@inkeep/open-knowledge 0.58.0-beta.8 → 0.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. package/dist/{acp-harness-probe-dZsvbgrC.mjs → acp-harness-probe-EY118B13.mjs} +2 -2
  2. package/dist/cli.mjs +23 -23
  3. package/dist/config-schema.json +1 -1
  4. package/dist/config.project.schema.json +1 -1
  5. package/dist/constants-CGYatEBL.mjs +2 -0
  6. package/dist/fs-traced-BEuPZxxL.mjs +1 -0
  7. package/dist/{fs-traced-oq2wG9J_.mjs → fs-traced-xJfl5Rxd.mjs} +2 -2
  8. package/dist/git-handle-CcWdc2o_.mjs +1 -0
  9. package/dist/{git-handle-2o4Vxedu.mjs → git-handle-Dk7GEAfH.mjs} +2 -2
  10. package/dist/index.d.mts +2 -2600
  11. package/dist/index.mjs +3 -3
  12. package/dist/init-BglLqrOW.mjs +1 -0
  13. package/dist/{init-DasMrTCg.mjs → init-CjDJqCL6.mjs} +5 -5
  14. package/dist/{launch-json-removal-BCc3Wt5o.mjs → launch-json-removal-DBGHaxha.mjs} +2 -2
  15. package/dist/{loader-CFnKYZR2.mjs → loader-B7lXyJFO.mjs} +2 -2
  16. package/dist/loader-xqwijD2m.mjs +1 -0
  17. package/dist/md-manager-30TBxbTV.mjs +2 -0
  18. package/dist/{open-browser-CMs-r6aL.mjs → open-browser-BXT69qcq.mjs} +2 -2
  19. package/dist/parse-worker.mjs +1 -1
  20. package/dist/preview-BqXocFFE.mjs +1 -0
  21. package/dist/{preview-Dv9l315C.mjs → preview-EGTe7kIb.mjs} +2 -2
  22. package/dist/public/assets/ActivityModeContent-Bh8PvwWR.js +1 -0
  23. package/dist/public/assets/{AgentDiffPane-BuZT0CFj.js → AgentDiffPane-CxvPSRp5.js} +1 -1
  24. package/dist/public/assets/{AgentIconCluster-D_inolLQ.js → AgentIconCluster-CjMEI-L4.js} +1 -1
  25. package/dist/public/assets/{AgentThreadClientBinder-Db3J-HNk.js → AgentThreadClientBinder-CZt9gzGP.js} +1 -1
  26. package/dist/public/assets/{AppMenubar-DNz-YQ-n.js → AppMenubar-CiSfRgZz.js} +1 -1
  27. package/dist/public/assets/{BugReportHistory-3WmeKMdN.js → BugReportHistory-DAkLR0uT.js} +1 -1
  28. package/dist/public/assets/{BugReportHistoryDialog-B8G8dpLP.js → BugReportHistoryDialog-D3FmiOs-.js} +1 -1
  29. package/dist/public/assets/{CodeMirrorPropInput-B3PfIk_d.js → CodeMirrorPropInput-Bj9gYc9v.js} +1 -1
  30. package/dist/public/assets/ConsentDialogBody-ByUP5rlV.js +2 -0
  31. package/dist/public/assets/{DiffView-CjTilKZT.js → DiffView-BbCF3n86.js} +1 -1
  32. package/dist/public/assets/DocumentContext-CM98n-Wm.js +38 -0
  33. package/dist/public/assets/EditorModeToggle-BOtGsJ58.js +1 -0
  34. package/dist/public/assets/EnableSyncConfirmDialog-edPIQ6AO.js +1 -0
  35. package/dist/public/assets/FeedbackForm-B44dYSuT.js +1 -0
  36. package/dist/public/assets/{GraphPanel-CEcqZRWw.js → GraphPanel-Dbt6ehOx.js} +1 -1
  37. package/dist/public/assets/ImportSkillDialog-BYZRPrHX.js +1 -0
  38. package/dist/public/assets/{LintConfigEditor-Bcr2QKP1.js → LintConfigEditor-DPAgvzQo.js} +1 -1
  39. package/dist/public/assets/ManagedArtifactProperties-D35GmczH.js +1 -0
  40. package/dist/public/assets/ManagedArtifactProperties-N6SxoaQN.js +1 -0
  41. package/dist/public/assets/McpConsentDialogBody-Cdxs_Q-f.js +1 -0
  42. package/dist/public/assets/{MermaidDocEditor-Co4QYa48.js → MermaidDocEditor-B-SpVE_4.js} +1 -1
  43. package/dist/public/assets/{OpenInAgentMenuItem-C_aRPIjj.js → OpenInAgentMenuItem--c5Kl0UJ.js} +1 -1
  44. package/dist/public/assets/{PropertyDisplayRow-CrYGlgp7.js → PropertyDisplayRow-JWrzMen3.js} +1 -1
  45. package/dist/public/assets/{ReportBugDialogBody-CN1i_Y7g.js → ReportBugDialogBody-Bn7KSO7Z.js} +1 -1
  46. package/dist/public/assets/SchemaConfigEditor-4ELQUjOk.js +1 -0
  47. package/dist/public/assets/SessionsHost-CkCwV0Gg.js +2 -0
  48. package/dist/public/assets/SettingsDialogBody-f_hQ7VPv.js +13 -0
  49. package/dist/public/assets/ShareBranchSwitchDialog-BcO94wih.js +1 -0
  50. package/dist/public/assets/ShareReceiveDialog-tG5J08TH.js +1 -0
  51. package/dist/public/assets/ShareReceiveMissDialog-ClfobBlL.js +1 -0
  52. package/dist/public/assets/{SkillCostValue-C0tQ5Ey6.js → SkillCostValue-XTEKNDJI.js} +1 -1
  53. package/dist/public/assets/{SkillDestinationList-DYjzv8JN.js → SkillDestinationList-Dw1naFS2.js} +1 -1
  54. package/dist/public/assets/{SkillEditBanner-DUbh82i0.js → SkillEditBanner-DFhrQ8xp.js} +1 -1
  55. package/dist/public/assets/{SkillInstallMenu-aKaOX_rG.js → SkillInstallMenu-B2HRT0pR.js} +1 -1
  56. package/dist/public/assets/{SkillOriginInline-Dcw5U9Gu.js → SkillOriginInline-Ba3UO-r0.js} +1 -1
  57. package/dist/public/assets/{SkillToolbarControls-CZNGVa1t.js → SkillToolbarControls-D_gVZcnp.js} +1 -1
  58. package/dist/public/assets/SlidesToolbarControls-Dtor0bv_.js +1 -0
  59. package/dist/public/assets/{SourceEditor-DrIQgn17.js → SourceEditor-CZ1cWoNO.js} +1 -1
  60. package/dist/public/assets/{TerminalPanel-C61cGKq0.js → TerminalPanel-D15yQGLN.js} +3 -3
  61. package/dist/public/assets/{TerminalWindowApp-Zyc8LXKG.js → TerminalWindowApp-DoVS1306.js} +1 -1
  62. package/dist/public/assets/{TextDocEditor-Dhfis_S6.js → TextDocEditor-gZsWz3eO.js} +1 -1
  63. package/dist/public/assets/{ThreadView-BZYcGOYJ.js → ThreadView-BQHsrBEu.js} +1 -1
  64. package/dist/public/assets/TimelineDiffPane-CT-ihYQ6.js +2 -0
  65. package/dist/public/assets/{auth-state-cache-CWPxRafc.js → auth-state-cache-BrvpmLJN.js} +4 -4
  66. package/dist/public/assets/{client-version-BsMRrwFS.js → client-version-vyi1QvTS.js} +1 -1
  67. package/dist/public/assets/comment-chips-C9lD2NUl.js +5 -0
  68. package/dist/public/assets/{config-provider-DkOV03RH.js → config-provider-D1oa8ar_.js} +3 -3
  69. package/dist/public/assets/{dist-CP7w45uR.js → dist-BrL2bd3x.js} +2 -2
  70. package/dist/public/assets/{doc-paths-CX0c2GkE.js → doc-paths-CeZpYfYr.js} +1 -1
  71. package/dist/public/assets/{documents-events-DGovPb4Q.js → documents-events-C6H3LrA9.js} +1 -1
  72. package/dist/public/assets/{file-tree-adapter-CNrTrjb9.js → file-tree-adapter-DFyrX-92.js} +1 -1
  73. package/dist/public/assets/{file-tree-utils-Ceep4GK6.js → file-tree-utils-C9zTW2_A.js} +1 -1
  74. package/dist/public/assets/{folder-config-api-BavUQIxi.js → folder-config-api-JwI3TW0L.js} +1 -1
  75. package/dist/public/assets/{follow-file-BDoShwy7.js → follow-file-H_OOuojl.js} +1 -1
  76. package/dist/public/assets/globals-CyRfFhRe.css +1 -0
  77. package/dist/public/assets/i18n-BdQmUBxL.js +1 -0
  78. package/dist/public/assets/index-BXv4_oa9.js +2095 -0
  79. package/dist/public/assets/{lint-config-client-BXCLXBm0.js → lint-config-client-qKPmO3Qw.js} +1 -1
  80. package/dist/public/assets/markdownlint-rule-browser-BNoonKhJ.js +1 -0
  81. package/dist/public/assets/{mcp-consent-store-lJGGM3y3.js → mcp-consent-store-Bxq-u2M3.js} +1 -1
  82. package/dist/public/assets/messages-BSrj3IKW.js +1 -0
  83. package/dist/public/assets/messages-BsTQ5dHv.js +1 -0
  84. package/dist/public/assets/messages-C-9-pube.js +1 -0
  85. package/dist/public/assets/messages-CH0H74g3.js +1 -0
  86. package/dist/public/assets/messages-C_U8ss6i.js +1 -0
  87. package/dist/public/assets/messages-Ce75_Ji3.js +1 -0
  88. package/dist/public/assets/messages-CyG8vSMs.js +1 -0
  89. package/dist/public/assets/messages-D2dSy_ch.js +1 -0
  90. package/dist/public/assets/messages-D7FYHWNu.js +1 -0
  91. package/dist/public/assets/messages-DavhhPbD.js +1 -0
  92. package/dist/public/assets/messages-DcmkySre.js +1 -0
  93. package/dist/public/assets/messages-YKhV6ZL8.js +1 -0
  94. package/dist/public/assets/{navigation-targets-B9ZSMArq.js → navigation-targets-Du1yYMa3.js} +1 -1
  95. package/dist/public/assets/{open-managed-artifact-tab-FyNAk92K.js → open-managed-artifact-tab-DA0xFMQL.js} +1 -1
  96. package/dist/public/assets/pending-receive-nav-store-jTqdW3b0.js +1 -0
  97. package/dist/public/assets/{platform-labels-C-SqHx4o.js → platform-labels-BW7YRK2j.js} +1 -1
  98. package/dist/public/assets/{project-paths-BShAgBI2.js → project-paths-xKaVJSAX.js} +1 -1
  99. package/dist/public/assets/{prop-types-BWoV6rdx.js → prop-types-LyJPmVUN.js} +1 -1
  100. package/dist/public/assets/{receive-store-sP45Lmaj.js → receive-store-C7uwmgHL.js} +1 -1
  101. package/dist/public/assets/{selection-context-jZhBCQUz.js → selection-context-BJ7u_a2a.js} +1 -1
  102. package/dist/public/assets/skill-actions-CUghpMeW.js +1 -0
  103. package/dist/public/assets/{skill-scope-C3ZLyDFU.js → skill-scope-41fjvVEv.js} +1 -1
  104. package/dist/public/assets/{skills-api-DkJBCb26.js → skills-api-BLsd0Xm0.js} +1 -1
  105. package/dist/public/assets/{src-DXY6B71v.js → src-TKA4AIQa.js} +1 -1
  106. package/dist/public/assets/{tag-pill-input-obzr2Bmc.js → tag-pill-input-BBAkEv9f.js} +1 -1
  107. package/dist/public/assets/{target-navigation-intent-IjRnfQQ9.js → target-navigation-intent-BxG_VSFm.js} +1 -1
  108. package/dist/public/assets/{terminal-cli-display-fzswbBoR.js → terminal-cli-display-B3miHBqb.js} +1 -1
  109. package/dist/public/assets/{terminal-launch-events-BZw6Kevo.js → terminal-launch-events-D3Djrj2P.js} +1 -1
  110. package/dist/public/assets/{terminal-telemetry-BTfW00Ir.js → terminal-telemetry-yDrCOyY3.js} +1 -1
  111. package/dist/public/assets/thread-client-d5910s2I.js +1 -0
  112. package/dist/public/assets/{typing-burst-detector-adEL1lyg.js → typing-burst-detector-BgFZQX05.js} +2 -2
  113. package/dist/public/assets/{uninstall-DJb5IlCU.js → uninstall-CFA5w-m5.js} +1 -1
  114. package/dist/public/assets/{use-activity-panel-bJnzXq1_.js → use-activity-panel-DPJJ75w9.js} +1 -1
  115. package/dist/public/assets/{use-apply-config-color-theme-hdarUMLl.js → use-apply-config-color-theme-Eo0YlkiS.js} +1 -1
  116. package/dist/public/assets/{use-collab-url-BSs7OT15.js → use-collab-url-DtfgRTLQ.js} +1 -1
  117. package/dist/public/assets/{use-live-xterm-theme-BQNkHYLe.js → use-live-xterm-theme-DSbS2g15.js} +1 -1
  118. package/dist/public/assets/use-open-skill-CmlgDEiD.js +1 -0
  119. package/dist/public/assets/{use-popular-skills-DSYrjkIc.js → use-popular-skills-AdcFV1D_.js} +1 -1
  120. package/dist/public/assets/{use-settings-route-CAQ6W9p6.js → use-settings-route-B2jig6fs.js} +1 -1
  121. package/dist/public/assets/use-skill-origin-DXe-gG8s.js +1 -0
  122. package/dist/public/assets/{use-skills-BrC3Upu3.js → use-skills-Ct4t-6Ji.js} +1 -1
  123. package/dist/public/assets/{use-terminal-enabled-B-_ScHv6.js → use-terminal-enabled-DLCLwzPR.js} +1 -1
  124. package/dist/public/assets/{use-timeline-entry-diff-EyIHz_x3.js → use-timeline-entry-diff-B1RCXahh.js} +1 -1
  125. package/dist/public/assets/{use-workspace-CFSG46RY.js → use-workspace-DXg_fDor.js} +1 -1
  126. package/dist/public/index.html +56 -56
  127. package/dist/public/uninstall.html +7 -7
  128. package/dist/{repair-launch-json-BU_wTHU6.mjs → repair-launch-json-CnC1yFmy.mjs} +2 -2
  129. package/dist/{repair-mcp-configs-DLGnB9SW.mjs → repair-mcp-configs-CO6hDA8w.mjs} +2 -2
  130. package/dist/repair-skills-BmR0xC0t.mjs +1 -0
  131. package/dist/repair-skills-DC9YrDGX.mjs +4 -0
  132. package/dist/schemas/v0/config.project.schema.json +1 -1
  133. package/dist/server-lock-D-FV4bZf.mjs +1 -0
  134. package/dist/{server-lock-CucURT_N.mjs → server-lock-xhUgHytn.mjs} +2 -2
  135. package/dist/{skill-teardown-C2iNSWvT.mjs → skill-teardown-DVWO087y.mjs} +2 -2
  136. package/dist/{sleep-BU8QtSQy.mjs → sleep-D_nNc7T_.mjs} +2 -2
  137. package/dist/src-Bf9qn1Q1.mjs +1 -0
  138. package/dist/{src-C1pxKPYT.mjs → src-CBALwizo.mjs} +4 -4
  139. package/dist/src-CCW4TQuz.mjs +357 -0
  140. package/dist/src-D5ZZydZi.mjs +2017 -0
  141. package/dist/{src-CXbUZB_b.mjs → src-DT3BV-Jn.mjs} +1 -1
  142. package/dist/start-Df_2ALn7.mjs +1 -0
  143. package/dist/start-ZRhTJkN6.mjs +12 -0
  144. package/dist/{ui-UQBOE6mj.mjs → ui-D8O01OgQ.mjs} +3 -3
  145. package/dist/{write-project-skill-7xCQZ9iq.mjs → write-project-skill-BufydPiH.mjs} +3 -3
  146. package/package.json +4 -4
  147. package/dist/constants-CzhGjsFo.mjs +0 -2
  148. package/dist/fs-traced-corg4Obj.mjs +0 -1
  149. package/dist/git-handle-DEjt_7O0.mjs +0 -1
  150. package/dist/init-Ct7mqKVm.mjs +0 -1
  151. package/dist/loader-C6UUw0ZZ.mjs +0 -1
  152. package/dist/md-manager-FXuCv5zc.mjs +0 -2
  153. package/dist/preview-D9SZkYr5.mjs +0 -1
  154. package/dist/public/assets/ActivityModeContent-DB3zhNIv.js +0 -1
  155. package/dist/public/assets/ConsentDialogBody-DIXTiaxR.js +0 -2
  156. package/dist/public/assets/DocumentContext-BNs9Wc7G.js +0 -38
  157. package/dist/public/assets/EditorModeToggle-SBfl-yYh.js +0 -1
  158. package/dist/public/assets/EnableSyncConfirmDialog-BoBmQwEy.js +0 -1
  159. package/dist/public/assets/FeedbackForm-Bwghznhy.js +0 -1
  160. package/dist/public/assets/ImportSkillDialog-C7EVNmz7.js +0 -1
  161. package/dist/public/assets/ManagedArtifactProperties-B3ZJ9FFR.js +0 -1
  162. package/dist/public/assets/ManagedArtifactProperties-CZwQTU72.js +0 -1
  163. package/dist/public/assets/McpConsentDialogBody-CRg_BChy.js +0 -1
  164. package/dist/public/assets/SchemaConfigEditor-CntIIKsB.js +0 -1
  165. package/dist/public/assets/SessionsHost-CdJc0MSK.js +0 -2
  166. package/dist/public/assets/SettingsDialogBody-8GHLppL4.js +0 -13
  167. package/dist/public/assets/ShareBranchSwitchDialog-K6rF_BB-.js +0 -1
  168. package/dist/public/assets/ShareReceiveDialog-D2tJPvcw.js +0 -1
  169. package/dist/public/assets/ShareReceiveMissDialog-PifhU4tt.js +0 -1
  170. package/dist/public/assets/SlidesToolbarControls-Cf1lF5oY.js +0 -1
  171. package/dist/public/assets/TimelineDiffPane-BBmd35R9.js +0 -2
  172. package/dist/public/assets/comment-chips-DdMmWihZ.js +0 -5
  173. package/dist/public/assets/globals-BGlAio6U.css +0 -1
  174. package/dist/public/assets/i18n-fvzGnIHb.js +0 -1
  175. package/dist/public/assets/index-Br-j853R.js +0 -2095
  176. package/dist/public/assets/markdownlint-rule-browser-CjQ1_sCE.js +0 -1
  177. package/dist/public/assets/messages-6l97Z9l-.js +0 -1
  178. package/dist/public/assets/messages-B6xCk04J.js +0 -1
  179. package/dist/public/assets/messages-BdOR8jpl.js +0 -1
  180. package/dist/public/assets/messages-BiqhEyiZ.js +0 -1
  181. package/dist/public/assets/messages-CWuRF_g4.js +0 -1
  182. package/dist/public/assets/messages-ChE4ifHJ.js +0 -1
  183. package/dist/public/assets/messages-D-dvdC6u.js +0 -1
  184. package/dist/public/assets/messages-D3F4EU1O.js +0 -1
  185. package/dist/public/assets/messages-D7hPscmx.js +0 -1
  186. package/dist/public/assets/messages-Debu1u7T.js +0 -1
  187. package/dist/public/assets/messages-Dr79fPY9.js +0 -1
  188. package/dist/public/assets/messages-Dwk3zwPu.js +0 -1
  189. package/dist/public/assets/pending-receive-nav-store-DR3ooVas.js +0 -1
  190. package/dist/public/assets/skill-actions-BAWcLPFa.js +0 -1
  191. package/dist/public/assets/thread-client-rJFsjItr.js +0 -1
  192. package/dist/public/assets/use-open-skill-B2CpqHwW.js +0 -1
  193. package/dist/public/assets/use-skill-origin-DbGsYAIW.js +0 -1
  194. package/dist/repair-skills-6kXbAVAI.mjs +0 -1
  195. package/dist/repair-skills-B2XZB3Rs.mjs +0 -4
  196. package/dist/server-lock-Tb9AMsy7.mjs +0 -1
  197. package/dist/src-Bf5oIrhA.mjs +0 -1
  198. package/dist/src-BjPajWAS.mjs +0 -357
  199. package/dist/src-pjKDNsjY.mjs +0 -2017
  200. package/dist/start-C62GgsB9.mjs +0 -1
  201. package/dist/start-rya2hbae.mjs +0 -12
  202. /package/dist/public/assets/{dist-CMZSEMCN2.js → dist-CuH7ikCn.js} +0 -0
  203. /package/dist/public/assets/{dist-CdT2fVlj.js → dist-DUfEoSbR.js} +0 -0
  204. /package/dist/public/assets/{globals-BBuo3zzi.js → globals-OB7mlRhv.js} +0 -0
