opkg 0.9.2 → 0.9.4
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/agents/code-reviewer.md +171 -0
- package/.claude/commands/commit-push-pr.md +20 -0
- package/.claude/commands/{specs/read.md → read-specs.md} +1 -1
- package/.claude/commands/{specs/update.md → update-specs.md} +4 -0
- package/.claude/skills/code-review-excellence/SKILL.md +538 -0
- package/README.md +2 -2
- package/package.json +3 -1
- package/packages/cli/dist/add-IJAPFHIX.js +624 -0
- package/packages/cli/dist/add-IJAPFHIX.js.map +7 -0
- package/packages/cli/dist/add-LLUNFLJI.js +624 -0
- package/packages/cli/dist/add-LLUNFLJI.js.map +7 -0
- package/packages/cli/dist/add-U44SL3OR.js +624 -0
- package/packages/cli/dist/add-U44SL3OR.js.map +7 -0
- package/packages/cli/dist/chunk-23VBP5L6.js +371 -0
- package/packages/cli/dist/chunk-23VBP5L6.js.map +7 -0
- package/packages/cli/dist/chunk-2SVHLF5C.js +1419 -0
- package/packages/cli/dist/chunk-2SVHLF5C.js.map +7 -0
- package/packages/cli/dist/chunk-37256POU.js +99 -0
- package/packages/cli/dist/chunk-37256POU.js.map +7 -0
- package/packages/cli/dist/chunk-3PZRVA6O.js +196 -0
- package/packages/cli/dist/chunk-3PZRVA6O.js.map +7 -0
- package/packages/cli/dist/chunk-427DCURL.js +155 -0
- package/packages/cli/dist/chunk-427DCURL.js.map +7 -0
- package/packages/cli/dist/chunk-4B5HJLP2.js +48 -0
- package/packages/cli/dist/chunk-4B5HJLP2.js.map +7 -0
- package/packages/cli/dist/chunk-4OWT3YEG.js +413 -0
- package/packages/cli/dist/chunk-4OWT3YEG.js.map +7 -0
- package/packages/cli/dist/chunk-4RIBTBXI.js +568 -0
- package/packages/cli/dist/chunk-4RIBTBXI.js.map +7 -0
- package/packages/cli/dist/chunk-4X2EJHJN.js +63 -0
- package/packages/cli/dist/chunk-4X2EJHJN.js.map +7 -0
- package/packages/cli/dist/chunk-6CYW66HD.js +1136 -0
- package/packages/cli/dist/chunk-6CYW66HD.js.map +7 -0
- package/packages/cli/dist/chunk-6DITYAFA.js +172 -0
- package/packages/cli/dist/chunk-6DITYAFA.js.map +7 -0
- package/packages/cli/dist/chunk-7KEAKEVZ.js +568 -0
- package/packages/cli/dist/chunk-7KEAKEVZ.js.map +7 -0
- package/packages/cli/dist/chunk-ABFUD25D.js +61 -0
- package/packages/cli/dist/chunk-ABFUD25D.js.map +7 -0
- package/packages/cli/dist/chunk-AR7GJCG6.js +274 -0
- package/packages/cli/dist/chunk-AR7GJCG6.js.map +7 -0
- package/packages/cli/dist/chunk-AYTGQCXH.js +86 -0
- package/packages/cli/dist/chunk-AYTGQCXH.js.map +7 -0
- package/packages/cli/dist/chunk-BROJ6OUT.js +631 -0
- package/packages/cli/dist/chunk-BROJ6OUT.js.map +7 -0
- package/packages/cli/dist/chunk-BVVSU7QD.js +23 -0
- package/packages/cli/dist/chunk-BVVSU7QD.js.map +7 -0
- package/packages/cli/dist/chunk-C6FY55UP.js +108 -0
- package/packages/cli/dist/chunk-C6FY55UP.js.map +7 -0
- package/packages/cli/dist/chunk-CVA64SXK.js +1136 -0
- package/packages/cli/dist/chunk-CVA64SXK.js.map +7 -0
- package/packages/cli/dist/chunk-D3O7LY2Q.js +1151 -0
- package/packages/cli/dist/chunk-D3O7LY2Q.js.map +7 -0
- package/packages/cli/dist/chunk-D6LEPODL.js +413 -0
- package/packages/cli/dist/chunk-D6LEPODL.js.map +7 -0
- package/packages/cli/dist/chunk-DEC24S7E.js +186 -0
- package/packages/cli/dist/chunk-DEC24S7E.js.map +7 -0
- package/packages/cli/dist/chunk-FMVVJH5M.js +371 -0
- package/packages/cli/dist/chunk-FMVVJH5M.js.map +7 -0
- package/packages/cli/dist/chunk-GDVFS3YP.js +130 -0
- package/packages/cli/dist/chunk-GDVFS3YP.js.map +7 -0
- package/packages/cli/dist/chunk-GEP2G5HF.js +31 -0
- package/packages/cli/dist/chunk-GEP2G5HF.js.map +7 -0
- package/packages/cli/dist/chunk-GSWHZBT2.js +62 -0
- package/packages/cli/dist/chunk-GSWHZBT2.js.map +7 -0
- package/packages/cli/dist/chunk-HTYHJA3B.js +61 -0
- package/packages/cli/dist/chunk-HTYHJA3B.js.map +7 -0
- package/packages/cli/dist/chunk-HYKYECAE.js +222 -0
- package/packages/cli/dist/chunk-HYKYECAE.js.map +7 -0
- package/packages/cli/dist/chunk-I7FEAHB4.js +100 -0
- package/packages/cli/dist/chunk-I7FEAHB4.js.map +7 -0
- package/packages/cli/dist/chunk-IHVZ5AUJ.js +107 -0
- package/packages/cli/dist/chunk-IHVZ5AUJ.js.map +7 -0
- package/packages/cli/dist/chunk-KI7FDU3H.js +99 -0
- package/packages/cli/dist/chunk-KI7FDU3H.js.map +7 -0
- package/packages/cli/dist/chunk-L5GRJQBS.js +32 -0
- package/packages/cli/dist/chunk-L5GRJQBS.js.map +7 -0
- package/packages/cli/dist/chunk-LHEAUDJL.js +302 -0
- package/packages/cli/dist/chunk-LHEAUDJL.js.map +7 -0
- package/packages/cli/dist/chunk-MIURCESJ.js +48 -0
- package/packages/cli/dist/chunk-MIURCESJ.js.map +7 -0
- package/packages/cli/dist/chunk-N43IXOND.js +732 -0
- package/packages/cli/dist/chunk-N43IXOND.js.map +7 -0
- package/packages/cli/dist/chunk-OUZRMGPV.js +274 -0
- package/packages/cli/dist/chunk-OUZRMGPV.js.map +7 -0
- package/packages/cli/dist/chunk-PSQXKAL4.js +371 -0
- package/packages/cli/dist/chunk-PSQXKAL4.js.map +7 -0
- package/packages/cli/dist/chunk-PUDRKDVZ.js +1419 -0
- package/packages/cli/dist/chunk-PUDRKDVZ.js.map +7 -0
- package/packages/cli/dist/chunk-RAKMX654.js +631 -0
- package/packages/cli/dist/chunk-RAKMX654.js.map +7 -0
- package/packages/cli/dist/chunk-RSFLK2TP.js +195 -0
- package/packages/cli/dist/chunk-RSFLK2TP.js.map +7 -0
- package/packages/cli/dist/chunk-S26PR2BS.js +99 -0
- package/packages/cli/dist/chunk-S26PR2BS.js.map +7 -0
- package/packages/cli/dist/chunk-U7FW7SXX.js +568 -0
- package/packages/cli/dist/chunk-U7FW7SXX.js.map +7 -0
- package/packages/cli/dist/chunk-VKM6K5TN.js +413 -0
- package/packages/cli/dist/chunk-VKM6K5TN.js.map +7 -0
- package/packages/cli/dist/chunk-VKNJG4JN.js +253 -0
- package/packages/cli/dist/chunk-VKNJG4JN.js.map +7 -0
- package/packages/cli/dist/chunk-VQ2KY6CK.js +113 -0
- package/packages/cli/dist/chunk-VQ2KY6CK.js.map +7 -0
- package/packages/cli/dist/chunk-VQDTXLOX.js +1312 -0
- package/packages/cli/dist/chunk-VQDTXLOX.js.map +7 -0
- package/packages/cli/dist/chunk-VXNS3X5O.js +60 -0
- package/packages/cli/dist/chunk-VXNS3X5O.js.map +7 -0
- package/packages/cli/dist/chunk-WF7H2YDU.js +376 -0
- package/packages/cli/dist/chunk-WF7H2YDU.js.map +7 -0
- package/packages/cli/dist/chunk-WNRXZLWW.js +266 -0
- package/packages/cli/dist/chunk-WNRXZLWW.js.map +7 -0
- package/packages/cli/dist/chunk-WT4VVCXM.js +1121 -0
- package/packages/cli/dist/chunk-WT4VVCXM.js.map +7 -0
- package/packages/cli/dist/configure-3AZUMDJZ.js +107 -0
- package/packages/cli/dist/configure-3AZUMDJZ.js.map +7 -0
- package/packages/cli/dist/configure-D722JQOD.js +107 -0
- package/packages/cli/dist/configure-D722JQOD.js.map +7 -0
- package/packages/cli/dist/configure-IU5H7XD6.js +107 -0
- package/packages/cli/dist/configure-IU5H7XD6.js.map +7 -0
- package/packages/cli/dist/file-format-detector-PXCIAKTK.js +22 -0
- package/packages/cli/dist/file-format-detector-PXCIAKTK.js.map +7 -0
- package/packages/cli/dist/index.js +17 -17
- package/packages/cli/dist/install-EZNWMLJR.js +7581 -0
- package/packages/cli/dist/install-EZNWMLJR.js.map +7 -0
- package/packages/cli/dist/install-F5ANFUBX.js +7577 -0
- package/packages/cli/dist/install-F5ANFUBX.js.map +7 -0
- package/packages/cli/dist/install-JSXEPPC2.js +7104 -0
- package/packages/cli/dist/install-JSXEPPC2.js.map +7 -0
- package/packages/cli/dist/install-QHEBX7JH.js +7101 -0
- package/packages/cli/dist/install-QHEBX7JH.js.map +7 -0
- package/packages/cli/dist/list-DMOUATYI.js +327 -0
- package/packages/cli/dist/list-DMOUATYI.js.map +7 -0
- package/packages/cli/dist/list-UESSCB7Y.js +327 -0
- package/packages/cli/dist/list-UESSCB7Y.js.map +7 -0
- package/packages/cli/dist/list-XR7RSJFS.js +327 -0
- package/packages/cli/dist/list-XR7RSJFS.js.map +7 -0
- package/packages/cli/dist/login-EYZ2SOYZ.js +150 -0
- package/packages/cli/dist/login-EYZ2SOYZ.js.map +7 -0
- package/packages/cli/dist/login-JWCSTAEU.js +150 -0
- package/packages/cli/dist/login-JWCSTAEU.js.map +7 -0
- package/packages/cli/dist/login-NRKHXZKM.js +150 -0
- package/packages/cli/dist/login-NRKHXZKM.js.map +7 -0
- package/packages/cli/dist/logout-HDMYRXIE.js +40 -0
- package/packages/cli/dist/logout-HDMYRXIE.js.map +7 -0
- package/packages/cli/dist/logout-SYHXCVCQ.js +40 -0
- package/packages/cli/dist/logout-SYHXCVCQ.js.map +7 -0
- package/packages/cli/dist/logout-X3XUUOH5.js +40 -0
- package/packages/cli/dist/logout-X3XUUOH5.js.map +7 -0
- package/packages/cli/dist/new-3LTFKDTQ.js +277 -0
- package/packages/cli/dist/new-3LTFKDTQ.js.map +7 -0
- package/packages/cli/dist/new-F46OSD72.js +277 -0
- package/packages/cli/dist/new-F46OSD72.js.map +7 -0
- package/packages/cli/dist/new-OPCCLNL2.js +277 -0
- package/packages/cli/dist/new-OPCCLNL2.js.map +7 -0
- package/packages/cli/dist/package-marker-detector-T5O5YD2E.js +80 -0
- package/packages/cli/dist/package-marker-detector-T5O5YD2E.js.map +7 -0
- package/packages/cli/dist/package-yml-QWZIJDYU.js +16 -0
- package/packages/cli/dist/package-yml-QWZIJDYU.js.map +7 -0
- package/packages/cli/dist/plugin-naming-YP2I4NPA.js +29 -0
- package/packages/cli/dist/plugin-naming-YP2I4NPA.js.map +7 -0
- package/packages/cli/dist/publish-4H43PCSG.js +619 -0
- package/packages/cli/dist/publish-4H43PCSG.js.map +7 -0
- package/packages/cli/dist/publish-RULKLNUX.js +619 -0
- package/packages/cli/dist/publish-RULKLNUX.js.map +7 -0
- package/packages/cli/dist/publish-URWY2P3E.js +619 -0
- package/packages/cli/dist/publish-URWY2P3E.js.map +7 -0
- package/packages/cli/dist/remove-BD52BHR2.js +542 -0
- package/packages/cli/dist/remove-BD52BHR2.js.map +7 -0
- package/packages/cli/dist/remove-G5NRC7LD.js +542 -0
- package/packages/cli/dist/remove-G5NRC7LD.js.map +7 -0
- package/packages/cli/dist/remove-TC3FQUYQ.js +542 -0
- package/packages/cli/dist/remove-TC3FQUYQ.js.map +7 -0
- package/packages/cli/dist/resource-discoverer-4X4RY43E.js +17 -0
- package/packages/cli/dist/resource-discoverer-4X4RY43E.js.map +7 -0
- package/packages/cli/dist/save-24TESYKI.js +1728 -0
- package/packages/cli/dist/save-24TESYKI.js.map +7 -0
- package/packages/cli/dist/save-N3QWF2WN.js +1728 -0
- package/packages/cli/dist/save-N3QWF2WN.js.map +7 -0
- package/packages/cli/dist/save-P2U67DTV.js +1728 -0
- package/packages/cli/dist/save-P2U67DTV.js.map +7 -0
- package/packages/cli/dist/search-ABROK3UO.js +157 -0
- package/packages/cli/dist/search-ABROK3UO.js.map +7 -0
- package/packages/cli/dist/search-WVFXFNAV.js +157 -0
- package/packages/cli/dist/search-WVFXFNAV.js.map +7 -0
- package/packages/cli/dist/search-YQN2Q2SO.js +157 -0
- package/packages/cli/dist/search-YQN2Q2SO.js.map +7 -0
- package/packages/cli/dist/set-DCWF73F6.js +251 -0
- package/packages/cli/dist/set-DCWF73F6.js.map +7 -0
- package/packages/cli/dist/set-GJEG2F6Y.js +251 -0
- package/packages/cli/dist/set-GJEG2F6Y.js.map +7 -0
- package/packages/cli/dist/set-NGM2FIKF.js +251 -0
- package/packages/cli/dist/set-NGM2FIKF.js.map +7 -0
- package/packages/cli/dist/uninstall-3CJQMTYH.js +539 -0
- package/packages/cli/dist/uninstall-3CJQMTYH.js.map +7 -0
- package/packages/cli/dist/uninstall-Q3CP4UN5.js +539 -0
- package/packages/cli/dist/uninstall-Q3CP4UN5.js.map +7 -0
- package/packages/cli/dist/uninstall-QU5OMEEC.js +539 -0
- package/packages/cli/dist/uninstall-QU5OMEEC.js.map +7 -0
- package/packages/cli/dist/unpublish-GHJQYC4S.js +245 -0
- package/packages/cli/dist/unpublish-GHJQYC4S.js.map +7 -0
- package/packages/cli/dist/unpublish-L2CYMK4B.js +245 -0
- package/packages/cli/dist/unpublish-L2CYMK4B.js.map +7 -0
- package/packages/cli/dist/unpublish-VBTNTMS5.js +245 -0
- package/packages/cli/dist/unpublish-VBTNTMS5.js.map +7 -0
- package/packages/cli/dist/view-MXRBMXOG.js +488 -0
- package/packages/cli/dist/view-MXRBMXOG.js.map +7 -0
- package/packages/cli/dist/view-NMND7SAW.js +488 -0
- package/packages/cli/dist/view-NMND7SAW.js.map +7 -0
- package/packages/cli/dist/view-RPQRDSYB.js +488 -0
- package/packages/cli/dist/view-RPQRDSYB.js.map +7 -0
- package/packages/cli/package.json +2 -0
- package/packages/core/dist/constants/index.d.ts +9 -0
- package/packages/core/dist/constants/index.d.ts.map +1 -1
- package/packages/core/dist/constants/index.js +12 -0
- package/packages/core/dist/constants/index.js.map +1 -1
- package/packages/core/dist/core/dependency-resolver/index.d.ts +2 -10
- package/packages/core/dist/core/dependency-resolver/index.d.ts.map +1 -1
- package/packages/core/dist/core/dependency-resolver/index.js +3 -14
- package/packages/core/dist/core/dependency-resolver/index.js.map +1 -1
- package/packages/core/dist/core/install/base-detector.d.ts +2 -1
- package/packages/core/dist/core/install/base-detector.d.ts.map +1 -1
- package/packages/core/dist/core/install/base-detector.js +54 -1
- package/packages/core/dist/core/install/base-detector.js.map +1 -1
- package/packages/core/dist/core/install/conflicts/file-conflict-resolver.d.ts +7 -5
- package/packages/core/dist/core/install/conflicts/file-conflict-resolver.d.ts.map +1 -1
- package/packages/core/dist/core/install/conflicts/file-conflict-resolver.js +25 -9
- package/packages/core/dist/core/install/conflicts/file-conflict-resolver.js.map +1 -1
- package/packages/core/dist/core/install/flow-index-installer.d.ts +2 -1
- package/packages/core/dist/core/install/flow-index-installer.d.ts.map +1 -1
- package/packages/core/dist/core/install/flow-index-installer.js +19 -4
- package/packages/core/dist/core/install/flow-index-installer.js.map +1 -1
- package/packages/core/dist/core/install/input-classifier-base.js +3 -3
- package/packages/core/dist/core/install/input-classifier-base.js.map +1 -1
- package/packages/core/dist/core/install/install-reporting.d.ts.map +1 -1
- package/packages/core/dist/core/install/install-reporting.js +7 -9
- package/packages/core/dist/core/install/install-reporting.js.map +1 -1
- package/packages/core/dist/core/install/list-handler.d.ts.map +1 -1
- package/packages/core/dist/core/install/list-handler.js +3 -0
- package/packages/core/dist/core/install/list-handler.js.map +1 -1
- package/packages/core/dist/core/install/marketplace-handler.d.ts.map +1 -1
- package/packages/core/dist/core/install/marketplace-handler.js.map +1 -1
- package/packages/core/dist/core/install/operations/conflict-handler.d.ts +2 -1
- package/packages/core/dist/core/install/operations/conflict-handler.d.ts.map +1 -1
- package/packages/core/dist/core/install/operations/conflict-handler.js +2 -2
- package/packages/core/dist/core/install/operations/conflict-handler.js.map +1 -1
- package/packages/core/dist/core/install/operations/installation-executor.d.ts +3 -0
- package/packages/core/dist/core/install/operations/installation-executor.d.ts.map +1 -1
- package/packages/core/dist/core/install/operations/installation-executor.js +39 -22
- package/packages/core/dist/core/install/operations/installation-executor.js.map +1 -1
- package/packages/core/dist/core/install/orchestrator/orchestrator.d.ts +7 -3
- package/packages/core/dist/core/install/orchestrator/orchestrator.d.ts.map +1 -1
- package/packages/core/dist/core/install/orchestrator/orchestrator.js +193 -93
- package/packages/core/dist/core/install/orchestrator/orchestrator.js.map +1 -1
- package/packages/core/dist/core/install/orchestrator/strategies/git-strategy.d.ts +1 -0
- package/packages/core/dist/core/install/orchestrator/strategies/git-strategy.d.ts.map +1 -1
- package/packages/core/dist/core/install/orchestrator/strategies/git-strategy.js +11 -24
- package/packages/core/dist/core/install/orchestrator/strategies/git-strategy.js.map +1 -1
- package/packages/core/dist/core/install/orchestrator/strategies/path-strategy.d.ts +2 -0
- package/packages/core/dist/core/install/orchestrator/strategies/path-strategy.d.ts.map +1 -1
- package/packages/core/dist/core/install/orchestrator/strategies/path-strategy.js +14 -14
- package/packages/core/dist/core/install/orchestrator/strategies/path-strategy.js.map +1 -1
- package/packages/core/dist/core/install/orchestrator/strategies/registry-strategy.d.ts +7 -0
- package/packages/core/dist/core/install/orchestrator/strategies/registry-strategy.d.ts.map +1 -1
- package/packages/core/dist/core/install/orchestrator/strategies/registry-strategy.js +28 -0
- package/packages/core/dist/core/install/orchestrator/strategies/registry-strategy.js.map +1 -1
- package/packages/core/dist/core/install/orchestrator/types.d.ts +2 -0
- package/packages/core/dist/core/install/orchestrator/types.d.ts.map +1 -1
- package/packages/core/dist/core/install/path-package-loader.d.ts.map +1 -1
- package/packages/core/dist/core/install/path-package-loader.js +20 -1
- package/packages/core/dist/core/install/path-package-loader.js.map +1 -1
- package/packages/core/dist/core/install/platform-resolution.d.ts +3 -0
- package/packages/core/dist/core/install/platform-resolution.d.ts.map +1 -1
- package/packages/core/dist/core/install/platform-resolution.js +5 -2
- package/packages/core/dist/core/install/platform-resolution.js.map +1 -1
- package/packages/core/dist/core/install/preprocessing/context-population.d.ts +18 -0
- package/packages/core/dist/core/install/preprocessing/context-population.d.ts.map +1 -0
- package/packages/core/dist/core/install/preprocessing/context-population.js +36 -0
- package/packages/core/dist/core/install/preprocessing/context-population.js.map +1 -0
- package/packages/core/dist/core/install/preprocessing/convenience-preprocessor.d.ts +23 -0
- package/packages/core/dist/core/install/preprocessing/convenience-preprocessor.d.ts.map +1 -1
- package/packages/core/dist/core/install/preprocessing/convenience-preprocessor.js +44 -0
- package/packages/core/dist/core/install/preprocessing/convenience-preprocessor.js.map +1 -1
- package/packages/core/dist/core/install/sources/git-source.d.ts.map +1 -1
- package/packages/core/dist/core/install/sources/git-source.js +67 -4
- package/packages/core/dist/core/install/sources/git-source.js.map +1 -1
- package/packages/core/dist/core/install/sources/path-source.d.ts.map +1 -1
- package/packages/core/dist/core/install/sources/path-source.js +8 -0
- package/packages/core/dist/core/install/sources/path-source.js.map +1 -1
- package/packages/core/dist/core/install/strategies/flow-based-strategy.d.ts.map +1 -1
- package/packages/core/dist/core/install/strategies/flow-based-strategy.js +12 -5
- package/packages/core/dist/core/install/strategies/flow-based-strategy.js.map +1 -1
- package/packages/core/dist/core/install/strategies/types.d.ts +11 -1
- package/packages/core/dist/core/install/strategies/types.d.ts.map +1 -1
- package/packages/core/dist/core/install/unified/context-builders.d.ts +5 -0
- package/packages/core/dist/core/install/unified/context-builders.d.ts.map +1 -1
- package/packages/core/dist/core/install/unified/context-builders.js +12 -0
- package/packages/core/dist/core/install/unified/context-builders.js.map +1 -1
- package/packages/core/dist/core/install/unified/context-helpers.d.ts +0 -4
- package/packages/core/dist/core/install/unified/context-helpers.d.ts.map +1 -1
- package/packages/core/dist/core/install/unified/context-helpers.js +0 -24
- package/packages/core/dist/core/install/unified/context-helpers.js.map +1 -1
- package/packages/core/dist/core/install/unified/index.d.ts +1 -1
- package/packages/core/dist/core/install/unified/index.d.ts.map +1 -1
- package/packages/core/dist/core/install/unified/index.js +1 -1
- package/packages/core/dist/core/install/unified/index.js.map +1 -1
- package/packages/core/dist/core/install/unified/multi-context-pipeline.d.ts +6 -0
- package/packages/core/dist/core/install/unified/multi-context-pipeline.d.ts.map +1 -1
- package/packages/core/dist/core/install/unified/multi-context-pipeline.js +11 -4
- package/packages/core/dist/core/install/unified/multi-context-pipeline.js.map +1 -1
- package/packages/core/dist/core/install/unified/phases/conflicts.d.ts.map +1 -1
- package/packages/core/dist/core/install/unified/phases/conflicts.js +1 -1
- package/packages/core/dist/core/install/unified/phases/conflicts.js.map +1 -1
- package/packages/core/dist/core/install/unified/phases/execute.d.ts.map +1 -1
- package/packages/core/dist/core/install/unified/phases/execute.js +5 -5
- package/packages/core/dist/core/install/unified/phases/execute.js.map +1 -1
- package/packages/core/dist/core/install/unified/phases/load-package.js +3 -3
- package/packages/core/dist/core/install/unified/phases/load-package.js.map +1 -1
- package/packages/core/dist/core/install/unified/phases/report.js +1 -1
- package/packages/core/dist/core/install/unified/phases/report.js.map +1 -1
- package/packages/core/dist/core/install/unified/pipeline.d.ts.map +1 -1
- package/packages/core/dist/core/install/unified/pipeline.js +7 -10
- package/packages/core/dist/core/install/unified/pipeline.js.map +1 -1
- package/packages/core/dist/core/install/wave-resolver/content-root-cache.d.ts +24 -0
- package/packages/core/dist/core/install/wave-resolver/content-root-cache.d.ts.map +1 -0
- package/packages/core/dist/core/install/wave-resolver/content-root-cache.js +71 -0
- package/packages/core/dist/core/install/wave-resolver/content-root-cache.js.map +1 -0
- package/packages/core/dist/core/install/wave-resolver/context-builder.d.ts +39 -0
- package/packages/core/dist/core/install/wave-resolver/context-builder.d.ts.map +1 -0
- package/packages/core/dist/core/install/wave-resolver/context-builder.js +148 -0
- package/packages/core/dist/core/install/wave-resolver/context-builder.js.map +1 -0
- package/packages/core/dist/core/install/wave-resolver/fetcher.d.ts +49 -0
- package/packages/core/dist/core/install/wave-resolver/fetcher.d.ts.map +1 -0
- package/packages/core/dist/core/install/wave-resolver/fetcher.js +221 -0
- package/packages/core/dist/core/install/wave-resolver/fetcher.js.map +1 -0
- package/packages/core/dist/core/install/wave-resolver/index-updater.d.ts +23 -0
- package/packages/core/dist/core/install/wave-resolver/index-updater.d.ts.map +1 -0
- package/packages/core/dist/core/install/wave-resolver/index-updater.js +87 -0
- package/packages/core/dist/core/install/wave-resolver/index-updater.js.map +1 -0
- package/packages/core/dist/core/install/wave-resolver/index-write-collector.d.ts +101 -0
- package/packages/core/dist/core/install/wave-resolver/index-write-collector.d.ts.map +1 -0
- package/packages/core/dist/core/install/wave-resolver/index-write-collector.js +194 -0
- package/packages/core/dist/core/install/wave-resolver/index-write-collector.js.map +1 -0
- package/packages/core/dist/core/install/wave-resolver/index.d.ts +17 -0
- package/packages/core/dist/core/install/wave-resolver/index.d.ts.map +1 -0
- package/packages/core/dist/core/install/wave-resolver/index.js +16 -0
- package/packages/core/dist/core/install/wave-resolver/index.js.map +1 -0
- package/packages/core/dist/core/install/wave-resolver/manifest-reader.d.ts +34 -0
- package/packages/core/dist/core/install/wave-resolver/manifest-reader.d.ts.map +1 -0
- package/packages/core/dist/core/install/wave-resolver/manifest-reader.js +112 -0
- package/packages/core/dist/core/install/wave-resolver/manifest-reader.js.map +1 -0
- package/packages/core/dist/core/install/wave-resolver/types.d.ts +210 -0
- package/packages/core/dist/core/install/wave-resolver/types.d.ts.map +1 -0
- package/packages/core/dist/core/install/wave-resolver/types.js +6 -0
- package/packages/core/dist/core/install/wave-resolver/types.js.map +1 -0
- package/packages/core/dist/core/install/wave-resolver/version-solver.d.ts +65 -0
- package/packages/core/dist/core/install/wave-resolver/version-solver.d.ts.map +1 -0
- package/packages/core/dist/core/install/wave-resolver/version-solver.js +166 -0
- package/packages/core/dist/core/install/wave-resolver/version-solver.js.map +1 -0
- package/packages/core/dist/core/install/wave-resolver/wave-engine.d.ts +16 -0
- package/packages/core/dist/core/install/wave-resolver/wave-engine.d.ts.map +1 -0
- package/packages/core/dist/core/install/wave-resolver/wave-engine.js +337 -0
- package/packages/core/dist/core/install/wave-resolver/wave-engine.js.map +1 -0
- package/packages/core/dist/core/install/wave-resolver/wave-installer.d.ts +50 -0
- package/packages/core/dist/core/install/wave-resolver/wave-installer.d.ts.map +1 -0
- package/packages/core/dist/core/install/wave-resolver/wave-installer.js +246 -0
- package/packages/core/dist/core/install/wave-resolver/wave-installer.js.map +1 -0
- package/packages/core/dist/core/ports/buffered-output.d.ts +36 -0
- package/packages/core/dist/core/ports/buffered-output.d.ts.map +1 -0
- package/packages/core/dist/core/ports/buffered-output.js +89 -0
- package/packages/core/dist/core/ports/buffered-output.js.map +1 -0
- package/packages/core/dist/core/ports/resolve.d.ts +0 -13
- package/packages/core/dist/core/ports/resolve.d.ts.map +1 -1
- package/packages/core/dist/core/ports/resolve.js +0 -28
- package/packages/core/dist/core/ports/resolve.js.map +1 -1
- package/packages/core/dist/core/remove/removal-confirmation.d.ts +4 -1
- package/packages/core/dist/core/remove/removal-confirmation.d.ts.map +1 -1
- package/packages/core/dist/core/remove/removal-confirmation.js +5 -4
- package/packages/core/dist/core/remove/removal-confirmation.js.map +1 -1
- package/packages/core/dist/core/remove/remove-from-source-pipeline.d.ts.map +1 -1
- package/packages/core/dist/core/remove/remove-from-source-pipeline.js +1 -10
- package/packages/core/dist/core/remove/remove-from-source-pipeline.js.map +1 -1
- package/packages/core/dist/core/uninstall/uninstall-executor.js +1 -1
- package/packages/core/dist/core/uninstall/uninstall-executor.js.map +1 -1
- package/packages/core/dist/core/uninstall/uninstall-reporter.d.ts +2 -2
- package/packages/core/dist/core/uninstall/uninstall-reporter.d.ts.map +1 -1
- package/packages/core/dist/core/uninstall/uninstall-reporter.js +4 -4
- package/packages/core/dist/core/uninstall/uninstall-reporter.js.map +1 -1
- package/packages/core/dist/index.d.ts +1 -1
- package/packages/core/dist/index.d.ts.map +1 -1
- package/packages/core/dist/types/execution-context.d.ts +40 -10
- package/packages/core/dist/types/execution-context.d.ts.map +1 -1
- package/packages/core/dist/utils/concurrency-pool.d.ts +34 -0
- package/packages/core/dist/utils/concurrency-pool.d.ts.map +1 -0
- package/packages/core/dist/utils/concurrency-pool.js +58 -0
- package/packages/core/dist/utils/concurrency-pool.js.map +1 -0
- package/packages/core/dist/utils/plugin-naming.d.ts +11 -3
- package/packages/core/dist/utils/plugin-naming.d.ts.map +1 -1
- package/packages/core/dist/utils/plugin-naming.js +27 -7
- package/packages/core/dist/utils/plugin-naming.js.map +1 -1
- package/plans/wave-resolver.md +254 -0
- package/.claude/agents/essentials/code-simplifier.md +0 -52
- package/.claude/commands/essentials/cleanup.md +0 -1
- package/.claude/commands/essentials/review.md +0 -8
- package/.claude/commands/git/commit.md +0 -5
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../core/src/utils/hash-utils.ts", "../../core/src/core/flows/flow-executor.ts", "../../core/src/utils/root-file-merger.ts", "../../core/src/core/glob-target-mapping.ts", "../../core/src/core/platform-yaml-merge.ts", "../../core/src/core/flows/flow-key-mapper.ts", "../../core/src/core/flows/source-resolver.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Hash Utilities Module\n * Utility functions for content hashing and comparison\n */\n\nimport { xxhash3 } from 'hash-wasm';\nimport { logger } from './logger.js';\n\n/**\n * Calculate hash of file content using xxhash3\n */\nexport async function calculateFileHash(content: string): Promise<string> {\n try {\n return await xxhash3(content);\n } catch (error) {\n logger.warn(`Failed to calculate hash for content: ${error}`);\n // Return a fallback hash based on content length and first/last chars\n const fallback = `${content.length}-${content.charAt(0)}-${content.charAt(content.length - 1)}`;\n return fallback;\n }\n}\n\n/**\n * Calculate hash of file content synchronously (for simple cases)\n * Note: This is less performant but useful when async operations aren't needed\n */\nexport function calculateFileHashSync(content: string): string {\n try {\n // For sync operations, we'll use a simple hash based on content characteristics\n // In a real implementation, you might use a sync hash library\n const length = content.length;\n const firstChar = content.charCodeAt(0) || 0;\n const lastChar = content.charCodeAt(content.length - 1) || 0;\n\n // Simple hash combining length and character codes\n return `${length}-${firstChar}-${lastChar}`;\n } catch (error) {\n logger.warn(`Failed to calculate sync hash for content: ${error}`);\n return `fallback-${content.length}`;\n }\n}\n", "/**\n * Flow Executor\n * \n * Executes flows through a multi-stage pipeline:\n * 1. Load source file and parse format\n * 2. Extract JSONPath (if specified)\n * 3. Pick/omit keys\n * 4. Map keys (with transforms)\n * 5. Apply pipe transforms\n * 6. Embed in target structure\n * 7. Merge with existing target (priority-based)\n * 8. Write to target file\n */\n\nimport { promises as fs } from 'fs';\nimport fsSync from 'fs';\nimport path from 'path';\nimport yaml from 'js-yaml';\nimport * as TOML from 'smol-toml';\nimport { parse as parseJsonc } from 'jsonc-parser';\nimport { JSONPath } from 'jsonpath-plus';\nimport { minimatch } from 'minimatch';\nimport * as fsUtils from '../../utils/fs.js';\nimport { mergePackageContentIntoRootFile } from '../../utils/root-file-merger.js';\nimport { resolveRecursiveGlobTargetRelativePath } from '../glob-target-mapping.js';\nimport type {\n Flow,\n FlowContext,\n FlowResult,\n FlowExecutor,\n FlowConflict,\n ValidationResult,\n ValidationError,\n ParsedContent,\n FileFormat,\n MultiTargetFlows,\n SwitchExpression,\n} from '../../types/flows.js';\nimport { logger } from '../../utils/logger.js';\nimport { \n defaultTransformRegistry, \n TransformRegistry,\n} from './flow-transforms.js';\nimport { mergeInlinePlatformOverride } from '../platform-yaml-merge.js';\nimport { \n getNestedValue,\n setNestedValue,\n deleteNestedValue\n} from './flow-key-mapper.js';\nimport { extractAllKeys } from './flow-key-extractor.js';\nimport { applyMapPipeline, createMapContext, validateMapPipeline, splitMapPipeline } from './map-pipeline/index.js';\nimport { SourcePatternResolver } from './source-resolver.js';\nimport { resolveSwitchExpression, validateSwitchExpression } from './switch-resolver.js';\nimport { smartEquals, smartNotEquals } from '../../utils/path-comparison.js';\nimport { stripPlatformSuffixFromFilename } from './platform-suffix-handler.js';\nimport { parseMarkdownDocument, serializeMarkdownDocument } from './markdown.js';\n\n/**\n * Default flow executor implementation\n */\nexport class DefaultFlowExecutor implements FlowExecutor {\n private transformRegistry: TransformRegistry;\n private sourceResolver: SourcePatternResolver;\n\n constructor(transformRegistry?: TransformRegistry) {\n this.transformRegistry = transformRegistry || defaultTransformRegistry;\n this.sourceResolver = new SourcePatternResolver();\n }\n\n /**\n * Execute a single flow (now supports glob patterns and switch expressions)\n */\n async executeFlow(flow: Flow, context: FlowContext): Promise<FlowResult> {\n const startTime = Date.now();\n\n try {\n // Resolve switch expressions in 'from' field\n let resolvedFrom = flow.from;\n if (this.isSwitchExpression(flow.from)) {\n try {\n resolvedFrom = resolveSwitchExpression(flow.from as any as SwitchExpression, context);\n } catch (error) {\n return {\n source: '<switch expression>',\n target: this.normalizeToPattern(flow.to),\n success: false,\n transformed: false,\n error: error instanceof Error ? error : new Error(String(error)),\n executionTime: Date.now() - startTime,\n };\n }\n }\n\n // Resolve switch expressions in 'to' field\n let resolvedTo = flow.to;\n if (this.isSwitchExpression(flow.to)) {\n try {\n resolvedTo = resolveSwitchExpression(flow.to as SwitchExpression, context);\n } catch (error) {\n return {\n source: this.normalizeFromPattern(resolvedFrom),\n target: '<switch expression>',\n success: false,\n transformed: false,\n error: error instanceof Error ? error : new Error(String(error)),\n executionTime: Date.now() - startTime,\n };\n }\n }\n\n // Check if this is a multi-target flow\n if (typeof resolvedTo !== 'string') {\n const results = await this.executeMultiTarget({ ...flow, from: resolvedFrom, to: resolvedTo }, context);\n // Aggregate results\n return this.aggregateResults(results, startTime);\n }\n\n // Validate flow (with resolved 'from' and 'to')\n const validation = this.validateFlow({ ...flow, from: resolvedFrom, to: resolvedTo });\n if (!validation.valid) {\n return {\n source: this.normalizeFromPattern(resolvedFrom),\n target: resolvedTo as string,\n success: false,\n transformed: false,\n error: new Error(`Invalid flow: ${validation.errors.map(e => e.message).join(', ')}`),\n executionTime: Date.now() - startTime,\n };\n }\n\n // Evaluate conditions\n if (flow.when && !this.evaluateCondition(flow.when, context)) {\n const normalized = this.normalizeFromPattern(resolvedFrom);\n logger.debug(`Flow skipped due to condition: ${normalized} -> ${resolvedTo}`);\n return {\n source: normalized,\n target: resolvedTo as string,\n success: true,\n transformed: false,\n warnings: ['Flow skipped due to condition'],\n executionTime: Date.now() - startTime,\n };\n }\n\n // Resolve source paths (may return multiple files for glob patterns)\n const resolution = await this.resolveSourcePattern(resolvedFrom, context);\n const sourcePaths = resolution.paths;\n const resolutionWarnings = resolution.warnings;\n\n // If no files matched, return success with no files processed\n if (sourcePaths.length === 0) {\n return {\n source: this.normalizeFromPattern(resolvedFrom),\n target: resolvedTo as string,\n success: true,\n transformed: false,\n warnings: resolutionWarnings.length > 0 ? resolutionWarnings : ['No files matched pattern'],\n executionTime: Date.now() - startTime,\n };\n }\n\n // Execute pipeline for each matched file\n const results: FlowResult[] = [];\n const firstFromPattern = this.getFirstPattern(resolvedFrom);\n \n for (const sourcePath of sourcePaths) {\n const targetPath = this.resolveTargetFromGlob(sourcePath, firstFromPattern, resolvedTo as string, context);\n const result = await this.executePipeline(flow, sourcePath, targetPath, context);\n results.push({\n ...result,\n executionTime: Date.now() - startTime,\n });\n }\n \n // Add resolution warnings to first result if any\n if (resolutionWarnings.length > 0 && results.length > 0) {\n results[0].warnings = [\n ...(results[0].warnings || []),\n ...resolutionWarnings,\n ];\n }\n\n // If single file, return single result\n if (results.length === 1) {\n return results[0];\n }\n\n // Aggregate multiple results\n return this.aggregateResults(results, startTime);\n } catch (error) {\n return {\n source: this.isSwitchExpression(flow.from) ? '<switch>' : this.normalizeFromPattern(flow.from),\n target: this.normalizeToPattern(flow.to),\n success: false,\n transformed: false,\n error: error instanceof Error ? error : new Error(String(error)),\n executionTime: Date.now() - startTime,\n };\n }\n }\n\n /**\n * Execute multiple flows\n */\n async executeFlows(flows: Flow[], context: FlowContext): Promise<FlowResult[]> {\n const results: FlowResult[] = [];\n\n for (const flow of flows) {\n const result = await this.executeFlow(flow, context);\n results.push(result);\n }\n\n return results;\n }\n\n /**\n * Execute a multi-target flow\n */\n async executeMultiTarget(flow: Flow, context: FlowContext): Promise<FlowResult[]> {\n if (typeof flow.to === 'string') {\n throw new Error('Flow is not a multi-target flow');\n }\n\n const multiTarget = flow.to as MultiTargetFlows;\n const normalizedFrom = this.normalizeFromPattern(flow.from);\n \n // Resolve source paths (may be multiple files with glob)\n const resolution = await this.resolveSourcePattern(flow.from, context);\n const sourcePaths = resolution.paths;\n\n // If no files matched\n if (sourcePaths.length === 0) {\n return Object.keys(multiTarget).map(target => ({\n source: normalizedFrom,\n target,\n success: true,\n transformed: false,\n warnings: resolution.warnings.length > 0 ? resolution.warnings : ['No files matched pattern'],\n }));\n }\n\n // Execute each source file\n const allResults: FlowResult[] = [];\n const firstFromPattern = this.getFirstPattern(flow.from);\n\n for (const sourcePath of sourcePaths) {\n // Load and parse source once\n const sourceContent = await this.loadSourceFile(sourcePath, context);\n\n // Execute each target\n for (const [targetPath, targetFlow] of Object.entries(multiTarget)) {\n const startTime = Date.now();\n\n try {\n // Merge target flow with base flow\n const mergedFlow: Flow = {\n ...flow,\n ...targetFlow,\n from: flow.from,\n to: targetPath,\n };\n\n // Evaluate conditions\n if (mergedFlow.when && !this.evaluateCondition(mergedFlow.when, context)) {\n logger.debug(`Multi-target flow skipped due to condition: ${normalizedFrom} -> ${targetPath}`);\n allResults.push({\n source: normalizedFrom,\n target: targetPath,\n success: true,\n transformed: false,\n warnings: ['Flow skipped due to condition'],\n executionTime: Date.now() - startTime,\n });\n continue;\n }\n\n const resolvedTargetPath = this.resolveTargetFromGlob(sourcePath, firstFromPattern, targetPath, context);\n\n // Execute pipeline with pre-loaded content\n const result = await this.executePipelineWithContent(\n mergedFlow,\n sourceContent,\n sourcePath,\n resolvedTargetPath,\n context\n );\n\n allResults.push({\n ...result,\n executionTime: Date.now() - startTime,\n });\n } catch (error) {\n allResults.push({\n source: normalizedFrom,\n target: targetPath,\n success: false,\n transformed: false,\n error: error instanceof Error ? error : new Error(String(error)),\n executionTime: Date.now() - startTime,\n });\n }\n }\n }\n\n return allResults;\n }\n\n /**\n * Validate a flow configuration\n */\n validateFlow(flow: Flow): ValidationResult {\n const errors: ValidationError[] = [];\n\n // Check required fields\n if (!flow.from) {\n errors.push({ message: 'Flow missing required field \"from\"', code: 'MISSING_FROM' });\n }\n\n if (!flow.to) {\n errors.push({ message: 'Flow missing required field \"to\"', code: 'MISSING_TO' });\n }\n\n // Validate switch expression in 'to' field\n if (flow.to && this.isSwitchExpression(flow.to)) {\n const switchValidation = validateSwitchExpression(flow.to as SwitchExpression);\n if (!switchValidation.valid) {\n for (const error of switchValidation.errors) {\n errors.push({\n message: error,\n code: 'INVALID_SWITCH_EXPRESSION',\n });\n }\n }\n }\n\n // Validate pick/omit\n if (flow.pick && flow.omit) {\n errors.push({ message: 'Flow cannot have both \"pick\" and \"omit\"', code: 'CONFLICTING_FILTERS' });\n }\n\n // Validate merge strategy\n if (flow.merge && !['deep', 'shallow', 'replace', 'composite'].includes(flow.merge)) {\n errors.push({\n message: `Invalid merge strategy: ${flow.merge}. Must be one of: deep, shallow, replace, composite`,\n code: 'INVALID_MERGE',\n });\n }\n\n // Validate JSONPath expression\n if (flow.path) {\n try {\n // Try to validate JSONPath syntax\n JSONPath({ path: flow.path, json: {} });\n } catch (error) {\n errors.push({\n message: `Invalid JSONPath expression: ${flow.path}`,\n code: 'INVALID_JSONPATH',\n });\n }\n }\n\n // Validate map pipeline\n if (flow.map) {\n const mapPipelineValidation = validateMapPipeline(flow.map);\n if (!mapPipelineValidation.valid) {\n for (const error of mapPipelineValidation.errors) {\n errors.push({\n message: error,\n code: 'INVALID_MAP_PIPELINE',\n });\n }\n }\n }\n\n return {\n valid: errors.length === 0,\n errors,\n warnings: [],\n };\n }\n\n /**\n * Check if a value is a switch expression\n */\n private isSwitchExpression(value: any): boolean {\n return (\n typeof value === 'object' &&\n value !== null &&\n '$switch' in value\n );\n }\n\n /**\n * Execute the transformation pipeline\n */\n private async executePipeline(\n flow: Flow,\n sourcePath: string,\n targetPath: string,\n context: FlowContext\n ): Promise<Omit<FlowResult, 'executionTime'>> {\n // Check if we can skip parsing for pass-through flows\n if (!this.needsParsing(flow, sourcePath, targetPath, context)) {\n return await this.executePassThroughCopy(flow, sourcePath, targetPath, context);\n }\n\n // Step 1: Load source file with parsing\n const sourceContent = await this.loadSourceFile(sourcePath, context);\n\n return this.executePipelineWithContent(flow, sourceContent, sourcePath, targetPath, context);\n }\n\n /**\n * Execute pipeline with pre-loaded content (for multi-target flows)\n */\n private async executePipelineWithContent(\n flow: Flow,\n sourceContent: ParsedContent,\n sourcePath: string,\n targetPath: string,\n context: FlowContext\n ): Promise<Omit<FlowResult, 'executionTime'>> {\n const warnings: string[] = [];\n const conflicts: FlowConflict[] = [];\n\n let data = sourceContent.data;\n let transformed = false;\n\n try {\n // Step 2: Extract JSONPath (if specified)\n if (flow.path) {\n data = this.extractJSONPath(data, flow.path);\n transformed = true;\n }\n\n // Step 3: Pick/omit keys\n if (flow.pick) {\n data = this.pickKeys(data, flow.pick);\n transformed = true;\n } else if (flow.omit) {\n data = this.omitKeys(data, flow.omit);\n transformed = true;\n }\n\n // Step 4: Apply map pipeline\n // Split into schema operations and pipe operations\n // Schema ops are applied BEFORE merge, pipe ops are applied AFTER merge\n let contributedKeys: string[] | undefined;\n let schemaOps: any[] = [];\n let pipeOps: any[] = [];\n \n if (flow.map) {\n const split = splitMapPipeline(flow.map);\n schemaOps = split.schemaOps;\n pipeOps = split.pipeOps;\n \n // Apply schema operations first (before merge)\n if (schemaOps.length > 0) {\n const mapContext = createMapContext({\n filename: path.basename(sourcePath, path.extname(sourcePath)),\n dirname: path.basename(path.dirname(sourcePath)),\n path: path.relative(context.packageRoot, sourcePath),\n ext: path.extname(sourcePath),\n });\n \n // For markdown files, apply to frontmatter\n if (data && typeof data === 'object' && 'frontmatter' in data) {\n data.frontmatter = applyMapPipeline(\n data.frontmatter, \n schemaOps, \n mapContext,\n this.transformRegistry\n );\n } else {\n // Apply to entire document\n data = applyMapPipeline(\n data, \n schemaOps, \n mapContext,\n this.transformRegistry\n );\n }\n transformed = true;\n }\n }\n \n // Track keys AFTER schema transforms but BEFORE merge and pipe transforms\n // This represents the structured data this package contributes\n const shouldTrackKeys =\n Boolean(flow.merge) &&\n flow.merge !== 'replace' &&\n flow.merge !== 'composite';\n \n if (shouldTrackKeys && typeof data === 'object' && data !== null) {\n // Extract from frontmatter if it's a markdown file\n const dataToExtract = (data && 'frontmatter' in data) ? data.frontmatter : data;\n if (typeof dataToExtract === 'object' && dataToExtract !== null) {\n contributedKeys = extractAllKeys(dataToExtract);\n }\n }\n\n const targetExists = await fsUtils.exists(targetPath);\n\n // Step 6: Embed in target structure\n if (flow.embed) {\n data = this.embedContent(data, flow.embed);\n transformed = true;\n }\n\n // Step 7: Merge with existing target (if needed)\n if (targetExists) {\n const targetContent = await this.loadSourceFile(targetPath, context);\n \n // Special handling for composite merge - works with raw text\n if (flow.merge === 'composite') {\n // Use raw content for composite merge\n const sourceRaw = sourceContent.raw;\n const targetRaw = targetContent.raw;\n data = mergePackageContentIntoRootFile(targetRaw, context.packageName, sourceRaw);\n transformed = true;\n } else {\n // Normal merge for other strategies\n const mergeResult = this.mergeContent(\n data,\n targetContent.data,\n flow.merge || 'replace',\n context\n );\n data = mergeResult.data;\n conflicts.push(...mergeResult.conflicts);\n if (mergeResult.conflicts.length > 0) {\n transformed = true;\n }\n }\n }\n\n // Step 7.5: Apply pipe operations AFTER merge (format conversions)\n // These operations may convert the data to a string format (e.g., json-to-toml)\n if (pipeOps.length > 0) {\n const mapContext = createMapContext({\n filename: path.basename(sourcePath, path.extname(sourcePath)),\n dirname: path.basename(path.dirname(sourcePath)),\n path: path.relative(context.packageRoot, sourcePath),\n ext: path.extname(sourcePath),\n });\n \n // For markdown files, apply to frontmatter\n if (data && typeof data === 'object' && 'frontmatter' in data) {\n data.frontmatter = applyMapPipeline(\n data.frontmatter, \n pipeOps, \n mapContext,\n this.transformRegistry\n );\n } else {\n // Apply to entire document\n data = applyMapPipeline(\n data, \n pipeOps, \n mapContext,\n this.transformRegistry\n );\n }\n transformed = true;\n }\n\n // Step 8: Write to target file\n if (!context.dryRun) {\n await this.writeTargetFile(targetPath, data, sourceContent.format);\n }\n\n return {\n source: sourcePath,\n target: targetPath,\n success: true,\n transformed,\n keys: contributedKeys,\n merge: flow.merge,\n warnings: warnings.length > 0 ? warnings : undefined,\n conflicts: conflicts.length > 0 ? conflicts : undefined,\n pipeline: this.getPipeline(flow),\n };\n } catch (error) {\n return {\n source: sourcePath,\n target: targetPath,\n success: false,\n transformed,\n error: error instanceof Error ? error : new Error(String(error)),\n warnings: warnings.length > 0 ? warnings : undefined,\n };\n }\n }\n\n /**\n * Load and parse source file\n */\n async loadSourceFile(filePath: string, context?: FlowContext): Promise<ParsedContent> {\n let raw = await fsUtils.readTextFile(filePath);\n const format = this.detectFormat(filePath, raw);\n \n // Apply platform-specific frontmatter overrides for markdown files during install\n if ((format === 'markdown' || format === 'md') && context?.platform && context?.direction === 'install') {\n raw = mergeInlinePlatformOverride(raw, context.platform, context.workspaceRoot);\n }\n \n const data = this.parseSourceContent(raw, format);\n\n return { data, format, raw };\n }\n\n /**\n * Write transformed content to target file\n */\n async writeTargetFile(filePath: string, content: any, sourceFormat: FileFormat): Promise<void> {\n await fsUtils.ensureDir(path.dirname(filePath));\n // Detect target format from file extension\n const targetFormat = this.detectFormat(filePath, '');\n\n const serialized = this.serializeTargetContent(content, targetFormat);\n await fsUtils.writeTextFile(filePath, serialized);\n }\n\n /**\n * Determine if parsing is needed for this flow\n * Returns false for simple pass-through copies with no transformations\n */\n private needsParsing(flow: Flow, sourcePath: string, targetPath: string, context: FlowContext): boolean {\n // Check for content manipulation operations\n if (flow.map || flow.pick || flow.omit || flow.path || flow.embed) {\n return true;\n }\n\n // Check for merge operations that need parsing\n if (flow.merge) {\n if (flow.merge === 'deep' || flow.merge === 'shallow') {\n return true;\n }\n // 'composite' and 'replace' don't need parsing\n }\n\n // Check for format conversion\n const sourceExt = path.extname(sourcePath).toLowerCase();\n const targetExt = path.extname(targetPath).toLowerCase();\n \n // If extensions differ and source is a structured format, need to parse for conversion\n if (sourceExt !== targetExt) {\n const structuredFormats = ['.json', '.jsonc', '.yaml', '.yml', '.toml'];\n if (structuredFormats.includes(sourceExt)) {\n return true;\n }\n }\n\n // Check for markdown with platform-specific frontmatter overrides\n if ((sourceExt === '.md' || sourceExt === '.mdc' || sourceExt === '.markdown') && \n context.platform && \n context.direction === 'install') {\n // Need to parse for frontmatter override merging\n return true;\n }\n\n // Simple pass-through - no parsing needed\n return false;\n }\n\n /**\n * Execute a pass-through copy without parsing\n * Used for simple file copies with no transformations\n */\n private async executePassThroughCopy(\n flow: Flow,\n sourcePath: string,\n targetPath: string,\n context: FlowContext\n ): Promise<Omit<FlowResult, 'executionTime'>> {\n const warnings: string[] = [];\n\n try {\n // Check if target exists and handle merge strategy\n const targetExists = await fsUtils.exists(targetPath);\n \n if (targetExists && flow.merge && flow.merge !== 'replace') {\n // If merge strategy other than replace, we need to parse after all\n // This is a safety check - needsParsing should have caught this\n logger.warn(`Pass-through copy attempted with merge strategy '${flow.merge}' - falling back to parsed pipeline`);\n const sourceContent = await this.loadSourceFile(sourcePath, context);\n return this.executePipelineWithContent(flow, sourceContent, sourcePath, targetPath, context);\n }\n\n // Simple byte copy\n if (!context.dryRun) {\n await fsUtils.ensureDir(path.dirname(targetPath));\n const content = await fs.readFile(sourcePath);\n await fs.writeFile(targetPath, content);\n }\n\n return {\n source: sourcePath,\n target: targetPath,\n success: true,\n transformed: false,\n warnings: warnings.length > 0 ? warnings : undefined,\n };\n } catch (error) {\n return {\n source: sourcePath,\n target: targetPath,\n success: false,\n transformed: false,\n error: error instanceof Error ? error : new Error(String(error)),\n warnings: warnings.length > 0 ? warnings : undefined,\n };\n }\n }\n\n /**\n * Parse source content based on format\n */\n parseSourceContent(content: string, format: FileFormat): any {\n // Handle empty content gracefully for structured formats\n if (!content.trim()) {\n switch (format) {\n case 'json':\n case 'jsonc':\n case 'yaml':\n case 'yml':\n case 'toml':\n return {};\n case 'markdown':\n case 'md':\n return { body: '' };\n case 'text':\n case 'txt':\n default:\n return content;\n }\n }\n\n try {\n switch (format) {\n case 'json':\n case 'jsonc':\n // Remove comments for JSONC\n const cleaned = content;\n if (format === 'jsonc') {\n const parsed = parseJsonc(cleaned);\n if (parsed === undefined) {\n throw new Error('jsonc-parser returned undefined');\n }\n return parsed;\n }\n return JSON.parse(cleaned);\n\n case 'yaml':\n case 'yml':\n return yaml.load(content);\n\n case 'toml':\n try {\n return TOML.parse(content);\n } catch (error) {\n throw new Error(`TOML parse error: ${error instanceof Error ? error.message : String(error)}`);\n }\n\n case 'markdown':\n case 'md':\n return this.parseMarkdown(content);\n\n case 'text':\n case 'txt':\n default:\n return content;\n }\n } catch (error) {\n throw new Error(`Failed to parse ${format} content: ${error instanceof Error ? error.message : String(error)}`);\n }\n }\n\n /**\n * Serialize content to target format\n */\n serializeTargetContent(content: any, format: FileFormat): string {\n try {\n switch (format) {\n case 'json':\n case 'jsonc':\n return JSON.stringify(content, null, 2);\n\n case 'yaml':\n case 'yml':\n return yaml.dump(content, { indent: 2, flowLevel: -1, lineWidth: -1 });\n\n case 'toml':\n // If a pipeline already produced TOML text (e.g. via domain transforms),\n // don't stringify again.\n if (typeof content === 'string') {\n return content;\n }\n try {\n // Serialize to TOML\n let toml = TOML.stringify(content);\n \n // Apply inline table formatting for Codex MCP configs\n if (content && typeof content === 'object' && content.mcp_servers) {\n toml = this.applyCodexTomlFormatting(toml);\n }\n \n return toml;\n } catch (error) {\n throw new Error(`TOML stringify error: ${error instanceof Error ? error.message : String(error)}`);\n }\n\n case 'markdown':\n case 'md':\n return this.serializeMarkdown(content);\n\n case 'text':\n case 'txt':\n default:\n return typeof content === 'string' ? content : JSON.stringify(content, null, 2);\n }\n } catch (error) {\n throw new Error(`Failed to serialize ${format} content: ${error instanceof Error ? error.message : String(error)}`);\n }\n }\n\n /**\n * Detect format from file extension or content\n */\n private detectFormat(filePath: string, content: string): FileFormat {\n const ext = path.extname(filePath).toLowerCase();\n\n const extMap: Record<string, FileFormat> = {\n '.json': 'json',\n '.jsonc': 'jsonc',\n '.yaml': 'yaml',\n '.yml': 'yml',\n '.toml': 'toml',\n '.md': 'markdown',\n '.mdc': 'markdown',\n '.markdown': 'markdown',\n '.txt': 'text',\n };\n\n if (extMap[ext]) {\n return extMap[ext];\n }\n\n // Try to detect from content\n if (content.trim().startsWith('{') || content.trim().startsWith('[')) {\n return content.includes('//') || content.includes('/*') ? 'jsonc' : 'json';\n }\n\n if (content.includes('---\\n') || content.includes('\\n---\\n')) {\n return 'markdown';\n }\n\n return 'text';\n }\n\n /**\n * Extract data using JSONPath\n */\n private extractJSONPath(data: any, jsonPath: string): any {\n try {\n const result = JSONPath({ path: jsonPath, json: data });\n return result.length === 1 ? result[0] : result;\n } catch (error) {\n throw new Error(`JSONPath extraction failed: ${error instanceof Error ? error.message : String(error)}`);\n }\n }\n\n /**\n * Pick specified keys\n */\n private pickKeys(data: any, keys: string[]): any {\n if (typeof data !== 'object' || data === null) {\n return data;\n }\n\n const result: any = Array.isArray(data) ? [] : {};\n\n for (const key of keys) {\n if (key.includes('.')) {\n // Handle nested keys\n this.setNestedValue(result, key, this.getNestedValue(data, key));\n } else if (key in data) {\n result[key] = data[key];\n }\n }\n\n return result;\n }\n\n /**\n * Omit specified keys\n */\n private omitKeys(data: any, keys: string[]): any {\n if (typeof data !== 'object' || data === null) {\n return data;\n }\n\n const result = Array.isArray(data) ? [...data] : { ...data };\n\n for (const key of keys) {\n if (key.includes('.')) {\n // Handle nested keys\n this.deleteNestedValue(result, key);\n } else {\n delete result[key];\n }\n }\n\n return result;\n }\n\n /**\n * Apply pipe transforms\n */\n private async applyPipeTransforms(data: any, transforms: string[], context: FlowContext): Promise<any> {\n let result = data;\n\n for (const transformSpec of transforms) {\n try {\n // Parse transform specification\n // Format: \"transform-name\" or \"transform-name(option1=value1,option2=value2)\"\n const { name, options } = this.parseTransformSpec(transformSpec);\n\n logger.debug(`Applying transform: ${name}`, options);\n\n // Execute transform\n result = this.transformRegistry.execute(name, result, options);\n } catch (error) {\n throw new Error(`Transform '${transformSpec}' failed: ${error instanceof Error ? error.message : String(error)}`);\n }\n }\n\n return result;\n }\n\n /**\n * Parse transform specification\n * Examples: \"trim\", \"number\", \"pick-keys(keys=[a,b,c])\"\n */\n private parseTransformSpec(spec: string): { name: string; options?: any } {\n const match = spec.match(/^([a-z-]+)(?:\\((.+)\\))?$/);\n if (!match) {\n throw new Error(`Invalid transform specification: ${spec}`);\n }\n\n const [, name, optionsStr] = match;\n\n if (!optionsStr) {\n return { name };\n }\n\n // Parse options (simple key=value format)\n const options: any = {};\n const pairs = optionsStr.split(',').map(s => s.trim());\n \n for (const pair of pairs) {\n const [key, value] = pair.split('=').map(s => s.trim());\n \n // Parse value type\n if (value.startsWith('[') && value.endsWith(']')) {\n // Array\n options[key] = value.slice(1, -1).split(',').map(s => s.trim());\n } else if (value === 'true' || value === 'false') {\n // Boolean\n options[key] = value === 'true';\n } else if (!isNaN(Number(value))) {\n // Number\n options[key] = Number(value);\n } else {\n // String\n options[key] = value;\n }\n }\n\n return { name, options };\n }\n\n /**\n * Embed content under a key\n */\n private embedContent(data: any, key: string): any {\n return { [key]: data };\n }\n\n /**\n * Merge content with priority-based conflict resolution\n */\n private mergeContent(\n source: any,\n target: any,\n strategy: string,\n context: FlowContext\n ): { data: any; conflicts: FlowConflict[] } {\n const conflicts: FlowConflict[] = [];\n\n let merged: any;\n\n switch (strategy) {\n case 'replace':\n merged = source;\n break;\n\n case 'shallow':\n merged = { ...target, ...source };\n break;\n\n case 'deep':\n merged = this.deepMerge(target, source, conflicts, context);\n break;\n\n case 'composite':\n // Composite merge is handled earlier in the pipeline (Step 7)\n // This case should not be reached\n merged = source;\n break;\n\n default:\n merged = source;\n }\n\n return { data: merged, conflicts };\n }\n\n /**\n * Deep merge two objects\n */\n private deepMerge(target: any, source: any, conflicts: FlowConflict[], context: FlowContext, keyPath: string = ''): any {\n if (typeof source !== 'object' || source === null) {\n return source;\n }\n\n if (typeof target !== 'object' || target === null) {\n return source;\n }\n\n if (Array.isArray(source) && Array.isArray(target)) {\n // Merge arrays\n return [...target, ...source];\n }\n\n const result = { ...target };\n\n for (const key of Object.keys(source)) {\n const currentPath = keyPath ? `${keyPath}.${key}` : key;\n\n if (!(key in target)) {\n result[key] = source[key];\n } else if (typeof source[key] === 'object' && typeof target[key] === 'object') {\n result[key] = this.deepMerge(target[key], source[key], conflicts, context, currentPath);\n } else if (source[key] !== target[key]) {\n // Conflict detected\n conflicts.push({\n path: currentPath,\n winner: context.packageName,\n losers: ['existing'],\n type: 'value',\n resolution: 'last-writer-wins',\n });\n result[key] = source[key];\n }\n }\n\n return result;\n }\n\n /**\n * Evaluate condition\n */\n private evaluateCondition(condition: any, context: FlowContext): boolean {\n if (condition.and) {\n return condition.and.every((c: any) => this.evaluateCondition(c, context));\n }\n\n if (condition.or) {\n return condition.or.some((c: any) => this.evaluateCondition(c, context));\n }\n\n if (condition.not) {\n return !this.evaluateCondition(condition.not, context);\n }\n\n if (condition.$eq) {\n const [left, right] = condition.$eq;\n const leftVal = this.resolveValue(left, context);\n const rightVal = this.resolveValue(right, context);\n return smartEquals(leftVal, rightVal);\n }\n\n if (condition.$ne) {\n const [left, right] = condition.$ne;\n const leftVal = this.resolveValue(left, context);\n const rightVal = this.resolveValue(right, context);\n return smartNotEquals(leftVal, rightVal);\n }\n\n if (condition.exists) {\n const testPath = path.join(context.workspaceRoot, condition.exists);\n // Use existsSync for synchronous condition evaluation\n return fsSync.existsSync(testPath);\n }\n\n if (condition.platform) {\n return context.platform === condition.platform;\n }\n\n return true;\n }\n\n /**\n * Resolve a value, handling $$variable references\n */\n private resolveValue(value: string, context: FlowContext): any {\n if (value.startsWith('$$')) {\n const varName = value.slice(2);\n return context.variables[varName];\n }\n return value;\n }\n\n\n\n /**\n * Resolve pattern with glob support and priority-based array matching\n * Returns resolved file paths (glob patterns return multiple files)\n */\n private async resolveSourcePattern(\n pattern: string | string[] | SwitchExpression,\n context: FlowContext\n ): Promise<{ paths: string[]; warnings: string[] }> {\n if (this.isSwitchExpression(pattern)) {\n throw new Error('Cannot resolve SwitchExpression - expression must be resolved first');\n }\n // Type narrowing: pattern is now string | string[]\n const narrowedPattern = pattern as string | string[];\n const result = await this.sourceResolver.resolve(narrowedPattern, {\n baseDir: context.packageRoot,\n logWarnings: true,\n });\n\n return {\n paths: result.paths,\n warnings: result.warnings,\n };\n }\n\n /**\n * Resolve target path from source path and patterns\n * Handles single-level (*) and recursive (**) globs\n * Strips platform suffixes from filenames (e.g. read-specs.claude.md -> read-specs.md)\n */\n private resolveTargetFromGlob(sourcePath: string, fromPattern: string, toPattern: string, context: FlowContext): string {\n // Get relative path from package root\n const relativePath = path.relative(context.packageRoot, sourcePath);\n \n // If 'to' pattern has glob, map the structure\n if (toPattern.includes('*')) {\n // Handle ** recursive patterns\n if (toPattern.includes('**')) {\n const targetRel = resolveRecursiveGlobTargetRelativePath(\n relativePath,\n fromPattern,\n toPattern\n );\n return path.join(context.workspaceRoot, targetRel);\n }\n \n // Handle single-level * patterns\n const sourceFileName = path.basename(sourcePath);\n const sourceExt = path.extname(sourcePath);\n const sourceBase = path.basename(sourcePath, sourceExt);\n \n const toParts = toPattern.split('*');\n const toPrefix = toParts[0];\n const toSuffix = toParts[1] || '';\n \n const targetExt = toSuffix.startsWith('.') ? toSuffix : (sourceExt + toSuffix);\n const targetFileName = sourceBase + targetExt;\n \n // Strip platform suffix from the final target filename\n const strippedTargetFileName = stripPlatformSuffixFromFilename(targetFileName);\n \n const resolvedTo = toPrefix + strippedTargetFileName;\n return path.join(context.workspaceRoot, resolvedTo);\n }\n \n // No glob in target - use as-is\n return path.join(context.workspaceRoot, toPattern);\n }\n\n /**\n * Get pipeline description\n */\n private getPipeline(flow: Flow): string[] {\n const pipeline: string[] = ['load'];\n\n if (flow.path) pipeline.push('extract');\n if (flow.pick) pipeline.push('pick');\n if (flow.omit) pipeline.push('omit');\n if (flow.map) pipeline.push('map');\n if (flow.embed) pipeline.push('embed');\n if (flow.merge) pipeline.push(`merge:${flow.merge}`);\n\n pipeline.push('write');\n\n return pipeline;\n }\n\n /**\n * Normalize from pattern for display in results\n * Converts array to comma-separated string\n */\n private normalizeFromPattern(pattern: string | string[] | SwitchExpression): string {\n if (this.isSwitchExpression(pattern)) {\n return '<switch>';\n }\n // Type narrowing: pattern is now string | string[]\n const narrowedPattern = pattern as string | string[];\n return Array.isArray(narrowedPattern) ? narrowedPattern.join(', ') : narrowedPattern;\n }\n\n /**\n * Normalize to pattern for display in results\n * Handles string, multi-target, and switch expressions\n */\n private normalizeToPattern(pattern: string | MultiTargetFlows | SwitchExpression): string {\n if (typeof pattern === 'string') {\n return pattern;\n }\n if (this.isSwitchExpression(pattern)) {\n return '<switch>';\n }\n return Object.keys(pattern as MultiTargetFlows).join(', ');\n }\n\n /**\n * Get the first pattern from a pattern or array of patterns\n * Used for path resolution when multiple sources are specified\n */\n private getFirstPattern(pattern: string | string[] | SwitchExpression): string {\n if (this.isSwitchExpression(pattern)) {\n throw new Error('Cannot get first pattern from SwitchExpression - expression must be resolved first');\n }\n // Type narrowing: pattern is now string | string[]\n const narrowedPattern = pattern as string | string[];\n return Array.isArray(narrowedPattern) ? narrowedPattern[0] : narrowedPattern;\n }\n\n /**\n * Aggregate multi-target results\n */\n private aggregateResults(results: FlowResult[], startTime: number): FlowResult {\n const successful = results.filter(r => r.success);\n const failed = results.filter(r => !r.success);\n\n if (failed.length > 0) {\n return {\n source: results[0]?.source || '',\n target: results.map(r => r.target).join(', '),\n success: false,\n transformed: results.some(r => r.transformed),\n error: failed[0]?.error,\n warnings: results.flatMap(r => r.warnings || []),\n executionTime: Date.now() - startTime,\n };\n }\n\n return {\n source: results[0]?.source || '',\n target: results.flatMap(r => typeof r.target === 'string' ? [r.target] : r.target),\n success: true,\n transformed: results.some(r => r.transformed),\n warnings: results.flatMap(r => r.warnings || []),\n conflicts: results.flatMap(r => r.conflicts || []),\n executionTime: Date.now() - startTime,\n };\n }\n\n /**\n * Parse markdown with frontmatter\n */\n private parseMarkdown(content: string): any {\n return parseMarkdownDocument(content);\n }\n\n /**\n * Serialize markdown with frontmatter\n */\n private serializeMarkdown(content: any): string {\n return serializeMarkdownDocument(content);\n }\n\n /**\n * Strip JSON comments\n */\n private stripJSONComments(content: string): string {\n // Remove single-line comments\n let result = content.replace(/\\/\\/.*$/gm, '');\n // Remove multi-line comments\n result = result.replace(/\\/\\*[\\s\\S]*?\\*\\//g, '');\n return result;\n }\n\n /**\n * Get nested value using dot notation (delegates to key mapper)\n */\n private getNestedValue(obj: any, path: string): any {\n return getNestedValue(obj, path);\n }\n\n /**\n * Set nested value using dot notation (delegates to key mapper)\n */\n private setNestedValue(obj: any, path: string, value: any): void {\n setNestedValue(obj, path, value);\n }\n\n /**\n * Delete nested value using dot notation (delegates to key mapper)\n */\n private deleteNestedValue(obj: any, path: string): void {\n deleteNestedValue(obj, path);\n }\n\n /**\n * Apply Codex-specific TOML formatting\n * Converts nested table sections to inline format for http_headers and env_http_headers\n */\n private applyCodexTomlFormatting(toml: string): string {\n const inlineKeys = ['http_headers', 'env_http_headers'];\n let result = toml;\n\n for (const key of inlineKeys) {\n // Pattern to match nested table sections for the key\n const pattern = new RegExp(\n `\\\\[([\\\\w-]+(?:\\\\.[\\\\w-]+|\\\\.\"[^\"]+\")*)?\\\\.${key}\\\\]\\\\s*\\\\n([\\\\s\\\\S]*?)(?=\\\\n\\\\[|\\\\n*$)`,\n 'g'\n );\n\n result = result.replace(pattern, (match, parentPath, content) => {\n const pairs: string[] = [];\n const lines = content.trim().split('\\n');\n\n for (const line of lines) {\n const trimmed = line.trim();\n if (!trimmed || trimmed.startsWith('#')) continue;\n\n const kvMatch = trimmed.match(/^([\\w-]+)\\s*=\\s*(.+)$/);\n if (kvMatch) {\n const [, k, v] = kvMatch;\n pairs.push(`\"${k}\" = ${v}`);\n }\n }\n\n if (pairs.length === 0) return match;\n\n const inlineTable = `{ ${pairs.join(', ')} }`;\n return `${key} = ${inlineTable}`;\n });\n }\n\n return result;\n }\n}\n\n/**\n * Create a flow executor instance\n */\nexport function createFlowExecutor(): FlowExecutor {\n return new DefaultFlowExecutor();\n}\n", "/**\n * Root File Content Merger Utility\n * Handles marker-based content merging for root files (AGENTS.md, CLAUDE.md, etc.)\n */\n\nimport { buildOpenMarker, buildOpenMarkerRegex, CLOSE_MARKER, CLOSE_MARKER_REGEX } from './root-file-extractor.js';\n\n/**\n * Merge package-specific content into a root file while preserving all other content.\n * Finds the package section between markers and replaces it, or appends if not found.\n * \n * @param existingContent - The current content of the root file (or empty string)\n * @param packageName - Name of the package to merge\n * @param newContent - Section body to insert between the markers (without markers)\n * @returns Updated root file content with package section merged\n */\nexport function mergePackageContentIntoRootFile(\n existingContent: string,\n packageName: string,\n newContent: string\n): string {\n if (!packageName) {\n throw new Error('Package name is required for merging');\n }\n\n const openMarker = buildOpenMarker(packageName);\n const closeMarker = CLOSE_MARKER;\n \n // Create regex to find existing package section\n const openRe = buildOpenMarkerRegex(packageName);\n const closeRe = CLOSE_MARKER_REGEX;\n\n const openMatch = openRe.exec(existingContent);\n \n if (!openMatch) {\n // Package section doesn't exist - append it\n const separator = existingContent.trim() ? '\\n\\n' : '';\n return existingContent.trim() + separator + openMarker + '\\n' + newContent.trim() + '\\n' + closeMarker + '\\n';\n }\n\n // Package section exists - check if it already has the correct content\n const beforeSection = existingContent.substring(0, openMatch.index);\n const afterMarkerIndex = openMatch.index + openMatch[0].length;\n const restContent = existingContent.substring(afterMarkerIndex);\n\n const closeMatch = closeRe.exec(restContent);\n\n if (!closeMatch) {\n // Malformed - missing closing marker, append new section at end\n const separator = existingContent.trim() ? '\\n\\n' : '';\n return existingContent.trim() + separator + openMarker + '\\n' + newContent.trim() + '\\n' + closeMarker + '\\n';\n }\n\n // Extract the existing section content\n const existingSectionBody = restContent.substring(0, closeMatch.index).trim();\n const afterCloseMarkerIndex = closeMatch.index + closeMatch[0].length;\n const afterSection = restContent.substring(afterCloseMarkerIndex);\n\n // Check if the existing section already has the correct content and marker\n // Use component-wise comparison to avoid issues with whitespace formatting differences\n const existingOpenMarker = openMatch[0];\n const hasCorrectMarker = existingOpenMarker === openMarker;\n const hasCorrectContent = existingSectionBody === newContent.trim();\n const hasCloseMarker = true; // We already verified closeMatch exists\n\n if (hasCorrectMarker && hasCorrectContent && hasCloseMarker) {\n // Existing section is already correct, return unchanged\n return existingContent;\n }\n\n // Replace the section content\n return beforeSection + openMarker + '\\n' + newContent.trim() + '\\n' + closeMarker + afterSection;\n}\n\n", "import { extname, basename, dirname } from 'path';\nimport { stripPlatformSuffixFromFilename } from './flows/platform-suffix-handler.js';\n\nfunction normalizeSlashPath(input: string): string {\n return input.replace(/\\\\/g, '/');\n}\n\nfunction splitSegments(input: string): string[] {\n const normalized = normalizeSlashPath(input);\n return normalized.split('/').filter(Boolean);\n}\n\n/**\n * When mapping a source path into a destination base (e.g. `skills/foo.txt` into `.cursor/skills/**`),\n * avoid duplicating overlapping anchor segments (e.g. `.cursor/skills/skills/foo.txt`).\n *\n * This finds the longest overlap where a suffix of `destBase` equals a prefix of `sourceRel`,\n * then strips that prefix from `sourceRel`.\n */\nexport function stripOverlappingDestBaseFromSource(\n destBase: string,\n sourceRelFromPackage: string\n): string {\n const destSegments = splitSegments(destBase);\n const sourceSegments = splitSegments(sourceRelFromPackage);\n\n const maxOverlap = Math.min(destSegments.length, sourceSegments.length);\n let overlapLen = 0;\n\n for (let k = maxOverlap; k >= 1; k--) {\n const destSuffix = destSegments.slice(-k).join('/');\n const sourcePrefix = sourceSegments.slice(0, k).join('/');\n if (destSuffix === sourcePrefix) {\n overlapLen = k;\n break;\n }\n }\n\n return sourceSegments.slice(overlapLen).join('/');\n}\n\nfunction extractTargetExtensionFromRecursiveSuffix(toSuffix: string): string | null {\n const normalized = normalizeSlashPath(toSuffix);\n const match = normalized.match(/(\\.[^/]+)$/);\n return match?.[1] ?? null;\n}\n\n/**\n * Resolve the workspace-relative target path for patterns containing `**`.\n *\n * - Preserves nested subdirectories from the source.\n * - Prevents accidental duplication when the destination base overlaps the source prefix.\n * - Supports basic extension remapping (e.g. `** / *.md` -> `** / *.mdc`).\n * - Strips platform suffixes from filenames (e.g. `read-specs.claude.md` -> `read-specs.md`).\n */\nexport function resolveRecursiveGlobTargetRelativePath(\n sourceRelFromPackage: string,\n fromPattern: string,\n toPattern: string\n): string {\n const toParts = normalizeSlashPath(toPattern).split('**');\n const toBase = toParts[0].replace(/\\/$/, '');\n const toSuffix = toParts[1] || '';\n\n let relativeSubpath = sourceRelFromPackage;\n\n if (fromPattern.includes('**')) {\n const fromParts = normalizeSlashPath(fromPattern).split('**');\n const fromBase = fromParts[0].replace(/\\/$/, '');\n const fromSuffix = fromParts[1] || '';\n\n if (fromBase) {\n const normalizedSource = normalizeSlashPath(sourceRelFromPackage);\n relativeSubpath = normalizedSource.startsWith(fromBase + '/')\n ? normalizedSource.slice(fromBase.length + 1)\n : normalizedSource;\n }\n\n // Handle extension mapping if suffixes specify extensions: /**/*.md -> /**/*.mdc\n if (fromSuffix && toSuffix) {\n const fromExt = fromSuffix.replace(/^\\/?\\*+/, '');\n const toExt = toSuffix.replace(/^\\/?\\*+/, '');\n if (fromExt && toExt && fromExt !== toExt) {\n relativeSubpath = relativeSubpath.replace(\n new RegExp(fromExt.replace('.', '\\\\.') + '$'),\n toExt\n );\n }\n }\n } else {\n // We don't have a recursive `fromPattern`, so preserve the full source path but avoid\n // duplicating any overlapping \"anchor\" segments with the destination base.\n relativeSubpath = toBase\n ? stripOverlappingDestBaseFromSource(toBase, sourceRelFromPackage)\n : normalizeSlashPath(sourceRelFromPackage);\n\n const toExt = extractTargetExtensionFromRecursiveSuffix(toSuffix);\n if (toExt && toExt.startsWith('.')) {\n const currentExt = extname(relativeSubpath);\n if (currentExt && currentExt !== toExt) {\n relativeSubpath = relativeSubpath.slice(0, -currentExt.length) + toExt;\n }\n }\n }\n\n // Strip platform suffix from filename (e.g. read-specs.claude.md -> read-specs.md)\n // This must be done before constructing the final path\n relativeSubpath = stripPlatformSuffixFromFilename(relativeSubpath);\n\n return toBase ? normalizeSlashPath(`${toBase}/${relativeSubpath}`) : normalizeSlashPath(relativeSubpath);\n}\n", "import { FILE_PATTERNS } from '../constants/index.js';\nimport type { Platform } from '../types/platform.js';\nimport {\n deepEqualYaml,\n deepMerge,\n extractInlinePlatformOverrides,\n splitFrontmatter,\n composeMarkdown\n} from './markdown-frontmatter.js';\n\n/**\n * Merge inline platform-specific override with universal content.\n * - Frontmatter contains common keys and platform-keyed override blocks.\n * - Produces merged frontmatter (common + override[targetPlatform]) and\n * removes platform blocks in the emitted markdown.\n */\nexport function mergeInlinePlatformOverride(\n universalContent: string,\n targetPlatform: Platform,\n cwd?: string\n): string {\n try {\n const trimmed = universalContent.trim();\n if (!trimmed.endsWith(FILE_PATTERNS.MD_FILES) && !trimmed.startsWith('---')) {\n // Fast path: only attempt merge for markdown with potential frontmatter\n return universalContent;\n }\n\n const { frontmatter, body, rawFrontmatter } = splitFrontmatter(universalContent);\n const { common, overridesByPlatform } = extractInlinePlatformOverrides(frontmatter, cwd);\n const override = overridesByPlatform.get(targetPlatform) ?? {};\n\n const mergedData = deepMerge(common, override);\n\n // Avoid reformatting if there's no change compared to base.\n // If frontmatter was present, check deep equality.\n if (rawFrontmatter !== undefined && deepEqualYaml(frontmatter, mergedData)) {\n return universalContent;\n }\n\n // If no frontmatter was present and merged result is empty, return original.\n if (rawFrontmatter === undefined && Object.keys(mergedData).length === 0) {\n return universalContent;\n }\n\n return composeMarkdown(mergedData, body);\n } catch {\n return universalContent;\n }\n}\n", "/**\n * Flow Key Mapper\n * \n * Implements sophisticated key transformations for the flow execution pipeline.\n * Supports dot notation, wildcard patterns, value transforms, lookup tables, and defaults.\n */\n\nimport { logger } from '../../utils/logger.js';\nimport { defaultTransformRegistry } from './flow-transforms.js';\nimport type { KeyMap, KeyMapConfig, FlowContext } from '../../types/flows.js';\n\n/**\n * Map a single key (simple or nested with dot notation)\n */\nfunction mapSingleKey(\n obj: any,\n sourceKey: string,\n targetConfig: string | KeyMapConfig,\n result: any,\n context: FlowContext,\n mappedKeys: Set<string>\n): void {\n const target = typeof targetConfig === 'string' ? targetConfig : targetConfig.to;\n const config = typeof targetConfig === 'object' ? targetConfig : undefined;\n\n // Get source value\n const value = getNestedValue(obj, sourceKey);\n\n // Track that we've processed this key\n markKeyAsMapped(sourceKey, mappedKeys);\n\n // Handle missing value\n if (value === undefined) {\n // Use default value if provided\n if (config?.default !== undefined) {\n const transformedValue = applyValueTransform(config.default, config, context);\n setNestedValue(result, target, transformedValue);\n } else if (config?.required) {\n logger.warn(`Required key missing: ${sourceKey}`);\n }\n return;\n }\n\n // Transform the value\n const transformedValue = applyValueTransform(value, config, context);\n\n // Skip if value is null/undefined and not required\n if ((transformedValue === null || transformedValue === undefined) && config?.required === false) {\n return;\n }\n\n // Set the transformed value in result\n setNestedValue(result, target, transformedValue);\n}\n\n/**\n * Map keys using wildcard patterns\n * \n * Examples:\n * - \"ai.*\" \u2192 \"cursor.*\" (map all keys under ai to cursor)\n * - \"servers.*\" \u2192 \"mcp.servers.*\" (map to nested path)\n */\nfunction mapWildcard(\n obj: any,\n pattern: string,\n targetConfig: string | KeyMapConfig,\n result: any,\n context: FlowContext,\n mappedKeys: Set<string>\n): void {\n const targetPattern = typeof targetConfig === 'string' ? targetConfig : targetConfig.to;\n const config = typeof targetConfig === 'object' ? targetConfig : undefined;\n\n // Parse pattern and target\n const { prefix: sourcePrefix, suffix: sourceSuffix } = parseWildcardPattern(pattern);\n const { prefix: targetPrefix, suffix: targetSuffix } = parseWildcardPattern(targetPattern);\n\n // Get all matching keys\n const matchingKeys = getMatchingKeys(obj, sourcePrefix, sourceSuffix);\n\n for (const key of matchingKeys) {\n // Extract the wildcard part\n const wildcardPart = extractWildcardPart(key, sourcePrefix, sourceSuffix);\n\n // Construct target key\n const targetKey = targetPrefix + wildcardPart + targetSuffix;\n\n // Get value\n const value = getNestedValue(obj, key);\n\n // Track as mapped\n markKeyAsMapped(key, mappedKeys);\n\n // Transform value\n if (value !== undefined) {\n const transformedValue = applyValueTransform(value, config, context);\n setNestedValue(result, targetKey, transformedValue);\n }\n }\n}\n\n/**\n * Parse wildcard pattern into prefix and suffix\n * \n * Examples:\n * - \"ai.*\" \u2192 { prefix: \"ai.\", suffix: \"\" }\n * - \"*.value\" \u2192 { prefix: \"\", suffix: \".value\" }\n * - \"servers.*.config\" \u2192 { prefix: \"servers.\", suffix: \".config\" }\n */\nfunction parseWildcardPattern(pattern: string): { prefix: string; suffix: string } {\n const wildcardIndex = pattern.indexOf('*');\n \n if (wildcardIndex === -1) {\n return { prefix: pattern, suffix: '' };\n }\n\n const prefix = pattern.substring(0, wildcardIndex);\n const suffix = pattern.substring(wildcardIndex + 1);\n\n return { prefix, suffix };\n}\n\n/**\n * Get all keys matching a wildcard pattern\n */\nfunction getMatchingKeys(obj: any, prefix: string, suffix: string): string[] {\n const flatKeys = getFlatKeys(obj);\n \n return flatKeys.filter(key => {\n if (prefix && !key.startsWith(prefix)) {\n return false;\n }\n if (suffix && !key.endsWith(suffix)) {\n return false;\n }\n return true;\n });\n}\n\n/**\n * Extract the wildcard part from a key\n */\nfunction extractWildcardPart(key: string, prefix: string, suffix: string): string {\n let result = key;\n \n if (prefix) {\n result = result.substring(prefix.length);\n }\n \n if (suffix) {\n result = result.substring(0, result.length - suffix.length);\n }\n \n return result;\n}\n\n/**\n * Get all flat keys (dot notation) from an object\n */\nfunction getFlatKeys(obj: any, prefix = ''): string[] {\n const keys: string[] = [];\n\n if (typeof obj !== 'object' || obj === null) {\n return [];\n }\n\n for (const [key, value] of Object.entries(obj)) {\n const fullKey = prefix ? `${prefix}.${key}` : key;\n keys.push(fullKey);\n\n // Recursively get nested keys\n if (typeof value === 'object' && value !== null && !Array.isArray(value)) {\n keys.push(...getFlatKeys(value, fullKey));\n }\n }\n\n return keys;\n}\n\n/**\n * Apply value transformations\n * \n * Applies transforms and value lookups in order:\n * 1. Apply value lookup table (if provided)\n * 2. Apply transform functions (if provided)\n */\nfunction applyValueTransform(\n value: any,\n config: KeyMapConfig | undefined,\n context: FlowContext\n): any {\n if (!config) {\n return value;\n }\n\n let result = value;\n\n // Apply value lookup table first\n if (config.values && result in config.values) {\n result = config.values[result];\n }\n\n // Apply transform functions\n if (config.transform) {\n result = applyTransforms(result, config.transform, context);\n }\n\n return result;\n}\n\n/**\n * Apply one or more transforms to a value\n */\nfunction applyTransforms(value: any, transforms: string | string[], context: FlowContext): any {\n const transformList = Array.isArray(transforms) ? transforms : [transforms];\n \n let result = value;\n\n for (const transformName of transformList) {\n try {\n // Check if transform exists\n if (defaultTransformRegistry.has(transformName)) {\n result = defaultTransformRegistry.execute(transformName, result);\n } else {\n logger.warn(`Unknown transform: ${transformName}`);\n }\n } catch (error) {\n const errorMsg = error instanceof Error ? error.message : String(error);\n logger.warn(`Transform '${transformName}' failed: ${errorMsg}`);\n // Continue with unmodified value on error\n }\n }\n\n return result;\n}\n\n/**\n * Get nested value using dot notation\n * \n * Examples:\n * - getNestedValue({ a: { b: 1 } }, \"a.b\") \u2192 1\n * - getNestedValue({ a: { b: 1 } }, \"a.c\") \u2192 undefined\n */\nexport function getNestedValue(obj: any, path: string): any {\n if (!path) {\n return obj;\n }\n\n const keys = path.split('.');\n let current = obj;\n\n for (const key of keys) {\n if (current && typeof current === 'object' && key in current) {\n current = current[key];\n } else {\n return undefined;\n }\n }\n\n return current;\n}\n\n/**\n * Set nested value using dot notation\n * \n * Examples:\n * - setNestedValue({}, \"a.b\", 1) \u2192 { a: { b: 1 } }\n * - setNestedValue({ a: {} }, \"a.b\", 1) \u2192 { a: { b: 1 } }\n */\nexport function setNestedValue(obj: any, path: string, value: any): void {\n if (!path) {\n return;\n }\n\n const keys = path.split('.');\n let current = obj;\n\n // Navigate/create nested structure\n for (let i = 0; i < keys.length - 1; i++) {\n const key = keys[i];\n \n if (!(key in current) || typeof current[key] !== 'object') {\n current[key] = {};\n }\n \n current = current[key];\n }\n\n // Set final value\n const finalKey = keys[keys.length - 1];\n current[finalKey] = value;\n}\n\n/**\n * Delete nested value using dot notation\n */\nexport function deleteNestedValue(obj: any, path: string): void {\n if (!path) {\n return;\n }\n\n const keys = path.split('.');\n let current = obj;\n\n // Navigate to parent\n for (let i = 0; i < keys.length - 1; i++) {\n const key = keys[i];\n \n if (!(key in current) || typeof current[key] !== 'object') {\n return; // Path doesn't exist\n }\n \n current = current[key];\n }\n\n // Delete final key\n const finalKey = keys[keys.length - 1];\n delete current[finalKey];\n}\n\n/**\n * Mark a key (and its nested parent keys) as mapped\n * \n * Examples:\n * - markKeyAsMapped(\"a.b.c\", set) adds \"a\", \"a.b\", \"a.b.c\" to set\n */\nfunction markKeyAsMapped(key: string, mappedKeys: Set<string>): void {\n mappedKeys.add(key);\n\n // Also mark parent keys as mapped\n const parts = key.split('.');\n for (let i = 1; i < parts.length; i++) {\n const parentKey = parts.slice(0, i).join('.');\n mappedKeys.add(parentKey);\n }\n}\n\n/**\n * Copy unmapped keys from source to result\n * \n * This preserves keys that are not explicitly mapped.\n */\nfunction copyUnmappedKeys(source: any, result: any, mappedKeys: Set<string>): void {\n if (typeof source !== 'object' || source === null) {\n return;\n }\n\n // If result is an array, don't copy unmapped keys\n if (Array.isArray(result)) {\n return;\n }\n\n for (const key of Object.keys(source)) {\n if (!mappedKeys.has(key) && !(key in result)) {\n result[key] = source[key];\n }\n }\n}\n\n\n", "/**\n * Source Pattern Resolver\n * \n * Resolves source file patterns (including arrays with priority) to actual file paths.\n * Supports glob patterns and priority-based pattern selection.\n */\n\nimport { promises as fs } from 'fs';\nimport path from 'path';\nimport { minimatch } from 'minimatch';\nimport * as fsUtils from '../../utils/fs.js';\nimport { logger } from '../../utils/logger.js';\n\n/**\n * Result of source pattern resolution\n */\nexport interface SourceResolutionResult {\n /** Resolved file paths that matched */\n paths: string[];\n \n /** Warnings generated during resolution */\n warnings: string[];\n \n /** Pattern that matched (for multi-pattern scenarios) */\n matchedPattern?: string;\n \n /** Patterns that were skipped due to lower priority */\n skippedPatterns?: string[];\n}\n\n/**\n * Options for source resolution\n */\nexport interface SourceResolutionOptions {\n /** Base directory for resolving relative patterns */\n baseDir: string;\n \n /** Whether to log warnings for skipped patterns */\n logWarnings?: boolean;\n}\n\n/**\n * Source Pattern Resolver\n * \n * Handles resolution of single patterns, arrays of patterns (with priority),\n * and glob patterns to actual file paths.\n */\nexport class SourcePatternResolver {\n /**\n * Resolve source pattern(s) to file paths\n * \n * For single patterns: returns all matching files\n * For array patterns: returns files from first matching pattern only (priority order)\n * \n * @param pattern - Single pattern or array of patterns with priority\n * @param options - Resolution options\n * @returns Resolution result with paths and warnings\n */\n async resolve(\n pattern: string | string[],\n options: SourceResolutionOptions\n ): Promise<SourceResolutionResult> {\n // Handle array of patterns with priority\n if (Array.isArray(pattern)) {\n return this.resolveWithPriority(pattern, options);\n }\n \n // Single pattern\n const paths = await this.resolveSinglePattern(pattern, options.baseDir);\n return {\n paths,\n warnings: [],\n };\n }\n\n /**\n * Resolve array of patterns with priority (first match wins)\n * \n * Iterates through patterns in order, returning files from first matching pattern.\n * Logs warnings if lower-priority patterns also match.\n * \n * @param patterns - Array of patterns in priority order\n * @param options - Resolution options\n * @returns Resolution result\n */\n private async resolveWithPriority(\n patterns: string[],\n options: SourceResolutionOptions\n ): Promise<SourceResolutionResult> {\n if (patterns.length === 0) {\n return { paths: [], warnings: ['Empty pattern array provided'] };\n }\n\n const warnings: string[] = [];\n const skippedPatterns: string[] = [];\n\n // Try each pattern in priority order\n for (let i = 0; i < patterns.length; i++) {\n const currentPattern = patterns[i];\n const matches = await this.resolveSinglePattern(currentPattern, options.baseDir);\n\n if (matches.length > 0) {\n // Found matches - check if lower-priority patterns also match\n for (let j = i + 1; j < patterns.length; j++) {\n const lowerPriorityPattern = patterns[j];\n const lowerMatches = await this.resolveSinglePattern(\n lowerPriorityPattern,\n options.baseDir\n );\n\n if (lowerMatches.length > 0) {\n const warning = `Pattern \"${currentPattern}\" matched (priority ${i + 1}). ` +\n `Ignoring lower-priority pattern \"${lowerPriorityPattern}\" (priority ${j + 1}) ` +\n `which also matched ${lowerMatches.length} file(s).`;\n \n warnings.push(warning);\n skippedPatterns.push(lowerPriorityPattern);\n\n if (options.logWarnings !== false) {\n logger.debug(warning);\n }\n }\n }\n\n return {\n paths: matches,\n warnings,\n matchedPattern: currentPattern,\n skippedPatterns: skippedPatterns.length > 0 ? skippedPatterns : undefined,\n };\n }\n }\n\n // No patterns matched\n return {\n paths: [],\n warnings: [`No files matched any of the ${patterns.length} pattern(s): ${patterns.join(', ')}`],\n };\n }\n\n /**\n * Resolve a single pattern to file paths\n * \n * Handles both glob patterns and literal file paths.\n * \n * @param pattern - File pattern (may contain globs)\n * @param baseDir - Base directory for resolution\n * @returns Array of resolved file paths\n */\n private async resolveSinglePattern(pattern: string, baseDir: string): Promise<string[]> {\n // Check if pattern contains glob wildcard\n if (this.isGlobPattern(pattern)) {\n return this.resolveGlobPattern(pattern, baseDir);\n }\n\n // Literal file path - check if it exists\n const resolved = path.join(baseDir, pattern);\n const exists = await fsUtils.exists(resolved);\n\n return exists ? [resolved] : [];\n }\n\n /**\n * Check if pattern contains glob wildcards\n * \n * @param pattern - Pattern to check\n * @returns True if pattern contains glob syntax\n */\n private isGlobPattern(pattern: string): boolean {\n return pattern.includes('*') || pattern.includes('?') || pattern.includes('[');\n }\n\n /**\n * Resolve glob pattern to matching files\n * \n * @param pattern - Glob pattern\n * @param baseDir - Base directory\n * @returns Array of matching file paths\n */\n private async resolveGlobPattern(pattern: string, baseDir: string): Promise<string[]> {\n const matches: string[] = [];\n\n // Extract directory and file pattern\n const parts = pattern.split('/');\n const globPart = parts.findIndex(p => this.isGlobPattern(p));\n\n if (globPart === -1) {\n // No glob found (shouldn't happen, but handle gracefully)\n return [path.join(baseDir, pattern)];\n }\n\n // Build directory path up to first glob\n const dirPath = path.join(baseDir, ...parts.slice(0, globPart));\n const filePattern = parts.slice(globPart).join('/');\n\n // Check if directory exists\n if (!await fsUtils.exists(dirPath)) {\n return [];\n }\n\n // Recursively find matching files\n await this.findMatchingFiles(dirPath, filePattern, baseDir, matches);\n\n return matches;\n }\n\n /**\n * Recursively find files matching glob pattern\n * \n * Supports ** for recursive directory matching.\n * \n * @param dir - Current directory\n * @param pattern - Pattern to match\n * @param baseDir - Base directory for relative paths\n * @param matches - Array to accumulate matches\n */\n private async findMatchingFiles(\n dir: string,\n pattern: string,\n baseDir: string,\n matches: string[]\n ): Promise<void> {\n try {\n const entries = await fs.readdir(dir, { withFileTypes: true });\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name);\n const relativePath = path.relative(baseDir, fullPath);\n\n if (entry.isDirectory()) {\n // Always recurse for ** patterns\n if (pattern.startsWith('**') || pattern.includes('/**/')) {\n await this.findMatchingFiles(fullPath, pattern, baseDir, matches);\n } else if (pattern.includes('/')) {\n // For patterns with subdirs, continue searching\n await this.findMatchingFiles(fullPath, pattern, baseDir, matches);\n }\n } else if (entry.isFile()) {\n // Test file against pattern\n if (minimatch(relativePath, pattern, { dot: false })) {\n matches.push(fullPath);\n }\n }\n }\n } catch (error) {\n // Ignore errors (directory not accessible, etc.)\n logger.debug(`Error reading directory ${dir}: ${error}`);\n }\n }\n}\n\n/**\n * Create a source pattern resolver instance\n */\nexport function createSourceResolver(): SourcePatternResolver {\n return new SourcePatternResolver();\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,SAAS,eAAe;AAMxB,eAAsB,kBAAkB,SAAkC;AACxE,MAAI;AACF,WAAO,MAAM,QAAQ,OAAO;AAAA,EAC9B,SAAS,OAAO;AACd,kBAAO,KAAK,yCAAyC,KAAK,EAAE,GAE3C,GAAG,QAAQ,MAAM,IAAI,QAAQ,OAAO,CAAC,CAAC,IAAI,QAAQ,OAAO,QAAQ,SAAS,CAAC,CAAC;AAAA,EAE/F;AACF;;;ACNA,SAAS,YAAYA,WAAU;AAC/B,OAAO,YAAY;AACnB,OAAOC,WAAU;AACjB,OAAO,UAAU;AACjB,YAAY,UAAU;AACtB,SAAS,SAAS,kBAAkB;AACpC,SAAS,gBAAgB;;;ACJlB,SAAS,gCACd,iBACA,aACA,YACQ;AACR,MAAI,CAAC;AACH,UAAM,IAAI,MAAM,sCAAsC;AAGxD,MAAM,aAAa,gBAAgB,WAAW,GACxC,cAAc,cAGd,SAAS,qBAAqB,WAAW,GACzC,UAAU,oBAEV,YAAY,OAAO,KAAK,eAAe;AAE7C,MAAI,CAAC,WAAW;AA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EAMQ,yBAAyB,MAAsB;AACrD,QAAM,aAAa,CAAC,gBAAgB,kBAAkB,GAClD,SAAS;AAEb,aAAW,OAAO,YAAY;AAE5B,UAAM,UAAU,IAAI;AAAA,QAClB,6CAA6C,GAAG;AAAA,QAChD;AAAA,MACF;AAEA,eAAS,OAAO,QAAQ,SAAS,CAAC,OAAO,YAAY,YAAY;AAC/D,YAAM,QAAkB,CAAC,GACnB,QAAQ,QAAQ,KAAK,EAAE,MAAM;AAAA,CAAI;AAEvC,iBAAW,QAAQ,OAAO;AACxB,cAAM,UAAU,KAAK,KAAK;AAC1B,cAAI,CAAC,WAAW,QAAQ,WAAW,GAAG,EAAG;AAEzC,cAAM,UAAU,QAAQ,MAAM,uBAAuB;AACrD,cAAI,SAAS;AACX,gBAAM,CAAC,EAAE,GAAG,CAAC,IAAI;AACjB,kBAAM,KAAK,IAAI,CAAC,OAAO,CAAC,EAAE;AAAA,UAC5B;AAAA,QACF;AAEA,YAAI,MAAM,WAAW,EAAG,QAAO;AAE/B,YAAM,cAAc,KAAK,MAAM,KAAK,IAAI,CAAC;AACzC,eAAO,GAAG,GAAG,MAAM,WAAW;AAAA,MAChC,CAAC;AAAA,IACH;AAEA,WAAO;AAAA,EACT;AACF;AAKO,SAAS,qBAAmC;AACjD,SAAO,IAAI,oBAAoB;AACjC;",
|
|
6
|
+
"names": ["fs", "path", "path", "results", "path", "fs"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
profileManager
|
|
4
|
+
} from "./chunk-S6OARUVQ.js";
|
|
5
|
+
import {
|
|
6
|
+
createCliExecutionContext,
|
|
7
|
+
resolveOutput,
|
|
8
|
+
resolvePrompt
|
|
9
|
+
} from "./chunk-BROJ6OUT.js";
|
|
10
|
+
import {
|
|
11
|
+
ensureOpenPackageDirectories
|
|
12
|
+
} from "./chunk-XEPVYZO3.js";
|
|
13
|
+
import "./chunk-VN22A7NW.js";
|
|
14
|
+
import "./chunk-J4IFFBLP.js";
|
|
15
|
+
import "./chunk-S47F4OG4.js";
|
|
16
|
+
import {
|
|
17
|
+
UserCancellationError
|
|
18
|
+
} from "./chunk-ID4SVDQZ.js";
|
|
19
|
+
import {
|
|
20
|
+
logger
|
|
21
|
+
} from "./chunk-5EFWGD33.js";
|
|
22
|
+
|
|
23
|
+
// src/utils/messages.ts
|
|
24
|
+
var API_KEY_SIGNUP_MESSAGE = "\u{1F4A1} Obtain an API key by signing up at \x1B[4mhttps://openpackage.dev\x1B[0m";
|
|
25
|
+
|
|
26
|
+
// src/commands/configure.ts
|
|
27
|
+
async function setupProfile(profileName, out, prm) {
|
|
28
|
+
try {
|
|
29
|
+
logger.info(`Setting up profile: ${profileName}`), await ensureOpenPackageDirectories(), out.info(API_KEY_SIGNUP_MESSAGE);
|
|
30
|
+
let apiKey = await prm.text(`Enter API key for profile '${profileName}':`, {
|
|
31
|
+
validate: (value) => value.length > 0 ? !0 : "API key is required"
|
|
32
|
+
}), description = await prm.text(`Enter description for profile '${profileName}' (optional):`, {
|
|
33
|
+
initial: profileName === "default" ? "Default profile" : ""
|
|
34
|
+
});
|
|
35
|
+
if (!apiKey)
|
|
36
|
+
throw new UserCancellationError("Profile setup cancelled");
|
|
37
|
+
return await profileManager.setProfile(profileName, {
|
|
38
|
+
description: description || void 0
|
|
39
|
+
}), await profileManager.setProfileCredentials(profileName, {
|
|
40
|
+
api_key: apiKey
|
|
41
|
+
}), out.success(`Profile '${profileName}' configured successfully`), profileName === "default" ? (out.message(""), out.info("You can now use remote registry features with this profile.")) : (out.message(""), out.info(`You can now use remote registry features with --profile ${profileName}`)), {
|
|
42
|
+
success: !0,
|
|
43
|
+
data: {
|
|
44
|
+
profile: profileName,
|
|
45
|
+
message: "Profile configured successfully"
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
} catch (error) {
|
|
49
|
+
if (error instanceof UserCancellationError)
|
|
50
|
+
throw error;
|
|
51
|
+
return logger.error(`Failed to setup profile: ${profileName}`, { error }), { success: !1, error: `Failed to setup profile: ${error}` };
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
async function listProfiles(out) {
|
|
55
|
+
try {
|
|
56
|
+
let profiles = await profileManager.listProfiles();
|
|
57
|
+
if (profiles.length === 0)
|
|
58
|
+
return out.info("No profiles configured."), out.message(""), out.info("To create a profile, run:"), out.info(" opkg configure"), out.info(" opkg configure --profile <name>"), { success: !0, data: { profiles: [] } };
|
|
59
|
+
out.info("Configured profiles:"), out.message("");
|
|
60
|
+
for (let profileName of profiles) {
|
|
61
|
+
let profile = await profileManager.getProfile(profileName), hasCredentials = !!profile?.credentials?.api_key, description = profile?.config?.description || "(no description)";
|
|
62
|
+
out.message(` ${profileName}`), out.message(` Description: ${description}`), out.message(` Credentials: ${hasCredentials ? "\u2705 Configured" : "\u274C Missing"}`), out.message("");
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
success: !0,
|
|
66
|
+
data: { profiles }
|
|
67
|
+
};
|
|
68
|
+
} catch (error) {
|
|
69
|
+
return logger.error("Failed to list profiles", { error }), { success: !1, error: `Failed to list profiles: ${error}` };
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
async function deleteProfile(profileName, out, prm) {
|
|
73
|
+
try {
|
|
74
|
+
if (profileName === "default")
|
|
75
|
+
return { success: !1, error: "Cannot delete the default profile" };
|
|
76
|
+
if (!await profileManager.hasProfile(profileName))
|
|
77
|
+
return { success: !1, error: `Profile '${profileName}' not found` };
|
|
78
|
+
if (!await prm.confirm(
|
|
79
|
+
`Are you sure you want to delete profile '${profileName}'?`,
|
|
80
|
+
!1
|
|
81
|
+
))
|
|
82
|
+
throw new UserCancellationError("Profile deletion cancelled");
|
|
83
|
+
return await profileManager.deleteProfile(profileName), out.success(`Profile '${profileName}' deleted successfully`), {
|
|
84
|
+
success: !0,
|
|
85
|
+
data: {
|
|
86
|
+
profile: profileName,
|
|
87
|
+
message: "Profile deleted successfully"
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
} catch (error) {
|
|
91
|
+
if (error instanceof UserCancellationError)
|
|
92
|
+
throw error;
|
|
93
|
+
return logger.error(`Failed to delete profile: ${profileName}`, { error }), { success: !1, error: `Failed to delete profile: ${error}` };
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
async function configureCommand(options, out, prm) {
|
|
97
|
+
return logger.info("Configure command executed", { options }), options.list ? await listProfiles(out) : typeof options.delete == "string" ? await deleteProfile(options.delete, out, prm) : options.delete && options.profile ? await deleteProfile(options.profile, out, prm) : options.delete ? { success: !1, error: "Please provide a profile name via --delete <name> or --profile <name>." } : options.profile ? await setupProfile(options.profile, out, prm) : await setupProfile("default", out, prm);
|
|
98
|
+
}
|
|
99
|
+
async function setupConfigureCommand(args) {
|
|
100
|
+
let [options] = args, ctx = await createCliExecutionContext({ outputMode: "rich" }), out = resolveOutput(ctx), prm = resolvePrompt(ctx), result = await configureCommand(options, out, prm);
|
|
101
|
+
if (!result.success)
|
|
102
|
+
throw new Error(result.error || "Configure operation failed");
|
|
103
|
+
}
|
|
104
|
+
export {
|
|
105
|
+
setupConfigureCommand
|
|
106
|
+
};
|
|
107
|
+
//# sourceMappingURL=configure-3AZUMDJZ.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/utils/messages.ts", "../src/commands/configure.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * User-facing messages and notifications for the OpenPackage CLI\n */\n\n/**\n * API key signup message\n * Displayed when prompting users to obtain an API key\n */\nexport const API_KEY_SIGNUP_MESSAGE = '\uD83D\uDCA1 Obtain an API key by signing up at \\x1b[4mhttps://openpackage.dev\\x1b[0m';\n\n/**\n * Display the API key signup message to the console\n */\nexport function showApiKeySignupMessage(): void {\n console.log(API_KEY_SIGNUP_MESSAGE);\n}\n", "import { CommandResult } from '@opkg/core/types/index.js';\nimport { profileManager } from '@opkg/core/core/profiles.js';\nimport { ensureOpenPackageDirectories } from '@opkg/core/core/directory.js';\nimport { logger } from '@opkg/core/utils/logger.js';\nimport { UserCancellationError } from '@opkg/core/utils/errors.js';\nimport { API_KEY_SIGNUP_MESSAGE } from '../utils/messages.js';\nimport { createCliExecutionContext } from '../cli/context.js';\nimport { resolveOutput, resolvePrompt } from '@opkg/core/core/ports/resolve.js';\nimport type { OutputPort } from '@opkg/core/core/ports/output.js';\nimport type { PromptPort } from '@opkg/core/core/ports/prompt.js';\n\n/**\n * Configure command implementation for profile management\n */\n\ninterface ConfigureOptions {\n profile?: string;\n list?: boolean;\n delete?: string | boolean;\n}\n\n/**\n * Interactive profile setup\n */\nasync function setupProfile(profileName: string, out: OutputPort, prm: PromptPort): Promise<CommandResult> {\n try {\n logger.info(`Setting up profile: ${profileName}`);\n\n // Ensure directories exist\n await ensureOpenPackageDirectories();\n\n out.info(API_KEY_SIGNUP_MESSAGE);\n\n // Prompt for API key\n const apiKey = await prm.text(`Enter API key for profile '${profileName}':`, {\n validate: (value: string) => value.length > 0 ? true : 'API key is required'\n });\n\n const description = await prm.text(`Enter description for profile '${profileName}' (optional):`, {\n initial: profileName === 'default' ? 'Default profile' : ''\n });\n\n if (!apiKey) {\n throw new UserCancellationError('Profile setup cancelled');\n }\n\n // Set profile configuration\n await profileManager.setProfile(profileName, {\n description: description || undefined\n });\n\n // Set profile credentials\n await profileManager.setProfileCredentials(profileName, {\n api_key: apiKey\n });\n\n out.success(`Profile '${profileName}' configured successfully`);\n \n if (profileName === 'default') {\n out.message('');\n out.info('You can now use remote registry features with this profile.');\n } else {\n out.message('');\n out.info(`You can now use remote registry features with --profile ${profileName}`);\n }\n\n return {\n success: true,\n data: {\n profile: profileName,\n message: 'Profile configured successfully'\n }\n };\n } catch (error) {\n if (error instanceof UserCancellationError) {\n throw error; // Re-throw to be handled by withErrorHandling\n }\n logger.error(`Failed to setup profile: ${profileName}`, { error });\n return { success: false, error: `Failed to setup profile: ${error}` };\n }\n}\n\n/**\n * List all profiles\n */\nasync function listProfiles(out: OutputPort): Promise<CommandResult> {\n try {\n const profiles = await profileManager.listProfiles();\n \n if (profiles.length === 0) {\n out.info('No profiles configured.');\n out.message('');\n out.info('To create a profile, run:');\n out.info(' opkg configure');\n out.info(' opkg configure --profile <name>');\n return { success: true, data: { profiles: [] } };\n }\n\n out.info('Configured profiles:');\n out.message('');\n\n for (const profileName of profiles) {\n const profile = await profileManager.getProfile(profileName);\n const hasCredentials = !!profile?.credentials?.api_key;\n const description = profile?.config?.description || '(no description)';\n \n out.message(` ${profileName}`);\n out.message(` Description: ${description}`);\n out.message(` Credentials: ${hasCredentials ? '\\u2705 Configured' : '\\u274C Missing'}`);\n out.message('');\n }\n\n return {\n success: true,\n data: { profiles }\n };\n } catch (error) {\n logger.error('Failed to list profiles', { error });\n return { success: false, error: `Failed to list profiles: ${error}` };\n }\n}\n\n/**\n * Delete a profile\n */\nasync function deleteProfile(profileName: string, out: OutputPort, prm: PromptPort): Promise<CommandResult> {\n try {\n if (profileName === 'default') {\n return { success: false, error: 'Cannot delete the default profile' };\n }\n\n const exists = await profileManager.hasProfile(profileName);\n if (!exists) {\n return { success: false, error: `Profile '${profileName}' not found` };\n }\n\n // Confirm deletion\n const confirmed = await prm.confirm(\n `Are you sure you want to delete profile '${profileName}'?`,\n false\n );\n\n if (!confirmed) {\n throw new UserCancellationError('Profile deletion cancelled');\n }\n\n await profileManager.deleteProfile(profileName);\n out.success(`Profile '${profileName}' deleted successfully`);\n\n return {\n success: true,\n data: {\n profile: profileName,\n message: 'Profile deleted successfully'\n }\n };\n } catch (error) {\n if (error instanceof UserCancellationError) {\n throw error; // Re-throw to be handled by withErrorHandling\n }\n logger.error(`Failed to delete profile: ${profileName}`, { error });\n return { success: false, error: `Failed to delete profile: ${error}` };\n }\n}\n\n\n/**\n * Main configure command implementation\n */\nasync function configureCommand(options: ConfigureOptions, out: OutputPort, prm: PromptPort): Promise<CommandResult> {\n logger.info('Configure command executed', { options });\n\n // List profiles\n if (options.list) {\n return await listProfiles(out);\n }\n\n // Delete profile\n if (typeof options.delete === 'string') {\n return await deleteProfile(options.delete, out, prm);\n }\n if (options.delete && options.profile) {\n // Backward compatibility: allow --delete with --profile <name>\n return await deleteProfile(options.profile, out, prm);\n }\n if (options.delete) {\n return { success: false, error: 'Please provide a profile name via --delete <name> or --profile <name>.' };\n }\n\n // Setup default profile (default behavior)\n if (!options.profile) {\n return await setupProfile('default', out, prm);\n }\n\n // Setup profile\n return await setupProfile(options.profile, out, prm);\n}\n\n/**\n * Setup the configure command\n */\nexport async function setupConfigureCommand(args: any[]): Promise<void> {\n const [options] = args as [ConfigureOptions];\n const ctx = await createCliExecutionContext({ outputMode: 'rich' });\n const out = resolveOutput(ctx);\n const prm = resolvePrompt(ctx);\n const result = await configureCommand(options, out, prm);\n if (!result.success) {\n throw new Error(result.error || 'Configure operation failed');\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAQO,IAAM,yBAAyB;;;ACgBtC,eAAe,aAAa,aAAqB,KAAiB,KAAyC;AACzG,MAAI;AACF,WAAO,KAAK,uBAAuB,WAAW,EAAE,GAGhD,MAAM,6BAA6B,GAEnC,IAAI,KAAK,sBAAsB;AAG/B,QAAM,SAAS,MAAM,IAAI,KAAK,8BAA8B,WAAW,MAAM;AAAA,MAC3E,UAAU,CAAC,UAAkB,MAAM,SAAS,IAAI,KAAO;AAAA,IACzD,CAAC,GAEK,cAAc,MAAM,IAAI,KAAK,kCAAkC,WAAW,iBAAiB;AAAA,MAC/F,SAAS,gBAAgB,YAAY,oBAAoB;AAAA,IAC3D,CAAC;AAED,QAAI,CAAC;AACH,YAAM,IAAI,sBAAsB,yBAAyB;AAI3D,iBAAM,eAAe,WAAW,aAAa;AAAA,MAC3C,aAAa,eAAe;AAAA,IAC9B,CAAC,GAGD,MAAM,eAAe,sBAAsB,aAAa;AAAA,MACtD,SAAS;AAAA,IACX,CAAC,GAED,IAAI,QAAQ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MAAM,0BAA0B,EAAE,YAAY,OAAO,CAAC,GAC5D,MAAM,cAAc,GAAG,GACvB,MAAM,cAAc,GAAG,GACvB,SAAS,MAAM,iBAAiB,SAAS,KAAK,GAAG;AACvD,MAAI,CAAC,OAAO;AACV,UAAM,IAAI,MAAM,OAAO,SAAS,4BAA4B;AAEhE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
profileManager
|
|
4
|
+
} from "./chunk-S6OARUVQ.js";
|
|
5
|
+
import {
|
|
6
|
+
createCliExecutionContext,
|
|
7
|
+
resolveOutput,
|
|
8
|
+
resolvePrompt
|
|
9
|
+
} from "./chunk-RAKMX654.js";
|
|
10
|
+
import {
|
|
11
|
+
ensureOpenPackageDirectories
|
|
12
|
+
} from "./chunk-XEPVYZO3.js";
|
|
13
|
+
import "./chunk-VN22A7NW.js";
|
|
14
|
+
import "./chunk-J4IFFBLP.js";
|
|
15
|
+
import "./chunk-S47F4OG4.js";
|
|
16
|
+
import {
|
|
17
|
+
UserCancellationError
|
|
18
|
+
} from "./chunk-ID4SVDQZ.js";
|
|
19
|
+
import {
|
|
20
|
+
logger
|
|
21
|
+
} from "./chunk-5EFWGD33.js";
|
|
22
|
+
|
|
23
|
+
// src/utils/messages.ts
|
|
24
|
+
var API_KEY_SIGNUP_MESSAGE = "\u{1F4A1} Obtain an API key by signing up at \x1B[4mhttps://openpackage.dev\x1B[0m";
|
|
25
|
+
|
|
26
|
+
// src/commands/configure.ts
|
|
27
|
+
async function setupProfile(profileName, out, prm) {
|
|
28
|
+
try {
|
|
29
|
+
logger.info(`Setting up profile: ${profileName}`), await ensureOpenPackageDirectories(), out.info(API_KEY_SIGNUP_MESSAGE);
|
|
30
|
+
let apiKey = await prm.text(`Enter API key for profile '${profileName}':`, {
|
|
31
|
+
validate: (value) => value.length > 0 ? !0 : "API key is required"
|
|
32
|
+
}), description = await prm.text(`Enter description for profile '${profileName}' (optional):`, {
|
|
33
|
+
initial: profileName === "default" ? "Default profile" : ""
|
|
34
|
+
});
|
|
35
|
+
if (!apiKey)
|
|
36
|
+
throw new UserCancellationError("Profile setup cancelled");
|
|
37
|
+
return await profileManager.setProfile(profileName, {
|
|
38
|
+
description: description || void 0
|
|
39
|
+
}), await profileManager.setProfileCredentials(profileName, {
|
|
40
|
+
api_key: apiKey
|
|
41
|
+
}), out.success(`Profile '${profileName}' configured successfully`), profileName === "default" ? (out.message(""), out.info("You can now use remote registry features with this profile.")) : (out.message(""), out.info(`You can now use remote registry features with --profile ${profileName}`)), {
|
|
42
|
+
success: !0,
|
|
43
|
+
data: {
|
|
44
|
+
profile: profileName,
|
|
45
|
+
message: "Profile configured successfully"
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
} catch (error) {
|
|
49
|
+
if (error instanceof UserCancellationError)
|
|
50
|
+
throw error;
|
|
51
|
+
return logger.error(`Failed to setup profile: ${profileName}`, { error }), { success: !1, error: `Failed to setup profile: ${error}` };
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
async function listProfiles(out) {
|
|
55
|
+
try {
|
|
56
|
+
let profiles = await profileManager.listProfiles();
|
|
57
|
+
if (profiles.length === 0)
|
|
58
|
+
return out.info("No profiles configured."), out.message(""), out.info("To create a profile, run:"), out.info(" opkg configure"), out.info(" opkg configure --profile <name>"), { success: !0, data: { profiles: [] } };
|
|
59
|
+
out.info("Configured profiles:"), out.message("");
|
|
60
|
+
for (let profileName of profiles) {
|
|
61
|
+
let profile = await profileManager.getProfile(profileName), hasCredentials = !!profile?.credentials?.api_key, description = profile?.config?.description || "(no description)";
|
|
62
|
+
out.message(` ${profileName}`), out.message(` Description: ${description}`), out.message(` Credentials: ${hasCredentials ? "\u2705 Configured" : "\u274C Missing"}`), out.message("");
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
success: !0,
|
|
66
|
+
data: { profiles }
|
|
67
|
+
};
|
|
68
|
+
} catch (error) {
|
|
69
|
+
return logger.error("Failed to list profiles", { error }), { success: !1, error: `Failed to list profiles: ${error}` };
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
async function deleteProfile(profileName, out, prm) {
|
|
73
|
+
try {
|
|
74
|
+
if (profileName === "default")
|
|
75
|
+
return { success: !1, error: "Cannot delete the default profile" };
|
|
76
|
+
if (!await profileManager.hasProfile(profileName))
|
|
77
|
+
return { success: !1, error: `Profile '${profileName}' not found` };
|
|
78
|
+
if (!await prm.confirm(
|
|
79
|
+
`Are you sure you want to delete profile '${profileName}'?`,
|
|
80
|
+
!1
|
|
81
|
+
))
|
|
82
|
+
throw new UserCancellationError("Profile deletion cancelled");
|
|
83
|
+
return await profileManager.deleteProfile(profileName), out.success(`Profile '${profileName}' deleted successfully`), {
|
|
84
|
+
success: !0,
|
|
85
|
+
data: {
|
|
86
|
+
profile: profileName,
|
|
87
|
+
message: "Profile deleted successfully"
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
} catch (error) {
|
|
91
|
+
if (error instanceof UserCancellationError)
|
|
92
|
+
throw error;
|
|
93
|
+
return logger.error(`Failed to delete profile: ${profileName}`, { error }), { success: !1, error: `Failed to delete profile: ${error}` };
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
async function configureCommand(options, out, prm) {
|
|
97
|
+
return logger.info("Configure command executed", { options }), options.list ? await listProfiles(out) : typeof options.delete == "string" ? await deleteProfile(options.delete, out, prm) : options.delete && options.profile ? await deleteProfile(options.profile, out, prm) : options.delete ? { success: !1, error: "Please provide a profile name via --delete <name> or --profile <name>." } : options.profile ? await setupProfile(options.profile, out, prm) : await setupProfile("default", out, prm);
|
|
98
|
+
}
|
|
99
|
+
async function setupConfigureCommand(args) {
|
|
100
|
+
let [options] = args, ctx = await createCliExecutionContext({ outputMode: "rich" }), out = resolveOutput(ctx), prm = resolvePrompt(ctx), result = await configureCommand(options, out, prm);
|
|
101
|
+
if (!result.success)
|
|
102
|
+
throw new Error(result.error || "Configure operation failed");
|
|
103
|
+
}
|
|
104
|
+
export {
|
|
105
|
+
setupConfigureCommand
|
|
106
|
+
};
|
|
107
|
+
//# sourceMappingURL=configure-D722JQOD.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/utils/messages.ts", "../src/commands/configure.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * User-facing messages and notifications for the OpenPackage CLI\n */\n\n/**\n * API key signup message\n * Displayed when prompting users to obtain an API key\n */\nexport const API_KEY_SIGNUP_MESSAGE = '\uD83D\uDCA1 Obtain an API key by signing up at \\x1b[4mhttps://openpackage.dev\\x1b[0m';\n\n/**\n * Display the API key signup message to the console\n */\nexport function showApiKeySignupMessage(): void {\n console.log(API_KEY_SIGNUP_MESSAGE);\n}\n", "import { CommandResult } from '@opkg/core/types/index.js';\nimport { profileManager } from '@opkg/core/core/profiles.js';\nimport { ensureOpenPackageDirectories } from '@opkg/core/core/directory.js';\nimport { logger } from '@opkg/core/utils/logger.js';\nimport { UserCancellationError } from '@opkg/core/utils/errors.js';\nimport { API_KEY_SIGNUP_MESSAGE } from '../utils/messages.js';\nimport { createCliExecutionContext } from '../cli/context.js';\nimport { resolveOutput, resolvePrompt } from '@opkg/core/core/ports/resolve.js';\nimport type { OutputPort } from '@opkg/core/core/ports/output.js';\nimport type { PromptPort } from '@opkg/core/core/ports/prompt.js';\n\n/**\n * Configure command implementation for profile management\n */\n\ninterface ConfigureOptions {\n profile?: string;\n list?: boolean;\n delete?: string | boolean;\n}\n\n/**\n * Interactive profile setup\n */\nasync function setupProfile(profileName: string, out: OutputPort, prm: PromptPort): Promise<CommandResult> {\n try {\n logger.info(`Setting up profile: ${profileName}`);\n\n // Ensure directories exist\n await ensureOpenPackageDirectories();\n\n out.info(API_KEY_SIGNUP_MESSAGE);\n\n // Prompt for API key\n const apiKey = await prm.text(`Enter API key for profile '${profileName}':`, {\n validate: (value: string) => value.length > 0 ? true : 'API key is required'\n });\n\n const description = await prm.text(`Enter description for profile '${profileName}' (optional):`, {\n initial: profileName === 'default' ? 'Default profile' : ''\n });\n\n if (!apiKey) {\n throw new UserCancellationError('Profile setup cancelled');\n }\n\n // Set profile configuration\n await profileManager.setProfile(profileName, {\n description: description || undefined\n });\n\n // Set profile credentials\n await profileManager.setProfileCredentials(profileName, {\n api_key: apiKey\n });\n\n out.success(`Profile '${profileName}' configured successfully`);\n \n if (profileName === 'default') {\n out.message('');\n out.info('You can now use remote registry features with this profile.');\n } else {\n out.message('');\n out.info(`You can now use remote registry features with --profile ${profileName}`);\n }\n\n return {\n success: true,\n data: {\n profile: profileName,\n message: 'Profile configured successfully'\n }\n };\n } catch (error) {\n if (error instanceof UserCancellationError) {\n throw error; // Re-throw to be handled by withErrorHandling\n }\n logger.error(`Failed to setup profile: ${profileName}`, { error });\n return { success: false, error: `Failed to setup profile: ${error}` };\n }\n}\n\n/**\n * List all profiles\n */\nasync function listProfiles(out: OutputPort): Promise<CommandResult> {\n try {\n const profiles = await profileManager.listProfiles();\n \n if (profiles.length === 0) {\n out.info('No profiles configured.');\n out.message('');\n out.info('To create a profile, run:');\n out.info(' opkg configure');\n out.info(' opkg configure --profile <name>');\n return { success: true, data: { profiles: [] } };\n }\n\n out.info('Configured profiles:');\n out.message('');\n\n for (const profileName of profiles) {\n const profile = await profileManager.getProfile(profileName);\n const hasCredentials = !!profile?.credentials?.api_key;\n const description = profile?.config?.description || '(no description)';\n \n out.message(` ${profileName}`);\n out.message(` Description: ${description}`);\n out.message(` Credentials: ${hasCredentials ? '\\u2705 Configured' : '\\u274C Missing'}`);\n out.message('');\n }\n\n return {\n success: true,\n data: { profiles }\n };\n } catch (error) {\n logger.error('Failed to list profiles', { error });\n return { success: false, error: `Failed to list profiles: ${error}` };\n }\n}\n\n/**\n * Delete a profile\n */\nasync function deleteProfile(profileName: string, out: OutputPort, prm: PromptPort): Promise<CommandResult> {\n try {\n if (profileName === 'default') {\n return { success: false, error: 'Cannot delete the default profile' };\n }\n\n const exists = await profileManager.hasProfile(profileName);\n if (!exists) {\n return { success: false, error: `Profile '${profileName}' not found` };\n }\n\n // Confirm deletion\n const confirmed = await prm.confirm(\n `Are you sure you want to delete profile '${profileName}'?`,\n false\n );\n\n if (!confirmed) {\n throw new UserCancellationError('Profile deletion cancelled');\n }\n\n await profileManager.deleteProfile(profileName);\n out.success(`Profile '${profileName}' deleted successfully`);\n\n return {\n success: true,\n data: {\n profile: profileName,\n message: 'Profile deleted successfully'\n }\n };\n } catch (error) {\n if (error instanceof UserCancellationError) {\n throw error; // Re-throw to be handled by withErrorHandling\n }\n logger.error(`Failed to delete profile: ${profileName}`, { error });\n return { success: false, error: `Failed to delete profile: ${error}` };\n }\n}\n\n\n/**\n * Main configure command implementation\n */\nasync function configureCommand(options: ConfigureOptions, out: OutputPort, prm: PromptPort): Promise<CommandResult> {\n logger.info('Configure command executed', { options });\n\n // List profiles\n if (options.list) {\n return await listProfiles(out);\n }\n\n // Delete profile\n if (typeof options.delete === 'string') {\n return await deleteProfile(options.delete, out, prm);\n }\n if (options.delete && options.profile) {\n // Backward compatibility: allow --delete with --profile <name>\n return await deleteProfile(options.profile, out, prm);\n }\n if (options.delete) {\n return { success: false, error: 'Please provide a profile name via --delete <name> or --profile <name>.' };\n }\n\n // Setup default profile (default behavior)\n if (!options.profile) {\n return await setupProfile('default', out, prm);\n }\n\n // Setup profile\n return await setupProfile(options.profile, out, prm);\n}\n\n/**\n * Setup the configure command\n */\nexport async function setupConfigureCommand(args: any[]): Promise<void> {\n const [options] = args as [ConfigureOptions];\n const ctx = await createCliExecutionContext({ outputMode: 'rich' });\n const out = resolveOutput(ctx);\n const prm = resolvePrompt(ctx);\n const result = await configureCommand(options, out, prm);\n if (!result.success) {\n throw new Error(result.error || 'Configure operation failed');\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAQO,IAAM,yBAAyB;;;ACgBtC,eAA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