@inkeep/open-knowledge 0.5.0-beta.2 → 0.5.0-beta.3
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/THIRD_PARTY_NOTICES.md +10 -0
- package/dist/assets/skills/open-knowledge/SKILL.md +1 -1
- package/dist/cli.mjs +5 -5
- package/dist/constants-CdfqNseZ.mjs +2 -0
- package/dist/{dist-CKbBtGcV.mjs → dist-B57jcfo9.mjs} +2 -2
- package/dist/{dist-DD3jbGts.mjs → dist-BGL0ZAep.mjs} +15 -15
- package/dist/{dist-DLi5l7jc.mjs → dist-CitXaW0V.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/init-CYRb_5EB.mjs +1 -0
- package/dist/{init-BVF99f4p.mjs → init-WxyC-q6H.mjs} +3 -3
- package/dist/{loader-BuVjsSVh.mjs → loader-49cQC73v.mjs} +2 -2
- package/dist/loader-CcNPgKn1.mjs +1 -0
- package/dist/{preview-CgtprTPm.mjs → preview-D4TVVGvQ.mjs} +2 -2
- package/dist/preview-gwaAyRK2.mjs +1 -0
- package/dist/public/assets/ActivityModeContent-CDvwQiJl.js +2 -0
- package/dist/public/assets/ConsentDialogBody-zb1TKG9i.js +2 -0
- package/dist/public/assets/DocumentContext-DsG0dRJh.js +41 -0
- package/dist/public/assets/{GraphPanel-C3gvPdoq.js → GraphPanel-5-zTeMY1.js} +2 -2
- package/dist/public/assets/McpConsentDialogBody-C8ewMYVI.js +1 -0
- package/dist/public/assets/SettingsDialog-CzUxAbsW.js +11 -0
- package/dist/public/assets/{SourceEditor-Xxy5TvNJ.js → SourceEditor-Bc46I85k.js} +2 -2
- package/dist/public/assets/{_baseFor-CVV1DSgL.js → _baseFor-Dewzr4ka.js} +1 -1
- package/dist/public/assets/{arc-DoxD41WW.js → arc-DA-_Qgty.js} +1 -1
- package/dist/public/assets/architecture-YZFGNWBL-ii1DMScC.js +1 -0
- package/dist/public/assets/{architectureDiagram-Q4EWVU46-Du5oNRD5.js → architectureDiagram-Q4EWVU46-Wd0Ua0Z1.js} +1 -1
- package/dist/public/assets/{blockDiagram-DXYQGD6D-CuxUJ8VP.js → blockDiagram-DXYQGD6D-B_z4vCOg.js} +1 -1
- package/dist/public/assets/{c4Diagram-AHTNJAMY-D58kKzW4.js → c4Diagram-AHTNJAMY-CXNX0C7S.js} +1 -1
- package/dist/public/assets/channel-BsgewBDI.js +1 -0
- package/dist/public/assets/{chunk-2KRD3SAO-uai9wz3V.js → chunk-2KRD3SAO-QHu6lS2z.js} +1 -1
- package/dist/public/assets/{chunk-336JU56O-CtkQ28bg.js → chunk-336JU56O-D77Rj_75.js} +2 -2
- package/dist/public/assets/chunk-426QAEUC-b3iWz8H-.js +1 -0
- package/dist/public/assets/{chunk-4BX2VUAB-BTctgoF3.js → chunk-4BX2VUAB-CDjfF5mJ.js} +1 -1
- package/dist/public/assets/{chunk-4TB4RGXK-Cnl-K_AI.js → chunk-4TB4RGXK-DgzpC1RW.js} +1 -1
- package/dist/public/assets/chunk-55IACEB6-DLoy8CmX.js +1 -0
- package/dist/public/assets/{chunk-5FUZZQ4R-DF0EG1O8.js → chunk-5FUZZQ4R-pDx0Wde8.js} +1 -1
- package/dist/public/assets/{chunk-5PVQY5BW-BpceE2BZ.js → chunk-5PVQY5BW-kcWn_d-_.js} +1 -1
- package/dist/public/assets/{chunk-67CJDMHE-DiSIolj4.js → chunk-67CJDMHE-DlS8iVRi.js} +1 -1
- package/dist/public/assets/{chunk-7N4EOEYR-Yp7Nf16N.js → chunk-7N4EOEYR-BhSQn_oU.js} +1 -1
- package/dist/public/assets/{chunk-AA7GKIK3--s2NNuet.js → chunk-AA7GKIK3-C1CcYx5B.js} +1 -1
- package/dist/public/assets/{chunk-BSJP7CBP-BrRqu__W.js → chunk-BSJP7CBP-B5xN369R.js} +1 -1
- package/dist/public/assets/{chunk-CIAEETIT-BUzaopy6.js → chunk-CIAEETIT-ecxKAxUb.js} +1 -1
- package/dist/public/assets/{chunk-EDXVE4YY-Bo83e0iq.js → chunk-EDXVE4YY-Bm2-fU6x.js} +1 -1
- package/dist/public/assets/{chunk-ENJZ2VHE-CY9yto8o.js → chunk-ENJZ2VHE-1bYQNnwE.js} +1 -1
- package/dist/public/assets/{chunk-FMBD7UC4-DEzvlUl3.js → chunk-FMBD7UC4-Da7gMLWx.js} +1 -1
- package/dist/public/assets/{chunk-FOC6F5B3-BtjWNx10.js → chunk-FOC6F5B3-CHF5QCPz.js} +1 -1
- package/dist/public/assets/{chunk-ICPOFSXX-BC5Xd13f.js → chunk-ICPOFSXX-rmT7ehAO.js} +1 -1
- package/dist/public/assets/{chunk-K5T4RW27-CfU2wPmV.js → chunk-K5T4RW27-CHoEPFOL.js} +1 -1
- package/dist/public/assets/{chunk-KGLVRYIC-BV1pDifD.js → chunk-KGLVRYIC-DRtjGHKV.js} +1 -1
- package/dist/public/assets/{chunk-LIHQZDEY-C40dIbib.js → chunk-LIHQZDEY-GDhBbkMd.js} +1 -1
- package/dist/public/assets/{chunk-ORNJ4GCN-8cFqvOFf.js → chunk-ORNJ4GCN-C9FrQ4Hp.js} +1 -1
- package/dist/public/assets/{chunk-OYMX7WX6-D0C6jdl8.js → chunk-OYMX7WX6-CAW2HwTq.js} +1 -1
- package/dist/public/assets/chunk-QZHKN3VN-XrJADtWP.js +1 -0
- package/dist/public/assets/{chunk-U2HBQHQK-DenE4TdD.js → chunk-U2HBQHQK-Cg7rxXd1.js} +1 -1
- package/dist/public/assets/{chunk-X2U36JSP-DSyuGkzP.js → chunk-X2U36JSP-Z4V8etFJ.js} +1 -1
- package/dist/public/assets/{chunk-XPW4576I-CLO5Bb_q.js → chunk-XPW4576I-Ci37cmyJ.js} +1 -1
- package/dist/public/assets/{chunk-YZCP3GAM-D8kUvWu6.js → chunk-YZCP3GAM-BlAQKShJ.js} +1 -1
- package/dist/public/assets/{chunk-ZZ45TVLE-DHB0SHUz.js → chunk-ZZ45TVLE-CKHp-exc.js} +1 -1
- package/dist/public/assets/classDiagram-6PBFFD2Q-Bt8hJVX9.js +1 -0
- package/dist/public/assets/classDiagram-v2-HSJHXN6E-BTPIteVB.js +1 -0
- package/dist/public/assets/clone-B_tH2FKO.js +1 -0
- package/dist/public/assets/config-validation-events-kuYsS9Uy.js +10 -0
- package/dist/public/assets/{cose-bilkent-S5V4N54A-6FB6GAoi.js → cose-bilkent-S5V4N54A-CzOLOBap.js} +1 -1
- package/dist/public/assets/{dagre-D2_448Gx.js → dagre-CbTJGa51.js} +1 -1
- package/dist/public/assets/{dagre-KV5264BT-Bn9RtFC-.js → dagre-KV5264BT-CzrIWBHi.js} +1 -1
- package/dist/public/assets/{diagram-5BDNPKRD-XCR9sVhK.js → diagram-5BDNPKRD-DDHvw5SM.js} +1 -1
- package/dist/public/assets/{diagram-G4DWMVQ6-Bz0ngc_7.js → diagram-G4DWMVQ6-DiQx8aIN.js} +1 -1
- package/dist/public/assets/{diagram-MMDJMWI5-o_IQFxK_.js → diagram-MMDJMWI5-CJELLr4J.js} +1 -1
- package/dist/public/assets/{diagram-TYMM5635-D2QJXyfV.js → diagram-TYMM5635-BHwicR15.js} +1 -1
- package/dist/public/assets/dialog-CY2eQd6O.js +45 -0
- package/dist/public/assets/{dist-BYGzJeLM.js → dist-B3L7cm0M.js} +1 -1
- package/dist/public/assets/{dist-CXGJFbY5.js → dist-BMooy-F_.js} +1 -1
- package/dist/public/assets/{dist-DsbVHLNy.js → dist-BiYnsAMa.js} +1 -1
- package/dist/public/assets/{dist-Cq1LYbUj.js → dist-CATLRngz.js} +1 -1
- package/dist/public/assets/{dist-BrsSsfiw.js → dist-Cp-iTcML.js} +1 -1
- package/dist/public/assets/{dist-CyaBbyDQ.js → dist-Dwop2AD8.js} +1 -1
- package/dist/public/assets/doc-hash-CaKfwYBW.js +422 -0
- package/dist/public/assets/{erDiagram-SMLLAGMA-C1Mr5jbs.js → erDiagram-SMLLAGMA-DdltplqB.js} +1 -1
- package/dist/public/assets/{flatten-DFiFicpD.js → flatten-BdgTwKTr.js} +1 -1
- package/dist/public/assets/{flowDiagram-DWJPFMVM--ukgnTYS.js → flowDiagram-DWJPFMVM-CQHlOxjR.js} +1 -1
- package/dist/public/assets/{ganttDiagram-T4ZO3ILL-CVeIdgCM.js → ganttDiagram-T4ZO3ILL-CNDOT9hb.js} +1 -1
- package/dist/public/assets/gitGraph-7Q5UKJZL-CIz9LX1B.js +1 -0
- package/dist/public/assets/{gitGraphDiagram-UUTBAWPF-BSivDyLh.js → gitGraphDiagram-UUTBAWPF-BgXxQBs9.js} +1 -1
- package/dist/public/assets/{graphlib-DvRtwu4N.js → graphlib-CrrIJ98S.js} +1 -1
- package/dist/public/assets/index-DThsdx9L.js +1853 -0
- package/dist/public/assets/index-wYiupFbR.css +1 -0
- package/dist/public/assets/info-OMHHGYJF-CIFsXa-y.js +1 -0
- package/dist/public/assets/{infoDiagram-42DDH7IO-DtO1Tc8U.js → infoDiagram-42DDH7IO-BNSprTvD.js} +1 -1
- package/dist/public/assets/{isEmpty-gGVpRSDa.js → isEmpty-XlV2b3kS.js} +1 -1
- package/dist/public/assets/isSymbol-CiN6ou2H.js +1 -0
- package/dist/public/assets/{ishikawaDiagram-UXIWVN3A-BY3noyNF.js → ishikawaDiagram-UXIWVN3A-COSeJVOI.js} +1 -1
- package/dist/public/assets/{journeyDiagram-VCZTEJTY-DdFdkR8_.js → journeyDiagram-VCZTEJTY-sGfNXUrs.js} +1 -1
- package/dist/public/assets/{kanban-definition-6JOO6SKY-WoLnXp48.js → kanban-definition-6JOO6SKY-DknMinG3.js} +1 -1
- package/dist/public/assets/{line-C59Ezo8Z.js → line-BI6r6-S8.js} +1 -1
- package/dist/public/assets/{linear-faBQNtcz.js → linear-1aKBO-v1.js} +1 -1
- package/dist/public/assets/{mermaid-parser.core-CFsvu03i.js → mermaid-parser.core-BrufKICx.js} +2 -2
- package/dist/public/assets/{mermaid.core-CWYso-V4.js → mermaid.core-hgzeX18g.js} +3 -3
- package/dist/public/assets/{mindmap-definition-QFDTVHPH-BG3Kwhhs.js → mindmap-definition-QFDTVHPH-X4KQZFdB.js} +1 -1
- package/dist/public/assets/{now-D_m-3Vjm.js → now--RAZR_wd.js} +1 -1
- package/dist/public/assets/{ordinal-BLFwWMHf.js → ordinal-C6wHcby9.js} +1 -1
- package/dist/public/assets/packet-4T2RLAQJ-BaGTVTK6.js +1 -0
- package/dist/public/assets/pie-ZZUOXDRM-BlBm3k_7.js +1 -0
- package/dist/public/assets/{pieDiagram-DEJITSTG-B1wtn7py.js → pieDiagram-DEJITSTG-5kceM3o3.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-34T5L4WZ-yboV7Kxh.js → quadrantDiagram-34T5L4WZ-CQehowKY.js} +1 -1
- package/dist/public/assets/radar-PYXPWWZC-DcDFZeKR.js +1 -0
- package/dist/public/assets/{reduce-DmI60TfL.js → reduce-C4NH7ua9.js} +1 -1
- package/dist/public/assets/{requirementDiagram-MS252O5E-BpVLqxNT.js → requirementDiagram-MS252O5E-DySfGFfG.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-XADWPNL6-CH1ZYL1H.js → sankeyDiagram-XADWPNL6-CMU0uGgr.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-FGHM5R23-CwQvwa3m.js → sequenceDiagram-FGHM5R23-BlnukeK1.js} +1 -1
- package/dist/public/assets/{src-DOAilbaA.js → src-BXk72DrU.js} +1 -1
- package/dist/public/assets/{stateDiagram-FHFEXIEX-DL3pXt3n.js → stateDiagram-FHFEXIEX-B7C4fJw1.js} +1 -1
- package/dist/public/assets/stateDiagram-v2-QKLJ7IA2-BjMTOSSV.js +1 -0
- package/dist/public/assets/{target-navigation-intent-Bsa-5sN4.js → target-navigation-intent-COKjYFzE.js} +1 -1
- package/dist/public/assets/{telemetry-impl-H--5W_Jc.js → telemetry-impl-C6x9yckj.js} +2 -2
- package/dist/public/assets/{timeline-definition-GMOUNBTQ-CDbb3c--.js → timeline-definition-GMOUNBTQ-DAcQtRlS.js} +1 -1
- package/dist/public/assets/{toggle-group-fH3GS2vu.js → toggle-group-zxAmL7AG.js} +1 -1
- package/dist/public/assets/{tooltip-BuwIhPCp.js → tooltip-DfmK7iDN.js} +1 -1
- package/dist/public/assets/treeView-SZITEDCU-DT6-aoa9.js +1 -0
- package/dist/public/assets/treemap-W4RFUUIX-JWBoWOdi.js +1 -0
- package/dist/public/assets/{typing-burst-detector-isOlON7R.js → typing-burst-detector-wbnGbURk.js} +2 -2
- package/dist/public/assets/{vennDiagram-DHZGUBPP-BaHOUqGA.js → vennDiagram-DHZGUBPP-D5QpqXSc.js} +1 -1
- package/dist/public/assets/wardley-RL74JXVD-GxyzoOqN.js +1 -0
- package/dist/public/assets/{wardleyDiagram-NUSXRM2D-5ysokC2z.js → wardleyDiagram-NUSXRM2D-CV74dN2L.js} +1 -1
- package/dist/public/assets/{xychartDiagram-5P7HB3ND-CFQqcNjf.js → xychartDiagram-5P7HB3ND-VYAkLjyv.js} +1 -1
- package/dist/public/index.html +19 -20
- package/dist/{src-ClUycJ-8.mjs → src-D8dkz5py.mjs} +2 -2
- package/dist/start-C2EAqlEk.mjs +1 -0
- package/dist/{start-9GiauZpx.mjs → start-GpGsUB8n.mjs} +2 -2
- package/package.json +1 -1
- package/dist/constants-DaHLULeB.mjs +0 -2
- package/dist/init-C5EZlTRi.mjs +0 -1
- package/dist/loader-hhLpWo02.mjs +0 -1
- package/dist/preview-B3SUZJxp.mjs +0 -1
- package/dist/public/assets/ActivityModeContent-BPpQcXSp.js +0 -2
- package/dist/public/assets/ConsentDialogBody-CPwBJJLE.js +0 -2
- package/dist/public/assets/DocumentContext-DOBntg5q.js +0 -37
- package/dist/public/assets/McpConsentDialogBody-0w9-K4mU.js +0 -1
- package/dist/public/assets/SettingsDialog-DJeu0WRa.js +0 -11
- package/dist/public/assets/architecture-YZFGNWBL-C7rs88Cj.js +0 -1
- package/dist/public/assets/channel-kvPH_LHg.js +0 -1
- package/dist/public/assets/chunk-426QAEUC-jRhC4EYv.js +0 -1
- package/dist/public/assets/chunk-55IACEB6-dtXOOCuI.js +0 -1
- package/dist/public/assets/chunk-QZHKN3VN-Bz4XrtbS.js +0 -1
- package/dist/public/assets/classDiagram-6PBFFD2Q-MrFnlVPS.js +0 -1
- package/dist/public/assets/classDiagram-v2-HSJHXN6E-DFkKo4Ct.js +0 -1
- package/dist/public/assets/clone-jj9sSaF-.js +0 -1
- package/dist/public/assets/config-validation-events-BpvRjXIZ.js +0 -10
- package/dist/public/assets/dialog-BFN-ujuF.js +0 -1
- package/dist/public/assets/dist-OTL8-1C2.js +0 -45
- package/dist/public/assets/doc-hash-DefAyZGx.js +0 -422
- package/dist/public/assets/gitGraph-7Q5UKJZL-Bmgp5n-M.js +0 -1
- package/dist/public/assets/index-Cfu0nrKh.js +0 -1853
- package/dist/public/assets/index-Cl4ZMMDO.css +0 -1
- package/dist/public/assets/info-OMHHGYJF-DCMX4pS_.js +0 -1
- package/dist/public/assets/isSymbol-D0ur5y-p.js +0 -1
- package/dist/public/assets/packet-4T2RLAQJ-DveBhlQF.js +0 -1
- package/dist/public/assets/pie-ZZUOXDRM-yiLyabeZ.js +0 -1
- package/dist/public/assets/radar-PYXPWWZC-D8GV_2fZ.js +0 -1
- package/dist/public/assets/stateDiagram-v2-QKLJ7IA2-6f8E13YF.js +0 -1
- package/dist/public/assets/treeView-SZITEDCU-A2Cj-I1J.js +0 -1
- package/dist/public/assets/treemap-W4RFUUIX-uOn6xcZK.js +0 -1
- package/dist/public/assets/wardley-RL74JXVD-DrTPuxUO.js +0 -1
- package/dist/start-BOjZrRX3.mjs +0 -1
- /package/dist/public/assets/{ActivityPanelDiffView-DeDaG2lq.js → ActivityPanelDiffView-EaCFURAu.js} +0 -0
- /package/dist/public/assets/{__vite-browser-external-sCjVW6Bj.js → __vite-browser-external-mvD4HPu0.js} +0 -0
- /package/dist/public/assets/{array-COEOjKUv.js → array-o2rfyIz3.js} +0 -0
- /package/dist/public/assets/{colors-D6LRuSY-.js → colors-BbIH8S-B.js} +0 -0
- /package/dist/public/assets/{cytoscape.esm-4jw_vW_Q.js → cytoscape.esm-xzkCxEpv.js} +0 -0
- /package/dist/public/assets/{defaultLocale-CoF2cqkH.js → defaultLocale-D3xTVDt1.js} +0 -0
- /package/dist/public/assets/{dist-Du-s1q8P.js → dist-D2RGH7XO.js} +0 -0
- /package/dist/public/assets/{dist-Bog19bCH.js → dist-TlK-S7KL.js} +0 -0
- /package/dist/public/assets/{go-wMvjCq97.js → go-e6pdpn6U.js} +0 -0
- /package/dist/public/assets/{init-8GNx5phc.js → init-gbiKrEzm.js} +0 -0
- /package/dist/public/assets/{input-BOmkuBId.js → input-hZk8Tm0e.js} +0 -0
- /package/dist/public/assets/{isObjectLike-DFnkciUU.js → isObjectLike-BNNgtFA6.js} +0 -0
- /package/dist/public/assets/{min-BiwsSkbB.js → min-VayDM1tY.js} +0 -0
- /package/dist/public/assets/{path-C-grg3CZ.js → path-DFpIsaqN.js} +0 -0
- /package/dist/public/assets/{pdf-CtJiipL_.js → pdf-w2KBoLit.js} +0 -0
- /package/dist/public/assets/{pdf.worker-BZq-wJdz.js → pdf.worker-BpRoOtgY.js} +0 -0
- /package/dist/public/assets/{project-paths-Cs3srSjk.js → project-paths-hiY0fNWB.js} +0 -0
- /package/dist/public/assets/{rough.esm-DDK-gphn.js → rough.esm-BgPNbngg.js} +0 -0
- /package/dist/public/assets/{shell-DdhS5_h8.js → shell-BkCD5kyH.js} +0 -0
- /package/dist/public/assets/{src-L3wpjxBL.js → src-BYmEUJ3I.js} +0 -0
- /package/dist/public/assets/{stex-CzCFWeB9.js → stex-J8UMaf7u.js} +0 -0
- /package/dist/public/assets/{textarea-CaFqgjns.js → textarea-gXd-JXvQ.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Bn as e,Ct as t,Ft as n,Lt as r,Rn as i,Sn as a,k as o}from"./dist-
|
|
1
|
+
import{Bn as e,Ct as t,Ft as n,Lt as r,Rn as i,Sn as a,k as o}from"./dist-BGL0ZAep.mjs";import{_ as s,a as c,c as l,d as u,f as d,g as f,i as p,l as m,m as h,n as g,o as _,p as v,r as y,s as b,t as x,u as S}from"./server-lock-D7DXNVql-BRVVzA6T.mjs";import{$ as C,$n as w,$t as T,A as E,An as D,Ar as O,At as k,B as A,Bn as j,Bt as M,C as N,Cn as P,Cr as F,Ct as I,D as L,Dn as R,Dr as z,Dt as B,E as V,En as H,Er as U,Et as W,F as G,Fn as K,Fr as q,Ft as J,G as Y,Gn as X,Gt as Z,H as Q,Hn as $,Ht as ee,I as te,In as ne,Ir as re,It as ie,J as ae,Jn as oe,Jt as se,K as ce,Kn as le,Kt as ue,L as de,Ln as fe,Lr as pe,Lt as me,M as he,Mn as ge,Mr as _e,Mt as ve,N as ye,Nn as be,Nr as xe,Nt as Se,O as Ce,On as we,Or as Te,Ot as Ee,P as De,Pn as Oe,Pr as ke,Pt as Ae,Q as je,Qn as Me,Qt as Ne,R as Pe,Rn as Fe,Rr as Ie,Rt as Le,S as Re,Sn as ze,Sr as Be,St as Ve,T as He,Tn as Ue,Tr as We,Tt as Ge,U as Ke,Un as qe,Ut as Je,V as Ye,Vn as Xe,Vt as Ze,W as Qe,Wn as $e,Wt as et,X as tt,Xn as nt,Xr as rt,Xt as it,Y as at,Yn as ot,Yr as st,Yt as ct,Z as lt,Zn as ut,Zt as dt,_ as ft,_n as pt,_r as mt,_t as ht,a as gt,an as _t,ar as vt,at as yt,b as bt,bn as xt,br as St,bt as Ct,c as wt,cn as Tt,cr as Et,ct as Dt,d as Ot,dn as kt,dr as At,dt as jt,en as Mt,er as Nt,et as Pt,f as Ft,fn as It,fr as Lt,ft as Rt,g as zt,gn as Bt,gr as Vt,gt as Ht,h as Ut,hn as Wt,hr as Gt,ht as Kt,i as qt,in as Jt,ir as Yt,it as Xt,j as Zt,jn as Qt,jr as $t,jt as en,k as tn,kn as nn,kr as rn,kt as an,l as on,ln as sn,lr as cn,lt as ln,m as un,mn as dn,mr as fn,mt as pn,n as mn,nn as hn,nr as gn,nt as _n,o as vn,on as yn,or as bn,ot as xn,p as Sn,pn as Cn,pr as wn,pt as Tn,q as En,qn as Dn,qt as On,r as kn,rn as An,rr as jn,rt as Mn,s as Nn,sn as Pn,sr as Fn,st as In,t as Ln,tn as Rn,tr as zn,tt as Bn,u as Vn,un as Hn,ur as Un,ut as Wn,v as Gn,vn as Kn,vr as qn,vt as Jn,w as Yn,wn as Xn,wr as Zn,wt as Qn,x as $n,xn as er,xr as tr,xt as nr,y as rr,yn as ir,yr as ar,yt as or,z as sr,zn as cr,zr as lr,zt as ur}from"./dist-B57jcfo9.mjs";export{Ln as AGENT_ID_MAX_LEN,mn as AGENT_ID_RE,kn as AGENT_WRITE_ORIGIN,qt as AgentFocusBroadcaster,gt as AgentPresenceBroadcaster,vn as AgentSessionCapacityError,Nn as AgentSessionManager,wt as BacklinkIndex,on as CC1Broadcaster,o as CC1_CONTRACT_VERSION,Vn as CONFLICT_MARKER_RE,Ot as CURSOR_BUNDLE_PATHS_BY_PLATFORM,Ft as ConfigSchema,Sn as DEFAULT_CHECKPOINT_RETENTION,un as DEFAULT_PACK_ID,Ut as FILE_SYSTEM_WRITER,zt as FILE_WATCHER_ORIGIN,ft as GIT_UPSTREAM_WRITER,st as GitDirAccessError,Gn as HOCUSPOCUS_AUTH_REJECTION_REASONS,rr as HocuspocusAuthRejection,bt as HocuspocusAuthTokenSchema,$n as INSTALLED_AGENTS_SCHEMES,Re as LIVE_DERIVED_INDEX_DEBOUNCE_MS,N as LOG_MD_TEMPLATE,Yn as MANAGED_RENAME_ORIGIN,He as MAX_AGENT_SESSIONS,V as MCP_CONNECTION_ID_HEADER,L as MCP_SERVER_NAME,Ce as MISSING_OK_CONFIG_MESSAGE,rt as MalformedGitPointerError,tn as McpLogger,E as MissingOkConfigError,Zt as OBSERVER_SYNC_ORIGIN,t as ORPHAN_MODES,he as PERSONAL_TEMPLATES,ye as PERSONAL_TEMPLATE_NAMES,De as PinoLogger,x as ProcessLockCollisionError,G as ProjectGitInitError,te as ROLLBACK_ORIGIN,g as RUNTIME_VERSION,de as SERVICE_WRITER,Pe as SKILL_INSTALL_EVENTS_FILE_REL,n as SKILL_STATE_TARGETS,sr as STARTER_FOLDERS,A as STARTER_FOLDER_FRONTMATTER_FILENAME,Ye as STARTER_PACKS,Q as STARTER_PACK_IDS,Ke as STARTER_TEMPLATES,Qe as STATE_MANIFEST_FILENAME,y as STATE_SCHEMA_VERSION,r as SYSTEM_DOC_NAME,Y as SeedPrerequisiteError,ce as SeedRootDirError,p as ServerLockCollisionError,En as StateManifestError,ae as TagIndex,at as UiLockCollisionError,c as acquireProcessLock,_ as acquireServerLock,tt as acquireUiLock,lt as applyAgentMarkdownWrite,je as applyExternalChange,C as applySeed,Pt as assertCompatibleStateManifest,Bn as assertNeverDiskEvent,_n as attachIdleShutdown,Mn as bootServer,Xt as buildAndOpenSkill,yt as buildExecResult,xn as buildInstructions,In as buildReadResult,Dt as buildSkillZip,ln as buildStarterFolderFrontmatterYaml,Wn as buildWipTree,jt as classifyEvents,Rt as classifyFsPath,Tn as clearContributors,pn as coercePackId,a as colorFromSeed,Kt as commitUpstreamImport,Ht as commitWip,ht as commitWipFromTree,Jn as containsConflictMarkers,or as contentHash,Ct as contributorCount,nr as createApiExtension,Ve as createAssetServeMiddleware,I as createContentFilter,Qn as createContentFilterAsync,Ge as createExternalChangeHandler,W as createLiveDerivedIndexExtension,B as createMcpHttpHandler,Ee as createOsProbe,an as createPersistenceExtension,k as createServer,en as createServerObserverExtension,ve as createStreamingErrorWriter,Se as createTestLogger,Ae as detectClaudeDesktopPresence,J as detectProjectShape,ie as ensureProjectGit,me as errorResponse,Le as evictStaleTrackerEntries,ur as extractWikiLinksFromMarkdown,M as findEnclosingGitRoot,Ze as findEnclosingProjectRoot,ee as formatAuthRejectionWire,Je as formatContributors,et as gcCheckpointRefs,Z as getCurrentMcpLogger,ue as getLocalDir,On as getLogger,se as getMeter,ct as getMetrics,it as getTracer,dt as handleCollabSocketError,Ne as handleSpawnCursor,i as iconFromClientName,T as incrementCollabSocketFilteredError,Mt as incrementServerObserverFire,Rn as initShadowRepo,hn as initTelemetry,An as installTestLoggers,Jt as installUserSkill,_t as isAllowedApiOrigin,yn as isAllowedWorkspaceHostHeader,Pn as isConfigDoc,Tt as isHocuspocusAuthRejectionReason,sn as isKnownPackId,Hn as isLoopbackAddress,e as isOrphanMode,kt as isPairedWriteOrigin,It as isPathWithinDir,b as isProcessAlive,Cn as isSelfWrite,dn as isSystemDoc,l as isValidLockPid,Wt as lastKnownHash,Bt as listRescueCheckpoints,pt as listStarterPacks,Kn as loadPrincipal,m as lockFilePath,ir as loggerFactory,xt as mountMcpAndApi,er as normalizeFsPath,ze as parseAuthRejectionWire,P as parseHocuspocusAuthToken,Xn as parseKeepaliveConnectionId,Ue as pathToDocName,H as planPersonalTemplates,R as planSeed,we as readAllTargets,nn as readBranchFromHead,S as readProcessLock,u as readProcessLockDetailed,d as readServerLock,D as readServerPackageVersion,Qt as readSkillInstallStateSnapshot,ge as readStateManifest,be as readTargetRecordedAt,Oe as readTargetVersion,K as readUiLock,ne as reconcile,fe as recordContributor,Fe as recordSkillInstallEvent,cr as registerAllTools,j as registerWrite,v as releaseProcessLock,h as releaseServerLock,Xe as releaseUiLock,$ as removeLastKnownHash,qe as resetMetrics,$e as resolveBundledSkillDir,X as resolveContentDir,le as resolveCursorBinaryDefault,Dn as resolveCursorSpawnInvocation,oe as resolveLockDir,ot as resolvePack,nt as resolvePackageVersion,ut as rewriteMarkdownLinksForDocumentRename,Me as rewriteWikiLinksForDocumentRename,w as runAuthReposSubprocess,Nt as runAuthStatusSubprocess,zn as runCloneSubprocess,gn as runDeviceFlowSubprocess,jn as runWithMcpLogger,Yt as safeContentPath,vt as safeSubdir,bn as safetyCheckpoint,Fn as sanitizeClientName,Et as saveInMemoryCheckpoint,cn as saveVersion,Un as seedBasenameIndex,At as setActiveSpanAttributes,Lt as shadowGit,wn as shutdownTelemetry,fn as splitMarkdownBlocks,Gt as startWatcher,Vt as streamingProblemEvent,mt as toBroadcasterKey,qn as tracedAppendFileSync,ar as tracedLinkSync,St as tracedMkdir,tr as tracedMkdirSync,Be as tracedRename,F as tracedRenameSync,Zn as tracedRmSync,We as tracedRmdirSync,U as tracedUnlinkSync,z as tracedWriteFile,Te as tracedWriteFileSync,rn as updateLastKnownHash,f as updateProcessLockPort,s as updateServerLockPort,O as updateUiLockPort,$t as validateAgentId,_e as validateCloneInputs,xe as validateSkillZip,ke as withSpan,q as withSpanSync,re as writePersonalTemplates,pe as writeStateManifest,Ie as writeTargetVersion,lr as writeTracker};
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,d as t,f as n,i as r,l as i,m as a,p as o,t as s,u as c}from"./init-
|
|
1
|
+
import{c as e,d as t,f as n,i as r,l as i,m as a,p as o,t as s,u as c}from"./init-WxyC-q6H.mjs";import{n as l}from"./loader-49cQC73v.mjs";import{n as u}from"./preview-D4TVVGvQ.mjs";import{t as d}from"./src-D8dkz5py.mjs";export{c as ALL_EDITOR_IDS,t as EDITOR_LABELS,n as EDITOR_TARGETS,s as detectInstalledEditors,a as initContent,l as loadConfig,u as previewContent,r as readExistingMcpEntry,o as resolveProjectRoot,e as writeEditorMcpConfig,d as writeProjectAiIntegrations,i as writeUserMcpConfigs};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./init-WxyC-q6H.mjs";export{e as runInit};
|
|
@@ -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{J as a,ir as o,n as s,or as c}from"./dist-DD3jbGts.mjs";import{D as l,F as u,It as d,Pt as f,Wn as p,in as m}from"./dist-CKbBtGcV.mjs";import{n as h,t as g}from"./constants-DaHLULeB.mjs";import{t as _}from"./is-object-C-4FJ0rP.mjs";import{i as v,o as y,r as b,s as x,t as S}from"./colors-BtKMHmBX.mjs";import{t as ee}from"./preview-CgtprTPm.mjs";import{execFileSync as te}from"node:child_process";import ne,{basename as re,dirname as C,isAbsolute as w,join as T,posix as ie,relative as E,resolve as D,sep as O,win32 as ae}from"node:path";import{cpSync as oe,existsSync as k,lstatSync as se,mkdirSync as A,readFileSync as j,realpathSync as ce,rmSync as le,writeFileSync as M}from"node:fs";import N from"node:process";import{homedir as P}from"node:os";import{AsyncLocalStorage as ue,AsyncResource as de}from"node:async_hooks";import{stripVTControlCharacters as fe,styleText as F}from"node:util";import*as pe from"node:readline";function me(){return N.platform.startsWith(`win`)?!!N.env.CI||!!N.env.WT_SESSION||!!N.env.TERMINUS_SUBLIME||N.env.ConEmuTask===`{cmd::Cmder}`||N.env.TERM_PROGRAM===`Terminus-Sublime`||N.env.TERM_PROGRAM===`vscode`||N.env.TERM===`xterm-256color`||N.env.TERM===`alacritty`||N.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:N.env.TERM!==`linux`}const he={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:`╱`},ge={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:`⅒`},_e={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`},ve={...he,...ge},ye={...he,..._e},I=me()?ve:ye;Object.entries(ge);var be=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 xe=(()=>{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}})(),Se=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,Ce=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,we=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Te=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Ee=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,De=/\t{1,1000}/y,Oe=/[\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,ke=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Ae=/\p{M}+/gu,je={limit:1/0,ellipsis:``},Me=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?Me(i,je,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,c=n.emojiWidth??2,l=n.regularWidth??1,u=n.wideWidth??2,d=[[ke,l],[we,0],[Te,o],[De,s],[Oe,c],[Ee,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(Ae,``)){let t=e.codePointAt(0)||0;if(S=Se(t)?2:Ce(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===Ee?xe(e.slice(p,n.lastIndex)):n===Oe?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}},Ne={limit:1/0,ellipsis:``,ellipsisWidth:0},L=(e,t={})=>Me(e,Ne,t).width,Pe=`]8;;`,Fe=RegExp(`(?:\\[(?<code>\\d+)m|\\${Pe}(?<uri>.*))`,`y`),Ie=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},Le=e=>`[${e}m`,Re=e=>`${Pe}${e}`,ze=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:L(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=L(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===``)&&(i=!0,a=t.startsWith(Pe,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())},Be=e=>{let t=e.split(` `),n=t.length;for(;n&&!L(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Ve=(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=L(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=L(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(``),ze(s,r,t),c=L(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){ze(s,r,t),c=L(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){ze(s,r,t),c=L(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>Be(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{J as a,ir as o,n as s,or as c}from"./dist-BGL0ZAep.mjs";import{D as l,F as u,It as d,Pt as f,Wn as p,in as m}from"./dist-B57jcfo9.mjs";import{n as h,t as g}from"./constants-CdfqNseZ.mjs";import{t as _}from"./is-object-C-4FJ0rP.mjs";import{i as v,o as y,r as b,s as x,t as S}from"./colors-BtKMHmBX.mjs";import{t as ee}from"./preview-D4TVVGvQ.mjs";import{execFileSync as te}from"node:child_process";import ne,{basename as re,dirname as C,isAbsolute as w,join as T,posix as ie,relative as E,resolve as D,sep as O,win32 as ae}from"node:path";import{cpSync as oe,existsSync as k,lstatSync as se,mkdirSync as A,readFileSync as j,realpathSync as ce,rmSync as le,writeFileSync as M}from"node:fs";import N from"node:process";import{homedir as P}from"node:os";import{AsyncLocalStorage as ue,AsyncResource as de}from"node:async_hooks";import{stripVTControlCharacters as fe,styleText as F}from"node:util";import*as pe from"node:readline";function me(){return N.platform.startsWith(`win`)?!!N.env.CI||!!N.env.WT_SESSION||!!N.env.TERMINUS_SUBLIME||N.env.ConEmuTask===`{cmd::Cmder}`||N.env.TERM_PROGRAM===`Terminus-Sublime`||N.env.TERM_PROGRAM===`vscode`||N.env.TERM===`xterm-256color`||N.env.TERM===`alacritty`||N.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:N.env.TERM!==`linux`}const he={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:`╱`},ge={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:`⅒`},_e={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`},ve={...he,...ge},ye={...he,..._e},I=me()?ve:ye;Object.entries(ge);var be=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 xe=(()=>{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}})(),Se=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,Ce=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,we=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Te=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Ee=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,De=/\t{1,1000}/y,Oe=/[\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,ke=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Ae=/\p{M}+/gu,je={limit:1/0,ellipsis:``},Me=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?Me(i,je,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,c=n.emojiWidth??2,l=n.regularWidth??1,u=n.wideWidth??2,d=[[ke,l],[we,0],[Te,o],[De,s],[Oe,c],[Ee,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(Ae,``)){let t=e.codePointAt(0)||0;if(S=Se(t)?2:Ce(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===Ee?xe(e.slice(p,n.lastIndex)):n===Oe?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}},Ne={limit:1/0,ellipsis:``,ellipsisWidth:0},L=(e,t={})=>Me(e,Ne,t).width,Pe=`]8;;`,Fe=RegExp(`(?:\\[(?<code>\\d+)m|\\${Pe}(?<uri>.*))`,`y`),Ie=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},Le=e=>`[${e}m`,Re=e=>`${Pe}${e}`,ze=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:L(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=L(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===``)&&(i=!0,a=t.startsWith(Pe,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())},Be=e=>{let t=e.split(` `),n=t.length;for(;n&&!L(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Ve=(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=L(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=L(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(``),ze(s,r,t),c=L(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){ze(s,r,t),c=L(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){ze(s,r,t),c=L(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>Be(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===``){Fe.lastIndex=e+1;let t=Fe.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+=Re(``));let e=i?Ie(i):void 0;i&&e&&(r+=Le(e))}else t===`
|
|
4
4
|
`&&(i&&Ie(i)&&(r+=Le(i)),a&&(r+=Re(a)))}return r},He=/\r?\n/;function Ue(e,t,n){return String(e).normalize().split(He).map(e=>Ve(e,t,n)).join(`
|
|
@@ -404,5 +404,5 @@ last-spawn-error.log
|
|
|
404
404
|
`)?n:`${n}\n`,`utf-8`)}function lr(e,t){let n;try{n=ce(t)}catch{n=D(t)}let r;try{r=se(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=C(e);for(;i.length>1&&i!==O;){let t;try{t=ce(i)}catch(e){if(e.code===`ENOENT`){i=C(i);continue}throw e}let r=E(n,t);if(r===``||!r.startsWith(`..`)&&!w(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 ur=e=>e!==`project`,dr=e=>e!==`user`;async function fr(){let e=await nn({message:`Where should the MCP server be configured?
|
|
405
405
|
`,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 pr(e){return e.mcp===!1?null:e.scope?e.scope:e.isTTY??process.stdout.isTTY?(e.promptFn??fr)():`both`}const mr=`0.0.1`,hr=`open-knowledge-ui`;function gr(e,t={}){let n=T(e,`.claude`,`launch.json`),r=t.mode===`dev`?{name:hr,runtimeExecutable:`node`,runtimeArgs:[Jn(),`ui`],port:3e3}:{name:hr,runtimeExecutable:`npx`,runtimeArgs:[`@inkeep/open-knowledge`,`ui`],port:3e3};try{if(lr(n,e),!k(n))return A(C(n),{recursive:!0}),M(n,`${JSON.stringify({version:mr,configurations:[r]},null,2)}\n`,`utf-8`),{action:`created`,configPath:n};let t=j(n,`utf-8`).trim(),i=t?JSON.parse(t):{};if(!_(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=>_(e)&&e.name===hr);o>=0?a[o]=r:a.push(r);let s={...i,version:i.version??mr,configurations:a};return M(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 _r(e,t,n){try{return k(e.detectPath?.(t,n)??C(e.configPath(t,n)))}catch{return!1}}function vr(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&&!_r(e,t,r))return{editorId:e.id,label:e.label,action:`skipped-missing`,configPath:o,serverName:a};if(i!==void 0)try{lr(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`?or(o):ar(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`?cr(o,d):sr(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 yr(e,t){let n=e.projectSkillPath?.(t);if(!n)return{editorId:e.id,label:e.label,action:`skipped-unsupported`,path:``};try{let r=p(),i=C(n);lr(i,t);let a=k(n)?`overwritten`:`written`;return le(i,{recursive:!0,force:!0}),A(C(i),{recursive:!0}),oe(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 br(e,t){let n=e.projectConfigPath?.(t);if(!(!n||!k(n)))return{editorId:e.id,label:e.label,path:n}}async function xr(e){let t=ir(e.editors),n={mode:`published`,cliPath:e.cliPath,skipAvailabilityCheck:!0};return t.map(t=>vr(t,``,n,e.home))}function Sr(e,t,n){let r;try{r=e.configPath(t,n)}catch{return null}let i;try{i=e.format===`toml`?or(r):ar(r)}catch{return null}let a=i[e.topLevelKey];if(!_(a))return null;let o=a[e.serverName(t)];return _(o)?o:null}async function Cr(e={}){let t=D(e.cwd??process.cwd()),n=Gn(t,{homeDir:e.home}),r=n.projectRoot,i=!k(T(r,`.ok`));n.ancestorPromoted?console.log(`[ok] Opened existing project at ${r}`):n.gitRootPromoted&&i&&console.log(`[ok] Initialized OK at ${r} — opened parent of ${E(r,t)} because it contains a .git folder`);let a={mode:e.devMcp?`dev`:`published`},o=await d(r),s;try{s=Hn(r,{contentDir:n.defaultContentDir})}catch(t){let n=$.claude.configPath(r,e.home);return{projectRoot:r,contentCreated:[],contentUpdated:[],contentSkipped:[],editors:[],projectSkills:[],legacyProjectConfigs:[],didGitInit:o.didInit,claudeDesktopDetected:!1,mcpAction:`failed`,mcpPath:n,mcpError:`Content scaffolding failed: ${t instanceof Error?t.message:String(t)}`}}let c=await pr({scope:e.scope,mcp:e.mcp,isTTY:e.isTTY,promptFn:e.promptFn}),l=e.editors??Tr(r,e.home),u=e.editors??Y.filter(e=>$[e].projectConfigPath!==void 0),p=ir(l),h=ir(u),g=e.mcp===!1||c===null,_=Array.from(new Map([...p,...g?[]:h].map(e=>[e.id,e])).values()),v=p.filter(t=>_r(t,r,e.home)),y=[],b=[],x=new Set;for(let t of _){if(g){let n=``;try{n=t.configPath(r,e.home)}catch{}y.push({editorId:t.id,label:t.label,action:`skipped-flag`,configPath:n,serverName:t.serverName(r)});continue}if(ur(c)&&p.includes(t)&&y.push(vr(t,r,a,e.home)),dr(c)&&h.includes(t)&&t.projectConfigPath){let n=t.projectConfigPath(r),i=vr(t,r,a,e.home,n);y.push(i),(i.action===`written`||i.action===`overwritten`)&&(x.add(n),b.push(yr(t,r)))}}let S=!g&&c!==null&&dr(c)?h.filter(e=>!e.projectConfigPath).map(e=>e.label):void 0,ee=g?[]:v.map(e=>br(e,r)).filter(e=>e!==void 0).filter(e=>!x.has(e.path)),te=v.some(e=>e.id===`claude`)&&!g?gr(r,a):void 0,ne=await(e.installUserSkill??m)({home:e.home}),re=f({home:e.home}),C=g?`skipped-flag`:`skipped-missing`,w=y.find(e=>e.editorId===`claude`)??y[0]??{action:C,configPath:$.claude.configPath(r,e.home)};return{projectRoot:r,contentCreated:s.created,contentUpdated:s.updated,contentSkipped:s.skipped,editors:y,projectSkills:b,legacyProjectConfigs:ee,launchJson:te,skillInstall:ne,didGitInit:o.didInit,claudeDesktopDetected:re,mcpAction:w.action,mcpPath:w.configPath,mcpError:`error`in w?w.error:void 0,projectScopeUnsupportedLabels:S}}function wr(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)?E(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=T(t,`.ok`);if(e.contentCreated.length>0||e.contentUpdated.length>0?(n.push(S(`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(S(`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(S(`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(S(`MCP server configuration:`)),n.push(` No supported editor config directories detected; skipped MCP registration`);else{n.push(S(`MCP server configuration:`));for(let r of e.editors){let i=r.configPath.startsWith(t)?E(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} ${y(`registered`)}${a}${u}`);break;case`overwritten`:n.push(` ${c}${l}${i} ${y(`updated`)}${a}${u}`);break;case`skipped-missing`:n.push(` ${c}${l}${i} config root missing; skipped`);break;case`failed`:n.push(` ${c}${l}${i} ${b(`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(S(`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?E(t,r.path):``;switch(r.action){case`written`:n.push(` ${e}${i}${a} ${y(`installed`)}`);break;case`overwritten`:n.push(` ${e}${i}${a} ${y(`updated`)}`);break;case`skipped-unsupported`:n.push(` ${e}${i}no known project skill surface; skipped`);break;case`failed`:n.push(` ${e}${i}${a} ${b(`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} ${E(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(S(`User-global skill:`)),e.skillInstall){case`installed`:n.push(` open-knowledge ${y(`installed to detected agent hosts`)} via \`npx skills\``);break;case`skip-current`:n.push(` open-knowledge ${y(`already installed at current version`)}`);break;case`failed`:n.push(` ${x(`open-knowledge install failed — MCP still configured; run manually:`)}`),n.push(` ${x(` 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: ${S(`ok install-skill`)}`)),e.preview?(n.push(``),n.push(ee(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(`${y(`✓`)} ${S(`Next steps:`)}`),n.push(` 1. Open your editor (${v(r.join(` / `))})`),n.push(` 2. Approve the MCP server when prompted`),n.push(` 3. (Optional) scaffold the starter knowledge-base structure:`),n.push(` - ${v(`ok seed`)}`),n.push(` 4. Use the three MCP workflow tools as you build the wiki:`),n.push(` - ${v(`mcp__open-knowledge__ingest`)} — capture an external source`),n.push(` - ${v(`mcp__open-knowledge__research`)} — gather sources and write findings`),n.push(` - ${v(`mcp__open-knowledge__consolidate`)} — promote research to canonical articles`)}return n.join(`
|
|
406
406
|
`)}function Tr(e,t){let n=[];for(let r of Y)_r($[r],e,t)&&n.push(r);return n}function Er(){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 Cr({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.
|
|
407
|
-
`),e.stderr&&process.stderr.write(`${e.stderr.trim()}\n`),process.exitCode=1;return}throw e}try{let{previewContent:e}=await import(`./preview-
|
|
408
|
-
//# sourceMappingURL=init-
|
|
407
|
+
`),e.stderr&&process.stderr.write(`${e.stderr.trim()}\n`),process.exitCode=1;return}throw e}try{let{previewContent:e}=await import(`./preview-gwaAyRK2.mjs`),{loadConfig:t}=await import(`./loader-CcNPgKn1.mjs`),{resolveContentDir:r}=await import(`./dist-CitXaW0V.mjs`),{config:i}=t(n.projectRoot),a=r(i,n.projectRoot);n.preview=e({projectDir:n.projectRoot,contentDir:a})}catch(e){n.previewWarning=e instanceof Error?e.message:String(e)}process.stdout.write(`${wr(n,n.projectRoot)}\n`),(n.editors.some(e=>e.action===`failed`)||n.mcpAction===`failed`)&&(process.exitCode=1)})}export{Ue as C,We as S,I as T,it as _,pr as a,lt as b,vr as c,X as d,$ as f,rt as g,ot as h,Sr as i,xr as l,Hn as m,wr as n,Cr as o,Gn as p,Er as r,gr as s,Tr as t,Y as u,st as v,be as w,et as x,at as y};
|
|
408
|
+
//# sourceMappingURL=init-WxyC-q6H.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Ln as e,Zr as t,lr as n}from"./dist-
|
|
1
|
+
import{Ln as e,Zr as t,lr as n}from"./dist-BGL0ZAep.mjs";import{Kr as r,f as i,qr as a}from"./dist-B57jcfo9.mjs";import{t as o}from"./constants-CdfqNseZ.mjs";import{t as s}from"./is-object-C-4FJ0rP.mjs";import{resolve as c}from"node:path";import{existsSync as l,readFileSync as u}from"node:fs";import{realpath as d}from"node:fs/promises";async function f(e){let t=c(e);try{return await d(t)}catch(e){if(e.code!==`ENOENT`){let n=e instanceof Error?e.message:String(e);console.warn(`[normalize-cwd] realpath failed for ${t}: ${n}`)}return t}}var p=t();function m(e,t){let n={...e};for(let r of Object.keys(t)){let i=e[r],a=t[r];s(a)&&s(i)?n[r]=m(i,a):a!==void 0&&(n[r]=a)}return n}function h(e){if(!l(e))return{value:null,path:e,source:null,doc:null};let t;try{t=u(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,p.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 s(r)?{value:r,path:e,source:t,doc:n}:{value:null,path:e,source:t,doc:n}}const g=[`include`,`exclude`];function _(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 v(e){let t=e.value;if(!s(t))return[];let r=t.content;if(!s(r))return[];let i=[];for(let t of g)if(t in r){let r=[`content`,t],a;e.doc!==null&&e.source!==null&&(a=n({file:e.path,source:e.source,doc:e.doc,path:r})),i.push({code:`REMOVED_KEY`,path:r,redirect:_(t),...a===void 0?{}:{source:a}})}return i}function y(e,t){return e.map(e=>{let r=e.path.map(e=>typeof e==`symbol`?String(e):e),i={path:r,message:e.message,issueCode:e.code};if(t.doc!==null&&t.source!==null){let e=n({file:t.path,source:t.source,doc:t.doc,path:r});if(e!==void 0)return{...i,source:e}}return i})}function b(t){let n=t??process.cwd(),s=[],l=a(`user`,n),u=r({absPath:l}),d={};u.valid&&u.source!==void 0?(d=m(d,u.value),s.push(l)):u.valid;let f=c(n,`.ok`,o),p=h(f);if(p.value!==null){let t=v(p);if(t.length>0)throw Error(t.map(e).join(`
|
|
2
2
|
|
|
3
3
|
`));d=m(d,p.value),s.push(f)}x(d,[`upload`,`maxBytes`],`streaming uploads have no user-facing cap`),x(d,[`github`,`oauthAppClientId`],`use the OPEN_KNOWLEDGE_GITHUB_CLIENT_ID env var instead`),x(d,[`server`,`host`],`use the --host flag or HOST env var instead`),x(d,[`server`,`openOnAgentEdit`]),x(d,[`mcp`,`autoStart`],`to disable auto-start, set OK_MCP_AUTOSTART=0`),x(d,[`mcp`,`tools`,`read_document`,`historyDepth`]),x(d,[`mcp`,`tools`,`grep`,`maxResults`]),x(d,[`mcp`,`tools`,`search`,`maxResults`]),x(d,[`preview`,`baseUrl`],"preview URLs now resolve only to the running UI process — start one with `ok ui`");let g=i.safeParse(d);if(!g.success){let t={code:`SCHEMA_INVALID`,issues:y(g.error.issues,p)};throw Error(e(t))}return{config:g.data,sources:s}}function x(e,t,n){let r=e;for(let e=0;e<t.length-1;e++){if(!s(r))return;r=r[t[e]]}if(!s(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.`)}function S(e){let t=e.cacheMs??1e3,n=e.loadConfigFn??b,r=new Map,i=new Map,a=f(e.startupCwd);return async o=>{let s=await f(o??e.startupCwd),c=Date.now(),l=r.get(s);if(l&&l.expiresAt>c)return l.config;let u=i.get(s);if(u)return await u;let d=(async()=>{if(s===await a)return r.set(s,{config:e.startupConfig,expiresAt:Date.now()+t}),e.startupConfig;let i=n(s).config;return r.set(s,{config:i,expiresAt:Date.now()+t}),i})();i.set(s,d);try{return await d}finally{i.delete(s)}}}export{b as n,S as t};
|
|
4
|
-
//# sourceMappingURL=loader-
|
|
4
|
+
//# sourceMappingURL=loader-49cQC73v.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./loader-49cQC73v.mjs";export{e as loadConfig};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{Ct as e}from"./dist-
|
|
1
|
+
import{Ct as e}from"./dist-B57jcfo9.mjs";import"./constants-CdfqNseZ.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-D4TVVGvQ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./preview-D4TVVGvQ.mjs";export{t as formatPreviewBlock,e as previewContent};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ActivityPanelDiffView-EaCFURAu.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{$ as a,Dn as o,En as s,On as c,dn as l,n as u,r as d}from"./DocumentContext-DsG0dRJh.js";import{G as f,W as p,jt as m,p as h}from"./doc-hash-CaKfwYBW.js";import{C as g,t as _}from"./button-C1nwPVFQ.js";import{f as v,i as y,m as b,r as x,t as S}from"./agent-presence-BrTlNKmt.js";import{a as C,c as w,i as T,o as E,s as D,t as O,x as k}from"./dialog-CY2eQd6O.js";import{i as A,n as ee,t as te}from"./tooltip-DfmK7iDN.js";var ne=g(`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`}]]),j=i(),M=e(n(),1),re=500,ie=64;async function ae(e){let t=`/api/agent-activity?agentId=${encodeURIComponent(e)}`,n=await fetch(t),r;try{r=await n.json()}catch(e){throw new a(`Could not parse /api/agent-activity response.`,{cause:e,status:n.status})}if(!n.ok){let e=m.safeParse(r);throw e.success?Error(e.data.title):new a(`/api/agent-activity returned a non-RFC-9457 error response.`,{cause:e.error,status:n.status})}let i=p.safeParse(r);if(!i.success)throw new a(`/api/agent-activity returned a body that did not match AgentActivitySuccessSchema.`,{cause:i.error,status:n.status});return i.data}async function oe(e,t,n){let r=`/api/agent-burst-diff?agentId=${encodeURIComponent(e)}&docName=${encodeURIComponent(t)}&stackIndex=${n}`,i=await fetch(r),o;try{o=await i.json()}catch(e){throw new a(`Could not parse /api/agent-burst-diff response.`,{cause:e,status:i.status})}if(!i.ok){let e=m.safeParse(o);throw e.success?Error(e.data.title):new a(`/api/agent-burst-diff returned a non-RFC-9457 error response.`,{cause:e.error,status:i.status})}let s=f.safeParse(o);if(!s.success)throw new a(`/api/agent-burst-diff returned a body that did not match AgentBurstDiffSuccessSchema.`,{cause:s.error,status:i.status});return s.data.diff}function se(e){let t=(0,j.c)(23),{systemProvider:n}=u(),[r,i]=(0,M.useState)(null),[a,o]=(0,M.useState)(`idle`),[s,c]=(0,M.useState)(null),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=new y(ie),t[0]=l):l=t[0];let d=(0,M.useRef)(l),f=(0,M.useRef)(0),p;t[1]===n?p=t[2]:(p=e=>{let t=f.current+=1;o(`loading`),c(null),ae(e).then(r=>{if(f.current!==t)return;let a=le(n,e);i({...r,writingDocs:a}),o(`ready`)}).catch(e=>{f.current===t&&(c(e instanceof Error?e.message:String(e)),o(`error`))})},t[1]=n,t[2]=p);let m=p,g;t[3]!==e||t[4]!==m?(g=()=>{if(!e){f.current+=1,i(null),o(`idle`),c(null),d.current.clear();return}d.current.clear(),m(e);let t=null,n=h(n=>{n.includes(`session-activity`)&&(t&&clearTimeout(t),t=setTimeout(()=>{t=null,m(e)},re))});return()=>{t&&clearTimeout(t),n()}},t[3]=e,t[4]=m,t[5]=g):g=t[5];let _;t[6]===e?_=t[7]:(_=[e],t[6]=e,t[7]=_),(0,M.useEffect)(g,_);let v,b;t[8]!==e||t[9]!==n?(v=()=>{if(!e||!n)return;let t=()=>{if(!n.awareness)return;let t=le(n,e);i(e=>!e||ce(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]=v,t[11]=b):(v=t[10],b=t[11]),(0,M.useEffect)(v,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 oe(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]!==m?(C=()=>{e&&m(e)},t[14]=e,t[15]=m,t[16]=C):C=t[16];let w=C,T;return t[17]!==r||t[18]!==s||t[19]!==S||t[20]!==w||t[21]!==a?(T={data:r,status:a,error:s,reload:w,fetchBurstDiff:S},t[17]=r,t[18]=s,t[19]=S,t[20]=w,t[21]=a,t[22]=T):T=t[22],T}function ce(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function le(e,t){let n=new Set;if(!e)return n;let r=e.awareness;if(!S(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 N=r(),ue=(0,M.lazy)(async()=>({default:(await t(()=>import(`./ActivityPanelDiffView-EaCFURAu.js`),__vite__mapDeps([0,1,2,3]),import.meta.url)).ActivityPanelDiffView}));function de(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 fe(e){let t=(0,j.c)(38),{burst:n,docName:r,fetchBurstDiff:i}=e,[a,s]=(0,M.useState)(!1),[l,u]=(0,M.useState)(null),[d,f]=(0,M.useState)(null),[p,m]=(0,M.useState)(!1),[h,g]=(0,M.useState)(P),_,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,M.useEffect)(_,v);let y;t[2]!==n.stackIndex||t[3]!==l||t[4]!==r||t[5]!==a||t[6]!==i||t[7]!==p?(y=()=>{let e=!a;s(e),e&&l===null&&!p&&(m(!0),f(null),i(r,n.stackIndex).then(e=>{u(e),m(!1)}).catch(e=>{f(e instanceof Error?e.message:String(e)),m(!1)}))},t[2]=n.stackIndex,t[3]=l,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,N.jsx)(c,{className:`size-3 shrink-0`,"aria-hidden":`true`}):(0,N.jsx)(o,{className:`size-3 shrink-0`,"aria-hidden":`true`}),t[9]=a,t[10]=S);let C;t[11]!==n.ts||t[12]!==h?(C=de(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,N.jsx)(`span`,{className:`font-mono`,children:C}),t[14]=C,t[15]=w);let T;t[16]===n.additions?T=t[17]:(T=(0,N.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,N.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,N.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,N.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]!==l||t[31]!==a||t[32]!==d||t[33]!==p?(k=a?(0,N.jsx)(`div`,{className:`bg-muted/20`,children:p?(0,N.jsx)(`div`,{className:`px-4 py-2 text-xs text-muted-foreground italic`,children:`Loading diff`}):d?(0,N.jsxs)(`div`,{className:`px-4 py-2 text-xs text-destructive`,children:[`Failed: `,d]}):l===null?(0,N.jsx)(`div`,{className:`px-4 py-2 text-xs text-muted-foreground italic`,children:`No diff.`}):(0,N.jsx)(M.Suspense,{fallback:(0,N.jsx)(`div`,{className:`px-4 py-2 text-xs text-muted-foreground italic`,children:`Loading diff`}),children:(0,N.jsx)(ue,{diff:l})})}):null,t[30]=l,t[31]=a,t[32]=d,t[33]=p,t[34]=k):k=t[34];let A;return t[35]!==O||t[36]!==k?(A=(0,N.jsxs)(`div`,{className:`border-t border-border/50`,children:[O,k]}),t[35]=O,t[36]=k,t[37]=A):A=t[37],A}function P(){return Date.now()}function pe(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 F(e){let t=(0,j.c)(93),{file:n,sessionAlive:r,isWriting:i,onNavigate:a,onUndoLast:s,onUndoAll:l,fetchBurstDiff:u}=e,[d,f]=(0,M.useState)(!1),[p,m]=(0,M.useState)(!1),[h,g]=(0,M.useState)(!1),[y,b]=(0,M.useState)(he),x,S;if(t[0]===Symbol.for(`react.memo_cache_sentinel`)?(x=()=>{let e=setInterval(()=>b(Date.now()),3e4);return()=>clearInterval(e)},S=[],t[0]=x,t[1]=S):(x=t[0],S=t[1]),(0,M.useEffect)(x,S),n.bursts.length===0)return null;let k=!r||n.bursts.length===0||h,re=r?n.bursts.length===0?`Nothing to undo on this file`:null:`Session ended — undo unavailable`,ie;t[2]!==k||t[3]!==n.docName||t[4]!==s?(ie=e=>{e.stopPropagation(),!k&&(g(!0),Promise.resolve(s(n.docName)).finally(()=>g(!1)))},t[2]=k,t[3]=n.docName,t[4]=s,t[5]=ie):ie=t[5];let ae=ie,oe;t[6]===k?oe=t[7]:(oe=e=>{e.stopPropagation(),!k&&m(!0)},t[6]=k,t[7]=oe);let se=oe,ce;t[8]!==k||t[9]!==n.docName||t[10]!==l?(ce=()=>{m(!1),!k&&(g(!0),Promise.resolve(l(n.docName)).finally(()=>g(!1)))},t[8]=k,t[9]=n.docName,t[10]=l,t[11]=ce):ce=t[11];let le=ce,ue;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(ue=()=>f(me),t[12]=ue):ue=t[12];let de=d?`Collapse ${n.docName}`:`Expand ${n.docName}`,P;t[13]===d?P=t[14]:(P=d?(0,N.jsx)(c,{className:`size-4`,"aria-hidden":`true`}):(0,N.jsx)(o,{className:`size-4`,"aria-hidden":`true`}),t[13]=d,t[14]=P);let F;t[15]!==d||t[16]!==de||t[17]!==P?(F=(0,N.jsx)(`button`,{type:`button`,onClick:ue,className:`flex size-5 shrink-0 items-center justify-center rounded hover:bg-muted`,"aria-expanded":d,"aria-label":de,"data-testid":`activity-panel-file-row-carrot`,children:P}),t[15]=d,t[16]=de,t[17]=P,t[18]=F):F=t[18];let I;t[19]!==n.docName||t[20]!==a?(I=()=>a(n.docName),t[19]=n.docName,t[20]=a,t[21]=I):I=t[21];let ge=`Navigate to ${n.docName}`,L;t[22]!==n.docName||t[23]!==I||t[24]!==ge?(L=(0,N.jsx)(`button`,{type:`button`,onClick:I,className:`min-w-0 flex-1 truncate text-left text-foreground hover:underline focus-visible:outline-ring`,"aria-label":ge,"data-testid":`activity-panel-file-row-filename`,title:n.docName,children:n.docName}),t[22]=n.docName,t[23]=I,t[24]=ge,t[25]=L):L=t[25];let _e=`Undo last edit on ${n.docName}`,ve;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(ve=(0,N.jsx)(v,{className:`size-3.5`,"aria-hidden":`true`}),t[26]=ve):ve=t[26];let R;t[27]!==k||t[28]!==ae||t[29]!==_e?(R=(0,N.jsx)(A,{asChild:!0,children:(0,N.jsx)(_,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6 shrink-0`,onClick:ae,disabled:k,"aria-label":_e,"data-testid":`activity-panel-undo-last`,children:ve})}),t[27]=k,t[28]=ae,t[29]=_e,t[30]=R):R=t[30];let ye=re??`Undo last edit`,z;t[31]===ye?z=t[32]:(z=(0,N.jsx)(ee,{side:`bottom`,children:ye}),t[31]=ye,t[32]=z);let B;t[33]!==R||t[34]!==z?(B=(0,N.jsxs)(te,{children:[R,z]}),t[33]=R,t[34]=z,t[35]=B):B=t[35];let be=`Undo all edits on ${n.docName}`,xe;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,N.jsx)(ne,{className:`size-3.5`,"aria-hidden":`true`}),t[36]=xe):xe=t[36];let V;t[37]!==k||t[38]!==se||t[39]!==be?(V=(0,N.jsx)(A,{asChild:!0,children:(0,N.jsx)(_,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6 shrink-0`,onClick:se,disabled:k,"aria-label":be,"data-testid":`activity-panel-undo-all`,children:xe})}),t[37]=k,t[38]=se,t[39]=be,t[40]=V):V=t[40];let Se=re??`Undo all edits`,H;t[41]===Se?H=t[42]:(H=(0,N.jsx)(ee,{side:`bottom`,children:Se}),t[41]=Se,t[42]=H);let U;t[43]!==V||t[44]!==H?(U=(0,N.jsxs)(te,{children:[V,H]}),t[43]=V,t[44]=H,t[45]=U):U=t[45];let W;t[46]===n.additionsTotal?W=t[47]:(W=(0,N.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additionsTotal]}),t[46]=n.additionsTotal,t[47]=W);let G;t[48]===n.deletionsTotal?G=t[49]:(G=(0,N.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletionsTotal]}),t[48]=n.deletionsTotal,t[49]=G);let K;t[50]!==W||t[51]!==G?(K=(0,N.jsxs)(`span`,{className:`shrink-0 font-mono text-xs`,children:[W,` `,G]}),t[50]=W,t[51]=G,t[52]=K):K=t[52];let q;t[53]!==n.lastTs||t[54]!==y?(q=pe(n.lastTs,y),t[53]=n.lastTs,t[54]=y,t[55]=q):q=t[55];let J;t[56]===q?J=t[57]:(J=(0,N.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:q}),t[56]=q,t[57]=J);let Y;t[58]===i?Y=t[59]:(Y=i?(0,N.jsx)(`span`,{className:`shrink-0 text-[11px] text-primary animate-pulse`,role:`status`,children:`writing`}):null,t[58]=i,t[59]=Y);let X;t[60]!==L||t[61]!==B||t[62]!==U||t[63]!==K||t[64]!==J||t[65]!==Y||t[66]!==F?(X=(0,N.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 text-sm`,children:[F,L,B,U,K,J,Y]}),t[60]=L,t[61]=B,t[62]=U,t[63]=K,t[64]=J,t[65]=Y,t[66]=F,t[67]=X):X=t[67];let Z;t[68]!==d||t[69]!==u||t[70]!==n.bursts||t[71]!==n.docName?(Z=d?(0,N.jsx)(`div`,{children:n.bursts.map(e=>(0,N.jsx)(fe,{burst:e,docName:n.docName,fetchBurstDiff:u},`${n.docName}:${e.stackIndex}`))}):null,t[68]=d,t[69]=u,t[70]=n.bursts,t[71]=n.docName,t[72]=Z):Z=t[72];let Ce;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,N.jsx)(w,{children:`Undo all edits on this file?`}),t[73]=Ce):Ce=t[73];let Q;t[74]===n.docName?Q=t[75]:(Q=(0,N.jsx)(`span`,{className:`font-mono text-foreground`,children:n.docName}),t[74]=n.docName,t[75]=Q);let we=n.bursts.length===1?``:`s`,Te;t[76]!==n.bursts.length||t[77]!==Q||t[78]!==we?(Te=(0,N.jsxs)(D,{children:[Ce,(0,N.jsxs)(C,{children:[`This will revert every change this agent has made to`,` `,Q,` in their current session (`,n.bursts.length,` burst`,we,`). Other files and other writers are not affected.`]})]}),t[76]=n.bursts.length,t[77]=Q,t[78]=we,t[79]=Te):Te=t[79];let Ee;t[80]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=(0,N.jsx)(_,{type:`button`,variant:`outline`,onClick:()=>m(!1),"data-testid":`activity-panel-undo-all-cancel`,children:`Cancel`}),t[80]=Ee):Ee=t[80];let De;t[81]===le?De=t[82]:(De=(0,N.jsxs)(E,{children:[Ee,(0,N.jsx)(_,{type:`button`,variant:`destructive`,onClick:le,"data-testid":`activity-panel-undo-all-confirm`,children:`Undo all`})]}),t[81]=le,t[82]=De);let Oe;t[83]!==Te||t[84]!==De?(Oe=(0,N.jsxs)(T,{className:`sm:max-w-md`,children:[Te,De]}),t[83]=Te,t[84]=De,t[85]=Oe):Oe=t[85];let $;t[86]!==p||t[87]!==Oe?($=(0,N.jsx)(O,{open:p,onOpenChange:m,children:Oe}),t[86]=p,t[87]=Oe,t[88]=$):$=t[88];let ke;return t[89]!==X||t[90]!==Z||t[91]!==$?(ke=(0,N.jsxs)(`div`,{className:`border-b border-border`,"data-testid":`activity-panel-file-row`,children:[X,Z,$]}),t[89]=X,t[90]=Z,t[91]=$,t[92]=ke):ke=t[92],ke}function me(e){return!e}function he(){return Date.now()}async function I(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 ge(e){return`#/${e.split(`/`).map(e=>encodeURIComponent(e)).join(`/`)}`}function L(e){typeof window>`u`||(window.location.hash=ge(e))}function _e(){let e=(0,j.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,N.jsxs)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,role:`status`,"aria-busy":`true`,children:[(0,N.jsx)(l,{className:`mr-2 size-4 animate-spin`,"aria-hidden":`true`}),(0,N.jsx)(`span`,{className:`text-sm`,children:`Loading agent activity`})]}),e[0]=t):t=e[0],t}function ve(e){let t=(0,j.c)(9),{error:n,onRetry:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,N.jsx)(s,{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,N.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,N.jsxs)(`div`,{className:`space-y-1`,children:[a,(0,N.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,N.jsx)(_,{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,N.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 R(){let e=(0,j.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,N.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,"data-testid":`activity-panel-empty`,children:(0,N.jsx)(`p`,{className:`text-sm italic`,children:`No edits yet.`})}),e[0]=t):t=e[0],t}function ye(e){let t=(0,j.c)(8),{onExit:n}=e,r;t[0]===n?r=t[1]:(r=(0,N.jsx)(z,{onClick:n}),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,N.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,N.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,N.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-6 text-muted-foreground`,children:(0,N.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,N.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 z(e){let t=(0,j.c)(6),{onClick:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,N.jsx)(b,{}),t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i=(0,N.jsx)(A,{asChild:!0,children:(0,N.jsx)(_,{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,N.jsx)(ee,{side:`bottom`,children:`Back to document view`}),t[3]=a):a=t[3];let o;return t[4]===i?o=t[5]:(o=(0,N.jsxs)(te,{children:[i,a]}),t[4]=i,t[5]=o),o}function B(e){let t=(0,j.c)(9),{lastTs:n}=e,[r]=(0,M.useState)(be),i;t[0]!==n||t[1]!==r?(i=n?xe(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,N.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,N.jsxs)(`span`,{children:[` · `,a]}):null,t[4]=a,t[5]=s);let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,N.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,N.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 be(){return Date.now()}function xe(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,j.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,N.jsx)(x,{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,N.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 Se(e){let t=(0,j.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,N.jsx)(z,{onClick:s}),t[0]=s,t[1]=f);let p;t[2]===n?p=t[3]:(p=n?.agent?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(V,{agent:n.agent}),(0,N.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,N.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:n.agent.displayName}),(0,N.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,N.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,N.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,N.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,N.jsx)(`div`,{className:`flex-1 overflow-y-auto`,"data-testid":`activity-panel-body`,children:r===`loading`&&n===null?(0,N.jsx)(_e,{}):r===`error`&&i?(0,N.jsx)(ve,{error:i,onRetry:a}):n===null?(0,N.jsx)(R,{}):(0,N.jsxs)(N.Fragment,{children:[n.sessionAlive?null:(0,N.jsx)(B,{lastTs:d}),n.files.length===0?(0,N.jsx)(R,{}):n.files.map(e=>(0,N.jsx)(F,{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,N.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 H(){let e=(0,j.c)(22),{docPanelAgentId:t,closeActivityPanel:n}=u(),{openDocumentTransition:r}=d(),{data:i,status:a,error:o,reload:s,fetchBurstDiff:c}=se(t);if(t===null){let t;return e[0]===n?t=e[1]:(t=(0,N.jsx)(ye,{onExit:n}),e[0]=n,e[1]=t),t}let l;e[2]===r?l=e[3]:(l=e=>{r(e),L(e)},e[2]=r,e[3]=l);let f=l,p;e[4]!==i||e[5]!==t||e[6]!==s?(p=async e=>{try{await I({connectionId:t,docName:e,scope:`last`,agentName:i?.agent?.displayName}),s()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);k.error(`Undo failed: ${n}`),s()}},e[4]=i,e[5]=t,e[6]=s,e[7]=p):p=e[7];let m=p,h;e[8]!==i||e[9]!==t||e[10]!==s?(h=async e=>{try{await I({connectionId:t,docName:e,scope:`file`,agentName:i?.agent?.displayName}),k.success(`Undone all edits on ${e}`),s()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);k.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]!==f||e[17]!==g||e[18]!==m||e[19]!==s||e[20]!==a?(_=(0,N.jsx)(Se,{data:i,status:a,error:o,reload:s,fetchBurstDiff:c,onExit:n,onNavigate:f,onUndoLast:m,onUndoAll:g}),e[12]=n,e[13]=i,e[14]=o,e[15]=c,e[16]=f,e[17]=g,e[18]=m,e[19]=s,e[20]=a,e[21]=_):_=e[21],_}export{H as ActivityModeContent};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{t as i}from"./button-C1nwPVFQ.js";import{a,c as o,i as s,n as c,o as l,s as u,t as ee,x as d}from"./dialog-CY2eQd6O.js";import{t as te}from"./input-hZk8Tm0e.js";import{n as ne,r as f,t as re}from"./project-paths-hiY0fNWB.js";import{t as ie}from"./textarea-gXd-JXvQ.js";var ae=r(),p=e(t(),1),m=n(),oe=750,se={root:`You picked the filesystem root (/). Scaffolding here will scan every file on this machine — make sure that's what you want.`,home:`You picked your home directory. OK will index everything in your home tree — large and may surface personal files.`,"home-documents":`You picked ~/Documents. OK will index every markdown file under it. If you only want to manage a sub-folder, choose a smaller scope.`,"home-desktop":`You picked ~/Desktop. OK will index everything on your desktop.`,"home-downloads":`You picked ~/Downloads. Files there are usually transient — consider a stable folder instead.`,"volumes-mount":`This path is on an external volume (/Volumes/...). OK will lose track of files when the drive ejects.`,"drive-root":`This looks like a drive root (e.g., C:\\). Scaffolding here will scan an entire drive.`},h={error:e=>d.error(e)};function ce(e){let t=(0,ae.c)(9),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{store:r,toast:i,payload:a}=n,o=r===void 0?f:r,s=i===void 0?h:i,c;t[2]!==a||t[3]!==o?(c=a??o.getSnapshot(),t[2]=a,t[3]=o,t[4]=c):c=t[4];let l=c;if(!l)return null;let u;return t[5]!==l||t[6]!==o||t[7]!==s?(u=(0,m.jsx)(g,{payload:l,store:o,toast:s}),t[5]=l,t[6]=o,t[7]=s,t[8]=u):u=t[8],u}function g(e){let t=(0,ae.c)(96),{payload:n,store:r,toast:d}=e,[f,se]=(0,p.useState)(n.defaultContentDir),[h,ce]=(0,p.useState)(``),g;t[0]===n.editorOptions?g=t[1]:(g=()=>new Set(n.editorOptions.map(ue)),t[0]=n.editorOptions,t[1]=g);let[_,fe]=(0,p.useState)(g),[pe,me]=(0,p.useState)(null),[v,y]=(0,p.useState)(!1),[b,he]=(0,p.useState)(null),x,S;t[2]===f?(x=t[3],S=t[4]):(x=()=>{if(!re(f)){me(null);return}let e=!1,t=setTimeout(()=>{let t=window.okDesktop;t&&t.onboarding.probeContent({contentDir:f}).then(t=>{e||me(t)}).catch(t=>{e||me({ok:!1,error:t instanceof Error?t.message:`probe failed`})})},oe);return()=>{e=!0,clearTimeout(t)}},S=[f],t[2]=f,t[3]=x,t[4]=S),(0,p.useEffect)(x,S);let ge;t[5]===f?ge=t[6]:(ge=re(f),t[5]=f,t[6]=ge);let C=ge,w=v||!C,T;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(T=function(e){fe(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[7]=T):T=t[7];let _e=T,E;t[8]===n.projectDir?E=t[9]:(E=async function(){let e=window.okDesktop;if(!e)return;let t;try{t=await e.dialog.openFolder({defaultPath:n.projectDir})}catch(e){let t=e;he(t instanceof Error?t.message:`Could not open folder picker`);return}if(t===null)return;let r=ne(n.projectDir,t);if(r===null){he(`Selection must be inside the project`);return}he(null),se(r)},t[8]=n.projectDir,t[9]=E);let ve=E,D;t[10]!==h||t[11]!==f||t[12]!==_||t[13]!==r||t[14]!==d?(D=async function(){y(!0);let e=await r.confirm({initGit:!0,contentDir:f,additionalIgnores:h,editorIds:Array.from(_)});e.ok||(d.error(e.error),y(!1))},t[10]=h,t[11]=f,t[12]=_,t[13]=r,t[14]=d,t[15]=D):D=t[15];let ye=D,O;t[16]!==ye||t[17]!==w?(O=function(e){e.preventDefault(),!w&&ye()},t[16]=ye,t[17]=w,t[18]=O):O=t[18];let be=O,k;t[19]!==r||t[20]!==d?(k=async function(){y(!0);let e=await r.cancel();e.ok||(d.error(e.error),y(!1))},t[19]=r,t[20]=d,t[21]=k):k=t[21];let A=k,j;t[22]!==v||t[23]!==A?(j=function(e){!e&&!v&&A()},t[22]=v,t[23]=A,t[24]=j):j=t[24];let xe=j,M;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,m.jsx)(o,{children:`Open this folder with Open Knowledge`}),t[25]=M):M=t[25];let N;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,m.jsxs)(u,{children:[M,(0,m.jsxs)(a,{children:[`Open Knowledge will create a `,(0,m.jsx)(`code`,{children:`.ok/`}),` folder to track this project's metadata. Click Start to proceed with the defaults below — adjust any field first, or Cancel to leave the folder untouched.`]})]}),t[26]=N):N=t[26];let P;t[27]!==n.gitRootPromoted||t[28]!==n.pickedPath||t[29]!==n.projectDir?(P=n.gitRootPromoted?(0,m.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`OK will be initialized at `,(0,m.jsx)(`code`,{children:n.projectDir}),` — the parent of`,` `,(0,m.jsx)(`code`,{children:ne(n.projectDir,n.pickedPath)??n.pickedPath}),` `,`because it contains a `,(0,m.jsx)(`code`,{children:`.git`}),` folder (one .ok/ per git repo).`,` `,(0,m.jsx)(`code`,{children:`Content directory`}),` defaults to `,(0,m.jsx)(`code`,{children:`.`}),` (the whole repo); type a sub-folder below to narrow it.`]}):null,t[27]=n.gitRootPromoted,t[28]=n.pickedPath,t[29]=n.projectDir,t[30]=P):P=t[30];let F;t[31]===n.warnings?F=t[32]:(F=n.warnings.length>0?(0,m.jsx)(`div`,{role:`alert`,className:`rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900 dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200`,children:n.warnings.map(le)}):null,t[31]=n.warnings,t[32]=F);let I;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,m.jsx)(`label`,{htmlFor:`consent-content-dir`,className:`mb-1 block text-sm font-medium`,children:`Content directory`}),t[33]=I):I=t[33];let L;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>{se(e.target.value),he(null)},t[34]=L):L=t[34];let Se=!C,R;t[35]!==v||t[36]!==f||t[37]!==Se?(R=(0,m.jsx)(te,{id:`consent-content-dir`,value:f,onChange:L,disabled:v,"aria-invalid":Se,"data-testid":`consent-content-dir`,className:`flex-1`}),t[35]=v,t[36]=f,t[37]=Se,t[38]=R):R=t[38];let z;t[39]===ve?z=t[40]:(z=()=>void ve(),t[39]=ve,t[40]=z);let B;t[41]!==v||t[42]!==z?(B=(0,m.jsx)(i,{type:`button`,variant:`outline`,disabled:v,onClick:z,"data-testid":`consent-content-dir-browse`,children:`Browse`}),t[41]=v,t[42]=z,t[43]=B):B=t[43];let V;t[44]!==R||t[45]!==B?(V=(0,m.jsxs)(`div`,{className:`flex items-stretch gap-2`,children:[R,B]}),t[44]=R,t[45]=B,t[46]=V):V=t[46];let H;t[47]!==b||t[48]!==C||t[49]!==pe?(H=b===null?C?(0,m.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,"data-testid":`consent-preview`,children:de(pe)}):(0,m.jsx)(`p`,{className:`mt-1 text-xs text-destructive`,"data-testid":`consent-content-dir-error`,children:`Content directory must be inside the project`}):(0,m.jsx)(`p`,{className:`mt-1 text-xs text-destructive`,"data-testid":`consent-content-dir-browse-error`,children:b}),t[47]=b,t[48]=C,t[49]=pe,t[50]=H):H=t[50];let U;t[51]!==V||t[52]!==H?(U=(0,m.jsxs)(`div`,{children:[I,V,H]}),t[51]=V,t[52]=H,t[53]=U):U=t[53];let Ce;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,m.jsx)(`label`,{htmlFor:`consent-additional-ignores`,className:`mb-1 block text-sm font-medium`,children:`Ignore patterns`}),t[54]=Ce):Ce=t[54];let we;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(we=e=>ce(e.target.value),t[55]=we):we=t[55];let W;t[56]!==h||t[57]!==v?(W=(0,m.jsx)(ie,{id:`consent-additional-ignores`,value:h,onChange:we,disabled:v,placeholder:`tmp/
|
|
2
|
+
*.draft.md`,rows:3,"data-testid":`consent-additional-ignores`}),t[56]=h,t[57]=v,t[58]=W):W=t[58];let Te;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,m.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[`One pattern per line — appended to `,(0,m.jsx)(`code`,{children:`.okignore`}),`.`]}),t[59]=Te):Te=t[59];let G;t[60]===W?G=t[61]:(G=(0,m.jsxs)(`div`,{children:[Ce,W,Te]}),t[60]=W,t[61]=G);let Ee;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=(0,m.jsx)(`legend`,{className:`text-sm font-medium`,children:`Connect to AI tools`}),t[62]=Ee):Ee=t[62];let De;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(De=(0,m.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`All editors are checked by default — uncheck the ones you don't use. Each checked editor's project-MCP config is written; the Claude Code entry also scaffolds`,` `,(0,m.jsx)(`code`,{children:`.claude/launch.json`}),`.`]}),t[63]=De):De=t[63];let K;if(t[64]!==v||t[65]!==_||t[66]!==n.editorOptions){let e;t[68]!==v||t[69]!==_?(e=e=>(0,m.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,m.jsx)(`input`,{type:`checkbox`,checked:_.has(e.id),onChange:()=>_e(e.id),disabled:v,className:`size-4 shrink-0 rounded accent-primary`,"data-testid":`consent-editor-${e.id}`}),(0,m.jsx)(`span`,{children:e.label}),(0,m.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`consent-editor-${e.id}-scope`,children:e.hasProjectConfig?`(project + user)`:`(user-level only)`})]},e.id),t[68]=v,t[69]=_,t[70]=e):e=t[70],K=n.editorOptions.map(e),t[64]=v,t[65]=_,t[66]=n.editorOptions,t[67]=K}else K=t[67];let q;t[71]===K?q=t[72]:(q=(0,m.jsxs)(`fieldset`,{className:`space-y-2 pb-2`,children:[Ee,De,K]}),t[71]=K,t[72]=q);let J;t[73]!==P||t[74]!==F||t[75]!==U||t[76]!==G||t[77]!==q?(J=(0,m.jsxs)(c,{className:`space-y-4`,children:[P,F,U,G,q]}),t[73]=P,t[74]=F,t[75]=U,t[76]=G,t[77]=q,t[78]=J):J=t[78];let Y;t[79]===A?Y=t[80]:(Y=()=>void A(),t[79]=A,t[80]=Y);let X;t[81]!==v||t[82]!==Y?(X=(0,m.jsx)(i,{type:`button`,variant:`outline`,className:`font-mono uppercase`,onClick:Y,disabled:v,"data-testid":`consent-cancel`,children:`Cancel`}),t[81]=v,t[82]=Y,t[83]=X):X=t[83];let Z;t[84]===w?Z=t[85]:(Z=(0,m.jsx)(i,{type:`submit`,disabled:w,"data-testid":`consent-start`,children:`Start`}),t[84]=w,t[85]=Z);let Q;t[86]!==X||t[87]!==Z?(Q=(0,m.jsxs)(l,{children:[X,Z]}),t[86]=X,t[87]=Z,t[88]=Q):Q=t[88];let $;t[89]!==be||t[90]!==J||t[91]!==Q?($=(0,m.jsxs)(s,{className:`sm:max-w-lg motion-reduce:duration-0 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none`,children:[N,(0,m.jsxs)(`form`,{onSubmit:be,"data-testid":`consent-form`,className:`flex min-h-0 flex-1 flex-col`,children:[J,Q]})]}),t[89]=be,t[90]=J,t[91]=Q,t[92]=$):$=t[92];let Oe;return t[93]!==xe||t[94]!==$?(Oe=(0,m.jsx)(ee,{open:!0,onOpenChange:xe,children:$}),t[93]=xe,t[94]=$,t[95]=Oe):Oe=t[95],Oe}function le(e){return(0,m.jsx)(`p`,{className:`mb-1 last:mb-0`,children:se[e.kind]},e.kind)}function ue(e){return e.id}function de(e){if(e===null)return`Counting markdown files`;if(!e.ok)return`Preview unavailable: ${e.error}`;let t=e.truncated?`≥ 50,000`:String(e.count);return e.sample.length===0?`Found ${t} markdown files`:`Found ${t} markdown files; sample: ${e.sample.join(`, `)}`}export{ce as default};
|