fuli-context 0.27.0 → 0.27.2

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 (431) hide show
  1. package/dist/web/assets/{AboutPage-Bp2Edkdg.js → AboutPage-Bgcf03U0.js} +1 -1
  2. package/dist/web/assets/{AboutSectionHeading-DFfY2f_Z.js → AboutSectionHeading-BaQBY_Xs.js} +1 -1
  3. package/dist/web/assets/AgentAppsPage-DNuujLT2.js +1 -0
  4. package/dist/web/assets/{AgentAvatar-w-2A3nsJ.js → AgentAvatar-DGXedNUs.js} +1 -1
  5. package/dist/web/assets/{AgentHand-BGGU49Jt.js → AgentHand-BwE2VGth.js} +1 -1
  6. package/dist/web/assets/AgentManagement-2r8DUS1N.js +7 -0
  7. package/dist/web/assets/AgentManagement-hRkMpjvY.css +1 -0
  8. package/dist/web/assets/{AgentMentionCopy-BAHZjubz.js → AgentMentionCopy-y3JD1Cef.js} +1 -1
  9. package/dist/web/assets/{AgentName-CXlsC-4o.js → AgentName-XrBcHq4R.js} +1 -1
  10. package/dist/web/assets/AgentProfilePage-DE7z980p.js +5 -0
  11. package/dist/web/assets/AgentServicesPage-CWfGSxcb.js +1 -0
  12. package/dist/web/assets/{AppViewerPage-6gWP6nAf.js → AppViewerPage-BaKMk9pp.js} +1 -1
  13. package/dist/web/assets/{BackToTop-Cs5_rV99.js → BackToTop-DITd9y7X.js} +1 -1
  14. package/dist/web/assets/{BoardCardFieldsMenu-CvFrsIgy.js → BoardCardFieldsMenu-CWtHiVR-.js} +1 -1
  15. package/dist/web/assets/{BoardMoveMenu-B5isxIcK.js → BoardMoveMenu-CEDdltY7.js} +1 -1
  16. package/dist/web/assets/Breadcrumb-C98voz9V.js +1 -0
  17. package/dist/web/assets/{CaptureChangePage-Ca72_PHc.js → CaptureChangePage-CE8tJfiQ.js} +1 -1
  18. package/dist/web/assets/{CopyFixPrompt-wGATZKOq.js → CopyFixPrompt-C2hC04lV.js} +1 -1
  19. package/dist/web/assets/DataFormatPage-BjZkck9o.js +2 -0
  20. package/dist/web/assets/DebugTurnPage-B82geu1y.js +1 -0
  21. package/dist/web/assets/DebugTurnsPage-BlDDz1Fk.js +1 -0
  22. package/dist/web/assets/DialogTitle-fpANsAcy.js +1 -0
  23. package/dist/web/assets/{EmployeeRedirectPage-C2SHpAEF.js → EmployeeRedirectPage-CSSuvAqx.js} +1 -1
  24. package/dist/web/assets/EmployeeScopeDialog-BoEMQOEj.js +1 -0
  25. package/dist/web/assets/EmployeeWorkbench-DvEojWb7.js +4 -0
  26. package/dist/web/assets/{EmployeeWorkbench-Bp9pUkfS.css → EmployeeWorkbench-rhY970vW.css} +1 -1
  27. package/dist/web/assets/FieldRoot-D3lnRut5.js +1 -0
  28. package/dist/web/assets/{FlaGrowth-DGnUPN7D.js → FlaGrowth-OdlmgEVi.js} +1 -1
  29. package/dist/web/assets/{FlaOccupationKit-DAJjSrmL.js → FlaOccupationKit-CnouVWnU.js} +1 -1
  30. package/dist/web/assets/{FlaTaskSheets-DRLgfrVC.js → FlaTaskSheets-rSIdCtzz.js} +1 -1
  31. package/dist/web/assets/FlasPage-BZ791caF.js +1 -0
  32. package/dist/web/assets/{FlasPage-H99IZ9M6.css → FlasPage-D3CcJcvN.css} +1 -1
  33. package/dist/web/assets/{GrowthLoading-NLj2W4jj.js → GrowthLoading-BYOSvxZY.js} +1 -1
  34. package/dist/web/assets/{HowtoPage-CrvMmT6K.css → HowtoPage-DNTwYQCD.css} +1 -1
  35. package/dist/web/assets/HowtoPage-lYwzi4Vm.js +1 -0
  36. package/dist/web/assets/InboxPage-C3cSvJjB.js +6 -0
  37. package/dist/web/assets/{KnowledgeDeleteButton-DaT-gTmm.js → KnowledgeDeleteButton-yc8Gi-BH.js} +1 -1
  38. package/dist/web/assets/{KnowledgeHardDeleteSection-C9d7DVLa.js → KnowledgeHardDeleteSection-D9Ktc-uC.js} +1 -1
  39. package/dist/web/assets/KnowledgeItemEditPage-Csy4oOxD.js +1 -0
  40. package/dist/web/assets/{KnowledgeItemSummaryCard-eLzjKvgN.js → KnowledgeItemSummaryCard-BH5UYmde.js} +1 -1
  41. package/dist/web/assets/KnowledgeOrganizerPage-BTeQX0gH.js +1 -0
  42. package/dist/web/assets/KnowledgePage-BuukvNxz.js +1 -0
  43. package/dist/web/assets/KnowledgePeek-D0pcU7U5.js +1 -0
  44. package/dist/web/assets/KnowledgeTurnReceiptPage-Bd_LIdCc.js +1 -0
  45. package/dist/web/assets/{KnowledgeWorkspace-DDg3tUb3.css → KnowledgeWorkspace-Be2gUul5.css} +1 -1
  46. package/dist/web/assets/KnowledgeWorkspace-Dr-zYpDQ.js +4 -0
  47. package/dist/web/assets/{MeAvatar-f6qxg9dN.js → MeAvatar-CmhuRFOf.js} +1 -1
  48. package/dist/web/assets/{MeLink-DTvFYaYE.js → MeLink-BesUihiS.js} +1 -1
  49. package/dist/web/assets/MenuSeparator-BGo0DgyF.js +1 -0
  50. package/dist/web/assets/{ModelSettingsPage-B38R-kBZ.css → ModelSettingsPage-BZcyT7Vy.css} +1 -1
  51. package/dist/web/assets/ModelSettingsPage-CBPwuIBM.js +1 -0
  52. package/dist/web/assets/{NewSessionPanel-9yINjwyx.js → NewSessionPanel-Bvp9ElzU.js} +1 -1
  53. package/dist/web/assets/{NotFoundPage-CqevPz0_.js → NotFoundPage-BrolI2fz.js} +1 -1
  54. package/dist/web/assets/{workbench-card-Dt0820yW.css → NoticeRow-DD-J76Yo.css} +1 -1
  55. package/dist/web/assets/NoticeRow-Q9QT5NqB.js +1 -0
  56. package/dist/web/assets/OccupationsPage-CZCeeihl.js +1 -0
  57. package/dist/web/assets/{PageOutline-HHUlu2x3.js → PageOutline-DULpqEwg.js} +1 -1
  58. package/dist/web/assets/PageStack-BMzrkyV4.css +1 -0
  59. package/dist/web/assets/PageStack-DTzWJuae.js +1 -0
  60. package/dist/web/assets/{PersonalProfilePage-DnjNX2xK.css → PersonalProfilePage-BE5q2bqc.css} +1 -1
  61. package/dist/web/assets/PersonalProfilePage-DbXWycCQ.js +1 -0
  62. package/dist/web/assets/PersonalProjectsPage-pdAJpnZd.js +1 -0
  63. package/dist/web/assets/{PinIcon-DP-9Iisk.js → PinIcon-YYoaYKTx.js} +1 -1
  64. package/dist/web/assets/PopperContent-CnNwFMIA.js +1 -0
  65. package/dist/web/assets/Presence-CuIoA2sH.js +3 -0
  66. package/dist/web/assets/{ProfileAuthorChip-BKZJC_N2.js → ProfileAuthorChip-BEfiuJbm.js} +1 -1
  67. package/dist/web/assets/ProjectAgentsPage-BPf2RLsw.js +5 -0
  68. package/dist/web/assets/{ProjectJudgmentPolicy-BJ5sVuFI.js → ProjectJudgmentPolicy-CCzHtmOb.js} +1 -1
  69. package/dist/web/assets/{RoundtablesPage-D5Xc3yun.js → RoundtablesPage-BDU4W-bg.js} +1 -1
  70. package/dist/web/assets/RovingFocusGroup-DS4v3bEq.js +1 -0
  71. package/dist/web/assets/RovingFocusItem-bLEnnw2Y.js +1 -0
  72. package/dist/web/assets/SessionMigrationPage-DrK4df0L.js +1 -0
  73. package/dist/web/assets/{SessionRecordsPage-C6U5YGSt.js → SessionRecordsPage-CFAgM65g.js} +1 -1
  74. package/dist/web/assets/SettingsPage-CsJxhhsu.js +1 -0
  75. package/dist/web/assets/SettingsPage-VX_e4ty2.css +1 -0
  76. package/dist/web/assets/SharedJefaReportPage-DbTPYwa_.js +1 -0
  77. package/dist/web/assets/StatementCalendarPage-CIo5R14R.js +1 -0
  78. package/dist/web/assets/StatementCalendarPage-t8pJI4G6.css +1 -0
  79. package/dist/web/assets/StatementRows-CubaC9KG.js +1 -0
  80. package/dist/web/assets/StatementRows-TQ2i_uXU.css +1 -0
  81. package/dist/web/assets/{TagVocabularyPage-Brpr-Q-y.js → TagVocabularyPage-BVlLmKv2.js} +1 -1
  82. package/dist/web/assets/TaskBlockerNotice-YSvmy6B4.js +1 -0
  83. package/dist/web/assets/{TaskReason-RKKs4Kb5.js → TaskReason-CrLPeiOg.js} +1 -1
  84. package/dist/web/assets/{TeamCard-8hjo1h0x.js → TeamCard-SBMJMd7P.js} +1 -1
  85. package/dist/web/assets/TeamCardsWidget-CGLW04TH.js +1 -0
  86. package/dist/web/assets/TeamIsland-jJKTwCJD.js +9 -0
  87. package/dist/web/assets/Teleport-CRjWb-eC.js +1 -0
  88. package/dist/web/assets/{TextField-G2fJ4aFQ.js → TextField-Cd8UOHKv.js} +1 -1
  89. package/dist/web/assets/TodayPage-BvbZCEFJ.js +1 -0
  90. package/dist/web/assets/TodayPage-EJ8SWFE0.css +1 -0
  91. package/dist/web/assets/TonborgDelegationSwitch-BFb1JkWe.css +1 -0
  92. package/dist/web/assets/TonborgDelegationSwitch-BOidSjkk.js +1 -0
  93. package/dist/web/assets/{UiChip-BHEJVA6L.js → UiChip-B2z0UERX.js} +1 -1
  94. package/dist/web/assets/{UiDisclosure-B1pd8qXW.js → UiDisclosure-Bw4Wu0Dm.js} +1 -1
  95. package/dist/web/assets/{UiIcon-K7OhYTSy.js → UiIcon-BuaIQ57Z.js} +1 -1
  96. package/dist/web/assets/UiSegmented-DlI1vR3k.js +1 -0
  97. package/dist/web/assets/{UiWeight-eAw682rH.js → UiWeight-DpBexUUy.js} +1 -1
  98. package/dist/web/assets/{VirtualDirectoryList-BGum1GZc.js → VirtualDirectoryList-RV2XtTPO.js} +1 -1
  99. package/dist/web/assets/{VisuallyHidden-Ck6D7rq-.js → VisuallyHidden-DciDIEua.js} +1 -1
  100. package/dist/web/assets/{VisuallyHiddenInput-DXWhIUlB.js → VisuallyHiddenInput-mfi7gVBu.js} +1 -1
  101. package/dist/web/assets/WidgetSlot-xFZKjZ5z.js +2 -0
  102. package/dist/web/assets/WorkbenchListPage-BKT03RRO.css +1 -0
  103. package/dist/web/assets/WorkbenchListPage-suawrzji.js +1 -0
  104. package/dist/web/assets/_plugin-vue_export-helper-CYsAcErn.js +9 -0
  105. package/dist/web/assets/{agent-apps-D0eG1aMx.js → agent-apps-B_0syRPr.js} +1 -1
  106. package/dist/web/assets/agent-occupation-C-9THmIG.js +1 -0
  107. package/dist/web/assets/{agent-pins-OYjJQ38F.js → agent-pins-B9wMvxGh.js} +1 -1
  108. package/dist/web/assets/{agent-roster-records-CsYjmaNn.js → agent-roster-records-CY0aSUNq.js} +1 -1
  109. package/dist/web/assets/{agent-work-summary-BOeJ4JXc.js → agent-work-summary-Cs8jPFL0.js} +1 -1
  110. package/dist/web/assets/{attach-closest-edge-C75rKXiz.js → attach-closest-edge-BRDsvYPn.js} +1 -1
  111. package/dist/web/assets/{attention-store-k4mPCefZ.js → attention-store-HMiJ1K6M.js} +1 -1
  112. package/dist/web/assets/{badge-B2rll-68.js → badge-jafr8Jg1.js} +1 -1
  113. package/dist/web/assets/{button-q6JhonlL.js → button-d6TCVE0s.js} +1 -1
  114. package/dist/web/assets/{card-CPQiMHSu.js → card-ebnaJXQA.js} +1 -1
  115. package/dist/web/assets/{catalog-CBPcEkXC.js → catalog-CvdvPGYk.js} +1 -1
  116. package/dist/web/assets/checkbox-CdIozFRY.js +1 -0
  117. package/dist/web/assets/{client-KFFphxpK.js → client--hZxcKYo.js} +1 -1
  118. package/dist/web/assets/{client-links-store-Cw9c8MWc.js → client-links-store-XyR0EzJi.js} +1 -1
  119. package/dist/web/assets/combobox-DzLSYxyO.js +1 -0
  120. package/dist/web/assets/{console-BCR2S3AF.js → console-D597wx3f.js} +1 -1
  121. package/dist/web/assets/conversation-launcher-settings-CFFH9C2y.js +1 -0
  122. package/dist/web/assets/copy-mention-CWsw8po1.js +1 -0
  123. package/dist/web/assets/dialog-SLa8cPbS.js +1 -0
  124. package/dist/web/assets/{dist-CaVgk2QB.js → dist-B78L06NL.js} +1 -1
  125. package/dist/web/assets/{dist-D73EXNtz.js → dist-Dy5JoHWF.js} +1 -1
  126. package/dist/web/assets/dropdown-menu-C-PcZxRY.js +1 -0
  127. package/dist/web/assets/{field-BaUOZtN5.js → field-DeguT8it.js} +1 -1
  128. package/dist/web/assets/{format-bytes-D5eCtdg1.js → format-bytes-Br4RwHnA.js} +1 -1
  129. package/dist/web/assets/hover-card-B-H7mMvg.js +1 -0
  130. package/dist/web/assets/identity-V8oA_IuB.js +1 -0
  131. package/dist/web/assets/{index-HRZACEmh.css → index-CHDkJLQR.css} +1 -1
  132. package/dist/web/assets/index-DdAVEwQV.js +24 -0
  133. package/dist/web/assets/{input-Dxh25T4M.js → input-CRCpCN_c.js} +1 -1
  134. package/dist/web/assets/label-DwMBzI2m.js +1 -0
  135. package/dist/web/assets/label-table-DiaZlHIp.js +1 -0
  136. package/dist/web/assets/{model-ZwOxwk2m.js → model-B4AuKvPj.js} +1 -1
  137. package/dist/web/assets/model-BwOv-HBS.js +1 -0
  138. package/dist/web/assets/{model-Blk5Wgg2.js → model-C-60EMcI.js} +1 -1
  139. package/dist/web/assets/{model-Bgh75q3j.js → model-CB4ObIOH.js} +1 -1
  140. package/dist/web/assets/{model--lR9icA_.js → model-CUAxIOXR.js} +1 -1
  141. package/dist/web/assets/{model-jC3F-J2F.js → model-CjQPAeCy.js} +1 -1
  142. package/dist/web/assets/{model-D4DkvMH-.js → model-CwFZ_IgV.js} +1 -1
  143. package/dist/web/assets/{model-CWMP5GOL.js → model-D-vak-m0.js} +1 -1
  144. package/dist/web/assets/{motion-BL3lek9c.js → motion-Cr9JChF9.js} +1 -1
  145. package/dist/web/assets/motion-D5Fs3-ut.js +1 -0
  146. package/dist/web/assets/{motion-preference-D3UMHojT.js → motion-preference-DgdzdVh8.js} +1 -1
  147. package/dist/web/assets/{occupation-catalog-BeJ2O9nm.js → occupation-catalog-DHsjkd_q.js} +1 -1
  148. package/dist/web/assets/{occupation-kits-Bkiu6MzD.js → occupation-kits-BVLLRN4V.js} +1 -1
  149. package/dist/web/assets/{option-Crs2MA88.js → option-DhAwzags.js} +1 -1
  150. package/dist/web/assets/{orchestration-filters-3AfjDoHQ.js → orchestration-filters-lhR2CHlQ.js} +1 -1
  151. package/dist/web/assets/overview-data-QDnygL-x.js +1 -0
  152. package/dist/web/assets/{page-refresh-Bz5r7A_Q.js → page-refresh-BVRlo-dI.js} +1 -1
  153. package/dist/web/assets/{page-title-KYZApNys.js → page-title-ReSXziuS.js} +1 -1
  154. package/dist/web/assets/{person-profile-mhLxWtq7.js → person-profile-BgUfg57K.js} +1 -1
  155. package/dist/web/assets/popover-UYksnAeH.js +1 -0
  156. package/dist/web/assets/popup-host-DMoMkD3v.js +1 -0
  157. package/dist/web/assets/preference-conflicts-a-H51vUw.js +1 -0
  158. package/dist/web/assets/{profile-model-DWutKuCZ.js → profile-model-CM98TJsj.js} +1 -1
  159. package/dist/web/assets/{project-board-layout-CWMHQuUA.js → project-board-layout-RH6UXkCA.js} +1 -1
  160. package/dist/web/assets/{project-capture-CebFSnn0.js → project-capture-DcQ8cXIt.js} +1 -1
  161. package/dist/web/assets/{project-origin-BnUVE0be.js → project-origin-BNzeAazi.js} +1 -1
  162. package/dist/web/assets/{quick-edit-api-YwzoODMc.js → quick-edit-api-COKVNuPk.js} +1 -1
  163. package/dist/web/assets/radio-group-DfegNkLG.js +1 -0
  164. package/dist/web/assets/review-api-CAKGInLD.js +1 -0
  165. package/dist/web/assets/{review-list-_PN7ljSY.js → review-list-CbpXvBp-.js} +1 -1
  166. package/dist/web/assets/{review-store-CobX9No6.js → review-store-BzrmqVoj.js} +1 -1
  167. package/dist/web/assets/{role-names-wD9l8uz5.js → role-names-Ba0c6AbS.js} +1 -1
  168. package/dist/web/assets/{roundtable-live-Dm4Vwo75.js → roundtable-live-CoKmaXKd.js} +1 -1
  169. package/dist/web/assets/{runtime-dom.esm-bundler-DzfwnSj8.js → runtime-dom.esm-bundler-CaYBCU9Y.js} +1 -1
  170. package/dist/web/assets/select-Bq2TQ0Gw.js +1 -0
  171. package/dist/web/assets/{session-launch-offers-C9UkoKUJ.js → session-launch-offers-C-oBkMKe.js} +1 -1
  172. package/dist/web/assets/{settings-autosave-L0zSXnBO.js → settings-autosave-C3bTildI.js} +1 -1
  173. package/dist/web/assets/settings-tabs-DFZcxOaQ.js +1 -0
  174. package/dist/web/assets/shared-report-Ci1jBiYV.js +3 -0
  175. package/dist/web/assets/{source-adapters-r-NIqO77.js → source-adapters-CunVF9JG.js} +1 -1
  176. package/dist/web/assets/switch-DaUSEDq0.js +1 -0
  177. package/dist/web/assets/tabs-B_7xQRfl.js +1 -0
  178. package/dist/web/assets/{task-card-fields-B1z1PmTT.js → task-card-fields-Ce11pWnv.js} +1 -1
  179. package/dist/web/assets/{task-evidence-DydhKn9x.js → task-evidence-D0XkNnb8.js} +1 -1
  180. package/dist/web/assets/{task-labels-DTc5OuFF.js → task-labels-BulIuDQB.js} +1 -1
  181. package/dist/web/assets/{task-reason-CneTZWRv.js → task-reason-gHlp8KHO.js} +1 -1
  182. package/dist/web/assets/{team-sheets-CUt3Vp2s.js → team-sheets-BzV1WjjK.js} +1 -1
  183. package/dist/web/assets/{textarea-DJ0ucCir.js → textarea-D6czUY3a.js} +1 -1
  184. package/dist/web/assets/ui-BCHzwL4X.js +1 -0
  185. package/dist/web/assets/ui-CgwSWg1F.css +1 -0
  186. package/dist/web/assets/{useAgentRecords-CwkwZy8H.js → useAgentRecords-DijrJ79w.js} +1 -1
  187. package/dist/web/assets/{useAgentWorkSummary-DoiCqME7.js → useAgentWorkSummary-CUv88AVP.js} +1 -1
  188. package/dist/web/assets/{useApi-CROJJdhE-CenjhnR5.js → useApi-CROJJdhE-CxqsMZ6P.js} +1 -1
  189. package/dist/web/assets/{useClipboardCopy-Ba86PzjA.js → useClipboardCopy-uGyNKuWB.js} +1 -1
  190. package/dist/web/assets/useDirection-Bi78LycK.js +1 -0
  191. package/dist/web/assets/{useFocusReturn-B0ErBkt_.js → useFocusReturn-7BKdKvqF.js} +1 -1
  192. package/dist/web/assets/{useForwardPropsEmits-D1vvIUcB.js → useForwardPropsEmits-BMeknK03.js} +1 -1
  193. package/dist/web/assets/useForwardScopeId-DHGSyWlZ.js +1 -0
  194. package/dist/web/assets/{useKnowledgeConfirm-781LUhoU.js → useKnowledgeConfirm-mFWI8EbK.js} +1 -1
  195. package/dist/web/assets/{useKnowledgeItemPeek-CnuCvJKQ.js → useKnowledgeItemPeek-DtazLM2s.js} +1 -1
  196. package/dist/web/assets/{useMinimumLoadingDisplay-DCC9EfQ9.js → useMinimumLoadingDisplay-D5UC2KRz.js} +1 -1
  197. package/dist/web/assets/{usePageTools-BaB021q0.js → usePageTools-BXkR_gpB.js} +1 -1
  198. package/dist/web/assets/usePrimitiveElement-BxOn-Fn_.js +1 -0
  199. package/dist/web/assets/{useProjectAgentRoster-M3wbWpS-.js → useProjectAgentRoster-blZ5REnH.js} +1 -1
  200. package/dist/web/assets/{useRoutePeek-CYg5JyYt.js → useRoutePeek-D_j5KVFv.js} +1 -1
  201. package/dist/web/assets/useTeamWork-e57CKhLW.js +1 -0
  202. package/dist/web/assets/{useTypeahead-DYb5kVkH.js → useTypeahead-6a1q-4Oq.js} +1 -1
  203. package/dist/web/assets/{utils-Cli0RsEd.js → utils-BQtZ8ZUw.js} +1 -1
  204. package/dist/web/assets/{utils-B7sUn8rD.js → utils-DBsOpQt4.js} +1 -1
  205. package/dist/web/assets/{verification-DY7kllTI.js → verification-BlF0avgs.js} +1 -1
  206. package/dist/web/assets/{version-CBgUEmnM.js → version-oG6VyAd6.js} +1 -1
  207. package/dist/web/assets/{vue-router-ab7kABlJ.js → vue-router-CCvxNose.js} +1 -1
  208. package/dist/web/index.html +75 -79
  209. package/docs/agent-roundtable.md +45 -3
  210. package/docs/judgment-and-autonomy.md +2 -0
  211. package/graph-provider/fuli_graph/app.py +6 -0
  212. package/graph-provider/fuli_graph/knowledge_duplicates.py +27 -14
  213. package/graph-provider/fuli_graph/knowledge_search.py +31 -32
  214. package/graph-provider/fuli_graph/knowledge_semantic.py +38 -11
  215. package/graph-provider/fuli_graph/knowledge_statement.py +230 -0
  216. package/graph-provider/fuli_graph/knowledge_statement_days.py +109 -0
  217. package/graph-provider/fuli_graph/models.py +15 -0
  218. package/graph-provider/fuli_graph/preference_organizing.py +162 -0
  219. package/graph-provider/fuli_graph/project_agent_routes.py +22 -0
  220. package/graph-provider/fuli_graph/project_agent_task_models.py +26 -2
  221. package/graph-provider/fuli_graph/store_project_agent_task_activity.py +51 -11
  222. package/graph-provider/fuli_graph/store_project_agent_task_blockers.py +13 -6
  223. package/graph-provider/fuli_graph/store_project_agent_task_person_close.py +82 -0
  224. package/graph-provider/fuli_graph/store_project_agent_tasks.py +18 -1
  225. package/graph-provider/fuli_graph/task_blocker.py +10 -0
  226. package/graph-provider/pyproject.toml +1 -1
  227. package/native/win32/fuli-win-helper.exe +0 -0
  228. package/npm-shrinkwrap.json +57 -9
  229. package/package.json +4 -3
  230. package/packages/roundtable/package.json +1 -0
  231. package/packages/roundtable/src/agents/claude-code/wake.js +4 -2
  232. package/packages/roundtable/src/agents/codex/wake.js +1 -0
  233. package/packages/roundtable/src/host.js +4 -1
  234. package/packages/roundtable/src/peer/control-cli.js +103 -2
  235. package/packages/roundtable/src/peer/control.js +29 -3
  236. package/packages/roundtable/src/peer/coordinator-http.js +23 -2
  237. package/packages/roundtable/src/peer/coordinator-service.js +92 -14
  238. package/packages/roundtable/src/peer/coordinator-store.js +2 -1
  239. package/packages/roundtable/src/peer/lan-addresses.js +43 -0
  240. package/packages/roundtable/src/peer/nearby-attempts.js +73 -0
  241. package/packages/roundtable/src/peer/nearby-discovery.js +132 -0
  242. package/packages/roundtable/src/peer/nearby-pairing.js +422 -0
  243. package/packages/roundtable/src/peer/nearby-presence.js +93 -0
  244. package/packages/roundtable/src/peer/node-store.js +10 -0
  245. package/packages/roundtable/src/peer/pairing-share.js +139 -0
  246. package/packages/roundtable/src/peer/peer-runtime.js +684 -89
  247. package/packages/roundtable/src/peer/peer-transport.js +58 -3
  248. package/packages/roundtable/src/peer/protocol.js +24 -1
  249. package/packages/roundtable/src/roundtable/chat-service.js +14 -3
  250. package/packages/roundtable/src/roundtable/chat.js +1 -0
  251. package/packages/roundtable/src/roundtable/delivery-state.js +2 -1
  252. package/packages/roundtable/src/roundtable/group-discussion-store.js +130 -5
  253. package/packages/roundtable/src/roundtable/group-discussion.js +596 -111
  254. package/packages/roundtable/src/roundtable/service.js +10 -2
  255. package/packages/roundtable/src/roundtable/store.js +11 -1
  256. package/packages/roundtable/src/roundtable/wake.js +3 -1
  257. package/packages/roundtable/src/standalone/cli.js +1 -1
  258. package/skills/capturing-session-knowledge/SKILL.md +1 -1
  259. package/skills/capturing-session-knowledge/references/coordination.md +28 -4
  260. package/skills/grilling-project/references/project-profile.md +13 -5
  261. package/skills/operating-fuli/SKILL.md +30 -5
  262. package/skills/operating-fuli/references/workflow-recipes.md +6 -2
  263. package/src/agent-apps/host-tools/catalog.js +2 -0
  264. package/src/agent-delegation/operation-log.js +15 -1
  265. package/src/agent-delegation/port.js +2 -3
  266. package/src/agent-delegation/refusals.js +12 -4
  267. package/src/agent-roundtable/task-context.js +1 -1
  268. package/src/agent-roundtable/tools.js +5 -2
  269. package/src/agent-tools/graph-definitions.js +2 -0
  270. package/src/agent-tools/graph-handlers.js +6 -3
  271. package/src/agent-tools/interface-catalog.js +11 -1
  272. package/src/agent-tools/interface-definitions.js +3 -2
  273. package/src/agent-tools/project-agent-definitions.js +2 -1
  274. package/src/agent-tools/project-organizing-definitions.js +7 -4
  275. package/src/agent-tools/project-space-definitions.js +2 -0
  276. package/src/agent-tools/session-fuli-gate.js +6 -1
  277. package/src/agent-tools/statement-definitions.js +18 -0
  278. package/src/agents/codex/lifecycle-hook.js +3 -1
  279. package/src/agents/identity-receipt.js +3 -1
  280. package/src/agents/native-session-env.js +7 -0
  281. package/src/conversations/entry-budget.js +3 -2
  282. package/src/conversations/entry-inline-budget.js +40 -10
  283. package/src/conversations/preference-lifecycle.js +3 -3
  284. package/src/conversations/turn-findings.js +9 -2
  285. package/src/graphiti/agent-project-resolution.js +18 -0
  286. package/src/graphiti/collaboration-preference-entry.js +5 -2
  287. package/src/graphiti/current-project-knowledge-search.js +3 -3
  288. package/src/graphiti/fla-mention.js +48 -9
  289. package/src/graphiti/local-runtimes.js +5 -0
  290. package/src/graphiti/project-agent-task-sessions.js +49 -0
  291. package/src/graphiti/project-agent-task-summaries.js +82 -0
  292. package/src/graphiti/project-agent-workflows.js +8 -5
  293. package/src/graphiti/project-path-context.js +23 -9
  294. package/src/graphiti/provider-client.js +23 -1
  295. package/src/graphiti/repository-remote.js +34 -8
  296. package/src/graphiti/roundtable-host.js +13 -1
  297. package/src/graphiti/task-context-entry.js +14 -7
  298. package/src/graphiti/task-entry-group-discussion.js +111 -25
  299. package/src/graphiti/task-entry-owner-change.js +22 -2
  300. package/src/graphiti/task-entry-preferences.js +9 -4
  301. package/src/graphiti/task-entry-project-scope.js +19 -0
  302. package/src/graphiti/task-preference-pages.js +3 -3
  303. package/src/graphiti/task-preference-reader.js +44 -9
  304. package/src/graphiti/worker-task-context.js +1 -1
  305. package/src/http/api-router.js +5 -0
  306. package/src/http/graph-api-router.js +5 -2
  307. package/src/http/statement-api-router.js +27 -0
  308. package/src/http/task-blocker-api-router.js +11 -1
  309. package/src/http/task-close-api-router.js +59 -0
  310. package/src/judgment/engine.js +6 -1
  311. package/src/judgment/http.js +2 -2
  312. package/src/judgment/review-delegation.js +16 -4
  313. package/src/judgment/review-egress.js +25 -0
  314. package/src/judgment/service.js +1 -1
  315. package/src/judgment/store.js +9 -0
  316. package/src/knowledge-impressions/store.js +72 -9
  317. package/src/mcp/create-mcp-server.js +2 -2
  318. package/src/mcp/direct-call.js +3 -2
  319. package/src/mcp/preference-delivery.js +64 -6
  320. package/src/mcp/session-id.js +12 -4
  321. package/src/mcp/tool-annotations.js +1 -0
  322. package/src/mcp/tool-result.js +8 -6
  323. package/src/model-backends/config.js +7 -0
  324. package/src/model-backends/egress.js +8 -0
  325. package/src/model-backends/failures.js +8 -0
  326. package/src/model-backends/port.js +39 -16
  327. package/src/model-backends/role-trust.js +3 -9
  328. package/src/model-backends/usage-ledger.js +20 -9
  329. package/src/notices/recent-notices.js +2 -1
  330. package/src/presence/windows-helper-pin.js +1 -1
  331. package/src/project-organizing/agent-tool.js +34 -7
  332. package/src/server.js +7 -0
  333. package/src/statement/agent-tool.js +29 -0
  334. package/src/statement/compounding-statement.js +134 -0
  335. package/src/task-blockers/agent-resume.js +73 -0
  336. package/src/task-blockers/console-port.js +5 -2
  337. package/src/task-blockers/resume-status.js +2 -0
  338. package/src/task-closing/console-port.js +26 -0
  339. package/src/whats-new/lines/0.27.1.json +13 -0
  340. package/src/whats-new/lines/0.27.2.json +13 -0
  341. package/dist/web/assets/AgentAppsPage-CjyvPZSs.js +0 -1
  342. package/dist/web/assets/AgentManagement-Cc00RLSO.css +0 -1
  343. package/dist/web/assets/AgentManagement-MMGrwdD2.js +0 -7
  344. package/dist/web/assets/AgentProfilePage-eDKbJJwY.js +0 -5
  345. package/dist/web/assets/AgentServicesPage-CZwsN5U2.js +0 -1
  346. package/dist/web/assets/Breadcrumb-BXTA4e-W.js +0 -1
  347. package/dist/web/assets/DataFormatPage-CQKkFhcH.js +0 -2
  348. package/dist/web/assets/DebugTurnPage-CUqbuhgX.js +0 -1
  349. package/dist/web/assets/DebugTurnsPage-HwaTG8Fa.js +0 -1
  350. package/dist/web/assets/DialogTitle-HYzAHbGg.js +0 -1
  351. package/dist/web/assets/EmployeeScopeDialog-yUCgujKT.js +0 -1
  352. package/dist/web/assets/EmployeeWorkbench-CbRJhkJO.js +0 -4
  353. package/dist/web/assets/FieldRoot-BLcsuPMA.js +0 -1
  354. package/dist/web/assets/FlasPage-CMv2awKJ.js +0 -1
  355. package/dist/web/assets/HowtoPage-CkGRrKpf.js +0 -1
  356. package/dist/web/assets/InboxPage-DfQvtnyq.js +0 -6
  357. package/dist/web/assets/KnowledgeItemEditPage-BUKQK37o.js +0 -1
  358. package/dist/web/assets/KnowledgeOrganizerPage-CiZ9JlNX.js +0 -1
  359. package/dist/web/assets/KnowledgePage-C3_Cvz4g.js +0 -1
  360. package/dist/web/assets/KnowledgePeek-DtOOiARX.js +0 -1
  361. package/dist/web/assets/KnowledgeTurnReceiptPage-Dne5NQ9q.js +0 -1
  362. package/dist/web/assets/KnowledgeWorkspace-Cq_XYcma.js +0 -4
  363. package/dist/web/assets/MenuSeparator-CLmsZ9rj.js +0 -1
  364. package/dist/web/assets/ModelSettingsPage-COVaW4eh.js +0 -1
  365. package/dist/web/assets/NoticeRow-D5MWTeBY.js +0 -1
  366. package/dist/web/assets/NoticeRow-ktVO_9Es.css +0 -1
  367. package/dist/web/assets/OccupationsPage-BKd051j1.js +0 -1
  368. package/dist/web/assets/OverviewPage-C90G_adj.js +0 -1
  369. package/dist/web/assets/OverviewPage-KVt4LcE-.css +0 -1
  370. package/dist/web/assets/PageColumns-DEideeB7.css +0 -1
  371. package/dist/web/assets/PageColumns-Df60nEzj.js +0 -1
  372. package/dist/web/assets/PersonalProfilePage-DIDgG3NH.js +0 -1
  373. package/dist/web/assets/PersonalProjectsPage-DwhlEpNg.js +0 -1
  374. package/dist/web/assets/PopperContent-DWCMeKSL.js +0 -1
  375. package/dist/web/assets/Presence-Ba3jqPYx.js +0 -3
  376. package/dist/web/assets/ProjectAgentsPage-BefVF9ZP.js +0 -5
  377. package/dist/web/assets/RecentNotices-CDHGIky1.js +0 -1
  378. package/dist/web/assets/RovingFocusGroup-DoGybG5V.js +0 -1
  379. package/dist/web/assets/RovingFocusItem-B455TzUI.js +0 -1
  380. package/dist/web/assets/SessionMigrationPage-BAzXqxxO.js +0 -1
  381. package/dist/web/assets/SettingsPage-7mNL3bwe.js +0 -1
  382. package/dist/web/assets/SettingsPage-Cku8SoLk.css +0 -1
  383. package/dist/web/assets/SharedJefaReportPage-rH6I4cI9.js +0 -1
  384. package/dist/web/assets/TaskBlockerClear-BBmPbomO.css +0 -1
  385. package/dist/web/assets/TaskBlockerClear-BHOMZYwm.js +0 -1
  386. package/dist/web/assets/TaskBlockerNotice-POmS2neR.js +0 -1
  387. package/dist/web/assets/TeamCardsWidget-DIHFUDrF.js +0 -1
  388. package/dist/web/assets/TeamIsland-DdhEcVOZ.js +0 -9
  389. package/dist/web/assets/Teleport-CukHuRhz.js +0 -1
  390. package/dist/web/assets/TonborgDelegationSwitch-BA3Qb8Wr.js +0 -1
  391. package/dist/web/assets/TonborgDelegationSwitch-DeqERWoo.css +0 -1
  392. package/dist/web/assets/UiDialog-bUwGQz96.js +0 -1
  393. package/dist/web/assets/UiIconButton-D3R6WwwI.css +0 -1
  394. package/dist/web/assets/UiIconButton-DlLZ5_Yc.js +0 -1
  395. package/dist/web/assets/UiSegmented-CYrTxDn1.js +0 -1
  396. package/dist/web/assets/WidgetSlot-D6vCSWaz.js +0 -2
  397. package/dist/web/assets/WorkbenchListHead-CR_fDYYr.js +0 -1
  398. package/dist/web/assets/WorkbenchListPage-BX6Z9gkB.css +0 -1
  399. package/dist/web/assets/WorkbenchListPage-Zr5PW-cf.js +0 -1
  400. package/dist/web/assets/_plugin-vue_export-helper-BRS32yXs.js +0 -9
  401. package/dist/web/assets/agent-occupation-CEd3bAhb.js +0 -1
  402. package/dist/web/assets/agent-workflows-D3VeY6Yz.js +0 -1
  403. package/dist/web/assets/checkbox-C67upxzl.js +0 -1
  404. package/dist/web/assets/combobox-yHRJ-zN-.js +0 -1
  405. package/dist/web/assets/conversation-launcher-settings-28CqC1Gn.js +0 -1
  406. package/dist/web/assets/copy-mention-C4Nos381.js +0 -1
  407. package/dist/web/assets/dialog-Cjoy4nsv.js +0 -1
  408. package/dist/web/assets/dropdown-menu-Dto6hjoc.js +0 -1
  409. package/dist/web/assets/hover-card-Bg0dulGq.js +0 -1
  410. package/dist/web/assets/index-B-aRUs9w.js +0 -24
  411. package/dist/web/assets/label-CbrduZla.js +0 -1
  412. package/dist/web/assets/label-table-_YAtPkRI.js +0 -1
  413. package/dist/web/assets/model-DcsCYhXk.js +0 -1
  414. package/dist/web/assets/motion-_MepnmMC.js +0 -1
  415. package/dist/web/assets/overview-data-BIeNATEJ.js +0 -1
  416. package/dist/web/assets/popover-CMahoDLo.js +0 -1
  417. package/dist/web/assets/popup-host-DKN99Od3.js +0 -1
  418. package/dist/web/assets/radio-group-vRt8y8mF.js +0 -1
  419. package/dist/web/assets/review-api-WhNB3ppo.js +0 -1
  420. package/dist/web/assets/select-B9mVptgx.js +0 -1
  421. package/dist/web/assets/settings-tabs-DTbgqX8g.js +0 -1
  422. package/dist/web/assets/shared-report-0FO_y0sa.js +0 -3
  423. package/dist/web/assets/switch-BCzrGc4W.js +0 -1
  424. package/dist/web/assets/tabs-CB38D8N0.js +0 -1
  425. package/dist/web/assets/ui-D4nAhcmu.css +0 -1
  426. package/dist/web/assets/ui-M_UKzb_A.js +0 -1
  427. package/dist/web/assets/useForwardExpose-DJ6fcpI2.js +0 -1
  428. package/dist/web/assets/useForwardScopeId-CoSQtoUU.js +0 -1
  429. package/dist/web/assets/usePrimitiveElement-iRKqOVuY.js +0 -1
  430. package/dist/web/assets/useTeamPeople-CPC62La3.js +0 -1
  431. package/dist/web/assets/useTeamWork-Dql3_qLV.js +0 -1
