@metabase/cli 0.3.0-alpha.extract-api-client.e9b2dd5 → 0.3.1-alpha.support-worktrees.b634907
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{add-collection-B3Ty8SzB.mjs → add-collection-CxzzDG4z.mjs} +6 -5
- package/dist/{alert-DT-ee7yf.mjs → alert-CQ7Az16h.mjs} +7 -7
- package/dist/{alerts-Bf2RH_p_.mjs → alerts-DmwyyBfW.mjs} +7 -6
- package/dist/{append-DFzQRPMd.mjs → append-B0avMkvW.mjs} +6 -4
- package/dist/{archive-Cd29QC0c.mjs → archive-BPSNe0Ul.mjs} +4 -3
- package/dist/{archive-Dr9Xnx_Z.mjs → archive-BQ50OZ7y.mjs} +6 -5
- package/dist/{archive-B6eXiyER.mjs → archive-BVblae-p.mjs} +4 -3
- package/dist/{archive-C7w49Grr.mjs → archive-BZEu6UfT.mjs} +6 -5
- package/dist/{archive-lQqs13Uz.mjs → archive-CMTHh4-w.mjs} +4 -3
- package/dist/archive-CqOKKrb2.mjs +38 -0
- package/dist/{archive-CwAdlv63.mjs → archive-Cvrkz8F8.mjs} +5 -4
- package/dist/archive-DCjdICg7.mjs +38 -0
- package/dist/{archive-4tmm946K.mjs → archive-DCyeRNfV.mjs} +4 -3
- package/dist/{archive-gid9Y09v.mjs → archive-DFofUIEC.mjs} +4 -3
- package/dist/{archive-ByvA49Kz.mjs → archive-THcEfy9B.mjs} +5 -4
- package/dist/{auth-Dltxua89.mjs → auth-BEEkuu4J.mjs} +5 -5
- package/dist/{body-Cur4NJt9.mjs → body-DxRSAMNC.mjs} +1 -1
- package/dist/branch-BSeGrtP7.mjs +28 -0
- package/dist/{branches-DchlyU0i.mjs → branches-CmWc8NyL.mjs} +4 -3
- package/dist/{cancel-BMQa5R1Z.mjs → cancel-DrQqmxvn.mjs} +4 -3
- package/dist/cancel-task-BMQXtjW5.mjs +34 -0
- package/dist/{card-zyUkr2nS.mjs → card-BEeafd4Y.mjs} +1 -1
- package/dist/{card-DZxRmver.mjs → card-CrBGUkGQ.mjs} +1 -0
- package/dist/card-RlzLDB2z.mjs +24 -0
- package/dist/{cards-SccWvRQD.mjs → cards-M_6X8wCI.mjs} +7 -6
- package/dist/cli.mjs +142 -46
- package/dist/{client-BqhzKdLM.mjs → client-DYD8WZYy.mjs} +241 -75
- package/dist/collection-Bhe20ckt.mjs +20 -0
- package/dist/{collection-CfulNRBG.mjs → collection-BxE7OzcQ.mjs} +6 -3
- package/dist/{collection-CGoVLvcD.mjs → collection-CJHqsFKP.mjs} +1 -1
- package/dist/{collection-namespace-GwydWBF3.mjs → collection-namespace-CEoQ7G08.mjs} +1 -1
- package/dist/content-translation-BrHOrmj9.mjs +5 -0
- package/dist/content-translation-C8MlXPOF.mjs +12 -0
- package/dist/{create-BOLwWt8Q.mjs → create-BA_tTDEk.mjs} +5 -4
- package/dist/{create-DF4QtgDL.mjs → create-BLWwN0uw.mjs} +5 -4
- package/dist/{create-DV-Ln5Mo.mjs → create-BqpkCjx4.mjs} +4 -3
- package/dist/{create-BNQ_DytP.mjs → create-BupBEwR2.mjs} +12 -7
- package/dist/{create-C79vErX0.mjs → create-ByuJ6T4k.mjs} +7 -6
- package/dist/{create-Beh-2uoN.mjs → create-C2XFfbjx.mjs} +4 -3
- package/dist/{create-CCh_LyW9.mjs → create-C7iooS6W.mjs} +14 -8
- package/dist/{create-CAWytBE5.mjs → create-CJ7Am4Gc.mjs} +5 -4
- package/dist/{create-DJmXXQoq.mjs → create-CY-SzM66.mjs} +16 -11
- package/dist/{create-CD008jdE.mjs → create-CoubLR5o.mjs} +8 -7
- package/dist/{create-CAQV2g6V.mjs → create-D0anrINz.mjs} +14 -9
- package/dist/create-DwrhcI8r2.mjs +144 -0
- package/dist/create-branch-B3BMpF1g.mjs +49 -0
- package/dist/{create-i14Wv3Tj.mjs → create-hTc131aX.mjs} +4 -3
- package/dist/{create-tQbnuz-I.mjs → create-ldrghMd1.mjs} +4 -3
- package/dist/{create-CHQx7jq4.mjs → create-myI6doga.mjs} +5 -4
- package/dist/{create-zeveFdnd.mjs → create-z-oMrlfT.mjs} +5 -4
- package/dist/{csv-B2Jgb1GM.mjs → csv-DBNzJiWK.mjs} +6 -4
- package/dist/{current-task-MpBFGttd.mjs → current-task-YzemU0Ic.mjs} +12 -7
- package/dist/{dashboard-BHJBoaG7.mjs → dashboard-B1mpfCq_.mjs} +10 -10
- package/dist/{dashboard-CsIFFpzK.mjs → dashboard-BlbNszi8.mjs} +1 -1
- package/dist/{dashboard-BCpSq_G-.mjs → dashboard-CKUR8ZpQ.mjs} +1 -0
- package/dist/{db-DsfojyeH.mjs → db-1tLH3nYI.mjs} +7 -7
- package/dist/{delete-DFmX7jTp.mjs → delete-CD_-B4Kq.mjs} +5 -4
- package/dist/{delete-BApOjQvl.mjs → delete-CpKH5ia4.mjs} +5 -4
- package/dist/delete-D_OgiI4v.mjs +86 -0
- package/dist/{delete-Ob06PPie.mjs → delete-DjAUp9mk.mjs} +5 -4
- package/dist/{delete-Ck0q4Dzp.mjs → delete-QNgBV6eS.mjs} +10 -5
- package/dist/{delete-B8e01xAG.mjs → delete-eAUB7p-f.mjs} +10 -5
- package/dist/{delete-runtime-D74s6vhu.mjs → delete-runtime-b2_ZMSjj.mjs} +1 -1
- package/dist/{delete-table-DuyhGrvA.mjs → delete-table-DamlxnSO.mjs} +10 -5
- package/dist/dependencies-DEx0BsZ3.mjs +41 -0
- package/dist/dirty-dC1-Ud0G.mjs +40 -0
- package/dist/document-DOJbBWLF.mjs +19 -0
- package/dist/download-C4v7u-AV.mjs +29 -0
- package/dist/{eid-WTZmDdsr.mjs → eid-CP35PdEF.mjs} +4 -3
- package/dist/{events-Bn7jh5lP.mjs → events-DmbzKIh_.mjs} +5 -4
- package/dist/{export-BjfoZRDJ.mjs → export-i8D6laBG.mjs} +25 -12
- package/dist/export-preflight-B5MvYhm3.mjs +67 -0
- package/dist/{field-Zau6Hc6X.mjs → field-BKn9bt7I.mjs} +5 -5
- package/dist/{fields-CBBa-Prp.mjs → fields-8_p81BqN.mjs} +5 -4
- package/dist/{get-DdsoHaKH.mjs → get-B0g6VMBC.mjs} +4 -3
- package/dist/{get-DRvsATp-.mjs → get-BBOfshz1.mjs} +4 -3
- package/dist/{get-CDMGbgrh.mjs → get-BHGgXqUq.mjs} +4 -3
- package/dist/{get-Dn9ZiSZr.mjs → get-BbHPFNqr.mjs} +4 -3
- package/dist/{get-CnbUCzDM.mjs → get-Bds6Izxk.mjs} +4 -3
- package/dist/{get-B7sMgsFs.mjs → get-BvW21ujw.mjs} +4 -3
- package/dist/{get-Dmj9Ygz1.mjs → get-CAzSP-7o.mjs} +4 -3
- package/dist/{get-CvI--9S_.mjs → get-CNEQK0-9.mjs} +5 -4
- package/dist/{get-D_h-G9bn.mjs → get-CPTbySa7.mjs} +4 -3
- package/dist/{get-B_xdF1kq.mjs → get-CWf46UFu.mjs} +6 -5
- package/dist/get-Cfagmy1i.mjs +42 -0
- package/dist/{get-CDJFVvhj.mjs → get-DFkbi5L3.mjs} +3 -2
- package/dist/{get-DYO1kywc.mjs → get-DnCE7K0y.mjs} +5 -4
- package/dist/{get-DY03Azx9.mjs → get-DvLuY5Xu.mjs} +17 -9
- package/dist/get-DwdMvWXU.mjs +44 -0
- package/dist/{get-DmpB6J9g.mjs → get-N4dOaTsp.mjs} +5 -4
- package/dist/get-jV8G90Zy.mjs +42 -0
- package/dist/get-mGEv-kag.mjs +33 -0
- package/dist/{get-run-Cnux9ln0.mjs → get-run-4Ng8_awa.mjs} +6 -5
- package/dist/{get-Bz99dAxK.mjs → get-vrccOMBk.mjs} +6 -5
- package/dist/{get-00lyLv6R.mjs → get-vvs0qzzM.mjs} +4 -3
- package/dist/{git-sync-BDnxPrqU.mjs → git-sync-DLzJrdMi.mjs} +22 -3
- package/dist/git-sync-DjoaNmRM.mjs +29 -0
- package/dist/{git-sync-DxD_ng48.mjs → git-sync-LQIVMNxO.mjs} +31 -2
- package/dist/{group-DBM87IgC.mjs → group-YN6jj2AN.mjs} +3 -2
- package/dist/{has-remote-changes-C684Redh.mjs → has-remote-changes-BXPGI9xG.mjs} +14 -6
- package/dist/{import-Rmmttboo.mjs → import-BoxOkA-G.mjs} +28 -11
- package/dist/{is-dirty-DYeJYhBz.mjs → is-dirty-Cwxq4_gd.mjs} +15 -6
- package/dist/{items-CQlPXBXE.mjs → items-Cv6iAzrI.mjs} +17 -9
- package/dist/{library-Bsm5KsFF.mjs → library-CRaOhJnj.mjs} +5 -5
- package/dist/{library-ClLgrAXy.mjs → library-Cfw6eF35.mjs} +1 -1
- package/dist/{library-DfYAT2Ep.mjs → library-fhVn1KDC.mjs} +1 -1
- package/dist/{list-CMpoc2TN.mjs → list--2T-GUEF.mjs} +5 -4
- package/dist/list-5Iojbr_p.mjs +37 -0
- package/dist/{list-CNUiF8Z7.mjs → list-9uvk9dIA.mjs} +4 -3
- package/dist/{list-CQwOgIlj.mjs → list-BBp9XjYs.mjs} +4 -3
- package/dist/list-BD4onDqO.mjs +37 -0
- package/dist/{list-BpFp9Wre.mjs → list-BLJkJp5a.mjs} +4 -3
- package/dist/{list-BtmsNOEn.mjs → list-BwkfWtP2.mjs} +4 -3
- package/dist/list-C2yL7-CH.mjs +45 -0
- package/dist/{list-BP3MPq-M.mjs → list-C8J3n8B8.mjs} +4 -3
- package/dist/list-CbbKip6U.mjs +32 -0
- package/dist/{list-UhpKG6_m.mjs → list-CtZAu4im.mjs} +5 -4
- package/dist/{list-BtkWNtvY.mjs → list-DOZNpX4b.mjs} +5 -4
- package/dist/{list-DF2rvoO1.mjs → list-DOaWCx8S.mjs} +18 -9
- package/dist/list-Dg2XeDON.mjs +47 -0
- package/dist/{list-CQDprvW0.mjs → list-DhrapAcy.mjs} +6 -5
- package/dist/{list-BzVTHOoH.mjs → list-L2U1l6R4.mjs} +4 -3
- package/dist/{list-DE9FM957.mjs → list-WSJLnunb.mjs} +4 -3
- package/dist/{list-B4hJuMhA.mjs → list-oAAgU5uE.mjs} +16 -9
- package/dist/{list-B8nAGwP4.mjs → list-tutXEQRW.mjs} +5 -4
- package/dist/{login-CGHeSjlP.mjs → login-DqWRF3Og.mjs} +6 -5
- package/dist/{logout-DAxOlbv4.mjs → logout-ChCz1bkf.mjs} +3 -2
- package/dist/{measure-BsYv0p26.mjs → measure-C5dIdFj1.mjs} +6 -6
- package/dist/{network-error-CEb9ymDW.mjs → network-error-D6CiOEBw.mjs} +10 -2
- package/dist/{notification-Fcq1fIPw.mjs → notification-DVrLkjFT.mjs} +1 -1
- package/dist/{parameter-values-CJTdqd8c.mjs → parameter-values-Dy4cBs5y.mjs} +4 -3
- package/dist/{parse-id-C_jmKFaa.mjs → parse-id-DDCn3VXx.mjs} +1 -1
- package/dist/{parse-ref-ibKVB0J4.mjs → parse-ref-Wv21Roup.mjs} +6 -2
- package/dist/{path-B5gHvrYL.mjs → path-IYhuzjQV.mjs} +5 -4
- package/dist/pin-BuZ_kg-u.mjs +62 -0
- package/dist/{preflight-YpPQo-sa.mjs → preflight-HLUVr2Yf.mjs} +2 -2
- package/dist/{publish-DijrxaCW.mjs → publish-CMkCSt8i.mjs} +5 -4
- package/dist/{pulse-DhG6I9mI.mjs → pulse-a-83M4DV.mjs} +1 -1
- package/dist/{query-BbqECzmF.mjs → query-Bka77J62.mjs} +9 -13
- package/dist/{query-result-DBDwk8TS.mjs → query-result-E4Q-Gra6.mjs} +1 -1
- package/dist/{query-Dc__-KJH.mjs → query-tWQAV9pb.mjs} +8 -7
- package/dist/{remove-collection-BOnxYvhj.mjs → remove-collection-BV9wRQZD.mjs} +6 -5
- package/dist/{render-CI93iP0I.mjs → render-DHjCcUXn.mjs} +7 -1
- package/dist/{replace-Cq4CxVa-.mjs → replace-mt47dlRV.mjs} +6 -4
- package/dist/{rescan-values-Dr_j416g.mjs → rescan-values-6cRjcpTs.mjs} +4 -3
- package/dist/{run-DdGJ544X.mjs → run-BmGmC-GQ.mjs} +4 -3
- package/dist/{run-C3DkS6NP.mjs → run-DI_pDxji.mjs} +6 -5
- package/dist/{runs-CUNWiidL.mjs → runs-9Fu0mug5.mjs} +7 -6
- package/dist/{runtime-DiKyBxOw.mjs → runtime-CNAZ_FuR.mjs} +104 -9
- package/dist/{schema-tables-CV386fnC.mjs → schema-tables-CLG0mtQb.mjs} +5 -4
- package/dist/{schemas-DM-UqZBQ.mjs → schemas-Cm5NWy59.mjs} +5 -4
- package/dist/scope-DsGuWG5w.mjs +11 -0
- package/dist/{search-DmGScXs8.mjs → search-CljYyf2F.mjs} +14 -8
- package/dist/{segment-BzUGM2Fr.mjs → segment-IRzlQggt.mjs} +6 -6
- package/dist/{selectors-DGDn0Hto.mjs → selectors-D4iOP5uB.mjs} +2 -2
- package/dist/{send-CVxxEpDB.mjs → send-D7DBnQbu.mjs} +4 -3
- package/dist/{set-DFolTjbd.mjs → set-DKN8fuC6.mjs} +4 -3
- package/dist/{set-active-BD8L1lPX.mjs → set-active-CkE0Eiqh.mjs} +3 -2
- package/dist/{setting-DyhaeICs.mjs → setting-CN4l8N-b.mjs} +4 -4
- package/dist/{setup-BbDQN8fe.mjs → setup-BpTptmdO.mjs} +4 -3
- package/dist/{skills--vK6J-e4.mjs → skills-BSAiLI3Z.mjs} +3 -3
- package/dist/{skills-DTCrMcix.mjs → skills-hVKSOCUf.mjs} +1 -1
- package/dist/{snippet-CyKAgIZl.mjs → snippet-BxgvQ09J.mjs} +5 -2
- package/dist/{snippet-oJLaYW9V.mjs → snippet-DecHB4Dn.mjs} +1 -1
- package/dist/snippet-LlHz3FdJ.mjs +19 -0
- package/dist/{stash-D0S4JmAz.mjs → stash-DJs6A6BA.mjs} +7 -6
- package/dist/{status-BhswxJL1.mjs → status-DtwBDRtc.mjs} +44 -16
- package/dist/{status-hL1am-HV.mjs → status-N_2EaWb7.mjs} +16 -7
- package/dist/stream-McixcoUl.mjs +7 -0
- package/dist/{subscription-_d5fB45F.mjs → subscription-BnGDp1oy.mjs} +6 -6
- package/dist/{subscriptions-s4TF6Ax3.mjs → subscriptions-BfFwV__x.mjs} +7 -6
- package/dist/{summary-CsPvcUwW.mjs → summary-CHiq-4mz.mjs} +4 -3
- package/dist/{sync-schema-DaZ_MV-u.mjs → sync-schema-DhnM-rpm.mjs} +5 -4
- package/dist/{sync-task-BACcrs0i.mjs → sync-task-G1K47Nvn.mjs} +1 -1
- package/dist/{table-DYoC1kPn.mjs → table-BQaiCSNS.mjs} +5 -5
- package/dist/timeline-C2VW0Ph6.mjs +21 -0
- package/dist/{timeline-event-CNQdCTDg.mjs → timeline-event-B7H1y8s8.mjs} +6 -6
- package/dist/{transform-D3QX0jxA.mjs → transform-BvOEn41C.mjs} +4 -1
- package/dist/{transform-DoTyyXAu.mjs → transform-CiDOJGBW.mjs} +2 -2
- package/dist/transform-DAf0Y02t.mjs +28 -0
- package/dist/transform-job-ntiT5Rrh.mjs +22 -0
- package/dist/{transform-tag-Dmb4u3-Q.mjs → transform-tag-DiXWRCQG.mjs} +1 -1
- package/dist/{transform-tag-_tgwlsdB.mjs → transform-tag-Dip51YBa.mjs} +5 -5
- package/dist/{transform-tag-CcElGp3C.mjs → transform-tag-jBVd6wXd.mjs} +9 -4
- package/dist/{transforms-oU4zizbO.mjs → transforms-C-jYgS6z.mjs} +7 -6
- package/dist/tree-DtyJhD54.mjs +36 -0
- package/dist/unpin-DxbXmLtW.mjs +45 -0
- package/dist/{unpublish-BUl9RU5C.mjs → unpublish-BokbnLng.mjs} +4 -3
- package/dist/{update-BiFDBcEH.mjs → update-AZSXMJqu.mjs} +14 -8
- package/dist/{update-BCS5FxKr.mjs → update-B9DcRSBQ.mjs} +18 -12
- package/dist/{update-bD_Jh5-s.mjs → update-BBQInyiJ.mjs} +6 -5
- package/dist/{update-BzMDeZiU.mjs → update-BCGE5UYC.mjs} +6 -5
- package/dist/{update-tX9mKBN_.mjs → update-BErxnZrj.mjs} +9 -8
- package/dist/{update-C4YJQFDS.mjs → update-BRXKLeJH.mjs} +5 -4
- package/dist/{update-cYkvbqK8.mjs → update-Bc8s1TL1.mjs} +5 -4
- package/dist/{update-BZPllQoR.mjs → update-C4PbAYgW.mjs} +5 -4
- package/dist/{update-CVPAwJaH.mjs → update-CKL2FtoX.mjs} +6 -5
- package/dist/{update-Nfi44RrE.mjs → update-CPEU8ZEu.mjs} +6 -5
- package/dist/{update-CmDTljK-.mjs → update-CfQoYVTc.mjs} +5 -4
- package/dist/{update-CO4m4wH3.mjs → update-CpLEEbiJ.mjs} +8 -7
- package/dist/{update-D-NE60AV.mjs → update-D9OTkZhw.mjs} +5 -4
- package/dist/{update-dashcard-C3TuYO_k.mjs → update-dashcard-St-dGcE3.mjs} +7 -6
- package/dist/{update-CHNSUHK4.mjs → update-e7lyQPxq.mjs} +14 -8
- package/dist/{update-CvOO8TED.mjs → update-rkbpH0lF.mjs} +5 -4
- package/dist/{upgrade-DXMV4AyP.mjs → upgrade-CUoRHfVg.mjs} +4 -3
- package/dist/upload-BPd1Uzxc.mjs +43 -0
- package/dist/upload-C3z5ZaXA.mjs +24 -0
- package/dist/{upload-CH632qW6.mjs → upload-CD555ui1.mjs} +1 -24
- package/dist/upload-Dc3QLhZw.mjs +13 -0
- package/dist/{uuid-BJkDWj9p.mjs → uuid-CFN8LIkP.mjs} +3 -2
- package/dist/{validate-query-DaGYSmpQ.mjs → validate-query-Chc43ezW.mjs} +1 -1
- package/dist/{values-Dxf1JEoA.mjs → values-BL_U-Zdw.mjs} +4 -3
- package/dist/{verify-K96rItG5.mjs → verify-DnBaRmkI.mjs} +3 -3
- package/dist/{wait-flags-DWEF9tX4.mjs → wait-flags-DzytMEG8.mjs} +2 -2
- package/dist/{wait-DoMDH226.mjs → wait-mPoOZxrw.mjs} +12 -7
- package/dist/{window-BkvrP0gB.mjs → window-DSb1tqSe.mjs} +1 -1
- package/dist/worktree-ChdDlG3Q.mjs +25 -0
- package/dist/worktree-DC0kTxxQ.mjs +20 -0
- package/dist/worktree-xAro1xAB.mjs +24 -0
- package/package.json +1 -1
- package/skill-data/core/SKILL.md +17 -14
- package/skill-data/dashboard/SKILL.md +2 -2
- package/skill-data/git-sync/SKILL.md +91 -1
- package/skill-data/transform/SKILL.md +9 -1
- package/dist/archive-BxNPHxOY.mjs +0 -32
- package/dist/archive-ChORH5JH.mjs +0 -32
- package/dist/cancel-task-C5CU1pxU.mjs +0 -28
- package/dist/card-CHI2bmds.mjs +0 -24
- package/dist/collection-CY0AB99E.mjs +0 -20
- package/dist/create-branch-CYo6jZth.mjs +0 -35
- package/dist/dependencies-Bj3QrGIm.mjs +0 -36
- package/dist/dirty-DNYoM6Bp.mjs +0 -31
- package/dist/document-BbskZPTT.mjs +0 -19
- package/dist/get-ByBOq30r.mjs +0 -31
- package/dist/get-C2-Q3iQ5.mjs +0 -31
- package/dist/get-DkWO0EI0.mjs +0 -36
- package/dist/git-sync-MQQYRYLg.mjs +0 -28
- package/dist/list-BOET6zhP.mjs +0 -36
- package/dist/list-C5Zs8nrb.mjs +0 -28
- package/dist/list-CKK-s3Ty.mjs +0 -28
- package/dist/list-DMKDsBRd.mjs +0 -38
- package/dist/snippet-DRwKb2x7.mjs +0 -19
- package/dist/timeline-xlDbEKWg.mjs +0 -21
- package/dist/transform-Bs0EWijQ.mjs +0 -28
- package/dist/transform-job-BcLChRup.mjs +0 -22
- package/dist/tree-CH-f3bjP.mjs +0 -27
- package/dist/upload-Dey_8rLf.mjs +0 -13
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { H as profileFlag, R as connectionFlags, V as outputFlags, a as parseWorktreeRef, p as renderSummary } from "./cli.mjs";
|
|
2
|
+
import { B as ProfilePin, I as writeProfileWorktree, a as findWorktree, n as WORKTREE_REF_LABEL, t as defineMetabaseCommand } from "./runtime-CNAZ_FuR.mjs";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
//#region src/commands/worktree/pin.ts
|
|
5
|
+
const WorktreePinResult = z.object({
|
|
6
|
+
profile: z.string(),
|
|
7
|
+
worktree: ProfilePin
|
|
8
|
+
});
|
|
9
|
+
const worktreePinView = {
|
|
10
|
+
compactPick: WorktreePinResult,
|
|
11
|
+
tableColumns: [{
|
|
12
|
+
key: "profile",
|
|
13
|
+
label: "Profile"
|
|
14
|
+
}, {
|
|
15
|
+
key: "worktree",
|
|
16
|
+
label: "Worktree",
|
|
17
|
+
format: (value) => renderPin(value)
|
|
18
|
+
}]
|
|
19
|
+
};
|
|
20
|
+
function renderPin(value) {
|
|
21
|
+
const parsed = ProfilePin.safeParse(value);
|
|
22
|
+
return parsed.success ? `${parsed.data.id} (${parsed.data.branch})` : "—";
|
|
23
|
+
}
|
|
24
|
+
var pin_default = defineMetabaseCommand({
|
|
25
|
+
meta: {
|
|
26
|
+
name: "pin",
|
|
27
|
+
description: "Confine every command run under this profile to one worktree"
|
|
28
|
+
},
|
|
29
|
+
capabilities: {
|
|
30
|
+
minVersion: 64,
|
|
31
|
+
tokenFeature: "remote_sync"
|
|
32
|
+
},
|
|
33
|
+
worktree: "any",
|
|
34
|
+
details: "The pin is a lock, not a default: while it stands, --worktree and MB_WORKTREE may only re-state it, and commands that change main-app content refuse to run.",
|
|
35
|
+
args: {
|
|
36
|
+
...outputFlags,
|
|
37
|
+
...profileFlag,
|
|
38
|
+
...connectionFlags,
|
|
39
|
+
ref: {
|
|
40
|
+
type: "positional",
|
|
41
|
+
description: "Worktree id or branch name",
|
|
42
|
+
required: true
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
outputSchema: WorktreePinResult,
|
|
46
|
+
examples: ["mb worktree pin 3", "mb worktree pin feat/transforms --profile agent"],
|
|
47
|
+
async run({ args, ctx, getClient, getResolvedConfig }) {
|
|
48
|
+
const worktree = await findWorktree(parseWorktreeRef(args.ref, WORKTREE_REF_LABEL), await getClient());
|
|
49
|
+
const profile = (await getResolvedConfig()).profile;
|
|
50
|
+
const pin = {
|
|
51
|
+
id: worktree.id,
|
|
52
|
+
branch: worktree.branch
|
|
53
|
+
};
|
|
54
|
+
await writeProfileWorktree(profile, pin);
|
|
55
|
+
renderSummary({
|
|
56
|
+
profile,
|
|
57
|
+
worktree: pin
|
|
58
|
+
}, worktreePinView, `Pinned profile "${profile}" to worktree ${pin.id} (${pin.branch}).`, ctx);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
//#endregion
|
|
62
|
+
export { pin_default as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as ConfigError, o as MetabaseError } from "./predicates-Bkm2IoeX.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { i as chainRequestFailure } from "./network-error-
|
|
2
|
+
import { m as writeJson } from "./cli.mjs";
|
|
3
|
+
import { i as chainRequestFailure } from "./network-error-D6CiOEBw.mjs";
|
|
4
4
|
import "./validate-BWchyW0V.mjs";
|
|
5
5
|
//#region src/commands/dashboard/preflight.ts
|
|
6
6
|
async function preflightDashcardCardReferences(client, dashcards) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { f as errorMessage } from "./predicates-Bkm2IoeX.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { t as defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import { i as CollectionCompact, r as Collection } from "./collection-
|
|
5
|
-
import { n as tableSelectorFlags, t as parseTableSelectors } from "./selectors-
|
|
2
|
+
import { H as profileFlag, R as connectionFlags, T as warn, V as outputFlags, p as renderSummary } from "./cli.mjs";
|
|
3
|
+
import { t as defineMetabaseCommand } from "./runtime-CNAZ_FuR.mjs";
|
|
4
|
+
import { i as CollectionCompact, r as Collection } from "./collection-BxE7OzcQ.mjs";
|
|
5
|
+
import { n as tableSelectorFlags, t as parseTableSelectors } from "./selectors-D4iOP5uB.mjs";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
//#region src/commands/git-sync/sync-scope.ts
|
|
8
8
|
function isOutsideSyncScope(collection) {
|
|
@@ -41,6 +41,7 @@ var publish_default = defineMetabaseCommand({
|
|
|
41
41
|
minVersion: 59,
|
|
42
42
|
tokenFeature: "library"
|
|
43
43
|
},
|
|
44
|
+
worktree: "main-only",
|
|
44
45
|
args: {
|
|
45
46
|
...outputFlags,
|
|
46
47
|
...profileFlag,
|
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
import { i as ConfigError } from "./predicates-Bkm2IoeX.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as parseId } from "./parse-id-
|
|
5
|
-
import { h as parseJson } from "./network-error-
|
|
6
|
-
import { i as CardExportFormat, o as CardQueryResult } from "./card-
|
|
7
|
-
import { t as cardQueryView } from "./card-
|
|
8
|
-
import { t as formatQueryResult } from "./query-result-
|
|
2
|
+
import { H as profileFlag, R as connectionFlags, V as outputFlags, p as renderSummary } from "./cli.mjs";
|
|
3
|
+
import { q as parseOptionalInteger, t as defineMetabaseCommand } from "./runtime-CNAZ_FuR.mjs";
|
|
4
|
+
import { t as parseId } from "./parse-id-DDCn3VXx.mjs";
|
|
5
|
+
import { h as parseJson } from "./network-error-D6CiOEBw.mjs";
|
|
6
|
+
import { i as CardExportFormat, o as CardQueryResult } from "./card-CrBGUkGQ.mjs";
|
|
7
|
+
import { t as cardQueryView } from "./card-BEeafd4Y.mjs";
|
|
8
|
+
import { t as formatQueryResult } from "./query-result-E4Q-Gra6.mjs";
|
|
9
|
+
import { t as pipeToStdout } from "./stream-McixcoUl.mjs";
|
|
9
10
|
import { z } from "zod";
|
|
10
|
-
import { Writable } from "node:stream";
|
|
11
|
-
//#region src/output/stream.ts
|
|
12
|
-
async function pipeToStdout(stream) {
|
|
13
|
-
await stream.pipeTo(Writable.toWeb(process.stdout));
|
|
14
|
-
}
|
|
15
|
-
//#endregion
|
|
16
11
|
//#region src/commands/card/query.ts
|
|
17
12
|
const QueryParameters = z.array(z.unknown());
|
|
18
13
|
var query_default = defineMetabaseCommand({
|
|
@@ -21,6 +16,7 @@ var query_default = defineMetabaseCommand({
|
|
|
21
16
|
description: "Run a saved card and return results (json envelope, or stream CSV/JSON/XLSX via --export-format)"
|
|
22
17
|
},
|
|
23
18
|
capabilities: { minVersion: 58 },
|
|
19
|
+
worktree: "any",
|
|
24
20
|
args: {
|
|
25
21
|
...outputFlags,
|
|
26
22
|
...profileFlag,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _ as formatScalar, v as renderRows } from "./cli.mjs";
|
|
2
2
|
//#region src/output/query-result.ts
|
|
3
3
|
function formatQueryResult(result) {
|
|
4
4
|
if (result.status !== "completed" || result.data === void 0) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { i as ConfigError } from "./predicates-Bkm2IoeX.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { t as defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import { t as readBody } from "./body-
|
|
2
|
+
import { H as profileFlag, R as connectionFlags, V as outputFlags, m as writeJson, p as renderSummary } from "./cli.mjs";
|
|
3
|
+
import { t as defineMetabaseCommand } from "./runtime-CNAZ_FuR.mjs";
|
|
4
|
+
import { t as readBody } from "./body-DxRSAMNC.mjs";
|
|
5
5
|
import { t as bodyInputFlags } from "./body-flags-AqKpN01Y.mjs";
|
|
6
|
-
import { o as CardQueryResult } from "./card-
|
|
7
|
-
import { t as cardQueryView } from "./card-
|
|
6
|
+
import { o as CardQueryResult } from "./card-CrBGUkGQ.mjs";
|
|
7
|
+
import { t as cardQueryView } from "./card-BEeafd4Y.mjs";
|
|
8
8
|
import { i as validateQuery, n as getQuerySchemaBundle, r as isMbql5Query, t as assertNotLegacyEnvelopeWrappingMbql5 } from "./validate-BWchyW0V.mjs";
|
|
9
|
-
import { o as skipValidateFlag } from "./validate-query-
|
|
10
|
-
import { t as formatQueryResult } from "./query-result-
|
|
9
|
+
import { o as skipValidateFlag } from "./validate-query-Chc43ezW.mjs";
|
|
10
|
+
import { t as formatQueryResult } from "./query-result-E4Q-Gra6.mjs";
|
|
11
11
|
import { z } from "zod";
|
|
12
12
|
//#region src/commands/query.ts
|
|
13
13
|
const QueryBody = z.unknown().describe("MBQL 5, legacy MBQL, or native query body — full MBQL 5 schema: mb query --print-schema");
|
|
@@ -22,6 +22,7 @@ var query_default = defineMetabaseCommand({
|
|
|
22
22
|
purpose: "body shape, clause rules, and the dry-run loop"
|
|
23
23
|
}],
|
|
24
24
|
capabilities: { minVersion: 58 },
|
|
25
|
+
worktree: "any",
|
|
25
26
|
args: {
|
|
26
27
|
...outputFlags,
|
|
27
28
|
...profileFlag,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as defineMetabaseCommand } from "./runtime-
|
|
3
|
-
import { t as parseId } from "./parse-id-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { H as profileFlag, R as connectionFlags, V as outputFlags, p as renderSummary } from "./cli.mjs";
|
|
2
|
+
import { t as defineMetabaseCommand } from "./runtime-CNAZ_FuR.mjs";
|
|
3
|
+
import { t as parseId } from "./parse-id-DDCn3VXx.mjs";
|
|
4
|
+
import { c as SyncSettingsUpdateResult } from "./git-sync-DLzJrdMi.mjs";
|
|
5
|
+
import { s as syncSettingsUpdateView } from "./git-sync-LQIVMNxO.mjs";
|
|
6
6
|
//#region src/commands/git-sync/remove-collection.ts
|
|
7
7
|
var remove_collection_default = defineMetabaseCommand({
|
|
8
8
|
meta: {
|
|
@@ -13,6 +13,7 @@ var remove_collection_default = defineMetabaseCommand({
|
|
|
13
13
|
minVersion: 60,
|
|
14
14
|
tokenFeature: "remote_sync"
|
|
15
15
|
},
|
|
16
|
+
worktree: "main-only",
|
|
16
17
|
args: {
|
|
17
18
|
...outputFlags,
|
|
18
19
|
...profileFlag,
|
|
@@ -28,8 +28,14 @@ function renderAuthMethod(value) {
|
|
|
28
28
|
function renderVersionTag(value) {
|
|
29
29
|
return pickString(value, "tag") ?? "—";
|
|
30
30
|
}
|
|
31
|
+
function renderWorktreePin(value) {
|
|
32
|
+
const id = pickProperty(value, "id");
|
|
33
|
+
const branch = pickString(value, "branch");
|
|
34
|
+
if (typeof id !== "number" || branch === null) return "—";
|
|
35
|
+
return `${id} (${branch})`;
|
|
36
|
+
}
|
|
31
37
|
function renderTimestamp(value) {
|
|
32
38
|
return typeof value === "string" ? value : "—";
|
|
33
39
|
}
|
|
34
40
|
//#endregion
|
|
35
|
-
export { renderVersionTag as a, renderUserRole as i, renderTimestamp as n, renderUserName as r, renderAuthMethod as t };
|
|
41
|
+
export { renderVersionTag as a, renderUserRole as i, renderTimestamp as n, renderWorktreePin as o, renderUserName as r, renderAuthMethod as t };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as defineMetabaseCommand } from "./runtime-
|
|
3
|
-
import { t as parseId } from "./parse-id-
|
|
1
|
+
import { H as profileFlag, R as connectionFlags, V as outputFlags, p as renderSummary } from "./cli.mjs";
|
|
2
|
+
import { t as defineMetabaseCommand } from "./runtime-CNAZ_FuR.mjs";
|
|
3
|
+
import { t as parseId } from "./parse-id-DDCn3VXx.mjs";
|
|
4
4
|
import { n as UploadUpdateResult } from "./upload-DAtxBBms.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { n as requireUploadFilePath, t as readCsvFile } from "./upload-CD555ui1.mjs";
|
|
6
|
+
import { n as uploadUpdateResultView } from "./upload-C3z5ZaXA.mjs";
|
|
6
7
|
//#region src/commands/upload/replace.ts
|
|
7
8
|
var replace_default = defineMetabaseCommand({
|
|
8
9
|
meta: {
|
|
@@ -11,6 +12,7 @@ var replace_default = defineMetabaseCommand({
|
|
|
11
12
|
},
|
|
12
13
|
details: "Replaces the contents of the table with the given id with the rows of the CSV. The table must have been created by a CSV upload and the CSV columns must match.",
|
|
13
14
|
capabilities: { minVersion: 58 },
|
|
15
|
+
worktree: "main-only",
|
|
14
16
|
args: {
|
|
15
17
|
...outputFlags,
|
|
16
18
|
...profileFlag,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as defineMetabaseCommand } from "./runtime-
|
|
3
|
-
import { t as parseId } from "./parse-id-
|
|
1
|
+
import { H as profileFlag, R as connectionFlags, V as outputFlags, p as renderSummary } from "./cli.mjs";
|
|
2
|
+
import { t as defineMetabaseCommand } from "./runtime-CNAZ_FuR.mjs";
|
|
3
|
+
import { t as parseId } from "./parse-id-DDCn3VXx.mjs";
|
|
4
4
|
import { a as DatabaseSyncResult } from "./database-C8G6ZKG0.mjs";
|
|
5
5
|
import { t as databaseSyncResultView } from "./database-B19qlLKZ.mjs";
|
|
6
6
|
//#region src/commands/db/rescan-values.ts
|
|
@@ -10,6 +10,7 @@ var rescan_values_default = defineMetabaseCommand({
|
|
|
10
10
|
description: "Trigger a rescan of cached field values for a database"
|
|
11
11
|
},
|
|
12
12
|
capabilities: { minVersion: 58 },
|
|
13
|
+
worktree: "main-only",
|
|
13
14
|
args: {
|
|
14
15
|
...outputFlags,
|
|
15
16
|
...profileFlag,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as defineMetabaseCommand } from "./runtime-
|
|
3
|
-
import { t as parseId } from "./parse-id-
|
|
1
|
+
import { H as profileFlag, R as connectionFlags, V as outputFlags, p as renderSummary } from "./cli.mjs";
|
|
2
|
+
import { t as defineMetabaseCommand } from "./runtime-CNAZ_FuR.mjs";
|
|
3
|
+
import { t as parseId } from "./parse-id-DDCn3VXx.mjs";
|
|
4
4
|
import { a as TransformJobRunResult } from "./transform-job-DRrK28IH.mjs";
|
|
5
5
|
//#region src/commands/transform-job/run.ts
|
|
6
6
|
const transformJobRunResultView = {
|
|
@@ -20,6 +20,7 @@ var run_default = defineMetabaseCommand({
|
|
|
20
20
|
},
|
|
21
21
|
details: "Starts the job and returns immediately. The job runs every transform carrying one of its tags, plus those transforms' dependencies. Dependencies that are already fresh are skipped by default; --force-refresh re-runs the whole plan including them.",
|
|
22
22
|
capabilities: { minVersion: 59 },
|
|
23
|
+
worktree: "main-only",
|
|
23
24
|
args: {
|
|
24
25
|
...outputFlags,
|
|
25
26
|
...profileFlag,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as defineMetabaseCommand } from "./runtime-
|
|
3
|
-
import { t as parseId } from "./parse-id-
|
|
4
|
-
import { l as isTransformRunFailed, o as TransformRunResult } from "./transform-
|
|
5
|
-
import { i as waitFlags, n as parseWaitFlags } from "./wait-flags-
|
|
1
|
+
import { H as profileFlag, R as connectionFlags, V as outputFlags, p as renderSummary } from "./cli.mjs";
|
|
2
|
+
import { t as defineMetabaseCommand } from "./runtime-CNAZ_FuR.mjs";
|
|
3
|
+
import { t as parseId } from "./parse-id-DDCn3VXx.mjs";
|
|
4
|
+
import { l as isTransformRunFailed, o as TransformRunResult } from "./transform-BvOEn41C.mjs";
|
|
5
|
+
import { i as waitFlags, n as parseWaitFlags } from "./wait-flags-DzytMEG8.mjs";
|
|
6
6
|
//#region src/commands/transform/run.ts
|
|
7
7
|
const transformRunResultView = {
|
|
8
8
|
compactPick: TransformRunResult,
|
|
@@ -28,6 +28,7 @@ var run_default = defineMetabaseCommand({
|
|
|
28
28
|
},
|
|
29
29
|
details: "Starts a run and returns immediately. --wait polls the run to a terminal status. --sync additionally waits until the run's output table is registered and returns its `target_table_id`, so you can build MBQL cards against it — the run registers the table itself, so no separate `db sync-schema` is needed; --sync implies waiting for the run.",
|
|
30
30
|
capabilities: { minVersion: 59 },
|
|
31
|
+
worktree: "main-only",
|
|
31
32
|
args: {
|
|
32
33
|
...outputFlags,
|
|
33
34
|
...profileFlag,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as defineMetabaseCommand } from "./runtime-
|
|
3
|
-
import { t as parseId } from "./parse-id-
|
|
4
|
-
import { t as collectForOutput } from "./window-
|
|
5
|
-
import { a as TransformRunCompact } from "./transform-
|
|
6
|
-
import { t as transformRunView } from "./transform-
|
|
1
|
+
import { G as listEnvelopeSchema, H as profileFlag, R as connectionFlags, V as outputFlags, f as renderList, z as listFlags } from "./cli.mjs";
|
|
2
|
+
import { t as defineMetabaseCommand } from "./runtime-CNAZ_FuR.mjs";
|
|
3
|
+
import { t as parseId } from "./parse-id-DDCn3VXx.mjs";
|
|
4
|
+
import { t as collectForOutput } from "./window-DSb1tqSe.mjs";
|
|
5
|
+
import { a as TransformRunCompact } from "./transform-BvOEn41C.mjs";
|
|
6
|
+
import { t as transformRunView } from "./transform-CiDOJGBW.mjs";
|
|
7
7
|
//#region src/commands/transform/runs.ts
|
|
8
8
|
const TransformRunListEnvelope = listEnvelopeSchema(TransformRunCompact);
|
|
9
9
|
var runs_default = defineMetabaseCommand({
|
|
@@ -12,6 +12,7 @@ var runs_default = defineMetabaseCommand({
|
|
|
12
12
|
description: "List recent transform runs"
|
|
13
13
|
},
|
|
14
14
|
capabilities: { minVersion: 59 },
|
|
15
|
+
worktree: "any",
|
|
15
16
|
args: {
|
|
16
17
|
...outputFlags,
|
|
17
18
|
...listFlags,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { d as ValidationError, f as errorMessage, i as ConfigError, l as TimeoutError, o as MetabaseError, p as isFileNotFoundError } from "./predicates-Bkm2IoeX.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { _ as parseJsonResult, a as isRetryableStatus, c as normalizeUrl, f as isOAuthExpired, m as JSON_CONTENT_TYPE, o as assertEndpointOrigin, p as oauthCredentialFromTokens, r as HttpError, t as buildNetworkError } from "./network-error-
|
|
2
|
+
import { A as ENV_SKIP_PREFLIGHT, D as ENV_DISABLE_KEYRING, E as ENV_API_KEY, F as setMetabaseAugment, J as toAliasArray, K as flagConsumesValue, L as version, M as ENV_WORKTREE, N as consumeLegacyEnvWarnings, P as readEnv, T as warn, c as checkCapabilities, i as mainOnlyRefusal, j as ENV_URL, l as mergeCapabilities, n as interruptSignal, o as resolveScopeSource, q as normalizeFlag, r as formatWorktreeRef, s as BASELINE_CAPABILITIES, t as readVerbChain, u as reportError } from "./cli.mjs";
|
|
3
|
+
import { _ as parseJsonResult, a as isRetryableStatus, c as normalizeUrl, f as isOAuthExpired, m as JSON_CONTENT_TYPE, o as assertEndpointOrigin, p as oauthCredentialFromTokens, r as HttpError, t as buildNetworkError } from "./network-error-D6CiOEBw.mjs";
|
|
4
4
|
import { defineCommand } from "citty";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { parse } from "semver";
|
|
@@ -100,13 +100,18 @@ const ProfileOAuth = z.object({
|
|
|
100
100
|
clientId: z.string()
|
|
101
101
|
}).loose();
|
|
102
102
|
const ProfileAuthMethod = z.enum(["oauth", "apiKey"]);
|
|
103
|
+
const ProfilePin = z.object({
|
|
104
|
+
id: z.number().int().positive(),
|
|
105
|
+
branch: z.string()
|
|
106
|
+
});
|
|
103
107
|
const ProfileRecord = z.object({
|
|
104
108
|
name: z.string(),
|
|
105
109
|
url: z.string(),
|
|
106
110
|
apiKey: z.string().nullable(),
|
|
107
111
|
oauth: ProfileOAuth.nullable().default(null),
|
|
108
112
|
lastProbe: ProfileLastProbe.nullable(),
|
|
109
|
-
lastFailure: ProfileLastFailure.nullable()
|
|
113
|
+
lastFailure: ProfileLastFailure.nullable(),
|
|
114
|
+
worktree: ProfilePin.nullable().default(null)
|
|
110
115
|
}).loose();
|
|
111
116
|
const ProfilesFile = z.object({ profiles: z.array(ProfileRecord) }).loose();
|
|
112
117
|
function profileAuthMethod(record) {
|
|
@@ -326,7 +331,8 @@ async function writeProfile(profile, name = DEFAULT_PROFILE) {
|
|
|
326
331
|
apiKey: inlineApiKey,
|
|
327
332
|
oauth: null,
|
|
328
333
|
lastProbe: null,
|
|
329
|
-
lastFailure: null
|
|
334
|
+
lastFailure: null,
|
|
335
|
+
worktree: null
|
|
330
336
|
} : {
|
|
331
337
|
...existing,
|
|
332
338
|
url: profile.url,
|
|
@@ -357,7 +363,8 @@ async function writeOAuthProfile(url, credential, name = DEFAULT_PROFILE) {
|
|
|
357
363
|
apiKey: null,
|
|
358
364
|
oauth,
|
|
359
365
|
lastProbe: null,
|
|
360
|
-
lastFailure: null
|
|
366
|
+
lastFailure: null,
|
|
367
|
+
worktree: null
|
|
361
368
|
} : {
|
|
362
369
|
...existing,
|
|
363
370
|
url,
|
|
@@ -408,6 +415,18 @@ async function writeProbeFailure(name, input) {
|
|
|
408
415
|
});
|
|
409
416
|
return failure;
|
|
410
417
|
}
|
|
418
|
+
async function writeProfileWorktree(name, pin) {
|
|
419
|
+
const file = await readProfilesFile();
|
|
420
|
+
if (findRecord(file, name) === null) throw new ConfigError(`no such profile "${name}"; run \`mb auth login --profile ${name}\` first`);
|
|
421
|
+
const profiles = file.profiles.map((entry) => entry.name === name ? {
|
|
422
|
+
...entry,
|
|
423
|
+
worktree: pin
|
|
424
|
+
} : entry);
|
|
425
|
+
await writeProfilesFile({
|
|
426
|
+
...file,
|
|
427
|
+
profiles
|
|
428
|
+
});
|
|
429
|
+
}
|
|
411
430
|
async function clearProfile(name = DEFAULT_PROFILE) {
|
|
412
431
|
const file = await readProfilesFile();
|
|
413
432
|
const existing = findRecord(file, name);
|
|
@@ -800,6 +819,7 @@ function resolveCommonFlags(args, options = {}) {
|
|
|
800
819
|
url: args.url,
|
|
801
820
|
apiKey: args.apiKey,
|
|
802
821
|
profile: args.profile,
|
|
822
|
+
worktree: args.worktree,
|
|
803
823
|
skipPreflight: args.skipPreflight === true
|
|
804
824
|
};
|
|
805
825
|
}
|
|
@@ -873,7 +893,43 @@ function flagCandidates(token) {
|
|
|
873
893
|
return candidates;
|
|
874
894
|
}
|
|
875
895
|
//#endregion
|
|
896
|
+
//#region src/commands/worktree-scope.ts
|
|
897
|
+
const WORKTREE_REF_LABEL = "worktree ref";
|
|
898
|
+
const WORKTREE_SCOPE_DETAIL = "Pass --worktree <id|branch> (or set MB_WORKTREE, or pin the profile with `mb worktree pin`) to operate inside a git-sync worktree.";
|
|
899
|
+
async function findWorktree(ref, mb) {
|
|
900
|
+
if (ref.kind === "id") return mb.gitSync.getWorktree(ref.id);
|
|
901
|
+
const { data } = await mb.gitSync.worktrees();
|
|
902
|
+
const match = data.find((worktree) => worktree.branch === ref.branch);
|
|
903
|
+
if (match === void 0) throw new ConfigError(`worktree ${formatWorktreeRef(ref)} not found; run \`mb worktree list\``);
|
|
904
|
+
return match;
|
|
905
|
+
}
|
|
906
|
+
async function resolveWorktreeScope(source, mb) {
|
|
907
|
+
if (source.scope !== null) return source.scope;
|
|
908
|
+
const worktree = await findWorktree(source.ref, mb);
|
|
909
|
+
return {
|
|
910
|
+
id: worktree.id,
|
|
911
|
+
branch: worktree.branch
|
|
912
|
+
};
|
|
913
|
+
}
|
|
914
|
+
function scopeQuery(scope) {
|
|
915
|
+
return { "worktree-id": scope === null ? void 0 : scope.id };
|
|
916
|
+
}
|
|
917
|
+
function assertInWorktree(kind, id, worktreeId, scope) {
|
|
918
|
+
if (scope === null || worktreeId === scope.id) return;
|
|
919
|
+
throw new ConfigError(`${kind} ${id} is not in worktree ${scope.id} (${scope.branch}); refusing to touch main-app content`);
|
|
920
|
+
}
|
|
921
|
+
function scopeBody(body, scope) {
|
|
922
|
+
if (scope === null) return body;
|
|
923
|
+
const stated = body.worktree_id;
|
|
924
|
+
if (stated !== void 0 && stated !== null && stated !== scope.id) throw new ConfigError(`body names worktree_id ${stated}, but the active scope is worktree ${scope.id} (${scope.branch})`);
|
|
925
|
+
return {
|
|
926
|
+
...body,
|
|
927
|
+
worktree_id: scope.id
|
|
928
|
+
};
|
|
929
|
+
}
|
|
930
|
+
//#endregion
|
|
876
931
|
//#region src/commands/runtime.ts
|
|
932
|
+
const UNNAMED_COMMAND = "this command";
|
|
877
933
|
function defineMetabaseCommand(def) {
|
|
878
934
|
const required = def.capabilities === null ? null : mergeCapabilities(def.capabilities);
|
|
879
935
|
const cmd = defineCommand({
|
|
@@ -900,7 +956,7 @@ function defineMetabaseCommand(def) {
|
|
|
900
956
|
const rawGetClient = async () => {
|
|
901
957
|
if (cachedClient === null) {
|
|
902
958
|
const resolved = await getResolvedConfig();
|
|
903
|
-
const { createClient } = await import("./client-
|
|
959
|
+
const { createClient } = await import("./client-DYD8WZYy.mjs").then((n) => n.t);
|
|
904
960
|
cachedClient = createClient({
|
|
905
961
|
url: resolved.url,
|
|
906
962
|
credential: resolved.credential
|
|
@@ -914,18 +970,35 @@ function defineMetabaseCommand(def) {
|
|
|
914
970
|
return cachedClient;
|
|
915
971
|
};
|
|
916
972
|
const enforcePreflight = createPreflightEnforcer(required, getServerInfo, ctx.skipPreflight);
|
|
973
|
+
let cachedScopeSource = null;
|
|
974
|
+
const getScopeSource = () => {
|
|
975
|
+
if (cachedScopeSource === null) cachedScopeSource = loadScopeSource(ctx, getResolvedConfig);
|
|
976
|
+
return cachedScopeSource;
|
|
977
|
+
};
|
|
978
|
+
const enforceWorktreePolicy = async () => {
|
|
979
|
+
const source = await getScopeSource();
|
|
980
|
+
if (source === null || def.worktree !== "main-only") return;
|
|
981
|
+
throw new ConfigError(mainOnlyRefusal(commandName(def.meta), source));
|
|
982
|
+
};
|
|
917
983
|
const getClient = async () => {
|
|
918
984
|
const client = await rawGetClient();
|
|
985
|
+
await enforceWorktreePolicy();
|
|
919
986
|
await enforcePreflight();
|
|
920
987
|
return client;
|
|
921
988
|
};
|
|
989
|
+
let cachedScope = null;
|
|
990
|
+
const getWorktree = () => {
|
|
991
|
+
if (cachedScope === null) cachedScope = loadWorktreeScope(getScopeSource, getClient);
|
|
992
|
+
return cachedScope;
|
|
993
|
+
};
|
|
922
994
|
try {
|
|
923
995
|
await def.run({
|
|
924
996
|
args,
|
|
925
997
|
ctx,
|
|
926
998
|
getClient,
|
|
927
999
|
getResolvedConfig,
|
|
928
|
-
getServerInfo
|
|
1000
|
+
getServerInfo,
|
|
1001
|
+
getWorktree
|
|
929
1002
|
});
|
|
930
1003
|
} finally {
|
|
931
1004
|
emitPendingWarnings();
|
|
@@ -941,10 +1014,31 @@ function defineMetabaseCommand(def) {
|
|
|
941
1014
|
skills: def.skills ?? [],
|
|
942
1015
|
inputSchema: def.inputSchema ?? null,
|
|
943
1016
|
outputSchema: def.outputSchema ?? null,
|
|
944
|
-
capabilities: required
|
|
1017
|
+
capabilities: required,
|
|
1018
|
+
worktree: def.worktree
|
|
945
1019
|
});
|
|
946
1020
|
return cmd;
|
|
947
1021
|
}
|
|
1022
|
+
function commandName(meta) {
|
|
1023
|
+
const chain = readVerbChain();
|
|
1024
|
+
if (chain !== null) return chain;
|
|
1025
|
+
return typeof meta.name === "string" && meta.name !== "" ? meta.name : UNNAMED_COMMAND;
|
|
1026
|
+
}
|
|
1027
|
+
async function loadScopeSource(ctx, getResolvedConfig) {
|
|
1028
|
+
const resolved = await getResolvedConfig();
|
|
1029
|
+
const record = await readProfileRecord(resolved.profile);
|
|
1030
|
+
return resolveScopeSource({
|
|
1031
|
+
profile: resolved.profile,
|
|
1032
|
+
flag: ctx.worktree,
|
|
1033
|
+
env: readEnv(ENV_WORKTREE),
|
|
1034
|
+
pin: record?.worktree ?? null
|
|
1035
|
+
});
|
|
1036
|
+
}
|
|
1037
|
+
async function loadWorktreeScope(getScopeSource, getClient) {
|
|
1038
|
+
const source = await getScopeSource();
|
|
1039
|
+
if (source === null) return null;
|
|
1040
|
+
return resolveWorktreeScope(source, await getClient());
|
|
1041
|
+
}
|
|
948
1042
|
function emitPendingWarnings() {
|
|
949
1043
|
for (const message of consumeLegacyEnvWarnings()) warn(message);
|
|
950
1044
|
const legacy = consumeLegacyStorageWarning();
|
|
@@ -991,6 +1085,7 @@ function pickCommonArgs(args) {
|
|
|
991
1085
|
if (typeof args["limit"] === "string") out.limit = args["limit"];
|
|
992
1086
|
if (typeof args["offset"] === "string") out.offset = args["offset"];
|
|
993
1087
|
if (typeof args["profile"] === "string") out.profile = args["profile"];
|
|
1088
|
+
if (typeof args["worktree"] === "string") out.worktree = args["worktree"];
|
|
994
1089
|
if (typeof args["url"] === "string") out.url = args["url"];
|
|
995
1090
|
if (typeof args["apiKey"] === "string") out.apiKey = args["apiKey"];
|
|
996
1091
|
if (typeof args["skipPreflight"] === "boolean") out.skipPreflight = args["skipPreflight"];
|
|
@@ -1004,4 +1099,4 @@ function buildConfigFlags(ctx) {
|
|
|
1004
1099
|
return flags;
|
|
1005
1100
|
}
|
|
1006
1101
|
//#endregion
|
|
1007
|
-
export {
|
|
1102
|
+
export { readProfileRecord as A, ProfilePin as B, DEFAULT_PROFILE as C, keyringFallbackWarning as D, consumeKeyringDowngradeWarning as E, writeProfile as F, TokenFeatures as G, ParsedVersion as H, writeProfileWorktree as I, parseInteger as K, ProbedUser as L, writeOAuthProfile as M, writeProbeFailure as N, listProfileRecords as O, writeProbeResult as P, ProfileAuthMethod as R, tryDiscoverMetadata as S, consumeKeychainResidualWarning as T, tryParseTag as U, profileAuthMethod as V, SessionProperties as W, revokeOAuthCredential as _, findWorktree as a, exchangeCode as b, parseCsv as c, createCredentialRefresher as d, explicitProfileName as f, USER_AGENT as g, OAUTH_CLIENT_NAME as h, assertInWorktree as i, resolveRecordCredential as j, readProfileCredential as k, parseEnum as l, resolveProfileName as m, WORKTREE_REF_LABEL as n, scopeBody as o, readEnvCredentials as p, parseOptionalInteger as q, WORKTREE_SCOPE_DETAIL as r, scopeQuery as s, defineMetabaseCommand as t, parseEnumCsv as u, OAUTH_SCOPE as v, clearProfile as w, registerClient as x, discoverMetadata as y, ProfileLastFailure as z };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as defineMetabaseCommand } from "./runtime-
|
|
3
|
-
import { t as parseId } from "./parse-id-
|
|
4
|
-
import { n as windowList } from "./window-
|
|
1
|
+
import { G as listEnvelopeSchema, H as profileFlag, R as connectionFlags, V as outputFlags, f as renderList, z as listFlags } from "./cli.mjs";
|
|
2
|
+
import { t as defineMetabaseCommand } from "./runtime-CNAZ_FuR.mjs";
|
|
3
|
+
import { t as parseId } from "./parse-id-DDCn3VXx.mjs";
|
|
4
|
+
import { n as windowList } from "./window-DSb1tqSe.mjs";
|
|
5
5
|
import { n as TableCompact } from "./table-CeeTJgQb.mjs";
|
|
6
6
|
import { t as tableView } from "./table-CsIJNPFf.mjs";
|
|
7
7
|
//#region src/commands/db/schema-tables.ts
|
|
@@ -12,6 +12,7 @@ var schema_tables_default = defineMetabaseCommand({
|
|
|
12
12
|
description: "List tables in a database schema"
|
|
13
13
|
},
|
|
14
14
|
capabilities: { minVersion: 58 },
|
|
15
|
+
worktree: "any",
|
|
15
16
|
args: {
|
|
16
17
|
...outputFlags,
|
|
17
18
|
...listFlags,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as defineMetabaseCommand } from "./runtime-
|
|
3
|
-
import { t as parseId } from "./parse-id-
|
|
4
|
-
import { n as windowList } from "./window-
|
|
1
|
+
import { G as listEnvelopeSchema, H as profileFlag, R as connectionFlags, V as outputFlags, f as renderList, z as listFlags } from "./cli.mjs";
|
|
2
|
+
import { t as defineMetabaseCommand } from "./runtime-CNAZ_FuR.mjs";
|
|
3
|
+
import { t as parseId } from "./parse-id-DDCn3VXx.mjs";
|
|
4
|
+
import { n as windowList } from "./window-DSb1tqSe.mjs";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
//#region src/commands/db/schemas.ts
|
|
7
7
|
const SchemaName = z.object({ name: z.string() });
|
|
@@ -19,6 +19,7 @@ var schemas_default = defineMetabaseCommand({
|
|
|
19
19
|
description: "List schemas in a database"
|
|
20
20
|
},
|
|
21
21
|
capabilities: { minVersion: 58 },
|
|
22
|
+
worktree: "any",
|
|
22
23
|
args: {
|
|
23
24
|
...outputFlags,
|
|
24
25
|
...listFlags,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { i as assertInWorktree } from "./runtime-CNAZ_FuR.mjs";
|
|
2
|
+
//#region src/commands/transform-tag/scope.ts
|
|
3
|
+
const TRANSFORM_TAG_KIND = "transform tag";
|
|
4
|
+
async function assertTagInWorktree(client, id, scope) {
|
|
5
|
+
if (scope === null) return;
|
|
6
|
+
const { data } = await client.transformTag.list({ "worktree-id": scope.id });
|
|
7
|
+
const match = data.find((tag) => tag.id === id);
|
|
8
|
+
assertInWorktree(TRANSFORM_TAG_KIND, id, match === void 0 ? null : match.worktree_id, scope);
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { assertTagInWorktree as t };
|