fuli-context 0.23.0-beta.8 → 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 (505) hide show
  1. package/dist/web/assets/{AboutPage-BHbNacTY.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-BYXraPFM.js +1 -0
  5. package/dist/web/assets/{AgentHand-BGzGOjzl.js → AgentHand-BGGdVdd9.js} +1 -1
  6. package/dist/web/assets/AgentManagement-Bza8k5ra.js +7 -0
  7. package/dist/web/assets/AgentManagement-CeF4mjtg.css +1 -0
  8. package/dist/web/assets/AgentMentionCopy-C72hY2QL.js +1 -0
  9. package/dist/web/assets/{AgentName-C5HzUHaA.js → AgentName-CUjBNQ8j.js} +1 -1
  10. package/dist/web/assets/AgentProfilePage-D5QUzw5N.css +1 -0
  11. package/dist/web/assets/AgentProfilePage-kp7-gRRx.js +5 -0
  12. package/dist/web/assets/AgentServicesPage-IsGaz7FY.js +1 -0
  13. package/dist/web/assets/{AppViewerPage-N5C_6WLz.css → AppViewerPage-CJ0Zy6LA.css} +1 -1
  14. package/dist/web/assets/AppViewerPage-CcOlwxck.js +1 -0
  15. package/dist/web/assets/{BackToTop-SL4ai3_g.js → BackToTop-C3KYEoCW.js} +1 -1
  16. package/dist/web/assets/BoardCardFieldsMenu-BlBWT1j7.js +1 -0
  17. package/dist/web/assets/BoardMoveMenu-Bc7xC1Uh.js +1 -0
  18. package/dist/web/assets/Breadcrumb-BbwBNrG2.css +1 -0
  19. package/dist/web/assets/Breadcrumb-C_xMiD-Z.js +1 -0
  20. package/dist/web/assets/CaptureChangePage-Bekp1aWg.js +1 -0
  21. package/dist/web/assets/ConnectionsPage-BpvecWXD.js +1 -0
  22. package/dist/web/assets/{CopyFixPrompt-CCrPxN5x.js → CopyFixPrompt-Bp-UX4Hq.js} +1 -1
  23. package/dist/web/assets/DataFormatPage-dsy8d3oA.js +2 -0
  24. package/dist/web/assets/DataFormatPage-sSnjjUY4.css +1 -0
  25. package/dist/web/assets/DebugTurnPage-HdFAyc2D.css +1 -0
  26. package/dist/web/assets/DebugTurnPage-cIJV7xDW.js +1 -0
  27. package/dist/web/assets/DebugTurnsPage-B6Te_Alp.js +1 -0
  28. package/dist/web/assets/DebugTurnsPage-BFuOzyWR.css +1 -0
  29. package/dist/web/assets/{DialogTitle-CTKjDGQc.js → DialogTitle-Lj5s6nwG.js} +1 -1
  30. package/dist/web/assets/EmployeeRedirectPage-DnvwJeCN.js +1 -0
  31. package/dist/web/assets/EmployeeScopeDialog-CXNZ62Ab.js +1 -0
  32. package/dist/web/assets/EmployeeWorkbench-BhReI8l6.css +1 -0
  33. package/dist/web/assets/EmployeeWorkbench-DALIO-cM.js +4 -0
  34. package/dist/web/assets/FieldRoot-DRnAC66O.js +1 -0
  35. package/dist/web/assets/FlaGrowth-7wlv31Tl.js +1 -0
  36. package/dist/web/assets/FlaGrowth-BzXY8pcx.css +1 -0
  37. package/dist/web/assets/FlaTaskSheets-CNdaBy1P.js +1 -0
  38. package/dist/web/assets/FlasPage-BCs1Ffpf.js +1 -0
  39. package/dist/web/assets/{FlasPage-Cb6Q5lge.css → FlasPage-SLQDMv47.css} +1 -1
  40. package/dist/web/assets/{button-CaCh3Iim.css → GrowthLoading-CigPij0N.css} +1 -1
  41. package/dist/web/assets/GrowthLoading-Cr8xZwwO.js +1 -0
  42. package/dist/web/assets/HowtoPage-Cv1YQy1s.js +1 -0
  43. package/dist/web/assets/{HowtoPage-BRV2W1Go.css → HowtoPage-t12tDDpS.css} +1 -1
  44. package/dist/web/assets/{InboxPage-DSOmt6VL.js → InboxPage-CgJnymOY.js} +2 -2
  45. package/dist/web/assets/KnowledgeDeleteButton-FEyEvhlR.js +1 -0
  46. package/dist/web/assets/KnowledgeHardDeleteSection-CVwTeMEJ.js +1 -0
  47. package/dist/web/assets/KnowledgeItemEditPage-rwpM8cF1.js +1 -0
  48. package/dist/web/assets/{KnowledgeItemSummaryCard-D1h0e1Hn.js → KnowledgeItemSummaryCard-49EADY_Z.js} +1 -1
  49. package/dist/web/assets/KnowledgeOrganizerPage-7IdnjM3L.js +1 -0
  50. package/dist/web/assets/KnowledgePage-gxqOIZxf.js +1 -0
  51. package/dist/web/assets/KnowledgePeek-Bm5jRVA9.css +1 -0
  52. package/dist/web/assets/KnowledgePeek-CQyCxHFj.js +1 -0
  53. package/dist/web/assets/KnowledgeTurnReceiptPage-BOz7IpaK.js +1 -0
  54. package/dist/web/assets/KnowledgeWorkspace-A7zVb26p.js +4 -0
  55. package/dist/web/assets/KnowledgeWorkspace-DCoVFyf0.css +1 -0
  56. package/dist/web/assets/{MeAvatar-DHJA3h2E.js → MeAvatar-CYVcRiuW.js} +1 -1
  57. package/dist/web/assets/{MeLink-CU7zuYgD.js → MeLink-BdqkzhT6.js} +1 -1
  58. package/dist/web/assets/{MenuSeparator-DV3U0Y8_.js → MenuSeparator-quqkZZXY.js} +1 -1
  59. package/dist/web/assets/ModelSettingsPage-B8jC_uew.js +3 -0
  60. package/dist/web/assets/ModelSettingsPage-DhCn_SF6.css +1 -0
  61. package/dist/web/assets/{NotFoundPage-BMWxdf6r.js → NotFoundPage-Dmn32VWo.js} +1 -1
  62. package/dist/web/assets/OccupationsPage-BVREfX_R.js +1 -0
  63. package/dist/web/assets/OverviewPage-CHyEbdP4.js +1 -0
  64. package/dist/web/assets/OverviewPage-xdF5g6bZ.css +1 -0
  65. package/dist/web/assets/{PageColumns-D7jIeVv6.js → PageColumns-DpfaPeu7.js} +1 -1
  66. package/dist/web/assets/PageOutline-BKBQ1T4d.js +1 -0
  67. package/dist/web/assets/PageOutline-BqVgnlos.css +1 -0
  68. package/dist/web/assets/PersonalProfilePage-Cxp2gn6J.js +1 -0
  69. package/dist/web/assets/PersonalProjectsPage-821imOxR.js +1 -0
  70. package/dist/web/assets/{PinIcon-DzYhXU_p.js → PinIcon-B7dvh7ld.js} +1 -1
  71. package/dist/web/assets/{PopperContent-BnejG-fO.js → PopperContent-DNqbLkNa.js} +1 -1
  72. package/dist/web/assets/{Presence-o9BoSyBV.js → Presence-D3HKb5Hb.js} +1 -1
  73. package/dist/web/assets/ProfileAuthorChip-7HSHODdR.js +1 -0
  74. package/dist/web/assets/ProfileAuthorChip-C_0hzDoP.css +1 -0
  75. package/dist/web/assets/ProjectAgentsPage-DBsXS6Xa.js +5 -0
  76. package/dist/web/assets/{ProjectAgentsPage-Dt37ogX1.css → ProjectAgentsPage-RpfiV2Fm.css} +1 -1
  77. package/dist/web/assets/ProjectJudgmentPolicy-GA33aSRi.js +2 -0
  78. package/dist/web/assets/PublicProjectsPage-PJlBI8IE.js +1 -0
  79. package/dist/web/assets/{RoundtablesPage-C6vo4kl6.css → RoundtablesPage-DK9A9J-y.css} +1 -1
  80. package/dist/web/assets/{RoundtablesPage-B2mqkwwR.js → RoundtablesPage-DT5DUXsa.js} +2 -2
  81. package/dist/web/assets/{RovingFocusGroup-CKxT5j44.js → RovingFocusGroup-BB0d3k17.js} +1 -1
  82. package/dist/web/assets/{RovingFocusItem-Cr-XrVve.js → RovingFocusItem-CFd7tXzD.js} +1 -1
  83. package/dist/web/assets/SessionMigrationPage-BZ1lEDQr.js +1 -0
  84. package/dist/web/assets/SessionRecordsPage-BMAAtIAt.js +1 -0
  85. package/dist/web/assets/SettingsPage-BYNEk6BM.js +1 -0
  86. package/dist/web/assets/SettingsPage-Uj1IpZpS.css +1 -0
  87. package/dist/web/assets/SharedJefaReportPage-g35o6jUb.js +1 -0
  88. package/dist/web/assets/TagVocabularyPage-COubNJXz.js +1 -0
  89. package/dist/web/assets/{TaskBlockerClear-38qdj0bl.js → TaskBlockerClear-B5MpHdlh.js} +1 -1
  90. package/dist/web/assets/{TaskBlockerNotice--X8TtCGj.js → TaskBlockerNotice-CIN0HRiE.js} +1 -1
  91. package/dist/web/assets/{TaskReason-COiuiZVd.js → TaskReason-LQ0CFiKu.js} +1 -1
  92. package/dist/web/assets/{TeamCard-Bl4riuQt.css → TeamCard-CsmWDw2Q.css} +1 -1
  93. package/dist/web/assets/TeamCard-D-kLa5rT.js +1 -0
  94. package/dist/web/assets/TeamCardsWidget-DGX9k0S6.js +1 -0
  95. package/dist/web/assets/{TeamIsland-D8ycFpkZ.js → TeamIsland-BIo-l49b.js} +2 -2
  96. package/dist/web/assets/{Teleport-BAIkXp2z.js → Teleport-C1upABpY.js} +1 -1
  97. package/dist/web/assets/{TextField-BFGv0VA5.js → TextField-ZnmRqG0h.js} +1 -1
  98. package/dist/web/assets/{UiChip-h_SUumBM.js → UiChip-CizeOu1Q.js} +1 -1
  99. package/dist/web/assets/UiDialog-CGTzxn3-.js +1 -0
  100. package/dist/web/assets/{UiDisclosure-BO5EAYyS.js → UiDisclosure-ueMA4jl0.js} +1 -1
  101. package/dist/web/assets/UiIcon-sD1hUsOF.js +1 -0
  102. package/dist/web/assets/{UiIconButton-C0WP-F-p.js → UiIconButton-CCo4NPYv.js} +1 -1
  103. package/dist/web/assets/{UiNotice-NCEwjNQR.js → UiNotice-DGPFbVo7.js} +1 -1
  104. package/dist/web/assets/{UiSegmented-B49yYjJ3.js → UiSegmented-BZ-jqnPE.js} +1 -1
  105. package/dist/web/assets/{UiWeight-DRIwuLUX.js → UiWeight-BRO3oVMZ.js} +1 -1
  106. package/dist/web/assets/{VirtualDirectoryList-Dieq64pn.js → VirtualDirectoryList-BkV3gj5E.js} +1 -1
  107. package/dist/web/assets/{VisuallyHidden-DIWFV5lV.js → VisuallyHidden-B8wfJ_mU.js} +1 -1
  108. package/dist/web/assets/{VisuallyHiddenInput-WxcAZDj2.js → VisuallyHiddenInput-Bdcr9CwC.js} +1 -1
  109. package/dist/web/assets/WidgetSlot-DFojQaSo.js +2 -0
  110. package/dist/web/assets/_plugin-vue_export-helper-B9AJmZbc.js +9 -0
  111. package/dist/web/assets/{agent-apps-CXhZLNMa.js → agent-apps-CKGFfySp.js} +1 -1
  112. package/dist/web/assets/{agent-avatar-xTnj6P4n.js → agent-avatar-V6M_DF3r.js} +1 -1
  113. package/dist/web/assets/agent-occupation-PZ2YAIM8.js +1 -0
  114. package/dist/web/assets/{agent-pins-CMBM9w6b.js → agent-pins-8KX0ynzy.js} +1 -1
  115. package/dist/web/assets/agent-profile-Clb-gYu-.css +1 -0
  116. package/dist/web/assets/{agent-roster-records-pCYzR1as.js → agent-roster-records-PfAgndHp.js} +1 -1
  117. package/dist/web/assets/{agent-workflows-IeF737kp.js → agent-workflows-DQlqVOoA.js} +1 -1
  118. package/dist/web/assets/{attach-closest-edge-B34lttZK.js → attach-closest-edge-D2qlayPy.js} +1 -1
  119. package/dist/web/assets/{attention-store-BTKBC8TZ.js → attention-store-BnZ8l3kk.js} +1 -1
  120. package/dist/web/assets/{badge-Bnc2nVhV.js → badge-DX_xrLV6.js} +1 -1
  121. package/dist/web/assets/button-CEkPBC1E.js +1 -0
  122. package/dist/web/assets/button-CoXXgtY5.css +1 -0
  123. package/dist/web/assets/{card-B2JIXyum.js → card-DNQ0_6vT.js} +1 -1
  124. package/dist/web/assets/{catalog-C8eUDXUx.js → catalog-KnpBkv5t.js} +1 -1
  125. package/dist/web/assets/{checkbox-Blw3CguI.js → checkbox-DPyLHneg.js} +1 -1
  126. package/dist/web/assets/{client-AaxCWoEF.js → client-CSQcWFRh.js} +2 -2
  127. package/dist/web/assets/client-connection-model-vO2cap6a.js +1 -0
  128. package/dist/web/assets/{client-links-store-CmP5Qsfa.js → client-links-store-DMqe0MbK.js} +1 -1
  129. package/dist/web/assets/combobox-zUq9bkyM.js +1 -0
  130. package/dist/web/assets/{console-DtxpKdVW.js → console-DaoAO-EO.js} +1 -1
  131. package/dist/web/assets/{context-menu-DSGaOBX2.js → context-menu-CcGDnF_k.js} +1 -1
  132. package/dist/web/assets/{conversation-launcher-settings-DAL9Kf4y.js → conversation-launcher-settings-CXFE-q_A.js} +1 -1
  133. package/dist/web/assets/{dialog-CwFuZvhM.js → dialog-CxhKMo0D.js} +1 -1
  134. package/dist/web/assets/dist-B9GqMC5C.js +1 -0
  135. package/dist/web/assets/dist-DIJqkL4O.js +1 -0
  136. package/dist/web/assets/dropdown-menu-CXmMnCBh.js +1 -0
  137. package/dist/web/assets/field-LNsBZqam.js +1 -0
  138. package/dist/web/assets/{format-bytes-N7zRFzUD.js → format-bytes-Bqefdt37.js} +1 -1
  139. package/dist/web/assets/{identity-BUFzZs1s.js → identity-DRfhWjty.js} +1 -1
  140. package/dist/web/assets/index-B4AMPpl_.css +1 -0
  141. package/dist/web/assets/index-BYIOAXnn.js +2 -0
  142. package/dist/web/assets/{input-Db1wVnd4.js → input-UoZ-0Xne.js} +1 -1
  143. package/dist/web/assets/{label--RjFNYxb.js → label-DpjbTOxt.js} +1 -1
  144. package/dist/web/assets/label-table-BnWNYfyk.js +1 -0
  145. package/dist/web/assets/{model-crzN3PVX.js → model-13BQndfF.js} +1 -1
  146. package/dist/web/assets/{model-KuA63FiT.js → model-B5g0CFcM.js} +1 -1
  147. package/dist/web/assets/model-BYKHVgJr.js +1 -0
  148. package/dist/web/assets/{model-B5f68kqL.js → model-CDevUwUw.js} +1 -1
  149. package/dist/web/assets/model-CpuIG8Du.js +4 -0
  150. package/dist/web/assets/{model-B5dQs6Zt.js → model-P5fSGsiJ.js} +1 -1
  151. package/dist/web/assets/{model-DOf6QDiY.js → model-pJ6k3zYD.js} +1 -1
  152. package/dist/web/assets/{motion-CeLn8y1x.js → motion-C-ZimCUS.js} +1 -1
  153. package/dist/web/assets/{motion-wEp9RlID.js → motion-QY5FKKko.js} +1 -1
  154. package/dist/web/assets/{motion-preference-DfUreaML.js → motion-preference-BQiiwhab.js} +1 -1
  155. package/dist/web/assets/{occupation-catalog-Crs_Zc8R.js → occupation-catalog-uDDhZwKK.js} +1 -1
  156. package/dist/web/assets/{option-DCSIgajR.js → option-CcHPBOo6.js} +1 -1
  157. package/dist/web/assets/{orchestration-filters-Cu9KEzWE.js → orchestration-filters-DmF4Qs8E.js} +1 -1
  158. package/dist/web/assets/{page-title-Bvm24KbY.js → page-title-NXphgeQI.js} +1 -1
  159. package/dist/web/assets/{person-profile-Cf0Sytyw.js → person-profile-DXXfpvta.js} +1 -1
  160. package/dist/web/assets/popover-xSRzcSmY.js +1 -0
  161. package/dist/web/assets/popup-host-Bmvrf-2t.js +1 -0
  162. package/dist/web/assets/{profile-model-DkDH6Qth.js → profile-model-6gTmScHC.js} +1 -1
  163. package/dist/web/assets/{project-board-layout-OeuzohUI.js → project-board-layout-DBQeP_QP.js} +1 -1
  164. package/dist/web/assets/{project-capture-BQAqeAJf.js → project-capture-BhYsDWwJ.js} +1 -1
  165. package/dist/web/assets/{project-origin-CENDtRuK.js → project-origin-D8jy8EF_.js} +1 -1
  166. package/dist/web/assets/{quick-edit-api-Qndjqk1h.js → quick-edit-api-WLh_88w6.js} +1 -1
  167. package/dist/web/assets/{radio-group-pfWejLFt.js → radio-group-B4r78nDh.js} +1 -1
  168. package/dist/web/assets/{role-names-aIXV-sMx.js → role-names-PECaMfQo.js} +1 -1
  169. package/dist/web/assets/{roundtable-live-D7Asm_GB.js → roundtable-live-DFeDF56c.js} +1 -1
  170. package/dist/web/assets/{runtime-dom.esm-bundler-BS2lpl87.js → runtime-dom.esm-bundler-f39i44Mt.js} +1 -1
  171. package/dist/web/assets/save-file-rPduHi2f.js +1 -0
  172. package/dist/web/assets/select-_JO3Mxdp.js +1 -0
  173. package/dist/web/assets/{session-launch-offers-kLW-dRsW.js → session-launch-offers-X9b0DwF1.js} +1 -1
  174. package/dist/web/assets/settings-restart-BnwcTv3i.js +1 -0
  175. package/dist/web/assets/shared-report-BxNVLalR.js +3 -0
  176. package/dist/web/assets/shared-report-mYIyRY9C.css +1 -0
  177. package/dist/web/assets/{source-adapters-CUxqZHz7.js → source-adapters-aupsL146.js} +1 -1
  178. package/dist/web/assets/{switch-Cdz4-JcE.js → switch-B3Y3oE_n.js} +1 -1
  179. package/dist/web/assets/{tabs-C3w1-eMu.js → tabs-BlcZiEMY.js} +1 -1
  180. package/dist/web/assets/{task-board-model-DSr4P56O.js → task-board-model-CmMKsWdY.js} +1 -1
  181. package/dist/web/assets/task-card-fields-DAx6zMLz.js +1 -0
  182. package/dist/web/assets/task-labels-BdDFvSAy.js +1 -0
  183. package/dist/web/assets/{task-reason-BywD_kfi.js → task-reason-7WnPreht.js} +1 -1
  184. package/dist/web/assets/{team-sheets-D8Y--CP4.js → team-sheets-Cr0ZTPw3.js} +1 -1
  185. package/dist/web/assets/{textarea-C228nxbD.js → textarea-CRzFqL9a.js} +1 -1
  186. package/dist/web/assets/{ui-BM8jZcP6.js → ui-BopQuQfc.js} +1 -1
  187. package/dist/web/assets/{useAgentRecords-D7x4xQ9O.js → useAgentRecords-CMtpd3Fj.js} +1 -1
  188. package/dist/web/assets/{useAgentWorkSummary-pc1i6nr0.js → useAgentWorkSummary-BQbhaHov.js} +1 -1
  189. package/dist/web/assets/{useApi-CROJJdhE-DZtkWJZv.js → useApi-CROJJdhE-CRCgNOqq.js} +1 -1
  190. package/dist/web/assets/{useClipboardCopy-sTthF_MD.js → useClipboardCopy-DkqKK3wY.js} +1 -1
  191. package/dist/web/assets/{useFocusReturn-BoyUh5y3.js → useFocusReturn-BZpVmQnM.js} +1 -1
  192. package/dist/web/assets/{useForwardExpose-CqXuqZvd.js → useForwardExpose-Di-MnbTz.js} +1 -1
  193. package/dist/web/assets/{useForwardPropsEmits-0F_e7unJ.js → useForwardPropsEmits-L9XcB5DG.js} +1 -1
  194. package/dist/web/assets/useForwardScopeId-CUQFIAIj.js +1 -0
  195. package/dist/web/assets/useKnowledgeItemPeek-PmQJixw5.js +1 -0
  196. package/dist/web/assets/{useMinimumLoadingDisplay-CzfqbQPs.js → useMinimumLoadingDisplay-CWPiOaDl.js} +1 -1
  197. package/dist/web/assets/useProjectAgentRoster-CWVpSsQ3.js +1 -0
  198. package/dist/web/assets/{useRoutePeek-BDgll9Fy.js → useRoutePeek-DxLVksbJ.js} +1 -1
  199. package/dist/web/assets/useTeamPeople-CDISP0PM.js +1 -0
  200. package/dist/web/assets/{useTeamWork-BSFi27vj.js → useTeamWork-BTZd_wKs.js} +1 -1
  201. package/dist/web/assets/{useTypeahead-D_g4j3Xp.js → useTypeahead-pEZNpBls.js} +1 -1
  202. package/dist/web/assets/{utils-C6vsxGrE.js → utils-B4pBTmyh.js} +1 -1
  203. package/dist/web/assets/utils-BsxOjD1Q.js +1 -0
  204. package/dist/web/assets/version-db3QWWjt.js +1 -0
  205. package/dist/web/assets/{vue-router-BPhQ0Qow.js → vue-router-B79HWW1l.js} +1 -1
  206. package/dist/web/assets/website-YgovUEcN.js +1 -0
  207. package/dist/web/index.html +71 -66
  208. package/docs/agent-interface-architecture.md +13 -4
  209. package/docs/client-connections.md +3 -2
  210. package/docs/employee-agents.md +11 -9
  211. package/docs/judgment-and-autonomy.md +4 -4
  212. package/graph-provider/fuli_graph/app.py +4 -0
  213. package/graph-provider/fuli_graph/collaboration_context.py +3 -7
  214. package/graph-provider/fuli_graph/graph_field_contract.py +10 -2
  215. package/graph-provider/fuli_graph/graph_format_builtin_occupations.py +33 -1
  216. package/graph-provider/fuli_graph/graph_format_migrations.py +18 -0
  217. package/graph-provider/fuli_graph/graph_query.py +3 -12
  218. package/graph-provider/fuli_graph/knowledge_index_scan.py +120 -0
  219. package/graph-provider/fuli_graph/knowledge_outdated.py +9 -1
  220. package/graph-provider/fuli_graph/knowledge_retrieval_models.py +95 -0
  221. package/graph-provider/fuli_graph/knowledge_retrieval_terms.py +116 -0
  222. package/graph-provider/fuli_graph/knowledge_search.py +220 -39
  223. package/graph-provider/fuli_graph/knowledge_semantic.py +87 -0
  224. package/graph-provider/fuli_graph/knowledge_semantic_index.py +98 -0
  225. package/graph-provider/fuli_graph/knowledge_semantic_models.py +72 -0
  226. package/graph-provider/fuli_graph/knowledge_semantic_query.py +19 -0
  227. package/graph-provider/fuli_graph/knowledge_versions.py +14 -7
  228. package/graph-provider/fuli_graph/models.py +4 -0
  229. package/graph-provider/fuli_graph/occupation_catalog.py +6 -3
  230. package/graph-provider/fuli_graph/personal_global_preferences.py +3 -7
  231. package/graph-provider/fuli_graph/preference_versions.py +110 -0
  232. package/graph-provider/fuli_graph/project_agent_models.py +3 -0
  233. package/graph-provider/fuli_graph/project_agent_recruitment_occupation.py +1 -1
  234. package/graph-provider/fuli_graph/provider_values.py +7 -0
  235. package/graph-provider/fuli_graph/search_projection.py +2 -6
  236. package/graph-provider/fuli_graph/store_knowledge.py +10 -1
  237. package/graph-provider/fuli_graph/task_context_routes.py +1 -1
  238. package/graph-provider/pyproject.toml +1 -1
  239. package/native/win32/fuli-win-helper.exe +0 -0
  240. package/npm-shrinkwrap.json +3 -4
  241. package/package.json +2 -1
  242. package/skills/capturing-session-knowledge/SKILL.md +14 -7
  243. package/skills/capturing-session-knowledge/references/capture.md +12 -2
  244. package/skills/capturing-session-knowledge/references/retrieval.md +13 -4
  245. package/skills/grilling-project/SKILL.md +2 -0
  246. package/skills/operating-fuli/SKILL.md +36 -8
  247. package/skills/operating-fuli/references/workflow-recipes.md +10 -9
  248. package/src/agent-apps/host-tools/catalog.js +3 -0
  249. package/src/agent-delegation/agent-tool.js +12 -2
  250. package/src/agent-delegation/delegation-header.js +32 -8
  251. package/src/agent-delegation/entry-prompts.js +54 -0
  252. package/src/agent-delegation/operation-log.js +17 -7
  253. package/src/agent-delegation/person-words.js +38 -0
  254. package/src/agent-delegation/port.js +6 -4
  255. package/src/agent-delegation/refusals.js +14 -0
  256. package/src/agent-kits/client-detection.js +7 -0
  257. package/src/agent-kits/client-installer.js +13 -0
  258. package/src/agent-tools/delegation-definitions.js +5 -3
  259. package/src/agent-tools/diagnostic-definitions.js +23 -0
  260. package/src/agent-tools/graph-definitions.js +4 -0
  261. package/src/agent-tools/graph-handlers.js +6 -1
  262. package/src/agent-tools/interface-catalog.js +47 -17
  263. package/src/agent-tools/model-backend-definitions.js +1 -1
  264. package/src/agent-tools/old-data-definitions.js +16 -0
  265. package/src/agent-tools/task-entry-definitions.js +1 -1
  266. package/src/agent-tools/work-surface-definitions.js +1 -1
  267. package/src/agents/claude-code/lifecycle-hook.js +19 -5
  268. package/src/agents/claude-code/transcript-format-probe.js +31 -0
  269. package/src/agents/codex/lifecycle-hook.js +27 -7
  270. package/src/agents/codex/transcript-format-probe.js +29 -0
  271. package/src/agents/cursor/lifecycle-hook.js +4 -1
  272. package/src/agents/lifecycle-failure.js +27 -0
  273. package/src/agents/lifecycle-message.js +10 -0
  274. package/src/agents/opencode/lifecycle-hook.js +18 -2
  275. package/src/agents/transcript-format-registry.js +34 -0
  276. package/src/agents/transcript-format-scan.js +71 -0
  277. package/src/cli/command-registry.js +3 -0
  278. package/src/cli/diagnostics-command.js +59 -0
  279. package/src/cli/setup-command.js +3 -0
  280. package/src/cli.js +5 -0
  281. package/src/conversations/entry-budget.js +1 -1
  282. package/src/conversations/entry-detail-readers.js +22 -0
  283. package/src/conversations/entry-inline-budget.js +24 -12
  284. package/src/conversations/entry-skeleton.js +27 -9
  285. package/src/conversations/preference-lifecycle.js +2 -1
  286. package/src/conversations/preference-session.js +5 -2
  287. package/src/conversations/preference-snapshot.js +4 -1
  288. package/src/conversations/preference-view.js +5 -1
  289. package/src/conversations/reply-citations.js +21 -0
  290. package/src/conversations/stop-auto-close.js +21 -9
  291. package/src/conversations/task-context-view.js +31 -0
  292. package/src/data-format/backup-retention.js +8 -0
  293. package/src/data-format/local-stores.js +24 -2
  294. package/src/debug-turns/fuli-surface.js +23 -0
  295. package/src/debug-turns/model-capture.js +84 -0
  296. package/src/debug-turns/model-request.js +97 -0
  297. package/src/debug-turns/record.js +178 -0
  298. package/src/debug-turns/recorder.js +53 -0
  299. package/src/debug-turns/store.js +91 -0
  300. package/src/debug-turns/transcript-reader.js +64 -0
  301. package/src/debug-turns/trigger.js +25 -0
  302. package/src/diagnostics/agent-tool.js +14 -0
  303. package/src/diagnostics/event-log.js +133 -0
  304. package/src/diagnostics/failure-records.js +43 -0
  305. package/src/diagnostics/query.js +114 -0
  306. package/src/diagnostics/safe-event.js +83 -0
  307. package/src/dreaming/run.js +310 -0
  308. package/src/dreaming/scheduler.js +58 -0
  309. package/src/employees/builtin/jefa/board-store.js +78 -19
  310. package/src/employees/builtin/jefa/http.js +8 -5
  311. package/src/employees/builtin/jefa/project-board.js +2 -0
  312. package/src/employees/builtin/jefa/tools.js +7 -6
  313. package/src/employees/recruitment.js +20 -2
  314. package/src/employees/service.js +11 -1
  315. package/src/graphiti/agent-growth.js +64 -0
  316. package/src/graphiti/collaboration-preference-projection.js +7 -0
  317. package/src/graphiti/collaboration-preference-workflow.js +3 -3
  318. package/src/graphiti/current-project-knowledge-search.js +24 -1
  319. package/src/graphiti/federated-application.js +19 -1
  320. package/src/graphiti/federated-search.js +8 -1
  321. package/src/graphiti/local-runtimes.js +13 -0
  322. package/src/graphiti/personal-projects.js +11 -0
  323. package/src/graphiti/project-agent-mapping.js +1 -0
  324. package/src/graphiti/project-agent-task-sheets.js +6 -2
  325. package/src/graphiti/project-agent-workflows.js +22 -4
  326. package/src/graphiti/project-profile-authors.js +14 -7
  327. package/src/graphiti/provider-client.js +36 -0
  328. package/src/graphiti/session-knowledge-migration.js +103 -3
  329. package/src/graphiti/session-migration-notices.js +65 -0
  330. package/src/graphiti/session-records.js +22 -4
  331. package/src/graphiti/task-context-entry.js +5 -1
  332. package/src/graphiti/task-entry-preferences.js +31 -2
  333. package/src/graphiti/task-entry-read-only.js +28 -0
  334. package/src/graphiti/task-knowledge-checkpoint.js +2 -0
  335. package/src/graphiti/task-knowledge-recall.js +96 -19
  336. package/src/graphiti/task-remember.js +7 -2
  337. package/src/graphiti/task-update-request.js +13 -0
  338. package/src/graphiti/temporary-project-scope.js +7 -1
  339. package/src/graphiti/turn-receipt-delivery.js +5 -3
  340. package/src/http/agent-delegation-gate.js +5 -4
  341. package/src/http/agent-growth-api-router.js +17 -0
  342. package/src/http/api-router.js +18 -2
  343. package/src/http/capture-onboarding-api-router.js +3 -2
  344. package/src/http/debug-turns-api-router.js +70 -0
  345. package/src/http/diagnostic-events-api-router.js +27 -0
  346. package/src/http/dreaming-api-router.js +32 -0
  347. package/src/http/graph-api-router.js +35 -1
  348. package/src/http/knowledge-item-api-router.js +19 -2
  349. package/src/http/knowledge-scope-api-router.js +3 -2
  350. package/src/http/old-data-api-router.js +47 -0
  351. package/src/http/person-profile-api-router.js +3 -2
  352. package/src/http/retrieval-terms-api-router.js +37 -0
  353. package/src/http/semantic-api-router.js +26 -0
  354. package/src/judgment/agent-view.js +1 -1
  355. package/src/judgment/backend.js +30 -0
  356. package/src/judgment/http.js +2 -1
  357. package/src/judgment/review-prompt.js +2 -0
  358. package/src/judgment/routing.js +10 -2
  359. package/src/judgment/service.js +8 -2
  360. package/src/judgment/store.js +17 -7
  361. package/src/local-runtime/lifecycle.js +3 -0
  362. package/src/local-runtime/windows-process-handle.js +9 -3
  363. package/src/mcp/create-mcp-server.js +42 -25
  364. package/src/mcp/process-registry.js +45 -3
  365. package/src/mcp/runtime.js +2 -1
  366. package/src/mcp/stdio-relay.js +4 -1
  367. package/src/mcp/tool-annotations.js +2 -0
  368. package/src/model-backends/adapters/anthropic-messages.js +1 -1
  369. package/src/model-backends/adapters/exchange.js +2 -2
  370. package/src/model-backends/adapters/openai-chat.js +1 -1
  371. package/src/model-backends/adapters/openai-embeddings.js +60 -0
  372. package/src/model-backends/adapters/registry.js +3 -1
  373. package/src/model-backends/adapters/typesafe-systemone.js +1 -1
  374. package/src/model-backends/budget.js +14 -8
  375. package/src/model-backends/config.js +49 -15
  376. package/src/model-backends/decision-contract.js +2 -1
  377. package/src/model-backends/http.js +19 -1
  378. package/src/model-backends/model-fetch.js +37 -0
  379. package/src/model-backends/port.js +165 -67
  380. package/src/model-backends/prompt.js +4 -3
  381. package/src/model-backends/request.js +42 -3
  382. package/src/native-runtime/runtime.js +28 -4
  383. package/src/old-data/agent-tools.js +17 -0
  384. package/src/old-data/backup-reader.js +78 -0
  385. package/src/old-data/console-actions.js +53 -0
  386. package/src/old-data/guarded-stores.js +18 -0
  387. package/src/old-data/inventory.js +142 -0
  388. package/src/old-data/port.js +53 -0
  389. package/src/person-profile/port.js +2 -1
  390. package/src/presence/windows-helper-pin.js +1 -1
  391. package/src/project-change-log/port.js +65 -0
  392. package/src/project-change-log/store.js +60 -0
  393. package/src/retrieval-terms/fill.js +102 -0
  394. package/src/retrieval-terms/runner.js +50 -0
  395. package/src/retrieval-terms/terms-model.js +99 -0
  396. package/src/security/sensitive-content.js +11 -0
  397. package/src/semantic/scheduler.js +50 -0
  398. package/src/semantic/semantic-index.js +94 -0
  399. package/src/server.js +20 -1
  400. package/src/setup/paths.js +1 -1
  401. package/src/setup/setup.js +7 -0
  402. package/src/system/client-connection-status.js +6 -4
  403. package/src/system/doctor-repair.js +16 -4
  404. package/src/system/doctor.js +75 -3
  405. package/src/system/log-paths.js +11 -0
  406. package/src/system/log-retention.js +2 -8
  407. package/src/system/mcp-process-scan.js +55 -0
  408. package/src/system/resource-monitor.js +18 -2
  409. package/src/system/system-service.js +39 -7
  410. package/src/system/windows-data-acl.js +109 -0
  411. package/src/work-surfaces/port.js +17 -11
  412. package/src/work-surfaces/sources.js +4 -3
  413. package/dist/web/assets/AboutSectionHeading-BOXKE5Le.js +0 -1
  414. package/dist/web/assets/AboutSectionHeading-CiD3M3eG.css +0 -1
  415. package/dist/web/assets/AgentAppsPage-DS2X485q.js +0 -1
  416. package/dist/web/assets/AgentConversations-D7QJVFIo.js +0 -2
  417. package/dist/web/assets/AgentConversations-oZFXZE1X.css +0 -1
  418. package/dist/web/assets/AgentMentionCopy-O6pAjjYE.js +0 -1
  419. package/dist/web/assets/AgentProfilePage-CKCTcTzc.js +0 -2
  420. package/dist/web/assets/AgentProfilePage-D1ha8O3z.css +0 -1
  421. package/dist/web/assets/AgentServicesPage-C3npKkHp.js +0 -1
  422. package/dist/web/assets/AgentWorkbench-CJ4TYQA1.css +0 -1
  423. package/dist/web/assets/AgentWorkbench-D9HGRW-n.js +0 -2
  424. package/dist/web/assets/AppViewerPage-Al4TzYJF.js +0 -1
  425. package/dist/web/assets/BoardMoveMenu-ncWgEitd.js +0 -1
  426. package/dist/web/assets/Breadcrumb-QzjzIJdS.js +0 -1
  427. package/dist/web/assets/Breadcrumb-bsc0JKtG.css +0 -1
  428. package/dist/web/assets/CaptureChangePage-BQdqH2qC.js +0 -1
  429. package/dist/web/assets/ConnectionsPage-Be8jIb93.js +0 -1
  430. package/dist/web/assets/DataFormatPage-0Ne27K6I.css +0 -1
  431. package/dist/web/assets/DataFormatPage-C92rwzHa.js +0 -2
  432. package/dist/web/assets/EmployeeScopeDialog-DdR2DzcW.js +0 -1
  433. package/dist/web/assets/EmployeeTaskBoard-Bo8JT36K.js +0 -3
  434. package/dist/web/assets/EmployeeTaskBoard-Dljjy_L7.css +0 -1
  435. package/dist/web/assets/EmployeeWorkbenchPage-B249Mgle.js +0 -3
  436. package/dist/web/assets/EmployeeWorkbenchPage-BBjZJ6Od.css +0 -1
  437. package/dist/web/assets/FieldRoot-YdKVCBhW.js +0 -1
  438. package/dist/web/assets/FlaTaskSheets-Cm5SLq7J.js +0 -1
  439. package/dist/web/assets/FlasPage-C57gTN5X.js +0 -1
  440. package/dist/web/assets/HowtoPage-CDJScY6b.js +0 -1
  441. package/dist/web/assets/KnowledgeDeleteButton-5EtCPPl4.js +0 -1
  442. package/dist/web/assets/KnowledgeHardDeleteSection-r0lZ7ijb.js +0 -1
  443. package/dist/web/assets/KnowledgeItemEditPage-BStIRllM.js +0 -1
  444. package/dist/web/assets/KnowledgeOrganizerPage-BByk8hbw.js +0 -1
  445. package/dist/web/assets/KnowledgePage-DuWS3bRP.js +0 -1
  446. package/dist/web/assets/KnowledgePeek-BycBJ2xR.js +0 -1
  447. package/dist/web/assets/KnowledgePeek-EvumfJER.css +0 -1
  448. package/dist/web/assets/KnowledgeTurnReceiptPage-DTcDN-pG.js +0 -1
  449. package/dist/web/assets/KnowledgeWorkspace-CJo-6xdn.js +0 -4
  450. package/dist/web/assets/KnowledgeWorkspace-DPBq-At0.css +0 -1
  451. package/dist/web/assets/ModelSettingsPage-C1ghraAh.js +0 -1
  452. package/dist/web/assets/ModelSettingsPage-ConWy_ec.css +0 -1
  453. package/dist/web/assets/OccupationsPage-BY1jej7i.js +0 -1
  454. package/dist/web/assets/OverviewPage-C7YJf-Cq.css +0 -1
  455. package/dist/web/assets/OverviewPage-Dl-H0EBe.js +0 -1
  456. package/dist/web/assets/PersonalProfilePage-BcaVzKM6.js +0 -1
  457. package/dist/web/assets/PersonalProjectsPage-CO4ZYVAI.js +0 -1
  458. package/dist/web/assets/ProjectAgentDetailPage-Bgh78Mr5.js +0 -8
  459. package/dist/web/assets/ProjectAgentDetailPage-h7hr9iee.css +0 -1
  460. package/dist/web/assets/ProjectAgentDialog--T6mU-FW.css +0 -1
  461. package/dist/web/assets/ProjectAgentDialog-DzTor5ky.js +0 -5
  462. package/dist/web/assets/ProjectAgentsPage-CzN183pa.js +0 -1
  463. package/dist/web/assets/ProjectJudgmentPolicy-BMlEBJM3.js +0 -2
  464. package/dist/web/assets/PublicProjectsPage-DAHT31B8.js +0 -1
  465. package/dist/web/assets/SessionMigrationPage-IW07XhmD.js +0 -1
  466. package/dist/web/assets/SessionRecordsPage-Du76tewc.js +0 -1
  467. package/dist/web/assets/SettingsPage-CJNXe313.js +0 -1
  468. package/dist/web/assets/SettingsPage-D3AYCNTC.css +0 -1
  469. package/dist/web/assets/SharedJefaReportPage-dzHSSGhu.js +0 -1
  470. package/dist/web/assets/TagVocabularyPage-C_oV6GFs.js +0 -1
  471. package/dist/web/assets/TeamCard-CdO0RiNB.js +0 -1
  472. package/dist/web/assets/TeamCardsWidget-Cg_kJmb-.js +0 -1
  473. package/dist/web/assets/UiDialog-CUgrU6SQ.js +0 -1
  474. package/dist/web/assets/UiIcon-DPv0eZIU.js +0 -1
  475. package/dist/web/assets/WidgetSlot-BSU_-l_4.js +0 -2
  476. package/dist/web/assets/_plugin-vue_export-helper-DQENg-QE.js +0 -9
  477. package/dist/web/assets/agent-occupation-BvOgDW-q.js +0 -1
  478. package/dist/web/assets/agent-profile-BBqkfac0.css +0 -1
  479. package/dist/web/assets/agent-task-board-Cf9il_1i.js +0 -1
  480. package/dist/web/assets/button-N4FjuQuJ.js +0 -1
  481. package/dist/web/assets/client-connection-model-C3gpYYl7.js +0 -1
  482. package/dist/web/assets/combobox-DHwWXUpj.js +0 -1
  483. package/dist/web/assets/desktop-client-DnfjyLBX.js +0 -1
  484. package/dist/web/assets/dist-BInsvNsv.js +0 -1
  485. package/dist/web/assets/dist-Dc8jFf8M.js +0 -1
  486. package/dist/web/assets/field-BQLn7Hfw.js +0 -1
  487. package/dist/web/assets/index-CXPYDcyq.js +0 -2
  488. package/dist/web/assets/index-x95VDmzK.css +0 -1
  489. package/dist/web/assets/judgment-api-CK9yqrpU.js +0 -1
  490. package/dist/web/assets/label-table-KdyaCTvK.js +0 -1
  491. package/dist/web/assets/model-D4kKYvpj.js +0 -1
  492. package/dist/web/assets/popover-D4YFkL_5.js +0 -1
  493. package/dist/web/assets/project-board-settings-DPP6xKLz.js +0 -1
  494. package/dist/web/assets/project-team-api-7ybLH-uJ.js +0 -1
  495. package/dist/web/assets/save-file-CRxAsski.js +0 -1
  496. package/dist/web/assets/select-CUy1AIwE.js +0 -1
  497. package/dist/web/assets/settings-restart-JYH81qB-.js +0 -1
  498. package/dist/web/assets/shared-report-8p3nBKr-.js +0 -1
  499. package/dist/web/assets/source-coverage-4PsHC9TK.js +0 -1
  500. package/dist/web/assets/task-labels-CXBG2chm.js +0 -1
  501. package/dist/web/assets/useForwardScopeId-DVUFcuwO.js +0 -1
  502. package/dist/web/assets/useKnowledgeItemPeek-KZveY8Wz.js +0 -1
  503. package/dist/web/assets/useTeamPeople-Dna3Yrm3.js +0 -1
  504. package/dist/web/assets/utils-BX1QI2N6.js +0 -1
  505. package/dist/web/assets/version-CBPeq5nI.js +0 -1
@@ -1,7 +1,10 @@
1
+ import { randomUUID } from 'node:crypto';
2
+
1
3
  import { ApplicationError, ApplicationErrorCode } from '../app/application-error.js';
2
4
  import { receiptConsoleUrl } from '../agents/identity-receipt.js';
3
5
  import { requiredString } from '../validation/values.js';
4
6
  import { providerReaderFields, taskKnowledgeReader } from './knowledge-reader.js';
7
+ import { sessionFuliState } from './session-layer-decision.js';
5
8
  import { isTemporaryProjectId } from './temporary-project-scope.js';
6
9
 
7
10
  // rec#20 part 2: what a host session saved while nobody chose where it applies
@@ -12,11 +15,15 @@ import { isTemporaryProjectId } from './temporary-project-scope.js';
12
15
  // the session holds and moves each chosen item through the quick edit's scope
13
16
  // change, in one transaction; an item that changed since the page read it
14
17
  // refuses the whole batch (409 stale_version, naming every such item).
18
+ // rec#82: a move that succeeded is recorded for the session whose items moved
19
+ // (session-migration-notices.js), and that session's next task entry says so
20
+ // in one line of its receipt; the page shows whether it was delivered yet.
15
21
 
16
22
  const ITEM_KINDS = new Set(['entity', 'relationship']);
17
23
  const MAX_SESSION_ID = 256;
18
24
  const MAX_CLIENT = 32;
19
25
  const MAX_PROJECT_ID = 128;
26
+ const MAX_MIGRATION_ID = 128;
20
27
  // The Provider's limit for one migration (SessionMigrationApply).
21
28
  const MAX_ITEMS = 100;
22
29
 
@@ -30,7 +37,11 @@ export function readSessionMigration(application, ownerReads, input) {
30
37
  }
31
38
 
32
39
  // scopeConsole: the console port that sends it on the human-review channel (src/knowledge-scope).
33
- export function applySessionMigration(application, scopeConsole, input) {
40
+ // ownerReads: the console's read port, for what the session still holds afterwards.
41
+ // migrationId: the page's id for this confirm; a repeat of a recorded one
42
+ // answers that move again and sends nothing. A caller without one (a
43
+ // delegated call) gets a fresh id, so its move is recorded once too.
44
+ export async function applySessionMigration(application, scopeConsole, input, { ownerReads = null } = {}) {
34
45
  if (!Array.isArray(input.items) || !input.items.length || input.items.length > MAX_ITEMS) {
35
46
  invalid(`items names 1 to ${MAX_ITEMS} held items`);
36
47
  }
@@ -45,8 +56,97 @@ export function applySessionMigration(application, scopeConsole, input) {
45
56
  if (new Set(items.map(item => `${item.item_kind}:${item.item_id}`)).size !== items.length) {
46
57
  invalid('each item is named once');
47
58
  }
48
- return scopeConsole.applySessionMigration({ ...target(application, input),
49
- reason: requiredString(input.reason, 'reason', 2000), items, operation_actor: 'human' });
59
+ const migrationId = input.migrationId === undefined ? randomUUID()
60
+ : requiredString(input.migrationId, 'migrationId', MAX_MIGRATION_ID);
61
+ const reason = requiredString(input.reason, 'reason', 2000);
62
+ const providerInput = target(application, input);
63
+ const session = noticeSession(providerInput);
64
+ const notices = application.sessionMigrationNotices;
65
+ const earlier = notices?.find(session, migrationId);
66
+ if (earlier && earlier.targetProjectId !== providerInput.target_project_id) {
67
+ invalid('migrationId names another migration');
68
+ }
69
+ if (earlier) return migrationAnswer(application, earlier, session, migrationId);
70
+ const result = await scopeConsole.applySessionMigration({ ...providerInput, reason, items, operation_actor: 'human' });
71
+ const moved = result.moved.map(({ item_kind, item_id }) => ({ item_kind, item_id }));
72
+ const event = { migrationId, targetProjectId: result.target_project_id, moved,
73
+ heldCount: await stillHeld(ownerReads, providerInput) };
74
+ let recorded = null;
75
+ try { recorded = notices?.record(session, event) ?? null; } catch { /* the move stands; the page says it was not recorded */ }
76
+ return migrationAnswer(application, recorded ?? event, session, migrationId, { recorded: Boolean(recorded) });
77
+ }
78
+
79
+ // Whether the session that holds the items was told of one confirmed migration.
80
+ export function readSessionMigrationDelivery(application, input) {
81
+ const session = noticeSession(target(application, input));
82
+ const migrationId = requiredString(input.migrationId, 'migrationId', MAX_MIGRATION_ID);
83
+ const event = application.sessionMigrationNotices?.find(session, migrationId) ?? null;
84
+ return { migration_id: migrationId, delivery: delivery(application, event, session) };
85
+ }
86
+
87
+ // rec#82: the line a session's next task entry carries for the migrations a
88
+ // person confirmed for it: what moved and what still waits there. Plain text,
89
+ // no link and no instruction; nothing at all when none waits.
90
+ export function sessionMigrationNotice(application, task) {
91
+ if (!task?.sessionId || !task.token) return null;
92
+ try {
93
+ const events = application.sessionMigrationNotices?.claim(noticeSession({
94
+ source_application: task.sourceApplication ?? 'other', session_id: task.sessionId }), task.token) ?? [];
95
+ return events.length ? migrationNoticeLine(task, events) : null;
96
+ } catch {
97
+ return null;
98
+ }
99
+ }
100
+
101
+ function migrationNoticeLine(task, events) {
102
+ const byProject = new Map();
103
+ for (const event of events) {
104
+ byProject.set(event.targetProjectId, (byProject.get(event.targetProjectId) ?? 0) + event.moved.length);
105
+ }
106
+ const moved = [...byProject].map(([projectId, count]) =>
107
+ `${count} 条迁入${projectId === task.personalProjectId ? '当前项目' : `项目 ${projectId}`}`).join(',');
108
+ const held = events.at(-1).heldCount;
109
+ const left = held === null ? '' : held ? `,仍有 ${held} 条暂存待定范围` : ',临时项目已清空';
110
+ return `FULI 迁移已确认:${moved}${left}`;
111
+ }
112
+
113
+ async function stillHeld(ownerReads, providerInput) {
114
+ if (!ownerReads) return null;
115
+ try {
116
+ const held = (await ownerReads.sessionMigration({ ...providerInput, include_items: false }))?.held_count;
117
+ return Number.isInteger(held) ? held : null;
118
+ } catch {
119
+ return null;
120
+ }
121
+ }
122
+
123
+ function migrationAnswer(application, event, session, migrationId, { recorded = true } = {}) {
124
+ return { migration_id: migrationId, target_project_id: event.targetProjectId, moved: event.moved,
125
+ held_count: event.heldCount, delivery: recorded ? delivery(application, event, session)
126
+ : { state: 'unreachable', reason: 'not_recorded' } };
127
+ }
128
+
129
+ // waiting: recorded, the session has not started a task since. delivered: its
130
+ // task entry carried the line. unreachable: nothing recorded it, or FULI is
131
+ // stopped in that session, so no entry of it reads anything until it starts again.
132
+ function delivery(application, event, session) {
133
+ if (!event) return { state: 'unreachable', reason: 'not_recorded' };
134
+ if (event.delivery) return { state: 'delivered', delivered_at: event.delivery.at };
135
+ return sessionStopped(application, session.sessionId)
136
+ ? { state: 'unreachable', reason: 'session_stopped' } : { state: 'waiting' };
137
+ }
138
+
139
+ // An unreadable switch is not taken for stopped: the line still waits for the session's next entry.
140
+ function sessionStopped(application, sessionId) {
141
+ try {
142
+ return sessionFuliState(application, sessionId).enabled === false;
143
+ } catch {
144
+ return false;
145
+ }
146
+ }
147
+
148
+ function noticeSession(providerInput) {
149
+ return { sourceApplication: providerInput.source_application, sessionId: providerInput.session_id };
50
150
  }
51
151
 
52
152
  // The receipt line that links the person to the migration page, or null.
@@ -0,0 +1,65 @@
1
+ import { existsSync } from 'node:fs';
2
+ import { dirname, join, resolve } from 'node:path';
3
+
4
+ import { contentHash } from '../../packages/roundtable/src/canonical-json.js';
5
+ import { sha256Bytes } from '../security/digest.js';
6
+ import { jsonFormat, readJsonRecord, updateVersionedJsonFileAtomic } from '../storage/json-format.js';
7
+
8
+ // rec#82: a person's confirmed session migration, kept for the host session
9
+ // that holds the items until that session's next task entry claims it. One
10
+ // file per client and host session, named by their hash, so an entry reads
11
+ // and claims only its own session's events and a session with none reads
12
+ // nothing. An event holds counts and ids only, never knowledge text, and
13
+ // grants nothing. The first task entry to claim an event keeps it; a retry
14
+ // of that same task sees it again, any other task never does.
15
+
16
+ export const SESSION_MIGRATION_NOTICE_FORMAT = jsonFormat({ store: 'session-migration-notice', versions: [1] });
17
+ export const SESSION_MIGRATION_NOTICE_DIRECTORY = 'session-migration-notices';
18
+ const FORMAT_VERSION = 1;
19
+ // A session confirms few migrations; the oldest beyond this are dropped.
20
+ const MAX_EVENTS = 20;
21
+
22
+ export function sessionMigrationNoticesForRuntime(runtimeConfigPath) {
23
+ return createSessionMigrationNotices(runtimeConfigPath
24
+ ? join(dirname(resolve(runtimeConfigPath)), SESSION_MIGRATION_NOTICE_DIRECTORY) : null);
25
+ }
26
+
27
+ // directory: where the session files live, or null when this application has
28
+ // no data directory; then nothing is recorded and nothing can be delivered.
29
+ function createSessionMigrationNotices(directory, { now = () => new Date().toISOString() } = {}) {
30
+ const path = ({ sourceApplication, sessionId }) => join(directory,
31
+ `${contentHash({ purpose: 'session-migration-notice-v1', sourceApplication, sessionId })}.json`);
32
+ const events = session => readJsonRecord(path(session), SESSION_MIGRATION_NOTICE_FORMAT)?.events ?? [];
33
+ return Object.freeze({
34
+ available: Boolean(directory),
35
+ // The completed migration, once per migration id: a repeated record returns the first one unchanged.
36
+ record(session, { migrationId, targetProjectId, moved, heldCount }) {
37
+ if (!directory) return null;
38
+ let stored = null;
39
+ updateVersionedJsonFileAtomic(path(session), SESSION_MIGRATION_NOTICE_FORMAT, current => {
40
+ const kept = current?.events ?? [];
41
+ stored = kept.find(event => event.migrationId === migrationId) ?? null;
42
+ if (stored) return undefined;
43
+ stored = { migrationId, targetProjectId, moved, heldCount, appliedAt: now(), delivery: null };
44
+ return { version: FORMAT_VERSION, events: [...kept, stored].slice(-MAX_EVENTS) };
45
+ });
46
+ return stored;
47
+ },
48
+ find(session, migrationId) {
49
+ if (!directory) return null;
50
+ return events(session).find(event => event.migrationId === migrationId) ?? null;
51
+ },
52
+ // The events this task entry delivers: those nobody claimed yet, and those this same task claimed before.
53
+ claim(session, taskToken) {
54
+ if (!directory || !existsSync(path(session))) return [];
55
+ const task = sha256Bytes(taskToken);
56
+ const result = updateVersionedJsonFileAtomic(path(session), SESSION_MIGRATION_NOTICE_FORMAT, current => {
57
+ if (!current?.events.some(event => !event.delivery)) return undefined;
58
+ const at = now();
59
+ return { ...current, events: current.events.map(event => event.delivery ? event
60
+ : { ...event, delivery: { task, at } }) };
61
+ });
62
+ return (result?.events ?? []).filter(event => event.delivery?.task === task);
63
+ }
64
+ });
65
+ }
@@ -44,14 +44,32 @@ export async function readSessionRecords(application, ownerReads, { personalSpac
44
44
  export async function readOwnSessionRecords(application, { taskContextToken, sourceApplication }) {
45
45
  const task = await application.taskContextRegistry.context(requiredString(taskContextToken, 'taskContextToken', 160),
46
46
  requiredBinding(sourceApplication, 'sourceApplication', MAX_CLIENT));
47
+ const { session, read } = await ownSessionRead(application, task);
48
+ const view = sessionRecordsView(application, session, read);
49
+ // The numbered lines carry every entry once; the same entries again as
50
+ // data would only double what the answer costs.
51
+ return { total: view.total, truncated: view.truncated, url: view.session.url, markdown: sessionRecordsMarkdown(view) };
52
+ }
53
+
54
+ // The person's newest saved messages in a task's own session, as that task's
55
+ // Agent reads the session (the same turns as above), oldest first, each with
56
+ // the turn that holds it: what words an FLA relays as the person's decision
57
+ // are checked against (rec#80). A message is saved when its turn's transcript is.
58
+ export async function recentSessionUserMessages(application, task, limit) {
59
+ const { read } = await ownSessionRead(application, task);
60
+ return read.turns.filter(turn => !turn.hidden).flatMap(turn => turn.messages
61
+ .filter(message => message.role === 'user')
62
+ .map(message => ({ text: message.text, ref: { taskId: turn.task_id ?? null,
63
+ conversationId: turn.conversation_id ?? null, at: message.created_at ?? null } })))
64
+ .sort((left, right) => time(left.ref.at) - time(right.ref.at)).slice(-limit);
65
+ }
66
+
67
+ async function ownSessionRead(application, task) {
47
68
  const session = { sourceApplication: task.sourceApplication, sessionId: task.sessionId };
48
69
  const reader = providerReaderFields(taskKnowledgeReader(task));
49
70
  const read = await providerRead(application, session,
50
71
  body => application.personal.readSessionRecords({ ...body, ...reader }));
51
- const view = sessionRecordsView(application, session, withinReader(read, task));
52
- // The numbered lines carry every entry once; the same entries again as
53
- // data would only double what the answer costs.
54
- return { total: view.total, truncated: view.truncated, url: view.session.url, markdown: sessionRecordsMarkdown(view) };
72
+ return { session, read: withinReader(read, task) };
55
73
  }
56
74
 
57
75
  async function providerRead(application, session, readRecords) {
@@ -2,6 +2,7 @@ import { taskAgentAssignment, withRouteMarkers } from './task-agent-assignment.j
2
2
  import { FLA_ROUTE } from './task-entry-named-fla.js';
3
3
  import { beginConversation } from './agent-conversations.js';
4
4
  import { REMEMBER_GUIDANCE, rememberRequested } from './task-remember.js';
5
+ import { UPDATE_GUIDANCE, updateRequested } from './task-update-request.js';
5
6
  import { withRecoveredSource } from './task-knowledge-recall.js';
6
7
  import { entryAgentReceipt } from './turn-receipt-delivery.js';
7
8
  import { taskPreferenceScope } from '../mcp/provider-task-context-registry.js';
@@ -113,7 +114,9 @@ export async function beginTaskFromPreferences(application, preferences, {
113
114
  // coordination associations. Missing metadata keeps the legacy requirement.
114
115
  // A request to keep something is never a routine auto-closed task.
115
116
  const remembering = rememberRequested(taskPrompt);
116
- const autoClosed = !remembering && ((entryVia === 'hook' && task.entryVia === 'hook') || task.routineAutoCloseEligible === true);
117
+ const updating = updateRequested(taskPrompt);
118
+ const autoClosed = !remembering && !updating
119
+ && ((entryVia === 'hook' && task.entryVia === 'hook') || task.routineAutoCloseEligible === true);
117
120
  const conversation = await beginConversation(application, task);
118
121
  const receipt = preferences.agent_receipt ? await entryAgentReceipt(application, task, preferences.agent_receipt) : null;
119
122
  return withPreferenceScope({
@@ -123,6 +126,7 @@ export async function beginTaskFromPreferences(application, preferences, {
123
126
  checkpoint_required: !autoClosed && task.checkpoint?.phase !== 'complete',
124
127
  ...(autoClosed ? { checkpoint_guidance: STOP_HOOK_CHECKPOINT_GUIDANCE } : {}),
125
128
  ...(remembering ? { remember_guidance: REMEMBER_GUIDANCE } : {}),
129
+ ...(updating ? { update_guidance: UPDATE_GUIDANCE } : {}),
126
130
  resumed_checkpoint: Boolean(resumed),
127
131
  previous_checkpoint_missing: task.previousCheckpointMissing,
128
132
  ...preferences, ...(receipt ? { agent_receipt: receipt } : {}),
@@ -19,13 +19,23 @@ import { withSharedProjectList } from './shared-project-list.js';
19
19
  import { clearSessionTaskBlockers } from './task-blocker-progress.js';
20
20
  import { standingOwnerEntry } from './task-entry-standing-owner.js';
21
21
  import { roundtableAskEntry } from './task-entry-roundtable-ask.js';
22
+ import { isReadOnlyRefusal, readOnlyLifecycle, readOnlyTaskEntry } from './task-entry-read-only.js';
22
23
 
23
24
  export async function finishTaskEntryPreferences(application, preferences, input) {
24
25
  if (!input.agentInvocation || input.agentToolName !== 'get_collaboration_preferences') return preferences;
25
26
  if (!input.sessionId || typeof input.taskPrompt !== 'string') return { ...preferences,
26
27
  task_lifecycle: { status: 'not_started', reason: !input.sessionId ? 'native_session_required' : 'task_prompt_required',
27
28
  guidance: 'Preferences were loaded, but no task token was created. Supply the current host sessionId and taskPrompt to get_collaboration_preferences. Do not guess a session ID, use an MCP process ID or reuse an earlier task token.' } };
28
- return withEntryHint(application, await beginTaskFromPreferences(application, preferences, input), input);
29
+ let entry;
30
+ try {
31
+ entry = await beginTaskFromPreferences(application, preferences, input);
32
+ } catch (error) {
33
+ if (!isReadOnlyRefusal(error)) throw error;
34
+ return { ...preferences, checkpoint_required: false, task_lifecycle: readOnlyLifecycle() };
35
+ }
36
+ // An Agent's own entry keeps no prompt; it drops what the session's earlier task kept.
37
+ keepEntryPrompt(application, entry, input, null);
38
+ return withEntryHint(application, entry, input);
29
39
  }
30
40
 
31
41
  // begin_task_context and the lifecycle hooks: the same hints, once per session each.
@@ -34,7 +44,14 @@ export async function finishTaskEntryPreferences(application, preferences, input
34
44
  export function beginTaskEntry(application, input) {
35
45
  return withSharedProjectList(async () => {
36
46
  if (input.projectPath !== undefined && input.projectPath !== null) application.listPersonalProjects().catch(() => {});
37
- const entry = await beginTaskContext(application, input);
47
+ let entry;
48
+ try {
49
+ entry = await beginTaskContext(application, input);
50
+ } catch (error) {
51
+ if (!isReadOnlyRefusal(error)) throw error;
52
+ return readOnlyTaskEntry(application, input);
53
+ }
54
+ keepEntryPrompt(application, entry, input, input.taskPrompt);
38
55
  // Its task and opening writes are done: a hook deadline from here on
39
56
  // delivers the token instead of nothing (entry-budget.js).
40
57
  noteEntryTask(entry);
@@ -46,6 +63,18 @@ export function beginTaskEntry(application, input) {
46
63
  });
47
64
  }
48
65
 
66
+ // The prompt the relay check reads in this same turn (entry-prompts.js);
67
+ // kept only for a hook's entry, never failing the entry.
68
+ function keepEntryPrompt(application, entry, input, prompt) {
69
+ if (!application.entryPrompts || typeof entry?.taskContextToken !== 'string' || !input.sessionId) return;
70
+ try {
71
+ application.entryPrompts.enter({ token: entry.taskContextToken, sessionId: input.sessionId,
72
+ sourceApplication: input.sourceApplication ?? 'other' }, prompt);
73
+ } catch {
74
+ // Ignore: without it a same-turn relay asks the person again.
75
+ }
76
+ }
77
+
49
78
  // The person replied in this session; the clear is one of its writes, so it
50
79
  // asks the same capture decision as the entry's other writes.
51
80
  async function clearReplyBlockers(application, input) {
@@ -0,0 +1,28 @@
1
+ import { getCollaborationPreferences } from './collaboration-preference-workflow.js';
2
+ import { resolvePreferenceProject } from './preference-project-resolution.js';
3
+
4
+ // While a graph format step waits for the person the graph is read-only, and a
5
+ // task lives in the graph, so no task can begin. The graph stays read-only: a
6
+ // write in the old format is what the wait protects against. What an Agent needs
7
+ // from the entry is all reads, though, so it keeps the person's preferences and
8
+ // recall, records nothing, and says why instead of failing.
9
+ export const READ_ONLY_REASON = 'data_format_read_only';
10
+ const GUIDANCE = 'FULI is waiting for the person to confirm a data format update, so this task is not recorded. '
11
+ + 'Reads and searches work; saving knowledge is refused until then. There is no task token, so make no checkpoint. '
12
+ + 'Tell the person once to confirm it in the FULI console under Settings, Data format. / '
13
+ + 'FULI 的数据格式更新在等用户确认,这次任务不会被记录。读取和搜索照常,保存知识会被拒绝。没有任务 token,不用 checkpoint。'
14
+ + '请告诉用户一次:到 FULI 控制台的「设置 › 数据格式」确认。';
15
+
16
+ export const isReadOnlyRefusal = error => error?.code === READ_ONLY_REASON;
17
+ export const readOnlyLifecycle = () => ({ status: 'not_started', reason: READ_ONLY_REASON, guidance: GUIDANCE });
18
+
19
+ export async function readOnlyTaskEntry(application, { personalProjectId = null, projectPath, taskPrompt = null, sessionId = null,
20
+ sourceSessionId = null, sourceApplication = null, projectAgentId = null, workKind = null, workflow = null }) {
21
+ const projectResolution = await resolvePreferenceProject(application, { personalProjectId, projectPath });
22
+ const preferences = await getCollaborationPreferences(application, projectResolution,
23
+ { projectAgentId, taskPrompt, sessionId, sourceSessionId, workKind, workflow, sourceApplication }, () => {});
24
+ return { context: { personal_space_id: application.config.personal.spaceId, personal_project_id: projectResolution.personalProjectId ?? null },
25
+ effective_preferences: preferences.effective_preferences, scope_unknown: preferences.scope_unknown,
26
+ ...(preferences.task_knowledge_recall ? { task_knowledge_recall: preferences.task_knowledge_recall } : {}),
27
+ checkpoint_required: false, task_lifecycle: readOnlyLifecycle() };
28
+ }
@@ -91,6 +91,8 @@ export async function checkpointTaskKnowledge(application, {
91
91
  );
92
92
  }
93
93
  const finish = async (result, checkpointTask = task, memory = null) => {
94
+ // The turn is finished: the prompt kept for the relay check goes (rec#80).
95
+ try { application.entryPrompts?.checkpointed(task); } catch { /* the next entry replaces it */ }
94
96
  const team = await taskTeam(application, checkpointTask, collaborators);
95
97
  const effectiveLog = workLog ?? { status: 'reported', summary: reason };
96
98
  const conversation = captureCheck.allowed ? await checkpointConversation(application, task, effectiveLog, team)
@@ -8,6 +8,7 @@ import { NEUTRAL, usagePriorLookup } from '../knowledge-impressions/ranking-prio
8
8
 
9
9
  const MAX_QUERIES = 4;
10
10
  const MAX_ITEMS_PER_KIND = 3;
11
+ const TOPIC_ONLY = plan => plan.trigger_categories.length === 1 && plan.trigger_categories[0] === 'topic';
11
12
  const MAX_ITEM_TEXT = 1000;
12
13
  const CONFIRMED = new Set(['confirmed', 'agent_confirmed']);
13
14
  // People confirmed every returned item; reading files only to re-check them costs the tokens recall saves.
@@ -43,6 +44,14 @@ const RECALL_INTENTS = Object.freeze([
43
44
  pattern: /(?:怎么(?:做|办|处理|操作|走)?|如何(?:做|处理|操作|进行)?|怎样(?:做|处理|操作)?|(?:什么|哪(?:个|种)|有没有|是否有|给我|提供|使用|采用|遵循|按照|沿用|走).{0,16}(?:方法|方式|流程|步骤)|(?:方法|方式|流程|步骤).{0,16}(?:是什么|有哪些|怎么|如何|怎样|吗|呢|?|\?)|\brunbook\b|\bprocedure\b|\bhow\s+to\b|(?:what|which|show|give|use|follow|existing|documented).{0,24}\bworkflow\b)/iu,
44
45
  queries: ['方法 方式 流程 步骤 runbook workflow procedure']
45
46
  },
47
+ {
48
+ // rec#63: "our error code convention", "the team that owns the ledger
49
+ // code", "the way we release beta builds" name a stored project fact
50
+ // without saying "previously".
51
+ category: 'project_convention',
52
+ pattern: /(?:约定|规范|惯例|规则|负责人|谁负责|谁来审|我们的|我们(?:一般|通常|都)|convention|policy|\bour\s+[a-z]|\bowns?\b|\bowner\b|who (?:owns|reviews|approves)|the way we|we (?:always|usually|use|agreed|decided))/iu,
53
+ queries: ['约定 规范 规则 负责人 convention policy rule owner']
54
+ },
46
55
  {
47
56
  category: 'prior_context',
48
57
  pattern: /(?:之前|以前|上次|已经存|保存过|记得|照旧|同样|还是用|不用再|先前|约定|定好的|previous|earlier|\bprior\b|last time|remember|same as|again|we (?:decided|agreed|settled|chose))/iu,
@@ -88,6 +97,9 @@ const INDEX_TITLE_BYTES = 40;
88
97
  // search leaves the recall not_needed.
89
98
  const INDEX_MIN_REMAINING_MS = 2000;
90
99
  const INDEX_READ = 'Titles of one bounded search: read one with search_current_project_knowledge before relying on it.';
100
+ // rec#63: after "searched, no match" models stopped looking and copied a
101
+ // stale value from the repository; one quick search is not the whole store.
102
+ const MISS_NEXT = 'One quick search only. Before taking a project value or rule (port, command, owner, convention) from repo files, search_current_project_knowledge for it.';
91
103
 
92
104
  export const TASK_KNOWLEDGE_RETRIEVAL_GUIDANCE = Object.freeze({
93
105
  before_reasking:
@@ -118,12 +130,26 @@ export function planTaskKnowledgeRecall(taskPrompt) {
118
130
  };
119
131
  const matched = RECALL_INTENTS.filter(({ category, pattern }) =>
120
132
  pattern.test(intentPrompt[category] ?? prompt));
133
+ // rec#88: 16 of 20 held-out misses were never searched because the prompt
134
+ // had no cue word. A prompt with words of its own is searched by them; one
135
+ // with none ("继续") has nothing to search for.
121
136
  if (!matched.length) {
122
- return { status: 'not_needed', trigger_categories: [], queries: [] };
137
+ const own = clauseQueries(leadParagraph(taskPrompt).replace(CODE_SPAN, ' '));
138
+ return own.length ? { status: 'planned', trigger_categories: ['topic'], queries: own.slice(0, MAX_QUERIES) }
139
+ : { status: 'not_needed', trigger_categories: [], queries: [] };
123
140
  }
124
- const focus = distinctivePromptTerms(prompt).join(' ').slice(0, 180);
125
- // Named targets already focus every query; a plain question uses its own clauses.
126
- const queries = unique([...(focus ? [] : clauseQueries(prompt)), ...matched.flatMap(({ queries: values }) => values)
141
+ // Named targets already focus every query; otherwise the prompt's own
142
+ // clauses go first. File paths and code names are no target: a fact is
143
+ // stored under its concept ("retry policy", "staging port"), so a query
144
+ // of paths and category words matched none of it (rec#63). Focus, targets and
145
+ // clauses read the lead paragraph (focus falls back to the whole prompt when
146
+ // it names nothing): a name in trailing notes ("WSL Ubuntu", "Windows
147
+ // Node" in pasted environment rules) is not what the task is about.
148
+ const statement = leadParagraph(taskPrompt);
149
+ const leadTerms = distinctivePromptTerms(statement);
150
+ const focus = (leadTerms.length ? leadTerms : distinctivePromptTerms(prompt)).join(' ').slice(0, 180);
151
+ const ownWords = namedTarget(statement) ? [] : clauseQueries(statement.replace(CODE_SPAN, ' '));
152
+ const queries = unique([...ownWords, ...matched.flatMap(({ queries: values }) => values)
127
153
  .map((query) => focus ? `${focus} ${query}` : query)]);
128
154
  return {
129
155
  status: 'planned',
@@ -165,11 +191,12 @@ function withoutRelativeWhere(prompt) {
165
191
 
166
192
  export async function recallTaskKnowledge(application, resolution, taskPrompt, { sourceApplication = null, sessionId = null } = {}) {
167
193
  const plan = planTaskKnowledgeRecall(taskPrompt);
168
- if (plan.status === 'not_needed') {
169
- return await knowledgeIndexRecall(application, resolution, taskPrompt, { sourceApplication, sessionId })
170
- ?? recallWithoutSearch(plan.status, plan);
171
- }
194
+ const unasked = () => knowledgeIndexRecall(application, resolution, taskPrompt, { sourceApplication, sessionId })
195
+ .then(index => index ?? recallWithoutSearch('not_needed', { trigger_categories: [], queries: [] }));
196
+ if (plan.status === 'not_needed') return await unasked();
172
197
  if (plan.status !== 'planned') return recallWithoutSearch(plan.status, plan);
198
+ // Without a project, a prompt no cue asked about reads as before.
199
+ if (!resolution.personalProjectId && TOPIC_ONLY(plan)) return await unasked();
173
200
  if (!resolution.personalProjectId) {
174
201
  return {
175
202
  status: 'project_unresolved',
@@ -218,6 +245,13 @@ export async function recallTaskKnowledge(application, resolution, taskPrompt, {
218
245
  entities,
219
246
  projectScopePriority: 'strict'
220
247
  });
248
+ // A search by the prompt's own words that found nothing, or failed, costs the
249
+ // entry nothing: it reads as before, when no cue asked for one.
250
+ if (TOPIC_ONLY(plan) && !facts.length && !entities.length) {
251
+ // A search that failed (a stopped hook, a Provider down) asks for no index either.
252
+ return failedQueryCount === settlements.length ? recallWithoutSearch('not_needed', { trigger_categories: [], queries: [] })
253
+ : await unasked();
254
+ }
221
255
  const searched = results.length > 0;
222
256
  const result = {
223
257
  status: facts.length || entities.length
@@ -235,6 +269,7 @@ export async function recallTaskKnowledge(application, resolution, taskPrompt, {
235
269
  })
236
270
  } : {}),
237
271
  ...(pendingSlots.length ? { pending_fallback: { slots: pendingSlots, note: PENDING_NOTE } } : {}),
272
+ ...(searched && !facts.length && !entities.length ? { next: MISS_NEXT } : {}),
238
273
  ...(answersFromConfirmed(application) && confirmedByPeople([...facts, ...entities])
239
274
  ? { confirmed_use: CONFIRMED_USE } : {}),
240
275
  facts,
@@ -460,18 +495,60 @@ function distinctivePromptTerms(prompt) {
460
495
  // words appear in it, so one long query of every word matches nothing.
461
496
  const MAX_CLAUSE_QUERIES = 3;
462
497
  const CLAUSE_WORD_LIMIT = 5;
463
- const CLAUSE_STOP_WORDS = new Set(('about after also answer because been before bullet bullets could does from have here into '
464
- + 'just know like list make more most much need only please reply repo short should show some tell than that their them '
465
- + 'then there these they this those three what when where which while will with would your').split(' '));
466
-
498
+ const CLAUSE_HAN_LIMIT = 16;
499
+ // Asking and doing words: they say what to do with a fact, never which one.
500
+ const CLAUSE_STOP_WORDS = new Set(('about add adding after also answer because been before bullet bullets could create '
501
+ + 'does entry existing exporting file folder following from full have here into just keep know like line list make more '
502
+ + 'most much need new now one only please reply repo return returns saying short should show some sure tell than that '
503
+ + 'their them then there these they this those three throw update use using what when where which while will with '
504
+ + 'would write your').split(' '));
505
+ const CLAUSE_HAN_FILLERS = /请|帮我|帮忙|麻烦|一下|我们|你们|这个|那个|一个|然后|还有|的|了|吗|呢|吧/gu;
506
+ // A clause naming a kept fact ("the retry policy we agreed", "who owns it")
507
+ // queries first, so a long change request does not spend the slots on its
508
+ // other clauses.
509
+ const KNOWN_FACT_CUE = /(?:agreed|decided|convention|policy|rule|owns?\b|owner|\breview|the way we|\bour\b|port\b|command|channel|region|约定|规范|规则|负责|端口|地址|命令|渠道|策略|惯例|决定)/iu;
510
+
511
+ // When some clauses name a kept fact, only they query: the rest of a change
512
+ // request ("so tests do not wait") would bring back unrelated items.
467
513
  function clauseQueries(prompt) {
468
- return prompt.split(/[,;:,;:。!?!?]|\.(?:\s|$)|\b(?:and|or|then)\b/iu)
469
- .map((clause) => unique((clause.toLocaleLowerCase('en-US').match(/[a-z][a-z0-9-]{2,}/gu) ?? [])
470
- .filter((word) => !CLAUSE_STOP_WORDS.has(word) && !['the', 'who', 'how', 'for', 'are', 'was'].includes(word)))
471
- .slice(0, CLAUSE_WORD_LIMIT))
472
- .filter((words) => words.length >= 2)
473
- .slice(0, MAX_CLAUSE_QUERIES)
474
- .map((words) => words.join(' '));
514
+ const clauses = prompt.split(/[,;:,;:。!?!?]|\.(?:\s|$)|\b(?:and|or|then)\b/iu);
515
+ const cued = clauses.filter((clause) => KNOWN_FACT_CUE.test(clause));
516
+ return (cued.length ? cued : clauses)
517
+ .map(clauseQuery)
518
+ .filter(Boolean)
519
+ .slice(0, MAX_CLAUSE_QUERIES);
520
+ }
521
+
522
+ function clauseQuery(clause) {
523
+ const words = unique((clause.toLocaleLowerCase('en-US').match(/[a-z][a-z0-9-]{2,}/gu) ?? [])
524
+ .filter((word) => !CLAUSE_STOP_WORDS.has(word) && !['the', 'who', 'how', 'for', 'are', 'was'].includes(word)))
525
+ .slice(0, CLAUSE_WORD_LIMIT);
526
+ // The Provider matches Chinese by character pairs, so the clause's own
527
+ // characters, without filler, are the query.
528
+ const han = (clause.match(/[\p{Script=Han}]+/gu) ?? []).join('').replace(CLAUSE_HAN_FILLERS, '').slice(0, CLAUSE_HAN_LIMIT);
529
+ const query = [han.length >= 4 ? han : '', words.length >= 2 || han.length >= 4 ? words.join(' ') : ''].filter(Boolean).join(' ');
530
+ return query || null;
531
+ }
532
+
533
+ // A name the person gave (a quoted phrase, a product, a URL, a version, an
534
+ // uncommon acronym), not a file path or code identifier.
535
+ const CODE_SPAN = /`[^`]*`/gu;
536
+ const COMMON_ACRONYMS = new Set(['API', 'CI', 'CLI', 'CODEOWNERS', 'CSS', 'CSV', 'HTML', 'HTTP', 'HTTPS', 'ID', 'ISO', 'JS',
537
+ 'JSON', 'NPM', 'PR', 'README', 'SDK', 'SQL', 'TS', 'UI', 'URL', 'UTC', 'YAML']);
538
+
539
+ // The text before the first blank line, as one line; the whole prompt when
540
+ // it has no later paragraph.
541
+ function leadParagraph(taskPrompt) {
542
+ const [lead] = taskPrompt.trim().split(/\r?\n[ \t]*\r?\n/u);
543
+ return singleLine(lead).slice(0, 8192);
544
+ }
545
+
546
+ function namedTarget(prompt) {
547
+ const text = prompt.replace(CODE_SPAN, ' ');
548
+ const identifiers = new Set(text.match(/\b[A-Za-z][A-Za-z0-9]{0,63}[_./-][A-Za-z0-9_.\/-]{1,127}\b/gu) ?? []);
549
+ // A quoted heading or snippet ("## Release") is markup, not a name.
550
+ return distinctivePromptTerms(text).some((term) => !identifiers.has(term) && !COMMON_ACRONYMS.has(term)
551
+ && /^[\p{L}\p{N}]/u.test(term));
475
552
  }
476
553
 
477
554
  // On unless the person asked for every answer to be checked against the files.
@@ -15,8 +15,13 @@ const MAX_ITEMS = 8;
15
15
  // Hosts such as Claude Code keep their own memory files; a request to keep
16
16
  // something must still reach FULI. Detected only on the prompt, so ordinary
17
17
  // tasks carry no extra entry text.
18
- const REMEMBER_REQUEST = /(?:记住|记一下|记下来|别忘|以后要用|\bremember\b|keep in mind|don't forget)/iu;
19
- export const REMEMBER_GUIDANCE = 'The user asked to keep something: record it with checkpoint_task_knowledge remember (preference or project_fact), not only in the host memory files.';
18
+ // rec#63: "make sure this decision is remembered" and "keep this for later
19
+ // sessions" were missed, and the model wrote only a repository file.
20
+ const REMEMBER_REQUEST = new RegExp('(?:记住|记一下|记下来|记好|别忘|以后要用|今后|往后|以后(?:都|也|就)?(?:要|按|用|这样)|下次(?:也|还)?(?:要|按|用)'
21
+ + '|\\bremember(?:ed|s|ing)?\\b|keep in mind|don\'?t forget|from now on|going forward'
22
+ + '|\\b(?:keep|save|note) (?:this|it|that)(?: \\w+){0,2} for (?:later|next time|future)'
23
+ + '|\\bfor (?:later|future) (?:sessions?|work|tasks?|reference)|\\bfuture (?:sessions?|work)\\b)', 'iu');
24
+ export const REMEMBER_GUIDANCE = 'The user asked to keep something: record it with checkpoint_task_knowledge remember (preference or project_fact) before finishing; a repository file or the host memory files are not FULI memory.';
20
25
 
21
26
  export function rememberRequested(taskPrompt) {
22
27
  return typeof taskPrompt === 'string' && REMEMBER_REQUEST.test(taskPrompt);
@@ -0,0 +1,13 @@
1
+ // A prompt that says a kept fact changed ("the channel moved", "now deploys
2
+ // to X, not the region recorded earlier", 改成). In the rec#63 eval the model
3
+ // captured the new statement beside the old one, so both stayed current.
4
+ // Detected only on the prompt, so ordinary tasks carry no extra entry text.
5
+ const UPDATE_REQUEST = new RegExp('(?:\\bmoved\\b|\\binstead of\\b|\\bno longer\\b|\\bcorrection\\b|\\bcorrected\\b'
6
+ + '|\\bnot the (?:\\w+ ){0,3}(?:recorded|remembered|stored|old|previous)|\\bchanged (?:to|from)\\b|\\bhas changed\\b'
7
+ + '|\\bupdate (?:what is remembered|the (?:project )?knowledge|the (?:stored|remembered|recorded)\\b)'
8
+ + '|改成|改为|换成|换到|搬到|不再|更正|纠正|已经变|变成了)', 'iu');
9
+ export const UPDATE_GUIDANCE = 'The user says something kept may have changed: find the current item with search_current_project_knowledge and revise it with revise_personal_knowledge (action update); capture a new item only when none matches, so the old one does not stay current beside it.';
10
+
11
+ export function updateRequested(taskPrompt) {
12
+ return typeof taskPrompt === 'string' && UPDATE_REQUEST.test(taskPrompt);
13
+ }
@@ -1,4 +1,5 @@
1
1
  import { createHash } from 'node:crypto';
2
+ import { ApplicationError } from '../app/application-error.js';
2
3
 
3
4
  export const temporaryProjectScope = Object.freeze({
4
5
  type: 'temporary', lifetime: 'task', persisted: true
@@ -13,6 +14,11 @@ export function isTemporaryProjectId(projectId) {
13
14
 
14
15
  // Explicit coordination owns provisioning. Preference and discovery reads never
15
16
  // create projects. Identity contains no filesystem paths, prompts or host IDs.
17
+ // A task coordinates only in its own project (rec#86: this surfaced as
18
+ // internal_error); it says what to do instead.
19
+ export const otherProjectTask = () => new ApplicationError('task_context_other_project',
20
+ 'This task belongs to another project. Begin a task in the target project with begin_task_context, then coordinate from it.');
21
+
16
22
  export async function resolveCoordinationScope(application, resolution, input, entryTask) {
17
23
  const projectId = resolution.personal_project_id ?? resolution.personalProjectId;
18
24
  if (projectId) {
@@ -24,7 +30,7 @@ export async function resolveCoordinationScope(application, resolution, input, e
24
30
  }
25
31
  if (!['unmatched', 'not_provided'].includes(resolution.status)) return resolution;
26
32
  if (entryTask?.personalProjectId && entryTask.projectScope?.type !== 'temporary') {
27
- throw new TypeError('Coordination task context belongs to another project');
33
+ throw otherProjectTask();
28
34
  }
29
35
  const scopeKey = createHash('sha256').update(JSON.stringify([
30
36
  'fuli-temporary-task-v1', application.config.personal.spaceId,
@@ -2,7 +2,7 @@ import { deferredTurnReceipt, MAX_LIST_EPISODES, readEpisodeReceipts, readTurnRe
2
2
  from '../agents/turn-receipt.js';
3
3
  import { withReceiptLines, withTurnReceipt } from '../agents/identity-receipt.js';
4
4
  import { taskKnowledgeReader } from './knowledge-reader.js';
5
- import { formalTask, sessionMigrationLine, sessionMigrationOffer } from './session-knowledge-migration.js';
5
+ import { formalTask, sessionMigrationLine, sessionMigrationNotice, sessionMigrationOffer } from './session-knowledge-migration.js';
6
6
  import { receiptFormatNotices } from '../data-format/format-notices.js';
7
7
 
8
8
  // When a turn's receipt reaches a reply, exactly once (rec#20). The Provider
@@ -43,13 +43,15 @@ async function savedTurnReceipt(application, task, results, { memory, agentName
43
43
 
44
44
  // A task entry's receipt: the identity line, then what earlier turns saved but
45
45
  // never showed, then the offer to migrate what the session's temporary project
46
- // holds once the session linked to a formal project (rec#20 part 2).
46
+ // holds once the session linked to a formal project (rec#20 part 2), and
47
+ // what a person confirmed moving for this session since its last entry (rec#82).
47
48
  export async function entryAgentReceipt(application, task, receipt) {
48
49
  const format = await receiptFormatNotices(application, { taskId: task.token, includePending: false });
49
50
  if (format.length) receipt = { ...receipt, markdown: [receipt.markdown, ...format].join(' · ') };
50
51
  const late = await unreadTurnReceipt(application, task);
52
+ const confirmed = sessionMigrationNotice(application, task);
51
53
  const migration = await sessionMigrationOffer(application, task);
52
- return withReceiptLines(withTurnReceipt(receipt, late), migration ? [migration] : []);
54
+ return withReceiptLines(withTurnReceipt(receipt, late), [confirmed, migration].filter(Boolean));
53
55
  }
54
56
 
55
57
  // What earlier turns of this session saved but never showed. Each receipt is