fuli-context 0.22.0-beta.2 → 0.22.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/README.md +5 -1
  2. package/README.zh-CN.md +4 -1
  3. package/dist/web/assets/{AboutPage-BsYF7_sz.js → AboutPage-B-2YJJ-G.js} +1 -1
  4. package/dist/web/assets/{AgentHand-C5aUnyp3.js → AgentHand-DopO5H90.js} +1 -1
  5. package/dist/web/assets/AgentMentionCopy-C0UVaXJ0.js +1 -0
  6. package/dist/web/assets/{AgentName-DcR-yXAg.js → AgentName-D0cN8PPH.js} +1 -1
  7. package/dist/web/assets/{AgentProfilePage-Cu7q_7eQ.js → AgentProfilePage-CcKTlJ7Q.js} +1 -1
  8. package/dist/web/assets/{AgentServicesPage-KuM8Gh2-.js → AgentServicesPage-ClJ8gZlA.js} +1 -1
  9. package/dist/web/assets/{AgentsDirectoryPage-ColciWpR.css → AgentsDirectoryPage-Cq1z926q.css} +1 -1
  10. package/dist/web/assets/AgentsDirectoryPage-DfctUJW0.js +1 -0
  11. package/dist/web/assets/{BackLink-plP8tjp9.js → BackLink-DxwgM7JP.js} +1 -1
  12. package/dist/web/assets/BoardMoveMenu-D447UK2m.js +1 -0
  13. package/dist/web/assets/{CaptureChangePage-BV0LJpm1.js → CaptureChangePage-CMRXIMj1.js} +1 -1
  14. package/dist/web/assets/{Card-B9fEjzdx.js → Card-BGesvePJ.js} +1 -1
  15. package/dist/web/assets/{CardHeader-iTzyVlAg.js → CardHeader-BpUupnIn.js} +1 -1
  16. package/dist/web/assets/{CardTitle-Dq4vYfDe.js → CardTitle-Bzpt25kH.js} +1 -1
  17. package/dist/web/assets/{ConnectionsPage-CMVrntwM.js → ConnectionsPage-Dp64DSq7.js} +1 -1
  18. package/dist/web/assets/{CreateProjectDialog-dGfGAGgo.js → CreateProjectDialog-DxuDZK9m.js} +1 -1
  19. package/dist/web/assets/{DataFormatPage-DuEma4K0.js → DataFormatPage-B9r9V-uv.js} +1 -1
  20. package/dist/web/assets/{DialogFooter-BwqCbMpI.js → DialogFooter-B10YyasM.js} +1 -1
  21. package/dist/web/assets/EmployeeScopeDialog-CBexPEM7.css +1 -0
  22. package/dist/web/assets/EmployeeScopeDialog-VjF-kd7Q.js +1 -0
  23. package/dist/web/assets/{EmployeeWorkbenchPage-CmNwqk91.css → EmployeeWorkbenchPage-BFVC_klR.css} +1 -1
  24. package/dist/web/assets/EmployeeWorkbenchPage-W500poA_.js +3 -0
  25. package/dist/web/assets/FieldDescription-DkFfTPhf.js +1 -0
  26. package/dist/web/assets/{GrowthLoading-CL1dGObg.js → GrowthLoading-Dhb1g-H4.js} +1 -1
  27. package/dist/web/assets/{InboxPage-DrgE7gQu.js → InboxPage-BD6P8Efx.js} +1 -1
  28. package/dist/web/assets/Input-b7eq326T.js +1 -0
  29. package/dist/web/assets/KnowledgeHardDeleteSection-AQS3hA1R.js +1 -0
  30. package/dist/web/assets/KnowledgeItemEditPage-CuIBKm4N.js +1 -0
  31. package/dist/web/assets/{KnowledgeItemSummaryCard-Bd0Ml6Ia.js → KnowledgeItemSummaryCard-tLKjZ7DU.js} +1 -1
  32. package/dist/web/assets/{KnowledgeOrganizerPage-BIOaMzgQ.css → KnowledgeOrganizerPage-CY0VHyYE.css} +1 -1
  33. package/dist/web/assets/KnowledgeOrganizerPage-_IANoL7f.js +1 -0
  34. package/dist/web/assets/KnowledgePage-CPOERyKP.js +1 -0
  35. package/dist/web/assets/KnowledgePeek-BNCgLdgm.js +1 -0
  36. package/dist/web/assets/{KnowledgeTurnReceiptPage-DTZckYql.js → KnowledgeTurnReceiptPage-BxsD4mef.js} +1 -1
  37. package/dist/web/assets/{KnowledgeWorkspace-bhlGz1Mr.css → KnowledgeWorkspace-B9sihoKq.css} +1 -1
  38. package/dist/web/assets/KnowledgeWorkspace-DsRKJ8-h.js +4 -0
  39. package/dist/web/assets/Label-soyrIpZY.js +1 -0
  40. package/dist/web/assets/ModelSettingsPage-Cfz_NyhY.js +1 -0
  41. package/dist/web/assets/{NotFoundPage--X4xZoMR.js → NotFoundPage-CuWZ8XAB.js} +1 -1
  42. package/dist/web/assets/{OccupationsPage-DKuRfjeQ.js → OccupationsPage-DiG4cFZW.js} +1 -1
  43. package/dist/web/assets/{OverviewPage-C2ao6sX6.css → OverviewPage-4iaO9iiX.css} +1 -1
  44. package/dist/web/assets/OverviewPage-hyFXv4Sl.js +2 -0
  45. package/dist/web/assets/{PersonalProfilePage-DgveAPjq.js → PersonalProfilePage-CYmSuTVr.js} +1 -1
  46. package/dist/web/assets/{PersonalProjectsPage-DJ1VBf1r.js → PersonalProjectsPage-CNL7Abtm.js} +1 -1
  47. package/dist/web/assets/PopperContent-CzgSawpH.js +1 -0
  48. package/dist/web/assets/Presence-DA-9RGQg.js +3 -0
  49. package/dist/web/assets/ProjectAgentDetailPage-Bh7o-Uee.css +1 -0
  50. package/dist/web/assets/ProjectAgentDetailPage-CrabDPDO.js +8 -0
  51. package/dist/web/assets/{ProjectAgentDialog-3Abm-9sL.js → ProjectAgentDialog-CmtLqQGS.js} +1 -1
  52. package/dist/web/assets/ProjectAgentFirstTask-aMFh3D9I.js +1 -0
  53. package/dist/web/assets/{ProjectAgentsPage-Cj0PTJAE.js → ProjectAgentsPage-DgJJUgot.js} +1 -1
  54. package/dist/web/assets/{ProjectJudgmentPolicy-9BP_2AkI.js → ProjectJudgmentPolicy-CA07W9d0.js} +1 -1
  55. package/dist/web/assets/{ProjectScopePicker-CyZZQW4d.js → ProjectScopePicker-t-ilH5yl.js} +1 -1
  56. package/dist/web/assets/{PublicProjectsPage-Te3uZA-M.js → PublicProjectsPage-DVNyOkvj.js} +1 -1
  57. package/dist/web/assets/RadioGroupItem-DEPHXKxA.js +1 -0
  58. package/dist/web/assets/{RoundtablesPage-D0LICyzx.js → RoundtablesPage-CjzxTwUP.js} +1 -1
  59. package/dist/web/assets/RovingFocusGroup-GMKLSsaY.js +1 -0
  60. package/dist/web/assets/RovingFocusItem-Cx4l1jRn.js +1 -0
  61. package/dist/web/assets/SessionMigrationPage-LAbB2tBV.js +1 -0
  62. package/dist/web/assets/{SessionRecordsPage-DthAYkM5.js → SessionRecordsPage-Ceuq3Pfb.js} +1 -1
  63. package/dist/web/assets/SettingsPage-D_z_WUp7.js +1 -0
  64. package/dist/web/assets/{SettingsPage-DQMUQGfr.css → SettingsPage-DpVeP2OZ.css} +1 -1
  65. package/dist/web/assets/{SharedJefaReportPage-2VMoiCJj.js → SharedJefaReportPage-COTfS9Ci.js} +1 -1
  66. package/dist/web/assets/{TableHeader-D7hfNBTs.js → TableHeader-qvZVXeQ2.js} +1 -1
  67. package/dist/web/assets/TabsContent-Bmnetrj7.js +1 -0
  68. package/dist/web/assets/TabsTrigger-BNxu9oAO.js +1 -0
  69. package/dist/web/assets/TagVocabularyPage-BkYPfQf_.js +1 -0
  70. package/dist/web/assets/TaskBlockerClear-Cf32Iu7a.js +1 -0
  71. package/dist/web/assets/TaskBlockerClear-D4AaavVV.css +1 -0
  72. package/dist/web/assets/TaskBlockerNotice-CZkho0TF.css +1 -0
  73. package/dist/web/assets/TaskBlockerNotice-koB1bhtY.js +1 -0
  74. package/dist/web/assets/{TaskExecutionPlan-BeP4gm5O.js → TaskExecutionPlan-Bx4M7Crg.js} +1 -1
  75. package/dist/web/assets/TaskReason-BjSQGvxY.js +1 -0
  76. package/dist/web/assets/TaskReason-LleXL19i.css +1 -0
  77. package/dist/web/assets/Teleport-B8Xs4PR1.js +1 -0
  78. package/dist/web/assets/{TextField-CKNwSQVb.js → TextField-_kBQgOm4.js} +1 -1
  79. package/dist/web/assets/Textarea-B-B6pCuK.js +1 -0
  80. package/dist/web/assets/UiChip-CH2uwQzd.css +1 -0
  81. package/dist/web/assets/UiChip-m2z1qf19.js +1 -0
  82. package/dist/web/assets/{UiDialog-BAd1JUvO.js → UiDialog-BKCT2nEm.js} +1 -1
  83. package/dist/web/assets/{UiDisclosure-DVZdIuCs.js → UiDisclosure-iI_-leHt.js} +1 -1
  84. package/dist/web/assets/{UiIcon-DOwSNz_e.js → UiIcon-aVoMGzB_.js} +1 -1
  85. package/dist/web/assets/{UiIconButton-W1WfC7dt.js → UiIconButton-4oRs6Wjr.js} +1 -1
  86. package/dist/web/assets/{UiSegmented-Csh7hHda.js → UiSegmented-CM_NFPbE.js} +1 -1
  87. package/dist/web/assets/{UiSelect-Db8o-PRU.js → UiSelect-DVkY-zdx.js} +1 -1
  88. package/dist/web/assets/{UiToggle-DMuBZLY-.js → UiToggle-CPnuUD3m.js} +1 -1
  89. package/dist/web/assets/{UiWeight-CfhzKts0.js → UiWeight-Cf_B-Tt4.js} +1 -1
  90. package/dist/web/assets/{UnassignedConversationsPanel-DWUCNfR_.js → UnassignedConversationsPanel-DyRVwViP.js} +1 -1
  91. package/dist/web/assets/VirtualDirectoryList-1vLi41SD.css +1 -0
  92. package/dist/web/assets/VirtualDirectoryList-BZClXxm-.js +1 -0
  93. package/dist/web/assets/VisuallyHiddenInput-oDCEkdBd.js +1 -0
  94. package/dist/web/assets/{Workbench3D-DZZDfj10.js → Workbench3D-DAVAUokc.js} +1 -1
  95. package/dist/web/assets/_plugin-vue_export-helper-DwqUzWFm.js +10 -0
  96. package/dist/web/assets/accordion-DeuKUTo6.js +1 -0
  97. package/dist/web/assets/{agent-pins-O8E8apGs.js → agent-pins-Bzw_o47J.js} +1 -1
  98. package/dist/web/assets/agent-profile.css_vue_type_style_index_0_src_true_lang-DhfWt-ju.js +1 -0
  99. package/dist/web/assets/{agent-roster-records-D13CvTqR.js → agent-roster-records-nKOjRgMg.js} +1 -1
  100. package/dist/web/assets/{agent-work-summary-BM2HS3g8.js → agent-work-summary-I1_SuyRd.js} +1 -1
  101. package/dist/web/assets/{attach-closest-edge-u1fTT6hT.js → attach-closest-edge-kkH4SHtO.js} +1 -1
  102. package/dist/web/assets/{attention-store-Dexy6ybk.js → attention-store-COv0PZM0.js} +1 -1
  103. package/dist/web/assets/{badge-DvKUKtfP.js → badge-S3AzASdS.js} +1 -1
  104. package/dist/web/assets/{button-C1iW0ZW7.js → button-DiPIaXs0.js} +1 -1
  105. package/dist/web/assets/checkbox-5sUxMsGN.js +1 -0
  106. package/dist/web/assets/{client-CrxcG5dV.js → client-C6lXoprE.js} +1 -1
  107. package/dist/web/assets/{client-links-store-CrSwWuAU.js → client-links-store-Cj_SiUOF.js} +1 -1
  108. package/dist/web/assets/{console-DQ5fV3T8.js → console-nGYn-KhJ.js} +1 -1
  109. package/dist/web/assets/{conversation-launcher-settings-Bd222WX0.js → conversation-launcher-settings-DBfFQttb.js} +1 -1
  110. package/dist/web/assets/{design-lab-B9QfdWfU.js → design-lab-BXvRUkCw.js} +1 -1
  111. package/dist/web/assets/dialog-ww9GQxCB.js +1 -0
  112. package/dist/web/assets/{dist-Cox3qxin.js → dist-D9XImFJ_.js} +1 -1
  113. package/dist/web/assets/dropdown-menu-BBQ_wt28.js +1 -0
  114. package/dist/web/assets/field-XA6AAd2X.js +1 -0
  115. package/dist/web/assets/{identity-GQWezGWB.js → identity-BCQz5OgS.js} +1 -1
  116. package/dist/web/assets/{index-Dktlia0_.css → index-CCGc-VYW.css} +1 -1
  117. package/dist/web/assets/index-QVmt7uvq.js +2 -0
  118. package/dist/web/assets/{judgment-api-BzpDqFDw.js → judgment-api-BEBhG8Y_.js} +1 -1
  119. package/dist/web/assets/label-table-Ce-QboBr.js +1 -0
  120. package/dist/web/assets/{model-0znFleoY.js → model-Bc0tOa2c.js} +1 -1
  121. package/dist/web/assets/{model-T6Jor9oL.js → model-BkBhQ9o3.js} +1 -1
  122. package/dist/web/assets/model-C0qbdcqx.js +1 -0
  123. package/dist/web/assets/{model-LTc6Nj3z.js → model-CmPVTIaG.js} +1 -1
  124. package/dist/web/assets/{model-CYXGfox9.js → model-D0t9zEbm.js} +1 -1
  125. package/dist/web/assets/{model-BeQStl_a.js → model-DjKMVYCP.js} +1 -1
  126. package/dist/web/assets/{motion-preference-CHiRbvgR.js → motion-preference-D6zZi8T8.js} +1 -1
  127. package/dist/web/assets/{occupation-catalog-Caq13-kY.js → occupation-catalog-YQnolokQ.js} +1 -1
  128. package/dist/web/assets/{orchestration-filters-DSnybvV3.js → orchestration-filters-BDbIfsqD.js} +1 -1
  129. package/dist/web/assets/{page-title-BflOskhA.js → page-title-mg5604I3.js} +1 -1
  130. package/dist/web/assets/{profile-model-CVx0a_P4.js → profile-model-jbDqdjtS.js} +1 -1
  131. package/dist/web/assets/{project-board-layout-DmQActFu.js → project-board-layout-CXvrHTam.js} +1 -1
  132. package/dist/web/assets/{project-capture-H4qMdM1l.js → project-capture-ynCUqESv.js} +1 -1
  133. package/dist/web/assets/{project-origin-DMR9fKUE.js → project-origin-x5cyBJcv.js} +1 -1
  134. package/dist/web/assets/project-team-api-CfqgeQIC.js +1 -0
  135. package/dist/web/assets/{quick-edit-api-CCaH3tbK.js → quick-edit-api-BWWfXAWF.js} +1 -1
  136. package/dist/web/assets/select-OVX_qOPL.js +1 -0
  137. package/dist/web/assets/shared-report-BOcsUVT-.js +3 -0
  138. package/dist/web/assets/{task-evidence-M32pNYH0.js → task-evidence-B2smSxDg.js} +1 -1
  139. package/dist/web/assets/task-labels-CG_JrDCh.js +1 -0
  140. package/dist/web/assets/ui-_Q88vp6G.js +1 -0
  141. package/dist/web/assets/{useAgentRecords-3-zWyxUu.js → useAgentRecords-CVehRSqs.js} +1 -1
  142. package/dist/web/assets/{useApi-CROJJdhE-Cm-N4N7-.js → useApi-CROJJdhE-B-cZNZ6h.js} +1 -1
  143. package/dist/web/assets/useDirection-BqacNx7k.js +1 -0
  144. package/dist/web/assets/{useFocusReturn-Dq-yqBLj.js → useFocusReturn-DIBmClUp.js} +1 -1
  145. package/dist/web/assets/useForwardExpose-20R7HtuT.js +1 -0
  146. package/dist/web/assets/{useKnowledgeItemPeek-BWbdLqAL.js → useKnowledgeItemPeek-Q4RZHFs1.js} +1 -1
  147. package/dist/web/assets/{useMinimumLoadingDisplay-BEUl4UAV.js → useMinimumLoadingDisplay-CGwmiVPu.js} +1 -1
  148. package/dist/web/assets/{useRoutePeek-C_9DVOKT.js → useRoutePeek-rDjGKJht.js} +1 -1
  149. package/dist/web/assets/{useTypeahead-CP74zC2e.js → useTypeahead-Bs-0o0Sf.js} +1 -1
  150. package/dist/web/assets/utils-8iXGyRIT.js +1 -0
  151. package/dist/web/assets/{vue-router-rg-hudCL.js → vue-router-DuCF3Twy.js} +1 -1
  152. package/dist/web/index.html +41 -38
  153. package/docs/agent-interface-architecture.md +14 -4
  154. package/graph-provider/fuli_graph/app.py +1 -1
  155. package/graph-provider/fuli_graph/graph_field_contract.py +1 -1
  156. package/graph-provider/fuli_graph/graph_format_migrations.py +10 -1
  157. package/graph-provider/fuli_graph/project_agent_names.py +29 -5
  158. package/graph-provider/fuli_graph/project_agent_routes.py +16 -0
  159. package/graph-provider/fuli_graph/project_agent_task_models.py +14 -3
  160. package/graph-provider/fuli_graph/runtime.py +7 -0
  161. package/graph-provider/fuli_graph/store_project_agent_naming.py +33 -6
  162. package/graph-provider/fuli_graph/store_project_agent_task_blockers.py +42 -7
  163. package/graph-provider/fuli_graph/store_project_agent_task_reads.py +2 -1
  164. package/graph-provider/fuli_graph/store_project_agent_tasks.py +3 -0
  165. package/graph-provider/fuli_graph/store_project_agents.py +1 -1
  166. package/graph-provider/fuli_graph/task_blocker.py +11 -0
  167. package/graph-provider/pyproject.toml +1 -1
  168. package/native/win32/fuli-win-helper.exe +0 -0
  169. package/npm-shrinkwrap.json +2 -2
  170. package/package.json +1 -1
  171. package/skills/capturing-session-knowledge/references/coordination.md +6 -2
  172. package/skills/operating-fuli/references/workflow-recipes.md +2 -1
  173. package/src/agent-apps/host-tools/catalog.js +1 -0
  174. package/src/agent-naming/naming-style.js +30 -0
  175. package/src/agent-tools/graph-handlers.js +7 -0
  176. package/src/agent-tools/interface-catalog.js +2 -0
  177. package/src/agent-tools/project-agent-definitions.js +4 -1
  178. package/src/agent-tools/project-agent-tool-definitions.js +6 -0
  179. package/src/cli/native-runtime-command.js +1 -0
  180. package/src/desktop/windows-controller.js +39 -6
  181. package/src/desktop/windows-installation-switch.js +16 -6
  182. package/src/desktop/windows-update-command.js +2 -0
  183. package/src/desktop/windows-update-runtime.js +28 -3
  184. package/src/desktop/windows-update.js +9 -9
  185. package/src/graphiti/federated-application.js +1 -0
  186. package/src/graphiti/project-agent-mapping.js +1 -0
  187. package/src/http/api-router.js +3 -0
  188. package/src/http/task-blocker-api-router.js +35 -0
  189. package/src/local-runtime/child-process-log.js +34 -0
  190. package/src/mcp/tool-annotations.js +1 -0
  191. package/src/native-runtime/neo4j-asset-state.js +4 -3
  192. package/src/native-runtime/neo4j-lifecycle.js +43 -18
  193. package/src/native-runtime/neo4j-version-policy.js +28 -0
  194. package/src/native-runtime/runtime.js +14 -12
  195. package/src/native-runtime/windows-processes.js +3 -3
  196. package/src/presence/windows-helper-pin.js +1 -1
  197. package/src/server.js +7 -0
  198. package/src/setup/graph-runtime.js +9 -7
  199. package/src/setup/paths.js +7 -1
  200. package/src/setup/setup.js +11 -1
  201. package/src/system/console-port-switch.js +42 -0
  202. package/src/system/reserved-ports.js +111 -0
  203. package/src/system/runtime-settings.js +6 -2
  204. package/src/system/settings-apply.js +6 -6
  205. package/src/system/settings-guide.js +7 -0
  206. package/src/system/system-service.js +2 -1
  207. package/src/task-blockers/console-port.js +20 -0
  208. package/dist/web/assets/AgentMentionCopy-CTVGHbLe.js +0 -1
  209. package/dist/web/assets/AgentsDirectoryPage-9YEOf4nL.js +0 -1
  210. package/dist/web/assets/BoardMoveMenu-DC6_givs.js +0 -1
  211. package/dist/web/assets/EmployeeScopeDialog-BoVOcccy.js +0 -1
  212. package/dist/web/assets/EmployeeScopeDialog-DkqAe9sJ.css +0 -1
  213. package/dist/web/assets/EmployeeWorkbenchPage-_h6-ZFHV.js +0 -3
  214. package/dist/web/assets/Input-14C6kRsv.js +0 -1
  215. package/dist/web/assets/KnowledgeHardDeleteSection-DYD4BeL_.js +0 -1
  216. package/dist/web/assets/KnowledgeItemEditPage-Cja2_OMd.js +0 -1
  217. package/dist/web/assets/KnowledgeOrganizerPage-MT3tMGVx.js +0 -1
  218. package/dist/web/assets/KnowledgePage-bWItlXy5.js +0 -1
  219. package/dist/web/assets/KnowledgePeek-Cj9AiG_J.js +0 -1
  220. package/dist/web/assets/KnowledgeWorkspace-BOrKazVl.js +0 -4
  221. package/dist/web/assets/Label-WCfl_UpK.js +0 -1
  222. package/dist/web/assets/ModelSettingsPage-CQZdCaiX.js +0 -1
  223. package/dist/web/assets/OverviewPage-B2sbgaT-.js +0 -2
  224. package/dist/web/assets/PopperContent-DgnpW6vB.js +0 -1
  225. package/dist/web/assets/Presence-Bn4pKveC.js +0 -3
  226. package/dist/web/assets/ProjectAgentDetailPage-BSBpu2sZ.css +0 -1
  227. package/dist/web/assets/ProjectAgentDetailPage-CH57mPoo.js +0 -8
  228. package/dist/web/assets/ProjectAgentFirstTask-CLQFOwXi.js +0 -1
  229. package/dist/web/assets/RadioGroupItem-CZvh557X.js +0 -1
  230. package/dist/web/assets/RovingFocusGroup-CKuSV66n.js +0 -1
  231. package/dist/web/assets/RovingFocusItem-D6DzRzcZ.js +0 -1
  232. package/dist/web/assets/SessionMigrationPage-CEP1Mr9n.js +0 -1
  233. package/dist/web/assets/SettingsPage-BtJ3O9ZH.js +0 -1
  234. package/dist/web/assets/TabsContent-vZY5Gjt-.js +0 -1
  235. package/dist/web/assets/TabsTrigger-Dhi51wTn.js +0 -1
  236. package/dist/web/assets/TagVocabularyPage-CLe5HBs6.js +0 -1
  237. package/dist/web/assets/TaskBlockerNotice-CIVFwBgZ.css +0 -1
  238. package/dist/web/assets/TaskBlockerNotice-DgJBUFNl.js +0 -1
  239. package/dist/web/assets/Teleport-ByKM5w1b.js +0 -1
  240. package/dist/web/assets/Textarea-Ca7nOquD.js +0 -1
  241. package/dist/web/assets/VirtualDirectoryList-BpYcDx5H.js +0 -1
  242. package/dist/web/assets/VirtualDirectoryList-pgDELOEf.css +0 -1
  243. package/dist/web/assets/VisuallyHiddenInput-BEz-QHu_.js +0 -1
  244. package/dist/web/assets/_plugin-vue_export-helper-C98j5XpL.js +0 -10
  245. package/dist/web/assets/accordion-BqNFYBeR.js +0 -1
  246. package/dist/web/assets/agent-profile.css_vue_type_style_index_0_src_true_lang-cZYEJ_8z.js +0 -1
  247. package/dist/web/assets/checkbox-BIMU57_g.js +0 -1
  248. package/dist/web/assets/dialog-DFkjUY8h.js +0 -1
  249. package/dist/web/assets/dropdown-menu-BF3zRtMG.js +0 -1
  250. package/dist/web/assets/field-CG5pHJks.js +0 -1
  251. package/dist/web/assets/index-Di5_eD7U.js +0 -2
  252. package/dist/web/assets/model-DRuw3_ym.js +0 -1
  253. package/dist/web/assets/project-team-api-CBnMg8k5.js +0 -1
  254. package/dist/web/assets/select-C369n9Ru.js +0 -1
  255. package/dist/web/assets/shared-report-DO2Khr8D.js +0 -3
  256. package/dist/web/assets/task-labels-BRZad3HE.js +0 -1
  257. package/dist/web/assets/ui-DieLnn9C.js +0 -1
  258. package/dist/web/assets/useDirection-BGtNSPCf.js +0 -1
  259. package/dist/web/assets/utils-DDDNAHy1.js +0 -1
