@unbrained/pm-cli 2026.7.15 → 2026.7.17
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/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +23 -2
- package/CONTRIBUTING.md +2 -2
- package/dist/cli/bootstrap-args.d.ts +2 -115
- package/dist/cli/bootstrap-args.js +4 -831
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/commands/eval.d.ts +4 -64
- package/dist/cli/commands/eval.js +4 -153
- package/dist/cli/commands/eval.js.map +1 -1
- package/dist/cli/commands/linked-test-entry.d.ts +6 -6
- package/dist/cli/commands/linked-test-entry.js +4 -65
- package/dist/cli/commands/linked-test-entry.js.map +1 -1
- package/dist/cli/commands/linked-test-parsers.d.ts +3 -45
- package/dist/cli/commands/linked-test-parsers.js +4 -516
- package/dist/cli/commands/linked-test-parsers.js.map +1 -1
- package/dist/cli/commands/list.d.ts +3 -210
- package/dist/cli/commands/list.js +4 -1068
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/search.d.ts +3 -464
- package/dist/cli/commands/search.js +4 -2236
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/stats.d.ts +6 -66
- package/dist/cli/commands/stats.js +4 -157
- package/dist/cli/commands/stats.js.map +1 -1
- package/dist/cli/commands/telemetry.d.ts +6 -14
- package/dist/cli/commands/telemetry.js +4 -349
- package/dist/cli/commands/telemetry.js.map +1 -1
- package/dist/cli/commands/test-all.d.ts +6 -95
- package/dist/cli/commands/test-all.js +4 -439
- package/dist/cli/commands/test-all.js.map +1 -1
- package/dist/cli/commands/test-runs.d.ts +6 -92
- package/dist/cli/commands/test-runs.js +4 -189
- package/dist/cli/commands/test-runs.js.map +1 -1
- package/dist/cli/commands/test.d.ts +6 -244
- package/dist/cli/commands/test.js +4 -1780
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/update-many.d.ts +15 -29
- package/dist/cli/commands/update-many.js +355 -259
- package/dist/cli/commands/update-many.js.map +1 -1
- package/dist/cli/main.js +140 -133
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/search-refresh.js +4 -9
- package/dist/cli/search-refresh.js.map +1 -1
- package/dist/cli/shared-parsers.d.ts +6 -9
- package/dist/cli/shared-parsers.js +4 -37
- package/dist/cli/shared-parsers.js.map +1 -1
- package/dist/cli/telemetry-flush.js +4 -4
- package/dist/cli/telemetry-flush.js.map +1 -1
- package/dist/cli-bundle/bundle-manifest.json +341 -341
- package/dist/cli-bundle/chunks/{append-OJQFUQ4T.js → append-5YF3TO7I.js} +5 -5
- package/dist/cli-bundle/chunks/append-JHO5K6RP.js +11 -0
- package/dist/cli-bundle/chunks/{chunk-WT3ZEOGH.js → chunk-23TCGBRK.js} +16 -7
- package/dist/cli-bundle/chunks/{chunk-WT3ZEOGH.js.map → chunk-23TCGBRK.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-BCOFWYW4.js → chunk-2BX74BAS.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-APRVSW2O.js → chunk-2CXL335K.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-KG44YSKD.js → chunk-2FUOXSRN.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-HDH3JUGG.js → chunk-2IPNL3DR.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-J6364LFM.js → chunk-2MPMKJF2.js} +9 -18
- package/dist/cli-bundle/chunks/{chunk-J6364LFM.js.map → chunk-2MPMKJF2.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-GM5QHQU6.js → chunk-2XOSFSTH.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-K3WII2ME.js → chunk-37DRDP2B.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-2WSE6PO2.js → chunk-37V5MXAU.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-UWQHLMEB.js → chunk-3D4YVTNG.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-PMOSXADO.js → chunk-47HXN6RX.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-6CFNAVTF.js → chunk-5HGZKQUL.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-2IFFUZLC.js → chunk-5UKQLQM2.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-DM4H7FP4.js → chunk-633PKXLT.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-XSJUSQAE.js → chunk-646MQXFW.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZI6VQWQ7.js → chunk-66MKH7SZ.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-S6MQESFR.js → chunk-67RO3H4N.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-34L5OT3Y.js → chunk-6DYOZS6C.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RRM5JYJC.js → chunk-6O44IN44.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ONG5V5CI.js → chunk-6XAZB6SE.js} +97 -69
- package/dist/cli-bundle/chunks/chunk-6XAZB6SE.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-PENXZX3U.js → chunk-74FKFFXO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-LPYWLWDS.js → chunk-7CTQ7WW5.js} +37 -37
- package/dist/cli-bundle/chunks/chunk-7CTQ7WW5.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-HO4KXD6I.js → chunk-7H5NNCJ5.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-XXXF6PAQ.js → chunk-7LTCLTRG.js} +69 -61
- package/dist/cli-bundle/chunks/chunk-7LTCLTRG.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-TQSZFPIS.js → chunk-AFGKSHAM.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-JXQUXVMI.js → chunk-AFSV5HBB.js} +77 -7
- package/dist/cli-bundle/chunks/{chunk-JXQUXVMI.js.map → chunk-AFSV5HBB.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-6N2VXVTQ.js → chunk-ARGDWQ4J.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3U7ZR6M4.js → chunk-B57RJHBZ.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-7B67ZL4N.js → chunk-B6SH2YNN.js} +75 -5
- package/dist/cli-bundle/chunks/{chunk-7B67ZL4N.js.map → chunk-B6SH2YNN.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-YCQET3OT.js → chunk-BAP7G3N2.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QKXHFPYM.js → chunk-BIRYX32V.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-RMLWNPH2.js → chunk-BVLOMU6O.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-YBLZ2VE7.js → chunk-CFSUNEL7.js} +320 -239
- package/dist/cli-bundle/chunks/chunk-CFSUNEL7.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-2VPAVL7O.js → chunk-CKX4WOPC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TKOVBP6C.js → chunk-D52ZN3BF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KPMKHGEA.js → chunk-D53RTYVI.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-ODALILG3.js → chunk-D5XHO4Q7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-E2OJMKML.js → chunk-DCC2AQBD.js} +18 -9
- package/dist/cli-bundle/chunks/{chunk-E2OJMKML.js.map → chunk-DCC2AQBD.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-YAQEBNY7.js → chunk-DDFGYUCQ.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-EAB64KLB.js → chunk-DG2EQRIH.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-IG3SWA4A.js → chunk-EHJFUOXL.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-ONREO4ST.js → chunk-EY7ZE3TG.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-EJEXHTY5.js → chunk-FHOBCGQO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-H3EIEWGR.js → chunk-FL4D53ND.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WUJQK4YV.js → chunk-FVNWHUME.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-INU6DKT5.js → chunk-FXFCFL73.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-QEHQ2GVG.js → chunk-FY4RLHSC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-EACOH7AU.js → chunk-FZGM3PNA.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-FNSPG7MU.js → chunk-G6KM4YKY.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-AHVTB5I5.js → chunk-G6MYGULG.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-TSMHDIW4.js → chunk-GLZKZON6.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-2JKGO6QX.js → chunk-H5IOT54C.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-5ZSLZLDN.js → chunk-HF63SBLC.js} +585 -456
- package/dist/cli-bundle/chunks/chunk-HF63SBLC.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-SELVXEZK.js → chunk-HO4DLBNK.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3CLU2XZO.js → chunk-HSYV4ZYT.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-EH2OPHBI.js → chunk-HTXXXF45.js} +23 -19
- package/dist/cli-bundle/chunks/chunk-HTXXXF45.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-CRVF2JDM.js → chunk-HXVHBERL.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-NU3IMIEA.js → chunk-I7DIDUSP.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-2NCIPMQP.js → chunk-I7GY4X6Y.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JYFOV7FC.js → chunk-IE5KRAKN.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-UY2ACEMF.js → chunk-ILVOOAT4.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-GOSLKLFE.js → chunk-KH6QAHME.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-J6EY5V4N.js → chunk-KOEZCHRF.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-QKECXBBG.js → chunk-KX62NMZC.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-QKECXBBG.js.map → chunk-KX62NMZC.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-WQPUU7XD.js → chunk-L337QKWJ.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-LSG2U345.js → chunk-L6FVNR7X.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-ILX33QXL.js → chunk-LLODAQMP.js} +706 -532
- package/dist/cli-bundle/chunks/chunk-LLODAQMP.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-FMBNM2EN.js → chunk-LSOWTLEM.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4223PVZT.js → chunk-M7MVOKVV.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-MNV226E4.js +834 -0
- package/dist/cli-bundle/chunks/chunk-MNV226E4.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-UMOPHQSU.js → chunk-MR4SHYR4.js} +41 -19
- package/dist/cli-bundle/chunks/chunk-MR4SHYR4.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-BKVG6XOA.js → chunk-MSGETE6I.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-3WM75PWC.js → chunk-N33FD2UI.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-UFXU44HV.js → chunk-N7I2DGLP.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-3S5QVM5H.js → chunk-NCAFUBJX.js} +13 -13
- package/dist/cli-bundle/chunks/chunk-NCAFUBJX.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-6S3YSUYG.js → chunk-NNANAWFH.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-IJIICKVW.js → chunk-NTRQLE2R.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SDQLJWBO.js → chunk-NVZ6NVHJ.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-H2Z3FYXQ.js → chunk-OWP6QFBV.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-Q7A43DS4.js → chunk-P22HGFFI.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NLDFBC6J.js → chunk-P56LKFQX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NVPZIJVR.js → chunk-PT7MCCGD.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-P74IZQ7A.js → chunk-QKVVV6QO.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-5JLUII3O.js → chunk-QNUAZYGW.js} +321 -240
- package/dist/cli-bundle/chunks/chunk-QNUAZYGW.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-QIPLHNP7.js → chunk-QWBKN3QC.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-7PIWCHTW.js → chunk-R5XTTZSJ.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-JOUQZENX.js → chunk-RC4UOUXA.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-BEP7WJA2.js → chunk-RGMWJLXF.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-NP22ERDF.js → chunk-RTBX3C4C.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-HYB5AZ63.js → chunk-S46R2M3W.js} +117 -71
- package/dist/cli-bundle/chunks/chunk-S46R2M3W.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-H5APFTHZ.js → chunk-S6FF7VW6.js} +18 -18
- package/dist/cli-bundle/chunks/chunk-S6FF7VW6.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-UXONS674.js → chunk-SIJV365F.js} +54 -55
- package/dist/cli-bundle/chunks/chunk-SIJV365F.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-7Z4LKRS4.js → chunk-SPFZV2GR.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-ULTHRDBP.js → chunk-TM5CIO3F.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-4XQ3BDV4.js → chunk-V3VBXQQV.js} +36 -36
- package/dist/cli-bundle/chunks/chunk-V3VBXQQV.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-YAROI3PD.js → chunk-V7MP6YTN.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-OW4JWD5M.js → chunk-VAHZIPWS.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-DYH63FX7.js → chunk-VE6ZSTQW.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-3AUGG2DP.js → chunk-W5E2UUSH.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-BSEQUTQP.js → chunk-WACRQ26A.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-BSEQUTQP.js.map → chunk-WACRQ26A.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-UOHFKBUV.js → chunk-WL3SS45P.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-QKJGPFAF.js → chunk-WU3KAN6A.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-IA5FKNII.js → chunk-X2MGQMZO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TD3LVC7D.js → chunk-X5YCTFKT.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-B7PE22W6.js → chunk-XC2HEEOV.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-J5AOEGDC.js → chunk-XNPMDSQQ.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-K2X6U4UA.js → chunk-XXLXJL7V.js} +4 -4
- package/dist/cli-bundle/chunks/chunk-XYJK6GIQ.js +851 -0
- package/dist/cli-bundle/chunks/chunk-XYJK6GIQ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-RLCHOOHC.js → chunk-YJSURTBB.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-PGY23YTC.js → chunk-YKFHF37B.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-JFTKLTEF.js → chunk-YQCWK2MB.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-EYLCSJAI.js → chunk-YQEZWI3R.js} +2 -2
- package/dist/cli-bundle/chunks/close-BEP7MHF3.js +12 -0
- package/dist/cli-bundle/chunks/{close-CWODTPKG.js → close-Y6QFUJQN.js} +5 -5
- package/dist/cli-bundle/chunks/{close-many-CQFUY7MR.js → close-many-JJFW7KTT.js} +14 -14
- package/dist/cli-bundle/chunks/close-many-QJ6FKJUE.js +23 -0
- package/dist/cli-bundle/chunks/comments-2AOZQ5D2.js +13 -0
- package/dist/cli-bundle/chunks/{comments-WGLHR7LB.js → comments-TMHMALA5.js} +7 -7
- package/dist/cli-bundle/chunks/{copy-LXVDXH7B.js → copy-FWQA5OU4.js} +4 -4
- package/dist/cli-bundle/chunks/copy-N3LCQBMC.js +9 -0
- package/dist/cli-bundle/chunks/{create-LBVCYMEG.js → create-AQ5SIGZC.js} +9 -9
- package/dist/cli-bundle/chunks/{create-J5U6ND4K.js → create-KOGQ3JKD.js} +9 -9
- package/dist/cli-bundle/chunks/delete-6G3MBZ6S.js +10 -0
- package/dist/cli-bundle/chunks/{delete-PMJBNY5G.js → delete-YYYFOSEA.js} +4 -4
- package/dist/cli-bundle/chunks/{deps-OA26IS25.js → deps-5NC4IZH7.js} +5 -5
- package/dist/cli-bundle/chunks/{deps-JZ7TMVCB.js → deps-EVTOQMKW.js} +5 -5
- package/dist/cli-bundle/chunks/{docs-FEWB2DQB.js → docs-53NUGMIQ.js} +6 -6
- package/dist/cli-bundle/chunks/docs-OWRGDMNY.js +14 -0
- package/dist/cli-bundle/chunks/{files-EFIWKFTM.js → files-3PXGXYDB.js} +6 -6
- package/dist/cli-bundle/chunks/{files-6YFBJRBG.js → files-EGLKHD7O.js} +6 -6
- package/dist/cli-bundle/chunks/focus-KZLIA6WS.js +10 -0
- package/dist/cli-bundle/chunks/{focus-4QJR7FOQ.js → focus-SRPASFTN.js} +5 -5
- package/dist/cli-bundle/chunks/{history-compact-CKRPDTJN.js → history-compact-G4DULDCX.js} +6 -6
- package/dist/cli-bundle/chunks/history-compact-HHIUOMZ7.js +16 -0
- package/dist/cli-bundle/chunks/{history-redact-BB3TGDAE.js → history-redact-IUSJ6X3E.js} +4 -4
- package/dist/cli-bundle/chunks/{history-redact-D225BHOZ.js → history-redact-THHGRQXV.js} +4 -4
- package/dist/cli-bundle/chunks/history-repair-KG7SWXI6.js +16 -0
- package/dist/cli-bundle/chunks/{history-repair-RQXKQHL4.js → history-repair-LUQWRS7X.js} +6 -6
- package/dist/cli-bundle/chunks/{learnings-JLNLCOL5.js → learnings-2MRNBFJF.js} +7 -7
- package/dist/cli-bundle/chunks/learnings-ZVHSALJY.js +13 -0
- package/dist/cli-bundle/chunks/{notes-GB47XXQQ.js → notes-73JWKWUD.js} +7 -7
- package/dist/cli-bundle/chunks/notes-BAKUL5DJ.js +13 -0
- package/dist/cli-bundle/chunks/{plan-VDCJ2PCN.js → plan-AZPMCG37.js} +10 -10
- package/dist/cli-bundle/chunks/plan-LEAGLPGP.js +24 -0
- package/dist/cli-bundle/chunks/{profile-IVXQEL3D.js → profile-AGUKS52S.js} +9 -9
- package/dist/cli-bundle/chunks/{profile-FAU7NZML.js → profile-U2B6Y7GE.js} +9 -9
- package/dist/cli-bundle/chunks/{register-list-query-UL4UKBBN.js → register-list-query-A5KRJ5J2.js} +16 -16
- package/dist/cli-bundle/chunks/{register-list-query-DKA3EH5D.js → register-list-query-NEYP3TXO.js} +16 -16
- package/dist/cli-bundle/chunks/{register-mutation-RBBJ52DK.js → register-mutation-6LOPBAHC.js} +29 -29
- package/dist/cli-bundle/chunks/{register-mutation-ARFHRW55.js → register-mutation-GCZOALNJ.js} +29 -29
- package/dist/cli-bundle/chunks/{register-operations-ZIBBRSED.js → register-operations-6ZZIF27A.js} +35 -35
- package/dist/cli-bundle/chunks/{register-operations-ZUJ5JWPE.js → register-operations-REDIAEGI.js} +35 -35
- package/dist/cli-bundle/chunks/{register-setup-TDCGWIOS.js → register-setup-BHPMN5SK.js} +15 -15
- package/dist/cli-bundle/chunks/{register-setup-BCVLFEYS.js → register-setup-J3JS2ZVT.js} +15 -15
- package/dist/cli-bundle/chunks/{restore-25DLT2Q2.js → restore-E3PRGDN3.js} +6 -6
- package/dist/cli-bundle/chunks/restore-KIUYTAEJ.js +14 -0
- package/dist/cli-bundle/chunks/{schema-FNU3WE4O.js → schema-5JNFQFUW.js} +6 -6
- package/dist/cli-bundle/chunks/{schema-NBCM3RAD.js → schema-TMIW4XZC.js} +6 -6
- package/dist/cli-bundle/chunks/update-PQQHLYCC.js +21 -0
- package/dist/cli-bundle/chunks/{update-XHSIAIXE.js → update-SA6AG23P.js} +12 -12
- package/dist/cli-bundle/chunks/update-many-RQVTFJPD.js +36 -0
- package/dist/cli-bundle/chunks/update-many-TV3L3KBX.js +32 -0
- package/dist/cli-bundle/main.js +153 -855
- package/dist/cli-bundle/main.js.map +4 -4
- package/dist/cli-bundle/sdk-runtime.js +54 -54
- package/dist/cli-bundle/sdk-testing.js +6 -6
- package/dist/cli-bundle/sdk.js +195 -59
- package/dist/cli-bundle/sdk.js.map +3 -3
- package/dist/core/extensions/item-fields.js +2 -2
- package/dist/core/extensions/item-fields.js.map +1 -1
- package/dist/sdk/cli-bootstrap.d.ts +122 -0
- package/dist/sdk/cli-bootstrap.js +879 -0
- package/dist/sdk/cli-bootstrap.js.map +1 -0
- package/dist/sdk/eval.d.ts +66 -0
- package/dist/sdk/eval.js +186 -0
- package/dist/sdk/eval.js.map +1 -0
- package/dist/sdk/index.d.ts +16 -4
- package/dist/sdk/index.js +18 -6
- package/dist/sdk/index.js.map +1 -1
- package/dist/{cli/commands → sdk/query}/item-filter-options.d.ts +1 -1
- package/dist/{cli/commands → sdk/query}/item-filter-options.js +3 -3
- package/dist/sdk/query/item-filter-options.js.map +1 -0
- package/dist/sdk/query/list.d.ts +254 -0
- package/dist/sdk/query/list.js +1073 -0
- package/dist/sdk/query/list.js.map +1 -0
- package/dist/sdk/query/parsers.d.ts +9 -0
- package/dist/sdk/query/parsers.js +45 -0
- package/dist/sdk/query/parsers.js.map +1 -0
- package/dist/{cli/commands → sdk/query}/search-pagination.js +4 -4
- package/dist/sdk/query/search-pagination.js.map +1 -0
- package/dist/{cli/commands → sdk/query}/search-rendering.js +3 -3
- package/dist/sdk/query/search-rendering.js.map +1 -0
- package/dist/sdk/query/search.d.ts +469 -0
- package/dist/sdk/query/search.js +2247 -0
- package/dist/sdk/query/search.js.map +1 -0
- package/dist/sdk/runtime.d.ts +7 -7
- package/dist/sdk/runtime.js +13 -7
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/sdk/search-refresh-worker.d.ts +2 -0
- package/dist/sdk/search-refresh-worker.js +19 -0
- package/dist/sdk/search-refresh-worker.js.map +1 -0
- package/dist/sdk/stats.d.ts +66 -0
- package/dist/sdk/stats.js +151 -0
- package/dist/sdk/stats.js.map +1 -0
- package/dist/sdk/telemetry-flush.d.ts +2 -0
- package/dist/sdk/telemetry-flush.js +14 -0
- package/dist/sdk/telemetry-flush.js.map +1 -0
- package/dist/sdk/telemetry.d.ts +14 -0
- package/dist/sdk/telemetry.js +398 -0
- package/dist/sdk/telemetry.js.map +1 -0
- package/dist/sdk/test/batch.d.ts +94 -0
- package/dist/sdk/test/batch.js +492 -0
- package/dist/sdk/test/batch.js.map +1 -0
- package/dist/sdk/test/entry.d.ts +6 -0
- package/dist/sdk/test/entry.js +74 -0
- package/dist/sdk/test/entry.js.map +1 -0
- package/dist/sdk/test/execution.d.ts +282 -0
- package/dist/sdk/test/execution.js +1817 -0
- package/dist/sdk/test/execution.js.map +1 -0
- package/dist/sdk/test/parsers.d.ts +48 -0
- package/dist/sdk/test/parsers.js +522 -0
- package/dist/sdk/test/parsers.js.map +1 -0
- package/dist/sdk/test/runs.d.ts +92 -0
- package/dist/sdk/test/runs.js +195 -0
- package/dist/sdk/test/runs.js.map +1 -0
- package/docs/SDK.md +122 -0
- package/docs/SDK_PRIMITIVE_INVENTORY.md +5 -3
- package/docs/examples/sdk-custom-tool/README.md +27 -0
- package/docs/examples/sdk-custom-tool/package.json +13 -0
- package/docs/examples/sdk-custom-tool/src/cli.ts +36 -0
- package/docs/examples/sdk-custom-tool/src/entry.ts +15 -0
- package/docs/examples/sdk-custom-tool/src/index.ts +223 -0
- package/marketplace.json +2 -2
- package/package.json +4 -4
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-governance-audit/extensions/governance-audit/comments-audit.ts +77 -57
- package/packages/pm-governance-audit/extensions/governance-audit/dedupe-audit.ts +202 -194
- package/packages/pm-governance-audit/extensions/governance-audit/dedupe-merge.ts +227 -153
- package/packages/pm-governance-audit/extensions/governance-audit/normalize.ts +169 -125
- package/packages/pm-governance-audit/extensions/governance-audit/runtime-utils.ts +130 -81
- package/packages/pm-governance-audit/extensions/governance-audit/sdk.ts +53 -4
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/dist/cli/commands/item-filter-options.js.map +0 -1
- package/dist/cli/commands/search-pagination.js.map +0 -1
- package/dist/cli/commands/search-rendering.js.map +0 -1
- package/dist/cli-bundle/chunks/append-UZVHUO74.js +0 -11
- package/dist/cli-bundle/chunks/chunk-3S5QVM5H.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-4XQ3BDV4.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5JLUII3O.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5ZSLZLDN.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-EH2OPHBI.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-H5APFTHZ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HYB5AZ63.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ILX33QXL.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-LPYWLWDS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ONG5V5CI.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-UMOPHQSU.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-UXONS674.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-XXXF6PAQ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-YBLZ2VE7.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-YXSHIAUJ.js +0 -58
- package/dist/cli-bundle/chunks/chunk-YXSHIAUJ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ZKRZY773.js +0 -68
- package/dist/cli-bundle/chunks/chunk-ZKRZY773.js.map +0 -7
- package/dist/cli-bundle/chunks/close-W6LI2PKM.js +0 -12
- package/dist/cli-bundle/chunks/close-many-DLDDVSH5.js +0 -23
- package/dist/cli-bundle/chunks/comments-E3TNTK24.js +0 -13
- package/dist/cli-bundle/chunks/copy-Q5ZJPUKR.js +0 -9
- package/dist/cli-bundle/chunks/delete-WNHB3LYW.js +0 -10
- package/dist/cli-bundle/chunks/docs-HA2AIDBB.js +0 -14
- package/dist/cli-bundle/chunks/focus-POIW5LTJ.js +0 -10
- package/dist/cli-bundle/chunks/history-compact-FWG2C7FZ.js +0 -16
- package/dist/cli-bundle/chunks/history-repair-6GEAM7HE.js +0 -16
- package/dist/cli-bundle/chunks/learnings-RSNLSWDC.js +0 -13
- package/dist/cli-bundle/chunks/notes-2WDH6DXU.js +0 -13
- package/dist/cli-bundle/chunks/plan-DOVI2VMW.js +0 -24
- package/dist/cli-bundle/chunks/restore-YPMVUUEX.js +0 -14
- package/dist/cli-bundle/chunks/update-WWBYOPXO.js +0 -21
- package/dist/cli-bundle/chunks/update-many-OUGIU5SF.js +0 -32
- package/dist/cli-bundle/chunks/update-many-TA7NGQBO.js +0 -36
- /package/dist/cli-bundle/chunks/{append-OJQFUQ4T.js.map → append-5YF3TO7I.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-UZVHUO74.js.map → append-JHO5K6RP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BCOFWYW4.js.map → chunk-2BX74BAS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-APRVSW2O.js.map → chunk-2CXL335K.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KG44YSKD.js.map → chunk-2FUOXSRN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HDH3JUGG.js.map → chunk-2IPNL3DR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GM5QHQU6.js.map → chunk-2XOSFSTH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-K3WII2ME.js.map → chunk-37DRDP2B.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2WSE6PO2.js.map → chunk-37V5MXAU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UWQHLMEB.js.map → chunk-3D4YVTNG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PMOSXADO.js.map → chunk-47HXN6RX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6CFNAVTF.js.map → chunk-5HGZKQUL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2IFFUZLC.js.map → chunk-5UKQLQM2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DM4H7FP4.js.map → chunk-633PKXLT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XSJUSQAE.js.map → chunk-646MQXFW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZI6VQWQ7.js.map → chunk-66MKH7SZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-S6MQESFR.js.map → chunk-67RO3H4N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-34L5OT3Y.js.map → chunk-6DYOZS6C.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RRM5JYJC.js.map → chunk-6O44IN44.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PENXZX3U.js.map → chunk-74FKFFXO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HO4KXD6I.js.map → chunk-7H5NNCJ5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TQSZFPIS.js.map → chunk-AFGKSHAM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6N2VXVTQ.js.map → chunk-ARGDWQ4J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3U7ZR6M4.js.map → chunk-B57RJHBZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YCQET3OT.js.map → chunk-BAP7G3N2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QKXHFPYM.js.map → chunk-BIRYX32V.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RMLWNPH2.js.map → chunk-BVLOMU6O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2VPAVL7O.js.map → chunk-CKX4WOPC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TKOVBP6C.js.map → chunk-D52ZN3BF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KPMKHGEA.js.map → chunk-D53RTYVI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ODALILG3.js.map → chunk-D5XHO4Q7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YAQEBNY7.js.map → chunk-DDFGYUCQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EAB64KLB.js.map → chunk-DG2EQRIH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IG3SWA4A.js.map → chunk-EHJFUOXL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ONREO4ST.js.map → chunk-EY7ZE3TG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EJEXHTY5.js.map → chunk-FHOBCGQO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-H3EIEWGR.js.map → chunk-FL4D53ND.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WUJQK4YV.js.map → chunk-FVNWHUME.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-INU6DKT5.js.map → chunk-FXFCFL73.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QEHQ2GVG.js.map → chunk-FY4RLHSC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EACOH7AU.js.map → chunk-FZGM3PNA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FNSPG7MU.js.map → chunk-G6KM4YKY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AHVTB5I5.js.map → chunk-G6MYGULG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TSMHDIW4.js.map → chunk-GLZKZON6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2JKGO6QX.js.map → chunk-H5IOT54C.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SELVXEZK.js.map → chunk-HO4DLBNK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3CLU2XZO.js.map → chunk-HSYV4ZYT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CRVF2JDM.js.map → chunk-HXVHBERL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NU3IMIEA.js.map → chunk-I7DIDUSP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2NCIPMQP.js.map → chunk-I7GY4X6Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JYFOV7FC.js.map → chunk-IE5KRAKN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UY2ACEMF.js.map → chunk-ILVOOAT4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GOSLKLFE.js.map → chunk-KH6QAHME.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-J6EY5V4N.js.map → chunk-KOEZCHRF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WQPUU7XD.js.map → chunk-L337QKWJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LSG2U345.js.map → chunk-L6FVNR7X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FMBNM2EN.js.map → chunk-LSOWTLEM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4223PVZT.js.map → chunk-M7MVOKVV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BKVG6XOA.js.map → chunk-MSGETE6I.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3WM75PWC.js.map → chunk-N33FD2UI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UFXU44HV.js.map → chunk-N7I2DGLP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6S3YSUYG.js.map → chunk-NNANAWFH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IJIICKVW.js.map → chunk-NTRQLE2R.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SDQLJWBO.js.map → chunk-NVZ6NVHJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-H2Z3FYXQ.js.map → chunk-OWP6QFBV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Q7A43DS4.js.map → chunk-P22HGFFI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NLDFBC6J.js.map → chunk-P56LKFQX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NVPZIJVR.js.map → chunk-PT7MCCGD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-P74IZQ7A.js.map → chunk-QKVVV6QO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QIPLHNP7.js.map → chunk-QWBKN3QC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7PIWCHTW.js.map → chunk-R5XTTZSJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JOUQZENX.js.map → chunk-RC4UOUXA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BEP7WJA2.js.map → chunk-RGMWJLXF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NP22ERDF.js.map → chunk-RTBX3C4C.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7Z4LKRS4.js.map → chunk-SPFZV2GR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ULTHRDBP.js.map → chunk-TM5CIO3F.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YAROI3PD.js.map → chunk-V7MP6YTN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OW4JWD5M.js.map → chunk-VAHZIPWS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DYH63FX7.js.map → chunk-VE6ZSTQW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3AUGG2DP.js.map → chunk-W5E2UUSH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UOHFKBUV.js.map → chunk-WL3SS45P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QKJGPFAF.js.map → chunk-WU3KAN6A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IA5FKNII.js.map → chunk-X2MGQMZO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TD3LVC7D.js.map → chunk-X5YCTFKT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-B7PE22W6.js.map → chunk-XC2HEEOV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-J5AOEGDC.js.map → chunk-XNPMDSQQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-K2X6U4UA.js.map → chunk-XXLXJL7V.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RLCHOOHC.js.map → chunk-YJSURTBB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PGY23YTC.js.map → chunk-YKFHF37B.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JFTKLTEF.js.map → chunk-YQCWK2MB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EYLCSJAI.js.map → chunk-YQEZWI3R.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-W6LI2PKM.js.map → close-BEP7MHF3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-CWODTPKG.js.map → close-Y6QFUJQN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-CQFUY7MR.js.map → close-many-JJFW7KTT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-DLDDVSH5.js.map → close-many-QJ6FKJUE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-E3TNTK24.js.map → comments-2AOZQ5D2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-WGLHR7LB.js.map → comments-TMHMALA5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-LXVDXH7B.js.map → copy-FWQA5OU4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-Q5ZJPUKR.js.map → copy-N3LCQBMC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-LBVCYMEG.js.map → create-AQ5SIGZC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-J5U6ND4K.js.map → create-KOGQ3JKD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-WNHB3LYW.js.map → delete-6G3MBZ6S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-PMJBNY5G.js.map → delete-YYYFOSEA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-OA26IS25.js.map → deps-5NC4IZH7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-JZ7TMVCB.js.map → deps-EVTOQMKW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-FEWB2DQB.js.map → docs-53NUGMIQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-HA2AIDBB.js.map → docs-OWRGDMNY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-EFIWKFTM.js.map → files-3PXGXYDB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-6YFBJRBG.js.map → files-EGLKHD7O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-POIW5LTJ.js.map → focus-KZLIA6WS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-4QJR7FOQ.js.map → focus-SRPASFTN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-CKRPDTJN.js.map → history-compact-G4DULDCX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-FWG2C7FZ.js.map → history-compact-HHIUOMZ7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-BB3TGDAE.js.map → history-redact-IUSJ6X3E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-D225BHOZ.js.map → history-redact-THHGRQXV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-6GEAM7HE.js.map → history-repair-KG7SWXI6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-RQXKQHL4.js.map → history-repair-LUQWRS7X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-JLNLCOL5.js.map → learnings-2MRNBFJF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-RSNLSWDC.js.map → learnings-ZVHSALJY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-GB47XXQQ.js.map → notes-73JWKWUD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-2WDH6DXU.js.map → notes-BAKUL5DJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-VDCJ2PCN.js.map → plan-AZPMCG37.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-DOVI2VMW.js.map → plan-LEAGLPGP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-IVXQEL3D.js.map → profile-AGUKS52S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-FAU7NZML.js.map → profile-U2B6Y7GE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-list-query-UL4UKBBN.js.map → register-list-query-A5KRJ5J2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-list-query-DKA3EH5D.js.map → register-list-query-NEYP3TXO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-mutation-RBBJ52DK.js.map → register-mutation-6LOPBAHC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-mutation-ARFHRW55.js.map → register-mutation-GCZOALNJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-operations-ZIBBRSED.js.map → register-operations-6ZZIF27A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-operations-ZUJ5JWPE.js.map → register-operations-REDIAEGI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-setup-TDCGWIOS.js.map → register-setup-BHPMN5SK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-setup-BCVLFEYS.js.map → register-setup-J3JS2ZVT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-25DLT2Q2.js.map → restore-E3PRGDN3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-YPMVUUEX.js.map → restore-KIUYTAEJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-FNU3WE4O.js.map → schema-5JNFQFUW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-NBCM3RAD.js.map → schema-TMIW4XZC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-WWBYOPXO.js.map → update-PQQHLYCC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-XHSIAIXE.js.map → update-SA6AG23P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-TA7NGQBO.js.map → update-many-RQVTFJPD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-OUGIU5SF.js.map → update-many-TV3L3KBX.js.map} +0 -0
- /package/dist/{cli/commands → sdk/query}/search-pagination.d.ts +0 -0
- /package/dist/{cli/commands → sdk/query}/search-rendering.d.ts +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../../sdk/relationship-analytics.ts", "../../../../../../../sdk/relationship-history.ts", "../../../../../../../sdk/define.ts", "../../../../../../../sdk/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * @module sdk/relationship-analytics\n *\n * Provides exact, deterministic graph analytics with explicit semantics and\n * provenance suitable for planning, impact analysis, and context selection.\n */\nimport type { RelationshipSnapshot } from \"./relationship-history.js\";\nimport {\n RelationshipGraph,\n RelationshipKindRegistry,\n createRelationshipKindRegistry,\n type RelationshipEdge,\n type RelationshipQueryOptions,\n} from \"./relationships.js\";\n\n/** Exact execution-graph analysis over registered ordering kinds. */\nexport interface RelationshipExecutionAnalysis {\n /** Whether the result is exact rather than sampled or approximate. */\n exact: true;\n /** Whether the order-bearing graph is acyclic. */\n acyclic: boolean;\n /** Deterministic topological order for acyclic nodes. */\n order: string[];\n /** Parallelizable topological layers. */\n layers: string[][];\n /** Nodes with no prerequisites. */\n frontier: string[];\n /** Longest prerequisite distance for each acyclic node. */\n depth: Record<string, number>;\n /** Longest deterministic execution path. */\n criticalPath: string[];\n /** Edge count of the critical path. */\n criticalPathLength: number;\n /** Strongly connected order-bearing components that represent cycles. */\n cycles: string[][];\n /** Semantic provenance for the analysis. */\n provenance: { algorithm: \"kahn-longest-path\"; edgeFamily: \"ordering\" };\n}\n\n/** One affected node with its exact shortest explanation path. */\nexport interface RelationshipImpactRow {\n /** Affected node identifier. */\n id: string;\n /** Shortest relationship distance from the root. */\n distance: number;\n /** Exact path explaining why the node is affected. */\n path: string[];\n}\n\n/** Bounded reverse- or forward-impact result. */\nexport interface RelationshipImpactAnalysis {\n /** Impact origin. */\n root: string;\n /** Deterministic affected-node rows. */\n affected: RelationshipImpactRow[];\n /** Returned rows are exact even when the bounded result is incomplete. */\n exact: true;\n /** Whether configured traversal bounds omitted reachable work. */\n truncated: boolean;\n /** Query work retained for performance and explainability. */\n cost: { visitedNodes: number; inspectedEdges: number };\n}\n\n/** Exact structural summary of the complete graph snapshot. */\nexport interface RelationshipKnowledgeAnalysis {\n /** Weakly connected components, largest then lexicographic. */\n components: string[][];\n /** Strongly connected components over directed stored edges. */\n stronglyConnected: string[][];\n /** Nodes with no relationship edges. */\n orphans: string[];\n /** Maximum-degree nodes and their unique-neighbor degree. */\n hubs: { id: string; degree: number }[];\n /** Whether the result is exact. */\n exact: true;\n /** Semantic provenance for the analysis. */\n provenance: { algorithm: \"component-degree\"; edgeFamily: \"all\" };\n}\n\n/** Edge-level delta between two immutable snapshots. */\nexport interface RelationshipSnapshotComparison {\n /** Earlier snapshot version. */\n fromVersion: number;\n /** Later snapshot version. */\n toVersion: number;\n /** Edges introduced in the later snapshot. */\n added: RelationshipEdge[];\n /** Edges absent from the later snapshot. */\n removed: RelationshipEdge[];\n /** Number of byte-equivalent edges retained. */\n unchangedCount: number;\n /** Whether the comparison is exact. */\n exact: true;\n}\n\n/** Registry override for custom domain semantics. */\nexport interface RelationshipAnalyticsOptions {\n /** Registry used to interpret ordering direction and custom kinds. */\n registry?: RelationshipKindRegistry;\n}\n\nfunction appendNeighbor(\n adjacency: Map<string, Set<string>>,\n source: string,\n target: string,\n): void {\n adjacency.get(source)!.add(target);\n}\n\nfunction createAdjacency(nodes: readonly string[]): Map<string, Set<string>> {\n return new Map(nodes.map((node) => [node, new Set<string>()]));\n}\n\nfunction sortComponents(components: string[][]): string[][] {\n for (const component of components) component.sort();\n return components.sort(\n (left, right) =>\n right.length - left.length || left[0]!.localeCompare(right[0]!),\n );\n}\n\nfunction stableJsonValue(value: unknown): unknown {\n if (Array.isArray(value)) return value.map((entry) => stableJsonValue(entry));\n if (value === null || typeof value !== \"object\") return value;\n const toJSON = (value as { toJSON?: (this: object) => unknown }).toJSON;\n if (typeof toJSON === \"function\") return stableJsonValue(toJSON.call(value));\n return Object.fromEntries(\n Object.entries(value)\n .sort(([left], [right]) => left.localeCompare(right))\n .map(([key, entry]) => [key, stableJsonValue(entry)]),\n );\n}\n\nfunction relationshipEdgeKey(edge: RelationshipEdge): string {\n return JSON.stringify(stableJsonValue(edge));\n}\n\nfunction appendFinishingOrder(\n start: string,\n adjacency: ReadonlyMap<string, ReadonlySet<string>>,\n visited: Set<string>,\n order: string[],\n): void {\n const stack = [{ id: start, expanded: false }];\n while (stack.length > 0) {\n const current = stack.pop()!;\n if (current.expanded) {\n order.push(current.id);\n continue;\n }\n if (visited.has(current.id)) continue;\n visited.add(current.id);\n stack.push({ id: current.id, expanded: true });\n const neighbors = [...adjacency.get(current.id)!].sort().reverse();\n for (const neighbor of neighbors)\n if (!visited.has(neighbor)) stack.push({ id: neighbor, expanded: false });\n }\n}\n\nfunction computeFinishingOrder(\n nodes: readonly string[],\n adjacency: ReadonlyMap<string, ReadonlySet<string>>,\n): string[] {\n const visited = new Set<string>();\n const order: string[] = [];\n for (const start of nodes)\n if (!visited.has(start))\n appendFinishingOrder(start, adjacency, visited, order);\n return order;\n}\n\nfunction collectReverseComponents(\n order: readonly string[],\n reverse: ReadonlyMap<string, ReadonlySet<string>>,\n): string[][] {\n const visited = new Set<string>();\n const components: string[][] = [];\n for (const start of [...order].reverse()) {\n if (visited.has(start)) continue;\n const component: string[] = [];\n const stack = [start];\n visited.add(start);\n while (stack.length > 0) {\n const current = stack.pop()!;\n component.push(current);\n for (const neighbor of reverse.get(current)!) {\n if (visited.has(neighbor)) continue;\n visited.add(neighbor);\n stack.push(neighbor);\n }\n }\n components.push(component);\n }\n return sortComponents(components);\n}\n\nfunction stronglyConnectedComponents(\n nodes: readonly string[],\n adjacency: ReadonlyMap<string, ReadonlySet<string>>,\n): string[][] {\n const reverse = createAdjacency(nodes);\n for (const [source, targets] of adjacency)\n for (const target of targets) appendNeighbor(reverse, target, source);\n return collectReverseComponents(\n computeFinishingOrder(nodes, adjacency),\n reverse,\n );\n}\n\nfunction buildExecutionAdjacency(\n graph: RelationshipGraph,\n registry: RelationshipKindRegistry,\n): Map<string, Set<string>> {\n const adjacency = createAdjacency(graph.nodes());\n for (const edge of graph.edges()) {\n const definition = registry.require(edge.kind);\n if (!definition.ordering) continue;\n // Legacy and JSON-parsed definitions may predate explicit precedence.\n const sourceFirst =\n (definition.precedence ?? \"source_before_target\") ===\n \"source_before_target\";\n appendNeighbor(\n adjacency,\n sourceFirst ? edge.source : edge.target,\n sourceFirst ? edge.target : edge.source,\n );\n }\n return adjacency;\n}\n\nfunction topologicalLayers(\n nodes: readonly string[],\n adjacency: ReadonlyMap<string, ReadonlySet<string>>,\n): string[][] {\n const indegree = new Map(nodes.map((node) => [node, 0]));\n for (const targets of adjacency.values())\n for (const target of targets)\n indegree.set(target, indegree.get(target)! + 1);\n let frontier = nodes.filter((node) => indegree.get(node) === 0).sort();\n const layers: string[][] = [];\n while (frontier.length > 0) {\n layers.push(frontier);\n const next: string[] = [];\n for (const source of frontier) {\n for (const target of adjacency.get(source)!) {\n const remaining = indegree.get(target)! - 1;\n indegree.set(target, remaining);\n if (remaining === 0) next.push(target);\n }\n }\n frontier = next.sort();\n }\n return layers;\n}\n\nfunction longestPath(\n order: readonly string[],\n adjacency: ReadonlyMap<string, ReadonlySet<string>>,\n): { depth: Record<string, number>; path: string[] } {\n const depth = new Map(order.map((node) => [node, 0]));\n const parent = new Map<string, string>();\n for (const source of order) {\n for (const target of adjacency.get(source)!) {\n if (!depth.has(target)) continue;\n const candidate = depth.get(source)! + 1;\n const currentParent = parent.get(target);\n if (\n candidate > depth.get(target)! ||\n (candidate === depth.get(target)! &&\n (currentParent === undefined ||\n source.localeCompare(currentParent) < 0))\n ) {\n depth.set(target, candidate);\n parent.set(target, source);\n }\n }\n }\n const end = [...order].sort(\n (left, right) =>\n depth.get(right)! - depth.get(left)! || left.localeCompare(right),\n )[0];\n const path = end === undefined ? [] : [end];\n while (path[0] !== undefined && parent.has(path[0]!))\n path.unshift(parent.get(path[0]!)!);\n return { depth: Object.fromEntries(depth), path };\n}\n\nfunction reconstructImpactPath(\n root: string,\n target: string,\n parents: ReadonlyMap<string, string>,\n): string[] {\n const path = [target];\n let cursor = target;\n while (cursor !== root) {\n cursor = parents.get(cursor)!;\n path.push(cursor);\n }\n return path.reverse();\n}\n\n/** Analyze registered order-bearing relationships without treating associative cycles as blockers. */\nexport function analyzeRelationshipExecution(\n graph: RelationshipGraph,\n options: RelationshipAnalyticsOptions = {},\n): RelationshipExecutionAnalysis {\n const registry = options.registry ?? createRelationshipKindRegistry();\n const nodes = [...graph.nodes()];\n const adjacency = buildExecutionAdjacency(graph, registry);\n const layers = topologicalLayers(nodes, adjacency);\n const order = layers.flat();\n const acyclic = order.length === nodes.length;\n const cycles = acyclic\n ? []\n : stronglyConnectedComponents(nodes, adjacency).filter(\n (component) =>\n component.length > 1 ||\n adjacency.get(component[0]!)!.has(component[0]!),\n );\n const longest = longestPath(order, adjacency);\n return {\n exact: true,\n acyclic,\n order,\n layers,\n frontier: layers[0] ?? [],\n depth: longest.depth,\n criticalPath: longest.path,\n criticalPathLength: Math.max(0, longest.path.length - 1),\n cycles,\n provenance: { algorithm: \"kahn-longest-path\", edgeFamily: \"ordering\" },\n };\n}\n\n/** Compute bounded impact rows and exact shortest explanation paths. */\nexport function analyzeGraphImpact(\n graph: RelationshipGraph,\n root: string,\n options: RelationshipQueryOptions = {},\n): RelationshipImpactAnalysis {\n const direction = options.direction ?? \"outgoing\";\n const maxDepth = options.maxDepth ?? Number.POSITIVE_INFINITY;\n const limit = options.limit ?? Number.POSITIVE_INFINITY;\n const queue = [{ id: root, depth: 0 }];\n const seen = new Set([root]);\n const parents = new Map<string, string>();\n const affected: RelationshipImpactRow[] = [];\n let visitedNodes = 0;\n let inspectedEdges = 0;\n let truncated = false;\n traversal: for (let index = 0; index < queue.length; index += 1) {\n options.signal?.throwIfAborted();\n const current = queue[index]!;\n visitedNodes += 1;\n const adjacent = graph.adjacency(current.id, {\n direction,\n kinds: options.kinds,\n signal: options.signal,\n });\n inspectedEdges += adjacent.meta.inspectedEdges;\n if (current.depth >= maxDepth) {\n if (adjacent.value.some((id) => !seen.has(id))) truncated = true;\n continue;\n }\n for (const id of adjacent.value) {\n if (seen.has(id)) continue;\n if (affected.length >= limit) {\n truncated = true;\n break traversal;\n }\n seen.add(id);\n parents.set(id, current.id);\n const depth = current.depth + 1;\n affected.push({\n id,\n distance: depth,\n path: reconstructImpactPath(root, id, parents),\n });\n queue.push({ id, depth });\n }\n }\n return {\n root,\n affected,\n exact: true,\n truncated,\n cost: { visitedNodes, inspectedEdges },\n };\n}\n\n/** Analyze weak/strong components, isolates, and exact unique-neighbor hubs. */\nexport function analyzeKnowledgeGraph(\n graph: RelationshipGraph,\n): RelationshipKnowledgeAnalysis {\n const nodes = [...graph.nodes()];\n const weak = createAdjacency(nodes);\n const directed = createAdjacency(nodes);\n for (const edge of graph.edges()) {\n appendNeighbor(weak, edge.source, edge.target);\n appendNeighbor(weak, edge.target, edge.source);\n appendNeighbor(directed, edge.source, edge.target);\n }\n const components: string[][] = [];\n const visited = new Set<string>();\n for (const start of nodes) {\n if (visited.has(start)) continue;\n const component: string[] = [];\n const stack = [start];\n visited.add(start);\n while (stack.length > 0) {\n const current = stack.pop()!;\n component.push(current);\n for (const neighbor of weak.get(current)!) {\n if (visited.has(neighbor)) continue;\n visited.add(neighbor);\n stack.push(neighbor);\n }\n }\n components.push(component);\n }\n const degrees = nodes.map((id) => ({ id, degree: weak.get(id)!.size }));\n const maximum = Math.max(0, ...degrees.map(({ degree }) => degree));\n return {\n components: sortComponents(components),\n stronglyConnected: stronglyConnectedComponents(nodes, directed),\n orphans: degrees.filter(({ degree }) => degree === 0).map(({ id }) => id),\n hubs: degrees.filter(({ degree }) => degree > 0 && degree === maximum),\n exact: true,\n provenance: { algorithm: \"component-degree\", edgeFamily: \"all\" },\n };\n}\n\n/** Compare two immutable relationship snapshots by full normalized edge value. */\nexport function compareRelationshipSnapshots(\n before: RelationshipSnapshot,\n after: RelationshipSnapshot,\n): RelationshipSnapshotComparison {\n const earlier = new Map(\n before.edges.map((edge) => [relationshipEdgeKey(edge), edge]),\n );\n const later = new Map(\n after.edges.map((edge) => [relationshipEdgeKey(edge), edge]),\n );\n return {\n fromVersion: before.version,\n toVersion: after.version,\n added: [...later]\n .filter(([key]) => !earlier.has(key))\n .map(([, edge]) => edge),\n removed: [...earlier]\n .filter(([key]) => !later.has(key))\n .map(([, edge]) => edge),\n unchangedCount: [...earlier.keys()].filter((key) => later.has(key)).length,\n exact: true,\n };\n}\n", "/**\n * @module sdk/relationship-history\n *\n * Provides an append-only, storage-independent relationship event ledger with\n * optimistic concurrency, deterministic replay, snapshots, and cursor pages.\n */\nimport {\n createQueryFingerprint,\n decodeQueryCursorState,\n paginateQueryRows,\n} from \"./pagination.js\";\nimport { constants } from \"node:fs\";\nimport { lstat, mkdir, open, type FileHandle } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { acquireLock } from \"../core/lock/lock.js\";\nimport {\n RelationshipGraph,\n RelationshipKindRegistry,\n createRelationshipKindRegistry,\n type RelationshipEdge,\n} from \"./relationships.js\";\n\n/** Mutation kinds retained in the immutable relationship event stream. */\nexport type RelationshipEventAction = \"add\" | \"remove\" | \"supersede\";\n\n/** Caller-authored relationship mutation before its sequence is assigned. */\nexport interface RelationshipEventInput {\n /** Globally unique idempotency key for this event. */\n eventId: string;\n /** Stable logical relationship identifier across superseding events. */\n relationshipId: string;\n /** Append, remove, or replace the logical relationship. */\n action: RelationshipEventAction;\n /** Edge required for add and supersede actions. */\n edge?: RelationshipEdge;\n /** Attributable actor responsible for the mutation. */\n author: string;\n /** Valid event-time timestamp. */\n timestamp: string;\n /** Optional optimistic concurrency precondition. */\n expectedVersion?: number;\n /** Optional human-readable mutation rationale. */\n reason?: string;\n}\n\n/** One immutable sequenced relationship mutation. */\nexport interface RelationshipEvent extends Omit<\n RelationshipEventInput,\n \"expectedVersion\"\n> {\n /** One-based append sequence assigned by the ledger. */\n sequence: number;\n}\n\n/** Point-in-time materialized relationship view. */\nexport interface RelationshipSnapshot {\n /** Final event sequence included in this snapshot. */\n version: number;\n /** Timestamp of the final included event, when one exists. */\n asOf?: string;\n /** Deterministic active edge materialization. */\n edges: readonly RelationshipEdge[];\n /** Immutable graph query view over the active edges. */\n graph: RelationshipGraph;\n}\n\n/** Stable cursor page over a fixed relationship event-log version. */\nexport interface RelationshipEventPage {\n /** Log version against which this page was produced. */\n version: number;\n /** Events in append order. */\n events: RelationshipEvent[];\n /** Whether another event page exists. */\n hasMore: boolean;\n /** Opaque continuation cursor when another page exists. */\n nextCursor?: string;\n}\n\n/** Construction controls for the in-memory reference ledger. */\nexport interface RelationshipEventLogOptions {\n /** Registry defining edge semantics and cardinality. */\n registry?: RelationshipKindRegistry;\n}\n\n/** Filesystem controls for the durable relationship event store. */\nexport interface RelationshipEventStoreOptions extends RelationshipEventLogOptions {\n /** Tracker root that owns the relationship history directory. */\n pmRoot: string;\n /** Fixed node universe validated by every replay and append. */\n nodes: Iterable<string>;\n /** Optional JSONL path relative to the tracker root. */\n relativePath?: string;\n}\n\ninterface RelationshipCardinalityIndexes {\n identities: Map<string, string>;\n outgoingOne: Map<string, string>;\n incomingOne: Map<string, string>;\n}\n\nfunction requiredText(value: unknown, field: string): string {\n if (typeof value !== \"string\" || value.trim().length === 0)\n throw new TypeError(`Relationship event ${field} must be non-empty`);\n return value.trim();\n}\n\nfunction edgeIdentity(\n edge: RelationshipEdge,\n registry: RelationshipKindRegistry,\n): string {\n const definition = registry.require(edge.kind);\n const endpoints =\n definition.direction === \"undirected\"\n ? [edge.source, edge.target].sort().join(\"\\u0000\")\n : `${edge.source}\\u0000${edge.target}`;\n return `${definition.kind}\\u0000${endpoints}`;\n}\n\nfunction freezeEdge(edge: RelationshipEdge): RelationshipEdge {\n return Object.freeze({\n ...edge,\n ...(edge.payload === undefined\n ? {}\n : { payload: Object.freeze(structuredClone(edge.payload)) }),\n });\n}\n\nfunction assertCardinality(\n candidate: RelationshipEdge,\n excludeRelationshipId: string,\n registry: RelationshipKindRegistry,\n indexes: RelationshipCardinalityIndexes,\n): void {\n const definition = registry.require(candidate.kind);\n const outgoingOwner = indexes.outgoingOne.get(\n `${definition.kind}\\u0000${candidate.source}`,\n );\n if (outgoingOwner !== undefined && outgoingOwner !== excludeRelationshipId)\n throw new TypeError(\n `Relationship outgoing cardinality exceeded for ${definition.kind}`,\n );\n const incomingOwner = indexes.incomingOne.get(\n `${definition.kind}\\u0000${candidate.target}`,\n );\n if (incomingOwner !== undefined && incomingOwner !== excludeRelationshipId)\n throw new TypeError(\n `Relationship incoming cardinality exceeded for ${definition.kind}`,\n );\n const identity = edgeIdentity(candidate, registry);\n const identityOwner = indexes.identities.get(identity);\n if (identityOwner !== undefined && identityOwner !== excludeRelationshipId)\n throw new TypeError(`Relationship edge already active: ${identity}`);\n}\n\nfunction replayEvents(\n events: readonly RelationshipEvent[],\n): Map<string, RelationshipEdge> {\n const active = new Map<string, RelationshipEdge>();\n for (const event of events) {\n if (event.action === \"remove\") active.delete(event.relationshipId);\n else active.set(event.relationshipId, event.edge!);\n }\n return active;\n}\n\nfunction normalizeEventHeader(\n input: RelationshipEventInput,\n currentVersion: number,\n eventIds: ReadonlySet<string>,\n): {\n eventId: string;\n relationshipId: string;\n author: string;\n timestamp: string;\n} {\n if (\n input.expectedVersion !== undefined &&\n input.expectedVersion !== currentVersion\n )\n throw new TypeError(\n `Relationship event version conflict: expected ${input.expectedVersion}, current ${currentVersion}`,\n );\n const eventId = requiredText(input.eventId, \"eventId\");\n if (eventIds.has(eventId))\n throw new TypeError(`Relationship event already exists: ${eventId}`);\n if (\n input.action !== \"add\" &&\n input.action !== \"remove\" &&\n input.action !== \"supersede\"\n )\n throw new TypeError(`Unknown relationship event action: ${input.action}`);\n if (!Number.isFinite(Date.parse(input.timestamp)))\n throw new TypeError(\"Relationship event timestamp must be valid\");\n return {\n eventId,\n relationshipId: requiredText(input.relationshipId, \"relationshipId\"),\n author: requiredText(input.author, \"author\"),\n timestamp: new Date(input.timestamp).toISOString(),\n };\n}\n\nfunction resolveMutationEdge(\n input: RelationshipEventInput,\n relationshipId: string,\n active: ReadonlyMap<string, RelationshipEdge>,\n nodes: ReadonlySet<string>,\n registry: RelationshipKindRegistry,\n indexes: RelationshipCardinalityIndexes,\n): RelationshipEdge | undefined {\n const isActive = active.has(relationshipId);\n if (input.action === \"add\" && isActive)\n throw new TypeError(`Relationship is already active: ${relationshipId}`);\n if (input.action !== \"add\" && !isActive)\n throw new TypeError(`Relationship is not active: ${relationshipId}`);\n if (input.action === \"remove\") return undefined;\n if (!input.edge)\n throw new TypeError(`Relationship ${input.action} event requires an edge`);\n const source =\n typeof input.edge.source === \"string\" ? input.edge.source.trim() : \"\";\n const target =\n typeof input.edge.target === \"string\" ? input.edge.target.trim() : \"\";\n if (!nodes.has(source) || !nodes.has(target))\n throw new TypeError(\n `Relationship endpoint not found: ${source} -> ${target}`,\n );\n const canonical = new RelationshipGraph(\n [source, target],\n [input.edge],\n registry,\n ).edges()[0]!;\n assertCardinality(canonical, relationshipId, registry, indexes);\n return freezeEdge(canonical);\n}\n\n/**\n * Append-only in-memory reference ledger. Durable adapters can persist the\n * returned immutable events while reusing the same replay and validation model.\n */\nexport class RelationshipEventLog {\n readonly #nodes: ReadonlySet<string>;\n readonly #registry: RelationshipKindRegistry;\n readonly #events: RelationshipEvent[] = [];\n readonly #eventIds = new Set<string>();\n readonly #active = new Map<string, RelationshipEdge>();\n readonly #cardinalityIndexes: RelationshipCardinalityIndexes = {\n identities: new Map(),\n outgoingOne: new Map(),\n incomingOne: new Map(),\n };\n\n /** Create an empty relationship ledger for a fixed node universe. */\n public constructor(\n nodes: Iterable<string>,\n options: RelationshipEventLogOptions = {},\n ) {\n this.#nodes = new Set(\n [...nodes]\n .filter((node): node is string => typeof node === \"string\")\n .map((node) => node.trim())\n .filter(Boolean),\n );\n this.#registry = options.registry ?? createRelationshipKindRegistry();\n }\n\n /** Current append sequence. */\n public get version(): number {\n return this.#events.length;\n }\n\n /** Return an immutable copy of the full event stream. */\n public events(): readonly RelationshipEvent[] {\n return Object.freeze([...this.#events]);\n }\n\n /** Add one active relationship to constant-time validation indexes. */\n #indexActive(relationshipId: string, edge: RelationshipEdge): void {\n const definition = this.#registry.require(edge.kind);\n this.#cardinalityIndexes.identities.set(\n edgeIdentity(edge, this.#registry),\n relationshipId,\n );\n if (definition.outgoing === \"one\")\n this.#cardinalityIndexes.outgoingOne.set(\n `${definition.kind}\\u0000${edge.source}`,\n relationshipId,\n );\n if (definition.incoming === \"one\")\n this.#cardinalityIndexes.incomingOne.set(\n `${definition.kind}\\u0000${edge.target}`,\n relationshipId,\n );\n }\n\n /** Remove one superseded or deleted relationship from validation indexes. */\n #unindexActive(edge: RelationshipEdge): void {\n const definition = this.#registry.require(edge.kind);\n this.#cardinalityIndexes.identities.delete(\n edgeIdentity(edge, this.#registry),\n );\n if (definition.outgoing === \"one\")\n this.#cardinalityIndexes.outgoingOne.delete(\n `${definition.kind}\\u0000${edge.source}`,\n );\n if (definition.incoming === \"one\")\n this.#cardinalityIndexes.incomingOne.delete(\n `${definition.kind}\\u0000${edge.target}`,\n );\n }\n\n /** Validate and append one attributable relationship mutation. */\n public append(input: RelationshipEventInput): RelationshipEvent {\n const header = normalizeEventHeader(input, this.version, this.#eventIds);\n const previous = this.#active.get(header.relationshipId);\n const edge = resolveMutationEdge(\n input,\n header.relationshipId,\n this.#active,\n this.#nodes,\n this.#registry,\n this.#cardinalityIndexes,\n );\n\n const event = Object.freeze({\n eventId: header.eventId,\n relationshipId: header.relationshipId,\n action: input.action,\n ...(edge === undefined ? {} : { edge }),\n author: header.author,\n timestamp: header.timestamp,\n ...(input.reason?.trim() ? { reason: input.reason.trim() } : {}),\n sequence: this.version + 1,\n }) satisfies RelationshipEvent;\n this.#events.push(event);\n this.#eventIds.add(header.eventId);\n if (previous) this.#unindexActive(previous);\n if (input.action === \"remove\") this.#active.delete(header.relationshipId);\n else {\n this.#active.set(header.relationshipId, edge!);\n this.#indexActive(header.relationshipId, edge!);\n }\n return event;\n }\n\n /** Materialize an exact point-in-time graph without mutating the ledger. */\n public snapshot(\n options: {\n atVersion?: number;\n atTimestamp?: string;\n } = {},\n ): RelationshipSnapshot {\n if (options.atVersion !== undefined && options.atTimestamp !== undefined)\n throw new TypeError(\"Relationship snapshot accepts one target\");\n let included: RelationshipEvent[];\n if (options.atTimestamp !== undefined) {\n const timestamp = Date.parse(options.atTimestamp);\n if (!Number.isFinite(timestamp))\n throw new TypeError(\"Relationship snapshot timestamp must be valid\");\n let lastIndex = -1;\n for (let index = this.#events.length - 1; index >= 0; index -= 1) {\n if (Date.parse(this.#events[index]!.timestamp) > timestamp) continue;\n lastIndex = index;\n break;\n }\n included = lastIndex === -1 ? [] : this.#events.slice(0, lastIndex + 1);\n } else {\n const version = options.atVersion ?? this.version;\n if (!Number.isInteger(version) || version < 0 || version > this.version)\n throw new TypeError(\n `Relationship snapshot version out of range: ${version}`,\n );\n included = this.#events.slice(0, version);\n }\n const active = replayEvents(included);\n const graph = new RelationshipGraph(\n this.#nodes,\n active.values(),\n this.#registry,\n );\n return Object.freeze({\n version: included.length,\n ...(included.at(-1) ? { asOf: included.at(-1)!.timestamp } : {}),\n edges: graph.edges(),\n graph,\n });\n }\n\n /** Page the immutable event stream with a cursor bound to this log version. */\n public page(options: {\n limit: number;\n cursor?: string;\n }): RelationshipEventPage {\n if (!Number.isInteger(options.limit) || options.limit < 1)\n throw new TypeError(\"Relationship event page limit must be positive\");\n const fingerprint = createQueryFingerprint(\"relationship-events\", {\n order: \"append-sequence\",\n });\n const snapshot =\n options.cursor === undefined\n ? this.version\n : Number(decodeQueryCursorState(options.cursor, fingerprint).snapshot);\n if (\n !Number.isSafeInteger(snapshot) ||\n snapshot < 0 ||\n snapshot > this.version\n )\n throw new TypeError(\n \"Relationship event cursor snapshot version is invalid\",\n );\n const page = paginateQueryRows(this.#events.slice(0, snapshot), {\n cursor: options.cursor,\n fingerprint,\n limit: options.limit,\n readId: (event) => event.eventId,\n snapshot: String(snapshot),\n });\n return {\n version: snapshot,\n events: page.rows,\n hasMore: page.has_more,\n ...(page.next_cursor ? { nextCursor: page.next_cursor } : {}),\n };\n }\n}\n\nconst RELATIONSHIP_STORE_LOCK_ID = \"relationship-event-store\";\nconst RELATIONSHIP_NOFOLLOW_FLAG = constants.O_NOFOLLOW;\n\nfunction acquireRelationshipStoreLock(\n pmRoot: string,\n): Promise<() => Promise<void>> {\n return acquireLock(\n pmRoot,\n RELATIONSHIP_STORE_LOCK_ID,\n 30,\n `relationship-store:${process.pid}`,\n false,\n false,\n 3_000,\n );\n}\n\nasync function resolveRelationshipEventStorePath(\n pmRoot: string,\n relativePath = \"relationships/events.jsonl\",\n): Promise<string> {\n const root = path.resolve(pmRoot);\n const target = path.resolve(root, relativePath);\n const relative = path.relative(root, target);\n if (relative.length === 0)\n throw new TypeError(\n \"Relationship event path must name a file within the tracker root\",\n );\n if (\n relative === \"..\" ||\n relative.startsWith(`..${path.sep}`) ||\n path.isAbsolute(relative)\n )\n throw new TypeError(\n \"Relationship event path must stay within the tracker root\",\n );\n await mkdir(root, { recursive: true });\n const rootStats = await lstat(root);\n if (rootStats.isSymbolicLink())\n throw new TypeError(\n \"Relationship event tracker root must not be a symbolic link\",\n );\n let current = root;\n for (const segment of relative.split(path.sep)) {\n current = path.join(current, segment);\n try {\n if ((await lstat(current)).isSymbolicLink())\n throw new TypeError(\n \"Relationship event path must not contain symbolic links\",\n );\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === \"ENOENT\") break;\n throw error;\n }\n }\n return target;\n}\n\nasync function loadRelationshipEventLog(\n target: string,\n nodes: readonly string[],\n registry: RelationshipKindRegistry | undefined,\n): Promise<RelationshipEventLog> {\n const log = new RelationshipEventLog(nodes, { registry });\n let raw: string;\n let handle: FileHandle | undefined;\n try {\n handle = await open(\n target,\n constants.O_RDONLY | RELATIONSHIP_NOFOLLOW_FLAG,\n );\n raw = await handle.readFile(\"utf8\");\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === \"ENOENT\") return log;\n throw error;\n } finally {\n await handle?.close();\n }\n const lines = raw.split(\"\\n\");\n for (let index = 0; index < lines.length; index += 1) {\n const line = lines[index]!.trim();\n if (!line) continue;\n let stored: RelationshipEvent;\n try {\n stored = JSON.parse(line) as RelationshipEvent;\n } catch {\n throw new TypeError(\n `Invalid relationship event JSONL at line ${index + 1}`,\n );\n }\n if (stored.sequence !== log.version + 1)\n throw new TypeError(\n `Invalid relationship event sequence at line ${index + 1}`,\n );\n log.append({\n eventId: stored.eventId,\n relationshipId: stored.relationshipId,\n action: stored.action,\n ...(stored.edge === undefined ? {} : { edge: stored.edge }),\n author: stored.author,\n timestamp: stored.timestamp,\n ...(stored.reason === undefined ? {} : { reason: stored.reason }),\n expectedVersion: log.version,\n });\n }\n return log;\n}\n\n/**\n * Lock-serialized durable JSONL adapter for {@link RelationshipEventLog}.\n * Every append replays the current stream while holding the workspace lock, so\n * independent processes share optimistic versions without lost updates.\n */\nexport class RelationshipEventStore {\n readonly #pmRoot: string;\n readonly #nodes: readonly string[];\n readonly #registry: RelationshipKindRegistry | undefined;\n readonly #path: string;\n #log: RelationshipEventLog;\n\n private constructor(\n options: RelationshipEventStoreOptions,\n nodes: readonly string[],\n target: string,\n log: RelationshipEventLog,\n ) {\n this.#pmRoot = options.pmRoot;\n this.#nodes = nodes;\n this.#registry = options.registry;\n this.#path = target;\n this.#log = log;\n }\n\n /** Open and validate an existing stream or create an empty store view. */\n public static async open(\n options: RelationshipEventStoreOptions,\n ): Promise<RelationshipEventStore> {\n const nodes = Object.freeze([...options.nodes]);\n const target = await resolveRelationshipEventStorePath(\n options.pmRoot,\n options.relativePath,\n );\n const release = await acquireRelationshipStoreLock(options.pmRoot);\n try {\n await resolveRelationshipEventStorePath(options.pmRoot, target);\n const log = await loadRelationshipEventLog(\n target,\n nodes,\n options.registry,\n );\n return new RelationshipEventStore(options, nodes, target, log);\n } finally {\n await release();\n }\n }\n\n /** Absolute JSONL path, exposed for diagnostics and backup tooling. */\n public get path(): string {\n return this.#path;\n }\n\n /** Refresh from durable history and return the current validated append sequence. */\n public async currentVersion(): Promise<number> {\n this.#log = await this.#refreshFromDurableHistory();\n return this.#log.version;\n }\n\n /** Append one event after refreshing under the shared workspace lock. */\n public async append(\n input: RelationshipEventInput,\n ): Promise<RelationshipEvent> {\n const release = await acquireRelationshipStoreLock(this.#pmRoot);\n try {\n const target = await resolveRelationshipEventStorePath(\n this.#pmRoot,\n this.#path,\n );\n const refreshed = await loadRelationshipEventLog(\n target,\n this.#nodes,\n this.#registry,\n );\n const event = refreshed.append(input);\n await mkdir(path.dirname(target), { recursive: true });\n await resolveRelationshipEventStorePath(this.#pmRoot, target);\n const handle = await open(\n target,\n constants.O_APPEND |\n constants.O_CREAT |\n constants.O_WRONLY |\n RELATIONSHIP_NOFOLLOW_FLAG,\n );\n try {\n await handle.appendFile(`${JSON.stringify(event)}\\n`, \"utf8\");\n } finally {\n await handle.close();\n }\n this.#log = refreshed;\n return event;\n } finally {\n await release();\n }\n }\n\n /** Refresh from durable history and materialize an exact validated snapshot. */\n public async snapshot(\n options: Parameters<RelationshipEventLog[\"snapshot\"]>[0] = {},\n ): Promise<RelationshipSnapshot> {\n this.#log = await this.#refreshFromDurableHistory();\n return this.#log.snapshot(options);\n }\n\n /** Refresh from durable history and page immutable events. */\n public async page(\n options: Parameters<RelationshipEventLog[\"page\"]>[0],\n ): Promise<RelationshipEventPage> {\n this.#log = await this.#refreshFromDurableHistory();\n return this.#log.page(options);\n }\n\n /** Serialize a durable refresh with writers so readers never observe a torn JSONL tail. */\n async #refreshFromDurableHistory(): Promise<RelationshipEventLog> {\n const release = await acquireRelationshipStoreLock(this.#pmRoot);\n try {\n const target = await resolveRelationshipEventStorePath(\n this.#pmRoot,\n this.#path,\n );\n return await loadRelationshipEventLog(\n target,\n this.#nodes,\n this.#registry,\n );\n } finally {\n await release();\n }\n }\n}\n", "/**\n * @module sdk/define\n *\n * Authoring-time typed builders for every extension registration surface.\n *\n * These `define*` helpers are the third leg of the SDK ergonomics tripod:\n * {@link ../core/extensions/loader.js#ExtensionApi | `api.register*`} registers\n * a definition at activation, the `assert*`/`run*` testing helpers verify and\n * invoke it, and these builders let authors *write* the definition with full\n * type-checking and editor inference before it ever reaches `activate`.\n *\n * Every builder is a zero-cost identity function that returns its argument\n * unchanged — exactly like the SDK's {@link ./index.js#defineExtension} and the\n * wider `defineConfig`/`defineComponent` ecosystem convention. Extensions are\n * authored fully in TypeScript (ADR pm-2c28); these builders are where that type\n * safety is anchored at the definition site. Their value is entirely at the type\n * level:\n *\n * - A bare `const cmd = { ... }` satisfies the registration type only\n * structurally and widens its literals; `const cmd = defineCommand({ ... })`\n * checks the object against the contract *and* preserves the narrow literal\n * type, while inferring the nested handler's `context` parameter from the\n * builder signature.\n * - Definitions can be colocated, exported, reused, and unit-tested apart from\n * the `activate` call instead of being trapped as inline literals.\n *\n * Object-definition builders use a generic constraint (`<T extends Def>`) so the\n * narrow literal type survives the round-trip, mirroring `defineExtension`.\n * Function-definition builders are intentionally non-generic: a generic\n * constrained to a whole function type suppresses contextual typing of a bare\n * arrow's parameter (it would fall back to implicit `any`), whereas the\n * non-generic signature lets TypeScript type the handler parameter from the\n * declared function type.\n */\nimport type {\n AfterCommandHook,\n BeforeCommandHook,\n CommandDefinition,\n CommandOverride,\n Exporter,\n ExtensionManifest,\n FlagDefinition,\n Importer,\n OnIndexHook,\n OnReadHook,\n OnWriteHook,\n ParserOverride,\n PreflightOverride,\n RendererOverride,\n SchemaFieldDefinition,\n SchemaItemTypeDefinition,\n SchemaMigrationDefinition,\n SearchProviderDefinition,\n ServiceOverride,\n VectorStoreAdapterDefinition,\n} from \"../core/extensions/loader.js\";\nimport type { ProjectProfileDefinition } from \"../core/profile/profile-presets.js\";\n\n/**\n * Type an extension's in-module manifest mirror (the `manifest` export / field).\n *\n * Completes the `define*` family: the manifest is the one authoring surface that\n * otherwise had no builder. Contract-checks the object against\n * {@link ExtensionManifest} where it is authored, catching a missing required\n * field or a mistyped key at edit time instead of at load time. Pair with\n * {@link ./compose.js#deriveExtensionCapabilities | `deriveExtensionCapabilities`}\n * to keep `capabilities` matched to the surfaces the extension actually registers.\n */\nexport function defineExtensionManifest<TManifest extends ExtensionManifest>(\n manifest: TManifest,\n): TManifest {\n return manifest;\n}\n\n/**\n * Type a project-profile definition for the profile registry.\n *\n * A profile bundles item types, statuses, fields, per-type workflows, config\n * knobs, create templates, and package recommendations into one declarative\n * archetype that `pm profile apply` stages idempotently. This builder checks the\n * object against {@link ProjectProfileDefinition} where it is authored — catching\n * an invalid field type or a malformed workflow at edit time — while preserving\n * the literal `name`/`types`/`statuses` so a package's archetype stays strongly\n * typed at the definition site, mirroring {@link defineItemType}. It is the\n * authoring anchor a first-party or third-party profile package builds on.\n */\nexport function defineProjectProfile<TProfile extends ProjectProfileDefinition>(\n profile: TProfile,\n): TProfile {\n return profile;\n}\n\n/**\n * Type a command definition for `api.registerCommand(definition)`.\n *\n * Checks the object against {@link CommandDefinition} and infers the `run`\n * handler's `context` parameter while preserving the literal `name`/`action`\n * types. Pass the result straight to `registerCommand`, or export it so the\n * command can be invoked in tests via `runRegisteredCommandForTest`.\n */\nexport function defineCommand<TDefinition extends CommandDefinition>(\n definition: TDefinition,\n): TDefinition {\n return definition;\n}\n\n/**\n * Type a single flag definition for a `api.registerFlags(command, flags)` array.\n *\n * Authors compose builders into the array\n * (`api.registerFlags(\"list\", [defineFlag({ long: \"--mine\" })])`) to get\n * per-flag contract checking — `value_type`, `list`, and `default` included —\n * instead of validating a loosely-typed literal array all at once.\n */\nexport function defineFlag<TFlag extends FlagDefinition>(flag: TFlag): TFlag {\n return flag;\n}\n\n/**\n * Type a custom item-type definition for `api.registerItemTypes([...])`.\n *\n * Preserves the literal `name`/`folder`/`aliases` so a project archetype's\n * domain types stay strongly typed where the definition is declared and reused.\n */\nexport function defineItemType<TType extends SchemaItemTypeDefinition>(\n type: TType,\n): TType {\n return type;\n}\n\n/**\n * Type a custom item-metadata field definition for `api.registerItemFields([...])`.\n *\n * Checks `name`/`type`/`optional` against {@link SchemaFieldDefinition} while\n * keeping the field's extra metadata (the contract carries an index signature)\n * intact.\n */\nexport function defineItemField<TField extends SchemaFieldDefinition>(\n field: TField,\n): TField {\n return field;\n}\n\n/**\n * Type a schema migration definition for `api.registerMigration(definition)`.\n *\n * Preserves the literal `id` and, when `run` is provided, infers the migration\n * runner's context, so the same definition can be registered and later exercised\n * through `runRegisteredMigrationForTest`.\n */\nexport function defineMigration<TMigration extends SchemaMigrationDefinition>(\n migration: TMigration,\n): TMigration {\n return migration;\n}\n\n/**\n * Type a search-provider definition for `api.registerSearchProvider(provider)`.\n *\n * Infers the `query`/`embed`/`embedBatch` operation contexts and result shapes\n * so a custom retrieval backend is type-checked at the definition site and\n * reusable in `runRegisteredSearchProviderForTest`.\n */\nexport function defineSearchProvider<\n TProvider extends SearchProviderDefinition,\n>(provider: TProvider): TProvider {\n return provider;\n}\n\n/**\n * Type a vector-store adapter definition for `api.registerVectorStoreAdapter(adapter)`.\n *\n * Infers the `query`/`upsert`/`delete` operation contexts so a package that owns\n * its own semantic index storage gets contract checking before activation and a\n * definition it can drive through `runRegisteredVectorStoreAdapterForTest`.\n */\nexport function defineVectorStoreAdapter<\n TAdapter extends VectorStoreAdapterDefinition,\n>(adapter: TAdapter): TAdapter {\n return adapter;\n}\n\n/**\n * Type a command-override handler for `api.registerCommand(command, override)`.\n *\n * The non-generic signature lets TypeScript contextually type the override's\n * `context` parameter from {@link CommandOverride}, so a bare arrow authored in\n * a `.js` package still gets a fully-typed argument.\n */\nexport function defineCommandOverride(\n override: CommandOverride,\n): CommandOverride {\n return override;\n}\n\n/**\n * Type a parser-override handler for `api.registerParser(command, override)`.\n *\n * Contextually types the `context` parameter and the returned\n * {@link ParserOverride} delta so an argument-rewriting override is checked\n * where it is written.\n */\nexport function defineParserOverride(override: ParserOverride): ParserOverride {\n return override;\n}\n\n/**\n * Type a preflight-override handler for `api.registerPreflight(override)`.\n *\n * Contextually types the `context` parameter and the returned gate decision so a\n * package's pre-run validation override is checked at the definition site.\n */\nexport function definePreflightOverride(\n override: PreflightOverride,\n): PreflightOverride {\n return override;\n}\n\n/**\n * Type a service-override handler for `api.registerService(service, override)`.\n *\n * Contextually types the `context` parameter from {@link ServiceOverride} so a\n * package overriding a built-in service (output formatting, embeddings, and the\n * like) keeps its handler argument typed without an explicit annotation.\n */\nexport function defineServiceOverride(\n override: ServiceOverride,\n): ServiceOverride {\n return override;\n}\n\n/**\n * Type a renderer-override handler for `api.registerRenderer(format, renderer)`.\n *\n * Contextually types the `context` parameter and the `string | null | undefined`\n * return contract so a custom output renderer is checked where it is authored.\n */\nexport function defineRendererOverride(\n renderer: RendererOverride,\n): RendererOverride {\n return renderer;\n}\n\n/**\n * Type an importer handler for `api.registerImporter(name, importer, options)`.\n *\n * Contextually types the {@link Importer} `context` (registration, args,\n * options, pm root) so the bridge from an external system into the pm context\n * graph is type-checked and reusable in `runRegisteredImporterForTest`.\n */\nexport function defineImporter(importer: Importer): Importer {\n return importer;\n}\n\n/**\n * Type an exporter handler for `api.registerExporter(name, exporter, options)`.\n *\n * Contextually types the {@link Exporter} `context` so the bridge from the pm\n * context graph out to an external system is checked at the definition site and\n * reusable in `runRegisteredExporterForTest`.\n */\nexport function defineExporter(exporter: Exporter): Exporter {\n return exporter;\n}\n\n/**\n * Type a `before_command` hook for `api.hooks.beforeCommand(hook)`.\n *\n * Contextually types the {@link BeforeCommandHook} `context` so a hook that\n * inspects or annotates a command before it runs keeps its argument typed when\n * authored as a standalone, exportable, testable value.\n */\nexport function defineBeforeCommandHook(\n hook: BeforeCommandHook,\n): BeforeCommandHook {\n return hook;\n}\n\n/**\n * Type an `after_command` hook for `api.hooks.afterCommand(hook)`.\n *\n * Contextually types the {@link AfterCommandHook} `context` — including the\n * `affected` items pm mutated — so the natural place to react to every change\n * (\"project management = context management\") is checked where it is written.\n */\nexport function defineAfterCommandHook(\n hook: AfterCommandHook,\n): AfterCommandHook {\n return hook;\n}\n\n/**\n * Type an `on_write` hook for `api.hooks.onWrite(hook)`.\n *\n * Contextually types the {@link OnWriteHook} `context` so a hook reacting to\n * item persistence keeps its argument typed without an explicit annotation.\n */\nexport function defineOnWriteHook(hook: OnWriteHook): OnWriteHook {\n return hook;\n}\n\n/**\n * Type an `on_read` hook for `api.hooks.onRead(hook)`.\n *\n * Contextually types the {@link OnReadHook} `context` so a hook augmenting items\n * as they are read is type-checked at the definition site.\n */\nexport function defineOnReadHook(hook: OnReadHook): OnReadHook {\n return hook;\n}\n\n/**\n * Type an `on_index` hook for `api.hooks.onIndex(hook)`.\n *\n * Contextually types the {@link OnIndexHook} `context` so a hook participating\n * in index/search refresh keeps its argument typed even without TypeScript\n * annotations.\n */\nexport function defineOnIndexHook(hook: OnIndexHook): OnIndexHook {\n return hook;\n}\n", "/**\n * @module sdk/index\n *\n * Defines public SDK APIs and package-author helpers for Index.\n */\nexport {\n isErrnoError,\n limitAnnotationEntries,\n parseAnnotationTextInput,\n readAnnotationEntries,\n resolveAnnotationInput,\n resolveAnnotationIndex,\n runAnnotationCommand,\n wrapOwnershipConflict,\n type AnnotationCommandConfig,\n type AnnotationCommandOptions,\n type AnnotationCommandResult,\n type AnnotationEntry,\n type AnnotationInput,\n type AnnotationSourceOptions,\n type OwnershipConflictGuidance,\n} from \"./annotations.js\";\nexport {\n inspectHistoryAuthorStream,\n scanHistoryAuthorAttribution,\n type HistoryAuthorAttributionScan,\n type UnknownAuthorHistoryEvent,\n} from \"./author-attribution.js\";\nexport { createPmCliProgram } from \"./cli-program.js\";\nexport {\n quoteCommandArg,\n quoteWindowsCommandArg,\n renderPmCommand,\n} from \"./command-line.js\";\nexport * from \"./governance/gc.js\";\nexport * from \"./governance/health.js\";\nexport * from \"./governance/validate.js\";\nexport { runExtension } from \"./extension.js\";\nexport { applyInvocationAuthorOverride } from \"./invocation-author.js\";\nexport {\n _testOnly as _testOnlyTemplates,\n type TemplateSource,\n} from \"./templates.js\";\nexport {\n runConfig,\n _testOnlyConfigCommand,\n type NestedSettingResultValue,\n} from \"./config.js\";\nexport {\n INIT_AGENT_GUIDANCE_MODE_VALUES,\n runInitAgentGuidance,\n _testOnly as _testOnlyInitAgentGuidance,\n type InitAgentGuidanceMode,\n type InitAgentGuidanceSummary,\n type RunInitAgentGuidanceOptions,\n type RunInitAgentGuidanceResult,\n} from \"./init-agent-guidance.js\";\nexport {\n runInit,\n summarizeInitResult,\n _testOnly as _testOnlyInit,\n type InitAgentGuidanceResult,\n type InitConciseResult,\n type InitInstalledPackagesSummary,\n type InitRegisteredTypePresetSummary,\n type InitTargetResolution,\n type InitTypePresetName,\n} from \"./init.js\";\nexport {\n PROFILE_SUBCOMMANDS,\n formatProfileApplyHuman,\n formatProfileLintHuman,\n formatProfileListHuman,\n formatProfileShowHuman,\n runProfileApply,\n runProfileLint,\n runProfileList,\n runProfileShow,\n type ProfileApplyDimension,\n type ProfileComposition,\n type ProfileListEntry,\n} from \"./profile.js\";\nimport {\n EXTENSION_CAPABILITY_CONTRACT,\n EXTENSION_CAPABILITY_CONTRACT_VERSION,\n EXTENSION_CAPABILITY_LEGACY_ALIASES,\n KNOWN_EXTENSION_CAPABILITIES,\n KNOWN_EXTENSION_POLICY_MODES,\n KNOWN_EXTENSION_POLICY_SURFACES,\n KNOWN_EXTENSION_SANDBOX_PROFILES,\n KNOWN_EXTENSION_TRUST_MODES,\n} from \"../core/extensions/loader.js\";\nexport { RESERVED_ITEM_FIELD_NAMES } from \"../core/extensions/item-fields.js\";\nexport {\n PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,\n PM_PACKAGE_RESOURCE_KINDS,\n collectPackageExtensionDirectories,\n readPmPackageManifest,\n type PmPackageCatalogLinkMap,\n type PmPackageCatalogMediaMap,\n type PmPackageCatalogMetadata,\n type PmPackageManifest,\n type PmPackageResourceKind,\n type PmPackageResourceMap,\n} from \"../core/packages/manifest.js\";\nexport type {\n CommanderOptionAliasContract,\n CommanderOptionRegistrationContract,\n} from \"./cli-contracts.js\";\nexport {\n ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,\n APPEND_FLAG_CONTRACTS,\n CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,\n CALENDAR_FLAG_CONTRACTS,\n CLAIM_FLAG_CONTRACTS,\n CLOSE_FLAG_CONTRACTS,\n CLOSE_MANY_FLAG_CONTRACTS,\n CLOSE_TASK_FLAG_CONTRACTS,\n COMMENTS_FLAG_CONTRACTS,\n COMPLETION_FLAG_CONTRACTS,\n CONFIG_FLAG_CONTRACTS,\n CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,\n CONTEXT_FLAG_CONTRACTS,\n CONTRACTS_FLAG_CONTRACTS,\n COPY_FLAG_CONTRACTS,\n CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,\n CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,\n CREATE_COMMANDER_STRING_OPTION_CONTRACTS,\n CREATE_FLAG_CONTRACTS,\n DELETE_FLAG_CONTRACTS,\n DEPS_FLAG_CONTRACTS,\n DOCS_FLAG_CONTRACTS,\n EVAL_FLAG_CONTRACTS,\n EXTENSION_ACTIVATE_FLAG_CONTRACTS,\n EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,\n EXTENSION_ADOPT_FLAG_CONTRACTS,\n EXTENSION_CATALOG_FLAG_CONTRACTS,\n EXTENSION_DEACTIVATE_FLAG_CONTRACTS,\n EXTENSION_DESCRIBE_FLAG_CONTRACTS,\n EXTENSION_DOCTOR_FLAG_CONTRACTS,\n EXTENSION_EXPLORE_FLAG_CONTRACTS,\n EXTENSION_FLAG_CONTRACTS,\n EXTENSION_INIT_FLAG_CONTRACTS,\n EXTENSION_INSTALL_FLAG_CONTRACTS,\n EXTENSION_MANAGE_FLAG_CONTRACTS,\n EXTENSION_RELOAD_FLAG_CONTRACTS,\n EXTENSION_SCOPE_FLAG_CONTRACTS,\n EXTENSION_UNINSTALL_FLAG_CONTRACTS,\n FILES_FLAG_CONTRACTS,\n FOCUS_FLAG_CONTRACTS,\n GC_FLAG_CONTRACTS,\n GET_FLAG_CONTRACTS,\n GLOBAL_FLAG_CONTRACTS,\n GUIDE_FLAG_CONTRACTS,\n HEALTH_FLAG_CONTRACTS,\n HISTORY_COMPACT_FLAG_CONTRACTS,\n HISTORY_FLAG_CONTRACTS,\n HISTORY_REDACT_FLAG_CONTRACTS,\n HISTORY_REPAIR_FLAG_CONTRACTS,\n INIT_FLAG_CONTRACTS,\n INSTALL_FLAG_CONTRACTS,\n LEARNINGS_FLAG_CONTRACTS,\n LIST_COMMANDER_STRING_OPTION_CONTRACTS,\n LIST_FILTER_FLAG_CONTRACTS,\n MEET_FLAG_CONTRACTS,\n NEXT_COMMANDER_STRING_OPTION_CONTRACTS,\n NEXT_FLAG_CONTRACTS,\n NOTES_FLAG_CONTRACTS,\n PACKAGE_FLAG_CONTRACTS,\n PACKAGE_INIT_FLAG_CONTRACTS,\n PAUSE_TASK_FLAG_CONTRACTS,\n PLAN_FLAG_CONTRACTS,\n PM_CORE_COMMAND_NAMES,\n PM_EXTENSION_CAPABILITY_CONTRACTS,\n PM_EXTENSION_POLICY_MODE_CONTRACTS,\n PM_EXTENSION_POLICY_SURFACE_CONTRACTS,\n PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,\n PM_EXTENSION_SERVICE_NAME_CONTRACTS,\n PM_EXTENSION_TRUST_MODE_CONTRACTS,\n PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,\n PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,\n PM_TOOL_ACTIONS,\n PM_TOOL_ACTION_PARAMETER_CONTRACTS,\n PM_TOOL_PARAMETERS_SCHEMA,\n PM_TOOL_PARAMETERS_SCHEMA_MAJOR,\n PM_TOOL_PARAMETERS_SCHEMA_VERSION,\n PROFILE_FLAG_CONTRACTS,\n REINDEX_FLAG_CONTRACTS,\n RELEASE_FLAG_CONTRACTS,\n REMIND_FLAG_CONTRACTS,\n RESTORE_FLAG_CONTRACTS,\n SCHEMA_FLAG_CONTRACTS,\n SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,\n SEARCH_FLAG_CONTRACTS,\n START_TASK_FLAG_CONTRACTS,\n STATS_FLAG_CONTRACTS,\n SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,\n TELEMETRY_FLAG_CONTRACTS,\n TEST_ALL_FLAG_CONTRACTS,\n TEST_FLAG_CONTRACTS,\n TEST_RUNS_FLAG_CONTRACTS,\n TOOL_ACTIVITY_OPTION_CONTRACTS,\n TOOL_AGGREGATE_OPTION_CONTRACTS,\n TOOL_CALENDAR_OPTION_CONTRACTS,\n TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,\n TOOL_CONTEXT_OPTION_CONTRACTS,\n TOOL_CREATE_OPTION_CONTRACTS,\n TOOL_DEPS_OPTION_CONTRACTS,\n TOOL_LIST_FILTER_OPTION_CONTRACTS,\n TOOL_SEARCH_FILTER_OPTION_CONTRACTS,\n TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,\n TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,\n TOOL_UPDATE_OPTION_CONTRACTS,\n UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,\n UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,\n UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,\n UPDATE_FLAG_CONTRACTS,\n UPDATE_MANY_FLAG_CONTRACTS,\n UPGRADE_FLAG_CONTRACTS,\n compactFlagAliasContracts,\n isPmExtensionCapabilityContract,\n isPmExtensionPolicyModeContract,\n isPmExtensionPolicySurfaceContract,\n isPmExtensionServiceNameContract,\n isPmToolAction,\n readFirstStringFromCommanderOptions,\n readFirstValueFromCommanderOptions,\n readStringArrayFromCommanderOptions,\n resolveSubcommandFlagContractsForCommand,\n toCompletionFlagString,\n withFlagAliasMetadata,\n} from \"./cli-contracts.js\";\nexport type {\n CliFlagContract,\n PmActionSchemaContract,\n PmExtensionCapabilityContract,\n PmExtensionPolicyModeContract,\n PmExtensionPolicySurfaceContract,\n PmExtensionSandboxProfileContract,\n PmExtensionServiceNameContract,\n PmExtensionTrustModeContract,\n PmToolAction,\n ToolOptionFlagContract,\n} from \"./cli-contracts.js\";\nexport * from \"./compose.js\";\nexport * from \"./context-relevance.js\";\nexport * from \"./context-packing.js\";\nexport * from \"./context-usage.js\";\nexport * from \"./history-compact.js\";\nexport * from \"./history-read.js\";\nexport * from \"./history-redact.js\";\nexport * from \"./history-repair.js\";\nexport * from \"./item-children.js\";\nexport * from \"./item-schedule.js\";\nexport {\n collectDanglingDependencyReferences,\n runDeps,\n type DanglingDependencyReference,\n type DanglingDependencyReferenceSummary,\n type DependencyReferenceHolder,\n type DepsCollapseMode,\n type DepsFormat,\n type DepsGraphEdge,\n type DepsGraphNode,\n type DepsGraphResult,\n type DepsTreeNode,\n} from \"./dependencies.js\";\nexport { runDocs } from \"./docs.js\";\nexport {\n runFiles,\n runFilesDiscover,\n type FilesDiscoveryCandidate,\n} from \"./files.js\";\nexport {\n applyPathMigrations,\n applyStandaloneNote,\n artifactKey,\n dedupeLinkedArtifacts,\n ensureScope,\n expandAddGlobEntries,\n normalizeLinkedPath,\n parseAddEntries,\n parseAddGlobEntries,\n parseMigrateEntries,\n parseRemoveEntries,\n renameArtifactsResultKey,\n runLinkedArtifacts,\n sortLinkedArtifacts,\n validateLinkedPaths,\n type AddGlobEntry,\n type LinkedArtifact,\n type LinkedArtifactCommandOptions,\n type LinkedArtifactKindConfig,\n type LinkedArtifactResult,\n type LinkedPathValidation,\n type PathMigration,\n} from \"./linked-artifacts.js\";\nexport * from \"./pagination.js\";\nexport * from \"./output.js\";\nexport * from \"./relationship-analytics.js\";\nexport * from \"./relationship-context.js\";\nexport * from \"./relationship-history.js\";\nexport * from \"./relationships.js\";\nexport type {\n PlanCommandOptions,\n PlanCommandResult,\n PlanDispatchInput,\n PlanResultPlan,\n PlanShowDepth,\n PlanStepSummary,\n PlanSubcommand,\n PlanTemplateName,\n} from \"../cli/commands/plan.js\";\nexport {\n PLAN_SHOW_DEPTH_VALUES,\n PLAN_SUBCOMMANDS,\n PLAN_TEMPLATE_NAMES,\n} from \"../cli/commands/plan.js\";\nexport * from \"./define.js\";\nexport {\n BASELINE_ITEM_FORMAT_VERSION,\n BUILTIN_ITEM_TYPE_VALUES,\n CONFIDENCE_TEXT_VALUES,\n CURRENT_ITEM_FORMAT_VERSION,\n DEPENDENCY_KIND_VALUES,\n EXIT_CODE,\n ISSUE_SEVERITY_VALUES,\n ITEM_TYPE_VALUES,\n PM_CLI_EXPECTED_ERROR_NAME,\n PmCliError,\n PmClient,\n RISK_VALUES,\n STATUS_VALUES,\n acquireLock,\n appendHistoryEntry,\n canonicalDocument,\n classifyItemFormatVersion,\n clearWorkspaceContractsCache,\n commitImportedItem,\n createHistoryEntry,\n createPmCliExpectedError,\n effectiveItemFormatVersion,\n emptyImportedDocument,\n ensureTrackerInitialized,\n generateItemId,\n getActiveExtensionRegistrations,\n getContracts,\n getHistoryPath,\n getItemPath,\n getSettingsPath,\n getWorkspaceContracts,\n isPmCliExpectedError,\n isTimestampLiteral,\n listAllItemMetadata,\n loadCreateTemplateOptions,\n locateItem,\n normalizeItemMetadata,\n normalizeItemFormatVersion,\n normalizeItemId,\n normalizeRawItemId,\n normalizeStatusInput,\n nowIso,\n parseTags,\n pathExists,\n readBooleanOption,\n readCsvListOption,\n readFileIfExists,\n readLocatedItem,\n readRequiredString,\n readSettings,\n readStringOption,\n removeFileIfExists,\n renderCalendarMarkdown,\n renderCalendarToon,\n renderGuideMarkdown,\n resolveCalendarOutputFormat,\n resolveGuideOutputFormat,\n resolveItemTypeRegistry,\n resolvePmRoot,\n resolveRuntimeFieldRegistry,\n resolveRuntimeStatusRegistry,\n runAction,\n runActiveOnReadHooks,\n runActiveOnWriteHooks,\n runCalendar,\n runCompletion,\n runGuide,\n runReindex,\n runSearch,\n runTemplatesList,\n runTemplatesSave,\n runTemplatesShow,\n runTestRunsList,\n runTestRunsLogs,\n runTestRunsResume,\n runTestRunsStatus,\n runTestRunsStop,\n scanItemFormatVersions,\n selectImportAuthor,\n serializeItemDocument,\n splitFrontMatter,\n toEstimatedMinutesValue,\n toImportBoolean,\n toImportConfidence,\n toImportInteger,\n toImportLinkedDocs,\n toImportLinkedFiles,\n toImportLinkedTests,\n toImportLogEntries,\n toImportNormalizedEnum,\n toImportNumberMap,\n toImportPriority,\n toImportStatus,\n toImportStringList,\n toImportStringMap,\n toImportTags,\n toNonEmptyImportString,\n writeFileAtomic,\n aggregate,\n append,\n claim,\n claimNext,\n close,\n closeTask,\n comments,\n config,\n context,\n copy,\n create,\n deleteItem,\n deps,\n docs,\n extension,\n extensionActivate,\n extensionDeactivate,\n extensionList,\n files,\n filesDiscover,\n focus,\n gc,\n get,\n health,\n historyCompact,\n historyCompactBulk,\n historyRedact,\n historyRepair,\n historyRepairAll,\n init,\n learnings,\n list,\n next,\n notes,\n packageActivate,\n packageCatalog,\n packageDeactivate,\n packageDescribe,\n packageDoctor,\n packageInstall,\n packageLifecycle,\n packageList,\n packageManage,\n packageReload,\n packageUninstall,\n pauseTask,\n profile,\n profileApply,\n profileLint,\n profileList,\n profileShow,\n release,\n restore,\n schema,\n schemaAddField,\n schemaAddStatus,\n schemaAddType,\n schemaApplyPreset,\n schemaInferTypes,\n schemaList,\n schemaListFields,\n schemaRemoveField,\n schemaRemoveStatus,\n schemaRemoveType,\n schemaShow,\n schemaShowField,\n schemaShowStatus,\n search,\n startTask,\n stats,\n update,\n upgrade,\n validate,\n type AggregateOptions,\n type AggregateResult,\n type AggregateRow,\n type AppendCommandOptions,\n type AppendResult,\n type BlockerEntry,\n type CalendarOptions,\n type CalendarResult,\n type ClaimResult,\n type CloseResult,\n type CloseTaskResult,\n type CommitImportedItemParams,\n type CommitImportedItemResult,\n type CommentsCommandOptions,\n type CommentsResult,\n type ConfigCommandOptions,\n type ConfigResult,\n type CompletionResult,\n type CompletionShell,\n type ContractsCommandOptions,\n type ContractsResult,\n type ContextFocusItem,\n type ContextOptions,\n type ContextOutputFormat,\n type ContextResult,\n type CopyResult,\n type CreatePmCliExpectedErrorOptions,\n type CreateResult,\n type CreateTemplateOptions,\n type Dependency,\n type DeleteResult,\n type DepsCommandOptions,\n type DepsResult,\n type DocsCommandOptions,\n type DocsResult,\n type ExtensionCommandOptions,\n type ExtensionCommandResult,\n type FilesCommandOptions,\n type FilesDiscoverOptions,\n type FilesDiscoverResult,\n type FilesResult,\n type FocusResult,\n type GcCommandOptions,\n type GcResult,\n type GetContractsOptions,\n type GetOptions,\n type GetResult,\n type GuideDepth,\n type GuideOptions,\n type GuideOutputFormat,\n type GuideResult,\n type HealthResult,\n type ImportLinkedScope,\n type InitCommandOptions,\n type InitResult,\n type ItemFormatVersionScanEntry,\n type ItemFormatVersionScanResult,\n type ItemFormatVersionStatus,\n type LearningsCommandOptions,\n type LearningsResult,\n type LinkedDoc,\n type LinkedFile,\n type LinkedTest,\n type ListedItem,\n type ListCompactResult,\n type ListOptions,\n type ListResult,\n type ListSortField,\n type ListSortOrder,\n type ListVerboseResult,\n type LogNote,\n type NextActionableItem,\n type NextBlockerRef,\n type NextOptions,\n type NextOutputFormat,\n type NextRecommendation,\n type NextResult,\n type NotesCommandOptions,\n type NotesResult,\n type PackageCommandOptions,\n type PackageCommandResult,\n type PauseTaskResult,\n type PmActionInput,\n type PmActionName,\n type PmActionOptions,\n type PmClientFullMutationOptions,\n type PmClientMutationOptions,\n type PmClientOptions,\n type PmClientRunArgs,\n type PmCliExpectedError,\n type ProfileApplyCommandOptions,\n type ProfileApplyResult,\n type ProfileLintResult,\n type ProfileListResult,\n type ProfileResult,\n type ProfileShowResult,\n type ProfileSubcommand,\n type ReindexOptions,\n type ReindexResult,\n type ReleaseResult,\n type RestoreResult,\n type RunHealthOptions,\n type SchemaAddFieldCommandOptions,\n type SchemaAddFieldResult,\n type SchemaAddStatusCommandOptions,\n type SchemaAddStatusResult,\n type SchemaAddTypeCommandOptions,\n type SchemaAddTypeInferCommandOptions,\n type SchemaAddTypeInferResult,\n type SchemaAddTypeResult,\n type SchemaApplyPresetCommandOptions,\n type SchemaApplyPresetResult,\n type SchemaInspectResult,\n type SchemaListFieldsResult,\n type SchemaListResult,\n type SchemaRemoveFieldCommandOptions,\n type SchemaRemoveFieldResult,\n type SchemaRemoveStatusCommandOptions,\n type SchemaRemoveStatusResult,\n type SchemaRemoveTypeCommandOptions,\n type SchemaRemoveTypeResult,\n type SchemaShowFieldResult,\n type SchemaShowResult,\n type SchemaShowStatusResult,\n type SchemaResult,\n type SchemaSubcommand,\n type SearchCompactResult,\n type SearchHit,\n type SearchHitHighlight,\n type SearchMatchMode,\n type SearchOptions,\n type ClaimNextOptions,\n type SearchResult,\n type SearchResultItem,\n type SearchVerboseResult,\n type StartTaskResult,\n type StatsCommandOptions,\n type StatsResult,\n type TemplatesListResult,\n type TemplatesSaveResult,\n type TemplatesShowResult,\n type TestRunsListCommandOptions,\n type TestRunsLogsCommandOptions,\n type TestRunsResumeCommandOptions,\n type TestRunsStopCommandOptions,\n type ToImportLinkedArtifactsOptions,\n type ToImportLinkedTestsOptions,\n type ToImportLogEntriesOptions,\n type UpdateResult,\n type UpgradeCommandOptions,\n type UpgradeResult,\n type ValidateCommandOptions,\n type ValidateResult,\n type WorkspaceContracts,\n type WorkspaceContractsOptions,\n} from \"./runtime.js\";\nexport {\n BUILTIN_PROFILES,\n listProfiles,\n normalizeProfileName,\n PROFILE_NAMES,\n resolveProfile,\n type ProfileConfigEntry,\n type ProfileName,\n type ProfilePackageRecommendation,\n type ProfileTemplateEntry,\n type ProfileTemplateOptions,\n type ProjectProfileDefinition,\n type ProjectProfileRegistrationInput,\n} from \"../core/profile/profile-presets.js\";\nexport {\n planProfileApplication,\n type ProfileApplicationPlan,\n type ProfileChangeStatus,\n type ProfileComponentChange,\n type ProfileConfigChange,\n type ProfileConfigPlan,\n type ProfileCurrentState,\n type ProfilePackagePlan,\n type ProfileSchemaPlan,\n type ProfileTemplateChange,\n type ProfileTemplatePlan,\n type ProfileWorkflowChange,\n type ProfileWorkflowPlan,\n} from \"../core/profile/profile-plan.js\";\nexport {\n describeProfileComposition,\n describeProjectProfile,\n type ProjectProfileComposition,\n type ProjectProfileDescription,\n type ProjectProfilePackageSummary,\n} from \"../core/profile/profile-describe.js\";\nexport {\n lintProjectProfile,\n PROFILE_LINT_CODES,\n PROFILE_LINT_DIMENSIONS,\n type ProfileLintCode,\n type ProfileLintDimension,\n type ProfileLintSeverity,\n type ProjectProfileLintFinding,\n type ProjectProfileLintReport,\n} from \"../core/profile/profile-lint.js\";\nexport {\n assertExtensionBlueprint,\n assertExtensionCapabilityUsage,\n assertExtensionDeactivated,\n assertExtensionManifestCompatible,\n assertExtensionManifestMatchesBlueprint,\n assertExtensionPreflight,\n assertPackageManifest,\n assertProjectProfile,\n assertRegisteredCommandContract,\n assertRegisteredCommandOverride,\n assertRegisteredExporter,\n assertRegisteredFlags,\n assertRegisteredHook,\n assertRegisteredImporter,\n assertRegisteredItemField,\n assertRegisteredItemType,\n assertRegisteredMigration,\n assertRegisteredParserOverride,\n assertRegisteredPreflightOverride,\n assertRegisteredProfile,\n assertRegisteredRendererOverride,\n assertRegisteredSearchProvider,\n assertRegisteredServiceOverride,\n assertRegisteredVectorStoreAdapter,\n activateExtensionForTest,\n createExtensionTestHarness,\n deactivateExtensionForTest,\n describeExtensionActivation,\n runRegisteredCommandForTest,\n runRegisteredCommandOverrideForTest,\n runRegisteredExporterForTest,\n runRegisteredHookForTest,\n runRegisteredImporterForTest,\n runRegisteredMigrationForTest,\n runRegisteredParserOverrideForTest,\n runRegisteredPreflightOverrideForTest,\n runRegisteredRendererOverrideForTest,\n runRegisteredSearchProviderForTest,\n runRegisteredServiceOverrideForTest,\n runRegisteredVectorStoreAdapterForTest,\n type ActivateExtensionForTestOptions,\n type AssertProjectProfileOptions,\n type DeactivateExtensionForTestOptions,\n type DescribeExtensionActivationOptions,\n type ExtensionActivationSummary,\n type RenderExtensionHarnessMarkdownOptions,\n type RunRegisteredCommandForTestOptions,\n type RunRegisteredExporterForTestOptions,\n type RunRegisteredHookForTestOptions,\n type RunRegisteredImporterForTestOptions,\n type RunRegisteredMigrationForTestOptions,\n type RunRegisteredSearchProviderForTestOptions,\n type RunRegisteredVectorStoreAdapterForTestOptions,\n type SearchProviderOperationContexts,\n type SearchProviderOperationResults,\n type VectorStoreAdapterOperationContexts,\n type VectorStoreAdapterOperationResults,\n type ExtensionCapabilityUsageAssertion,\n type ExtensionCapabilityUsageExpectation,\n type ExtensionDeactivationExpectation,\n type ExtensionManifestBlueprintMatch,\n type ExtensionTestHarness,\n type PackageManifestExpectation,\n type PackageManifestResourceExpectation,\n type RegisteredCommandContractAssertion,\n type RegisteredCommandContractExpectation,\n type RegisteredCommandOverrideExpectation,\n type RegisteredExporterExpectation,\n type RegisteredFlagsExpectation,\n type RegisteredHookExpectation,\n type RegisteredHookKind,\n type RegisteredImporterExpectation,\n type RegisteredItemFieldAssertion,\n type RegisteredItemFieldExpectation,\n type RegisteredItemTypeAssertion,\n type RegisteredItemTypeExpectation,\n type RegisteredMigrationExpectation,\n type RegisteredParserOverrideExpectation,\n type RegisteredPreflightOverrideExpectation,\n type RegisteredProfileAssertion,\n type RegisteredProfileExpectation,\n type RegisteredRendererOverrideExpectation,\n type RegisteredSearchProviderExpectation,\n type RegisteredServiceOverrideExpectation,\n type RegisteredVectorStoreAdapterExpectation,\n} from \"./testing.js\";\n\n/**\n * Canonical extension capability names accepted by pm.\n *\n * Extension manifests should declare one or more of these values in\n * `capabilities`.\n */\nexport const EXTENSION_CAPABILITIES = KNOWN_EXTENSION_CAPABILITIES;\n/** Restricts extension capability values accepted by command, SDK, and storage contracts. */\nexport type ExtensionCapability = (typeof EXTENSION_CAPABILITIES)[number];\n\n/** Canonical extension governance policy modes and registration surfaces. */\nexport const EXTENSION_POLICY_MODES = KNOWN_EXTENSION_POLICY_MODES;\n/** Public contract for extension policy surfaces, shared by SDK and presentation-layer consumers. */\nexport const EXTENSION_POLICY_SURFACES = KNOWN_EXTENSION_POLICY_SURFACES;\n/** Public contract for extension trust modes, shared by SDK and presentation-layer consumers. */\nexport const EXTENSION_TRUST_MODES = KNOWN_EXTENSION_TRUST_MODES;\n/** Public contract for extension sandbox profiles, shared by SDK and presentation-layer consumers. */\nexport const EXTENSION_SANDBOX_PROFILES = KNOWN_EXTENSION_SANDBOX_PROFILES;\n/** Restricts extension policy mode values accepted by command, SDK, and storage contracts. */\nexport type ExtensionPolicyMode = (typeof EXTENSION_POLICY_MODES)[number];\n/** Restricts extension policy surface values accepted by command, SDK, and storage contracts. */\nexport type ExtensionPolicySurface = (typeof EXTENSION_POLICY_SURFACES)[number];\n/** Restricts extension trust mode values accepted by command, SDK, and storage contracts. */\nexport type ExtensionTrustMode = (typeof EXTENSION_TRUST_MODES)[number];\n/** Restricts extension sandbox profile values accepted by command, SDK, and storage contracts. */\nexport type ExtensionSandboxProfile =\n (typeof EXTENSION_SANDBOX_PROFILES)[number];\n\n/** Versioned capability contract metadata emitted by runtime diagnostics. */\nexport {\n EXTENSION_CAPABILITY_CONTRACT,\n EXTENSION_CAPABILITY_CONTRACT_VERSION,\n EXTENSION_CAPABILITY_LEGACY_ALIASES,\n};\n\n/** Least-privilege capability reconciliation helpers: map declared capabilities against the registration surfaces a package actually exercises at activation. */\nexport {\n EXTENSION_CAPABILITY_REGISTRATION_SURFACES,\n collectUsedExtensionCapabilities,\n reconcileExtensionCapabilityUsage,\n type CollectUsedExtensionCapabilitiesOptions,\n type ExtensionCapabilityUsageReconciliation,\n} from \"../core/extensions/capability-usage.js\";\n\n/**\n * Render an extension/package activation summary\n * ({@link describeExtensionActivation} / {@link describeExtensionBlueprint}) to a\n * deterministic Markdown reference document — the author-facing *render* leg of\n * the describe verb, for drift-free package READMEs.\n */\nexport {\n renderExtensionSurfaceMarkdown,\n type ExtensionSurfaceMarkdownOptions,\n} from \"../core/extensions/activation-summary-markdown.js\";\n\nexport type {\n AfterCommandAffectedItem,\n AfterCommandHook,\n AfterCommandHookContext,\n BeforeCommandHook,\n BeforeCommandHookContext,\n CommandDefinition,\n ExtensionCommandArgumentDefinition,\n CommandHandler,\n CommandHandlerContext,\n CommandHandlerResult,\n CommandOverride,\n CommandOverrideContext,\n ExtensionServiceName,\n Exporter,\n ExtensionActivationResult,\n ExtensionApi,\n ExtensionCommandRegistry,\n ExtensionDeactivationFailure,\n ExtensionDeactivationOptions,\n ExtensionDeactivationResult,\n ExtensionDiagnostic,\n ExtensionDiscoveryResult,\n ExtensionHookRegistry,\n ExtensionSelfIdentity,\n ExtensionLoadResult,\n ExtensionManifest,\n ExtensionManifestEngines,\n ExtensionGovernancePolicy,\n ExtensionPolicyOverride,\n ExtensionProvenanceMetadata,\n ExtensionRuntimePermissionDeclaration,\n ExtensionSearchMode,\n ExtensionParserRegistry,\n ExtensionPreflightRegistry,\n ExtensionRegistrationRegistry,\n ExtensionRendererRegistry,\n ExtensionServiceRegistry,\n FlagValueType,\n FlagDefinition,\n ImportExportContext,\n ImportExportRegistrationOptions,\n Importer,\n OnIndexHook,\n OnIndexHookContext,\n OnReadHook,\n OnReadHookContext,\n OnWriteHook,\n OnWriteHookContext,\n OutputRendererFormat,\n ParserOverride,\n ParserOverrideContext,\n ParserOverrideDelta,\n PreflightOverride,\n PreflightOverrideContext,\n PreflightOverrideDelta,\n PreflightRuntimeDecision,\n RegisteredExtensionExporter,\n RegisteredExtensionFlagDefinitions,\n RegisteredExtensionHook,\n RegisteredExtensionImporter,\n RegisteredExtensionProjectProfile,\n RegisteredExtensionSchemaMigrationDefinition,\n RegisteredExtensionSearchProvider,\n RegisteredExtensionServiceOverride,\n RegisteredExtensionVectorStoreAdapter,\n RendererOverride,\n RendererOverrideContext,\n SchemaFieldDefinition,\n SchemaItemTypeCommandOptionPolicyDefinition,\n SchemaItemTypeOptionDefinition,\n SchemaItemTypeDefinition,\n SchemaMigrationDefinition,\n SchemaMigrationRunContext,\n SchemaMigrationRunner,\n SearchProviderEmbedBatchContext,\n SearchProviderEmbedContext,\n SearchProviderDefinition,\n SearchProviderHit,\n SearchProviderQueryContext,\n SearchProviderQueryResult,\n ServiceOverride,\n ServiceOverrideContext,\n VectorStoreAdapterDefinition,\n VectorStoreDeleteContext,\n VectorStoreQueryContext,\n VectorStoreQueryHit,\n VectorStoreUpsertContext,\n VectorStoreUpsertPoint,\n} from \"../core/extensions/loader.js\";\n\nexport type { GlobalOptions } from \"../core/shared/command-types.js\";\nexport type {\n ItemDocument,\n ItemMetadata,\n ItemStatus,\n ItemType,\n PmSettings,\n} from \"../types/index.js\";\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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B,SAAO;AACT;AASM,SAAU,uBACd,MAAsB;AAEtB,SAAO;AACT;AAQM,SAAU,kBAAkB,MAAiB;AACjD,SAAO;AACT;AAQM,SAAU,iBAAiB,MAAgB;AAC/C,SAAO;AACT;AASM,SAAU,kBAAkB,MAAiB;AACjD,SAAO;AACT;;;;;;;;;;ACmdO,IAAM,yBAAyB;AAK/B,IAAM,yBAAyB;AAE/B,IAAM,4BAA4B;AAElC,IAAM,wBAAwB;AAE9B,IAAM,6BAA6B;",
|
|
3
|
+
"sources": ["../../../../../../../sdk/search-refresh-worker.ts", "../../../../../../../sdk/telemetry-flush.ts", "../../../../../../../sdk/relationship-analytics.ts", "../../../../../../../sdk/relationship-history.ts", "../../../../../../../sdk/define.ts", "../../../../../../../sdk/index.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @module sdk/search-refresh-worker\n *\n * Owns the detached semantic-refresh worker entry used by custom mutation hosts.\n */\nimport { runSemanticRefreshWorker } from \"../core/search/background-refresh.js\";\nimport { refreshSemanticEmbeddingsForMutatedItems } from \"../core/search/cache.js\";\nimport { resolvePmRoot } from \"../core/store/paths.js\";\n\n/** Drain the active workspace's pending semantic-refresh queue. */\nexport async function runSearchRefreshWorkerEntrypoint(): Promise<void> {\n const pmRoot = resolvePmRoot(process.cwd(), process.env.PM_PATH);\n await runSemanticRefreshWorker(pmRoot, (root, itemIds) =>\n refreshSemanticEmbeddingsForMutatedItems(root, itemIds, {\n apply_runtime_defaults: true,\n }),\n );\n}\n", "/**\n * @module sdk/telemetry-flush\n *\n * Owns explicit telemetry queue draining for embedded and detached hosts.\n */\nimport { flushTelemetryQueueNow } from \"../core/telemetry/runtime.js\";\n\n/** Flush the durable telemetry queue immediately. */\nexport async function flushTelemetryQueue(): Promise<void> {\n await flushTelemetryQueueNow();\n}\n", "/**\n * @module sdk/relationship-analytics\n *\n * Provides exact, deterministic graph analytics with explicit semantics and\n * provenance suitable for planning, impact analysis, and context selection.\n */\nimport type { RelationshipSnapshot } from \"./relationship-history.js\";\nimport {\n RelationshipGraph,\n RelationshipKindRegistry,\n createRelationshipKindRegistry,\n type RelationshipEdge,\n type RelationshipQueryOptions,\n} from \"./relationships.js\";\n\n/** Exact execution-graph analysis over registered ordering kinds. */\nexport interface RelationshipExecutionAnalysis {\n /** Whether the result is exact rather than sampled or approximate. */\n exact: true;\n /** Whether the order-bearing graph is acyclic. */\n acyclic: boolean;\n /** Deterministic topological order for acyclic nodes. */\n order: string[];\n /** Parallelizable topological layers. */\n layers: string[][];\n /** Nodes with no prerequisites. */\n frontier: string[];\n /** Longest prerequisite distance for each acyclic node. */\n depth: Record<string, number>;\n /** Longest deterministic execution path. */\n criticalPath: string[];\n /** Edge count of the critical path. */\n criticalPathLength: number;\n /** Strongly connected order-bearing components that represent cycles. */\n cycles: string[][];\n /** Semantic provenance for the analysis. */\n provenance: { algorithm: \"kahn-longest-path\"; edgeFamily: \"ordering\" };\n}\n\n/** One affected node with its exact shortest explanation path. */\nexport interface RelationshipImpactRow {\n /** Affected node identifier. */\n id: string;\n /** Shortest relationship distance from the root. */\n distance: number;\n /** Exact path explaining why the node is affected. */\n path: string[];\n}\n\n/** Bounded reverse- or forward-impact result. */\nexport interface RelationshipImpactAnalysis {\n /** Impact origin. */\n root: string;\n /** Deterministic affected-node rows. */\n affected: RelationshipImpactRow[];\n /** Returned rows are exact even when the bounded result is incomplete. */\n exact: true;\n /** Whether configured traversal bounds omitted reachable work. */\n truncated: boolean;\n /** Query work retained for performance and explainability. */\n cost: { visitedNodes: number; inspectedEdges: number };\n}\n\n/** Exact structural summary of the complete graph snapshot. */\nexport interface RelationshipKnowledgeAnalysis {\n /** Weakly connected components, largest then lexicographic. */\n components: string[][];\n /** Strongly connected components over directed stored edges. */\n stronglyConnected: string[][];\n /** Nodes with no relationship edges. */\n orphans: string[];\n /** Maximum-degree nodes and their unique-neighbor degree. */\n hubs: { id: string; degree: number }[];\n /** Whether the result is exact. */\n exact: true;\n /** Semantic provenance for the analysis. */\n provenance: { algorithm: \"component-degree\"; edgeFamily: \"all\" };\n}\n\n/** Edge-level delta between two immutable snapshots. */\nexport interface RelationshipSnapshotComparison {\n /** Earlier snapshot version. */\n fromVersion: number;\n /** Later snapshot version. */\n toVersion: number;\n /** Edges introduced in the later snapshot. */\n added: RelationshipEdge[];\n /** Edges absent from the later snapshot. */\n removed: RelationshipEdge[];\n /** Number of byte-equivalent edges retained. */\n unchangedCount: number;\n /** Whether the comparison is exact. */\n exact: true;\n}\n\n/** Registry override for custom domain semantics. */\nexport interface RelationshipAnalyticsOptions {\n /** Registry used to interpret ordering direction and custom kinds. */\n registry?: RelationshipKindRegistry;\n}\n\nfunction appendNeighbor(\n adjacency: Map<string, Set<string>>,\n source: string,\n target: string,\n): void {\n adjacency.get(source)!.add(target);\n}\n\nfunction createAdjacency(nodes: readonly string[]): Map<string, Set<string>> {\n return new Map(nodes.map((node) => [node, new Set<string>()]));\n}\n\nfunction sortComponents(components: string[][]): string[][] {\n for (const component of components) component.sort();\n return components.sort(\n (left, right) =>\n right.length - left.length || left[0]!.localeCompare(right[0]!),\n );\n}\n\nfunction stableJsonValue(value: unknown): unknown {\n if (Array.isArray(value)) return value.map((entry) => stableJsonValue(entry));\n if (value === null || typeof value !== \"object\") return value;\n const toJSON = (value as { toJSON?: (this: object) => unknown }).toJSON;\n if (typeof toJSON === \"function\") return stableJsonValue(toJSON.call(value));\n return Object.fromEntries(\n Object.entries(value)\n .sort(([left], [right]) => left.localeCompare(right))\n .map(([key, entry]) => [key, stableJsonValue(entry)]),\n );\n}\n\nfunction relationshipEdgeKey(edge: RelationshipEdge): string {\n return JSON.stringify(stableJsonValue(edge));\n}\n\nfunction appendFinishingOrder(\n start: string,\n adjacency: ReadonlyMap<string, ReadonlySet<string>>,\n visited: Set<string>,\n order: string[],\n): void {\n const stack = [{ id: start, expanded: false }];\n while (stack.length > 0) {\n const current = stack.pop()!;\n if (current.expanded) {\n order.push(current.id);\n continue;\n }\n if (visited.has(current.id)) continue;\n visited.add(current.id);\n stack.push({ id: current.id, expanded: true });\n const neighbors = [...adjacency.get(current.id)!].sort().reverse();\n for (const neighbor of neighbors)\n if (!visited.has(neighbor)) stack.push({ id: neighbor, expanded: false });\n }\n}\n\nfunction computeFinishingOrder(\n nodes: readonly string[],\n adjacency: ReadonlyMap<string, ReadonlySet<string>>,\n): string[] {\n const visited = new Set<string>();\n const order: string[] = [];\n for (const start of nodes)\n if (!visited.has(start))\n appendFinishingOrder(start, adjacency, visited, order);\n return order;\n}\n\nfunction collectReverseComponents(\n order: readonly string[],\n reverse: ReadonlyMap<string, ReadonlySet<string>>,\n): string[][] {\n const visited = new Set<string>();\n const components: string[][] = [];\n for (const start of [...order].reverse()) {\n if (visited.has(start)) continue;\n const component: string[] = [];\n const stack = [start];\n visited.add(start);\n while (stack.length > 0) {\n const current = stack.pop()!;\n component.push(current);\n for (const neighbor of reverse.get(current)!) {\n if (visited.has(neighbor)) continue;\n visited.add(neighbor);\n stack.push(neighbor);\n }\n }\n components.push(component);\n }\n return sortComponents(components);\n}\n\nfunction stronglyConnectedComponents(\n nodes: readonly string[],\n adjacency: ReadonlyMap<string, ReadonlySet<string>>,\n): string[][] {\n const reverse = createAdjacency(nodes);\n for (const [source, targets] of adjacency)\n for (const target of targets) appendNeighbor(reverse, target, source);\n return collectReverseComponents(\n computeFinishingOrder(nodes, adjacency),\n reverse,\n );\n}\n\nfunction buildExecutionAdjacency(\n graph: RelationshipGraph,\n registry: RelationshipKindRegistry,\n): Map<string, Set<string>> {\n const adjacency = createAdjacency(graph.nodes());\n for (const edge of graph.edges()) {\n const definition = registry.require(edge.kind);\n if (!definition.ordering) continue;\n // Legacy and JSON-parsed definitions may predate explicit precedence.\n const sourceFirst =\n (definition.precedence ?? \"source_before_target\") ===\n \"source_before_target\";\n appendNeighbor(\n adjacency,\n sourceFirst ? edge.source : edge.target,\n sourceFirst ? edge.target : edge.source,\n );\n }\n return adjacency;\n}\n\nfunction topologicalLayers(\n nodes: readonly string[],\n adjacency: ReadonlyMap<string, ReadonlySet<string>>,\n): string[][] {\n const indegree = new Map(nodes.map((node) => [node, 0]));\n for (const targets of adjacency.values())\n for (const target of targets)\n indegree.set(target, indegree.get(target)! + 1);\n let frontier = nodes.filter((node) => indegree.get(node) === 0).sort();\n const layers: string[][] = [];\n while (frontier.length > 0) {\n layers.push(frontier);\n const next: string[] = [];\n for (const source of frontier) {\n for (const target of adjacency.get(source)!) {\n const remaining = indegree.get(target)! - 1;\n indegree.set(target, remaining);\n if (remaining === 0) next.push(target);\n }\n }\n frontier = next.sort();\n }\n return layers;\n}\n\nfunction longestPath(\n order: readonly string[],\n adjacency: ReadonlyMap<string, ReadonlySet<string>>,\n): { depth: Record<string, number>; path: string[] } {\n const depth = new Map(order.map((node) => [node, 0]));\n const parent = new Map<string, string>();\n for (const source of order) {\n for (const target of adjacency.get(source)!) {\n if (!depth.has(target)) continue;\n const candidate = depth.get(source)! + 1;\n const currentParent = parent.get(target);\n if (\n candidate > depth.get(target)! ||\n (candidate === depth.get(target)! &&\n (currentParent === undefined ||\n source.localeCompare(currentParent) < 0))\n ) {\n depth.set(target, candidate);\n parent.set(target, source);\n }\n }\n }\n const end = [...order].sort(\n (left, right) =>\n depth.get(right)! - depth.get(left)! || left.localeCompare(right),\n )[0];\n const path = end === undefined ? [] : [end];\n while (path[0] !== undefined && parent.has(path[0]!))\n path.unshift(parent.get(path[0]!)!);\n return { depth: Object.fromEntries(depth), path };\n}\n\nfunction reconstructImpactPath(\n root: string,\n target: string,\n parents: ReadonlyMap<string, string>,\n): string[] {\n const path = [target];\n let cursor = target;\n while (cursor !== root) {\n cursor = parents.get(cursor)!;\n path.push(cursor);\n }\n return path.reverse();\n}\n\n/** Analyze registered order-bearing relationships without treating associative cycles as blockers. */\nexport function analyzeRelationshipExecution(\n graph: RelationshipGraph,\n options: RelationshipAnalyticsOptions = {},\n): RelationshipExecutionAnalysis {\n const registry = options.registry ?? createRelationshipKindRegistry();\n const nodes = [...graph.nodes()];\n const adjacency = buildExecutionAdjacency(graph, registry);\n const layers = topologicalLayers(nodes, adjacency);\n const order = layers.flat();\n const acyclic = order.length === nodes.length;\n const cycles = acyclic\n ? []\n : stronglyConnectedComponents(nodes, adjacency).filter(\n (component) =>\n component.length > 1 ||\n adjacency.get(component[0]!)!.has(component[0]!),\n );\n const longest = longestPath(order, adjacency);\n return {\n exact: true,\n acyclic,\n order,\n layers,\n frontier: layers[0] ?? [],\n depth: longest.depth,\n criticalPath: longest.path,\n criticalPathLength: Math.max(0, longest.path.length - 1),\n cycles,\n provenance: { algorithm: \"kahn-longest-path\", edgeFamily: \"ordering\" },\n };\n}\n\n/** Compute bounded impact rows and exact shortest explanation paths. */\nexport function analyzeGraphImpact(\n graph: RelationshipGraph,\n root: string,\n options: RelationshipQueryOptions = {},\n): RelationshipImpactAnalysis {\n const direction = options.direction ?? \"outgoing\";\n const maxDepth = options.maxDepth ?? Number.POSITIVE_INFINITY;\n const limit = options.limit ?? Number.POSITIVE_INFINITY;\n const queue = [{ id: root, depth: 0 }];\n const seen = new Set([root]);\n const parents = new Map<string, string>();\n const affected: RelationshipImpactRow[] = [];\n let visitedNodes = 0;\n let inspectedEdges = 0;\n let truncated = false;\n traversal: for (let index = 0; index < queue.length; index += 1) {\n options.signal?.throwIfAborted();\n const current = queue[index]!;\n visitedNodes += 1;\n const adjacent = graph.adjacency(current.id, {\n direction,\n kinds: options.kinds,\n signal: options.signal,\n });\n inspectedEdges += adjacent.meta.inspectedEdges;\n if (current.depth >= maxDepth) {\n if (adjacent.value.some((id) => !seen.has(id))) truncated = true;\n continue;\n }\n for (const id of adjacent.value) {\n if (seen.has(id)) continue;\n if (affected.length >= limit) {\n truncated = true;\n break traversal;\n }\n seen.add(id);\n parents.set(id, current.id);\n const depth = current.depth + 1;\n affected.push({\n id,\n distance: depth,\n path: reconstructImpactPath(root, id, parents),\n });\n queue.push({ id, depth });\n }\n }\n return {\n root,\n affected,\n exact: true,\n truncated,\n cost: { visitedNodes, inspectedEdges },\n };\n}\n\n/** Analyze weak/strong components, isolates, and exact unique-neighbor hubs. */\nexport function analyzeKnowledgeGraph(\n graph: RelationshipGraph,\n): RelationshipKnowledgeAnalysis {\n const nodes = [...graph.nodes()];\n const weak = createAdjacency(nodes);\n const directed = createAdjacency(nodes);\n for (const edge of graph.edges()) {\n appendNeighbor(weak, edge.source, edge.target);\n appendNeighbor(weak, edge.target, edge.source);\n appendNeighbor(directed, edge.source, edge.target);\n }\n const components: string[][] = [];\n const visited = new Set<string>();\n for (const start of nodes) {\n if (visited.has(start)) continue;\n const component: string[] = [];\n const stack = [start];\n visited.add(start);\n while (stack.length > 0) {\n const current = stack.pop()!;\n component.push(current);\n for (const neighbor of weak.get(current)!) {\n if (visited.has(neighbor)) continue;\n visited.add(neighbor);\n stack.push(neighbor);\n }\n }\n components.push(component);\n }\n const degrees = nodes.map((id) => ({ id, degree: weak.get(id)!.size }));\n const maximum = Math.max(0, ...degrees.map(({ degree }) => degree));\n return {\n components: sortComponents(components),\n stronglyConnected: stronglyConnectedComponents(nodes, directed),\n orphans: degrees.filter(({ degree }) => degree === 0).map(({ id }) => id),\n hubs: degrees.filter(({ degree }) => degree > 0 && degree === maximum),\n exact: true,\n provenance: { algorithm: \"component-degree\", edgeFamily: \"all\" },\n };\n}\n\n/** Compare two immutable relationship snapshots by full normalized edge value. */\nexport function compareRelationshipSnapshots(\n before: RelationshipSnapshot,\n after: RelationshipSnapshot,\n): RelationshipSnapshotComparison {\n const earlier = new Map(\n before.edges.map((edge) => [relationshipEdgeKey(edge), edge]),\n );\n const later = new Map(\n after.edges.map((edge) => [relationshipEdgeKey(edge), edge]),\n );\n return {\n fromVersion: before.version,\n toVersion: after.version,\n added: [...later]\n .filter(([key]) => !earlier.has(key))\n .map(([, edge]) => edge),\n removed: [...earlier]\n .filter(([key]) => !later.has(key))\n .map(([, edge]) => edge),\n unchangedCount: [...earlier.keys()].filter((key) => later.has(key)).length,\n exact: true,\n };\n}\n", "/**\n * @module sdk/relationship-history\n *\n * Provides an append-only, storage-independent relationship event ledger with\n * optimistic concurrency, deterministic replay, snapshots, and cursor pages.\n */\nimport {\n createQueryFingerprint,\n decodeQueryCursorState,\n paginateQueryRows,\n} from \"./pagination.js\";\nimport { constants } from \"node:fs\";\nimport { lstat, mkdir, open, type FileHandle } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { acquireLock } from \"../core/lock/lock.js\";\nimport {\n RelationshipGraph,\n RelationshipKindRegistry,\n createRelationshipKindRegistry,\n type RelationshipEdge,\n} from \"./relationships.js\";\n\n/** Mutation kinds retained in the immutable relationship event stream. */\nexport type RelationshipEventAction = \"add\" | \"remove\" | \"supersede\";\n\n/** Caller-authored relationship mutation before its sequence is assigned. */\nexport interface RelationshipEventInput {\n /** Globally unique idempotency key for this event. */\n eventId: string;\n /** Stable logical relationship identifier across superseding events. */\n relationshipId: string;\n /** Append, remove, or replace the logical relationship. */\n action: RelationshipEventAction;\n /** Edge required for add and supersede actions. */\n edge?: RelationshipEdge;\n /** Attributable actor responsible for the mutation. */\n author: string;\n /** Valid event-time timestamp. */\n timestamp: string;\n /** Optional optimistic concurrency precondition. */\n expectedVersion?: number;\n /** Optional human-readable mutation rationale. */\n reason?: string;\n}\n\n/** One immutable sequenced relationship mutation. */\nexport interface RelationshipEvent extends Omit<\n RelationshipEventInput,\n \"expectedVersion\"\n> {\n /** One-based append sequence assigned by the ledger. */\n sequence: number;\n}\n\n/** Point-in-time materialized relationship view. */\nexport interface RelationshipSnapshot {\n /** Final event sequence included in this snapshot. */\n version: number;\n /** Timestamp of the final included event, when one exists. */\n asOf?: string;\n /** Deterministic active edge materialization. */\n edges: readonly RelationshipEdge[];\n /** Immutable graph query view over the active edges. */\n graph: RelationshipGraph;\n}\n\n/** Stable cursor page over a fixed relationship event-log version. */\nexport interface RelationshipEventPage {\n /** Log version against which this page was produced. */\n version: number;\n /** Events in append order. */\n events: RelationshipEvent[];\n /** Whether another event page exists. */\n hasMore: boolean;\n /** Opaque continuation cursor when another page exists. */\n nextCursor?: string;\n}\n\n/** Construction controls for the in-memory reference ledger. */\nexport interface RelationshipEventLogOptions {\n /** Registry defining edge semantics and cardinality. */\n registry?: RelationshipKindRegistry;\n}\n\n/** Filesystem controls for the durable relationship event store. */\nexport interface RelationshipEventStoreOptions extends RelationshipEventLogOptions {\n /** Tracker root that owns the relationship history directory. */\n pmRoot: string;\n /** Fixed node universe validated by every replay and append. */\n nodes: Iterable<string>;\n /** Optional JSONL path relative to the tracker root. */\n relativePath?: string;\n}\n\ninterface RelationshipCardinalityIndexes {\n identities: Map<string, string>;\n outgoingOne: Map<string, string>;\n incomingOne: Map<string, string>;\n}\n\nfunction requiredText(value: unknown, field: string): string {\n if (typeof value !== \"string\" || value.trim().length === 0)\n throw new TypeError(`Relationship event ${field} must be non-empty`);\n return value.trim();\n}\n\nfunction edgeIdentity(\n edge: RelationshipEdge,\n registry: RelationshipKindRegistry,\n): string {\n const definition = registry.require(edge.kind);\n const endpoints =\n definition.direction === \"undirected\"\n ? [edge.source, edge.target].sort().join(\"\\u0000\")\n : `${edge.source}\\u0000${edge.target}`;\n return `${definition.kind}\\u0000${endpoints}`;\n}\n\nfunction freezeEdge(edge: RelationshipEdge): RelationshipEdge {\n return Object.freeze({\n ...edge,\n ...(edge.payload === undefined\n ? {}\n : { payload: Object.freeze(structuredClone(edge.payload)) }),\n });\n}\n\nfunction assertCardinality(\n candidate: RelationshipEdge,\n excludeRelationshipId: string,\n registry: RelationshipKindRegistry,\n indexes: RelationshipCardinalityIndexes,\n): void {\n const definition = registry.require(candidate.kind);\n const outgoingOwner = indexes.outgoingOne.get(\n `${definition.kind}\\u0000${candidate.source}`,\n );\n if (outgoingOwner !== undefined && outgoingOwner !== excludeRelationshipId)\n throw new TypeError(\n `Relationship outgoing cardinality exceeded for ${definition.kind}`,\n );\n const incomingOwner = indexes.incomingOne.get(\n `${definition.kind}\\u0000${candidate.target}`,\n );\n if (incomingOwner !== undefined && incomingOwner !== excludeRelationshipId)\n throw new TypeError(\n `Relationship incoming cardinality exceeded for ${definition.kind}`,\n );\n const identity = edgeIdentity(candidate, registry);\n const identityOwner = indexes.identities.get(identity);\n if (identityOwner !== undefined && identityOwner !== excludeRelationshipId)\n throw new TypeError(`Relationship edge already active: ${identity}`);\n}\n\nfunction replayEvents(\n events: readonly RelationshipEvent[],\n): Map<string, RelationshipEdge> {\n const active = new Map<string, RelationshipEdge>();\n for (const event of events) {\n if (event.action === \"remove\") active.delete(event.relationshipId);\n else active.set(event.relationshipId, event.edge!);\n }\n return active;\n}\n\nfunction normalizeEventHeader(\n input: RelationshipEventInput,\n currentVersion: number,\n eventIds: ReadonlySet<string>,\n): {\n eventId: string;\n relationshipId: string;\n author: string;\n timestamp: string;\n} {\n if (\n input.expectedVersion !== undefined &&\n input.expectedVersion !== currentVersion\n )\n throw new TypeError(\n `Relationship event version conflict: expected ${input.expectedVersion}, current ${currentVersion}`,\n );\n const eventId = requiredText(input.eventId, \"eventId\");\n if (eventIds.has(eventId))\n throw new TypeError(`Relationship event already exists: ${eventId}`);\n if (\n input.action !== \"add\" &&\n input.action !== \"remove\" &&\n input.action !== \"supersede\"\n )\n throw new TypeError(`Unknown relationship event action: ${input.action}`);\n if (!Number.isFinite(Date.parse(input.timestamp)))\n throw new TypeError(\"Relationship event timestamp must be valid\");\n return {\n eventId,\n relationshipId: requiredText(input.relationshipId, \"relationshipId\"),\n author: requiredText(input.author, \"author\"),\n timestamp: new Date(input.timestamp).toISOString(),\n };\n}\n\nfunction resolveMutationEdge(\n input: RelationshipEventInput,\n relationshipId: string,\n active: ReadonlyMap<string, RelationshipEdge>,\n nodes: ReadonlySet<string>,\n registry: RelationshipKindRegistry,\n indexes: RelationshipCardinalityIndexes,\n): RelationshipEdge | undefined {\n const isActive = active.has(relationshipId);\n if (input.action === \"add\" && isActive)\n throw new TypeError(`Relationship is already active: ${relationshipId}`);\n if (input.action !== \"add\" && !isActive)\n throw new TypeError(`Relationship is not active: ${relationshipId}`);\n if (input.action === \"remove\") return undefined;\n if (!input.edge)\n throw new TypeError(`Relationship ${input.action} event requires an edge`);\n const source =\n typeof input.edge.source === \"string\" ? input.edge.source.trim() : \"\";\n const target =\n typeof input.edge.target === \"string\" ? input.edge.target.trim() : \"\";\n if (!nodes.has(source) || !nodes.has(target))\n throw new TypeError(\n `Relationship endpoint not found: ${source} -> ${target}`,\n );\n const canonical = new RelationshipGraph(\n [source, target],\n [input.edge],\n registry,\n ).edges()[0]!;\n assertCardinality(canonical, relationshipId, registry, indexes);\n return freezeEdge(canonical);\n}\n\n/**\n * Append-only in-memory reference ledger. Durable adapters can persist the\n * returned immutable events while reusing the same replay and validation model.\n */\nexport class RelationshipEventLog {\n readonly #nodes: ReadonlySet<string>;\n readonly #registry: RelationshipKindRegistry;\n readonly #events: RelationshipEvent[] = [];\n readonly #eventIds = new Set<string>();\n readonly #active = new Map<string, RelationshipEdge>();\n readonly #cardinalityIndexes: RelationshipCardinalityIndexes = {\n identities: new Map(),\n outgoingOne: new Map(),\n incomingOne: new Map(),\n };\n\n /** Create an empty relationship ledger for a fixed node universe. */\n public constructor(\n nodes: Iterable<string>,\n options: RelationshipEventLogOptions = {},\n ) {\n this.#nodes = new Set(\n [...nodes]\n .filter((node): node is string => typeof node === \"string\")\n .map((node) => node.trim())\n .filter(Boolean),\n );\n this.#registry = options.registry ?? createRelationshipKindRegistry();\n }\n\n /** Current append sequence. */\n public get version(): number {\n return this.#events.length;\n }\n\n /** Return an immutable copy of the full event stream. */\n public events(): readonly RelationshipEvent[] {\n return Object.freeze([...this.#events]);\n }\n\n /** Add one active relationship to constant-time validation indexes. */\n #indexActive(relationshipId: string, edge: RelationshipEdge): void {\n const definition = this.#registry.require(edge.kind);\n this.#cardinalityIndexes.identities.set(\n edgeIdentity(edge, this.#registry),\n relationshipId,\n );\n if (definition.outgoing === \"one\")\n this.#cardinalityIndexes.outgoingOne.set(\n `${definition.kind}\\u0000${edge.source}`,\n relationshipId,\n );\n if (definition.incoming === \"one\")\n this.#cardinalityIndexes.incomingOne.set(\n `${definition.kind}\\u0000${edge.target}`,\n relationshipId,\n );\n }\n\n /** Remove one superseded or deleted relationship from validation indexes. */\n #unindexActive(edge: RelationshipEdge): void {\n const definition = this.#registry.require(edge.kind);\n this.#cardinalityIndexes.identities.delete(\n edgeIdentity(edge, this.#registry),\n );\n if (definition.outgoing === \"one\")\n this.#cardinalityIndexes.outgoingOne.delete(\n `${definition.kind}\\u0000${edge.source}`,\n );\n if (definition.incoming === \"one\")\n this.#cardinalityIndexes.incomingOne.delete(\n `${definition.kind}\\u0000${edge.target}`,\n );\n }\n\n /** Validate and append one attributable relationship mutation. */\n public append(input: RelationshipEventInput): RelationshipEvent {\n const header = normalizeEventHeader(input, this.version, this.#eventIds);\n const previous = this.#active.get(header.relationshipId);\n const edge = resolveMutationEdge(\n input,\n header.relationshipId,\n this.#active,\n this.#nodes,\n this.#registry,\n this.#cardinalityIndexes,\n );\n\n const event = Object.freeze({\n eventId: header.eventId,\n relationshipId: header.relationshipId,\n action: input.action,\n ...(edge === undefined ? {} : { edge }),\n author: header.author,\n timestamp: header.timestamp,\n ...(input.reason?.trim() ? { reason: input.reason.trim() } : {}),\n sequence: this.version + 1,\n }) satisfies RelationshipEvent;\n this.#events.push(event);\n this.#eventIds.add(header.eventId);\n if (previous) this.#unindexActive(previous);\n if (input.action === \"remove\") this.#active.delete(header.relationshipId);\n else {\n this.#active.set(header.relationshipId, edge!);\n this.#indexActive(header.relationshipId, edge!);\n }\n return event;\n }\n\n /** Materialize an exact point-in-time graph without mutating the ledger. */\n public snapshot(\n options: {\n atVersion?: number;\n atTimestamp?: string;\n } = {},\n ): RelationshipSnapshot {\n if (options.atVersion !== undefined && options.atTimestamp !== undefined)\n throw new TypeError(\"Relationship snapshot accepts one target\");\n let included: RelationshipEvent[];\n if (options.atTimestamp !== undefined) {\n const timestamp = Date.parse(options.atTimestamp);\n if (!Number.isFinite(timestamp))\n throw new TypeError(\"Relationship snapshot timestamp must be valid\");\n let lastIndex = -1;\n for (let index = this.#events.length - 1; index >= 0; index -= 1) {\n if (Date.parse(this.#events[index]!.timestamp) > timestamp) continue;\n lastIndex = index;\n break;\n }\n included = lastIndex === -1 ? [] : this.#events.slice(0, lastIndex + 1);\n } else {\n const version = options.atVersion ?? this.version;\n if (!Number.isInteger(version) || version < 0 || version > this.version)\n throw new TypeError(\n `Relationship snapshot version out of range: ${version}`,\n );\n included = this.#events.slice(0, version);\n }\n const active = replayEvents(included);\n const graph = new RelationshipGraph(\n this.#nodes,\n active.values(),\n this.#registry,\n );\n return Object.freeze({\n version: included.length,\n ...(included.at(-1) ? { asOf: included.at(-1)!.timestamp } : {}),\n edges: graph.edges(),\n graph,\n });\n }\n\n /** Page the immutable event stream with a cursor bound to this log version. */\n public page(options: {\n limit: number;\n cursor?: string;\n }): RelationshipEventPage {\n if (!Number.isInteger(options.limit) || options.limit < 1)\n throw new TypeError(\"Relationship event page limit must be positive\");\n const fingerprint = createQueryFingerprint(\"relationship-events\", {\n order: \"append-sequence\",\n });\n const snapshot =\n options.cursor === undefined\n ? this.version\n : Number(decodeQueryCursorState(options.cursor, fingerprint).snapshot);\n if (\n !Number.isSafeInteger(snapshot) ||\n snapshot < 0 ||\n snapshot > this.version\n )\n throw new TypeError(\n \"Relationship event cursor snapshot version is invalid\",\n );\n const page = paginateQueryRows(this.#events.slice(0, snapshot), {\n cursor: options.cursor,\n fingerprint,\n limit: options.limit,\n readId: (event) => event.eventId,\n snapshot: String(snapshot),\n });\n return {\n version: snapshot,\n events: page.rows,\n hasMore: page.has_more,\n ...(page.next_cursor ? { nextCursor: page.next_cursor } : {}),\n };\n }\n}\n\nconst RELATIONSHIP_STORE_LOCK_ID = \"relationship-event-store\";\nconst RELATIONSHIP_NOFOLLOW_FLAG = constants.O_NOFOLLOW;\n\nfunction acquireRelationshipStoreLock(\n pmRoot: string,\n): Promise<() => Promise<void>> {\n return acquireLock(\n pmRoot,\n RELATIONSHIP_STORE_LOCK_ID,\n 30,\n `relationship-store:${process.pid}`,\n false,\n false,\n 3_000,\n );\n}\n\nasync function resolveRelationshipEventStorePath(\n pmRoot: string,\n relativePath = \"relationships/events.jsonl\",\n): Promise<string> {\n const root = path.resolve(pmRoot);\n const target = path.resolve(root, relativePath);\n const relative = path.relative(root, target);\n if (relative.length === 0)\n throw new TypeError(\n \"Relationship event path must name a file within the tracker root\",\n );\n if (\n relative === \"..\" ||\n relative.startsWith(`..${path.sep}`) ||\n path.isAbsolute(relative)\n )\n throw new TypeError(\n \"Relationship event path must stay within the tracker root\",\n );\n await mkdir(root, { recursive: true });\n const rootStats = await lstat(root);\n if (rootStats.isSymbolicLink())\n throw new TypeError(\n \"Relationship event tracker root must not be a symbolic link\",\n );\n let current = root;\n for (const segment of relative.split(path.sep)) {\n current = path.join(current, segment);\n try {\n if ((await lstat(current)).isSymbolicLink())\n throw new TypeError(\n \"Relationship event path must not contain symbolic links\",\n );\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === \"ENOENT\") break;\n throw error;\n }\n }\n return target;\n}\n\nasync function loadRelationshipEventLog(\n target: string,\n nodes: readonly string[],\n registry: RelationshipKindRegistry | undefined,\n): Promise<RelationshipEventLog> {\n const log = new RelationshipEventLog(nodes, { registry });\n let raw: string;\n let handle: FileHandle | undefined;\n try {\n handle = await open(\n target,\n constants.O_RDONLY | RELATIONSHIP_NOFOLLOW_FLAG,\n );\n raw = await handle.readFile(\"utf8\");\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === \"ENOENT\") return log;\n throw error;\n } finally {\n await handle?.close();\n }\n const lines = raw.split(\"\\n\");\n for (let index = 0; index < lines.length; index += 1) {\n const line = lines[index]!.trim();\n if (!line) continue;\n let stored: RelationshipEvent;\n try {\n stored = JSON.parse(line) as RelationshipEvent;\n } catch {\n throw new TypeError(\n `Invalid relationship event JSONL at line ${index + 1}`,\n );\n }\n if (stored.sequence !== log.version + 1)\n throw new TypeError(\n `Invalid relationship event sequence at line ${index + 1}`,\n );\n log.append({\n eventId: stored.eventId,\n relationshipId: stored.relationshipId,\n action: stored.action,\n ...(stored.edge === undefined ? {} : { edge: stored.edge }),\n author: stored.author,\n timestamp: stored.timestamp,\n ...(stored.reason === undefined ? {} : { reason: stored.reason }),\n expectedVersion: log.version,\n });\n }\n return log;\n}\n\n/**\n * Lock-serialized durable JSONL adapter for {@link RelationshipEventLog}.\n * Every append replays the current stream while holding the workspace lock, so\n * independent processes share optimistic versions without lost updates.\n */\nexport class RelationshipEventStore {\n readonly #pmRoot: string;\n readonly #nodes: readonly string[];\n readonly #registry: RelationshipKindRegistry | undefined;\n readonly #path: string;\n #log: RelationshipEventLog;\n\n private constructor(\n options: RelationshipEventStoreOptions,\n nodes: readonly string[],\n target: string,\n log: RelationshipEventLog,\n ) {\n this.#pmRoot = options.pmRoot;\n this.#nodes = nodes;\n this.#registry = options.registry;\n this.#path = target;\n this.#log = log;\n }\n\n /** Open and validate an existing stream or create an empty store view. */\n public static async open(\n options: RelationshipEventStoreOptions,\n ): Promise<RelationshipEventStore> {\n const nodes = Object.freeze([...options.nodes]);\n const target = await resolveRelationshipEventStorePath(\n options.pmRoot,\n options.relativePath,\n );\n const release = await acquireRelationshipStoreLock(options.pmRoot);\n try {\n await resolveRelationshipEventStorePath(options.pmRoot, target);\n const log = await loadRelationshipEventLog(\n target,\n nodes,\n options.registry,\n );\n return new RelationshipEventStore(options, nodes, target, log);\n } finally {\n await release();\n }\n }\n\n /** Absolute JSONL path, exposed for diagnostics and backup tooling. */\n public get path(): string {\n return this.#path;\n }\n\n /** Refresh from durable history and return the current validated append sequence. */\n public async currentVersion(): Promise<number> {\n this.#log = await this.#refreshFromDurableHistory();\n return this.#log.version;\n }\n\n /** Append one event after refreshing under the shared workspace lock. */\n public async append(\n input: RelationshipEventInput,\n ): Promise<RelationshipEvent> {\n const release = await acquireRelationshipStoreLock(this.#pmRoot);\n try {\n const target = await resolveRelationshipEventStorePath(\n this.#pmRoot,\n this.#path,\n );\n const refreshed = await loadRelationshipEventLog(\n target,\n this.#nodes,\n this.#registry,\n );\n const event = refreshed.append(input);\n await mkdir(path.dirname(target), { recursive: true });\n await resolveRelationshipEventStorePath(this.#pmRoot, target);\n const handle = await open(\n target,\n constants.O_APPEND |\n constants.O_CREAT |\n constants.O_WRONLY |\n RELATIONSHIP_NOFOLLOW_FLAG,\n );\n try {\n await handle.appendFile(`${JSON.stringify(event)}\\n`, \"utf8\");\n } finally {\n await handle.close();\n }\n this.#log = refreshed;\n return event;\n } finally {\n await release();\n }\n }\n\n /** Refresh from durable history and materialize an exact validated snapshot. */\n public async snapshot(\n options: Parameters<RelationshipEventLog[\"snapshot\"]>[0] = {},\n ): Promise<RelationshipSnapshot> {\n this.#log = await this.#refreshFromDurableHistory();\n return this.#log.snapshot(options);\n }\n\n /** Refresh from durable history and page immutable events. */\n public async page(\n options: Parameters<RelationshipEventLog[\"page\"]>[0],\n ): Promise<RelationshipEventPage> {\n this.#log = await this.#refreshFromDurableHistory();\n return this.#log.page(options);\n }\n\n /** Serialize a durable refresh with writers so readers never observe a torn JSONL tail. */\n async #refreshFromDurableHistory(): Promise<RelationshipEventLog> {\n const release = await acquireRelationshipStoreLock(this.#pmRoot);\n try {\n const target = await resolveRelationshipEventStorePath(\n this.#pmRoot,\n this.#path,\n );\n return await loadRelationshipEventLog(\n target,\n this.#nodes,\n this.#registry,\n );\n } finally {\n await release();\n }\n }\n}\n", "/**\n * @module sdk/define\n *\n * Authoring-time typed builders for every extension registration surface.\n *\n * These `define*` helpers are the third leg of the SDK ergonomics tripod:\n * {@link ../core/extensions/loader.js#ExtensionApi | `api.register*`} registers\n * a definition at activation, the `assert*`/`run*` testing helpers verify and\n * invoke it, and these builders let authors *write* the definition with full\n * type-checking and editor inference before it ever reaches `activate`.\n *\n * Every builder is a zero-cost identity function that returns its argument\n * unchanged — exactly like the SDK's {@link ./index.js#defineExtension} and the\n * wider `defineConfig`/`defineComponent` ecosystem convention. Extensions are\n * authored fully in TypeScript (ADR pm-2c28); these builders are where that type\n * safety is anchored at the definition site. Their value is entirely at the type\n * level:\n *\n * - A bare `const cmd = { ... }` satisfies the registration type only\n * structurally and widens its literals; `const cmd = defineCommand({ ... })`\n * checks the object against the contract *and* preserves the narrow literal\n * type, while inferring the nested handler's `context` parameter from the\n * builder signature.\n * - Definitions can be colocated, exported, reused, and unit-tested apart from\n * the `activate` call instead of being trapped as inline literals.\n *\n * Object-definition builders use a generic constraint (`<T extends Def>`) so the\n * narrow literal type survives the round-trip, mirroring `defineExtension`.\n * Function-definition builders are intentionally non-generic: a generic\n * constrained to a whole function type suppresses contextual typing of a bare\n * arrow's parameter (it would fall back to implicit `any`), whereas the\n * non-generic signature lets TypeScript type the handler parameter from the\n * declared function type.\n */\nimport type {\n AfterCommandHook,\n BeforeCommandHook,\n CommandDefinition,\n CommandOverride,\n Exporter,\n ExtensionManifest,\n FlagDefinition,\n Importer,\n OnIndexHook,\n OnReadHook,\n OnWriteHook,\n ParserOverride,\n PreflightOverride,\n RendererOverride,\n SchemaFieldDefinition,\n SchemaItemTypeDefinition,\n SchemaMigrationDefinition,\n SearchProviderDefinition,\n ServiceOverride,\n VectorStoreAdapterDefinition,\n} from \"../core/extensions/loader.js\";\nimport type { ProjectProfileDefinition } from \"../core/profile/profile-presets.js\";\n\n/**\n * Type an extension's in-module manifest mirror (the `manifest` export / field).\n *\n * Completes the `define*` family: the manifest is the one authoring surface that\n * otherwise had no builder. Contract-checks the object against\n * {@link ExtensionManifest} where it is authored, catching a missing required\n * field or a mistyped key at edit time instead of at load time. Pair with\n * {@link ./compose.js#deriveExtensionCapabilities | `deriveExtensionCapabilities`}\n * to keep `capabilities` matched to the surfaces the extension actually registers.\n */\nexport function defineExtensionManifest<TManifest extends ExtensionManifest>(\n manifest: TManifest,\n): TManifest {\n return manifest;\n}\n\n/**\n * Type a project-profile definition for the profile registry.\n *\n * A profile bundles item types, statuses, fields, per-type workflows, config\n * knobs, create templates, and package recommendations into one declarative\n * archetype that `pm profile apply` stages idempotently. This builder checks the\n * object against {@link ProjectProfileDefinition} where it is authored — catching\n * an invalid field type or a malformed workflow at edit time — while preserving\n * the literal `name`/`types`/`statuses` so a package's archetype stays strongly\n * typed at the definition site, mirroring {@link defineItemType}. It is the\n * authoring anchor a first-party or third-party profile package builds on.\n */\nexport function defineProjectProfile<TProfile extends ProjectProfileDefinition>(\n profile: TProfile,\n): TProfile {\n return profile;\n}\n\n/**\n * Type a command definition for `api.registerCommand(definition)`.\n *\n * Checks the object against {@link CommandDefinition} and infers the `run`\n * handler's `context` parameter while preserving the literal `name`/`action`\n * types. Pass the result straight to `registerCommand`, or export it so the\n * command can be invoked in tests via `runRegisteredCommandForTest`.\n */\nexport function defineCommand<TDefinition extends CommandDefinition>(\n definition: TDefinition,\n): TDefinition {\n return definition;\n}\n\n/**\n * Type a single flag definition for a `api.registerFlags(command, flags)` array.\n *\n * Authors compose builders into the array\n * (`api.registerFlags(\"list\", [defineFlag({ long: \"--mine\" })])`) to get\n * per-flag contract checking — `value_type`, `list`, and `default` included —\n * instead of validating a loosely-typed literal array all at once.\n */\nexport function defineFlag<TFlag extends FlagDefinition>(flag: TFlag): TFlag {\n return flag;\n}\n\n/**\n * Type a custom item-type definition for `api.registerItemTypes([...])`.\n *\n * Preserves the literal `name`/`folder`/`aliases` so a project archetype's\n * domain types stay strongly typed where the definition is declared and reused.\n */\nexport function defineItemType<TType extends SchemaItemTypeDefinition>(\n type: TType,\n): TType {\n return type;\n}\n\n/**\n * Type a custom item-metadata field definition for `api.registerItemFields([...])`.\n *\n * Checks `name`/`type`/`optional` against {@link SchemaFieldDefinition} while\n * keeping the field's extra metadata (the contract carries an index signature)\n * intact.\n */\nexport function defineItemField<TField extends SchemaFieldDefinition>(\n field: TField,\n): TField {\n return field;\n}\n\n/**\n * Type a schema migration definition for `api.registerMigration(definition)`.\n *\n * Preserves the literal `id` and, when `run` is provided, infers the migration\n * runner's context, so the same definition can be registered and later exercised\n * through `runRegisteredMigrationForTest`.\n */\nexport function defineMigration<TMigration extends SchemaMigrationDefinition>(\n migration: TMigration,\n): TMigration {\n return migration;\n}\n\n/**\n * Type a search-provider definition for `api.registerSearchProvider(provider)`.\n *\n * Infers the `query`/`embed`/`embedBatch` operation contexts and result shapes\n * so a custom retrieval backend is type-checked at the definition site and\n * reusable in `runRegisteredSearchProviderForTest`.\n */\nexport function defineSearchProvider<\n TProvider extends SearchProviderDefinition,\n>(provider: TProvider): TProvider {\n return provider;\n}\n\n/**\n * Type a vector-store adapter definition for `api.registerVectorStoreAdapter(adapter)`.\n *\n * Infers the `query`/`upsert`/`delete` operation contexts so a package that owns\n * its own semantic index storage gets contract checking before activation and a\n * definition it can drive through `runRegisteredVectorStoreAdapterForTest`.\n */\nexport function defineVectorStoreAdapter<\n TAdapter extends VectorStoreAdapterDefinition,\n>(adapter: TAdapter): TAdapter {\n return adapter;\n}\n\n/**\n * Type a command-override handler for `api.registerCommand(command, override)`.\n *\n * The non-generic signature lets TypeScript contextually type the override's\n * `context` parameter from {@link CommandOverride}, so a bare arrow authored in\n * a `.js` package still gets a fully-typed argument.\n */\nexport function defineCommandOverride(\n override: CommandOverride,\n): CommandOverride {\n return override;\n}\n\n/**\n * Type a parser-override handler for `api.registerParser(command, override)`.\n *\n * Contextually types the `context` parameter and the returned\n * {@link ParserOverride} delta so an argument-rewriting override is checked\n * where it is written.\n */\nexport function defineParserOverride(override: ParserOverride): ParserOverride {\n return override;\n}\n\n/**\n * Type a preflight-override handler for `api.registerPreflight(override)`.\n *\n * Contextually types the `context` parameter and the returned gate decision so a\n * package's pre-run validation override is checked at the definition site.\n */\nexport function definePreflightOverride(\n override: PreflightOverride,\n): PreflightOverride {\n return override;\n}\n\n/**\n * Type a service-override handler for `api.registerService(service, override)`.\n *\n * Contextually types the `context` parameter from {@link ServiceOverride} so a\n * package overriding a built-in service (output formatting, embeddings, and the\n * like) keeps its handler argument typed without an explicit annotation.\n */\nexport function defineServiceOverride(\n override: ServiceOverride,\n): ServiceOverride {\n return override;\n}\n\n/**\n * Type a renderer-override handler for `api.registerRenderer(format, renderer)`.\n *\n * Contextually types the `context` parameter and the `string | null | undefined`\n * return contract so a custom output renderer is checked where it is authored.\n */\nexport function defineRendererOverride(\n renderer: RendererOverride,\n): RendererOverride {\n return renderer;\n}\n\n/**\n * Type an importer handler for `api.registerImporter(name, importer, options)`.\n *\n * Contextually types the {@link Importer} `context` (registration, args,\n * options, pm root) so the bridge from an external system into the pm context\n * graph is type-checked and reusable in `runRegisteredImporterForTest`.\n */\nexport function defineImporter(importer: Importer): Importer {\n return importer;\n}\n\n/**\n * Type an exporter handler for `api.registerExporter(name, exporter, options)`.\n *\n * Contextually types the {@link Exporter} `context` so the bridge from the pm\n * context graph out to an external system is checked at the definition site and\n * reusable in `runRegisteredExporterForTest`.\n */\nexport function defineExporter(exporter: Exporter): Exporter {\n return exporter;\n}\n\n/**\n * Type a `before_command` hook for `api.hooks.beforeCommand(hook)`.\n *\n * Contextually types the {@link BeforeCommandHook} `context` so a hook that\n * inspects or annotates a command before it runs keeps its argument typed when\n * authored as a standalone, exportable, testable value.\n */\nexport function defineBeforeCommandHook(\n hook: BeforeCommandHook,\n): BeforeCommandHook {\n return hook;\n}\n\n/**\n * Type an `after_command` hook for `api.hooks.afterCommand(hook)`.\n *\n * Contextually types the {@link AfterCommandHook} `context` — including the\n * `affected` items pm mutated — so the natural place to react to every change\n * (\"project management = context management\") is checked where it is written.\n */\nexport function defineAfterCommandHook(\n hook: AfterCommandHook,\n): AfterCommandHook {\n return hook;\n}\n\n/**\n * Type an `on_write` hook for `api.hooks.onWrite(hook)`.\n *\n * Contextually types the {@link OnWriteHook} `context` so a hook reacting to\n * item persistence keeps its argument typed without an explicit annotation.\n */\nexport function defineOnWriteHook(hook: OnWriteHook): OnWriteHook {\n return hook;\n}\n\n/**\n * Type an `on_read` hook for `api.hooks.onRead(hook)`.\n *\n * Contextually types the {@link OnReadHook} `context` so a hook augmenting items\n * as they are read is type-checked at the definition site.\n */\nexport function defineOnReadHook(hook: OnReadHook): OnReadHook {\n return hook;\n}\n\n/**\n * Type an `on_index` hook for `api.hooks.onIndex(hook)`.\n *\n * Contextually types the {@link OnIndexHook} `context` so a hook participating\n * in index/search refresh keeps its argument typed even without TypeScript\n * annotations.\n */\nexport function defineOnIndexHook(hook: OnIndexHook): OnIndexHook {\n return hook;\n}\n", "/**\n * @module sdk/index\n *\n * Defines public SDK APIs and package-author helpers for Index.\n */\nexport {\n isErrnoError,\n limitAnnotationEntries,\n parseAnnotationTextInput,\n readAnnotationEntries,\n resolveAnnotationInput,\n resolveAnnotationIndex,\n runAnnotationCommand,\n wrapOwnershipConflict,\n type AnnotationCommandConfig,\n type AnnotationCommandOptions,\n type AnnotationCommandResult,\n type AnnotationEntry,\n type AnnotationInput,\n type AnnotationSourceOptions,\n type OwnershipConflictGuidance,\n} from \"./annotations.js\";\nexport {\n inspectHistoryAuthorStream,\n scanHistoryAuthorAttribution,\n type HistoryAuthorAttributionScan,\n type UnknownAuthorHistoryEvent,\n} from \"./author-attribution.js\";\nexport { createPmCliProgram } from \"./cli-program.js\";\nexport { runSearchRefreshWorkerEntrypoint } from \"./search-refresh-worker.js\";\nexport { flushTelemetryQueue } from \"./telemetry-flush.js\";\nexport {\n EXECUTABLE_COMMAND_ALIASES,\n applyBootstrapPagerPolicy,\n coalesceRepeatedListFlags,\n listAliasPluralKeys,\n mergeLinkedTestTwoTokenEntries,\n normalizeBootstrapInvocation,\n normalizeLegacyExtensionActionSyntax,\n parseBootstrapCommandName,\n parseBootstrapGlobalOptions,\n parseBootstrapHelpRequest,\n parseBootstrapTypeValue,\n stripGlobalBootstrapTokens,\n type BootstrapGlobalOptions,\n type BootstrapHelpRequest,\n type BootstrapInvocationNormalizationResult,\n type BootstrapNormalizationEvent,\n} from \"./cli-bootstrap.js\";\nexport {\n quoteCommandArg,\n quoteWindowsCommandArg,\n renderPmCommand,\n} from \"./command-line.js\";\nexport {\n runGc,\n type GcCheckpointsSummary,\n type GcLocksSummary,\n} from \"./governance/gc.js\";\nexport {\n _testOnlyHealthCommand,\n runHealth,\n type HealthCheck,\n} from \"./governance/health.js\";\nexport {\n _testOnlyValidateCommand,\n runValidate,\n type ValidateCheck,\n type ValidateFixesSummary,\n type ValidateMutationServices,\n} from \"./governance/validate.js\";\nexport { runExtension } from \"./extension.js\";\nexport { applyInvocationAuthorOverride } from \"./invocation-author.js\";\nexport {\n _testOnly as _testOnlyTemplates,\n type TemplateSource,\n} from \"./templates.js\";\nexport {\n runConfig,\n _testOnlyConfigCommand,\n type NestedSettingResultValue,\n} from \"./config.js\";\nexport {\n INIT_AGENT_GUIDANCE_MODE_VALUES,\n runInitAgentGuidance,\n _testOnly as _testOnlyInitAgentGuidance,\n type InitAgentGuidanceMode,\n type InitAgentGuidanceSummary,\n type RunInitAgentGuidanceOptions,\n type RunInitAgentGuidanceResult,\n} from \"./init-agent-guidance.js\";\nexport {\n runInit,\n summarizeInitResult,\n _testOnly as _testOnlyInit,\n type InitAgentGuidanceResult,\n type InitConciseResult,\n type InitInstalledPackagesSummary,\n type InitRegisteredTypePresetSummary,\n type InitTargetResolution,\n type InitTypePresetName,\n} from \"./init.js\";\nexport {\n PROFILE_SUBCOMMANDS,\n formatProfileApplyHuman,\n formatProfileLintHuman,\n formatProfileListHuman,\n formatProfileShowHuman,\n runProfileApply,\n runProfileLint,\n runProfileList,\n runProfileShow,\n type ProfileApplyDimension,\n type ProfileComposition,\n type ProfileListEntry,\n} from \"./profile.js\";\nimport {\n EXTENSION_CAPABILITY_CONTRACT,\n EXTENSION_CAPABILITY_CONTRACT_VERSION,\n EXTENSION_CAPABILITY_LEGACY_ALIASES,\n KNOWN_EXTENSION_CAPABILITIES,\n KNOWN_EXTENSION_POLICY_MODES,\n KNOWN_EXTENSION_POLICY_SURFACES,\n KNOWN_EXTENSION_SANDBOX_PROFILES,\n KNOWN_EXTENSION_TRUST_MODES,\n} from \"../core/extensions/loader.js\";\nexport { RESERVED_ITEM_FIELD_NAMES } from \"../core/extensions/item-fields.js\";\nexport {\n PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,\n PM_PACKAGE_RESOURCE_KINDS,\n collectPackageExtensionDirectories,\n readPmPackageManifest,\n type PmPackageCatalogLinkMap,\n type PmPackageCatalogMediaMap,\n type PmPackageCatalogMetadata,\n type PmPackageManifest,\n type PmPackageResourceKind,\n type PmPackageResourceMap,\n} from \"../core/packages/manifest.js\";\nexport type {\n CommanderOptionAliasContract,\n CommanderOptionRegistrationContract,\n} from \"./cli-contracts.js\";\nexport {\n ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,\n APPEND_FLAG_CONTRACTS,\n CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,\n CALENDAR_FLAG_CONTRACTS,\n CLAIM_FLAG_CONTRACTS,\n CLOSE_FLAG_CONTRACTS,\n CLOSE_MANY_FLAG_CONTRACTS,\n CLOSE_TASK_FLAG_CONTRACTS,\n COMMENTS_FLAG_CONTRACTS,\n COMPLETION_FLAG_CONTRACTS,\n CONFIG_FLAG_CONTRACTS,\n CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,\n CONTEXT_FLAG_CONTRACTS,\n CONTRACTS_FLAG_CONTRACTS,\n COPY_FLAG_CONTRACTS,\n CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,\n CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,\n CREATE_COMMANDER_STRING_OPTION_CONTRACTS,\n CREATE_FLAG_CONTRACTS,\n DELETE_FLAG_CONTRACTS,\n DEPS_FLAG_CONTRACTS,\n DOCS_FLAG_CONTRACTS,\n EVAL_FLAG_CONTRACTS,\n EXTENSION_ACTIVATE_FLAG_CONTRACTS,\n EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,\n EXTENSION_ADOPT_FLAG_CONTRACTS,\n EXTENSION_CATALOG_FLAG_CONTRACTS,\n EXTENSION_DEACTIVATE_FLAG_CONTRACTS,\n EXTENSION_DESCRIBE_FLAG_CONTRACTS,\n EXTENSION_DOCTOR_FLAG_CONTRACTS,\n EXTENSION_EXPLORE_FLAG_CONTRACTS,\n EXTENSION_FLAG_CONTRACTS,\n EXTENSION_INIT_FLAG_CONTRACTS,\n EXTENSION_INSTALL_FLAG_CONTRACTS,\n EXTENSION_MANAGE_FLAG_CONTRACTS,\n EXTENSION_RELOAD_FLAG_CONTRACTS,\n EXTENSION_SCOPE_FLAG_CONTRACTS,\n EXTENSION_UNINSTALL_FLAG_CONTRACTS,\n FILES_FLAG_CONTRACTS,\n FOCUS_FLAG_CONTRACTS,\n GC_FLAG_CONTRACTS,\n GET_FLAG_CONTRACTS,\n GLOBAL_FLAG_CONTRACTS,\n GUIDE_FLAG_CONTRACTS,\n HEALTH_FLAG_CONTRACTS,\n HISTORY_COMPACT_FLAG_CONTRACTS,\n HISTORY_FLAG_CONTRACTS,\n HISTORY_REDACT_FLAG_CONTRACTS,\n HISTORY_REPAIR_FLAG_CONTRACTS,\n INIT_FLAG_CONTRACTS,\n INSTALL_FLAG_CONTRACTS,\n LEARNINGS_FLAG_CONTRACTS,\n LIST_COMMANDER_STRING_OPTION_CONTRACTS,\n LIST_FILTER_FLAG_CONTRACTS,\n MEET_FLAG_CONTRACTS,\n NEXT_COMMANDER_STRING_OPTION_CONTRACTS,\n NEXT_FLAG_CONTRACTS,\n NOTES_FLAG_CONTRACTS,\n PACKAGE_FLAG_CONTRACTS,\n PACKAGE_INIT_FLAG_CONTRACTS,\n PAUSE_TASK_FLAG_CONTRACTS,\n PLAN_FLAG_CONTRACTS,\n PM_CORE_COMMAND_NAMES,\n PM_EXTENSION_CAPABILITY_CONTRACTS,\n PM_EXTENSION_POLICY_MODE_CONTRACTS,\n PM_EXTENSION_POLICY_SURFACE_CONTRACTS,\n PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,\n PM_EXTENSION_SERVICE_NAME_CONTRACTS,\n PM_EXTENSION_TRUST_MODE_CONTRACTS,\n PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,\n PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,\n PM_TOOL_ACTIONS,\n PM_TOOL_ACTION_PARAMETER_CONTRACTS,\n PM_TOOL_PARAMETERS_SCHEMA,\n PM_TOOL_PARAMETERS_SCHEMA_MAJOR,\n PM_TOOL_PARAMETERS_SCHEMA_VERSION,\n PROFILE_FLAG_CONTRACTS,\n REINDEX_FLAG_CONTRACTS,\n RELEASE_FLAG_CONTRACTS,\n REMIND_FLAG_CONTRACTS,\n RESTORE_FLAG_CONTRACTS,\n SCHEMA_FLAG_CONTRACTS,\n SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,\n SEARCH_FLAG_CONTRACTS,\n START_TASK_FLAG_CONTRACTS,\n STATS_FLAG_CONTRACTS,\n SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,\n TELEMETRY_FLAG_CONTRACTS,\n TEST_ALL_FLAG_CONTRACTS,\n TEST_FLAG_CONTRACTS,\n TEST_RUNS_FLAG_CONTRACTS,\n TOOL_ACTIVITY_OPTION_CONTRACTS,\n TOOL_AGGREGATE_OPTION_CONTRACTS,\n TOOL_CALENDAR_OPTION_CONTRACTS,\n TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,\n TOOL_CONTEXT_OPTION_CONTRACTS,\n TOOL_CREATE_OPTION_CONTRACTS,\n TOOL_DEPS_OPTION_CONTRACTS,\n TOOL_LIST_FILTER_OPTION_CONTRACTS,\n TOOL_SEARCH_FILTER_OPTION_CONTRACTS,\n TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,\n TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,\n TOOL_UPDATE_OPTION_CONTRACTS,\n UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,\n UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,\n UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,\n UPDATE_FLAG_CONTRACTS,\n UPDATE_MANY_FLAG_CONTRACTS,\n UPGRADE_FLAG_CONTRACTS,\n compactFlagAliasContracts,\n isPmExtensionCapabilityContract,\n isPmExtensionPolicyModeContract,\n isPmExtensionPolicySurfaceContract,\n isPmExtensionServiceNameContract,\n isPmToolAction,\n readFirstStringFromCommanderOptions,\n readFirstValueFromCommanderOptions,\n readStringArrayFromCommanderOptions,\n resolveSubcommandFlagContractsForCommand,\n toCompletionFlagString,\n withFlagAliasMetadata,\n} from \"./cli-contracts.js\";\nexport type {\n CliFlagContract,\n PmActionSchemaContract,\n PmExtensionCapabilityContract,\n PmExtensionPolicyModeContract,\n PmExtensionPolicySurfaceContract,\n PmExtensionSandboxProfileContract,\n PmExtensionServiceNameContract,\n PmExtensionTrustModeContract,\n PmToolAction,\n ToolOptionFlagContract,\n} from \"./cli-contracts.js\";\nexport * from \"./compose.js\";\nexport * from \"./context-relevance.js\";\nexport * from \"./context-packing.js\";\nexport * from \"./context-usage.js\";\nexport * from \"./history-compact.js\";\nexport * from \"./history-read.js\";\nexport * from \"./history-redact.js\";\nexport * from \"./history-repair.js\";\nexport * from \"./item-children.js\";\nexport * from \"./item-schedule.js\";\nexport {\n collectDanglingDependencyReferences,\n runDeps,\n type DanglingDependencyReference,\n type DanglingDependencyReferenceSummary,\n type DependencyReferenceHolder,\n type DepsCollapseMode,\n type DepsFormat,\n type DepsGraphEdge,\n type DepsGraphNode,\n type DepsGraphResult,\n type DepsTreeNode,\n} from \"./dependencies.js\";\nexport { runDocs } from \"./docs.js\";\nexport {\n runFiles,\n runFilesDiscover,\n type FilesDiscoveryCandidate,\n} from \"./files.js\";\nexport {\n applyPathMigrations,\n applyStandaloneNote,\n artifactKey,\n dedupeLinkedArtifacts,\n ensureScope,\n expandAddGlobEntries,\n normalizeLinkedPath,\n parseAddEntries,\n parseAddGlobEntries,\n parseMigrateEntries,\n parseRemoveEntries,\n renameArtifactsResultKey,\n runLinkedArtifacts,\n sortLinkedArtifacts,\n validateLinkedPaths,\n type AddGlobEntry,\n type LinkedArtifact,\n type LinkedArtifactCommandOptions,\n type LinkedArtifactKindConfig,\n type LinkedArtifactResult,\n type LinkedPathValidation,\n type PathMigration,\n} from \"./linked-artifacts.js\";\nexport * from \"./pagination.js\";\nexport * from \"./query/item-filter-options.js\";\nexport * from \"./query/parsers.js\";\nexport * from \"./output.js\";\nexport * from \"./relationship-analytics.js\";\nexport * from \"./relationship-context.js\";\nexport * from \"./relationship-history.js\";\nexport * from \"./relationships.js\";\nexport type {\n PlanCommandOptions,\n PlanCommandResult,\n PlanDispatchInput,\n PlanResultPlan,\n PlanShowDepth,\n PlanStepSummary,\n PlanSubcommand,\n PlanTemplateName,\n} from \"../cli/commands/plan.js\";\nexport {\n PLAN_SHOW_DEPTH_VALUES,\n PLAN_SUBCOMMANDS,\n PLAN_TEMPLATE_NAMES,\n} from \"../cli/commands/plan.js\";\nexport * from \"./define.js\";\nexport {\n BASELINE_ITEM_FORMAT_VERSION,\n BUILTIN_ITEM_TYPE_VALUES,\n CONFIDENCE_TEXT_VALUES,\n CURRENT_ITEM_FORMAT_VERSION,\n DEPENDENCY_KIND_VALUES,\n EXIT_CODE,\n ISSUE_SEVERITY_VALUES,\n ITEM_TYPE_VALUES,\n PM_CLI_EXPECTED_ERROR_NAME,\n PmCliError,\n PmClient,\n RISK_VALUES,\n STATUS_VALUES,\n acquireLock,\n appendHistoryEntry,\n canonicalDocument,\n classifyItemFormatVersion,\n clearWorkspaceContractsCache,\n commitImportedItem,\n createHistoryEntry,\n createPmCliExpectedError,\n effectiveItemFormatVersion,\n emptyImportedDocument,\n ensureTrackerInitialized,\n generateItemId,\n getActiveExtensionRegistrations,\n getContracts,\n getHistoryPath,\n getItemPath,\n getSettingsPath,\n getWorkspaceContracts,\n isPmCliExpectedError,\n isTimestampLiteral,\n listAllItemMetadata,\n loadCreateTemplateOptions,\n locateItem,\n normalizeItemMetadata,\n normalizeItemFormatVersion,\n normalizeItemId,\n normalizeRawItemId,\n normalizeStatusInput,\n nowIso,\n parseTags,\n pathExists,\n readBooleanOption,\n readCsvListOption,\n readFileIfExists,\n readLocatedItem,\n readRequiredString,\n readSettings,\n readStringOption,\n removeFileIfExists,\n renderCalendarMarkdown,\n renderCalendarToon,\n renderGuideMarkdown,\n resolveCalendarOutputFormat,\n resolveGuideOutputFormat,\n resolveItemTypeRegistry,\n resolvePmRoot,\n resolveRuntimeFieldRegistry,\n resolveRuntimeStatusRegistry,\n runAction,\n runActiveOnReadHooks,\n runActiveOnWriteHooks,\n runCalendar,\n runCompletion,\n runGuide,\n runList,\n runReindex,\n runSearch,\n runTemplatesList,\n runTemplatesSave,\n runTemplatesShow,\n runTestRunsList,\n runTestRunsLogs,\n runTestRunsResume,\n runTestRunsStatus,\n runTestRunsStop,\n scanItemFormatVersions,\n selectImportAuthor,\n serializeItemDocument,\n splitFrontMatter,\n toEstimatedMinutesValue,\n toImportBoolean,\n toImportConfidence,\n toImportInteger,\n toImportLinkedDocs,\n toImportLinkedFiles,\n toImportLinkedTests,\n toImportLogEntries,\n toImportNormalizedEnum,\n toImportNumberMap,\n toImportPriority,\n toImportStatus,\n toImportStringList,\n toImportStringMap,\n toImportTags,\n toNonEmptyImportString,\n writeFileAtomic,\n aggregate,\n append,\n claim,\n claimNext,\n close,\n closeTask,\n comments,\n config,\n context,\n copy,\n create,\n deleteItem,\n deps,\n docs,\n extension,\n extensionActivate,\n extensionDeactivate,\n extensionList,\n files,\n filesDiscover,\n focus,\n gc,\n get,\n health,\n historyCompact,\n historyCompactBulk,\n historyRedact,\n historyRepair,\n historyRepairAll,\n init,\n learnings,\n list,\n next,\n notes,\n packageActivate,\n packageCatalog,\n packageDeactivate,\n packageDescribe,\n packageDoctor,\n packageInstall,\n packageLifecycle,\n packageList,\n packageManage,\n packageReload,\n packageUninstall,\n pauseTask,\n profile,\n profileApply,\n profileLint,\n profileList,\n profileShow,\n release,\n restore,\n schema,\n schemaAddField,\n schemaAddStatus,\n schemaAddType,\n schemaApplyPreset,\n schemaInferTypes,\n schemaList,\n schemaListFields,\n schemaRemoveField,\n schemaRemoveStatus,\n schemaRemoveType,\n schemaShow,\n schemaShowField,\n schemaShowStatus,\n search,\n startTask,\n stats,\n update,\n upgrade,\n validate,\n type AggregateOptions,\n type AggregateResult,\n type AggregateRow,\n type AppendCommandOptions,\n type AppendResult,\n type BlockerEntry,\n type CalendarOptions,\n type CalendarResult,\n type ClaimResult,\n type CloseResult,\n type CloseTaskResult,\n type CommitImportedItemParams,\n type CommitImportedItemResult,\n type CommentsCommandOptions,\n type CommentsResult,\n type ConfigCommandOptions,\n type ConfigResult,\n type CompletionResult,\n type CompletionShell,\n type ContractsCommandOptions,\n type ContractsResult,\n type ContextFocusItem,\n type ContextOptions,\n type ContextOutputFormat,\n type ContextResult,\n type CopyResult,\n type CreatePmCliExpectedErrorOptions,\n type CreateResult,\n type CreateTemplateOptions,\n type Dependency,\n type DeleteResult,\n type DepsCommandOptions,\n type DepsResult,\n type DocsCommandOptions,\n type DocsResult,\n type ExtensionCommandOptions,\n type ExtensionCommandResult,\n type FilesCommandOptions,\n type FilesDiscoverOptions,\n type FilesDiscoverResult,\n type FilesResult,\n type FocusResult,\n type GcCommandOptions,\n type GcResult,\n type GetContractsOptions,\n type GetOptions,\n type GetResult,\n type GuideDepth,\n type GuideOptions,\n type GuideOutputFormat,\n type GuideResult,\n type HealthResult,\n type ImportLinkedScope,\n type InitCommandOptions,\n type InitResult,\n type ItemFormatVersionScanEntry,\n type ItemFormatVersionScanResult,\n type ItemFormatVersionStatus,\n type LearningsCommandOptions,\n type LearningsResult,\n type LinkedDoc,\n type LinkedFile,\n type LinkedTest,\n type ListedItem,\n type ListCompactResult,\n type ListFullResult,\n type ListOptions,\n type ListProjectedItem,\n type ListResult,\n type ListResultItem,\n type ListSortField,\n type ListSortOrder,\n type ListTreeItem,\n type ListTreeMetadata,\n type ListVerboseResult,\n type LogNote,\n type NextActionableItem,\n type NextBlockerRef,\n type NextOptions,\n type NextOutputFormat,\n type NextRecommendation,\n type NextResult,\n type NotesCommandOptions,\n type NotesResult,\n type PackageCommandOptions,\n type PackageCommandResult,\n type PauseTaskResult,\n type PmActionInput,\n type PmActionName,\n type PmActionOptions,\n type PmClientFullMutationOptions,\n type PmClientMutationOptions,\n type PmClientOptions,\n type PmClientRunArgs,\n type PmCliExpectedError,\n type ProfileApplyCommandOptions,\n type ProfileApplyResult,\n type ProfileLintResult,\n type ProfileListResult,\n type ProfileResult,\n type ProfileShowResult,\n type ProfileSubcommand,\n type ReindexOptions,\n type ReindexResult,\n type ReleaseResult,\n type RestoreResult,\n type RunHealthOptions,\n type SchemaAddFieldCommandOptions,\n type SchemaAddFieldResult,\n type SchemaAddStatusCommandOptions,\n type SchemaAddStatusResult,\n type SchemaAddTypeCommandOptions,\n type SchemaAddTypeInferCommandOptions,\n type SchemaAddTypeInferResult,\n type SchemaAddTypeResult,\n type SchemaApplyPresetCommandOptions,\n type SchemaApplyPresetResult,\n type SchemaInspectResult,\n type SchemaListFieldsResult,\n type SchemaListResult,\n type SchemaRemoveFieldCommandOptions,\n type SchemaRemoveFieldResult,\n type SchemaRemoveStatusCommandOptions,\n type SchemaRemoveStatusResult,\n type SchemaRemoveTypeCommandOptions,\n type SchemaRemoveTypeResult,\n type SchemaShowFieldResult,\n type SchemaShowResult,\n type SchemaShowStatusResult,\n type SchemaResult,\n type SchemaSubcommand,\n type SearchCompactResult,\n type SearchHit,\n type SearchHitHighlight,\n type SearchMatchMode,\n type SearchOptions,\n type ClaimNextOptions,\n type SearchResult,\n type SearchResultItem,\n type SearchVerboseResult,\n type StartTaskResult,\n type StatsCommandOptions,\n type StatsResult,\n type TemplatesListResult,\n type TemplatesSaveResult,\n type TemplatesShowResult,\n type TestRunsListCommandOptions,\n type TestRunsLogsCommandOptions,\n type TestRunsResumeCommandOptions,\n type TestRunsStopCommandOptions,\n type ToImportLinkedArtifactsOptions,\n type ToImportLinkedTestsOptions,\n type ToImportLogEntriesOptions,\n type UpdateResult,\n type UpgradeCommandOptions,\n type UpgradeResult,\n type ValidateCommandOptions,\n type ValidateResult,\n type WorkspaceContracts,\n type WorkspaceContractsOptions,\n} from \"./runtime.js\";\nexport { runStats } from \"./stats.js\";\nexport {\n DEFAULT_EVAL_QUERIES_RELATIVE_PATH,\n runEval,\n type EvalOptions,\n type EvalQueryReport,\n type EvalResult,\n} from \"./eval.js\";\nexport {\n runTelemetry,\n TELEMETRY_SUBCOMMANDS,\n type TelemetryCommandOptions,\n type TelemetrySubcommand,\n} from \"./telemetry.js\";\nexport {\n classifyLinkedTestFailure,\n countFailureCategories,\n extractReferencedPmItemIdsFromCommand,\n resolveLinkedTestFailureExitCode,\n runLinkedTests,\n runTest,\n summarizeContextPreflight,\n type LinkedTestFailureCategory,\n type TestCommandOptions,\n type TestResult,\n type TestRunResult,\n} from \"./test/execution.js\";\nexport {\n runTestAll,\n type TestAllCommandOptions,\n type TestAllItemResult,\n type TestAllResult,\n} from \"./test/batch.js\";\nexport {\n LINKED_TEST_ENV_NAME_PATTERN,\n LINKED_TEST_PM_CONTEXT_MODE_VALUES,\n LINKED_TEST_PROTECTED_ENV_KEYS,\n parseLinkedTestAssertionEqualsMap,\n parseLinkedTestAssertionGteMap,\n parseLinkedTestBoolean,\n parseLinkedTestContextMode,\n parseLinkedTestEnvClear,\n parseLinkedTestEnvSet,\n parseLinkedTestJsonEntries,\n parseLinkedTestMinLines,\n parseLinkedTestRegexList,\n parseLinkedTestStringList,\n type LinkedTestPmContextMode,\n} from \"./test/parsers.js\";\nexport {\n runStartBackgroundRun,\n runTestRunsWorker,\n type StartBackgroundRunCommandOptions,\n type StartBackgroundRunResult,\n} from \"./test/runs.js\";\nexport {\n BUILTIN_PROFILES,\n listProfiles,\n normalizeProfileName,\n PROFILE_NAMES,\n resolveProfile,\n type ProfileConfigEntry,\n type ProfileName,\n type ProfilePackageRecommendation,\n type ProfileTemplateEntry,\n type ProfileTemplateOptions,\n type ProjectProfileDefinition,\n type ProjectProfileRegistrationInput,\n} from \"../core/profile/profile-presets.js\";\nexport {\n planProfileApplication,\n type ProfileApplicationPlan,\n type ProfileChangeStatus,\n type ProfileComponentChange,\n type ProfileConfigChange,\n type ProfileConfigPlan,\n type ProfileCurrentState,\n type ProfilePackagePlan,\n type ProfileSchemaPlan,\n type ProfileTemplateChange,\n type ProfileTemplatePlan,\n type ProfileWorkflowChange,\n type ProfileWorkflowPlan,\n} from \"../core/profile/profile-plan.js\";\nexport {\n describeProfileComposition,\n describeProjectProfile,\n type ProjectProfileComposition,\n type ProjectProfileDescription,\n type ProjectProfilePackageSummary,\n} from \"../core/profile/profile-describe.js\";\nexport {\n lintProjectProfile,\n PROFILE_LINT_CODES,\n PROFILE_LINT_DIMENSIONS,\n type ProfileLintCode,\n type ProfileLintDimension,\n type ProfileLintSeverity,\n type ProjectProfileLintFinding,\n type ProjectProfileLintReport,\n} from \"../core/profile/profile-lint.js\";\nexport {\n assertExtensionBlueprint,\n assertExtensionCapabilityUsage,\n assertExtensionDeactivated,\n assertExtensionManifestCompatible,\n assertExtensionManifestMatchesBlueprint,\n assertExtensionPreflight,\n assertPackageManifest,\n assertProjectProfile,\n assertRegisteredCommandContract,\n assertRegisteredCommandOverride,\n assertRegisteredExporter,\n assertRegisteredFlags,\n assertRegisteredHook,\n assertRegisteredImporter,\n assertRegisteredItemField,\n assertRegisteredItemType,\n assertRegisteredMigration,\n assertRegisteredParserOverride,\n assertRegisteredPreflightOverride,\n assertRegisteredProfile,\n assertRegisteredRendererOverride,\n assertRegisteredSearchProvider,\n assertRegisteredServiceOverride,\n assertRegisteredVectorStoreAdapter,\n activateExtensionForTest,\n createExtensionTestHarness,\n deactivateExtensionForTest,\n describeExtensionActivation,\n runRegisteredCommandForTest,\n runRegisteredCommandOverrideForTest,\n runRegisteredExporterForTest,\n runRegisteredHookForTest,\n runRegisteredImporterForTest,\n runRegisteredMigrationForTest,\n runRegisteredParserOverrideForTest,\n runRegisteredPreflightOverrideForTest,\n runRegisteredRendererOverrideForTest,\n runRegisteredSearchProviderForTest,\n runRegisteredServiceOverrideForTest,\n runRegisteredVectorStoreAdapterForTest,\n type ActivateExtensionForTestOptions,\n type AssertProjectProfileOptions,\n type DeactivateExtensionForTestOptions,\n type DescribeExtensionActivationOptions,\n type ExtensionActivationSummary,\n type RenderExtensionHarnessMarkdownOptions,\n type RunRegisteredCommandForTestOptions,\n type RunRegisteredExporterForTestOptions,\n type RunRegisteredHookForTestOptions,\n type RunRegisteredImporterForTestOptions,\n type RunRegisteredMigrationForTestOptions,\n type RunRegisteredSearchProviderForTestOptions,\n type RunRegisteredVectorStoreAdapterForTestOptions,\n type SearchProviderOperationContexts,\n type SearchProviderOperationResults,\n type VectorStoreAdapterOperationContexts,\n type VectorStoreAdapterOperationResults,\n type ExtensionCapabilityUsageAssertion,\n type ExtensionCapabilityUsageExpectation,\n type ExtensionDeactivationExpectation,\n type ExtensionManifestBlueprintMatch,\n type ExtensionTestHarness,\n type PackageManifestExpectation,\n type PackageManifestResourceExpectation,\n type RegisteredCommandContractAssertion,\n type RegisteredCommandContractExpectation,\n type RegisteredCommandOverrideExpectation,\n type RegisteredExporterExpectation,\n type RegisteredFlagsExpectation,\n type RegisteredHookExpectation,\n type RegisteredHookKind,\n type RegisteredImporterExpectation,\n type RegisteredItemFieldAssertion,\n type RegisteredItemFieldExpectation,\n type RegisteredItemTypeAssertion,\n type RegisteredItemTypeExpectation,\n type RegisteredMigrationExpectation,\n type RegisteredParserOverrideExpectation,\n type RegisteredPreflightOverrideExpectation,\n type RegisteredProfileAssertion,\n type RegisteredProfileExpectation,\n type RegisteredRendererOverrideExpectation,\n type RegisteredSearchProviderExpectation,\n type RegisteredServiceOverrideExpectation,\n type RegisteredVectorStoreAdapterExpectation,\n} from \"./testing.js\";\n\n/**\n * Canonical extension capability names accepted by pm.\n *\n * Extension manifests should declare one or more of these values in\n * `capabilities`.\n */\nexport const EXTENSION_CAPABILITIES = KNOWN_EXTENSION_CAPABILITIES;\n/** Restricts extension capability values accepted by command, SDK, and storage contracts. */\nexport type ExtensionCapability = (typeof EXTENSION_CAPABILITIES)[number];\n\n/** Canonical extension governance policy modes and registration surfaces. */\nexport const EXTENSION_POLICY_MODES = KNOWN_EXTENSION_POLICY_MODES;\n/** Public contract for extension policy surfaces, shared by SDK and presentation-layer consumers. */\nexport const EXTENSION_POLICY_SURFACES = KNOWN_EXTENSION_POLICY_SURFACES;\n/** Public contract for extension trust modes, shared by SDK and presentation-layer consumers. */\nexport const EXTENSION_TRUST_MODES = KNOWN_EXTENSION_TRUST_MODES;\n/** Public contract for extension sandbox profiles, shared by SDK and presentation-layer consumers. */\nexport const EXTENSION_SANDBOX_PROFILES = KNOWN_EXTENSION_SANDBOX_PROFILES;\n/** Restricts extension policy mode values accepted by command, SDK, and storage contracts. */\nexport type ExtensionPolicyMode = (typeof EXTENSION_POLICY_MODES)[number];\n/** Restricts extension policy surface values accepted by command, SDK, and storage contracts. */\nexport type ExtensionPolicySurface = (typeof EXTENSION_POLICY_SURFACES)[number];\n/** Restricts extension trust mode values accepted by command, SDK, and storage contracts. */\nexport type ExtensionTrustMode = (typeof EXTENSION_TRUST_MODES)[number];\n/** Restricts extension sandbox profile values accepted by command, SDK, and storage contracts. */\nexport type ExtensionSandboxProfile =\n (typeof EXTENSION_SANDBOX_PROFILES)[number];\n\n/** Versioned capability contract metadata emitted by runtime diagnostics. */\nexport {\n EXTENSION_CAPABILITY_CONTRACT,\n EXTENSION_CAPABILITY_CONTRACT_VERSION,\n EXTENSION_CAPABILITY_LEGACY_ALIASES,\n};\n\n/** Least-privilege capability reconciliation helpers: map declared capabilities against the registration surfaces a package actually exercises at activation. */\nexport {\n EXTENSION_CAPABILITY_REGISTRATION_SURFACES,\n collectUsedExtensionCapabilities,\n reconcileExtensionCapabilityUsage,\n type CollectUsedExtensionCapabilitiesOptions,\n type ExtensionCapabilityUsageReconciliation,\n} from \"../core/extensions/capability-usage.js\";\n\n/**\n * Render an extension/package activation summary\n * ({@link describeExtensionActivation} / {@link describeExtensionBlueprint}) to a\n * deterministic Markdown reference document — the author-facing *render* leg of\n * the describe verb, for drift-free package READMEs.\n */\nexport {\n renderExtensionSurfaceMarkdown,\n type ExtensionSurfaceMarkdownOptions,\n} from \"../core/extensions/activation-summary-markdown.js\";\n\nexport type {\n AfterCommandAffectedItem,\n AfterCommandHook,\n AfterCommandHookContext,\n BeforeCommandHook,\n BeforeCommandHookContext,\n CommandDefinition,\n ExtensionCommandArgumentDefinition,\n CommandHandler,\n CommandHandlerContext,\n CommandHandlerResult,\n CommandOverride,\n CommandOverrideContext,\n ExtensionServiceName,\n Exporter,\n ExtensionActivationResult,\n ExtensionApi,\n ExtensionCommandRegistry,\n ExtensionDeactivationFailure,\n ExtensionDeactivationOptions,\n ExtensionDeactivationResult,\n ExtensionDiagnostic,\n ExtensionDiscoveryResult,\n ExtensionHookRegistry,\n ExtensionSelfIdentity,\n ExtensionLoadResult,\n ExtensionManifest,\n ExtensionManifestEngines,\n ExtensionGovernancePolicy,\n ExtensionPolicyOverride,\n ExtensionProvenanceMetadata,\n ExtensionRuntimePermissionDeclaration,\n ExtensionSearchMode,\n ExtensionParserRegistry,\n ExtensionPreflightRegistry,\n ExtensionRegistrationRegistry,\n ExtensionRendererRegistry,\n ExtensionServiceRegistry,\n FlagValueType,\n FlagDefinition,\n ImportExportContext,\n ImportExportRegistrationOptions,\n Importer,\n OnIndexHook,\n OnIndexHookContext,\n OnReadHook,\n OnReadHookContext,\n OnWriteHook,\n OnWriteHookContext,\n OutputRendererFormat,\n ParserOverride,\n ParserOverrideContext,\n ParserOverrideDelta,\n PreflightOverride,\n PreflightOverrideContext,\n PreflightOverrideDelta,\n PreflightRuntimeDecision,\n RegisteredExtensionExporter,\n RegisteredExtensionFlagDefinitions,\n RegisteredExtensionHook,\n RegisteredExtensionImporter,\n RegisteredExtensionProjectProfile,\n RegisteredExtensionSchemaMigrationDefinition,\n RegisteredExtensionSearchProvider,\n RegisteredExtensionServiceOverride,\n RegisteredExtensionVectorStoreAdapter,\n RendererOverride,\n RendererOverrideContext,\n SchemaFieldDefinition,\n SchemaItemTypeCommandOptionPolicyDefinition,\n SchemaItemTypeOptionDefinition,\n SchemaItemTypeDefinition,\n SchemaMigrationDefinition,\n SchemaMigrationRunContext,\n SchemaMigrationRunner,\n SearchProviderEmbedBatchContext,\n SearchProviderEmbedContext,\n SearchProviderDefinition,\n SearchProviderHit,\n SearchProviderQueryContext,\n SearchProviderQueryResult,\n ServiceOverride,\n ServiceOverrideContext,\n VectorStoreAdapterDefinition,\n VectorStoreDeleteContext,\n VectorStoreQueryContext,\n VectorStoreQueryHit,\n VectorStoreUpsertContext,\n VectorStoreUpsertPoint,\n} from \"../core/extensions/loader.js\";\n\nexport type { GlobalOptions } from \"../core/shared/command-types.js\";\nexport type {\n ItemDocument,\n ItemMetadata,\n ItemStatus,\n ItemType,\n PmSettings,\n} from \"../types/index.js\";\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,eAAsB,mC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C/C,SAAO;AACT;AASM,SAAU,eAAe,UAAkB;AAC/C,SAAO;AACT;AASM,SAAU,wBACd,MAAuB;AAEvB,SAAO;AACT;AASM,SAAU,uBACd,MAAsB;AAEtB,SAAO;AACT;AAQM,SAAU,kBAAkB,MAAiB;AACjD,SAAO;AACT;AAQM,SAAU,iBAAiB,MAAgB;AAC/C,SAAO;AACT;AASM,SAAU,kBAAkB,MAAiB;AACjD,SAAO;AACT;;;;;;;;;;ACojBO,IAAM,yBAAyB;AAK/B,IAAM,yBAAyB;AAE/B,IAAM,4BAA4B;AAElC,IAAM,wBAAwB;AAE9B,IAAM,6BAA6B;",
|
|
6
6
|
"names": ["next", "path", "release", "profile"]
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="502fd73a-7bbc-5203-bc9c-1bc9ddf6a713")}catch(e){}}();
|
|
3
3
|
import { normalizeItemFieldType, } from "./item-field-types.js";
|
|
4
4
|
import { EXIT_CODE, ITEM_METADATA_KEY_ORDER } from "../shared/constants.js";
|
|
5
5
|
import { PmCliError } from "../shared/errors.js";
|
|
@@ -231,4 +231,4 @@ export function applyRegisteredItemFieldDefaultsAndValidation(itemMetadata, regi
|
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
//# sourceMappingURL=item-fields.js.map
|
|
234
|
-
//# debugId=
|
|
234
|
+
//# debugId=502fd73a-7bbc-5203-bc9c-1bc9ddf6a713
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item-fields.js","sources":["core/extensions/item-fields.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module core/extensions/item-fields\n *\n * Implements extension runtime contracts and governance for Item Fields.\n */\nimport type { ExtensionRegistrationRegistry } from \"./loader.js\";\nimport {\n normalizeItemFieldType,\n type KnownItemFieldType,\n} from \"./item-field-types.js\";\nimport { EXIT_CODE, ITEM_METADATA_KEY_ORDER } from \"../shared/constants.js\";\nimport { PmCliError } from \"../shared/errors.js\";\n\nconst reservedItemFieldNames = new Set(ITEM_METADATA_KEY_ORDER);\n\n/** Item metadata keys extension-provided fields may never shadow, exposed without mutation methods. */\nexport const RESERVED_ITEM_FIELD_NAMES: ReadonlySet<string> = Object.freeze({\n get size(): number {\n return reservedItemFieldNames.size;\n },\n has(value: string): boolean {\n return reservedItemFieldNames.has(value);\n },\n entries(): IterableIterator<[string, string]> {\n return reservedItemFieldNames.entries();\n },\n keys(): IterableIterator<string> {\n return reservedItemFieldNames.keys();\n },\n values(): IterableIterator<string> {\n return reservedItemFieldNames.values();\n },\n forEach(\n callback: (value: string, value2: string, set: ReadonlySet<string>) => void,\n thisArg?: unknown,\n ): void {\n reservedItemFieldNames.forEach((value) =>\n callback.call(thisArg, value, value, RESERVED_ITEM_FIELD_NAMES),\n );\n },\n [Symbol.iterator](): IterableIterator<string> {\n return reservedItemFieldNames.values();\n },\n});\n\nfunction normalizeFieldName(value: unknown): string | null {\n if (typeof value !== \"string\") {\n return null;\n }\n const normalized = value.trim();\n return normalized.length > 0 ? normalized : null;\n}\n\nfunction normalizeFieldType(value: unknown): KnownItemFieldType | null {\n if (typeof value !== \"string\") {\n return null;\n }\n return normalizeItemFieldType(value);\n}\n\nfunction cloneFieldValue<T>(value: T): T {\n try {\n return structuredClone(value);\n } catch {\n return value;\n }\n}\n\nfunction parseFieldAssignment(raw: string): { key: string; value: string } {\n const trimmed = raw.trim();\n const separatorIndex = trimmed.indexOf(\"=\");\n if (separatorIndex <= 0) {\n throw new PmCliError(\n `--field entries must use name=value syntax, received: ${raw}`,\n EXIT_CODE.USAGE,\n );\n }\n // `separatorIndex > 0` guarantees a non-`=` first character on the already\n // trimmed string, so the trimmed key is always non-empty here.\n const key = trimmed.slice(0, separatorIndex).trim();\n const value = trimmed.slice(separatorIndex + 1);\n return { key, value };\n}\n\nfunction parseJsonFieldValue(\n raw: string,\n fieldName: string,\n expectedType: \"array\" | \"object\",\n): unknown {\n try {\n const parsed = JSON.parse(raw);\n if (expectedType === \"array\" && Array.isArray(parsed)) {\n return parsed;\n }\n if (\n expectedType === \"object\" &&\n typeof parsed === \"object\" &&\n parsed !== null &&\n !Array.isArray(parsed)\n ) {\n return parsed;\n }\n } catch {\n // Fall through to the typed usage error below.\n }\n throw new PmCliError(\n `--field ${fieldName}=... must be valid JSON ${expectedType}`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction coerceRegisteredFieldValue(\n fieldName: string,\n fieldType: \"string\" | \"number\" | \"boolean\" | \"array\" | \"object\",\n raw: string,\n): unknown {\n if (fieldType === \"string\") {\n return raw;\n }\n if (fieldType === \"number\") {\n const trimmed = raw.trim();\n if (trimmed.length === 0) {\n throw new PmCliError(\n `--field ${fieldName}=... must be a number`,\n EXIT_CODE.USAGE,\n );\n }\n const parsed = Number(trimmed);\n if (!Number.isFinite(parsed)) {\n throw new PmCliError(\n `--field ${fieldName}=... must be a number`,\n EXIT_CODE.USAGE,\n );\n }\n return parsed;\n }\n if (fieldType === \"boolean\") {\n const normalized = raw.trim().toLowerCase();\n if (normalized === \"true\" || normalized === \"1\" || normalized === \"yes\") {\n return true;\n }\n if (normalized === \"false\" || normalized === \"0\" || normalized === \"no\") {\n return false;\n }\n throw new PmCliError(\n `--field ${fieldName}=... must be one of true|false|1|0|yes|no`,\n EXIT_CODE.USAGE,\n );\n }\n return parseJsonFieldValue(raw, fieldName, fieldType);\n}\n\nfunction collectRegisteredFieldDefinitions(\n registrations: ExtensionRegistrationRegistry | null,\n): Map<\n string,\n { name: string; type: \"string\" | \"number\" | \"boolean\" | \"array\" | \"object\" }\n> {\n const definitions = new Map<\n string,\n { name: string; type: \"string\" | \"number\" | \"boolean\" | \"array\" | \"object\" }\n >();\n if (!registrations) {\n return definitions;\n }\n for (const registration of registrations.item_fields) {\n for (const definition of registration.fields) {\n const fieldName = normalizeFieldName(definition.name);\n const fieldType = normalizeFieldType(definition.type);\n if (!fieldName || !fieldType) {\n continue;\n }\n const existing = definitions.get(fieldName);\n if (existing && existing.type !== fieldType) {\n throw new PmCliError(\n `Extension item field \"${fieldName}\" is declared with conflicting types: ${existing.type}, ${fieldType}`,\n EXIT_CODE.USAGE,\n {\n code: \"extension_item_field_type_conflict\",\n nextSteps: [\n \"Make every active extension declaration for this field use the same type.\",\n ],\n },\n );\n }\n definitions.set(fieldName, { name: fieldName, type: fieldType });\n }\n }\n return definitions;\n}\n\nfunction assertNotReservedItemFieldName(fieldName: string): void {\n if (!RESERVED_ITEM_FIELD_NAMES.has(fieldName)) {\n return;\n }\n throw new PmCliError(\n `Extension item field \"${fieldName}\" collides with built-in item metadata \"${fieldName}\"; rename the extension field with an extension-specific prefix. Reserved fields: ${[...RESERVED_ITEM_FIELD_NAMES].sort((left, right) => left.localeCompare(right)).join(\", \")}.`,\n EXIT_CODE.USAGE,\n {\n code: \"extension_item_field_reserved\",\n nextSteps: [\n \"Rename the extension item field, preferably with an extension-specific prefix.\",\n ],\n },\n );\n}\n\n/** Implements collect registered item field names for the public runtime surface of this module. */\nexport function collectRegisteredItemFieldNames(\n registrations: ExtensionRegistrationRegistry | null,\n): string[] {\n return [...collectRegisteredFieldDefinitions(registrations).keys()].sort(\n (left, right) => left.localeCompare(right),\n );\n}\n\n/** Implements parse registered item field assignments for the public runtime surface of this module. */\nexport function parseRegisteredItemFieldAssignments(\n rawFields: string[] | undefined,\n registrations: ExtensionRegistrationRegistry | null,\n): Record<string, unknown> {\n if (!rawFields || rawFields.length === 0) {\n return {};\n }\n const definitions = collectRegisteredFieldDefinitions(registrations);\n const values: Record<string, unknown> = {};\n for (const raw of rawFields) {\n const { key, value } = parseFieldAssignment(raw);\n const definition = definitions.get(key);\n if (!definition) {\n const known = [...definitions.keys()].sort((left, right) =>\n left.localeCompare(right),\n );\n throw new PmCliError(\n `--field ${key} is not declared by an active extension item-field registration`,\n EXIT_CODE.USAGE,\n {\n code: \"extension_item_field_unknown\",\n recovery: { provided_fields: known },\n nextSteps:\n known.length > 0\n ? [`Use one of the declared fields: ${known.join(\", \")}`]\n : [\n \"Activate an extension that calls registerItemFields before setting extension fields.\",\n ],\n },\n );\n }\n assertNotReservedItemFieldName(definition.name);\n values[definition.name] = coerceRegisteredFieldValue(\n definition.name,\n definition.type,\n value,\n );\n }\n return values;\n}\n\nfunction isValidFieldType(\n value: unknown,\n expectedType: \"string\" | \"number\" | \"boolean\" | \"array\" | \"object\",\n): boolean {\n if (expectedType === \"string\") {\n return typeof value === \"string\";\n }\n if (expectedType === \"number\") {\n return typeof value === \"number\" && Number.isFinite(value);\n }\n if (expectedType === \"boolean\") {\n return typeof value === \"boolean\";\n }\n if (expectedType === \"array\") {\n return Array.isArray(value);\n }\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction isAllowedFieldValue(\n value: unknown,\n allowed: unknown[] | undefined,\n): boolean {\n if (!allowed || allowed.length === 0) {\n return true;\n }\n return allowed.some((candidate) => Object.is(candidate, value));\n}\n\n/** Implements apply registered item field defaults and validation for the public runtime surface of this module. */\nexport function applyRegisteredItemFieldDefaultsAndValidation(\n itemMetadata: Record<string, unknown>,\n registrations: ExtensionRegistrationRegistry | null,\n options: { skipDefaultFields?: ReadonlySet<string> } = {},\n): void {\n if (!registrations) {\n return;\n }\n collectRegisteredFieldDefinitions(registrations);\n for (const registration of registrations.item_fields) {\n for (const definition of registration.fields) {\n const fieldName = normalizeFieldName(definition.name);\n if (!fieldName) {\n continue;\n }\n assertNotReservedItemFieldName(fieldName);\n if (\n !(fieldName in itemMetadata) &&\n !options.skipDefaultFields?.has(fieldName) &&\n Object.prototype.hasOwnProperty.call(definition, \"default\")\n ) {\n itemMetadata[fieldName] = cloneFieldValue(definition.default);\n }\n\n const currentValue = itemMetadata[fieldName];\n if (currentValue === undefined) {\n continue;\n }\n const expectedType = normalizeFieldType(definition.type);\n if (expectedType && !isValidFieldType(currentValue, expectedType)) {\n throw new TypeError(\n `Item field \"${fieldName}\" must be of type ${expectedType}`,\n );\n }\n\n const allowedValues = Array.isArray(definition.values)\n ? definition.values\n : undefined;\n if (!isAllowedFieldValue(currentValue, allowedValues)) {\n throw new TypeError(\n `Item field \"${fieldName}\" must match one of the configured allowed values`,\n );\n }\n }\n }\n}\n"],"names":[],"mappings":";;AAMA,OAAO,EACL,sBAAsB,GAEvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC,uBAAuB,CAAC,CAAC;AAEhE,uGAAuG;AACvG,MAAM,CAAC,MAAM,yBAAyB,GAAwB,MAAM,CAAC,MAAM,CAAC;IAC1E,IAAI,IAAI;QACN,OAAO,sBAAsB,CAAC,IAAI,CAAC;IACrC,CAAC;IACD,GAAG,CAAC,KAAa;QACf,OAAO,sBAAsB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IACD,OAAO;QACL,OAAO,sBAAsB,CAAC,OAAO,EAAE,CAAC;IAC1C,CAAC;IACD,IAAI;QACF,OAAO,sBAAsB,CAAC,IAAI,EAAE,CAAC;IACvC,CAAC;IACD,MAAM;QACJ,OAAO,sBAAsB,CAAC,MAAM,EAAE,CAAC;IACzC,CAAC;IACD,OAAO,CACL,QAA2E,EAC3E,OAAiB;QAEjB,sBAAsB,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CACvC,QAAQ,CAAC,IAAI,CAAC,OAAO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* @module core/extensions/item-fields\n *\n * Implements extension runtime contracts and governance for Item Fields.\n */\nimport type { ExtensionRegistrationRegistry } from \"./loader.js\";\nimport {\n normalizeItemFieldType,\n type KnownItemFieldType,\n} from \"./item-field-types.js\";\nimport { EXIT_CODE, ITEM_METADATA_KEY_ORDER } from \"../shared/constants.js\";\nimport { PmCliError } from \"../shared/errors.js\";\n\nconst reservedItemFieldNames = new Set(ITEM_METADATA_KEY_ORDER);\n\n/** Item metadata keys extension-provided fields may never shadow, exposed without mutation methods. */\nexport const RESERVED_ITEM_FIELD_NAMES: ReadonlySet<string> = Object.freeze({\n get size(): number {\n return reservedItemFieldNames.size;\n },\n has(value: string): boolean {\n return reservedItemFieldNames.has(value);\n },\n entries(): SetIterator<[string, string]> {\n return reservedItemFieldNames.entries();\n },\n keys(): SetIterator<string> {\n return reservedItemFieldNames.keys();\n },\n values(): SetIterator<string> {\n return reservedItemFieldNames.values();\n },\n forEach(\n callback: (value: string, value2: string, set: ReadonlySet<string>) => void,\n thisArg?: unknown,\n ): void {\n reservedItemFieldNames.forEach((value) =>\n callback.call(thisArg, value, value, RESERVED_ITEM_FIELD_NAMES),\n );\n },\n [Symbol.iterator](): SetIterator<string> {\n return reservedItemFieldNames.values();\n },\n});\n\nfunction normalizeFieldName(value: unknown): string | null {\n if (typeof value !== \"string\") {\n return null;\n }\n const normalized = value.trim();\n return normalized.length > 0 ? normalized : null;\n}\n\nfunction normalizeFieldType(value: unknown): KnownItemFieldType | null {\n if (typeof value !== \"string\") {\n return null;\n }\n return normalizeItemFieldType(value);\n}\n\nfunction cloneFieldValue<T>(value: T): T {\n try {\n return structuredClone(value);\n } catch {\n return value;\n }\n}\n\nfunction parseFieldAssignment(raw: string): { key: string; value: string } {\n const trimmed = raw.trim();\n const separatorIndex = trimmed.indexOf(\"=\");\n if (separatorIndex <= 0) {\n throw new PmCliError(\n `--field entries must use name=value syntax, received: ${raw}`,\n EXIT_CODE.USAGE,\n );\n }\n // `separatorIndex > 0` guarantees a non-`=` first character on the already\n // trimmed string, so the trimmed key is always non-empty here.\n const key = trimmed.slice(0, separatorIndex).trim();\n const value = trimmed.slice(separatorIndex + 1);\n return { key, value };\n}\n\nfunction parseJsonFieldValue(\n raw: string,\n fieldName: string,\n expectedType: \"array\" | \"object\",\n): unknown {\n try {\n const parsed = JSON.parse(raw);\n if (expectedType === \"array\" && Array.isArray(parsed)) {\n return parsed;\n }\n if (\n expectedType === \"object\" &&\n typeof parsed === \"object\" &&\n parsed !== null &&\n !Array.isArray(parsed)\n ) {\n return parsed;\n }\n } catch {\n // Fall through to the typed usage error below.\n }\n throw new PmCliError(\n `--field ${fieldName}=... must be valid JSON ${expectedType}`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction coerceRegisteredFieldValue(\n fieldName: string,\n fieldType: \"string\" | \"number\" | \"boolean\" | \"array\" | \"object\",\n raw: string,\n): unknown {\n if (fieldType === \"string\") {\n return raw;\n }\n if (fieldType === \"number\") {\n const trimmed = raw.trim();\n if (trimmed.length === 0) {\n throw new PmCliError(\n `--field ${fieldName}=... must be a number`,\n EXIT_CODE.USAGE,\n );\n }\n const parsed = Number(trimmed);\n if (!Number.isFinite(parsed)) {\n throw new PmCliError(\n `--field ${fieldName}=... must be a number`,\n EXIT_CODE.USAGE,\n );\n }\n return parsed;\n }\n if (fieldType === \"boolean\") {\n const normalized = raw.trim().toLowerCase();\n if (normalized === \"true\" || normalized === \"1\" || normalized === \"yes\") {\n return true;\n }\n if (normalized === \"false\" || normalized === \"0\" || normalized === \"no\") {\n return false;\n }\n throw new PmCliError(\n `--field ${fieldName}=... must be one of true|false|1|0|yes|no`,\n EXIT_CODE.USAGE,\n );\n }\n return parseJsonFieldValue(raw, fieldName, fieldType);\n}\n\nfunction collectRegisteredFieldDefinitions(\n registrations: ExtensionRegistrationRegistry | null,\n): Map<\n string,\n { name: string; type: \"string\" | \"number\" | \"boolean\" | \"array\" | \"object\" }\n> {\n const definitions = new Map<\n string,\n { name: string; type: \"string\" | \"number\" | \"boolean\" | \"array\" | \"object\" }\n >();\n if (!registrations) {\n return definitions;\n }\n for (const registration of registrations.item_fields) {\n for (const definition of registration.fields) {\n const fieldName = normalizeFieldName(definition.name);\n const fieldType = normalizeFieldType(definition.type);\n if (!fieldName || !fieldType) {\n continue;\n }\n const existing = definitions.get(fieldName);\n if (existing && existing.type !== fieldType) {\n throw new PmCliError(\n `Extension item field \"${fieldName}\" is declared with conflicting types: ${existing.type}, ${fieldType}`,\n EXIT_CODE.USAGE,\n {\n code: \"extension_item_field_type_conflict\",\n nextSteps: [\n \"Make every active extension declaration for this field use the same type.\",\n ],\n },\n );\n }\n definitions.set(fieldName, { name: fieldName, type: fieldType });\n }\n }\n return definitions;\n}\n\nfunction assertNotReservedItemFieldName(fieldName: string): void {\n if (!RESERVED_ITEM_FIELD_NAMES.has(fieldName)) {\n return;\n }\n throw new PmCliError(\n `Extension item field \"${fieldName}\" collides with built-in item metadata \"${fieldName}\"; rename the extension field with an extension-specific prefix. Reserved fields: ${[...RESERVED_ITEM_FIELD_NAMES].sort((left, right) => left.localeCompare(right)).join(\", \")}.`,\n EXIT_CODE.USAGE,\n {\n code: \"extension_item_field_reserved\",\n nextSteps: [\n \"Rename the extension item field, preferably with an extension-specific prefix.\",\n ],\n },\n );\n}\n\n/** Implements collect registered item field names for the public runtime surface of this module. */\nexport function collectRegisteredItemFieldNames(\n registrations: ExtensionRegistrationRegistry | null,\n): string[] {\n return [...collectRegisteredFieldDefinitions(registrations).keys()].sort(\n (left, right) => left.localeCompare(right),\n );\n}\n\n/** Implements parse registered item field assignments for the public runtime surface of this module. */\nexport function parseRegisteredItemFieldAssignments(\n rawFields: string[] | undefined,\n registrations: ExtensionRegistrationRegistry | null,\n): Record<string, unknown> {\n if (!rawFields || rawFields.length === 0) {\n return {};\n }\n const definitions = collectRegisteredFieldDefinitions(registrations);\n const values: Record<string, unknown> = {};\n for (const raw of rawFields) {\n const { key, value } = parseFieldAssignment(raw);\n const definition = definitions.get(key);\n if (!definition) {\n const known = [...definitions.keys()].sort((left, right) =>\n left.localeCompare(right),\n );\n throw new PmCliError(\n `--field ${key} is not declared by an active extension item-field registration`,\n EXIT_CODE.USAGE,\n {\n code: \"extension_item_field_unknown\",\n recovery: { provided_fields: known },\n nextSteps:\n known.length > 0\n ? [`Use one of the declared fields: ${known.join(\", \")}`]\n : [\n \"Activate an extension that calls registerItemFields before setting extension fields.\",\n ],\n },\n );\n }\n assertNotReservedItemFieldName(definition.name);\n values[definition.name] = coerceRegisteredFieldValue(\n definition.name,\n definition.type,\n value,\n );\n }\n return values;\n}\n\nfunction isValidFieldType(\n value: unknown,\n expectedType: \"string\" | \"number\" | \"boolean\" | \"array\" | \"object\",\n): boolean {\n if (expectedType === \"string\") {\n return typeof value === \"string\";\n }\n if (expectedType === \"number\") {\n return typeof value === \"number\" && Number.isFinite(value);\n }\n if (expectedType === \"boolean\") {\n return typeof value === \"boolean\";\n }\n if (expectedType === \"array\") {\n return Array.isArray(value);\n }\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction isAllowedFieldValue(\n value: unknown,\n allowed: unknown[] | undefined,\n): boolean {\n if (!allowed || allowed.length === 0) {\n return true;\n }\n return allowed.some((candidate) => Object.is(candidate, value));\n}\n\n/** Implements apply registered item field defaults and validation for the public runtime surface of this module. */\nexport function applyRegisteredItemFieldDefaultsAndValidation(\n itemMetadata: Record<string, unknown>,\n registrations: ExtensionRegistrationRegistry | null,\n options: { skipDefaultFields?: ReadonlySet<string> } = {},\n): void {\n if (!registrations) {\n return;\n }\n collectRegisteredFieldDefinitions(registrations);\n for (const registration of registrations.item_fields) {\n for (const definition of registration.fields) {\n const fieldName = normalizeFieldName(definition.name);\n if (!fieldName) {\n continue;\n }\n assertNotReservedItemFieldName(fieldName);\n if (\n !(fieldName in itemMetadata) &&\n !options.skipDefaultFields?.has(fieldName) &&\n Object.prototype.hasOwnProperty.call(definition, \"default\")\n ) {\n itemMetadata[fieldName] = cloneFieldValue(definition.default);\n }\n\n const currentValue = itemMetadata[fieldName];\n if (currentValue === undefined) {\n continue;\n }\n const expectedType = normalizeFieldType(definition.type);\n if (expectedType && !isValidFieldType(currentValue, expectedType)) {\n throw new TypeError(\n `Item field \"${fieldName}\" must be of type ${expectedType}`,\n );\n }\n\n const allowedValues = Array.isArray(definition.values)\n ? definition.values\n : undefined;\n if (!isAllowedFieldValue(currentValue, allowedValues)) {\n throw new TypeError(\n `Item field \"${fieldName}\" must match one of the configured allowed values`,\n );\n }\n }\n }\n}\n"],"names":[],"mappings":";;AAMA,OAAO,EACL,sBAAsB,GAEvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC,uBAAuB,CAAC,CAAC;AAEhE,uGAAuG;AACvG,MAAM,CAAC,MAAM,yBAAyB,GAAwB,MAAM,CAAC,MAAM,CAAC;IAC1E,IAAI,IAAI;QACN,OAAO,sBAAsB,CAAC,IAAI,CAAC;IACrC,CAAC;IACD,GAAG,CAAC,KAAa;QACf,OAAO,sBAAsB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IACD,OAAO;QACL,OAAO,sBAAsB,CAAC,OAAO,EAAE,CAAC;IAC1C,CAAC;IACD,IAAI;QACF,OAAO,sBAAsB,CAAC,IAAI,EAAE,CAAC;IACvC,CAAC;IACD,MAAM;QACJ,OAAO,sBAAsB,CAAC,MAAM,EAAE,CAAC;IACzC,CAAC;IACD,OAAO,CACL,QAA2E,EAC3E,OAAiB;QAEjB,sBAAsB,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CACvC,QAAQ,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,yBAAyB,CAAC,CAChE,CAAC;IACJ,CAAC;IACD,CAAC,MAAM,CA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