allyhub 0.22.0 → 0.23.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/dist/command.js +1 -1
- package/dist/commands/dev.js +5 -5
- package/dist/commands/index.js +1 -1
- package/dist/commands/list.js +1 -1
- package/dist/commands/schedule.js +4 -0
- package/dist/commands.json +1 -1
- package/dist/main.js +8 -8
- package/dist/node_modules/@allyhub/3d-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/audio/package.json +1 -1
- package/dist/node_modules/@allyhub/blocks/package.json +1 -1
- package/dist/node_modules/@allyhub/browser/package.json +1 -1
- package/dist/node_modules/@allyhub/build/package.json +1 -1
- package/dist/node_modules/@allyhub/canvas-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
- package/dist/node_modules/@allyhub/chart/package.json +1 -1
- package/dist/node_modules/@allyhub/check/package.json +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/scheduled-tasks.js +2 -0
- package/dist/node_modules/@allyhub/cloud/package.json +1 -1
- package/dist/node_modules/@allyhub/components/package.json +1 -1
- package/dist/node_modules/@allyhub/dev-server/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/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/package.json +1 -1
- package/dist/node_modules/@allyhub/formats/package.json +1 -1
- package/dist/node_modules/@allyhub/html-extension/package.json +1 -1
- 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/measure/package.json +1 -1
- package/dist/node_modules/@allyhub/media/package.json +1 -1
- package/dist/node_modules/@allyhub/media-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/model/package.json +1 -1
- package/dist/node_modules/@allyhub/office-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
- package/dist/node_modules/@allyhub/piece/package.json +1 -1
- package/dist/node_modules/@allyhub/project/package.json +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/editor.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/events.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/paywall.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/scheduled-tasks.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
- package/dist/node_modules/@allyhub/protocol/package.json +5 -1
- package/dist/node_modules/@allyhub/registry/package.json +1 -1
- package/dist/node_modules/@allyhub/render/package.json +1 -1
- package/dist/node_modules/@allyhub/report-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
- package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet/package.json +1 -1
- 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/package.json +1 -1
- package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/telemetry/package.json +1 -1
- package/dist/node_modules/@allyhub/text-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/video-core/package.json +1 -1
- package/dist/node_modules/@allyhub/video-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
- package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
- package/dist/node_modules/@allyhub/website/package.json +1 -1
- package/dist/node_modules/@allyhub/website-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/x-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/x-model/package.json +1 -1
- package/dist/node_modules/@allyhub/x-view/package.json +1 -1
- package/dist/package.json +15 -15
- package/dist/works.js +1 -1
- package/editor-web/assets/{abnfDiagram-WEYOIA3C-D6qI3rai.js → abnfDiagram-WEYOIA3C-OIbGwO0P.js} +1 -1
- package/editor-web/assets/{architecture-WOLXFQ4H-B3V6ggq8.js → architecture-WOLXFQ4H-i87EDk8h.js} +1 -1
- package/editor-web/assets/{architectureDiagram-ZHVYKT53-IauNyxXn.js → architectureDiagram-ZHVYKT53-DRsgKDbu.js} +1 -1
- package/editor-web/assets/article-BVbLqhwK.js +3 -0
- package/editor-web/assets/article-BxkgemqI.js +7 -0
- package/editor-web/assets/bar-button-BJ-_6g-F.js +1 -0
- package/editor-web/assets/{blockDiagram-RJAE7QA3-yXhlfxbH.js → blockDiagram-RJAE7QA3-k_lanKyI.js} +1 -1
- package/editor-web/assets/{c4Diagram-XDPPPE54-B-anrhvt.js → c4Diagram-XDPPPE54-BFJTpM5w.js} +1 -1
- package/editor-web/assets/channel-CDJSUIp1.js +1 -0
- package/editor-web/assets/chevron-right-7tjLd0X4.js +1 -0
- package/editor-web/assets/chip-lvclIKGj.js +1 -0
- package/editor-web/assets/{chunk-2E7WHVMD-QPOni4XB.js → chunk-2E7WHVMD-Bbfj2q42.js} +1 -1
- package/editor-web/assets/{chunk-4EMNKR2T-DG1FCRRI.js → chunk-4EMNKR2T-iKWsgYqL.js} +1 -1
- package/editor-web/assets/{chunk-55XCU76K-mKuMXpnC.js → chunk-55XCU76K-WwcsywWu.js} +1 -1
- package/editor-web/assets/{chunk-7S6XSTFO-CgZAazgt.js → chunk-7S6XSTFO-BEEtZTsQ.js} +1 -1
- package/editor-web/assets/{chunk-AQDTSKZB-BRU84phF.js → chunk-AQDTSKZB-ZT2PBdLK.js} +1 -1
- package/editor-web/assets/{chunk-DSNLSHJZ-zku9oeG3.js → chunk-DSNLSHJZ-BDlY4xos.js} +1 -1
- package/editor-web/assets/{chunk-HAGFOTED-CaUkBv_0.js → chunk-HAGFOTED-Yp6V4sx6.js} +1 -1
- package/editor-web/assets/{chunk-HNE4Q36P-BQz4ZCJf.js → chunk-HNE4Q36P-C6IdGLw2.js} +1 -1
- package/editor-web/assets/{chunk-NQOKRVIF-CHVBEDkg.js → chunk-NQOKRVIF-D3gs_SMr.js} +1 -1
- package/editor-web/assets/{chunk-UHW7PFBP-DrYeJo1e.js → chunk-UHW7PFBP-Byf0dX4X.js} +1 -1
- package/editor-web/assets/{chunk-VQ5W62QI-D8ToVCUe.js → chunk-VQ5W62QI-n9lsvBOX.js} +1 -1
- package/editor-web/assets/{chunk-WQQL4CDK-DZ0tyi9F.js → chunk-WQQL4CDK-BW540sO1.js} +1 -1
- package/editor-web/assets/{chunk-YZO67HFG-BLe7PXER.js → chunk-YZO67HFG-CWL9cioT.js} +1 -1
- package/editor-web/assets/{chunk-ZAUX2LTX-ByaeSIre.js → chunk-ZAUX2LTX-D9zlkFeQ.js} +1 -1
- package/editor-web/assets/{chunk-ZCHMQSOR-DdMJr_t5.js → chunk-ZCHMQSOR-nieSgKB5.js} +1 -1
- package/editor-web/assets/{classDiagram-v2-4MYWR3UA-DDpq7fFC.js → classDiagram-v2-4MYWR3UA-BXamBIDc.js} +1 -1
- package/editor-web/assets/{color-picker-CDeICDN5.js → color-picker-XpkmmKxv.js} +1 -1
- package/editor-web/assets/context-menu-pSruvRyd.js +1 -0
- package/editor-web/assets/{cynefin-EF2NZ3EQ-CMivy2fr.js → cynefin-EF2NZ3EQ-CVKVgqFb.js} +1 -1
- package/editor-web/assets/{cynefinDiagram-WF24UDRP-GtxT_9wW.js → cynefinDiagram-WF24UDRP-r0bqUe5X.js} +1 -1
- package/editor-web/assets/{dagre-NK4GIZVX-Bn1O2Hjl.js → dagre-NK4GIZVX-4q_IUjiM.js} +1 -1
- package/editor-web/assets/deck-cyd6f3QU.js +1 -0
- package/editor-web/assets/{diagram-CBK3MWTC-W715PWZw.js → diagram-CBK3MWTC-CDh12DaH.js} +1 -1
- package/editor-web/assets/{diagram-I5XIIV2D-BKObZPn2.js → diagram-I5XIIV2D-C_sqASp8.js} +1 -1
- package/editor-web/assets/{diagram-ODIL2UCW-UtQxEPoW.js → diagram-ODIL2UCW-QgoMb-iS.js} +1 -1
- package/editor-web/assets/{diagram-PFBEJUXE-CpLGEK-k.js → diagram-PFBEJUXE-Djhv4RT6.js} +1 -1
- package/editor-web/assets/{diagram-RJA3I4VV-DGyMXoHb.js → diagram-RJA3I4VV-CvVswF4l.js} +1 -1
- package/editor-web/assets/{diagram-TYUNFSNR-Dy_Ewr8V.js → diagram-TYUNFSNR-DLnbV741.js} +1 -1
- package/editor-web/assets/dist-BK-WZ2ce.js +3 -0
- package/editor-web/assets/dist-CQ8-PJqF.js +16 -0
- package/editor-web/assets/dist-CQElMvxC.js +4 -0
- package/editor-web/assets/{dist-H9rTuNhb.js → dist-D49XAtID.js} +1 -1
- package/editor-web/assets/{dist-DNMKDcLg.js → dist-DDQLLUz5.js} +1 -1
- package/editor-web/assets/{dist-oeSWr2LE.js → dist-DO2VygfS.js} +3 -3
- package/editor-web/assets/dist-DOoUVqs_.js +24 -0
- package/editor-web/assets/{dist-B0rUvCi2.js → dist-DUyJ8AI0.js} +1 -1
- package/editor-web/assets/dist-DlDgR_Er.js +1 -0
- package/editor-web/assets/dist-Dw7AH_ip.js +6 -0
- package/editor-web/assets/{dist-0I0Obj60.js → dist-Dx3tLwZ1.js} +17 -17
- package/editor-web/assets/{dist-DptBQzJR.js → dist-F7lLi27Y.js} +1 -1
- package/editor-web/assets/dist-OfUZ68xY.js +547 -0
- package/editor-web/assets/{dist-D7M5YTq2.js → dist-OyPpS4AG.js} +28 -28
- package/editor-web/assets/dist-QCvBWMrp.js +5 -0
- package/editor-web/assets/{dist-CKD_paj_.js → dist-RppJbSHJ.js} +1 -1
- package/editor-web/assets/dist-ZFgjTFWK.js +19 -0
- package/editor-web/assets/{dist-Cc8v9lfc.js → dist-onYtssQw.js} +1 -1
- package/editor-web/assets/{docx-draw-B5cM77hc.js → docx-draw-BBI4k72R.js} +1 -1
- package/editor-web/assets/{ebnfDiagram-V4P3TTPT-GPYcx6dU.js → ebnfDiagram-V4P3TTPT-BoiJRPsL.js} +1 -1
- package/editor-web/assets/{elk-QONTBCTQ-Bi0r4UFM.js → elk-QONTBCTQ-BDiBwn0f.js} +1 -1
- package/editor-web/assets/{erDiagram-KYQIGQAA-DrOSrnci.js → erDiagram-KYQIGQAA-DaA3jdNm.js} +1 -1
- package/editor-web/assets/{esm-jIPnpbBD.js → esm-BWIRT8Yl.js} +1 -1
- package/editor-web/assets/{eventmodeling-K75KTNOO-Dw-MjgUb.js → eventmodeling-K75KTNOO-j7ZSOAed.js} +1 -1
- package/editor-web/assets/flowDiagram-IUGLLWBU-Cb-xQSAJ.js +1 -0
- package/editor-web/assets/{ganttDiagram-R7GPNTJY-Bwe8cQqi.js → ganttDiagram-R7GPNTJY-CyNcjwUZ.js} +1 -1
- package/editor-web/assets/{gitGraph-VSP46ZUC-DsAcAKP0.js → gitGraph-VSP46ZUC-BuzoK22Z.js} +1 -1
- package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-aObRwdru.js → gitGraphDiagram-PDYL7XHY--lzum_QP.js} +1 -1
- package/editor-web/assets/index-BSd85XUU.js +28 -0
- package/editor-web/assets/{info-OHQRW6UA-DBPN8JFr.js → info-OHQRW6UA-rs42SY_Y.js} +1 -1
- package/editor-web/assets/{infoDiagram-MVDRKAX5-Bx26Hq7M.js → infoDiagram-MVDRKAX5-BjedWKrM.js} +1 -1
- package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-BJ_MCDwA.js → ishikawaDiagram-HPEHV2GE-Dtqm_gq7.js} +1 -1
- package/editor-web/assets/{journeyDiagram-BOSHW7O7-B5g4W2Dx.js → journeyDiagram-BOSHW7O7-J0dA2yU0.js} +1 -1
- package/editor-web/assets/{kanban-definition-FNSA4HC5-U8YNlxN7.js → kanban-definition-FNSA4HC5-DV13v0Uf.js} +1 -1
- package/editor-web/assets/{mermaid-parser.core-DYLQlYDo.js → mermaid-parser.core-B7bZFHzS.js} +3 -3
- package/editor-web/assets/{mermaid.core-qNJmZ0b4.js → mermaid.core-DQ10-Otk.js} +4 -4
- package/editor-web/assets/{mindmap-definition-6OY57UG3-CI5aBWbK.js → mindmap-definition-6OY57UG3-DgdXGBCF.js} +1 -1
- package/editor-web/assets/{packet-JDAUHWVQ-BBclMGlJ.js → packet-JDAUHWVQ-ZNSLC_YL.js} +1 -1
- package/editor-web/assets/{panes-BShVq38A.js → panes-1hRg6CCN.js} +2 -2
- package/editor-web/assets/{pegDiagram-ECIUJNBX-B3pljPTu.js → pegDiagram-ECIUJNBX-nBIsHepE.js} +1 -1
- package/editor-web/assets/{pie-XZMESJXO-B7WzimHm.js → pie-XZMESJXO-CXen6okO.js} +1 -1
- package/editor-web/assets/{pieDiagram-GNMPY74T-tM1Da50-.js → pieDiagram-GNMPY74T-BlimMsUq.js} +1 -1
- package/editor-web/assets/{quadrantDiagram-D57K4MC3-BEq_Shj9.js → quadrantDiagram-D57K4MC3-D_B7p8XB.js} +1 -1
- package/editor-web/assets/{radar-ABXABTNO-v2jJSW5T.js → radar-ABXABTNO-DFfRPPEM.js} +1 -1
- package/editor-web/assets/{railroad-I3PHUGI6-6W3Z4F8Y.js → railroad-I3PHUGI6-DS8ly7WZ.js} +1 -1
- package/editor-web/assets/{railroad-abnf-LNEFI6M7-DxIN7Zrt.js → railroad-abnf-LNEFI6M7-Coohlgpw.js} +1 -1
- package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-Bb5O7tAx.js → railroad-ebnf-DWYD2UWJ-CvcfKbZc.js} +1 -1
- package/editor-web/assets/{railroad-peg-JR7BVNR7-i2LjEP5t.js → railroad-peg-JR7BVNR7-jRtVHKtg.js} +1 -1
- package/editor-web/assets/{railroadDiagram-Y72NRBL7-DhsyVKbG.js → railroadDiagram-Y72NRBL7-kWUIDPHg.js} +1 -1
- package/editor-web/assets/{requirementDiagram-EQYSW5RA-Du2k7i1E.js → requirementDiagram-EQYSW5RA-C39Gfdi-.js} +1 -1
- package/editor-web/assets/ribbon-tabs-5R-_EtHp.js +1 -0
- package/editor-web/assets/{sankeyDiagram-SY24JHO5-CDnRMu7J.js → sankeyDiagram-SY24JHO5-DtSQ2N2q.js} +1 -1
- package/editor-web/assets/{sequenceDiagram-BLEHNHQU-BUXBhWYW.js → sequenceDiagram-BLEHNHQU-BZx9gAR1.js} +1 -1
- package/editor-web/assets/{session--OJYv_B7.js → session-2pd0mFQm.js} +1 -1
- package/editor-web/assets/{snapshots-DYooVfOx.js → snapshots-8hCkRemI.js} +1 -1
- package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-Enb8LZUA.js → stateDiagram-v2-A6IESKWZ-E9qhWPa3.js} +1 -1
- package/editor-web/assets/{swimlanes-B3ENRKFQ-pnpjgTrl.js → swimlanes-B3ENRKFQ-C6vD9fmU.js} +1 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-D_DL_JP0.js +8 -0
- package/editor-web/assets/{timeline-definition-JXYKGLGB-C4pR18kd.js → timeline-definition-JXYKGLGB-CT8AKsKE.js} +1 -1
- package/editor-web/assets/{treeView-D4JQ5SDB-kzNGeAv6.js → treeView-D4JQ5SDB-DA2iE5aC.js} +1 -1
- package/editor-web/assets/{treemap-SAJKECNS-Buhb5wzt.js → treemap-SAJKECNS-RgrBf6Sq.js} +1 -1
- package/editor-web/assets/{updating-Cbxw83_O.js → updating--4wIxO0k.js} +1 -1
- package/editor-web/assets/{usecaseDiagram-WPOLBNNX-CL-xLQWl.js → usecaseDiagram-WPOLBNNX-DfIcy0_F.js} +1 -1
- package/editor-web/assets/{vennDiagram-Q3Y3IDCW-bwsyCcdK.js → vennDiagram-Q3Y3IDCW-DxTSyNH7.js} +1 -1
- package/editor-web/assets/{video-8MxWX9f5.js → video-yjnj5UY2.js} +1 -1
- package/editor-web/assets/{wardley-7MLQ67FV-DXsLgedI.js → wardley-7MLQ67FV-pow5gWxU.js} +1 -1
- package/editor-web/assets/{wardleyDiagram-IVAIDKWA-Cn0ph953.js → wardleyDiagram-IVAIDKWA-Dar0j9HS.js} +1 -1
- package/editor-web/assets/{workbook-BDWkQ149.js → workbook-7fUt0Qgy.js} +1 -1
- package/editor-web/assets/{xychartDiagram-4URNHDU4-CfXnqGWZ.js → xychartDiagram-4URNHDU4-qCxuQZMj.js} +1 -1
- package/editor-web/index.html +4 -3
- package/package.json +2 -2
- package/editor-web/assets/article-BHjKp5We.js +0 -3
- package/editor-web/assets/article-BlNKv1Cn.js +0 -7
- package/editor-web/assets/bar-button-CJmpgNg4.js +0 -1
- package/editor-web/assets/channel-Bhb-_8v6.js +0 -1
- package/editor-web/assets/chip-pNQlYa2W.js +0 -1
- package/editor-web/assets/deck-Cohd-G5m.js +0 -1
- package/editor-web/assets/dist-6ugUm4dS.js +0 -6
- package/editor-web/assets/dist-CKUW5NzS.js +0 -3
- package/editor-web/assets/dist-Ca9Gsuu0.js +0 -24
- package/editor-web/assets/dist-CynBNzYv.js +0 -1
- package/editor-web/assets/dist-D9tsFc2N.js +0 -16
- package/editor-web/assets/dist-Doj7_HUI.js +0 -547
- package/editor-web/assets/dist-DzKB210A.js +0 -5
- package/editor-web/assets/dist-RyGsFHE0.js +0 -4
- package/editor-web/assets/dist-wD_hHJ8_.js +0 -19
- package/editor-web/assets/flowDiagram-IUGLLWBU-DbZTfPEP.js +0 -1
- package/editor-web/assets/index-D-MNVykg.js +0 -28
- package/editor-web/assets/ribbon-tabs-Bxuj_hct.js +0 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-B-B2Eoc8.js +0 -8
package/dist/main.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{mkdir as
|
|
3
|
-
`);return}const v=await
|
|
4
|
-
`)),(p??
|
|
5
|
-
`)},
|
|
6
|
-
`)},signal:
|
|
7
|
-
`)}else i.stderr(`${
|
|
8
|
-
${
|
|
9
|
-
`)}}export async function run(o){const i=await main(o,
|
|
2
|
+
import{mkdir as X,writeFile as q}from"node:fs/promises";import{tmpdir as Q}from"node:os";import{dirname as Z,join as A}from"node:path";import"@allyhub/stage-runtime/use";import{CLI_PROGRAM as J,EXIT as f,PROBLEMS_FOUND as nn}from"@allyhub/protocol/cli";import{WORK_DIR as tn}from"@allyhub/formats/layout";import{projectAt as en}from"./project.js";import{cutLong as on}from"./text/long-text.js";import{readArgs as rn}from"./args.js";import{CLI_VERSION as j}from"./cli-version.js";import{CommandError as x,inStudio as sn}from"./command.js";import{COMMAND_SOURCES as L}from"./commands/index.js";import{commandEntries as an,commandEntry as cn,entriesOf as dn,joinedCommands as mn}from"./commands/list.js";import{contributedSpecs as un}from"./commands/contributed.js";import{groupHelp as fn,listHelp as ln,workHelp as pn}from"./help.js";import{sdkDocs as hn}from"./sdk-docs.js";import{cliTelemetry as wn}from"./telemetry.js";import{turnOf as gn}from"./turn.js";import{endUpdateCheck as $n}from"./update-notice.js";import{WORKS as Sn,cloudNouns as kn,withJoined as K,workNamed as yn,workTitle as Y}from"./works.js";const C={stdout:o=>process.stdout.write(o),stderr:o=>process.stderr.write(o),cwd:process.cwd(),env:process.env};export const FORMER_NAMES={render:"export"};export function namedNow(o){const i=o[0]==="help"?1:0,s=FORMER_NAMES[o[i]??""];return o.map((a,h)=>h===i&&s!==void 0?s:a)}export function findCommand(o,i){let s;for(const a of i){const h=a.name.split(" ");h.every((w,e)=>o[e]===w)&&h.length>(s?.length??0)&&(s={command:a,length:h.length})}return s?{command:s.command,rest:o.slice(s.length)}:{rest:[...o]}}export async function resolveCommand(o,i,s,a=L){const h=async e=>{const c=await e.resolve(o,i);return c&&{...c,command:cn(c.command,s)}},w=findCommand(o,s);if(w.command){const e=w.command.name;if(w.rest.length>0)for(const c of a.filter(S=>S.under===e)){const S=await h(c);if(S)return S}return w}for(const e of a){const c=await h(e);if(c)return c}return w}export async function main(o,i=C,s,a=L,h){const w=o.includes("--json"),e=namedNow(o.filter(n=>n!=="--json")),c=async(n,t,$)=>{if(w){i.stdout(`${JSON.stringify(n,null,2)}
|
|
3
|
+
`);return}const v=await en(i.cwd),u=A(v===void 0?A(Q(),"allyhub"):A(v,tn),"out",`${$.replaceAll(" ","-")}.txt`),p=on(t,u);p!==void 0&&(await X(Z(u),{recursive:!0}),await q(u,`${t}
|
|
4
|
+
`)),(p??t)!==""&&i.stdout(`${p??t}
|
|
5
|
+
`)},S=new AbortController,g={cwd:i.cwd,env:{ALLYHUB_CLIENT:`${J}/${j}`,...i.env},progress:n=>{i.stderr(`${n}
|
|
6
|
+
`)},signal:S.signal};if(e[0]==="--version"||e[0]==="-v")return await c({version:j},j,"version"),f.ok;const E=s===void 0?await an():dn(s),M=sn(g.env),O=M?E.filter(n=>n.notInStudio===void 0):E,T=new Set(E.filter(n=>!O.includes(n)).map(n=>n.name)),_=n=>T.size===0?n:{...n,commands:n.commands.filter(t=>!T.has(t))},D=n=>M&&n.notInStudio!==void 0?new x("in-studio",n.notInStudio):void 0,H=n=>O.filter(t=>n.length>0&&t.name.startsWith(`${n.join(" ")} `));if(e.length===0||e[0]==="help"||e[0]==="--help"||e[0]==="-h"){const n=e.slice(1).findIndex(r=>r.startsWith("-")),t=(n<0?e.slice(1):e.slice(1,n+1)).flatMap(r=>r.split(" ").filter(d=>d!=="")),$=await hn(i.cwd).catch(()=>{}),v=async()=>{const r=await Promise.all(a.map(d=>d.nouns(g).then(z=>z.map(V=>({...V,work:d.works!==!1}))).catch(()=>{})));return r.some(d=>d===void 0)?void 0:r.flatMap(d=>d??[])},u=await un(g,await mn());if(t.length===0){const r=await v();return await c({version:j,docs:$?.dir,works:Sn.map(d=>({...K(_(d),u),title:Y(d,r)})),commands:O.map(d=>d.spec),made:[...a.flatMap(d=>d.entries),...r??[]]},ln(O,a,r,$?.dir),"help"),f.ok}const p=t.length===1?yn(t[0]??""):void 0,l=p&&K(_(p),u);if(l){const r=l.cloud===void 0?[]:await v();return await c({...l,title:Y(l,r),...l.cloud===void 0?{}:{cloudWorks:r&&kn(l,r)},docsDir:$?.dir},pn(l,O,a,$?.dir,r,u),`help ${t.join(" ")}`),f.ok}let b;try{b=await resolveCommand(t,g,E,a)}catch(r){return N(r)}const{command:m,rest:k}=b;if(m&&b.list===!0)return await P(m,k);const y=H(t);if(!m&&y.length>0)return await c({commands:y.map(r=>r.spec)},fn(t.join(" "),y),`help ${t.join(" ")}`),f.ok;if(!m||k.length>0)return N(new x("unknown-command",`allyhub has no command "${t.join(" ")}".`,{exit:f.usage,hint:"allyhub help lists them and the works."}));const G=D(m);return G?N(G):(await c(m.described,m.help,`help ${m.name}`),f.ok)}let W;try{W=await resolveCommand(e,g,E,a)}catch(n){return N(n)}const{command:I,rest:R}=W;if(!I){const n=H(e.slice(0,1));return N(new x("unknown-command",`allyhub has no command "${e.join(" ")}".`,{exit:f.usage,hint:n.length>0?`${e[0]??""} has these: ${n.map(t=>t.name).join(", ")}.`:"allyhub help lists them."}))}const U=D(I);if(U)return N(U);if(R.includes("--help")||R.includes("-h"))return await c(I.described,I.help,`${I.name} help`),f.ok;return await P(I,R);async function P(n,t){const $=()=>{S.abort(new x("interrupted","Stopped.",{exit:f.interrupted}))};process.once("SIGINT",$);const v=Date.now();let u=f.failed,p;const l=await gn(g.env,g.cwd),b=l===void 0?g:{...g,env:{...g.env,TRACEPARENT:l}};try{const m=await n.command(),k=rn(m.spec,t),y=await m.run(k,b);await c(y.value,y.text,m.spec.name),u=y.exit??f.ok,u!==f.ok&&(p=y.code??nn)}catch(m){const k=B(m);u=k.exit,p=k.code,F(k)}finally{process.off("SIGINT",$)}return await h?.({command:n.name,ms:Date.now()-v,exit:u,...p===void 0?{}:{code:p},...l===void 0?{}:{traceparent:l}}),u}function N(n){const t=B(n);return F(t),t.exit}function B(n){return n instanceof x?n:S.signal.aborted?new x("interrupted","Stopped.",{exit:f.interrupted}):new x("failed",n instanceof Error?n.message:String(n))}function F(n){if(w){const t={error:{code:n.code,message:n.message,...n.hint?{hint:n.hint}:{}}};i.stdout(`${JSON.stringify(t,null,2)}
|
|
7
|
+
`)}else i.stderr(`${n.message}${n.hint?`
|
|
8
|
+
${n.hint}`:""}
|
|
9
|
+
`)}}export async function run(o){const i=await main(o,C,void 0,L,wn({ALLYHUB_CLIENT:`${J}/${j}`,...C.env},a=>{C.stderr(a)})),s=await $n();return s!==void 0&&C.stderr(`${s}
|
|
10
10
|
`),i}
|
|
@@ -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,DEVICE_HEADER as E,ORGANIZATION_HEADER as g}from"@allyhub/protocol/auth";import{COMMAND_LINE_PAYWALL_MET as O,paywallNumbersOfData as
|
|
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 S,needsPlanForOfData as O,paywallNumbersOfData as $,paywallReasonOfCode as k}from"@allyhub/protocol/paywall";import{EXIT as s}from"@allyhub/protocol/cli";import{SCHEDULED_TASKS_PATH as D}from"@allyhub/protocol/scheduled-tasks";import{IDEMPOTENCY_KEY_HEADER as N,planPageAddress as p}from"@allyhub/protocol/cloud";import{accessOf as T,SignedOut as x}from"./credentials.js";import{userAgent as H}from"./device.js";import{CloudError as h,notSignedIn as y,unreachable as m}from"./errors.js";export function scrub(d,i){let t=d.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>"),i&&(t=t.split(i).join("<key>")),t}const z="/api/tools",w=new _;export function callsMadeInBackground(d){return w.run(!0,d)}export class Cloud{config;constructor(i){this.config=i}async tellStudio(i,t,e){const c=this.config.studioHost;if(c===void 0)return;const r=O(e),n={reason:i,what:t.startsWith(z)?"tool":t.startsWith(D)?"scheduled_task":"command",numbers:$(e),...r===void 0?{}:{needsPlanFor:r}},a=(o,l)=>fetch(`${c}/${o}`,{method:"POST",signal:AbortSignal.timeout(1e3),...l===void 0?{}:{headers:{"content-type":"application/json"},body:l}}).then(async f=>(await f.body?.cancel(),f.status),()=>{});await a(S,JSON.stringify(n))===404&&i==="insufficient_credits"&&await a("out-of-credits")}get url(){return this.config.url}async key(i={}){const t=this.config.apiKey;if(t)return{key:t,source:"env",account:b("sha256").update(t).digest("hex")};try{const e=await T(this.config,i);if(!e)return;const c=e.credentials.account.organization?.id,r=e.credentials.device;return{key:e.token,source:"oauth",account:e.credentials.account.id,expiresAt:e.expiresAt,...c===void 0?{}:{organization:c},...r===void 0?{}:{device:r}}}catch(e){if(e instanceof x)return;throw m(this.url,e)}}async requireKey(){const i=await this.key();if(!i)throw y();return i}keyedFetch=async(i,t)=>{const e=this.config.client===void 0?void 0:await H(this.config.client),c=u=>{const o=new Headers(t?.headers);return o.set("authorization",`Bearer ${u.key}`),e!==void 0&&!o.has("user-agent")&&o.set("user-agent",e),this.config.traceparent!==void 0&&!o.has("traceparent")&&o.set("traceparent",this.config.traceparent),u.organization!==void 0&&!o.has(g)&&o.set(g,u.organization),u.device!==void 0&&o.set(E,u.device),w.getStore()===!0&&o.set(A,"1"),this.config.fetch(i,{...t,headers:o})},r=await this.requireKey(),n=await c(r);if(n.status!==401||r.source!=="oauth"||t?.body instanceof ReadableStream||i instanceof Request)return n;const a=await this.key({refused:r.key});return a===void 0?n:(await n.body?.cancel(),c(a))};async json(i,t={}){const e=t.auth!==!1,c=e?await this.requireKey():void 0,r=c?.key,n=t.organization??c?.organization;let a;try{a=await(e?this.keyedFetch:this.config.fetch)(`${this.url}${i}`,{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?{}:{[N]:t.idempotencyKey}},...t.body===void 0?{}:{body:JSON.stringify(t.body)}})}catch(f){throw f instanceof h?f:m(this.url,f)}const u=await a.text(),o=a.ok?void 0:C(u,a.status,r,this.url,n),l=k(o?.code);if(l!==void 0&&await this.tellStudio(l,i,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:s.auth,status:403});if(a.status===401)throw y(e?"This computer's AllyHub sign-in is not valid any more.":void 0);if(!a.ok)throw new h("api-error",`${this.url}${i} answered ${String(a.status)}: ${scrub(u.slice(0,300),r)}`,{exit:a.status>=500?s.platform:s.usage,status:a.status});if(a.status!==204)try{return JSON.parse(u)}catch{throw new h("api-error",`${this.url}${i} did not answer JSON.`,{exit:s.platform,status:a.status})}}}const I={bad_input:s.usage,insufficient_credits:s.auth,plan_required:s.auth,tool_off:s.auth,storage_full:s.auth,limit_reached:s.auth,forbidden:s.auth,not_found:s.notFound,conflict:s.conflict,cli_outdated:s.platform},R=d=>d.code==="limit_reached"&&typeof d.data=="object"&&d.data!==null&&d.data.reason==="calls_an_hour";function C(d,i,t,e,c){let r;try{r=JSON.parse(d)}catch{return}const n=r?.error;if(typeof n?.code!="string"||typeof n.message!="string")return;const a=n.code==="insufficient_credits"?`Buy credits at ${p(e,{organization:c,open:"credits"})}.`:n.code==="plan_required"?`Subscribe at ${p(e,{organization:c,open:"plans"})}.`:n.code==="tool_off"?`Turn it on in Capabilities at ${e}/.`:typeof n.hint=="string"?R(n)?`${n.hint.replace(/\.$/u,"")} (${e}/).`:n.hint:void 0;return new h(n.code.replaceAll("_","-"),scrub(n.message,t),{exit:I[n.code]??s.platform,status:i,...a===void 0?{}:{hint:a},...typeof n.data=="object"&&n.data!==null?{data:n.data}:{}})}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
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";
|
|
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{changeScheduledTask,createScheduledTask,describeScheduledTask,listRunsOfScheduledTask,listScheduledTasks,removeScheduledTask,runScheduledTaskNow}from"./scheduled-tasks.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";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{SCHEDULED_TASKS_PATH as d,ScheduledTaskRunsSchema as o,ScheduledTaskSchema as a,ScheduledTasksSchema as n,scheduledTaskPath as c,scheduledTaskRunNowPath as h,scheduledTaskRunsPath as r}from"@allyhub/protocol/scheduled-tasks";export const listScheduledTasks=async s=>n.parse(await s.json(d)).tasks,describeScheduledTask=async(s,e)=>a.parse(await s.json(c(e))),createScheduledTask=async(s,e)=>a.parse(await s.json(d,{method:"POST",body:e})),changeScheduledTask=async(s,e,t)=>a.parse(await s.json(c(e),{method:"PATCH",body:t})),removeScheduledTask=async(s,e)=>{await s.json(c(e),{method:"DELETE"})},runScheduledTaskNow=async(s,e)=>a.parse(await s.json(h(e),{method:"POST"})),listRunsOfScheduledTask=async(s,e)=>o.parse(await s.json(r(e))).runs;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{z as t}from"zod";import{FILE_METHODS as r,FILE_NOTIFICATIONS as a,FolderSchema as i,PathSchema as o}from"./files.js";import{method as e,notification as s}from"./jsonrpc.js";import{KindInfoSchema as h}from"./kinds.js";import{NoteRectSchema as c}from"./notes.js";import{PlaceSchema as n}from"./place.js";import{AgentHereSchema as m,PRESENCE_METHODS as
|
|
2
|
+
import{z as t}from"zod";import{FILE_METHODS as r,FILE_NOTIFICATIONS as a,FolderSchema as i,PathSchema as o}from"./files.js";import{method as e,notification as s}from"./jsonrpc.js";import{KindInfoSchema as h}from"./kinds.js";import{NoteRectSchema as c}from"./notes.js";import{PlaceSchema as n}from"./place.js";import{AgentHereSchema as m,PRESENCE_METHODS as d,PRESENCE_NOTIFICATIONS as l}from"./presence.js";import{TOOL_NOTIFICATIONS as p}from"./tools.js";export{PLACE_PARAM,PlaceSchema,placeIn,placeParams}from"./place.js";export const ThemeSchema=t.enum(["light","dark"]),EDITOR_MODES=["read","edit"],EditorModeSchema=t.enum(EDITOR_MODES),HostContextSchema=t.strictObject({locale:t.string().min(2),theme:ThemeSchema,agent:t.strictObject({name:t.string().min(1)}).optional(),project:t.strictObject({name:t.string().min(1)}),notes:t.boolean().optional(),share:t.boolean().optional(),commands:t.boolean().optional(),audienceWindow:t.boolean().optional(),mode:EditorModeSchema,place:n.optional(),item:t.strictObject({id:o,kind:t.string().min(1).optional(),dir:i,entry:o,kindInfo:h}),editor:t.string().min(1)}),OpenTargetSchema=t.discriminatedUnion("type",[t.strictObject({type:t.literal("file"),path:o,line:t.int().positive().optional()}),t.strictObject({type:t.literal("browser"),url:t.url({protocol:/^https?$/u}).optional(),tabId:t.string().min(1).optional()})]),AUDIENCE_WINDOW="allyhub-audience",EDITOR_STATES=["saved","saving","unsaved","error"],EXPORT_BUTTON_STATES=["idle","queued","running","done","failed"],ExportStateSchema=t.strictObject({at:t.enum(EXPORT_BUTTON_STATES),percent:t.number().min(0).max(100).optional(),open:t.boolean().optional()}),PlayedSchema=t.strictObject({seconds:t.number().min(0),length:t.number().min(0),ended:t.boolean()}),HOST_METHODS={"host/context":e(t.strictObject({}),HostContextSchema,"Where the editor runs."),"items/open":e(t.strictObject({target:OpenTargetSchema}),t.strictObject({}),"Shows another item, a file or a page, where the host shows things."),"storage/get":e(t.strictObject({key:t.string().min(1)}),t.strictObject({value:t.unknown()}),"What the editor kept for this person on this computer (a hand sort, what was last seen), or null."),"storage/set":e(t.strictObject({key:t.string().min(1),value:t.unknown()}),t.strictObject({}),"Keeps a value for this person on this computer; null removes it."),"editor/state":e(t.strictObject({state:t.enum(EDITOR_STATES),message:t.string().optional()}),t.strictObject({}),"Says whether what the person typed is saved."),"export/state":e(ExportStateSchema,t.strictObject({}),"Says how the item's exports go, for a host that draws Export itself (HostContext's `commands`)."),"agent/here":e(m,t.strictObject({}),"Says whether the project's agent is in the item and what it does there, and whether the editor follows it, for a host that draws the agent's name itself (HostContext's `commands`); the host's button asks back with `editor/command`'s `follow` or `unfollow`."),"editor/place":e(t.strictObject({place:n}),t.strictObject({}),"Says where the person is in the item (a video's moment, a deck's slide), on a pause, a seek or another slide, never each frame, so the host opens it there again (HostContext's `place`). The place is the editor's, in the shape its `editors` contribution's schema says; the host keeps it unread."),"editor/played":e(PlayedSchema,t.strictObject({}),"Says a stretch of the item played, from the person pressing play to a pause, its end, or the editor going or its page hidden: how many seconds of it played and whether it reached its end. A host that counts nothing answers all the same."),"agent/ask":e(t.strictObject({text:t.string().min(1)}),t.strictObject({delivered:t.boolean()}),"Puts words before the person's agent, for them to go on and send; false where no agent takes them. Never sent by itself."),"note/begin":e(t.strictObject({from:c.optional(),selection:t.boolean().optional()}),t.strictObject({begun:t.boolean()}),"Starts the host's Mark up on what is on show, as its own Note button does, so a person can mark anything up for their agent from wherever they are; false where the host has none. Sends nothing."),"share/begin":e(t.strictObject({}),t.strictObject({begun:t.boolean()}),"Opens the host's Share panel for the item on show, as the editor's own Share button does (HostContext's `share`); false where the host shares nothing. Shares nothing by itself."),"edit/request":e(t.strictObject({}),t.strictObject({asked:t.boolean()}),"The person pressed an Edit of the editor's own (a website's view, with no machine to run its server) in read mode (`mode`): the host wakes the machine that changes it; false where nothing does. Never sent for a key pressed in the item."),"tools/call":e(t.strictObject({name:t.string().min(1),arguments:t.record(t.string(),t.unknown()).default({})}),t.strictObject({result:t.unknown()}),"Runs one of the project server's tools (tools.ts's PROJECT_TOOLS), for an editor that needs more than files (a video's preview, a still).")},HOST_NOTIFICATIONS={"host/context-changed":s(HostContextSchema,"The language, theme or agent changed."),"editor/command":s(t.strictObject({command:t.string().min(1),open:t.boolean().optional()}),"The host around the editor asked it to run a command: what its own shortcut does (Export, ⌘E), or a command its extension contributes."),...a,...p,...l},EDITOR_HOST_METHODS={...r,...HOST_METHODS,...d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{z as e}from"zod";import{TURN_MOODS as s,TURN_PURPOSES as r,TURN_TROUBLES as i}from"./purposes.js";export const EVENTS_PATH="/api/events",EVENTS_AT_MOST=100,EventWordSchema=e.string().regex(/^[a-z0-9][a-z0-9_.:-]{0,63}$/u),EventIdSchema=e.string().regex(/^[A-Za-z0-9_-]{1,128}$/u),EventLanguageSchema=e.string().regex(/^[a-z]{2}$/u),EventCountrySchema=e.string().regex(/^[A-Z]{2}$/u),EventTraceIdSchema=e.string().regex(/^[0-9a-f]{32}$/u),EventRouteSchema=e.string().regex(/^(?:\/[A-Za-z0-9_.:*-]{1,64}){1,12}$|^unmatched$/u);const o=e.record(EventWordSchema,e.number().int().min(0).max(1e6)).refine(n=>Object.keys(n).length<=32,"At most 32 words.");export const WINDOW_PRODUCTS=["agents","desktop","cloud"],UPGRADE_PLACES=["sidebar_offer","plan_settings","refusal_card","read_only_chip","paywall"],PAYWALL_TRIGGERS=["refused","reminder","locked"],WINDOW_PAGES=["console_home","cloud_studio","plan_settings"],CHECKOUT_WHATS=["plan","top_up","card"],CHECKOUT_LEFT_REASONS=["price","payment_method","just_looking","other"];const a=e.number().int().min(0).max(10080*60*1e3);export const EVENT_PROPS={program_opened:e.strictObject({os:EventWordSchema,arch:EventWordSchema,where:e.enum(["computer","cloud"])}),project_opened:e.strictObject({fresh:e.boolean(),items:o}),item_opened:e.strictObject({kind:EventWordSchema}),session_started:e.strictObject({agent:EventWordSchema}),turn_started:e.strictObject({agent:EventWordSchema}),turn_finished:e.strictObject({agent:EventWordSchema,durationMs:a,ended:EventWordSchema,changed:o,made:o.optional()}),job_finished:e.strictObject({what:EventWordSchema,about:EventWordSchema,kind:EventWordSchema.optional(),durationMs:a,outcome:e.enum(["done","failed","cancelled"])}),command_ran:e.strictObject({command:EventWordSchema,durationMs:a,exit:e.number().int().min(0).max(255),code:EventWordSchema.optional()}),refusal_shown:e.strictObject({code:EventWordSchema,where:EventWordSchema}),home_product_chosen:e.strictObject({product:e.enum(WINDOW_PRODUCTS)}),item_opened_from_sidebar:e.strictObject({kind:EventWordSchema,extension:EventWordSchema.optional()}),file_downloaded:e.strictObject({kind:EventWordSchema,format:EventWordSchema,paused:e.boolean()}),share_opened:e.strictObject({kind:EventWordSchema}),upgrade_clicked:e.strictObject({where:e.enum(UPGRADE_PLACES)}),prompt_prefilled:e.strictObject({blanks:e.boolean(),from:EventWordSchema.optional()}),welcome_example_pressed:e.strictObject({index:e.number().int().min(1).max(9)}),plan_chosen:e.strictObject({plan:EventWordSchema,interval:EventWordSchema,change:e.boolean(),where:e.enum(UPGRADE_PLACES)}),page_viewed:e.strictObject({page:e.enum(WINDOW_PAGES)}),paywall_shown:e.strictObject({reason:EventWordSchema,what:EventWordSchema,trigger:e.enum(PAYWALL_TRIGGERS)}),checkout_abandoned:e.strictObject({what:e.enum(CHECKOUT_WHATS),reason:e.enum(CHECKOUT_LEFT_REASONS).optional()}),account_created:e.strictObject({}),refusal_met:e.strictObject({code:EventWordSchema,route:EventRouteSchema,background:e.boolean().optional()}),checkout_started:e.strictObject({what:e.enum(CHECKOUT_WHATS),plan:EventWordSchema.optional(),interval:EventWordSchema.optional()}),checkout_completed:e.strictObject({what:e.enum(["plan","top_up"]),plan:EventWordSchema.optional(),amount_cents:e.number().int().nonnegative().optional(),currency:EventWordSchema.optional()}),checkout_expired:e.strictObject({what:e.enum(CHECKOUT_WHATS),plan:EventWordSchema.optional(),interval:EventWordSchema.optional(),currency:EventWordSchema.optional(),country:EventCountrySchema.optional()}),subscription_changed:e.strictObject({plan:EventWordSchema,interval:EventWordSchema,from_plan:EventWordSchema,from_interval:EventWordSchema}),subscription_canceled:e.strictObject({plan:EventWordSchema,interval:EventWordSchema,reason:EventWordSchema.optional()}),subscription_ended:e.strictObject({plan:EventWordSchema,interval:EventWordSchema}),subscription_renewed:e.strictObject({plan:EventWordSchema,interval:EventWordSchema,amount_cents:e.number().int().nonnegative(),currency:EventWordSchema}),payment_failed:e.strictObject({plan:EventWordSchema,interval:EventWordSchema,attempt:e.number().int().min(1)}),share_made:e.strictObject({kind:EventWordSchema,audience:EventWordSchema}),studio_opened:e.strictObject({where:e.enum(["computer","cloud"]),first:e.boolean()}),activated:e.strictObject({turns_before:e.number().int().min(0),hours_since_sign_up:e.number().min(0)}),turn_ended_on_question:e.strictObject({turns_before:e.number().int().min(0)}),turn_started_with_blanks:e.strictObject({turns_before:e.number().int().min(0)}),turn_classified:e.strictObject({purpose:e.enum(r),language:EventLanguageSchema.optional(),mood:e.enum(s).optional(),trouble:e.enum(i).optional()})},EVENT_ABOUT={program_opened:"Studio started.",project_opened:"A project was opened in Studio.",item_opened:"A piece was put on show in Studio: its kind (a video, a deck, a doc), never which one.",session_started:"A conversation with an agent began.",turn_started:"A message was sent to an agent: which agent, never what the message says.",turn_finished:"An agent finished answering a message: how long it took, how it ended, how many files it changed of each kind of work and how many pieces of each kind it made.",job_finished:"Work Studio did ended: an export, a publish, an install, a download.",command_ran:"A command of the allyhub CLI ran: its name, how long it took, its exit code and, where it did not succeed, its failure's code.",refusal_shown:"Studio showed that a call needs credits or a plan.",home_product_chosen:"On the console's Home, the action of one of the three ways to use AllyHub was pressed: which way.",item_opened_from_sidebar:"A piece or a file was opened from the sidebar by hand: its kind, and a plain file's extension, never which one.",file_downloaded:"A file was downloaded from Studio's Download: the piece's kind, the file's format, and whether the computer in the cloud was paused.",share_opened:"Studio's Share panel was opened: the piece's kind.",upgrade_clicked:"An upgrade or buy-credits button was pressed: which of a few places it was in.",prompt_prefilled:"The composer opened with a prompt from a link (a tool page's Get started): whether it has blanks to fill in, and which tool page it came from. Never its words.",welcome_example_pressed:"In the first project, one of the welcome's examples was pressed: its number as shown. Never its words.",plan_chosen:"A plan's button was pressed on the plan page: which plan, monthly or yearly, whether it changes a plan already paid for, and whether the page was in Settings or the paywall.",page_viewed:"One of a few pages was arrived at: the console's Home, AllyHub in the Cloud, or the plan's settings.",paywall_shown:"The dialog that offers plans and credits opened: why AllyHub refused (credits, a plan, storage), what kind of thing it refused, and whether a refusal or its reminder opened it.",checkout_abandoned:"Someone came back from Stripe's payment page without paying: what it was for (a plan, credits, a card) and, when they answered, which of a few reasons stopped them.",account_created:"A person signed up.",refusal_met:"AllyHub's service refused a call for credits, a plan, a limit, a tool turned off or storage, and whether background work made the call.",checkout_started:"A person went to pay.",checkout_completed:"A payment arrived.",checkout_expired:"A payment page was left unpaid until Stripe closed it.",subscription_changed:"A plan moved to another plan or between monthly and yearly.",subscription_canceled:"A plan was set to end, and the reason the person chose for it, when they chose one.",subscription_ended:"A plan ended.",subscription_renewed:"A plan's new period was paid.",payment_failed:"A plan's payment could not be charged.",share_made:"A share link was made.",studio_opened:"A person opened AllyHub Studio: the first time, then once a day at most.",activated:"A person's first message an agent answered to its end with something changed or made.",turn_ended_on_question:"An agent answered a person's message with a question alone: it ended as meant, changed and made nothing, and its answer ends in a question mark. How many messages the person had sent before it. Never a word of the message or the answer.",turn_started_with_blanks:"A person sent a message with a blank in square brackets still to fill in, as a tool page's prompt copied unfilled: how many messages they had sent before it. Never a word of the message.",turn_classified:"A message's labels, read by AllyHub's own model: which of a few kinds of work it asked for (research, a document, media, writing…), its language, how the person sounded (pleased, neutral, confused, frustrated) and, when confused or frustrated, about what. Never a word of the message."},CLIENT_EVENTS=["program_opened","project_opened","item_opened","session_started","turn_started","turn_finished","job_finished","command_ran","refusal_shown"],WINDOW_EVENTS=["home_product_chosen","item_opened_from_sidebar","file_downloaded","share_opened","upgrade_clicked","plan_chosen","prompt_prefilled","welcome_example_pressed","page_viewed","paywall_shown","checkout_abandoned"],sent={id:e.uuid(),at:e.iso.datetime(),projectId:EventIdSchema.optional(),sessionId:EventIdSchema.optional(),traceId:EventTraceIdSchema.optional()};const t=n=>e.strictObject({...sent,name:e.literal(n),props:EVENT_PROPS[n]});export const ClientEventSchema=e.discriminatedUnion("name",[t("program_opened"),t("project_opened"),t("item_opened"),t("session_started"),t("turn_started"),t("turn_finished"),t("job_finished"),t("command_ran"),t("refusal_shown")]),EventsRequestSchema=e.strictObject({events:e.array(ClientEventSchema).min(1).max(EVENTS_AT_MOST)});
|
|
2
|
+
import{z as e}from"zod";import{TURN_MOODS as s,TURN_PURPOSES as r,TURN_TROUBLES as i}from"./purposes.js";export const EVENTS_PATH="/api/events",EVENTS_AT_MOST=100,EventWordSchema=e.string().regex(/^[a-z0-9][a-z0-9_.:-]{0,63}$/u),EventIdSchema=e.string().regex(/^[A-Za-z0-9_-]{1,128}$/u),EventLanguageSchema=e.string().regex(/^[a-z]{2}$/u),EventCountrySchema=e.string().regex(/^[A-Z]{2}$/u),EventTraceIdSchema=e.string().regex(/^[0-9a-f]{32}$/u),EventRouteSchema=e.string().regex(/^(?:\/[A-Za-z0-9_.:*-]{1,64}){1,12}$|^unmatched$/u);const o=e.record(EventWordSchema,e.number().int().min(0).max(1e6)).refine(n=>Object.keys(n).length<=32,"At most 32 words.");export const WINDOW_PRODUCTS=["agents","desktop","cloud"],UPGRADE_PLACES=["sidebar_offer","plan_settings","refusal_card","read_only_chip","paywall"],PAYWALL_TRIGGERS=["refused","reminder","locked"],WINDOW_PAGES=["console_home","cloud_studio","plan_settings"],CHECKOUT_WHATS=["plan","top_up","card"],CHECKOUT_LEFT_REASONS=["price","payment_method","just_looking","other"];const a=e.number().int().min(0).max(10080*60*1e3);export const EVENT_PROPS={program_opened:e.strictObject({os:EventWordSchema,arch:EventWordSchema,where:e.enum(["computer","cloud"])}),project_opened:e.strictObject({fresh:e.boolean(),items:o}),item_opened:e.strictObject({kind:EventWordSchema}),session_started:e.strictObject({agent:EventWordSchema}),turn_started:e.strictObject({agent:EventWordSchema}),turn_finished:e.strictObject({agent:EventWordSchema,durationMs:a,ended:EventWordSchema,changed:o,made:o.optional()}),job_finished:e.strictObject({what:EventWordSchema,about:EventWordSchema,kind:EventWordSchema.optional(),durationMs:a,outcome:e.enum(["done","failed","cancelled"])}),command_ran:e.strictObject({command:EventWordSchema,durationMs:a,exit:e.number().int().min(0).max(255),code:EventWordSchema.optional()}),refusal_shown:e.strictObject({code:EventWordSchema,where:EventWordSchema}),home_product_chosen:e.strictObject({product:e.enum(WINDOW_PRODUCTS)}),item_opened_from_sidebar:e.strictObject({kind:EventWordSchema,extension:EventWordSchema.optional()}),file_downloaded:e.strictObject({kind:EventWordSchema,format:EventWordSchema,paused:e.boolean()}),item_played:e.strictObject({kind:EventWordSchema,seconds:e.number().min(0).max(1440*60),length:e.number().min(0).max(1440*60),ended:e.boolean()}),share_opened:e.strictObject({kind:EventWordSchema}),upgrade_clicked:e.strictObject({where:e.enum(UPGRADE_PLACES)}),prompt_prefilled:e.strictObject({blanks:e.boolean(),from:EventWordSchema.optional()}),welcome_example_pressed:e.strictObject({index:e.number().int().min(1).max(9)}),plan_chosen:e.strictObject({plan:EventWordSchema,interval:EventWordSchema,change:e.boolean(),where:e.enum(UPGRADE_PLACES)}),page_viewed:e.strictObject({page:e.enum(WINDOW_PAGES)}),paywall_shown:e.strictObject({reason:EventWordSchema,what:EventWordSchema,trigger:e.enum(PAYWALL_TRIGGERS)}),checkout_abandoned:e.strictObject({what:e.enum(CHECKOUT_WHATS),reason:e.enum(CHECKOUT_LEFT_REASONS).optional()}),account_created:e.strictObject({}),refusal_met:e.strictObject({code:EventWordSchema,route:EventRouteSchema,background:e.boolean().optional()}),checkout_started:e.strictObject({what:e.enum(CHECKOUT_WHATS),plan:EventWordSchema.optional(),interval:EventWordSchema.optional()}),checkout_completed:e.strictObject({what:e.enum(["plan","top_up"]),plan:EventWordSchema.optional(),amount_cents:e.number().int().nonnegative().optional(),currency:EventWordSchema.optional()}),checkout_expired:e.strictObject({what:e.enum(CHECKOUT_WHATS),plan:EventWordSchema.optional(),interval:EventWordSchema.optional(),currency:EventWordSchema.optional(),country:EventCountrySchema.optional()}),subscription_changed:e.strictObject({plan:EventWordSchema,interval:EventWordSchema,from_plan:EventWordSchema,from_interval:EventWordSchema}),subscription_canceled:e.strictObject({plan:EventWordSchema,interval:EventWordSchema,reason:EventWordSchema.optional()}),subscription_ended:e.strictObject({plan:EventWordSchema,interval:EventWordSchema}),subscription_renewed:e.strictObject({plan:EventWordSchema,interval:EventWordSchema,amount_cents:e.number().int().nonnegative(),currency:EventWordSchema}),payment_failed:e.strictObject({plan:EventWordSchema,interval:EventWordSchema,attempt:e.number().int().min(1)}),share_made:e.strictObject({kind:EventWordSchema,audience:EventWordSchema}),studio_opened:e.strictObject({where:e.enum(["computer","cloud"]),first:e.boolean(),device:e.enum(["phone","tablet","computer"]).optional(),os:e.enum(["iOS","iPadOS","Android","macOS","Windows","ChromeOS","Linux","other"]).optional(),browser:e.enum(["Safari","Chrome","Edge","Firefox","Samsung Internet","Opera","in-app","other"]).optional()}),activated:e.strictObject({turns_before:e.number().int().min(0),hours_since_sign_up:e.number().min(0)}),turn_ended_on_question:e.strictObject({turns_before:e.number().int().min(0)}),turn_started_with_blanks:e.strictObject({turns_before:e.number().int().min(0)}),turn_classified:e.strictObject({purpose:e.enum(r),language:EventLanguageSchema.optional(),mood:e.enum(s).optional(),trouble:e.enum(i).optional()})},EVENT_ABOUT={program_opened:"Studio started.",project_opened:"A project was opened in Studio.",item_opened:"A piece was put on show in Studio: its kind (a video, a deck, a doc), never which one.",session_started:"A conversation with an agent began.",turn_started:"A message was sent to an agent: which agent, never what the message says.",turn_finished:"An agent finished answering a message: how long it took, how it ended, how many files it changed of each kind of work and how many pieces of each kind it made.",job_finished:"Work Studio did ended: an export, a publish, an install, a download.",command_ran:"A command of the allyhub CLI ran: its name, how long it took, its exit code and, where it did not succeed, its failure's code.",refusal_shown:"Studio showed that a call needs credits or a plan.",home_product_chosen:"On the Ways to use AllyHub page, the action of one of the three ways to use AllyHub was pressed: which way.",item_opened_from_sidebar:"A piece or a file was opened from the sidebar by hand: its kind, and a plain file's extension, never which one.",file_downloaded:"A file was downloaded from Studio's Download: the piece's kind, the file's format, and whether the computer in the cloud was paused.",item_played:"A piece was played in Studio, from pressing play to a pause, its end or leaving it: its kind, the seconds that played, its length and whether it played to its end. Never which one.",share_opened:"Studio's Share panel was opened: the piece's kind.",upgrade_clicked:"An upgrade or buy-credits button was pressed: which of a few places it was in.",prompt_prefilled:"The composer opened with a prompt from a link (a tool page's Get started): whether it has blanks to fill in, and which tool page it came from. Never its words.",welcome_example_pressed:"In the first project, one of the welcome's examples was pressed: its number as shown. Never its words.",plan_chosen:"A plan's button was pressed on the plan page: which plan, monthly or yearly, whether it changes a plan already paid for, and whether the page was in Settings or the paywall.",page_viewed:"One of a few pages was arrived at: the Ways to use AllyHub page, AllyHub in the Cloud, or the plan's settings.",paywall_shown:"The dialog that offers plans and credits opened: why AllyHub refused (credits, a plan, storage), what kind of thing it refused, and whether a refusal or its reminder opened it.",checkout_abandoned:"Someone came back from Stripe's payment page without paying: what it was for (a plan, credits, a card) and, when they answered, which of a few reasons stopped them.",account_created:"A person signed up.",refusal_met:"AllyHub's service refused a call for credits, a plan, a limit, a tool turned off or storage, and whether background work made the call.",checkout_started:"A person went to pay.",checkout_completed:"A payment arrived.",checkout_expired:"A payment page was left unpaid until Stripe closed it.",subscription_changed:"A plan moved to another plan or between monthly and yearly.",subscription_canceled:"A plan was set to end, and the reason the person chose for it, when they chose one.",subscription_ended:"A plan ended.",subscription_renewed:"A plan's new period was paid.",payment_failed:"A plan's payment could not be charged.",share_made:"A share link was made.",studio_opened:"A person opened AllyHub Studio: the first time, then once a day at most.",activated:"A person's first message an agent answered to its end with something changed or made.",turn_ended_on_question:"An agent answered a person's message with a question alone: it ended as meant, changed and made nothing, and its answer ends in a question mark. How many messages the person had sent before it. Never a word of the message or the answer.",turn_started_with_blanks:"A person sent a message with a blank in square brackets still to fill in, as a tool page's prompt copied unfilled: how many messages they had sent before it. Never a word of the message.",turn_classified:"A message's labels, read by AllyHub's own model: which of a few kinds of work it asked for (research, a document, media, writing…), its language, how the person sounded (pleased, neutral, confused, frustrated) and, when confused or frustrated, about what. Never a word of the message."},CLIENT_EVENTS=["program_opened","project_opened","item_opened","session_started","turn_started","turn_finished","job_finished","command_ran","refusal_shown"],WINDOW_EVENTS=["home_product_chosen","item_opened_from_sidebar","file_downloaded","item_played","share_opened","upgrade_clicked","plan_chosen","prompt_prefilled","welcome_example_pressed","page_viewed","paywall_shown","checkout_abandoned"],sent={id:e.uuid(),at:e.iso.datetime(),projectId:EventIdSchema.optional(),sessionId:EventIdSchema.optional(),traceId:EventTraceIdSchema.optional()};const t=n=>e.strictObject({...sent,name:e.literal(n),props:EVENT_PROPS[n]});export const ClientEventSchema=e.discriminatedUnion("name",[t("program_opened"),t("project_opened"),t("item_opened"),t("session_started"),t("turn_started"),t("turn_finished"),t("job_finished"),t("command_ran"),t("refusal_shown")]),EventsRequestSchema=e.strictObject({events:e.array(ClientEventSchema).min(1).max(EVENTS_AT_MOST)});
|