trellis 3.1.35 → 3.2.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/CHANGELOG.md +16 -5
- package/README.md +19 -2
- package/bin/trellis.mjs +2 -75
- package/dist/better-sqlite-backend-2P4F6AOJ.js +209 -0
- package/dist/{better-sqlite-backend-ahx5p0br.js → better-sqlite-backend-PII64VE6.js} +37 -25
- package/dist/better-sqlite-backend-VUBVQ7SN.js +209 -0
- package/dist/better-sqlite-backend-Y3AQN65E.js +159 -0
- package/dist/better-sqlite-backend-Y3M7DXOX.js +159 -0
- package/dist/boot-middleware-FJDGVUM4.js +9 -0
- package/dist/boot-middleware-MHLHFCUC.js +9 -0
- package/dist/boot-middleware-MLJUTLUM.js +9 -0
- package/dist/boot-middleware-ZZPDZNYR.js +9 -0
- package/dist/{index-wncptktd.js → chunk-276LKLZR.js} +126 -59
- package/dist/chunk-2BRTCEHB.js +143 -0
- package/dist/chunk-2CX5UCRV.js +111 -0
- package/dist/chunk-2ESYSVXG.js +48 -0
- package/dist/{index-yp88he8n.js → chunk-2I5JU73Y.js} +88 -64
- package/dist/{index-w5wccer3.js → chunk-2UNSRRNB.js} +10 -5
- package/dist/{index-4wxa8xz4.js → chunk-335UEHQR.js} +158 -22
- package/dist/chunk-36VSSTL7.js +357 -0
- package/dist/chunk-3ETIIPPB.js +1077 -0
- package/dist/chunk-3GDRZTAW.js +45 -0
- package/dist/chunk-44FFQKQX.js +142 -0
- package/dist/chunk-4CF2L46N.js +29 -0
- package/dist/chunk-4HYPLFJD.js +150 -0
- package/dist/chunk-4XIVMVHC.js +361 -0
- package/dist/chunk-5CINODKT.js +41 -0
- package/dist/chunk-5ESGWJ5L.js +45 -0
- package/dist/chunk-5FGLQGMF.js +1676 -0
- package/dist/chunk-5IQZFITY.js +357 -0
- package/dist/{index-wt8rz4gn.js → chunk-5JWFAQDW.js} +41 -23
- package/dist/{index-7pjz3tsy.js → chunk-62UHTVU3.js} +50 -16
- package/dist/{index-h32txmxe.js → chunk-66UJQT2I.js} +6 -13
- package/dist/chunk-6CTA6MCE.js +340 -0
- package/dist/{index-4cdr7x2x.js → chunk-6RNNVOAS.js} +178 -109
- package/dist/chunk-6X23PZ6H.js +969 -0
- package/dist/chunk-7C7LL6MB.js +315 -0
- package/dist/chunk-7F4HM3JG.js +394 -0
- package/dist/chunk-7KJ7T4D3.js +910 -0
- package/dist/chunk-7QQQNUB5.js +92 -0
- package/dist/{index-53f3b8p8.js → chunk-7QWJBS72.js} +210 -165
- package/dist/chunk-7R36OZK3.js +957 -0
- package/dist/chunk-7UPKCOHE.js +946 -0
- package/dist/chunk-7WQGTFVJ.js +7434 -0
- package/dist/chunk-A3BONW34.js +35 -0
- package/dist/chunk-AHMDVHBL.js +141 -0
- package/dist/chunk-AW6A4OZY.js +171 -0
- package/dist/chunk-B3ZIFA2O.js +2240 -0
- package/dist/chunk-BJ5EKCJ5.js +458 -0
- package/dist/chunk-BJ7EZ7FP.js +145 -0
- package/dist/chunk-BQBUVMRN.js +171 -0
- package/dist/chunk-BRGYDO7D.js +223 -0
- package/dist/chunk-BXSTJVE3.js +67 -0
- package/dist/chunk-C5KPSEDN.js +359 -0
- package/dist/chunk-CCTNYTUC.js +940 -0
- package/dist/chunk-CYQ2OVD2.js +35 -0
- package/dist/chunk-DDAK7YOE.js +299 -0
- package/dist/chunk-DRILKBY6.js +965 -0
- package/dist/chunk-DXE24HNN.js +45 -0
- package/dist/chunk-E7ICUNW7.js +945 -0
- package/dist/chunk-EAL2PUOE.js +10022 -0
- package/dist/chunk-ELT7MLZB.js +109 -0
- package/dist/chunk-EO3J7GRP.js +0 -0
- package/dist/chunk-EWEIRF6G.js +171 -0
- package/dist/chunk-F5VDGQJC.js +120 -0
- package/dist/chunk-FCPL3IEQ.js +98 -0
- package/dist/{index-nq520y6k.js → chunk-FDPKYSV7.js} +43 -31
- package/dist/chunk-FES3TC24.js +171 -0
- package/dist/chunk-FF36CQHZ.js +61 -0
- package/dist/chunk-FKQO5A3H.js +35 -0
- package/dist/chunk-FOWKR5TW.js +129 -0
- package/dist/chunk-FZVCXDYW.js +150 -0
- package/dist/chunk-G3XIHPSQ.js +361 -0
- package/dist/chunk-GD5QJXSS.js +98 -0
- package/dist/chunk-GFZCJ4EH.js +108 -0
- package/dist/chunk-GKJLYLVU.js +359 -0
- package/dist/chunk-GLM4HGN4.js +55 -0
- package/dist/chunk-GNXHXNVQ.js +113 -0
- package/dist/chunk-GSR6ILTM.js +277 -0
- package/dist/chunk-GWRIMRSX.js +45 -0
- package/dist/chunk-H72UW2HJ.js +45 -0
- package/dist/chunk-HGI74PXB.js +7417 -0
- package/dist/chunk-HGRA37LO.js +145 -0
- package/dist/chunk-HO4TURXW.js +1078 -0
- package/dist/chunk-HXSRQO3L.js +145 -0
- package/dist/chunk-IG2X2BVO.js +373 -0
- package/dist/chunk-IIJVDD54.js +373 -0
- package/dist/chunk-IUWVEEOX.js +145 -0
- package/dist/chunk-IX4BBOIT.js +394 -0
- package/dist/{index-yhwjgfvj.js → chunk-IXU4RMQM.js} +67 -60
- package/dist/chunk-J3WYZO3Q.js +211 -0
- package/dist/{index-vkpkfwhq.js → chunk-J6OUIION.js} +234 -194
- package/dist/{index-xzym9w0m.js → chunk-JA7AIHRK.js} +12 -7
- package/dist/chunk-JUEMDWLU.js +233 -0
- package/dist/chunk-K46RNFDE.js +171 -0
- package/dist/chunk-KAGU2XMY.js +359 -0
- package/dist/chunk-KCVYJNVX.js +394 -0
- package/dist/chunk-KFQGP6VL.js +33 -0
- package/dist/chunk-KKDRMIV6.js +419 -0
- package/dist/chunk-KQ4A2D2P.js +910 -0
- package/dist/chunk-KSU2GW22.js +958 -0
- package/dist/chunk-KYLIQ3YI.js +399 -0
- package/dist/chunk-KZYJJIRN.js +946 -0
- package/dist/chunk-LFOX744K.js +96 -0
- package/dist/{index-rv1p47gp.js → chunk-LHOVJEWR.js} +2756 -2307
- package/dist/{index-h9e2efx4.js → chunk-LNUIGRDZ.js} +71 -55
- package/dist/chunk-LOPXTPF3.js +120 -0
- package/dist/chunk-LZR3VIFU.js +907 -0
- package/dist/chunk-MBNBTJCR.js +394 -0
- package/dist/chunk-MCKGQKYU.js +15 -0
- package/dist/{index-skhn0agf.js → chunk-MLC5BUYO.js} +19 -20
- package/dist/chunk-MPXUVGT3.js +104 -0
- package/dist/chunk-MU6EOS6F.js +0 -0
- package/dist/chunk-MWRQ2TXT.js +357 -0
- package/dist/{index-nzb3am4f.js → chunk-NO73OK2I.js} +43 -21
- package/dist/chunk-NPE2YJHK.js +394 -0
- package/dist/{index-xhcp6xrn.js → chunk-NSDXU6QX.js} +654 -500
- package/dist/chunk-NXIRDSZ6.js +145 -0
- package/dist/chunk-NZWFNHCS.js +407 -0
- package/dist/chunk-O2AV5WMN.js +48 -0
- package/dist/{index-h7zxhhhh.js → chunk-OB4CMMX6.js} +46 -38
- package/dist/chunk-OBKU74FU.js +7411 -0
- package/dist/chunk-OQNDWRDE.js +145 -0
- package/dist/chunk-OVWAJMB6.js +394 -0
- package/dist/chunk-PDHLBTTD.js +45 -0
- package/dist/chunk-PEQNRKLG.js +210 -0
- package/dist/chunk-QERIS7QY.js +7403 -0
- package/dist/chunk-QHA2DM3C.js +373 -0
- package/dist/chunk-QLM4HSYC.js +45 -0
- package/dist/chunk-RSWUFTO2.js +857 -0
- package/dist/chunk-S2OT3TQJ.js +283 -0
- package/dist/chunk-S5PHSN5K.js +907 -0
- package/dist/chunk-SIAA4J6H.js +21 -0
- package/dist/chunk-SPSPV5BC.js +390 -0
- package/dist/chunk-SQBNLUIA.js +171 -0
- package/dist/chunk-STLN6A6B.js +355 -0
- package/dist/chunk-TCKXSOBP.js +123 -0
- package/dist/chunk-U7HV7GU2.js +17 -0
- package/dist/chunk-UBGUDMUV.js +59 -0
- package/dist/chunk-UGZHOGRA.js +39 -0
- package/dist/chunk-UICF66FS.js +359 -0
- package/dist/chunk-UK3EQREE.js +1078 -0
- package/dist/chunk-UPKPURVY.js +394 -0
- package/dist/chunk-URC74VCN.js +959 -0
- package/dist/chunk-USEINYUL.js +12 -0
- package/dist/{index-bmyt7k8n.js → chunk-UZRUP7QW.js} +12 -4
- package/dist/chunk-V3G7Q3QQ.js +102 -0
- package/dist/chunk-VDAKEOML.js +857 -0
- package/dist/chunk-VUJ6SA55.js +303 -0
- package/dist/chunk-VUJQLIML.js +141 -0
- package/dist/chunk-VWKLKLYB.js +267 -0
- package/dist/chunk-VYC3RZMK.js +277 -0
- package/dist/chunk-WMERMSWI.js +154 -0
- package/dist/chunk-WMR777PO.js +2213 -0
- package/dist/{index-n9f2qyh5.js → chunk-X46IECAC.js} +55 -33
- package/dist/chunk-X5FLTRUB.js +517 -0
- package/dist/chunk-X762XWVC.js +419 -0
- package/dist/chunk-XEN3OEYY.js +2234 -0
- package/dist/chunk-XMQ7G77X.js +260 -0
- package/dist/chunk-XZQ66K7A.js +124 -0
- package/dist/{index-w7ng765c.js → chunk-YCM7ZYEZ.js} +102 -49
- package/dist/chunk-YY3GF7DH.js +7411 -0
- package/dist/chunk-ZE5R3H4C.js +907 -0
- package/dist/chunk-ZHVI7BQN.js +1077 -0
- package/dist/chunk-ZMN5LUB7.js +7411 -0
- package/dist/chunk-ZUV4MD5U.js +94 -0
- package/dist/cli/errors.d.ts +6 -0
- package/dist/cli/errors.d.ts.map +1 -0
- package/dist/cli/examples.d.ts +23 -0
- package/dist/cli/examples.d.ts.map +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +2338 -6190
- package/dist/client/index.d.ts +6 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +41 -21
- package/dist/client/live.d.ts +67 -0
- package/dist/client/live.d.ts.map +1 -0
- package/dist/client/reactive.d.ts +31 -0
- package/dist/client/reactive.d.ts.map +1 -0
- package/dist/client/sdk.d.ts +26 -2
- package/dist/client/sdk.d.ts.map +1 -1
- package/dist/client/sdk.js +9 -0
- package/dist/client/vcs-client.d.ts +129 -0
- package/dist/client/vcs-client.d.ts.map +1 -0
- package/dist/cms/index.js +171 -163
- package/dist/{config-8hczw0rs.js → config-KMY6RRK3.js} +8 -9
- package/dist/config-PFTP67TR.js +19 -0
- package/dist/config-VDMK2DUJ.js +19 -0
- package/dist/core/computation/index.d.ts +5 -0
- package/dist/core/computation/index.d.ts.map +1 -0
- package/dist/core/computation/rollup.d.ts +18 -0
- package/dist/core/computation/rollup.d.ts.map +1 -0
- package/dist/core/index.d.ts +5 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +168 -101
- package/dist/core/kernel/boot-middleware.d.ts +10 -0
- package/dist/core/kernel/boot-middleware.d.ts.map +1 -0
- package/dist/core/kernel/logic-middleware.d.ts +7 -1
- package/dist/core/kernel/logic-middleware.d.ts.map +1 -1
- package/dist/core/kernel/trellis-kernel.d.ts.map +1 -1
- package/dist/core/ontology/types.d.ts +5 -0
- package/dist/core/ontology/types.d.ts.map +1 -1
- package/dist/core/persist/better-sqlite-backend.d.ts +9 -2
- package/dist/core/persist/better-sqlite-backend.d.ts.map +1 -1
- package/dist/core/persist/factory.d.ts +6 -7
- package/dist/core/persist/factory.d.ts.map +1 -1
- package/dist/core/persist/factory.js +2 -3
- package/dist/core/persist/sqljs-backend.js +2 -3
- package/dist/db/index.d.ts +4 -1
- package/dist/db/index.d.ts.map +1 -1
- package/dist/db/index.js +69 -56
- package/dist/db/inspector.js +11 -19
- package/dist/decisions/index.js +9 -10
- package/dist/deploy-66EC752W.js +9 -0
- package/dist/deploy-SO7AFK6L.js +9 -0
- package/dist/embeddings/auto-embed.d.ts +2 -2
- package/dist/embeddings/auto-embed.d.ts.map +1 -1
- package/dist/embeddings/index.js +20 -22
- package/dist/embeddings/search.d.ts +2 -1
- package/dist/embeddings/search.d.ts.map +1 -1
- package/dist/embeddings/store.d.ts +25 -4
- package/dist/embeddings/store.d.ts.map +1 -1
- package/dist/engine-7GXBM4IT.js +7 -0
- package/dist/engine-NSR6BIF7.js +7 -0
- package/dist/engine.d.ts +32 -12
- package/dist/engine.d.ts.map +1 -1
- package/dist/factory-2P64OC7M.js +34 -0
- package/dist/factory-YP4ZZK5K.js +34 -0
- package/dist/import-AJLYHFIA.js +10 -0
- package/dist/import-UZEKXU3B.js +10 -0
- package/dist/index.js +102 -93
- package/dist/launch-explorer-AI6L2AWJ.js +91 -0
- package/dist/launch-explorer-HZ4ZJA4X.js +95 -0
- package/dist/links/index.js +24 -26
- package/dist/plugins/agent-memory/index.js +316 -0
- package/dist/plugins/idea-garden/index.js +165 -0
- package/dist/plugins/plan-approval/index.js +579 -0
- package/dist/plugins/proactive-watcher/index.js +194 -0
- package/dist/{index-2r4jxwnb.js → query-GJL3CVGN.js} +14 -15
- package/dist/query-MBJSK3EB.js +31 -0
- package/dist/query-TJHEVSKL.js +31 -0
- package/dist/query-WUIKOHPE.js +524 -0
- package/dist/query-XYLTJYSA.js +31 -0
- package/dist/react/index.js +39 -70
- package/dist/react/realtime.js +11 -0
- package/dist/react/schema-hooks.js +87 -0
- package/dist/realtime/broadcast-channel-transport.d.ts +43 -0
- package/dist/realtime/broadcast-channel-transport.d.ts.map +1 -0
- package/dist/realtime/durable-object-relay-transport.d.ts +96 -0
- package/dist/realtime/durable-object-relay-transport.d.ts.map +1 -0
- package/dist/realtime/index.d.ts +44 -0
- package/dist/realtime/index.d.ts.map +1 -0
- package/dist/realtime/index.js +40 -0
- package/dist/realtime/memory-hub.d.ts +32 -0
- package/dist/realtime/memory-hub.d.ts.map +1 -0
- package/dist/realtime/persistent-channel.d.ts +105 -0
- package/dist/realtime/persistent-channel.d.ts.map +1 -0
- package/dist/realtime/presence.d.ts +73 -0
- package/dist/realtime/presence.d.ts.map +1 -0
- package/dist/realtime/relay-persistence.d.ts +37 -0
- package/dist/realtime/relay-persistence.d.ts.map +1 -0
- package/dist/realtime/relay-persistence.js +107 -0
- package/dist/realtime/relay-server.d.ts +103 -0
- package/dist/realtime/relay-server.d.ts.map +1 -0
- package/dist/realtime/room.d.ts +98 -0
- package/dist/realtime/room.d.ts.map +1 -0
- package/dist/realtime/text.d.ts +73 -0
- package/dist/realtime/text.d.ts.map +1 -0
- package/dist/realtime/types.d.ts +89 -0
- package/dist/realtime/types.d.ts.map +1 -0
- package/dist/realtime/websocket-relay-transport.d.ts +28 -0
- package/dist/realtime/websocket-relay-transport.d.ts.map +1 -0
- package/dist/realtime.bundle.js +1100 -0
- package/dist/remote-manager-BLJZ6KF6.js +224 -0
- package/dist/{remote-manager-xvbg4230.js → remote-manager-BPYE46SI.js} +24 -15
- package/dist/remote-manager-FMESEAFA.js +224 -0
- package/dist/remote-manager-K2WZ5RHY.js +223 -0
- package/dist/remote-manager-SG545WNY.js +224 -0
- package/dist/remote-manager-SG5PQKCH.js +224 -0
- package/dist/remote-manager-WGP6MIQZ.js +224 -0
- package/dist/scaffold/write.d.ts.map +1 -1
- package/dist/schema/define.d.ts +137 -0
- package/dist/schema/define.d.ts.map +1 -0
- package/dist/schema/entity-projection.d.ts +34 -0
- package/dist/schema/entity-projection.d.ts.map +1 -0
- package/dist/schema/eql.d.ts +46 -0
- package/dist/schema/eql.d.ts.map +1 -0
- package/dist/schema/index.d.ts +21 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +45 -0
- package/dist/schema/kernel-resolve.d.ts +21 -0
- package/dist/schema/kernel-resolve.d.ts.map +1 -0
- package/dist/schema/mutations.d.ts +20 -0
- package/dist/schema/mutations.d.ts.map +1 -0
- package/dist/schema/resolve.d.ts +21 -0
- package/dist/schema/resolve.d.ts.map +1 -0
- package/dist/sdk-3KBB3E6V.js +16 -0
- package/dist/sdk-4ZQO6UTU.js +16 -0
- package/dist/sdk-6JA6GV3G.js +16 -0
- package/dist/sdk-6VTP5UTZ.js +16 -0
- package/dist/sdk-7VS6TYCD.js +16 -0
- package/dist/sdk-HQ3FTLRT.js +16 -0
- package/dist/sdk-HZ7NU3XE.js +15 -0
- package/dist/sdk-KBQE2OXT.js +16 -0
- package/dist/sdk-LZ7W3EEY.js +9 -0
- package/dist/sdk-MSCDZ7JU.js +15 -0
- package/dist/sdk-WNZOGO3S.js +15 -0
- package/dist/sdk-YLV33ZCW.js +9 -0
- package/dist/sdk-ZSUD2LLJ.js +16 -0
- package/dist/server/index.d.ts +2 -0
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +69 -61
- package/dist/server/node-adapter.js +5 -104
- package/dist/server/realtime.d.ts +10 -2
- package/dist/server/realtime.d.ts.map +1 -1
- package/dist/server/server.d.ts +7 -16
- package/dist/server/server.d.ts.map +1 -1
- package/dist/server/sprites.d.ts.map +1 -1
- package/dist/server/tenancy.d.ts.map +1 -1
- package/dist/server-AFXFFBWA.js +11 -0
- package/dist/server-AGHC4VUL.js +11 -0
- package/dist/server-BOH7M4TT.js +13 -0
- package/dist/server-DBUY2KY5.js +11 -0
- package/dist/server-GWBQJPRG.js +11 -0
- package/dist/server-IGBIIJSF.js +13 -0
- package/dist/server-JZZFULVU.js +11 -0
- package/dist/server-L5XAF4M5.js +11 -0
- package/dist/server-NYFUHANA.js +12 -0
- package/dist/server-OABUB2LO.js +12 -0
- package/dist/server-P2CKZWWV.js +12 -0
- package/dist/{sprites-vc4qbrp1.js → sprites-RU3E4XQN.js} +6 -7
- package/dist/sprites-XVSMQLSI.js +15 -0
- package/dist/sql-wasm-FORCZFHZ.js +2148 -0
- package/dist/sql-wasm-JZH76RLO.js +2148 -0
- package/dist/sqljs-backend-CJQOIQYE.js +266 -0
- package/dist/sqljs-backend-KWXBUDUO.js +266 -0
- package/dist/state-demo.bundle.js +1033 -0
- package/dist/svelte/index.d.ts +17 -0
- package/dist/svelte/index.d.ts.map +1 -0
- package/dist/svelte/index.js +51 -0
- package/dist/svelte/schema-hooks.d.ts +45 -0
- package/dist/svelte/schema-hooks.d.ts.map +1 -0
- package/dist/svelte/schema-hooks.js +71 -0
- package/dist/svelte/stores.d.ts +78 -0
- package/dist/svelte/stores.d.ts.map +1 -0
- package/dist/sync/http-transport.d.ts +3 -3
- package/dist/sync/http-transport.d.ts.map +1 -1
- package/dist/sync/index.d.ts +15 -1
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +617 -0
- package/dist/sync/memory-room.d.ts +37 -0
- package/dist/sync/memory-room.d.ts.map +1 -0
- package/dist/sync/memory-transport.d.ts +3 -3
- package/dist/sync/memory-transport.d.ts.map +1 -1
- package/dist/sync/partykit-room.d.ts +40 -0
- package/dist/sync/partykit-room.d.ts.map +1 -0
- package/dist/sync/partykit-transport.d.ts +84 -0
- package/dist/sync/partykit-transport.d.ts.map +1 -0
- package/dist/sync/room-core.d.ts +53 -0
- package/dist/sync/room-core.d.ts.map +1 -0
- package/dist/sync/sync-engine.d.ts +40 -2
- package/dist/sync/sync-engine.d.ts.map +1 -1
- package/dist/sync/sync-room-server.d.ts +39 -0
- package/dist/sync/sync-room-server.d.ts.map +1 -0
- package/dist/sync/types.d.ts +70 -3
- package/dist/sync/types.d.ts.map +1 -1
- package/dist/sync/vcs-sync-peer.d.ts +63 -0
- package/dist/sync/vcs-sync-peer.d.ts.map +1 -0
- package/dist/sync/ws-transport.d.ts +2 -2
- package/dist/sync/ws-transport.d.ts.map +1 -1
- package/dist/tenancy-CBWYEVUB.js +11 -0
- package/dist/tenancy-FO6WVYFN.js +13 -0
- package/dist/tenancy-FWDBESMX.js +14 -0
- package/dist/tenancy-HGPIS5QA.js +13 -0
- package/dist/tenancy-HXFALA37.js +14 -0
- package/dist/tenancy-OP34NFFS.js +14 -0
- package/dist/tenancy-S676GLID.js +14 -0
- package/dist/tenancy-V7ARWNNV.js +14 -0
- package/dist/tenancy-ZDN4GXK5.js +13 -0
- package/dist/tenancy-ZT5VMY7B.js +14 -0
- package/dist/ui/client.html +355 -67
- package/dist/ui/launch-explorer.d.ts +22 -0
- package/dist/ui/launch-explorer.d.ts.map +1 -0
- package/dist/ui/server.d.ts +1 -1
- package/dist/ui/server.d.ts.map +1 -1
- package/dist/vcs/blob-store.d.ts.map +1 -1
- package/dist/vcs/idb-op-log.d.ts +67 -0
- package/dist/vcs/idb-op-log.d.ts.map +1 -0
- package/dist/vcs/index.d.ts +1 -0
- package/dist/vcs/index.d.ts.map +1 -1
- package/dist/vcs/index.js +81 -72
- package/dist/vcs/issue.d.ts +22 -5
- package/dist/vcs/issue.d.ts.map +1 -1
- package/dist/vcs/lane-materialize.d.ts +5 -0
- package/dist/vcs/lane-materialize.d.ts.map +1 -1
- package/dist/vcs/op-log.d.ts +28 -2
- package/dist/vcs/op-log.d.ts.map +1 -1
- package/dist/vcs/ops.d.ts +10 -0
- package/dist/vcs/ops.d.ts.map +1 -1
- package/dist/{vm-config-6xhsj6b3.js → vm-config-JI4OXKDQ.js} +9 -10
- package/dist/vm-config-YZRJ3KUB.js +21 -0
- package/dist/vue/hooks.d.ts +64 -0
- package/dist/vue/hooks.d.ts.map +1 -0
- package/dist/vue/index.d.ts +19 -0
- package/dist/vue/index.d.ts.map +1 -0
- package/dist/vue/index.js +59 -0
- package/dist/vue/schema-hooks.d.ts +41 -0
- package/dist/vue/schema-hooks.d.ts.map +1 -0
- package/dist/vue/schema-hooks.js +64 -0
- package/package.json +118 -16
- package/dist/deploy-999q207z.js +0 -10
- package/dist/engine-y0724kjq.js +0 -8
- package/dist/import-s2b8e0ft.js +0 -11
- package/dist/index-a76rekgs.js +0 -67
- package/dist/index-c9h37r6h.js +0 -1
- package/dist/index-hr9qvv77.js +0 -860
- package/dist/index-k5b0xskw.js +0 -1
- package/dist/index-y6a4kj0p.js +0 -43
- package/dist/sdk-bepky0xs.js +0 -16
- package/dist/server-szdjx0nt.js +0 -13
- package/dist/sqlite-backend-0vsmc6qj.js +0 -8
- package/dist/tenancy-pjm32b4v.js +0 -14
package/dist/cms/index.js
CHANGED
|
@@ -1,28 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import"../index-a76rekgs.js";
|
|
1
|
+
import "../chunk-KFQGP6VL.js";
|
|
3
2
|
|
|
4
3
|
// src/cms/internal.ts
|
|
5
|
-
var SYSTEM_TYPES = new Set([
|
|
6
|
-
"issue",
|
|
7
|
-
"agent",
|
|
8
|
-
"project",
|
|
9
|
-
"memory",
|
|
10
|
-
"mcp",
|
|
11
|
-
"sprite",
|
|
12
|
-
"workunit",
|
|
13
|
-
"cycle",
|
|
14
|
-
"epic",
|
|
15
|
-
"roadmap",
|
|
16
|
-
"suggestion",
|
|
17
|
-
"file",
|
|
18
|
-
"directory",
|
|
19
|
-
"op",
|
|
20
|
-
"branch",
|
|
21
|
-
"decision",
|
|
22
|
-
"session",
|
|
23
|
-
"typeschema",
|
|
24
|
-
"field"
|
|
25
|
-
]);
|
|
26
4
|
function typeKey(type) {
|
|
27
5
|
return type.trim().toLowerCase();
|
|
28
6
|
}
|
|
@@ -31,8 +9,7 @@ function entryFromFacts(entity, facts, links) {
|
|
|
31
9
|
let status = "draft";
|
|
32
10
|
let cmsStatusSeen = false;
|
|
33
11
|
for (const f of facts) {
|
|
34
|
-
if (f.a === "type")
|
|
35
|
-
continue;
|
|
12
|
+
if (f.a === "type") continue;
|
|
36
13
|
if (f.a === "cms_status") {
|
|
37
14
|
status = f.v === "published" ? "published" : "draft";
|
|
38
15
|
cmsStatusSeen = true;
|
|
@@ -41,62 +18,54 @@ function entryFromFacts(entity, facts, links) {
|
|
|
41
18
|
fields[f.a] = f.v;
|
|
42
19
|
}
|
|
43
20
|
if (!cmsStatusSeen) {
|
|
44
|
-
if (fields.status === "published")
|
|
45
|
-
|
|
46
|
-
else if (fields.status === "draft")
|
|
47
|
-
status = "draft";
|
|
21
|
+
if (fields.status === "published") status = "published";
|
|
22
|
+
else if (fields.status === "draft") status = "draft";
|
|
48
23
|
}
|
|
49
24
|
if (links) {
|
|
50
25
|
for (const link of links) {
|
|
51
|
-
if (link.e1 !== entity.id)
|
|
52
|
-
|
|
53
|
-
if (!(link.a in fields))
|
|
54
|
-
fields[link.a] = link.e2;
|
|
26
|
+
if (link.e1 !== entity.id) continue;
|
|
27
|
+
if (!(link.a in fields)) fields[link.a] = link.e2;
|
|
55
28
|
}
|
|
56
29
|
}
|
|
57
30
|
return { id: entity.id, type: entity.type, status, fields };
|
|
58
31
|
}
|
|
59
32
|
function groupFactsByEntity(facts) {
|
|
60
|
-
const map = new Map;
|
|
33
|
+
const map = /* @__PURE__ */ new Map();
|
|
61
34
|
for (const f of facts) {
|
|
62
35
|
const list = map.get(f.e);
|
|
63
|
-
if (list)
|
|
64
|
-
|
|
65
|
-
else
|
|
66
|
-
map.set(f.e, [f]);
|
|
36
|
+
if (list) list.push(f);
|
|
37
|
+
else map.set(f.e, [f]);
|
|
67
38
|
}
|
|
68
39
|
return map;
|
|
69
40
|
}
|
|
70
41
|
function groupLinksBySource(links) {
|
|
71
|
-
const map = new Map;
|
|
42
|
+
const map = /* @__PURE__ */ new Map();
|
|
72
43
|
for (const l of links) {
|
|
73
44
|
const list = map.get(l.e1);
|
|
74
|
-
if (list)
|
|
75
|
-
|
|
76
|
-
else
|
|
77
|
-
map.set(l.e1, [l]);
|
|
45
|
+
if (list) list.push(l);
|
|
46
|
+
else map.set(l.e1, [l]);
|
|
78
47
|
}
|
|
79
48
|
return map;
|
|
80
49
|
}
|
|
81
50
|
async function expandReferences(entries, expandKeys, fetchEntity) {
|
|
82
|
-
const ids = new Set;
|
|
51
|
+
const ids = /* @__PURE__ */ new Set();
|
|
83
52
|
for (const entry of entries) {
|
|
84
53
|
for (const key of expandKeys) {
|
|
85
54
|
const v = entry.fields[key];
|
|
86
|
-
if (typeof v === "string")
|
|
87
|
-
ids.add(v);
|
|
55
|
+
if (typeof v === "string") ids.add(v);
|
|
88
56
|
}
|
|
89
57
|
}
|
|
90
|
-
if (ids.size === 0)
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
58
|
+
if (ids.size === 0) return entries;
|
|
59
|
+
const resolved = /* @__PURE__ */ new Map();
|
|
60
|
+
await Promise.all(
|
|
61
|
+
[...ids].map(async (id) => {
|
|
62
|
+
try {
|
|
63
|
+
resolved.set(id, await fetchEntity(id));
|
|
64
|
+
} catch {
|
|
65
|
+
resolved.set(id, null);
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
);
|
|
100
69
|
return entries.map((entry) => {
|
|
101
70
|
const next = { ...entry.fields };
|
|
102
71
|
for (const key of expandKeys) {
|
|
@@ -113,14 +82,13 @@ function fingerprint(value) {
|
|
|
113
82
|
}
|
|
114
83
|
|
|
115
84
|
// src/cms/formula.ts
|
|
116
|
-
var OPS = new Set(["+", "-", "*", "/", "(", ")"]);
|
|
85
|
+
var OPS = /* @__PURE__ */ new Set(["+", "-", "*", "/", "(", ")"]);
|
|
117
86
|
function num(value) {
|
|
118
87
|
if (typeof value === "number")
|
|
119
|
-
return Number.isFinite(value) ? value :
|
|
120
|
-
if (typeof value !== "string" || value.trim() === "")
|
|
121
|
-
return;
|
|
88
|
+
return Number.isFinite(value) ? value : void 0;
|
|
89
|
+
if (typeof value !== "string" || value.trim() === "") return void 0;
|
|
122
90
|
const parsed = Number(value);
|
|
123
|
-
return Number.isFinite(parsed) ? parsed :
|
|
91
|
+
return Number.isFinite(parsed) ? parsed : void 0;
|
|
124
92
|
}
|
|
125
93
|
function tokenize(expr) {
|
|
126
94
|
const tokens = [];
|
|
@@ -138,16 +106,14 @@ function tokenize(expr) {
|
|
|
138
106
|
}
|
|
139
107
|
if (/\d|\./.test(ch)) {
|
|
140
108
|
let end = i + 1;
|
|
141
|
-
while (end < expr.length && /\d|\./.test(expr[end]))
|
|
142
|
-
end++;
|
|
109
|
+
while (end < expr.length && /\d|\./.test(expr[end])) end++;
|
|
143
110
|
const value = Number(expr.slice(i, end));
|
|
144
|
-
if (!Number.isFinite(value))
|
|
145
|
-
return;
|
|
111
|
+
if (!Number.isFinite(value)) return void 0;
|
|
146
112
|
tokens.push(value);
|
|
147
113
|
i = end;
|
|
148
114
|
continue;
|
|
149
115
|
}
|
|
150
|
-
return;
|
|
116
|
+
return void 0;
|
|
151
117
|
}
|
|
152
118
|
return tokens;
|
|
153
119
|
}
|
|
@@ -157,29 +123,25 @@ function parse(tokens) {
|
|
|
157
123
|
const take = () => tokens[i++];
|
|
158
124
|
const primary = () => {
|
|
159
125
|
const token = take();
|
|
160
|
-
if (typeof token === "number")
|
|
161
|
-
|
|
162
|
-
if (token === "+")
|
|
163
|
-
return primary();
|
|
126
|
+
if (typeof token === "number") return token;
|
|
127
|
+
if (token === "+") return primary();
|
|
164
128
|
if (token === "-") {
|
|
165
129
|
const value2 = primary();
|
|
166
|
-
return value2 ===
|
|
130
|
+
return value2 === void 0 ? void 0 : -value2;
|
|
167
131
|
}
|
|
168
132
|
if (token === "(") {
|
|
169
133
|
const value2 = add();
|
|
170
|
-
if (take() !== ")")
|
|
171
|
-
return;
|
|
134
|
+
if (take() !== ")") return void 0;
|
|
172
135
|
return value2;
|
|
173
136
|
}
|
|
174
|
-
return;
|
|
137
|
+
return void 0;
|
|
175
138
|
};
|
|
176
139
|
const mul = () => {
|
|
177
140
|
let left = primary();
|
|
178
141
|
while (peek() === "*" || peek() === "/") {
|
|
179
142
|
const op = take();
|
|
180
143
|
const right = primary();
|
|
181
|
-
if (left ===
|
|
182
|
-
return;
|
|
144
|
+
if (left === void 0 || right === void 0) return void 0;
|
|
183
145
|
left = op === "*" ? left * right : left / right;
|
|
184
146
|
}
|
|
185
147
|
return left;
|
|
@@ -189,26 +151,25 @@ function parse(tokens) {
|
|
|
189
151
|
while (peek() === "+" || peek() === "-") {
|
|
190
152
|
const op = take();
|
|
191
153
|
const right = mul();
|
|
192
|
-
if (left ===
|
|
193
|
-
return;
|
|
154
|
+
if (left === void 0 || right === void 0) return void 0;
|
|
194
155
|
left = op === "+" ? left + right : left - right;
|
|
195
156
|
}
|
|
196
157
|
return left;
|
|
197
158
|
};
|
|
198
159
|
const value = add();
|
|
199
|
-
if (i !== tokens.length || value ===
|
|
200
|
-
return;
|
|
160
|
+
if (i !== tokens.length || value === void 0 || !Number.isFinite(value))
|
|
161
|
+
return void 0;
|
|
201
162
|
return value;
|
|
202
163
|
}
|
|
203
164
|
function evaluateFormula(expr, fields) {
|
|
204
165
|
const interpolated = expr.replace(/\{([^{}]+)\}/g, (match, key) => {
|
|
205
166
|
const value = num(fields[key.trim()]);
|
|
206
|
-
return value ===
|
|
167
|
+
return value === void 0 ? match : String(value);
|
|
207
168
|
});
|
|
208
169
|
if (interpolated.includes("{") || interpolated.includes("}"))
|
|
209
|
-
return;
|
|
170
|
+
return void 0;
|
|
210
171
|
const tokens = tokenize(interpolated);
|
|
211
|
-
return tokens ? parse(tokens) :
|
|
172
|
+
return tokens ? parse(tokens) : void 0;
|
|
212
173
|
}
|
|
213
174
|
function keys(value) {
|
|
214
175
|
const raw = value.replace(/^schema:/, "").trim();
|
|
@@ -219,15 +180,12 @@ function keys(value) {
|
|
|
219
180
|
return [...new Set([lower, snake, compact].filter(Boolean))];
|
|
220
181
|
}
|
|
221
182
|
function parseFields(raw) {
|
|
222
|
-
if (typeof raw !== "string")
|
|
223
|
-
return [];
|
|
183
|
+
if (typeof raw !== "string") return [];
|
|
224
184
|
try {
|
|
225
185
|
const parsed = JSON.parse(raw);
|
|
226
|
-
if (!Array.isArray(parsed))
|
|
227
|
-
return [];
|
|
186
|
+
if (!Array.isArray(parsed)) return [];
|
|
228
187
|
return parsed.filter((item) => {
|
|
229
|
-
if (!item || typeof item !== "object")
|
|
230
|
-
return false;
|
|
188
|
+
if (!item || typeof item !== "object") return false;
|
|
231
189
|
const def = item;
|
|
232
190
|
return typeof def.key === "string" && typeof def.type === "string";
|
|
233
191
|
});
|
|
@@ -237,15 +195,18 @@ function parseFields(raw) {
|
|
|
237
195
|
}
|
|
238
196
|
function schemaFields(facts, names) {
|
|
239
197
|
const wanted = new Set(names.flatMap(keys));
|
|
240
|
-
const fact = facts.find(
|
|
198
|
+
const fact = facts.find(
|
|
199
|
+
(item) => item.e.startsWith("schema:") && item.a === "props" && keys(item.e).some((key) => wanted.has(key))
|
|
200
|
+
);
|
|
241
201
|
return parseFields(fact?.v);
|
|
242
202
|
}
|
|
243
203
|
function applyFormulas(entry, defs) {
|
|
244
|
-
const formulas = defs.filter(
|
|
245
|
-
|
|
246
|
-
|
|
204
|
+
const formulas = defs.filter(
|
|
205
|
+
(def) => def.type === "formula" && typeof def.formula === "string" && def.formula.trim()
|
|
206
|
+
);
|
|
207
|
+
if (formulas.length === 0) return entry;
|
|
247
208
|
const fields = { ...entry.fields };
|
|
248
|
-
for (let pass = 0;pass < formulas.length; pass++) {
|
|
209
|
+
for (let pass = 0; pass < formulas.length; pass++) {
|
|
249
210
|
for (const def of formulas)
|
|
250
211
|
fields[def.key] = evaluateFormula(def.formula, fields);
|
|
251
212
|
}
|
|
@@ -254,25 +215,27 @@ function applyFormulas(entry, defs) {
|
|
|
254
215
|
|
|
255
216
|
// src/cms/client.ts
|
|
256
217
|
var DEFAULT_BASE_PATH = "/trellis/store";
|
|
257
|
-
var DEFAULT_POLL_MS =
|
|
218
|
+
var DEFAULT_POLL_MS = 2e3;
|
|
258
219
|
var MIN_POLL_MS = 500;
|
|
259
|
-
var MAX_FACTS_PER_FETCH =
|
|
260
|
-
var MAX_ENTITIES_PER_FETCH =
|
|
220
|
+
var MAX_FACTS_PER_FETCH = 5e3;
|
|
221
|
+
var MAX_ENTITIES_PER_FETCH = 1e3;
|
|
261
222
|
var defaultEquals = (prev, next) => fingerprint(prev) === fingerprint(next);
|
|
262
|
-
|
|
263
|
-
class CmsClient {
|
|
223
|
+
var CmsClient = class {
|
|
264
224
|
url;
|
|
265
225
|
basePath;
|
|
266
226
|
directory;
|
|
267
227
|
pollIntervalMs;
|
|
268
228
|
fetchFn;
|
|
269
229
|
apiKey;
|
|
270
|
-
subscriptions = new Map;
|
|
230
|
+
subscriptions = /* @__PURE__ */ new Map();
|
|
271
231
|
constructor(opts) {
|
|
272
232
|
this.url = opts.url.replace(/\/+$/, "");
|
|
273
233
|
this.basePath = (opts.basePath ?? DEFAULT_BASE_PATH).replace(/\/+$/, "");
|
|
274
234
|
this.directory = opts.directory;
|
|
275
|
-
this.pollIntervalMs = Math.max(
|
|
235
|
+
this.pollIntervalMs = Math.max(
|
|
236
|
+
MIN_POLL_MS,
|
|
237
|
+
opts.pollIntervalMs ?? DEFAULT_POLL_MS
|
|
238
|
+
);
|
|
276
239
|
this.fetchFn = opts.fetch ?? globalThis.fetch.bind(globalThis);
|
|
277
240
|
this.apiKey = opts.apiKey;
|
|
278
241
|
}
|
|
@@ -282,25 +245,24 @@ class CmsClient {
|
|
|
282
245
|
entry(id) {
|
|
283
246
|
return new EntryRef(this, id);
|
|
284
247
|
}
|
|
248
|
+
/** List CMS collections (TypeSchema entities marked cms=true). */
|
|
285
249
|
async collections() {
|
|
286
250
|
const [entities, facts] = await Promise.all([
|
|
287
251
|
this._entities(),
|
|
288
252
|
this._facts()
|
|
289
253
|
]);
|
|
290
254
|
const factsByEntity = groupFactsByEntity(facts ?? []);
|
|
291
|
-
const counts = new Map;
|
|
255
|
+
const counts = /* @__PURE__ */ new Map();
|
|
292
256
|
for (const e of entities ?? []) {
|
|
293
257
|
const k = typeKey(e.type);
|
|
294
258
|
counts.set(k, (counts.get(k) ?? 0) + 1);
|
|
295
259
|
}
|
|
296
|
-
const out = new Map;
|
|
260
|
+
const out = /* @__PURE__ */ new Map();
|
|
297
261
|
for (const e of entities ?? []) {
|
|
298
|
-
if (e.type !== "TypeSchema")
|
|
299
|
-
continue;
|
|
262
|
+
if (e.type !== "TypeSchema") continue;
|
|
300
263
|
const efacts = factsByEntity.get(e.id) ?? [];
|
|
301
264
|
const isCms = efacts.some((f) => f.a === "cms" && f.v === true);
|
|
302
|
-
if (!isCms)
|
|
303
|
-
continue;
|
|
265
|
+
if (!isCms) continue;
|
|
304
266
|
const name = e.id.replace(/^schema:/, "");
|
|
305
267
|
const k = typeKey(name);
|
|
306
268
|
const labelFact = efacts.find((f) => f.a === "label");
|
|
@@ -321,12 +283,19 @@ class CmsClient {
|
|
|
321
283
|
}
|
|
322
284
|
this.subscriptions.clear();
|
|
323
285
|
}
|
|
286
|
+
/**
|
|
287
|
+
* Shared polling subscription. Multiple subscribers to the same key share a
|
|
288
|
+
* single timer and one HTTP request per poll cycle. New subscribers receive
|
|
289
|
+
* the most recently fetched value immediately if one is cached.
|
|
290
|
+
*
|
|
291
|
+
* @internal
|
|
292
|
+
*/
|
|
324
293
|
_share(key, fetcher, callback, extras = {}) {
|
|
325
294
|
let sub = this.subscriptions.get(key);
|
|
326
295
|
if (!sub) {
|
|
327
296
|
const fresh = {
|
|
328
|
-
subscribers: new Set,
|
|
329
|
-
interval:
|
|
297
|
+
subscribers: /* @__PURE__ */ new Set(),
|
|
298
|
+
interval: void 0,
|
|
330
299
|
hasLast: false,
|
|
331
300
|
fetcher
|
|
332
301
|
};
|
|
@@ -343,14 +312,13 @@ class CmsClient {
|
|
|
343
312
|
}
|
|
344
313
|
}
|
|
345
314
|
} catch (err) {
|
|
346
|
-
for (const item2 of fresh.subscribers)
|
|
347
|
-
item2.onError?.(err);
|
|
315
|
+
for (const item2 of fresh.subscribers) item2.onError?.(err);
|
|
348
316
|
}
|
|
349
317
|
};
|
|
350
318
|
fresh.interval = setInterval(tick, this.pollIntervalMs);
|
|
351
319
|
this.subscriptions.set(key, fresh);
|
|
352
320
|
sub = fresh;
|
|
353
|
-
tick();
|
|
321
|
+
void tick();
|
|
354
322
|
}
|
|
355
323
|
const item = {
|
|
356
324
|
callback,
|
|
@@ -372,6 +340,7 @@ class CmsClient {
|
|
|
372
340
|
}
|
|
373
341
|
};
|
|
374
342
|
}
|
|
343
|
+
/** @internal */
|
|
375
344
|
async _get(path) {
|
|
376
345
|
const u = new URL(`${this.basePath}${path}`, this.url);
|
|
377
346
|
if (this.directory && !u.searchParams.has("directory")) {
|
|
@@ -380,29 +349,37 @@ class CmsClient {
|
|
|
380
349
|
const res = await this.fetchFn(u.toString(), {
|
|
381
350
|
headers: this.apiKey ? { Authorization: `Bearer ${this.apiKey}` } : {}
|
|
382
351
|
});
|
|
383
|
-
if (res.status === 404)
|
|
384
|
-
return;
|
|
352
|
+
if (res.status === 404) return void 0;
|
|
385
353
|
if (!res.ok)
|
|
386
|
-
throw new Error(
|
|
354
|
+
throw new Error(
|
|
355
|
+
`Trellis CMS request failed (${res.status}) ${u.pathname}`
|
|
356
|
+
);
|
|
387
357
|
const kind = res.headers.get("content-type") ?? "";
|
|
388
358
|
const text = await res.text();
|
|
389
359
|
if (!kind.toLowerCase().includes("application/json")) {
|
|
390
|
-
throw new Error(
|
|
360
|
+
throw new Error(
|
|
361
|
+
`Trellis CMS expected JSON (${res.status}) ${u.pathname}: ${text.slice(0, 120)}`
|
|
362
|
+
);
|
|
391
363
|
}
|
|
392
364
|
try {
|
|
393
365
|
return JSON.parse(text);
|
|
394
366
|
} catch (err) {
|
|
395
|
-
throw new Error(
|
|
367
|
+
throw new Error(
|
|
368
|
+
`Trellis CMS invalid JSON (${res.status}) ${u.pathname}: ${text.slice(0, 120)}`,
|
|
369
|
+
{ cause: err }
|
|
370
|
+
);
|
|
396
371
|
}
|
|
397
372
|
}
|
|
373
|
+
/** @internal */
|
|
398
374
|
async _entities() {
|
|
399
375
|
const out = [];
|
|
400
376
|
let offset = 0;
|
|
401
377
|
while (true) {
|
|
402
|
-
const page = await this._get(
|
|
378
|
+
const page = await this._get(
|
|
379
|
+
`/entities?limit=${MAX_ENTITIES_PER_FETCH}&offset=${offset}`
|
|
380
|
+
) ?? [];
|
|
403
381
|
out.push(...page);
|
|
404
|
-
if (page.length < MAX_ENTITIES_PER_FETCH)
|
|
405
|
-
return out;
|
|
382
|
+
if (page.length < MAX_ENTITIES_PER_FETCH) return out;
|
|
406
383
|
offset += MAX_ENTITIES_PER_FETCH;
|
|
407
384
|
}
|
|
408
385
|
}
|
|
@@ -410,27 +387,28 @@ class CmsClient {
|
|
|
410
387
|
const out = [];
|
|
411
388
|
let offset = 0;
|
|
412
389
|
while (true) {
|
|
413
|
-
const page = await this._get(
|
|
390
|
+
const page = await this._get(
|
|
391
|
+
`/facts?limit=${MAX_FACTS_PER_FETCH}&offset=${offset}`
|
|
392
|
+
) ?? [];
|
|
414
393
|
out.push(...page);
|
|
415
|
-
if (page.length < MAX_FACTS_PER_FETCH)
|
|
416
|
-
return out;
|
|
394
|
+
if (page.length < MAX_FACTS_PER_FETCH) return out;
|
|
417
395
|
offset += MAX_FACTS_PER_FETCH;
|
|
418
396
|
}
|
|
419
397
|
}
|
|
398
|
+
/** @internal */
|
|
420
399
|
async _entryById(id, schemaFacts) {
|
|
421
400
|
const detail = await this._get(`/entity/${encodeURIComponent(id)}`);
|
|
422
|
-
if (!detail)
|
|
423
|
-
return null;
|
|
401
|
+
if (!detail) return null;
|
|
424
402
|
const typeFact = detail.facts.find((f) => f.a === "type");
|
|
425
403
|
const type = typeof typeFact?.v === "string" ? typeFact.v : "unknown";
|
|
426
404
|
const facts = schemaFacts ?? await this._facts() ?? [];
|
|
427
|
-
return applyFormulas(
|
|
405
|
+
return applyFormulas(
|
|
406
|
+
entryFromFacts({ id: detail.id, type }, detail.facts, detail.links),
|
|
407
|
+
schemaFields(facts, [type])
|
|
408
|
+
);
|
|
428
409
|
}
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
class CollectionRef {
|
|
432
|
-
client;
|
|
433
|
-
key;
|
|
410
|
+
};
|
|
411
|
+
var CollectionRef = class {
|
|
434
412
|
constructor(client, key) {
|
|
435
413
|
this.client = client;
|
|
436
414
|
this.key = key;
|
|
@@ -444,62 +422,88 @@ class CollectionRef {
|
|
|
444
422
|
this.client._facts(),
|
|
445
423
|
this.client._get(`/links`)
|
|
446
424
|
]);
|
|
447
|
-
if (!allEntities)
|
|
448
|
-
return [];
|
|
425
|
+
if (!allEntities) return [];
|
|
449
426
|
const wantedKey = typeKey(this.key);
|
|
450
427
|
const matching = allEntities.filter((e) => typeKey(e.type) === wantedKey);
|
|
451
|
-
if (matching.length === 0)
|
|
452
|
-
return [];
|
|
428
|
+
if (matching.length === 0) return [];
|
|
453
429
|
const factsByEntity = groupFactsByEntity(facts ?? []);
|
|
454
430
|
const linksBySource = groupLinksBySource(links ?? []);
|
|
455
431
|
const defs = schemaFields(facts ?? [], [
|
|
456
432
|
this.key,
|
|
457
433
|
...matching.map((e) => e.type)
|
|
458
434
|
]);
|
|
459
|
-
let entries = matching.map(
|
|
435
|
+
let entries = matching.map(
|
|
436
|
+
(e) => applyFormulas(
|
|
437
|
+
entryFromFacts(
|
|
438
|
+
e,
|
|
439
|
+
factsByEntity.get(e.id) ?? [],
|
|
440
|
+
linksBySource.get(e.id) ?? []
|
|
441
|
+
),
|
|
442
|
+
defs
|
|
443
|
+
)
|
|
444
|
+
);
|
|
460
445
|
if (status !== "all") {
|
|
461
446
|
entries = entries.filter((e) => e.status === status);
|
|
462
447
|
}
|
|
463
448
|
entries = entries.slice(0, limit);
|
|
464
449
|
if (wantsExpand) {
|
|
465
|
-
entries = await expandReferences(
|
|
450
|
+
entries = await expandReferences(
|
|
451
|
+
entries,
|
|
452
|
+
opts.expand,
|
|
453
|
+
(id) => this.client._entryById(id, facts ?? [])
|
|
454
|
+
);
|
|
466
455
|
}
|
|
467
456
|
return entries;
|
|
468
457
|
}
|
|
469
458
|
async get(id, opts = {}) {
|
|
470
459
|
const entry = await this.client._entryById(id);
|
|
471
|
-
if (!entry)
|
|
472
|
-
return null;
|
|
460
|
+
if (!entry) return null;
|
|
473
461
|
if (opts.expand && opts.expand.length > 0) {
|
|
474
|
-
const [expanded] = await expandReferences(
|
|
462
|
+
const [expanded] = await expandReferences(
|
|
463
|
+
[entry],
|
|
464
|
+
opts.expand,
|
|
465
|
+
(eid) => this.client._entryById(eid)
|
|
466
|
+
);
|
|
475
467
|
return expanded;
|
|
476
468
|
}
|
|
477
469
|
return entry;
|
|
478
470
|
}
|
|
471
|
+
/**
|
|
472
|
+
* Subscribe to changes. Currently implemented as polling; a future SSE-backed
|
|
473
|
+
* upgrade will replace the transport without changing this API.
|
|
474
|
+
*
|
|
475
|
+
* Multiple subscribers to the same collection + opts share one polling timer
|
|
476
|
+
* and one HTTP request per cycle.
|
|
477
|
+
*/
|
|
479
478
|
subscribe(callback, opts = {}) {
|
|
480
479
|
const { onError, equals, ...listOpts } = opts;
|
|
481
480
|
const key = `coll:${typeKey(this.key)}:${JSON.stringify(listOpts)}`;
|
|
482
|
-
return this.client._share(
|
|
481
|
+
return this.client._share(
|
|
482
|
+
key,
|
|
483
|
+
() => this.list(listOpts),
|
|
484
|
+
callback,
|
|
485
|
+
{ onError, equals }
|
|
486
|
+
);
|
|
483
487
|
}
|
|
484
488
|
async schema() {
|
|
485
489
|
const facts = await this.client._facts();
|
|
486
490
|
return schemaFields(facts ?? [], [this.key]);
|
|
487
491
|
}
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
class EntryRef {
|
|
491
|
-
client;
|
|
492
|
-
id;
|
|
492
|
+
};
|
|
493
|
+
var EntryRef = class {
|
|
493
494
|
constructor(client, id) {
|
|
494
495
|
this.client = client;
|
|
495
496
|
this.id = id;
|
|
496
497
|
}
|
|
497
498
|
async get(opts = {}) {
|
|
498
499
|
const entry = await this.client._entryById(this.id);
|
|
499
|
-
if (!entry)
|
|
500
|
-
return null;
|
|
500
|
+
if (!entry) return null;
|
|
501
501
|
if (opts.expand && opts.expand.length > 0) {
|
|
502
|
-
const [expanded] = await expandReferences(
|
|
502
|
+
const [expanded] = await expandReferences(
|
|
503
|
+
[entry],
|
|
504
|
+
opts.expand,
|
|
505
|
+
(eid) => this.client._entryById(eid)
|
|
506
|
+
);
|
|
503
507
|
return expanded;
|
|
504
508
|
}
|
|
505
509
|
return entry;
|
|
@@ -507,22 +511,26 @@ class EntryRef {
|
|
|
507
511
|
subscribe(callback, opts = {}) {
|
|
508
512
|
const { onError, equals, ...getOpts } = opts;
|
|
509
513
|
const key = `entry:${this.id}:${JSON.stringify(getOpts)}`;
|
|
510
|
-
return this.client._share(
|
|
514
|
+
return this.client._share(
|
|
515
|
+
key,
|
|
516
|
+
() => this.get(getOpts),
|
|
517
|
+
callback,
|
|
518
|
+
{ onError, equals }
|
|
519
|
+
);
|
|
511
520
|
}
|
|
512
|
-
}
|
|
521
|
+
};
|
|
513
522
|
function createCmsClient(opts) {
|
|
514
523
|
return new CmsClient(opts);
|
|
515
524
|
}
|
|
525
|
+
|
|
516
526
|
// src/cms/scaffold.ts
|
|
517
527
|
var DEFAULT_URL = "http://localhost:4096";
|
|
518
528
|
function expandLiteral(expand) {
|
|
519
|
-
if (!expand || expand.length === 0)
|
|
520
|
-
return "";
|
|
529
|
+
if (!expand || expand.length === 0) return "";
|
|
521
530
|
return ` expand: ${JSON.stringify(expand)},`;
|
|
522
531
|
}
|
|
523
532
|
function clientLiteral(url, directory) {
|
|
524
|
-
if (!directory)
|
|
525
|
-
return `createCmsClient({ url: "${url}" })`;
|
|
533
|
+
if (!directory) return `createCmsClient({ url: "${url}" })`;
|
|
526
534
|
return `createCmsClient({ url: "${url}", directory: ${JSON.stringify(directory)} })`;
|
|
527
535
|
}
|
|
528
536
|
function vanilla(opts) {
|
|
@@ -636,13 +644,13 @@ function scaffoldFilename(opts) {
|
|
|
636
644
|
}
|
|
637
645
|
}
|
|
638
646
|
export {
|
|
639
|
-
|
|
640
|
-
scaffoldConsumer,
|
|
641
|
-
parseFields,
|
|
642
|
-
evaluateFormula,
|
|
643
|
-
createCmsClient,
|
|
644
|
-
applyFormulas,
|
|
645
|
-
EntryRef,
|
|
647
|
+
CmsClient,
|
|
646
648
|
CollectionRef,
|
|
647
|
-
|
|
649
|
+
EntryRef,
|
|
650
|
+
applyFormulas,
|
|
651
|
+
createCmsClient,
|
|
652
|
+
evaluateFormula,
|
|
653
|
+
parseFields,
|
|
654
|
+
scaffoldConsumer,
|
|
655
|
+
scaffoldFilename
|
|
648
656
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// @bun
|
|
2
1
|
import {
|
|
3
2
|
CONFIG_FILE,
|
|
4
3
|
configPath,
|
|
@@ -7,14 +6,14 @@ import {
|
|
|
7
6
|
readConfig,
|
|
8
7
|
updateConfig,
|
|
9
8
|
writeConfig
|
|
10
|
-
} from "./
|
|
11
|
-
import"./
|
|
9
|
+
} from "./chunk-JA7AIHRK.js";
|
|
10
|
+
import "./chunk-2ESYSVXG.js";
|
|
12
11
|
export {
|
|
13
|
-
|
|
14
|
-
updateConfig,
|
|
15
|
-
readConfig,
|
|
16
|
-
hasConfig,
|
|
17
|
-
defaultLocalConfig,
|
|
12
|
+
CONFIG_FILE,
|
|
18
13
|
configPath,
|
|
19
|
-
|
|
14
|
+
defaultLocalConfig,
|
|
15
|
+
hasConfig,
|
|
16
|
+
readConfig,
|
|
17
|
+
updateConfig,
|
|
18
|
+
writeConfig
|
|
20
19
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CONFIG_FILE,
|
|
3
|
+
configPath,
|
|
4
|
+
defaultLocalConfig,
|
|
5
|
+
hasConfig,
|
|
6
|
+
readConfig,
|
|
7
|
+
updateConfig,
|
|
8
|
+
writeConfig
|
|
9
|
+
} from "./chunk-JA7AIHRK.js";
|
|
10
|
+
import "./chunk-KFQGP6VL.js";
|
|
11
|
+
export {
|
|
12
|
+
CONFIG_FILE,
|
|
13
|
+
configPath,
|
|
14
|
+
defaultLocalConfig,
|
|
15
|
+
hasConfig,
|
|
16
|
+
readConfig,
|
|
17
|
+
updateConfig,
|
|
18
|
+
writeConfig
|
|
19
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CONFIG_FILE,
|
|
3
|
+
configPath,
|
|
4
|
+
defaultLocalConfig,
|
|
5
|
+
hasConfig,
|
|
6
|
+
readConfig,
|
|
7
|
+
updateConfig,
|
|
8
|
+
writeConfig
|
|
9
|
+
} from "./chunk-JA7AIHRK.js";
|
|
10
|
+
import "./chunk-SIAA4J6H.js";
|
|
11
|
+
export {
|
|
12
|
+
CONFIG_FILE,
|
|
13
|
+
configPath,
|
|
14
|
+
defaultLocalConfig,
|
|
15
|
+
hasConfig,
|
|
16
|
+
readConfig,
|
|
17
|
+
updateConfig,
|
|
18
|
+
writeConfig
|
|
19
|
+
};
|