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
@@ -0,0 +1,27 @@
1
+ import { dirname } from 'node:path';
2
+
3
+ import { diagnosticEventLog } from '../diagnostics/event-log.js';
4
+ import { errorCode } from '../diagnostics/safe-event.js';
5
+ import { resolveGraphRuntimeOptions } from '../graphiti/runtime-config.js';
6
+ import { hookFailureCause } from './lifecycle-message.js';
7
+
8
+ // A lifecycle hook that failed records it in the data directory's diagnostics
9
+ // log (rec#73), with the same cause its client was shown and the session as
10
+ // correlation. Common to every Agent's hook; each passes its own client and
11
+ // event. Never throws: the hook's answer is already decided.
12
+ export function recordHookFailure({ runtimeConfigPath, client, event, error, sessionId = null, startedAt = null,
13
+ now = Date.now }) {
14
+ if (typeof runtimeConfigPath !== 'string' || !runtimeConfigPath) return false;
15
+ return diagnosticEventLog(dirname(runtimeConfigPath)).record({
16
+ component: 'hook', operation: `${client}.${event ?? 'unknown'}`, outcome: 'failed',
17
+ code: errorCode(error), reason: hookFailureCause(error),
18
+ durationMs: Number.isFinite(startedAt) ? Math.round(now() - startedAt) : null,
19
+ correlationId: typeof sessionId === 'string' ? sessionId : null
20
+ });
21
+ }
22
+
23
+ // The runtime configuration a hook process was started with, as the hook
24
+ // itself resolves it; null when even that cannot be resolved.
25
+ export function runtimeConfigPathOf(args, env = process.env) {
26
+ try { return resolveGraphRuntimeOptions(args, env).runtimeConfigPath; } catch { return null; }
27
+ }
@@ -1,7 +1,17 @@
1
+ import { errorCode } from '../diagnostics/safe-event.js';
2
+
1
3
  // Every listed rule fetch is a model round trip (Codex re-sends its whole
2
4
  // prompt each time), so ordinary tasks must not read the shared rules at all.
3
5
  // A call that carries its task token is decided by that session; without one
4
6
  // it may be refused while another session of the client is off (rec#5 C3b).
7
+ // Why a lifecycle hook failed, as far as it is safe to say (rec#85): an error's
8
+ // code or class, which are fixed identifiers. Never its message, which may carry
9
+ // a prompt, path or credential.
10
+ export function hookFailureCause(error) {
11
+ const code = errorCode(error);
12
+ return code ? `the hook failed: ${code}` : 'the hook failed';
13
+ }
14
+
5
15
  export const PASS_TASK_TOKEN = 'Pass taskContextToken to every FULI call. ';
6
16
  export const TASK_RULES_ON_DEMAND = 'Shared rules are referenced by version. Do not read fuli://rules/task-entry for an ordinary task; read one referenced section only when you must act on it (workers, Agent choices, board writes, memory merge, conflicts).';
7
17
 
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { PASS_TASK_TOKEN, TASK_RULES_ON_DEMAND, taskClosingInstruction } from '../lifecycle-message.js';
2
+ import { hookFailureCause, PASS_TASK_TOKEN, TASK_RULES_ON_DEMAND, taskClosingInstruction } from '../lifecycle-message.js';
3
+ import { recordHookFailure } from '../lifecycle-failure.js';
3
4
  import { compactTaskContext } from '../../conversations/task-context-view.js';
4
5
  import { preferenceHookOutput } from '../../conversations/preference-lifecycle.js';
5
6
  import { sessionFuliCommandResult, sessionFuliEntryRefusal, sessionFuliOffContext } from '../../conversations/session-fuli-entry.js';
@@ -125,6 +126,10 @@ export async function runOpenCodeLifecycleCommand(args, dependencies = {}) {
125
126
  (dependencies.write ?? (value => process.stdout.write(value)))(`${JSON.stringify(output)}\n`);
126
127
  };
127
128
  const budget = entryBudget(timeoutMs);
129
+ const startedAt = Date.now();
130
+ let runtimeConfigPath = null;
131
+ let sessionId = null;
132
+ const readInput = dependencies.readInput ?? readHookInput;
128
133
  let cleanup = async () => {};
129
134
  let deadline;