@@ -21,6 +21,22 @@ const GUIDANCE = 'This session\'s FLA changed: from this task on, to_agent_id ow
21
21
  const NAME_WAIT_MS = 300;
22
22
  const MARKER = /^owner_change:(\S+) (.+)$/su;
23
23
 
24
+ // How this task's project was found, said beside the change (rec#125), so a
25
+ // switch by repository address is not silent. Other bases add nothing.
26
+ const BASIS_LABELS = Object.freeze({
27
+ git_remote: { 'zh-CN': '按仓库地址', 'en-US': 'by repository address' },
28
+ repository_root: { 'zh-CN': '按仓库目录名', 'en-US': 'by repository folder name' },
29
+ directory_name: { 'zh-CN': '按目录名', 'en-US': 'by folder name' },
30
+ git_worktree_origin: { 'zh-CN': '按 worktree 原仓库名', 'en-US': 'by the worktree\'s original repository' },
31
+ workspace_child: { 'zh-CN': '按工作区里的项目目录', 'en-US': 'by a project folder in the workspace' },
32
+ registered_repository: { 'zh-CN': '按刚登记的仓库', 'en-US': 'by the repository just registered' },
33
+ named_in_prompt: { 'zh-CN': '按消息里的项目名', 'en-US': 'by the project named in the message' }
34
+ });
35
+
36
+ function basisLabel(basis) {
37
+ return BASIS_LABELS[String(basis ?? '').replace(/_case_insensitive$/u, '')] ?? null;
38
+ }
39
+
24
40
  // The FLA and project of the session's current task, as the session itself
