fuli-context 0.27.0 → 0.27.1

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 (354) hide show
  1. package/dist/web/assets/{AboutPage-Bp2Edkdg.js → AboutPage-BKyNoI0v.js} +1 -1
  2. package/dist/web/assets/{AboutSectionHeading-DFfY2f_Z.js → AboutSectionHeading-DwvCvoqO.js} +1 -1
  3. package/dist/web/assets/AgentAppsPage-Cp2-sZXi.js +1 -0
  4. package/dist/web/assets/{AgentAvatar-w-2A3nsJ.js → AgentAvatar-CDhU4m0T.js} +1 -1
  5. package/dist/web/assets/{AgentHand-BGGU49Jt.js → AgentHand-BfRjs1He.js} +1 -1
  6. package/dist/web/assets/{AgentManagement-MMGrwdD2.js → AgentManagement-qCpr876m.js} +1 -1
  7. package/dist/web/assets/{AgentMentionCopy-BAHZjubz.js → AgentMentionCopy-_pr-D8vX.js} +1 -1
  8. package/dist/web/assets/{AgentName-CXlsC-4o.js → AgentName-CUuWNrzE.js} +1 -1
  9. package/dist/web/assets/AgentProfilePage-DcOBhuHG.js +5 -0
  10. package/dist/web/assets/AgentServicesPage-CAL-JT1J.js +1 -0
  11. package/dist/web/assets/{AppViewerPage-6gWP6nAf.js → AppViewerPage-Ct46NPXP.js} +1 -1
  12. package/dist/web/assets/{BackToTop-Cs5_rV99.js → BackToTop-DOlt-xjQ.js} +1 -1
  13. package/dist/web/assets/{BoardCardFieldsMenu-CvFrsIgy.js → BoardCardFieldsMenu-RFcx_CAs.js} +1 -1
  14. package/dist/web/assets/{BoardMoveMenu-B5isxIcK.js → BoardMoveMenu-GJ8lpuZY.js} +1 -1
  15. package/dist/web/assets/Breadcrumb-DTo6Zvtb.js +1 -0
  16. package/dist/web/assets/{CaptureChangePage-Ca72_PHc.js → CaptureChangePage-DRgWyCRo.js} +1 -1
  17. package/dist/web/assets/{CopyFixPrompt-wGATZKOq.js → CopyFixPrompt-1UXH_ItZ.js} +1 -1
  18. package/dist/web/assets/DataFormatPage-CgFXfOW_.js +2 -0
  19. package/dist/web/assets/DebugTurnPage-B8YhpTPm.js +1 -0
  20. package/dist/web/assets/DebugTurnsPage-BGKSH3n0.js +1 -0
  21. package/dist/web/assets/{DialogTitle-HYzAHbGg.js → DialogTitle-CIVSlKqQ.js} +1 -1
  22. package/dist/web/assets/{EmployeeRedirectPage-C2SHpAEF.js → EmployeeRedirectPage-8qPpnbyP.js} +1 -1
  23. package/dist/web/assets/EmployeeScopeDialog-BZymZidB.js +1 -0
  24. package/dist/web/assets/{EmployeeWorkbench-CbRJhkJO.js → EmployeeWorkbench-BnxEZCSS.js} +1 -1
  25. package/dist/web/assets/FieldRoot-D6HtUgDA.js +1 -0
  26. package/dist/web/assets/{FlaGrowth-DGnUPN7D.js → FlaGrowth-CaFdmezv.js} +1 -1
  27. package/dist/web/assets/{FlaOccupationKit-DAJjSrmL.js → FlaOccupationKit-CFoBUWGF.js} +1 -1
  28. package/dist/web/assets/{FlaTaskSheets-DRLgfrVC.js → FlaTaskSheets-BShmW9R5.js} +1 -1
  29. package/dist/web/assets/FlasPage-DtkW-_9f.js +1 -0
  30. package/dist/web/assets/{GrowthLoading-NLj2W4jj.js → GrowthLoading-CVBn4r4q.js} +1 -1
  31. package/dist/web/assets/{HowtoPage-CkGRrKpf.js → HowtoPage-B8f5J_An.js} +1 -1
  32. package/dist/web/assets/InboxPage-D9VIDrsL.js +6 -0
  33. package/dist/web/assets/{KnowledgeDeleteButton-DaT-gTmm.js → KnowledgeDeleteButton-C01O4FSO.js} +1 -1
  34. package/dist/web/assets/{KnowledgeHardDeleteSection-C9d7DVLa.js → KnowledgeHardDeleteSection-jqad3dJN.js} +1 -1
  35. package/dist/web/assets/KnowledgeItemEditPage-DV8TVpvf.js +1 -0
  36. package/dist/web/assets/{KnowledgeItemSummaryCard-eLzjKvgN.js → KnowledgeItemSummaryCard-XbkYp7Dy.js} +1 -1
  37. package/dist/web/assets/KnowledgeOrganizerPage-C4G6JCmG.js +1 -0
  38. package/dist/web/assets/KnowledgePage-Afiw2Kxy.js +1 -0
  39. package/dist/web/assets/KnowledgePeek-DIcPS9WU.js +1 -0
  40. package/dist/web/assets/{KnowledgeTurnReceiptPage-Dne5NQ9q.js → KnowledgeTurnReceiptPage-7ncXkxKd.js} +1 -1
  41. package/dist/web/assets/{KnowledgeWorkspace-DDg3tUb3.css → KnowledgeWorkspace-Be2gUul5.css} +1 -1
  42. package/dist/web/assets/KnowledgeWorkspace-CmzU6Vuh.js +4 -0
  43. package/dist/web/assets/{MeAvatar-f6qxg9dN.js → MeAvatar-D_LFqHrR.js} +1 -1
  44. package/dist/web/assets/{MeLink-DTvFYaYE.js → MeLink-CeIxjFrm.js} +1 -1
  45. package/dist/web/assets/{MenuSeparator-CLmsZ9rj.js → MenuSeparator-yD3wld9s.js} +1 -1
  46. package/dist/web/assets/{ModelSettingsPage-B38R-kBZ.css → ModelSettingsPage-BZcyT7Vy.css} +1 -1
  47. package/dist/web/assets/ModelSettingsPage-BqClsFmC.js +1 -0
  48. package/dist/web/assets/{NewSessionPanel-9yINjwyx.js → NewSessionPanel-BKrOFEMO.js} +1 -1
  49. package/dist/web/assets/{NotFoundPage-CqevPz0_.js → NotFoundPage-CdOCRj3P.js} +1 -1
  50. package/dist/web/assets/{NoticeRow-D5MWTeBY.js → NoticeRow-CQShZQtw.js} +1 -1
  51. package/dist/web/assets/OccupationsPage-BrBus-nh.js +1 -0
  52. package/dist/web/assets/OverviewPage-Cq89Klha.js +1 -0
  53. package/dist/web/assets/{PageColumns-Df60nEzj.js → PageColumns-CgIXTt4J.js} +1 -1
  54. package/dist/web/assets/{PageOutline-HHUlu2x3.js → PageOutline-VtLLW4kh.js} +1 -1
  55. package/dist/web/assets/{PersonalProfilePage-DnjNX2xK.css → PersonalProfilePage-BE5q2bqc.css} +1 -1
  56. package/dist/web/assets/PersonalProfilePage-C_dmUEuW.js +1 -0
  57. package/dist/web/assets/PersonalProjectsPage-CiCFHVt_.js +1 -0
  58. package/dist/web/assets/{PinIcon-DP-9Iisk.js → PinIcon-DD3Un-hh.js} +1 -1
  59. package/dist/web/assets/{PopperContent-DWCMeKSL.js → PopperContent-CCmt2yHl.js} +1 -1
  60. package/dist/web/assets/{Presence-Ba3jqPYx.js → Presence-DqPb-1P1.js} +1 -1
  61. package/dist/web/assets/{ProfileAuthorChip-BKZJC_N2.js → ProfileAuthorChip-Dm5GjcAt.js} +1 -1
  62. package/dist/web/assets/ProjectAgentsPage-B5r0DKWL.js +5 -0
  63. package/dist/web/assets/{ProjectJudgmentPolicy-BJ5sVuFI.js → ProjectJudgmentPolicy-DVFV5Cai.js} +1 -1
  64. package/dist/web/assets/{RecentNotices-CDHGIky1.js → RecentNotices-DYXEBfYm.js} +1 -1
  65. package/dist/web/assets/{RoundtablesPage-D5Xc3yun.js → RoundtablesPage-DlAXApKi.js} +1 -1
  66. package/dist/web/assets/{RovingFocusGroup-DoGybG5V.js → RovingFocusGroup-CI4aZr1z.js} +1 -1
  67. package/dist/web/assets/{RovingFocusItem-B455TzUI.js → RovingFocusItem-C_N843Nb.js} +1 -1
  68. package/dist/web/assets/{SessionMigrationPage-BAzXqxxO.js → SessionMigrationPage-CVKkTACn.js} +1 -1
  69. package/dist/web/assets/{SessionRecordsPage-C6U5YGSt.js → SessionRecordsPage-Dy203sP2.js} +1 -1
  70. package/dist/web/assets/SettingsPage-BcrAdXX7.js +1 -0
  71. package/dist/web/assets/SettingsPage-BlhCcwPn.css +1 -0
  72. package/dist/web/assets/SharedJefaReportPage-CASkC5pc.js +1 -0
  73. package/dist/web/assets/{TagVocabularyPage-Brpr-Q-y.js → TagVocabularyPage-Bd57YcUL.js} +1 -1
  74. package/dist/web/assets/TaskBlockerClear-DGaXP2ak.js +1 -0
  75. package/dist/web/assets/{TaskBlockerNotice-POmS2neR.js → TaskBlockerNotice-8nogmPA-.js} +1 -1
  76. package/dist/web/assets/{TaskReason-RKKs4Kb5.js → TaskReason-BxYwBDoB.js} +1 -1
  77. package/dist/web/assets/{TeamCard-8hjo1h0x.js → TeamCard-cWYC5z07.js} +1 -1
  78. package/dist/web/assets/{TeamCardsWidget-DIHFUDrF.js → TeamCardsWidget-BOf6oHOp.js} +1 -1
  79. package/dist/web/assets/{TeamIsland-DdhEcVOZ.js → TeamIsland-BD5s-zFZ.js} +1 -1
  80. package/dist/web/assets/{Teleport-CukHuRhz.js → Teleport-DhMmMHjy.js} +1 -1
  81. package/dist/web/assets/{TextField-G2fJ4aFQ.js → TextField-XakqTnVl.js} +1 -1
  82. package/dist/web/assets/TonborgDelegationSwitch-B59PUZBz.js +1 -0
  83. package/dist/web/assets/TonborgDelegationSwitch-BFb1JkWe.css +1 -0
  84. package/dist/web/assets/{UiChip-BHEJVA6L.js → UiChip-BFdfq8Jm.js} +1 -1
  85. package/dist/web/assets/{UiDisclosure-B1pd8qXW.js → UiDisclosure-G3MiGB7F.js} +1 -1
  86. package/dist/web/assets/{UiIcon-K7OhYTSy.js → UiIcon--qI1_q89.js} +1 -1
  87. package/dist/web/assets/UiSegmented-CRJ06vHP.js +1 -0
  88. package/dist/web/assets/{UiWeight-eAw682rH.js → UiWeight-BRA-6EY_.js} +1 -1
  89. package/dist/web/assets/{VirtualDirectoryList-BGum1GZc.js → VirtualDirectoryList-Dm07NMxq.js} +1 -1
  90. package/dist/web/assets/{VisuallyHidden-Ck6D7rq-.js → VisuallyHidden-DIg8c_z2.js} +1 -1
  91. package/dist/web/assets/{VisuallyHiddenInput-DXWhIUlB.js → VisuallyHiddenInput-rcWqHewS.js} +1 -1
  92. package/dist/web/assets/WidgetSlot-C5h--noP.js +2 -0
  93. package/dist/web/assets/{WorkbenchListHead-CR_fDYYr.js → WorkbenchListHead-D40-J4GT.js} +1 -1
  94. package/dist/web/assets/WorkbenchListPage-CJUvq4Ac.js +1 -0
  95. package/dist/web/assets/_plugin-vue_export-helper-D9CtLGVz.js +9 -0
  96. package/dist/web/assets/{agent-apps-D0eG1aMx.js → agent-apps-Svxh5tiY.js} +1 -1
  97. package/dist/web/assets/agent-occupation-Dhoz7LjT.js +1 -0
  98. package/dist/web/assets/{agent-pins-OYjJQ38F.js → agent-pins-CvATgFji.js} +1 -1
  99. package/dist/web/assets/{agent-workflows-D3VeY6Yz.js → agent-workflows-BS4KlKFj.js} +1 -1
  100. package/dist/web/assets/{attach-closest-edge-C75rKXiz.js → attach-closest-edge-DFoBNGBU.js} +1 -1
  101. package/dist/web/assets/{attention-store-k4mPCefZ.js → attention-store-CHxXJTuF.js} +1 -1
  102. package/dist/web/assets/{badge-B2rll-68.js → badge-DqHf-RNw.js} +1 -1
  103. package/dist/web/assets/{button-q6JhonlL.js → button-CdYobu4m.js} +1 -1
  104. package/dist/web/assets/{card-CPQiMHSu.js → card-8xZot-73.js} +1 -1
  105. package/dist/web/assets/{catalog-CBPcEkXC.js → catalog-h6KbvKdB.js} +1 -1
  106. package/dist/web/assets/{checkbox-C67upxzl.js → checkbox-DZ6CDZ8r.js} +1 -1
  107. package/dist/web/assets/{client-KFFphxpK.js → client-DRnUmjCk.js} +1 -1
  108. package/dist/web/assets/{client-links-store-Cw9c8MWc.js → client-links-store-DQY0A5PC.js} +1 -1
  109. package/dist/web/assets/{combobox-yHRJ-zN-.js → combobox-DE0HzdKP.js} +1 -1
  110. package/dist/web/assets/{console-BCR2S3AF.js → console-BF8ZU9dG.js} +1 -1
  111. package/dist/web/assets/{conversation-launcher-settings-28CqC1Gn.js → conversation-launcher-settings-D4vYOpHN.js} +1 -1
  112. package/dist/web/assets/{copy-mention-C4Nos381.js → copy-mention-Crs0NIJB.js} +1 -1
  113. package/dist/web/assets/{dialog-Cjoy4nsv.js → dialog-Bg5NVU4Y.js} +1 -1
  114. package/dist/web/assets/{dist-CaVgk2QB.js → dist--2DWcoU9.js} +1 -1
  115. package/dist/web/assets/{dist-D73EXNtz.js → dist-INkzWhVF.js} +1 -1
  116. package/dist/web/assets/{dropdown-menu-Dto6hjoc.js → dropdown-menu-C5Kf9x2y.js} +1 -1
  117. package/dist/web/assets/{field-BaUOZtN5.js → field-7G2bSNl5.js} +1 -1
  118. package/dist/web/assets/{format-bytes-D5eCtdg1.js → format-bytes-Jj3-0UhP.js} +1 -1
  119. package/dist/web/assets/{hover-card-Bg0dulGq.js → hover-card-llxR7wrX.js} +1 -1
  120. package/dist/web/assets/index-C2o_v2mq.js +24 -0
  121. package/dist/web/assets/{input-Dxh25T4M.js → input-z5o2wIZC.js} +1 -1
  122. package/dist/web/assets/{label-CbrduZla.js → label-BtTrlS8e.js} +1 -1
  123. package/dist/web/assets/label-table-CuTFbFd3.js +1 -0
  124. package/dist/web/assets/{model-CWMP5GOL.js → model-BD6AfoOR.js} +1 -1
  125. package/dist/web/assets/{model-ZwOxwk2m.js → model-BKg9fdsn.js} +1 -1
  126. package/dist/web/assets/{model-Blk5Wgg2.js → model-BMd98Yux.js} +1 -1
  127. package/dist/web/assets/{model-DcsCYhXk.js → model-Bb0VtRJH.js} +1 -1
  128. package/dist/web/assets/{model--lR9icA_.js → model-Bhyqm3my.js} +1 -1
  129. package/dist/web/assets/{model-jC3F-J2F.js → model-CCaA3vRN.js} +1 -1
  130. package/dist/web/assets/{model-D4DkvMH-.js → model-CGfhtR6w.js} +1 -1
  131. package/dist/web/assets/{model-Bgh75q3j.js → model-Ejc2vysd.js} +1 -1
  132. package/dist/web/assets/{motion-_MepnmMC.js → motion-Cw_hptY4.js} +1 -1
  133. package/dist/web/assets/{motion-BL3lek9c.js → motion-pePEUhOt.js} +1 -1
  134. package/dist/web/assets/{motion-preference-D3UMHojT.js → motion-preference-DTwjqiJ8.js} +1 -1
  135. package/dist/web/assets/{occupation-catalog-BeJ2O9nm.js → occupation-catalog-ByjQk0EY.js} +1 -1
  136. package/dist/web/assets/{occupation-kits-Bkiu6MzD.js → occupation-kits-Dg6UZqc1.js} +1 -1
  137. package/dist/web/assets/{option-Crs2MA88.js → option-BIjYeAh2.js} +1 -1
  138. package/dist/web/assets/{page-refresh-Bz5r7A_Q.js → page-refresh-BTqRX45n.js} +1 -1
  139. package/dist/web/assets/{page-title-KYZApNys.js → page-title-B5RyNTPD.js} +1 -1
  140. package/dist/web/assets/{person-profile-mhLxWtq7.js → person-profile-BzPwdtix.js} +1 -1
  141. package/dist/web/assets/{popover-CMahoDLo.js → popover-BsWyCEy5.js} +1 -1
  142. package/dist/web/assets/popup-host-DWJ1gygp.js +1 -0
  143. package/dist/web/assets/{profile-model-DWutKuCZ.js → profile-model-TAsyybji.js} +1 -1
  144. package/dist/web/assets/{project-board-layout-CWMHQuUA.js → project-board-layout-BwyHItDc.js} +1 -1
  145. package/dist/web/assets/{project-capture-CebFSnn0.js → project-capture-I8-7JwsK.js} +1 -1
  146. package/dist/web/assets/{project-origin-BnUVE0be.js → project-origin-B_Ku288r.js} +1 -1
  147. package/dist/web/assets/{quick-edit-api-YwzoODMc.js → quick-edit-api-Cm-W3ZVP.js} +1 -1
  148. package/dist/web/assets/{radio-group-vRt8y8mF.js → radio-group-DJ5np5d_.js} +1 -1
  149. package/dist/web/assets/review-api-Gwr5nP1B.js +1 -0
  150. package/dist/web/assets/{review-list-_PN7ljSY.js → review-list-CNeXKjBw.js} +1 -1
  151. package/dist/web/assets/{review-store-CobX9No6.js → review-store-BaMwO51r.js} +1 -1
  152. package/dist/web/assets/{role-names-wD9l8uz5.js → role-names-C-F0XIE1.js} +1 -1
  153. package/dist/web/assets/{roundtable-live-Dm4Vwo75.js → roundtable-live-CM4Cqw2v.js} +1 -1
  154. package/dist/web/assets/{runtime-dom.esm-bundler-DzfwnSj8.js → runtime-dom.esm-bundler-tA5o2TEo.js} +1 -1
  155. package/dist/web/assets/{select-B9mVptgx.js → select-DJ7iyJ-X.js} +1 -1
  156. package/dist/web/assets/{session-launch-offers-C9UkoKUJ.js → session-launch-offers-CEdCRTz9.js} +1 -1
  157. package/dist/web/assets/{settings-autosave-L0zSXnBO.js → settings-autosave-D3wBf_zN.js} +1 -1
  158. package/dist/web/assets/settings-tabs-B9pCaEFP.js +1 -0
  159. package/dist/web/assets/shared-report-KyuP8oQk.js +3 -0
  160. package/dist/web/assets/{source-adapters-r-NIqO77.js → source-adapters-BR-AAGhD.js} +1 -1
  161. package/dist/web/assets/{switch-BCzrGc4W.js → switch-BoOtTu6O.js} +1 -1
  162. package/dist/web/assets/{tabs-CB38D8N0.js → tabs-D0TAS18R.js} +1 -1
  163. package/dist/web/assets/{task-card-fields-B1z1PmTT.js → task-card-fields-BWlLtcKE.js} +1 -1
  164. package/dist/web/assets/{task-labels-DTc5OuFF.js → task-labels-BrNKooHK.js} +1 -1
  165. package/dist/web/assets/{task-reason-CneTZWRv.js → task-reason-CvmaNQWE.js} +1 -1
  166. package/dist/web/assets/{team-sheets-CUt3Vp2s.js → team-sheets-DkAuebg6.js} +1 -1
  167. package/dist/web/assets/{textarea-DJ0ucCir.js → textarea-BQnuJ0v3.js} +1 -1
  168. package/dist/web/assets/ui-CJiEsCpv.js +1 -0
  169. package/dist/web/assets/ui-CgwSWg1F.css +1 -0
  170. package/dist/web/assets/{useAgentRecords-CwkwZy8H.js → useAgentRecords-PysQYF4V.js} +1 -1
  171. package/dist/web/assets/{useAgentWorkSummary-DoiCqME7.js → useAgentWorkSummary-DaNyOo2z.js} +1 -1
  172. package/dist/web/assets/{useApi-CROJJdhE-CenjhnR5.js → useApi-CROJJdhE-CgPyy2pi.js} +1 -1
  173. package/dist/web/assets/{useClipboardCopy-Ba86PzjA.js → useClipboardCopy-Cf3GZrHC.js} +1 -1
  174. package/dist/web/assets/{useFocusReturn-B0ErBkt_.js → useFocusReturn-uY18_eDg.js} +1 -1
  175. package/dist/web/assets/{useForwardExpose-DJ6fcpI2.js → useForwardExpose-Ci_aBJDg.js} +1 -1
  176. package/dist/web/assets/{useForwardPropsEmits-D1vvIUcB.js → useForwardPropsEmits-mGaDeNMp.js} +1 -1
  177. package/dist/web/assets/useForwardScopeId-DYW8CZTp.js +1 -0
  178. package/dist/web/assets/{useKnowledgeConfirm-781LUhoU.js → useKnowledgeConfirm-PcqqgwNU.js} +1 -1
  179. package/dist/web/assets/{useKnowledgeItemPeek-CnuCvJKQ.js → useKnowledgeItemPeek-yjyrSFtf.js} +1 -1
  180. package/dist/web/assets/{useMinimumLoadingDisplay-DCC9EfQ9.js → useMinimumLoadingDisplay-Bu6xyHby.js} +1 -1
  181. package/dist/web/assets/{usePageTools-BaB021q0.js → usePageTools-DYi9x7HJ.js} +1 -1
  182. package/dist/web/assets/usePrimitiveElement-DdC34jzt.js +1 -0
  183. package/dist/web/assets/{useProjectAgentRoster-M3wbWpS-.js → useProjectAgentRoster-KPwWl2jE.js} +1 -1
  184. package/dist/web/assets/{useRoutePeek-CYg5JyYt.js → useRoutePeek-BiHDBRKc.js} +1 -1
  185. package/dist/web/assets/useTeamPeople-Od3dDz6d.js +1 -0
  186. package/dist/web/assets/{useTeamWork-Dql3_qLV.js → useTeamWork-CDKVZwYe.js} +1 -1
  187. package/dist/web/assets/{useTypeahead-DYb5kVkH.js → useTypeahead-D_Z5P9Xm.js} +1 -1
  188. package/dist/web/assets/{utils-Cli0RsEd.js → utils-CAAvfQSj.js} +1 -1
  189. package/dist/web/assets/{utils-B7sUn8rD.js → utils-D6RjkXrh.js} +1 -1
  190. package/dist/web/assets/{verification-DY7kllTI.js → verification-DoN2EFaZ.js} +1 -1
  191. package/dist/web/assets/{version-CBgUEmnM.js → version-DbJq2Cfv.js} +1 -1
  192. package/dist/web/assets/{vue-router-ab7kABlJ.js → vue-router-BwoPnYha.js} +1 -1
  193. package/dist/web/index.html +74 -77
  194. package/docs/agent-roundtable.md +45 -3
  195. package/docs/judgment-and-autonomy.md +2 -0
  196. package/graph-provider/fuli_graph/app.py +2 -0
  197. package/graph-provider/fuli_graph/knowledge_duplicates.py +27 -14
  198. package/graph-provider/fuli_graph/knowledge_search.py +31 -32
  199. package/graph-provider/fuli_graph/knowledge_semantic.py +38 -11
  200. package/graph-provider/fuli_graph/models.py +15 -0
  201. package/graph-provider/fuli_graph/preference_organizing.py +162 -0
  202. package/graph-provider/fuli_graph/project_agent_routes.py +22 -0
  203. package/graph-provider/fuli_graph/project_agent_task_models.py +26 -2
  204. package/graph-provider/fuli_graph/store_project_agent_task_activity.py +51 -11
  205. package/graph-provider/fuli_graph/store_project_agent_task_blockers.py +13 -6
  206. package/graph-provider/fuli_graph/store_project_agent_task_person_close.py +82 -0
  207. package/graph-provider/fuli_graph/store_project_agent_tasks.py +18 -1
  208. package/graph-provider/fuli_graph/task_blocker.py +10 -0
  209. package/graph-provider/pyproject.toml +1 -1
  210. package/native/win32/fuli-win-helper.exe +0 -0
  211. package/npm-shrinkwrap.json +57 -9
  212. package/package.json +4 -3
  213. package/packages/roundtable/package.json +1 -0
  214. package/packages/roundtable/src/agents/claude-code/wake.js +4 -2
  215. package/packages/roundtable/src/agents/codex/wake.js +1 -0
  216. package/packages/roundtable/src/host.js +4 -1
  217. package/packages/roundtable/src/peer/control-cli.js +75 -2
  218. package/packages/roundtable/src/peer/control.js +15 -1
  219. package/packages/roundtable/src/peer/coordinator-http.js +23 -2
  220. package/packages/roundtable/src/peer/coordinator-service.js +81 -9
  221. package/packages/roundtable/src/peer/coordinator-store.js +2 -1
  222. package/packages/roundtable/src/peer/lan-addresses.js +28 -0
  223. package/packages/roundtable/src/peer/nearby-attempts.js +73 -0
  224. package/packages/roundtable/src/peer/nearby-discovery.js +71 -0
  225. package/packages/roundtable/src/peer/nearby-pairing.js +422 -0
  226. package/packages/roundtable/src/peer/nearby-presence.js +93 -0
  227. package/packages/roundtable/src/peer/node-store.js +10 -0
  228. package/packages/roundtable/src/peer/peer-runtime.js +528 -70
  229. package/packages/roundtable/src/peer/peer-transport.js +58 -3
  230. package/packages/roundtable/src/peer/protocol.js +24 -1
  231. package/packages/roundtable/src/roundtable/chat-service.js +14 -3
  232. package/packages/roundtable/src/roundtable/chat.js +1 -0
  233. package/packages/roundtable/src/roundtable/delivery-state.js +2 -1
  234. package/packages/roundtable/src/roundtable/group-discussion-store.js +130 -5
  235. package/packages/roundtable/src/roundtable/group-discussion.js +596 -111
  236. package/packages/roundtable/src/roundtable/service.js +10 -2
  237. package/packages/roundtable/src/roundtable/store.js +11 -1
  238. package/packages/roundtable/src/roundtable/wake.js +3 -1
  239. package/packages/roundtable/src/standalone/cli.js +1 -1
  240. package/skills/capturing-session-knowledge/SKILL.md +1 -1
  241. package/skills/capturing-session-knowledge/references/coordination.md +28 -4
  242. package/skills/grilling-project/references/project-profile.md +13 -5
  243. package/skills/operating-fuli/SKILL.md +22 -5
  244. package/skills/operating-fuli/references/workflow-recipes.md +5 -2
  245. package/src/agent-delegation/port.js +1 -1
  246. package/src/agent-delegation/refusals.js +12 -4
  247. package/src/agent-roundtable/task-context.js +1 -1
  248. package/src/agent-roundtable/tools.js +5 -2
  249. package/src/agent-tools/graph-handlers.js +4 -3
  250. package/src/agent-tools/interface-catalog.js +10 -1
  251. package/src/agent-tools/interface-definitions.js +3 -2
  252. package/src/agent-tools/project-agent-definitions.js +2 -1
  253. package/src/agent-tools/project-organizing-definitions.js +7 -4
  254. package/src/agent-tools/project-space-definitions.js +2 -0
  255. package/src/agent-tools/session-fuli-gate.js +6 -1
  256. package/src/agents/codex/lifecycle-hook.js +3 -1
  257. package/src/agents/identity-receipt.js +3 -1
  258. package/src/agents/native-session-env.js +7 -0
  259. package/src/conversations/entry-budget.js +3 -2
  260. package/src/conversations/entry-inline-budget.js +40 -10
  261. package/src/conversations/preference-lifecycle.js +3 -3
  262. package/src/conversations/turn-findings.js +9 -2
  263. package/src/graphiti/agent-project-resolution.js +18 -0
  264. package/src/graphiti/collaboration-preference-entry.js +5 -2
  265. package/src/graphiti/current-project-knowledge-search.js +3 -3
  266. package/src/graphiti/fla-mention.js +48 -9
  267. package/src/graphiti/project-agent-task-summaries.js +82 -0
  268. package/src/graphiti/project-agent-workflows.js +8 -5
  269. package/src/graphiti/project-path-context.js +23 -9
  270. package/src/graphiti/provider-client.js +15 -1
  271. package/src/graphiti/repository-remote.js +34 -8
  272. package/src/graphiti/roundtable-host.js +9 -1
  273. package/src/graphiti/task-context-entry.js +4 -1
  274. package/src/graphiti/task-entry-group-discussion.js +111 -25
  275. package/src/graphiti/task-entry-owner-change.js +22 -2
  276. package/src/graphiti/task-entry-preferences.js +9 -4
  277. package/src/graphiti/task-entry-project-scope.js +19 -0
  278. package/src/graphiti/task-preference-pages.js +3 -3
  279. package/src/graphiti/task-preference-reader.js +44 -9
  280. package/src/graphiti/worker-task-context.js +1 -1
  281. package/src/http/api-router.js +3 -0
  282. package/src/http/task-blocker-api-router.js +11 -1
  283. package/src/http/task-close-api-router.js +59 -0
  284. package/src/judgment/engine.js +6 -1
  285. package/src/judgment/http.js +2 -2
  286. package/src/judgment/review-delegation.js +16 -4
  287. package/src/judgment/review-egress.js +25 -0
  288. package/src/judgment/service.js +1 -1
  289. package/src/mcp/create-mcp-server.js +2 -2
  290. package/src/mcp/direct-call.js +3 -2
  291. package/src/mcp/preference-delivery.js +64 -6
  292. package/src/mcp/session-id.js +12 -4
  293. package/src/mcp/tool-result.js +8 -6
  294. package/src/model-backends/config.js +7 -0
  295. package/src/model-backends/egress.js +8 -0
  296. package/src/model-backends/failures.js +8 -0
  297. package/src/model-backends/port.js +39 -16
  298. package/src/model-backends/role-trust.js +3 -9
  299. package/src/model-backends/usage-ledger.js +20 -9
  300. package/src/presence/windows-helper-pin.js +1 -1
  301. package/src/project-organizing/agent-tool.js +34 -7
  302. package/src/server.js +7 -0
  303. package/src/task-blockers/agent-resume.js +73 -0
  304. package/src/task-blockers/console-port.js +5 -2
  305. package/src/task-blockers/resume-status.js +2 -0
  306. package/src/task-closing/console-port.js +26 -0
  307. package/src/whats-new/lines/0.27.1.json +13 -0
  308. package/dist/web/assets/AgentAppsPage-CjyvPZSs.js +0 -1
  309. package/dist/web/assets/AgentProfilePage-eDKbJJwY.js +0 -5
  310. package/dist/web/assets/AgentServicesPage-CZwsN5U2.js +0 -1
  311. package/dist/web/assets/Breadcrumb-BXTA4e-W.js +0 -1
  312. package/dist/web/assets/DataFormatPage-CQKkFhcH.js +0 -2
  313. package/dist/web/assets/DebugTurnPage-CUqbuhgX.js +0 -1
  314. package/dist/web/assets/DebugTurnsPage-HwaTG8Fa.js +0 -1
  315. package/dist/web/assets/EmployeeScopeDialog-yUCgujKT.js +0 -1
  316. package/dist/web/assets/FieldRoot-BLcsuPMA.js +0 -1
  317. package/dist/web/assets/FlasPage-CMv2awKJ.js +0 -1
  318. package/dist/web/assets/InboxPage-DfQvtnyq.js +0 -6
  319. package/dist/web/assets/KnowledgeItemEditPage-BUKQK37o.js +0 -1
  320. package/dist/web/assets/KnowledgeOrganizerPage-CiZ9JlNX.js +0 -1
  321. package/dist/web/assets/KnowledgePage-C3_Cvz4g.js +0 -1
  322. package/dist/web/assets/KnowledgePeek-DtOOiARX.js +0 -1
  323. package/dist/web/assets/KnowledgeWorkspace-Cq_XYcma.js +0 -4
  324. package/dist/web/assets/ModelSettingsPage-COVaW4eh.js +0 -1
  325. package/dist/web/assets/OccupationsPage-BKd051j1.js +0 -1
  326. package/dist/web/assets/OverviewPage-C90G_adj.js +0 -1
  327. package/dist/web/assets/PersonalProfilePage-DIDgG3NH.js +0 -1
  328. package/dist/web/assets/PersonalProjectsPage-DwhlEpNg.js +0 -1
  329. package/dist/web/assets/ProjectAgentsPage-BefVF9ZP.js +0 -5
  330. package/dist/web/assets/SettingsPage-7mNL3bwe.js +0 -1
  331. package/dist/web/assets/SettingsPage-Cku8SoLk.css +0 -1
  332. package/dist/web/assets/SharedJefaReportPage-rH6I4cI9.js +0 -1
  333. package/dist/web/assets/TaskBlockerClear-BHOMZYwm.js +0 -1
  334. package/dist/web/assets/TonborgDelegationSwitch-BA3Qb8Wr.js +0 -1
  335. package/dist/web/assets/TonborgDelegationSwitch-DeqERWoo.css +0 -1
  336. package/dist/web/assets/UiDialog-bUwGQz96.js +0 -1
  337. package/dist/web/assets/UiIconButton-D3R6WwwI.css +0 -1
  338. package/dist/web/assets/UiIconButton-DlLZ5_Yc.js +0 -1
  339. package/dist/web/assets/UiSegmented-CYrTxDn1.js +0 -1
  340. package/dist/web/assets/WidgetSlot-D6vCSWaz.js +0 -2
  341. package/dist/web/assets/WorkbenchListPage-Zr5PW-cf.js +0 -1
  342. package/dist/web/assets/_plugin-vue_export-helper-BRS32yXs.js +0 -9
  343. package/dist/web/assets/agent-occupation-CEd3bAhb.js +0 -1
  344. package/dist/web/assets/index-B-aRUs9w.js +0 -24
  345. package/dist/web/assets/label-table-_YAtPkRI.js +0 -1
  346. package/dist/web/assets/popup-host-DKN99Od3.js +0 -1
  347. package/dist/web/assets/review-api-WhNB3ppo.js +0 -1
  348. package/dist/web/assets/settings-tabs-DTbgqX8g.js +0 -1
  349. package/dist/web/assets/shared-report-0FO_y0sa.js +0 -3
  350. package/dist/web/assets/ui-D4nAhcmu.css +0 -1
  351. package/dist/web/assets/ui-M_UKzb_A.js +0 -1
  352. package/dist/web/assets/useForwardScopeId-CoSQtoUU.js +0 -1
  353. package/dist/web/assets/usePrimitiveElement-iRKqOVuY.js +0 -1
  354. package/dist/web/assets/useTeamPeople-CPC62La3.js +0 -1
