fuli-context 0.27.1 → 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-BKyNoI0v.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-BfRjs1He.js → AgentHand-1yBhYv72.js} +1 -1
- package/dist/web/assets/{AgentManagement-qCpr876m.js → AgentManagement-D8jHUEWK.js} +2 -2
- package/dist/web/assets/{AgentMentionCopy-_pr-D8vX.js → AgentMentionCopy-BRxaxi6r.js} +1 -1
- package/dist/web/assets/{AgentName-CUuWNrzE.js → AgentName-CL8xix6s.js} +1 -1
- package/dist/web/assets/AgentProfilePage-BosYAypt.js +5 -0
- package/dist/web/assets/AgentServicesPage-BQHw7Cyx.js +1 -0
- package/dist/web/assets/{AppViewerPage-Ct46NPXP.js → AppViewerPage-CO5-dW38.js} +1 -1
- package/dist/web/assets/{BackToTop-DOlt-xjQ.js → BackToTop-dl4Y4CgO.js} +1 -1
- package/dist/web/assets/{BoardCardFieldsMenu-RFcx_CAs.js → BoardCardFieldsMenu-BBqsgCq8.js} +1 -1
- package/dist/web/assets/{BoardMoveMenu-GJ8lpuZY.js → BoardMoveMenu-Rys8yvXz.js} +1 -1
- package/dist/web/assets/{Breadcrumb-DTo6Zvtb.js → Breadcrumb-DXXN0moP.js} +1 -1
- package/dist/web/assets/{CaptureChangePage-DRgWyCRo.js → CaptureChangePage-lNiPS4XI.js} +1 -1
- package/dist/web/assets/{CopyFixPrompt-1UXH_ItZ.js → CopyFixPrompt-Cpve4rdS.js} +1 -1
- package/dist/web/assets/{DataFormatPage-CgFXfOW_.js → DataFormatPage-DpBIwY-n.js} +1 -1
- package/dist/web/assets/DebugTurnPage-DzJ07GMF.js +1 -0
- package/dist/web/assets/{DebugTurnsPage-BGKSH3n0.js → DebugTurnsPage-CNAeNt5i.js} +1 -1
- package/dist/web/assets/{DialogTitle-CIVSlKqQ.js → DialogTitle-D0EVi01-.js} +1 -1
- package/dist/web/assets/{EmployeeRedirectPage-8qPpnbyP.js → EmployeeRedirectPage-qlH0SVZY.js} +1 -1
- package/dist/web/assets/EmployeeScopeDialog-C4B724Jj.js +1 -0
- package/dist/web/assets/EmployeeWorkbench-BgpxZ_1F.js +4 -0
- package/dist/web/assets/{EmployeeWorkbench-Bp9pUkfS.css → EmployeeWorkbench-rhY970vW.css} +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-CaFdmezv.js → FlaGrowth-Ct4GbCJZ.js} +1 -1
- package/dist/web/assets/{FlaOccupationKit-CFoBUWGF.js → FlaOccupationKit-Cbx058JA.js} +1 -1
- package/dist/web/assets/{FlaTaskSheets-BShmW9R5.js → FlaTaskSheets-CoWj7Gw3.js} +1 -1
- package/dist/web/assets/FlasPage-BGrz_P1x.js +1 -0
- package/dist/web/assets/{FlasPage-H99IZ9M6.css → FlasPage-D3CcJcvN.css} +1 -1
- package/dist/web/assets/{GrowthLoading-CVBn4r4q.js → GrowthLoading-BHxVzIoM.js} +1 -1
- package/dist/web/assets/HowtoPage-DfHVIb8E.css +1 -0
- package/dist/web/assets/HowtoPage-Dx7xGKQi.js +1 -0
- package/dist/web/assets/{InboxPage-D9VIDrsL.js → InboxPage-ByZQpihN.js} +1 -1
- package/dist/web/assets/{KnowledgeDeleteButton-C01O4FSO.js → KnowledgeDeleteButton-dvslN7EO.js} +1 -1
- package/dist/web/assets/{KnowledgeHardDeleteSection-jqad3dJN.js → KnowledgeHardDeleteSection-DMARNrze.js} +1 -1
- package/dist/web/assets/KnowledgeItemEditPage-D7X3K-Fu.js +1 -0
- package/dist/web/assets/{KnowledgeItemSummaryCard-XbkYp7Dy.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-CY85DtmF.js +1 -0
- package/dist/web/assets/{KnowledgeWorkspace-CmzU6Vuh.js → KnowledgeWorkspace-D8Q8usZc.js} +3 -3
- package/dist/web/assets/{MeAvatar-D_LFqHrR.js → MeAvatar-WSCaLEJ1.js} +1 -1
- package/dist/web/assets/{MeLink-CeIxjFrm.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-BKrOFEMO.js → NewSessionPanel-DNYTQ0Lw.js} +1 -1
- package/dist/web/assets/{NotFoundPage-CdOCRj3P.js → NotFoundPage-BbnR0KYy.js} +1 -1
- package/dist/web/assets/NoticeRow-CcQ1J4wZ.js +1 -0
- package/dist/web/assets/{workbench-card-Dt0820yW.css → NoticeRow-DD-J76Yo.css} +1 -1
- package/dist/web/assets/OccupationsPage-DQGGceta.js +1 -0
- package/dist/web/assets/{PageOutline-VtLLW4kh.js → PageOutline-nKD_AvCJ.js} +1 -1
- package/dist/web/assets/PageStack-BMzrkyV4.css +1 -0
- package/dist/web/assets/PageStack-BVHOFq7x.js +1 -0
- package/dist/web/assets/PersonalProfilePage-Cm1NxyU0.js +1 -0
- package/dist/web/assets/PersonalProjectsPage-CgqC4u77.js +1 -0
- package/dist/web/assets/{PinIcon-DD3Un-hh.js → PinIcon-DxjWqB7x.js} +1 -1
- package/dist/web/assets/PopperContent-BkTZlJWP.js +1 -0
- package/dist/web/assets/{Presence-DqPb-1P1.js → Presence-DrSz_UA1.js} +1 -1
- package/dist/web/assets/{ProfileAuthorChip-Dm5GjcAt.js → ProfileAuthorChip-CN1ZYzKN.js} +1 -1
- package/dist/web/assets/ProjectAgentsPage-DMnRnXDT.js +5 -0
- package/dist/web/assets/{ProjectJudgmentPolicy-DVFV5Cai.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-Dvddk8pN.js +1 -0
- package/dist/web/assets/{RovingFocusItem-C_N843Nb.js → RovingFocusItem-Ck-FCX8l.js} +1 -1
- package/dist/web/assets/SessionMigrationPage-Chm5L6p4.js +1 -0
- package/dist/web/assets/{SessionRecordsPage-Dy203sP2.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-CASkC5pc.js → SharedJefaReportPage-DHD4As4b.js} +1 -1
- package/dist/web/assets/StatementCalendarPage-lkq1OrUT.js +1 -0
- package/dist/web/assets/StatementCalendarPage-t8pJI4G6.css +1 -0
- package/dist/web/assets/StatementRows-DS-_XbkC.js +1 -0
- package/dist/web/assets/StatementRows-TQ2i_uXU.css +1 -0
- package/dist/web/assets/{TagVocabularyPage-Bd57YcUL.js → TagVocabularyPage-ap97B1fd.js} +1 -1
- package/dist/web/assets/TaskBlockerClear-xmjIgmON.js +1 -0
- package/dist/web/assets/TaskBlockerNotice-D3awZbiX.js +1 -0
- package/dist/web/assets/{TaskReason-BxYwBDoB.js → TaskReason-Y_gLRUR4.js} +1 -1
- package/dist/web/assets/{TeamCard-cWYC5z07.js → TeamCard-C5BOBfgK.js} +1 -1
- package/dist/web/assets/TeamCardsWidget-jLieh7GV.js +1 -0
- package/dist/web/assets/{TeamIsland-BD5s-zFZ.js → TeamIsland-C2U6j6W0.js} +1 -1
- package/dist/web/assets/{Teleport-DhMmMHjy.js → Teleport-RJS88HRO.js} +1 -1
- package/dist/web/assets/{TextField-XakqTnVl.js → TextField-CwecNrfC.js} +1 -1
- package/dist/web/assets/TodayPage-EJ8SWFE0.css +1 -0
- package/dist/web/assets/TodayPage-wkVzpeI1.js +1 -0
- package/dist/web/assets/{TonborgDelegationSwitch-B59PUZBz.js → TonborgDelegationSwitch-C9jrfVCw.js} +1 -1
- package/dist/web/assets/{UiChip-BFdfq8Jm.js → UiChip-DLTDKZh9.js} +1 -1
- package/dist/web/assets/UiDialog-u4ZkP4DG.js +1 -0
- package/dist/web/assets/{UiDisclosure-G3MiGB7F.js → UiDisclosure-CKVkr79z.js} +1 -1
- package/dist/web/assets/{UiIcon--qI1_q89.js → UiIcon-D2DJw7hg.js} +1 -1
- package/dist/web/assets/UiSegmented-D6pLjXXW.js +1 -0
- package/dist/web/assets/{UiWeight-BRA-6EY_.js → UiWeight-BOEi9suT.js} +1 -1
- package/dist/web/assets/{VirtualDirectoryList-Dm07NMxq.js → VirtualDirectoryList-BX3eeyRo.js} +1 -1
- package/dist/web/assets/{VisuallyHidden-DIg8c_z2.js → VisuallyHidden-DjqI8CEj.js} +1 -1
- package/dist/web/assets/{VisuallyHiddenInput-rcWqHewS.js → VisuallyHiddenInput-Cc2Qp6aL.js} +1 -1
- package/dist/web/assets/WidgetSlot-7bCPwUl2.js +2 -0
- package/dist/web/assets/WorkbenchListPage-BKT03RRO.css +1 -0
- package/dist/web/assets/WorkbenchListPage-DlE6S2WC.js +1 -0
- package/dist/web/assets/_plugin-vue_export-helper-BXUcxlz4.js +9 -0
- package/dist/web/assets/{agent-apps-Svxh5tiY.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-CvATgFji.js → agent-pins-XtAvsJ8S.js} +1 -1
- package/dist/web/assets/{agent-roster-records-CsYjmaNn.js → agent-roster-records-DiZKG26q.js} +1 -1
- package/dist/web/assets/{agent-work-summary-BOeJ4JXc.js → agent-work-summary-CvHRy3NR.js} +1 -1
- package/dist/web/assets/{attach-closest-edge-DFoBNGBU.js → attach-closest-edge-De5463t-.js} +1 -1
- package/dist/web/assets/{attention-store-CHxXJTuF.js → attention-store-CWRvv8xT.js} +1 -1
- package/dist/web/assets/{badge-DqHf-RNw.js → badge-CyUHAZlb.js} +1 -1
- package/dist/web/assets/{button-CdYobu4m.js → button-DgFpUg62.js} +1 -1
- package/dist/web/assets/{card-8xZot-73.js → card-BG73LSt9.js} +1 -1
- package/dist/web/assets/{catalog-h6KbvKdB.js → catalog-KaWiF7K5.js} +1 -1
- package/dist/web/assets/{checkbox-DZ6CDZ8r.js → checkbox-DNX0E3Ym.js} +1 -1
- package/dist/web/assets/{client-DRnUmjCk.js → client-eeoB__-w.js} +1 -1
- package/dist/web/assets/{client-links-store-DQY0A5PC.js → client-links-store-C1T7b2HQ.js} +1 -1
- package/dist/web/assets/combobox-BG6YUVkp.js +1 -0
- package/dist/web/assets/{console-BF8ZU9dG.js → console-KA3Jxkr4.js} +1 -1
- package/dist/web/assets/conversation-launcher-settings-QWrAaAPe.js +1 -0
- package/dist/web/assets/copy-mention-BwT-8AqP.js +1 -0
- package/dist/web/assets/{dialog-Bg5NVU4Y.js → dialog-CPHmFum7.js} +1 -1
- package/dist/web/assets/{dist--2DWcoU9.js → dist-CTCo5IXd.js} +1 -1
- package/dist/web/assets/{dist-INkzWhVF.js → dist-e1tihV1g.js} +1 -1
- package/dist/web/assets/dropdown-menu-BScsuHhH.js +1 -0
- package/dist/web/assets/{field-7G2bSNl5.js → field-8F_Pt8vb.js} +1 -1
- package/dist/web/assets/{format-bytes-Jj3-0UhP.js → format-bytes-DkVJGLsS.js} +1 -1
- package/dist/web/assets/{hover-card-llxR7wrX.js → hover-card-Db-Mrxk6.js} +1 -1
- package/dist/web/assets/identity-wfQfyysH.js +1 -0
- package/dist/web/assets/{index-HRZACEmh.css → index-CHDkJLQR.css} +1 -1
- package/dist/web/assets/index-CRSH-FaE.js +24 -0
- package/dist/web/assets/{input-z5o2wIZC.js → input-DFTIPfkE.js} +1 -1
- package/dist/web/assets/{label-BtTrlS8e.js → label-BDet7nvg.js} +1 -1
- package/dist/web/assets/label-table-BVh638Sy.js +1 -0
- package/dist/web/assets/{model-CGfhtR6w.js → model-BwEuimI0.js} +1 -1
- package/dist/web/assets/{model-CCaA3vRN.js → model-Bzgg7OTO.js} +1 -1
- package/dist/web/assets/model-C7J0jC4U.js +1 -0
- package/dist/web/assets/{model-BD6AfoOR.js → model-D3j-Q4br.js} +1 -1
- package/dist/web/assets/{model-BMd98Yux.js → model-DFuUc43Z.js} +1 -1
- package/dist/web/assets/{model-BKg9fdsn.js → model-DGpMX2GY.js} +1 -1
- package/dist/web/assets/{model-Ejc2vysd.js → model-LXhsHZ_S.js} +1 -1
- package/dist/web/assets/{model-Bhyqm3my.js → model-WhGp0XZv.js} +1 -1
- package/dist/web/assets/motion-0KGuL0P9.js +1 -0
- package/dist/web/assets/{motion-pePEUhOt.js → motion-BhDwEDuX.js} +1 -1
- package/dist/web/assets/{motion-preference-DTwjqiJ8.js → motion-preference--VYomm-z.js} +1 -1
- package/dist/web/assets/{occupation-catalog-ByjQk0EY.js → occupation-catalog-D5SQWfUI.js} +1 -1
- package/dist/web/assets/{occupation-kits-Dg6UZqc1.js → occupation-kits-CrqixyUx.js} +1 -1
- package/dist/web/assets/{option-BIjYeAh2.js → option-C9CkqCvy.js} +1 -1
- package/dist/web/assets/{orchestration-filters-3AfjDoHQ.js → orchestration-filters-DTnWbCEm.js} +1 -1
- package/dist/web/assets/overview-data-BvW9uhT4.js +1 -0
- package/dist/web/assets/{page-refresh-BTqRX45n.js → page-refresh-GRJ3nMpT.js} +1 -1
- package/dist/web/assets/{page-title-B5RyNTPD.js → page-title-B9HNL7K4.js} +1 -1
- package/dist/web/assets/{person-profile-BzPwdtix.js → person-profile-Cng7edLa.js} +1 -1
- package/dist/web/assets/{popover-BsWyCEy5.js → popover-BgaSR8Zf.js} +1 -1
- package/dist/web/assets/popup-host-CFQVWMSj.js +1 -0
- package/dist/web/assets/preference-conflicts-WphCdbo6.js +1 -0
- package/dist/web/assets/{profile-model-TAsyybji.js → profile-model-B9K6ylO1.js} +1 -1
- package/dist/web/assets/{project-board-layout-BwyHItDc.js → project-board-layout-GxgeqkX4.js} +1 -1
- package/dist/web/assets/{project-capture-I8-7JwsK.js → project-capture-C6NQkcJw.js} +1 -1
- package/dist/web/assets/{project-origin-B_Ku288r.js → project-origin-DuSzjbhd.js} +1 -1
- package/dist/web/assets/{quick-edit-api-Cm-W3ZVP.js → quick-edit-api-BDFnInRp.js} +1 -1
- package/dist/web/assets/radio-group-D6RUfdDr.js +1 -0
- package/dist/web/assets/{review-api-Gwr5nP1B.js → review-api-D31JYGWJ.js} +1 -1
- package/dist/web/assets/{review-list-CNeXKjBw.js → review-list-Cvacm108.js} +1 -1
- package/dist/web/assets/{review-store-BaMwO51r.js → review-store-D7_Vfhh7.js} +1 -1
- package/dist/web/assets/{role-names-C-F0XIE1.js → role-names-DebBvCND.js} +1 -1
- package/dist/web/assets/{roundtable-live-CM4Cqw2v.js → roundtable-live-DfN7Sw9Q.js} +1 -1
- package/dist/web/assets/{runtime-dom.esm-bundler-tA5o2TEo.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-CEdCRTz9.js → session-launch-offers-BO40dDPk.js} +1 -1
- package/dist/web/assets/{settings-autosave-D3wBf_zN.js → settings-autosave-q7Wr9G3O.js} +1 -1
- package/dist/web/assets/settings-tabs-D7-3akvW.js +1 -0
- package/dist/web/assets/shared-report-j27wViAk.js +3 -0
- package/dist/web/assets/{source-adapters-BR-AAGhD.js → source-adapters-D3VpWZ6y.js} +1 -1
- package/dist/web/assets/{switch-BoOtTu6O.js → switch-ClI3aPV3.js} +1 -1
- package/dist/web/assets/tabs-BYpn35nj.js +1 -0
- package/dist/web/assets/{task-card-fields-BWlLtcKE.js → task-card-fields-CR_cHUml.js} +1 -1
- package/dist/web/assets/{task-evidence-DydhKn9x.js → task-evidence-D0XkNnb8.js} +1 -1
- package/dist/web/assets/{task-labels-BrNKooHK.js → task-labels-C6FR9pf_.js} +1 -1
- package/dist/web/assets/{task-reason-CvmaNQWE.js → task-reason-C2NjR8__.js} +1 -1
- package/dist/web/assets/{team-sheets-DkAuebg6.js → team-sheets-5rb7d8An.js} +1 -1
- package/dist/web/assets/{textarea-BQnuJ0v3.js → textarea-BW51g0FT.js} +1 -1
- package/dist/web/assets/ui-rJlFkhnh.js +1 -0
- package/dist/web/assets/{useAgentRecords-PysQYF4V.js → useAgentRecords-BDEGuChX.js} +1 -1
- package/dist/web/assets/{useAgentWorkSummary-DaNyOo2z.js → useAgentWorkSummary-B7fcYNAf.js} +1 -1
- package/dist/web/assets/{useApi-CROJJdhE-CgPyy2pi.js → useApi-CROJJdhE-CXkEmQ40.js} +1 -1
- package/dist/web/assets/{useClipboardCopy-Cf3GZrHC.js → useClipboardCopy-CLyPUkax.js} +1 -1
- package/dist/web/assets/useDirection-hD2Ki6e_.js +1 -0
- package/dist/web/assets/{useFocusReturn-uY18_eDg.js → useFocusReturn-BzZRnzjC.js} +1 -1
- package/dist/web/assets/{useForwardExpose-Ci_aBJDg.js → useForwardExpose-BFvXozfQ.js} +1 -1
- package/dist/web/assets/{useForwardPropsEmits-mGaDeNMp.js → useForwardPropsEmits-BQIBYWrX.js} +1 -1
- package/dist/web/assets/useForwardScopeId-DJpBz5AW.js +1 -0
- package/dist/web/assets/{useKnowledgeConfirm-PcqqgwNU.js → useKnowledgeConfirm-B7ljY3BE.js} +1 -1
- package/dist/web/assets/{useKnowledgeItemPeek-yjyrSFtf.js → useKnowledgeItemPeek-W54o0cXF.js} +1 -1
- package/dist/web/assets/{useMinimumLoadingDisplay-Bu6xyHby.js → useMinimumLoadingDisplay-i0As_nIh.js} +1 -1
- package/dist/web/assets/useNow-w9sbWus7.js +1 -0
- package/dist/web/assets/{usePageTools-DYi9x7HJ.js → usePageTools-ChjnsxqE.js} +1 -1
- package/dist/web/assets/usePrimitiveElement-tPtHrVAh.js +1 -0
- package/dist/web/assets/{useProjectAgentRoster-KPwWl2jE.js → useProjectAgentRoster-Cv-2h61l.js} +1 -1
- package/dist/web/assets/{useRoutePeek-BiHDBRKc.js → useRoutePeek-6T3XqFw1.js} +1 -1
- package/dist/web/assets/useTeamWork-rjEihEaF.js +1 -0
- package/dist/web/assets/{useTypeahead-D_Z5P9Xm.js → useTypeahead-BBlzBvAi.js} +1 -1
- package/dist/web/assets/{utils-CAAvfQSj.js → utils-Bhge2HAf.js} +1 -1
- package/dist/web/assets/{utils-D6RjkXrh.js → utils-DVo87S8o.js} +1 -1
- package/dist/web/assets/{verification-DoN2EFaZ.js → verification-BKmnZihv.js} +1 -1
- package/dist/web/assets/{version-DbJq2Cfv.js → version-BYqyCHiB.js} +1 -1
- package/dist/web/assets/{vue-router-BwoPnYha.js → vue-router-BJZE7CCr.js} +1 -1
- package/dist/web/index.html +77 -76
- package/docs/agent-roundtable.md +5 -3
- package/graph-provider/fuli_graph/app.py +4 -0
- 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/knowledge_statement.py +230 -0
- package/graph-provider/fuli_graph/knowledge_statement_days.py +109 -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 +35 -3
- package/packages/roundtable/src/peer/control.js +24 -5
- package/packages/roundtable/src/peer/coordinator-service.js +44 -21
- package/packages/roundtable/src/peer/coordinator-store.js +11 -4
- package/packages/roundtable/src/peer/lan-addresses.js +16 -1
- package/packages/roundtable/src/peer/nearby-discovery.js +105 -44
- 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/pairing-share.js +139 -0
- package/packages/roundtable/src/peer/peer-port.js +45 -7
- package/packages/roundtable/src/peer/peer-runtime.js +199 -46
- 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 +13 -3
- package/skills/operating-fuli/references/workflow-recipes.md +4 -3
- package/src/agent-apps/host-tools/catalog.js +3 -0
- package/src/agent-delegation/operation-log.js +15 -1
- package/src/agent-delegation/port.js +1 -2
- package/src/agent-peer/http.js +15 -1
- package/src/agent-roundtable/tools.js +8 -0
- package/src/agent-tools/graph-definitions.js +2 -0
- package/src/agent-tools/graph-handlers.js +2 -0
- package/src/agent-tools/interface-catalog.js +6 -4
- package/src/agent-tools/statement-definitions.js +18 -0
- 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 +9 -0
- package/src/graphiti/project-agent-task-sessions.js +49 -0
- package/src/graphiti/provider-client.js +8 -0
- package/src/graphiti/roundtable-host.js +53 -0
- package/src/graphiti/task-context-entry.js +10 -6
- package/src/http/api-router.js +4 -0
- package/src/http/graph-api-router.js +5 -2
- package/src/http/statement-api-router.js +27 -0
- package/src/http/visitor-access-api-router.js +37 -0
- package/src/judgment/store.js +9 -0
- package/src/knowledge-impressions/store.js +72 -9
- package/src/mcp/create-mcp-server.js +2 -0
- package/src/mcp/session-id.js +1 -1
- package/src/mcp/tool-annotations.js +4 -1
- package/src/notices/recent-notices.js +2 -1
- package/src/presence/windows-helper-pin.js +1 -1
- package/src/statement/agent-tool.js +29 -0
- package/src/statement/compounding-statement.js +134 -0
- 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.2.json +13 -0
- package/src/whats-new/lines/0.27.3.json +13 -0
- package/dist/web/assets/AboutSectionHeading-DjXpIV27.css +0 -1
- package/dist/web/assets/AboutSectionHeading-DwvCvoqO.js +0 -1
- package/dist/web/assets/AgentAppsPage-Cp2-sZXi.js +0 -1
- package/dist/web/assets/AgentAvatar-CDhU4m0T.js +0 -1
- package/dist/web/assets/AgentAvatar-DbsG1_BY.css +0 -1
- package/dist/web/assets/AgentProfilePage-DcOBhuHG.js +0 -5
- package/dist/web/assets/AgentServicesPage-CAL-JT1J.js +0 -1
- package/dist/web/assets/DebugTurnPage-B8YhpTPm.js +0 -1
- package/dist/web/assets/EmployeeScopeDialog-BZymZidB.js +0 -1
- package/dist/web/assets/EmployeeWorkbench-BnxEZCSS.js +0 -4
- package/dist/web/assets/FieldRoot-D6HtUgDA.js +0 -1
- package/dist/web/assets/FlasPage-DtkW-_9f.js +0 -1
- package/dist/web/assets/HowtoPage-B8f5J_An.js +0 -1
- package/dist/web/assets/HowtoPage-CrvMmT6K.css +0 -1
- package/dist/web/assets/KnowledgeItemEditPage-DV8TVpvf.js +0 -1
- package/dist/web/assets/KnowledgeOrganizerPage-C4G6JCmG.js +0 -1
- package/dist/web/assets/KnowledgePage-Afiw2Kxy.js +0 -1
- package/dist/web/assets/KnowledgePeek-DIcPS9WU.js +0 -1
- package/dist/web/assets/KnowledgeTurnReceiptPage-7ncXkxKd.js +0 -1
- package/dist/web/assets/MenuSeparator-yD3wld9s.js +0 -1
- package/dist/web/assets/ModelSettingsPage-BqClsFmC.js +0 -1
- package/dist/web/assets/NoticeRow-CQShZQtw.js +0 -1
- package/dist/web/assets/NoticeRow-ktVO_9Es.css +0 -1
- package/dist/web/assets/OccupationsPage-BrBus-nh.js +0 -1
- package/dist/web/assets/OverviewPage-Cq89Klha.js +0 -1
- package/dist/web/assets/OverviewPage-KVt4LcE-.css +0 -1
- package/dist/web/assets/PageColumns-CgIXTt4J.js +0 -1
- package/dist/web/assets/PageColumns-DEideeB7.css +0 -1
- package/dist/web/assets/PersonalProfilePage-C_dmUEuW.js +0 -1
- package/dist/web/assets/PersonalProjectsPage-CiCFHVt_.js +0 -1
- package/dist/web/assets/PopperContent-CCmt2yHl.js +0 -1
- package/dist/web/assets/ProjectAgentsPage-B5r0DKWL.js +0 -5
- package/dist/web/assets/RecentNotices-DYXEBfYm.js +0 -1
- package/dist/web/assets/RoundtablesPage-DlAXApKi.js +0 -13
- package/dist/web/assets/RovingFocusGroup-CI4aZr1z.js +0 -1
- package/dist/web/assets/SessionMigrationPage-CVKkTACn.js +0 -1
- package/dist/web/assets/SettingsPage-BcrAdXX7.js +0 -1
- package/dist/web/assets/SettingsPage-BlhCcwPn.css +0 -1
- package/dist/web/assets/TaskBlockerClear-DGaXP2ak.js +0 -1
- package/dist/web/assets/TaskBlockerNotice-8nogmPA-.js +0 -1
- package/dist/web/assets/TeamCardsWidget-BOf6oHOp.js +0 -1
- package/dist/web/assets/UiSegmented-CRJ06vHP.js +0 -1
- package/dist/web/assets/WidgetSlot-C5h--noP.js +0 -2
- package/dist/web/assets/WorkbenchListHead-D40-J4GT.js +0 -1
- package/dist/web/assets/WorkbenchListPage-BX6Z9gkB.css +0 -1
- package/dist/web/assets/WorkbenchListPage-CJUvq4Ac.js +0 -1
- package/dist/web/assets/_plugin-vue_export-helper-D9CtLGVz.js +0 -9
- package/dist/web/assets/agent-occupation-Dhoz7LjT.js +0 -1
- package/dist/web/assets/agent-workflows-BS4KlKFj.js +0 -1
- package/dist/web/assets/combobox-DE0HzdKP.js +0 -1
- package/dist/web/assets/conversation-launcher-settings-D4vYOpHN.js +0 -1
- package/dist/web/assets/copy-mention-Crs0NIJB.js +0 -1
- package/dist/web/assets/dropdown-menu-C5Kf9x2y.js +0 -1
- package/dist/web/assets/index-C2o_v2mq.js +0 -24
- package/dist/web/assets/label-table-CuTFbFd3.js +0 -1
- package/dist/web/assets/model-Bb0VtRJH.js +0 -1
- package/dist/web/assets/motion-Cw_hptY4.js +0 -1
- package/dist/web/assets/overview-data-BIeNATEJ.js +0 -1
- package/dist/web/assets/popup-host-DWJ1gygp.js +0 -1
- package/dist/web/assets/radio-group-DJ5np5d_.js +0 -1
- package/dist/web/assets/select-DJ7iyJ-X.js +0 -1
- package/dist/web/assets/settings-tabs-B9pCaEFP.js +0 -1
- package/dist/web/assets/shared-report-KyuP8oQk.js +0 -3
- package/dist/web/assets/tabs-D0TAS18R.js +0 -1
- package/dist/web/assets/ui-CJiEsCpv.js +0 -1
- package/dist/web/assets/useForwardScopeId-DYW8CZTp.js +0 -1
- package/dist/web/assets/usePrimitiveElement-DdC34jzt.js +0 -1
- package/dist/web/assets/useTeamPeople-Od3dDz6d.js +0 -1
- package/dist/web/assets/useTeamWork-CDKVZwYe.js +0 -1
|
@@ -2,19 +2,36 @@ import { setTimeout as delay } from 'node:timers/promises';
|
|
|
2
2
|
|
|
3
3
|
import { certificateFingerprint, verifyDeviceSignature } from './device-identity.js';
|
|
4
4
|
import { isAuthorityKey, verifyOriginProof } from './origin-proof.js';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
PEER_LIMITS, PEER_QUERY_PROTOCOL, PeerError, peerCleanup, peerMessageKey, validateAssertion, validateQuery,
|
|
7
|
+
} from './protocol.js';
|
|
8
|
+
import { answerPeerQuery, QUERY_REFUSED, queryCode, requesterLabel } from './query-answer.js';
|
|
9
|
+
import { outwardFailure } from '../roundtable/wake-failure.js';
|
|
10
|
+
import { REMOTE_WAKE_ATTEMPTS } from '../roundtable/wake-ladder.js';
|
|
6
11
|
|
|
7
12
|
const RETRY_MS = 5_000;
|
|
13
|
+
// A query lives at most a minute and its proof expires with it; past that the
|
|
14
|
+
// assertion is refused as expired before its device is proven, never recorded.
|
|
15
|
+
const REFUSAL_SKEW_MS = 60_000;
|
|
16
|
+
const REFUSALS_REMEMBERED = 2_000;
|
|
8
17
|
const STARTED_STATES = new Set(['starting', 'running', 'finished']);
|
|
18
|
+
// How each kind of claim is checked: a message may wake the shared lead under
|
|
19
|
+
// an execution proof; a query only reads, under a query proof.
|
|
20
|
+
const MESSAGE = Object.freeze({ validate: validateAssertion, purpose: 'execution', visitor: false });
|
|
21
|
+
const QUERY = Object.freeze({ validate: validateQuery, purpose: 'query', visitor: true });
|
|
9
22
|
|
|
10
23
|
// Receives asks for this device's shared project leads. Every claim is written
|
|
11
24
|
// down before it is accepted, nothing runs before the coordinator confirmed the
|
|
12
25
|
// acceptance, and an attempt that may have run is never reported as not started.
|
|
13
|
-
|
|
26
|
+
// pairedDevices(): on the coordinating computer, the fingerprints of its own
|
|
27
|
+
// active paired devices; null on a member, which cannot know the group.
|
|
28
|
+
export function createPeerRunner({ store, client, roundtable, host, nodeId, spaceId, pairedDevices = () => null,
|
|
14
29
|
clock = Date.now, retryMs = RETRY_MS, renewMs = PEER_LIMITS.renewSeconds * 1000, onError = () => {} }) {
|
|
15
30
|
const stopping = new AbortController();
|
|
16
31
|
const running = new Map();
|
|
17
32
|
const handlers = new Map();
|
|
33
|
+
const refusedQueries = new Map();
|
|
34
|
+
const background = new Set();
|
|
18
35
|
let loop = null;
|
|
19
36
|
|
|
20
37
|
function start() {
|
|
@@ -79,13 +96,22 @@ export function createPeerRunner({ store, client, roundtable, host, nodeId, spac
|
|
|
79
96
|
queue(messageId, attemptId, 'cancelled', { error: 'cancelled' });
|
|
80
97
|
return flush();
|
|
81
98
|
}
|
|
99
|
+
// A visitor's query is answered here from shared knowledge; it never reaches a wake.
|
|
100
|
+
const kind = claim.assertion?.protocol === PEER_QUERY_PROTOCOL ? QUERY : MESSAGE;
|
|
82
101
|
let authorized;
|
|
83
102
|
try {
|
|
84
|
-
authorized = authorize(claim);
|
|
103
|
+
authorized = authorize(claim, kind);
|
|
85
104
|
} catch (error) {
|
|
86
105
|
store.setAttemptState(messageId, attemptId, 'rejected', error.code ?? 'rejected');
|
|
87
|
-
|
|
88
|
-
|
|
106
|
+
// A query's sender learns one word whatever failed, on the same path: this
|
|
107
|
+
// computer keeps the real code and records it, once the sending device was
|
|
108
|
+
// proven, only after the answer went out.
|
|
109
|
+
queue(messageId, attemptId, 'failed', { error: kind === QUERY ? QUERY_REFUSED : error.code ?? 'rejected' });
|
|
110
|
+
const flushed = flush();
|
|
111
|
+
if (kind === QUERY && error.device && firstRefusal(claim, error.device)) {
|
|
112
|
+
inBackground(flushed.then(() => recordQueryRefusal(claim, error.device, error.code)));
|
|
113
|
+
}
|
|
114
|
+
return flushed;
|
|
89
115
|
}
|
|
90
116
|
if (stopping.signal.aborted) {
|
|
91
117
|
store.setAttemptState(messageId, attemptId, 'not_started', 'stopped');
|
|
@@ -93,33 +119,92 @@ export function createPeerRunner({ store, client, roundtable, host, nodeId, spac
|
|
|
93
119
|
return flush();
|
|
94
120
|
}
|
|
95
121
|
store.setAttemptState(messageId, attemptId, 'starting');
|
|
96
|
-
const outcome =
|
|
122
|
+
const outcome = kind === QUERY
|
|
123
|
+
? await answerPeerQuery({ host, share: authorized.share, assertion: claim.assertion, device: authorized.device,
|
|
124
|
+
deviceName: claim.sender.name })
|
|
125
|
+
: await supervise(claim, authorized, acceptedAt);
|
|
97
126
|
store.setAttemptState(messageId, attemptId, 'finished', outcome.outcome);
|
|
98
127
|
queue(messageId, attemptId, outcome.outcome, outcome);
|
|
99
128
|
return flush();
|
|
100
129
|
}
|
|
101
130
|
|
|
102
131
|
// Every check that decides whether this device may act, before any authority is issued.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
132
|
+
// A query is also tied to the coordinator's key for its assertion, so a claim
|
|
133
|
+
// cannot run one assertion under another ID, and needs a host that answers queries.
|
|
134
|
+
// device: the sending device's fingerprint, computed here from the certificate the
|
|
135
|
+
// coordinator holds from pairing; that certificate signed the assertion and the
|
|
136
|
+
// device's pinned origin authority signed its proof. Nothing the assertion says names it.
|
|
137
|
+
// A refusal after this proof carries the proven device (error.device).
|
|
138
|
+
function authorize(claim, kind) {
|
|
139
|
+
const device = provenSender(claim, kind);
|
|
140
|
+
try { return { ...permitted(claim, kind, device), device }; }
|
|
141
|
+
catch (error) { error.device = device; throw error; }
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// The sending device, proven: its certificate signed this assertion.
|
|
145
|
+
function provenSender({ assertion, signature, sender }, { validate }) {
|
|
146
|
+
validate(assertion, { now: clock() });
|
|
147
|
+
const device = sender ? certificateFingerprint(sender.certPem) : null;
|
|
148
|
+
if (!device || device !== sender.nodeId || assertion.from.node !== device) {
|
|
107
149
|
throw new PeerError('sender_mismatch', 'The message sender does not match its device', 403);
|
|
108
150
|
}
|
|
109
151
|
if (!verifyDeviceSignature(sender.certPem, assertion, signature)) throw new PeerError('invalid_signature', 'Invalid device signature', 403);
|
|
152
|
+
return device;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function permitted(claim, { purpose, visitor }, device) {
|
|
156
|
+
const { assertion, sender } = claim;
|
|
110
157
|
if (assertion.to.node !== nodeId) throw new PeerError('wrong_device', 'The message is for another device', 403);
|
|
158
|
+
if (visitor && claim.messageId !== peerMessageKey(sender.nodeId, assertion.messageId)) {
|
|
159
|
+
throw new PeerError('message_mismatch', 'The claim does not belong to this query', 403);
|
|
160
|
+
}
|
|
161
|
+
if (visitor && typeof host.searchSharedProject !== 'function') throw new PeerError('query_unsupported', 'This device does not answer queries', 403);
|
|
162
|
+
// The coordinating computer knows its group: only its own active paired devices ask.
|
|
163
|
+
const paired = visitor ? pairedDevices() : null;
|
|
164
|
+
if (paired && !paired.has(device)) throw new PeerError('device_not_paired', 'The sending device is not paired with this computer', 403);
|
|
111
165
|
const share = store.share(assertion.to.bindingId);
|
|
112
166
|
if (!share || share.communicationOnly || share.agentId !== assertion.to.agentId || share.spaceId !== spaceId()) {
|
|
113
167
|
throw new PeerError('agent_not_shared', 'That Agent is not shared on this device', 403);
|
|
114
168
|
}
|
|
115
169
|
const authority = pinnedAuthority(sender);
|
|
116
|
-
const origin = verifyOriginProof(assertion, authority, { now: clock() });
|
|
170
|
+
const origin = verifyOriginProof(assertion, authority, { now: clock(), purpose });
|
|
117
171
|
const earlier = store.attemptsFor(claim.messageId)
|
|
118
172
|
.filter((attempt) => attempt.attempt_id !== claim.attemptId && STARTED_STATES.has(attempt.state));
|
|
119
173
|
if (earlier.length) throw new PeerError('already_started', 'This message already started on this device', 409);
|
|
120
174
|
return { share, origin };
|
|
121
175
|
}
|
|
122
176
|
|
|
177
|
+
// Recorded and counted against the proven device, so a flood shows, with the
|
|
178
|
+
// project of the share the query named when this computer has that share.
|
|
179
|
+
async function recordQueryRefusal(claim, device, code) {
|
|
180
|
+
if (typeof host.refuseSharedQuery !== 'function') return;
|
|
181
|
+
const share = store.share(claim.assertion.to.bindingId);
|
|
182
|
+
await host.refuseSharedQuery({ action: claim.assertion.query.action, code: queryCode(code),
|
|
183
|
+
...(share?.spaceId === spaceId() ? { projectId: share.projectId } : {}),
|
|
184
|
+
requester: { node: device, name: requesterLabel(claim.sender.name, device), agentName: null } });
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// A refused query is remembered by its own key (the proven device and the
|
|
188
|
+
// assertion's ID) until it and its proof have expired, so replaying it under
|
|
189
|
+
// new attempt or claim IDs is refused again without being recorded or counted
|
|
190
|
+
// twice. In memory, at most REFUSALS_REMEMBERED entries (oldest out first);
|
|
191
|
+
// after a restart a replay inside that minute is recorded once more.
|
|
192
|
+
function firstRefusal(claim, device) {
|
|
193
|
+
const now = clock();
|
|
194
|
+
for (const [key, until] of refusedQueries) if (until <= now) refusedQueries.delete(key);
|
|
195
|
+
const key = peerMessageKey(device, claim.assertion.messageId);
|
|
196
|
+
if (refusedQueries.has(key)) return false;
|
|
197
|
+
refusedQueries.set(key, Date.parse(claim.assertion.expiresAt) + REFUSAL_SKEW_MS);
|
|
198
|
+
if (refusedQueries.size > REFUSALS_REMEMBERED) refusedQueries.delete(refusedQueries.keys().next().value);
|
|
199
|
+
return true;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// Work that follows an answer already sent: failures are logged like the runner's own.
|
|
203
|
+
function inBackground(work) {
|
|
204
|
+
const tracked = work.catch(onError).finally(() => background.delete(tracked));
|
|
205
|
+
background.add(tracked);
|
|
206
|
+
}
|
|
207
|
+
|
|
123
208
|
function pinnedAuthority(sender) {
|
|
124
209
|
const pinned = store.authority(sender.nodeId);
|
|
125
210
|
if (pinned) {
|
|
@@ -175,6 +260,7 @@ export function createPeerRunner({ store, client, roundtable, host, nodeId, spac
|
|
|
175
260
|
}
|
|
176
261
|
})();
|
|
177
262
|
running.set(messageId, { controller, share, stop });
|
|
263
|
+
let grants = 0;
|
|
178
264
|
try {
|
|
179
265
|
const answer = await roundtable.answerRemote({ claim, share, signal: controller.signal,
|
|
180
266
|
timeoutMs: PEER_LIMITS.executionSeconds * 1000,
|
|
@@ -184,6 +270,11 @@ export function createPeerRunner({ store, client, roundtable, host, nodeId, spac
|
|
|
184
270
|
void renew('running');
|
|
185
271
|
},
|
|
186
272
|
issueGrant: async (delivery, lifetime) => {
|
|
273
|
+
// Each wake of this attempt gets its own grant, under its own origin key
|
|
274
|
+
// (the attempt, then attempt.2 and attempt.3), and the Provider issues
|
|
275
|
+
// each key once: one claimed attempt can never hold more than
|
|
276
|
+
// REMOTE_WAKE_ATTEMPTS grants, even across a restart.
|
|
277
|
+
if (++grants > REMOTE_WAKE_ATTEMPTS) throw new PeerError('wake_limit', 'This ask already used its wakes', 409);
|
|
187
278
|
if (claim.assertion.chatWake) {
|
|
188
279
|
const current = await client.post('/peer/1/renew', { messageId, attemptId, state: 'starting' }, { signal: controller.signal });
|
|
189
280
|
if (current.cancel) throw new PeerError('cancelled', 'Chat membership or sharing was revoked', 499);
|
|
@@ -191,7 +282,8 @@ export function createPeerRunner({ store, client, roundtable, host, nodeId, spac
|
|
|
191
282
|
return host.issueRemoteDelegation({ projectId: share.projectId, agentId: share.agentId,
|
|
192
283
|
targetClient: delivery.client, targetSessionId: delivery.client === 'codex' ? delivery.sessionId : null,
|
|
193
284
|
lifetimeSeconds: Math.max(30, Math.min(900, Math.round(lifetime))),
|
|
194
|
-
originNode: claim.sender.nodeId, originMessageId: messageId,
|
|
285
|
+
originNode: claim.sender.nodeId, originMessageId: messageId,
|
|
286
|
+
originAttemptId: grants === 1 ? attemptId : `${attemptId}.${grants}` }); } });
|
|
195
287
|
if (controller.signal.aborted) throw new PeerError('cancelled', 'The delivery was stopped', 499);
|
|
196
288
|
return { outcome: 'answered', reply: answer.body, via: answer.via, verified: true };
|
|
197
289
|
} catch (error) {
|
|
@@ -200,7 +292,8 @@ export function createPeerRunner({ store, client, roundtable, host, nodeId, spac
|
|
|
200
292
|
const extra = cleanup ? { cleanup } : {};
|
|
201
293
|
if (reason === 'lease_lost') return { outcome: 'unknown', error: 'lease_lost', ...extra };
|
|
202
294
|
if (reason === 'cancelled' || reason === 'stopped' || error.code === 'cancelled') return { outcome: 'cancelled', error: reason ?? 'cancelled', ...extra };
|
|
203
|
-
|
|
295
|
+
// Only codes cross to the asker: never the client's output, a path or a session.
|
|
296
|
+
return { outcome: 'failed', error: outwardFailure(error), ...extra };
|
|
204
297
|
} finally {
|
|
205
298
|
controller.abort('finished');
|
|
206
299
|
clearTimeout(leaseTimer);
|
|
@@ -238,6 +331,7 @@ export function createPeerRunner({ store, client, roundtable, host, nodeId, spac
|
|
|
238
331
|
await loop?.catch(() => {});
|
|
239
332
|
await Promise.allSettled([...handlers.keys()]);
|
|
240
333
|
await flush();
|
|
334
|
+
await Promise.allSettled([...background]);
|
|
241
335
|
}
|
|
242
336
|
|
|
243
337
|
async function reconcileShares(validBindings = null) {
|
|
@@ -13,10 +13,12 @@ import { agentDiscoveryProfile, matchesAgentDiscovery } from './discovery.js';
|
|
|
13
13
|
import { CLIENT_LABELS, deliveryState } from './delivery-state.js';
|
|
14
14
|
|
|
15
15
|
import { RoundtableError } from '../errors.js';
|
|
16
|
+
import { visitView } from '../peer/query-answer.js';
|
|
16
17
|
import { assertRoundtableHost } from '../host.js';
|
|
17
18
|
import { nearNames } from './near-names.js';
|
|
18
19
|
import { WAKE_CLIENTS, resolveClientCommand, sessionTurnRunning, sessionWorkingDirectory, wakeAgent } from './wake.js';
|
|
19
|
-
import { createWakeLadder, standInAllowed } from './wake-ladder.js';
|
|
20
|
+
import { REMOTE_WAKE_ATTEMPTS, createWakeLadder, standInAllowed } from './wake-ladder.js';
|
|
21
|
+
import { outwardFailureView, wakeAttemptRecord } from './wake-failure.js';
|
|
20
22
|
import { enterStandIn, recordStandInReply, standInState } from './stand-in.js';
|
|
21
23
|
|
|
22
24
|
const THREAD_MESSAGE_LIMIT = 24;
|
|
@@ -25,6 +27,9 @@ const REMOTE_PENDING = new Set(['sent', 'queued', 'claimed', 'running']);
|
|
|
25
27
|
const REMOTE_FINAL = new Set(['answered', 'failed', 'cancelled', 'expired', 'unknown']);
|
|
26
28
|
// Claim refusals kept on the ask; a chat wait is the chat's own state, not the ask's.
|
|
27
29
|
const RECORDED_REFUSALS = new Set(['execution_claimed', 'cleanup_unconfirmed']);
|
|
30
|
+
// A later wake of a remote ask starts only with this much of its deadline left
|
|
31
|
+
// (the shortest grant lifetime the Provider issues).
|
|
32
|
+
const MIN_REMOTE_WAKE_MS = 30_000;
|
|
28
33
|
|
|
29
34
|
// Agents talk to each other directly: an ask wakes the recipient in its own
|
|
30
35
|
// client and returns its answer, or waits in its inbox for its next task.
|
|
@@ -190,8 +195,9 @@ export function createAgentRoundtable({ host, peer = null, openStore, wake = wak
|
|
|
190
195
|
ladder?.skip('new_session', { client: preferClient,
|
|
191
196
|
reason: permitted.includes(preferClient) ? 'client_unavailable' : 'client_not_allowed' });
|
|
192
197
|
}
|
|
198
|
+
// A share names its clients in the owner's order.
|
|
193
199
|
const freshClients = explicit ? [resumable.client]
|
|
194
|
-
: [...new Set([preferClient ?? resumable?.client, ...WAKE_CLIENTS])].filter((client) => allowed.includes(client));
|
|
200
|
+
: [...new Set([preferClient ?? resumable?.client, ...(clients ?? WAKE_CLIENTS)])].filter((client) => allowed.includes(client));
|
|
195
201
|
// A strict delivery only starts new sessions in a folder known for this project.
|
|
196
202
|
const strictFolder = strictCwd ? freshCwd ?? resumable?.cwd ?? await projectFolder(agent, projectId) : null;
|
|
197
203
|
if (strictCwd && !strictFolder) return resumable ? [resumable] : [];
|
|
@@ -213,27 +219,36 @@ export function createAgentRoundtable({ host, peer = null, openStore, wake = wak
|
|
|
213
219
|
|
|
214
220
|
// Tries each target until one answers as the restored Agent. The grant is the
|
|
215
221
|
// only authority the woken session receives and is revoked after every attempt.
|
|
216
|
-
|
|
222
|
+
// remote ({ deadline }): a paired device's ask wakes at most REMOTE_WAKE_ATTEMPTS
|
|
223
|
+
// times, all within its one execution deadline, and a refused grant ends it.
|
|
224
|
+
async function deliver({ ask, attempts, prompt, timeoutMs, issueGrant, signal, onSpawn, peerDepth, remote = null,
|
|
217
225
|
readOnly = false, ladder = null }) {
|
|
218
226
|
const unusable = new Set();
|
|
219
227
|
let failure = 'wake_failed';
|
|
228
|
+
let detail = null;
|
|
229
|
+
let woken = 0;
|
|
220
230
|
let cleanup = null;
|
|
221
231
|
for (const delivery of attempts) {
|
|
222
232
|
if (unusable.has(delivery.client)) continue;
|
|
223
|
-
if (signal?.aborted) { failure = 'cancelled'; break; }
|
|
233
|
+
if (signal?.aborted) { failure = 'cancelled'; detail = 'cancelled'; break; }
|
|
224
234
|
// Resuming in place would write into a turn that is still running.
|
|
225
235
|
if (delivery.busy) {
|
|
226
236
|
failure = 'session_busy';
|
|
237
|
+
detail = null;
|
|
227
238
|
ladder?.skip('resume', { client: delivery.client, session: delivery.sessionId, reason: failure });
|
|
228
239
|
continue;
|
|
229
240
|
}
|
|
241
|
+
const waitMs = remote ? Math.min(timeoutMs, remote.deadline - now()) : timeoutMs;
|
|
242
|
+
if (remote && woken && (woken >= REMOTE_WAKE_ATTEMPTS || waitMs < MIN_REMOTE_WAKE_MS)) break;
|
|
230
243
|
store.updateMessage(ask.id, { status: 'delivering', toClient: delivery.client, toSession: delivery.sessionId });
|
|
231
244
|
let answer;
|
|
232
245
|
let grant;
|
|
246
|
+
const startedAt = now();
|
|
233
247
|
try {
|
|
234
|
-
grant = await issueGrant(delivery,
|
|
248
|
+
grant = await issueGrant(delivery, waitMs / 1000);
|
|
249
|
+
woken += 1;
|
|
235
250
|
answer = await wake({ client: delivery.client, sessionId: delivery.sessionId, cwd: delivery.cwd,
|
|
236
|
-
timeoutMs, prompt, delegationToken: grant.token, peerDepth, signal, readOnly,
|
|
251
|
+
timeoutMs: waitMs, prompt, delegationToken: grant.token, peerDepth, signal, readOnly,
|
|
237
252
|
onSpawn: (pid) => { wakeClaims.recordSpawn(ask.id, pid); onSpawn?.(pid); },
|
|
238
253
|
onSession: session => host.sealDelegation({ token: grant.token, sessionId: session }) });
|
|
239
254
|
const verified = answer.sessionId && await host.verifyDelegation({ token: grant.token, sessionId: answer.sessionId });
|
|
@@ -242,7 +257,9 @@ export function createAgentRoundtable({ host, peer = null, openStore, wake = wak
|
|
|
242
257
|
store.recordMemoryResult(ask.id, verified.memoryResultCount ?? 0);
|
|
243
258
|
} catch (error) {
|
|
244
259
|
failure = attemptFailure(error);
|
|
260
|
+
detail = error.detail ?? null;
|
|
245
261
|
ladder?.attempt(delivery, 'failed', failure);
|
|
262
|
+
if (grant) recordWake(ask, delivery, { startedAt, remote, error });
|
|
246
263
|
// The team rules refused this Agent: no other channel or stand-in may reach it.
|
|
247
264
|
if (failure === 'not_permitted') break;
|
|
248
265
|
// A process that may still be running must not get a sibling on another channel.
|
|
@@ -256,19 +273,35 @@ export function createAgentRoundtable({ host, peer = null, openStore, wake = wak
|
|
|
256
273
|
if (['client_login_required', 'client_unavailable'].includes(failure)) unusable.add(delivery.client);
|
|
257
274
|
// A timeout already used the caller's wait; a cancellation ends the delivery.
|
|
258
275
|
if (failure === 'wake_timeout' || failure === 'cancelled') break;
|
|
259
|
-
//
|
|
260
|
-
//
|
|
261
|
-
if (
|
|
276
|
+
// Each wake of a remote ask is authorised as the first one was (its own
|
|
277
|
+
// grant from the owner's Provider); a refused grant ends the ask.
|
|
278
|
+
if (remote && !grant) break;
|
|
262
279
|
continue;
|
|
263
280
|
} finally {
|
|
264
281
|
// Even failed or timed-out attempts lose their authority. Expiry remains
|
|
265
282
|
// the fail-closed backstop if the Provider is temporarily unreachable.
|
|
266
283
|
if (grant?.token) await host.revokeDelegation({ token: grant.token }).catch(() => {});
|
|
267
284
|
}
|
|
285
|
+
recordWake(ask, delivery, { startedAt, remote });
|
|
268
286
|
ladder?.attempt(delivery, 'answered');
|
|
269
287
|
return { answer, delivery, via: `${delivery.client}:${delivery.sessionId ? 'resume' : 'new'}` };
|
|
270
288
|
}
|
|
271
|
-
throw Object.assign(new Error('No client answered'), { code: failure, ...(
|
|
289
|
+
throw Object.assign(new Error('No client answered'), { code: failure, ...(detail ? { detail } : {}),
|
|
290
|
+
...(remote ? { attempts: woken } : {}), ...(cleanup ? { cleanup } : {}) });
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// Each wake is kept where it ran, its output only as the host redacts it
|
|
294
|
+
// (wake-failure.js); a failure also reaches the host's diagnostics, without that output.
|
|
295
|
+
// The record is diagnostics: failing to keep it never changes what the ask answers.
|
|
296
|
+
function recordWake(ask, delivery, { startedAt, remote, error = null }) {
|
|
297
|
+
try {
|
|
298
|
+
const record = wakeAttemptRecord({ client: delivery.client, sessionId: delivery.sessionId, error,
|
|
299
|
+
durationMs: now() - startedAt, redact: host.redactDiagnostic });
|
|
300
|
+
store.wakeAttempts.record(ask.id, record);
|
|
301
|
+
if (!error || record.code === 'cancelled') return;
|
|
302
|
+
const { client, sessionMode, code, detail, exitCode, signal, durationMs } = record;
|
|
303
|
+
host.recordWakeFailure?.({ client, sessionMode, code, detail, exitCode, signal, durationMs, remote: Boolean(remote) });
|
|
304
|
+
} catch { /* the wake's own outcome stands */ }
|
|
272
305
|
}
|
|
273
306
|
|
|
274
307
|
// While an earlier wake of this Agent may still be running, no new one starts.
|
|
@@ -504,6 +537,24 @@ export function createAgentRoundtable({ host, peer = null, openStore, wake = wak
|
|
|
504
537
|
return handedOver(remoteView(applyRemote(ask.id, state)), 'message_agent');
|
|
505
538
|
}
|
|
506
539
|
|
|
540
|
+
// The visiting assistant: the current task's Agent reads a paired device's
|
|
541
|
+
// shared project with this client's own model. The other device answers from
|
|
542
|
+
// its shared knowledge and wakes nothing; message_agent is the path that wakes its lead.
|
|
543
|
+
async function visitSharedLead({ taskContextToken = null, sourceApplication, address, action, queries, signal }) {
|
|
544
|
+
if (!peer?.isRemoteAddress(address)) throw validation('Visit a paired device\'s lead by its peer:<device>:<binding> address from find_agents');
|
|
545
|
+
if (!VISIT_ACTIONS.has(action)) throw validation('action is card or search');
|
|
546
|
+
if (action === 'search' && (!Array.isArray(queries) || !queries.length || queries.length > 4
|
|
547
|
+
|| !queries.every((query) => typeof query === 'string' && query.trim() && query.length <= 200))) {
|
|
548
|
+
throw validation('search needs 1-4 focused queries of at most 200 characters');
|
|
549
|
+
}
|
|
550
|
+
const from = await sender({ taskContextToken, sourceApplication });
|
|
551
|
+
if (!from.agent || !from.projectId) throw validation('A visit must come from an active project task of a FULI Agent; pass taskContextToken');
|
|
552
|
+
const target = await peer.resolveRemote(address);
|
|
553
|
+
const answer = await peer.query(target, action === 'search' ? { action, queries } : { action }, { taskContextToken,
|
|
554
|
+
sourceApplication: from.client, from: { agentId: from.agent.agentId, name: label(from.agent) }, signal });
|
|
555
|
+
return visitView({ address: target.address, device: target.deviceName, action, answer });
|
|
556
|
+
}
|
|
557
|
+
|
|
507
558
|
function applyRemote(messageId, state) {
|
|
508
559
|
const ask = store.getMessage(messageId);
|
|
509
560
|
if (!ask || !state || !REMOTE_PENDING.has(ask.status)) return ask;
|
|
@@ -528,7 +579,7 @@ export function createAgentRoundtable({ host, peer = null, openStore, wake = wak
|
|
|
528
579
|
? store.messages(ask.thread_id).find((message) => message.in_reply_to === ask.id) : null;
|
|
529
580
|
return { status: ask.status === 'sent' ? 'queued' : ask.status, threadId: ask.thread_id, messageId: ask.id,
|
|
530
581
|
recipient: { agentId: ask.to_agent, name: ask.to_name }, remote: true,
|
|
531
|
-
...(reply ? { reply: reply.body, via: reply.via } : {}), ...(ask.error ?
|
|
582
|
+
...(reply ? { reply: reply.body, via: reply.via } : {}), ...(ask.error ? outwardFailureView(ask.error) : {}),
|
|
532
583
|
...cleanupView(storedCleanup(ask)),
|
|
533
584
|
...(REMOTE_FINAL.has(ask.status) ? {} : { guidance: 'The remote device has not answered yet. Check later with get_agent_message_status; it does not mean the work ran.' }),
|
|
534
585
|
...(ask.status === 'unknown' ? { guidance: 'The remote device lost track of this attempt; it may or may not have run. It is not retried automatically.' } : {}) };
|
|
@@ -576,8 +627,9 @@ export function createAgentRoundtable({ host, peer = null, openStore, wake = wak
|
|
|
576
627
|
}
|
|
577
628
|
const prompt = promptOverride ?? wakePrompt({ thread, ask, target, senderName: ask.from_name, senderClient: ask.from_client });
|
|
578
629
|
try {
|
|
630
|
+
// A paired device only asks: every client is woken read-only on this computer.
|
|
579
631
|
const { answer, delivery, via } = await deliver({ ask, attempts, prompt, timeoutMs, issueGrant, signal, onSpawn,
|
|
580
|
-
peerDepth: assertion.depth,
|
|
632
|
+
peerDepth: assertion.depth, readOnly: true, remote: { deadline: now() + timeoutMs } });
|
|
581
633
|
finishWake(ask);
|
|
582
634
|
store.updateMessage(ask.id, { status: 'answered', via });
|
|
583
635
|
store.appendMessage(thread.id, { id: idFactory(), kind: 'reply', body: answer.body, status: 'sent', inReplyTo: ask.id, via,
|
|
@@ -831,7 +883,7 @@ export function createAgentRoundtable({ host, peer = null, openStore, wake = wak
|
|
|
831
883
|
// conversations, who is subscribed and how each one receives a post.
|
|
832
884
|
const ownerThread = async ({ threadId }) => ({ ...thread({ threadId }), ...await person.view(threadId) });
|
|
833
885
|
return { ...chat, findAgents, messageAgent, readMessages, replyMessage, threads, thread, refreshRemote, taskEntryDelegation,
|
|
834
|
-
messageStatus, cancelMessage, answerRemote,
|
|
886
|
+
messageStatus, cancelMessage, answerRemote, visitSharedLead,
|
|
835
887
|
// The folder a fresh wake of this lead would use: its latest session in the project, else the host's.
|
|
836
888
|
knownProjectFolder: ({ agentId, projectId }) => projectFolder({ agentId }, projectId),
|
|
837
889
|
discuss: discussions.discuss,
|
|
@@ -842,7 +894,12 @@ export function createAgentRoundtable({ host, peer = null, openStore, wake = wak
|
|
|
842
894
|
groupDiscussionStatus: discussions.ownerStatus,
|
|
843
895
|
joinGroupDiscussion: discussions.ownerJoin,
|
|
844
896
|
groupDiscussionTurns: discussions.ownerSessionTurn,
|
|
845
|
-
|
|
897
|
+
// The owner also sees each wake this computer started for the ask and why it failed.
|
|
898
|
+
ownerMessageStatus: async ({ messageId }) => {
|
|
899
|
+
const ask = ownedAsk(messageId);
|
|
900
|
+
const wakeAttempts = store.wakeAttempts.forMessage(ask.id);
|
|
901
|
+
return { ...await statusOf(ask), ...(wakeAttempts.length ? { wakeAttempts } : {}) };
|
|
902
|
+
},
|
|
846
903
|
// Cancelling is not evidence that a possibly running process exited; any cleanup hold stays.
|
|
847
904
|
ownerCancelMessage: ({ messageId }) => cancelAsk(ownedAsk(messageId)),
|
|
848
905
|
pending: (agentId, projectId = undefined) => store.pendingFor(spaceId(), agentId)
|
|
@@ -915,6 +972,8 @@ function inboxGreeting(target) {
|
|
|
915
972
|
return `FULI 圆桌会把发给「${label(target)}」的消息排进这个对话。现在只需回复「好」。`;
|
|
916
973
|
}
|
|
917
974
|
|
|
975
|
+
const VISIT_ACTIONS = new Set(['card', 'search']);
|
|
976
|
+
|
|
918
977
|
function label(agent) {
|
|
919
978
|
return agent.profile.displayName || agent.profile.name || agent.agentId;
|
|
920
979
|
}
|
|
@@ -5,6 +5,7 @@ import { GROUP_DISCUSSION_JOIN_COLUMNS, GROUP_DISCUSSION_JOIN_TABLES, GROUP_DISC
|
|
|
5
5
|
createGroupDiscussionStore } from './group-discussion-store.js';
|
|
6
6
|
import { THREAD_SUBSCRIPTION_TABLES, createThreadSubscriptionStore } from './thread-subscriptions.js';
|
|
7
7
|
import { DESKTOP_INBOX_TABLES, createDesktopInboxStore } from './desktop-inbox-store.js';
|
|
8
|
+
import { WAKE_ATTEMPT_TABLES, createWakeAttemptStore } from './wake-attempt-store.js';
|
|
8
9
|
|
|
9
10
|
export const ROUNDTABLE_FORMAT = sqliteFormat({
|
|
10
11
|
store: 'roundtable',
|
|
@@ -66,6 +67,11 @@ export const ROUNDTABLE_FORMAT = sqliteFormat({
|
|
|
66
67
|
id: 'roundtable/9-group-discussion-joins', to: 9, kind: 'add-table', table: 'group_discussion_joins',
|
|
67
68
|
summary: 'members who joined a group discussion by code, and the client and model of each message',
|
|
68
69
|
create: GROUP_DISCUSSION_JOIN_TABLES
|
|
70
|
+
}, {
|
|
71
|
+
// Why a wake did not answer, kept where it ran (wake-attempt-store.js).
|
|
72
|
+
id: 'roundtable/10-wake-attempts', to: 10, kind: 'add-table', table: 'wake_attempts',
|
|
73
|
+
summary: 'each wake an ask started: client, resumed or new session, failure code, exit code and a redacted output summary',
|
|
74
|
+
create: WAKE_ATTEMPT_TABLES
|
|
69
75
|
}],
|
|
70
76
|
pragmas: 'PRAGMA journal_mode = WAL;'
|
|
71
77
|
});
|
|
@@ -81,6 +87,7 @@ export function createRoundtableStore(path = ':memory:', { clock = () => new Dat
|
|
|
81
87
|
const discussions = createGroupDiscussionStore(database, chat);
|
|
82
88
|
const subscriptions = createThreadSubscriptionStore(database, chat);
|
|
83
89
|
const desktopInboxes = createDesktopInboxStore(database);
|
|
90
|
+
const wakeAttempts = createWakeAttemptStore(database, now);
|
|
84
91
|
const transaction = (work) => {
|
|
85
92
|
database.exec('BEGIN IMMEDIATE');
|
|
86
93
|
let result;
|
|
@@ -96,6 +103,7 @@ export function createRoundtableStore(path = ':memory:', { clock = () => new Dat
|
|
|
96
103
|
discussions,
|
|
97
104
|
subscriptions,
|
|
98
105
|
desktopInboxes,
|
|
106
|
+
wakeAttempts,
|
|
99
107
|
transaction,
|
|
100
108
|
createThread({ id, spaceId, projectId = null, subject }) {
|
|
101
109
|
const at = now();
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Every wake an ask started on this computer and how it ended: the client, a
|
|
2
|
+
// resumed or new session, the failure code and its detail (wake-failure.js),
|
|
3
|
+
// exit code and signal, how long it ran, and a redacted, bounded summary of the
|
|
4
|
+
// client's output. Kept where the wake ran and never sent to another computer.
|
|
5
|
+
// Part of the roundtable store format (roundtable/10-wake-attempts).
|
|
6
|
+
export const WAKE_ATTEMPT_TABLES = `
|
|
7
|
+
CREATE TABLE IF NOT EXISTS wake_attempts (
|
|
8
|
+
message_id TEXT NOT NULL, attempt INTEGER NOT NULL, client TEXT NOT NULL, session_mode TEXT NOT NULL,
|
|
9
|
+
outcome TEXT NOT NULL, code TEXT, detail TEXT, exit_code INTEGER, signal TEXT, duration_ms INTEGER,
|
|
10
|
+
output_summary TEXT, created_at TEXT NOT NULL, PRIMARY KEY(message_id, attempt));
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
export function createWakeAttemptStore(db, now) {
|
|
14
|
+
return {
|
|
15
|
+
// The attempt number is the next one of this ask, decided in the insert itself.
|
|
16
|
+
record(messageId, { client, sessionMode, outcome, code, detail, exitCode, signal, durationMs, outputSummary }) {
|
|
17
|
+
db.prepare(`INSERT INTO wake_attempts(message_id, attempt, client, session_mode, outcome, code, detail,
|
|
18
|
+
exit_code, signal, duration_ms, output_summary, created_at)
|
|
19
|
+
SELECT ?, coalesce(max(attempt), 0) + 1, ?,?,?,?,?,?,?,?,?,? FROM wake_attempts WHERE message_id = ?`)
|
|
20
|
+
.run(messageId, client, sessionMode, outcome, code, detail, exitCode, signal, durationMs, outputSummary, now(), messageId);
|
|
21
|
+
},
|
|
22
|
+
forMessage: messageId => db.prepare(`SELECT attempt, client, session_mode AS sessionMode, outcome, code, detail,
|
|
23
|
+
exit_code AS exitCode, signal, duration_ms AS durationMs, output_summary AS outputSummary, created_at AS createdAt
|
|
24
|
+
FROM wake_attempts WHERE message_id = ? ORDER BY attempt`).all(messageId)
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// Why one wake did not answer, kept on the computer where it ran.
|
|
2
|
+
//
|
|
3
|
+
// A failed wake keeps its outward code (wake_failed, wake_timeout,
|
|
4
|
+
// client_unavailable, ...), which the ladder and older peers read, and adds a
|
|
5
|
+
// detail from this closed set. The client's own output stays local: it is kept
|
|
6
|
+
// only as a redacted, bounded summary in the roundtable store, and never
|
|
7
|
+
// crosses to another computer; only the detail code and the attempt count do.
|
|
8
|
+
|
|
9
|
+
const WAKE_FAILURE_DETAILS = Object.freeze([
|
|
10
|
+
'client_not_found', // no command for the client, or the OS could not find it
|
|
11
|
+
'spawn_error', // the OS refused to start it
|
|
12
|
+
'login_required', // the client said it is not logged in
|
|
13
|
+
'client_exit_nonzero', // it exited with a non-zero code or a signal
|
|
14
|
+
'no_final_answer', // it exited 0 without a complete final answer
|
|
15
|
+
'output_too_large', // it wrote more than a wake may read
|
|
16
|
+
'timed_out', // it did not answer within the wake's time
|
|
17
|
+
'cancelled' // the asker or the owner stopped it
|
|
18
|
+
]);
|
|
19
|
+
|
|
20
|
+
// The summary of a client's output that may be kept: already redacted, then bounded.
|
|
21
|
+
const SUMMARY_CHARS = 600;
|
|
22
|
+
const OUTWARD = /^([a-z_]{1,64})(?:;detail=([a-z_]{1,32}))?(?:;attempts=([1-9]))?$/;
|
|
23
|
+
// A bare code as older peers and coordinators send it. Anything else another computer put in
|
|
24
|
+
// the error text is not shown to the asking Agent.
|
|
25
|
+
const BARE_CODE = /^[A-Za-z0-9_.:-]{1,64}$/;
|
|
26
|
+
|
|
27
|
+
// A failure error the wake throws. output: the captured tails, never sent anywhere.
|
|
28
|
+
export function wakeFailure(code, detail, message, { exitCode = null, signal = null, output = null } = {}) {
|
|
29
|
+
return Object.assign(new Error(message), { code, detail, exitCode, signal, output });
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// The record kept for one wake attempt. redact: the host's redaction of text
|
|
33
|
+
// that leaves the process; without one, the client's output is dropped and
|
|
34
|
+
// only the codes, exit code and signal are kept.
|
|
35
|
+
export function wakeAttemptRecord({ client, sessionId, error = null, durationMs, redact = null }) {
|
|
36
|
+
const detail = WAKE_FAILURE_DETAILS.includes(error?.detail) ? error.detail : null;
|
|
37
|
+
let summary = null;
|
|
38
|
+
if (error && redact) {
|
|
39
|
+
try { summary = summaryOf([error.output?.stderr, error.output?.stdout], redact); } catch { summary = null; }
|
|
40
|
+
}
|
|
41
|
+
return { client, sessionMode: sessionId ? 'resumed' : 'new', outcome: error ? 'failed' : 'answered',
|
|
42
|
+
code: error ? error.code ?? 'wake_failed' : null, detail,
|
|
43
|
+
exitCode: Number.isSafeInteger(error?.exitCode) ? error.exitCode : null,
|
|
44
|
+
signal: typeof error?.signal === 'string' && /^SIG[A-Z0-9]{1,12}$/.test(error.signal) ? error.signal : null,
|
|
45
|
+
durationMs: Math.max(0, Math.round(durationMs)), outputSummary: summary };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// The end of each captured part, stderr first: a client's own error is its last lines.
|
|
49
|
+
// Each part is redacted whole before it is cut, so a cut never splits what redaction would remove.
|
|
50
|
+
function summaryOf(parts, redact) {
|
|
51
|
+
const kept = [];
|
|
52
|
+
let room = SUMMARY_CHARS;
|
|
53
|
+
for (const part of parts) {
|
|
54
|
+
if (!part || room <= 0) continue;
|
|
55
|
+
const text = String(redact(part)).slice(-room);
|
|
56
|
+
kept.push(text);
|
|
57
|
+
room -= text.length + 1;
|
|
58
|
+
}
|
|
59
|
+
return kept.join('\n') || null;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// What a paired device reports for an ask it could not answer: the code, the
|
|
63
|
+
// detail code and how many wakes it tried, in the one error string every
|
|
64
|
+
// coordinator already relays (an older asker shows it as it is).
|
|
65
|
+
export function outwardFailure({ code, detail = null, attempts = null }) {
|
|
66
|
+
return `${code ?? 'wake_failed'}${WAKE_FAILURE_DETAILS.includes(detail) ? `;detail=${detail}` : ''}`
|
|
67
|
+
+ `${Number.isSafeInteger(attempts) && attempts > 0 && attempts < 10 ? `;attempts=${attempts}` : ''}`;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// The asker's reading of that string: an unknown detail is dropped, a bare
|
|
71
|
+
// code an older peer sent stays the reason as it is, and free text reads as
|
|
72
|
+
// remote_error.
|
|
73
|
+
export function outwardFailureView(error) {
|
|
74
|
+
const [, reason, detail, attempts] = OUTWARD.exec(error) ?? [null, BARE_CODE.test(error) ? error : 'remote_error'];
|
|
75
|
+
return { reason, ...(WAKE_FAILURE_DETAILS.includes(detail) ? { detail } : {}),
|
|
76
|
+
...(attempts ? { attempts: Number(attempts) } : {}) };
|
|
77
|
+
}
|
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
|
|
10
10
|
const LADDER_TIERS = Object.freeze(['resume', 'new_session', 'stand_in']);
|
|
11
11
|
|
|
12
|
+
// A paired device's ask wakes at most this many times on the owner's computer
|
|
13
|
+
// (the latest session, a new one in its client, then the share's other
|
|
14
|
+
// clients), each with its own grant; no stand-in answers for a remote ask.
|
|
15
|
+
export const REMOTE_WAKE_ATTEMPTS = 3;
|
|
16
|
+
|
|
12
17
|
// Why a step did not answer, in words the person reads as they are.
|
|
13
18
|
const REASONS = {
|
|
14
19
|
no_previous_session: '没有可续接的历史会话',
|