fuli-context 0.23.0-beta.9 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (294) hide show
  1. package/dist/web/assets/{AboutPage-Co0jsR1c.js → AboutPage-S8QFfzpA.js} +1 -1
  2. package/dist/web/assets/AboutSectionHeading-B5CzH4Zs.js +1 -0
  3. package/dist/web/assets/AboutSectionHeading-DjXpIV27.css +1 -0
  4. package/dist/web/assets/{AgentAppsPage-DY_TV5EE.js → AgentAppsPage-BYXraPFM.js} +1 -1
  5. package/dist/web/assets/{AgentHand-CTKH7yFY.js → AgentHand-BGGdVdd9.js} +1 -1
  6. package/dist/web/assets/AgentManagement-Bza8k5ra.js +7 -0
  7. package/dist/web/assets/AgentMentionCopy-C72hY2QL.js +1 -0
  8. package/dist/web/assets/{AgentName-DNxVHPb0.js → AgentName-CUjBNQ8j.js} +1 -1
  9. package/dist/web/assets/AgentProfilePage-kp7-gRRx.js +5 -0
  10. package/dist/web/assets/{AgentServicesPage-DEz1dnct.js → AgentServicesPage-IsGaz7FY.js} +1 -1
  11. package/dist/web/assets/{AppViewerPage-BMnN0lgj.js → AppViewerPage-CcOlwxck.js} +1 -1
  12. package/dist/web/assets/{BackToTop-BfdZE6xK.js → BackToTop-C3KYEoCW.js} +1 -1
  13. package/dist/web/assets/{BoardCardFieldsMenu-xjUzesvU.js → BoardCardFieldsMenu-BlBWT1j7.js} +1 -1
  14. package/dist/web/assets/{BoardMoveMenu-CCvochC4.js → BoardMoveMenu-Bc7xC1Uh.js} +1 -1
  15. package/dist/web/assets/{Breadcrumb-ys780J7e.js → Breadcrumb-C_xMiD-Z.js} +1 -1
  16. package/dist/web/assets/{CaptureChangePage-BY7KKPuU.js → CaptureChangePage-Bekp1aWg.js} +1 -1
  17. package/dist/web/assets/{ConnectionsPage-Cj-T0BH2.js → ConnectionsPage-BpvecWXD.js} +1 -1
  18. package/dist/web/assets/{CopyFixPrompt-ERDPz6w7.js → CopyFixPrompt-Bp-UX4Hq.js} +1 -1
  19. package/dist/web/assets/DataFormatPage-dsy8d3oA.js +2 -0
  20. package/dist/web/assets/DataFormatPage-sSnjjUY4.css +1 -0
  21. package/dist/web/assets/{DebugTurnPage-C6xOOTYf.js → DebugTurnPage-cIJV7xDW.js} +1 -1
  22. package/dist/web/assets/{DebugTurnsPage-uclemAXU.js → DebugTurnsPage-B6Te_Alp.js} +1 -1
  23. package/dist/web/assets/{DialogTitle-C86eI8Q_.js → DialogTitle-Lj5s6nwG.js} +1 -1
  24. package/dist/web/assets/{EmployeeRedirectPage-B5Sh-mOu.js → EmployeeRedirectPage-DnvwJeCN.js} +1 -1
  25. package/dist/web/assets/{EmployeeScopeDialog-DbEgouOr.js → EmployeeScopeDialog-CXNZ62Ab.js} +1 -1
  26. package/dist/web/assets/{EmployeeWorkbench-Cd0Yrv4Z.js → EmployeeWorkbench-DALIO-cM.js} +3 -3
  27. package/dist/web/assets/FieldRoot-DRnAC66O.js +1 -0
  28. package/dist/web/assets/{FlaGrowth-BS5MVg54.js → FlaGrowth-7wlv31Tl.js} +1 -1
  29. package/dist/web/assets/{FlaTaskSheets-IQ1HsEu5.js → FlaTaskSheets-CNdaBy1P.js} +1 -1
  30. package/dist/web/assets/{FlasPage-DsAcdiFS.js → FlasPage-BCs1Ffpf.js} +1 -1
  31. package/dist/web/assets/{GrowthLoading-BMf6Z2MU.js → GrowthLoading-Cr8xZwwO.js} +1 -1
  32. package/dist/web/assets/HowtoPage-Cv1YQy1s.js +1 -0
  33. package/dist/web/assets/{HowtoPage-BRV2W1Go.css → HowtoPage-t12tDDpS.css} +1 -1
  34. package/dist/web/assets/{InboxPage-DPV8n8FW.js → InboxPage-CgJnymOY.js} +1 -1
  35. package/dist/web/assets/{KnowledgeDeleteButton-Bo7gXmnS.js → KnowledgeDeleteButton-FEyEvhlR.js} +1 -1
  36. package/dist/web/assets/{KnowledgeHardDeleteSection-amJaLmkS.js → KnowledgeHardDeleteSection-CVwTeMEJ.js} +1 -1
  37. package/dist/web/assets/KnowledgeItemEditPage-rwpM8cF1.js +1 -0
  38. package/dist/web/assets/{KnowledgeItemSummaryCard-CjcKr6Xr.js → KnowledgeItemSummaryCard-49EADY_Z.js} +1 -1
  39. package/dist/web/assets/{KnowledgeOrganizerPage-CzXXBL9z.js → KnowledgeOrganizerPage-7IdnjM3L.js} +1 -1
  40. package/dist/web/assets/KnowledgePage-gxqOIZxf.js +1 -0
  41. package/dist/web/assets/KnowledgePeek-CQyCxHFj.js +1 -0
  42. package/dist/web/assets/{KnowledgeTurnReceiptPage-CbRSAOkW.js → KnowledgeTurnReceiptPage-BOz7IpaK.js} +1 -1
  43. package/dist/web/assets/{KnowledgeWorkspace-6C9dPHLk.js → KnowledgeWorkspace-A7zVb26p.js} +3 -3
  44. package/dist/web/assets/{MeAvatar-Ca5kjZR7.js → MeAvatar-CYVcRiuW.js} +1 -1
  45. package/dist/web/assets/{MeLink-CMsMg8E_.js → MeLink-BdqkzhT6.js} +1 -1
  46. package/dist/web/assets/{MenuSeparator-BlL75cLC.js → MenuSeparator-quqkZZXY.js} +1 -1
  47. package/dist/web/assets/ModelSettingsPage-B8jC_uew.js +3 -0
  48. package/dist/web/assets/ModelSettingsPage-DhCn_SF6.css +1 -0
  49. package/dist/web/assets/{NotFoundPage-j5qbgkxY.js → NotFoundPage-Dmn32VWo.js} +1 -1
  50. package/dist/web/assets/{OccupationsPage-DLIkdMDv.js → OccupationsPage-BVREfX_R.js} +1 -1
  51. package/dist/web/assets/{OverviewPage-BeExbgPK.js → OverviewPage-CHyEbdP4.js} +1 -1
  52. package/dist/web/assets/{PageColumns-C93sMwwH.js → PageColumns-DpfaPeu7.js} +1 -1
  53. package/dist/web/assets/{PageOutline-Dtu7R8Wo.js → PageOutline-BKBQ1T4d.js} +1 -1
  54. package/dist/web/assets/{PersonalProfilePage-CIeXNXqv.js → PersonalProfilePage-Cxp2gn6J.js} +1 -1
  55. package/dist/web/assets/PersonalProjectsPage-821imOxR.js +1 -0
  56. package/dist/web/assets/{PinIcon-Dp4Ubaw6.js → PinIcon-B7dvh7ld.js} +1 -1
  57. package/dist/web/assets/{PopperContent-D6WQ0NV4.js → PopperContent-DNqbLkNa.js} +1 -1
  58. package/dist/web/assets/{Presence-D-jzaDBV.js → Presence-D3HKb5Hb.js} +1 -1
  59. package/dist/web/assets/{ProfileAuthorChip-CpLzynWF.js → ProfileAuthorChip-7HSHODdR.js} +1 -1
  60. package/dist/web/assets/{ProjectAgentsPage-v-Wtq-2-.js → ProjectAgentsPage-DBsXS6Xa.js} +1 -1
  61. package/dist/web/assets/{ProjectJudgmentPolicy-DR8Rk_1K.js → ProjectJudgmentPolicy-GA33aSRi.js} +1 -1
  62. package/dist/web/assets/{PublicProjectsPage-QwAtKnu1.js → PublicProjectsPage-PJlBI8IE.js} +1 -1
  63. package/dist/web/assets/{RoundtablesPage-DLZdviOP.js → RoundtablesPage-DT5DUXsa.js} +1 -1
  64. package/dist/web/assets/{RovingFocusGroup-CmwaBpdi.js → RovingFocusGroup-BB0d3k17.js} +1 -1
  65. package/dist/web/assets/{RovingFocusItem-HhNodnJn.js → RovingFocusItem-CFd7tXzD.js} +1 -1
  66. package/dist/web/assets/{SessionMigrationPage-_W2BnsjS.js → SessionMigrationPage-BZ1lEDQr.js} +1 -1
  67. package/dist/web/assets/{SessionRecordsPage-CedaErNM.js → SessionRecordsPage-BMAAtIAt.js} +1 -1
  68. package/dist/web/assets/SettingsPage-BYNEk6BM.js +1 -0
  69. package/dist/web/assets/{SettingsPage-D85vqpZb.css → SettingsPage-Uj1IpZpS.css} +1 -1
  70. package/dist/web/assets/{SharedJefaReportPage-BkmmPYH1.js → SharedJefaReportPage-g35o6jUb.js} +1 -1
  71. package/dist/web/assets/{TagVocabularyPage-Bcd5fvzW.js → TagVocabularyPage-COubNJXz.js} +1 -1
  72. package/dist/web/assets/{TaskBlockerClear-Bln3zxga.js → TaskBlockerClear-B5MpHdlh.js} +1 -1
  73. package/dist/web/assets/{TaskBlockerNotice-Db1uAtT2.js → TaskBlockerNotice-CIN0HRiE.js} +1 -1
  74. package/dist/web/assets/{TaskReason-BgF2K1hA.js → TaskReason-LQ0CFiKu.js} +1 -1
  75. package/dist/web/assets/{TeamCard-B4J2jkm5.js → TeamCard-D-kLa5rT.js} +1 -1
  76. package/dist/web/assets/{TeamCardsWidget-CZTQVqyh.js → TeamCardsWidget-DGX9k0S6.js} +1 -1
  77. package/dist/web/assets/{TeamIsland-DXIQQ3bx.js → TeamIsland-BIo-l49b.js} +1 -1
  78. package/dist/web/assets/{Teleport-Dg_IoSZh.js → Teleport-C1upABpY.js} +1 -1
  79. package/dist/web/assets/{TextField-Y8DAIUw6.js → TextField-ZnmRqG0h.js} +1 -1
  80. package/dist/web/assets/{UiChip-vvwIQTGB.js → UiChip-CizeOu1Q.js} +1 -1
  81. package/dist/web/assets/UiDialog-CGTzxn3-.js +1 -0
  82. package/dist/web/assets/{UiDisclosure-Bp0vA9km.js → UiDisclosure-ueMA4jl0.js} +1 -1
  83. package/dist/web/assets/UiIcon-sD1hUsOF.js +1 -0
  84. package/dist/web/assets/{UiIconButton-EZ8ktpFH.js → UiIconButton-CCo4NPYv.js} +1 -1
  85. package/dist/web/assets/{UiNotice-DYZn5s6m.js → UiNotice-DGPFbVo7.js} +1 -1
  86. package/dist/web/assets/{UiSegmented-DX8WXXVn.js → UiSegmented-BZ-jqnPE.js} +1 -1
  87. package/dist/web/assets/{UiWeight-Ci6wZg1W.js → UiWeight-BRO3oVMZ.js} +1 -1
  88. package/dist/web/assets/{VirtualDirectoryList-XB8MT97E.js → VirtualDirectoryList-BkV3gj5E.js} +1 -1
  89. package/dist/web/assets/{VisuallyHidden-BLRDANy_.js → VisuallyHidden-B8wfJ_mU.js} +1 -1
  90. package/dist/web/assets/{VisuallyHiddenInput-D-GgOU3T.js → VisuallyHiddenInput-Bdcr9CwC.js} +1 -1
  91. package/dist/web/assets/WidgetSlot-DFojQaSo.js +2 -0
  92. package/dist/web/assets/_plugin-vue_export-helper-B9AJmZbc.js +9 -0
  93. package/dist/web/assets/{agent-apps-CQf2Eba8.js → agent-apps-CKGFfySp.js} +1 -1
  94. package/dist/web/assets/{agent-avatar-lPJyVS9O.js → agent-avatar-V6M_DF3r.js} +1 -1
  95. package/dist/web/assets/agent-occupation-PZ2YAIM8.js +1 -0
  96. package/dist/web/assets/{agent-pins-CoyKIkO2.js → agent-pins-8KX0ynzy.js} +1 -1
  97. package/dist/web/assets/{agent-workflows-CRdfc5xN.js → agent-workflows-DQlqVOoA.js} +1 -1
  98. package/dist/web/assets/{attach-closest-edge-BIyU46Kh.js → attach-closest-edge-D2qlayPy.js} +1 -1
  99. package/dist/web/assets/{attention-store-BrThOc88.js → attention-store-BnZ8l3kk.js} +1 -1
  100. package/dist/web/assets/{badge-mwWygmG4.js → badge-DX_xrLV6.js} +1 -1
  101. package/dist/web/assets/{button-byjQ5eLH.js → button-CEkPBC1E.js} +1 -1
  102. package/dist/web/assets/{card-Bo5Wyknz.js → card-DNQ0_6vT.js} +1 -1
  103. package/dist/web/assets/{catalog-CgoPKxd_.js → catalog-KnpBkv5t.js} +1 -1
  104. package/dist/web/assets/{checkbox-BB8_0W6A.js → checkbox-DPyLHneg.js} +1 -1
  105. package/dist/web/assets/{client-DmgW-kvA.js → client-CSQcWFRh.js} +1 -1
  106. package/dist/web/assets/{client-connection-model-CrDtN1yF.js → client-connection-model-vO2cap6a.js} +1 -1
  107. package/dist/web/assets/{client-links-store-B7VjTEfO.js → client-links-store-DMqe0MbK.js} +1 -1
  108. package/dist/web/assets/combobox-zUq9bkyM.js +1 -0
  109. package/dist/web/assets/{console-BB2sTsSs.js → console-DaoAO-EO.js} +1 -1
  110. package/dist/web/assets/{context-menu-DW29av0t.js → context-menu-CcGDnF_k.js} +1 -1
  111. package/dist/web/assets/{conversation-launcher-settings-DVd61o9s.js → conversation-launcher-settings-CXFE-q_A.js} +1 -1
  112. package/dist/web/assets/{dialog-CHAmruFj.js → dialog-CxhKMo0D.js} +1 -1
  113. package/dist/web/assets/{dist-Bz5tCO-_.js → dist-B9GqMC5C.js} +1 -1
  114. package/dist/web/assets/{dist-B9snV3GY.js → dist-DIJqkL4O.js} +1 -1
  115. package/dist/web/assets/dropdown-menu-CXmMnCBh.js +1 -0
  116. package/dist/web/assets/{field-ZZb3Sy9Y.js → field-LNsBZqam.js} +1 -1
  117. package/dist/web/assets/{format-bytes-DiEwa-ch.js → format-bytes-Bqefdt37.js} +1 -1
  118. package/dist/web/assets/{identity-4i_OR9WP.js → identity-DRfhWjty.js} +1 -1
  119. package/dist/web/assets/index-B4AMPpl_.css +1 -0
  120. package/dist/web/assets/index-BYIOAXnn.js +2 -0
  121. package/dist/web/assets/{input-BP9Wn4Yk.js → input-UoZ-0Xne.js} +1 -1
  122. package/dist/web/assets/{label-xRSp2rqO.js → label-DpjbTOxt.js} +1 -1
  123. package/dist/web/assets/label-table-BnWNYfyk.js +1 -0
  124. package/dist/web/assets/{model-CidDnNzT.js → model-13BQndfF.js} +1 -1
  125. package/dist/web/assets/{model-P1cRTtx9.js → model-B5g0CFcM.js} +1 -1
  126. package/dist/web/assets/{model-DiJvQFH-.js → model-BYKHVgJr.js} +1 -1
  127. package/dist/web/assets/{model-4BHOc7rR.js → model-CDevUwUw.js} +1 -1
  128. package/dist/web/assets/{model-DRrCt6Xz.js → model-CpuIG8Du.js} +1 -1
  129. package/dist/web/assets/{model-CxmTkWuw.js → model-P5fSGsiJ.js} +1 -1
  130. package/dist/web/assets/{model-6a2cm5q3.js → model-pJ6k3zYD.js} +1 -1
  131. package/dist/web/assets/{motion-eJ8Y9ulR.js → motion-C-ZimCUS.js} +1 -1
  132. package/dist/web/assets/{motion-TN6JdrrU.js → motion-QY5FKKko.js} +1 -1
  133. package/dist/web/assets/{motion-preference-CC0XwuGQ.js → motion-preference-BQiiwhab.js} +1 -1
  134. package/dist/web/assets/{occupation-catalog-C3Hj8p4a.js → occupation-catalog-uDDhZwKK.js} +1 -1
  135. package/dist/web/assets/{option-CdihAKf9.js → option-CcHPBOo6.js} +1 -1
  136. package/dist/web/assets/{page-title-CPUoKkyh.js → page-title-NXphgeQI.js} +1 -1
  137. package/dist/web/assets/{person-profile-Cmkd1uXt.js → person-profile-DXXfpvta.js} +1 -1
  138. package/dist/web/assets/popover-xSRzcSmY.js +1 -0
  139. package/dist/web/assets/popup-host-Bmvrf-2t.js +1 -0
  140. package/dist/web/assets/{profile-model-CmC9A3we.js → profile-model-6gTmScHC.js} +1 -1
  141. package/dist/web/assets/{project-board-layout-BPk55Azx.js → project-board-layout-DBQeP_QP.js} +1 -1
  142. package/dist/web/assets/{project-capture-zRbPkI54.js → project-capture-BhYsDWwJ.js} +1 -1
  143. package/dist/web/assets/{project-origin-BNl8Mqof.js → project-origin-D8jy8EF_.js} +1 -1
  144. package/dist/web/assets/{quick-edit-api-D6Xgntqh.js → quick-edit-api-WLh_88w6.js} +1 -1
  145. package/dist/web/assets/{radio-group-AkUGYCQ8.js → radio-group-B4r78nDh.js} +1 -1
  146. package/dist/web/assets/{role-names-BDswxugG.js → role-names-PECaMfQo.js} +1 -1
  147. package/dist/web/assets/{roundtable-live-C1wc_F30.js → roundtable-live-DFeDF56c.js} +1 -1
  148. package/dist/web/assets/{runtime-dom.esm-bundler-CjD1s0uc.js → runtime-dom.esm-bundler-f39i44Mt.js} +1 -1
  149. package/dist/web/assets/select-_JO3Mxdp.js +1 -0
  150. package/dist/web/assets/{session-launch-offers-2SxrTwBr.js → session-launch-offers-X9b0DwF1.js} +1 -1
  151. package/dist/web/assets/{settings-restart-fHB-lEm8.js → settings-restart-BnwcTv3i.js} +1 -1
  152. package/dist/web/assets/shared-report-BxNVLalR.js +3 -0
  153. package/dist/web/assets/{source-adapters-TLaUKVEM.js → source-adapters-aupsL146.js} +1 -1
  154. package/dist/web/assets/{switch-Cq1rT1Ti.js → switch-B3Y3oE_n.js} +1 -1
  155. package/dist/web/assets/{tabs-B8ccOT5z.js → tabs-BlcZiEMY.js} +1 -1
  156. package/dist/web/assets/{task-card-fields-BkwTMtq6.js → task-card-fields-DAx6zMLz.js} +1 -1
  157. package/dist/web/assets/{task-labels-CVomryt6.js → task-labels-BdDFvSAy.js} +1 -1
  158. package/dist/web/assets/{task-reason-BenU3Ly4.js → task-reason-7WnPreht.js} +1 -1
  159. package/dist/web/assets/{team-sheets-BIFVatFG.js → team-sheets-Cr0ZTPw3.js} +1 -1
  160. package/dist/web/assets/{textarea-CEokSlpT.js → textarea-CRzFqL9a.js} +1 -1
  161. package/dist/web/assets/{ui-Pf0_u3Mo.js → ui-BopQuQfc.js} +1 -1
  162. package/dist/web/assets/{useAgentRecords-B0ODDGeO.js → useAgentRecords-CMtpd3Fj.js} +1 -1
  163. package/dist/web/assets/{useAgentWorkSummary-CNoUxwOW.js → useAgentWorkSummary-BQbhaHov.js} +1 -1
  164. package/dist/web/assets/{useApi-CROJJdhE-CbQwoO_u.js → useApi-CROJJdhE-CRCgNOqq.js} +1 -1
  165. package/dist/web/assets/{useClipboardCopy-Dd9bf8dt.js → useClipboardCopy-DkqKK3wY.js} +1 -1
  166. package/dist/web/assets/{useFocusReturn-DFHFciMS.js → useFocusReturn-BZpVmQnM.js} +1 -1
  167. package/dist/web/assets/{useForwardExpose-D3bCxDJx.js → useForwardExpose-Di-MnbTz.js} +1 -1
  168. package/dist/web/assets/{useForwardPropsEmits-CshHUE63.js → useForwardPropsEmits-L9XcB5DG.js} +1 -1
  169. package/dist/web/assets/useForwardScopeId-CUQFIAIj.js +1 -0
  170. package/dist/web/assets/{useKnowledgeItemPeek-24H5cZzL.js → useKnowledgeItemPeek-PmQJixw5.js} +1 -1
  171. package/dist/web/assets/{useMinimumLoadingDisplay-Br2MBA-0.js → useMinimumLoadingDisplay-CWPiOaDl.js} +1 -1
  172. package/dist/web/assets/{useProjectAgentRoster-BLHF34Hj.js → useProjectAgentRoster-CWVpSsQ3.js} +1 -1
  173. package/dist/web/assets/{useRoutePeek-KvY9hOQI.js → useRoutePeek-DxLVksbJ.js} +1 -1
  174. package/dist/web/assets/useTeamPeople-CDISP0PM.js +1 -0
  175. package/dist/web/assets/{useTeamWork-wKGBRcNv.js → useTeamWork-BTZd_wKs.js} +1 -1
  176. package/dist/web/assets/{useTypeahead-C50w2tTI.js → useTypeahead-pEZNpBls.js} +1 -1
  177. package/dist/web/assets/{utils-_mWlJRpS.js → utils-B4pBTmyh.js} +1 -1
  178. package/dist/web/assets/{utils-CArDYAhe.js → utils-BsxOjD1Q.js} +1 -1
  179. package/dist/web/assets/version-db3QWWjt.js +1 -0
  180. package/dist/web/assets/{vue-router-BzQKabzW.js → vue-router-B79HWW1l.js} +1 -1
  181. package/dist/web/assets/website-YgovUEcN.js +1 -0
  182. package/dist/web/index.html +65 -64
  183. package/docs/client-connections.md +3 -2
  184. package/docs/employee-agents.md +1 -1
  185. package/docs/judgment-and-autonomy.md +2 -2
  186. package/graph-provider/fuli_graph/app.py +4 -0
  187. package/graph-provider/fuli_graph/graph_field_contract.py +10 -2
  188. package/graph-provider/fuli_graph/graph_format_migrations.py +10 -0
  189. package/graph-provider/fuli_graph/knowledge_index_scan.py +120 -0
  190. package/graph-provider/fuli_graph/knowledge_retrieval_models.py +95 -0
  191. package/graph-provider/fuli_graph/knowledge_retrieval_terms.py +116 -0
  192. package/graph-provider/fuli_graph/knowledge_search.py +191 -31
  193. package/graph-provider/fuli_graph/knowledge_semantic.py +87 -0
  194. package/graph-provider/fuli_graph/knowledge_semantic_index.py +98 -0
  195. package/graph-provider/fuli_graph/knowledge_semantic_models.py +72 -0
  196. package/graph-provider/fuli_graph/knowledge_semantic_query.py +19 -0
  197. package/graph-provider/fuli_graph/models.py +4 -0
  198. package/graph-provider/fuli_graph/task_context_routes.py +1 -1
  199. package/graph-provider/pyproject.toml +1 -1
  200. package/native/win32/fuli-win-helper.exe +0 -0
  201. package/npm-shrinkwrap.json +2 -2
  202. package/package.json +1 -1
  203. package/skills/capturing-session-knowledge/SKILL.md +9 -5
  204. package/skills/capturing-session-knowledge/references/retrieval.md +2 -0
  205. package/skills/operating-fuli/SKILL.md +5 -1
  206. package/skills/operating-fuli/references/workflow-recipes.md +1 -1
  207. package/src/agent-kits/client-detection.js +7 -0
  208. package/src/agent-kits/client-installer.js +13 -0
  209. package/src/agent-tools/interface-catalog.js +6 -0
  210. package/src/agent-tools/model-backend-definitions.js +1 -1
  211. package/src/agents/claude-code/lifecycle-hook.js +1 -1
  212. package/src/agents/claude-code/transcript-format-probe.js +31 -0
  213. package/src/agents/codex/lifecycle-hook.js +1 -1
  214. package/src/agents/codex/transcript-format-probe.js +29 -0
  215. package/src/agents/transcript-format-registry.js +34 -0
  216. package/src/agents/transcript-format-scan.js +71 -0
  217. package/src/conversations/preference-lifecycle.js +2 -1
  218. package/src/conversations/reply-citations.js +21 -0
  219. package/src/conversations/stop-auto-close.js +21 -9
  220. package/src/dreaming/run.js +310 -0
  221. package/src/dreaming/scheduler.js +58 -0
  222. package/src/graphiti/current-project-knowledge-search.js +24 -1
  223. package/src/graphiti/federated-search.js +8 -1
  224. package/src/graphiti/provider-client.js +36 -0
  225. package/src/graphiti/task-entry-preferences.js +15 -2
  226. package/src/graphiti/task-entry-read-only.js +28 -0
  227. package/src/graphiti/task-knowledge-recall.js +19 -5
  228. package/src/http/api-router.js +11 -1
  229. package/src/http/dreaming-api-router.js +32 -0
  230. package/src/http/knowledge-item-api-router.js +7 -0
  231. package/src/http/retrieval-terms-api-router.js +37 -0
  232. package/src/http/semantic-api-router.js +26 -0
  233. package/src/local-runtime/lifecycle.js +3 -0
  234. package/src/local-runtime/windows-process-handle.js +9 -3
  235. package/src/mcp/process-registry.js +45 -3
  236. package/src/mcp/runtime.js +2 -1
  237. package/src/mcp/stdio-relay.js +4 -1
  238. package/src/model-backends/adapters/anthropic-messages.js +1 -1
  239. package/src/model-backends/adapters/exchange.js +2 -2
  240. package/src/model-backends/adapters/openai-chat.js +1 -1
  241. package/src/model-backends/adapters/openai-embeddings.js +60 -0
  242. package/src/model-backends/adapters/registry.js +3 -1
  243. package/src/model-backends/adapters/typesafe-systemone.js +1 -1
  244. package/src/model-backends/budget.js +14 -8
  245. package/src/model-backends/config.js +49 -15
  246. package/src/model-backends/decision-contract.js +2 -1
  247. package/src/model-backends/http.js +19 -1
  248. package/src/model-backends/model-fetch.js +37 -0
  249. package/src/model-backends/port.js +165 -67
  250. package/src/model-backends/prompt.js +4 -3
  251. package/src/model-backends/request.js +42 -3
  252. package/src/presence/windows-helper-pin.js +1 -1
  253. package/src/retrieval-terms/fill.js +102 -0
  254. package/src/retrieval-terms/runner.js +50 -0
  255. package/src/retrieval-terms/terms-model.js +99 -0
  256. package/src/semantic/scheduler.js +50 -0
  257. package/src/semantic/semantic-index.js +94 -0
  258. package/src/server.js +16 -1
  259. package/src/system/client-connection-status.js +6 -4
  260. package/src/system/doctor.js +62 -3
  261. package/src/system/mcp-process-scan.js +55 -0
  262. package/src/system/system-service.js +23 -5
  263. package/dist/web/assets/AboutSectionHeading-CiD3M3eG.css +0 -1
  264. package/dist/web/assets/AboutSectionHeading-w5P9g9WB.js +0 -1
  265. package/dist/web/assets/AgentManagement-VWpTW_38.js +0 -7
  266. package/dist/web/assets/AgentMentionCopy-DI23ym95.js +0 -1
  267. package/dist/web/assets/AgentProfilePage-DrqWGjqt.js +0 -5
  268. package/dist/web/assets/DataFormatPage-0Ne27K6I.css +0 -1
  269. package/dist/web/assets/DataFormatPage-D39VmkWL.js +0 -2
  270. package/dist/web/assets/FieldRoot-BZby7Lhw.js +0 -1
  271. package/dist/web/assets/HowtoPage-CKJAtKbM.js +0 -1
  272. package/dist/web/assets/KnowledgeItemEditPage-n0jtTdHB.js +0 -1
  273. package/dist/web/assets/KnowledgePage-CZ9oDt3D.js +0 -1
  274. package/dist/web/assets/KnowledgePeek-J6gHDda8.js +0 -1
  275. package/dist/web/assets/ModelSettingsPage-BwUnvtP6.js +0 -1
  276. package/dist/web/assets/ModelSettingsPage-ConWy_ec.css +0 -1
  277. package/dist/web/assets/PersonalProjectsPage-DM70jshg.js +0 -1
  278. package/dist/web/assets/SettingsPage-aRxdnfBu.js +0 -1
  279. package/dist/web/assets/UiDialog-Cbb3AvXb.js +0 -1
  280. package/dist/web/assets/UiIcon-o5x6Sf-c.js +0 -1
  281. package/dist/web/assets/WidgetSlot-URHq8Let.js +0 -2
  282. package/dist/web/assets/_plugin-vue_export-helper-PxAQThRD.js +0 -9
  283. package/dist/web/assets/agent-occupation-DM6nIHrD.js +0 -1
  284. package/dist/web/assets/combobox-BOXLFvvr.js +0 -1
  285. package/dist/web/assets/dropdown-menu-C0AuLdFm.js +0 -1
  286. package/dist/web/assets/index-CSV9nk7P.js +0 -2
  287. package/dist/web/assets/index-DFt6UfTv.css +0 -1
  288. package/dist/web/assets/label-table-BUAeArKh.js +0 -1
  289. package/dist/web/assets/popover-DyX7FE_t.js +0 -1
  290. package/dist/web/assets/select-CuhUd9VL.js +0 -1
  291. package/dist/web/assets/shared-report-BKhY4rtE.js +0 -3
  292. package/dist/web/assets/useForwardScopeId-Bzm9IM9h.js +0 -1
  293. package/dist/web/assets/useTeamPeople-IATXewrX.js +0 -1
  294. package/dist/web/assets/version-Cw272WBv.js +0 -1
