allyhub 0.17.1 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/bin/allyhub.js +10 -0
- package/dist/args.js +1 -1
- package/dist/command.js +1 -1
- package/dist/commands/add.js +1 -1
- package/dist/commands/auth.js +1 -1
- package/dist/commands/cloud-tools.js +1 -1
- package/dist/commands/cloud.js +1 -1
- package/dist/commands/contributed.js +1 -1
- package/dist/commands/found-extensions.js +2 -0
- package/dist/commands/frames/common.js +1 -1
- package/dist/commands/frames/doc.js +1 -1
- package/dist/commands/frames.js +9 -9
- package/dist/commands/index.js +1 -1
- package/dist/commands/inspect/common.js +3 -3
- package/dist/commands/inspect/index.js +1 -1
- package/dist/commands/inspect/layout.js +1 -1
- package/dist/commands/inspect/views.js +1 -1
- package/dist/commands/list.js +2 -0
- package/dist/commands/mail.js +1 -1
- package/dist/commands/render.js +1 -1
- package/dist/commands/run-context.js +2 -0
- package/dist/commands.json +1 -0
- package/dist/fields.js +1 -1
- package/dist/main.js +7 -7
- package/dist/node_modules/@allyhub/3d-extension/dist/build.js +1 -1
- package/dist/node_modules/@allyhub/3d-extension/dist/scenery-build.js +1 -1
- package/dist/node_modules/@allyhub/3d-extension/package.json +3 -2
- 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/build-plugins.js +1 -1
- package/dist/node_modules/@allyhub/build/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/build/dist/meta-worker.js +1 -1
- package/dist/node_modules/@allyhub/build/dist/plugin.js +9 -9
- package/dist/node_modules/@allyhub/build/dist/prepare.js +3 -3
- package/dist/node_modules/@allyhub/build/dist/project-root.js +1 -1
- package/dist/node_modules/@allyhub/build/dist/scan.js +1 -1
- package/dist/node_modules/@allyhub/build/dist/sdk-parts.js +2 -0
- package/dist/node_modules/@allyhub/build/dist/vite.js +2 -2
- package/dist/node_modules/@allyhub/build/package.json +9 -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/dist/check.js +2 -2
- package/dist/node_modules/@allyhub/check/package.json +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/blobs.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/call.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/catalog.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/config.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/credentials.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/device.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/errors.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/loopback.js +2 -2
- package/dist/node_modules/@allyhub/cloud/dist/mail.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/records.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/signin.js +2 -2
- package/dist/node_modules/@allyhub/cloud/dist/sites.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/token.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/tools.js +2 -0
- package/dist/node_modules/@allyhub/cloud/dist/uploads.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/voice.js +1 -1
- package/dist/node_modules/@allyhub/cloud/package.json +5 -1
- package/dist/node_modules/@allyhub/components/package.json +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/offline-page.js +2 -0
- package/dist/node_modules/@allyhub/dev-server/dist/pages.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/project.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/record.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/tools.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/package.json +1 -1
- package/dist/node_modules/@allyhub/doc-extension/dist/cli/find.js +1 -1
- package/dist/node_modules/@allyhub/doc-extension/dist/workspace.js +1 -1
- 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/package.json +1 -1
- package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
- package/dist/node_modules/@allyhub/extension-host/dist/host.js +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/files.d.ts +4 -0
- package/dist/node_modules/@allyhub/formats/dist/items.d.ts +24 -7
- package/dist/node_modules/@allyhub/formats/dist/items.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/note-shape.d.ts +1 -1
- package/dist/node_modules/@allyhub/formats/package.json +25 -1
- package/dist/node_modules/@allyhub/html-extension/LICENSE +241 -0
- package/dist/node_modules/@allyhub/html-extension/dist/page.js +6 -0
- package/dist/node_modules/@allyhub/html-extension/dist/project-tools.js +21 -0
- package/dist/node_modules/@allyhub/html-extension/dist/tools.js +2 -0
- package/dist/node_modules/@allyhub/html-extension/markup/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/html-extension/markup/markup.json +15 -0
- package/dist/node_modules/@allyhub/html-extension/markup/pages/budget.html +36 -0
- package/dist/node_modules/@allyhub/html-extension/package.json +92 -0
- package/dist/node_modules/@allyhub/i18n/package.json +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 +1 -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/linkedin-view/src/style.css +1 -600
- package/dist/node_modules/@allyhub/measure/package.json +1 -1
- package/dist/node_modules/@allyhub/media/package.json +5 -1
- package/dist/node_modules/@allyhub/media-extension/dist/asr/hear.js +1 -1
- package/dist/node_modules/@allyhub/media-extension/dist/vision/track.js +1 -1
- package/dist/node_modules/@allyhub/media-extension/package.json +2 -1
- package/dist/node_modules/@allyhub/model/package.json +1 -1
- package/dist/node_modules/@allyhub/office-extension/package.json +4 -1
- package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
- package/dist/node_modules/@allyhub/piece/dist/layer.d.ts +1 -2
- package/dist/node_modules/@allyhub/piece/dist/media.d.ts +1 -1
- package/dist/node_modules/@allyhub/piece/dist/source.d.ts +2 -2
- package/dist/node_modules/@allyhub/piece/dist/stage.d.ts +2 -2
- package/dist/node_modules/@allyhub/piece/package.json +1 -1
- package/dist/node_modules/@allyhub/project/package.json +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/blobs.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/cli.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/errors.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/events.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/jsonrpc.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/kinds.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/mail.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/notes.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/paywall.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/purposes.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/registry.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/sites.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/teams.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub/protocol/package.json +41 -1
- package/dist/node_modules/@allyhub/registry/package.json +1 -1
- package/dist/node_modules/@allyhub/render/dist/errors.js +1 -1
- package/dist/node_modules/@allyhub/render/dist/post-probe.js +1 -1
- package/dist/node_modules/@allyhub/render/package.json +9 -1
- package/dist/node_modules/@allyhub/runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/runtimes/dist/bundled.js +1 -1
- package/dist/node_modules/@allyhub/runtimes/dist/declared.js +1 -1
- package/dist/node_modules/@allyhub/runtimes/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/runtimes/dist/manifest.js +1 -1
- package/dist/node_modules/@allyhub/runtimes/dist/runtimes.js +1 -1
- package/dist/node_modules/@allyhub/runtimes/manifest.json +1 -1
- package/dist/node_modules/@allyhub/runtimes/package.json +9 -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/dist/bundle.js +3 -3
- package/dist/node_modules/@allyhub/scenery-host/dist/fact.d.ts +1 -1
- package/dist/node_modules/@allyhub/scenery-host/dist/model-stage.js +2 -2
- package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/annotations.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/api/workbook.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/arrange.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/filter.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/generated.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/html.js +6 -6
- package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
- package/dist/node_modules/@allyhub/sheet/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/dist/cli/open.js +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/dist/code.js +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/dist/export.js +2 -2
- package/dist/node_modules/@allyhub/sheet-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/package.json +1 -1
- 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/fonts/arimo/400-italic.css +1 -79
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/arimo/400.css +1 -79
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/arimo/700-italic.css +1 -79
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/arimo/700.css +1 -79
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/arimo/arial.css +1 -316
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/400-italic.css +1 -19
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/400.css +1 -19
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/700-italic.css +1 -19
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/700.css +1 -19
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/caladea/cambria.css +1 -76
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/carlito/400-italic.css +1 -69
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/carlito/400.css +1 -69
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/carlito/700-italic.css +1 -69
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/carlito/700.css +1 -69
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/carlito/calibri.css +1 -276
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/400-italic.css +1 -79
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/400.css +1 -79
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/700-italic.css +1 -79
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/700.css +1 -79
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/cousine/courier-new.css +1 -316
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/noto-color-emoji/emoji.css +1 -8
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/noto-sans-sc/400.css +1 -1009
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/noto-sans-sc/700.css +1 -1009
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/noto-sans-sc/microsoft-yahei.css +1 -2018
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/400-italic.css +1 -79
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/400.css +1 -79
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/700-italic.css +1 -79
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/700.css +1 -79
- package/dist/node_modules/@allyhub/stage-page/dist/fonts/tinos/times-new-roman.css +1 -316
- package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
- package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/telemetry/dist/doc.js +1 -1
- package/dist/node_modules/@allyhub/telemetry/dist/errors.js +1 -1
- package/dist/node_modules/@allyhub/telemetry/dist/telemetry.js +2 -2
- package/dist/node_modules/@allyhub/telemetry/package.json +1 -1
- package/dist/node_modules/@allyhub/text-extension/package.json +2 -1
- package/dist/node_modules/@allyhub/video-core/package.json +1 -1
- package/dist/node_modules/@allyhub/video-extension/dist/build-plugins.js +1 -1
- package/dist/node_modules/@allyhub/video-extension/package.json +6 -2
- package/dist/node_modules/@allyhub/video-measure/dist/plans.js +2 -2
- package/dist/node_modules/@allyhub/video-measure/dist/reference/video.js +1 -1
- package/dist/node_modules/@allyhub/video-measure/package.json +5 -1
- package/dist/node_modules/@allyhub/video-sdk/dist/config.js +2 -0
- package/dist/node_modules/@allyhub/video-sdk/dist/piece.js +1 -1
- package/dist/node_modules/@allyhub/video-sdk/package.json +5 -1
- package/dist/node_modules/@allyhub/website/package.json +1 -1
- package/dist/node_modules/@allyhub/website-extension/dist/build.js +1 -1
- package/dist/node_modules/@allyhub/website-extension/package.json +4 -4
- package/dist/node_modules/@allyhub/x-extension/dist/build.js +1 -1
- package/dist/node_modules/@allyhub/x-extension/package.json +8 -2
- package/dist/node_modules/@allyhub/x-model/package.json +1 -1
- package/dist/node_modules/@allyhub/x-view/package.json +1 -1
- package/dist/node_modules/@allyhub/x-view/src/style.css +1 -709
- package/dist/package.json +14 -13
- package/dist/project.js +1 -1
- package/dist/resources.js +1 -1
- package/dist/sdk-docs.js +1 -1
- package/dist/slot.js +4 -0
- package/dist/telemetry.js +1 -1
- package/dist/version.js +1 -1
- package/editor-web/assets/{abnfDiagram-WEYOIA3C-CHNpVSPv.js → abnfDiagram-WEYOIA3C-DYaMS_BB.js} +1 -1
- package/editor-web/assets/{architecture-WOLXFQ4H-gPsJqQwV.js → architecture-WOLXFQ4H-g_Tjfl_y.js} +1 -1
- package/editor-web/assets/{architectureDiagram-ZHVYKT53-CEIDcC6r.js → architectureDiagram-ZHVYKT53-CqdhofOL.js} +1 -1
- package/editor-web/assets/article-8evPh712.js +3 -0
- package/editor-web/assets/{article-DfELjJ2o.js → article-BhRtWYMd.js} +2 -2
- package/editor-web/assets/{blockDiagram-RJAE7QA3-CUzEGVet.js → blockDiagram-RJAE7QA3-Bc-28Bci.js} +1 -1
- package/editor-web/assets/{c4Diagram-XDPPPE54-CB94NR9s.js → c4Diagram-XDPPPE54-CTGJb8FB.js} +1 -1
- package/editor-web/assets/{calc-worker-BdHh5LXM.js → calc-worker-oEIqrrTM.js} +1 -1
- package/editor-web/assets/channel-wIj_OqDm.js +1 -0
- package/editor-web/assets/{chart-file-CfbWK9l1.js → chart-file-dGiRgFcH.js} +1 -1
- package/editor-web/assets/{chunk-2E7WHVMD-DFYo_Boi.js → chunk-2E7WHVMD-B2MPOVTU.js} +1 -1
- package/editor-web/assets/{chunk-4EMNKR2T-CLLjmweX.js → chunk-4EMNKR2T-BUV1ZHP0.js} +1 -1
- package/editor-web/assets/{chunk-55XCU76K-CkwQ_3m1.js → chunk-55XCU76K-BZlpspL5.js} +1 -1
- package/editor-web/assets/{chunk-7S6XSTFO-V-AvHpAB.js → chunk-7S6XSTFO-CpKeisWE.js} +1 -1
- package/editor-web/assets/{chunk-AQDTSKZB-PjHyYpb8.js → chunk-AQDTSKZB-BJqwAPyo.js} +1 -1
- package/editor-web/assets/{chunk-DSNLSHJZ-QaczBS3J.js → chunk-DSNLSHJZ-D6oPWl_W.js} +1 -1
- package/editor-web/assets/{chunk-HAGFOTED-aLaQB5Xu.js → chunk-HAGFOTED-B5pk4MZF.js} +1 -1
- package/editor-web/assets/{chunk-HNE4Q36P-De3ftDQR.js → chunk-HNE4Q36P-DHbSPvxQ.js} +1 -1
- package/editor-web/assets/{chunk-NQOKRVIF-CrhVQyvP.js → chunk-NQOKRVIF-CcL_GcRA.js} +1 -1
- package/editor-web/assets/{chunk-UHW7PFBP-BFmZ5ZLn.js → chunk-UHW7PFBP-YgiOL6XE.js} +1 -1
- package/editor-web/assets/{chunk-VQ5W62QI-CzppUHLA.js → chunk-VQ5W62QI-p14b4UYc.js} +1 -1
- package/editor-web/assets/{chunk-WQQL4CDK-BrAU7V6v.js → chunk-WQQL4CDK-BWW0x-XH.js} +1 -1
- package/editor-web/assets/{chunk-YZO67HFG-BSiF71qj.js → chunk-YZO67HFG-oG3qd68C.js} +1 -1
- package/editor-web/assets/{chunk-ZAUX2LTX-BJc4r5b1.js → chunk-ZAUX2LTX-CpcheH0u.js} +1 -1
- package/editor-web/assets/{chunk-ZCHMQSOR-CkGTuehB.js → chunk-ZCHMQSOR-cWQvLl1w.js} +1 -1
- package/editor-web/assets/{classDiagram-v2-4MYWR3UA-Byxc7J88.js → classDiagram-v2-4MYWR3UA-7PG7YcdU.js} +1 -1
- package/editor-web/assets/{cynefin-EF2NZ3EQ-BSxkVbdf.js → cynefin-EF2NZ3EQ-CtcknEQ_.js} +1 -1
- package/editor-web/assets/{cynefinDiagram-WF24UDRP-IkCgARNs.js → cynefinDiagram-WF24UDRP-Ca7VIsjN.js} +1 -1
- package/editor-web/assets/{dagre-NK4GIZVX-9PgeH6nY.js → dagre-NK4GIZVX-BzcSLtsr.js} +1 -1
- package/editor-web/assets/deck-C7fN0Qtn.js +1 -0
- package/editor-web/assets/{diagram-CBK3MWTC-DRzeg3Ds.js → diagram-CBK3MWTC-DpRmTGlG.js} +1 -1
- package/editor-web/assets/{diagram-I5XIIV2D-B_zeKMN6.js → diagram-I5XIIV2D-BTrs_AX8.js} +1 -1
- package/editor-web/assets/{diagram-ODIL2UCW-FFm0O8SN.js → diagram-ODIL2UCW-CkIVjPqH.js} +1 -1
- package/editor-web/assets/{diagram-PFBEJUXE-DrtCT8OA.js → diagram-PFBEJUXE-BlFMbAG1.js} +1 -1
- package/editor-web/assets/{diagram-RJA3I4VV-DtxJ3V0q.js → diagram-RJA3I4VV-D3f8VJ-D.js} +1 -1
- package/editor-web/assets/{diagram-TYUNFSNR-DmxF_8H_.js → diagram-TYUNFSNR-Bbpngj6F.js} +1 -1
- package/editor-web/assets/{dist-bQKpw3Zz.js → dist-3iovns9K.js} +3 -3
- package/editor-web/assets/dist-BkHnbOEj.js +4 -0
- package/editor-web/assets/dist-BvOrNcK-.js +19 -0
- package/editor-web/assets/dist-CEIszq39.js +1 -0
- package/editor-web/assets/dist-CU5RbLNH.js +1 -0
- package/editor-web/assets/dist-CWZj8IAm.js +1 -0
- package/editor-web/assets/{dist-PBbWAsrV.js → dist-C_Mtrnif.js} +3 -3
- package/editor-web/assets/{dist-CEknsRDd.js → dist-CdqpwdCV.js} +4 -4
- package/editor-web/assets/{dist-CAb3W9_P.js → dist-CjT76RAw.js} +1 -1
- package/editor-web/assets/dist-CpzEn9T8.js +6 -0
- package/editor-web/assets/dist-CrFYWl5-.js +3 -0
- package/editor-web/assets/{dist-Dr3o4vee.js → dist-D4eBFGVL.js} +1 -1
- package/editor-web/assets/dist-DTcjb3cP.js +18 -0
- package/editor-web/assets/dist-D_WSM29I.js +17 -0
- package/editor-web/assets/{dist-C21CkR7Z.js → dist-Dp_9ISjP.js} +12 -12
- package/editor-web/assets/{dist-C56mWAec.js → dist-J-tPYKGS.js} +4 -4
- package/editor-web/assets/{docx-draw-9Q_fArBC.js → docx-draw-CoK1oqQD.js} +1 -1
- package/editor-web/assets/{ebnfDiagram-V4P3TTPT-DSX1Aoty.js → ebnfDiagram-V4P3TTPT-BaKj-yL6.js} +1 -1
- package/editor-web/assets/{elk-QONTBCTQ-C7gy9q56.js → elk-QONTBCTQ-Cn2qv1_U.js} +1 -1
- package/editor-web/assets/{erDiagram-KYQIGQAA-CKx_HoY4.js → erDiagram-KYQIGQAA-Bd7AEIDo.js} +1 -1
- package/editor-web/assets/{esm-BZb5QMQf.js → esm-Cjv8ogpP.js} +1 -1
- package/editor-web/assets/{eventmodeling-K75KTNOO-DL4HvSrd.js → eventmodeling-K75KTNOO-Sfp7_461.js} +1 -1
- package/editor-web/assets/flowDiagram-IUGLLWBU-BlVUglzw.js +1 -0
- package/editor-web/assets/{ganttDiagram-R7GPNTJY-N-AP4slN.js → ganttDiagram-R7GPNTJY-CBqcGdHI.js} +1 -1
- package/editor-web/assets/{gitGraph-VSP46ZUC-BKRGJKWm.js → gitGraph-VSP46ZUC-WTokXKTW.js} +1 -1
- package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-ClwL7w2_.js → gitGraphDiagram-PDYL7XHY-BIWZHD9q.js} +1 -1
- package/editor-web/assets/index-BQWZnyAQ.js +28 -0
- package/editor-web/assets/index-Dvh1t1om.css +2 -0
- package/editor-web/assets/{info-OHQRW6UA-DpcY8t23.js → info-OHQRW6UA-COC6G-_J.js} +1 -1
- package/editor-web/assets/{infoDiagram-MVDRKAX5-ChtmtWni.js → infoDiagram-MVDRKAX5-DpaqdKBD.js} +1 -1
- package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-BZNTuG_F.js → ishikawaDiagram-HPEHV2GE-Dyn2MAy1.js} +1 -1
- package/editor-web/assets/{iso-ahTwmFwH.js → iso-DoC-ZoBr.js} +1 -1
- package/editor-web/assets/{journeyDiagram-BOSHW7O7-C3uVmZbL.js → journeyDiagram-BOSHW7O7-DeSVfmm7.js} +1 -1
- package/editor-web/assets/{kanban-definition-FNSA4HC5-puEhftGG.js → kanban-definition-FNSA4HC5-Bfg0lj7B.js} +1 -1
- package/editor-web/assets/{mermaid-parser.core-Bw8re-WE.js → mermaid-parser.core-CyhovuYE.js} +3 -3
- package/editor-web/assets/{mermaid.core-Cc2GIqBr.js → mermaid.core-Dx1fBVUG.js} +4 -4
- package/editor-web/assets/{mindmap-definition-6OY57UG3-C6MUl_S_.js → mindmap-definition-6OY57UG3-QEU2HF_m.js} +1 -1
- package/editor-web/assets/{packet-JDAUHWVQ-C75RnvC5.js → packet-JDAUHWVQ-ReJTa_hw.js} +1 -1
- package/editor-web/assets/{pegDiagram-ECIUJNBX-ChjmsdV4.js → pegDiagram-ECIUJNBX-Bo1jFrvb.js} +1 -1
- package/editor-web/assets/{pie-XZMESJXO-BaKxJQpj.js → pie-XZMESJXO-BrtYafNA.js} +1 -1
- package/editor-web/assets/{pieDiagram-GNMPY74T-CT2ez8pr.js → pieDiagram-GNMPY74T-Cj0zQqs_.js} +1 -1
- package/editor-web/assets/{props-form-D5oKHfpk.js → props-form-BpSXbrSF.js} +1 -1
- package/editor-web/assets/{quadrantDiagram-D57K4MC3-BJItlTfk.js → quadrantDiagram-D57K4MC3-D5npDAVn.js} +1 -1
- package/editor-web/assets/{radar-ABXABTNO-DnLzBlTo.js → radar-ABXABTNO-C8RDrRqi.js} +1 -1
- package/editor-web/assets/{railroad-I3PHUGI6-D5hj6Yv3.js → railroad-I3PHUGI6-ebDrmYTK.js} +1 -1
- package/editor-web/assets/{railroad-abnf-LNEFI6M7-DUZlZoPu.js → railroad-abnf-LNEFI6M7-BxKuqg6V.js} +1 -1
- package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-CDyyDC6d.js → railroad-ebnf-DWYD2UWJ-DOclnfpr.js} +1 -1
- package/editor-web/assets/{railroad-peg-JR7BVNR7-CC3ImNnT.js → railroad-peg-JR7BVNR7-DN0A1fpq.js} +1 -1
- package/editor-web/assets/{railroadDiagram-Y72NRBL7-Bjw-8Se5.js → railroadDiagram-Y72NRBL7-B3PjoVWw.js} +1 -1
- package/editor-web/assets/{requirementDiagram-EQYSW5RA-CDFnuEIO.js → requirementDiagram-EQYSW5RA-DLdzkQk5.js} +1 -1
- package/editor-web/assets/{sankeyDiagram-SY24JHO5-CQPVLY1w.js → sankeyDiagram-SY24JHO5-Dip4Piv_.js} +1 -1
- package/editor-web/assets/schemas-CQ_UU8-Z.js +1 -0
- package/editor-web/assets/{sequenceDiagram-BLEHNHQU-BQzuLmBX.js → sequenceDiagram-BLEHNHQU-QnPcoybL.js} +1 -1
- package/editor-web/assets/{session-s1I85rox.js → session-DMlLCFWg.js} +1 -1
- package/editor-web/assets/slides-7xWhREpt.js +1 -0
- package/editor-web/assets/snapshots-BLX4NTQC.js +1 -0
- package/editor-web/assets/{split-7CVjIkSU.js → split-tFGKk-x8.js} +1 -1
- package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-DOuageUf.js → stateDiagram-v2-A6IESKWZ-D103CiMX.js} +1 -1
- package/editor-web/assets/{swimlanes-B3ENRKFQ-CXKkok7X.js → swimlanes-B3ENRKFQ-y4gCqEoa.js} +1 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-DKzB_wSf.js +8 -0
- package/editor-web/assets/tabs-CuEawka3.js +1 -0
- package/editor-web/assets/{timeline-definition-JXYKGLGB-DgAjAeZp.js → timeline-definition-JXYKGLGB-BMp76v4V.js} +1 -1
- package/editor-web/assets/{treeView-D4JQ5SDB-C0Xvnhck.js → treeView-D4JQ5SDB-Q_GYyk0b.js} +1 -1
- package/editor-web/assets/{treemap-SAJKECNS-aXfKAeSX.js → treemap-SAJKECNS-B5lRWdQB.js} +1 -1
- package/editor-web/assets/{usecaseDiagram-WPOLBNNX-CvUlBa-L.js → usecaseDiagram-WPOLBNNX--QRllA-U.js} +1 -1
- package/editor-web/assets/{vennDiagram-Q3Y3IDCW-qMJ1iCxs.js → vennDiagram-Q3Y3IDCW-CzkATPA3.js} +1 -1
- package/editor-web/assets/{video-DQrjo1TI.js → video-D0uTbHWx.js} +1 -1
- package/editor-web/assets/{wardley-7MLQ67FV-DEdnH0by.js → wardley-7MLQ67FV-BXzwcdJa.js} +1 -1
- package/editor-web/assets/{wardleyDiagram-IVAIDKWA-Bt-B2hQ5.js → wardleyDiagram-IVAIDKWA-BQvC8Agx.js} +1 -1
- package/editor-web/assets/{words-0Ww2RyT4.js → words-CaUHhQHf.js} +1 -1
- package/editor-web/assets/workbook-CiCXkjmN.js +45 -0
- package/editor-web/assets/{xychartDiagram-4URNHDU4-DV4bSzTb.js → xychartDiagram-4URNHDU4-aY-lsD5o.js} +1 -1
- package/editor-web/index.html +4 -4
- package/package.json +2 -2
- package/dist/node_modules/@allyhub/browser/dist/browser.d.ts +0 -24
- package/dist/node_modules/@allyhub/browser/dist/capture.d.ts +0 -61
- package/dist/node_modules/@allyhub/browser/dist/cdp.d.ts +0 -51
- package/dist/node_modules/@allyhub/browser/dist/emoji.d.ts +0 -29
- package/dist/node_modules/@allyhub/browser/dist/flags.d.ts +0 -13
- package/dist/node_modules/@allyhub/browser/dist/frames.d.ts +0 -35
- package/dist/node_modules/@allyhub/browser/dist/html.d.ts +0 -19
- package/dist/node_modules/@allyhub/browser/dist/index.d.ts +0 -10
- package/dist/node_modules/@allyhub/browser/dist/launch.d.ts +0 -35
- package/dist/node_modules/@allyhub/browser/dist/page.d.ts +0 -74
- package/dist/node_modules/@allyhub/browser/dist/picture.d.ts +0 -18
- package/dist/node_modules/@allyhub/browser/dist/server.d.ts +0 -26
- package/dist/node_modules/@allyhub/build/dist/build-plugins.d.ts +0 -91
- package/dist/node_modules/@allyhub/build/dist/cli-command.d.ts +0 -84
- package/dist/node_modules/@allyhub/build/dist/code.d.ts +0 -26
- package/dist/node_modules/@allyhub/build/dist/content.d.ts +0 -64
- package/dist/node_modules/@allyhub/build/dist/data.d.ts +0 -11
- package/dist/node_modules/@allyhub/build/dist/evaluate.d.ts +0 -44
- package/dist/node_modules/@allyhub/build/dist/file-check.d.ts +0 -35
- package/dist/node_modules/@allyhub/build/dist/files.d.ts +0 -4
- package/dist/node_modules/@allyhub/build/dist/fonts.d.ts +0 -26
- package/dist/node_modules/@allyhub/build/dist/generated.d.ts +0 -29
- package/dist/node_modules/@allyhub/build/dist/imports.d.ts +0 -17
- package/dist/node_modules/@allyhub/build/dist/index.d.ts +0 -37
- package/dist/node_modules/@allyhub/build/dist/inspect-view.d.ts +0 -119
- package/dist/node_modules/@allyhub/build/dist/kind-build.d.ts +0 -530
- package/dist/node_modules/@allyhub/build/dist/made-notes.d.ts +0 -9
- package/dist/node_modules/@allyhub/build/dist/matrix.d.ts +0 -19
- package/dist/node_modules/@allyhub/build/dist/media.d.ts +0 -10
- package/dist/node_modules/@allyhub/build/dist/messages.d.ts +0 -60
- package/dist/node_modules/@allyhub/build/dist/meta-worker.d.ts +0 -59
- package/dist/node_modules/@allyhub/build/dist/meta.d.ts +0 -24
- package/dist/node_modules/@allyhub/build/dist/model-info.d.ts +0 -6
- package/dist/node_modules/@allyhub/build/dist/move-refs.d.ts +0 -16
- package/dist/node_modules/@allyhub/build/dist/places.d.ts +0 -23
- package/dist/node_modules/@allyhub/build/dist/plugin.d.ts +0 -50
- package/dist/node_modules/@allyhub/build/dist/prepare.d.ts +0 -138
- package/dist/node_modules/@allyhub/build/dist/project-root.d.ts +0 -19
- package/dist/node_modules/@allyhub/build/dist/project-tool.d.ts +0 -133
- package/dist/node_modules/@allyhub/build/dist/references.d.ts +0 -6
- package/dist/node_modules/@allyhub/build/dist/scan.d.ts +0 -45
- package/dist/node_modules/@allyhub/build/dist/stage-route.d.ts +0 -80
- package/dist/node_modules/@allyhub/build/dist/takes.d.ts +0 -9
- package/dist/node_modules/@allyhub/build/dist/types.d.ts +0 -11
- package/dist/node_modules/@allyhub/build/dist/uses.d.ts +0 -44
- package/dist/node_modules/@allyhub/build/dist/version.d.ts +0 -56
- package/dist/node_modules/@allyhub/build/dist/vite.d.ts +0 -115
- package/dist/node_modules/@allyhub/build/dist/work.d.ts +0 -38
- package/dist/node_modules/@allyhub/cloud/dist/blobs.d.ts +0 -29
- package/dist/node_modules/@allyhub/cloud/dist/call.d.ts +0 -91
- package/dist/node_modules/@allyhub/cloud/dist/catalog.d.ts +0 -12
- package/dist/node_modules/@allyhub/cloud/dist/client.d.ts +0 -64
- package/dist/node_modules/@allyhub/cloud/dist/config.d.ts +0 -40
- package/dist/node_modules/@allyhub/cloud/dist/credentials.d.ts +0 -76
- package/dist/node_modules/@allyhub/cloud/dist/device.d.ts +0 -14
- package/dist/node_modules/@allyhub/cloud/dist/errors.d.ts +0 -24
- package/dist/node_modules/@allyhub/cloud/dist/hashes.d.ts +0 -43
- package/dist/node_modules/@allyhub/cloud/dist/index.d.ts +0 -19
- package/dist/node_modules/@allyhub/cloud/dist/keychain.d.ts +0 -18
- package/dist/node_modules/@allyhub/cloud/dist/loopback.d.ts +0 -22
- package/dist/node_modules/@allyhub/cloud/dist/mail.d.ts +0 -16
- package/dist/node_modules/@allyhub/cloud/dist/pkce.d.ts +0 -11
- package/dist/node_modules/@allyhub/cloud/dist/records.d.ts +0 -42
- package/dist/node_modules/@allyhub/cloud/dist/signin-worker.d.ts +0 -2
- package/dist/node_modules/@allyhub/cloud/dist/signin.d.ts +0 -48
- package/dist/node_modules/@allyhub/cloud/dist/sites.d.ts +0 -20
- package/dist/node_modules/@allyhub/cloud/dist/token.d.ts +0 -20
- package/dist/node_modules/@allyhub/cloud/dist/uploads.d.ts +0 -58
- package/dist/node_modules/@allyhub/cloud/dist/voice.d.ts +0 -22
- package/dist/node_modules/@allyhub/jobs/dist/index.d.ts +0 -3
- package/dist/node_modules/@allyhub/jobs/dist/jobs.d.ts +0 -139
- package/dist/node_modules/@allyhub/jobs/dist/show.d.ts +0 -41
- package/dist/node_modules/@allyhub/measure/dist/compare.d.ts +0 -195
- package/dist/node_modules/@allyhub/measure/dist/grain.d.ts +0 -8
- package/dist/node_modules/@allyhub/measure/dist/image.d.ts +0 -16
- package/dist/node_modules/@allyhub/measure/dist/index.d.ts +0 -4
- package/dist/node_modules/@allyhub/media/dist/analysis.d.ts +0 -25
- package/dist/node_modules/@allyhub/media/dist/audio.d.ts +0 -16
- package/dist/node_modules/@allyhub/media/dist/beats.d.ts +0 -100
- package/dist/node_modules/@allyhub/media/dist/cache.d.ts +0 -26
- package/dist/node_modules/@allyhub/media/dist/errors.d.ts +0 -34
- package/dist/node_modules/@allyhub/media/dist/fetch.d.ts +0 -11
- package/dist/node_modules/@allyhub/media/dist/grid.d.ts +0 -101
- package/dist/node_modules/@allyhub/media/dist/index.d.ts +0 -21
- package/dist/node_modules/@allyhub/media/dist/picture.d.ts +0 -130
- package/dist/node_modules/@allyhub/media/dist/probe.d.ts +0 -52
- package/dist/node_modules/@allyhub/media/dist/progress.d.ts +0 -16
- package/dist/node_modules/@allyhub/media/dist/run.d.ts +0 -25
- package/dist/node_modules/@allyhub/media/dist/sheet.d.ts +0 -67
- package/dist/node_modules/@allyhub/media/dist/shots.d.ts +0 -110
- package/dist/node_modules/@allyhub/media/dist/sync.d.ts +0 -156
- package/dist/node_modules/@allyhub/media/dist/tools.d.ts +0 -25
- package/dist/node_modules/@allyhub/media/dist/video.d.ts +0 -35
- package/dist/node_modules/@allyhub/media/dist/vision/cache.d.ts +0 -42
- package/dist/node_modules/@allyhub/media/dist/vision/probe.d.ts +0 -39
- package/dist/node_modules/@allyhub/media/dist/vision/types.d.ts +0 -2
- package/dist/node_modules/@allyhub/media/dist/voice-shape.d.ts +0 -51
- package/dist/node_modules/@allyhub/model/dist/authoring.d.ts +0 -48
- package/dist/node_modules/@allyhub/model/dist/bevel-attributes.d.ts +0 -19
- package/dist/node_modules/@allyhub/model/dist/bevel-collapse.d.ts +0 -12
- package/dist/node_modules/@allyhub/model/dist/bevel-corner-plan.d.ts +0 -24
- package/dist/node_modules/@allyhub/model/dist/bevel-deform.d.ts +0 -5
- package/dist/node_modules/@allyhub/model/dist/bevel-fans.d.ts +0 -12
- package/dist/node_modules/@allyhub/model/dist/bevel-junction.d.ts +0 -16
- package/dist/node_modules/@allyhub/model/dist/bevel-marks.d.ts +0 -14
- package/dist/node_modules/@allyhub/model/dist/bevel-metric.d.ts +0 -4
- package/dist/node_modules/@allyhub/model/dist/bevel-mixed.d.ts +0 -12
- package/dist/node_modules/@allyhub/model/dist/bevel-offsets.d.ts +0 -22
- package/dist/node_modules/@allyhub/model/dist/bevel-patch.d.ts +0 -45
- package/dist/node_modules/@allyhub/model/dist/bevel-profile.d.ts +0 -13
- package/dist/node_modules/@allyhub/model/dist/bevel-projection.d.ts +0 -10
- package/dist/node_modules/@allyhub/model/dist/bevel-reflex.d.ts +0 -10
- package/dist/node_modules/@allyhub/model/dist/bevel-square-out.d.ts +0 -18
- package/dist/node_modules/@allyhub/model/dist/bevel-strips.d.ts +0 -8
- package/dist/node_modules/@allyhub/model/dist/bmesh-cycles.d.ts +0 -52
- package/dist/node_modules/@allyhub/model/dist/build-cache.d.ts +0 -42
- package/dist/node_modules/@allyhub/model/dist/build-job.d.ts +0 -34
- package/dist/node_modules/@allyhub/model/dist/build-worker.d.ts +0 -2
- package/dist/node_modules/@allyhub/model/dist/build.d.ts +0 -67
- package/dist/node_modules/@allyhub/model/dist/cancel.d.ts +0 -8
- package/dist/node_modules/@allyhub/model/dist/curve-math.d.ts +0 -21
- package/dist/node_modules/@allyhub/model/dist/curve-mesh.d.ts +0 -30
- package/dist/node_modules/@allyhub/model/dist/evaluation-guard.d.ts +0 -11
- package/dist/node_modules/@allyhub/model/dist/export.d.ts +0 -12
- package/dist/node_modules/@allyhub/model/dist/mesh-queries.d.ts +0 -34
- package/dist/node_modules/@allyhub/model/dist/names.d.ts +0 -9
- package/dist/node_modules/@allyhub/model/dist/png.d.ts +0 -12
- package/dist/node_modules/@allyhub/model/dist/polygon-triangulation.d.ts +0 -4
- package/dist/node_modules/@allyhub/model/dist/program-location.d.ts +0 -7
- package/dist/node_modules/@allyhub/model/dist/report.d.ts +0 -70
- package/dist/node_modules/@allyhub/piece/dist/page/console.d.ts +0 -21
- package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +0 -4
- package/dist/node_modules/@allyhub/piece/dist/page/locate.d.ts +0 -17
- package/dist/node_modules/@allyhub/piece/dist/page/runtimes.d.ts +0 -9
- package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +0 -661
- package/dist/node_modules/@allyhub/protocol/dist/account.js +0 -2
- package/dist/node_modules/@allyhub/protocol/dist/app.d.ts +0 -30
- package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +0 -200
- package/dist/node_modules/@allyhub/protocol/dist/blobs.d.ts +0 -44
- package/dist/node_modules/@allyhub/protocol/dist/cli.d.ts +0 -68
- package/dist/node_modules/@allyhub/protocol/dist/cloud-computer.d.ts +0 -77
- package/dist/node_modules/@allyhub/protocol/dist/cloud-computer.js +0 -2
- package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +0 -577
- package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +0 -674
- package/dist/node_modules/@allyhub/protocol/dist/errors.d.ts +0 -7
- package/dist/node_modules/@allyhub/protocol/dist/events.d.ts +0 -803
- package/dist/node_modules/@allyhub/protocol/dist/files.d.ts +0 -103
- package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +0 -247
- package/dist/node_modules/@allyhub/protocol/dist/image.d.ts +0 -8
- package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +0 -38
- package/dist/node_modules/@allyhub/protocol/dist/jobs.d.ts +0 -91
- package/dist/node_modules/@allyhub/protocol/dist/jsonrpc.d.ts +0 -83
- package/dist/node_modules/@allyhub/protocol/dist/kinds.d.ts +0 -143
- package/dist/node_modules/@allyhub/protocol/dist/mail.d.ts +0 -274
- package/dist/node_modules/@allyhub/protocol/dist/notes.d.ts +0 -211
- package/dist/node_modules/@allyhub/protocol/dist/open.d.ts +0 -13
- package/dist/node_modules/@allyhub/protocol/dist/paywall.d.ts +0 -134
- package/dist/node_modules/@allyhub/protocol/dist/peer.d.ts +0 -59
- package/dist/node_modules/@allyhub/protocol/dist/peer.js +0 -2
- package/dist/node_modules/@allyhub/protocol/dist/place.d.ts +0 -21
- package/dist/node_modules/@allyhub/protocol/dist/presence.d.ts +0 -125
- package/dist/node_modules/@allyhub/protocol/dist/purposes.d.ts +0 -47
- package/dist/node_modules/@allyhub/protocol/dist/registry.d.ts +0 -191
- package/dist/node_modules/@allyhub/protocol/dist/routes.d.ts +0 -14
- package/dist/node_modules/@allyhub/protocol/dist/routes.js +0 -2
- package/dist/node_modules/@allyhub/protocol/dist/runtimes.d.ts +0 -96
- package/dist/node_modules/@allyhub/protocol/dist/shape.d.ts +0 -35
- package/dist/node_modules/@allyhub/protocol/dist/shape.js +0 -2
- package/dist/node_modules/@allyhub/protocol/dist/shares.d.ts +0 -156
- package/dist/node_modules/@allyhub/protocol/dist/shares.js +0 -2
- package/dist/node_modules/@allyhub/protocol/dist/sidebar-deletion.d.ts +0 -34
- package/dist/node_modules/@allyhub/protocol/dist/sidebar-deletion.js +0 -2
- package/dist/node_modules/@allyhub/protocol/dist/sites.d.ts +0 -298
- package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +0 -496
- package/dist/node_modules/@allyhub/protocol/dist/sources.d.ts +0 -14
- package/dist/node_modules/@allyhub/protocol/dist/studio-server.d.ts +0 -264
- package/dist/node_modules/@allyhub/protocol/dist/studio-server.js +0 -2
- package/dist/node_modules/@allyhub/protocol/dist/studio-tool-calls.d.ts +0 -18
- package/dist/node_modules/@allyhub/protocol/dist/studio-tool-calls.js +0 -2
- package/dist/node_modules/@allyhub/protocol/dist/studio-window-requests.d.ts +0 -97
- package/dist/node_modules/@allyhub/protocol/dist/studio-window-requests.js +0 -2
- package/dist/node_modules/@allyhub/protocol/dist/teams.d.ts +0 -203
- package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +0 -578
- package/dist/node_modules/@allyhub/protocol/dist/turns.d.ts +0 -71
- package/dist/node_modules/@allyhub/protocol/dist/turns.js +0 -2
- package/dist/node_modules/@allyhub/runtimes/dist/bundled.d.ts +0 -10
- package/dist/node_modules/@allyhub/runtimes/dist/declared.d.ts +0 -14
- package/dist/node_modules/@allyhub/runtimes/dist/download.d.ts +0 -38
- package/dist/node_modules/@allyhub/runtimes/dist/errors.d.ts +0 -20
- package/dist/node_modules/@allyhub/runtimes/dist/ffmpeg.d.ts +0 -15
- package/dist/node_modules/@allyhub/runtimes/dist/home.d.ts +0 -2
- package/dist/node_modules/@allyhub/runtimes/dist/index.d.ts +0 -12
- package/dist/node_modules/@allyhub/runtimes/dist/lock.d.ts +0 -14
- package/dist/node_modules/@allyhub/runtimes/dist/manifest.d.ts +0 -3
- package/dist/node_modules/@allyhub/runtimes/dist/node-program.d.ts +0 -12
- package/dist/node_modules/@allyhub/runtimes/dist/packages.d.ts +0 -101
- package/dist/node_modules/@allyhub/runtimes/dist/runtimes.d.ts +0 -73
- package/dist/node_modules/@allyhub/runtimes/dist/unpack.d.ts +0 -14
- package/dist/node_modules/@allyhub/scenery-host/dist/allyhub.d.ts +0 -20
- package/dist/node_modules/@allyhub/scenery-host/dist/bake/digest.d.ts +0 -14
- package/dist/node_modules/@allyhub/scenery-host/dist/bake/envmap.d.ts +0 -21
- package/dist/node_modules/@allyhub/scenery-host/dist/bake/run.d.ts +0 -63
- package/dist/node_modules/@allyhub/scenery-host/dist/budget.d.ts +0 -40
- package/dist/node_modules/@allyhub/scenery-host/dist/bundle.d.ts +0 -92
- package/dist/node_modules/@allyhub/scenery-host/dist/commands.d.ts +0 -54
- package/dist/node_modules/@allyhub/scenery-host/dist/draw2d.d.ts +0 -47
- package/dist/node_modules/@allyhub/scenery-host/dist/glass.d.ts +0 -39
- package/dist/node_modules/@allyhub/scenery-host/dist/index.d.ts +0 -25
- package/dist/node_modules/@allyhub/scenery-host/dist/inventory.d.ts +0 -18
- package/dist/node_modules/@allyhub/scenery-host/dist/layer/fidelity.d.ts +0 -70
- package/dist/node_modules/@allyhub/scenery-host/dist/layer/grade.d.ts +0 -7
- package/dist/node_modules/@allyhub/scenery-host/dist/layer/moire.d.ts +0 -6
- package/dist/node_modules/@allyhub/scenery-host/dist/measure/contacts.d.ts +0 -45
- package/dist/node_modules/@allyhub/scenery-host/dist/measure/health.d.ts +0 -10
- package/dist/node_modules/@allyhub/scenery-host/dist/measure/index.d.ts +0 -110
- package/dist/node_modules/@allyhub/scenery-host/dist/measure/relations.d.ts +0 -17
- package/dist/node_modules/@allyhub/scenery-host/dist/measure/solid.d.ts +0 -32
- package/dist/node_modules/@allyhub/scenery-host/dist/measure/support.d.ts +0 -11
- package/dist/node_modules/@allyhub/scenery-host/dist/model-stage.d.ts +0 -32
- package/dist/node_modules/@allyhub/scenery-host/dist/queries/inventory.d.ts +0 -5
- package/dist/node_modules/@allyhub/scenery-host/dist/queries/map.d.ts +0 -5
- package/dist/node_modules/@allyhub/scenery-host/dist/queries/view.d.ts +0 -10
- package/dist/node_modules/@allyhub/scenery-host/dist/scene.d.ts +0 -35
- package/dist/node_modules/@allyhub/scenery-host/dist/screen-dom.d.ts +0 -24
- package/dist/node_modules/@allyhub/scenery-host/dist/stage/bakes.d.ts +0 -42
- package/dist/node_modules/@allyhub/scenery-host/dist/stage/index.d.ts +0 -6
- package/dist/node_modules/@allyhub/scenery-host/dist/stage/page.d.ts +0 -70
- package/dist/node_modules/@allyhub/scenery-host/dist/stage/solve.d.ts +0 -49
- package/dist/node_modules/@allyhub/scenery-host/dist/stage/version.d.ts +0 -73
- package/dist/node_modules/@allyhub/scenery-host/dist/stage/view.d.ts +0 -18
- package/dist/node_modules/@allyhub/scenery-host/dist/steady.d.ts +0 -4
- package/dist/node_modules/@allyhub/scenery-host/dist/viewer.d.ts +0 -134
- package/editor-web/assets/article-BHTjq0_Y.js +0 -3
- package/editor-web/assets/channel-DCDCx5Es.js +0 -1
- package/editor-web/assets/deck-tTzKONci.js +0 -1
- package/editor-web/assets/dist-BEpzsYn_.js +0 -6
- package/editor-web/assets/dist-BUD4ywMB.js +0 -18
- package/editor-web/assets/dist-CbZAznNW.js +0 -19
- package/editor-web/assets/dist-DDzjbKIg.js +0 -4
- package/editor-web/assets/dist-DaEbElXI.js +0 -3
- package/editor-web/assets/dist-JLyDtl9X.js +0 -1
- package/editor-web/assets/dist-ZZlQa66J.js +0 -1
- package/editor-web/assets/dist-d4dayaWE.js +0 -17
- package/editor-web/assets/flowDiagram-IUGLLWBU-BUnRtJ8q.js +0 -1
- package/editor-web/assets/index-BedbINE5.css +0 -2
- package/editor-web/assets/index-DG2nHq4D.js +0 -28
- package/editor-web/assets/schemas-moE_A7Nj.js +0 -1
- package/editor-web/assets/slides-oQ_C0SVJ.js +0 -1
- package/editor-web/assets/snapshots-BPJKywuN.js +0 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-C3Car2M0.js +0 -8
- package/editor-web/assets/tabs-CiF1N-pL.js +0 -1
- package/editor-web/assets/workbook-FSSUiIp9.js +0 -45
- /package/dist/node_modules/@allyhub/{protocol/dist/runtimes.js → runtimes/dist/schema.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{AsyncLocalStorage as _}from"node:async_hooks";import{createHash as b}from"node:crypto";import{BACKGROUND_HEADER as A,
|
|
2
|
+
import{AsyncLocalStorage as _}from"node:async_hooks";import{createHash as b}from"node:crypto";import{BACKGROUND_HEADER as A,DEVICE_HEADER as E,ORGANIZATION_HEADER as g}from"@allyhub/protocol/auth";import{COMMAND_LINE_PAYWALL_MET as O,paywallNumbersOfData as k,paywallReasonOfCode as S}from"@allyhub/protocol/paywall";import{EXIT as c}from"@allyhub/protocol/cli";import{IDEMPOTENCY_KEY_HEADER as $,planPageAddress as y}from"@allyhub/protocol/cloud";import{accessOf as N,SignedOut as x}from"./credentials.js";import{userAgent as z}from"./device.js";import{CloudError as h,notSignedIn as p,unreachable as m}from"./errors.js";export function scrub(u,n){let t=u.replace(/(authorization)\s*[:=]\s*[^\r\n]+/giu,"$1: <redacted>");return t=t.replace(/\bahk_[A-Za-z0-9_-]+/gu,"<api-key>"),t=t.replace(/\beyJ[\w-]+\.[\w-]+\.[\w-]+/gu,"<token>"),n&&(t=t.split(n).join("<key>")),t}const I="/api/tools",w=new _;export function callsMadeInBackground(u){return w.run(!0,u)}export class Cloud{config;constructor(n){this.config=n}async tellStudio(n,t,i){const r=this.config.studioHost;if(r===void 0)return;const s={reason:n,what:t.startsWith(I)?"tool":"command",numbers:k(i)},e=(d,o)=>fetch(`${r}/${d}`,{method:"POST",signal:AbortSignal.timeout(1e3),...o===void 0?{}:{headers:{"content-type":"application/json"},body:o}}).then(async f=>(await f.body?.cancel(),f.status),()=>{});await e(O,JSON.stringify(s))===404&&n==="insufficient_credits"&&await e("out-of-credits")}get url(){return this.config.url}async key(n={}){const t=this.config.apiKey;if(t)return{key:t,source:"env",account:b("sha256").update(t).digest("hex")};try{const i=await N(this.config,n);if(!i)return;const r=i.credentials.account.organization?.id,s=i.credentials.device;return{key:i.token,source:"oauth",account:i.credentials.account.id,expiresAt:i.expiresAt,...r===void 0?{}:{organization:r},...s===void 0?{}:{device:s}}}catch(i){if(i instanceof x)return;throw m(this.url,i)}}async requireKey(){const n=await this.key();if(!n)throw p();return n}keyedFetch=async(n,t)=>{const i=this.config.client===void 0?void 0:await z(this.config.client),r=d=>{const o=new Headers(t?.headers);return o.set("authorization",`Bearer ${d.key}`),i!==void 0&&!o.has("user-agent")&&o.set("user-agent",i),this.config.traceparent!==void 0&&!o.has("traceparent")&&o.set("traceparent",this.config.traceparent),d.organization!==void 0&&!o.has(g)&&o.set(g,d.organization),d.device!==void 0&&o.set(E,d.device),w.getStore()===!0&&o.set(A,"1"),this.config.fetch(n,{...t,headers:o})},s=await this.requireKey(),e=await r(s);if(e.status!==401||s.source!=="oauth"||t?.body instanceof ReadableStream||n instanceof Request)return e;const a=await this.key({refused:s.key});return a===void 0?e:(await e.body?.cancel(),r(a))};async json(n,t={}){const i=t.auth!==!1,r=i?await this.requireKey():void 0,s=r?.key,e=t.organization??r?.organization;let a;try{a=await(i?this.keyedFetch:this.config.fetch)(`${this.url}${n}`,{redirect:"error",signal:t.signal??AbortSignal.timeout(3e4),method:t.method??"GET",headers:{accept:"application/json",...t.body===void 0?{}:{"content-type":"application/json"},...t.organization===void 0?{}:{[g]:t.organization},...t.idempotencyKey===void 0?{}:{[$]:t.idempotencyKey}},...t.body===void 0?{}:{body:JSON.stringify(t.body)}})}catch(l){throw l instanceof h?l:m(this.url,l)}const d=await a.text(),o=a.ok?void 0:T(d,a.status,s,this.url,e),f=S(o?.code);if(f!==void 0&&await this.tellStudio(f,n,o?.data),o&&a.status!==401)throw o;if(a.status===403)throw new h("forbidden","This AllyHub account does not have access to this operation.",{exit:c.auth,status:403});if(a.status===401)throw p(i?"This computer's AllyHub sign-in is not valid any more.":void 0);if(!a.ok)throw new h("api-error",`${this.url}${n} answered ${String(a.status)}: ${scrub(d.slice(0,300),s)}`,{exit:a.status>=500?c.platform:c.usage,status:a.status});if(a.status!==204)try{return JSON.parse(d)}catch{throw new h("api-error",`${this.url}${n} did not answer JSON.`,{exit:c.platform,status:a.status})}}}const R={bad_input:c.usage,insufficient_credits:c.auth,plan_required:c.auth,tool_off:c.auth,storage_full:c.auth,limit_reached:c.auth,forbidden:c.auth,not_found:c.notFound,conflict:c.conflict};function T(u,n,t,i,r){let s;try{s=JSON.parse(u)}catch{return}const e=s?.error;if(typeof e?.code!="string"||typeof e.message!="string")return;const a=e.code==="insufficient_credits"?`Buy credits at ${y(i,{organization:r,open:"credits"})}, or ask an owner or admin of the team to.`:e.code==="plan_required"?`Subscribe at ${y(i,{organization:r,open:"plans"})}, or ask an owner or admin of the team to.`:e.code==="tool_off"?`Turn it on in Capabilities at ${i}/, or ask an owner or admin of the team to.`:typeof e.hint=="string"?e.hint:void 0;return new h(e.code.replaceAll("_","-"),scrub(e.message,t),{exit:R[e.code]??c.platform,status:n,...a===void 0?{}:{hint:a},...typeof e.data=="object"&&e.data!==null?{data:e.data}:{}})}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{homedir as d}from"node:os";import{join as u}from"node:path";import{API_KEY_ENV as l
|
|
2
|
+
import{homedir as d}from"node:os";import{join as u}from"node:path";import{API_KEY_ENV as l}from"@allyhub/protocol/cloud";import{CREDENTIALS_FILE as a}from"@allyhub/protocol/auth";import{cacheHome as A}from"@allyhub/runtimes/home";import{osKeychain as E}from"./keychain.js";const T="https://app.allyhub.com",_=["ALLYHUB_URL"],h=/^00-[0-9a-f]{32}-[0-9a-f]{16}-[0-9a-f]{2}$/u,H=o=>o.replace(/\/+$/u,"");export function cloudConfig(o,r={}){const c=o[l]?.trim(),t=H(o.ALLYHUB_URL??T),e=o.ALLYHUB_HOME,i=r.client??o.ALLYHUB_CLIENT,n=h.exec(o.TRACEPARENT?.trim()??"")?.[0],f=u(e??d(),a),m=o.ALLYHUB_CREDENTIALS_STORE,L=m==="keychain"||m!=="file"&&e===void 0?E({service:"AllyHub",account:e===void 0?t:`${t} ${f}`}):void 0;return{url:t,from:_.filter(s=>o[s]!==void 0),credentialsFile:f,...L?{keychain:L}:{},cacheDir:u(A(o),"cloud"),...c?{apiKey:c}:{},fetch:r.fetch??fetch,...i===void 0?{}:{client:i},...n===void 0?{}:{traceparent:n},...o.ALLYHUB_STUDIO_HOST?{studioHost:o.ALLYHUB_STUDIO_HOST}:{}}}export function hostsText(o){return o.from.length>0?`${o.url} (from ${o.from.join(", ")})`:o.url}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{randomBytes as T}from"node:crypto";import{chmod as C,mkdir as m,readFile as b,rename as P,rm as h,stat as O,writeFile as z}from"node:fs/promises";import{dirname as x}from"node:path";import*as y from"zod";import{ACCOUNT_PATH as I,AccountSchema as j,AuthServerSchema as N,CLIENT_ID as w,CredentialsFileSchema as $,DeviceAuthorizationSchema as R,METADATA_PATH as J,OAuthErrorSchema as L,SCOPES as U,TokenResponseSchema as B}from"@allyhub/protocol";import{deviceHeaders as W,newDeviceId as E}from"./device.js";import{notSignedIn as G}from"./errors.js";export class SignedOut extends Error{}const K=6e4,p={waitMs:15e3,staleMs:3e4,stepMs:50},g=new Map;export function authServer(e){let n=g.get(e.url);return n||(n=(async()=>{const t=await e.fetch(`${e.url}${J}`,{redirect:"error",headers:{accept:"application/json"},signal:AbortSignal.timeout(3e4)});if(!t.ok)throw new Error(`AllyHub's sign-in metadata answered ${String(t.status)}.`);return N.parse(await t.json())})(),n.catch(()=>g.delete(e.url)),g.set(e.url,n)),n}const V=y.object({revision:y.string().min(1),refreshToken:y.string().min(1),access:$.shape.access}),k=new Map;async function q(e,n,t){const r=k.get(e.credentialsFile);if(!t&&r?.revision===n)return r;if(e.keychain)try{const i=await e.keychain.get(),a=V.safeParse(i===void 0?void 0:JSON.parse(i));return!a.success||a.data.revision!==n?void 0:(k.set(e.credentialsFile,a.data),a.data)}catch{return}}export async function readCredentials(e,n=!1){for(let t=0;t<3;t+=1){let r;try{const a=$.safeParse(JSON.parse(await b(e.credentialsFile,"utf8")));if(!a.success||a.data.url!==e.url)return;r=a.data}catch{return}if(r.keychain===void 0)return r.refreshToken===void 0?void 0:{...r,refreshToken:r.refreshToken};const i=await q(e,r.keychain,n||t>0);if(i){const{access:a,refreshToken:o}=i;return{...r,refreshToken:o,...a?{access:a}:{}}}await new Promise(a=>setTimeout(a,p.stepMs))}}export async function writeCredentials(e,n){const{refreshToken:t,access:r,...i}=n,a={version:i.version,url:i.url,issuer:i.issuer,account:i.account,since:i.since,...i.device===void 0?{}:{device:i.device}};let o={...a,refreshToken:t,...r?{access:r}:{}};if(e.keychain){const f={revision:T(9).toString("base64url"),refreshToken:t,...r?{access:r}:{}},A=JSON.stringify(f);try{if(await e.keychain.set(A),await e.keychain.get()!==A)throw new Error(`${e.keychain.name} did not keep the sign-in.`);k.set(e.credentialsFile,f),o={...a,keychain:f.revision}}catch{}}const d=e.credentialsFile,u=`${JSON.stringify(o,null,2)}
|
|
2
|
+
import{randomBytes as T}from"node:crypto";import{chmod as C,mkdir as m,readFile as b,rename as P,rm as h,stat as O,writeFile as z}from"node:fs/promises";import{dirname as x}from"node:path";import*as y from"zod";import{ACCOUNT_PATH as I,AccountSchema as j,AuthServerSchema as N,CLIENT_ID as w,CredentialsFileSchema as $,DeviceAuthorizationSchema as R,METADATA_PATH as J,OAuthErrorSchema as L,SCOPES as U,TokenResponseSchema as B}from"@allyhub/protocol/auth";import{deviceHeaders as W,newDeviceId as E}from"./device.js";import{notSignedIn as G}from"./errors.js";export class SignedOut extends Error{}const K=6e4,p={waitMs:15e3,staleMs:3e4,stepMs:50},g=new Map;export function authServer(e){let n=g.get(e.url);return n||(n=(async()=>{const t=await e.fetch(`${e.url}${J}`,{redirect:"error",headers:{accept:"application/json"},signal:AbortSignal.timeout(3e4)});if(!t.ok)throw new Error(`AllyHub's sign-in metadata answered ${String(t.status)}.`);return N.parse(await t.json())})(),n.catch(()=>g.delete(e.url)),g.set(e.url,n)),n}const V=y.object({revision:y.string().min(1),refreshToken:y.string().min(1),access:$.shape.access}),k=new Map;async function q(e,n,t){const r=k.get(e.credentialsFile);if(!t&&r?.revision===n)return r;if(e.keychain)try{const i=await e.keychain.get(),a=V.safeParse(i===void 0?void 0:JSON.parse(i));return!a.success||a.data.revision!==n?void 0:(k.set(e.credentialsFile,a.data),a.data)}catch{return}}export async function readCredentials(e,n=!1){for(let t=0;t<3;t+=1){let r;try{const a=$.safeParse(JSON.parse(await b(e.credentialsFile,"utf8")));if(!a.success||a.data.url!==e.url)return;r=a.data}catch{return}if(r.keychain===void 0)return r.refreshToken===void 0?void 0:{...r,refreshToken:r.refreshToken};const i=await q(e,r.keychain,n||t>0);if(i){const{access:a,refreshToken:o}=i;return{...r,refreshToken:o,...a?{access:a}:{}}}await new Promise(a=>setTimeout(a,p.stepMs))}}export async function writeCredentials(e,n){const{refreshToken:t,access:r,...i}=n,a={version:i.version,url:i.url,issuer:i.issuer,account:i.account,since:i.since,...i.device===void 0?{}:{device:i.device}};let o={...a,refreshToken:t,...r?{access:r}:{}};if(e.keychain){const f={revision:T(9).toString("base64url"),refreshToken:t,...r?{access:r}:{}},A=JSON.stringify(f);try{if(await e.keychain.set(A),await e.keychain.get()!==A)throw new Error(`${e.keychain.name} did not keep the sign-in.`);k.set(e.credentialsFile,f),o={...a,keychain:f.revision}}catch{}}const d=e.credentialsFile,u=`${JSON.stringify(o,null,2)}
|
|
3
3
|
`,c=await O(d).catch(()=>{});if(c!==void 0&&(c.mode&511)===384&&await b(d,"utf8").catch(()=>{})===u)return;await m(x(d),{recursive:!0,mode:448});const s=`${d}.${T(6).toString("hex")}.tmp`;try{await z(s,u,{mode:384}),await C(s,384),await P(s,d)}finally{await h(s,{force:!0})}}export async function forgetCredentials(e,n){if(n!==void 0){const t=await readCredentials(e,!0);if(t!==void 0&&t.refreshToken!==n)return}await h(e.credentialsFile,{force:!0}),k.delete(e.credentialsFile),await e.keychain?.delete().catch(()=>{})}async function _(e,n){const t=`${e}.lock`;await m(x(e),{recursive:!0,mode:448});const r=Date.now()+p.waitMs;for(;;)try{await m(t);break}catch{const i=await O(t).catch(()=>{});if(i&&Date.now()-i.mtimeMs>p.staleMs){await h(t,{recursive:!0,force:!0});continue}if(Date.now()>r)throw new Error("Another AllyHub program holds the sign-in's lock.");await new Promise(a=>setTimeout(a,p.stepMs))}try{return await n()}finally{await h(t,{recursive:!0,force:!0})}}async function l(e,n,t,r,i={}){return e.fetch(n,{method:"POST",redirect:"error",headers:{...i,"content-type":"application/x-www-form-urlencoded",accept:"application/json"},body:new URLSearchParams(t).toString(),signal:r??AbortSignal.timeout(3e4)})}async function v(e){const n=await e.json().catch(()=>({}));if(e.ok)return B.parse(n);const t=L.safeParse(n);return{error:t.success?t.data.error:`http_${String(e.status)}`}}const D=e=>({token:e.access_token,expiresAt:new Date(Date.now()+e.expires_in*1e3).toISOString()});export async function accountOf(e,n){const t=await e.fetch(`${e.url}${I}`,{redirect:"error",headers:{authorization:`Bearer ${n}`,accept:"application/json"},signal:AbortSignal.timeout(3e4)});if(t.status===401)throw new SignedOut("This computer is signed out of AllyHub.");if(!t.ok)throw new Error(`Reading the account: AllyHub answered ${String(t.status)}.`);const r=await t.json();return j.parse({id:r.id,email:r.email,...r.name?{name:r.name}:{},...r.organization?{organization:r.organization}:{}})}const Q=e=>e.client??"AllyHub",S=(e,n)=>W(Q(e),n),F=async e=>(await readCredentials(e).catch(()=>{}))?.device??E();async function H(e,n,t){if(n.refresh_token===void 0)throw new Error("AllyHub gave no refresh token.");const r=await authServer(e),i={version:1,url:e.url,issuer:r.issuer,account:await accountOf(e,n.access_token),refreshToken:n.refresh_token,access:D(n),since:new Date().toISOString(),device:t},a=await readCredentials(e).catch(()=>{});return await writeCredentials(e,i),a!==void 0&&a.device===void 0&&a.refreshToken!==i.refreshToken&&await M(e,r.revocation_endpoint,a.refreshToken).then(o=>o.body?.cancel()).catch(()=>{}),i}const M=(e,n,t)=>l(e,n,{token:t,token_type_hint:"refresh_token",client_id:w});export async function signInWithCode(e,n){const t=await authServer(e),r=await F(e),i=await v(await l(e,t.token_endpoint,{grant_type:"authorization_code",client_id:w,code:n.code,redirect_uri:n.redirectUri,code_verifier:n.codeVerifier,resource:e.url},void 0,await S(e,r)));if("error"in i)throw new Error(`Signing in: AllyHub refused the code (${i.error}).`);return H(e,i,r)}export async function signInWithDevice(e,n,t){const r=await authServer(e),i=await l(e,r.device_authorization_endpoint,{client_id:w,scope:U,resource:e.url});if(!i.ok)throw new Error(`Asking for a device's code: AllyHub answered ${String(i.status)}.`);const a=R.parse(await i.json()),o=await F(e),d=await S(e,o);n(a);let u=(a.interval??5)*1e3;const c=Date.now()+a.expires_in*1e3;for(;Date.now()<c;){if(await new Promise(f=>setTimeout(f,u)),t?.aborted===!0)throw new Error("Signing in was stopped.");const s=await v(await l(e,r.token_endpoint,{grant_type:"urn:ietf:params:oauth:grant-type:device_code",client_id:w,device_code:a.device_code,resource:e.url},void 0,d));if(!("error"in s))return H(e,s,o);if(s.error!=="authorization_pending"){if(s.error==="slow_down"){u+=5e3;continue}throw new Error(s.error==="access_denied"?"The sign-in was turned down.":`Signing in: AllyHub refused (${s.error}).`)}}throw new Error("The device's code ran out before it was entered.")}export async function accessOf(e,n={}){const t=o=>o?.access!==void 0&&o.access.token!==n.refused&&Date.parse(o.access.expiresAt)-K>Date.now()?{token:o.access.token,expiresAt:o.access.expiresAt,credentials:o}:void 0;let r=await readCredentials(e);if(!r||(e.keychain&&r.keychain===void 0&&(r=await _(e.credentialsFile,async()=>{const o=await readCredentials(e,!0);return o&&o.keychain===void 0&&await writeCredentials(e,o),o})),!r))return;const i=t(r);if(i)return i;const a=await authServer(e);return _(e.credentialsFile,async()=>{const o=await readCredentials(e,!0);if(!o)return;const d=t(o);if(d)return d;const u=o.device??E(),c=await v(await l(e,a.token_endpoint,{grant_type:"refresh_token",client_id:w,refresh_token:o.refreshToken,resource:e.url},void 0,await S(e,u)));if("error"in c)throw c.error==="invalid_grant"?(await forgetCredentials(e,o.refreshToken),new SignedOut("This computer is signed out of AllyHub.")):new Error(`Renewing the sign-in: AllyHub answered ${c.error}.`);const s={...o,refreshToken:c.refresh_token??o.refreshToken,access:D(c),device:u};return await writeCredentials(e,s),{token:s.access?.token??c.access_token,expiresAt:s.access?.expiresAt??"",credentials:s}})}export async function signOut(e,n){await forgetCredentials(e,n.refreshToken);const t=await authServer(e),r=await M(e,t.revocation_endpoint,n.refreshToken);if(await r.body?.cancel(),!r.ok&&r.status!==400)throw new Error(`Signing out: AllyHub answered ${String(r.status)}.`)}export async function chooseOrganization(e,n){await _(e.credentialsFile,async()=>{const t=await readCredentials(e,!0);if(!t)throw G();await writeCredentials(e,{...t,account:{...t.account,organization:n}})})}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{execFile as m}from"node:child_process";import{randomBytes as l}from"node:crypto";import{arch as p,hostname as w,platform as s,release as r}from"node:os";import{DEVICE_HEADER as d,DEVICE_NAME_HEADER as f}from"@allyhub/protocol";const a=(e,t)=>new Promise(n=>{m(e,t,{timeout:2e3},(c,u)=>{const o=u.trim();n(c===null&&o!==""?o:void 0)})});let i;export function thisComputer(){return i??=(async()=>{const e=w().replace(/\.local$/u,"");switch(s()){case"darwin":{const[t,n]=await Promise.all([a("/usr/sbin/scutil",["--get","ComputerName"]),a("/usr/bin/sw_vers",["-productVersion"])]);return{name:t??e,os:`macOS ${n??r()}`}}case"win32":return{name:e,os:`Windows ${r()}`};case"linux":return{name:e,os:`Linux ${r()}`};default:return{name:e,os:`${s()} ${r()}`}}})(),i}export const newDeviceId=()=>l(18).toString("base64url");export async function userAgent(e){const t=await thisComputer();return`${e} (${t.os}; ${p()})`}export async function deviceHeaders(e,t){const n=await thisComputer();return{"user-agent":await userAgent(e),[d]:t,[f]:encodeURIComponent(n.name)}}
|
|
2
|
+
import{execFile as m}from"node:child_process";import{randomBytes as l}from"node:crypto";import{arch as p,hostname as w,platform as s,release as r}from"node:os";import{DEVICE_HEADER as d,DEVICE_NAME_HEADER as f}from"@allyhub/protocol/auth";const a=(e,t)=>new Promise(n=>{m(e,t,{timeout:2e3},(c,u)=>{const o=u.trim();n(c===null&&o!==""?o:void 0)})});let i;export function thisComputer(){return i??=(async()=>{const e=w().replace(/\.local$/u,"");switch(s()){case"darwin":{const[t,n]=await Promise.all([a("/usr/sbin/scutil",["--get","ComputerName"]),a("/usr/bin/sw_vers",["-productVersion"])]);return{name:t??e,os:`macOS ${n??r()}`}}case"win32":return{name:e,os:`Windows ${r()}`};case"linux":return{name:e,os:`Linux ${r()}`};default:return{name:e,os:`${s()} ${r()}`}}})(),i}export const newDeviceId=()=>l(18).toString("base64url");export async function userAgent(e){const t=await thisComputer();return`${e} (${t.os}; ${p()})`}export async function deviceHeaders(e,t){const n=await thisComputer();return{"user-agent":await userAgent(e),[d]:t,[f]:encodeURIComponent(n.name)}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{CommandError as o,EXIT as r}from"@allyhub/protocol";export class CloudError extends Error{code;hint;exit;status;data;constructor(t,i,n={}){super(i,n.cause===void 0?void 0:{cause:n.cause}),this.name="CloudError",this.code=t,this.hint=n.hint,this.exit=n.exit??r.failed,this.status=n.status,this.data=n.data}}export async function cloudWork(e){try{return await e()}catch(t){throw t instanceof CloudError?new o(t.code,t.message,{exit:t.exit,...t.hint===void 0?{}:{hint:t.hint},cause:t}):t}}export const SIGN_IN="Run allyhub auth login (or set ALLYHUB_API_KEY).",notSignedIn=(e,t)=>new CloudError("not-signed-in",e??"This computer is not signed in to AllyHub.",{exit:r.auth,hint:t??SIGN_IN}),unreachable=(e,t)=>new CloudError("network",`Cannot reach ${e}: ${t instanceof Error?t.message:String(t)}`,{exit:r.platform,hint:"Check the connection; ALLYHUB_URL sets another address.",cause:t});
|
|
2
|
+
import{CommandError as o,EXIT as r}from"@allyhub/protocol/cli";export class CloudError extends Error{code;hint;exit;status;data;constructor(t,i,n={}){super(i,n.cause===void 0?void 0:{cause:n.cause}),this.name="CloudError",this.code=t,this.hint=n.hint,this.exit=n.exit??r.failed,this.status=n.status,this.data=n.data}}export async function cloudWork(e){try{return await e()}catch(t){throw t instanceof CloudError?new o(t.code,t.message,{exit:t.exit,...t.hint===void 0?{}:{hint:t.hint},cause:t}):t}}export const SIGN_IN="Run allyhub auth login (or set ALLYHUB_API_KEY).",notSignedIn=(e,t)=>new CloudError("not-signed-in",e??"This computer is not signed in to AllyHub.",{exit:r.auth,hint:t??SIGN_IN}),unreachable=(e,t)=>new CloudError("network",`Cannot reach ${e}: ${t instanceof Error?t.message:String(t)}`,{exit:r.platform,hint:"Check the connection; ALLYHUB_URL sets another address.",cause:t});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
export
|
|
2
|
+
export*from"./tools.js";export{SignedOut,accessOf,accountOf,authServer,chooseOrganization,forgetCredentials,readCredentials,signInWithCode,signInWithDevice,signOut,writeCredentials}from"./credentials.js";export{SIGN_IN_WAIT_MS,openBrowser,signIn,signInByEmail,signInDevice,signInInBackground,signedInAs}from"./signin.js";export{osKeychain}from"./keychain.js";export{LoopbackError,startLoopback}from"./loopback.js";export{pkcePair,randomState}from"./pkce.js";export{billingSummary,browserLink,organizations,webLink}from"./token.js";export{BlobStore,BlobsUnavailable}from"./blobs.js";export{Hashes,hashFolder,sha256Of}from"./hashes.js";export{addDeployment,changeSite,createSite,goLive,listSites,removeSite,siteDetail,unpublishSite}from"./sites.js";export{createMailAlias,mailbox,rawMail,readMail,replyMail,searchMail,sendMail}from"./mail.js";export{BASE64_FROM,LARGE_FROM,canonical,genRecord,inputHash,isSecretName,namedFile,readGen,recordInput,recordOutput,toolWords,withoutSignature,writeGen,writeWords}from"./records.js";export{makeSay,sayInput}from"./voice.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{timingSafeEqual as y}from"node:crypto";
|
|
2
|
+
import{timingSafeEqual as y}from"node:crypto";const{createServer:x}=process.getBuiltinModule("node:http"),k=3e4,h="/callback";export class LoopbackError extends Error{code;constructor(n,i){super(i),this.name="LoopbackError",this.code=n}}export async function startLoopback(e){let n={ok:()=>{},fail:()=>{}};const i=new Promise((a,o)=>{n={ok:a,fail:o}});let t,r;const l=a=>{const o=t;t=void 0,clearTimeout(r),!(o===void 0||o.writableEnded)&&(a!==void 0?c(o,200,s("Sign-in failed.",a.message)):e.landing!==void 0?o.writeHead(303,{location:e.landing,"cache-control":"no-store",connection:"close"}).end():c(o,200,s("You're signed in.","You can close this tab and go back to AllyHub.")))},d=x((a,o)=>{T(a,o,e.state,{...n,ok:b=>{t=o,r=setTimeout(()=>{t===void 0||t.writableEnded||(c(t,200,s("Returning to AllyHub…","You can close this tab.")),t=void 0)},k),n.ok(b)}})});await A(d);const{port:m}=d.address(),p=`http://127.0.0.1:${String(m)}${h}`;let f=!1;const u=async()=>{f||(f=!0,clearTimeout(w),n.fail(new LoopbackError("sign-in-cancelled","Sign-in was cancelled.")),l(),d.closeAllConnections(),await new Promise(a=>{d.close(()=>{a()})}))},w=setTimeout(()=>{n.fail(new LoopbackError("sign-in-timeout",`Nobody signed in within ${String(Math.round(e.timeoutMs/6e4))} minutes.`)),u()},e.timeoutMs);return i.catch(u),{result:i,redirectUri:p,finish:async a=>{l(a),await u()},close:u}}async function A(e){await new Promise((n,i)=>{e.once("error",i),e.listen(0,"127.0.0.1",()=>{e.off("error",i),n()})})}function T(e,n,i,t){if(e.method!=="GET"){n.writeHead(405,{"content-type":"text/plain"}).end();return}const r=new URL(e.url??"/","http://127.0.0.1");if(r.pathname!==h){n.writeHead(404,{"content-type":"text/plain"}).end();return}if(!S(r.searchParams.get("state")??"",i)){c(n,400,s("This sign-in link is not valid.","Run allyhub auth login again.")),t.fail(new LoopbackError("sign-in-state","The sign-in did not match this one."));return}if(r.searchParams.get("error")==="access_denied"){c(n,200,s("Sign-in cancelled.","You can close this tab.")),t.fail(new LoopbackError("sign-in-denied","The sign-in was cancelled in the browser."));return}const l=r.searchParams.get("code");if(!l){c(n,400,s("Sign-in failed.","Run allyhub auth login again.")),t.fail(new LoopbackError("sign-in-failed","The browser came back without a code."));return}t.ok(l)}function S(e,n){const i=Buffer.from(e),t=Buffer.from(n);return i.length===t.length&&y(i,t)}function c(e,n,i){e.writeHead(n,{"content-type":"text/html; charset=utf-8","cache-control":"no-store",connection:"close"}).end(i)}const g=e=>e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""");function s(e,n){return`<!doctype html><html><head><meta charset="utf-8"><title>AllyHub</title>
|
|
3
3
|
<style>body{font-family:system-ui,sans-serif;display:flex;align-items:center;justify-content:center;height:100vh;margin:0;background:#f7f7f6;color:#1b1b19}main{max-width:440px;text-align:center;padding:32px;border-radius:10px;background:#fff;border:1px solid #dfdfdc}h1{font-family:Piazzolla,Georgia,serif;font-size:20px;font-weight:600;margin:0 0 8px}p{margin:0;color:#605f5a}</style>
|
|
4
|
-
</head><body><main><h1>${
|
|
4
|
+
</head><body><main><h1>${g(e)}</h1><p>${g(n)}</p></main></body></html>`}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{MAIL_ALIASES_PATH as S,MAIL_MESSAGES_PATH as n,MAIL_PATH as h,MAIL_SEND_PATH as p,MailAddressSchema as y,MailMessageSchema as M,MailSearchResponseSchema as A,MailSummarySchema as o,MailboxSchema as d,mailMessagePath as i,mailRawPath as c,mailReplyPath as w}from"@allyhub/protocol";export const mailbox=async a=>d.parse(await a.json(h)),createMailAlias=async(a,e)=>y.parse(await a.json(S,{method:"POST",body:e}));export async function searchMail(a,e,t){const r=new URLSearchParams;for(const[m,s]of Object.entries(e))s!==void 0&&r.set(m,String(s));const l=r.size===0?n:`${n}?${r.toString()}`;return A.parse(await a.json(l,t===void 0?{}:{signal:t})).messages}export const readMail=async(a,e,t={})=>M.parse(await a.json(t.html===!0?`${i(e)}?html=1`:i(e)));export async function rawMail(a,e){const t=await a.keyedFetch(`${a.url}${c(e)}`,{redirect:"error",signal:AbortSignal.timeout(6e4)});if(t.ok)return new Uint8Array(await t.arrayBuffer());throw await t.body?.cancel(),await a.json(c(e)),new Error(`The message could not be read (${String(t.status)}).`)}export const sendMail=async(a,e)=>o.parse(await a.json(p,{method:"POST",body:e,signal:AbortSignal.timeout(12e4)})),replyMail=async(a,e,t)=>o.parse(await a.json(w(e),{method:"POST",body:t,signal:AbortSignal.timeout(12e4)}));
|
|
2
|
+
import{MAIL_ALIASES_PATH as S,MAIL_MESSAGES_PATH as n,MAIL_PATH as h,MAIL_SEND_PATH as p,MailAddressSchema as y,MailMessageSchema as M,MailSearchResponseSchema as A,MailSummarySchema as o,MailboxSchema as d,mailMessagePath as i,mailRawPath as c,mailReplyPath as w}from"@allyhub/protocol/mail";export const mailbox=async a=>d.parse(await a.json(h)),createMailAlias=async(a,e)=>y.parse(await a.json(S,{method:"POST",body:e}));export async function searchMail(a,e,t){const r=new URLSearchParams;for(const[m,s]of Object.entries(e))s!==void 0&&r.set(m,String(s));const l=r.size===0?n:`${n}?${r.toString()}`;return A.parse(await a.json(l,t===void 0?{}:{signal:t})).messages}export const readMail=async(a,e,t={})=>M.parse(await a.json(t.html===!0?`${i(e)}?html=1`:i(e)));export async function rawMail(a,e){const t=await a.keyedFetch(`${a.url}${c(e)}`,{redirect:"error",signal:AbortSignal.timeout(6e4)});if(t.ok)return new Uint8Array(await t.arrayBuffer());throw await t.body?.cancel(),await a.json(c(e)),new Error(`The message could not be read (${String(t.status)}).`)}export const sendMail=async(a,e)=>o.parse(await a.json(p,{method:"POST",body:e,signal:AbortSignal.timeout(12e4)})),replyMail=async(a,e,t)=>o.parse(await a.json(w(e),{method:"POST",body:t,signal:AbortSignal.timeout(12e4)}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{createHash as x}from"node:crypto";import{readdir as S,readFile as p,rename as O,stat as b,writeFile as l}from"node:fs/promises";import{basename as F,dirname as o,extname as $,join as h}from"node:path";import{GenFileSchema as y,
|
|
2
|
+
import{createHash as x}from"node:crypto";import{readdir as S,readFile as p,rename as O,stat as b,writeFile as l}from"node:fs/promises";import{basename as F,dirname as o,extname as $,join as h}from"node:path";import{GenFileSchema as y,genFileFor as a}from"@allyhub/formats/data/gen";import{WordsFileSchema as A,wordsFileFor as j}from"@allyhub/formats/data/words";const u=t=>x("sha256").update(t).digest("hex");export function canonical(t){if(Array.isArray(t))return`[${t.map(canonical).join(",")}]`;if(typeof t=="object"&&t!==null){const e=t;return`{${Object.keys(e).filter(n=>e[n]!==void 0).sort().map(n=>`${JSON.stringify(n)}:${canonical(e[n])}`).join(",")}}`}return JSON.stringify(t??null)}export function inputHash(t,e){return u(canonical({tool:t,input:e}))}export const BASE64_FROM=1024,LARGE_FROM=2e3;const k=t=>t.replace(/([a-z0-9])([A-Z])/gu,"$1_$2").toLowerCase().split(/[^a-z0-9]+/u).filter(Boolean),N=new Set(["apikey","token","secret","password","passwd","passphrase","authorization","credential","credentials","cookie","bearer"]),E=new Set(["api","access","secret","private","auth","signing"]);export function isSecretName(t){const e=k(t);return e.some(n=>N.has(n))?!0:e.some((n,r)=>n==="key"&&E.has(e[r-1]??""))}function W(t){if(t.length<BASE64_FROM)return;const e=/^data:[^,]*;base64,/u.exec(t),n=e?t.slice(e[0].length):t;if(/^[A-Za-z0-9+/_-]+(?:\r?\n[A-Za-z0-9+/_-]+)*={0,2}\s*$/u.test(n))return Buffer.from(n,"base64")}const _=/^(x-amz-(signature|credential|security-token)|x-goog-(signature|credential)|signature|sig|se|sp|token|expires|key-pair-id|policy)$/iu;export function withoutSignature(t){if(!/^https?:\/\//iu.test(t))return t;let e;try{e=new URL(t)}catch{return t}return[...e.searchParams.keys()].some(n=>_.test(n))?(e.search="",`${e.toString()}?[signature redacted]`):t}const g=t=>({omitted:!0,sha256:u(t),bytes:typeof t=="string"?Buffer.byteLength(t):t.length});function c(t,e){if(e!==void 0&&isSecretName(e))return t==null?t:"[redacted]";if(typeof t=="string"){const n=W(t);return n?g(n):withoutSignature(t)}return Array.isArray(t)?t.map(n=>c(n,void 0)):typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t).map(([n,r])=>[n,c(r,n)])):t}export function recordInput(t){return c(t,void 0)}export function recordOutput(t){const e={};for(const[n,r]of Object.entries(recordInput(t))){const i=r===void 0?"null":JSON.stringify(r);e[n]=i.length>LARGE_FROM?g(i):r}return e}const m=t=>typeof t=="string"&&t!==""?t:void 0;export async function genRecord(t,e){const n=await p(t),r=e.model??m(e.output.model)??m(e.input.model);return y.parse({version:1,ai:!0,tool:e.tool,...r?{model:r}:{},input:recordInput(e.input),inputHash:inputHash(e.tool,e.input),output:recordOutput(e.output),...e.credits===void 0?{}:{credits:e.credits},at:(e.at??new Date).toISOString(),sha256:u(n),bytes:n.length})}export async function writeGen(t,e){const n=a(t);return await l(`${n}.part`,`${JSON.stringify(e,null,2)}
|
|
3
3
|
`),await O(`${n}.part`,n),n}export async function readGen(t){try{const e=y.safeParse(JSON.parse(await p(a(t),"utf8")));return e.success&&e.data.inputHash!==void 0?e.data:void 0}catch{return}}const d=a("");export async function namedFile(t){if($(t))return(await b(t).catch(()=>{}))?.isFile()?t:void 0;const e=F(t),r=(await S(o(t)).catch(()=>[])).filter(s=>s.startsWith(`${e}.`)),i=r.find(s=>s.endsWith(d)&&r.includes(s.slice(0,-d.length)));if(i)return h(o(t),i.slice(0,-d.length));const f=r.find(s=>!s.endsWith(".json")&&/^\.[^.]+$/u.test(s.slice(e.length)));return f?h(o(t),f):void 0}const w=t=>Math.round(t*1e3)/1e3;export function toolWords(t){const n=(Array.isArray(t.words)?t.words:[]).flatMap(r=>{const i=r;return typeof i.text=="string"&&i.text!==""&&typeof i.start=="number"&&typeof i.end=="number"&&i.end>=i.start&&i.start>=0?[{text:i.text,start:w(i.start),end:w(i.end)}]:[]});return n.length>0?n:void 0}export async function writeWords(t,e,n){const r=j(t),i=A.parse({version:1,...n===void 0?{}:{duration:n},words:e});return await l(r,`${JSON.stringify(i,null,1)}
|
|
4
4
|
`),r}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{spawn as k}from"node:child_process";import{mkdtemp as j,open as E,readFile as m,rename as O,rm as
|
|
2
|
+
import{spawn as k}from"node:child_process";import{mkdtemp as j,open as E,readFile as m,rename as O,rm as p,writeFile as N}from"node:fs/promises";import{tmpdir as U}from"node:os";import{join as s}from"node:path";import{fileURLToPath as b}from"node:url";import{CLIENT_ID as P,SCOPES as L,SIGN_IN_LINK_PATH as R,signedInAddress as v}from"@allyhub/protocol/auth";import{EXIT as g}from"@allyhub/protocol/cli";import{accessOf as $,authServer as A,SignedOut as D,signInWithCode as W,signInWithDevice as C}from"./credentials.js";import{nodeCommand as J}from"@allyhub/runtimes/node";import{CloudError as l,unreachable as u}from"./errors.js";import{LoopbackError as B,startLoopback as h}from"./loopback.js";import{pkcePair as z,randomState as F}from"./pkce.js";const H="idp_hint";export const SIGN_IN_WAIT_MS=5*6e4;const M=3e4;function y(){return{state:F(),...z()}}async function I(t,e,o,r={}){const i=await A(t),n=new URLSearchParams({response_type:"code",client_id:P,redirect_uri:o,scope:L,state:e.state,code_challenge:e.challenge,code_challenge_method:"S256",resource:t.url});return r.with!==void 0&&n.set(H,r.with),r.email!==void 0&&n.set("login_hint",r.email),`${i.authorization_endpoint}?${n.toString()}`}export function openBrowser(t,e){if(e.BROWSER==="none")return;const[o,r]=process.platform==="darwin"?["open",[t]]:process.platform==="win32"?["cmd",["/c","start","",t]]:["xdg-open",[t]];try{const i=k(o,r,{stdio:"ignore",detached:!0});i.on("error",()=>{}),i.unref()}catch{}}export async function signedInAs(t){try{return(await $(t.config))?.credentials.account}catch(e){if(e instanceof D)return;throw u(t.url,e)}}const S=t=>new l(t instanceof B?t.code:"sign-in-failed",t instanceof Error?t.message:String(t),{exit:g.auth,hint:"Run allyhub auth login again."});async function _(t,e,o){let r;try{r=await o.result}catch(n){throw S(n)}let i;try{i=(await W(t,{code:r,codeVerifier:e.verifier,redirectUri:o.redirectUri})).account}catch(n){const a=S(n);throw await o.finish(a),a}return await o.finish(),i}const x=(t,e={})=>v(t.url,{desktop:e.desktop});export async function signIn(t,e,o=SIGN_IN_WAIT_MS,r={}){const i=y(),n=await h({state:i.state,timeoutMs:o,landing:x(t.config,r)});try{e(await I(t.config,i,n.redirectUri,r))}catch(a){throw await n.close(),u(t.url,a)}return _(t.config,i,n)}export async function signInByEmail(t,e,o,r=SIGN_IN_WAIT_MS,i={}){const n=t.config,a=y(),f=await h({state:a.state,timeoutMs:r,landing:x(n,i)});try{const d={email:e,authorization:await I(n,a,f.redirectUri)},c=await n.fetch(`${n.url}${R}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(d)});if(!c.ok)throw new l("sign-in-failed",`AllyHub did not send the link (${String(c.status)}): ${(await c.text()).slice(0,300)}`,{exit:g.auth,status:c.status});await c.body?.cancel()}catch(d){throw await f.close(),d instanceof l?d:u(t.url,d)}return o(),_(n,a,f)}export async function signInDevice(t,e,o){try{return(await C(t.config,e,o)).account}catch(r){throw S(r)}}const G=b(new URL("./signin-worker.js",import.meta.url));export async function signInInBackground(t,e,o=SIGN_IN_WAIT_MS){const r=y(),i=await j(s(U(),"allyhub-sign-in-"));await N(s(i,"flow.json"),JSON.stringify({flow:r,timeoutMs:o}),{mode:384});const n=await E(s(i,"worker.log"),"w"),a=k(J(e),[G,i],{detached:!0,stdio:["ignore","ignore",n.fd],env:{...e}});await n.close();const f={exited:!1};a.once("exit",()=>{f.exited=!0}),a.unref();const d=Date.now()+M;for(;Date.now()<d;)try{const w=JSON.parse(await m(s(i,"ready.json"),"utf8"));return await I(t.config,r,w.redirectUri)}catch(w){if(w instanceof Error&&!("code"in w))throw u(t.url,w);if(f.exited)break;await new Promise(T=>setTimeout(T,50))}const c=(await m(s(i,"worker.log"),"utf8").catch(()=>"")).trim().split(`
|
|
3
3
|
`).slice(-5).join(`
|
|
4
|
-
`);throw await
|
|
4
|
+
`);throw await p(i,{recursive:!0,force:!0}),new l("sign-in-failed",c?`The sign-in listener did not start: ${c}`:"The sign-in listener did not start.",{exit:g.platform})}export async function serveSignIn(t,e){const{flow:o,timeoutMs:r}=JSON.parse(await m(s(e,"flow.json"),"utf8"));await p(s(e,"flow.json"),{force:!0});const i=await h({state:o.state,timeoutMs:r,landing:x(t)});await N(s(e,"ready.json.tmp"),JSON.stringify({redirectUri:i.redirectUri})),await O(s(e,"ready.json.tmp"),s(e,"ready.json"));try{await _(t,o,i)}finally{await new Promise(n=>setTimeout(n,200)),await p(e,{recursive:!0,force:!0})}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{DeploymentMadeSchema as S,SITES_PATH as n,SITE_PERSON_QUERY as p,SiteDetailSchema as m,SiteLiveAnswerSchema as h,SiteSchema as o,SitesResponseSchema as y,siteDeploymentsPath as d,siteLivePath as i,sitePath as r,siteSettingsPath as P}from"@allyhub/protocol";export const listSites=async e=>y.parse(await e.json(n)),createSite=async(e,t)=>o.parse(await e.json(n,{method:"POST",body:t})),addDeployment=async(e,t,s)=>S.parse(await e.json(d(t),{method:"POST",body:s,signal:AbortSignal.timeout(12e4)})),siteDetail=async(e,t)=>m.parse(await e.json(r(t)));const a=(e,t)=>t?`${e}?${p}`:e;export const goLive=async(e,t,s,c={})=>h.parse(await e.json(a(i(t),c.person===!0),{method:"PUT",body:{deployment:s}})),unpublishSite=async(e,t)=>o.parse(await e.json(a(i(t),!0),{method:"DELETE"})),removeSite=async(e,t)=>{await e.json(a(r(t),!0),{method:"DELETE"})},changeSite=async(e,t,s)=>o.parse(await e.json(a(P(t),!0),{method:"PUT",body:s}));
|
|
2
|
+
import{DeploymentMadeSchema as S,SITES_PATH as n,SITE_PERSON_QUERY as p,SiteDetailSchema as m,SiteLiveAnswerSchema as h,SiteSchema as o,SitesResponseSchema as y,siteDeploymentsPath as d,siteLivePath as i,sitePath as r,siteSettingsPath as P}from"@allyhub/protocol/sites";export const listSites=async e=>y.parse(await e.json(n)),createSite=async(e,t)=>o.parse(await e.json(n,{method:"POST",body:t})),addDeployment=async(e,t,s)=>S.parse(await e.json(d(t),{method:"POST",body:s,signal:AbortSignal.timeout(12e4)})),siteDetail=async(e,t)=>m.parse(await e.json(r(t)));const a=(e,t)=>t?`${e}?${p}`:e;export const goLive=async(e,t,s,c={})=>h.parse(await e.json(a(i(t),c.person===!0),{method:"PUT",body:{deployment:s}})),unpublishSite=async(e,t)=>o.parse(await e.json(a(i(t),!0),{method:"DELETE"})),removeSite=async(e,t)=>{await e.json(a(r(t),!0),{method:"DELETE"})},changeSite=async(e,t,s)=>o.parse(await e.json(a(P(t),!0),{method:"PUT",body:s}));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{BILLING_SUMMARY_PATH as
|
|
2
|
+
import{BILLING_SUMMARY_PATH as i,BillingSummarySchema as e}from"@allyhub/protocol/cloud";import{BROWSER_LINK_PATH as o,BrowserLinkSchema as t}from"@allyhub/protocol/auth";import{ORGANIZATIONS_PATH as s,OrganizationsSchema as c}from"@allyhub/protocol/teams";export async function billingSummary(n){return e.parse(await n.json(i))}export async function organizations(n){return c.parse(await n.json(s)).organizations}export async function browserLink(n,a){return t.parse(await n.json(o,{method:"POST",body:{to:a}})).url}export async function webLink(n,a){const r=new URL(a,n.config.url);return n.config.apiKey!==void 0?r.href:browserLink(n,`${r.pathname}${r.search}`).catch(()=>r.href)}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
export{cloudConfig,hostsText}from"./config.js";export{CloudError,cloudWork,notSignedIn,SIGN_IN}from"./errors.js";export{Cloud,callsMadeInBackground,scrub}from"./client.js";export{CATALOG_CACHE_SECONDS,findTool,loadCatalog}from"./catalog.js";export{POLL_SECONDS,READ_SECONDS,RETRY_SECONDS,WAIT_SECONDS,callTool,resumeJob}from"./call.js";export{REUSE_LEFT_MS,UPLOAD_CONCURRENCY,UPLOAD_TYPES,uploadFiles,urlExpiry,withKnownUploads}from"./uploads.js";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{createHash as b}from"node:crypto";import{chmod as U,mkdir as F,readFile as x,realpath as S,stat as P,writeFile as C}from"node:fs/promises";import{basename as D,dirname as N,extname as _,isAbsolute as L,join as R,relative as A,resolve as g}from"node:path";import{EXIT as
|
|
2
|
+
import{createHash as b}from"node:crypto";import{chmod as U,mkdir as F,readFile as x,realpath as S,stat as P,writeFile as C}from"node:fs/promises";import{basename as D,dirname as N,extname as _,isAbsolute as L,join as R,relative as A,resolve as g}from"node:path";import{EXIT as $}from"@allyhub/protocol/cli";import{FILES_PATH as M,FILE_MAX_BYTES as O,FileContentResponseSchema as z,FileCreatedSchema as v,UploadedFileSchema as X,fileContentPath as q,fileDonePath as H}from"@allyhub/protocol/cloud";import{CloudError as p}from"./errors.js";export const UPLOAD_TYPES={jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",mp3:"audio/mpeg",wav:"audio/wav",m4a:"audio/mp4",aac:"audio/aac",ogg:"audio/ogg",oga:"audio/ogg",flac:"audio/flac",mp4:"video/mp4",mov:"video/quicktime",webm:"video/webm"},REUSE_LEFT_MS=3600*1e3;const K=720*60*60*1e3;export const UPLOAD_CONCURRENCY=4;const Y=Object.keys(UPLOAD_TYPES).map(e=>`.${e}`).join(", ");async function j(e){const t=(await e.key())?.account??"",i=b("sha256").update(`${e.url}
|
|
3
3
|
${t}`).digest("hex").slice(0,12);return R(e.config.cacheDir,`uploads-${i}.json`)}async function E(e){try{const t=JSON.parse(await x(e,"utf8"));return{files:t.files??{},urls:t.urls??{}}}catch{return{files:{},urls:{}}}}async function J(e,t){const i=Date.now();for(const[c,o]of Object.entries(t.urls))i-Date.parse(o.expiresAt??o.at)>K&&Reflect.deleteProperty(t.urls,c);await F(N(e),{recursive:!0}),await C(e,JSON.stringify(t),{mode:384}),await U(e,384)}export function urlExpiry(e){let t;try{t=new URL(e).searchParams}catch{return}const i=/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})Z$/u.exec(t.get("X-Amz-Date")??""),c=Number(t.get("X-Amz-Expires"));if(!i||!Number.isFinite(c)||c<=0)return;const[o,r,l,a,n,u]=i.slice(1).map(Number);return new Date(Date.UTC(o,r-1,l,a,n,u)+c*1e3).toISOString()}const T=async e=>await S(g(e)).catch(()=>g(e)),y=(e,t)=>{const i=A(e,t);return i.startsWith("..")||L(i)},w=(e,t)=>new p("bad-input",e,{exit:$.usage,...t===void 0?{}:{hint:t}});async function W(e,t){const i=g(t.base,e),c=()=>w(`${e} is not inside ${String(t.inside)}.`,"Upload a file of the project.");if(t.inside!==void 0&&y(g(t.inside),i))throw c();const o=await P(i).catch(()=>{});if(!o?.isFile())throw w(`There is no file ${i}.`,"A relative path is read from the folder it is run in.");const r=await S(i);if(t.inside!==void 0&&y(await T(t.inside),r))throw c();const l=_(r).slice(1).toLowerCase(),a=UPLOAD_TYPES[l];if(a===void 0)throw w(`${e} is a${l?` .${l}`:"n unnamed"} file; an upload is one of ${Y}.`,"Convert it first, for example with ffmpeg.");if(o.size>O)throw w(`${e} is ${String(o.size)} bytes; AllyHub keeps files of at most ${String(O)}.`,"Make it smaller first, for example with ffmpeg.");const n=await x(r);return{given:e,path:r,type:a,sha256:b("sha256").update(n).digest("hex"),bytes:n}}async function B(e,t,i){const c=new Array(e.length);let o=0;const r=async()=>{for(;o<e.length;){const l=o++;c[l]=await i(e[l])}};return await Promise.all(Array.from({length:Math.min(t,e.length)},r)),c}async function k(e,t,i,c){const o=i.files[t.sha256];if(o&&!c)return{fileId:o.fileId,known:!0};const r={name:D(t.path),size:t.bytes.length,sha256:t.sha256,contentType:t.type},l=v.parse(await e.json(M,{method:"POST",body:r}));if(l.upload!==null){const n=await e.config.fetch(l.upload.url,{method:"PUT",headers:l.upload.headers,body:new Uint8Array(t.bytes),signal:AbortSignal.timeout(3e5)});if(!n.ok)throw new p("upload-failed",`Storage refused ${t.given}: ${String(n.status)} ${(await n.text()).slice(0,200)}`,{exit:$.platform})}const a=X.parse(await e.json(H(l.id),{method:"POST"}));return i.files[t.sha256]={fileId:a.id,path:t.path,bytes:t.bytes.length},{fileId:a.id,known:!1}}const I=async(e,t)=>z.parse(await e.json(q(t,"inline"))).url;export async function uploadFiles(e,t,i){if(t.length===0)throw w("Name at least one file to upload.");const c=[];for(const a of t)c.push(await W(a,{base:i.base,...i.inside===void 0?{}:{inside:i.inside}}));await e.requireKey();const o=await j(e),r=await E(o),l=await B(c,i.concurrency??UPLOAD_CONCURRENCY,async a=>{const n=(s,d,f,m,h)=>({ok:!0,file:a.given,path:a.path,fileId:s,url:d,...f===void 0?{}:{expiresAt:f},sha256:a.sha256,bytes:a.bytes.length,contentType:a.type,known:m,reused:h}),u=r.files[a.sha256];if(u){const s=Date.now(),d=Object.entries(r.urls).find(([,f])=>f.sha256===a.sha256&&f.expiresAt!==void 0&&Date.parse(f.expiresAt)-s>=REUSE_LEFT_MS);if(d)return u.path=a.path,n(u.fileId,d[0],d[1].expiresAt,!0,!0)}try{let s=await k(e,a,r,!1),d;try{d=await I(e,s.fileId)}catch(h){if(!s.known||!(h instanceof p)||h.status!==404)throw h;s=await k(e,a,r,!0),d=await I(e,s.fileId)}const f=urlExpiry(d);r.urls[d]={sha256:a.sha256,...f===void 0?{}:{expiresAt:f},at:new Date().toISOString()};const m=r.files[a.sha256];return m&&(m.path=a.path),n(s.fileId,d,f,s.known,!1)}catch(s){if(!(s instanceof p)||s.code==="not-signed-in")throw s;return{ok:!1,file:a.given,error:new p(s.code==="api-error"?"upload-failed":s.code,`Uploading ${a.given} failed. ${s.message}`,{exit:s.exit,...s.hint?{hint:s.hint}:{}})}}});return await J(o,r),l}export async function withKnownUploads(e,t,i){const c=await E(await j(e)),o=await T(i),r=n=>y(o,n)?n:A(o,n),l=new Map;for(const[n,u]of Object.entries(c.urls)){const s=c.files[u.sha256];s&&l.set(n,{uploaded:r(s.path),sha256:u.sha256,bytes:s.bytes})}const a=n=>typeof n=="string"?l.get(n)??n:Array.isArray(n)?n.map(a):typeof n=="object"&&n!==null?Object.fromEntries(Object.entries(n).map(([u,s])=>[u,a(s)])):n;return a(t)}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{copyFile as c,mkdir as p,mkdtemp as s,rm as w}from"node:fs/promises";import{tmpdir as v}from"node:os";import{dirname as x,extname as I,join as r}from"node:path";import{WORK_DIR as g
|
|
2
|
+
import{copyFile as c,mkdir as p,mkdtemp as s,rm as w}from"node:fs/promises";import{tmpdir as v}from"node:os";import{dirname as x,extname as I,join as r}from"node:path";import{WORK_DIR as g}from"@allyhub/formats/layout";import{genFileFor as k}from"@allyhub/formats/data/gen";import{EXIT as F}from"@allyhub/protocol/cli";import{callTool as b}from"./call.js";import{CloudError as h}from"./errors.js";import{toolWords as D,writeWords as W}from"./records.js";export function sayInput(t){return{...t.params??{},text:t.text,...t.voice===void 0?{}:{voiceId:t.voice}}}export async function makeSay(t,e,n,f){const u=await s(r(v(),"allyhub-voice-"));try{const o=await b(t,n.tool,sayInput(n),{...f,outDir:u,outputDir:r(e,g,"voice"),wait:!0});if("jobId"in o||o.file===void 0)throw new h("no-audio",`${n.tool} returned no audio file.`,{exit:F.platform});const d=D(o.output)??[],a=o.output.durationSeconds,m=typeof a=="number"?a:d.at(-1)?.end??0,i=`${n.stem}${I(o.file).toLowerCase()||".mp3"}`;await p(x(r(e,i)),{recursive:!0}),await c(o.file,r(e,i)),o.gen&&await c(o.gen,r(e,k(i)));const l=await W(r(e,i),d,m>=0?m:void 0);return{file:i,words:l.slice(e.length+1),seconds:m,credits:o.credits??0}}finally{await w(u,{recursive:!0,force:!0})}}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allyhub/cloud",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"default": "./dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"./tools": {
|
|
11
|
+
"types": "./dist/tools.d.ts",
|
|
12
|
+
"default": "./dist/tools.js"
|
|
9
13
|
}
|
|
10
14
|
},
|
|
11
15
|
"private": true,
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{createHash as h}from"node:crypto";import{posix as c}from"node:path";export const OFFLINE_LIMITS={file:20*1024*1024,page:60*1024*1024};const g={"text/css":".css","text/javascript":".js","application/javascript":".js","application/x-javascript":".js","application/json":".json","font/woff2":".woff2","font/woff":".woff","font/ttf":".ttf","font/otf":".otf","application/font-woff2":".woff2","application/font-woff":".woff","image/png":".png","image/jpeg":".jpg","image/gif":".gif","image/webp":".webp","image/avif":".avif","image/svg+xml":".svg"},d=n=>n.split(";")[0]?.trim().toLowerCase()??"",w=n=>d(n)==="text/css";export function keptPathOf(n,r){let f;try{f=new URL(n)}catch(t){if(t instanceof TypeError)return;throw t}if(f.protocol!=="https:")return;const o=f.pathname.split("/").filter(t=>t!=="").map(t=>t==="."||t===".."?"_":t);let e=o.pop()??"index";f.search!==""&&(e=`${e}-${h("sha256").update(f.search).digest("hex").slice(0,10)}`);const a=g[d(r)];return a!==void 0&&!e.toLowerCase().endsWith(a)&&(e+=a),["_net",f.host,...o,e].join("/")}function u(n,r,f){let o=n;for(const[e,a]of[...f].sort((t,p)=>p[0].length-t[0].length)){const t=c.relative(r,a);o=o.split(e).join(t);const p=e.replaceAll("&","&");p!==e&&(o=o.split(p).join(t))}return o}export function offlinePage(n,r,f){const o=c.dirname(n)==="."?"":c.dirname(n),e=new Map;let a=0;for(const i of f){if(e.has(i.url))continue;const s=keptPathOf(i.url,i.mime);if(s===void 0)continue;const l=i.body.byteLength;l>OFFLINE_LIMITS.file||a+l>OFFLINE_LIMITS.page||(a+=l,e.set(i.url,{path:o===""?s:`${o}/${s}`,file:i}))}if(e.size===0)return[];const t=new Map([...e].map(([i,s])=>[i,s.path])),p=new TextEncoder,m=[{path:n,type:"text/html; charset=utf-8",bytes:p.encode(u(r,o,t))}];for(const{path:i,file:s}of e.values())m.push({path:i,type:s.mime,bytes:w(s.mime)?p.encode(u(new TextDecoder().decode(s.body),c.dirname(i),t)):s.body});return m}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{once as
|
|
2
|
+
import{once as S}from"node:events";import{createServer as v}from"node:http";import{posix as R}from"node:path";import{getRequestListener as P}from"@hono/node-server";import{pathProblem as x}from"./paths.js";import{forwarded as $}from"./ports.js";import{fileResponse as C}from"./respond.js";import{inside as L}from"./tree.js";export const PAGE_POLICY=["default-src 'self' data: blob:","script-src 'self' 'unsafe-inline' 'unsafe-eval' blob:","style-src 'self' 'unsafe-inline'","img-src 'self' data: blob:","font-src 'self' data:","connect-src 'self' data: blob:","media-src 'self' data: blob:"].join("; "),NETWORK_PAGE_POLICY=["default-src 'self' data: blob: https:","script-src 'self' 'unsafe-inline' 'unsafe-eval' blob: https:","style-src 'self' 'unsafe-inline' https:","img-src 'self' data: blob: https:","font-src 'self' data: https:","connect-src 'self' data: blob:","media-src 'self' data: blob: https:"].join("; "),PAGE_SOURCE="page";export class Pages{o;origins=new Map;constructor(n){this.o=n}async url(n,s,o,l={}){const a=await this.origin(s);a.pages.set(o,n),l.network===!0?a.network.add(o):a.network.delete(o);const d=a.port.url.endsWith("/")?a.port.url:`${a.port.url}/`,f=s===""?o:o.slice(s.length+1);return`${d}${f.split("/").map(encodeURIComponent).join("/")}`}origin(n){let s=this.origins.get(n);return s||(s=this.start(n),this.origins.set(n,s),s.catch(()=>{this.origins.get(n)===s&&this.origins.delete(n)})),s}async start(n){const{root:s,inputs:o}=this.o,l=new Map,a=new Set,d=new Map;let f=new Set;const g=r=>{let t;try{t=decodeURIComponent(r).replace(/^\/+/u,"")}catch{return}(t===""||t.endsWith("/"))&&(t=`${t}index.html`);const e=n===""?t:`${n}/${t}`;if(x(e)===void 0&&!e.split("/").some(c=>c.startsWith(".")))return R.normalize(e)},b=(r,t)=>{const e=l.get(r);if(e!==void 0){o.set(e,PAGE_SOURCE,[r]);for(const i of d.values())i.delete(e);return new Set([e])}let c;try{const i=t===void 0?void 0:new URL(t);i&&f.has(i.host)&&(c=g(i.pathname))}catch{c=void 0}if(c!==void 0){const i=l.get(c);if(i!==void 0)return new Set([i]);const u=d.get(c);if(u)return new Set(u)}return new Set(l.values())},y=P(async r=>{const t=new URL(r.url),e=g(t.pathname);if(e===void 0)return new Response("not found",{status:404});const c=b(e,r.headers.get("referer")??void 0),i=d.get(e)??new Set;for(const w of c)i.add(w),o.add(w,PAGE_SOURCE,e);d.set(e,i);const u=L(s,e);return u?C(u,r.headers.get("range")??void 0,{"content-security-policy":a.has(e)?NETWORK_PAGE_POLICY:PAGE_POLICY,"cache-control":"no-store","x-content-type-options":"nosniff"}):new Response("not found",{status:404})}),p=v((r,t)=>{if(!f.has(r.headers.host??"")){t.writeHead(403,{"content-type":"text/plain; charset=utf-8"}),t.end("forbidden host");return}y(r,t)});p.listen(0,"127.0.0.1"),await S(p,"listening");const h=p.address().port,m=$(this.o.ports,h);return f=new Set([`127.0.0.1:${String(h)}`,`localhost:${String(h)}`,...m.hosts,new URL(m.url).host]),{server:p,port:m,pages:l,network:a,loads:d}}async close(){const n=[...this.origins.values()];this.origins.clear();for(const s of n){const o=await s.catch(()=>{});o&&(o.port.dispose(),o.server.closeAllConnections(),await new Promise(l=>o.server.close(l)))}}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{isListedFile as v,itemNameOf as g,listedWork as T,listsFile as k,projectPath as S}from"@allyhub/formats";import{randomBytes as E}from"node:crypto";import{isAbsolute as y,relative as j,resolve as I,sep as P}from"node:path";import{AGENT_NAME as N,FILE_METHODS as R,HOST_METHODS as x,JSONRPC as
|
|
2
|
+
import{isListedFile as v,itemNameOf as g,listedWork as T,listsFile as k,projectPath as S}from"@allyhub/formats";import{randomBytes as E}from"node:crypto";import{isAbsolute as y,relative as j,resolve as I,sep as P}from"node:path";import{AGENT_NAME as N,FILE_METHODS as R,HOST_METHODS as x,JSONRPC as h,PRESENCE_METHODS as D,PROJECT_TOOLS as l,RPC_ERROR as d,RequestSchema as M,RpcError as f,answer as p}from"@allyhub/protocol";import{listFiles as _,projectItems as C,readWork as F}from"@allyhub/build";import{Checker as A,Indexer as J}from"./background.js";import{TRASH_KEPT_DAYS as H,movesOfDeletion as L}from"./deletion.js";import{Exports as q}from"./exports.js";import{downloadsFolder as W,hasFileManager as B,revealFile as $}from"./reveal.js";import{Live as K}from"./live.js";import{Inputs as U}from"./inputs.js";import{Pages as Y}from"./pages.js";import{fileIn as O}from"./paths.js";import{kindContext as G}from"./kinds.js";import{Presence as V}from"./presence.js";import{Texts as X}from"./texts.js";import{contributedTool as z,contributedTools as Q,projectToolContext as Z,toolHandlers as ee}from"./tools.js";import{Watcher as te}from"./watcher.js";import{Writer as se}from"./writer.js";export const SERVER_METHODS={...R,"tools/call":x["tools/call"],...D};const ie=5e3,ne="sidebar";export class ProjectServer{root;writer;watcher;live;exports;presence;inputs=new U;pages;texts;placing=Promise.resolve();telling=Promise.resolve();listed;extensions;reveal;checker;serving;indexer;clients=new Map;contributed;services;held=new Map;unhearJobs;constructor(e){this.root=I(e.root),this.services={...e.jobs===void 0?{}:{jobs:e.jobs},...e.cloud===void 0?{}:{cloud:e.cloud},...e.env===void 0?{}:{env:e.env},...e.ports===void 0?{}:{ports:e.ports}},this.unhearJobs=e.jobs?.on(t=>{if(!y(t.about.id))return;const s=j(this.root,t.about.id);s===""||s.startsWith("..")||y(s)||this.notify("jobs/changed",{job:t,item:s.split(P).join("/")})})??(()=>{}),this.contributed=Q(e.kinds,e.extensions?.projectTools()??[]),this.extensions=e.extensions,this.live=new K(this.root,{kinds:e.kinds,...e.gpu===void 0?{}:{gpu:e.gpu},recordInputs:(t,s,r)=>{const n=[...r];this.listedItems().then(a=>{const c=a.find(u=>u.entry===t);c&&this.inputs.set(c.id,s,n)})}}),this.pages=new Y({root:this.root,ports:e.ports,inputs:this.inputs}),this.presence=new V(t=>{this.notify("presence/changed",{collaborators:t})}),this.texts=new X(this.root),this.watcher=new te(this.root,(t,s)=>{this.sendTo(this.watchOwner(t),"files/changed",{watch:t,changes:s})},(t,s)=>{this.live.moved(t),this.notify("project/changed",{revision:t}),this.checker?.schedule(),this.telling=this.telling.then(()=>this.tellItems(s))},{by:{kind:"agent",name:N},moved:t=>{this.placing=this.placing.then(()=>this.wroteOutside(t))}}),this.writer=new se(this.root,e.kinds,(t,s)=>{for(const r of t)this.texts.set(r.path,r.text);this.watcher.wrote(t.map(({path:r,version:n})=>({path:r,version:n})),s)},e.writable),this.reveal=e.reveal===!1?void 0:e.reveal??(B()?$:void 0),this.exports=new q(this.root,e.kinds,t=>{this.notify("export/changed",{job:t})},e.jobs===void 0?void 0:{jobs:e.jobs,nameOf:async t=>{const{items:s}=await this.tool("project/items",{}),r=s.find(n=>n.id===t);return g(r??{id:t})}},{...e.extensions?{processors:e.extensions.exportProcessors(),analyses:e.extensions.mediaAnalyses()}:{},...this.reveal===void 0||e.exportsTo===!1?{}:{saveTo:e.exportsTo??W}});const i=e.index??process.env.ALLYHUB_NO_INDEX!=="1";if(e.check!==!1){const t=i?new J({root:this.root,analyses:e.extensions?.mediaAnalyses()??[],env:e.env??process.env,emit:r=>{this.notify("index/changed",{jobs:r})},made:()=>{this.checker?.schedule(!0)}}):void 0;this.indexer=t;const s=e.extensions?.fileEditors();this.checker=new A({live:this.live,...s===void 0?{}:{files:s},emit:r=>{this.notify("check/changed",r)},...t?{needs:r=>{t.want(r)}}:{},...e.settle===void 0?{}:{settle:e.settle}})}}static open(e){const i=new ProjectServer(e);return i.watcher.start(),i.checker?.schedule(),i.texts.warm(),Promise.resolve(i)}async settled(){await this.watcher.settled(),await this.placing,await this.telling}async tellItems(e){if(e.length===0)return;const i=await this.listedItems();for(const[t,s]of this.inputs.affected(i,e))this.notify("items/changed",{item:t,paths:s})}async wroteOutside(e){let i;for(const s of e){const{changed:r,lines:n}=await this.texts.changed(s).catch(()=>({changed:!1,lines:void 0}));r&&(i={path:s,...n})}if(i===void 0)return;const t=await this.itemOf(i.path);this.presence.agent({doing:"editing",...t===void 0?{}:{item:t},source:i})}async itemOf(e){const i=await this.listedItems(),t=i.filter(s=>s.dir!==""&&e.startsWith(`${s.dir}/`)).sort((s,r)=>r.dir.length-s.dir.length);return(i.find(s=>s.entry===e)??i.find(s=>s.files!==void 0&&k(s.files,e))??t[0])?.id}async listedItems(){const e=Date.now();return this.listed!==void 0&&e-this.listed.at<ie||(this.listed={at:e,items:this.tool("project/items",{}).then(t=>t.items,()=>[])}),await this.listed?.items??[]}owners=new Map;watchOwner(e){return this.owners.get(e)}connect(e,i={}){const t=`c${E(6).toString("hex")}`;this.clients.set(t,e);const s=this.handlersFor(t,i.origin);return{id:t,receive:async r=>{const n=await this.answerOne(s,r);n&&e(n)},close:()=>{this.clients.delete(t),this.watcher.forget(t);for(const[r,n]of this.owners)n===t&&this.owners.delete(r)}}}channel(){const e=new Set,i=this.connect(t=>{const s=JSON.parse(JSON.stringify(t));queueMicrotask(()=>{for(const r of e)r(s)})});return{send:t=>{i.receive(JSON.parse(JSON.stringify(t)))},listen:t=>(e.add(t),()=>e.delete(t)),close:()=>{i.close()}}}notify(e,i){for(const t of this.clients.values())t({jsonrpc:h,method:e,params:i})}sendTo(e,i,t){e!==void 0&&this.clients.get(e)?.({jsonrpc:h,method:i,params:t})}async answerOne(e,i){const t=M.safeParse(i);if(!t.success){const r=i?.id;return typeof r!="string"&&typeof r!="number"?void 0:{jsonrpc:h,id:r,error:{code:d.invalidRequest,message:"Not a JSON-RPC request."}}}const s=t.data;return Object.hasOwn(x,s.method)&&s.method!=="tools/call"?{jsonrpc:h,id:s.id,error:{code:d.methodNotFound,message:`${s.method} is answered by the page that hosts the editor, not by allyhub dev's server.`}}:p(SERVER_METHODS,e,s)}handlersFor(e,i){const{writer:t,watcher:s}=this,r=this.toolSet(()=>this.serving?.tree(i));return{"files/read":({path:n})=>t.read(n),"files/write":async({path:n,text:a,over:c})=>({version:await t.write(n,a,c,e)}),"files/upload":async({dir:n,name:a,data:c})=>({path:await t.upload(n,a,Buffer.from(c,"base64"),e)}),"files/url":async({path:n})=>{if(await O(this.root,n),!this.serving)throw new f(d.unavailable,"This server serves no files over HTTP: only allyhub dev's does.");return{url:this.serving.file(i,n)}},"files/list":({dir:n})=>t.list(n),"files/move":async({from:n,to:a})=>({rewritten:await t.move(n,a,e)}),"files/remove":async({path:n})=>({trash:await t.remove(n,e)}),"files/trash":async()=>({entries:await t.trash()}),"files/restore":async({id:n})=>({path:await t.restore(n,e)}),"files/watch":async({paths:n})=>{for(const c of n)await O(this.root,c);const a=await s.watch(e,n);return this.owners.set(a,e),{watch:a}},"files/unwatch":({watch:n})=>(this.owners.get(n)===e&&(s.unwatch(n),this.owners.delete(n)),Promise.resolve({})),"tools/call":async({name:n,arguments:a})=>({result:await this.runTool(r,n,a)}),"presence/get":()=>Promise.resolve({collaborators:this.presence.list()})}}toolSet(e){const i=this.toolContext(e);return{core:ee(i),context:Z(i)}}async runTool(e,i,t){const s={jsonrpc:h,id:0,method:i,params:t},r=Object.hasOwn(l,i)?void 0:this.contributed.get(i);let n;if(r===void 0)n=await p(l,e.core,s);else{const a=await z(r).catch(c=>{throw new f(d.internal,c instanceof Error?c.message:String(c))});n=await p({[i]:a},{[i]:c=>a.run(c,e.context)},s)}if("error"in n)throw new f(n.error.code,n.error.message,n.error.data);return n.result}hasTool(e){return Object.hasOwn(l,e)||this.contributed.has(e)}toolContext(e){return{live:this.live,checker:this.checker,exports:this.exports,reveal:this.reveal,tree:e,extensions:this.extensions,services:this.services,held:this.held,kindContext:G(this.root,i=>this.hasTool(i),(i,t)=>this.tool(i,t)),inputs:this.inputs,pages:this.pages}}async tool(e,i,t={}){const s=await this.runTool(this.toolSet(()=>t.tree??this.serving?.tree(void 0)),e,i);return Object.hasOwn(l,e)?l[e].result.parse(s):s}async planDeletionOfItem(e){const i=await _(this.root),{listed:t}=await C(this.root,this.live.kinds,i,this.extensions?.fileEditors()??[]),s=t.find(o=>o.id===e);if(s===void 0)throw new f(d.notFound,`There is no item ${e}.`);const r=this.live.latest(),n=new Map((r?.items??[]).map(o=>[o.id,o.files])),a=o=>{const m=!v(o);return{id:o.id,entry:o.entry,ofKind:m,files:m?n.get(o.id):[{path:o.entry}],inputs:[...this.inputs.of(o.id)]}},{work:c}=await F(this.root),{moves:u,stays:b}=L({target:a(s),others:t.filter(o=>o.id!==e).map(a),listed:T(c).map(o=>S(o.file)).filter(o=>o!==s.entry),files:i}),w=r?.pieces.find(o=>o.place===e)?.title;return{item:e,name:g(s,typeof w=="string"?w:void 0),...v(s)?{}:{kind:s.kind},entry:s.entry,moves:u,stays:b}}deleteItemFromSidebar(e,i={}){return this.writer.moveToTrashAndUnlist({planNow:()=>this.planDeletionOfItem(e),keptDays:i.keptDays??H,...i.now===void 0?{}:{now:i.now}},ne)}async close(){this.unhearJobs(),this.presence.close(),this.watcher.close(),this.clients.clear();for(const e of[...this.held.values()].reverse())await Promise.resolve(e.dispose()).catch(()=>{});this.held.clear(),await this.pages.close(),await this.checker?.close(),await this.indexer?.close(),await this.exports.close(),await this.live.close()}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{readdir as
|
|
2
|
+
import{readFile as ne,readdir as ie,realpath as re,stat as ae}from"node:fs/promises";import{setTimeout as ce}from"node:timers/promises";import{join as P,relative as de,sep as fe}from"node:path";import{openPage as le}from"@allyhub/browser";import{KeyedStore as ue}from"@allyhub/project";import{NEVER_CANCELLED as pe}from"@allyhub/extension-api";import{COMPONENT_STILLS_MAX as V,KindSnapshotSchema as me,RpcError as X,SNAPSHOT_TREE as b,pieceSourcePath as he,snapshotAnswerPath as T,snapshotPreviewPath as we,stillPath as Q,stillsIndexKey as ge,stillsIndexPath as ye}from"@allyhub/protocol";import{runtimeFiles as be}from"@allyhub/stage-page";import{itemPreview as ke}from"./card.js";import{offlinePage as $e}from"./offline-page.js";import{kindContext as Se,kindItem as Ee}from"./kinds.js";import{USE_FORMS as Pe,mediaTypeOf as F}from"@allyhub/formats";import{Reach as ve,pieceBundle as Me,pieceNames as je,reachedCheck as Ie,reachedSource as Oe}from"./reach.js";import{matteFile as Te}from"./tree.js";const Ne="assets/";export const PAGE_RECORDING={width:1440,height:900,timeout:3e4,settle:1500};const N="https://tree.invalid/";function _(i){return typeof i=="string"?i.startsWith(N)?i.slice(N.length):i:Array.isArray(i)?i.map(_):i!==null&&typeof i=="object"?Object.fromEntries(Object.entries(i).map(([S,a])=>[S,_(a)])):i}const j=i=>new TextEncoder().encode(JSON.stringify(i));async function Y(i){return(await ie(i,{recursive:!0,withFileTypes:!0}).catch(()=>[])).filter(a=>a.isFile()).map(a=>de(i,P(a.parentPath,a.name)).split(fe).join("/"))}const xe=i=>ae(i).then(S=>S.isFile(),()=>!1);export async function recordTree(i,S={}){const{project:a}=i,{live:u,root:y}=a;await a.watcher.settled();const k=new Map,g=(e,t,o=F(e))=>{k.set(e,{path:e,type:o,file:t})},L=(e,t)=>{k.set(e,{path:e,type:F(e),file:t,immutable:!0})},v=(e,t,o=F(e))=>{k.set(e,{path:e,type:o,bytes:t})},W=async(e,t)=>{for(const o of await Y(t))g(`${e}${o}`,P(t,o))},Z=u.revision,d=await u.prepared(),x=new Map;if(i.ui!==void 0)for(const e of await Y(i.ui))(e.startsWith(Ne)?L:g)(`${b.editor}${e}`,P(i.ui,e));for(const[e,t]of await be())g(`${b.runtime}${e}`,t);const I=async(e,t)=>{let o;try{o={result:_(await a.tool(e,t,{tree:N}))}}catch(n){o={error:n instanceof X?{code:n.code,message:n.message}:{code:-32603,message:n instanceof Error?n.message:""}}}const r=T(e,t);v(r,j(o));const f=t.item;return typeof f=="string"&&x.set(f,[...x.get(f)??[],r]),o},ee=Se(y,e=>a.hasTool(e),async(e,t)=>{const o=await I(e,t);if(o.error)throw new X(o.error.code,o.error.message);return o.result}),te=async(e,t,o)=>{const r=new Map;for(const s of o)r.set(ge(s),s);if(r.size===0)return;const f=ue.of(y,"stills"),n={stills:{}},$=p.of(e),m=[...r];for(let s=0;s<m.length;s+=V){const l=m.slice(s,s+V);(await a.tool("components/stills",{item:e,...t===""?{}:{version:t},components:l.map(([,w])=>w)},{tree:N}).catch(()=>{}))?.stills.forEach((w,E)=>{const H=l[E]?.[0];!w||H===void 0||(n.stills[H]=w.key,g(Q(w.key),f.path(`${w.key}.webp`),"image/webp"),$?.tree.add(Q(w.key)))})}const c=ye(e,t);v(c,j(n),"application/json"),$?.tree.add(c)},B=(await I("project/items",{})).result,O=B?.items??[],R=O.filter(e=>e.kind!==void 0),C=O.filter(e=>e.kind===void 0&&e.kindInfo?.share===!0),oe=new Map(d.items.map(e=>[e.id,e.files])),p=new ve([...R.map(e=>({...e,files:oe.get(e.id)??e.files})),...C],d.files,(d.bundle?.beside??[]).map(e=>`${b.build}${e}`)),M=a.checker?.state,D=M===void 0||M.status==="waiting"||M.status==="running"?{status:"off",revision:u.revision,problems:M?.problems??[],facts:M?.facts??[]}:M;v(T("check/results",{}),j({result:D}));for(const e of p.items){const t=p.of(e),o=new Set(d.pieces.filter(n=>n.place===e).map(n=>n.id)),r=O.find(n=>n.id===e)?.entry,f=n=>n===r||p.itemsOf(n).includes(e);t?.own.push({path:T("project/items",{}),type:"application/json",bytes:j({result:{...B,items:O.filter(n=>n.id===e)}})},{path:T("check/results",{}),type:"application/json",bytes:j({result:Ie(D,o,f)})})}for(const e of d.bundle?.chunks.files??[])L(`${b.build}${e}`,P(u.pieceDir,e));for(const e of d.bundle?.beside??[])await W(`${b.build}${e}`,P(u.pieceDir,e));const q=new Set(Object.keys(d.media));for(const e of Object.keys(d.media)){const t=Te(y,d.media[e]);t!==void 0&&await xe(t)&&g(`${b.matte}${e}`,t,"video/mp4")}const A=new Map,G=new Map,se=a.extensions?.fileEditors()??[];for(const e of C)se.some(t=>t.id===e.kindInfo?.editor&&t.page)&&(A.set(e.id,{}),G.set(e.id,e.entry));const J=new Map,K=e=>({file:(t,o,r)=>{g(`${e}${t}`,o,r)},folder:(t,o)=>W(`${e}${t}`,o),bytes:(t,o,r)=>{v(`${e}${t}`,o,r)},media:t=>{q.add(t)}});for(const e of R){const t=await a.extensions?.kindProvider(e.kind);if(!t?.snapshot)continue;const o=await Promise.resolve(t.snapshot(Ee(e),ee,pe)).catch(()=>{}),r=me.safeParse(o??{});if(!r.success)continue;const{stills:f,shows:n,routes:$,page:m}=r.data;m&&A.set(e.id,{...m.folder===void 0?{}:{folder:m.folder},...m.file===void 0?{}:{file:m.file}}),n&&J.set(e.id,{media:new Set(n.media),data:new Set(n.data)});for(const c of f??[])await I("components/stage",{item:e.id,version:c.version}),c.version===""&&await I("components/stage",{item:e.id}),await te(e.id,c.version,c.components);for(const[c,s]of Object.entries($??{})){const l=await u.routes.route(c).catch(()=>{});if(l?.route.recordItem)for(const h of s)await l.route.recordItem(h,K(c),l.context).catch(()=>{})}}for(const e of q)g(`${b.media}${e}`,P(y,e));for(const[e,t]of A){const o=await a.tool("items/page",{item:e,...t}).catch(()=>{});if(!o)continue;const r=new URL(o.url).origin,f=G.get(e),n=await le(await u.browser(),{width:PAGE_RECORDING.width,height:PAGE_RECORDING.height,allow:s=>s===r||s.startsWith(`${r}/`)||f!==void 0&&s.startsWith("https://")}).catch(()=>{});if(!n)continue;const $=[],m=[];try{if(f!==void 0){const s=n.session,l=new Map;s.on("Network.responseReceived",h=>{h.response.url.startsWith("https://")&&h.response.status===200&&l.set(h.requestId,{url:h.response.url,mime:h.response.mimeType})}),s.on("Network.loadingFinished",h=>{const w=l.get(h.requestId);w&&m.push(s.send("Network.getResponseBody",{requestId:h.requestId}).then(E=>{$.push({...w,body:E.base64Encoded?Buffer.from(E.body,"base64"):new TextEncoder().encode(E.body)})},E=>{if(!(E instanceof Error))throw E}))}),await s.send("Network.enable",{})}await n.goto(o.url,{timeoutMs:PAGE_RECORDING.timeout}),await n.evaluate("document.fonts.ready.then(() => true)",{timeoutMs:PAGE_RECORDING.timeout}),await ce(PAGE_RECORDING.settle)}catch{}finally{await Promise.allSettled(m),await n.close()}if(f===void 0||$.length===0)continue;const c=await ne(P(y,f),"utf8").catch(()=>{});if(c!==void 0)for(const s of $e(f,c,$)){const l=`${b.pages}${s.path}`;v(l,s.bytes,s.type),p.of(e)?.tree.add(l)}}for(const e of p.items){const t=p.of(e);if(t)for(const o of a.inputs.of(e))if(o===""||o.endsWith("/"))for(const r of d.files)r.startsWith(o)&&t.files.add(r);else d.files.includes(o)&&t.files.add(o)}for(const e of u.routes.specs.keys()){const t=await u.routes.route(e).catch(()=>{});t?.route.record&&await t.route.record(K(e),t.context).catch(()=>{})}const U=[y,await re(y).catch(()=>y)];for(const e of d.pieces){const t=await u.source(e.id).catch(()=>{});if(!t)continue;const o=[e,...d.pieces.filter(s=>Re(d.items,e.place).has(s.place))],r=o.map(s=>({p:s,bundle:Me(d.bundle?.chunks,s.id)})),f={files:new Set(r.flatMap(s=>[...s.bundle.files])),modules:new Set(r.flatMap(s=>[...s.bundle.modules]))},n={media:new Set,data:new Set};for(const{p:s,bundle:l}of r){const h=je({prepared:d,piece:s,reach:p,modules:l.modules,roots:U,reads:a.checker?.reads.get(s.id),shows:J.get(s.place)});for(const w of h.media)n.media.add(w);for(const w of h.data)n.data.add(w)}const $=d.pieces.filter(s=>!o.includes(s)&&!U.some(l=>f.modules.has(P(l,s.file)))).map(s=>s.id),m=he(e.id);v(m,j(Oe(t,n,$)));const c=p.of(e.place);if(c){c.tree.add(m);for(const s of f.files)c.tree.add(`${b.build}${s}`);for(const s of n.media)c.tree.add(`${b.media}${s}`),c.tree.add(`${b.matte}${s}`),c.files.add(s)}}for(const[e,t]of x)for(const o of t)p.of(e)?.tree.add(o);for(const e of d.docs)for(const t of e.shows)p.of(e.place)?.files.add(t);for(const e of d.sheets)for(const t of e.files)p.of(e.place)?.files.add(t);const z=S.preview===!1?void 0:S.preview??(e=>ke(i,e));if(z)for(const e of R){const t=await z(e).catch(()=>{});if(t===void 0)continue;const o=we(e.id);v(o,Buffer.from(JSON.stringify(t)),"application/json"),p.of(e.id)?.tree.add(o)}return{revision:Z,files:[...k.values()],reach:p.done(new Set(k.keys())),routes:u.routes.loads()}}function Re(i,S){const a=new Map(i.map(k=>[k.id,k])),u=new Set,y=k=>{for(const g of a.get(k)?.uses??[])g.type===Pe.live&&!u.has(g.item)&&(u.add(g.item),y(g.item))};return y(S),u}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{createHash as
|
|
2
|
+
import{createHash as M}from"node:crypto";import{access as y,stat as F}from"node:fs/promises";import{basename as N,join as b,posix as E}from"node:path";import{pathToFileURL as _}from"node:url";import{inTime as T,listWork as D,projectItems as h,stageId as H}from"@allyhub/build";import{NEVER_CANCELLED as W}from"@allyhub/extension-api";import{OUT_DIR as U,fileEditorIn as j,isListedFile as R,listedFileIdOf as A,unscanned as S,WORK_FILE as K}from"@allyhub/formats";import{OpenedVersion as V,componentStills as q,itemDigests as G,keyedStills as z,parseCombo as B}from"@allyhub/project";import{runtimeFile as J,stageFiles as Q}from"@allyhub/stage-page";import{RPC_ERROR as f,RpcError as c,SNAPSHOT_TREE as I,TREE_PAGES as P,listedFileEditor as g,listedKind as $,stillPath as X}from"@allyhub/protocol";import{comboKey as Y,componentRefText as Z}from"@allyhub/piece";import{providedPreview as ee}from"./card.js";import{kindItem as te}from"./kinds.js";import{rpcErrorOf as x}from"./live.js";import{pathProblem as ne}from"./paths.js";import{forwarded as oe}from"./ports.js";import{inside as ie}from"./tree.js";const re=n=>M("sha256").update(n).digest("base64url").slice(0,16);async function O(n,t,o){const e=t.replace(/^\.\//u,""),i=(await h(n.live.root,n.live.kinds)).items.find(u=>u.id===e||u.entry===e),s=i?void 0:await se(n,e),r=i?.id??s;if(r===void 0)throw new c(f.notFound,`There is no item ${t} in the project's list, nor a file of the project an editor opens.`);const d=(o.folder??"").replace(/\/+$/u,""),a=o.file??i?.entry??r;if(d!==""&&!a.startsWith(`${d}/`))throw new c(f.invalid,`${a} is not in the folder ${d} the page is served from.`);return n.pages.url(r,d,a,{network:s!==void 0})}async function se(n,t){if(S(t)||ne(t)!==void 0||!j(n.extensions?.fileEditors()??[],t))return;const o=ie(n.live.root,t);return o&&await F(o).then(i=>i.isFile(),()=>!1)?A(t):void 0}const v=(n,t)=>{const o=n.tree();if(o===void 0)throw new c(f.unavailable,"This server serves no pages: only allyhub dev's does.");return new URL(t,o).href},C=(n,t,o)=>({url:v(n,`${t}?${o.toString()}`),probe:v(n,P.probe)});async function ae(n,t,o){if(t.title!==void 0)return t.title;const e=await n.extensions?.kindProvider(t.kind);if(!e?.title)return(await o()).get(t.id);try{const i=await e.title(te(t),n.kindContext,W);return typeof i=="string"?i:void 0}catch{return}}export function contributedTools(n,t=[]){const o=new Map;for(const e of n)for(const i of e.projectTools??[])o.has(i.name)||o.set(i.name,i);for(const e of t)o.has(e.name)||o.set(e.name,e);return o}const k=new Map;export async function contributedTool(n){let t=k.get(n.module);t||(t=import(_(n.module).href).then(e=>{if(typeof e.default!="object"||e.default===null)throw new Error(`${n.extension}'s project tools (${n.module}) have no default export.`);return e.default}),k.set(n.module,t),t.catch(()=>{k.get(n.module)===t&&k.delete(n.module)}));const o=(await t)[n.name];if(!o)throw new Error(`${n.extension} contributes the project tool "${n.name}" but its module (${n.module}) has none of that name.`);return o}export function projectToolContext(n){const{live:t}=n,o=new Map;return{root:t.root,kinds:t.kinds,prepared:()=>t.prepared(),target:(e,i)=>t.target(e,i),itemCode:e=>t.itemCode(e),items:async()=>(await h(t.root,t.kinds)).items,async version(e,i,s,r){try{return await t.withSession(async d=>{const a=await V.open({root:t.root,item:e,...i===void 0?{}:{combos:[B(i)]},purpose:s,session:d});try{return await r(a)}finally{await a.close()}})}catch(d){throw x(d)}},async componentStills(e,i,s){try{const r=await t.prepared(),{gpu:d}=await t.browser();return await z(i,{prepared:r,item:e,combo:s,gpu:d,withSession:a=>t.withSession(a)})}catch(r){throw x(r)}},served:e=>v(n,e),page:(e,i)=>C(n,e,i),buildDir:t.pieceDir,stageStyles:()=>Q().fontCss.flatMap(e=>{const i=J(e);return i===void 0?[]:[{file:i,url:v(n,`${I.runtime}${e}`)}]}),kept(e,i){return o.has(e)||o.set(e,i()),o.get(e)},held(e,i){return n.held.has(e)||n.held.set(e,i()),n.held.get(e)},jobs:n.services.jobs,cloud:n.services.cloud,env:n.services.env??process.env,forward:e=>oe(n.services.ports,e),pageOf:(e,i={})=>O(n,e,i),recordInputs:(e,i,s)=>{n.inputs.set(e,i,s)}}}export function toolHandlers(n){const{live:t}=n;return{"project/items":async()=>{const o=await h(t.root,t.kinds,void 0,n.extensions?.fileEditors()??[]);let e;const i=()=>e??=(async()=>{const a=await t.prepared().catch(()=>t.latest()),u=new Map;for(const l of a?.pieces??[]){const p=typeof l.title=="string"?l.title:void 0;p&&u.set(l.place,p)}return u})(),s=new Map((t.latest()?.items??[]).map(a=>[a.id,a.files])),r=n.extensions?.fileEditors()??[];return{items:await Promise.all(o.listed.map(async a=>{const u={id:a.id,dir:a.dir,entry:a.entry,...a.title===void 0?{}:{title:a.title},groups:a.groups};if(R(a)){const w=r.find(L=>L.id===a.editor);return{...u,...w?{kindInfo:g(w)}:{}}}const l=await ae(n,a,i),p=t.kinds.find(w=>w.id===a.kind),m=s.get(a.id);return{...u,kind:a.kind,...l?{title:l}:{},...m?{files:m}:{},...p?{kindInfo:$(p)}:{}}})),kinds:t.kinds.map(a=>({id:a.id,...$(a)})),name:N(t.root),scope:re(t.root),revision:t.revision}},"project/file":async({path:o})=>{const e=o.replace(/^\.\//u,""),i=n.extensions?.fileEditors()??[],r=(await h(t.root,t.kinds,void 0,i)).listed.find(l=>l.entry===e||l.id===e);if(r){const l={id:r.id,dir:r.dir,entry:r.entry,...r.title===void 0?{}:{title:r.title},groups:r.groups};if(R(r)){const m=i.find(w=>w.id===r.editor);return{item:{...l,...m?{kindInfo:g(m)}:{}}}}const p=t.kinds.find(m=>m.id===r.kind);return{item:{...l,kind:r.kind,...p?{kindInfo:$(p)}:{}}}}const d=!S(e)&&await F(b(t.root,e)).then(l=>l.isFile(),()=>!1),a=d?j(i,e):void 0;if(!a)throw new c(f.notFound,d?`No editor opens ${e} by its name.`:`The project has no file ${e}.`);const u=E.dirname(e);return{item:{id:e,dir:u==="."?"":u,entry:e,groups:[],kindInfo:g(a)}}},"items/preview":async({item:o})=>{const e=o.replace(/^\.\//u,""),i=(await h(t.root,t.kinds)).items.find(r=>r.id===e||r.entry===e);if(!i)throw new c(f.notFound,`There is no item ${o} in the project's list.`);const s=await ee(n.extensions,i,n.kindContext);return s===void 0?{}:{preview:s}},"items/page":async({item:o,folder:e,file:i})=>({url:await O(n,o,{folder:e,file:i})}),"work/add":async({kind:o,file:e,title:i})=>{if(!t.kinds.some(s=>s.id===o))throw new c(f.invalid,`No extension here contributes the kind ${o}.`);return await y(b(t.root,e)).catch(()=>{throw new c(f.notFound,`There is no file ${e} to list in ${K}.`)}),await D(t.root,{kind:o,file:e,...i===void 0?{}:{title:i}}),{}},"components/list":async({item:o})=>{const e=await t.prepared(),i=e.items.find(s=>s.id===o||s.entry===o)?.dir??o;return{components:e.components.map(s=>{const r=E.relative(i,s.file);return{of:Z({path:r.startsWith(".")?r:`./${r}`,name:s.export}),name:s.name,...s.label===void 0?{}:{label:s.label}}})}},"components/stage":async({item:o,version:e})=>{const{prepared:i,host:s,combo:r}=await t.componentHost(o,e);if(!("components"in s)&&T(s,i.kinds))throw new c(f.notFound,`${o} has no components to draw alone: a deck's or a doc's are.`);const{code:d}=await G(i,s),a=new URLSearchParams({piece:H(s),combo:Y(r),mode:"component",code:d.slice(0,16)});return C(n,P.stage,a)},"components/stills":async({item:o,version:e,components:i})=>{v(n,I.stills);try{const{prepared:s,host:r,combo:d}=await t.componentHost(o,e);if(!("components"in r)&&T(r,s.kinds))throw new c(f.notFound,`${o} has no components to draw alone: a deck's or a doc's are.`);const{gpu:a}=await t.browser();return{stills:(await q(i,{prepared:s,item:r,combo:d,gpu:a,withSession:l=>t.withSession(l)})).map(({key:l})=>({key:l,url:v(n,X(l))}))}}catch(s){throw x(s)}},"check/results":()=>Promise.resolve(n.checker?.state??{status:"off",revision:t.revision,problems:[],facts:[]}),"check/run":()=>{if(!n.checker)throw new c(f.unavailable,"This server runs no check.");return n.checker.schedule(!0),Promise.resolve({})},"export/start":async({item:o,versions:e,types:i,options:s})=>{const{items:r}=await h(t.root,t.kinds);if(!r.some(d=>d.id===o))throw new c(f.notFound,`There is no item ${o}.`);return{job:n.exports.start(o,e??[],i??[],s)}},"export/cancel":({job:o})=>{if(!n.exports.cancel(o))throw new c(f.notFound,`No export ${o} is under way.`);return Promise.resolve({})},"export/list":()=>Promise.resolve({jobs:n.exports.list(),reveal:n.reveal!==void 0}),"export/reveal":async({path:o})=>{if(!n.reveal)throw new c(f.unavailable,"This server is not on the person's computer: download the file.");if(!o.startsWith(`${U}/`))throw new c(f.notFound,`${o} is no exported file.`);const e=n.exports.savedOf(o),i=e!==void 0&&await y(e).then(()=>!0,()=>!1)?e:b(t.root,o);return await y(i).catch(()=>{throw new c(f.notFound,`There is no file ${o}.`)}),await n.reveal(i),{}}}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{readFile as
|
|
2
|
+
import{readFile as l,stat as b}from"node:fs/promises";import{join as g,relative as y,resolve as x,sep as D}from"node:path";import{readWork as $}from"@allyhub/build";import{itemIdOf as j,listedWork as v}from"@allyhub/formats";import{CommandError as W,EXIT as B}from"@allyhub/protocol";const C=/\.mdx?$/iu;export async function findDoc(o,c,d){const e=x(c,d),t=y(o,e).split(D).join("/"),s=v((await $(o)).work);if(C.test(e)&&(await b(e).catch(()=>{}))?.isFile())return s.some(a=>a.file===t&&a.kind!=="doc")?void 0:e;const r=new Set([t,d.replace(/^\.\//u,"").replace(/\/+$/u,"")]),p=s.find(a=>a.kind==="doc"&&r.has(j(a.file)));return p===void 0?void 0:g(o,p.file)}export function pagesOf(o){const c=[];for(const d of o.split(",")){const e=/^\s*(\d+)\s*(?:-\s*(\d+)\s*)?$/u.exec(d),t=Number(e?.[1]),s=e?.[2]===void 0?t:Number(e[2]);if(!e||t<1||s<t)throw new W("bad-page",`Cannot read the pages "${o}".`,{exit:B.usage,hint:"Write pages from 1, joined with commas: --page 2, --page 2-4, --page 1,5."});for(let r=t;r<=s;r++)c.push(r)}return c}export async function fromBuild(o,c,d){const e=await l(o,"utf8"),{componentDraws:t,everyBlock:s,parseDoc:r}=await import("@allyhub/doc"),p=n=>n.type==="component"||n.type==="chart"&&n.data!==void 0,a=r(e);return![...s(a.blocks)].some(p)&&a.page.bibliography===void 0?{}:d(async n=>{const i=n.prepared.docs.find(k=>k.place===c);if(!i)return{};const u=n.prepared.messages.locales[0],f=i.components.length===0?[]:t(r(await l(g(n.prepared.root,i.file),"utf8")).blocks),m=u===void 0?{}:{lang:u},h=f.length===0?void 0:await n.componentStills(i,f,m),w=f.length===0?void 0:await n.componentMeasures?.(i,f,m);return{stills:h,measures:w,data:i.data,sources:i.sources}})}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{readFile as
|
|
2
|
+
import{readFile as a}from"node:fs/promises";import{join as d}from"node:path";const u=()=>import("@allyhub/doc");export const PREVIEW_DEFAULTS={lines:4,chars:240};function p(t){if(!("content"in t)||!Array.isArray(t.content))return;const n=t.content.map(e=>e.text).join("").trim();return n===""?void 0:n}const l=(t,n)=>t.length<=n?t:`${t.slice(0,n-1).trimEnd()}…`;export async function docPreview(t){const{parseDoc:n,splitTitle:e}=await u(),{body:i}=e(n(t).blocks),o=[];for(const r of i){const c=p(r);if(c!==void 0&&o.push(l(c,PREVIEW_DEFAULTS.chars)),o.length===PREVIEW_DEFAULTS.lines)break}return{type:"text",lines:o}}export async function docTitle(t,n){try{const e=await a(d(t,n.entry),"utf8"),{parseDoc:i,splitTitle:o,titleText:r}=await u();return r(o(i(e).blocks).title)||void 0}catch{return}}export async function docSnapshot(t,{root:n,tool:e}){await e("doc/data",{item:t.id}).catch(()=>{});const i=await a(d(n,t.entry),"utf8").catch(()=>{});if(i===void 0)return{};const{componentAt:o,everyBlock:r,parseDoc:c}=await u(),s=[];for(const f of r(c(i).blocks))f.type==="component"&&s.push(o(f));return s.length===0?{}:{stills:[{version:"",components:s}]}}export function activate(t){t.subscriptions.push(t.allyhub.kinds.registerKindProvider("doc",{preview:async(n,{root:e})=>docPreview(await a(d(e,n.entry),"utf8")),title:(n,{root:e})=>docTitle(e,n),snapshot:(n,e)=>docSnapshot(n,e)}))}
|