25
41
  // holds them (a standing assignment's route keeps the session where it was).
26
42
  export function sessionOwnerOf(task) {
@@ -51,10 +67,14 @@ export async function previousOwnerName(application, from) {
51
67
  // The owner_change field, receipt notice and route marker.
52
68
  export function ownerChangeEntry(from, fromName, resolution, to, toName) {
53
69
  const fromLabel = fromName ?? from.agentId;
54
- const notice = `本会话上一个任务由 ${fromLabel} 负责,这次起由 ${toName ?? to} 负责;要继续由 ${fromLabel} 负责,消息开头写 #FLA ${fromLabel}`;
70
+ const label = basisLabel(resolution.basis);
71
+ const projectId = resolution.personalProjectId ?? null;
72
+ const basis = label ? `(${label['zh-CN']}${projectId ? `匹配到项目 ${projectId}` : ''})` : '';
73
+ const notice = `本会话上一个任务由 ${fromLabel} 负责,这次起由 ${toName ?? to} 负责${basis};要继续由 ${fromLabel} 负责,消息开头写 #FLA ${fromLabel}`;
55
74
  return {
56
75
  field: { from_agent_id: from.agentId, from_project_id: from.personalProjectId, to_agent_id: to,
57
- to_project_id: resolution.personalProjectId ?? null, guidance: GUIDANCE },
76
+ to_project_id: projectId, ...(label ? { basis: resolution.basis, basis_text: label['en-US'] } : {}),
77
+ guidance: GUIDANCE },
58
78
  receiptNotice: receiptText(notice),
59
79
  marker: `owner_change:${from.agentId} ${notice}`
60
80
  };
@@ -1,6 +1,6 @@
1
1
  import { captureSettingsUrl, receiptText, taskAgentReceipt } from '../agents/identity-receipt.js';
2
2
  import { FLA_ROUTE, namedFlaEntry } from './task-entry-named-fla.js';
3
- import { groupDiscussionEntry } from './task-entry-group-discussion.js';
3
+ import { groupDiscussionEntry, joinedRoundsEntry } from './task-entry-group-discussion.js';
4
4
  import { beginTaskContext, beginTaskFromPreferences } from './agent-knowledge-workflows.js';
5
5
  import { getCollaborationPreferences as getCollaborationPreferencesWorkflow } from './collaboration-preference-workflow.js';
6
6
  import { resolveTaskEntryAgent, loadProjectAgentContinuity } from './project-agent-task-entry.js';
@@ -168,7 +168,8 @@ async function entryPreferences(application, projectResolution, {
168
168
  includeTeam ? taskJudgmentContext(application, projectResolution.personalProjectId) : null
169
169
  ]);
170
170
  });