@@ -5,7 +5,7 @@ import { isAuthorityKey } from './origin-proof.js';
5
5
  import { createCoordinatorChat } from './chat-coordinator.js';
6
6
  import {
7
7
  canonicalJson, encodeInvitation, PEER_LIMITS, PeerError, peerCleanup, pemToDer, publicDirectoryEntry,
8
- RESULT_OUTCOMES, sha256Hex, TERMINAL_STATUSES, validateAssertion,
8
+ graphemePrefix, RESULT_OUTCOMES, sha256Hex, TERMINAL_STATUSES, validateAssertion, withoutControls,
9
9
  } from './protocol.js';
10
10
 
11
11
  const ONLINE_MS = 90_000;
@@ -19,13 +19,23 @@ const ONLINE_MS = 90_000;
19
19
  const LAST_SEEN_WRITE_MS = 15_000;
20
20
  const PAIRING_FAILURE_WINDOW_MS = 10 * 60_000;
21
21
  const PAIRING_FAILURE_LIMIT = 10;
22
+ const REPOSITORY_DIGEST = /^[0-9a-f]{32}$/;
23
+ // A paired device could publish guessed addresses to learn what others have:
24
+ // at most this many digests per device, and its set may change this often a day.
25
+ const REPOSITORY_LIMIT = 50;
26
+ const REPOSITORY_CHANGES_PER_DAY = 3;
27
+ const DAY_MS = 24 * 60 * 60_000;
22
28
 
