fuli-context 0.27.2 → 0.27.3
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.
- package/dist/web/assets/{AboutPage-Bgcf03U0.js → AboutPage-C-fJv2EQ.js} +1 -1
- package/dist/web/assets/AboutSectionHeading-CaZhhuuu.css +1 -0
- package/dist/web/assets/AboutSectionHeading-DLjnjHfb.js +1 -0
- package/dist/web/assets/AgentAppsPage-CBcUlh8U.js +1 -0
- package/dist/web/assets/AgentAvatar-Cu_TwSqc.js +1 -0
- package/dist/web/assets/AgentAvatar-VUEAsIqM.css +1 -0
- package/dist/web/assets/{AgentHand-BwE2VGth.js → AgentHand-1yBhYv72.js} +1 -1
- package/dist/web/assets/AgentManagement-Cc00RLSO.css +1 -0
- package/dist/web/assets/AgentManagement-D8jHUEWK.js +7 -0
- package/dist/web/assets/{AgentMentionCopy-y3JD1Cef.js → AgentMentionCopy-BRxaxi6r.js} +1 -1
- package/dist/web/assets/{AgentName-XrBcHq4R.js → AgentName-CL8xix6s.js} +1 -1
- package/dist/web/assets/{AgentProfilePage-DE7z980p.js → AgentProfilePage-BosYAypt.js} +3 -3
- package/dist/web/assets/AgentServicesPage-BQHw7Cyx.js +1 -0
- package/dist/web/assets/{AppViewerPage-BaKMk9pp.js → AppViewerPage-CO5-dW38.js} +1 -1
- package/dist/web/assets/{BackToTop-DITd9y7X.js → BackToTop-dl4Y4CgO.js} +1 -1
- package/dist/web/assets/{BoardCardFieldsMenu-CWtHiVR-.js → BoardCardFieldsMenu-BBqsgCq8.js} +1 -1
- package/dist/web/assets/{BoardMoveMenu-CEDdltY7.js → BoardMoveMenu-Rys8yvXz.js} +1 -1
- package/dist/web/assets/{Breadcrumb-C98voz9V.js → Breadcrumb-DXXN0moP.js} +1 -1
- package/dist/web/assets/{CaptureChangePage-CE8tJfiQ.js → CaptureChangePage-lNiPS4XI.js} +1 -1
- package/dist/web/assets/{CopyFixPrompt-C2hC04lV.js → CopyFixPrompt-Cpve4rdS.js} +1 -1
- package/dist/web/assets/{DataFormatPage-BjZkck9o.js → DataFormatPage-DpBIwY-n.js} +1 -1
- package/dist/web/assets/DebugTurnPage-DzJ07GMF.js +1 -0
- package/dist/web/assets/{DebugTurnsPage-BlDDz1Fk.js → DebugTurnsPage-CNAeNt5i.js} +1 -1
- package/dist/web/assets/DialogTitle-D0EVi01-.js +1 -0
- package/dist/web/assets/{EmployeeRedirectPage-CSSuvAqx.js → EmployeeRedirectPage-qlH0SVZY.js} +1 -1
- package/dist/web/assets/EmployeeScopeDialog-C4B724Jj.js +1 -0
- package/dist/web/assets/{EmployeeWorkbench-DvEojWb7.js → EmployeeWorkbench-BgpxZ_1F.js} +1 -1
- package/dist/web/assets/FieldRoot-oxmAMICi.js +1 -0
- package/dist/web/assets/FlaBlockedTasks-CWa5T5nU.css +1 -0
- package/dist/web/assets/FlaBlockedTasks-DGw9I-j7.js +1 -0
- package/dist/web/assets/{FlaGrowth-OdlmgEVi.js → FlaGrowth-Ct4GbCJZ.js} +1 -1
- package/dist/web/assets/{FlaOccupationKit-CnouVWnU.js → FlaOccupationKit-Cbx058JA.js} +1 -1
- package/dist/web/assets/{FlaTaskSheets-rSIdCtzz.js → FlaTaskSheets-CoWj7Gw3.js} +1 -1
- package/dist/web/assets/{FlasPage-BZ791caF.js → FlasPage-BGrz_P1x.js} +1 -1
- package/dist/web/assets/{GrowthLoading-BYOSvxZY.js → GrowthLoading-BHxVzIoM.js} +1 -1
- package/dist/web/assets/{HowtoPage-DNTwYQCD.css → HowtoPage-DfHVIb8E.css} +1 -1
- package/dist/web/assets/HowtoPage-Dx7xGKQi.js +1 -0
- package/dist/web/assets/{InboxPage-C3cSvJjB.js → InboxPage-ByZQpihN.js} +1 -1
- package/dist/web/assets/{KnowledgeDeleteButton-yc8Gi-BH.js → KnowledgeDeleteButton-dvslN7EO.js} +1 -1
- package/dist/web/assets/{KnowledgeHardDeleteSection-D9Ktc-uC.js → KnowledgeHardDeleteSection-DMARNrze.js} +1 -1
- package/dist/web/assets/{KnowledgeItemEditPage-Csy4oOxD.js → KnowledgeItemEditPage-D7X3K-Fu.js} +1 -1
- package/dist/web/assets/{KnowledgeItemSummaryCard-BH5UYmde.js → KnowledgeItemSummaryCard-Carpboje.js} +1 -1
- package/dist/web/assets/KnowledgeOrganizerPage-CdFva4xO.js +1 -0
- package/dist/web/assets/KnowledgePage-CwrWmdLl.js +1 -0
- package/dist/web/assets/KnowledgePeek-C4QSXTOF.js +1 -0
- package/dist/web/assets/{KnowledgeTurnReceiptPage-Bd_LIdCc.js → KnowledgeTurnReceiptPage-CY85DtmF.js} +1 -1
- package/dist/web/assets/{KnowledgeWorkspace-Dr-zYpDQ.js → KnowledgeWorkspace-D8Q8usZc.js} +1 -1
- package/dist/web/assets/{MeAvatar-CmhuRFOf.js → MeAvatar-WSCaLEJ1.js} +1 -1
- package/dist/web/assets/{MeLink-BesUihiS.js → MeLink-rP0IiTaj.js} +1 -1
- package/dist/web/assets/MenuSeparator-C_h65gsb.js +1 -0
- package/dist/web/assets/ModelSettingsPage-B_Udk6b7.js +1 -0
- package/dist/web/assets/{NewSessionPanel-Bvp9ElzU.js → NewSessionPanel-DNYTQ0Lw.js} +1 -1
- package/dist/web/assets/{NotFoundPage-BrolI2fz.js → NotFoundPage-BbnR0KYy.js} +1 -1
- package/dist/web/assets/{NoticeRow-Q9QT5NqB.js → NoticeRow-CcQ1J4wZ.js} +1 -1
- package/dist/web/assets/OccupationsPage-DQGGceta.js +1 -0
- package/dist/web/assets/{PageOutline-DULpqEwg.js → PageOutline-nKD_AvCJ.js} +1 -1
- package/dist/web/assets/{PageStack-DTzWJuae.js → PageStack-BVHOFq7x.js} +1 -1
- package/dist/web/assets/PersonalProfilePage-Cm1NxyU0.js +1 -0
- package/dist/web/assets/PersonalProjectsPage-CgqC4u77.js +1 -0
- package/dist/web/assets/{PinIcon-YYoaYKTx.js → PinIcon-DxjWqB7x.js} +1 -1
- package/dist/web/assets/PopperContent-BkTZlJWP.js +1 -0
- package/dist/web/assets/Presence-DrSz_UA1.js +3 -0
- package/dist/web/assets/{ProfileAuthorChip-BEfiuJbm.js → ProfileAuthorChip-CN1ZYzKN.js} +1 -1
- package/dist/web/assets/ProjectAgentsPage-DMnRnXDT.js +5 -0
- package/dist/web/assets/{ProjectJudgmentPolicy-CCzHtmOb.js → ProjectJudgmentPolicy-DBszt68M.js} +1 -1
- package/dist/web/assets/{RoundtablesPage-DL-IOngN.css → RoundtablesPage-Cdbl7Tbx.css} +1 -1
- package/dist/web/assets/RoundtablesPage-QtNyNaDg.js +13 -0
- package/dist/web/assets/{RovingFocusGroup-DS4v3bEq.js → RovingFocusGroup-Dvddk8pN.js} +1 -1
- package/dist/web/assets/RovingFocusItem-Ck-FCX8l.js +1 -0
- package/dist/web/assets/{SessionMigrationPage-DrK4df0L.js → SessionMigrationPage-Chm5L6p4.js} +1 -1
- package/dist/web/assets/{SessionRecordsPage-CFAgM65g.js → SessionRecordsPage-BHPaCRH-.js} +1 -1
- package/dist/web/assets/SettingsPage-C80ljt40.js +1 -0
- package/dist/web/assets/SettingsPage-CnqtNPWd.css +1 -0
- package/dist/web/assets/{SharedJefaReportPage-DbTPYwa_.js → SharedJefaReportPage-DHD4As4b.js} +1 -1
- package/dist/web/assets/{StatementCalendarPage-CIo5R14R.js → StatementCalendarPage-lkq1OrUT.js} +1 -1
- package/dist/web/assets/{StatementRows-CubaC9KG.js → StatementRows-DS-_XbkC.js} +1 -1
- package/dist/web/assets/{TagVocabularyPage-BVlLmKv2.js → TagVocabularyPage-ap97B1fd.js} +1 -1
- package/dist/web/assets/TaskBlockerClear-BBmPbomO.css +1 -0
- package/dist/web/assets/TaskBlockerClear-xmjIgmON.js +1 -0
- package/dist/web/assets/TaskBlockerNotice-D3awZbiX.js +1 -0
- package/dist/web/assets/{TaskReason-CrLPeiOg.js → TaskReason-Y_gLRUR4.js} +1 -1
- package/dist/web/assets/{TeamCard-SBMJMd7P.js → TeamCard-C5BOBfgK.js} +1 -1
- package/dist/web/assets/{TeamCardsWidget-CGLW04TH.js → TeamCardsWidget-jLieh7GV.js} +1 -1
- package/dist/web/assets/TeamIsland-C2U6j6W0.js +9 -0
- package/dist/web/assets/Teleport-RJS88HRO.js +1 -0
- package/dist/web/assets/{TextField-Cd8UOHKv.js → TextField-CwecNrfC.js} +1 -1
- package/dist/web/assets/TodayPage-wkVzpeI1.js +1 -0
- package/dist/web/assets/{TonborgDelegationSwitch-BOidSjkk.js → TonborgDelegationSwitch-C9jrfVCw.js} +1 -1
- package/dist/web/assets/{UiChip-B2z0UERX.js → UiChip-DLTDKZh9.js} +1 -1
- package/dist/web/assets/UiDialog-u4ZkP4DG.js +1 -0
- package/dist/web/assets/{UiDisclosure-Bw4Wu0Dm.js → UiDisclosure-CKVkr79z.js} +1 -1
- package/dist/web/assets/{UiIcon-BuaIQ57Z.js → UiIcon-D2DJw7hg.js} +1 -1
- package/dist/web/assets/UiSegmented-D6pLjXXW.js +1 -0
- package/dist/web/assets/{UiWeight-DpBexUUy.js → UiWeight-BOEi9suT.js} +1 -1
- package/dist/web/assets/{VirtualDirectoryList-RV2XtTPO.js → VirtualDirectoryList-BX3eeyRo.js} +1 -1
- package/dist/web/assets/{VisuallyHidden-DciDIEua.js → VisuallyHidden-DjqI8CEj.js} +1 -1
- package/dist/web/assets/{VisuallyHiddenInput-mfi7gVBu.js → VisuallyHiddenInput-Cc2Qp6aL.js} +1 -1
- package/dist/web/assets/WidgetSlot-7bCPwUl2.js +2 -0
- package/dist/web/assets/{WorkbenchListPage-suawrzji.js → WorkbenchListPage-DlE6S2WC.js} +1 -1
- package/dist/web/assets/_plugin-vue_export-helper-BXUcxlz4.js +9 -0
- package/dist/web/assets/{agent-apps-B_0syRPr.js → agent-apps-CFWQ-pVX.js} +1 -1
- package/dist/web/assets/agent-occupation-BQG-rvnx.js +1 -0
- package/dist/web/assets/{agent-pins-B9wMvxGh.js → agent-pins-XtAvsJ8S.js} +1 -1
- package/dist/web/assets/{agent-roster-records-CY0aSUNq.js → agent-roster-records-DiZKG26q.js} +1 -1
- package/dist/web/assets/{agent-work-summary-Cs8jPFL0.js → agent-work-summary-CvHRy3NR.js} +1 -1
- package/dist/web/assets/{attach-closest-edge-BRDsvYPn.js → attach-closest-edge-De5463t-.js} +1 -1
- package/dist/web/assets/{attention-store-HMiJ1K6M.js → attention-store-CWRvv8xT.js} +1 -1
- package/dist/web/assets/{badge-jafr8Jg1.js → badge-CyUHAZlb.js} +1 -1
- package/dist/web/assets/{button-d6TCVE0s.js → button-DgFpUg62.js} +1 -1
- package/dist/web/assets/{card-ebnaJXQA.js → card-BG73LSt9.js} +1 -1
- package/dist/web/assets/{catalog-CvdvPGYk.js → catalog-KaWiF7K5.js} +1 -1
- package/dist/web/assets/checkbox-DNX0E3Ym.js +1 -0
- package/dist/web/assets/{client--hZxcKYo.js → client-eeoB__-w.js} +1 -1
- package/dist/web/assets/{client-links-store-XyR0EzJi.js → client-links-store-C1T7b2HQ.js} +1 -1
- package/dist/web/assets/combobox-BG6YUVkp.js +1 -0
- package/dist/web/assets/{console-D597wx3f.js → console-KA3Jxkr4.js} +1 -1
- package/dist/web/assets/{conversation-launcher-settings-CFFH9C2y.js → conversation-launcher-settings-QWrAaAPe.js} +1 -1
- package/dist/web/assets/copy-mention-BwT-8AqP.js +1 -0
- package/dist/web/assets/dialog-CPHmFum7.js +1 -0
- package/dist/web/assets/{dist-B78L06NL.js → dist-CTCo5IXd.js} +1 -1
- package/dist/web/assets/{dist-Dy5JoHWF.js → dist-e1tihV1g.js} +1 -1
- package/dist/web/assets/dropdown-menu-BScsuHhH.js +1 -0
- package/dist/web/assets/{field-DeguT8it.js → field-8F_Pt8vb.js} +1 -1
- package/dist/web/assets/{format-bytes-Br4RwHnA.js → format-bytes-DkVJGLsS.js} +1 -1
- package/dist/web/assets/hover-card-Db-Mrxk6.js +1 -0
- package/dist/web/assets/{identity-V8oA_IuB.js → identity-wfQfyysH.js} +1 -1
- package/dist/web/assets/index-CRSH-FaE.js +24 -0
- package/dist/web/assets/{input-CRCpCN_c.js → input-DFTIPfkE.js} +1 -1
- package/dist/web/assets/label-BDet7nvg.js +1 -0
- package/dist/web/assets/label-table-BVh638Sy.js +1 -0
- package/dist/web/assets/{model-CwFZ_IgV.js → model-BwEuimI0.js} +1 -1
- package/dist/web/assets/{model-CjQPAeCy.js → model-Bzgg7OTO.js} +1 -1
- package/dist/web/assets/{model-BwOv-HBS.js → model-C7J0jC4U.js} +1 -1
- package/dist/web/assets/{model-D-vak-m0.js → model-D3j-Q4br.js} +1 -1
- package/dist/web/assets/{model-C-60EMcI.js → model-DFuUc43Z.js} +1 -1
- package/dist/web/assets/{model-B4AuKvPj.js → model-DGpMX2GY.js} +1 -1
- package/dist/web/assets/{model-CB4ObIOH.js → model-LXhsHZ_S.js} +1 -1
- package/dist/web/assets/{model-CUAxIOXR.js → model-WhGp0XZv.js} +1 -1
- package/dist/web/assets/{motion-D5Fs3-ut.js → motion-0KGuL0P9.js} +1 -1
- package/dist/web/assets/{motion-Cr9JChF9.js → motion-BhDwEDuX.js} +1 -1
- package/dist/web/assets/{motion-preference-DgdzdVh8.js → motion-preference--VYomm-z.js} +1 -1
- package/dist/web/assets/{occupation-catalog-DHsjkd_q.js → occupation-catalog-D5SQWfUI.js} +1 -1
- package/dist/web/assets/{occupation-kits-BVLLRN4V.js → occupation-kits-CrqixyUx.js} +1 -1
- package/dist/web/assets/{option-DhAwzags.js → option-C9CkqCvy.js} +1 -1
- package/dist/web/assets/{orchestration-filters-lhR2CHlQ.js → orchestration-filters-DTnWbCEm.js} +1 -1
- package/dist/web/assets/{overview-data-QDnygL-x.js → overview-data-BvW9uhT4.js} +1 -1
- package/dist/web/assets/{page-refresh-BVRlo-dI.js → page-refresh-GRJ3nMpT.js} +1 -1
- package/dist/web/assets/{page-title-ReSXziuS.js → page-title-B9HNL7K4.js} +1 -1
- package/dist/web/assets/{person-profile-BgUfg57K.js → person-profile-Cng7edLa.js} +1 -1
- package/dist/web/assets/popover-BgaSR8Zf.js +1 -0
- package/dist/web/assets/popup-host-CFQVWMSj.js +1 -0
- package/dist/web/assets/{preference-conflicts-a-H51vUw.js → preference-conflicts-WphCdbo6.js} +1 -1
- package/dist/web/assets/{profile-model-CM98TJsj.js → profile-model-B9K6ylO1.js} +1 -1
- package/dist/web/assets/{project-board-layout-RH6UXkCA.js → project-board-layout-GxgeqkX4.js} +1 -1
- package/dist/web/assets/{project-capture-DcQ8cXIt.js → project-capture-C6NQkcJw.js} +1 -1
- package/dist/web/assets/{project-origin-BNzeAazi.js → project-origin-DuSzjbhd.js} +1 -1
- package/dist/web/assets/{quick-edit-api-COKVNuPk.js → quick-edit-api-BDFnInRp.js} +1 -1
- package/dist/web/assets/radio-group-D6RUfdDr.js +1 -0
- package/dist/web/assets/{review-api-CAKGInLD.js → review-api-D31JYGWJ.js} +1 -1
- package/dist/web/assets/{review-list-CbpXvBp-.js → review-list-Cvacm108.js} +1 -1
- package/dist/web/assets/{review-store-BzrmqVoj.js → review-store-D7_Vfhh7.js} +1 -1
- package/dist/web/assets/{role-names-Ba0c6AbS.js → role-names-DebBvCND.js} +1 -1
- package/dist/web/assets/{roundtable-live-CoKmaXKd.js → roundtable-live-DfN7Sw9Q.js} +1 -1
- package/dist/web/assets/{runtime-dom.esm-bundler-CaYBCU9Y.js → runtime-dom.esm-bundler-DBdCxLeu.js} +1 -1
- package/dist/web/assets/select-C0ecw2Gn.js +1 -0
- package/dist/web/assets/{session-launch-offers-C-oBkMKe.js → session-launch-offers-BO40dDPk.js} +1 -1
- package/dist/web/assets/{settings-autosave-C3bTildI.js → settings-autosave-q7Wr9G3O.js} +1 -1
- package/dist/web/assets/{settings-tabs-DFZcxOaQ.js → settings-tabs-D7-3akvW.js} +1 -1
- package/dist/web/assets/shared-report-j27wViAk.js +3 -0
- package/dist/web/assets/{source-adapters-CunVF9JG.js → source-adapters-D3VpWZ6y.js} +1 -1
- package/dist/web/assets/switch-ClI3aPV3.js +1 -0
- package/dist/web/assets/tabs-BYpn35nj.js +1 -0
- package/dist/web/assets/{task-card-fields-Ce11pWnv.js → task-card-fields-CR_cHUml.js} +1 -1
- package/dist/web/assets/{task-labels-BulIuDQB.js → task-labels-C6FR9pf_.js} +1 -1
- package/dist/web/assets/{task-reason-gHlp8KHO.js → task-reason-C2NjR8__.js} +1 -1
- package/dist/web/assets/{team-sheets-BzV1WjjK.js → team-sheets-5rb7d8An.js} +1 -1
- package/dist/web/assets/{textarea-D6czUY3a.js → textarea-BW51g0FT.js} +1 -1
- package/dist/web/assets/ui-rJlFkhnh.js +1 -0
- package/dist/web/assets/{useAgentRecords-DijrJ79w.js → useAgentRecords-BDEGuChX.js} +1 -1
- package/dist/web/assets/{useAgentWorkSummary-CUv88AVP.js → useAgentWorkSummary-B7fcYNAf.js} +1 -1
- package/dist/web/assets/{useApi-CROJJdhE-CxqsMZ6P.js → useApi-CROJJdhE-CXkEmQ40.js} +1 -1
- package/dist/web/assets/{useClipboardCopy-uGyNKuWB.js → useClipboardCopy-CLyPUkax.js} +1 -1
- package/dist/web/assets/useDirection-hD2Ki6e_.js +1 -0
- package/dist/web/assets/{useFocusReturn-7BKdKvqF.js → useFocusReturn-BzZRnzjC.js} +1 -1
- package/dist/web/assets/useForwardExpose-BFvXozfQ.js +1 -0
- package/dist/web/assets/{useForwardPropsEmits-BMeknK03.js → useForwardPropsEmits-BQIBYWrX.js} +1 -1
- package/dist/web/assets/useForwardScopeId-DJpBz5AW.js +1 -0
- package/dist/web/assets/{useKnowledgeConfirm-mFWI8EbK.js → useKnowledgeConfirm-B7ljY3BE.js} +1 -1
- package/dist/web/assets/{useKnowledgeItemPeek-DtazLM2s.js → useKnowledgeItemPeek-W54o0cXF.js} +1 -1
- package/dist/web/assets/{useMinimumLoadingDisplay-D5UC2KRz.js → useMinimumLoadingDisplay-i0As_nIh.js} +1 -1
- package/dist/web/assets/useNow-w9sbWus7.js +1 -0
- package/dist/web/assets/{usePageTools-BXkR_gpB.js → usePageTools-ChjnsxqE.js} +1 -1
- package/dist/web/assets/usePrimitiveElement-tPtHrVAh.js +1 -0
- package/dist/web/assets/{useProjectAgentRoster-blZ5REnH.js → useProjectAgentRoster-Cv-2h61l.js} +1 -1
- package/dist/web/assets/{useRoutePeek-D_j5KVFv.js → useRoutePeek-6T3XqFw1.js} +1 -1
- package/dist/web/assets/{useTeamWork-e57CKhLW.js → useTeamWork-rjEihEaF.js} +1 -1
- package/dist/web/assets/{useTypeahead-6a1q-4Oq.js → useTypeahead-BBlzBvAi.js} +1 -1
- package/dist/web/assets/{utils-BQtZ8ZUw.js → utils-Bhge2HAf.js} +1 -1
- package/dist/web/assets/{utils-DBsOpQt4.js → utils-DVo87S8o.js} +1 -1
- package/dist/web/assets/{verification-BlF0avgs.js → verification-BKmnZihv.js} +1 -1
- package/dist/web/assets/{version-oG6VyAd6.js → version-BYqyCHiB.js} +1 -1
- package/dist/web/assets/{vue-router-CCvxNose.js → vue-router-BJZE7CCr.js} +1 -1
- package/dist/web/index.html +75 -73
- package/docs/agent-roundtable.md +5 -3
- package/graph-provider/fuli_graph/graph_field_contract.py +2 -0
- package/graph-provider/fuli_graph/graph_format_migrations.py +5 -0
- package/graph-provider/fuli_graph/knowledge_search.py +84 -7
- package/graph-provider/fuli_graph/knowledge_sensitivity.py +105 -0
- package/graph-provider/fuli_graph/knowledge_source_delete_copies.py +36 -0
- package/graph-provider/fuli_graph/models.py +25 -0
- package/graph-provider/fuli_graph/project_agent_remote_origins.py +27 -13
- package/graph-provider/pyproject.toml +1 -1
- package/native/win32/fuli-win-helper.exe +0 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/packages/roundtable/src/agents/claude-code/wake.js +13 -8
- package/packages/roundtable/src/host.js +21 -0
- package/packages/roundtable/src/peer/control-cli.js +5 -1
- package/packages/roundtable/src/peer/control.js +10 -3
- package/packages/roundtable/src/peer/coordinator-service.js +30 -13
- package/packages/roundtable/src/peer/coordinator-store.js +11 -4
- package/packages/roundtable/src/peer/nearby-pairing.js +13 -1
- package/packages/roundtable/src/peer/origin-proof.js +17 -2
- package/packages/roundtable/src/peer/peer-port.js +45 -7
- package/packages/roundtable/src/peer/peer-runtime.js +20 -4
- package/packages/roundtable/src/peer/protocol.js +68 -2
- package/packages/roundtable/src/peer/query-answer.js +78 -0
- package/packages/roundtable/src/peer/runner.js +107 -13
- package/packages/roundtable/src/roundtable/service.js +73 -14
- package/packages/roundtable/src/roundtable/store.js +8 -0
- package/packages/roundtable/src/roundtable/wake-attempt-store.js +26 -0
- package/packages/roundtable/src/roundtable/wake-failure.js +77 -0
- package/packages/roundtable/src/roundtable/wake-ladder.js +5 -0
- package/packages/roundtable/src/roundtable/wake.js +39 -15
- package/packages/roundtable/src/standalone/host.js +5 -2
- package/skills/capturing-session-knowledge/references/coordination.md +11 -0
- package/skills/operating-fuli/SKILL.md +5 -3
- package/skills/operating-fuli/references/workflow-recipes.md +3 -3
- package/src/agent-apps/host-tools/catalog.js +1 -0
- package/src/agent-peer/http.js +15 -1
- package/src/agent-roundtable/tools.js +8 -0
- package/src/agent-tools/interface-catalog.js +5 -4
- package/src/data-format/local-stores.js +3 -0
- package/src/desktop/windows-controller.js +17 -4
- package/src/desktop/windows-installation-context.js +26 -1
- package/src/diagnostics/failure-records.js +16 -0
- package/src/diagnostics/query.js +2 -2
- package/src/diagnostics/safe-event.js +4 -12
- package/src/external-knowledge/safe-diagnostic.js +2 -5
- package/src/graphiti/local-runtimes.js +4 -0
- package/src/graphiti/roundtable-host.js +49 -0
- package/src/http/api-router.js +2 -0
- package/src/http/visitor-access-api-router.js +37 -0
- package/src/mcp/create-mcp-server.js +2 -0
- package/src/mcp/session-id.js +1 -1
- package/src/mcp/tool-annotations.js +3 -1
- package/src/presence/windows-helper-pin.js +1 -1
- package/src/text/control-characters.js +9 -0
- package/src/text/local-paths.js +48 -0
- package/src/text/shareable-text.js +23 -0
- package/src/visitor-access/port.js +194 -0
- package/src/visitor-access/rate-limit.js +26 -0
- package/src/visitor-access/shared-project-search.js +129 -0
- package/src/visitor-access/store.js +192 -0
- package/src/whats-new/lines/0.27.3.json +13 -0
- package/dist/web/assets/AboutSectionHeading-BaQBY_Xs.js +0 -1
- package/dist/web/assets/AboutSectionHeading-DjXpIV27.css +0 -1
- package/dist/web/assets/AgentAppsPage-DNuujLT2.js +0 -1
- package/dist/web/assets/AgentAvatar-DGXedNUs.js +0 -1
- package/dist/web/assets/AgentAvatar-DbsG1_BY.css +0 -1
- package/dist/web/assets/AgentManagement-2r8DUS1N.js +0 -7
- package/dist/web/assets/AgentManagement-hRkMpjvY.css +0 -1
- package/dist/web/assets/AgentServicesPage-CWfGSxcb.js +0 -1
- package/dist/web/assets/DebugTurnPage-B82geu1y.js +0 -1
- package/dist/web/assets/DialogTitle-fpANsAcy.js +0 -1
- package/dist/web/assets/EmployeeScopeDialog-BoEMQOEj.js +0 -1
- package/dist/web/assets/FieldRoot-D3lnRut5.js +0 -1
- package/dist/web/assets/HowtoPage-lYwzi4Vm.js +0 -1
- package/dist/web/assets/KnowledgeOrganizerPage-BTeQX0gH.js +0 -1
- package/dist/web/assets/KnowledgePage-BuukvNxz.js +0 -1
- package/dist/web/assets/KnowledgePeek-D0pcU7U5.js +0 -1
- package/dist/web/assets/MenuSeparator-BGo0DgyF.js +0 -1
- package/dist/web/assets/ModelSettingsPage-CBPwuIBM.js +0 -1
- package/dist/web/assets/OccupationsPage-CZCeeihl.js +0 -1
- package/dist/web/assets/PersonalProfilePage-DbXWycCQ.js +0 -1
- package/dist/web/assets/PersonalProjectsPage-pdAJpnZd.js +0 -1
- package/dist/web/assets/PopperContent-CnNwFMIA.js +0 -1
- package/dist/web/assets/Presence-CuIoA2sH.js +0 -3
- package/dist/web/assets/ProjectAgentsPage-BPf2RLsw.js +0 -5
- package/dist/web/assets/RoundtablesPage-BDU4W-bg.js +0 -13
- package/dist/web/assets/RovingFocusItem-bLEnnw2Y.js +0 -1
- package/dist/web/assets/SettingsPage-CsJxhhsu.js +0 -1
- package/dist/web/assets/SettingsPage-VX_e4ty2.css +0 -1
- package/dist/web/assets/TaskBlockerNotice-YSvmy6B4.js +0 -1
- package/dist/web/assets/TeamIsland-jJKTwCJD.js +0 -9
- package/dist/web/assets/Teleport-CRjWb-eC.js +0 -1
- package/dist/web/assets/TodayPage-BvbZCEFJ.js +0 -1
- package/dist/web/assets/UiSegmented-DlI1vR3k.js +0 -1
- package/dist/web/assets/WidgetSlot-xFZKjZ5z.js +0 -2
- package/dist/web/assets/_plugin-vue_export-helper-CYsAcErn.js +0 -9
- package/dist/web/assets/agent-occupation-C-9THmIG.js +0 -1
- package/dist/web/assets/checkbox-CdIozFRY.js +0 -1
- package/dist/web/assets/combobox-DzLSYxyO.js +0 -1
- package/dist/web/assets/copy-mention-CWsw8po1.js +0 -1
- package/dist/web/assets/dialog-SLa8cPbS.js +0 -1
- package/dist/web/assets/dropdown-menu-C-PcZxRY.js +0 -1
- package/dist/web/assets/hover-card-B-H7mMvg.js +0 -1
- package/dist/web/assets/index-DdAVEwQV.js +0 -24
- package/dist/web/assets/label-DwMBzI2m.js +0 -1
- package/dist/web/assets/label-table-DiaZlHIp.js +0 -1
- package/dist/web/assets/popover-UYksnAeH.js +0 -1
- package/dist/web/assets/popup-host-DMoMkD3v.js +0 -1
- package/dist/web/assets/radio-group-DfegNkLG.js +0 -1
- package/dist/web/assets/select-Bq2TQ0Gw.js +0 -1
- package/dist/web/assets/shared-report-Ci1jBiYV.js +0 -3
- package/dist/web/assets/switch-DaUSEDq0.js +0 -1
- package/dist/web/assets/tabs-B_7xQRfl.js +0 -1
- package/dist/web/assets/ui-BCHzwL4X.js +0 -1
- package/dist/web/assets/useDirection-Bi78LycK.js +0 -1
- package/dist/web/assets/useForwardScopeId-DHGSyWlZ.js +0 -1
- package/dist/web/assets/usePrimitiveElement-BxOn-Fn_.js +0 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"""Which knowledge items a visitor's search may return (max_sensitivity='normal').
|
|
2
|
+
|
|
3
|
+
Sensitivity is stored only on episodes (`fuli_sensitivity`). An item reaches
|
|
4
|
+
a visitor only when every source it has, and every source of every version
|
|
5
|
+
it replaced or absorbed (edits, supersedes and duplicate merges all point the
|
|
6
|
+
older item at the newer one with fuli_replaced_by_item_id), is explicitly
|
|
7
|
+
normal, and there is at least one. One private or restricted source anywhere
|
|
8
|
+
in that lineage keeps the item out: an entity a private capture created
|
|
9
|
+
keeps that capture's words even after a normal one mentions it.
|
|
10
|
+
|
|
11
|
+
An edit episode (knowledge_versions._write_edit_episodes) says nothing about
|
|
12
|
+
how sensitive the knowledge is, so it counts neither way. An episode without
|
|
13
|
+
a stored sensitivity is not normal: every FULI writer has set it since the
|
|
14
|
+
graph's first release, so a missing value is not FULI's capture and is not
|
|
15
|
+
trusted.
|
|
16
|
+
|
|
17
|
+
The walk reads MAX_VERSION_DEPTH levels of predecessors; a lineage with a
|
|
18
|
+
predecessor still unread after that is left out.
|
|
19
|
+
|
|
20
|
+
Deleted sources. A relationship lists its episodes by id (`episodes`); one
|
|
21
|
+
whose list names an episode that no longer exists is left out, since that
|
|
22
|
+
episode's sensitivity cannot be read. FULI's own source delete
|
|
23
|
+
(knowledge_source_delete_copies) marks every item that outlives the deletion
|
|
24
|
+
of a non-normal, non-edit source with fuli_had_restricted_source = true
|
|
25
|
+
(graph format 20); a lineage with that marker on any version is left out.
|
|
26
|
+
Known limits, not checked here:
|
|
27
|
+
- A source deleted before graph format 20 left no marker, and none is
|
|
28
|
+
backfilled.
|
|
29
|
+
- A deletion outside FULI's source delete leaves nothing on an entity (it
|
|
30
|
+
records no list of its sources) or on a successor (the version link is
|
|
31
|
+
stored only on the older item).
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
MAX_VERSION_DEPTH = 20
|
|
35
|
+
EDIT_SOURCE_KINDS = ('human_knowledge_edit', 'agent_knowledge_edit')
|
|
36
|
+
|
|
37
|
+
_ITEM = {
|
|
38
|
+
'entity': ('(item:Entity)', '''
|
|
39
|
+
OPTIONAL MATCH (episode:Episodic {group_id: item.group_id})-[:MENTIONS]->(item)
|
|
40
|
+
WITH origin, item, collect(DISTINCT episode) AS episodes, 0 AS missing'''),
|
|
41
|
+
'relationship': ('()-[item:RELATES_TO]->()', '''
|
|
42
|
+
OPTIONAL MATCH (episode:Episodic {group_id: item.group_id})
|
|
43
|
+
WHERE episode.uuid IN coalesce(item.episodes, [])
|
|
44
|
+
WITH origin, item, collect(DISTINCT episode) AS episodes
|
|
45
|
+
WITH origin, item, episodes,
|
|
46
|
+
size([id IN coalesce(item.episodes, []) WHERE NOT id IN [found IN episodes | found.uuid]]) AS missing'''),
|
|
47
|
+
}
|
|
48
|
+
_SOURCES = '''
|
|
49
|
+
RETURN origin, item.uuid AS id, item.group_id AS group_id, missing,
|
|
50
|
+
coalesce(item.fuli_had_restricted_source, false) AS had_restricted_source,
|
|
51
|
+
[episode IN episodes | {kind: episode.fuli_source_kind,
|
|
52
|
+
sensitivity: episode.fuli_sensitivity}] AS sources
|
|
53
|
+
'''
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
async def normal_only_ids(store, item_kind: str, item_ids: list[str]) -> set[str]:
|
|
57
|
+
"""The items among item_ids whose whole lineage has only normal sources."""
|
|
58
|
+
if not item_ids:
|
|
59
|
+
return set()
|
|
60
|
+
pattern, episodes = _ITEM[item_kind]
|
|
61
|
+
predecessors = f'''
|
|
62
|
+
UNWIND $frontier AS row
|
|
63
|
+
MATCH {pattern}
|
|
64
|
+
WHERE item.group_id = row.group_id AND item.fuli_replaced_by_item_id = row.id
|
|
65
|
+
AND coalesce(item.fuli_replaced_by_item_kind, $item_kind) = $item_kind
|
|
66
|
+
WITH row.origin AS origin, item{episodes}{_SOURCES}'''
|
|
67
|
+
lineages = {}
|
|
68
|
+
frontier = _merge(lineages, await _read(store, f'''
|
|
69
|
+
MATCH {pattern} WHERE item.uuid IN $item_ids
|
|
70
|
+
WITH item.uuid AS origin, item{episodes}{_SOURCES}''', item_ids=list(dict.fromkeys(item_ids))))
|
|
71
|
+
for _ in range(MAX_VERSION_DEPTH):
|
|
72
|
+
if not frontier:
|
|
73
|
+
break
|
|
74
|
+
frontier = _merge(lineages, await _read(store, predecessors, frontier=frontier, item_kind=item_kind))
|
|
75
|
+
if frontier:
|
|
76
|
+
# Read, not merged: only whether anything is left past the last level.
|
|
77
|
+
for row in await _read(store, predecessors, frontier=frontier, item_kind=item_kind):
|
|
78
|
+
lineages[row['origin']]['withheld'] = True
|
|
79
|
+
return {origin for origin, lineage in lineages.items() if lineage['sources'] and not lineage['withheld']}
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
async def _read(store, query, **parameters) -> list[dict]:
|
|
83
|
+
records, _, _ = await store.runtime.driver.execute_query(query, **parameters, routing_='r')
|
|
84
|
+
return [dict(record) for record in records]
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def _merge(lineages: dict, rows) -> list[dict]:
|
|
88
|
+
"""Adds each version's sources to its origin's lineage; answers the
|
|
89
|
+
versions whose predecessors are still to read. A version already seen
|
|
90
|
+
(a cycle) is not read again, and a lineage withheld at this level is not
|
|
91
|
+
followed further, whichever of its versions withheld it."""
|
|
92
|
+
found = []
|
|
93
|
+
for row in rows:
|
|
94
|
+
lineage = lineages.setdefault(row['origin'], {'seen': set(), 'sources': 0, 'withheld': False})
|
|
95
|
+
if row['id'] in lineage['seen']:
|
|
96
|
+
continue
|
|
97
|
+
lineage['seen'].add(row['id'])
|
|
98
|
+
lineage['withheld'] |= bool(row.get('missing')) or bool(row.get('had_restricted_source'))
|
|
99
|
+
for source in row['sources']:
|
|
100
|
+
if source.get('kind') in EDIT_SOURCE_KINDS:
|
|
101
|
+
continue
|
|
102
|
+
lineage['sources'] += 1
|
|
103
|
+
lineage['withheld'] |= source.get('sensitivity') != 'normal'
|
|
104
|
+
found.append({'origin': row['origin'], 'id': row['id'], 'group_id': row['group_id']})
|
|
105
|
+
return [version for version in found if not lineages[version['origin']]['withheld']]
|
|
@@ -7,11 +7,47 @@ mutation erases local publication drafts in the same transaction; remote copies
|
|
|
7
7
|
are outside this local source operation.
|
|
8
8
|
"""
|
|
9
9
|
from .conversation_context import message_bytes
|
|
10
|
+
from .knowledge_sensitivity import EDIT_SOURCE_KINDS
|
|
10
11
|
from .store_agent_conversations import decode_event
|
|
11
12
|
|
|
13
|
+
# A deleted source that was not explicitly normal (private, restricted or
|
|
14
|
+
# unknown) and not an edit episode, which says nothing about the knowledge.
|
|
15
|
+
_NON_NORMAL_SOURCE = '''
|
|
16
|
+
NOT coalesce(episode.fuli_source_kind, '') IN $edit_kinds
|
|
17
|
+
AND coalesce(episode.fuli_sensitivity, '') <> 'normal'
|
|
18
|
+
'''
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
async def _mark_restricted_source_loss(scoped, space, episode_ids):
|
|
22
|
+
"""Before the episodes go, in the delete's own transaction: every item a
|
|
23
|
+
non-normal one of them is a source of, and that outlives the delete (the
|
|
24
|
+
items that go were removed before this), carries
|
|
25
|
+
fuli_had_restricted_source = true from now on, so a visitor's search
|
|
26
|
+
(knowledge_sensitivity) still withholds it. The marker is never unset;
|
|
27
|
+
only that search reads it."""
|
|
28
|
+
if not episode_ids:
|
|
29
|
+
return
|
|
30
|
+
params = {'group_id': space['group_id'], 'episode_ids': episode_ids, 'edit_kinds': list(EDIT_SOURCE_KINDS)}
|
|
31
|
+
await scoped.runtime.driver.execute_query(
|
|
32
|
+
'''
|
|
33
|
+
MATCH (episode:Episodic {group_id: $group_id})-[:MENTIONS]->(item:Entity {group_id: $group_id})
|
|
34
|
+
WHERE episode.uuid IN $episode_ids AND''' + _NON_NORMAL_SOURCE + '''
|
|
35
|
+
SET item.fuli_had_restricted_source = true
|
|
36
|
+
''', **params)
|
|
37
|
+
await scoped.runtime.driver.execute_query(
|
|
38
|
+
'''
|
|
39
|
+
MATCH (episode:Episodic {group_id: $group_id})
|
|
40
|
+
WHERE episode.uuid IN $episode_ids AND''' + _NON_NORMAL_SOURCE + '''
|
|
41
|
+
WITH collect(episode.uuid) AS withheld
|
|
42
|
+
MATCH ()-[item:RELATES_TO {group_id: $group_id}]->()
|
|
43
|
+
WHERE any(id IN coalesce(item.episodes, []) WHERE id IN withheld)
|
|
44
|
+
SET item.fuli_had_restricted_source = true
|
|
45
|
+
''', **params)
|
|
46
|
+
|
|
12
47
|
|
|
13
48
|
async def remove_source_copies(scoped, space, inventory):
|
|
14
49
|
episode_ids = [episode['uuid'] for episode in inventory['episodes']]
|
|
50
|
+
await _mark_restricted_source_loss(scoped, space, episode_ids)
|
|
15
51
|
await scoped.runtime.driver.execute_query(
|
|
16
52
|
'''
|
|
17
53
|
MATCH ()-[item:RELATES_TO {group_id: $group_id}]->()
|
|
@@ -756,6 +756,15 @@ class SearchRequest(StrictModel):
|
|
|
756
756
|
inherit_project_knowledge: bool = True
|
|
757
757
|
include_personal_global: bool = False
|
|
758
758
|
semantic: SemanticQuery | None = None
|
|
759
|
+
# 'normal' (a visitor's search): only items whose every source, in every
|
|
760
|
+
# version they replaced, is normal, and relationships whose two endpoints
|
|
761
|
+
# this search may return too (knowledge_sensitivity). None: no such filter.
|
|
762
|
+
max_sensitivity: Literal['normal'] | None = None
|
|
763
|
+
# False: an item another project defined and this one only references is
|
|
764
|
+
# not this project's. True keeps every existing caller's view.
|
|
765
|
+
include_project_references: bool = True
|
|
766
|
+
# Entity types this search never returns, nor lets a relationship reach.
|
|
767
|
+
excluded_entity_types: list[str] = Field(default_factory=list, max_length=16)
|
|
759
768
|
|
|
760
769
|
@field_validator('personal_project_ids')
|
|
761
770
|
@classmethod
|
|
@@ -778,6 +787,22 @@ class SearchRequest(StrictModel):
|
|
|
778
787
|
)
|
|
779
788
|
if self.project_agent_id and not self.active_personal_project_id:
|
|
780
789
|
raise ValueError('project Agent search requires active_personal_project_id')
|
|
790
|
+
# A visitor's search reads one project's own current, confirmed items
|
|
791
|
+
# only; the search enforces that scope anyway, and a request that asks
|
|
792
|
+
# for anything wider is a caller's mistake worth refusing.
|
|
793
|
+
if self.max_sensitivity:
|
|
794
|
+
widened = [name for name, wide in (
|
|
795
|
+
('include_project_references', self.include_project_references),
|
|
796
|
+
('inherit_project_knowledge', self.inherit_project_knowledge),
|
|
797
|
+
('include_personal_global', self.include_personal_global),
|
|
798
|
+
('include_pending', self.include_pending),
|
|
799
|
+
('include_historical', self.include_historical),
|
|
800
|
+
('project_agent_id', self.project_agent_id is not None),
|
|
801
|
+
) if wide]
|
|
802
|
+
if not self.active_personal_project_id:
|
|
803
|
+
raise ValueError('a max_sensitivity search requires active_personal_project_id')
|
|
804
|
+
if widened:
|
|
805
|
+
raise ValueError(f'a max_sensitivity search requires {", ".join(widened)} to be off')
|
|
781
806
|
return self
|
|
782
807
|
|
|
783
808
|
|
|
@@ -26,6 +26,18 @@ DIGEST = r'^[0-9a-f]{64}$'
|
|
|
26
26
|
CANONICAL_TIME = r'^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$'
|
|
27
27
|
PROOF_VERSION = 'fuli-remote-origin/1'
|
|
28
28
|
CHAT_PROOF_VERSION = 'fuli-chat-origin/1'
|
|
29
|
+
# Each purpose signs under its own version, so a verifier that knows only some
|
|
30
|
+
# purposes rejects the others. Execution keeps the version and wire shape it
|
|
31
|
+
# had before purposes existed; every other proof also signs its purpose.
|
|
32
|
+
PROOF_VERSIONS = {
|
|
33
|
+
'execution': PROOF_VERSION,
|
|
34
|
+
'chat': CHAT_PROOF_VERSION,
|
|
35
|
+
'query': 'fuli-query-origin/1',
|
|
36
|
+
'request': 'fuli-request-origin/1',
|
|
37
|
+
}
|
|
38
|
+
# Asking another computer to act stays with the project lead. Chat and a
|
|
39
|
+
# visitor's query are asked by any Agent of a live project task.
|
|
40
|
+
LEAD_PURPOSES = frozenset({'execution', 'request'})
|
|
29
41
|
MAX_LIFETIME = timedelta(minutes=30)
|
|
30
42
|
|
|
31
43
|
|
|
@@ -38,7 +50,7 @@ class AgentRemoteOriginIssue(StrictModel):
|
|
|
38
50
|
target_node: str = Field(pattern=DIGEST)
|
|
39
51
|
binding_id: str = Field(min_length=1, max_length=128, pattern=OPAQUE)
|
|
40
52
|
expires_at: str = Field(pattern=CANONICAL_TIME)
|
|
41
|
-
purpose: Literal['execution', 'chat'] = 'execution'
|
|
53
|
+
purpose: Literal['execution', 'chat', 'query', 'request'] = 'execution'
|
|
42
54
|
|
|
43
55
|
|
|
44
56
|
def _encode(value):
|
|
@@ -93,13 +105,13 @@ class StoreRemoteAgentOrigins:
|
|
|
93
105
|
project_id = context.get('personal_project_id')
|
|
94
106
|
if not agent_id or not project_id or (context.get('checkpoint') or {}).get('phase') == 'complete':
|
|
95
107
|
raise HTTPException(409, 'A remote ask requires an active project task of a FULI Agent')
|
|
96
|
-
if request.purpose
|
|
108
|
+
if request.purpose != 'execution' and (context.get('agent_memory_scope') == 'task_only'
|
|
97
109
|
or (context.get('turn_id') or '').startswith('worker-run:')):
|
|
98
|
-
raise HTTPException(403, 'A restricted worker cannot open cross-device chats')
|
|
110
|
+
raise HTTPException(403, 'A restricted worker cannot open cross-device chats, queries or requests')
|
|
99
111
|
await authorize_personal_project(self, actor, space, project_id)
|
|
100
112
|
policy = await self.get_project_agent_coordination_policy(actor, request.personal_space_id, project_id)
|
|
101
|
-
# Execution
|
|
102
|
-
if request.purpose
|
|
113
|
+
# Execution and requests stay with the project lead; chat and queries do not act.
|
|
114
|
+
if request.purpose in LEAD_PURPOSES and (not policy.team_lead_agent_id or agent_id != policy.team_lead_agent_id):
|
|
103
115
|
raise HTTPException(403, 'Only the project lead can ask Agents on other devices')
|
|
104
116
|
agent = await self.get_project_agent(actor, request.personal_space_id, project_id, agent_id)
|
|
105
117
|
if agent.profile.status != 'active':
|
|
@@ -126,7 +138,7 @@ class StoreRemoteAgentOrigins:
|
|
|
126
138
|
MATCH (project)-[:HAS_PROJECT_AGENT_ASSIGNMENT]->
|
|
127
139
|
(:FuliProjectAgentAssignment {status: 'active'})-[:ASSIGNED_AGENT]->(role)
|
|
128
140
|
} AS assigned
|
|
129
|
-
WITH live_task, lead, assigned, live_task AND (lead OR $
|
|
141
|
+
WITH live_task, lead, assigned, live_task AND (lead OR NOT $lead_required) AND assigned AS allowed
|
|
130
142
|
FOREACH (ignored IN CASE WHEN allowed THEN [1] ELSE [] END |
|
|
131
143
|
MERGE (origin:FuliRemoteAgentOrigin {space_id: $space_id, message_id: $message_id})
|
|
132
144
|
ON CREATE SET origin.digest = $digest, origin.agent_id = $agent_id, origin.project_id = $project_id,
|
|
@@ -141,26 +153,28 @@ class StoreRemoteAgentOrigins:
|
|
|
141
153
|
RETURN live_task, lead, assigned, same''',
|
|
142
154
|
space_id=request.personal_space_id, token=request.task_context_token, message_id=request.message_id,
|
|
143
155
|
digest=request.digest, agent_id=agent_id, project_id=project_id, target_node=request.target_node,
|
|
144
|
-
binding_id=request.binding_id, task_hash=task_hash, expires_at=request.expires_at, purpose=request.purpose
|
|
156
|
+
binding_id=request.binding_id, task_hash=task_hash, expires_at=request.expires_at, purpose=request.purpose,
|
|
157
|
+
lead_required=request.purpose in LEAD_PURPOSES)
|
|
145
158
|
row = rows[0] if rows else None
|
|
146
159
|
if not row or not row['live_task']:
|
|
147
160
|
raise HTTPException(404, 'The sending task is no longer current')
|
|
148
|
-
if (request.purpose
|
|
161
|
+
if (request.purpose in LEAD_PURPOSES and not row['lead']) or not row['assigned']:
|
|
149
162
|
raise HTTPException(403, 'Only the project lead can ask Agents on other devices')
|
|
150
163
|
if not row['same']:
|
|
151
164
|
raise HTTPException(409, 'This message ID already belongs to a different remote ask')
|
|
152
165
|
key = await self._remote_origin_key(request.personal_space_id)
|
|
153
166
|
claims = {
|
|
154
|
-
'version':
|
|
167
|
+
'version': PROOF_VERSIONS[request.purpose],
|
|
155
168
|
'key_id': key['key_id'], 'space_id': request.personal_space_id,
|
|
156
169
|
'project_id': project_id, 'agent_id': agent_id, 'task_hash': task_hash,
|
|
157
170
|
'message_id': request.message_id, 'digest': request.digest, 'target_node': request.target_node,
|
|
158
171
|
'binding_id': request.binding_id, 'issued_at': canonical_time(now), 'expires_at': request.expires_at,
|
|
159
172
|
}
|
|
160
|
-
# Existing execution proofs retain their exact wire shape.
|
|
161
|
-
#
|
|
162
|
-
|
|
163
|
-
|
|
173
|
+
# Existing execution proofs retain their exact wire shape. Every other
|
|
174
|
+
# purpose uses a distinct version and signs its purpose, so even older
|
|
175
|
+
# execution ports reject it.
|
|
176
|
+
if request.purpose != 'execution':
|
|
177
|
+
claims['purpose'] = request.purpose
|
|
164
178
|
payload = json.dumps(claims, sort_keys=True, separators=(',', ':')).encode()
|
|
165
179
|
signature = SigningKey(_decode(key['private_key'])).sign(payload).signature
|
|
166
180
|
return {'agent_id': agent_id, 'agent_name': agent.profile.display_name or agent.profile.name or agent_id,
|
|
Binary file
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fuli-context",
|
|
3
|
-
"version": "0.27.
|
|
3
|
+
"version": "0.27.3",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "fuli-context",
|
|
9
|
-
"version": "0.27.
|
|
9
|
+
"version": "0.27.3",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@agentclientprotocol/sdk": "1.5.0",
|
package/package.json
CHANGED
|
@@ -3,8 +3,13 @@ import { join } from 'node:path';
|
|
|
3
3
|
|
|
4
4
|
import { firstField, listDirectory } from '../session-log.js';
|
|
5
5
|
|
|
6
|
-
//
|
|
7
|
-
|
|
6
|
+
// A read-only wake has only the built-in tools that read. Whatever edits a file, runs a command
|
|
7
|
+
// (Bash, PowerShell), fetches from the web or starts another agent is not there; the edit and
|
|
8
|
+
// shell tools are denied as well, since a deny rule wins over any allow rule the person keeps.
|
|
9
|
+
// Tools of MCP servers the person configured are not built in: they still follow that person's
|
|
10
|
+
// own allow rules (docs/agent-roundtable.md).
|
|
11
|
+
const READ_ONLY_TOOLS = Object.freeze(['Read', 'Grep', 'Glob']);
|
|
12
|
+
const READ_ONLY_DENIED_TOOLS = Object.freeze(['Edit', 'Write', 'NotebookEdit', 'MultiEdit', 'Bash', 'PowerShell']);
|
|
8
13
|
|
|
9
14
|
// Wakes Claude Code headlessly. Resuming forks the session, so an open window is
|
|
10
15
|
// never written concurrently while the answer still has that conversation's context.
|
|
@@ -19,14 +24,14 @@ export const claudeCodeWake = Object.freeze({
|
|
|
19
24
|
// delegated wake names the (forked) session up front and binds it first.
|
|
20
25
|
plansSession: true,
|
|
21
26
|
|
|
22
|
-
// readOnly (a group discussion turn) keeps the
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
+
// readOnly (a group discussion turn, an ask from another computer) keeps the
|
|
28
|
+
// same non-interactive mode with the reading tools only, so the woken session
|
|
29
|
+
// can read and answer but not change files or run commands. (Plan mode is
|
|
30
|
+
// avoided: headless it may end with a plan or an empty answer instead of the
|
|
31
|
+
// member's view.)
|
|
27
32
|
args({ sessionId, plannedSessionId = null, readOnly = false }) {
|
|
28
33
|
return ['-p', '--output-format', 'stream-json', '--verbose', '--permission-mode', 'dontAsk',
|
|
29
|
-
...(readOnly ? ['--disallowedTools', READ_ONLY_DENIED_TOOLS.join(',')] : []),
|
|
34
|
+
...(readOnly ? ['--tools', READ_ONLY_TOOLS.join(','), '--disallowedTools', READ_ONLY_DENIED_TOOLS.join(',')] : []),
|
|
30
35
|
...(sessionId ? ['--resume', sessionId, '--fork-session'] : []),
|
|
31
36
|
...(plannedSessionId ? ['--session-id', plannedSessionId] : [])];
|
|
32
37
|
},
|
|
@@ -36,6 +36,9 @@
|
|
|
36
36
|
// { agent_id, proof }: signed origin for a cross-device ask or chat
|
|
37
37
|
// remoteOriginAuthority() public keys that verify those origins
|
|
38
38
|
// recordMemoryUsage(input) optional: { recorded, reason? }
|
|
39
|
+
// agentLooks() optional: the faces the person changed, [{ agentId, kind, seed? }];
|
|
40
|
+
// a 'generated' seed is shared with paired devices
|
|
41
|
+
// (LAN directory `look`), nothing else is
|
|
39
42
|
// projectFolder(projectId) optional: the project's known folder for fresh sessions
|
|
40
43
|
// folderRepository(path) optional: the normalised origin address of the Git
|
|
41
44
|
// repository holding path, or null (LAN share folder check)
|
|
@@ -47,6 +50,24 @@
|
|
|
47
50
|
// standInScope({ agentId, name, occupation, projectId, text, client, sessionId })
|
|
48
51
|
// optional: the Agent's shareable index for a session that
|
|
49
52
|
// stands in for it (stand-in.js); never its private memory
|
|
53
|
+
// searchSharedProject({ projectId, agentId, requester: { node, name, agentName }, query: { action: 'card' | 'search', queries? } })
|
|
54
|
+
// optional: a paired device's read-only look at one shared project
|
|
55
|
+
// (projectId and agentId from this device's share, never from the
|
|
56
|
+
// asker; node the asking device's verified fingerprint, name and
|
|
57
|
+
// agentName display text), every card and search rate limited and
|
|
58
|
+
// recorded by the host: card { ok: true, name, responsibility,
|
|
59
|
+
// projectName }, search { ok: true, results, truncated }, or
|
|
60
|
+
// { ok: false, code }; without it this device refuses every
|
|
61
|
+
// visitor query (query_unsupported)
|
|
62
|
+
// refuseSharedQuery({ requester: { node, name, agentName }, action, code })
|
|
63
|
+
// optional: records a visitor query this device refused before
|
|
64
|
+
// searchSharedProject (not shared, a wrong proof, a replay) once
|
|
65
|
+
// the asking device was proven, counted toward its limits
|
|
66
|
+
// redactDiagnostic(text) optional, sync: a failed wake's captured client output as it
|
|
67
|
+
// may be kept (paths, credentials, secrets removed); without
|
|
68
|
+
// it the output is dropped and only codes are kept
|
|
69
|
+
// recordWakeFailure({ client, sessionMode, code, detail, exitCode, signal, durationMs, remote })
|
|
70
|
+
// optional, sync, never throws: the host's diagnostics of a failed wake
|
|
50
71
|
// requestSignal() optional, sync: the current request's AbortSignal
|
|
51
72
|
// inRestrictedWorker() optional, sync: true inside a sealed worker run
|
|
52
73
|
export const ROUNDTABLE_HOST_METHODS = Object.freeze([
|
|
@@ -56,6 +56,7 @@ export async function runPeerControlCommand(args, { baseUrl, command, notRunning
|
|
|
56
56
|
if (!/^\d{6}$/.test(code)) throw new Error('Pass the 6-digit code shown on the other computer.');
|
|
57
57
|
const pairing = (await call('GET', '/api/peer')).nearby?.pairing;
|
|
58
58
|
if (!pairing?.requestId || pairing.state !== 'confirm') throw new Error('No pairing is waiting for confirmation here.');
|
|
59
|
+
if (pairing.coordinator === 'other') write(MEMBER_TRUST);
|
|
59
60
|
return printNearby(await call('POST', '/api/peer/nearby/confirm', { requestId: pairing.requestId, code }), write, command);
|
|
60
61
|
}
|
|
61
62
|
case 'cancel': return printNearby(await call('POST', '/api/peer/nearby/cancel', {}), write, command);
|
|
@@ -78,6 +79,7 @@ export async function runPeerControlCommand(args, { baseUrl, command, notRunning
|
|
|
78
79
|
if (!invitation) throw new Error('Pass --invitation or --invitation-file.');
|
|
79
80
|
// Joining is the consent to share the common projects' leads: said first, as the console does.
|
|
80
81
|
write(SHARE_ON_PAIRING);
|
|
82
|
+
write(MEMBER_TRUST);
|
|
81
83
|
return printStatus(await call('POST', '/api/peer/join', { invitation, name: option(rest, '--name') }), write);
|
|
82
84
|
}
|
|
83
85
|
case 'share': {
|
|
@@ -167,12 +169,14 @@ function printNearby(status, write, command) {
|
|
|
167
169
|
write(`Pairing with ${device}: code ${pairing.code}. ${pairing.coordinator === 'this' ? 'This computer' : 'The other computer'} will coordinate.`);
|
|
168
170
|
write(pairing.confirmedHere
|
|
169
171
|
? `Confirmed here; waiting for the person on the other computer${pairing.confirmedThere ? ' (confirmed there too, finishing)' : ''}. \`${command} peer status\` then lists what was shared.`
|
|
170
|
-
: `Compare it with the code on the other computer; if they match, run \`${command} peer confirm <the code shown there>\` before ${pairing.expiresAt}.\n${SHARE_ON_PAIRING}`);
|
|
172
|
+
: `Compare it with the code on the other computer; if they match, run \`${command} peer confirm <the code shown there>\` before ${pairing.expiresAt}.\n${SHARE_ON_PAIRING}${pairing.coordinator === 'other' ? `\n${MEMBER_TRUST}` : ''}`);
|
|
171
173
|
} else write(`Pairing with ${device}: ${pairing.state}${pairing.reason ? ` (${pairing.reason})` : ''}`);
|
|
172
174
|
}
|
|
173
175
|
|
|
174
176
|
// Said before the person confirms a pairing or joins with an invitation.
|
|
175
177
|
const SHARE_ON_PAIRING = 'Once confirmed, leads of up to 8 projects the other computer says it has too can talk. Nothing else.';
|
|
178
|
+
// Said to the side that will join another computer's group, when it consents.
|
|
179
|
+
const MEMBER_TRUST = 'The other computer relays messages and decides who else is in the group. Pair only if you trust it.';
|
|
176
180
|
|
|
177
181
|
// Why nearby pairing turned itself off, or what it last did.
|
|
178
182
|
const NEARBY_ENDED = {
|
|
@@ -8,8 +8,7 @@ const LOOPBACK = new Set(['127.0.0.1', '::1', '::ffff:127.0.0.1']);
|
|
|
8
8
|
export async function handlePeerControlRequest({ request, response, url, peer, readJson, sendJson, unavailableMessage }) {
|
|
9
9
|
if (!url.pathname.startsWith('/api/peer')) return false;
|
|
10
10
|
if (!peer) { sendJson(response, 404, { error: 'peer_unavailable', message: unavailableMessage }); return true; }
|
|
11
|
-
|
|
12
|
-
if (!LOOPBACK.has(request.socket?.remoteAddress) || !/^(127\.0\.0\.1|\[::1\])(:\d+)?$/.test(host)) {
|
|
11
|
+
if (!isLocalOwnerRequest(request)) {
|
|
13
12
|
sendJson(response, 403, { error: 'local_owner_only', message: 'LAN roundtable settings can only be changed on this computer' });
|
|
14
13
|
return true;
|
|
15
14
|
}
|
|
@@ -26,6 +25,13 @@ export async function handlePeerControlRequest({ request, response, url, peer, r
|
|
|
26
25
|
return true;
|
|
27
26
|
}
|
|
28
27
|
|
|
28
|
+
// A request from this computer's own loopback address naming a loopback Host:
|
|
29
|
+
// what every owner-only LAN roundtable page answers, including who visited it.
|
|
30
|
+
export function isLocalOwnerRequest(request) {
|
|
31
|
+
return LOOPBACK.has(request.socket?.remoteAddress)
|
|
32
|
+
&& /^(127\.0\.0\.1|\[::1\])(:\d+)?$/.test(String(request.headers?.host ?? ''));
|
|
33
|
+
}
|
|
34
|
+
|
|
29
35
|
async function route(request, url, peer, readJson) {
|
|
30
36
|
const { method } = request;
|
|
31
37
|
const { pathname } = url;
|
|
@@ -60,7 +66,8 @@ async function route(request, url, peer, readJson) {
|
|
|
60
66
|
if (pathname === '/api/peer/nearby/pair' && method === 'POST') return peer.pairNearby({ fingerprint: (await readJson(request)).fingerprint });
|
|
61
67
|
if (pathname === '/api/peer/nearby/confirm' && method === 'POST') {
|
|
62
68
|
const body = await readJson(request);
|
|
63
|
-
return peer.confirmPairing({ requestId: body.requestId, code: body.code
|
|
69
|
+
return peer.confirmPairing({ requestId: body.requestId, code: body.code,
|
|
70
|
+
...(body.fingerprint === undefined ? {} : { fingerprint: body.fingerprint }) });
|
|
64
71
|
}
|
|
65
72
|
if (pathname === '/api/peer/nearby/cancel' && method === 'POST') { await readJson(request); return peer.cancelPairing(); }
|
|
66
73
|
if (pathname === '/api/peer/nearby/attempts/clear' && method === 'POST') { await readJson(request); return peer.clearPairingAttempts(); }
|
|
@@ -4,10 +4,21 @@ import { certificateFingerprint, verifyDeviceSignature } from './device-identity
|
|
|
4
4
|
import { isAuthorityKey } from './origin-proof.js';
|
|
5
5
|
import { createCoordinatorChat } from './chat-coordinator.js';
|
|
6
6
|
import {
|
|
7
|
-
canonicalJson, encodeInvitation, PEER_LIMITS, PeerError, peerCleanup, pemToDer, publicDirectoryEntry,
|
|
8
|
-
graphemePrefix, RESULT_OUTCOMES, sha256Hex, TERMINAL_STATUSES, validateAssertion, withoutControls,
|
|
7
|
+
canonicalJson, encodeInvitation, PEER_LIMITS, PEER_QUERY_PROTOCOL, PeerError, peerCleanup, peerMessageKey, pemToDer, publicDirectoryEntry,
|
|
8
|
+
graphemePrefix, RESULT_OUTCOMES, sha256Hex, TERMINAL_STATUSES, validateAssertion, validateQuery, withoutControls,
|
|
9
9
|
} from './protocol.js';
|
|
10
10
|
|
|
11
|
+
// What the queue holds: messages that may wake a lead, and visitors' read-only
|
|
12
|
+
// queries, each with its own validation, per-device queue cap and answer size.
|
|
13
|
+
const KINDS = Object.freeze({
|
|
14
|
+
message: { validate: validateAssertion, queueCap: PEER_LIMITS.queuePerNode, replyBytes: Infinity },
|
|
15
|
+
query: { validate: validateQuery, queueCap: PEER_LIMITS.queryQueuePerNode, senderCap: PEER_LIMITS.queryQueuePerSender,
|
|
16
|
+
replyBytes: PEER_LIMITS.queryReplyBytes },
|
|
17
|
+
});
|
|
18
|
+
// Queries claimed in a row while a message waits, at most; then a message goes.
|
|
19
|
+
const QUERY_STREAK = 3;
|
|
20
|
+
const kindOf = (message) => (JSON.parse(message.assertion_json).protocol === PEER_QUERY_PROTOCOL ? KINDS.query : KINDS.message);
|
|
21
|
+
|
|
11
22
|
const ONLINE_MS = 90_000;
|
|
12
23
|
// last_seen_at only feeds the "online" flag of directory() and devices(); no trust,
|
|
13
24
|
// revocation or claim decision reads it. A connected device re-authenticates on every
|
|
@@ -33,6 +44,8 @@ export function createCoordinatorService({ store, identity, authority, name, clo
|
|
|
33
44
|
repositoryChanges = memoryRecord() }) {
|
|
34
45
|
const iso = (offsetMs = 0) => new Date(clock() + offsetMs).toISOString();
|
|
35
46
|
const pairingFailures = [];
|
|
47
|
+
// Per receiving device: how many queries were claimed in a row (claim order only, kept in memory).
|
|
48
|
+
const queryStreaks = new Map();
|
|
36
49
|
const repositories = new Map();
|
|
37
50
|
let repositoryKey = null;
|
|
38
51
|
rotateRepositoryKey();
|
|
@@ -151,7 +164,8 @@ export function createCoordinatorService({ store, identity, authority, name, clo
|
|
|
151
164
|
}
|
|
152
165
|
|
|
153
166
|
function submit(nodeId, { assertion, signature }) {
|
|
154
|
-
|
|
167
|
+
const kind = assertion?.protocol === PEER_QUERY_PROTOCOL ? KINDS.query : KINDS.message;
|
|
168
|
+
kind.validate(assertion, { now: clock() });
|
|
155
169
|
if (assertion.from.node !== nodeId) throw new PeerError('sender_mismatch', 'The message sender is not this device', 403);
|
|
156
170
|
const sender = store.node(nodeId);
|
|
157
171
|
if (!verifyDeviceSignature(sender.cert_pem, assertion, signature)) throw new PeerError('invalid_signature', 'The message signature is invalid', 403);
|
|
@@ -162,7 +176,7 @@ export function createCoordinatorService({ store, identity, authority, name, clo
|
|
|
162
176
|
if (!shared) throw new PeerError('agent_not_shared', 'That Agent is not shared by the receiving device', 404);
|
|
163
177
|
const assertionJson = canonicalJson(assertion);
|
|
164
178
|
return store.transaction(() => {
|
|
165
|
-
const key =
|
|
179
|
+
const key = peerMessageKey(nodeId, assertion.messageId);
|
|
166
180
|
const existing = store.message(key);
|
|
167
181
|
if (existing) {
|
|
168
182
|
if (existing.assertion_json !== assertionJson) {
|
|
@@ -171,7 +185,10 @@ export function createCoordinatorService({ store, identity, authority, name, clo
|
|
|
171
185
|
return statusView(existing);
|
|
172
186
|
}
|
|
173
187
|
chat.validateWake(assertion);
|
|
174
|
-
if (store.queuedCount(target.id) >=
|
|
188
|
+
if (store.queuedCount(target.id, assertion.protocol) >= kind.queueCap
|
|
189
|
+
|| (kind.senderCap && store.queuedCount(target.id, assertion.protocol, nodeId) >= kind.senderCap)) {
|
|
190
|
+
throw new PeerError('queue_full', 'The receiving device has too many waiting messages', 429);
|
|
191
|
+
}
|
|
175
192
|
store.insertMessage({ id: key, senderNode: nodeId, targetNode: target.id,
|
|
176
193
|
bindingId: assertion.to.bindingId, assertionJson, signature, expiresAt: assertion.expiresAt, at: iso() });
|
|
177
194
|
return statusView(store.message(key));
|
|
@@ -180,8 +197,10 @@ export function createCoordinatorService({ store, identity, authority, name, clo
|
|
|
180
197
|
|
|
181
198
|
function claim(nodeId) {
|
|
182
199
|
return store.transaction(() => {
|
|
183
|
-
|
|
200
|
+
// Queries first, but never more than QUERY_STREAK in a row while a message waits.
|
|
201
|
+
const next = store.nextQueued(nodeId, iso(), (queryStreaks.get(nodeId) ?? 0) >= QUERY_STREAK ? 'message' : 'query');
|
|
184
202
|
if (!next) return null;
|
|
203
|
+
queryStreaks.set(nodeId, kindOf(next) === KINDS.query ? (queryStreaks.get(nodeId) ?? 0) + 1 : 0);
|
|
185
204
|
try { chat.validateWake(JSON.parse(next.assertion_json)); }
|
|
186
205
|
catch (error) {
|
|
187
206
|
store.updateMessage(next.id, { status: 'failed', error: error.code ?? 'chat_wake_rejected' }, iso(), 'failed');
|
|
@@ -232,6 +251,9 @@ export function createCoordinatorService({ store, identity, authority, name, clo
|
|
|
232
251
|
}
|
|
233
252
|
return store.transaction(() => {
|
|
234
253
|
const message = currentAttempt(nodeId, messageId, attemptId);
|
|
254
|
+
if (outcome === 'answered' && Buffer.byteLength(reply) > kindOf(message).replyBytes) {
|
|
255
|
+
throw new PeerError('invalid_result', 'The answer is larger than this kind of ask allows');
|
|
256
|
+
}
|
|
235
257
|
if (TERMINAL_STATUSES.has(message.status) && message.status !== 'unknown') return statusView(message);
|
|
236
258
|
const detail = typeof error === 'string' ? error.slice(0, 120) : null;
|
|
237
259
|
if (outcome === 'never_started') {
|
|
@@ -260,7 +282,7 @@ export function createCoordinatorService({ store, identity, authority, name, clo
|
|
|
260
282
|
|
|
261
283
|
function addressed(nodeId, messageId) {
|
|
262
284
|
if (typeof messageId !== 'string' || messageId.length > 128) return null;
|
|
263
|
-
const sent = store.message(
|
|
285
|
+
const sent = store.message(peerMessageKey(nodeId, messageId));
|
|
264
286
|
if (sent) return sent;
|
|
265
287
|
const received = store.message(messageId);
|
|
266
288
|
return received?.target_node === nodeId ? received : null;
|
|
@@ -276,7 +298,7 @@ export function createCoordinatorService({ store, identity, authority, name, clo
|
|
|
276
298
|
|
|
277
299
|
function cancel(nodeId, { messageId }) {
|
|
278
300
|
return store.transaction(() => {
|
|
279
|
-
const message = typeof messageId === 'string' ? store.message(
|
|
301
|
+
const message = typeof messageId === 'string' ? store.message(peerMessageKey(nodeId, messageId)) : null;
|
|
280
302
|
if (!message) throw new PeerError('message_not_found', 'No such message sent by this device', 404);
|
|
281
303
|
if (message.status === 'queued') store.updateMessage(message.id, { status: 'cancelled', error: 'cancelled' }, iso(), 'cancelled');
|
|
282
304
|
else if (['claimed', 'running'].includes(message.status)) store.updateMessage(message.id, { cancel_requested: 1 }, iso(), 'cancel_requested');
|
|
@@ -343,11 +365,6 @@ function seenWithin(node, now, windowMs) {
|
|
|
343
365
|
return age >= 0 && age < windowMs;
|
|
344
366
|
}
|
|
345
367
|
|
|
346
|
-
// Message IDs are chosen by senders, so the coordinator keys them per sending device.
|
|
347
|
-
function messageKey(senderNode, messageId) {
|
|
348
|
-
return sha256Hex(`${senderNode}:${messageId}`);
|
|
349
|
-
}
|
|
350
|
-
|
|
351
368
|
function statusView(message) {
|
|
352
369
|
return { messageId: JSON.parse(message.assertion_json).messageId, status: message.status, reply: message.reply ?? null, error: message.error ?? null,
|
|
353
370
|
via: message.via ?? null, verified: message.verified === 1, updatedAt: message.updated_at,
|
|
@@ -91,13 +91,20 @@ export function createCoordinatorStore(path = ':memory:') {
|
|
|
91
91
|
event(row.at, { messageId: row.id, nodeId: row.senderNode, kind: 'queued' });
|
|
92
92
|
},
|
|
93
93
|
message: (id) => database.prepare('SELECT * FROM messages WHERE id = ?').get(id) ?? null,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
// Open messages of one protocol for one device, optionally from one sender:
|
|
95
|
+
// messages and queries have separate caps, and queries one per sender too.
|
|
96
|
+
queuedCount: (targetNode, protocol, senderNode = null) => database.prepare(
|
|
97
|
+
`SELECT count(*) AS count FROM messages WHERE target_node = ? AND status IN ('queued','claimed','running')
|
|
98
|
+
AND json_extract(assertion_json, '$.protocol') = ? AND (? IS NULL OR sender_node = ?)`)
|
|
99
|
+
.get(targetNode, protocol, senderNode, senderNode).count,
|
|
100
|
+
// The oldest waiting entry, of the kind first (query or message) when one of
|
|
101
|
+
// that kind waits; the coordinator decides which kind goes first.
|
|
102
|
+
nextQueued: (targetNode, at, first) => database.prepare(`SELECT q.* FROM messages q WHERE q.target_node = ? AND q.status = 'queued'
|
|
97
103
|
AND q.expires_at > ? AND q.cancel_requested = 0 AND (json_type(q.assertion_json,'$.chatWake') IS NULL OR NOT EXISTS (SELECT 1 FROM messages a
|
|
98
104
|
WHERE a.target_node=q.target_node AND json_extract(a.assertion_json,'$.to.agentId')=json_extract(q.assertion_json,'$.to.agentId')
|
|
99
105
|
AND (a.status IN ('claimed','running','unknown') OR a.cleanup_status='unconfirmed')))
|
|
100
|
-
ORDER BY q.
|
|
106
|
+
ORDER BY (json_extract(q.assertion_json, '$.protocol') = 'peer-query/1') = ? DESC, q.created_at LIMIT 1`)
|
|
107
|
+
.get(targetNode, at, first === 'query' ? 1 : 0) ?? null,
|
|
101
108
|
updateMessage(id, changes, at, kind, detail = null) {
|
|
102
109
|
const columns = Object.keys(changes);
|
|
103
110
|
database.prepare(`UPDATE messages SET ${columns.map((column) => `${column} = ?`).join(', ')}, updated_at = ? WHERE id = ?`)
|