fuli-context 0.27.0 → 0.27.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/web/assets/{AboutPage-Bp2Edkdg.js → AboutPage-BKyNoI0v.js} +1 -1
- package/dist/web/assets/{AboutSectionHeading-DFfY2f_Z.js → AboutSectionHeading-DwvCvoqO.js} +1 -1
- package/dist/web/assets/AgentAppsPage-Cp2-sZXi.js +1 -0
- package/dist/web/assets/{AgentAvatar-w-2A3nsJ.js → AgentAvatar-CDhU4m0T.js} +1 -1
- package/dist/web/assets/{AgentHand-BGGU49Jt.js → AgentHand-BfRjs1He.js} +1 -1
- package/dist/web/assets/{AgentManagement-MMGrwdD2.js → AgentManagement-qCpr876m.js} +1 -1
- package/dist/web/assets/{AgentMentionCopy-BAHZjubz.js → AgentMentionCopy-_pr-D8vX.js} +1 -1
- package/dist/web/assets/{AgentName-CXlsC-4o.js → AgentName-CUuWNrzE.js} +1 -1
- package/dist/web/assets/AgentProfilePage-DcOBhuHG.js +5 -0
- package/dist/web/assets/AgentServicesPage-CAL-JT1J.js +1 -0
- package/dist/web/assets/{AppViewerPage-6gWP6nAf.js → AppViewerPage-Ct46NPXP.js} +1 -1
- package/dist/web/assets/{BackToTop-Cs5_rV99.js → BackToTop-DOlt-xjQ.js} +1 -1
- package/dist/web/assets/{BoardCardFieldsMenu-CvFrsIgy.js → BoardCardFieldsMenu-RFcx_CAs.js} +1 -1
- package/dist/web/assets/{BoardMoveMenu-B5isxIcK.js → BoardMoveMenu-GJ8lpuZY.js} +1 -1
- package/dist/web/assets/Breadcrumb-DTo6Zvtb.js +1 -0
- package/dist/web/assets/{CaptureChangePage-Ca72_PHc.js → CaptureChangePage-DRgWyCRo.js} +1 -1
- package/dist/web/assets/{CopyFixPrompt-wGATZKOq.js → CopyFixPrompt-1UXH_ItZ.js} +1 -1
- package/dist/web/assets/DataFormatPage-CgFXfOW_.js +2 -0
- package/dist/web/assets/DebugTurnPage-B8YhpTPm.js +1 -0
- package/dist/web/assets/DebugTurnsPage-BGKSH3n0.js +1 -0
- package/dist/web/assets/{DialogTitle-HYzAHbGg.js → DialogTitle-CIVSlKqQ.js} +1 -1
- package/dist/web/assets/{EmployeeRedirectPage-C2SHpAEF.js → EmployeeRedirectPage-8qPpnbyP.js} +1 -1
- package/dist/web/assets/EmployeeScopeDialog-BZymZidB.js +1 -0
- package/dist/web/assets/{EmployeeWorkbench-CbRJhkJO.js → EmployeeWorkbench-BnxEZCSS.js} +1 -1
- package/dist/web/assets/FieldRoot-D6HtUgDA.js +1 -0
- package/dist/web/assets/{FlaGrowth-DGnUPN7D.js → FlaGrowth-CaFdmezv.js} +1 -1
- package/dist/web/assets/{FlaOccupationKit-DAJjSrmL.js → FlaOccupationKit-CFoBUWGF.js} +1 -1
- package/dist/web/assets/{FlaTaskSheets-DRLgfrVC.js → FlaTaskSheets-BShmW9R5.js} +1 -1
- package/dist/web/assets/FlasPage-DtkW-_9f.js +1 -0
- package/dist/web/assets/{GrowthLoading-NLj2W4jj.js → GrowthLoading-CVBn4r4q.js} +1 -1
- package/dist/web/assets/{HowtoPage-CkGRrKpf.js → HowtoPage-B8f5J_An.js} +1 -1
- package/dist/web/assets/InboxPage-D9VIDrsL.js +6 -0
- package/dist/web/assets/{KnowledgeDeleteButton-DaT-gTmm.js → KnowledgeDeleteButton-C01O4FSO.js} +1 -1
- package/dist/web/assets/{KnowledgeHardDeleteSection-C9d7DVLa.js → KnowledgeHardDeleteSection-jqad3dJN.js} +1 -1
- package/dist/web/assets/KnowledgeItemEditPage-DV8TVpvf.js +1 -0
- package/dist/web/assets/{KnowledgeItemSummaryCard-eLzjKvgN.js → KnowledgeItemSummaryCard-XbkYp7Dy.js} +1 -1
- package/dist/web/assets/KnowledgeOrganizerPage-C4G6JCmG.js +1 -0
- package/dist/web/assets/KnowledgePage-Afiw2Kxy.js +1 -0
- package/dist/web/assets/KnowledgePeek-DIcPS9WU.js +1 -0
- package/dist/web/assets/{KnowledgeTurnReceiptPage-Dne5NQ9q.js → KnowledgeTurnReceiptPage-7ncXkxKd.js} +1 -1
- package/dist/web/assets/{KnowledgeWorkspace-DDg3tUb3.css → KnowledgeWorkspace-Be2gUul5.css} +1 -1
- package/dist/web/assets/KnowledgeWorkspace-CmzU6Vuh.js +4 -0
- package/dist/web/assets/{MeAvatar-f6qxg9dN.js → MeAvatar-D_LFqHrR.js} +1 -1
- package/dist/web/assets/{MeLink-DTvFYaYE.js → MeLink-CeIxjFrm.js} +1 -1
- package/dist/web/assets/{MenuSeparator-CLmsZ9rj.js → MenuSeparator-yD3wld9s.js} +1 -1
- package/dist/web/assets/{ModelSettingsPage-B38R-kBZ.css → ModelSettingsPage-BZcyT7Vy.css} +1 -1
- package/dist/web/assets/ModelSettingsPage-BqClsFmC.js +1 -0
- package/dist/web/assets/{NewSessionPanel-9yINjwyx.js → NewSessionPanel-BKrOFEMO.js} +1 -1
- package/dist/web/assets/{NotFoundPage-CqevPz0_.js → NotFoundPage-CdOCRj3P.js} +1 -1
- package/dist/web/assets/{NoticeRow-D5MWTeBY.js → NoticeRow-CQShZQtw.js} +1 -1
- package/dist/web/assets/OccupationsPage-BrBus-nh.js +1 -0
- package/dist/web/assets/OverviewPage-Cq89Klha.js +1 -0
- package/dist/web/assets/{PageColumns-Df60nEzj.js → PageColumns-CgIXTt4J.js} +1 -1
- package/dist/web/assets/{PageOutline-HHUlu2x3.js → PageOutline-VtLLW4kh.js} +1 -1
- package/dist/web/assets/{PersonalProfilePage-DnjNX2xK.css → PersonalProfilePage-BE5q2bqc.css} +1 -1
- package/dist/web/assets/PersonalProfilePage-C_dmUEuW.js +1 -0
- package/dist/web/assets/PersonalProjectsPage-CiCFHVt_.js +1 -0
- package/dist/web/assets/{PinIcon-DP-9Iisk.js → PinIcon-DD3Un-hh.js} +1 -1
- package/dist/web/assets/{PopperContent-DWCMeKSL.js → PopperContent-CCmt2yHl.js} +1 -1
- package/dist/web/assets/{Presence-Ba3jqPYx.js → Presence-DqPb-1P1.js} +1 -1
- package/dist/web/assets/{ProfileAuthorChip-BKZJC_N2.js → ProfileAuthorChip-Dm5GjcAt.js} +1 -1
- package/dist/web/assets/ProjectAgentsPage-B5r0DKWL.js +5 -0
- package/dist/web/assets/{ProjectJudgmentPolicy-BJ5sVuFI.js → ProjectJudgmentPolicy-DVFV5Cai.js} +1 -1
- package/dist/web/assets/{RecentNotices-CDHGIky1.js → RecentNotices-DYXEBfYm.js} +1 -1
- package/dist/web/assets/{RoundtablesPage-D5Xc3yun.js → RoundtablesPage-DlAXApKi.js} +1 -1
- package/dist/web/assets/{RovingFocusGroup-DoGybG5V.js → RovingFocusGroup-CI4aZr1z.js} +1 -1
- package/dist/web/assets/{RovingFocusItem-B455TzUI.js → RovingFocusItem-C_N843Nb.js} +1 -1
- package/dist/web/assets/{SessionMigrationPage-BAzXqxxO.js → SessionMigrationPage-CVKkTACn.js} +1 -1
- package/dist/web/assets/{SessionRecordsPage-C6U5YGSt.js → SessionRecordsPage-Dy203sP2.js} +1 -1
- package/dist/web/assets/SettingsPage-BcrAdXX7.js +1 -0
- package/dist/web/assets/SettingsPage-BlhCcwPn.css +1 -0
- package/dist/web/assets/SharedJefaReportPage-CASkC5pc.js +1 -0
- package/dist/web/assets/{TagVocabularyPage-Brpr-Q-y.js → TagVocabularyPage-Bd57YcUL.js} +1 -1
- package/dist/web/assets/TaskBlockerClear-DGaXP2ak.js +1 -0
- package/dist/web/assets/{TaskBlockerNotice-POmS2neR.js → TaskBlockerNotice-8nogmPA-.js} +1 -1
- package/dist/web/assets/{TaskReason-RKKs4Kb5.js → TaskReason-BxYwBDoB.js} +1 -1
- package/dist/web/assets/{TeamCard-8hjo1h0x.js → TeamCard-cWYC5z07.js} +1 -1
- package/dist/web/assets/{TeamCardsWidget-DIHFUDrF.js → TeamCardsWidget-BOf6oHOp.js} +1 -1
- package/dist/web/assets/{TeamIsland-DdhEcVOZ.js → TeamIsland-BD5s-zFZ.js} +1 -1
- package/dist/web/assets/{Teleport-CukHuRhz.js → Teleport-DhMmMHjy.js} +1 -1
- package/dist/web/assets/{TextField-G2fJ4aFQ.js → TextField-XakqTnVl.js} +1 -1
- package/dist/web/assets/TonborgDelegationSwitch-B59PUZBz.js +1 -0
- package/dist/web/assets/TonborgDelegationSwitch-BFb1JkWe.css +1 -0
- package/dist/web/assets/{UiChip-BHEJVA6L.js → UiChip-BFdfq8Jm.js} +1 -1
- package/dist/web/assets/{UiDisclosure-B1pd8qXW.js → UiDisclosure-G3MiGB7F.js} +1 -1
- package/dist/web/assets/{UiIcon-K7OhYTSy.js → UiIcon--qI1_q89.js} +1 -1
- package/dist/web/assets/UiSegmented-CRJ06vHP.js +1 -0
- package/dist/web/assets/{UiWeight-eAw682rH.js → UiWeight-BRA-6EY_.js} +1 -1
- package/dist/web/assets/{VirtualDirectoryList-BGum1GZc.js → VirtualDirectoryList-Dm07NMxq.js} +1 -1
- package/dist/web/assets/{VisuallyHidden-Ck6D7rq-.js → VisuallyHidden-DIg8c_z2.js} +1 -1
- package/dist/web/assets/{VisuallyHiddenInput-DXWhIUlB.js → VisuallyHiddenInput-rcWqHewS.js} +1 -1
- package/dist/web/assets/WidgetSlot-C5h--noP.js +2 -0
- package/dist/web/assets/{WorkbenchListHead-CR_fDYYr.js → WorkbenchListHead-D40-J4GT.js} +1 -1
- package/dist/web/assets/WorkbenchListPage-CJUvq4Ac.js +1 -0
- package/dist/web/assets/_plugin-vue_export-helper-D9CtLGVz.js +9 -0
- package/dist/web/assets/{agent-apps-D0eG1aMx.js → agent-apps-Svxh5tiY.js} +1 -1
- package/dist/web/assets/agent-occupation-Dhoz7LjT.js +1 -0
- package/dist/web/assets/{agent-pins-OYjJQ38F.js → agent-pins-CvATgFji.js} +1 -1
- package/dist/web/assets/{agent-workflows-D3VeY6Yz.js → agent-workflows-BS4KlKFj.js} +1 -1
- package/dist/web/assets/{attach-closest-edge-C75rKXiz.js → attach-closest-edge-DFoBNGBU.js} +1 -1
- package/dist/web/assets/{attention-store-k4mPCefZ.js → attention-store-CHxXJTuF.js} +1 -1
- package/dist/web/assets/{badge-B2rll-68.js → badge-DqHf-RNw.js} +1 -1
- package/dist/web/assets/{button-q6JhonlL.js → button-CdYobu4m.js} +1 -1
- package/dist/web/assets/{card-CPQiMHSu.js → card-8xZot-73.js} +1 -1
- package/dist/web/assets/{catalog-CBPcEkXC.js → catalog-h6KbvKdB.js} +1 -1
- package/dist/web/assets/{checkbox-C67upxzl.js → checkbox-DZ6CDZ8r.js} +1 -1
- package/dist/web/assets/{client-KFFphxpK.js → client-DRnUmjCk.js} +1 -1
- package/dist/web/assets/{client-links-store-Cw9c8MWc.js → client-links-store-DQY0A5PC.js} +1 -1
- package/dist/web/assets/{combobox-yHRJ-zN-.js → combobox-DE0HzdKP.js} +1 -1
- package/dist/web/assets/{console-BCR2S3AF.js → console-BF8ZU9dG.js} +1 -1
- package/dist/web/assets/{conversation-launcher-settings-28CqC1Gn.js → conversation-launcher-settings-D4vYOpHN.js} +1 -1
- package/dist/web/assets/{copy-mention-C4Nos381.js → copy-mention-Crs0NIJB.js} +1 -1
- package/dist/web/assets/{dialog-Cjoy4nsv.js → dialog-Bg5NVU4Y.js} +1 -1
- package/dist/web/assets/{dist-CaVgk2QB.js → dist--2DWcoU9.js} +1 -1
- package/dist/web/assets/{dist-D73EXNtz.js → dist-INkzWhVF.js} +1 -1
- package/dist/web/assets/{dropdown-menu-Dto6hjoc.js → dropdown-menu-C5Kf9x2y.js} +1 -1
- package/dist/web/assets/{field-BaUOZtN5.js → field-7G2bSNl5.js} +1 -1
- package/dist/web/assets/{format-bytes-D5eCtdg1.js → format-bytes-Jj3-0UhP.js} +1 -1
- package/dist/web/assets/{hover-card-Bg0dulGq.js → hover-card-llxR7wrX.js} +1 -1
- package/dist/web/assets/index-C2o_v2mq.js +24 -0
- package/dist/web/assets/{input-Dxh25T4M.js → input-z5o2wIZC.js} +1 -1
- package/dist/web/assets/{label-CbrduZla.js → label-BtTrlS8e.js} +1 -1
- package/dist/web/assets/label-table-CuTFbFd3.js +1 -0
- package/dist/web/assets/{model-CWMP5GOL.js → model-BD6AfoOR.js} +1 -1
- package/dist/web/assets/{model-ZwOxwk2m.js → model-BKg9fdsn.js} +1 -1
- package/dist/web/assets/{model-Blk5Wgg2.js → model-BMd98Yux.js} +1 -1
- package/dist/web/assets/{model-DcsCYhXk.js → model-Bb0VtRJH.js} +1 -1
- package/dist/web/assets/{model--lR9icA_.js → model-Bhyqm3my.js} +1 -1
- package/dist/web/assets/{model-jC3F-J2F.js → model-CCaA3vRN.js} +1 -1
- package/dist/web/assets/{model-D4DkvMH-.js → model-CGfhtR6w.js} +1 -1
- package/dist/web/assets/{model-Bgh75q3j.js → model-Ejc2vysd.js} +1 -1
- package/dist/web/assets/{motion-_MepnmMC.js → motion-Cw_hptY4.js} +1 -1
- package/dist/web/assets/{motion-BL3lek9c.js → motion-pePEUhOt.js} +1 -1
- package/dist/web/assets/{motion-preference-D3UMHojT.js → motion-preference-DTwjqiJ8.js} +1 -1
- package/dist/web/assets/{occupation-catalog-BeJ2O9nm.js → occupation-catalog-ByjQk0EY.js} +1 -1
- package/dist/web/assets/{occupation-kits-Bkiu6MzD.js → occupation-kits-Dg6UZqc1.js} +1 -1
- package/dist/web/assets/{option-Crs2MA88.js → option-BIjYeAh2.js} +1 -1
- package/dist/web/assets/{page-refresh-Bz5r7A_Q.js → page-refresh-BTqRX45n.js} +1 -1
- package/dist/web/assets/{page-title-KYZApNys.js → page-title-B5RyNTPD.js} +1 -1
- package/dist/web/assets/{person-profile-mhLxWtq7.js → person-profile-BzPwdtix.js} +1 -1
- package/dist/web/assets/{popover-CMahoDLo.js → popover-BsWyCEy5.js} +1 -1
- package/dist/web/assets/popup-host-DWJ1gygp.js +1 -0
- package/dist/web/assets/{profile-model-DWutKuCZ.js → profile-model-TAsyybji.js} +1 -1
- package/dist/web/assets/{project-board-layout-CWMHQuUA.js → project-board-layout-BwyHItDc.js} +1 -1
- package/dist/web/assets/{project-capture-CebFSnn0.js → project-capture-I8-7JwsK.js} +1 -1
- package/dist/web/assets/{project-origin-BnUVE0be.js → project-origin-B_Ku288r.js} +1 -1
- package/dist/web/assets/{quick-edit-api-YwzoODMc.js → quick-edit-api-Cm-W3ZVP.js} +1 -1
- package/dist/web/assets/{radio-group-vRt8y8mF.js → radio-group-DJ5np5d_.js} +1 -1
- package/dist/web/assets/review-api-Gwr5nP1B.js +1 -0
- package/dist/web/assets/{review-list-_PN7ljSY.js → review-list-CNeXKjBw.js} +1 -1
- package/dist/web/assets/{review-store-CobX9No6.js → review-store-BaMwO51r.js} +1 -1
- package/dist/web/assets/{role-names-wD9l8uz5.js → role-names-C-F0XIE1.js} +1 -1
- package/dist/web/assets/{roundtable-live-Dm4Vwo75.js → roundtable-live-CM4Cqw2v.js} +1 -1
- package/dist/web/assets/{runtime-dom.esm-bundler-DzfwnSj8.js → runtime-dom.esm-bundler-tA5o2TEo.js} +1 -1
- package/dist/web/assets/{select-B9mVptgx.js → select-DJ7iyJ-X.js} +1 -1
- package/dist/web/assets/{session-launch-offers-C9UkoKUJ.js → session-launch-offers-CEdCRTz9.js} +1 -1
- package/dist/web/assets/{settings-autosave-L0zSXnBO.js → settings-autosave-D3wBf_zN.js} +1 -1
- package/dist/web/assets/settings-tabs-B9pCaEFP.js +1 -0
- package/dist/web/assets/shared-report-KyuP8oQk.js +3 -0
- package/dist/web/assets/{source-adapters-r-NIqO77.js → source-adapters-BR-AAGhD.js} +1 -1
- package/dist/web/assets/{switch-BCzrGc4W.js → switch-BoOtTu6O.js} +1 -1
- package/dist/web/assets/{tabs-CB38D8N0.js → tabs-D0TAS18R.js} +1 -1
- package/dist/web/assets/{task-card-fields-B1z1PmTT.js → task-card-fields-BWlLtcKE.js} +1 -1
- package/dist/web/assets/{task-labels-DTc5OuFF.js → task-labels-BrNKooHK.js} +1 -1
- package/dist/web/assets/{task-reason-CneTZWRv.js → task-reason-CvmaNQWE.js} +1 -1
- package/dist/web/assets/{team-sheets-CUt3Vp2s.js → team-sheets-DkAuebg6.js} +1 -1
- package/dist/web/assets/{textarea-DJ0ucCir.js → textarea-BQnuJ0v3.js} +1 -1
- package/dist/web/assets/ui-CJiEsCpv.js +1 -0
- package/dist/web/assets/ui-CgwSWg1F.css +1 -0
- package/dist/web/assets/{useAgentRecords-CwkwZy8H.js → useAgentRecords-PysQYF4V.js} +1 -1
- package/dist/web/assets/{useAgentWorkSummary-DoiCqME7.js → useAgentWorkSummary-DaNyOo2z.js} +1 -1
- package/dist/web/assets/{useApi-CROJJdhE-CenjhnR5.js → useApi-CROJJdhE-CgPyy2pi.js} +1 -1
- package/dist/web/assets/{useClipboardCopy-Ba86PzjA.js → useClipboardCopy-Cf3GZrHC.js} +1 -1
- package/dist/web/assets/{useFocusReturn-B0ErBkt_.js → useFocusReturn-uY18_eDg.js} +1 -1
- package/dist/web/assets/{useForwardExpose-DJ6fcpI2.js → useForwardExpose-Ci_aBJDg.js} +1 -1
- package/dist/web/assets/{useForwardPropsEmits-D1vvIUcB.js → useForwardPropsEmits-mGaDeNMp.js} +1 -1
- package/dist/web/assets/useForwardScopeId-DYW8CZTp.js +1 -0
- package/dist/web/assets/{useKnowledgeConfirm-781LUhoU.js → useKnowledgeConfirm-PcqqgwNU.js} +1 -1
- package/dist/web/assets/{useKnowledgeItemPeek-CnuCvJKQ.js → useKnowledgeItemPeek-yjyrSFtf.js} +1 -1
- package/dist/web/assets/{useMinimumLoadingDisplay-DCC9EfQ9.js → useMinimumLoadingDisplay-Bu6xyHby.js} +1 -1
- package/dist/web/assets/{usePageTools-BaB021q0.js → usePageTools-DYi9x7HJ.js} +1 -1
- package/dist/web/assets/usePrimitiveElement-DdC34jzt.js +1 -0
- package/dist/web/assets/{useProjectAgentRoster-M3wbWpS-.js → useProjectAgentRoster-KPwWl2jE.js} +1 -1
- package/dist/web/assets/{useRoutePeek-CYg5JyYt.js → useRoutePeek-BiHDBRKc.js} +1 -1
- package/dist/web/assets/useTeamPeople-Od3dDz6d.js +1 -0
- package/dist/web/assets/{useTeamWork-Dql3_qLV.js → useTeamWork-CDKVZwYe.js} +1 -1
- package/dist/web/assets/{useTypeahead-DYb5kVkH.js → useTypeahead-D_Z5P9Xm.js} +1 -1
- package/dist/web/assets/{utils-Cli0RsEd.js → utils-CAAvfQSj.js} +1 -1
- package/dist/web/assets/{utils-B7sUn8rD.js → utils-D6RjkXrh.js} +1 -1
- package/dist/web/assets/{verification-DY7kllTI.js → verification-DoN2EFaZ.js} +1 -1
- package/dist/web/assets/{version-CBgUEmnM.js → version-DbJq2Cfv.js} +1 -1
- package/dist/web/assets/{vue-router-ab7kABlJ.js → vue-router-BwoPnYha.js} +1 -1
- package/dist/web/index.html +74 -77
- package/docs/agent-roundtable.md +45 -3
- package/docs/judgment-and-autonomy.md +2 -0
- package/graph-provider/fuli_graph/app.py +2 -0
- package/graph-provider/fuli_graph/knowledge_duplicates.py +27 -14
- package/graph-provider/fuli_graph/knowledge_search.py +31 -32
- package/graph-provider/fuli_graph/knowledge_semantic.py +38 -11
- package/graph-provider/fuli_graph/models.py +15 -0
- package/graph-provider/fuli_graph/preference_organizing.py +162 -0
- package/graph-provider/fuli_graph/project_agent_routes.py +22 -0
- package/graph-provider/fuli_graph/project_agent_task_models.py +26 -2
- package/graph-provider/fuli_graph/store_project_agent_task_activity.py +51 -11
- package/graph-provider/fuli_graph/store_project_agent_task_blockers.py +13 -6
- package/graph-provider/fuli_graph/store_project_agent_task_person_close.py +82 -0
- package/graph-provider/fuli_graph/store_project_agent_tasks.py +18 -1
- package/graph-provider/fuli_graph/task_blocker.py +10 -0
- package/graph-provider/pyproject.toml +1 -1
- package/native/win32/fuli-win-helper.exe +0 -0
- package/npm-shrinkwrap.json +57 -9
- package/package.json +4 -3
- package/packages/roundtable/package.json +1 -0
- package/packages/roundtable/src/agents/claude-code/wake.js +4 -2
- package/packages/roundtable/src/agents/codex/wake.js +1 -0
- package/packages/roundtable/src/host.js +4 -1
- package/packages/roundtable/src/peer/control-cli.js +75 -2
- package/packages/roundtable/src/peer/control.js +15 -1
- package/packages/roundtable/src/peer/coordinator-http.js +23 -2
- package/packages/roundtable/src/peer/coordinator-service.js +81 -9
- package/packages/roundtable/src/peer/coordinator-store.js +2 -1
- package/packages/roundtable/src/peer/lan-addresses.js +28 -0
- package/packages/roundtable/src/peer/nearby-attempts.js +73 -0
- package/packages/roundtable/src/peer/nearby-discovery.js +71 -0
- package/packages/roundtable/src/peer/nearby-pairing.js +422 -0
- package/packages/roundtable/src/peer/nearby-presence.js +93 -0
- package/packages/roundtable/src/peer/node-store.js +10 -0
- package/packages/roundtable/src/peer/peer-runtime.js +528 -70
- package/packages/roundtable/src/peer/peer-transport.js +58 -3
- package/packages/roundtable/src/peer/protocol.js +24 -1
- package/packages/roundtable/src/roundtable/chat-service.js +14 -3
- package/packages/roundtable/src/roundtable/chat.js +1 -0
- package/packages/roundtable/src/roundtable/delivery-state.js +2 -1
- package/packages/roundtable/src/roundtable/group-discussion-store.js +130 -5
- package/packages/roundtable/src/roundtable/group-discussion.js +596 -111
- package/packages/roundtable/src/roundtable/service.js +10 -2
- package/packages/roundtable/src/roundtable/store.js +11 -1
- package/packages/roundtable/src/roundtable/wake.js +3 -1
- package/packages/roundtable/src/standalone/cli.js +1 -1
- package/skills/capturing-session-knowledge/SKILL.md +1 -1
- package/skills/capturing-session-knowledge/references/coordination.md +28 -4
- package/skills/grilling-project/references/project-profile.md +13 -5
- package/skills/operating-fuli/SKILL.md +22 -5
- package/skills/operating-fuli/references/workflow-recipes.md +5 -2
- package/src/agent-delegation/port.js +1 -1
- package/src/agent-delegation/refusals.js +12 -4
- package/src/agent-roundtable/task-context.js +1 -1
- package/src/agent-roundtable/tools.js +5 -2
- package/src/agent-tools/graph-handlers.js +4 -3
- package/src/agent-tools/interface-catalog.js +10 -1
- package/src/agent-tools/interface-definitions.js +3 -2
- package/src/agent-tools/project-agent-definitions.js +2 -1
- package/src/agent-tools/project-organizing-definitions.js +7 -4
- package/src/agent-tools/project-space-definitions.js +2 -0
- package/src/agent-tools/session-fuli-gate.js +6 -1
- package/src/agents/codex/lifecycle-hook.js +3 -1
- package/src/agents/identity-receipt.js +3 -1
- package/src/agents/native-session-env.js +7 -0
- package/src/conversations/entry-budget.js +3 -2
- package/src/conversations/entry-inline-budget.js +40 -10
- package/src/conversations/preference-lifecycle.js +3 -3
- package/src/conversations/turn-findings.js +9 -2
- package/src/graphiti/agent-project-resolution.js +18 -0
- package/src/graphiti/collaboration-preference-entry.js +5 -2
- package/src/graphiti/current-project-knowledge-search.js +3 -3
- package/src/graphiti/fla-mention.js +48 -9
- package/src/graphiti/project-agent-task-summaries.js +82 -0
- package/src/graphiti/project-agent-workflows.js +8 -5
- package/src/graphiti/project-path-context.js +23 -9
- package/src/graphiti/provider-client.js +15 -1
- package/src/graphiti/repository-remote.js +34 -8
- package/src/graphiti/roundtable-host.js +9 -1
- package/src/graphiti/task-context-entry.js +4 -1
- package/src/graphiti/task-entry-group-discussion.js +111 -25
- package/src/graphiti/task-entry-owner-change.js +22 -2
- package/src/graphiti/task-entry-preferences.js +9 -4
- package/src/graphiti/task-entry-project-scope.js +19 -0
- package/src/graphiti/task-preference-pages.js +3 -3
- package/src/graphiti/task-preference-reader.js +44 -9
- package/src/graphiti/worker-task-context.js +1 -1
- package/src/http/api-router.js +3 -0
- package/src/http/task-blocker-api-router.js +11 -1
- package/src/http/task-close-api-router.js +59 -0
- package/src/judgment/engine.js +6 -1
- package/src/judgment/http.js +2 -2
- package/src/judgment/review-delegation.js +16 -4
- package/src/judgment/review-egress.js +25 -0
- package/src/judgment/service.js +1 -1
- package/src/mcp/create-mcp-server.js +2 -2
- package/src/mcp/direct-call.js +3 -2
- package/src/mcp/preference-delivery.js +64 -6
- package/src/mcp/session-id.js +12 -4
- package/src/mcp/tool-result.js +8 -6
- package/src/model-backends/config.js +7 -0
- package/src/model-backends/egress.js +8 -0
- package/src/model-backends/failures.js +8 -0
- package/src/model-backends/port.js +39 -16
- package/src/model-backends/role-trust.js +3 -9
- package/src/model-backends/usage-ledger.js +20 -9
- package/src/presence/windows-helper-pin.js +1 -1
- package/src/project-organizing/agent-tool.js +34 -7
- package/src/server.js +7 -0
- package/src/task-blockers/agent-resume.js +73 -0
- package/src/task-blockers/console-port.js +5 -2
- package/src/task-blockers/resume-status.js +2 -0
- package/src/task-closing/console-port.js +26 -0
- package/src/whats-new/lines/0.27.1.json +13 -0
- package/dist/web/assets/AgentAppsPage-CjyvPZSs.js +0 -1
- package/dist/web/assets/AgentProfilePage-eDKbJJwY.js +0 -5
- package/dist/web/assets/AgentServicesPage-CZwsN5U2.js +0 -1
- package/dist/web/assets/Breadcrumb-BXTA4e-W.js +0 -1
- package/dist/web/assets/DataFormatPage-CQKkFhcH.js +0 -2
- package/dist/web/assets/DebugTurnPage-CUqbuhgX.js +0 -1
- package/dist/web/assets/DebugTurnsPage-HwaTG8Fa.js +0 -1
- package/dist/web/assets/EmployeeScopeDialog-yUCgujKT.js +0 -1
- package/dist/web/assets/FieldRoot-BLcsuPMA.js +0 -1
- package/dist/web/assets/FlasPage-CMv2awKJ.js +0 -1
- package/dist/web/assets/InboxPage-DfQvtnyq.js +0 -6
- package/dist/web/assets/KnowledgeItemEditPage-BUKQK37o.js +0 -1
- package/dist/web/assets/KnowledgeOrganizerPage-CiZ9JlNX.js +0 -1
- package/dist/web/assets/KnowledgePage-C3_Cvz4g.js +0 -1
- package/dist/web/assets/KnowledgePeek-DtOOiARX.js +0 -1
- package/dist/web/assets/KnowledgeWorkspace-Cq_XYcma.js +0 -4
- package/dist/web/assets/ModelSettingsPage-COVaW4eh.js +0 -1
- package/dist/web/assets/OccupationsPage-BKd051j1.js +0 -1
- package/dist/web/assets/OverviewPage-C90G_adj.js +0 -1
- package/dist/web/assets/PersonalProfilePage-DIDgG3NH.js +0 -1
- package/dist/web/assets/PersonalProjectsPage-DwhlEpNg.js +0 -1
- package/dist/web/assets/ProjectAgentsPage-BefVF9ZP.js +0 -5
- package/dist/web/assets/SettingsPage-7mNL3bwe.js +0 -1
- package/dist/web/assets/SettingsPage-Cku8SoLk.css +0 -1
- package/dist/web/assets/SharedJefaReportPage-rH6I4cI9.js +0 -1
- package/dist/web/assets/TaskBlockerClear-BHOMZYwm.js +0 -1
- package/dist/web/assets/TonborgDelegationSwitch-BA3Qb8Wr.js +0 -1
- package/dist/web/assets/TonborgDelegationSwitch-DeqERWoo.css +0 -1
- package/dist/web/assets/UiDialog-bUwGQz96.js +0 -1
- package/dist/web/assets/UiIconButton-D3R6WwwI.css +0 -1
- package/dist/web/assets/UiIconButton-DlLZ5_Yc.js +0 -1
- package/dist/web/assets/UiSegmented-CYrTxDn1.js +0 -1
- package/dist/web/assets/WidgetSlot-D6vCSWaz.js +0 -2
- package/dist/web/assets/WorkbenchListPage-Zr5PW-cf.js +0 -1
- package/dist/web/assets/_plugin-vue_export-helper-BRS32yXs.js +0 -9
- package/dist/web/assets/agent-occupation-CEd3bAhb.js +0 -1
- package/dist/web/assets/index-B-aRUs9w.js +0 -24
- package/dist/web/assets/label-table-_YAtPkRI.js +0 -1
- package/dist/web/assets/popup-host-DKN99Od3.js +0 -1
- package/dist/web/assets/review-api-WhNB3ppo.js +0 -1
- package/dist/web/assets/settings-tabs-DTbgqX8g.js +0 -1
- package/dist/web/assets/shared-report-0FO_y0sa.js +0 -3
- package/dist/web/assets/ui-D4nAhcmu.css +0 -1
- package/dist/web/assets/ui-M_UKzb_A.js +0 -1
- package/dist/web/assets/useForwardScopeId-CoSQtoUU.js +0 -1
- package/dist/web/assets/usePrimitiveElement-iRKqOVuY.js +0 -1
- package/dist/web/assets/useTeamPeople-CPC62La3.js +0 -1
|
@@ -99,6 +99,7 @@ class StoreProjectAgentTaskBlockers:
|
|
|
99
99
|
if not await self._clear_task_blocker(
|
|
100
100
|
request.personal_space_id, task_id, cause,
|
|
101
101
|
project_id=request.personal_project_id, note=request.note, clearer=clearer,
|
|
102
|
+
resume_status=request.resume_status, expected_revision=request.expected_revision,
|
|
102
103
|
):
|
|
103
104
|
raise HTTPException(409, 'the task is no longer blocked, or nothing says it is probably resolved; reload it')
|
|
104
105
|
return await self.get_project_agent_task(
|
|
@@ -158,9 +159,9 @@ class StoreProjectAgentTaskBlockers:
|
|
|
158
159
|
|
|
159
160
|
async def _clear_task_blocker(
|
|
160
161
|
self, space_id: str, task_id: str, cause: BlockerClearCause, *, session=None,
|
|
161
|
-
project_id=None, note=None, clearer=None,
|
|
162
|
+
project_id=None, note=None, clearer=None, resume_status='running', expected_revision=None,
|
|
162
163
|
) -> bool:
|
|
163
|
-
"""Move one blocked task to running. session, when given, must be the reporting one.
|
|
164
|
+
"""Move one blocked task to running (or queued). session, when given, must be the reporting one.
|
|
164
165
|
|
|
165
166
|
The person's own clear ('person') is a human event whose summary is
|
|
166
167
|
their note; their confirmation ('person_confirmed') needs the block's
|
|
@@ -174,6 +175,11 @@ class StoreProjectAgentTaskBlockers:
|
|
|
174
175
|
blocker = scoped._blocker_from_row(row) if row else None
|
|
175
176
|
if not blocker or (session and not blocked_in_session(blocker, *session)):
|
|
176
177
|
return False
|
|
178
|
+
current = int(dict(row['task']).get('revision') or 0)
|
|
179
|
+
if expected_revision is not None and expected_revision != current:
|
|
180
|
+
# Checked under the task lock: a block reported again since is not cleared.
|
|
181
|
+
raise HTTPException(409, f'task revision is stale: expected {expected_revision}, current '
|
|
182
|
+
f'{current}; nothing was cleared, read the task again')
|
|
177
183
|
hint = blocker.probably_resolved
|
|
178
184
|
if cause == 'person_confirmed' and not hint:
|
|
179
185
|
return False
|
|
@@ -194,24 +200,25 @@ class StoreProjectAgentTaskBlockers:
|
|
|
194
200
|
})
|
|
195
201
|
CREATE (event:FuliProjectAgentTaskEvent {
|
|
196
202
|
id: $event_id, event_id: $event_id, task_id: $task_id,
|
|
197
|
-
agent_id: $agent_id, status:
|
|
203
|
+
agent_id: $agent_id, status: $resume_status, actor_kind: $actor_kind,
|
|
198
204
|
summary: $summary, source_application: $application,
|
|
199
205
|
source_session_id: $session_id, blocker_cleared_by: $cause,
|
|
200
206
|
created_at: $updated_at
|
|
201
207
|
})
|
|
202
208
|
MERGE (task)-[:HAS_TASK_EVENT]->(event)
|
|
203
|
-
SET task.status =
|
|
209
|
+
SET task.status = $resume_status,
|
|
204
210
|
task.updated_at = $updated_at,
|
|
205
211
|
task.revision = coalesce(task.revision, 0) + 1
|
|
206
212
|
WITH task
|
|
207
213
|
OPTIONAL MATCH (task)-[participant:HAS_PARTICIPANT]->()
|
|
208
214
|
WHERE participant.status = 'blocked'
|
|
209
215
|
FOREACH (_ IN CASE WHEN participant IS NULL THEN [] ELSE [1] END |
|
|
210
|
-
SET ''' + running_since_set('participant',
|
|
211
|
-
participant.status =
|
|
216
|
+
SET ''' + running_since_set('participant', '$resume_status') + '''
|
|
217
|
+
participant.status = $resume_status,
|
|
212
218
|
participant.updated_at = $updated_at
|
|
213
219
|
)
|
|
214
220
|
''',
|
|
221
|
+
resume_status=resume_status,
|
|
215
222
|
space_id=space_id, task_id=task_id,
|
|
216
223
|
event_id=stable_uuid(
|
|
217
224
|
self.settings.provider_id, space_id, 'project-agent-task-blocker-clear',
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"""The person completes or cancels a task themself (rec#123).
|
|
2
|
+
|
|
3
|
+
An Agent's own completion needs its participating Agent ID and, for a task
|
|
4
|
+
that is verified, the exact artifact revision a verifier passed. The person's
|
|
5
|
+
own close needs neither: it is their acceptance (FULI is human-authoritative).
|
|
6
|
+
It comes only on the console's human-review channel, from the person's click
|
|
7
|
+
or from an FLA relaying the person's words through run_delegated_action; the
|
|
8
|
+
event is the person's (actor_kind human) and names the relaying FLA, its
|
|
9
|
+
client and session. A blocked task's block ends with it.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from types import SimpleNamespace
|
|
13
|
+
|
|
14
|
+
from fastapi import HTTPException
|
|
15
|
+
|
|
16
|
+
from .project_agent_task_models import ProjectAgentTaskPersonClose, ProjectAgentTaskRecord
|
|
17
|
+
from .provider_values import now_utc, stable_uuid
|
|
18
|
+
from .store_project_agent_task_activity import TERMINAL_TASK_STATUSES
|
|
19
|
+
from .store_project_agent_task_blockers import STATUS_UPDATE_RESPONSE
|
|
20
|
+
from .store_transactions import query_store_transaction
|
|
21
|
+
from .task_participant_running import running_since_set
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class StoreProjectAgentTaskPersonClose:
|
|
25
|
+
async def close_task_by_person(
|
|
26
|
+
self, actor: dict, task_id: str, request: ProjectAgentTaskPersonClose,
|
|
27
|
+
) -> ProjectAgentTaskRecord:
|
|
28
|
+
self._require_personal()
|
|
29
|
+
if actor.get('_human_review_verified') is not True:
|
|
30
|
+
raise HTTPException(403, 'only the person closes a task this way, from the local console')
|
|
31
|
+
await self.authorize(actor, request.personal_space_id, 'maintainer')
|
|
32
|
+
async with query_store_transaction(self) as scoped:
|
|
33
|
+
await scoped._lock_task_activity(request.personal_space_id, task_id)
|
|
34
|
+
row = await scoped._find_task_row(request.personal_space_id, task_id, request.personal_project_id)
|
|
35
|
+
if not row:
|
|
36
|
+
raise HTTPException(404, 'project Agent task not found')
|
|
37
|
+
was = dict(row['task'])['status']
|
|
38
|
+
if was in TERMINAL_TASK_STATUSES:
|
|
39
|
+
raise HTTPException(409, f'the task is already {was}; reload it')
|
|
40
|
+
now = now_utc()
|
|
41
|
+
await scoped.runtime.driver.execute_query(
|
|
42
|
+
'''
|
|
43
|
+
MATCH (:FuliSpace {id: $space_id, kind: 'personal'})-[:HAS_PROJECT_AGENT_TASK]->
|
|
44
|
+
(task:FuliProjectAgentTask {personal_space_id: $space_id, task_id: $task_id})
|
|
45
|
+
CREATE (event:FuliProjectAgentTaskEvent {
|
|
46
|
+
id: $event_id, event_id: $event_id, task_id: $task_id,
|
|
47
|
+
agent_id: $relayed_by, status: $status, actor_kind: 'human',
|
|
48
|
+
summary: $summary, source_application: $application,
|
|
49
|
+
source_session_id: $session_id, blocker_cleared_by: $cleared_by,
|
|
50
|
+
created_at: $updated_at
|
|
51
|
+
})
|
|
52
|
+
MERGE (task)-[:HAS_TASK_EVENT]->(event)
|
|
53
|
+
SET task.status = $status,
|
|
54
|
+
task.result_summary = $summary,
|
|
55
|
+
task.completed_at = $updated_at,
|
|
56
|
+
task.updated_at = $updated_at,
|
|
57
|
+
task.revision = coalesce(task.revision, 0) + 1
|
|
58
|
+
WITH task
|
|
59
|
+
OPTIONAL MATCH (task)-[participant:HAS_PARTICIPANT]->()
|
|
60
|
+
WHERE NOT coalesce(participant.status, '') IN ['completed', 'failed', 'cancelled']
|
|
61
|
+
FOREACH (_ IN CASE WHEN participant IS NULL THEN [] ELSE [1] END |
|
|
62
|
+
SET ''' + running_since_set('participant') + '''
|
|
63
|
+
participant.status = $status,
|
|
64
|
+
participant.updated_at = $updated_at,
|
|
65
|
+
participant.ended_at = $updated_at
|
|
66
|
+
)
|
|
67
|
+
''',
|
|
68
|
+
space_id=request.personal_space_id, task_id=task_id, status=request.status,
|
|
69
|
+
event_id=stable_uuid(self.settings.provider_id, request.personal_space_id,
|
|
70
|
+
'project-agent-task-person-close', task_id, now.isoformat()),
|
|
71
|
+
relayed_by=request.relayed_by, summary=request.summary,
|
|
72
|
+
application=request.source_application, session_id=request.source_session_id,
|
|
73
|
+
cleared_by='person' if was == 'blocked' else None, updated_at=now,
|
|
74
|
+
)
|
|
75
|
+
if was == 'blocked':
|
|
76
|
+
await scoped._close_blocker_attention(request.personal_space_id, task_id, STATUS_UPDATE_RESPONSE, now)
|
|
77
|
+
await scoped.close_task_agent_loans(actor, request.personal_space_id, task_id)
|
|
78
|
+
await scoped._archive_finished_temporary_agent(SimpleNamespace(
|
|
79
|
+
status=request.status, personal_space_id=request.personal_space_id, task_id=task_id), None, now)
|
|
80
|
+
return await self.get_project_agent_task(
|
|
81
|
+
actor, request.personal_space_id, task_id, personal_project_id=request.personal_project_id,
|
|
82
|
+
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import json
|
|
2
2
|
from collections import defaultdict
|
|
3
|
-
from datetime import date
|
|
3
|
+
from datetime import date, datetime
|
|
4
4
|
from fastapi import HTTPException
|
|
5
5
|
from .system_hr_identity import resolve_hr_alias
|
|
6
6
|
from .personal_project_access import authorize_personal_project
|
|
@@ -29,12 +29,15 @@ from .store_project_agent_task_staffing import (
|
|
|
29
29
|
from .store_project_agent_coordination_policy import StoreProjectAgentCoordinationPolicy
|
|
30
30
|
from .store_project_agent_task_activity import StoreProjectAgentTaskActivity, TERMINAL_TASK_STATUSES
|
|
31
31
|
from .store_project_agent_task_blockers import StoreProjectAgentTaskBlockers
|
|
32
|
+
from .store_project_agent_task_person_close import StoreProjectAgentTaskPersonClose
|
|
32
33
|
from .store_transactions import TransactionQueryDriver, query_store_transaction
|
|
33
34
|
from .task_activity_origin import coordination_activity_origin, read_activity_origin
|
|
35
|
+
from .task_blocker import BLOCKED_ELSEWHERE_CODE, BLOCKED_MOVE_GUIDANCE
|
|
34
36
|
from .project_agent_hierarchy import reporting_parent, bind_task_coordinator, validate_task_reports
|
|
35
37
|
class StoreProjectAgentTasks(
|
|
36
38
|
StoreProjectAgentTaskActivity,
|
|
37
39
|
StoreProjectAgentTaskBlockers,
|
|
40
|
+
StoreProjectAgentTaskPersonClose,
|
|
38
41
|
StoreProjectAgentCoordinationPolicy,
|
|
39
42
|
StoreProjectAgentTaskRecruitment,
|
|
40
43
|
StoreProjectAgentTaskReads,
|
|
@@ -556,7 +559,10 @@ class StoreProjectAgentTasks(
|
|
|
556
559
|
agent_id: str | None = None,
|
|
557
560
|
status: str | None = None,
|
|
558
561
|
limit: int = 100,
|
|
562
|
+
after_updated_at: datetime | None = None,
|
|
563
|
+
after_task_id: str | None = None,
|
|
559
564
|
) -> list[ProjectAgentTaskRecord]:
|
|
565
|
+
"""The space's tasks, latest change first; after_* continues past one listed task."""
|
|
560
566
|
self._require_personal()
|
|
561
567
|
space = await self.authorize(actor, personal_space_id, 'reader')
|
|
562
568
|
agent_id = await resolve_hr_alias(self, personal_space_id, agent_id)
|
|
@@ -586,6 +592,10 @@ class StoreProjectAgentTasks(
|
|
|
586
592
|
MATCH (:FuliTaskContext {personal_space_id: $personal_space_id,
|
|
587
593
|
project_agent_id: $agent_id})-[:COORDINATES_TASK]->(task)
|
|
588
594
|
})
|
|
595
|
+
AND ($after_updated_at IS NULL
|
|
596
|
+
OR task.updated_at < datetime($after_updated_at)
|
|
597
|
+
OR (task.updated_at = datetime($after_updated_at)
|
|
598
|
+
AND task.task_id > $after_task_id))
|
|
589
599
|
'''
|
|
590
600
|
) + '\nORDER BY task.updated_at DESC, task.task_id LIMIT $limit',
|
|
591
601
|
personal_space_id=personal_space_id,
|
|
@@ -593,6 +603,8 @@ class StoreProjectAgentTasks(
|
|
|
593
603
|
agent_id=agent_id,
|
|
594
604
|
status=status,
|
|
595
605
|
limit=limit,
|
|
606
|
+
after_updated_at=after_updated_at.isoformat() if after_updated_at else None,
|
|
607
|
+
after_task_id=after_task_id,
|
|
596
608
|
routing_='r',
|
|
597
609
|
)
|
|
598
610
|
return [self._task_from_row(row) for row in records]
|
|
@@ -743,6 +755,11 @@ class StoreProjectAgentTasks(
|
|
|
743
755
|
'completed', 'cancelled', 'failed',
|
|
744
756
|
}
|
|
745
757
|
if requested not in allowed.get(current, set()):
|
|
758
|
+
if current == 'blocked':
|
|
759
|
+
# A deliberate boundary (human-authoritative): another session's
|
|
760
|
+
# word alone does not end a block; the refusal names the way that does.
|
|
761
|
+
raise HTTPException(409, {'code': BLOCKED_ELSEWHERE_CODE,
|
|
762
|
+
'message': f'blocked -> {requested} {BLOCKED_MOVE_GUIDANCE}'})
|
|
746
763
|
raise HTTPException(
|
|
747
764
|
status_code=409,
|
|
748
765
|
detail=f'illegal project Agent task transition: {current} -> {requested}',
|
|
@@ -17,6 +17,16 @@ from .provider_values import native_datetime
|
|
|
17
17
|
PERSON_CLEAR_SUMMARY = 'Marked as unblocked by the person in FULI.'
|
|
18
18
|
# The person confirmed a block FULI saw as probably resolved, without a note.
|
|
19
19
|
PERSON_CONFIRM_SUMMARY = 'Confirmed as unblocked by the person after the Agent went on in another session.'
|
|
20
|
+
# Why another session's status report cannot move a blocked task on, and what
|
|
21
|
+
# does (rec#123). The Agent-facing message is cut at 240 characters and the
|
|
22
|
+
# Node client turns ':' into ' —', so it names the route without its path. Its
|
|
23
|
+
# code lets the Agent tool clear the block under the person's AI permission
|
|
24
|
+
# and record the report in one call (src/task-blockers/agent-resume.js).
|
|
25
|
+
BLOCKED_ELSEWHERE_CODE = 'task_blocked_elsewhere'
|
|
26
|
+
BLOCKED_MOVE_GUIDANCE = (
|
|
27
|
+
'needs its reporting session or lead Agent. Fixed it? Resend running/queued with taskContextToken '
|
|
28
|
+
"(FULI clears it under the person's AI permission) or use run_delegated_action, task blocker/clear route"
|
|
29
|
+
)
|
|
20
30
|
|
|
21
31
|
|
|
22
32
|
def current_blocker(
|
|
Binary file
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fuli-context",
|
|
3
|
-
"version": "0.27.
|
|
3
|
+
"version": "0.27.1",
|
|
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.1",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@agentclientprotocol/sdk": "1.5.0",
|
|
13
|
-
"@hono/node-server": "2.1.
|
|
13
|
+
"@hono/node-server": "2.1.8",
|
|
14
14
|
"@internationalized/date": "3.12.4",
|
|
15
15
|
"@modelcontextprotocol/sdk": "^1.31.0",
|
|
16
16
|
"@peculiar/x509": "2.1.0",
|
|
17
|
+
"bonjour-service": "1.4.4",
|
|
17
18
|
"reflect-metadata": "0.2.2",
|
|
18
19
|
"smol-toml": "1.9.1",
|
|
19
20
|
"zod": "^4.6.7"
|
|
@@ -552,9 +553,9 @@
|
|
|
552
553
|
}
|
|
553
554
|
},
|
|
554
555
|
"node_modules/@hono/node-server": {
|
|
555
|
-
"version": "2.1.
|
|
556
|
-
"resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-2.1.
|
|
557
|
-
"integrity": "sha512-
|
|
556
|
+
"version": "2.1.8",
|
|
557
|
+
"resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-2.1.8.tgz",
|
|
558
|
+
"integrity": "sha512-jdf7FHh6A1lzjpHHQUgxsg2GeER2vMetnAOfeActzcoli6jamlK+NAwL6Dsr5Fl3BS3tYUQzCdtZjU8Qxv7bEA==",
|
|
558
559
|
"license": "MIT",
|
|
559
560
|
"engines": {
|
|
560
561
|
"node": ">=20"
|
|
@@ -704,6 +705,12 @@
|
|
|
704
705
|
"@jridgewell/sourcemap-codec": "^1.4.14"
|
|
705
706
|
}
|
|
706
707
|
},
|
|
708
|
+
"node_modules/@leichtgewicht/ip-codec": {
|
|
709
|
+
"version": "2.0.5",
|
|
710
|
+
"resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.5.tgz",
|
|
711
|
+
"integrity": "sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw==",
|
|
712
|
+
"license": "MIT"
|
|
713
|
+
},
|
|
707
714
|
"node_modules/@modelcontextprotocol/sdk": {
|
|
708
715
|
"version": "1.32.1",
|
|
709
716
|
"resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.32.1.tgz",
|
|
@@ -2908,6 +2915,16 @@
|
|
|
2908
2915
|
"url": "https://opencollective.com/express"
|
|
2909
2916
|
}
|
|
2910
2917
|
},
|
|
2918
|
+
"node_modules/bonjour-service": {
|
|
2919
|
+
"version": "1.4.4",
|
|
2920
|
+
"resolved": "https://registry.npmjs.org/bonjour-service/-/bonjour-service-1.4.4.tgz",
|
|
2921
|
+
"integrity": "sha512-jCZcVv7eoc4QesRscwEZtSROBen+6LpKAmBIsQYQrsAeVHLyMXWX/t6eIV5KiRZYNUBl8eVqImEEMQ8L5+c/Kw==",
|
|
2922
|
+
"license": "MIT",
|
|
2923
|
+
"dependencies": {
|
|
2924
|
+
"fast-deep-equal": "^3.1.3",
|
|
2925
|
+
"multicast-dns": "^7.2.5"
|
|
2926
|
+
}
|
|
2927
|
+
},
|
|
2911
2928
|
"node_modules/boolbase": {
|
|
2912
2929
|
"version": "1.0.0",
|
|
2913
2930
|
"resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
|
|
@@ -3698,6 +3715,18 @@
|
|
|
3698
3715
|
"node": ">=8"
|
|
3699
3716
|
}
|
|
3700
3717
|
},
|
|
3718
|
+
"node_modules/dns-packet": {
|
|
3719
|
+
"version": "5.6.1",
|
|
3720
|
+
"resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-5.6.1.tgz",
|
|
3721
|
+
"integrity": "sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw==",
|
|
3722
|
+
"license": "MIT",
|
|
3723
|
+
"dependencies": {
|
|
3724
|
+
"@leichtgewicht/ip-codec": "^2.0.1"
|
|
3725
|
+
},
|
|
3726
|
+
"engines": {
|
|
3727
|
+
"node": ">=6"
|
|
3728
|
+
}
|
|
3729
|
+
},
|
|
3701
3730
|
"node_modules/dom-serializer": {
|
|
3702
3731
|
"version": "2.0.0",
|
|
3703
3732
|
"resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz",
|
|
@@ -4268,9 +4297,9 @@
|
|
|
4268
4297
|
"license": "MIT"
|
|
4269
4298
|
},
|
|
4270
4299
|
"node_modules/hono": {
|
|
4271
|
-
"version": "4.13.
|
|
4272
|
-
"resolved": "https://registry.npmjs.org/hono/-/hono-4.13.
|
|
4273
|
-
"integrity": "sha512-
|
|
4300
|
+
"version": "4.13.18",
|
|
4301
|
+
"resolved": "https://registry.npmjs.org/hono/-/hono-4.13.18.tgz",
|
|
4302
|
+
"integrity": "sha512-H9q/E1XizaWstJxUW881dmLxEj+t/TrGGnyxINkm4+sK0qUwsMtFdo2BWI9Vs3cIS19MU6b6iCijoUoEf4f3DA==",
|
|
4274
4303
|
"license": "MIT",
|
|
4275
4304
|
"engines": {
|
|
4276
4305
|
"node": ">=16.9.0"
|
|
@@ -5148,6 +5177,19 @@
|
|
|
5148
5177
|
"dev": true,
|
|
5149
5178
|
"license": "MIT"
|
|
5150
5179
|
},
|
|
5180
|
+
"node_modules/multicast-dns": {
|
|
5181
|
+
"version": "7.2.5",
|
|
5182
|
+
"resolved": "https://registry.npmjs.org/multicast-dns/-/multicast-dns-7.2.5.tgz",
|
|
5183
|
+
"integrity": "sha512-2eznPJP8z2BFLX50tf0LuODrpINqP1RVIm/CObbTcBRITQgmC/TjcREF1NeTBzIcR5XO/ukWo+YHOjBbFwIupg==",
|
|
5184
|
+
"license": "MIT",
|
|
5185
|
+
"dependencies": {
|
|
5186
|
+
"dns-packet": "^5.2.2",
|
|
5187
|
+
"thunky": "^1.0.2"
|
|
5188
|
+
},
|
|
5189
|
+
"bin": {
|
|
5190
|
+
"multicast-dns": "cli.js"
|
|
5191
|
+
}
|
|
5192
|
+
},
|
|
5151
5193
|
"node_modules/nanoid": {
|
|
5152
5194
|
"version": "3.3.20",
|
|
5153
5195
|
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz",
|
|
@@ -6101,6 +6143,12 @@
|
|
|
6101
6143
|
"url": "https://opencollective.com/webpack"
|
|
6102
6144
|
}
|
|
6103
6145
|
},
|
|
6146
|
+
"node_modules/thunky": {
|
|
6147
|
+
"version": "1.1.0",
|
|
6148
|
+
"resolved": "https://registry.npmjs.org/thunky/-/thunky-1.1.0.tgz",
|
|
6149
|
+
"integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==",
|
|
6150
|
+
"license": "MIT"
|
|
6151
|
+
},
|
|
6104
6152
|
"node_modules/tinybench": {
|
|
6105
6153
|
"version": "2.9.0",
|
|
6106
6154
|
"resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fuli-context",
|
|
3
|
-
"version": "0.27.
|
|
3
|
+
"version": "0.27.1",
|
|
4
4
|
"description": "Local-first collaboration relationship graph for AI agents.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -87,10 +87,11 @@
|
|
|
87
87
|
"license": "Apache-2.0",
|
|
88
88
|
"dependencies": {
|
|
89
89
|
"@agentclientprotocol/sdk": "1.5.0",
|
|
90
|
-
"@hono/node-server": "2.1.
|
|
90
|
+
"@hono/node-server": "2.1.8",
|
|
91
91
|
"@internationalized/date": "3.12.4",
|
|
92
92
|
"@modelcontextprotocol/sdk": "^1.31.0",
|
|
93
93
|
"@peculiar/x509": "2.1.0",
|
|
94
|
+
"bonjour-service": "1.4.4",
|
|
94
95
|
"reflect-metadata": "0.2.2",
|
|
95
96
|
"smol-toml": "1.9.1",
|
|
96
97
|
"zod": "^4.6.7"
|
|
@@ -133,7 +134,7 @@
|
|
|
133
134
|
},
|
|
134
135
|
"overrides": {
|
|
135
136
|
"@modelcontextprotocol/sdk": {
|
|
136
|
-
"@hono/node-server": "2.1.
|
|
137
|
+
"@hono/node-server": "2.1.8"
|
|
137
138
|
},
|
|
138
139
|
"brace-expansion": "$brace-expansion",
|
|
139
140
|
"fast-uri": "3.1.9",
|
|
@@ -41,10 +41,12 @@ export const claudeCodeWake = Object.freeze({
|
|
|
41
41
|
return null;
|
|
42
42
|
},
|
|
43
43
|
|
|
44
|
-
// stream-json ends with one `result` event carrying the final answer.
|
|
45
|
-
|
|
44
|
+
// stream-json ends with one `result` event carrying the final answer. Its
|
|
45
|
+
// `system` `init` event names the model the session runs (rec#129).
|
|
46
|
+
initialState: () => ({ body: '', completed: true, failed: false, model: null }),
|
|
46
47
|
nativeSessionId: event => event.type === 'system' && event.subtype === 'init' ? event.session_id : null,
|
|
47
48
|
readEvent(event, state) {
|
|
49
|
+
if (event.type === 'system' && event.subtype === 'init' && typeof event.model === 'string') state.model = event.model;
|
|
48
50
|
if (event.type !== 'result') return;
|
|
49
51
|
state.body = event.result ?? '';
|
|
50
52
|
state.failed ||= Boolean(event.is_error);
|
|
@@ -53,6 +53,7 @@ export const codexWake = Object.freeze({
|
|
|
53
53
|
},
|
|
54
54
|
|
|
55
55
|
// `codex exec --json` streams items; the last agent message before turn.completed is the answer.
|
|
56
|
+
// No event names the model, so a Codex wake's model stays unknown (rec#129).
|
|
56
57
|
initialState: () => ({ body: '', completed: false, failed: false }),
|
|
57
58
|
nativeSessionId: event => event.type === 'thread.started' ? event.thread_id : null,
|
|
58
59
|
readEvent(event, state) {
|
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
// Agent { agentId, employeeNumber?, occupation?, assignments?, personalProjectId?,
|
|
7
7
|
// profile: { name, displayName?, responsibility?, capabilities?, allowedClients, status } }
|
|
8
8
|
// Session { client, sessionId, projectId, lastActive }
|
|
9
|
-
// Project { projectId, name, temporary, archived }
|
|
9
|
+
// Project { projectId, name, temporary, archived, repositories? } repositories: the normalised
|
|
10
|
+
// addresses of the project's own repositories (host/path), which paired devices compare as digests
|
|
10
11
|
// Team { lead: { agentId, name, employeeNumber?, responsibility? } | null, people: [same shape] }
|
|
11
12
|
//
|
|
12
13
|
// Methods (async unless marked sync)
|
|
@@ -36,6 +37,8 @@
|
|
|
36
37
|
// remoteOriginAuthority() public keys that verify those origins
|
|
37
38
|
// recordMemoryUsage(input) optional: { recorded, reason? }
|
|
38
39
|
// projectFolder(projectId) optional: the project's known folder for fresh sessions
|
|
40
|
+
// folderRepository(path) optional: the normalised origin address of the Git
|
|
41
|
+
// repository holding path, or null (LAN share folder check)
|
|
39
42
|
// matchWork(query) optional: leads the person's own names for work point to, in
|
|
40
43
|
// this space: [{ agentId, projectId, project, responsibility?,
|
|
41
44
|
// matchedTerms? }] (a project name, or an active standing assignment);
|
|
@@ -5,6 +5,10 @@ import { shortFingerprint } from './protocol.js';
|
|
|
5
5
|
export function peerUsage(command) {
|
|
6
6
|
return `${command} peer <action> (LAN roundtable Beta; the local service must be running)
|
|
7
7
|
status
|
|
8
|
+
nearby [on [--name NAME] | off | clear-attempts] list nearby FULI; on: be seen and listen for pairing
|
|
9
|
+
pair FINGERPRINT pair with a nearby FULI (first 4+ characters from the list)
|
|
10
|
+
confirm CODE the 6 digits the person reads on the OTHER computer
|
|
11
|
+
cancel cancel the pairing waiting here
|
|
8
12
|
host --address IP [--port PORT] [--name NAME] turn this computer into the coordinator
|
|
9
13
|
invite print a one-use pairing invitation (10 minutes)
|
|
10
14
|
join (--invitation TEXT | --invitation-file FILE) [--name NAME]
|
|
@@ -32,6 +36,27 @@ export async function runPeerControlCommand(args, { baseUrl, command, notRunning
|
|
|
32
36
|
};
|
|
33
37
|
switch (action) {
|
|
34
38
|
case 'status': return printStatus(await call('GET', '/api/peer'), write);
|
|
39
|
+
case 'nearby': {
|
|
40
|
+
const [toggle] = positional(rest);
|
|
41
|
+
if (toggle === 'on') return printNearby(await call('POST', '/api/peer/nearby', { on: true, name: option(rest, '--name') }), write, command);
|
|
42
|
+
if (toggle === 'off') return printNearby(await call('POST', '/api/peer/nearby', { on: false }), write, command);
|
|
43
|
+
if (toggle === 'clear-attempts') return printNearby(await call('POST', '/api/peer/nearby/attempts/clear', {}), write, command);
|
|
44
|
+
if (toggle) throw new Error(`Unknown nearby action: ${toggle}\n${peerUsage(command)}`);
|
|
45
|
+
return printNearby(await call('GET', '/api/peer'), write, command);
|
|
46
|
+
}
|
|
47
|
+
case 'pair': {
|
|
48
|
+
const [fingerprint] = positional(rest);
|
|
49
|
+
if (!fingerprint) throw new Error(`Pass the fingerprint of a computer from \`${command} peer nearby\`.`);
|
|
50
|
+
return printNearby(await call('POST', '/api/peer/nearby/pair', { fingerprint }), write, command);
|
|
51
|
+
}
|
|
52
|
+
case 'confirm': {
|
|
53
|
+
const code = positional(rest).join('');
|
|
54
|
+
if (!/^\d{6}$/.test(code)) throw new Error('Pass the 6-digit code shown on the other computer.');
|
|
55
|
+
const pairing = (await call('GET', '/api/peer')).nearby?.pairing;
|
|
56
|
+
if (!pairing?.requestId || pairing.state !== 'confirm') throw new Error('No pairing is waiting for confirmation here.');
|
|
57
|
+
return printNearby(await call('POST', '/api/peer/nearby/confirm', { requestId: pairing.requestId, code }), write, command);
|
|
58
|
+
}
|
|
59
|
+
case 'cancel': return printNearby(await call('POST', '/api/peer/nearby/cancel', {}), write, command);
|
|
35
60
|
case 'host': {
|
|
36
61
|
const address = option(rest, '--address');
|
|
37
62
|
if (!address) throw new Error(`Pass --address with one of this computer's LAN addresses (see \`${command} peer status\`).`);
|
|
@@ -79,12 +104,60 @@ function printStatus(status, write) {
|
|
|
79
104
|
write(`LAN roundtable (Beta): ${status.role === 'coordinator' ? 'coordinator' : 'paired device'}`);
|
|
80
105
|
write(`This device: ${status.device.shortFingerprint}`);
|
|
81
106
|
write(`Coordinator: ${status.coordinator.name} ${status.coordinator.url} (${status.coordinator.shortFingerprint})`);
|
|
107
|
+
const failure = status.coordinator.listenFailure;
|
|
108
|
+
if (failure) write(`Not listening: could not open ${failure.address}:${failure.port} (${failure.code}). Paired devices cannot reach this computer; turn the LAN roundtable off and on again.`);
|
|
82
109
|
for (const device of status.devices.filter((entry) => !entry.self)) {
|
|
83
|
-
write(` device ${device.name} ${device.shortFingerprint} ${device.status}${device.online ? ' online' : ''} ${device.nodeId}`);
|
|
110
|
+
write(` device ${device.name} ${device.shortFingerprint} ${device.status}${device.online ? ' online' : ''} · shared Agents ${device.sharedAgents} · ${device.nodeId}`);
|
|
84
111
|
}
|
|
85
112
|
for (const share of status.shares) {
|
|
86
|
-
write(` shared project lead: ${share.projectName} · ${share.clients.join(', ')} · ${share.state}${share.workingDirectory ? '' : ' · folder from recent sessions'}`);
|
|
113
|
+
write(` shared project lead: ${share.projectName} · ${share.clients.join(', ')} · ${share.state}${share.reason ? ` (${share.reason})` : ''}${share.workingDirectory ? '' : ' · folder from recent sessions'}`);
|
|
87
114
|
}
|
|
115
|
+
for (const project of status.shareable.filter((entry) => entry.sameProjectOn?.length)) {
|
|
116
|
+
write(` same project on ${project.sameProjectOn.map((device) => device.name).join(', ')}: ${project.projectName} (${project.projectId})${project.knownFolder ? '' : ' · no known folder here, pass --folder'}`);
|
|
117
|
+
}
|
|
118
|
+
if (status.lastPublish?.error) write(`The coordinator did not get this device's shared list: ${status.lastPublish.error}.`);
|
|
119
|
+
else if (status.lastPublish) write(`Shared list sent to the coordinator: ${status.lastPublish.agents} Agent(s) at ${status.lastPublish.at}`);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function printNearby(status, write, command) {
|
|
123
|
+
const { nearby } = status;
|
|
124
|
+
const ended = NEARBY_ENDED[nearby.ended?.kind];
|
|
125
|
+
if (ended) write(ended(nearby.ended));
|
|
126
|
+
if (!nearby.on) {
|
|
127
|
+
write(`Nearby pairing: off. \`${command} peer nearby on [--name NAME]\` lets computers on this network see that this one runs FULI (for 30 minutes).`);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
write(`Nearby pairing: on until ${nearby.until}, seen as "${nearby.name}"${nearby.reason ? ` (${nearby.reason})` : ''}`);
|
|
131
|
+
const tried = nearby.attempts;
|
|
132
|
+
if (nearby.limited) write(`Too many pairing attempts (${tried.lastWindow} in 10 minutes, ${tried.lastDay} in 24 hours). Wait, or the person on this computer runs \`${command} peer nearby clear-attempts\`.`);
|
|
133
|
+
else if (tried?.lastDay) write(`Pairing attempts: ${tried.lastWindow} in the last 10 minutes, ${tried.lastDay} in 24 hours.`);
|
|
134
|
+
if (!nearby.devices.length) write(' No other FULI seen on this network yet.');
|
|
135
|
+
for (const device of nearby.devices) write(` ${device.name} · ${device.shortFingerprint}${device.paired ? ' · paired' : ''}`);
|
|
136
|
+
const { pairing } = nearby;
|
|
137
|
+
if (!pairing) return;
|
|
138
|
+
const device = `${pairing.device.name} (${pairing.device.shortFingerprint ?? '…'})`;
|
|
139
|
+
if (pairing.direction === 'incoming' && pairing.state === 'connecting') {
|
|
140
|
+
write(`${device} asks to pair with this computer. \`${command} peer cancel\` refuses it.`);
|
|
141
|
+
} else if (pairing.state === 'confirm' || pairing.state === 'finishing') {
|
|
142
|
+
write(`Pairing with ${device}: code ${pairing.code}. ${pairing.coordinator === 'this' ? 'This computer' : 'The other computer'} will coordinate.`);
|
|
143
|
+
write(pairing.confirmedHere
|
|
144
|
+
? `Confirmed here; waiting for the person on the other computer${pairing.confirmedThere ? ' (confirmed there too, finishing)' : ''}.`
|
|
145
|
+
: `Compare it with the code on the other computer; if they match, run \`${command} peer confirm <the code shown there>\` before ${pairing.expiresAt}.`);
|
|
146
|
+
} else write(`Pairing with ${device}: ${pairing.state}${pairing.reason ? ` (${pairing.reason})` : ''}`);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Why nearby pairing turned itself off, or what it last did.
|
|
150
|
+
const NEARBY_ENDED = {
|
|
151
|
+
paired: (ended) => `Paired with ${ended.name}; nearby pairing turned itself off.`,
|
|
152
|
+
timeout: () => 'Nearby pairing turned itself off after 30 minutes.',
|
|
153
|
+
discovery_failed: (ended) => `Nearby discovery could not start: ${ended.reason}. Nearby pairing is off; the rest keeps running.`,
|
|
154
|
+
trust_withdrawn: (ended) => `${ended.name} never connected after pairing, so this computer no longer trusts it.`,
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
// The words before the first --option.
|
|
158
|
+
function positional(args) {
|
|
159
|
+
const first = args.findIndex((value) => value.startsWith('--'));
|
|
160
|
+
return first < 0 ? args : args.slice(0, first);
|
|
88
161
|
}
|
|
89
162
|
|
|
90
163
|
function option(args, name) {
|
|
@@ -19,7 +19,9 @@ export async function handlePeerControlRequest({ request, response, url, peer, r
|
|
|
19
19
|
sendJson(response, 200, result);
|
|
20
20
|
} catch (error) {
|
|
21
21
|
if (!(error instanceof PeerError)) throw error;
|
|
22
|
-
|
|
22
|
+
// A refusal is always an error status, whatever another device answered.
|
|
23
|
+
const status = Number.isInteger(error.status) && error.status >= 400 && error.status < 600 ? error.status : 502;
|
|
24
|
+
sendJson(response, status, { error: error.code, message: error.message });
|
|
23
25
|
}
|
|
24
26
|
return true;
|
|
25
27
|
}
|
|
@@ -43,5 +45,17 @@ async function route(request, pathname, peer, readJson) {
|
|
|
43
45
|
const revoke = /^\/api\/peer\/devices\/([0-9a-f]{64})\/revoke$/.exec(pathname);
|
|
44
46
|
if (revoke && method === 'POST') { await readJson(request); return peer.revokeDevice(revoke[1]); }
|
|
45
47
|
if (pathname === '/api/peer/disable' && method === 'POST') { await readJson(request); return peer.disable(); }
|
|
48
|
+
if (pathname === '/api/peer/nearby' && method === 'POST') {
|
|
49
|
+
const body = await readJson(request);
|
|
50
|
+
if (typeof body.on !== 'boolean') throw new PeerError('invalid_nearby', 'Pass on: true or on: false', 422);
|
|
51
|
+
return body.on ? peer.nearbyOn({ name: body.name }) : peer.nearbyOff();
|
|
52
|
+
}
|
|
53
|
+
if (pathname === '/api/peer/nearby/pair' && method === 'POST') return peer.pairNearby({ fingerprint: (await readJson(request)).fingerprint });
|
|
54
|
+
if (pathname === '/api/peer/nearby/confirm' && method === 'POST') {
|
|
55
|
+
const body = await readJson(request);
|
|
56
|
+
return peer.confirmPairing({ requestId: body.requestId, code: body.code });
|
|
57
|
+
}
|
|
58
|
+
if (pathname === '/api/peer/nearby/cancel' && method === 'POST') { await readJson(request); return peer.cancelPairing(); }
|
|
59
|
+
if (pathname === '/api/peer/nearby/attempts/clear' && method === 'POST') { await readJson(request); return peer.clearPairingAttempts(); }
|
|
46
60
|
return undefined;
|
|
47
61
|
}
|
|
@@ -8,8 +8,11 @@ const SWEEP_MS = 5_000;
|
|
|
8
8
|
|
|
9
9
|
// The only network listener of the LAN roundtable. Every route requires a
|
|
10
10
|
// TLS-verified, currently paired device, except one-use pairing, which accepts
|
|
11
|
-
// a not-yet-trusted client certificate and authorizes it by invitation code
|
|
12
|
-
|
|
11
|
+
// a not-yet-trusted client certificate and authorizes it by invitation code,
|
|
12
|
+
// and nearby pairing (nearby-pairing.js), which trusts nothing until the person
|
|
13
|
+
// on each computer confirmed the same code.
|
|
14
|
+
export async function startCoordinatorServer({ service, identity, host, port = 0, claimWaitMs = PEER_LIMITS.claimWaitMs,
|
|
15
|
+
nearby = null, onReached = () => {} }) {
|
|
13
16
|
const secureContext = () => ({ ...identity.tlsOptions, ca: service.trustedCertificates() });
|
|
14
17
|
const server = createServer({
|
|
15
18
|
...secureContext(), requestCert: true, rejectUnauthorized: false, minVersion: 'TLSv1.3',
|
|
@@ -19,6 +22,8 @@ export async function startCoordinatorServer({ service, identity, host, port = 0
|
|
|
19
22
|
{ error: error instanceof PeerError ? error.code : 'internal_error', message: error instanceof PeerError ? error.message : 'Request failed' }));
|
|
20
23
|
});
|
|
21
24
|
server.keepAliveTimeout = 5_000;
|
|
25
|
+
// The local address each paired device last reached this listener on.
|
|
26
|
+
const reached = new Map();
|
|
22
27
|
|
|
23
28
|
async function handle(request, response) {
|
|
24
29
|
const { pathname } = new URL(request.url, 'https://peer.invalid');
|
|
@@ -31,8 +36,20 @@ export async function startCoordinatorServer({ service, identity, host, port = 0
|
|
|
31
36
|
sendJson(response, service.pair({ code: body.code, name: body.name, authority: body.authority, certPem: derToPem(certificate.raw) }));
|
|
32
37
|
return;
|
|
33
38
|
}
|
|
39
|
+
// While nearby pairing is off, or on an adapter it does not answer on, these paths answer exactly as any unknown path.
|
|
40
|
+
if (pathname.startsWith('/peer/1/nearby/') && nearby?.listening(plainAddress(request.socket.localAddress))) {
|
|
41
|
+
const { value, after } = await nearby.handle(pathname, body, { certPem: derToPem(certificate.raw),
|
|
42
|
+
fingerprint: sha256Hex(certificate.raw), address: plainAddress(request.socket.remoteAddress),
|
|
43
|
+
localAddress: plainAddress(request.socket.localAddress) });
|
|
44
|
+
// A step that closes this listener (joining the other computer) runs once the answer is out.
|
|
45
|
+
if (after) response.once('finish', after);
|
|
46
|
+
sendJson(response, value);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
34
49
|
if (!request.socket.authorized) throw new PeerError('device_not_trusted', 'This device is not paired', 403);
|
|
35
50
|
const nodeId = service.authenticate(sha256Hex(certificate.raw)).id;
|
|
51
|
+
const reachedAt = plainAddress(request.socket.localAddress);
|
|
52
|
+
if (reached.get(nodeId) !== reachedAt) { reached.set(nodeId, reachedAt); onReached(nodeId, reachedAt); }
|
|
36
53
|
switch (pathname) {
|
|
37
54
|
case '/peer/1/directory/publish': return sendJson(response, service.publishDirectory(nodeId, body));
|
|
38
55
|
case '/peer/1/directory': return sendJson(response, service.directory(nodeId));
|
|
@@ -118,6 +135,10 @@ function readBody(request) {
|
|
|
118
135
|
});
|
|
119
136
|
}
|
|
120
137
|
|
|
138
|
+
function plainAddress(address) {
|
|
139
|
+
return typeof address === 'string' ? address.replace(/^::ffff:/, '') : null;
|
|
140
|
+
}
|
|
141
|
+
|
|
121
142
|
function send(response, status, value) {
|
|
122
143
|
if (response.headersSent) return;
|
|
123
144
|
const body = JSON.stringify(value);
|