23
29
  // Routes messages between paired devices. It never executes anything: each
24
30
  // receiving device re-checks its own shares and identity authority.
25
31
  export function createCoordinatorService({ store, identity, authority, name, clock = Date.now,
26
- randomCode = () => randomBytes(32).toString('base64url'), idFactory = randomUUID, onTrustChange = () => {} }) {
32
+ randomCode = () => randomBytes(32).toString('base64url'), idFactory = randomUUID, onTrustChange = () => {},
33
+ repositoryChanges = memoryRecord() }) {
27
34
  const iso = (offsetMs = 0) => new Date(clock() + offsetMs).toISOString();
28
35
  const pairingFailures = [];
36
+ const repositories = new Map();
37
+ let repositoryKey = null;
38
+ rotateRepositoryKey();
29
39
  if (!isAuthorityKey(authority)) throw new PeerError('authority_unavailable', 'The coordinator needs its local origin authority', 500);
30
40
  store.upsertNode({ id: identity.fingerprint, name, certPem: identity.certPem, authority, at: iso() });
31
41
  const chat = createCoordinatorChat({ store, identity, clock });
@@ -51,13 +61,28 @@ export function createCoordinatorService({ store, identity, authority, name, clo
51
61
  pairingFailures.push(now);
52
62
  throw new PeerError('invalid_pairing_code', 'This invitation is invalid, expired or already used', 403);
53
63
  }
64
+ return trustDevice({ fingerprint, certPem, name: deviceName, authority: deviceAuthority }, () => {
65
+ if (!store.useInvitation(codeHash, fingerprint, iso())) throw new PeerError('invalid_pairing_code', 'This invitation was already used', 403);
66
+ });
67
+ }
68
+
69
+ // Nearby pairing (nearby-pairing.js) writes the same trust record an
70
+ // invitation does, after the person on each computer confirmed the same code.
71
+ function trustNearbyDevice({ certPem, name: deviceName, authority: deviceAuthority }) {
72
+ const fingerprint = certificateFingerprint(certPem);
73
+ if (fingerprint === identity.fingerprint) throw new PeerError('invalid_pairing', 'A device cannot pair with itself', 400);
74
+ return trustDevice({ fingerprint, certPem, name: deviceName, authority: deviceAuthority });
75
+ }
76
+
77
+ function trustDevice({ fingerprint, certPem, name: deviceName, authority: deviceAuthority }, claimInvitation = () => {}) {
54
78
  if (!isAuthorityKey(deviceAuthority)) throw new PeerError('invalid_pairing', 'The device did not present its origin authority', 400);
55
79
  const label = cleanName(deviceName) || `FULI device ${fingerprint.slice(0, 8)}`;
56
80
  store.transaction(() => {
57
- if (!store.useInvitation(codeHash, fingerprint, iso())) throw new PeerError('invalid_pairing_code', 'This invitation was already used', 403);
81
+ claimInvitation();
58
82
  store.upsertNode({ id: fingerprint, name: label, certPem,
59
83
  authority: { keyId: deviceAuthority.keyId, publicKey: deviceAuthority.publicKey }, at: iso() });
60
84
  });
85
+ repositories.delete(fingerprint);
61
86
  onTrustChange();
62
87
  return { nodeId: fingerprint, coordinatorNodeId: identity.fingerprint, coordinatorName: name };
63
88
  }
@@ -70,22 +95,57 @@ export function createCoordinatorService({ store, identity, authority, name, clo
70
95
  return node;
71
96
  }
72
97
 
73
- function publishDirectory(nodeId, { agents }) {
98
+ function publishDirectory(nodeId, { agents, repositories: projectRepositories }) {
74
99
  if (!Array.isArray(agents) || agents.length > PEER_LIMITS.directoryAgents) throw new PeerError('invalid_directory', 'Invalid shared Agent list');
75
- const entries = agents.map(publicDirectoryEntry);
100
+ const entries = agents.map((agent, index) => {
101
+ try { return publicDirectoryEntry(agent); }
102
+ catch (error) { throw new PeerError(error.code, `${error.message} (entry ${index + 1})`, error.status); }
103
+ });
76
104
  store.setDirectory(nodeId, entries);
77
- return { published: entries.length };
105
+ // Each device's own repository addresses, keyed with a secret only the
106
+ // paired group gets (repositoryKey, from this answer). Like online state
107
+ // they are kept only in memory and published again within a minute; a
108
+ // digest made with an older key is dropped.
109
+ if (projectRepositories?.keyId === repositoryKey.id) acceptRepositories(nodeId, repositoryDigests(projectRepositories.digests));
110
+ return { published: entries.length, repositoryKey };
78
111
  }
79
112
 
113
+ // Another device's digests never leave the coordinator: each device learns
114
+ // only which of its own digests another paired device also has.
80
115
  function directory(nodeId) {
81
116
  const now = clock();
117
+ const mine = new Set(repositories.get(nodeId) ?? []);
82
118
  return { devices: store.nodes().filter((node) => node.status === 'active' && node.id !== nodeId).map((node) => ({
83
119
  nodeId: node.id, name: node.name,
84
120
  online: seenWithin(node, now, ONLINE_MS),
85
121
  agents: JSON.parse(node.directory_json),
122
+ sameRepositories: (repositories.get(node.id) ?? []).filter((digest) => mine.has(digest)),
86
123
  })) };
87
124
  }
88
125
 
126
+ // The same set again is free; a new set counts, and past the daily limit the earlier set stays.
127
+ // The count is kept in the host's store (repositoryChanges), so a restart
128
+ // does not reset it. The first set a device sends under a new key (after a
129
+ // restart or a revoke) is free, so a revoke never locks out the others.
130
+ function acceptRepositories(nodeId, digests) {
131
+ const current = repositories.get(nodeId);
132
+ if (current && current.length === digests.length && digests.every((digest) => current.includes(digest))) return;
133
+ const now = clock();
134
+ const all = repositoryChanges.read() ?? {};
135
+ const record = all[nodeId] ?? {};
136
+ const changes = (Array.isArray(record.at) ? record.at : []).filter((at) => Number.isFinite(at) && at > now - DAY_MS);
137
+ const firstUnderKey = record.keyId !== repositoryKey.id;
138
+ if (!firstUnderKey && changes.length >= REPOSITORY_CHANGES_PER_DAY) return;
139
+ repositoryChanges.write({ ...all, [nodeId]: { keyId: repositoryKey.id, at: firstUnderKey ? changes : [...changes, now] } });
140
+ repositories.set(nodeId, digests);
141
+ }
142
+
143
+ // A revoked device keeps the old key, so the group gets a new one.
144
+ function rotateRepositoryKey() {
145
+ repositoryKey = { id: randomUUID(), key: randomBytes(32).toString('base64url') };
146
+ repositories.clear();
147
+ }
148
+
89
149
  function submit(nodeId, { assertion, signature }) {
90
150
  validateAssertion(assertion, { now: clock() });
91
151
  if (assertion.from.node !== nodeId) throw new PeerError('sender_mismatch', 'The message sender is not this device', 403);
@@ -229,6 +289,7 @@ export function createCoordinatorService({ store, identity, authority, name, clo
229
289
  else store.updateMessage(message.id, { cancel_requested: 1 }, iso(), 'cancel_requested', 'device_revoked');
230
290
  }
231
291
  });
292
+ rotateRepositoryKey();
232
293
  onTrustChange();
233
294
  return { revoked: true };
234
295
  }
@@ -258,12 +319,12 @@ export function createCoordinatorService({ store, identity, authority, name, clo
258
319
  function devices() {
259
320
  const now = clock();
260
321
  return store.nodes().map((node) => ({ nodeId: node.id, name: node.name, status: node.status,
261
- self: node.id === identity.fingerprint, pairedAt: node.paired_at, revokedAt: node.revoked_at,
322
+ self: node.id === identity.fingerprint, pairedAt: node.paired_at, revokedAt: node.revoked_at, lastSeenAt: node.last_seen_at ?? null,
262
323
  online: node.id === identity.fingerprint || seenWithin(node, now, ONLINE_MS),
263
324
  sharedAgents: JSON.parse(node.directory_json).length }));
264
325
  }
265
326
 
266
- return { chat: chat.execute, chatOwner: chat.ownerRead, chatUpdates: chat.ownerUpdates, createInvitation, pair, authenticate, publishDirectory, directory, submit, claim, renew, result,
327
+ return { chat: chat.execute, chatOwner: chat.ownerRead, chatUpdates: chat.ownerUpdates, createInvitation, pair, trustNearbyDevice, authenticate, publishDirectory, directory, submit, claim, renew, result,
267
328
  status, cancel, revoke, sweep, devices, trustedCertificates: () => store.activeCertificates(),
268
329
  openInvitations: () => store.openInvitations(iso()).length };
269
330
  }
@@ -287,6 +348,17 @@ function statusView(message) {
287
348
  ...(message.cleanup_status ? { cleanup: { status: message.cleanup_status, code: message.cleanup_code ?? null } } : {}) };
288
349
  }
289
350
 
351
+ // Only 32-hex digests pass (peer-runtime.js makes them); anything else is dropped, never echoed.
352
+ function repositoryDigests(value) {
353
+ return Array.isArray(value) ? [...new Set(value.filter((digest) => typeof digest === 'string' && REPOSITORY_DIGEST.test(digest)))]
354
+ .slice(0, REPOSITORY_LIMIT) : [];
355
+ }
356
+
357
+ function memoryRecord() {
358
+ let value = {};
359
+ return { read: () => value, write: (next) => { value = next; } };
360
+ }
361
+
290
362
  export function cleanName(value) {
291
- return typeof value === 'string' ? value.replace(/[\u0000-\u001f\u007f]/g, '').trim().slice(0, 60) : '';
363
+ return typeof value === 'string' ? graphemePrefix(withoutControls(value).trim(), 60).trim() : '';
292
364
  }
@@ -62,7 +62,8 @@ export function createCoordinatorStore(path = ':memory:') {
62
62
  upsertNode({ id, name, certPem, authority = null, at }) {
63
63
  database.prepare(`INSERT INTO nodes(id, name, cert_pem, status, paired_at, authority_json) VALUES(?,?,?,'active',?,?)
64
64
  ON CONFLICT(id) DO UPDATE SET name = excluded.name, cert_pem = excluded.cert_pem, status = 'active',
65
- revoked_at = NULL, directory_json = '[]', paired_at = excluded.paired_at, authority_json = excluded.authority_json`)
65
+ revoked_at = NULL, directory_json = '[]', paired_at = excluded.paired_at, authority_json = excluded.authority_json,
66
+ last_seen_at = NULL`)
66
67
  .run(id, name, certPem, at, authority ? JSON.stringify(authority) : null);
67
68
  event(at, { nodeId: id, kind: 'paired' });
68
69
  },
@@ -0,0 +1,28 @@
1
+ // Adapters for virtual machines, containers and VPNs (Hyper-V and WSL,
2
+ // VirtualBox, VMware, Docker, Tailscale, WireGuard, ZeroTier, macOS utun and
3
+ // AWDL): another computer on the LAN usually cannot reach their addresses.
4
+ const VIRTUAL_ADAPTER = /^(vethernet|virtualbox|vboxnet|vmware|vmnet|docker|br-|veth|virbr|utun|tun|tap|wg|zt|zerotier|tailscale|awdl|llw|bridge|hyper-v|wsl|nordlynx)/i;
5
+
6
+ // This computer's IPv4 LAN addresses, those of physical adapters first.
7
+ export function lanAddresses(interfaces) {
8
+ const all = classified(interfaces);
9
+ return [...all.filter((entry) => !entry.virtual), ...all.filter((entry) => entry.virtual)].map((entry) => entry.address);
10
+ }
11
+
12
+ // The addresses worth announcing: the physical ones, or all when there is none.
13
+ export function announcedAddresses(interfaces) {
14
+ const all = classified(interfaces);
15
+ const physical = all.filter((entry) => !entry.virtual);
16
+ return (physical.length ? physical : all).map((entry) => entry.address);
17
+ }
18
+
19
+ // Addresses of virtual and VPN adapters, where nearby pairing does not answer.
20
+ export function virtualAddresses(interfaces) {
21
+ return classified(interfaces).filter((entry) => entry.virtual).map((entry) => entry.address);
22
+ }
23
+
24
+ function classified(interfaces) {
25
+ return Object.entries(interfaces()).flatMap(([name, list]) => (list ?? [])
26
+ .filter((entry) => entry && !entry.internal && (entry.family === 'IPv4' || entry.family === 4))
27
+ .map((entry) => ({ address: entry.address, virtual: VIRTUAL_ADAPTER.test(name) })));
28
+ }
@@ -0,0 +1,73 @@
1
+ import { performance } from 'node:perf_hooks';
2
+
3
+ import { PeerError } from './protocol.js';
4
+
5
+ // Every nearby pairing handshake this computer takes part in (a nonce it gives
6
+ // to a requesting device, or a pairing its person starts) is one attempt.
7
+ // Attempts are kept with their time in the computer's own store, so turning
8
+ // nearby pairing off and on, or restarting FULI, does not forget them; they
9
+ // only age out, or the person on this computer clears them (local only).
10
+ //
11
+ // Time here never runs backward. While FULI runs, it advances only with the
12
+ // process's monotonic clock: setting the system clock back or forward changes
13
+ // nothing. Across restarts it starts from the later of the system clock and
14
+ // the latest time already stored (a high-water mark), so a clock set back is
15
+ // measured from that mark. An entry stored later than that is counted as now.
16
+ // What remains: a system clock moved forward while FULI is stopped ages the
17
+ // count by that much once.
18
+ const WINDOW_MS = 10 * 60_000;
19
+ const DAY_MS = 24 * 60 * 60_000;
20
+ export const ATTEMPT_LIMITS = Object.freeze({ perDeviceWindow: 3, window: 5, day: 10 });
21
+
22
+ export function createAttemptLedger({ read, update, clock = Date.now, monotonic = () => performance.now() }) {
23
+ let anchor = null;
24
+
25
+ // This process's own time: the start point plus monotonic time since.
26
+ function now(stored) {
27
+ anchor ??= { at: Math.max(clock(), stored.highWater), mono: monotonic() };
28
+ return Math.max(anchor.at + (monotonic() - anchor.mono), stored.highWater);
29
+ }
30
+
31
+ // At most ATTEMPT_LIMITS.day entries are ever kept, so a scan is a scan of at most ten.
32
+ function current(value, at) {
33
+ const stored = shape(value);
34
+ const time = at ?? now(stored);
35
+ const entries = stored.entries.map((entry) => ({ key: entry.key, at: Math.min(entry.at, time) }))
36
+ .filter((entry) => entry.at > time - DAY_MS);
37
+ return { time, entries, window: entries.filter((entry) => entry.at > time - WINDOW_MS) };
38
+ }
39
+
40
+ function summary() {
41
+ const { entries, window } = current(read());
42
+ return { lastWindow: window.length, lastDay: entries.length,
43
+ limited: window.length >= ATTEMPT_LIMITS.window || entries.length >= ATTEMPT_LIMITS.day };
44
+ }
45
+
46
+ // Checks and counts in one immediate store transaction: no other request,
47
+ // and no other process on this data directory, can pass between them.
48
+ function take(key) {
49
+ update((value) => {
50
+ const { time, entries, window } = current(value);
51
+ if (entries.length >= ATTEMPT_LIMITS.day || window.length >= ATTEMPT_LIMITS.window
52
+ || window.filter((entry) => entry.key === key).length >= ATTEMPT_LIMITS.perDeviceWindow) {
53
+ throw new PeerError('pairing_rate_limited', 'Too many pairing attempts on this computer; wait, or clear them on this computer', 429);
54
+ }
55
+ return { entries: [...entries, { key, at: time }], highWater: time };
56
+ });
57
+ }
58
+
59
+ // The person's own reset keeps the high-water mark: a clock set back stays measured from it.
60
+ function clear() {
61
+ update((value) => ({ entries: [], highWater: now(shape(value)) }));
62
+ }
63
+
64
+ return { take, summary, clear };
65
+ }
66
+
67
+ // The stored list, or an earlier plain array of entries, or nothing usable.
68
+ function shape(value) {
69
+ const list = Array.isArray(value) ? value : Array.isArray(value?.entries) ? value.entries : [];
70
+ const entries = list.filter((entry) => typeof entry?.key === 'string' && Number.isFinite(entry.at));
71
+ const highWater = Math.max(Number.isFinite(value?.highWater) ? value.highWater : 0, ...entries.map((entry) => entry.at), 0);
72
+ return { entries, highWater };
73
+ }
@@ -0,0 +1,71 @@
1
+ import { Bonjour } from 'bonjour-service';
2
+
3
+ export const NEARBY_SERVICE_TYPE = 'fuli-peer';
4
+
5
+ // mDNS / DNS-SD over the maintained bonjour-service library (MIT, pure
6
+ // JavaScript). Nothing binds the multicast socket until something is
7
+ // advertised or browsed, so a FULI with nearby pairing off sends nothing.
8
+ //
9
+ // The multicast socket failing to bind (UDP 5353 taken or not allowed) is an
10
+ // 'error' event that would end the process: it goes to onFailure instead, and
11
+ // the caller turns nearby pairing off. Sending into a network that went away
12
+ // (an interface down, sleep and wake) is only a warning; mDNS retries itself.
13
+ export function createBonjourDiscovery({ onFailure = () => {}, options = undefined } = {}) {
14
+ let bonjour = null;
15
+ const instance = () => {
16
+ if (bonjour) return bonjour;
17
+ const created = new Bonjour(options, () => {});
18
+ const mdns = created.server?.mdns;
19
+ mdns?.on('error', (error) => {
20
+ if (bonjour === created) bonjour = null;
21
+ quietly(() => created.destroy());
22
+ onFailure(error);
23
+ });
24
+ mdns?.on('warning', () => {});
25
+ bonjour = created;
26
+ return created;
27
+ };
28
+ return {
29
+ // addresses: the only IPv4 addresses announced for this computer (others
30
+ // such as virtual adapters are left out); null announces every one.
31
+ advertise({ name, host, port, txt, addresses = null }) {
32
+ const service = instance().publish({ name, host, port, txt, type: NEARBY_SERVICE_TYPE, disableIPv6: true });
33
+ if (addresses) {
34
+ const allowed = new Set(addresses);
35
+ const records = service.records.bind(service);
36
+ service.records = () => records().filter((record) => record.type !== 'A' || allowed.has(record.data));
37
+ }
38
+ service.on?.('error', () => {});
39
+ return { stop: () => quietly(() => service.stop?.()) };
40
+ },
41
+ browse({ onUp, onDown }) {
42
+ let browser = null;
43
+ // The addresses the computer announces (its physical LAN ones) come
44
+ // before the one its packet arrived from, which may be a virtual adapter.
45
+ const view = (service) => ({ name: service.name, port: service.port, txt: service.txt ?? {},
46
+ addresses: [...(service.addresses ?? []), service.referer?.address].filter(Boolean) });
47
+ const start = () => {
48
+ browser = instance().find({ type: NEARBY_SERVICE_TYPE });
49
+ browser.on('up', (service) => onUp(view(service)));
50
+ browser.on('txt-update', (service) => onUp(view(service)));
51
+ browser.on('srv-update', (service) => onUp(view(service)));
52
+ browser.on('down', (service) => onDown(view(service)));
53
+ };
54
+ start();
55
+ return {
56
+ stop: () => quietly(() => browser?.stop()),
57
+ // A fresh browser asks again, so every computer still there answers anew.
58
+ refresh: () => { quietly(() => browser?.stop()); quietly(start); },
59
+ };
60
+ },
61
+ close() {
62
+ const current = bonjour;
63
+ bonjour = null;
64
+ quietly(() => current?.destroy());
65
+ },
66
+ };
67
+ }
68
+
69
+ function quietly(work) {
70
+ try { work(); } catch { /* the socket is already gone */ }
71
+ }