fuli-context 0.25.2 → 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/README.md +23 -3
- package/README.zh-CN.md +19 -4
- package/dist/web/assets/{AboutPage-Dx07_Z8u.js → AboutPage-BKyNoI0v.js} +1 -1
- package/dist/web/assets/{AboutSectionHeading-BdhpM609.js → AboutSectionHeading-DwvCvoqO.js} +1 -1
- package/dist/web/assets/AgentAppsPage-Cp2-sZXi.js +1 -0
- package/dist/web/assets/{AgentAvatar-DlAQP7gm.js → AgentAvatar-CDhU4m0T.js} +1 -1
- package/dist/web/assets/{AgentHand-FPFg9-Y1.js → AgentHand-BfRjs1He.js} +1 -1
- package/dist/web/assets/{AgentManagement-CLFw9oV9.css → AgentManagement-Cc00RLSO.css} +1 -1
- package/dist/web/assets/{AgentManagement-UTe4I3WA.js → AgentManagement-qCpr876m.js} +2 -2
- package/dist/web/assets/{AgentMentionCopy-C5ExlutT.js → AgentMentionCopy-_pr-D8vX.js} +1 -1
- package/dist/web/assets/{AgentName-C8mYbtKs.js → AgentName-CUuWNrzE.js} +1 -1
- package/dist/web/assets/{AgentProfilePage-DumsVHP1.css → AgentProfilePage-Ce25JSzZ.css} +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-BR8ttEGa.js → AppViewerPage-Ct46NPXP.js} +1 -1
- package/dist/web/assets/{BackToTop-5_AQRMZl.js → BackToTop-DOlt-xjQ.js} +1 -1
- package/dist/web/assets/{BoardCardFieldsMenu-Bb_Z9a4Q.js → BoardCardFieldsMenu-RFcx_CAs.js} +1 -1
- package/dist/web/assets/{BoardMoveMenu-B-f8O6cC.js → BoardMoveMenu-GJ8lpuZY.js} +1 -1
- package/dist/web/assets/Breadcrumb-DTo6Zvtb.js +1 -0
- package/dist/web/assets/CaptureChangePage-DRgWyCRo.js +1 -0
- package/dist/web/assets/{CopyFixPrompt-CVFYWDSt.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-BQXOe8EK.js → DialogTitle-CIVSlKqQ.js} +1 -1
- package/dist/web/assets/{EmployeeRedirectPage-BjWpXDSM.js → EmployeeRedirectPage-8qPpnbyP.js} +1 -1
- package/dist/web/assets/EmployeeScopeDialog-BZymZidB.js +1 -0
- package/dist/web/assets/EmployeeWorkbench-BnxEZCSS.js +4 -0
- package/dist/web/assets/FieldRoot-D6HtUgDA.js +1 -0
- package/dist/web/assets/{FlaGrowth-OQtTLTng.js → FlaGrowth-CaFdmezv.js} +1 -1
- package/dist/web/assets/{FlaOccupationKit-C-x4VrKk.js → FlaOccupationKit-CFoBUWGF.js} +1 -1
- package/dist/web/assets/{FlaTaskSheets-CoaF5CbQ.js → FlaTaskSheets-BShmW9R5.js} +1 -1
- package/dist/web/assets/FlasPage-DtkW-_9f.js +1 -0
- package/dist/web/assets/{GrowthLoading-VuVo2vLf.js → GrowthLoading-CVBn4r4q.js} +1 -1
- package/dist/web/assets/{HowtoPage-CZ3mOdLc.js → HowtoPage-B8f5J_An.js} +1 -1
- package/dist/web/assets/InboxPage-Bv8XUdl8.css +1 -0
- package/dist/web/assets/InboxPage-D9VIDrsL.js +6 -0
- package/dist/web/assets/{KnowledgeDeleteButton-BlUnSG3b.js → KnowledgeDeleteButton-C01O4FSO.js} +1 -1
- package/dist/web/assets/{KnowledgeHardDeleteSection-CznXBtHY.js → KnowledgeHardDeleteSection-jqad3dJN.js} +1 -1
- package/dist/web/assets/KnowledgeItemEditPage-DV8TVpvf.js +1 -0
- package/dist/web/assets/{KnowledgeItemSummaryCard-Co5JKBHl.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-CwZVuSkf.css → KnowledgePeek-D6SeISIM.css} +1 -1
- package/dist/web/assets/KnowledgePeek-DIcPS9WU.js +1 -0
- package/dist/web/assets/{KnowledgeTurnReceiptPage-Csyjimeg.js → KnowledgeTurnReceiptPage-7ncXkxKd.js} +1 -1
- package/dist/web/assets/KnowledgeWorkspace-Be2gUul5.css +1 -0
- package/dist/web/assets/KnowledgeWorkspace-CmzU6Vuh.js +4 -0
- package/dist/web/assets/{MeAvatar-aY_q8cKs.js → MeAvatar-D_LFqHrR.js} +1 -1
- package/dist/web/assets/{MeLink-B0pNwVLa.js → MeLink-CeIxjFrm.js} +1 -1
- package/dist/web/assets/{MenuSeparator-BR-uLovR.js → MenuSeparator-yD3wld9s.js} +1 -1
- package/dist/web/assets/ModelSettingsPage-BZcyT7Vy.css +1 -0
- package/dist/web/assets/ModelSettingsPage-BqClsFmC.js +1 -0
- package/dist/web/assets/NewSessionPanel-BKrOFEMO.js +1 -0
- package/dist/web/assets/NewSessionPanel-CTdd7xpN.css +1 -0
- package/dist/web/assets/{NotFoundPage-Cr1MaPuk.js → NotFoundPage-CdOCRj3P.js} +1 -1
- package/dist/web/assets/NoticeRow-CQShZQtw.js +1 -0
- package/dist/web/assets/OccupationsPage-BrBus-nh.js +1 -0
- package/dist/web/assets/OverviewPage-Cq89Klha.js +1 -0
- package/dist/web/assets/{OverviewPage-Dr4jrXW4.css → OverviewPage-KVt4LcE-.css} +1 -1
- package/dist/web/assets/{PageColumns-DvehZlYm.js → PageColumns-CgIXTt4J.js} +1 -1
- package/dist/web/assets/PageOutline-D5h1GuKt.css +1 -0
- package/dist/web/assets/PageOutline-VtLLW4kh.js +1 -0
- 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-BTQsnxRY.js → PinIcon-DD3Un-hh.js} +1 -1
- package/dist/web/assets/{PopperContent-DtMksk76.js → PopperContent-CCmt2yHl.js} +1 -1
- package/dist/web/assets/{Presence-B0zMpCF4.js → Presence-DqPb-1P1.js} +1 -1
- package/dist/web/assets/{ProfileAuthorChip-BqT9Vv65.js → ProfileAuthorChip-Dm5GjcAt.js} +1 -1
- package/dist/web/assets/ProjectAgentsPage-B5r0DKWL.js +5 -0
- package/dist/web/assets/ProjectJudgmentPolicy-BHyiqKLV.css +1 -0
- package/dist/web/assets/ProjectJudgmentPolicy-DVFV5Cai.js +2 -0
- package/dist/web/assets/{RecentNotices-vJobVOcm.js → RecentNotices-DYXEBfYm.js} +1 -1
- package/dist/web/assets/{RoundtablesPage-C3dYekQ5.js → RoundtablesPage-DlAXApKi.js} +2 -2
- package/dist/web/assets/{RovingFocusGroup-CUqyjFSs.js → RovingFocusGroup-CI4aZr1z.js} +1 -1
- package/dist/web/assets/{RovingFocusItem-CyyuWXjE.js → RovingFocusItem-C_N843Nb.js} +1 -1
- package/dist/web/assets/{SessionMigrationPage-DukDM0TP.js → SessionMigrationPage-CVKkTACn.js} +1 -1
- package/dist/web/assets/{SessionRecordsPage-DZ5ZBiuS.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-BKLFJiSu.js → TagVocabularyPage-Bd57YcUL.js} +1 -1
- package/dist/web/assets/TaskBlockerClear-DGaXP2ak.js +1 -0
- package/dist/web/assets/TaskBlockerNotice-8nogmPA-.js +1 -0
- package/dist/web/assets/{TaskReason-D5j7L8tl.js → TaskReason-BxYwBDoB.js} +1 -1
- package/dist/web/assets/{TeamCard-CDunbIrP.js → TeamCard-cWYC5z07.js} +1 -1
- package/dist/web/assets/{TeamCardsWidget-CUW-fPn7.js → TeamCardsWidget-BOf6oHOp.js} +1 -1
- package/dist/web/assets/{TeamIsland-CmpDmIX2.js → TeamIsland-BD5s-zFZ.js} +1 -1
- package/dist/web/assets/{Teleport-Dzdr8umQ.js → Teleport-DhMmMHjy.js} +1 -1
- package/dist/web/assets/{TextField-BPhEpEv9.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-BEQ067LV.js → UiChip-BFdfq8Jm.js} +1 -1
- package/dist/web/assets/{UiChip-DulygSq8.css → UiChip-BiUmvjdz.css} +1 -1
- package/dist/web/assets/{UiDisclosure-L6GEJHSw.js → UiDisclosure-G3MiGB7F.js} +1 -1
- package/dist/web/assets/UiIcon--qI1_q89.js +1 -0
- package/dist/web/assets/UiSegmented-CRJ06vHP.js +1 -0
- package/dist/web/assets/{UiWeight-D-2iZ_Kc.js → UiWeight-BRA-6EY_.js} +1 -1
- package/dist/web/assets/{VirtualDirectoryList-BV8KsA-Z.js → VirtualDirectoryList-Dm07NMxq.js} +1 -1
- package/dist/web/assets/{VisuallyHidden-BxKxuXRF.js → VisuallyHidden-DIg8c_z2.js} +1 -1
- package/dist/web/assets/{VisuallyHiddenInput-DD4vhlqT.js → VisuallyHiddenInput-rcWqHewS.js} +1 -1
- package/dist/web/assets/WidgetSlot-C5h--noP.js +2 -0
- package/dist/web/assets/{WorkbenchListHead-B0TjHsTO.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-B1Je-mpY.js → agent-apps-Svxh5tiY.js} +1 -1
- package/dist/web/assets/agent-occupation-Dhoz7LjT.js +1 -0
- package/dist/web/assets/{agent-pins-DxHlJ96z.js → agent-pins-CvATgFji.js} +1 -1
- package/dist/web/assets/agent-profile-TuRobv9N.css +1 -0
- package/dist/web/assets/agent-roster-records-CsYjmaNn.js +1 -0
- package/dist/web/assets/{agent-work-summary-o_9-QWBL.js → agent-work-summary-BOeJ4JXc.js} +1 -1
- package/dist/web/assets/{agent-workflows-DgdbJqpg.js → agent-workflows-BS4KlKFj.js} +1 -1
- package/dist/web/assets/{attach-closest-edge-DUc_VUVO.js → attach-closest-edge-DFoBNGBU.js} +1 -1
- package/dist/web/assets/{attention-store-Bod20yM3.js → attention-store-CHxXJTuF.js} +1 -1
- package/dist/web/assets/{badge-tMy2Qr94.js → badge-DqHf-RNw.js} +1 -1
- package/dist/web/assets/{button-DnKFsImW.js → button-CdYobu4m.js} +1 -1
- package/dist/web/assets/{card-Ccu7HCNb.js → card-8xZot-73.js} +1 -1
- package/dist/web/assets/{catalog-CJUV8OJ6.js → catalog-h6KbvKdB.js} +1 -1
- package/dist/web/assets/{checkbox-D1R6kTUB.js → checkbox-DZ6CDZ8r.js} +1 -1
- package/dist/web/assets/{client-D-G2i5VU.js → client-DRnUmjCk.js} +1 -1
- package/dist/web/assets/{client-links-store-UgmraFBZ.js → client-links-store-DQY0A5PC.js} +1 -1
- package/dist/web/assets/{combobox-C7QLYGzs.js → combobox-DE0HzdKP.js} +1 -1
- package/dist/web/assets/console-BF8ZU9dG.js +1 -0
- package/dist/web/assets/conversation-launcher-settings-D4vYOpHN.js +1 -0
- package/dist/web/assets/{copy-mention-C0EJhDPy.js → copy-mention-Crs0NIJB.js} +1 -1
- package/dist/web/assets/{dialog-Bbq93W68.js → dialog-Bg5NVU4Y.js} +1 -1
- package/dist/web/assets/{dist-PpsW5ZE3.js → dist--2DWcoU9.js} +1 -1
- package/dist/web/assets/{dist-Dd8yFhv6.js → dist-INkzWhVF.js} +1 -1
- package/dist/web/assets/{dropdown-menu-1fGUL0V3.js → dropdown-menu-C5Kf9x2y.js} +1 -1
- package/dist/web/assets/{field-DjVv_wIS.js → field-7G2bSNl5.js} +1 -1
- package/dist/web/assets/{format-bytes-BKq_E0Hs.js → format-bytes-Jj3-0UhP.js} +1 -1
- package/dist/web/assets/{hover-card-BO-929hq.js → hover-card-llxR7wrX.js} +1 -1
- package/dist/web/assets/index-C2o_v2mq.js +24 -0
- package/dist/web/assets/index-HRZACEmh.css +1 -0
- package/dist/web/assets/{input-DmwRmYO2.js → input-z5o2wIZC.js} +1 -1
- package/dist/web/assets/{label-BvwPUTS4.js → label-BtTrlS8e.js} +1 -1
- package/dist/web/assets/label-table-CuTFbFd3.js +1 -0
- package/dist/web/assets/{model-0TZRbkN2.js → model-BD6AfoOR.js} +1 -1
- package/dist/web/assets/model-BKg9fdsn.js +3 -0
- package/dist/web/assets/{model-BF_ZMPLi.js → model-BMd98Yux.js} +1 -1
- package/dist/web/assets/{model-CaR7VPg7.js → model-Bb0VtRJH.js} +1 -1
- package/dist/web/assets/{model-Tmn6HvL-.js → model-Bhyqm3my.js} +1 -1
- package/dist/web/assets/model-Big7Ppeu.js +1 -0
- package/dist/web/assets/{model-Dfe81jZT.js → model-CCaA3vRN.js} +1 -1
- package/dist/web/assets/{model-y7OUvtKz.js → model-CGfhtR6w.js} +1 -1
- package/dist/web/assets/{model-DpkZUZUL.js → model-Ejc2vysd.js} +1 -1
- package/dist/web/assets/{motion-C1fZrqmI.js → motion-Cw_hptY4.js} +1 -1
- package/dist/web/assets/{motion-mAmbRj_M.js → motion-pePEUhOt.js} +1 -1
- package/dist/web/assets/{motion-preference-Dz9S1bZa.js → motion-preference-DTwjqiJ8.js} +1 -1
- package/dist/web/assets/{occupation-catalog-_SnxxRbK.js → occupation-catalog-ByjQk0EY.js} +1 -1
- package/dist/web/assets/{occupation-kits-DFC6Auuc.js → occupation-kits-Dg6UZqc1.js} +1 -1
- package/dist/web/assets/{option-DC8frdbr.js → option-BIjYeAh2.js} +1 -1
- package/dist/web/assets/{orchestration-filters-UeiAHJqn.js → orchestration-filters-3AfjDoHQ.js} +1 -1
- package/dist/web/assets/overview-data-BIeNATEJ.js +1 -0
- package/dist/web/assets/{page-refresh-DdRJaxMv.js → page-refresh-BTqRX45n.js} +1 -1
- package/dist/web/assets/{page-title-Cm9u_qw1.js → page-title-B5RyNTPD.js} +1 -1
- package/dist/web/assets/{person-profile-BH2AzOfw.js → person-profile-BzPwdtix.js} +1 -1
- package/dist/web/assets/{popover-DW__YCSE.js → popover-BsWyCEy5.js} +1 -1
- package/dist/web/assets/popup-host-DWJ1gygp.js +1 -0
- package/dist/web/assets/{profile-model-DtISOJ-X.js → profile-model-TAsyybji.js} +1 -1
- package/dist/web/assets/{project-board-layout-CTM8kAgq.js → project-board-layout-BwyHItDc.js} +1 -1
- package/dist/web/assets/{project-capture-B3pNhpFF.js → project-capture-I8-7JwsK.js} +1 -1
- package/dist/web/assets/{project-origin-BO8Ngccf.js → project-origin-B_Ku288r.js} +1 -1
- package/dist/web/assets/{quick-edit-api-B169r5Qb.js → quick-edit-api-Cm-W3ZVP.js} +1 -1
- package/dist/web/assets/{radio-group-DqA46cXQ.js → radio-group-DJ5np5d_.js} +1 -1
- package/dist/web/assets/review-api-Gwr5nP1B.js +1 -0
- package/dist/web/assets/{review-list-BbV-Mle7.js → review-list-CNeXKjBw.js} +1 -1
- package/dist/web/assets/review-store-BaMwO51r.js +1 -0
- package/dist/web/assets/{role-names-By0xdfTn.js → role-names-C-F0XIE1.js} +1 -1
- package/dist/web/assets/{roundtable-live-u9qUU6aA.js → roundtable-live-CM4Cqw2v.js} +1 -1
- package/dist/web/assets/{runtime-dom.esm-bundler-DhFy4Djs.js → runtime-dom.esm-bundler-tA5o2TEo.js} +1 -1
- package/dist/web/assets/{select-TqPBladU.js → select-DJ7iyJ-X.js} +1 -1
- package/dist/web/assets/{session-launch-offers-CtQeY4Qk.js → session-launch-offers-CEdCRTz9.js} +1 -1
- package/dist/web/assets/{settings-autosave-C7vW3_SP.js → settings-autosave-D3wBf_zN.js} +1 -1
- package/dist/web/assets/settings-tabs-B9pCaEFP.js +1 -0
- package/dist/web/assets/{npm-copies-GRyMAduA.css → settings-tabs-C9VDs91j.css} +1 -1
- package/dist/web/assets/shared-report-KyuP8oQk.js +3 -0
- package/dist/web/assets/source-adapters-BR-AAGhD.js +1 -0
- package/dist/web/assets/{switch-D7w_0h3m.js → switch-BoOtTu6O.js} +1 -1
- package/dist/web/assets/{tabs-DR8k0PN9.js → tabs-D0TAS18R.js} +1 -1
- package/dist/web/assets/{task-card-fields-X1ZYCm_j.js → task-card-fields-BWlLtcKE.js} +1 -1
- package/dist/web/assets/task-evidence-DydhKn9x.js +1 -0
- package/dist/web/assets/{task-labels-LuXoQhF9.js → task-labels-BrNKooHK.js} +1 -1
- package/dist/web/assets/{task-reason-ChpbGtyx.js → task-reason-CvmaNQWE.js} +1 -1
- package/dist/web/assets/{team-sheets-DYCQqa8I.js → team-sheets-DkAuebg6.js} +1 -1
- package/dist/web/assets/{textarea-D53VYanK.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-Hy9nqMs7.js → useAgentRecords-PysQYF4V.js} +1 -1
- package/dist/web/assets/{useAgentWorkSummary-mloD4p12.js → useAgentWorkSummary-DaNyOo2z.js} +1 -1
- package/dist/web/assets/{useApi-CROJJdhE-DnUGUb8O.js → useApi-CROJJdhE-CgPyy2pi.js} +1 -1
- package/dist/web/assets/{useClipboardCopy-BTuQMeWI.js → useClipboardCopy-Cf3GZrHC.js} +1 -1
- package/dist/web/assets/{useFocusReturn-4hUmSzj9.js → useFocusReturn-uY18_eDg.js} +1 -1
- package/dist/web/assets/{useForwardExpose-BDmW7q7u.js → useForwardExpose-Ci_aBJDg.js} +1 -1
- package/dist/web/assets/{useForwardPropsEmits-BzT2luD4.js → useForwardPropsEmits-mGaDeNMp.js} +1 -1
- package/dist/web/assets/useForwardScopeId-DYW8CZTp.js +1 -0
- package/dist/web/assets/{useKnowledgeConfirm-L8wnJCuX.js → useKnowledgeConfirm-PcqqgwNU.js} +1 -1
- package/dist/web/assets/{useKnowledgeItemPeek-C_huXt6E.js → useKnowledgeItemPeek-yjyrSFtf.js} +1 -1
- package/dist/web/assets/{useMinimumLoadingDisplay-Dkl8NQru.js → useMinimumLoadingDisplay-Bu6xyHby.js} +1 -1
- package/dist/web/assets/{usePageTools-CbDOdIrg.js → usePageTools-DYi9x7HJ.js} +1 -1
- package/dist/web/assets/usePrimitiveElement-DdC34jzt.js +1 -0
- package/dist/web/assets/{useProjectAgentRoster-BBmRvcgr.js → useProjectAgentRoster-KPwWl2jE.js} +1 -1
- package/dist/web/assets/{useRoutePeek-CRbCDqsm.js → useRoutePeek-BiHDBRKc.js} +1 -1
- package/dist/web/assets/useTeamPeople-Od3dDz6d.js +1 -0
- package/dist/web/assets/{useTeamWork-CXEQwF4n.js → useTeamWork-CDKVZwYe.js} +1 -1
- package/dist/web/assets/{useTypeahead-CVYuxPOD.js → useTypeahead-D_Z5P9Xm.js} +1 -1
- package/dist/web/assets/{utils-BsGjKHV8.js → utils-CAAvfQSj.js} +1 -1
- package/dist/web/assets/{utils-BnrWDlfm.js → utils-D6RjkXrh.js} +1 -1
- package/dist/web/assets/{verification-DbCo_dnY.js → verification-DoN2EFaZ.js} +1 -1
- package/dist/web/assets/version-DbJq2Cfv.js +1 -0
- package/dist/web/assets/{vue-router-D4_ms6om.js → vue-router-BwoPnYha.js} +1 -1
- package/dist/web/index.html +80 -87
- package/docs/agent-conversations-and-collaboration.md +6 -0
- package/docs/agent-interface-architecture.md +4 -1
- package/docs/agent-roundtable.md +45 -3
- package/docs/client-connections.md +29 -5
- package/docs/employee-agents.md +1 -1
- package/docs/external-knowledge-architecture.md +8 -3
- package/docs/judgment-and-autonomy.md +8 -4
- package/docs/project-agent-memory.md +12 -1
- package/graph-provider/fuli_graph/app.py +14 -234
- package/graph-provider/fuli_graph/auth.py +10 -0
- package/graph-provider/fuli_graph/builtin_embedding.py +388 -0
- package/graph-provider/fuli_graph/builtin_embedding_routes.py +53 -0
- package/graph-provider/fuli_graph/client_coverage.py +2 -2
- package/graph-provider/fuli_graph/config.py +3 -0
- package/graph-provider/fuli_graph/knowledge_duplicates.py +27 -15
- package/graph-provider/fuli_graph/knowledge_index_scan.py +13 -6
- package/graph-provider/fuli_graph/knowledge_search.py +142 -77
- package/graph-provider/fuli_graph/knowledge_semantic.py +47 -11
- package/graph-provider/fuli_graph/knowledge_semantic_index.py +5 -3
- package/graph-provider/fuli_graph/knowledge_tags.py +5 -10
- package/graph-provider/fuli_graph/models.py +16 -81
- package/graph-provider/fuli_graph/personal_global_preference_models.py +0 -23
- package/graph-provider/fuli_graph/personal_global_preferences.py +5 -630
- package/graph-provider/fuli_graph/preference_conflicts.py +3 -1
- package/graph-provider/fuli_graph/preference_organizing.py +162 -0
- package/graph-provider/fuli_graph/project_agent_delegations.py +6 -1
- package/graph-provider/fuli_graph/project_agent_executor_models.py +0 -26
- package/graph-provider/fuli_graph/project_agent_models.py +1 -0
- package/graph-provider/fuli_graph/project_agent_routes.py +22 -27
- package/graph-provider/fuli_graph/project_agent_task_models.py +26 -20
- package/graph-provider/fuli_graph/project_agent_work_log.py +4 -2
- package/graph-provider/fuli_graph/project_knowledge.py +2 -1
- package/graph-provider/fuli_graph/retired_graph_labels.py +30 -0
- package/graph-provider/fuli_graph/store_identity.py +4 -16
- package/graph-provider/fuli_graph/store_project_agent_executor_learning.py +0 -7
- package/graph-provider/fuli_graph/store_project_agent_executor_routing.py +0 -2
- package/graph-provider/fuli_graph/store_project_agent_executors.py +0 -8
- 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_task_recruitment.py +1 -61
- package/graph-provider/fuli_graph/store_project_agent_tasks.py +18 -1
- package/graph-provider/fuli_graph/store_project_agents.py +1 -1
- package/graph-provider/fuli_graph/store_projects.py +0 -151
- package/graph-provider/fuli_graph/store_publication.py +1 -160
- package/graph-provider/fuli_graph/store_records.py +0 -43
- package/graph-provider/fuli_graph/store_task_contexts.py +10 -0
- package/graph-provider/fuli_graph/task_blocker.py +10 -0
- package/graph-provider/fuli_graph/task_checkpoint_amendment.py +77 -0
- package/graph-provider/fuli_graph/task_context_auto_close.py +1 -1
- package/graph-provider/fuli_graph/task_context_models.py +19 -0
- package/graph-provider/fuli_graph/task_context_routes.py +5 -1
- package/graph-provider/fuli_graph/workflow_candidate_models.py +1 -61
- package/graph-provider/fuli_graph/workflow_candidates.py +7 -446
- package/graph-provider/fuli_graph/workflow_observation_models.py +1 -1
- 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 -4
- 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 +26 -2
- package/packages/roundtable/src/agents/session-log.js +29 -7
- package/packages/roundtable/src/host.js +7 -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/near-names.js +27 -0
- package/packages/roundtable/src/roundtable/reply-inbox.js +6 -2
- package/packages/roundtable/src/roundtable/service.js +191 -49
- package/packages/roundtable/src/roundtable/stand-in.js +64 -0
- package/packages/roundtable/src/roundtable/store.js +19 -7
- package/packages/roundtable/src/roundtable/wake-ladder.js +63 -0
- package/packages/roundtable/src/roundtable/wake.js +10 -1
- package/packages/roundtable/src/standalone/cli.js +1 -1
- package/packages/roundtable/src/standalone/mcp.js +0 -5
- package/packages/roundtable/src/standalone/serve.js +13 -0
- package/registry/embedding-models.json +208 -0
- package/skills/capturing-session-knowledge/SKILL.md +2 -2
- package/skills/capturing-session-knowledge/references/capture.md +15 -34
- package/skills/capturing-session-knowledge/references/coordination.md +67 -4
- package/skills/capturing-session-knowledge/references/retrieval.md +9 -13
- package/skills/grilling-project/SKILL.md +8 -53
- package/skills/grilling-project/agents/openai.yaml +2 -2
- package/skills/grilling-project/references/project-profile.md +18 -27
- package/skills/operating-fuli/SKILL.md +56 -11
- package/skills/operating-fuli/references/workflow-recipes.md +8 -4
- package/src/agent-apps/host-tools/catalog.js +2 -25
- package/src/agent-delegation/port.js +1 -1
- package/src/agent-delegation/refusals.js +12 -4
- package/src/agent-kits/client-detection.js +14 -4
- package/src/agent-kits/installer-manifest.js +16 -5
- package/src/agent-kits/pack-manifest.js +7 -2
- package/src/agent-kits/pins.js +6 -6
- package/src/agent-kits/session-clients.js +1 -0
- package/src/agent-kits/vendor/agent-installer/README.md +1 -1
- package/src/agent-roundtable/task-context.js +1 -1
- package/src/agent-roundtable/tools.js +7 -4
- package/src/agent-roundtable/turn-receipt.js +65 -0
- package/src/agent-tools/graph-definitions.js +4 -2
- package/src/agent-tools/graph-handlers.js +9 -46
- package/src/agent-tools/interface-catalog.js +20 -15
- package/src/agent-tools/interface-definitions.js +3 -9
- package/src/agent-tools/judgment-definitions.js +1 -1
- package/src/agent-tools/knowledge-curation-definitions.js +1 -63
- package/src/agent-tools/knowledge-definitions.js +11 -124
- package/src/agent-tools/project-agent-definitions.js +2 -2
- package/src/agent-tools/project-agent-tool-definitions.js +0 -16
- package/src/agent-tools/project-organizing-definitions.js +34 -0
- package/src/agent-tools/project-space-definitions.js +6 -83
- package/src/agent-tools/retired-tools.js +37 -0
- package/src/agent-tools/session-fuli-gate.js +6 -1
- package/src/agent-tools/task-entry-definitions.js +4 -3
- package/src/agent-tools/tonborg-question-definitions.js +3 -3
- package/src/agent-tools.js +5 -1
- package/src/agents/choice-answers.js +2 -1
- package/src/agents/claude-code/choice-answers.js +2 -24
- package/src/agents/claude-desktop/app-control.js +23 -0
- package/src/agents/client-apps.js +8 -0
- package/src/agents/codex/choice-answers.js +61 -0
- package/src/agents/codex/lifecycle-hook.js +6 -12
- package/src/agents/dsh/bundle.js +50 -0
- package/src/agents/dsh/lifecycle-hook.js +18 -0
- package/src/agents/dsh/plugin.js +111 -0
- package/src/agents/identity-receipt.js +22 -5
- package/src/agents/jsonl-tail.js +35 -0
- package/src/agents/native-session-env.js +7 -0
- package/src/agents/opencode/lifecycle-hook.js +9 -174
- package/src/agents/opencode/plugin-file.js +7 -29
- package/src/agents/opencode/plugin.js +3 -76
- package/src/agents/plugin-hook-process.js +87 -0
- package/src/agents/plugin-lifecycle-hook.js +174 -0
- package/src/agents/plugin-module-source.js +26 -0
- package/src/agents/source-applications.js +3 -3
- package/src/agents/token-usage-resolver.js +0 -6
- package/src/cli/clients-command.js +3 -3
- package/src/cli/command-registry.js +1 -2
- package/src/cli/connect-command.js +1 -1
- package/src/cli/mcp-command.js +1 -1
- package/src/cli/setup-command.js +3 -2
- package/src/cli.js +0 -5
- package/src/conversations/entry-budget.js +4 -3
- package/src/conversations/entry-inline-budget.js +40 -10
- package/src/conversations/person-words.js +0 -5
- package/src/conversations/preference-lifecycle.js +3 -3
- package/src/conversations/turn-findings.js +9 -2
- package/src/data-format/local-stores.js +6 -0
- package/src/debug-turns/model-request.js +2 -27
- package/src/desktop/npm-copy-data.js +20 -6
- package/src/embedding-models/manifest.js +147 -0
- package/src/embedding-models/port.js +117 -0
- package/src/embedding-models/registry.js +24 -0
- package/src/embedding-models/store.js +208 -0
- package/src/external-knowledge/connectors/custom.js +4 -0
- package/src/external-knowledge/connectors/mcp.js +13 -1
- package/src/external-knowledge/connectors/response-values.js +8 -0
- package/src/external-knowledge/connectors/retrieval-api.js +5 -1
- package/src/external-knowledge/service.js +22 -5
- package/src/graphiti/agent-conversations.js +3 -2
- package/src/graphiti/agent-knowledge-workflows.js +1 -6
- package/src/graphiti/agent-project-resolution.js +18 -0
- package/src/graphiti/capture-change-confirmation.js +1 -1
- package/src/graphiti/checkpoint-amendment.js +50 -0
- package/src/graphiti/checkpoint-capture.js +7 -3
- package/src/graphiti/checkpoint-save-status.js +71 -0
- package/src/graphiti/collaboration-preference-entry.js +5 -2
- package/src/graphiti/current-project-knowledge-search.js +3 -3
- package/src/graphiti/federated-application.js +11 -132
- package/src/graphiti/first-run-guide.js +25 -4
- package/src/graphiti/fla-mention.js +48 -9
- package/src/graphiti/fuli-markup.js +1 -1
- package/src/graphiti/human-review-channel.js +4 -2
- package/src/graphiti/knowledge-curation.js +12 -24
- package/src/graphiti/knowledge-provider-mapping.js +0 -21
- package/src/graphiti/knowledge-reader.js +0 -7
- package/src/graphiti/knowledge-spaces.js +36 -0
- package/src/graphiti/local-runtimes.js +9 -1
- package/src/graphiti/personal-global-preference-candidates.js +0 -44
- package/src/graphiti/project-agent-control-plane.js +5 -12
- package/src/graphiti/project-agent-mapping.js +0 -13
- package/src/graphiti/project-agent-task-summaries.js +82 -0
- package/src/graphiti/project-agent-workflows.js +8 -21
- package/src/graphiti/project-path-context.js +23 -9
- package/src/graphiti/provider-client.js +41 -168
- package/src/graphiti/reply-echo-group.js +7 -6
- package/src/graphiti/repository-remote.js +34 -8
- package/src/graphiti/roundtable-host.js +14 -1
- package/src/graphiti/session-knowledge-capture.js +5 -31
- 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 +86 -0
- package/src/graphiti/task-entry-preferences.js +23 -6
- package/src/graphiti/task-entry-project-scope.js +24 -1
- package/src/graphiti/task-knowledge-checkpoint.js +30 -14
- package/src/graphiti/task-preference-pages.js +3 -3
- package/src/graphiti/task-preference-reader.js +44 -9
- package/src/graphiti/topic-proposals.js +31 -8
- package/src/graphiti/topic-team-handoff.js +121 -0
- package/src/graphiti/worker-task-context.js +1 -1
- package/src/graphiti/workflow-learning.js +0 -25
- package/src/graphiti/workspace-provider-client.js +4 -50
- package/src/http/api-router.js +18 -0
- package/src/http/capture-onboarding-api-router.js +13 -4
- package/src/http/embedding-models-api-router.js +36 -0
- package/src/http/graph-api-router.js +3 -125
- package/src/http/project-organizing-api-router.js +27 -0
- package/src/http/reply-echo-api-router.js +2 -2
- package/src/http/request-policy.js +0 -4
- package/src/http/task-blocker-api-router.js +11 -1
- package/src/http/task-close-api-router.js +59 -0
- package/src/judgment/acceptance.js +2 -2
- package/src/judgment/agent-view.js +8 -8
- package/src/judgment/conversation.js +75 -69
- package/src/judgment/engine.js +39 -37
- package/src/judgment/explain-method.js +8 -7
- package/src/judgment/http.js +5 -3
- package/src/judgment/question-options.js +117 -74
- package/src/judgment/question-tools.js +54 -34
- package/src/judgment/review-delegation.js +32 -7
- package/src/judgment/review-egress.js +25 -0
- package/src/judgment/review-prompt.js +29 -33
- package/src/judgment/routing.js +4 -3
- package/src/judgment/service.js +51 -9
- package/src/judgment/verdict-schema.js +2 -7
- package/src/knowledge-hard-delete/console-port.js +1 -7
- package/src/knowledge-hard-delete/forget-references.js +1 -1
- package/src/knowledge-owner-reads/console-port.js +8 -19
- package/src/mcp/chat-listing.js +1 -1
- package/src/mcp/create-mcp-server.js +13 -33
- package/src/mcp/direct-call.js +3 -4
- package/src/mcp/preference-delivery.js +65 -5
- package/src/mcp/provider-task-context-registry.js +14 -0
- package/src/mcp/session-id.js +13 -37
- package/src/mcp/tool-annotations.js +3 -44
- package/src/mcp/tool-result.js +8 -6
- package/src/model-backends/adapters/builtin-embeddings.js +44 -0
- package/src/model-backends/adapters/registry.js +3 -1
- package/src/model-backends/config.js +24 -4
- package/src/model-backends/egress.js +8 -0
- package/src/model-backends/failures.js +8 -0
- package/src/model-backends/port.js +46 -17
- package/src/model-backends/role-trust.js +3 -9
- package/src/model-backends/runtime.js +6 -13
- package/src/model-backends/secret-store.js +2 -20
- package/src/model-backends/usage-ledger.js +20 -9
- package/src/native-runtime/runtime.js +13 -2
- package/src/presence/windows-helper-pin.js +1 -1
- package/src/project-organizing/agent-tool.js +92 -0
- package/src/project-organizing/model-tiers.js +31 -0
- package/src/project-organizing/port.js +130 -0
- package/src/server.js +29 -13
- package/src/setup/agents/claude-code/descriptor.json +1 -5
- package/src/setup/agents/codex/descriptor.json +1 -5
- package/src/setup/agents/cursor/descriptor.json +1 -5
- package/src/setup/agents/descriptor-schema.js +4 -1
- package/src/setup/agents/opencode/descriptor.json +1 -5
- package/src/setup/paths.js +1 -0
- package/src/system/client-connection-install.js +12 -2
- package/src/system/client-connection-status.js +90 -20
- package/src/system/client-restart.js +72 -0
- package/src/system/configured-install.js +103 -0
- package/src/system/doctor-repair.js +3 -1
- package/src/system/doctor.js +3 -1
- package/src/system/system-service.js +14 -2
- 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.0.json +13 -0
- package/src/whats-new/lines/0.27.1.json +13 -0
- package/dist/web/assets/AgentAppsPage-5VW0uCTz.js +0 -1
- package/dist/web/assets/AgentProfilePage-BLeyT3By.js +0 -5
- package/dist/web/assets/AgentServicesPage-BXi152Xc.js +0 -1
- package/dist/web/assets/Breadcrumb-DtM5lZy5.js +0 -1
- package/dist/web/assets/CaptureChangePage-BzwcfacI.js +0 -1
- package/dist/web/assets/ConnectionsPage-C_vgqwF2.js +0 -1
- package/dist/web/assets/ConnectionsPage-DS2PEG6K.css +0 -1
- package/dist/web/assets/DataFormatPage-DwL4Ofc9.js +0 -2
- package/dist/web/assets/DebugTurnPage-UpK_3ZWY.js +0 -1
- package/dist/web/assets/DebugTurnsPage-C0aZg5-3.js +0 -1
- package/dist/web/assets/EmployeeScopeDialog-Bt3ZlDyZ.js +0 -1
- package/dist/web/assets/EmployeeWorkbench-GtJIUD5G.js +0 -4
- package/dist/web/assets/FieldRoot-DRf4wM5x.js +0 -1
- package/dist/web/assets/FlasPage-CgIVOGFM.js +0 -1
- package/dist/web/assets/InboxPage-1ue8vA7H.css +0 -1
- package/dist/web/assets/InboxPage-zNUnnYeJ.js +0 -6
- package/dist/web/assets/KnowledgeItemEditPage-DGRNkAYd.js +0 -1
- package/dist/web/assets/KnowledgeOrganizerPage-BWvF1GEu.js +0 -1
- package/dist/web/assets/KnowledgePage--Z4_kAhq.js +0 -1
- package/dist/web/assets/KnowledgePeek-BgzQA9SI.js +0 -1
- package/dist/web/assets/KnowledgeWorkspace-0yOpWtEB.js +0 -4
- package/dist/web/assets/KnowledgeWorkspace-BgWo6lBj.css +0 -1
- package/dist/web/assets/ModelSettingsPage-B9PS1Kay.css +0 -1
- package/dist/web/assets/ModelSettingsPage-BL6MsF7C.js +0 -1
- package/dist/web/assets/NoticeRow-BXZWn4EZ.js +0 -1
- package/dist/web/assets/OccupationsPage-CkVqZ2pz.js +0 -1
- package/dist/web/assets/OverviewPage-_9e2idJR.js +0 -1
- package/dist/web/assets/PageOutline-CFGtHmOK.js +0 -1
- package/dist/web/assets/PageOutline-DG5ZYtA8.css +0 -1
- package/dist/web/assets/PersonalProfilePage-TxsNr44t.js +0 -1
- package/dist/web/assets/PersonalProjectsPage-AhgP6CL8.js +0 -1
- package/dist/web/assets/ProjectAgentsPage-O-cMavcz.js +0 -5
- package/dist/web/assets/ProjectJudgmentPolicy-CyHAu0nm.js +0 -2
- package/dist/web/assets/ProjectJudgmentPolicy-DnjMniaz.css +0 -1
- package/dist/web/assets/PublicProjectsPage-Ck1QSR0R.js +0 -1
- package/dist/web/assets/PublicProjectsPage-CskSzffL.css +0 -1
- package/dist/web/assets/SettingsPage-Cj3pEWcd.css +0 -1
- package/dist/web/assets/SettingsPage-bLssMIz6.js +0 -1
- package/dist/web/assets/SharedJefaReportPage-DUY03VLS.js +0 -1
- package/dist/web/assets/TaskBlockerClear-BxOiiuK8.js +0 -1
- package/dist/web/assets/TaskBlockerNotice-iUiD3BuZ.js +0 -1
- package/dist/web/assets/TonborgDelegationSwitch-C1nkJqkJ.js +0 -1
- package/dist/web/assets/TonborgDelegationSwitch-DeqERWoo.css +0 -1
- package/dist/web/assets/UiDialog-JjqzOA0z.js +0 -1
- package/dist/web/assets/UiIcon-vgD4v8q8.js +0 -1
- package/dist/web/assets/UiIconButton-BzyMc14P.js +0 -1
- package/dist/web/assets/UiIconButton-ZCBdABdM.css +0 -1
- package/dist/web/assets/UiSegmented-CIIm3KoV.js +0 -1
- package/dist/web/assets/WidgetSlot-Dw5nWlb7.js +0 -2
- package/dist/web/assets/WorkbenchListPage-D0xX-YNl.js +0 -1
- package/dist/web/assets/_plugin-vue_export-helper-B4pFJCwG.js +0 -9
- package/dist/web/assets/agent-occupation-CjfQqSzd.js +0 -1
- package/dist/web/assets/agent-profile-BNPLhDog.css +0 -1
- package/dist/web/assets/agent-roster-records-Bi5HWDif.js +0 -1
- package/dist/web/assets/console-DgRc8Itw.js +0 -1
- package/dist/web/assets/conversation-launcher-settings-CZAfuu8B.js +0 -1
- package/dist/web/assets/identity-DIG-uOiU.js +0 -1
- package/dist/web/assets/index-C2VDC1uO.js +0 -24
- package/dist/web/assets/index-DF0TcfPY.css +0 -1
- package/dist/web/assets/label-table-CDzYRZpc.js +0 -1
- package/dist/web/assets/model-BjUERpoQ.js +0 -3
- package/dist/web/assets/npm-copies-BLRc0FXW.js +0 -1
- package/dist/web/assets/overview-data-Cq1gefY5.js +0 -1
- package/dist/web/assets/popup-host-ctKYu9Ze.js +0 -1
- package/dist/web/assets/review-api-CJaNgPMA.js +0 -1
- package/dist/web/assets/review-store-DSQpb5P8.js +0 -1
- package/dist/web/assets/shared-report-DQBSigHB.js +0 -3
- package/dist/web/assets/source-adapters-DPJzumzC.js +0 -1
- package/dist/web/assets/task-evidence-DIbw2U42.js +0 -1
- package/dist/web/assets/ui-D4nAhcmu.css +0 -1
- package/dist/web/assets/ui-DmNbL8MW.js +0 -1
- package/dist/web/assets/useForwardScopeId-DZCnSswO.js +0 -1
- package/dist/web/assets/usePrimitiveElement-tPQM7XJs.js +0 -1
- package/dist/web/assets/useTeamPeople-D_5cxxf1.js +0 -1
- package/dist/web/assets/version-lXtOG8uf.js +0 -1
- package/docs/public-personal-architecture.md +0 -73
- package/graph-provider/fuli_graph/common_knowledge.py +0 -459
- package/graph-provider/fuli_graph/common_knowledge_models.py +0 -54
- package/graph-provider/fuli_graph/project_management.py +0 -251
- package/skills/flreview/SKILL.md +0 -101
- package/skills/flreview/agents/openai.yaml +0 -6
- package/src/agent-tools/project-relation-definitions.js +0 -36
- package/src/agents/codex/acp-process.js +0 -244
- package/src/agents/codex/acp-session.js +0 -190
- package/src/agents/codex/acp-worker.js +0 -54
- package/src/agents/codex/review-command.js +0 -29
- package/src/cli/worker-command.js +0 -80
- package/src/graphiti/checkpoint-provider-outage.js +0 -23
- package/src/graphiti/common-knowledge-candidates.js +0 -222
- package/src/graphiti/public-project-relations.js +0 -28
- package/src/graphiti/public-projects.js +0 -125
- package/src/graphiti/public-submission-reconciliation.js +0 -37
- package/src/graphiti/public-submission.js +0 -77
- package/src/graphiti/publication-draft-capture.js +0 -28
- package/src/graphiti/publication-draft-input.js +0 -11
- package/src/graphiti/publication-review-queues.js +0 -50
- package/src/graphiti/worker-plan-host.js +0 -92
- package/src/graphiti/worker-run-host.js +0 -287
- package/src/graphiti/workflow-observation.js +0 -72
- package/src/mcp/common-knowledge-preview-tokens.js +0 -67
- package/src/server/worker-plan-runtime.js +0 -56
|
@@ -2,6 +2,10 @@ import hashlib
|
|
|
2
2
|
import hmac
|
|
3
3
|
import secrets
|
|
4
4
|
|
|
5
|
+
from fastapi import HTTPException
|
|
6
|
+
|
|
7
|
+
HUMAN_PROOF_REQUIRED = 'independent human review proof required'
|
|
8
|
+
|
|
5
9
|
|
|
6
10
|
def issue_access_token() -> str:
|
|
7
11
|
return secrets.token_urlsafe(48)
|
|
@@ -33,3 +37,9 @@ def matches_workflow_observation_token(
|
|
|
33
37
|
if not provided or not expected:
|
|
34
38
|
return False
|
|
35
39
|
return hmac.compare_digest(provided, expected)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def require_human_proof(actor: dict, operation_actor: str) -> None:
|
|
43
|
+
"""A change recorded as the person's own needs the console's human-review proof."""
|
|
44
|
+
if operation_actor == 'human' and actor.get('_human_review_verified') is not True:
|
|
45
|
+
raise HTTPException(status_code=403, detail=HUMAN_PROOF_REQUIRED)
|
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
"""A small embedding model run on this computer (search by meaning without a
|
|
2
|
+
model service).
|
|
3
|
+
|
|
4
|
+
The person picks a model from FULI's catalog; Node downloads its three data
|
|
5
|
+
files (config.json, vocab.txt, model.safetensors), checks their digests and
|
|
6
|
+
writes `fuli-model.json` beside them. This module turns texts into vectors
|
|
7
|
+
with them. It needs nothing but numpy: a safetensors file is a JSON header
|
|
8
|
+
and raw arrays (it cannot carry code), the tokenizer is BERT's WordPiece, and
|
|
9
|
+
the network is a plain BERT encoder. Nothing is loaded until the first text
|
|
10
|
+
arrives, and one model is kept at a time.
|
|
11
|
+
"""
|
|
12
|
+
import json
|
|
13
|
+
import math
|
|
14
|
+
import mmap
|
|
15
|
+
import re
|
|
16
|
+
import threading
|
|
17
|
+
import unicodedata
|
|
18
|
+
from pathlib import Path
|
|
19
|
+
|
|
20
|
+
import numpy as np
|
|
21
|
+
|
|
22
|
+
MODEL_ID = re.compile(r'[a-z0-9](?:[a-z0-9._-]{0,62}[a-z0-9])?')
|
|
23
|
+
SPEC_FILE = 'fuli-model.json'
|
|
24
|
+
MAX_HEADER_BYTES = 8 * 1024 * 1024
|
|
25
|
+
MAX_WORD_CHARS = 100
|
|
26
|
+
# No array of a small encoder has more axes or a longer axis than this.
|
|
27
|
+
MAX_DIMENSIONS = 4
|
|
28
|
+
MAX_AXIS = 1_000_000
|
|
29
|
+
# What the catalog's models stay well inside; a config beyond it is not one FULI runs.
|
|
30
|
+
MAX_LAYERS = 48
|
|
31
|
+
MAX_HEADS = 64
|
|
32
|
+
MAX_POSITIONS = 8192
|
|
33
|
+
BATCH = 16
|
|
34
|
+
_DTYPES = {'F32': np.float32, 'F16': np.float16, 'F64': np.float64, 'I64': np.int64, 'I32': np.int32}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class BuiltinEmbeddingError(Exception):
|
|
38
|
+
"""The model is not on this computer, or its files are not ones this module runs."""
|
|
39
|
+
|
|
40
|
+
def __init__(self, code: str, message: str):
|
|
41
|
+
super().__init__(message)
|
|
42
|
+
self.code = code
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def read_safetensors(path: Path) -> dict[str, np.ndarray]:
|
|
46
|
+
"""Every array of a safetensors file as float32 (integers as they are),
|
|
47
|
+
read through a memory map, so pages the model never touches stay on disk."""
|
|
48
|
+
try:
|
|
49
|
+
with open(path, 'rb') as handle:
|
|
50
|
+
mapped = mmap.mmap(handle.fileno(), 0, access=mmap.ACCESS_READ)
|
|
51
|
+
except (OSError, ValueError) as error:
|
|
52
|
+
# An empty file cannot be mapped.
|
|
53
|
+
raise BuiltinEmbeddingError('model_invalid', 'The model file is empty or cannot be read') from error
|
|
54
|
+
arrays: dict[str, np.ndarray] = {}
|
|
55
|
+
try:
|
|
56
|
+
if len(mapped) < 8:
|
|
57
|
+
raise BuiltinEmbeddingError('model_invalid', 'The model file is too short')
|
|
58
|
+
header_bytes = int.from_bytes(mapped[:8], 'little')
|
|
59
|
+
if not 2 <= header_bytes <= min(MAX_HEADER_BYTES, len(mapped) - 8):
|
|
60
|
+
raise BuiltinEmbeddingError('model_invalid', 'The model file has no readable header')
|
|
61
|
+
try:
|
|
62
|
+
header = json.loads(mapped[8:8 + header_bytes].decode('utf-8'))
|
|
63
|
+
except (UnicodeDecodeError, json.JSONDecodeError, RecursionError) as error:
|
|
64
|
+
raise BuiltinEmbeddingError('model_invalid', 'The model file has no readable header') from error
|
|
65
|
+
if not isinstance(header, dict):
|
|
66
|
+
raise BuiltinEmbeddingError('model_invalid', 'The model file has no readable header')
|
|
67
|
+
start = 8 + header_bytes
|
|
68
|
+
for name, entry in header.items():
|
|
69
|
+
if name == '__metadata__':
|
|
70
|
+
continue
|
|
71
|
+
if not isinstance(entry, dict):
|
|
72
|
+
raise BuiltinEmbeddingError('model_invalid', f'The model file describes an array wrongly: {name}')
|
|
73
|
+
dtype = _DTYPES.get(entry.get('dtype'))
|
|
74
|
+
offsets = entry.get('data_offsets')
|
|
75
|
+
shape = entry.get('shape')
|
|
76
|
+
if not (isinstance(offsets, list) and len(offsets) == 2 and all(type(value) is int for value in offsets)
|
|
77
|
+
and isinstance(shape, list) and len(shape) <= MAX_DIMENSIONS
|
|
78
|
+
and all(type(size) is int and 0 < size <= MAX_AXIS for size in shape)):
|
|
79
|
+
raise BuiltinEmbeddingError('model_invalid', f'The model file describes an array wrongly: {name}')
|
|
80
|
+
begin, end = offsets
|
|
81
|
+
shape = tuple(shape)
|
|
82
|
+
if dtype is None or not 0 <= begin <= end <= len(mapped) - start:
|
|
83
|
+
raise BuiltinEmbeddingError('model_invalid', f'The model file holds an array this version cannot read: {name}')
|
|
84
|
+
count = int(np.prod(shape)) if shape else 1
|
|
85
|
+
if count * np.dtype(dtype).itemsize != end - begin:
|
|
86
|
+
raise BuiltinEmbeddingError('model_invalid', f'The model file holds an array of the wrong size: {name}')
|
|
87
|
+
array = np.frombuffer(mapped, dtype=dtype, count=count, offset=start + begin).reshape(shape)
|
|
88
|
+
arrays[name] = array.astype(np.float32) if dtype in (np.float16, np.float64) else array
|
|
89
|
+
return arrays
|
|
90
|
+
except BaseException:
|
|
91
|
+
# A file that is refused is let go at once: Windows keeps a mapped file from being replaced.
|
|
92
|
+
arrays.clear()
|
|
93
|
+
try:
|
|
94
|
+
mapped.close()
|
|
95
|
+
except BufferError:
|
|
96
|
+
pass
|
|
97
|
+
raise
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
class WordPiece:
|
|
101
|
+
"""BERT's tokenizer: clean the text, put spaces around CJK characters and
|
|
102
|
+
punctuation, optionally lowercase and strip accents, then split each word
|
|
103
|
+
into the longest pieces the vocabulary holds. Some models lowercase the
|
|
104
|
+
text but keep its accents, so the two are set apart."""
|
|
105
|
+
|
|
106
|
+
def __init__(self, vocabulary: list[str], lowercase: bool, strip_accents: bool):
|
|
107
|
+
self.ids = {token: index for index, token in enumerate(vocabulary)}
|
|
108
|
+
self.lowercase = lowercase
|
|
109
|
+
self.strip_accents = strip_accents
|
|
110
|
+
for token in ('[UNK]', '[CLS]', '[SEP]', '[PAD]'):
|
|
111
|
+
if token not in self.ids:
|
|
112
|
+
raise BuiltinEmbeddingError('model_invalid', f'The vocabulary has no {token}')
|
|
113
|
+
self.unknown, self.cls, self.sep, self.pad = (self.ids[token] for token in ('[UNK]', '[CLS]', '[SEP]', '[PAD]'))
|
|
114
|
+
|
|
115
|
+
def encode(self, text: str, limit: int) -> list[int]:
|
|
116
|
+
pieces = []
|
|
117
|
+
for word in self._words(text):
|
|
118
|
+
pieces.extend(self._pieces(word))
|
|
119
|
+
if len(pieces) >= limit - 2:
|
|
120
|
+
break
|
|
121
|
+
return [self.cls, *pieces[:limit - 2], self.sep]
|
|
122
|
+
|
|
123
|
+
def _words(self, text: str) -> list[str]:
|
|
124
|
+
spaced = []
|
|
125
|
+
for char in text:
|
|
126
|
+
code = ord(char)
|
|
127
|
+
if code in (0, 0xFFFD) or _is_control(char):
|
|
128
|
+
continue
|
|
129
|
+
if _is_cjk(code):
|
|
130
|
+
spaced.extend((' ', char, ' '))
|
|
131
|
+
else:
|
|
132
|
+
spaced.append(' ' if _is_space(char) else char)
|
|
133
|
+
words = []
|
|
134
|
+
for word in ''.join(spaced).split():
|
|
135
|
+
if self.lowercase:
|
|
136
|
+
word = word.lower()
|
|
137
|
+
if self.strip_accents:
|
|
138
|
+
word = ''.join(char for char in unicodedata.normalize('NFD', word) if unicodedata.category(char) != 'Mn')
|
|
139
|
+
current = []
|
|
140
|
+
for char in word:
|
|
141
|
+
if _is_punctuation(char):
|
|
142
|
+
if current:
|
|
143
|
+
words.append(''.join(current))
|
|
144
|
+
current = []
|
|
145
|
+
words.append(char)
|
|
146
|
+
else:
|
|
147
|
+
current.append(char)
|
|
148
|
+
if current:
|
|
149
|
+
words.append(''.join(current))
|
|
150
|
+
return words
|
|
151
|
+
|
|
152
|
+
def _pieces(self, word: str) -> list[int]:
|
|
153
|
+
if len(word) > MAX_WORD_CHARS:
|
|
154
|
+
return [self.unknown]
|
|
155
|
+
pieces, start = [], 0
|
|
156
|
+
while start < len(word):
|
|
157
|
+
end, found = len(word), None
|
|
158
|
+
while start < end:
|
|
159
|
+
found = self.ids.get(('##' if start else '') + word[start:end])
|
|
160
|
+
if found is not None:
|
|
161
|
+
break
|
|
162
|
+
end -= 1
|
|
163
|
+
if found is None:
|
|
164
|
+
return [self.unknown]
|
|
165
|
+
pieces.append(found)
|
|
166
|
+
start = end
|
|
167
|
+
return pieces
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
def _is_space(char: str) -> bool:
|
|
171
|
+
return char in ' \t\n\r' or unicodedata.category(char) == 'Zs'
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
def _is_control(char: str) -> bool:
|
|
175
|
+
return char not in '\t\n\r' and unicodedata.category(char).startswith('C')
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
def _is_punctuation(char: str) -> bool:
|
|
179
|
+
code = ord(char)
|
|
180
|
+
return (33 <= code <= 47 or 58 <= code <= 64 or 91 <= code <= 96 or 123 <= code <= 126
|
|
181
|
+
or unicodedata.category(char).startswith('P'))
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
def _is_cjk(code: int) -> bool:
|
|
185
|
+
return (0x4E00 <= code <= 0x9FFF or 0x3400 <= code <= 0x4DBF or 0x20000 <= code <= 0x2A6DF
|
|
186
|
+
or 0x2A700 <= code <= 0x2B73F or 0x2B740 <= code <= 0x2B81F or 0x2B820 <= code <= 0x2CEAF
|
|
187
|
+
or 0xF900 <= code <= 0xFAFF or 0x2F800 <= code <= 0x2FA1F)
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def _erf(values: np.ndarray) -> np.ndarray:
|
|
191
|
+
"""Abramowitz and Stegun 7.1.26 (error under 1.5e-7): numpy has no erf."""
|
|
192
|
+
sign = np.sign(values)
|
|
193
|
+
x = np.abs(values)
|
|
194
|
+
t = 1.0 / (1.0 + 0.3275911 * x)
|
|
195
|
+
poly = ((((1.061405429 * t - 1.453152027) * t + 1.421413741) * t - 0.284496736) * t + 0.254829592) * t
|
|
196
|
+
return sign * (1.0 - poly * np.exp(-x * x))
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
def _gelu(values: np.ndarray) -> np.ndarray:
|
|
200
|
+
return (0.5 * values * (1.0 + _erf(values / math.sqrt(2.0)))).astype(np.float32)
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
class BertEncoder:
|
|
204
|
+
"""A BERT encoder's forward pass over its stored weights."""
|
|
205
|
+
|
|
206
|
+
def __init__(self, weights: dict[str, np.ndarray], config: dict):
|
|
207
|
+
prefix = next((name[:-len('embeddings.word_embeddings.weight')] for name in weights
|
|
208
|
+
if name.endswith('embeddings.word_embeddings.weight')), None)
|
|
209
|
+
if prefix is None or config.get('model_type', 'bert') != 'bert' \
|
|
210
|
+
or config.get('position_embedding_type', 'absolute') != 'absolute' \
|
|
211
|
+
or config.get('hidden_act', 'gelu') != 'gelu':
|
|
212
|
+
raise BuiltinEmbeddingError('model_unsupported', 'Only BERT encoders with absolute positions and GELU are supported')
|
|
213
|
+
self.weights = {name[len(prefix):]: array for name, array in weights.items() if name.startswith(prefix)}
|
|
214
|
+
try:
|
|
215
|
+
self.layers = int(config['num_hidden_layers'])
|
|
216
|
+
self.heads = int(config['num_attention_heads'])
|
|
217
|
+
self.epsilon = float(config.get('layer_norm_eps', 1e-12))
|
|
218
|
+
self.positions = int(config.get('max_position_embeddings', 512))
|
|
219
|
+
except (KeyError, TypeError, ValueError) as error:
|
|
220
|
+
raise BuiltinEmbeddingError('model_invalid', 'The model config lacks its sizes') from error
|
|
221
|
+
# A layer norm divides by sqrt(variance + epsilon): zero, negative or not a number gives no vectors.
|
|
222
|
+
if not 0 < self.epsilon < 1:
|
|
223
|
+
raise BuiltinEmbeddingError('model_invalid', 'The model config has an epsilon no encoder has')
|
|
224
|
+
if not (0 < self.layers <= MAX_LAYERS and 0 < self.heads <= MAX_HEADS and 0 < self.positions <= MAX_POSITIONS):
|
|
225
|
+
raise BuiltinEmbeddingError('model_invalid', 'The model config has sizes no encoder has')
|
|
226
|
+
try:
|
|
227
|
+
words = self._get('embeddings.word_embeddings.weight')
|
|
228
|
+
positions = self._get('embeddings.position_embeddings.weight')
|
|
229
|
+
for layer in range(self.layers):
|
|
230
|
+
self._get(f'encoder.layer.{layer}.output.dense.weight')
|
|
231
|
+
except KeyError as error:
|
|
232
|
+
raise BuiltinEmbeddingError('model_unsupported', f'The model file lacks {error.args[0]}') from error
|
|
233
|
+
if words.ndim != 2 or positions.ndim != 2 or positions.shape[1] != words.shape[1]:
|
|
234
|
+
raise BuiltinEmbeddingError('model_invalid', 'The model file has embeddings of the wrong shape')
|
|
235
|
+
self.hidden = words.shape[1]
|
|
236
|
+
self.vocabulary = words.shape[0]
|
|
237
|
+
# A text is never longer than the positions the file really holds.
|
|
238
|
+
self.positions = min(self.positions, positions.shape[0])
|
|
239
|
+
if self.hidden % self.heads:
|
|
240
|
+
raise BuiltinEmbeddingError('model_invalid', 'The model config does not fit its weights')
|
|
241
|
+
|
|
242
|
+
def _get(self, name: str) -> np.ndarray:
|
|
243
|
+
return self.weights[name]
|
|
244
|
+
|
|
245
|
+
def _norm(self, values: np.ndarray, name: str) -> np.ndarray:
|
|
246
|
+
gain = self.weights.get(f'{name}.weight', self.weights.get(f'{name}.gamma'))
|
|
247
|
+
bias = self.weights.get(f'{name}.bias', self.weights.get(f'{name}.beta'))
|
|
248
|
+
mean = values.mean(axis=-1, keepdims=True)
|
|
249
|
+
variance = ((values - mean) ** 2).mean(axis=-1, keepdims=True)
|
|
250
|
+
return (values - mean) / np.sqrt(variance + self.epsilon) * gain + bias
|
|
251
|
+
|
|
252
|
+
def _dense(self, values: np.ndarray, name: str) -> np.ndarray:
|
|
253
|
+
return values @ self._get(f'{name}.weight').T + self._get(f'{name}.bias')
|
|
254
|
+
|
|
255
|
+
def forward(self, token_ids: np.ndarray, mask: np.ndarray) -> np.ndarray:
|
|
256
|
+
"""token_ids, mask: (batch, length). Answers (batch, length, hidden)."""
|
|
257
|
+
batch, length = token_ids.shape
|
|
258
|
+
hidden = (self._get('embeddings.word_embeddings.weight')[token_ids]
|
|
259
|
+
+ self._get('embeddings.position_embeddings.weight')[:length]
|
|
260
|
+
+ self._get('embeddings.token_type_embeddings.weight')[0])
|
|
261
|
+
hidden = self._norm(hidden, 'embeddings.LayerNorm')
|
|
262
|
+
width = self.hidden // self.heads
|
|
263
|
+
# Padding never receives attention.
|
|
264
|
+
blocked = ((1.0 - mask)[:, None, None, :] * -1e9).astype(np.float32)
|
|
265
|
+
|
|
266
|
+
def split(values):
|
|
267
|
+
return values.reshape(batch, length, self.heads, width).transpose(0, 2, 1, 3)
|
|
268
|
+
|
|
269
|
+
for layer in range(self.layers):
|
|
270
|
+
base = f'encoder.layer.{layer}'
|
|
271
|
+
query = split(self._dense(hidden, f'{base}.attention.self.query'))
|
|
272
|
+
key = split(self._dense(hidden, f'{base}.attention.self.key'))
|
|
273
|
+
value = split(self._dense(hidden, f'{base}.attention.self.value'))
|
|
274
|
+
scores = query @ key.transpose(0, 1, 3, 2) / math.sqrt(width) + blocked
|
|
275
|
+
scores = np.exp(scores - scores.max(axis=-1, keepdims=True))
|
|
276
|
+
attention = scores / scores.sum(axis=-1, keepdims=True)
|
|
277
|
+
context = (attention @ value).transpose(0, 2, 1, 3).reshape(batch, length, self.hidden)
|
|
278
|
+
hidden = self._norm(self._dense(context, f'{base}.attention.output.dense') + hidden,
|
|
279
|
+
f'{base}.attention.output.LayerNorm')
|
|
280
|
+
inner = _gelu(self._dense(hidden, f'{base}.intermediate.dense'))
|
|
281
|
+
hidden = self._norm(self._dense(inner, f'{base}.output.dense') + hidden, f'{base}.output.LayerNorm')
|
|
282
|
+
return hidden
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
class BuiltinEmbeddingModel:
|
|
286
|
+
"""One downloaded model: texts in, unit vectors out."""
|
|
287
|
+
|
|
288
|
+
def __init__(self, directory: Path):
|
|
289
|
+
try:
|
|
290
|
+
spec = json.loads((directory / SPEC_FILE).read_text(encoding='utf-8'))
|
|
291
|
+
config = json.loads((directory / 'config.json').read_text(encoding='utf-8'))
|
|
292
|
+
vocabulary = (directory / 'vocab.txt').read_text(encoding='utf-8').split('\n')
|
|
293
|
+
except RecursionError as error:
|
|
294
|
+
raise BuiltinEmbeddingError('model_invalid', 'The model description is nested too deep') from error
|
|
295
|
+
except (OSError, UnicodeDecodeError, json.JSONDecodeError) as error:
|
|
296
|
+
raise BuiltinEmbeddingError('model_missing', 'This model is not downloaded on this computer') from error
|
|
297
|
+
if vocabulary and vocabulary[-1] == '':
|
|
298
|
+
vocabulary.pop()
|
|
299
|
+
if not isinstance(spec, dict) or not isinstance(config, dict):
|
|
300
|
+
raise BuiltinEmbeddingError('model_invalid', 'The model description is not an object')
|
|
301
|
+
self.revision = spec.get('revision') if isinstance(spec.get('revision'), str) else ''
|
|
302
|
+
self.pooling = spec.get('pooling')
|
|
303
|
+
if self.pooling not in ('cls', 'mean'):
|
|
304
|
+
raise BuiltinEmbeddingError('model_unsupported', 'Only cls and mean pooling are supported')
|
|
305
|
+
self.tokenizer = WordPiece([token.rstrip('\r') for token in vocabulary], bool(spec.get('lowercase')),
|
|
306
|
+
bool(spec.get('stripAccents')))
|
|
307
|
+
if not (directory / 'model.safetensors').is_file():
|
|
308
|
+
raise BuiltinEmbeddingError('model_missing', 'This model is not downloaded on this computer')
|
|
309
|
+
self.encoder = BertEncoder(read_safetensors(directory / 'model.safetensors'), config)
|
|
310
|
+
if len(self.tokenizer.ids) > self.encoder.vocabulary:
|
|
311
|
+
raise BuiltinEmbeddingError('model_invalid', 'The vocabulary is longer than the model knows')
|
|
312
|
+
limit = spec.get('maxTokens')
|
|
313
|
+
self.limit = max(2, min(limit if type(limit) is int and limit > 0 else 512, self.encoder.positions))
|
|
314
|
+
self.dimensions = self.encoder.hidden
|
|
315
|
+
|
|
316
|
+
def embed(self, texts: list[str]) -> tuple[list[list[float]], int]:
|
|
317
|
+
"""The texts' vectors in order, and how many tokens they were."""
|
|
318
|
+
encoded = [self.tokenizer.encode(text, self.limit) for text in texts]
|
|
319
|
+
vectors: list[list[float] | None] = [None] * len(texts)
|
|
320
|
+
# Similar lengths share a batch, so a short text is not padded to a long one.
|
|
321
|
+
order = sorted(range(len(texts)), key=lambda index: len(encoded[index]))
|
|
322
|
+
for start in range(0, len(order), BATCH):
|
|
323
|
+
chosen = order[start:start + BATCH]
|
|
324
|
+
length = max(len(encoded[index]) for index in chosen)
|
|
325
|
+
ids = np.full((len(chosen), length), self.tokenizer.pad, dtype=np.int64)
|
|
326
|
+
mask = np.zeros((len(chosen), length), dtype=np.float32)
|
|
327
|
+
for row, index in enumerate(chosen):
|
|
328
|
+
ids[row, :len(encoded[index])] = encoded[index]
|
|
329
|
+
mask[row, :len(encoded[index])] = 1.0
|
|
330
|
+
hidden = self.encoder.forward(ids, mask)
|
|
331
|
+
pooled = hidden[:, 0] if self.pooling == 'cls' \
|
|
332
|
+
else (hidden * mask[:, :, None]).sum(axis=1) / mask.sum(axis=1, keepdims=True)
|
|
333
|
+
pooled = pooled / np.maximum(np.linalg.norm(pooled, axis=1, keepdims=True), 1e-12)
|
|
334
|
+
for row, index in enumerate(chosen):
|
|
335
|
+
vectors[index] = [round(float(value), 6) for value in pooled[row]]
|
|
336
|
+
return vectors, sum(len(item) for item in encoded)
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
def _load(folder: Path) -> BuiltinEmbeddingModel:
|
|
340
|
+
"""The model in a folder; files that are not what they claim are one refusal, never a stray error."""
|
|
341
|
+
try:
|
|
342
|
+
return BuiltinEmbeddingModel(folder)
|
|
343
|
+
except BuiltinEmbeddingError:
|
|
344
|
+
raise
|
|
345
|
+
except (ValueError, IndexError, KeyError, TypeError, AttributeError, ZeroDivisionError, OverflowError,
|
|
346
|
+
RecursionError, MemoryError) as error:
|
|
347
|
+
raise BuiltinEmbeddingError('model_invalid', 'The model files are not ones FULI can read') from error
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
class BuiltinEmbeddings:
|
|
351
|
+
"""The models directory; the model last asked for stays loaded."""
|
|
352
|
+
|
|
353
|
+
def __init__(self, directory: str | None):
|
|
354
|
+
self.directory = Path(directory) if directory else None
|
|
355
|
+
self._lock = threading.Lock()
|
|
356
|
+
self._loaded: tuple[str, float, BuiltinEmbeddingModel] | None = None
|
|
357
|
+
|
|
358
|
+
def embed(self, model_id: str, texts: list[str], revision: str | None = None) -> dict:
|
|
359
|
+
if self.directory is None:
|
|
360
|
+
raise BuiltinEmbeddingError('builtin_unavailable', 'Built-in models are not available in this installation')
|
|
361
|
+
if not MODEL_ID.fullmatch(model_id or ''):
|
|
362
|
+
raise BuiltinEmbeddingError('model_missing', 'This model is not downloaded on this computer')
|
|
363
|
+
folder = self.directory / model_id
|
|
364
|
+
with self._lock:
|
|
365
|
+
try:
|
|
366
|
+
stamp = (folder / SPEC_FILE).stat().st_mtime
|
|
367
|
+
except OSError as error:
|
|
368
|
+
self._loaded = None
|
|
369
|
+
raise BuiltinEmbeddingError('model_missing', 'This model is not downloaded on this computer') from error
|
|
370
|
+
# A model downloaded again (or removed) is read again.
|
|
371
|
+
if not self._loaded or self._loaded[:2] != (model_id, stamp):
|
|
372
|
+
self._loaded = None
|
|
373
|
+
self._loaded = (model_id, stamp, _load(folder))
|
|
374
|
+
model = self._loaded[2]
|
|
375
|
+
# The caller names the revision its index was built with; other files under the id are not that model.
|
|
376
|
+
if revision and not model.revision.startswith(revision):
|
|
377
|
+
raise BuiltinEmbeddingError('model_missing', 'The model on this computer is another revision')
|
|
378
|
+
try:
|
|
379
|
+
vectors, tokens = model.embed(texts)
|
|
380
|
+
except (ValueError, IndexError, KeyError, TypeError, ZeroDivisionError, FloatingPointError, MemoryError) as error:
|
|
381
|
+
# Weights whose shapes do not fit each other only show when they are multiplied.
|
|
382
|
+
self._loaded = None
|
|
383
|
+
raise BuiltinEmbeddingError('model_invalid', 'The model files do not fit together') from error
|
|
384
|
+
return {'model': model_id, 'dimensions': model.dimensions, 'vectors': vectors, 'tokens': tokens}
|
|
385
|
+
|
|
386
|
+
def unload(self) -> None:
|
|
387
|
+
with self._lock:
|
|
388
|
+
self._loaded = None
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"""The route that runs a downloaded embedding model (builtin_embedding.py).
|
|
2
|
+
|
|
3
|
+
Node asks with the model's catalog id and the texts; it gets vectors and how
|
|
4
|
+
many tokens they were. The texts never leave this computer.
|
|
5
|
+
"""
|
|
6
|
+
import asyncio
|
|
7
|
+
from typing import Annotated
|
|
8
|
+
|
|
9
|
+
from fastapi import HTTPException
|
|
10
|
+
from pydantic import Field
|
|
11
|
+
|
|
12
|
+
from .builtin_embedding import BuiltinEmbeddingError, BuiltinEmbeddings
|
|
13
|
+
from .model_base import StrictModel
|
|
14
|
+
|
|
15
|
+
MAX_TEXTS = 64
|
|
16
|
+
MAX_TEXT_CHARS = 32_000
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class BuiltinEmbeddingRequest(StrictModel):
|
|
20
|
+
model: str = Field(min_length=1, max_length=64)
|
|
21
|
+
# The start of the revision the caller indexed with; files of another revision are refused.
|
|
22
|
+
revision: str | None = Field(default=None, min_length=1, max_length=64)
|
|
23
|
+
texts: list[Annotated[str, Field(max_length=MAX_TEXT_CHARS)]] = Field(min_length=1, max_length=MAX_TEXTS)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class BuiltinEmbeddingAnswer(StrictModel):
|
|
27
|
+
model: str
|
|
28
|
+
dimensions: int
|
|
29
|
+
vectors: list[list[float]]
|
|
30
|
+
tokens: int
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# Not on this computer is the caller's to fix (download it); a file this version cannot run is refused.
|
|
34
|
+
_STATUS = {'model_missing': 404, 'builtin_unavailable': 404, 'model_unsupported': 422, 'model_invalid': 422}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def register_builtin_embedding_routes(application, settings, Actor) -> None:
|
|
38
|
+
models = BuiltinEmbeddings(settings.embedding_models_dir)
|
|
39
|
+
|
|
40
|
+
@application.post('/v1/builtin-embeddings', response_model=BuiltinEmbeddingAnswer)
|
|
41
|
+
async def builtin_embeddings(request: BuiltinEmbeddingRequest, actor: Actor):
|
|
42
|
+
try:
|
|
43
|
+
# The forward pass is CPU work: off the event loop, so other requests go on.
|
|
44
|
+
return await asyncio.to_thread(models.embed, request.model, request.texts, request.revision)
|
|
45
|
+
except BuiltinEmbeddingError as error:
|
|
46
|
+
raise HTTPException(status_code=_STATUS.get(error.code, 422),
|
|
47
|
+
detail={'code': error.code, 'message': str(error)}) from error
|
|
48
|
+
|
|
49
|
+
@application.post('/v1/builtin-embeddings/unload', status_code=204)
|
|
50
|
+
async def unload_builtin_embeddings(actor: Actor):
|
|
51
|
+
# Before a model's files are removed: Windows keeps a mapped file from being deleted.
|
|
52
|
+
# It waits for a running embed, so it waits off the event loop like the embed itself.
|
|
53
|
+
await asyncio.to_thread(models.unload)
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"""Which client a stored client or source list covers (rec#11 D-64).
|
|
2
2
|
|
|
3
3
|
OpenCode and Antigravity used the generic ``other`` source until each got its
|
|
4
|
-
own (``opencode``, ``antigravity``). A list written before that names
|
|
4
|
+
own (``opencode``, ``antigravity``, ``dsh``). A list written before that names
|
|
5
5
|
``other`` for it, so at read time a list that contains ``other`` and lacks
|
|
6
6
|
that client covers it too. No stored list is rewritten. The Node side applies
|
|
7
7
|
the same rule in ``src/agents/source-applications.js``.
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
|
-
LEGACY_ALIASES = {'opencode': 'other', 'antigravity': 'other'}
|
|
10
|
+
LEGACY_ALIASES = {'opencode': 'other', 'antigravity': 'other', 'dsh': 'other'}
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
def covers_client(clients, client):
|
|
@@ -22,6 +22,9 @@ class Settings(BaseSettings):
|
|
|
22
22
|
neo4j_password: str = Field(min_length=8)
|
|
23
23
|
neo4j_database: str = 'neo4j'
|
|
24
24
|
embedding_dim: int = 384
|
|
25
|
+
# Where Node keeps the embedding models a person downloaded (builtin_embedding.py);
|
|
26
|
+
# unset where the provider cannot read this computer's files.
|
|
27
|
+
embedding_models_dir: str | None = None
|
|
25
28
|
# Cosine of the local lexical-hash embedding at which a tag is proposed as a
|
|
26
29
|
# similar candidate; it is never merged. Unrelated random names stay below it
|
|
27
30
|
# (measured in test_knowledge_tags_http.py).
|
|
@@ -22,7 +22,7 @@ from fastapi import HTTPException
|
|
|
22
22
|
from .knowledge_audit import record_human_change
|
|
23
23
|
from .knowledge_audit_models import KnowledgeRevisionRecord
|
|
24
24
|
from .knowledge_duplicate_models import DuplicateMergeRequest, DuplicateMergeResult
|
|
25
|
-
from .knowledge_duplicate_rules import duplicate_merge, shape
|
|
25
|
+
from .knowledge_duplicate_rules import Merge, duplicate_merge, shape
|
|
26
26
|
from .knowledge_semantic import item_text
|
|
27
27
|
from .knowledge_versions import _END_OF_VALIDITY, invalid_property, item_revisions, lock_knowledge, \
|
|
28
28
|
record_version_revision
|
|
@@ -32,7 +32,6 @@ from .store_transactions import query_store_transaction
|
|
|
32
32
|
MERGE_REASON = 'The same knowledge was stored twice; this copy was merged into the item that stays current.'
|
|
33
33
|
CANDIDATE_LIMIT = 200
|
|
34
34
|
WORKFLOW_RELATION = 'RECOMMENDS_NEXT'
|
|
35
|
-
SCAN_LIMIT = 50
|
|
36
35
|
|
|
37
36
|
_ITEM_FIELDS = '''{
|
|
38
37
|
item_id: {item}.uuid, name: {item}.name, summary: {item}.summary, fact: {item}.fact,
|
|
@@ -55,6 +54,12 @@ def _fields(name: str, template: str = _ITEM_FIELDS, said_at: str | None = None)
|
|
|
55
54
|
return fields[:fields.rindex('}')] + f', said_at: {said_at}}}' if said_at else fields
|
|
56
55
|
|
|
57
56
|
|
|
57
|
+
def duplicate_item_fields(name: str, said_at: str | None = None) -> str:
|
|
58
|
+
"""What duplicate_pairs reads of the bound item `name`, as a Cypher map
|
|
59
|
+
projection; said_at is the expression of its latest source, if any."""
|
|
60
|
+
return _fields(name, said_at=said_at)
|
|
61
|
+
|
|
62
|
+
|
|
58
63
|
# Same type, current, not a preference; an entity's place is the [project,
|
|
59
64
|
# FLA] of the episodes that said it, as for the staleness check.
|
|
60
65
|
_ENTITY_CANDIDATES = f'''
|
|
@@ -193,22 +198,29 @@ async def merge_duplicates(store, actor, request: DuplicateMergeRequest) -> Dupl
|
|
|
193
198
|
records, _, _ = await scoped.runtime.driver.execute_query(
|
|
194
199
|
'// duplicate merge: scan\n' + (_ENTITY_SCAN if item_kind == 'entity' else _RELATIONSHIP_SCAN),
|
|
195
200
|
group_id=space['group_id'], workflow_relation=WORKFLOW_RELATION, routing_='r')
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
for group in groups:
|
|
203
|
-
for merge in _group_merges(group):
|
|
204
|
-
if len(merged) >= request.limit:
|
|
205
|
-
return DuplicateMergeResult(merged=merged)
|
|
206
|
-
if await _merge(scoped, actor, space, item_kind, merge, created_at=created_at):
|
|
207
|
-
merged.append({'item_kind': item_kind, 'item_id': merge.drop['item_id'],
|
|
208
|
-
'kept_item_id': merge.keep['item_id'], 'rule': merge.rule})
|
|
201
|
+
for merge in await duplicate_pairs(scoped, space, item_kind, records):
|
|
202
|
+
if len(merged) >= request.limit:
|
|
203
|
+
return DuplicateMergeResult(merged=merged)
|
|
204
|
+
if await _merge(scoped, actor, space, item_kind, merge, created_at=created_at):
|
|
205
|
+
merged.append({'item_kind': item_kind, 'item_id': merge.drop['item_id'],
|
|
206
|
+
'kept_item_id': merge.keep['item_id'], 'rule': merge.rule})
|
|
209
207
|
return DuplicateMergeResult(merged=merged)
|
|
210
208
|
|
|
211
209
|
|
|
210
|
+
async def duplicate_pairs(store, space, item_kind, records) -> list[Merge]:
|
|
211
|
+
"""Every merge the pair rules find among items already read, each record
|
|
212
|
+
{'item': _ITEM_FIELDS with said_at, 'kind_key', 'places'}: only items of
|
|
213
|
+
one kind key, sharing a place, are compared. Writes nothing; the periodic
|
|
214
|
+
pass merges them, the preference organising read proposes them to a person."""
|
|
215
|
+
items = {record['item']['item_id']: {**_record(item_kind, record['item']), 'kind_key': record['kind_key'],
|
|
216
|
+
'places': [tuple(place) for place in record['places']]}
|
|
217
|
+
for record in records}
|
|
218
|
+
apart = await _kept_apart(store, space, item_kind, items.values())
|
|
219
|
+
groups = _groups([item for item in items.values() if item['item_id'] not in apart])
|
|
220
|
+
await _with_meaning(store, space, item_kind, groups)
|
|
221
|
+
return [merge for group in groups for merge in _group_merges(group)]
|
|
222
|
+
|
|
223
|
+
|
|
212
224
|
def _groups(items) -> list[list[dict]]:
|
|
213
225
|
"""Items that may be one: same type (or relation), a shared place and the
|
|
214
226
|
same scope settings, then the same sentence or the same name."""
|
|
@@ -5,10 +5,14 @@ derived value is written.
|
|
|
5
5
|
|
|
6
6
|
Only current items of the space count, resting on no unresolved basis,
|
|
7
7
|
confirmed by a person or an Agent, and reachable through a scope (a
|
|
8
|
-
preference, an assignment, a source episode or a project reference).
|
|
8
|
+
preference, an assignment, a source episode or a project reference). The
|
|
9
|
+
meaning index also covers items still waiting for confirmation: a search that
|
|
10
|
+
asks for pending items finds them by meaning too, and default search still
|
|
11
|
+
never returns them. Derived
|
|
9
12
|
values (a meaning vector, retrieval terms) are an index: storing one writes no
|
|
10
13
|
history and changes no version, lock_version or timestamp.
|
|
11
14
|
"""
|
|
15
|
+
from .knowledge_weight import effective_confirmation_status
|
|
12
16
|
from .search_projection import is_default_retrievable
|
|
13
17
|
|
|
14
18
|
# Items read per query while looking through them.
|
|
@@ -66,26 +70,29 @@ def scan_query(item_kind: str) -> str:
|
|
|
66
70
|
'''
|
|
67
71
|
|
|
68
72
|
|
|
69
|
-
async def indexable_items(store, space, item_kind: str, after: str = ''):
|
|
70
|
-
"""The indexable items of one kind after `after`, in id order
|
|
73
|
+
async def indexable_items(store, space, item_kind: str, after: str = '', *, include_pending: bool = False):
|
|
74
|
+
"""The indexable items of one kind after `after`, in id order; with
|
|
75
|
+
include_pending, also those waiting for confirmation."""
|
|
71
76
|
while True:
|
|
72
77
|
records, _, _ = await store.runtime.driver.execute_query(
|
|
73
78
|
scan_query(item_kind), group_id=space['group_id'], space_id=space['id'], item_kind=item_kind,
|
|
74
79
|
after=after, chunk=SCAN_CHUNK, routing_='r')
|
|
75
80
|
for record in records:
|
|
76
|
-
if is_default_retrievable(record)
|
|
81
|
+
if is_default_retrievable(record) or (
|
|
82
|
+
include_pending and effective_confirmation_status(record) == 'pending'):
|
|
77
83
|
yield record
|
|
78
84
|
if len(records) < SCAN_CHUNK:
|
|
79
85
|
return
|
|
80
86
|
after = records[-1]['id']
|
|
81
87
|
|
|
82
88
|
|
|
83
|
-
async def indexable_from(store, space, after: str | None):
|
|
89
|
+
async def indexable_from(store, space, after: str | None, *, include_pending: bool = False):
|
|
84
90
|
"""Every indexable item of every kind from a page cursor on, as (kind, record)."""
|
|
85
91
|
start, item_id = page_cursor(after)
|
|
86
92
|
for kind_index in range(start, len(ITEM_KINDS)):
|
|
87
93
|
item_kind = ITEM_KINDS[kind_index]
|
|
88
|
-
async for record in indexable_items(store, space, item_kind, item_id if kind_index == start else ''
|
|
94
|
+
async for record in indexable_items(store, space, item_kind, item_id if kind_index == start else '',
|
|
95
|
+
include_pending=include_pending):
|
|
89
96
|
yield item_kind, record
|
|
90
97
|
|
|
91
98
|
|