@inkeep/open-knowledge 0.24.1-beta.2 → 0.25.0-beta.1
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 +5 -0
- package/dist/assets/skills/discovery/SKILL.md +1 -1
- package/dist/assets/skills/project/SKILL.md +1 -1
- package/dist/cli.mjs +6 -6
- package/dist/constants-C5Kh99hH.mjs +2 -0
- package/dist/{dist-BE7wFbsP.mjs → dist-CwoT-vvz.mjs} +5 -5
- package/dist/{dist-BGSaL7p3.mjs → dist-tv3SH76A.mjs} +1 -1
- package/dist/{gh-detect-B4gJX6Zo.mjs → gh-detect-C_OoX4ZE.mjs} +2 -2
- package/dist/index.d.mts +2 -0
- package/dist/index.mjs +1 -1
- package/dist/{init-CN8ty6F9.mjs → init-BFySg4cK.mjs} +12 -12
- package/dist/init-ByAw3X7-.mjs +1 -0
- package/dist/{loader-CCpZauUS.mjs → loader-kYfLQbUq.mjs} +2 -2
- package/dist/loader-p811lc-J.mjs +1 -0
- package/dist/preview-BcZ2y0Ew.mjs +1 -0
- package/dist/{preview-C6whX7rn.mjs → preview-DcLHmjqA.mjs} +2 -2
- package/dist/public/assets/ActivityModeContent-BXwyo0tV.js +2 -0
- package/dist/public/assets/{ConsentDialogBody-DCI_Zz2q.js → ConsentDialogBody-DPw1rTwW.js} +1 -1
- package/dist/public/assets/{DocumentContext-C0dw3rw3.js → DocumentContext-BiJ-_xlQ.js} +20 -20
- package/dist/public/assets/{GraphPanel-Dtitc1eX.js → GraphPanel-D5yxV_ez.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-DSNCCGIr.js → ManagedArtifactProperties-DrATYt0M.js} +1 -1
- package/dist/public/assets/{McpConsentDialogBody-BbLcmrpa.js → McpConsentDialogBody-DnW93Hlu.js} +1 -1
- package/dist/public/assets/{PropertyPanel-DnhJSeOi.js → PropertyPanel-DDb_pPhO.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-U76LymvA.js → SettingsDialogBody-Cq52gaLH.js} +1 -1
- package/dist/public/assets/{SkillEditorActions-6BIs3QJ2.js → SkillEditorActions-BEyFie-g.js} +1 -1
- package/dist/public/assets/{SourceEditor-BXNCwVDU.js → SourceEditor-Ca3EOrpG.js} +1 -1
- package/dist/public/assets/{TerminalPanel-BZfQlHIU.js → TerminalPanel-Ds-ev2-D.js} +1 -1
- package/dist/public/assets/agent-presence-BRmBPq78.js +1 -0
- package/dist/public/assets/{arc-CiaWvt2w.js → arc-DHpQGPKi.js} +1 -1
- package/dist/public/assets/{architectureDiagram-Q4EWVU46-NxFvfkUm.js → architectureDiagram-Q4EWVU46-Dl6zKdMi.js} +1 -1
- package/dist/public/assets/{blockDiagram-DXYQGD6D-BeV4XK8L.js → blockDiagram-DXYQGD6D-TTNbipzm.js} +1 -1
- package/dist/public/assets/{c4Diagram-AHTNJAMY-DMxcpW8j.js → c4Diagram-AHTNJAMY-DJ6_yNro.js} +1 -1
- package/dist/public/assets/{calendar-hJvUCxTp.js → calendar-BefXYqrv.js} +1 -1
- package/dist/public/assets/channel-ClECMrL_.js +1 -0
- package/dist/public/assets/{checkbox-Br2wN2O0.js → checkbox-DwE0ySFI.js} +1 -1
- package/dist/public/assets/{chunk-336JU56O-D1-vm4Aq.js → chunk-336JU56O-BDNF8ABQ.js} +2 -2
- package/dist/public/assets/chunk-426QAEUC-UlKin18B.js +1 -0
- package/dist/public/assets/{chunk-4BX2VUAB-BBbXBHik.js → chunk-4BX2VUAB-B11p4CCh.js} +1 -1
- package/dist/public/assets/{chunk-4TB4RGXK-8_DPOE46.js → chunk-4TB4RGXK-k8il4Vah.js} +1 -1
- package/dist/public/assets/chunk-55IACEB6-maKdi3q_.js +1 -0
- package/dist/public/assets/{chunk-5FUZZQ4R-Dcjz8zV3.js → chunk-5FUZZQ4R-BhDATrAC.js} +1 -1
- package/dist/public/assets/{chunk-5PVQY5BW-zd6E2AwX.js → chunk-5PVQY5BW-7GSXpGpA.js} +1 -1
- package/dist/public/assets/{chunk-BSJP7CBP-COD3jCAD.js → chunk-BSJP7CBP-DRn1Q8qZ.js} +1 -1
- package/dist/public/assets/{chunk-EDXVE4YY-DJpiytWA.js → chunk-EDXVE4YY-TfqLQBKW.js} +1 -1
- package/dist/public/assets/{chunk-ENJZ2VHE-BRL63elo.js → chunk-ENJZ2VHE-CqUfmxZL.js} +1 -1
- package/dist/public/assets/{chunk-FMBD7UC4-8FaPWUe0.js → chunk-FMBD7UC4-_M3xiFqk.js} +1 -1
- package/dist/public/assets/{chunk-ICPOFSXX-CBTIINX7.js → chunk-ICPOFSXX-MhneOmo1.js} +1 -1
- package/dist/public/assets/{chunk-OYMX7WX6-CZN76u5O.js → chunk-OYMX7WX6-Dn8GoIJo.js} +1 -1
- package/dist/public/assets/chunk-QZHKN3VN-DUJDGGgJ.js +1 -0
- package/dist/public/assets/{chunk-U2HBQHQK-DEerLjEq.js → chunk-U2HBQHQK-Wd4MIHD7.js} +1 -1
- package/dist/public/assets/{chunk-X2U36JSP-B_Aoz3Bs.js → chunk-X2U36JSP-DgR3BYDC.js} +1 -1
- package/dist/public/assets/{chunk-XPW4576I-Cfo5EZ2y.js → chunk-XPW4576I-BIhGQhfc.js} +1 -1
- package/dist/public/assets/{chunk-YZCP3GAM-D8IyN6od.js → chunk-YZCP3GAM-DfCU0Z-P.js} +1 -1
- package/dist/public/assets/{chunk-ZZ45TVLE-CtHOqhsK.js → chunk-ZZ45TVLE-Bml1MOax.js} +1 -1
- package/dist/public/assets/classDiagram-6PBFFD2Q-C9zXtHUq.js +1 -0
- package/dist/public/assets/classDiagram-v2-HSJHXN6E-BLmW_Iw2.js +1 -0
- package/dist/public/assets/clone-1iKEKVKL.js +1 -0
- package/dist/public/assets/config-validation-events-xzRhWOFG.js +11 -0
- package/dist/public/assets/{cose-bilkent-S5V4N54A-D7s2A-mt.js → cose-bilkent-S5V4N54A-CIV0yZWV.js} +1 -1
- package/dist/public/assets/{dagre-Bdh4z066.js → dagre-BUnZfAns.js} +1 -1
- package/dist/public/assets/{dagre-KV5264BT-CnfZ6fw7.js → dagre-KV5264BT-Bscv1HQo.js} +1 -1
- package/dist/public/assets/{diagram-5BDNPKRD-DH8DUt-N.js → diagram-5BDNPKRD-QBP7yg8z.js} +1 -1
- package/dist/public/assets/{diagram-G4DWMVQ6-D7Y2TMQn.js → diagram-G4DWMVQ6-CMdeZ41j.js} +1 -1
- package/dist/public/assets/{diagram-MMDJMWI5-_CTgdNhE.js → diagram-MMDJMWI5-DCz0ew8n.js} +1 -1
- package/dist/public/assets/{diagram-TYMM5635-yAT3IgDs.js → diagram-TYMM5635-zN9Dx1fB.js} +1 -1
- package/dist/public/assets/{dist-Di2l3Ssa.js → dist-GmorMgHF.js} +1 -1
- package/dist/public/assets/{documents-events-BYd41PCA.js → documents-events-CSQluyCM.js} +1 -1
- package/dist/public/assets/{erDiagram-SMLLAGMA-B2N-rX7W.js → erDiagram-SMLLAGMA-CFPPEjz0.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-D5GTz2ID.js → file-tree-adapter-TDYabCI-.js} +1 -1
- package/dist/public/assets/{flowDiagram-DWJPFMVM-BokUmIjd.js → flowDiagram-DWJPFMVM-DOjygKY4.js} +1 -1
- package/dist/public/assets/{ganttDiagram-T4ZO3ILL-BildKT2S.js → ganttDiagram-T4ZO3ILL-Cox3d5Yp.js} +1 -1
- package/dist/public/assets/{gitGraphDiagram-UUTBAWPF-DN7mmlx1.js → gitGraphDiagram-UUTBAWPF-BXvw3bmB.js} +1 -1
- package/dist/public/assets/{graphlib-Ev7xYInR.js → graphlib-FYrXvm7X.js} +1 -1
- package/dist/public/assets/index-DqAFQhRc.js +2004 -0
- package/dist/public/assets/index-HjoM0Lai.css +1 -0
- package/dist/public/assets/{infoDiagram-42DDH7IO-DLEmjvKE.js → infoDiagram-42DDH7IO-Bk54rrHD.js} +1 -1
- package/dist/public/assets/{ishikawaDiagram-UXIWVN3A-86ybJ4r7.js → ishikawaDiagram-UXIWVN3A-Bc3G_190.js} +1 -1
- package/dist/public/assets/{journeyDiagram-VCZTEJTY-Cjv_3O7y.js → journeyDiagram-VCZTEJTY-CLrtuKm7.js} +1 -1
- package/dist/public/assets/{kanban-definition-6JOO6SKY-DY3-b8O-.js → kanban-definition-6JOO6SKY-DwQiIK5Z.js} +1 -1
- package/dist/public/assets/{keyboard-shortcuts-BsTuVge8.js → keyboard-shortcuts-CZysvuV8.js} +1 -1
- package/dist/public/assets/{line-7O-RVBuT.js → line-Dk1foLQO.js} +1 -1
- package/dist/public/assets/{linear-k9FggNF1.js → linear-D7qoVA2u.js} +1 -1
- package/dist/public/assets/{mermaid.core-skHi15xD.js → mermaid.core-CLOkRfd8.js} +3 -3
- package/dist/public/assets/{mindmap-definition-QFDTVHPH-IB_V4uN7.js → mindmap-definition-QFDTVHPH-DYJRBCQs.js} +1 -1
- package/dist/public/assets/{navigation-targets-JmelDbnG.js → navigation-targets-CXdtVjj4.js} +1 -1
- package/dist/public/assets/{open-managed-artifact-tab-C1P5ckzv.js → open-managed-artifact-tab-CvsZjaW-.js} +1 -1
- package/dist/public/assets/{ordinal-CswHjkoW.js → ordinal-BLFf0NQg.js} +1 -1
- package/dist/public/assets/panzoom.es-1vRDHCmL.js +1 -0
- package/dist/public/assets/{pieDiagram-DEJITSTG-DGtP3wwq.js → pieDiagram-DEJITSTG-BtJ94Yhu.js} +1 -1
- package/dist/public/assets/{project-paths-CFOqTfJj.js → project-paths-CcPGtodV.js} +1 -1
- package/dist/public/assets/{prop-types-BI50tqle.js → prop-types-C_2IQGCC.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-34T5L4WZ-B9rxVP0b.js → quadrantDiagram-34T5L4WZ-B8wf6FVG.js} +1 -1
- package/dist/public/assets/{radio-group-BFP076-0.js → radio-group-CFPLlVag.js} +1 -1
- package/dist/public/assets/{requirementDiagram-MS252O5E-G580V0tZ.js → requirementDiagram-MS252O5E-PrH6Wk-f.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-XADWPNL6-DXuXPtkv.js → sankeyDiagram-XADWPNL6-DuDWdyws.js} +1 -1
- package/dist/public/assets/{selection-context-CQO18Ziy.js → selection-context-DBzjobL4.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-FGHM5R23-D3sq9jQw.js → sequenceDiagram-FGHM5R23-BvF_oV_w.js} +1 -1
- package/dist/public/assets/{skill-actions-DGnNQ-ww.js → skill-actions-5seH6nEr.js} +1 -1
- package/dist/public/assets/{skills-api-DlAIvvy9.js → skills-api-CAh7BbdG.js} +1 -1
- package/dist/public/assets/{src-E0Xmdnkn.js → src-DEzC9TbA.js} +1 -1
- package/dist/public/assets/{stateDiagram-FHFEXIEX-D0_mYY7n.js → stateDiagram-FHFEXIEX-BvOoHTsD.js} +1 -1
- package/dist/public/assets/stateDiagram-v2-QKLJ7IA2-B02IOISZ.js +1 -0
- package/dist/public/assets/{target-navigation-intent-DgYVkH6P.js → target-navigation-intent-C4nLupIH.js} +1 -1
- package/dist/public/assets/{telemetry-impl-Djdmeyn9.js → telemetry-impl-BM7BnAv2.js} +2 -2
- package/dist/public/assets/{telemetry-startup-BChv7055.js → telemetry-startup-Pz1ro4a2.js} +1 -1
- package/dist/public/assets/{timeline-definition-GMOUNBTQ-CMpZyEzW.js → timeline-definition-GMOUNBTQ-_VzX4HAF.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-QMerAO-A.js → typing-burst-detector-DerDTg2m.js} +1 -1
- package/dist/public/assets/{vennDiagram-DHZGUBPP-x72Dx_Vy.js → vennDiagram-DHZGUBPP-BiS2w_m-.js} +1 -1
- package/dist/public/assets/{wardleyDiagram-NUSXRM2D-QMd5rM-2.js → wardleyDiagram-NUSXRM2D-BgB2gOdF.js} +1 -1
- package/dist/public/assets/{xychartDiagram-5P7HB3ND-Cbqm8fTK.js → xychartDiagram-5P7HB3ND-DIurDFny.js} +1 -1
- package/dist/public/index.html +29 -29
- package/dist/{repair-launch-json-BY4V8Y3u.mjs → repair-launch-json-DJ72dZ5s.mjs} +2 -2
- package/dist/{repair-mcp-configs-BviHtgkr.mjs → repair-mcp-configs-CehYsaY5.mjs} +2 -2
- package/dist/repair-skills-8Fp4JWM2.mjs +1 -0
- package/dist/{repair-skills-BTS6TSPc.mjs → repair-skills-qae9fkzx.mjs} +2 -2
- package/dist/server-lock-8Lv6A-Xa-COMNAqoW.mjs +1 -0
- package/dist/{server-lock-CN2YHwpP-DwE4XXIS.mjs → server-lock-CN2YHwpP-CIPpd1-K.mjs} +2 -2
- package/dist/{src-8_8qDFXB.mjs → src-BGnLjdLF.mjs} +2 -2
- package/dist/start-BBxjM94q.mjs +1 -0
- package/dist/{start-BOvNJ8gf.mjs → start-DOnYbt5T.mjs} +2 -2
- package/dist/{write-project-skill-0Z8n-AaN.mjs → write-project-skill-Ta2BaP1w.mjs} +3 -3
- package/package.json +1 -1
- package/dist/constants-DgQvDmlF.mjs +0 -2
- package/dist/init-MfODXCVp.mjs +0 -1
- package/dist/loader-DxX33GnP.mjs +0 -1
- package/dist/preview-C-OA0vd3.mjs +0 -1
- package/dist/public/assets/ActivityModeContent-Clo_tbvc.js +0 -2
- package/dist/public/assets/agent-presence-CkVdjA8f.js +0 -1
- package/dist/public/assets/channel-Bc7iw-1z.js +0 -1
- package/dist/public/assets/chunk-426QAEUC-56v0L0jI.js +0 -1
- package/dist/public/assets/chunk-55IACEB6-C-vOsSCw.js +0 -1
- package/dist/public/assets/chunk-QZHKN3VN-L8ovJpy0.js +0 -1
- package/dist/public/assets/classDiagram-6PBFFD2Q-BKJjlIFa.js +0 -1
- package/dist/public/assets/classDiagram-v2-HSJHXN6E-C4fGwvjG.js +0 -1
- package/dist/public/assets/clone-rB6I880i.js +0 -1
- package/dist/public/assets/config-validation-events-CLcox5Vr.js +0 -11
- package/dist/public/assets/index-D1MvaGNd.css +0 -1
- package/dist/public/assets/index-D_PlF1jK.js +0 -2004
- package/dist/public/assets/stateDiagram-v2-QKLJ7IA2-BpKIOQ1k.js +0 -1
- package/dist/repair-skills-9djvOEM4.mjs +0 -1
- package/dist/server-lock-8Lv6A-Xa-Cxe-7wxJ.mjs +0 -1
- package/dist/start-DUN3zejh.mjs +0 -1
- /package/dist/public/assets/{ActivityPanelDiffView-PUPu9fFq.js → ActivityPanelDiffView-TEHR9A38.js} +0 -0
- /package/dist/public/assets/{__vite-browser-external-DIAygczV.js → __vite-browser-external-DimdflAw.js} +0 -0
- /package/dist/public/assets/{array-B6ZTlsco.js → array-CXyn2wAU.js} +0 -0
- /package/dist/public/assets/{chevron-down-BaPMAfbX.js → chevron-down-CzFz_0zd.js} +0 -0
- /package/dist/public/assets/{chevron-left-CGj9PTYZ.js → chevron-left-Bb3WBx0B.js} +0 -0
- /package/dist/public/assets/{chevron-right-CVuQ_gVm.js → chevron-right-jyIhGBkw.js} +0 -0
- /package/dist/public/assets/{collapsible-FSPLRtBn.js → collapsible-CjgfK1G5.js} +0 -0
- /package/dist/public/assets/{colors-7nNIGUOn.js → colors-DOVRXUpv.js} +0 -0
- /package/dist/public/assets/{config-context-tA-88vUT.js → config-context-DhhN0rlf.js} +0 -0
- /package/dist/public/assets/{cursor-BrtPotfZ.js → cursor-CpjEfgnv.js} +0 -0
- /package/dist/public/assets/{cytoscape.esm-rD9G3Tw9.js → cytoscape.esm-DGKrBfTH.js} +0 -0
- /package/dist/public/assets/{defaultLocale-jKqPDDbE.js → defaultLocale-CIVmmKdD.js} +0 -0
- /package/dist/public/assets/{dialog-C_TDJ6cj.js → dialog-CvKVTeQa.js} +0 -0
- /package/dist/public/assets/{dist-CPqf4XEL.js → dist-BAzUe-Rb.js} +0 -0
- /package/dist/public/assets/{init-TpXo0TbV.js → init-DAmDTHXL.js} +0 -0
- /package/dist/public/assets/{mermaid-parser.core-BD_vM2ET.js → mermaid-parser.core-WlD4T62P.js} +0 -0
- /package/dist/public/assets/{min-qPYEXls6.js → min-CGFu6QbN.js} +0 -0
- /package/dist/public/assets/{now-cVYsjiQf.js → now-C9pOxV0O.js} +0 -0
- /package/dist/public/assets/{path-CF3Q1cYH.js → path-1iyJ-o9O.js} +0 -0
- /package/dist/public/assets/{pdf-D2qYqk1m.js → pdf-BjE4l7oX.js} +0 -0
- /package/dist/public/assets/{pdf.worker-BkdiOOpP.js → pdf.worker-CU7PVDgr.js} +0 -0
- /package/dist/public/assets/{rough.esm-DwjmZEWq.js → rough.esm-Bk-GM2I8.js} +0 -0
- /package/dist/public/assets/{src-GEZz0zf_.js → src-C3imF5Zq.js} +0 -0
- /package/dist/public/assets/{toggle-group--3vcPCRI.js → toggle-group-Bc5FaFo3.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Fi as e,J as t,Oi as n,Vt as r,a as i,c as a,d as o,dn as s,f as c,g as l,h as u,i as d,ii as f,kn as p,l as m,m as h,n as g,o as _,on as v,p as y,r as b,s as x,t as S,tn as C,u as w,wn as T}from"./server-lock-CN2YHwpP-DwE4XXIS.mjs";import{$ as E,$i as D,$n as O,$r as k,$t as A,A as j,Ai as M,An as N,Ar as P,At as F,B as I,Bi as L,Bn as R,Br as z,Bt as B,C as V,Ci as H,Cn as U,Cr as W,Ct as G,D as K,Di as q,Dn as J,Dr as Y,Dt as X,E as Z,Ei as Q,En as $,Er as ee,Et as te,F as ne,Fi as re,Fn as ie,Fr as ae,Ft as oe,G as se,Gi as ce,Gn as le,Gr as ue,Gt as de,H as fe,Hi as pe,Hn as me,Hr as he,Ht as ge,I as _e,Ii as ve,In as ye,Ir as be,It as xe,J as Se,Ji as Ce,Jn as we,Jr as Te,Jt as Ee,K as De,Ki as Oe,Kn as ke,Kr as Ae,Kt as je,L as Me,Li as Ne,Ln as Pe,Lr as Fe,Lt as Ie,M as Le,Mi as Re,Mn as ze,Mr as Be,Mt as Ve,N as He,Ni as Ue,Nn as We,Nr as Ge,Nt as Ke,O as qe,Oi as Je,On as Ye,Or as Xe,Ot as Ze,P as Qe,Pi as $e,Pn as et,Pr as tt,Pt as nt,Q as rt,Qi as it,Qn as at,Qr as ot,Qt as st,R as ct,Ri as lt,Rn as ut,Rr as dt,Rt as ft,S as pt,Si as mt,Sn as ht,Sr as gt,St as _t,T as vt,Ti as yt,Tn as bt,Tr as xt,Tt as St,U as Ct,Ui as wt,Un as Tt,Ur as Et,Ut as Dt,V as Ot,Vi as kt,Vn as At,Vr as jt,Vt as Mt,W as Nt,Wi as Pt,Wn as Ft,Wr as It,Wt as Lt,X as Rt,Xi as zt,Xn as Bt,Xr as Vt,Xt as Ht,Y as Ut,Yi as Wt,Yn as Gt,Yr as Kt,Yt as qt,Z as Jt,Zi as Yt,Zn as Xt,Zr as Zt,Zt as Qt,_ as $t,_a as en,_i as tn,_n as nn,_r as rn,_t as an,a as on,aa as sn,ai as cn,an as ln,ar as un,at as dn,b as fn,bi as pn,bn as mn,br as hn,bt as gn,c as _n,ci as vn,cn as yn,cr as bn,ct as xn,d as Sn,di as Cn,dn as wn,dr as Tn,dt as En,ea as Dn,ei as On,en as kn,er as An,et as jn,f as Mn,fi as Nn,fn as Pn,fr as Fn,ft as In,g as Ln,gi as Rn,gn as zn,gr as Bn,gt as Vn,h as Hn,hi as Un,hn as Wn,hr as Gn,ht as Kn,i as qn,ia as Jn,ii as Yn,in as Xn,ir as Zn,it as Qn,j as $n,ji as er,jn as tr,jr as nr,jt as rr,k as ir,ki as ar,kn as or,kr as sr,kt as cr,l as lr,li as ur,ln as dr,lr as fr,lt as pr,m as mr,mi as hr,mn as gr,mr as _r,mt as vr,n as yr,na as br,ni as xr,nn as Sr,nr as Cr,nt as wr,o as Tr,oi as Er,on as Dr,or as Or,ot as kr,p as Ar,pi as jr,pn as Mr,pr as Nr,pt as Pr,q as Fr,qi as Ir,qn as Lr,qr as Rr,qt as zr,r as Br,ra as Vr,ri as Hr,rn as Ur,rr as Wr,rt as Gr,s as Kr,si as qr,sn as Jr,sr as Yr,st as Xr,t as Zr,ta as Qr,ti as $r,tn as ei,tr as ti,tt as ni,u as ri,ui as ii,un as ai,ur as oi,ut as si,v as ci,va as li,vi as ui,vn as di,vr as fi,vt as pi,w as mi,wi as hi,wn as gi,wr as _i,wt as vi,x as yi,xi as bi,xn as xi,xr as Si,xt as Ci,y as wi,yi as Ti,yn as Ei,yr as Di,yt as Oi,z as ki,zi as Ai,zn as ji,zr as Mi,zt as Ni}from"./dist-BE7wFbsP.mjs";export{Zr as AGENT_ID_MAX_LEN,yr as AGENT_ID_RE,Br as AGENT_WRITE_ORIGIN,qn as AgentFocusBroadcaster,on as AgentPresenceBroadcaster,Tr as AgentSessionCapacityError,Kr as AgentSessionManager,_n as AutoStartDisabledError,lr as BUNDLE_IDS,ri as BUNDLE_SCOPE,Sn as BUNDLE_SKILL_NAME,Mn as BacklinkIndex,Ar as CC1Broadcaster,t as CC1_CONTRACT_VERSION,mr as CONFIG_FILENAME,Hn as CONFLICT_MARKER_RE,Ln as CURSOR_BUNDLE_PATHS_BY_PLATFORM,$t as ConfigSchema,ci as DEFAULT_CHECKPOINT_RETENTION,wi as DEFAULT_EMBEDDINGS_DIMENSIONS,fn as DEFAULT_PACK_ID,yi as EMBEDDINGS_API_KEY_ENV,pt as FILE_SYSTEM_WRITER,V as FILE_WATCHER_ORIGIN,mi as FileEmbeddingsBackend,vt as GIT_PREFLIGHT_FAIL_SPAN_NAME,Z as GIT_UPSTREAM_WRITER,en as GitDirAccessError,K as GitNotAvailableError,qe as GitTooOldError,ir as HOCUSPOCUS_AUTH_REJECTION_REASONS,j as HocuspocusAuthRejection,$n as HocuspocusAuthTokenSchema,Le as INSTALLED_AGENTS_SCHEMES,r as LINEAGE_EPOCH_KEY,He as LIVE_DERIVED_INDEX_DEBOUNCE_MS,Qe as LOG_MD_TEMPLATE,ne as MANAGED_RENAME_ORIGIN,_e as MAX_AGENT_SESSIONS,Me as MCP_CONNECTION_ID_HEADER,C as MCP_SERVER_NAME,ct as MIN_GIT_VERSION,ki as MISSING_OK_CONFIG_MESSAGE,li as MalformedGitPointerError,I as McpLogger,Ot as MissingOkConfigError,fe as OBSERVER_SYNC_ORIGIN,Ct as OK_OKIGNORE_TEMPLATE,v as ORPHAN_MODES,Nt as PANE_TARGET_TTL_MS,s as PROTOCOL_VERSION,se as PinoLogger,S as ProcessLockCollisionError,De as ProjectGitInitError,Fr as ROLLBACK_ORIGIN,Se as ROOT_GITIGNORE_TEMPLATE,g as RUNTIME_VERSION,Ut as SERVICE_WRITER,Rt as SKILL_INSTALL_EVENTS_FILE_REL,T as SKILL_STATE_TARGETS,Jt as STARTER_FOLDERS,rt as STARTER_FOLDER_FRONTMATTER_FILENAME,E as STARTER_PACKS,jn as STARTER_PACK_IDS,ni as STARTER_TEMPLATES,wr as STATE_MANIFEST_FILENAME,b as STATE_SCHEMA_VERSION,p as SYSTEM_DOC_NAME,Gr as SeedPrerequisiteError,Qn as SeedRootDirError,d as ServerLockCollisionError,dn as SingleFileNotAFileError,kr as SingleFileNotFoundError,Xr as SingleFileNotMarkdownError,xn as StateManifestError,pr as TagIndex,si as USER_GLOBAL_BUNDLE_IDS,En as UiLockCollisionError,In as __getShowAllWalkStatsForTesting,Pr as __resetShowAllWalkStatsForTesting,i as acquireProcessLock,_ as acquireServerLock,vr as acquireUiLock,Kn as applyAgentMarkdownWrite,Vn as applyExternalChange,an as applySeed,pi as armPaneTarget,Oi as assertCompatibleStateManifest,gn as assertGitAvailable,Ci as assertNeverDiskEvent,_t as attachIdleShutdown,G as bootServer,vi as buildAndOpenSkill,St as buildConfigYmlContent,te as buildExecResult,X as buildSkillZip,Ze as buildStarterFolderFrontmatterYaml,cr as buildWipTree,F as bundleSkillMdPath,rr as classifyEvents,Ve as classifyFsPath,Ke as clearArmedPaneTarget,nt as clearContributors,oe as clearEmbeddingsKeyFromAllBackends,xe as coercePackId,f as colorFromSeed,Ie as commitUpstreamImport,ft as commitWip,Ni as commitWipFromTree,B as compareSemver,Mt as containsConflictMarkers,ge as contentHash,Dt as contributorCount,Lt as countShadowObjects,de as countStaleAgentWipRefs,je as countWipRefs,zr as createApiExtension,Ee as createAssetServeMiddleware,qt as createContentFilter,Ht as createContentFilterAsync,Qt as createEmbeddingsSecretStore,st as createEphemeralProjectDir,A as createExternalChangeHandler,kn as createFileLogger,ei as createLiveDerivedIndexExtension,Sr as createMcpHttpHandler,Ur as createOsProbe,Xn as createPersistenceExtension,ln as createServer,Dr as createServerObserverExtension,Jr as createStreamingErrorWriter,yn as createTestLogger,dr as describeStoredEmbeddingsKey,ai as detectClaudeDesktopPresence,wn as detectGit,Pn as detectProjectShape,Mr as discoverLockDirs,gr as emitPreflightFailureSpan,Wn as encodeDocName,zn as encodeFolderRoute,nn as encodeSkillRoute,di as ensureProjectGit,Ei as errorResponse,mn as evictStaleTrackerEntries,xi as extractOkBinaryPath,ht as extractWikiLinksFromMarkdown,U as fallbackPaths,gi as findEnclosingGitRoot,bt as findEnclosingProjectRoot,$ as flushFileLogger,J as formatAuthRejectionWire,Ye as formatContributors,or as formatContributorsFrom,N as formatPackRationale,tr as gcCheckpointRefs,ze as getCurrentMcpLogger,We as getLocalDir,et as getLogFilePath,ie as getLogger,ye as getLogsDir,Pe as getMeter,ut as getMetrics,ji as getTracer,R as handleCollabSocketError,At as handleSpawnCursor,me as hasGcLogLatch,n as iconFromClientName,Tt as incrementCollabSocketFilteredError,Ft as incrementServerObserverFire,le as initContent,ke as initShadowRepo,Lr as initTelemetry,we as initToleranceTelemetryWriter,Gt as installPrettyZodErrors,Bt as installTestLoggers,Xt as installUserSkill,at as isAllowedApiOrigin,O as isAllowedWorkspaceHostHeader,An as isConfigDoc,ti as isHocuspocusAuthRejectionReason,Cr as isKnownPackId,Wr as isLinkIndexExcludedDoc,Zn as isLoopbackAddress,un as isManagedArtifactDoc,e as isOrphanMode,Or as isPairedWriteOrigin,Yr as isPathWithinDir,x as isProcessAlive,bn as isProjectRoot,fr as isProjectSkillManaged,oi as isReservedForUserTree,Tn as isSelfWrite,Fn as isSystemDoc,Nr as isToleranceTelemetryEnabled,a as isValidLockPid,_r as lastKnownHash,Gn as listRescueCheckpoints,Bn as listStarterPacks,rn as loadPrincipal,m as lockFilePath,fi as loggerFactory,Di as logsCurrentPath,hn as logsPreviousPath,Si as makeLazyEmbeddingsKeyStore,gt as mountMcpAndApi,W as normalizeFsPath,_i as packageVersionMajorMinor,xt as parseAuthRejectionWire,ee as parseGitVersion,Y as parseHocuspocusAuthToken,Xe as parseKeepaliveConnectionId,sr as pathToDocName,P as planSeed,nr as prepareSingleFileOpen,Be as processCommand,Ge as processUsage,tt as readAllTargets,ae as readArmedPaneTarget,be as readBranchFromHead,w as readProcessLock,o as readProcessLockDetailed,Fe as readProjectLocalSemanticConfig,c as readServerLock,dt as readServerPackageVersion,Mi as readSkillInstallStateSnapshot,z as readSkillManagement,jt as readStateManifest,he as readTargetRecordedAt,Et as readTargetVersion,It as readUiLock,ue as reconcile,Ae as recordContributor,Rr as recordSkillInstallEvent,Te as registerAllTools,Kt as registerWrite,y as releaseProcessLock,h as releaseServerLock,Vt as releaseUiLock,Zt as removeLastKnownHash,ot as resetMetrics,k as resolveBundledSkillDir,On as resolveContentDir,$r as resolveCursorBinaryDefault,xr as resolveCursorSpawnInvocation,Hr as resolveLockDir,Yn as resolvePack,cn as resolvePackageVersion,Er as resolveUiInfo,qr as restoreContributors,vn as restoreLifecycleFromConflictsJson,ur as rewriteMarkdownLinksForDocumentRename,ii as rewriteWikiLinksForDocumentRename,Cn as runAuthReposSubprocess,Nn as runAuthStatusSubprocess,jr as runCloneSubprocess,hr as runDeviceFlowSubprocess,Un as runWithMcpLogger,Rn as safeContentPath,tn as safeSubdir,ui as safetyCheckpoint,Ti as sanitizeClientName,pn as saveInMemoryCheckpoint,bi as saveVersion,mt as seedBasenameIndex,H as serializeError,hi as setActiveSpanAttributes,yt as shadowGit,Q as shutdownTelemetry,q as skillManagementPath,Je as spansCurrentPath,ar as spansPreviousPath,M as spawnDetached,er as splitMarkdownBlocks,Re as startWatcher,Ue as streamingProblemEvent,$e as swapContributors,re as teardownToleranceTelemetryWriter,ve as toBroadcasterKey,Ne as tracedAppendFileSync,lt as tracedLinkSync,Ai as tracedMkdir,L as tracedMkdirSync,kt as tracedRename,pe as tracedRenameSync,wt as tracedRmSync,Pt as tracedRmdirSync,ce as tracedUnlinkSync,Oe as tracedWriteFile,Ir as tracedWriteFileSync,Ce as updateLastKnownHash,u as updateProcessLockPort,l as updateServerLockPort,Wt as updateUiLockPort,zt as validateAgentId,Yt as validateCloneInputs,it as validateSkillZip,D as withSpan,Dn as withSpanSync,Qr as writeRootGitignoreForNewRepo,br as writeSkillManagement,Vr as writeStateManifest,Jn as writeTargetVersion,sn as writeTracker};
|
|
1
|
+
import{Fi as e,J as t,Oi as n,Vt as r,a as i,c as a,d as o,dn as s,f as c,g as l,h as u,i as d,ii as f,kn as p,l as m,m as h,n as g,o as _,on as v,p as y,r as b,s as x,t as S,tn as C,u as w,wn as T}from"./server-lock-CN2YHwpP-CIPpd1-K.mjs";import{$ as E,$i as D,$n as O,$r as k,$t as A,A as j,Ai as M,An as N,Ar as P,At as F,B as I,Bi as L,Bn as R,Br as z,Bt as B,C as V,Ci as H,Cn as U,Cr as W,Ct as G,D as K,Di as q,Dn as J,Dr as Y,Dt as X,E as Z,Ei as Q,En as $,Er as ee,Et as te,F as ne,Fi as re,Fn as ie,Fr as ae,Ft as oe,G as se,Gi as ce,Gn as le,Gr as ue,Gt as de,H as fe,Hi as pe,Hn as me,Hr as he,Ht as ge,I as _e,Ii as ve,In as ye,Ir as be,It as xe,J as Se,Ji as Ce,Jn as we,Jr as Te,Jt as Ee,K as De,Ki as Oe,Kn as ke,Kr as Ae,Kt as je,L as Me,Li as Ne,Ln as Pe,Lr as Fe,Lt as Ie,M as Le,Mi as Re,Mn as ze,Mr as Be,Mt as Ve,N as He,Ni as Ue,Nn as We,Nr as Ge,Nt as Ke,O as qe,Oi as Je,On as Ye,Or as Xe,Ot as Ze,P as Qe,Pi as $e,Pn as et,Pr as tt,Pt as nt,Q as rt,Qi as it,Qn as at,Qr as ot,Qt as st,R as ct,Ri as lt,Rn as ut,Rr as dt,Rt as ft,S as pt,Si as mt,Sn as ht,Sr as gt,St as _t,T as vt,Ti as yt,Tn as bt,Tr as xt,Tt as St,U as Ct,Ui as wt,Un as Tt,Ur as Et,Ut as Dt,V as Ot,Vi as kt,Vn as At,Vr as jt,Vt as Mt,W as Nt,Wi as Pt,Wn as Ft,Wr as It,Wt as Lt,X as Rt,Xi as zt,Xn as Bt,Xr as Vt,Xt as Ht,Y as Ut,Yi as Wt,Yn as Gt,Yr as Kt,Yt as qt,Z as Jt,Zi as Yt,Zn as Xt,Zr as Zt,Zt as Qt,_ as $t,_a as en,_i as tn,_n as nn,_r as rn,_t as an,a as on,aa as sn,ai as cn,an as ln,ar as un,at as dn,b as fn,bi as pn,bn as mn,br as hn,bt as gn,c as _n,ci as vn,cn as yn,cr as bn,ct as xn,d as Sn,di as Cn,dn as wn,dr as Tn,dt as En,ea as Dn,ei as On,en as kn,er as An,et as jn,f as Mn,fi as Nn,fn as Pn,fr as Fn,ft as In,g as Ln,gi as Rn,gn as zn,gr as Bn,gt as Vn,h as Hn,hi as Un,hn as Wn,hr as Gn,ht as Kn,i as qn,ia as Jn,ii as Yn,in as Xn,ir as Zn,it as Qn,j as $n,ji as er,jn as tr,jr as nr,jt as rr,k as ir,ki as ar,kn as or,kr as sr,kt as cr,l as lr,li as ur,ln as dr,lr as fr,lt as pr,m as mr,mi as hr,mn as gr,mr as _r,mt as vr,n as yr,na as br,ni as xr,nn as Sr,nr as Cr,nt as wr,o as Tr,oi as Er,on as Dr,or as Or,ot as kr,p as Ar,pi as jr,pn as Mr,pr as Nr,pt as Pr,q as Fr,qi as Ir,qn as Lr,qr as Rr,qt as zr,r as Br,ra as Vr,ri as Hr,rn as Ur,rr as Wr,rt as Gr,s as Kr,si as qr,sn as Jr,sr as Yr,st as Xr,t as Zr,ta as Qr,ti as $r,tn as ei,tr as ti,tt as ni,u as ri,ui as ii,un as ai,ur as oi,ut as si,v as ci,va as li,vi as ui,vn as di,vr as fi,vt as pi,w as mi,wi as hi,wn as gi,wr as _i,wt as vi,x as yi,xi as bi,xn as xi,xr as Si,xt as Ci,y as wi,yi as Ti,yn as Ei,yr as Di,yt as Oi,z as ki,zi as Ai,zn as ji,zr as Mi,zt as Ni}from"./dist-CwoT-vvz.mjs";export{Zr as AGENT_ID_MAX_LEN,yr as AGENT_ID_RE,Br as AGENT_WRITE_ORIGIN,qn as AgentFocusBroadcaster,on as AgentPresenceBroadcaster,Tr as AgentSessionCapacityError,Kr as AgentSessionManager,_n as AutoStartDisabledError,lr as BUNDLE_IDS,ri as BUNDLE_SCOPE,Sn as BUNDLE_SKILL_NAME,Mn as BacklinkIndex,Ar as CC1Broadcaster,t as CC1_CONTRACT_VERSION,mr as CONFIG_FILENAME,Hn as CONFLICT_MARKER_RE,Ln as CURSOR_BUNDLE_PATHS_BY_PLATFORM,$t as ConfigSchema,ci as DEFAULT_CHECKPOINT_RETENTION,wi as DEFAULT_EMBEDDINGS_DIMENSIONS,fn as DEFAULT_PACK_ID,yi as EMBEDDINGS_API_KEY_ENV,pt as FILE_SYSTEM_WRITER,V as FILE_WATCHER_ORIGIN,mi as FileEmbeddingsBackend,vt as GIT_PREFLIGHT_FAIL_SPAN_NAME,Z as GIT_UPSTREAM_WRITER,en as GitDirAccessError,K as GitNotAvailableError,qe as GitTooOldError,ir as HOCUSPOCUS_AUTH_REJECTION_REASONS,j as HocuspocusAuthRejection,$n as HocuspocusAuthTokenSchema,Le as INSTALLED_AGENTS_SCHEMES,r as LINEAGE_EPOCH_KEY,He as LIVE_DERIVED_INDEX_DEBOUNCE_MS,Qe as LOG_MD_TEMPLATE,ne as MANAGED_RENAME_ORIGIN,_e as MAX_AGENT_SESSIONS,Me as MCP_CONNECTION_ID_HEADER,C as MCP_SERVER_NAME,ct as MIN_GIT_VERSION,ki as MISSING_OK_CONFIG_MESSAGE,li as MalformedGitPointerError,I as McpLogger,Ot as MissingOkConfigError,fe as OBSERVER_SYNC_ORIGIN,Ct as OK_OKIGNORE_TEMPLATE,v as ORPHAN_MODES,Nt as PANE_TARGET_TTL_MS,s as PROTOCOL_VERSION,se as PinoLogger,S as ProcessLockCollisionError,De as ProjectGitInitError,Fr as ROLLBACK_ORIGIN,Se as ROOT_GITIGNORE_TEMPLATE,g as RUNTIME_VERSION,Ut as SERVICE_WRITER,Rt as SKILL_INSTALL_EVENTS_FILE_REL,T as SKILL_STATE_TARGETS,Jt as STARTER_FOLDERS,rt as STARTER_FOLDER_FRONTMATTER_FILENAME,E as STARTER_PACKS,jn as STARTER_PACK_IDS,ni as STARTER_TEMPLATES,wr as STATE_MANIFEST_FILENAME,b as STATE_SCHEMA_VERSION,p as SYSTEM_DOC_NAME,Gr as SeedPrerequisiteError,Qn as SeedRootDirError,d as ServerLockCollisionError,dn as SingleFileNotAFileError,kr as SingleFileNotFoundError,Xr as SingleFileNotMarkdownError,xn as StateManifestError,pr as TagIndex,si as USER_GLOBAL_BUNDLE_IDS,En as UiLockCollisionError,In as __getShowAllWalkStatsForTesting,Pr as __resetShowAllWalkStatsForTesting,i as acquireProcessLock,_ as acquireServerLock,vr as acquireUiLock,Kn as applyAgentMarkdownWrite,Vn as applyExternalChange,an as applySeed,pi as armPaneTarget,Oi as assertCompatibleStateManifest,gn as assertGitAvailable,Ci as assertNeverDiskEvent,_t as attachIdleShutdown,G as bootServer,vi as buildAndOpenSkill,St as buildConfigYmlContent,te as buildExecResult,X as buildSkillZip,Ze as buildStarterFolderFrontmatterYaml,cr as buildWipTree,F as bundleSkillMdPath,rr as classifyEvents,Ve as classifyFsPath,Ke as clearArmedPaneTarget,nt as clearContributors,oe as clearEmbeddingsKeyFromAllBackends,xe as coercePackId,f as colorFromSeed,Ie as commitUpstreamImport,ft as commitWip,Ni as commitWipFromTree,B as compareSemver,Mt as containsConflictMarkers,ge as contentHash,Dt as contributorCount,Lt as countShadowObjects,de as countStaleAgentWipRefs,je as countWipRefs,zr as createApiExtension,Ee as createAssetServeMiddleware,qt as createContentFilter,Ht as createContentFilterAsync,Qt as createEmbeddingsSecretStore,st as createEphemeralProjectDir,A as createExternalChangeHandler,kn as createFileLogger,ei as createLiveDerivedIndexExtension,Sr as createMcpHttpHandler,Ur as createOsProbe,Xn as createPersistenceExtension,ln as createServer,Dr as createServerObserverExtension,Jr as createStreamingErrorWriter,yn as createTestLogger,dr as describeStoredEmbeddingsKey,ai as detectClaudeDesktopPresence,wn as detectGit,Pn as detectProjectShape,Mr as discoverLockDirs,gr as emitPreflightFailureSpan,Wn as encodeDocName,zn as encodeFolderRoute,nn as encodeSkillRoute,di as ensureProjectGit,Ei as errorResponse,mn as evictStaleTrackerEntries,xi as extractOkBinaryPath,ht as extractWikiLinksFromMarkdown,U as fallbackPaths,gi as findEnclosingGitRoot,bt as findEnclosingProjectRoot,$ as flushFileLogger,J as formatAuthRejectionWire,Ye as formatContributors,or as formatContributorsFrom,N as formatPackRationale,tr as gcCheckpointRefs,ze as getCurrentMcpLogger,We as getLocalDir,et as getLogFilePath,ie as getLogger,ye as getLogsDir,Pe as getMeter,ut as getMetrics,ji as getTracer,R as handleCollabSocketError,At as handleSpawnCursor,me as hasGcLogLatch,n as iconFromClientName,Tt as incrementCollabSocketFilteredError,Ft as incrementServerObserverFire,le as initContent,ke as initShadowRepo,Lr as initTelemetry,we as initToleranceTelemetryWriter,Gt as installPrettyZodErrors,Bt as installTestLoggers,Xt as installUserSkill,at as isAllowedApiOrigin,O as isAllowedWorkspaceHostHeader,An as isConfigDoc,ti as isHocuspocusAuthRejectionReason,Cr as isKnownPackId,Wr as isLinkIndexExcludedDoc,Zn as isLoopbackAddress,un as isManagedArtifactDoc,e as isOrphanMode,Or as isPairedWriteOrigin,Yr as isPathWithinDir,x as isProcessAlive,bn as isProjectRoot,fr as isProjectSkillManaged,oi as isReservedForUserTree,Tn as isSelfWrite,Fn as isSystemDoc,Nr as isToleranceTelemetryEnabled,a as isValidLockPid,_r as lastKnownHash,Gn as listRescueCheckpoints,Bn as listStarterPacks,rn as loadPrincipal,m as lockFilePath,fi as loggerFactory,Di as logsCurrentPath,hn as logsPreviousPath,Si as makeLazyEmbeddingsKeyStore,gt as mountMcpAndApi,W as normalizeFsPath,_i as packageVersionMajorMinor,xt as parseAuthRejectionWire,ee as parseGitVersion,Y as parseHocuspocusAuthToken,Xe as parseKeepaliveConnectionId,sr as pathToDocName,P as planSeed,nr as prepareSingleFileOpen,Be as processCommand,Ge as processUsage,tt as readAllTargets,ae as readArmedPaneTarget,be as readBranchFromHead,w as readProcessLock,o as readProcessLockDetailed,Fe as readProjectLocalSemanticConfig,c as readServerLock,dt as readServerPackageVersion,Mi as readSkillInstallStateSnapshot,z as readSkillManagement,jt as readStateManifest,he as readTargetRecordedAt,Et as readTargetVersion,It as readUiLock,ue as reconcile,Ae as recordContributor,Rr as recordSkillInstallEvent,Te as registerAllTools,Kt as registerWrite,y as releaseProcessLock,h as releaseServerLock,Vt as releaseUiLock,Zt as removeLastKnownHash,ot as resetMetrics,k as resolveBundledSkillDir,On as resolveContentDir,$r as resolveCursorBinaryDefault,xr as resolveCursorSpawnInvocation,Hr as resolveLockDir,Yn as resolvePack,cn as resolvePackageVersion,Er as resolveUiInfo,qr as restoreContributors,vn as restoreLifecycleFromConflictsJson,ur as rewriteMarkdownLinksForDocumentRename,ii as rewriteWikiLinksForDocumentRename,Cn as runAuthReposSubprocess,Nn as runAuthStatusSubprocess,jr as runCloneSubprocess,hr as runDeviceFlowSubprocess,Un as runWithMcpLogger,Rn as safeContentPath,tn as safeSubdir,ui as safetyCheckpoint,Ti as sanitizeClientName,pn as saveInMemoryCheckpoint,bi as saveVersion,mt as seedBasenameIndex,H as serializeError,hi as setActiveSpanAttributes,yt as shadowGit,Q as shutdownTelemetry,q as skillManagementPath,Je as spansCurrentPath,ar as spansPreviousPath,M as spawnDetached,er as splitMarkdownBlocks,Re as startWatcher,Ue as streamingProblemEvent,$e as swapContributors,re as teardownToleranceTelemetryWriter,ve as toBroadcasterKey,Ne as tracedAppendFileSync,lt as tracedLinkSync,Ai as tracedMkdir,L as tracedMkdirSync,kt as tracedRename,pe as tracedRenameSync,wt as tracedRmSync,Pt as tracedRmdirSync,ce as tracedUnlinkSync,Oe as tracedWriteFile,Ir as tracedWriteFileSync,Ce as updateLastKnownHash,u as updateProcessLockPort,l as updateServerLockPort,Wt as updateUiLockPort,zt as validateAgentId,Yt as validateCloneInputs,it as validateSkillZip,D as withSpan,Dn as withSpanSync,Qr as writeRootGitignoreForNewRepo,br as writeSkillManagement,Vr as writeStateManifest,Jn as writeTargetVersion,sn as writeTracker};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{Fo as e}from"./server-lock-CN2YHwpP-
|
|
1
|
+
import{Fo as e}from"./server-lock-CN2YHwpP-CIPpd1-K.mjs";import{execFileSync as t}from"node:child_process";import{dirname as n,join as r}from"node:path";import{existsSync as i,mkdirSync as a,readFileSync as o,writeFileSync as s}from"node:fs";import{homedir as c}from"node:os";var l=e();const u=`open-knowledge`;function d(e){try{e()}catch{}}var f=class{backend=`keyring`;constructor(e){this.onKeychainRead=e}async get(e){let{Entry:t}=await import(`@napi-rs/keyring`),n;try{n=new t(u,e).getPassword()}catch(t){return d(()=>this.onKeychainRead?.({kind:`read-error`,host:e,error:t instanceof Error?t.name:`unknown`})),null}if(n==null)return d(()=>this.onKeychainRead?.({kind:`absent`,host:e})),null;try{return JSON.parse(n)}catch{return d(()=>this.onKeychainRead?.({kind:`corrupt-entry`,host:e,error:`corrupt-entry`})),null}}async set(e,t,n,r){let{Entry:i}=await import(`@napi-rs/keyring`),a=new i(u,e),o={login:t,token:n,...r};a.setPassword(JSON.stringify(o))}async clear(e){let{Entry:t}=await import(`@napi-rs/keyring`);try{new t(u,e).deletePassword()}catch{}}},p=class{backend=`file`;authFile;constructor(e){this.authFile=e??r(c(),`.ok`,`auth.yml`)}read(){if(!i(this.authFile))return{};try{return(0,l.parse)(o(this.authFile,`utf-8`))??{}}catch(e){let t=e instanceof Error?e.message:`unknown error`;return process.stderr.write(`[auth] Failed to parse ${this.authFile}: ${t}. Starting with empty credentials.\n`),{}}}write(e){let t=n(this.authFile);i(t)||a(t,{recursive:!0,mode:448}),s(this.authFile,(0,l.stringify)(e),{mode:384})}async get(e){return this.read()[e]??null}async set(e,t,n,r){let i=this.read();i[e]={login:t,token:n,...r},this.write(i)}async clear(e){let t=this.read();delete t[e],this.write(t)}},m=class{backend=`keyring`;constructor(e,t){this.keychain=e,this.file=t}async get(e){let t=await this.keychain.get(e);if(t!=null)return t;let n=await this.file.get(e);if(n==null)return null;try{await this.keychain.set(e,n.login,n.token,{gitProtocol:n.gitProtocol,name:n.name,email:n.email}),await this.file.clear(e),process.stderr.write(`[auth] migrated ${e} credential from ~/.ok/auth.yml to the OS keychain\n`)}catch{}return n}set(e,t,n,r){return this.keychain.set(e,t,n,r)}async clear(e){await this.keychain.clear(e),await this.file.get(e)!=null&&await this.file.clear(e)}};async function h(e,t){try{let{Entry:n}=await import(`@napi-rs/keyring`);return new n(u,`__probe__`),process.stderr.write(`[auth] token storage: OS keychain
|
|
2
2
|
`),d(()=>t?.onBackendSelected?.({backend:`keyring`})),new m(new f(t?.onKeychainRead),new p(e))}catch(n){let r=n instanceof Error?`${n.name}: ${n.message}`:String(n);return process.stderr.write(`[auth] token storage: file (~/.ok/auth.yml) — OS keychain unavailable: ${r}\n`),d(()=>t?.onBackendSelected?.({backend:`file`,reason:r})),new p(e)}}function g(e){let t=null;return function(){if(t)return t;let n=2e3;return t=(async()=>{let t=null,r=new Promise(r=>{t=setTimeout(()=>{process.stderr.write(`[auth] token storage: keyring init exceeded ${n}ms; falling back to file (~/.ok/auth.yml)\n`),r(new p(e))},n)});try{return await Promise.race([h(e),r])}catch{return new p(e)}finally{t!==null&&clearTimeout(t)}})(),t}}function _(e){let t=g(e);return{async get(e){let n=await(await t()).get(e);return n===null?null:{token:n.token}}}}function v(e){let t=g(e);return{backend:`file`,async get(e){return(await t()).get(e)},async set(e,n,r,i){return(await t()).set(e,n,r,i)},async clear(e){return(await t()).clear(e)}}}async function y(e,t){let n=[],r=new p(t);await r.get(e)!=null&&(await r.clear(e),n.push(`file`));try{let{Entry:t}=await import(`@napi-rs/keyring`);new t(u,`__probe__`);let r=new f;await r.get(e)!=null&&(await r.clear(e),n.push(`keychain`))}catch{}return{touched:n}}const b=[`/opt/homebrew/bin/gh`,`/usr/local/bin/gh`,`/opt/local/bin/gh`,`/snap/bin/gh`,`/usr/bin/gh`];function x(e,n={}){let r=n._exec??t,a=n._fileExists??i,o=[`auth`,`token`,...e?[`--hostname`,e]:[]],s=[`gh`,...b.filter(a)];for(let e of s)try{let t=r(e,o,{encoding:`utf-8`,stdio:[`ignore`,`pipe`,`pipe`],timeout:5e3}).toString().trim();if(t.length>0)return{available:!0,token:t}}catch{}return{available:!1}}export{v as a,_ as i,y as n,h as r,x as t};
|
|
3
|
-
//# sourceMappingURL=gh-detect-
|
|
3
|
+
//# sourceMappingURL=gh-detect-C_OoX4ZE.mjs.map
|
package/dist/index.d.mts
CHANGED
|
@@ -69,6 +69,8 @@ interface EditorMcpTarget {
|
|
|
69
69
|
configPath: (cwd: string, home?: string) => string;
|
|
70
70
|
format: 'json' | 'toml';
|
|
71
71
|
topLevelKey: 'mcpServers' | 'servers' | 'mcp_servers' | 'mcp';
|
|
72
|
+
serverMapSubKey?: string;
|
|
73
|
+
offerOnlyWhenDetected?: boolean;
|
|
72
74
|
serverName: (cwd: string) => string;
|
|
73
75
|
buildEntry: (cwd: string, options?: McpInstallOptions) => Record<string, unknown>;
|
|
74
76
|
scope: 'project' | 'global';
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,r as t,t as n}from"./gh-detect-
|
|
1
|
+
import{i as e,r as t,t as n}from"./gh-detect-C_OoX4ZE.mjs";import{C as r,D as i,E as a,O as o,S as s,T as c,a as l,b as u,c as d,i as f,k as p,l as m,n as h,p as g,v as _,w as v,y}from"./init-BFySg4cK.mjs";import{d as b,f as x,i as S,l as C,n as w,r as T,t as E,u as D}from"./src-BGnLjdLF.mjs";import{a as O,c as k,l as A,o as j,r as M,s as N,t as P,u as F}from"./write-project-skill-Ta2BaP1w.mjs";import{n as I}from"./loader-kYfLQbUq.mjs";import{n as L}from"./preview-DcLHmjqA.mjs";import{n as R,t as z}from"./mcp-migrate-event-D0NrGjvc.mjs";export{M as ALL_EDITOR_IDS,O as EDITOR_LABELS,j as EDITOR_TARGETS,N as HOSTS_WITH_USER_SKILL_DIR,h as LAUNCH_CONFIG_NAME,f as LAUNCH_UI_CHAIN_SENTINEL,l as LAUNCH_UI_CHAIN_V1,r as addOkPathsToGitExclude,P as assertProjectPathSafe,k as buildManagedServerEntry,T as buildMcpConfigDeclineEvent,z as buildMcpConfigMigrateEvent,d as classifyExistingMcpEntry,t as createTokenStore,n as detectGh,m as detectInstalledEditors,v as formatTrackedRemediation,c as getExcludedOkPaths,a as getOkArtifactPaths,A as isEntryUpToDate,F as isOwnManagedEntry,I as loadConfig,e as makeLazyProbeTokenStore,C as parseGitHubBlobUrl,D as parseGitHubShareUrl,b as parseGitHubTreeUrl,x as parseGitUrl,L as previewContent,i as probeTrackedOkPaths,g as readExistingMcpEntry,o as readSharingMode,p as removeOkPathsFromGitExclude,s as resolveProjectRoot,S as runStop,_ as scaffoldLaunchJson,R as truncatePriorEntry,w as validateLocalFolderForShare,y as writeEditorMcpConfig,E as writeProjectAiIntegrations,u as writeUserMcpConfigs};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,s as t,t as n}from"./chunk-C94x7I9S.mjs";import{r,t as i}from"./esm-BLMtE3s6.mjs";import{Aa as a,Hi as o,It as s,St as c,fi as l,hn as u,ja as d,xa as f}from"./server-lock-CN2YHwpP-DwE4XXIS.mjs";import{$n as p,D as m,Gn as h,K as g,O as _,Qn as v,Zn as y,ba as b,cr as x,fa as S,ha as C,ir as w,ta as T,vn as ee}from"./dist-BE7wFbsP.mjs";import{t as te}from"./constants-DgQvDmlF.mjs";import{d as ne,f as E,n as re,o as D,r as ie,t as O}from"./write-project-skill-0Z8n-AaN.mjs";import{t as k}from"./is-object-Cg453afR.mjs";import{i as A,o as j,r as ae,s as M,t as N}from"./colors-8SzMRIVy.mjs";import{t as oe}from"./preview-C6whX7rn.mjs";import{createRequire as P}from"node:module";import{execFileSync as se}from"node:child_process";import ce,{dirname as F,isAbsolute as le,join as I,relative as L,resolve as ue,sep as de}from"node:path";import{existsSync as R,lstatSync as fe,mkdirSync as pe,readFileSync as z,readlinkSync as me,realpathSync as he,statSync as ge,writeFileSync as _e}from"node:fs";import B from"node:process";import{homedir as ve}from"node:os";import{fileURLToPath as ye}from"node:url";import{randomUUID as be}from"node:crypto";import{inspect as xe,stripVTControlCharacters as Se,styleText as V}from"node:util";import{AsyncLocalStorage as Ce,AsyncResource as we}from"node:async_hooks";import{createServer as Te,request as Ee}from"node:http";import*as De from"node:readline";import{connect as Oe}from"node:net";const ke=new Set([`emacs`,`vim`]);function Ae(e){return ke.has(e)}function je(){let e=process.env.INQUIRER_KEYBINDINGS;return e?Array.from(new Set(e.toLowerCase().split(/[\s,]+/).filter(Ae))):[]}const H=(e,t=[])=>e.name===`up`||t.includes(`vim`)&&e.name===`k`||t.includes(`emacs`)&&e.ctrl&&e.name===`p`,Me=(e,t=[])=>e.name===`down`||t.includes(`vim`)&&e.name===`j`||t.includes(`emacs`)&&e.ctrl&&e.name===`n`,Ne=e=>e.name===`space`,Pe=e=>e.name===`backspace`,Fe=e=>`1234567890`.includes(e.name),Ie=e=>e.name===`enter`||e.name===`return`;var Le=class extends Error{name=`AbortPromptError`;message=`Prompt was aborted`;constructor(e){super(),this.cause=e?.cause}},Re=class extends Error{name=`CancelPromptError`;message=`Prompt was canceled`},ze=class extends Error{name=`ExitPromptError`},Be=class extends Error{name=`HookError`},Ve=class extends Error{name=`ValidationError`};const He=new Ce;function Ue(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function We(e,t){let n=Ue(e);return He.run(n,()=>{function e(e){n.handleChange=()=>{n.index=0,e()},n.handleChange()}return t(e)})}function U(){let e=He.getStore();if(!e)throw new Be(`[Inquirer] Hook functions can only be called from within a prompt`);return e}function Ge(){return U().rl}function Ke(e){return we.bind((...t)=>{let n=U(),r=!1,i=n.handleChange;n.handleChange=()=>{r=!0};let a=e(...t);return r&&i(),n.handleChange=i,a})}function qe(e){let t=U(),{index:n}=t,r=e({get(){return t.hooks[n]},set(e){t.hooks[n]=e},initialized:n in t.hooks});return t.index++,r}function Je(){U().handleChange()}const Ye={queue(e){let t=U(),{index:n}=t;t.hooksEffect.push(()=>{t.hooksCleanup[n]?.();let r=e(Ge());if(r!=null&&typeof r!=`function`)throw new Ve(`useEffect return value must be a cleanup function or nothing.`);t.hooksCleanup[n]=r})},run(){let e=U();Ke(()=>{e.hooksEffect.forEach(e=>{e()}),e.hooksEffect.length=0})()},clearAll(){let e=U();e.hooksCleanup.forEach(e=>{e?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function Xe(e){return typeof e==`function`}function W(e){return qe(t=>{let n=we.bind(function(e){t.get()!==e&&(t.set(e),Je())});if(t.initialized)return[t.get(),n];let r=Xe(e)?e():e;return t.set(r),[r,n]})}function Ze(e,t){qe(n=>{let r=n.get();(!Array.isArray(r)||t.some((e,t)=>!Object.is(e,r[t])))&&Ye.queue(e),n.set(t)})}function Qe(){return B.platform.startsWith(`win`)?!!B.env.CI||!!B.env.WT_SESSION||!!B.env.TERMINUS_SUBLIME||B.env.ConEmuTask===`{cmd::Cmder}`||B.env.TERM_PROGRAM===`Terminus-Sublime`||B.env.TERM_PROGRAM===`vscode`||B.env.TERM===`xterm-256color`||B.env.TERM===`alacritty`||B.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:B.env.TERM!==`linux`}const $e={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:`╱`},et={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:`⅒`},tt={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`},nt={...$e,...et},rt={...$e,...tt},G=Qe()?nt:rt;Object.entries(et);const it={prefix:{idle:V(`blue`,`?`),done:V(`green`,G.tick)},spinner:{interval:80,frames:[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`].map(e=>V(`yellow`,e))},keybindings:[],style:{answer:e=>V(`cyan`,e),message:e=>V(`bold`,e),error:e=>V(`red`,`> ${e}`),defaultAnswer:e=>V(`dim`,`(${e})`),help:e=>V(`dim`,e),highlight:e=>V(`cyan`,e),key:e=>V(`cyan`,V(`bold`,`<${e}>`))}};function at(){return{...it,keybindings:je()}}function ot(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function st(...e){let t={};for(let n of e)for(let[e,r]of Object.entries(n)){let n=t[e];t[e]=ot(n)&&ot(r)?st(n,r):r}return t}function ct(...e){return st(at(),...e.filter(e=>e!=null))}function lt({status:e=`idle`,theme:t}){let[n,r]=W(!1),[i,a]=W(0),{prefix:o,spinner:s}=ct(t);return Ze(()=>{if(e===`loading`){let e,t=-1,n=setTimeout(()=>{r(!0),e=setInterval(()=>{t+=1,a(t%s.frames.length)},s.interval)},300);return()=>{clearTimeout(n),clearInterval(e)}}else r(!1)},[e]),n?s.frames[i]:typeof o==`string`?o:o[e===`loading`?`idle`:e]??o.idle}function ut(e,t){return qe(n=>{let r=n.get();if(!r||r.dependencies.length!==t.length||r.dependencies.some((e,n)=>e!==t[n])){let r=e();return n.set({value:r,dependencies:t}),r}return r.value})}function dt(e){return W({current:e})[0]}function ft(e){let t=dt(e);t.current=e,Ze(e=>{let n=!1,r=Ke((r,i)=>{n||t.current(i,e)});return e.input.on(`keypress`,r),()=>{n=!0,e.input.removeListener(`keypress`,r)}},[])}var pt=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 mt=(()=>{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}})(),ht=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,gt=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,_t=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,vt=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,yt=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,bt=/\t{1,1000}/y,xt=/[\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,St=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Ct=/\p{M}+/gu,wt={limit:1/0,ellipsis:``},Tt=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?Tt(i,wt,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,c=n.emojiWidth??2,l=n.regularWidth??1,u=n.wideWidth??2,d=[[St,l],[_t,0],[vt,o],[bt,s],[xt,c],[yt,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(Ct,``)){let t=e.codePointAt(0)||0;if(S=ht(t)?2:gt(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===yt?mt(e.slice(p,n.lastIndex)):n===xt?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}},Et={limit:1/0,ellipsis:``,ellipsisWidth:0},K=(e,t={})=>Tt(e,Et,t).width,Dt=`]8;;`,Ot=RegExp(`(?:\\[(?<code>\\d+)m|\\${Dt}(?<uri>.*))`,`y`),kt=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},At=e=>`[${e}m`,jt=e=>`${Dt}${e}`,Mt=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:K(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=K(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===``)&&(i=!0,a=t.startsWith(Dt,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())},Nt=e=>{let t=e.split(` `),n=t.length;for(;n&&!K(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Pt=(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=K(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=K(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(``),Mt(s,r,t),c=K(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){Mt(s,r,t),c=K(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){Mt(s,r,t),c=K(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>Nt(e)));let l=s.join(`
|
|
1
|
+
import{a as e,s as t,t as n}from"./chunk-C94x7I9S.mjs";import{r,t as i}from"./esm-BLMtE3s6.mjs";import{Aa as a,Hi as o,It as s,St as c,fi as l,hn as u,ja as d,xa as f}from"./server-lock-CN2YHwpP-CIPpd1-K.mjs";import{$n as p,D as m,Gn as h,K as g,O as _,Qn as v,Zn as y,ba as b,cr as x,fa as S,ha as C,ir as w,ta as T,vn as ee}from"./dist-CwoT-vvz.mjs";import{t as te}from"./constants-C5Kh99hH.mjs";import{d as ne,f as E,n as re,o as D,r as ie,t as O}from"./write-project-skill-Ta2BaP1w.mjs";import{t as k}from"./is-object-Cg453afR.mjs";import{i as A,o as j,r as ae,s as M,t as N}from"./colors-8SzMRIVy.mjs";import{t as oe}from"./preview-DcLHmjqA.mjs";import{createRequire as P}from"node:module";import{execFileSync as se}from"node:child_process";import ce,{dirname as F,isAbsolute as le,join as I,relative as L,resolve as ue,sep as de}from"node:path";import{existsSync as R,lstatSync as fe,mkdirSync as pe,readFileSync as z,readlinkSync as me,realpathSync as he,statSync as ge,writeFileSync as _e}from"node:fs";import B from"node:process";import{homedir as ve}from"node:os";import{fileURLToPath as ye}from"node:url";import{randomUUID as be}from"node:crypto";import{inspect as xe,stripVTControlCharacters as Se,styleText as V}from"node:util";import{AsyncLocalStorage as Ce,AsyncResource as we}from"node:async_hooks";import{createServer as Te,request as Ee}from"node:http";import*as De from"node:readline";import{connect as Oe}from"node:net";const ke=new Set([`emacs`,`vim`]);function Ae(e){return ke.has(e)}function je(){let e=process.env.INQUIRER_KEYBINDINGS;return e?Array.from(new Set(e.toLowerCase().split(/[\s,]+/).filter(Ae))):[]}const H=(e,t=[])=>e.name===`up`||t.includes(`vim`)&&e.name===`k`||t.includes(`emacs`)&&e.ctrl&&e.name===`p`,Me=(e,t=[])=>e.name===`down`||t.includes(`vim`)&&e.name===`j`||t.includes(`emacs`)&&e.ctrl&&e.name===`n`,Ne=e=>e.name===`space`,Pe=e=>e.name===`backspace`,Fe=e=>`1234567890`.includes(e.name),Ie=e=>e.name===`enter`||e.name===`return`;var Le=class extends Error{name=`AbortPromptError`;message=`Prompt was aborted`;constructor(e){super(),this.cause=e?.cause}},Re=class extends Error{name=`CancelPromptError`;message=`Prompt was canceled`},ze=class extends Error{name=`ExitPromptError`},Be=class extends Error{name=`HookError`},Ve=class extends Error{name=`ValidationError`};const He=new Ce;function Ue(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function We(e,t){let n=Ue(e);return He.run(n,()=>{function e(e){n.handleChange=()=>{n.index=0,e()},n.handleChange()}return t(e)})}function U(){let e=He.getStore();if(!e)throw new Be(`[Inquirer] Hook functions can only be called from within a prompt`);return e}function Ge(){return U().rl}function Ke(e){return we.bind((...t)=>{let n=U(),r=!1,i=n.handleChange;n.handleChange=()=>{r=!0};let a=e(...t);return r&&i(),n.handleChange=i,a})}function qe(e){let t=U(),{index:n}=t,r=e({get(){return t.hooks[n]},set(e){t.hooks[n]=e},initialized:n in t.hooks});return t.index++,r}function Je(){U().handleChange()}const Ye={queue(e){let t=U(),{index:n}=t;t.hooksEffect.push(()=>{t.hooksCleanup[n]?.();let r=e(Ge());if(r!=null&&typeof r!=`function`)throw new Ve(`useEffect return value must be a cleanup function or nothing.`);t.hooksCleanup[n]=r})},run(){let e=U();Ke(()=>{e.hooksEffect.forEach(e=>{e()}),e.hooksEffect.length=0})()},clearAll(){let e=U();e.hooksCleanup.forEach(e=>{e?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function Xe(e){return typeof e==`function`}function W(e){return qe(t=>{let n=we.bind(function(e){t.get()!==e&&(t.set(e),Je())});if(t.initialized)return[t.get(),n];let r=Xe(e)?e():e;return t.set(r),[r,n]})}function Ze(e,t){qe(n=>{let r=n.get();(!Array.isArray(r)||t.some((e,t)=>!Object.is(e,r[t])))&&Ye.queue(e),n.set(t)})}function Qe(){return B.platform.startsWith(`win`)?!!B.env.CI||!!B.env.WT_SESSION||!!B.env.TERMINUS_SUBLIME||B.env.ConEmuTask===`{cmd::Cmder}`||B.env.TERM_PROGRAM===`Terminus-Sublime`||B.env.TERM_PROGRAM===`vscode`||B.env.TERM===`xterm-256color`||B.env.TERM===`alacritty`||B.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:B.env.TERM!==`linux`}const $e={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:`╱`},et={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:`⅒`},tt={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`},nt={...$e,...et},rt={...$e,...tt},G=Qe()?nt:rt;Object.entries(et);const it={prefix:{idle:V(`blue`,`?`),done:V(`green`,G.tick)},spinner:{interval:80,frames:[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`].map(e=>V(`yellow`,e))},keybindings:[],style:{answer:e=>V(`cyan`,e),message:e=>V(`bold`,e),error:e=>V(`red`,`> ${e}`),defaultAnswer:e=>V(`dim`,`(${e})`),help:e=>V(`dim`,e),highlight:e=>V(`cyan`,e),key:e=>V(`cyan`,V(`bold`,`<${e}>`))}};function at(){return{...it,keybindings:je()}}function ot(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function st(...e){let t={};for(let n of e)for(let[e,r]of Object.entries(n)){let n=t[e];t[e]=ot(n)&&ot(r)?st(n,r):r}return t}function ct(...e){return st(at(),...e.filter(e=>e!=null))}function lt({status:e=`idle`,theme:t}){let[n,r]=W(!1),[i,a]=W(0),{prefix:o,spinner:s}=ct(t);return Ze(()=>{if(e===`loading`){let e,t=-1,n=setTimeout(()=>{r(!0),e=setInterval(()=>{t+=1,a(t%s.frames.length)},s.interval)},300);return()=>{clearTimeout(n),clearInterval(e)}}else r(!1)},[e]),n?s.frames[i]:typeof o==`string`?o:o[e===`loading`?`idle`:e]??o.idle}function ut(e,t){return qe(n=>{let r=n.get();if(!r||r.dependencies.length!==t.length||r.dependencies.some((e,n)=>e!==t[n])){let r=e();return n.set({value:r,dependencies:t}),r}return r.value})}function dt(e){return W({current:e})[0]}function ft(e){let t=dt(e);t.current=e,Ze(e=>{let n=!1,r=Ke((r,i)=>{n||t.current(i,e)});return e.input.on(`keypress`,r),()=>{n=!0,e.input.removeListener(`keypress`,r)}},[])}var pt=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 mt=(()=>{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}})(),ht=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,gt=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,_t=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,vt=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,yt=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,bt=/\t{1,1000}/y,xt=/[\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,St=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Ct=/\p{M}+/gu,wt={limit:1/0,ellipsis:``},Tt=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?Tt(i,wt,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,c=n.emojiWidth??2,l=n.regularWidth??1,u=n.wideWidth??2,d=[[St,l],[_t,0],[vt,o],[bt,s],[xt,c],[yt,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(Ct,``)){let t=e.codePointAt(0)||0;if(S=ht(t)?2:gt(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===yt?mt(e.slice(p,n.lastIndex)):n===xt?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}},Et={limit:1/0,ellipsis:``,ellipsisWidth:0},K=(e,t={})=>Tt(e,Et,t).width,Dt=`]8;;`,Ot=RegExp(`(?:\\[(?<code>\\d+)m|\\${Dt}(?<uri>.*))`,`y`),kt=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},At=e=>`[${e}m`,jt=e=>`${Dt}${e}`,Mt=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:K(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=K(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===``)&&(i=!0,a=t.startsWith(Dt,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())},Nt=e=>{let t=e.split(` `),n=t.length;for(;n&&!K(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Pt=(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=K(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=K(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(``),Mt(s,r,t),c=K(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){Mt(s,r,t),c=K(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){Mt(s,r,t),c=K(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>Nt(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===``){Ot.lastIndex=e+1;let t=Ot.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+=jt(``));let e=i?kt(i):void 0;i&&e&&(r+=At(e))}else t===`
|
|
4
4
|
`&&(i&&kt(i)&&(r+=At(i)),a&&(r+=jt(a)))}return r},Ft=/\r?\n/;function It(e,t,n){return String(e).normalize().split(Ft).map(e=>Pt(e,t,n)).join(`
|
|
@@ -285,17 +285,17 @@ let Kr=/^[a-z0-9-_]+$/i;function qr(e){let t=typeof e;if(t===`object`){if(Array.
|
|
|
285
285
|
`}}return e&&(a||!o)&&(a=a?`[${e}]\n${a}`:`[${e}]`),a&&o?`${a}\n${o}`:a||o}function ti(e,{maxDepth:t=1e3,numbersAsFloat:n=!1}={}){if(qr(e)!==`object`)throw TypeError(`stringify can only be called with an object`);let r=ei(0,e,``,t,n);return r[r.length-1]===`
|
|
286
286
|
`?r:r+`
|
|
287
287
|
`}function ni(e,t){let n=L(t,e);return n.length>0&&!n.startsWith(`..`)&&!le(n)}const ri=e=>{try{let t=se(`git`,[`rev-parse`,`--show-toplevel`],{cwd:e,encoding:`utf8`,stdio:[`ignore`,`pipe`,`ignore`]}).trim();return t.length>0?t:null}catch{return null}};function ii(e,t={}){let n=t.homeDir??ve(),r=t.gitTopLevel??ri,i=ue(e),a;try{a=he(i)}catch{a=i}let o=a,s=0;for(;s<30&&!(o===n||o===`/`||o===``);){if(x(o))return{projectRoot:o,defaultContentDir:`.`,ancestorPromoted:o!==a,gitRootPromoted:!1};let e=F(o);if(e===o)break;o=e,s+=1}let c=r(a);return c!==null&&ni(c,n)?c===a?{projectRoot:i,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}:{projectRoot:c,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!0}:{projectRoot:i,defaultContentDir:`.`,ancestorPromoted:!1,gitRootPromoted:!1}}function ai(e){let t=e&&typeof e==`object`&&`code`in e?e.code:void 0;return t===`MODULE_NOT_FOUND`||t===`ERR_MODULE_NOT_FOUND`}function Q(e,t){if(!process.env.OK_DEBUG_NATIVE)return;let n=t instanceof Error?t.message:String(t);process.stderr.write(`[ok] native-config ${e}: ${n}\n`)}const oi=[`native`,`index.js`];function si(e={}){let t=e.moduleUrl??import.meta.url,n=e.requireModule??P(t);try{return n(I(F(ye(t)),...oi))}catch(e){ai(e)||Q(`bundled loader failed to load`,e)}try{return n(`@inkeep/open-knowledge-native-config`)}catch(e){return ai(e)||Q(`workspace addon failed to load`,e),null}}function ci(){let e=si();return e&&typeof e.resolveSymlinkWritePath==`function`?e:null}function li(e){let t=e,n=new Set;for(;;){let r;try{r=fe(t).isSymbolicLink()}catch(n){return n.code===`ENOENT`?{readPath:t,writePath:t}:{readPath:null,writePath:e}}if(!r)return{readPath:t,writePath:t};if(n.has(t))return{readPath:null,writePath:e};n.add(t);let i;try{i=me(t)}catch(t){return Q(`readlinkSync threw during symlink walk`,t),{readPath:null,writePath:e}}t=le(i)?i:I(F(t),i)}}let ui;function di(){return ui===void 0&&(ui=ci()),ui}function fi(e,t=di){let n=t();if(n)try{let t=n.resolveSymlinkWritePath(e);return{readPath:t.readPath??null,writePath:t.writePath}}catch(e){Q(`resolveSymlinkWritePath threw`,e)}return li(e)}function pi(){let e=si();return e&&typeof e.parseTomlToJson==`function`?e:null}function mi(e){try{let t=e.parseTomlToJson(`probe = 1`);return typeof t==`string`&&t.includes(`probe`)}catch(e){return Q(`addon loaded but probe failed`,e),!1}}function hi(e){if(!k(e))throw Error(`TOML root is not a table`);return e}function gi(e){return{backend:`native`,parseToObject(t){return hi(JSON.parse(e.parseTomlToJson(t)))},upsertEntry(t,n,r){let i=e.upsertMcpServer(t,n,JSON.stringify(r));return{text:i.text,existed:i.existed}}}}function _i(){return{backend:`fallback`,parseToObject(e){return hi(Gr(e))}}}function vi(e=pi){let t=e();return t&&mi(t)?gi(t):_i()}let yi=null;function bi(){return yi===null&&(yi=vi()),yi}function $(e,t,n,r,i){let a=`urn:uuid:${be()}`;if(e.headersSent||e.writableEnded||e.destroyed){console.error(`[ok ui] emitProblem called after headers sent — suppressed`,{type:n,status:t,instance:a});return}let o={type:n,title:r,status:t,instance:a,...i===void 0?{}:{detail:i}},s=u.safeParse(o);if(!s.success){console.error(`[ok ui] emitProblem produced an invalid ProblemDetails body:`,{issues:s.error.issues,originalStatus:t,body:o}),e.writeHead(500,{"Content-Type":`application/problem+json`,"X-Content-Type-Options":`nosniff`,"Cache-Control":`no-store`}),e.end(JSON.stringify({type:`urn:ok:error:internal-server-error`,title:`Internal server error.`,status:500,instance:a}));return}e.writeHead(t,{"Content-Type":`application/problem+json`,"X-Content-Type-Options":`nosniff`,"Cache-Control":`no-store`}),e.end(JSON.stringify(o))}const xi=1e4;function Si(e,t){let n=e.socket?.remoteAddress;if(n!==void 0&&!w(n))return $(t,403,`urn:ok:error:loopback-required`,`Request must originate from a loopback address.`),!0;if(!p(e.headers.host))return $(t,403,`urn:ok:error:host-not-allowed`,`Host header is not in the loopback allowlist.`),!0;let r=e.headers.origin;return r!==void 0&&!v(r)?($(t,403,`urn:ok:error:invalid-origin`,`Origin header is not in the loopback allowlist.`),!0):!1}const Ci=3e4;function wi(e,t){let n=e.socket?.remoteAddress;if(n!==void 0&&!w(n)||!p(e.headers.host))return t.destroy(),!0;let r=e.headers.origin;return typeof r==`string`&&!v(r)?(t.destroy(),!0):!1}function Ti(e,t,n,r,i,a){a.add(t),t.once(`close`,()=>a.delete(t));let o=Oe({host:r,port:i,timeout:xi});a.add(o),o.once(`close`,()=>a.delete(o));let s=!1,c=n=>{if(!s){if(s=!0,n!==void 0){let t=n.err;console.warn(JSON.stringify({event:n.event,upstreamHost:r,upstreamPort:i,url:e.url,code:t instanceof Error?t.code:void 0,message:t instanceof Error?t.message:void 0}))}try{o.destroy()}catch{}try{t.destroy()}catch{}}};o.once(`connect`,()=>{o.setTimeout(0);let a=[`${e.method??`GET`} ${e.url??`/`} HTTP/1.1`,`host: ${r}:${i}`];for(let[t,n]of Object.entries(e.headers))if(t.toLowerCase()!==`host`&&n!==void 0)if(Array.isArray(n))for(let e of n)a.push(`${t}: ${e}`);else a.push(`${t}: ${n}`);try{o.write(`${a.join(`\r
|
|
288
|
-
`)}\r\n\r\n`),n.length>0&&o.write(n)}catch(e){c({event:`proxy-upgrade-handshake-write-failed`,err:e});return}o.on(`data`,e=>{t.writable&&t.write(e)}),t.on(`data`,e=>{o.writable&&o.write(e)})}),o.once(`timeout`,()=>{c({event:`proxy-upgrade-upstream-connect-timeout`})}),o.on(`error`,e=>c({event:`proxy-upgrade-upstream-error`,err:e})),t.on(`error`,e=>c({event:`proxy-upgrade-client-error`,err:e})),o.once(`close`,()=>c()),t.once(`close`,()=>c())}const Ei=[`connection`,`keep-alive`,`proxy-authenticate`,`proxy-authorization`,`te`,`trailer`,`transfer-encoding`,`upgrade`,`cookie`,`set-cookie`];async function Di(e){let t=e.upstreamTimeoutMs??xi,n=new Set,r=Te((n,r)=>{Si(n,r)||ki(n,r,e.upstreamHost,e.upstreamPort,t)});r.on(`upgrade`,(t,r,i)=>{wi(t,r)||Ti(t,r,i,e.upstreamHost,e.upstreamPort,n)}),await new Promise((t,n)=>{let i=e=>n(e);r.once(`error`,i),r.listen(e.listenPort,e.host,()=>{r.off(`error`,i),t()})});let i=r.address();return{httpServer:r,port:typeof i==`object`&&i?i.port:e.listenPort,close:()=>new Promise(e=>{for(let e of n)try{e.destroy()}catch{}n.clear(),r.close(()=>e()),r.closeIdleConnections()})}}function Oi(e,t,n){ki(e,t,n.upstreamHost,n.upstreamPort,n.upstreamTimeoutMs??xi)}function ki(e,t,n,r,i){let a={...e.headers};delete a.host;for(let e of Ei)delete a[e];e.setTimeout(Ci,()=>{if(t.headersSent)try{t.end()}catch{}else try{$(t,408,`urn:ok:error:request-timeout`,`Proxy request exceeded the per-request deadline.`,`Slow-loris-class: client did not finish within ${Ci/1e3}s.`)}catch{}try{e.socket?.destroy()}catch{}});let o=Ee({host:n,port:r,method:e.method,path:e.url,headers:{...a,host:`${n}:${r}`}},e=>{let n={...e.headers};for(let e of Ei)delete n[e];t.writeHead(e.statusCode??502,n),e.pipe(t),e.once(`error`,()=>{try{t.end()}catch{}})});i>0&&o.setTimeout(i,()=>{if(!t.headersSent)$(t,504,`urn:ok:error:gateway-timeout`,`Upstream did not respond before the gateway deadline.`,`Upstream timeout: ${i/1e3}s elapsed without a response.`);else try{t.end()}catch{}o.destroy()}),o.on(`error`,()=>{if(!t.headersSent)$(t,502,`urn:ok:error:collab-server-not-running`,`Collab server is unreachable.`,`Upstream connection failed or dropped before a response was received.`);else try{t.end()}catch{}}),e.on(`error`,()=>{o.destroy()}),e.pipe(o)}const Ai=39847,ji=39848;async function Mi(e){await Promise.all(e.map(e=>new Promise(t=>{e.close(()=>t())})))}async function Ni(e){let{existsSync:t}=await import(`node:fs`),{createServer:n}=await import(`node:http`),{resolve:r}=await import(`node:path`),{acquireUiLock:i,clearArmedPaneTarget:o,createAssetServeMiddleware:s,createContentFilter:c,readArmedPaneTarget:u,readServerLock:p,releaseUiLock:m,updateUiLockPort:h}=await import(`./dist-BGSaL7p3.mjs`),{default:g}=await import(`./build-Ca40rJCO.mjs`),{resolveContentDir:_,resolveLockDir:v}=await import(`./dist-BGSaL7p3.mjs`),y=_(e.config,e.cwd),b=v(e.cwd);i(b,{port:0,worktreeRoot:e.cwd});let x=import.meta.dirname??new URL(`.`,import.meta.url).pathname,S=[r(x,`public`),r(x,`../../app/dist`),r(x,`../../../app/dist`)],C=e.assetDir??S.find(e=>t(e)),w=C?g(C,{single:!0,gzip:!0,etag:!0,dev:!0,extensions:[]}):null,T=t(y)?s({contentFilter:c({projectDir:e.cwd,contentDir:y}),contentSirv:g(y,{dotfiles:!1,dev:!0,extensions:[]}),inlineExtensions:d,assetExtensions:f,blocklistExtensions:a}):null,ee=e.port,te=null,ne=(e,t)=>{let n=e.url?.split(`?`)[0];if(e.method===`GET`&&(n===`/`||n===``)){let e=u(b);if(e&&!/[\r\n]/.test(e)){o(b),t.statusCode=302,t.setHeader(`Location`,`/${e}`),t.setHeader(`Cache-Control`,`no-store`),t.end();return}}if((n===`/`||n===``)&&(e.url=`/index.html`),!(n?.startsWith(`/api/`)&&Si(e,t))){if(n===`/api/config`&&e.method===`DELETE`){o(b),t.setHeader(`Cache-Control`,`no-store`),t.statusCode=204,t.end();return}if(n===`/api/config`&&(e.method===`GET`||e.method===`HEAD`)){te?.();let n=p(b),r=e.headers.host??`localhost:${ee}`,i=n&&n.port>0?`ws://${r}/collab`:null,a=u(b),o=JSON.stringify({collabUrl:i,previewUrl:null,port:ee,paneTarget:a});t.setHeader(`Content-Type`,`application/json`),t.setHeader(`Cache-Control`,`no-store`),t.setHeader(`X-Content-Type-Options`,`nosniff`),t.statusCode=200,e.method===`HEAD`?t.end():t.end(o);return}if(n?.startsWith(`/api/`)){te?.();let r=p(b);if(!r||r.port<=0){$(t,503,`urn:ok:error:collab-server-not-running`,"Collab server not running. Start `ok start` or run `ok status`.",`Path: ${n}`);return}Oi(e,t,{upstreamHost:`localhost`,upstreamPort:r.port});return}if(w&&n?.startsWith(`/assets/`)){w(e,t,()=>{T?T(e,t,()=>Pi(t)):Pi(t)});return}if(T){T(e,t,()=>{w?w(e,t):Pi(t)});return}if(w){w(e,t);return}Pi(t)}},E=new Set,re=(e,t,n)=>{if(wi(e,t))return;let r=e.url?.split(`?`)[0]??``;if(r!==`/collab`&&!r.startsWith(`/collab/`)){t.destroy();return}let i=p(b);if(!i||i.port<=0){console.warn(JSON.stringify({event:`ok-ui-upgrade-no-collab-lock`,url:r,reason:"server.lock missing or port unbound — is `ok start` running?"})),t.destroy();return}Ti(e,t,n,`localhost`,i.port,E)},D=()=>{for(let e of E)try{e.destroy()}catch{}E.clear()},ie=e.host===void 0?[`::1`,`127.0.0.1`]:[e.host],O=[],k=e.port,A=e=>e instanceof Error&&e.code===`EADDRINUSE`,j=async()=>{await Promise.all(O.splice(0).map(e=>new Promise(t=>{try{e.close(()=>t())}catch{t()}})))},ae=async e=>{k=e;for(let e of ie){let t=n(ne);t.on(`upgrade`,re),O.push(t),await new Promise((n,r)=>{let i=e=>r(e);t.once(`error`,i),t.listen(k,e,()=>{t.off(`error`,i);let e=t.address();typeof e==`object`&&e&&(k=e.port),n()})})}};try{try{await ae(e.port)}catch(t){if(e.fallbackToKernel===!0&&A(t))await j(),await ae(0);else throw t}}catch(e){await j();try{m(b)}catch{}throw e}let M=k;ee=M,h(b,M);let N=e.scheduler??l,oe=e.safetyNetMs??432e5,P=null,se=!1,ce=!1,F=()=>{se||(se=!0,P!==null&&(N.clearTimeout(P),P=null))},le=()=>{if(F(),!ce){ce=!0;try{m(b)}catch{}}},I=()=>{se||oe<=0||(P!==null&&(N.clearTimeout(P),P=null),P=N.setTimeout(()=>{P=null,console.warn(`[ui] safety-net (${oe}ms) reached — shutting down (D-025 backstop)`);try{e.onSafetyNet?.()}catch{}D();for(let e of O)try{e.close()}catch{}le()},oe))},L=()=>{se||oe<=0||I()};return te=L,I(),{httpServers:O,port:M,release:le,detachSafetyNet:F,nudgeSafetyNet:L,drainUpgradeSockets:D}}function Pi(e){e.headersSent||e.writableEnded||e.destroyed||(e.setHeader(`X-Content-Type-Options`,`nosniff`),e.setHeader(`Cache-Control`,`no-store`),e.statusCode=404,e.end())}function Fi(e,t){if(e!==void 0){let t=Number.parseInt(e,10);if(Number.isNaN(t)||t<0||t>65535)throw Error(`Invalid --port value '${e}'`);return{port:t,fallbackToKernel:!1}}if(t!==void 0&&t!==``){let e=Number.parseInt(t,10);if(Number.isNaN(e)||e<0||e>65535)throw Error(`Invalid PORT env value '${t}'`);return{port:e,fallbackToKernel:!1}}return{port:Ai,fallbackToKernel:!0}}async function Ii(e){let t=e.readLock??(async()=>{let{readUiLock:t}=await import(`./dist-BGSaL7p3.mjs`);return t(e.lockDir)}),n=await t();if(!n)throw Error(`UI lock collision reported but the lock disappeared before handling — retry acquiring.`);if(n.port===e.requestedPort&&n.port>0)return{mode:`already-running`,port:n.port};let r=n.port;if(r===0){let n=Date.now()+(e.pollDeadlineMs??2e3),i=e.pollIntervalMs??100;for(;Date.now()<n;){await new Promise(e=>{setTimeout(e,i)});let e=await t();if(e&&e.port>0){r=e.port;break}}if(r===0)throw Error("UI did not bind within 2s; run `ok clean`");if(r===e.requestedPort)return{mode:`already-running`,port:r}}return{mode:`proxy`,handle:await Di({listenPort:e.requestedPort,host:e.host,upstreamHost:`localhost`,upstreamPort:r}),upstreamPort:r}}function Li(e){return new i(`ui`).description(`Serve the OpenKnowledge React editor UI`).option(`-p, --port <port>`,`UI port (default: $PORT env or ${Ai}, kernel-allocated fallback if busy)`).option(`-H, --host <host>`,"UI host. Default: two-socket loopback bind (`[::1]` + `127.0.0.1`) so cross-family collisions fail loud. Pass an explicit host (e.g. `127.0.0.1`, `0.0.0.0`) to bind a single socket on that host.").action(async t=>{let{dim:n}=await import(`./colors-CmkIIbww.mjs`),{UiLockCollisionError:r}=await import(`./dist-BGSaL7p3.mjs`),{resolveLockDir:i}=await import(`./dist-BGSaL7p3.mjs`),a=e(),o=t.host,s;try{s=Fi(t.port,process.env.PORT)}catch(e){console.error(e instanceof Error?e.message:String(e)),process.exitCode=1;return}let c=s.port;try{let e=await Ni({config:a,cwd:process.cwd(),port:c,fallbackToKernel:s.fallbackToKernel,host:o}),t=o===void 0||o===`::`||o===`0.0.0.0`?`localhost`:o;console.log(`${n(`[ui]`)} listening on http://${t}:${e.port}`);let r=!1,i=t=>{if(r)return;r=!0,console.log(n(`\n[ui] Shutting down (${t})`)),e.detachSafetyNet();let i=()=>{try{e.release()}finally{process.exit(process.exitCode??0)}};e.drainUpgradeSockets(),Mi(e.httpServers).then(i,i),setTimeout(i,2e3).unref()};process.once(`SIGINT`,()=>i(`SIGINT`)),process.once(`SIGTERM`,()=>i(`SIGTERM`));return}catch(e){if(!(e instanceof r))throw e;let t=i(process.cwd()),a=o??`localhost`,s;try{s=await Ii({requestedPort:c,host:a,lockDir:t})}catch(e){console.error(e instanceof Error?e.message:String(e)),process.exit(1)}if(s.mode===`already-running`){if(console.log(`UI already running at http://${a}:${s.port}`),Ri(process)){await new Promise(e=>{let t=t=>{console.log(n(`\n[ui-keepalive] Shutting down (${t})`)),e()};process.once(`SIGINT`,()=>t(`SIGINT`)),process.once(`SIGTERM`,()=>t(`SIGTERM`))});return}process.exit(0)}console.log(`UI running at http://${a}:${s.upstreamPort}; acting as HTTP proxy on port ${s.handle.port}`);let l=!1,u=e=>{l||(l=!0,console.log(n(`\n[ui-proxy] Shutting down (${e})`)),s.handle.close().finally(()=>process.exit(process.exitCode??0)),setTimeout(()=>process.exit(process.exitCode??0),2e3).unref())};process.once(`SIGINT`,()=>u(`SIGINT`)),process.once(`SIGTERM`,()=>u(`SIGTERM`))}})}function Ri(e){let t=e.stdout.isTTY===!0,n=typeof e.env.PORT==`string`&&e.env.PORT!==``;return!t||n}const zi={allowTrailingComma:!0,disallowComments:!1};function Bi(e,t){return e.error===1&&e.offset===0&&t.charCodeAt(0)===65279}function Vi(e){let t=[],n=_r(e,t,zi);return t.some(t=>!Bi(t,e))||!n||n.type!==`object`?null:n}function Hi(e,t){let n=0;for(let r of e.children??[]){let e=r.children?.[0];e!==void 0&&vr(e)===t&&(n+=1)}return n}function Ui(e,t){S(e,`${JSON.stringify(t,null,2)}\n`)}function Wi(e,t){let n=ti(t);S(e,n.endsWith(`
|
|
288
|
+
`)}\r\n\r\n`),n.length>0&&o.write(n)}catch(e){c({event:`proxy-upgrade-handshake-write-failed`,err:e});return}o.on(`data`,e=>{t.writable&&t.write(e)}),t.on(`data`,e=>{o.writable&&o.write(e)})}),o.once(`timeout`,()=>{c({event:`proxy-upgrade-upstream-connect-timeout`})}),o.on(`error`,e=>c({event:`proxy-upgrade-upstream-error`,err:e})),t.on(`error`,e=>c({event:`proxy-upgrade-client-error`,err:e})),o.once(`close`,()=>c()),t.once(`close`,()=>c())}const Ei=[`connection`,`keep-alive`,`proxy-authenticate`,`proxy-authorization`,`te`,`trailer`,`transfer-encoding`,`upgrade`,`cookie`,`set-cookie`];async function Di(e){let t=e.upstreamTimeoutMs??xi,n=new Set,r=Te((n,r)=>{Si(n,r)||ki(n,r,e.upstreamHost,e.upstreamPort,t)});r.on(`upgrade`,(t,r,i)=>{wi(t,r)||Ti(t,r,i,e.upstreamHost,e.upstreamPort,n)}),await new Promise((t,n)=>{let i=e=>n(e);r.once(`error`,i),r.listen(e.listenPort,e.host,()=>{r.off(`error`,i),t()})});let i=r.address();return{httpServer:r,port:typeof i==`object`&&i?i.port:e.listenPort,close:()=>new Promise(e=>{for(let e of n)try{e.destroy()}catch{}n.clear(),r.close(()=>e()),r.closeIdleConnections()})}}function Oi(e,t,n){ki(e,t,n.upstreamHost,n.upstreamPort,n.upstreamTimeoutMs??xi)}function ki(e,t,n,r,i){let a={...e.headers};delete a.host;for(let e of Ei)delete a[e];e.setTimeout(Ci,()=>{if(t.headersSent)try{t.end()}catch{}else try{$(t,408,`urn:ok:error:request-timeout`,`Proxy request exceeded the per-request deadline.`,`Slow-loris-class: client did not finish within ${Ci/1e3}s.`)}catch{}try{e.socket?.destroy()}catch{}});let o=Ee({host:n,port:r,method:e.method,path:e.url,headers:{...a,host:`${n}:${r}`}},e=>{let n={...e.headers};for(let e of Ei)delete n[e];t.writeHead(e.statusCode??502,n),e.pipe(t),e.once(`error`,()=>{try{t.end()}catch{}})});i>0&&o.setTimeout(i,()=>{if(!t.headersSent)$(t,504,`urn:ok:error:gateway-timeout`,`Upstream did not respond before the gateway deadline.`,`Upstream timeout: ${i/1e3}s elapsed without a response.`);else try{t.end()}catch{}o.destroy()}),o.on(`error`,()=>{if(!t.headersSent)$(t,502,`urn:ok:error:collab-server-not-running`,`Collab server is unreachable.`,`Upstream connection failed or dropped before a response was received.`);else try{t.end()}catch{}}),e.on(`error`,()=>{o.destroy()}),e.pipe(o)}const Ai=39847,ji=39848;async function Mi(e){await Promise.all(e.map(e=>new Promise(t=>{e.close(()=>t())})))}async function Ni(e){let{existsSync:t}=await import(`node:fs`),{createServer:n}=await import(`node:http`),{resolve:r}=await import(`node:path`),{acquireUiLock:i,clearArmedPaneTarget:o,createAssetServeMiddleware:s,createContentFilter:c,readArmedPaneTarget:u,readServerLock:p,releaseUiLock:m,updateUiLockPort:h}=await import(`./dist-tv3SH76A.mjs`),{default:g}=await import(`./build-Ca40rJCO.mjs`),{resolveContentDir:_,resolveLockDir:v}=await import(`./dist-tv3SH76A.mjs`),y=_(e.config,e.cwd),b=v(e.cwd);i(b,{port:0,worktreeRoot:e.cwd});let x=import.meta.dirname??new URL(`.`,import.meta.url).pathname,S=[r(x,`public`),r(x,`../../app/dist`),r(x,`../../../app/dist`)],C=e.assetDir??S.find(e=>t(e)),w=C?g(C,{single:!0,gzip:!0,etag:!0,dev:!0,extensions:[]}):null,T=t(y)?s({contentFilter:c({projectDir:e.cwd,contentDir:y}),contentSirv:g(y,{dotfiles:!1,dev:!0,extensions:[]}),inlineExtensions:d,assetExtensions:f,blocklistExtensions:a}):null,ee=e.port,te=null,ne=(e,t)=>{let n=e.url?.split(`?`)[0];if(e.method===`GET`&&(n===`/`||n===``)){let e=u(b);if(e&&!/[\r\n]/.test(e)){o(b),t.statusCode=302,t.setHeader(`Location`,`/${e}`),t.setHeader(`Cache-Control`,`no-store`),t.end();return}}if((n===`/`||n===``)&&(e.url=`/index.html`),!(n?.startsWith(`/api/`)&&Si(e,t))){if(n===`/api/config`&&e.method===`DELETE`){o(b),t.setHeader(`Cache-Control`,`no-store`),t.statusCode=204,t.end();return}if(n===`/api/config`&&(e.method===`GET`||e.method===`HEAD`)){te?.();let n=p(b),r=e.headers.host??`localhost:${ee}`,i=n&&n.port>0?`ws://${r}/collab`:null,a=u(b),o=JSON.stringify({collabUrl:i,previewUrl:null,port:ee,paneTarget:a});t.setHeader(`Content-Type`,`application/json`),t.setHeader(`Cache-Control`,`no-store`),t.setHeader(`X-Content-Type-Options`,`nosniff`),t.statusCode=200,e.method===`HEAD`?t.end():t.end(o);return}if(n?.startsWith(`/api/`)){te?.();let r=p(b);if(!r||r.port<=0){$(t,503,`urn:ok:error:collab-server-not-running`,"Collab server not running. Start `ok start` or run `ok status`.",`Path: ${n}`);return}Oi(e,t,{upstreamHost:`localhost`,upstreamPort:r.port});return}if(w&&n?.startsWith(`/assets/`)){w(e,t,()=>{T?T(e,t,()=>Pi(t)):Pi(t)});return}if(T){T(e,t,()=>{w?w(e,t):Pi(t)});return}if(w){w(e,t);return}Pi(t)}},E=new Set,re=(e,t,n)=>{if(wi(e,t))return;let r=e.url?.split(`?`)[0]??``;if(r!==`/collab`&&!r.startsWith(`/collab/`)){t.destroy();return}let i=p(b);if(!i||i.port<=0){console.warn(JSON.stringify({event:`ok-ui-upgrade-no-collab-lock`,url:r,reason:"server.lock missing or port unbound — is `ok start` running?"})),t.destroy();return}Ti(e,t,n,`localhost`,i.port,E)},D=()=>{for(let e of E)try{e.destroy()}catch{}E.clear()},ie=e.host===void 0?[`::1`,`127.0.0.1`]:[e.host],O=[],k=e.port,A=e=>e instanceof Error&&e.code===`EADDRINUSE`,j=async()=>{await Promise.all(O.splice(0).map(e=>new Promise(t=>{try{e.close(()=>t())}catch{t()}})))},ae=async e=>{k=e;for(let e of ie){let t=n(ne);t.on(`upgrade`,re),O.push(t),await new Promise((n,r)=>{let i=e=>r(e);t.once(`error`,i),t.listen(k,e,()=>{t.off(`error`,i);let e=t.address();typeof e==`object`&&e&&(k=e.port),n()})})}};try{try{await ae(e.port)}catch(t){if(e.fallbackToKernel===!0&&A(t))await j(),await ae(0);else throw t}}catch(e){await j();try{m(b)}catch{}throw e}let M=k;ee=M,h(b,M);let N=e.scheduler??l,oe=e.safetyNetMs??432e5,P=null,se=!1,ce=!1,F=()=>{se||(se=!0,P!==null&&(N.clearTimeout(P),P=null))},le=()=>{if(F(),!ce){ce=!0;try{m(b)}catch{}}},I=()=>{se||oe<=0||(P!==null&&(N.clearTimeout(P),P=null),P=N.setTimeout(()=>{P=null,console.warn(`[ui] safety-net (${oe}ms) reached — shutting down (D-025 backstop)`);try{e.onSafetyNet?.()}catch{}D();for(let e of O)try{e.close()}catch{}le()},oe))},L=()=>{se||oe<=0||I()};return te=L,I(),{httpServers:O,port:M,release:le,detachSafetyNet:F,nudgeSafetyNet:L,drainUpgradeSockets:D}}function Pi(e){e.headersSent||e.writableEnded||e.destroyed||(e.setHeader(`X-Content-Type-Options`,`nosniff`),e.setHeader(`Cache-Control`,`no-store`),e.statusCode=404,e.end())}function Fi(e,t){if(e!==void 0){let t=Number.parseInt(e,10);if(Number.isNaN(t)||t<0||t>65535)throw Error(`Invalid --port value '${e}'`);return{port:t,fallbackToKernel:!1}}if(t!==void 0&&t!==``){let e=Number.parseInt(t,10);if(Number.isNaN(e)||e<0||e>65535)throw Error(`Invalid PORT env value '${t}'`);return{port:e,fallbackToKernel:!1}}return{port:Ai,fallbackToKernel:!0}}async function Ii(e){let t=e.readLock??(async()=>{let{readUiLock:t}=await import(`./dist-tv3SH76A.mjs`);return t(e.lockDir)}),n=await t();if(!n)throw Error(`UI lock collision reported but the lock disappeared before handling — retry acquiring.`);if(n.port===e.requestedPort&&n.port>0)return{mode:`already-running`,port:n.port};let r=n.port;if(r===0){let n=Date.now()+(e.pollDeadlineMs??2e3),i=e.pollIntervalMs??100;for(;Date.now()<n;){await new Promise(e=>{setTimeout(e,i)});let e=await t();if(e&&e.port>0){r=e.port;break}}if(r===0)throw Error("UI did not bind within 2s; run `ok clean`");if(r===e.requestedPort)return{mode:`already-running`,port:r}}return{mode:`proxy`,handle:await Di({listenPort:e.requestedPort,host:e.host,upstreamHost:`localhost`,upstreamPort:r}),upstreamPort:r}}function Li(e){return new i(`ui`).description(`Serve the OpenKnowledge React editor UI`).option(`-p, --port <port>`,`UI port (default: $PORT env or ${Ai}, kernel-allocated fallback if busy)`).option(`-H, --host <host>`,"UI host. Default: two-socket loopback bind (`[::1]` + `127.0.0.1`) so cross-family collisions fail loud. Pass an explicit host (e.g. `127.0.0.1`, `0.0.0.0`) to bind a single socket on that host.").action(async t=>{let{dim:n}=await import(`./colors-CmkIIbww.mjs`),{UiLockCollisionError:r}=await import(`./dist-tv3SH76A.mjs`),{resolveLockDir:i}=await import(`./dist-tv3SH76A.mjs`),a=e(),o=t.host,s;try{s=Fi(t.port,process.env.PORT)}catch(e){console.error(e instanceof Error?e.message:String(e)),process.exitCode=1;return}let c=s.port;try{let e=await Ni({config:a,cwd:process.cwd(),port:c,fallbackToKernel:s.fallbackToKernel,host:o}),t=o===void 0||o===`::`||o===`0.0.0.0`?`localhost`:o;console.log(`${n(`[ui]`)} listening on http://${t}:${e.port}`);let r=!1,i=t=>{if(r)return;r=!0,console.log(n(`\n[ui] Shutting down (${t})`)),e.detachSafetyNet();let i=()=>{try{e.release()}finally{process.exit(process.exitCode??0)}};e.drainUpgradeSockets(),Mi(e.httpServers).then(i,i),setTimeout(i,2e3).unref()};process.once(`SIGINT`,()=>i(`SIGINT`)),process.once(`SIGTERM`,()=>i(`SIGTERM`));return}catch(e){if(!(e instanceof r))throw e;let t=i(process.cwd()),a=o??`localhost`,s;try{s=await Ii({requestedPort:c,host:a,lockDir:t})}catch(e){console.error(e instanceof Error?e.message:String(e)),process.exit(1)}if(s.mode===`already-running`){if(console.log(`UI already running at http://${a}:${s.port}`),Ri(process)){await new Promise(e=>{let t=t=>{console.log(n(`\n[ui-keepalive] Shutting down (${t})`)),e()};process.once(`SIGINT`,()=>t(`SIGINT`)),process.once(`SIGTERM`,()=>t(`SIGTERM`))});return}process.exit(0)}console.log(`UI running at http://${a}:${s.upstreamPort}; acting as HTTP proxy on port ${s.handle.port}`);let l=!1,u=e=>{l||(l=!0,console.log(n(`\n[ui-proxy] Shutting down (${e})`)),s.handle.close().finally(()=>process.exit(process.exitCode??0)),setTimeout(()=>process.exit(process.exitCode??0),2e3).unref())};process.once(`SIGINT`,()=>u(`SIGINT`)),process.once(`SIGTERM`,()=>u(`SIGTERM`))}})}function Ri(e){let t=e.stdout.isTTY===!0,n=typeof e.env.PORT==`string`&&e.env.PORT!==``;return!t||n}const zi={allowTrailingComma:!0,disallowComments:!1};function Bi(e,t){return e.error===1&&e.offset===0&&t.charCodeAt(0)===65279}function Vi(e){let t=[],n=_r(e,t,zi);return t.some(t=>!Bi(t,e))||!n||n.type!==`object`?null:n}function Hi(e,t){let n=0;for(let r of e.children??[]){let e=r.children?.[0];e!==void 0&&vr(e)===t&&(n+=1)}return n}function Ui(e,t){S(e,`${JSON.stringify(t,null,2)}\n`)}function Wi(e,t){let n=ti(t);S(e,n.endsWith(`
|
|
289
289
|
`)?n:`${n}\n`)}function Gi(e){let t=(e.match(/\r\n/g)??[]).length;return t===0?!1:t>=(e.match(/\n/g)??[]).length-t}const Ki=10*1024*1024;function qi(e,t){if(e===t)return!0;if(Array.isArray(e)||Array.isArray(t))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((e,n)=>qi(e,t[n]));if(k(e)&&k(t)){let n=Object.keys(e);return n.length===Object.keys(t).length?n.every(n=>Object.hasOwn(t,n)&&qi(e[n],t[n])):!1}return!1}function Ji(e){for(let t of e.split(`
|
|
290
|
-
`)){let e=t.trimStart();if(!(e.length===0||e.length===t.length))return t.charCodeAt(0)===9?{insertSpaces:!1,tabSize:1}:{insertSpaces:!0,tabSize:t.length-e.length}}return{insertSpaces:!0,tabSize:2}}function Yi(e){try{return ge(e).mode&511}catch{return}}function Xi(e,t,n,r){if(!R(e))return Ui(e,
|
|
290
|
+
`)){let e=t.trimStart();if(!(e.length===0||e.length===t.length))return t.charCodeAt(0)===9?{insertSpaces:!1,tabSize:1}:{insertSpaces:!0,tabSize:t.length-e.length}}return{insertSpaces:!0,tabSize:2}}function Yi(e){try{return ge(e).mode&511}catch{return}}function Xi(e,t,n){return t===void 0?[e,n]:[e,t,n]}function Zi(e,t,n,r){let i={[n]:r};return{[e]:t===void 0?i:{[t]:i}}}function Qi(e,t,n){let r=e[t];return n===void 0?r:k(r)?r[n]:void 0}function $i(e,t,n,r,i){if(!R(e))return Ui(e,Zi(t,i,n,r)),{kind:`written`};let a;try{a=z(e,`utf-8`)}catch(e){return Q(`json config read failed`,e),{kind:`declined`,reason:`unparseable`}}if(a.trim()===``)return Ui(e,Zi(t,i,n,r)),{kind:`written`};if(Buffer.byteLength(a,`utf-8`)>Ki)return{kind:`declined`,reason:`oversize`};let o=Vi(a);if(!o)return{kind:`declined`,reason:`unparseable`};if(Hi(o,t)>1)return{kind:`declined`,reason:`duplicate-container`};let s=Qi(vr(o),t,i),c=k(s)?s[n]:void 0,l=c!==void 0;if(l&&qi(c,r))return{kind:`overwritten`};let u=a.charCodeAt(0)===65279,d=u?a.slice(1):a,f=d.includes(`\r
|
|
291
291
|
`)?`\r
|
|
292
292
|
`:`
|
|
293
|
-
`,
|
|
293
|
+
`,p=br(d,Xi(t,i,n),r,{formattingOptions:{...Ji(d),eol:f}}),m=`${u?``:``}${xr(d,p)}`;return m!==a&&S(e,m,{mode:Yi(e)}),{kind:l?`overwritten`:`written`}}function ea(e,t,n,r,i){let a=``;if(R(t))try{a=z(t,`utf-8`)}catch(e){return Q(`toml config read failed`,e),{kind:`declined`,reason:`unparseable`}}let o=a.trim()===``;if(e.backend===`fallback`)return o?(Wi(t,{[n]:{[r]:i}}),{kind:`written`}):{kind:`declined`,reason:`no-native-writer`};let s=a.charCodeAt(0)===65279,c=s?a.slice(1):a,l=Gi(c),u=o||c.endsWith(`
|
|
294
294
|
`),d;try{d=e.upsertEntry(c,r,i)}catch(e){return Q(`upsertEntry failed`,e),{kind:`declined`,reason:`unparseable`}}let f=d.text;u?f.endsWith(`
|
|
295
295
|
`)||(f=`${f}\n`):f=f.replace(/\n+$/,``),l&&(f=f.replace(/\r\n/g,`
|
|
296
296
|
`).replace(/\n/g,`\r
|
|
297
|
-
`));let p=`${s?``:``}${f}`;return p!==a&&S(t,p,{mode:Yi(t)}),{kind:d.existed?`overwritten`:`written`}}const
|
|
298
|
-
`,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
|
|
297
|
+
`));let p=`${s?``:``}${f}`;return p!==a&&S(t,p,{mode:Yi(t)}),{kind:d.existed?`overwritten`:`written`}}const ta=e=>e!==`project`,na=e=>e!==`user`;async function ra(){let e=await Bn({message:`Where should the MCP server be configured?
|
|
298
|
+
`,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 ia(e){return e.mcp===!1?null:e.scope?e.scope:e.isTTY??process.stdout.isTTY?(e.promptFn??ra)():`both`}async function aa(e){return Gn({message:`How do you want to handle OpenKnowledge config files (.ok/, .mcp.json, project skills, launch.json)?`,default:e,choices:[{name:`Share with my team (commit alongside content)`,value:`shared`,description:`OK config gets committed alongside your project content.`},{name:`Local only (keep out of git via .git/info/exclude)`,value:`local-only`,description:"OK config stays on this machine only; teammates do not see it. Safe escape hatch via `ok config-sharing share`."}]})}async function oa(e){if(e.sharing!==void 0)return e.sharing;let t=xn(e.projectRoot)===`local-only`?`local-only`:`shared`;return e.isTTY??process.stdout.isTTY?(e.promptFn??aa)(t):t}var sa=class extends Error{constructor(e){super(e),this.name=`ContentDirError`}};function ca(e,t,n){let r=ue(n,e),i;try{i=ge(r)}catch(e){let t=e.code;throw t===`ENOENT`?new sa(`--content-dir path does not exist: ${r}`):new sa(`--content-dir path is not accessible (${t??`unknown error`}): ${r}`)}if(!i.isDirectory())throw new sa(`--content-dir must be a directory: ${r}`);let a=L(la(t),la(r));if(a.startsWith(`..`)||le(a))throw new sa(`--content-dir must be inside the project root (${t}); got ${r}`);return a===``?`.`:a}function la(e){try{return he(e)}catch{return e}}const ua=`0.0.1`,da=`open-knowledge-ui`,fa=[`-y`,`@inkeep/open-knowledge@latest`,`ui`],pa=`# ok-ui-v1`,ma=`${pa}
|
|
299
299
|
UIPORT="\${PORT:-${ji}}"
|
|
300
300
|
unset PORT
|
|
301
301
|
USER_BUNDLE="$HOME/Applications/OpenKnowledge.app/Contents/Resources/cli/bin/ok.sh"
|
|
@@ -307,11 +307,11 @@ for d in "$HOME/.nvm/versions/node"/*/bin "$HOME/.fnm/node-versions"/*/installat
|
|
|
307
307
|
[ -f "$d/npx" ] && [ -x "$d/npx" ] && exec "$d/npx" -y @inkeep/open-knowledge@latest start --ui-port "$UIPORT"
|
|
308
308
|
done
|
|
309
309
|
echo "OpenKnowledge: install OK Desktop or Node.js 24+, then restart your editor" >&2
|
|
310
|
-
exit 127`;function
|
|
310
|
+
exit 127`;function ha(e,t={}){let n=I(e,`.claude`,`launch.json`),r=t.mode===`dev`?{name:da,runtimeExecutable:`/bin/sh`,runtimeArgs:[`-l`,`-c`,`${pa}
|
|
311
311
|
UIPORT="\${PORT:-${ji}}"
|
|
312
312
|
unset PORT
|
|
313
|
-
exec node "${ne()}" start --ui-port "$UIPORT"`],port:ji,autoPort:!0}:{name:ca,runtimeExecutable:`/bin/sh`,runtimeArgs:[`-l`,`-c`,da],port:ji,autoPort:!0};try{if(O(n,e),!R(n))return pe(F(n),{recursive:!0}),_e(n,`${JSON.stringify({version:sa,configurations:[r]},null,2)}\n`,`utf-8`),{action:`created`,configPath:n};let t=z(n,`utf-8`).trim(),i=t?JSON.parse(t):{};if(!k(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=>k(e)&&e.name===`open-knowledge-ui`);o>=0?a[o]=r:a.push(r);let s={...i,version:i.version??sa,configurations:a};return _e(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 pa(e,t,n){try{return R(e.detectPath?.(t,n)??F(e.configPath(t,n)))}catch{return!1}}function ma(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&&!pa(e,t,r))return{editorId:e.id,label:e.label,action:`skipped-missing`,configPath:o,serverName:a};if(i!==void 0)try{O(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.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),...i===void 0?{}:{configScope:`project`}}}try{pe(F(o),{recursive:!0})}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),...i===void 0?{}:{configScope:`project`}}}let c={action:`written`},l;try{C(`${o}.lock`,()=>{let t=fi(o).writePath;if(pe(F(t),{recursive:!0}),e.format===`toml`){let n=Zi(bi(),t,e.topLevelKey,a,s);c.action=n.kind,n.kind===`declined`&&(c.declineReason=n.reason);return}let n=Xi(t,e.topLevelKey,a,s);c.action=n.kind,n.kind===`declined`&&(c.declineReason=n.reason)},{onWarn:(e,t)=>process.stderr.write(`[ok] ${e} ${JSON.stringify(t)}\n`)})}catch(e){l=e instanceof Error?e:Error(String(e))}return l?{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:l.message,...i===void 0?{}:{configScope:`project`}}:c.action===`declined`?{editorId:e.id,label:e.label,action:`declined`,configPath:o,serverName:a,declineReason:c.declineReason,...i===void 0?{}:{configScope:`project`}}:{editorId:e.id,label:e.label,action:c.action,configPath:o,serverName:a,...i===void 0?{}:{configScope:`project`}}}function ha(e,t){let n=e.projectConfigPath?.(t);if(!(!n||!R(n)))return{editorId:e.id,label:e.label,path:n}}async function ga(e){let t=E(e.editors),n={mode:`published`,skipAvailabilityCheck:!0};return t.map(t=>ma(t,``,n,e.home))}function _a(e,t,n,r){let i=ya(e,t,n,r);return i.kind===`present`?i.entry:null}function va(e,t,n){let r=e[t];if(!k(r))return{kind:`no-entry`};let i=r[n];return k(i)?{kind:`present`,entry:i}:{kind:`no-entry`}}function ya(e,t,n,r){let i;try{i=r??e.configPath(t,n)}catch{return{kind:`absent`}}if(!R(i))return{kind:`absent`};try{if(ge(i).size>Ki)return{kind:`decline`,reason:`oversize`}}catch{return{kind:`decline`,reason:`unparseable`}}let a;try{a=z(i,`utf-8`)}catch{return{kind:`decline`,reason:`unparseable`}}if(a.trim()===``)return{kind:`absent`};let o=e.serverName(t);if(e.format===`toml`){let t;try{t=bi().parseToObject(a)}catch{return{kind:`decline`,reason:`unparseable`}}return va(t,e.topLevelKey,o)}let s=Vi(a);return s?Hi(s,e.topLevelKey)>1?{kind:`decline`,reason:`duplicate-container`}:va(vr(s),e.topLevelKey,o):{kind:`decline`,reason:`unparseable`}}async function ba(e={}){let t=ue(e.cwd??process.cwd()),n=ii(t,{homeDir:e.home}),r=n.projectRoot,i=!R(I(r,`.ok`)),a=n.gitRootPromoted?L(r,t):void 0,o=e.contentDir===void 0?n.defaultContentDir:aa(e.contentDir,r,t);n.ancestorPromoted?console.log(`[ok] Opened existing project at ${r}`):n.gitRootPromoted&&i&&o===`.`&&process.stderr.write(`${M(`[ok] Content scope promoted to the git repo root: ${r}`)}\n Ran in ${a}/, but .ok/ lives at the git root (one .ok/ per git repo),\n so the whole repo is now the content scope. To narrow it, re-run with\n \`ok init --content-dir .\`, or set content.dir: ${a} in .ok/config.yml.\n`);let s={mode:e.devMcp?`dev`:`published`},c=await ee(r),l;try{l=h(r,{contentDir:o})}catch(t){let i=D.claude.configPath(r,e.home);return{projectRoot:r,contentCreated:[],contentUpdated:[],contentSkipped:[],editors:[],projectSkills:[],legacyProjectConfigs:[],didGitInit:c.didInit,rootGitignoreCreated:!1,gitRootPromoted:n.gitRootPromoted,promotedFromDir:a,contentDirRequested:e.contentDir,contentScaffoldFailed:!0,mcpAction:`failed`,mcpPath:i,mcpError:`Content scaffolding failed: ${t instanceof Error?t.message:String(t)}`,sharing:{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:!1}}}let u=l.created.includes(te),d=!1;if(c.didInit)try{d=T(r)===`created`}catch(e){console.warn(`[ok] Skipping .gitignore seed at ${r}: ${e instanceof Error?e.message:String(e)}`)}let f=await ta({scope:e.scope,mcp:e.mcp,isTTY:e.isTTY,promptFn:e.promptFn}),p=e.editors??Ea(r,e.home),m=e.editors??ie.filter(e=>D[e].projectConfigPath!==void 0),g=E(p),_=E(m),v=e.mcp===!1||f===null,b=Array.from(new Map([...g,...v?[]:_].map(e=>[e.id,e])).values()),x=g.filter(t=>pa(t,r,e.home)),S=[],C=[],w=new Set;for(let t of b){if(v){let n=``;try{n=t.configPath(r,e.home)}catch{}S.push({editorId:t.id,label:t.label,action:`skipped-flag`,configPath:n,serverName:t.serverName(r)});continue}if(Qi(f)&&g.includes(t)&&S.push(ma(t,r,s,e.home)),$i(f)&&_.includes(t)&&t.projectConfigPath){let n=t.projectConfigPath(r),i=ma(t,r,s,e.home,n);S.push(i),(i.action===`written`||i.action===`overwritten`)&&w.add(n)}}let ne=new Set;for(let e of _){let t=e.projectSkillPath?.(r);!t||ne.has(t)||(ne.add(t),C.push(re(e,r)))}let O=!v&&f!==null&&$i(f)?_.filter(e=>!e.projectConfigPath).map(e=>e.label):void 0,k=v?[]:x.map(e=>ha(e,r)).filter(e=>e!==void 0).filter(e=>!w.has(e.path)),A=x.some(e=>e.id===`claude`)&&!v?fa(r,s):void 0,j=await(e.installUserSkill??y)({home:e.home}),ae=v?`skipped-flag`:`skipped-missing`,N=S.find(e=>e.editorId===`claude`)??S[0]??{action:ae,configPath:D.claude.configPath(r,e.home)},oe=await xa({projectRoot:r,desiredMode:await ra({sharing:e.sharing,projectRoot:r,isTTY:e.isTTY,promptFn:e.sharingPromptFn}),explicitFlag:e.sharing});return{projectRoot:r,contentCreated:l.created,contentUpdated:l.updated,contentSkipped:l.skipped,editors:S,projectSkills:C,legacyProjectConfigs:k,launchJson:A,skillInstall:j,didGitInit:c.didInit,rootGitignoreCreated:d,gitRootPromoted:n.gitRootPromoted,promotedFromDir:a,contentDir:u?o:void 0,contentDirRequested:e.contentDir,contentScaffoldFailed:!1,mcpAction:N.action,mcpPath:N.configPath,mcpError:`error`in N?N.error:void 0,projectScopeUnsupportedLabels:O,sharing:oe}}async function xa(e){let{projectRoot:t,desiredMode:n,explicitFlag:r}=e,i=xn(t);if(i===`no-git`)return{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:r===`local-only`};let a=vn(t);if(n===`local-only`){let e=yn(t,a);if(e.kind===`refused-tracked`){let t=e;return{kind:`refused-tracked`,tracked:t.tracked,remediation:t.remediation}}return e.kind===`no-exclude`?{kind:`no-exclude`,reason:e.reason,localOnlyRequested:r===`local-only`}:Sa(t,e,`add`)}if(i===`shared`)return{kind:`applied`,mode:`shared`,action:`noop`,appended:[],alreadyPresent:[],removed:[]};let o=bn(t,a);return o.kind===`no-exclude`?{kind:`no-exclude`,reason:o.reason,localOnlyRequested:!1}:Sa(t,o,`remove`)}function Sa(e,t,n){let r=xn(e);return n===`add`?{kind:`applied`,mode:r,action:t.appended.length>0?`added`:`noop`,appended:t.appended,alreadyPresent:t.alreadyPresent,removed:[]}:{kind:`applied`,mode:r,action:`removed`,appended:[],alreadyPresent:[],removed:t.removed}}function Ca(e){switch(e){case`oversize`:return`config too large to edit safely`;case`duplicate-container`:return`duplicate server block`;case`no-native-writer`:return`no format-preserving writer available`;default:return`config not readable`}}function wa(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)?L(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)`),e.rootGitignoreCreated&&n.push(`Seeded .gitignore at ${t}/.gitignore (.DS_Store)`);let c=I(t,`.ok`);if(e.contentCreated.length>0||e.contentUpdated.length>0?(n.push(N(`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(N(`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(N(`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(N(`MCP server configuration:`)),n.push(` No supported editor config directories detected; skipped MCP registration`);else{n.push(N(`MCP server configuration:`));for(let r of e.editors){let i=r.configPath.startsWith(t)?L(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} ${j(`registered`)}${a}${u}`);break;case`overwritten`:n.push(` ${c}${l}${i} ${j(`updated`)}${a}${u}`);break;case`skipped-missing`:n.push(` ${c}${l}${i} config root missing; skipped`);break;case`failed`:n.push(` ${c}${l}${i} ${ae(`FAILED`)}: ${r.error}`);break;case`declined`:n.push(` ${c}${l}${i} left unchanged (${Ca(r.declineReason)})`);break;case`skipped-flag`:break;default:r.action}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(N(`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?L(t,r.path):``;switch(r.action){case`written`:n.push(` ${e}${i}${a} ${j(`installed`)}`);break;case`overwritten`:n.push(` ${e}${i}${a} ${j(`updated`)}`);break;case`skipped-unsupported`:n.push(` ${e}${i}no known project skill surface; skipped`);break;case`failed`:n.push(` ${e}${i}${a} ${ae(`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} ${L(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(N(`User-global skill:`)),e.skillInstall){case`installed`:n.push(` open-knowledge ${j(`installed to detected agent hosts`)} via \`npx skills\``);break;case`skip-current`:n.push(` open-knowledge ${j(`already installed at current version`)}`);break;case`failed`:n.push(` ${M(`open-knowledge install failed — MCP still configured; run manually:`)}`),n.push(` ${M(` npx skills@~1.5.0 add <bundled-path> --agent '*' -g -y --copy`)}`);break}if(e.contentDirRequested!==void 0&&e.contentDir===void 0&&!e.contentScaffoldFailed?(n.push(``),n.push(M(`⚠ --content-dir ${e.contentDirRequested} ignored — .ok/config.yml already exists`)),n.push(` Edit .ok/config.yml → content.dir directly to change the content scope.`)):e.contentDir!==void 0&&e.contentDir!==`.`?(n.push(``),n.push(`Content scope set to ${e.contentDir}/ (content.dir in .ok/config.yml).`)):e.gitRootPromoted&&e.contentDir===`.`&&e.contentDirRequested===void 0&&(n.push(``),n.push(M(`⚠ Content scope promoted to the git repo root`)),n.push(` .ok/ was initialized at ${t} because it contains a .git folder (one .ok/ per git repo),`),n.push(` not the sub-folder you ran \`ok init\` in${e.promotedFromDir?` (${e.promotedFromDir})`:``}. The whole repo is now the content scope.`),e.promotedFromDir&&(n.push(" To scope to just that sub-folder, re-run `ok init --content-dir .` from there, or set"),n.push(` content.dir: ${e.promotedFromDir} in .ok/config.yml.`))),e.preview?(n.push(``),n.push(oe(e.preview,t))):e.previewWarning&&(n.push(``),n.push(`Content preview unavailable: ${e.previewWarning}`)),n.push(``),n.push(...ka(e.sharing,t)),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(`${j(`✓`)} ${N(`Next steps:`)}`),n.push(` 1. Open your editor (${A(r.join(` / `))})`),n.push(` 2. Approve the MCP server when prompted`),n.push(` 3. (Optional) scaffold the starter knowledge-base structure:`),n.push(` - ${A(`ok seed`)} — empty repo, Karpathy 3-layer`),n.push(` - ${A(`mcp__open-knowledge__discover`)} — existing repo, extract conventions`),n.push(` 4. Use the MCP workflow tools as you build the wiki:`),n.push(` - ${A(`mcp__open-knowledge__ingest`)} — capture an external source`),n.push(` - ${A(`mcp__open-knowledge__research`)} — gather sources and write findings`),n.push(` - ${A(`mcp__open-knowledge__consolidate`)} — promote research to canonical articles`)}return n.join(`
|
|
314
|
-
`)}function
|
|
315
|
-
`),e.stderr&&process.stderr.write(`${e.stderr.trim()}\n`),process.exitCode=1;return}throw e}let i=r.contentDir??`.`,a=null,{loadConfig:o}=await import(`./loader-
|
|
316
|
-
`))n.push(t.length>0?` ${t}`:``);return n.push(` Re-run ${A(`ok config-sharing unshare`)} after resolving to complete the switch.`),n;case`no-exclude`:if(e.localOnlyRequested)n.push(M(`Sharing mode: --local-only requested but no git repo found — option ignored`)),n.push(` Run ${A(`git init`)} (or open this folder via OK Desktop, which can scaffold a repo) and then ${A(`ok config-sharing unshare`)}.`);else if(e.reason===`no-git`)return[];else n.push(M(`Sharing mode unavailable: ${e.reason}.`));return n}}export{_n as A,yn as C,Cn as D,vn as E,W as F,Ie as I,ft as M,lt as N,xn as O,ct as P,ii as S,Sn as T,
|
|
317
|
-
//# sourceMappingURL=init-
|
|
313
|
+
exec node "${ne()}" start --ui-port "$UIPORT"`],port:ji,autoPort:!0}:{name:da,runtimeExecutable:`/bin/sh`,runtimeArgs:[`-l`,`-c`,ma],port:ji,autoPort:!0};try{if(O(n,e),!R(n))return pe(F(n),{recursive:!0}),_e(n,`${JSON.stringify({version:ua,configurations:[r]},null,2)}\n`,`utf-8`),{action:`created`,configPath:n};let t=z(n,`utf-8`).trim(),i=t?JSON.parse(t):{};if(!k(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=>k(e)&&e.name===`open-knowledge-ui`);o>=0?a[o]=r:a.push(r);let s={...i,version:i.version??ua,configurations:a};return _e(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 ga(e,t,n){try{return R(e.detectPath?.(t,n)??F(e.configPath(t,n)))}catch{return!1}}function _a(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)}}let s=!n.skipAvailabilityCheck||e.offerOnlyWhenDetected===!0;if(!i&&s&&!ga(e,t,r))return{editorId:e.id,label:e.label,action:`skipped-missing`,configPath:o,serverName:a};if(i!==void 0)try{O(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 c;try{c=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),...i===void 0?{}:{configScope:`project`}}}try{pe(F(o),{recursive:!0})}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),...i===void 0?{}:{configScope:`project`}}}let l={action:`written`},u;try{C(`${o}.lock`,()=>{let t=fi(o).writePath;if(pe(F(t),{recursive:!0}),e.format===`toml`){let n=ea(bi(),t,e.topLevelKey,a,c);l.action=n.kind,n.kind===`declined`&&(l.declineReason=n.reason);return}let n=$i(t,e.topLevelKey,a,c,e.serverMapSubKey);l.action=n.kind,n.kind===`declined`&&(l.declineReason=n.reason)},{onWarn:(e,t)=>process.stderr.write(`[ok] ${e} ${JSON.stringify(t)}\n`)})}catch(e){u=e instanceof Error?e:Error(String(e))}return u?{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:u.message,...i===void 0?{}:{configScope:`project`}}:l.action===`declined`?{editorId:e.id,label:e.label,action:`declined`,configPath:o,serverName:a,declineReason:l.declineReason,...i===void 0?{}:{configScope:`project`}}:{editorId:e.id,label:e.label,action:l.action,configPath:o,serverName:a,...i===void 0?{}:{configScope:`project`}}}function va(e,t){let n=e.projectConfigPath?.(t);if(!(!n||!R(n)))return{editorId:e.id,label:e.label,path:n}}async function ya(e){let t=E(e.editors),n={mode:`published`,skipAvailabilityCheck:!0};return t.map(t=>_a(t,``,n,e.home))}function ba(e,t,n,r){let i=Sa(e,t,n,r);return i.kind===`present`?i.entry:null}function xa(e,t,n,r){let i=Qi(e,t,r);if(!k(i))return{kind:`no-entry`};let a=i[n];return k(a)?{kind:`present`,entry:a}:{kind:`no-entry`}}function Sa(e,t,n,r){let i;try{i=r??e.configPath(t,n)}catch{return{kind:`absent`}}if(!R(i))return{kind:`absent`};try{if(ge(i).size>Ki)return{kind:`decline`,reason:`oversize`}}catch{return{kind:`decline`,reason:`unparseable`}}let a;try{a=z(i,`utf-8`)}catch{return{kind:`decline`,reason:`unparseable`}}if(a.trim()===``)return{kind:`absent`};let o=e.serverName(t);if(e.format===`toml`){let t;try{t=bi().parseToObject(a)}catch{return{kind:`decline`,reason:`unparseable`}}return xa(t,e.topLevelKey,o,e.serverMapSubKey)}let s=Vi(a);return s?Hi(s,e.topLevelKey)>1?{kind:`decline`,reason:`duplicate-container`}:xa(vr(s),e.topLevelKey,o,e.serverMapSubKey):{kind:`decline`,reason:`unparseable`}}async function Ca(e={}){let t=ue(e.cwd??process.cwd()),n=ii(t,{homeDir:e.home}),r=n.projectRoot,i=!R(I(r,`.ok`)),a=n.gitRootPromoted?L(r,t):void 0,o=e.contentDir===void 0?n.defaultContentDir:ca(e.contentDir,r,t);n.ancestorPromoted?console.log(`[ok] Opened existing project at ${r}`):n.gitRootPromoted&&i&&o===`.`&&process.stderr.write(`${M(`[ok] Content scope promoted to the git repo root: ${r}`)}\n Ran in ${a}/, but .ok/ lives at the git root (one .ok/ per git repo),\n so the whole repo is now the content scope. To narrow it, re-run with\n \`ok init --content-dir .\`, or set content.dir: ${a} in .ok/config.yml.\n`);let s={mode:e.devMcp?`dev`:`published`},c=await ee(r),l;try{l=h(r,{contentDir:o})}catch(t){let i=D.claude.configPath(r,e.home);return{projectRoot:r,contentCreated:[],contentUpdated:[],contentSkipped:[],editors:[],projectSkills:[],legacyProjectConfigs:[],didGitInit:c.didInit,rootGitignoreCreated:!1,gitRootPromoted:n.gitRootPromoted,promotedFromDir:a,contentDirRequested:e.contentDir,contentScaffoldFailed:!0,mcpAction:`failed`,mcpPath:i,mcpError:`Content scaffolding failed: ${t instanceof Error?t.message:String(t)}`,sharing:{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:!1}}}let u=l.created.includes(te),d=!1;if(c.didInit)try{d=T(r)===`created`}catch(e){console.warn(`[ok] Skipping .gitignore seed at ${r}: ${e instanceof Error?e.message:String(e)}`)}let f=await ia({scope:e.scope,mcp:e.mcp,isTTY:e.isTTY,promptFn:e.promptFn}),p=e.editors??ka(r,e.home),m=e.editors??ie.filter(e=>D[e].projectConfigPath!==void 0),g=E(p),_=E(m),v=e.mcp===!1||f===null,b=Array.from(new Map([...g,...v?[]:_].map(e=>[e.id,e])).values()),x=g.filter(t=>ga(t,r,e.home)),S=[],C=[],w=new Set;for(let t of b){if(v){let n=``;try{n=t.configPath(r,e.home)}catch{}S.push({editorId:t.id,label:t.label,action:`skipped-flag`,configPath:n,serverName:t.serverName(r)});continue}if(ta(f)&&g.includes(t)&&S.push(_a(t,r,s,e.home)),na(f)&&_.includes(t)&&t.projectConfigPath){let n=t.projectConfigPath(r),i=_a(t,r,s,e.home,n);S.push(i),(i.action===`written`||i.action===`overwritten`)&&w.add(n)}}let ne=new Set;for(let e of _){let t=e.projectSkillPath?.(r);!t||ne.has(t)||(ne.add(t),C.push(re(e,r)))}let O=!v&&f!==null&&na(f)?_.filter(e=>!e.projectConfigPath).map(e=>e.label):void 0,k=v?[]:x.map(e=>va(e,r)).filter(e=>e!==void 0).filter(e=>!w.has(e.path)),A=x.some(e=>e.id===`claude`)&&!v?ha(r,s):void 0,j=await(e.installUserSkill??y)({home:e.home}),ae=v?`skipped-flag`:`skipped-missing`,N=S.find(e=>e.editorId===`claude`)??S[0]??{action:ae,configPath:D.claude.configPath(r,e.home)},oe=await wa({projectRoot:r,desiredMode:await oa({sharing:e.sharing,projectRoot:r,isTTY:e.isTTY,promptFn:e.sharingPromptFn}),explicitFlag:e.sharing});return{projectRoot:r,contentCreated:l.created,contentUpdated:l.updated,contentSkipped:l.skipped,editors:S,projectSkills:C,legacyProjectConfigs:k,launchJson:A,skillInstall:j,didGitInit:c.didInit,rootGitignoreCreated:d,gitRootPromoted:n.gitRootPromoted,promotedFromDir:a,contentDir:u?o:void 0,contentDirRequested:e.contentDir,contentScaffoldFailed:!1,mcpAction:N.action,mcpPath:N.configPath,mcpError:`error`in N?N.error:void 0,projectScopeUnsupportedLabels:O,sharing:oe}}async function wa(e){let{projectRoot:t,desiredMode:n,explicitFlag:r}=e,i=xn(t);if(i===`no-git`)return{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:r===`local-only`};let a=vn(t);if(n===`local-only`){let e=yn(t,a);if(e.kind===`refused-tracked`){let t=e;return{kind:`refused-tracked`,tracked:t.tracked,remediation:t.remediation}}return e.kind===`no-exclude`?{kind:`no-exclude`,reason:e.reason,localOnlyRequested:r===`local-only`}:Ta(t,e,`add`)}if(i===`shared`)return{kind:`applied`,mode:`shared`,action:`noop`,appended:[],alreadyPresent:[],removed:[]};let o=bn(t,a);return o.kind===`no-exclude`?{kind:`no-exclude`,reason:o.reason,localOnlyRequested:!1}:Ta(t,o,`remove`)}function Ta(e,t,n){let r=xn(e);return n===`add`?{kind:`applied`,mode:r,action:t.appended.length>0?`added`:`noop`,appended:t.appended,alreadyPresent:t.alreadyPresent,removed:[]}:{kind:`applied`,mode:r,action:`removed`,appended:[],alreadyPresent:[],removed:t.removed}}function Ea(e){switch(e){case`oversize`:return`config too large to edit safely`;case`duplicate-container`:return`duplicate server block`;case`no-native-writer`:return`no format-preserving writer available`;default:return`config not readable`}}function Da(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)?L(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)`),e.rootGitignoreCreated&&n.push(`Seeded .gitignore at ${t}/.gitignore (.DS_Store)`);let c=I(t,`.ok`);if(e.contentCreated.length>0||e.contentUpdated.length>0?(n.push(N(`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(N(`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(N(`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(N(`MCP server configuration:`)),n.push(` No supported editor config directories detected; skipped MCP registration`);else{n.push(N(`MCP server configuration:`));for(let r of e.editors){let i=r.configPath.startsWith(t)?L(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} ${j(`registered`)}${a}${u}`);break;case`overwritten`:n.push(` ${c}${l}${i} ${j(`updated`)}${a}${u}`);break;case`skipped-missing`:n.push(` ${c}${l}${i} config root missing; skipped`);break;case`failed`:n.push(` ${c}${l}${i} ${ae(`FAILED`)}: ${r.error}`);break;case`declined`:n.push(` ${c}${l}${i} left unchanged (${Ea(r.declineReason)})`);break;case`skipped-flag`:break;default:r.action}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(N(`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?L(t,r.path):``;switch(r.action){case`written`:n.push(` ${e}${i}${a} ${j(`installed`)}`);break;case`overwritten`:n.push(` ${e}${i}${a} ${j(`updated`)}`);break;case`skipped-unsupported`:n.push(` ${e}${i}no known project skill surface; skipped`);break;case`failed`:n.push(` ${e}${i}${a} ${ae(`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} ${L(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(N(`User-global skill:`)),e.skillInstall){case`installed`:n.push(` open-knowledge ${j(`installed to detected agent hosts`)} via \`npx skills\``);break;case`skip-current`:n.push(` open-knowledge ${j(`already installed at current version`)}`);break;case`failed`:n.push(` ${M(`open-knowledge install failed — MCP still configured; run manually:`)}`),n.push(` ${M(` npx skills@~1.5.0 add <bundled-path> --agent '*' -g -y --copy`)}`);break}if(e.contentDirRequested!==void 0&&e.contentDir===void 0&&!e.contentScaffoldFailed?(n.push(``),n.push(M(`⚠ --content-dir ${e.contentDirRequested} ignored — .ok/config.yml already exists`)),n.push(` Edit .ok/config.yml → content.dir directly to change the content scope.`)):e.contentDir!==void 0&&e.contentDir!==`.`?(n.push(``),n.push(`Content scope set to ${e.contentDir}/ (content.dir in .ok/config.yml).`)):e.gitRootPromoted&&e.contentDir===`.`&&e.contentDirRequested===void 0&&(n.push(``),n.push(M(`⚠ Content scope promoted to the git repo root`)),n.push(` .ok/ was initialized at ${t} because it contains a .git folder (one .ok/ per git repo),`),n.push(` not the sub-folder you ran \`ok init\` in${e.promotedFromDir?` (${e.promotedFromDir})`:``}. The whole repo is now the content scope.`),e.promotedFromDir&&(n.push(" To scope to just that sub-folder, re-run `ok init --content-dir .` from there, or set"),n.push(` content.dir: ${e.promotedFromDir} in .ok/config.yml.`))),e.preview?(n.push(``),n.push(oe(e.preview,t))):e.previewWarning&&(n.push(``),n.push(`Content preview unavailable: ${e.previewWarning}`)),n.push(``),n.push(...Ma(e.sharing,t)),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(`${j(`✓`)} ${N(`Next steps:`)}`),n.push(` 1. Open your editor (${A(r.join(` / `))})`),n.push(` 2. Approve the MCP server when prompted`),n.push(` 3. (Optional) scaffold the starter knowledge-base structure:`),n.push(` - ${A(`ok seed`)} — empty repo, Karpathy 3-layer`),n.push(` - ${A(`mcp__open-knowledge__discover`)} — existing repo, extract conventions`),n.push(` 4. Use the MCP workflow tools as you build the wiki:`),n.push(` - ${A(`mcp__open-knowledge__ingest`)} — capture an external source`),n.push(` - ${A(`mcp__open-knowledge__research`)} — gather sources and write findings`),n.push(` - ${A(`mcp__open-knowledge__consolidate`)} — promote research to canonical articles`)}return n.join(`
|
|
314
|
+
`)}function Oa(e,t){return{projectRoot:e.projectRoot,gitRootPromoted:e.gitRootPromoted,promotedFromDir:e.promotedFromDir??null,contentDir:t.contentDir,contentDirRequested:e.contentDirRequested??null,contentDirApplied:e.contentDir!==void 0,contentFileCount:t.contentFileCount,previewError:e.previewWarning??null,didGitInit:e.didGitInit,mcpAction:e.mcpAction,editors:e.editors.map(e=>({editorId:e.editorId,label:e.label,action:e.action,configPath:e.configPath,scope:e.configScope===`project`?`project`:`user`}))}}function ka(e,t){let n=[];for(let r of ie)ga(D[r],e,t)&&n.push(r);return n}function Aa(){let e={log:console.log,info:console.info,debug:console.debug},t=(...e)=>{process.stderr.write(`${e.map(e=>typeof e==`string`?e:xe(e)).join(` `)}\n`)};return console.log=t,console.info=t,console.debug=t,()=>{console.log=e.log,console.info=e.info,console.debug=e.debug}}function ja(){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`).option(`--content-dir <dir>`,`Limit content to <dir> instead of the whole project. <dir> is interpreted relative to your current directory (e.g. "." = the folder you run the command in), then saved to .ok/config.yml as content.dir.`).option(`--json`,`Emit a structured JSON summary to stdout (diagnostics stay on stderr)`).addOption(new r(`--scope <scope>`,`Write MCP config at user level, project level, or both`).choices([`user`,`project`,`both`])).addOption(new r(`--shared`,`Commit OK config alongside content (the default for fresh repos)`).conflicts(`localOnly`)).addOption(new r(`--local-only`,`Keep OK config out of git via .git/info/exclude (per-clone, not committed)`).conflicts(`shared`)).action(async e=>{let t=process.cwd(),n=e.shared?`shared`:e.localOnly?`local-only`:void 0,r=e.json?Aa():null;try{let r;try{r=await Ca({cwd:t,mcp:e.mcp,devMcp:e.devMcp,scope:e.scope,sharing:n,contentDir:e.contentDir})}catch(e){if(e instanceof sa){process.stderr.write(`${e.message}\n`),process.exitCode=64;return}if(e instanceof m||e instanceof _){process.stderr.write(`${e.message}\n`),process.exitCode=78;return}if(e instanceof g){process.stderr.write(`open-knowledge could not initialize a git repo for this project. Re-run, or run 'git init' yourself in the project folder.
|
|
315
|
+
`),e.stderr&&process.stderr.write(`${e.stderr.trim()}\n`),process.exitCode=1;return}throw e}let i=r.contentDir??`.`,a=null,{loadConfig:o}=await import(`./loader-p811lc-J.mjs`),{resolveContentDir:s}=await import(`./dist-tv3SH76A.mjs`),c;try{c=o(r.projectRoot).config,i=c.content.dir}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}if(c)try{let{previewContent:e}=await import(`./preview-BcZ2y0Ew.mjs`),t=s(c,r.projectRoot);r.preview=e({projectDir:r.projectRoot,contentDir:t}),a=r.preview.totalCount}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}e.json?process.stdout.write(`${JSON.stringify(Oa(r,{contentDir:i,contentFileCount:a}),null,2)}\n`):process.stdout.write(`${Da(r,r.projectRoot)}\n`),(r.editors.some(e=>e.action===`failed`)||r.mcpAction===`failed`)&&(process.exitCode=1)}finally{r?.()}})}function Ma(e,t){let n=[];switch(e.kind){case`applied`:return n.push(N(`Sharing mode:`)),e.mode===`local-only`?e.action===`added`?n.push(` ${j(`local-only`)} — appended ${e.appended.length} path(s) to ${N(`${t}/.git/info/exclude`)} (per-clone, not committed).`):e.action===`noop`&&e.alreadyPresent.length>0?n.push(` ${j(`local-only`)} — already excluded; nothing to do.`):n.push(` ${j(`local-only`)}`):e.action===`removed`?n.push(` ${j(`shared`)} — removed OK paths from ${N(`${t}/.git/info/exclude`)}; commit the files to share with teammates.`):n.push(` ${j(`shared`)} — OK config will be committed alongside content.`),n;case`refused-tracked`:n.push(M(`Sharing mode: switch to local-only deferred`));for(let t of e.remediation.split(`
|
|
316
|
+
`))n.push(t.length>0?` ${t}`:``);return n.push(` Re-run ${A(`ok config-sharing unshare`)} after resolving to complete the switch.`),n;case`no-exclude`:if(e.localOnlyRequested)n.push(M(`Sharing mode: --local-only requested but no git repo found — option ignored`)),n.push(` Run ${A(`git init`)} (or open this folder via OK Desktop, which can scaffold a repo) and then ${A(`ok config-sharing unshare`)}.`);else if(e.reason===`no-git`)return[];else n.push(M(`Sharing mode unavailable: ${e.reason}.`));return n}}export{_n as A,yn as C,Cn as D,vn as E,W as F,Ie as I,ft as M,lt as N,xn as O,ct as P,ii as S,Sn as T,Ca as _,ma as a,ya as b,Sa as c,Ma as d,ja as f,oa as g,ca as h,pa as i,rn as j,bn as k,ka as l,ia as m,da as n,wa as o,ba as p,fa as r,Oa as s,sa as t,Da as u,ha as v,wn as w,Li as x,_a as y};
|
|
317
|
+
//# sourceMappingURL=init-BFySg4cK.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e}from"./init-BFySg4cK.mjs";export{e as runInit};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Ba as e,Fo as t,Va as n,Wa as r}from"./server-lock-CN2YHwpP-
|
|
1
|
+
import{Ba as e,Fo as t,Va as n,Wa as r}from"./server-lock-CN2YHwpP-CIPpd1-K.mjs";import{_ as i,ma as a,pa as o}from"./dist-CwoT-vvz.mjs";import{t as s}from"./constants-C5Kh99hH.mjs";import{t as c}from"./is-object-Cg453afR.mjs";import{resolve as l}from"node:path";import{existsSync as u,readFileSync as d}from"node:fs";import{realpath as f}from"node:fs/promises";async function p(e){let t=l(e);try{return await f(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 m=t();function h(e,t){let n={...e};for(let r of Object.keys(t)){let i=e[r],a=t[r];c(a)&&c(i)?n[r]=h(i,a):a!==void 0&&(n[r]=a)}return n}function g(e){if(!u(e))return{value:null,path:e,source:null,doc:null};let t;try{t=d(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,m.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 c(r)?{value:r,path:e,source:t,doc:n}:{value:null,path:e,source:t,doc:n}}function _(e,t){return e.map(e=>{let n=e.path.map(e=>typeof e==`symbol`?String(e):e),i={path:n,message:e.message,issueCode:e.code};if(t.doc!==null&&t.source!==null){let e=r({file:t.path,source:t.source,doc:t.doc,path:n});if(e!==void 0)return{...i,source:e}}return i})}function v(t){let r=t??process.cwd(),c=[],u=a(`user`,r),d=o({absPath:u}),f={};d.valid&&d.source!==void 0?(f=h(f,d.value),c.push(u)):d.valid;let p=l(r,`.ok`,s),m=g(p);if(m.value!==null){let t=e({value:m.value,file:m.path,source:m.source,doc:m.doc});if(t.length>0)throw Error(t.map(n).join(`
|
|
2
2
|
|
|
3
3
|
`));f=h(f,m.value),c.push(p)}let v=i.safeParse(f);if(!v.success){let e={code:`SCHEMA_INVALID`,issues:_(v.error.issues,m)};throw Error(n(e))}return{config:v.data,sources:c}}function y(e){let t=e.cacheMs??1e3,n=e.loadConfigFn??v,r=new Map,i=new Map,a=p(e.startupCwd);return async o=>{let s=await p(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{v as n,y as t};
|
|
4
|
-
//# sourceMappingURL=loader-
|
|
4
|
+
//# sourceMappingURL=loader-kYfLQbUq.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./loader-kYfLQbUq.mjs";export{e as loadConfig};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./preview-DcLHmjqA.mjs";export{t as formatPreviewBlock,e as previewContent};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{Yt as e}from"./dist-
|
|
1
|
+
import{Yt as e}from"./dist-CwoT-vvz.mjs";import"./constants-C5Kh99hH.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-DcLHmjqA.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ActivityPanelDiffView-TEHR9A38.js","./chunk-CFjPhJqf.js","./dist-CQw2y-s3.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{Cr as a,Or as o,n as s,pt as c,r as l}from"./DocumentContext-BiJ-_xlQ.js";import{n as u,r as d}from"./dist-CQw2y-s3.js";import{a as f,i as p,rt as m}from"./dist-GmorMgHF.js";import{t as h,u as g}from"./button-DGf25ccp.js";import{a as _,c as v,i as y,o as b,s as x,t as S}from"./dialog-CvKVTeQa.js";import{t as C}from"./chevron-down-CzFz_0zd.js";import{t as w}from"./chevron-right-jyIhGBkw.js";import{i as T}from"./prop-types-C_2IQGCC.js";import{d as E}from"./config-context-DhhN0rlf.js";import{c as D,i as O,r as k,t as A}from"./agent-presence-BRmBPq78.js";import{n as j}from"./dist-KBKQayVB.js";import{o as M,u as N}from"./documents-events-CSQluyCM.js";import{i as P,n as ee,t as te}from"./tooltip-DiL7DBhT.js";import{o as ne}from"./navigation-targets-CXdtVjj4.js";var re=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`}]]),F=i(),I=e(n(),1),ie=500,L=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 c(`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 c(`/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 c(`/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),a;try{a=await i.json()}catch(e){throw new c(`Could not parse /api/agent-burst-diff response.`,{cause:e,status:i.status})}if(!i.ok){let e=m.safeParse(a);throw e.success?Error(e.data.title):new c(`/api/agent-burst-diff returned a non-RFC-9457 error response.`,{cause:e.error,status:i.status})}let o=f.safeParse(a);if(!o.success)throw new c(`/api/agent-burst-diff returned a body that did not match AgentBurstDiffSuccessSchema.`,{cause:o.error,status:i.status});return o.data.diff}function se(e){let t=(0,F.c)(23),{systemProvider:n}=s(),[r,i]=(0,I.useState)(null),[a,o]=(0,I.useState)(`idle`),[c,l]=(0,I.useState)(null),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=new O(L),t[0]=u):u=t[0];let d=(0,I.useRef)(u),f=(0,I.useRef)(0),p;t[1]===n?p=t[2]:(p=e=>{let t=f.current+=1;o(`loading`),l(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&&(l(e instanceof Error?e.message:String(e)),o(`error`))})},t[1]=n,t[2]=p);let m=p,h;t[3]!==e||t[4]!==m?(h=()=>{if(!e){f.current+=1,i(null),o(`idle`),l(null),d.current.clear();return}d.current.clear(),m(e);let t=null,n=M(n=>{n.includes(`session-activity`)&&(t&&clearTimeout(t),t=setTimeout(()=>{t=null,m(e)},ie))});return()=>{t&&clearTimeout(t),n()}},t[3]=e,t[4]=m,t[5]=h):h=t[5];let g;t[6]===e?g=t[7]:(g=[e],t[6]=e,t[7]=g),(0,I.useEffect)(h,g);let _,v;t[8]!==e||t[9]!==n?(_=()=>{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)}},v=[e,n],t[8]=e,t[9]=n,t[10]=_,t[11]=v):(_=t[10],v=t[11]),(0,I.useEffect)(_,v);let y;t[12]===e?y=t[13]:(y=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]=y);let b=y,x;t[14]!==e||t[15]!==m?(x=()=>{e&&m(e)},t[14]=e,t[15]=m,t[16]=x):x=t[16];let S=x,C;return t[17]!==r||t[18]!==c||t[19]!==b||t[20]!==S||t[21]!==a?(C={data:r,status:a,error:c,reload:S,fetchBurstDiff:b},t[17]=r,t[18]=c,t[19]=b,t[20]=S,t[21]=a,t[22]=C):C=t[22],C}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(!A(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 R=r(),ue=(0,I.lazy)(async()=>({default:(await t(()=>import(`./ActivityPanelDiffView-TEHR9A38.js`),__vite__mapDeps([0,1,2,3,4]),import.meta.url)).ActivityPanelDiffView}));function de(e,t){let n=Math.max(0,t-e);if(n<6e4){let e=Math.round(n/1e3);return N._({id:`pbwTg6`,values:{seconds:e}})}if(n<36e5){let e=Math.round(n/6e4);return N._({id:`_rP3HI`,values:{minutes:e}})}return new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function fe(e){let t=(0,F.c)(42),{burst:n,docName:r,fetchBurstDiff:i}=e,{_:a}=d(),[o,s]=(0,I.useState)(!1),[c,l]=(0,I.useState)(null),[f,p]=(0,I.useState)(null),[m,h]=(0,I.useState)(!1),[g,_]=(0,I.useState)(z),v,y;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(v=()=>{let e=setInterval(()=>_(Date.now()),3e4);return()=>clearInterval(e)},y=[],t[0]=v,t[1]=y):(v=t[0],y=t[1]),(0,I.useEffect)(v,y);let b;t[2]!==n.stackIndex||t[3]!==c||t[4]!==r||t[5]!==o||t[6]!==i||t[7]!==m?(b=()=>{let e=!o;s(e),e&&c===null&&!m&&(h(!0),p(null),i(r,n.stackIndex).then(e=>{l(e),h(!1)}).catch(e=>{p(e instanceof Error?e.message:String(e)),h(!1)}))},t[2]=n.stackIndex,t[3]=c,t[4]=r,t[5]=o,t[6]=i,t[7]=m,t[8]=b):b=t[8];let x=b,S=n.stackIndex+1,T;t[9]!==a||t[10]!==S||t[11]!==o?(T=a(o?{id:`-i7ik4`,values:{burstNumber:S}}:{id:`EeRZnZ`,values:{burstNumber:S}}),t[9]=a,t[10]=S,t[11]=o,t[12]=T):T=t[12];let E;t[13]===o?E=t[14]:(E=o?(0,R.jsx)(C,{className:`size-3 shrink-0`,"aria-hidden":`true`}):(0,R.jsx)(w,{className:`size-3 shrink-0`,"aria-hidden":`true`}),t[13]=o,t[14]=E);let D;t[15]!==n.ts||t[16]!==g?(D=de(n.ts,g),t[15]=n.ts,t[16]=g,t[17]=D):D=t[17];let O;t[18]===D?O=t[19]:(O=(0,R.jsx)(`span`,{className:`font-mono`,children:D}),t[18]=D,t[19]=O);let k;t[20]===n.additions?k=t[21]:(k=(0,R.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additions]}),t[20]=n.additions,t[21]=k);let A;t[22]===n.deletions?A=t[23]:(A=(0,R.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletions]}),t[22]=n.deletions,t[23]=A);let j;t[24]!==k||t[25]!==A?(j=(0,R.jsxs)(`span`,{className:`ml-auto font-mono`,children:[k,` `,A]}),t[24]=k,t[25]=A,t[26]=j):j=t[26];let M;t[27]!==o||t[28]!==j||t[29]!==T||t[30]!==E||t[31]!==O||t[32]!==x?(M=(0,R.jsxs)(`button`,{type:`button`,onClick:x,className:`flex w-full items-center gap-2 px-4 py-1.5 text-xs text-muted-foreground hover:bg-muted/40`,"aria-expanded":o,"aria-label":T,children:[E,O,j]}),t[27]=o,t[28]=j,t[29]=T,t[30]=E,t[31]=O,t[32]=x,t[33]=M):M=t[33];let N;t[34]!==c||t[35]!==o||t[36]!==f||t[37]!==m?(N=o?(0,R.jsx)(`div`,{className:`bg-muted/20`,children:m?(0,R.jsx)(`div`,{className:`px-4 py-2 text-xs text-muted-foreground italic`,children:(0,R.jsx)(u,{id:`38foVZ`})}):f?(0,R.jsx)(`div`,{className:`px-4 py-2 text-xs text-destructive`,children:(0,R.jsx)(u,{id:`pmKdif`,values:{loadError:f}})}):c===null?(0,R.jsx)(`div`,{className:`px-4 py-2 text-xs text-muted-foreground italic`,children:(0,R.jsx)(u,{id:`iNFKkm`})}):(0,R.jsx)(I.Suspense,{fallback:(0,R.jsx)(`div`,{className:`px-4 py-2 text-xs text-muted-foreground italic`,children:(0,R.jsx)(u,{id:`38foVZ`})}),children:(0,R.jsx)(ue,{diff:c})})}):null,t[34]=c,t[35]=o,t[36]=f,t[37]=m,t[38]=N):N=t[38];let P;return t[39]!==M||t[40]!==N?(P=(0,R.jsxs)(`div`,{className:`border-t border-border/50`,children:[M,N]}),t[39]=M,t[40]=N,t[41]=P):P=t[41],P}function z(){return Date.now()}function pe(e,t){let n=Math.max(0,t-e);if(n<6e4){let e=Math.round(n/1e3);return N._({id:`pbwTg6`,values:{seconds:e}})}if(n<36e5){let e=Math.round(n/6e4);return N._({id:`_rP3HI`,values:{minutes:e}})}let r=Math.round(n/36e5);return N._({id:`nYeBmY`,values:{hours:r}})}function B(e){let t=(0,F.c)(118),{file:n,sessionAlive:r,isWriting:i,onNavigate:a,onUndoLast:o,onUndoAll:s,fetchBurstDiff:c}=e,{_:l}=d(),{docName:f}=n,[p,m]=(0,I.useState)(!1),[g,T]=(0,I.useState)(!1),[E,O]=(0,I.useState)(!1),[k,A]=(0,I.useState)(he),j,M;if(t[0]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>{let e=setInterval(()=>A(Date.now()),3e4);return()=>clearInterval(e)},M=[],t[0]=j,t[1]=M):(j=t[0],M=t[1]),(0,I.useEffect)(j,M),n.bursts.length===0)return null;let N=!r||n.bursts.length===0||E,ne=n.bursts.length,ie;t[2]!==l||t[3]!==n.bursts.length||t[4]!==r?(ie=r?n.bursts.length===0?l({id:`2fkdnR`}):null:l({id:`NzFvyK`}),t[2]=l,t[3]=n.bursts.length,t[4]=r,t[5]=ie):ie=t[5];let L=ie,ae;t[6]!==N||t[7]!==n.docName||t[8]!==o?(ae=e=>{e.stopPropagation(),!N&&(O(!0),Promise.resolve(o(n.docName)).finally(()=>O(!1)))},t[6]=N,t[7]=n.docName,t[8]=o,t[9]=ae):ae=t[9];let oe=ae,se;t[10]===N?se=t[11]:(se=e=>{e.stopPropagation(),!N&&T(!0)},t[10]=N,t[11]=se);let ce=se,le;t[12]!==N||t[13]!==n.docName||t[14]!==s?(le=()=>{T(!1),!N&&(O(!0),Promise.resolve(s(n.docName)).finally(()=>O(!1)))},t[12]=N,t[13]=n.docName,t[14]=s,t[15]=le):le=t[15];let ue=le,de;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(de=()=>m(me),t[16]=de):de=t[16];let z;t[17]!==l||t[18]!==f||t[19]!==p?(z=l(p?{id:`rVgSRB`,values:{docName:f}}:{id:`tW_yvQ`,values:{docName:f}}),t[17]=l,t[18]=f,t[19]=p,t[20]=z):z=t[20];let B;t[21]===p?B=t[22]:(B=p?(0,R.jsx)(C,{className:`size-4`,"aria-hidden":`true`}):(0,R.jsx)(w,{className:`size-4`,"aria-hidden":`true`}),t[21]=p,t[22]=B);let V;t[23]!==p||t[24]!==z||t[25]!==B?(V=(0,R.jsx)(`button`,{type:`button`,onClick:de,className:`flex size-5 shrink-0 items-center justify-center rounded hover:bg-muted`,"aria-expanded":p,"aria-label":z,"data-testid":`activity-panel-file-row-carrot`,children:B}),t[23]=p,t[24]=z,t[25]=B,t[26]=V):V=t[26];let H;t[27]!==n.docName||t[28]!==a?(H=()=>a(n.docName),t[27]=n.docName,t[28]=a,t[29]=H):H=t[29];let U;t[30]!==l||t[31]!==f?(U=l({id:`QcpeeE`,values:{docName:f}}),t[30]=l,t[31]=f,t[32]=U):U=t[32];let W;t[33]!==n.docName||t[34]!==H||t[35]!==U?(W=(0,R.jsx)(`button`,{type:`button`,onClick:H,className:`min-w-0 flex-1 truncate text-left text-foreground hover:underline focus-visible:outline-ring`,"aria-label":U,"data-testid":`activity-panel-file-row-filename`,title:n.docName,children:n.docName}),t[33]=n.docName,t[34]=H,t[35]=U,t[36]=W):W=t[36];let G;t[37]!==l||t[38]!==f?(G=l({id:`m4v3XT`,values:{docName:f}}),t[37]=l,t[38]=f,t[39]=G):G=t[39];let ge;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,R.jsx)(D,{className:`size-3.5`,"aria-hidden":`true`}),t[40]=ge):ge=t[40];let K;t[41]!==N||t[42]!==oe||t[43]!==G?(K=(0,R.jsx)(P,{asChild:!0,children:(0,R.jsx)(h,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6 shrink-0`,onClick:oe,disabled:N,"aria-label":G,"data-testid":`activity-panel-undo-last`,children:ge})}),t[41]=N,t[42]=oe,t[43]=G,t[44]=K):K=t[44];let q;t[45]!==l||t[46]!==L?(q=L??l({id:`ArBWJf`}),t[45]=l,t[46]=L,t[47]=q):q=t[47];let J;t[48]===q?J=t[49]:(J=(0,R.jsx)(ee,{side:`bottom`,children:q}),t[48]=q,t[49]=J);let Y;t[50]!==K||t[51]!==J?(Y=(0,R.jsxs)(te,{children:[K,J]}),t[50]=K,t[51]=J,t[52]=Y):Y=t[52];let X;t[53]!==l||t[54]!==f?(X=l({id:`J2MgzQ`,values:{docName:f}}),t[53]=l,t[54]=f,t[55]=X):X=t[55];let _e;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(_e=(0,R.jsx)(re,{className:`size-3.5`,"aria-hidden":`true`}),t[56]=_e):_e=t[56];let Z;t[57]!==N||t[58]!==ce||t[59]!==X?(Z=(0,R.jsx)(P,{asChild:!0,children:(0,R.jsx)(h,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6 shrink-0`,onClick:ce,disabled:N,"aria-label":X,"data-testid":`activity-panel-undo-all`,children:_e})}),t[57]=N,t[58]=ce,t[59]=X,t[60]=Z):Z=t[60];let Q;t[61]!==l||t[62]!==L?(Q=L??l({id:`mNY1G6`}),t[61]=l,t[62]=L,t[63]=Q):Q=t[63];let ve;t[64]===Q?ve=t[65]:(ve=(0,R.jsx)(ee,{side:`bottom`,children:Q}),t[64]=Q,t[65]=ve);let ye;t[66]!==Z||t[67]!==ve?(ye=(0,R.jsxs)(te,{children:[Z,ve]}),t[66]=Z,t[67]=ve,t[68]=ye):ye=t[68];let be;t[69]===n.additionsTotal?be=t[70]:(be=(0,R.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additionsTotal]}),t[69]=n.additionsTotal,t[70]=be);let xe;t[71]===n.deletionsTotal?xe=t[72]:(xe=(0,R.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletionsTotal]}),t[71]=n.deletionsTotal,t[72]=xe);let Se;t[73]!==be||t[74]!==xe?(Se=(0,R.jsxs)(`span`,{className:`shrink-0 font-mono text-xs`,children:[be,` `,xe]}),t[73]=be,t[74]=xe,t[75]=Se):Se=t[75];let Ce;t[76]!==n.lastTs||t[77]!==k?(Ce=pe(n.lastTs,k),t[76]=n.lastTs,t[77]=k,t[78]=Ce):Ce=t[78];let $;t[79]===Ce?$=t[80]:($=(0,R.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:Ce}),t[79]=Ce,t[80]=$);let we;t[81]===i?we=t[82]:(we=i?(0,R.jsx)(`span`,{className:`shrink-0 text-[11px] text-primary animate-pulse`,role:`status`,children:(0,R.jsx)(u,{id:`6q0rnH`})}):null,t[81]=i,t[82]=we);let Te;t[83]!==V||t[84]!==W||t[85]!==Y||t[86]!==ye||t[87]!==Se||t[88]!==$||t[89]!==we?(Te=(0,R.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 text-sm`,children:[V,W,Y,ye,Se,$,we]}),t[83]=V,t[84]=W,t[85]=Y,t[86]=ye,t[87]=Se,t[88]=$,t[89]=we,t[90]=Te):Te=t[90];let Ee;t[91]!==p||t[92]!==c||t[93]!==n.bursts||t[94]!==n.docName?(Ee=p?(0,R.jsx)(`div`,{children:n.bursts.map(e=>(0,R.jsx)(fe,{burst:e,docName:n.docName,fetchBurstDiff:c},`${n.docName}:${e.stackIndex}`))}):null,t[91]=p,t[92]=c,t[93]=n.bursts,t[94]=n.docName,t[95]=Ee):Ee=t[95];let De;t[96]===Symbol.for(`react.memo_cache_sentinel`)?(De=(0,R.jsx)(v,{children:(0,R.jsx)(u,{id:`SEYWYq`})}),t[96]=De):De=t[96];let Oe;t[97]!==ne||t[98]!==f?(Oe={docName:f,burstCount:ne},t[97]=ne,t[98]=f,t[99]=Oe):Oe=t[99];let ke;t[100]===Symbol.for(`react.memo_cache_sentinel`)?(ke={0:(0,R.jsx)(`span`,{className:`font-mono text-foreground`})},t[100]=ke):ke=t[100];let Ae;t[101]===Oe?Ae=t[102]:(Ae=(0,R.jsxs)(x,{children:[De,(0,R.jsx)(_,{children:(0,R.jsx)(u,{id:`ZBYKxv`,values:Oe,components:ke})})]}),t[101]=Oe,t[102]=Ae);let je;t[103]===Symbol.for(`react.memo_cache_sentinel`)?(je=()=>T(!1),t[103]=je):je=t[103];let Me;t[104]===Symbol.for(`react.memo_cache_sentinel`)?(Me=(0,R.jsx)(h,{type:`button`,variant:`outline`,onClick:je,"data-testid":`activity-panel-undo-all-cancel`,children:(0,R.jsx)(u,{id:`dEgA5A`})}),t[104]=Me):Me=t[104];let Ne;t[105]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,R.jsx)(u,{id:`MWrUEd`}),t[105]=Ne):Ne=t[105];let Pe;t[106]===ue?Pe=t[107]:(Pe=(0,R.jsxs)(b,{children:[Me,(0,R.jsx)(h,{type:`button`,variant:`destructive`,onClick:ue,"data-testid":`activity-panel-undo-all-confirm`,children:Ne})]}),t[106]=ue,t[107]=Pe);let Fe;t[108]!==Ae||t[109]!==Pe?(Fe=(0,R.jsxs)(y,{className:`sm:max-w-md`,children:[Ae,Pe]}),t[108]=Ae,t[109]=Pe,t[110]=Fe):Fe=t[110];let Ie;t[111]!==g||t[112]!==Fe?(Ie=(0,R.jsx)(S,{open:g,onOpenChange:T,children:Fe}),t[111]=g,t[112]=Fe,t[113]=Ie):Ie=t[113];let Le;return t[114]!==Te||t[115]!==Ee||t[116]!==Ie?(Le=(0,R.jsxs)(`div`,{className:`border-b border-border`,"data-testid":`activity-panel-file-row`,children:[Te,Ee,Ie]}),t[114]=Te,t[115]=Ee,t[116]=Ie,t[117]=Le):Le=t[117],Le}function me(e){return!e}function he(){return Date.now()}async function V(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 H(e){return`#/${e.split(`/`).map(e=>encodeURIComponent(e)).join(`/`)}`}function U(e){typeof window>`u`||(window.location.hash=H(e))}function W(){let e=(0,F.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,R.jsx)(E,{className:`mr-2 size-4 animate-spin`,"aria-hidden":`true`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,R.jsxs)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,role:`status`,"aria-busy":`true`,children:[t,(0,R.jsx)(`span`,{className:`text-sm`,children:(0,R.jsx)(u,{id:`ONPvOb`})})]}),e[1]=n):n=e[1],n}function G(e){let t=(0,F.c)(10),{error:n,onRetry:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,R.jsx)(a,{className:`size-6 text-destructive`,"aria-hidden":`true`}),t[0]=i):i=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,R.jsx)(`p`,{className:`text-sm font-medium`,children:(0,R.jsx)(u,{id:`DhLHEb`})}),t[1]=o):o=t[1];let s;t[2]===n?s=t[3]:(s=(0,R.jsxs)(`div`,{className:`space-y-1`,children:[o,(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n})]}),t[2]=n,t[3]=s);let c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,R.jsx)(u,{id:`6gRgw8`}),t[4]=c):c=t[4];let l;t[5]===r?l=t[6]:(l=(0,R.jsx)(h,{type:`button`,variant:`outline`,size:`sm`,onClick:r,children:c}),t[5]=r,t[6]=l);let d;return t[7]!==s||t[8]!==l?(d=(0,R.jsxs)(`div`,{className:`flex flex-col items-center gap-3 p-6 text-center`,role:`alert`,"data-testid":`activity-panel-error`,children:[i,s,l]}),t[7]=s,t[8]=l,t[9]=d):d=t[9],d}function ge(){let e=(0,F.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,R.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,"data-testid":`activity-panel-empty`,children:(0,R.jsx)(`p`,{className:`text-sm italic`,children:(0,R.jsx)(u,{id:`iuTKci`})})}),e[0]=t):t=e[0],t}function K(e){let t=(0,F.c)(12),{onExit:n,showBackButton:r}=e,{_:i}=d(),a;t[0]===i?a=t[1]:(a=i({id:`kYL1lH`}),t[0]=i,t[1]=a);let o;t[2]!==n||t[3]!==r?(o=r?(0,R.jsx)(q,{onClick:n}):null,t[2]=n,t[3]=r,t[4]=o):o=t[4];let s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,R.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:(0,R.jsx)(u,{id:`kYL1lH`})}),t[5]=s):s=t[5];let c;t[6]===o?c=t[7]:(c=(0,R.jsxs)(`div`,{className:`flex shrink-0 flex-row items-center gap-2 border-b border-border px-3 py-2`,children:[o,s]}),t[6]=o,t[7]=c);let l;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,R.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-6 text-muted-foreground`,children:(0,R.jsx)(`p`,{className:`text-center text-sm italic`,children:(0,R.jsx)(u,{id:`D_WKe_`})})}),t[8]=l):l=t[8];let f;return t[9]!==a||t[10]!==c?(f=(0,R.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel-no-agent`,"aria-label":a,children:[c,l]}),t[9]=a,t[10]=c,t[11]=f):f=t[11],f}function q(e){let t=(0,F.c)(9),{onClick:n}=e,{_:r}=d(),i;t[0]===r?i=t[1]:(i=r({id:`ogAuyr`}),t[0]=r,t[1]=i);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,R.jsx)(o,{}),t[2]=a):a=t[2];let s;t[3]!==n||t[4]!==i?(s=(0,R.jsx)(P,{asChild:!0,children:(0,R.jsx)(h,{type:`button`,variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,onClick:n,"aria-label":i,"data-testid":`docpanel-exit-agent-mode`,children:a})}),t[3]=n,t[4]=i,t[5]=s):s=t[5];let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,R.jsx)(ee,{side:`bottom`,children:(0,R.jsx)(u,{id:`ogAuyr`})}),t[6]=c):c=t[6];let l;return t[7]===s?l=t[8]:(l=(0,R.jsxs)(te,{children:[s,c]}),t[7]=s,t[8]=l),l}function J(e){let t=(0,F.c)(9),{lastTs:n}=e,[r]=(0,I.useState)(Y),i;t[0]!==n||t[1]!==r?(i=n?X(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,R.jsx)(`span`,{className:`font-medium`,children:(0,R.jsx)(u,{id:`LCUy_N`})}),t[3]=o):o=t[3];let s;t[4]===a?s=t[5]:(s=a?(0,R.jsxs)(`span`,{children:[` · `,a]}):null,t[4]=a,t[5]=s);let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,R.jsx)(`div`,{className:`mt-1 opacity-80`,children:(0,R.jsx)(u,{id:`GK-IRZ`})}),t[6]=c):c=t[6];let l;return t[7]===s?l=t[8]:(l=(0,R.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 Y(){return Date.now()}function X(e){let t=Math.max(0,e);if(t<6e4){let e=Math.round(t/1e3);return N._({id:`pbwTg6`,values:{seconds:e}})}if(t<36e5){let e=Math.round(t/6e4);return N._({id:`_rP3HI`,values:{minutes:e}})}let n=Math.round(t/36e5);return N._({id:`nYeBmY`,values:{hours:n}})}function _e(e){let t=(0,F.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,R.jsx)(k,{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,R.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 Z(e){let t=(0,F.c)(26),{data:n,status:r,error:i,reload:a,fetchBurstDiff:o,onExit:s,onNavigate:c,onUndoLast:l,onUndoAll:f,showBackButton:p}=e,{_:m}=d(),h=n?.files?.[0]?.lastTs??null,g=n?.files?.length??0,_;t[0]===m?_=t[1]:(_=m({id:`kYL1lH`}),t[0]=m,t[1]=_);let v;t[2]!==s||t[3]!==p?(v=p?(0,R.jsx)(q,{onClick:s}):null,t[2]=s,t[3]=p,t[4]=v):v=t[4];let y;t[5]!==n||t[6]!==g||t[7]!==h?(y=n?.agent?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(_e,{agent:n.agent}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:n.agent.displayName}),(0,R.jsxs)(`p`,{className:`truncate text-xs text-muted-foreground`,children:[n.sessionAlive?(0,R.jsx)(u,{id:`F6pfE9`}):h===null?(0,R.jsx)(u,{id:`PMyJ9C`}):(0,R.jsx)(u,{id:`237hSL`}),n.files.length>0?(0,R.jsxs)(R.Fragment,{children:[` · `,(0,R.jsx)(u,{id:`u3BOHd`,values:{fileCount:g}})]}):null]})]})]}):(0,R.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,R.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:(0,R.jsx)(u,{id:`kYL1lH`})})}),t[5]=n,t[6]=g,t[7]=h,t[8]=y):y=t[8];let b;t[9]!==v||t[10]!==y?(b=(0,R.jsxs)(`div`,{className:`flex flex-row items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[v,y]}),t[9]=v,t[10]=y,t[11]=b):b=t[11];let x;t[12]!==n||t[13]!==i||t[14]!==o||t[15]!==h||t[16]!==c||t[17]!==f||t[18]!==l||t[19]!==a||t[20]!==r?(x=(0,R.jsx)(`div`,{className:`flex-1 overflow-y-auto`,"data-testid":`activity-panel-body`,children:r===`loading`&&n===null?(0,R.jsx)(W,{}):r===`error`&&i?(0,R.jsx)(G,{error:i,onRetry:a}):n===null?(0,R.jsx)(ge,{}):(0,R.jsxs)(R.Fragment,{children:[!n.sessionAlive&&h!==null?(0,R.jsx)(J,{lastTs:h}):null,n.files.length===0?(0,R.jsx)(ge,{}):n.files.map(e=>(0,R.jsx)(B,{file:e,sessionAlive:n.sessionAlive,isWriting:n.writingDocs.has(e.docName),onNavigate:c,onUndoLast:l,onUndoAll:f,fetchBurstDiff:o},e.docName))]})}),t[12]=n,t[13]=i,t[14]=o,t[15]=h,t[16]=c,t[17]=f,t[18]=l,t[19]=a,t[20]=r,t[21]=x):x=t[21];let S;return t[22]!==_||t[23]!==b||t[24]!==x?(S=(0,R.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel`,"aria-label":_,children:[b,x]}),t[22]=_,t[23]=b,t[24]=x,t[25]=S):S=t[25],S}function Q(e){let t=(0,F.c)(29),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{showBackButton:r}=n,i=r===void 0?!0:r,{_:a}=d(),{docPanelAgentId:o,closeActivityPanel:c}=s(),{openTargetTransition:u}=l(),{pageMeta:f}=T(),{data:p,status:m,error:h,reload:g,fetchBurstDiff:_}=se(o);if(o===null){let e;return t[2]!==c||t[3]!==i?(e=(0,R.jsx)(K,{onExit:c,showBackButton:i}),t[2]=c,t[3]=i,t[4]=e):e=t[4],e}let v;t[5]!==u||t[6]!==f?(v=e=>{u(ne({kind:`doc`,target:e,docName:e},f)),U(e)},t[5]=u,t[6]=f,t[7]=v):v=t[7];let y=v,b;t[8]!==a||t[9]!==p||t[10]!==o||t[11]!==g?(b=async e=>{try{await V({connectionId:o,docName:e,scope:`last`,agentName:p?.agent?.displayName}),g()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);j.error(a({id:`EqrC_R`,values:{message:n}})),g()}},t[8]=a,t[9]=p,t[10]=o,t[11]=g,t[12]=b):b=t[12];let x=b,S;t[13]!==a||t[14]!==p||t[15]!==o||t[16]!==g?(S=async e=>{try{await V({connectionId:o,docName:e,scope:`file`,agentName:p?.agent?.displayName}),j.success(a({id:`pRc-Im`,values:{docName:e}})),g()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);j.error(a({id:`7KeV5F`,values:{message:n}})),g()}},t[13]=a,t[14]=p,t[15]=o,t[16]=g,t[17]=S):S=t[17];let C=S,w;return t[18]!==c||t[19]!==p||t[20]!==h||t[21]!==_||t[22]!==y||t[23]!==C||t[24]!==x||t[25]!==g||t[26]!==i||t[27]!==m?(w=(0,R.jsx)(Z,{data:p,status:m,error:h,reload:g,fetchBurstDiff:_,onExit:c,onNavigate:y,onUndoLast:x,onUndoAll:C,showBackButton:i}),t[18]=c,t[19]=p,t[20]=h,t[21]=_,t[22]=y,t[23]=C,t[24]=x,t[25]=g,t[26]=i,t[27]=m,t[28]=w):w=t[28],w}export{Q as ActivityModeContent};
|
|
@@ -1,2 +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{n as i,r as a}from"./dist-CQw2y-s3.js";import{t as o}from"./button-DGf25ccp.js";import{a as s,c,i as l,n as u,o as d,s as f,t as p}from"./dialog-
|
|
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{n as i,r as a}from"./dist-CQw2y-s3.js";import{t as o}from"./button-DGf25ccp.js";import{a as s,c,i as l,n as u,o as d,s as f,t as p}from"./dialog-CvKVTeQa.js";import{t as ee}from"./chevron-right-jyIhGBkw.js";import{n as te,r as ne,t as re}from"./collapsible-CjgfK1G5.js";import{n as m}from"./dist-KBKQayVB.js";import{t as h}from"./checkbox-DwE0ySFI.js";import{t as g}from"./input-DkQ8Zmzd.js";import{i as _,n as ie,r as ae,t as oe}from"./project-paths-CcPGtodV.js";import{t as se}from"./textarea-BQFFQ9_l.js";var ce=r(),v=e(t(),1),y=n(),le=750,ue={root:{id:`ZWolSV`},home:{id:`_RcqUM`},"home-documents":{id:`of3tF-`},"home-desktop":{id:`vfWA_g`},"home-downloads":{id:`wlwXUk`},"volumes-mount":{id:`nMSYz5`},"drive-root":{id:`M3ytY_`}},b={error:e=>m.error(e)};function x(e){let t=(0,ce.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?_:r,s=i===void 0?b: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,y.jsx)(de,{payload:l,store:o,toast:s}),t[5]=l,t[6]=o,t[7]=s,t[8]=u):u=t[8],u}function de(e){let t=(0,ce.c)(125),{payload:n,store:r,toast:m}=e,{_}=a(),b=(0,v.useId)(),[x,de]=(0,v.useState)(n.defaultContentDir),[S,he]=(0,v.useState)(``),ge;t[0]===n.editorOptions?ge=t[1]:(ge=()=>new Set(n.editorOptions.map(pe)),t[0]=n.editorOptions,t[1]=ge);let[C,_e]=(0,v.useState)(ge),[w,ve]=(0,v.useState)(`shared`),[ye,be]=(0,v.useState)(null),[T,xe]=(0,v.useState)(!1),[E,Se]=(0,v.useState)(null),[Ce,we]=(0,v.useState)(!1),Te,Ee;t[2]!==_||t[3]!==x?(Te=()=>{if(!oe(x)){be(null);return}let e=!1,t=setTimeout(()=>{let t=window.okDesktop;t&&t.onboarding.probeContent({contentDir:x}).then(t=>{e||be(t)}).catch(t=>{e||be({ok:!1,error:t instanceof Error?t.message:_({id:`snrVQ7`})})})},le);return()=>{e=!0,clearTimeout(t)}},Ee=[x,_],t[2]=_,t[3]=x,t[4]=Te,t[5]=Ee):(Te=t[4],Ee=t[5]),(0,v.useEffect)(Te,Ee);let De;t[6]===x?De=t[7]:(De=oe(x),t[6]=x,t[7]=De);let D=De,O=T||!D,Oe=Ce||!D,ke=n.projectDir,Ae;t[8]!==n.pickedPath||t[9]!==n.projectDir?(Ae=ie(n.projectDir,n.pickedPath)??n.pickedPath,t[8]=n.pickedPath,t[9]=n.projectDir,t[10]=Ae):Ae=t[10];let je=Ae,Me;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(Me=function(e){_e(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[11]=Me):Me=t[11];let Ne=Me,Pe;t[12]!==_||t[13]!==n.projectDir?(Pe=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;Se(t instanceof Error?t.message:_({id:`P-ye9o`}));return}if(t===null)return;let r=ie(n.projectDir,t);if(r===null){Se(_({id:`UTZ97u`}));return}Se(null),de(r)},t[12]=_,t[13]=n.projectDir,t[14]=Pe):Pe=t[14];let Fe=Pe,k;t[15]!==S||t[16]!==x||t[17]!==C||t[18]!==w||t[19]!==r||t[20]!==m?(k=async function(){xe(!0);let e=await r.confirm({initGit:!0,contentDir:x,additionalIgnores:S,editorIds:Array.from(C),sharing:w});e.ok||(m.error(e.error),xe(!1))},t[15]=S,t[16]=x,t[17]=C,t[18]=w,t[19]=r,t[20]=m,t[21]=k):k=t[21];let Ie=k,Le;t[22]!==Ie||t[23]!==O?(Le=function(e){e.preventDefault(),!O&&Ie()},t[22]=Ie,t[23]=O,t[24]=Le):Le=t[24];let Re=Le,ze;t[25]!==r||t[26]!==m?(ze=async function(){xe(!0);let e=await r.cancel();e.ok||(m.error(e.error),xe(!1))},t[25]=r,t[26]=m,t[27]=ze):ze=t[27];let A=ze,Be;t[28]!==T||t[29]!==A?(Be=function(e){!e&&!T&&A()},t[28]=T,t[29]=A,t[30]=Be):Be=t[30];let Ve=Be,He;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(He=(0,y.jsx)(c,{children:(0,y.jsx)(i,{id:`seeS6l`})}),t[31]=He):He=t[31];let Ue;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=(0,y.jsxs)(f,{children:[He,(0,y.jsx)(s,{children:(0,y.jsx)(i,{id:`HqiZvw`,components:{0:(0,y.jsx)(`code`,{})}})})]}),t[32]=Ue):Ue=t[32];let j;t[33]!==n.gitRootPromoted||t[34]!==je||t[35]!==ke?(j=n.gitRootPromoted?(0,y.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,y.jsx)(i,{id:`Y1kX2z`,values:{projectDir:ke,pickedRelative:je},components:{0:(0,y.jsx)(`code`,{}),1:(0,y.jsx)(`code`,{}),2:(0,y.jsx)(`code`,{}),3:(0,y.jsx)(`code`,{}),4:(0,y.jsx)(`code`,{})}})}):null,t[33]=n.gitRootPromoted,t[34]=je,t[35]=ke,t[36]=j):j=t[36];let M;t[37]!==_||t[38]!==n.warnings?(M=n.warnings.length>0?(0,y.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(e=>(0,y.jsx)(`p`,{className:`mb-1 last:mb-0`,children:_(ue[e.kind])},e.kind))}):null,t[37]=_,t[38]=n.warnings,t[39]=M):M=t[39];let N;t[40]!==D||t[41]!==ye?(N=D?(0,y.jsx)(me,{probe:ye}):null,t[40]=D,t[41]=ye,t[42]=N):N=t[42];let P;t[43]!==T||t[44]!==b||t[45]!==w?(P=(0,y.jsx)(ae,{idPrefix:b,testIdPrefix:`consent-sharing`,value:w,onValueChange:ve,disabled:T}),t[43]=T,t[44]=b,t[45]=w,t[46]=P):P=t[46];let We;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(We=(0,y.jsxs)(ne,{className:`group flex w-full items-center justify-between gap-2 px-3 py-2 text-sm font-medium hover:bg-muted/50`,"data-testid":`consent-advanced-trigger`,children:[(0,y.jsx)(i,{id:`VNgKZz`}),(0,y.jsx)(ee,{className:`size-4 transition-transform group-data-[state=open]:rotate-90 motion-reduce:transition-none`,"aria-hidden":!0})]}),t[47]=We):We=t[47];let Ge;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,y.jsx)(`label`,{htmlFor:`consent-content-dir`,className:`text-sm font-medium`,children:(0,y.jsx)(i,{id:`ll2yNl`})}),t[48]=Ge):Ge=t[48];let Ke;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(Ke=e=>{de(e.target.value),Se(null)},t[49]=Ke):Ke=t[49];let qe=!D,Je=E===null?D?void 0:`consent-content-dir-error`:`consent-content-dir-browse-error`,F;t[50]!==T||t[51]!==x||t[52]!==qe||t[53]!==Je?(F=(0,y.jsx)(g,{id:`consent-content-dir`,value:x,onChange:Ke,disabled:T,"aria-invalid":qe,"aria-describedby":Je,"data-testid":`consent-content-dir`,className:`flex-1`}),t[50]=T,t[51]=x,t[52]=qe,t[53]=Je,t[54]=F):F=t[54];let I;t[55]===Fe?I=t[56]:(I=()=>void Fe(),t[55]=Fe,t[56]=I);let Ye;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(Ye=(0,y.jsx)(i,{id:`O2UpM1`}),t[57]=Ye):Ye=t[57];let L;t[58]!==T||t[59]!==I?(L=(0,y.jsx)(o,{type:`button`,variant:`outline`,disabled:T,onClick:I,"data-testid":`consent-content-dir-browse`,children:Ye}),t[58]=T,t[59]=I,t[60]=L):L=t[60];let R;t[61]!==F||t[62]!==L?(R=(0,y.jsxs)(`div`,{className:`flex items-stretch gap-2`,children:[F,L]}),t[61]=F,t[62]=L,t[63]=R):R=t[63];let z;t[64]!==E||t[65]!==D?(z=E===null?D?null:(0,y.jsx)(`p`,{id:`consent-content-dir-error`,className:`text-1sm text-destructive`,"data-testid":`consent-content-dir-error`,children:(0,y.jsx)(i,{id:`U5Spo9`})}):(0,y.jsx)(`p`,{id:`consent-content-dir-browse-error`,className:`text-1sm text-destructive`,"data-testid":`consent-content-dir-browse-error`,children:E}),t[64]=E,t[65]=D,t[66]=z):z=t[66];let B;t[67]!==R||t[68]!==z?(B=(0,y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[Ge,R,z]}),t[67]=R,t[68]=z,t[69]=B):B=t[69];let Xe;t[70]===Symbol.for(`react.memo_cache_sentinel`)?(Xe=(0,y.jsx)(`label`,{htmlFor:`consent-additional-ignores`,className:`text-sm font-medium`,children:(0,y.jsx)(i,{id:`3zyg_A`})}),t[70]=Xe):Xe=t[70];let Ze;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=e=>he(e.target.value),t[71]=Ze):Ze=t[71];let V;t[72]!==S||t[73]!==T?(V=(0,y.jsx)(se,{id:`consent-additional-ignores`,value:S,onChange:Ze,disabled:T,placeholder:`tmp/
|
|
2
2
|
*.draft.md`,rows:3,"data-testid":`consent-additional-ignores`}),t[72]=S,t[73]=T,t[74]=V):V=t[74];let Qe;t[75]===Symbol.for(`react.memo_cache_sentinel`)?(Qe=(0,y.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,y.jsx)(i,{id:`aE2_XM`,components:{0:(0,y.jsx)(`code`,{})}})}),t[75]=Qe):Qe=t[75];let H;t[76]===V?H=t[77]:(H=(0,y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[Xe,V,Qe]}),t[76]=V,t[77]=H);let $e;t[78]===Symbol.for(`react.memo_cache_sentinel`)?($e=(0,y.jsx)(`legend`,{className:`text-sm font-medium`,children:(0,y.jsx)(i,{id:`0YEbfk`})}),t[78]=$e):$e=t[78];let et;t[79]===Symbol.for(`react.memo_cache_sentinel`)?(et=(0,y.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,y.jsx)(i,{id:`eSu2Xn`,components:{0:(0,y.jsx)(`code`,{})}})}),t[79]=et):et=t[79];let U;if(t[80]!==T||t[81]!==C||t[82]!==n.editorOptions){let e;t[84]!==T||t[85]!==C?(e=e=>{let t=`consent-editor-${e.id}-cb`;return(0,y.jsxs)(`label`,{htmlFor:t,className:`flex items-center gap-2 text-sm`,children:[(0,y.jsx)(h,{id:t,checked:C.has(e.id),onCheckedChange:()=>Ne(e.id),disabled:T,"data-testid":`consent-editor-${e.id}`}),(0,y.jsx)(`span`,{children:e.label}),(0,y.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`consent-editor-${e.id}-scope`,children:e.hasProjectConfig?(0,y.jsx)(i,{id:`cKjLuT`}):(0,y.jsx)(i,{id:`nYKerc`})})]},e.id)},t[84]=T,t[85]=C,t[86]=e):e=t[86],U=n.editorOptions.map(e),t[80]=T,t[81]=C,t[82]=n.editorOptions,t[83]=U}else U=t[83];let W;t[87]===U?W=t[88]:(W=(0,y.jsxs)(`fieldset`,{className:`flex flex-col space-y-2 pb-2`,children:[$e,et,U]}),t[87]=U,t[88]=W);let G;t[89]!==B||t[90]!==H||t[91]!==W?(G=(0,y.jsxs)(te,{className:`space-y-6 border-t border-border px-3 py-4`,children:[B,H,W]}),t[89]=B,t[90]=H,t[91]=W,t[92]=G):G=t[92];let K;t[93]!==Oe||t[94]!==G?(K=(0,y.jsxs)(re,{open:Oe,onOpenChange:we,className:`rounded-md border border-border`,"data-testid":`consent-advanced`,children:[We,G]}),t[93]=Oe,t[94]=G,t[95]=K):K=t[95];let q;t[96]!==b||t[97]!==Re||t[98]!==N||t[99]!==P||t[100]!==K?(q=(0,y.jsxs)(`form`,{id:b,onSubmit:Re,"data-testid":`consent-form`,className:`space-y-6`,children:[N,P,K]}),t[96]=b,t[97]=Re,t[98]=N,t[99]=P,t[100]=K,t[101]=q):q=t[101];let J;t[102]!==j||t[103]!==M||t[104]!==q?(J=(0,y.jsxs)(u,{className:`space-y-6`,children:[j,M,q]}),t[102]=j,t[103]=M,t[104]=q,t[105]=J):J=t[105];let Y;t[106]===A?Y=t[107]:(Y=()=>void A(),t[106]=A,t[107]=Y);let tt;t[108]===Symbol.for(`react.memo_cache_sentinel`)?(tt=(0,y.jsx)(i,{id:`dEgA5A`}),t[108]=tt):tt=t[108];let X;t[109]!==T||t[110]!==Y?(X=(0,y.jsx)(o,{type:`button`,variant:`outline`,className:`font-mono uppercase`,onClick:Y,disabled:T,"data-testid":`consent-cancel`,children:tt}),t[109]=T,t[110]=Y,t[111]=X):X=t[111];let nt;t[112]===Symbol.for(`react.memo_cache_sentinel`)?(nt=(0,y.jsx)(i,{id:`RDjuBN`}),t[112]=nt):nt=t[112];let Z;t[113]!==b||t[114]!==O?(Z=(0,y.jsx)(o,{type:`submit`,form:b,disabled:O,"data-testid":`consent-start`,children:nt}),t[113]=b,t[114]=O,t[115]=Z):Z=t[115];let Q;t[116]!==X||t[117]!==Z?(Q=(0,y.jsxs)(d,{children:[X,Z]}),t[116]=X,t[117]=Z,t[118]=Q):Q=t[118];let $;t[119]!==J||t[120]!==Q?($=(0,y.jsxs)(l,{className:`sm:max-w-lg`,onOpenAutoFocus:fe,children:[Ue,J,Q]}),t[119]=J,t[120]=Q,t[121]=$):$=t[121];let rt;return t[122]!==Ve||t[123]!==$?(rt=(0,y.jsx)(p,{open:!0,onOpenChange:Ve,children:$}),t[122]=Ve,t[123]=$,t[124]=rt):rt=t[124],rt}function fe(e){e.preventDefault(),e.currentTarget.querySelector(`[role="radio"]`)?.focus()}function pe(e){return e.id}function me(e){let t=(0,ce.c)(24),{probe:n}=e,{_:r}=a();if(n===null){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`consent-preview`,children:(0,y.jsx)(i,{id:`DiFKSL`})}),t[0]=e):e=t[0],e}if(!n.ok){let e=n.error,r;return t[1]===e?r=t[2]:(r=(0,y.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`consent-preview`,children:(0,y.jsx)(i,{id:`9fvog2`,values:{errorDetail:e}})}),t[1]=e,t[2]=r),r}let o=n.truncated?`≥ 50,000`:String(n.count),s;t[3]!==r||t[4]!==o?(s=r({id:`MV-Dkb`,values:{countDisplay:o}}),t[3]=r,t[4]=o,t[5]=s):s=t[5];let c=s;if(n.sample.length===0){let e;return t[6]===c?e=t[7]:(e=(0,y.jsx)(`p`,{className:`text-1sm text-muted-foreground`,"data-testid":`consent-preview`,children:c}),t[6]=c,t[7]=e),e}let l=n.truncated?null:n.count-n.sample.length,u;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,y.jsx)(ee,{className:`size-3 transition-transform motion-reduce:transition-none`,"aria-hidden":!0}),t[8]=u):u=t[8];let d;t[9]===c?d=t[10]:(d=(0,y.jsxs)(ne,{className:`flex items-center gap-1 text-1sm text-muted-foreground hover:text-foreground [&[data-state=open]>svg]:rotate-90`,children:[u,(0,y.jsx)(`span`,{children:c})]}),t[9]=c,t[10]=d);let f;t[11]===n.sample?f=t[12]:(f=n.sample.map(S),t[11]=n.sample,t[12]=f);let p;t[13]===f?p=t[14]:(p=(0,y.jsx)(`ul`,{className:`space-y-1.5 font-mono`,children:f}),t[13]=f,t[14]=p);let m;t[15]!==n.truncated||t[16]!==l?(m=n.truncated||l!==null&&l>0?(0,y.jsx)(`p`,{className:`mt-1 italic`,children:n.truncated?(0,y.jsx)(i,{id:`5wV2qQ`}):(0,y.jsx)(i,{id:`nNYV3Y`,values:{remaining:l}})}):null,t[15]=n.truncated,t[16]=l,t[17]=m):m=t[17];let h;t[18]!==p||t[19]!==m?(h=(0,y.jsxs)(te,{className:`pt-1 pl-4 text-1sm text-muted-foreground`,children:[p,m]}),t[18]=p,t[19]=m,t[20]=h):h=t[20];let g;return t[21]!==d||t[22]!==h?(g=(0,y.jsxs)(re,{"data-testid":`consent-preview`,children:[d,h]}),t[21]=d,t[22]=h,t[23]=g):g=t[23],g}function S(e){return(0,y.jsx)(`li`,{children:e},e)}export{x as default};
|