package/dist/index.d.mts CHANGED
@@ -1130,14 +1130,14 @@ type _File = typeof globalThis extends {
1130
1130
  File: infer F extends new (...args: any[]) => any;
1131
1131
  } ? InstanceType<F> : {};
1132
1132
  /** Do not reference this directly. */
1133
- interface File$1 extends _File {
1133
+ interface File extends _File {
1134
1134
  readonly type: string;
1135
1135
  readonly size: number;
1136
1136
  }
1137
1137
  interface $ZodFileDef extends $ZodTypeDef {
1138
1138
  type: "file";
1139
1139
  }
1140
- interface $ZodFileInternals extends $ZodTypeInternals<File$1, File$1> {
1140
+ interface $ZodFileInternals extends $ZodTypeInternals<File, File> {
1141
1141
  def: $ZodFileDef;
1142
1142
  isst: $ZodIssueInvalidType;
1143
1143
  bag: LoosePartial<{
@@ -2095,8 +2095,6 @@ declare const ZodNumber: $constructor<ZodNumber>;
2095
2095
  interface _ZodBoolean<T extends $ZodBooleanInternals = $ZodBooleanInternals> extends _ZodType<T> {}
2096
2096
  interface ZodBoolean extends _ZodBoolean<$ZodBooleanInternals<boolean>> {}
2097
2097
  declare const ZodBoolean: $constructor<ZodBoolean>;
2098
- interface ZodNull extends _ZodType<$ZodNullInternals> {}
2099
- declare const ZodNull: $constructor<ZodNull>;
2100
2098
  interface ZodUnknown extends _ZodType<$ZodUnknownInternals> {}
2101
2099
  declare const ZodUnknown: $constructor<ZodUnknown>;
2102
2100
  interface ZodArray<T extends SomeType = $ZodType> extends _ZodType<$ZodArrayInternals<T>>, $ZodArray<T> {
@@ -2229,20 +2227,6 @@ interface ZodReadonly<T extends SomeType = $ZodType> extends _ZodType<$ZodReadon
2229
2227
  }
2230
2228
  declare const ZodReadonly: $constructor<ZodReadonly>;
2231
2229
  //#endregion
2232
- //#region ../core/src/bug-report-sidecar/schema.d.ts
2233
- /**
2234
- * Known report lifecycle states. Read as an OPEN enum: an unrecognized value
2235
- * (a newer app wrote a state this build doesn't know) normalizes to `'unknown'`
2236
- * rather than rejecting the sidecar. Transitions:
2237
- * generated → uploading → sent (+reference) | upload-failed (+lastError) | email-drafted
2238
- * A retry moves a non-`sent` report back to `uploading` and on to a terminal
2239
- * state again.
2240
- */
2241
- declare const REPORT_SIDECAR_STATES: readonly ["generated", "uploading", "sent", "upload-failed", "email-drafted"];
2242
- type ReportSidecarKnownState = (typeof REPORT_SIDECAR_STATES)[number];
2243
- /** The known states plus the `'unknown'` sentinel a read may normalize to. */
2244
- type ReportSidecarState = ReportSidecarKnownState | 'unknown';
2245
- //#endregion
2246
2230
  //#region ../core/src/logger-types.d.ts
2247
2231
  interface BundleRedaction {
2248
2232
  readonly file: string;
@@ -2274,231 +2258,6 @@ interface ReportBundleSummary$1 {
2274
2258
  redactedLineCount: number;
2275
2259
  generatedAt: string;
2276
2260
  }
2277
- /**
2278
- * A captured picture of the app window handed to the renderer for the report
2279
- * dialog's include-a-screenshot preview. `dataUrl` is a downscaled PNG for the
2280
- * `<img>` preview only; the full-resolution bytes stay in main and are staged
2281
- * into the bundle only when the user keeps the screenshot checked. `width` /
2282
- * `height` are the capture's logical (DIP) dimensions, so the preview can hold
2283
- * the real aspect ratio without a layout shift.
2284
- */
2285
- interface OkBugReportScreenshot {
2286
- dataUrl: string;
2287
- width: number;
2288
- height: number;
2289
- }
2290
- /**
2291
- * Result of the desktop `ok:bug-report:dispatch` create operation. Never
2292
- * thrown across the IPC boundary — every failure mode is discriminated so the
2293
- * report dialog can render its failure state.
2294
- */
2295
- type OkBugReportCreateResult = {
2296
- ok: true;
2297
- zipPath: string;
2298
- /**
2299
- * On-disk size of the produced zip. Carried on the result rather than
2300
- * the summary because the summary mirrors the bundled manifest, which
2301
- * cannot know the final size of the archive that contains it.
2302
- */
2303
- zipSizeBytes: number;
2304
- summary: ReportBundleSummary$1;
2305
- } | {
2306
- ok: false;
2307
- error: string;
2308
- };
2309
- /**
2310
- * Report metadata the renderer supplies with a send operation — the user's
2311
- * note plus the system summary the preceding create yielded. Main enriches
2312
- * it with host facts (app version, platform) before it reaches the intake
2313
- * wire or the fallback email body; the renderer never sources those.
2314
- */
2315
- interface OkBugReportSendMetadata {
2316
- level: ReportBundleLevel$1;
2317
- /** True when the bundle was system-wide (no project open at capture). */
2318
- systemWide: boolean;
2319
- projectSlug: string | null;
2320
- note?: string;
2321
- }
2322
- /**
2323
- * Why a send operation resolved to the email fallback instead of an upload
2324
- * reference. `email-draft` is the designed default, not a failure: no intake
2325
- * endpoint is configured, no network request was made, and the prefilled
2326
- * draft IS the transport — the dialog shows an email flow, not an error.
2327
- * `send-failed` covers real failures: a configured upload that was attempted
2328
- * and refused (offline, timeout, rejection at any step), or a request the
2329
- * handler refused outright (malformed payload, zip outside the bug-reports
2330
- * root).
2331
- */
2332
- type OkBugReportSendFallbackReason = 'email-draft' | 'send-failed';
2333
- /**
2334
- * Result of the desktop `ok:bug-report:dispatch` send operation. Success
2335
- * carries the intake service's report reference. Everything else resolves to
2336
- * the email fallback — a prefilled mailto the dialog offers in place of the
2337
- * upload — with `reason` discriminating the designed no-intake email path
2338
- * from a genuine send failure. Never thrown across the IPC boundary.
2339
- */
2340
- type OkBugReportSendResult = {
2341
- ok: true;
2342
- reference: string;
2343
- } | {
2344
- ok: false;
2345
- reason: OkBugReportSendFallbackReason;
2346
- fallback: {
2347
- mailtoUrl: string;
2348
- };
2349
- };
2350
- /**
2351
- * A crash signal detected by desktop main, pushed to the renderer over the
2352
- * `ok:bug-report:crash-detected` event channel as an invitation to file a
2353
- * report — never an automatic send. `eventId` keys the acknowledgment
2354
- * round-trip: the renderer acks over `ok:bug-report:dispatch`
2355
- * (`kind: 'crash-ack'`) and main persists the id so one crash event never
2356
- * prompts twice, across restarts included.
2357
- *
2358
- * Lives in core for the same reason as the sibling bug-report types: the
2359
- * desktop-bridge leaf and the capture implementation must share one type.
2360
- *
2361
- * `minidumpAvailable` is main's authoritative answer (only main can stat the
2362
- * crash-dumps dir) to "is there a crash minidump to include for this event?".
2363
- * The report dialog renders the crash-dump opt-in only when it is true — an
2364
- * invite with no dump (e.g. a dirty shutdown that left none) offers no dead
2365
- * checkbox. Advisory for UI gating only: the actual attach still re-checks the
2366
- * dump on disk at bundle time, so a dump that vanished by then is simply
2367
- * omitted.
2368
- */
2369
- type OkBugReportCrashDetectedEvent = {
2370
- eventId: string;
2371
- kind: 'render-process-gone';
2372
- context: {
2373
- reason: string;
2374
- exitCode?: number;
2375
- };
2376
- minidumpAvailable: boolean;
2377
- } | {
2378
- eventId: string;
2379
- kind: 'child-process-gone';
2380
- context: {
2381
- reason: string;
2382
- processType: string;
2383
- name?: string;
2384
- exitCode?: number;
2385
- };
2386
- minidumpAvailable: boolean;
2387
- } | {
2388
- eventId: string; /** Boot-time detection: the previous session left a dirty-shutdown sentinel or fresh minidumps. */
2389
- kind: 'boot';
2390
- context: {
2391
- dirtyShutdown: boolean;
2392
- newMinidumps: number;
2393
- };
2394
- minidumpAvailable: boolean;
2395
- /**
2396
- * App version of the session that CRASHED, which is not the version now
2397
- * running whenever an auto-update landed between the crash and this
2398
- * launch. Absent when neither the crashed session's sentinel nor the
2399
- * minidump's own annotations name one — an unknown version is reported
2400
- * as unknown rather than approximated by the running one.
2401
- *
2402
- * Only the boot variant carries it. The two runtime variants are raised
2403
- * by the very session that crashed, so their crashed version is the
2404
- * running version by construction and a field would be pure restatement.
2405
- */
2406
- crashedAppVersion?: string;
2407
- };
2408
- /**
2409
- * Result of the desktop `ok:bug-report:dispatch` crash-ack operation. Never
2410
- * thrown across the IPC boundary; the only failure mode is a malformed
2411
- * renderer payload.
2412
- */
2413
- type OkBugReportCrashAckResult = {
2414
- ok: true;
2415
- } | {
2416
- ok: false;
2417
- error: string;
2418
- };
2419
- /**
2420
- * Whether main is holding a crash dump a report opened right now could carry.
2421
- *
2422
- * Deliberately a bare boolean: which dump, when it was written, and how big it
2423
- * is are all per-crash identifiers, and the renderer only needs to decide
2424
- * whether to render the opt-in.
2425
- */
2426
- interface OkBugReportCrashDumpAvailability {
2427
- available: boolean;
2428
- }
2429
- /**
2430
- * One row in the persisted bug-report history, projected from a report sidecar
2431
- * plus main-derived facts. `state` is the OPEN sidecar state (`'unknown'` for a
2432
- * degraded/legacy/corrupt row). `zipPath` is main-derived (never renderer
2433
- * influenced) and re-validated for containment before any retry/reveal; the
2434
- * renderer passes it straight back to `send` / reveal without composing a path.
2435
- *
2436
- * `systemWide` / `projectSlug` are carried so a retry reconstructs the exact
2437
- * `OkBugReportSendMetadata` without a second capture. `retryable` is
2438
- * `true` only when the report is neither `sent` nor mid-`uploading` and its zip
2439
- * is still on disk. `degraded` is `true` for a synthesized row (no sidecar, a
2440
- * corrupt sidecar, or an unknown state) so the list can render it plainly
2441
- * instead of failing.
2442
- */
2443
- interface OkBugReportListRow {
2444
- id: string;
2445
- createdAt: string;
2446
- bundleLevel: ReportBundleLevel$1 | 'unknown';
2447
- /**
2448
- * Derived from the sidecar's single-source state list, so a state added to
2449
- * `REPORT_SIDECAR_STATES` propagates here instead of silently drifting.
2450
- */
2451
- state: ReportSidecarState;
2452
- zipBytes: number;
2453
- zipDeleted: boolean;
2454
- zipExists: boolean;
2455
- systemWide: boolean;
2456
- projectSlug: string | null;
2457
- /**
2458
- * State-coupled: present only when `state === 'sent'`. Not modelled as a
2459
- * discriminated union because `state` is an OPEN enum — enumerating arms
2460
- * here would reintroduce the drift that deriving `state` removes.
2461
- */
2462
- reference?: string;
2463
- /** State-coupled: present only when `state === 'upload-failed'`. */
2464
- lastError?: {
2465
- reason: string;
2466
- at: string;
2467
- };
2468
- attemptsCount: number;
2469
- note?: string;
2470
- /** Main-derived absolute zip path; re-validated for containment on use. */
2471
- zipPath: string;
2472
- retryable: boolean;
2473
- degraded: boolean;
2474
- }
2475
- /**
2476
- * Result of the desktop `ok:bug-report:dispatch` list operation — the persisted
2477
- * report history, newest first. Never thrown across the IPC boundary; a scan
2478
- * failure resolves to `{ ok: false }` so the list renders an error state.
2479
- */
2480
- type OkBugReportListResult = {
2481
- ok: true;
2482
- reports: OkBugReportListRow[];
2483
- } | {
2484
- ok: false;
2485
- reason: string;
2486
- };
2487
- /**
2488
- * Result of the desktop `ok:bug-report:dispatch` delete operation. Removes a
2489
- * report's zip and sidecar by `id` after a containment + id-shape check. Never
2490
- * thrown across the IPC boundary.
2491
- * - `id-invalid` — the id failed the timestamp-basename shape / containment gate.
2492
- * - `in-flight` — the report's own send is currently in progress in this process.
2493
- * - `not-found` — no zip and no sidecar for the id.
2494
- * - `io-error` — a filesystem removal failed.
2495
- */
2496
- type OkBugReportDeleteResult = {
2497
- ok: true;
2498
- } | {
2499
- ok: false;
2500
- reason: 'id-invalid' | 'in-flight' | 'not-found' | 'io-error';
2501
- };
2502
2261
  //#endregion
2503
2262
  //#region ../core/src/logging/secret-scrub.d.ts
2504
2263
  /** Apply {@link SECRET_PATTERNS} line by line; report which patterns matched. */
@@ -4477,19 +4236,6 @@ interface IgnoredCommittedKey {
4477
4236
  source?: ConfigIssueSource;
4478
4237
  }
4479
4238
  //#endregion
4480
- //#region ../core/src/constants/create-new-banner.d.ts
4481
- /**
4482
- * Cascade-banner discriminator for the Create new project dialog. Drives:
4483
- * - the renderer's banner-shown telemetry dedup (one per dialog open)
4484
- * - the main-process recordCreateNewBannerShown handler's banner attribute
4485
- * - the corresponding span attribute on ok.desktop.createNewBannerShown
4486
- *
4487
- * - `'nested'` — banner shown when parent is inside an existing OK project.
4488
- * - `'nonempty'` — banner shown when target folder exists with content.
4489
- * - `'git-confirm'` — banner shown when parent is inside a git repo (no .ok/).
4490
- */
4491
- type CreateNewBannerKind = 'nested' | 'nonempty' | 'git-confirm';
4492
- //#endregion
4493
4239
  //#region ../core/src/constants/editors.d.ts
4494
4240
  /**
4495
4241
  * Canonical editor-ID and label registry shared across the CLI's
@@ -4501,19 +4247,6 @@ type CreateNewBannerKind = 'nested' | 'nonempty' | 'git-confirm';
4501
4247
  */
4502
4248
  type EditorId$1 = 'claude' | 'claude-desktop' | 'cursor' | 'codex' | 'copilot' | 'opencode' | 'openclaw' | 'pi' | 'antigravity' | 'lm-studio' | 'hermes';
4503
4249
  //#endregion
4504
- //#region ../core/src/constants/folder-state.d.ts
4505
- /**
4506
- * Classification of a candidate folder path. Drives the renderer's banner
4507
- * cascade and the IPC handler's defense-in-depth check.
4508
- *
4509
- * - `'free'` — path does not exist on disk; safe to mkdir.
4510
- * - `'exists-empty'` — directory exists with zero entries; safe to use.
4511
- * - `'exists-nonempty'` — directory exists with at least one entry, OR the
4512
- * path resolves to a non-directory (a file occupies
4513
- * the name). Either case blocks the create.
4514
- */
4515
- type OkFolderState = 'free' | 'exists-empty' | 'exists-nonempty';
4516
- //#endregion
4517
4250
  //#region ../../node_modules/.pnpm/prosemirror-transform@1.12.0/node_modules/prosemirror-transform/dist/index.d.ts
4518
4251
  /**
4519
4252
  There are several things that positions can be mapped through.
@@ -10213,190 +9946,6 @@ declare module '@tiptap/core' {
10213
9946
  }
10214
9947
  }
10215
9948
  //#endregion
10216
- //#region ../core/src/git/worktree-selector-model.d.ts
10217
- interface WorktreeSelectorEntry {
10218
- /** Short branch name. `null` for a detached-HEAD worktree (rare). */
10219
- readonly branch: string | null;
10220
- /**
10221
- * Absolute path of the worktree checked out on this branch, or `null` when
10222
- * no worktree exists for it yet. Realpath-collapsed by the caller.
10223
- */
10224
- readonly worktreePath: string | null;
10225
- /** This entry's worktree is the currently-focused window's project. */
10226
- readonly isCurrent: boolean;
10227
- /** This entry's worktree is the repo's main (primary) worktree. */
10228
- readonly isMain: boolean;
10229
- /** The worktree is locked (`git worktree lock`). */
10230
- readonly locked: boolean;
10231
- /**
10232
- * How many commits this local branch is behind its `origin/<branch>`
10233
- * upstream (READ-ONLY, no-network `git rev-list --count <branch>..origin/<branch>`
10234
- * at model-build). Present only when the branch HAS an upstream and the count
10235
- * is computable; absent (undefined) when there's no upstream, no network fetch
10236
- * has run, or the count couldn't be read. `0` means up-to-date with the last
10237
- * fetch. Surfaced as a "N behind origin" hint on the base selector to nudge the
10238
- * user toward a fresh `origin/<x>` base instead of a stale local one.
10239
- */
10240
- readonly behind?: number;
10241
- }
10242
- interface WorktreeSelectorModel {
10243
- /** Absolute path of the repo's main worktree (the `.ok/worktrees/` anchor). */
10244
- readonly mainRoot: string;
10245
- /** Branch of the currently-focused window's project, or `null` if unknown. */
10246
- readonly currentBranch: string | null;
10247
- /** Ordered for display: current first, then main, then the rest. */
10248
- readonly entries: readonly WorktreeSelectorEntry[];
10249
- /**
10250
- * Remote-tracking branch refs WITH their remote prefix (`origin/main`,
10251
- * `origin/feature-x`, `upstream/dev`), deduped + order-preserving,
10252
- * `<remote>/HEAD` symbolic refs excluded. Two consumers in the dialog:
10253
- * - remote-tracking CHECKOUT: a typed `branch` whose bare name matches one
10254
- * of these refs but has NO local branch is checked out as a new local
10255
- * tracking branch (`git worktree add --track -b <name> <path> origin/<name>`),
10256
- * NOT forked off stale HEAD (which would silently discard remote history).
10257
- * - remote BASE options: every ref is selectable as a `--no-track` base for
10258
- * a new branch, so a feature branch can start from fresh `origin/<x>` even
10259
- * when the local `<x>` is behind.
10260
- * Empty when the repo has no remotes / enumeration failed (fail-soft).
10261
- */
10262
- readonly remoteBranches: readonly string[];
10263
- }
10264
- /**
10265
- * IPC-facing result of enumerating the worktree selector. Canonical here (not
10266
- * in desktop) so the desktop host contract and `ipc-channels` import one
10267
- * definition. `no-git` = the project isn't inside a git repo.
10268
- */
10269
- type WorktreeListResult = {
10270
- readonly ok: true;
10271
- readonly model: WorktreeSelectorModel;
10272
- } | {
10273
- readonly ok: false;
10274
- readonly reason: 'no-git';
10275
- };
10276
- /** Renderer → main request to create (or locate) a worktree for a branch. */
10277
- interface WorktreeCreateRequest {
10278
- /** With `createBranch`, a NEW branch name; otherwise an existing branch. */
10279
- readonly branch: string;
10280
- /**
10281
- * Base ref for a new LOCAL-based branch (defaults to HEAD). Ignored unless
10282
- * `createBranch`, and mutually exclusive with `baseRef` (a remote base). The
10283
- * created branch does NOT track this base (a local base carries no upstream to
10284
- * inherit). Git arm: `git worktree add -b <branch> <path> -- <baseBranch>`.
10285
- */
10286
- readonly baseBranch?: string | null;
10287
- /**
10288
- * Remote-tracking base ref for a new branch (e.g. `origin/main`). Set instead
10289
- * of `baseBranch` when the user picked a remote base in the selector. The new
10290
- * branch is created off this ref WITH `--no-track` — a feature branch must not
10291
- * inherit the base's remote as its own upstream. Ignored unless `createBranch`;
10292
- * takes precedence over `baseBranch` when both are somehow set. Git arm:
10293
- * `git worktree add -b <branch> <path> <baseRef> --no-track`. The ref is a
10294
- * `<remote>/<branch>` string, never a dash-prefixed positional, so it needs no
10295
- * `--` guard (git resolves it as a ref, and the trailing `--no-track` is a flag).
10296
- */
10297
- readonly baseRef?: string | null;
10298
- /**
10299
- * Remote-only checkout ref (e.g. `origin/feature-x`). Set when `branch` names a
10300
- * branch that exists ONLY on a remote (no local branch). The worktree is checked
10301
- * out as a NEW LOCAL branch that TRACKS this remote ref, preserving remote
10302
- * history instead of forking a divergent local branch off stale HEAD. When set,
10303
- * `createBranch` is `true` (a local branch is created) but `baseBranch` /
10304
- * `baseRef` are ignored — the remote ref IS the base. Git arm:
10305
- * `git worktree add --track -b <branch> <path> <remoteRef>`. The explicit ref
10306
- * avoids the multi-remote DWIM `fatal: invalid reference` a bare `-b <branch>`
10307
- * would hit.
10308
- */
10309
- readonly remoteRef?: string | null;
10310
- /** `true` → create a new branch; `false` → check out an existing branch. */
10311
- readonly createBranch: boolean;
10312
- }
10313
- /**
10314
- * IPC-facing result of creating/locating a worktree. `created: false` means the
10315
- * branch already had a worktree and `path` points at it (open that window
10316
- * instead). The failure reasons map git's refusal modes to actionable copy.
10317
- * `branch-not-found` / `fetch-failed` arise only from the share-scoped
10318
- * `checkout` operation, whose branch resolution may `git fetch` from `origin`
10319
- * (branch gone upstream vs. a retryable network/timeout failure); the other
10320
- * failure reasons come from validation and `git worktree add`.
10321
- */
10322
- type WorktreeCreateResult = {
10323
- readonly ok: true;
10324
- readonly path: string;
10325
- readonly created: boolean;
10326
- } | {
10327
- readonly ok: false;
10328
- readonly reason: 'helper-not-found';
10329
- /**
10330
- * The command git tried to spawn and couldn't resolve (e.g. `git-lfs`),
10331
- * extracted by `detectMissingGitHelper`. Required on this arm so a
10332
- * producer can't emit the reason without naming the tool — the failure
10333
- * copy shows it verbatim so the user knows what to install.
10334
- */
10335
- readonly helper: string;
10336
- readonly message?: string;
10337
- } | {
10338
- readonly ok: false;
10339
- readonly reason: 'fetch-failed';
10340
- readonly message?: string;
10341
- readonly helper?: never;
10342
- /**
10343
- * Set when the fetch failed for want of a usable credential rather than
10344
- * for a network/timeout reason, and re-authenticating could plausibly fix
10345
- * it (`isLoginFixableGitAuthError` — so not 403, scope-mismatch, or SSH
10346
- * key failures, which a sign-in doesn't repair).
10347
- *
10348
- * Its own arm rather than a field on the shared failure arm below: only
10349
- * `fetch-failed` reaches git's credential stage, so no other reason can
10350
- * structurally carry the flag. Optional and additive — a producer that
10351
- * omits it degrades to the generic connection-flavored copy, which is the
10352
- * pre-existing behavior.
10353
- */
10354
- readonly authFailed?: true;
10355
- } | {
10356
- readonly ok: false;
10357
- readonly reason: 'invalid-branch' | 'branch-exists' | 'already-checked-out' | 'path-exists' | 'no-git' | 'branch-not-found'
10358
- /**
10359
- * The repository exists but has no commits, so no branch is a
10360
- * resolvable ref and `git worktree add` fails with
10361
- * `fatal: invalid reference: <base>`. Distinct from `no-git` (not a
10362
- * repository at all) and from `branch-not-found` (a repository with
10363
- * history where that particular branch is missing).
10364
- */
10365
- | 'empty-repo' | 'error';
10366
- readonly message?: string;
10367
- readonly helper?: never;
10368
- };
10369
- //#endregion
10370
- //#region ../core/src/handoff/types.d.ts
10371
- /** Failure classes reported by handoff telemetry and the desktop host bridge. */
10372
- type HandoffFailureReason = 'not-installed' | 'scheme-blocked' | 'web-endpoint-error' | 'invalid-payload' | 'dispatch-error' | 'web-host-cursor-unsupported';
10373
- /**
10374
- * Scope discriminator recorded on a handoff telemetry line. Present only on a
10375
- * selection-scoped dispatch; the file / folder / project scopes omit the
10376
- * field, so an absent `scope` reads as a non-selection handoff.
10377
- *
10378
- * Reused by the desktop telemetry channel and bridge rather than redeclared
10379
- * at each boundary.
10380
- */
10381
- type HandoffScope = 'selection';
10382
- //#endregion
10383
- //#region ../core/src/handoff/terminal-launch.d.ts
10384
- /**
10385
- * The agent CLIs the docked terminal can launch. Each starts an INTERACTIVE
10386
- * session that stays open with the composed prompt threaded in — NOT the
10387
- * non-interactive one-shot variants (`codex exec`, `cursor-agent -p`,
10388
- * `hermes -q`/`-z`) which run-and-exit before the user can continue.
10389
- *
10390
- * The prompt reaches the CLI three ways, per {@link TerminalCliInfo}:
10391
- * - positional (`claude '<prompt>'`) — the default (no `promptFlag`);
10392
- * - a flag (`opencode --prompt '<prompt>'`, `openclaw chat --message '<prompt>'`)
10393
- * for CLIs whose positional isn't the prompt (`promptFlag`);
10394
- * - post-launch PTY paste (`hermes`) for CLIs with NO starting-prompt argument
10395
- * at all — the promptless `<bin>` is spawned and the prompt is bracketed-paste
10396
- * injected once its TUI is ready (`startupInjection`).
10397
- */
10398
- type TerminalCli = 'claude' | 'codex' | 'copilot' | 'cursor' | 'opencode' | 'pi' | 'antigravity' | 'openclaw' | 'hermes';
10399
- //#endregion
10400
9949
  //#region ../core/src/i18n/locales.d.ts
10401
9950
  /**
10402
9951
  * The interface locales OpenKnowledge enumerates, ordered by total speakers.
@@ -10680,2153 +10229,6 @@ declare module 'mdast-util-math' {
10680
10229
  }
10681
10230
  } //# sourceMappingURL=mdast-augmentation.d.ts.map
10682
10231
  //#endregion
10683
- //#region ../core/src/markdown/lint/types.d.ts
10684
- declare const LINT_PLUGIN_IDS: readonly ["markdownlint", "frontmatter", "okf"];
10685
- type LintPluginId = (typeof LINT_PLUGIN_IDS)[number];
10686
- //#endregion
10687
- //#region ../core/src/schemas/api/local-op.d.ts
10688
- /**
10689
- * Response body for `POST /api/local-op/ok-init`, discriminated on `ok`.
10690
- *
10691
- * Both branches return HTTP 200; protocol-level errors (400 malformed
10692
- * body, 500 unexpected) use the standard RFC 9457 problem+json envelope.
10693
- *
10694
- * On success: `projectPath` is the realpath-collapsed path that was
10695
- * scaffolded (callers compare against their input to detect symlink
10696
- * resolution). The endpoint is idempotent — calling on an already-OK
10697
- * project returns `{ok: true}` without rewriting `config.yml`.
10698
- *
10699
- * On failure: `reason` discriminates the user-facing recovery path
10700
- * (not-a-git-worktree → re-pick a different folder; init-failed →
10701
- * surface the message and let the user inspect manually).
10702
- */
10703
- declare const LocalOpOkInitResponseSchema: ZodDiscriminatedUnion<[ZodObject<{
10704
- ok: ZodLiteral<true>;
10705
- projectPath: ZodString;
10706
- }, $loose>, ZodObject<{
10707
- ok: ZodLiteral<false>;
10708
- reason: ZodEnum<{
10709
- "init-failed": "init-failed";
10710
- "not-a-git-worktree": "not-a-git-worktree";
10711
- }>;
10712
- message: ZodString;
10713
- }, $loose>], "ok">;
10714
- type LocalOpOkInitResponse = output<typeof LocalOpOkInitResponseSchema>;
10715
- //#endregion
10716
- //#region ../core/src/schemas/api/share.d.ts
10717
- declare const BranchInfoResponseSchema: ZodDiscriminatedUnion<[ZodObject<{
10718
- shareTargetExists: ZodBoolean;
10719
- dirtyConflicts: ZodObject<{
10720
- conflicts: ZodBoolean;
10721
- files: ZodArray<ZodString>;
10722
- }, $loose>;
10723
- branchIsLocal: ZodBoolean;
10724
- shareTargetOnOriginBranch: ZodOptional<ZodBoolean>;
10725
- detached: ZodLiteral<false>;
10726
- currentBranch: ZodNullable<ZodString>;
10727
- currentHeadSha: ZodNull;
10728
- }, $loose>, ZodObject<{
10729
- shareTargetExists: ZodBoolean;
10730
- dirtyConflicts: ZodObject<{
10731
- conflicts: ZodBoolean;
10732
- files: ZodArray<ZodString>;
10733
- }, $loose>;
10734
- branchIsLocal: ZodBoolean;
10735
- shareTargetOnOriginBranch: ZodOptional<ZodBoolean>;
10736
- detached: ZodLiteral<true>;
10737
- currentBranch: ZodNull;
10738
- currentHeadSha: ZodString;
10739
- }, $loose>], "detached">;
10740
- type BranchInfoResponse = output<typeof BranchInfoResponseSchema>;
10741
- /**
10742
- * Response body for `POST /api/git/checkout`, discriminated on `ok`.
10743
- *
10744
- * Both branches return HTTP 200; protocol-level errors (400 malformed
10745
- * body, 500 unexpected) use the standard RFC 9457 problem+json envelope
10746
- * via `errorResponse`. Logical failures carry the discriminated reason
10747
- * code so the dialog can map each to its own toast copy.
10748
- *
10749
- * On `dirty-conflict`, `files` is the same intersection-of-paths set
10750
- * `dirtyFilesOverlapWith` returns — sorted ascending, deduped. Omitted
10751
- * on all other failure variants and on success.
10752
- */
10753
- declare const CheckoutResponseSchema: ZodDiscriminatedUnion<[ZodObject<{
10754
- ok: ZodLiteral<true>;
10755
- }, $loose>, ZodObject<{
10756
- ok: ZodLiteral<false>;
10757
- reason: ZodEnum<{
10758
- "dirty-conflict": "dirty-conflict";
10759
- "branch-not-found": "branch-not-found";
10760
- "fetch-failed": "fetch-failed";
10761
- "checkout-failed": "checkout-failed";
10762
- "branch-in-other-worktree": "branch-in-other-worktree";
10763
- "ff-diverged": "ff-diverged";
10764
- }>;
10765
- files: ZodOptional<ZodArray<ZodString>>;
10766
- otherWorktreePath: ZodOptional<ZodString>;
10767
- }, $loose>], "ok">;
10768
- type CheckoutResponse = output<typeof CheckoutResponseSchema>;
10769
- /**
10770
- * Response body for `POST /api/share/target-status`, discriminated on
10771
- * `verdict`. Only `renamed` carries `renamedTo` (the redirect target), so the
10772
- * illegal state "renamed with no destination" is unrepresentable.
10773
- *
10774
- * The whole union is value-tolerant: any parse failure — an unrecognized
10775
- * verdict from a newer server, or a malformed `renamed` missing `renamedTo` —
10776
- * collapses to `{ verdict: 'unknown' }`, so a skewed client degrades to today's
10777
- * guidance instead of throwing. Members are `.loose()` so the desktop proxy
10778
- * passes unknown additive fields through.
10779
- */
10780
- declare const ShareTargetStatusResponseSchema: ZodCatch<ZodDiscriminatedUnion<[ZodObject<{
10781
- verdict: ZodLiteral<"on-origin">;
10782
- }, $loose>, ZodObject<{
10783
- verdict: ZodLiteral<"renamed">;
10784
- renamedTo: ZodString;
10785
- }, $loose>, ZodObject<{
10786
- verdict: ZodLiteral<"deleted">;
10787
- }, $loose>, ZodObject<{
10788
- verdict: ZodLiteral<"never-on-branch">;
10789
- }, $loose>, ZodObject<{
10790
- verdict: ZodLiteral<"changed-locally">;
10791
- }, $loose>, ZodObject<{
10792
- verdict: ZodLiteral<"unknown">;
10793
- }, $loose>], "verdict">>;
10794
- type ShareTargetStatusResponse = output<typeof ShareTargetStatusResponseSchema>;
10795
- //#endregion
10796
- //#region ../core/src/sharing/receive-flow.d.ts
10797
- /**
10798
- * Recent-projects row. `missing` is set at read time by main (folder was
10799
- * absent when the list was assembled). `gitRemoteUrl` is the canonical
10800
- * `https://github.com/<owner>/<repo>.git` form when available (open-time
10801
- * backfill from `.git/config`).
10802
- */
10803
- interface RecentProjectEntry {
10804
- path: string;
10805
- name: string;
10806
- lastOpenedAt: string;
10807
- missing?: boolean;
10808
- gitRemoteUrl?: string;
10809
- /**
10810
- * Git-worktree relationship, computed at list-time (not persisted) so the
10811
- * project switcher can nest linked worktrees under their main project.
10812
- * Absent for non-git projects. `gitCommonDir` is the repo identity shared by
10813
- * all worktrees; `mainRoot` is the repo's main worktree root; `branch` is the
10814
- * checked-out branch (null on detached HEAD).
10815
- */
10816
- gitCommonDir?: string;
10817
- mainRoot?: string;
10818
- isLinkedWorktree?: boolean;
10819
- branch?: string | null;
10820
- }
10821
- //#endregion
10822
- //#region ../core/src/skills-catalog/skill-cost.d.ts
10823
- /**
10824
- * A skill's context cost in estimated tokens, split by when the cost is paid.
10825
- * There is deliberately no summed total: a single figure misranks skills whose
10826
- * weight sits in different tiers (a lean index in front of a heavy body vs. the
10827
- * reverse), so every surface renders the three tiers or a documented subset.
10828
- *
10829
- * The zod schema is the single source both the estimator's return type and the
10830
- * skills-list wire field derive from, so the shape cannot drift between the
10831
- * producer and the transport.
10832
- */
10833
- declare const SkillCostTiersSchema: ZodObject<{
10834
- alwaysOn: ZodNumber;
10835
- onTrigger: ZodNumber;
10836
- onDemand: ZodNumber;
10837
- }, $strict>;
10838
- type SkillCostTiers = output<typeof SkillCostTiersSchema>;
10839
- //#endregion
10840
- //#region ../core/src/terminal-layout.d.ts
10841
- declare const TERMINAL_PLACEMENTS: readonly ["bottom", "right"];
10842
- type TerminalPlacement = (typeof TERMINAL_PLACEMENTS)[number];
10843
- //#endregion
10844
- //#region ../core/src/desktop-bridge.d.ts
10845
- interface OkTerminalRestartTab {
10846
- ordinal: number;
10847
- customLabel: string | null;
10848
- }
10849
- interface OkTerminalRestartSnapshot {
10850
- tabs: OkTerminalRestartTab[];
10851
- activeOrdinal: number | null;
10852
- }
10853
- interface OkTerminalDockState {
10854
- terminalVisible: boolean;
10855
- agentPanelVisible: boolean;
10856
- terminal?: {
10857
- order: string[];
10858
- activeKey: string | null;
10859
- };
10860
- terminalSnapshot?: OkTerminalRestartSnapshot;
10861
- agents?: {
10862
- order: string[];
10863
- activeKey: string | null;
10864
- };
10865
- }
10866
- /**
10867
- * A conversation or comments action started in a popped-out note window and
10868
- * handed back to the owning project window. The note renderer composes the
10869
- * same bounded prompt it would use locally; main only resolves/focuses the
10870
- * project window and forwards this typed intent.
10871
- */
10872
- type OkNoteWindowMainAction = {
10873
- readonly kind: 'active-input';
10874
- readonly text: string;
10875
- readonly newTab: boolean;
10876
- readonly submit: boolean;
10877
- readonly target?: 'agents';
10878
- } | {
10879
- readonly kind: 'agent-thread';
10880
- readonly agentSource: 'registry' | 'custom';
10881
- readonly agentId: string;
10882
- readonly prompt: string | null;
10883
- readonly docName: string | null;
10884
- readonly titleHint: string | null;
10885
- } | {
10886
- readonly kind: 'terminal-launch';
10887
- readonly prompt: string;
10888
- readonly cli: TerminalCli;
10889
- readonly stage: boolean;
10890
- } | {
10891
- readonly kind: 'reveal-comments';
10892
- readonly docName: string;
10893
- readonly scope: 'doc' | 'queue';
10894
- };
10895
- type OkNoteWindowMainActionResult = {
10896
- readonly ok: true;
10897
- } | {
10898
- readonly ok: false;
10899
- readonly reason: 'invalid-action' | 'not-note-window' | 'project-not-open';
10900
- };
10901
- type OkTerminalDockStateUpdate = {
10902
- surface: 'terminal';
10903
- order: string[];
10904
- activeKey: string | null;
10905
- terminalSnapshot: OkTerminalRestartSnapshot;
10906
- } | {
10907
- surface: 'agents';
10908
- order: string[];
10909
- activeKey: string | null;
10910
- };
10911
- type OkTerminalDockStateWriteResult = {
10912
- ok: true;
10913
- } | {
10914
- ok: false;
10915
- reason: 'invalid-request' | 'no-window-context' | 'persist-failed' | 'ipc-unavailable';
10916
- };
10917
- /** Render mode picked by the main process when creating a BrowserWindow. */
10918
- type OkDesktopMode = 'editor' | 'navigator' | 'terminal' | 'note';
10919
- /**
10920
- * Config values injected at preload-exposure time. A frozen snapshot, not a
10921
- * getter — mid-session project switches fire through `onProjectSwitched`
10922
- * instead. Required fields are present before the first renderer render
10923
- * because the main process awaits the utility's `ready` message before
10924
- * creating the BrowserWindow.
10925
- */
10926
- interface OkDesktopConfig {
10927
- /** WebSocket URL for the HocuspocusProvider (ws://localhost:<port>/collab). */
10928
- readonly collabUrl: string;
10929
- /** Origin for HTTP /api/* fetches (http://localhost:<port>). */
10930
- readonly apiOrigin: string;
10931
- /** Realpath of the project's content directory. */
10932
- readonly projectPath: string;
10933
- /** Display name for the project (usually basename of projectPath). */
10934
- readonly projectName: string;
10935
- /** Render mode — `navigator` renders the Project Navigator, `editor` renders the doc editor, `terminal` renders the standalone terminal window, `note` renders a single popped-out document full-window. */
10936
- readonly mode: OkDesktopMode;
10937
- readonly e2eSmoke: boolean;
10938
- readonly singleFile: boolean;
10939
- readonly initialDoc: string | null;
10940
- readonly freshlyCreated: boolean;
10941
- readonly startupTraceparent?: string;
10942
- readonly ptyAvailable: boolean;
10943
- /**
10944
- * The saved interface-language choice, unresolved, as main read it off disk
10945
- * while starting this window.
10946
- *
10947
- * Windows that mount a `ConfigProvider` get the preference from config and
10948
- * ignore this. The launcher has no project and therefore no config document,
10949
- * so without a value here it renders the bootstrap catalog under a menu bar
10950
- * main has already translated — main resolves the preference before any
10951
- * window exists, which is the whole reason the menus are right.
10952
- *
10953
- * Unresolved on purpose: `'system'` has to arrive as `'system'` so the
10954
- * renderer re-resolves it against the browser's current list rather than
10955
- * freezing whatever the OS said when the window opened.
10956
- */
10957
- readonly languagePreference?: LanguagePreference;
10958
- }
10959
- /**
10960
- * Menu-action IDs fired by main → renderer via `ok:menu-action` after a user
10961
- * selects a menu bar item. The renderer dispatches the action into the editor
10962
- * store. Keep this union flat and strongly typed — a single `kind` field
10963
- * discriminates without payload.
10964
- */
10965
- type OkMenuAction = 'new-doc' | 'new-folder' | 'new-project' | 'rename' | 'delete' | 'close-active-tab-or-window' | 'toggle-sidebar' | 'toggle-source' | 'save-version' | 'version-history' | 'focus-search' | 'focus-command-palette' | 'navigate-back' | 'navigate-forward' | 'new-from-template' | 'duplicate' | 'move-to-trash' | 'reveal-in-finder' | 'send-to-ai' | 'copy-full-path' | 'copy-relative-path' | 'toggle-show-hidden-files' | 'toggle-show-ok-folders' | 'toggle-show-only-markdown-files' | 'toggle-show-skills-section' | 'expand-all-tree' | 'collapse-all-tree' | 'toggle-doc-panel' | 'toggle-terminal' | 'move-terminal' | 'toggle-agent-panel' | 'new-terminal' | 'kill-terminal' | 'new-worktree' | 'switch-worktree' | 'report-bug' | 'send-feedback';
10966
- /**
10967
- * Unsubscribe closure returned from `onProjectSwitched` / `onMenuAction`.
10968
- * Calling it removes the listener. Per-electron#33328, the bridge's
10969
- * preload-side wrapper is what actually tracks the listener reference so
10970
- * callers must use this returned closure rather than trying to remove by
10971
- * reference from their own code.
10972
- */
10973
- type OkUnsubscribe = () => void;
10974
- interface PersistedEditorPane {
10975
- id: string;
10976
- openTabs: string[];
10977
- pinnedTabIds: string[];
10978
- activeTabId: string | null;
10979
- size: number;
10980
- }
10981
- interface ProjectSessionState {
10982
- activeTabByMode: {
10983
- files: string | null;
10984
- skills: string | null;
10985
- };
10986
- updatedAt: string | null;
10987
- panes: PersistedEditorPane[];
10988
- focusedPaneId: string;
10989
- }
10990
- /**
10991
- * Discriminator for the Navigator-side surface that initiated a project-open.
10992
- * Matches the desktop runtime `EntryPoint` discriminator.
10993
- */
10994
- type OkProjectEntryPoint = 'create-new' | 'create-new-nested-redirect' | 'pick-existing' | 'recents' | 'deep-link' | 'drag-drop' | 'share-receive' | 'worktree';
10995
- /**
10996
- * Payload accepted by `bridge.project.open(...)`. `target` stays in the
10997
- * contract for forward-compat even though `'new-window'` is the only value
10998
- * today (no switch-in-place). `entryPoint` tags the originating surface so
10999
- * the consent-dialog gate can branch on user intent.
11000
- */
11001
- interface OkProjectOpenRequest {
11002
- path: string;
11003
- target: 'new-window';
11004
- entryPoint: OkProjectEntryPoint;
11005
- /**
11006
- * Optional kind-discriminated target to deep-link into after the project
11007
- * window mounts. Used by share-receive: Q1 hits and Q2/Q3 success both
11008
- * pass the share's target (a `doc` path or a `folder` path) so the editor
11009
- * opens it directly. Threaded through to `wm.createProjectWindow`'s
11010
- * `pendingDeepLinkTarget` (cold spawn → `dom-ready` deep-link IPC) and to
11011
- * `sendDeepLink` for the warm-focus path. Mirrors the existing
11012
- * `openknowledge://open?project=&doc=` flow.
11013
- */
11014
- pendingDeepLinkTarget?: {
11015
- kind: 'doc' | 'folder'; /** Content-relative renderer navigation path. */
11016
- path: string; /** Repository-relative path used only by receive-side Git/filesystem probes. */
11017
- repositoryPath?: string; /** Present only for v2; strips the repository prefix from rename results. */
11018
- contentRootDepth?: number;
11019
- };
11020
- /**
11021
- * Optional share branch riding alongside `pendingDeepLinkTarget`. See
11022
- * canonical bridge contract below.
11023
- */
11024
- pendingBranch?: string | null;
11025
- /**
11026
- * Optional branch-switch payload for the share-receive "I already have it
11027
- * locally" path. When the located clone
11028
- * is on a different branch than the share, main delivers the
11029
- * `project-branch-switch` surface instead of a plain deep-link open.
11030
- */
11031
- pendingShareBranchSwitch?: {
11032
- share: OkSharePayloadFields;
11033
- projectPath: string;
11034
- currentBranch: string | null;
11035
- };
11036
- }
11037
- /**
11038
- * Outcome of `bridge.project.checkTargetExists({projectPath, kind, path})`.
11039
- * Alias used by existing desktop consumers as `CheckTargetExistsResult`.
11040
- *
11041
- * Used by the main-side target-existence gate AFTER the branch comparison
11042
- * passes — answers "does the share's target actually exist on the receiver's
11043
- * currently-checked-out branch?" The `'unreadable'` sentinel collapses
11044
- * the input-rejection + non-ENOENT I/O paths into a single graceful-fail
11045
- * the caller treats as "silent dispatch is safe."
11046
- */
11047
- type OkCheckTargetExistsResult = 'exists' | 'missing' | 'unreadable';
11048
- /**
11049
- * Outcome of `bridge.project.readHeadBranch(projectPath)`.
11050
- *
11051
- * All-null + `detached: false` is the "couldn't determine" sentinel returned
11052
- * on every failure mode (missing `.git`, malformed HEAD, I/O error, traversal
11053
- * attempt). Used by the Project Navigator's recent-projects list.
11054
- */
11055
- interface OkHeadBranchInfo {
11056
- readonly currentBranch: string | null;
11057
- readonly headSha: string | null;
11058
- readonly detached: boolean;
11059
- }
11060
- /**
11061
- * Payload delivered to `onUpdateDownloaded` subscribers. Fires after
11062
- * electron-updater has completed the ZIP download and is waiting for
11063
- * install-on-quit (or an imperative `autoUpdater.quitAndInstall()` via
11064
- * Toast A's "Relaunch now" action).
11065
- */
11066
- interface OkUpdateDownloadedInfo {
11067
- readonly version: string;
11068
- }
11069
- /**
11070
- * Payload delivered to `onUpdateRelaunching` subscribers. Fires when one
11071
- * window's "Relaunch now" click commits in main (`ok:update:relaunch-now`
11072
- * passed its `versionPendingInstall` gate). Every window swaps its
11073
- * `update-downloaded` card to the in-progress "Relaunching…" state.
11074
- */
11075
- interface OkUpdateRelaunchingInfo {
11076
- readonly version: string;
11077
- }
11078
- /**
11079
- * Payload delivered to `onUpdateRelaunchFailed` subscribers. Fires when a
11080
- * committed relaunch fails after the fact — the updater's `error` event
11081
- * landed while the relaunch was in flight, the no-quit watchdog elapsed, or
11082
- * `quitAndInstall()` threw. Main re-arms the banner separately via a
11083
- * re-broadcast `ok:update:downloaded`; this carries the failure detail.
11084
- */
11085
- interface OkUpdateRelaunchFailedInfo {
11086
- readonly version: string;
11087
- readonly message?: string;
11088
- readonly downloadUrl?: string;
11089
- }
11090
- /**
11091
- * Payload delivered to `onWhatsNew` subscribers. Fires once per version
11092
- * transition on first launch post-update (main compared `app.getVersion()`
11093
- * to `AppState.lastSeenVersion`). `releaseUrl` is the GitHub Releases page
11094
- * for the new version — renderer opens it via `bridge.shell.openExternal`.
11095
- */
11096
- interface OkWhatsNewInfo {
11097
- readonly version: string;
11098
- readonly releaseUrl: string;
11099
- }
11100
- /**
11101
- * Payload delivered to `onUpdateStuckHint` subscribers. Fires at most once
11102
- * per installation after 7 consecutive calendar days of failed update
11103
- * checks. `downloadUrl` is the manual-download page (inkeep.com's
11104
- * OpenKnowledge download CTA); renderer opens it via
11105
- * `bridge.shell.openExternal`.
11106
- */
11107
- interface OkUpdateStuckHintInfo {
11108
- readonly downloadUrl: string;
11109
- }
11110
- /**
11111
- * Renderer-facing payload for `ok:share-received`. Carried by the main-
11112
- * process share-flow handler in `url-scheme.ts` after `parseShareUrl`
11113
- * dispatches on the universal-link / custom-scheme input shapes.
11114
- *
11115
- * - `kind: 'project-branch-switch'` — editor-shell branch-switch surface
11116
- * - `kind: 'launcher-consent'` / `launcher-miss` — Navigator surfaces
11117
- * - `kind: 'unsupported-version'` — sonner toast "Update OpenKnowledge"
11118
- * - `kind: 'invalid'` — sonner toast "Invalid share URL"
11119
- *
11120
- * Source (universal-link vs custom-scheme) is NOT propagated — main-process
11121
- * diagnostic logging only.
11122
- */
11123
- /** Kind-discriminated receiver target carried by `OkSharePayloadFields`. */
11124
- type ShareTarget = {
11125
- readonly kind: 'doc';
11126
- readonly docPath: string;
11127
- } | {
11128
- readonly kind: 'folder';
11129
- readonly folderPath: string;
11130
- };
11131
- /** Parsed project-share fields carried across the desktop host bridge. */
11132
- interface OkSharePayloadFields {
11133
- /** GitHub host of the shared repo: `github.com` or a GHES hostname. */
11134
- readonly host: string;
11135
- readonly owner: string;
11136
- readonly repo: string;
11137
- readonly branch: string;
11138
- readonly sharedUrl: string;
11139
- /** URL-derived repository coordinate. Never inferred from receiver config. */
11140
- readonly repositoryTarget: ShareTarget;
11141
- /** `null` for historical v1; positive decoded prefix depth for v2. */
11142
- readonly contentRootDepth: number | null;
11143
- readonly target: ShareTarget;
11144
- }
11145
- /** Renderer-facing payload for a received project share. */
11146
- type OkShareReceivedPayload = {
11147
- readonly kind: 'unsupported-version';
11148
- } | {
11149
- readonly kind: 'invalid';
11150
- } | {
11151
- readonly kind: 'project-branch-switch';
11152
- readonly share: OkSharePayloadFields;
11153
- readonly projectPath: string;
11154
- readonly currentBranch: string | null;
11155
- } | {
11156
- readonly kind: 'launcher-consent';
11157
- readonly share: OkSharePayloadFields;
11158
- readonly candidatePath: string;
11159
- /**
11160
- * Name of the Recents project whose `listGitWorktrees` anchor surfaced
11161
- * `candidatePath`, when the candidate came from worktree-enum off an
11162
- * existing OK project. `null` when the candidate was surfaced from
11163
- * a Recents path that itself matched the share. Drives the
11164
- * "(a worktree of <name>)" caption in the Navigator consent dialog.
11165
- */
11166
- readonly parentProjectName: string | null;
11167
- } | {
11168
- readonly kind: 'launcher-miss';
11169
- readonly share: OkSharePayloadFields;
11170
- };
11171
- /**
11172
- * Renderer-facing representation of `ShareFolderValidationResult` from
11173
- * `@inkeep/open-knowledge`'s `validateLocalFolderForShare`. Carried
11174
- * by the `share.validateLocalFolder` IPC.
11175
- */
11176
- type ShareFolderValidationResult$1 = {
11177
- readonly kind: 'ok';
11178
- readonly gitRemoteUrl: string;
11179
- } | {
11180
- readonly kind: 'not-git';
11181
- } | {
11182
- readonly kind: 'no-origin';
11183
- } | {
11184
- readonly kind: 'wrong-repo';
11185
- readonly actualOwner: string;
11186
- readonly actualRepo: string;
11187
- } | {
11188
- readonly kind: 'wrong-host';
11189
- readonly actualHost: string;
11190
- } | {
11191
- readonly kind: 'non-github';
11192
- } | {
11193
- readonly kind: 'symlink-escape';
11194
- };
11195
- /**
11196
- * Auto-update channel — derived in desktop's main from the running build's
11197
- * version string. `'beta'` for a prerelease build, `'latest'` for a stable
11198
- * one. Not a runtime preference. Mirrors `UpdateChannel` in desktop's
11199
- * `state-store.ts`.
11200
- */
11201
- type OkUpdateChannel = 'latest' | 'beta';
11202
- /**
11203
- * User-intent theme value. Mirrors Electron's `nativeTheme.themeSource`
11204
- * union. Carried verbatim through the `ok:theme:set-source` IPC channel —
11205
- * never resolved to a concrete light/dark value at the renderer call site
11206
- * (the `'system'` value IS the lever that delegates appearance tracking to
11207
- * macOS). The desktop and app compatibility paths re-export this declaration.
11208
- */
11209
- type OkThemeSource = 'system' | 'light' | 'dark';
11210
- /** Colors handed to Electron for OS-drawn window chrome. */
11211
- interface OkChromeColors {
11212
- /** Active theme's sidebar surface color. */
11213
- bg: string;
11214
- /** Active theme's sidebar foreground color. */
11215
- symbol: string;
11216
- }
11217
- /**
11218
- * Snapshot returned by `state.query()` — newly-opened windows query on
11219
- * mount to render the correct BETA badge / About-panel label (channel is
11220
- * build-derived) and to route the refuse-downgrade UX when a future-build
11221
- * state was rolled back.
11222
- */
11223
- interface OkStateSnapshot {
11224
- readonly channel: OkUpdateChannel;
11225
- readonly schemaIncompatibility: {
11226
- readonly currentBuild: string;
11227
- readonly persistedSchemaVersion: number;
11228
- readonly maxSupported: number;
11229
- } | null;
11230
- }
11231
- /**
11232
- * Editor IDs surfaced through the first-launch MCP consent bridge.
11233
- * Aliased to the canonical `EditorId` from `constants/editors.ts` — single
11234
- * source of truth for the literal union.
11235
- */
11236
- type OkMcpWiringEditorId = EditorId$1;
11237
- /**
11238
- * Payload delivered to `mcpWiring.onShow` subscribers on first-launch MCP
11239
- * consent. Every editor in `ALL_EDITOR_IDS` appears; `detected: true`
11240
- * preselects the checkbox in `<McpConsentDialog>`. `willReplace: true`
11241
- * signals that the editor has an existing OK-managed entry that Add would
11242
- * overwrite — surfaced per-row so long-time CLI users aren't surprised to
11243
- * find their pre-existing entry stomped. `pathInstall` drives the dialog's
11244
- * shell-PATH toggle row: `shellDetected: false` hides the row;
11245
- * `alreadyInstalled: true` renders it informational; `rcFilesToTouch`
11246
- * names the tildified shell files a grant would edit.
11247
- */
11248
- interface OkMcpWiringShowPayload {
11249
- readonly detectedEditors: readonly {
11250
- readonly id: OkMcpWiringEditorId;
11251
- readonly label: string;
11252
- readonly detected: boolean;
11253
- readonly willReplace: boolean; /** Display-form user-global config path, or null when unavailable. */
11254
- readonly configPath: string | null; /** Locator for OpenKnowledge's entry within the editor config. */
11255
- readonly entryLocator: string;
11256
- }[];
11257
- readonly pathInstall: {
11258
- readonly shellDetected: boolean;
11259
- readonly rcFilesToTouch: readonly string[];
11260
- readonly alreadyInstalled: boolean;
11261
- };
11262
- /** Per-bundle opt-in rows for the two user-global skills. Empty ⇒ no skill
11263
- * decision solicited. `alreadyInstalled: true` renders the row pre-checked
11264
- * as an existing install the user can uncheck to remove. The disclosure
11265
- * fields (description, size, hosts, paths) let the row show what the skill
11266
- * is, costs, and where it would land — the same information Settings shows,
11267
- * so first-launch consent is as informed. `hosts` empty ⇒ nowhere to land,
11268
- * and the row disables its checkbox. */
11269
- readonly globalSkills: readonly {
11270
- readonly id: string;
11271
- readonly name: string;
11272
- readonly alreadyInstalled: boolean; /** The skill's own frontmatter description. */
11273
- readonly description: string; /** Three-tier context cost; absent when the packaged bundle is unreadable. */
11274
- readonly size?: SkillCostTiers; /** Resolved reach: static editor ids plus declared custom-root paths. */
11275
- readonly hosts: readonly string[]; /** Destination paths a confirmed install writes (or an uninstall removes). */
11276
- readonly paths: readonly string[];
11277
- }[];
11278
- }
11279
- /**
11280
- * Confirm payload for `mcpWiring.confirm`. `pathInstall` is the PATH
11281
- * toggle, tri-state: `true` → append the managed rc block (consent
11282
- * granted); `false` → record declined, touch no rc file; absent → no PATH
11283
- * decision was solicited (row hidden or informational).
11284
- *
11285
- * `skills` — bundle ids the user left checked. Present ⇒ a skill decision was
11286
- * solicited; every offered bundle not in the list is recorded declined (and
11287
- * removed if already installed).
11288
- */
11289
- interface OkMcpWiringConfirmRequest {
11290
- readonly editorIds: readonly OkMcpWiringEditorId[];
11291
- readonly pathInstall?: boolean;
11292
- readonly skills?: readonly string[];
11293
- }
11294
- /**
11295
- * Result shape for `mcpWiring.confirm` / `skip`. `ok:false` surfaces only
11296
- * when `writeUserMcpConfigs` throws — per-editor failures still resolve
11297
- * `ok:true` and are surfaced to operator logs via structured
11298
- * `mcp-wiring-write-failed` events (deferred-marker semantics).
11299
- */
11300
- type OkMcpWiringResult = {
11301
- ok: true;
11302
- } | {
11303
- ok: false;
11304
- error: string;
11305
- };
11306
- /**
11307
- * Per-editor MCP state for Settings → AI tools. `installed` rows uncheck to
11308
- * remove; `not-installed` rows check to install; `foreign` is an entry under
11309
- * OK's server name that isn't recognizably OK's own (uninstall refuses,
11310
- * install overwrites); `unmanageable` is a config OK can't safely edit.
11311
- */
11312
- type OkIntegrationsEditorState = 'installed' | 'not-installed' | 'foreign' | 'unmanageable';
11313
- /** Component inventory for Settings → AI tools. `available: false` renders
11314
- * the section read-only (install actors gated off for this process). `path.
11315
- * installed` reflects the managed rc block actually being on disk. */
11316
- interface OkIntegrationsStatus {
11317
- readonly available: boolean;
11318
- readonly editors: readonly {
11319
- readonly id: OkMcpWiringEditorId;
11320
- readonly label: string;
11321
- readonly detected: boolean;
11322
- readonly state: OkIntegrationsEditorState;
11323
- readonly configPath: string | null;
11324
- readonly entryLocator: string;
11325
- }[];
11326
- readonly path: {
11327
- readonly shellDetected: boolean;
11328
- readonly rcFilesToTouch: readonly string[];
11329
- readonly installed: boolean;
11330
- };
11331
- readonly skills: readonly {
11332
- readonly id: string;
11333
- readonly name: string;
11334
- /** The skill's own frontmatter description; empty when the bundle is
11335
- * unreadable. Replaces the hand-written per-id subtext on the row. */
11336
- readonly description: string;
11337
- readonly installed: boolean;
11338
- readonly paths: readonly string[];
11339
- /** Three-tier context cost from the shared estimator. Absent when the
11340
- * bundle could not be parsed (broken build) — the row hides the cost. */
11341
- readonly size?: SkillCostTiers; /** On-disk source directory of the built-in bundle (its SKILL.md + files). */
11342
- readonly sourceDir: string;
11343
- /** Every place this skill would install: static agent hosts present on disk
11344
- * plus declared custom roots. For a custom root `editor === skillsRoot`. */
11345
- readonly resolvedHosts: readonly {
11346
- readonly editor: string;
11347
- readonly skillsRoot: string;
11348
- readonly custom: boolean;
11349
- }[];
11350
- }[];
11351
- /**
11352
- * Every editor whose host root already exists on this machine — a SUPERSET
11353
- * of the ids in `editors[]`, which is filtered to targets with a user-global
11354
- * MCP surface. The Create-new-project dialog seeds its editor checkboxes
11355
- * from this so a user who never opens "Advanced settings" still gets MCP
11356
- * config + the project skill for the tools they actually have, and none for
11357
- * the ones they don't.
11358
- */
11359
- readonly detectedEditorIds: readonly OkMcpWiringEditorId[];
11360
- }
11361
- /** One toggle for `integrations.setComponent`. */
11362
- interface OkIntegrationsSetRequest {
11363
- readonly component: {
11364
- readonly kind: 'editor';
11365
- readonly id: OkMcpWiringEditorId;
11366
- } | {
11367
- readonly kind: 'path';
11368
- } | {
11369
- readonly kind: 'skill';
11370
- readonly id: string;
11371
- };
11372
- readonly enabled: boolean;
11373
- }
11374
- /** Set-component result — both arms carry a fresh status snapshot so the
11375
- * renderer re-renders truthfully after failed/refused toggles too. */
11376
- type OkIntegrationsSetResult = {
11377
- readonly ok: true;
11378
- readonly status: OkIntegrationsStatus;
11379
- } | {
11380
- readonly ok: false;
11381
- readonly error: string;
11382
- readonly status: OkIntegrationsStatus;
11383
- };
11384
- /** Post-install manual step a project MCP config needs before OK's tools
11385
- * connect: `approve-once` (Claude Code), `enable-manually` (Cursor, silently
11386
- * disabled until toggled), `auto-connect` (Codex on a trusted project),
11387
- * `none`. */
11388
- type OkProjectIntegrationsFollowUp = 'approve-once' | 'enable-manually' | 'auto-connect' | 'none';
11389
- /** Component inventory for Settings → This project → AI tools (per-editor
11390
- * PROJECT MCP config files + the single project runtime skill), scoped to the
11391
- * project the requesting window has open. `hasProject: false` → empty state;
11392
- * `available: false` → read-only. */
11393
- interface OkProjectIntegrationsStatus {
11394
- readonly available: boolean;
11395
- readonly hasProject: boolean;
11396
- readonly projectDir: string | null;
11397
- readonly editors: readonly {
11398
- readonly id: OkMcpWiringEditorId;
11399
- readonly label: string;
11400
- readonly state: OkIntegrationsEditorState;
11401
- readonly configPath: string;
11402
- readonly entryLocator: string;
11403
- readonly followUp: OkProjectIntegrationsFollowUp;
11404
- }[];
11405
- readonly skill: {
11406
- readonly installed: boolean;
11407
- readonly paths: readonly string[];
11408
- /** The skill's own frontmatter description, so the row states what the
11409
- * bundle says rather than a hand-written subtext that can drift from it. */
11410
- readonly description: string;
11411
- /** Editor ids this project's skill fans out to — the reach cluster's input.
11412
- * Project-scoped, so these are the editors with a project skill root here,
11413
- * not the user-global host set. */
11414
- readonly hosts: readonly string[];
11415
- /** Three-tier context cost of the bundled project skill. Absent when the
11416
- * bundle cannot be read. */
11417
- readonly size?: SkillCostTiers; /** On-disk source of the bundled skill, so the row can open its preview. */
11418
- readonly sourceDir?: string;
11419
- } | null;
11420
- }
11421
- /** One toggle for `projectIntegrations.setComponent`. The skill is a single
11422
- * row (no id) — it fans out across every capable editor. */
11423
- interface OkProjectIntegrationsSetRequest {
11424
- readonly component: {
11425
- readonly kind: 'editor';
11426
- readonly id: OkMcpWiringEditorId;
11427
- } | {
11428
- readonly kind: 'skill';
11429
- };
11430
- readonly enabled: boolean;
11431
- }
11432
- type OkProjectIntegrationsSetResult = {
11433
- readonly ok: true;
11434
- readonly status: OkProjectIntegrationsStatus;
11435
- } | {
11436
- readonly ok: false;
11437
- readonly error: string;
11438
- readonly status: OkProjectIntegrationsStatus;
11439
- };
11440
- /**
11441
- * Per-project consent dialog — renderer-facing payload + result shapes.
11442
- */
11443
- type OkOnboardingWarningKind = 'root' | 'home' | 'home-documents' | 'home-desktop' | 'home-downloads' | 'volumes-mount' | 'drive-root';
11444
- type OkOnboardingGitState = 'present' | 'absent' | 'shell-only';
11445
- interface OkOnboardingShowPayload {
11446
- readonly pickedPath: string;
11447
- readonly projectDir: string;
11448
- readonly defaultContentDir: string;
11449
- readonly gitState: OkOnboardingGitState;
11450
- readonly gitRootPromoted: boolean;
11451
- readonly warnings: readonly {
11452
- readonly kind: OkOnboardingWarningKind;
11453
- }[];
11454
- readonly editorOptions: readonly {
11455
- readonly id: OkMcpWiringEditorId;
11456
- readonly label: string;
11457
- readonly hasProjectConfig: boolean;
11458
- /** Optional for back-compat; absent reads as `true`. `false` = the editor
11459
- * has no user-global config surface (Pi — project-scope only). */
11460
- readonly hasUserConfig?: boolean;
11461
- }[];
11462
- }
11463
- interface OkOnboardingConfirmRequest {
11464
- readonly initGit: boolean;
11465
- readonly contentDir: string;
11466
- readonly additionalIgnores: string;
11467
- readonly editorIds: readonly OkMcpWiringEditorId[];
11468
- readonly sharing: 'shared' | 'local-only';
11469
- }
11470
- type OkOnboardingResult = {
11471
- ok: true;
11472
- } | {
11473
- ok: false;
11474
- error: string;
11475
- };
11476
- interface OkOnboardingProbeContentRequest {
11477
- readonly contentDir: string;
11478
- }
11479
- type OkOnboardingProbeContentResult = {
11480
- readonly ok: true;
11481
- readonly count: number;
11482
- readonly sample: readonly string[];
11483
- readonly truncated: boolean;
11484
- } | {
11485
- readonly ok: false;
11486
- readonly error: string;
11487
- };
11488
- /**
11489
- * Result shape for `bridge.debug?.keyringSmoke()` — mirrors
11490
- * `KeyringSmokeResult` in `packages/desktop/src/utility/keyring-smoke.ts`
11491
- * (identical field set). Duplicated here (not imported) because core has no
11492
- * dep on desktop. The desktop utility remains checked against this canonical
11493
- * field set by the desktop architecture test.
11494
- */
11495
- interface OkKeyringSmokeResult {
11496
- ok: boolean;
11497
- backend?: 'keyring' | 'file';
11498
- error?: string;
11499
- durationMs?: number;
11500
- timestamp: string;
11501
- }
11502
- /**
11503
- * Seed scaffolder shapes duplicated structurally (same rationale as
11504
- * `OkKeyringSmokeResult` above — avoids pulling the server package into
11505
- * core's compilation tree). Structural shape tracks
11506
- * `@inkeep/open-knowledge-server`'s `ScaffoldPlan` / `ApplyResult` /
11507
- * `ApplyError` / `FileEntry` / `SkipEntry`.
11508
- *
11509
- * Folder defaults moved out of `config.yml` `folders:` and into nested
11510
- * `<folder>/.ok/frontmatter.yml` files written via the standard file-entry
11511
- * path. The previous `OkFolderRule` / `OkScaffoldConfigEdit` mirror types
11512
- * + the `configEdits` field on `OkScaffoldPlan` were removed alongside.
11513
- */
11514
- interface OkScaffoldFileEntry {
11515
- path: string;
11516
- kind: 'folder' | 'file';
11517
- contentPreview?: string;
11518
- }
11519
- interface OkScaffoldSkipEntry {
11520
- path: string;
11521
- reason: 'already-exists' | 'user-content' | 'glob-collision';
11522
- }
11523
- interface OkScaffoldPlan {
11524
- created: OkScaffoldFileEntry[];
11525
- skipped: OkScaffoldSkipEntry[];
11526
- warnings: string[];
11527
- /** Project-local skills shipped by the pack. `pending` means apply would
11528
- * author or refresh the skill source. `conflict` means a user-owned skill
11529
- * holds the name; apply will neither install nor clobber it. */
11530
- packSkills?: {
11531
- name: string;
11532
- pending: boolean;
11533
- conflict?: boolean;
11534
- }[];
11535
- /**
11536
- * Lint plugins the pack requires. `pending` means apply would turn one on.
11537
- *
11538
- * `id` is the plugin union rather than a bare `string`: this interface is
11539
- * hand-mirrored from the server's `ScaffoldPlan`, and the preload passes one
11540
- * where the other is expected — so a widened field here does not read as
11541
- * "more permissive", it fails to assign.
11542
- */
11543
- requiredPlugins?: {
11544
- id: LintPluginId;
11545
- pending: boolean;
11546
- }[];
11547
- }
11548
- interface OkScaffoldApplyError {
11549
- path: string;
11550
- error: string;
11551
- }
11552
- interface OkScaffoldApplyResult {
11553
- applied: number;
11554
- errors: OkScaffoldApplyError[];
11555
- durationMs: number;
11556
- /** Editor display-names that received the pack's project skill (e.g. "Claude Code"). */
11557
- packSkillsInstalled: string[];
11558
- /** Required plugins this apply actually turned on; empty when all were already enabled. */
11559
- pluginsEnabled: LintPluginId[];
11560
- /** Pack skills skipped because a user-owned same-named skill holds the name. */
11561
- packSkillConflicts: {
11562
- name: string;
11563
- hosts?: string[];
11564
- }[];
11565
- }
11566
- interface OkSeedError {
11567
- kind: 'no-project' | 'prerequisite-missing' | 'invalid-root' | 'internal';
11568
- message: string;
11569
- }
11570
- /**
11571
- * Pack-id wire shape — accepted strings; coerced server-side via `coercePackId`.
11572
- *
11573
- * This bridge leaf is the renderer contract's single declaration point.
11574
- */
11575
- type OkPackId = 'knowledge-base' | 'software-lifecycle' | 'codebase-wiki' | 'plain-notes' | 'worldbuilding' | 'writing-pipeline' | 'entity-vault' | 'okf';
11576
- interface OkSeedPlanOptions {
11577
- rootDir?: string;
11578
- packId?: OkPackId;
11579
- /**
11580
- * Preview a pack for a project that does not exist yet. The create-new
11581
- * dialog runs on the Navigator window, which has no project bound, so the
11582
- * normal `resolveProjectRoot` path answers `no-project`. Main plans against
11583
- * a throwaway directory instead, so every entry reads as `created`.
11584
- *
11585
- * `skillsInstallable` is the part only the caller knows: whether the project
11586
- * about to be created has an editor selected, and so whether the pack's
11587
- * skills will actually install once it exists.
11588
- */
11589
- preview?: {
11590
- skillsInstallable: boolean;
11591
- };
11592
- }
11593
- interface OkSeedApplyOptions {
11594
- packId?: OkPackId;
11595
- }
11596
- interface OkSeedPackFolderInfo {
11597
- path: string;
11598
- summary: string;
11599
- }
11600
- /**
11601
- * User-visible entry counts surfaced on each pack picker card as
11602
- * "N files · N folders".
11603
- */
11604
- interface OkSeedPackEntryCounts {
11605
- files: number;
11606
- folders: number;
11607
- }
11608
- interface OkSeedPackInfo {
11609
- id: OkPackId;
11610
- name: string;
11611
- description: string;
11612
- defaultSubfolder?: string;
11613
- folders: OkSeedPackFolderInfo[];
11614
- entryCounts: OkSeedPackEntryCounts;
11615
- }
11616
- /** Pure-fs upward-walk result types mirrored from `@inkeep/open-knowledge-server`'s
11617
- * `fs/` module. Structurally duplicated for the same reason as the seed shapes
11618
- * above (core has no dep on server). */
11619
- interface OkFindEnclosingProjectRootResult {
11620
- readonly rootPath: string;
11621
- readonly distance: number;
11622
- }
11623
- interface OkFindEnclosingGitRootResult {
11624
- readonly gitRoot: string;
11625
- readonly distance: number;
11626
- }
11627
- type OkSeedPlanResult = {
11628
- ok: true;
11629
- plan: OkScaffoldPlan;
11630
- } | {
11631
- ok: false;
11632
- error: OkSeedError;
11633
- };
11634
- type OkSeedApplyResult = {
11635
- ok: true;
11636
- result: OkScaffoldApplyResult;
11637
- } | {
11638
- ok: false;
11639
- error: OkSeedError;
11640
- };
11641
- type OkSeedListPacksResult = {
11642
- ok: true;
11643
- packs: OkSeedPackInfo[];
11644
- } | {
11645
- ok: false;
11646
- error: {
11647
- kind: 'internal';
11648
- message: string;
11649
- };
11650
- };
11651
- /**
11652
- * Pre-project local-op event shapes — auth + clone flows surfaced to the
11653
- * Navigator window via IPC because it has no backing API server.
11654
- */
11655
- type OkLocalOpAuthEvent = {
11656
- type: 'verification';
11657
- user_code: string;
11658
- verification_uri: string;
11659
- expires_in: number;
11660
- } | {
11661
- type: 'complete';
11662
- host: string;
11663
- login: string;
11664
- name?: string;
11665
- email?: string;
11666
- avatarUrl?: string;
11667
- } | {
11668
- type: 'error';
11669
- message: string;
11670
- };
11671
- type OkLocalOpCloneEvent = {
11672
- type: 'progress';
11673
- phase: string;
11674
- pct: number;
11675
- } | {
11676
- type: 'complete';
11677
- dir: string;
11678
- } | {
11679
- type: 'branch-fallback';
11680
- branch: string;
11681
- } | {
11682
- type: 'error';
11683
- message: string;
11684
- };
11685
- interface OkLocalOpStream<E> {
11686
- readonly events: AsyncIterable<E>;
11687
- cancel(): void;
11688
- }
11689
- type OkLocalOpAuthStatusResponse = {
11690
- authenticated: true;
11691
- host: string;
11692
- login: string;
11693
- tier?: 'A' | 'B' | 'C';
11694
- name?: string;
11695
- email?: string;
11696
- ghAvailable?: boolean;
11697
- } | {
11698
- authenticated: false;
11699
- host: string;
11700
- error?: string;
11701
- ghAvailable?: boolean;
11702
- };
11703
- interface OkLocalOpRepoEntry {
11704
- full_name: string;
11705
- clone_url: string;
11706
- private: boolean;
11707
- }
11708
- type OkLocalOpAuthReposResponse = {
11709
- ok: true;
11710
- host: string;
11711
- repos: OkLocalOpRepoEntry[];
11712
- } | {
11713
- ok: false;
11714
- error: string;
11715
- };
11716
- /**
11717
- * Renderer → main snapshot of the editor area's active target.
11718
- * Discriminated-union shape so TypeScript narrows `identifier` per `kind`.
11719
- * Drives the macOS File menu's state-aware enable/disable for items like
11720
- * Rename / Move to Trash / Open with AI.
11721
- */
11722
- type OkEditorActiveTargetSnapshot = {
11723
- readonly kind: 'doc';
11724
- readonly identifier: string;
11725
- } | {
11726
- readonly kind: 'folder';
11727
- readonly identifier: string;
11728
- } | {
11729
- readonly kind: 'asset';
11730
- readonly identifier: string;
11731
- } | {
11732
- readonly kind: null;
11733
- };
11734
- /**
11735
- * Renderer → main snapshot of the View menu's checkbox + smart-hide state.
11736
- * Sibling of `OkEditorActiveTargetSnapshot`.
11737
- */
11738
- interface OkEditorViewMenuStateSnapshot {
11739
- readonly showHiddenFiles: boolean;
11740
- readonly showOkFolders: boolean;
11741
- readonly showOnlyMarkdownFiles: boolean;
11742
- readonly showSkillsSection: boolean;
11743
- readonly canExpandAll: boolean;
11744
- readonly canCollapseAll: boolean;
11745
- readonly sidebarVisible: boolean;
11746
- readonly docPanelVisible?: boolean;
11747
- readonly terminalVisible?: boolean;
11748
- readonly terminalPlacement?: TerminalPlacement;
11749
- readonly terminalLive?: boolean;
11750
- readonly agentPanelVisible?: boolean;
11751
- readonly canViewInSource?: boolean;
11752
- /**
11753
- * Is there a live editor selection? ⌘L stages that selection in the agents
11754
- * panel instead of toggling it, so the menu item has to know: without this the
11755
- * label reads "Hide Agents" while the click stages a passage and the panel
11756
- * stays open.
11757
- */
11758
- readonly hasEditorSelection?: boolean;
11759
- }
11760
- /**
11761
- * Windows/Linux renderer-menubar dispatch payloads (the windows-linux-port
11762
- * renderer-menubar decision). macOS keeps the native menu bar; win/linux draw it in the
11763
- * renderer and route every click through main via `menu.dispatch` so menu
11764
- * semantics stay single-sourced: `menu-action` relays through the same
11765
- * dispatch path the native menu items use, `role` maps onto Electron's
11766
- * built-in menu roles, `command` covers the main-side click handlers
11767
- * (navigator, folder picker, settings, updater…), and `query` returns the
11768
- * aggregated state the native menu renders from. The IPC channel module
11769
- * re-exports these canonical types under its transport-facing names.
11770
- */
11771
- type OkMenuDispatchRole = 'undo' | 'redo' | 'cut' | 'copy' | 'paste' | 'selectAll' | 'reload' | 'forceReload' | 'toggleDevTools' | 'resetZoom' | 'zoomIn' | 'zoomOut' | 'toggleFullScreen' | 'minimize' | 'close' | 'quit';
11772
- type OkMenuDispatchCommand = 'open-navigator' | 'open-folder-dialog' | 'clear-recent-projects' | 'open-settings' | 'check-for-updates' | 'reconfigure-mcp-wiring' | 'open-github' | 'toggle-spell-check';
11773
- type OkMenuDispatchRequest = {
11774
- readonly kind: 'query';
11775
- } | {
11776
- readonly kind: 'menu-action';
11777
- readonly action: OkMenuAction;
11778
- } | {
11779
- readonly kind: 'command';
11780
- readonly command: OkMenuDispatchCommand;
11781
- } | {
11782
- readonly kind: 'open-recent-project';
11783
- readonly path: string;
11784
- } | {
11785
- readonly kind: 'role';
11786
- readonly role: OkMenuDispatchRole;
11787
- };
11788
- /** `query` result — the same aggregated state the native menu renders from. */
11789
- interface OkMenuRendererSnapshot {
11790
- readonly recentProjects: ReadonlyArray<{
11791
- readonly path: string;
11792
- readonly name: string;
11793
- }>;
11794
- readonly spellCheckEnabled: boolean;
11795
- readonly showDevToolsMenu: boolean;
11796
- readonly canCheckForUpdates: boolean;
11797
- readonly canReconfigureMcpWiring: boolean;
11798
- readonly activeTarget: OkEditorActiveTargetSnapshot;
11799
- readonly viewMenuState: OkEditorViewMenuStateSnapshot;
11800
- }
11801
- /** Consent-bearing payload for the renderer-to-main bug-report send hop. */
11802
- interface OkBugReportSendInput {
11803
- zipPath: string;
11804
- metadata: OkBugReportSendMetadata;
11805
- /**
11806
- * Whether the reviewed bundle contains an app screenshot. The bundle's
11807
- * inventory is the consent record; absent or false means main must not
11808
- * upload the capture it may still hold.
11809
- */
11810
- includeScreenshot?: boolean;
11811
- }
11812
- /**
11813
- * Renderer-facing Electron bridge. Populated on `window.okDesktop` by the
11814
- * desktop preload script. Web distribution omits the
11815
- * global entirely — consumers MUST use `window.okDesktop?.` optional chaining.
11816
- *
11817
- * Method surface is intentionally small: dialog pickers, outbound URL /
11818
- * clipboard relays, project subscriptions, and the readonly config snapshot.
11819
- * Broad APIs (window sizing, system info, raw ipcRenderer) are deliberately
11820
- * omitted — new capabilities cross the preload boundary deliberately, one at
11821
- * a time, via new typed methods.
11822
- */
11823
- /** OK config sharing mode. */
11824
- interface OkSharingStatusResult {
11825
- readonly kind: 'status';
11826
- readonly mode: 'shared' | 'local-only' | 'no-git';
11827
- readonly excluded: readonly string[];
11828
- readonly trackedUpstream: readonly string[];
11829
- /** True when local-only but `.ok/skills/` is carved back out as shareable. */
11830
- readonly skillsShared: boolean;
11831
- }
11832
- type OkSharingSetModeResult = {
11833
- readonly kind: 'applied';
11834
- readonly mode: 'shared' | 'local-only' | 'no-git';
11835
- } | {
11836
- readonly kind: 'refused-tracked';
11837
- readonly tracked: readonly string[];
11838
- readonly remediation: string;
11839
- } | {
11840
- readonly kind: 'no-exclude';
11841
- readonly reason: 'no-git' | 'no-info-dir' | 'malformed-pointer' | 'inaccessible';
11842
- };
11843
- /** Slides (Slidev) — detect-only IPC payload. Canonical types in
11844
- * `packages/desktop/src/shared/ipc-channels.ts`; mirrored here per the
11845
- * OkDesktopBridge 3-way-mirror invariant. */
11846
- type SlidevSource = 'project-local' | 'global';
11847
- type OkSlidesStatusResult = {
11848
- readonly kind: 'status';
11849
- readonly available: true;
11850
- readonly source: SlidevSource;
11851
- } | {
11852
- readonly kind: 'status';
11853
- readonly available: false;
11854
- };
11855
- /** Why opening a deck as slides failed. Canonical types in
11856
- * `packages/desktop/src/shared/ipc-channels.ts`; mirrored here. */
11857
- type SlidevOpenFailureReason = 'not-available' | 'invalid-path' | 'spawn-error' | 'exited-early' | 'timeout' | 'unsupported-server';
11858
- type OkSlidesOpenResult = {
11859
- readonly kind: 'open';
11860
- readonly ok: true;
11861
- } | {
11862
- readonly kind: 'open';
11863
- readonly ok: false;
11864
- readonly reason: SlidevOpenFailureReason;
11865
- };
11866
- /**
11867
- * Payload for `onServerVersionDrift` — the desktop attached to a server whose
11868
- * version differs from the running app's (most often a prior version's
11869
- * detached server still alive after an auto-update).
11870
- */
11871
- interface OkServerVersionDriftInfo {
11872
- /** `older` = the attached server predates the app; `newer` = it is ahead. */
11873
- readonly relation: 'older' | 'newer';
11874
- /** Which dimension differed — diagnostic, not surfaced in copy. */
11875
- readonly dimension: 'protocol' | 'runtime';
11876
- /** The attached server's runtime semver (for the notification body). */
11877
- readonly serverRuntime: string;
11878
- /** The running app's runtime semver. */
11879
- readonly appRuntime: string;
11880
- }
11881
- /** Payload for `onServerRestarted` — fired on the freshly-spawned window after a successful restart. */
11882
- interface OkServerRestartedInfo {
11883
- readonly appRuntime: string;
11884
- }
11885
- /**
11886
- * Payload for `onRecentRemovedMissing` — fired on the window that initiated a
11887
- * recents open when the target folder was gone and its stale entry was pruned.
11888
- */
11889
- interface OkRecentRemovedMissingInfo {
11890
- readonly path: string;
11891
- readonly projectName: string;
11892
- }
11893
- /**
11894
- * Result of `restartServer`. Only the failure case reaches the originating
11895
- * renderer — on success the window is recreated, so its invoke promise never
11896
- * resolves (by design); the success toast fires on the new window instead.
11897
- */
11898
- type OkServerRestartOutcome = {
11899
- readonly ok: true;
11900
- } | {
11901
- readonly ok: false;
11902
- readonly reason: 'eperm' | 'other';
11903
- };
11904
- /** Result of `terminal.create`. */
11905
- type OkPtyCreateResult = {
11906
- readonly ok: true;
11907
- readonly ptyId: string;
11908
- } | {
11909
- readonly ok: false;
11910
- readonly reason: 'no-project' | 'not-consented';
11911
- };
11912
- /** Entry of `terminal.list`. */
11913
- interface OkPtyListEntry {
11914
- readonly ptyId: string;
11915
- /** User-set custom tab name that survives a renderer reload; null when unset. */
11916
- readonly customLabel: string | null;
11917
- /** Sticky per-session tab number, preserved across a renderer reload; null
11918
- * until the renderer has reported it for a just-created session. */
11919
- readonly ordinal: number | null;
11920
- }
11921
- /** Result of `terminal.adopt`. */
11922
- type OkPtyAdoptResult = {
11923
- readonly ok: true;
11924
- readonly replay: string;
11925
- } | {
11926
- readonly ok: false;
11927
- readonly reason: 'unknown-session';
11928
- };
11929
- /** Push payload for `ok:pty:data`. */
11930
- interface OkPtyData {
11931
- readonly ptyId: string;
11932
- readonly data: string;
11933
- }
11934
- /** Push payload for `ok:pty:exit`. */
11935
- interface OkPtyExit {
11936
- readonly ptyId: string;
11937
- readonly exitCode: number;
11938
- readonly signal: number | null;
11939
- readonly error?: string;
11940
- }
11941
- /**
11942
- * Claude Code readiness for the docked terminal.
11943
- */
11944
- interface ClaudeReadiness {
11945
- readonly claude: 'present' | 'not-found' | 'unknown';
11946
- readonly mcp: 'wired' | 'needs-rewire';
11947
- /** True when the project's own `open-knowledge` `.mcp.json` entry is verified
11948
- * to be OK's canonical managed server (cli `isOwnManagedEntry`), so the docked
11949
- * terminal may pre-approve it on Claude launch instead of re-showing Claude's
11950
- * trust prompt. False/absent for a foreign, tampered, or missing entry (the
11951
- * supply-chain risk in a shared/cloned project) — launch bare and let Claude
11952
- * prompt. Computed per-project by the desktop preflight; absent means false
11953
- * (fail-safe). */
11954
- readonly mcpPreApprovable?: boolean;
11955
- /** Set only on a `rewire`-action result when re-arming MCP wiring threw, so
11956
- * the renderer can surface the failure instead of the button silently no-op'ing. */
11957
- readonly rewireError?: string;
11958
- }
11959
- /** On-PATH readiness for a non-Claude agent CLI (codex / cursor-agent) launched
11960
- * in the docked terminal. */
11961
- interface CliReadiness {
11962
- readonly onPath: 'present' | 'not-found' | 'unknown';
11963
- /** Codex-only: whether OK's `open-knowledge` MCP server is already configured
11964
- * in the user's codex config. Gates the per-launch `-c` tool-auto-approve
11965
- * override — codex fails to load its config if `-c` targets a server that is
11966
- * not defined, so the launch site adds the override only when this is true.
11967
- * Absent for CLIs where it does not apply.
11968
- *
11969
- * DELIBERATELY WEAKER THAN CLAUDE'S GATE, and not its security equivalent.
11970
- * This is existence-by-name (any object under `mcp_servers.open-knowledge`),
11971
- * whereas claude's `mcpPreApprovable` runs `isOwnManagedEntry` to verify the
11972
- * entry is byte-exactly OK's own. The asymmetry is sound because the two read
11973
- * different files: claude's is a PROJECT-scoped `.mcp.json` that travels in a
11974
- * clone, so a same-named foreign entry is a real RCE vector; codex's target is
11975
- * `scope: 'global'` (`~/.codex/config.toml`, resolved from `home`, never from
11976
- * cwd), so anyone able to plant a foreign entry there can already register
11977
- * arbitrary MCP servers and has won regardless. Tightening this to an exact
11978
- * ownership match would also fail closed on a legitimate entry carrying any
11979
- * extra codex key, silently disabling auto-approve for real users. This gate's
11980
- * job is availability (don't break codex's config load), not authorization. */
11981
- readonly okServerConfigured?: boolean;
11982
- }
11983
- interface OkDesktopBridge {
11984
- readonly config: OkDesktopConfig;
11985
- /** Subscribe to project-switch events. Returns unsubscribe. */
11986
- onProjectSwitched(cb: (next: OkDesktopConfig) => void): OkUnsubscribe;
11987
- /** Subscribe to menu-bar actions. Returns unsubscribe. */
11988
- onMenuAction(cb: (action: OkMenuAction) => void): OkUnsubscribe;
11989
- /**
11990
- * Subscribe to `autoUpdater` `update-downloaded` events. Fires once per
11991
- * pending-update version (gated in main by `AppState.versionPendingInstall`).
11992
- * Returns unsubscribe. Toast A.
11993
- */
11994
- onUpdateDownloaded(cb: (info: OkUpdateDownloadedInfo) => void): OkUnsubscribe;
11995
- /**
11996
- * Subscribe to `ok:update:relaunching` — another window's "Relaunch now"
11997
- * click committed in main. Swap this window's `update-downloaded` card to the
11998
- * button-less "Relaunching…" in-progress state so every window shows
11999
- * consistent feedback during the pre-`quitAndInstall` server teardown.
12000
- * Returns unsubscribe.
12001
- */
12002
- onUpdateRelaunching(cb: (info: OkUpdateRelaunchingInfo) => void): OkUnsubscribe;
12003
- /**
12004
- * Subscribe to `ok:update:relaunch-failed` — a committed relaunch failed
12005
- * (async updater error, no-quit watchdog, or sync throw). Surface the
12006
- * relaunch-error notice; the banner re-arm arrives separately as a
12007
- * re-broadcast `ok:update:downloaded`. Returns unsubscribe.
12008
- */
12009
- onUpdateRelaunchFailed(cb: (info: OkUpdateRelaunchFailedInfo) => void): OkUnsubscribe;
12010
- /**
12011
- * Subscribe to post-update "What's new" events. Fires once per version
12012
- * transition on first launch (gated in main by `AppState.lastSeenVersion`).
12013
- * Returns unsubscribe. Toast B.
12014
- */
12015
- onWhatsNew(cb: (info: OkWhatsNewInfo) => void): OkUnsubscribe;
12016
- /** Subscribe to `ok:update:whats-new-dismissed` — another window dismissed the what's-new notice; clear this window's `whats-new-<version>` card. */
12017
- onWhatsNewDismissed(cb: (info: {
12018
- readonly version: string;
12019
- }) => void): OkUnsubscribe;
12020
- /**
12021
- * Subscribe to `stuck-update` hints. Fires at most once per installation
12022
- * after 7 consecutive failed-check days. Returns unsubscribe. Toast C.
12023
- */
12024
- onUpdateStuckHint(cb: (info: OkUpdateStuckHintInfo) => void): OkUnsubscribe;
12025
- /**
12026
- * Subscribe to `ok:deep-link` — fired when an
12027
- * `openknowledge://open?project=…&doc=<name>` URL is routed to this
12028
- * window. Renderer updates `location.hash` to open the target doc via
12029
- * the existing hash-route listener. Returns unsubscribe.
12030
- */
12031
- onDeepLink(cb: (evt: {
12032
- doc: string;
12033
- kind: 'doc' | 'folder';
12034
- branch?: string | null;
12035
- multiCandidate?: boolean;
12036
- targetMissing?: boolean;
12037
- repositoryPath?: string;
12038
- contentRootDepth?: number;
12039
- }) => void): OkUnsubscribe;
12040
- /**
12041
- * Subscribe to `ok:share-received` — fired when a share URL (universal
12042
- * link `https://openknowledge.ai/d/<encoded>` or custom scheme
12043
- * `openknowledge://share?url=<blob-url>`) routes to this window. The
12044
- * discriminated payload tells the renderer to mount the receive dialog
12045
- * (kind `ok`) or surface a toast (kind `unsupported-version` / `invalid`).
12046
- */
12047
- onShareReceived(cb: (payload: OkShareReceivedPayload) => void): OkUnsubscribe;
12048
- /**
12049
- * Subscribe to `ok:server-version-drift` — fired once when this window
12050
- * attaches to a server whose version differs from the app's. The renderer
12051
- * surfaces a cancelable notification offering to restart the server via
12052
- * `restartServer`.
12053
- */
12054
- onServerVersionDrift(cb: (info: OkServerVersionDriftInfo) => void): OkUnsubscribe;
12055
- /**
12056
- * Subscribe to `ok:server-restarted` — fired on a freshly-recreated window
12057
- * after a successful `restartServer`, so the renderer can confirm the
12058
- * server now matches the app.
12059
- */
12060
- onServerRestarted(cb: (info: OkServerRestartedInfo) => void): OkUnsubscribe;
12061
- /**
12062
- * Subscribe to `ok:project:recent-removed-missing` — fired on the window that
12063
- * initiated a recents open of a folder that no longer exists. The stale entry
12064
- * has already been pruned from the recents list; the renderer surfaces a
12065
- * lightweight toast (and, in the Navigator, drops the row from its list).
12066
- */
12067
- onRecentRemovedMissing(cb: (info: OkRecentRemovedMissingInfo) => void): OkUnsubscribe;
12068
- /**
12069
- * Restart the project's server to match this app's version: terminate the
12070
- * attached (not-owned) server and recreate the window against a fresh
12071
- * own-version spawn. Resolves to `{ ok:false }` only when termination fails
12072
- * (the originating window stays); on success the window is recreated and the
12073
- * success toast fires there.
12074
- */
12075
- restartServer(projectPath: string): Promise<OkServerRestartOutcome>;
12076
- /**
12077
- * Push the user's chosen `nativeTheme.themeSource` value to main. Carries
12078
- * the user-intent value (`'system' | 'light' | 'dark'`) verbatim — NEVER
12079
- * resolve `'system'` to a concrete `'light' | 'dark'` at the call site
12080
- * (it IS the lever that delegates to macOS appearance). Renderer
12081
- * ConfigProvider runs this on every CRDT mutation of `appearance.theme`.
12082
- * Failure is best-effort — body theme stays correct via next-themes; next
12083
- * CRDT mutation re-fires.
12084
- */
12085
- setThemeSource(source: OkThemeSource): Promise<{
12086
- ok: true;
12087
- }>;
12088
- /**
12089
- * Push the user's chosen interface language to main, which rebuilds the
12090
- * native menu bar in it. Carries the user-intent value (`'system'` or a
12091
- * supported tag) verbatim — NEVER resolve `'system'` to a concrete locale at
12092
- * the call site, for the same reason `setThemeSource` must not: `'system'`
12093
- * IS the lever that delegates to the OS preferred-language list, and a
12094
- * resolved value silently stops following it.
12095
- *
12096
- * Main resolves the language for its own boot by reading the persisted
12097
- * preference off disk, because the menu is built before any renderer exists;
12098
- * this call only carries subsequent changes. Failure is best-effort — the
12099
- * menu stays on the previous language and the next mutation re-fires.
12100
- */
12101
- setLanguagePreference(preference: LanguagePreference): Promise<{
12102
- ok: true;
12103
- }>;
12104
- /**
12105
- * Fire-and-forget renderer→main signal that the theme has been applied
12106
- * to chrome. Main's per-window show-gate listens for this alongside
12107
- * `ready-to-show` before calling `BrowserWindow.show()` — eliminates the
12108
- * cold-launch staleness window. Implemented in preload as
12109
- * `invoke('ok:theme:applied', opts).catch(() => {})` so it composes
12110
- * through the typed `createInvoker` wrapper.
12111
- *
12112
- * Optional `opts.reducedTransparency` carries the renderer's live
12113
- * `matchMedia('(prefers-reduced-transparency: reduce)').matches` value;
12114
- * main toggles vibrancy material accordingly. `opts.chrome` carries the
12115
- * active palette's OS-drawn chrome colors.
12116
- */
12117
- signalThemeApplied(opts?: {
12118
- reducedTransparency?: boolean;
12119
- chrome?: OkChromeColors;
12120
- }): void;
12121
- /** Native folder-picker dialog surfaces. */
12122
- dialog: {
12123
- /** `dialog.showOpenDialog({ properties: ['openDirectory'] })`. Resolves to the selected path or `null` on cancel.
12124
- * `defaultPath` seeds the initial directory shown to the user. */
12125
- openFolder(opts?: {
12126
- defaultPath?: string;
12127
- }): Promise<string | null>;
12128
- };
12129
- /**
12130
- * IPC-relayed wrappers around Electron's `shell` module. Main-process
12131
- * handlers enforce the outbound-scheme allowlist (`https`, `http`,
12132
- * `mailto`, `openknowledge`, plus `claude`, `codex`, `cursor` for the
12133
- * "Open in Agent Desktop" dropdown) before delegating. Unauthorized
12134
- * schemes reject.
12135
- */
12136
- shell: {
12137
- openExternal(url: string): Promise<void>;
12138
- /**
12139
- * Probe whether a URL scheme has a registered handler on this OS.
12140
- * Used by the "Open in Agent Desktop" dropdown to render disabled-
12141
- * with-tooltip rows when the target app isn't installed. Returns
12142
- * `{installed: false}` on timeout or platform-API error.
12143
- *
12144
- * **Scheme format contract:** `scheme` is the scheme NAME without
12145
- * trailing colon (e.g. `'claude'`, not `'claude:'`). Matches the Linux
12146
- * `xdg-mime query default x-scheme-handler/<name>` shell-command form
12147
- * and the main-process shell-injection sanitizer — callers with a
12148
- * colonful scheme MUST strip the trailing `:` first.
12149
- */
12150
- detectProtocol(scheme: string): Promise<{
12151
- installed: boolean;
12152
- displayName?: string;
12153
- }>;
12154
- /**
12155
- * Step 1 of the Cursor two-step handoff — spawns `cursor <path>` via a
12156
- * validated argv (shell:false, 2s timeout). Dedicated channel because
12157
- * the threat model is a command allowlist (PATH hijacking, arg
12158
- * injection) distinct from the URL-scheme allowlist above.
12159
- */
12160
- spawnCursor(path: string): Promise<{
12161
- ok: true;
12162
- } | {
12163
- ok: false;
12164
- reason: 'invalid-path' | 'not-installed' | 'timeout' | 'spawn-error';
12165
- }>;
12166
- /**
12167
- * Append a local-only telemetry line to `~/.ok/stats.jsonl`. Zero
12168
- * phone-home. Resolves even if HOME is unwritable — telemetry failure
12169
- * must never bubble up and affect the dispatch path. The reason and scope
12170
- * fields use the handoff subsystem's canonical literal-union discriminators.
12171
- */
12172
- recordHandoff(line: {
12173
- readonly target: 'claude-cowork' | 'claude-code' | 'codex' | 'cursor';
12174
- readonly host: 'electron' | 'web';
12175
- readonly outcome: 'ok' | 'error';
12176
- readonly ts: string;
12177
- readonly reason?: HandoffFailureReason;
12178
- readonly scope?: HandoffScope;
12179
- }): Promise<void>;
12180
- /**
12181
- * Open an asset via the OS default handler. `relPath` is project-relative
12182
- * (main-process resolves against `ProjectContext.projectPath` + `realpath` +
12183
- * `isPathWithinProject`). Executable extensions (`.exe`, `.sh`, `.app`, …)
12184
- * hard-refuse at the main handler — see
12185
- * `EXECUTABLE_BLOCKLIST_EXTENSIONS` in `core/constants/upload.ts` for
12186
- * the full blocklist.
12187
- */
12188
- openAsset(relPath: string): Promise<{
12189
- ok: true;
12190
- } | {
12191
- ok: false;
12192
- reason: 'extension-blocked' | 'path-escape' | 'not-found' | 'resolve-error';
12193
- }>;
12194
- /**
12195
- * Reveal an asset in the native file manager (macOS Finder / Windows
12196
- * Explorer / Linux xdg-open → default). Parent-only — does NOT invoke
12197
- * the OS default handler for content. Lower-risk than `openAsset`; the
12198
- * executable blocklist does NOT apply.
12199
- */
12200
- revealAsset(relPath: string): Promise<{
12201
- ok: true;
12202
- } | {
12203
- ok: false;
12204
- reason: 'path-escape' | 'not-found' | 'resolve-error';
12205
- }>;
12206
- /**
12207
- * Reveal an ABSOLUTE path outside the caller window's project — the
12208
- * terminal's "this file is outside your project" clickable-link flow.
12209
- * Deliberately NOT containment-gated (unlike `revealAsset`); main stats the
12210
- * path and pops a native confirmation dialog, revealing only on confirm. The
12211
- * dialog is the trust boundary.
12212
- */
12213
- revealExternal(absPath: string): Promise<{
12214
- ok: true;
12215
- outcome: 'revealed' | 'dismissed';
12216
- } | {
12217
- ok: false;
12218
- reason: 'not-found' | 'invalid-path' | 'error';
12219
- }>;
12220
- /**
12221
- * Display the native right-click context menu for an on-disk reference
12222
- * (`asset`, `wiki-link`, or `image`). Built from `Menu.buildFromTemplate`
12223
- * in main — the gesture-attested pattern: main observes the click
12224
- * directly, no IPC gesture forwarding needed. Entries: Reveal in Finder
12225
- * + Open in default app + Copy link.
12226
- */
12227
- showAssetMenu(params: {
12228
- readonly relPath: string;
12229
- readonly title: string;
12230
- readonly kind: 'asset' | 'wiki-link' | 'image';
12231
- }): Promise<void>;
12232
- /**
12233
- * Reveal a file or folder in the OS file manager (Finder / Explorer /
12234
- * Linux default). Path is validated against the caller window's project
12235
- * directory in main; out-of-project, non-absolute, or null-byte-bearing
12236
- * paths are silently refused at the wire (channel returns `undefined`
12237
- * regardless; refusals emit a main-process `console.warn` for debugging).
12238
- */
12239
- showItemInFolder(path: string): Promise<void>;
12240
- /**
12241
- * Move a file or folder to the OS Trash via `shell.trashItem`. Step 1
12242
- * of the sidebar Delete flow's two-step Option B orchestration.
12243
- */
12244
- trashItem(absPath: string): Promise<{
12245
- ok: true;
12246
- } | {
12247
- ok: false;
12248
- reason: 'not-found' | 'permission-denied' | 'system-error' | 'path-escape';
12249
- detail?: string;
12250
- }>;
12251
- };
12252
- /** IPC-relayed clipboard writer (sandboxed renderer cannot call clipboard directly). */
12253
- clipboard: {
12254
- writeText(text: string): Promise<void>;
12255
- /**
12256
- * Copy an image to the clipboard as raster bytes via `nativeImage`,
12257
- * which macOS's pasteboard writer expands into the 9-flavor raster
12258
- * set (`«class PNGf»`, `TIFF picture`, `JPEG picture`, `GIF
12259
- * picture`, `«class jp2»`, `«class BMP»`, `«class TPIC»`,
12260
- * `«class 8BPS»`, `«class AVIF»`) — the same shape a macOS
12261
- * screenshot writes. Every rich receiver (Notes, Docs, Slack chat,
12262
- * Notion inline, iMessage) picks a compatible flavor and renders
12263
- * inline first-try.
12264
- *
12265
- * Renderer's own `navigator.clipboard.write` can't produce that
12266
- * 9-flavor set (Chromium's Async Clipboard API only accepts one
12267
- * blob per MIME key), which is why the copy has to run in main.
12268
- * `nativeImage.createFromBuffer` decodes PNG + JPEG only; other
12269
- * formats resolve `empty-image` and the renderer is expected to
12270
- * fall back to its own best-effort `navigator.clipboard.write`.
12271
- */
12272
- copyImage(params: {
12273
- readonly src: string;
12274
- readonly alt: string;
12275
- }): Promise<{
12276
- ok: true;
12277
- } | {
12278
- ok: false;
12279
- reason: 'fetch-failed' | 'path-escape' | 'empty-image' | 'read-error' | 'write-error';
12280
- detail?: string;
12281
- }>;
12282
- };
12283
- /**
12284
- * Project-management surface consumed by the Navigator component.
12285
- * `listRecent` reads the LRU-capped recent list from app state; `open`
12286
- * spawns a NEW editor window for `request.path` (no switch-in-place);
12287
- * `close` tears down the window hosting the call site.
12288
- */
12289
- project: {
12290
- listRecent(): Promise<RecentProjectEntry[]>; /** Forget one entry from the recent-projects list. */
12291
- removeRecent(path: string): Promise<void>;
12292
- getSessionState(): Promise<ProjectSessionState>;
12293
- setSessionState(state: ProjectSessionState): Promise<void>;
12294
- open(request: OkProjectOpenRequest): Promise<void>;
12295
- /**
12296
- * File → Open file… — show the native md/mdx picker and open the pick in a
12297
- * temporary single-file session (the desktop side of `ok <file>`). Picker +
12298
- * open both run main-side; the picked path never crosses back to the
12299
- * renderer.
12300
- */
12301
- openFile(): Promise<void>;
12302
- /**
12303
- * Atomically scaffold a new project under `parent/name` with the
12304
- * user-chosen `editors` set. `editors` is the renderer's exact selection
12305
- * (seeded from `integrations.status().detectedEditorIds`, minus/plus
12306
- * anything the user toggled); main never widens or narrows it.
12307
- */
12308
- createNew(args: {
12309
- parent: string;
12310
- name: string;
12311
- editors: OkMcpWiringEditorId[]; /** OK config sharing mode — defaults to 'shared' when omitted. */
12312
- sharing?: 'shared' | 'local-only';
12313
- packId?: OkPackId;
12314
- /**
12315
- * Folder the pack scaffolds into, relative to the project root.
12316
- * Omitted → the project root (the dialog's default).
12317
- */
12318
- rootDir?: string;
12319
- }): Promise<void>;
12320
- /**
12321
- * Fire-and-forget renderer→main telemetry counter for the Create-new-project
12322
- * dialog cascade banners.
12323
- */
12324
- recordCreateNewBannerShown(banner: CreateNewBannerKind): Promise<void>;
12325
- /**
12326
- * Probe `<projectPath>/<path>` for the share-receive target-existence
12327
- * gate, dispatching the on-disk predicate on `kind`.
12328
- */
12329
- checkTargetExists(request: {
12330
- projectPath: string;
12331
- kind: 'doc' | 'folder';
12332
- path: string;
12333
- }): Promise<OkCheckTargetExistsResult>; /** Read `<projectPath>/.git/HEAD` and classify the result. */
12334
- readHeadBranch(projectPath: string): Promise<OkHeadBranchInfo>; /** Proxy `GET /api/git/branch-info` against the project's running server. */
12335
- fetchBranchInfo(request: {
12336
- projectPath: string;
12337
- branch: string;
12338
- kind: 'doc' | 'folder'; /** URL-derived repository-relative target path. */
12339
- path: string;
12340
- }): Promise<BranchInfoResponse | null>;
12341
- /**
12342
- * Proxy `POST /api/git/checkout` against the project's running server.
12343
- * `fastForward` (on-origin "Switch and update branch") fast-forwards the
12344
- * target branch to origin's tip before checkout; divergence → `ff-diverged`
12345
- * (nothing mutated).
12346
- */
12347
- runCheckout(request: {
12348
- projectPath: string;
12349
- branch: string;
12350
- fastForward?: boolean;
12351
- }): Promise<CheckoutResponse | null>;
12352
- /**
12353
- * Proxy `POST /api/share/target-status` for the branch-switch dialog's
12354
- * verdict pivot.
12355
- */
12356
- fetchTargetStatus(request: {
12357
- projectPath: string;
12358
- branch: string; /** URL-derived repository-relative target path. */
12359
- path: string;
12360
- kind: 'doc' | 'folder'; /** Present only for v2 so rename destinations can be content-relative. */
12361
- contentRootDepth?: number;
12362
- }): Promise<ShareTargetStatusResponse | null>;
12363
- /**
12364
- * Gate dialog dismissal on the `branch-switched` broadcast landing
12365
- * in the project window.
12366
- */
12367
- awaitBranchSwitched(request: {
12368
- projectPath: string;
12369
- branch: string;
12370
- timeoutMs: number;
12371
- }): Promise<{
12372
- ok: true;
12373
- } | {
12374
- ok: false;
12375
- reason: 'timeout' | 'project-not-open';
12376
- }>; /** Run the share-receive scaffold inside a CLI-managed worktree. */
12377
- okInit(request: {
12378
- projectPath: string;
12379
- }): Promise<LocalOpOkInitResponse>;
12380
- close(): Promise<void>;
12381
- };
12382
- /**
12383
- * Worktree selector (worktree = window). `list` enumerates the
12384
- * sender window's project's local branches + their worktrees; `create`
12385
- * creates (or locates) the worktree for a branch under
12386
- * `<mainRoot>/.ok/worktrees/`; `checkout` is the share-receive arm
12387
- * (resolves where the branch lives — fetching from `origin` when
12388
- * needed — then create-or-locates). Opening a worktree window reuses
12389
- * `project.open({ entryPoint: 'worktree' })`.
12390
- */
12391
- worktree: {
12392
- list(): Promise<WorktreeListResult>;
12393
- create(request: WorktreeCreateRequest): Promise<WorktreeCreateResult>;
12394
- checkout(request: {
12395
- branch: string;
12396
- }): Promise<WorktreeCreateResult>;
12397
- };
12398
- /**
12399
- * OK config sharing mode — per-project sharing-mode posture.
12400
- */
12401
- sharing: {
12402
- status(): Promise<OkSharingStatusResult>;
12403
- setMode(mode: 'shared' | 'local-only'): Promise<OkSharingSetModeResult>; /** Toggle `.ok/skills/` shareability within local-only mode. */
12404
- setSkillsShared(shared: boolean): Promise<OkSharingSetModeResult>;
12405
- };
12406
- /**
12407
- * Slides (Slidev) — `status` detects a runnable `slidev`; `open` starts (or
12408
- * reuses) a server for the deck and resolves once it is confirmed serving.
12409
- * Canonical JSDoc in `packages/desktop/src/shared/ipc-channels.ts`.
12410
- * Mirrored here per the OkDesktopBridge 3-way-mirror invariant.
12411
- */
12412
- slides: {
12413
- status(): Promise<OkSlidesStatusResult>;
12414
- open(docPath: string): Promise<OkSlidesOpenResult>;
12415
- };
12416
- /**
12417
- * In-app "Report a bug" — `create` builds the redacted diagnostic zip
12418
- * (optional crash-dump opt-in via `includeCrashDump`, optional app
12419
- * screenshot via `includeScreenshot`); `captureScreenshot` grabs the app
12420
- * before the dialog paints; `send` uploads it with an email fallback;
12421
- * `onCrashDetected` / `crashAck` carry the crash-invite round-trip.
12422
- */
12423
- bugReport: {
12424
- create(request: {
12425
- level: ReportBundleLevel$1;
12426
- note?: string;
12427
- includeCrashDump?: boolean;
12428
- includeScreenshot?: boolean;
12429
- }): Promise<OkBugReportCreateResult>;
12430
- captureScreenshot(): Promise<OkBugReportScreenshot | null>;
12431
- /**
12432
- * Whether main is holding a crash dump this report could carry. Only a
12433
- * report the user opened themselves needs to ask — a crash invitation
12434
- * already carries the answer on its event.
12435
- */
12436
- crashDumpAvailability(): Promise<OkBugReportCrashDumpAvailability>;
12437
- send(request: OkBugReportSendInput): Promise<OkBugReportSendResult>;
12438
- crashAck(request: {
12439
- eventId: string;
12440
- }): Promise<OkBugReportCrashAckResult>;
12441
- list(): Promise<OkBugReportListResult>;
12442
- delete(id: string): Promise<OkBugReportDeleteResult>;
12443
- onCrashDetected(cb: (event: OkBugReportCrashDetectedEvent) => void): OkUnsubscribe;
12444
- };
12445
- /** Filesystem probes that back the Create-new-project dialog cascade. */
12446
- fs: {
12447
- defaultProjectsRoot(): Promise<string>;
12448
- folderState(path: string): Promise<OkFolderState>;
12449
- findEnclosingProjectRoot(path: string): Promise<OkFindEnclosingProjectRootResult | null>;
12450
- findEnclosingGitRoot(path: string): Promise<OkFindEnclosingGitRootResult | null>;
12451
- removeGitFolder(gitRoot: string): Promise<void>;
12452
- };
12453
- /**
12454
- * Re-summon the Project Navigator window from inside an editor window.
12455
- * Backed by main's `openNavigator()` helper — focus-existing-or-create
12456
- * with no toggle semantics. Renderer call sites: `ProjectSwitcher`
12457
- * dropdown's "Switch Project…" item and `CommandPalette`'s "Switch
12458
- * Project" entry. The File menu's "Switch Project…" item invokes
12459
- * `openNavigator()` directly inside main without crossing the bridge.
12460
- */
12461
- navigator: {
12462
- open(): Promise<void>;
12463
- };
12464
- /** Popped-out single-document windows (`--ok-mode=note`). */
12465
- noteWindow: {
12466
- /**
12467
- * Pop `docName` out into its own window, or focus the window already
12468
- * showing it. `no-project` when the calling window has no project context.
12469
- */
12470
- open(docName: string, entryPoint: 'tab-menu' | 'palette'): Promise<{
12471
- ok: true;
12472
- outcome: 'created' | 'focused';
12473
- } | {
12474
- ok: false;
12475
- reason: 'no-project' | 'invalid-request';
12476
- }>;
12477
- /**
12478
- * Focus the owning project window and deliver a conversation/comments
12479
- * action there. Note-window renderers call this instead of opening chrome
12480
- * that deliberately does not exist in their reduced surface.
12481
- */
12482
- dispatchToMain(action: OkNoteWindowMainAction): Promise<OkNoteWindowMainActionResult>; /** Receive a note-window action in the owning project renderer. */
12483
- onMainAction(cb: (action: OkNoteWindowMainAction) => void): OkUnsubscribe;
12484
- };
12485
- /**
12486
- * `ok seed` scaffolder surface consumed by the FileSidebar + menu.
12487
- * `plan()` is read-only and returns what the scaffolder would write;
12488
- * `apply(plan)` performs the writes. Same functions run under the
12489
- * Commander CLI (`ok seed`).
12490
- */
12491
- seed: {
12492
- plan(options?: OkSeedPlanOptions): Promise<OkSeedPlanResult>;
12493
- apply(plan: OkScaffoldPlan, options?: OkSeedApplyOptions): Promise<OkSeedApplyResult>;
12494
- listPacks(): Promise<OkSeedListPacksResult>;
12495
- };
12496
- /**
12497
- * Claude Chat & Cowork skill install-dialog hooks. Drives the 2-click
12498
- * install via Claude.app's `.skill` `CFBundleDocumentType`. Local-build
12499
- * design: `.skill` is produced on demand from the app-bundled SKILL.md;
12500
- * no GitHub Releases dep.
12501
- */
12502
- skill: {
12503
- /** True when Claude Desktop's config dir exists on this machine. */detectClaudeDesktop(): Promise<boolean>;
12504
- /**
12505
- * Build `openknowledge.skill` from the bundled source, save to
12506
- * Downloads, invoke the OS file association (`.skill` → Claude
12507
- * Desktop). Local build; no network.
12508
- *
12509
- * Gated by `~/.ok/skill-state/claude-cowork`: when the recorded
12510
- * version matches the current bundled skill version, resolves with
12511
- * `{ ok: true, skipped: true, version, recordedAt? }` without
12512
- * rebuilding. Pass `force: true` to bypass.
12513
- */
12514
- buildAndOpen(opts?: {
12515
- force?: boolean;
12516
- }): Promise<{
12517
- ok: true;
12518
- path: string;
12519
- skipped?: false;
12520
- version?: string;
12521
- } | {
12522
- ok: true;
12523
- path?: undefined;
12524
- skipped: true;
12525
- version: string;
12526
- recordedAt?: string;
12527
- } | {
12528
- ok: false;
12529
- reason: 'build-failed' | 'open-failed' | 'no-downloads-dir';
12530
- message?: string;
12531
- }>;
12532
- };
12533
- /**
12534
- * Auto-update control surface. Toast A's "Relaunch now" button calls
12535
- * `relaunchNow()` which invokes `autoUpdater.quitAndInstall()` in main.
12536
- */
12537
- update: {
12538
- relaunchNow(): Promise<void>;
12539
- /**
12540
- * Force an out-of-cadence `checkForUpdates()` — fires the
12541
- * `ok:update:check-now` IPC. Surfaced from the application menu's
12542
- * "Check for Updates…" entries (App menu on macOS, Help menu
12543
- * cross-platform). The user-facing result reaches the UI through
12544
- * the existing toast event subscribers, so this resolves once main
12545
- * has fired the request rather than waiting on the network.
12546
- */
12547
- checkNow(): Promise<void>;
12548
- /**
12549
- * Fire `ok:update:whats-new-dismiss` — tells main this window dismissed the
12550
- * what's-new notice so main clears it across all windows. Fire-and-forget.
12551
- */
12552
- dismissWhatsNew(version: string): Promise<void>;
12553
- };
12554
- /**
12555
- * Channel + schema-compatibility state surface. Renderer queries on mount
12556
- * to render the correct BETA badge / About-panel label and route the
12557
- * refuse-downgrade UX when a future-build state was rolled back.
12558
- */
12559
- state: {
12560
- query(): Promise<OkStateSnapshot>;
12561
- resetIncompatible(): Promise<void>;
12562
- };
12563
- /**
12564
- * First-launch MCP consent surface. Renderer mounts `<McpConsentDialog>`
12565
- * when `onShow` fires; calls `confirm` / `skip` on user action; calls
12566
- * `signalReady()` once on app mount so main knows a renderer is
12567
- * subscribed (mount-ack handshake).
12568
- */
12569
- mcpWiring: {
12570
- /** Subscribe to the consent-dialog-show event. Returns unsubscribe. */onShow(cb: (payload: OkMcpWiringShowPayload) => void): OkUnsubscribe; /** Fire a one-way mount-ack event so main's whenRendererReady gate opens. */
12571
- signalReady(): void;
12572
- /** User clicked Add. `editorIds` is the subset the user checked;
12573
- * `pathInstall` is the PATH toggle (tri-state — see
12574
- * `OkMcpWiringConfirmRequest`). */
12575
- confirm(request: OkMcpWiringConfirmRequest): Promise<OkMcpWiringResult>; /** User clicked Skip (or pressed ESC). */
12576
- skip(): Promise<OkMcpWiringResult>;
12577
- /**
12578
- * Re-arm the consent dialog on demand (File → "Set up OpenKnowledge
12579
- * integrations…" and the Cmd+K command). Resolves `true` when armed,
12580
- * `false` when unavailable (non-darwin / unpackaged / arming threw).
12581
- */
12582
- reconfigure(): Promise<boolean>;
12583
- };
12584
- /**
12585
- * App-wide spell-check toggle (Edit → "Check spelling while typing" and the
12586
- * Cmd+K command). `toggle()` flips the flag and resolves to the new enabled
12587
- * state. Bespoke main-side setting; NOT part of the View-menu-state snapshot.
12588
- */
12589
- spellcheck: {
12590
- toggle(): Promise<boolean>;
12591
- };
12592
- /**
12593
- * Settings → AI tools: live per-component install state + one-component
12594
- * install/uninstall for OK's global footprint (per-editor MCP entries,
12595
- * shell-PATH shim, user-global skill bundles). Mutations serialize in main.
12596
- */
12597
- integrations: {
12598
- status(): Promise<OkIntegrationsStatus>;
12599
- setComponent(request: OkIntegrationsSetRequest): Promise<OkIntegrationsSetResult>;
12600
- };
12601
- /**
12602
- * Settings → This project → AI tools: live per-component install state +
12603
- * one-component install/uninstall for OK's PROJECT-LOCAL footprint (per-editor
12604
- * project MCP config files + the project runtime skill) against the project
12605
- * the requesting window has open. Mutations serialize in main.
12606
- */
12607
- projectIntegrations: {
12608
- status(): Promise<OkProjectIntegrationsStatus>;
12609
- setComponent(request: OkProjectIntegrationsSetRequest): Promise<OkProjectIntegrationsSetResult>;
12610
- };
12611
- /**
12612
- * Per-project consent dialog surface. Navigator-only.
12613
- * Renderer mounts a shadcn Dialog when `onShow` fires; calls
12614
- * `confirm` / `cancel` on user action; calls `signalReady()` once on app
12615
- * mount so main's mount-ack gate opens. `onToast` fires on freshly-spawned
12616
- * editor windows for ancestor- and git-root-promote events.
12617
- */
12618
- onboarding: {
12619
- onShow(cb: (payload: OkOnboardingShowPayload) => void): OkUnsubscribe;
12620
- signalReady(): void;
12621
- confirm(request: OkOnboardingConfirmRequest): Promise<OkOnboardingResult>;
12622
- cancel(): Promise<OkOnboardingResult>;
12623
- probeContent(request: OkOnboardingProbeContentRequest): Promise<OkOnboardingProbeContentResult>;
12624
- onToast(cb: (payload: {
12625
- readonly kind: 'ancestor-promote';
12626
- readonly ancestorPath: string;
12627
- } | {
12628
- readonly kind: 'git-root-promote';
12629
- readonly gitRoot: string;
12630
- readonly pickedPath: string;
12631
- } | {
12632
- readonly kind: 'startup-reclaim';
12633
- readonly mcp: {
12634
- readonly status: 'none';
12635
- } | {
12636
- readonly status: 'repaired';
12637
- readonly editors: readonly string[];
12638
- } | {
12639
- readonly status: 'failed';
12640
- readonly editors: readonly string[];
12641
- };
12642
- readonly path: {
12643
- readonly status: 'none';
12644
- } | {
12645
- readonly status: 'installed';
12646
- readonly summary: string;
12647
- } | {
12648
- readonly status: 'failed';
12649
- readonly summary: string;
12650
- };
12651
- } | {
12652
- readonly kind: 'sharing-refused-tracked';
12653
- readonly tracked: readonly string[];
12654
- readonly remediation: string;
12655
- } | {
12656
- readonly kind: 'sharing-no-git';
12657
- readonly requestedMode: 'local-only';
12658
- }) => void): OkUnsubscribe;
12659
- };
12660
- /**
12661
- * Pre-project local-op flows. Required by the Project Navigator window
12662
- * (no backing API server). Editor windows use the HTTP path; this
12663
- * surface is unused there.
12664
- */
12665
- localOp: {
12666
- auth: {
12667
- start(): OkLocalOpStream<OkLocalOpAuthEvent>;
12668
- };
12669
- clone: {
12670
- start(request: {
12671
- url: string;
12672
- dir: string;
12673
- branch?: string | null;
12674
- }): OkLocalOpStream<OkLocalOpCloneEvent>;
12675
- };
12676
- authStatus(request?: {
12677
- host?: string;
12678
- }): Promise<OkLocalOpAuthStatusResponse>;
12679
- authRepos(request?: {
12680
- host?: string;
12681
- }): Promise<OkLocalOpAuthReposResponse>;
12682
- };
12683
- /**
12684
- * Share-receive flow surface. `validateLocalFolder` runs the
12685
- * Q2 "I have it locally" folder validator in the main process via
12686
- * `validateLocalFolderForShare` from the CLI package.
12687
- */
12688
- share: {
12689
- validateLocalFolder(args: {
12690
- folderPath: string;
12691
- host: string;
12692
- owner: string;
12693
- repo: string;
12694
- }): Promise<ShareFolderValidationResult$1>;
12695
- };
12696
- /**
12697
- * Editor area state push surface. Renderer fires
12698
- * `notifyActiveTargetChanged` once per `activeTarget` transition in
12699
- * `useDocumentContext()`.
12700
- */
12701
- editor: {
12702
- notifyActiveTargetChanged(target: OkEditorActiveTargetSnapshot): void; /** Fire-and-forget push of the sidebar's view-menu state. */
12703
- notifyViewMenuStateChanged(state: Partial<OkEditorViewMenuStateSnapshot>): void;
12704
- /**
12705
- * Fire-and-forget push keying the window's Chromium background-throttling
12706
- * to its unsynced work.
12707
- */
12708
- notifyBackgroundThrottle(signal: {
12709
- hasPendingWork: boolean;
12710
- enabled: boolean;
12711
- }): void;
12712
- };
12713
- /**
12714
- * Windows/Linux renderer-menubar dispatch surface (windows-linux-port
12715
- * renderer-menubar decision). macOS keeps the native menu bar and never calls this; on
12716
- * win/linux the renderer-drawn menu bar routes every click through main
12717
- * so menu semantics live in one place. `query` resolves the aggregated
12718
- * `OkMenuRendererSnapshot`; every other kind performs the action
12719
- * main-side and resolves undefined.
12720
- */
12721
- menu: {
12722
- dispatch(request: OkMenuDispatchRequest): Promise<OkMenuRendererSnapshot | undefined>;
12723
- };
12724
- /**
12725
- * Startup-instrumentation push surface (desktop launch waterfall). The
12726
- * renderer reports its two launch checkpoints — page-list ready and first
12727
- * content — as epoch-ms once both land; main folds them into the
12728
- * `desktop.startup-timeline` log line.
12729
- */
12730
- startup: {
12731
- reportMarks(marks: {
12732
- pageListReadyMs: number;
12733
- firstContentMs: number;
12734
- }): void;
12735
- };
12736
- /**
12737
- * Sidebar tree-state push subscriptions. Main pushes
12738
- * `ok:sidebar:expand-all` / `ok:sidebar:collapse-all` when the user picks
12739
- * View → Expand All / Collapse All.
12740
- */
12741
- sidebar: {
12742
- expandAll(cb: () => void): OkUnsubscribe;
12743
- collapseAll(cb: () => void): OkUnsubscribe;
12744
- };
12745
- /** Docked terminal panel surface (bottom or right). */
12746
- terminal: {
12747
- create(opts: {
12748
- cols: number;
12749
- rows: number;
12750
- launchCommand?: string;
12751
- }): Promise<OkPtyCreateResult>;
12752
- input(ptyId: string, data: string): void;
12753
- resize(ptyId: string, cols: number, rows: number): void;
12754
- kill(ptyId: string): Promise<void>;
12755
- drain(ptyId: string, bytes: number): void; /** Reload-rehydration inventory. */
12756
- list(): Promise<OkPtyListEntry[]>; /** Reload-rehydration adopt. */
12757
- adopt(ptyId: string): Promise<OkPtyAdoptResult>;
12758
- /**
12759
- * Persist per-session tab metadata (custom name + sticky ordinal) in main so
12760
- * it survives a renderer reload — main outlives the reload, so a reloaded dock
12761
- * reads it back via `list`. Fire-and-forget; omit a field to leave it unchanged.
12762
- */
12763
- setMeta(ptyId: string, meta: {
12764
- customLabel?: string | null;
12765
- ordinal?: number;
12766
- }): void;
12767
- /**
12768
- * Persist the tab display order in main (ptyIds in visual order) so a reorder
12769
- * survives a renderer reload. Fire-and-forget.
12770
- */
12771
- setOrder(orderedPtyIds: readonly string[]): void; /** Per-window state for the independent terminal and agents panels. */
12772
- getDockState(): Promise<OkTerminalDockState>; /** Persist one panel's session state per window and report durable-write failures. */
12773
- setDockState(state: OkTerminalDockStateUpdate): Promise<OkTerminalDockStateWriteResult>;
12774
- onData(cb: (msg: OkPtyData) => void): OkUnsubscribe;
12775
- onExit(cb: (msg: OkPtyExit) => void): OkUnsubscribe;
12776
- claudePreflight(): Promise<ClaudeReadiness>;
12777
- cliPreflight(cli: TerminalCli): Promise<CliReadiness>;
12778
- /**
12779
- * Batched on-PATH readiness. An absent key means the probe could not verify
12780
- * that CLI either way (NOT absence) — consumers must fail open on
12781
- * `undefined` and reserve gating-off for the positive `false`.
12782
- */
12783
- cliInstalledMap(): Promise<Partial<Record<TerminalCli, boolean>>>;
12784
- rewireClaudeMcp(): Promise<ClaudeReadiness>;
12785
- };
12786
- /**
12787
- * OS assistive-tech signal gating xterm's `screenReaderMode`. Optional in
12788
- * the renderer contract: session-only
12789
- * bridges omit it, and consumers treat an absent surface as
12790
- * screen-reader-active (fail-accessible).
12791
- */
12792
- accessibility?: {
12793
- isScreenReaderActive(): boolean;
12794
- onScreenReaderChanged(cb: (active: boolean) => void): OkUnsubscribe;
12795
- };
12796
- /** Current platform — `process.platform` reported by preload. */
12797
- readonly platform: 'darwin' | 'win32' | 'linux';
12798
- /** Electron app version (from main's `app.getVersion()`). */
12799
- readonly appVersion: string;
12800
- /**
12801
- * Named parallel dev-instance label (branch/worktree) when this launch
12802
- * relocated `userData` to a named sibling — auto-derived from the git
12803
- * checkout or an explicit `OK_INSTANCE`. Null for the default install and in
12804
- * web / CLI distribution. Drives the header branch badge.
12805
- */
12806
- readonly instanceLabel: string | null;
12807
- /**
12808
- * Resolve a dropped `File` to its absolute filesystem path via Electron
12809
- * `webUtils.getPathForFile` (renderer-side, no IPC). Returns null for a File
12810
- * with no backing path on disk (e.g. an in-memory clipboard blob). The
12811
- * docked terminal uses this to insert a dropped file's path at the prompt.
12812
- */
12813
- getPathForFile(file: File): string | null;
12814
- /**
12815
- * Debug-only namespace — populated by preload ONLY when the
12816
- * `OK_DEBUG_KEYRING_SMOKE=1` env var is set OR the app is unpacked (dev
12817
- * mode). Absent in normal production runs.
12818
- */
12819
- debug?: {
12820
- keyringSmoke(): Promise<OkKeyringSmokeResult>;
12821
- };
12822
- }
12823
- declare global {
12824
- interface Window {
12825
- /** Populated by the desktop preload script. Absent in web / CLI distribution. */
12826
- okDesktop?: OkDesktopBridge;
12827
- }
12828
- } //# sourceMappingURL=desktop-bridge.d.ts.map
12829
- //#endregion
12830
10232
  //#region src/commands/editors.d.ts
12831
10233
  type EditorId = EditorId$1;
12832
10234
  declare const ALL_EDITOR_IDS: readonly EditorId[];