@svenroth-ai/shipwright 0.28.0 → 0.29.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/dist/apple-touch-icon.png +0 -0
- package/client/dist/assets/{EmbeddedTerminal-4xgNUBUu.js → EmbeddedTerminal-BXosRYLy.js} +30 -30
- package/client/dist/assets/{abnfDiagram-VRR7QNED-BdCNbaqc.js → abnfDiagram-VCTEODGH-BGxuVEiU.js} +1 -1
- package/client/dist/assets/arc-o82bcJs8.js +1 -0
- package/client/dist/assets/architectureDiagram-5GKGNRK7-CaeUIM7e.js +36 -0
- package/client/dist/assets/blockDiagram-I7D4REHJ-DtWpTjgT.js +129 -0
- package/client/dist/assets/c4Diagram-7LVT6UL2-sJULbaUv.js +38 -0
- package/client/dist/assets/channel-CLBQbfQb.js +1 -0
- package/client/dist/assets/{chunk-2Q5K7J3B-4N6AnmBJ.js → chunk-2Q5K7J3B-CPeH4xHb.js} +1 -1
- package/client/dist/assets/{chunk-5VM5RSS4-Bwd7rtD3.js → chunk-5VM5RSS4-DxiKB3qZ.js} +1 -1
- package/client/dist/assets/{chunk-32BRIVSS-Cs67LiCy.js → chunk-F27PBJKO-B8V1zhCX.js} +1 -1
- package/client/dist/assets/{chunk-EX3LRPZG-CQqGfptD.js → chunk-IMKFNOWR-BtXet829.js} +5 -5
- package/client/dist/assets/{chunk-JWPE2WC7-ClvKd4PN.js → chunk-JWPE2WC7-BaQYKssR.js} +1 -1
- package/client/dist/assets/chunk-POPQ4Y6H-I1x_vfH3.js +1 -0
- package/client/dist/assets/{chunk-MOJQB5TN-Cwvj8GE1.js → chunk-SVP7TREG-Bvt8jrSp.js} +1 -1
- package/client/dist/assets/{chunk-V7JOEXUC-CYFfa4PY.js → chunk-TICWLB2K--9ywNq1F.js} +1 -1
- package/client/dist/assets/{chunk-XXDRQBXY-BQAZ6Our.js → chunk-XXDRQBXY-DrIyrBs1.js} +1 -1
- package/client/dist/assets/classDiagram-ZZMXUADV-D8z-o3xu.js +1 -0
- package/client/dist/assets/classDiagram-v2-VYDZK3BY-D8z-o3xu.js +1 -0
- package/client/dist/assets/{cose-bilkent-JH36ORCC-C76Yia6h.js → cose-bilkent-JH36ORCC-DISm8_p0.js} +1 -1
- package/client/dist/assets/{cynefin-VYW2F7L2-pJe7rdTi.js → cynefin-OW5HDTMX-wyDjqucU.js} +3 -3
- package/client/dist/assets/{cynefinDiagram-TSTJHNR4-EeHQ7dYV.js → cynefinDiagram-5FMLGOSQ-CN-IKDQ6.js} +1 -1
- package/client/dist/assets/dagre-GXQ25YYZ-QY0m5eSL.js +4 -0
- package/client/dist/assets/diagram-S7CK7UJ4-DhjaAe2g.js +30 -0
- package/client/dist/assets/diagram-UQ7AKVKN-D-3R3axg.js +41 -0
- package/client/dist/assets/{diagram-FQU43EPY-DW_-leqw.js → diagram-VSXAHHWV-BxXEtjRu.js} +2 -2
- package/client/dist/assets/{diagram-G47NLZAW-C_hsLD4u.js → diagram-VX7I27RA-DkbXkJpd.js} +1 -1
- package/client/dist/assets/{diagram-NH7WQ7WH-CbeQuO_f.js → diagram-Z3DM3KII-DQGRD9gQ.js} +1 -1
- package/client/dist/assets/{ebnfDiagram-CCIWWBDH-B8Z8WHF6.js → ebnfDiagram-PWID7BFC-C_XxskCm.js} +1 -1
- package/client/dist/assets/erDiagram-RLTQ6QDP-BhBsYQ7c.js +99 -0
- package/client/dist/assets/flowDiagram-HODETNUW-D7fXEPrM.js +168 -0
- package/client/dist/assets/{ganttDiagram-NO4QXBWP-K3X0DYBa.js → ganttDiagram-EL5Y4UJY-Bwf8EtWr.js} +4 -4
- package/client/dist/assets/{gitGraphDiagram-IHSO6WYX-B2SEx0xa.js → gitGraphDiagram-WWUBYQGX-C3_ixsOl.js} +1 -1
- package/client/dist/assets/index-DWrPE3aq.css +1 -0
- package/client/dist/assets/index-DwRlIUrK.js +924 -0
- package/client/dist/assets/infoDiagram-27XIBGKW-BpcHmgOL.js +2 -0
- package/client/dist/assets/{ishikawaDiagram-FXEZZL3T-CrN7QJzt.js → ishikawaDiagram-5VMMS53U-DzSGmhT5.js} +4 -4
- package/client/dist/assets/{journeyDiagram-5HDEW3XC-XHIsl7rM.js → journeyDiagram-3NMN7TZE-CT1CrVQO.js} +2 -2
- package/client/dist/assets/{kanban-definition-HUTT4EX6-A6HJqHw7.js → kanban-definition-UXKFOSKX-N1CNMAOm.js} +8 -8
- package/client/dist/assets/katex-C5jXJg4s.js +257 -0
- package/client/dist/assets/layout-CR8gdfo4.js +1 -0
- package/client/dist/assets/{linear-D1vF9IQB.js → linear-CfLRjQgX.js} +1 -1
- package/client/dist/assets/mermaid.core-Bnqt31Q7.js +312 -0
- package/client/dist/assets/{mindmap-definition-LN4V7U3C-CxRkUj6Z.js → mindmap-definition-YA3MSWOX-Brc-v1M4.js} +2 -2
- package/client/dist/assets/{pegDiagram-2B236MQR-Bs9dp-8a.js → pegDiagram-XKGWAZYB-D8jUV01U.js} +1 -1
- package/client/dist/assets/{pieDiagram-ENE6RG2P-DBWILzB8.js → pieDiagram-E7YTZNPT-BiSkIsrz.js} +3 -3
- package/client/dist/assets/{quadrantDiagram-ABIIQ3AL-DrCVJJx6.js → quadrantDiagram-AXDQQJYC-CJetqQxd.js} +1 -1
- package/client/dist/assets/{railroadDiagram-RFXS5EU6-BdPW2dNf.js → railroadDiagram-O6MQD6OU-DTTtZpGO.js} +1 -1
- package/client/dist/assets/{requirementDiagram-TGXJPOKE-Bj_g3tC5.js → requirementDiagram-BXWQKSXE-meFCoLtR.js} +5 -5
- package/client/dist/assets/{sankeyDiagram-HTMAVEWB-BGL9NnsS.js → sankeyDiagram-P5KCCOFB-BR9eN4Do.js} +4 -4
- package/client/dist/assets/{sequenceDiagram-DBY2YBRQ-DEirxTZY.js → sequenceDiagram-WJ2MYXX4-BdVzFsCC.js} +1 -1
- package/client/dist/assets/{sizeCapture-X5ZJPWSS-BtLrvrea.js → sizeCapture-INFHLROL-CZoZ7r-1.js} +1 -1
- package/client/dist/assets/stateDiagram-D77RDMKH-Cmc-iYtm.js +1 -0
- package/client/dist/assets/stateDiagram-v2-MP3YSRHH-Cj-hQ4qB.js +1 -0
- package/client/dist/assets/swimlanes-42K2YHIH-DN4MssUX.js +1 -0
- package/client/dist/assets/swimlanesDiagram-VR7AAH4N-DFxrYFKF.js +8 -0
- package/client/dist/assets/{timeline-definition-FHXFAJF6-CnBKJtD_.js → timeline-definition-24CTP7MA-pxxqlxwt.js} +3 -3
- package/client/dist/assets/{vennDiagram-L72KCM5P-BYmiJYoh.js → vennDiagram-4TSXK5OY-DiItNcze.js} +5 -5
- package/client/dist/assets/{wardleyDiagram-EHGQE667-DU7vW8q3.js → wardleyDiagram-VM6X3IG4-Dfvub75z.js} +1 -1
- package/client/dist/assets/xychartDiagram-S5SC5T6Z-Bx83X515.js +7 -0
- package/client/dist/favicon-16.png +0 -0
- package/client/dist/favicon-32.png +0 -0
- package/client/dist/icon-192.png +0 -0
- package/client/dist/icon-512.png +0 -0
- package/client/dist/icon-maskable-512.png +0 -0
- package/client/dist/index.html +11 -2
- package/client/dist/manifest.json +13 -0
- package/package.json +2 -2
- package/server/dist/config.d.ts.map +1 -1
- package/server/dist/config.js +7 -2
- package/server/dist/config.js.map +1 -1
- package/server/dist/core/adopt-scan-findings.d.ts +12 -0
- package/server/dist/core/adopt-scan-findings.d.ts.map +1 -0
- package/server/dist/core/adopt-scan-findings.js +96 -0
- package/server/dist/core/adopt-scan-findings.js.map +1 -0
- package/server/dist/core/adopt-scan.d.ts +49 -0
- package/server/dist/core/adopt-scan.d.ts.map +1 -0
- package/server/dist/core/adopt-scan.js +201 -0
- package/server/dist/core/adopt-scan.js.map +1 -0
- package/server/dist/core/custom-profile-command-policy.d.ts +6 -0
- package/server/dist/core/custom-profile-command-policy.d.ts.map +1 -0
- package/server/dist/core/custom-profile-command-policy.js +110 -0
- package/server/dist/core/custom-profile-command-policy.js.map +1 -0
- package/server/dist/core/custom-profile-loader.d.ts +34 -0
- package/server/dist/core/custom-profile-loader.d.ts.map +1 -0
- package/server/dist/core/custom-profile-loader.js +225 -0
- package/server/dist/core/custom-profile-loader.js.map +1 -0
- package/server/dist/core/preview-child-lifecycle.d.ts +7 -2
- package/server/dist/core/preview-child-lifecycle.d.ts.map +1 -1
- package/server/dist/core/preview-child-lifecycle.js +17 -5
- package/server/dist/core/preview-child-lifecycle.js.map +1 -1
- package/server/dist/core/preview-session-manager.d.ts +1 -0
- package/server/dist/core/preview-session-manager.d.ts.map +1 -1
- package/server/dist/core/preview-session-manager.js +2 -2
- package/server/dist/core/preview-session-manager.js.map +1 -1
- package/server/dist/core/project-actions-loader.d.ts +13 -0
- package/server/dist/core/project-actions-loader.d.ts.map +1 -1
- package/server/dist/core/project-actions-loader.js +28 -6
- package/server/dist/core/project-actions-loader.js.map +1 -1
- package/server/dist/core/project-data-dir.d.ts +41 -0
- package/server/dist/core/project-data-dir.d.ts.map +1 -0
- package/server/dist/core/project-data-dir.js +64 -0
- package/server/dist/core/project-data-dir.js.map +1 -0
- package/server/dist/core/project-data-migrate.d.ts +14 -0
- package/server/dist/core/project-data-migrate.d.ts.map +1 -0
- package/server/dist/core/project-data-migrate.js +94 -0
- package/server/dist/core/project-data-migrate.js.map +1 -0
- package/server/dist/core/project-manager.d.ts.map +1 -1
- package/server/dist/core/project-manager.js +9 -10
- package/server/dist/core/project-manager.js.map +1 -1
- package/server/dist/core/session-file/access.d.ts +26 -0
- package/server/dist/core/session-file/access.d.ts.map +1 -0
- package/server/dist/core/session-file/access.js +143 -0
- package/server/dist/core/session-file/access.js.map +1 -0
- package/server/dist/core/session-file/asset-access.d.ts +15 -0
- package/server/dist/core/session-file/asset-access.d.ts.map +1 -0
- package/server/dist/core/session-file/asset-access.js +141 -0
- package/server/dist/core/session-file/asset-access.js.map +1 -0
- package/server/dist/core/session-file/evidence.d.ts +25 -0
- package/server/dist/core/session-file/evidence.d.ts.map +1 -0
- package/server/dist/core/session-file/evidence.js +201 -0
- package/server/dist/core/session-file/evidence.js.map +1 -0
- package/server/dist/core/session-file/probe.d.ts +16 -0
- package/server/dist/core/session-file/probe.d.ts.map +1 -0
- package/server/dist/core/session-file/probe.js +63 -0
- package/server/dist/core/session-file/probe.js.map +1 -0
- package/server/dist/core/session-file/safe-read.d.ts +33 -0
- package/server/dist/core/session-file/safe-read.d.ts.map +1 -0
- package/server/dist/core/session-file/safe-read.js +103 -0
- package/server/dist/core/session-file/safe-read.js.map +1 -0
- package/server/dist/core/session-file/sensitive.d.ts +5 -0
- package/server/dist/core/session-file/sensitive.d.ts.map +1 -0
- package/server/dist/core/session-file/sensitive.js +52 -0
- package/server/dist/core/session-file/sensitive.js.map +1 -0
- package/server/dist/core/session-info/collect.d.ts +70 -0
- package/server/dist/core/session-info/collect.d.ts.map +1 -0
- package/server/dist/core/session-info/collect.js +248 -0
- package/server/dist/core/session-info/collect.js.map +1 -0
- package/server/dist/core/session-info/line-scan.d.ts +20 -0
- package/server/dist/core/session-info/line-scan.d.ts.map +1 -0
- package/server/dist/core/session-info/line-scan.js +109 -0
- package/server/dist/core/session-info/line-scan.js.map +1 -0
- package/server/dist/core/session-info/remote-control.d.ts +9 -0
- package/server/dist/core/session-info/remote-control.d.ts.map +1 -0
- package/server/dist/core/session-info/remote-control.js +64 -0
- package/server/dist/core/session-info/remote-control.js.map +1 -0
- package/server/dist/core/session-info/session-info.d.ts +18 -0
- package/server/dist/core/session-info/session-info.d.ts.map +1 -0
- package/server/dist/core/session-info/session-info.js +170 -0
- package/server/dist/core/session-info/session-info.js.map +1 -0
- package/server/dist/core/session-info/small-file.d.ts +2 -0
- package/server/dist/core/session-info/small-file.d.ts.map +1 -0
- package/server/dist/core/session-info/small-file.js +42 -0
- package/server/dist/core/session-info/small-file.js.map +1 -0
- package/server/dist/core/session-info/subagent-transcript.d.ts +12 -0
- package/server/dist/core/session-info/subagent-transcript.d.ts.map +1 -0
- package/server/dist/core/session-info/subagent-transcript.js +78 -0
- package/server/dist/core/session-info/subagent-transcript.js.map +1 -0
- package/server/dist/core/session-info/subagents.d.ts +14 -0
- package/server/dist/core/session-info/subagents.d.ts.map +1 -0
- package/server/dist/core/session-info/subagents.js +92 -0
- package/server/dist/core/session-info/subagents.js.map +1 -0
- package/server/dist/core/session-info/test-fixtures.d.ts +50 -0
- package/server/dist/core/session-info/test-fixtures.d.ts.map +1 -0
- package/server/dist/core/session-info/test-fixtures.js +43 -0
- package/server/dist/core/session-info/test-fixtures.js.map +1 -0
- package/server/dist/core/session-info/types.d.ts +77 -0
- package/server/dist/core/session-info/types.d.ts.map +1 -0
- package/server/dist/core/session-info/types.js +14 -0
- package/server/dist/core/session-info/types.js.map +1 -0
- package/server/dist/core/stack-profiles-create.d.ts +31 -0
- package/server/dist/core/stack-profiles-create.d.ts.map +1 -0
- package/server/dist/core/stack-profiles-create.js +128 -0
- package/server/dist/core/stack-profiles-create.js.map +1 -0
- package/server/dist/core/stack-profiles.d.ts +49 -0
- package/server/dist/core/stack-profiles.d.ts.map +1 -0
- package/server/dist/core/stack-profiles.js +142 -0
- package/server/dist/core/stack-profiles.js.map +1 -0
- package/server/dist/external/_shared/helpers.d.ts +2 -0
- package/server/dist/external/_shared/helpers.d.ts.map +1 -1
- package/server/dist/external/_shared/helpers.js.map +1 -1
- package/server/dist/external/actions/get.d.ts +3 -1
- package/server/dist/external/actions/get.d.ts.map +1 -1
- package/server/dist/external/actions/get.js +15 -4
- package/server/dist/external/actions/get.js.map +1 -1
- package/server/dist/external/actions/routes.d.ts +3 -1
- package/server/dist/external/actions/routes.d.ts.map +1 -1
- package/server/dist/external/actions/routes.js.map +1 -1
- package/server/dist/external/actions/stub.d.ts.map +1 -1
- package/server/dist/external/actions/stub.js +15 -4
- package/server/dist/external/actions/stub.js.map +1 -1
- package/server/dist/external/actions/upload-delete.d.ts.map +1 -1
- package/server/dist/external/actions/upload-delete.js +30 -20
- package/server/dist/external/actions/upload-delete.js.map +1 -1
- package/server/dist/external/actions/upload.d.ts.map +1 -1
- package/server/dist/external/actions/upload.js +5 -4
- package/server/dist/external/actions/upload.js.map +1 -1
- package/server/dist/external/create-external-routes-args.d.ts +3 -1
- package/server/dist/external/create-external-routes-args.d.ts.map +1 -1
- package/server/dist/external/inbox/_phase-gate.d.ts +9 -0
- package/server/dist/external/inbox/_phase-gate.d.ts.map +1 -0
- package/server/dist/external/inbox/_phase-gate.js +87 -0
- package/server/dist/external/inbox/_phase-gate.js.map +1 -0
- package/server/dist/external/inbox/_types.d.ts +7 -0
- package/server/dist/external/inbox/_types.d.ts.map +1 -1
- package/server/dist/external/inbox/routes.d.ts.map +1 -1
- package/server/dist/external/inbox/routes.js +2 -0
- package/server/dist/external/inbox/routes.js.map +1 -1
- package/server/dist/external/launch/action-substitution-branch.js +2 -2
- package/server/dist/external/launch/action-substitution-branch.js.map +1 -1
- package/server/dist/external/mission-context/facts.js +2 -2
- package/server/dist/external/mission-context/facts.js.map +1 -1
- package/server/dist/external/preview/routes.d.ts +3 -1
- package/server/dist/external/preview/routes.d.ts.map +1 -1
- package/server/dist/external/preview/routes.js +8 -1
- package/server/dist/external/preview/routes.js.map +1 -1
- package/server/dist/external/routes.d.ts.map +1 -1
- package/server/dist/external/routes.js +2 -2
- package/server/dist/external/routes.js.map +1 -1
- package/server/dist/external/session-file/probe-route.d.ts +4 -0
- package/server/dist/external/session-file/probe-route.d.ts.map +1 -0
- package/server/dist/external/session-file/probe-route.js +66 -0
- package/server/dist/external/session-file/probe-route.js.map +1 -0
- package/server/dist/external/session-file/routes.d.ts +12 -0
- package/server/dist/external/session-file/routes.d.ts.map +1 -0
- package/server/dist/external/session-file/routes.js +90 -0
- package/server/dist/external/session-file/routes.js.map +1 -0
- package/server/dist/external/session-file/session-file.fixture.d.ts +45 -0
- package/server/dist/external/session-file/session-file.fixture.d.ts.map +1 -0
- package/server/dist/external/session-file/session-file.fixture.js +41 -0
- package/server/dist/external/session-file/session-file.fixture.js.map +1 -0
- package/server/dist/external/session-info/routes.d.ts +15 -0
- package/server/dist/external/session-info/routes.d.ts.map +1 -0
- package/server/dist/external/session-info/routes.js +57 -0
- package/server/dist/external/session-info/routes.js.map +1 -0
- package/server/dist/external/tasks/_phase-helpers.js +2 -2
- package/server/dist/external/tasks/_phase-helpers.js.map +1 -1
- package/server/dist/external/tasks/create.js +2 -2
- package/server/dist/external/tasks/create.js.map +1 -1
- package/server/dist/external-routes-wiring.d.ts.map +1 -1
- package/server/dist/external-routes-wiring.js +10 -1
- package/server/dist/external-routes-wiring.js.map +1 -1
- package/server/dist/index.d.ts.map +1 -1
- package/server/dist/index.js +6 -8
- package/server/dist/index.js.map +1 -1
- package/server/dist/routes/adopt-scan.d.ts +4 -0
- package/server/dist/routes/adopt-scan.d.ts.map +1 -0
- package/server/dist/routes/adopt-scan.js +27 -0
- package/server/dist/routes/adopt-scan.js.map +1 -0
- package/server/dist/routes/profiles.d.ts +7 -0
- package/server/dist/routes/profiles.d.ts.map +1 -1
- package/server/dist/routes/profiles.js +13 -0
- package/server/dist/routes/profiles.js.map +1 -1
- package/server/dist/routes/projects.d.ts.map +1 -1
- package/server/dist/routes/projects.js +58 -16
- package/server/dist/routes/projects.js.map +1 -1
- package/server/dist/routes/stack-profiles.d.ts +10 -0
- package/server/dist/routes/stack-profiles.d.ts.map +1 -0
- package/server/dist/routes/stack-profiles.js +65 -0
- package/server/dist/routes/stack-profiles.js.map +1 -0
- package/server/dist/terminal/data-target.d.ts +17 -0
- package/server/dist/terminal/data-target.d.ts.map +1 -0
- package/server/dist/terminal/data-target.js +56 -0
- package/server/dist/terminal/data-target.js.map +1 -0
- package/server/dist/terminal/image-paste.d.ts +2 -0
- package/server/dist/terminal/image-paste.d.ts.map +1 -1
- package/server/dist/terminal/image-paste.js +11 -12
- package/server/dist/terminal/image-paste.js.map +1 -1
- package/server/dist/terminal/routes.d.ts +5 -0
- package/server/dist/terminal/routes.d.ts.map +1 -1
- package/server/dist/terminal/routes.js +11 -13
- package/server/dist/terminal/routes.js.map +1 -1
- package/server/dist/types/project.d.ts +9 -0
- package/server/dist/types/project.d.ts.map +1 -1
- package/server/dist/types/stack-profile-contract.d.ts +33 -0
- package/server/dist/types/stack-profile-contract.d.ts.map +1 -0
- package/server/dist/types/stack-profile-contract.js +11 -0
- package/server/dist/types/stack-profile-contract.js.map +1 -0
- package/server/package.json +3 -3
- package/client/dist/assets/arc-DoZTTE1N.js +0 -1
- package/client/dist/assets/architectureDiagram-ZJ3FMSHR-DFTG4KtO.js +0 -36
- package/client/dist/assets/blockDiagram-677ZJIJ3-C34UBjOB.js +0 -132
- package/client/dist/assets/c4Diagram-LMCZKHZV-CbqAB1Ou.js +0 -10
- package/client/dist/assets/channel-DBcZw7Kn.js +0 -1
- package/client/dist/assets/chunk-RYQCIY6F-DrWMx37d.js +0 -1
- package/client/dist/assets/chunk-VR4S4FIN-B5eWtesm.js +0 -1
- package/client/dist/assets/classDiagram-OUVF2IWQ-C3Q1V9DU.js +0 -1
- package/client/dist/assets/classDiagram-v2-EOCWNBFH-C3Q1V9DU.js +0 -1
- package/client/dist/assets/dagre-VKFMJZFB-VXOY6IHR.js +0 -4
- package/client/dist/assets/diagram-OA4YK3LP-DRHY5d_c.js +0 -30
- package/client/dist/assets/diagram-WEI45ONY-B87OYR_S.js +0 -41
- package/client/dist/assets/erDiagram-Q63AITRT-DaD7oa9H.js +0 -85
- package/client/dist/assets/flowDiagram-23GEKE2U-GrMVpsea.js +0 -156
- package/client/dist/assets/graph-C9eacEi8.js +0 -1
- package/client/dist/assets/index-CIpLt0ie.js +0 -863
- package/client/dist/assets/index-DGtnTeFd.css +0 -1
- package/client/dist/assets/infoDiagram-FWYZ7A6U-Fi8fQ95G.js +0 -2
- package/client/dist/assets/katex-DkKDou_j.js +0 -257
- package/client/dist/assets/layout-DEXfKzaS.js +0 -1
- package/client/dist/assets/map-Czzmt4hB.js +0 -1
- package/client/dist/assets/mermaid.core-D6w9zlA0.js +0 -314
- package/client/dist/assets/stateDiagram-2N3HPSRC-D3GXIouX.js +0 -1
- package/client/dist/assets/stateDiagram-v2-6OUMAXLB-D3lXe_mJ.js +0 -1
- package/client/dist/assets/swimlanes-5IMT3BWC-PMRQzNhU.js +0 -2
- package/client/dist/assets/swimlanesDiagram-G3AALYLV-DMLbRFiO.js +0 -8
- package/client/dist/assets/xychartDiagram-FW5EYKEG-BEtPvBSU.js +0 -7
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{s as pi,g as mi,o as $t,n as yi,a as bi,b as wi,_ as a,l as Ut,D as Ai,d as Ci,p as Si,y as Dt,i as Ri,A as Gt,B as _i,E as ki,aC as Ti,R as Xt}from"./mermaid.core-Bnqt31Q7.js";import{i as Di}from"./init-Gi6I4Gst.js";import{o as Pi}from"./ordinal-Cboi1Yqb.js";import{l as Nt}from"./linear-CfLRjQgX.js";import"./index-DwRlIUrK.js";import"./defaultLocale-DX6XiGOO.js";function vi(e,t,i){e=+e,t=+t,i=(n=arguments.length)<2?(t=e,e=0,1):n<3?1:+i;for(var s=-1,n=Math.max(0,Math.ceil((t-e)/i))|0,o=new Array(n);++s<n;)o[s]=e+s*i;return o}function St(){var e=Pi().unknown(void 0),t=e.domain,i=e.range,s=0,n=1,o,h,p=!1,u=0,f=0,R=.5;delete e.unknown;function C(){var y=t().length,E=n<s,v=E?n:s,L=E?s:n;o=(L-v)/Math.max(1,y-u+f*2),p&&(o=Math.floor(o)),v+=(L-v-o*(y-u))*R,h=o*(1-u),p&&(v=Math.round(v),h=Math.round(h));var M=vi(y).map(function(b){return v+o*b});return i(E?M.reverse():M)}return e.domain=function(y){return arguments.length?(t(y),C()):t()},e.range=function(y){return arguments.length?([s,n]=y,s=+s,n=+n,C()):[s,n]},e.rangeRound=function(y){return[s,n]=y,s=+s,n=+n,p=!0,C()},e.bandwidth=function(){return h},e.step=function(){return o},e.round=function(y){return arguments.length?(p=!!y,C()):p},e.padding=function(y){return arguments.length?(u=Math.min(1,f=+y),C()):u},e.paddingInner=function(y){return arguments.length?(u=Math.min(1,y),C()):u},e.paddingOuter=function(y){return arguments.length?(f=+y,C()):f},e.align=function(y){return arguments.length?(R=Math.max(0,Math.min(1,y)),C()):R},e.copy=function(){return St(t(),[s,n]).round(p).paddingInner(u).paddingOuter(f).align(R)},Di.apply(C(),arguments)}var Rt=(function(){var e=a(function(W,l,g,d){for(g=g||{},d=W.length;d--;g[W[d]]=l);return g},"o"),t=[1,10,12,14,16,18,19,21,23],i=[2,6],s=[1,3],n=[1,5],o=[1,6],h=[1,7],p=[1,5,10,12,14,16,18,19,21,23,36,37,38],u=[1,25],f=[1,26],R=[1,28],C=[1,29],y=[1,30],E=[1,31],v=[1,32],L=[1,33],M=[1,34],b=[1,35],D=[1,36],c=[1,37],z=[1,43],F=[1,42],X=[1,47],N=[1,50],k=[1,10,12,14,16,18,19,21,23,36,37,38],H=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],A=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],S=[1,65],O=[26,28],T={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:a(function(l,g,d,x,_,r,lt){var m=r.length-1;switch(_){case 5:x.setOrientation(r[m]);break;case 9:x.setDiagramTitle(r[m].text.trim());break;case 12:x.setLineData({text:"",type:"text"},r[m]);break;case 13:x.setLineData(r[m-1],r[m]);break;case 14:x.setBarData({text:"",type:"text"},r[m]);break;case 15:x.setBarData(r[m-1],r[m]);break;case 16:this.$=r[m].trim(),x.setAccTitle(this.$);break;case 17:case 18:this.$=r[m].trim(),x.setAccDescription(this.$);break;case 19:this.$=r[m-1];break;case 20:case 30:this.$=[r[m-2],...r[m]];break;case 21:case 31:this.$=[r[m]];break;case 22:this.$={value:Number(r[m-1]),label:r[m]};break;case 23:this.$={value:Number(r[m]),label:""};break;case 24:x.setXAxisTitle(r[m]);break;case 25:x.setXAxisTitle(r[m-1]);break;case 26:x.setXAxisTitle({type:"text",text:""});break;case 27:x.setXAxisBand(r[m]);break;case 28:x.setXAxisRangeData(Number(r[m-2]),Number(r[m]));break;case 29:this.$=r[m-1];break;case 32:x.setYAxisTitle(r[m]);break;case 33:x.setYAxisTitle(r[m-1]);break;case 34:x.setYAxisTitle({type:"text",text:""});break;case 35:x.setYAxisRangeData(Number(r[m-2]),Number(r[m]));break;case 39:this.$={text:r[m],type:"text"};break;case 40:this.$={text:r[m],type:"text"};break;case 41:this.$={text:r[m],type:"markdown"};break;case 42:this.$=r[m];break;case 43:this.$=r[m-1]+""+r[m];break}},"anonymous"),table:[e(t,i,{3:1,4:2,7:4,5:s,36:n,37:o,38:h}),{1:[3]},e(t,i,{4:2,7:4,3:8,5:s,36:n,37:o,38:h}),e(t,i,{4:2,7:4,6:9,3:10,5:s,8:[1,11],36:n,37:o,38:h}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(p,[2,36]),e(p,[2,37]),e(p,[2,38]),{1:[2,1]},e(t,i,{4:2,7:4,3:21,5:s,36:n,37:o,38:h}),{1:[2,3]},e(p,[2,5]),e(t,[2,7],{4:22,36:n,37:o,38:h}),{11:23,30:u,39:24,40:f,41:27,42:R,43:C,44:y,45:E,46:v,47:L,48:M,49:b,50:D,51:c},{11:39,13:38,24:z,29:F,30:u,31:40,32:41,39:24,40:f,41:27,42:R,43:C,44:y,45:E,46:v,47:L,48:M,49:b,50:D,51:c},{11:45,15:44,29:X,30:u,35:46,39:24,40:f,41:27,42:R,43:C,44:y,45:E,46:v,47:L,48:M,49:b,50:D,51:c},{11:49,17:48,24:N,30:u,39:24,40:f,41:27,42:R,43:C,44:y,45:E,46:v,47:L,48:M,49:b,50:D,51:c},{11:52,17:51,24:N,30:u,39:24,40:f,41:27,42:R,43:C,44:y,45:E,46:v,47:L,48:M,49:b,50:D,51:c},{20:[1,53]},{22:[1,54]},e(k,[2,18]),{1:[2,2]},e(k,[2,8]),e(k,[2,9]),e(H,[2,39],{41:55,42:R,43:C,44:y,45:E,46:v,47:L,48:M,49:b,50:D,51:c}),e(H,[2,40]),e(H,[2,41]),e(A,[2,42]),e(A,[2,44]),e(A,[2,45]),e(A,[2,46]),e(A,[2,47]),e(A,[2,48]),e(A,[2,49]),e(A,[2,50]),e(A,[2,51]),e(A,[2,52]),e(A,[2,53]),e(k,[2,10]),e(k,[2,24],{32:41,31:56,24:z,29:F}),e(k,[2,26]),e(k,[2,27]),{33:[1,57]},{11:59,30:u,34:58,39:24,40:f,41:27,42:R,43:C,44:y,45:E,46:v,47:L,48:M,49:b,50:D,51:c},e(k,[2,11]),e(k,[2,32],{35:60,29:X}),e(k,[2,34]),{33:[1,61]},e(k,[2,12]),{17:62,24:N},{25:63,27:64,29:S},e(k,[2,14]),{17:66,24:N},e(k,[2,16]),e(k,[2,17]),e(A,[2,43]),e(k,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},e(k,[2,33]),{29:[1,70]},e(k,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},e(O,[2,23],{30:[1,73]}),e(k,[2,15]),e(k,[2,28]),e(k,[2,29]),{11:59,30:u,34:74,39:24,40:f,41:27,42:R,43:C,44:y,45:E,46:v,47:L,48:M,49:b,50:D,51:c},e(k,[2,35]),e(k,[2,19]),{25:75,27:64,29:S},e(O,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:a(function(l,g){if(g.recoverable)this.trace(l);else{var d=new Error(l);throw d.hash=g,d}},"parseError"),parse:a(function(l){var g=this,d=[0],x=[],_=[null],r=[],lt=this.table,m="",dt=0,Ot=0,ui=2,Vt=1,di=r.slice.call(arguments,1),P=Object.create(this.lexer),$={yy:{}};for(var bt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,bt)&&($.yy[bt]=this.yy[bt]);P.setInput(l,$.yy),$.yy.lexer=P,$.yy.parser=this,typeof P.yylloc>"u"&&(P.yylloc={});var wt=P.yylloc;r.push(wt);var xi=P.options&&P.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function fi(B){d.length=d.length-2*B,_.length=_.length-B,r.length=r.length-B}a(fi,"popStack");function Ft(){var B;return B=x.pop()||P.lex()||Vt,typeof B!="number"&&(B instanceof Array&&(x=B,B=x.pop()),B=g.symbols_[B]||B),B}a(Ft,"lex");for(var I,U,V,At,j={},xt,Y,Wt,ft;;){if(U=d[d.length-1],this.defaultActions[U]?V=this.defaultActions[U]:((I===null||typeof I>"u")&&(I=Ft()),V=lt[U]&<[U][I]),typeof V>"u"||!V.length||!V[0]){var Ct="";ft=[];for(xt in lt[U])this.terminals_[xt]&&xt>ui&&ft.push("'"+this.terminals_[xt]+"'");P.showPosition?Ct="Parse error on line "+(dt+1)+`:
|
|
2
|
+
`+P.showPosition()+`
|
|
3
|
+
Expecting `+ft.join(", ")+", got '"+(this.terminals_[I]||I)+"'":Ct="Parse error on line "+(dt+1)+": Unexpected "+(I==Vt?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(Ct,{text:P.match,token:this.terminals_[I]||I,line:P.yylineno,loc:wt,expected:ft})}if(V[0]instanceof Array&&V.length>1)throw new Error("Parse Error: multiple actions possible at state: "+U+", token: "+I);switch(V[0]){case 1:d.push(I),_.push(P.yytext),r.push(P.yylloc),d.push(V[1]),I=null,Ot=P.yyleng,m=P.yytext,dt=P.yylineno,wt=P.yylloc;break;case 2:if(Y=this.productions_[V[1]][1],j.$=_[_.length-Y],j._$={first_line:r[r.length-(Y||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(Y||1)].first_column,last_column:r[r.length-1].last_column},xi&&(j._$.range=[r[r.length-(Y||1)].range[0],r[r.length-1].range[1]]),At=this.performAction.apply(j,[m,Ot,dt,$.yy,V[1],_,r].concat(di)),typeof At<"u")return At;Y&&(d=d.slice(0,-1*Y*2),_=_.slice(0,-1*Y),r=r.slice(0,-1*Y)),d.push(this.productions_[V[1]][0]),_.push(j.$),r.push(j._$),Wt=lt[d[d.length-2]][d[d.length-1]],d.push(Wt);break;case 3:return!0}}return!0},"parse")},ht=(function(){var W={EOF:1,parseError:a(function(g,d){if(this.yy.parser)this.yy.parser.parseError(g,d);else throw new Error(g)},"parseError"),setInput:a(function(l,g){return this.yy=g||this.yy||{},this._input=l,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:a(function(){var l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var g=l.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),l},"input"),unput:a(function(l){var g=l.length,d=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var x=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),d.length-1&&(this.yylineno-=d.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:d?(d.length===x.length?this.yylloc.first_column:0)+x[x.length-d.length].length-d[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:a(function(l){this.unput(this.match.slice(l))},"less"),pastInput:a(function(){var l=this.matched.substr(0,this.matched.length-this.match.length);return(l.length>20?"...":"")+l.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a(function(){var l=this.match;return l.length<20&&(l+=this._input.substr(0,20-l.length)),(l.substr(0,20)+(l.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a(function(){var l=this.pastInput(),g=new Array(l.length+1).join("-");return l+this.upcomingInput()+`
|
|
5
|
+
`+g+"^"},"showPosition"),test_match:a(function(l,g){var d,x,_;if(this.options.backtrack_lexer&&(_={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(_.yylloc.range=this.yylloc.range.slice(0))),x=l[0].match(/(?:\r\n?|\n).*/g),x&&(this.yylineno+=x.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:x?x[x.length-1].length-x[x.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+l[0].length},this.yytext+=l[0],this.match+=l[0],this.matches=l,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(l[0].length),this.matched+=l[0],d=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),d)return d;if(this._backtrack){for(var r in _)this[r]=_[r];return!1}return!1},"test_match"),next:a(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var l,g,d,x;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),r=0;r<_.length;r++)if(d=this._input.match(this.rules[_[r]]),d&&(!g||d[0].length>g[0].length)){if(g=d,x=r,this.options.backtrack_lexer){if(l=this.test_match(d,_[r]),l!==!1)return l;if(this._backtrack){g=!1;continue}else return!1}else if(!this.options.flex)break}return g?(l=this.test_match(g,_[x]),l!==!1?l:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:a(function(){var g=this.next();return g||this.lex()},"lex"),begin:a(function(g){this.conditionStack.push(g)},"begin"),popState:a(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:a(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:a(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:a(function(g){this.begin(g)},"pushState"),stateStackSize:a(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:a(function(g,d,x,_){switch(x){case 0:break;case 1:break;case 2:return this.popState(),36;case 3:return this.popState(),36;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 33;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 29;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return W})();T.lexer=ht;function q(){this.yy={}}return a(q,"Parser"),q.prototype=T,T.Parser=q,new q})();Rt.parser=Rt;var Li=Rt;function pt(e){return e.type==="bar"}a(pt,"isBarPlot");function mt(e){return e.type==="band"}a(mt,"isBandAxisData");function Q(e){return e.type==="linear"}a(Q,"isLinearAxisData");var K,Pt=(K=class{constructor(t){this.parentGroup=t}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((o,h)=>Math.max(h.length,o),0)*i,height:i};const s={width:0,height:0},n=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(const o of t){const h=Ti(n,1,o),p=h?h.width:o.length*i,u=h?h.height:i;s.width=Math.max(s.width,p),s.height=Math.max(s.height,u)}return n.remove(),s}},a(K,"TextDimensionCalculatorWithFont"),K),Yt=.7,Ht=.2,Z,qt=(Z=class{constructor(t,i,s,n){this.axisConfig=t,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}setRange(t){this.range=t,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){const t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(t=>t.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){Yt*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(Yt*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let i=t.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const s=this.getLabelDimension(),n=Ht*t.width;this.outerPadding=Math.min(s.width/2,n);let o=s.height;this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0&&(o=Math.max(o,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*s.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*s.height))),o+=this.axisConfig.labelPadding*2,this.labelTextHeight=s.height,o<=i&&(i-=o,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;this.titleTextHeight=s.height,n<=i&&(i-=n,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-i}calculateSpaceIfDrawnVertical(t){let i=t.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const s=this.getLabelDimension(),n=Ht*t.height;this.outerPadding=Math.min(s.height/2,n);const o=s.width+this.axisConfig.labelPadding*2;o<=i&&(i-=o,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;this.titleTextHeight=s.height,n<=i&&(i-=n,this.showTitle=!0)}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateOffsetByRotation(t){const i=this.normalizedLabelRotationInRad;return i===0?0:Math.sin(i)*this.getLabelDimension()[t]/2}getDrawableElementsForLeftAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${i},${this.getScaleValue(s)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(s)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForBottomAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForTopAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${this.getScaleValue(s)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(s)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},a(Z,"BaseAxis"),Z),J,Ei=(J=class extends qt{constructor(t,i,s,n,o){super(t,n,o,i),this.categories=s,this.scale=St().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=St().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),Ut.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},a(J,"BandAxis"),J),tt,Mi=(tt=class extends qt{constructor(t,i,s,n,o){super(t,n,o,i),this.domain=s,this.scale=Nt().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];this.axisPosition==="left"&&t.reverse(),this.scale=Nt().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}},a(tt,"LinearAxis"),tt);function _t(e,t,i,s){const n=new Pt(s);return mt(e)?new Ei(t,i,e.categories,e.title,n):new Mi(t,i,[e.min,e.max],e.title,n)}a(_t,"getAxis");var it,Ii=(it=class{constructor(t,i,s,n){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){const i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),s=Math.max(i.width,t.width),n=i.height+2*this.chartConfig.titlePadding;return i.width<=s&&i.height<=n&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=s,this.boundingRect.height=n,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const t=[];return this.showChartTitle&&t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),t}},a(it,"ChartTitle"),it);function jt(e,t,i,s){const n=new Pt(s);return new Ii(n,e,t,i)}a(jt,"getChartTitleComponent");var Bi=.75,zi=.5,Oi=.35;function kt(e){return{fontSize:e,markerSize:e*Bi,markerSpacing:e*Oi,itemSpacing:e*zi}}a(kt,"getLegendLayout");var et,Vi=(et=class{constructor(t,i,s,n){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.visiblePlots=[]}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){if(this.visiblePlots=this.chartConfig.showLegend?this.chartData.plots.filter(f=>f.title):[],this.visiblePlots.length===0)return this.boundingRect.width=0,this.boundingRect.height=0,{width:0,height:0};const{fontSize:i,markerSize:s,markerSpacing:n,itemSpacing:o}=kt(this.chartConfig.legendFontSize),h=this.textDimensionCalculator.getMaxDimension(this.visiblePlots.map(f=>f.title),i),p=this.chartConfig.legendPadding*2+s+n+h.width,u=this.chartConfig.legendPadding*2+this.visiblePlots.length*i+(this.visiblePlots.length-1)*o;return p<=t.width&&u<=t.height?(this.boundingRect.width=p,this.boundingRect.height=u):(this.visiblePlots=[],this.boundingRect.width=0,this.boundingRect.height=0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(this.visiblePlots.length===0)return[];const{fontSize:t,markerSize:i,markerSpacing:s,itemSpacing:n}=kt(this.chartConfig.legendFontSize),o=t+n,h=this.boundingRect.x+this.chartConfig.legendPadding,p=this.boundingRect.y+this.chartConfig.legendPadding,u=[],f=[];for(const[R,C]of this.visiblePlots.entries())if(pt(C))u.push({x:h,y:p+R*o,width:i,height:i,fill:C.fill,strokeFill:C.fill,strokeWidth:0});else{const y=p+R*o+i/2;f.push({path:`M ${h},${y} L ${h+i},${y}`,strokeFill:C.strokeFill,strokeWidth:C.strokeWidth})}return[{groupTexts:["legend","markers"],type:"rect",data:u},{groupTexts:["legend","markers"],type:"path",data:f},{groupTexts:["legend","label"],type:"text",data:this.visiblePlots.map((R,C)=>({text:R.title,x:h+i+s,y:p+C*o+i/2,fill:this.chartThemeConfig.legendTextColor,fontSize:t,rotation:0,verticalPos:"middle",horizontalPos:"left"}))}]}},a(et,"ChartLegend"),et);function Qt(e,t,i,s){const n=new Pt(s);return new Vi(n,e,t,i)}a(Qt,"getChartLegendComponent");var st,Fi=(st=class{constructor(t,i,s,n,o){this.plotData=t,this.xAxis=i,this.yAxis=s,this.orientation=n,this.plotIndex=o}getDrawableElement(){const t=this.plotData.data.map(n=>[this.xAxis.getScaleValue(n[0]),this.yAxis.getScaleValue(n[1])]);let i;if(this.orientation==="horizontal"?i=Xt().y(n=>n[0]).x(n=>n[1])(t):i=Xt().x(n=>n[0]).y(n=>n[1])(t),!i)return[];const s=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){const h=[];for(const[p,[u,f]]of t.entries()){const R=this.plotData.pointLabels[p];R&&(this.orientation==="horizontal"?h.push({x:f+10,y:u,text:R,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0}):h.push({x:u,y:f-10,text:R,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0}))}h.length>0&&s.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:h})}return s}},a(st,"LinePlot"),st),nt,Wi=(nt=class{constructor(t,i,s,n,o,h){this.barData=t,this.boundingRect=i,this.xAxis=s,this.yAxis=n,this.orientation=o,this.plotIndex=h}getDrawableElement(){const t=this.barData.data.map(o=>[this.xAxis.getScaleValue(o[0]),this.yAxis.getScaleValue(o[1])]),s=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),n=s/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(o=>({x:this.boundingRect.x,y:o[0]-n,height:s,width:o[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(o=>({x:o[0]-n,y:o[1],width:s,height:this.boundingRect.y+this.boundingRect.height-o[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},a(nt,"BarPlot"),nt),at,Xi=(at=class{constructor(t,i,s){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(t,i){this.xAxis=t,this.yAxis=i}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const t=[];for(const[i,s]of this.chartData.plots.entries())switch(s.type){case"line":{const n=new Fi(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...n.getDrawableElement())}break;case"bar":{const n=new Wi(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...n.getDrawableElement())}break}return t}},a(at,"BasePlot"),at);function Kt(e,t,i){return new Xi(e,t,i)}a(Kt,"getPlotComponent");var ot,Ni=(ot=class{constructor(t,i,s,n){this.chartConfig=t,this.chartData=i,this.componentStore={title:jt(t,i,s,n),plot:Kt(t,i,s),legend:Qt(t,i,s,n),xAxis:_t(i.xAxis,t.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},n),yAxis:_t(i.yAxis,t.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},n)}}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,o={width:0,height:0},h=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),p=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),u=this.componentStore.plot.calculateSpace({width:h,height:p});t-=u.width,i-=u.height,u=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),n=u.height,i-=u.height,this.componentStore.xAxis.setAxisPosition("bottom"),u=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=u.height,this.componentStore.yAxis.setAxisPosition("left"),u=this.componentStore.yAxis.calculateSpace({width:t,height:i}),s=u.width,t-=u.width,o=this.componentStore.legend.calculateSpace({width:t,height:p}),t-=o.width,t>0&&(h+=t,t=0),i>0&&(p+=i,i=0),this.componentStore.plot.calculateSpace({width:h,height:p}),this.componentStore.plot.setBoundingBoxXY({x:s,y:n}),this.componentStore.legend.setBoundingBoxXY({x:s+h,y:n+Math.max((p-o.height)/2,0)}),this.componentStore.xAxis.setRange([s,s+h]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:n+p}),this.componentStore.yAxis.setRange([n,n+p]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some(f=>pt(f))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,o=0,h={width:0,height:0},p=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),u=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),f=this.componentStore.plot.calculateSpace({width:p,height:u});t-=f.width,i-=f.height,f=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=f.height,i-=f.height,this.componentStore.xAxis.setAxisPosition("left"),f=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=f.width,n=f.width,this.componentStore.yAxis.setAxisPosition("top"),f=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=f.height,o=s+f.height,h=this.componentStore.legend.calculateSpace({width:t,height:u}),t-=h.width,t>0&&(p+=t,t=0),i>0&&(u+=i,i=0),this.componentStore.plot.calculateSpace({width:p,height:u}),this.componentStore.plot.setBoundingBoxXY({x:n,y:o}),this.componentStore.legend.setBoundingBoxXY({x:n+p,y:o+Math.max((u-h.height)/2,0)}),this.componentStore.yAxis.setRange([n,n+p]),this.componentStore.yAxis.setBoundingBoxXY({x:n,y:s}),this.componentStore.xAxis.setRange([o,o+u]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:o}),this.chartData.plots.some(R=>pt(R))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const i of Object.values(this.componentStore))t.push(...i.getDrawableElements());return t}},a(ot,"Orchestrator"),ot),rt,Yi=(rt=class{static build(t,i,s,n){return new Ni(t,i,s,n).getDrawableElement()}},a(rt,"XYChartBuilder"),rt),ct=0,Zt,gt=Et(),ut=Lt(),w=Mt(),Tt=ut.plotColorPalette.split(",").map(e=>e.trim()),yt=!1,vt=!1;function Lt(){const e=ki(),t=Dt();return Gt(e.xyChart,t.themeVariables.xyChart)}a(Lt,"getChartDefaultThemeConfig");function Et(){const e=Dt();return Gt(_i.xyChart,e.xyChart)}a(Et,"getChartDefaultConfig");function Mt(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}a(Mt,"getChartDefaultData");function G(e){const t=Dt();return Ri(e.trim(),t)}a(G,"textSanitizer");function Jt(e){Zt=e}a(Jt,"setTmpSVGG");function ti(e){e==="horizontal"?gt.chartOrientation="horizontal":gt.chartOrientation="vertical"}a(ti,"setOrientation");function ii(e){w.xAxis.title=G(e.text)}a(ii,"setXAxisTitle");function It(e,t){w.xAxis={type:"linear",title:w.xAxis.title,min:e,max:t},yt=!0}a(It,"setXAxisRangeData");function ei(e){w.xAxis={type:"band",title:w.xAxis.title,categories:e.map(t=>G(t.text))},yt=!0}a(ei,"setXAxisBand");function si(e){w.yAxis.title=G(e.text)}a(si,"setYAxisTitle");function ni(e,t){w.yAxis={type:"linear",title:w.yAxis.title,min:e,max:t},vt=!0}a(ni,"setYAxisRangeData");function ai(e){const t=Math.min(...e),i=Math.max(...e),s=Q(w.yAxis)?w.yAxis.min:1/0,n=Q(w.yAxis)?w.yAxis.max:-1/0;w.yAxis={type:"linear",title:w.yAxis.title,min:Math.min(s,t),max:Math.max(n,i)}}a(ai,"setYAxisRangeFromPlotData");function Bt(e){let t=[];if(e.length===0)return t;if(!yt){const i=Q(w.xAxis)?w.xAxis.min:1/0,s=Q(w.xAxis)?w.xAxis.max:-1/0;It(Math.min(i,1),Math.max(s,e.length))}if(mt(w.xAxis)&&e.length>w.xAxis.categories.length&&(e=e.slice(0,w.xAxis.categories.length)),vt||ai(e),mt(w.xAxis)&&(t=w.xAxis.categories.map((i,s)=>[i,e[s]])),Q(w.xAxis)){const i=w.xAxis.min,s=w.xAxis.max;if(e.length===1)t=[[`${i}`,e[0]]];else{const n=(s-i)/(e.length-1);t=e.map((o,h)=>[`${i+h*n}`,o])}}return t}a(Bt,"transformDataWithoutCategory");function zt(e){return Tt[e===0?0:e%Tt.length]}a(zt,"getPlotColorFromPalette");function oi(e,t){const i=t.map(h=>h.value),s=t.map(h=>h.label?G(h.label):""),n=Bt(i),o=s.some(h=>h!=="");w.plots.push({type:"line",title:G(e.text),strokeFill:zt(ct),strokeWidth:2,data:n,...o?{pointLabels:s}:{}}),ct++}a(oi,"setLineData");function ri(e,t){const i=t.map(n=>n.value),s=Bt(i);w.plots.push({type:"bar",title:G(e.text),fill:zt(ct),data:s}),ct++}a(ri,"setBarData");function hi(){if(w.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return w.title=$t(),Yi.build(gt,w,ut,Zt)}a(hi,"getDrawableElem");function li(){return ut}a(li,"getChartThemeConfig");function ci(){return gt}a(ci,"getChartConfig");function gi(){return w}a(gi,"getXYChartData");var Hi=a(function(){Si(),ct=0,gt=Et(),w=Mt(),ut=Lt(),Tt=ut.plotColorPalette.split(",").map(e=>e.trim()),yt=!1,vt=!1},"clear"),$i={getDrawableElem:hi,clear:Hi,setAccTitle:wi,getAccTitle:bi,setDiagramTitle:yi,getDiagramTitle:$t,getAccDescription:mi,setAccDescription:pi,setOrientation:ti,setXAxisTitle:ii,setXAxisRangeData:It,setXAxisBand:ei,setYAxisTitle:si,setYAxisRangeData:ni,setLineData:oi,setBarData:ri,setTmpSVGG:Jt,getChartThemeConfig:li,getChartConfig:ci,getXYChartData:gi},Ui=a((e,t,i,s)=>{const n=s.db,o=n.getChartThemeConfig(),h=n.getChartConfig(),p=n.getXYChartData().plots[0].data.map(b=>b[1]);function u(b){return b==="top"?"text-before-edge":"middle"}a(u,"getDominantBaseLine");function f(b){return b==="left"?"start":b==="right"?"end":"middle"}a(f,"getTextAnchor");function R(b){return`translate(${b.x}, ${b.y}) rotate(${b.rotation||0})`}a(R,"getTextTransformation"),Ut.debug(`Rendering xychart chart
|
|
7
|
+
`+e);const C=Ai(t),y=C.append("g").attr("class","main"),E=y.append("rect").attr("width",h.width).attr("height",h.height).attr("class","background");Ci(C,h.height,h.width,!0),C.attr("viewBox",`0 0 ${h.width} ${h.height}`),E.attr("fill",o.backgroundColor),n.setTmpSVGG(C.append("g").attr("class","mermaid-tmp-group"));const v=n.getDrawableElem(),L={};function M(b){let D=y,c="";for(const[z]of b.entries()){let F=y;z>0&&L[c]&&(F=L[c]),c+=b[z],D=L[c],D||(D=L[c]=F.append("g").attr("class",b[z]))}return D}a(M,"getGroup");for(const b of v){if(b.data.length===0)continue;const D=M(b.groupTexts);switch(b.type){case"rect":if(D.selectAll("rect").data(b.data).enter().append("rect").attr("x",c=>c.x).attr("y",c=>c.y).attr("width",c=>c.width).attr("height",c=>c.height).attr("fill",c=>c.fill).attr("stroke",c=>c.strokeFill).attr("stroke-width",c=>c.strokeWidth),h.showDataLabel){const c=h.showDataLabelOutsideBar;if(h.chartOrientation==="horizontal"){let z=function(S,O){const{data:T,label:ht}=S;return O*ht.length*F<=T.width-X};a(z,"fitsHorizontally");const F=.7,X=10,N=b.data.map((S,O)=>({data:S,label:p[O].toString()})).filter(S=>S.data.width>0&&S.data.height>0),k=N.map(S=>{const{data:O}=S;let T=O.height*.7;for(;!z(S,T)&&T>0;)T-=1;return T}),H=Math.floor(Math.min(...k)),A=a(S=>c?S.data.x+S.data.width+X:S.data.x+S.data.width-X,"determineLabelXPosition");D.selectAll("text").data(N).enter().append("text").attr("x",A).attr("y",S=>S.data.y+S.data.height/2).attr("text-anchor",c?"start":"end").attr("dominant-baseline","middle").attr("fill",o.dataLabelColor).attr("font-size",`${H}px`).text(S=>S.label)}else{let z=function(A,S,O){const{data:T,label:ht}=A,W=S*ht.length*.7,l=T.x+T.width/2,g=l-W/2,d=l+W/2,x=g>=T.x&&d<=T.x+T.width,_=T.y+O+S<=T.y+T.height;return x&&_};a(z,"fitsInBar");const F=10,X=b.data.map((A,S)=>({data:A,label:p[S].toString()})).filter(A=>A.data.width>0&&A.data.height>0),N=X.map(A=>{const{data:S,label:O}=A;let T=S.width/(O.length*.7);for(;!z(A,T,F)&&T>0;)T-=1;return T}),k=Math.floor(Math.min(...N)),H=a(A=>c?A.data.y-F:A.data.y+F,"determineLabelYPosition");D.selectAll("text").data(X).enter().append("text").attr("x",A=>A.data.x+A.data.width/2).attr("y",H).attr("text-anchor","middle").attr("dominant-baseline",c?"auto":"hanging").attr("fill",o.dataLabelColor).attr("font-size",`${k}px`).text(A=>A.label)}}break;case"text":D.selectAll("text").data(b.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",c=>c.fill).attr("font-size",c=>c.fontSize).attr("dominant-baseline",c=>u(c.verticalPos)).attr("text-anchor",c=>f(c.horizontalPos)).attr("transform",c=>R(c)).text(c=>c.text);break;case"path":D.selectAll("path").data(b.data).enter().append("path").attr("d",c=>c.path).attr("fill",c=>c.fill?c.fill:"none").attr("stroke",c=>c.strokeFill).attr("stroke-width",c=>c.strokeWidth);break}}},"draw"),Gi={draw:Ui},te={parser:Li,db:$i,renderer:Gi};export{te as diagram};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/client/dist/index.html
CHANGED
|
@@ -17,9 +17,18 @@
|
|
|
17
17
|
breaks this local-first tool offline and makes A00's container-generated
|
|
18
18
|
visual baselines permanently unstable (fallback in the container, real
|
|
19
19
|
face on the dev box). AC4 asserts ZERO CDN font requests on load. -->
|
|
20
|
+
<!-- Ship's-wheel icon set. iOS ignores <link rel="icon"> for "Add to Home
|
|
21
|
+
Screen" and wants an OPAQUE apple-touch-icon (transparent pixels render
|
|
22
|
+
black); the web manifest covers Android/desktop install. -->
|
|
23
|
+
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32.png" />
|
|
24
|
+
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16.png" />
|
|
25
|
+
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
|
|
26
|
+
<link rel="manifest" href="/manifest.json" />
|
|
27
|
+
<meta name="theme-color" content="#292522" />
|
|
28
|
+
<meta name="apple-mobile-web-app-title" content="Shipwright" />
|
|
20
29
|
<title>Shipwright Command Center</title>
|
|
21
|
-
<script type="module" crossorigin src="/assets/index-
|
|
22
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
30
|
+
<script type="module" crossorigin src="/assets/index-DwRlIUrK.js"></script>
|
|
31
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DWrPE3aq.css">
|
|
23
32
|
</head>
|
|
24
33
|
<body>
|
|
25
34
|
<div id="root"></div>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "Shipwright Command Center",
|
|
3
|
+
"short_name": "Shipwright",
|
|
4
|
+
"start_url": "/",
|
|
5
|
+
"display": "standalone",
|
|
6
|
+
"background_color": "#292522",
|
|
7
|
+
"theme_color": "#292522",
|
|
8
|
+
"icons": [
|
|
9
|
+
{ "src": "/icon-192.png", "sizes": "192x192", "type": "image/png" },
|
|
10
|
+
{ "src": "/icon-512.png", "sizes": "512x512", "type": "image/png" },
|
|
11
|
+
{ "src": "/icon-maskable-512.png", "sizes": "512x512", "type": "image/png", "purpose": "maskable" }
|
|
12
|
+
]
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@svenroth-ai/shipwright",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.1",
|
|
4
4
|
"description": "One command to install AND update Shipwright — the /shipwright-* SDLC plugins and the Command Center. Run `npx @svenroth-ai/shipwright@latest`.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"oxlint": "^1.66.0",
|
|
62
62
|
"typescript": "^5.7.0",
|
|
63
|
-
"vitest": "^4.1.
|
|
63
|
+
"vitest": "^4.1.12"
|
|
64
64
|
},
|
|
65
65
|
"overrides": {
|
|
66
66
|
"ws": "^8.21.0"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,6EAA6E;IAC7E,oBAAoB,EAAE,MAAM,CAAC;IAC7B,yGAAyG;IACzG,qBAAqB,E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,4BAA4B,EAAE,MAAM,CAAC;IACrC;;;;;;;;;;;;OAYG;IACH,sBAAsB,EAAE,OAAO,CAAC;IAChC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,iBAAiB,EAAE,OAAO,CAAC;IAC3B;;;;;OAKG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC;;;;;;;OAOG;IACH,sBAAsB,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5C;AAqBD,wBAAgB,SAAS,IAAI,YAAY,CA0ExC"}
|
package/server/dist/config.js
CHANGED
|
@@ -16,11 +16,16 @@ function clampNonNegativeInt(raw, fallback) {
|
|
|
16
16
|
const n = parseInt(raw, 10);
|
|
17
17
|
return Number.isFinite(n) && n >= 0 ? n : fallback;
|
|
18
18
|
}
|
|
19
|
+
/** `SHIPWRIGHT_DATA_DIR` (made absolute) or `~/.shipwright-webui`. */
|
|
20
|
+
function dataRoot() {
|
|
21
|
+
const o = process.env.SHIPWRIGHT_DATA_DIR;
|
|
22
|
+
return o ? path.resolve(o) : path.join(os.homedir(), ".shipwright-webui");
|
|
23
|
+
}
|
|
19
24
|
export function getConfig() {
|
|
20
25
|
return {
|
|
21
26
|
port: parseInt(process.env.PORT ?? "3847", 10),
|
|
22
27
|
maxConcurrent: parseInt(process.env.SHIPWRIGHT_MAX_CONCURRENT ?? "3", 10),
|
|
23
|
-
registryDir:
|
|
28
|
+
registryDir: dataRoot(),
|
|
24
29
|
heartbeatIntervalMs: 30_000,
|
|
25
30
|
// SHIPWRIGHT_STATIC_DIR — test-only seam so spa-fallback.test.ts can
|
|
26
31
|
// point at a fixture instead of requiring a real `client/dist` build.
|
|
@@ -37,7 +42,7 @@ export function getConfig() {
|
|
|
37
42
|
? process.env.SHIPWRIGHT_PTY_SHELL_OVERRIDE
|
|
38
43
|
: undefined,
|
|
39
44
|
terminalScrollbackDir: process.env.SHIPWRIGHT_TERMINAL_SCROLLBACK_DIR ??
|
|
40
|
-
path.join(
|
|
45
|
+
path.join(dataRoot(), "terminal-scrollback"),
|
|
41
46
|
terminalScrollbackMaxBytes: clampNonNegativeInt(process.env.SHIPWRIGHT_TERMINAL_SCROLLBACK_MAX_BYTES, 1_048_576),
|
|
42
47
|
terminalScrollbackTtlDays: clampPositiveInt(process.env.SHIPWRIGHT_TERMINAL_SCROLLBACK_TTL_DAYS, 1),
|
|
43
48
|
terminalSweepMaxFilesPerPass: clampPositiveInt(process.env.SHIPWRIGHT_TERMINAL_SWEEP_MAX_FILES_PER_PASS, 100),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AA0GtC,SAAS,gBAAgB,CAAC,GAAuB,EAAE,QAAgB;IACjE,IAAI,CAAC,GAAG;QAAE,OAAO,QAAQ,CAAC;IAC1B,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC5B,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;AACpD,CAAC;AAED,2EAA2E;AAC3E,SAAS,mBAAmB,CAAC,GAAuB,EAAE,QAAgB;IACpE,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,EAAE;QAAE,OAAO,QAAQ,CAAC;IACrD,MAAM,CAAC,GAAG,QAAQ,CAAC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
+
tests?: string | null;
|
|
5
|
+
ci?: string | null;
|
|
6
|
+
conventions?: string | null;
|
|
7
|
+
commands?: string[] | null;
|
|
8
|
+
}
|
|
9
|
+
export declare const CONTROL: RegExp;
|
|
10
|
+
/** Findings of a snapshot; `{}` for anything that is not an object. */
|
|
11
|
+
export declare function extractFindings(raw: unknown): AdoptScanFindings;
|
|
12
|
+
//# sourceMappingURL=adopt-scan-findings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adopt-scan-findings.d.ts","sourceRoot":"","sources":["../../src/core/adopt-scan-findings.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;CAC5B;AAOD,eAAO,MAAM,OAAO,QAA6K,CAAC;AA8DlM,uEAAuE;AACvE,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,iBAAiB,CAW/D"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* adopt-scan-findings.ts - the live rows of the Adopt result screen, read from the
|
|
3
|
+
* analyzer snapshot of an UNTRUSTED repo (`analyze_codebase.py`, schema 1.x).
|
|
4
|
+
*
|
|
5
|
+
* Every value is short, typed and cleaned, and one malformed key nulls only itself:
|
|
6
|
+
* `undefined` (key omitted) = the snapshot does not report it (a 1.0 snapshot, or an
|
|
7
|
+
* analyzer without that detector); `null` = reported, nothing found. Commands are
|
|
8
|
+
* exposed as NAMES only (dev, build, ...), never as command text - the screen sits
|
|
9
|
+
* next to an "Adopt this repo" button, and repo-authored command text on a
|
|
10
|
+
* trusted-looking screen is exactly what a hostile repo would want to place there.
|
|
11
|
+
* The values are shown as plain text by the client and are never logged.
|
|
12
|
+
*/
|
|
13
|
+
const MAX_TEXT = 120;
|
|
14
|
+
const MAX_ITEMS = 8;
|
|
15
|
+
const COMMAND_NAMES = ["dev", "build", "test", "lint"];
|
|
16
|
+
const TEST_KINDS = ["unit", "integration", "e2e", "db", "coverage_tool"];
|
|
17
|
+
// eslint-disable-next-line no-control-regex
|
|
18
|
+
export const CONTROL = /[\u0000-\u001f\u007f-\u009f\u200b-\u200f\u2028-\u202e\u2066-\u2069\u061c\u00ad\u2060-\u2064\ufeff\u3164\u115f\u1160\u2800\u034f\u180e\ufe00-\ufe0f\u{e0000}-\u{e007f}]/gu;
|
|
19
|
+
function isObject(v) {
|
|
20
|
+
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
21
|
+
}
|
|
22
|
+
/** Cleaned, single-spaced, capped; "" when nothing readable is left. */
|
|
23
|
+
function clean(v, max = MAX_TEXT) {
|
|
24
|
+
const text = typeof v === "string" ? v.replace(CONTROL, " ").replace(/\s+/g, " ").trim() : "";
|
|
25
|
+
return [...text].slice(0, max).join("");
|
|
26
|
+
}
|
|
27
|
+
function joined(parts) {
|
|
28
|
+
const text = [...parts.filter(Boolean).slice(0, MAX_ITEMS).join(" · ")].slice(0, MAX_TEXT).join("").trim();
|
|
29
|
+
return text || null;
|
|
30
|
+
}
|
|
31
|
+
function count(v) {
|
|
32
|
+
return Array.isArray(v) && Number.isSafeInteger(v.length) ? v.length : null;
|
|
33
|
+
}
|
|
34
|
+
/** "React@^19.0.0" -> "React" (names of detected technologies, version stripped). */
|
|
35
|
+
function techNames(group) {
|
|
36
|
+
if (!isObject(group))
|
|
37
|
+
return [];
|
|
38
|
+
return Object.values(group).map((v) => clean(typeof v === "string" ? v.split("@")[0] : "", 60)).filter(Boolean);
|
|
39
|
+
}
|
|
40
|
+
function stack(v) {
|
|
41
|
+
if (!isObject(v))
|
|
42
|
+
return null;
|
|
43
|
+
const names = [clean(v.primary_language, 40), ...["frontend", "backend", "database", "auth"].flatMap((k) => techNames(v[k]))];
|
|
44
|
+
return joined([...new Set(names)]);
|
|
45
|
+
}
|
|
46
|
+
function tests(v) {
|
|
47
|
+
if (!isObject(v))
|
|
48
|
+
return null;
|
|
49
|
+
const parts = TEST_KINDS.flatMap((kind) => {
|
|
50
|
+
const raw = v[kind];
|
|
51
|
+
const names = (Array.isArray(raw) ? raw : [raw]).map((n) => clean(n, 40)).filter(Boolean);
|
|
52
|
+
return names.length > 0 ? [`${kind}: ${names.join(", ")}`] : [];
|
|
53
|
+
});
|
|
54
|
+
return joined(parts);
|
|
55
|
+
}
|
|
56
|
+
function ci(v) {
|
|
57
|
+
if (!isObject(v))
|
|
58
|
+
return null;
|
|
59
|
+
const provider = clean(v.provider, 40);
|
|
60
|
+
if (!provider)
|
|
61
|
+
return null;
|
|
62
|
+
const n = count(v.workflows);
|
|
63
|
+
return n ? `${provider} · ${n} workflow${n === 1 ? "" : "s"}` : provider;
|
|
64
|
+
}
|
|
65
|
+
function conventions(v) {
|
|
66
|
+
if (!isObject(v))
|
|
67
|
+
return null;
|
|
68
|
+
return joined([clean(v.linter, 40), clean(v.formatter, 40), v.tsconfig_strict === true ? "strict TypeScript" : ""]);
|
|
69
|
+
}
|
|
70
|
+
function commands(v) {
|
|
71
|
+
if (!isObject(v))
|
|
72
|
+
return null;
|
|
73
|
+
const found = COMMAND_NAMES.filter((name) => clean(v[name], 200) !== "");
|
|
74
|
+
return found.length > 0 ? [...found] : null;
|
|
75
|
+
}
|
|
76
|
+
/** Findings of a snapshot; `{}` for anything that is not an object. */
|
|
77
|
+
export function extractFindings(raw) {
|
|
78
|
+
if (!isObject(raw))
|
|
79
|
+
return {};
|
|
80
|
+
const out = {};
|
|
81
|
+
const has = (key) => Object.prototype.hasOwnProperty.call(raw, key);
|
|
82
|
+
if (has("stack"))
|
|
83
|
+
out.stack = stack(raw.stack);
|
|
84
|
+
if (has("features"))
|
|
85
|
+
out.routes = count(raw.features);
|
|
86
|
+
if (has("test_frameworks"))
|
|
87
|
+
out.tests = tests(raw.test_frameworks);
|
|
88
|
+
if (has("ci_pipeline"))
|
|
89
|
+
out.ci = ci(raw.ci_pipeline);
|
|
90
|
+
if (has("conventions"))
|
|
91
|
+
out.conventions = conventions(raw.conventions);
|
|
92
|
+
if (has("commands"))
|
|
93
|
+
out.commands = commands(raw.commands);
|
|
94
|
+
return out;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=adopt-scan-findings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adopt-scan-findings.js","sourceRoot":"","sources":["../../src/core/adopt-scan-findings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAWH,MAAM,QAAQ,GAAG,GAAG,CAAC;AACrB,MAAM,SAAS,GAAG,CAAC,CAAC;AACpB,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAU,CAAC;AAChE,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,IAAI,EAAE,eAAe,CAAU,CAAC;AAClF,4CAA4C;AAC5C,MAAM,CAAC,MAAM,OAAO,GAAG,0KAA0K,CAAC;AAElM,SAAS,QAAQ,CAAC,CAAU;IAC1B,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAClE,CAAC;AAED,wEAAwE;AACxE,SAAS,KAAK,CAAC,CAAU,EAAE,GAAG,GAAG,QAAQ;IACvC,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,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AC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC5E,IAAI,GAAG,CAAC,OAAO,CAAC;QAAE,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC/C,IAAI,GAAG,CAAC,UAAU,CAAC;QAAE,GAAG,CAAC,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACtD,IAAI,GAAG,CAAC,iBAAiB,CAAC;QAAE,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACnE,IAAI,GAAG,CAAC,aAAa,CAAC;QAAE,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACrD,IAAI,GAAG,CAAC,aAAa,CAAC;QAAE,GAAG,CAAC,WAAW,GAAG,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACvE,IAAI,GAAG,CAAC,UAAU,CAAC;QAAE,GAAG,CAAC,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC3D,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type AdoptScanFindings } from "./adopt-scan-findings.js";
|
|
2
|
+
import { type CliChildSpawnFn } from "./cli-child-spawn.js";
|
|
3
|
+
import { type RunFn } from "./readiness-probe.js";
|
|
4
|
+
export declare const ADOPT_SCAN_TIMEOUT_MS = 45000;
|
|
5
|
+
export declare const SUPPORTED_SNAPSHOT_MAJOR = 1;
|
|
6
|
+
export interface AdoptScanProfile {
|
|
7
|
+
matched: string | null;
|
|
8
|
+
confidence: number | null;
|
|
9
|
+
source: string | null;
|
|
10
|
+
warnings: string[];
|
|
11
|
+
}
|
|
12
|
+
export type AdoptScanOutcome = {
|
|
13
|
+
status: "ok";
|
|
14
|
+
profile: AdoptScanProfile;
|
|
15
|
+
findings: AdoptScanFindings;
|
|
16
|
+
} | {
|
|
17
|
+
status: "invalid-path";
|
|
18
|
+
reason: string;
|
|
19
|
+
} | {
|
|
20
|
+
status: "busy";
|
|
21
|
+
reason: string;
|
|
22
|
+
} | {
|
|
23
|
+
status: "unsupported-schema";
|
|
24
|
+
version: string;
|
|
25
|
+
} | {
|
|
26
|
+
status: "engine-unavailable";
|
|
27
|
+
reason: string;
|
|
28
|
+
repairCommand: string;
|
|
29
|
+
} | {
|
|
30
|
+
status: "failed";
|
|
31
|
+
reason: string;
|
|
32
|
+
};
|
|
33
|
+
export interface AdoptScanDeps {
|
|
34
|
+
run?: RunFn;
|
|
35
|
+
spawn?: CliChildSpawnFn;
|
|
36
|
+
homeDir?: string;
|
|
37
|
+
baseEnv?: NodeJS.ProcessEnv;
|
|
38
|
+
timeoutMs?: number;
|
|
39
|
+
scriptOverride?: string;
|
|
40
|
+
tmpRoot?: string;
|
|
41
|
+
}
|
|
42
|
+
/** Newest installed `shipwright-adopt/<version>/scripts/tools/analyze_codebase.py`. */
|
|
43
|
+
export declare function resolveAnalyzerScript(deps?: Pick<AdoptScanDeps, "homeDir" | "scriptOverride">): string | null;
|
|
44
|
+
/** Tolerant reader (snapshot 1.0 lacks source/warnings); unknown major refused. */
|
|
45
|
+
export declare function extractProfile(raw: unknown): AdoptScanOutcome;
|
|
46
|
+
export declare function scanRepoProfile(input: {
|
|
47
|
+
path: unknown;
|
|
48
|
+
}, deps?: AdoptScanDeps): Promise<AdoptScanOutcome>;
|
|
49
|
+
//# sourceMappingURL=adopt-scan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adopt-scan.d.ts","sourceRoot":"","sources":["../../src/core/adopt-scan.ts"],"names":[],"mappings":"AAqBA,OAAO,EAA4B,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC5F,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAA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AI,CAAC,aAAa,EAAE,SAAS,GAAG,gBAAgB,CAAM,GAAG,MAAM,GAAG,IAAI,CAwBjH;AAMD,mFAAmF;AACnF,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,gBAAgB,CA0B7D;AAkBD,wBAAsB,eAAe,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,EAAE,IAAI,GAAE,aAAkB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA6BnH"}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* adopt-scan.ts — a READ-ONLY look at a local repo for the Adopt screen: runs the
|
|
3
|
+
* shipwright adopt analyzer (`analyze_codebase.py`, Layer-1 detectors) and returns
|
|
4
|
+
* ONLY the detected stack-profile block (match, source, discovery warnings) plus a
|
|
5
|
+
* few short, cleaned findings rows (`adopt-scan-findings.ts`) - never the snapshot.
|
|
6
|
+
*
|
|
7
|
+
* "Nothing has been written yet" must stay true, so the analyzer is always given
|
|
8
|
+
* `--output` pointing at a private temp dir (without it the analyzer writes
|
|
9
|
+
* `<repo>/.shipwright/adopt/snapshot.json`); the temp dir is removed in `finally`.
|
|
10
|
+
* The path is untrusted: absolute, an existing directory, realpath'd, never a
|
|
11
|
+
* filesystem root or the home folder. One scan at a time (a stalled/huge repo
|
|
12
|
+
* cannot pile up processes); the analyzer is discovered from the newest installed
|
|
13
|
+
* `shipwright-adopt` (no hardcoded version). Spawn discipline mirrors
|
|
14
|
+
* `stack-profiles.ts`: `uv run --no-project`, shell:false, fixed argv, honest
|
|
15
|
+
* engine-unavailable, whole-tree kill on timeout (cli-child-spawn).
|
|
16
|
+
*/
|
|
17
|
+
import { closeSync, existsSync, fstatSync, mkdtempSync, openSync, readdirSync, readFileSync, realpathSync, rmSync, statSync } from "node:fs";
|
|
18
|
+
import os from "node:os";
|
|
19
|
+
import path from "node:path";
|
|
20
|
+
import { CONTROL, extractFindings } from "./adopt-scan-findings.js";
|
|
21
|
+
import { defaultCliChildSpawn } from "./cli-child-spawn.js";
|
|
22
|
+
import { READINESS_REPAIR_COMMAND, shipwrightCacheRoot } from "./readiness-probe.js";
|
|
23
|
+
import { resolveUv } from "./uv-runner.js";
|
|
24
|
+
export const ADOPT_SCAN_TIMEOUT_MS = 45_000;
|
|
25
|
+
export const SUPPORTED_SNAPSHOT_MAJOR = 1;
|
|
26
|
+
const MAX_SNAPSHOT_BYTES = 8 * 1024 * 1024;
|
|
27
|
+
const MAX_WARNINGS = 20;
|
|
28
|
+
const MAX_WARNING_CHARS = 300;
|
|
29
|
+
/** Newest installed `shipwright-adopt/<version>/scripts/tools/analyze_codebase.py`. */
|
|
30
|
+
export function resolveAnalyzerScript(deps = {}) {
|
|
31
|
+
const override = deps.scriptOverride ?? process.env.SHIPWRIGHT_ANALYZE_CODEBASE_SCRIPT;
|
|
32
|
+
if (override)
|
|
33
|
+
return existsSync(override) ? override : null;
|
|
34
|
+
const base = path.join(shipwrightCacheRoot(deps.homeDir ?? os.homedir()), "shipwright-adopt");
|
|
35
|
+
let versions;
|
|
36
|
+
try {
|
|
37
|
+
versions = readdirSync(base);
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
const parse = (v) => v.split(".").map((n) => Number.parseInt(n, 10) || 0);
|
|
43
|
+
versions.sort((a, b) => {
|
|
44
|
+
const [pa, pb] = [parse(a), parse(b)];
|
|
45
|
+
for (let i = 0; i < Math.max(pa.length, pb.length); i++) {
|
|
46
|
+
const d = (pb[i] ?? 0) - (pa[i] ?? 0);
|
|
47
|
+
if (d !== 0)
|
|
48
|
+
return d;
|
|
49
|
+
}
|
|
50
|
+
return 0;
|
|
51
|
+
});
|
|
52
|
+
for (const v of versions) {
|
|
53
|
+
const candidate = path.join(base, v, "scripts", "tools", "analyze_codebase.py");
|
|
54
|
+
if (existsSync(candidate))
|
|
55
|
+
return candidate;
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
function isObject(v) {
|
|
60
|
+
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
61
|
+
}
|
|
62
|
+
/** Tolerant reader (snapshot 1.0 lacks source/warnings); unknown major refused. */
|
|
63
|
+
export function extractProfile(raw) {
|
|
64
|
+
if (!isObject(raw))
|
|
65
|
+
return { status: "failed", reason: "The scan returned something unreadable." };
|
|
66
|
+
if (raw.schema_version !== undefined) {
|
|
67
|
+
const major = Number.parseInt(String(raw.schema_version).split(".")[0] ?? "", 10);
|
|
68
|
+
if (!Number.isFinite(major) || major < 1 || major > SUPPORTED_SNAPSHOT_MAJOR) {
|
|
69
|
+
return { status: "unsupported-schema", version: String(raw.schema_version).slice(0, 20) };
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
const p = raw.profile;
|
|
73
|
+
if (!isObject(p))
|
|
74
|
+
return { status: "failed", reason: "The scan has no profile block." };
|
|
75
|
+
const warnings = Array.isArray(p.warnings)
|
|
76
|
+
? p.warnings
|
|
77
|
+
.filter((w) => typeof w === "string")
|
|
78
|
+
.slice(0, MAX_WARNINGS)
|
|
79
|
+
.map((w) => w.replace(CONTROL, " ").slice(0, MAX_WARNING_CHARS))
|
|
80
|
+
: [];
|
|
81
|
+
return {
|
|
82
|
+
status: "ok",
|
|
83
|
+
findings: extractFindings(raw),
|
|
84
|
+
profile: {
|
|
85
|
+
matched: typeof p.matched === "string" ? p.matched.replace(CONTROL, " ").slice(0, 120) : null,
|
|
86
|
+
confidence: typeof p.confidence === "number" && Number.isFinite(p.confidence) ? p.confidence : null,
|
|
87
|
+
source: typeof p.source === "string" ? p.source.replace(CONTROL, " ").slice(0, 40) : null,
|
|
88
|
+
warnings,
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
function refuseRoot(real, home) {
|
|
93
|
+
const parsed = path.parse(real);
|
|
94
|
+
if (real === parsed.root)
|
|
95
|
+
return "That is a drive root, not a project folder.";
|
|
96
|
+
const norm = (x) => (process.platform === "win32" ? x.toLowerCase() : x);
|
|
97
|
+
let realHome = path.resolve(home);
|
|
98
|
+
try {
|
|
99
|
+
realHome = realpathSync(home);
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
// keep the resolved path
|
|
103
|
+
}
|
|
104
|
+
if (norm(real) === norm(realHome) || norm(real) === norm(path.resolve(home)))
|
|
105
|
+
return "That is your home folder, not a project folder.";
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
let busy = false;
|
|
109
|
+
export async function scanRepoProfile(input, deps = {}) {
|
|
110
|
+
const raw = input.path;
|
|
111
|
+
if (typeof raw !== "string" || raw.length === 0 || raw.length > 1024 || raw.includes("\0") || /^[\\/]{2}/.test(raw) || !path.isAbsolute(raw)) {
|
|
112
|
+
return { status: "invalid-path", reason: "Pick a folder on this computer." };
|
|
113
|
+
}
|
|
114
|
+
let real;
|
|
115
|
+
try {
|
|
116
|
+
real = realpathSync(raw);
|
|
117
|
+
if (!statSync(real).isDirectory())
|
|
118
|
+
return { status: "invalid-path", reason: "That is a file, not a folder." };
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
return { status: "invalid-path", reason: "That folder doesn't exist." };
|
|
122
|
+
}
|
|
123
|
+
const rootProblem = refuseRoot(real, deps.homeDir ?? os.homedir());
|
|
124
|
+
if (rootProblem)
|
|
125
|
+
return { status: "invalid-path", reason: rootProblem };
|
|
126
|
+
const unavailable = (reason) => ({
|
|
127
|
+
status: "engine-unavailable",
|
|
128
|
+
reason,
|
|
129
|
+
repairCommand: READINESS_REPAIR_COMMAND,
|
|
130
|
+
});
|
|
131
|
+
// The lock is taken BEFORE any process is started, so concurrent POSTs cannot each
|
|
132
|
+
// spawn a `uv --version`; it is released in the finally below on every path.
|
|
133
|
+
if (busy)
|
|
134
|
+
return { status: "busy", reason: "Another scan is still running." };
|
|
135
|
+
busy = true;
|
|
136
|
+
try {
|
|
137
|
+
return await scanLocked(real, deps, unavailable);
|
|
138
|
+
}
|
|
139
|
+
finally {
|
|
140
|
+
busy = false;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
async function scanLocked(real, deps, unavailable) {
|
|
144
|
+
const script = resolveAnalyzerScript(deps);
|
|
145
|
+
if (!script)
|
|
146
|
+
return unavailable("The Shipwright adopt tool isn't installed.");
|
|
147
|
+
const uv = await resolveUv({ run: deps.run, homeDir: deps.homeDir, baseEnv: deps.baseEnv });
|
|
148
|
+
if (!uv)
|
|
149
|
+
return unavailable("uv isn't installed — the scan needs it to run in a managed Python 3.11+.");
|
|
150
|
+
let out;
|
|
151
|
+
try {
|
|
152
|
+
out = mkdtempSync(path.join(deps.tmpRoot ?? os.tmpdir(), "sw-adopt-scan-"));
|
|
153
|
+
// the snapshot must never be written into the repo being looked at
|
|
154
|
+
const rel = path.relative(real, realpathSync(out));
|
|
155
|
+
if (rel === "" || (rel !== ".." && !rel.startsWith(".." + path.sep) && !path.isAbsolute(rel))) {
|
|
156
|
+
return { status: "failed", reason: "The scan needs a temporary folder outside the project." };
|
|
157
|
+
}
|
|
158
|
+
const file = path.join(out, "snapshot.json");
|
|
159
|
+
const spawn = deps.spawn ?? defaultCliChildSpawn;
|
|
160
|
+
const result = await spawn(uv.bin, ["run", "--no-project", "--python", ">=3.11", script, "--project-root", real, "--output", file], { timeoutMs: deps.timeoutMs ?? ADOPT_SCAN_TIMEOUT_MS, env: uv.env });
|
|
161
|
+
if (result.code === -1)
|
|
162
|
+
return unavailable("uv couldn't start on this machine.");
|
|
163
|
+
if (result.spawnError === "timeout")
|
|
164
|
+
return { status: "failed", reason: "The scan took too long and was stopped." };
|
|
165
|
+
if (result.code !== 0) {
|
|
166
|
+
const line = result.stderr.split(/\r?\n/).map((l) => l.trim()).filter(Boolean).pop() ?? "";
|
|
167
|
+
return { status: "failed", reason: line.replace(CONTROL, " ").slice(0, 200) || "The scan failed." };
|
|
168
|
+
}
|
|
169
|
+
let parsed;
|
|
170
|
+
try {
|
|
171
|
+
// size check and read share one descriptor - no check-then-act window
|
|
172
|
+
const fd = openSync(file, "r");
|
|
173
|
+
try {
|
|
174
|
+
if (fstatSync(fd).size > MAX_SNAPSHOT_BYTES)
|
|
175
|
+
return { status: "failed", reason: "The scan result was too large." };
|
|
176
|
+
parsed = JSON.parse(readFileSync(fd, "utf-8"));
|
|
177
|
+
}
|
|
178
|
+
finally {
|
|
179
|
+
closeSync(fd);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
catch {
|
|
183
|
+
return { status: "failed", reason: "The scan returned something unreadable." };
|
|
184
|
+
}
|
|
185
|
+
return extractProfile(parsed);
|
|
186
|
+
}
|
|
187
|
+
catch {
|
|
188
|
+
return { status: "failed", reason: "The scan could not be run." };
|
|
189
|
+
}
|
|
190
|
+
finally {
|
|
191
|
+
if (out) {
|
|
192
|
+
try {
|
|
193
|
+
rmSync(out, { recursive: true, force: true });
|
|
194
|
+
}
|
|
195
|
+
catch {
|
|
196
|
+
// best-effort: a stray temp dir holds a snapshot only, never repo content
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
//# sourceMappingURL=adopt-scan.js.map
|