171
- const [preferences, management, [context, judgmentContext], triage, capture, formatNotices, roundtableAsk, ownerFromName] = await Promise.all([
171
+ const [preferences, management, [context, judgmentContext], triage, capture, formatNotices, roundtableAsk, ownerFromName,
172
+ joinedRounds] = await Promise.all([
172
173
  getCollaborationPreferencesWorkflow(
173
174
  application,
174
175
  projectResolution,
@@ -197,7 +198,11 @@ async function entryPreferences(application, projectResolution, {
197
198
  includeMessages && agentInvocation ? roundtableAskEntry(application, { taskPrompt, sessionId },
198
199
  { personalProjectId: projectResolution.personalProjectId ?? null, agentId: selection?.agent?.agentId ?? null }) : null,
199
200
  // Display only: bounded, and its ID stands in (task-entry-owner-change.js).
200
- previousOwnerName(application, ownerFrom)
201
+ previousOwnerName(application, ownerFrom),
202
+ // A round the host of a discussion this session joined by code addressed to it (rec#129).
203
+ includeMessages && agentInvocation && !group?.view
204
+ ? joinedRoundsEntry(application, { sourceApplication, sessionId: sessionId ?? sourceSessionId,
205
+ agentId: selection?.agent?.agentId ?? null }) : null
201
206
  ]);
202
207
  const managedPreferences = management ? { ...preferences, project_management_context: management } : preferences;
203
208
  if (context) applyAgentAssignment(context, selection);
@@ -225,7 +230,7 @@ async function entryPreferences(application, projectResolution, {
225
230
  ...(triage ? { triage_candidates: triage } : {}),
226
231
  ...(standing ? { standing_owner: standing.field } : {}),
227
232
  ...(ownerChange ? { owner_change: ownerChange.field } : {}),
228
- ...(fla?.view ? { fla: fla.view } : {}), ...(group?.view ? { flg: group.view } : {}),
233
+ ...(fla?.view ? { fla: fla.view } : {}), ...(group?.view ?? joinedRounds ? { flg: group?.view ?? joinedRounds } : {}),
229
234
  ...(group?.interaction ?? fla?.interaction ? { human_interaction: group?.interaction ?? fla.interaction } : {}),
230
235
  ...(routeMarkers.length ? { [FLA_ROUTE]: routeMarkers } : {}),
231
236
  ...(judgmentContext ? { judgment_context: judgmentContext } : {}),
@@ -7,6 +7,7 @@ import { groupDiscussionRequest } from './task-entry-group-discussion.js';
7
7
  import { addressedAgentId } from './fla-mention.js';
8
8
  import { ASSISTANT_AGENT_ID } from './assistant-identity.js';
9
9
  import { sessionOwnerOf } from './task-entry-owner-change.js';
10
+ import { REMOTE_CONFLICT } from './agent-project-resolution.js';
10
11
 
11
12
  // Restore only exact session provenance; a normal folder name is not a role binding.
12
13
  // An unclaimed conversation never creates a project or hires a lead: it stays
@@ -47,6 +48,9 @@ function sessionTaskReader(application, input) {
47
48
  }
48
49
 
49
50
  async function sessionEntryProject(application, resolution, input, readSessionTask) {
51
+ if (resolution.reason === REMOTE_CONFLICT && resolution.status === 'ambiguous') {
52
+ return remoteConflictProject(application, resolution, input, readSessionTask);
53
+ }
50
54
  // An unregistered repository ID is only a hint: when auto-registration did
51
55
  // not apply, the prompt, the session and the assistant still decide.
52
56
  if (resolution.personalProjectId
@@ -100,6 +104,21 @@ async function sessionEntryProject(application, resolution, input, readSessionTa
100
104
  }
101
105
  }
102
106
 
107
+ // The repository address and the folder name point to two projects (rec#125):
108
+ // a project the message names decides, then the session's previous project
109
+ // when it is one of the two. Otherwise the person still chooses.
110
+ async function remoteConflictProject(application, resolution, input, readSessionTask) {
111
+ try {
112
+ if (!hostInternalActivity(application, input)) {
113
+ const named = await projectNamedInPrompt(application, input.taskPrompt);
114
+ if (named && !named.ambiguous) return matched(named.personalProjectId, named.basis);
115
+ }
116
+ const previous = sessionTaskContext(await readSessionTask())?.personalProjectId;
117
+ if (previous && resolution.candidateProjectIds?.includes(previous)) return matched(previous, 'host_session_context');
118
+ } catch { /* an unreadable prompt project or session leaves the choice to the person */ }
119
+ return resolution;
120
+ }
121
+
103
122
  // Where the session's current task keeps it, or null. A task a standing
104
123
  // assignment routed never moves its session there: the session continues
105
124
  // where it was before that task. Nor does a named FLA's, once its binding ended.
@@ -2,7 +2,7 @@ import { randomBytes } from 'node:crypto';
2
2
  import { ApplicationError } from '../app/application-error.js';
3
3
  import { contentHash } from '../../packages/roundtable/src/canonical-json.js';
4
4
  import { completePreferenceToolResult } from '../mcp/tool-result.js';
5
- import { blockedPreferenceDelivery, TASK_PREFERENCE_RESULT_LIMIT_BYTES } from '../mcp/preference-delivery.js';
5
+ import { blockedPreferenceRecovery, TASK_PREFERENCE_RESULT_LIMIT_BYTES } from '../mcp/preference-delivery.js';
6
6
 
7
7
  const COLLECTIONS = ['effective_preferences', 'active_conflicts', 'deferred_conflicts'];
8
8
  const REPEATED = new Set(['taskContextToken', 'task_context_token', 'checkpoint_required', 'agent_receipt',
@@ -89,13 +89,13 @@ export function createTaskPreferencePager({ now = Date.now } = {}) {
89
89
  for (let end = 1; end <= units.length; end++) {
90
90
  const candidate = completePreferenceToolResult(page(start, end, units.length, units.length, CURSOR_PLACEHOLDER));
91
91
  if (candidate.structuredContent.preference_delivery.status !== 'blocked') continue;
92
- if (end - 1 === start) return blockedPreferenceDelivery(full, 'delivery_budget');
92
+ if (end - 1 === start) return blockedPreferenceRecovery(full, 'delivery_budget');
93
93
  ranges.push([start, end - 1]);
94
94
  start = end - 1;
95
95
  // Retry this item on its own, including when it is the final item.
96
96
  end--;
97
97
  }
98
- if (start === units.length) return blockedPreferenceDelivery(full, 'delivery_budget');
98
+ if (start === units.length) return blockedPreferenceRecovery(full, 'delivery_budget');
99
99
  ranges.push([start, units.length]);
100
100
  while (snapshots.size >= MAX_SNAPSHOTS) remove(snapshots.keys().next().value);
101
101
  state = { ranges, expires: now() + CURSOR_TTL_MS,
@@ -1,11 +1,13 @@
1
1
  import { ApplicationError } from '../app/application-error.js';
2
+ import { isFuliProcessSession } from '../mcp/session-id.js';
3
+ import { ProviderRequestError } from './provider-client.js';
2
4
  import { captureSettingsUrl, taskAgentReceipt } from '../agents/identity-receipt.js';
3
5
  import { taskPreferenceScope } from '../mcp/provider-task-context-registry.js';
4
6
  import { projectAgentCollaborationPreferences } from './collaboration-preference-workflow.js';
5
7
  import { taskKnowledgeGuidance } from './task-knowledge-guidance.js';
6
8
  import { taskJudgmentContext } from './task-entry-preferences.js';
7
9
  import { withWorkerTaskGuidance } from './worker-task-context.js';
8
- import { blockedPreferenceDelivery } from '../mcp/preference-delivery.js';
10
+ import { blockedPreferenceRecovery } from '../mcp/preference-delivery.js';
9
11
  import { projectAgentRecord } from './project-agent-mapping.js';
10
12
  import { PROJECT_AGENT_CONTINUITY_GUIDANCE, projectAgentRoleContext, projectAgentRoleTextOverflows } from './project-agent-task-entry.js';
11
13
  import { loadProjectTeamContext } from './project-agent-team-context.js';
@@ -22,15 +24,13 @@ const PAGERS = new WeakMap();
22
24
 
23
25
  // A fresh read of the current source, never a task entry or preference snapshot.
24
26
  export async function readTaskPreferences(application, {
25
- taskContextToken, sourceApplication, sourceSessionId, sourceSessionVerified = false,
27
+ taskContextToken, sourceApplication, sourceSessionId, sourceSessionVerified = false, sourceSessionBinding = null,
26
28
  workerRun = null, cursor
27
29
  }) {
28
- if (!sourceSessionVerified || !sourceSessionId || sourceSessionId.startsWith('fuli-host-')) {
29
- throw blocked('This host has no verified native or sealed worker session; do not supply or guess a session to recover preferences.');
30
- }
31
- const { task, preferences } = await application.taskContextRegistry.preferences(taskContextToken,
32
- { sourceApplication, sessionId: sourceSessionId });
33
- if (task.token !== taskContextToken || task.sessionId !== sourceSessionId ||
30
+ const sessionId = await readerSession(application,
31
+ { taskContextToken, sourceApplication, sourceSessionId, sourceSessionVerified, sourceSessionBinding });
32
+ const { task, preferences } = await ownedTaskPreferences(application, taskContextToken, { sourceApplication, sessionId });
33
+ if (task.token !== taskContextToken || task.sessionId !== sessionId ||
34
34
  task.sourceApplication !== sourceApplication || task.checkpoint?.phase === 'complete') {
35
35
  throw blocked('Task preferences do not belong to this active host session.');
36
36
  }
@@ -114,10 +114,45 @@ export async function readTaskPreferences(application, {
114
114
  }
115
115
  if (!PAGERS.has(application)) PAGERS.set(application, createTaskPreferencePager());
116
116
  const page = PAGERS.get(application).read(projection.context.source_truncated
117
- ? blockedPreferenceDelivery(result, 'source_window') : result, { cursor });
117
+ ? blockedPreferenceRecovery(result, 'source_window') : result, { cursor });
118
118
  // A final page is only a suffix, never a complete native delta baseline.
119
119
  return page.preference_delivery.status === 'complete'
120
120
  ? withPreferenceScope(page, taskPreferenceMetadata(task, spaceId)) : page;
121
121
  }
122
122
 
123
+ // The session whose task this read may recover. A host that names a session
124
+ // (native or sealed worker) binds it, and a task of another session is
125
+ // refused. A process of a client that names no session at all
126
+ // (sourceSessionBinding 'task_token', set by session-id.js, such as Claude
127
+ // Desktop's connector serving its Code tab, rec#107, rec#128): there the
128
+ // token's current, unfinished task in this client names its own session,
129
+ // recorded when the task began. A process of a client that names sessions but
130
+ // proves none is refused. The caller never supplies or chooses a session.
131
+ async function readerSession(application,
132
+ { taskContextToken, sourceApplication, sourceSessionId, sourceSessionVerified, sourceSessionBinding }) {
133
+ if (sourceSessionVerified && sourceSessionId && !isFuliProcessSession(sourceSessionId)) return sourceSessionId;
134
+ if (!sourceSessionVerified && sourceSessionBinding === 'task_token' && isFuliProcessSession(sourceSessionId)) {
135
+ const sessionId = await application.taskContextRegistry.currentTaskSession(taskContextToken, sourceApplication);
136
+ if (typeof sessionId === 'string' && sessionId && !isFuliProcessSession(sessionId)) return sessionId;
137
+ throw blocked('This taskContextToken names no current task of a host session in this client; recover with the latest entry\'s token.');
138
+ }
139
+ throw blocked('This host has no verified native or sealed worker session; do not supply or guess a session to recover preferences.');
140
+ }
141
+
142
+ // The Provider answers 404 when the token's current task is not this
143
+ // session's: an MCP process started before /clear or an in-app resume still
144
+ // names the earlier session (the host's variable is fixed at its start), or a
145
+ // newer entry superseded the token. Said as the reader's refusal, never a
146
+ // provider error the model would retry.
147
+ async function ownedTaskPreferences(application, token, scope) {
148
+ try {
149
+ return await application.taskContextRegistry.preferences(token, scope);
150
+ } catch (error) {
151
+ if (!(error instanceof ProviderRequestError && error.status === 404)) throw error;
152
+ // Shown whole: an MCP error message keeps 240 characters.
153
+ throw blocked('Not the current task of this MCP process\'s session: the process may predate /clear or a resume, or a newer '
154
+ + 'entry superseded the token. Tell the person; checkpoint this token as incomplete if checkpoint_required.');
155
+ }
156
+ }
157
+
123
158
  function blocked(message) { return new ApplicationError('preference_recovery_blocked', message); }
@@ -12,7 +12,7 @@ const OWN_LAYER_TOOLS = new Set([
12
12
  const ENTRY_TOOLS = new Set(['begin_task_context', 'get_collaboration_preferences']);
13
13
  const SOURCE_FIELDS = new Set([
14
14
  'sourceApplication', 'source_application', 'sourceSessionId', 'source_session_id',
15
- 'sourceSessionVerified', 'source_session_verified', 'sessionId', 'session_id',
15
+ 'sourceSessionVerified', 'source_session_verified', 'sourceSessionBinding', 'sessionId', 'session_id',
16
16
  'turnId', 'turn_id', 'taskContextToken', 'task_context_token',
17
17
  'personalSpaceId', 'personal_space_id', 'personalProjectId', 'personal_project_id',
18
18
  'projectAgentId', 'project_agent_id', 'agentId', 'agent_id', 'ownerInspection',
@@ -22,6 +22,7 @@ import { handleKnowledgeHardDeleteRequest } from './knowledge-hard-delete-api-ro
22
22
  import { handleKnowledgeScopeRequest } from './knowledge-scope-api-router.js';
23
23
  import { handleProjectHierarchyRequest } from './project-hierarchy-api-router.js';
24
24
  import { handleTaskBlockerRequest } from './task-blocker-api-router.js';
25
+ import { handleTaskCloseRequest } from './task-close-api-router.js';
25
26
  import { handleKnowledgeTagsRequest } from './knowledge-tags-api-router.js';
26
27
  import { handleStandingAssignmentRequest } from './standing-assignment-api-router.js';
27
28
  import { handleClientLinksRequest } from './client-links-api-router.js';
@@ -42,6 +43,7 @@ import { ASTRO_OPERATION } from '../graphiti/assistant-project-candidate.js';
42
43
  import { DREAMING_OPERATION } from '../dreaming/run.js';
43
44
  import { handleDreamingRequest } from './dreaming-api-router.js';
44
45
  import { handleNoticesRequest } from './notices-api-router.js';
46
+ import { handleStatementRequest } from './statement-api-router.js';
45
47
  import { handleRetrospectivesRequest } from './retrospectives-api-router.js';
46
48
  import { handleSemanticRequest } from './semantic-api-router.js';
47
49
  import { handleEmbeddingModelsRequest } from './embedding-models-api-router.js';
@@ -66,6 +68,7 @@ export async function handleApiRequest({
66
68
  knowledgeScope = null,
67
69
  projectHierarchy = null,
68
70
  taskBlockers = null,
71
+ taskClosing = null,
69
72
  knowledgeOwnerReads = null,
70
73
  knowledgeTags = null,
71
74
  modelRoleSettings = null,
@@ -232,6 +235,7 @@ export async function handleApiRequest({
232
235
  if (await handleOccupationPluginsRequest({ request, response, url, app })) return true;
233
236
  if (await handleDreamingRequest({ request, response, url, app, ownerReads: knowledgeOwnerReads })) return true;
234
237
  if (await handleNoticesRequest({ request, response, url, app, delegation: agentDelegation, system })) return true;
238
+ if (await handleStatementRequest({ request, response, url, app })) return true;
235
239
  if (await handleRetrospectivesRequest({ request, response, url, app })) return true;
236
240
  if (await handleSemanticRequest({ request, response, url, app, indexer: app.semanticIndexer ?? null })) return true;
237
241
  if (await handleEmbeddingModelsRequest({ request, response, url, embeddingModels: app.embeddingModels ?? null })) return true;
@@ -296,6 +300,7 @@ export async function handleApiRequest({
296
300
  await handleKnowledgeScopeRequest({ request, response, url, app, scopeConsole: knowledgeScope, ownerReads: knowledgeOwnerReads }) ||
297
301
  await handleProjectHierarchyRequest({ request, response, url, app, hierarchyConsole: projectHierarchy }) ||
298
302
  await handleTaskBlockerRequest({ request, response, url, app, blockerConsole: taskBlockers }) ||
303
+ await handleTaskCloseRequest({ request, response, url, app, closeConsole: taskClosing }) ||
299
304
  await handleKnowledgeTagsRequest({ request, response, url, app, tagsConsole: knowledgeTags }) ||
300
305
  await handleJudgmentApiRequest({ request, response, url, app, undoConsole: judgmentUndo, ownerReads: knowledgeOwnerReads }) ||
301
306
  await handleStandingAssignmentRequest({ request, response, url, app }) ||
@@ -14,6 +14,7 @@ import { handleSessionRecordsRequest } from './session-records-api-router.js';
14
14
  import { handleCaptureChangeRequest } from './capture-change-api-router.js';
15
15
  import { handleCaptureOnboardingRequest, handleFirstRunGuideRequest } from './capture-onboarding-api-router.js';
16
16
  import { PERSON_WRITER } from '../graphiti/project-profile-authors.js';
17
+ import { taskSessions } from '../graphiti/project-agent-task-sessions.js';
17
18
 
18
19
  // The Provider keeps a confirmer's label of at most this many characters.
19
20
  const CONFIRMER_LABEL_LIMIT = 160;
@@ -372,13 +373,15 @@ export async function handleGraphApiRequest({
372
373
  return true;
373
374
  }
374
375
  if (url.pathname === '/api/project-agent-tasks' && request.method === 'GET') {
375
- sendJson(response, 200, await app.listProjectAgentTasks({
376
+ const tasks = await app.listProjectAgentTasks({
376
377
  personalSpaceId: url.searchParams.get('personalSpaceId'),
377
378
  personalProjectId: url.searchParams.get('personalProjectId'),
378
379
  agentId: url.searchParams.get('agentId'),
379
380
  status: url.searchParams.get('status'),
380
381
  limit: numberParam(url, 'limit', null)
381
- }));
382
+ });
383
+ // The console shows which client each open task runs in (今天's 正在干活).
384
+ sendJson(response, 200, tasks.map((task) => ({ ...task, sessions: taskSessions(task) })));
382
385
  return true;
383
386
  }
384
387
  if (url.pathname === '/api/project-agent-task-pages' && request.method === 'GET') {
@@ -0,0 +1,27 @@
1
+ import { InvalidInputError } from '../app/application-error.js';
2
+ import { compoundingStatement, statementDays, statementDaysWindow, statementWindow } from '../statement/compounding-statement.js';
3
+ import { refuseRemoteDecision } from './request-policy.js';
4
+ import { sendJson } from './response.js';
5
+
6
+ // The person's compounding statement (src/statement). Read only and only on
7
+ // this computer, like the workbench's notices: it counts what was done for
8
+ // the person. from/to are the person's local week bounds the console computed;
9
+ // /days takes a range of local days with the person's UTC offset.
10
+ const PATH = '/api/statement';
11
+ const DAYS_PATH = '/api/statement/days';
12
+
13
+ export async function handleStatementRequest({ request, response, url, app }) {
14
+ if (url.pathname !== PATH && url.pathname !== DAYS_PATH) return false;
15
+ response.setHeader('Cache-Control', 'no-store');
16
+ if (refuseRemoteDecision(request, response, 'The statement is read only on this computer')) return true;
17
+ if (request.method !== 'GET') { sendJson(response, 405, { error: 'Method not allowed' }); return true; }
18
+ const params = url.searchParams;
19
+ if (url.pathname === DAYS_PATH) {
20
+ sendJson(response, 200, await statementDays(app, statementDaysWindow({ from: params.get('from'), to: params.get('to') })));
21
+ return true;
22
+ }
23
+ if (params.has('weeks') && !/^\d{1,2}$/.test(params.get('weeks'))) throw new InvalidInputError('weeks must be a whole number of weeks');
24
+ sendJson(response, 200, await compoundingStatement(app, statementWindow({ from: params.get('from'), to: params.get('to'),
25
+ ...(params.has('weeks') ? { weeks: Number(params.get('weeks')) } : {}) })));
26
+ return true;
27
+ }
@@ -3,6 +3,7 @@ import { delegatedCall } from './agent-delegation-gate.js';
3
3
  import { refuseRemoteDecision } from './request-policy.js';
4
4
  import { validationError } from '../app/application-error.js';
5
5
  import { requiredString } from '../validation/values.js';
6
+ import { RESUME_STATUSES } from '../task-blockers/resume-status.js';
6
7
 
7
8
  const CLEAR_PATH = /^\/api\/project-agent-tasks\/([^/]+)\/blocker\/clear$/;
8
9
  const MAX_ID = 128;
@@ -36,12 +37,21 @@ export async function handleTaskBlockerRequest({ request, response, url, app, bl
36
37
  if (body.confirmHint != null && typeof body.confirmHint !== 'boolean') {
37
38
  throw validationError('confirmHint must be true or false');
38
39
  }
40
+ // An FLA resuming the task from its own report may put it back in its queue (rec#123).
41
+ if (body.resumeStatus != null && !RESUME_STATUSES.has(body.resumeStatus)) {
42
+ throw validationError('resumeStatus must be running or queued');
43
+ }
44
+ // The revision the clearer read; the Provider clears nothing if the task moved on since.
45
+ if (body.expectedRevision != null && !(Number.isSafeInteger(body.expectedRevision) && body.expectedRevision >= 0)) {
46
+ throw validationError('expectedRevision must be a whole number from 0');
47
+ }
39
48
  const call = delegatedCall(request);
40
49
  const clearer = call
41
50
  ? { agent: { agentId: call.actor.agentId, client: call.actor.client, sessionId: call.actor.sessionId },
42
51
  note: note ?? call.reason }
43
52
  : { confirmHint: body.confirmHint === true, note };
44
53
  sendJson(response, 200, await blockerConsole.markUnblocked(taskId,
45
- { personalSpaceId: body.personalSpaceId, personalProjectId, ...clearer }));
54
+ { personalSpaceId: body.personalSpaceId, personalProjectId, resumeStatus: body.resumeStatus ?? null,
55
+ expectedRevision: body.expectedRevision ?? null, ...clearer }));
46
56
  return true;
47
57
  }
@@ -0,0 +1,59 @@
1
+ import { readJson, sendJson } from './response.js';
2
+ import { delegatedCall } from './agent-delegation-gate.js';
3
+ import { refuseRemoteDecision } from './request-policy.js';
4
+ import { ApplicationError, validationError } from '../app/application-error.js';
5
+ import { requiredString } from '../validation/values.js';
6
+
7
+ const CLOSE_PATH = /^\/api\/project-agent-tasks\/([^/]+)\/close$/;
8
+ const STATUSES = new Set(['completed', 'cancelled']);
9
+ const MAX_ID = 128;
10
+ const MAX_NOTE = 1000;
11
+ const PERSON_SUMMARY = 'Closed by the person in FULI.';
12
+ // Closing a task is the person's acceptance, so their relayed words must say
13
+ // it themselves: a bare yes to the Agent's question is not enough (rec#123).
14
+ const MIN_CLOSE_WORDS = 2;
15
+ const ASSENT = new Set(['可以', '好', '好的', '好吧', '行', '行吧', '嗯', '嗯嗯', '对', '是', '是的', '可以的', '没问题',
16
+ '同意', 'ok', 'okay', 'yes', 'yep', 'yeah', 'sure', 'fine', 'alright', 'agreed', 'go ahead', 'do it', 'sounds good']);
17
+ const ASSENT_ONLY = '这句话只是同意:要结束任务,请让本人用自己的话说这个任务已完成或取消。 / '
18
+ + 'These words only assent; the person must say in their own words that the task is done or cancelled.';
19
+
20
+ function bareAssent(words) {
21
+ const bare = String(words).toLowerCase().replace(/[\p{P}\p{S}]+/gu, ' ').replace(/\s+/g, ' ').trim();
22
+ return ASSENT.has(bare) || [...bare.replace(/ /g, '')].length < MIN_CLOSE_WORDS;
23
+ }
24
+
25
+ // The person completes or cancels a task themself (rec#123). An FLA relays
26
+ // the person's words with run_delegated_action; the delegation gate admits it
27
+ // only with those words found in the person's recent messages and only while
28
+ // Settings › AI permissions › Relay your decisions is on, and records it. The
29
+ // task's history then carries the person's words and names the FLA that
30
+ // relayed them. Accepted only on this computer.
31
+ export async function handleTaskCloseRequest({ request, response, url, app, closeConsole }) {
32
+ const match = url.pathname.match(CLOSE_PATH);
33
+ if (!match || request.method !== 'POST') return false;
34
+ response.setHeader('Cache-Control', 'no-store');
35
+ if (refuseRemoteDecision(request, response, 'Tasks are closed by the person only on this computer')) return true;
36
+ if (!closeConsole) {
37
+ sendJson(response, 503, { error: 'Closing a task needs a local FULI installation' });
38
+ return true;
39
+ }
40
+ const body = await readJson(request);
41
+ if (body?.personalSpaceId !== app.config.personal.spaceId) {
42
+ throw validationError('Tasks are closed in the active personal space');
43
+ }
44
+ const taskId = requiredString(decodeURIComponent(match[1]), 'taskId', MAX_ID);
45
+ const personalProjectId = requiredString(body.personalProjectId, 'personalProjectId', MAX_ID);
46
+ if (!STATUSES.has(body.status)) throw validationError('status must be completed or cancelled');
47
+ const blank = body.note == null || (typeof body.note === 'string' && !body.note.trim());
48
+ const note = blank ? null : requiredString(body.note, 'note', MAX_NOTE);
49
+ const call = delegatedCall(request);
50
+ if (call?.relayed && bareAssent(call.relayed.words)) {
51
+ throw new ApplicationError('person_words_not_a_close', ASSENT_ONLY, { status: 400 });
52
+ }
53
+ // A relayed close is the person's words, then what the relaying FLA adds.
54
+ const summary = call?.relayed ? [`「${call.relayed.words}」`, note].filter(Boolean).join(' ') : note ?? PERSON_SUMMARY;
55
+ const relayer = call ? { agentId: call.actor.agentId, client: call.actor.client, sessionId: call.actor.sessionId } : null;
56
+ sendJson(response, 200, await closeConsole.closeAsPerson(taskId,
57
+ { personalSpaceId: body.personalSpaceId, personalProjectId, status: body.status, summary, relayer }));
58
+ return true;
59
+ }
@@ -18,6 +18,7 @@ import { ASK_FIELDS, askProperties, guessProperty, softAsk } from './question-op
18
18
  import { injectionSignals } from './review-injection-precheck.js';
19
19
  import { automaticWriteDecision } from '../graphiti/capture-decision.js';
20
20
  import { coversClient } from '../agents/source-applications.js';
21
+ import { reviewEgressRefused } from './review-egress.js';
21
22
 
22
23
  const id = z.string().min(1).max(256);
23
24
  const reviewInput = z.object({ personalSpaceId: id, personalProjectId: id.nullable().optional(), requestId: id,
@@ -253,7 +254,11 @@ export function createJudgmentEngine({ app, judge = createJudgmentBackend(), tru
253
254
  let records = [], checked = 0;
254
255
  for (; checked < Math.min(scopes.length, 25); checked++) {
255
256
  const projectId = scopes[((cursor.value ?? 0) + checked) % scopes.length];
256
- if (automatic && store.policy(space, projectId ?? '').mode === 'manual' && !store.delegation(space).enabled) continue;
257
+ const policy = store.policy(space, projectId ?? '');
258
+ if (automatic && policy.mode === 'manual' && !store.delegation(space).enabled) continue;
259
+ // rec#124: a scope Tonborg's model may not read is skipped, with no attempt and no failed record each round;
260
+ // the switch on 待决策 names it (review-egress.js). A review the person asks for still records the refusal.
261
+ if (automatic && policy.backend !== 'legacy_cli' && reviewEgressRefused(app.modelBackends, space, projectId)) continue;
257
262
  try {
258
263
  const result = await review(service, { ...input, personalProjectId: projectId,
259
264
  requestId: `${input.requestId}:${projectId ?? 'global'}`.slice(0, 256) }, { localOnly: true });
@@ -52,7 +52,7 @@ export async function handleJudgmentApiRequest({ request, response, url, app, un
52
52
  response.setHeader('Cache-Control', 'no-store');
53
53
  if (refuseRemoteDecision(request, response, 'Handing review to Tonborg is changed only on this computer')) return true;
54
54
  sendJson(response, 200, await setReviewDelegation({ judgment: app.judgment, modelTrust: app.modelTrust ?? null,
55
- input: await readJson(request) }));
55
+ modelBackends: app.modelBackends ?? null, input: await readJson(request) }));
56
56
  return true;
57
57
  }
58
58
  if (OWNER_ROUTES.has(route)) {
@@ -76,7 +76,7 @@ export async function handleJudgmentApiRequest({ request, response, url, app, un
76
76
  [`GET ${SUGGESTIONS_PATH}`]: async () => ({ suggestions: await tonborgReviewSuggestions({ judgment: app.judgment,
77
77
  input: { personalSpaceId: query.personalSpaceId } }) }),
78
78
  [`GET ${DELEGATION_PATH}`]: () => reviewDelegation({ judgment: app.judgment, modelTrust: app.modelTrust ?? null,
79
- input: { personalSpaceId: query.personalSpaceId } }),
79
+ modelBackends: app.modelBackends ?? null, input: { personalSpaceId: query.personalSpaceId } }),
80
80
  // language: the one the console shows now, so each question is asked in it.
81
81
  [`GET ${DELEGATED_PATH}`]: () => delegatedReviewList({ judgment: app.judgment, personal: app.personal,
82
82
  input: { personalSpaceId: query.personalSpaceId, ...(query.language ? { language: query.language } : {}) } }),
@@ -4,6 +4,7 @@ import { EmployeeError } from '../employees/manifest.js';
4
4
  import { TONBORG_OPERATIONS } from './backend.js';
5
5
  import { DELEGATED_LIST_LIMIT, latestDelegatedReviews } from './delegated-reviews.js';
6
6
  import { plainQuestion } from './question-options.js';
7
+ import { reviewReach } from './review-egress.js';
7
8
  import { parse } from './service.js';
8
9
  import { visibleKnowledgeKeys } from './visible-items.js';
9
10
 
@@ -41,13 +42,24 @@ function tonborgModel(modelTrust) {
41
42
  return { connected, status: view.status, reason: connected ? view.reason : 'not_configured' };
42
43
  }
43
44
 
44
- export async function reviewDelegation({ judgment, modelTrust, input }) {
45
+ // The switch as the console reads it: its state, Tonborg's model, and which
46
+ // active projects that model may read (rec#124: on, it still confirms nothing
47
+ // in a project the person did not approve for it). The projects live in the
48
+ // Provider; without it reach is null and the switch still reads.
49
+ async function delegationView({ judgment, modelTrust, modelBackends }, personalSpaceId, saved) {
50
+ const projectIds = await judgment.activeProjectIds(personalSpaceId).catch(() => null);
51
+ return { ...saved, model: tonborgModel(modelTrust),
52
+ reach: projectIds ? reviewReach(modelBackends, personalSpaceId, projectIds,
53
+ projectId => judgment.store().policy(personalSpaceId, projectId ?? '').backend !== 'legacy_cli') : null };
54
+ }
55
+
56
+ export async function reviewDelegation({ judgment, modelTrust, modelBackends = null, input }) {
45
57
  const { personalSpaceId } = parse(readInput, input);
46
58
  await judgment.scope({ personalSpaceId });
47
- return { ...judgment.store().delegation(personalSpaceId), model: tonborgModel(modelTrust) };
59
+ return delegationView({ judgment, modelTrust, modelBackends }, personalSpaceId, judgment.store().delegation(personalSpaceId));
48
60
  }
49
61
 
50
- export async function setReviewDelegation({ judgment, modelTrust, input }) {
62
+ export async function setReviewDelegation({ judgment, modelTrust, modelBackends = null, input }) {
51
63
  const { personalSpaceId, enabled, expectedRevision, language } = parse(writeInput, input);
52
64
  await judgment.scope({ personalSpaceId });
53
65
  // Only turning it on is the say-so; saving it on again (a new language) changes no trust setting.
@@ -64,7 +76,7 @@ export async function setReviewDelegation({ judgment, modelTrust, input }) {
64
76
  if (!trust.warningSeen) modelTrust.acknowledgeWarning(ROLE, trust.warningVersion, trust.revision);
65
77
  }
66
78
  const saved = judgment.store().setDelegation(personalSpaceId, enabled, expectedRevision, language);
67
- return { ...saved, model: tonborgModel(modelTrust) };
79
+ return delegationView({ judgment, modelTrust, modelBackends }, personalSpaceId, saved);
68
80
  }
69
81
 
70
82
  // What the person's list shows of Tonborg's delegated work: the items it
@@ -0,0 +1,25 @@
1
+ import { scopeEgress } from '../model-backends/egress.js';
2
+ import { TONBORG_OPERATIONS } from './backend.js';
3
+
4
+ // rec#124: Tonborg's model may carry a project's knowledge out only when the
5
+ // person approved that project for it (C7, model-backends/egress.js). Its
6
+ // scheduled review skips a scope its model would refuse, instead of failing
7
+ // there every round, and the switch says which scopes it cannot reach. Both
8
+ // read the live settings, so approving a project takes effect on the next round.
9
+
10
+ // Whether Tonborg's model would refuse a knowledge review of this scope
11
+ // (personalProjectId null: knowledge outside projects). Without a model of its
12
+ // own, or with one on this computer, nothing is refused.
13
+ export function reviewEgressRefused(modelBackends, personalSpaceId, personalProjectId) {
14
+ return modelBackends?.refusesEgress(scopeEgress({ role: 'tonborg', operation: TONBORG_OPERATIONS.review,
15
+ scope: { personalSpaceId, personalProjectId } })) === true;
16
+ }
17
+
18
+ // What the switch says of the active projects: how many there are, which ones
19
+ // Tonborg's model may not read, and whether knowledge outside projects may go.
20
+ // A scope reviewed through the person's own CLI client sends nothing to the
21
+ // model, so the scheduled review still covers it (usesModel says which do not).
22
+ export function reviewReach(modelBackends, personalSpaceId, projectIds, usesModel = () => true) {
23
+ const refused = projectId => usesModel(projectId) && reviewEgressRefused(modelBackends, personalSpaceId, projectId);
24
+ return { projects: projectIds.length, blockedProjectIds: projectIds.filter(refused), unassignedAllowed: !refused(null) };
25
+ }
@@ -88,7 +88,7 @@ export function createJudgmentService({ app, openStore = () => new JudgmentStore
88
88
  return questionsPort ??= questionTools({ app, service });
89
89
  };
90
90
  const service = {
91
- store, scope,
91
+ store, scope, activeProjectIds,
92
92
  async pins(input) { space(input); return store().pins(input.personalSpaceId); },
93
93
  async pin(input) {
94
94
  const parsed = parse(pinSchema, input); space(parsed);
@@ -214,6 +214,15 @@ export class JudgmentStore {
214
214
  AND json_extract(value,'$.mode') IN ('shared','autonomous')) OR (key=? AND json_extract(value,'$.enabled')=1))
215
215
  LIMIT 1`).get(space, DELEGATION_KEY)?.enabled === 1;
216
216
  }
217
+ // How many judgments Tonborg applied in [from, to), and how many the person
218
+ // undid there (the undo is its own receipt). Counts only, like pins:
219
+ // readable while text recovery waits.
220
+ executionCounts(space, from, to) {
221
+ return this.db.prepare(`SELECT COUNT(DISTINCT CASE WHEN e.status='applied' THEN e.decision END) AS applied,
222
+ COUNT(DISTINCT CASE WHEN e.status='undone' THEN e.decision END) AS undone
223
+ FROM judgment_execution e JOIN judgment_records r ON r.id = e.decision
224
+ WHERE r.space=? AND e.status IN ('applied','undone') AND e.created_at >= ? AND e.created_at < ?`).get(space, from, to);
225
+ }
217
226
  // relay: the FLA that relayed the person's vote and their words (rec#80), or null.
218
227
  feedback(space, id, vote, reason, expectedRevision, relay = null) {
219
228
  return this.transaction(() => {