@inkeep/open-knowledge 0.4.0-beta.9 → 0.4.0
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/assets/skills/open-knowledge/SKILL.md +1 -1
- package/dist/cli.mjs +31 -31
- package/dist/constants-BWv15Llm.mjs +2 -0
- package/dist/dist-Bu-MwAbD.mjs +1 -0
- package/dist/{dist-ou5qina8.mjs → dist-D4M20vXU.mjs} +13 -12
- package/dist/{dist-DVM7wH81.mjs → dist-DfIz2LcA.mjs} +15 -15
- package/dist/index.mjs +1 -1
- package/dist/{init-Cw_1Ay1s.mjs → init-B1cOyI0L.mjs} +5 -5
- package/dist/init-DssmNpgE.mjs +1 -0
- package/dist/loader-CHkc9V89.mjs +1 -0
- package/dist/{loader-BTC8Ab4t.mjs → loader-CWaAs1JL.mjs} +3 -3
- package/dist/open-browser-BOeCxs2W.mjs +2 -0
- package/dist/preview-BjoTulUl.mjs +1 -0
- package/dist/{preview-IJyfVtTf.mjs → preview-FAMk9J0z.mjs} +2 -2
- package/dist/public/assets/{ActivityModeContent-1ymqlcHI.js → ActivityModeContent-BS-F_q5b.js} +2 -2
- package/dist/public/assets/DocumentContext-CKgn09Wu.js +37 -0
- package/dist/public/assets/{GraphPanel-DdVygxYk.js → GraphPanel-BYxZ6mOr.js} +2 -2
- package/dist/public/assets/McpConsentDialogBody-C-eBNOSk.js +1 -0
- package/dist/public/assets/{OutlinePanel-dumodx-h.js → OutlinePanel-B1VwD6nb.js} +1 -1
- package/dist/public/assets/SettingsPane-Byz_-VcF.js +11 -0
- package/dist/public/assets/{SourceEditor-CR_7DOAH.js → SourceEditor-CF1C1jlS.js} +2 -2
- package/dist/public/assets/{_baseFor-CX8dsZbW.js → _baseFor-DTImdh6y.js} +1 -1
- package/dist/public/assets/{agent-presence-Ds2n3U5P.js → agent-presence-CaGG2gp7.js} +1 -1
- package/dist/public/assets/{arc-BL_OKZmE.js → arc-VNWsD8TF.js} +1 -1
- package/dist/public/assets/architecture-YZFGNWBL-BiRl99NU.js +1 -0
- package/dist/public/assets/{architectureDiagram-Q4EWVU46-BKKtWWhU.js → architectureDiagram-Q4EWVU46-C7EDVIb_.js} +1 -1
- package/dist/public/assets/{blockDiagram-DXYQGD6D-fzO4vZye.js → blockDiagram-DXYQGD6D-RDoQRmSR.js} +1 -1
- package/dist/public/assets/button-qDXa0MxS.js +1 -0
- package/dist/public/assets/{c4Diagram-AHTNJAMY-BkXqEjiP.js → c4Diagram-AHTNJAMY-DWq5v6f-.js} +1 -1
- package/dist/public/assets/channel-C0UNiHDS.js +1 -0
- package/dist/public/assets/checkbox-kWXLLH40.js +1 -0
- package/dist/public/assets/{chunk-2KRD3SAO-DQj0pw3H.js → chunk-2KRD3SAO-BTibUhx6.js} +1 -1
- package/dist/public/assets/{chunk-336JU56O-CBajDulv.js → chunk-336JU56O-Bm6IwRki.js} +2 -2
- package/dist/public/assets/chunk-426QAEUC-BexV_O4G.js +1 -0
- package/dist/public/assets/{chunk-4BX2VUAB-D8pbSOlJ.js → chunk-4BX2VUAB-Dzrv7xRQ.js} +1 -1
- package/dist/public/assets/{chunk-4TB4RGXK-mA6CujZO.js → chunk-4TB4RGXK-n_VCZ-Dw.js} +1 -1
- package/dist/public/assets/chunk-55IACEB6-yo8vOoww.js +1 -0
- package/dist/public/assets/{chunk-5FUZZQ4R-BVDLgFg2.js → chunk-5FUZZQ4R-CwFS-NM9.js} +1 -1
- package/dist/public/assets/{chunk-5PVQY5BW-Cxi5d3lT.js → chunk-5PVQY5BW-Cf3pEIAB.js} +1 -1
- package/dist/public/assets/{chunk-67CJDMHE-CdrAY8qZ.js → chunk-67CJDMHE-B1qjR6o5.js} +1 -1
- package/dist/public/assets/{chunk-7N4EOEYR-CJ3HBg3c.js → chunk-7N4EOEYR-9LthribN.js} +1 -1
- package/dist/public/assets/{chunk-AA7GKIK3-D0ckJAXt.js → chunk-AA7GKIK3-DFgv_Jxv.js} +1 -1
- package/dist/public/assets/{chunk-BSJP7CBP-D4bNhKd7.js → chunk-BSJP7CBP-BMfaq0VP.js} +1 -1
- package/dist/public/assets/{chunk-CIAEETIT-D1Fpp2md.js → chunk-CIAEETIT-DUfZ-zCl.js} +1 -1
- package/dist/public/assets/{chunk-EDXVE4YY-ChhT3Iyo.js → chunk-EDXVE4YY-BKbUy63F.js} +1 -1
- package/dist/public/assets/{chunk-ENJZ2VHE-Bby39so4.js → chunk-ENJZ2VHE-DIZOQmDi.js} +1 -1
- package/dist/public/assets/{chunk-FMBD7UC4-pRkDIOZn.js → chunk-FMBD7UC4-DA5iFIgZ.js} +1 -1
- package/dist/public/assets/{chunk-FOC6F5B3-BsB4oTj4.js → chunk-FOC6F5B3-DlEcGgqD.js} +1 -1
- package/dist/public/assets/{chunk-ICPOFSXX-CrnuSfeJ.js → chunk-ICPOFSXX-BDU_0nPa.js} +2 -2
- package/dist/public/assets/{chunk-K5T4RW27-CtREah_n.js → chunk-K5T4RW27-CZi_8YH2.js} +1 -1
- package/dist/public/assets/{chunk-KGLVRYIC-DtDxSfKu.js → chunk-KGLVRYIC-q8yxX2UV.js} +1 -1
- package/dist/public/assets/{chunk-LIHQZDEY-D63TRk6j.js → chunk-LIHQZDEY-BqlaDvTQ.js} +1 -1
- package/dist/public/assets/{chunk-ORNJ4GCN-Dv2PvYVu.js → chunk-ORNJ4GCN-B6A2jdfA.js} +1 -1
- package/dist/public/assets/{chunk-OYMX7WX6-BhfqKepC.js → chunk-OYMX7WX6-BtgGgZZ0.js} +1 -1
- package/dist/public/assets/chunk-QZHKN3VN-Dm2czGiD.js +1 -0
- package/dist/public/assets/{chunk-U2HBQHQK-6BAKH95D.js → chunk-U2HBQHQK-LrOM0aht.js} +1 -1
- package/dist/public/assets/{chunk-X2U36JSP-Cqpkx90-.js → chunk-X2U36JSP-CsEhwsxu.js} +1 -1
- package/dist/public/assets/{chunk-XPW4576I-DSytTnq4.js → chunk-XPW4576I-D3W7wPR1.js} +1 -1
- package/dist/public/assets/{chunk-YZCP3GAM-Dt9awjVh.js → chunk-YZCP3GAM-C2TR8l-U.js} +1 -1
- package/dist/public/assets/{chunk-ZZ45TVLE-JGFITgiO.js → chunk-ZZ45TVLE-DGa_Hgat.js} +1 -1
- package/dist/public/assets/classDiagram-6PBFFD2Q-DqMO_sxB.js +1 -0
- package/dist/public/assets/classDiagram-v2-HSJHXN6E-BbC-74zc.js +1 -0
- package/dist/public/assets/clone-DpRB82L-.js +1 -0
- package/dist/public/assets/config-validation-events-BX5T6Pv4.js +7 -0
- package/dist/public/assets/{cose-bilkent-S5V4N54A-B9nG-SHi.js → cose-bilkent-S5V4N54A-cxoevGhk.js} +1 -1
- package/dist/public/assets/{dagre-BEdPLXba.js → dagre-DoC3Vx7E.js} +1 -1
- package/dist/public/assets/{dagre-KV5264BT-DKn5nGCC.js → dagre-KV5264BT-CjRUxU3J.js} +1 -1
- package/dist/public/assets/{diagram-5BDNPKRD-BQuwYEd0.js → diagram-5BDNPKRD-DlgILr6_.js} +1 -1
- package/dist/public/assets/{diagram-G4DWMVQ6-BmzIMyV5.js → diagram-G4DWMVQ6-CA3PL8En.js} +1 -1
- package/dist/public/assets/{diagram-MMDJMWI5-CI5eJfgr.js → diagram-MMDJMWI5-DVx-bZhM.js} +1 -1
- package/dist/public/assets/{diagram-TYMM5635-Cc8TJ7v3.js → diagram-TYMM5635-DCl_Xx4h.js} +1 -1
- package/dist/public/assets/dialog-CV9Q4JrD.js +45 -0
- package/dist/public/assets/{dist-nPpvoMNC.js → dist-BEF_m-Pp.js} +1 -1
- package/dist/public/assets/{dist-BH1b1nWB.js → dist-BJPjDIRr.js} +1 -1
- package/dist/public/assets/{dist-S8LJmtzL.js → dist-Bf3rdSRu.js} +1 -1
- package/dist/public/assets/{dist-D08h1pJc.js → dist-ByDNshqn.js} +1 -1
- package/dist/public/assets/{dist-B4kUko7n.js → dist-CSfB7p8y.js} +1 -1
- package/dist/public/assets/{dist-VyzSEzD4.js → dist-DVWct0HX.js} +1 -1
- package/dist/public/assets/{dist-BOapDt7N.js → dist-Gvva1zQ6.js} +1 -1
- package/dist/public/assets/{doc-hash-Q6dTjwu5.js → doc-hash-CfmBVnag.js} +90 -90
- package/dist/public/assets/{erDiagram-SMLLAGMA-BkrhGWMT.js → erDiagram-SMLLAGMA-ChTvmoDx.js} +1 -1
- package/dist/public/assets/{flatten-UmyAv3V9.js → flatten-DXpXo4tl.js} +1 -1
- package/dist/public/assets/{flowDiagram-DWJPFMVM-qh62fanI.js → flowDiagram-DWJPFMVM-8ceKQudh.js} +1 -1
- package/dist/public/assets/{ganttDiagram-T4ZO3ILL-DXuCeCk6.js → ganttDiagram-T4ZO3ILL-uadeK_KN.js} +1 -1
- package/dist/public/assets/gitGraph-7Q5UKJZL-CN7yaTu1.js +1 -0
- package/dist/public/assets/{gitGraphDiagram-UUTBAWPF-BbcuenPj.js → gitGraphDiagram-UUTBAWPF-BcANz6_Q.js} +1 -1
- package/dist/public/assets/{graphlib-CasrTmMJ.js → graphlib-D3l3HBM4.js} +1 -1
- package/dist/public/assets/index-B4T9ZPge.js +1854 -0
- package/dist/public/assets/index-DFiz58v4.css +1 -0
- package/dist/public/assets/info-OMHHGYJF-oSrA8B1G.js +1 -0
- package/dist/public/assets/{infoDiagram-42DDH7IO-WFAMbO2S.js → infoDiagram-42DDH7IO-qKcHjiUa.js} +1 -1
- package/dist/public/assets/{isEmpty-DWJlzxR1.js → isEmpty-D9j5AQZB.js} +1 -1
- package/dist/public/assets/isSymbol-C4J31wCa.js +1 -0
- package/dist/public/assets/{ishikawaDiagram-UXIWVN3A-BJBiReWg.js → ishikawaDiagram-UXIWVN3A-DyndBZjz.js} +1 -1
- package/dist/public/assets/{journeyDiagram-VCZTEJTY-Boq77pl6.js → journeyDiagram-VCZTEJTY-CTiuXUzg.js} +1 -1
- package/dist/public/assets/{kanban-definition-6JOO6SKY-DYMSr18F.js → kanban-definition-6JOO6SKY-D03tqXqX.js} +1 -1
- package/dist/public/assets/label-BOVWulDu.js +1 -0
- package/dist/public/assets/{line-_p5Px7MV.js → line-CZuyNGqX.js} +1 -1
- package/dist/public/assets/{linear-DwuDS4qT.js → linear-CoY1VP-w.js} +1 -1
- package/dist/public/assets/{mermaid-parser.core-BcBb_Ows.js → mermaid-parser.core-D4O7MeLl.js} +2 -2
- package/dist/public/assets/{mermaid.core-ZLTnLqVQ.js → mermaid.core-4xgx5kDJ.js} +3 -3
- package/dist/public/assets/{mindmap-definition-QFDTVHPH-BSxM4djR.js → mindmap-definition-QFDTVHPH-BaMNW13B.js} +1 -1
- package/dist/public/assets/{now-BBH4UqDm.js → now-CJgVN_7h.js} +1 -1
- package/dist/public/assets/{ordinal-CeOFUmRv.js → ordinal-BZbu6HlW.js} +1 -1
- package/dist/public/assets/packet-4T2RLAQJ-N-KqWOhj.js +1 -0
- package/dist/public/assets/{panel-BgMqDESF.js → panel-BaN47PCr.js} +1 -1
- package/dist/public/assets/pie-ZZUOXDRM-BcRf7Q2g.js +1 -0
- package/dist/public/assets/{pieDiagram-DEJITSTG-CHRE_Jie.js → pieDiagram-DEJITSTG-_dBzvPAb.js} +1 -1
- package/dist/public/assets/{propagation-api-qAYD7s-v.js → propagation-api-CuTE-jIt.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-34T5L4WZ-CQkE5TwH.js → quadrantDiagram-34T5L4WZ-jnOwhGSn.js} +1 -1
- package/dist/public/assets/radar-PYXPWWZC-CqcGRFrW.js +1 -0
- package/dist/public/assets/{reduce-DotyoGA7.js → reduce-Cn1fAmcq.js} +1 -1
- package/dist/public/assets/{requirementDiagram-MS252O5E-DHK98tKS.js → requirementDiagram-MS252O5E-DpZY5MOe.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-XADWPNL6-BIXaStZh.js → sankeyDiagram-XADWPNL6-CNLrFRka.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-FGHM5R23-BCNH3kJo.js → sequenceDiagram-FGHM5R23-Cqjio9cN.js} +1 -1
- package/dist/public/assets/{src-C9jsS3p4.js → src-CVigMQ0t.js} +1 -1
- package/dist/public/assets/{stateDiagram-FHFEXIEX-BC5mjB6x.js → stateDiagram-FHFEXIEX-rE9sZdwc.js} +1 -1
- package/dist/public/assets/stateDiagram-v2-QKLJ7IA2-CrJSNsUc.js +1 -0
- package/dist/public/assets/{target-navigation-intent-BfGOumP6.js → target-navigation-intent-CNDuSbLi.js} +1 -1
- package/dist/public/assets/{telemetry-impl-CMeDUVKn.js → telemetry-impl-iq6UBtaA.js} +2 -2
- package/dist/public/assets/{timeline-definition-GMOUNBTQ-VNxUGgXp.js → timeline-definition-GMOUNBTQ-B_X3o8J_.js} +1 -1
- package/dist/public/assets/tooltip-csUfbEtd.js +1 -0
- package/dist/public/assets/treeView-SZITEDCU-B1rO_oUt.js +1 -0
- package/dist/public/assets/treemap-W4RFUUIX-DXE3h2Bn.js +1 -0
- package/dist/public/assets/{vennDiagram-DHZGUBPP-DV2Y2j0r.js → vennDiagram-DHZGUBPP-Cs25K1vw.js} +1 -1
- package/dist/public/assets/wardley-RL74JXVD-ChWi2iyS.js +1 -0
- package/dist/public/assets/{wardleyDiagram-NUSXRM2D-C1mMZ3kx.js → wardleyDiagram-NUSXRM2D-RgfpVD8G.js} +1 -1
- package/dist/public/assets/{xychartDiagram-5P7HB3ND-CxFcwN2X.js → xychartDiagram-5P7HB3ND-BrRrEDJB.js} +1 -1
- package/dist/public/index.html +20 -19
- package/dist/src-B_Vh13Py.mjs +1 -0
- package/dist/{start-BDIOjX_O.mjs → start-CSRc43Yr.mjs} +2 -2
- package/dist/start-DVUu2YvT.mjs +1 -0
- package/package.json +1 -1
- package/dist/constants-CswmjLU5.mjs +0 -2
- package/dist/dist-BToVkFhc.mjs +0 -1
- package/dist/init-C90VliDt.mjs +0 -1
- package/dist/loader-BOTBqos-.mjs +0 -1
- package/dist/open-browser-BZZK_gJj.mjs +0 -2
- package/dist/preview-CGUMKfC0.mjs +0 -1
- package/dist/public/assets/DocumentContext-bvfr7pL2.js +0 -37
- package/dist/public/assets/McpConsentDialogBody-CJwPf_uv.js +0 -1
- package/dist/public/assets/SettingsPane-CtgbQZxP.js +0 -6
- package/dist/public/assets/architecture-YZFGNWBL-DVxNz-zn.js +0 -1
- package/dist/public/assets/button-BsFpqlpT.js +0 -1
- package/dist/public/assets/channel-CR-xJel6.js +0 -1
- package/dist/public/assets/chunk-426QAEUC-BoBKbVmN.js +0 -1
- package/dist/public/assets/chunk-55IACEB6-CqVyNzhX.js +0 -1
- package/dist/public/assets/chunk-QZHKN3VN-DBRWHtgj.js +0 -1
- package/dist/public/assets/classDiagram-6PBFFD2Q-oopM_Z0m.js +0 -1
- package/dist/public/assets/classDiagram-v2-HSJHXN6E-ZAL74u9S.js +0 -1
- package/dist/public/assets/clone-C5y6xhRJ.js +0 -1
- package/dist/public/assets/config-validation-events-BvuBj41U.js +0 -1
- package/dist/public/assets/dialog-Cv1qneWl.js +0 -45
- package/dist/public/assets/gitGraph-7Q5UKJZL-CYhZlmk3.js +0 -1
- package/dist/public/assets/index-BBbaN3Kd.js +0 -1858
- package/dist/public/assets/index-DOkkqO-8.css +0 -1
- package/dist/public/assets/info-OMHHGYJF-BslcKZhH.js +0 -1
- package/dist/public/assets/isSymbol-BP7IOIqG.js +0 -1
- package/dist/public/assets/mcp-consent-store-BBTXqzE6.js +0 -1
- package/dist/public/assets/packet-4T2RLAQJ-QVnYA304.js +0 -1
- package/dist/public/assets/pie-ZZUOXDRM-C61c5byc.js +0 -1
- package/dist/public/assets/radar-PYXPWWZC-CMxjRtd8.js +0 -1
- package/dist/public/assets/stateDiagram-v2-QKLJ7IA2-B8L3BBt1.js +0 -1
- package/dist/public/assets/tooltip-CBGDOTMI.js +0 -1
- package/dist/public/assets/treeView-SZITEDCU-DfSa_Oiv.js +0 -1
- package/dist/public/assets/treemap-W4RFUUIX-Cp0s5wEq.js +0 -1
- package/dist/public/assets/wardley-RL74JXVD-CXcBKCuj.js +0 -1
- package/dist/src-DXx7F2B7.mjs +0 -1
- package/dist/start-DmOxN4Ez.mjs +0 -1
- /package/dist/public/assets/{ActivityPanelDiffView-DoHWP1ak.js → ActivityPanelDiffView-B_49ivYc.js} +0 -0
- /package/dist/public/assets/{__vite-browser-external-FEGw1XPd.js → __vite-browser-external-6Gb3h3lj.js} +0 -0
- /package/dist/public/assets/{array-X0JlPOfd.js → array-DO1uCttT.js} +0 -0
- /package/dist/public/assets/{colors-XIJoz9Bd.js → colors-BjbB2MOj.js} +0 -0
- /package/dist/public/assets/{cytoscape.esm-BkjNfcSF.js → cytoscape.esm-AyAnQ5hQ.js} +0 -0
- /package/dist/public/assets/{defaultLocale-ZxyFnXCb.js → defaultLocale-B6RGN4id.js} +0 -0
- /package/dist/public/assets/{dist-CIRuNcH5.js → dist-0bM9CqzR.js} +0 -0
- /package/dist/public/assets/{go-a33xvodr.js → go-BRhAdNMM.js} +0 -0
- /package/dist/public/assets/{init-CBj3ecIW.js → init-BmUWJJHz.js} +0 -0
- /package/dist/public/assets/{isObjectLike-AdQZ65l0.js → isObjectLike-CjYO71dq.js} +0 -0
- /package/dist/public/assets/{katex-qwlL5fSd.js → katex-DBuiuHex.js} +0 -0
- /package/dist/public/assets/{min-HKuGSUqa.js → min-CwjSmrJ6.js} +0 -0
- /package/dist/public/assets/{path-rUlDLHdA.js → path-CoPyR7c2.js} +0 -0
- /package/dist/public/assets/{pdf-a35ddrIO.js → pdf-DaFpV-4n.js} +0 -0
- /package/dist/public/assets/{pdf.worker-CM-zAFN-.js → pdf.worker-Cq62cyp3.js} +0 -0
- /package/dist/public/assets/{rough.esm-BFJ-MgcB.js → rough.esm-ec8xsRC7.js} +0 -0
- /package/dist/public/assets/{shell-40VLet8r.js → shell-DT_H80Gx.js} +0 -0
- /package/dist/public/assets/{src-zyMpT2LE.js → src-CWigLjcs.js} +0 -0
- /package/dist/public/assets/{stex-BKMR5xQj.js → stex-DQW679lh.js} +0 -0
- /package/dist/public/assets/{trace-api-DPMyR1_m.js → trace-api-CbLDdnQA.js} +0 -0
- /package/dist/public/assets/{w3c-keyname-Dfj2imOv.js → w3c-keyname-B5t0fahT.js} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,d as t,i as n,l as r,s as i,t as a,u as o}from"./init-
|
|
1
|
+
import{c as e,d as t,i as n,l as r,s as i,t as a,u as o}from"./init-B1cOyI0L.mjs";import{t as s}from"./loader-CWaAs1JL.mjs";import"./src-B_Vh13Py.mjs";export{r as ALL_EDITOR_IDS,o as EDITOR_TARGETS,a as detectInstalledEditors,t as initContent,s as loadConfig,n as readExistingMcpEntry,i as writeEditorMcpConfig,e as writeUserMcpConfigs};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,o as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{r,t as i}from"./esm-CEs3LWY3.mjs";import{_t as a,ht as o}from"./dist-DVM7wH81.mjs";import{C as s,St as c,bt as l,k as u,vn as d,zt as f}from"./dist-ou5qina8.mjs";import{n as p,t as m}from"./constants-CswmjLU5.mjs";import{t as h}from"./is-object-DF0ZeuvD.mjs";import{i as g,o as _,r as v,s as y,t as b}from"./colors-BNufdynn.mjs";import{t as x}from"./preview-IJyfVtTf.mjs";import S,{basename as C,dirname as w,isAbsolute as T,join as E,posix as ee,relative as D,resolve as O,sep as k,win32 as te}from"node:path";import{cpSync as ne,existsSync as A,lstatSync as re,mkdirSync as j,readFileSync as M,realpathSync as ie,rmSync as ae,writeFileSync as N}from"node:fs";import P from"node:process";import{homedir as F}from"node:os";import{AsyncLocalStorage as oe,AsyncResource as se}from"node:async_hooks";import{stripVTControlCharacters as ce,styleText as I}from"node:util";import*as le from"node:readline";function ue(){return P.platform.startsWith(`win`)?!!P.env.CI||!!P.env.WT_SESSION||!!P.env.TERMINUS_SUBLIME||P.env.ConEmuTask===`{cmd::Cmder}`||P.env.TERM_PROGRAM===`Terminus-Sublime`||P.env.TERM_PROGRAM===`vscode`||P.env.TERM===`xterm-256color`||P.env.TERM===`alacritty`||P.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:P.env.TERM!==`linux`}const de={circleQuestionMark:`(?)`,questionMarkPrefix:`(?)`,square:`█`,squareDarkShade:`▓`,squareMediumShade:`▒`,squareLightShade:`░`,squareTop:`▀`,squareBottom:`▄`,squareLeft:`▌`,squareRight:`▐`,squareCenter:`■`,bullet:`●`,dot:`․`,ellipsis:`…`,pointerSmall:`›`,triangleUp:`▲`,triangleUpSmall:`▴`,triangleDown:`▼`,triangleDownSmall:`▾`,triangleLeftSmall:`◂`,triangleRightSmall:`▸`,home:`⌂`,heart:`♥`,musicNote:`♪`,musicNoteBeamed:`♫`,arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,arrowLeftRight:`↔`,arrowUpDown:`↕`,almostEqual:`≈`,notEqual:`≠`,lessOrEqual:`≤`,greaterOrEqual:`≥`,identical:`≡`,infinity:`∞`,subscriptZero:`₀`,subscriptOne:`₁`,subscriptTwo:`₂`,subscriptThree:`₃`,subscriptFour:`₄`,subscriptFive:`₅`,subscriptSix:`₆`,subscriptSeven:`₇`,subscriptEight:`₈`,subscriptNine:`₉`,oneHalf:`½`,oneThird:`⅓`,oneQuarter:`¼`,oneFifth:`⅕`,oneSixth:`⅙`,oneEighth:`⅛`,twoThirds:`⅔`,twoFifths:`⅖`,threeQuarters:`¾`,threeFifths:`⅗`,threeEighths:`⅜`,fourFifths:`⅘`,fiveSixths:`⅚`,fiveEighths:`⅝`,sevenEighths:`⅞`,line:`─`,lineBold:`━`,lineDouble:`═`,lineDashed0:`┄`,lineDashed1:`┅`,lineDashed2:`┈`,lineDashed3:`┉`,lineDashed4:`╌`,lineDashed5:`╍`,lineDashed6:`╴`,lineDashed7:`╶`,lineDashed8:`╸`,lineDashed9:`╺`,lineDashed10:`╼`,lineDashed11:`╾`,lineDashed12:`−`,lineDashed13:`–`,lineDashed14:`‐`,lineDashed15:`⁃`,lineVertical:`│`,lineVerticalBold:`┃`,lineVerticalDouble:`║`,lineVerticalDashed0:`┆`,lineVerticalDashed1:`┇`,lineVerticalDashed2:`┊`,lineVerticalDashed3:`┋`,lineVerticalDashed4:`╎`,lineVerticalDashed5:`╏`,lineVerticalDashed6:`╵`,lineVerticalDashed7:`╷`,lineVerticalDashed8:`╹`,lineVerticalDashed9:`╻`,lineVerticalDashed10:`╽`,lineVerticalDashed11:`╿`,lineDownLeft:`┐`,lineDownLeftArc:`╮`,lineDownBoldLeftBold:`┓`,lineDownBoldLeft:`┒`,lineDownLeftBold:`┑`,lineDownDoubleLeftDouble:`╗`,lineDownDoubleLeft:`╖`,lineDownLeftDouble:`╕`,lineDownRight:`┌`,lineDownRightArc:`╭`,lineDownBoldRightBold:`┏`,lineDownBoldRight:`┎`,lineDownRightBold:`┍`,lineDownDoubleRightDouble:`╔`,lineDownDoubleRight:`╓`,lineDownRightDouble:`╒`,lineUpLeft:`┘`,lineUpLeftArc:`╯`,lineUpBoldLeftBold:`┛`,lineUpBoldLeft:`┚`,lineUpLeftBold:`┙`,lineUpDoubleLeftDouble:`╝`,lineUpDoubleLeft:`╜`,lineUpLeftDouble:`╛`,lineUpRight:`└`,lineUpRightArc:`╰`,lineUpBoldRightBold:`┗`,lineUpBoldRight:`┖`,lineUpRightBold:`┕`,lineUpDoubleRightDouble:`╚`,lineUpDoubleRight:`╙`,lineUpRightDouble:`╘`,lineUpDownLeft:`┤`,lineUpBoldDownBoldLeftBold:`┫`,lineUpBoldDownBoldLeft:`┨`,lineUpDownLeftBold:`┥`,lineUpBoldDownLeftBold:`┩`,lineUpDownBoldLeftBold:`┪`,lineUpDownBoldLeft:`┧`,lineUpBoldDownLeft:`┦`,lineUpDoubleDownDoubleLeftDouble:`╣`,lineUpDoubleDownDoubleLeft:`╢`,lineUpDownLeftDouble:`╡`,lineUpDownRight:`├`,lineUpBoldDownBoldRightBold:`┣`,lineUpBoldDownBoldRight:`┠`,lineUpDownRightBold:`┝`,lineUpBoldDownRightBold:`┡`,lineUpDownBoldRightBold:`┢`,lineUpDownBoldRight:`┟`,lineUpBoldDownRight:`┞`,lineUpDoubleDownDoubleRightDouble:`╠`,lineUpDoubleDownDoubleRight:`╟`,lineUpDownRightDouble:`╞`,lineDownLeftRight:`┬`,lineDownBoldLeftBoldRightBold:`┳`,lineDownLeftBoldRightBold:`┯`,lineDownBoldLeftRight:`┰`,lineDownBoldLeftBoldRight:`┱`,lineDownBoldLeftRightBold:`┲`,lineDownLeftRightBold:`┮`,lineDownLeftBoldRight:`┭`,lineDownDoubleLeftDoubleRightDouble:`╦`,lineDownDoubleLeftRight:`╥`,lineDownLeftDoubleRightDouble:`╤`,lineUpLeftRight:`┴`,lineUpBoldLeftBoldRightBold:`┻`,lineUpLeftBoldRightBold:`┷`,lineUpBoldLeftRight:`┸`,lineUpBoldLeftBoldRight:`┹`,lineUpBoldLeftRightBold:`┺`,lineUpLeftRightBold:`┶`,lineUpLeftBoldRight:`┵`,lineUpDoubleLeftDoubleRightDouble:`╩`,lineUpDoubleLeftRight:`╨`,lineUpLeftDoubleRightDouble:`╧`,lineUpDownLeftRight:`┼`,lineUpBoldDownBoldLeftBoldRightBold:`╋`,lineUpDownBoldLeftBoldRightBold:`╈`,lineUpBoldDownLeftBoldRightBold:`╇`,lineUpBoldDownBoldLeftRightBold:`╊`,lineUpBoldDownBoldLeftBoldRight:`╉`,lineUpBoldDownLeftRight:`╀`,lineUpDownBoldLeftRight:`╁`,lineUpDownLeftBoldRight:`┽`,lineUpDownLeftRightBold:`┾`,lineUpBoldDownBoldLeftRight:`╂`,lineUpDownLeftBoldRightBold:`┿`,lineUpBoldDownLeftBoldRight:`╃`,lineUpBoldDownLeftRightBold:`╄`,lineUpDownBoldLeftBoldRight:`╅`,lineUpDownBoldLeftRightBold:`╆`,lineUpDoubleDownDoubleLeftDoubleRightDouble:`╬`,lineUpDoubleDownDoubleLeftRight:`╫`,lineUpDownLeftDoubleRightDouble:`╪`,lineCross:`╳`,lineBackslash:`╲`,lineSlash:`╱`},fe={tick:`✔`,info:`ℹ`,warning:`⚠`,cross:`✘`,squareSmall:`◻`,squareSmallFilled:`◼`,circle:`◯`,circleFilled:`◉`,circleDotted:`◌`,circleDouble:`◎`,circleCircle:`ⓞ`,circleCross:`ⓧ`,circlePipe:`Ⓘ`,radioOn:`◉`,radioOff:`◯`,checkboxOn:`☒`,checkboxOff:`☐`,checkboxCircleOn:`ⓧ`,checkboxCircleOff:`Ⓘ`,pointer:`❯`,triangleUpOutline:`△`,triangleLeft:`◀`,triangleRight:`▶`,lozenge:`◆`,lozengeOutline:`◇`,hamburger:`☰`,smiley:`㋡`,mustache:`෴`,star:`★`,play:`▶`,nodejs:`⬢`,oneSeventh:`⅐`,oneNinth:`⅑`,oneTenth:`⅒`},pe={tick:`√`,info:`i`,warning:`‼`,cross:`×`,squareSmall:`□`,squareSmallFilled:`■`,circle:`( )`,circleFilled:`(*)`,circleDotted:`( )`,circleDouble:`( )`,circleCircle:`(○)`,circleCross:`(×)`,circlePipe:`(│)`,radioOn:`(*)`,radioOff:`( )`,checkboxOn:`[×]`,checkboxOff:`[ ]`,checkboxCircleOn:`(×)`,checkboxCircleOff:`( )`,pointer:`>`,triangleUpOutline:`∆`,triangleLeft:`◄`,triangleRight:`►`,lozenge:`♦`,lozengeOutline:`◊`,hamburger:`≡`,smiley:`☺`,mustache:`┌─┐`,star:`✶`,play:`►`,nodejs:`♦`,oneSeventh:`1/7`,oneNinth:`1/9`,oneTenth:`1/10`},me={...de,...fe},he={...de,...pe},L=ue()?me:he;Object.entries(fe);var ge=n(((t,n)=>{n.exports=i;function r(t){let n={defaultWidth:0,output:process.stdout,tty:e(`tty`)};return t?(Object.keys(n).forEach(function(e){t[e]||(t[e]=n[e])}),t):n}function i(e){let t=r(e);if(t.output.getWindowSize)return t.output.getWindowSize()[0]||t.defaultWidth;if(t.tty.getWindowSize)return t.tty.getWindowSize()[1]||t.defaultWidth;if(t.output.columns)return t.output.columns;if(process.env.CLI_WIDTH){let e=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(e)&&e!==0)return e}return t.defaultWidth}}));const _e=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let n=0;for(e.lastIndex=0;e.test(t);)n+=1;return t.length-n}})(),ve=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,ye=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141,be=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,xe=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Se=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,Ce=/\t{1,1000}/y,we=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,Te=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Ee=/\p{M}+/gu,De={limit:1/0,ellipsis:``},Oe=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?Oe(i,De,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,c=n.emojiWidth??2,l=n.regularWidth??1,u=n.wideWidth??2,d=[[Te,l],[be,0],[xe,o],[Ce,s],[we,c],[Se,u]],f=0,p=0,m=e.length,h=0,g=!1,_=m,v=Math.max(0,r-a),y=0,b=0,x=0,S=0;outer:for(;;){if(b>y||p>=m&&p>f){let t=e.slice(y,b)||e.slice(f,p);h=0;for(let e of t.replaceAll(Ee,``)){let t=e.codePointAt(0)||0;if(S=ve(t)?2:ye(t)?u:l,x+S>v&&(_=Math.min(_,Math.max(y,f)+h)),x+S>r){g=!0;break outer}h+=e.length,x+=S}y=b=0}if(p>=m)break outer;for(let t=0,n=d.length;t<n;t++){let[n,i]=d[t];if(n.lastIndex=p,n.test(e)){if(h=n===Se?_e(e.slice(p,n.lastIndex)):n===we?1:n.lastIndex-p,S=h*i,x+S>v&&(_=Math.min(_,p+Math.floor((v-x)/i))),x+S>r){g=!0;break outer}x+=S,y=f,b=p,p=f=n.lastIndex;continue outer}}p+=1}return{width:g?v:x,index:g?_:m,truncated:g,ellipsed:g&&r>=a}},ke={limit:1/0,ellipsis:``,ellipsisWidth:0},R=(e,t={})=>Oe(e,ke,t).width,Ae=`]8;;`,je=RegExp(`(?:\\[(?<code>\\d+)m|\\${Ae}(?<uri>.*))`,`y`),Me=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},Ne=e=>`[${e}m`,Pe=e=>`${Ae}${e}`,Fe=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:R(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=R(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===``)&&(i=!0,a=t.startsWith(Ae,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length&&e.length>1&&(e[e.length-2]+=e.pop())},Ie=e=>{let t=e.split(` `),n=t.length;for(;n&&!R(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Le=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=[``],c=0;for(let e=0;e<o.length;e++){let r=o[e];if(n.trim!==!1){let e=s.at(-1)??``,t=e.trimStart();e.length!==t.length&&(s[s.length-1]=t,c=R(t))}e!==0&&(c>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),c=0),(c||n.trim===!1)&&(s[s.length-1]+=` `,c++));let i=R(r);if(n.hard&&i>t){let e=t-c,n=1+Math.floor((i-e-1)/t);Math.floor((i-1)/t)<n&&s.push(``),Fe(s,r,t),c=R(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){Fe(s,r,t),c=R(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){Fe(s,r,t),c=R(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>Ie(e)));let l=s.join(`
|
|
1
|
+
import{i as e,o as t,t as n}from"./chunk-FK9Q3tQk.mjs";import{r,t as i}from"./esm-CEs3LWY3.mjs";import{bt as a,vt as o}from"./dist-DfIz2LcA.mjs";import{Bt as s,C as c,Ct as l,k as u,xt as d,yn as f}from"./dist-D4M20vXU.mjs";import{n as p,t as m}from"./constants-BWv15Llm.mjs";import{t as h}from"./is-object-DF0ZeuvD.mjs";import{i as g,o as _,r as v,s as y,t as b}from"./colors-BNufdynn.mjs";import{t as x}from"./preview-FAMk9J0z.mjs";import S,{basename as C,dirname as w,isAbsolute as T,join as E,posix as ee,relative as D,resolve as O,sep as k,win32 as te}from"node:path";import{cpSync as ne,existsSync as A,lstatSync as re,mkdirSync as j,readFileSync as M,realpathSync as ie,rmSync as ae,writeFileSync as N}from"node:fs";import P from"node:process";import{homedir as F}from"node:os";import{AsyncLocalStorage as oe,AsyncResource as se}from"node:async_hooks";import{stripVTControlCharacters as ce,styleText as I}from"node:util";import*as le from"node:readline";function ue(){return P.platform.startsWith(`win`)?!!P.env.CI||!!P.env.WT_SESSION||!!P.env.TERMINUS_SUBLIME||P.env.ConEmuTask===`{cmd::Cmder}`||P.env.TERM_PROGRAM===`Terminus-Sublime`||P.env.TERM_PROGRAM===`vscode`||P.env.TERM===`xterm-256color`||P.env.TERM===`alacritty`||P.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:P.env.TERM!==`linux`}const de={circleQuestionMark:`(?)`,questionMarkPrefix:`(?)`,square:`█`,squareDarkShade:`▓`,squareMediumShade:`▒`,squareLightShade:`░`,squareTop:`▀`,squareBottom:`▄`,squareLeft:`▌`,squareRight:`▐`,squareCenter:`■`,bullet:`●`,dot:`․`,ellipsis:`…`,pointerSmall:`›`,triangleUp:`▲`,triangleUpSmall:`▴`,triangleDown:`▼`,triangleDownSmall:`▾`,triangleLeftSmall:`◂`,triangleRightSmall:`▸`,home:`⌂`,heart:`♥`,musicNote:`♪`,musicNoteBeamed:`♫`,arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,arrowLeftRight:`↔`,arrowUpDown:`↕`,almostEqual:`≈`,notEqual:`≠`,lessOrEqual:`≤`,greaterOrEqual:`≥`,identical:`≡`,infinity:`∞`,subscriptZero:`₀`,subscriptOne:`₁`,subscriptTwo:`₂`,subscriptThree:`₃`,subscriptFour:`₄`,subscriptFive:`₅`,subscriptSix:`₆`,subscriptSeven:`₇`,subscriptEight:`₈`,subscriptNine:`₉`,oneHalf:`½`,oneThird:`⅓`,oneQuarter:`¼`,oneFifth:`⅕`,oneSixth:`⅙`,oneEighth:`⅛`,twoThirds:`⅔`,twoFifths:`⅖`,threeQuarters:`¾`,threeFifths:`⅗`,threeEighths:`⅜`,fourFifths:`⅘`,fiveSixths:`⅚`,fiveEighths:`⅝`,sevenEighths:`⅞`,line:`─`,lineBold:`━`,lineDouble:`═`,lineDashed0:`┄`,lineDashed1:`┅`,lineDashed2:`┈`,lineDashed3:`┉`,lineDashed4:`╌`,lineDashed5:`╍`,lineDashed6:`╴`,lineDashed7:`╶`,lineDashed8:`╸`,lineDashed9:`╺`,lineDashed10:`╼`,lineDashed11:`╾`,lineDashed12:`−`,lineDashed13:`–`,lineDashed14:`‐`,lineDashed15:`⁃`,lineVertical:`│`,lineVerticalBold:`┃`,lineVerticalDouble:`║`,lineVerticalDashed0:`┆`,lineVerticalDashed1:`┇`,lineVerticalDashed2:`┊`,lineVerticalDashed3:`┋`,lineVerticalDashed4:`╎`,lineVerticalDashed5:`╏`,lineVerticalDashed6:`╵`,lineVerticalDashed7:`╷`,lineVerticalDashed8:`╹`,lineVerticalDashed9:`╻`,lineVerticalDashed10:`╽`,lineVerticalDashed11:`╿`,lineDownLeft:`┐`,lineDownLeftArc:`╮`,lineDownBoldLeftBold:`┓`,lineDownBoldLeft:`┒`,lineDownLeftBold:`┑`,lineDownDoubleLeftDouble:`╗`,lineDownDoubleLeft:`╖`,lineDownLeftDouble:`╕`,lineDownRight:`┌`,lineDownRightArc:`╭`,lineDownBoldRightBold:`┏`,lineDownBoldRight:`┎`,lineDownRightBold:`┍`,lineDownDoubleRightDouble:`╔`,lineDownDoubleRight:`╓`,lineDownRightDouble:`╒`,lineUpLeft:`┘`,lineUpLeftArc:`╯`,lineUpBoldLeftBold:`┛`,lineUpBoldLeft:`┚`,lineUpLeftBold:`┙`,lineUpDoubleLeftDouble:`╝`,lineUpDoubleLeft:`╜`,lineUpLeftDouble:`╛`,lineUpRight:`└`,lineUpRightArc:`╰`,lineUpBoldRightBold:`┗`,lineUpBoldRight:`┖`,lineUpRightBold:`┕`,lineUpDoubleRightDouble:`╚`,lineUpDoubleRight:`╙`,lineUpRightDouble:`╘`,lineUpDownLeft:`┤`,lineUpBoldDownBoldLeftBold:`┫`,lineUpBoldDownBoldLeft:`┨`,lineUpDownLeftBold:`┥`,lineUpBoldDownLeftBold:`┩`,lineUpDownBoldLeftBold:`┪`,lineUpDownBoldLeft:`┧`,lineUpBoldDownLeft:`┦`,lineUpDoubleDownDoubleLeftDouble:`╣`,lineUpDoubleDownDoubleLeft:`╢`,lineUpDownLeftDouble:`╡`,lineUpDownRight:`├`,lineUpBoldDownBoldRightBold:`┣`,lineUpBoldDownBoldRight:`┠`,lineUpDownRightBold:`┝`,lineUpBoldDownRightBold:`┡`,lineUpDownBoldRightBold:`┢`,lineUpDownBoldRight:`┟`,lineUpBoldDownRight:`┞`,lineUpDoubleDownDoubleRightDouble:`╠`,lineUpDoubleDownDoubleRight:`╟`,lineUpDownRightDouble:`╞`,lineDownLeftRight:`┬`,lineDownBoldLeftBoldRightBold:`┳`,lineDownLeftBoldRightBold:`┯`,lineDownBoldLeftRight:`┰`,lineDownBoldLeftBoldRight:`┱`,lineDownBoldLeftRightBold:`┲`,lineDownLeftRightBold:`┮`,lineDownLeftBoldRight:`┭`,lineDownDoubleLeftDoubleRightDouble:`╦`,lineDownDoubleLeftRight:`╥`,lineDownLeftDoubleRightDouble:`╤`,lineUpLeftRight:`┴`,lineUpBoldLeftBoldRightBold:`┻`,lineUpLeftBoldRightBold:`┷`,lineUpBoldLeftRight:`┸`,lineUpBoldLeftBoldRight:`┹`,lineUpBoldLeftRightBold:`┺`,lineUpLeftRightBold:`┶`,lineUpLeftBoldRight:`┵`,lineUpDoubleLeftDoubleRightDouble:`╩`,lineUpDoubleLeftRight:`╨`,lineUpLeftDoubleRightDouble:`╧`,lineUpDownLeftRight:`┼`,lineUpBoldDownBoldLeftBoldRightBold:`╋`,lineUpDownBoldLeftBoldRightBold:`╈`,lineUpBoldDownLeftBoldRightBold:`╇`,lineUpBoldDownBoldLeftRightBold:`╊`,lineUpBoldDownBoldLeftBoldRight:`╉`,lineUpBoldDownLeftRight:`╀`,lineUpDownBoldLeftRight:`╁`,lineUpDownLeftBoldRight:`┽`,lineUpDownLeftRightBold:`┾`,lineUpBoldDownBoldLeftRight:`╂`,lineUpDownLeftBoldRightBold:`┿`,lineUpBoldDownLeftBoldRight:`╃`,lineUpBoldDownLeftRightBold:`╄`,lineUpDownBoldLeftBoldRight:`╅`,lineUpDownBoldLeftRightBold:`╆`,lineUpDoubleDownDoubleLeftDoubleRightDouble:`╬`,lineUpDoubleDownDoubleLeftRight:`╫`,lineUpDownLeftDoubleRightDouble:`╪`,lineCross:`╳`,lineBackslash:`╲`,lineSlash:`╱`},fe={tick:`✔`,info:`ℹ`,warning:`⚠`,cross:`✘`,squareSmall:`◻`,squareSmallFilled:`◼`,circle:`◯`,circleFilled:`◉`,circleDotted:`◌`,circleDouble:`◎`,circleCircle:`ⓞ`,circleCross:`ⓧ`,circlePipe:`Ⓘ`,radioOn:`◉`,radioOff:`◯`,checkboxOn:`☒`,checkboxOff:`☐`,checkboxCircleOn:`ⓧ`,checkboxCircleOff:`Ⓘ`,pointer:`❯`,triangleUpOutline:`△`,triangleLeft:`◀`,triangleRight:`▶`,lozenge:`◆`,lozengeOutline:`◇`,hamburger:`☰`,smiley:`㋡`,mustache:`෴`,star:`★`,play:`▶`,nodejs:`⬢`,oneSeventh:`⅐`,oneNinth:`⅑`,oneTenth:`⅒`},pe={tick:`√`,info:`i`,warning:`‼`,cross:`×`,squareSmall:`□`,squareSmallFilled:`■`,circle:`( )`,circleFilled:`(*)`,circleDotted:`( )`,circleDouble:`( )`,circleCircle:`(○)`,circleCross:`(×)`,circlePipe:`(│)`,radioOn:`(*)`,radioOff:`( )`,checkboxOn:`[×]`,checkboxOff:`[ ]`,checkboxCircleOn:`(×)`,checkboxCircleOff:`( )`,pointer:`>`,triangleUpOutline:`∆`,triangleLeft:`◄`,triangleRight:`►`,lozenge:`♦`,lozengeOutline:`◊`,hamburger:`≡`,smiley:`☺`,mustache:`┌─┐`,star:`✶`,play:`►`,nodejs:`♦`,oneSeventh:`1/7`,oneNinth:`1/9`,oneTenth:`1/10`},me={...de,...fe},he={...de,...pe},L=ue()?me:he;Object.entries(fe);var ge=n(((t,n)=>{n.exports=i;function r(t){let n={defaultWidth:0,output:process.stdout,tty:e(`tty`)};return t?(Object.keys(n).forEach(function(e){t[e]||(t[e]=n[e])}),t):n}function i(e){let t=r(e);if(t.output.getWindowSize)return t.output.getWindowSize()[0]||t.defaultWidth;if(t.tty.getWindowSize)return t.tty.getWindowSize()[1]||t.defaultWidth;if(t.output.columns)return t.output.columns;if(process.env.CLI_WIDTH){let e=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(e)&&e!==0)return e}return t.defaultWidth}}));const _e=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let n=0;for(e.lastIndex=0;e.test(t);)n+=1;return t.length-n}})(),ve=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,ye=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141,be=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,xe=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Se=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,Ce=/\t{1,1000}/y,we=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,Te=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Ee=/\p{M}+/gu,De={limit:1/0,ellipsis:``},Oe=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?Oe(i,De,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,c=n.emojiWidth??2,l=n.regularWidth??1,u=n.wideWidth??2,d=[[Te,l],[be,0],[xe,o],[Ce,s],[we,c],[Se,u]],f=0,p=0,m=e.length,h=0,g=!1,_=m,v=Math.max(0,r-a),y=0,b=0,x=0,S=0;outer:for(;;){if(b>y||p>=m&&p>f){let t=e.slice(y,b)||e.slice(f,p);h=0;for(let e of t.replaceAll(Ee,``)){let t=e.codePointAt(0)||0;if(S=ve(t)?2:ye(t)?u:l,x+S>v&&(_=Math.min(_,Math.max(y,f)+h)),x+S>r){g=!0;break outer}h+=e.length,x+=S}y=b=0}if(p>=m)break outer;for(let t=0,n=d.length;t<n;t++){let[n,i]=d[t];if(n.lastIndex=p,n.test(e)){if(h=n===Se?_e(e.slice(p,n.lastIndex)):n===we?1:n.lastIndex-p,S=h*i,x+S>v&&(_=Math.min(_,p+Math.floor((v-x)/i))),x+S>r){g=!0;break outer}x+=S,y=f,b=p,p=f=n.lastIndex;continue outer}}p+=1}return{width:g?v:x,index:g?_:m,truncated:g,ellipsed:g&&r>=a}},ke={limit:1/0,ellipsis:``,ellipsisWidth:0},R=(e,t={})=>Oe(e,ke,t).width,Ae=`]8;;`,je=RegExp(`(?:\\[(?<code>\\d+)m|\\${Ae}(?<uri>.*))`,`y`),Me=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},Ne=e=>`[${e}m`,Pe=e=>`${Ae}${e}`,Fe=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:R(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=R(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===``)&&(i=!0,a=t.startsWith(Ae,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length&&e.length>1&&(e[e.length-2]+=e.pop())},Ie=e=>{let t=e.split(` `),n=t.length;for(;n&&!R(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Le=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=[``],c=0;for(let e=0;e<o.length;e++){let r=o[e];if(n.trim!==!1){let e=s.at(-1)??``,t=e.trimStart();e.length!==t.length&&(s[s.length-1]=t,c=R(t))}e!==0&&(c>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),c=0),(c||n.trim===!1)&&(s[s.length-1]+=` `,c++));let i=R(r);if(n.hard&&i>t){let e=t-c,n=1+Math.floor((i-e-1)/t);Math.floor((i-1)/t)<n&&s.push(``),Fe(s,r,t),c=R(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){Fe(s,r,t),c=R(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){Fe(s,r,t),c=R(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>Ie(e)));let l=s.join(`
|
|
2
2
|
`),u=!1;for(let e=0;e<l.length;e++){let t=l[e];if(r+=t,u)u=!1;else if(u=t>=`\ud800`&&t<=`\udbff`,u)continue;if(t===`\x1B`||t===``){je.lastIndex=e+1;let t=je.exec(l)?.groups;if(t?.code!==void 0){let e=Number.parseFloat(t.code);i=e===39?void 0:e}else t?.uri!==void 0&&(a=t.uri.length===0?void 0:t.uri)}if(l[e+1]===`
|
|
3
3
|
`){a&&(r+=Pe(``));let e=i?Me(i):void 0;i&&e&&(r+=Ne(e))}else t===`
|
|
4
4
|
`&&(i&&Me(i)&&(r+=Ne(i)),a&&(r+=Pe(a)))}return r},Re=/\r?\n/;function ze(e,t,n){return String(e).normalize().split(Re).map(e=>Le(e,t,n)).join(`
|
|
@@ -389,9 +389,9 @@ ${a}/
|
|
|
389
389
|
# drafts/ # exclude a directory
|
|
390
390
|
# *.draft.md # exclude files matching a pattern
|
|
391
391
|
# !keep.md # re-include a file .gitignore excluded
|
|
392
|
-
`,`.okignore`)?n.push(`.okignore`):i.push(`.okignore`),{created:n,updated:r,skipped:i}}const zn=[`claude`,`claude-desktop`,`cursor`,`vscode`,`windsurf`,`codex`],Bn=[`@inkeep/open-knowledge`,`mcp`],Vn={MCP_DEBUG:`1`,OK_LOG_FILE:`/tmp/ok-mcp.log`};function Hn(e=process.argv[1]){if(!e)throw Error(`Cannot infer the local CLI entry for --dev-mcp because process.argv[1] is empty.`);let t=O(e);if(C(t)===`cli.mjs`&&C(w(t))===`dist`)return t;let n=t.split(k),r=n.lastIndexOf(`packages`);if(r===-1||n[r+1]!==`cli`)throw Error(`Cannot infer the repo root for --dev-mcp from ${t}. Run the local CLI from this repo so the built dist path can be derived.`);let i=n.slice(0,r);return E(i.length===0?k:i.join(k),`packages`,`cli`,`dist`,`cli.mjs`)}function Y(e={}){return e.cliPath?{command:e.cliPath,args:[`mcp`]}:e.mode===`dev`?{command:`node`,args:[Hn(),`mcp`],env:{...Vn}}:{command:`npx`,args:[...Bn]}}function X(e){return e===`win32`?te:ee}function Un(e={}){let t=e.platformName??process.platform,n=e.home??F(),r=e.env??process.env,i=X(t);return t===`darwin`?i.join(n,`Library`,`Application Support`):t===`win32`?r.APPDATA??i.join(n,`AppData`,`Roaming`):r.XDG_CONFIG_HOME??i.join(n,`.config`)}function Wn(e={}){let t=e.platformName??process.platform,n=e.home??F();return X(t).join(n,`.claude.json`)}function Gn(e={}){let t=e.platformName??process.platform,n=e.home??F(),r=e.env??process.env;if(t===`darwin`)return ee.join(n,`Library`,`Application Support`,`Claude`,`claude_desktop_config.json`);if(t===`win32`){let e=r.APPDATA??te.join(n,`AppData`,`Roaming`);return te.join(e,`Claude`,`claude_desktop_config.json`)}throw Error(`Claude Desktop is not available on ${t}. Supported: macOS, Windows.`)}function Kn(e={}){let t=e.platformName??process.platform,n=e.home??F();return X(t).join(n,`.cursor`,`mcp.json`)}function qn(e={}){return X(e.platformName??process.platform).join(Un(e),`Code`,`User`,`mcp.json`)}function Jn(e={}){let t=e.platformName??process.platform,n=e.home??F();return X(t).join(n,`.codeium`,`windsurf`,`mcp_config.json`)}function Yn(e={}){let t=e.platformName??process.platform,n=e.home??F();return(e.env??process.env).CODEX_HOME??X(t).join(n,`.codex`)}function Xn(e={}){return X(e.platformName??process.platform).join(Yn(e),`config.toml`)}function Zn(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,n)=>Zn(e,t[n]));if(h(e)&&h(t)){let n=Object.keys(e).sort(),r=Object.keys(t).sort();return n.length===r.length&&n.every((e,t)=>e===r[t])&&n.every(n=>Zn(e[n],t[n]))}return!1}function Qn(e,t){return Object.entries(t).every(([t,n])=>Zn(e[t],n))}function $n(e,t){return{...e,...t}}function Z(e){return{...e,isCompatible(t,n,r){return Qn(t,e.buildEntry(n,r))},mergeManagedFields(t,n,r){return $n(t,e.buildEntry(n,r))}}}const Q={claude:Z({id:`claude`,label:`Claude Code`,configPath:(e,t)=>Wn({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>
|
|
392
|
+
`,`.okignore`)?n.push(`.okignore`):i.push(`.okignore`),{created:n,updated:r,skipped:i}}const zn=[`claude`,`claude-desktop`,`cursor`,`vscode`,`windsurf`,`codex`],Bn=[`@inkeep/open-knowledge`,`mcp`],Vn={MCP_DEBUG:`1`,OK_LOG_FILE:`/tmp/ok-mcp.log`};function Hn(e=process.argv[1]){if(!e)throw Error(`Cannot infer the local CLI entry for --dev-mcp because process.argv[1] is empty.`);let t=O(e);if(C(t)===`cli.mjs`&&C(w(t))===`dist`)return t;let n=t.split(k),r=n.lastIndexOf(`packages`);if(r===-1||n[r+1]!==`cli`)throw Error(`Cannot infer the repo root for --dev-mcp from ${t}. Run the local CLI from this repo so the built dist path can be derived.`);let i=n.slice(0,r);return E(i.length===0?k:i.join(k),`packages`,`cli`,`dist`,`cli.mjs`)}function Y(e={}){return e.cliPath?{command:e.cliPath,args:[`mcp`]}:e.mode===`dev`?{command:`node`,args:[Hn(),`mcp`],env:{...Vn}}:{command:`npx`,args:[...Bn]}}function X(e){return e===`win32`?te:ee}function Un(e={}){let t=e.platformName??process.platform,n=e.home??F(),r=e.env??process.env,i=X(t);return t===`darwin`?i.join(n,`Library`,`Application Support`):t===`win32`?r.APPDATA??i.join(n,`AppData`,`Roaming`):r.XDG_CONFIG_HOME??i.join(n,`.config`)}function Wn(e={}){let t=e.platformName??process.platform,n=e.home??F();return X(t).join(n,`.claude.json`)}function Gn(e={}){let t=e.platformName??process.platform,n=e.home??F(),r=e.env??process.env;if(t===`darwin`)return ee.join(n,`Library`,`Application Support`,`Claude`,`claude_desktop_config.json`);if(t===`win32`){let e=r.APPDATA??te.join(n,`AppData`,`Roaming`);return te.join(e,`Claude`,`claude_desktop_config.json`)}throw Error(`Claude Desktop is not available on ${t}. Supported: macOS, Windows.`)}function Kn(e={}){let t=e.platformName??process.platform,n=e.home??F();return X(t).join(n,`.cursor`,`mcp.json`)}function qn(e={}){return X(e.platformName??process.platform).join(Un(e),`Code`,`User`,`mcp.json`)}function Jn(e={}){let t=e.platformName??process.platform,n=e.home??F();return X(t).join(n,`.codeium`,`windsurf`,`mcp_config.json`)}function Yn(e={}){let t=e.platformName??process.platform,n=e.home??F();return(e.env??process.env).CODEX_HOME??X(t).join(n,`.codex`)}function Xn(e={}){return X(e.platformName??process.platform).join(Yn(e),`config.toml`)}function Zn(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,n)=>Zn(e,t[n]));if(h(e)&&h(t)){let n=Object.keys(e).sort(),r=Object.keys(t).sort();return n.length===r.length&&n.every((e,t)=>e===r[t])&&n.every(n=>Zn(e[n],t[n]))}return!1}function Qn(e,t){return Object.entries(t).every(([t,n])=>Zn(e[t],n))}function $n(e,t){return{...e,...t}}function Z(e){return{...e,isCompatible(t,n,r){return Qn(t,e.buildEntry(n,r))},mergeManagedFields(t,n,r){return $n(t,e.buildEntry(n,r))}}}const Q={claude:Z({id:`claude`,label:`Claude Code`,configPath:(e,t)=>Wn({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>c,buildEntry:(e,t)=>Y(t),scope:`global`,detectPath:(e,t)=>E(t??F(),`.claude`),projectConfigPath:e=>E(e,`.mcp.json`),projectSkillPath:e=>E(e,`.claude`,`skills`,`open-knowledge`,`SKILL.md`)}),"claude-desktop":Z({id:`claude-desktop`,label:`Claude Desktop`,configPath:(e,t)=>Gn({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>c,buildEntry:(e,t)=>Y(t),scope:`global`,detectPath:(e,t)=>w(Gn({home:t}))}),cursor:Z({id:`cursor`,label:`Cursor`,configPath:(e,t)=>Kn({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>c,buildEntry:(e,t)=>Y(t),scope:`global`,detectPath:(e,t)=>w(Kn({home:t})),projectConfigPath:e=>E(e,`.cursor`,`mcp.json`),projectSkillPath:e=>E(e,`.cursor`,`skills`,`open-knowledge`,`SKILL.md`)}),vscode:Z({id:`vscode`,label:`VS Code`,configPath:(e,t)=>qn({home:t}),format:`json`,topLevelKey:`servers`,serverName:()=>c,buildEntry:(e,t)=>({type:`stdio`,...Y(t)}),scope:`global`,detectPath:(e,t)=>w(qn({home:t})),projectConfigPath:e=>E(e,`.vscode`,`mcp.json`)}),windsurf:Z({id:`windsurf`,label:`Windsurf`,configPath:(e,t)=>Jn({home:t}),format:`json`,topLevelKey:`mcpServers`,serverName:()=>c,buildEntry:(e,t)=>Y(t),scope:`global`,detectPath:(e,t)=>w(Jn({home:t}))}),codex:Z({id:`codex`,label:`Codex`,configPath:(e,t)=>Xn({home:t}),format:`toml`,topLevelKey:`mcp_servers`,serverName:()=>c,buildEntry:(e,t)=>Y(t),scope:`global`,detectPath:(e,t)=>w(Xn({home:t})),projectConfigPath:e=>E(e,`.codex`,`config.toml`)})};function er(e){let t=e.filter(e=>!Object.hasOwn(Q,e));if(t.length>0)throw Error(`Unknown editor(s): ${t.join(`, `)}. Valid options: ${zn.join(`, `)}`);return e.map(e=>Q[e])}function tr(e){if(!A(e))return{};let t=M(e,`utf-8`).trim();if(t===``)return{};try{let n=JSON.parse(t);if(h(n))return n;throw Error(`${e} root must be a JSON object`)}catch(t){throw t instanceof SyntaxError?Error(`${e} contains invalid JSON: ${t.message}`):t}}function nr(e){if(!A(e))return{};let t=M(e,`utf-8`).trim();if(t===``)return{};try{let n=Cn(t);if(h(n))return n;throw Error(`${e} root must be a TOML table`)}catch(t){throw Error(`${e} contains invalid TOML: ${t instanceof Error?t.message:String(t)}`)}}function rr(e,t){j(w(e),{recursive:!0}),N(e,`${JSON.stringify(t,null,2)}\n`,`utf-8`)}function ir(e,t){j(w(e),{recursive:!0});let n=Mn(t);N(e,n.endsWith(`
|
|
393
393
|
`)?n:`${n}\n`,`utf-8`)}function ar(e,t){let n;try{n=ie(t)}catch{n=O(t)}let r;try{r=re(e)}catch(e){if(e.code!==`ENOENT`)throw e}if(r?.isSymbolicLink())throw Error(`Refusing to write through a symbolic link at ${e}. Remove the symlink and re-run \`ok init\`, or pass \`--no-mcp\` to skip MCP config writes.`);let i=w(e);for(;i.length>1&&i!==k;){let t;try{t=ie(i)}catch(e){if(e.code===`ENOENT`){i=w(i);continue}throw e}let r=D(n,t);if(r===``||!r.startsWith(`..`)&&!T(r))return;throw Error(`Refusing to write at ${e}: ancestor ${i} resolves to ${t}, which is outside the project directory ${n}. A symbolic link in the path likely escapes the project. Remove the symlink and re-run, or pass \`--no-mcp\`.`)}}const or=e=>e!==`project`,sr=e=>e!==`user`;async function cr(){let e=await $t({message:`Where should the MCP server be configured?
|
|
394
|
-
`,required:!1,theme:{icon:{checked:`[x]`,unchecked:`[ ]`}},choices:[{name:`User-level (~/.claude.json, ~/.cursor/mcp.json, …)`,value:`user`,checked:!0},{name:`Project-level (.mcp.json, .cursor/mcp.json, …)`,value:`project`,checked:!0}]});return e.includes(`user`)&&e.includes(`project`)?`both`:e.includes(`user`)?`user`:e.includes(`project`)?`project`:null}async function lr(e){return e.mcp===!1?null:e.scope?e.scope:e.isTTY??process.stdout.isTTY?(e.promptFn??cr)():`both`}const ur=`0.0.1`,dr=`open-knowledge-ui`;function fr(e,t={}){let n=E(e,`.claude`,`launch.json`),r=t.mode===`dev`?{name:dr,runtimeExecutable:`node`,runtimeArgs:[Hn(),`ui`],port:3e3}:{name:dr,runtimeExecutable:`npx`,runtimeArgs:[`@inkeep/open-knowledge`,`ui`],port:3e3};try{if(ar(n,e),!A(n))return j(w(n),{recursive:!0}),N(n,`${JSON.stringify({version:ur,configurations:[r]},null,2)}\n`,`utf-8`),{action:`created`,configPath:n};let t=M(n,`utf-8`).trim(),i=t?JSON.parse(t):{};if(!h(i))return{action:`failed`,configPath:n,error:`launch.json root is not an object`};let a=Array.isArray(i.configurations)?i.configurations:[],o=a.findIndex(e=>h(e)&&e.name===dr);o>=0?a[o]=r:a.push(r);let s={...i,version:i.version??ur,configurations:a};return N(n,`${JSON.stringify(s,null,2)}\n`,`utf-8`),{action:o>=0?`merged`:`created`,configPath:n}}catch(e){return{action:`failed`,configPath:n,error:e instanceof Error?e.message:String(e)}}}function pr(e,t,n){try{return A(e.detectPath?.(t,n)??w(e.configPath(t,n)))}catch{return!1}}function $(e,t,n,r,i){let a=e.serverName(t),o;try{o=i??e.configPath(t,r)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:``,serverName:a,error:t instanceof Error?t.message:String(t)}}if(!i&&!n.skipAvailabilityCheck&&!pr(e,t,r))return{editorId:e.id,label:e.label,action:`skipped-missing`,configPath:o,serverName:a};if(i!==void 0)try{ar(o,t)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),configScope:`project`}}let s;try{s=e.format===`toml`?nr(o):tr(o)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t)}}let c=s[e.topLevelKey]??{},l=c[a],u;try{u=e.buildEntry(t,n)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t)}}let d={...s,[e.topLevelKey]:{...c,[a]:u}};try{e.format===`toml`?ir(o,d):rr(o,d)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t)}}return{editorId:e.id,label:e.label,action:l===void 0?`written`:`overwritten`,configPath:o,serverName:a,...i===void 0?{}:{configScope:`project`}}}function mr(e,t){let n=e.projectSkillPath?.(t);if(!n)return{editorId:e.id,label:e.label,action:`skipped-unsupported`,path:``};try{let r=d(),i=w(n);ar(i,t);let a=A(n)?`overwritten`:`written`;return ae(i,{recursive:!0,force:!0}),j(w(i),{recursive:!0}),ne(r,i,{recursive:!0}),{editorId:e.id,label:e.label,action:a,path:n}}catch(t){return{editorId:e.id,label:e.label,action:`failed`,path:n,error:t instanceof Error?t.message:String(t)}}}function hr(e,t){let n=e.projectConfigPath?.(t);if(!(!n||!A(n)))return{editorId:e.id,label:e.label,path:n}}async function gr(e){let t=er(e.editors),n={mode:`published`,cliPath:e.cliPath,skipAvailabilityCheck:!0};return t.map(t=>$(t,``,n,e.home))}function _r(e,t,n){let r;try{r=e.configPath(t,n)}catch{return null}let i;try{i=e.format===`toml`?nr(r):tr(r)}catch{return null}let a=i[e.topLevelKey];if(!h(a))return null;let o=a[e.serverName(t)];return h(o)?o:null}async function vr(e={}){let t=O(e.cwd??process.cwd()),n={mode:e.devMcp?`dev`:`published`},r=await c(t),i;try{i=Rn(t)}catch(n){let i=Q.claude.configPath(t,e.home);return{contentCreated:[],contentUpdated:[],contentSkipped:[],editors:[],projectSkills:[],legacyProjectConfigs:[],didGitInit:r.didInit,claudeDesktopDetected:!1,mcpAction:`failed`,mcpPath:i,mcpError:`Content scaffolding failed: ${n instanceof Error?n.message:String(n)}`}}let a=await lr({scope:e.scope,mcp:e.mcp,isTTY:e.isTTY,promptFn:e.promptFn}),o=e.editors??br(t,e.home),s=e.editors??zn.filter(e=>Q[e].projectConfigPath!==void 0),u=er(o),d=er(s),p=e.mcp===!1||a===null,m=Array.from(new Map([...u,...p?[]:d].map(e=>[e.id,e])).values()),h=u.filter(n=>pr(n,t,e.home)),g=[],_=[],v=new Set;for(let r of m){if(p){let n=``;try{n=r.configPath(t,e.home)}catch{}g.push({editorId:r.id,label:r.label,action:`skipped-flag`,configPath:n,serverName:r.serverName(t)});continue}if(or(a)&&u.includes(r)&&g.push($(r,t,n,e.home)),sr(a)&&d.includes(r)&&r.projectConfigPath){let i=r.projectConfigPath(t),a=$(r,t,n,e.home,i);g.push(a),(a.action===`written`||a.action===`overwritten`)&&(v.add(i),_.push(mr(r,t)))}}let y=!p&&a!==null&&sr(a)?d.filter(e=>!e.projectConfigPath).map(e=>e.label):void 0,b=p?[]:h.map(e=>hr(e,t)).filter(e=>e!==void 0).filter(e=>!v.has(e.path)),x=h.some(e=>e.id===`claude`)&&!p?fr(t,n):void 0,S=await(e.installUserSkill??f)({home:e.home}),C=l({home:e.home}),w=p?`skipped-flag`:`skipped-missing`,T=g.find(e=>e.editorId===`claude`)??g[0]??{action:w,configPath:Q.claude.configPath(t,e.home)};return{contentCreated:i.created,contentUpdated:i.updated,contentSkipped:i.skipped,editors:g,projectSkills:_,legacyProjectConfigs:b,launchJson:x,skillInstall:S,didGitInit:r.didInit,claudeDesktopDetected:C,mcpAction:T.action,mcpPath:T.configPath,mcpError:`error`in T?T.error:void 0,projectScopeUnsupportedLabels:y}}function yr(e,t){let n=[],r=e.editors.some(e=>e.action===`written`||e.action===`overwritten`),i=e.editors.some(e=>e.action===`failed`)||e.projectSkills.some(e=>e.action===`failed`),a=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-flag`),o=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-missing`),s=e=>{let n=e.configPath.startsWith(t)?D(t,e.configPath):e.configPath;switch(e.action){case`created`:return` app preview server ${n} configured for Claude Code Desktop embedded browser`;case`merged`:return` app preview server ${n} updated for Claude Code Desktop embedded browser`;case`failed`:return` app preview server ${n} FAILED: ${e.error}`}};e.didGitInit&&n.push(`Initialized git repo at ${t}/.git/ (default branch: main)`);let c=E(t,`.ok`);if(e.contentCreated.length>0||e.contentUpdated.length>0?(n.push(b(`Content scaffolded at ${c}/`)),e.contentCreated.length>0&&n.push(` Created: ${e.contentCreated.join(`, `)}`),e.contentUpdated.length>0&&n.push(` Updated: ${e.contentUpdated.join(`, `)}`)):n.push(b(`Content already present at ${c}/`)),e.contentSkipped.length>0&&n.push(` Skipped (already exist): ${e.contentSkipped.join(`, `)}`),n.push(``),e.mcpError&&e.editors.length===0)n.push(`Warning: ${e.mcpError}`);else if(e.editors.length===0)if(n.push(b(`MCP server configuration:`)),e.mcpAction===`skipped-flag`)n.push(` MCP config not written — use without --no-mcp to configure editors`);else if(e.projectScopeUnsupportedLabels&&e.projectScopeUnsupportedLabels.length>0){let t=e.projectScopeUnsupportedLabels.join(`, `),r=e.projectScopeUnsupportedLabels.length===1?`does`:`do`;n.push(` ${t} ${r} not support project-level config; skipped`)}else n.push(` No supported editor config directories detected; skipped MCP registration`);else if(a)n.push(`MCP config not written — use without --no-mcp to configure editors`);else if(o)n.push(b(`MCP server configuration:`)),n.push(` No supported editor config directories detected; skipped MCP registration`);else{n.push(b(`MCP server configuration:`));for(let r of e.editors){let i=r.configPath.startsWith(t)?D(t,r.configPath):r.configPath.replace(/^\/Users\/[^/]+/,`~`),a=r.serverName===`open-knowledge`?``:` (${r.serverName})`,o=r.configScope===`project`?` (project)`:``,c=`${r.label}${o}`,l=` `.repeat(Math.max(1,20-c.length)),u=r.editorId===`claude-desktop`&&(r.action===`written`||r.action===`overwritten`)?` — quit and relaunch Claude Desktop to activate`:``;switch(r.action){case`written`:n.push(` ${c}${l}${i} ${_(`registered`)}${a}${u}`);break;case`overwritten`:n.push(` ${c}${l}${i} ${_(`updated`)}${a}${u}`);break;case`skipped-missing`:n.push(` ${c}${l}${i} config root missing; skipped`);break;case`failed`:n.push(` ${c}${l}${i} ${v(`FAILED`)}: ${r.error}`);break;case`skipped-flag`:break}r.editorId===`claude`&&e.launchJson&&n.push(s(e.launchJson))}if(e.projectScopeUnsupportedLabels&&e.projectScopeUnsupportedLabels.length>0){let t=e.projectScopeUnsupportedLabels.join(`, `),r=e.projectScopeUnsupportedLabels.length===1?`does`:`do`;n.push(` ${t} ${r} not support project-level config; skipped`)}}if(e.projectSkills.length>0){n.push(``),n.push(b(`Project-local skills:`));for(let r of e.projectSkills){let e=`${r.label} (project)`,i=` `.repeat(Math.max(1,20-e.length)),a=r.path?D(t,r.path):``;switch(r.action){case`written`:n.push(` ${e}${i}${a} ${_(`installed`)}`);break;case`overwritten`:n.push(` ${e}${i}${a} ${_(`updated`)}`);break;case`skipped-unsupported`:n.push(` ${e}${i}no known project skill surface; skipped`);break;case`failed`:n.push(` ${e}${i}${a} ${v(`FAILED`)}: ${r.error}`);break}}}if(i&&(n.push(``),n.push(`For failed editors, add the MCP server entry or project skill manually. See:`),n.push(` https://github.com/inkeep/open-knowledge#mcp-setup`)),e.legacyProjectConfigs.length>0){n.push(``),n.push(`Project MCP configs found:`);for(let r of e.legacyProjectConfigs)n.push(` ${r.label} ${D(t,r.path)}`);n.push(` These project-local files may override the global config. Remove them if you want fully user-scoped MCP setup in this project.`)}if(e.skillInstall)switch(n.push(``),n.push(b(`User-global skill:`)),e.skillInstall){case`installed`:n.push(` open-knowledge ${_(`installed to detected agent hosts`)} via \`npx skills\``);break;case`skip-current`:n.push(` open-knowledge ${_(`already installed at current version`)}`);break;case`failed`:n.push(` ${y(`open-knowledge install failed — MCP still configured; run manually:`)}`),n.push(` ${y(` npx skills@~1.5.0 add <bundled-path> --agent '*' -g -y --copy`)}`);break}if(e.claudeDesktopDetected&&(n.push(``),n.push(`Claude Desktop App detected. To enable in Claude Chat & Cowork, run: ${b(`ok install-skill`)}`)),e.preview?(n.push(``),n.push(x(e.preview,t))):e.previewWarning&&(n.push(``),n.push(`Content preview unavailable: ${e.previewWarning}`)),r){let t=new Set,r=e.editors.filter(e=>e.action===`written`||e.action===`overwritten`).filter(e=>!t.has(e.editorId)&&t.add(e.editorId)).map(e=>e.label);n.push(``),n.push(`${_(`✓`)} ${b(`Next steps:`)}`),n.push(` 1. Open your editor (${g(r.join(` / `))})`),n.push(` 2. Approve the MCP server when prompted`),n.push(` 3. (Optional) scaffold the starter knowledge-base structure:`),n.push(` - ${g(`ok seed`)}`),n.push(` 4. Use the three MCP workflow tools as you build the wiki:`),n.push(` - ${g(`mcp__open-knowledge__ingest`)} — capture an external source`),n.push(` - ${g(`mcp__open-knowledge__research`)} — gather sources and write findings`),n.push(` - ${g(`mcp__open-knowledge__consolidate`)} — promote research to canonical articles`)}return n.join(`
|
|
394
|
+
`,required:!1,theme:{icon:{checked:`[x]`,unchecked:`[ ]`}},choices:[{name:`User-level (~/.claude.json, ~/.cursor/mcp.json, …)`,value:`user`,checked:!0},{name:`Project-level (.mcp.json, .cursor/mcp.json, …)`,value:`project`,checked:!0}]});return e.includes(`user`)&&e.includes(`project`)?`both`:e.includes(`user`)?`user`:e.includes(`project`)?`project`:null}async function lr(e){return e.mcp===!1?null:e.scope?e.scope:e.isTTY??process.stdout.isTTY?(e.promptFn??cr)():`both`}const ur=`0.0.1`,dr=`open-knowledge-ui`;function fr(e,t={}){let n=E(e,`.claude`,`launch.json`),r=t.mode===`dev`?{name:dr,runtimeExecutable:`node`,runtimeArgs:[Hn(),`ui`],port:3e3}:{name:dr,runtimeExecutable:`npx`,runtimeArgs:[`@inkeep/open-knowledge`,`ui`],port:3e3};try{if(ar(n,e),!A(n))return j(w(n),{recursive:!0}),N(n,`${JSON.stringify({version:ur,configurations:[r]},null,2)}\n`,`utf-8`),{action:`created`,configPath:n};let t=M(n,`utf-8`).trim(),i=t?JSON.parse(t):{};if(!h(i))return{action:`failed`,configPath:n,error:`launch.json root is not an object`};let a=Array.isArray(i.configurations)?i.configurations:[],o=a.findIndex(e=>h(e)&&e.name===dr);o>=0?a[o]=r:a.push(r);let s={...i,version:i.version??ur,configurations:a};return N(n,`${JSON.stringify(s,null,2)}\n`,`utf-8`),{action:o>=0?`merged`:`created`,configPath:n}}catch(e){return{action:`failed`,configPath:n,error:e instanceof Error?e.message:String(e)}}}function pr(e,t,n){try{return A(e.detectPath?.(t,n)??w(e.configPath(t,n)))}catch{return!1}}function $(e,t,n,r,i){let a=e.serverName(t),o;try{o=i??e.configPath(t,r)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:``,serverName:a,error:t instanceof Error?t.message:String(t)}}if(!i&&!n.skipAvailabilityCheck&&!pr(e,t,r))return{editorId:e.id,label:e.label,action:`skipped-missing`,configPath:o,serverName:a};if(i!==void 0)try{ar(o,t)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),configScope:`project`}}let s;try{s=e.format===`toml`?nr(o):tr(o)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t)}}let c=s[e.topLevelKey]??{},l=c[a],u;try{u=e.buildEntry(t,n)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t)}}let d={...s,[e.topLevelKey]:{...c,[a]:u}};try{e.format===`toml`?ir(o,d):rr(o,d)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t)}}return{editorId:e.id,label:e.label,action:l===void 0?`written`:`overwritten`,configPath:o,serverName:a,...i===void 0?{}:{configScope:`project`}}}function mr(e,t){let n=e.projectSkillPath?.(t);if(!n)return{editorId:e.id,label:e.label,action:`skipped-unsupported`,path:``};try{let r=f(),i=w(n);ar(i,t);let a=A(n)?`overwritten`:`written`;return ae(i,{recursive:!0,force:!0}),j(w(i),{recursive:!0}),ne(r,i,{recursive:!0}),{editorId:e.id,label:e.label,action:a,path:n}}catch(t){return{editorId:e.id,label:e.label,action:`failed`,path:n,error:t instanceof Error?t.message:String(t)}}}function hr(e,t){let n=e.projectConfigPath?.(t);if(!(!n||!A(n)))return{editorId:e.id,label:e.label,path:n}}async function gr(e){let t=er(e.editors),n={mode:`published`,cliPath:e.cliPath,skipAvailabilityCheck:!0};return t.map(t=>$(t,``,n,e.home))}function _r(e,t,n){let r;try{r=e.configPath(t,n)}catch{return null}let i;try{i=e.format===`toml`?nr(r):tr(r)}catch{return null}let a=i[e.topLevelKey];if(!h(a))return null;let o=a[e.serverName(t)];return h(o)?o:null}async function vr(e={}){let t=O(e.cwd??process.cwd()),n={mode:e.devMcp?`dev`:`published`},r=await l(t),i;try{i=Rn(t)}catch(n){let i=Q.claude.configPath(t,e.home);return{contentCreated:[],contentUpdated:[],contentSkipped:[],editors:[],projectSkills:[],legacyProjectConfigs:[],didGitInit:r.didInit,claudeDesktopDetected:!1,mcpAction:`failed`,mcpPath:i,mcpError:`Content scaffolding failed: ${n instanceof Error?n.message:String(n)}`}}let a=await lr({scope:e.scope,mcp:e.mcp,isTTY:e.isTTY,promptFn:e.promptFn}),o=e.editors??br(t,e.home),c=e.editors??zn.filter(e=>Q[e].projectConfigPath!==void 0),u=er(o),f=er(c),p=e.mcp===!1||a===null,m=Array.from(new Map([...u,...p?[]:f].map(e=>[e.id,e])).values()),h=u.filter(n=>pr(n,t,e.home)),g=[],_=[],v=new Set;for(let r of m){if(p){let n=``;try{n=r.configPath(t,e.home)}catch{}g.push({editorId:r.id,label:r.label,action:`skipped-flag`,configPath:n,serverName:r.serverName(t)});continue}if(or(a)&&u.includes(r)&&g.push($(r,t,n,e.home)),sr(a)&&f.includes(r)&&r.projectConfigPath){let i=r.projectConfigPath(t),a=$(r,t,n,e.home,i);g.push(a),(a.action===`written`||a.action===`overwritten`)&&(v.add(i),_.push(mr(r,t)))}}let y=!p&&a!==null&&sr(a)?f.filter(e=>!e.projectConfigPath).map(e=>e.label):void 0,b=p?[]:h.map(e=>hr(e,t)).filter(e=>e!==void 0).filter(e=>!v.has(e.path)),x=h.some(e=>e.id===`claude`)&&!p?fr(t,n):void 0,S=await(e.installUserSkill??s)({home:e.home}),C=d({home:e.home}),w=p?`skipped-flag`:`skipped-missing`,T=g.find(e=>e.editorId===`claude`)??g[0]??{action:w,configPath:Q.claude.configPath(t,e.home)};return{contentCreated:i.created,contentUpdated:i.updated,contentSkipped:i.skipped,editors:g,projectSkills:_,legacyProjectConfigs:b,launchJson:x,skillInstall:S,didGitInit:r.didInit,claudeDesktopDetected:C,mcpAction:T.action,mcpPath:T.configPath,mcpError:`error`in T?T.error:void 0,projectScopeUnsupportedLabels:y}}function yr(e,t){let n=[],r=e.editors.some(e=>e.action===`written`||e.action===`overwritten`),i=e.editors.some(e=>e.action===`failed`)||e.projectSkills.some(e=>e.action===`failed`),a=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-flag`),o=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-missing`),s=e=>{let n=e.configPath.startsWith(t)?D(t,e.configPath):e.configPath;switch(e.action){case`created`:return` app preview server ${n} configured for Claude Code Desktop embedded browser`;case`merged`:return` app preview server ${n} updated for Claude Code Desktop embedded browser`;case`failed`:return` app preview server ${n} FAILED: ${e.error}`}};e.didGitInit&&n.push(`Initialized git repo at ${t}/.git/ (default branch: main)`);let c=E(t,`.ok`);if(e.contentCreated.length>0||e.contentUpdated.length>0?(n.push(b(`Content scaffolded at ${c}/`)),e.contentCreated.length>0&&n.push(` Created: ${e.contentCreated.join(`, `)}`),e.contentUpdated.length>0&&n.push(` Updated: ${e.contentUpdated.join(`, `)}`)):n.push(b(`Content already present at ${c}/`)),e.contentSkipped.length>0&&n.push(` Skipped (already exist): ${e.contentSkipped.join(`, `)}`),n.push(``),e.mcpError&&e.editors.length===0)n.push(`Warning: ${e.mcpError}`);else if(e.editors.length===0)if(n.push(b(`MCP server configuration:`)),e.mcpAction===`skipped-flag`)n.push(` MCP config not written — use without --no-mcp to configure editors`);else if(e.projectScopeUnsupportedLabels&&e.projectScopeUnsupportedLabels.length>0){let t=e.projectScopeUnsupportedLabels.join(`, `),r=e.projectScopeUnsupportedLabels.length===1?`does`:`do`;n.push(` ${t} ${r} not support project-level config; skipped`)}else n.push(` No supported editor config directories detected; skipped MCP registration`);else if(a)n.push(`MCP config not written — use without --no-mcp to configure editors`);else if(o)n.push(b(`MCP server configuration:`)),n.push(` No supported editor config directories detected; skipped MCP registration`);else{n.push(b(`MCP server configuration:`));for(let r of e.editors){let i=r.configPath.startsWith(t)?D(t,r.configPath):r.configPath.replace(/^\/Users\/[^/]+/,`~`),a=r.serverName===`open-knowledge`?``:` (${r.serverName})`,o=r.configScope===`project`?` (project)`:``,c=`${r.label}${o}`,l=` `.repeat(Math.max(1,20-c.length)),u=r.editorId===`claude-desktop`&&(r.action===`written`||r.action===`overwritten`)?` — quit and relaunch Claude Desktop to activate`:``;switch(r.action){case`written`:n.push(` ${c}${l}${i} ${_(`registered`)}${a}${u}`);break;case`overwritten`:n.push(` ${c}${l}${i} ${_(`updated`)}${a}${u}`);break;case`skipped-missing`:n.push(` ${c}${l}${i} config root missing; skipped`);break;case`failed`:n.push(` ${c}${l}${i} ${v(`FAILED`)}: ${r.error}`);break;case`skipped-flag`:break}r.editorId===`claude`&&e.launchJson&&n.push(s(e.launchJson))}if(e.projectScopeUnsupportedLabels&&e.projectScopeUnsupportedLabels.length>0){let t=e.projectScopeUnsupportedLabels.join(`, `),r=e.projectScopeUnsupportedLabels.length===1?`does`:`do`;n.push(` ${t} ${r} not support project-level config; skipped`)}}if(e.projectSkills.length>0){n.push(``),n.push(b(`Project-local skills:`));for(let r of e.projectSkills){let e=`${r.label} (project)`,i=` `.repeat(Math.max(1,20-e.length)),a=r.path?D(t,r.path):``;switch(r.action){case`written`:n.push(` ${e}${i}${a} ${_(`installed`)}`);break;case`overwritten`:n.push(` ${e}${i}${a} ${_(`updated`)}`);break;case`skipped-unsupported`:n.push(` ${e}${i}no known project skill surface; skipped`);break;case`failed`:n.push(` ${e}${i}${a} ${v(`FAILED`)}: ${r.error}`);break}}}if(i&&(n.push(``),n.push(`For failed editors, add the MCP server entry or project skill manually. See:`),n.push(` https://github.com/inkeep/open-knowledge#mcp-setup`)),e.legacyProjectConfigs.length>0){n.push(``),n.push(`Project MCP configs found:`);for(let r of e.legacyProjectConfigs)n.push(` ${r.label} ${D(t,r.path)}`);n.push(` These project-local files may override the global config. Remove them if you want fully user-scoped MCP setup in this project.`)}if(e.skillInstall)switch(n.push(``),n.push(b(`User-global skill:`)),e.skillInstall){case`installed`:n.push(` open-knowledge ${_(`installed to detected agent hosts`)} via \`npx skills\``);break;case`skip-current`:n.push(` open-knowledge ${_(`already installed at current version`)}`);break;case`failed`:n.push(` ${y(`open-knowledge install failed — MCP still configured; run manually:`)}`),n.push(` ${y(` npx skills@~1.5.0 add <bundled-path> --agent '*' -g -y --copy`)}`);break}if(e.claudeDesktopDetected&&(n.push(``),n.push(`Claude Desktop App detected. To enable in Claude Chat & Cowork, run: ${b(`ok install-skill`)}`)),e.preview?(n.push(``),n.push(x(e.preview,t))):e.previewWarning&&(n.push(``),n.push(`Content preview unavailable: ${e.previewWarning}`)),r){let t=new Set,r=e.editors.filter(e=>e.action===`written`||e.action===`overwritten`).filter(e=>!t.has(e.editorId)&&t.add(e.editorId)).map(e=>e.label);n.push(``),n.push(`${_(`✓`)} ${b(`Next steps:`)}`),n.push(` 1. Open your editor (${g(r.join(` / `))})`),n.push(` 2. Approve the MCP server when prompted`),n.push(` 3. (Optional) scaffold the starter knowledge-base structure:`),n.push(` - ${g(`ok seed`)}`),n.push(` 4. Use the three MCP workflow tools as you build the wiki:`),n.push(` - ${g(`mcp__open-knowledge__ingest`)} — capture an external source`),n.push(` - ${g(`mcp__open-knowledge__research`)} — gather sources and write findings`),n.push(` - ${g(`mcp__open-knowledge__consolidate`)} — promote research to canonical articles`)}return n.join(`
|
|
395
395
|
`)}function br(e,t){let n=[];for(let r of zn)pr(Q[r],e,t)&&n.push(r);return n}function xr(){return new i(`init`).description(`Scaffold .ok/ in the current directory and register the MCP server for your editor(s)`).option(`--mcp`,`Register the MCP server for selected editors (default: true)`,!0).option(`--no-mcp`,`Scaffold the .ok/ directory but do not touch MCP config`).option(`--dev-mcp`,`Register a local dev MCP entry using node + packages/cli/dist/cli.mjs with debug logging`).addOption(new r(`--scope <scope>`,`Write MCP config at user level, project level, or both`).choices([`user`,`project`,`both`])).action(async e=>{let t=process.cwd(),n;try{n=await vr({cwd:t,mcp:e.mcp,devMcp:e.devMcp,scope:e.scope})}catch(e){if(e instanceof u){process.stderr.write(`open-knowledge requires git to initialize a parent repo. Install git or run 'git init' yourself, then re-run.
|
|
396
|
-
`),e.stderr&&process.stderr.write(`${e.stderr.trim()}\n`),process.exitCode=1;return}throw e}try{let{previewContent:e}=await import(`./preview-
|
|
397
|
-
//# sourceMappingURL=init-
|
|
396
|
+
`),e.stderr&&process.stderr.write(`${e.stderr.trim()}\n`),process.exitCode=1;return}throw e}try{let{previewContent:e}=await import(`./preview-BjoTulUl.mjs`),{loadConfig:r}=await import(`./loader-CHkc9V89.mjs`),{resolveContentDir:i}=await import(`./dist-Bu-MwAbD.mjs`),{config:a}=r(t),o=i(a,t);n.preview=e({projectDir:t,contentDir:o})}catch(e){n.previewWarning=e instanceof Error?e.message:String(e)}process.stdout.write(`${yr(n,t)}\n`),(n.editors.some(e=>e.action===`failed`)||n.mcpAction===`failed`)&&(process.exitCode=1)})}export{L as S,ot as _,lr as a,ze as b,gr as c,Rn as d,rt as f,nt as g,it as h,_r as i,zn as l,tt as m,yr as n,vr as o,et as p,xr as r,$ as s,br as t,Q as u,Ze as v,ge as x,Be as y};
|
|
397
|
+
//# sourceMappingURL=init-B1cOyI0L.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./init-B1cOyI0L.mjs";export{e as runInit};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./loader-CWaAs1JL.mjs";export{e as loadConfig};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Ct as e,Q as t,dn as n}from"./dist-DfIz2LcA.mjs";import{d as r,rr as i}from"./dist-D4M20vXU.mjs";import{t as a}from"./constants-BWv15Llm.mjs";import{t as o}from"./is-object-DF0ZeuvD.mjs";import{resolve as s}from"node:path";import{existsSync as c,readFileSync as l}from"node:fs";import{homedir as u}from"node:os";var d=n();function f(e,t){let n={...e};for(let r of Object.keys(t)){let i=e[r],a=t[r];o(a)&&o(i)?n[r]=f(i,a):a!==void 0&&(n[r]=a)}return n}function p(e){if(!c(e))return{value:null,path:e,source:null,doc:null};let t;try{t=l(e,`utf-8`)}catch(t){return console.warn(`[config] Failed to read ${e}: ${t instanceof Error?t.message:t}`),{value:null,path:e,source:null,doc:null}}let n=(0,d.parseDocument)(t);if(n.errors.length>0)return console.warn(`[config] Failed to parse ${e}: ${n.errors.map(e=>e.message).join(`; `)}`),{value:null,path:e,source:t,doc:null};let r=n.toJSON();return o(r)?{value:r,path:e,source:t,doc:n}:{value:null,path:e,source:t,doc:n}}const m=[`include`,`exclude`];function h(e){let t="Run `ok config migrate` to strip the obsolete key from config.yml automatically, or remove it by hand.";return e===`exclude`?[`Move these patterns to .okignore at the project root (gitignore syntax, 1:1 migration).`,t].join(` `):[`content.include has been removed.`,`For subdirectory scoping, set content.dir in .ok/config.yml instead.`,`For pattern-based filtering, use .okignore (gitignore syntax — exclude-only; do not copy include patterns directly).`,t].join(` `)}function g(t){let n=t.value;if(!o(n))return[];let r=n.content;if(!o(r))return[];let i=[];for(let n of m)if(n in r){let r=[`content`,n],a;t.doc!==null&&t.source!==null&&(a=e({file:t.path,source:t.source,doc:t.doc,path:r})),i.push({code:`REMOVED_KEY`,path:r,redirect:h(n),...a===void 0?{}:{source:a}})}return i}function _(t,n){return t.map(t=>{let r=t.path.map(e=>typeof e==`symbol`?String(e):e),i={path:r,message:t.message,issueCode:t.code};if(n.doc!==null&&n.source!==null){let t=e({file:n.path,source:n.source,doc:n.doc,path:r});if(t!==void 0)return{...i,source:t}}return i})}function v(e){let n=e??process.cwd(),o=[],c=s(u(),`.ok`,a),l=i({absPath:c}),d={};l.valid&&l.source!==void 0?(d=f(d,l.value),o.push(c)):l.valid;let m=s(n,`.ok`,a),h=p(m);if(h.value!==null){let e=g(h);if(e.length>0)throw Error(e.map(t).join(`
|
|
2
2
|
|
|
3
|
-
`));d=f(d,h.value),o.push(m)}y(d,[`upload`,`maxBytes`],`streaming uploads have no user-facing cap`),y(d,[`github`,`oauthAppClientId`],`use the OPEN_KNOWLEDGE_GITHUB_CLIENT_ID env var instead`),y(d,[`server`,`host`],`use the --host flag or HOST env var instead`),y(d,[`server`,`openOnAgentEdit`]),y(d,[`mcp`,`autoStart`],`to disable auto-start, set OK_MCP_AUTOSTART=0`),y(d,[`mcp`,`tools`,`read_document`,`historyDepth`]),y(d,[`mcp`,`tools`,`grep`,`maxResults`]),y(d,[`mcp`,`tools`,`search`,`maxResults`]);let v=r.safeParse(d);if(!v.success){let
|
|
4
|
-
//# sourceMappingURL=loader-
|
|
3
|
+
`));d=f(d,h.value),o.push(m)}y(d,[`upload`,`maxBytes`],`streaming uploads have no user-facing cap`),y(d,[`github`,`oauthAppClientId`],`use the OPEN_KNOWLEDGE_GITHUB_CLIENT_ID env var instead`),y(d,[`server`,`host`],`use the --host flag or HOST env var instead`),y(d,[`server`,`openOnAgentEdit`]),y(d,[`mcp`,`autoStart`],`to disable auto-start, set OK_MCP_AUTOSTART=0`),y(d,[`mcp`,`tools`,`read_document`,`historyDepth`]),y(d,[`mcp`,`tools`,`grep`,`maxResults`]),y(d,[`mcp`,`tools`,`search`,`maxResults`]);let v=r.safeParse(d);if(!v.success){let e={code:`SCHEMA_INVALID`,issues:_(v.error.issues,h)};throw Error(t(e))}return{config:v.data,sources:o}}function y(e,t,n){let r=e;for(let e=0;e<t.length-1;e++){if(!o(r))return;r=r[t[e]]}if(!o(r))return;let i=t[t.length-1];if(r[i]===void 0)return;let a=t.join(`.`);console.warn(`[config] ${a} is no longer user-configurable; ${n??`the value is hardcoded in @inkeep/open-knowledge-core`}. Remove the key to silence this warning.`)}export{v as t};
|
|
4
|
+
//# sourceMappingURL=loader-CWaAs1JL.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{execFile as e}from"node:child_process";const t=new Set([`http:`,`https:`]),n=/[\u0000-\u0020\u007F-\u009F"'`\\&|<>^()$;{}[\]*?!~]/;function r(e,t){console.warn(`Could not auto-open browser (${t}); visit ${e} manually`)}function i(i){let a;try{a=new URL(i)}catch{r(i,`invalid URL`);return}if(!t.has(a.protocol)){r(i,`unsupported scheme '${a.protocol}'`);return}if(n.test(i)){r(i,`URL contains unsafe characters`);return}e(process.platform===`darwin`?`open`:process.platform===`win32`?`cmd`:`xdg-open`,process.platform===`win32`?[`/c`,`start`,``,i]:[i],e=>{e&&console.warn(`Could not auto-open browser (${e.message}); visit ${i} manually`)})}export{i as openBrowser};
|
|
2
|
+
//# sourceMappingURL=open-browser-BOeCxs2W.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./preview-FAMk9J0z.mjs";export{t as formatPreviewBlock,e as previewContent};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{ft as e}from"./dist-
|
|
1
|
+
import{ft as e}from"./dist-D4M20vXU.mjs";import"./constants-BWv15Llm.mjs";import{join as t,relative as n}from"node:path";import{existsSync as r,lstatSync as i,readdirSync as a,realpathSync as o,statSync as s}from"node:fs";function c(r){let{projectDir:c,contentDir:l,sampleCap:u=5}=r,d=[],f=[];try{i(l)}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[`cannot access content directory ${l}: ${e instanceof Error?e.message:String(e)}`]}}let p;try{p=e({projectDir:c,contentDir:l})}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[e instanceof Error?e.message:String(e)]}}function m(e){let r;try{r=a(e,{withFileTypes:!0})}catch(t){let r=t instanceof Error?t.message:String(t);d.push(`could not read directory ${n(l,e)||`.`}: ${r}`);return}for(let i of r){let r=t(e,i.name);if(i.isSymbolicLink()){let e;try{e=o(r)}catch(e){let t=e.code;t===`ENOENT`||t===`ELOOP`?d.push(`broken or cyclic symlink: ${n(l,r)}`):d.push(`cannot resolve symlink ${n(l,r)}: ${t??`unknown error`}`);continue}let t;try{t=s(e)}catch{continue}if(t.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(t.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}else if(i.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(i.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}}return m(l),{totalCount:f.length,sample:f.slice(0,u),contentDir:l,warnings:d}}function l(e,i){let a=[],o=n(i,e.contentDir),s=o===``?`./`:`./${o}`;if(a.push(`Content:`),a.push(` Found ${e.totalCount} markdown files in ${s}`),e.sample.length>0){let t=e.sample.join(`, `),n=e.totalCount>e.sample.length?`, …`:``;a.push(` Sample: ${t}${n}`)}if(e.warnings.length>0)for(let t of e.warnings)a.push(` Warning: ${t}`);return a.push(``),r(t(i,`.ok`,`config.yml`))?(a.push(` To adjust scope, add patterns to .okignore at the project root.`),a.push(` To change the content root, edit .ok/config.yml → content.dir.`)):a.push(" Run `open-knowledge init` to scaffold config + .okignore."),a.push(``),a.push(` Re-check anytime: open-knowledge preview`),a.join(`
|
|
2
2
|
`)}export{c as n,l as t};
|
|
3
|
-
//# sourceMappingURL=preview-
|
|
3
|
+
//# sourceMappingURL=preview-FAMk9J0z.mjs.map
|
package/dist/public/assets/{ActivityModeContent-1ymqlcHI.js → ActivityModeContent-BS-F_q5b.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ActivityPanelDiffView-
|
|
2
|
-
import{o as e}from"./chunk-CFjPhJqf.js";import{t}from"./preload-helper-2ej06EnG.js";import{n,r,t as i}from"./compiler-runtime-CVnuRdak.js";import{m as a}from"./doc-hash-Q6dTjwu5.js";import{C as o,t as s}from"./button-BsFpqlpT.js";import{Ft as c,Xt as l,Yt as u,Zt as d,n as f,r as p}from"./DocumentContext-bvfr7pL2.js";import{f as m,i as h,m as g,r as _,t as v}from"./agent-presence-Ds2n3U5P.js";import{a as y,c as b,i as x,o as S,s as C,t as w,x as T}from"./dialog-Cv1qneWl.js";import{i as E,n as D,t as O}from"./tooltip-CBGDOTMI.js";var k=o(`rewind`,[[`path`,{d:`M12 6a2 2 0 0 0-3.414-1.414l-6 6a2 2 0 0 0 0 2.828l6 6A2 2 0 0 0 12 18z`,key:`2a1g8i`}],[`path`,{d:`M22 6a2 2 0 0 0-3.414-1.414l-6 6a2 2 0 0 0 0 2.828l6 6A2 2 0 0 0 22 18z`,key:`rg3s36`}]]),A=i(),j=e(n(),1),M=500,ee=64;async function te(e){let t=`/api/agent-activity?agentId=${encodeURIComponent(e)}`,n=await fetch(t);if(!n.ok)throw Error(`agent-activity fetch failed: HTTP ${n.status}`);let r=await n.json();if(!r.ok)throw Error(r.error??`agent-activity fetch not ok`);return{sessionAlive:r.sessionAlive??!1,agent:r.agent??null,files:r.files??[]}}async function N(e,t,n){let r=`/api/agent-burst-diff?agentId=${encodeURIComponent(e)}&docName=${encodeURIComponent(t)}&stackIndex=${n}`,i=await fetch(r);if(!i.ok)throw Error(`agent-burst-diff fetch failed: HTTP ${i.status}`);let a=await i.json();if(!a.ok)throw Error(a.error??`agent-burst-diff fetch not ok`);return a.diff??``}function ne(e){let t=(0,A.c)(23),{systemProvider:n}=f(),[r,i]=(0,j.useState)(null),[o,s]=(0,j.useState)(`idle`),[c,l]=(0,j.useState)(null),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=new h(ee),t[0]=u):u=t[0];let d=(0,j.useRef)(u),p=(0,j.useRef)(0),m;t[1]===n?m=t[2]:(m=e=>{let t=p.current+=1;s(`loading`),l(null),te(e).then(r=>{if(p.current!==t)return;let a=ie(n,e);i({...r,writingDocs:a}),s(`ready`)}).catch(e=>{p.current===t&&(l(e instanceof Error?e.message:String(e)),s(`error`))})},t[1]=n,t[2]=m);let g=m,_;t[3]!==e||t[4]!==g?(_=()=>{if(!e){p.current+=1,i(null),s(`idle`),l(null),d.current.clear();return}d.current.clear(),g(e);let t=null,n=a(n=>{n.includes(`session-activity`)&&(t&&clearTimeout(t),t=setTimeout(()=>{t=null,g(e)},M))});return()=>{t&&clearTimeout(t),n()}},t[3]=e,t[4]=g,t[5]=_):_=t[5];let v;t[6]===e?v=t[7]:(v=[e],t[6]=e,t[7]=v),(0,j.useEffect)(_,v);let y,b;t[8]!==e||t[9]!==n?(y=()=>{if(!e||!n)return;let t=()=>{if(!n.awareness)return;let t=ie(n,e);i(e=>!e||re(e.writingDocs,t)?e:{...e,writingDocs:t})},r=n.awareness;if(!r||typeof r.on!=`function`){t();return}r.on(`update`,t),t();let a=setInterval(t,1e3);return()=>{clearInterval(a),typeof r.off==`function`&&r.off(`update`,t)}},b=[e,n],t[8]=e,t[9]=n,t[10]=y,t[11]=b):(y=t[10],b=t[11]),(0,j.useEffect)(y,b);let x;t[12]===e?x=t[13]:(x=async(t,n)=>{if(!e)return``;let r=`${t}\0${n}`,i=d.current.get(r);if(i!==void 0)return i;let a=await N(e,t,n);return d.current.set(r,a),a},t[12]=e,t[13]=x);let S=x,C;t[14]!==e||t[15]!==g?(C=()=>{e&&g(e)},t[14]=e,t[15]=g,t[16]=C):C=t[16];let w=C,T;return t[17]!==r||t[18]!==c||t[19]!==S||t[20]!==w||t[21]!==o?(T={data:r,status:o,error:c,reload:w,fetchBurstDiff:S},t[17]=r,t[18]=c,t[19]=S,t[20]=w,t[21]=o,t[22]=T):T=t[22],T}function re(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function ie(e,t){let n=new Set;if(!e)return n;let r=e.awareness;if(!v(r))return n;let i=[t,t.startsWith(`agent-`)?t.slice(6):`agent-${t}`];for(let e of r.getStates().values()){let t=e.agentPresence;if(t)for(let e of i){let r=t[e];r&&r.mode===`writing`&&r.currentDoc&&n.add(r.currentDoc)}}return n}var P=r(),ae=(0,j.lazy)(async()=>({default:(await t(()=>import(`./ActivityPanelDiffView-DoHWP1ak.js`),__vite__mapDeps([0,1,2,3]),import.meta.url)).ActivityPanelDiffView}));function oe(e,t){let n=Math.max(0,t-e);return n<6e4?`${Math.round(n/1e3)}s ago`:n<36e5?`${Math.round(n/6e4)}m ago`:new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function se(e){let t=(0,A.c)(38),{burst:n,docName:r,fetchBurstDiff:i}=e,[a,o]=(0,j.useState)(!1),[s,c]=(0,j.useState)(null),[u,f]=(0,j.useState)(null),[p,m]=(0,j.useState)(!1),[h,g]=(0,j.useState)(ce),_,v;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>{let e=setInterval(()=>g(Date.now()),3e4);return()=>clearInterval(e)},v=[],t[0]=_,t[1]=v):(_=t[0],v=t[1]),(0,j.useEffect)(_,v);let y;t[2]!==n.stackIndex||t[3]!==s||t[4]!==r||t[5]!==a||t[6]!==i||t[7]!==p?(y=()=>{let e=!a;o(e),e&&s===null&&!p&&(m(!0),f(null),i(r,n.stackIndex).then(e=>{c(e),m(!1)}).catch(e=>{f(e instanceof Error?e.message:String(e)),m(!1)}))},t[2]=n.stackIndex,t[3]=s,t[4]=r,t[5]=a,t[6]=i,t[7]=p,t[8]=y):y=t[8];let b=y,x=`${a?`Collapse`:`Expand`} burst ${n.stackIndex+1} diff`,S;t[9]===a?S=t[10]:(S=a?(0,P.jsx)(d,{className:`size-3 shrink-0`,"aria-hidden":`true`}):(0,P.jsx)(l,{className:`size-3 shrink-0`,"aria-hidden":`true`}),t[9]=a,t[10]=S);let C;t[11]!==n.ts||t[12]!==h?(C=oe(n.ts,h),t[11]=n.ts,t[12]=h,t[13]=C):C=t[13];let w;t[14]===C?w=t[15]:(w=(0,P.jsx)(`span`,{className:`font-mono`,children:C}),t[14]=C,t[15]=w);let T;t[16]===n.additions?T=t[17]:(T=(0,P.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additions]}),t[16]=n.additions,t[17]=T);let E;t[18]===n.deletions?E=t[19]:(E=(0,P.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletions]}),t[18]=n.deletions,t[19]=E);let D;t[20]!==T||t[21]!==E?(D=(0,P.jsxs)(`span`,{className:`ml-auto font-mono`,children:[T,` `,E]}),t[20]=T,t[21]=E,t[22]=D):D=t[22];let O;t[23]!==a||t[24]!==D||t[25]!==x||t[26]!==S||t[27]!==w||t[28]!==b?(O=(0,P.jsxs)(`button`,{type:`button`,onClick:b,className:`flex w-full items-center gap-2 px-4 py-1.5 text-xs text-muted-foreground hover:bg-muted/40`,"aria-expanded":a,"aria-label":x,children:[S,w,D]}),t[23]=a,t[24]=D,t[25]=x,t[26]=S,t[27]=w,t[28]=b,t[29]=O):O=t[29];let k;t[30]!==s||t[31]!==a||t[32]!==u||t[33]!==p?(k=a?(0,P.jsx)(`div`,{className:`bg-muted/20`,children:p?(0,P.jsx)(`div`,{className:`px-4 py-2 text-xs text-muted-foreground italic`,children:`Loading diff…`}):u?(0,P.jsxs)(`div`,{className:`px-4 py-2 text-xs text-destructive`,children:[`Failed: `,u]}):s===null?(0,P.jsx)(`div`,{className:`px-4 py-2 text-xs text-muted-foreground italic`,children:`No diff.`}):(0,P.jsx)(j.Suspense,{fallback:(0,P.jsx)(`div`,{className:`px-4 py-2 text-xs text-muted-foreground italic`,children:`Loading diff…`}),children:(0,P.jsx)(ae,{diff:s})})}):null,t[30]=s,t[31]=a,t[32]=u,t[33]=p,t[34]=k):k=t[34];let M;return t[35]!==O||t[36]!==k?(M=(0,P.jsxs)(`div`,{className:`border-t border-border/50`,children:[O,k]}),t[35]=O,t[36]=k,t[37]=M):M=t[37],M}function ce(){return Date.now()}function le(e,t){let n=Math.max(0,t-e);return n<6e4?`${Math.round(n/1e3)}s ago`:n<36e5?`${Math.round(n/6e4)}m ago`:`${Math.round(n/36e5)}h ago`}function ue(e){let t=(0,A.c)(93),{file:n,sessionAlive:r,isWriting:i,onNavigate:a,onUndoLast:o,onUndoAll:c,fetchBurstDiff:u}=e,[f,p]=(0,j.useState)(!1),[h,g]=(0,j.useState)(!1),[_,v]=(0,j.useState)(!1),[T,M]=(0,j.useState)(fe),ee,te;if(t[0]===Symbol.for(`react.memo_cache_sentinel`)?(ee=()=>{let e=setInterval(()=>M(Date.now()),3e4);return()=>clearInterval(e)},te=[],t[0]=ee,t[1]=te):(ee=t[0],te=t[1]),(0,j.useEffect)(ee,te),n.bursts.length===0)return null;let N=!r||n.bursts.length===0||_,ne=r?n.bursts.length===0?`Nothing to undo on this file`:null:`Session ended — undo unavailable`,re;t[2]!==N||t[3]!==n.docName||t[4]!==o?(re=e=>{e.stopPropagation(),!N&&(v(!0),Promise.resolve(o(n.docName)).finally(()=>v(!1)))},t[2]=N,t[3]=n.docName,t[4]=o,t[5]=re):re=t[5];let ie=re,ae;t[6]===N?ae=t[7]:(ae=e=>{e.stopPropagation(),!N&&g(!0)},t[6]=N,t[7]=ae);let oe=ae,ce;t[8]!==N||t[9]!==n.docName||t[10]!==c?(ce=()=>{g(!1),!N&&(v(!0),Promise.resolve(c(n.docName)).finally(()=>v(!1)))},t[8]=N,t[9]=n.docName,t[10]=c,t[11]=ce):ce=t[11];let ue=ce,F;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(F=()=>p(de),t[12]=F):F=t[12];let pe=f?`Collapse ${n.docName}`:`Expand ${n.docName}`,I;t[13]===f?I=t[14]:(I=f?(0,P.jsx)(d,{className:`size-4`,"aria-hidden":`true`}):(0,P.jsx)(l,{className:`size-4`,"aria-hidden":`true`}),t[13]=f,t[14]=I);let L;t[15]!==f||t[16]!==pe||t[17]!==I?(L=(0,P.jsx)(`button`,{type:`button`,onClick:F,className:`flex size-5 shrink-0 items-center justify-center rounded hover:bg-muted`,"aria-expanded":f,"aria-label":pe,"data-testid":`activity-panel-file-row-carrot`,children:I}),t[15]=f,t[16]=pe,t[17]=I,t[18]=L):L=t[18];let R;t[19]!==n.docName||t[20]!==a?(R=()=>a(n.docName),t[19]=n.docName,t[20]=a,t[21]=R):R=t[21];let me=`Navigate to ${n.docName}`,z;t[22]!==n.docName||t[23]!==R||t[24]!==me?(z=(0,P.jsx)(`button`,{type:`button`,onClick:R,className:`min-w-0 flex-1 truncate text-left text-foreground hover:underline focus-visible:outline-ring`,"aria-label":me,"data-testid":`activity-panel-file-row-filename`,title:n.docName,children:n.docName}),t[22]=n.docName,t[23]=R,t[24]=me,t[25]=z):z=t[25];let he=`Undo last edit on ${n.docName}`,ge;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,P.jsx)(m,{className:`size-3.5`,"aria-hidden":`true`}),t[26]=ge):ge=t[26];let B;t[27]!==N||t[28]!==ie||t[29]!==he?(B=(0,P.jsx)(E,{asChild:!0,children:(0,P.jsx)(s,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6 shrink-0`,onClick:ie,disabled:N,"aria-label":he,"data-testid":`activity-panel-undo-last`,children:ge})}),t[27]=N,t[28]=ie,t[29]=he,t[30]=B):B=t[30];let _e=ne??`Undo last edit`,V;t[31]===_e?V=t[32]:(V=(0,P.jsx)(D,{side:`bottom`,children:_e}),t[31]=_e,t[32]=V);let H;t[33]!==B||t[34]!==V?(H=(0,P.jsxs)(O,{children:[B,V]}),t[33]=B,t[34]=V,t[35]=H):H=t[35];let ve=`Undo all edits on ${n.docName}`,ye;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,P.jsx)(k,{className:`size-3.5`,"aria-hidden":`true`}),t[36]=ye):ye=t[36];let be;t[37]!==N||t[38]!==oe||t[39]!==ve?(be=(0,P.jsx)(E,{asChild:!0,children:(0,P.jsx)(s,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6 shrink-0`,onClick:oe,disabled:N,"aria-label":ve,"data-testid":`activity-panel-undo-all`,children:ye})}),t[37]=N,t[38]=oe,t[39]=ve,t[40]=be):be=t[40];let xe=ne??`Undo all edits`,U;t[41]===xe?U=t[42]:(U=(0,P.jsx)(D,{side:`bottom`,children:xe}),t[41]=xe,t[42]=U);let W;t[43]!==be||t[44]!==U?(W=(0,P.jsxs)(O,{children:[be,U]}),t[43]=be,t[44]=U,t[45]=W):W=t[45];let G;t[46]===n.additionsTotal?G=t[47]:(G=(0,P.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additionsTotal]}),t[46]=n.additionsTotal,t[47]=G);let K;t[48]===n.deletionsTotal?K=t[49]:(K=(0,P.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletionsTotal]}),t[48]=n.deletionsTotal,t[49]=K);let q;t[50]!==G||t[51]!==K?(q=(0,P.jsxs)(`span`,{className:`shrink-0 font-mono text-xs`,children:[G,` `,K]}),t[50]=G,t[51]=K,t[52]=q):q=t[52];let J;t[53]!==n.lastTs||t[54]!==T?(J=le(n.lastTs,T),t[53]=n.lastTs,t[54]=T,t[55]=J):J=t[55];let Y;t[56]===J?Y=t[57]:(Y=(0,P.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:J}),t[56]=J,t[57]=Y);let X;t[58]===i?X=t[59]:(X=i?(0,P.jsx)(`span`,{className:`shrink-0 text-[11px] text-primary animate-pulse`,role:`status`,children:`writing…`}):null,t[58]=i,t[59]=X);let Z;t[60]!==z||t[61]!==H||t[62]!==W||t[63]!==q||t[64]!==Y||t[65]!==X||t[66]!==L?(Z=(0,P.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 text-sm`,children:[L,z,H,W,q,Y,X]}),t[60]=z,t[61]=H,t[62]=W,t[63]=q,t[64]=Y,t[65]=X,t[66]=L,t[67]=Z):Z=t[67];let Q;t[68]!==f||t[69]!==u||t[70]!==n.bursts||t[71]!==n.docName?(Q=f?(0,P.jsx)(`div`,{children:n.bursts.map(e=>(0,P.jsx)(se,{burst:e,docName:n.docName,fetchBurstDiff:u},`${n.docName}:${e.stackIndex}`))}):null,t[68]=f,t[69]=u,t[70]=n.bursts,t[71]=n.docName,t[72]=Q):Q=t[72];let Se;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(Se=(0,P.jsx)(b,{children:`Undo all edits on this file?`}),t[73]=Se):Se=t[73];let Ce;t[74]===n.docName?Ce=t[75]:(Ce=(0,P.jsx)(`span`,{className:`font-mono text-foreground`,children:n.docName}),t[74]=n.docName,t[75]=Ce);let we=n.bursts.length===1?``:`s`,Te;t[76]!==n.bursts.length||t[77]!==Ce||t[78]!==we?(Te=(0,P.jsxs)(C,{children:[Se,(0,P.jsxs)(y,{children:[`This will revert every change this agent has made to`,` `,Ce,` in their current session (`,n.bursts.length,` burst`,we,`). Other files and other writers are not affected.`]})]}),t[76]=n.bursts.length,t[77]=Ce,t[78]=we,t[79]=Te):Te=t[79];let Ee;t[80]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=(0,P.jsx)(s,{type:`button`,variant:`outline`,onClick:()=>g(!1),"data-testid":`activity-panel-undo-all-cancel`,children:`Cancel`}),t[80]=Ee):Ee=t[80];let De;t[81]===ue?De=t[82]:(De=(0,P.jsxs)(S,{children:[Ee,(0,P.jsx)(s,{type:`button`,variant:`destructive`,onClick:ue,"data-testid":`activity-panel-undo-all-confirm`,children:`Undo all`})]}),t[81]=ue,t[82]=De);let Oe;t[83]!==Te||t[84]!==De?(Oe=(0,P.jsxs)(x,{className:`sm:max-w-md`,children:[Te,De]}),t[83]=Te,t[84]=De,t[85]=Oe):Oe=t[85];let $;t[86]!==h||t[87]!==Oe?($=(0,P.jsx)(w,{open:h,onOpenChange:g,children:Oe}),t[86]=h,t[87]=Oe,t[88]=$):$=t[88];let ke;return t[89]!==Z||t[90]!==Q||t[91]!==$?(ke=(0,P.jsxs)(`div`,{className:`border-b border-border`,"data-testid":`activity-panel-file-row`,children:[Z,Q,$]}),t[89]=Z,t[90]=Q,t[91]=$,t[92]=ke):ke=t[92],ke}function de(e){return!e}function fe(){return Date.now()}async function F(e){let t=await fetch(`/api/agent-undo`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...e,agentId:e.connectionId})});if(!t.ok)throw Error(`agent-undo failed: HTTP ${t.status}`)}function pe(e){return`#/${e.split(`/`).map(e=>encodeURIComponent(e)).join(`/`)}`}function I(e){typeof window>`u`||(window.location.hash=pe(e))}function L(){let e=(0,A.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,P.jsxs)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,role:`status`,"aria-busy":`true`,children:[(0,P.jsx)(c,{className:`mr-2 size-4 animate-spin`,"aria-hidden":`true`}),(0,P.jsx)(`span`,{className:`text-sm`,children:`Loading agent activity…`})]}),e[0]=t):t=e[0],t}function R(e){let t=(0,A.c)(9),{error:n,onRetry:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,P.jsx)(u,{className:`size-6 text-destructive`,"aria-hidden":`true`}),t[0]=i):i=t[0];let a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,P.jsx)(`p`,{className:`text-sm font-medium`,children:`Failed to load activity`}),t[1]=a):a=t[1];let o;t[2]===n?o=t[3]:(o=(0,P.jsxs)(`div`,{className:`space-y-1`,children:[a,(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n})]}),t[2]=n,t[3]=o);let c;t[4]===r?c=t[5]:(c=(0,P.jsx)(s,{type:`button`,variant:`outline`,size:`sm`,onClick:r,children:`Retry`}),t[4]=r,t[5]=c);let l;return t[6]!==o||t[7]!==c?(l=(0,P.jsxs)(`div`,{className:`flex flex-col items-center gap-3 p-6 text-center`,role:`alert`,"data-testid":`activity-panel-error`,children:[i,o,c]}),t[6]=o,t[7]=c,t[8]=l):l=t[8],l}function me(){let e=(0,A.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,P.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,"data-testid":`activity-panel-empty`,children:(0,P.jsx)(`p`,{className:`text-sm italic`,children:`No edits yet.`})}),e[0]=t):t=e[0],t}function z(e){let t=(0,A.c)(8),{onExit:n}=e,r;t[0]===n?r=t[1]:(r=(0,P.jsx)(he,{onClick:n}),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,P.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:`Agent activity`}),t[2]=i):i=t[2];let a;t[3]===r?a=t[4]:(a=(0,P.jsxs)(`div`,{className:`flex shrink-0 flex-row items-center gap-2 border-b border-border px-3 py-2`,children:[r,i]}),t[3]=r,t[4]=a);let o;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,P.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-6 text-muted-foreground`,children:(0,P.jsx)(`p`,{className:`text-center text-sm italic`,children:`Click an agent's avatar in the presence bar to view their session.`})}),t[5]=o):o=t[5];let s;return t[6]===a?s=t[7]:(s=(0,P.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel-no-agent`,"aria-label":`Agent activity`,children:[a,o]}),t[6]=a,t[7]=s),s}function he(e){let t=(0,A.c)(6),{onClick:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,P.jsx)(g,{}),t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i=(0,P.jsx)(E,{asChild:!0,children:(0,P.jsx)(s,{type:`button`,variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,onClick:n,"aria-label":`Back to document view`,"data-testid":`docpanel-exit-agent-mode`,children:r})}),t[1]=n,t[2]=i);let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,P.jsx)(D,{side:`bottom`,children:`Back to document view`}),t[3]=a):a=t[3];let o;return t[4]===i?o=t[5]:(o=(0,P.jsxs)(O,{children:[i,a]}),t[4]=i,t[5]=o),o}function ge(e){let t=(0,A.c)(9),{lastTs:n}=e,[r]=(0,j.useState)(B),i;t[0]!==n||t[1]!==r?(i=n?_e(r-n):null,t[0]=n,t[1]=r,t[2]=i):i=t[2];let a=i,o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,P.jsx)(`span`,{className:`font-medium`,children:`Session ended`}),t[3]=o):o=t[3];let s;t[4]===a?s=t[5]:(s=a?(0,P.jsxs)(`span`,{children:[` · `,a]}):null,t[4]=a,t[5]=s);let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,P.jsx)(`div`,{className:`mt-1 opacity-80`,children:`Undo buttons are disabled — per-session state has been garbage-collected.`}),t[6]=c):c=t[6];let l;return t[7]===s?l=t[8]:(l=(0,P.jsxs)(`div`,{className:`border-b border-border bg-muted/40 px-4 py-3 text-xs text-muted-foreground`,"data-testid":`activity-panel-session-ended`,children:[o,s,c]}),t[7]=s,t[8]=l),l}function B(){return Date.now()}function _e(e){let t=Math.max(0,e);return t<6e4?`${Math.round(t/1e3)}s ago`:t<36e5?`${Math.round(t/6e4)}m ago`:`${Math.round(t/36e5)}h ago`}function V(e){let t=(0,A.c)(10),{agent:n,size:r}=e,i=r===void 0?28:r,a;t[0]!==n.color||t[1]!==i?(a={backgroundColor:n.color,width:i,height:i},t[0]=n.color,t[1]=i,t[2]=a):a=t[2];let o=i*.57,s=i*.57,c;t[3]!==n.icon||t[4]!==o||t[5]!==s?(c=(0,P.jsx)(_,{icon:n.icon,width:o,height:s}),t[3]=n.icon,t[4]=o,t[5]=s,t[6]=c):c=t[6];let l;return t[7]!==a||t[8]!==c?(l=(0,P.jsx)(`span`,{className:`inline-flex shrink-0 items-center justify-center rounded-full text-white ring-2 ring-background`,style:a,"aria-hidden":`true`,children:c}),t[7]=a,t[8]=c,t[9]=l):l=t[9],l}function H(e){let t=(0,A.c)(20),{data:n,status:r,error:i,reload:a,fetchBurstDiff:o,onExit:s,onNavigate:c,onUndoLast:l,onUndoAll:u}=e,d=n?.files?.[0]?.lastTs??null,f;t[0]===s?f=t[1]:(f=(0,P.jsx)(he,{onClick:s}),t[0]=s,t[1]=f);let p;t[2]===n?p=t[3]:(p=n?.agent?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(V,{agent:n.agent}),(0,P.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,P.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:n.agent.displayName}),(0,P.jsxs)(`p`,{className:`truncate text-xs text-muted-foreground`,children:[n.sessionAlive?`Active`:`Ended`,n.files.length>0?` · ${n.files.length} file${n.files.length===1?``:`s`}`:``]})]})]}):(0,P.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,P.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:`Agent activity`})}),t[2]=n,t[3]=p);let m;t[4]!==f||t[5]!==p?(m=(0,P.jsxs)(`div`,{className:`flex flex-row items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[f,p]}),t[4]=f,t[5]=p,t[6]=m):m=t[6];let h;t[7]!==n||t[8]!==i||t[9]!==o||t[10]!==d||t[11]!==c||t[12]!==u||t[13]!==l||t[14]!==a||t[15]!==r?(h=(0,P.jsx)(`div`,{className:`flex-1 overflow-y-auto`,"data-testid":`activity-panel-body`,children:r===`loading`&&n===null?(0,P.jsx)(L,{}):r===`error`&&i?(0,P.jsx)(R,{error:i,onRetry:a}):n===null?(0,P.jsx)(me,{}):(0,P.jsxs)(P.Fragment,{children:[n.sessionAlive?null:(0,P.jsx)(ge,{lastTs:d}),n.files.length===0?(0,P.jsx)(me,{}):n.files.map(e=>(0,P.jsx)(ue,{file:e,sessionAlive:n.sessionAlive,isWriting:n.writingDocs.has(e.docName),onNavigate:c,onUndoLast:l,onUndoAll:u,fetchBurstDiff:o},e.docName))]})}),t[7]=n,t[8]=i,t[9]=o,t[10]=d,t[11]=c,t[12]=u,t[13]=l,t[14]=a,t[15]=r,t[16]=h):h=t[16];let g;return t[17]!==m||t[18]!==h?(g=(0,P.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel`,"aria-label":`Agent activity`,children:[m,h]}),t[17]=m,t[18]=h,t[19]=g):g=t[19],g}function ve(){let e=(0,A.c)(22),{docPanelAgentId:t,closeActivityPanel:n}=f(),{openDocumentTransition:r}=p(),{data:i,status:a,error:o,reload:s,fetchBurstDiff:c}=ne(t);if(t===null){let t;return e[0]===n?t=e[1]:(t=(0,P.jsx)(z,{onExit:n}),e[0]=n,e[1]=t),t}let l;e[2]===r?l=e[3]:(l=e=>{r(e),I(e)},e[2]=r,e[3]=l);let u=l,d;e[4]!==i||e[5]!==t||e[6]!==s?(d=async e=>{try{await F({connectionId:t,docName:e,scope:`last`,agentName:i?.agent?.displayName}),s()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);T.error(`Undo failed: ${n}`),s()}},e[4]=i,e[5]=t,e[6]=s,e[7]=d):d=e[7];let m=d,h;e[8]!==i||e[9]!==t||e[10]!==s?(h=async e=>{try{await F({connectionId:t,docName:e,scope:`file`,agentName:i?.agent?.displayName}),T.success(`Undone all edits on ${e}`),s()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);T.error(`Undo all failed: ${n}`),s()}},e[8]=i,e[9]=t,e[10]=s,e[11]=h):h=e[11];let g=h,_;return e[12]!==n||e[13]!==i||e[14]!==o||e[15]!==c||e[16]!==u||e[17]!==g||e[18]!==m||e[19]!==s||e[20]!==a?(_=(0,P.jsx)(H,{data:i,status:a,error:o,reload:s,fetchBurstDiff:c,onExit:n,onNavigate:u,onUndoLast:m,onUndoAll:g}),e[12]=n,e[13]=i,e[14]=o,e[15]=c,e[16]=u,e[17]=g,e[18]=m,e[19]=s,e[20]=a,e[21]=_):_=e[21],_}export{ve as ActivityModeContent};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ActivityPanelDiffView-B_49ivYc.js","./chunk-CFjPhJqf.js","./compiler-runtime-CVnuRdak.js","./ActivityPanelDiffView-legcy4jI.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{o as e}from"./chunk-CFjPhJqf.js";import{t}from"./preload-helper-2ej06EnG.js";import{n,r,t as i}from"./compiler-runtime-CVnuRdak.js";import{m as a}from"./doc-hash-CfmBVnag.js";import{t as o,w as s}from"./button-qDXa0MxS.js";import{Jt as c,Pt as l,Xt as u,Yt as d,n as f,r as p}from"./DocumentContext-CKgn09Wu.js";import{f as m,i as h,m as g,r as _,t as v}from"./agent-presence-CaGG2gp7.js";import{S as y,a as b,c as x,i as S,o as C,s as w,t as T}from"./dialog-CV9Q4JrD.js";import{i as E,n as D,t as O}from"./tooltip-csUfbEtd.js";var k=s(`rewind`,[[`path`,{d:`M12 6a2 2 0 0 0-3.414-1.414l-6 6a2 2 0 0 0 0 2.828l6 6A2 2 0 0 0 12 18z`,key:`2a1g8i`}],[`path`,{d:`M22 6a2 2 0 0 0-3.414-1.414l-6 6a2 2 0 0 0 0 2.828l6 6A2 2 0 0 0 22 18z`,key:`rg3s36`}]]),A=i(),j=e(n(),1),M=500,ee=64;async function te(e){let t=`/api/agent-activity?agentId=${encodeURIComponent(e)}`,n=await fetch(t);if(!n.ok)throw Error(`agent-activity fetch failed: HTTP ${n.status}`);let r=await n.json();if(!r.ok)throw Error(r.error??`agent-activity fetch not ok`);return{sessionAlive:r.sessionAlive??!1,agent:r.agent??null,files:r.files??[]}}async function N(e,t,n){let r=`/api/agent-burst-diff?agentId=${encodeURIComponent(e)}&docName=${encodeURIComponent(t)}&stackIndex=${n}`,i=await fetch(r);if(!i.ok)throw Error(`agent-burst-diff fetch failed: HTTP ${i.status}`);let a=await i.json();if(!a.ok)throw Error(a.error??`agent-burst-diff fetch not ok`);return a.diff??``}function ne(e){let t=(0,A.c)(23),{systemProvider:n}=f(),[r,i]=(0,j.useState)(null),[o,s]=(0,j.useState)(`idle`),[c,l]=(0,j.useState)(null),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=new h(ee),t[0]=u):u=t[0];let d=(0,j.useRef)(u),p=(0,j.useRef)(0),m;t[1]===n?m=t[2]:(m=e=>{let t=p.current+=1;s(`loading`),l(null),te(e).then(r=>{if(p.current!==t)return;let a=ie(n,e);i({...r,writingDocs:a}),s(`ready`)}).catch(e=>{p.current===t&&(l(e instanceof Error?e.message:String(e)),s(`error`))})},t[1]=n,t[2]=m);let g=m,_;t[3]!==e||t[4]!==g?(_=()=>{if(!e){p.current+=1,i(null),s(`idle`),l(null),d.current.clear();return}d.current.clear(),g(e);let t=null,n=a(n=>{n.includes(`session-activity`)&&(t&&clearTimeout(t),t=setTimeout(()=>{t=null,g(e)},M))});return()=>{t&&clearTimeout(t),n()}},t[3]=e,t[4]=g,t[5]=_):_=t[5];let v;t[6]===e?v=t[7]:(v=[e],t[6]=e,t[7]=v),(0,j.useEffect)(_,v);let y,b;t[8]!==e||t[9]!==n?(y=()=>{if(!e||!n)return;let t=()=>{if(!n.awareness)return;let t=ie(n,e);i(e=>!e||re(e.writingDocs,t)?e:{...e,writingDocs:t})},r=n.awareness;if(!r||typeof r.on!=`function`){t();return}r.on(`update`,t),t();let a=setInterval(t,1e3);return()=>{clearInterval(a),typeof r.off==`function`&&r.off(`update`,t)}},b=[e,n],t[8]=e,t[9]=n,t[10]=y,t[11]=b):(y=t[10],b=t[11]),(0,j.useEffect)(y,b);let x;t[12]===e?x=t[13]:(x=async(t,n)=>{if(!e)return``;let r=`${t}\0${n}`,i=d.current.get(r);if(i!==void 0)return i;let a=await N(e,t,n);return d.current.set(r,a),a},t[12]=e,t[13]=x);let S=x,C;t[14]!==e||t[15]!==g?(C=()=>{e&&g(e)},t[14]=e,t[15]=g,t[16]=C):C=t[16];let w=C,T;return t[17]!==r||t[18]!==c||t[19]!==S||t[20]!==w||t[21]!==o?(T={data:r,status:o,error:c,reload:w,fetchBurstDiff:S},t[17]=r,t[18]=c,t[19]=S,t[20]=w,t[21]=o,t[22]=T):T=t[22],T}function re(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function ie(e,t){let n=new Set;if(!e)return n;let r=e.awareness;if(!v(r))return n;let i=[t,t.startsWith(`agent-`)?t.slice(6):`agent-${t}`];for(let e of r.getStates().values()){let t=e.agentPresence;if(t)for(let e of i){let r=t[e];r&&r.mode===`writing`&&r.currentDoc&&n.add(r.currentDoc)}}return n}var P=r(),ae=(0,j.lazy)(async()=>({default:(await t(()=>import(`./ActivityPanelDiffView-B_49ivYc.js`),__vite__mapDeps([0,1,2,3]),import.meta.url)).ActivityPanelDiffView}));function oe(e,t){let n=Math.max(0,t-e);return n<6e4?`${Math.round(n/1e3)}s ago`:n<36e5?`${Math.round(n/6e4)}m ago`:new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function se(e){let t=(0,A.c)(38),{burst:n,docName:r,fetchBurstDiff:i}=e,[a,o]=(0,j.useState)(!1),[s,c]=(0,j.useState)(null),[l,f]=(0,j.useState)(null),[p,m]=(0,j.useState)(!1),[h,g]=(0,j.useState)(ce),_,v;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>{let e=setInterval(()=>g(Date.now()),3e4);return()=>clearInterval(e)},v=[],t[0]=_,t[1]=v):(_=t[0],v=t[1]),(0,j.useEffect)(_,v);let y;t[2]!==n.stackIndex||t[3]!==s||t[4]!==r||t[5]!==a||t[6]!==i||t[7]!==p?(y=()=>{let e=!a;o(e),e&&s===null&&!p&&(m(!0),f(null),i(r,n.stackIndex).then(e=>{c(e),m(!1)}).catch(e=>{f(e instanceof Error?e.message:String(e)),m(!1)}))},t[2]=n.stackIndex,t[3]=s,t[4]=r,t[5]=a,t[6]=i,t[7]=p,t[8]=y):y=t[8];let b=y,x=`${a?`Collapse`:`Expand`} burst ${n.stackIndex+1} diff`,S;t[9]===a?S=t[10]:(S=a?(0,P.jsx)(u,{className:`size-3 shrink-0`,"aria-hidden":`true`}):(0,P.jsx)(d,{className:`size-3 shrink-0`,"aria-hidden":`true`}),t[9]=a,t[10]=S);let C;t[11]!==n.ts||t[12]!==h?(C=oe(n.ts,h),t[11]=n.ts,t[12]=h,t[13]=C):C=t[13];let w;t[14]===C?w=t[15]:(w=(0,P.jsx)(`span`,{className:`font-mono`,children:C}),t[14]=C,t[15]=w);let T;t[16]===n.additions?T=t[17]:(T=(0,P.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additions]}),t[16]=n.additions,t[17]=T);let E;t[18]===n.deletions?E=t[19]:(E=(0,P.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletions]}),t[18]=n.deletions,t[19]=E);let D;t[20]!==T||t[21]!==E?(D=(0,P.jsxs)(`span`,{className:`ml-auto font-mono`,children:[T,` `,E]}),t[20]=T,t[21]=E,t[22]=D):D=t[22];let O;t[23]!==a||t[24]!==D||t[25]!==x||t[26]!==S||t[27]!==w||t[28]!==b?(O=(0,P.jsxs)(`button`,{type:`button`,onClick:b,className:`flex w-full items-center gap-2 px-4 py-1.5 text-xs text-muted-foreground hover:bg-muted/40`,"aria-expanded":a,"aria-label":x,children:[S,w,D]}),t[23]=a,t[24]=D,t[25]=x,t[26]=S,t[27]=w,t[28]=b,t[29]=O):O=t[29];let k;t[30]!==s||t[31]!==a||t[32]!==l||t[33]!==p?(k=a?(0,P.jsx)(`div`,{className:`bg-muted/20`,children:p?(0,P.jsx)(`div`,{className:`px-4 py-2 text-xs text-muted-foreground italic`,children:`Loading diff…`}):l?(0,P.jsxs)(`div`,{className:`px-4 py-2 text-xs text-destructive`,children:[`Failed: `,l]}):s===null?(0,P.jsx)(`div`,{className:`px-4 py-2 text-xs text-muted-foreground italic`,children:`No diff.`}):(0,P.jsx)(j.Suspense,{fallback:(0,P.jsx)(`div`,{className:`px-4 py-2 text-xs text-muted-foreground italic`,children:`Loading diff…`}),children:(0,P.jsx)(ae,{diff:s})})}):null,t[30]=s,t[31]=a,t[32]=l,t[33]=p,t[34]=k):k=t[34];let M;return t[35]!==O||t[36]!==k?(M=(0,P.jsxs)(`div`,{className:`border-t border-border/50`,children:[O,k]}),t[35]=O,t[36]=k,t[37]=M):M=t[37],M}function ce(){return Date.now()}function le(e,t){let n=Math.max(0,t-e);return n<6e4?`${Math.round(n/1e3)}s ago`:n<36e5?`${Math.round(n/6e4)}m ago`:`${Math.round(n/36e5)}h ago`}function ue(e){let t=(0,A.c)(93),{file:n,sessionAlive:r,isWriting:i,onNavigate:a,onUndoLast:s,onUndoAll:c,fetchBurstDiff:l}=e,[f,p]=(0,j.useState)(!1),[h,g]=(0,j.useState)(!1),[_,v]=(0,j.useState)(!1),[y,M]=(0,j.useState)(fe),ee,te;if(t[0]===Symbol.for(`react.memo_cache_sentinel`)?(ee=()=>{let e=setInterval(()=>M(Date.now()),3e4);return()=>clearInterval(e)},te=[],t[0]=ee,t[1]=te):(ee=t[0],te=t[1]),(0,j.useEffect)(ee,te),n.bursts.length===0)return null;let N=!r||n.bursts.length===0||_,ne=r?n.bursts.length===0?`Nothing to undo on this file`:null:`Session ended — undo unavailable`,re;t[2]!==N||t[3]!==n.docName||t[4]!==s?(re=e=>{e.stopPropagation(),!N&&(v(!0),Promise.resolve(s(n.docName)).finally(()=>v(!1)))},t[2]=N,t[3]=n.docName,t[4]=s,t[5]=re):re=t[5];let ie=re,ae;t[6]===N?ae=t[7]:(ae=e=>{e.stopPropagation(),!N&&g(!0)},t[6]=N,t[7]=ae);let oe=ae,ce;t[8]!==N||t[9]!==n.docName||t[10]!==c?(ce=()=>{g(!1),!N&&(v(!0),Promise.resolve(c(n.docName)).finally(()=>v(!1)))},t[8]=N,t[9]=n.docName,t[10]=c,t[11]=ce):ce=t[11];let ue=ce,F;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(F=()=>p(de),t[12]=F):F=t[12];let pe=f?`Collapse ${n.docName}`:`Expand ${n.docName}`,I;t[13]===f?I=t[14]:(I=f?(0,P.jsx)(u,{className:`size-4`,"aria-hidden":`true`}):(0,P.jsx)(d,{className:`size-4`,"aria-hidden":`true`}),t[13]=f,t[14]=I);let L;t[15]!==f||t[16]!==pe||t[17]!==I?(L=(0,P.jsx)(`button`,{type:`button`,onClick:F,className:`flex size-5 shrink-0 items-center justify-center rounded hover:bg-muted`,"aria-expanded":f,"aria-label":pe,"data-testid":`activity-panel-file-row-carrot`,children:I}),t[15]=f,t[16]=pe,t[17]=I,t[18]=L):L=t[18];let R;t[19]!==n.docName||t[20]!==a?(R=()=>a(n.docName),t[19]=n.docName,t[20]=a,t[21]=R):R=t[21];let me=`Navigate to ${n.docName}`,z;t[22]!==n.docName||t[23]!==R||t[24]!==me?(z=(0,P.jsx)(`button`,{type:`button`,onClick:R,className:`min-w-0 flex-1 truncate text-left text-foreground hover:underline focus-visible:outline-ring`,"aria-label":me,"data-testid":`activity-panel-file-row-filename`,title:n.docName,children:n.docName}),t[22]=n.docName,t[23]=R,t[24]=me,t[25]=z):z=t[25];let he=`Undo last edit on ${n.docName}`,ge;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,P.jsx)(m,{className:`size-3.5`,"aria-hidden":`true`}),t[26]=ge):ge=t[26];let B;t[27]!==N||t[28]!==ie||t[29]!==he?(B=(0,P.jsx)(E,{asChild:!0,children:(0,P.jsx)(o,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6 shrink-0`,onClick:ie,disabled:N,"aria-label":he,"data-testid":`activity-panel-undo-last`,children:ge})}),t[27]=N,t[28]=ie,t[29]=he,t[30]=B):B=t[30];let _e=ne??`Undo last edit`,V;t[31]===_e?V=t[32]:(V=(0,P.jsx)(D,{side:`bottom`,children:_e}),t[31]=_e,t[32]=V);let H;t[33]!==B||t[34]!==V?(H=(0,P.jsxs)(O,{children:[B,V]}),t[33]=B,t[34]=V,t[35]=H):H=t[35];let ve=`Undo all edits on ${n.docName}`,ye;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,P.jsx)(k,{className:`size-3.5`,"aria-hidden":`true`}),t[36]=ye):ye=t[36];let be;t[37]!==N||t[38]!==oe||t[39]!==ve?(be=(0,P.jsx)(E,{asChild:!0,children:(0,P.jsx)(o,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6 shrink-0`,onClick:oe,disabled:N,"aria-label":ve,"data-testid":`activity-panel-undo-all`,children:ye})}),t[37]=N,t[38]=oe,t[39]=ve,t[40]=be):be=t[40];let xe=ne??`Undo all edits`,U;t[41]===xe?U=t[42]:(U=(0,P.jsx)(D,{side:`bottom`,children:xe}),t[41]=xe,t[42]=U);let W;t[43]!==be||t[44]!==U?(W=(0,P.jsxs)(O,{children:[be,U]}),t[43]=be,t[44]=U,t[45]=W):W=t[45];let G;t[46]===n.additionsTotal?G=t[47]:(G=(0,P.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additionsTotal]}),t[46]=n.additionsTotal,t[47]=G);let K;t[48]===n.deletionsTotal?K=t[49]:(K=(0,P.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletionsTotal]}),t[48]=n.deletionsTotal,t[49]=K);let q;t[50]!==G||t[51]!==K?(q=(0,P.jsxs)(`span`,{className:`shrink-0 font-mono text-xs`,children:[G,` `,K]}),t[50]=G,t[51]=K,t[52]=q):q=t[52];let J;t[53]!==n.lastTs||t[54]!==y?(J=le(n.lastTs,y),t[53]=n.lastTs,t[54]=y,t[55]=J):J=t[55];let Y;t[56]===J?Y=t[57]:(Y=(0,P.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:J}),t[56]=J,t[57]=Y);let X;t[58]===i?X=t[59]:(X=i?(0,P.jsx)(`span`,{className:`shrink-0 text-[11px] text-primary animate-pulse`,role:`status`,children:`writing…`}):null,t[58]=i,t[59]=X);let Z;t[60]!==z||t[61]!==H||t[62]!==W||t[63]!==q||t[64]!==Y||t[65]!==X||t[66]!==L?(Z=(0,P.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 text-sm`,children:[L,z,H,W,q,Y,X]}),t[60]=z,t[61]=H,t[62]=W,t[63]=q,t[64]=Y,t[65]=X,t[66]=L,t[67]=Z):Z=t[67];let Q;t[68]!==f||t[69]!==l||t[70]!==n.bursts||t[71]!==n.docName?(Q=f?(0,P.jsx)(`div`,{children:n.bursts.map(e=>(0,P.jsx)(se,{burst:e,docName:n.docName,fetchBurstDiff:l},`${n.docName}:${e.stackIndex}`))}):null,t[68]=f,t[69]=l,t[70]=n.bursts,t[71]=n.docName,t[72]=Q):Q=t[72];let Se;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(Se=(0,P.jsx)(x,{children:`Undo all edits on this file?`}),t[73]=Se):Se=t[73];let Ce;t[74]===n.docName?Ce=t[75]:(Ce=(0,P.jsx)(`span`,{className:`font-mono text-foreground`,children:n.docName}),t[74]=n.docName,t[75]=Ce);let we=n.bursts.length===1?``:`s`,Te;t[76]!==n.bursts.length||t[77]!==Ce||t[78]!==we?(Te=(0,P.jsxs)(w,{children:[Se,(0,P.jsxs)(b,{children:[`This will revert every change this agent has made to`,` `,Ce,` in their current session (`,n.bursts.length,` burst`,we,`). Other files and other writers are not affected.`]})]}),t[76]=n.bursts.length,t[77]=Ce,t[78]=we,t[79]=Te):Te=t[79];let Ee;t[80]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=(0,P.jsx)(o,{type:`button`,variant:`outline`,onClick:()=>g(!1),"data-testid":`activity-panel-undo-all-cancel`,children:`Cancel`}),t[80]=Ee):Ee=t[80];let De;t[81]===ue?De=t[82]:(De=(0,P.jsxs)(C,{children:[Ee,(0,P.jsx)(o,{type:`button`,variant:`destructive`,onClick:ue,"data-testid":`activity-panel-undo-all-confirm`,children:`Undo all`})]}),t[81]=ue,t[82]=De);let Oe;t[83]!==Te||t[84]!==De?(Oe=(0,P.jsxs)(S,{className:`sm:max-w-md`,children:[Te,De]}),t[83]=Te,t[84]=De,t[85]=Oe):Oe=t[85];let $;t[86]!==h||t[87]!==Oe?($=(0,P.jsx)(T,{open:h,onOpenChange:g,children:Oe}),t[86]=h,t[87]=Oe,t[88]=$):$=t[88];let ke;return t[89]!==Z||t[90]!==Q||t[91]!==$?(ke=(0,P.jsxs)(`div`,{className:`border-b border-border`,"data-testid":`activity-panel-file-row`,children:[Z,Q,$]}),t[89]=Z,t[90]=Q,t[91]=$,t[92]=ke):ke=t[92],ke}function de(e){return!e}function fe(){return Date.now()}async function F(e){let t=await fetch(`/api/agent-undo`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...e,agentId:e.connectionId})});if(!t.ok)throw Error(`agent-undo failed: HTTP ${t.status}`)}function pe(e){return`#/${e.split(`/`).map(e=>encodeURIComponent(e)).join(`/`)}`}function I(e){typeof window>`u`||(window.location.hash=pe(e))}function L(){let e=(0,A.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,P.jsxs)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,role:`status`,"aria-busy":`true`,children:[(0,P.jsx)(l,{className:`mr-2 size-4 animate-spin`,"aria-hidden":`true`}),(0,P.jsx)(`span`,{className:`text-sm`,children:`Loading agent activity…`})]}),e[0]=t):t=e[0],t}function R(e){let t=(0,A.c)(9),{error:n,onRetry:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,P.jsx)(c,{className:`size-6 text-destructive`,"aria-hidden":`true`}),t[0]=i):i=t[0];let a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,P.jsx)(`p`,{className:`text-sm font-medium`,children:`Failed to load activity`}),t[1]=a):a=t[1];let s;t[2]===n?s=t[3]:(s=(0,P.jsxs)(`div`,{className:`space-y-1`,children:[a,(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n})]}),t[2]=n,t[3]=s);let l;t[4]===r?l=t[5]:(l=(0,P.jsx)(o,{type:`button`,variant:`outline`,size:`sm`,onClick:r,children:`Retry`}),t[4]=r,t[5]=l);let u;return t[6]!==s||t[7]!==l?(u=(0,P.jsxs)(`div`,{className:`flex flex-col items-center gap-3 p-6 text-center`,role:`alert`,"data-testid":`activity-panel-error`,children:[i,s,l]}),t[6]=s,t[7]=l,t[8]=u):u=t[8],u}function me(){let e=(0,A.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,P.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,"data-testid":`activity-panel-empty`,children:(0,P.jsx)(`p`,{className:`text-sm italic`,children:`No edits yet.`})}),e[0]=t):t=e[0],t}function z(e){let t=(0,A.c)(8),{onExit:n}=e,r;t[0]===n?r=t[1]:(r=(0,P.jsx)(he,{onClick:n}),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,P.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:`Agent activity`}),t[2]=i):i=t[2];let a;t[3]===r?a=t[4]:(a=(0,P.jsxs)(`div`,{className:`flex shrink-0 flex-row items-center gap-2 border-b border-border px-3 py-2`,children:[r,i]}),t[3]=r,t[4]=a);let o;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,P.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-6 text-muted-foreground`,children:(0,P.jsx)(`p`,{className:`text-center text-sm italic`,children:`Click an agent's avatar in the presence bar to view their session.`})}),t[5]=o):o=t[5];let s;return t[6]===a?s=t[7]:(s=(0,P.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel-no-agent`,"aria-label":`Agent activity`,children:[a,o]}),t[6]=a,t[7]=s),s}function he(e){let t=(0,A.c)(6),{onClick:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,P.jsx)(g,{}),t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i=(0,P.jsx)(E,{asChild:!0,children:(0,P.jsx)(o,{type:`button`,variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,onClick:n,"aria-label":`Back to document view`,"data-testid":`docpanel-exit-agent-mode`,children:r})}),t[1]=n,t[2]=i);let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,P.jsx)(D,{side:`bottom`,children:`Back to document view`}),t[3]=a):a=t[3];let s;return t[4]===i?s=t[5]:(s=(0,P.jsxs)(O,{children:[i,a]}),t[4]=i,t[5]=s),s}function ge(e){let t=(0,A.c)(9),{lastTs:n}=e,[r]=(0,j.useState)(B),i;t[0]!==n||t[1]!==r?(i=n?_e(r-n):null,t[0]=n,t[1]=r,t[2]=i):i=t[2];let a=i,o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,P.jsx)(`span`,{className:`font-medium`,children:`Session ended`}),t[3]=o):o=t[3];let s;t[4]===a?s=t[5]:(s=a?(0,P.jsxs)(`span`,{children:[` · `,a]}):null,t[4]=a,t[5]=s);let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,P.jsx)(`div`,{className:`mt-1 opacity-80`,children:`Undo buttons are disabled — per-session state has been garbage-collected.`}),t[6]=c):c=t[6];let l;return t[7]===s?l=t[8]:(l=(0,P.jsxs)(`div`,{className:`border-b border-border bg-muted/40 px-4 py-3 text-xs text-muted-foreground`,"data-testid":`activity-panel-session-ended`,children:[o,s,c]}),t[7]=s,t[8]=l),l}function B(){return Date.now()}function _e(e){let t=Math.max(0,e);return t<6e4?`${Math.round(t/1e3)}s ago`:t<36e5?`${Math.round(t/6e4)}m ago`:`${Math.round(t/36e5)}h ago`}function V(e){let t=(0,A.c)(10),{agent:n,size:r}=e,i=r===void 0?28:r,a;t[0]!==n.color||t[1]!==i?(a={backgroundColor:n.color,width:i,height:i},t[0]=n.color,t[1]=i,t[2]=a):a=t[2];let o=i*.57,s=i*.57,c;t[3]!==n.icon||t[4]!==o||t[5]!==s?(c=(0,P.jsx)(_,{icon:n.icon,width:o,height:s}),t[3]=n.icon,t[4]=o,t[5]=s,t[6]=c):c=t[6];let l;return t[7]!==a||t[8]!==c?(l=(0,P.jsx)(`span`,{className:`inline-flex shrink-0 items-center justify-center rounded-full text-white ring-2 ring-background`,style:a,"aria-hidden":`true`,children:c}),t[7]=a,t[8]=c,t[9]=l):l=t[9],l}function H(e){let t=(0,A.c)(20),{data:n,status:r,error:i,reload:a,fetchBurstDiff:o,onExit:s,onNavigate:c,onUndoLast:l,onUndoAll:u}=e,d=n?.files?.[0]?.lastTs??null,f;t[0]===s?f=t[1]:(f=(0,P.jsx)(he,{onClick:s}),t[0]=s,t[1]=f);let p;t[2]===n?p=t[3]:(p=n?.agent?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(V,{agent:n.agent}),(0,P.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,P.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:n.agent.displayName}),(0,P.jsxs)(`p`,{className:`truncate text-xs text-muted-foreground`,children:[n.sessionAlive?`Active`:`Ended`,n.files.length>0?` · ${n.files.length} file${n.files.length===1?``:`s`}`:``]})]})]}):(0,P.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,P.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:`Agent activity`})}),t[2]=n,t[3]=p);let m;t[4]!==f||t[5]!==p?(m=(0,P.jsxs)(`div`,{className:`flex flex-row items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[f,p]}),t[4]=f,t[5]=p,t[6]=m):m=t[6];let h;t[7]!==n||t[8]!==i||t[9]!==o||t[10]!==d||t[11]!==c||t[12]!==u||t[13]!==l||t[14]!==a||t[15]!==r?(h=(0,P.jsx)(`div`,{className:`flex-1 overflow-y-auto`,"data-testid":`activity-panel-body`,children:r===`loading`&&n===null?(0,P.jsx)(L,{}):r===`error`&&i?(0,P.jsx)(R,{error:i,onRetry:a}):n===null?(0,P.jsx)(me,{}):(0,P.jsxs)(P.Fragment,{children:[n.sessionAlive?null:(0,P.jsx)(ge,{lastTs:d}),n.files.length===0?(0,P.jsx)(me,{}):n.files.map(e=>(0,P.jsx)(ue,{file:e,sessionAlive:n.sessionAlive,isWriting:n.writingDocs.has(e.docName),onNavigate:c,onUndoLast:l,onUndoAll:u,fetchBurstDiff:o},e.docName))]})}),t[7]=n,t[8]=i,t[9]=o,t[10]=d,t[11]=c,t[12]=u,t[13]=l,t[14]=a,t[15]=r,t[16]=h):h=t[16];let g;return t[17]!==m||t[18]!==h?(g=(0,P.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel`,"aria-label":`Agent activity`,children:[m,h]}),t[17]=m,t[18]=h,t[19]=g):g=t[19],g}function ve(){let e=(0,A.c)(22),{docPanelAgentId:t,closeActivityPanel:n}=f(),{openDocumentTransition:r}=p(),{data:i,status:a,error:o,reload:s,fetchBurstDiff:c}=ne(t);if(t===null){let t;return e[0]===n?t=e[1]:(t=(0,P.jsx)(z,{onExit:n}),e[0]=n,e[1]=t),t}let l;e[2]===r?l=e[3]:(l=e=>{r(e),I(e)},e[2]=r,e[3]=l);let u=l,d;e[4]!==i||e[5]!==t||e[6]!==s?(d=async e=>{try{await F({connectionId:t,docName:e,scope:`last`,agentName:i?.agent?.displayName}),s()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);y.error(`Undo failed: ${n}`),s()}},e[4]=i,e[5]=t,e[6]=s,e[7]=d):d=e[7];let m=d,h;e[8]!==i||e[9]!==t||e[10]!==s?(h=async e=>{try{await F({connectionId:t,docName:e,scope:`file`,agentName:i?.agent?.displayName}),y.success(`Undone all edits on ${e}`),s()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);y.error(`Undo all failed: ${n}`),s()}},e[8]=i,e[9]=t,e[10]=s,e[11]=h):h=e[11];let g=h,_;return e[12]!==n||e[13]!==i||e[14]!==o||e[15]!==c||e[16]!==u||e[17]!==g||e[18]!==m||e[19]!==s||e[20]!==a?(_=(0,P.jsx)(H,{data:i,status:a,error:o,reload:s,fetchBurstDiff:c,onExit:n,onNavigate:u,onUndoLast:m,onUndoAll:g}),e[12]=n,e[13]=i,e[14]=o,e[15]=c,e[16]=u,e[17]=g,e[18]=m,e[19]=s,e[20]=a,e[21]=_):_=e[21],_}export{ve as ActivityModeContent};
|