130
135
  const expired = new Promise(resolve => {
@@ -139,9 +144,20 @@ export async function runOpenCodeLifecycleCommand(args, dependencies = {}) {
139
144
  });
140
145
  try {
141
146
  const running = runWithEntryBudget(budget, () => runOpenCodeLifecycleHook(args, { ...dependencies,
147
+ readInput: async () => { const input = await readInput(); sessionId = input?.session_id ?? null; return input; },
148
+ // The hook's own resolution, kept so a failure is recorded where its data lives.
149
+ resolveRuntimeOptions: (...resolveArgs) => {
150
+ const options = (dependencies.resolveRuntimeOptions ?? resolveGraphRuntimeOptions)(...resolveArgs);
151
+ runtimeConfigPath = options?.runtimeConfigPath ?? null;
152
+ return options;
153
+ },
142
154
  signal: controller.signal, onCleanup: close => { cleanup = close; } }))
143
155
  .then(output => { write(output); return { timedOut: false }; },
144
- () => { write(event === 'prompt' ? { context: openCodeUnavailableContext('the hook failed') } : {}); return { timedOut: false }; });
156
+ (error) => {
157
+ write(event === 'prompt' ? { context: openCodeUnavailableContext(hookFailureCause(error)) } : {});
158
+ recordHookFailure({ runtimeConfigPath, client: 'opencode', event, error, sessionId, startedAt });
159
+ return { timedOut: false };
160
+ });
145
161
  return await Promise.race([running, expired]);
146
162
  } finally {
147
163
  clearTimeout(deadline);
@@ -0,0 +1,34 @@
1
+ import { claudeTranscriptFormat } from './claude-code/transcript-format-probe.js';
2
+ import { codexTranscriptFormat } from './codex/transcript-format-probe.js';
3
+ import { newestTranscript } from './transcript-format-scan.js';
4
+
5
+ // The doctor's port to each Agent's transcript format probe: whether FULI's
6
+ // parser still reads the private transcript format of each client it captures.
7
+ // Answers { [clientId]: { readable: true, recognized, total } | { readable: false, reason } }.
8
+ // Only a transcript changed within the last week counts; a client without one
9
+ // answers no_transcript. The console polls the doctor, so an answer is kept
10
+ // for ten minutes.
11
+ const TRANSCRIPT_FORMATS = Object.freeze([claudeTranscriptFormat, codexTranscriptFormat]);
12
+ const RECENT_MS = 7 * 24 * 60 * 60 * 1000;
13
+ const PROBE_CACHE_MS = 10 * 60 * 1000;
14
+
15
+ export function createTranscriptFormatProbe({ formats = TRANSCRIPT_FORMATS, env = process.env,
16
+ cacheMs = PROBE_CACHE_MS, now = () => Date.now() } = {}) {
17
+ let cached = null;
18
+ return async function read() {
19
+ if (cached && now() - cached.at < cacheMs) return cached.result;
20
+ const result = Object.fromEntries(await Promise.all(formats.map(async (format) =>
21
+ [format.clientId, await probeFormat(format, env, now())])));
22
+ cached = { at: now(), result };
23
+ return result;
24
+ };
25
+ }
26
+
27
+ async function probeFormat(format, env, at) {
28
+ try {
29
+ const path = await newestTranscript(format.root(env), { depth: format.depth, since: at - RECENT_MS });
30
+ return path ? await format.probe(path) : { readable: false, reason: 'no_transcript' };
31
+ } catch {
32
+ return { readable: false, reason: 'transcript_unreadable' };
33
+ }
34
+ }
@@ -0,0 +1,71 @@
1
+ import { constants } from 'node:fs';
2
+ import { lstat, opendir } from 'node:fs/promises';
3
+ import { join } from 'node:path';
4
+
5
+ import { openWithoutFollowing } from '../system/open-without-following.js';
6
+
7
+ // The file reading behind each Agent's transcript format probe
8
+ // (src/agents/<agent>/transcript-format-probe.js): find a client's newest
9
+ // transcript, and count how many records of its tail the Agent's own parser
10
+ // reads. Only counts leave this module: no text, path or session ID.
11
+ const TAIL_BYTES = 256 * 1024;
12
+ const MAX_SCAN_ENTRIES = 10_000;
13
+ // This many lines with no turn at all: the turns themselves were renamed.
14
+ const NO_TURNS_LINES = 20;
15
+
16
+ // The newest .jsonl file under root, at most depth directories down, changed
17
+ // at or after since (ms); null when there is none. Symbolic links are not followed.
18
+ export async function newestTranscript(root, { depth, since }) {
19
+ const scan = { entries: 0, newest: null };
20
+ await visit(root, depth, since, scan);
21
+ return scan.newest?.path ?? null;
22
+ }
23
+
24
+ async function visit(directory, depth, since, scan) {
25
+ let entries;
26
+ try { entries = await opendir(directory); } catch { return; }
27
+ for await (const entry of entries) {
28
+ if (++scan.entries > MAX_SCAN_ENTRIES) break;
29
+ const path = join(directory, entry.name);
30
+ if (entry.isDirectory()) {
31
+ if (depth > 0) await visit(path, depth - 1, since, scan);
32
+ } else if (entry.isFile() && entry.name.endsWith('.jsonl')) {
33
+ const changedAt = await lstat(path).then((stat) => stat.mtimeMs, () => -Infinity);
34
+ if (changedAt >= since && changedAt > (scan.newest?.changedAt ?? -Infinity)) scan.newest = { path, changedAt };
35
+ }
36
+ }
37
+ }
38
+
39
+ // recognize(record) answers true when the parser reads the record, false when
40
+ // it should and cannot, and null for a record the parser leaves out by design.
41
+ // A line that is not JSON counts as one the parser cannot read. The first line
42
+ // of a cut tail and a record the client is still writing are not counted.
43
+ export async function countTranscriptTail(path, recognize) {
44
+ const file = await openWithoutFollowing(path, constants.O_RDONLY);
45
+ try {
46
+ const { size } = await file.stat();
47
+ const start = Math.max(0, size - TAIL_BYTES);
48
+ const tail = Buffer.alloc(size - start);
49
+ const { bytesRead } = await file.read(tail, 0, tail.length, start);
50
+ const lines = tail.subarray(0, bytesRead).toString('utf8').split('\n');
51
+ lines.pop();
52
+ if (start > 0) lines.shift();
53
+ let recognized = 0;
54
+ let total = 0;
55
+ const records = lines.filter((candidate) => candidate.trim());
56
+ for (const line of records) {
57
+ const verdict = recognizeLine(line, recognize);
58
+ if (verdict === null) continue;
59
+ total += 1;
60
+ if (verdict) recognized += 1;
61
+ }
62
+ return { readable: true, recognized, total: total || (records.length >= NO_TURNS_LINES ? records.length : 0) };
63
+ } finally {
64
+ await file.close();
65
+ }
66
+ }
67
+
68
+ function recognizeLine(line, recognize) {
69
+ // A parser that throws on a record cannot read it: that is the finding.
70
+ try { return recognize(JSON.parse(line)); } catch { return false; }
71
+ }
@@ -47,6 +47,9 @@ Data formats:
47
47
  migrate restore --store LABEL [--backup REF] [--data-dir DIR] (replaces a whole store with a backup, losing later changes; FULI stopped)
48
48
  migrate prune [--keep N] [--max-mb MB] [--dry-run] [--data-dir DIR] (format backups by retention policy; never one an undo or the current version needs)
49
49
 
50
+ Diagnostics:
51
+ diagnostics [--from ISO] [--to ISO] [--component hook|http|provider|mcp] [--level error|warning] [--code CODE] [--limit N] [--cursor CURSOR] [--json] [--data-dir DIR] (FULI's recorded runtime failures, newest first; read only, works while FULI is stopped)
52
+
50
53
  Graph data portability:
51
54
  graph export --output DIR [--mode container|native] [--data-dir DIR]
52
55
  graph import --input DIR [--target-mode container|native] [--yes] [--data-dir DIR]
@@ -0,0 +1,59 @@
1
+ import { parseArgs } from 'node:util';
2
+
3
+ import { diagnosticEventLog } from '../diagnostics/event-log.js';
4
+ import { diagnosticEventsAnswer } from '../diagnostics/query.js';
5
+ import { resolveSetupPaths } from '../setup/paths.js';
6
+ import { writeLine } from './terminal-io.js';
7
+
8
+ // `fuli diagnostics` (rec#73): FULI's runtime failures read straight from the
9
+ // data directory's diagnostics files, so it works while the console is down.
10
+ // The same filters and answer as GET /api/diagnostics/events. Read only.
11
+
12
+ const USAGE = 'Usage: fuli diagnostics [--from ISO] [--to ISO] [--component hook|http|provider|mcp] '
13
+ + '[--level error|warning] [--code CODE] [--limit N] [--cursor CURSOR] [--json] [--data-dir DIR]';
14
+ const FILTERS = ['from', 'to', 'component', 'level', 'code', 'limit', 'cursor'];
15
+ const OPTIONS = Object.freeze({ ...Object.fromEntries(FILTERS.map((name) => [name, { type: 'string' }])),
16
+ json: { type: 'boolean' }, 'data-dir': { type: 'string' } });
17
+ const UNREADABLE_EXIT_CODE = 2;
18
+
19
+ export async function runDiagnosticsCommand(args, dependencies = {}) {
20
+ const options = parseDiagnosticsOptions(args);
21
+ const env = dependencies.env ?? process.env;
22
+ const write = dependencies.write ?? writeLine;
23
+ const { dataDir } = (dependencies.resolvePaths ?? resolveSetupPaths)({ dataDir: options['data-dir'] ?? null, env });
24
+ const answer = diagnosticEventsAnswer(diagnosticEventLog(dataDir),
25
+ Object.fromEntries(FILTERS.filter((name) => options[name] !== undefined).map((name) => [name, options[name]])));
26
+ write(options.json ? JSON.stringify(answer, null, 2) : formatDiagnostics(answer));
27
+ return { exitCode: answer.sourcesUnavailable.length ? UNREADABLE_EXIT_CODE : 0, answer };
28
+ }
29
+
30
+ function parseDiagnosticsOptions(args) {
31
+ try {
32
+ return parseArgs({ args, options: OPTIONS, strict: true, allowPositionals: false }).values;
33
+ } catch (error) {
34
+ throw new TypeError(`${USAGE}\n${error.message}`);
35
+ }
36
+ }
37
+
38
+ export function formatDiagnostics(answer) {
39
+ const lines = [answer.stored
40
+ ? `${answer.total} matching event${answer.total === 1 ? '' : 's'}, newest first`
41
+ + `${answer.retainedFrom ? ` (kept since ${answer.retainedFrom})` : ''}.`
42
+ : 'No diagnostic events are stored in this data directory yet.'];
43
+ for (const event of answer.events) {
44
+ lines.push([event.at, event.level, event.component, event.operation, event.code ?? '-',
45
+ event.durationMs === undefined ? null : `${event.durationMs} ms`, event.correlationId ?? null]
46
+ .filter((part) => part !== null).join(' '));
47
+ if (event.reason) lines.push(` ${event.reason}`);
48
+ }
49
+ const counts = Object.entries(answer.counts.code).map(([code, count]) => `${code} ${count}`).join(', ');
50
+ if (counts) lines.push(`By code: ${counts}${answer.counts.codesOmitted ? `, ${answer.counts.codesOmitted} more` : ''}`);
51
+ if (answer.truncatedBy.includes('page')) lines.push(`More events match; next page: --cursor ${answer.nextCursor}`);
52
+ if (answer.truncatedBy.includes('retention')) {
53
+ lines.push('Older events were dropped by rotation, so the requested range may be incomplete.');
54
+ }
55
+ for (const { source, reason } of answer.sourcesUnavailable) lines.push(`Could not read ${source} (${reason}).`);
56
+ if (answer.skippedLines) lines.push(`${answer.skippedLines} unreadable or newer-format lines were skipped.`);
57
+ lines.push(answer.notCovered);
58
+ return lines.join('\n');
59
+ }
@@ -132,6 +132,9 @@ export function formatSetupResult(result, plan, copy = String) {
132
132
  ? 'Fuli setup needs knowledge recovery before local stores are ready.'
133
133
  : 'Fuli started, but one or more Agents are not connected.'];
134
134
  if (result.knowledgeRecovery) lines.push(knowledgeReconciliationMessage(result.knowledgeRecovery));
135
+ if (result.dataDirPrivate === false) {
136
+ lines.push('Data directory: other accounts may still read it; the console\'s 体检 (doctor) can limit it to you and SYSTEM.');
137
+ }
135
138
  lines.push(...(result.runtime.portMoves ?? []).map(portMoveSentence));
136
139
  if (result.runtime.url) lines.push(`Open: ${copy(result.runtime.url)}`);
137
140
  if (result.runtime.lan === true) {
package/src/cli.js CHANGED
@@ -10,6 +10,7 @@ import { runGraphDataCommand } from './cli/graph-data-command.js';
10
10
  import { runNativeRuntimeCommand } from './cli/native-runtime-command.js';
11
11
  import { runGraphMigrateCommand } from './cli/graph-migrate-command.js';
12
12
  import { runMigrateCommand } from './cli/migrate-command.js';
13
+ import { runDiagnosticsCommand } from './cli/diagnostics-command.js';
13
14
  import { runEmployeeCommand } from './cli/employee-command.js';
14
15
  import { runAppCommand } from './cli/app-command.js';
15
16
  import { runModelsCommand } from './cli/models-command.js';
@@ -66,6 +67,10 @@ export async function main(argv = process.argv.slice(2), env = process.env) {
66
67
  assertSupportedNodeVersion();
67
68
  return runMigrateCommand(commandArgs, { env });
68
69
  }
70
+ if (command === 'diagnostics') {
71
+ assertSupportedNodeVersion();
72
+ return runDiagnosticsCommand(commandArgs, { env });
73
+ }
69
74
  if (command === 'employee') {
70
75
  assertSupportedNodeVersion();
71
76
  return runEmployeeCommand(commandArgs, { env });
@@ -26,7 +26,7 @@ export function entryHintSkipped() {
26
26
  // delivered as it is at the deadline, so a partial entry still says how to
27
27
  // checkpoint, and that the person asked to keep something.
28
28
  const DELIVERED_AT_DEADLINE = Object.freeze(['checkpoint_required', 'checkpoint_guidance', 'remember_guidance',
29
- 'previous_checkpoint_missing', 'project_scope']);
29
+ 'update_guidance', 'previous_checkpoint_missing', 'project_scope']);
30
30
 
31
31
  // The task this entry wrote, with its opening writes done in time. One noted
32
32
  // after the deadline was cut short and is never delivered. The entry is kept
@@ -0,0 +1,22 @@
1
+ // The read call that returns an entry detail in full. An entry that shows a
2
+ // detail only as a count or pointer names its reader here, so the inline fit
3
+ // (entry-inline-budget.js) and the token-less view (task-context-view.js)
4
+ // point to the same calls with the IDs the entry already holds.
5
+ const present = values => Object.fromEntries(Object.entries(values).filter(([, item]) => item !== undefined));
6
+
7
+ // One working-memory layer: the project layer, or the global one with null.
8
+ export function memoryRead(value, personalProjectId) {
9
+ return { tool: 'get_project_agent_memory', arguments: present({ personalSpaceId: value.context?.personal_space_id,
10
+ personalProjectId, agentId: value.context?.project_agent_id ?? value.project_agent_context?.project_agent_id }) };
11
+ }
12
+
13
+ export function teamRead(value) {
14
+ return { tool: 'get_project_team', arguments: present({ personalSpaceId: value.context?.personal_space_id,
15
+ personalProjectId: value.context?.personal_project_id ?? value.project_agent_context?.personal_project_id }) };
16
+ }
17
+
18
+ // A manager's tools and schemas; its board is then read through them.
19
+ export function managerRead(manager) {
20
+ return manager.read ?? { tool: manager.tools?.discover ?? 'list_employee_tools',
21
+ arguments: { templateId: manager.template_id, personalProjectId: manager.personal_project_id } };
22
+ }
@@ -1,6 +1,7 @@
1
1
  import { copyPreferenceScope, entryWorkKind } from './preference-snapshot.js';
2
2
  import { preferenceAlwaysInline, preferenceNamesWorkKind, preferenceSceneReplaceable } from '../graphiti/preference-task-scope.js';
3
3
  import { blockedByDeliveryBudget, blockedPreferenceDelivery } from '../mcp/preference-delivery.js';
4
+ import { managerRead, memoryRead, teamRead } from './entry-detail-readers.js';
4
5
 
5
6
  // The blocked reason of an entry that does not fit its host's inline limit.
6
7
  const INLINE_BUDGET = 'inline_budget';
@@ -37,6 +38,8 @@ export function fitUncached(fit, value, render) {
37
38
  // An entry that fits is unchanged. Otherwise, in this order:
38
39
  // 1. the automatic recall becomes a pointer to its search, then the recent
39
40
  // conversation drops its oldest messages, as the Provider's own window does;
41
+ // where that is not enough, the preferences lose their IDs first and step
42
+ // 1 is tried again;
40
43
  // 2. then preferences go, lowest ranked first, except hard rules
41
44
  // (preferenceAlwaysInline). The rest rank by kind and task scene: a
42
45
  // boundary a scene switch never revokes first, then an item whose own scene
@@ -63,12 +66,19 @@ export function fitUncached(fit, value, render) {
63
66
  // the blocked frame (inline_budget) that keeps the token, closing fields and
64
67
  // identity and recovers through read_task_preferences.
65
68
  export function inlineEntryFit(limit, length) {
66
- return (value, { deliver, complete }) => {
69
+ return (whole, { deliver, complete }) => {
67
70
  // A frame the renderer blocked as over its own delivery budget is short,
68
71
  // but delivers nothing: it does not fit. Size only grows with the entry,
69
72
  // so both conditions stay monotonic for the search below. Any other
70
73
  // blocked reason is kept as it is.
71
74
  const fits = attempt => !blockedByDeliveryBudget(attempt.result.structuredContent) && length(attempt.result) <= limit;
75
+ for (const level of contextLevels(whole)) {
76
+ const attempt = deliver(level);
77
+ if (fits(attempt)) return attempt;
78
+ }
79
+ // Preference IDs go before any preference does (rec#75): search finds
80
+ // one by its preference_key.
81
+ const value = withoutPreferenceIds(whole);
72
82
  const levels = contextLevels(value);
73
83
  for (const level of levels) {
74
84
  const attempt = deliver(level);
@@ -142,6 +152,12 @@ function withoutCompleteClaims(value) {
142
152
  return { ...rest, ...(delivery && delivery.status !== 'complete' ? { preference_delivery: delivery } : {}) };
143
153
  }
144
154
 
155
+ function withoutPreferenceIds(value) {
156
+ if (!Array.isArray(value.effective_preferences) || !value.effective_preferences.some(item => item.id)) return value;
157
+ return copyPreferenceScope(value, { ...value,
158
+ effective_preferences: value.effective_preferences.map(({ id: _id, item_kind: _kind, ...item }) => item) });
159
+ }
160
+
145
161
  function withPreferences(level, selected, total) {
146
162
  return copyPreferenceScope(level, { ...withoutCompleteClaims(level),
147
163
  effective_preferences: level.effective_preferences.filter((_, index) => selected.has(index)),
@@ -185,8 +201,6 @@ function reducedDetails(leanest, steps) {
185
201
 
186
202
  const withContinuity = (value, field, view) => ({ ...value, project_agent_context: { ...value.project_agent_context, [field]: view } });
187
203
  const present = values => Object.fromEntries(Object.entries(values).filter(([, item]) => item !== undefined));
188
- const memoryArguments = (value, personalProjectId) => present({ personalSpaceId: value.context?.personal_space_id,
189
- personalProjectId, agentId: value.context?.project_agent_id ?? value.project_agent_context?.project_agent_id });
190
204
 
191
205
  // Each step returns the entry with one detail reduced to what it counts and
192
206
  // the call that reads it, or null when there is nothing to reduce. The role is
@@ -195,29 +209,27 @@ const memoryArguments = (value, personalProjectId) => present({ personalSpaceId:
195
209
  const DETAIL_STEPS = [
196
210
  // The global layer first, as it is the less specific one.
197
211
  value => value.project_agent_context?.global_memory?.current ? withContinuity(value, 'global_memory',
198
- memoryPointer(value.project_agent_context.global_memory, memoryArguments(value, null))) : null,
212
+ memoryPointer(value.project_agent_context.global_memory, memoryRead(value, null))) : null,
199
213
  value => value.project_agent_context?.memory?.current ? withContinuity(value, 'memory',
200
- memoryPointer(value.project_agent_context.memory, memoryArguments(value, value.context?.personal_project_id ?? null))) : null,
214
+ memoryPointer(value.project_agent_context.memory, memoryRead(value, value.context?.personal_project_id ?? null))) : null,
201
215
  // The snapshot's files are written with the memory the layers' read returns.
202
216
  value => {
203
217
  const snapshot = value.project_agent_context?.directorySnapshot;
204
218
  return Array.isArray(snapshot?.files) ? withContinuity(value, 'directorySnapshot',
205
219
  { status: snapshot.status, path: snapshot.path, files_omitted: snapshot.files.length,
206
- read: { tool: 'get_project_agent_memory', arguments: memoryArguments(value, value.context?.personal_project_id ?? null) } }) : null;
220
+ read: memoryRead(value, value.context?.personal_project_id ?? null) }) : null;
207
221
  },
208
222
  value => {
209
223
  const team = value.project_agent_context?.team;
210
224
  return team?.roster?.length ? withContinuity(value, 'team', { roster_total: team.roster_total ?? team.roster.length,
211
- read: { tool: 'get_project_team', arguments: present({ personalSpaceId: value.context?.personal_space_id,
212
- personalProjectId: value.context?.personal_project_id ?? value.project_agent_context?.personal_project_id }) } }) : null;
225
+ read: teamRead(value) }) : null;
213
226
  },
214
227
  value => {
215
228
  const managers = value.project_management_context?.managers;
216
229
  return managers?.length ? { ...value, project_management_context: { ...value.project_management_context,
217
230
  managers: managers.map(manager => present({ template_id: manager.template_id, agent_id: manager.agent_id, name: manager.name,
218
231
  title_mode: manager.title_mode, suggested_match: manager.suggested_match, guidance: manager.guidance,
219
- read: { tool: manager.tools?.discover ?? 'list_employee_tools',
220
- arguments: { templateId: manager.template_id, personalProjectId: manager.personal_project_id } } })) } } : null;
232
+ read: managerRead(manager) })) } } : null;
221
233
  },
222
234
  ({ active_conflicts: conflicts, ...value }) => conflicts?.length ? { ...withoutCompleteClaims(value),
223
235
  active_conflicts_omitted: { count: conflicts.length,
@@ -226,9 +238,9 @@ const DETAIL_STEPS = [
226
238
 
227
239
  // A layer's preview without its notes: its scope, revision and rules stay,
228
240
  // so a checkpoint still names the revision it read (task-context-view.js).
229
- function memoryPointer(memory, readArguments) {
241
+ function memoryPointer(memory, read) {
230
242
  const { current: _current, notesTruncated: _cut, ...pointer } = memory;
231
- return { ...pointer, view: 'omitted', read: { tool: 'get_project_agent_memory', arguments: readArguments } };
243
+ return { ...pointer, view: 'omitted', read };
232
244
  }
233
245
 
234
246
  // The recall without its items: what it matched, how many, and the search
@@ -5,15 +5,18 @@ import { canonicalJson, contentHash } from '../../packages/roundtable/src/canoni
5
5
  // context generation showed exactly so, and names that frame by its
6
6
  // skeleton_revision, so the model never has to guess which earlier frame is
7
7
  // meant. The token, checkpoint requirement, preferences, conflicts and the
8
- // recovered conversation are never part of it: they have their own deltas.
8
+ // recovered messages are never part of it: they have their own deltas.
9
9
  // `context` and `task_knowledge_recall` repeat byte for byte only when the
10
- // same prompt does.
11
- export const SKELETON_FIELDS = Object.freeze(['agent_receipt', 'task_guidance', 'application_guidance', 'checkpoint_guidance',
12
- 'project_agent_context', 'project_management_context', 'judgment_context', 'context', 'task_knowledge_recall']);
10
+ // same prompt does. A dotted part is a path inside the frame: the
11
+ // conversation's rule reference and the latest saved result of its
12
+ // conversation, which repeats while no task records a new one (rec#15).
13
+ export const SKELETON_PARTS = Object.freeze(['agent_receipt', 'task_guidance', 'application_guidance', 'checkpoint_guidance',
14
+ 'project_agent_context', 'project_management_context', 'judgment_context', 'context', 'task_knowledge_recall',
15
+ 'conversation.guidance', 'conversation.recovery.latest_checkpoint']);
13
16
  // The hook's own instructions above the frame, as the host recorded them.
14
17
  export const SKELETON_LABEL = 'label';
15
- export const SKELETON_UNCHANGED_LABEL = 'skeleton_unchanged: parts left out, as earlier FULI frames gave them (what they named included), by skeleton_revision: '
16
- + 'revision(s) whose parts apply, later over earlier, under this frame\'s own, or a map revision → parts (label: the text above the JSON).';
18
+ export const SKELETON_UNCHANGED_LABEL = 'skeleton_unchanged: parts not repeated here, as earlier FULI frames gave them, by skeleton_revision '
19
+ + '(later wins, this frame\'s own first; a map lists parts; label = text above the JSON).';
17
20
  const HASH = /^[a-f0-9]{64}$/;
18
21
  export const MAX_SKELETON_PROMPTS = 16;
19
22
  const NO_BASES = Object.freeze({ bases: Object.freeze([]) });
@@ -92,7 +95,7 @@ export function projectSkeleton(value, evidence, label) {
92
95
  const own = delivered(skeletonOf(value));
93
96
  if (!evidence || !Object.keys(own).length || value.preferences_complete === false) return value;
94
97
  const parts = { ...own, [SKELETON_LABEL]: label(value) };
95
- const names = [SKELETON_LABEL, ...SKELETON_FIELDS].filter(name => Object.hasOwn(parts, name));
98
+ const names = [SKELETON_LABEL, ...SKELETON_PARTS].filter(name => Object.hasOwn(parts, name));
96
99
  const from = {};
97
100
  for (const part of names) {
98
101
  const base = evidence.bases.findLast(item => Object.hasOwn(item.parts, part)
@@ -110,7 +113,7 @@ export function projectSkeleton(value, evidence, label) {
110
113
  && Object.entries(resolved).every(([part, item]) => Object.hasOwn(parts, part)
111
114
  && (!left.has(part) || canonicalJson(item) === canonicalJson(parts[part])));
112
115
  const named = !exact ? from : chain.length === 1 ? chain[0][0] : chain.map(([revision]) => revision);
113
- const trimmed = withRevision({ ...Object.fromEntries(Object.entries(value).filter(([key]) => !left.has(key))),
116
+ const trimmed = withRevision({ ...withoutParts(value, [...left].filter(part => part !== SKELETON_LABEL)),
114
117
  skeleton_unchanged: named }, label);
115
118
  return frameBytes(trimmed, label) < frameBytes(complete, label) ? trimmed : complete;
116
119
  }
@@ -163,7 +166,22 @@ function skeletonRevision(frame, label) {
163
166
  }
164
167
 
165
168
  function skeletonOf(value) {
166
- return Object.fromEntries(SKELETON_FIELDS.filter(field => value?.[field] !== undefined).map(field => [field, value[field]]));
169
+ return Object.fromEntries(SKELETON_PARTS.map(part => [part, partOf(value, part)]).filter(([, item]) => item !== undefined));
170
+ }
171
+
172
+ function partOf(value, part) {
173
+ return part.split('.').reduce((item, key) => item?.[key], value);
174
+ }
175
+
176
+ // The value without these parts, copying only the objects on their paths.
177
+ function withoutParts(value, parts) {
178
+ const result = { ...value };
179
+ for (const part of parts) {
180
+ const [key, ...rest] = part.split('.');
181
+ if (rest.length) result[key] = withoutParts(result[key], [rest.join('.')]);
182
+ else delete result[key];
183
+ }
184
+ return result;
167
185
  }
168
186
 
169
187
  // The fields as the frame delivers them: JSON drops undefined.
@@ -83,7 +83,8 @@ export async function preferenceHookOutput(entry, event, input, delivery, source
83
83
  label: skeletonFrameLabel(frameLabel(projected), projected), limitBytes: 128 * 1024, itemLimit: 1000,
84
84
  blockedLabel: `${BLOCKED_PREFERENCE_LABEL} ${taskReceiptInstruction(value)}`.trim() });
85
85
  const fit = inlineChars ? inlineEntryFit(inlineChars, hookContextLength) : WHOLE_ENTRY;
86
- const result = delivery ? await delivery.deliver(value, { sourceApplication,
86
+ // An entry without a task has nothing for delivery to track (task-entry-read-only.js).
87
+ const result = delivery && typeof entry.taskContextToken === 'string' ? await delivery.deliver(value, { sourceApplication,
87
88
  nativeSessionId: input.session_id, transcriptPath: input.transcript_path, forceFull,
88
89
  taskPrompt: typeof input.prompt === 'string' ? input.prompt : null, label: frameLabel }, format, fit)
89
90
  : fitUncached(fit, value, projected => format(withoutDeliveryProofs(projected)));
@@ -203,8 +203,11 @@ async function missing(path) {
203
203
  // generation starts at its end. A reset record (compaction) of the same file
204
204
  // starts a generation after that record, where the evidence reader begins.
205
205
  function generationState(state, proof, nativeGeneration) {
206
- if (state.untrusted || state.floor === null
207
- || (nativeGeneration && state.nativeGeneration && nativeGeneration !== state.nativeGeneration)) {
206
+ // A delivery that names its host execution and window starts a new
207
+ // generation unless the record holds that same one: a hook reset or a
208
+ // fresh record holds none, and a window change after it leaves no other
209
+ // trace (review of #654).
210
+ if (state.untrusted || state.floor === null || (nativeGeneration && nativeGeneration !== state.nativeGeneration)) {
208
211
  return { pending: [], recent: [], prompts: [], floor: boundary(proof, false) };
209
212
  }
210
213
  if (!proof.known) return state;
@@ -193,7 +193,10 @@ function sceneName(scene) {
193
193
  return [scene.work_kind, scene.workflow].filter(Boolean).join('/') || null;
194
194
  }
195
195
 
196
- function unit(item) {
196
+ // The source ID is delivered but is no instruction revision: a frame bounded
197
+ // without IDs proves the same set. A new version under a new ID (rec#75) that
198
+ // says the same thing needs no redelivery.
199
+ function unit({ id: _id, item_kind: _kind, ...item }) {
197
200
  return { hash: contentHash(JSON.parse(canonicalJson(item, { omitUndefined: true }))), identity: identity(item),
198
201
  scene: preferenceSceneReplaceable(item) };
199
202
  }
@@ -1,8 +1,12 @@
1
1
  // Shared mandatory instruction projection for compact entry and full-reader
2
- // fingerprints. Source IDs/search metadata are not instruction revisions.
2
+ // fingerprints. Search metadata is dropped. The item's ID is kept for
3
+ // revise_personal_knowledge (rec#75; item_kind only when not an entity), but
4
+ // the fingerprint leaves it out (preference-snapshot.js).
3
5
  export function preferenceInstructionView(item) {
4
6
  return {
5
7
  instruction: item.instruction, preference_key: item.preference_key,
8
+ ...(item.id ? { id: item.id } : {}),
9
+ ...(item.item_kind && item.item_kind !== 'entity' ? { item_kind: item.item_kind } : {}),
6
10
  preference_scope: item.preference_scope, confirmation_status: item.confirmation_status,
7
11
  ...(item.profile_aspect ? { profile_aspect: item.profile_aspect } : {}),
8
12
  ...Object.fromEntries(['preference_project_id', 'preference_agent_id',
@@ -0,0 +1,21 @@
1
+ // What a reply cites through FULI's own source links (source-marker.js), read at
2
+ // Stop (rec#88). A task closed by the Stop hook never reported its use, and
3
+ // reporting costs the model a turn, so learning had no input: the link the
4
+ // reply already carries says the same thing for free. It is the model's own
5
+ // citation, so it counts as `cited` and carries the weight of a reported one.
6
+ const SOURCE_LINK = /https?:\/\/(?:127\.0\.0\.1|localhost|\[::1\])(?::\d+)?\/knowledge\/[^/\s)]+\/[^/\s)]+\/directory\/(entity|relationship)\/([^/\s)?#]+)/g;
7
+ const MAX_CITED = 20;
8
+
9
+ export function citedKnowledge(reply) {
10
+ if (typeof reply !== 'string') return [];
11
+ const cited = new Map();
12
+ for (const [, itemKind, encoded] of reply.matchAll(SOURCE_LINK)) {
13
+ const itemId = decoded(encoded);
14
+ if (itemId) cited.set(`${itemKind}:${itemId}`, { itemId, itemKind, useKind: 'cited' });
15
+ }
16
+ return [...cited.values()].slice(0, MAX_CITED);
17
+ }
18
+
19
+ function decoded(segment) {
20
+ try { return decodeURIComponent(segment); } catch { return null; }
21
+ }
@@ -1,4 +1,5 @@
1
1
  import { boundedHookMessage } from '../agents/lifecycle-message.js';
2
+ import { citedKnowledge } from './reply-citations.js';
2
3
 
3
4
  export const AUTO_CLOSE_SUMMARY = 'Auto-closed by the Stop hook: the Agent recorded no checkpoint for this task.';
4
5
 
@@ -6,8 +7,9 @@ export const AUTO_CLOSE_SUMMARY = 'Auto-closed by the Stop hook: the Agent recor
6
7
  // lifecycle hook, or a routine fallback the Provider marks closable, is closed
7
8
  // honestly as retain_nothing (status "reported", never "completed") instead of
8
9
  // costing the model another full turn; any other open task keeps the advisory
9
- // reminder. Nothing is invented or captured here.
10
- export async function stopHookOutcome(check, invoke, source) {
10
+ // reminder. Nothing is invented or captured here. reply: the turn's last answer,
11
+ // where the host gives it; what it cites is recorded as use.
12
+ export async function stopHookOutcome(check, invoke, source, { reply = null } = {}) {
11
13
  if (check?.decision !== 'block') return {};
12
14
  const remind = () => {
13
15
  const reason = boundedHookMessage(check?.reason);
@@ -15,14 +17,24 @@ export async function stopHookOutcome(check, invoke, source) {
15
17
  };
16
18
  const closable = check.entry_via === 'hook' || check.routine_auto_close_eligible === true;
17
19
  if (!closable || typeof check.task_context_token !== 'string') return remind();
20
+ const close = (usage) => invoke('checkpoint_task_knowledge', {
21
+ taskContextToken: check.task_context_token,
22
+ disposition: 'retain_nothing',
23
+ reason: AUTO_CLOSE_SUMMARY,
24
+ workLog: { status: 'reported', summary: AUTO_CLOSE_SUMMARY },
25
+ ...(usage.length ? { knowledgeUsage: usage } : {}),
26
+ ...source
27
+ });
28
+ const cited = citedKnowledge(reply);
18
29
  try {
19
- await invoke('checkpoint_task_knowledge', {
20
- taskContextToken: check.task_context_token,
21
- disposition: 'retain_nothing',
22
- reason: AUTO_CLOSE_SUMMARY,
23
- workLog: { status: 'reported', summary: AUTO_CLOSE_SUMMARY },
24
- ...source
25
- });
30
+ await close(cited);
31
+ return {};
32
+ } catch {
33
+ if (!cited.length) return remind();
34
+ }
35
+ // A link that names nothing usable never keeps the task open.
36
+ try {
37
+ await close([]);
26
38
  return {};
27
39
  } catch {
28
40
  return remind();