braian 0.0.4 → 0.0.5

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 (353) hide show
  1. package/README.md +31 -7
  2. package/bin/braian.mjs +337 -60
  3. package/bin/launch-target.mjs +15 -27
  4. package/bin/run-state.mjs +203 -0
  5. package/dist/app.module.js +2 -0
  6. package/dist/bootstrap.js +4 -1
  7. package/dist/http/api-controllers.js +6 -0
  8. package/dist/http/vault-http-error.js +4 -1
  9. package/dist/http/web-app-fallback.js +37 -0
  10. package/dist/logging/logging.middleware.js +3 -1
  11. package/dist/main.js +3 -0
  12. package/dist/mcp/mcp-path.js +12 -0
  13. package/dist/mcp/mcp-settings.controller.js +78 -0
  14. package/dist/mcp/mcp.controller.js +147 -0
  15. package/dist/mcp/mcp.dto.js +53 -0
  16. package/dist/mcp/mcp.module.js +20 -0
  17. package/dist/mcp/mcp.service.js +117 -0
  18. package/dist/providers/model-provider.service.js +3 -3
  19. package/dist/rss/rss-profiles.controller.js +167 -0
  20. package/dist/rss/rss-profiles.dto.js +511 -0
  21. package/dist/rss/rss-profiles.service.js +149 -0
  22. package/dist/rss/rss.module.js +5 -2
  23. package/dist/search/search.controller.js +1 -1
  24. package/dist/vaults/vault.controller.js +41 -0
  25. package/dist/vaults/vault.dto.js +80 -6
  26. package/dist/vaults/vaults.module.js +2 -1
  27. package/dist/vaults/vaults.service.js +30 -2
  28. package/dist/workspace/workspace-config.js +3 -3
  29. package/node_modules/@braian/ai-providers/dist/index.js +4 -1
  30. package/node_modules/@braian/ai-providers/dist/jev-routing.js +41 -13
  31. package/node_modules/@braian/graph-agent/dist/agent-profiles/tool-catalog.js +4 -4
  32. package/node_modules/@braian/graph-agent/dist/data-workspace.js +44 -0
  33. package/node_modules/@braian/graph-agent/dist/demo-vaults.js +348 -0
  34. package/node_modules/@braian/graph-agent/dist/feature-switch.js +1 -1
  35. package/node_modules/@braian/graph-agent/dist/graph-agent.js +40 -7
  36. package/node_modules/@braian/graph-agent/dist/index.js +24 -2
  37. package/node_modules/@braian/graph-agent/dist/mcp-tokens.js +62 -0
  38. package/node_modules/@braian/graph-agent/dist/rss/index.js +43 -1
  39. package/node_modules/@braian/graph-agent/dist/rss/rss-profile-model.js +378 -0
  40. package/node_modules/@braian/graph-agent/dist/rss/rss-profile-store.js +170 -0
  41. package/node_modules/@braian/graph-agent/dist/rss/rss-profile-test.js +120 -0
  42. package/node_modules/@braian/graph-agent/dist/rss/rss-profile-use-cases.js +74 -0
  43. package/node_modules/@braian/graph-agent/dist/vault-changes.js +3 -0
  44. package/node_modules/@braian/graph-agent/dist/vault-settings-operations.js +3 -1
  45. package/node_modules/@braian/graph-agent/dist/vault-settings-registry.js +1 -1
  46. package/node_modules/@braian/voice-transcription/dist/transcribe.js +1 -1
  47. package/package.json +3 -1
  48. package/public/assets/{agent-profiles-settings-I5Ux2GnH.js → agent-profiles-settings-yElCnMJo.js} +1 -1
  49. package/public/assets/{appearance-settings-module-CD3bJpfR.js → appearance-settings-module-BFDKE-mZ.js} +1 -1
  50. package/public/assets/{ar-SA-G6X2FPQ2-BPq1dwIU.js → ar-SA-G6X2FPQ2-R9ND2Rw0.js} +1 -1
  51. package/public/assets/{attachment-embed-BkP-B_Pa.js → attachment-embed-BX0XSPNZ.js} +1 -1
  52. package/public/assets/{attachments-settings-BeAekkzf.js → attachments-settings-CSEjOoFg.js} +1 -1
  53. package/public/assets/{az-AZ-76LH7QW2-nXEHcVXP.js → az-AZ-76LH7QW2-DpGlptKS.js} +1 -1
  54. package/public/assets/{bg-BG-XCXSNQG7-CpTkmSSX.js → bg-BG-XCXSNQG7-WKBfRf7q.js} +1 -1
  55. package/public/assets/{bn-BD-2XOGV67Q-BDMEyCuA.js → bn-BD-2XOGV67Q-BmT7jnvl.js} +1 -1
  56. package/public/assets/board-workspace-CmetKvXF.js +1 -0
  57. package/public/assets/{boards-settings-module-CCN_ZNks.js → boards-settings-module-Bh5dh9jG.js} +1 -1
  58. package/public/assets/{boards-view-B1B8wHHn.js → boards-view-3JR36W_w.js} +1 -1
  59. package/public/assets/{ca-ES-6MX7JW3Y-D0UEot-K.js → ca-ES-6MX7JW3Y-CBR9ytrG.js} +1 -1
  60. package/public/assets/{calendar-view-BlTCcAzD.js → calendar-view-Cr1VSpj0.js} +1 -1
  61. package/public/assets/calendar-workspace-B-2Himdy.js +1 -0
  62. package/public/assets/{calendars-settings-module-ActBZM9v.js → calendars-settings-module-BWI1k_YA.js} +1 -1
  63. package/public/assets/{card-fields-nzhTsBAW.js → card-fields-eo7dqj1P.js} +1 -1
  64. package/public/assets/{chat-composer-editor-CRtsZz3W.js → chat-composer-editor-DCmWVP16.js} +1 -1
  65. package/public/assets/chat-message-list-DPXjDBw1.js +1 -0
  66. package/public/assets/{chunk-EIO257PC-CGqfS2j0.js → chunk-EIO257PC-Bfdsn_q8.js} +1 -1
  67. package/public/assets/{code-editor-DnrGU9QQ.js → code-editor-CxLqzVwa.js} +1 -1
  68. package/public/assets/color-picker-DK8V_DI0.js +1 -0
  69. package/public/assets/{contents-view-C6RdJxE2.js → contents-view-DHRWEBwV.js} +1 -1
  70. package/public/assets/{conversation-debug-panel-DIjQShXO.js → conversation-debug-panel-zsrBEMxW.js} +1 -1
  71. package/public/assets/create-note-popup-C9IB_IZr.js +1 -0
  72. package/public/assets/{cs-CZ-2BRQDIVT-DvEBYfBD.js → cs-CZ-2BRQDIVT-fiabtlu1.js} +1 -1
  73. package/public/assets/{cypher-editor-Cdd9vqJj.js → cypher-editor-ef6RdDgm.js} +1 -1
  74. package/public/assets/{da-DK-5WZEPLOC-nBVf9B0e.js → da-DK-5WZEPLOC-C-5tRCvs.js} +1 -1
  75. package/public/assets/{daily-notes-settings-DG9RUcYk.js → daily-notes-settings-CCotd1Iq.js} +1 -1
  76. package/public/assets/{dashboard-grid-BvlcalWZ.js → dashboard-grid-DKMK4z_a.js} +1 -1
  77. package/public/assets/dashboard-workspace-4u-QaXby.js +4 -0
  78. package/public/assets/{dashboards-settings-module-CMkRnuLc.js → dashboards-settings-module-DmE0Krje.js} +1 -1
  79. package/public/assets/{dashboards-view-BB1CRB2G.js → dashboards-view-DxUAl6zg.js} +1 -1
  80. package/public/assets/{de-DE-XR44H4JA-wIoI5uHM.js → de-DE-XR44H4JA-4wneKMQi.js} +1 -1
  81. package/public/assets/{desktop-server-settings-j8RrUDQh.js → desktop-server-settings-DDd8PcxW.js} +1 -1
  82. package/public/assets/{directory-picker-columns-BDdL8yxc.js → directory-picker-columns-CqPZNMT8.js} +1 -1
  83. package/public/assets/{discovery-create-popup-DpDB1MTg.js → discovery-create-popup-BSOSYM4o.js} +1 -1
  84. package/public/assets/{discovery-import-popup-BsyONSTT.js → discovery-import-popup-NodFxSW1.js} +1 -1
  85. package/public/assets/{discovery-settings-module-CSz3wdqd.js → discovery-settings-module-DQMZismj.js} +1 -1
  86. package/public/assets/{discovery-view-DOb6HJff.js → discovery-view-PiwStXSa.js} +1 -1
  87. package/public/assets/discovery-workspace-BTrjBF19.js +2 -0
  88. package/public/assets/{dist-tLZONR8L.js → dist-B58c6eJE.js} +1 -1
  89. package/public/assets/drag-preview-D61OK7zr.js +1 -0
  90. package/public/assets/{drawing-note-BZkhWRBb.js → drawing-note-BytzAih9.js} +1 -1
  91. package/public/assets/{el-GR-BZB4AONW-BoxDB0UD.js → el-GR-BZB4AONW-BUDxOK9m.js} +1 -1
  92. package/public/assets/{en-B4ZKOASM-D3_h4H29.js → en-B4ZKOASM-jB7I34Md.js} +1 -1
  93. package/public/assets/{es-ES-U4NZUMDT-BTF8-J9f.js → es-ES-U4NZUMDT-gXLOOlpz.js} +1 -1
  94. package/public/assets/{esm-zhVSGSwY.js → esm-BSlSeh8A.js} +1 -1
  95. package/public/assets/{eu-ES-A7QVB2H4-PqSQa04Y.js → eu-ES-A7QVB2H4-4kiV_opo.js} +1 -1
  96. package/public/assets/{fa-IR-HGAKTJCU-B03HX6BC.js → fa-IR-HGAKTJCU-C7F0Dl4h.js} +1 -1
  97. package/public/assets/{feature-switch-section-CDTUV6B-.js → feature-switch-section-617S6UWP.js} +1 -1
  98. package/public/assets/{fi-FI-Z5N7JZ37-D5Rn9AGc.js → fi-FI-Z5N7JZ37-DEUSwc4a.js} +1 -1
  99. package/public/assets/{file-editor-DTm2a8_D.js → file-editor-DvP7rRI9.js} +3 -3
  100. package/public/assets/{file-language-C8bPT8Wh.js → file-language-DjeubQk3.js} +1 -1
  101. package/public/assets/{file-preview-Bp9k2YvK.js → file-preview-AkYowAab.js} +1 -1
  102. package/public/assets/{file-preview-media-CNZHdx05.js → file-preview-media-DL2hGeeZ.js} +1 -1
  103. package/public/assets/{file-references-api-CSyFnFFm.js → file-references-api-C2G0bSy9.js} +1 -1
  104. package/public/assets/{files-settings-module-D4HPlkbW.js → files-settings-module-DsylYhrR.js} +1 -1
  105. package/public/assets/files-view-B6_Mlm9V.css +1 -0
  106. package/public/assets/files-view-DPSrj_WW.js +3 -0
  107. package/public/assets/{folder-picker-dialog-D57Q15N4.js → folder-picker-dialog-D_VCqm_i.js} +1 -1
  108. package/public/assets/{format-panel-value-DYwL3ttM.js → format-panel-value-vueBm4DQ.js} +1 -1
  109. package/public/assets/{fr-FR-RHASNOE6-BoIuGpVa.js → fr-FR-RHASNOE6-BKLo10bn.js} +1 -1
  110. package/public/assets/{gl-ES-HMX3MZ6V-R9gfMkm_.js → gl-ES-HMX3MZ6V-D_nHnidC.js} +1 -1
  111. package/public/assets/{graph-explorer-DtYVExeD.js → graph-explorer-CHz-bFkx.js} +5 -5
  112. package/public/assets/{graph-settings-module-D--vzqKr.js → graph-settings-module-9hY9bkdT.js} +1 -1
  113. package/public/assets/{he-IL-6SHJWFNN-DLh6r8yJ.js → he-IL-6SHJWFNN-BXKK7JWx.js} +1 -1
  114. package/public/assets/{hi-IN-IWLTKZ5I-DsP1yUVR.js → hi-IN-IWLTKZ5I-D2utCBQM.js} +1 -1
  115. package/public/assets/{hu-HU-A5ZG7DT2-ttWV7_mJ.js → hu-HU-A5ZG7DT2-BENIngFF.js} +1 -1
  116. package/public/assets/{id-ID-SAP4L64H-DIFD1Rmb.js → id-ID-SAP4L64H-Bw77jJOj.js} +1 -1
  117. package/public/assets/{ide-settings-module-Dsg4tJV6.js → ide-settings-module-BbIX3okW.js} +1 -1
  118. package/public/assets/ide-view-0vK2duKI.js +2 -0
  119. package/public/assets/{image-GAAHSSAO-C38PUNrv.js → image-GAAHSSAO-D4NDL8F6.js} +1 -1
  120. package/public/assets/{imap-accounts-QVDGlYad.js → imap-accounts-BRbnITJv.js} +1 -1
  121. package/public/assets/index-BVDhmwI8.js +11 -0
  122. package/public/assets/index-DjUUY3gd.css +1 -0
  123. package/public/assets/{it-IT-JPQ66NNP-D9CIdJgS.js → it-IT-JPQ66NNP-DiG4G8vQ.js} +1 -1
  124. package/public/assets/{ja-JP-DBVTYXUO-CYn7dH3E.js → ja-JP-DBVTYXUO-CILN9NGs.js} +1 -1
  125. package/public/assets/{journal-create-popup-DnYgWgDU.js → journal-create-popup-39y9ieVG.js} +1 -1
  126. package/public/assets/{journal-day-route-DpsYGWU7.js → journal-day-route-CYlyL-u0.js} +1 -1
  127. package/public/assets/{journal-folder-field-DuvIgT6Y.js → journal-folder-field-BfO-_ied.js} +1 -1
  128. package/public/assets/{journal-page-BdQlNdyB.js → journal-page-TgyVFaPE.js} +2 -2
  129. package/public/assets/{journal-settings-Dq-9Conv.js → journal-settings-CfjXOXzF.js} +1 -1
  130. package/public/assets/{journal-typography-QR4z5v0X.js → journal-typography-D3O3AK2U.js} +1 -1
  131. package/public/assets/journal-writing-route-CYhXzipC.js +1 -0
  132. package/public/assets/journals-view-DNomC0nF.js +1 -0
  133. package/public/assets/{kaa-6HZHGXH3-DmZqyxcr.js → kaa-6HZHGXH3-BUua-YiR.js} +1 -1
  134. package/public/assets/{kab-KAB-ZGHBKWFO-BnEoO3f6.js → kab-KAB-ZGHBKWFO-yPJB-J7N.js} +1 -1
  135. package/public/assets/{kk-KZ-P5N5QNE5-DcYcuRxx.js → kk-KZ-P5N5QNE5-CAitSjw5.js} +1 -1
  136. package/public/assets/{km-KH-HSX4SM5Z-DO6DHT6h.js → km-KH-HSX4SM5Z-CSZjabru.js} +1 -1
  137. package/public/assets/{ko-KR-MTYHY66A-Ch6OwlXE.js → ko-KR-MTYHY66A-CGEXYXZz.js} +1 -1
  138. package/public/assets/{ku-TR-6OUDTVRD-C9KHFYbx.js → ku-TR-6OUDTVRD-DOfuZRKI.js} +1 -1
  139. package/public/assets/{link-file-browser-BvVwFMvC.js → link-file-browser-A_Mappx0.js} +1 -1
  140. package/public/assets/{link-kind-icon-r9mUfWOh.js → link-kind-icon-BMfHfR_C.js} +1 -1
  141. package/public/assets/{link-picker-C90irWTA.js → link-picker-BfwWXJZg.js} +2 -2
  142. package/public/assets/{locked-shares-prompt-CA0MuZ_G.js → locked-shares-prompt-BsM-ai_V.js} +1 -1
  143. package/public/assets/{logging-settings-contribution-C55dtngt.js → logging-settings-contribution-BLHCBnwO.js} +1 -1
  144. package/public/assets/logic-DtHJ5GlU.js +28 -0
  145. package/public/assets/{lt-LT-XHIRWOB4-CrK3hZ26.js → lt-LT-XHIRWOB4-CmbJTJAh.js} +1 -1
  146. package/public/assets/{lv-LV-5QDEKY6T-BOA9oRt-.js → lv-LV-5QDEKY6T-Br-VqxTs.js} +1 -1
  147. package/public/assets/{markdown-message-9f2rcF0-.js → markdown-message-BIo2pHhE.js} +2 -2
  148. package/public/assets/{markdown-task-toggle-DiIwYCgC.js → markdown-task-toggle-9k1EldDD.js} +3 -3
  149. package/public/assets/{matrices-settings-module-DPI1_WsY.js → matrices-settings-module-DKGdrCad.js} +1 -1
  150. package/public/assets/{matrices-view-CQlirOdv.js → matrices-view-DYF7e5ES.js} +1 -1
  151. package/public/assets/matrix-workspace-JZhH-HQ5.js +1 -0
  152. package/public/assets/{maximize-2-C6N1RKlt.js → maximize-2-DATMN9kx.js} +1 -1
  153. package/public/assets/{mermaid-diagram-CnzQOrTI.js → mermaid-diagram-gUL2-JyE.js} +1 -1
  154. package/public/assets/{mobile-file-text-B4j-_eP4.js → mobile-file-text-meniSeto.js} +1 -1
  155. package/public/assets/{mobile-note-content-editor-znLhIM9A.js → mobile-note-content-editor-C6TUyA4F.js} +2 -2
  156. package/public/assets/{mobile-panel-layer-C2OowtdM.js → mobile-panel-layer-2EcEm-JB.js} +1 -1
  157. package/public/assets/model-provider-settings-contribution-CfHiu3nS.js +1 -0
  158. package/public/assets/model-providers-cQOCMmwX.js +1 -0
  159. package/public/assets/{mr-IN-CRQNXWMA-GWTqYMNI.js → mr-IN-CRQNXWMA-DwF8SFQB.js} +1 -1
  160. package/public/assets/{my-MM-5M5IBNSE-DnqvLQeM.js → my-MM-5M5IBNSE-BEiMo9eJ.js} +1 -1
  161. package/public/assets/{nb-NO-T6EIAALU-DyrWt8fZ.js → nb-NO-T6EIAALU-BelWzTQs.js} +1 -1
  162. package/public/assets/{nl-NL-IS3SIHDZ-COWPkkr8.js → nl-NL-IS3SIHDZ-Ce06PPL4.js} +1 -1
  163. package/public/assets/{nn-NO-6E72VCQL-8aH2uP9Y.js → nn-NO-6E72VCQL-BbXlzJzR.js} +1 -1
  164. package/public/assets/note-collab-provider-B9DpnE58.js +1 -0
  165. package/public/assets/note-collab-transport-BHZ891IL.js +1 -0
  166. package/public/assets/{note-create-settings-module-CV4dWr8t.js → note-create-settings-module-rIZc1DjQ.js} +1 -1
  167. package/public/assets/{note-documents-DCd2HaSQ.js → note-documents-CcJDTkta.js} +2 -2
  168. package/public/assets/note-editor-container-DL3yLdYs.js +2 -0
  169. package/public/assets/{note-editor-settings-module-CbPu_40k.js → note-editor-settings-module-DI0jRyPy.js} +1 -1
  170. package/public/assets/{note-excalidraw-editor-RjnG4My9.js → note-excalidraw-editor-fDQ1JVBh.js} +11 -11
  171. package/public/assets/{note-export-api-2u0sbOpc.js → note-export-api-CwuXGV0y.js} +1 -1
  172. package/public/assets/{note-export-flow-B3wRdMj0.js → note-export-flow-DcBoI5Pp.js} +1 -1
  173. package/public/assets/{note-filter-rule-rows-BajgD2k3.js → note-filter-rule-rows-DFSWBwql.js} +1 -1
  174. package/public/assets/{note-folds-settings-module-DZju6Mum.js → note-folds-settings-module-CFfVg1Cp.js} +1 -1
  175. package/public/assets/{note-frontmatter-summary-BSKg__aS.js → note-frontmatter-summary-iubFPHA_.js} +1 -1
  176. package/public/assets/{note-link-list-DKU2PqtO.js → note-link-list-CI9-GM_3.js} +1 -1
  177. package/public/assets/{note-markdown-editor-CXelEHqr.js → note-markdown-editor-lG6gZT9i.js} +10 -10
  178. package/public/assets/{note-outline-CNoqBtUP.js → note-outline-BFidIp-8.js} +1 -1
  179. package/public/assets/note-page-content-8gzPBWMV.js +2 -0
  180. package/public/assets/{note-page-editor-rhBoxKYB.js → note-page-editor-DpVUxkCx.js} +4 -4
  181. package/public/assets/{note-path-breadcrumb-uTSXCQK4.js → note-path-breadcrumb-HmtWyYZP.js} +1 -1
  182. package/public/assets/{note-picker-BD8rmAOq.js → note-picker-B5i41l1u.js} +1 -1
  183. package/public/assets/{note-picker-popover-DI9Wc706.js → note-picker-popover-B9VTeHiM.js} +1 -1
  184. package/public/assets/{note-shares-popup-9sJOmL1-.js → note-shares-popup-aUO1SNLN.js} +1 -1
  185. package/public/assets/{note-source-editor-DWyDYMCj.js → note-source-editor-BXPR_-41.js} +1 -1
  186. package/public/assets/{note-type-grid-BFX3oTAC.js → note-type-grid-CRCfpYZy.js} +2 -2
  187. package/public/assets/{note-values-BqD4746M.js → note-values-6D6wWXPg.js} +1 -1
  188. package/public/assets/{notes-settings-module-C5IPmwKt.js → notes-settings-module-DcP9Hid-.js} +1 -1
  189. package/public/assets/{oc-FR-POXYY2M6-C_R_VP74.js → oc-FR-POXYY2M6-CyRgkETq.js} +1 -1
  190. package/public/assets/{open-journal-writing-Bd-CppeX.js → open-journal-writing-Bub8Zn13.js} +1 -1
  191. package/public/assets/{pa-IN-N4M65BXN-B21EEaul.js → pa-IN-N4M65BXN-A1_Q9748.js} +1 -1
  192. package/public/assets/page-content-B3fNjwr-.js +1 -0
  193. package/public/assets/{page-files-BMj9IzfB.js → page-files-CSqFupDZ.js} +1 -1
  194. package/public/assets/page-note-nmiinGCs.js +1 -0
  195. package/public/assets/{pane-keys-CTLoUZZR.js → pane-keys-osajBGnu.js} +1 -1
  196. package/public/assets/{panel-columns-fields-DPjV39xn.js → panel-columns-fields-ZlW6A4My.js} +1 -1
  197. package/public/assets/{pdf-view-Cm78nuSA.js → pdf-view-BATpBLO5.js} +1 -1
  198. package/public/assets/{pencil-DQ9fAqT6.js → pencil-xxFNyZzr.js} +1 -1
  199. package/public/assets/{percentages-BXMCSKIN-CUt8fyAS.js → percentages-BXMCSKIN-DzsiA6IB.js} +1 -1
  200. package/public/assets/{phone-numbers-CHQaYRah.js → phone-numbers-BQgyhfcH.js} +1 -1
  201. package/public/assets/{pl-PL-T2D74RX3-Bdo_j9QK.js → pl-PL-T2D74RX3-DaINIVjz.js} +1 -1
  202. package/public/assets/provider-configuration-CSnNV6ps.css +1 -0
  203. package/public/assets/provider-configuration-DaFovElx.js +8 -0
  204. package/public/assets/provider-use-select-D-lJiZ2W.js +1 -0
  205. package/public/assets/{pt-BR-5N22H2LF-C9DRQ7CW.js → pt-BR-5N22H2LF-ENVHjTz_.js} +1 -1
  206. package/public/assets/{pt-PT-UZXXM6DQ-ColydZPV.js → pt-PT-UZXXM6DQ-D5Uqv0Vz.js} +1 -1
  207. package/public/assets/{qr-code-Bm7I0KYt.js → qr-code-CDBCi1Cu.js} +2 -2
  208. package/public/assets/{qr-code-svg-D0RAuUIk.js → qr-code-svg-8ENstC8b.js} +1 -1
  209. package/public/assets/qr-defaults-settings-C_8ybA4R.js +1 -0
  210. package/public/assets/qr-settings-fields-C2-DGF6a.js +1 -0
  211. package/public/assets/qr-viewer-DAOzDI8d.js +1 -0
  212. package/public/assets/{reader-clock-22DkpiWR.js → reader-clock-7x7Yvzv1.js} +1 -1
  213. package/public/assets/{recording-bar-DOm-SEGc.js → recording-bar-BcuvYwhh.js} +2 -2
  214. package/public/assets/{recording-setup-CV3LE2_1.js → recording-setup-D_MgrYb7.js} +1 -1
  215. package/public/assets/{recordings-api-C-Bxpzgo.js → recordings-api-Ds77lFsk.js} +1 -1
  216. package/public/assets/resource-overview-card-BainFWKz.js +1 -0
  217. package/public/assets/{ro-RO-JPDTUUEW-iJAQDPe9.js → ro-RO-JPDTUUEW-Dq_ouOp1.js} +1 -1
  218. package/public/assets/{rss-preferences-Bx1Wa4ri.js → rss-preferences-BafuZ3Ku.js} +1 -1
  219. package/public/assets/{rss-settings-module-BmDISWDk.js → rss-settings-module-Df-YS9tr.js} +1 -1
  220. package/public/assets/rss-view-BORHnuIQ.js +3 -0
  221. package/public/assets/rss-view-DIPQBTLT.css +1 -0
  222. package/public/assets/{ru-RU-B4JR7IUQ-CX_CWbT7.js → ru-RU-B4JR7IUQ-CqqISqJC.js} +1 -1
  223. package/public/assets/{safe-block-copy-DygjvDD4.js → safe-block-copy-BOVhmncw.js} +1 -1
  224. package/public/assets/{safe-block-qr-button-Cn9WpEkl.js → safe-block-qr-button-CD7cJG3N.js} +1 -1
  225. package/public/assets/{safe-block-reader-CNfzTExh.js → safe-block-reader-BkilW4Hj.js} +1 -1
  226. package/public/assets/safe-folder-conversion-DWTRwvTH.js +1 -0
  227. package/public/assets/{safe-folders-DCf8IdrM.js → safe-folders-DmvM6dtV.js} +1 -1
  228. package/public/assets/{safe-move-leaving-tN-IMhDo.js → safe-move-leaving-BT5e1h3p.js} +1 -1
  229. package/public/assets/{safe-note-locked-B_lt0XcX.js → safe-note-locked-BDCeVwpK.js} +1 -1
  230. package/public/assets/{safe-notes-settings-module-CMvkyfNG.js → safe-notes-settings-module-BrZreYgf.js} +1 -1
  231. package/public/assets/search-settings-module-CPnculiI.js +1 -0
  232. package/public/assets/{secret-form-DSD348Om.js → secret-form-B-YAlbZf.js} +1 -1
  233. package/public/assets/{secret-popup-y9W7WIrZ.js → secret-popup-CoVpeLZV.js} +1 -1
  234. package/public/assets/{security-settings-contribution-B_Syg5ab.js → security-settings-contribution-BmcZq1hf.js} +1 -1
  235. package/public/assets/settings-CU8YR8di.js +1 -0
  236. package/public/assets/{settings-edit-dialog-B5emNjJi.js → settings-edit-dialog-C_AeTz9Y.js} +1 -1
  237. package/public/assets/settings-panel-Ds7lOtnD.js +1 -0
  238. package/public/assets/settings-view-BTz2XbnW.js +4 -0
  239. package/public/assets/{settings-view-6_hMxTXD.css → settings-view-Bd65kLGK.css} +1 -1
  240. package/public/assets/{setup-prompt-6JRbE0oa.js → setup-prompt-BbpHVdla.js} +1 -1
  241. package/public/assets/{share-access-control-C5mpELVT.js → share-access-control-CzAVEv6b.js} +1 -1
  242. package/public/assets/share-label-CbjQ9iMF.js +1 -0
  243. package/public/assets/{shared-board-lanes-UWl9klys.js → shared-board-lanes-CAbJAFk6.js} +1 -1
  244. package/public/assets/{shared-calendar-view-DcCO3mNo.js → shared-calendar-view-DTzDjSs0.js} +1 -1
  245. package/public/assets/shared-note-route-B_gfX0Nl.js +4 -0
  246. package/public/assets/{shared-note-text-BdCw7a9a.js → shared-note-text-DFBEyL8Z.js} +1 -1
  247. package/public/assets/{shares-settings-module-9oF4v70A.js → shares-settings-module-pIdBLmCq.js} +1 -1
  248. package/public/assets/{si-LK-N5RQ5JYF-DfLSaLm6.js → si-LK-N5RQ5JYF-DmhE8IT5.js} +1 -1
  249. package/public/assets/{sk-SK-C5VTKIMK-DrAaUVFC.js → sk-SK-C5VTKIMK-YiOZ-xKA.js} +1 -1
  250. package/public/assets/{sl-SI-NN7IZMDC-WxYLW2Uj.js → sl-SI-NN7IZMDC-BKb37Hlu.js} +1 -1
  251. package/public/assets/{spaces-settings-module-Dh_QfANj.js → spaces-settings-module-BLU1RsTS.js} +1 -1
  252. package/public/assets/spaces-view-BhWD3mAw.js +2 -0
  253. package/public/assets/{sqlite-browser-BfIrq_0x.js → sqlite-browser-C98PFoRG.js} +2 -2
  254. package/public/assets/{store-attachments-DNyH0asy.js → store-attachments-DbqF7LgE.js} +1 -1
  255. package/public/assets/{stored-color-picker-CYL7LYdQ.js → stored-color-picker-DLX-e5Nq.js} +1 -1
  256. package/public/assets/subset-shared.chunk-D8M638AI.js +1 -0
  257. package/public/assets/{subset-worker.chunk-BrbK91mW.js → subset-worker.chunk-B9ZhBm-P.js} +1 -1
  258. package/public/assets/{sv-SE-XGPEYMSR-DOB2jm3x.js → sv-SE-XGPEYMSR-VT0snW-T.js} +1 -1
  259. package/public/assets/{ta-IN-2NMHFXQM-DfC3wGVU.js → ta-IN-2NMHFXQM--MqIf2Jf.js} +1 -1
  260. package/public/assets/{text-diff-BzNG8nfy.js → text-diff-BmKfp7mY.js} +1 -1
  261. package/public/assets/{th-TH-HPSO5L25-BsqplWuv.js → th-TH-HPSO5L25-CTKAmQrO.js} +1 -1
  262. package/public/assets/{theme-colors-2LJ6VIeK.js → theme-colors-zbTaiYL0.js} +1 -1
  263. package/public/assets/{toolbar-items-DF7H0MSb.js → toolbar-items-DLi0bl0c.js} +1 -1
  264. package/public/assets/{topology-code-editor-B7zxDyT3.js → topology-code-editor-CNnSyUQ3.js} +1 -1
  265. package/public/assets/topology-designer-T54LYLYv.js +1 -0
  266. package/public/assets/topology-editor-aGtCktzA.js +8 -0
  267. package/public/assets/{topology-folder-migration-popup-Bj4nu8HE.js → topology-folder-migration-popup-C0Wc3ViK.js} +1 -1
  268. package/public/assets/{topology-settings-module-cWWujj9j.js → topology-settings-module-Dp-Sm37Z.js} +1 -1
  269. package/public/assets/{tr-TR-DEFEU3FU-DWO1lNTH.js → tr-TR-DEFEU3FU-BVLSiyVW.js} +1 -1
  270. package/public/assets/{transcription-settings-HrJHl14H.js → transcription-settings-BldPwHO7.js} +4 -4
  271. package/public/assets/{uk-UA-QMV73CPH-ZHBKj9kv.js → uk-UA-QMV73CPH-DQ4YsZml.js} +1 -1
  272. package/public/assets/{unlock-prompt-C1AEyIR_.js → unlock-prompt-CkkcVo9g.js} +1 -1
  273. package/public/assets/{use-candidate-notes-Du1V_uun.js → use-candidate-notes-jH4-EW29.js} +1 -1
  274. package/public/assets/{use-directory-listing-BaYgcuHI.js → use-directory-listing-Cn9t21ra.js} +1 -1
  275. package/public/assets/{use-folding-enabled-CyYip5Go.js → use-folding-enabled-DKvri2UA.js} +1 -1
  276. package/public/assets/{use-live-document-Ck_XPFVd.js → use-live-document-D4PkZrbU.js} +1 -1
  277. package/public/assets/{use-mobile-layer-navigation-CBRepW9w.js → use-mobile-layer-navigation-BIC7HlT_.js} +1 -1
  278. package/public/assets/{use-note-attachments-SPgAe-M0.js → use-note-attachments-Bew073Hl.js} +1 -1
  279. package/public/assets/{use-note-delete-Dvrzq6Pl.js → use-note-delete-fFNH1Glk.js} +1 -1
  280. package/public/assets/use-note-editor-session-R1wm0xDf.js +1 -0
  281. package/public/assets/{use-note-export-flow-0uAfXAwf.js → use-note-export-flow-Dm7yhW5s.js} +2 -2
  282. package/public/assets/use-provider-dialogs-CrxN9JCo.js +1 -0
  283. package/public/assets/{use-reflection-request-DV5-_c14.js → use-reflection-request-C1DxtaYX.js} +3 -3
  284. package/public/assets/{use-safe-folder-moves-0nw2jjTX.js → use-safe-folder-moves-DjQUnMvz.js} +1 -1
  285. package/public/assets/{use-safe-folders-apply-C9pni8YW.js → use-safe-folders-apply-B1V8l7WU.js} +1 -1
  286. package/public/assets/{use-screen-source-BllYITR6.js → use-screen-source-CF-48NnC.js} +1 -1
  287. package/public/assets/use-share-actions-kb7uFat_.js +1 -0
  288. package/public/assets/{use-vault-file-link-C0ZO_VPm.js → use-vault-file-link-B-ZRcKDu.js} +1 -1
  289. package/public/assets/{use-voice-questions-Bjgb45Dc.js → use-voice-questions-DGVQlAST.js} +1 -1
  290. package/public/assets/{vault-entries-api-DVVjgeZh.js → vault-entries-api-pFsJiGnJ.js} +1 -1
  291. package/public/assets/vault-manager-YKz_Ib18.js +1 -0
  292. package/public/assets/{vault-settings-module-DMjLQmKz.js → vault-settings-module-CCMMSy4B.js} +1 -1
  293. package/public/assets/{vault-shares-popup-CCPGkRmF.js → vault-shares-popup-CaGnEIJA.js} +1 -1
  294. package/public/assets/{versioning-preferences-dvxhrMo9.js → versioning-preferences-DrNq-y_0.js} +1 -1
  295. package/public/assets/{versioning-settings-module-CnDDngKG.js → versioning-settings-module-Ddug486c.js} +1 -1
  296. package/public/assets/versioning-view-PR4R4gks.js +2 -0
  297. package/public/assets/{vi-VN-M7AON7JQ-uUfHJEho.js → vi-VN-M7AON7JQ-B-fHV7o8.js} +1 -1
  298. package/public/assets/video-recording-dialog-CxRs1eLE.js +1 -0
  299. package/public/assets/{video-recording-settings-D6YT_FW3.js → video-recording-settings-B2iE6IdW.js} +1 -1
  300. package/public/assets/{widget-frame-CjlAZSUy.js → widget-frame-DiF4946k.js} +1 -1
  301. package/public/assets/{zh-CN-LNUGB5OW-COz3oRg3.js → zh-CN-LNUGB5OW-CUgxiiUV.js} +1 -1
  302. package/public/assets/{zh-HK-E62DVLB3-C8ICkLhf.js → zh-HK-E62DVLB3-D-87W8QH.js} +1 -1
  303. package/public/assets/{zh-TW-RAJ6MFWO-AYdVqmV8.js → zh-TW-RAJ6MFWO-BVaf47B6.js} +1 -1
  304. package/public/index.html +3 -3
  305. package/public/assets/board-workspace-DPSlmJ8w.js +0 -1
  306. package/public/assets/calendar-workspace-6t1kuFgj.js +0 -1
  307. package/public/assets/chat-message-list-ClUR56GV.js +0 -1
  308. package/public/assets/color-picker-ClAn42eA.js +0 -1
  309. package/public/assets/create-note-popup-CRi210cC.js +0 -1
  310. package/public/assets/dashboard-workspace-D45MA_Wf.js +0 -4
  311. package/public/assets/discovery-workspace-Cyc70gQ1.js +0 -2
  312. package/public/assets/drag-preview-Cb6aidku.js +0 -1
  313. package/public/assets/files-view-BIDZtZgg.js +0 -3
  314. package/public/assets/files-view-Bo1uBB_W.css +0 -1
  315. package/public/assets/ide-view-DCvwb5Bx.js +0 -2
  316. package/public/assets/index-B8xguO4f.css +0 -1
  317. package/public/assets/index-CCUyKE6q.js +0 -11
  318. package/public/assets/journal-writing-route-JP-jPBGZ.js +0 -1
  319. package/public/assets/journals-view-No5xQN8-.js +0 -1
  320. package/public/assets/logic-BNk_20eJ.js +0 -28
  321. package/public/assets/matrix-workspace-C3LhTNPX.js +0 -1
  322. package/public/assets/model-provider-settings-contribution-DYmNbsgA.js +0 -1
  323. package/public/assets/model-providers-7VKk3K9H.js +0 -8
  324. package/public/assets/model-providers-DgRkVmP5.css +0 -1
  325. package/public/assets/note-collab-provider-969Kgyu8.js +0 -1
  326. package/public/assets/note-collab-transport-CQDYt_Db.js +0 -1
  327. package/public/assets/note-editor-container-CTnEE-98.js +0 -2
  328. package/public/assets/note-page-content-DIqkiMvt.js +0 -2
  329. package/public/assets/page-content-C1jtzs7H.js +0 -1
  330. package/public/assets/page-note-Chw2UF0u.js +0 -1
  331. package/public/assets/provider-use-select-DCSwSrlz.js +0 -1
  332. package/public/assets/qr-defaults-settings-2_Yt9x4N.js +0 -1
  333. package/public/assets/qr-settings-fields-DDO4XgMl.js +0 -1
  334. package/public/assets/qr-viewer-CvEfRC2r.js +0 -1
  335. package/public/assets/resource-overview-card-Co8aU6jw.js +0 -1
  336. package/public/assets/rss-view-5aqCVOCs.css +0 -1
  337. package/public/assets/rss-view-BCEFsYtS.js +0 -1
  338. package/public/assets/safe-folder-conversion-BOLpnv8P.js +0 -1
  339. package/public/assets/search-settings-module-DmczYjcQ.js +0 -1
  340. package/public/assets/settings-ChT117Ke.js +0 -1
  341. package/public/assets/settings-panel-Cl5kUs9O.js +0 -1
  342. package/public/assets/settings-view-C_lfjngd.js +0 -3
  343. package/public/assets/share-label-BU3So3s7.js +0 -1
  344. package/public/assets/shared-note-route-DaI6hm83.js +0 -4
  345. package/public/assets/spaces-view-Dw2uxDxU.js +0 -2
  346. package/public/assets/subset-shared.chunk-D1nlqSEH.js +0 -1
  347. package/public/assets/topology-designer-CvJN6QTV.js +0 -1
  348. package/public/assets/topology-editor-RZ0_yLuO.js +0 -8
  349. package/public/assets/use-note-editor-session-CRC-natg.js +0 -1
  350. package/public/assets/use-share-actions-ujEMhCfl.js +0 -1
  351. package/public/assets/vault-manager-CMQaGDss.js +0 -1
  352. package/public/assets/versioning-view-BsIFugt4.js +0 -2
  353. package/public/assets/video-recording-dialog-7IGrQMwx.js +0 -1
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rssJudgeSystemPrompt = exports.rssJudgeOutputSchema = exports.rssJudgeBatchSize = exports.minimumUnseenForScore = exports.rssTestPoolLimits = void 0;
4
+ exports.rssProfileTestPool = rssProfileTestPool;
5
+ exports.scoreRssProfileTest = scoreRssProfileTest;
6
+ exports.rssJudgeBatchMessage = rssJudgeBatchMessage;
7
+ exports.readRssJudgeBatch = readRssJudgeBatch;
8
+ const rss_profile_model_1 = require("./rss-profile-model");
9
+ const rss_tags_1 = require("./rss-tags");
10
+ exports.rssTestPoolLimits = { rated: 60, tagged: 20 };
11
+ /** Fewer unseen rated entries than this say too little to be the score on their own. */
12
+ exports.minimumUnseenForScore = 8;
13
+ /** How much of the score is the like index, when tags are scored too. */
14
+ const likeShare = 0.7;
15
+ /**
16
+ * The entries a test judges: the rated ones (those the profile has not seen first, then the most recently rated), and
17
+ * the tagged but unrated ones, for the tags alone. A profile that does not say what it learned from has seen them all.
18
+ */
19
+ function rssProfileTestPool(entries, profile, limits = exports.rssTestPoolLimits) {
20
+ const training = profile.training;
21
+ const learned = training ? new Set([...(training.rated ?? []).map((line) => line.slice(line.indexOf(' ') + 1)), ...(training.tagged ?? [])]) : undefined;
22
+ const vocabulary = (profile.tags ?? []).map((tag) => tag.tag);
23
+ const articles = entries.flatMap((entry) => {
24
+ const rating = entry.custom?.rating?.value;
25
+ const tags = (0, rss_tags_1.normalizeRssTags)(entry.custom?.tags ?? []).filter((tag) => (0, rss_tags_1.hasRssTag)(vocabulary, tag));
26
+ if (rating !== 'like' && rating !== 'dislike' && !tags.length)
27
+ return [];
28
+ const summary = entry.summary ?? entry.content?.join('\n\n');
29
+ return [{ article: {
30
+ feedId: entry.feedId, entryId: entry.id, feedName: entry.feedName, title: entry.title, ...(summary ? { summary } : {}), ...(entry.categories?.length ? { categories: entry.categories } : {}),
31
+ ...(rating === 'like' || rating === 'dislike' ? { rating } : {}), tags, seen: learned ? learned.has((0, rss_profile_model_1.rssEntryKey)(entry.feedId, entry.id)) : true,
32
+ }, at: entry.custom?.rating?.at ?? entry.custom?.readAt ?? entry.firstSeenAt }];
33
+ }).sort((a, b) => Number(a.article.seen) - Number(b.article.seen) || b.at.localeCompare(a.at)).map(({ article }) => article);
34
+ return [...articles.filter((article) => article.rating).slice(0, limits.rated), ...articles.filter((article) => !article.rating).slice(0, limits.tagged)];
35
+ }
36
+ /** Balanced closeness: the mean probability given to what was true and to what was false, each side weighing the same, so a judge that always says yes scores 0.5. */
37
+ function balanced(pairs) {
38
+ const mean = (values) => values.reduce((total, value) => total + value, 0) / values.length;
39
+ const yes = pairs.filter((pair) => pair.target).map((pair) => pair.probability), no = pairs.filter((pair) => !pair.target).map((pair) => 1 - pair.probability);
40
+ const sides = [yes, no].filter((side) => side.length).map(mean);
41
+ return sides.length ? { score: Math.round(mean(sides) * 1000) / 1000, count: pairs.length } : undefined;
42
+ }
43
+ /** The rows and the score of a test, from the pool and the judge's answers in the same order. */
44
+ function scoreRssProfileTest(profile, articles, judgements, threshold) {
45
+ const clamp = (value) => typeof value === 'number' && Number.isFinite(value) ? Math.min(1, Math.max(0, value)) : 0.5;
46
+ const vocabulary = (profile.tags ?? []).map((tag) => tag.tag);
47
+ // A chat model may spell a tag in another case than the profile does.
48
+ const answers = judgements.map((judgement) => new Map(Object.entries(judgement?.tags ?? {}).map(([tag, probability]) => [tag.toLowerCase(), probability])));
49
+ const tagProbability = (index, tag) => clamp(answers[index]?.get(tag.toLowerCase()) ?? 0);
50
+ const rows = articles.map((article, index) => {
51
+ const judgement = judgements[index], like = Math.round(clamp(judgement?.like) * 1000) / 1000;
52
+ const suggested = vocabulary.map((tag) => ({ tag, probability: Math.round(tagProbability(index, tag) * 1000) / 1000 })).filter((tag) => tag.probability >= threshold).sort((a, b) => b.probability - a.probability);
53
+ return { ...article, like, ...(article.rating ? { error: Math.round(Math.abs((article.rating === 'like' ? 1 : 0) - like) * 1000) / 1000 } : {}), suggested };
54
+ });
55
+ const likePairs = (list) => balanced(list.filter((row) => row.rating).map((row) => ({ target: row.rating === 'like', probability: row.like })));
56
+ const unseen = likePairs(rows.filter((row) => !row.seen)), seen = likePairs(rows.filter((row) => row.seen)), all = likePairs(rows);
57
+ const basis = unseen && unseen.count >= exports.minimumUnseenForScore ? 'unseen' : 'all';
58
+ const like = basis === 'unseen' ? unseen : all;
59
+ // Tags are scored only on entries the reader tagged: an untagged entry says nothing about which tags it should have.
60
+ const tags = balanced(articles.flatMap((article, index) => article.tags.length ? vocabulary.map((tag) => ({ target: (0, rss_tags_1.hasRssTag)(article.tags, tag), probability: tagProbability(index, tag) })) : []));
61
+ const score = like && tags ? likeShare * like.score + (1 - likeShare) * tags.score : (like ?? tags)?.score ?? 0;
62
+ return {
63
+ score: Math.round(score * 1000) / 1000, basis,
64
+ ...(like ? { like: { ...like, ...(unseen ? { unseen } : {}), ...(seen ? { seen } : {}) } } : {}),
65
+ ...(tags ? { tags } : {}),
66
+ // The worst misses first: that is where a profile is read to be improved.
67
+ rows: rows.sort((a, b) => (b.error ?? -1) - (a.error ?? -1)),
68
+ };
69
+ }
70
+ /** How many articles one request to a chat model judges. */
71
+ exports.rssJudgeBatchSize = 8;
72
+ /** The chat model's answer, as a strict JSON schema: one result per article, by its index. */
73
+ exports.rssJudgeOutputSchema = {
74
+ type: 'object', additionalProperties: false, required: ['results'],
75
+ properties: {
76
+ results: {
77
+ type: 'array', description: 'One item per article, in the order given.',
78
+ items: {
79
+ type: 'object', additionalProperties: false, required: ['index', 'like', 'tags'],
80
+ properties: {
81
+ index: { type: 'integer', description: 'The article\'s index as given.' },
82
+ like: { type: 'number', description: '0 to 1: the probability that the reader likes the article.' },
83
+ tags: { type: 'array', description: 'Every tag asked, with its probability.', items: { type: 'object', additionalProperties: false, required: ['tag', 'probability'], properties: { tag: { type: 'string' }, probability: { type: 'number', description: '0 to 1: the probability that the reader files the article under this tag.' } } } },
84
+ },
85
+ },
86
+ },
87
+ },
88
+ };
89
+ exports.rssJudgeSystemPrompt = `You judge news articles for one reader, from a profile of their preferences.
90
+
91
+ You receive one JSON message: "reader" (who they are, what they seek and avoid, the feeds they lean on, the writing they like), "like" (how to decide whether they would like an article), "tags" (each of the reader's tags and what it means to them), and "articles" (each with an index, title, feed, excerpt and categories).
92
+
93
+ For every article answer two things, each as a probability from 0 to 1:
94
+ - like: how likely this reader is to like the article. Use the whole range: 0.9 for a clear match on what they seek, 0.1 for a clear match on what they avoid, 0.5 only when the profile says nothing either way.
95
+ - tags: for every tag listed, how likely the reader files the article under it. Tagging is independent of liking: an article they dislike still takes the tags that describe it.
96
+
97
+ Judge each article on its own, from its title, feed and excerpt alone. Answer with one JSON object {"results": [{"index": 0, "like": 0.0, "tags": [{"tag": "…", "probability": 0.0}]}]} holding one result per article, and nothing else.`;
98
+ /** The one message a chat model gets for a batch: the same reader, questions and articles Jev gets, as JSON. */
99
+ function rssJudgeBatchMessage(profile, articles) {
100
+ const requests = articles.map((article) => (0, rss_profile_model_1.rssProfileJudgeRequest)(profile, article));
101
+ const like = requests[0]?.questions.like;
102
+ return JSON.stringify({
103
+ reader: profile.preferences,
104
+ like: like ? { instructions: like.instructions, yes: like.criteria.true, no: like.criteria.false } : undefined,
105
+ tags: (profile.tags ?? []).map(({ tag, meaning }) => ({ tag, meaning })),
106
+ articles: requests.map((request, index) => ({ index, ...request.state.article })),
107
+ });
108
+ }
109
+ /** A batch's judgements in the articles' order; an article the model left out gets no signal (0.5, no tags). */
110
+ function readRssJudgeBatch(answer, count) {
111
+ const results = (answer && typeof answer === 'object' ? answer.results : undefined);
112
+ const byIndex = new Map();
113
+ for (const item of Array.isArray(results) ? results : []) {
114
+ if (typeof item?.index !== 'number' || typeof item.like !== 'number')
115
+ continue;
116
+ const tags = Array.isArray(item.tags) ? Object.fromEntries(item.tags.flatMap((tag) => typeof tag?.tag === 'string' && typeof tag.probability === 'number' ? [[tag.tag.replace(/^#/, ''), tag.probability]] : [])) : {};
117
+ byIndex.set(item.index, { like: item.like, tags });
118
+ }
119
+ return Array.from({ length: count }, (_unused, index) => byIndex.get(index) ?? { like: 0.5, tags: {} });
120
+ }
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RssProfileUseCases = void 0;
4
+ // What the reader's Preference profiles do: list the rated entries, generate a profile from a sample of them through a
5
+ // chat model the caller supplies, and keep, delete and activate the profiles. Matching entries against a profile is not here.
6
+ const errors_1 = require("../errors");
7
+ const rss_profile_model_1 = require("./rss-profile-model");
8
+ const rss_profile_test_1 = require("./rss-profile-test");
9
+ class RssProfileUseCases {
10
+ ports;
11
+ constructor(ports) {
12
+ this.ports = ports;
13
+ }
14
+ async list() {
15
+ const [profiles, settings] = await Promise.all([this.ports.store.list(), this.ports.store.settings()]);
16
+ return { profiles, ...settings };
17
+ }
18
+ /** The entries the person rated, most recently rated first. */
19
+ async feedback() { return (0, rss_profile_model_1.rssFeedbackItems)(await this.ports.entries()); }
20
+ /** The rated entries, and the tags a generation would learn with how many entries carry each. */
21
+ async evidence() {
22
+ const entries = await this.ports.entries();
23
+ return { entries: (0, rss_profile_model_1.rssFeedbackItems)(entries), tags: (0, rss_profile_model_1.rssTagCounts)((0, rss_profile_model_1.rssTaggedItems)(entries)) };
24
+ }
25
+ source(id) { return this.ports.store.source(id); }
26
+ lastTest(id) { return this.ports.store.readTest(id); }
27
+ /**
28
+ * Judges the entries whose answer is known against the profile and scores how close the judge came to the reader's
29
+ * own ratings and tags. The result is kept beside the profile; the evaluator's model, when given, is remembered.
30
+ */
31
+ async test(id, judge, evaluatorModel) {
32
+ await this.assertEnabled();
33
+ const profile = await this.ports.store.read(id);
34
+ const articles = (0, rss_profile_test_1.rssProfileTestPool)(await this.ports.entries(), profile);
35
+ if (!articles.length)
36
+ throw new errors_1.GraphAgentError('rss_profile_no_feedback', 'Nothing to test against yet: like, dislike or tag a few entries first.');
37
+ if (evaluatorModel)
38
+ await this.ports.store.updateSettings({ evaluatorModel });
39
+ const { judgements, evaluator } = await judge(profile, articles);
40
+ const result = { testedAt: (this.ports.now?.() ?? new Date()).toISOString(), evaluator, ...(0, rss_profile_test_1.scoreRssProfileTest)(profile, articles, judgements, rss_profile_model_1.defaultRssTagThreshold) };
41
+ await this.ports.store.writeTest(id, result);
42
+ return result;
43
+ }
44
+ async remove(id) { await this.assertEnabled(); await this.ports.store.remove(id); }
45
+ async activate(id) { await this.assertEnabled(); return this.ports.store.updateSettings({ active: id }); }
46
+ /**
47
+ * Draws the sample, reads every tagged entry, asks the model for the distilled profile, and writes it as a new file.
48
+ * The model and the reader's context (given, else the one saved) are remembered for the next generation; the new
49
+ * profile becomes active when none is.
50
+ */
51
+ async generate(input, complete, signal) {
52
+ await this.assertEnabled();
53
+ const sample = (0, rss_profile_model_1.normalizeRssProfileSample)(input.sample);
54
+ if (input.context !== undefined && input.context.length > rss_profile_model_1.maximumRssProfileContext)
55
+ throw new errors_1.GraphAgentError('invalid_rss_profile', `The context is at most ${rss_profile_model_1.maximumRssProfileContext} characters.`);
56
+ const entries = await this.ports.entries();
57
+ const items = (0, rss_profile_model_1.sampleRssFeedback)((0, rss_profile_model_1.rssFeedbackItems)(entries), sample, this.ports.random), tagged = (0, rss_profile_model_1.rssTaggedItems)(entries);
58
+ if (!items.length)
59
+ throw new errors_1.GraphAgentError('rss_profile_no_feedback', 'Like or dislike a few entries first: a profile is distilled from them.');
60
+ const settings = await this.ports.store.updateSettings({ model: input.model, ...(input.context !== undefined ? { context: input.context } : {}) });
61
+ const answer = await complete({ model: input.model, system: rss_profile_model_1.rssProfileSystemPrompt, messages: (0, rss_profile_model_1.rssProfileMessages)(items, tagged, settings.context), schema: { name: 'rss_preference_profile', schema: rss_profile_model_1.rssProfileOutputSchema }, ...(signal ? { signal } : {}) });
62
+ const at = this.ports.now?.() ?? new Date();
63
+ const profile = (0, rss_profile_model_1.buildRssProfile)({ createdAt: at.toISOString(), model: input.model, sample, items, tagged, ...(settings.context ? { context: settings.context } : {}), corpus: entries.map(rss_profile_model_1.rssSignalText), answer: (0, rss_profile_model_1.extractJsonObject)(answer) });
64
+ const id = await this.ports.store.create((0, rss_profile_model_1.rssProfileId)(at), profile);
65
+ if (!(await this.ports.store.settings()).active)
66
+ await this.ports.store.updateSettings({ active: id });
67
+ return { id, createdAt: profile.createdAt, providerId: profile.generator.providerId, modelId: profile.generator.modelId, basedOn: profile.generator.basedOn, summary: profile.preferences.summary };
68
+ }
69
+ async assertEnabled() {
70
+ if (!(await this.ports.enabled()))
71
+ throw new errors_1.GraphAgentError('rss_disabled', 'RSS is off in this vault.');
72
+ }
73
+ }
74
+ exports.RssProfileUseCases = RssProfileUseCases;
@@ -38,6 +38,7 @@ function classifyMetadataPath(relativePath) {
38
38
  case 'folds.yaml': return { kind: 'folds', action: 'changed' };
39
39
  case 'ide.yaml': return { kind: 'ide', action: 'changed' };
40
40
  case 'rss/feeds.yaml': return { kind: 'rss', action: 'changed' };
41
+ case 'rss/profiles.yaml': return { kind: 'rss', action: 'changed', id: 'profiles' };
41
42
  case 'vault.yaml': return { kind: 'settings', action: 'changed' };
42
43
  case 'safe-notes.yaml': return { kind: 'settings', action: 'changed', id: 'safe-notes' };
43
44
  default: break;
@@ -47,6 +48,8 @@ function classifyMetadataPath(relativePath) {
47
48
  const topology = /^topology\/([^/]+)\.ya?ml$/i.exec(path);
48
49
  if (topology)
49
50
  return { kind: 'topology', action: 'changed', id: topology[1] };
51
+ if (/^rss\/profiles\/\d{14}(\.test)?\.yaml$/.test(path))
52
+ return { kind: 'rss', action: 'changed', id: 'profiles' };
50
53
  const rssFeed = /^rss\/feed-([a-z0-9]+(?:-[a-z0-9]+)*)\//.exec(path);
51
54
  if (rssFeed)
52
55
  return { kind: 'rss-entries', action: 'changed', id: rssFeed[1] };
@@ -28,7 +28,7 @@ const transcription_settings_1 = require("./transcription-settings");
28
28
  const versioning_settings_1 = require("./versioning-settings");
29
29
  /** Applies `operation` to `settings` in place and returns it: a pure step, so a mutation can be checked without a file. */
30
30
  function applyVaultSettingsOperation(settings, operation) {
31
- if (!operation || typeof operation !== 'object' || !['replace_note_keys', 'replace_daily_notes', 'set_daily_notes_enabled', 'set_versioning_enabled', 'replace_spotlight_config', 'set_embeddings_enabled', 'replace_embeddings_config', 'set_matrices_enabled', 'set_dashboards_enabled', 'set_spaces_enabled', 'set_discovery_enabled', 'set_shares_enabled', 'set_share_default_access', 'set_share_save_limit', 'set_safe_notes_enabled', 'replace_safe_notes', 'replace_safe_folders', 'relink_safe_journal_folder', 'set_boards_enabled', 'set_calendars_enabled', 'set_notes_enabled', 'set_files_enabled', 'replace_files', 'set_topology_enabled', 'set_graph_enabled', 'set_chat_enabled', 'set_rss_enabled', 'set_ide_enabled', 'set_attachments_enabled', 'replace_attachments', 'set_recordings_enabled', 'replace_recordings', 'replace_navigation', 'replace_color_slots', 'replace_qr_defaults', 'replace_variables', 'replace_transcription', 'replace_instructions', 'set_agent_editing', 'set_agent_tools', 'add_entity_binding', 'update_entity_binding', 'remove_entity_binding'].includes(operation.op))
31
+ if (!operation || typeof operation !== 'object' || !['replace_note_keys', 'replace_daily_notes', 'set_daily_notes_enabled', 'set_versioning_enabled', 'replace_spotlight_config', 'set_embeddings_enabled', 'replace_embeddings_config', 'set_matrices_enabled', 'set_dashboards_enabled', 'set_spaces_enabled', 'set_discovery_enabled', 'set_shares_enabled', 'set_share_default_access', 'set_share_save_limit', 'set_safe_notes_enabled', 'replace_safe_notes', 'replace_safe_folders', 'relink_safe_journal_folder', 'set_boards_enabled', 'set_calendars_enabled', 'set_notes_enabled', 'set_files_enabled', 'replace_files', 'set_topology_enabled', 'set_graph_enabled', 'set_chat_enabled', 'set_rss_enabled', 'set_ide_enabled', 'set_mcp_enabled', 'set_attachments_enabled', 'replace_attachments', 'set_recordings_enabled', 'replace_recordings', 'replace_navigation', 'replace_color_slots', 'replace_qr_defaults', 'replace_variables', 'replace_transcription', 'replace_instructions', 'set_agent_editing', 'set_agent_tools', 'add_entity_binding', 'update_entity_binding', 'remove_entity_binding'].includes(operation.op))
32
32
  throw new errors_1.GraphAgentError('malformed_settings', 'Unknown vault settings operation.');
33
33
  // The key form and the Notes switch write the same record from different places, so each keeps what the other owns.
34
34
  if (operation.op === 'replace_note_keys')
@@ -100,6 +100,8 @@ function applyVaultSettingsOperation(settings, operation) {
100
100
  settings.rss = (0, feature_switch_1.validateFeatureSwitch)({ enabled: operation.enabled }, 'rss');
101
101
  if (operation.op === 'set_ide_enabled')
102
102
  settings.ide = (0, feature_switch_1.validateFeatureSwitch)({ enabled: operation.enabled }, 'ide');
103
+ if (operation.op === 'set_mcp_enabled')
104
+ settings.mcp = (0, feature_switch_1.validateFeatureSwitch)({ enabled: operation.enabled }, 'mcp');
103
105
  if (operation.op === 'set_attachments_enabled')
104
106
  settings.attachments = (0, attachment_settings_1.validateAttachmentSettings)({ ...(0, attachment_settings_1.resolveAttachmentSettings)(settings), enabled: operation.enabled });
105
107
  if (operation.op === 'replace_attachments')
@@ -256,7 +256,7 @@ function validateVaultSettings(value) {
256
256
  if (featureDefaults !== undefined && featureDefaults !== exports.featureDefaultsVersion)
257
257
  throw new errors_1.GraphAgentError('malformed_settings', `featureDefaults must be ${exports.featureDefaultsVersion} when present.`);
258
258
  // Files keeps its place among the switches, so a file written again keeps its order; its record carries more than the switch.
259
- const switches = Object.fromEntries(['chat', 'boards', 'calendars', 'files', 'topology', 'graph', 'rss', 'ide'].flatMap((feature) => { const raw = value[feature]; return raw === undefined ? [] : [[feature, feature === 'files' ? (0, files_settings_1.validateFilesSettings)(raw) : (0, feature_switch_1.validateFeatureSwitch)(raw, feature)]]; }));
259
+ const switches = Object.fromEntries(['chat', 'boards', 'calendars', 'files', 'topology', 'graph', 'rss', 'ide', 'mcp'].flatMap((feature) => { const raw = value[feature]; return raw === undefined ? [] : [[feature, feature === 'files' ? (0, files_settings_1.validateFilesSettings)(raw) : (0, feature_switch_1.validateFeatureSwitch)(raw, feature)]]; }));
260
260
  const rawSpotlight = value.spotlight;
261
261
  const spotlight = rawSpotlight === undefined ? undefined : (0, spotlight_settings_1.validateSpotlightSettings)(rawSpotlight);
262
262
  const rawTranscription = value.transcription;
@@ -79,7 +79,7 @@ class TranscriptionService {
79
79
  (0, guidance_1.guidanceFields)(provider, guidance);
80
80
  const key = await (0, configuration_1.providerKey)(provider, this.credentials);
81
81
  if (provider.kind !== 'whisperkit' && !key)
82
- throw new types_1.TranscriptionError('key_required', provider.useAgentKey ? `Connect ${provider.label} in Settings › AI providers.` : 'Configure the connection in Settings › AI providers.', 409);
82
+ throw new types_1.TranscriptionError('key_required', provider.useAgentKey ? `Connect ${provider.label} in Settings › AI Providers.` : 'Configure the connection in Settings › AI Providers.', 409);
83
83
  const timeout = AbortSignal.timeout(120_000), combined = AbortSignal.any([signal, timeout]);
84
84
  try {
85
85
  const audio = await this.audio.prepare(input, combined);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braian",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "BrAIan: a local-first typed knowledge-graph workspace. Run it with `npx braian`.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "commonjs",
@@ -30,6 +30,7 @@
30
30
  "@braian/vault-sdk": "0.0.0",
31
31
  "@braian/vault-versioning": "0.0.0",
32
32
  "@braian/voice-transcription": "0.0.0",
33
+ "@modelcontextprotocol/server": "2.4.0",
33
34
  "@mozilla/readability": "0.6.0",
34
35
  "@myriaddreamin/typst-ts-node-compiler": "0.7.0",
35
36
  "@nestjs/common": "11.2.1",
@@ -60,6 +61,7 @@
60
61
  "uqr": "0.1.3",
61
62
  "y-protocols": "1.0.7",
62
63
  "yaml": "2.9.0",
64
+ "yauzl": "3.4.0",
63
65
  "yazl": "3.3.1",
64
66
  "yjs": "13.6.33",
65
67
  "zod": "4.6.7"
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{m as t,t as n}from"./react-B3NTyEzE.js";import{a as r,c as i,d as a,r as o,s}from"./settings-ChT117Ke.js";import{Bn as c,Dt as l,Ft as u,Gt as d,Jt as f,Kn as p,Un as m,Wn as h,Y as g,ar as _,cr as v,gr as y,hr as b,ir as x,or as S,pr as C,rr as w,un as T}from"./index-CCUyKE6q.js";import{I as E,T as D,z as O}from"./icons-CxH3_W-q.js";import{t as k}from"./Trash.es-B7UVM9v_.js";import{Jn as A,_l as j,gl as M,hl as N,ml as P,pl as F,vl as I}from"./logic-BNk_20eJ.js";import{t as L}from"./SlidersHorizontal.es-DkPz8o7o.js";import{t as R}from"./Clock.es-D6bs8ZLR.js";import{t as ee}from"./Prohibit.es-M5ljYyQ3.js";import{n as te,t as ne}from"./link-kind-icon-r9mUfWOh.js";import{t as re}from"./link-picker-C90irWTA.js";import{n as ie,t as ae}from"./browser-DkgCZo02.js";import{t as oe}from"./Eye.es-DKoV8w-8.js";var z=e(t(),1),B=new Map([[`bold`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M128,20A108,108,0,0,0,31.85,177.23L21,209.66A20,20,0,0,0,46.34,235l32.43-10.81A108,108,0,1,0,128,20Zm0,192a84,84,0,0,1-42.06-11.27,12,12,0,0,0-6-1.62,12.1,12.1,0,0,0-3.8.62l-29.79,9.93,9.93-29.79a12,12,0,0,0-1-9.81A84,84,0,1,1,128,212Z`}))],[`duotone`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M224,128A96,96,0,0,1,79.93,211.11h0L42.54,223.58a8,8,0,0,1-10.12-10.12l12.47-37.39h0A96,96,0,1,1,224,128Z`,opacity:`0.2`}),z.createElement(`path`,{d:`M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z`}))],[`fill`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M232,128A104,104,0,0,1,79.12,219.82L45.07,231.17a16,16,0,0,1-20.24-20.24l11.35-34.05A104,104,0,1,1,232,128Z`}))],[`light`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M128,26A102,102,0,0,0,38.35,176.69L26.73,211.56a14,14,0,0,0,17.71,17.71l34.87-11.62A102,102,0,1,0,128,26Zm0,192a90,90,0,0,1-45.06-12.08,6.09,6.09,0,0,0-3-.81,6.2,6.2,0,0,0-1.9.31L40.65,217.88a2,2,0,0,1-2.53-2.53L50.58,178a6,6,0,0,0-.5-4.91A90,90,0,1,1,128,218Z`}))],[`regular`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z`}))],[`thin`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M128,28A100,100,0,0,0,40.53,176.5l-11.9,35.69a12,12,0,0,0,15.18,15.18l35.69-11.9A100,100,0,1,0,128,28Zm0,192a92,92,0,0,1-46.07-12.35,4.05,4.05,0,0,0-2-.54,3.93,3.93,0,0,0-1.27.21L41.28,219.78a4,4,0,0,1-5.06-5.06l12.46-37.38a4,4,0,0,0-.33-3.27A92,92,0,1,1,128,220Z`}))]]),V=z.forwardRef((e,t)=>z.createElement(O,{ref:t,...e,weights:B}));V.displayName=`ChatCircleIcon`;var H=new Map([[`bold`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M156,40a12,12,0,0,1-12,12H112a12,12,0,0,1,0-24h32A12,12,0,0,1,156,40ZM144,204H112a12,12,0,0,0,0,24h32a12,12,0,0,0,0-24ZM208,28H184a12,12,0,0,0,0,24h20V72a12,12,0,0,0,24,0V48A20,20,0,0,0,208,28Zm8,72a12,12,0,0,0-12,12v32a12,12,0,0,0,24,0V112A12,12,0,0,0,216,100Zm0,72a12,12,0,0,0-12,12v20H184a12,12,0,0,0,0,24h24a20,20,0,0,0,20-20V184A12,12,0,0,0,216,172ZM40,156a12,12,0,0,0,12-12V112a12,12,0,0,0-24,0v32A12,12,0,0,0,40,156Zm32,48H52V184a12,12,0,0,0-24,0v24a20,20,0,0,0,20,20H72a12,12,0,0,0,0-24ZM72,28H48A20,20,0,0,0,28,48V72a12,12,0,0,0,24,0V52H72a12,12,0,0,0,0-24Z`}))],[`duotone`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M216,40V216H40V40Z`,opacity:`0.2`}),z.createElement(`path`,{d:`M152,40a8,8,0,0,1-8,8H112a8,8,0,0,1,0-16h32A8,8,0,0,1,152,40Zm-8,168H112a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16ZM208,32H184a8,8,0,0,0,0,16h24V72a8,8,0,0,0,16,0V48A16,16,0,0,0,208,32Zm8,72a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V112A8,8,0,0,0,216,104Zm0,72a8,8,0,0,0-8,8v24H184a8,8,0,0,0,0,16h24a16,16,0,0,0,16-16V184A8,8,0,0,0,216,176ZM40,152a8,8,0,0,0,8-8V112a8,8,0,0,0-16,0v32A8,8,0,0,0,40,152Zm32,56H48V184a8,8,0,0,0-16,0v24a16,16,0,0,0,16,16H72a8,8,0,0,0,0-16ZM72,32H48A16,16,0,0,0,32,48V72a8,8,0,0,0,16,0V48H72a8,8,0,0,0,0-16Z`}))],[`fill`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM104,200H72a16,16,0,0,1-16-16V152a8,8,0,0,1,16,0v32h32a8,8,0,0,1,0,16Zm0-128H72v32a8,8,0,0,1-16,0V72A16,16,0,0,1,72,56h32a8,8,0,0,1,0,16Zm96,112a16,16,0,0,1-16,16H152a8,8,0,0,1,0-16h32V152a8,8,0,0,1,16,0Zm0-80a8,8,0,0,1-16,0V72H152a8,8,0,0,1,0-16h32a16,16,0,0,1,16,16Z`}))],[`light`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M150,40a6,6,0,0,1-6,6H112a6,6,0,0,1,0-12h32A6,6,0,0,1,150,40Zm-6,170H112a6,6,0,0,0,0,12h32a6,6,0,0,0,0-12ZM208,34H184a6,6,0,0,0,0,12h24a2,2,0,0,1,2,2V72a6,6,0,0,0,12,0V48A14,14,0,0,0,208,34Zm8,72a6,6,0,0,0-6,6v32a6,6,0,0,0,12,0V112A6,6,0,0,0,216,106Zm0,72a6,6,0,0,0-6,6v24a2,2,0,0,1-2,2H184a6,6,0,0,0,0,12h24a14,14,0,0,0,14-14V184A6,6,0,0,0,216,178ZM40,150a6,6,0,0,0,6-6V112a6,6,0,0,0-12,0v32A6,6,0,0,0,40,150Zm32,60H48a2,2,0,0,1-2-2V184a6,6,0,0,0-12,0v24a14,14,0,0,0,14,14H72a6,6,0,0,0,0-12ZM72,34H48A14,14,0,0,0,34,48V72a6,6,0,0,0,12,0V48a2,2,0,0,1,2-2H72a6,6,0,0,0,0-12Z`}))],[`regular`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M152,40a8,8,0,0,1-8,8H112a8,8,0,0,1,0-16h32A8,8,0,0,1,152,40Zm-8,168H112a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16ZM208,32H184a8,8,0,0,0,0,16h24V72a8,8,0,0,0,16,0V48A16,16,0,0,0,208,32Zm8,72a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V112A8,8,0,0,0,216,104Zm0,72a8,8,0,0,0-8,8v24H184a8,8,0,0,0,0,16h24a16,16,0,0,0,16-16V184A8,8,0,0,0,216,176ZM40,152a8,8,0,0,0,8-8V112a8,8,0,0,0-16,0v32A8,8,0,0,0,40,152Zm32,56H48V184a8,8,0,0,0-16,0v24a16,16,0,0,0,16,16H72a8,8,0,0,0,0-16ZM72,32H48A16,16,0,0,0,32,48V72a8,8,0,0,0,16,0V48H72a8,8,0,0,0,0-16Z`}))],[`thin`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M148,40a4,4,0,0,1-4,4H112a4,4,0,0,1,0-8h32A4,4,0,0,1,148,40Zm-4,172H112a4,4,0,0,0,0,8h32a4,4,0,0,0,0-8ZM208,36H184a4,4,0,0,0,0,8h24a4,4,0,0,1,4,4V72a4,4,0,0,0,8,0V48A12,12,0,0,0,208,36Zm8,72a4,4,0,0,0-4,4v32a4,4,0,0,0,8,0V112A4,4,0,0,0,216,108Zm0,72a4,4,0,0,0-4,4v24a4,4,0,0,1-4,4H184a4,4,0,0,0,0,8h24a12,12,0,0,0,12-12V184A4,4,0,0,0,216,180ZM40,148a4,4,0,0,0,4-4V112a4,4,0,0,0-8,0v32A4,4,0,0,0,40,148Zm32,64H48a4,4,0,0,1-4-4V184a4,4,0,0,0-8,0v24a12,12,0,0,0,12,12H72a4,4,0,0,0,0-8ZM72,36H48A12,12,0,0,0,36,48V72a4,4,0,0,0,8,0V48a4,4,0,0,1,4-4H72a4,4,0,0,0,0-8Z`}))]]),U=z.forwardRef((e,t)=>z.createElement(O,{ref:t,...e,weights:H}));U.displayName=`SelectionIcon`;function W(e,t=[]){return{version:1,id:e,title:`New agent`,description:``,enabled:!0,spotlight:!1,trigger:``,instructions:``,inherit:q(),mode:`read-only`,tools:t,response:`text`}}function G(e){return ie(e)}function K(e){let t=ae(e);if(!t||typeof t!=`object`||Array.isArray(t)||typeof t.id!=`string`||typeof t.title!=`string`||typeof t.instructions!=`string`||!Array.isArray(t.tools)||t.tools.some(e=>typeof e!=`string`)||![`read-only`,`read-write`].includes(t.mode))throw Error(`Enter a profile with id, title, instructions, mode and tools before switching to the form.`);t.context!==void 0&&ue(t.context);let{inheritInstructions:n,...r}=t,i=typeof n==`boolean`&&r.inherit===void 0?{applicationInstructions:n,vaultInstructions:n}:{};return{...W(t.id),...r,inherit:se({...i,...r.inherit})}}function q(){return{defaultInstructions:!0,excludedRules:[],applicationInstructions:!0,vaultInstructions:!0}}function se(e){if(e!==void 0&&(!e||typeof e!=`object`||Array.isArray(e)||e.excludedRules!==void 0&&(!Array.isArray(e.excludedRules)||e.excludedRules.some(e=>typeof e!=`string`))))throw Error(`Correct the inherit configuration before switching to the form.`);return{...q(),...e}}function ce(){return{currentView:!0,openNotes:`excerpt`,mentionedNotes:!0,conversation:`recent`,semanticBindings:!0,topology:{mode:`all`,types:[],includeTemplates:!1},attachments:[]}}function le(e){let t=ce();return{...t,...e,topology:{...t.topology,...e?.topology},attachments:(e?.attachments??[]).map(e=>({...e,reason:e.reason??``,content:e.content??`metadata`,maxLines:e.maxLines??40}))}}function ue(e){let t=e=>!(!e||typeof e!=`object`||Array.isArray(e)),n=()=>{throw Error(`Correct the context configuration before switching to the form.`)};if(!t(e))return n();for(let t of[`currentView`,`mentionedNotes`,`semanticBindings`])e[t]!==void 0&&typeof e[t]!=`boolean`&&n();if(e.openNotes!==void 0&&![`off`,`references`,`excerpt`].includes(String(e.openNotes))&&n(),e.conversation!==void 0&&![`recent`,`current`].includes(String(e.conversation))&&n(),e.topology!==void 0){if(!t(e.topology))return n();e.topology.types!==void 0&&(!Array.isArray(e.topology.types)||e.topology.types.some(e=>typeof e!=`string`))&&n(),e.topology.mode!==void 0&&![`off`,`selected`,`all`].includes(String(e.topology.mode))&&n()}e.attachments!==void 0&&(!Array.isArray(e.attachments)||e.attachments.some(e=>!t(e)||typeof e.id!=`string`))&&n()}var J=n();function de({title:e,attachment:t,disabled:n,onChange:r,onRemove:i}){let c=e=>r({...t,...e});return(0,J.jsxs)(v,{className:`agent-context-attachment`,legend:e??t.id,children:[e&&(0,J.jsx)(_,{as:`p`,size:`caption`,tone:`muted`,children:t.id}),(0,J.jsx)(o,{label:`Why this item matters`,children:(0,J.jsx)(a,{rows:2,maxLength:2e3,disabled:n,value:t.reason,onChange:e=>c({reason:e.target.value})})}),(0,J.jsx)(o,{label:`Include content`,children:(0,J.jsx)(w,{label:`Include content`,disabled:n,value:t.content,onValueChange:e=>c({content:e}),options:[{value:`metadata`,label:`Metadata`},{value:`body`,label:`Full body`},{value:`excerpt`,label:`First lines`}]})}),t.content===`excerpt`&&(0,J.jsx)(o,{label:`Number of lines`,children:(0,J.jsx)(s,{type:`number`,min:1,max:500,required:!0,value:t.maxLines,disabled:n,onChange:e=>c({maxLines:e.target.valueAsNumber})})}),t.id.startsWith(`board:`)&&(0,J.jsx)(_,{as:`p`,size:`small`,tone:`muted`,children:`Includes the board’s metadata and columns, without loading its cards.`}),(0,J.jsx)(b,{variant:`ghost`,disabled:n,onClick:i,"aria-label":`Remove ${t.id}`,children:`Remove attachment`})]})}function Y({title:e,description:t,children:n}){let r=(0,z.useId)();return(0,J.jsxs)(`section`,{className:`agent-profile-section`,"aria-labelledby":r,children:[(0,J.jsxs)(`header`,{children:[(0,J.jsx)(x,{as:`h3`,size:`subsection`,id:r,children:e}),(0,J.jsx)(_,{as:`p`,size:`small`,tone:`muted`,children:t})]}),(0,J.jsx)(`div`,{className:`agent-profile-section-body`,children:n})]})}function X({label:e,description:t,checked:n,disabled:r,onChange:i}){let a=(0,z.useId)();return(0,J.jsxs)(`div`,{className:`agent-profile-toggle`,children:[(0,J.jsx)(C,{checked:n,disabled:r,"aria-describedby":a,onCheckedChange:i,children:e}),(0,J.jsx)(_,{as:`p`,id:a,size:`small`,tone:`muted`,children:t})]})}function fe(e){let[t,n]=(0,z.useState)({notes:[],types:[],boards:[],loading:!0});return(0,z.useEffect)(()=>{let t=!0;return Promise.allSettled([u(e,`full`),A(e),P(e)]).then(([e,r,i])=>{t&&n({loading:!1,notes:e.status===`fulfilled`?e.value:[],types:r.status===`fulfilled`?r.value:[],boards:i.status===`fulfilled`?i.value:[],...[e,r,i].some(e=>e.status===`rejected`)?{error:`Some context choices could not be loaded. Existing attachments are preserved.`}:{}})}),()=>{t=!1}},[e]),t}function pe({vaultId:e,value:t,disabled:n,onChange:r}){let i=le(t),a=fe(e),s=e=>r({...i,...e}),c=e=>{i.attachments.some(t=>t.id===e)||s({attachments:[...i.attachments,{id:e,reason:``,content:`metadata`,maxLines:40}]})},l=new Set(i.attachments.map(e=>e.id));return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(Y,{title:`Screen and conversation`,description:`Choose the context supplied with each new message.`,children:[(0,J.jsx)(X,{label:`Include current view`,description:`Provide the active view and its references.`,checked:i.currentView,disabled:n,onChange:e=>s({currentView:e})}),(0,J.jsx)(o,{label:`Open notes`,children:(0,J.jsx)(w,{label:`Open notes`,value:i.openNotes,disabled:n,onValueChange:e=>s({openNotes:e}),options:[{value:`off`,label:`Off`},{value:`references`,label:`References`},{value:`excerpt`,label:`Excerpt`}]})}),(0,J.jsx)(X,{label:`Preload notes mentioned in the message`,description:`Read notes explicitly linked in the prompt before the agent starts.`,checked:i.mentionedNotes,disabled:n,onChange:e=>s({mentionedNotes:e})}),(0,J.jsx)(o,{label:`Conversation context`,children:(0,J.jsx)(w,{label:`Conversation context`,value:i.conversation,disabled:n,onValueChange:e=>s({conversation:e}),options:[{value:`current`,label:`This message`,icon:(0,J.jsx)(V,{})},{value:`recent`,label:`Recent chat`,icon:(0,J.jsx)(R,{})}]})}),(0,J.jsx)(X,{label:`Include vault semantic bindings`,description:`Provide the vault’s configured meaning and identity bindings.`,checked:i.semanticBindings,disabled:n,onChange:e=>s({semanticBindings:e})})]}),(0,J.jsxs)(Y,{title:`Schema and templates`,description:`Preload the entity definitions this agent needs, avoiding discovery calls.`,children:[(0,J.jsx)(o,{label:`Topology context`,children:(0,J.jsx)(w,{label:`Topology context`,value:i.topology.mode,disabled:n,onValueChange:e=>s({topology:{...i.topology,mode:e}}),options:[{value:`off`,label:`Off`,icon:(0,J.jsx)(ee,{})},{value:`selected`,label:`Selected`,icon:(0,J.jsx)(U,{})},{value:`all`,label:`All types`,icon:(0,J.jsx)(te,{})}]})}),i.topology.mode===`selected`&&(0,J.jsx)(o,{label:`Entity types`,children:(0,J.jsx)(`div`,{className:`agent-profile-type-choices`,children:[...new Set([...a.types.map(e=>e.id),...i.topology.types])].map(e=>(0,J.jsxs)(S,{checked:i.topology.types.includes(e),disabled:n,onCheckedChange:t=>s({topology:{...i.topology,types:t?[...i.topology.types,e]:i.topology.types.filter(t=>t!==e)}}),children:[a.types.find(t=>t.id===e)?.name??e,` (`,e,`)`]},e))})}),i.topology.mode!==`off`&&(0,J.jsx)(X,{label:`Include template bodies`,description:`Provide the full templates for the included entity types.`,checked:i.topology.includeTemplates,disabled:n,onChange:e=>s({topology:{...i.topology,includeTemplates:e}})})]}),(0,J.jsxs)(Y,{title:`Attached items`,description:`Attach notes, pages or Kanban boards, read fresh before each run.`,children:[!i.attachments.length&&(0,J.jsx)(_,{as:`p`,size:`small`,tone:`muted`,children:`No items attached. Add the people, reference notes or destination Kanban board this agent needs.`}),i.attachments.map((e,t)=>(0,J.jsx)(de,{title:a.notes.find(t=>t.id===e.id)?.label??a.boards.find(t=>`board:${t.id}`===e.id)?.name,attachment:e,disabled:n,onChange:e=>s({attachments:i.attachments.map((n,r)=>r===t?e:n)}),onRemove:()=>s({attachments:i.attachments.filter((e,n)=>n!==t)})},`${t}:${e.id}`)),(0,J.jsx)(re,{label:`Attach context item`,kindsLabel:`What to attach`,idPrefix:`agent-context`,noteSearchLabel:`Find a note or page`,disabled:n||a.loading||i.attachments.length>=20,notes:a.notes.filter(e=>!l.has(e.id)),onChooseNote:e=>c(e.id),trigger:(0,J.jsx)(b,{variant:`secondary`,disabled:n||a.loading||i.attachments.length>=20,children:`Attach item…`}),kinds:[{kind:`note`,title:`Note or page`,caption:`A note from this vault`,step:{type:`note`}},{kind:`board`,title:`Kanban board`,caption:`Board details and columns`,step:{type:`choices`,label:`Choose a Kanban board`,empty:`No Kanban boards available`,choices:a.boards.filter(e=>!l.has(`board:${e.id}`)).map(e=>({key:e.id,title:e.name,icon:(0,J.jsx)(ne,{kind:`board`}),onChoose:()=>c(`board:${e.id}`)}))}}]}),(0,J.jsx)(_,{as:`p`,size:`caption`,tone:`muted`,children:`Bodies are limited to 24 KiB per item. Missing or truncated content is marked.`})]}),a.loading&&(0,J.jsx)(_,{as:`p`,size:`small`,tone:`muted`,role:`status`,children:`Loading context choices…`}),a.error&&(0,J.jsx)(_,{as:`p`,tone:`danger`,size:`small`,role:`alert`,children:a.error})]})}var me=new Map([[`bold`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M117.18,188.74a12,12,0,0,1,0,17l-5.12,5.12A58.26,58.26,0,0,1,70.6,228h0A58.62,58.62,0,0,1,29.14,127.92L63.89,93.17a58.64,58.64,0,0,1,98.56,28.11,12,12,0,1,1-23.37,5.44,34.65,34.65,0,0,0-58.22-16.58L46.11,144.89A34.62,34.62,0,0,0,70.57,204h0a34.41,34.41,0,0,0,24.49-10.14l5.11-5.12A12,12,0,0,1,117.18,188.74ZM226.83,45.17a58.65,58.65,0,0,0-82.93,0l-5.11,5.11a12,12,0,0,0,17,17l5.12-5.12a34.63,34.63,0,1,1,49,49L175.1,145.86A34.39,34.39,0,0,1,150.61,156h0a34.63,34.63,0,0,1-33.69-26.72,12,12,0,0,0-23.38,5.44A58.64,58.64,0,0,0,150.56,180h.05a58.28,58.28,0,0,0,41.47-17.17l34.75-34.75a58.62,58.62,0,0,0,0-82.91Z`}))],[`duotone`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M218.34,119.6,183.6,154.34a46.58,46.58,0,0,1-44.31,12.26c-.31.34-.62.67-.95,1L103.6,202.34A46.63,46.63,0,1,1,37.66,136.4L72.4,101.66A46.6,46.6,0,0,1,116.71,89.4c.31-.34.62-.67,1-1L152.4,53.66a46.63,46.63,0,0,1,65.94,65.94Z`,opacity:`0.2`}),z.createElement(`path`,{d:`M240,88.23a54.43,54.43,0,0,1-16,37L189.25,160a54.27,54.27,0,0,1-38.63,16h-.05A54.63,54.63,0,0,1,96,119.84a8,8,0,0,1,16,.45A38.62,38.62,0,0,0,150.58,160h0a38.39,38.39,0,0,0,27.31-11.31l34.75-34.75a38.63,38.63,0,0,0-54.63-54.63l-11,11A8,8,0,0,1,135.7,59l11-11A54.65,54.65,0,0,1,224,48,54.86,54.86,0,0,1,240,88.23ZM109,185.66l-11,11A38.41,38.41,0,0,1,70.6,208h0a38.63,38.63,0,0,1-27.29-65.94L78,107.31A38.63,38.63,0,0,1,144,135.71a8,8,0,0,0,7.78,8.22H152a8,8,0,0,0,8-7.78A54.86,54.86,0,0,0,144,96a54.65,54.65,0,0,0-77.27,0L32,130.75A54.62,54.62,0,0,0,70.56,224h0a54.28,54.28,0,0,0,38.64-16l11-11A8,8,0,0,0,109,185.66Z`}))],[`fill`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM115.7,192.49a43.31,43.31,0,0,1-55-66.43l25.37-25.37a43.35,43.35,0,0,1,61.25,0,42.9,42.9,0,0,1,9.95,15.43,8,8,0,1,1-15,5.6A27.33,27.33,0,0,0,97.37,112L72,137.37a27.32,27.32,0,0,0,34.68,41.91,8,8,0,1,1,9,13.21Zm79.61-62.55-25.37,25.37A43,43,0,0,1,139.32,168h0a43.35,43.35,0,0,1-40.53-28.12,8,8,0,1,1,15-5.6A27.35,27.35,0,0,0,139.28,152h0a27.14,27.14,0,0,0,19.32-8L184,118.63a27.32,27.32,0,0,0-34.68-41.91,8,8,0,1,1-9-13.21,43.32,43.32,0,0,1,55,66.43Z`}))],[`light`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M238,88.18a52.42,52.42,0,0,1-15.4,35.66l-34.75,34.75A52.28,52.28,0,0,1,150.62,174h-.05A52.63,52.63,0,0,1,98,119.9a6,6,0,0,1,6-5.84h.17a6,6,0,0,1,5.83,6.16A40.62,40.62,0,0,0,150.58,162h0a40.4,40.4,0,0,0,28.73-11.9l34.75-34.74A40.63,40.63,0,0,0,156.63,57.9l-11,11a6,6,0,0,1-8.49-8.49l11-11a52.62,52.62,0,0,1,74.43,0A52.83,52.83,0,0,1,238,88.18Zm-127.62,98.9-11,11A40.36,40.36,0,0,1,70.6,210h0a40.63,40.63,0,0,1-28.7-69.36L76.62,105.9A40.63,40.63,0,0,1,146,135.77a6,6,0,0,0,5.83,6.16H152a6,6,0,0,0,6-5.84A52.63,52.63,0,0,0,68.14,97.42L33.38,132.16A52.63,52.63,0,0,0,70.56,222h0a52.26,52.26,0,0,0,37.22-15.42l11-11a6,6,0,1,0-8.49-8.48Z`}))],[`regular`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M240,88.23a54.43,54.43,0,0,1-16,37L189.25,160a54.27,54.27,0,0,1-38.63,16h-.05A54.63,54.63,0,0,1,96,119.84a8,8,0,0,1,16,.45A38.62,38.62,0,0,0,150.58,160h0a38.39,38.39,0,0,0,27.31-11.31l34.75-34.75a38.63,38.63,0,0,0-54.63-54.63l-11,11A8,8,0,0,1,135.7,59l11-11A54.65,54.65,0,0,1,224,48,54.86,54.86,0,0,1,240,88.23ZM109,185.66l-11,11A38.41,38.41,0,0,1,70.6,208h0a38.63,38.63,0,0,1-27.29-65.94L78,107.31A38.63,38.63,0,0,1,144,135.71a8,8,0,0,0,16,.45A54.86,54.86,0,0,0,144,96a54.65,54.65,0,0,0-77.27,0L32,130.75A54.62,54.62,0,0,0,70.56,224h0a54.28,54.28,0,0,0,38.64-16l11-11A8,8,0,0,0,109,185.66Z`}))],[`thin`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M236,88.12a50.44,50.44,0,0,1-14.81,34.31l-34.75,34.74A50.33,50.33,0,0,1,150.62,172h-.05A50.63,50.63,0,0,1,100,120a4,4,0,0,1,4-3.89h.11a4,4,0,0,1,3.89,4.11A42.64,42.64,0,0,0,150.58,164h0a42.32,42.32,0,0,0,30.14-12.49l34.75-34.74a42.63,42.63,0,1,0-60.29-60.28l-11,11a4,4,0,0,1-5.66-5.65l11-11A50.64,50.64,0,0,1,236,88.12ZM111.78,188.49l-11,11A42.33,42.33,0,0,1,70.6,212h0a42.63,42.63,0,0,1-30.11-72.77l34.75-34.74A42.63,42.63,0,0,1,148,135.82a4,4,0,0,0,8,.23A50.64,50.64,0,0,0,69.55,98.83L34.8,133.57A50.63,50.63,0,0,0,70.56,220h0a50.33,50.33,0,0,0,35.81-14.83l11-11a4,4,0,1,0-5.65-5.66Z`}))]]),Z=z.forwardRef((e,t)=>z.createElement(O,{ref:t,...e,weights:me}));Z.displayName=`LinkIcon`;var he={safety:`Always on`,writing:`Writing notes`,time:`Time`,reading:`Reading the vault`,answers:`Answers`,context:`Context blocks`},ge=[`safety`,`writing`,`time`,`reading`,`answers`,`context`];function _e(e){return ge.map(t=>({id:t,label:he[t],rules:e.filter(e=>e.group===t)})).filter(e=>e.rules.length>0)}function Q(e,t){return e.locked||t.defaultInstructions&&!t.excludedRules.includes(e.id)}function ve(e,t,n){return n?e.filter(e=>e!==t):e.includes(t)?e:[...e,t]}function ye({profile:e,rules:t,disabled:n,onChange:r}){let i=e.inherit,s=t=>r({...e,inherit:{...i,...t}}),c=t.filter(e=>Q(e,i)).length;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(Y,{title:`Inherited instructions`,description:`The model reads these before this agent’s own instructions, which may narrow them where they say so.`,children:[(0,J.jsx)(X,{label:`Default instructions`,description:`BrAIan’s standard rules for reading, writing and dating notes. Locked rules always apply.`,checked:i.defaultInstructions,disabled:n,onChange:e=>s({defaultInstructions:e})}),t.length>0&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(_,{as:`p`,size:`small`,tone:`muted`,children:[c,` of `,t.length,` rules included. Leaving out a rule that costs a read or a search makes the agent faster and less careful.`]}),_e(t).map(e=>(0,J.jsx)(v,{legend:e.label,children:(0,J.jsx)(`div`,{className:`agent-profile-tools`,children:e.rules.map(e=>(0,J.jsxs)(`div`,{className:`agent-profile-tool`,children:[(0,J.jsx)(S,{checked:Q(e,i),disabled:n||e.locked||!i.defaultInstructions,onCheckedChange:t=>s({excludedRules:ve(i.excludedRules,e.id,t)}),children:e.title}),(0,J.jsxs)(_,{as:`small`,size:`caption`,tone:`muted`,children:[e.locked?`Always on · `:``,e.summary]})]},e.id))})},e.id))]}),(0,J.jsx)(X,{label:`Global instructions`,description:`The instructions you set for BrAIan in every vault.`,checked:i.applicationInstructions,disabled:n,onChange:e=>s({applicationInstructions:e})}),(0,J.jsx)(X,{label:`Vault instructions`,description:`This vault’s own instructions.`,checked:i.vaultInstructions,disabled:n,onChange:e=>s({vaultInstructions:e})})]}),(0,J.jsx)(Y,{title:`This agent’s instructions`,description:`What this agent does, read last. Say explicitly when it should depart from an inherited rule.`,children:(0,J.jsx)(o,{label:`Instructions`,children:(0,J.jsx)(a,{value:e.instructions,disabled:n,required:!0,rows:12,maxLength:16384,onChange:t=>r({...e,instructions:t.target.value})})})}),(0,J.jsx)(Y,{title:`Response format`,description:`Choose what a successful reply should contain.`,children:(0,J.jsx)(o,{label:`Response`,children:(0,J.jsx)(w,{label:`Response`,value:e.response,disabled:n,onValueChange:t=>r({...e,response:t}),options:[{value:`text`,label:`Normal text`,icon:(0,J.jsx)(V,{})},{value:`links-only`,label:`Links only`,icon:(0,J.jsx)(Z,{})}]})})}),(0,J.jsxs)(Y,{title:`Reasoning`,description:`How long the model thinks before each step. Lower is faster; capture rarely needs more than Low.`,children:[(0,J.jsx)(o,{label:`Effort`,children:(0,J.jsx)(w,{label:`Reasoning effort`,value:e.reasoningEffort??`default`,disabled:n,onValueChange:t=>r(be(e,t)),options:[{value:`default`,label:`Default`},{value:`low`,label:`Low`},{value:`medium`,label:`Medium`},{value:`high`,label:`High`}]})}),(0,J.jsxs)(_,{as:`p`,size:`small`,tone:`muted`,children:[`Default is `,e.response===`links-only`?`Low, since this agent answers with links only`:`the chat’s own effort`,`. Applies to models that offer an effort; others ignore it.`]})]})]})}function be(e,t){let{reasoningEffort:n,...r}=e;return t===`low`||t===`medium`||t===`high`?{...r,reasoningEffort:t}:r}function xe({profile:e,tools:t,disabled:n,onChange:r}){return(0,J.jsxs)(Y,{title:`Tools and permissions`,description:`Choose the actions this workflow can take. Its list is its own: a new workflow starts with the main agent's tools, and later changes to either do not reach the other.`,children:[(0,J.jsx)(o,{label:`Access`,children:(0,J.jsx)(w,{label:`Access`,value:e.mode,disabled:n,onValueChange:t=>r({...e,mode:t}),options:[{value:`read-only`,label:`Read only`,icon:(0,J.jsx)(oe,{})},{value:`read-write`,label:`Read and write`,icon:(0,J.jsx)(E,{})}]})}),(0,J.jsxs)(_,{as:`p`,size:`small`,tone:`muted`,children:[e.tools.length,` of `,t.length,` tools selected. Read-only access blocks writes; disabled vault features remain unavailable.`]}),[`read`,`write`].map(i=>(0,J.jsx)(v,{legend:i===`read`?`Read tools`:`Write tools`,children:(0,J.jsx)(`div`,{className:`agent-profile-tools`,children:t.filter(e=>e.access===i).map(t=>(0,J.jsxs)(`div`,{className:`agent-profile-tool`,children:[(0,J.jsx)(S,{checked:e.tools.includes(t.name),disabled:n,onCheckedChange:n=>r({...e,tools:n?[...e.tools,t.name]:e.tools.filter(e=>e!==t.name)}),children:t.label}),(0,J.jsxs)(_,{as:`small`,size:`caption`,tone:`muted`,children:[t.available?e.mode===`read-only`&&t.access===`write`?`Blocked by read-only access · `:``:`Feature disabled · `,t.description]})]},t.name))})},i))]})}function Se({vaultId:e,profile:t,tools:n,rules:r,isNew:i,disabled:c,onChange:l}){let[u,d]=(0,z.useState)(`general`),f=(0,z.useRef)(null),p=(0,z.useRef)(u);(0,z.useLayoutEffect)(()=>{p.current!==u&&f.current?.scrollIntoView?.({block:`start`}),p.current=u},[u]);let m=e=>l({...t,...e});return(0,J.jsx)(`div`,{ref:f,children:(0,J.jsx)(g,{label:`Agent configuration`,value:u,onChange:d,options:[{value:`general`,label:`General`},{value:`instructions`,label:`Instructions`},{value:`context`,label:`Context`},{value:`tools`,label:`Tools`}],children:(0,J.jsxs)(`div`,{className:`agent-profile-tab-content`,children:[u===`general`&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(Y,{title:`Identity`,description:`How this agent appears in Chat and Spotlight.`,children:[(0,J.jsx)(o,{label:`Title`,children:(0,J.jsx)(s,{value:t.title,"data-popup-autofocus":`true`,disabled:c,required:!0,maxLength:100,onChange:e=>m({title:e.target.value})})}),(0,J.jsx)(o,{label:`Description`,children:(0,J.jsx)(s,{value:t.description,disabled:c,maxLength:500,onChange:e=>m({description:e.target.value})})}),(0,J.jsx)(o,{label:`ID`,children:(0,J.jsx)(s,{value:t.id,disabled:!i||c,required:!0,pattern:`[a-z][a-z0-9-]{0,63}`,maxLength:64,onChange:e=>m({id:e.target.value})})})]}),(0,J.jsxs)(Y,{title:`Availability and routing`,description:`Control how you and the automatic router find this agent.`,children:[(0,J.jsx)(X,{label:`Enable this agent`,description:`Make this profile available for new turns.`,checked:t.enabled,disabled:c,onChange:e=>m({enabled:e})}),(0,J.jsx)(X,{label:`Show as a Spotlight command`,description:`Offer a shortcut that starts Chat with this agent selected.`,checked:t.spotlight,disabled:c,onChange:e=>m({spotlight:e})}),(0,J.jsx)(o,{label:`When to use this agent`,children:(0,J.jsx)(a,{value:t.trigger,disabled:c,rows:3,maxLength:2e3,placeholder:`Describe matching requests. Leave empty for explicit use only.`,onChange:e=>m({trigger:e.target.value})})})]})]}),u===`instructions`&&(0,J.jsx)(ye,{profile:t,rules:r,disabled:c,onChange:l}),u===`context`&&(0,J.jsx)(pe,{vaultId:e,value:t.context,disabled:c,onChange:e=>m({context:e})}),u===`tools`&&(0,J.jsx)(xe,{profile:t,tools:n,disabled:c,onChange:l})]})})})}function Ce({vaultId:e,document:t,tools:n,rules:i=[],onClose:s,onSaved:l}){let u=c(),[d]=(0,z.useState)(()=>t?.source??G(W(`agent-${crypto.randomUUID().slice(0,8)}`,n.filter(e=>e.enabled).map(e=>e.name)))),[f,g]=(0,z.useState)(d),[v,y]=(0,z.useState)(!t?.profile&&!!t),[b,x]=(0,z.useState)(!1),[S,C]=(0,z.useState)(t?.error),T=(()=>{try{return K(f)}catch{return}})(),E=async()=>{(f===d||await u.confirm({title:`Discard agent changes?`,message:`Your changes have not been saved.`,confirmLabel:`Discard`}))&&s()},O=async()=>{C(void 0),x(!0);try{let n=t?.id??K(f).id;await j(e,n,f,t?.revision??null),l()}catch(e){C(e instanceof Error?e.message:`Could not save agent.`)}finally{x(!1)}};return(0,J.jsx)(m,{title:t?`Edit ${t.profile?.title??t.id}`:`Add workflow`,description:`Changes in every tab are saved together with Save workflow.`,size:`large`,className:`agent-profile-editor`,busy:b,onCancel:()=>void E(),actions:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(h,{onClick:()=>void E(),disabled:b,children:`Cancel`}),(0,J.jsx)(p,{}),(0,J.jsx)(h,{primary:!0,disabled:b,onClick:()=>void O(),children:b?`Saving…`:`Save workflow`})]}),children:(0,J.jsxs)(r,{onSubmit:e=>{e.preventDefault(),O()},children:[(0,J.jsx)(`div`,{className:`agent-profile-editor-mode`,children:(0,J.jsx)(w,{label:`Editor mode`,value:v?`yaml`:`form`,disabled:b,options:[{value:`form`,label:`Form`,icon:(0,J.jsx)(L,{})},{value:`yaml`,label:`YAML`,icon:(0,J.jsx)(D,{})}],onValueChange:e=>{e===`form`&&!T?C(`Correct the YAML before switching to the form.`):y(e===`yaml`)}})}),v?(0,J.jsx)(o,{label:`Agent YAML`,children:(0,J.jsx)(a,{className:`agent-profile-source`,value:f,rows:24,disabled:b,onChange:e=>g(e.target.value)})}):T&&(0,J.jsx)(Se,{vaultId:e,profile:T,tools:n,rules:i,isNew:!t,disabled:b,onChange:e=>g(G(e))}),S&&(0,J.jsx)(_,{as:`p`,size:`small`,tone:`danger`,role:`alert`,children:S})]})})}function $({vaultId:e,onClose:t}){let n=c(),[r,i]=(0,z.useState)(),[s,l]=(0,z.useState)(``),[u,d]=(0,z.useState)(!1),[f,g]=(0,z.useState)();(0,z.useEffect)(()=>{let t=!0;return F(e).then(e=>{t&&(i(e),l(e.source))}).catch(e=>{t&&g(e instanceof Error?e.message:String(e))}),()=>{t=!1}},[e]);let v=async()=>{(!r||s===r.source||await n.confirm({title:`Discard routing changes?`,message:`Your changes have not been saved.`,confirmLabel:`Discard`}))&&t()},y=async()=>{if(r){d(!0),g(void 0);try{await I(e,s,r.revision),t()}catch(e){g(e instanceof Error?e.message:String(e))}finally{d(!1)}}};return(0,J.jsxs)(m,{title:`Agent routing`,description:`Prefer Jev when connected; otherwise use a lightweight available chat model.`,size:`large`,busy:u,onCancel:()=>void v(),actions:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(h,{onClick:()=>void v(),disabled:u,children:`Cancel`}),(0,J.jsx)(p,{}),(0,J.jsx)(h,{primary:!0,disabled:u||!r,onClick:()=>void y(),children:`Save routing`})]}),children:[(0,J.jsx)(_,{as:`p`,size:`small`,tone:`muted`,children:`Each strategy has its own prompt. Add an exact model ID under modelPrompts to override that model’s prompt. The timeout covers routing only; the selected agent uses the conversation’s model.`}),(0,J.jsx)(o,{label:`Routing YAML`,children:(0,J.jsx)(a,{className:`agent-profile-source`,rows:22,value:s,disabled:u||!r,onChange:e=>l(e.target.value)})}),f&&(0,J.jsx)(_,{as:`p`,size:`small`,tone:`danger`,role:`alert`,children:f})]})}function we({vaultId:e,vaultLabel:t,onClose:n}){let r=T(e),i=c(),[s,u]=(0,z.useState)(),[f,p]=(0,z.useState)(!1),[g,v]=(0,z.useState)(``),[x,S]=(0,z.useState)(),[C,w]=(0,z.useState)(!1),[D,O]=(0,z.useState)(),A=async t=>{if(await i.confirm({title:`Delete ${t.profile?.title??t.id}?`,message:`This removes its definition. Running turns keep their existing definition.`,confirmLabel:`Delete`}))try{await M(e,t.id,t.revision),await r.reload()}catch(e){O(e instanceof Error?e.message:String(e))}},j=r.profiles.map(e=>{let t=e.profile?.title??e.id;return{id:e.id,title:`${t}${e.profile?.enabled===!1?` · Disabled`:``}`,description:e.error?(0,J.jsx)(_,{as:`span`,size:`caption`,tone:`danger`,children:e.error}):e.profile?.description??`Invalid definition`,ariaLabel:`Open ${t}`,keyboardItem:!0,actions:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(y,{size:`small`,variant:`ghost`,"aria-label":`Edit ${t}`,title:`Edit workflow`,onClick:()=>u(e),children:(0,J.jsx)(E,{"aria-hidden":`true`})}),(0,J.jsx)(y,{size:`small`,variant:`ghost`,"aria-label":`Delete ${t}`,title:`Delete workflow`,onClick:()=>void A(e),children:(0,J.jsx)(k,{"aria-hidden":`true`})})]})}}),P=async()=>{w(!0),O(void 0),S(void 0);try{S(await N(e,g))}catch(e){O(e instanceof Error?e.message:String(e))}finally{w(!1)}};return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(m,{title:`Workflows`,description:`Workflows defined for ${t}.`,size:`large`,onCancel:n,actions:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(h,{onClick:()=>p(!0),children:`Routing settings`}),(0,J.jsx)(h,{primary:!0,onClick:()=>u(`new`),children:`Add workflow`})]}),children:(0,J.jsxs)(`div`,{className:`agent-profile-manager`,children:[(0,J.jsx)(_,{as:`p`,size:`small`,tone:`muted`,children:`A workflow is an agent with its own instructions and a restricted set of tools. Automatic routing checks its trigger before each new message.`}),r.loading?(0,J.jsx)(d,{status:`loading`,children:`Loading workflows…`}):(0,J.jsx)(l,{className:`agent-profile-list`,"aria-label":`Workflows`,trailingSeparator:!1,items:j,emptyState:(0,J.jsx)(d,{status:`empty`,density:`inline`,children:`No workflows in this vault yet.`}),onSelect:e=>{let t=r.profiles.find(t=>t.id===e);t&&u(t)}}),(0,J.jsx)(o,{label:`Try routing`,children:(0,J.jsx)(a,{value:g,rows:3,maxLength:6e3,placeholder:`Describe a request to see which agent would handle it.`,onChange:e=>v(e.target.value)})}),(0,J.jsx)(b,{disabled:C||!g.trim(),onClick:()=>void P(),children:C?`Choosing agent…`:`Choose agent without running it`}),x&&(0,J.jsxs)(_,{as:`p`,size:`small`,role:`status`,children:[`Selected: `,r.profiles.find(e=>e.id===x.profileId)?.profile?.title??`Default agent`,` · `,x.router.strategy,x.router.modelId?` · ${x.router.modelId}`:``,x.router.durationMs===void 0?``:` · ${x.router.durationMs} ms`,x.router.fallback?` · ${x.router.fallback}`:``]}),(r.error||D)&&(0,J.jsx)(_,{as:`p`,size:`small`,tone:`danger`,role:`alert`,children:D??r.error})]})}),s&&(0,J.jsx)(Ce,{vaultId:e,document:typeof s==`string`?void 0:s,tools:r.tools,rules:r.rules,onClose:()=>u(void 0),onSaved:()=>{u(void 0),r.reload()}},typeof s==`string`?s:`${s.id}:${s.revision}`),f&&(0,J.jsx)($,{vaultId:e,onClose:()=>p(!1)})]})}function Te(){let e=f(),[t,n]=(0,z.useState)(!1);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(i,{label:`Workflows`,description:`Agents with their own instructions, allowed tools and automatic routing for this vault.`,layout:`control`,persistence:`custom`,children:(0,J.jsx)(b,{disabled:e.loading,onClick:()=>n(!0),children:`Manage workflows`})}),t&&(0,J.jsx)(we,{vaultId:e.id,vaultLabel:e.label,onClose:()=>n(!1)},e.id)]})}var Ee={contributions:[{id:`agent-profiles`,sectionId:`agent`,priority:600,persistence:`custom`,Component:Te}]};export{Ee as agentProfilesSettingsModule};
1
+ import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{m as t,t as n}from"./react-B3NTyEzE.js";import{a as r,c as i,d as a,r as o,s}from"./settings-CU8YR8di.js";import{Dt as c,Ft as l,Gn as u,Gt as d,Hn as f,Jn as p,Jt as m,Kn as h,Y as g,_r as _,ar as v,cn as y,cr as b,hr as x,or as S,sr as C,ur as w,vr as T}from"./index-BVDhmwI8.js";import{I as E,T as D,z as O}from"./icons-CxH3_W-q.js";import{t as k}from"./Trash.es-B7UVM9v_.js";import{Xn as A,dl as j,fl as M,gl as N,hl as P,ml as F,pl as I}from"./logic-DtHJ5GlU.js";import{t as L}from"./SlidersHorizontal.es-DkPz8o7o.js";import{t as R}from"./Clock.es-D6bs8ZLR.js";import{t as ee}from"./Prohibit.es-M5ljYyQ3.js";import{n as te,t as ne}from"./link-kind-icon-BMfHfR_C.js";import{t as re}from"./link-picker-BfwWXJZg.js";import{n as ie,t as ae}from"./browser-DkgCZo02.js";import{t as oe}from"./Eye.es-DKoV8w-8.js";var z=e(t(),1),B=new Map([[`bold`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M128,20A108,108,0,0,0,31.85,177.23L21,209.66A20,20,0,0,0,46.34,235l32.43-10.81A108,108,0,1,0,128,20Zm0,192a84,84,0,0,1-42.06-11.27,12,12,0,0,0-6-1.62,12.1,12.1,0,0,0-3.8.62l-29.79,9.93,9.93-29.79a12,12,0,0,0-1-9.81A84,84,0,1,1,128,212Z`}))],[`duotone`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M224,128A96,96,0,0,1,79.93,211.11h0L42.54,223.58a8,8,0,0,1-10.12-10.12l12.47-37.39h0A96,96,0,1,1,224,128Z`,opacity:`0.2`}),z.createElement(`path`,{d:`M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z`}))],[`fill`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M232,128A104,104,0,0,1,79.12,219.82L45.07,231.17a16,16,0,0,1-20.24-20.24l11.35-34.05A104,104,0,1,1,232,128Z`}))],[`light`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M128,26A102,102,0,0,0,38.35,176.69L26.73,211.56a14,14,0,0,0,17.71,17.71l34.87-11.62A102,102,0,1,0,128,26Zm0,192a90,90,0,0,1-45.06-12.08,6.09,6.09,0,0,0-3-.81,6.2,6.2,0,0,0-1.9.31L40.65,217.88a2,2,0,0,1-2.53-2.53L50.58,178a6,6,0,0,0-.5-4.91A90,90,0,1,1,128,218Z`}))],[`regular`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z`}))],[`thin`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M128,28A100,100,0,0,0,40.53,176.5l-11.9,35.69a12,12,0,0,0,15.18,15.18l35.69-11.9A100,100,0,1,0,128,28Zm0,192a92,92,0,0,1-46.07-12.35,4.05,4.05,0,0,0-2-.54,3.93,3.93,0,0,0-1.27.21L41.28,219.78a4,4,0,0,1-5.06-5.06l12.46-37.38a4,4,0,0,0-.33-3.27A92,92,0,1,1,128,220Z`}))]]),V=z.forwardRef((e,t)=>z.createElement(O,{ref:t,...e,weights:B}));V.displayName=`ChatCircleIcon`;var H=new Map([[`bold`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M156,40a12,12,0,0,1-12,12H112a12,12,0,0,1,0-24h32A12,12,0,0,1,156,40ZM144,204H112a12,12,0,0,0,0,24h32a12,12,0,0,0,0-24ZM208,28H184a12,12,0,0,0,0,24h20V72a12,12,0,0,0,24,0V48A20,20,0,0,0,208,28Zm8,72a12,12,0,0,0-12,12v32a12,12,0,0,0,24,0V112A12,12,0,0,0,216,100Zm0,72a12,12,0,0,0-12,12v20H184a12,12,0,0,0,0,24h24a20,20,0,0,0,20-20V184A12,12,0,0,0,216,172ZM40,156a12,12,0,0,0,12-12V112a12,12,0,0,0-24,0v32A12,12,0,0,0,40,156Zm32,48H52V184a12,12,0,0,0-24,0v24a20,20,0,0,0,20,20H72a12,12,0,0,0,0-24ZM72,28H48A20,20,0,0,0,28,48V72a12,12,0,0,0,24,0V52H72a12,12,0,0,0,0-24Z`}))],[`duotone`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M216,40V216H40V40Z`,opacity:`0.2`}),z.createElement(`path`,{d:`M152,40a8,8,0,0,1-8,8H112a8,8,0,0,1,0-16h32A8,8,0,0,1,152,40Zm-8,168H112a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16ZM208,32H184a8,8,0,0,0,0,16h24V72a8,8,0,0,0,16,0V48A16,16,0,0,0,208,32Zm8,72a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V112A8,8,0,0,0,216,104Zm0,72a8,8,0,0,0-8,8v24H184a8,8,0,0,0,0,16h24a16,16,0,0,0,16-16V184A8,8,0,0,0,216,176ZM40,152a8,8,0,0,0,8-8V112a8,8,0,0,0-16,0v32A8,8,0,0,0,40,152Zm32,56H48V184a8,8,0,0,0-16,0v24a16,16,0,0,0,16,16H72a8,8,0,0,0,0-16ZM72,32H48A16,16,0,0,0,32,48V72a8,8,0,0,0,16,0V48H72a8,8,0,0,0,0-16Z`}))],[`fill`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM104,200H72a16,16,0,0,1-16-16V152a8,8,0,0,1,16,0v32h32a8,8,0,0,1,0,16Zm0-128H72v32a8,8,0,0,1-16,0V72A16,16,0,0,1,72,56h32a8,8,0,0,1,0,16Zm96,112a16,16,0,0,1-16,16H152a8,8,0,0,1,0-16h32V152a8,8,0,0,1,16,0Zm0-80a8,8,0,0,1-16,0V72H152a8,8,0,0,1,0-16h32a16,16,0,0,1,16,16Z`}))],[`light`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M150,40a6,6,0,0,1-6,6H112a6,6,0,0,1,0-12h32A6,6,0,0,1,150,40Zm-6,170H112a6,6,0,0,0,0,12h32a6,6,0,0,0,0-12ZM208,34H184a6,6,0,0,0,0,12h24a2,2,0,0,1,2,2V72a6,6,0,0,0,12,0V48A14,14,0,0,0,208,34Zm8,72a6,6,0,0,0-6,6v32a6,6,0,0,0,12,0V112A6,6,0,0,0,216,106Zm0,72a6,6,0,0,0-6,6v24a2,2,0,0,1-2,2H184a6,6,0,0,0,0,12h24a14,14,0,0,0,14-14V184A6,6,0,0,0,216,178ZM40,150a6,6,0,0,0,6-6V112a6,6,0,0,0-12,0v32A6,6,0,0,0,40,150Zm32,60H48a2,2,0,0,1-2-2V184a6,6,0,0,0-12,0v24a14,14,0,0,0,14,14H72a6,6,0,0,0,0-12ZM72,34H48A14,14,0,0,0,34,48V72a6,6,0,0,0,12,0V48a2,2,0,0,1,2-2H72a6,6,0,0,0,0-12Z`}))],[`regular`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M152,40a8,8,0,0,1-8,8H112a8,8,0,0,1,0-16h32A8,8,0,0,1,152,40Zm-8,168H112a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16ZM208,32H184a8,8,0,0,0,0,16h24V72a8,8,0,0,0,16,0V48A16,16,0,0,0,208,32Zm8,72a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V112A8,8,0,0,0,216,104Zm0,72a8,8,0,0,0-8,8v24H184a8,8,0,0,0,0,16h24a16,16,0,0,0,16-16V184A8,8,0,0,0,216,176ZM40,152a8,8,0,0,0,8-8V112a8,8,0,0,0-16,0v32A8,8,0,0,0,40,152Zm32,56H48V184a8,8,0,0,0-16,0v24a16,16,0,0,0,16,16H72a8,8,0,0,0,0-16ZM72,32H48A16,16,0,0,0,32,48V72a8,8,0,0,0,16,0V48H72a8,8,0,0,0,0-16Z`}))],[`thin`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M148,40a4,4,0,0,1-4,4H112a4,4,0,0,1,0-8h32A4,4,0,0,1,148,40Zm-4,172H112a4,4,0,0,0,0,8h32a4,4,0,0,0,0-8ZM208,36H184a4,4,0,0,0,0,8h24a4,4,0,0,1,4,4V72a4,4,0,0,0,8,0V48A12,12,0,0,0,208,36Zm8,72a4,4,0,0,0-4,4v32a4,4,0,0,0,8,0V112A4,4,0,0,0,216,108Zm0,72a4,4,0,0,0-4,4v24a4,4,0,0,1-4,4H184a4,4,0,0,0,0,8h24a12,12,0,0,0,12-12V184A4,4,0,0,0,216,180ZM40,148a4,4,0,0,0,4-4V112a4,4,0,0,0-8,0v32A4,4,0,0,0,40,148Zm32,64H48a4,4,0,0,1-4-4V184a4,4,0,0,0-8,0v24a12,12,0,0,0,12,12H72a4,4,0,0,0,0-8ZM72,36H48A12,12,0,0,0,36,48V72a4,4,0,0,0,8,0V48a4,4,0,0,1,4-4H72a4,4,0,0,0,0-8Z`}))]]),U=z.forwardRef((e,t)=>z.createElement(O,{ref:t,...e,weights:H}));U.displayName=`SelectionIcon`;function W(e,t=[]){return{version:1,id:e,title:`New agent`,description:``,enabled:!0,spotlight:!1,trigger:``,instructions:``,inherit:q(),mode:`read-only`,tools:t,response:`text`}}function G(e){return ie(e)}function K(e){let t=ae(e);if(!t||typeof t!=`object`||Array.isArray(t)||typeof t.id!=`string`||typeof t.title!=`string`||typeof t.instructions!=`string`||!Array.isArray(t.tools)||t.tools.some(e=>typeof e!=`string`)||![`read-only`,`read-write`].includes(t.mode))throw Error(`Enter a profile with id, title, instructions, mode and tools before switching to the form.`);t.context!==void 0&&ue(t.context);let{inheritInstructions:n,...r}=t,i=typeof n==`boolean`&&r.inherit===void 0?{applicationInstructions:n,vaultInstructions:n}:{};return{...W(t.id),...r,inherit:se({...i,...r.inherit})}}function q(){return{defaultInstructions:!0,excludedRules:[],applicationInstructions:!0,vaultInstructions:!0}}function se(e){if(e!==void 0&&(!e||typeof e!=`object`||Array.isArray(e)||e.excludedRules!==void 0&&(!Array.isArray(e.excludedRules)||e.excludedRules.some(e=>typeof e!=`string`))))throw Error(`Correct the inherit configuration before switching to the form.`);return{...q(),...e}}function ce(){return{currentView:!0,openNotes:`excerpt`,mentionedNotes:!0,conversation:`recent`,semanticBindings:!0,topology:{mode:`all`,types:[],includeTemplates:!1},attachments:[]}}function le(e){let t=ce();return{...t,...e,topology:{...t.topology,...e?.topology},attachments:(e?.attachments??[]).map(e=>({...e,reason:e.reason??``,content:e.content??`metadata`,maxLines:e.maxLines??40}))}}function ue(e){let t=e=>!(!e||typeof e!=`object`||Array.isArray(e)),n=()=>{throw Error(`Correct the context configuration before switching to the form.`)};if(!t(e))return n();for(let t of[`currentView`,`mentionedNotes`,`semanticBindings`])e[t]!==void 0&&typeof e[t]!=`boolean`&&n();if(e.openNotes!==void 0&&![`off`,`references`,`excerpt`].includes(String(e.openNotes))&&n(),e.conversation!==void 0&&![`recent`,`current`].includes(String(e.conversation))&&n(),e.topology!==void 0){if(!t(e.topology))return n();e.topology.types!==void 0&&(!Array.isArray(e.topology.types)||e.topology.types.some(e=>typeof e!=`string`))&&n(),e.topology.mode!==void 0&&![`off`,`selected`,`all`].includes(String(e.topology.mode))&&n()}e.attachments!==void 0&&(!Array.isArray(e.attachments)||e.attachments.some(e=>!t(e)||typeof e.id!=`string`))&&n()}var J=n();function de({title:e,attachment:t,disabled:n,onChange:r,onRemove:i}){let c=e=>r({...t,...e});return(0,J.jsxs)(w,{className:`agent-context-attachment`,legend:e??t.id,children:[e&&(0,J.jsx)(C,{as:`p`,size:`caption`,tone:`muted`,children:t.id}),(0,J.jsx)(o,{label:`Why this item matters`,children:(0,J.jsx)(a,{rows:2,maxLength:2e3,disabled:n,value:t.reason,onChange:e=>c({reason:e.target.value})})}),(0,J.jsx)(o,{label:`Include content`,children:(0,J.jsx)(v,{label:`Include content`,disabled:n,value:t.content,onValueChange:e=>c({content:e}),options:[{value:`metadata`,label:`Metadata`},{value:`body`,label:`Full body`},{value:`excerpt`,label:`First lines`}]})}),t.content===`excerpt`&&(0,J.jsx)(o,{label:`Number of lines`,children:(0,J.jsx)(s,{type:`number`,min:1,max:500,required:!0,value:t.maxLines,disabled:n,onChange:e=>c({maxLines:e.target.valueAsNumber})})}),t.id.startsWith(`board:`)&&(0,J.jsx)(C,{as:`p`,size:`small`,tone:`muted`,children:`Includes the board’s metadata and columns, without loading its cards.`}),(0,J.jsx)(_,{variant:`ghost`,disabled:n,onClick:i,"aria-label":`Remove ${t.id}`,children:`Remove attachment`})]})}function Y({title:e,description:t,children:n}){let r=(0,z.useId)();return(0,J.jsxs)(`section`,{className:`agent-profile-section`,"aria-labelledby":r,children:[(0,J.jsxs)(`header`,{children:[(0,J.jsx)(S,{as:`h3`,size:`subsection`,id:r,children:e}),(0,J.jsx)(C,{as:`p`,size:`small`,tone:`muted`,children:t})]}),(0,J.jsx)(`div`,{className:`agent-profile-section-body`,children:n})]})}function X({label:e,description:t,checked:n,disabled:r,onChange:i}){let a=(0,z.useId)();return(0,J.jsxs)(`div`,{className:`agent-profile-toggle`,children:[(0,J.jsx)(x,{checked:n,disabled:r,"aria-describedby":a,onCheckedChange:i,children:e}),(0,J.jsx)(C,{as:`p`,id:a,size:`small`,tone:`muted`,children:t})]})}function fe(e){let[t,n]=(0,z.useState)({notes:[],types:[],boards:[],loading:!0});return(0,z.useEffect)(()=>{let t=!0;return Promise.allSettled([l(e,`full`),A(e),M(e)]).then(([e,r,i])=>{t&&n({loading:!1,notes:e.status===`fulfilled`?e.value:[],types:r.status===`fulfilled`?r.value:[],boards:i.status===`fulfilled`?i.value:[],...[e,r,i].some(e=>e.status===`rejected`)?{error:`Some context choices could not be loaded. Existing attachments are preserved.`}:{}})}),()=>{t=!1}},[e]),t}function pe({vaultId:e,value:t,disabled:n,onChange:r}){let i=le(t),a=fe(e),s=e=>r({...i,...e}),c=e=>{i.attachments.some(t=>t.id===e)||s({attachments:[...i.attachments,{id:e,reason:``,content:`metadata`,maxLines:40}]})},l=new Set(i.attachments.map(e=>e.id));return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(Y,{title:`Screen and conversation`,description:`Choose the context supplied with each new message.`,children:[(0,J.jsx)(X,{label:`Include current view`,description:`Provide the active view and its references.`,checked:i.currentView,disabled:n,onChange:e=>s({currentView:e})}),(0,J.jsx)(o,{label:`Open notes`,children:(0,J.jsx)(v,{label:`Open notes`,value:i.openNotes,disabled:n,onValueChange:e=>s({openNotes:e}),options:[{value:`off`,label:`Off`},{value:`references`,label:`References`},{value:`excerpt`,label:`Excerpt`}]})}),(0,J.jsx)(X,{label:`Preload notes mentioned in the message`,description:`Read notes explicitly linked in the prompt before the agent starts.`,checked:i.mentionedNotes,disabled:n,onChange:e=>s({mentionedNotes:e})}),(0,J.jsx)(o,{label:`Conversation context`,children:(0,J.jsx)(v,{label:`Conversation context`,value:i.conversation,disabled:n,onValueChange:e=>s({conversation:e}),options:[{value:`current`,label:`This message`,icon:(0,J.jsx)(V,{})},{value:`recent`,label:`Recent chat`,icon:(0,J.jsx)(R,{})}]})}),(0,J.jsx)(X,{label:`Include vault semantic bindings`,description:`Provide the vault’s configured meaning and identity bindings.`,checked:i.semanticBindings,disabled:n,onChange:e=>s({semanticBindings:e})})]}),(0,J.jsxs)(Y,{title:`Schema and templates`,description:`Preload the entity definitions this agent needs, avoiding discovery calls.`,children:[(0,J.jsx)(o,{label:`Topology context`,children:(0,J.jsx)(v,{label:`Topology context`,value:i.topology.mode,disabled:n,onValueChange:e=>s({topology:{...i.topology,mode:e}}),options:[{value:`off`,label:`Off`,icon:(0,J.jsx)(ee,{})},{value:`selected`,label:`Selected`,icon:(0,J.jsx)(U,{})},{value:`all`,label:`All types`,icon:(0,J.jsx)(te,{})}]})}),i.topology.mode===`selected`&&(0,J.jsx)(o,{label:`Entity types`,children:(0,J.jsx)(`div`,{className:`agent-profile-type-choices`,children:[...new Set([...a.types.map(e=>e.id),...i.topology.types])].map(e=>(0,J.jsxs)(b,{checked:i.topology.types.includes(e),disabled:n,onCheckedChange:t=>s({topology:{...i.topology,types:t?[...i.topology.types,e]:i.topology.types.filter(t=>t!==e)}}),children:[a.types.find(t=>t.id===e)?.name??e,` (`,e,`)`]},e))})}),i.topology.mode!==`off`&&(0,J.jsx)(X,{label:`Include template bodies`,description:`Provide the full templates for the included entity types.`,checked:i.topology.includeTemplates,disabled:n,onChange:e=>s({topology:{...i.topology,includeTemplates:e}})})]}),(0,J.jsxs)(Y,{title:`Attached items`,description:`Attach notes, pages or Kanban boards, read fresh before each run.`,children:[!i.attachments.length&&(0,J.jsx)(C,{as:`p`,size:`small`,tone:`muted`,children:`No items attached. Add the people, reference notes or destination Kanban board this agent needs.`}),i.attachments.map((e,t)=>(0,J.jsx)(de,{title:a.notes.find(t=>t.id===e.id)?.label??a.boards.find(t=>`board:${t.id}`===e.id)?.name,attachment:e,disabled:n,onChange:e=>s({attachments:i.attachments.map((n,r)=>r===t?e:n)}),onRemove:()=>s({attachments:i.attachments.filter((e,n)=>n!==t)})},`${t}:${e.id}`)),(0,J.jsx)(re,{label:`Attach context item`,kindsLabel:`What to attach`,idPrefix:`agent-context`,noteSearchLabel:`Find a note or page`,disabled:n||a.loading||i.attachments.length>=20,notes:a.notes.filter(e=>!l.has(e.id)),onChooseNote:e=>c(e.id),trigger:(0,J.jsx)(_,{variant:`secondary`,disabled:n||a.loading||i.attachments.length>=20,children:`Attach item…`}),kinds:[{kind:`note`,title:`Note or page`,caption:`A note from this vault`,step:{type:`note`}},{kind:`board`,title:`Kanban board`,caption:`Board details and columns`,step:{type:`choices`,label:`Choose a Kanban board`,empty:`No Kanban boards available`,choices:a.boards.filter(e=>!l.has(`board:${e.id}`)).map(e=>({key:e.id,title:e.name,icon:(0,J.jsx)(ne,{kind:`board`}),onChoose:()=>c(`board:${e.id}`)}))}}]}),(0,J.jsx)(C,{as:`p`,size:`caption`,tone:`muted`,children:`Bodies are limited to 24 KiB per item. Missing or truncated content is marked.`})]}),a.loading&&(0,J.jsx)(C,{as:`p`,size:`small`,tone:`muted`,role:`status`,children:`Loading context choices…`}),a.error&&(0,J.jsx)(C,{as:`p`,tone:`danger`,size:`small`,role:`alert`,children:a.error})]})}var me=new Map([[`bold`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M117.18,188.74a12,12,0,0,1,0,17l-5.12,5.12A58.26,58.26,0,0,1,70.6,228h0A58.62,58.62,0,0,1,29.14,127.92L63.89,93.17a58.64,58.64,0,0,1,98.56,28.11,12,12,0,1,1-23.37,5.44,34.65,34.65,0,0,0-58.22-16.58L46.11,144.89A34.62,34.62,0,0,0,70.57,204h0a34.41,34.41,0,0,0,24.49-10.14l5.11-5.12A12,12,0,0,1,117.18,188.74ZM226.83,45.17a58.65,58.65,0,0,0-82.93,0l-5.11,5.11a12,12,0,0,0,17,17l5.12-5.12a34.63,34.63,0,1,1,49,49L175.1,145.86A34.39,34.39,0,0,1,150.61,156h0a34.63,34.63,0,0,1-33.69-26.72,12,12,0,0,0-23.38,5.44A58.64,58.64,0,0,0,150.56,180h.05a58.28,58.28,0,0,0,41.47-17.17l34.75-34.75a58.62,58.62,0,0,0,0-82.91Z`}))],[`duotone`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M218.34,119.6,183.6,154.34a46.58,46.58,0,0,1-44.31,12.26c-.31.34-.62.67-.95,1L103.6,202.34A46.63,46.63,0,1,1,37.66,136.4L72.4,101.66A46.6,46.6,0,0,1,116.71,89.4c.31-.34.62-.67,1-1L152.4,53.66a46.63,46.63,0,0,1,65.94,65.94Z`,opacity:`0.2`}),z.createElement(`path`,{d:`M240,88.23a54.43,54.43,0,0,1-16,37L189.25,160a54.27,54.27,0,0,1-38.63,16h-.05A54.63,54.63,0,0,1,96,119.84a8,8,0,0,1,16,.45A38.62,38.62,0,0,0,150.58,160h0a38.39,38.39,0,0,0,27.31-11.31l34.75-34.75a38.63,38.63,0,0,0-54.63-54.63l-11,11A8,8,0,0,1,135.7,59l11-11A54.65,54.65,0,0,1,224,48,54.86,54.86,0,0,1,240,88.23ZM109,185.66l-11,11A38.41,38.41,0,0,1,70.6,208h0a38.63,38.63,0,0,1-27.29-65.94L78,107.31A38.63,38.63,0,0,1,144,135.71a8,8,0,0,0,7.78,8.22H152a8,8,0,0,0,8-7.78A54.86,54.86,0,0,0,144,96a54.65,54.65,0,0,0-77.27,0L32,130.75A54.62,54.62,0,0,0,70.56,224h0a54.28,54.28,0,0,0,38.64-16l11-11A8,8,0,0,0,109,185.66Z`}))],[`fill`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM115.7,192.49a43.31,43.31,0,0,1-55-66.43l25.37-25.37a43.35,43.35,0,0,1,61.25,0,42.9,42.9,0,0,1,9.95,15.43,8,8,0,1,1-15,5.6A27.33,27.33,0,0,0,97.37,112L72,137.37a27.32,27.32,0,0,0,34.68,41.91,8,8,0,1,1,9,13.21Zm79.61-62.55-25.37,25.37A43,43,0,0,1,139.32,168h0a43.35,43.35,0,0,1-40.53-28.12,8,8,0,1,1,15-5.6A27.35,27.35,0,0,0,139.28,152h0a27.14,27.14,0,0,0,19.32-8L184,118.63a27.32,27.32,0,0,0-34.68-41.91,8,8,0,1,1-9-13.21,43.32,43.32,0,0,1,55,66.43Z`}))],[`light`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M238,88.18a52.42,52.42,0,0,1-15.4,35.66l-34.75,34.75A52.28,52.28,0,0,1,150.62,174h-.05A52.63,52.63,0,0,1,98,119.9a6,6,0,0,1,6-5.84h.17a6,6,0,0,1,5.83,6.16A40.62,40.62,0,0,0,150.58,162h0a40.4,40.4,0,0,0,28.73-11.9l34.75-34.74A40.63,40.63,0,0,0,156.63,57.9l-11,11a6,6,0,0,1-8.49-8.49l11-11a52.62,52.62,0,0,1,74.43,0A52.83,52.83,0,0,1,238,88.18Zm-127.62,98.9-11,11A40.36,40.36,0,0,1,70.6,210h0a40.63,40.63,0,0,1-28.7-69.36L76.62,105.9A40.63,40.63,0,0,1,146,135.77a6,6,0,0,0,5.83,6.16H152a6,6,0,0,0,6-5.84A52.63,52.63,0,0,0,68.14,97.42L33.38,132.16A52.63,52.63,0,0,0,70.56,222h0a52.26,52.26,0,0,0,37.22-15.42l11-11a6,6,0,1,0-8.49-8.48Z`}))],[`regular`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M240,88.23a54.43,54.43,0,0,1-16,37L189.25,160a54.27,54.27,0,0,1-38.63,16h-.05A54.63,54.63,0,0,1,96,119.84a8,8,0,0,1,16,.45A38.62,38.62,0,0,0,150.58,160h0a38.39,38.39,0,0,0,27.31-11.31l34.75-34.75a38.63,38.63,0,0,0-54.63-54.63l-11,11A8,8,0,0,1,135.7,59l11-11A54.65,54.65,0,0,1,224,48,54.86,54.86,0,0,1,240,88.23ZM109,185.66l-11,11A38.41,38.41,0,0,1,70.6,208h0a38.63,38.63,0,0,1-27.29-65.94L78,107.31A38.63,38.63,0,0,1,144,135.71a8,8,0,0,0,16,.45A54.86,54.86,0,0,0,144,96a54.65,54.65,0,0,0-77.27,0L32,130.75A54.62,54.62,0,0,0,70.56,224h0a54.28,54.28,0,0,0,38.64-16l11-11A8,8,0,0,0,109,185.66Z`}))],[`thin`,z.createElement(z.Fragment,null,z.createElement(`path`,{d:`M236,88.12a50.44,50.44,0,0,1-14.81,34.31l-34.75,34.74A50.33,50.33,0,0,1,150.62,172h-.05A50.63,50.63,0,0,1,100,120a4,4,0,0,1,4-3.89h.11a4,4,0,0,1,3.89,4.11A42.64,42.64,0,0,0,150.58,164h0a42.32,42.32,0,0,0,30.14-12.49l34.75-34.74a42.63,42.63,0,1,0-60.29-60.28l-11,11a4,4,0,0,1-5.66-5.65l11-11A50.64,50.64,0,0,1,236,88.12ZM111.78,188.49l-11,11A42.33,42.33,0,0,1,70.6,212h0a42.63,42.63,0,0,1-30.11-72.77l34.75-34.74A42.63,42.63,0,0,1,148,135.82a4,4,0,0,0,8,.23A50.64,50.64,0,0,0,69.55,98.83L34.8,133.57A50.63,50.63,0,0,0,70.56,220h0a50.33,50.33,0,0,0,35.81-14.83l11-11a4,4,0,1,0-5.65-5.66Z`}))]]),Z=z.forwardRef((e,t)=>z.createElement(O,{ref:t,...e,weights:me}));Z.displayName=`LinkIcon`;var he={safety:`Always on`,writing:`Writing notes`,time:`Time`,reading:`Reading the vault`,answers:`Answers`,context:`Context blocks`},ge=[`safety`,`writing`,`time`,`reading`,`answers`,`context`];function _e(e){return ge.map(t=>({id:t,label:he[t],rules:e.filter(e=>e.group===t)})).filter(e=>e.rules.length>0)}function Q(e,t){return e.locked||t.defaultInstructions&&!t.excludedRules.includes(e.id)}function ve(e,t,n){return n?e.filter(e=>e!==t):e.includes(t)?e:[...e,t]}function ye({profile:e,rules:t,disabled:n,onChange:r}){let i=e.inherit,s=t=>r({...e,inherit:{...i,...t}}),c=t.filter(e=>Q(e,i)).length;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(Y,{title:`Inherited instructions`,description:`The model reads these before this agent’s own instructions, which may narrow them where they say so.`,children:[(0,J.jsx)(X,{label:`Default instructions`,description:`BrAIan’s standard rules for reading, writing and dating notes. Locked rules always apply.`,checked:i.defaultInstructions,disabled:n,onChange:e=>s({defaultInstructions:e})}),t.length>0&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(C,{as:`p`,size:`small`,tone:`muted`,children:[c,` of `,t.length,` rules included. Leaving out a rule that costs a read or a search makes the agent faster and less careful.`]}),_e(t).map(e=>(0,J.jsx)(w,{legend:e.label,children:(0,J.jsx)(`div`,{className:`agent-profile-tools`,children:e.rules.map(e=>(0,J.jsxs)(`div`,{className:`agent-profile-tool`,children:[(0,J.jsx)(b,{checked:Q(e,i),disabled:n||e.locked||!i.defaultInstructions,onCheckedChange:t=>s({excludedRules:ve(i.excludedRules,e.id,t)}),children:e.title}),(0,J.jsxs)(C,{as:`small`,size:`caption`,tone:`muted`,children:[e.locked?`Always on · `:``,e.summary]})]},e.id))})},e.id))]}),(0,J.jsx)(X,{label:`Global instructions`,description:`The instructions you set for BrAIan in every vault.`,checked:i.applicationInstructions,disabled:n,onChange:e=>s({applicationInstructions:e})}),(0,J.jsx)(X,{label:`Vault instructions`,description:`This vault’s own instructions.`,checked:i.vaultInstructions,disabled:n,onChange:e=>s({vaultInstructions:e})})]}),(0,J.jsx)(Y,{title:`This agent’s instructions`,description:`What this agent does, read last. Say explicitly when it should depart from an inherited rule.`,children:(0,J.jsx)(o,{label:`Instructions`,children:(0,J.jsx)(a,{value:e.instructions,disabled:n,required:!0,rows:12,maxLength:16384,onChange:t=>r({...e,instructions:t.target.value})})})}),(0,J.jsx)(Y,{title:`Response format`,description:`Choose what a successful reply should contain.`,children:(0,J.jsx)(o,{label:`Response`,children:(0,J.jsx)(v,{label:`Response`,value:e.response,disabled:n,onValueChange:t=>r({...e,response:t}),options:[{value:`text`,label:`Normal text`,icon:(0,J.jsx)(V,{})},{value:`links-only`,label:`Links only`,icon:(0,J.jsx)(Z,{})}]})})}),(0,J.jsxs)(Y,{title:`Reasoning`,description:`How long the model thinks before each step. Lower is faster; capture rarely needs more than Low.`,children:[(0,J.jsx)(o,{label:`Effort`,children:(0,J.jsx)(v,{label:`Reasoning effort`,value:e.reasoningEffort??`default`,disabled:n,onValueChange:t=>r(be(e,t)),options:[{value:`default`,label:`Default`},{value:`low`,label:`Low`},{value:`medium`,label:`Medium`},{value:`high`,label:`High`}]})}),(0,J.jsxs)(C,{as:`p`,size:`small`,tone:`muted`,children:[`Default is `,e.response===`links-only`?`Low, since this agent answers with links only`:`the chat’s own effort`,`. Applies to models that offer an effort; others ignore it.`]})]})]})}function be(e,t){let{reasoningEffort:n,...r}=e;return t===`low`||t===`medium`||t===`high`?{...r,reasoningEffort:t}:r}function xe({profile:e,tools:t,disabled:n,onChange:r}){return(0,J.jsxs)(Y,{title:`Tools and permissions`,description:`Choose the actions this workflow can take. Its list is its own: a new workflow starts with the main agent's tools, and later changes to either do not reach the other.`,children:[(0,J.jsx)(o,{label:`Access`,children:(0,J.jsx)(v,{label:`Access`,value:e.mode,disabled:n,onValueChange:t=>r({...e,mode:t}),options:[{value:`read-only`,label:`Read only`,icon:(0,J.jsx)(oe,{})},{value:`read-write`,label:`Read and write`,icon:(0,J.jsx)(E,{})}]})}),(0,J.jsxs)(C,{as:`p`,size:`small`,tone:`muted`,children:[e.tools.length,` of `,t.length,` tools selected. Read-only access blocks writes; disabled vault features remain unavailable.`]}),[`read`,`write`].map(i=>(0,J.jsx)(w,{legend:i===`read`?`Read tools`:`Write tools`,children:(0,J.jsx)(`div`,{className:`agent-profile-tools`,children:t.filter(e=>e.access===i).map(t=>(0,J.jsxs)(`div`,{className:`agent-profile-tool`,children:[(0,J.jsx)(b,{checked:e.tools.includes(t.name),disabled:n,onCheckedChange:n=>r({...e,tools:n?[...e.tools,t.name]:e.tools.filter(e=>e!==t.name)}),children:t.label}),(0,J.jsxs)(C,{as:`small`,size:`caption`,tone:`muted`,children:[t.available?e.mode===`read-only`&&t.access===`write`?`Blocked by read-only access · `:``:`Feature disabled · `,t.description]})]},t.name))})},i))]})}function Se({vaultId:e,profile:t,tools:n,rules:r,isNew:i,disabled:c,onChange:l}){let[u,d]=(0,z.useState)(`general`),f=(0,z.useRef)(null),p=(0,z.useRef)(u);(0,z.useLayoutEffect)(()=>{p.current!==u&&f.current?.scrollIntoView?.({block:`start`}),p.current=u},[u]);let m=e=>l({...t,...e});return(0,J.jsx)(`div`,{ref:f,children:(0,J.jsx)(g,{label:`Agent configuration`,value:u,onChange:d,options:[{value:`general`,label:`General`},{value:`instructions`,label:`Instructions`},{value:`context`,label:`Context`},{value:`tools`,label:`Tools`}],children:(0,J.jsxs)(`div`,{className:`agent-profile-tab-content`,children:[u===`general`&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(Y,{title:`Identity`,description:`How this agent appears in Chat and Spotlight.`,children:[(0,J.jsx)(o,{label:`Title`,children:(0,J.jsx)(s,{value:t.title,"data-popup-autofocus":`true`,disabled:c,required:!0,maxLength:100,onChange:e=>m({title:e.target.value})})}),(0,J.jsx)(o,{label:`Description`,children:(0,J.jsx)(s,{value:t.description,disabled:c,maxLength:500,onChange:e=>m({description:e.target.value})})}),(0,J.jsx)(o,{label:`ID`,children:(0,J.jsx)(s,{value:t.id,disabled:!i||c,required:!0,pattern:`[a-z][a-z0-9-]{0,63}`,maxLength:64,onChange:e=>m({id:e.target.value})})})]}),(0,J.jsxs)(Y,{title:`Availability and routing`,description:`Control how you and the automatic router find this agent.`,children:[(0,J.jsx)(X,{label:`Enable this agent`,description:`Make this profile available for new turns.`,checked:t.enabled,disabled:c,onChange:e=>m({enabled:e})}),(0,J.jsx)(X,{label:`Show as a Spotlight command`,description:`Offer a shortcut that starts Chat with this agent selected.`,checked:t.spotlight,disabled:c,onChange:e=>m({spotlight:e})}),(0,J.jsx)(o,{label:`When to use this agent`,children:(0,J.jsx)(a,{value:t.trigger,disabled:c,rows:3,maxLength:2e3,placeholder:`Describe matching requests. Leave empty for explicit use only.`,onChange:e=>m({trigger:e.target.value})})})]})]}),u===`instructions`&&(0,J.jsx)(ye,{profile:t,rules:r,disabled:c,onChange:l}),u===`context`&&(0,J.jsx)(pe,{vaultId:e,value:t.context,disabled:c,onChange:e=>m({context:e})}),u===`tools`&&(0,J.jsx)(xe,{profile:t,tools:n,disabled:c,onChange:l})]})})})}function Ce({vaultId:e,document:t,tools:n,rules:i=[],onClose:s,onSaved:c}){let l=f(),[d]=(0,z.useState)(()=>t?.source??G(W(`agent-${crypto.randomUUID().slice(0,8)}`,n.filter(e=>e.enabled).map(e=>e.name)))),[m,g]=(0,z.useState)(d),[_,y]=(0,z.useState)(!t?.profile&&!!t),[b,x]=(0,z.useState)(!1),[S,w]=(0,z.useState)(t?.error),T=(()=>{try{return K(m)}catch{return}})(),E=async()=>{(m===d||await l.confirm({title:`Discard agent changes?`,message:`Your changes have not been saved.`,confirmLabel:`Discard`}))&&s()},O=async()=>{w(void 0),x(!0);try{let n=t?.id??K(m).id;await P(e,n,m,t?.revision??null),c()}catch(e){w(e instanceof Error?e.message:`Could not save agent.`)}finally{x(!1)}};return(0,J.jsx)(u,{title:t?`Edit ${t.profile?.title??t.id}`:`Add workflow`,description:`Changes in every tab are saved together with Save workflow.`,size:`large`,className:`agent-profile-editor`,busy:b,onCancel:()=>void E(),actions:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(h,{onClick:()=>void E(),disabled:b,children:`Cancel`}),(0,J.jsx)(p,{}),(0,J.jsx)(h,{primary:!0,disabled:b,onClick:()=>void O(),children:b?`Saving…`:`Save workflow`})]}),children:(0,J.jsxs)(r,{onSubmit:e=>{e.preventDefault(),O()},children:[(0,J.jsx)(`div`,{className:`agent-profile-editor-mode`,children:(0,J.jsx)(v,{label:`Editor mode`,value:_?`yaml`:`form`,disabled:b,options:[{value:`form`,label:`Form`,icon:(0,J.jsx)(L,{})},{value:`yaml`,label:`YAML`,icon:(0,J.jsx)(D,{})}],onValueChange:e=>{e===`form`&&!T?w(`Correct the YAML before switching to the form.`):y(e===`yaml`)}})}),_?(0,J.jsx)(o,{label:`Agent YAML`,children:(0,J.jsx)(a,{className:`agent-profile-source`,value:m,rows:24,disabled:b,onChange:e=>g(e.target.value)})}):T&&(0,J.jsx)(Se,{vaultId:e,profile:T,tools:n,rules:i,isNew:!t,disabled:b,onChange:e=>g(G(e))}),S&&(0,J.jsx)(C,{as:`p`,size:`small`,tone:`danger`,role:`alert`,children:S})]})})}function $({vaultId:e,onClose:t}){let n=f(),[r,i]=(0,z.useState)(),[s,c]=(0,z.useState)(``),[l,d]=(0,z.useState)(!1),[m,g]=(0,z.useState)();(0,z.useEffect)(()=>{let t=!0;return j(e).then(e=>{t&&(i(e),c(e.source))}).catch(e=>{t&&g(e instanceof Error?e.message:String(e))}),()=>{t=!1}},[e]);let _=async()=>{(!r||s===r.source||await n.confirm({title:`Discard routing changes?`,message:`Your changes have not been saved.`,confirmLabel:`Discard`}))&&t()},v=async()=>{if(r){d(!0),g(void 0);try{await N(e,s,r.revision),t()}catch(e){g(e instanceof Error?e.message:String(e))}finally{d(!1)}}};return(0,J.jsxs)(u,{title:`Agent routing`,description:`Prefer Jev when connected; otherwise use a lightweight available chat model.`,size:`large`,busy:l,onCancel:()=>void _(),actions:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(h,{onClick:()=>void _(),disabled:l,children:`Cancel`}),(0,J.jsx)(p,{}),(0,J.jsx)(h,{primary:!0,disabled:l||!r,onClick:()=>void v(),children:`Save routing`})]}),children:[(0,J.jsx)(C,{as:`p`,size:`small`,tone:`muted`,children:`Each strategy has its own prompt. Add an exact model ID under modelPrompts to override that model’s prompt. The timeout covers routing only; the selected agent uses the conversation’s model.`}),(0,J.jsx)(o,{label:`Routing YAML`,children:(0,J.jsx)(a,{className:`agent-profile-source`,rows:22,value:s,disabled:l||!r,onChange:e=>c(e.target.value)})}),m&&(0,J.jsx)(C,{as:`p`,size:`small`,tone:`danger`,role:`alert`,children:m})]})}function we({vaultId:e,vaultLabel:t,onClose:n}){let r=y(e),i=f(),[s,l]=(0,z.useState)(),[p,m]=(0,z.useState)(!1),[g,v]=(0,z.useState)(``),[b,x]=(0,z.useState)(),[S,w]=(0,z.useState)(!1),[D,O]=(0,z.useState)(),A=async t=>{if(await i.confirm({title:`Delete ${t.profile?.title??t.id}?`,message:`This removes its definition. Running turns keep their existing definition.`,confirmLabel:`Delete`}))try{await F(e,t.id,t.revision),await r.reload()}catch(e){O(e instanceof Error?e.message:String(e))}},j=r.profiles.map(e=>{let t=e.profile?.title??e.id;return{id:e.id,title:`${t}${e.profile?.enabled===!1?` · Disabled`:``}`,description:e.error?(0,J.jsx)(C,{as:`span`,size:`caption`,tone:`danger`,children:e.error}):e.profile?.description??`Invalid definition`,ariaLabel:`Open ${t}`,keyboardItem:!0,actions:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(T,{size:`small`,variant:`ghost`,"aria-label":`Edit ${t}`,title:`Edit workflow`,onClick:()=>l(e),children:(0,J.jsx)(E,{"aria-hidden":`true`})}),(0,J.jsx)(T,{size:`small`,variant:`ghost`,"aria-label":`Delete ${t}`,title:`Delete workflow`,onClick:()=>void A(e),children:(0,J.jsx)(k,{"aria-hidden":`true`})})]})}}),M=async()=>{w(!0),O(void 0),x(void 0);try{x(await I(e,g))}catch(e){O(e instanceof Error?e.message:String(e))}finally{w(!1)}};return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(u,{title:`Workflows`,description:`Workflows defined for ${t}.`,size:`large`,onCancel:n,actions:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(h,{onClick:()=>m(!0),children:`Routing settings`}),(0,J.jsx)(h,{primary:!0,onClick:()=>l(`new`),children:`Add workflow`})]}),children:(0,J.jsxs)(`div`,{className:`agent-profile-manager`,children:[(0,J.jsx)(C,{as:`p`,size:`small`,tone:`muted`,children:`A workflow is an agent with its own instructions and a restricted set of tools. Automatic routing checks its trigger before each new message.`}),r.loading?(0,J.jsx)(d,{status:`loading`,children:`Loading workflows…`}):(0,J.jsx)(c,{className:`agent-profile-list`,"aria-label":`Workflows`,trailingSeparator:!1,items:j,emptyState:(0,J.jsx)(d,{status:`empty`,density:`inline`,children:`No workflows in this vault yet.`}),onSelect:e=>{let t=r.profiles.find(t=>t.id===e);t&&l(t)}}),(0,J.jsx)(o,{label:`Try routing`,children:(0,J.jsx)(a,{value:g,rows:3,maxLength:6e3,placeholder:`Describe a request to see which agent would handle it.`,onChange:e=>v(e.target.value)})}),(0,J.jsx)(_,{disabled:S||!g.trim(),onClick:()=>void M(),children:S?`Choosing agent…`:`Choose agent without running it`}),b&&(0,J.jsxs)(C,{as:`p`,size:`small`,role:`status`,children:[`Selected: `,r.profiles.find(e=>e.id===b.profileId)?.profile?.title??`Default agent`,` · `,b.router.strategy,b.router.modelId?` · ${b.router.modelId}`:``,b.router.durationMs===void 0?``:` · ${b.router.durationMs} ms`,b.router.fallback?` · ${b.router.fallback}`:``]}),(r.error||D)&&(0,J.jsx)(C,{as:`p`,size:`small`,tone:`danger`,role:`alert`,children:D??r.error})]})}),s&&(0,J.jsx)(Ce,{vaultId:e,document:typeof s==`string`?void 0:s,tools:r.tools,rules:r.rules,onClose:()=>l(void 0),onSaved:()=>{l(void 0),r.reload()}},typeof s==`string`?s:`${s.id}:${s.revision}`),p&&(0,J.jsx)($,{vaultId:e,onClose:()=>m(!1)})]})}function Te(){let e=m(),[t,n]=(0,z.useState)(!1);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(i,{label:`Workflows`,description:`Agents with their own instructions, allowed tools and automatic routing for this vault.`,layout:`control`,persistence:`custom`,children:(0,J.jsx)(_,{disabled:e.loading,onClick:()=>n(!0),children:`Manage workflows`})}),t&&(0,J.jsx)(we,{vaultId:e.id,vaultLabel:e.label,onClose:()=>n(!1)},e.id)]})}var Ee={contributions:[{id:`agent-profiles`,sectionId:`agent`,priority:600,persistence:`custom`,Component:Te}]};export{Ee as agentProfilesSettingsModule};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{n as t}from"./Desktop.es-DVtEXtRb.js";import{m as n,t as r}from"./react-B3NTyEzE.js";import{z as i}from"./icons-CxH3_W-q.js";import{c as a}from"./settings-ChT117Ke.js";import{ar as o,rr as s,wn as c}from"./index-CCUyKE6q.js";var l=e(n(),1),u=new Map([[`bold`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M236.37,139.4a12,12,0,0,0-12-3A84.07,84.07,0,0,1,119.6,31.59a12,12,0,0,0-15-15A108.86,108.86,0,0,0,49.69,55.07,108,108,0,0,0,136,228a107.09,107.09,0,0,0,64.93-21.69,108.86,108.86,0,0,0,38.44-54.94A12,12,0,0,0,236.37,139.4Zm-49.88,47.74A84,84,0,0,1,68.86,69.51,84.93,84.93,0,0,1,92.27,48.29Q92,52.13,92,56A108.12,108.12,0,0,0,200,164q3.87,0,7.71-.27A84.79,84.79,0,0,1,186.49,187.14Z`}))],[`duotone`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M227.89,147.89A96,96,0,1,1,108.11,28.11,96.09,96.09,0,0,0,227.89,147.89Z`,opacity:`0.2`}),l.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`fill`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M235.54,150.21a104.84,104.84,0,0,1-37,52.91A104,104,0,0,1,32,120,103.09,103.09,0,0,1,52.88,57.48a104.84,104.84,0,0,1,52.91-37,8,8,0,0,1,10,10,88.08,88.08,0,0,0,109.8,109.8,8,8,0,0,1,10,10Z`}))],[`light`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M232.13,143.64a6,6,0,0,0-6-1.49A90.07,90.07,0,0,1,113.86,29.85a6,6,0,0,0-7.49-7.48A102.88,102.88,0,0,0,54.48,58.68,102,102,0,0,0,197.32,201.52a102.88,102.88,0,0,0,36.31-51.89A6,6,0,0,0,232.13,143.64Zm-42,48.29a90,90,0,0,1-126-126A90.9,90.9,0,0,1,99.65,37.66,102.06,102.06,0,0,0,218.34,156.35,90.9,90.9,0,0,1,190.1,191.93Z`}))],[`regular`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`thin`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M230.72,145.06a4,4,0,0,0-4-1A92.08,92.08,0,0,1,111.94,29.27a4,4,0,0,0-5-5A100.78,100.78,0,0,0,56.08,59.88a100,100,0,0,0,140,140,100.78,100.78,0,0,0,35.59-50.87A4,4,0,0,0,230.72,145.06ZM191.3,193.53A92,92,0,0,1,62.47,64.7a93,93,0,0,1,39.88-30.35,100.09,100.09,0,0,0,119.3,119.3A93,93,0,0,1,191.3,193.53Z`}))]]),d=l.forwardRef((e,t)=>l.createElement(i,{ref:t,...e,weights:u}));d.displayName=`MoonIcon`;var f=new Map([[`bold`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M116,36V20a12,12,0,0,1,24,0V36a12,12,0,0,1-24,0Zm80,92a68,68,0,1,1-68-68A68.07,68.07,0,0,1,196,128Zm-24,0a44,44,0,1,0-44,44A44.05,44.05,0,0,0,172,128ZM51.51,68.49a12,12,0,1,0,17-17l-12-12a12,12,0,0,0-17,17Zm0,119-12,12a12,12,0,0,0,17,17l12-12a12,12,0,1,0-17-17ZM196,72a12,12,0,0,0,8.49-3.51l12-12a12,12,0,0,0-17-17l-12,12A12,12,0,0,0,196,72Zm8.49,115.51a12,12,0,0,0-17,17l12,12a12,12,0,0,0,17-17ZM48,128a12,12,0,0,0-12-12H20a12,12,0,0,0,0,24H36A12,12,0,0,0,48,128Zm80,80a12,12,0,0,0-12,12v16a12,12,0,0,0,24,0V220A12,12,0,0,0,128,208Zm108-92H220a12,12,0,0,0,0,24h16a12,12,0,0,0,0-24Z`}))],[`duotone`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z`,opacity:`0.2`}),l.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`fill`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm8,24a64,64,0,1,0,64,64A64.07,64.07,0,0,0,128,64ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`light`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M122,40V16a6,6,0,0,1,12,0V40a6,6,0,0,1-12,0Zm68,88a62,62,0,1,1-62-62A62.07,62.07,0,0,1,190,128Zm-12,0a50,50,0,1,0-50,50A50.06,50.06,0,0,0,178,128ZM59.76,68.24a6,6,0,1,0,8.48-8.48l-16-16a6,6,0,0,0-8.48,8.48Zm0,119.52-16,16a6,6,0,1,0,8.48,8.48l16-16a6,6,0,1,0-8.48-8.48ZM192,70a6,6,0,0,0,4.24-1.76l16-16a6,6,0,0,0-8.48-8.48l-16,16A6,6,0,0,0,192,70Zm4.24,117.76a6,6,0,0,0-8.48,8.48l16,16a6,6,0,0,0,8.48-8.48ZM46,128a6,6,0,0,0-6-6H16a6,6,0,0,0,0,12H40A6,6,0,0,0,46,128Zm82,82a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V216A6,6,0,0,0,128,210Zm112-88H216a6,6,0,0,0,0,12h24a6,6,0,0,0,0-12Z`}))],[`regular`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`thin`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M124,40V16a4,4,0,0,1,8,0V40a4,4,0,0,1-8,0Zm64,88a60,60,0,1,1-60-60A60.07,60.07,0,0,1,188,128Zm-8,0a52,52,0,1,0-52,52A52.06,52.06,0,0,0,180,128ZM61.17,66.83a4,4,0,0,0,5.66-5.66l-16-16a4,4,0,0,0-5.66,5.66Zm0,122.34-16,16a4,4,0,0,0,5.66,5.66l16-16a4,4,0,0,0-5.66-5.66ZM192,68a4,4,0,0,0,2.83-1.17l16-16a4,4,0,1,0-5.66-5.66l-16,16A4,4,0,0,0,192,68Zm2.83,121.17a4,4,0,0,0-5.66,5.66l16,16a4,4,0,0,0,5.66-5.66ZM40,124H16a4,4,0,0,0,0,8H40a4,4,0,0,0,0-8Zm88,88a4,4,0,0,0-4,4v24a4,4,0,0,0,8,0V216A4,4,0,0,0,128,212Zm112-88H216a4,4,0,0,0,0,8h24a4,4,0,0,0,0-8Z`}))]]),p=l.forwardRef((e,t)=>l.createElement(i,{ref:t,...e,weights:f}));p.displayName=`SunIcon`;var m=r(),h=[{value:`system`,label:`System`,icon:(0,m.jsx)(t,{})},{value:`light`,label:`Light`,icon:(0,m.jsx)(p,{})},{value:`dark`,label:`Dark`,icon:(0,m.jsx)(d,{})}];function g(){let{theme:e,ready:t,error:n,setTheme:r}=c();return(0,m.jsxs)(a,{label:`Theme`,description:`Follow the device, or pin the app to light or dark.`,persistence:`immediate`,layout:`control`,className:`theme-setting`,children:[(0,m.jsx)(s,{label:`Theme`,value:e,options:h,disabled:!t,onValueChange:r}),n&&(0,m.jsxs)(o,{as:`small`,size:`caption`,tone:`danger`,className:`settings-inline-error`,role:`alert`,children:[`Unavailable: `,n]})]})}var _={contributions:[{id:`theme`,sectionId:`general`,priority:150,persistence:`immediate`,Component:g}]};export{_ as appearanceSettingsModule};
1
+ import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{n as t}from"./Desktop.es-DVtEXtRb.js";import{m as n,t as r}from"./react-B3NTyEzE.js";import{z as i}from"./icons-CxH3_W-q.js";import{c as a}from"./settings-CU8YR8di.js";import{En as o,ar as s,sr as c}from"./index-BVDhmwI8.js";var l=e(n(),1),u=new Map([[`bold`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M236.37,139.4a12,12,0,0,0-12-3A84.07,84.07,0,0,1,119.6,31.59a12,12,0,0,0-15-15A108.86,108.86,0,0,0,49.69,55.07,108,108,0,0,0,136,228a107.09,107.09,0,0,0,64.93-21.69,108.86,108.86,0,0,0,38.44-54.94A12,12,0,0,0,236.37,139.4Zm-49.88,47.74A84,84,0,0,1,68.86,69.51,84.93,84.93,0,0,1,92.27,48.29Q92,52.13,92,56A108.12,108.12,0,0,0,200,164q3.87,0,7.71-.27A84.79,84.79,0,0,1,186.49,187.14Z`}))],[`duotone`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M227.89,147.89A96,96,0,1,1,108.11,28.11,96.09,96.09,0,0,0,227.89,147.89Z`,opacity:`0.2`}),l.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`fill`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M235.54,150.21a104.84,104.84,0,0,1-37,52.91A104,104,0,0,1,32,120,103.09,103.09,0,0,1,52.88,57.48a104.84,104.84,0,0,1,52.91-37,8,8,0,0,1,10,10,88.08,88.08,0,0,0,109.8,109.8,8,8,0,0,1,10,10Z`}))],[`light`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M232.13,143.64a6,6,0,0,0-6-1.49A90.07,90.07,0,0,1,113.86,29.85a6,6,0,0,0-7.49-7.48A102.88,102.88,0,0,0,54.48,58.68,102,102,0,0,0,197.32,201.52a102.88,102.88,0,0,0,36.31-51.89A6,6,0,0,0,232.13,143.64Zm-42,48.29a90,90,0,0,1-126-126A90.9,90.9,0,0,1,99.65,37.66,102.06,102.06,0,0,0,218.34,156.35,90.9,90.9,0,0,1,190.1,191.93Z`}))],[`regular`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`thin`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M230.72,145.06a4,4,0,0,0-4-1A92.08,92.08,0,0,1,111.94,29.27a4,4,0,0,0-5-5A100.78,100.78,0,0,0,56.08,59.88a100,100,0,0,0,140,140,100.78,100.78,0,0,0,35.59-50.87A4,4,0,0,0,230.72,145.06ZM191.3,193.53A92,92,0,0,1,62.47,64.7a93,93,0,0,1,39.88-30.35,100.09,100.09,0,0,0,119.3,119.3A93,93,0,0,1,191.3,193.53Z`}))]]),d=l.forwardRef((e,t)=>l.createElement(i,{ref:t,...e,weights:u}));d.displayName=`MoonIcon`;var f=new Map([[`bold`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M116,36V20a12,12,0,0,1,24,0V36a12,12,0,0,1-24,0Zm80,92a68,68,0,1,1-68-68A68.07,68.07,0,0,1,196,128Zm-24,0a44,44,0,1,0-44,44A44.05,44.05,0,0,0,172,128ZM51.51,68.49a12,12,0,1,0,17-17l-12-12a12,12,0,0,0-17,17Zm0,119-12,12a12,12,0,0,0,17,17l12-12a12,12,0,1,0-17-17ZM196,72a12,12,0,0,0,8.49-3.51l12-12a12,12,0,0,0-17-17l-12,12A12,12,0,0,0,196,72Zm8.49,115.51a12,12,0,0,0-17,17l12,12a12,12,0,0,0,17-17ZM48,128a12,12,0,0,0-12-12H20a12,12,0,0,0,0,24H36A12,12,0,0,0,48,128Zm80,80a12,12,0,0,0-12,12v16a12,12,0,0,0,24,0V220A12,12,0,0,0,128,208Zm108-92H220a12,12,0,0,0,0,24h16a12,12,0,0,0,0-24Z`}))],[`duotone`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z`,opacity:`0.2`}),l.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`fill`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm8,24a64,64,0,1,0,64,64A64.07,64.07,0,0,0,128,64ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`light`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M122,40V16a6,6,0,0,1,12,0V40a6,6,0,0,1-12,0Zm68,88a62,62,0,1,1-62-62A62.07,62.07,0,0,1,190,128Zm-12,0a50,50,0,1,0-50,50A50.06,50.06,0,0,0,178,128ZM59.76,68.24a6,6,0,1,0,8.48-8.48l-16-16a6,6,0,0,0-8.48,8.48Zm0,119.52-16,16a6,6,0,1,0,8.48,8.48l16-16a6,6,0,1,0-8.48-8.48ZM192,70a6,6,0,0,0,4.24-1.76l16-16a6,6,0,0,0-8.48-8.48l-16,16A6,6,0,0,0,192,70Zm4.24,117.76a6,6,0,0,0-8.48,8.48l16,16a6,6,0,0,0,8.48-8.48ZM46,128a6,6,0,0,0-6-6H16a6,6,0,0,0,0,12H40A6,6,0,0,0,46,128Zm82,82a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V216A6,6,0,0,0,128,210Zm112-88H216a6,6,0,0,0,0,12h24a6,6,0,0,0,0-12Z`}))],[`regular`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`thin`,l.createElement(l.Fragment,null,l.createElement(`path`,{d:`M124,40V16a4,4,0,0,1,8,0V40a4,4,0,0,1-8,0Zm64,88a60,60,0,1,1-60-60A60.07,60.07,0,0,1,188,128Zm-8,0a52,52,0,1,0-52,52A52.06,52.06,0,0,0,180,128ZM61.17,66.83a4,4,0,0,0,5.66-5.66l-16-16a4,4,0,0,0-5.66,5.66Zm0,122.34-16,16a4,4,0,0,0,5.66,5.66l16-16a4,4,0,0,0-5.66-5.66ZM192,68a4,4,0,0,0,2.83-1.17l16-16a4,4,0,1,0-5.66-5.66l-16,16A4,4,0,0,0,192,68Zm2.83,121.17a4,4,0,0,0-5.66,5.66l16,16a4,4,0,0,0,5.66-5.66ZM40,124H16a4,4,0,0,0,0,8H40a4,4,0,0,0,0-8Zm88,88a4,4,0,0,0-4,4v24a4,4,0,0,0,8,0V216A4,4,0,0,0,128,212Zm112-88H216a4,4,0,0,0,0,8h24a4,4,0,0,0,0-8Z`}))]]),p=l.forwardRef((e,t)=>l.createElement(i,{ref:t,...e,weights:f}));p.displayName=`SunIcon`;var m=r(),h=[{value:`system`,label:`System`,icon:(0,m.jsx)(t,{})},{value:`light`,label:`Light`,icon:(0,m.jsx)(p,{})},{value:`dark`,label:`Dark`,icon:(0,m.jsx)(d,{})}];function g(){let{theme:e,ready:t,error:n,setTheme:r}=o();return(0,m.jsxs)(a,{label:`Theme`,description:`Follow the device, or pin the app to light or dark.`,persistence:`immediate`,layout:`control`,className:`theme-setting`,children:[(0,m.jsx)(s,{label:`Theme`,value:e,options:h,disabled:!t,onValueChange:r}),n&&(0,m.jsxs)(c,{as:`small`,size:`caption`,tone:`danger`,className:`settings-inline-error`,role:`alert`,children:[`Unavailable: `,n]})]})}var _={contributions:[{id:`theme`,sectionId:`general`,priority:150,persistence:`immediate`,Component:g}]};export{_ as appearanceSettingsModule};
@@ -1,4 +1,4 @@
1
- import"./note-excalidraw-editor-RjnG4My9.js";var e={paste:`لصق`,pasteAsPlaintext:`اللصق كنص عادي`,pasteCharts:`لصق الرسوم البيانية`,selectAll:`تحديد الكل`,multiSelect:`إضافة عنصر للتحديد`,moveCanvas:`نقل لوح الرسم`,cut:`قص`,copy:`نسخ`,copyAsPng:`نسخ إلى الحافظة بصيغة PNG`,copyAsSvg:`نسخ إلى الحافظة بصيغة SVG`,copyText:`نسخ إلى الحافظة كنص`,copySource:``,convertToCode:``,bringForward:`جلب للأمام`,sendToBack:`أرسل للخلف`,bringToFront:`أحضر للأمام`,sendBackward:`أرسل للخلف`,delete:`حذف`,copyStyles:`نسخ الأنماط`,pasteStyles:`لصق الأنماط`,stroke:`الخط`,background:`الخلفية`,fill:`التعبئة`,strokeWidth:`سُمك الخط`,strokeStyle:`نمط الخط`,strokeStyle_solid:`متصل`,strokeStyle_dashed:`متقطع`,strokeStyle_dotted:`منقط`,sloppiness:`الإمالة`,opacity:`الشفافية`,textAlign:`محاذاة النص`,edges:`الحواف`,sharp:`حادة`,round:`دائرية`,arrowheads:`رؤوس الأسهم`,arrowhead_none:`لا شيء`,arrowhead_arrow:`سهم`,arrowhead_bar:`شريط`,arrowhead_circle:``,arrowhead_circle_outline:``,arrowhead_triangle:`مثلث`,arrowhead_triangle_outline:``,arrowhead_diamond:``,arrowhead_diamond_outline:``,fontSize:`حجم الخط`,fontFamily:`نوع الخط`,addWatermark:`إضافة "مصنوعة بواسطة Excalidraw"`,handDrawn:`رسم باليد`,normal:`عادي`,code:`رمز`,small:`صغير`,medium:`متوسط`,large:`كبير`,veryLarge:`كبير جدا`,solid:`كامل`,hachure:`خطوط`,zigzag:`متعرج`,crossHatch:`خطوط متقطعة`,thin:`نحيف`,bold:`داكن`,left:`الـيسار`,center:`وسط`,right:`يمين`,extraBold:`عريض`,architect:`معماري`,artist:`رسام`,cartoonist:`كرتوني`,fileTitle:`إسم الملف`,colorPicker:`منتقي اللون`,canvasColors:`تستخدم على القماش`,canvasBackground:`خلفية اللوحة`,drawingCanvas:`لوحة الرسم`,layers:`الطبقات`,actions:`الإجراءات`,language:`اللغة`,liveCollaboration:`التعاون المباشر...`,duplicateSelection:`تكرار`,untitled:`غير معنون`,name:`الاسم`,yourName:`اسمك`,madeWithExcalidraw:`مصنوعة بواسطة Excalidraw`,group:`تحديد مجموعة`,ungroup:`إلغاء تحديد مجموعة`,collaborators:`المتعاونون`,showGrid:`إظهار الشبكة`,addToLibrary:`أضف إلى المكتبة`,removeFromLibrary:`حذف من المكتبة`,libraryLoadingMessage:`جارٍ تحميل المكتبة…`,libraries:`تصفح المكتبات`,loadingScene:`جاري تحميل المشهد…`,align:`محاذاة`,alignTop:`محاذاة إلى اﻷعلى`,alignBottom:`محاذاة إلى اﻷسفل`,alignLeft:`محاذاة إلى اليسار`,alignRight:`محاذاة إلى اليمين`,centerVertically:`توسيط عمودي`,centerHorizontally:`توسيط أفقي`,distributeHorizontally:`التوزيع الأفقي`,distributeVertically:`التوزيع عمودياً`,flipHorizontal:`قلب عامودي`,flipVertical:`قلب أفقي`,viewMode:`نمط العرض`,share:`مشاركة`,showStroke:`إظهار منتقي لون الخط`,showBackground:`إظهار منتقي لون الخلفية`,toggleTheme:`غير النمط`,personalLib:`المكتبة الشخصية`,excalidrawLib:`مكتبتنا`,decreaseFontSize:`تصغير حجم الخط`,increaseFontSize:`تكبير حجم الخط`,unbindText:`فك ربط النص`,bindText:`ربط النص بالحاوية`,createContainerFromText:`نص مغلف في حاوية`,link:{edit:`تعديل الرابط`,editEmbed:`تحرير الرابط وإدراجه`,create:`إنشاء رابط`,createEmbed:`إنشاء رابط و إدراجه`,label:`رابط`,labelEmbed:`رابط و إدراج`,empty:`لم يتم تعيين رابط`},lineEditor:{edit:`تحرير السطر`,exit:`الخروج من المُحرر`},elementLock:{lock:`قفل`,unlock:`فتح`,lockAll:`قفل الكل`,unlockAll:`فتح الكل`},statusPublished:`نُشر`,sidebarLock:`إبقاء الشريط الجانبي مفتوح`,selectAllElementsInFrame:`تحديد جميع العناصر في الإطار`,removeAllElementsFromFrame:`إزالة جميع العناصر من الإطار`,eyeDropper:`اختيار اللون من القماش`,textToDiagram:``,prompt:``},t={noItems:`لا توجد عناصر أضيفت بعد...`,hint_emptyLibrary:`حدد عنصر على القماش لإضافته هنا، أو تثبيت مكتبة من المستودع العام أدناه.`,hint_emptyPrivateLibrary:`حدد عنصر على القماش لإضافته هنا.`},n={clearReset:`إعادة تعيين اللوحة`,exportJSON:`صدر الملف`,exportImage:`تصدير الصورة...`,export:`حفظ إلى...`,copyToClipboard:`نسخ إلى الحافظة`,save:`احفظ للملف الحالي`,saveAs:`حفظ كـ`,load:`فتح`,getShareableLink:`احصل على رابط المشاركة`,close:`غلق`,selectLanguage:`اختر اللغة`,scrollBackToContent:`الرجوع إلى المحتوى`,zoomIn:`تكبير`,zoomOut:`تصغير`,resetZoom:`إعادة تعيين الشاشة`,menu:`القائمة`,done:`تم`,edit:`تعديل`,undo:`تراجع`,redo:`إعادة تنفيذ`,resetLibrary:`إعادة ضبط المكتبة`,createNewRoom:`إنشاء غرفة جديدة`,fullScreen:`شاشة كاملة`,darkMode:`الوضع المظلم`,lightMode:`الوضع المضيء`,zenMode:`وضع التأمل`,objectsSnapMode:`التقط إلى العناصر`,exitZenMode:`إلغاء الوضع الليلى`,cancel:`إلغاء`,clear:`مسح`,remove:`إزالة`,embed:`تبديل الإدراج`,publishLibrary:`انشر`,submit:`أرسل`,confirm:`تأكيد`,embeddableInteractionButton:`اضغط للتفاعل`},r={clearReset:`هذا سيُزيل كامل اللوحة. هل أنت متأكد؟`,couldNotCreateShareableLink:`تعذر إنشاء رابطة المشاركة.`,couldNotCreateShareableLinkTooBig:`تعذر إنشاء رابط قابل للمشاركة: المشهد كبير جدًا`,couldNotLoadInvalidFile:`تعذر التحميل، الملف غير صالح`,importBackendFailed:`فشل الاستيراد من الخادوم.`,cannotExportEmptyCanvas:`لا يمكن تصدير لوحة فارغة.`,couldNotCopyToClipboard:`تعذر النسخ إلى الحافظة.`,decryptFailed:`تعذر فك تشفير البيانات.`,uploadedSecurly:`تم تأمين التحميل بتشفير النهاية إلى النهاية، مما يعني أن خادوم Excalidraw والأطراف الثالثة لا يمكنها قراءة المحتوى.`,loadSceneOverridePrompt:`تحميل الرسم الخارجي سيحل محل المحتوى الموجود لديك. هل ترغب في المتابعة؟`,collabStopOverridePrompt:`إيقاف الجلسة سيؤدي إلى الكتابة فوق رسومك السابقة المخزنة داخليا. هل أنت متأكد؟
1
+ import"./note-excalidraw-editor-fDQ1JVBh.js";var e={paste:`لصق`,pasteAsPlaintext:`اللصق كنص عادي`,pasteCharts:`لصق الرسوم البيانية`,selectAll:`تحديد الكل`,multiSelect:`إضافة عنصر للتحديد`,moveCanvas:`نقل لوح الرسم`,cut:`قص`,copy:`نسخ`,copyAsPng:`نسخ إلى الحافظة بصيغة PNG`,copyAsSvg:`نسخ إلى الحافظة بصيغة SVG`,copyText:`نسخ إلى الحافظة كنص`,copySource:``,convertToCode:``,bringForward:`جلب للأمام`,sendToBack:`أرسل للخلف`,bringToFront:`أحضر للأمام`,sendBackward:`أرسل للخلف`,delete:`حذف`,copyStyles:`نسخ الأنماط`,pasteStyles:`لصق الأنماط`,stroke:`الخط`,background:`الخلفية`,fill:`التعبئة`,strokeWidth:`سُمك الخط`,strokeStyle:`نمط الخط`,strokeStyle_solid:`متصل`,strokeStyle_dashed:`متقطع`,strokeStyle_dotted:`منقط`,sloppiness:`الإمالة`,opacity:`الشفافية`,textAlign:`محاذاة النص`,edges:`الحواف`,sharp:`حادة`,round:`دائرية`,arrowheads:`رؤوس الأسهم`,arrowhead_none:`لا شيء`,arrowhead_arrow:`سهم`,arrowhead_bar:`شريط`,arrowhead_circle:``,arrowhead_circle_outline:``,arrowhead_triangle:`مثلث`,arrowhead_triangle_outline:``,arrowhead_diamond:``,arrowhead_diamond_outline:``,fontSize:`حجم الخط`,fontFamily:`نوع الخط`,addWatermark:`إضافة "مصنوعة بواسطة Excalidraw"`,handDrawn:`رسم باليد`,normal:`عادي`,code:`رمز`,small:`صغير`,medium:`متوسط`,large:`كبير`,veryLarge:`كبير جدا`,solid:`كامل`,hachure:`خطوط`,zigzag:`متعرج`,crossHatch:`خطوط متقطعة`,thin:`نحيف`,bold:`داكن`,left:`الـيسار`,center:`وسط`,right:`يمين`,extraBold:`عريض`,architect:`معماري`,artist:`رسام`,cartoonist:`كرتوني`,fileTitle:`إسم الملف`,colorPicker:`منتقي اللون`,canvasColors:`تستخدم على القماش`,canvasBackground:`خلفية اللوحة`,drawingCanvas:`لوحة الرسم`,layers:`الطبقات`,actions:`الإجراءات`,language:`اللغة`,liveCollaboration:`التعاون المباشر...`,duplicateSelection:`تكرار`,untitled:`غير معنون`,name:`الاسم`,yourName:`اسمك`,madeWithExcalidraw:`مصنوعة بواسطة Excalidraw`,group:`تحديد مجموعة`,ungroup:`إلغاء تحديد مجموعة`,collaborators:`المتعاونون`,showGrid:`إظهار الشبكة`,addToLibrary:`أضف إلى المكتبة`,removeFromLibrary:`حذف من المكتبة`,libraryLoadingMessage:`جارٍ تحميل المكتبة…`,libraries:`تصفح المكتبات`,loadingScene:`جاري تحميل المشهد…`,align:`محاذاة`,alignTop:`محاذاة إلى اﻷعلى`,alignBottom:`محاذاة إلى اﻷسفل`,alignLeft:`محاذاة إلى اليسار`,alignRight:`محاذاة إلى اليمين`,centerVertically:`توسيط عمودي`,centerHorizontally:`توسيط أفقي`,distributeHorizontally:`التوزيع الأفقي`,distributeVertically:`التوزيع عمودياً`,flipHorizontal:`قلب عامودي`,flipVertical:`قلب أفقي`,viewMode:`نمط العرض`,share:`مشاركة`,showStroke:`إظهار منتقي لون الخط`,showBackground:`إظهار منتقي لون الخلفية`,toggleTheme:`غير النمط`,personalLib:`المكتبة الشخصية`,excalidrawLib:`مكتبتنا`,decreaseFontSize:`تصغير حجم الخط`,increaseFontSize:`تكبير حجم الخط`,unbindText:`فك ربط النص`,bindText:`ربط النص بالحاوية`,createContainerFromText:`نص مغلف في حاوية`,link:{edit:`تعديل الرابط`,editEmbed:`تحرير الرابط وإدراجه`,create:`إنشاء رابط`,createEmbed:`إنشاء رابط و إدراجه`,label:`رابط`,labelEmbed:`رابط و إدراج`,empty:`لم يتم تعيين رابط`},lineEditor:{edit:`تحرير السطر`,exit:`الخروج من المُحرر`},elementLock:{lock:`قفل`,unlock:`فتح`,lockAll:`قفل الكل`,unlockAll:`فتح الكل`},statusPublished:`نُشر`,sidebarLock:`إبقاء الشريط الجانبي مفتوح`,selectAllElementsInFrame:`تحديد جميع العناصر في الإطار`,removeAllElementsFromFrame:`إزالة جميع العناصر من الإطار`,eyeDropper:`اختيار اللون من القماش`,textToDiagram:``,prompt:``},t={noItems:`لا توجد عناصر أضيفت بعد...`,hint_emptyLibrary:`حدد عنصر على القماش لإضافته هنا، أو تثبيت مكتبة من المستودع العام أدناه.`,hint_emptyPrivateLibrary:`حدد عنصر على القماش لإضافته هنا.`},n={clearReset:`إعادة تعيين اللوحة`,exportJSON:`صدر الملف`,exportImage:`تصدير الصورة...`,export:`حفظ إلى...`,copyToClipboard:`نسخ إلى الحافظة`,save:`احفظ للملف الحالي`,saveAs:`حفظ كـ`,load:`فتح`,getShareableLink:`احصل على رابط المشاركة`,close:`غلق`,selectLanguage:`اختر اللغة`,scrollBackToContent:`الرجوع إلى المحتوى`,zoomIn:`تكبير`,zoomOut:`تصغير`,resetZoom:`إعادة تعيين الشاشة`,menu:`القائمة`,done:`تم`,edit:`تعديل`,undo:`تراجع`,redo:`إعادة تنفيذ`,resetLibrary:`إعادة ضبط المكتبة`,createNewRoom:`إنشاء غرفة جديدة`,fullScreen:`شاشة كاملة`,darkMode:`الوضع المظلم`,lightMode:`الوضع المضيء`,zenMode:`وضع التأمل`,objectsSnapMode:`التقط إلى العناصر`,exitZenMode:`إلغاء الوضع الليلى`,cancel:`إلغاء`,clear:`مسح`,remove:`إزالة`,embed:`تبديل الإدراج`,publishLibrary:`انشر`,submit:`أرسل`,confirm:`تأكيد`,embeddableInteractionButton:`اضغط للتفاعل`},r={clearReset:`هذا سيُزيل كامل اللوحة. هل أنت متأكد؟`,couldNotCreateShareableLink:`تعذر إنشاء رابطة المشاركة.`,couldNotCreateShareableLinkTooBig:`تعذر إنشاء رابط قابل للمشاركة: المشهد كبير جدًا`,couldNotLoadInvalidFile:`تعذر التحميل، الملف غير صالح`,importBackendFailed:`فشل الاستيراد من الخادوم.`,cannotExportEmptyCanvas:`لا يمكن تصدير لوحة فارغة.`,couldNotCopyToClipboard:`تعذر النسخ إلى الحافظة.`,decryptFailed:`تعذر فك تشفير البيانات.`,uploadedSecurly:`تم تأمين التحميل بتشفير النهاية إلى النهاية، مما يعني أن خادوم Excalidraw والأطراف الثالثة لا يمكنها قراءة المحتوى.`,loadSceneOverridePrompt:`تحميل الرسم الخارجي سيحل محل المحتوى الموجود لديك. هل ترغب في المتابعة؟`,collabStopOverridePrompt:`إيقاف الجلسة سيؤدي إلى الكتابة فوق رسومك السابقة المخزنة داخليا. هل أنت متأكد؟
2
2
 
3
3
  (إذا كنت ترغب في الاحتفاظ برسمك المخزن داخليا، ببساطة أغلق علامة تبويب المتصفح بدلاً من ذلك.)`,errorAddingToLibrary:`تعذر إضافة العنصر للمكتبة`,errorRemovingFromLibrary:`تعذر إزالة العنصر من المكتبة`,confirmAddLibrary:`هذا سيضيف {{numShapes}} شكل إلى مكتبتك. هل أنت متأكد؟`,imageDoesNotContainScene:`يبدو أن هذه الصورة لا تحتوي على أي بيانات مشهد. هل قمت بتمكين تضمين المشهد أثناء التصدير؟`,cannotRestoreFromImage:`تعذر استعادة المشهد من ملف الصورة`,invalidSceneUrl:`تعذر استيراد المشهد من عنوان URL المتوفر. إما أنها مشوهة، أو لا تحتوي على بيانات Excalidraw JSON صالحة.`,resetLibrary:`هذا سوف يمسح مكتبتك. هل أنت متأكد؟`,removeItemsFromsLibrary:`حذف {{count}} عنصر (عناصر) من المكتبة؟`,invalidEncryptionKey:`مفتاح التشفير يجب أن يكون من 22 حرفاً. التعاون المباشر معطل.`,collabOfflineWarning:`لا يوجد اتصال بالانترنت.
4
4
  لن يتم حفظ التغييرات التي قمت بها!`},i={unsupportedFileType:`نوع الملف غير مدعوم.`,imageInsertError:`تعذر إدراج الصورة. حاول مرة أخرى لاحقاً...`,fileTooBig:`الملف كبير جداً. الحد الأقصى المسموح به للحجم هو {{maxSize}}.`,svgImageInsertError:`تعذر إدراج صورة SVG. يبدو أن ترميز SVG غير صحيح.`,failedToFetchImage:``,invalidSVGString:`SVG غير صالح.`,cannotResolveCollabServer:`تعذر الاتصال بخادم التعاون. الرجاء إعادة تحميل الصفحة والمحاولة مرة أخرى.`,importLibraryError:`تعذر تحميل المكتبة`,collabSaveFailed:`تعذر الحفظ في قاعدة البيانات. إذا استمرت المشاكل، يفضل أن تحفظ ملفك محليا كي لا تفقد عملك.`,collabSaveFailed_sizeExceeded:`تعذر الحفظ في قاعدة البيانات، يبدو أن القماش كبير للغاية، يفضّل حفظ الملف محليا كي لا تفقد عملك.`,imageToolNotSupported:``,brave_measure_text_error:{line1:`يبدو أنك تستخدم متصفح Brave مع إعداد <bold>حظر صارم لتتبع البصمة</bold>.`,line2:`قد يؤدي هذا إلى كسر <bold>عناصر النص</bold> في الرسومات الخاصة بك.`,line3:`من المستحسن إلغاء تفعيل هذا الإعداد. يمكنك اتباع <link>هذه الخطوات</link> لفعل ذلك.`,line4:`إذا لم يصلح تعطيل هذا الإعداد طريقة عرض النصوص، الرجاء كتابة <issueLink>بلاغ</issueLink> على حسابنا في GitHub، أو راسلنا على <discordLink>Discord</discordLink>`},libraryElementTypeError:{embeddable:`لا يمكن إضافة العناصر القابلة للتضمين في المكتبة.`,iframe:``,image:`سوف يتم دعم إضافة صور إلى المكتبة قريباً!`},asyncPasteFailedOnRead:``,asyncPasteFailedOnParse:``,copyToSystemClipboardFailed:``},a={selection:`تحديد`,image:`إدراج صورة`,rectangle:`مستطيل`,diamond:`مضلع`,ellipse:`دائرة`,arrow:`سهم`,line:`خط`,freedraw:`رسم`,text:`نص`,library:`مكتبة`,lock:`الحفاظ على أداة التحديد نشطة بعد الرسم`,penMode:`وضع القلم - امنع اللمس`,link:`إضافة/تحديث الرابط للشكل المحدد`,eraser:`ممحاة`,frame:`أداة الإطار`,magicframe:``,embeddable:`تضمين ويب`,laser:`مؤشر ليزر`,hand:`يد (أداة الإزاحة)`,extraTools:`المزيد من أﻷدوات`,mermaidToExcalidraw:``,magicSettings:``},o={canvasActions:`إجراءات اللوحة`,selectedShapeActions:`إجراءات الشكل المحدد`,shapes:`الأشكال`},s={canvasPanning:`لتحريك القماش، اضغط على عجلة الفأرة أو مفتاح المسافة أثناء السحب، أو استخدم أداة اليد`,linearElement:`انقر لبدء نقاط متعددة، اسحب لخط واحد`,freeDraw:`انقر واسحب، افرج عند الانتهاء`,text:`نصيحة: يمكنك أيضًا إضافة نص بالنقر المزدوج في أي مكان بأداة الاختيار`,embeddable:`اضغط مع السحب لإنشاء موقع ويب مضمّن`,text_selected:`انقر نقراً مزدوجاً أو اضغط ادخال لتعديل النص`,text_editing:`اضغط على Esc أو (Ctrl أو Cmd) + Enter لإنهاء التعديل`,linearElementMulti:`انقر فوق النقطة الأخيرة أو اضغط على Esc أو Enter للإنهاء`,lockAngle:`يمكنك تقييد الزاوية بالضغط على SHIFT`,resize:`يمكنك تقييد النسب بالضغط على SHIFT أثناء تغيير الحجم،
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{m as t,t as n}from"./react-B3NTyEzE.js";import{br as r,gr as i,on as a,xr as o,yt as s}from"./index-CCUyKE6q.js";import{a as c,i as l,n as u,r as d,t as f}from"./pdf-view-Cm78nuSA.js";import{h as p}from"./icons-CxH3_W-q.js";import{n as m,r as h,t as g}from"./maximize-2-C6N1RKlt.js";import{s as _,t as v}from"./use-vault-file-link-C0ZO_VPm.js";import{So as y}from"./logic-BNk_20eJ.js";var b=e(t(),1),x=n();function S({scope:e,reference:t,form:n,kind:a,name:c,url:f,onError:_}){let[v,y]=(0,b.useState)(!1),[S,C]=(0,b.useState)(!1),w=s(),T=(0,x.jsx)(i,{size:`compact`,className:`attachment-embed-menu`,"aria-label":`Actions for ${c}`,title:`Actions`,children:(0,x.jsx)(p,{"aria-hidden":`true`})});return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(r,{open:v,onOpenChange:y,trigger:T,label:`Attachment`,placement:`bottom-start`,children:[(0,x.jsxs)(o,{onClick:()=>{y(!1),d(e,t,n,_)},title:t,children:[(0,x.jsx)(h,{"aria-hidden":`true`}),`Open file`]}),a===`image`&&(0,x.jsxs)(o,{onClick:()=>{y(!1),C(!0)},children:[(0,x.jsx)(g,{"aria-hidden":`true`}),`Open large`]}),w&&(0,x.jsxs)(o,{onClick:()=>{y(!1),l(e,t,n,w,_)},children:[(0,x.jsx)(m,{"aria-hidden":`true`}),`Reveal in Files`]})]}),S&&(0,x.jsx)(u,{src:f,name:c,onClose:()=>C(!1)})]})}function C({scope:e,spec:t,variant:n=`inline`,onError:r}){let{link:i,failed:o,retry:s}=v(e,t.reference,t.form),[l,u]=(0,b.useState)(),p=e=>(0,x.jsx)(`span`,{className:`attachment-embed attachment-embed-note`,children:e});if(o)return p(`${t.label} could not be loaded.`);if(!i)return p(`Loading ${t.label}…`);if(i.status===`unresolved`)return p(`No file “${t.label}” in this vault.`);if(i.status===`ambiguous`)return p(`“${t.label}” matches ${i.candidates.length} files: ${i.candidates.map(e=>e.path).join(`, `)}.`);let{file:m}=i,h=t.width||t.height?{...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}}:void 0,g=_(m.mimeType),C=n===`thumbnail`?null:(0,x.jsx)(S,{scope:e,reference:t.reference,form:t.form,kind:g,name:m.name,url:m.url,onError:r}),w=e=>C?(0,x.jsxs)(`span`,{className:`attachment-embed-frame`,children:[e,C]}):e;return g===`image`?(0,x.jsx)(`span`,{className:n===`thumbnail`?`attachment-embed attachment-embed-thumbnail`:`attachment-embed`,children:w((0,x.jsx)(`img`,{className:`attachment-embed-image`,src:m.url,alt:t.alt??m.name,loading:`lazy`,decoding:`async`,style:h,onError:s}))}):g===`audio`||l===m.url?(0,x.jsx)(`span`,{className:`attachment-embed`,children:(0,x.jsxs)(`span`,{className:`attachment-embed-media`,children:[(0,x.jsx)(`audio`,{className:`attachment-embed-audio`,controls:!0,preload:`metadata`,src:m.url,title:m.name,onError:s}),C]})}):g===`video`?(0,x.jsx)(`span`,{className:`attachment-embed`,children:w((0,x.jsx)(`video`,{className:`attachment-embed-video`,controls:!0,preload:`metadata`,src:m.url,title:m.name,style:h,onError:s,onLoadedMetadata:e=>{c(m.mimeType,e.currentTarget)&&u(m.url)}}))}):g===`pdf`&&n!==`thumbnail`?(0,x.jsx)(`span`,{className:`attachment-embed`,children:(0,x.jsx)(f,{className:`attachment-embed-pdf`,url:m.url,name:m.name,fragment:t.fragment,cover:t.cover,style:h,actions:C,mobileReader:!0})}):(0,x.jsx)(`span`,{className:`attachment-embed attachment-embed-file`,children:(0,x.jsx)(a,{title:`${m.name} · ${y(m.size)}`,size:`small`,onClick:()=>d(e,m.path,`wikilink`,r)})})}export{C as t};
1
+ import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{m as t,t as n}from"./react-B3NTyEzE.js";import{Cr as r,Sr as i,mn as a,vr as o,yt as s}from"./index-BVDhmwI8.js";import{a as c,i as l,n as u,r as d,t as f}from"./pdf-view-BATpBLO5.js";import{h as p}from"./icons-CxH3_W-q.js";import{n as m,r as h,t as g}from"./maximize-2-DATMN9kx.js";import{s as _,t as v}from"./use-vault-file-link-B-ZRcKDu.js";import{wo as y}from"./logic-DtHJ5GlU.js";var b=e(t(),1),x=n();function S({scope:e,reference:t,form:n,kind:a,name:c,url:f,onError:_}){let[v,y]=(0,b.useState)(!1),[S,C]=(0,b.useState)(!1),w=s(),T=(0,x.jsx)(o,{size:`compact`,className:`attachment-embed-menu`,"aria-label":`Actions for ${c}`,title:`Actions`,children:(0,x.jsx)(p,{"aria-hidden":`true`})});return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(i,{open:v,onOpenChange:y,trigger:T,label:`Attachment`,placement:`bottom-start`,children:[(0,x.jsxs)(r,{onClick:()=>{y(!1),d(e,t,n,_)},title:t,children:[(0,x.jsx)(h,{"aria-hidden":`true`}),`Open file`]}),a===`image`&&(0,x.jsxs)(r,{onClick:()=>{y(!1),C(!0)},children:[(0,x.jsx)(g,{"aria-hidden":`true`}),`Open large`]}),w&&(0,x.jsxs)(r,{onClick:()=>{y(!1),l(e,t,n,w,_)},children:[(0,x.jsx)(m,{"aria-hidden":`true`}),`Reveal in Files`]})]}),S&&(0,x.jsx)(u,{src:f,name:c,onClose:()=>C(!1)})]})}function C({scope:e,spec:t,variant:n=`inline`,onError:r}){let{link:i,failed:o,retry:s}=v(e,t.reference,t.form),[l,u]=(0,b.useState)(),p=e=>(0,x.jsx)(`span`,{className:`attachment-embed attachment-embed-note`,children:e});if(o)return p(`${t.label} could not be loaded.`);if(!i)return p(`Loading ${t.label}…`);if(i.status===`unresolved`)return p(`No file “${t.label}” in this vault.`);if(i.status===`ambiguous`)return p(`“${t.label}” matches ${i.candidates.length} files: ${i.candidates.map(e=>e.path).join(`, `)}.`);let{file:m}=i,h=t.width||t.height?{...t.width?{width:t.width}:{},...t.height?{height:t.height}:{}}:void 0,g=_(m.mimeType),C=n===`thumbnail`?null:(0,x.jsx)(S,{scope:e,reference:t.reference,form:t.form,kind:g,name:m.name,url:m.url,onError:r}),w=e=>C?(0,x.jsxs)(`span`,{className:`attachment-embed-frame`,children:[e,C]}):e;return g===`image`?(0,x.jsx)(`span`,{className:n===`thumbnail`?`attachment-embed attachment-embed-thumbnail`:`attachment-embed`,children:w((0,x.jsx)(`img`,{className:`attachment-embed-image`,src:m.url,alt:t.alt??m.name,loading:`lazy`,decoding:`async`,style:h,onError:s}))}):g===`audio`||l===m.url?(0,x.jsx)(`span`,{className:`attachment-embed`,children:(0,x.jsxs)(`span`,{className:`attachment-embed-media`,children:[(0,x.jsx)(`audio`,{className:`attachment-embed-audio`,controls:!0,preload:`metadata`,src:m.url,title:m.name,onError:s}),C]})}):g===`video`?(0,x.jsx)(`span`,{className:`attachment-embed`,children:w((0,x.jsx)(`video`,{className:`attachment-embed-video`,controls:!0,preload:`metadata`,src:m.url,title:m.name,style:h,onError:s,onLoadedMetadata:e=>{c(m.mimeType,e.currentTarget)&&u(m.url)}}))}):g===`pdf`&&n!==`thumbnail`?(0,x.jsx)(`span`,{className:`attachment-embed`,children:(0,x.jsx)(f,{className:`attachment-embed-pdf`,url:m.url,name:m.name,fragment:t.fragment,cover:t.cover,style:h,actions:C,mobileReader:!0})}):(0,x.jsx)(`span`,{className:`attachment-embed attachment-embed-file`,children:(0,x.jsx)(a,{title:`${m.name} · ${y(m.size)}`,size:`small`,onClick:()=>d(e,m.path,`wikilink`,r)})})}export{C as t};