@maycombhq/atticus 0.0.0-stage → 2.0.0-beta.2
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/LICENSE +177 -0
- package/README.md +17 -2
- package/THIRD-PARTY-LICENSES.txt +2607 -0
- package/dist/bin.js +47 -0
- package/dist/chunk-23W7VWKR.js +2609 -0
- package/dist/chunk-27NKUS3X.js +4330 -0
- package/dist/chunk-2ANOROX3.js +2522 -0
- package/dist/chunk-2BF2EYJV.js +174 -0
- package/dist/chunk-2BFCZ3RK.js +315 -0
- package/dist/chunk-2DIQQJCB.js +378 -0
- package/dist/chunk-2RMYG36Q.js +1227 -0
- package/dist/chunk-2VHF7OXM.js +55 -0
- package/dist/chunk-3ALD2W2A.js +95 -0
- package/dist/chunk-3C7EYRFZ.js +41 -0
- package/dist/chunk-3G4YI4ZU.js +16 -0
- package/dist/chunk-3HI6Z55Y.js +5949 -0
- package/dist/chunk-3USYZGRF.js +324 -0
- package/dist/chunk-42EVSKME.js +37 -0
- package/dist/chunk-4AK7IBVP.js +915 -0
- package/dist/chunk-4BKGMUIK.js +53 -0
- package/dist/chunk-4BN53TG3.js +343 -0
- package/dist/chunk-4NDAAFQT.js +103 -0
- package/dist/chunk-4Q3NN7VF.js +32 -0
- package/dist/chunk-4RS5KZQD.js +25 -0
- package/dist/chunk-4SKZDI62.js +22 -0
- package/dist/chunk-4WBVUHXN.js +69 -0
- package/dist/chunk-5GDRCDQB.js +32 -0
- package/dist/chunk-5GGOLAKC.js +856 -0
- package/dist/chunk-5KLGBXG5.js +48 -0
- package/dist/chunk-5WG5YP4T.js +34 -0
- package/dist/chunk-64EQYWCA.js +180 -0
- package/dist/chunk-652QWTLZ.js +242 -0
- package/dist/chunk-65NYPGRC.js +766 -0
- package/dist/chunk-66YVAGGM.js +46 -0
- package/dist/chunk-6BNC6EQ4.js +41 -0
- package/dist/chunk-6BVONWJ7.js +50 -0
- package/dist/chunk-6D2CQ5II.js +41 -0
- package/dist/chunk-6IU67AEK.js +325 -0
- package/dist/chunk-6J5OKA4Y.js +49 -0
- package/dist/chunk-6JCPI55B.js +92 -0
- package/dist/chunk-6JUBZBMW.js +56 -0
- package/dist/chunk-6M5NK3K3.js +415 -0
- package/dist/chunk-6QSERWXH.js +53 -0
- package/dist/chunk-6TACQN3N.js +41 -0
- package/dist/chunk-76WKMA4J.js +14 -0
- package/dist/chunk-7AVHLZGD.js +45 -0
- package/dist/chunk-7EFILTCI.js +67 -0
- package/dist/chunk-7EKXJZ2Y.js +2902 -0
- package/dist/chunk-7EOBHUMC.js +133 -0
- package/dist/chunk-7FBGJFEE.js +66 -0
- package/dist/chunk-7JUKDRSZ.js +1726 -0
- package/dist/chunk-7SW2QWLU.js +212 -0
- package/dist/chunk-7WD63HU2.js +143 -0
- package/dist/chunk-7ZUIMTOU.js +108 -0
- package/dist/chunk-A3GY6SOA.js +95 -0
- package/dist/chunk-A7UPUQFY.js +2356 -0
- package/dist/chunk-AA6YULYB.js +376 -0
- package/dist/chunk-ABWHYWNI.js +101 -0
- package/dist/chunk-AIOQPLA5.js +540 -0
- package/dist/chunk-AVJDSJ2F.js +18 -0
- package/dist/chunk-B2WLAWNJ.js +374 -0
- package/dist/chunk-BKVWTZ6A.js +211 -0
- package/dist/chunk-BOHJZTEQ.js +1991 -0
- package/dist/chunk-BWZ77RQT.js +25 -0
- package/dist/chunk-C6EKFH7J.js +169 -0
- package/dist/chunk-CAQZUNOH.js +1150 -0
- package/dist/chunk-CEXSU4S6.js +1217 -0
- package/dist/chunk-CKSITVS4.js +16101 -0
- package/dist/chunk-CNUKCS2T.js +2741 -0
- package/dist/chunk-CPA6HPVR.js +3206 -0
- package/dist/chunk-CR3MTH32.js +207 -0
- package/dist/chunk-CSZ4C5N6.js +307 -0
- package/dist/chunk-D3PO4DOZ.js +261 -0
- package/dist/chunk-D46WUV3T.js +33 -0
- package/dist/chunk-DE76JROX.js +80 -0
- package/dist/chunk-DFBCSHVT.js +69 -0
- package/dist/chunk-DHPACDG7.js +104 -0
- package/dist/chunk-DKJA76CJ.js +113 -0
- package/dist/chunk-DPUYDDQG.js +164 -0
- package/dist/chunk-DPZHZQKE.js +285 -0
- package/dist/chunk-E36QOJMD.js +47 -0
- package/dist/chunk-EADP3PEN.js +450 -0
- package/dist/chunk-EBEW3XXQ.js +166 -0
- package/dist/chunk-EDS2L2LD.js +106 -0
- package/dist/chunk-EFHQ3TWP.js +637 -0
- package/dist/chunk-EPTBZ3GP.js +101 -0
- package/dist/chunk-EYWIDJFU.js +130 -0
- package/dist/chunk-F7HYOUFF.js +287 -0
- package/dist/chunk-FHH4I4ZV.js +128 -0
- package/dist/chunk-FITWGOJ2.js +131 -0
- package/dist/chunk-FQXYPF7E.js +147 -0
- package/dist/chunk-G2B4ZQGH.js +240 -0
- package/dist/chunk-GBRFVT63.js +45 -0
- package/dist/chunk-GDLULHTC.js +2919 -0
- package/dist/chunk-GLUX4EEP.js +583 -0
- package/dist/chunk-GQ4N4WKF.js +1142 -0
- package/dist/chunk-GT4I4ZWM.js +38 -0
- package/dist/chunk-HFQCFSJR.js +60 -0
- package/dist/chunk-HITVBIJS.js +1247 -0
- package/dist/chunk-HLJAXMM4.js +233 -0
- package/dist/chunk-HVUPKCGJ.js +162 -0
- package/dist/chunk-I3E7CX4H.js +155 -0
- package/dist/chunk-I4JRCD6M.js +184 -0
- package/dist/chunk-ICY36XCH.js +34 -0
- package/dist/chunk-IHMLFRVV.js +228 -0
- package/dist/chunk-IPKHE5D6.js +1963 -0
- package/dist/chunk-J4K3KVLD.js +131 -0
- package/dist/chunk-JBTK5OP2.js +55 -0
- package/dist/chunk-JCZIKA4C.js +163 -0
- package/dist/chunk-JGZCG5VM.js +189 -0
- package/dist/chunk-JIITQXFB.js +4087 -0
- package/dist/chunk-JMSCMUCA.js +271 -0
- package/dist/chunk-JZU3H6UQ.js +54 -0
- package/dist/chunk-K65BJIMT.js +49 -0
- package/dist/chunk-KEM4SDDP.js +3898 -0
- package/dist/chunk-KQDZXGNR.js +14 -0
- package/dist/chunk-L24C55VN.js +7923 -0
- package/dist/chunk-L6SGQIR3.js +471 -0
- package/dist/chunk-LR3R6Z2A.js +400 -0
- package/dist/chunk-M766ZJ6W.js +119 -0
- package/dist/chunk-MC3H7736.js +19910 -0
- package/dist/chunk-MGYZM27B.js +205 -0
- package/dist/chunk-MMOSZPWJ.js +273 -0
- package/dist/chunk-MVZVGYXH.js +1611 -0
- package/dist/chunk-N7IXEHK3.js +549 -0
- package/dist/chunk-NE2W3OO7.js +230 -0
- package/dist/chunk-NN2ZQEB4.js +38 -0
- package/dist/chunk-NXFPS2LR.js +182 -0
- package/dist/chunk-O3WI5KWW.js +31 -0
- package/dist/chunk-OLQJTJJU.js +76 -0
- package/dist/chunk-ONLS5QA5.js +102 -0
- package/dist/chunk-OT2O76OS.js +1496 -0
- package/dist/chunk-PAMPPUR6.js +4500 -0
- package/dist/chunk-PCOCACY3.js +385 -0
- package/dist/chunk-PCVDV3UZ.js +430 -0
- package/dist/chunk-PRPPGYZG.js +104 -0
- package/dist/chunk-Q4D5X7QB.js +264 -0
- package/dist/chunk-Q5AMFEWD.js +119 -0
- package/dist/chunk-QRAOANID.js +214 -0
- package/dist/chunk-QSXK2RGH.js +688 -0
- package/dist/chunk-QZSX3F7C.js +389 -0
- package/dist/chunk-R6RY4Q5T.js +51 -0
- package/dist/chunk-R6XF6UR3.js +149 -0
- package/dist/chunk-R77KLRB3.js +166 -0
- package/dist/chunk-RRTKKSLQ.js +251 -0
- package/dist/chunk-RTEYOSJY.js +29 -0
- package/dist/chunk-RUVFXE2L.js +666 -0
- package/dist/chunk-RVH5SUW5.js +69 -0
- package/dist/chunk-RZPYKDWS.js +26 -0
- package/dist/chunk-S2A7YC3Q.js +41433 -0
- package/dist/chunk-S3QNRWYR.js +25 -0
- package/dist/chunk-SJRGMG6A.js +174 -0
- package/dist/chunk-SP2I63OO.js +252 -0
- package/dist/chunk-T2UYZSCQ.js +545 -0
- package/dist/chunk-T6AIP7H5.js +3851 -0
- package/dist/chunk-T6XQL73F.js +94 -0
- package/dist/chunk-TANFV3MZ.js +531 -0
- package/dist/chunk-TDD55CJH.js +119 -0
- package/dist/chunk-TV45EUGM.js +51 -0
- package/dist/chunk-TXLH6WHQ.js +2078 -0
- package/dist/chunk-TYAID7B7.js +408 -0
- package/dist/chunk-UBBC2XSG.js +873 -0
- package/dist/chunk-UGLN7QHV.js +27 -0
- package/dist/chunk-UNM6ZOKP.js +878 -0
- package/dist/chunk-V2YTAIQO.js +1075 -0
- package/dist/chunk-VN3DP4LQ.js +43 -0
- package/dist/chunk-VOGCSYOI.js +16 -0
- package/dist/chunk-VYDBJ73M.js +32 -0
- package/dist/chunk-W3BQAZ3Q.js +34 -0
- package/dist/chunk-W5BVQF44.js +36 -0
- package/dist/chunk-WVPJSRRJ.js +52 -0
- package/dist/chunk-WY6PP6AA.js +53 -0
- package/dist/chunk-XAKWMCXI.js +285 -0
- package/dist/chunk-XPCM366L.js +70 -0
- package/dist/chunk-XPTOBS2D.js +48 -0
- package/dist/chunk-XY3P7JW7.js +3479 -0
- package/dist/chunk-XZRON6IV.js +131 -0
- package/dist/chunk-YEDDOYSC.js +27809 -0
- package/dist/chunk-YISXLPHN.js +496 -0
- package/dist/chunk-YMZ3TNYB.js +18 -0
- package/dist/chunk-YY6ZQQBP.js +203 -0
- package/dist/chunk-YYQN46FY.js +334 -0
- package/dist/chunk-Z6LF7HQN.js +22 -0
- package/dist/chunk-ZCJDOK2S.js +116 -0
- package/dist/chunk-ZDPAS56H.js +76 -0
- package/dist/chunk-ZMAINWBW.js +18 -0
- package/dist/chunk-ZMFPW66A.js +22 -0
- package/dist/chunk-ZNCEKR4J.js +296 -0
- package/dist/chunk-ZVM6AKKM.js +47 -0
- package/dist/files.json +1888 -0
- package/dist/fixtures/forge/README.md +19 -0
- package/dist/fixtures/forge/expected/discrepancies.yaml +54 -0
- package/dist/fixtures/forge/expected/inputs.yaml +38 -0
- package/dist/fixtures/forge/expected/scan.yaml +342 -0
- package/dist/fixtures/forge/inputs/diagrams/forge-context.drawio +23 -0
- package/dist/fixtures/forge/inputs/partner-specs/northwind-pay-openapi.yaml +11 -0
- package/dist/fixtures/forge/inputs/tickets/ado-stories.json +4 -0
- package/dist/fixtures/forge/inputs/tickets/closed-service-requests.json +5 -0
- package/dist/fixtures/forge/inputs/wiki/integration-patterns.md +11 -0
- package/dist/fixtures/forge/inputs/wiki/ledger-solution-spec.md +9 -0
- package/dist/fixtures/forge/inputs/wiki/snow-firewall-request.md +4 -0
- package/dist/fixtures/forge/metarepo/judgments/reaches/84af5b6af24f7ca8c23013f3.yaml +17 -0
- package/dist/fixtures/forge/metarepo/judgments/reaches/c3917555edebddce8cecb647.yaml +17 -0
- package/dist/fixtures/forge/metarepo/judgments/reaches/c5fafd6601f8ca9e34e0bbd0.yaml +17 -0
- package/dist/fixtures/forge/metarepo/org-pack/agents/architecture-critic.yaml +9 -0
- package/dist/fixtures/forge/metarepo/org-pack/agents/story-writer.yaml +10 -0
- package/dist/fixtures/forge/metarepo/org-pack/checklists/architecture.yaml +115 -0
- package/dist/fixtures/forge/metarepo/org-pack/dialects/forge.yaml +111 -0
- package/dist/fixtures/forge/metarepo/org-pack/gates.yaml +22 -0
- package/dist/fixtures/forge/metarepo/org-pack/pack.yaml +11 -0
- package/dist/fixtures/forge/metarepo/org-pack/patterns/A.EB.PUB.yaml +12 -0
- package/dist/fixtures/forge/metarepo/org-pack/patterns/D.JDBC.yaml +12 -0
- package/dist/fixtures/forge/metarepo/org-pack/patterns/S.DIR.BFF.yaml +12 -0
- package/dist/fixtures/forge/metarepo/org-pack/patterns/S.GW.SOR.yaml +13 -0
- package/dist/fixtures/forge/metarepo/org-pack/patterns/S.GW.VND.yaml +14 -0
- package/dist/fixtures/forge/metarepo/org-pack/process/change-templates/feature.md +37 -0
- package/dist/fixtures/forge/metarepo/org-pack/process/skills/add-forge-endpoint/SKILL.md +17 -0
- package/dist/fixtures/forge/metarepo/org-pack/process/snow/firewall-rule.yaml +14 -0
- package/dist/fixtures/forge/metarepo/org-pack/process/snow/gateway-route.yaml +13 -0
- package/dist/fixtures/forge/metarepo/org-pack/profiles/forge/profile.yaml +12 -0
- package/dist/fixtures/forge/metarepo/org-pack/profiles/forge/repos.manifest.yaml +44 -0
- package/dist/fixtures/forge/metarepo/org-pack/roles.yaml +14 -0
- package/dist/fixtures/forge/metarepo/org-pack/runtime.yaml +14 -0
- package/dist/fixtures/forge/metarepo/org-pack/sources.yaml +3 -0
- package/dist/fixtures/forge/repos/forge-events/topics/payments.initiated.yaml +4 -0
- package/dist/fixtures/forge/repos/forge-events/topics/transfers.completed.yaml +4 -0
- package/dist/fixtures/forge/repos/forge-gateway/proxies/ledger-v1/apiproxy/ledger-v1.xml +3 -0
- package/dist/fixtures/forge/repos/forge-gateway/proxies/ledger-v1/apiproxy/policies/SpikeArrest.xml +3 -0
- package/dist/fixtures/forge/repos/forge-gateway/proxies/ledger-v1/apiproxy/policies/VerifyOAuth.xml +4 -0
- package/dist/fixtures/forge/repos/forge-gateway/proxies/ledger-v1/apiproxy/proxies/default.xml +14 -0
- package/dist/fixtures/forge/repos/forge-gateway/proxies/ledger-v1/apiproxy/targets/ledger.xml +5 -0
- package/dist/fixtures/forge/repos/forge-infra/alerts/ledger-api.yaml +5 -0
- package/dist/fixtures/forge/repos/forge-infra/k8s/ledger-api.yaml +15 -0
- package/dist/fixtures/forge/repos/forge-infra/k8s/portal-bff.yaml +7 -0
- package/dist/fixtures/forge/repos/forge-infra/terraform/ledger-db.tf +9 -0
- package/dist/fixtures/forge/repos/forge-ledger/api/ledger-openapi.yaml +31 -0
- package/dist/fixtures/forge/repos/forge-ledger/forge.yaml +4 -0
- package/dist/fixtures/forge/repos/forge-ledger/src/main/java/forge/ledger/LedgerEndpoints.java +13 -0
- package/dist/fixtures/forge/repos/forge-ledger/src/main/java/forge/ledger/LedgerEvents.java +11 -0
- package/dist/fixtures/forge/repos/forge-ledger/src/main/java/forge/ledger/NorthwindClient.java +10 -0
- package/dist/fixtures/forge/repos/forge-ledger/src/main/resources/application.yml +3 -0
- package/dist/fixtures/forge/repos/forge-ledger/src/main/resources/db/migration/V1__create_account.sql +5 -0
- package/dist/fixtures/forge/repos/forge-ledger/src/main/resources/db/migration/V2__create_entry.sql +7 -0
- package/dist/fixtures/forge/repos/forge-portal-bff/pom.xml +1 -0
- package/dist/fixtures/forge/repos/forge-portal-bff/src/main/java/forge/portal/AuditPublisher.java +12 -0
- package/dist/fixtures/forge/repos/forge-portal-bff/src/main/java/forge/portal/BalanceController.java +16 -0
- package/dist/fixtures/forge/repos/forge-portal-bff/src/main/java/forge/portal/LedgerClient.java +13 -0
- package/dist/fixtures/forge/repos/forge-portal-bff/src/main/java/forge/portal/PaymentEvents.java +13 -0
- package/dist/fixtures/forge/repos/forge-portal-bff/src/main/resources/application.yml +8 -0
- package/dist/fixtures/forge/repos/forge-portal-ui/package.json +1 -0
- package/dist/fixtures/forge/repos/forge-portal-ui/src/api/balance.ts +5 -0
- package/dist/fixtures/forge/repos/forge-reports-job/src/main/java/forge/reports/DailyEntriesJob.java +19 -0
- package/dist/fixtures/forge/repos/forge-reports-job/src/main/resources/application.yml +3 -0
- package/dist/fixtures/forge-change/README.md +41 -0
- package/dist/fixtures/forge-change/expected/findings.yaml +301 -0
- package/dist/fixtures/forge-change/expected/stories.yaml +101 -0
- package/dist/fixtures/forge-change/judgments/personal-data/0b5f3dbf5257a22275d8c74b.yaml +18 -0
- package/dist/fixtures/forge-change/judgments/personal-data/2759a66770134c417440bf2d.yaml +18 -0
- package/dist/fixtures/forge-change/judgments/personal-data/31b1ea2f14d0737f1aca79fd.yaml +18 -0
- package/dist/fixtures/forge-change/judgments/personal-data/49afd70c08228e65ad6ca1ed.yaml +18 -0
- package/dist/fixtures/forge-change/judgments/personal-data/761cabcb8a39f5e5866d2dd6.yaml +18 -0
- package/dist/fixtures/forge-change/judgments/personal-data/adae902b90cc8ffa0c765145.yaml +18 -0
- package/dist/fixtures/forge-change/judgments/personal-data/ba11bb933105ec9493e065dd.yaml +18 -0
- package/dist/fixtures/forge-change/judgments/personal-data/bdbcd1cdac3021c68063c3e7.yaml +18 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/brief.md +35 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/change.yaml +120 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/data.md +18 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/design.md +29 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/interfaces.md +17 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/mappings.md +26 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/proposal.md +35 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/snow.md +12 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/specs/transfer-limits/spec.md +19 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/stories/s1-refuse-over-limit.md +17 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/stories/s2-show-remaining.md +16 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/stories/s3-audit-refusals.md +18 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/stories/s4-velocity-check.md +16 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/stories.md +8 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/tasks.md +12 -0
- package/dist/fixtures/forge-change/openspec/changes/add-transfer-limit/ux.md +7 -0
- package/dist/fixtures/forge-change/org-pack/agents/code-and-test-critic.yaml +13 -0
- package/dist/fixtures/forge-change/org-pack/agents/complete-critic.yaml +12 -0
- package/dist/fixtures/forge-change/org-pack/agents/safe-critic.yaml +12 -0
- package/dist/fixtures/forge-change/org-pack/agents/ship-critic.yaml +11 -0
- package/dist/fixtures/forge-change/org-pack/agents/true-critic.yaml +11 -0
- package/dist/fixtures/forge-change/org-pack/checklists/review.yaml +54 -0
- package/dist/fixtures/forge-change/org-pack/gates.yaml +25 -0
- package/dist/fixtures/forge-change/org-pack/teams/team-ledger/checklists/ledger-team.yaml +227 -0
- package/dist/fixtures/forge-change/recordings/complete-critic/2ad84f84bf39c1d5412697e69fe23034d6983ec45a00314bf0975e627589a3c5.json +12 -0
- package/dist/fixtures/forge-change/recordings/complete-critic/417c98d8e54a4387d0fd93441c49f44c2868958739070d855c1dce0c41e24db3.json +12 -0
- package/dist/fixtures/forge-change/recordings/complete-critic/50203ee22e9cb3ef047295edb6538fe7d5695e1e4b139f3c929013dc6ce47021.json +12 -0
- package/dist/fixtures/forge-change/recordings/complete-critic/89f18d67f5d9c325bf35e2a9e020f9ddb6ee13b8523315037f0905cc57c040b1.json +12 -0
- package/dist/fixtures/forge-change/recordings/complete-critic/b4097867d26ae8eadc8b9efa8cdd86897013358035f0b40086c299a59c4ba121.json +12 -0
- package/dist/fixtures/forge-change/recordings/safe-critic/302d06f49664dd67ad2e21ab9cf74c1b0f7d3f750709c6ed8eff2b70983274e2.json +12 -0
- package/dist/fixtures/forge-change/recordings/safe-critic/32f1049c9a5ab4a759543290db4644ec6e221cc45fdfdcf06193837c6a8ce0b9.json +12 -0
- package/dist/fixtures/forge-change/recordings/safe-critic/4e4a84bfc04b9f26ca4250319a879901ff7a1c081c71e46a117675fee05026b0.json +12 -0
- package/dist/fixtures/forge-change/recordings/safe-critic/604af0fcdd6df6b76208fa88305fdc15c37606c2a4d1ae816477e46ac8c2dd04.json +12 -0
- package/dist/fixtures/forge-change/recordings/safe-critic/f0bf50af11f14c50d07904f0dffe1c8c20fb0cd89770645a8824c1d30a443955.json +12 -0
- package/dist/fixtures/forge-change/recordings/ship-critic/350954b58833b2c04880c67db45a1b328b7fd541d9f0d943b63905b8875488a6.json +12 -0
- package/dist/fixtures/forge-change/recordings/ship-critic/4af95c6c96a206777cec9de1f9c2d8c55a36ddc9b8db2f81d6eb83217b835efa.json +12 -0
- package/dist/fixtures/forge-change/recordings/ship-critic/76c34522a49cf7587a4e5689a5030d384603fa780b8aba97d27815cbc829683e.json +12 -0
- package/dist/fixtures/forge-change/recordings/ship-critic/a3b2cd1ace48587e5994333db03b34c3a0f9dec4f1932f1730ddfb687f6918c8.json +12 -0
- package/dist/fixtures/forge-change/recordings/ship-critic/de288a4fa64d0fc20890f9a787080ce6eac5203b7b9b72d884df11e8cf111835.json +12 -0
- package/dist/fixtures/forge-change/recordings/story-writer/1ddb00eac2aaf91a5ec5d9dfd220116be9f75aec6546a4a3a3b050ed89af2864.json +12 -0
- package/dist/packages/assistant-kit/frameworks-kit/README.md +86 -0
- package/dist/packages/assistant-kit/frameworks-kit/checklist.md +11 -0
- package/dist/packages/assistant-kit/frameworks-kit/examples/tide-lantern.yaml +56 -0
- package/dist/packages/assistant-kit/frameworks-kit/examples/tide-platform.yaml +43 -0
- package/dist/packages/assistant-kit/frameworks-kit/prompts/write-framework-model.md +12 -0
- package/dist/packages/assistant-kit/kit/README.md +98 -0
- package/dist/packages/assistant-kit/kit/c2-reference.md +334 -0
- package/dist/packages/assistant-kit/kit/checklist.md +39 -0
- package/dist/packages/assistant-kit/kit/examples/house-http-client.yaml +102 -0
- package/dist/packages/assistant-kit/kit/examples/tide-apigee.yaml +56 -0
- package/dist/packages/assistant-kit/kit/examples/tide-apim.yaml +32 -0
- package/dist/packages/assistant-kit/kit/examples/tide-kong.yaml +44 -0
- package/dist/packages/assistant-kit/kit/prompts/write-dialect.md +34 -0
- package/dist/packages/assistant-kit/kit/worked-example.md +198 -0
- package/dist/packages/conformance/sample/README.md +4 -0
- package/dist/packages/conformance/sample/inputs/notes.md +3 -0
- package/dist/packages/conformance/sample/inputs/systems.csv +3 -0
- package/dist/packages/conformance/sample/repo/api/greeter.proto +6 -0
- package/dist/packages/conformance/sample/repo/api/openapi.yaml +10 -0
- package/dist/packages/conformance/sample/repo/api/schema.graphql +3 -0
- package/dist/packages/conformance/sample/repo/db/V1__create_greeting.sql +4 -0
- package/dist/packages/conformance/sample/repo/package.json +7 -0
- package/dist/packages/conformance/sample/repo/src/main/java/sample/HelloController.java +10 -0
- package/dist/packages/conformance/sample/repo/web/app.ts +4 -0
- package/dist/packages/evals/datasets/critic-lenses.yaml +62 -0
- package/dist/packages/evals/datasets/dialect-writer.yaml +14 -0
- package/dist/packages/evals/datasets/feature-namer.yaml +34 -0
- package/dist/packages/evals/datasets/glossary-definer.yaml +25 -0
- package/dist/packages/evals/datasets/story-writer.yaml +13 -0
- package/dist/packages/evals/datasets/template-writer.yaml +16 -0
- package/dist/packages/evals/datasets/test-writer.yaml +18 -0
- package/dist/packages/executors/reference/reference-executor.mjs +233 -0
- package/dist/packages/extractors/dialects/argocd.yaml +45 -0
- package/dist/packages/extractors/dialects/fixtures/jaxrs/accounts-service/src/main/java/forge/accounts/AccountResource.java +47 -0
- package/dist/packages/extractors/dialects/fixtures/jaxrs/accounts-service/src/main/java/forge/accounts/AuditClient.java +12 -0
- package/dist/packages/extractors/dialects/fixtures/jaxrs/accounts-service/src/main/java/forge/accounts/LedgerClient.java +17 -0
- package/dist/packages/extractors/dialects/fixtures/micronaut/statements-service/src/main/java/forge/statements/LedgerClient.java +14 -0
- package/dist/packages/extractors/dialects/fixtures/micronaut/statements-service/src/main/java/forge/statements/RatesClient.java +11 -0
- package/dist/packages/extractors/dialects/fixtures/micronaut/statements-service/src/main/java/forge/statements/StatementController.java +36 -0
- package/dist/packages/extractors/dialects/fixtures/micronaut/statements-service/src/main/resources/application.yml +7 -0
- package/dist/packages/extractors/dialects/fixtures/quarkus-reactive-messaging/fraud-service/src/main/java/forge/fraud/FraudScorer.java +27 -0
- package/dist/packages/extractors/dialects/fixtures/quarkus-reactive-messaging/fraud-service/src/main/resources/application.properties +4 -0
- package/dist/packages/extractors/dialects/fixtures/terraform-aws/forge-aws-infra/envs/prod/api.tf +38 -0
- package/dist/packages/extractors/dialects/fixtures/terraform-aws/forge-aws-infra/envs/prod/main.tf +95 -0
- package/dist/packages/extractors/dialects/fixtures/terraform-aws/forge-aws-infra/envs/prod/terraform.tfvars +1 -0
- package/dist/packages/extractors/dialects/fixtures/terraform-aws/forge-aws-infra/envs/prod/variables.tf +4 -0
- package/dist/packages/extractors/dialects/fixtures/terraform-azure/forge-azure-infra/main.tf +102 -0
- package/dist/packages/extractors/dialects/fixtures/terraform-gcp/forge-gcp-infra/main.tf +51 -0
- package/dist/packages/extractors/dialects/harness.yaml +101 -0
- package/dist/packages/extractors/dialects/jaxrs.yaml +155 -0
- package/dist/packages/extractors/dialects/micronaut.yaml +207 -0
- package/dist/packages/extractors/dialects/quarkus-reactive-messaging.yaml +158 -0
- package/dist/packages/extractors/dialects/tekton.yaml +71 -0
- package/dist/packages/extractors/dialects/terraform-aws.yaml +267 -0
- package/dist/packages/extractors/dialects/terraform-azure.yaml +212 -0
- package/dist/packages/extractors/dialects/terraform-gcp.yaml +109 -0
- package/dist/packages/extractors/grammars/README.md +11 -0
- package/dist/packages/extractors/grammars/tree-sitter-groovy.LICENSE +21 -0
- package/dist/packages/extractors/grammars/tree-sitter-groovy.wasm +0 -0
- package/dist/packages/extractors/grammars/vendored.json +11 -0
- package/dist/packages/learn/lessons/architect-diagrams-and-code.yaml +69 -0
- package/dist/packages/learn/lessons/business-analyst-story-bar.yaml +94 -0
- package/dist/packages/learn/lessons/delivery-lead-release-readiness.yaml +44 -0
- package/dist/packages/learn/lessons/designer-features-in-user-words.yaml +57 -0
- package/dist/packages/learn/lessons/developer-find-your-way.yaml +60 -0
- package/dist/packages/learn/lessons/everyone-first-hour.yaml +74 -0
- package/dist/packages/learn/lessons/platform-lead-coverage-and-defences.yaml +58 -0
- package/dist/packages/learn/lessons/product-owner-first-change.yaml +167 -0
- package/dist/packages/learn/lessons/qa-tests-and-trace.yaml +53 -0
- package/dist/packages/learn/lessons/team-lead-initiative.yaml +146 -0
- package/dist/packages/naysayer/constitution/constitution.yaml +286 -0
- package/dist/packages/naysayer/starter/review.yaml +256 -0
- package/dist/packages/sdk/npm/index.js +8892 -0
- package/dist/packages/speckit/rules/drift.yaml +78 -0
- package/dist/packages/taskrun/rules/conform.yaml +38 -0
- package/dist/packages/testgen/rules/trace.yaml +49 -0
- package/dist/packages/ui/dist/assets/elk-api-tma0MCuh.js +2 -0
- package/dist/packages/ui/dist/assets/elk-worker.min--dAJroGl.js +6401 -0
- package/dist/packages/ui/dist/assets/elk-worker.min-DdYmS5kP.js +2 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-cyrillic-400-normal-BTotfTJu.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-cyrillic-400-normal-DZqxrq2p.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-cyrillic-500-normal-ByOcLdNv.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-cyrillic-500-normal-CocWQlwt.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-cyrillic-600-normal-71GNu3SW.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-cyrillic-600-normal-BGq0mW3O.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-cyrillic-ext-400-normal-Dsrv2Tcn.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-cyrillic-ext-400-normal-g30qAdWV.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-cyrillic-ext-500-normal-Cs5J6C77.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-cyrillic-ext-500-normal-DB5PtV2g.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-cyrillic-ext-600-normal-Bz0x94Yp.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-cyrillic-ext-600-normal-DUMzJB7m.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-greek-400-normal-D9ESIMu3.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-greek-400-normal-_efipK4i.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-greek-500-normal-CuWXN6rf.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-greek-500-normal-JMMifIXV.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-greek-600-normal-D-CqTdkO.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-greek-600-normal-DzTrcv_p.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-latin-400-normal-CDDApCn2.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-latin-400-normal-CYLoc0-x.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-latin-500-normal-6ng42L7E.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-latin-500-normal-BgVn5rGT.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-latin-600-normal-Cu4Hd6ag.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-latin-600-normal-CuJfVYMP.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-latin-ext-400-normal-C5H60-Va.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-latin-ext-400-normal-RBey6euL.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-latin-ext-500-normal-D0aIdm-b.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-latin-ext-500-normal-DakdToA3.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-latin-ext-600-normal-DIrixKbi.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-latin-ext-600-normal-DOrvGEcy.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-vietnamese-400-normal-DG4YqDda.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-vietnamese-400-normal-fK1oJ5dG.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-vietnamese-500-normal-BEb3_waV.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-vietnamese-500-normal-e4dixQRQ.woff2 +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-vietnamese-600-normal-DgdngZtN.woff +0 -0
- package/dist/packages/ui/dist/assets/ibm-plex-sans-vietnamese-600-normal-DpPYBSTl.woff2 +0 -0
- package/dist/packages/ui/dist/assets/index-B54fm9FQ.js +29 -0
- package/dist/packages/ui/dist/assets/index-DD_hufQz.css +1 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-cyrillic-400-normal-BEIGL1Tu.woff2 +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-cyrillic-400-normal-ugxPyKxw.woff +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-cyrillic-500-normal-DJqRU3vO.woff +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-cyrillic-500-normal-DmUKJPL_.woff2 +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-greek-400-normal-B9oWc5Lo.woff +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-greek-400-normal-C190GLew.woff2 +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-greek-500-normal-D7SFKleX.woff +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-greek-500-normal-JpySY46c.woff2 +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-latin-ext-400-normal-fXTG6kC5.woff +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-latin-ext-500-normal-Cut-4mMH.woff2 +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-latin-ext-500-normal-ckzbgY84.woff +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-vietnamese-400-normal-CqNFfHCs.woff +0 -0
- package/dist/packages/ui/dist/assets/jetbrains-mono-vietnamese-500-normal-DNRqzVM1.woff +0 -0
- package/dist/packages/ui/dist/assets/rajdhani-devanagari-600-normal-BtY48IV_.woff +0 -0
- package/dist/packages/ui/dist/assets/rajdhani-devanagari-600-normal-DhS7ScYx.woff2 +0 -0
- package/dist/packages/ui/dist/assets/rajdhani-devanagari-700-normal-BQQOj9BB.woff2 +0 -0
- package/dist/packages/ui/dist/assets/rajdhani-devanagari-700-normal-DBRwWuxA.woff +0 -0
- package/dist/packages/ui/dist/assets/rajdhani-latin-600-normal-CXCVEoA9.woff2 +0 -0
- package/dist/packages/ui/dist/assets/rajdhani-latin-600-normal-Dx02qI2_.woff +0 -0
- package/dist/packages/ui/dist/assets/rajdhani-latin-700-normal-BPDUZo87.woff2 +0 -0
- package/dist/packages/ui/dist/assets/rajdhani-latin-700-normal-e0Uj8ZlN.woff +0 -0
- package/dist/packages/ui/dist/assets/rajdhani-latin-ext-600-normal-BleIgkPp.woff +0 -0
- package/dist/packages/ui/dist/assets/rajdhani-latin-ext-600-normal-C9ZjJQAt.woff2 +0 -0
- package/dist/packages/ui/dist/assets/rajdhani-latin-ext-700-normal-BPaQ7tlD.woff +0 -0
- package/dist/packages/ui/dist/assets/rajdhani-latin-ext-700-normal-S6aYESQK.woff2 +0 -0
- package/dist/packages/ui/dist/favicon.svg +1 -0
- package/dist/packages/ui/dist/index.html +15 -0
- package/dist/third-party.json +575 -0
- package/dist/vendor/@fission-ai/openspec/bin/openspec.js +85986 -0
- package/dist/vendor/@fission-ai/openspec/package.json +82 -0
- package/dist/vendor/@fission-ai/openspec/schemas/spec-driven/schema.yaml +248 -0
- package/dist/vendor/@fission-ai/openspec/schemas/spec-driven/templates/design.md +21 -0
- package/dist/vendor/@fission-ai/openspec/schemas/spec-driven/templates/proposal.md +34 -0
- package/dist/vendor/@fission-ai/openspec/schemas/spec-driven/templates/spec.md +13 -0
- package/dist/vendor/@fission-ai/openspec/schemas/spec-driven/templates/tasks.md +11 -0
- package/dist/vendor/tree-sitter-wasms/out/tree-sitter-c_sharp.wasm +0 -0
- package/dist/vendor/tree-sitter-wasms/out/tree-sitter-go.wasm +0 -0
- package/dist/vendor/tree-sitter-wasms/out/tree-sitter-java.wasm +0 -0
- package/dist/vendor/tree-sitter-wasms/out/tree-sitter-javascript.wasm +0 -0
- package/dist/vendor/tree-sitter-wasms/out/tree-sitter-kotlin.wasm +0 -0
- package/dist/vendor/tree-sitter-wasms/out/tree-sitter-php.wasm +0 -0
- package/dist/vendor/tree-sitter-wasms/out/tree-sitter-python.wasm +0 -0
- package/dist/vendor/tree-sitter-wasms/out/tree-sitter-ruby.wasm +0 -0
- package/dist/vendor/tree-sitter-wasms/out/tree-sitter-rust.wasm +0 -0
- package/dist/vendor/tree-sitter-wasms/out/tree-sitter-scala.wasm +0 -0
- package/dist/vendor/tree-sitter-wasms/out/tree-sitter-tsx.wasm +0 -0
- package/dist/vendor/tree-sitter-wasms/out/tree-sitter-typescript.wasm +0 -0
- package/dist/vendor/web-tree-sitter/tree-sitter.wasm +0 -0
- package/package.json +36 -3
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { createRequire as __atticusCreateRequire } from "node:module";
|
|
2
|
+
import { fileURLToPath as __atticusFileURLToPath } from "node:url";
|
|
3
|
+
var require = __atticusCreateRequire(import.meta.url);
|
|
4
|
+
var __atticusUrl = (p) => new URL("./" + p, import.meta.url).href;
|
|
5
|
+
var __atticusPath = (p) => __atticusFileURLToPath(__atticusUrl(p));
|
|
6
|
+
import {
|
|
7
|
+
BuildAttempt,
|
|
8
|
+
CONFORM_DIR,
|
|
9
|
+
CONFORM_GATE,
|
|
10
|
+
ConformError,
|
|
11
|
+
FILE_FORMAT,
|
|
12
|
+
RunLevel,
|
|
13
|
+
TASK_RUNNER,
|
|
14
|
+
TaskRunError,
|
|
15
|
+
TaskRunRecord,
|
|
16
|
+
TaskRunState,
|
|
17
|
+
applyChanges,
|
|
18
|
+
completeTaskHandoff,
|
|
19
|
+
conformAfterBuild,
|
|
20
|
+
conformChange,
|
|
21
|
+
conformFindingId,
|
|
22
|
+
conformFindings,
|
|
23
|
+
conformScanDir,
|
|
24
|
+
conformanceOf,
|
|
25
|
+
findWaitingTaskRun,
|
|
26
|
+
isTaskRun,
|
|
27
|
+
parseAnswer,
|
|
28
|
+
readConformResults,
|
|
29
|
+
readTaskRun,
|
|
30
|
+
refusedPath,
|
|
31
|
+
runTask,
|
|
32
|
+
saveRunSummary,
|
|
33
|
+
saveTaskRun,
|
|
34
|
+
shellCommandRunner,
|
|
35
|
+
taskDir,
|
|
36
|
+
taskPack,
|
|
37
|
+
taskRunnerAgent
|
|
38
|
+
} from "./chunk-CEXSU4S6.js";
|
|
39
|
+
import "./chunk-2ANOROX3.js";
|
|
40
|
+
import "./chunk-65NYPGRC.js";
|
|
41
|
+
import "./chunk-OT2O76OS.js";
|
|
42
|
+
import "./chunk-IPKHE5D6.js";
|
|
43
|
+
import "./chunk-CKSITVS4.js";
|
|
44
|
+
import "./chunk-L6SGQIR3.js";
|
|
45
|
+
import "./chunk-3HI6Z55Y.js";
|
|
46
|
+
import "./chunk-XY3P7JW7.js";
|
|
47
|
+
import "./chunk-4AK7IBVP.js";
|
|
48
|
+
import "./chunk-7JUKDRSZ.js";
|
|
49
|
+
import "./chunk-27NKUS3X.js";
|
|
50
|
+
import "./chunk-L24C55VN.js";
|
|
51
|
+
import "./chunk-PAMPPUR6.js";
|
|
52
|
+
import "./chunk-23W7VWKR.js";
|
|
53
|
+
import "./chunk-7EKXJZ2Y.js";
|
|
54
|
+
import "./chunk-MC3H7736.js";
|
|
55
|
+
import "./chunk-T6AIP7H5.js";
|
|
56
|
+
import "./chunk-EFHQ3TWP.js";
|
|
57
|
+
import "./chunk-GQ4N4WKF.js";
|
|
58
|
+
import "./chunk-CNUKCS2T.js";
|
|
59
|
+
import "./chunk-S2A7YC3Q.js";
|
|
60
|
+
import "./chunk-D3PO4DOZ.js";
|
|
61
|
+
import "./chunk-TV45EUGM.js";
|
|
62
|
+
export {
|
|
63
|
+
BuildAttempt,
|
|
64
|
+
CONFORM_DIR,
|
|
65
|
+
CONFORM_GATE,
|
|
66
|
+
ConformError,
|
|
67
|
+
FILE_FORMAT,
|
|
68
|
+
RunLevel,
|
|
69
|
+
TASK_RUNNER,
|
|
70
|
+
TaskRunError,
|
|
71
|
+
TaskRunRecord,
|
|
72
|
+
TaskRunState,
|
|
73
|
+
applyChanges,
|
|
74
|
+
completeTaskHandoff,
|
|
75
|
+
conformAfterBuild,
|
|
76
|
+
conformChange,
|
|
77
|
+
conformFindingId,
|
|
78
|
+
conformFindings,
|
|
79
|
+
conformScanDir,
|
|
80
|
+
conformanceOf,
|
|
81
|
+
findWaitingTaskRun,
|
|
82
|
+
isTaskRun,
|
|
83
|
+
parseAnswer,
|
|
84
|
+
readConformResults,
|
|
85
|
+
readTaskRun,
|
|
86
|
+
refusedPath,
|
|
87
|
+
runTask,
|
|
88
|
+
saveRunSummary,
|
|
89
|
+
saveTaskRun,
|
|
90
|
+
shellCommandRunner,
|
|
91
|
+
taskDir,
|
|
92
|
+
taskPack,
|
|
93
|
+
taskRunnerAgent
|
|
94
|
+
};
|
|
@@ -0,0 +1,531 @@
|
|
|
1
|
+
import { createRequire as __atticusCreateRequire } from "node:module";
|
|
2
|
+
import { fileURLToPath as __atticusFileURLToPath } from "node:url";
|
|
3
|
+
var require = __atticusCreateRequire(import.meta.url);
|
|
4
|
+
var __atticusUrl = (p) => new URL("./" + p, import.meta.url).href;
|
|
5
|
+
var __atticusPath = (p) => __atticusFileURLToPath(__atticusUrl(p));
|
|
6
|
+
import {
|
|
7
|
+
quantize
|
|
8
|
+
} from "./chunk-CNUKCS2T.js";
|
|
9
|
+
import {
|
|
10
|
+
Runtime,
|
|
11
|
+
external_exports,
|
|
12
|
+
orgPackDirOf,
|
|
13
|
+
readTarGz,
|
|
14
|
+
require_dist,
|
|
15
|
+
retrievalOf
|
|
16
|
+
} from "./chunk-S2A7YC3Q.js";
|
|
17
|
+
import "./chunk-D3PO4DOZ.js";
|
|
18
|
+
import {
|
|
19
|
+
__toESM
|
|
20
|
+
} from "./chunk-TV45EUGM.js";
|
|
21
|
+
|
|
22
|
+
// packages/embed/dist/wordpiece.js
|
|
23
|
+
function wordPieceConfig(json) {
|
|
24
|
+
const t = json;
|
|
25
|
+
if (t?.model?.type !== "WordPiece")
|
|
26
|
+
throw new Error(`the tokenizer is ${t?.model?.type ?? "unknown"}, not WordPiece`);
|
|
27
|
+
const lowercase = t.normalizer?.lowercase ?? true;
|
|
28
|
+
return {
|
|
29
|
+
vocab: new Map(Object.entries(t.model.vocab)),
|
|
30
|
+
unk: t.model.unk_token ?? "[UNK]",
|
|
31
|
+
prefix: t.model.continuing_subword_prefix ?? "##",
|
|
32
|
+
maxCharsPerWord: t.model.max_input_chars_per_word ?? 100,
|
|
33
|
+
lowercase,
|
|
34
|
+
// BertNormalizer: strip_accents null means "as lowercase".
|
|
35
|
+
stripAccents: t.normalizer?.strip_accents ?? lowercase,
|
|
36
|
+
cls: "[CLS]",
|
|
37
|
+
sep: "[SEP]"
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
var isControl = (c) => {
|
|
41
|
+
if (c === " " || c === "\n" || c === "\r")
|
|
42
|
+
return false;
|
|
43
|
+
return new RegExp("\\p{Cc}|\\p{Cf}", "u").test(c);
|
|
44
|
+
};
|
|
45
|
+
var isWhite = (c) => /\s/u.test(c);
|
|
46
|
+
var isPunct = (c) => {
|
|
47
|
+
const cp = c.codePointAt(0);
|
|
48
|
+
if (cp >= 33 && cp <= 47 || cp >= 58 && cp <= 64 || cp >= 91 && cp <= 96 || cp >= 123 && cp <= 126)
|
|
49
|
+
return true;
|
|
50
|
+
return new RegExp("\\p{P}", "u").test(c);
|
|
51
|
+
};
|
|
52
|
+
var isCjk = (cp) => cp >= 19968 && cp <= 40959 || cp >= 13312 && cp <= 19903 || cp >= 131072 && cp <= 173791 || cp >= 173824 && cp <= 177983 || cp >= 177984 && cp <= 178207 || cp >= 178208 && cp <= 183983 || cp >= 63744 && cp <= 64255 || cp >= 194560 && cp <= 195103;
|
|
53
|
+
function normalize(text, c) {
|
|
54
|
+
let out = "";
|
|
55
|
+
for (const ch of text) {
|
|
56
|
+
const cp = ch.codePointAt(0);
|
|
57
|
+
if (cp === 0 || cp === 65533 || isControl(ch))
|
|
58
|
+
continue;
|
|
59
|
+
if (isWhite(ch))
|
|
60
|
+
out += " ";
|
|
61
|
+
else if (isCjk(cp))
|
|
62
|
+
out += ` ${ch} `;
|
|
63
|
+
else
|
|
64
|
+
out += ch;
|
|
65
|
+
}
|
|
66
|
+
if (c.lowercase)
|
|
67
|
+
out = out.toLowerCase();
|
|
68
|
+
if (c.stripAccents)
|
|
69
|
+
out = out.normalize("NFD").replace(new RegExp("\\p{Mn}", "gu"), "");
|
|
70
|
+
return out;
|
|
71
|
+
}
|
|
72
|
+
function preTokenize(text) {
|
|
73
|
+
const out = [];
|
|
74
|
+
let cur = "";
|
|
75
|
+
for (const ch of text) {
|
|
76
|
+
if (isWhite(ch)) {
|
|
77
|
+
if (cur)
|
|
78
|
+
out.push(cur);
|
|
79
|
+
cur = "";
|
|
80
|
+
} else if (isPunct(ch)) {
|
|
81
|
+
if (cur)
|
|
82
|
+
out.push(cur);
|
|
83
|
+
out.push(ch);
|
|
84
|
+
cur = "";
|
|
85
|
+
} else
|
|
86
|
+
cur += ch;
|
|
87
|
+
}
|
|
88
|
+
if (cur)
|
|
89
|
+
out.push(cur);
|
|
90
|
+
return out;
|
|
91
|
+
}
|
|
92
|
+
function wordPieces(word, c) {
|
|
93
|
+
const chars = [...word];
|
|
94
|
+
if (chars.length > c.maxCharsPerWord)
|
|
95
|
+
return [c.unk];
|
|
96
|
+
const out = [];
|
|
97
|
+
let start = 0;
|
|
98
|
+
while (start < chars.length) {
|
|
99
|
+
let end = chars.length;
|
|
100
|
+
let found;
|
|
101
|
+
while (start < end) {
|
|
102
|
+
const sub = `${start > 0 ? c.prefix : ""}${chars.slice(start, end).join("")}`;
|
|
103
|
+
if (c.vocab.has(sub)) {
|
|
104
|
+
found = sub;
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
end--;
|
|
108
|
+
}
|
|
109
|
+
if (!found)
|
|
110
|
+
return [c.unk];
|
|
111
|
+
out.push(found);
|
|
112
|
+
start = end;
|
|
113
|
+
}
|
|
114
|
+
return out;
|
|
115
|
+
}
|
|
116
|
+
function encode(text, c, maxTokens) {
|
|
117
|
+
const ids = [c.vocab.get(c.cls)];
|
|
118
|
+
const unk = c.vocab.get(c.unk);
|
|
119
|
+
outer: for (const w of preTokenize(normalize(text, c)))
|
|
120
|
+
for (const p of wordPieces(w, c)) {
|
|
121
|
+
if (ids.length >= maxTokens - 1)
|
|
122
|
+
break outer;
|
|
123
|
+
ids.push(c.vocab.get(p) ?? unk);
|
|
124
|
+
}
|
|
125
|
+
ids.push(c.vocab.get(c.sep));
|
|
126
|
+
return ids;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// packages/embed/dist/model.js
|
|
130
|
+
var import_yaml = __toESM(require_dist(), 1);
|
|
131
|
+
import { createHash } from "node:crypto";
|
|
132
|
+
import { createReadStream, existsSync } from "node:fs";
|
|
133
|
+
import { readFile, stat } from "node:fs/promises";
|
|
134
|
+
import { createRequire } from "node:module";
|
|
135
|
+
import { dirname, join, sep } from "node:path";
|
|
136
|
+
import { pathToFileURL } from "node:url";
|
|
137
|
+
var __atticus_import_meta_url = __atticusUrl("packages/embed/dist/model.js");
|
|
138
|
+
var MODEL_MANIFEST = "atticus-model.yaml";
|
|
139
|
+
var ModelManifest = external_exports.strictObject({
|
|
140
|
+
schemaVersion: external_exports.literal(1),
|
|
141
|
+
/** A short name, e.g. snowflake-arctic-embed-xs. */
|
|
142
|
+
name: external_exports.string().regex(/^[a-z0-9][a-z0-9._-]*$/),
|
|
143
|
+
/** fp32 only: an int8 model's vectors change with the batch's shape and the backend. */
|
|
144
|
+
dtype: external_exports.literal("fp32"),
|
|
145
|
+
/** The model file, fp32 ONNX, in the folder. */
|
|
146
|
+
model: external_exports.string().min(1).default("model.onnx"),
|
|
147
|
+
sha256: external_exports.string().regex(/^[0-9a-f]{64}$/),
|
|
148
|
+
tokenizer: external_exports.string().min(1).default("tokenizer.json"),
|
|
149
|
+
dim: external_exports.number().int().positive(),
|
|
150
|
+
maxTokens: external_exports.number().int().positive(),
|
|
151
|
+
/** cls: the first token's vector; mean: the average over the tokens. */
|
|
152
|
+
pooling: external_exports.enum(["cls", "mean"]),
|
|
153
|
+
/** Said before a query (some retrieval models are trained with one). */
|
|
154
|
+
queryPrefix: external_exports.string().default(""),
|
|
155
|
+
documentPrefix: external_exports.string().default(""),
|
|
156
|
+
/** The cosine below which a node is not similar, for this model (calibrated on the eval). */
|
|
157
|
+
similarityFloor: external_exports.number().min(-1).max(1).optional(),
|
|
158
|
+
/** The model's output to pool. */
|
|
159
|
+
output: external_exports.string().default("last_hidden_state"),
|
|
160
|
+
licence: external_exports.string().min(1),
|
|
161
|
+
/** Where the weights were taken from, for the SBOM. */
|
|
162
|
+
source: external_exports.string().min(1)
|
|
163
|
+
});
|
|
164
|
+
async function readModelManifest(dir) {
|
|
165
|
+
const text = await readFile(join(dir, MODEL_MANIFEST), "utf8");
|
|
166
|
+
return ModelManifest.parse((0, import_yaml.parse)(text));
|
|
167
|
+
}
|
|
168
|
+
function fileSha256(file) {
|
|
169
|
+
return new Promise((resolve2, reject) => {
|
|
170
|
+
const h = createHash("sha256");
|
|
171
|
+
createReadStream(file).on("data", (b) => h.update(b)).on("error", reject).on("end", () => resolve2(h.digest("hex")));
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
var runtimePackages = (kind) => kind === "native" ? [`@maycombhq/onnxruntime-${process.platform}-${process.arch}`, "onnxruntime-node"] : ["@maycombhq/onnxruntime-wasm", "onnxruntime-web"];
|
|
175
|
+
function packageDir(req, name) {
|
|
176
|
+
try {
|
|
177
|
+
return dirname(req.resolve(`${name}/package.json`));
|
|
178
|
+
} catch {
|
|
179
|
+
try {
|
|
180
|
+
const entry = req.resolve(name);
|
|
181
|
+
const at = entry.lastIndexOf(`${sep}${name.split("/").join(sep)}${sep}`);
|
|
182
|
+
return at < 0 ? void 0 : entry.slice(0, at + name.length + 1);
|
|
183
|
+
} catch {
|
|
184
|
+
return void 0;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
async function loadOrt(kind, runtimeDir) {
|
|
189
|
+
const req = createRequire(runtimeDir ? join(runtimeDir, "noop.js") : __atticus_import_meta_url);
|
|
190
|
+
for (const name of runtimePackages(kind)) {
|
|
191
|
+
const dir = packageDir(req, name);
|
|
192
|
+
if (!dir)
|
|
193
|
+
continue;
|
|
194
|
+
const file = join(dir, "dist", kind === "native" ? "index.js" : "ort.wasm.min.mjs");
|
|
195
|
+
if (!existsSync(file))
|
|
196
|
+
continue;
|
|
197
|
+
const m = kind === "native" ? createRequire(file)(file) : await import(pathToFileURL(file).href);
|
|
198
|
+
return { ort: m.default ?? m, dir };
|
|
199
|
+
}
|
|
200
|
+
throw new Error(`no ${kind} ONNX runtime is installed (${runtimePackages(kind).join(" or ")})`);
|
|
201
|
+
}
|
|
202
|
+
var OnnxEmbedder = class _OnnxEmbedder {
|
|
203
|
+
dir;
|
|
204
|
+
manifest;
|
|
205
|
+
o;
|
|
206
|
+
id;
|
|
207
|
+
dim;
|
|
208
|
+
maxTokens;
|
|
209
|
+
backend = "not loaded";
|
|
210
|
+
floor;
|
|
211
|
+
session;
|
|
212
|
+
constructor(dir, manifest, o = {}) {
|
|
213
|
+
this.dir = dir;
|
|
214
|
+
this.manifest = manifest;
|
|
215
|
+
this.o = o;
|
|
216
|
+
this.id = `${manifest.name}@${manifest.sha256.slice(0, 12)}`;
|
|
217
|
+
this.dim = manifest.dim;
|
|
218
|
+
this.maxTokens = manifest.maxTokens;
|
|
219
|
+
if (manifest.similarityFloor !== void 0)
|
|
220
|
+
this.floor = manifest.similarityFloor;
|
|
221
|
+
}
|
|
222
|
+
static async open(dir, o = {}) {
|
|
223
|
+
return new _OnnxEmbedder(dir, await readModelManifest(dir), o);
|
|
224
|
+
}
|
|
225
|
+
/** The model file is there and is the one the manifest names (its sha256). */
|
|
226
|
+
async check() {
|
|
227
|
+
const file = join(this.dir, this.manifest.model);
|
|
228
|
+
if (!existsSync(file))
|
|
229
|
+
return { ok: false, problem: `${file} isn't there` };
|
|
230
|
+
const sha = await fileSha256(file);
|
|
231
|
+
return sha === this.manifest.sha256 ? { ok: true } : {
|
|
232
|
+
ok: false,
|
|
233
|
+
problem: `${file} has sha256 ${sha}, not the ${this.manifest.sha256} its manifest names`
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
load() {
|
|
237
|
+
this.session ??= (async () => {
|
|
238
|
+
const c = await this.check();
|
|
239
|
+
if (!c.ok)
|
|
240
|
+
throw new Error(c.problem);
|
|
241
|
+
const tok = wordPieceConfig(JSON.parse(await readFile(join(this.dir, this.manifest.tokenizer), "utf8")));
|
|
242
|
+
const file = join(this.dir, this.manifest.model);
|
|
243
|
+
let loaded;
|
|
244
|
+
let s;
|
|
245
|
+
if (this.o.backend !== "wasm") {
|
|
246
|
+
try {
|
|
247
|
+
loaded = await loadOrt("native", this.o.runtimeDir);
|
|
248
|
+
s = await loaded.ort.InferenceSession.create(file, {
|
|
249
|
+
executionProviders: ["cpu"],
|
|
250
|
+
graphOptimizationLevel: "all",
|
|
251
|
+
intraOpNumThreads: 1
|
|
252
|
+
});
|
|
253
|
+
this.backend = "native";
|
|
254
|
+
} catch {
|
|
255
|
+
s = void 0;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
if (!s) {
|
|
259
|
+
loaded = await loadOrt("wasm", this.o.runtimeDir);
|
|
260
|
+
if (loaded.ort.env?.wasm) {
|
|
261
|
+
loaded.ort.env.wasm.numThreads = 1;
|
|
262
|
+
loaded.ort.env.wasm.wasmBinary = await readFile(join(loaded.dir, "dist", "ort-wasm-simd-threaded.wasm"));
|
|
263
|
+
}
|
|
264
|
+
s = await loaded.ort.InferenceSession.create(await readFile(file), {
|
|
265
|
+
executionProviders: ["wasm"]
|
|
266
|
+
});
|
|
267
|
+
this.backend = "wasm";
|
|
268
|
+
}
|
|
269
|
+
return { s, ort: loaded.ort, tok };
|
|
270
|
+
})();
|
|
271
|
+
return this.session;
|
|
272
|
+
}
|
|
273
|
+
async embed(texts, kind) {
|
|
274
|
+
const { s, ort, tok } = await this.load();
|
|
275
|
+
const out = [];
|
|
276
|
+
const prefix = kind === "query" ? this.manifest.queryPrefix : this.manifest.documentPrefix;
|
|
277
|
+
for (const t of texts) {
|
|
278
|
+
const ids = encode(`${prefix}${t}`, tok, this.maxTokens);
|
|
279
|
+
const n = ids.length;
|
|
280
|
+
const feeds = {
|
|
281
|
+
input_ids: new ort.Tensor("int64", BigInt64Array.from(ids.map(BigInt)), [1, n]),
|
|
282
|
+
attention_mask: new ort.Tensor("int64", new BigInt64Array(n).fill(1n), [1, n])
|
|
283
|
+
};
|
|
284
|
+
if (s.inputNames.includes("token_type_ids"))
|
|
285
|
+
feeds.token_type_ids = new ort.Tensor("int64", new BigInt64Array(n), [1, n]);
|
|
286
|
+
const r = await s.run(feeds);
|
|
287
|
+
const h = r[this.manifest.output];
|
|
288
|
+
if (!h)
|
|
289
|
+
throw new Error(`the model has no output ${this.manifest.output}`);
|
|
290
|
+
const d = h.dims.at(-1);
|
|
291
|
+
const v = new Float64Array(d);
|
|
292
|
+
if (this.manifest.pooling === "cls")
|
|
293
|
+
for (let j = 0; j < d; j++)
|
|
294
|
+
v[j] = h.data[j];
|
|
295
|
+
else {
|
|
296
|
+
for (let i = 0; i < n; i++)
|
|
297
|
+
for (let j = 0; j < d; j++)
|
|
298
|
+
v[j] = v[j] + h.data[i * d + j];
|
|
299
|
+
for (let j = 0; j < d; j++)
|
|
300
|
+
v[j] = v[j] / n;
|
|
301
|
+
}
|
|
302
|
+
out.push(quantize(v));
|
|
303
|
+
}
|
|
304
|
+
return out;
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
async function modelInfo(dir) {
|
|
308
|
+
try {
|
|
309
|
+
const manifest = await readModelManifest(dir);
|
|
310
|
+
const st = await stat(join(dir, manifest.model)).catch(() => void 0);
|
|
311
|
+
if (!st)
|
|
312
|
+
return { ok: false, problem: `${join(dir, manifest.model)} isn't there` };
|
|
313
|
+
return { ok: true, manifest, bytes: st.size };
|
|
314
|
+
} catch (e) {
|
|
315
|
+
return {
|
|
316
|
+
ok: false,
|
|
317
|
+
problem: `${join(dir, MODEL_MANIFEST)}: ${e.message.split("\n")[0]}`
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// packages/embed/dist/resolve.js
|
|
323
|
+
var import_yaml2 = __toESM(require_dist(), 1);
|
|
324
|
+
import { existsSync as existsSync2 } from "node:fs";
|
|
325
|
+
import { readFile as readFile2 } from "node:fs/promises";
|
|
326
|
+
import { createRequire as createRequire2 } from "node:module";
|
|
327
|
+
import { isAbsolute, join as join2, resolve } from "node:path";
|
|
328
|
+
var __atticus_import_meta_url2 = __atticusUrl("packages/embed/dist/resolve.js");
|
|
329
|
+
function bundledModelDir(runtimeDir) {
|
|
330
|
+
try {
|
|
331
|
+
const req = createRequire2(runtimeDir ? join2(runtimeDir, "noop.js") : __atticus_import_meta_url2);
|
|
332
|
+
return join2(req.resolve("@maycombhq/embed-model/package.json"), "..");
|
|
333
|
+
} catch {
|
|
334
|
+
return void 0;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
function installedModelDir() {
|
|
338
|
+
const dir = bundledModelDir();
|
|
339
|
+
return dir && existsSync2(join2(dir, "model.onnx")) ? dir : void 0;
|
|
340
|
+
}
|
|
341
|
+
var embeddingsOffByEnv = () => process.env.ATTICUS_EMBEDDINGS === "off";
|
|
342
|
+
async function settingsOf(root) {
|
|
343
|
+
const text = await readFile2(join2(orgPackDirOf(root), "runtime.yaml"), "utf8").catch(() => void 0);
|
|
344
|
+
const raw = text ? (0, import_yaml2.parse)(text) : void 0;
|
|
345
|
+
const r = raw === void 0 ? void 0 : Runtime.safeParse(raw);
|
|
346
|
+
const e = retrievalOf(r?.success ? r.data : void 0).embeddings;
|
|
347
|
+
const said = raw?.retrieval?.embeddings?.model;
|
|
348
|
+
return {
|
|
349
|
+
model: e.model,
|
|
350
|
+
...e.runtime ? { runtime: e.runtime } : {},
|
|
351
|
+
configured: r?.success === true && said !== void 0
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
async function embeddingState(root) {
|
|
355
|
+
const s = await settingsOf(root);
|
|
356
|
+
const configured = s.configured;
|
|
357
|
+
if (embeddingsOffByEnv())
|
|
358
|
+
return { setting: "off", configured, problem: "ATTICUS_EMBEDDINGS is off for this process" };
|
|
359
|
+
if (s.model === "off")
|
|
360
|
+
return { setting: "off", configured, problem: "retrieval.embeddings.model is off" };
|
|
361
|
+
const base = orgPackDirOf(root);
|
|
362
|
+
const runtimeDir = s.runtime ? resolve(base, s.runtime) : void 0;
|
|
363
|
+
const dir = s.model === "bundled" ? bundledModelDir(runtimeDir) : isAbsolute(s.model) ? s.model : resolve(base, s.model);
|
|
364
|
+
if (!dir)
|
|
365
|
+
return {
|
|
366
|
+
setting: s.model,
|
|
367
|
+
configured,
|
|
368
|
+
problem: "the bundled model (@maycombhq/embed-model) isn't installed"
|
|
369
|
+
};
|
|
370
|
+
const info = await modelInfo(dir);
|
|
371
|
+
if (!info.ok)
|
|
372
|
+
return { setting: s.model, configured, dir, problem: info.problem };
|
|
373
|
+
return {
|
|
374
|
+
setting: s.model,
|
|
375
|
+
configured,
|
|
376
|
+
dir,
|
|
377
|
+
id: `${info.manifest.name}@${info.manifest.sha256.slice(0, 12)}`,
|
|
378
|
+
bytes: info.bytes,
|
|
379
|
+
licence: info.manifest.licence
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
async function runtimeAvailable(root) {
|
|
383
|
+
const s = await settingsOf(root);
|
|
384
|
+
const dir = s.runtime ? resolve(orgPackDirOf(root), s.runtime) : void 0;
|
|
385
|
+
const req = createRequire2(dir ? join2(dir, "noop.js") : __atticus_import_meta_url2);
|
|
386
|
+
for (const kind of ["native", "wasm"])
|
|
387
|
+
for (const name of runtimePackages(kind)) {
|
|
388
|
+
const d = packageDir(req, name);
|
|
389
|
+
if (d && existsSync2(join2(d, "dist", kind === "native" ? "index.js" : "ort.wasm.min.mjs")))
|
|
390
|
+
return kind;
|
|
391
|
+
}
|
|
392
|
+
return void 0;
|
|
393
|
+
}
|
|
394
|
+
async function embedderFor(root) {
|
|
395
|
+
const state = await embeddingState(root);
|
|
396
|
+
if (!state.dir || state.problem)
|
|
397
|
+
return { state };
|
|
398
|
+
const s = await settingsOf(root);
|
|
399
|
+
const runtimeDir = s.runtime ? resolve(orgPackDirOf(root), s.runtime) : void 0;
|
|
400
|
+
try {
|
|
401
|
+
return {
|
|
402
|
+
embedder: await OnnxEmbedder.open(state.dir, runtimeDir ? { runtimeDir } : {}),
|
|
403
|
+
state
|
|
404
|
+
};
|
|
405
|
+
} catch (e) {
|
|
406
|
+
return {
|
|
407
|
+
state: {
|
|
408
|
+
...state,
|
|
409
|
+
problem: `the model in ${state.dir} couldn't be opened: ${e.message.split("\n")[0]}`
|
|
410
|
+
}
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
// packages/embed/dist/pinned.js
|
|
416
|
+
import { createHash as createHash2 } from "node:crypto";
|
|
417
|
+
import { mkdir, readFile as readFile3, rename, writeFile } from "node:fs/promises";
|
|
418
|
+
import { dirname as dirname2, join as join3 } from "node:path";
|
|
419
|
+
var sha256Of = (b) => createHash2("sha256").update(b).digest("hex");
|
|
420
|
+
var PinError = class extends Error {
|
|
421
|
+
name = "PinError";
|
|
422
|
+
};
|
|
423
|
+
function checkPinned(bytes, sha256, what) {
|
|
424
|
+
const got = sha256Of(bytes);
|
|
425
|
+
if (got !== sha256)
|
|
426
|
+
throw new PinError(`${what} has sha256 ${got}, not the pinned ${sha256}: refused`);
|
|
427
|
+
}
|
|
428
|
+
var httpGet = async (url) => {
|
|
429
|
+
const r = await fetch(url, { redirect: "follow" });
|
|
430
|
+
if (!r.ok)
|
|
431
|
+
throw new PinError(`${url}: HTTP ${r.status}`);
|
|
432
|
+
return new Uint8Array(await r.arrayBuffer());
|
|
433
|
+
};
|
|
434
|
+
async function fetchSource(src, o) {
|
|
435
|
+
const file = join3(o.cacheDir, src.sha256);
|
|
436
|
+
const kept = await readFile3(file).catch(() => void 0);
|
|
437
|
+
if (kept && sha256Of(kept) === src.sha256)
|
|
438
|
+
return { bytes: kept, cached: true };
|
|
439
|
+
if (o.offline)
|
|
440
|
+
throw new PinError(`${src.url} isn't in the cache and this run may not download`);
|
|
441
|
+
const bytes = await (o.get ?? httpGet)(src.url);
|
|
442
|
+
checkPinned(bytes, src.sha256, src.url);
|
|
443
|
+
await mkdir(o.cacheDir, { recursive: true });
|
|
444
|
+
await writeFile(`${file}.part`, bytes);
|
|
445
|
+
await rename(`${file}.part`, file);
|
|
446
|
+
return { bytes, cached: false };
|
|
447
|
+
}
|
|
448
|
+
async function materialize(dir, pins, o) {
|
|
449
|
+
const downloaded = [];
|
|
450
|
+
const bySource = /* @__PURE__ */ new Map();
|
|
451
|
+
const sourceBytes = async (name) => {
|
|
452
|
+
let b = bySource.get(name);
|
|
453
|
+
if (b)
|
|
454
|
+
return b;
|
|
455
|
+
const src = pins.sources[name];
|
|
456
|
+
if (!src)
|
|
457
|
+
throw new PinError(`pins.json names no source ${name}`);
|
|
458
|
+
const r = await fetchSource(src, o);
|
|
459
|
+
if (!r.cached)
|
|
460
|
+
downloaded.push(src.url);
|
|
461
|
+
bySource.set(name, b = r.bytes);
|
|
462
|
+
return b;
|
|
463
|
+
};
|
|
464
|
+
const archives = /* @__PURE__ */ new Map();
|
|
465
|
+
const written = [];
|
|
466
|
+
for (const f of pins.files) {
|
|
467
|
+
if (f.path.split(/[\\/]/).includes(".."))
|
|
468
|
+
throw new PinError(`${f.path} leaves the package`);
|
|
469
|
+
let bytes;
|
|
470
|
+
if (f.entry) {
|
|
471
|
+
let a = archives.get(f.source);
|
|
472
|
+
if (!a)
|
|
473
|
+
archives.set(f.source, a = readTarGz(await sourceBytes(f.source), {
|
|
474
|
+
maxEntries: 2e4,
|
|
475
|
+
maxEntryBytes: 256 * 1024 * 1024,
|
|
476
|
+
maxTotalBytes: 1024 * 1024 * 1024
|
|
477
|
+
}));
|
|
478
|
+
const e = a.read(f.entry);
|
|
479
|
+
if (!e)
|
|
480
|
+
throw new PinError(`${f.source} has no ${f.entry}`);
|
|
481
|
+
bytes = e;
|
|
482
|
+
} else
|
|
483
|
+
bytes = await sourceBytes(f.source);
|
|
484
|
+
checkPinned(bytes, f.sha256, f.path);
|
|
485
|
+
const out = join3(dir, ...f.path.split("/"));
|
|
486
|
+
const was = await readFile3(out).catch(() => void 0);
|
|
487
|
+
if (!was || sha256Of(was) !== f.sha256) {
|
|
488
|
+
await mkdir(dirname2(out), { recursive: true });
|
|
489
|
+
await writeFile(out, bytes);
|
|
490
|
+
}
|
|
491
|
+
written.push(f.path);
|
|
492
|
+
}
|
|
493
|
+
return { written, downloaded };
|
|
494
|
+
}
|
|
495
|
+
async function checkMaterialized(dir, pins) {
|
|
496
|
+
const bad = [];
|
|
497
|
+
for (const f of pins.files) {
|
|
498
|
+
const b = await readFile3(join3(dir, ...f.path.split("/"))).catch(() => void 0);
|
|
499
|
+
if (!b || sha256Of(b) !== f.sha256)
|
|
500
|
+
bad.push(f.path);
|
|
501
|
+
}
|
|
502
|
+
return bad;
|
|
503
|
+
}
|
|
504
|
+
export {
|
|
505
|
+
MODEL_MANIFEST,
|
|
506
|
+
ModelManifest,
|
|
507
|
+
OnnxEmbedder,
|
|
508
|
+
PinError,
|
|
509
|
+
bundledModelDir,
|
|
510
|
+
checkMaterialized,
|
|
511
|
+
checkPinned,
|
|
512
|
+
embedderFor,
|
|
513
|
+
embeddingState,
|
|
514
|
+
embeddingsOffByEnv,
|
|
515
|
+
encode,
|
|
516
|
+
fetchSource,
|
|
517
|
+
fileSha256,
|
|
518
|
+
httpGet,
|
|
519
|
+
installedModelDir,
|
|
520
|
+
materialize,
|
|
521
|
+
modelInfo,
|
|
522
|
+
normalize,
|
|
523
|
+
packageDir,
|
|
524
|
+
preTokenize,
|
|
525
|
+
readModelManifest,
|
|
526
|
+
runtimeAvailable,
|
|
527
|
+
runtimePackages,
|
|
528
|
+
sha256Of,
|
|
529
|
+
wordPieceConfig,
|
|
530
|
+
wordPieces
|
|
531
|
+
};
|