allyhub 0.16.0 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/commands/inspect/index.js +1 -1
- package/dist/commands/inspect/uses.js +3 -0
- package/dist/node_modules/@allyhub/3d-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/audio/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/audio/dist/place.js +2 -0
- package/dist/node_modules/@allyhub/audio/package.json +1 -1
- package/dist/node_modules/@allyhub/browser/package.json +1 -1
- package/dist/node_modules/@allyhub/build/dist/content.d.ts +7 -0
- package/dist/node_modules/@allyhub/build/dist/imports.d.ts +17 -0
- package/dist/node_modules/@allyhub/build/dist/imports.js +2 -0
- package/dist/node_modules/@allyhub/build/dist/index.d.ts +2 -1
- package/dist/node_modules/@allyhub/build/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/build/dist/kind-build.d.ts +19 -3
- package/dist/node_modules/@allyhub/build/dist/prepare.js +3 -3
- package/dist/node_modules/@allyhub/build/dist/uses.d.ts +27 -6
- package/dist/node_modules/@allyhub/build/dist/uses.js +1 -1
- package/dist/node_modules/@allyhub/build/package.json +1 -1
- package/dist/node_modules/@allyhub/canvas-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
- package/dist/node_modules/@allyhub/chart/package.json +1 -1
- package/dist/node_modules/@allyhub/check/package.json +1 -1
- package/dist/node_modules/@allyhub/cloud/package.json +1 -1
- package/dist/node_modules/@allyhub/components/package.json +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/live.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/record.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
- package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
- package/dist/node_modules/@allyhub/doc/dist/docx.js +4 -4
- package/dist/node_modules/@allyhub/doc/dist/html.js +40 -40
- package/dist/node_modules/@allyhub/doc/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/markdown.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/parse.js +4 -4
- package/dist/node_modules/@allyhub/doc/dist/table.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/write.js +26 -26
- package/dist/node_modules/@allyhub/doc/package.json +1 -1
- package/dist/node_modules/@allyhub/doc-extension/dist/build.js +2 -2
- package/dist/node_modules/@allyhub/doc-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
- package/dist/node_modules/@allyhub/export/dist/export.js +1 -1
- package/dist/node_modules/@allyhub/export/package.json +1 -1
- package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
- package/dist/node_modules/@allyhub/extension-host/dist/points.js +1 -1
- package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +15 -3
- package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/items.d.ts +40 -7
- package/dist/node_modules/@allyhub/formats/dist/items.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +4 -0
- package/dist/node_modules/@allyhub/formats/package.json +1 -1
- package/dist/node_modules/@allyhub/i18n/package.json +1 -1
- package/dist/node_modules/@allyhub/image-draw/dist/stage.js +1 -1
- package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
- package/dist/node_modules/@allyhub/image-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
- package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
- package/dist/node_modules/@allyhub/image-render/package.json +1 -1
- package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
- package/dist/node_modules/@allyhub/jobs/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-extension/package.json +3 -1
- package/dist/node_modules/@allyhub/linkedin-model/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-view/package.json +1 -1
- package/dist/node_modules/@allyhub/measure/package.json +1 -1
- package/dist/node_modules/@allyhub/media/package.json +1 -1
- package/dist/node_modules/@allyhub/media-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/model/package.json +1 -1
- package/dist/node_modules/@allyhub/office-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
- package/dist/node_modules/@allyhub/piece/dist/layer.d.ts +15 -0
- package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +1 -0
- package/dist/node_modules/@allyhub/piece/dist/page/index.js +1 -1
- package/dist/node_modules/@allyhub/piece/dist/page/runtimes.d.ts +9 -0
- package/dist/node_modules/@allyhub/piece/dist/page/runtimes.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/source.d.ts +51 -10
- package/dist/node_modules/@allyhub/piece/dist/source.js +1 -1
- package/dist/node_modules/@allyhub/piece/package.json +1 -1
- package/dist/node_modules/@allyhub/project/dist/digest.js +1 -1
- package/dist/node_modules/@allyhub/project/dist/part-keys.js +1 -1
- package/dist/node_modules/@allyhub/project/package.json +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +0 -6
- package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/events.d.ts +39 -0
- package/dist/node_modules/@allyhub/protocol/dist/events.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +3 -0
- package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/kinds.d.ts +30 -0
- package/dist/node_modules/@allyhub/protocol/dist/kinds.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +6 -0
- package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub/protocol/package.json +1 -1
- package/dist/node_modules/@allyhub/registry/package.json +1 -1
- package/dist/node_modules/@allyhub/render/package.json +1 -1
- package/dist/node_modules/@allyhub/runtime/dist/compose.js +1 -1
- package/dist/node_modules/@allyhub/runtime/dist/embed.js +1 -1
- package/dist/node_modules/@allyhub/runtime/dist/film.js +1 -1
- package/dist/node_modules/@allyhub/runtime/dist/piece.js +2 -2
- package/dist/node_modules/@allyhub/runtime/dist/player/player.js +1 -1
- package/dist/node_modules/@allyhub/runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
- package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/coerce.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/date.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/dynamic.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/info.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/logical.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/lookup.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/text.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/formula/parse.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
- package/dist/node_modules/@allyhub/sheet/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/dist/build.js +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/animation.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/api.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/components.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-extension/dist/build.js +2 -1
- package/dist/node_modules/@allyhub/slides-extension/dist/deck-pptx.js +1 -1
- package/dist/node_modules/@allyhub/slides-extension/dist/evaluate.js +2 -2
- package/dist/node_modules/@allyhub/slides-extension/dist/export.js +1 -1
- package/dist/node_modules/@allyhub/slides-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/write.js +2 -2
- package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-runtime/dist/component.js +1 -1
- package/dist/node_modules/@allyhub/slides-runtime/dist/draw.js +2 -2
- package/dist/node_modules/@allyhub/slides-runtime/dist/item.js +2 -0
- package/dist/node_modules/@allyhub/slides-runtime/dist/load.js +5 -5
- package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/stage/package.json +1 -1
- package/dist/node_modules/@allyhub/stage-page/dist/install.js +1 -1
- package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
- package/dist/node_modules/@allyhub/stage-runtime/dist/runtime.js +19 -19
- package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/telemetry/package.json +1 -1
- package/dist/node_modules/@allyhub/text-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/video-core/package.json +1 -1
- package/dist/node_modules/@allyhub/video-extension/dist/build.js +1 -1
- package/dist/node_modules/@allyhub/video-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
- package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
- package/dist/node_modules/@allyhub/website/package.json +1 -1
- package/dist/node_modules/@allyhub/website-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/x-extension/package.json +3 -1
- package/dist/node_modules/@allyhub/x-model/package.json +1 -1
- package/dist/node_modules/@allyhub/x-view/package.json +1 -1
- package/dist/package.json +13 -13
- package/dist/works.js +1 -1
- package/editor-web/assets/{abnfDiagram-WEYOIA3C-B1AxOB-Y.js → abnfDiagram-WEYOIA3C-CHNpVSPv.js} +1 -1
- package/editor-web/assets/{architecture-WOLXFQ4H-C-7xKJ2Z.js → architecture-WOLXFQ4H-gPsJqQwV.js} +1 -1
- package/editor-web/assets/{architectureDiagram-ZHVYKT53-CyWb8_iD.js → architectureDiagram-ZHVYKT53-CEIDcC6r.js} +1 -1
- package/editor-web/assets/{article-qt4W_BKH.js → article-BHTjq0_Y.js} +1 -1
- package/editor-web/assets/{article-CTKW7Eo0.js → article-DfELjJ2o.js} +1 -1
- package/editor-web/assets/{blockDiagram-RJAE7QA3-uii4-7Ix.js → blockDiagram-RJAE7QA3-CUzEGVet.js} +1 -1
- package/editor-web/assets/{c4Diagram-XDPPPE54-BtL5Z-wF.js → c4Diagram-XDPPPE54-CB94NR9s.js} +1 -1
- package/editor-web/assets/calc-worker-BdHh5LXM.js +45 -0
- package/editor-web/assets/channel-DCDCx5Es.js +1 -0
- package/editor-web/assets/{chart-file-HE-uXGmJ.js → chart-file-CfbWK9l1.js} +1 -1
- package/editor-web/assets/{chunk-2E7WHVMD-BJjuZYBs.js → chunk-2E7WHVMD-DFYo_Boi.js} +1 -1
- package/editor-web/assets/{chunk-4EMNKR2T-nzPdUHaI.js → chunk-4EMNKR2T-CLLjmweX.js} +1 -1
- package/editor-web/assets/{chunk-55XCU76K-CH52E3Nl.js → chunk-55XCU76K-CkwQ_3m1.js} +1 -1
- package/editor-web/assets/{chunk-7S6XSTFO-Ba4LNKCV.js → chunk-7S6XSTFO-V-AvHpAB.js} +1 -1
- package/editor-web/assets/{chunk-AQDTSKZB-Co9SmoqD.js → chunk-AQDTSKZB-PjHyYpb8.js} +1 -1
- package/editor-web/assets/{chunk-DSNLSHJZ-BHRvxRGi.js → chunk-DSNLSHJZ-QaczBS3J.js} +1 -1
- package/editor-web/assets/{chunk-HAGFOTED-F5Wd8ETY.js → chunk-HAGFOTED-aLaQB5Xu.js} +1 -1
- package/editor-web/assets/{chunk-HNE4Q36P-C_E0__p9.js → chunk-HNE4Q36P-De3ftDQR.js} +1 -1
- package/editor-web/assets/{chunk-NQOKRVIF-BvrtbbWm.js → chunk-NQOKRVIF-CrhVQyvP.js} +1 -1
- package/editor-web/assets/{chunk-UHW7PFBP-D0HTPXRF.js → chunk-UHW7PFBP-BFmZ5ZLn.js} +1 -1
- package/editor-web/assets/{chunk-VQ5W62QI-B9hF2YMk.js → chunk-VQ5W62QI-CzppUHLA.js} +1 -1
- package/editor-web/assets/{chunk-WQQL4CDK-D7N3o-Ub.js → chunk-WQQL4CDK-BrAU7V6v.js} +1 -1
- package/editor-web/assets/{chunk-YZO67HFG-XaLSrI_W.js → chunk-YZO67HFG-BSiF71qj.js} +1 -1
- package/editor-web/assets/{chunk-ZAUX2LTX-sXc6qmw-.js → chunk-ZAUX2LTX-BJc4r5b1.js} +1 -1
- package/editor-web/assets/{chunk-ZCHMQSOR-B0X6sNMX.js → chunk-ZCHMQSOR-CkGTuehB.js} +1 -1
- package/editor-web/assets/{classDiagram-v2-4MYWR3UA-CjXVvOUp.js → classDiagram-v2-4MYWR3UA-Byxc7J88.js} +1 -1
- package/editor-web/assets/{cynefin-EF2NZ3EQ-PQ9VyM9v.js → cynefin-EF2NZ3EQ-BSxkVbdf.js} +1 -1
- package/editor-web/assets/{cynefinDiagram-WF24UDRP-KXuXFAhX.js → cynefinDiagram-WF24UDRP-IkCgARNs.js} +1 -1
- package/editor-web/assets/{dagre-NK4GIZVX-CBTyfYD5.js → dagre-NK4GIZVX-9PgeH6nY.js} +1 -1
- package/editor-web/assets/deck-tTzKONci.js +1 -0
- package/editor-web/assets/{diagram-CBK3MWTC-CsVO64Bf.js → diagram-CBK3MWTC-DRzeg3Ds.js} +1 -1
- package/editor-web/assets/{diagram-I5XIIV2D-fzbUm1St.js → diagram-I5XIIV2D-B_zeKMN6.js} +1 -1
- package/editor-web/assets/{diagram-ODIL2UCW-up6ihgN5.js → diagram-ODIL2UCW-FFm0O8SN.js} +1 -1
- package/editor-web/assets/{diagram-PFBEJUXE-T6hVBoCD.js → diagram-PFBEJUXE-DrtCT8OA.js} +1 -1
- package/editor-web/assets/{diagram-RJA3I4VV-BDntFeuR.js → diagram-RJA3I4VV-DtxJ3V0q.js} +1 -1
- package/editor-web/assets/{diagram-TYUNFSNR-Dv1-mqbf.js → diagram-TYUNFSNR-DmxF_8H_.js} +1 -1
- package/editor-web/assets/dist-BEpzsYn_.js +6 -0
- package/editor-web/assets/dist-BUD4ywMB.js +18 -0
- package/editor-web/assets/{dist-aTV6Rwon.js → dist-C21CkR7Z.js} +132 -131
- package/editor-web/assets/{dist-DhMagA-B.js → dist-C56mWAec.js} +1 -1
- package/editor-web/assets/{dist-B-lYrbqX.js → dist-CAb3W9_P.js} +1 -1
- package/editor-web/assets/{dist-Bfs4cZI_.js → dist-CEknsRDd.js} +1 -1
- package/editor-web/assets/{dist-C66KgS8g.js → dist-CbZAznNW.js} +2 -2
- package/editor-web/assets/{dist-Ba5Kv4A-.js → dist-DDzjbKIg.js} +1 -1
- package/editor-web/assets/{dist-CWXGbcPB.js → dist-DaEbElXI.js} +1 -1
- package/editor-web/assets/{dist-_ooK0TT9.js → dist-Dr3o4vee.js} +1 -1
- package/editor-web/assets/{dist-mrWPE-br.js → dist-JLyDtl9X.js} +1 -1
- package/editor-web/assets/{dist-BW8IR8bR.js → dist-PBbWAsrV.js} +3 -3
- package/editor-web/assets/{dist-CBeeIAlh.js → dist-ZZlQa66J.js} +1 -1
- package/editor-web/assets/{dist-CHKVUdcE.js → dist-bQKpw3Zz.js} +5 -5
- package/editor-web/assets/dist-d4dayaWE.js +17 -0
- package/editor-web/assets/{docx-draw-CeiLkccT.js → docx-draw-9Q_fArBC.js} +1 -1
- package/editor-web/assets/{ebnfDiagram-V4P3TTPT-CZzljBYN.js → ebnfDiagram-V4P3TTPT-DSX1Aoty.js} +1 -1
- package/editor-web/assets/{elk-QONTBCTQ-6vNb82av.js → elk-QONTBCTQ-C7gy9q56.js} +1 -1
- package/editor-web/assets/{erDiagram-KYQIGQAA-B8smxURG.js → erDiagram-KYQIGQAA-CKx_HoY4.js} +1 -1
- package/editor-web/assets/esm-BZb5QMQf.js +21 -0
- package/editor-web/assets/{eventmodeling-K75KTNOO-CngIhoUF.js → eventmodeling-K75KTNOO-DL4HvSrd.js} +1 -1
- package/editor-web/assets/flowDiagram-IUGLLWBU-BUnRtJ8q.js +1 -0
- package/editor-web/assets/{ganttDiagram-R7GPNTJY-BtzqHUiP.js → ganttDiagram-R7GPNTJY-N-AP4slN.js} +1 -1
- package/editor-web/assets/{gitGraph-VSP46ZUC-DOOpoQDh.js → gitGraph-VSP46ZUC-BKRGJKWm.js} +1 -1
- package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-Cu4T8UUo.js → gitGraphDiagram-PDYL7XHY-ClwL7w2_.js} +1 -1
- package/editor-web/assets/index-BedbINE5.css +2 -0
- package/editor-web/assets/index-DG2nHq4D.js +28 -0
- package/editor-web/assets/{info-OHQRW6UA-CiNozx0c.js → info-OHQRW6UA-DpcY8t23.js} +1 -1
- package/editor-web/assets/{infoDiagram-MVDRKAX5-A3mxzTmc.js → infoDiagram-MVDRKAX5-ChtmtWni.js} +1 -1
- package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-CIbVgY0Z.js → ishikawaDiagram-HPEHV2GE-BZNTuG_F.js} +1 -1
- package/editor-web/assets/{journeyDiagram-BOSHW7O7-BwPXFmyS.js → journeyDiagram-BOSHW7O7-C3uVmZbL.js} +1 -1
- package/editor-web/assets/{kanban-definition-FNSA4HC5-biRlEeb1.js → kanban-definition-FNSA4HC5-puEhftGG.js} +1 -1
- package/editor-web/assets/{mermaid-parser.core-ikwPmNne.js → mermaid-parser.core-Bw8re-WE.js} +3 -3
- package/editor-web/assets/{mermaid.core-B4GR7QVa.js → mermaid.core-Cc2GIqBr.js} +4 -4
- package/editor-web/assets/{mindmap-definition-6OY57UG3-BN8aiUmO.js → mindmap-definition-6OY57UG3-C6MUl_S_.js} +1 -1
- package/editor-web/assets/{packet-JDAUHWVQ-DWesZv6p.js → packet-JDAUHWVQ-C75RnvC5.js} +1 -1
- package/editor-web/assets/{pegDiagram-ECIUJNBX-Bh3QEAL_.js → pegDiagram-ECIUJNBX-ChjmsdV4.js} +1 -1
- package/editor-web/assets/{pie-XZMESJXO-DT1ANL51.js → pie-XZMESJXO-BaKxJQpj.js} +1 -1
- package/editor-web/assets/{pieDiagram-GNMPY74T-xXxgiv6O.js → pieDiagram-GNMPY74T-CT2ez8pr.js} +1 -1
- package/editor-web/assets/{props-form-BwZY8ZWd.js → props-form-D5oKHfpk.js} +1 -1
- package/editor-web/assets/{quadrantDiagram-D57K4MC3-BGzRd8iZ.js → quadrantDiagram-D57K4MC3-BJItlTfk.js} +1 -1
- package/editor-web/assets/{radar-ABXABTNO-C-rmMB0D.js → radar-ABXABTNO-DnLzBlTo.js} +1 -1
- package/editor-web/assets/{railroad-I3PHUGI6-CvLOq2i8.js → railroad-I3PHUGI6-D5hj6Yv3.js} +1 -1
- package/editor-web/assets/{railroad-abnf-LNEFI6M7-DMsb025s.js → railroad-abnf-LNEFI6M7-DUZlZoPu.js} +1 -1
- package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-5bvVcIvh.js → railroad-ebnf-DWYD2UWJ-CDyyDC6d.js} +1 -1
- package/editor-web/assets/{railroad-peg-JR7BVNR7-LKZ9-9ja.js → railroad-peg-JR7BVNR7-CC3ImNnT.js} +1 -1
- package/editor-web/assets/{railroadDiagram-Y72NRBL7-DVBhzkmC.js → railroadDiagram-Y72NRBL7-Bjw-8Se5.js} +1 -1
- package/editor-web/assets/{requirementDiagram-EQYSW5RA-B5RyzWna.js → requirementDiagram-EQYSW5RA-CDFnuEIO.js} +1 -1
- package/editor-web/assets/{sankeyDiagram-SY24JHO5-BvOJG-gB.js → sankeyDiagram-SY24JHO5-CQPVLY1w.js} +1 -1
- package/editor-web/assets/{schemas-BmdNnDyt.js → schemas-moE_A7Nj.js} +1 -1
- package/editor-web/assets/{sequenceDiagram-BLEHNHQU-BI7-Daqy.js → sequenceDiagram-BLEHNHQU-BQzuLmBX.js} +1 -1
- package/editor-web/assets/{session-D8E3nUwU.js → session-s1I85rox.js} +1 -1
- package/editor-web/assets/{slides-bj0WJT_G.js → slides-oQ_C0SVJ.js} +1 -1
- package/editor-web/assets/snapshots-BPJKywuN.js +1 -0
- package/editor-web/assets/{split-BrF9ECYb.js → split-7CVjIkSU.js} +1 -1
- package/editor-web/assets/square-arrow-out-up-right-DF5dvsSp.js +1 -0
- package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-C01p8WHX.js → stateDiagram-v2-A6IESKWZ-DOuageUf.js} +1 -1
- package/editor-web/assets/{swimlanes-B3ENRKFQ-B00P2SqG.js → swimlanes-B3ENRKFQ-CXKkok7X.js} +1 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-C3Car2M0.js +8 -0
- package/editor-web/assets/{tabs-CloHB5Z4.js → tabs-CiF1N-pL.js} +1 -1
- package/editor-web/assets/{timeline-definition-JXYKGLGB-BIBoOYJY.js → timeline-definition-JXYKGLGB-DgAjAeZp.js} +1 -1
- package/editor-web/assets/{treeView-D4JQ5SDB-CL6DL8V0.js → treeView-D4JQ5SDB-C0Xvnhck.js} +1 -1
- package/editor-web/assets/{treemap-SAJKECNS-CPLGr0WY.js → treemap-SAJKECNS-aXfKAeSX.js} +1 -1
- package/editor-web/assets/{usecaseDiagram-WPOLBNNX-L03lK2bO.js → usecaseDiagram-WPOLBNNX-CvUlBa-L.js} +1 -1
- package/editor-web/assets/{vennDiagram-Q3Y3IDCW-B5tKKP_-.js → vennDiagram-Q3Y3IDCW-qMJ1iCxs.js} +1 -1
- package/editor-web/assets/{video-BWUznyLR.js → video-DQrjo1TI.js} +1 -1
- package/editor-web/assets/{wardley-7MLQ67FV-vsBpXT56.js → wardley-7MLQ67FV-DEdnH0by.js} +1 -1
- package/editor-web/assets/{wardleyDiagram-IVAIDKWA-CMCnVUgh.js → wardleyDiagram-IVAIDKWA-Bt-B2hQ5.js} +1 -1
- package/editor-web/assets/workbook-FSSUiIp9.js +45 -0
- package/editor-web/assets/{xychartDiagram-4URNHDU4-C9XkBiEO.js → xychartDiagram-4URNHDU4-DV4bSzTb.js} +1 -1
- package/editor-web/index.html +3 -3
- package/package.json +2 -2
- package/editor-web/assets/calc-worker-jImBXoeb.js +0 -45
- package/editor-web/assets/channel-dEO-yacZ.js +0 -1
- package/editor-web/assets/deck-C-p17098.js +0 -1
- package/editor-web/assets/dist-B94TkgAP.js +0 -18
- package/editor-web/assets/dist-DxcrMrCR.js +0 -6
- package/editor-web/assets/dist-DzjSp2i2.js +0 -17
- package/editor-web/assets/esm-CNi9O1ya.js +0 -21
- package/editor-web/assets/flowDiagram-IUGLLWBU-CL0AVU4Y.js +0 -1
- package/editor-web/assets/index-BCjGdcPh.js +0 -28
- package/editor-web/assets/index-D9ng69En.css +0 -2
- package/editor-web/assets/snapshots-CuflsO8Q.js +0 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-ChmNuO4G.js +0 -8
- package/editor-web/assets/workbook-C1QR6Cts.js +0 -45
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
const
|
|
2
|
+
import{shownPath as M}from"@allyhub/formats";const x=/^[+\-−–]?[$€£¥]?\s?\d[\d,.\s]*\s?(%|×|x|k|K|M|B|bn|pt|pp)?\*?$/u,A=/^([—–-]|n\/a|N\/A|NA)$/u,w=t=>t.map(n=>n.text).join("").trim();export function numberColumns(t){const n=t.head===void 0||t.head==="both",e=t.head==="column"||t.head==="both",o=n?t.rows.slice(1):t.rows,c=Math.max(0,...t.rows.map(s=>s.length)),i=new Set;for(let s=e?1:0;s<c;s++){const u=o.map(d=>w(d[s]??[]));u.some(d=>x.test(d))&&u.every(d=>d===""||x.test(d)||A.test(d))&&i.add(s)}return i}export function emptyHead(t){const n=t.head===void 0||t.head==="both",e=t.rows[0];return n&&e!==void 0&&t.rows.length>1&&e.every(o=>w(o)==="")}const p={min:6,max:36,room:2},$=.55;export const charsAcross=(t,n)=>t/(n*96/72)/$;const R=t=>Math.max(0,...t.split(/\s+/u).map(n=>Array.from(n).length));export function columnShares(t,n){const e=Math.max(0,...t.rows.map(r=>r.length)),o=r=>t.rows.map(m=>w(m[r]??[])),c=r=>Math.max(0,...o(r).map(m=>Array.from(m).length)),i=Array.from({length:e},(r,m)=>Math.min(p.max,Math.max(p.min,c(m)+p.room)));if(n===void 0)return i;const s=i.map((r,m)=>Math.max(0,...o(m).map(R))+n.margins),u=i.map((r,m)=>Math.max(s[m]??0,Math.min(p.max,Math.max(p.min,c(m)))+n.margins)),d=r=>!t.widths?.[r],l=r=>r.reduce((m,f,g)=>m+(d(g)?f:0),0),a=l(s),h=l(u);if(h<=n.across||h===a)return u;if(a>=n.across)return s;const y=(n.across-a)/(h-a);return u.map((r,m)=>{const f=s[m]??r;return f+(r-f)*y})}export function tableRowsOf(t,n){if(t.data===void 0)return{rows:t.rows,problems:[]};if(n.data===void 0)return{rows:[],problems:[],waiting:!0};const e=n.data(M(t.data)),o=Array.isArray(e)?e:n.data(t.data);if(!Array.isArray(o)||o.length===0)return{rows:[],problems:[o===void 0?`${t.data} is not a data file or a sheet's table of the project`:`${t.data} holds no rows`]};const c=o,i=Object.keys(c[0]??{}),s=t.fields??i,u=s.filter(a=>!i.includes(a));if(u.length>0)return{rows:[],problems:[`${t.data} has no column ${u.join(", ")} (it has ${i.join(", ")})`]};const d=a=>{const h=typeof a=="string"||typeof a=="number"||typeof a=="boolean"?String(a):"";return h===""?[]:[{text:h,styles:{}}]};return{rows:[...t.head!=="none"&&t.head!=="column"?[s.map(a=>d(a))]:[],...c.map(a=>s.map(h=>d(a[h])))],problems:[]}}export function withTableData(t,n){return t.map(e=>e.type==="table"&&e.data!==void 0?{...e,rows:tableRowsOf(e,n).rows}:e.type==="columns"?{...e,columns:e.columns.map(o=>({...o,blocks:withTableData(o.blocks,n)}))}:e)}
|
|
@@ -1,70 +1,70 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{Document as K,visit as Y}from"yaml";import{pageLookYaml as F}from"./page.js";import{BLOCK_TAG as
|
|
3
|
-
${e.styles.background??""}`:void 0;default:return e.styles[n]?"on":void 0}}const
|
|
2
|
+
import{Document as K,visit as Y}from"yaml";import{pageLookYaml as F}from"./page.js";import{BLOCK_TAG as E,CALLOUT_TAG as I,CARD_TAG as R,STAT_TAG as J,STATS_TAG as B,TAG_TAG as N,CHART_TAG as O,PAGE_BREAK_TAG as Q,COLUMN_TAG as U,COLUMNS_TAG as W,COMPONENT_TAG as V,ITEM_TAG as X,TABLE_TAG as C,TOC_TAG as Z,BIBLIOGRAPHY_TAG as b}from"./parse.js";const A=["link","span","tag","underline","bold","italic","strike","code"];function g(e,n){switch(n){case"link":return e.href;case"tag":return e.styles.tag;case"span":return e.styles.color!==void 0||e.styles.background!==void 0?`${e.styles.color??""}
|
|
3
|
+
${e.styles.background??""}`:void 0;default:return e.styles[n]?"on":void 0}}const i=(e,n)=>n===void 0?"":` ${e}="${n.replace(/&/g,"&").replace(/"/g,""")}"`,_=e=>e!==void 0&&/[\p{L}\p{N}]/u.test(e);function G(e,n,r=n){let t="";const s=Array.from(e);return s.forEach((a,d)=>{const u=s[d-1],o=s[d+1];switch(a){case"\\":case"*":case"`":case"[":case"]":case"<":case">":case"{":case"}":case"~":t+=`\\${a}`;break;case"_":t+=_(u)&&_(o)?a:`\\${a}`;break;case"&":t+=/^&(#\d+|#x[0-9a-f]+|[a-z][a-z0-9]*);/i.test(s.slice(d,d+34).join(""))?"&":a;break;case"|":t+=n?"\\|":a;break;case"!":t+=o===void 0?"\\!":a;break;case`
|
|
4
4
|
`:t+=r?"<br />":`\\
|
|
5
|
-
`;break;default:t+=a}}),t}function
|
|
6
|
-
`)||n.inTable&&h.includes("|")?`<code>${G(h,n.inTable,n.oneLine)}</code>`:
|
|
7
|
-
`)&&
|
|
8
|
-
`).map(d=>
|
|
5
|
+
`;break;default:t+=a}}),t}function k(e){const n=Math.max(0,...(e.match(/`+/g)??[]).map(s=>s.length)),r="`".repeat(n+1),t=e.startsWith("`")||e.endsWith("`")||e.startsWith(" ")&&e.endsWith(" ")&&e.trim()!==""?" ":"";return`${r}${t}${e}${t}${r}`}const ee={bold:"**",italic:"*",strike:"~~"},q={underline:"u",bold:"strong",italic:"em",strike:"del",code:"code"};function T(e,n){let r="",t=0,s=!0;for(;t<e.length;){const a=e[t];if(a===void 0)break;if(a.note!==void 0||a.cite!==void 0){r+=a.note===void 0?`[${a.cite??""}]`:`[^${a.note}]`,s=!1,t++;continue}const d=A.find($=>!n.used.has($)&&g(a,$)!==void 0);if(d===void 0){r+=G(a.text,n.inTable,n.oneLine),s=!0,t++;continue}const u=g(a,d);let o=t+1;for(;o<e.length;){const $=e[o];if($===void 0||g($,d)!==u||d==="code"&&A.some(p=>p!=="code"&&!n.used.has(p)&&g($,p)!==void 0))break;o++}const c=e.slice(t,o),f=new Set([...n.used,d]),h=c.map($=>$.text).join(""),j=e[o],D=j===void 0||A.every($=>n.used.has($)||g(j,$)===void 0);if(d==="code")r+=h.includes(`
|
|
6
|
+
`)||n.inTable&&h.includes("|")?`<code>${G(h,n.inTable,n.oneLine)}</code>`:k(h);else if(d==="link"){const $=T(c,{...n,used:f}),p=(u??"").replace(/[\s<>\\]/g,L=>encodeURIComponent(L)),x=ne(p)?p:p.replace(/[()]/g,"\\$&");r+=`[${$}](${x})`}else if(d==="tag"){const $=T(c,{...n,used:f});r+=`<${N}${i("color",u)}>${$}</${N}>`}else if(d==="span"){const $=T(c,{...n,used:f}),p=c[0];r+=`<span${i("color",p?.styles.color)}${i("bg",p?.styles.background)}>${$}</span>`}else{const $=T(c,{...n,used:f}),p=ee[d],x=Array.from(h),L=t===0&&o===e.length,P=n.used.has("bold")||n.used.has("italic")||n.used.has("strike"),M=w=>w!==void 0&&A.every(y=>f.has(y)||g(w,y)===void 0),z=d==="bold"&&c.every(w=>w.styles.italic===!0&&A.every(y=>y==="italic"||f.has(y)||g(w,y)===void 0)),H=p!==void 0&&_(x[0])&&_(x.at(-1))&&!h.includes(`
|
|
7
|
+
`)&&s&&D&&(!P||L&&d==="italic"&&n.used.has("bold"))&&(M(c[0])&&M(c.at(-1))||z);r+=H?`${p}${$}${p}`:`<${q[d]}>${$}</${q[d]}>`}s=!1,t=o}return r}function ne(e){let n=0;for(const r of e)if(r==="(")n+=1;else if(r===")"&&--n<0)return!1;return n===0}function te(e){if(/^[ \t]/.test(e))return`&#x${e.charCodeAt(0).toString(16)};${e.slice(1)}`;if(/^(import|export)(\s|$)/.test(e))return`&#x${e.charCodeAt(0).toString(16)};${e.slice(1)}`;if(/^(#{1,6}(\s|$)|[-+](\s|$)|[=-]+\s*$|[|:\-\s]*-[|:\-\s]*$)/.test(e))return`\\${e}`;const n=/^(\d{1,9})([.)])(\s|$)/.exec(e);return n?.[1]!==void 0?`${n[1]}\\${e.slice(n[1].length)}`:e}function l(e,n=!1,r=n){const t=e.filter(d=>d.text!==""||d.href!==void 0).map((d,u,o)=>{if(d.note===void 0)return d;const c=o.slice(0,u).findLast(f=>f.note===void 0);return c===void 0?d:{...d,styles:{...c.styles},...c.href===void 0?{}:{href:c.href}}}),s=T(t,{inTable:n,oneLine:r,used:new Set}),a=d=>d.replace(/ +$/,"").replace(/^ +/,u=>" ".repeat(u.length));return r?a(s):s.split(`
|
|
8
|
+
`).map(d=>te(a(d))).join(`
|
|
9
9
|
`)}const S=(e,n)=>e.split(`
|
|
10
10
|
`).map((r,t)=>t===0||r===""?r:`${n}${r}`).join(`
|
|
11
|
-
`),m=e=>e.type==="bullet"||e.type==="numbered"||e.type==="check",
|
|
11
|
+
`),m=e=>e.type==="bullet"||e.type==="numbered"||e.type==="check",re=e=>`${i("align",e?.align)}${i("color",e?.color)}${i("bg",e?.background)}`,ie=e=>e!==void 0&&Object.keys(e).length>0;function v(e){return!("content"in e)||e.type==="callout"?!1:ie(e.look)||e.type==="toggle"||e.type==="heading"&&e.toggle?!0:(e.type==="paragraph"||e.type==="heading")&&(e.children?.length??0)>0}function se(e){const n=Math.max(2,...(e.match(/^\s*`{3,}/gm)??[]).map(r=>r.trim().length));return"`".repeat(n+1)}function de(e,n,r){const t=e.type==="numbered"?`${String(n)}${r} `:e.type==="check"?`- [${e.checked?"x":" "}] `:"- ",s=" ".repeat(e.type==="numbered"?t.length:2),a=e.children??[],d=l(e.content)||(e.type==="check"&&(e.children??[]).length===0?"<br />":"");if(a.length===0)return`${t}${S(d,s)}`.trimEnd();const u=d===""?"<br />":d,[o]=a,c=o!==void 0&&m(o)&&l(o.content)!==""&&!(o.type==="numbered"&&(o.start??1)!==1),f=a.every(m)&&d!==""&&c;return`${t}${S(u,s)}${f?`
|
|
12
12
|
`:`
|
|
13
13
|
|
|
14
|
-
`}${
|
|
14
|
+
`}${s}${S(writeBlocks(a),s)}`}function ae(e){switch(e.type){case"paragraph":{const n=l(e.content);return n===""?"<br />":n}case"heading":return`${"#".repeat(e.level)} ${l(e.content,!1,!0).replace(/(^| )(#+)$/,"$1\\$2")}`.trimEnd();case"toggle":return l(e.content)||"<br />";case"quote":{const n=l(e.content);return(e.children?.length?[n===""?"<br />":n,writeBlocks(e.children)]:[n]).join(`
|
|
15
15
|
|
|
16
16
|
`).split(`
|
|
17
17
|
`).map(t=>t===""?">":`> ${t}`).join(`
|
|
18
18
|
`)}case"callout":{const n=l(e.content),r=[n===""?"<br />":n,...e.children?.length?[writeBlocks(e.children)]:[]].join(`
|
|
19
19
|
|
|
20
|
-
`);return`<${
|
|
20
|
+
`);return`<${I}${i("icon",e.icon)}${i("color",e.look?.color)}${i("bg",e.look?.background)}>
|
|
21
21
|
|
|
22
22
|
${r}
|
|
23
23
|
|
|
24
|
-
</${
|
|
24
|
+
</${I}>`}case"card":{const n=e.children?.length?writeBlocks(e.children):"";return`<${R}${i("title",e.title)}${i("subtitle",e.subtitle)}>
|
|
25
25
|
|
|
26
26
|
${n===""?"<br />":n}
|
|
27
27
|
|
|
28
|
-
</${R}>`}case"stats":return[`<${
|
|
28
|
+
</${R}>`}case"stats":return[`<${B}>`,...e.stats.map(n=>`<${J}${i("label",n.label)}${i("value",n.value)}${i("delta",n.delta)}${i("note",n.note)}${n.downIsGood?" down-is-good":""}${i("trend",n.trend?.join(","))} />`),`</${B}>`].join(`
|
|
29
29
|
`);case"code":{const n=se(e.code);return`${n}${e.language??""}
|
|
30
30
|
${e.code}
|
|
31
|
-
${n}`}case"image":{const n=e.src.replace(/[\s()<>\\]/g,t=>encodeURIComponent(t));if(e.width!==void 0||e.align!==void 0||e.id!==void 0)return`<img${
|
|
32
|
-
`),d=e.widths?.some(u=>u!==null)?e.widths.map(u=>u===null?"":String(u)).join(","):void 0;return d===void 0&&e.head===void 0&&e.caption===void 0&&e.id===void 0?a:`<${
|
|
31
|
+
${n}`}case"image":{const n=e.src.replace(/[\s()<>\\]/g,t=>encodeURIComponent(t));if(e.width!==void 0||e.align!==void 0||e.id!==void 0)return`<img${i("src",e.src)}${i("alt",e.alt)}${i("title",e.caption)}${i("width",e.width===void 0?void 0:String(e.width))}${i("align",e.align)}${i("id",e.id)} />`;const r=e.caption===void 0?"":` "${e.caption.replace(/["\\]/g,"\\$&")}"`;return``}case"table":{if(e.data!==void 0){const u=e.widths?.some(o=>o!==null)?e.widths.map(o=>o===null?"":String(o)).join(","):void 0;return`<${C}${i("data",e.data)}${i("fields",e.fields?.join(","))}${i("widths",u)}${i("head",e.head)}${i("caption",e.caption)}${i("id",e.id)} />`}const n=Math.max(1,...e.rows.map(u=>u.length)),r=u=>`| ${Array.from({length:n},(o,c)=>l(u[c]??[],!0)).join(" | ")} |`,[t,...s]=e.rows,a=[r(t??[]),`| ${Array.from({length:n},()=>"---").join(" | ")} |`,...s.map(r)].join(`
|
|
32
|
+
`),d=e.widths?.some(u=>u!==null)?e.widths.map(u=>u===null?"":String(u)).join(","):void 0;return d===void 0&&e.head===void 0&&e.caption===void 0&&e.id===void 0?a:`<${C}${i("widths",d)}${i("head",e.head)}${i("caption",e.caption)}${i("id",e.id)}>
|
|
33
33
|
|
|
34
34
|
${a}
|
|
35
35
|
|
|
36
|
-
</${
|
|
36
|
+
</${C}>`}case"divider":return"---";case"component":{const n=t=>t===void 0?void 0:String(t),r=Object.entries(e.props).map(([t,s])=>i(t,s)).join("");return`<${e.item===!0?X:V}${i("of",e.of)}${i("width",n(e.width))}${i("height",n(e.height))}${i("at",n(e.at))}${r}${i("alt",e.alt)}${i("title",e.caption)}${i("align",e.align)}${i("id",e.id)} />`}case"chart":return oe(e);case"pagebreak":return`<${Q}${i("orientation",e.orientation)} />`;case"bibliography":return`<${b} />`;case"toc":return`<${Z}${i("levels",e.levels===void 0?void 0:String(e.levels))}${i("title",e.title)} />`;case"note":{const n=l(e.content)||"<br />",r=e.children?.length?`
|
|
37
37
|
|
|
38
38
|
${writeBlocks(e.children).split(`
|
|
39
39
|
`).map(t=>t===""?t:` ${t}`).join(`
|
|
40
|
-
`)}`:"";return`[^${e.label}]: ${S(n," ")}${r}`}case"columns":return[`<${
|
|
40
|
+
`)}`:"";return`[^${e.label}]: ${S(n," ")}${r}`}case"columns":return[`<${W}>`,...e.columns.map(n=>{const r=writeBlocks(n.blocks);return`<${U}${i("width",n.width===void 0?void 0:String(n.width))}>
|
|
41
41
|
|
|
42
42
|
${r===""?"<br />":r}
|
|
43
43
|
|
|
44
|
-
</${
|
|
44
|
+
</${U}>`}),`</${W}>`].join(`
|
|
45
45
|
|
|
46
|
-
`);case"embed":case"source":return e.source}}function
|
|
47
|
-
`);return`<${O}${
|
|
46
|
+
`);case"embed":case"source":return e.source}}function oe(e){const n=f=>f===void 0?void 0:String(f),r=f=>f===void 0?void 0:f.join(","),t=e.labels?.length===1&&e.labels[0]==="value"?" labels":i("labels",r(e.labels)),s=[i("type",e.kind),i("title",e.title),i("data",e.data),i("categories",e.categories),i("series",r(e.series)),i("legend",e.legend),t,i("format",e.format),i("min",n(e.min)),i("max",n(e.max)),i("colors",r(e.colors)),e.smooth?" smooth":"",i("width",n(e.width)),i("height",n(e.height)),i("alt",e.alt),i("id",e.id)].join("");if(e.table===void 0)return`<${O}${s} />`;const a=Math.max(1,...e.table.map(f=>f.length)),d=f=>`| ${Array.from({length:a},(h,j)=>G(f[j]??"",!0)).join(" | ")} |`,[u,...o]=e.table,c=[d(u??[]),`| ${Array.from({length:a},()=>"---").join(" | ")} |`,...o.map(d)].join(`
|
|
47
|
+
`);return`<${O}${s}>
|
|
48
48
|
|
|
49
|
-
${
|
|
49
|
+
${c}
|
|
50
50
|
|
|
51
|
-
</${O}>`}export function frontMatterOf(e){const n=F(e);if(Object.keys(n).length===0)return"";const r=new K(n);return Y(r,{Seq:(t,
|
|
51
|
+
</${O}>`}export function frontMatterOf(e){const n=F(e);if(Object.keys(n).length===0)return"";const r=new K(n);return Y(r,{Seq:(t,s)=>{s.flow=!0},Map:(t,s,a)=>{a.length>1&&(s.flow=!0)}}),r.toString({lineWidth:0}).trimEnd()}export function withPage(e,n){const r=frontMatterOf(n),t=r===""?"":`---
|
|
52
52
|
${r}
|
|
53
|
-
---`,
|
|
53
|
+
---`,s=e.frontMatter;if(s===void 0){if(t==="")return e.source;const d=e.source.replace(/^\s+/u,"");return d===""?`${t}
|
|
54
54
|
`:`${t}
|
|
55
55
|
|
|
56
|
-
${d}`}const a=e.source.slice(
|
|
56
|
+
${d}`}const a=e.source.slice(s.end).replace(/^\s+/u,"");return t===""?a:a===""?`${t}
|
|
57
57
|
`:`${t}
|
|
58
58
|
|
|
59
|
-
${a}`}function
|
|
59
|
+
${a}`}function ue(e){const n=e.type==="toggle"||e.type==="heading"&&e.toggle,{children:r}=e,t={...e};delete t.look,delete t.children;const s=t.type==="toggle"?{type:"paragraph",content:t.content}:t.type==="heading"?{type:"heading",level:t.level,content:t.content}:t,a=m(s)||s.type==="quote",d=writeBlocks(a?[{...s,...r?{children:r}:{}}]:[s,...r??[]]);return`<${E}${re(e.look)}${n?" toggle":""}>
|
|
60
60
|
|
|
61
61
|
${d}
|
|
62
62
|
|
|
63
|
-
</${
|
|
63
|
+
</${E}>`}export function continuesList(e,n){return m(e)&&m(n)&&!v(e)&&!v(n)&&e.type==="numbered"==(n.type==="numbered")&&!(n.type==="numbered"&&n.start!==void 0)}export function writeBlocks(e){const n=[];let r=0,t;for(;r<e.length;){const s=e[r];if(s===void 0)break;if(v(s)){n.push(ue(s)),t=void 0,r++;continue}if(!m(s)){n.push(r===0&&s.type==="divider"?"***":ae(s)),t=void 0,r++;continue}const a=s.type==="numbered",d=s.type==="numbered"?s.start??1:1,u=a&&t==="."?")":".",o=[];let c=r;for(;c<e.length;){const h=e[c];if(h===void 0||!m(h)||v(h)||h.type==="numbered"!==a||c>r&&!continuesList(s,h))break;o.push(de(h,d+(c-r),u)),c++}const f=o.some(h=>h.includes(`
|
|
64
64
|
|
|
65
|
-
`));n.push(
|
|
65
|
+
`));n.push(o.join(f?`
|
|
66
66
|
|
|
67
67
|
`:`
|
|
68
|
-
`)),t=a?u:void 0,r=
|
|
68
|
+
`)),t=a?u:void 0,r=c}return n.join(`
|
|
69
69
|
|
|
70
70
|
`)}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{readFile as
|
|
3
|
-
`&&
|
|
2
|
+
import{readFile as O}from"node:fs/promises";import{join as C,posix as h}from"node:path";import{problem as l}from"@allyhub/diagnostics";import{parseComponentRef as q,readPropsText as x,stageName as B,splitReference as _}from"@allyhub/build";import{DRAWN_CODE as G,citedKeys as H,docChart as X,everyBlock as E,readSources as Q,mathHtml as V,parseDoc as N,shownBlocks as Y,splitTitle as Z,tableRowsOf as ee,titleText as oe}from"@allyhub/doc";import{USE_FORMS as z,shownPath as te}from"@allyhub/formats";const F=180,ne=/^([a-z][a-z0-9+.-]*:|\/\/)/iu;function se(a){for(const t of a){if(t.type!=="paragraph")continue;const n=t.content.map(f=>f.text).join("").replace(/\s+/gu," ").trim();if(n!=="")return n.length>F?`${n.slice(0,F-1)}…`:n}}function*L(a){let t=0,n=1;for(const f of a.segments){for(;t<f.start;t++)a.source[t]===`
|
|
3
|
+
`&&n++;for(const u of f.blocks)for(const s of E([u]))yield{block:s,line:n}}}function T(a){const t=new Map;return(n,f,u)=>{const s=`${n}#${f}`;let o=t.get(s);return o||(o=(async()=>{if(!a)return{};const p=await a.request({type:"component",file:n,name:f});if(u.push(...p.problems),!p.ok)return{not:p.error??`${n} could not be read`};const m=p.value;return m.not===void 0?{props:m.props??{}}:{not:m.not}})(),t.set(s,o)),o}}async function I(a,t,n,f,u){const s=[],o=t.entry,p=N(await O(C(a,o),"utf8"));for(const e of p.problems)s.push(l("AK-M008",`${o}: ${e.message}.`,{where:{file:o,...e.line===void 0?{}:{line:e.line}}}));const m=Z(Y(p.blocks)),j=oe(m.title).trim()||void 0,y=se(m.body),w=new Set,P=[...p.page.cover===void 0?[]:[p.page.cover],...[...E(p.blocks)].flatMap(e=>e.type==="image"?[e.src]:[])];for(const e of P){if(ne.test(e))continue;const i=h.normalize(h.join(t.dir,decodeURIComponent(e)));w.add(i),n.has(i)||s.push(l("AK-M008",`${o} shows the picture ${e}, which is not in the project (${i}).`,{where:{file:o}}))}const S=new Map,D=new Set,K=[];for(const{block:e,line:i}of L(p)){if(e.type!=="component")continue;const c={where:{file:o,line:i}};if(e.item===!0){const{path:A,part:R}=_(e.of);D.has(e.of)||S.set(e.of,{of:e.of,module:h.normalize(h.join(t.dir,A)),name:R??"",item:!0}),D.add(e.of),K.push({of:e.of,from:o,line:i,types:[z.live],role:"item"});continue}const $=q(e.of);if(!$){s.push(l("AK-M008",`${o}: of="${e.of}" names no component: write the module's path from the doc's folder and its export (../../components/ui.ts#Dialog).`,c));continue}const r=h.normalize(h.join(t.dir,$.path));if(!n.has(r)){s.push(l("AK-M008",`${o} shows the component ${e.of}, whose module is not in the project (${r}).`,c));continue}const d=await f(r,$.name,s);if(d.not!==void 0){s.push(l("AK-M008",`${o}: ${d.not}.`,c));continue}if(d.props)for(const A of x({name:$.name,props:d.props},e.props).problems)s.push(l("AK-M008",`${o}: ${A}.`,c));S.set(e.of,{of:e.of,module:r,name:$.name,...d.props?{props:d.props}:{}})}const b={};for(const{block:e,line:i}of L(p)){const c={where:{file:o,line:i}};if(e.type==="code"&&e.language===G.math){const{error:r}=V(e.code);r!==void 0&&s.push(l("AK-M008",`${o}: an equation: ${r}.`,c));continue}if(e.type==="table"&&e.data!==void 0){const r=h.normalize(h.join(t.dir,e.data)),d=u[r];if(d?.value===void 0){s.push(l("AK-M008",d===void 0?`${o}: a table reads ${e.data}, which is not a data file or a sheet's table of the project (${r}).`:`${o}: a table reads ${e.data}, which cannot be read: ${d.error??"it holds nothing"}.`,c));continue}b[e.data]=d.value,d.shown!==void 0&&(b[te(e.data)]=d.shown),n.has(r)&&w.add(r);for(const A of ee(e,{data:R=>b[R]}).problems)s.push(l("AK-M008",`${o}: a table: ${A}.`,c));e.data.includes("#")&&K.push({of:e.data,from:o,line:i,types:[z.data],role:"data"});continue}if(e.type!=="chart")continue;if(e.data!==void 0){const r=h.normalize(h.join(t.dir,e.data)),d=u[r];if(d===void 0){s.push(l("AK-M008",`${o}: a chart reads ${e.data}, which is not a data file or a sheet's table of the project (${r}).`,c));continue}if(d.error!==void 0){s.push(l("AK-M008",`${o}: a chart reads ${e.data}, which cannot be read: ${d.error}.`,c));continue}b[e.data]=d.value,n.has(r)&&w.add(r),e.data.includes("#")&&K.push({of:e.data,from:o,line:i,types:[z.data],role:"data"})}const $=X(e,{base:t.dir,data:r=>b[r]});for(const r of $.problems)s.push(l("AK-M008",`${o}: the chart${e.title===void 0?"":` "${e.title}"`}: ${r}.`,c))}let M,k;const g=p.page.bibliography,v=H(p.blocks);if(g!==void 0){const e=h.normalize(h.join(t.dir,decodeURIComponent(g)));if(k=e,!n.has(e))s.push(l("AK-M008",`${o}: its bibliography ${g} is not in the project (${e}).`,{where:{file:o}}));else{w.add(e);try{const i=JSON.parse(await O(C(a,e),"utf8"));if(!Array.isArray(i))throw new Error("not a list of sources");M=Q(i)}catch(i){s.push(l("AK-M008",`${o}: its bibliography ${g} is not CSL-JSON (a list of sources, each with an id): ${i instanceof Error?i.message:String(i)}.`,{where:{file:o}}))}}}if(v.length>0){const e=new Set((M??[]).map(c=>c.id)),i=v.filter(c=>!e.has(c));g===void 0?s.push(l("AK-M008",`${o} cites ${v.map(c=>`@${c}`).join(", ")}: name its sources' CSL-JSON file in its front matter (bibliography: ./references.json).`,{where:{file:o}})):M!==void 0&&i.length>0&&s.push(l("AK-M008",`${o} cites ${i.map(c=>`@${c}`).join(", ")}, which ${g} does not hold.`,{where:{file:o}}))}const U={dir:t.dir,place:t.id,file:o,...j?{title:j}:{},...y?{glimpse:y}:{},shows:[...w],components:[...S.values()],data:b,...M===void 0?{}:{sources:M}},W=[...[...w].map(e=>({path:e,role:"shows"})),...k===void 0?[]:[{path:k,role:"sources"}]];return{doc:U,problems:s,files:W,uses:K}}export async function readDocs(a,t,n,f,u={}){const s=new Set(n),o=T(f),p=[],m=[];for(const j of t){const y=await I(a,j,s,o,u);p.push(y.doc),m.push(...y.problems)}return{docs:p,problems:m}}const J=new WeakMap,re={async read(a,t){let n=J.get(t.meta);n||(n={known:new Set(t.files),reads:T(t.meta)},J.set(t.meta,n));const{doc:f,problems:u,files:s,uses:o}=await I(t.root,a,n.known,n.reads,t.data);return{doc:f,problems:u,files:s,...o.length>0?{uses:o}:{},...f.components.length>0?{stage:{name:B(f.place),of:f.file,components:f.components}}:{}}},unreadable(a){const t=N(a),n=t.blocks.length===0?t.problems[0]:void 0;return n&&a.trim()!==""?[`not MDX${n.line===void 0?"":` (line ${String(n.line)})`}: ${n.message}`]:[]},render:async(a,t)=>(await import("./export.js")).renderDocFiles(a,t)};export default re;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{CACHE_DIR as Se}from"@allyhub/formats";import{mkdir as Ie,stat as je,writeFile as Ae}from"node:fs/promises";import{cpus as Le}from"node:os";import{dirname as Pe,isAbsolute as Ce,join as C,relative as ae,sep as Ne}from"node:path";import{itemKindBuild as Y,usesInOrder as Fe}from"@allyhub/build";import{FILE_TYPES as ce,comboKey as de,exportProblem as Oe,pieceIs as Re,pieceNamed as le,versionLabel as q}from"@allyhub/piece";import{runCheck as Ee}from"@allyhub/check";import{ConsolePool as Te,mergeConsole as _e,dedupe as fe,indexNeeds as De,makeIndex as Ke,CheckSession as We,OpenedVersion as ze,keyedStills as Be,ProjectError as A}from"@allyhub/project";import{batchCsv as He,batchRows as Ve}from"./batch.js";import{processFile as Ye}from"./processors.js";import{batchName as qe,checkName as Ge,exportName as pe,exportNames as Je}from"./names.js";export const exportsAtOnce=e=>Math.max(1,Math.min(e,Math.floor(Le().length/4)));const G=(e,r)=>`${String(e)} ${r}${e===1?"":"s"}`,J=(e,r)=>Re({id:e.id,path:e.entry},r);function Qe(e,r){if(e===void 0)return;const o=new Set([...Object.keys(ce),...r.flatMap(c=>c.renders?.types??[])]);for(const c of e)if(!o.has(c))throw new A("bad-type",`Cannot render ${c}.`,"usage",`Types: ${[...o].join(", ")}.`);return[...e]}const Ue=e=>({...e.steps===!0?{steps:!0}:{},...e.pptx==="picture"?{pptx:"picture"}:{}});function me(e,r){return[...e.docs.filter(o=>o.place===r.id).map(o=>o.file),...e.sheets.filter(o=>o.place===r.id).flatMap(o=>o.files)]}async function Q(e,r,o,c){const{files:m,type:$,...v}=r,{piece:I,...l}=o,y=m[0]??e,E=(await Promise.all(m.map(N=>je(N)))).reduce((N,F)=>N+F.size,0);return{files:[...m],...v,name:we(ae(e,y)),path:y,piece:I,type:$,...l,bytes:E,seconds:Math.round((performance.now()-c)/10)/100}}const ue=e=>"failure"in e;export function exportProject(e){return ge(e,new Map)}export const MADE_DIR=`${Se}/made`;const D=(e,r)=>`${e}\0${r}`;function he(e,r){return o=>{const c=e?.uses?.find($=>$.of===o);if(!c)return;const m=r.get(D(c.item,c.type))?.[0];if(m)return c.part===void 0?m.path:m.partFiles?.[c.part]}}async function ge(e,r){const o=Qe(e.types,e.kinds);e.name!==void 0&&Ge(e.name);const c=e.params??{},m=Ue(c),$=e.items??[],v=$.length>0,I=x=>$.some(S=>J(x,S)),l=[],y=[],E=[],N={root:e.root,out:e.out,params:c,...e.log===void 0?{}:{log:e.log},...e.signal===void 0?{}:{signal:e.signal}},F=async x=>{l.push(await Ye(x,e.processors??[],N))},K=()=>We.open({root:e.root,kinds:e.kinds,...e.gpu===void 0?{}:{gpu:e.gpu},...e.consoleLimit===void 0?{}:{consoleLimit:e.consoleLimit}});let p=await K(),W=!0;const U={componentStills:(x,S,d)=>Be(S,{prepared:p.prepared,item:x,combo:d,gpu:p.gpu,withSession:L=>L(p)})},X=new Set,Z=async(x,S,d)=>{X.has(x)||(X.add(x),await S?.ready?.(d,c))};try{const x=p.prepared.items.filter(n=>!v||I(n)),S=Fe(p.prepared.items,x).filter(n=>!r.has(D(n.item.id,n.type)));if(S.length>0){const n=p.prepared.pieces;W=!1,await p.close();for(const t of S){e.signal?.throwIfAborted();const g=n.find(a=>a.place===t.item.id)?.combos[0];e.log?.(`Making ${t.item.id} as ${t.type} first, which another item uses…`);try{const a=await ge({root:e.root,kinds:e.kinds,items:[t.item.id],types:[t.type],out:C(e.root,MADE_DIR),...g===void 0?{}:{combos:[g]},...e.gpu===void 0?{}:{gpu:e.gpu},...e.consoleLimit===void 0?{}:{consoleLimit:e.consoleLimit},...e.index===void 0?{}:{index:e.index},...e.analyses===void 0?{}:{analyses:e.analyses},...e.log===void 0?{}:{log:e.log},...e.signal===void 0?{}:{signal:e.signal}},r);r.set(D(t.item.id,t.type),a.files.filter(u=>u.type===t.type)),y.push(...a.failed)}catch(a){if(e.signal?.aborted===!0)throw a;r.set(D(t.item.id,t.type),[]),y.push({name:t.item.id,piece:t.item.id,type:t.type,code:a instanceof A?a.code:"failed",message:`${t.item.id}, which another item uses, could not be made: ${a.message}`})}}p=await K(),W=!0}const d=p.prepared,L=n=>d.kinds.find(t=>t.id===n)?.renders,O=[];for(const n of d.items){const t=await Y(d.kinds,n);t?.render&&t.onStage!==!0&&O.push({item:n,build:t})}const j=$.filter(n=>!O.some(t=>J(t.item,n)));for(const n of j)if(!d.pieces.some(t=>le({id:t.id,path:t.place},n))){const t=d.items.find(a=>J(a,n)),g=t&&d.problems.filter(a=>a.level==="error"&&(a.piece===t.id||a.where?.file===t.entry||(a.where?.file?.startsWith(`${t.dir}/`)??!1)));throw t&&g&&g.length>0?new A("item-failed",`${t.id} could not be made: ${g.map(a=>a.message).join(" ")}`,"failed","allyhub check lists every problem."):new A("no-item",`No item ${n}.`,"not-found",`Items: ${[...d.pieces.map(a=>a.id),...O.map(a=>a.item.id)].join(", ")||"none"}.`)}const ee=v&&j.length===0,ye=new Set(d.pieces.flatMap(n=>L(n.kind)?.types??[])),te=o?.filter(n=>n in ce||ye.has(n)),be=ee?[]:d.pieces.filter(n=>j.length===0||j.some(t=>le({id:n.id,path:n.place},t))),z=o?.includes("csv")===!0?be.filter(n=>n.matrix!==void 0):[];if(o?.includes("csv")===!0&&j.length>0&&z.length===0)throw new A("bad-type",`${j.join(", ")} has no slots (matrix.slots), so there is no table of ads to write as csv.`,"usage","csv is a batch's table of ads, or a sheet's rows.");let T=[...d.problems];const B=new Te(p.consoleLimit),ke=new Set(O.flatMap(n=>me(d,n.item))),$e=n=>n.where?.file!==void 0&&ke.has(n.where.file),ne=n=>n.filter(t=>t.level==="error"&&!$e(t)).length;if(!ee&&(te?.length!==0||z.length>0)&&(d.pieces.length>0||ne(d.problems)>0)){e.log?.("Checking…");const n=()=>Ze(p,e.root,j,e.combos);let t=await n();const g=e.index===!1?[]:De(t.results);if(g.length>0){const s=await Ke(d.root,g,e.analyses??[],{env:e.env??process.env,onProgress:et(e.log),signal:e.signal});E.push(...s.failed.map(i=>({file:i.need.file,error:i.error}))),s.done.length>0&&(await p.close(),p=await K(),t=await n())}T=t.problems,B.addReport(t.console);const a=ne(t.problems);if(a>0)throw new A("check-failed",`The check found ${G(a,"must-fix problem")}, so nothing is rendered.`,"failed","allyhub check lists them; fix them, then render.");for(const s of z){const i=performance.now(),b=qe(s.id),M=Ve(s,t.wholes,p.prepared.media,Xe(e.root,e.out),e.name);await Ie(Pe(C(e.out,b)),{recursive:!0}),await Ae(C(e.out,b),He(M));const P=t.targets.filter(h=>h.piece===s.id).length;M.length<P&&e.log?.(`${b}: ${G(P-M.length,"ad")} not listed, which did not load (allyhub check says why).`),await F(await Q(e.out,{type:"csv",files:[C(e.out,b)]},{piece:s.id},i))}const u=[],R=new Set;for(const s of t.targets){const i=p.prepared.pieces.find(k=>k.id===s.piece);if(!i)continue;if(!v&&i.options.deliverable===!1){R.add(s.piece);continue}const b=L(i.kind),M={kind:i.kind,types:b?.types??[]},P=t.wholes.find(k=>k.piece===s.piece&&de(k.combo)===s.key&&k.format===s.format)?.speaks??!1,h={piece:s.piece,output:s.output,combo:s.combo,format:s.format,...s.id===void 0?{}:{id:s.id}};for(const k of te??b?.defaults??[]){const f=Oe({...M,speech:P},k);if(!(f?.code==="bad_type"&&!v)){if(f&&f.code!=="no_speech")throw new A("bad-type",`${q(h)}: ${f.message}`,"usage",f.hint);u.push({target:h,kind:i.kind,type:k,...f?{refused:{name:pe(h,k,m),piece:h.piece,type:k,code:"no-speech",message:`${q(h)}: ${f.message}`,...f.hint?{hint:f.hint}:{}}}:{}})}}}R.size>0&&e.log?.(`Not rendered, shown only inside another video (deliverable: false): ${[...R].join(", ")}. Name one to render it.`);for(const s of new Set(u.map(i=>i.kind)))await Z(s,await Y(d.kinds,{kind:s}),u.filter(i=>i.kind===s).map(i=>i.type));const _=Je(u,e.name,m);u.forEach((s,i)=>{s.refused&&(s.refused.name=_[i]??s.refused.name)});const w=[],H=new Array(u.length).fill(0),V=(s,i)=>{H[s]=Math.max(H[s]??0,i),e.onProgress?.(H.reduce((b,M)=>b+M,0)/u.length)};let se=0,ve=0;const Me=async()=>{for(let s=se++;s<u.length;s=se++){e.signal?.throwIfAborted();const i=u[s];if(!i)continue;const b=_[s]??pe(i.target,i.type,m);if(i.refused){y.push(i.refused),V(s,1);continue}const M=await Y(d.kinds,{kind:i.kind}),P=performance.now(),h=await ze.open({root:e.root,session:p,item:i.target.piece,combos:[i.target.combo],purpose:"render"});try{const k=await M?.render?.(d.items.find(f=>f.id===h.piece.place)??{id:h.piece.place,kind:i.kind,dir:h.piece.dir,entry:h.piece.file,groups:[]},{root:e.root,prepared:p.prepared,types:[i.type],out:()=>C(e.out,b),params:c,version:h,session:U,made:he(d.items.find(f=>f.id===h.piece.place),r),onProgress:f=>{V(s,f)},...e.log===void 0?{}:{log:e.log},...e.signal===void 0?{}:{signal:e.signal}})??[{type:i.type,failure:{code:"no-render",message:`${q(i.target)}: its kind (${i.kind}) makes no files.`}}];for(const f of k){if(ue(f)){y.push({name:b,piece:i.target.piece,type:i.type,code:f.failure.code,message:f.failure.message,...f.failure.hint?{hint:f.failure.hint}:{}});continue}const re=await Q(e.out,f,{piece:i.target.piece,combo:i.target.combo,key:de(i.target.combo),format:i.target.format},P);await F(re),e.log?.(`[${String(++ve)}/${String(u.length)}] ${b} (${re.seconds.toFixed(1)} s)`)}}finally{w.push(...await h.problems()),B.add(i.target,await h.console()),await h.close(),V(s,1)}}};u.length>0&&e.log?.(`Rendering ${G(u.length,"file")}…`);const oe=(await Promise.allSettled(Array.from({length:exportsAtOnce(u.length)},Me))).find(s=>s.status==="rejected");if(oe)throw oe.reason;T=fe([...T,...w])}const xe=n=>d.problems.find(t=>t.level==="error"&&t.where?.file!==void 0&&n.includes(t.where.file)),ie=[];for(const n of O.filter(t=>!v||I(t.item))){const t=xe(me(d,n.item)),g=L(n.item.kind);t?y.push({name:n.item.id,piece:n.item.id,type:g?.defaults[0]??g?.types[0]??"",code:"check-failed",message:`${t.where?.file??n.item.entry}: ${t.message}`,hint:"Fix it, then render again."}):ie.push(n)}e.signal?.throwIfAborted();for(const{item:n,build:t}of ie){const g=L(n.kind),a=o===void 0?g?.defaults??[]:o.filter(w=>g?.types.includes(w)===!0);if(a.length===0)continue;await Z(n.kind,t,a);const u=performance.now(),R=n.id,_=await t.render?.(n,{root:e.root,prepared:p.prepared,types:a,out:w=>C(e.out,`${R}.${w}`),params:c,session:U,made:he(n,r),...e.log===void 0?{}:{log:e.log},...e.signal===void 0?{}:{signal:e.signal}})??[];for(const w of _)ue(w)?y.push({name:n.id,piece:n.id,type:w.type,code:w.failure.code,message:w.failure.message,...w.failure.hint?{hint:w.failure.hint}:{}}):await F(await Q(e.out,w,{piece:n.id},u))}return{out:e.out,files:l,failed:y,problems:T,console:B.report(),unindexed:E}}finally{W&&await p.close()}}const we=e=>e.split(Ne).join("/");function Xe(e,r){const o=ae(e,r);return o===""?".":o.startsWith("..")||Ce(o)?r:we(o)}async function Ze(e,r,o,c){const m=[];for(const l of o.length>0?o:[void 0])m.push(await Ee({dir:r,session:e,facts:!1,...l===void 0?{}:{piece:l},...c?{combos:[...c]}:{}}));const $=new Set,v=m.flatMap(l=>l.targets).filter(l=>{const y=`${l.piece}\0${l.key}\0${l.format}`;return $.has(y)?!1:($.add(y),!0)}),I=fe(m.flatMap(l=>l.problems));return{targets:v,results:m.flatMap(l=>l.results),wholes:m.flatMap(l=>l.wholes),problems:I,errors:I.filter(l=>l.level==="error").length,console:_e(e.consoleLimit,...m.map(l=>l.console))}}function et(e){let r="";return o=>{const c=o.status==="failed"?`Could not index ${o.file}: ${o.message}`:o.message;o.status==="running"&&o.share!==void 0||c!==r&&(r=c,e?.(c))}}
|
|
2
|
+
import{CACHE_DIR as Ie}from"@allyhub/formats";import{mkdir as je,stat as Le,writeFile as Pe}from"node:fs/promises";import{cpus as Ce}from"node:os";import{dirname as Ne,isAbsolute as Fe,join as C,relative as de,sep as Oe}from"node:path";import{itemKindBuild as q,madeType as ce,usesInOrder as Re}from"@allyhub/build";import{FILE_TYPES as le,comboKey as fe,exportProblem as Ee,pieceIs as Te,pieceNamed as pe,versionLabel as G}from"@allyhub/piece";import{runCheck as _e}from"@allyhub/check";import{ConsolePool as De,mergeConsole as Ke,dedupe as ue,indexNeeds as We,makeIndex as ze,CheckSession as Be,OpenedVersion as He,keyedStills as Ve,ProjectError as j}from"@allyhub/project";import{batchCsv as Ye,batchRows as qe}from"./batch.js";import{processFile as Ge}from"./processors.js";import{batchName as Je,checkName as Qe,exportName as me,exportNames as Ue}from"./names.js";export const exportsAtOnce=e=>Math.max(1,Math.min(e,Math.floor(Ce().length/4)));const J=(e,r)=>`${String(e)} ${r}${e===1?"":"s"}`,Q=(e,r)=>Te({id:e.id,path:e.entry},r);function Xe(e,r){if(e===void 0)return;const o=new Set([...Object.keys(le),...r.flatMap(d=>d.renders?.types??[])]);for(const d of e)if(!o.has(d))throw new j("bad-type",`Cannot render ${d}.`,"usage",`Types: ${[...o].join(", ")}.`);return[...e]}const Ze=e=>({...e.steps===!0?{steps:!0}:{},...e.pptx==="picture"?{pptx:"picture"}:{}});function he(e,r){return[...e.docs.filter(o=>o.place===r.id).map(o=>o.file),...e.sheets.filter(o=>o.place===r.id).flatMap(o=>o.files)]}async function U(e,r,o,d){const{files:m,type:b,...$}=r,{piece:S,...c}=o,y=m[0]??e,E=(await Promise.all(m.map(N=>Le(N)))).reduce((N,F)=>N+F.size,0);return{files:[...m],...$,name:ke(de(e,y)),path:y,piece:S,type:b,...c,bytes:E,seconds:Math.round((performance.now()-d)/10)/100}}const ge=e=>"failure"in e;export function exportProject(e){return ye(e,new Map)}export const MADE_DIR=`${Ie}/made`;const K=(e,r)=>`${e}\0${r}`;function we(e,r){return o=>{const d=e?.uses?.find($=>$.of===o&&ce($)!==void 0),m=d===void 0?void 0:ce(d);if(!d||m===void 0)return;const b=r.get(K(d.item,m))?.[0];if(b)return d.part===void 0?b.path:b.partFiles?.[d.part]}}async function ye(e,r){const o=Xe(e.types,e.kinds);e.name!==void 0&&Qe(e.name);const d=e.params??{},m=Ze(d),b=e.items??[],$=b.length>0,S=v=>b.some(A=>Q(v,A)),c=[],y=[],E=[],N={root:e.root,out:e.out,params:d,...e.log===void 0?{}:{log:e.log},...e.signal===void 0?{}:{signal:e.signal}},F=async v=>{c.push(await Ge(v,e.processors??[],N))},W=()=>Be.open({root:e.root,kinds:e.kinds,...e.gpu===void 0?{}:{gpu:e.gpu},...e.consoleLimit===void 0?{}:{consoleLimit:e.consoleLimit}});let p=await W(),z=!0;const X={componentStills:(v,A,L)=>Ve(A,{prepared:p.prepared,item:v,combo:L,gpu:p.gpu,withSession:l=>l(p)})},Z=new Set,ee=async(v,A,L)=>{Z.has(v)||(Z.add(v),await A?.ready?.(L,d))};try{const v=p.prepared.items.filter(n=>!$||S(n)),A=n=>{const t=p.prepared.kinds.find(u=>u.id===n.kind)?.renders;return o===void 0?t?.defaults??[]:o.filter(u=>t?.types.includes(u)===!0)},L=Re(p.prepared.items,v,A).filter(n=>!r.has(K(n.item.id,n.type)));if(L.length>0){const n=p.prepared.pieces;z=!1,await p.close();for(const t of L){e.signal?.throwIfAborted();const u=n.find(a=>a.place===t.item.id)?.combos[0];e.log?.(`Making ${t.item.id} as ${t.type} first, which another item uses…`);try{const a=await ye({root:e.root,kinds:e.kinds,items:[t.item.id],types:[t.type],out:C(e.root,MADE_DIR),...u===void 0?{}:{combos:[u]},...e.gpu===void 0?{}:{gpu:e.gpu},...e.consoleLimit===void 0?{}:{consoleLimit:e.consoleLimit},...e.index===void 0?{}:{index:e.index},...e.analyses===void 0?{}:{analyses:e.analyses},...e.log===void 0?{}:{log:e.log},...e.signal===void 0?{}:{signal:e.signal}},r);r.set(K(t.item.id,t.type),a.files.filter(h=>h.type===t.type)),y.push(...a.failed)}catch(a){if(e.signal?.aborted===!0)throw a;r.set(K(t.item.id,t.type),[]),y.push({name:t.item.id,piece:t.item.id,type:t.type,code:a instanceof j?a.code:"failed",message:`${t.item.id}, which another item uses, could not be made: ${a.message}`})}}p=await W(),z=!0}const l=p.prepared,T=n=>l.kinds.find(t=>t.id===n)?.renders,O=[];for(const n of l.items){const t=await q(l.kinds,n);t?.render&&t.onStage!==!0&&O.push({item:n,build:t})}const I=b.filter(n=>!O.some(t=>Q(t.item,n)));for(const n of I)if(!l.pieces.some(t=>pe({id:t.id,path:t.place},n))){const t=l.items.find(a=>Q(a,n)),u=t&&l.problems.filter(a=>a.level==="error"&&(a.piece===t.id||a.where?.file===t.entry||(a.where?.file?.startsWith(`${t.dir}/`)??!1)));throw t&&u&&u.length>0?new j("item-failed",`${t.id} could not be made: ${u.map(a=>a.message).join(" ")}`,"failed","allyhub check lists every problem."):new j("no-item",`No item ${n}.`,"not-found",`Items: ${[...l.pieces.map(a=>a.id),...O.map(a=>a.item.id)].join(", ")||"none"}.`)}const te=$&&I.length===0,be=new Set(l.pieces.flatMap(n=>T(n.kind)?.types??[])),ne=o?.filter(n=>n in le||be.has(n)),$e=te?[]:l.pieces.filter(n=>I.length===0||I.some(t=>pe({id:n.id,path:n.place},t))),B=o?.includes("csv")===!0?$e.filter(n=>n.matrix!==void 0):[];if(o?.includes("csv")===!0&&I.length>0&&B.length===0)throw new j("bad-type",`${I.join(", ")} has no slots (matrix.slots), so there is no table of ads to write as csv.`,"usage","csv is a batch's table of ads, or a sheet's rows.");let _=[...l.problems];const H=new De(p.consoleLimit),xe=new Set(O.flatMap(n=>he(l,n.item))),ve=n=>n.where?.file!==void 0&&xe.has(n.where.file),ie=n=>n.filter(t=>t.level==="error"&&!ve(t)).length;if(!te&&(ne?.length!==0||B.length>0)&&(l.pieces.length>0||ie(l.problems)>0)){e.log?.("Checking…");const n=()=>tt(p,e.root,I,e.combos);let t=await n();const u=e.index===!1?[]:We(t.results);if(u.length>0){const s=await ze(l.root,u,e.analyses??[],{env:e.env??process.env,onProgress:nt(e.log),signal:e.signal});E.push(...s.failed.map(i=>({file:i.need.file,error:i.error}))),s.done.length>0&&(await p.close(),p=await W(),t=await n())}_=t.problems,H.addReport(t.console);const a=ie(t.problems);if(a>0)throw new j("check-failed",`The check found ${J(a,"must-fix problem")}, so nothing is rendered.`,"failed","allyhub check lists them; fix them, then render.");for(const s of B){const i=performance.now(),k=Je(s.id),M=qe(s,t.wholes,p.prepared.media,et(e.root,e.out),e.name);await je(Ne(C(e.out,k)),{recursive:!0}),await Pe(C(e.out,k),Ye(M));const P=t.targets.filter(g=>g.piece===s.id).length;M.length<P&&e.log?.(`${k}: ${J(P-M.length,"ad")} not listed, which did not load (allyhub check says why).`),await F(await U(e.out,{type:"csv",files:[C(e.out,k)]},{piece:s.id},i))}const h=[],R=new Set;for(const s of t.targets){const i=p.prepared.pieces.find(x=>x.id===s.piece);if(!i)continue;if(!$&&i.options.deliverable===!1){R.add(s.piece);continue}const k=T(i.kind),M={kind:i.kind,types:k?.types??[]},P=t.wholes.find(x=>x.piece===s.piece&&fe(x.combo)===s.key&&x.format===s.format)?.speaks??!1,g={piece:s.piece,output:s.output,combo:s.combo,format:s.format,...s.id===void 0?{}:{id:s.id}};for(const x of ne??k?.defaults??[]){const f=Ee({...M,speech:P},x);if(!(f?.code==="bad_type"&&!$)){if(f&&f.code!=="no_speech")throw new j("bad-type",`${G(g)}: ${f.message}`,"usage",f.hint);h.push({target:g,kind:i.kind,type:x,...f?{refused:{name:me(g,x,m),piece:g.piece,type:x,code:"no-speech",message:`${G(g)}: ${f.message}`,...f.hint?{hint:f.hint}:{}}}:{}})}}}R.size>0&&e.log?.(`Not rendered, shown only inside another video (deliverable: false): ${[...R].join(", ")}. Name one to render it.`);for(const s of new Set(h.map(i=>i.kind)))await ee(s,await q(l.kinds,{kind:s}),h.filter(i=>i.kind===s).map(i=>i.type));const D=Ue(h,e.name,m);h.forEach((s,i)=>{s.refused&&(s.refused.name=D[i]??s.refused.name)});const w=[],V=new Array(h.length).fill(0),Y=(s,i)=>{V[s]=Math.max(V[s]??0,i),e.onProgress?.(V.reduce((k,M)=>k+M,0)/h.length)};let oe=0,Se=0;const Ae=async()=>{for(let s=oe++;s<h.length;s=oe++){e.signal?.throwIfAborted();const i=h[s];if(!i)continue;const k=D[s]??me(i.target,i.type,m);if(i.refused){y.push(i.refused),Y(s,1);continue}const M=await q(l.kinds,{kind:i.kind}),P=performance.now(),g=await He.open({root:e.root,session:p,item:i.target.piece,combos:[i.target.combo],purpose:"render"});try{const x=await M?.render?.(l.items.find(f=>f.id===g.piece.place)??{id:g.piece.place,kind:i.kind,dir:g.piece.dir,entry:g.piece.file,groups:[]},{root:e.root,prepared:p.prepared,types:[i.type],out:()=>C(e.out,k),params:d,version:g,session:X,made:we(l.items.find(f=>f.id===g.piece.place),r),onProgress:f=>{Y(s,f)},...e.log===void 0?{}:{log:e.log},...e.signal===void 0?{}:{signal:e.signal}})??[{type:i.type,failure:{code:"no-render",message:`${G(i.target)}: its kind (${i.kind}) makes no files.`}}];for(const f of x){if(ge(f)){y.push({name:k,piece:i.target.piece,type:i.type,code:f.failure.code,message:f.failure.message,...f.failure.hint?{hint:f.failure.hint}:{}});continue}const ae=await U(e.out,f,{piece:i.target.piece,combo:i.target.combo,key:fe(i.target.combo),format:i.target.format},P);await F(ae),e.log?.(`[${String(++Se)}/${String(h.length)}] ${k} (${ae.seconds.toFixed(1)} s)`)}}finally{w.push(...await g.problems()),H.add(i.target,await g.console()),await g.close(),Y(s,1)}}};h.length>0&&e.log?.(`Rendering ${J(h.length,"file")}…`);const re=(await Promise.allSettled(Array.from({length:exportsAtOnce(h.length)},Ae))).find(s=>s.status==="rejected");if(re)throw re.reason;_=ue([..._,...w])}const Me=n=>l.problems.find(t=>t.level==="error"&&t.where?.file!==void 0&&n.includes(t.where.file)),se=[];for(const n of O.filter(t=>!$||S(t.item))){const t=Me(he(l,n.item)),u=T(n.item.kind);t?y.push({name:n.item.id,piece:n.item.id,type:u?.defaults[0]??u?.types[0]??"",code:"check-failed",message:`${t.where?.file??n.item.entry}: ${t.message}`,hint:"Fix it, then render again."}):se.push(n)}e.signal?.throwIfAborted();for(const{item:n,build:t}of se){const u=T(n.kind),a=o===void 0?u?.defaults??[]:o.filter(w=>u?.types.includes(w)===!0);if(a.length===0)continue;await ee(n.kind,t,a);const h=performance.now(),R=n.id,D=await t.render?.(n,{root:e.root,prepared:p.prepared,types:a,out:w=>C(e.out,`${R}.${w}`),params:d,session:X,made:we(n,r),...e.log===void 0?{}:{log:e.log},...e.signal===void 0?{}:{signal:e.signal}})??[];for(const w of D)ge(w)?y.push({name:n.id,piece:n.id,type:w.type,code:w.failure.code,message:w.failure.message,...w.failure.hint?{hint:w.failure.hint}:{}}):await F(await U(e.out,w,{piece:n.id},h))}return{out:e.out,files:c,failed:y,problems:_,console:H.report(),unindexed:E}}finally{z&&await p.close()}}const ke=e=>e.split(Oe).join("/");function et(e,r){const o=de(e,r);return o===""?".":o.startsWith("..")||Fe(o)?r:ke(o)}async function tt(e,r,o,d){const m=[];for(const c of o.length>0?o:[void 0])m.push(await _e({dir:r,session:e,facts:!1,...c===void 0?{}:{piece:c},...d?{combos:[...d]}:{}}));const b=new Set,$=m.flatMap(c=>c.targets).filter(c=>{const y=`${c.piece}\0${c.key}\0${c.format}`;return b.has(y)?!1:(b.add(y),!0)}),S=ue(m.flatMap(c=>c.problems));return{targets:$,results:m.flatMap(c=>c.results),wholes:m.flatMap(c=>c.wholes),problems:S,errors:S.filter(c=>c.level==="error").length,console:Ke(e.consoleLimit,...m.map(c=>c.console))}}function nt(e){let r="";return o=>{const d=o.status==="failed"?`Could not index ${o.file}: ${o.message}`:o.message;o.status==="running"&&o.share!==void 0||d!==r&&(r=d,e?.(d))}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{CORE as _,declareRules as v,ruleOf as C}from"@allyhub/diagnostics";import{STAGE_LOADS as R}from"@allyhub/formats";import{LOCALES as A}from"@allyhub/i18n";import{PROJECT_TOOLS as L,RuntimeSchema as M,StageFolderSchema as W,StageLoadSchema as V,known as D}from"@allyhub/protocol";import{z as n}from"zod";import{KEY as K,MENUS as U,SETTING_TYPES as E,VIEW_CONTAINERS as p,inMenuBar as G,settingProblem as O,whenProblem as H}from"./shell.js";export const definePoint=e=>e,WordsSchema=n.record(n.string(),n.string().min(1));export function missingLocales(e){return A.filter(t=>!(t in e))}export const wordIn=(e,t)=>e[t]??e.en??Object.values(e)[0]??"";const h=n.string().regex(/^(@[a-z0-9][\w.-]*\/)?[a-z0-9][\w.-]*(\/[\w.-]+)*$/u);function b(e,t,i){if(typeof e!="object"||e===null||Array.isArray(e))return`is not an object of ${t}.`;const o=[];for(const[s,a]of Object.entries(e)){if(!Array.isArray(a))return`.${s} is not a list.`;a.forEach((d,u)=>{o.push([`.${s}[${String(u)}]`,typeof d=="object"&&d!==null?{...d,[i]:s}:d])})}return o}const y=n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),f=n.string().superRefine((e,t)=>{const i=H(e);i!==void 0&&t.addIssue({code:"custom",message:i})}),J=n.object({id:y,title:WordsSchema,enablement:f.optional(),place:n.enum(["workspace","ui"]).default("workspace")});export const COMMANDS=definePoint({id:"commands",about:"Commands a person runs from the palette, the menus and the keys.",entry:J,key:e=>e.id,activation:(e,t)=>e.place===t?[`onCommand:${e.id}`]:[],check:e=>{const t=missingLocales(e.title);return t.length>0?[`${e.id}'s title has no words in ${t.join(", ")}.`]:[]}});const B=n.object({command:y,key:n.string().regex(K,{message:"A key is modifiers among Mod, Shift and Alt, then a capital letter, a digit, a sign or a key's name (Mod+Shift+H)."}),when:f.optional()});export const KEYBINDING_POINT=definePoint({id:"keybindings",about:"Keys that run commands, each while its when clause holds.",entry:B});const F=n.object({menu:n.string().min(1),command:y,when:f.optional(),group:n.string().min(1).optional()});export const MENU_POINT=definePoint({id:"menus",about:`Commands in menus, by menu (${U.join(", ")}), each while its when clause holds.`,entry:F,entries:e=>b(e,"menus","menu"),check:e=>G(e.menu)?[`${e.command} is not placed in ${e.menu}: Studio's menu bar shows the core's entries alone yet.`]:[]});const x="Studio places no extension's view yet; its work card and its sidebar show the core's alone.",Y=n.object({location:n.string().min(1),id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),title:WordsSchema,icon:n.string().min(1).optional()});export const VIEW_CONTAINER_POINT=definePoint({id:"viewsContainers",about:`Containers of views, by where each goes; the shell gives its own (${p.join(", ")}) and takes none of an extension's yet.`,entry:Y,entries:e=>b(e,"places","location"),key:e=>e.id,check:e=>{const t=missingLocales(e.title);return[...t.length>0?[`${e.id}'s title has no words in ${t.join(", ")}.`]:[],`the container ${e.id} is not placed: ${x}`]}});const Z=n.object({container:n.string().min(1),id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),name:WordsSchema,when:f.optional(),icon:n.string().min(1).optional(),module:h.optional()});export const VIEW_POINT=definePoint({id:"views",about:`Views, by the container each is in (${p.join(", ")}): a page in a frame, as an editor is.`,entry:Z,entries:e=>b(e,"containers","container"),key:e=>e.id,check:e=>{const t=missingLocales(e.name);return[...p.includes(e.container)?[]:[`${e.container} is not a container: a view goes in ${p.join(" or ")}.`],...t.length>0?[`${e.id}'s name has no words in ${t.join(", ")}.`]:[],...e.module===void 0?[`${e.id} names no module: a view is a page's module, as an editor is.`]:[],`the view ${e.id} is not placed: ${x}`]}});const S=n.union([n.string(),n.boolean(),n.number()]),X=n.object({type:n.string().min(1),default:S.optional(),title:WordsSchema,description:WordsSchema.optional(),enum:n.array(S).min(1).optional(),enumItemLabels:n.array(WordsSchema).optional(),enumDescriptions:n.array(WordsSchema).optional(),minimum:n.number().optional(),maximum:n.number().optional(),minLength:n.number().int().min(0).optional(),order:n.number().int().optional()}),q=n.object({title:WordsSchema,order:n.number().int().optional(),properties:n.record(n.string(),X)});function Q(e,t){const i=[],o=(s,a)=>{const d=missingLocales(a);d.length>0&&i.push(`${e}'s ${s} has no words in ${d.join(", ")}.`)};return o("title",t.title),t.description!==void 0&&o("description",t.description),t.enumItemLabels?.forEach((s,a)=>{o(`label of choice ${String(a+1)}`,s)}),t.enumDescriptions?.forEach((s,a)=>{o(`description of choice ${String(a+1)}`,s)}),i}export const CONFIGURATION_POINT=definePoint({id:"configuration",about:"Settings: a title and JSON Schema properties by key, drawn as rows in the shell and read through allyhub.settings.",entry:q,entries:e=>Array.isArray(e)?e.map((t,i)=>[`[${String(i)}]`,t]):typeof e=="object"&&e!==null?[["",e]]:"is not a configuration or a list of them.",check:(e,t)=>{const i=[],o=missingLocales(e.title);o.length>0&&i.push(`a configuration's title has no words in ${o.join(", ")}.`);for(const[s,a]of Object.entries(e.properties)){if((!s.startsWith(`${t}.`)||s===`${t}.`)&&i.push(`${s} is not named by its extension: a setting's key is ${t}. and a name.`),i.push(...Q(s,a)),!E.includes(a.type)){i.push(`${s} is of type ${a.type}: a shell draws ${E.join(", ")}.`);continue}const d={...a,type:a.type};for(const[u,m]of(a.enum??[]).entries()){const c=O({type:d.type},m);c!==void 0&&i.push(`${s}'s choice ${String(u+1)}: ${c}`)}if(a.default!==void 0){const u=O(d,a.default);u!==void 0&&i.push(`${s}'s default: ${u}`)}for(const u of["enumItemLabels","enumDescriptions"]){const m=a[u];m!==void 0&&m.length!==(a.enum?.length??0)&&i.push(`${s}'s ${u} are ${String(m.length)}, and its choices ${String(a.enum?.length??0)}.`)}}return i}});const ee=n.object({name:n.string().regex(/^[a-z0-9][a-z0-9_-]*$/u),title:n.string().min(1),description:n.string().min(1),inputSchema:n.record(n.string(),n.unknown()),annotations:n.object({readOnlyHint:n.boolean(),destructiveHint:n.boolean(),idempotentHint:n.boolean(),openWorldHint:n.boolean()}).partial().optional()});export const WINDOW_TOOL_POINT=definePoint({id:"windowTools",about:"Tools an agent calls that act in the person's window, during its own turn: a name, a description, a JSON Schema of the input.",entry:ee,key:e=>e.name,check:e=>{const t=z(e.inputSchema);return[...t===void 0?[]:[`${e.name}'s inputSchema ${t}`],`the window tool ${e.name} is not given: Studio's MCP server gives the core's tools alone yet.`]}});const ne=n.object({name:n.string().regex(/^[a-z0-9][a-z0-9-]*( [a-z0-9][a-z0-9-]*){0,2}$/u),summary:n.string().min(1),work:n.string().min(1).optional(),module:n.string().min(1)});export const CLI_COMMANDS=definePoint({id:"cliCommands",about:"Commands the agent runs, `allyhub <name>`, listed in `allyhub help` before their module is loaded.",entry:ne,key:e=>e.name});const te=n.object({name:n.string().regex(/^[a-z0-9][a-z0-9.-]*\/[a-z][a-z0-9-]*$/u),source:n.enum(["project","asleep","machine"]),does:n.union([n.object({command:n.string().min(1)}),n.object({files:n.string().min(1)}),n.object({person:n.string().min(1)})]),module:n.string().min(1),readView:h.optional()});export const PROJECT_TOOL_POINT=definePoint({id:"projectTools",about:"Project tools: what an editor asks of a project through tools/call, each with the command or files that do the same for the agent.",entry:te,key:e=>e.name,check:(e,t)=>{if(Object.hasOwn(L,e.name))return[`${e.name} is the core's own project tool.`];const i=e.name.slice(0,e.name.lastIndexOf("/"));return T(t)||i===t?[]:[`the project tool ${e.name} does not start with its extension's id (${t}/…).`]}});const oe=n.object({folder:W,loads:n.array(V),module:n.string().min(1)});export const STAGE_ROUTE_POINT=definePoint({id:"stageRoutes",about:"Stage routes: a folder of the stage's tree an extension answers, what the stage's pages load from it, and what a snapshot records of it.",entry:oe,key:e=>e.folder});const ie=n.object({name:n.string().min(1),only:n.array(n.string().min(1)).min(1),values:n.array(n.string().min(1)).optional()}),se=n.object({files:n.record(n.string().min(1),n.string()),entry:n.string().min(1)}),w=e=>!e.startsWith("/")&&!e.includes("\\")&&e.split("/").every(t=>t!==""&&t!=="."&&t!==".."),ae=n.object({id:n.string().regex(/^[a-z][a-z0-9-]*$/u),name:WordsSchema,plural:WordsSchema.optional(),noun:n.string().min(1),part:n.object({noun:n.string().min(1),plural:n.string().min(1)}).optional(),pages:n.boolean().optional(),editor:n.string().min(1).optional(),shown:n.object({line:WordsSchema,order:n.number()}).optional(),icon:n.string().min(1).optional(),color:n.string().min(1).optional(),exports:n.object({types:n.array(n.string().min(1)).min(1),extras:n.array(n.string().min(1)).default([]),options:n.array(ie).default([]),names:n.record(n.string().min(1),WordsSchema).default({})}).optional(),renders:n.object({types:n.array(n.string().min(1)).min(1),defaults:n.array(n.string().min(1)).min(1)}).optional(),starter:se.optional(),share:n.boolean().optional(),build:n.string().min(1).optional()});export const KIND_POINT=definePoint({id:"kinds",about:"Kinds of item: their names, their editor, their icon and colour, what they export and render, what a new one starts as, whether one is shared alone.",entry:ae,key:e=>e.id,activation:(e,t)=>t==="workspace"?[`onKind:${e.id}`]:[],check:e=>{const t=[],i=missingLocales(e.name);i.length>0&&t.push(`${e.id}'s name has no words in ${i.join(", ")}.`);const o=e.plural&&missingLocales(e.plural);o&&o.length>0&&t.push(`${e.id}'s plural has no words in ${o.join(", ")}.`);for(const[a,d]of Object.entries(e.exports?.names??{})){const u=missingLocales(d);u.length>0&&t.push(`${e.id}'s name for its export ${a} has no words in ${u.join(", ")}.`)}const s=Object.keys(e.starter?.files??{});for(const a of s.filter(d=>!w(d)))t.push(`${e.id}'s starter file ${a} is not inside the new item's folder.`);return e.starter&&!s.includes(e.starter.entry)&&t.push(`${e.id}'s starter's entry ${e.starter.entry} is none of its files.`),t}});const I=n.union([n.string().min(1),n.array(n.string().min(1)).min(1)]),re=n.object({id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),markup:I.optional(),kinds:n.array(n.string().min(1)).default([]),files:n.array(n.string().min(1)).default([]),noun:n.string().min(1).optional(),name:WordsSchema.optional(),plural:WordsSchema.optional(),icon:n.string().min(1).optional(),color:n.string().min(1).optional(),check:n.string().min(1).optional(),priority:n.enum(["default","option"]).default("default"),module:h.optional(),place:n.record(n.string(),n.unknown()).optional()});function z(e){if(e.type!=="object")return'is not of "type": "object".';try{n.fromJSONSchema(e)}catch(t){return`is not a JSON Schema zod reads: ${t instanceof Error?t.message:String(t)}.`}}export const EDITOR_POINT=definePoint({id:"editors",about:"Editors: the kinds each opens, or the files it opens by their names (glob patterns, with their name, sign and check), whether it is their default, the module a page imports for it, and the schema of where a person is in what it opens.",entry:re,key:e=>e.id,activation:(e,t)=>t==="ui"?[`onEditor:${e.id}`]:[],check:e=>{const t=[],i=e.place&&z(e.place);if(i!==void 0&&t.push(`${e.id}'s place ${i}`),e.kinds.length===0&&e.files.length===0&&t.push(`${e.id} opens no kind and no files.`),e.kinds.length>0&&e.files.length>0&&t.push(`${e.id} opens kinds and files: an editor opens one or the other.`),e.files.length>0){e.noun===void 0&&t.push(`${e.id} opens files and has no noun for them.`),e.name===void 0&&t.push(`${e.id} opens files and has no name for them.`);for(const[o,s]of[["name",e.name],["plural",e.plural]]){const a=s===void 0?[]:missingLocales(s);a.length>0&&t.push(`${e.id}'s ${o} has no words in ${a.join(", ")}.`)}for(const o of e.files)(o.startsWith("/")||o.split("/").includes(".."))&&t.push(`${e.id}'s pattern ${o} is not of project paths (no leading /, no ..).`)}else e.check!==void 0&&t.push(`${e.id} has a check and opens no files: a kind's items are checked by its build.`);return t}});export function fileEditorTable(e,t=(i,o)=>o){return e.flatMap(({extension:i,entry:o})=>o.files.length===0||o.name===void 0||o.noun===void 0?[]:[{id:o.id,files:[...o.files],noun:o.noun,name:{...o.name},...o.plural===void 0?{}:{plural:{...o.plural}},...o.icon===void 0?{}:{icon:o.icon},...o.color===void 0?{}:{color:o.color},...o.priority==="option"?{priority:o.priority}:{},...o.check===void 0?{}:{check:t(i,o.check)},extension:i}])}const de=n.object({id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),markup:I.optional(),types:n.array(n.string().regex(/^[a-z]+\/(?:\*|[\w.+-]+)$/u)).min(1),module:h});export const PREVIEW_RENDERER_POINT=definePoint({id:"previewRenderers",about:"Preview renderers: how a file of a media type is drawn wherever one is shown (a canvas's node); each its media types and the module a page imports for it.",entry:de,key:e=>e.id});const T=e=>e.startsWith("allyhub.");function $(e,t,i){return T(e)||t.startsWith(`${e}/`)?[]:[`the ${i} ${t} does not start with its extension's id (${e}/…).`]}const le=n.object({code:n.string().regex(/^(AK-[A-Z]\d{3}|[a-z0-9][a-z0-9-]*\.[a-z0-9][a-z0-9-]*\/[A-Za-z0-9][\w.-]*)$/u),level:n.enum(["error","warn"]),rule:n.string().min(1)});export const RULE_POINT=definePoint({id:"rules",about:"Rules: the codes an extension reports problems under, each with its level and what it says.",entry:le,key:e=>e.code,check:(e,t)=>{const i=C(e.code);return[...$(t,e.code,"rule"),...i&&i.extension!==t?[`${e.code} is ${i.extension===_?"the core's":`${i.extension}'s`} rule already.`]:[]]},added:(e,t)=>v(t,[e])});const ce=n.object({kind:n.string().regex(/^([a-z][a-z0-9-]*|[a-z0-9][a-z0-9-]*\.[a-z0-9][a-z0-9-]*\/[a-z][a-z0-9-]*)$/u),about:n.string().min(1)});export const FACT_POINT=definePoint({id:"facts",about:"Kinds of fact: what an extension measures for the agent to judge, each with what it says.",entry:ce,key:e=>e.kind,check:(e,t)=>$(t,e.kind,"kind of fact")});const ue=n.object({module:n.string().min(1)});export const BUILD_PLUGINS_POINT=definePoint({id:"buildPlugins",about:"Build plugins: a module whose Vite plugins and lent packages every stage bundle of a project takes.",entry:ue});const k=n.string().min(1),me=n.object({name:n.string().regex(/^[a-z][a-z0-9-]*$/u),summary:n.string().min(1),module:k});export const INSPECT_VIEW_POINT=definePoint({id:"inspectViews",about:"Views of `allyhub inspect <name>`: a measurement now, listed in `allyhub help` before its module is loaded.",entry:me,key:e=>e.name});const pe=n.object({id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),types:n.array(n.string().min(1)).min(1),module:k});export const EXPORT_PROCESSOR_POINT=definePoint({id:"exportProcessors",about:"Export processors: a step run on every file of the types it names that an export makes.",entry:pe,key:e=>e.id,check:(e,t)=>e.id.startsWith(`${t}.`)?[]:[`the processor ${e.id} does not start with its extension's id (${t}.…).`]});const he=n.object({id:n.string().regex(/^([a-z][a-z0-9-]*|[a-z0-9][a-z0-9-]*\.[a-z0-9][a-z0-9-]*\/[a-z][a-z0-9-]*)$/u),about:n.string().min(1),what:n.string().min(1),media:n.array(n.enum(["image","audio","video"])).min(1),runtimes:n.array(n.string().regex(/^[a-z0-9][a-z0-9-]*$/u)).default([]),module:k});export const MEDIA_ANALYSIS_POINT=definePoint({id:"mediaAnalyses",about:"Media analyses: what the media index measures of a file once, by its content, when a version needs it.",entry:he,key:e=>e.id,check:(e,t)=>$(t,e.id,"media analysis")});const fe=n.object({id:n.string().regex(/^[a-z0-9][a-z0-9-]*$/u),...M.shape});export const RUNTIME_POINT=definePoint({id:"runtimes",about:"Runtimes: a tool's pinned download (a program, a model), fetched when first needed, checked, cached.",entry:fe,key:e=>e.id}),SKILL_NAME=/^(?=.{1,64}$)[a-z0-9]+(-[a-z0-9]+)*$/u;const g=e=>e.replace(/^\.\//u,"").replace(/\/+$/u,""),ge=n.object({path:n.string().min(1)});export const SKILL_POINT=definePoint({id:"skills",about:"Skills for the agent: a folder laid out as an Agent Skill's, a skill of its own or files of the skill of its name.",entry:ge,check:e=>{const t=g(e.path);if(!w(t))return[`the skill folder ${e.path} is not a folder inside its package.`];const i=t.slice(t.lastIndexOf("/")+1);return SKILL_NAME.test(i)?[]:[`the skill folder ${e.path} is not named as a skill is (lower-case letters, digits and hyphens, at most 64).`]}});const P=n.record(n.string(),n.string()),be=n.union([n.object({name:n.string().regex(/^[a-z0-9][a-z0-9_-]*$/u),command:n.string().min(1),args:n.array(n.string()).default([]),env:P.default({}),cwd:n.string().min(1).optional()}),n.object({name:n.string().regex(/^[a-z0-9][a-z0-9_-]*$/u),url:n.url(),headers:P.default({})})]);export const MCP_SERVER_POINT=definePoint({id:"mcpServers",about:"MCP servers: a local program or an address that gives an agent tools, defined as .mcp.json defines one.",entry:be,key:e=>e.name,check:e=>"cwd"in e&&e.cwd!==void 0&&!w(g(e.cwd))?[`the MCP server ${e.name}'s cwd is not a folder inside its package.`]:[]}),CORE_POINTS=[COMMANDS,KEYBINDING_POINT,MENU_POINT,VIEW_CONTAINER_POINT,VIEW_POINT,CONFIGURATION_POINT,WINDOW_TOOL_POINT,CLI_COMMANDS,KIND_POINT,EDITOR_POINT,PREVIEW_RENDERER_POINT,RULE_POINT,FACT_POINT,BUILD_PLUGINS_POINT,PROJECT_TOOL_POINT,STAGE_ROUTE_POINT,INSPECT_VIEW_POINT,EXPORT_PROCESSOR_POINT,MEDIA_ANALYSIS_POINT,RUNTIME_POINT,SKILL_POINT,MCP_SERVER_POINT];export function kindTable(e,t=(d,u)=>u,i=[],o=[],s=[],a=()=>{}){const d=c=>{const r=i.filter(l=>l.extension===c).map(l=>t(c,l.entry.module));return r.length>0?r:void 0},u=c=>{const r=o.filter(l=>l.extension===c).map(({entry:l})=>({name:l.name,source:l.source,does:l.does,module:t(c,l.module),extension:c}));return r.length>0?r:void 0},m=c=>{const r=s.filter(l=>l.extension===c).map(({entry:l})=>({folder:l.folder,loads:l.loads.filter(N=>D(R,N)),module:t(c,l.module),extension:c}));return r.length>0?r:void 0};return e.map(({extension:c,entry:r})=>({id:r.id,editor:r.editor,noun:r.noun,part:r.part,...r.pages===!0?{pages:!0}:{},name:r.name,plural:r.plural,icon:r.icon,color:r.color,exports:r.exports&&{types:r.exports.types,extras:r.exports.extras,options:r.exports.options.map(l=>({name:l.name,only:l.only,...l.values===void 0?{}:{values:l.values}})),...Object.keys(r.exports.names).length===0?{}:{names:r.exports.names}},renders:r.renders&&{types:r.renders.types,defaults:r.renders.defaults},starter:r.starter&&{files:{...r.starter.files},entry:r.starter.entry},share:r.share,build:r.build===void 0?void 0:t(c,r.build),buildPlugins:d(c),projectTools:u(c),stageRoutes:m(c),points:a(c),extension:c}))}export const inspectViewTable=(e,t)=>e.map(({extension:i,entry:o})=>({name:o.name,summary:o.summary,module:t(i,o.module),extension:i})),cliCommandTable=(e,t)=>e.map(({extension:i,entry:o})=>({name:o.name,summary:o.summary,...o.work===void 0?{}:{work:o.work},module:t(i,o.module),extension:i})),processorTable=(e,t)=>e.map(({extension:i,entry:o})=>({id:o.id,types:o.types,module:t(i,o.module),extension:i})),analysisTable=(e,t)=>e.map(({extension:i,entry:o})=>({id:o.id,about:o.about,what:o.what,media:o.media,runtimes:o.runtimes,module:t(i,o.module),extension:i})),skillTable=(e,t)=>e.map(({extension:i,entry:o})=>{const s=g(o.path);return{name:s.slice(s.lastIndexOf("/")+1),folder:t(i,s),extension:i}});const j=(e,t)=>e.replaceAll("${PLUGIN_ROOT}",t);export const mcpServerTable=(e,t,i)=>e.map(({extension:o,entry:s})=>{if("url"in s)return{name:s.name,url:s.url,headers:{...s.headers},extension:o};const a=t(o);return{name:s.name,command:j(s.command,a),args:s.args.map(d=>j(d,a)),env:Object.fromEntries(Object.entries(s.env).map(([d,u])=>[d,j(u,a)])),cwd:s.cwd===void 0?a:i(o,g(s.cwd)),extension:o}});
|
|
2
|
+
import{CORE as _,declareRules as v,ruleOf as C}from"@allyhub/diagnostics";import{STAGE_LOADS as R}from"@allyhub/formats";import{LOCALES as A}from"@allyhub/i18n";import{PROJECT_TOOLS as L,RuntimeSchema as M,StageFolderSchema as W,StageLoadSchema as V,known as D}from"@allyhub/protocol";import{z as n}from"zod";import{KEY as K,MENUS as U,SETTING_TYPES as E,VIEW_CONTAINERS as p,inMenuBar as G,settingProblem as O,whenProblem as H}from"./shell.js";export const definePoint=e=>e,WordsSchema=n.record(n.string(),n.string().min(1));export function missingLocales(e){return A.filter(t=>!(t in e))}export const wordIn=(e,t)=>e[t]??e.en??Object.values(e)[0]??"";const h=n.string().regex(/^(@[a-z0-9][\w.-]*\/)?[a-z0-9][\w.-]*(\/[\w.-]+)*$/u);function b(e,t,i){if(typeof e!="object"||e===null||Array.isArray(e))return`is not an object of ${t}.`;const o=[];for(const[s,r]of Object.entries(e)){if(!Array.isArray(r))return`.${s} is not a list.`;r.forEach((d,u)=>{o.push([`.${s}[${String(u)}]`,typeof d=="object"&&d!==null?{...d,[i]:s}:d])})}return o}const y=n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),f=n.string().superRefine((e,t)=>{const i=H(e);i!==void 0&&t.addIssue({code:"custom",message:i})}),J=n.object({id:y,title:WordsSchema,enablement:f.optional(),place:n.enum(["workspace","ui"]).default("workspace")});export const COMMANDS=definePoint({id:"commands",about:"Commands a person runs from the palette, the menus and the keys.",entry:J,key:e=>e.id,activation:(e,t)=>e.place===t?[`onCommand:${e.id}`]:[],check:e=>{const t=missingLocales(e.title);return t.length>0?[`${e.id}'s title has no words in ${t.join(", ")}.`]:[]}});const B=n.object({command:y,key:n.string().regex(K,{message:"A key is modifiers among Mod, Shift and Alt, then a capital letter, a digit, a sign or a key's name (Mod+Shift+H)."}),when:f.optional()});export const KEYBINDING_POINT=definePoint({id:"keybindings",about:"Keys that run commands, each while its when clause holds.",entry:B});const F=n.object({menu:n.string().min(1),command:y,when:f.optional(),group:n.string().min(1).optional()});export const MENU_POINT=definePoint({id:"menus",about:`Commands in menus, by menu (${U.join(", ")}), each while its when clause holds.`,entry:F,entries:e=>b(e,"menus","menu"),check:e=>G(e.menu)?[`${e.command} is not placed in ${e.menu}: Studio's menu bar shows the core's entries alone yet.`]:[]});const x="Studio places no extension's view yet; its work card and its sidebar show the core's alone.",Y=n.object({location:n.string().min(1),id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),title:WordsSchema,icon:n.string().min(1).optional()});export const VIEW_CONTAINER_POINT=definePoint({id:"viewsContainers",about:`Containers of views, by where each goes; the shell gives its own (${p.join(", ")}) and takes none of an extension's yet.`,entry:Y,entries:e=>b(e,"places","location"),key:e=>e.id,check:e=>{const t=missingLocales(e.title);return[...t.length>0?[`${e.id}'s title has no words in ${t.join(", ")}.`]:[],`the container ${e.id} is not placed: ${x}`]}});const Z=n.object({container:n.string().min(1),id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),name:WordsSchema,when:f.optional(),icon:n.string().min(1).optional(),module:h.optional()});export const VIEW_POINT=definePoint({id:"views",about:`Views, by the container each is in (${p.join(", ")}): a page in a frame, as an editor is.`,entry:Z,entries:e=>b(e,"containers","container"),key:e=>e.id,check:e=>{const t=missingLocales(e.name);return[...p.includes(e.container)?[]:[`${e.container} is not a container: a view goes in ${p.join(" or ")}.`],...t.length>0?[`${e.id}'s name has no words in ${t.join(", ")}.`]:[],...e.module===void 0?[`${e.id} names no module: a view is a page's module, as an editor is.`]:[],`the view ${e.id} is not placed: ${x}`]}});const S=n.union([n.string(),n.boolean(),n.number()]),X=n.object({type:n.string().min(1),default:S.optional(),title:WordsSchema,description:WordsSchema.optional(),enum:n.array(S).min(1).optional(),enumItemLabels:n.array(WordsSchema).optional(),enumDescriptions:n.array(WordsSchema).optional(),minimum:n.number().optional(),maximum:n.number().optional(),minLength:n.number().int().min(0).optional(),order:n.number().int().optional()}),q=n.object({title:WordsSchema,order:n.number().int().optional(),properties:n.record(n.string(),X)});function Q(e,t){const i=[],o=(s,r)=>{const d=missingLocales(r);d.length>0&&i.push(`${e}'s ${s} has no words in ${d.join(", ")}.`)};return o("title",t.title),t.description!==void 0&&o("description",t.description),t.enumItemLabels?.forEach((s,r)=>{o(`label of choice ${String(r+1)}`,s)}),t.enumDescriptions?.forEach((s,r)=>{o(`description of choice ${String(r+1)}`,s)}),i}export const CONFIGURATION_POINT=definePoint({id:"configuration",about:"Settings: a title and JSON Schema properties by key, drawn as rows in the shell and read through allyhub.settings.",entry:q,entries:e=>Array.isArray(e)?e.map((t,i)=>[`[${String(i)}]`,t]):typeof e=="object"&&e!==null?[["",e]]:"is not a configuration or a list of them.",check:(e,t)=>{const i=[],o=missingLocales(e.title);o.length>0&&i.push(`a configuration's title has no words in ${o.join(", ")}.`);for(const[s,r]of Object.entries(e.properties)){if((!s.startsWith(`${t}.`)||s===`${t}.`)&&i.push(`${s} is not named by its extension: a setting's key is ${t}. and a name.`),i.push(...Q(s,r)),!E.includes(r.type)){i.push(`${s} is of type ${r.type}: a shell draws ${E.join(", ")}.`);continue}const d={...r,type:r.type};for(const[u,m]of(r.enum??[]).entries()){const c=O({type:d.type},m);c!==void 0&&i.push(`${s}'s choice ${String(u+1)}: ${c}`)}if(r.default!==void 0){const u=O(d,r.default);u!==void 0&&i.push(`${s}'s default: ${u}`)}for(const u of["enumItemLabels","enumDescriptions"]){const m=r[u];m!==void 0&&m.length!==(r.enum?.length??0)&&i.push(`${s}'s ${u} are ${String(m.length)}, and its choices ${String(r.enum?.length??0)}.`)}}return i}});const ee=n.object({name:n.string().regex(/^[a-z0-9][a-z0-9_-]*$/u),title:n.string().min(1),description:n.string().min(1),inputSchema:n.record(n.string(),n.unknown()),annotations:n.object({readOnlyHint:n.boolean(),destructiveHint:n.boolean(),idempotentHint:n.boolean(),openWorldHint:n.boolean()}).partial().optional()});export const WINDOW_TOOL_POINT=definePoint({id:"windowTools",about:"Tools an agent calls that act in the person's window, during its own turn: a name, a description, a JSON Schema of the input.",entry:ee,key:e=>e.name,check:e=>{const t=z(e.inputSchema);return[...t===void 0?[]:[`${e.name}'s inputSchema ${t}`],`the window tool ${e.name} is not given: Studio's MCP server gives the core's tools alone yet.`]}});const ne=n.object({name:n.string().regex(/^[a-z0-9][a-z0-9-]*( [a-z0-9][a-z0-9-]*){0,2}$/u),summary:n.string().min(1),work:n.string().min(1).optional(),module:n.string().min(1)});export const CLI_COMMANDS=definePoint({id:"cliCommands",about:"Commands the agent runs, `allyhub <name>`, listed in `allyhub help` before their module is loaded.",entry:ne,key:e=>e.name});const te=n.object({name:n.string().regex(/^[a-z0-9][a-z0-9.-]*\/[a-z][a-z0-9-]*$/u),source:n.enum(["project","asleep","machine"]),does:n.union([n.object({command:n.string().min(1)}),n.object({files:n.string().min(1)}),n.object({person:n.string().min(1)})]),module:n.string().min(1),readView:h.optional()});export const PROJECT_TOOL_POINT=definePoint({id:"projectTools",about:"Project tools: what an editor asks of a project through tools/call, each with the command or files that do the same for the agent.",entry:te,key:e=>e.name,check:(e,t)=>{if(Object.hasOwn(L,e.name))return[`${e.name} is the core's own project tool.`];const i=e.name.slice(0,e.name.lastIndexOf("/"));return T(t)||i===t?[]:[`the project tool ${e.name} does not start with its extension's id (${t}/…).`]}});const oe=n.object({folder:W,loads:n.array(V),module:n.string().min(1)});export const STAGE_ROUTE_POINT=definePoint({id:"stageRoutes",about:"Stage routes: a folder of the stage's tree an extension answers, what the stage's pages load from it, and what a snapshot records of it.",entry:oe,key:e=>e.folder});const ie=n.object({name:n.string().min(1),only:n.array(n.string().min(1)).min(1),values:n.array(n.string().min(1)).optional()}),se=n.object({files:n.record(n.string().min(1),n.string()),entry:n.string().min(1)}),w=e=>!e.startsWith("/")&&!e.includes("\\")&&e.split("/").every(t=>t!==""&&t!=="."&&t!==".."),ae=n.object({id:n.string().regex(/^[a-z][a-z0-9-]*$/u),name:WordsSchema,plural:WordsSchema.optional(),noun:n.string().min(1),part:n.object({noun:n.string().min(1),plural:n.string().min(1)}).optional(),pages:n.boolean().optional(),editor:n.string().min(1).optional(),shown:n.object({line:WordsSchema,order:n.number()}).optional(),icon:n.string().min(1).optional(),color:n.string().min(1).optional(),exports:n.object({types:n.array(n.string().min(1)).min(1),extras:n.array(n.string().min(1)).default([]),options:n.array(ie).default([]),names:n.record(n.string().min(1),WordsSchema).default({})}).optional(),renders:n.object({types:n.array(n.string().min(1)).min(1),defaults:n.array(n.string().min(1)).min(1)}).optional(),starter:se.optional(),turnInto:n.boolean().optional(),share:n.boolean().optional(),build:n.string().min(1).optional()});export const KIND_POINT=definePoint({id:"kinds",about:"Kinds of item: their names, their editor, their icon and colour, what they export and render, what a new one starts as, whether one is shared alone.",entry:ae,key:e=>e.id,activation:(e,t)=>t==="workspace"?[`onKind:${e.id}`]:[],check:e=>{const t=[],i=missingLocales(e.name);i.length>0&&t.push(`${e.id}'s name has no words in ${i.join(", ")}.`);const o=e.plural&&missingLocales(e.plural);o&&o.length>0&&t.push(`${e.id}'s plural has no words in ${o.join(", ")}.`);for(const[r,d]of Object.entries(e.exports?.names??{})){const u=missingLocales(d);u.length>0&&t.push(`${e.id}'s name for its export ${r} has no words in ${u.join(", ")}.`)}const s=Object.keys(e.starter?.files??{});for(const r of s.filter(d=>!w(d)))t.push(`${e.id}'s starter file ${r} is not inside the new item's folder.`);return e.starter&&!s.includes(e.starter.entry)&&t.push(`${e.id}'s starter's entry ${e.starter.entry} is none of its files.`),t}});const I=n.union([n.string().min(1),n.array(n.string().min(1)).min(1)]),re=n.object({id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),markup:I.optional(),kinds:n.array(n.string().min(1)).default([]),files:n.array(n.string().min(1)).default([]),noun:n.string().min(1).optional(),name:WordsSchema.optional(),plural:WordsSchema.optional(),icon:n.string().min(1).optional(),color:n.string().min(1).optional(),check:n.string().min(1).optional(),priority:n.enum(["default","option"]).default("default"),module:h.optional(),place:n.record(n.string(),n.unknown()).optional()});function z(e){if(e.type!=="object")return'is not of "type": "object".';try{n.fromJSONSchema(e)}catch(t){return`is not a JSON Schema zod reads: ${t instanceof Error?t.message:String(t)}.`}}export const EDITOR_POINT=definePoint({id:"editors",about:"Editors: the kinds each opens, or the files it opens by their names (glob patterns, with their name, sign and check), whether it is their default, the module a page imports for it, and the schema of where a person is in what it opens.",entry:re,key:e=>e.id,activation:(e,t)=>t==="ui"?[`onEditor:${e.id}`]:[],check:e=>{const t=[],i=e.place&&z(e.place);if(i!==void 0&&t.push(`${e.id}'s place ${i}`),e.kinds.length===0&&e.files.length===0&&t.push(`${e.id} opens no kind and no files.`),e.kinds.length>0&&e.files.length>0&&t.push(`${e.id} opens kinds and files: an editor opens one or the other.`),e.files.length>0){e.noun===void 0&&t.push(`${e.id} opens files and has no noun for them.`),e.name===void 0&&t.push(`${e.id} opens files and has no name for them.`);for(const[o,s]of[["name",e.name],["plural",e.plural]]){const r=s===void 0?[]:missingLocales(s);r.length>0&&t.push(`${e.id}'s ${o} has no words in ${r.join(", ")}.`)}for(const o of e.files)(o.startsWith("/")||o.split("/").includes(".."))&&t.push(`${e.id}'s pattern ${o} is not of project paths (no leading /, no ..).`)}else e.check!==void 0&&t.push(`${e.id} has a check and opens no files: a kind's items are checked by its build.`);return t}});export function fileEditorTable(e,t=(i,o)=>o){return e.flatMap(({extension:i,entry:o})=>o.files.length===0||o.name===void 0||o.noun===void 0?[]:[{id:o.id,files:[...o.files],noun:o.noun,name:{...o.name},...o.plural===void 0?{}:{plural:{...o.plural}},...o.icon===void 0?{}:{icon:o.icon},...o.color===void 0?{}:{color:o.color},...o.priority==="option"?{priority:o.priority}:{},...o.check===void 0?{}:{check:t(i,o.check)},extension:i}])}const de=n.object({id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),markup:I.optional(),types:n.array(n.string().regex(/^[a-z]+\/(?:\*|[\w.+-]+)$/u)).min(1),module:h});export const PREVIEW_RENDERER_POINT=definePoint({id:"previewRenderers",about:"Preview renderers: how a file of a media type is drawn wherever one is shown (a canvas's node); each its media types and the module a page imports for it.",entry:de,key:e=>e.id});const T=e=>e.startsWith("allyhub.");function $(e,t,i){return T(e)||t.startsWith(`${e}/`)?[]:[`the ${i} ${t} does not start with its extension's id (${e}/…).`]}const le=n.object({code:n.string().regex(/^(AK-[A-Z]\d{3}|[a-z0-9][a-z0-9-]*\.[a-z0-9][a-z0-9-]*\/[A-Za-z0-9][\w.-]*)$/u),level:n.enum(["error","warn"]),rule:n.string().min(1)});export const RULE_POINT=definePoint({id:"rules",about:"Rules: the codes an extension reports problems under, each with its level and what it says.",entry:le,key:e=>e.code,check:(e,t)=>{const i=C(e.code);return[...$(t,e.code,"rule"),...i&&i.extension!==t?[`${e.code} is ${i.extension===_?"the core's":`${i.extension}'s`} rule already.`]:[]]},added:(e,t)=>v(t,[e])});const ce=n.object({kind:n.string().regex(/^([a-z][a-z0-9-]*|[a-z0-9][a-z0-9-]*\.[a-z0-9][a-z0-9-]*\/[a-z][a-z0-9-]*)$/u),about:n.string().min(1)});export const FACT_POINT=definePoint({id:"facts",about:"Kinds of fact: what an extension measures for the agent to judge, each with what it says.",entry:ce,key:e=>e.kind,check:(e,t)=>$(t,e.kind,"kind of fact")});const ue=n.object({module:n.string().min(1)});export const BUILD_PLUGINS_POINT=definePoint({id:"buildPlugins",about:"Build plugins: a module whose Vite plugins and lent packages every stage bundle of a project takes.",entry:ue});const k=n.string().min(1),me=n.object({name:n.string().regex(/^[a-z][a-z0-9-]*$/u),summary:n.string().min(1),module:k});export const INSPECT_VIEW_POINT=definePoint({id:"inspectViews",about:"Views of `allyhub inspect <name>`: a measurement now, listed in `allyhub help` before its module is loaded.",entry:me,key:e=>e.name});const pe=n.object({id:n.string().regex(/^[a-z0-9][\w-]*(\.[\w-]+)+$/u),types:n.array(n.string().min(1)).min(1),module:k});export const EXPORT_PROCESSOR_POINT=definePoint({id:"exportProcessors",about:"Export processors: a step run on every file of the types it names that an export makes.",entry:pe,key:e=>e.id,check:(e,t)=>e.id.startsWith(`${t}.`)?[]:[`the processor ${e.id} does not start with its extension's id (${t}.…).`]});const he=n.object({id:n.string().regex(/^([a-z][a-z0-9-]*|[a-z0-9][a-z0-9-]*\.[a-z0-9][a-z0-9-]*\/[a-z][a-z0-9-]*)$/u),about:n.string().min(1),what:n.string().min(1),media:n.array(n.enum(["image","audio","video"])).min(1),runtimes:n.array(n.string().regex(/^[a-z0-9][a-z0-9-]*$/u)).default([]),module:k});export const MEDIA_ANALYSIS_POINT=definePoint({id:"mediaAnalyses",about:"Media analyses: what the media index measures of a file once, by its content, when a version needs it.",entry:he,key:e=>e.id,check:(e,t)=>$(t,e.id,"media analysis")});const fe=n.object({id:n.string().regex(/^[a-z0-9][a-z0-9-]*$/u),...M.shape});export const RUNTIME_POINT=definePoint({id:"runtimes",about:"Runtimes: a tool's pinned download (a program, a model), fetched when first needed, checked, cached.",entry:fe,key:e=>e.id}),SKILL_NAME=/^(?=.{1,64}$)[a-z0-9]+(-[a-z0-9]+)*$/u;const g=e=>e.replace(/^\.\//u,"").replace(/\/+$/u,""),ge=n.object({path:n.string().min(1)});export const SKILL_POINT=definePoint({id:"skills",about:"Skills for the agent: a folder laid out as an Agent Skill's, a skill of its own or files of the skill of its name.",entry:ge,check:e=>{const t=g(e.path);if(!w(t))return[`the skill folder ${e.path} is not a folder inside its package.`];const i=t.slice(t.lastIndexOf("/")+1);return SKILL_NAME.test(i)?[]:[`the skill folder ${e.path} is not named as a skill is (lower-case letters, digits and hyphens, at most 64).`]}});const P=n.record(n.string(),n.string()),be=n.union([n.object({name:n.string().regex(/^[a-z0-9][a-z0-9_-]*$/u),command:n.string().min(1),args:n.array(n.string()).default([]),env:P.default({}),cwd:n.string().min(1).optional()}),n.object({name:n.string().regex(/^[a-z0-9][a-z0-9_-]*$/u),url:n.url(),headers:P.default({})})]);export const MCP_SERVER_POINT=definePoint({id:"mcpServers",about:"MCP servers: a local program or an address that gives an agent tools, defined as .mcp.json defines one.",entry:be,key:e=>e.name,check:e=>"cwd"in e&&e.cwd!==void 0&&!w(g(e.cwd))?[`the MCP server ${e.name}'s cwd is not a folder inside its package.`]:[]}),CORE_POINTS=[COMMANDS,KEYBINDING_POINT,MENU_POINT,VIEW_CONTAINER_POINT,VIEW_POINT,CONFIGURATION_POINT,WINDOW_TOOL_POINT,CLI_COMMANDS,KIND_POINT,EDITOR_POINT,PREVIEW_RENDERER_POINT,RULE_POINT,FACT_POINT,BUILD_PLUGINS_POINT,PROJECT_TOOL_POINT,STAGE_ROUTE_POINT,INSPECT_VIEW_POINT,EXPORT_PROCESSOR_POINT,MEDIA_ANALYSIS_POINT,RUNTIME_POINT,SKILL_POINT,MCP_SERVER_POINT];export function kindTable(e,t=(d,u)=>u,i=[],o=[],s=[],r=()=>{}){const d=c=>{const a=i.filter(l=>l.extension===c).map(l=>t(c,l.entry.module));return a.length>0?a:void 0},u=c=>{const a=o.filter(l=>l.extension===c).map(({entry:l})=>({name:l.name,source:l.source,does:l.does,module:t(c,l.module),extension:c}));return a.length>0?a:void 0},m=c=>{const a=s.filter(l=>l.extension===c).map(({entry:l})=>({folder:l.folder,loads:l.loads.filter(N=>D(R,N)),module:t(c,l.module),extension:c}));return a.length>0?a:void 0};return e.map(({extension:c,entry:a})=>({id:a.id,editor:a.editor,noun:a.noun,part:a.part,...a.pages===!0?{pages:!0}:{},name:a.name,plural:a.plural,icon:a.icon,color:a.color,exports:a.exports&&{types:a.exports.types,extras:a.exports.extras,options:a.exports.options.map(l=>({name:l.name,only:l.only,...l.values===void 0?{}:{values:l.values}})),...Object.keys(a.exports.names).length===0?{}:{names:a.exports.names}},renders:a.renders&&{types:a.renders.types,defaults:a.renders.defaults},starter:a.starter&&{files:{...a.starter.files},entry:a.starter.entry},...a.shown===void 0?{}:{order:a.shown.order},...a.turnInto===!1?{turnInto:!1}:{},share:a.share,build:a.build===void 0?void 0:t(c,a.build),buildPlugins:d(c),projectTools:u(c),stageRoutes:m(c),points:r(c),extension:c}))}export const inspectViewTable=(e,t)=>e.map(({extension:i,entry:o})=>({name:o.name,summary:o.summary,module:t(i,o.module),extension:i})),cliCommandTable=(e,t)=>e.map(({extension:i,entry:o})=>({name:o.name,summary:o.summary,...o.work===void 0?{}:{work:o.work},module:t(i,o.module),extension:i})),processorTable=(e,t)=>e.map(({extension:i,entry:o})=>({id:o.id,types:o.types,module:t(i,o.module),extension:i})),analysisTable=(e,t)=>e.map(({extension:i,entry:o})=>({id:o.id,about:o.about,what:o.what,media:o.media,runtimes:o.runtimes,module:t(i,o.module),extension:i})),skillTable=(e,t)=>e.map(({extension:i,entry:o})=>{const s=g(o.path);return{name:s.slice(s.lastIndexOf("/")+1),folder:t(i,s),extension:i}});const j=(e,t)=>e.replaceAll("${PLUGIN_ROOT}",t);export const mcpServerTable=(e,t,i)=>e.map(({extension:o,entry:s})=>{if("url"in s)return{name:s.name,url:s.url,headers:{...s.headers},extension:o};const r=t(o);return{name:s.name,command:j(s.command,r),args:s.args.map(d=>j(d,r)),env:Object.fromEntries(Object.entries(s.env).map(([d,u])=>[d,j(u,r)])),cwd:s.cwd===void 0?r:i(o,g(s.cwd)),extension:o}});
|
|
@@ -982,8 +982,8 @@ export type PlaybackFile = z.infer<typeof PlaybackSchema>;
|
|
|
982
982
|
/**
|
|
983
983
|
* A shape on a slide, by its name. Without a kind it changes a shape the
|
|
984
984
|
* slide has already (a layout's placeholder, a generator's shape); with
|
|
985
|
-
* one (`textbox`, `picture`, `movie`, `geometry`, `component`) it
|
|
986
|
-
* shape of the slide's own.
|
|
985
|
+
* one (`textbox`, `picture`, `movie`, `geometry`, `component`, `item`) it
|
|
986
|
+
* is a shape of the slide's own.
|
|
987
987
|
*/
|
|
988
988
|
export declare const ShapeSchema: z.ZodObject<{
|
|
989
989
|
frame: z.ZodOptional<z.ZodObject<{
|
|
@@ -1495,6 +1495,7 @@ export declare const ShapeSchema: z.ZodObject<{
|
|
|
1495
1495
|
}, z.core.$strict>>;
|
|
1496
1496
|
movie: z.ZodOptional<z.ZodString>;
|
|
1497
1497
|
audio: z.ZodOptional<z.ZodString>;
|
|
1498
|
+
item: z.ZodOptional<z.ZodString>;
|
|
1498
1499
|
poster: z.ZodOptional<z.ZodNumber>;
|
|
1499
1500
|
playback: z.ZodOptional<z.ZodObject<{
|
|
1500
1501
|
start: z.ZodOptional<z.ZodEnum<{
|
|
@@ -1895,6 +1896,9 @@ export declare const ShapeSchema: z.ZodObject<{
|
|
|
1895
1896
|
rows: z.ZodOptional<z.ZodInt>;
|
|
1896
1897
|
columns: z.ZodOptional<z.ZodInt>;
|
|
1897
1898
|
}, z.core.$strip>>>;
|
|
1899
|
+
data: z.ZodOptional<z.ZodString>;
|
|
1900
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1901
|
+
head: z.ZodOptional<z.ZodBoolean>;
|
|
1898
1902
|
style: z.ZodOptional<z.ZodString>;
|
|
1899
1903
|
first_row: z.ZodOptional<z.ZodBoolean>;
|
|
1900
1904
|
last_row: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -2205,7 +2209,7 @@ export declare function showJumpOf(link: string): ShowJump | undefined;
|
|
|
2205
2209
|
/** A link's slide (`#<id>`), if it is one. */
|
|
2206
2210
|
export declare const slideLinkOf: (link: string) => string | undefined;
|
|
2207
2211
|
/** The kinds a shape of the slide's own is, by the field that makes it. */
|
|
2208
|
-
export declare const SHAPE_KINDS: readonly ["textbox", "picture", "movie", "audio", "geometry", "path", "table", "chart", "component"];
|
|
2212
|
+
export declare const SHAPE_KINDS: readonly ["textbox", "picture", "movie", "audio", "geometry", "path", "table", "chart", "component", "item"];
|
|
2209
2213
|
/** How a slide comes on from the one before, by PowerPoint's transitions. */
|
|
2210
2214
|
export declare const SLIDE_TRANSITIONS: readonly ["fade", "push", "wipe", "split", "reveal", "cut", "cover", "uncover", "zoom", "morph"];
|
|
2211
2215
|
export type SlideTransitionType = (typeof SLIDE_TRANSITIONS)[number];
|
|
@@ -2836,6 +2840,7 @@ export declare const SlideSchema: z.ZodObject<{
|
|
|
2836
2840
|
}, z.core.$strict>>;
|
|
2837
2841
|
movie: z.ZodOptional<z.ZodString>;
|
|
2838
2842
|
audio: z.ZodOptional<z.ZodString>;
|
|
2843
|
+
item: z.ZodOptional<z.ZodString>;
|
|
2839
2844
|
poster: z.ZodOptional<z.ZodNumber>;
|
|
2840
2845
|
playback: z.ZodOptional<z.ZodObject<{
|
|
2841
2846
|
start: z.ZodOptional<z.ZodEnum<{
|
|
@@ -3236,6 +3241,9 @@ export declare const SlideSchema: z.ZodObject<{
|
|
|
3236
3241
|
rows: z.ZodOptional<z.ZodInt>;
|
|
3237
3242
|
columns: z.ZodOptional<z.ZodInt>;
|
|
3238
3243
|
}, z.core.$strip>>>;
|
|
3244
|
+
data: z.ZodOptional<z.ZodString>;
|
|
3245
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
3246
|
+
head: z.ZodOptional<z.ZodBoolean>;
|
|
3239
3247
|
style: z.ZodOptional<z.ZodString>;
|
|
3240
3248
|
first_row: z.ZodOptional<z.ZodBoolean>;
|
|
3241
3249
|
last_row: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -4216,6 +4224,7 @@ export declare const SlidesFileSchema: z.ZodObject<{
|
|
|
4216
4224
|
}, z.core.$strict>>;
|
|
4217
4225
|
movie: z.ZodOptional<z.ZodString>;
|
|
4218
4226
|
audio: z.ZodOptional<z.ZodString>;
|
|
4227
|
+
item: z.ZodOptional<z.ZodString>;
|
|
4219
4228
|
poster: z.ZodOptional<z.ZodNumber>;
|
|
4220
4229
|
playback: z.ZodOptional<z.ZodObject<{
|
|
4221
4230
|
start: z.ZodOptional<z.ZodEnum<{
|
|
@@ -4616,6 +4625,9 @@ export declare const SlidesFileSchema: z.ZodObject<{
|
|
|
4616
4625
|
rows: z.ZodOptional<z.ZodInt>;
|
|
4617
4626
|
columns: z.ZodOptional<z.ZodInt>;
|
|
4618
4627
|
}, z.core.$strip>>>;
|
|
4628
|
+
data: z.ZodOptional<z.ZodString>;
|
|
4629
|
+
fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
4630
|
+
head: z.ZodOptional<z.ZodBoolean>;
|
|
4619
4631
|
style: z.ZodOptional<z.ZodString>;
|
|
4620
4632
|
first_row: z.ZodOptional<z.ZodBoolean>;
|
|
4621
4633
|
last_row: z.ZodOptional<z.ZodBoolean>;
|