@inkeep/open-knowledge 0.5.0-beta.39 → 0.5.0-beta.40
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/open-knowledge/SKILL.md +11 -6
- package/dist/cli.mjs +4 -4
- package/dist/constants-CQfcgXd1.mjs +2 -0
- package/dist/{dist-mC3lFJl0.mjs → dist-DjC84IgZ.mjs} +18 -18
- package/dist/{dist-CQ1CW0Gw.mjs → dist-kgy3NArq.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{init-CZQOVWec.mjs → init-BH7ZH8Ug.mjs} +4 -4
- package/dist/init-CBnvLBjl.mjs +1 -0
- package/dist/loader-B87qQn2P.mjs +1 -0
- package/dist/{loader-BthnLVYV.mjs → loader-C2EgX1O-.mjs} +2 -2
- package/dist/preview-CF4spOTa.mjs +1 -0
- package/dist/{preview-Dp1J-57V.mjs → preview-Ctrbhc4r.mjs} +2 -2
- package/dist/public/assets/ActivityModeContent-DXBpRrSl.js +2 -0
- package/dist/public/assets/{ActivityPanelDiffView-DwtPYJgT.js → ActivityPanelDiffView-d4ec9M69.js} +1 -1
- package/dist/public/assets/ConsentDialogBody-CSNo2n5l.js +2 -0
- package/dist/public/assets/DocumentContext-B0sQn39F.css +1 -0
- package/dist/public/assets/DocumentContext-RBKslC5w.js +52 -0
- package/dist/public/assets/{GraphPanel-FXxgmAV7.js → GraphPanel-CCV85m0N.js} +2 -2
- package/dist/public/assets/McpConsentDialogBody-Cp08S9eY.js +1 -0
- package/dist/public/assets/SettingsDialogBody-DsD6fHwY.js +11 -0
- package/dist/public/assets/SourceEditor-13iENPpI.js +2 -0
- package/dist/public/assets/{_baseFor-BQ6FmUXQ.js → _baseFor-B3FCzyNW.js} +1 -1
- package/dist/public/assets/{agent-presence-LoQiwUUV.js → agent-presence-8VSgL2U2.js} +1 -1
- package/dist/public/assets/{arc-BTYHqK6I.js → arc-GOD6SLHR.js} +1 -1
- package/dist/public/assets/architecture-YZFGNWBL-B2pJrg2X.js +1 -0
- package/dist/public/assets/{architectureDiagram-Q4EWVU46-CAw8ZTI6.js → architectureDiagram-Q4EWVU46-CIVh0TLx.js} +1 -1
- package/dist/public/assets/{blockDiagram-DXYQGD6D-D4mfoScz.js → blockDiagram-DXYQGD6D-Cg-UHasz.js} +1 -1
- package/dist/public/assets/{button-BigAOfY9.js → button-DBLnjjvQ.js} +1 -1
- package/dist/public/assets/{c4Diagram-AHTNJAMY-g4PJwhMw.js → c4Diagram-AHTNJAMY-KFeHAAOO.js} +1 -1
- package/dist/public/assets/channel-BqqURnVG.js +1 -0
- package/dist/public/assets/checkbox-kroC1jEP.js +1 -0
- package/dist/public/assets/{chunk-2KRD3SAO-C0VEmSSK.js → chunk-2KRD3SAO-ChBquZUZ.js} +1 -1
- package/dist/public/assets/{chunk-336JU56O-CWe4KlcJ.js → chunk-336JU56O-DHqaXNrn.js} +2 -2
- package/dist/public/assets/chunk-426QAEUC-CuPmuy8t.js +1 -0
- package/dist/public/assets/{chunk-4BX2VUAB-CqFQlA48.js → chunk-4BX2VUAB-Dagml-_v.js} +1 -1
- package/dist/public/assets/{chunk-4TB4RGXK-B9HnNhjS.js → chunk-4TB4RGXK-QLafKs7A.js} +1 -1
- package/dist/public/assets/chunk-55IACEB6-BRPDx2aU.js +1 -0
- package/dist/public/assets/{chunk-5FUZZQ4R-HtBbmyzC.js → chunk-5FUZZQ4R-DoG5zk7O.js} +1 -1
- package/dist/public/assets/{chunk-5PVQY5BW-BsQqu9Pz.js → chunk-5PVQY5BW--zDnbXdQ.js} +1 -1
- package/dist/public/assets/{chunk-67CJDMHE-DaOHFcoK.js → chunk-67CJDMHE-BDDJCVvR.js} +1 -1
- package/dist/public/assets/{chunk-7N4EOEYR-DxJSpCGX.js → chunk-7N4EOEYR-DcM-tXJf.js} +1 -1
- package/dist/public/assets/{chunk-AA7GKIK3-Ck4Wrqot.js → chunk-AA7GKIK3-CIk9DOam.js} +1 -1
- package/dist/public/assets/{chunk-BSJP7CBP-c353z_ln.js → chunk-BSJP7CBP-CC13npHT.js} +1 -1
- package/dist/public/assets/{chunk-CIAEETIT-fgTeYGb2.js → chunk-CIAEETIT-B7rpgB3I.js} +1 -1
- package/dist/public/assets/{chunk-EDXVE4YY-D_b3pVvT.js → chunk-EDXVE4YY-BfT15Ufb.js} +1 -1
- package/dist/public/assets/{chunk-ENJZ2VHE-DVMAmZ6-.js → chunk-ENJZ2VHE-DEtEhITq.js} +1 -1
- package/dist/public/assets/{chunk-FMBD7UC4-c2vVGInH.js → chunk-FMBD7UC4-DXl_nUYs.js} +1 -1
- package/dist/public/assets/{chunk-FOC6F5B3-CH9dNZl0.js → chunk-FOC6F5B3-wEKzMqND.js} +1 -1
- package/dist/public/assets/{chunk-ICPOFSXX-D9mDZSHP.js → chunk-ICPOFSXX-C8AElYY_.js} +1 -1
- package/dist/public/assets/{chunk-K5T4RW27-DPAjYSpe.js → chunk-K5T4RW27-DcJgbIMU.js} +1 -1
- package/dist/public/assets/{chunk-KGLVRYIC-BKUgXOPp.js → chunk-KGLVRYIC-kNC4I9ls.js} +1 -1
- package/dist/public/assets/{chunk-LIHQZDEY-CWn5kZJ_.js → chunk-LIHQZDEY-B0zYcYPV.js} +1 -1
- package/dist/public/assets/{chunk-ORNJ4GCN-BETATk1q.js → chunk-ORNJ4GCN-S_3Y_0FS.js} +1 -1
- package/dist/public/assets/{chunk-OYMX7WX6-B2DjYZXs.js → chunk-OYMX7WX6-CX3nrwxJ.js} +1 -1
- package/dist/public/assets/chunk-QZHKN3VN-CTZ4su3-.js +1 -0
- package/dist/public/assets/{chunk-U2HBQHQK-bod_LD7f.js → chunk-U2HBQHQK-CfAyyLJz.js} +1 -1
- package/dist/public/assets/{chunk-X2U36JSP-fL9reWIe.js → chunk-X2U36JSP-CmACymAN.js} +1 -1
- package/dist/public/assets/{chunk-XPW4576I-BQtjckSw.js → chunk-XPW4576I-D1s3NdKZ.js} +1 -1
- package/dist/public/assets/{chunk-YZCP3GAM-D-UepLeD.js → chunk-YZCP3GAM-CiWxV9XS.js} +1 -1
- package/dist/public/assets/{chunk-ZZ45TVLE-Z9LUwvvb.js → chunk-ZZ45TVLE-B7t5_MqN.js} +1 -1
- package/dist/public/assets/classDiagram-6PBFFD2Q-DrN_pUa5.js +1 -0
- package/dist/public/assets/classDiagram-v2-HSJHXN6E-C1MJ1Ukt.js +1 -0
- package/dist/public/assets/clone-CecJCxEU.js +1 -0
- package/dist/public/assets/collapsible-L2bca9Ur.js +1 -0
- package/dist/public/assets/config-validation-events-C8srGpAi.js +10 -0
- package/dist/public/assets/{cose-bilkent-S5V4N54A-D7YGD8wq.js → cose-bilkent-S5V4N54A-BjJ-OKPr.js} +1 -1
- package/dist/public/assets/{dagre-BZr05USh.js → dagre-BuFRtOcC.js} +1 -1
- package/dist/public/assets/{dagre-KV5264BT-uIcBsxoB.js → dagre-KV5264BT-BpBW6R71.js} +1 -1
- package/dist/public/assets/{diagram-5BDNPKRD-CRnuX3SM.js → diagram-5BDNPKRD-B5phtkJp.js} +1 -1
- package/dist/public/assets/{diagram-G4DWMVQ6-CwcP8j6L.js → diagram-G4DWMVQ6-tjReW6yx.js} +1 -1
- package/dist/public/assets/{diagram-MMDJMWI5-7Eyc42Ou.js → diagram-MMDJMWI5-b4CgKryF.js} +1 -1
- package/dist/public/assets/{diagram-TYMM5635-Bwhd6MAt.js → diagram-TYMM5635-D5B0g2lj.js} +1 -1
- package/dist/public/assets/dialog-DSzqKgdW.js +45 -0
- package/dist/public/assets/{dist-CyhQWHfo.js → dist-By89CQBy.js} +1 -1
- package/dist/public/assets/{dist-BTf6on8c.js → dist-D-oqC0-R.js} +1 -1
- package/dist/public/assets/{dist-CHvMoypJ.js → dist-DQ1oWohr.js} +1 -1
- package/dist/public/assets/{dist-DDFRxG7H.js → dist-DXgyWuz5.js} +1 -1
- package/dist/public/assets/{dist-Duryk2cE.js → dist-DllAuqQQ.js} +1 -1
- package/dist/public/assets/{dist-BOZuiab_.js → dist-DpEGxZ9h.js} +1 -1
- package/dist/public/assets/doc-hash-iXNxzaUU.js +423 -0
- package/dist/public/assets/{erDiagram-SMLLAGMA-DlCYmXsw.js → erDiagram-SMLLAGMA-CRJz10Jv.js} +1 -1
- package/dist/public/assets/{flatten-ptFIxnDZ.js → flatten-BWAerz3O.js} +1 -1
- package/dist/public/assets/{flowDiagram-DWJPFMVM-BaUE7X8U.js → flowDiagram-DWJPFMVM-BDCJTgJ7.js} +1 -1
- package/dist/public/assets/{ganttDiagram-T4ZO3ILL-Q1QCHTKl.js → ganttDiagram-T4ZO3ILL-cPQKlGYc.js} +1 -1
- package/dist/public/assets/gitGraph-7Q5UKJZL-BMann5g7.js +1 -0
- package/dist/public/assets/{gitGraphDiagram-UUTBAWPF-CG07jTjK.js → gitGraphDiagram-UUTBAWPF-BMyjc352.js} +1 -1
- package/dist/public/assets/{graphlib-B9f9FmLr.js → graphlib-BU8FnRz1.js} +1 -1
- package/dist/public/assets/index-BQdYAvoY.js +1918 -0
- package/dist/public/assets/index-CkiIkxux.css +1 -0
- package/dist/public/assets/info-OMHHGYJF-CKMkwFH6.js +1 -0
- package/dist/public/assets/{infoDiagram-42DDH7IO-DNa5xg8m.js → infoDiagram-42DDH7IO-BZ6v5y-j.js} +1 -1
- package/dist/public/assets/{isEmpty-Dff4GQVw.js → isEmpty-Cairwk5V.js} +1 -1
- package/dist/public/assets/isSymbol-BKUBGC2u.js +1 -0
- package/dist/public/assets/{ishikawaDiagram-UXIWVN3A-CCIU9fS9.js → ishikawaDiagram-UXIWVN3A-DA7_P2Up.js} +1 -1
- package/dist/public/assets/{journeyDiagram-VCZTEJTY-BAQyhz-O.js → journeyDiagram-VCZTEJTY-CzZoB161.js} +1 -1
- package/dist/public/assets/{kanban-definition-6JOO6SKY-B7n3dFDX.js → kanban-definition-6JOO6SKY-DKg7pXv1.js} +1 -1
- package/dist/public/assets/{label-Cv_LZFf-.js → label-CdSs0Skc.js} +1 -1
- package/dist/public/assets/{line-CVYKAp-t.js → line-DGc-MCyQ.js} +1 -1
- package/dist/public/assets/{linear-B5hCL-s4.js → linear-D6wzOaQP.js} +1 -1
- package/dist/public/assets/mcp-consent-store-BPw6Zd40.js +1 -0
- package/dist/public/assets/{mermaid-parser.core-DfyX5Z2V.js → mermaid-parser.core-Bm2u0Ges.js} +2 -2
- package/dist/public/assets/{mermaid.core--fhVTWBk.js → mermaid.core-DRx0wZe0.js} +3 -3
- package/dist/public/assets/{mindmap-definition-QFDTVHPH-BLm_6XTS.js → mindmap-definition-QFDTVHPH-C9GRZxO6.js} +1 -1
- package/dist/public/assets/{now-y3Cm704C.js → now-BN_Nj6nz.js} +1 -1
- package/dist/public/assets/{ordinal-CdtiT3iH.js → ordinal-Dk6d5Y-0.js} +1 -1
- package/dist/public/assets/packet-4T2RLAQJ-DXn_0fd3.js +1 -0
- package/dist/public/assets/{panel-CG6xouXb.js → panel-Co559KoC.js} +1 -1
- package/dist/public/assets/pie-ZZUOXDRM-BdZBZPW9.js +1 -0
- package/dist/public/assets/{pieDiagram-DEJITSTG-BvfCwbBk.js → pieDiagram-DEJITSTG-L6I3ft9Z.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-34T5L4WZ-DUtci3Wz.js → quadrantDiagram-34T5L4WZ-Dp2IeEPC.js} +1 -1
- package/dist/public/assets/radar-PYXPWWZC-yUE2OrUV.js +1 -0
- package/dist/public/assets/{reduce-C8tvPXVb.js → reduce-CSWSFqzz.js} +1 -1
- package/dist/public/assets/{requirementDiagram-MS252O5E-DzkgPeTh.js → requirementDiagram-MS252O5E-BxNWyIZg.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-XADWPNL6-BIuEcRVf.js → sankeyDiagram-XADWPNL6-CRn0_xkw.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-FGHM5R23-XhnGy5pc.js → sequenceDiagram-FGHM5R23-Drkjb1j4.js} +1 -1
- package/dist/public/assets/{src-BqeO7p9A.js → src-DZeiyxTL.js} +1 -1
- package/dist/public/assets/{stateDiagram-FHFEXIEX-lEHzf3FW.js → stateDiagram-FHFEXIEX-BBUFKS0u.js} +1 -1
- package/dist/public/assets/stateDiagram-v2-QKLJ7IA2-BtYsWsIg.js +1 -0
- package/dist/public/assets/{target-navigation-intent-BKGZJzfb.js → target-navigation-intent-BZViEm6M.js} +1 -1
- package/dist/public/assets/{telemetry-impl-DQsr_8J4.js → telemetry-impl-DPRMO_b_.js} +2 -2
- package/dist/public/assets/{textarea-DECT2x7b.js → textarea-5ach84qM.js} +1 -1
- package/dist/public/assets/{timeline-definition-GMOUNBTQ-_uHiIDjf.js → timeline-definition-GMOUNBTQ-CLoe9y-z.js} +1 -1
- package/dist/public/assets/{toggle-group-CqR8P1U0.js → toggle-group-9ORKJ4oQ.js} +1 -1
- package/dist/public/assets/treeView-SZITEDCU-BjJ_gnFc.js +1 -0
- package/dist/public/assets/treemap-W4RFUUIX-DiV984fD.js +1 -0
- package/dist/public/assets/{typing-burst-detector-CXhMEzNx.js → typing-burst-detector-K-CfNoXw.js} +2 -2
- package/dist/public/assets/{vennDiagram-DHZGUBPP-BwneE_Sg.js → vennDiagram-DHZGUBPP-q2zdiy4F.js} +1 -1
- package/dist/public/assets/wardley-RL74JXVD-DbPCtCHV.js +1 -0
- package/dist/public/assets/{wardleyDiagram-NUSXRM2D-D1AodqH_.js → wardleyDiagram-NUSXRM2D-Njg6YHso.js} +1 -1
- package/dist/public/assets/{xychartDiagram-5P7HB3ND-9zuC0eMC.js → xychartDiagram-5P7HB3ND-Ct8Wgp45.js} +1 -1
- package/dist/public/index.html +25 -25
- package/dist/{repair-launch-json-BVtL3kCy.mjs → repair-launch-json-DKsMVH1M.mjs} +2 -2
- package/dist/{repair-mcp-configs-pWK5SBr3.mjs → repair-mcp-configs-BQ5B5SEm.mjs} +2 -2
- package/dist/{src-alwyUgEc.mjs → src-p510n6xV.mjs} +2 -2
- package/dist/{start-B_qddCkX.mjs → start--BCdrceO.mjs} +2 -2
- package/dist/start-CbVIel-D.mjs +1 -0
- package/package.json +1 -1
- package/dist/constants-n--3RKP-.mjs +0 -2
- package/dist/init-4KorX6rI.mjs +0 -1
- package/dist/loader-DlqrUrHi.mjs +0 -1
- package/dist/preview-BCWt39BR.mjs +0 -1
- package/dist/public/assets/ActivityModeContent-BqT9RtWA.js +0 -2
- package/dist/public/assets/ConsentDialogBody-Cxq7nXrG.js +0 -2
- package/dist/public/assets/DocumentContext-Cg2pKBP4.js +0 -52
- package/dist/public/assets/McpConsentDialogBody-_DJeXfdC.js +0 -1
- package/dist/public/assets/SettingsDialog-B-j9NFNZ.js +0 -11
- package/dist/public/assets/SourceEditor-CbzSX0iG.js +0 -2
- package/dist/public/assets/architecture-YZFGNWBL-haHjZ-W1.js +0 -1
- package/dist/public/assets/channel-CDgNg08A.js +0 -1
- package/dist/public/assets/chunk-426QAEUC-C43TcIY5.js +0 -1
- package/dist/public/assets/chunk-55IACEB6-mJDPihNE.js +0 -1
- package/dist/public/assets/chunk-QZHKN3VN-B5CMAE_s.js +0 -1
- package/dist/public/assets/classDiagram-6PBFFD2Q-B7OZyD7f.js +0 -1
- package/dist/public/assets/classDiagram-v2-HSJHXN6E-ByLnm7iZ.js +0 -1
- package/dist/public/assets/clone-DomZ2GAK.js +0 -1
- package/dist/public/assets/config-validation-events-BxoHnc7Y.js +0 -10
- package/dist/public/assets/dialog-B6Yo4QtX.js +0 -45
- package/dist/public/assets/dist-DbPwRkgP.js +0 -1
- package/dist/public/assets/dist-Qx1N2jU5.js +0 -1
- package/dist/public/assets/doc-hash-Ca3pPQw7.js +0 -423
- package/dist/public/assets/gitGraph-7Q5UKJZL-EPtzLtdn.js +0 -1
- package/dist/public/assets/index-CTDxIAjs.js +0 -1918
- package/dist/public/assets/index-Dgr6gLuG.css +0 -1
- package/dist/public/assets/info-OMHHGYJF-DhGHQOTJ.js +0 -1
- package/dist/public/assets/input-jeOsxRL6.js +0 -1
- package/dist/public/assets/isSymbol-DIRIUNhN.js +0 -1
- package/dist/public/assets/mcp-consent-store-BlzZxan6.js +0 -1
- package/dist/public/assets/packet-4T2RLAQJ-dOkbaGJi.js +0 -1
- package/dist/public/assets/pie-ZZUOXDRM-7mxWmZMD.js +0 -1
- package/dist/public/assets/radar-PYXPWWZC-CYrvwt0c.js +0 -1
- package/dist/public/assets/stateDiagram-v2-QKLJ7IA2-BsIimsLv.js +0 -1
- package/dist/public/assets/treeView-SZITEDCU-bf7fN5vg.js +0 -1
- package/dist/public/assets/treemap-W4RFUUIX-DeijdxYt.js +0 -1
- package/dist/public/assets/wardley-RL74JXVD-XbGOizT8.js +0 -1
- package/dist/start-CLPQ8L1O.mjs +0 -1
- /package/dist/public/assets/{__vite-browser-external-CCyf2WTU.js → __vite-browser-external-Bet_nOzq.js} +0 -0
- /package/dist/public/assets/{array-B4rubdDx.js → array-DfeqBzds.js} +0 -0
- /package/dist/public/assets/{colors-DTkp5rhC.js → colors-CuFmRbNJ.js} +0 -0
- /package/dist/public/assets/{cytoscape.esm-lL68JtBB.js → cytoscape.esm-C3hcpWGW.js} +0 -0
- /package/dist/public/assets/{defaultLocale-VDKImYxX.js → defaultLocale-CmG7Nywc.js} +0 -0
- /package/dist/public/assets/{dist-8vOhMUNR.js → dist-D3YXABda.js} +0 -0
- /package/dist/public/assets/{dist-Df8SLnPf.js → dist-GFox5lpz.js} +0 -0
- /package/dist/public/assets/{go-D1ad2i41.js → go-BjDSeE19.js} +0 -0
- /package/dist/public/assets/{init-B4uw1rya.js → init-D-V7N9g_.js} +0 -0
- /package/dist/public/assets/{isObjectLike-DkPsJ8ZC.js → isObjectLike-HLvQwJYx.js} +0 -0
- /package/dist/public/assets/{min-DTUJKQNu.js → min-CHzARyU6.js} +0 -0
- /package/dist/public/assets/{path-flVp2dgl.js → path-Bf8MP5yP.js} +0 -0
- /package/dist/public/assets/{pdf-zy6UKR6F.js → pdf-wFLJduM2.js} +0 -0
- /package/dist/public/assets/{pdf.worker-CETvIAHl.js → pdf.worker-CP44mBOj.js} +0 -0
- /package/dist/public/assets/{project-paths-CsGHlmFh.js → project-paths-DKT5BePl.js} +0 -0
- /package/dist/public/assets/{rough.esm-pmFy2cex.js → rough.esm-Di0388iR.js} +0 -0
- /package/dist/public/assets/{shell-FUK9YCOo.js → shell-184Lov7C.js} +0 -0
- /package/dist/public/assets/{src-CdWhPaRj.js → src-Dz70a8sm.js} +0 -0
- /package/dist/public/assets/{stex-BUy0wSq4.js → stex-ChE_gMQ6.js} +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{n as e,t}from"./esm-CEs3LWY3.mjs";import{pn as n}from"./dist-
|
|
1
|
+
import{n as e,t}from"./esm-CEs3LWY3.mjs";import{pn as n}from"./dist-DjC84IgZ.mjs";import{n as r}from"./constants-CQfcgXd1.mjs";import{spawn as i}from"node:child_process";import{join as a}from"node:path";import{closeSync as o,existsSync as s,mkdirSync as c,openSync as l,statSync as u}from"node:fs";import{homedir as d}from"node:os";import{setTimeout as f}from"node:timers/promises";const p=`Open Knowledge.app`,m=`/Applications/${p}`;function h(){return{platform:process.platform,env:process.env,execPath:process.execPath,isTTY:process.stdout.isTTY,statSync:e=>{try{return u(e,{throwIfNoEntry:!1})??null}catch{return null}}}}function g(e){if(e.env.ELECTRON_RUN_AS_NODE===`1`){let t=/(.+?\.app)\/Contents\/MacOS\//.exec(e.execPath);if(t?.[1])return t[1]}if(_(e,m))return m;let t=a(e.homeDir??d(),`Applications`,p);return _(e,t)?t:null}function _(e,t){try{let n=a(t,`Contents`,`MacOS`,`Open Knowledge`),r=e.statSync(n);return r&&typeof r.isFile==`function`?r.isFile():!1}catch{return!1}}function v(e){if(e.env.OK_FORCE_BROWSER===`1`)return{available:!1,reason:`force-browser`};if(e.platform!==`darwin`)return{available:!1,reason:`darwin-only`};let t;try{t=g(e)}catch{return{available:!1,reason:`stat-error`}}return t?e.env.OK_FORCE_DESKTOP===`1`?{available:!0,reason:`available`,bundlePath:t}:e.isTTY!==!0||e.env.SSH_CONNECTION||e.env.SSH_TTY?{available:!1,reason:`headless`,bundlePath:t}:{available:!0,reason:`available`,bundlePath:t}:{available:!1,reason:`no-bundle`}}function y(e){(e.log??(e=>console.error(e)))("Launching Open Knowledge desktop (use `ok start` for the browser server, or `OK_FORCE_BROWSER=1` to always skip)");let t={...process.env};delete t.ELECTRON_RUN_AS_NODE,e.spawn(`open`,[`-b`,`com.inkeep.open-knowledge`],{detached:!0,stdio:`ignore`,env:t}).unref()}function b(e=`no-bundle`){switch(e){case`no-bundle`:return`Desktop app not found at ${m}. Install via DMG, or omit --mode for browser mode.`;case`darwin-only`:return`Desktop app is macOS-only on this release. Use --mode=browser, or omit --mode for the server fallback.`;case`headless`:return`Desktop launch is gated in headless contexts (CI, SSH, non-TTY stdout). Set OK_FORCE_DESKTOP=1 to override, or use --mode=browser.`;case`force-browser`:return`OK_FORCE_BROWSER=1 is set — desktop dispatch is disabled. Unset it to use --mode=app.`;case`stat-error`:return`Failed to inspect desktop bundle at ${m} (filesystem error). Check permissions or use --mode=browser.`;case`available`:return`Desktop app appears available at ${m} but launch dispatch did not fire (caller bug).`}}function x(){let e=process.execPath,t=process.argv[1];return t?{command:e,prefixArgs:[t]}:(console.warn(`[self-spawn] process.argv[1] is empty — falling back to \`npx -y @inkeep/open-knowledge@latest\`. This re-introduces the registry-fetch surface that re-exec was fixing. Observed argv: ${JSON.stringify(process.argv)}`),{command:`npx`,prefixArgs:[`-y`,`@inkeep/open-knowledge@latest`]})}function S(e,t){return e.host??t.HOST??`localhost`}var C=class extends Error{cwd;constructor(e){super("This directory isn't set up yet. Run `ok init` first, then `ok start` again."),this.name=`OkDirMissingError`,this.cwd=e}};function w(e){return e.uiLock?e.isAlive(e.uiLock.pid)?{action:`skip`,reason:`alive`,pid:e.uiLock.pid,port:e.uiLock.port}:{action:`spawn`,reason:`stale`,stalePid:e.uiLock.pid}:{action:`spawn`,reason:`absent`}}function T(e){s(e.lockDir)||c(e.lockDir,{recursive:!0});let t=l(a(e.lockDir,`last-spawn-error.log`),`w`),n=e.spawn??i,{PORT:r,...u}=process.env,d=x();try{let r=n(d.command,[...d.prefixArgs,...e.args??[`ui`]],{detached:!0,stdio:[`ignore`,`ignore`,t],cwd:e.cwd,env:u});return r.unref(),r}finally{try{o(t)}catch{}}}async function E(e){let t=e.now()+e.timeoutMs;for(;e.now()<t;){let t=e.readUiLock();if(t&&t.port>0)return t.port;await e.sleep(e.pollIntervalMs)}let n=e.readUiLock();return n&&n.port>0?n.port:null}function D(e){let t=e.sigtermGraceMs??1e4,n=e.sigtermPollIntervalMs??200,r=e.sleep??(e=>f(e));return async()=>{try{let i=e.readUiLock();if(i&&e.isAlive(i.pid))try{e.killPid(i.pid,`SIGTERM`),e.log?.info({pid:i.pid,port:i.port},`idle-shutdown: SIGTERM UI sibling`);let a=Date.now()+t;for(;Date.now()<a&&e.isAlive(i.pid);)await r(n);if(e.isAlive(i.pid))try{e.killPid(i.pid,`SIGKILL`),e.log?.warn({pid:i.pid,graceMs:t},`idle-shutdown: SIGTERM grace expired — escalated to SIGKILL`)}catch(t){e.log?.error({pid:i.pid,err:t instanceof Error?t.message:String(t)},`idle-shutdown: SIGKILL failed`)}}catch(t){e.log?.warn({pid:i.pid,err:t instanceof Error?t.message:String(t)},`idle-shutdown: failed to SIGTERM UI sibling`)}}catch(t){e.log?.warn({err:t instanceof Error?t.message:String(t)},`idle-shutdown: UI lookup failed; proceeding with destroy`)}await e.destroy()}}async function O(e){let{config:t,cwd:r,host:i}=e,a=e.skipAutoInit??!1,o=e.skipUiAutoSpawn??!1,s=e.idleThresholdMs??18e5,{existsSync:c,mkdirSync:l}=await import(`node:fs`),{bootServer:u,getLogger:d,isProcessAlive:p,readUiLock:m,resolveContentDir:h}=await import(`./dist-kgy3NArq.mjs`),g=e.log??d(`start`);if(!a&&!n(r))throw new C(r);try{(e.repairMcpConfigsFn??(await import(`./repair-mcp-configs-BQ5B5SEm.mjs`)).repairMcpConfigs)({projectDir:r})}catch(e){g.warn({err:e},`[start] mcp-config repair sweep failed; continuing`)}try{(e.repairLaunchJsonFn??(await import(`./repair-launch-json-DKsMVH1M.mjs`)).repairLaunchJson)({projectDir:r})}catch(e){g.warn({err:e},`[start] launch.json repair sweep failed; continuing`)}let _=h(t,r);c(_)||(l(_,{recursive:!0}),g.info({contentDir:_},`Created content directory`));let v=null,y=await u({config:t,contentDir:_,projectDir:r,contentRoot:t.content.dir,port:e.port,host:i,quiet:!1,localOpCliArgs:[process.execPath,process.argv[1]],attachUiSibling:!0,idleShutdownMs:s,skipAutoInit:!0,spawnUiSiblingFn:async({lockDir:t})=>{if(v=w({uiLock:m(t),isAlive:p}),v.action===`spawn`&&!o)try{T({lockDir:t,cwd:r,spawn:e.spawn}),g.info({reason:v.reason},`[start] auto-spawned ok ui sibling`)}catch(e){console.warn(`[start] failed to auto-spawn ok ui: ${e instanceof Error?e.message:String(e)}`)}else v.action===`skip`&&g.info({port:v.port,pid:v.pid},`UI already running at port ${v.port}`)},idleShutdownHandler:e=>D({readUiLock:()=>m(y.lockDir),isAlive:p,killPid:(e,t)=>{process.kill(e,t)},destroy:e,log:g}),log:g});v||={action:`skip`,reason:`alive`,pid:0,port:0};let b=v,x=null;if(b.action===`skip`)x=b.port>0?b.port:null;else if(!o){let t=e.uiBindTimeoutMs??3e3;x=await E({readUiLock:()=>m(y.lockDir),now:Date.now,sleep:e=>f(e),timeoutMs:t,pollIntervalMs:50}),x===null&&g.warn({timeoutMs:t},`[start] ok ui did not bind within timeout — banner falls back to API URL`)}return{httpServer:y.httpServer,destroy:y.destroy,lockDir:y.lockDir,contentDir:_,port:y.port,ready:y.ready,degraded:y.degraded,uiSpawnDecision:v,resolvedUiPort:x}}function k(t){if(t===`browser`||t===`app`)return t;throw new e(`--mode must be 'browser' or 'app'`)}async function A(e,t){let{renderBanner:n}=await import(`./banner-COfNQySC.mjs`),{dim:i,error:a,warning:o}=await import(`./colors-BCE2jNgl.mjs`),s=process.cwd(),c=e,l=S(t,process.env),u=t.port===void 0?void 0:Number(t.port),d=process.env.PORT?Number(process.env.PORT):void 0,f=u??d,p;try{p=await O({config:c,cwd:s,host:l,port:f})}catch(e){e instanceof C&&(console.error(a(e.message)),process.exit(1));let t=j(e,s,await import(`./dist-kgy3NArq.mjs`));t!==null&&(console.error(a(t)),process.exit(1)),console.error(`${a(`Failed to start:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exit(1)}let m=!1,h=async e=>{if(!m){m=!0,console.log(i(`\nShutting down (${e})`));try{await p.destroy()}catch(e){console.error(`${a(`destroy() failed:`)} ${e instanceof Error?e.stack??e.message:String(e)}`),process.exitCode=1}process.exit(process.exitCode??0)}};process.once(`SIGINT`,()=>{h(`SIGINT`)}),process.once(`SIGTERM`,()=>{h(`SIGTERM`)});let g=`http://${l}:${p.port}`,_=l===`0.0.0.0`||l===`::`?`http://0.0.0.0:${p.port}`:void 0,v=p.resolvedUiPort,y=v!==null&&v>0?`http://${l}:${v}`:g;console.log(n({name:`open-knowledge`,version:r,localUrl:y,apiUrl:y===g?void 0:g,networkUrl:_}));let b={"shadow-repo":`Version history and branch-switch safety unavailable`,"file-watcher":`External file changes will not sync to the editor`,"head-watcher":`Git branch switches may cause document inconsistency`};p.ready.then(async()=>{if(p.degraded.length>0){console.log();for(let e of p.degraded){let t=b[e]??`${e} (check server logs for details)`;console.warn(` ${o(`⚠`)} ${o(e)}: ${i(t)}`)}console.log()}if(t.open){let{openBrowser:e}=await import(`./open-browser-Be-7qaQ9.mjs`);e(y)}}).catch(e=>{console.error(` ${a(`Server initialization failed:`)} ${e instanceof Error?e.message:String(e)}`)})}function j(e,t,n){let r=n.ServerLockCollisionError;if(r===void 0||!(e instanceof r))return null;try{let e=a(t,`.ok`),r=n.readServerLock(e);return r?r.kind===`interactive`?`Open Knowledge desktop is currently running on this project. Quit it or use --cwd to point elsewhere.`:r.kind===`mcp-spawned`?"An MCP-spawned server holds this lock; it should release on idle-shutdown (~30 min). Or run `ok stop`.":"Open Knowledge server is already running on this project — check `ok status` or `ok stop`.":"Open Knowledge server is already running on this project — check `ok status` or `ok stop`."}catch{return null}}function M(e){return new t(`start`).description(`Start the knowledge base collab server`).option(`-p, --port <port>`,`Server port`,void 0).option(`-H, --host <host>`,`Server host`,void 0).option(`--open`,`Open browser after start`).option(`--mode <mode>`,`Force dispatch mode: 'browser' or 'app'`,k).action(async t=>{let n=e();if(t.mode===`app`){t.open&&(process.stderr.write(`error: option '--mode=app' cannot be combined with '--open' (--open opens a browser tab against the local server, which app mode does not boot)
|
|
2
2
|
`),process.exit(2));let e=[];if(t.port!==void 0&&e.push(`--port`),t.host!==void 0&&e.push(`--host`),e.length>0){let t=process.env.OK_LOG_LEVEL??`info`;(t===`debug`||t===`trace`)&&console.error(`--mode=app: ignoring ${e.join(`, `)}`)}let n=v(h());if(n.available){y({spawn:i});return}console.error(b(n.reason)),process.exit(1)}await A(n,t)})}export{w as a,T as c,x as d,h as f,D as i,M as l,y as m,E as n,S as o,v as p,O as r,A as s,C as t,j as u};
|
|
3
|
-
//# sourceMappingURL=start
|
|
3
|
+
//# sourceMappingURL=start--BCdrceO.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l as e}from"./start--BCdrceO.mjs";export{e as startCommand};
|
package/package.json
CHANGED
package/dist/init-4KorX6rI.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as e}from"./init-CZQOVWec.mjs";export{e as runInit};
|
package/dist/loader-DlqrUrHi.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./loader-BthnLVYV.mjs";export{e as loadConfig};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,t}from"./preview-Dp1J-57V.mjs";export{t as formatPreviewBlock,e as previewContent};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ActivityPanelDiffView-DwtPYJgT.js","./chunk-CFjPhJqf.js","./compiler-runtime-CVnuRdak.js","./ActivityPanelDiffView-legcy4jI.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{o as e}from"./chunk-CFjPhJqf.js";import{t}from"./preload-helper-2ej06EnG.js";import{n,r,t as i}from"./compiler-runtime-CVnuRdak.js";import{Jn as a,Xn as o,Zn as s,it as c,kn as l,n as u,r as d}from"./DocumentContext-Cg2pKBP4.js";import{$ as f,D as p,E as m,Q as h,g,k as _,zt as v}from"./doc-hash-Ca3pPQw7.js";import{S as y,t as b}from"./button-BigAOfY9.js";import{f as x,i as S,m as C,r as w,t as T}from"./agent-presence-LoQiwUUV.js";import{a as E,b as D,c as O,i as k,o as ee,s as te,t as ne}from"./dialog-B6Yo4QtX.js";var re=y(`rewind`,[[`path`,{d:`M12 6a2 2 0 0 0-3.414-1.414l-6 6a2 2 0 0 0 0 2.828l6 6A2 2 0 0 0 12 18z`,key:`2a1g8i`}],[`path`,{d:`M22 6a2 2 0 0 0-3.414-1.414l-6 6a2 2 0 0 0 0 2.828l6 6A2 2 0 0 0 22 18z`,key:`rg3s36`}]]),A=i(),j=e(n(),1),ie=500,ae=64;async function oe(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=v.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=h.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 se(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=v.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 ce(e){let t=(0,A.c)(23),{systemProvider:n}=u(),[r,i]=(0,j.useState)(null),[a,o]=(0,j.useState)(`idle`),[s,c]=(0,j.useState)(null),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=new S(ae),t[0]=l):l=t[0];let d=(0,j.useRef)(l),f=(0,j.useRef)(0),p;t[1]===n?p=t[2]:(p=e=>{let t=f.current+=1;o(`loading`),c(null),oe(e).then(r=>{if(f.current!==t)return;let a=ue(n,e);i({...r,writingDocs:a}),o(`ready`)}).catch(e=>{f.current===t&&(c(e instanceof Error?e.message:String(e)),o(`error`))})},t[1]=n,t[2]=p);let m=p,h;t[3]!==e||t[4]!==m?(h=()=>{if(!e){f.current+=1,i(null),o(`idle`),c(null),d.current.clear();return}d.current.clear(),m(e);let t=null,n=g(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 _;t[6]===e?_=t[7]:(_=[e],t[6]=e,t[7]=_),(0,j.useEffect)(h,_);let v,y;t[8]!==e||t[9]!==n?(v=()=>{if(!e||!n)return;let t=()=>{if(!n.awareness)return;let t=ue(n,e);i(e=>!e||le(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)}},y=[e,n],t[8]=e,t[9]=n,t[10]=v,t[11]=y):(v=t[10],y=t[11]),(0,j.useEffect)(v,y);let b;t[12]===e?b=t[13]:(b=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 se(e,t,n);return d.current.set(r,a),a},t[12]=e,t[13]=b);let x=b,C;t[14]!==e||t[15]!==m?(C=()=>{e&&m(e)},t[14]=e,t[15]=m,t[16]=C):C=t[16];let w=C,T;return t[17]!==r||t[18]!==s||t[19]!==x||t[20]!==w||t[21]!==a?(T={data:r,status:a,error:s,reload:w,fetchBurstDiff:x},t[17]=r,t[18]=s,t[19]=x,t[20]=w,t[21]=a,t[22]=T):T=t[22],T}function le(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function ue(e,t){let n=new Set;if(!e)return n;let r=e.awareness;if(!T(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 M=r(),de=(0,j.lazy)(async()=>({default:(await t(()=>import(`./ActivityPanelDiffView-DwtPYJgT.js`),__vite__mapDeps([0,1,2,3]),import.meta.url)).ActivityPanelDiffView}));function fe(e,t){let n=Math.max(0,t-e);return n<6e4?`${Math.round(n/1e3)}s ago`:n<36e5?`${Math.round(n/6e4)}m ago`:new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function pe(e){let t=(0,A.c)(38),{burst:n,docName:r,fetchBurstDiff:i}=e,[a,c]=(0,j.useState)(!1),[l,u]=(0,j.useState)(null),[d,f]=(0,j.useState)(null),[p,m]=(0,j.useState)(!1),[h,g]=(0,j.useState)(N),_,v;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>{let e=setInterval(()=>g(Date.now()),3e4);return()=>clearInterval(e)},v=[],t[0]=_,t[1]=v):(_=t[0],v=t[1]),(0,j.useEffect)(_,v);let y;t[2]!==n.stackIndex||t[3]!==l||t[4]!==r||t[5]!==a||t[6]!==i||t[7]!==p?(y=()=>{let e=!a;c(e),e&&l===null&&!p&&(m(!0),f(null),i(r,n.stackIndex).then(e=>{u(e),m(!1)}).catch(e=>{f(e instanceof Error?e.message:String(e)),m(!1)}))},t[2]=n.stackIndex,t[3]=l,t[4]=r,t[5]=a,t[6]=i,t[7]=p,t[8]=y):y=t[8];let b=y,x=`${a?`Collapse`:`Expand`} burst ${n.stackIndex+1} diff`,S;t[9]===a?S=t[10]:(S=a?(0,M.jsx)(s,{className:`size-3 shrink-0`,"aria-hidden":`true`}):(0,M.jsx)(o,{className:`size-3 shrink-0`,"aria-hidden":`true`}),t[9]=a,t[10]=S);let C;t[11]!==n.ts||t[12]!==h?(C=fe(n.ts,h),t[11]=n.ts,t[12]=h,t[13]=C):C=t[13];let w;t[14]===C?w=t[15]:(w=(0,M.jsx)(`span`,{className:`font-mono`,children:C}),t[14]=C,t[15]=w);let T;t[16]===n.additions?T=t[17]:(T=(0,M.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additions]}),t[16]=n.additions,t[17]=T);let E;t[18]===n.deletions?E=t[19]:(E=(0,M.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletions]}),t[18]=n.deletions,t[19]=E);let D;t[20]!==T||t[21]!==E?(D=(0,M.jsxs)(`span`,{className:`ml-auto font-mono`,children:[T,` `,E]}),t[20]=T,t[21]=E,t[22]=D):D=t[22];let O;t[23]!==a||t[24]!==D||t[25]!==x||t[26]!==S||t[27]!==w||t[28]!==b?(O=(0,M.jsxs)(`button`,{type:`button`,onClick:b,className:`flex w-full items-center gap-2 px-4 py-1.5 text-xs text-muted-foreground hover:bg-muted/40`,"aria-expanded":a,"aria-label":x,children:[S,w,D]}),t[23]=a,t[24]=D,t[25]=x,t[26]=S,t[27]=w,t[28]=b,t[29]=O):O=t[29];let k;t[30]!==l||t[31]!==a||t[32]!==d||t[33]!==p?(k=a?(0,M.jsx)(`div`,{className:`bg-muted/20`,children:p?(0,M.jsx)(`div`,{className:`px-4 py-2 text-xs text-muted-foreground italic`,children:`Loading diff`}):d?(0,M.jsxs)(`div`,{className:`px-4 py-2 text-xs text-destructive`,children:[`Failed: `,d]}):l===null?(0,M.jsx)(`div`,{className:`px-4 py-2 text-xs text-muted-foreground italic`,children:`No diff.`}):(0,M.jsx)(j.Suspense,{fallback:(0,M.jsx)(`div`,{className:`px-4 py-2 text-xs text-muted-foreground italic`,children:`Loading diff`}),children:(0,M.jsx)(de,{diff:l})})}):null,t[30]=l,t[31]=a,t[32]=d,t[33]=p,t[34]=k):k=t[34];let ee;return t[35]!==O||t[36]!==k?(ee=(0,M.jsxs)(`div`,{className:`border-t border-border/50`,children:[O,k]}),t[35]=O,t[36]=k,t[37]=ee):ee=t[37],ee}function N(){return Date.now()}function me(e,t){let n=Math.max(0,t-e);return n<6e4?`${Math.round(n/1e3)}s ago`:n<36e5?`${Math.round(n/6e4)}m ago`:`${Math.round(n/36e5)}h ago`}function P(e){let t=(0,A.c)(93),{file:n,sessionAlive:r,isWriting:i,onNavigate:a,onUndoLast:c,onUndoAll:l,fetchBurstDiff:u}=e,[d,f]=(0,j.useState)(!1),[h,g]=(0,j.useState)(!1),[v,y]=(0,j.useState)(!1),[S,C]=(0,j.useState)(ge),w,T;if(t[0]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>{let e=setInterval(()=>C(Date.now()),3e4);return()=>clearInterval(e)},T=[],t[0]=w,t[1]=T):(w=t[0],T=t[1]),(0,j.useEffect)(w,T),n.bursts.length===0)return null;let D=!r||n.bursts.length===0||v,ie=r?n.bursts.length===0?`Nothing to undo on this file`:null:`Session ended — undo unavailable`,ae;t[2]!==D||t[3]!==n.docName||t[4]!==c?(ae=e=>{e.stopPropagation(),!D&&(y(!0),Promise.resolve(c(n.docName)).finally(()=>y(!1)))},t[2]=D,t[3]=n.docName,t[4]=c,t[5]=ae):ae=t[5];let oe=ae,se;t[6]===D?se=t[7]:(se=e=>{e.stopPropagation(),!D&&g(!0)},t[6]=D,t[7]=se);let ce=se,le;t[8]!==D||t[9]!==n.docName||t[10]!==l?(le=()=>{g(!1),!D&&(y(!0),Promise.resolve(l(n.docName)).finally(()=>y(!1)))},t[8]=D,t[9]=n.docName,t[10]=l,t[11]=le):le=t[11];let ue=le,de;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(de=()=>f(he),t[12]=de):de=t[12];let fe=d?`Collapse ${n.docName}`:`Expand ${n.docName}`,N;t[13]===d?N=t[14]:(N=d?(0,M.jsx)(s,{className:`size-4`,"aria-hidden":`true`}):(0,M.jsx)(o,{className:`size-4`,"aria-hidden":`true`}),t[13]=d,t[14]=N);let P;t[15]!==d||t[16]!==fe||t[17]!==N?(P=(0,M.jsx)(`button`,{type:`button`,onClick:de,className:`flex size-5 shrink-0 items-center justify-center rounded hover:bg-muted`,"aria-expanded":d,"aria-label":fe,"data-testid":`activity-panel-file-row-carrot`,children:N}),t[15]=d,t[16]=fe,t[17]=N,t[18]=P):P=t[18];let F;t[19]!==n.docName||t[20]!==a?(F=()=>a(n.docName),t[19]=n.docName,t[20]=a,t[21]=F):F=t[21];let _e=`Navigate to ${n.docName}`,I;t[22]!==n.docName||t[23]!==F||t[24]!==_e?(I=(0,M.jsx)(`button`,{type:`button`,onClick:F,className:`min-w-0 flex-1 truncate text-left text-foreground hover:underline focus-visible:outline-ring`,"aria-label":_e,"data-testid":`activity-panel-file-row-filename`,title:n.docName,children:n.docName}),t[22]=n.docName,t[23]=F,t[24]=_e,t[25]=I):I=t[25];let ve=`Undo last edit on ${n.docName}`,ye;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,M.jsx)(x,{className:`size-3.5`,"aria-hidden":`true`}),t[26]=ye):ye=t[26];let L;t[27]!==D||t[28]!==oe||t[29]!==ve?(L=(0,M.jsx)(_,{asChild:!0,children:(0,M.jsx)(b,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6 shrink-0`,onClick:oe,disabled:D,"aria-label":ve,"data-testid":`activity-panel-undo-last`,children:ye})}),t[27]=D,t[28]=oe,t[29]=ve,t[30]=L):L=t[30];let be=ie??`Undo last edit`,R;t[31]===be?R=t[32]:(R=(0,M.jsx)(p,{side:`bottom`,children:be}),t[31]=be,t[32]=R);let z;t[33]!==L||t[34]!==R?(z=(0,M.jsxs)(m,{children:[L,R]}),t[33]=L,t[34]=R,t[35]=z):z=t[35];let xe=`Undo all edits on ${n.docName}`,Se;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(Se=(0,M.jsx)(re,{className:`size-3.5`,"aria-hidden":`true`}),t[36]=Se):Se=t[36];let B;t[37]!==D||t[38]!==ce||t[39]!==xe?(B=(0,M.jsx)(_,{asChild:!0,children:(0,M.jsx)(b,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6 shrink-0`,onClick:ce,disabled:D,"aria-label":xe,"data-testid":`activity-panel-undo-all`,children:Se})}),t[37]=D,t[38]=ce,t[39]=xe,t[40]=B):B=t[40];let Ce=ie??`Undo all edits`,V;t[41]===Ce?V=t[42]:(V=(0,M.jsx)(p,{side:`bottom`,children:Ce}),t[41]=Ce,t[42]=V);let H;t[43]!==B||t[44]!==V?(H=(0,M.jsxs)(m,{children:[B,V]}),t[43]=B,t[44]=V,t[45]=H):H=t[45];let U;t[46]===n.additionsTotal?U=t[47]:(U=(0,M.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additionsTotal]}),t[46]=n.additionsTotal,t[47]=U);let W;t[48]===n.deletionsTotal?W=t[49]:(W=(0,M.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletionsTotal]}),t[48]=n.deletionsTotal,t[49]=W);let G;t[50]!==U||t[51]!==W?(G=(0,M.jsxs)(`span`,{className:`shrink-0 font-mono text-xs`,children:[U,` `,W]}),t[50]=U,t[51]=W,t[52]=G):G=t[52];let K;t[53]!==n.lastTs||t[54]!==S?(K=me(n.lastTs,S),t[53]=n.lastTs,t[54]=S,t[55]=K):K=t[55];let q;t[56]===K?q=t[57]:(q=(0,M.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:K}),t[56]=K,t[57]=q);let J;t[58]===i?J=t[59]:(J=i?(0,M.jsx)(`span`,{className:`shrink-0 text-[11px] text-primary animate-pulse`,role:`status`,children:`writing`}):null,t[58]=i,t[59]=J);let Y;t[60]!==I||t[61]!==z||t[62]!==H||t[63]!==G||t[64]!==q||t[65]!==J||t[66]!==P?(Y=(0,M.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 text-sm`,children:[P,I,z,H,G,q,J]}),t[60]=I,t[61]=z,t[62]=H,t[63]=G,t[64]=q,t[65]=J,t[66]=P,t[67]=Y):Y=t[67];let X;t[68]!==d||t[69]!==u||t[70]!==n.bursts||t[71]!==n.docName?(X=d?(0,M.jsx)(`div`,{children:n.bursts.map(e=>(0,M.jsx)(pe,{burst:e,docName:n.docName,fetchBurstDiff:u},`${n.docName}:${e.stackIndex}`))}):null,t[68]=d,t[69]=u,t[70]=n.bursts,t[71]=n.docName,t[72]=X):X=t[72];let we;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,M.jsx)(O,{children:`Undo all edits on this file?`}),t[73]=we):we=t[73];let Z;t[74]===n.docName?Z=t[75]:(Z=(0,M.jsx)(`span`,{className:`font-mono text-foreground`,children:n.docName}),t[74]=n.docName,t[75]=Z);let Te=n.bursts.length===1?``:`s`,Q;t[76]!==n.bursts.length||t[77]!==Z||t[78]!==Te?(Q=(0,M.jsxs)(te,{children:[we,(0,M.jsxs)(E,{children:[`This will revert every change this agent has made to`,` `,Z,` in their current session (`,n.bursts.length,` burst`,Te,`). Other files and other writers are not affected.`]})]}),t[76]=n.bursts.length,t[77]=Z,t[78]=Te,t[79]=Q):Q=t[79];let Ee;t[80]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=(0,M.jsx)(b,{type:`button`,variant:`outline`,onClick:()=>g(!1),"data-testid":`activity-panel-undo-all-cancel`,children:`Cancel`}),t[80]=Ee):Ee=t[80];let $;t[81]===ue?$=t[82]:($=(0,M.jsxs)(ee,{children:[Ee,(0,M.jsx)(b,{type:`button`,variant:`destructive`,onClick:ue,"data-testid":`activity-panel-undo-all-confirm`,children:`Undo all`})]}),t[81]=ue,t[82]=$);let De;t[83]!==Q||t[84]!==$?(De=(0,M.jsxs)(k,{className:`sm:max-w-md`,children:[Q,$]}),t[83]=Q,t[84]=$,t[85]=De):De=t[85];let Oe;t[86]!==h||t[87]!==De?(Oe=(0,M.jsx)(ne,{open:h,onOpenChange:g,children:De}),t[86]=h,t[87]=De,t[88]=Oe):Oe=t[88];let ke;return t[89]!==Y||t[90]!==X||t[91]!==Oe?(ke=(0,M.jsxs)(`div`,{className:`border-b border-border`,"data-testid":`activity-panel-file-row`,children:[Y,X,Oe]}),t[89]=Y,t[90]=X,t[91]=Oe,t[92]=ke):ke=t[92],ke}function he(e){return!e}function ge(){return Date.now()}async function F(e){let t=await fetch(`/api/agent-undo`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...e,agentId:e.connectionId})});if(!t.ok)throw Error(`agent-undo failed: HTTP ${t.status}`)}function _e(e){return`#/${e.split(`/`).map(e=>encodeURIComponent(e)).join(`/`)}`}function I(e){typeof window>`u`||(window.location.hash=_e(e))}function ve(){let e=(0,A.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,M.jsxs)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,role:`status`,"aria-busy":`true`,children:[(0,M.jsx)(l,{className:`mr-2 size-4 animate-spin`,"aria-hidden":`true`}),(0,M.jsx)(`span`,{className:`text-sm`,children:`Loading agent activity`})]}),e[0]=t):t=e[0],t}function ye(e){let t=(0,A.c)(9),{error:n,onRetry:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,M.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,M.jsx)(`p`,{className:`text-sm font-medium`,children:`Failed to load activity`}),t[1]=o):o=t[1];let s;t[2]===n?s=t[3]:(s=(0,M.jsxs)(`div`,{className:`space-y-1`,children:[o,(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n})]}),t[2]=n,t[3]=s);let c;t[4]===r?c=t[5]:(c=(0,M.jsx)(b,{type:`button`,variant:`outline`,size:`sm`,onClick:r,children:`Retry`}),t[4]=r,t[5]=c);let l;return t[6]!==s||t[7]!==c?(l=(0,M.jsxs)(`div`,{className:`flex flex-col items-center gap-3 p-6 text-center`,role:`alert`,"data-testid":`activity-panel-error`,children:[i,s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8],l}function L(){let e=(0,A.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,M.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,"data-testid":`activity-panel-empty`,children:(0,M.jsx)(`p`,{className:`text-sm italic`,children:`No edits yet.`})}),e[0]=t):t=e[0],t}function be(e){let t=(0,A.c)(9),{onExit:n,showBackButton:r}=e,i;t[0]!==n||t[1]!==r?(i=r?(0,M.jsx)(R,{onClick:n}):null,t[0]=n,t[1]=r,t[2]=i):i=t[2];let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,M.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:`Agent activity`}),t[3]=a):a=t[3];let o;t[4]===i?o=t[5]:(o=(0,M.jsxs)(`div`,{className:`flex shrink-0 flex-row items-center gap-2 border-b border-border px-3 py-2`,children:[i,a]}),t[4]=i,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,M.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-6 text-muted-foreground`,children:(0,M.jsx)(`p`,{className:`text-center text-sm italic`,children:`Click an agent's avatar in the presence bar to view their session.`})}),t[6]=s):s=t[6];let c;return t[7]===o?c=t[8]:(c=(0,M.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel-no-agent`,"aria-label":`Agent activity`,children:[o,s]}),t[7]=o,t[8]=c),c}function R(e){let t=(0,A.c)(6),{onClick:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,M.jsx)(C,{}),t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i=(0,M.jsx)(_,{asChild:!0,children:(0,M.jsx)(b,{type:`button`,variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,onClick:n,"aria-label":`Back to document view`,"data-testid":`docpanel-exit-agent-mode`,children:r})}),t[1]=n,t[2]=i);let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,M.jsx)(p,{side:`bottom`,children:`Back to document view`}),t[3]=a):a=t[3];let o;return t[4]===i?o=t[5]:(o=(0,M.jsxs)(m,{children:[i,a]}),t[4]=i,t[5]=o),o}function z(e){let t=(0,A.c)(9),{lastTs:n}=e,[r]=(0,j.useState)(xe),i;t[0]!==n||t[1]!==r?(i=n?Se(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,M.jsx)(`span`,{className:`font-medium`,children:`Session ended`}),t[3]=o):o=t[3];let s;t[4]===a?s=t[5]:(s=a?(0,M.jsxs)(`span`,{children:[` · `,a]}):null,t[4]=a,t[5]=s);let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,M.jsx)(`div`,{className:`mt-1 opacity-80`,children:`Undo buttons are disabled — per-session state has been garbage-collected.`}),t[6]=c):c=t[6];let l;return t[7]===s?l=t[8]:(l=(0,M.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 xe(){return Date.now()}function Se(e){let t=Math.max(0,e);return t<6e4?`${Math.round(t/1e3)}s ago`:t<36e5?`${Math.round(t/6e4)}m ago`:`${Math.round(t/36e5)}h ago`}function B(e){let t=(0,A.c)(10),{agent:n,size:r}=e,i=r===void 0?28:r,a;t[0]!==n.color||t[1]!==i?(a={backgroundColor:n.color,width:i,height:i},t[0]=n.color,t[1]=i,t[2]=a):a=t[2];let o=i*.57,s=i*.57,c;t[3]!==n.icon||t[4]!==o||t[5]!==s?(c=(0,M.jsx)(w,{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,M.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 Ce(e){let t=(0,A.c)(22),{data:n,status:r,error:i,reload:a,fetchBurstDiff:o,onExit:s,onNavigate:c,onUndoLast:l,onUndoAll:u,showBackButton:d}=e,f=n?.files?.[0]?.lastTs??null,p;t[0]!==s||t[1]!==d?(p=d?(0,M.jsx)(R,{onClick:s}):null,t[0]=s,t[1]=d,t[2]=p):p=t[2];let m;t[3]!==n||t[4]!==f?(m=n?.agent?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(B,{agent:n.agent}),(0,M.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,M.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:n.agent.displayName}),(0,M.jsxs)(`p`,{className:`truncate text-xs text-muted-foreground`,children:[n.sessionAlive?`Active`:f===null?`No edit session yet`:`Ended`,n.files.length>0?` · ${n.files.length} file${n.files.length===1?``:`s`}`:``]})]})]}):(0,M.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,M.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:`Agent activity`})}),t[3]=n,t[4]=f,t[5]=m):m=t[5];let h;t[6]!==p||t[7]!==m?(h=(0,M.jsxs)(`div`,{className:`flex flex-row items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[p,m]}),t[6]=p,t[7]=m,t[8]=h):h=t[8];let g;t[9]!==n||t[10]!==i||t[11]!==o||t[12]!==f||t[13]!==c||t[14]!==u||t[15]!==l||t[16]!==a||t[17]!==r?(g=(0,M.jsx)(`div`,{className:`flex-1 overflow-y-auto`,"data-testid":`activity-panel-body`,children:r===`loading`&&n===null?(0,M.jsx)(ve,{}):r===`error`&&i?(0,M.jsx)(ye,{error:i,onRetry:a}):n===null?(0,M.jsx)(L,{}):(0,M.jsxs)(M.Fragment,{children:[!n.sessionAlive&&f!==null?(0,M.jsx)(z,{lastTs:f}):null,n.files.length===0?(0,M.jsx)(L,{}):n.files.map(e=>(0,M.jsx)(P,{file:e,sessionAlive:n.sessionAlive,isWriting:n.writingDocs.has(e.docName),onNavigate:c,onUndoLast:l,onUndoAll:u,fetchBurstDiff:o},e.docName))]})}),t[9]=n,t[10]=i,t[11]=o,t[12]=f,t[13]=c,t[14]=u,t[15]=l,t[16]=a,t[17]=r,t[18]=g):g=t[18];let _;return t[19]!==h||t[20]!==g?(_=(0,M.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel`,"aria-label":`Agent activity`,children:[h,g]}),t[19]=h,t[20]=g,t[21]=_):_=t[21],_}function V(e){let t=(0,A.c)(26),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,{docPanelAgentId:a,closeActivityPanel:o}=u(),{openDocumentTransition:s}=d(),{data:c,status:l,error:f,reload:p,fetchBurstDiff:m}=ce(a);if(a===null){let e;return t[2]!==o||t[3]!==i?(e=(0,M.jsx)(be,{onExit:o,showBackButton:i}),t[2]=o,t[3]=i,t[4]=e):e=t[4],e}let h;t[5]===s?h=t[6]:(h=e=>{s(e),I(e)},t[5]=s,t[6]=h);let g=h,_;t[7]!==c||t[8]!==a||t[9]!==p?(_=async e=>{try{await F({connectionId:a,docName:e,scope:`last`,agentName:c?.agent?.displayName}),p()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);D.error(`Undo failed: ${n}`),p()}},t[7]=c,t[8]=a,t[9]=p,t[10]=_):_=t[10];let v=_,y;t[11]!==c||t[12]!==a||t[13]!==p?(y=async e=>{try{await F({connectionId:a,docName:e,scope:`file`,agentName:c?.agent?.displayName}),D.success(`Undone all edits on ${e}`),p()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);D.error(`Undo all failed: ${n}`),p()}},t[11]=c,t[12]=a,t[13]=p,t[14]=y):y=t[14];let b=y,x;return t[15]!==o||t[16]!==c||t[17]!==f||t[18]!==m||t[19]!==g||t[20]!==b||t[21]!==v||t[22]!==p||t[23]!==i||t[24]!==l?(x=(0,M.jsx)(Ce,{data:c,status:l,error:f,reload:p,fetchBurstDiff:m,onExit:o,onNavigate:g,onUndoLast:v,onUndoAll:b,showBackButton:i}),t[15]=o,t[16]=c,t[17]=f,t[18]=m,t[19]=g,t[20]=b,t[21]=v,t[22]=p,t[23]=i,t[24]=l,t[25]=x):x=t[25],x}export{V as ActivityModeContent};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CFjPhJqf.js";import{n as t,r as n,t as r}from"./compiler-runtime-CVnuRdak.js";import{t as i}from"./button-BigAOfY9.js";import{a,b as o,c as s,i as c,n as l,o as u,s as ee,t as te}from"./dialog-B6Yo4QtX.js";import{t as ne}from"./input-jeOsxRL6.js";import{n as re,r as d,t as ie}from"./project-paths-CsGHlmFh.js";import{t as ae}from"./textarea-DECT2x7b.js";var oe=r(),f=e(t(),1),p=n(),se=750,ce={root:`You picked the filesystem root (/). Scaffolding here will scan every file on this machine — make sure that's what you want.`,home:`You picked your home directory. OK will index everything in your home tree — large and may surface personal files.`,"home-documents":`You picked ~/Documents. OK will index every markdown file under it. If you only want to manage a sub-folder, choose a smaller scope.`,"home-desktop":`You picked ~/Desktop. OK will index everything on your desktop.`,"home-downloads":`You picked ~/Downloads. Files there are usually transient — consider a stable folder instead.`,"volumes-mount":`This path is on an external volume (/Volumes/...). OK will lose track of files when the drive ejects.`,"drive-root":`This looks like a drive root (e.g., C:\\). Scaffolding here will scan an entire drive.`},m={error:e=>o.error(e)};function le(e){let t=(0,oe.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?d:r,s=i===void 0?m: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,p.jsx)(h,{payload:l,store:o,toast:s}),t[5]=l,t[6]=o,t[7]=s,t[8]=u):u=t[8],u}function h(e){let t=(0,oe.c)(96),{payload:n,store:r,toast:o}=e,[d,ce]=(0,f.useState)(n.defaultContentDir),[m,le]=(0,f.useState)(``),h;t[0]===n.editorOptions?h=t[1]:(h=()=>new Set(n.editorOptions.map(de)),t[0]=n.editorOptions,t[1]=h);let[g,pe]=(0,f.useState)(h),[me,he]=(0,f.useState)(null),[_,v]=(0,f.useState)(!1),[y,b]=(0,f.useState)(null),ge,_e;t[2]===d?(ge=t[3],_e=t[4]):(ge=()=>{if(!ie(d)){he(null);return}let e=!1,t=setTimeout(()=>{let t=window.okDesktop;t&&t.onboarding.probeContent({contentDir:d}).then(t=>{e||he(t)}).catch(t=>{e||he({ok:!1,error:t instanceof Error?t.message:`probe failed`})})},se);return()=>{e=!0,clearTimeout(t)}},_e=[d],t[2]=d,t[3]=ge,t[4]=_e),(0,f.useEffect)(ge,_e);let ve;t[5]===d?ve=t[6]:(ve=ie(d),t[5]=d,t[6]=ve);let x=ve,S=_||!x,C;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(C=function(e){pe(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[7]=C):C=t[7];let ye=C,w;t[8]===n.projectDir?w=t[9]:(w=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;b(t instanceof Error?t.message:`Could not open folder picker`);return}if(t===null)return;let r=re(n.projectDir,t);if(r===null){b(`Selection must be inside the project`);return}b(null),ce(r)},t[8]=n.projectDir,t[9]=w);let be=w,T;t[10]!==m||t[11]!==d||t[12]!==g||t[13]!==r||t[14]!==o?(T=async function(){v(!0);let e=await r.confirm({initGit:!0,contentDir:d,additionalIgnores:m,editorIds:Array.from(g)});e.ok||(o.error(e.error),v(!1))},t[10]=m,t[11]=d,t[12]=g,t[13]=r,t[14]=o,t[15]=T):T=t[15];let xe=T,E;t[16]!==xe||t[17]!==S?(E=function(e){e.preventDefault(),!S&&xe()},t[16]=xe,t[17]=S,t[18]=E):E=t[18];let Se=E,D;t[19]!==r||t[20]!==o?(D=async function(){v(!0);let e=await r.cancel();e.ok||(o.error(e.error),v(!1))},t[19]=r,t[20]=o,t[21]=D):D=t[21];let O=D,k;t[22]!==_||t[23]!==O?(k=function(e){!e&&!_&&O()},t[22]=_,t[23]=O,t[24]=k):k=t[24];let Ce=k,A;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,p.jsx)(s,{children:`Open this folder with Open Knowledge`}),t[25]=A):A=t[25];let j;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,p.jsxs)(ee,{children:[A,(0,p.jsxs)(a,{children:[`Open Knowledge will create a `,(0,p.jsx)(`code`,{children:`.ok/`}),` folder to track this project's metadata. Click Start to proceed with the defaults below — adjust any field first, or Cancel to leave the folder untouched.`]})]}),t[26]=j):j=t[26];let M;t[27]!==n.gitRootPromoted||t[28]!==n.pickedPath||t[29]!==n.projectDir?(M=n.gitRootPromoted?(0,p.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`OK will be initialized at `,(0,p.jsx)(`code`,{children:n.projectDir}),` — the parent of`,` `,(0,p.jsx)(`code`,{children:re(n.projectDir,n.pickedPath)??n.pickedPath}),` `,`because it contains a `,(0,p.jsx)(`code`,{children:`.git`}),` folder (one .ok/ per git repo).`,` `,(0,p.jsx)(`code`,{children:`Content directory`}),` defaults to `,(0,p.jsx)(`code`,{children:`.`}),` (the whole repo); type a sub-folder below to narrow it.`]}):null,t[27]=n.gitRootPromoted,t[28]=n.pickedPath,t[29]=n.projectDir,t[30]=M):M=t[30];let N;t[31]===n.warnings?N=t[32]:(N=n.warnings.length>0?(0,p.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(ue)}):null,t[31]=n.warnings,t[32]=N);let P;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,p.jsx)(`label`,{htmlFor:`consent-content-dir`,className:`mb-1 block text-sm font-medium`,children:`Content directory`}),t[33]=P):P=t[33];let F;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(F=e=>{ce(e.target.value),b(null)},t[34]=F):F=t[34];let we=!x,I;t[35]!==_||t[36]!==d||t[37]!==we?(I=(0,p.jsx)(ne,{id:`consent-content-dir`,value:d,onChange:F,disabled:_,"aria-invalid":we,"data-testid":`consent-content-dir`,className:`flex-1`}),t[35]=_,t[36]=d,t[37]=we,t[38]=I):I=t[38];let L;t[39]===be?L=t[40]:(L=()=>void be(),t[39]=be,t[40]=L);let R;t[41]!==_||t[42]!==L?(R=(0,p.jsx)(i,{type:`button`,variant:`outline`,disabled:_,onClick:L,"data-testid":`consent-content-dir-browse`,children:`Browse`}),t[41]=_,t[42]=L,t[43]=R):R=t[43];let z;t[44]!==I||t[45]!==R?(z=(0,p.jsxs)(`div`,{className:`flex items-stretch gap-2`,children:[I,R]}),t[44]=I,t[45]=R,t[46]=z):z=t[46];let B;t[47]!==y||t[48]!==x||t[49]!==me?(B=y===null?x?(0,p.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,"data-testid":`consent-preview`,children:fe(me)}):(0,p.jsx)(`p`,{className:`mt-1 text-xs text-destructive`,"data-testid":`consent-content-dir-error`,children:`Content directory must be inside the project`}):(0,p.jsx)(`p`,{className:`mt-1 text-xs text-destructive`,"data-testid":`consent-content-dir-browse-error`,children:y}),t[47]=y,t[48]=x,t[49]=me,t[50]=B):B=t[50];let V;t[51]!==z||t[52]!==B?(V=(0,p.jsxs)(`div`,{children:[P,z,B]}),t[51]=z,t[52]=B,t[53]=V):V=t[53];let H;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,p.jsx)(`label`,{htmlFor:`consent-additional-ignores`,className:`mb-1 block text-sm font-medium`,children:`Ignore patterns`}),t[54]=H):H=t[54];let Te;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(Te=e=>le(e.target.value),t[55]=Te):Te=t[55];let U;t[56]!==m||t[57]!==_?(U=(0,p.jsx)(ae,{id:`consent-additional-ignores`,value:m,onChange:Te,disabled:_,placeholder:`tmp/
|
|
2
|
-
*.draft.md`,rows:3,"data-testid":`consent-additional-ignores`}),t[56]=m,t[57]=_,t[58]=U):U=t[58];let Ee;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=(0,p.jsxs)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:[`One pattern per line — appended to `,(0,p.jsx)(`code`,{children:`.okignore`}),`.`]}),t[59]=Ee):Ee=t[59];let W;t[60]===U?W=t[61]:(W=(0,p.jsxs)(`div`,{children:[H,U,Ee]}),t[60]=U,t[61]=W);let De;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(De=(0,p.jsx)(`legend`,{className:`text-sm font-medium`,children:`Connect to AI tools`}),t[62]=De):De=t[62];let Oe;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,p.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`All editors are checked by default — uncheck the ones you don't use. Each checked editor's project-MCP config is written; the Claude entry also scaffolds`,` `,(0,p.jsx)(`code`,{children:`.claude/launch.json`}),`.`]}),t[63]=Oe):Oe=t[63];let G;if(t[64]!==_||t[65]!==g||t[66]!==n.editorOptions){let e;t[68]!==_||t[69]!==g?(e=e=>(0,p.jsxs)(`label`,{className:`flex items-center gap-2 text-sm`,children:[(0,p.jsx)(`input`,{type:`checkbox`,checked:g.has(e.id),onChange:()=>ye(e.id),disabled:_,className:`size-4 shrink-0 rounded accent-primary`,"data-testid":`consent-editor-${e.id}`}),(0,p.jsx)(`span`,{children:e.label}),(0,p.jsx)(`span`,{className:`text-xs text-muted-foreground`,"data-testid":`consent-editor-${e.id}-scope`,children:e.hasProjectConfig?`(project + user)`:`(user-level only)`})]},e.id),t[68]=_,t[69]=g,t[70]=e):e=t[70],G=n.editorOptions.map(e),t[64]=_,t[65]=g,t[66]=n.editorOptions,t[67]=G}else G=t[67];let K;t[71]===G?K=t[72]:(K=(0,p.jsxs)(`fieldset`,{className:`space-y-2 pb-2`,children:[De,Oe,G]}),t[71]=G,t[72]=K);let q;t[73]!==M||t[74]!==N||t[75]!==V||t[76]!==W||t[77]!==K?(q=(0,p.jsxs)(l,{className:`space-y-4`,children:[M,N,V,W,K]}),t[73]=M,t[74]=N,t[75]=V,t[76]=W,t[77]=K,t[78]=q):q=t[78];let J;t[79]===O?J=t[80]:(J=()=>void O(),t[79]=O,t[80]=J);let Y;t[81]!==_||t[82]!==J?(Y=(0,p.jsx)(i,{type:`button`,variant:`outline`,className:`font-mono uppercase`,onClick:J,disabled:_,"data-testid":`consent-cancel`,children:`Cancel`}),t[81]=_,t[82]=J,t[83]=Y):Y=t[83];let X;t[84]===S?X=t[85]:(X=(0,p.jsx)(i,{type:`submit`,disabled:S,"data-testid":`consent-start`,children:`Start`}),t[84]=S,t[85]=X);let Z;t[86]!==Y||t[87]!==X?(Z=(0,p.jsxs)(u,{children:[Y,X]}),t[86]=Y,t[87]=X,t[88]=Z):Z=t[88];let Q;t[89]!==Se||t[90]!==q||t[91]!==Z?(Q=(0,p.jsxs)(c,{className:`sm:max-w-lg motion-reduce:duration-0 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none`,children:[j,(0,p.jsxs)(`form`,{onSubmit:Se,"data-testid":`consent-form`,className:`flex min-h-0 flex-1 flex-col`,children:[q,Z]})]}),t[89]=Se,t[90]=q,t[91]=Z,t[92]=Q):Q=t[92];let $;return t[93]!==Ce||t[94]!==Q?($=(0,p.jsx)(te,{open:!0,onOpenChange:Ce,children:Q}),t[93]=Ce,t[94]=Q,t[95]=$):$=t[95],$}function ue(e){return(0,p.jsx)(`p`,{className:`mb-1 last:mb-0`,children:ce[e.kind]},e.kind)}function de(e){return e.id}function fe(e){if(e===null)return`Counting markdown files`;if(!e.ok)return`Preview unavailable: ${e.error}`;let t=e.truncated?`≥ 50,000`:String(e.count);return e.sample.length===0?`Found ${t} markdown files`:`Found ${t} markdown files; sample: ${e.sample.join(`, `)}`}export{le as default};
|