@@ -4,7 +4,7 @@ import { dirname, join } from 'node:path';
4
4
  import { writeTextFileAtomic } from '../storage/json-file.js';
5
5
  import { canonicalWindowsInstallPath, installationSha256, windowsInstallPathsOverlap } from './windows-installation-context.js';
6
6
  import { stopInstalledFuli } from './windows-running-fuli.js';
7
- import { prepareWindowsUpdateRuntime, restoreWindowsUpdateRuntime } from './windows-update-runtime.js';
7
+ import { backupWindowsGraph, prepareWindowsUpdateRuntime, restoreWindowsUpdateRuntime } from './windows-update-runtime.js';
8
8
 
9
9
  // Switching the installed version: shared by update and user-initiated rollback.
10
10
  // The record and shortcuts change only after the running version has stopped,
@@ -46,7 +46,8 @@ export function stageWindowsShortcuts(shortcuts, packageRoot, createShortcut, re
46
46
  }
47
47
 
48
48
  // stopping: how processes that outlive the installed CLI's stop are handled (windows-running-fuli.js).
49
- export async function stopAndSwitchWindowsInstallation(plan, staged, packageRoot, { runCli, lock, write, discard = () => {}, stopping = {} }) {
49
+ // backupGraph: the graph backup before a Neo4j patch upgrade (windows-update-runtime.js).
50
+ export async function stopAndSwitchWindowsInstallation(plan, staged, packageRoot, { runCli, lock, write, discard = () => {}, stopping = {}, backupGraph = backupWindowsGraph }) {
50
51
  try {
51
52
  lock.assertHeld();
52
53
  assertInstallationUnchanged(plan.recordPath, plan.record);
@@ -58,10 +59,10 @@ export async function stopAndSwitchWindowsInstallation(plan, staged, packageRoot
58
59
  discard();
59
60
  throw error;
60
61
  }
61
- return switchInstallation(plan, staged, packageRoot, runCli, lock, write);
62
+ return switchInstallation(plan, staged, packageRoot, runCli, lock, write, backupGraph);
62
63
  }
63
64
 
64
- async function switchInstallation(plan, staged, packageRoot, runCli, lock, write) {
65
+ async function switchInstallation(plan, staged, packageRoot, runCli, lock, write, backupGraph) {
65
66
  const execute = runCli;
66
67
  runCli = async (...args) => {
67
68
  lock.assertHeld();
@@ -70,6 +71,9 @@ async function switchInstallation(plan, staged, packageRoot, runCli, lock, write
70
71
  return result;
71
72
  };
72
73
  const { current } = plan;
74
+ const upgrade = staged.runtime.neo4jUpgrade;
75
+ // After the newer Neo4j opened the store, the older one might not open it again.
76
+ const kept = () => upgrade ? ` The graph backup taken before Neo4j ${upgrade.to} is kept at ${upgrade.backupDir}.` : '';
73
77
  const args = command => [command, '--data-dir', current.dataDir];
74
78
  // A confirmed downgrade lets the new version replace the recorded Provider.
75
79
  const startArgs = () => plan.downgrade ? [...args('start'), '--allow-provider-downgrade'] : args('start');
@@ -79,6 +83,12 @@ async function switchInstallation(plan, staged, packageRoot, runCli, lock, write
79
83
  lock.assertHeld();
80
84
  assertInstallationUnchanged(plan.recordPath, plan.record);
81
85
  for (const shortcut of plan.shortcuts) assertInstallationUnchanged(shortcut.path, shortcut.bytes);
86
+ if (upgrade) {
87
+ write(`Backing up the graph before upgrading Neo4j ${upgrade.from} → ${upgrade.to}...`);
88
+ try { await backupGraph(staged.runtime, current); }
89
+ catch (error) { throw new Error('The graph backup before the Neo4j upgrade failed; nothing was switched.', { cause: error }); }
90
+ lock.assertHeld();
91
+ }
82
92
  prepareWindowsUpdateRuntime(staged.runtime);
83
93
  writeTextFileAtomic(plan.recordPath, staged.record);
84
94
  switched = true;
@@ -111,8 +121,8 @@ async function switchInstallation(plan, staged, packageRoot, runCli, lock, write
111
121
  await requireInstalledCli(runCli, current.packageRoot, args('start'), 'The previous Fuli did not start again.');
112
122
  await requireInstalledCli(runCli, current.packageRoot, args('status'), 'The previous Fuli did not report a running state.');
113
123
  } catch (caught) { failures.push(caught); }
114
- if (failures.length) throw new AggregateError([error, ...failures], 'Rollback needs attention: ' + failures.map(e => e.message).join('; '));
115
- throw new Error(`${error.message} Fuli ${current.applicationVersion} was restored; the other copy is kept at ${packageRoot}.`, { cause: error });
124
+ if (failures.length) throw new AggregateError([error, ...failures], 'Rollback needs attention: ' + failures.map(e => e.message).join('; ') + (started ? kept() : ''));
125
+ throw new Error(`${error.message} Fuli ${current.applicationVersion} was restored; the other copy is kept at ${packageRoot}.${started ? kept() : ''}`, { cause: error });
116
126
  }
117
127
  write('Reconnecting already connected Agent clients...');
118
128
  let clients = 'not_reconnected';
@@ -19,6 +19,8 @@ export async function runWindowsUpdateCommand(args = [], dependencies = {}) {
19
19
  const plan = (dependencies.plan ?? planWindowsUpdate)(updateOptions);
20
20
  if (plan.downgrade) write('这是降版替换(--allow-downgrade):程序换成更低的版本号,数据不变;更新前请先备份数据目录。 / This replaces Fuli with a lower version (--allow-downgrade); data is kept. Back up the data folder first.');
21
21
  write(`更新 / Update: ${plan.current.applicationVersion} → ${plan.applicationVersion}\n程序 / Application: ${plan.installRoot}\n保留数据 / Keep data: ${plan.current.dataDir}\n请先退出 Fuli 托盘;服务会自动停止后重启。 / Exit the tray first; services will be stopped and restarted.`);
22
+ const upgrade = plan.neo4jUpgrade;
23
+ if (upgrade) write(`Neo4j ${upgrade.from} → ${upgrade.to}:切换前先备份图谱;升级后不能回退到 ${upgrade.from}。 / The graph is backed up before the switch; rolling back to Neo4j ${upgrade.from} afterwards is refused.`);
22
24
  if (preview) return { status: 'preview' };
23
25
  if (!yes && !await confirm('更新? / Update? [y/N] ')) return { status: 'cancelled' };
24
26
  const stopping = { stopPids, confirmStop: yes ? undefined : async blockers => {
@@ -1,23 +1,48 @@
1
1
  import { existsSync, readFileSync, unlinkSync } from 'node:fs';
2
2
  import { join } from 'node:path';
3
+ import { exportGraphData } from '../backup/graph-backup.js';
4
+ import { createGraphBackupAdapter } from '../backup/runtime-adapters.js';
5
+ import { neo4jPatchUpgrade, neo4jUpgradeBackupPath } from '../native-runtime/neo4j-version-policy.js';
3
6
  import { readWindowsNativeBundle, resolveWindowsNativeBundle } from '../native-runtime/windows-assets.js';
4
7
  import { compareSemanticVersions } from '../semantic-version.js';
8
+ import { graphBackupDirectory, resolveSetupPaths } from '../setup/paths.js';
5
9
  import { writeTextFileAtomic } from '../storage/json-file.js';
6
10
 
7
11
  // downgrade: an older package refuses a newer runtime descriptor, so the switch
8
12
  // clears it and the older version records its own bundled runtime on start.
9
- export function snapshotWindowsUpdateRuntime(current, candidateRoot, { downgrade = false } = {}) {
13
+ // A newer Neo4j patch in the candidate is an upgrade: the graph is backed up
14
+ // before the newer Neo4j first opens the store (backupWindowsGraph). An older
15
+ // one is refused, whichever way the application version goes.
16
+ export function snapshotWindowsUpdateRuntime(current, candidateRoot, { downgrade = false, now = () => new Date() } = {}) {
10
17
  const settingsPath = join(current.dataDir, 'runtime-settings.json');
11
18
  if (!existsSync(settingsPath) || JSON.parse(readFileSync(settingsPath)).graphRuntimeMode !== 'native') {
12
19
  throw new Error('Open the installed Fuli tray and configure native mode before updating. Container data requires a separate migration.');
13
20
  }
14
21
  const assets = root => resolveWindowsNativeBundle(readWindowsNativeBundle(root));
15
22
  const previous = assets(current.packageRoot), next = assets(candidateRoot);
16
- if (previous.neo4jVersion !== next.neo4jVersion) throw new Error('Automatic update requires the same Neo4j version; database upgrades require a separate migration.');
23
+ const upgrade = neo4jPatchUpgrade(previous.neo4jVersion, next.neo4jVersion, { backup: current.previousInstallation?.graphBackup });
17
24
  const path = join(current.dataDir, 'native-runtime', 'manifest.json');
18
25
  const bytes = existsSync(path) ? readFileSync(path) : null;
19
26
  if (bytes) requireOwnedDescriptor(bytes, previous, current.applicationVersion);
20
- return { path, bytes, next, downgrade };
27
+ else if (upgrade) throw new Error(`Upgrading Neo4j ${previous.neo4jVersion} → ${next.neo4jVersion} backs up the graph first, which needs the installed runtime record. Start Fuli ${current.applicationVersion} once, then update again.`);
28
+ const neo4jUpgrade = upgrade ? { from: previous.neo4jVersion, to: next.neo4jVersion,
29
+ backupDir: neo4jUpgradeBackupPath(graphBackupDirectory(current.dataDir), next.neo4jVersion, now()) } : null;
30
+ return { path, bytes, next, downgrade, neo4jUpgrade };
31
+ }
32
+
33
+ // Runs inside the switch, after the installed version stopped and before the
34
+ // record changes. The runtime descriptor still selects the installed Neo4j, so
35
+ // `fuli graph export`'s mechanism dumps the store with the version that wrote it.
36
+ // It runs in this process: the candidate's CLI cannot resolve its paths until
37
+ // the record names it. The switch decides what starts afterwards, never the export.
38
+ export async function backupWindowsGraph(snapshot, current, {
39
+ exportGraph = exportGraphData, createAdapter = createGraphBackupAdapter
40
+ } = {}) {
41
+ if (!snapshot.neo4jUpgrade) return;
42
+ const paths = resolveSetupPaths({ dataDir: current.dataDir, packageRoot: current.packageRoot, platform: 'win32' });
43
+ const adapter = await createAdapter({ mode: 'native', paths });
44
+ await exportGraph({ outputDir: snapshot.neo4jUpgrade.backupDir, sourceMode: 'native', instances: adapter.instances,
45
+ adapter: { ...adapter, start: async () => {} } });
21
46
  }
22
47
 
23
48
  // Runs inside the switch, after the current version stopped and before the record changes.
@@ -1,7 +1,6 @@
1
1
  import { randomUUID } from 'node:crypto';
2
2
  import { mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
3
3
  import { dirname, isAbsolute, join } from 'node:path';
4
- import { readWindowsNativeBundle, resolveWindowsNativeBundle } from '../native-runtime/windows-assets.js';
5
4
  import { compareSemanticVersions } from '../semantic-version.js';
6
5
  import { canonicalWindowsInstallPath, installationSha256, readWindowsInstallation, windowsInstallPathsOverlap } from './windows-installation-context.js';
7
6
  import { createWindowsShortcut, readWindowsShortcut, trayInventory } from './windows-installation.js';
@@ -41,13 +40,13 @@ export function planWindowsUpdate({ source, installRoot, env = process.env, read
41
40
  throw new Error(comparison === 0 ? 'This version is already installed.'
42
41
  : 'The update package must be newer than the installed version. To replace it with a lower version on purpose (for example a local rc build with a public beta), back up the data folder and run Update-Fuli with --allow-downgrade.');
43
42
  }
44
- snapshotWindowsUpdateRuntime(installed.current, source);
45
- return { source, ...installed, inventorySha256: inventory.inventorySha256, applicationVersion, downgrade: comparison < 0 };
43
+ const { neo4jUpgrade } = snapshotWindowsUpdateRuntime(installed.current, source);
44
+ return { source, ...installed, inventorySha256: inventory.inventorySha256, applicationVersion, downgrade: comparison < 0, neo4jUpgrade };
46
45
  }
47
46
 
48
47
  export async function updateWindowsInstallation(options, {
49
48
  runCli = runInstalledCli, createShortcut = createWindowsShortcut, readShortcut = readWindowsShortcut,
50
- acquireLock = acquireWindowsUpdateLock, write = () => {}, stopping
49
+ acquireLock = acquireWindowsUpdateLock, write = () => {}, stopping, backupGraph
51
50
  } = {}) {
52
51
  const plan = planWindowsUpdate({ ...options, readShortcut });
53
52
  if ((options.expectedInstallationId && options.expectedInstallationId !== plan.current.installationId)
@@ -67,12 +66,11 @@ export async function updateWindowsInstallation(options, {
67
66
  let staged;
68
67
  try {
69
68
  staged = stageUpdate(plan, inventory, installationId, packageRoot, createShortcut, readShortcut);
70
- staged.runtime = snapshotWindowsUpdateRuntime(plan.current, packageRoot);
71
69
  } catch (error) {
72
70
  discard();
73
71
  throw error;
74
72
  }
75
- return await stopAndSwitchWindowsInstallation(plan, staged, packageRoot, { runCli, lock, write, discard, stopping });
73
+ return await stopAndSwitchWindowsInstallation(plan, staged, packageRoot, { runCli, lock, write, discard, stopping, backupGraph });
76
74
  } finally { await lock.release(); }
77
75
  }
78
76
 
@@ -84,14 +82,16 @@ function stageUpdate(plan, inventory, installationId, packageRoot, createShortcu
84
82
  writeFileSync(join(packageRoot, name), bytes, { flag: 'wx' });
85
83
  }
86
84
  writeFileSync(join(packageRoot, 'tray-files.sha256.json'), inventory.bytes, { flag: 'wx' });
87
- resolveWindowsNativeBundle(readWindowsNativeBundle(packageRoot));
85
+ const runtime = snapshotWindowsUpdateRuntime(plan.current, packageRoot);
88
86
  const receipt = { version: 1, kind: 'windows-user-installation', installationId,
89
87
  installRoot: plan.installRoot, packageRoot, dataDir: plan.current.dataDir, inventorySha256: plan.inventorySha256 };
90
88
  writeFileSync(join(packageRoot, 'installed-context.json'), JSON.stringify(receipt, null, 2) + '\n', { flag: 'wx' });
91
89
  const next = { ...receipt, status: 'installed', applicationVersion: plan.applicationVersion,
92
90
  shortcuts: plan.current.shortcuts, ...(plan.current.adoptedExistingData ? { adoptedExistingData: true } : {}),
93
91
  previousInstallation: { installationId: plan.current.installationId, packageRoot: plan.current.packageRoot,
94
- applicationVersion: plan.current.applicationVersion } };
92
+ applicationVersion: plan.current.applicationVersion,
93
+ // Named when a rollback to an older Neo4j is refused (neo4j-version-policy.js).
94
+ ...(runtime.neo4jUpgrade ? { graphBackup: runtime.neo4jUpgrade.backupDir } : {}) } };
95
95
  const shortcuts = stageWindowsShortcuts(plan.shortcuts, packageRoot, createShortcut, readShortcut);
96
- return { next, record: Buffer.from(JSON.stringify(next, null, 2) + '\n'), shortcuts };
96
+ return { next, record: Buffer.from(JSON.stringify(next, null, 2) + '\n'), shortcuts, runtime };
97
97
  }
@@ -160,6 +160,7 @@ export function openFederatedGraphApplication({
160
160
  readUrl: () => readRuntimeSettings(paths.runtimeSettingsPath).notifications.needsPersonUrl });
161
161
  app.explainSettings = () => describeSettings({ settings: readRuntimeSettings(paths.runtimeSettingsPath),
162
162
  capturePolicy: app.getCapturePolicy(), consoleUrl: app.consoleUrl });
163
+ app.agentNamingStyle = () => readRuntimeSettings(paths.runtimeSettingsPath).agentNamingStyle;
163
164
  }
164
165
  return app;
165
166
  }
@@ -560,6 +560,7 @@ export function projectAgentTaskEventRecord(value = {}) {
560
560
  fallbackReason: value.executor_fallback_reason ?? value.fallback_reason ?? null,
561
561
  fallbackUsed: value.fallback_used ?? false,
562
562
  blockerClearedBy: value.blocker_cleared_by ?? null,
563
+ blockerClearNote: value.blocker_clear_note ?? null,
563
564
  createdAt: value.created_at
564
565
  };
565
566
  copyOptional(
@@ -8,6 +8,7 @@ import { handleDataFormatApiRequest } from './data-format-api-router.js';
8
8
  import { handleKnowledgeHardDeleteRequest } from './knowledge-hard-delete-api-router.js';
9
9
  import { handleKnowledgeScopeRequest } from './knowledge-scope-api-router.js';
10
10
  import { handleProjectHierarchyRequest } from './project-hierarchy-api-router.js';
11
+ import { handleTaskBlockerRequest } from './task-blocker-api-router.js';
11
12
  import { handleKnowledgeTagsRequest } from './knowledge-tags-api-router.js';
12
13
  import { handleStandingAssignmentRequest } from './standing-assignment-api-router.js';
13
14
  import { handleClientLinksRequest } from './client-links-api-router.js';
@@ -37,6 +38,7 @@ export async function handleApiRequest({
37
38
  knowledgeHardDelete = null,
38
39
  knowledgeScope = null,
39
40
  projectHierarchy = null,
41
+ taskBlockers = null,
40
42
  knowledgeOwnerReads = null,
41
43
  knowledgeTags = null,
42
44
  modelRoleSettings = null,
@@ -211,6 +213,7 @@ export async function handleApiRequest({
211
213
  await handleKnowledgeHardDeleteRequest({ request, response, url, app, hardDelete: knowledgeHardDelete }) ||
212
214
  await handleKnowledgeScopeRequest({ request, response, url, app, scopeConsole: knowledgeScope }) ||
213
215
  await handleProjectHierarchyRequest({ request, response, url, app, hierarchyConsole: projectHierarchy }) ||
216
+ await handleTaskBlockerRequest({ request, response, url, app, blockerConsole: taskBlockers }) ||
214
217
  await handleKnowledgeTagsRequest({ request, response, url, app, tagsConsole: knowledgeTags }) ||
215
218
  await handleJudgmentApiRequest({ request, response, url, app, undoConsole: judgmentUndo, ownerReads: knowledgeOwnerReads }) ||
216
219
  await handleStandingAssignmentRequest({ request, response, url, app }) ||
@@ -0,0 +1,35 @@
1
+ import { readJson, sendJson } from './response.js';
2
+ import { refuseRemoteDecision } from './request-policy.js';
3
+ import { validationError } from '../app/application-error.js';
4
+ import { requiredString } from '../validation/values.js';
5
+
6
+ const CLEAR_PATH = /^\/api\/project-agent-tasks\/([^/]+)\/blocker\/clear$/;
7
+ const MAX_ID = 128;
8
+ const MAX_NOTE = 500;
9
+
10
+ // The person marks a blocked task as no longer blocked (「标记为已解除」), with
11
+ // an optional short note. Accepted only on this computer and sent on the
12
+ // human-review channel (src/task-blockers), so an Agent can never post it,
13
+ // not even straight to the Provider with its own token. No Agent tool
14
+ // reaches this route.
15
+ export async function handleTaskBlockerRequest({ request, response, url, app, blockerConsole }) {
16
+ const match = url.pathname.match(CLEAR_PATH);
17
+ if (!match || request.method !== 'POST') return false;
18
+ response.setHeader('Cache-Control', 'no-store');
19
+ if (refuseRemoteDecision(request, response, 'Blocked tasks are marked unblocked only on this computer')) return true;
20
+ if (!blockerConsole) {
21
+ sendJson(response, 503, { error: 'Marking a task unblocked needs a local FULI installation' });
22
+ return true;
23
+ }
24
+ const body = await readJson(request);
25
+ if (body?.personalSpaceId !== app.config.personal.spaceId) {
26
+ throw validationError('Tasks are marked unblocked in the active personal space');
27
+ }
28
+ const taskId = requiredString(decodeURIComponent(match[1]), 'taskId', MAX_ID);
29
+ const personalProjectId = requiredString(body.personalProjectId, 'personalProjectId', MAX_ID);
30
+ const blank = body.note == null || (typeof body.note === 'string' && !body.note.trim());
31
+ const note = blank ? null : requiredString(body.note, 'note', MAX_NOTE);
32
+ sendJson(response, 200, await blockerConsole.markUnblocked(taskId,
33
+ { personalSpaceId: body.personalSpaceId, personalProjectId, note }));
34
+ return true;
35
+ }
@@ -0,0 +1,34 @@
1
+ import { mkdirSync, openSync, renameSync, rmSync, statSync } from 'node:fs';
2
+ import { dirname } from 'node:path';
3
+
4
+ // A detached child (Neo4j, the Graph Provider, the console) writes straight to
5
+ // this file and outlives the process that started it, so the size is bounded
6
+ // when each child starts: a log past the limit becomes `.1`, older copies move
7
+ // up, and the oldest is dropped.
8
+ const CHILD_LOG_MAX_BYTES = 50 * 1024 * 1024;
9
+ const CHILD_LOG_KEPT_COPIES = 3;
10
+ // Another process (an editor, a tail, a child that survived) holds the file
11
+ // without sharing deletion: keep appending rather than refuse to start.
12
+ const HELD_FILE_CODES = new Set(['EBUSY', 'EPERM', 'EACCES']);
13
+
14
+ /** Opens a child process's log for appending after rotating it when too large. Returns the descriptor. */
15
+ export function openChildProcessLog(logPath) {
16
+ mkdirSync(dirname(logPath), { recursive: true });
17
+ try {
18
+ rotateWhenFull(logPath);
19
+ } catch (error) {
20
+ if (!HELD_FILE_CODES.has(error.code)) throw error;
21
+ }
22
+ return openSync(logPath, 'a');
23
+ }
24
+
25
+ function rotateWhenFull(logPath) {
26
+ const size = statSync(logPath, { throwIfNoEntry: false })?.size ?? 0;
27
+ if (size <= CHILD_LOG_MAX_BYTES) return;
28
+ rmSync(`${logPath}.${CHILD_LOG_KEPT_COPIES}`, { force: true });
29
+ for (let copy = CHILD_LOG_KEPT_COPIES - 1; copy >= 1; copy -= 1) {
30
+ const older = `${logPath}.${copy}`;
31
+ if (statSync(older, { throwIfNoEntry: false })) renameSync(older, `${logPath}.${copy + 1}`);
32
+ }
33
+ renameSync(logPath, `${logPath}.1`);
34
+ }
@@ -12,6 +12,7 @@ const READ_TOOLS = new Set([
12
12
  'get_capture_policy',
13
13
  'read_session_records',
14
14
  'explain_settings',
15
+ 'get_agent_naming_style',
15
16
  'list_external_knowledge_connectors',
16
17
  'discover_external_knowledge_sources',
17
18
  'list_external_knowledge_bindings',
@@ -58,7 +58,8 @@ function overlaps(a, b) {
58
58
  return inside(a, b) || inside(b, a);
59
59
  }
60
60
 
61
- export async function managedNeo4jContainers(paths, version) {
61
+ // versions: the Neo4j versions this runtime may hold (the current one and a retained older patch).
62
+ export async function managedNeo4jContainers(paths, versions) {
62
63
  const root = join(paths.nativeRuntimeDir, 'neo4j-assets');
63
64
  let entries;
64
65
  try { entries = await readdir(root, { withFileTypes: true }); }
@@ -69,8 +70,8 @@ export async function managedNeo4jContainers(paths, version) {
69
70
  if (!entry.isDirectory() || !/^jvs-a-[a-f0-9-]+$/.test(entry.name)) throw new Error('Unknown Neo4j asset entry was preserved.');
70
71
  const container = join(root, entry.name);
71
72
  const receipt = JSON.parse(await readFile(join(container, 'fuli-asset-owner.json'), 'utf8'));
72
- if (receipt.kind !== 'fuli-neo4j-assets' || receipt.id !== entry.name || receipt.version !== version) throw new Error('Unowned Neo4j asset directory was preserved.');
73
- await assertManagedNeo4jHome(paths, join(container, `neo4j-community-${version}`), version);
73
+ if (receipt.kind !== 'fuli-neo4j-assets' || receipt.id !== entry.name || !versions.includes(receipt.version)) throw new Error('Unowned Neo4j asset directory was preserved.');
74
+ await assertManagedNeo4jHome(paths, join(container, `neo4j-community-${receipt.version}`), receipt.version);
74
75
  containers.push(container);
75
76
  }
76
77
  return containers;
@@ -2,7 +2,8 @@ import { randomUUID } from 'node:crypto';
2
2
  import { existsSync } from 'node:fs';
3
3
  import { mkdir, readFile, rm } from 'node:fs/promises';
4
4
  import { join } from 'node:path';
5
- import { managedGraphInstances } from '../backup/runtime-adapters.js';
5
+ import { exportGraphData } from '../backup/graph-backup.js';
6
+ import { createGraphBackupAdapter, managedGraphInstances } from '../backup/runtime-adapters.js';
6
7
  import { localRuntimeControl } from '../cli/local-runtime-control.js';
7
8
  import { isProcessAlive } from '../local-runtime/processes.js';
8
9
  import { readJsonFile, writeJsonFileAtomic, writeTextFileAtomic } from '../storage/json-file.js';
@@ -11,6 +12,7 @@ import { assertManagedNeo4jHome, neo4jAssetFingerprint, acquireNeo4jLifecycleLoc
11
12
  import { assertMacNativePortFree } from './macos-ports.js';
12
13
  import { installNativeNeo4j } from './neo4j-install.js';
13
14
  import { readNeo4jStoreFormats } from './neo4j-store-formats.js';
15
+ import { neo4jPatchUpgrade, neo4jUpgradeBackupPath } from './neo4j-version-policy.js';
14
16
  import { createNativeGraphServices, requireReusableNativeRuntime, NATIVE_NEO4J_VERSION, NATIVE_NEO4J_URL, NATIVE_NEO4J_SHA256 } from './runtime.js';
15
17
 
16
18
  export async function planNativeNeo4j({ paths, action }) {
@@ -19,17 +21,19 @@ export async function planNativeNeo4j({ paths, action }) {
19
21
  const bytes = await readFile(paths.nativeRuntimeManifestPath);
20
22
  const current = JSON.parse(bytes);
21
23
  if (current.status !== 'ready' || current.mode !== 'native') throw new Error('Initialize the native runtime with fuli setup --runtime-mode native first.');
22
- if (current.neo4jVersion !== NATIVE_NEO4J_VERSION) throw new Error('Neo4j version changes require a separate data migration. Implicit upgrades and downgrades are blocked.');
24
+ // Only an update moves to the pinned version; an older patch is upgraded after a graph backup.
25
+ const upgrade = neo4jPatchUpgrade(current.neo4jVersion, NATIVE_NEO4J_VERSION) && action === 'update';
23
26
  await assertManagedNeo4jHome(paths, current.neo4jHome, current.neo4jVersion);
24
27
  const fingerprint = await neo4jAssetFingerprint(current.neo4jHome);
25
28
  if (current.neo4jAssetFingerprint && current.neo4jAssetFingerprint !== fingerprint) throw new Error('Current Neo4j asset integrity changed.');
26
29
  if (action === 'rollback') {
27
30
  const previous = current.previousNeo4jAsset;
28
- if (!previous || previous.version !== current.neo4jVersion) throw new Error('No retained same-version Neo4j assets are available for rollback.');
31
+ // Going back to an older patch is refused and names the pre-upgrade backup.
32
+ if (!previous || neo4jPatchUpgrade(current.neo4jVersion, previous.version, { backup: previous.graphBackup })) throw new Error('No retained same-version Neo4j assets are available for rollback.');
29
33
  await assertManagedNeo4jHome(paths, previous.home, previous.version);
30
34
  if (await neo4jAssetFingerprint(previous.home) !== previous.fingerprint) throw new Error('Retained Neo4j asset integrity changed.');
31
35
  }
32
- return { action, neo4jVersion: current.neo4jVersion, currentHome: current.neo4jHome,
36
+ return { action, neo4jVersion: upgrade ? NATIVE_NEO4J_VERSION : current.neo4jVersion, upgrade, currentHome: current.neo4jHome,
33
37
  previousHome: current.previousNeo4jAsset?.home ?? null, data: 'preserved', bytes, current, fingerprint };
34
38
  }
35
39
 
@@ -42,6 +46,13 @@ export async function manageNativeNeo4j({ paths, action, env = process.env }, de
42
46
  const service = descriptor => (dependencies.services ?? ((selected, options) => createNativeGraphServices({ paths, runtimeDescriptor: selected, ...options })))(descriptor, { env: operationEnv });
43
47
  const stopped = dependencies.assertStopped ?? (state => assertStopped(paths, state));
44
48
  const formats = dependencies.storeFormats ?? (descriptor => readNeo4jStoreFormats(paths, descriptor));
49
+ // `fuli graph export`'s mechanism, run with the stopped installed Neo4j inside
50
+ // this operation. The switch decides what starts afterwards, never the export.
51
+ const backup = dependencies.backupGraph ?? (async outputDir => {
52
+ const adapter = await createGraphBackupAdapter({ mode: 'native', paths,
53
+ createNativeServices: options => createNativeGraphServices({ ...options, env: operationEnv }) });
54
+ await exportGraphData({ outputDir, sourceMode: 'native', instances: adapter.instances, adapter: { ...adapter, start: async () => {} } });
55
+ });
45
56
  let candidateRoot;
46
57
  try {
47
58
  const plan = await planNativeNeo4j({ paths, action });
@@ -61,7 +72,7 @@ export async function manageNativeNeo4j({ paths, action, env = process.env }, de
61
72
  await (dependencies.install ?? installNativeNeo4j)({ paths: { ...paths, nativeRuntimeDir: candidateRoot }, home,
62
73
  url: NATIVE_NEO4J_URL, sha256: NATIVE_NEO4J_SHA256 });
63
74
  await assertManagedNeo4jHome(paths, home, NATIVE_NEO4J_VERSION);
64
- target = { ...current, neo4jHome: home, neo4jAssetFingerprint: await neo4jAssetFingerprint(home) };
75
+ target = { ...current, neo4jVersion: NATIVE_NEO4J_VERSION, neo4jHome: home, neo4jAssetFingerprint: await neo4jAssetFingerprint(home) };
65
76
  } else if (action === 'rollback') {
66
77
  target = { ...current, neo4jHome: current.previousNeo4jAsset.home,
67
78
  neo4jAssetFingerprint: current.previousNeo4jAsset.fingerprint };
@@ -70,9 +81,15 @@ export async function manageNativeNeo4j({ paths, action, env = process.env }, de
70
81
  const stopResult = await runtime.stop({ env: operationEnv });
71
82
  if (stopResult?.status !== 'stopped') throw new Error('Could not confirm the old runtime stopped; no assets were switched.');
72
83
  await stopped(oldState);
73
- let before;
74
- try { before = await formats(current); }
75
- catch (error) {
84
+ let before, graphBackup = null;
85
+ try {
86
+ before = await formats(current);
87
+ if (plan.upgrade) {
88
+ graphBackup = neo4jUpgradeBackupPath(paths.graphBackupDir, NATIVE_NEO4J_VERSION);
89
+ try { await backup(graphBackup); }
90
+ catch (error) { throw new Error('The graph backup before the Neo4j upgrade failed; no assets were switched.', { cause: error }); }
91
+ }
92
+ } catch (error) {
76
93
  await lock.assertHeld(); await unchanged(paths.nativeRuntimeManifestPath, plan.bytes);
77
94
  if (wasRunning) await runtime.start({ env: operationEnv });
78
95
  else if (wasDatabaseRunning) await service(current).start({ providers: wasProviderRunning });
@@ -86,10 +103,14 @@ export async function manageNativeNeo4j({ paths, action, env = process.env }, de
86
103
  await lock.assertHeld(); await unchanged(paths.nativeRuntimeManifestPath, plan.bytes);
87
104
  if (await neo4jAssetFingerprint(current.neo4jHome) !== plan.fingerprint) throw new Error('Current Neo4j assets changed while stopping.');
88
105
  if (action === 'uninstall') {
89
- const homes = [current.neo4jHome, current.previousNeo4jAsset?.home].filter(Boolean);
90
- const containers = new Set([await assertManagedNeo4jHome(paths, paths.nativeNeo4jHome, current.neo4jVersion),
91
- ...await managedNeo4jContainers(paths, current.neo4jVersion), ...homes.map(home => assetContainer(paths, home))]);
92
- for (const home of homes) await assertManagedNeo4jHome(paths, home, current.neo4jVersion);
106
+ // After a patch upgrade the retained assets are of the older patch.
107
+ const assets = [{ home: current.neo4jHome, version: current.neo4jVersion }, current.previousNeo4jAsset].filter(Boolean);
108
+ const versions = [...new Set(assets.map(({ version }) => version))];
109
+ const defaultHomes = await Promise.all(versions.map(version =>
110
+ assertManagedNeo4jHome(paths, join(paths.nativeRuntimeDir, `neo4j-community-${version}`), version)));
111
+ const containers = new Set([...defaultHomes, ...await managedNeo4jContainers(paths, versions),
112
+ ...assets.map(({ home }) => assetContainer(paths, home))]);
113
+ for (const { home, version } of assets) await assertManagedNeo4jHome(paths, home, version);
93
114
  writeJsonFileAtomic(journal, { action, phase: 'removing-assets', previous: current });
94
115
  writeJsonFileAtomic(paths.nativeRuntimeManifestPath, { ...current, status: 'uninstalled' });
95
116
  const uninstalled = await readFile(paths.nativeRuntimeManifestPath);
@@ -98,7 +119,9 @@ export async function manageNativeNeo4j({ paths, action, env = process.env }, de
98
119
  return { status: 'uninstalled', data: 'preserved' };
99
120
  }
100
121
  target.previousNeo4jAsset = { home: current.neo4jHome, version: current.neo4jVersion,
101
- fingerprint: plan.fingerprint, storeFormats: before };
122
+ fingerprint: plan.fingerprint, storeFormats: before, ...(graphBackup ? { graphBackup } : {}) };
123
+ // After the newer Neo4j opened the store, the older one might not open it again.
124
+ const kept = graphBackup ? ` The graph backup taken before the upgrade is kept at ${graphBackup}.` : '';
102
125
  const nextBytes = Buffer.from(`${JSON.stringify(target, null, 2)}\n`);
103
126
  const targetServices = service(target);
104
127
  writeJsonFileAtomic(journal, { action, phase: 'switching', previous: current, next: target, storeFormats: before });
@@ -123,16 +146,18 @@ export async function manageNativeNeo4j({ paths, action, env = process.env }, de
123
146
  if (consoleStartAttempted && (await runtime.stop({ env: operationEnv }))?.status !== 'stopped') throw new Error('Candidate console could not be stopped.');
124
147
  await targetServices.stopDatabases(); await stopped();
125
148
  if (JSON.stringify(await formats(target)) !== JSON.stringify(before)) throw new Error('Neo4j storage format changed; unsafe rollback blocked.');
126
- } catch (recoveryError) { throw new AggregateError([error, recoveryError], 'Neo4j rollback needs attention. The candidate was not replaced and recovery evidence was kept.'); }
127
- if (await neo4jAssetFingerprint(current.neo4jHome) !== plan.fingerprint) throw new Error('Previous assets changed; recovery needs attention.');
149
+ } catch (recoveryError) { throw new AggregateError([error, recoveryError], 'Neo4j rollback needs attention. The candidate was not replaced and recovery evidence was kept.' + kept); }
150
+ if (await neo4jAssetFingerprint(current.neo4jHome) !== plan.fingerprint) throw new Error('Previous assets changed; recovery needs attention.' + kept);
128
151
  if (switched) writeTextFileAtomic(paths.nativeRuntimeManifestPath, plan.bytes);
129
152
  const old = service(current);
130
- await old.start({ providers: wasProviderRunning });
131
- for (const instance of managedGraphInstances(paths)) await old.checkDatabaseHealth(instance);
153
+ try {
154
+ await old.start({ providers: wasProviderRunning });
155
+ for (const instance of managedGraphInstances(paths)) await old.checkDatabaseHealth(instance);
156
+ } catch (restartError) { throw new AggregateError([error, restartError], 'Neo4j switch failed and the previous Neo4j did not start again; recovery evidence was kept.' + kept); }
132
157
  if (wasRunning) await runtime.start({ env: operationEnv });
133
158
  else if (!wasDatabaseRunning) await old.stopDatabases();
134
159
  await rm(journal);
135
- throw new Error('Neo4j switch failed; the previous assets were restored. Data was preserved.', { cause: error });
160
+ throw new Error('Neo4j switch failed; the previous assets were restored. Data was preserved.' + kept, { cause: error });
136
161
  }
137
162
  } finally { await lock.release(); }
138
163
  }
@@ -0,0 +1,28 @@
1
+ // Which Neo4j version changes FULI makes without a separate data migration: an
2
+ // upward patch within one major.minor (5.26.0 → 5.26.28). Neo4j may raise a
3
+ // store's kernel version when it first opens it, so a change never goes down a
4
+ // patch: the older Neo4j might not open what the newer one left.
5
+
6
+ import { join } from 'node:path';
7
+
8
+ const VERSION = /^(\d+)\.(\d+)\.(\d+)$/;
9
+
10
+ // Where the graph backup before switching to Neo4j `version` goes. `fuli graph
11
+ // export` creates it with the installed Neo4j, before the newer one opens the store.
12
+ export function neo4jUpgradeBackupPath(graphBackupDir, version, now = new Date()) {
13
+ return join(graphBackupDir, `before-neo4j-${version}-${now.toISOString().replace(/[:.]/g, '-')}`);
14
+ }
15
+
16
+ // True when bundled is a newer patch of installed, false when they are equal.
17
+ // backup: where the graph backup from before the last upgrade is kept, named
18
+ // when a downgrade is refused.
19
+ export function neo4jPatchUpgrade(installed, bundled, { backup = null } = {}) {
20
+ if (installed === bundled) return false;
21
+ const [from, to] = [installed, bundled].map(version => VERSION.exec(version ?? '')?.slice(1).map(Number));
22
+ if (!from || !to || from[0] !== to[0] || from[1] !== to[1]) {
23
+ throw new Error(`Neo4j version ${installed} → ${bundled} changes the major or minor version; that needs a separate data migration. Nothing was changed.`);
24
+ }
25
+ if (to[2] > from[2]) return true;
26
+ throw new Error(`Neo4j version ${installed} → ${bundled} is a downgrade: ${installed} may have upgraded the graph store, and ${bundled} might not open it. Nothing was changed.`
27
+ + (backup ? ` The graph backup taken before the upgrade is kept at ${backup}; restoring it discards graph changes made since then.` : ''));
28
+ }
@@ -6,8 +6,6 @@ import {
6
6
  chmodSync,
7
7
  closeSync,
8
8
  existsSync,
9
- mkdirSync,
10
- openSync,
11
9
  readFileSync,
12
10
  unlinkSync
13
11
  } from 'node:fs';
@@ -24,6 +22,7 @@ import { assertManagedNeo4jHome, withNativeAssetOperation } from './neo4j-asset-
24
22
  import { assertMacNativePortFree, assertMacNativePortOwner } from './macos-ports.js';
25
23
  import { resolveNativeJavaHome } from './java-runtime.js';
26
24
  import { installNativeNeo4j } from './neo4j-install.js';
25
+ import { neo4jPatchUpgrade } from './neo4j-version-policy.js';
27
26
  import { FULI_VERSION } from '../package-metadata.js';
28
27
  import { compareSemanticVersions } from '../semantic-version.js';
29
28
  import { readWindowsNativeBundle, resolveWindowsNativeBundle } from './windows-assets.js';
@@ -39,6 +38,7 @@ import {
39
38
  readRuntimeSettings
40
39
  } from '../system/runtime-settings.js';
41
40
  import { nonEmptyText } from '../validation/values.js';
41
+ import { openChildProcessLog } from '../local-runtime/child-process-log.js';
42
42
  import { isProcessAlive } from '../local-runtime/processes.js';
43
43
  import { parseProviderEnv } from '../setup/provider-env.js';
44
44
 
@@ -452,9 +452,15 @@ async function ensureNativeRuntimeUnlocked(input, dependencies = {}) {
452
452
  throw new Error('Native Graph Provider source fingerprint is invalid.');
453
453
  }
454
454
  const saved = deps.readManifest(input.paths.nativeRuntimeManifestPath);
455
+ // An older patch stays selected: only `fuli graph runtime update` upgrades it,
456
+ // after a graph backup. A newer or other-minor version is refused here.
457
+ const upgradePending = saved?.neo4jVersion ? neo4jPatchUpgrade(saved.neo4jVersion, NATIVE_NEO4J_VERSION) : false;
458
+ const neo4jVersion = upgradePending ? saved.neo4jVersion : NATIVE_NEO4J_VERSION;
459
+ const pendingUpgrade = () => new Error(`Native Neo4j version ${neo4jVersion} last opened this graph; this Fuli bundles ${NATIVE_NEO4J_VERSION}. Upgrade it with \`fuli graph runtime update\`, which backs up the graph first and needs the ${neo4jVersion} assets still installed.`);
460
+ if (upgradePending && (saved.status !== 'ready' || !saved.neo4jHome)) throw pendingUpgrade();
455
461
  let neo4jHome = input.paths.nativeNeo4jHome;
456
- if (saved?.status === 'ready' && saved.neo4jHome && saved.neo4jVersion === NATIVE_NEO4J_VERSION) {
457
- neo4jHome = await assertManagedNeo4jHome(input.paths, saved.neo4jHome, NATIVE_NEO4J_VERSION);
462
+ if (saved?.status === 'ready' && saved.neo4jHome && saved.neo4jVersion === neo4jVersion) {
463
+ neo4jHome = await assertManagedNeo4jHome(input.paths, saved.neo4jHome, neo4jVersion);
458
464
  }
459
465
  const expected = {
460
466
  ...(saved?.previousNeo4jAsset ? { previousNeo4jAsset: saved.previousNeo4jAsset } : {}),
@@ -462,7 +468,7 @@ async function ensureNativeRuntimeUnlocked(input, dependencies = {}) {
462
468
  version: MANIFEST_VERSION,
463
469
  status: 'ready',
464
470
  mode: 'native',
465
- neo4jVersion: NATIVE_NEO4J_VERSION,
471
+ neo4jVersion,
466
472
  providerVersion: `${FULI_VERSION}+native.${PROVIDER_RUNTIME_REVISION}`,
467
473
  providerFingerprint,
468
474
  javaHome,
@@ -470,14 +476,12 @@ async function ensureNativeRuntimeUnlocked(input, dependencies = {}) {
470
476
  neo4jHome,
471
477
  providerPython
472
478
  };
473
- if (saved?.neo4jVersion && saved.neo4jVersion !== NATIVE_NEO4J_VERSION) {
474
- throw new Error('Native Neo4j version changes require an explicit data migration plan. Refusing implicit upgrade or downgrade.');
475
- }
476
479
  assertProviderUpgrade(saved?.providerVersion, expected.providerVersion, input.allowProviderDowngrade);
477
480
  if (manifestReady(saved, expected, input.paths, deps.pathExists)) return saved;
478
481
 
479
482
  deps.onProgress(input, `Installing native Neo4j ${NATIVE_NEO4J_VERSION}…`);
480
483
  if (!neo4jReady(input.paths, deps.pathExists, neo4jHome)) {
484
+ if (upgradePending) throw pendingUpgrade();
481
485
  await deps.installNeo4j({
482
486
  paths: input.paths,
483
487
  home: neo4jHome,
@@ -751,8 +755,7 @@ function spawnNativeDatabase(spec) {
751
755
  }
752
756
  unlinkSync(spec.pidPath);
753
757
  }
754
- mkdirSync(dirname(spec.logPath), { recursive: true });
755
- const log = openSync(spec.logPath, 'a');
758
+ const log = openChildProcessLog(spec.logPath);
756
759
  try {
757
760
  const child = spawn(spec.command, spec.args, {
758
761
  detached: true,
@@ -768,8 +771,7 @@ function spawnNativeDatabase(spec) {
768
771
  }
769
772
 
770
773
  function spawnNativeProvider(spec) {
771
- mkdirSync(dirname(spec.logPath), { recursive: true });
772
- const log = openSync(spec.logPath, 'a');
774
+ const log = openChildProcessLog(spec.logPath);
773
775
  try {
774
776
  const child = spawn(spec.python, [
775
777
  '-m', 'uvicorn', 'fuli_graph.app:app',
@@ -1,11 +1,12 @@
1
1
  import { spawn } from 'node:child_process';
2
2
  import { createHash } from 'node:crypto';
3
3
  import { once } from 'node:events';
4
- import { closeSync, mkdirSync, openSync, readFileSync } from 'node:fs';
4
+ import { closeSync, readFileSync } from 'node:fs';
5
5
  import { createConnection } from 'node:net';
6
6
  import { basename, dirname, join, normalize, win32 } from 'node:path';
7
7
  import { setTimeout as delay } from 'node:timers/promises';
8
8
 
9
+ import { openChildProcessLog } from '../local-runtime/child-process-log.js';
9
10
  import { execute, OWNED_PROCESS_TYPE, powershell } from '../local-runtime/windows-process-handle.js';
10
11
 
11
12
  const samePath = (left, right) => typeof left === 'string' && typeof right === 'string'
@@ -148,8 +149,7 @@ export async function stopWindowsNativeProcess(pid, entry, { timeoutMs } = {}) {
148
149
  }
149
150
 
150
151
  async function spawnOwned(command, args, environment, logPath, { provider = false } = {}) {
151
- mkdirSync(dirname(logPath), { recursive: true });
152
- const log = openSync(logPath, 'a');
152
+ const log = openChildProcessLog(logPath);
153
153
  let child;
154
154
  try {
155
155
  child = spawn(command, args, { detached: true, windowsHide: true,
@@ -3,4 +3,4 @@
3
3
  // and writes its digest here before publishing (scripts/pin-win-helper.js); a
4
4
  // source checkout has no helper and no pin, so Windows Hello is unavailable there.
5
5
  // The helper is not Authenticode-signed: this digest is its only integrity check.
6
- export const WIN_HELPER_SHA256 = '9d02879c4a8a1b0602f194a6b53ba212f91947758b31cc8bcd406314aabc8bf7';
6
+ export const WIN_HELPER_SHA256 = '7f91ca379963e7222889084efb9ddbf9973e699c2f4cfb2ef0877ac0b9b8414a';