@cardstack/boxel-cli 0.9.0 → 0.10.0-unstable.0
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/README.md +12 -0
- package/bundled-test-harness/assets/account-switch-failed-GCSVbJML.js +23 -0
- package/bundled-test-harness/assets/account-switch-failed-GsWni_Gk.css +18 -0
- package/bundled-test-harness/assets/account-switch-failed-test-CdZWNths.js +45 -0
- package/bundled-test-harness/assets/add-workspace-c7L50Gx8.js +141 -0
- package/bundled-test-harness/assets/add-workspace-test-BZxHa6Pe.js +72 -0
- package/bundled-test-harness/assets/advanced-color-picker-0pGF-3WG.js +504 -0
- package/bundled-test-harness/assets/advanced-color-picker-pbO4HWc_.js +2 -0
- package/bundled-test-harness/assets/ai-assistant-test-Dnm4o9vK.js +2211 -0
- package/bundled-test-harness/assets/ai-module-creation-test-C6253CMt.js +151 -0
- package/bundled-test-harness/assets/aibot-message-miKyGeKk.js +278 -0
- package/bundled-test-harness/assets/app-i8pGdQkw.js +22855 -0
- package/bundled-test-harness/assets/app-zC7o6PyQ.css +2718 -0
- package/bundled-test-harness/assets/audio-file-def-DHnydP0t.js +133 -0
- package/bundled-test-harness/assets/auth-container-BP2gSoo4.css +51 -0
- package/bundled-test-harness/assets/auth-container-DN94iVfX.js +24 -0
- package/bundled-test-harness/assets/avif-meta-extractor-Bo5zRX1V.js +162 -0
- package/bundled-test-harness/assets/base64-image-B0RYxzHT.js +2 -0
- package/bundled-test-harness/assets/base64-image-Bxjqdwew.js +262 -0
- package/bundled-test-harness/assets/big-integer-7RLj5_7H.js +89 -0
- package/bundled-test-harness/assets/big-integer-C9sJxKVy.js +2 -0
- package/bundled-test-harness/assets/binary-upload-dedupe-test-DZo3EaV0.js +308 -0
- package/bundled-test-harness/assets/boolean-CcKPYUph.js +94 -0
- package/bundled-test-harness/assets/boolean-DvsSmtM7.js +2 -0
- package/bundled-test-harness/assets/brand-functional-palette-KpVSY2Sa.js +137 -0
- package/bundled-test-harness/assets/brand-logo-DDiOec0t.js +295 -0
- package/bundled-test-harness/assets/broken-link-template-test-DAngUbFJ.js +192 -0
- package/bundled-test-harness/assets/bundled-base-C_lumba6.js +254 -0
- package/bundled-test-harness/assets/bundled-base-modules-test-CSF7Rl4Z.js +54 -0
- package/bundled-test-harness/assets/buried-stack-item-scroll-test-B0J_EP88.js +236 -0
- package/bundled-test-harness/assets/bxl-expression-test-Dej7WgI6.js +250 -0
- package/bundled-test-harness/assets/can-invoke-test-elyUcOKT.js +401 -0
- package/bundled-test-harness/assets/card-api-CjWXCkqh.js +8 -0
- package/bundled-test-harness/assets/card-api-Dzje0smT.js +4393 -0
- package/bundled-test-harness/assets/card-api-test-DA8d4Ooc.js +198 -0
- package/bundled-test-harness/assets/card-basics-test-mp1Odo-l.js +5364 -0
- package/bundled-test-harness/assets/card-chooser-paging-test-y8OfboYd.js +235 -0
- package/bundled-test-harness/assets/card-chooser-test-nmg2zkDj.js +393 -0
- package/bundled-test-harness/assets/card-collection-BXiO3i7R.js +118 -0
- package/bundled-test-harness/assets/card-context-search-results-Dbhn7lvW.js +30 -0
- package/bundled-test-harness/assets/card-context-search-results-test-DVXT-YC5.js +184 -0
- package/bundled-test-harness/assets/card-def-field-def-relationships-test-mX4rxrtO.js +562 -0
- package/bundled-test-harness/assets/card-delete-test-BxFsqFnX.js +466 -0
- package/bundled-test-harness/assets/card-error-C-7hjxu9.js +72 -0
- package/bundled-test-harness/assets/card-error-awaiting-index-test-BvfY2eaW.js +53 -0
- package/bundled-test-harness/assets/card-error-detail-nMwopDir.js +271 -0
- package/bundled-test-harness/assets/card-info-CTFxdohf.js +2 -0
- package/bundled-test-harness/assets/card-list-B9QrkJ97.js +2 -0
- package/bundled-test-harness/assets/card-list-XbwLCXZS.js +202 -0
- package/bundled-test-harness/assets/card-resource-JGLjQUy6.js +86 -0
- package/bundled-test-harness/assets/cards-grid-CWG41hZE.js +344 -0
- package/bundled-test-harness/assets/cards-grid-DSpX99p6.js +2 -0
- package/bundled-test-harness/assets/cards-grid-layout-Bht0LwZy.js +2 -0
- package/bundled-test-harness/assets/cards-grid-layout-CdpKlHUb.js +111 -0
- package/bundled-test-harness/assets/check-correctness-test-C4BrUeKA.js +554 -0
- package/bundled-test-harness/assets/clip-BEVvLrXx.js +2 -0
- package/bundled-test-harness/assets/clip-CoB714qX.js +92 -0
- package/bundled-test-harness/assets/code-ref-C2uguisI.js +2 -0
- package/bundled-test-harness/assets/code-ref-Cy7sV5a4.js +138 -0
- package/bundled-test-harness/assets/code-submode-availability-test-BsA_Ul01.js +198 -0
- package/bundled-test-harness/assets/code-submode-test-DkBhpEPB.js +1839 -0
- package/bundled-test-harness/assets/codeblocks-test-B1eZ2_JF.js +418 -0
- package/bundled-test-harness/assets/codemirror-editor-C6pxSm5y.js +2 -0
- package/bundled-test-harness/assets/codemirror-editor-DzM46Cd8.js +701 -0
- package/bundled-test-harness/assets/codemirror-embed-toolbar-test-BemP-ZdG.js +366 -0
- package/bundled-test-harness/assets/color-C-jGNFWZ.js +2 -0
- package/bundled-test-harness/assets/color-field-test-DPIRaBec.js +212 -0
- package/bundled-test-harness/assets/color-picker-field-Bv4IjS-d.js +139 -0
- package/bundled-test-harness/assets/color-picker-field-D1bYCQIg.js +2 -0
- package/bundled-test-harness/assets/color-wheel-picker-IIaCQplL.js +283 -0
- package/bundled-test-harness/assets/color-wheel-picker-Kw-UN3kV.js +2 -0
- package/bundled-test-harness/assets/color-zzCBneih.js +65 -0
- package/bundled-test-harness/assets/command-data-BMBtjT1E.js +95 -0
- package/bundled-test-harness/assets/command-data-BXC5Z0oA.js +2 -0
- package/bundled-test-harness/assets/compaction-test-CxUKnxlQ.js +150 -0
- package/bundled-test-harness/assets/components-Ct_agx0G.js +14294 -0
- package/bundled-test-harness/assets/computed-test-C-lpGQQ3.js +1320 -0
- package/bundled-test-harness/assets/container-BdPu8rvc.css +5565 -0
- package/bundled-test-harness/assets/container-Dj-5prh9.js +11288 -0
- package/bundled-test-harness/assets/contains-many-component-CAWqzX8W.js +2 -0
- package/bundled-test-harness/assets/contrast-checker-addon-BTLD7oMx.js +2 -0
- package/bundled-test-harness/assets/contrast-checker-addon-DBzizR04.js +71 -0
- package/bundled-test-harness/assets/convert-to-class-name-test-zZuKxYvF.js +17 -0
- package/bundled-test-harness/assets/coordinate-Bw8va6tO.js +48 -0
- package/bundled-test-harness/assets/copy-file-to-realm-test-DtCKPzqj.js +148 -0
- package/bundled-test-harness/assets/country-B_tWpLlO.js +199 -0
- package/bundled-test-harness/assets/create-file-modal-D-VPyEYp.js +570 -0
- package/bundled-test-harness/assets/create-listing-modal-test-hyLkQY0u.js +273 -0
- package/bundled-test-harness/assets/create-listing-pr-request-test-rjWFA_5S.js +117 -0
- package/bundled-test-harness/assets/create-spec-test-HKIxZGxK.js +256 -0
- package/bundled-test-harness/assets/create-specs-9-ELVyJP.js +215 -0
- package/bundled-test-harness/assets/create-submission-workflow-test-DNZrbRX8.js +132 -0
- package/bundled-test-harness/assets/credential-fields-test-xPEdA911.js +157 -0
- package/bundled-test-harness/assets/css-value-Du3HL39X.js +48 -0
- package/bundled-test-harness/assets/csv-file-def-EHRmilrp.js +277 -0
- package/bundled-test-harness/assets/currency-y6ZCHIqG.js +134 -0
- package/bundled-test-harness/assets/date-B27PrSFT.js +183 -0
- package/bundled-test-harness/assets/date-CiP5Eb9i.js +2 -0
- package/bundled-test-harness/assets/date-time-fields-test-Clf5vxRW.js +359 -0
- package/bundled-test-harness/assets/datetime-BEbR9YgU.js +201 -0
- package/bundled-test-harness/assets/datetime-DPnrt1wl.js +2 -0
- package/bundled-test-harness/assets/datetime-stamp-AuT7F7qn.js +2 -0
- package/bundled-test-harness/assets/datetime-stamp-CGwP2P3f.js +81 -0
- package/bundled-test-harness/assets/day-BFLxZ9bQ.js +2 -0
- package/bundled-test-harness/assets/day-CQoEkqgE.js +113 -0
- package/bundled-test-harness/assets/debug-message-test-CzgOpfcI.js +117 -0
- package/bundled-test-harness/assets/dist-B-fYvxfL.js +389 -0
- package/bundled-test-harness/assets/dist-C2IXvIKX.js +323 -0
- package/bundled-test-harness/assets/dist-CdNZu43l.js +1710 -0
- package/bundled-test-harness/assets/docx-file-def-BQMw460_.js +60 -0
- package/bundled-test-harness/assets/docx-meta-extractor-DBlmH_kV.js +60 -0
- package/bundled-test-harness/assets/docx-meta-extractor-Dw4gZ0ae.js +2 -0
- package/bundled-test-harness/assets/duration-B0SnEiw1.js +184 -0
- package/bundled-test-harness/assets/duration-DbjJTFeA.js +2 -0
- package/bundled-test-harness/assets/email-C-8cyWiQ.js +80 -0
- package/bundled-test-harness/assets/email-field-test-BOBmvQqx.js +75 -0
- package/bundled-test-harness/assets/email-xUgCst-p.js +2 -0
- package/bundled-test-harness/assets/enum-BWiCyJlu.js +167 -0
- package/bundled-test-harness/assets/enum-CzYjivhO.js +2 -0
- package/bundled-test-harness/assets/enum-field-test-Bea9EsQR.js +953 -0
- package/bundled-test-harness/assets/error-display-test-Cbl2D_0c.js +343 -0
- package/bundled-test-harness/assets/ethereum-address-Bw_J05bD.js +78 -0
- package/bundled-test-harness/assets/ethereum-address-C9wHMBt3.js +2 -0
- package/bundled-test-harness/assets/expiration-warning-BHcJEjZt.js +90 -0
- package/bundled-test-harness/assets/expiration-warning-_G8SKZd0.js +2 -0
- package/bundled-test-harness/assets/externals-CKblKBo1.js +4393 -0
- package/bundled-test-harness/assets/fallback-banner-BqCrvTDt.js +24 -0
- package/bundled-test-harness/assets/fallback-banner-live-delete-test-D_AYMvf6.js +207 -0
- package/bundled-test-harness/assets/fallback-banner-test-B8Ne9a5g.js +225 -0
- package/bundled-test-harness/assets/fallback-banner-test-C7oaSxd1.js +53 -0
- package/bundled-test-harness/assets/fallback-models-test-DY-PvU9k.js +161 -0
- package/bundled-test-harness/assets/field-component-Bj8YthPE.js +2 -0
- package/bundled-test-harness/assets/field-configuration-test-B5LztQ47.js +548 -0
- package/bundled-test-harness/assets/field-edit-Cx_haspD.js +36 -0
- package/bundled-test-harness/assets/field-edit-DQZWUz3F.js +2 -0
- package/bundled-test-harness/assets/field-markdown-domain-test-DnqK3CrE.js +616 -0
- package/bundled-test-harness/assets/field-markdown-oversize-test-BEpbXIvl.js +88 -0
- package/bundled-test-harness/assets/field-markdown-primitives-test-BDORWoOk.js +365 -0
- package/bundled-test-harness/assets/field-markdown-specialized-test-BmIzadYq.js +534 -0
- package/bundled-test-harness/assets/field-test-helpers-CRF9-jFw.js +45 -0
- package/bundled-test-harness/assets/file-api-DPMJghBY.js +7 -0
- package/bundled-test-harness/assets/file-attachment-test-DFLXg3xV.js +796 -0
- package/bundled-test-harness/assets/file-chooser-panel-test-B4DzCWkt.js +153 -0
- package/bundled-test-harness/assets/file-chooser-test-DpjOWgpB.js +504 -0
- package/bundled-test-harness/assets/file-def-edit-Bstl7Kkl.js +2 -0
- package/bundled-test-harness/assets/file-def-edit-C1dzJxmQ.js +26 -0
- package/bundled-test-harness/assets/file-def-embedded-CUy4G7Vc.js +2 -0
- package/bundled-test-harness/assets/file-def-embedded-DJs6P5t0.js +38 -0
- package/bundled-test-harness/assets/file-def-fitted-BlrBFfLh.js +38 -0
- package/bundled-test-harness/assets/file-def-fitted-Bo5Qfkyf.js +2 -0
- package/bundled-test-harness/assets/file-def-isolated-BsHydanv.js +38 -0
- package/bundled-test-harness/assets/file-def-isolated-Dp-Lc99-.js +2 -0
- package/bundled-test-harness/assets/file-def-serialization-test-CISKpt_o.js +89 -0
- package/bundled-test-harness/assets/file-menu-items-7_ltrFZq.js +117 -0
- package/bundled-test-harness/assets/file-menu-items-BnRG9ydE.js +2 -0
- package/bundled-test-harness/assets/file-preview-stage-CV3qZpiK.js +72 -0
- package/bundled-test-harness/assets/file-preview-stage-DTA5X8rX.js +2 -0
- package/bundled-test-harness/assets/file-shell-embedded-BpmiVzIG.js +2 -0
- package/bundled-test-harness/assets/file-shell-embedded-CEv0-6OE.js +68 -0
- package/bundled-test-harness/assets/file-shell-fitted-C6k3GnMc.js +2 -0
- package/bundled-test-harness/assets/file-shell-fitted-iSTg3PJa.js +98 -0
- package/bundled-test-harness/assets/file-shell-isolated-C-pEod2J.js +195 -0
- package/bundled-test-harness/assets/file-shell-isolated-DI9oU7ix.js +2 -0
- package/bundled-test-harness/assets/file-tree-from-index-BtOOMqnb.js +151 -0
- package/bundled-test-harness/assets/file-tree-from-index-test-T8w3hPw_.js +96 -0
- package/bundled-test-harness/assets/film-5n9_gRqZ.js +4074 -0
- package/bundled-test-harness/assets/film-Ca2Vzlfu.js +13 -0
- package/bundled-test-harness/assets/film-DEvhBbBu.js +2 -0
- package/bundled-test-harness/assets/fitted-6OGuHgoU.js +2 -0
- package/bundled-test-harness/assets/fitted-B2l1jlSp.js +34 -0
- package/bundled-test-harness/assets/flac-meta-extractor-BoJqvmDC.js +99 -0
- package/bundled-test-harness/assets/font-file-def-Czzt5paT.js +64 -0
- package/bundled-test-harness/assets/font-meta-extractor-DQYT_e5b.js +2 -0
- package/bundled-test-harness/assets/font-meta-extractor-IHD-pG8V.js +303 -0
- package/bundled-test-harness/assets/formatted-aibot-message-test-Djsl8RzE.js +109 -0
- package/bundled-test-harness/assets/from-elsewhere-BXcLYxxu.js +131 -0
- package/bundled-test-harness/assets/frontmatter-field-CciolgL3.js +41 -0
- package/bundled-test-harness/assets/garbage-collection-test-BTOLAfB6.js +403 -0
- package/bundled-test-harness/assets/gauge-C1loqGq3.js +2 -0
- package/bundled-test-harness/assets/gauge-u8dxl90d.js +106 -0
- package/bundled-test-harness/assets/general-test-Cd5WtVvd.js +926 -0
- package/bundled-test-harness/assets/get-relationship-membership-state-test-DJAuhOVM.js +1308 -0
- package/bundled-test-harness/assets/gif-meta-extractor-tSaPtuYW.js +114 -0
- package/bundled-test-harness/assets/glimmer-motion-and-choreo-in-cards-test-DNSy5l59.js +160 -0
- package/bundled-test-harness/assets/glimmer-motion-and-choreo-test-B6BbQxYq.js +74 -0
- package/bundled-test-harness/assets/helper-m6jA5HmU.js +478 -0
- package/bundled-test-harness/assets/host-submode-test-CsgdksBi.js +1243 -0
- package/bundled-test-harness/assets/html-file-def-yKtdMSa-.js +82 -0
- package/bundled-test-harness/assets/hydratable-card-CxNfbqly.js +147 -0
- package/bundled-test-harness/assets/hydratable-card-test-NJ4CI4ey.js +426 -0
- package/bundled-test-harness/assets/icons-B3SAtRoj.js +894 -0
- package/bundled-test-harness/assets/image-file-def-B0rpS3Yy.js +3 -0
- package/bundled-test-harness/assets/image-file-def-DUFmjNL8.js +65 -0
- package/bundled-test-harness/assets/image-olOUqgMQ.js +47 -0
- package/bundled-test-harness/assets/index-changes-test-D7OE-99k.js +367 -0
- package/bundled-test-harness/assets/index-query-engine-test-BBKqgSmg.js +2593 -0
- package/bundled-test-harness/assets/inspector-test-DV6Ms2uz.js +1930 -0
- package/bundled-test-harness/assets/instance-filter-matcher-test-Bs4kf7E8.js +788 -0
- package/bundled-test-harness/assets/interact-submode-creation-and-permissions-test-DIfgRhIN.js +475 -0
- package/bundled-test-harness/assets/interact-submode-setup-D4M_e580.js +566 -0
- package/bundled-test-harness/assets/is-component-declaration-test-jPGRTVh1.js +50 -0
- package/bundled-test-harness/assets/iso-bmff-DHtkSbQM.js +205 -0
- package/bundled-test-harness/assets/iso-bmff-zmOHoSVg.js +2 -0
- package/bundled-test-harness/assets/isolated-and-edit-BAnwcK1T.js +2 -0
- package/bundled-test-harness/assets/job-priority-header-test-7j2f3Dtl.js +81 -0
- package/bundled-test-harness/assets/job-scoped-instance-residency-test-DPzVQUL3.js +103 -0
- package/bundled-test-harness/assets/join-the-community-Ft5fjeIA.js +86 -0
- package/bundled-test-harness/assets/jpg-meta-extractor-Dsq6rZ8F.js +88 -0
- package/bundled-test-harness/assets/json-field-CxOZvp3k.js +19 -0
- package/bundled-test-harness/assets/json-field-ojdwGD6T.js +2 -0
- package/bundled-test-harness/assets/json-file-def-Da_5-zSM.js +298 -0
- package/bundled-test-harness/assets/last-modified-date-BnyJsc04.js +43 -0
- package/bundled-test-harness/assets/last-modified-date-test-DFl2mo1B.js +28 -0
- package/bundled-test-harness/assets/links-to-editor-DO24-71w.js +2 -0
- package/bundled-test-harness/assets/links-to-many-component-C7DabwAY.js +2 -0
- package/bundled-test-harness/assets/linksto-broken-link-placeholder-test-D4lDhvnQ.js +398 -0
- package/bundled-test-harness/assets/linksto-error-sentinel-test-oWgDz00K.js +238 -0
- package/bundled-test-harness/assets/linksto-many-broken-link-placeholder-test-CpSl7zJ7.js +354 -0
- package/bundled-test-harness/assets/linksto-many-per-slot-access-test-DJY3J8Xl.js +303 -0
- package/bundled-test-harness/assets/linksto-sentinel-reload-test-BxzfoONe.js +197 -0
- package/bundled-test-harness/assets/linksto-sentinel-roundtrip-test-DyE99km_.js +260 -0
- package/bundled-test-harness/assets/linksto-singular-js-access-contract-test-dcWAAgxt.js +196 -0
- package/bundled-test-harness/assets/llm-model-DrswiczZ.js +64 -0
- package/bundled-test-harness/assets/login-C-EIG0-Q.css +543 -0
- package/bundled-test-harness/assets/login-CNeL-9IC.js +408 -0
- package/bundled-test-harness/assets/login-error-text-test-CEH2tjNP.js +51 -0
- package/bundled-test-harness/assets/login-test-BpMx7qwV.js +246 -0
- package/bundled-test-harness/assets/m4a-meta-extractor-BJkMHUIK.js +204 -0
- package/bundled-test-harness/assets/main-BaUgfpPE.js +5 -0
- package/bundled-test-harness/assets/markdown-ByEGbwov.js +7 -0
- package/bundled-test-harness/assets/markdown-KJzgTg-A.js +2 -0
- package/bundled-test-harness/assets/markdown-editor-mode-select-BUGPXaSE.js +2 -0
- package/bundled-test-harness/assets/markdown-editor-mode-select-DBk8dG0O.js +54 -0
- package/bundled-test-harness/assets/markdown-embed-chooser-modal-test-BIlEmna9.js +470 -0
- package/bundled-test-harness/assets/markdown-embed-preview-pane-test-B6rscKpk.js +447 -0
- package/bundled-test-harness/assets/markdown-embed-preview-test-CTQw1wq-.js +368 -0
- package/bundled-test-harness/assets/markdown-fallback-BVsco6gJ.js +2 -0
- package/bundled-test-harness/assets/markdown-fallback-test-C_CIFEzH.js +316 -0
- package/bundled-test-harness/assets/markdown-highlighting-test-D6YvywF5.js +244 -0
- package/bundled-test-harness/assets/markdown-preview-1TSMSUv0.js +64 -0
- package/bundled-test-harness/assets/markdown-preview-jbuUjLoD.js +72 -0
- package/bundled-test-harness/assets/markdown-preview-test-zuU5uoA_.js +238 -0
- package/bundled-test-harness/assets/markdown-skill-frontmatter-test-CoicGRkb.js +146 -0
- package/bundled-test-harness/assets/menu-items-DZ_uOoYu.js +2 -0
- package/bundled-test-harness/assets/message-tool-test-K6LgTq5d.js +33 -0
- package/bundled-test-harness/assets/metadata-fields-WiOuUCDl.js +1415 -0
- package/bundled-test-harness/assets/metadata-fields-iu5AfQp3.js +2 -0
- package/bundled-test-harness/assets/midi-audio-def-CD2-4Wjx.js +52 -0
- package/bundled-test-harness/assets/midi-meta-extractor-CE3sLiEV.js +284 -0
- package/bundled-test-harness/assets/midi-meta-extractor-O7c8LHYV.js +2 -0
- package/bundled-test-harness/assets/migrate-skill-test-Beh-AeSN.js +161 -0
- package/bundled-test-harness/assets/mini-BNXINKKF.js +85 -0
- package/bundled-test-harness/assets/mini-C43Q4BWp.js +1519 -0
- package/bundled-test-harness/assets/mini-card-chooser-test-B1GMp-31.js +272 -0
- package/bundled-test-harness/assets/mini-file-chooser-test-CbI1vrQn.js +201 -0
- package/bundled-test-harness/assets/missing-template-BPhJRbDs.js +48 -0
- package/bundled-test-harness/assets/missing-template-DP-Pi-HQ.js +2 -0
- package/bundled-test-harness/assets/modal-KpPz2f8x.js +322 -0
- package/bundled-test-harness/assets/modal-container-0Efz_h2z.js +40 -0
- package/bundled-test-harness/assets/model-cost-tier-test-D-5VSjh6.js +173 -0
- package/bundled-test-harness/assets/module-contents-service-BRkTETb6.js +256 -0
- package/bundled-test-harness/assets/moment-Cln59YUK.js +3474 -0
- package/bundled-test-harness/assets/monaco-AbHCoDJY.js +143 -0
- package/bundled-test-harness/assets/monaco-test-DCPi18sy.js +100 -0
- package/bundled-test-harness/assets/monaco-test-waiter-lvFEYpFj.js +190 -0
- package/bundled-test-harness/assets/month-1eUIsvWN.js +2 -0
- package/bundled-test-harness/assets/month-BeUdWMWQ.js +123 -0
- package/bundled-test-harness/assets/month-day-Bbsd8YbR.js +192 -0
- package/bundled-test-harness/assets/month-day-Dks5STJu.js +2 -0
- package/bundled-test-harness/assets/month-year-pL_rpUhX.js +2 -0
- package/bundled-test-harness/assets/month-year-wH_YnYgL.js +93 -0
- package/bundled-test-harness/assets/mp3-meta-extractor-C3u34UHM.js +476 -0
- package/bundled-test-harness/assets/mp4-meta-extractor-Bj3F7dxs.js +188 -0
- package/bundled-test-harness/assets/multiple-stacks-test-mkNdTUMI.js +208 -0
- package/bundled-test-harness/assets/nested-query-field-render-test-BQLn3wg9.js +249 -0
- package/bundled-test-harness/assets/no-stacks-test-DpwZQAJ-.js +48 -0
- package/bundled-test-harness/assets/number-DZa-fHpu.js +151 -0
- package/bundled-test-harness/assets/number-Dvua76YP.js +3 -0
- package/bundled-test-harness/assets/number-field-test-BiaH2eaB.js +184 -0
- package/bundled-test-harness/assets/number-input-D5nDYDkK.js +82 -0
- package/bundled-test-harness/assets/office-extract-JzYva33g.js +27 -0
- package/bundled-test-harness/assets/office-extract-XMpsyYRh.js +2 -0
- package/bundled-test-harness/assets/ogg-meta-extractor-DJosZ9LA.js +225 -0
- package/bundled-test-harness/assets/on-key-BBVkS8Bi.js +472 -0
- package/bundled-test-harness/assets/ooxml-BlAE2w4d.js +172 -0
- package/bundled-test-harness/assets/ooxml-D-p8OmuM.js +2 -0
- package/bundled-test-harness/assets/open-image-in-new-tab-test-DWBU5pw9.js +52 -0
- package/bundled-test-harness/assets/operation-lowering-test-nzqprueU.js +2812 -0
- package/bundled-test-harness/assets/operations-CPvfTuY3.js +766 -0
- package/bundled-test-harness/assets/operations-invocation-test-C75T6zn3.js +523 -0
- package/bundled-test-harness/assets/operations-query-test-BoCszQEW.js +459 -0
- package/bundled-test-harness/assets/operations-test-79ipSnpM.js +2518 -0
- package/bundled-test-harness/assets/operations-x3Aw2Nky.js +3 -0
- package/bundled-test-harness/assets/operator-mode-acceptance-test-jjsYtt96.js +1188 -0
- package/bundled-test-harness/assets/operator-mode-card-chooser-test-hZP9gEQK.js +1036 -0
- package/bundled-test-harness/assets/operator-mode-links-test-DN16SuIx.js +793 -0
- package/bundled-test-harness/assets/operator-mode-state-service-gwiTSiWX.js +1275 -0
- package/bundled-test-harness/assets/operator-mode-state-service-test-Dt2qnKKP.js +206 -0
- package/bundled-test-harness/assets/operator-mode-test-BZnnxO9q.js +683 -0
- package/bundled-test-harness/assets/operator-mode-ui-test-O--qEo-y.js +1027 -0
- package/bundled-test-harness/assets/overlay-menu-items-test-Bl2k0aAa.js +317 -0
- package/bundled-test-harness/assets/overlays-CdN_JokA.js +270 -0
- package/bundled-test-harness/assets/overlays-clip-test-DpbR1ZTz.js +91 -0
- package/bundled-test-harness/assets/overlays-detached-element-test-cLgEGvMs.js +56 -0
- package/bundled-test-harness/assets/pane-PYdezM7g.js +330 -0
- package/bundled-test-harness/assets/panel-7FDqkxrr.js +474 -0
- package/bundled-test-harness/assets/panel-C3E0s49q.js +3540 -0
- package/bundled-test-harness/assets/past-sessions-test-BsjEeoze.js +321 -0
- package/bundled-test-harness/assets/patch-fields-test-CsixJmSr.js +1014 -0
- package/bundled-test-harness/assets/patch-instance-test-CBDgTi0L.js +348 -0
- package/bundled-test-harness/assets/pdf-file-def-9VNjnqDa.js +76 -0
- package/bundled-test-harness/assets/pdf-meta-extractor-BF4e5kMR.js +156 -0
- package/bundled-test-harness/assets/pdf-meta-extractor-D8Bxh2cc.js +2 -0
- package/bundled-test-harness/assets/pdf-viewer-Bu413sN8.js +112 -0
- package/bundled-test-harness/assets/pdf-viewer-GKDi_xmf.js +2 -0
- package/bundled-test-harness/assets/percentage-TOr6qK2T.js +84 -0
- package/bundled-test-harness/assets/permission-checking-realm-test-BRNVYszm.js +306 -0
- package/bundled-test-harness/assets/phone-number-D5SR8nWu.js +236 -0
- package/bundled-test-harness/assets/phone-number-field-test-DffwtqGd.js +73 -0
- package/bundled-test-harness/assets/phone-number-hf_xIVGQ.js +2 -0
- package/bundled-test-harness/assets/plate-Vojc88hM.js +41 -0
- package/bundled-test-harness/assets/plate-dTUzEMj5.js +2 -0
- package/bundled-test-harness/assets/player-CmRw0uM5.js +82 -0
- package/bundled-test-harness/assets/player-Dt85lPZl.js +2 -0
- package/bundled-test-harness/assets/plural-field-components-test-DNpGuH1D.js +198 -0
- package/bundled-test-harness/assets/png-image-def-GY7gjqya.js +48 -0
- package/bundled-test-harness/assets/png-meta-extractor-4pI611re.js +2 -0
- package/bundled-test-harness/assets/png-meta-extractor-CHp_rpAi.js +111 -0
- package/bundled-test-harness/assets/policy-scoped-search-test-CipPu7tY.js +339 -0
- package/bundled-test-harness/assets/pptx-file-def-lBBiebvn.js +60 -0
- package/bundled-test-harness/assets/pptx-meta-extractor-BjJYWiOJ.js +77 -0
- package/bundled-test-harness/assets/pptx-meta-extractor-DbT-dPRg.js +2 -0
- package/bundled-test-harness/assets/prerender-persistence-block-test-ClHMVvJt.js +124 -0
- package/bundled-test-harness/assets/prerender-serialize-cycle-test-LdqaMTK8.js +134 -0
- package/bundled-test-harness/assets/preview-CYlam_aW.js +74 -0
- package/bundled-test-harness/assets/preview-format-CiSo4kEa.js +41 -0
- package/bundled-test-harness/assets/preview-format-test-MsB1TOLB.js +103 -0
- package/bundled-test-harness/assets/process-card-B3xBGkv1.js +2 -0
- package/bundled-test-harness/assets/process-card-DumVcx9E.js +114 -0
- package/bundled-test-harness/assets/process-card-test-C44H8yVy.js +94 -0
- package/bundled-test-harness/assets/profile-settings-modal-ipYzrVTz.js +708 -0
- package/bundled-test-harness/assets/progress-circle-DJ6WSO2E.js +95 -0
- package/bundled-test-harness/assets/progress-circle-q358_9Sn.js +2 -0
- package/bundled-test-harness/assets/quarter-BjO5DlU2.js +2 -0
- package/bundled-test-harness/assets/quarter-_D72FwfS.js +168 -0
- package/bundled-test-harness/assets/query-field-membership-status-test-CzDyfK49.js +323 -0
- package/bundled-test-harness/assets/query-field-page-optin-test-B-x3vsmC.js +126 -0
- package/bundled-test-harness/assets/query-field-schema-test-DFw6KuYv.js +231 -0
- package/bundled-test-harness/assets/query-field-stale-prerender-test-DSQ-cv_O.js +152 -0
- package/bundled-test-harness/assets/query-fields-test-DQiMFRCe.js +535 -0
- package/bundled-test-harness/assets/rail-CNspDFyn.js +44 -0
- package/bundled-test-harness/assets/rail-D2YcQ0VP.js +2 -0
- package/bundled-test-harness/assets/realm-82Z5RUM_.js +95 -0
- package/bundled-test-harness/assets/realm-config-SgrwqjRu.js +844 -0
- package/bundled-test-harness/assets/realm-config-policy-standing-test-C6sQNk2u.js +290 -0
- package/bundled-test-harness/assets/realm-config-routing-rule-edit-test-DcYXBlvi.js +274 -0
- package/bundled-test-harness/assets/realm-config-settings-test-DblJv06X.js +187 -0
- package/bundled-test-harness/assets/realm-dropdown-CDvL8k3B.js +560 -0
- package/bundled-test-harness/assets/realm-et890flh.js +2 -0
- package/bundled-test-harness/assets/realm-field-test-pBK_x-Xw.js +100 -0
- package/bundled-test-harness/assets/realm-indexing-test-DSFn2F8F.js +4380 -0
- package/bundled-test-harness/assets/realm-policy-test-DYnLqzTS.js +1141 -0
- package/bundled-test-harness/assets/realm-test-DOZT2EG5.js +2363 -0
- package/bundled-test-harness/assets/realm-url-tooltip-qaXTjRb-.js +56 -0
- package/bundled-test-harness/assets/realm-url-tooltip-test-DGTEeLH9.js +78 -0
- package/bundled-test-harness/assets/reasoning-test-BRkhvYjr.js +234 -0
- package/bundled-test-harness/assets/recent-colors-addon-BreXcpg8.js +2 -0
- package/bundled-test-harness/assets/recent-colors-addon-CmCkbJ2_.js +61 -0
- package/bundled-test-harness/assets/relationship-loading-state-test-B6UGYKzG.js +290 -0
- package/bundled-test-harness/assets/relative-time-BjHvL023.js +2 -0
- package/bundled-test-harness/assets/relative-time-ChYKOMIM.js +129 -0
- package/bundled-test-harness/assets/remix-card-test-CpV0kKfq.js +58 -0
- package/bundled-test-harness/assets/rendered-markdown-CJa7IzCC.js +263 -0
- package/bundled-test-harness/assets/rendered-markdown-test-CVKsHS4P.js +587 -0
- package/bundled-test-harness/assets/resident-instance-reuse-test-jQfW1NMn.js +82 -0
- package/bundled-test-harness/assets/response-field-B2-daCl2.js +38 -0
- package/bundled-test-harness/assets/result-tile-BSg4mzbc.js +140 -0
- package/bundled-test-harness/assets/rich-markdown-BtP1yamM.js +2 -0
- package/bundled-test-harness/assets/rich-markdown-C6rQUngb.js +218 -0
- package/bundled-test-harness/assets/rich-markdown-field-test-9yB6ykCe.js +1647 -0
- package/bundled-test-harness/assets/room-C7tKd02X.js +1008 -0
- package/bundled-test-harness/assets/room-message-test-DsMmRYpV.js +445 -0
- package/bundled-test-harness/assets/room-test-golI1H61.js +95 -0
- package/bundled-test-harness/assets/run-realm-code-CbXk6bnK.js +1600 -0
- package/bundled-test-harness/assets/run-realm-code-test-B9JeesaW.js +2468 -0
- package/bundled-test-harness/assets/schema-generation-test-uLLGm5Vh.js +28 -0
- package/bundled-test-harness/assets/score-BQhCQdUP.js +2 -0
- package/bundled-test-harness/assets/score-CoWEzENH.js +100 -0
- package/bundled-test-harness/assets/scrolling-test-WHWEkKeZ.js +384 -0
- package/bundled-test-harness/assets/search-BkQYpQDY.js +605 -0
- package/bundled-test-harness/assets/search-adorn-test-CW92JPOk.js +136 -0
- package/bundled-test-harness/assets/search-entries-BU4w6Ymc.js +472 -0
- package/bundled-test-harness/assets/search-entries-result-test-9eydsDtD.js +234 -0
- package/bundled-test-harness/assets/search-entries-test-ByUREx0G.js +1486 -0
- package/bundled-test-harness/assets/search-result-header-UFkdo0Bx.js +128 -0
- package/bundled-test-harness/assets/search-results-DrHTuVRZ.js +266 -0
- package/bundled-test-harness/assets/search-results-test-krtQQM57.js +578 -0
- package/bundled-test-harness/assets/search-selection-menu-test-DoqSbez7.js +108 -0
- package/bundled-test-harness/assets/search-sheet-persistence-test-4ZPaEY-y.js +131 -0
- package/bundled-test-harness/assets/search-test-BYpq32RM.js +2241 -0
- package/bundled-test-harness/assets/searchable-BXw4T11q.js +192 -0
- package/bundled-test-harness/assets/searchable-CVvPDA3Q.js +2 -0
- package/bundled-test-harness/assets/searchable-option-test-BhLFI4ei.js +322 -0
- package/bundled-test-harness/assets/searchable-search-doc-test-DrNLCF73.js +1271 -0
- package/bundled-test-harness/assets/secure-sign-in-VNQhe0ae.js +130 -0
- package/bundled-test-harness/assets/secure-sign-in-Za8PX9cD.css +24 -0
- package/bundled-test-harness/assets/secure-sign-in-aunWHCrB.js +73 -0
- package/bundled-test-harness/assets/secure-sign-in-test-BcY1TcNd.js +32 -0
- package/bundled-test-harness/assets/secure-sign-in-test-DRdz89BT.js +245 -0
- package/bundled-test-harness/assets/sending-test-mbHpGZUu.js +576 -0
- package/bundled-test-harness/assets/serialization-rri-form-audit-test-nypV9J82.js +136 -0
- package/bundled-test-harness/assets/serialization-test-aLwrFv4d.js +8758 -0
- package/bundled-test-harness/assets/setup-Dgn0s6Zk.js +772 -0
- package/bundled-test-harness/assets/shared-link-target-reuse-test-D9MR2UNc.js +207 -0
- package/bundled-test-harness/assets/show-card-Dwfk332M.js +67 -0
- package/bundled-test-harness/assets/show-card-test-CRPwwJvc.js +365 -0
- package/bundled-test-harness/assets/show-file-DLdFPHMR.js +34 -0
- package/bundled-test-harness/assets/signed-capture-DUR9PohQ.js +204 -0
- package/bundled-test-harness/assets/signed-capture-link-test-DfTAB6OT.js +132 -0
- package/bundled-test-harness/assets/single-stack-test-Crr_8nti.js +652 -0
- package/bundled-test-harness/assets/skill-DQ00VonZ.js +3 -0
- package/bundled-test-harness/assets/skill-reference-LEitQV9i.js +112 -0
- package/bundled-test-harness/assets/skill-yZXS1VHQ.js +76 -0
- package/bundled-test-harness/assets/skills-test-D3-C-Dbm.js +648 -0
- package/bundled-test-harness/assets/slider-picker-B6AxKL2j.js +245 -0
- package/bundled-test-harness/assets/slider-picker-C4Tc5o-s.js +2 -0
- package/bundled-test-harness/assets/spec-Cl_LB6nC.js +602 -0
- package/bundled-test-harness/assets/spinner-BHFM7zcR.js +39 -0
- package/bundled-test-harness/assets/spinner-DvAvsyDT.css +21 -0
- package/bundled-test-harness/assets/store-BV6WX8oV.js +2205 -0
- package/bundled-test-harness/assets/store-module-rebuild-test-HyphFJiF.js +454 -0
- package/bundled-test-harness/assets/store-search-test-nUeJ5opb.js +175 -0
- package/bundled-test-harness/assets/store-test-BebUIJAg.js +3460 -0
- package/bundled-test-harness/assets/string-BHZZwNlZ.js +9 -0
- package/bundled-test-harness/assets/submode-switcher-D-U9cXo0.js +169 -0
- package/bundled-test-harness/assets/svg-meta-extractor-BsG4w2nX.js +42 -0
- package/bundled-test-harness/assets/swatches-picker-4vFztxHo.js +33 -0
- package/bundled-test-harness/assets/swatches-picker-C7RE7uJ8.js +2 -0
- package/bundled-test-harness/assets/switch-submode-CuA0Zfjn.js +79 -0
- package/bundled-test-harness/assets/switch-submode-test-i1Qic_Cp.js +168 -0
- package/bundled-test-harness/assets/tag-CZNs3DPN.js +105 -0
- package/bundled-test-harness/assets/tests-BneuP252.js +3523 -0
- package/bundled-test-harness/assets/text-area-DAShQQBe.js +9 -0
- package/bundled-test-harness/assets/text-file-def-D2Rs6nS1.js +151 -0
- package/bundled-test-harness/assets/text-input-validator-test-C9IG-1GZ.js +156 -0
- package/bundled-test-harness/assets/theme-Dm8LWaRK.js +9 -0
- package/bundled-test-harness/assets/theme-card-test-Cbb6tAap.js +621 -0
- package/bundled-test-harness/assets/theme-scheme-island-test-DOVLakx3.js +264 -0
- package/bundled-test-harness/assets/three-d-model-def-DWSPQGgD.js +70 -0
- package/bundled-test-harness/assets/time--_Txqya1.js +126 -0
- package/bundled-test-harness/assets/time-DKD7Bdjd.js +2 -0
- package/bundled-test-harness/assets/time-slots-BZaugjq_.js +2 -0
- package/bundled-test-harness/assets/time-slots-C85M0rWl.js +85 -0
- package/bundled-test-harness/assets/timeline-B3KGDm3M.js +2 -0
- package/bundled-test-harness/assets/timeline-BMwgaZZu.js +59 -0
- package/bundled-test-harness/assets/to-device-streaming-test-CMp5bFiz.js +163 -0
- package/bundled-test-harness/assets/token-usage-test-CXA0b8Ep.js +166 -0
- package/bundled-test-harness/assets/tool-field-BGLelnsr.js +94 -0
- package/bundled-test-harness/assets/tool-field-BOFuDDt3.js +2 -0
- package/bundled-test-harness/assets/tools-CTjy7Aub.js +725 -0
- package/bundled-test-harness/assets/tools-calling-test--JR-7AK7.js +200 -0
- package/bundled-test-harness/assets/tools-test-6yAW3W5I.js +2820 -0
- package/bundled-test-harness/assets/tools-test-DhpMUQkz.js +1624 -0
- package/bundled-test-harness/assets/ts-file-def-CDbf8aw2.js +159 -0
- package/bundled-test-harness/assets/update-room-skills-test-DoKsS_1C.js +240 -0
- package/bundled-test-harness/assets/url-D0ooeJxC.js +2 -0
- package/bundled-test-harness/assets/url-mFskVPSX.js +96 -0
- package/bundled-test-harness/assets/video-file-def-AcmWqzev.js +76 -0
- package/bundled-test-harness/assets/wav-meta-extractor-CbTLruQf.js +368 -0
- package/bundled-test-harness/assets/webm-meta-extractor-C9JH-CMX.js +178 -0
- package/bundled-test-harness/assets/webp-meta-extractor-C6sHm4J7.js +98 -0
- package/bundled-test-harness/assets/website-Bxuk_OmR.js +92 -0
- package/bundled-test-harness/assets/week-Bxssxce7.js +2 -0
- package/bundled-test-harness/assets/week-DQLj9974.js +111 -0
- package/bundled-test-harness/assets/welcome-to-boxel-BH82RsW5.js +172 -0
- package/bundled-test-harness/assets/workspace-DJ_s2x4g.js +614 -0
- package/bundled-test-harness/assets/workspace-a11y-test-BJbZNgoP.js +197 -0
- package/bundled-test-harness/assets/workspace-behavior-test-BLBARTfb.js +200 -0
- package/bundled-test-harness/assets/workspace-chooser-BpmlVrVn.js +2219 -0
- package/bundled-test-harness/assets/workspace-chooser-CqLR2Dzh.css +1296 -0
- package/bundled-test-harness/assets/workspace-chooser-catalog-order-test-CmAVNAWC.js +36 -0
- package/bundled-test-harness/assets/workspace-chooser-unreachable-notice-test-DEfG7Uh9.js +60 -0
- package/bundled-test-harness/assets/workspace-delete-multiple-test-DE7Z8ooj.js +212 -0
- package/bundled-test-harness/assets/workspace-delete-summary-test-CwtG_zLH.js +63 -0
- package/bundled-test-harness/assets/workspace-timestamp-labels-test-DFAaRmJW.js +58 -0
- package/bundled-test-harness/assets/xlsx-file-def-DcvaRYnZ.js +60 -0
- package/bundled-test-harness/assets/xlsx-meta-extractor-0RlViVaf.js +101 -0
- package/bundled-test-harness/assets/xlsx-meta-extractor-BH30Vuem.js +2 -0
- package/bundled-test-harness/assets/year-B_MBk_hE.js +78 -0
- package/bundled-test-harness/assets/year-hSpccI9L.js +2 -0
- package/bundled-test-harness/assets/zip-file-def-c84iddi9.js +288 -0
- package/bundled-test-harness/index.html +78 -68
- package/bundled-test-harness/tests/index.html +78 -68
- package/bundled-types/host-app/components/matrix/account-switch-failed.gts +2 -2
- package/bundled-types/host-app/components/matrix/auth.gts +2 -2
- package/bundled-types/host-app/components/matrix/cli-auth.gts +7 -6
- package/bundled-types/host-app/components/matrix/forgot-password.gts +43 -129
- package/bundled-types/host-app/components/matrix/login.gts +15 -118
- package/bundled-types/host-app/components/matrix/register-user.gts +45 -226
- package/bundled-types/host-app/components/matrix/secure-sign-in.gts +235 -0
- package/bundled-types/host-app/components/operator-mode/container.gts +13 -1
- package/bundled-types/host-app/components/operator-mode/profile-info-popover.gts +1 -1
- package/bundled-types/host-app/config/environment.ts +1 -1
- package/bundled-types/host-app/lib/secure-sign-in.ts +130 -0
- package/bundled-types/host-app/services/matrix-service.ts +46 -0
- package/bundled-types/host-app/services/monaco-service.ts +0 -5
- package/bundled-types/host-app/utils/login-token.ts +23 -10
- package/dist/api.js +1 -1
- package/dist/index.js +289 -285
- package/package.json +1 -1
- package/src/build-program.ts +6 -2
- package/src/commands/profile.ts +72 -3
- package/src/lib/profile-manager.ts +5 -1
- package/src/lib/secure-session.ts +29 -0
- package/src/lib/sso-login.ts +94 -15
- package/bundled-test-harness/assets/account-switch-failed-B3pr_iC3.js +0 -32
- package/bundled-test-harness/assets/account-switch-failed-DTGZZo-G.css +0 -61
- package/bundled-test-harness/assets/account-switch-failed-test-9ENVgvlx.js +0 -45
- package/bundled-test-harness/assets/add-workspace-BAbk0250.js +0 -141
- package/bundled-test-harness/assets/add-workspace-test-ChAja_t-.js +0 -72
- package/bundled-test-harness/assets/advanced-color-picker-C-xBFJ2S.js +0 -504
- package/bundled-test-harness/assets/advanced-color-picker-bWAmCT-8.js +0 -2
- package/bundled-test-harness/assets/ai-assistant-test-BJ9yetuC.js +0 -2211
- package/bundled-test-harness/assets/ai-module-creation-test-Bw3TKS9d.js +0 -151
- package/bundled-test-harness/assets/aibot-message-DkgHT6eJ.js +0 -465
- package/bundled-test-harness/assets/app-DW5QjtRp.js +0 -22816
- package/bundled-test-harness/assets/app-yCDjO4mk.css +0 -2718
- package/bundled-test-harness/assets/audio-file-def-bJ3cXVmC.js +0 -133
- package/bundled-test-harness/assets/avif-meta-extractor-CrSDfYEt.js +0 -162
- package/bundled-test-harness/assets/base64-image-C7UBjK5W.js +0 -262
- package/bundled-test-harness/assets/base64-image-CjWpxROT.js +0 -2
- package/bundled-test-harness/assets/big-integer-BBql7oGZ.js +0 -89
- package/bundled-test-harness/assets/big-integer-B_TrzRy_.js +0 -2
- package/bundled-test-harness/assets/binary-upload-dedupe-test-BiX8kS7D.js +0 -308
- package/bundled-test-harness/assets/boolean-9LNUUTfw.js +0 -2
- package/bundled-test-harness/assets/boolean-BAmK01TF.js +0 -94
- package/bundled-test-harness/assets/brand-functional-palette-CFuoS-LS.js +0 -137
- package/bundled-test-harness/assets/brand-logo-By89eknI.js +0 -295
- package/bundled-test-harness/assets/broken-link-template-test-odBriDSP.js +0 -192
- package/bundled-test-harness/assets/bundled-base-CLQkkmN4.js +0 -254
- package/bundled-test-harness/assets/bundled-base-modules-test-BYrTaTwa.js +0 -54
- package/bundled-test-harness/assets/buried-stack-item-scroll-test-DU4bM5nd.js +0 -236
- package/bundled-test-harness/assets/bxl-expression-test-Cs9JaZbC.js +0 -250
- package/bundled-test-harness/assets/can-invoke-test-ccMc06BU.js +0 -401
- package/bundled-test-harness/assets/card-api-Bn65NUT0.js +0 -8
- package/bundled-test-harness/assets/card-api-test-COrFXu2i.js +0 -198
- package/bundled-test-harness/assets/card-api-u1pOrwS6.js +0 -4393
- package/bundled-test-harness/assets/card-basics-test-D4rn3iN-.js +0 -5364
- package/bundled-test-harness/assets/card-chooser-paging-test-bZhdrUXt.js +0 -235
- package/bundled-test-harness/assets/card-chooser-test-D9w1duob.js +0 -393
- package/bundled-test-harness/assets/card-collection-ClCV-__1.js +0 -118
- package/bundled-test-harness/assets/card-context-search-results-H_rN3Upz.js +0 -30
- package/bundled-test-harness/assets/card-context-search-results-test-jciyaouV.js +0 -184
- package/bundled-test-harness/assets/card-def-field-def-relationships-test-BVZoQzM8.js +0 -562
- package/bundled-test-harness/assets/card-delete-test-CuLcZFnY.js +0 -466
- package/bundled-test-harness/assets/card-error-DIOivSkD.js +0 -72
- package/bundled-test-harness/assets/card-error-awaiting-index-test-JMwcRONq.js +0 -53
- package/bundled-test-harness/assets/card-error-detail-96jWBx6B.js +0 -271
- package/bundled-test-harness/assets/card-info-BxPtwG1h.js +0 -2
- package/bundled-test-harness/assets/card-list-B34qY3io.js +0 -2
- package/bundled-test-harness/assets/card-list-BpCaKkZJ.js +0 -202
- package/bundled-test-harness/assets/card-resource-DcPbIwH9.js +0 -86
- package/bundled-test-harness/assets/cards-grid-CTN8nBT_.js +0 -344
- package/bundled-test-harness/assets/cards-grid-Cx44vL-M.js +0 -2
- package/bundled-test-harness/assets/cards-grid-layout-BdL0Uzxl.js +0 -111
- package/bundled-test-harness/assets/cards-grid-layout-Dn8Yb4ma.js +0 -2
- package/bundled-test-harness/assets/check-correctness-test-BfMV-MC0.js +0 -554
- package/bundled-test-harness/assets/clip-CK6mVuyN.js +0 -92
- package/bundled-test-harness/assets/clip-CfXD1JTr.js +0 -2
- package/bundled-test-harness/assets/code-ref-85Bih6Zl.js +0 -138
- package/bundled-test-harness/assets/code-ref-DATHaoyt.js +0 -2
- package/bundled-test-harness/assets/code-submode-availability-test-DLYlx0wo.js +0 -198
- package/bundled-test-harness/assets/code-submode-test-CDIi7MjD.js +0 -1824
- package/bundled-test-harness/assets/codeblocks-test-CNPyTvuv.js +0 -418
- package/bundled-test-harness/assets/codemirror-editor-BPOPTR-f.js +0 -2
- package/bundled-test-harness/assets/codemirror-editor-DPhG0pec.js +0 -701
- package/bundled-test-harness/assets/codemirror-embed-toolbar-test-Dk5lFOUq.js +0 -366
- package/bundled-test-harness/assets/color-BxN5gRSg.js +0 -65
- package/bundled-test-harness/assets/color-CrunRcis.js +0 -2
- package/bundled-test-harness/assets/color-field-test-COjFIpXV.js +0 -212
- package/bundled-test-harness/assets/color-picker-field-C-GS1CIw.js +0 -139
- package/bundled-test-harness/assets/color-picker-field-D3RXhbCK.js +0 -2
- package/bundled-test-harness/assets/color-wheel-picker-Bz8cBmf4.js +0 -283
- package/bundled-test-harness/assets/color-wheel-picker-DrwPrB8B.js +0 -2
- package/bundled-test-harness/assets/command-data-BxXgtNBf.js +0 -2
- package/bundled-test-harness/assets/command-data-ZdkcpEgG.js +0 -95
- package/bundled-test-harness/assets/compaction-test-DS7DTGT_.js +0 -150
- package/bundled-test-harness/assets/components-CbCTWAON.js +0 -17777
- package/bundled-test-harness/assets/computed-test-D_OrXDtR.js +0 -1320
- package/bundled-test-harness/assets/container-DDolu1gk.js +0 -11109
- package/bundled-test-harness/assets/container-DndcCIMv.css +0 -5169
- package/bundled-test-harness/assets/contains-many-component-BtgnAXih.js +0 -2
- package/bundled-test-harness/assets/contrast-checker-addon-kwtLKWdL.js +0 -2
- package/bundled-test-harness/assets/contrast-checker-addon-zFY5cen1.js +0 -71
- package/bundled-test-harness/assets/convert-to-class-name-test-BcGWl2K1.js +0 -17
- package/bundled-test-harness/assets/coordinate-D72EF1Pl.js +0 -48
- package/bundled-test-harness/assets/copy-file-to-realm-test-CYoDX4YV.js +0 -148
- package/bundled-test-harness/assets/country-B-iIe5v8.js +0 -199
- package/bundled-test-harness/assets/create-file-modal-PpvMksjR.js +0 -570
- package/bundled-test-harness/assets/create-listing-modal-test-CQtEf_UD.js +0 -273
- package/bundled-test-harness/assets/create-listing-pr-request-test-CDtKWyfk.js +0 -117
- package/bundled-test-harness/assets/create-spec-test-Cbqk8I9T.js +0 -256
- package/bundled-test-harness/assets/create-specs-CZg2cpnh.js +0 -215
- package/bundled-test-harness/assets/create-submission-workflow-test-CYrxF7bg.js +0 -132
- package/bundled-test-harness/assets/credential-fields-test-Di4jCJgU.js +0 -157
- package/bundled-test-harness/assets/css-value-CceJyI5o.js +0 -48
- package/bundled-test-harness/assets/csv-file-def-DJL2aZI9.js +0 -277
- package/bundled-test-harness/assets/currency-Bn5WIqzF.js +0 -134
- package/bundled-test-harness/assets/date-XI2CVYA2.js +0 -2
- package/bundled-test-harness/assets/date-h83UJcFR.js +0 -183
- package/bundled-test-harness/assets/date-time-fields-test-Cterr2mj.js +0 -359
- package/bundled-test-harness/assets/datetime-DadI80tC.js +0 -201
- package/bundled-test-harness/assets/datetime-Dpb_Sejj.js +0 -2
- package/bundled-test-harness/assets/datetime-stamp-C4vv397u.js +0 -81
- package/bundled-test-harness/assets/datetime-stamp-DIsJdQux.js +0 -2
- package/bundled-test-harness/assets/day-C4pZoGNM.js +0 -113
- package/bundled-test-harness/assets/day-D0goBhKb.js +0 -2
- package/bundled-test-harness/assets/debug-message-test-CV0sj-fl.js +0 -117
- package/bundled-test-harness/assets/dist-CAIttNZm.js +0 -1710
- package/bundled-test-harness/assets/dist-CLbqnmnm.js +0 -389
- package/bundled-test-harness/assets/dist-qkBOmIQy.js +0 -323
- package/bundled-test-harness/assets/docx-file-def-hz2tVQKf.js +0 -60
- package/bundled-test-harness/assets/docx-meta-extractor-CeRshlxL.js +0 -60
- package/bundled-test-harness/assets/docx-meta-extractor-muK5CKF3.js +0 -2
- package/bundled-test-harness/assets/duration-BYx1dLfm.js +0 -2
- package/bundled-test-harness/assets/duration-FAmTFeUa.js +0 -184
- package/bundled-test-harness/assets/email-D-bFy_C1.js +0 -80
- package/bundled-test-harness/assets/email-field-test-CY9K2zur.js +0 -75
- package/bundled-test-harness/assets/email-j4DZNH2-.js +0 -2
- package/bundled-test-harness/assets/enum-B7_baAn_.js +0 -167
- package/bundled-test-harness/assets/enum-BQqNzVQS.js +0 -2
- package/bundled-test-harness/assets/enum-field-test-BJ9Epz15.js +0 -953
- package/bundled-test-harness/assets/error-display-test-CbDWjJ2F.js +0 -343
- package/bundled-test-harness/assets/ethereum-address-BOLEnKsm.js +0 -78
- package/bundled-test-harness/assets/ethereum-address-s3Kvb2wG.js +0 -2
- package/bundled-test-harness/assets/expiration-warning-BaIP1MOZ.js +0 -2
- package/bundled-test-harness/assets/expiration-warning-gjEtxPk0.js +0 -90
- package/bundled-test-harness/assets/externals-Bih8ejPS.js +0 -4393
- package/bundled-test-harness/assets/fallback-banner-MlImHjSD.js +0 -24
- package/bundled-test-harness/assets/fallback-banner-live-delete-test-Bm7IKXPf.js +0 -207
- package/bundled-test-harness/assets/fallback-banner-test-C7TGA0Ob.js +0 -53
- package/bundled-test-harness/assets/fallback-banner-test-lvuaVRXu.js +0 -225
- package/bundled-test-harness/assets/fallback-models-test-Dy7iIKUS.js +0 -161
- package/bundled-test-harness/assets/field-component-DBoOxTke.js +0 -2
- package/bundled-test-harness/assets/field-configuration-test-DnAnzyC-.js +0 -548
- package/bundled-test-harness/assets/field-edit-DdJ8Akso.js +0 -2
- package/bundled-test-harness/assets/field-edit-XAop92l8.js +0 -36
- package/bundled-test-harness/assets/field-markdown-domain-test-cZCqbcjj.js +0 -616
- package/bundled-test-harness/assets/field-markdown-oversize-test-BuATetVz.js +0 -88
- package/bundled-test-harness/assets/field-markdown-primitives-test-BsubQfhv.js +0 -365
- package/bundled-test-harness/assets/field-markdown-specialized-test-4eNLiYpF.js +0 -534
- package/bundled-test-harness/assets/field-test-helpers-9I7cHnaU.js +0 -45
- package/bundled-test-harness/assets/file-api-CC86I7Er.js +0 -7
- package/bundled-test-harness/assets/file-attachment-test-o9191GMb.js +0 -796
- package/bundled-test-harness/assets/file-chooser-panel-test-C8aZuJlk.js +0 -153
- package/bundled-test-harness/assets/file-chooser-test-B0Tn8CCR.js +0 -504
- package/bundled-test-harness/assets/file-def-edit-BSiF2Lje.js +0 -2
- package/bundled-test-harness/assets/file-def-edit-C5TYBp_q.js +0 -26
- package/bundled-test-harness/assets/file-def-embedded-BLVTCiVB.js +0 -2
- package/bundled-test-harness/assets/file-def-embedded-Bep4iD6s.js +0 -38
- package/bundled-test-harness/assets/file-def-fitted-BTs-AS78.js +0 -2
- package/bundled-test-harness/assets/file-def-fitted-DcPitdYu.js +0 -38
- package/bundled-test-harness/assets/file-def-isolated-Kg1YVhm-.js +0 -38
- package/bundled-test-harness/assets/file-def-isolated-tK5JWCam.js +0 -2
- package/bundled-test-harness/assets/file-def-serialization-test-D4wnd5XK.js +0 -89
- package/bundled-test-harness/assets/file-menu-items-CH4-naSK.js +0 -117
- package/bundled-test-harness/assets/file-menu-items-emUxx3ZI.js +0 -2
- package/bundled-test-harness/assets/file-preview-stage-B1McIWwu.js +0 -2
- package/bundled-test-harness/assets/file-preview-stage-BgZLNMN4.js +0 -72
- package/bundled-test-harness/assets/file-shell-embedded-BmfuwWfU.js +0 -2
- package/bundled-test-harness/assets/file-shell-embedded-zh8CJanA.js +0 -68
- package/bundled-test-harness/assets/file-shell-fitted-DSFUNRGJ.js +0 -2
- package/bundled-test-harness/assets/file-shell-fitted-DXKDH0fn.js +0 -98
- package/bundled-test-harness/assets/file-shell-isolated-0F1MFv4q.js +0 -2
- package/bundled-test-harness/assets/file-shell-isolated-DduZZzmi.js +0 -195
- package/bundled-test-harness/assets/file-tree-from-index-BzDvvUHy.js +0 -151
- package/bundled-test-harness/assets/file-tree-from-index-test-D0hfI4a1.js +0 -96
- package/bundled-test-harness/assets/film-BN_HVXBU.js +0 -13
- package/bundled-test-harness/assets/film-CKkbUi0L.js +0 -2
- package/bundled-test-harness/assets/film-CMNJITZ-.js +0 -4074
- package/bundled-test-harness/assets/fitted-CAvdcKpu.js +0 -34
- package/bundled-test-harness/assets/fitted-CbKOwd1u.js +0 -2
- package/bundled-test-harness/assets/flac-meta-extractor-e8qajPSl.js +0 -99
- package/bundled-test-harness/assets/font-file-def-9atde5W8.js +0 -64
- package/bundled-test-harness/assets/font-meta-extractor-IralDC8M.js +0 -303
- package/bundled-test-harness/assets/font-meta-extractor-zPBVOfoR.js +0 -2
- package/bundled-test-harness/assets/formatted-aibot-message-test-CWOiZUng.js +0 -109
- package/bundled-test-harness/assets/from-elsewhere-ChxbtsBa.js +0 -131
- package/bundled-test-harness/assets/frontmatter-field-cdig7KR9.js +0 -41
- package/bundled-test-harness/assets/garbage-collection-test-Dg-ww_Sb.js +0 -403
- package/bundled-test-harness/assets/gauge-B45nLOGe.js +0 -106
- package/bundled-test-harness/assets/gauge-BK-768BM.js +0 -2
- package/bundled-test-harness/assets/general-test-D7cn7PUr.js +0 -926
- package/bundled-test-harness/assets/get-relationship-membership-state-test-Skmj9V6y.js +0 -1308
- package/bundled-test-harness/assets/gif-meta-extractor-BychhK9q.js +0 -114
- package/bundled-test-harness/assets/glimmer-motion-and-choreo-in-cards-test-C09YUmk4.js +0 -160
- package/bundled-test-harness/assets/glimmer-motion-and-choreo-test-DYskx_Kk.js +0 -74
- package/bundled-test-harness/assets/helper-BHX0HLF2.js +0 -478
- package/bundled-test-harness/assets/host-submode-test-Clw_QnvF.js +0 -1243
- package/bundled-test-harness/assets/html-file-def-C0P9giwU.js +0 -82
- package/bundled-test-harness/assets/hydratable-card-DnjrxKsT.js +0 -147
- package/bundled-test-harness/assets/hydratable-card-test-BAmWHfv1.js +0 -426
- package/bundled-test-harness/assets/icons-DBXBZgLe.js +0 -894
- package/bundled-test-harness/assets/image-Cip6ojDd.js +0 -47
- package/bundled-test-harness/assets/image-file-def-BdQxjZcN.js +0 -65
- package/bundled-test-harness/assets/image-file-def-DP4aqWcS.js +0 -3
- package/bundled-test-harness/assets/index-changes-test-D8b_56Ke.js +0 -367
- package/bundled-test-harness/assets/index-query-engine-test-CCyaUwMX.js +0 -2593
- package/bundled-test-harness/assets/inspector-test-BJTVGdOO.js +0 -1930
- package/bundled-test-harness/assets/instance-filter-matcher-test-DjsPrXL7.js +0 -788
- package/bundled-test-harness/assets/interact-submode-creation-and-permissions-test-DSqM0vxh.js +0 -475
- package/bundled-test-harness/assets/interact-submode-setup-DF31UMX-.js +0 -566
- package/bundled-test-harness/assets/is-component-declaration-test-Did47eG9.js +0 -50
- package/bundled-test-harness/assets/iso-bmff-LuWkGL__.js +0 -205
- package/bundled-test-harness/assets/iso-bmff-_flO6c20.js +0 -2
- package/bundled-test-harness/assets/isolated-and-edit-frocLHin.js +0 -2
- package/bundled-test-harness/assets/job-priority-header-test-DHLAXfp7.js +0 -81
- package/bundled-test-harness/assets/job-scoped-instance-residency-test-C1Bt5j98.js +0 -103
- package/bundled-test-harness/assets/join-the-community-BBUSO2cs.js +0 -86
- package/bundled-test-harness/assets/jpg-meta-extractor-CoybO4Hq.js +0 -88
- package/bundled-test-harness/assets/json-field-8sdH5RQb.js +0 -2
- package/bundled-test-harness/assets/json-field-BDD3iTUh.js +0 -19
- package/bundled-test-harness/assets/json-file-def-BKibsfc6.js +0 -298
- package/bundled-test-harness/assets/last-modified-date-CR5jru2m.js +0 -43
- package/bundled-test-harness/assets/last-modified-date-test-jJ00YdTm.js +0 -28
- package/bundled-test-harness/assets/links-to-editor-rDoCYaN-.js +0 -2
- package/bundled-test-harness/assets/links-to-many-component-BqZT88Fb.js +0 -2
- package/bundled-test-harness/assets/linksto-broken-link-placeholder-test-Cp1Eb_4U.js +0 -398
- package/bundled-test-harness/assets/linksto-error-sentinel-test-Bddavnh_.js +0 -238
- package/bundled-test-harness/assets/linksto-many-broken-link-placeholder-test-c5WegXnR.js +0 -354
- package/bundled-test-harness/assets/linksto-many-per-slot-access-test-CWskzfGW.js +0 -303
- package/bundled-test-harness/assets/linksto-sentinel-reload-test-ByeVNhr8.js +0 -197
- package/bundled-test-harness/assets/linksto-sentinel-roundtrip-test-DP26i6Gb.js +0 -260
- package/bundled-test-harness/assets/linksto-singular-js-access-contract-test-fDUXx8tO.js +0 -196
- package/bundled-test-harness/assets/llm-model-BcLEkTV7.js +0 -64
- package/bundled-test-harness/assets/login-CeuuNVvU.css +0 -139
- package/bundled-test-harness/assets/login-DV0WlJv-.js +0 -348
- package/bundled-test-harness/assets/login-error-text-test-BMGY_9gW.js +0 -51
- package/bundled-test-harness/assets/login-test-CL9YpMH5.js +0 -246
- package/bundled-test-harness/assets/m4a-meta-extractor-CHO1JQtb.js +0 -204
- package/bundled-test-harness/assets/main-CPLT8JNu.js +0 -5
- package/bundled-test-harness/assets/markdown-BvBALLGh.js +0 -7
- package/bundled-test-harness/assets/markdown-DFezmrFD.js +0 -2
- package/bundled-test-harness/assets/markdown-editor-mode-select-Au64bcIO.js +0 -2
- package/bundled-test-harness/assets/markdown-editor-mode-select-rK9PP8rv.js +0 -54
- package/bundled-test-harness/assets/markdown-embed-chooser-modal-test-CIxizf5k.js +0 -470
- package/bundled-test-harness/assets/markdown-embed-preview-pane-test-C7GoNN7l.js +0 -447
- package/bundled-test-harness/assets/markdown-embed-preview-test-CDnj4uhd.js +0 -368
- package/bundled-test-harness/assets/markdown-fallback-n7PsLNmO.js +0 -2
- package/bundled-test-harness/assets/markdown-fallback-test-DTHT6OwQ.js +0 -316
- package/bundled-test-harness/assets/markdown-highlighting-test-DJ-4WSE_.js +0 -244
- package/bundled-test-harness/assets/markdown-preview-Ccelx5W-.js +0 -64
- package/bundled-test-harness/assets/markdown-preview-JXuMC_ve.js +0 -72
- package/bundled-test-harness/assets/markdown-preview-test-ByZqrpPk.js +0 -238
- package/bundled-test-harness/assets/markdown-skill-frontmatter-test-DAHGeL4K.js +0 -146
- package/bundled-test-harness/assets/menu-items-DzJm9H_H.js +0 -2
- package/bundled-test-harness/assets/message-tool-test-lmdrIEdY.js +0 -33
- package/bundled-test-harness/assets/metadata-fields-BZZr4Qe5.js +0 -2
- package/bundled-test-harness/assets/metadata-fields-BtdjGsKE.js +0 -1415
- package/bundled-test-harness/assets/midi-audio-def-uYbYFmFi.js +0 -52
- package/bundled-test-harness/assets/midi-meta-extractor-DNI5gc1q.js +0 -284
- package/bundled-test-harness/assets/midi-meta-extractor-DbKZ4fMG.js +0 -2
- package/bundled-test-harness/assets/migrate-skill-test-DI1xceiL.js +0 -161
- package/bundled-test-harness/assets/mini-CNoDyHqG.js +0 -1519
- package/bundled-test-harness/assets/mini-DexlIeKK.js +0 -85
- package/bundled-test-harness/assets/mini-card-chooser-test-DT5eIf1_.js +0 -272
- package/bundled-test-harness/assets/mini-file-chooser-test-DTQnKTZJ.js +0 -201
- package/bundled-test-harness/assets/missing-template-DL2mwddM.js +0 -2
- package/bundled-test-harness/assets/missing-template-ltqlJ4JC.js +0 -48
- package/bundled-test-harness/assets/modal-container-DRnt95-S.js +0 -40
- package/bundled-test-harness/assets/modal-zE95eEFp.js +0 -322
- package/bundled-test-harness/assets/model-cost-tier-test-CcFz7hcv.js +0 -173
- package/bundled-test-harness/assets/module-contents-service-Dk_zWt-V.js +0 -256
- package/bundled-test-harness/assets/month-BqReBYWo.js +0 -2
- package/bundled-test-harness/assets/month-RhvmIp40.js +0 -123
- package/bundled-test-harness/assets/month-day-XFAQA72z.js +0 -2
- package/bundled-test-harness/assets/month-day-XzKpk6nz.js +0 -192
- package/bundled-test-harness/assets/month-year-BeuNr2Cl.js +0 -2
- package/bundled-test-harness/assets/month-year-DhU7hATV.js +0 -93
- package/bundled-test-harness/assets/mp3-meta-extractor-Dx2RnJc5.js +0 -476
- package/bundled-test-harness/assets/mp4-meta-extractor--k0m8KsT.js +0 -188
- package/bundled-test-harness/assets/multiple-stacks-test-bC24IWcJ.js +0 -208
- package/bundled-test-harness/assets/nested-query-field-render-test-qxElXx1e.js +0 -249
- package/bundled-test-harness/assets/no-stacks-test-Br7IGAgV.js +0 -48
- package/bundled-test-harness/assets/number-73SsCMEF.js +0 -3
- package/bundled-test-harness/assets/number-CicTBWQd.js +0 -151
- package/bundled-test-harness/assets/number-field-test-kV5zXo1J.js +0 -184
- package/bundled-test-harness/assets/number-input-CQy4xUeA.js +0 -82
- package/bundled-test-harness/assets/office-extract-Bo8sbNkK.js +0 -27
- package/bundled-test-harness/assets/office-extract-CfBaoRMD.js +0 -2
- package/bundled-test-harness/assets/ogg-meta-extractor-aIf5q_Rq.js +0 -225
- package/bundled-test-harness/assets/on-key-C8acaldQ.js +0 -472
- package/bundled-test-harness/assets/ooxml-Bu3iZezv.js +0 -172
- package/bundled-test-harness/assets/ooxml-jQPBQK25.js +0 -2
- package/bundled-test-harness/assets/open-image-in-new-tab-test-CP7q3kMm.js +0 -52
- package/bundled-test-harness/assets/operation-lowering-test-9Mdr0hRT.js +0 -2812
- package/bundled-test-harness/assets/operations-R9b661Qn.js +0 -3
- package/bundled-test-harness/assets/operations-Zv_V3Api.js +0 -766
- package/bundled-test-harness/assets/operations-invocation-test-BJPpWb2H.js +0 -523
- package/bundled-test-harness/assets/operations-query-test-DufdmPQF.js +0 -459
- package/bundled-test-harness/assets/operations-test-CzT051YH.js +0 -2518
- package/bundled-test-harness/assets/operator-mode-acceptance-test-ByOIOcD0.js +0 -1188
- package/bundled-test-harness/assets/operator-mode-card-chooser-test-CNhR9mvv.js +0 -1036
- package/bundled-test-harness/assets/operator-mode-links-test-CuxSVTPR.js +0 -793
- package/bundled-test-harness/assets/operator-mode-state-service-CCeHt5SH.js +0 -1275
- package/bundled-test-harness/assets/operator-mode-state-service-test-C8TI9WWg.js +0 -206
- package/bundled-test-harness/assets/operator-mode-test-DG-mG8Tn.js +0 -683
- package/bundled-test-harness/assets/operator-mode-ui-test-DB7xhjS0.js +0 -1027
- package/bundled-test-harness/assets/overlay-menu-items-test-C6rcdF_S.js +0 -317
- package/bundled-test-harness/assets/overlays-D2zmPxzK.js +0 -270
- package/bundled-test-harness/assets/overlays-clip-test-Clpq3JzQ.js +0 -91
- package/bundled-test-harness/assets/overlays-detached-element-test-BtsTeJch.js +0 -56
- package/bundled-test-harness/assets/pane-f-IYhcWT.js +0 -330
- package/bundled-test-harness/assets/panel-B3PCSBbf.js +0 -3540
- package/bundled-test-harness/assets/panel-Ban7zCBP.js +0 -474
- package/bundled-test-harness/assets/past-sessions-test-uM2m-oKV.js +0 -321
- package/bundled-test-harness/assets/patch-fields-test-COPjDhnt.js +0 -1014
- package/bundled-test-harness/assets/patch-instance-test-CRb3dfby.js +0 -348
- package/bundled-test-harness/assets/pdf-file-def-J_yOUU8_.js +0 -76
- package/bundled-test-harness/assets/pdf-meta-extractor-83T5Bdo7.js +0 -156
- package/bundled-test-harness/assets/pdf-meta-extractor-INFIklMy.js +0 -2
- package/bundled-test-harness/assets/pdf-viewer-B4rRluWA.js +0 -2
- package/bundled-test-harness/assets/pdf-viewer-vYem8ozk.js +0 -112
- package/bundled-test-harness/assets/percentage-ChagfNRG.js +0 -84
- package/bundled-test-harness/assets/permission-checking-realm-test-Dmb2a428.js +0 -306
- package/bundled-test-harness/assets/phone-number-BiD2eaSd.js +0 -236
- package/bundled-test-harness/assets/phone-number-C-wt4_UK.js +0 -2
- package/bundled-test-harness/assets/phone-number-field-test-BHzAmuBP.js +0 -73
- package/bundled-test-harness/assets/plate-CqN2nM6P.js +0 -41
- package/bundled-test-harness/assets/plate-DaIfpORN.js +0 -2
- package/bundled-test-harness/assets/player-CGt5fTd5.js +0 -2
- package/bundled-test-harness/assets/player-CN0l44LK.js +0 -82
- package/bundled-test-harness/assets/plural-field-components-test-CO2g2opW.js +0 -198
- package/bundled-test-harness/assets/png-image-def-B_oou2wS.js +0 -48
- package/bundled-test-harness/assets/png-meta-extractor-BfPz1qP_.js +0 -2
- package/bundled-test-harness/assets/png-meta-extractor-C8ai8sPw.js +0 -111
- package/bundled-test-harness/assets/policy-scoped-search-test-BRRp2a1A.js +0 -339
- package/bundled-test-harness/assets/pptx-file-def-C3qYEHDM.js +0 -60
- package/bundled-test-harness/assets/pptx-meta-extractor-8IuoBq4I.js +0 -77
- package/bundled-test-harness/assets/pptx-meta-extractor-BPhy9RMM.js +0 -2
- package/bundled-test-harness/assets/prerender-persistence-block-test-Cteb_Rs_.js +0 -124
- package/bundled-test-harness/assets/prerender-serialize-cycle-test-CH7b6Ra9.js +0 -134
- package/bundled-test-harness/assets/preview-CmERZpI6.js +0 -74
- package/bundled-test-harness/assets/preview-format-BPMlCSbb.js +0 -41
- package/bundled-test-harness/assets/preview-format-test-B7sA8fbZ.js +0 -103
- package/bundled-test-harness/assets/process-card-CtDzDB-_.js +0 -2
- package/bundled-test-harness/assets/process-card-erbWKY5h.js +0 -114
- package/bundled-test-harness/assets/process-card-test-DXOt1jDW.js +0 -94
- package/bundled-test-harness/assets/profile-settings-modal-11BrR058.js +0 -708
- package/bundled-test-harness/assets/progress-circle-Cd79Zqh2.js +0 -2
- package/bundled-test-harness/assets/progress-circle-sc-W5aUl.js +0 -95
- package/bundled-test-harness/assets/quarter-B61kCpcD.js +0 -168
- package/bundled-test-harness/assets/quarter-d5jkTzcz.js +0 -2
- package/bundled-test-harness/assets/query-field-membership-status-test-BmpVfohw.js +0 -323
- package/bundled-test-harness/assets/query-field-page-optin-test-9_Cce-OJ.js +0 -126
- package/bundled-test-harness/assets/query-field-schema-test-CwV7xanX.js +0 -231
- package/bundled-test-harness/assets/query-field-stale-prerender-test-RkdnZ-VV.js +0 -152
- package/bundled-test-harness/assets/query-fields-test-BLxYkTAM.js +0 -535
- package/bundled-test-harness/assets/rail-CFPU0tFe.js +0 -2
- package/bundled-test-harness/assets/rail-CQ53Dakr.js +0 -44
- package/bundled-test-harness/assets/realm-DdVH9lSZ.js +0 -95
- package/bundled-test-harness/assets/realm-DdsFw3b-.js +0 -2
- package/bundled-test-harness/assets/realm-config-DIslxoB7.js +0 -844
- package/bundled-test-harness/assets/realm-config-policy-standing-test-b4WxNDor.js +0 -290
- package/bundled-test-harness/assets/realm-config-routing-rule-edit-test-C-rcvkkD.js +0 -274
- package/bundled-test-harness/assets/realm-config-settings-test-DDUkM3zw.js +0 -187
- package/bundled-test-harness/assets/realm-dropdown-1j55Dy-1.js +0 -560
- package/bundled-test-harness/assets/realm-field-test-D-uEtFKO.js +0 -100
- package/bundled-test-harness/assets/realm-indexing-test-U9m0epR-.js +0 -4380
- package/bundled-test-harness/assets/realm-policy-test-DhKabhlk.js +0 -1141
- package/bundled-test-harness/assets/realm-test-BX6C9SS5.js +0 -2363
- package/bundled-test-harness/assets/realm-url-tooltip-BjjcKqBx.js +0 -56
- package/bundled-test-harness/assets/realm-url-tooltip-test-DW0ZwEEE.js +0 -78
- package/bundled-test-harness/assets/reasoning-test-BWT94KXG.js +0 -234
- package/bundled-test-harness/assets/recent-colors-addon-CfgmgilF.js +0 -61
- package/bundled-test-harness/assets/recent-colors-addon-D--Ry3Pf.js +0 -2
- package/bundled-test-harness/assets/relationship-loading-state-test-C5R6jao_.js +0 -290
- package/bundled-test-harness/assets/relative-time-Bq7pqums.js +0 -2
- package/bundled-test-harness/assets/relative-time-D0QyW4ig.js +0 -129
- package/bundled-test-harness/assets/remix-card-test-Cy0h3Xdf.js +0 -58
- package/bundled-test-harness/assets/rendered-markdown-Hw_EF8SO.js +0 -263
- package/bundled-test-harness/assets/rendered-markdown-test-CqeF-UZd.js +0 -587
- package/bundled-test-harness/assets/resident-instance-reuse-test-BiI6L40n.js +0 -82
- package/bundled-test-harness/assets/response-field-BCxG5phG.js +0 -38
- package/bundled-test-harness/assets/result-tile-DMzRnTP8.js +0 -140
- package/bundled-test-harness/assets/rich-markdown-C4RUl7L0.js +0 -2
- package/bundled-test-harness/assets/rich-markdown-DxQSCg-o.js +0 -218
- package/bundled-test-harness/assets/rich-markdown-field-test-B7wpedKs.js +0 -1647
- package/bundled-test-harness/assets/room-D0M0Zwrs.js +0 -1008
- package/bundled-test-harness/assets/room-message-test-BWWd4xC8.js +0 -445
- package/bundled-test-harness/assets/room-test-DFH-nOwi.js +0 -95
- package/bundled-test-harness/assets/run-realm-code-DyVyEDBl.js +0 -1600
- package/bundled-test-harness/assets/run-realm-code-test-BpxF-tOz.js +0 -2468
- package/bundled-test-harness/assets/schema-generation-test-DjaJqpYP.js +0 -28
- package/bundled-test-harness/assets/score-Cfp34BE7.js +0 -2
- package/bundled-test-harness/assets/score-DIWWpeyf.js +0 -100
- package/bundled-test-harness/assets/scrolling-test-hA_uBwBg.js +0 -384
- package/bundled-test-harness/assets/search-C0-b7dJI.js +0 -605
- package/bundled-test-harness/assets/search-adorn-test-C6KP3AwA.js +0 -136
- package/bundled-test-harness/assets/search-entries-BfPq5sPS.js +0 -472
- package/bundled-test-harness/assets/search-entries-result-test-Bl9u_BOD.js +0 -234
- package/bundled-test-harness/assets/search-entries-test-BDC_lS43.js +0 -1486
- package/bundled-test-harness/assets/search-result-header-DCAze_cg.js +0 -128
- package/bundled-test-harness/assets/search-results-Dd0enVun.js +0 -266
- package/bundled-test-harness/assets/search-results-test-T5KEEII4.js +0 -578
- package/bundled-test-harness/assets/search-selection-menu-test-CCssnBq1.js +0 -108
- package/bundled-test-harness/assets/search-sheet-persistence-test-BzQiO-FK.js +0 -131
- package/bundled-test-harness/assets/search-test-fyCWb24m.js +0 -2241
- package/bundled-test-harness/assets/searchable-BkgeKQMl.js +0 -2
- package/bundled-test-harness/assets/searchable-D_6p6fyb.js +0 -192
- package/bundled-test-harness/assets/searchable-option-test-CnCUYGaq.js +0 -322
- package/bundled-test-harness/assets/searchable-search-doc-test-B8Q0D98v.js +0 -1271
- package/bundled-test-harness/assets/sending-test-D5PGBDys.js +0 -576
- package/bundled-test-harness/assets/serialization-rri-form-audit-test-BRJ1cJ31.js +0 -136
- package/bundled-test-harness/assets/serialization-test-DM6hK258.js +0 -8758
- package/bundled-test-harness/assets/setup-C_GgVgzM.js +0 -772
- package/bundled-test-harness/assets/shared-link-target-reuse-test-Be-lSKib.js +0 -207
- package/bundled-test-harness/assets/show-card-BFG6KR1m.js +0 -67
- package/bundled-test-harness/assets/show-card-test-l0wMrfZq.js +0 -365
- package/bundled-test-harness/assets/show-file-B8-FRVHj.js +0 -34
- package/bundled-test-harness/assets/signed-capture-D_Q44TQ7.js +0 -204
- package/bundled-test-harness/assets/signed-capture-link-test-DOS5xpYv.js +0 -132
- package/bundled-test-harness/assets/single-stack-test-BIEtzHVS.js +0 -652
- package/bundled-test-harness/assets/skill-BUTGmSsm.js +0 -76
- package/bundled-test-harness/assets/skill-Bo7R_2Ud.js +0 -3
- package/bundled-test-harness/assets/skill-reference-Cs64py3k.js +0 -112
- package/bundled-test-harness/assets/skills-test-CXxSIkYa.js +0 -648
- package/bundled-test-harness/assets/slider-picker-C81errGI.js +0 -245
- package/bundled-test-harness/assets/slider-picker-mvKsy6cR.js +0 -2
- package/bundled-test-harness/assets/spec-B55lJurX.js +0 -602
- package/bundled-test-harness/assets/store-DyQ0KiyI.js +0 -2205
- package/bundled-test-harness/assets/store-module-rebuild-test-C7532_bS.js +0 -454
- package/bundled-test-harness/assets/store-search-test-80NMJuoW.js +0 -175
- package/bundled-test-harness/assets/store-test-dHiWXXMs.js +0 -3460
- package/bundled-test-harness/assets/string-DHlQEHYm.js +0 -9
- package/bundled-test-harness/assets/submode-switcher-DQv-CD6G.js +0 -169
- package/bundled-test-harness/assets/svg-meta-extractor-Uw_EJytF.js +0 -42
- package/bundled-test-harness/assets/swatches-picker-CaEoibN1.js +0 -33
- package/bundled-test-harness/assets/swatches-picker-gPl50JbP.js +0 -2
- package/bundled-test-harness/assets/switch-submode-BKDnJd4m.js +0 -79
- package/bundled-test-harness/assets/switch-submode-test-_E2mVk4z.js +0 -168
- package/bundled-test-harness/assets/tag-B60lDr-j.js +0 -105
- package/bundled-test-harness/assets/tests-BBBgPBB6.js +0 -3520
- package/bundled-test-harness/assets/text-area-CJjWmwpi.js +0 -9
- package/bundled-test-harness/assets/text-file-def-u_dl0i2z.js +0 -151
- package/bundled-test-harness/assets/text-input-validator-test-BTwnkSS2.js +0 -156
- package/bundled-test-harness/assets/theme-BK-fAHVn.js +0 -9
- package/bundled-test-harness/assets/theme-card-test-BQmT7rqr.js +0 -621
- package/bundled-test-harness/assets/theme-scheme-island-test-Oi3aeyp1.js +0 -264
- package/bundled-test-harness/assets/three-d-model-def-B4KckPVC.js +0 -70
- package/bundled-test-harness/assets/time-BcuaSkHg.js +0 -126
- package/bundled-test-harness/assets/time-f7Irg7Z7.js +0 -2
- package/bundled-test-harness/assets/time-slots-ClYIZN53.js +0 -2
- package/bundled-test-harness/assets/time-slots-TI1aaqRN.js +0 -85
- package/bundled-test-harness/assets/timeline-Cof9eyq0.js +0 -59
- package/bundled-test-harness/assets/timeline-DFWQtCWE.js +0 -2
- package/bundled-test-harness/assets/to-device-streaming-test-BDrUUlOt.js +0 -163
- package/bundled-test-harness/assets/token-usage-test-CiZo03fY.js +0 -166
- package/bundled-test-harness/assets/tool-field-BXHr9r0w.js +0 -94
- package/bundled-test-harness/assets/tool-field-CoRO5C4R.js +0 -2
- package/bundled-test-harness/assets/tools-CmVaYDIS.js +0 -725
- package/bundled-test-harness/assets/tools-calling-test-B454__XF.js +0 -200
- package/bundled-test-harness/assets/tools-test-CLu51dJO.js +0 -1624
- package/bundled-test-harness/assets/tools-test-XGRAvVug.js +0 -2820
- package/bundled-test-harness/assets/ts-file-def-C05BDwdg.js +0 -159
- package/bundled-test-harness/assets/update-room-skills-test-jOvP14JX.js +0 -240
- package/bundled-test-harness/assets/url-BFf2CNo-.js +0 -2
- package/bundled-test-harness/assets/url-CYm-CeXp.js +0 -96
- package/bundled-test-harness/assets/video-file-def-B2UIrOFS.js +0 -76
- package/bundled-test-harness/assets/wav-meta-extractor-BNkv7e2f.js +0 -368
- package/bundled-test-harness/assets/webm-meta-extractor-C933kYyc.js +0 -178
- package/bundled-test-harness/assets/webp-meta-extractor-BLz0z1pZ.js +0 -98
- package/bundled-test-harness/assets/website-BuOMUW1v.js +0 -92
- package/bundled-test-harness/assets/week-Bo0666ji.js +0 -111
- package/bundled-test-harness/assets/week-CaVFA8Vc.js +0 -2
- package/bundled-test-harness/assets/welcome-to-boxel-PWard7GF.js +0 -172
- package/bundled-test-harness/assets/workspace-KXfFTQNV.js +0 -614
- package/bundled-test-harness/assets/workspace-a11y-test-Buwb-rfO.js +0 -197
- package/bundled-test-harness/assets/workspace-behavior-test-CbgFUOOo.js +0 -200
- package/bundled-test-harness/assets/workspace-chooser-BmQvhhrl.js +0 -2248
- package/bundled-test-harness/assets/workspace-chooser-Cu84Gd_E.css +0 -1317
- package/bundled-test-harness/assets/workspace-chooser-catalog-order-test-rcRw6sni.js +0 -36
- package/bundled-test-harness/assets/workspace-chooser-unreachable-notice-test-DUXnBIdY.js +0 -60
- package/bundled-test-harness/assets/workspace-delete-multiple-test-DjRKhZ2g.js +0 -212
- package/bundled-test-harness/assets/workspace-delete-summary-test-CvkLVYyN.js +0 -63
- package/bundled-test-harness/assets/workspace-timestamp-labels-test-AYJT4inv.js +0 -58
- package/bundled-test-harness/assets/xlsx-file-def-DuKdbGrJ.js +0 -60
- package/bundled-test-harness/assets/xlsx-meta-extractor-Bz-C2JWP.js +0 -101
- package/bundled-test-harness/assets/xlsx-meta-extractor-ClwwgABg.js +0 -2
- package/bundled-test-harness/assets/year-B6ctHikl.js +0 -2
- package/bundled-test-harness/assets/year-C11uAQE6.js +0 -78
- package/bundled-test-harness/assets/zip-file-def-B8XN-OS_.js +0 -288
- package/bundled-types/host-app/components/matrix/auth-button.gts +0 -39
- package/bundled-types/host-app/components/matrix/auth-container.gts +0 -69
- package/bundled-types/host-app/components/matrix/auth-form-field.gts +0 -43
|
@@ -1,2205 +0,0 @@
|
|
|
1
|
-
import { r as __exportAll } from "./chunk-Rp0pCe6z.js";
|
|
2
|
-
import { r as initializeDeferredDecorator, t as decorateFieldV2 } from "./runtime--fcdnjmJ-BoCBNIsz.js";
|
|
3
|
-
import { $o as isFileMetaResource, Ao as humanReadable, Cn as X_BOXEL_CONSUMING_REALM_HEADER, En as X_BOXEL_LOGGING_CORRELATION_ID_HEADER, Jt as mergeRelationships, Po as isCardInstance, Qa as clearReplacedArrayFieldMeta, Ro as isFileDefInstance, Sc as Deferred, Sn as X_BOXEL_LINK_SHAPE_HEADER, Tn as X_BOXEL_JOB_PRIORITY_HEADER, Vr as delay, Wo as loadCardDef, Yo as hasWithheldRelationships, _i as isEntrySingleDocument, ai as SEARCH_CONCURRENCY_CAP, as as isSparseItemResource, bc as stringifyErrorForLog, ci as assertRealmsBound, d as isLocalId, do as isJsonContentType, fc as formattedError, gi as isEntryCollectionDocument, ii as QUERY_FIELD_SEARCH_CONCURRENCY_CAP, in as formatDistanceToNow, is as isSingleCardDocument, ka as resolveFileDefCodeRef, l as hasExecutableExtension, mc as isCardError, ms as logger, na as searchEntryWireQueryFromQuery, si as applySearchPageBound, st as DURING_PRERENDER_HEADER, uc as CardError, uo as SupportedMimeType, ut as SKIP_INDEX_WAIT_HEADER, vi as isSingleFileMetaDocument, wn as X_BOXEL_JOB_ID_HEADER, yt as getTypeRefsFromFilter } from "./runtime-common-ClpqhbwG.js";
|
|
4
|
-
import { a as RealmPaths, v as ri, y as rri } from "./paths-BYHDgqsT.js";
|
|
5
|
-
import { B as cloneDeep, I as mergeWith, S as isEqual, _ as merge } from "./lodash-DnaZ_rzx.js";
|
|
6
|
-
import { K as realmURL, T as baseFileRef, U as meta, V as localId, k as baseRef } from "./constants-CqKWhRfY.js";
|
|
7
|
-
import { t as getOwner } from "./owner-BT6cj890.js";
|
|
8
|
-
import { On as isDestroyed, kn as isDestroying } from "./cache-DtDz7X5V-Wn8jRDfL.js";
|
|
9
|
-
import { r as service, t as Service } from "./service-LFpJ8EEP.js";
|
|
10
|
-
import { n as registerDestructor } from "./destroyable-mdLYRn_o.js";
|
|
11
|
-
import { t as isTesting } from "./runtime-9O0mNd7j.js";
|
|
12
|
-
import { l as didCancel, n as buildTask } from "./async-arrow-runtime-STsj7E8Y.js";
|
|
13
|
-
import { a as TrackedMap, i as TrackedSet, n as TrackedObject } from "./dist-B9tGPKZz.js";
|
|
14
|
-
import { n as tracked } from "./tracking-800VJb8b.js";
|
|
15
|
-
import { r as timeout } from "./dist-DEVZvbin.js";
|
|
16
|
-
import { t as buildWaiter } from "./dist-CSQ-y1Ft.js";
|
|
17
|
-
import { n as canonicalRealmIdentifiers, r as dedupeRealmsByIdentity, t as canonicalRealmIdentifier } from "./realm-utils-K-gQ_i6s.js";
|
|
18
|
-
import { n as getSearch } from "./search-C0-b7dJI.js";
|
|
19
|
-
import { r as enableRenderTimerStub, s as withTimersBlocked } from "./render-timer-stub-CMPEUlSe.js";
|
|
20
|
-
import { n as currentRenderScope, r as getDeps, t as CardStoreWithGarbageCollection } from "./gc-card-store-eg5fHk_x.js";
|
|
21
|
-
import { t as searchCacheKey } from "./search-cache-key-DEGjyFzB.js";
|
|
22
|
-
import { t as searchInFlightKey } from "./search-in-flight-key-B6C50Coa.js";
|
|
23
|
-
import { t as errorJsonApiToErrorEntry } from "./window-error-handler-DV_GtWRW.js";
|
|
24
|
-
import { t as FileDefAttributesExtractor } from "./file-def-attributes-extractor-B3vn2V7A.js";
|
|
25
|
-
//#region app/lib/prerender-fetch-headers.ts
|
|
26
|
-
function duringPrerenderHeaders() {
|
|
27
|
-
return globalThis.__boxelRenderContext === true ? { [DURING_PRERENDER_HEADER]: "1" } : {};
|
|
28
|
-
}
|
|
29
|
-
function headlessCommandWriteHeaders() {
|
|
30
|
-
return globalThis.__boxelHeadlessCommand === true ? { [DURING_PRERENDER_HEADER]: "1" } : {};
|
|
31
|
-
}
|
|
32
|
-
function consumingRealmHeader() {
|
|
33
|
-
let r = globalThis.__boxelConsumingRealm;
|
|
34
|
-
return r ? { [X_BOXEL_CONSUMING_REALM_HEADER]: r } : {};
|
|
35
|
-
}
|
|
36
|
-
function jobIdHeader() {
|
|
37
|
-
let j = globalThis.__boxelJobId;
|
|
38
|
-
return j ? { [X_BOXEL_JOB_ID_HEADER]: j } : {};
|
|
39
|
-
}
|
|
40
|
-
function loggingCorrelationIdHeader() {
|
|
41
|
-
if (globalThis.__boxelRenderContext !== true) return {};
|
|
42
|
-
return { [X_BOXEL_LOGGING_CORRELATION_ID_HEADER]: newCorrelationId() };
|
|
43
|
-
}
|
|
44
|
-
function newCorrelationId() {
|
|
45
|
-
let c = globalThis.crypto;
|
|
46
|
-
if (c?.randomUUID) return c.randomUUID();
|
|
47
|
-
return `r-${Date.now().toString(36)}-${Math.floor(Math.random() * 1e9).toString(36)}`;
|
|
48
|
-
}
|
|
49
|
-
//#endregion
|
|
50
|
-
//#region app/services/store.ts
|
|
51
|
-
var store_exports = /* @__PURE__ */ __exportAll({
|
|
52
|
-
asURL: () => asURL,
|
|
53
|
-
default: () => StoreService,
|
|
54
|
-
resolveOutboundJobPriority: () => resolveOutboundJobPriority
|
|
55
|
-
});
|
|
56
|
-
var waiter = buildWaiter("store-service");
|
|
57
|
-
var realmEventsLogger = logger("realm:events");
|
|
58
|
-
var storeLogger = logger("store");
|
|
59
|
-
function resolveOutboundJobPriority({ duringPrerender, jobPriority }) {
|
|
60
|
-
let valid = typeof jobPriority === "number" && Number.isSafeInteger(jobPriority) && jobPriority >= 0 ? jobPriority : void 0;
|
|
61
|
-
if (duringPrerender === true) return valid ?? 0;
|
|
62
|
-
return valid ?? 10;
|
|
63
|
-
}
|
|
64
|
-
function isInstanceWriteRequestId(clientRequestId) {
|
|
65
|
-
return clientRequestId.startsWith("instance:") || clientRequestId.startsWith("editor-with-instance");
|
|
66
|
-
}
|
|
67
|
-
function jobPriorityHeader() {
|
|
68
|
-
let g = globalThis;
|
|
69
|
-
return { [X_BOXEL_JOB_PRIORITY_HEADER]: String(resolveOutboundJobPriority({
|
|
70
|
-
duringPrerender: g.__boxelRenderContext,
|
|
71
|
-
jobPriority: g.__boxelJobPriority
|
|
72
|
-
})) };
|
|
73
|
-
}
|
|
74
|
-
var queryFieldSeedFromSearchSymbol = Symbol.for("cardstack-query-field-seed-from-search");
|
|
75
|
-
var KEEPALIVE_BODY_LIMIT = 64 * 1024;
|
|
76
|
-
var MAX_SHED_SEARCH_RETRIES = 3;
|
|
77
|
-
var MAX_SHED_RETRY_AFTER_SECONDS = 5;
|
|
78
|
-
var CARD_FACING_STORE_METHODS = new Set([
|
|
79
|
-
"save",
|
|
80
|
-
"create",
|
|
81
|
-
"add",
|
|
82
|
-
"addWithoutPersisting",
|
|
83
|
-
"addWithoutWaiting",
|
|
84
|
-
"peek",
|
|
85
|
-
"peekError",
|
|
86
|
-
"get",
|
|
87
|
-
"delete",
|
|
88
|
-
"patch",
|
|
89
|
-
"search",
|
|
90
|
-
"getSaveState"
|
|
91
|
-
]);
|
|
92
|
-
function shedRetryDelayMs(retryAfter) {
|
|
93
|
-
let seconds = Number(retryAfter);
|
|
94
|
-
if (!Number.isFinite(seconds) || seconds < 0) seconds = 1;
|
|
95
|
-
seconds = Math.min(seconds, MAX_SHED_RETRY_AFTER_SECONDS);
|
|
96
|
-
return seconds * 1e3 + Math.random() * 250;
|
|
97
|
-
}
|
|
98
|
-
var StoreService = class extends Service {
|
|
99
|
-
static {
|
|
100
|
-
decorateFieldV2(this.prototype, "realm", [service]);
|
|
101
|
-
}
|
|
102
|
-
#realm = (initializeDeferredDecorator(this, "realm"), void 0);
|
|
103
|
-
static {
|
|
104
|
-
decorateFieldV2(this.prototype, "loaderService", [service]);
|
|
105
|
-
}
|
|
106
|
-
#loaderService = (initializeDeferredDecorator(this, "loaderService"), void 0);
|
|
107
|
-
static {
|
|
108
|
-
decorateFieldV2(this.prototype, "messageService", [service]);
|
|
109
|
-
}
|
|
110
|
-
#messageService = (initializeDeferredDecorator(this, "messageService"), void 0);
|
|
111
|
-
static {
|
|
112
|
-
decorateFieldV2(this.prototype, "cardService", [service]);
|
|
113
|
-
}
|
|
114
|
-
#cardService = (initializeDeferredDecorator(this, "cardService"), void 0);
|
|
115
|
-
static {
|
|
116
|
-
decorateFieldV2(this.prototype, "toolService", [service]);
|
|
117
|
-
}
|
|
118
|
-
#toolService = (initializeDeferredDecorator(this, "toolService"), void 0);
|
|
119
|
-
static {
|
|
120
|
-
decorateFieldV2(this.prototype, "hostModeService", [service]);
|
|
121
|
-
}
|
|
122
|
-
#hostModeService = (initializeDeferredDecorator(this, "hostModeService"), void 0);
|
|
123
|
-
static {
|
|
124
|
-
decorateFieldV2(this.prototype, "network", [service]);
|
|
125
|
-
}
|
|
126
|
-
#network = (initializeDeferredDecorator(this, "network"), void 0);
|
|
127
|
-
static {
|
|
128
|
-
decorateFieldV2(this.prototype, "environmentService", [service]);
|
|
129
|
-
}
|
|
130
|
-
#environmentService = (initializeDeferredDecorator(this, "environmentService"), void 0);
|
|
131
|
-
static {
|
|
132
|
-
decorateFieldV2(this.prototype, "session", [service]);
|
|
133
|
-
}
|
|
134
|
-
#session = (initializeDeferredDecorator(this, "session"), void 0);
|
|
135
|
-
static {
|
|
136
|
-
decorateFieldV2(this.prototype, "operatorModeStateService", [service]);
|
|
137
|
-
}
|
|
138
|
-
#operatorModeStateService = (initializeDeferredDecorator(this, "operatorModeStateService"), void 0);
|
|
139
|
-
static {
|
|
140
|
-
decorateFieldV2(this.prototype, "realmServer", [service]);
|
|
141
|
-
}
|
|
142
|
-
#realmServer = (initializeDeferredDecorator(this, "realmServer"), void 0);
|
|
143
|
-
subscriptions = /* @__PURE__ */ new Map();
|
|
144
|
-
cardInvalidationSubscribers = /* @__PURE__ */ new Map();
|
|
145
|
-
cardReloadSubscribers = /* @__PURE__ */ new Set();
|
|
146
|
-
referenceCount = /* @__PURE__ */ new Map();
|
|
147
|
-
newReferencePromises = [];
|
|
148
|
-
autoSaveStates = new TrackedMap();
|
|
149
|
-
fileReadIds = new TrackedSet();
|
|
150
|
-
static {
|
|
151
|
-
decorateFieldV2(this.prototype, "_instanceMutationVersion", [tracked], function() {
|
|
152
|
-
return 0;
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
#_instanceMutationVersion = (initializeDeferredDecorator(this, "_instanceMutationVersion"), void 0);
|
|
156
|
-
cardApiCache;
|
|
157
|
-
gcInterval;
|
|
158
|
-
ready;
|
|
159
|
-
inflightGetCards = /* @__PURE__ */ new Map();
|
|
160
|
-
inflightGetFileMeta = /* @__PURE__ */ new Map();
|
|
161
|
-
inflightCardMutations = /* @__PURE__ */ new Map();
|
|
162
|
-
inflightCardCreates = /* @__PURE__ */ new Map();
|
|
163
|
-
inflightCardLoads = /* @__PURE__ */ new Map();
|
|
164
|
-
#reloadTargets = /* @__PURE__ */ new Map();
|
|
165
|
-
#localEdits = /* @__PURE__ */ new WeakMap();
|
|
166
|
-
#localEditSeq = 0;
|
|
167
|
-
#optimisticFields = /* @__PURE__ */ new Map();
|
|
168
|
-
inflightSearch = /* @__PURE__ */ new Map();
|
|
169
|
-
searchCache = /* @__PURE__ */ new Map();
|
|
170
|
-
searchCacheScope = void 0;
|
|
171
|
-
searchCacheGeneration = 0;
|
|
172
|
-
store;
|
|
173
|
-
#identityEpoch = 0;
|
|
174
|
-
isRenderStore = false;
|
|
175
|
-
onSaveSubscriber;
|
|
176
|
-
#pendingAutoSaves = /* @__PURE__ */ new Map();
|
|
177
|
-
autoSavePromises = /* @__PURE__ */ new Map();
|
|
178
|
-
#autoSaveHolds = /* @__PURE__ */ new Map();
|
|
179
|
-
#teardownAfterSave = /* @__PURE__ */ new Set();
|
|
180
|
-
#sessionEpoch = 0;
|
|
181
|
-
#keepaliveBytesInFlight = 0;
|
|
182
|
-
constructor(owner) {
|
|
183
|
-
super(owner);
|
|
184
|
-
this.store = this.createCardStore();
|
|
185
|
-
this.session.register(this);
|
|
186
|
-
this.ready = this.setup();
|
|
187
|
-
let removePageListeners = this.#listenForLeavingThePage();
|
|
188
|
-
registerDestructor(this, () => {
|
|
189
|
-
clearInterval(this.gcInterval);
|
|
190
|
-
removePageListeners();
|
|
191
|
-
this.#dropPendingAutoSaves();
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
#listenForLeavingThePage() {
|
|
195
|
-
if (typeof document === "undefined" || typeof window === "undefined") return () => {};
|
|
196
|
-
let onFocusOut = () => this.#sendPendingAutoSaves();
|
|
197
|
-
let onVisibilityChange = () => {
|
|
198
|
-
if (document.visibilityState === "hidden") this.#sendPendingAutoSaves({ keepalive: true });
|
|
199
|
-
};
|
|
200
|
-
let onPageHide = () => this.#sendPendingAutoSaves({ keepalive: true });
|
|
201
|
-
document.addEventListener("focusout", onFocusOut);
|
|
202
|
-
document.addEventListener("visibilitychange", onVisibilityChange);
|
|
203
|
-
window.addEventListener("pagehide", onPageHide);
|
|
204
|
-
return () => {
|
|
205
|
-
document.removeEventListener("focusout", onFocusOut);
|
|
206
|
-
document.removeEventListener("visibilitychange", onVisibilityChange);
|
|
207
|
-
window.removeEventListener("pagehide", onPageHide);
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
renderContextBlocksPersistence() {
|
|
211
|
-
if (globalThis.__boxelPrerenderApp) return true;
|
|
212
|
-
return this.isRenderStore && Boolean(globalThis.__boxelRenderContext);
|
|
213
|
-
}
|
|
214
|
-
_onSave(subscriber) {
|
|
215
|
-
this.onSaveSubscriber = subscriber;
|
|
216
|
-
this.cardService._onSave(subscriber);
|
|
217
|
-
}
|
|
218
|
-
_unregisterSaveSubscriber() {
|
|
219
|
-
this.onSaveSubscriber = void 0;
|
|
220
|
-
this.cardService._unregisterSaveSubscriber();
|
|
221
|
-
}
|
|
222
|
-
resetState() {
|
|
223
|
-
this.#sessionEpoch++;
|
|
224
|
-
this.#dropPendingAutoSaves();
|
|
225
|
-
clearInterval(this.gcInterval);
|
|
226
|
-
this.subscriptions = /* @__PURE__ */ new Map();
|
|
227
|
-
this.cardInvalidationSubscribers = /* @__PURE__ */ new Map();
|
|
228
|
-
this.cardReloadSubscribers = /* @__PURE__ */ new Set();
|
|
229
|
-
this.onSaveSubscriber = void 0;
|
|
230
|
-
this.referenceCount = /* @__PURE__ */ new Map();
|
|
231
|
-
this.#autoSaveHolds = /* @__PURE__ */ new Map();
|
|
232
|
-
this.#teardownAfterSave = /* @__PURE__ */ new Set();
|
|
233
|
-
this.newReferencePromises = [];
|
|
234
|
-
this.autoSaveStates = new TrackedMap();
|
|
235
|
-
this.fileReadIds.clear();
|
|
236
|
-
this.inflightGetCards = /* @__PURE__ */ new Map();
|
|
237
|
-
this.inflightGetFileMeta = /* @__PURE__ */ new Map();
|
|
238
|
-
this.inflightCardMutations = /* @__PURE__ */ new Map();
|
|
239
|
-
this.inflightCardCreates = /* @__PURE__ */ new Map();
|
|
240
|
-
this.inflightCardLoads = /* @__PURE__ */ new Map();
|
|
241
|
-
this.#reloadTargets = /* @__PURE__ */ new Map();
|
|
242
|
-
this.inflightSearch = /* @__PURE__ */ new Map();
|
|
243
|
-
this.searchCache = /* @__PURE__ */ new Map();
|
|
244
|
-
this.searchCacheScope = void 0;
|
|
245
|
-
this.searchCacheGeneration++;
|
|
246
|
-
this.store = this.createCardStore();
|
|
247
|
-
this.ready = this.setup();
|
|
248
|
-
}
|
|
249
|
-
async ensureSetupComplete() {
|
|
250
|
-
await this.ready;
|
|
251
|
-
}
|
|
252
|
-
clearInFlightSearch() {
|
|
253
|
-
this.inflightSearch.clear();
|
|
254
|
-
}
|
|
255
|
-
observeIndexingJob() {
|
|
256
|
-
if (!this.store.observeIndexingJob()) return;
|
|
257
|
-
this.inflightGetCards = /* @__PURE__ */ new Map();
|
|
258
|
-
this.inflightGetFileMeta = /* @__PURE__ */ new Map();
|
|
259
|
-
this.inflightCardLoads = /* @__PURE__ */ new Map();
|
|
260
|
-
this.#reloadTargets = /* @__PURE__ */ new Map();
|
|
261
|
-
this.inflightSearch = /* @__PURE__ */ new Map();
|
|
262
|
-
}
|
|
263
|
-
clearSearchCache() {
|
|
264
|
-
this.searchCache.clear();
|
|
265
|
-
this.searchCacheScope = void 0;
|
|
266
|
-
this.searchCacheGeneration++;
|
|
267
|
-
}
|
|
268
|
-
resetCache(opts) {
|
|
269
|
-
storeLogger.info(`resetting store cache; leaving identity epoch #${this.#identityEpoch}`);
|
|
270
|
-
this.#sendPendingAutoSaves();
|
|
271
|
-
if (!opts?.preserveReferences) {
|
|
272
|
-
this.referenceCount = /* @__PURE__ */ new Map();
|
|
273
|
-
this.#autoSaveHolds = /* @__PURE__ */ new Map();
|
|
274
|
-
this.#teardownAfterSave = /* @__PURE__ */ new Set();
|
|
275
|
-
}
|
|
276
|
-
this.cardApiCache = void 0;
|
|
277
|
-
this.autoSaveStates = new TrackedMap();
|
|
278
|
-
this.fileReadIds.clear();
|
|
279
|
-
this.newReferencePromises = [];
|
|
280
|
-
this.inflightGetCards = /* @__PURE__ */ new Map();
|
|
281
|
-
this.inflightGetFileMeta = /* @__PURE__ */ new Map();
|
|
282
|
-
this.inflightCardMutations = /* @__PURE__ */ new Map();
|
|
283
|
-
this.inflightCardCreates = /* @__PURE__ */ new Map();
|
|
284
|
-
this.inflightCardLoads = /* @__PURE__ */ new Map();
|
|
285
|
-
this.#reloadTargets = /* @__PURE__ */ new Map();
|
|
286
|
-
this.inflightSearch = /* @__PURE__ */ new Map();
|
|
287
|
-
this.searchCache = /* @__PURE__ */ new Map();
|
|
288
|
-
this.searchCacheScope = void 0;
|
|
289
|
-
this.searchCacheGeneration++;
|
|
290
|
-
this.store = this.createCardStore();
|
|
291
|
-
}
|
|
292
|
-
#resetIdentityInPlace() {
|
|
293
|
-
this.#identityEpoch++;
|
|
294
|
-
this.store.reset();
|
|
295
|
-
}
|
|
296
|
-
refreshReferencesForCodeChange(reason, opts) {
|
|
297
|
-
let reasonSuffix = reason ? ` (${reason})` : "";
|
|
298
|
-
storeLogger.debug(`resetting store for code change${reasonSuffix}`);
|
|
299
|
-
let telemetry = this.#clientTelemetry();
|
|
300
|
-
let start = telemetry?.isEnabled ? performance.now() : void 0;
|
|
301
|
-
this.#resetIdentityInPlace();
|
|
302
|
-
let refetch = this.reestablishReferences.perform();
|
|
303
|
-
if (telemetry?.isEnabled && start !== void 0) {
|
|
304
|
-
let triggerModules = opts?.triggerModule ? [opts.triggerModule] : [];
|
|
305
|
-
let report = (cardsReloaded) => telemetry.recordEvent({
|
|
306
|
-
event_type: "rebuild",
|
|
307
|
-
rebuild_source: "write",
|
|
308
|
-
realm: opts?.realm ?? null,
|
|
309
|
-
duration_ms: Math.round(performance.now() - start),
|
|
310
|
-
trigger_modules: triggerModules,
|
|
311
|
-
trigger_module: triggerModules[0] ?? "",
|
|
312
|
-
modules_refetched: 0,
|
|
313
|
-
cards_reloaded: cardsReloaded,
|
|
314
|
-
coalesced_events: 0
|
|
315
|
-
});
|
|
316
|
-
refetch.then((cardsReloaded) => report(cardsReloaded ?? 0), (e) => {
|
|
317
|
-
if (didCancel(e)) return;
|
|
318
|
-
report(0);
|
|
319
|
-
throw e;
|
|
320
|
-
});
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
subscribeToCardInvalidation(id, cb) {
|
|
324
|
-
let normalizedId = asURL(id, this.network.virtualNetwork);
|
|
325
|
-
let subscribers = this.cardInvalidationSubscribers.get(normalizedId);
|
|
326
|
-
if (!subscribers) {
|
|
327
|
-
subscribers = /* @__PURE__ */ new Set();
|
|
328
|
-
this.cardInvalidationSubscribers.set(normalizedId, subscribers);
|
|
329
|
-
}
|
|
330
|
-
subscribers.add(cb);
|
|
331
|
-
return () => {
|
|
332
|
-
let current = this.cardInvalidationSubscribers.get(normalizedId);
|
|
333
|
-
if (!current) return;
|
|
334
|
-
current.delete(cb);
|
|
335
|
-
if (current.size === 0) this.cardInvalidationSubscribers.delete(normalizedId);
|
|
336
|
-
};
|
|
337
|
-
}
|
|
338
|
-
notifyCardInvalidationSubscribers(id) {
|
|
339
|
-
let normalizedId = asURL(id, this.network.virtualNetwork);
|
|
340
|
-
let subscribers = this.cardInvalidationSubscribers.get(normalizedId);
|
|
341
|
-
if (!subscribers) return;
|
|
342
|
-
for (let cb of [...subscribers]) try {
|
|
343
|
-
let maybePromise = cb();
|
|
344
|
-
if (maybePromise && typeof maybePromise.then === "function") maybePromise.catch((err) => console.error(`card invalidation subscriber for ${normalizedId} rejected`, err));
|
|
345
|
-
} catch (err) {
|
|
346
|
-
console.error(`card invalidation subscriber for ${normalizedId} threw`, err);
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
dropReference(id) {
|
|
350
|
-
if (!id) return;
|
|
351
|
-
id = asURL(id, this.network.virtualNetwork);
|
|
352
|
-
let currentReferenceCount = this.referenceCount.get(id) ?? 0;
|
|
353
|
-
currentReferenceCount -= 1;
|
|
354
|
-
this.referenceCount.set(id, currentReferenceCount);
|
|
355
|
-
storeLogger.debug(`dropping reference to ${id}, current reference count: ${this.referenceCount.get(id)}`);
|
|
356
|
-
let autoSaveHolds = this.#autoSaveHolds.get(id) ?? 0;
|
|
357
|
-
if (autoSaveHolds > 0 && currentReferenceCount <= autoSaveHolds) {
|
|
358
|
-
this.#teardownAfterSave.add(id);
|
|
359
|
-
for (let [localId, pending] of this.#pendingAutoSaves) if (pending.holdKey === id) this.#sendAutoSave(localId);
|
|
360
|
-
}
|
|
361
|
-
if (currentReferenceCount <= 0) {
|
|
362
|
-
if (currentReferenceCount < 0) {
|
|
363
|
-
let message = `current reference count for ${id} is negative: ${this.referenceCount.get(id)}`;
|
|
364
|
-
storeLogger.error(message);
|
|
365
|
-
console.trace(message);
|
|
366
|
-
}
|
|
367
|
-
this.referenceCount.delete(id);
|
|
368
|
-
this.autoSaveStates.delete(id);
|
|
369
|
-
this.unsubscribeFromInstance(id);
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
addReference(id, opts) {
|
|
373
|
-
if (!id) return;
|
|
374
|
-
id = asURL(id, this.network.virtualNetwork);
|
|
375
|
-
let readType = opts?.type ?? "card";
|
|
376
|
-
let currentReferenceCount = this.referenceCount.get(id) ?? 0;
|
|
377
|
-
currentReferenceCount += 1;
|
|
378
|
-
this.referenceCount.set(id, currentReferenceCount);
|
|
379
|
-
storeLogger.debug(`adding reference to ${id}, current reference count: ${this.referenceCount.get(id)}`);
|
|
380
|
-
if (isLocalId(id)) {
|
|
381
|
-
let instanceOrError = this.peek(id);
|
|
382
|
-
if (instanceOrError) {
|
|
383
|
-
let realmURL$1 = isCardInstance(instanceOrError) ? instanceOrError[realmURL]?.href : instanceOrError.realm;
|
|
384
|
-
if (realmURL$1) this.subscribeToRealm(new URL(realmURL$1));
|
|
385
|
-
}
|
|
386
|
-
} else {
|
|
387
|
-
this.subscribeToRealm(rri(id));
|
|
388
|
-
this.wireUpNewReference(id, readType);
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
loaded() {
|
|
392
|
-
return this.store.loaded();
|
|
393
|
-
}
|
|
394
|
-
get loadGeneration() {
|
|
395
|
-
return this.store.loadGeneration;
|
|
396
|
-
}
|
|
397
|
-
trackLoad(load) {
|
|
398
|
-
this.store.trackLoad(load);
|
|
399
|
-
}
|
|
400
|
-
trackQueryLoad(load, meta) {
|
|
401
|
-
return this.store.trackQueryLoad?.(load, meta);
|
|
402
|
-
}
|
|
403
|
-
queryLoadsInFlight() {
|
|
404
|
-
return this.store.queryLoadsInFlight?.() ?? [];
|
|
405
|
-
}
|
|
406
|
-
cardDocLoadsInFlight() {
|
|
407
|
-
return this.store.cardDocLoadsInFlight?.() ?? [];
|
|
408
|
-
}
|
|
409
|
-
fileMetaDocLoadsInFlight() {
|
|
410
|
-
return this.store.fileMetaDocLoadsInFlight?.() ?? [];
|
|
411
|
-
}
|
|
412
|
-
recentCardDocLoads() {
|
|
413
|
-
return this.store.recentCardDocLoads?.() ?? [];
|
|
414
|
-
}
|
|
415
|
-
recentFileMetaLoads() {
|
|
416
|
-
return this.store.recentFileMetaLoads?.() ?? [];
|
|
417
|
-
}
|
|
418
|
-
recentQueryLoads() {
|
|
419
|
-
return this.store.recentQueryLoads?.() ?? [];
|
|
420
|
-
}
|
|
421
|
-
get cardDocsInFlight() {
|
|
422
|
-
return this.store.cardDocsInFlight;
|
|
423
|
-
}
|
|
424
|
-
get fileMetaDocsInFlight() {
|
|
425
|
-
return this.store.fileMetaDocsInFlight;
|
|
426
|
-
}
|
|
427
|
-
async create(doc, opts) {
|
|
428
|
-
let adoptsFrom = doc.data.meta?.adoptsFrom;
|
|
429
|
-
let waiterLabel = `create ${adoptsFrom ? humanReadable(adoptsFrom) : "<unknown type>"} in ${opts?.realm ?? "<default realm>"}`;
|
|
430
|
-
return await this.withTestWaiters(waiterLabel, async () => {
|
|
431
|
-
if (opts?.realm) doc.data.meta = {
|
|
432
|
-
...doc.data.meta ?? {},
|
|
433
|
-
realmURL: opts.realm
|
|
434
|
-
};
|
|
435
|
-
let cardOrError = await this.getCardInstance({
|
|
436
|
-
idOrDoc: doc,
|
|
437
|
-
relativeTo: opts?.relativeTo,
|
|
438
|
-
realm: opts?.realm,
|
|
439
|
-
opts: {
|
|
440
|
-
localDir: opts?.localDir,
|
|
441
|
-
dependencyTrackingContext: opts?.dependencyTrackingContext
|
|
442
|
-
}
|
|
443
|
-
});
|
|
444
|
-
if (isCardInstance(cardOrError)) return cardOrError.id;
|
|
445
|
-
return cardOrError;
|
|
446
|
-
});
|
|
447
|
-
}
|
|
448
|
-
save(id) {
|
|
449
|
-
this.doAutoSave(id, { isImmediate: true });
|
|
450
|
-
}
|
|
451
|
-
async add(instanceOrDoc, opts) {
|
|
452
|
-
return await this.addInternal(instanceOrDoc, opts);
|
|
453
|
-
}
|
|
454
|
-
async addWithoutPersisting(instanceOrDoc, opts) {
|
|
455
|
-
return await this.addInternal(instanceOrDoc, {
|
|
456
|
-
...opts,
|
|
457
|
-
doNotPersist: true
|
|
458
|
-
});
|
|
459
|
-
}
|
|
460
|
-
async addWithoutPersistingFromSerialized(instance, doc) {
|
|
461
|
-
await (await this.cardService.getAPI()).updateFromSerialized(instance, doc, this.store);
|
|
462
|
-
return await this.addWithoutPersisting(instance);
|
|
463
|
-
}
|
|
464
|
-
async addWithoutWaiting(instanceOrDoc, opts) {
|
|
465
|
-
return await this.addInternal(instanceOrDoc, {
|
|
466
|
-
...opts,
|
|
467
|
-
doNotWaitForPersist: true
|
|
468
|
-
});
|
|
469
|
-
}
|
|
470
|
-
async addInternal(instanceOrDoc, opts) {
|
|
471
|
-
let instance;
|
|
472
|
-
if (!isCardInstance(instanceOrDoc)) instance = await this.createFromSerialized(instanceOrDoc.data, instanceOrDoc, opts?.relativeTo, opts?.dependencyTrackingContext, opts?.hydrateFieldsMs);
|
|
473
|
-
else {
|
|
474
|
-
instance = instanceOrDoc;
|
|
475
|
-
let deps = getDeps(await this.cardService.getAPI(), instance);
|
|
476
|
-
for (let dep of deps) {
|
|
477
|
-
if (isCardInstance(dep)) {
|
|
478
|
-
if (!this.store.getCard(dep[localId])) this.store.setCard(dep.id ?? dep[localId], dep);
|
|
479
|
-
continue;
|
|
480
|
-
}
|
|
481
|
-
if (isFileDefInstance(dep) && dep.id) {
|
|
482
|
-
if (!this.store.getFileMeta(dep.id)) this.store.setFileMeta(dep.id, dep);
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
if (opts?.realm) instance[meta] = {
|
|
487
|
-
...instance[meta],
|
|
488
|
-
realmURL: opts.realm
|
|
489
|
-
};
|
|
490
|
-
if (!opts?.doNotPersist && globalThis.__boxelPrerenderApp && globalThis.__boxelHeadlessCommand) throw new Error(`cannot persist instance ${instance.id ?? instance[localId]}: a headless command is running with the prerender app's persistence block still raised`);
|
|
491
|
-
let maybeOldInstance = instance.id ? this.store.getCard(instance.id) : void 0;
|
|
492
|
-
if (maybeOldInstance) await this.stopAutoSaving(maybeOldInstance);
|
|
493
|
-
this.setIdentityContext(instance);
|
|
494
|
-
await this.startAutoSaving(instance);
|
|
495
|
-
if (this.renderContextBlocksPersistence()) return instance;
|
|
496
|
-
if (opts?.doNotWaitForPersist) this.persistAndUpdate(instance, {
|
|
497
|
-
realm: opts?.realm,
|
|
498
|
-
localDir: opts?.localDir,
|
|
499
|
-
skipIndexWait: opts?.skipIndexWait
|
|
500
|
-
});
|
|
501
|
-
else if (!opts?.doNotPersist) {
|
|
502
|
-
if (instance.id && this.useEphemeralState(instance)) return instance;
|
|
503
|
-
let stateKey = instance.id ?? instance[localId];
|
|
504
|
-
return await this.trackingSaveState(instance, stateKey, () => this.persistAndUpdate(instance, {
|
|
505
|
-
realm: opts?.realm,
|
|
506
|
-
localDir: opts?.localDir,
|
|
507
|
-
skipIndexWait: opts?.skipIndexWait
|
|
508
|
-
}));
|
|
509
|
-
}
|
|
510
|
-
return instance;
|
|
511
|
-
}
|
|
512
|
-
peek(id, opts) {
|
|
513
|
-
id = asURL(id, this.network.virtualNetwork);
|
|
514
|
-
return (opts?.type ?? "card") === "file-meta" ? this.store.getFileMetaInstanceOrError(id) : this.store.getCardInstanceOrError(id);
|
|
515
|
-
}
|
|
516
|
-
allCardInstances() {
|
|
517
|
-
return this.store.allCardInstances();
|
|
518
|
-
}
|
|
519
|
-
allFileMetaInstances() {
|
|
520
|
-
return this.store.allFileMetaInstances();
|
|
521
|
-
}
|
|
522
|
-
get instanceMutationVersion() {
|
|
523
|
-
return this._instanceMutationVersion;
|
|
524
|
-
}
|
|
525
|
-
async getMatchAPI() {
|
|
526
|
-
let api = await this.cardService.getAPI();
|
|
527
|
-
return {
|
|
528
|
-
getQueryableValue: api.getQueryableValue,
|
|
529
|
-
formatQueryValue: api.formatQueryValue,
|
|
530
|
-
peekAtField: api.peekAtField,
|
|
531
|
-
isQueryTaintedField: api.isQueryTaintedField,
|
|
532
|
-
isNonPresentLink: api.isNonPresentLink,
|
|
533
|
-
getCardMeta: api.getCardMeta,
|
|
534
|
-
primitive: api.primitive,
|
|
535
|
-
virtualNetwork: this.network.virtualNetwork
|
|
536
|
-
};
|
|
537
|
-
}
|
|
538
|
-
readTypeFor(id) {
|
|
539
|
-
let url = asURL(id, this.network.virtualNetwork);
|
|
540
|
-
return url && this.fileReadIds.has(url) ? "file-meta" : "card";
|
|
541
|
-
}
|
|
542
|
-
peekError(id, opts) {
|
|
543
|
-
id = asURL(id, this.network.virtualNetwork);
|
|
544
|
-
if ((opts?.type ?? "card") === "file-meta") return this.store.getFileMetaError(id);
|
|
545
|
-
return this.store.getCardError(id);
|
|
546
|
-
}
|
|
547
|
-
async get(id, opts) {
|
|
548
|
-
return (opts?.type ?? "card") === "file-meta" ? await this.getFileMetaInstance({
|
|
549
|
-
idOrDoc: id,
|
|
550
|
-
opts: { dependencyTrackingContext: opts?.dependencyTrackingContext }
|
|
551
|
-
}) : await this.getCardInstance({
|
|
552
|
-
idOrDoc: id,
|
|
553
|
-
opts: { dependencyTrackingContext: opts?.dependencyTrackingContext }
|
|
554
|
-
});
|
|
555
|
-
}
|
|
556
|
-
async getWithoutCache(id, opts) {
|
|
557
|
-
return (opts?.type ?? "card") === "file-meta" ? await this.getFileMetaInstance({
|
|
558
|
-
idOrDoc: id,
|
|
559
|
-
opts: { noCache: true }
|
|
560
|
-
}) : await this.getCardInstance({
|
|
561
|
-
idOrDoc: id,
|
|
562
|
-
opts: { noCache: true }
|
|
563
|
-
});
|
|
564
|
-
}
|
|
565
|
-
async serializeFileDefAsDocument(fileDef) {
|
|
566
|
-
return (await this.cardService.getAPI()).serializeFileDef(fileDef, {});
|
|
567
|
-
}
|
|
568
|
-
async delete(id, opts) {
|
|
569
|
-
id = asURL(id, this.network.virtualNetwork);
|
|
570
|
-
if (!id) return;
|
|
571
|
-
if (opts?.type === "file-meta") {
|
|
572
|
-
this.store.delete(id);
|
|
573
|
-
await this.cardService.deleteSource(new URL(id));
|
|
574
|
-
this.notifyCardInvalidationSubscribers(id);
|
|
575
|
-
return;
|
|
576
|
-
}
|
|
577
|
-
let instance = this.store.getCard(id);
|
|
578
|
-
let api = instance ? await this.cardService.getAPI() : void 0;
|
|
579
|
-
let consumers = api && instance ? this.store.consumersOf(api, instance) : [];
|
|
580
|
-
this.unsubscribeFromInstance(id);
|
|
581
|
-
this.store.delete(id);
|
|
582
|
-
if (api) for (let consumer of consumers) api.notifyLinksToTargetDeleted(consumer, id);
|
|
583
|
-
await this.cardService.fetchJSON(id, {
|
|
584
|
-
method: "DELETE",
|
|
585
|
-
...opts?.skipIndexWait ? { headers: { [SKIP_INDEX_WAIT_HEADER]: "1" } } : {}
|
|
586
|
-
});
|
|
587
|
-
this.notifyCardInvalidationSubscribers(id);
|
|
588
|
-
}
|
|
589
|
-
async patch(id, patch, opts) {
|
|
590
|
-
if (this.renderContextBlocksPersistence()) return;
|
|
591
|
-
let instance = await this.get(id);
|
|
592
|
-
if (!instance || !isCardInstance(instance)) return;
|
|
593
|
-
if (opts?.doNotPersist) await this.stopAutoSaving(instance);
|
|
594
|
-
let linkedCards = await this.loadPatchedInstances(patch, instance.id);
|
|
595
|
-
for (let [field, value] of Object.entries(linkedCards)) if (field.includes(".")) {
|
|
596
|
-
let parts = field.split(".");
|
|
597
|
-
let leaf = parts.pop();
|
|
598
|
-
if (!leaf) throw new Error(`bug: error in field name "${field}"`);
|
|
599
|
-
let inner = instance;
|
|
600
|
-
for (let part of parts) inner = inner[part];
|
|
601
|
-
inner[leaf.match(/^\d+$/) ? Number(leaf) : leaf] = value;
|
|
602
|
-
} else instance[field] = value;
|
|
603
|
-
let api = await this.cardService.getAPI();
|
|
604
|
-
let doc = await this.cardService.serializeCard(instance, { omitQueryFields: true });
|
|
605
|
-
if (patch.attributes) {
|
|
606
|
-
doc.data.attributes = mergeWith(doc.data.attributes, patch.attributes, (_dest, src) => Array.isArray(src) ? src : void 0);
|
|
607
|
-
if (doc.data.attributes) replacePrimitiveValues(api, doc.data.attributes, patch.attributes, instance);
|
|
608
|
-
clearReplacedArrayFieldMeta(doc.data.meta, patch.attributes);
|
|
609
|
-
}
|
|
610
|
-
if (patch.relationships) {
|
|
611
|
-
let mergedRel = mergeRelationships(doc.data.relationships, patch.relationships);
|
|
612
|
-
if (mergedRel && Object.keys(mergedRel).length !== 0) doc.data.relationships = mergedRel;
|
|
613
|
-
}
|
|
614
|
-
if (patch.meta) doc.data.meta = merge(doc.data.meta, patch.meta);
|
|
615
|
-
await api.updateFromSerialized(instance, doc, this.store);
|
|
616
|
-
let shouldPersist = !opts?.doNotPersist;
|
|
617
|
-
let shouldAwaitPersist = shouldPersist && !opts?.doNotWaitForPersist;
|
|
618
|
-
let persistedResult = instance;
|
|
619
|
-
if (opts?.doNotPersist) await this.startAutoSaving(instance);
|
|
620
|
-
else if (shouldPersist) {
|
|
621
|
-
let persistPromise = this.persistAndUpdate(instance, { clientRequestId: opts?.clientRequestId });
|
|
622
|
-
if (shouldAwaitPersist) persistedResult = await persistPromise;
|
|
623
|
-
}
|
|
624
|
-
return persistedResult;
|
|
625
|
-
}
|
|
626
|
-
async search(query, realms, opts) {
|
|
627
|
-
let { instances } = await this.searchInternal(query, realms, opts);
|
|
628
|
-
return instances;
|
|
629
|
-
}
|
|
630
|
-
async searchWithMeta(query, realms, opts) {
|
|
631
|
-
return await this.searchInternal(query, realms, opts);
|
|
632
|
-
}
|
|
633
|
-
async searchInternal(query, realms, opts) {
|
|
634
|
-
if ("asData" in query && query.asData) throw new Error(`store.search returns instances only — use store.searchEntries for the raw entry wire format`);
|
|
635
|
-
let searchRealms = opts?.cardInitiated ? this.normalizeRealmPaths(realms) : this.normalizeSearchRealms(realms);
|
|
636
|
-
if (searchRealms.length === 0) return {
|
|
637
|
-
instances: [],
|
|
638
|
-
meta: { page: { total: 0 } }
|
|
639
|
-
};
|
|
640
|
-
if (opts?.cardInitiated) {
|
|
641
|
-
assertRealmsBound(searchRealms);
|
|
642
|
-
query = applySearchPageBound(query);
|
|
643
|
-
}
|
|
644
|
-
let run = () => this.fetchAndHydrateSearchResults(query, searchRealms, opts?.dependencyTrackingContext, opts?.scope);
|
|
645
|
-
let lane = opts?.cardInitiated ? "card" : opts?.throttled ? "query-field" : void 0;
|
|
646
|
-
return lane ? await this.performThrottledSearch(async () => {
|
|
647
|
-
if (opts?.isObsolete?.()) return {
|
|
648
|
-
instances: [],
|
|
649
|
-
meta: { page: { total: 0 } }
|
|
650
|
-
};
|
|
651
|
-
return await run();
|
|
652
|
-
}, lane) : await run();
|
|
653
|
-
}
|
|
654
|
-
async searchEntries(query, realms, opts) {
|
|
655
|
-
let searchRealms = opts?.cardInitiated ? this.normalizeRealmPaths(realms) : this.normalizeSearchRealms(realms);
|
|
656
|
-
if (searchRealms.length === 0) return {
|
|
657
|
-
data: [],
|
|
658
|
-
meta: { page: { total: 0 } }
|
|
659
|
-
};
|
|
660
|
-
return await this.fetchSearchEntryDoc(query, searchRealms, { linksOnly: opts?.linksOnly });
|
|
661
|
-
}
|
|
662
|
-
async inflateSearchEntryItem(resource) {
|
|
663
|
-
if (resource.meta.error != null || hasWithheldRelationships(resource) || isSparseItemResource(resource)) return;
|
|
664
|
-
await this.addResourceFromSearchData(resource);
|
|
665
|
-
}
|
|
666
|
-
normalizeRealmPaths(realms) {
|
|
667
|
-
return dedupeRealmsByIdentity(this.network.virtualNetwork, realms ?? []);
|
|
668
|
-
}
|
|
669
|
-
normalizeSearchRealms(realms) {
|
|
670
|
-
let normalizedRealms = this.normalizeRealmPaths(realms);
|
|
671
|
-
return normalizedRealms.length > 0 ? normalizedRealms : this.realmServer.availableRealmIdentifiers;
|
|
672
|
-
}
|
|
673
|
-
cardSearchThrottle = buildTask(() => ({
|
|
674
|
-
context: this,
|
|
675
|
-
generator: function* (run) {
|
|
676
|
-
return yield run();
|
|
677
|
-
}
|
|
678
|
-
}), {
|
|
679
|
-
maxConcurrency: SEARCH_CONCURRENCY_CAP,
|
|
680
|
-
enqueue: true
|
|
681
|
-
}, "cardSearchThrottle", null);
|
|
682
|
-
queryFieldSearchThrottle = buildTask(() => ({
|
|
683
|
-
context: this,
|
|
684
|
-
generator: function* (run) {
|
|
685
|
-
return yield run();
|
|
686
|
-
}
|
|
687
|
-
}), {
|
|
688
|
-
maxConcurrency: QUERY_FIELD_SEARCH_CONCURRENCY_CAP,
|
|
689
|
-
enqueue: true
|
|
690
|
-
}, "queryFieldSearchThrottle", null);
|
|
691
|
-
performThrottledSearch(run, lane) {
|
|
692
|
-
return (lane === "card" ? this.cardSearchThrottle : this.queryFieldSearchThrottle).perform(run);
|
|
693
|
-
}
|
|
694
|
-
cardFacingStore(getCurrentRealm) {
|
|
695
|
-
let store = this;
|
|
696
|
-
return new Proxy(store, {
|
|
697
|
-
get(target, prop) {
|
|
698
|
-
if (prop === "search") return (query, realmURLs, opts) => {
|
|
699
|
-
let current = getCurrentRealm();
|
|
700
|
-
let realms = realmURLs ?? (current ? [current] : []);
|
|
701
|
-
return target.search(query, realms, {
|
|
702
|
-
cardInitiated: true,
|
|
703
|
-
scope: opts?.scope
|
|
704
|
-
});
|
|
705
|
-
};
|
|
706
|
-
if (typeof prop === "string" && !CARD_FACING_STORE_METHODS.has(prop)) return prop in Object.prototype ? Reflect.get(Object.prototype, prop) : void 0;
|
|
707
|
-
let value = Reflect.get(target, prop, target);
|
|
708
|
-
return typeof value === "function" ? value.bind(target) : value;
|
|
709
|
-
},
|
|
710
|
-
set: () => false,
|
|
711
|
-
defineProperty: () => false,
|
|
712
|
-
deleteProperty: () => false
|
|
713
|
-
});
|
|
714
|
-
}
|
|
715
|
-
async fetchAndHydrateSearchResults(query, realms, dependencyTrackingContext, scope) {
|
|
716
|
-
let collectionDoc = await this.fetchSearchDoc(query, realms, scope);
|
|
717
|
-
let items = this.itemResourcesFromSearchEntries(collectionDoc);
|
|
718
|
-
return {
|
|
719
|
-
instances: (await Promise.all(items.map(async (resource) => {
|
|
720
|
-
try {
|
|
721
|
-
if (hasWithheldRelationships(resource)) return await this.loadWithheldSearchItem(resource, dependencyTrackingContext);
|
|
722
|
-
return await this.addResourceFromSearchData(resource, dependencyTrackingContext);
|
|
723
|
-
} catch (error) {
|
|
724
|
-
storeLogger.warn(`Failed to hydrate resource from search results (id: ${"id" in resource ? resource.id : "unknown"})`, error);
|
|
725
|
-
return;
|
|
726
|
-
}
|
|
727
|
-
}))).filter(Boolean),
|
|
728
|
-
meta: collectionDoc.meta
|
|
729
|
-
};
|
|
730
|
-
}
|
|
731
|
-
async loadWithheldSearchItem(resource, dependencyTrackingContext) {
|
|
732
|
-
if (!resource.id) throw new Error("resource must have an id");
|
|
733
|
-
let loaded = isFileMetaResource(resource) ? await this.getFileMetaInstance({
|
|
734
|
-
idOrDoc: resource.id,
|
|
735
|
-
opts: { dependencyTrackingContext }
|
|
736
|
-
}) : await this.getCardInstance({
|
|
737
|
-
idOrDoc: resource.id,
|
|
738
|
-
opts: { dependencyTrackingContext }
|
|
739
|
-
});
|
|
740
|
-
if (isCardInstance(loaded) || isFileDefInstance(loaded)) return loaded;
|
|
741
|
-
storeLogger.warn(`Failed to load search result whose relationships were withheld (id: ${resource.id})`, loaded);
|
|
742
|
-
}
|
|
743
|
-
async fetchSearchDoc(query, realms, scope) {
|
|
744
|
-
let inPrerender = Boolean(globalThis.__boxelRenderContext);
|
|
745
|
-
let renderScope = inPrerender ? currentRenderScope() : void 0;
|
|
746
|
-
let consumingRealm = inPrerender ? globalThis.__boxelConsumingRealm : void 0;
|
|
747
|
-
if (typeof renderScope === "string" && renderScope !== this.searchCacheScope) {
|
|
748
|
-
this.searchCache.clear();
|
|
749
|
-
this.searchCacheScope = renderScope;
|
|
750
|
-
this.searchCacheGeneration++;
|
|
751
|
-
}
|
|
752
|
-
let wireScope = this.resolveWireScope(query, scope);
|
|
753
|
-
let cacheKey;
|
|
754
|
-
if (inPrerender && typeof renderScope === "string" && typeof consumingRealm === "string" && realms.length === 1 && canonicalRealmIdentifier(this.network.virtualNetwork, realms[0]) === canonicalRealmIdentifier(this.network.virtualNetwork, consumingRealm)) {
|
|
755
|
-
cacheKey = searchCacheKey(renderScope, consumingRealm, query, wireScope);
|
|
756
|
-
if (cacheKey !== void 0) {
|
|
757
|
-
let cached = this.searchCache.get(cacheKey);
|
|
758
|
-
if (cached !== void 0) return cached;
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
let captureGeneration = this.searchCacheGeneration;
|
|
762
|
-
let inflightKey = inPrerender ? searchInFlightKey(canonicalRealmIdentifiers(this.network.virtualNetwork, realms), query, wireScope) : void 0;
|
|
763
|
-
let doc;
|
|
764
|
-
if (inflightKey !== void 0) {
|
|
765
|
-
let existing = this.inflightSearch.get(inflightKey);
|
|
766
|
-
if (existing) doc = await existing;
|
|
767
|
-
else {
|
|
768
|
-
let pending = this.fetchSearchDocUncoalesced(query, realms, wireScope).finally(() => {
|
|
769
|
-
if (this.inflightSearch.get(inflightKey) === pending) this.inflightSearch.delete(inflightKey);
|
|
770
|
-
});
|
|
771
|
-
this.inflightSearch.set(inflightKey, pending);
|
|
772
|
-
doc = await pending;
|
|
773
|
-
}
|
|
774
|
-
} else doc = await this.fetchSearchDocUncoalesced(query, realms, wireScope);
|
|
775
|
-
if (cacheKey !== void 0 && this.searchCacheGeneration === captureGeneration) this.searchCache.set(cacheKey, doc);
|
|
776
|
-
return doc;
|
|
777
|
-
}
|
|
778
|
-
resolveWireScope(query, explicitScope) {
|
|
779
|
-
let hasPositiveType = (query.filter ? getTypeRefsFromFilter(query.filter) : void 0)?.some((r) => !r.negated && !isEqual(r.ref, baseRef)) ?? false;
|
|
780
|
-
return explicitScope !== void 0 ? explicitScope === "all" ? void 0 : explicitScope : hasPositiveType ? void 0 : "cards";
|
|
781
|
-
}
|
|
782
|
-
async fetchSearchDocUncoalesced(query, realms, wireScope) {
|
|
783
|
-
return await this.fetchSearchEntryDoc(searchEntryWireQueryFromQuery(query, {
|
|
784
|
-
fields: ["item"],
|
|
785
|
-
...wireScope ? { scope: wireScope } : {}
|
|
786
|
-
}), realms);
|
|
787
|
-
}
|
|
788
|
-
itemResourcesFromSearchEntries(doc) {
|
|
789
|
-
let byKey = /* @__PURE__ */ new Map();
|
|
790
|
-
for (let included of doc.included ?? []) if (included.type === "card" || included.type === "file-meta") byKey.set(`${included.type}:${included.id}`, included);
|
|
791
|
-
let items = [];
|
|
792
|
-
for (let entry of doc.data) {
|
|
793
|
-
let ref = entry.relationships.item?.data;
|
|
794
|
-
if (!ref) continue;
|
|
795
|
-
let item = byKey.get(`${ref.type}:${ref.id}`);
|
|
796
|
-
if (item) items.push(item);
|
|
797
|
-
}
|
|
798
|
-
return items;
|
|
799
|
-
}
|
|
800
|
-
async fetchSearchEntryDoc(query, realms, opts) {
|
|
801
|
-
let realmServerURLs = this.realmServer.getRealmServersForRealms(realms);
|
|
802
|
-
this.realmServer.assertOwnRealmServer(realmServerURLs);
|
|
803
|
-
let [realmServerURL] = realmServerURLs;
|
|
804
|
-
let searchURL = new URL("_federated-search", realmServerURL);
|
|
805
|
-
let response;
|
|
806
|
-
for (let attempt = 0;; attempt++) {
|
|
807
|
-
response = await this.realmServer.maybeAuthedFetchForRealms(searchURL.href, realms, {
|
|
808
|
-
method: "QUERY",
|
|
809
|
-
headers: {
|
|
810
|
-
Accept: SupportedMimeType.CardJson,
|
|
811
|
-
"Content-Type": "application/json",
|
|
812
|
-
...duringPrerenderHeaders(),
|
|
813
|
-
...consumingRealmHeader(),
|
|
814
|
-
...jobIdHeader(),
|
|
815
|
-
...jobPriorityHeader(),
|
|
816
|
-
...loggingCorrelationIdHeader(),
|
|
817
|
-
...opts?.linksOnly ? { [X_BOXEL_LINK_SHAPE_HEADER]: "links-only" } : {}
|
|
818
|
-
},
|
|
819
|
-
body: JSON.stringify({
|
|
820
|
-
...query,
|
|
821
|
-
realms
|
|
822
|
-
})
|
|
823
|
-
});
|
|
824
|
-
if (response.status !== 429 || attempt >= MAX_SHED_SEARCH_RETRIES) break;
|
|
825
|
-
await timeout(shedRetryDelayMs(response.headers.get("Retry-After")));
|
|
826
|
-
}
|
|
827
|
-
if (!response.ok) {
|
|
828
|
-
let responseText = await response.text();
|
|
829
|
-
let err = /* @__PURE__ */ new Error(`status: ${response.status} - ${response.statusText}. ${responseText}`);
|
|
830
|
-
err.status = response.status;
|
|
831
|
-
err.responseText = responseText;
|
|
832
|
-
err.responseHeaders = response.headers;
|
|
833
|
-
throw err;
|
|
834
|
-
}
|
|
835
|
-
let json = await response.json();
|
|
836
|
-
if (!isEntryCollectionDocument(json)) throw new Error(`The realm search response was not a valid entry collection document:
|
|
837
|
-
${JSON.stringify(json, null, 2)}`);
|
|
838
|
-
return json;
|
|
839
|
-
}
|
|
840
|
-
async fetchCardEntry(url, opts) {
|
|
841
|
-
let requestURL = new URL(url);
|
|
842
|
-
if (opts.format) requestURL.searchParams.set("format", opts.format);
|
|
843
|
-
if (opts.renderType) requestURL.searchParams.set("renderType", `${opts.renderType.module}/${opts.renderType.name}`);
|
|
844
|
-
if (opts.fields) requestURL.searchParams.set("fields", opts.fields);
|
|
845
|
-
let headers = {
|
|
846
|
-
Accept: opts.kind === "file-meta" ? SupportedMimeType.FileMetaHtml : SupportedMimeType.CardHtml,
|
|
847
|
-
...duringPrerenderHeaders(),
|
|
848
|
-
...consumingRealmHeader(),
|
|
849
|
-
...jobIdHeader(),
|
|
850
|
-
...jobPriorityHeader(),
|
|
851
|
-
...loggingCorrelationIdHeader()
|
|
852
|
-
};
|
|
853
|
-
if (opts.ifNoneMatch) headers["If-None-Match"] = opts.ifNoneMatch;
|
|
854
|
-
let response = await this.network.authedFetch(requestURL.href, {
|
|
855
|
-
method: "GET",
|
|
856
|
-
headers
|
|
857
|
-
});
|
|
858
|
-
if (response.status === 304) return { notModified: true };
|
|
859
|
-
if (!response.ok) {
|
|
860
|
-
let responseText = await response.text();
|
|
861
|
-
let err = /* @__PURE__ */ new Error(`status: ${response.status} - ${response.statusText}. ${responseText}`);
|
|
862
|
-
err.status = response.status;
|
|
863
|
-
err.responseText = responseText;
|
|
864
|
-
err.responseHeaders = response.headers;
|
|
865
|
-
throw err;
|
|
866
|
-
}
|
|
867
|
-
let json = JSON.parse(await response.text());
|
|
868
|
-
if (!isEntrySingleDocument(json)) throw new Error(`The card+html response was not a valid entry single document:
|
|
869
|
-
${JSON.stringify(json, null, 2)}`);
|
|
870
|
-
return {
|
|
871
|
-
notModified: false,
|
|
872
|
-
doc: json
|
|
873
|
-
};
|
|
874
|
-
}
|
|
875
|
-
getSearchResource(parent, getQuery, getRealms, opts) {
|
|
876
|
-
if (this.isRenderStore && opts) {
|
|
877
|
-
opts.isLive = false;
|
|
878
|
-
opts.throttled = false;
|
|
879
|
-
}
|
|
880
|
-
return getSearch(parent, getOwner(this), getQuery, getRealms, {
|
|
881
|
-
...opts,
|
|
882
|
-
storeService: this
|
|
883
|
-
});
|
|
884
|
-
}
|
|
885
|
-
getSaveState(id) {
|
|
886
|
-
id = asURL(id, this.network.virtualNetwork);
|
|
887
|
-
return this.autoSaveStates.get(id);
|
|
888
|
-
}
|
|
889
|
-
async flush() {
|
|
890
|
-
await this.ready;
|
|
891
|
-
await Promise.allSettled(this.newReferencePromises);
|
|
892
|
-
}
|
|
893
|
-
async flushSaves(opts) {
|
|
894
|
-
let gaveUp = false;
|
|
895
|
-
let flush = async () => {
|
|
896
|
-
while (!gaveUp && (this.#pendingAutoSaves.size > 0 || this.autoSavePromises.size > 0)) {
|
|
897
|
-
this.#sendPendingAutoSaves();
|
|
898
|
-
await Promise.allSettled([...this.autoSavePromises.values()]);
|
|
899
|
-
}
|
|
900
|
-
};
|
|
901
|
-
if (opts?.timeoutMs === void 0) {
|
|
902
|
-
await flush();
|
|
903
|
-
return;
|
|
904
|
-
}
|
|
905
|
-
let timer;
|
|
906
|
-
await Promise.race([flush(), new Promise((resolve) => {
|
|
907
|
-
timer = setTimeout(resolve, opts.timeoutMs);
|
|
908
|
-
})]);
|
|
909
|
-
clearTimeout(timer);
|
|
910
|
-
gaveUp = true;
|
|
911
|
-
}
|
|
912
|
-
get hasUnsavedEdits() {
|
|
913
|
-
return this.#pendingAutoSaves.size > 0 || this.autoSavePromises.size > 0;
|
|
914
|
-
}
|
|
915
|
-
getReferenceCount(id) {
|
|
916
|
-
id = asURL(id, this.network.virtualNetwork);
|
|
917
|
-
return this.referenceCount.get(id) ?? 0;
|
|
918
|
-
}
|
|
919
|
-
isSameId(a, b) {
|
|
920
|
-
return a === b || this.peek(a) === this.peek(b);
|
|
921
|
-
}
|
|
922
|
-
async waitForCardLoad(cardId) {
|
|
923
|
-
let normalizedId = asURL(cardId, this.network.virtualNetwork);
|
|
924
|
-
if (!normalizedId) return;
|
|
925
|
-
let inflightLoad = this.inflightCardLoads.get(normalizedId);
|
|
926
|
-
if (inflightLoad) await inflightLoad.promise;
|
|
927
|
-
}
|
|
928
|
-
startTrackingCardLoad(cardId) {
|
|
929
|
-
if (!cardId) return;
|
|
930
|
-
let normalizedId = asURL(cardId, this.network.virtualNetwork);
|
|
931
|
-
if (!normalizedId) return;
|
|
932
|
-
let deferred = new Deferred();
|
|
933
|
-
this.inflightCardLoads.set(normalizedId, deferred);
|
|
934
|
-
return deferred;
|
|
935
|
-
}
|
|
936
|
-
finishTrackingCardLoad(cardId, deferred) {
|
|
937
|
-
if (!cardId || !deferred) return;
|
|
938
|
-
let normalizedId = asURL(cardId, this.network.virtualNetwork);
|
|
939
|
-
if (!normalizedId) return;
|
|
940
|
-
if (this.inflightCardLoads.get(normalizedId) === deferred) this.inflightCardLoads.delete(normalizedId);
|
|
941
|
-
deferred.fulfill();
|
|
942
|
-
}
|
|
943
|
-
async wireUpNewReference(url, readType = "card") {
|
|
944
|
-
let deferred = new Deferred();
|
|
945
|
-
let waiterLabel = `wireUpNewReference ${url}`;
|
|
946
|
-
await this.withTestWaiters(waiterLabel, async () => {
|
|
947
|
-
this.newReferencePromises.push(deferred.promise);
|
|
948
|
-
try {
|
|
949
|
-
await this.ready;
|
|
950
|
-
if (readType === "file-meta") {
|
|
951
|
-
let instanceOrError = await this.getFileMetaInstance({ idOrDoc: url });
|
|
952
|
-
this.setIdentityContext(instanceOrError, "file-meta");
|
|
953
|
-
deferred.fulfill();
|
|
954
|
-
return;
|
|
955
|
-
}
|
|
956
|
-
if (this.peekError(url, { type: "file-meta" }) ?? this.peek(url, { type: "file-meta" })) {
|
|
957
|
-
deferred.fulfill();
|
|
958
|
-
return;
|
|
959
|
-
}
|
|
960
|
-
let instanceOrError = this.peekError(url) ?? this.peek(url);
|
|
961
|
-
if (!instanceOrError) {
|
|
962
|
-
instanceOrError = await this.getCardInstance({ idOrDoc: url });
|
|
963
|
-
if (this.readTypeFor(url) === "file-meta") {
|
|
964
|
-
deferred.fulfill();
|
|
965
|
-
return;
|
|
966
|
-
}
|
|
967
|
-
this.setIdentityContext(instanceOrError);
|
|
968
|
-
}
|
|
969
|
-
await this.startAutoSaving(instanceOrError);
|
|
970
|
-
if (!instanceOrError.id) this.store.addCardInstanceOrError(url, instanceOrError);
|
|
971
|
-
deferred.fulfill();
|
|
972
|
-
} catch (e) {
|
|
973
|
-
console.error(`error encountered wiring up new reference for ${JSON.stringify(url)}`, e);
|
|
974
|
-
deferred.reject(e);
|
|
975
|
-
}
|
|
976
|
-
});
|
|
977
|
-
}
|
|
978
|
-
/**
|
|
979
|
-
* Low-level deserialization that throws on validation errors.
|
|
980
|
-
*
|
|
981
|
-
* Most callers should use `add()` or `create()` instead — those methods
|
|
982
|
-
* handle persistence, identity mapping, and auto-saving. This method
|
|
983
|
-
* bypasses all of that and calls `card-api.createFromSerialized` directly.
|
|
984
|
-
*
|
|
985
|
-
* `store.add()` relaxes serialization errors: `Field.validate()` failures
|
|
986
|
-
* during deserialization are caught internally and logged as console warnings
|
|
987
|
-
* rather than thrown. This is correct for the UI but not for validation use
|
|
988
|
-
* cases where errors must propagate. Use this method only when you need
|
|
989
|
-
* validation errors to throw (e.g., the software-factory's instantiate-card
|
|
990
|
-
* command which validates that a card instance can be deserialized).
|
|
991
|
-
*/
|
|
992
|
-
async __dangerousCreateFromSerialized(resource, doc, relativeTo, dependencyTrackingContext) {
|
|
993
|
-
return this.createFromSerialized(resource, doc, relativeTo, dependencyTrackingContext);
|
|
994
|
-
}
|
|
995
|
-
async createFromSerialized(resource, doc, relativeTo, dependencyTrackingContext, hydrateFieldsMs) {
|
|
996
|
-
let api = await this.cardService.getAPI();
|
|
997
|
-
let shouldStubTimers = this.renderContextBlocksPersistence() && !isTesting();
|
|
998
|
-
let performCreate = async () => await api.createFromSerialized(resource, doc, relativeTo, {
|
|
999
|
-
store: this.store,
|
|
1000
|
-
dependencyTrackingContext,
|
|
1001
|
-
...hydrateFieldsMs ? { hydrateFieldsMs } : {}
|
|
1002
|
-
});
|
|
1003
|
-
let telemetry = this.#clientTelemetry();
|
|
1004
|
-
let deserializeStart = telemetry?.isEnabled ? performance.now() : void 0;
|
|
1005
|
-
let card = shouldStubTimers ? await withStubbedRenderTimers(performCreate) : await performCreate();
|
|
1006
|
-
if (telemetry?.isEnabled && deserializeStart !== void 0) telemetry.recordDeserialize({
|
|
1007
|
-
durationMs: performance.now() - deserializeStart,
|
|
1008
|
-
doc,
|
|
1009
|
-
resource
|
|
1010
|
-
});
|
|
1011
|
-
return card;
|
|
1012
|
-
}
|
|
1013
|
-
#clientTelemetry() {
|
|
1014
|
-
if (globalThis.__boxelRenderContext) return;
|
|
1015
|
-
try {
|
|
1016
|
-
return getOwner(this)?.lookup("service:client-telemetry");
|
|
1017
|
-
} catch {
|
|
1018
|
-
return;
|
|
1019
|
-
}
|
|
1020
|
-
}
|
|
1021
|
-
async setup() {
|
|
1022
|
-
let api = await this.cardService.getAPI();
|
|
1023
|
-
if (isDestroyed(this) || isDestroying(this)) return;
|
|
1024
|
-
this.gcInterval = setInterval(() => this.store.sweep(api), 2 * 6e4);
|
|
1025
|
-
}
|
|
1026
|
-
unsubscribeFromInstance(id) {
|
|
1027
|
-
let instance = this.store.getCard(id);
|
|
1028
|
-
if (instance && this.cardApiCache) this.cardApiCache.unsubscribeFromChanges(instance, this.onInstanceUpdated);
|
|
1029
|
-
let realmHref = !isLocalId(id) ? [...this.subscriptions.keys()].find((realmURL) => id.startsWith(realmURL)) : void 0;
|
|
1030
|
-
if (!realmHref) return;
|
|
1031
|
-
let subscription = this.subscriptions.get(realmHref);
|
|
1032
|
-
if (subscription && ![...this.referenceCount.entries()].find(([referenceId, count]) => !isLocalId(referenceId) && count > 0 && referenceId.startsWith(realmHref))) {
|
|
1033
|
-
subscription.unsubscribe();
|
|
1034
|
-
this.subscriptions.delete(realmHref);
|
|
1035
|
-
}
|
|
1036
|
-
}
|
|
1037
|
-
createCardStore() {
|
|
1038
|
-
this.#identityEpoch++;
|
|
1039
|
-
return new CardStoreWithGarbageCollection(this.referenceCount, this.network.authedFetch, this.network.virtualNetwork, {
|
|
1040
|
-
resolvesQueryFieldsEagerly: () => this.resolvesQueryFieldsEagerly(),
|
|
1041
|
-
receivesIndexEventsFor: (id) => this.receivesIndexEventsFor(id),
|
|
1042
|
-
getSearchResource: (parent, getQuery, getRealms, opts) => this.getSearchResource(parent, getQuery, getRealms, opts)
|
|
1043
|
-
});
|
|
1044
|
-
}
|
|
1045
|
-
resolvesQueryFieldsEagerly() {
|
|
1046
|
-
if (globalThis.__boxelPrerenderApp) return false;
|
|
1047
|
-
return !this.isRenderStore;
|
|
1048
|
-
}
|
|
1049
|
-
receivesIndexEventsFor(id) {
|
|
1050
|
-
if (this.isRenderStore) return false;
|
|
1051
|
-
if (isLocalId(id)) return false;
|
|
1052
|
-
let realmURL = this.realm.realmOf(rri(asURL(id, this.network.virtualNetwork)));
|
|
1053
|
-
return realmURL != null && this.subscriptions.has(realmURL);
|
|
1054
|
-
}
|
|
1055
|
-
handleInvalidations = (event) => {
|
|
1056
|
-
if (event.eventName !== "index") return;
|
|
1057
|
-
let telemetry = this.#clientTelemetry();
|
|
1058
|
-
let processingStart = telemetry?.isEnabled ? performance.now() : void 0;
|
|
1059
|
-
let eventArgs = () => {
|
|
1060
|
-
let { invalidations: _invalidations, ...rest } = event;
|
|
1061
|
-
return rest;
|
|
1062
|
-
};
|
|
1063
|
-
if (event.indexType === "full") {
|
|
1064
|
-
let reloadsTriggered = this.reloadAwaitingIndexInstances(event.realmURL);
|
|
1065
|
-
telemetry?.recordEvent({
|
|
1066
|
-
event_type: "realm-event",
|
|
1067
|
-
realm: event.realmURL,
|
|
1068
|
-
index_type: "full",
|
|
1069
|
-
invalidations_count: 0,
|
|
1070
|
-
invalidated_ids: [],
|
|
1071
|
-
reloads_triggered: reloadsTriggered,
|
|
1072
|
-
own_write: false,
|
|
1073
|
-
processing_ms: 0,
|
|
1074
|
-
event_args: eventArgs()
|
|
1075
|
-
});
|
|
1076
|
-
return;
|
|
1077
|
-
}
|
|
1078
|
-
if (event.indexType !== "incremental") return;
|
|
1079
|
-
let invalidations = event.invalidations;
|
|
1080
|
-
let ownWrite = [event.clientRequestId, ...(event.coalescedWrites ?? []).map((write) => write.clientRequestId)].some((id) => !!id && this.cardService.clientRequestIds.has(id));
|
|
1081
|
-
let executableInvalidations = invalidations.filter(hasExecutableExtension);
|
|
1082
|
-
let alreadyFlushed = new Set(executableInvalidations.filter((i) => this.loaderService.wasModuleFlushedForCodeChange(i)));
|
|
1083
|
-
let needsRebuild = executableInvalidations.length > 0 && (this.rebuildForCodeChange.isRunning || alreadyFlushed.size > 0 || executableInvalidations.some((i) => this.loaderService.loader.isModuleLoaded(i)));
|
|
1084
|
-
let reloadsTriggered = 0;
|
|
1085
|
-
if (needsRebuild) {
|
|
1086
|
-
if (telemetry?.isEnabled) this.#accumulatePendingRebuild(event.realmURL, executableInvalidations, alreadyFlushed);
|
|
1087
|
-
this.rebuildForCodeChange.perform();
|
|
1088
|
-
} else reloadsTriggered = this.#reloadInvalidatedInstances(event, invalidations);
|
|
1089
|
-
if (telemetry?.isEnabled) telemetry.recordEvent({
|
|
1090
|
-
event_type: "realm-event",
|
|
1091
|
-
realm: event.realmURL,
|
|
1092
|
-
index_type: "incremental",
|
|
1093
|
-
invalidations_count: invalidations.length,
|
|
1094
|
-
invalidated_ids: invalidations.slice(0, 50),
|
|
1095
|
-
reloads_triggered: reloadsTriggered,
|
|
1096
|
-
own_write: ownWrite,
|
|
1097
|
-
processing_ms: processingStart !== void 0 ? Math.round(performance.now() - processingStart) : 0,
|
|
1098
|
-
event_args: eventArgs()
|
|
1099
|
-
});
|
|
1100
|
-
};
|
|
1101
|
-
#sharedPassNeedsReload(writes, invalidation) {
|
|
1102
|
-
let changedBy = writes.filter((write) => write.changed === null || write.changed.includes(invalidation));
|
|
1103
|
-
if (changedBy.length === 0) {
|
|
1104
|
-
realmEventsLogger.debug(`reloading card ${invalidation} because no write in its shared pass changed it directly`);
|
|
1105
|
-
return true;
|
|
1106
|
-
}
|
|
1107
|
-
let stranger = changedBy.find(({ clientRequestId, changed, clientAuthored }) => !clientRequestId || !this.cardService.clientRequestIds.has(clientRequestId) || !isInstanceWriteRequestId(clientRequestId) || !(clientAuthored ?? changed ?? []).includes(invalidation));
|
|
1108
|
-
if (stranger) {
|
|
1109
|
-
realmEventsLogger.debug(`reloading card ${invalidation} because request ${stranger.clientRequestId ?? "with no id"} in its shared pass changed it and did not carry our content for it`);
|
|
1110
|
-
return true;
|
|
1111
|
-
}
|
|
1112
|
-
realmEventsLogger.debug(`ignoring invalidation for card ${invalidation} because every write in its shared pass that changed it is ours and carried its content`);
|
|
1113
|
-
return false;
|
|
1114
|
-
}
|
|
1115
|
-
#reloadInvalidatedInstances(event, invalidations) {
|
|
1116
|
-
let reloadsTriggered = 0;
|
|
1117
|
-
for (let invalidation of invalidations) {
|
|
1118
|
-
if (hasExecutableExtension(invalidation)) continue;
|
|
1119
|
-
if (this.peekError(invalidation, { type: "file-meta" }) ?? this.peek(invalidation, { type: "file-meta" })) {
|
|
1120
|
-
realmEventsLogger.debug(`reloading file-meta resource ${invalidation} because it was previously loaded`);
|
|
1121
|
-
this.reloadFileMetaTask.perform(invalidation);
|
|
1122
|
-
reloadsTriggered++;
|
|
1123
|
-
}
|
|
1124
|
-
let clientRequestId = event.clientRequestId ?? void 0;
|
|
1125
|
-
let clientAuthored = event.clientAuthored;
|
|
1126
|
-
let instance = this.peekError(invalidation) ?? this.peek(invalidation);
|
|
1127
|
-
if (instance) if (isCardInstance(instance)) {
|
|
1128
|
-
if (invalidation.split("/").pop() === instance[localId] && instance.id !== rri(invalidation)) instance.id = rri(invalidation);
|
|
1129
|
-
let reloadFile = false;
|
|
1130
|
-
if (event.coalescedWrites) reloadFile = this.#sharedPassNeedsReload(event.coalescedWrites, invalidation);
|
|
1131
|
-
else if (!clientRequestId) {
|
|
1132
|
-
reloadFile = true;
|
|
1133
|
-
realmEventsLogger.debug(`reloading file resource ${invalidation} because event has no clientRequestId`);
|
|
1134
|
-
} else if (this.cardService.clientRequestIds.has(clientRequestId)) if (isInstanceWriteRequestId(clientRequestId)) if (clientAuthored && !clientAuthored.includes(invalidation)) {
|
|
1135
|
-
reloadFile = true;
|
|
1136
|
-
realmEventsLogger.debug(`reloading card ${invalidation} because request id ${clientRequestId} is ours but did not carry this card's content`);
|
|
1137
|
-
} else realmEventsLogger.debug(`ignoring invalidation for card ${invalidation} because request id ${clientRequestId} is ours and an instance type`);
|
|
1138
|
-
else {
|
|
1139
|
-
reloadFile = true;
|
|
1140
|
-
realmEventsLogger.debug(`reloading file resource ${invalidation} because request id ${clientRequestId} is not instance type`);
|
|
1141
|
-
}
|
|
1142
|
-
else {
|
|
1143
|
-
reloadFile = true;
|
|
1144
|
-
realmEventsLogger.debug(`reloading file resource ${invalidation} because request id ${clientRequestId} is not contained within known clientRequestIds`, Array.from(this.cardService.clientRequestIds.values()));
|
|
1145
|
-
}
|
|
1146
|
-
let alreadyHeld;
|
|
1147
|
-
if (reloadFile) {
|
|
1148
|
-
alreadyHeld = this.#indexStateAlreadyHeld(event, invalidation, instance);
|
|
1149
|
-
if (alreadyHeld) reloadFile = false;
|
|
1150
|
-
}
|
|
1151
|
-
if (reloadFile) {
|
|
1152
|
-
let target;
|
|
1153
|
-
if (typeof event.generation === "number" || event.versions?.[invalidation] !== void 0) {
|
|
1154
|
-
target = {
|
|
1155
|
-
generation: event.generation,
|
|
1156
|
-
version: event.versions?.[invalidation]
|
|
1157
|
-
};
|
|
1158
|
-
this.#reloadTargets.set(instance[localId], target);
|
|
1159
|
-
}
|
|
1160
|
-
this.reloadTask.perform(instance, target);
|
|
1161
|
-
reloadsTriggered++;
|
|
1162
|
-
} else realmEventsLogger.debug(alreadyHeld ? `ignoring invalidation ${invalidation} because ${alreadyHeld}` : `ignoring invalidation ${invalidation} for request id ${clientRequestId}`);
|
|
1163
|
-
} else {
|
|
1164
|
-
realmEventsLogger.debug(`reloading file resource ${invalidation} because it is in an error state`);
|
|
1165
|
-
this.loadInstanceTask.perform(invalidation);
|
|
1166
|
-
reloadsTriggered++;
|
|
1167
|
-
}
|
|
1168
|
-
else if (this.hasInflightCardLoad(invalidation)) {
|
|
1169
|
-
realmEventsLogger.debug(`deferring reload of ${invalidation} until its in-flight load settles`);
|
|
1170
|
-
this.reloadAfterInflightLoad.perform(invalidation);
|
|
1171
|
-
} else realmEventsLogger.debug(`ignoring invalidation ${invalidation} because we did not previously try to load it`);
|
|
1172
|
-
}
|
|
1173
|
-
let realmConfigCardId = `${event.realmURL}realm`;
|
|
1174
|
-
if (invalidations.includes(realmConfigCardId)) {
|
|
1175
|
-
let indexCardId = `${event.realmURL}index`;
|
|
1176
|
-
let indexCard = this.peek(indexCardId);
|
|
1177
|
-
if (indexCard && isCardInstance(indexCard)) {
|
|
1178
|
-
realmEventsLogger.debug(`reloading index card ${indexCardId} because the realm config card was re-indexed`);
|
|
1179
|
-
this.reloadTask.perform(indexCard);
|
|
1180
|
-
reloadsTriggered++;
|
|
1181
|
-
}
|
|
1182
|
-
}
|
|
1183
|
-
return reloadsTriggered;
|
|
1184
|
-
}
|
|
1185
|
-
#indexStateAlreadyHeld(event, invalidation, instance) {
|
|
1186
|
-
let held = instance[meta];
|
|
1187
|
-
let incoming = this.#reloadTargets.get(instance[localId]);
|
|
1188
|
-
let generation = Math.max(typeof held?.generation === "number" ? held.generation : -Infinity, typeof incoming?.generation === "number" ? incoming.generation : -Infinity);
|
|
1189
|
-
if (typeof event.generation === "number" && Number.isFinite(generation) && event.generation <= generation) return `the store is at index generation ${generation}, at or past this event's ${event.generation}`;
|
|
1190
|
-
let version = event.versions?.[invalidation];
|
|
1191
|
-
if (version !== void 0 && (version === held?.version || version === incoming?.version)) return `the store is at version ${version}`;
|
|
1192
|
-
}
|
|
1193
|
-
loadInstanceTask = buildTask(() => ({
|
|
1194
|
-
context: this,
|
|
1195
|
-
generator: function* (idOrDoc) {
|
|
1196
|
-
let url = asURL(idOrDoc, this.network.virtualNetwork);
|
|
1197
|
-
let token = waiter.beginAsync(void 0, `loadInstance ${url ?? "new card document"}`);
|
|
1198
|
-
let reloadTracker = this.startTrackingCardLoad(url);
|
|
1199
|
-
try {
|
|
1200
|
-
let oldInstance = url ? this.store.getCard(url) : void 0;
|
|
1201
|
-
let instanceOrError = yield this.getCardInstance({
|
|
1202
|
-
idOrDoc,
|
|
1203
|
-
opts: { noCache: true }
|
|
1204
|
-
});
|
|
1205
|
-
if (oldInstance) yield this.stopAutoSaving(oldInstance);
|
|
1206
|
-
this.setIdentityContext(instanceOrError);
|
|
1207
|
-
yield this.startAutoSaving(instanceOrError);
|
|
1208
|
-
if (isTesting()) yield this.cardService.cardsSettled();
|
|
1209
|
-
} finally {
|
|
1210
|
-
this.finishTrackingCardLoad(url, reloadTracker);
|
|
1211
|
-
waiter.endAsync(token);
|
|
1212
|
-
}
|
|
1213
|
-
}
|
|
1214
|
-
}), null, "loadInstanceTask", null);
|
|
1215
|
-
hasInflightCardLoad(id) {
|
|
1216
|
-
let url = asURL(id, this.network.virtualNetwork);
|
|
1217
|
-
if (url && this.inflightGetCards.has(url)) return true;
|
|
1218
|
-
return this.#cardDocLoadInFlight(id) !== void 0;
|
|
1219
|
-
}
|
|
1220
|
-
#cardDocLoadInFlight(id) {
|
|
1221
|
-
return this.store.cardDocLoadInFlight?.(id);
|
|
1222
|
-
}
|
|
1223
|
-
reloadAfterInflightLoad = buildTask(() => ({
|
|
1224
|
-
context: this,
|
|
1225
|
-
generator: function* (id) {
|
|
1226
|
-
let url = asURL(id, this.network.virtualNetwork);
|
|
1227
|
-
let inflight = url ? this.inflightGetCards.get(url) : void 0;
|
|
1228
|
-
if (inflight) yield inflight;
|
|
1229
|
-
let docLoad = this.#cardDocLoadInFlight(id);
|
|
1230
|
-
if (docLoad) {
|
|
1231
|
-
yield docLoad.catch(() => {});
|
|
1232
|
-
yield Promise.resolve();
|
|
1233
|
-
}
|
|
1234
|
-
if (this.peekError(id)?.awaitingIndex) {
|
|
1235
|
-
this.loadInstanceTask.perform(id);
|
|
1236
|
-
return;
|
|
1237
|
-
}
|
|
1238
|
-
if (docLoad && this.peek(id)) {
|
|
1239
|
-
storeLogger.debug(`reloading ${id} because its link resolution settled across an invalidation`);
|
|
1240
|
-
this.loadInstanceTask.perform(id);
|
|
1241
|
-
}
|
|
1242
|
-
}
|
|
1243
|
-
}), null, "reloadAfterInflightLoad", null);
|
|
1244
|
-
reloadAwaitingIndexInstances(realmURL) {
|
|
1245
|
-
let reloaded = 0;
|
|
1246
|
-
for (let [id, error] of this.store.cardErrorEntries()) {
|
|
1247
|
-
if (!error.awaitingIndex) continue;
|
|
1248
|
-
if (this.realm.realmOf(rri(id)) !== realmURL) continue;
|
|
1249
|
-
realmEventsLogger.debug(`reloading ${id} because a full index of ${realmURL} may have landed the row it is waiting for`);
|
|
1250
|
-
this.loadInstanceTask.perform(id);
|
|
1251
|
-
reloaded++;
|
|
1252
|
-
}
|
|
1253
|
-
for (let id of this.inflightGetCards.keys()) {
|
|
1254
|
-
if (this.realm.realmOf(rri(id)) !== realmURL) continue;
|
|
1255
|
-
realmEventsLogger.debug(`deferring reload of ${id} until its in-flight load settles, because a full index of ${realmURL} landed while it was reading`);
|
|
1256
|
-
this.reloadAfterInflightLoad.perform(id);
|
|
1257
|
-
}
|
|
1258
|
-
return reloaded;
|
|
1259
|
-
}
|
|
1260
|
-
reestablishReferences = buildTask(() => ({
|
|
1261
|
-
context: this,
|
|
1262
|
-
generator: function* () {
|
|
1263
|
-
let remoteIds = /* @__PURE__ */ new Set();
|
|
1264
|
-
for (let [id, referenceCount] of this.referenceCount) {
|
|
1265
|
-
if (referenceCount === 0) continue;
|
|
1266
|
-
if (isLocalId(id)) {
|
|
1267
|
-
let remoteIdsForLocal = this.store.getRemoteIds(id);
|
|
1268
|
-
if (remoteIdsForLocal.length === 0) {
|
|
1269
|
-
let error = this.store.getCardError(id);
|
|
1270
|
-
if (error?.meta?.remoteId) remoteIdsForLocal = [error.meta.remoteId];
|
|
1271
|
-
}
|
|
1272
|
-
for (let remoteId of remoteIdsForLocal) remoteIds.add(remoteId);
|
|
1273
|
-
} else remoteIds.add(id);
|
|
1274
|
-
}
|
|
1275
|
-
let shouldLog = remoteIds.size > 0;
|
|
1276
|
-
let fields = `references=${remoteIds.size} epoch=${this.#identityEpoch}`;
|
|
1277
|
-
let start = performance.now();
|
|
1278
|
-
let outcome = "cancelled";
|
|
1279
|
-
let errored = "";
|
|
1280
|
-
if (shouldLog) storeLogger.info(`re-establishing ${fields} outcome=started`);
|
|
1281
|
-
try {
|
|
1282
|
-
let count = (yield Promise.all([...remoteIds].map((id) => this.getCardInstance({ idOrDoc: id })))).filter((result) => !isCardInstance(result) && !isFileDefInstance(result)).length;
|
|
1283
|
-
outcome = "settled";
|
|
1284
|
-
errored = ` errored=${count}`;
|
|
1285
|
-
} catch (e) {
|
|
1286
|
-
outcome = "failed";
|
|
1287
|
-
throw e;
|
|
1288
|
-
} finally {
|
|
1289
|
-
if (shouldLog) storeLogger.info(`re-establishing ${fields} outcome=${outcome}${errored} durationMs=${Math.round(performance.now() - start)}`);
|
|
1290
|
-
}
|
|
1291
|
-
return remoteIds.size;
|
|
1292
|
-
}
|
|
1293
|
-
}), null, "reestablishReferences", null);
|
|
1294
|
-
#pendingRebuild = void 0;
|
|
1295
|
-
#accumulatePendingRebuild(realm, executableInvalidations, alreadyFlushed) {
|
|
1296
|
-
let pending = this.#pendingRebuild ??= {
|
|
1297
|
-
realm,
|
|
1298
|
-
triggerModules: /* @__PURE__ */ new Set(),
|
|
1299
|
-
modulesRefetched: /* @__PURE__ */ new Set(),
|
|
1300
|
-
events: 0
|
|
1301
|
-
};
|
|
1302
|
-
pending.realm = realm;
|
|
1303
|
-
pending.events++;
|
|
1304
|
-
for (let module of executableInvalidations) {
|
|
1305
|
-
pending.triggerModules.add(module);
|
|
1306
|
-
if (alreadyFlushed.has(module) || this.loaderService.loader.isModuleLoaded(module)) pending.modulesRefetched.add(module);
|
|
1307
|
-
}
|
|
1308
|
-
}
|
|
1309
|
-
rebuildForCodeChange = buildTask(() => ({
|
|
1310
|
-
context: this,
|
|
1311
|
-
generator: function* () {
|
|
1312
|
-
let telemetry = this.#clientTelemetry();
|
|
1313
|
-
let pending = this.#pendingRebuild;
|
|
1314
|
-
this.#pendingRebuild = void 0;
|
|
1315
|
-
let rebuildStart = telemetry?.isEnabled && pending ? performance.now() : void 0;
|
|
1316
|
-
this.loaderService.resetLoader();
|
|
1317
|
-
this.#resetIdentityInPlace();
|
|
1318
|
-
let cardsReloaded;
|
|
1319
|
-
try {
|
|
1320
|
-
cardsReloaded = yield this.reestablishReferences.perform();
|
|
1321
|
-
} finally {
|
|
1322
|
-
if (telemetry?.isEnabled && pending && rebuildStart !== void 0) {
|
|
1323
|
-
let triggerModules = [...pending.triggerModules].slice(0, 20);
|
|
1324
|
-
telemetry.recordEvent({
|
|
1325
|
-
event_type: "rebuild",
|
|
1326
|
-
rebuild_source: "realm-event",
|
|
1327
|
-
realm: pending.realm,
|
|
1328
|
-
duration_ms: Math.round(performance.now() - rebuildStart),
|
|
1329
|
-
trigger_modules: triggerModules,
|
|
1330
|
-
trigger_module: triggerModules[0] ?? "",
|
|
1331
|
-
modules_refetched: pending.modulesRefetched.size,
|
|
1332
|
-
cards_reloaded: cardsReloaded ?? 0,
|
|
1333
|
-
coalesced_events: pending.events
|
|
1334
|
-
});
|
|
1335
|
-
}
|
|
1336
|
-
}
|
|
1337
|
-
}
|
|
1338
|
-
}), null, "rebuildForCodeChange", "keepLatest");
|
|
1339
|
-
reloadTask = buildTask(() => ({
|
|
1340
|
-
context: this,
|
|
1341
|
-
generator: function* (instance, reloadTarget) {
|
|
1342
|
-
let reloadTracker = this.startTrackingCardLoad(instance.id);
|
|
1343
|
-
let maybeReloadedInstance;
|
|
1344
|
-
let isDelete = false;
|
|
1345
|
-
let identityMap = this.store;
|
|
1346
|
-
let identityEpoch = this.#identityEpoch;
|
|
1347
|
-
try {
|
|
1348
|
-
try {
|
|
1349
|
-
maybeReloadedInstance = yield this.reloadInstance(instance, identityMap, identityEpoch);
|
|
1350
|
-
} catch (err) {
|
|
1351
|
-
let cardError = processCardError(instance.id, err).errors[0];
|
|
1352
|
-
if (cardError?.awaitingIndex) maybeReloadedInstance = instance;
|
|
1353
|
-
else if (err.status === 404) isDelete = true;
|
|
1354
|
-
else maybeReloadedInstance = cardError;
|
|
1355
|
-
}
|
|
1356
|
-
if (this.#identityEpoch !== identityEpoch) {
|
|
1357
|
-
storeLogger.info(`dropping reload of ${instance.id}: it started in identity epoch #${identityEpoch}, which was superseded by #${this.#identityEpoch} while the reload was in flight`);
|
|
1358
|
-
return;
|
|
1359
|
-
}
|
|
1360
|
-
if (!isCardInstance(maybeReloadedInstance) || maybeReloadedInstance !== instance) yield this.stopAutoSaving(instance);
|
|
1361
|
-
if (maybeReloadedInstance) {
|
|
1362
|
-
this.setIdentityContext(maybeReloadedInstance);
|
|
1363
|
-
yield this.startAutoSaving(maybeReloadedInstance);
|
|
1364
|
-
}
|
|
1365
|
-
if (!isDelete && maybeReloadedInstance === instance) this.notifyCardReloadSubscribers(instance);
|
|
1366
|
-
if (isDelete) {
|
|
1367
|
-
yield this.stopAutoSaving(instance);
|
|
1368
|
-
let api = yield this.cardService.getAPI();
|
|
1369
|
-
let consumers = this.store.consumersOf(api, instance);
|
|
1370
|
-
this.store.delete(instance.id);
|
|
1371
|
-
for (let consumer of consumers) api.notifyLinksToTargetDeleted(consumer, instance.id);
|
|
1372
|
-
this.notifyCardInvalidationSubscribers(instance.id);
|
|
1373
|
-
}
|
|
1374
|
-
} finally {
|
|
1375
|
-
let localId$1 = instance[localId];
|
|
1376
|
-
if (reloadTarget && this.#reloadTargets.get(localId$1) === reloadTarget) this.#reloadTargets.delete(localId$1);
|
|
1377
|
-
this.finishTrackingCardLoad(instance.id, reloadTracker);
|
|
1378
|
-
}
|
|
1379
|
-
}
|
|
1380
|
-
}), null, "reloadTask", null);
|
|
1381
|
-
reloadFileMetaTask = buildTask(() => ({
|
|
1382
|
-
context: this,
|
|
1383
|
-
generator: function* (url) {
|
|
1384
|
-
let waiterLabel = `reloadFileMeta ${url}`;
|
|
1385
|
-
yield this.withTestWaiters(waiterLabel, async () => {
|
|
1386
|
-
let instanceOrError = await this.getFileMetaInstance({
|
|
1387
|
-
idOrDoc: url,
|
|
1388
|
-
opts: { noCache: true }
|
|
1389
|
-
});
|
|
1390
|
-
this.setIdentityContext(instanceOrError, "file-meta");
|
|
1391
|
-
});
|
|
1392
|
-
}
|
|
1393
|
-
}), null, "reloadFileMetaTask", null);
|
|
1394
|
-
onInstanceUpdated = (instance, fieldName) => {
|
|
1395
|
-
if (fieldName === "id") return;
|
|
1396
|
-
if (isCardInstance(instance)) {
|
|
1397
|
-
this._instanceMutationVersion++;
|
|
1398
|
-
this.#recordLocalEdit(instance, fieldName);
|
|
1399
|
-
let autoSaveState = this.initOrGetAutoSaveState(instance);
|
|
1400
|
-
autoSaveState.hasUnsavedChanges = true;
|
|
1401
|
-
this.doAutoSave(instance);
|
|
1402
|
-
}
|
|
1403
|
-
};
|
|
1404
|
-
#recordLocalEdit(instance, fieldName) {
|
|
1405
|
-
let edits = this.#localEdits.get(instance);
|
|
1406
|
-
if (!edits) {
|
|
1407
|
-
edits = /* @__PURE__ */ new Map();
|
|
1408
|
-
this.#localEdits.set(instance, edits);
|
|
1409
|
-
}
|
|
1410
|
-
edits.set(fieldName.split(".")[0], ++this.#localEditSeq);
|
|
1411
|
-
}
|
|
1412
|
-
#acknowledgeLocalEdits(instance, sentSeq) {
|
|
1413
|
-
let edits = this.#localEdits.get(instance);
|
|
1414
|
-
if (!edits) return;
|
|
1415
|
-
for (let [fieldName, seq] of edits) if (seq <= sentSeq) edits.delete(fieldName);
|
|
1416
|
-
}
|
|
1417
|
-
#pinnedFields(instance) {
|
|
1418
|
-
let pinned = new Set(this.#localEdits.get(instance)?.keys() ?? []);
|
|
1419
|
-
for (let field of this.#optimisticFields.get(instance[localId]) ?? []) pinned.delete(field);
|
|
1420
|
-
return pinned;
|
|
1421
|
-
}
|
|
1422
|
-
#recordOptimisticFields(instance, basis, result) {
|
|
1423
|
-
let changed = /* @__PURE__ */ new Set();
|
|
1424
|
-
for (let member of ["attributes", "relationships"]) {
|
|
1425
|
-
let before = basis[member] ?? {};
|
|
1426
|
-
let after = result[member] ?? {};
|
|
1427
|
-
for (let key of new Set([...Object.keys(before), ...Object.keys(after)])) if (!isEqual(before[key], after[key])) changed.add(key.split(".")[0]);
|
|
1428
|
-
}
|
|
1429
|
-
if (changed.size === 0) return;
|
|
1430
|
-
let localId$2 = instance[localId];
|
|
1431
|
-
let fields = this.#optimisticFields.get(localId$2);
|
|
1432
|
-
if (!fields) {
|
|
1433
|
-
fields = /* @__PURE__ */ new Set();
|
|
1434
|
-
this.#optimisticFields.set(localId$2, fields);
|
|
1435
|
-
}
|
|
1436
|
-
for (let field of changed) fields.add(field);
|
|
1437
|
-
}
|
|
1438
|
-
releaseOptimisticFields(localId) {
|
|
1439
|
-
this.#optimisticFields.delete(localId);
|
|
1440
|
-
}
|
|
1441
|
-
setIdentityContext(instanceOrError, readType = "card") {
|
|
1442
|
-
if (readType === "file-meta") {
|
|
1443
|
-
let id = instanceOrError.id;
|
|
1444
|
-
if (!id) return;
|
|
1445
|
-
this.store.addFileMetaInstanceOrError(id, instanceOrError);
|
|
1446
|
-
return;
|
|
1447
|
-
}
|
|
1448
|
-
let instance = isCardInstance(instanceOrError) ? instanceOrError : void 0;
|
|
1449
|
-
if (!instance && !instanceOrError.id) return;
|
|
1450
|
-
if (!instance && instanceOrError.awaitingIndex && this.store.getCard(instanceOrError.id)) return;
|
|
1451
|
-
this.store.addCardInstanceOrError(instance ? instance.id ?? instance[localId] : instanceOrError.id, instanceOrError);
|
|
1452
|
-
}
|
|
1453
|
-
async createFileMetaFromSerialized(resource, doc, relativeTo, dependencyTrackingContext) {
|
|
1454
|
-
let instance = await (await this.cardService.getAPI()).createFromSerialized(resource, doc, relativeTo, {
|
|
1455
|
-
store: this.store,
|
|
1456
|
-
dependencyTrackingContext
|
|
1457
|
-
});
|
|
1458
|
-
this.setIdentityContext(instance, "file-meta");
|
|
1459
|
-
return instance;
|
|
1460
|
-
}
|
|
1461
|
-
async addResourceFromSearchData(resource, dependencyTrackingContext) {
|
|
1462
|
-
if (!resource.id) throw new Error("resource must have an id");
|
|
1463
|
-
let canonicalId = this.network.virtualNetwork.unresolveURL(resource.id);
|
|
1464
|
-
if (canonicalId !== resource.id) resource.id = canonicalId;
|
|
1465
|
-
if (isFileMetaResource(resource)) {
|
|
1466
|
-
let existingInstance = this.peek(resource.id, { type: "file-meta" });
|
|
1467
|
-
if (existingInstance && isFileDefInstance(existingInstance)) return existingInstance;
|
|
1468
|
-
let doc = { data: resource };
|
|
1469
|
-
return this.createFileMetaFromSerialized(resource, doc, resource.id, dependencyTrackingContext);
|
|
1470
|
-
}
|
|
1471
|
-
let existingInstance = this.peek(resource.id);
|
|
1472
|
-
if (existingInstance && isCardInstance(existingInstance)) return existingInstance;
|
|
1473
|
-
resource[queryFieldSeedFromSearchSymbol] = true;
|
|
1474
|
-
return this.addWithoutPersisting({ data: resource }, {
|
|
1475
|
-
relativeTo: resource.id,
|
|
1476
|
-
dependencyTrackingContext
|
|
1477
|
-
});
|
|
1478
|
-
}
|
|
1479
|
-
async startAutoSaving(instanceOrError) {
|
|
1480
|
-
if (!isCardInstance(instanceOrError)) return;
|
|
1481
|
-
if (this.renderContextBlocksPersistence()) return;
|
|
1482
|
-
let instance = instanceOrError;
|
|
1483
|
-
this.cardApiCache = await this.cardService.getAPI();
|
|
1484
|
-
this.cardApiCache.unsubscribeFromChanges(instance, this.onInstanceUpdated);
|
|
1485
|
-
this.cardApiCache.subscribeToChanges(instance, this.onInstanceUpdated);
|
|
1486
|
-
}
|
|
1487
|
-
async stopAutoSaving(instanceOrError) {
|
|
1488
|
-
if (!isCardInstance(instanceOrError)) return;
|
|
1489
|
-
let instance = instanceOrError;
|
|
1490
|
-
this.cardApiCache = await this.cardService.getAPI();
|
|
1491
|
-
this.cardApiCache.unsubscribeFromChanges(instance, this.onInstanceUpdated);
|
|
1492
|
-
this.autoSaveStates.delete(instance.id);
|
|
1493
|
-
this.autoSaveStates.delete(instance[localId]);
|
|
1494
|
-
}
|
|
1495
|
-
async getCardInstance({ idOrDoc, relativeTo, realm, opts }) {
|
|
1496
|
-
let deferred;
|
|
1497
|
-
let id = asURL(idOrDoc, this.network.virtualNetwork);
|
|
1498
|
-
if (id) {
|
|
1499
|
-
let working = this.inflightGetCards.get(id);
|
|
1500
|
-
if (working) return working;
|
|
1501
|
-
deferred = new Deferred();
|
|
1502
|
-
this.inflightGetCards.set(id, deferred.promise);
|
|
1503
|
-
}
|
|
1504
|
-
try {
|
|
1505
|
-
if (!id) if (!this.renderContextBlocksPersistence()) {
|
|
1506
|
-
let doc = idOrDoc;
|
|
1507
|
-
let newInstance = await this.createFromSerialized(doc.data, doc, relativeTo, opts?.dependencyTrackingContext);
|
|
1508
|
-
let maybeError = await this.persistAndUpdate(newInstance, {
|
|
1509
|
-
realm,
|
|
1510
|
-
localDir: opts?.localDir
|
|
1511
|
-
});
|
|
1512
|
-
if (!isCardInstance(maybeError)) return maybeError;
|
|
1513
|
-
this.store.setCard(newInstance.id, newInstance);
|
|
1514
|
-
deferred?.fulfill(newInstance);
|
|
1515
|
-
return newInstance;
|
|
1516
|
-
} else throw new Error(`cannot save serialized doc in render context`);
|
|
1517
|
-
let existingInstance = this.peek(id);
|
|
1518
|
-
if (!opts?.noCache && existingInstance) {
|
|
1519
|
-
deferred?.fulfill(existingInstance);
|
|
1520
|
-
return existingInstance;
|
|
1521
|
-
}
|
|
1522
|
-
let vn = this.network.virtualNetwork;
|
|
1523
|
-
if (isLocalId(id) && !vn.isRegisteredPrefix(id)) {
|
|
1524
|
-
let remoteId = this.store.getRemoteIds(id)?.[0];
|
|
1525
|
-
if (!remoteId) throw new Error(`instance with local id ${id} does not exist in the store`);
|
|
1526
|
-
id = remoteId;
|
|
1527
|
-
}
|
|
1528
|
-
let url = vn.isRegisteredPrefix(id) ? vn.toURL(id).href : id;
|
|
1529
|
-
let doc = typeof idOrDoc !== "string" ? idOrDoc : void 0;
|
|
1530
|
-
if (!doc) {
|
|
1531
|
-
let json;
|
|
1532
|
-
if (this.isRenderStore && globalThis.__boxelRenderContext) {
|
|
1533
|
-
let result = await this.cardService.getSource(vn.toURL(`${url}.json`));
|
|
1534
|
-
if (result.status === 200) {
|
|
1535
|
-
if (!isJsonContentType(result.contentType)) throw new Error(`Could not load ${url} as a card: the response (content type ${result.contentType ?? "unknown"}) is not a card document. If this is a relationship link, it likely points at a non-card URL (e.g. an image) rather than a card.`);
|
|
1536
|
-
try {
|
|
1537
|
-
json = JSON.parse(result.content);
|
|
1538
|
-
} catch {
|
|
1539
|
-
throw new Error(`Could not load ${url} as a card: its source (content type ${result.contentType ?? "unknown"}) is not valid JSON.`);
|
|
1540
|
-
}
|
|
1541
|
-
} else throw new Error(`Received non-200 status fetching instance source ${url}.json: ${result.content}`);
|
|
1542
|
-
} else json = await this.cardService.fetchJSON(url);
|
|
1543
|
-
if (!isSingleCardDocument(json)) {
|
|
1544
|
-
if (isSingleFileMetaDocument(json)) {
|
|
1545
|
-
if (id) this.fileReadIds.add(id);
|
|
1546
|
-
let fileMeta = await this.getFileMetaInstance({
|
|
1547
|
-
idOrDoc: url,
|
|
1548
|
-
opts: {
|
|
1549
|
-
noCache: opts?.noCache,
|
|
1550
|
-
dependencyTrackingContext: opts?.dependencyTrackingContext
|
|
1551
|
-
}
|
|
1552
|
-
});
|
|
1553
|
-
if (id && !isFileDefInstance(fileMeta)) this.store.addFileMetaInstanceOrError(id, fileMeta);
|
|
1554
|
-
deferred?.fulfill(fileMeta);
|
|
1555
|
-
return fileMeta;
|
|
1556
|
-
}
|
|
1557
|
-
throw new Error(`bug: server returned a non card document for ${url}:
|
|
1558
|
-
${JSON.stringify(json, null, 2)}`);
|
|
1559
|
-
}
|
|
1560
|
-
if (!json.data.id || !isResolvableInstanceId(json.data.id, this.network.virtualNetwork)) json.data.id = rri(url);
|
|
1561
|
-
if (!json.data.meta?.realmURL) {
|
|
1562
|
-
let realmURL = this.realm.realmOf(rri(url));
|
|
1563
|
-
if (realmURL) json.data.meta = {
|
|
1564
|
-
...json.data.meta ?? {},
|
|
1565
|
-
realmURL
|
|
1566
|
-
};
|
|
1567
|
-
}
|
|
1568
|
-
doc = json;
|
|
1569
|
-
}
|
|
1570
|
-
let instance = await this.createFromSerialized(doc.data, doc, doc.data.id, opts?.dependencyTrackingContext);
|
|
1571
|
-
this.store.setCard(url, instance);
|
|
1572
|
-
deferred?.fulfill(instance);
|
|
1573
|
-
if (!existingInstance || !isCardInstance(existingInstance)) {
|
|
1574
|
-
this.setIdentityContext(instance);
|
|
1575
|
-
await this.startAutoSaving(instance);
|
|
1576
|
-
}
|
|
1577
|
-
return instance;
|
|
1578
|
-
} catch (error) {
|
|
1579
|
-
let cardError = processCardError(id, error).errors[0];
|
|
1580
|
-
let running = cardError?.awaitingIndex && id ? this.store.getCard(id) : void 0;
|
|
1581
|
-
if (running) {
|
|
1582
|
-
deferred?.fulfill(running);
|
|
1583
|
-
return running;
|
|
1584
|
-
}
|
|
1585
|
-
deferred?.fulfill(cardError);
|
|
1586
|
-
this.setIdentityContext(cardError);
|
|
1587
|
-
let status = cardError?.status ?? error?.status;
|
|
1588
|
-
let isSystemCardDefault = isSystemCardDefaultId(id, idOrDoc, cardError?.id);
|
|
1589
|
-
let shouldLogAsError = !(isTesting() && status === 404 && isSystemCardDefault);
|
|
1590
|
-
let message = `error getting instance ${JSON.stringify(idOrDoc, null, 2)}: ${stringifyErrorForLog(error)}`;
|
|
1591
|
-
if (shouldLogAsError) storeLogger.error(message);
|
|
1592
|
-
else storeLogger.debug(message);
|
|
1593
|
-
return cardError;
|
|
1594
|
-
} finally {
|
|
1595
|
-
if (id && deferred && this.inflightGetCards.get(id) === deferred.promise) this.inflightGetCards.delete(id);
|
|
1596
|
-
}
|
|
1597
|
-
}
|
|
1598
|
-
async getFileMetaInstance({ idOrDoc, opts }) {
|
|
1599
|
-
let deferred;
|
|
1600
|
-
let id = asURL(idOrDoc, this.network.virtualNetwork);
|
|
1601
|
-
if (!id) throw new Error("file-meta reads require a URL id");
|
|
1602
|
-
let working = this.inflightGetFileMeta.get(id);
|
|
1603
|
-
if (working) return working;
|
|
1604
|
-
deferred = new Deferred();
|
|
1605
|
-
this.inflightGetFileMeta.set(id, deferred.promise);
|
|
1606
|
-
try {
|
|
1607
|
-
let existingInstance = this.peek(id, { type: "file-meta" });
|
|
1608
|
-
if (!opts?.noCache && existingInstance) {
|
|
1609
|
-
deferred.fulfill(existingInstance);
|
|
1610
|
-
return existingInstance;
|
|
1611
|
-
}
|
|
1612
|
-
let vn = this.network.virtualNetwork;
|
|
1613
|
-
if (isLocalId(id) && !vn.isRegisteredPrefix(id)) throw new Error(`file-meta reads do not support local ids (${id})`);
|
|
1614
|
-
let url = vn.isRegisteredPrefix(id) ? vn.toURL(id).href : id;
|
|
1615
|
-
let fileMetaDoc;
|
|
1616
|
-
if (this.isRenderStore && globalThis.__boxelRenderContext) fileMetaDoc = await this.extractFileMetaDirectly(url);
|
|
1617
|
-
else fileMetaDoc = await this.store.loadFileMetaDocument(url, { dependencyTrackingContext: opts?.dependencyTrackingContext });
|
|
1618
|
-
if (isCardError(fileMetaDoc)) throw fileMetaDoc;
|
|
1619
|
-
let fileInstance = await (await this.cardService.getAPI()).createFromSerialized(fileMetaDoc.data, fileMetaDoc, fileMetaDoc.data.id ?? new URL(url), {
|
|
1620
|
-
store: this.store,
|
|
1621
|
-
dependencyTrackingContext: opts?.dependencyTrackingContext
|
|
1622
|
-
});
|
|
1623
|
-
this.setIdentityContext(fileInstance, "file-meta");
|
|
1624
|
-
if (fileMetaDoc.data.id && fileMetaDoc.data.id !== id) this.store.setFileMeta(id, fileInstance);
|
|
1625
|
-
deferred.fulfill(fileInstance);
|
|
1626
|
-
return fileInstance;
|
|
1627
|
-
} catch (error) {
|
|
1628
|
-
let cardError = processCardError(id, error, "file-meta").errors[0];
|
|
1629
|
-
deferred.fulfill(cardError);
|
|
1630
|
-
console.error(`error getting file-meta instance ${JSON.stringify(idOrDoc, null, 2)}: ${JSON.stringify(error, null, 2)}`, error);
|
|
1631
|
-
return cardError;
|
|
1632
|
-
} finally {
|
|
1633
|
-
if (this.inflightGetFileMeta.get(id) === deferred.promise) this.inflightGetFileMeta.delete(id);
|
|
1634
|
-
}
|
|
1635
|
-
}
|
|
1636
|
-
async extractFileMetaDirectly(url) {
|
|
1637
|
-
let fileDefCodeRef = resolveFileDefCodeRef(new URL(url));
|
|
1638
|
-
let result = await new FileDefAttributesExtractor({
|
|
1639
|
-
loaderService: this.loaderService,
|
|
1640
|
-
network: this.network,
|
|
1641
|
-
fileURL: url,
|
|
1642
|
-
fileDefCodeRef,
|
|
1643
|
-
baseFileDefCodeRef: baseFileRef,
|
|
1644
|
-
contentHash: void 0,
|
|
1645
|
-
contentSize: void 0,
|
|
1646
|
-
buildError: (errorUrl, error) => {
|
|
1647
|
-
let errorJSONAPI = formattedError(errorUrl, error).errors[0];
|
|
1648
|
-
return errorJsonApiToErrorEntry(errorJSONAPI);
|
|
1649
|
-
}
|
|
1650
|
-
}).extract();
|
|
1651
|
-
if (result.status === "error" || !result.resource) return new CardError(result.error?.error?.message ?? "File extract failed", { status: 500 });
|
|
1652
|
-
return { data: result.resource };
|
|
1653
|
-
}
|
|
1654
|
-
useEphemeralState(instance) {
|
|
1655
|
-
if (!instance) return false;
|
|
1656
|
-
let realmURL$2 = instance[realmURL];
|
|
1657
|
-
if (!realmURL$2) return false;
|
|
1658
|
-
return !this.realm.permissions(realmURL$2.href).canWrite;
|
|
1659
|
-
}
|
|
1660
|
-
doAutoSave(idOrInstance, opts) {
|
|
1661
|
-
if (this.isRenderStore) return;
|
|
1662
|
-
let instance;
|
|
1663
|
-
if (typeof idOrInstance === "string") {
|
|
1664
|
-
let maybeInstance = this.peek(idOrInstance);
|
|
1665
|
-
if (!isCardInstance(maybeInstance)) return;
|
|
1666
|
-
instance = maybeInstance;
|
|
1667
|
-
} else instance = idOrInstance;
|
|
1668
|
-
if (this.useEphemeralState(instance)) return;
|
|
1669
|
-
let autoSaveState = this.initOrGetAutoSaveState(instance);
|
|
1670
|
-
autoSaveState.lastSaveError = void 0;
|
|
1671
|
-
let localId$3 = instance[localId];
|
|
1672
|
-
let pending = this.#pendingAutoSaves.get(localId$3);
|
|
1673
|
-
if (!pending) {
|
|
1674
|
-
pending = {
|
|
1675
|
-
instance,
|
|
1676
|
-
firstChangeAt: Date.now(),
|
|
1677
|
-
timer: void 0,
|
|
1678
|
-
isImmediate: false,
|
|
1679
|
-
keepalive: false,
|
|
1680
|
-
isSending: false,
|
|
1681
|
-
waiterToken: waiter.beginAsync(void 0, `pendingAutoSave ${localId$3}`),
|
|
1682
|
-
sessionEpoch: this.#sessionEpoch,
|
|
1683
|
-
...this.#holdForAutoSave(instance)
|
|
1684
|
-
};
|
|
1685
|
-
this.#pendingAutoSaves.set(localId$3, pending);
|
|
1686
|
-
}
|
|
1687
|
-
pending.instance = instance;
|
|
1688
|
-
if (opts?.isImmediate) pending.isImmediate = true;
|
|
1689
|
-
if (pending.isSending) return;
|
|
1690
|
-
if (pending.isImmediate) {
|
|
1691
|
-
this.#sendAutoSave(localId$3);
|
|
1692
|
-
return;
|
|
1693
|
-
}
|
|
1694
|
-
let { autoSaveQuietPeriodMs, autoSaveMaxWaitMs } = this.environmentService;
|
|
1695
|
-
let wait = Math.max(0, Math.min(autoSaveQuietPeriodMs, pending.firstChangeAt + autoSaveMaxWaitMs - Date.now()));
|
|
1696
|
-
clearTimeout(pending.timer);
|
|
1697
|
-
pending.timer = setTimeout(() => this.#sendAutoSave(localId$3), wait);
|
|
1698
|
-
this.calculateLastSavedMsg(autoSaveState, { hasPendingSave: true });
|
|
1699
|
-
}
|
|
1700
|
-
#sendPendingAutoSaves(opts) {
|
|
1701
|
-
for (let localId of [...this.#pendingAutoSaves.keys()]) this.#sendAutoSave(localId, opts);
|
|
1702
|
-
}
|
|
1703
|
-
#dropPendingAutoSaves() {
|
|
1704
|
-
for (let [localId, pending] of [...this.#pendingAutoSaves]) {
|
|
1705
|
-
if (pending.isSending) continue;
|
|
1706
|
-
clearTimeout(pending.timer);
|
|
1707
|
-
this.#pendingAutoSaves.delete(localId);
|
|
1708
|
-
waiter.endAsync(pending.waiterToken);
|
|
1709
|
-
}
|
|
1710
|
-
}
|
|
1711
|
-
#sendAutoSave(localId, opts) {
|
|
1712
|
-
let pending = this.#pendingAutoSaves.get(localId);
|
|
1713
|
-
if (!pending) return;
|
|
1714
|
-
if (opts?.keepalive) pending.keepalive = true;
|
|
1715
|
-
clearTimeout(pending.timer);
|
|
1716
|
-
pending.timer = void 0;
|
|
1717
|
-
if (pending.isSending) return;
|
|
1718
|
-
pending.isSending = true;
|
|
1719
|
-
let previous = this.autoSavePromises.get(localId);
|
|
1720
|
-
let run;
|
|
1721
|
-
run = (async () => {
|
|
1722
|
-
try {
|
|
1723
|
-
await previous;
|
|
1724
|
-
await this.inflightCardMutations.get(localId);
|
|
1725
|
-
if (this.#pendingAutoSaves.get(localId) === pending) this.#pendingAutoSaves.delete(localId);
|
|
1726
|
-
if (pending.sessionEpoch !== this.#sessionEpoch) {
|
|
1727
|
-
storeLogger.warn(`not saving ${localId}: the session it was edited in has ended`);
|
|
1728
|
-
return;
|
|
1729
|
-
}
|
|
1730
|
-
let { instance } = pending;
|
|
1731
|
-
let autoSaveState = this.initOrGetAutoSaveState(instance);
|
|
1732
|
-
autoSaveState.isSaving = true;
|
|
1733
|
-
await this.trackingSaveState(instance, localId, () => this.saveInstance(instance, {
|
|
1734
|
-
...pending.isImmediate ? { isImmediate: true } : {},
|
|
1735
|
-
...pending.keepalive ? { keepalive: true } : {}
|
|
1736
|
-
}));
|
|
1737
|
-
} catch {} finally {
|
|
1738
|
-
if (this.#pendingAutoSaves.get(localId) === pending) this.#pendingAutoSaves.delete(localId);
|
|
1739
|
-
if (this.autoSavePromises.get(localId) === run) this.autoSavePromises.delete(localId);
|
|
1740
|
-
this.#releaseAutoSaveHold(pending);
|
|
1741
|
-
waiter.endAsync(pending.waiterToken);
|
|
1742
|
-
}
|
|
1743
|
-
})();
|
|
1744
|
-
this.autoSavePromises.set(localId, run);
|
|
1745
|
-
}
|
|
1746
|
-
#holdForAutoSave(instance) {
|
|
1747
|
-
let holdKey = asURL(instance.id ?? instance[localId], this.network.virtualNetwork);
|
|
1748
|
-
this.referenceCount.set(holdKey, (this.referenceCount.get(holdKey) ?? 0) + 1);
|
|
1749
|
-
this.#autoSaveHolds.set(holdKey, (this.#autoSaveHolds.get(holdKey) ?? 0) + 1);
|
|
1750
|
-
return {
|
|
1751
|
-
holdKey,
|
|
1752
|
-
heldIn: this.referenceCount
|
|
1753
|
-
};
|
|
1754
|
-
}
|
|
1755
|
-
#releaseAutoSaveHold(pending) {
|
|
1756
|
-
if (pending.heldIn !== this.referenceCount) return;
|
|
1757
|
-
let { holdKey } = pending;
|
|
1758
|
-
let holds = (this.#autoSaveHolds.get(holdKey) ?? 0) - 1;
|
|
1759
|
-
if (holds > 0) this.#autoSaveHolds.set(holdKey, holds);
|
|
1760
|
-
else this.#autoSaveHolds.delete(holdKey);
|
|
1761
|
-
if (this.#teardownAfterSave.has(holdKey)) {
|
|
1762
|
-
if (holds <= 0) this.#teardownAfterSave.delete(holdKey);
|
|
1763
|
-
this.dropReference(holdKey);
|
|
1764
|
-
return;
|
|
1765
|
-
}
|
|
1766
|
-
let count = (this.referenceCount.get(holdKey) ?? 0) - 1;
|
|
1767
|
-
if (count > 0) this.referenceCount.set(holdKey, count);
|
|
1768
|
-
else this.referenceCount.delete(holdKey);
|
|
1769
|
-
}
|
|
1770
|
-
async trackingSaveState(instance, stateKey, save) {
|
|
1771
|
-
let autoSaveState = this.initOrGetAutoSaveState(instance);
|
|
1772
|
-
try {
|
|
1773
|
-
let maybeError = await save();
|
|
1774
|
-
autoSaveState.hasUnsavedChanges = this.#pendingAutoSaves.has(instance[localId]);
|
|
1775
|
-
autoSaveState.lastSaved = Date.now();
|
|
1776
|
-
autoSaveState.lastSavedErrorMsg = void 0;
|
|
1777
|
-
autoSaveState.lastSaveError = maybeError && !isCardInstance(maybeError) ? maybeError : void 0;
|
|
1778
|
-
return maybeError;
|
|
1779
|
-
} catch (error) {
|
|
1780
|
-
autoSaveState.lastSaveError = error;
|
|
1781
|
-
throw error;
|
|
1782
|
-
} finally {
|
|
1783
|
-
autoSaveState.isSaving = false;
|
|
1784
|
-
this.calculateLastSavedMsg(autoSaveState, { hasPendingSave: this.#pendingAutoSaves.has(instance[localId]) });
|
|
1785
|
-
if (isLocalId(stateKey) && instance.id) this.autoSaveStates.set(instance.id, autoSaveState);
|
|
1786
|
-
}
|
|
1787
|
-
}
|
|
1788
|
-
initOrGetAutoSaveState(instance) {
|
|
1789
|
-
let autoSaveState = this.autoSaveStates.get(instance.id ?? instance[localId]);
|
|
1790
|
-
if (!autoSaveState) {
|
|
1791
|
-
autoSaveState = new TrackedObject({
|
|
1792
|
-
isSaving: false,
|
|
1793
|
-
hasUnsavedChanges: false,
|
|
1794
|
-
lastSaved: void 0,
|
|
1795
|
-
lastSavedErrorMsg: void 0,
|
|
1796
|
-
lastSaveError: void 0
|
|
1797
|
-
});
|
|
1798
|
-
this.autoSaveStates.set(instance[localId], autoSaveState);
|
|
1799
|
-
}
|
|
1800
|
-
if (instance.id && !this.autoSaveStates.get(instance.id)) this.autoSaveStates.set(instance.id, autoSaveState);
|
|
1801
|
-
return autoSaveState;
|
|
1802
|
-
}
|
|
1803
|
-
async saveInstance(instance, opts) {
|
|
1804
|
-
if (this.renderContextBlocksPersistence()) return;
|
|
1805
|
-
let persistOpts = opts?.keepalive ? { keepalive: true } : void 0;
|
|
1806
|
-
if (opts?.isImmediate || opts?.keepalive) return await this.persistAndUpdate(instance, persistOpts);
|
|
1807
|
-
else {
|
|
1808
|
-
let [result] = await Promise.all([this.persistAndUpdate(instance, persistOpts), delay(500)]);
|
|
1809
|
-
return result;
|
|
1810
|
-
}
|
|
1811
|
-
}
|
|
1812
|
-
async saveCardDocument(doc, opts) {
|
|
1813
|
-
let isSaved = !!doc.data.id;
|
|
1814
|
-
let url = resolveDocUrl(doc.data.id, opts?.realm, opts?.localDir);
|
|
1815
|
-
let body = JSON.stringify(doc, null, 2);
|
|
1816
|
-
let keepaliveBytes = opts?.keepalive ? new TextEncoder().encode(body).length : 0;
|
|
1817
|
-
let keepalive = keepaliveBytes > 0 && this.#keepaliveBytesInFlight + keepaliveBytes <= KEEPALIVE_BODY_LIMIT;
|
|
1818
|
-
if (keepalive) this.#keepaliveBytesInFlight += keepaliveBytes;
|
|
1819
|
-
let json = await this.cardService.fetchJSON(url, {
|
|
1820
|
-
method: isSaved ? "PATCH" : "POST",
|
|
1821
|
-
body,
|
|
1822
|
-
...keepalive ? { keepalive: true } : {},
|
|
1823
|
-
headers: {
|
|
1824
|
-
"Content-Type": SupportedMimeType.CardJson,
|
|
1825
|
-
...headlessCommandWriteHeaders(),
|
|
1826
|
-
...opts?.skipIndexWait === true ? { [SKIP_INDEX_WAIT_HEADER]: "1" } : {}
|
|
1827
|
-
},
|
|
1828
|
-
clientRequestId: opts?.clientRequestId
|
|
1829
|
-
}).finally(() => {
|
|
1830
|
-
if (keepalive) this.#keepaliveBytesInFlight -= keepaliveBytes;
|
|
1831
|
-
});
|
|
1832
|
-
if (!isSingleCardDocument(json)) throw new Error(`bug: arg is not a card document:
|
|
1833
|
-
${JSON.stringify(json, null, 2)}`);
|
|
1834
|
-
return json;
|
|
1835
|
-
}
|
|
1836
|
-
calculateLastSavedMsg(autoSaveState, opts) {
|
|
1837
|
-
let savedMessage;
|
|
1838
|
-
if (autoSaveState.lastSaveError) savedMessage = `Failed to save: ${this.getErrorMessage(autoSaveState.lastSaveError)}`;
|
|
1839
|
-
else if (opts?.hasPendingSave) savedMessage = "Unsaved changes";
|
|
1840
|
-
else if (autoSaveState.lastSaved) savedMessage = `Saved ${formatDistanceToNow(autoSaveState.lastSaved, { addSuffix: true })}`;
|
|
1841
|
-
if (autoSaveState.lastSavedErrorMsg != savedMessage) autoSaveState.lastSavedErrorMsg = savedMessage;
|
|
1842
|
-
}
|
|
1843
|
-
getErrorMessage(error) {
|
|
1844
|
-
if ("meta" in error && typeof error.meta === "object" && "responseHeaders" in error.meta && error.meta.responseHeaders && typeof error.meta.responseHeaders === "object") {
|
|
1845
|
-
let wafRule = Object.entries(error.meta.responseHeaders).find(([header]) => header.toLowerCase() === "x-blocked-by-waf-rule")?.[1];
|
|
1846
|
-
if (wafRule) return `Request blocked by Web Application Firewall. X-blocked-by-waf-rule response header specifies rule: ${wafRule}`;
|
|
1847
|
-
}
|
|
1848
|
-
if (error.message) return error.message;
|
|
1849
|
-
return "Unknown error";
|
|
1850
|
-
}
|
|
1851
|
-
async persistAndUpdate(instance, opts) {
|
|
1852
|
-
let waiterLabel = `persistAndUpdate ${instance.id ?? instance[localId]}`;
|
|
1853
|
-
return await this.withTestWaiters(waiterLabel, async () => {
|
|
1854
|
-
let isNew = !instance.id;
|
|
1855
|
-
return await this.withCardMutationLock(instance[localId], async () => {
|
|
1856
|
-
let endCreate;
|
|
1857
|
-
try {
|
|
1858
|
-
let realmURL$3 = instance[realmURL];
|
|
1859
|
-
if (!realmURL$3) {
|
|
1860
|
-
let defaultRealmHref = opts?.realm ?? this.realm.defaultWritableRealm?.path;
|
|
1861
|
-
if (!defaultRealmHref) throw new Error("Could not find a writable realm");
|
|
1862
|
-
realmURL$3 = new URL(defaultRealmHref);
|
|
1863
|
-
}
|
|
1864
|
-
let doc;
|
|
1865
|
-
let sentSeq;
|
|
1866
|
-
({doc, sentSeq, endCreate} = await this.#serializeForSave(instance));
|
|
1867
|
-
let json = await this.saveCardDocument(doc, {
|
|
1868
|
-
realm: realmURL$3.href,
|
|
1869
|
-
localDir: opts?.localDir,
|
|
1870
|
-
clientRequestId: opts?.clientRequestId,
|
|
1871
|
-
skipIndexWait: opts?.skipIndexWait,
|
|
1872
|
-
keepalive: opts?.keepalive
|
|
1873
|
-
});
|
|
1874
|
-
let api = await this.cardService.getAPI();
|
|
1875
|
-
if (needsServerStateMerge(instance, json)) {
|
|
1876
|
-
let serverState = cloneDeep(json);
|
|
1877
|
-
delete serverState.data.attributes;
|
|
1878
|
-
delete serverState.data.relationships;
|
|
1879
|
-
await api.updateFromSerialized(instance, serverState, this.store);
|
|
1880
|
-
}
|
|
1881
|
-
if (isNew) await this.assignRemoteIdentity(instance, json.data.id);
|
|
1882
|
-
this.#recordWrittenVersion(instance, json);
|
|
1883
|
-
this.#acknowledgeLocalEdits(instance, sentSeq);
|
|
1884
|
-
if (this.onSaveSubscriber) this.onSaveSubscriber(this.network.virtualNetwork.toURL(json.data.id), json);
|
|
1885
|
-
return instance;
|
|
1886
|
-
} catch (err) {
|
|
1887
|
-
console.error(`Failed to save ${instance.id}: `, err);
|
|
1888
|
-
let cardError = processCardError(instance.id ?? instance[localId], err).errors[0];
|
|
1889
|
-
this.setIdentityContext(cardError);
|
|
1890
|
-
let remoteId = cardError.meta?.remoteId;
|
|
1891
|
-
if (remoteId && (!cardError.id || isLocalId(cardError.id))) this.store.addCardInstanceOrError(remoteId, cardError);
|
|
1892
|
-
return cardError;
|
|
1893
|
-
} finally {
|
|
1894
|
-
endCreate?.();
|
|
1895
|
-
}
|
|
1896
|
-
});
|
|
1897
|
-
});
|
|
1898
|
-
}
|
|
1899
|
-
async #serializeForSave(instance) {
|
|
1900
|
-
for (;;) {
|
|
1901
|
-
let sentSeq = this.#localEditSeq;
|
|
1902
|
-
let doc = await this.cardService.serializeCard(instance, {
|
|
1903
|
-
useAbsoluteURL: true,
|
|
1904
|
-
withLocalResourcesIncluded: true,
|
|
1905
|
-
omitQueryFields: true
|
|
1906
|
-
});
|
|
1907
|
-
let pendingCreates = (doc.included ?? []).flatMap((resource) => {
|
|
1908
|
-
let pending = !resource.id && "lid" in resource && resource.lid ? this.inflightCardCreates.get(resource.lid) : void 0;
|
|
1909
|
-
return pending ? [pending] : [];
|
|
1910
|
-
});
|
|
1911
|
-
if (pendingCreates.length === 0) return {
|
|
1912
|
-
doc,
|
|
1913
|
-
sentSeq,
|
|
1914
|
-
...doc.data.id ? {} : { endCreate: this.beginCreates([instance[localId]]) }
|
|
1915
|
-
};
|
|
1916
|
-
await Promise.all(pendingCreates);
|
|
1917
|
-
}
|
|
1918
|
-
}
|
|
1919
|
-
beginCreates(localIds) {
|
|
1920
|
-
let sent = new Deferred();
|
|
1921
|
-
for (let localId of localIds) this.inflightCardCreates.set(localId, sent.promise);
|
|
1922
|
-
return () => {
|
|
1923
|
-
for (let localId of localIds) if (this.inflightCardCreates.get(localId) === sent.promise) this.inflightCardCreates.delete(localId);
|
|
1924
|
-
sent.fulfill();
|
|
1925
|
-
};
|
|
1926
|
-
}
|
|
1927
|
-
async withCardMutationLock(localId, fn) {
|
|
1928
|
-
let inflightMutation = this.inflightCardMutations.get(localId);
|
|
1929
|
-
if (inflightMutation) await inflightMutation;
|
|
1930
|
-
let deferred = new Deferred();
|
|
1931
|
-
this.inflightCardMutations.set(localId, deferred.promise);
|
|
1932
|
-
try {
|
|
1933
|
-
return await fn();
|
|
1934
|
-
} finally {
|
|
1935
|
-
deferred.fulfill();
|
|
1936
|
-
}
|
|
1937
|
-
}
|
|
1938
|
-
async withMutationLocks(localIds, fn) {
|
|
1939
|
-
let [first, ...rest] = [...new Set(localIds)];
|
|
1940
|
-
if (first === void 0) return await fn();
|
|
1941
|
-
return await this.withCardMutationLock(first, () => this.withMutationLocks(rest, fn));
|
|
1942
|
-
}
|
|
1943
|
-
onCardReloaded(cb) {
|
|
1944
|
-
this.cardReloadSubscribers.add(cb);
|
|
1945
|
-
return () => {
|
|
1946
|
-
this.cardReloadSubscribers.delete(cb);
|
|
1947
|
-
};
|
|
1948
|
-
}
|
|
1949
|
-
notifyCardReloadSubscribers(instance) {
|
|
1950
|
-
for (let subscriber of [...this.cardReloadSubscribers]) try {
|
|
1951
|
-
subscriber(instance);
|
|
1952
|
-
} catch (err) {
|
|
1953
|
-
console.error(`card reload subscriber threw for ${instance.id}`, err);
|
|
1954
|
-
}
|
|
1955
|
-
}
|
|
1956
|
-
operationVersionOf(instance) {
|
|
1957
|
-
return instance[meta]?.version;
|
|
1958
|
-
}
|
|
1959
|
-
recordOperationVersion(instance, version) {
|
|
1960
|
-
this.#recordWrittenVersion(instance, { data: { meta: { version } } });
|
|
1961
|
-
}
|
|
1962
|
-
async applyOperationSource(instance, resource, basis) {
|
|
1963
|
-
let api = await this.cardService.getAPI();
|
|
1964
|
-
let held = instance[meta];
|
|
1965
|
-
this.#recordOptimisticFields(instance, basis, resource);
|
|
1966
|
-
await api.updateFromSerialized(instance, { data: resource }, this.store);
|
|
1967
|
-
instance[meta] = {
|
|
1968
|
-
...held,
|
|
1969
|
-
...instance[meta]
|
|
1970
|
-
};
|
|
1971
|
-
}
|
|
1972
|
-
async reloadForRollback(instance) {
|
|
1973
|
-
await this.reloadTask.perform(instance);
|
|
1974
|
-
}
|
|
1975
|
-
async adoptMintedIdentities(minted) {
|
|
1976
|
-
let conflicts = [];
|
|
1977
|
-
let pairs = [];
|
|
1978
|
-
for (let { lid, id } of minted) {
|
|
1979
|
-
let held = this.store.getCard(rri(id));
|
|
1980
|
-
if (held && held[localId] !== lid) conflicts.push({
|
|
1981
|
-
lid,
|
|
1982
|
-
id,
|
|
1983
|
-
held
|
|
1984
|
-
});
|
|
1985
|
-
else pairs.push({
|
|
1986
|
-
lid,
|
|
1987
|
-
id
|
|
1988
|
-
});
|
|
1989
|
-
}
|
|
1990
|
-
for (let { lid, id } of pairs) {
|
|
1991
|
-
let instance = this.store.getCard(lid);
|
|
1992
|
-
if (!instance || instance.id) continue;
|
|
1993
|
-
await this.assignRemoteIdentity(instance, rri(id));
|
|
1994
|
-
}
|
|
1995
|
-
if (conflicts.length === 0) return;
|
|
1996
|
-
for (let { held } of conflicts) if (held.id) this.reloadTask.perform(held);
|
|
1997
|
-
let [{ id, lid, held }] = conflicts;
|
|
1998
|
-
throw new Error(`the batch committed, but its card ${id} cannot be paired with local id ${lid}: this store already holds that card under local id ${held[localId]}. The realm has the write, the batch's other cards are paired, and this tab's copy of that card is being re-read.`);
|
|
1999
|
-
}
|
|
2000
|
-
async assignRemoteIdentity(instance, remoteId) {
|
|
2001
|
-
(await this.cardService.getAPI()).setId(instance, remoteId);
|
|
2002
|
-
this.subscribeToRealm(rri(instance.id));
|
|
2003
|
-
this.operatorModeStateService.handleCardIdAssignment(instance[localId]);
|
|
2004
|
-
await this.updateForeignConsumersOf(instance);
|
|
2005
|
-
this.setIdentityContext(instance);
|
|
2006
|
-
await this.startAutoSaving(instance);
|
|
2007
|
-
}
|
|
2008
|
-
#recordWrittenVersion(instance, json) {
|
|
2009
|
-
let held = instance[meta];
|
|
2010
|
-
let version = json.data.meta?.version;
|
|
2011
|
-
if (version === held?.version) return;
|
|
2012
|
-
instance[meta] = {
|
|
2013
|
-
...held,
|
|
2014
|
-
version
|
|
2015
|
-
};
|
|
2016
|
-
}
|
|
2017
|
-
async updateForeignConsumersOf(instance) {
|
|
2018
|
-
let consumers = this.store.consumersOf(await this.cardService.getAPI(), instance);
|
|
2019
|
-
let instanceRealm = instance[realmURL]?.href;
|
|
2020
|
-
if (!instanceRealm) return;
|
|
2021
|
-
for (let consumer of consumers) if (consumer[realmURL]?.href !== instanceRealm && consumer.id) this.save(consumer.id);
|
|
2022
|
-
}
|
|
2023
|
-
async reloadInstance(instance, identityMap, identityEpoch) {
|
|
2024
|
-
let waiterLabel = `reloadInstance ${instance.id}`;
|
|
2025
|
-
return await this.withTestWaiters(waiterLabel, async () => {
|
|
2026
|
-
let api = await this.cardService.getAPI();
|
|
2027
|
-
let pinnedAtRead = this.#pinnedFields(instance);
|
|
2028
|
-
let incomingDoc = await this.cardService.fetchJSON(instance.id, void 0);
|
|
2029
|
-
if (!isSingleCardDocument(incomingDoc)) throw new Error(`bug: server returned a non card document for ${instance.id}:
|
|
2030
|
-
${JSON.stringify(incomingDoc, null, 2)}`);
|
|
2031
|
-
let newDef;
|
|
2032
|
-
try {
|
|
2033
|
-
newDef = await loadCardDef(incomingDoc.data.meta.adoptsFrom, {
|
|
2034
|
-
loader: this.loaderService.loader,
|
|
2035
|
-
relativeTo: this.network.virtualNetwork.toURL(instance.id)
|
|
2036
|
-
});
|
|
2037
|
-
} catch (err) {
|
|
2038
|
-
if (isCardError(err) && err.status === 404) err.status = 422;
|
|
2039
|
-
throw err;
|
|
2040
|
-
}
|
|
2041
|
-
if (this.#identityEpoch !== identityEpoch) return;
|
|
2042
|
-
if (Reflect.getPrototypeOf(instance)?.constructor !== newDef) {
|
|
2043
|
-
let rebuilt = new newDef({
|
|
2044
|
-
id: instance.id,
|
|
2045
|
-
[localId]: instance[localId]
|
|
2046
|
-
});
|
|
2047
|
-
await api.updateFromSerialized(rebuilt, incomingDoc, identityMap);
|
|
2048
|
-
return rebuilt;
|
|
2049
|
-
}
|
|
2050
|
-
let kept = /* @__PURE__ */ new Set();
|
|
2051
|
-
await api.updateFromSerialized(instance, incomingDoc, identityMap, void 0, (fieldName) => {
|
|
2052
|
-
let keep = this.#pinnedFields(instance).has(fieldName) || pinnedAtRead.has(fieldName) && !this.#optimisticFields.get(instance[localId])?.has(fieldName);
|
|
2053
|
-
if (keep) kept.add(fieldName);
|
|
2054
|
-
return keep;
|
|
2055
|
-
});
|
|
2056
|
-
if (this.#identityEpoch !== identityEpoch) return;
|
|
2057
|
-
if (kept.size > 0) {
|
|
2058
|
-
realmEventsLogger.debug(`reload of ${instance.id} keeps local edits to ${[...kept].join(", ")}`);
|
|
2059
|
-
this.doAutoSave(instance);
|
|
2060
|
-
}
|
|
2061
|
-
return instance;
|
|
2062
|
-
});
|
|
2063
|
-
}
|
|
2064
|
-
subscribeToRealm(url) {
|
|
2065
|
-
if (this.hostModeService.isActive) return;
|
|
2066
|
-
let realmURL = this.realm.realmOf(url);
|
|
2067
|
-
if (!realmURL) {
|
|
2068
|
-
console.warn(`could not determine realm for card ${url instanceof URL ? url.href : url} when trying to subscribe to realm`);
|
|
2069
|
-
return;
|
|
2070
|
-
}
|
|
2071
|
-
if (!this.subscriptions.get(realmURL)) this.subscriptions.set(realmURL, { unsubscribe: this.messageService.subscribe(realmURL, (event) => this.handleInvalidations(event)) });
|
|
2072
|
-
}
|
|
2073
|
-
async loadPatchedInstances(patchData, relativeTo) {
|
|
2074
|
-
if (!patchData?.relationships) return {};
|
|
2075
|
-
let result = {};
|
|
2076
|
-
await Promise.all(Object.entries(patchData.relationships).map(async ([fieldName, rel]) => {
|
|
2077
|
-
if (Array.isArray(rel)) {
|
|
2078
|
-
let instances = [];
|
|
2079
|
-
await Promise.all(rel.map(async (r) => {
|
|
2080
|
-
let instance = await this.loadRelationshipInstance(r, relativeTo);
|
|
2081
|
-
if (instance) instances.push(instance);
|
|
2082
|
-
}));
|
|
2083
|
-
result[fieldName] = instances;
|
|
2084
|
-
} else {
|
|
2085
|
-
let instance = await this.loadRelationshipInstance(rel, relativeTo);
|
|
2086
|
-
if (instance) result[fieldName] = instance;
|
|
2087
|
-
}
|
|
2088
|
-
}));
|
|
2089
|
-
return result;
|
|
2090
|
-
}
|
|
2091
|
-
async loadRelationshipInstance(rel, relativeTo) {
|
|
2092
|
-
if (!rel.links?.self) return;
|
|
2093
|
-
let id = rel.links.self;
|
|
2094
|
-
let instance = await this.getCardInstance({ idOrDoc: this.network.virtualNetwork.resolveURL(id, relativeTo).href });
|
|
2095
|
-
return isCardInstance(instance) ? instance : void 0;
|
|
2096
|
-
}
|
|
2097
|
-
async withTestWaiters(label, cb) {
|
|
2098
|
-
let token = waiter.beginAsync(void 0, label);
|
|
2099
|
-
try {
|
|
2100
|
-
let result = await cb();
|
|
2101
|
-
if (isTesting()) await this.cardService.cardsSettled();
|
|
2102
|
-
return result;
|
|
2103
|
-
} finally {
|
|
2104
|
-
waiter.endAsync(token);
|
|
2105
|
-
}
|
|
2106
|
-
}
|
|
2107
|
-
};
|
|
2108
|
-
function processCardError(url, error, readType = "card") {
|
|
2109
|
-
let httpStatus = typeof error?.status === "number" ? error.status : void 0;
|
|
2110
|
-
let errorResponse;
|
|
2111
|
-
let body = errorResponseBody(error);
|
|
2112
|
-
if (body) errorResponse = formattedError(url, error, body.errors?.[0]);
|
|
2113
|
-
else switch (error.status) {
|
|
2114
|
-
case 404:
|
|
2115
|
-
errorResponse = formattedError(url, error, notFoundError(url, readType));
|
|
2116
|
-
break;
|
|
2117
|
-
default: errorResponse = formattedError(url, error, void 0);
|
|
2118
|
-
}
|
|
2119
|
-
if (httpStatus != null && httpStatus !== 404) {
|
|
2120
|
-
let cardError = errorResponse.errors[0];
|
|
2121
|
-
if (cardError?.status === 404) cardError.status = httpStatus;
|
|
2122
|
-
}
|
|
2123
|
-
return errorResponse;
|
|
2124
|
-
}
|
|
2125
|
-
function errorResponseBody(error) {
|
|
2126
|
-
if (typeof error?.responseText !== "string") return;
|
|
2127
|
-
let parsed;
|
|
2128
|
-
try {
|
|
2129
|
-
parsed = JSON.parse(error.responseText);
|
|
2130
|
-
} catch {
|
|
2131
|
-
return;
|
|
2132
|
-
}
|
|
2133
|
-
return parsed != null && typeof parsed === "object" ? parsed : void 0;
|
|
2134
|
-
}
|
|
2135
|
-
function notFoundError(url, readType) {
|
|
2136
|
-
let { title, noun } = readType === "file-meta" ? {
|
|
2137
|
-
title: "File Not Found",
|
|
2138
|
-
noun: "file"
|
|
2139
|
-
} : {
|
|
2140
|
-
title: "Card Not Found",
|
|
2141
|
-
noun: "card"
|
|
2142
|
-
};
|
|
2143
|
-
return {
|
|
2144
|
-
status: 404,
|
|
2145
|
-
title,
|
|
2146
|
-
message: `The ${noun} ${url} does not exist`
|
|
2147
|
-
};
|
|
2148
|
-
}
|
|
2149
|
-
function replacePrimitiveValues(api, merged, patch, owner) {
|
|
2150
|
-
let fields = api.getFields(owner, { includeComputeds: true });
|
|
2151
|
-
for (let [name, source] of Object.entries(patch)) {
|
|
2152
|
-
if (!isPlainRecord(source) || !Object.hasOwn(fields, name)) continue;
|
|
2153
|
-
let field = fields[name];
|
|
2154
|
-
if (api.primitive in field.card) {
|
|
2155
|
-
merged[name] = cloneDeep(source);
|
|
2156
|
-
continue;
|
|
2157
|
-
}
|
|
2158
|
-
let target = merged[name];
|
|
2159
|
-
let value = owner[name];
|
|
2160
|
-
if (field.fieldType !== "contains" || !isPlainRecord(target) || !(value instanceof api.BaseDef)) continue;
|
|
2161
|
-
replacePrimitiveValues(api, target, source, value);
|
|
2162
|
-
}
|
|
2163
|
-
}
|
|
2164
|
-
function isPlainRecord(value) {
|
|
2165
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2166
|
-
}
|
|
2167
|
-
function needsServerStateMerge(instance, serverState) {
|
|
2168
|
-
return instance.id !== serverState.data.id || !isEqual(instance[meta]?.realmInfo, serverState.data.meta.realmInfo);
|
|
2169
|
-
}
|
|
2170
|
-
function isResolvableInstanceId(id, vn) {
|
|
2171
|
-
return vn.isRegisteredPrefix(id) || id.startsWith("http://") || id.startsWith("https://");
|
|
2172
|
-
}
|
|
2173
|
-
function asURL(urlOrDoc, vn) {
|
|
2174
|
-
let id = typeof urlOrDoc === "string" ? urlOrDoc.replace(/\.json$/, "") : void 0;
|
|
2175
|
-
if (id === void 0) {
|
|
2176
|
-
id = urlOrDoc.data.id;
|
|
2177
|
-
if (id == null) return;
|
|
2178
|
-
}
|
|
2179
|
-
return isLocalId(id) ? id : vn.keyForIdentifier(id);
|
|
2180
|
-
}
|
|
2181
|
-
function isSystemCardDefaultId(id, idOrDoc, errorId) {
|
|
2182
|
-
return [
|
|
2183
|
-
id,
|
|
2184
|
-
typeof idOrDoc === "string" ? idOrDoc : idOrDoc?.data?.id,
|
|
2185
|
-
errorId
|
|
2186
|
-
].filter(Boolean).some((candidate) => candidate.includes("/SystemCard/default"));
|
|
2187
|
-
}
|
|
2188
|
-
async function withStubbedRenderTimers(cb) {
|
|
2189
|
-
if (typeof window === "undefined" || isTesting()) return await cb();
|
|
2190
|
-
let restore = enableRenderTimerStub();
|
|
2191
|
-
try {
|
|
2192
|
-
return await withTimersBlocked(cb);
|
|
2193
|
-
} finally {
|
|
2194
|
-
restore();
|
|
2195
|
-
}
|
|
2196
|
-
}
|
|
2197
|
-
function resolveDocUrl(id, realm, local) {
|
|
2198
|
-
if (id) return id;
|
|
2199
|
-
if (!realm) throw new Error("Cannot resolve target url without a realm");
|
|
2200
|
-
let path = new RealmPaths(ri(realm));
|
|
2201
|
-
if (local) return path.directoryRRI(local);
|
|
2202
|
-
return path.url;
|
|
2203
|
-
}
|
|
2204
|
-
//#endregion
|
|
2205
|
-
export { resolveOutboundJobPriority as n, store_exports as r, StoreService as t };
|