@@ -49,7 +49,7 @@ clients are on this computer, and whether FULI is in each, is
49
49
  [agent-installer](https://github.com/JevonsCode/agent-installer)'s `status` for FULI's product manifest
50
50
  (see [Shared client components](#shared-client-components)); FULI no longer probes clients itself. The
51
51
  list shows each detected client and whether its Fuli integration configuration is still in place: **Connected** (`connected`, current Fuli entry in
52
- config), **Configuration changed** (`changed`, Fuli entry present but differs from this version),
52
+ config), **Update needed** (`changed`, Fuli entry present but differs from this version),
53
53
  **Skills only** (`skills_left`, Fuli MCP entry gone and only skill files remain), **Removed**
54
54
  (`removed` after an earlier connection), **Not connected** (`not_connected`), **Not found**
55
55
  (`not_detected`), or **Cannot confirm** (`unknown`) when FULI's MCP entry cannot be read, parsed,
@@ -247,7 +247,8 @@ in `test/fixtures/installer-manifest-snapshot.json` (`test/agent-kits/installer-
247
247
  | Port busy or setup stops early | Resolve the reported port or runtime conflict; setup stops before modifying Agent configs |
248
248
  | Settings shows **Connected** (`connected`), but tools are missing or a call fails | Reload and trust the MCP server in the client; quit and reopen apps that read config only at launch; open a new task |
249
249
  | Codex Hooks not running or exit with untrusted notice | Review and trust the Hooks in Codex with `/hooks` (setup never bypasses host trust) |
250
- | Settings shows **Configuration changed** (`changed`) or **Connected** (`connected`) after an upgrade | Run `fuli setup --yes --connected-only` to refresh clients that still have a Fuli MCP entry in their config |
250
+ | Settings shows **Update needed** (`changed`) or **Connected** (`connected`) after an upgrade | Run `fuli setup --yes --connected-only` to refresh clients that still have a Fuli MCP entry in their config |
251
+ | A client row says open sessions need a restart | FULI changed that client's Skills or hooks after those sessions started. Restart them; the prompt clears by itself. **Connected** only means the files are current, and a Skill's receipt keeps the version that last changed it, so Skills of one client can show different versions while all are current |
251
252
  | Settings shows **Skills only** (`skills_left`), **Removed** (`removed`), **Not connected** (`not_connected`), or client is newly installed | Run a full `fuli setup`. `--connected-only` skips clients without a Fuli MCP entry and leaves existing Skills unchanged |
252
253
  | Unsure whether local UI / graph services are running | Run `fuli status` (and `fuli start` or `fuli restart` if stopped) |
253
254
 
@@ -261,4 +261,4 @@ With `review: true`, a card for one project also carries Bole's suggested next s
261
261
 
262
262
  Every result Bole's `performance_review`, the Assistant's `project_candidate` and Jefa's `board_match` returned after asking their own model (suggested, superseded, stopped or handed back to the session) is also recorded, as the session received it then but without the session guidance, in `role-suggestions.sqlite`, and only while recording is on for that call: the capture decision for the task's (or, for Bole, this client's and the project's) scope is read after the model answered, and anything that cannot be read records nothing. Turning recording off never changes what the role returns. Settings → 模型与用量 lists them under 「建议记录」, together with the knowledge reviews Tonborg left to the person (docs/judgment-and-autonomy.md, 「Suggestions in the console」), with the model, the time each was made, the readable evidence (Bole's cited dimensions) and, for a stop or a supersession, the reason in plain words. These are records of what was said at the time, never a to-do: a suggestion followed by a newer one for the same Agent or conversation reads 「已有更新」, and whether anything is still to do is answered by the page each action opens (the Assistant's unclaimed conversations, the task on Jefa's board, Bole's score card read-only), which says when it cannot tell. Nothing there applies a suggestion or treats it as permission. The console reads them at `GET /api/model-backends/suggestions`, like its other full reads: loopback only, a LAN device with its LAN code included, and only after the console server confirmed its own human-review proof (rec#11 D-60, docs/judgment-and-autonomy.md, 「Console trust boundary」); no Agent tool reads them. The server attaches that proof itself, so a local process can still read the list over loopback HTTP; FULI is a local tool and has no console login (rec#11 D-70). The list shows the last 90 days; rows older than that or beyond the newest 300 are deleted when the next record is written, not on expiry, and a plain delete is not an erasure of the disk. A record names Agents, conversations, projects and board tasks, never a knowledge item, so FULI cannot tell which model reason quoted knowledge a person permanently deletes. A permanent delete therefore clears the words of every record of that space written up to the delete's own recorded time (the hint, the model's reason and uncertainty, and the project and task names it showed), keeping only its time, role, status and target IDs; the section shows such a record as 「内容已因彻底删除清除」. Every later cleanup run of the same delete (a retry, recovery at console start, an old link's status page) uses that same time, so it never reaches a record written after the delete. A new record is stored without words while a delete in the space is still open, and also when a delete was open or began after its role read its evidence, since the model may have answered from knowledge that is gone since. FULI has no personal-project or conversation deletion today (projects are archived), so no such deletion clears these records yet.
263
263
 
264
- Each role's row under Settings → 模型与用量 also has a collapsed 「变更记录 / Change history」: every change saved from the console to the role's effective model settings (each changed field, before and after, for the role and the connection it names; a role sharing a saved connection gets its own entry marked as changed through the other role's settings) and to its 「只给建议」 switch or warning acknowledgement, newest first with its time (rec#11 D-42). A key reference is shown only as replaced, never by its value; keys never reach the record. The rows are kept in `model-settings-history.sqlite`, cannot be edited or deleted and are never pruned; Agents read them at `GET /api/model-backends/history?role=&limit=`. A save that changes nothing records nothing. If a change cannot be recorded it still stays saved, and the save answers `history: "not_recorded"`. Without naming a cause, the list notes 「这里有修改没有记录下来」 where a record does not start from what the one before it left, and 「当前设置与最后一条记录不一致」 on top when `model-backends.json` or a role's execution mode is newer than the latest record; a role whose settings existed before the first recorded save, or whose execution mode changed before recording began, ends with 「更早的改动没有记录」.
264
+ Each use's 「查看详情 / Details」 under Settings → 模型与用量 also has a collapsed 「变更记录 / Change history」: every change saved from the console to the role's effective model settings (each changed field, before and after, for the role and the connection it names; a role sharing a saved connection gets its own entry marked as changed through the other role's settings) and to its 「只给建议」 switch or warning acknowledgement, newest first with its time (rec#11 D-42). A key reference is shown only as replaced, never by its value; keys never reach the record. The rows are kept in `model-settings-history.sqlite`, cannot be edited or deleted and are never pruned; Agents read them at `GET /api/model-backends/history?role=&limit=`. A save that changes nothing records nothing. If a change cannot be recorded it still stays saved, and the save answers `history: "not_recorded"`. Without naming a cause, the list notes 「这里有修改没有记录下来」 where a record does not start from what the one before it left, and 「当前设置与最后一条记录不一致」 on top when `model-backends.json` or a role's execution mode is newer than the latest record; a role whose settings existed before the first recorded save, or whose execution mode changed before recording began, ends with 「更早的改动没有记录」.
@@ -25,7 +25,7 @@ A model the person configured for a role is trusted by default (rec#10 D-36). To
25
25
  A review approval is written back without the person only when all of these hold at the moment of the write:
26
26
 
27
27
  - **Tonborg's configured model answered it.** The role is enabled in `model-backends.json`, `knowledge_review` is in its allowed operations, and the role still names the same connection that answered: the same connection id, protocol, endpoint and model. An answer from the current session (no model, a disabled role, or a fallback after the model failed) or from an opted-in legacy CLI is a suggestion, as before this change (`session_answer`). An answer from a connection the role no longer names is not trusted (`connection_changed`), including the same model name on another connection and the same connection with its endpoint changed in place.
28
- - **The role is not set to 「只给建议 / Suggestions only」.** Each role card on the model settings page has this switch; it is off by default. When it is on, every answer is a suggestion (`suggestions_only`).
28
+ - **The role is not set to 「只给建议 / Suggestions only」.** Each role's 「查看详情」 on the model settings page has this switch; it is off by default. When it is on, every answer is a suggestion (`suggestions_only`).
29
29
  - **The person has read the warning.** Next to the switch the card says: 「模型可能判断错,它的判断会直接生效;你可以随时改成「只给建议」,部分写入可在回执里撤回。」 It counts as read only when the person presses 「我已看过 / I have read this」 on the settings page. Opening the page, rendering a receipt or any background read never sets it. Until then the configured model's approval is a suggestion (`warning_not_seen`), and that receipt shows the same warning with a link to the settings page. The item stays a suggestion for the person; it is not asked again while its evidence is unchanged.
30
30
  - **Every rule that applied before still allows it.** Trust relaxes none of them: the autonomy choice (**I decide** keeps every approval a suggestion), items that need attention or have negative or conflicting evidence, the confidence floor, Tonborg's permission for the scope, the role's data-sharing approval for the review's project as it is now (`egress_not_approved`), the capture switch for the scope, globally and for the project (`capture_off`), the hard-delete fence, injection isolation of the evidence, the injection pattern pre-check below, and the Provider's evidence snapshot check. These checks govern what passes through FULI's host; they are not a sandbox.
31
31
 
@@ -93,4 +93,4 @@ Each answers only a loopback request. A request from another device is refused w
93
93
 
94
94
  Agents keep their own tools (`list_judgments`, `review_with_tonborg`, `assess_agent_action`, `assess_task_completion`), and no MCP or Agent tool module imports these routes or the proof check (`test/judgment-console-owner.test.js`). `GET /api/agent-pins` and `GET /api/judgment/policy` hold no history and stay as they were; the undo keeps its own check, since only the human-review channel can send it.
95
95
 
96
- **Known limit: local HTTP callers are trusted.** The console server trusts every local HTTP caller and attaches the proof itself. The proof shows only that the console server holds the token; it shows nothing about who sent the request. So any local process, including an Agent with a shell, can still read the full history over loopback HTTP (for example `GET /api/judgment/records` with only a `Host` header) without reading any token. D-60 makes these routes consistent with the console's other full reads and refuses LAN requests; it does not close that local HTTP path. FULI is a local tool for one person, so the console has no login and none is planned (rec#11 D-70, which drops D-61's console session).
96
+ **Known limit: local HTTP callers are trusted.** The console server trusts every local HTTP caller and attaches the proof itself. The proof shows only that the console server holds the token; it shows nothing about who sent the request. So any local process, including an Agent with a shell, can still read the full history over loopback HTTP (for example `GET /api/judgment/records` with only a `Host` header) without reading any token. D-60 makes these routes consistent with the console's other full reads and refuses LAN requests; it does not close that local HTTP path. FULI is a local tool for one person, so the console has no login and none is planned (rec#11 D-70, which drops D-61's console session). The same holds for every person-only route and for `personWords`: they stop an Agent going through its tools, and they do not stop a process on this computer. An Agent with a shell can call the console, or run `fuli session stop`, as the person could. They prevent mistakes and keep an honest record; they are not a security boundary against a local program.
@@ -151,6 +151,8 @@ from .project_agent_routes import register_project_agent_routes
151
151
  from .knowledge_item_routes import register_knowledge_item_routes
152
152
  from .knowledge_hard_delete_routes import register_knowledge_hard_delete_routes
153
153
  from .knowledge_deletion_watermark import register_knowledge_deletion_watermark_route
154
+ from .knowledge_semantic_index import register_knowledge_semantic_routes
155
+ from .knowledge_retrieval_terms import register_knowledge_retrieval_routes
154
156
  from .knowledge_tag_routes import register_knowledge_tag_routes
155
157
  from .preference_conflicts import (
156
158
  complete_preference_conflict,
@@ -374,6 +376,8 @@ def create_app(settings: Settings | None = None) -> FastAPI:
374
376
  register_knowledge_item_routes(application, store, Actor, ReviewAwareActor, HumanReviewer)
375
377
  register_knowledge_hard_delete_routes(application, store, HumanReviewer)
376
378
  register_knowledge_deletion_watermark_route(application, store, Actor)
379
+ register_knowledge_semantic_routes(application, store, Actor)
380
+ register_knowledge_retrieval_routes(application, store, Actor)
377
381
 
378
382
  @application.post('/v1/publication-drafts', response_model=PublicationDraftRecord)
379
383
  async def create_publication_draft(
@@ -45,7 +45,11 @@ NODE_FIELDS = {
45
45
  'fuli_profile_aspect': 'profile_aspect?', 'fuli_project_agent_id': 'string?',
46
46
  'fuli_qualified_use_count': 'integer?', 'fuli_reasoning_summary': 'string?',
47
47
  'fuli_replaced_by_item_id': 'string?', 'fuli_replaced_by_item_kind': 'item_kind?',
48
- 'fuli_requires_attention': 'boolean?', 'fuli_scope_status': 'string?',
48
+ 'fuli_requires_attention': 'boolean?', 'fuli_retrieval_context': 'string?',
49
+ 'fuli_retrieval_hash': 'string?', 'fuli_retrieval_terms': 'string[]?',
50
+ 'fuli_scope_status': 'string?',
51
+ 'fuli_semantic_hash': 'string?', 'fuli_semantic_model': 'string?',
52
+ 'fuli_semantic_vector': 'float[]?',
49
53
  'fuli_type': 'string?', 'fuli_unresolved_bases': 'string[]?',
50
54
  'fuli_usage_generation': 'integer?', 'fuli_utility_score': 'float?', 'group_id': 'string',
51
55
  'hr_identity_original_agent_id': 'string?', 'name': 'string?', 'name_embedding': 'float[]?',
@@ -689,7 +693,11 @@ RELATIONSHIP_FIELDS = {
689
693
  'fuli_profile_aspect': 'profile_aspect?', 'fuli_qualified_use_count': 'integer?',
690
694
  'fuli_reasoning_summary': 'string?', 'fuli_replaced_by_item_id': 'string?',
691
695
  'fuli_replaced_by_item_kind': 'item_kind?', 'fuli_requires_attention': 'boolean?',
692
- 'fuli_scope_status': 'string?', 'fuli_unresolved_bases': 'string[]?',
696
+ 'fuli_retrieval_context': 'string?', 'fuli_retrieval_hash': 'string?',
697
+ 'fuli_retrieval_terms': 'string[]?',
698
+ 'fuli_scope_status': 'string?', 'fuli_semantic_hash': 'string?',
699
+ 'fuli_semantic_model': 'string?', 'fuli_semantic_vector': 'float[]?',
700
+ 'fuli_unresolved_bases': 'string[]?',
693
701
  'fuli_usage_generation': 'integer?', 'fuli_utility_score': 'float?',
694
702
  'fuli_workflow_condition_json': 'string?',
695
703
  'fuli_workflow_confirmation_authority': 'workflow_confirmation_authority?',
@@ -160,6 +160,16 @@ GRAPH_MIGRATIONS = (
160
160
  builtin_occupations.apply_role_occupations,
161
161
  builtin_occupations.ROLE_OCCUPATION_JOURNAL,
162
162
  ),
163
+ GraphMigration(
164
+ 'graph/17-semantic-vectors', 17, 'schema',
165
+ 'an optional meaning vector on entities and relationships, with its model and text hash',
166
+ fields_only=True,
167
+ ),
168
+ GraphMigration(
169
+ 'graph/18-retrieval-terms', 18, 'schema',
170
+ 'optional retrieval terms and context on entities and relationships, with the hash of the words they came from',
171
+ fields_only=True,
172
+ ),
163
173
  )
164
174
 
165
175
  GRAPH_FORMAT_VERSION = GRAPH_MIGRATIONS[-1].to_version
@@ -0,0 +1,120 @@
1
+ """The items a derived index covers (rec#88, rec#92): those default search
2
+ could return, read one chunk at a time with their own text and the derived
3
+ values stored beside it, and the write lock that pins an item's text while a
4
+ derived value is written.
5
+
6
+ Only current items of the space count, resting on no unresolved basis,
7
+ confirmed by a person or an Agent, and reachable through a scope (a
8
+ preference, an assignment, a source episode or a project reference). Derived
9
+ values (a meaning vector, retrieval terms) are an index: storing one writes no
10
+ history and changes no version, lock_version or timestamp.
11
+ """
12
+ from .search_projection import is_default_retrievable
13
+
14
+ # Items read per query while looking through them.
15
+ SCAN_CHUNK = 500
16
+ ITEM_KINDS = ('entity', 'relationship')
17
+
18
+ _ELIGIBLE = {
19
+ 'entity': '''
20
+ MATCH (item:Entity {group_id: $group_id})
21
+ WHERE item.uuid > $after AND item.fuli_invalid_at IS NULL''',
22
+ 'relationship': '''
23
+ MATCH ()-[item:RELATES_TO {group_id: $group_id}]->()
24
+ WHERE item.uuid > $after AND item.invalid_at IS NULL''',
25
+ }
26
+ _REACHABLE = {
27
+ 'entity': 'EXISTS { MATCH (:Episodic {group_id: $group_id})-[:MENTIONS]->(item) }',
28
+ 'relationship': 'size(coalesce(item.episodes, [])) > 0',
29
+ }
30
+ _SOURCE_EPISODES = {
31
+ 'entity': 'OPTIONAL MATCH (episode:Episodic {group_id: $group_id})-[:MENTIONS]->(item)',
32
+ 'relationship': '''OPTIONAL MATCH (episode:Episodic {group_id: $group_id})
33
+ WHERE episode.uuid IN coalesce(item.episodes, [])''',
34
+ }
35
+ _TEXT = {
36
+ 'entity': 'item.name AS name, item.summary AS summary',
37
+ 'relationship': 'item.name AS name, item.fact AS fact',
38
+ }
39
+ _DERIVED = '''item.fuli_retrieval_terms AS retrieval_terms, item.fuli_retrieval_context AS retrieval_context,
40
+ item.fuli_retrieval_hash AS retrieval_hash,
41
+ item.fuli_semantic_model AS semantic_model, item.fuli_semantic_hash AS semantic_hash'''
42
+
43
+
44
+ def scan_query(item_kind: str) -> str:
45
+ return _ELIGIBLE[item_kind] + '''
46
+ AND size(coalesce(item.fuli_unresolved_bases, [])) = 0
47
+ OPTIONAL MATCH (assignment:FuliKnowledgeAssignment {
48
+ space_id: $space_id, item_kind: $item_kind, item_id: item.uuid
49
+ })
50
+ WITH item, assignment
51
+ WHERE item.fuli_profile_aspect IS NOT NULL OR assignment IS NOT NULL
52
+ OR ''' + _REACHABLE[item_kind] + '''
53
+ OR EXISTS { MATCH (:FuliSpace {id: $space_id})-[:HAS_KNOWLEDGE_REFERENCE]->
54
+ (:FuliKnowledgeProjectReference {item_kind: $item_kind, item_id: item.uuid,
55
+ status: 'active'}) }
56
+ ''' + _SOURCE_EPISODES[item_kind] + '''
57
+ WITH item, assignment, min(episode.fuli_personal_project_id) AS episode_project_id
58
+ RETURN item.uuid AS id, ''' + _TEXT[item_kind] + ''',
59
+ coalesce(item.fuli_confirmation_status, 'pending') AS confirmation_status,
60
+ item.fuli_confirmation_basis_json AS confirmation_basis_json,
61
+ coalesce(assignment.project_id, item.fuli_preference_project_id, episode_project_id)
62
+ AS personal_project_id,
63
+ ''' + _DERIVED + '''
64
+ ORDER BY item.uuid
65
+ LIMIT $chunk
66
+ '''
67
+
68
+
69
+ async def indexable_items(store, space, item_kind: str, after: str = ''):
70
+ """The indexable items of one kind after `after`, in id order."""
71
+ while True:
72
+ records, _, _ = await store.runtime.driver.execute_query(
73
+ scan_query(item_kind), group_id=space['group_id'], space_id=space['id'], item_kind=item_kind,
74
+ after=after, chunk=SCAN_CHUNK, routing_='r')
75
+ for record in records:
76
+ if is_default_retrievable(record):
77
+ yield record
78
+ if len(records) < SCAN_CHUNK:
79
+ return
80
+ after = records[-1]['id']
81
+
82
+
83
+ async def indexable_from(store, space, after: str | None):
84
+ """Every indexable item of every kind from a page cursor on, as (kind, record)."""
85
+ start, item_id = page_cursor(after)
86
+ for kind_index in range(start, len(ITEM_KINDS)):
87
+ item_kind = ITEM_KINDS[kind_index]
88
+ async for record in indexable_items(store, space, item_kind, item_id if kind_index == start else ''):
89
+ yield item_kind, record
90
+
91
+
92
+ def page_cursor(after: str | None) -> tuple[int, str]:
93
+ if not after:
94
+ return 0, ''
95
+ kind, _, item_id = after.partition(':')
96
+ return (ITEM_KINDS.index(kind), item_id) if kind in ITEM_KINDS else (len(ITEM_KINDS), '')
97
+
98
+
99
+ # The item's write lock, held to the commit, then its text: an edit waits, so
100
+ # the text checked is the text a derived value is stored beside. The lock
101
+ # property is removed in the same statement and the item is left as it was.
102
+ _LOCKED_TEXT = {
103
+ 'entity': '''
104
+ MATCH (item:Entity {uuid: $item_id, group_id: $group_id})
105
+ SET item._index_lock = true REMOVE item._index_lock
106
+ RETURN item.name AS name, item.summary AS summary,
107
+ item.fuli_retrieval_terms AS retrieval_terms, item.fuli_retrieval_context AS retrieval_context''',
108
+ 'relationship': '''
109
+ MATCH ()-[item:RELATES_TO {uuid: $item_id, group_id: $group_id}]->()
110
+ SET item._index_lock = true REMOVE item._index_lock
111
+ RETURN item.fact AS fact,
112
+ item.fuli_retrieval_terms AS retrieval_terms, item.fuli_retrieval_context AS retrieval_context''',
113
+ }
114
+
115
+
116
+ async def locked_item(scoped, space, item_kind: str, item_id: str) -> dict | None:
117
+ """Inside a store transaction: lock the item and read its text, or None when it is gone."""
118
+ records, _, _ = await scoped.runtime.driver.execute_query(
119
+ _LOCKED_TEXT[item_kind], item_id=item_id, group_id=space['group_id'])
120
+ return records[0] if records else None
@@ -0,0 +1,95 @@
1
+ """Requests and answers of retrieval terms (rec#92)."""
2
+ from typing import Annotated
3
+
4
+ from pydantic import Field, field_validator, model_validator
5
+
6
+ from .knowledge_audit_models import KnowledgeItemKind
7
+ from .knowledge_semantic_models import Sha256
8
+ from .model_base import StrictModel
9
+
10
+ RETRIEVAL_BATCH_LIMIT = 64
11
+ MAX_TERMS = 24
12
+ MAX_TERM_CHARS = 120
13
+ MAX_CONTEXT_CHARS = 300
14
+ SpaceId = Annotated[str, Field(min_length=1, max_length=128)]
15
+
16
+
17
+ class RetrievalCandidatesRequest(StrictModel):
18
+ personal_space_id: SpaceId
19
+ # Only this project's items; omitted for every project and items no project owns.
20
+ personal_project_id: str | None = Field(default=None, min_length=1, max_length=128)
21
+ limit: int = Field(default=RETRIEVAL_BATCH_LIMIT, ge=1, le=RETRIEVAL_BATCH_LIMIT)
22
+ after: str | None = Field(default=None, min_length=1, max_length=320)
23
+ # Only items without terms for their current text.
24
+ missing_only: bool = True
25
+
26
+
27
+ class RetrievalCandidate(StrictModel):
28
+ item_kind: KnowledgeItemKind
29
+ item_id: str
30
+ personal_project_id: str | None
31
+ title: str
32
+ # The item's own words, which the terms are made from.
33
+ text: str
34
+ has_terms: bool
35
+ # Of `text`: a write whose hash no longer matches is skipped.
36
+ hash: str
37
+
38
+
39
+ class RetrievalCandidatesPage(StrictModel):
40
+ items: list[RetrievalCandidate]
41
+ next: str | None
42
+
43
+
44
+ class RetrievalTermsItem(StrictModel):
45
+ item_kind: KnowledgeItemKind
46
+ item_id: str = Field(min_length=1, max_length=256)
47
+ hash: Sha256
48
+ terms: list[str] = Field(min_length=1, max_length=MAX_TERMS)
49
+ context: str | None = Field(default=None, max_length=MAX_CONTEXT_CHARS)
50
+
51
+ @field_validator('terms')
52
+ @classmethod
53
+ def clean_terms(cls, terms: list[str]) -> list[str]:
54
+ cleaned = list(dict.fromkeys(term.strip() for term in terms if term.strip()))
55
+ if not cleaned:
56
+ raise ValueError('at least one term is required')
57
+ if any(len(term) > MAX_TERM_CHARS for term in cleaned):
58
+ raise ValueError(f'a term has at most {MAX_TERM_CHARS} characters')
59
+ return cleaned
60
+
61
+ @field_validator('context')
62
+ @classmethod
63
+ def clean_context(cls, context: str | None) -> str | None:
64
+ return context.strip() or None if context else None
65
+
66
+
67
+ class RetrievalTermsWrite(StrictModel):
68
+ personal_space_id: SpaceId
69
+ items: list[RetrievalTermsItem] = Field(min_length=1, max_length=RETRIEVAL_BATCH_LIMIT)
70
+
71
+ @model_validator(mode='after')
72
+ def validate_unique(self):
73
+ if len({(item.item_kind, item.item_id) for item in self.items}) != len(self.items):
74
+ raise ValueError('each item may appear once')
75
+ return self
76
+
77
+
78
+ class RetrievalTermsWriteResult(StrictModel):
79
+ written: int = Field(ge=0)
80
+ # The items whose text changed since their hash was computed, or that are gone.
81
+ skipped: list[str]
82
+
83
+
84
+ class RetrievalStatsRequest(StrictModel):
85
+ personal_space_id: SpaceId
86
+ personal_project_id: str | None = Field(default=None, min_length=1, max_length=128)
87
+
88
+
89
+ class RetrievalStats(StrictModel):
90
+ items: int = Field(ge=0)
91
+ with_terms: int = Field(ge=0)
92
+ # Characters of the items' own words, all of them and those still without terms:
93
+ # what an estimate of the fill's cost starts from.
94
+ chars: int = Field(ge=0)
95
+ missing_chars: int = Field(ge=0)
@@ -0,0 +1,116 @@
1
+ """Retrieval terms (rec#92): the other ways someone would ask for an item,
2
+ stored beside it so word search and the meaning index find it by them.
3
+
4
+ Knowledge saved before FULI asked for search terms has only its own words.
5
+ Node asks a model for the missing terms of each item and stores them here.
6
+ They are derived data, like a meaning vector: storing them writes no history
7
+ and no human-change record, changes no version, lock_version or timestamp,
8
+ and nothing waits for a person. Each set keeps the hash of the item's words it
9
+ was made from, so an edit leaves the item without current terms again.
10
+ """
11
+ from .knowledge_index_scan import ITEM_KINDS, indexable_from, indexable_items, locked_item
12
+ from .knowledge_item_view import personal_reader_space
13
+ from .knowledge_retrieval_models import (
14
+ RetrievalCandidate,
15
+ RetrievalCandidatesPage,
16
+ RetrievalCandidatesRequest,
17
+ RetrievalStats,
18
+ RetrievalStatsRequest,
19
+ RetrievalTermsWrite,
20
+ RetrievalTermsWriteResult,
21
+ )
22
+ from .knowledge_semantic import item_text, semantic_hash
23
+ from .store_transactions import query_store_transaction
24
+
25
+
26
+ def _current(item_kind: str, record) -> tuple[str, str, bool]:
27
+ """The item's own words, their hash, and whether its stored terms were made from them."""
28
+ text = item_text(item_kind, record)
29
+ text_hash = semantic_hash(text)
30
+ return text, text_hash, bool(record.get('retrieval_terms')) and record.get('retrieval_hash') == text_hash
31
+
32
+
33
+ def _in_project(record, personal_project_id: str | None) -> bool:
34
+ return personal_project_id is None or record['personal_project_id'] == personal_project_id
35
+
36
+
37
+ async def retrieval_candidates(store, actor, request: RetrievalCandidatesRequest) -> RetrievalCandidatesPage:
38
+ space = await personal_reader_space(store, actor, request.personal_space_id)
39
+ items = []
40
+ async for item_kind, record in indexable_from(store, space, request.after):
41
+ if not _in_project(record, request.personal_project_id):
42
+ continue
43
+ text, text_hash, has_terms = _current(item_kind, record)
44
+ if not text or (request.missing_only and has_terms):
45
+ continue
46
+ if len(items) == request.limit:
47
+ last = items[-1]
48
+ return RetrievalCandidatesPage(items=items, next=f'{last.item_kind}:{last.item_id}')
49
+ items.append(RetrievalCandidate(
50
+ item_kind=item_kind, item_id=record['id'], personal_project_id=record['personal_project_id'],
51
+ title=(record.get('name') if item_kind == 'entity' else None) or text[:120], text=text,
52
+ has_terms=has_terms,
53
+ hash=text_hash))
54
+ return RetrievalCandidatesPage(items=items, next=None)
55
+
56
+
57
+ async def retrieval_stats(store, actor, request: RetrievalStatsRequest) -> RetrievalStats:
58
+ space = await personal_reader_space(store, actor, request.personal_space_id)
59
+ counts = {'items': 0, 'with_terms': 0, 'chars': 0, 'missing_chars': 0}
60
+ for item_kind in ITEM_KINDS:
61
+ async for record in indexable_items(store, space, item_kind):
62
+ if not _in_project(record, request.personal_project_id):
63
+ continue
64
+ text, _, has_terms = _current(item_kind, record)
65
+ if not text:
66
+ continue
67
+ counts['items'] += 1
68
+ counts['chars'] += len(text)
69
+ if has_terms:
70
+ counts['with_terms'] += 1
71
+ else:
72
+ counts['missing_chars'] += len(text)
73
+ return RetrievalStats(**counts)
74
+
75
+
76
+ _STORE_TERMS = {
77
+ 'entity': '''
78
+ MATCH (item:Entity {uuid: $item_id, group_id: $group_id})
79
+ SET item.fuli_retrieval_terms = $terms, item.fuli_retrieval_context = $context,
80
+ item.fuli_retrieval_hash = $hash''',
81
+ 'relationship': '''
82
+ MATCH ()-[item:RELATES_TO {uuid: $item_id, group_id: $group_id}]->()
83
+ SET item.fuli_retrieval_terms = $terms, item.fuli_retrieval_context = $context,
84
+ item.fuli_retrieval_hash = $hash''',
85
+ }
86
+
87
+
88
+ async def write_retrieval_terms(store, actor, request: RetrievalTermsWrite) -> RetrievalTermsWriteResult:
89
+ space = await personal_reader_space(store, actor, request.personal_space_id)
90
+ written, skipped = 0, []
91
+ # One transaction: terms never land beside words other than those they were made from.
92
+ async with query_store_transaction(store) as scoped:
93
+ for item in request.items:
94
+ record = await locked_item(scoped, space, item.item_kind, item.item_id)
95
+ if record is None or semantic_hash(item_text(item.item_kind, record)) != item.hash:
96
+ skipped.append(item.item_id)
97
+ continue
98
+ await scoped.runtime.driver.execute_query(
99
+ _STORE_TERMS[item.item_kind], terms=item.terms, context=item.context, hash=item.hash,
100
+ item_id=item.item_id, group_id=space['group_id'])
101
+ written += 1
102
+ return RetrievalTermsWriteResult(written=written, skipped=skipped)
103
+
104
+
105
+ def register_knowledge_retrieval_routes(application, store, Actor) -> None:
106
+ @application.post('/v1/retrieval/candidates', response_model=RetrievalCandidatesPage)
107
+ async def candidates(request: RetrievalCandidatesRequest, actor: Actor):
108
+ return await retrieval_candidates(store, actor, request)
109
+
110
+ @application.post('/v1/retrieval/terms', response_model=RetrievalTermsWriteResult)
111
+ async def terms(request: RetrievalTermsWrite, actor: Actor):
112
+ return await write_retrieval_terms(store, actor, request)
113
+
114
+ @application.post('/v1/retrieval/stats', response_model=RetrievalStats)
115
+ async def stats(request: RetrievalStatsRequest, actor: Actor):
116
+ return await retrieval_stats(store, actor, request)