fuli-context 0.23.0-beta.8 → 0.23.0
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-BHbNacTY.js → AboutPage-S8QFfzpA.js} +1 -1
- package/dist/web/assets/AboutSectionHeading-B5CzH4Zs.js +1 -0
- package/dist/web/assets/AboutSectionHeading-DjXpIV27.css +1 -0
- package/dist/web/assets/AgentAppsPage-BYXraPFM.js +1 -0
- package/dist/web/assets/{AgentHand-BGzGOjzl.js → AgentHand-BGGdVdd9.js} +1 -1
- package/dist/web/assets/AgentManagement-Bza8k5ra.js +7 -0
- package/dist/web/assets/AgentManagement-CeF4mjtg.css +1 -0
- package/dist/web/assets/AgentMentionCopy-C72hY2QL.js +1 -0
- package/dist/web/assets/{AgentName-C5HzUHaA.js → AgentName-CUjBNQ8j.js} +1 -1
- package/dist/web/assets/AgentProfilePage-D5QUzw5N.css +1 -0
- package/dist/web/assets/AgentProfilePage-kp7-gRRx.js +5 -0
- package/dist/web/assets/AgentServicesPage-IsGaz7FY.js +1 -0
- package/dist/web/assets/{AppViewerPage-N5C_6WLz.css → AppViewerPage-CJ0Zy6LA.css} +1 -1
- package/dist/web/assets/AppViewerPage-CcOlwxck.js +1 -0
- package/dist/web/assets/{BackToTop-SL4ai3_g.js → BackToTop-C3KYEoCW.js} +1 -1
- package/dist/web/assets/BoardCardFieldsMenu-BlBWT1j7.js +1 -0
- package/dist/web/assets/BoardMoveMenu-Bc7xC1Uh.js +1 -0
- package/dist/web/assets/Breadcrumb-BbwBNrG2.css +1 -0
- package/dist/web/assets/Breadcrumb-C_xMiD-Z.js +1 -0
- package/dist/web/assets/CaptureChangePage-Bekp1aWg.js +1 -0
- package/dist/web/assets/ConnectionsPage-BpvecWXD.js +1 -0
- package/dist/web/assets/{CopyFixPrompt-CCrPxN5x.js → CopyFixPrompt-Bp-UX4Hq.js} +1 -1
- package/dist/web/assets/DataFormatPage-dsy8d3oA.js +2 -0
- package/dist/web/assets/DataFormatPage-sSnjjUY4.css +1 -0
- package/dist/web/assets/DebugTurnPage-HdFAyc2D.css +1 -0
- package/dist/web/assets/DebugTurnPage-cIJV7xDW.js +1 -0
- package/dist/web/assets/DebugTurnsPage-B6Te_Alp.js +1 -0
- package/dist/web/assets/DebugTurnsPage-BFuOzyWR.css +1 -0
- package/dist/web/assets/{DialogTitle-CTKjDGQc.js → DialogTitle-Lj5s6nwG.js} +1 -1
- package/dist/web/assets/EmployeeRedirectPage-DnvwJeCN.js +1 -0
- package/dist/web/assets/EmployeeScopeDialog-CXNZ62Ab.js +1 -0
- package/dist/web/assets/EmployeeWorkbench-BhReI8l6.css +1 -0
- package/dist/web/assets/EmployeeWorkbench-DALIO-cM.js +4 -0
- package/dist/web/assets/FieldRoot-DRnAC66O.js +1 -0
- package/dist/web/assets/FlaGrowth-7wlv31Tl.js +1 -0
- package/dist/web/assets/FlaGrowth-BzXY8pcx.css +1 -0
- package/dist/web/assets/FlaTaskSheets-CNdaBy1P.js +1 -0
- package/dist/web/assets/FlasPage-BCs1Ffpf.js +1 -0
- package/dist/web/assets/{FlasPage-Cb6Q5lge.css → FlasPage-SLQDMv47.css} +1 -1
- package/dist/web/assets/{button-CaCh3Iim.css → GrowthLoading-CigPij0N.css} +1 -1
- package/dist/web/assets/GrowthLoading-Cr8xZwwO.js +1 -0
- package/dist/web/assets/HowtoPage-Cv1YQy1s.js +1 -0
- package/dist/web/assets/{HowtoPage-BRV2W1Go.css → HowtoPage-t12tDDpS.css} +1 -1
- package/dist/web/assets/{InboxPage-DSOmt6VL.js → InboxPage-CgJnymOY.js} +2 -2
- package/dist/web/assets/KnowledgeDeleteButton-FEyEvhlR.js +1 -0
- package/dist/web/assets/KnowledgeHardDeleteSection-CVwTeMEJ.js +1 -0
- package/dist/web/assets/KnowledgeItemEditPage-rwpM8cF1.js +1 -0
- package/dist/web/assets/{KnowledgeItemSummaryCard-D1h0e1Hn.js → KnowledgeItemSummaryCard-49EADY_Z.js} +1 -1
- package/dist/web/assets/KnowledgeOrganizerPage-7IdnjM3L.js +1 -0
- package/dist/web/assets/KnowledgePage-gxqOIZxf.js +1 -0
- package/dist/web/assets/KnowledgePeek-Bm5jRVA9.css +1 -0
- package/dist/web/assets/KnowledgePeek-CQyCxHFj.js +1 -0
- package/dist/web/assets/KnowledgeTurnReceiptPage-BOz7IpaK.js +1 -0
- package/dist/web/assets/KnowledgeWorkspace-A7zVb26p.js +4 -0
- package/dist/web/assets/KnowledgeWorkspace-DCoVFyf0.css +1 -0
- package/dist/web/assets/{MeAvatar-DHJA3h2E.js → MeAvatar-CYVcRiuW.js} +1 -1
- package/dist/web/assets/{MeLink-CU7zuYgD.js → MeLink-BdqkzhT6.js} +1 -1
- package/dist/web/assets/{MenuSeparator-DV3U0Y8_.js → MenuSeparator-quqkZZXY.js} +1 -1
- package/dist/web/assets/ModelSettingsPage-B8jC_uew.js +3 -0
- package/dist/web/assets/ModelSettingsPage-DhCn_SF6.css +1 -0
- package/dist/web/assets/{NotFoundPage-BMWxdf6r.js → NotFoundPage-Dmn32VWo.js} +1 -1
- package/dist/web/assets/OccupationsPage-BVREfX_R.js +1 -0
- package/dist/web/assets/OverviewPage-CHyEbdP4.js +1 -0
- package/dist/web/assets/OverviewPage-xdF5g6bZ.css +1 -0
- package/dist/web/assets/{PageColumns-D7jIeVv6.js → PageColumns-DpfaPeu7.js} +1 -1
- package/dist/web/assets/PageOutline-BKBQ1T4d.js +1 -0
- package/dist/web/assets/PageOutline-BqVgnlos.css +1 -0
- package/dist/web/assets/PersonalProfilePage-Cxp2gn6J.js +1 -0
- package/dist/web/assets/PersonalProjectsPage-821imOxR.js +1 -0
- package/dist/web/assets/{PinIcon-DzYhXU_p.js → PinIcon-B7dvh7ld.js} +1 -1
- package/dist/web/assets/{PopperContent-BnejG-fO.js → PopperContent-DNqbLkNa.js} +1 -1
- package/dist/web/assets/{Presence-o9BoSyBV.js → Presence-D3HKb5Hb.js} +1 -1
- package/dist/web/assets/ProfileAuthorChip-7HSHODdR.js +1 -0
- package/dist/web/assets/ProfileAuthorChip-C_0hzDoP.css +1 -0
- package/dist/web/assets/ProjectAgentsPage-DBsXS6Xa.js +5 -0
- package/dist/web/assets/{ProjectAgentsPage-Dt37ogX1.css → ProjectAgentsPage-RpfiV2Fm.css} +1 -1
- package/dist/web/assets/ProjectJudgmentPolicy-GA33aSRi.js +2 -0
- package/dist/web/assets/PublicProjectsPage-PJlBI8IE.js +1 -0
- package/dist/web/assets/{RoundtablesPage-C6vo4kl6.css → RoundtablesPage-DK9A9J-y.css} +1 -1
- package/dist/web/assets/{RoundtablesPage-B2mqkwwR.js → RoundtablesPage-DT5DUXsa.js} +2 -2
- package/dist/web/assets/{RovingFocusGroup-CKxT5j44.js → RovingFocusGroup-BB0d3k17.js} +1 -1
- package/dist/web/assets/{RovingFocusItem-Cr-XrVve.js → RovingFocusItem-CFd7tXzD.js} +1 -1
- package/dist/web/assets/SessionMigrationPage-BZ1lEDQr.js +1 -0
- package/dist/web/assets/SessionRecordsPage-BMAAtIAt.js +1 -0
- package/dist/web/assets/SettingsPage-BYNEk6BM.js +1 -0
- package/dist/web/assets/SettingsPage-Uj1IpZpS.css +1 -0
- package/dist/web/assets/SharedJefaReportPage-g35o6jUb.js +1 -0
- package/dist/web/assets/TagVocabularyPage-COubNJXz.js +1 -0
- package/dist/web/assets/{TaskBlockerClear-38qdj0bl.js → TaskBlockerClear-B5MpHdlh.js} +1 -1
- package/dist/web/assets/{TaskBlockerNotice--X8TtCGj.js → TaskBlockerNotice-CIN0HRiE.js} +1 -1
- package/dist/web/assets/{TaskReason-COiuiZVd.js → TaskReason-LQ0CFiKu.js} +1 -1
- package/dist/web/assets/{TeamCard-Bl4riuQt.css → TeamCard-CsmWDw2Q.css} +1 -1
- package/dist/web/assets/TeamCard-D-kLa5rT.js +1 -0
- package/dist/web/assets/TeamCardsWidget-DGX9k0S6.js +1 -0
- package/dist/web/assets/{TeamIsland-D8ycFpkZ.js → TeamIsland-BIo-l49b.js} +2 -2
- package/dist/web/assets/{Teleport-BAIkXp2z.js → Teleport-C1upABpY.js} +1 -1
- package/dist/web/assets/{TextField-BFGv0VA5.js → TextField-ZnmRqG0h.js} +1 -1
- package/dist/web/assets/{UiChip-h_SUumBM.js → UiChip-CizeOu1Q.js} +1 -1
- package/dist/web/assets/UiDialog-CGTzxn3-.js +1 -0
- package/dist/web/assets/{UiDisclosure-BO5EAYyS.js → UiDisclosure-ueMA4jl0.js} +1 -1
- package/dist/web/assets/UiIcon-sD1hUsOF.js +1 -0
- package/dist/web/assets/{UiIconButton-C0WP-F-p.js → UiIconButton-CCo4NPYv.js} +1 -1
- package/dist/web/assets/{UiNotice-NCEwjNQR.js → UiNotice-DGPFbVo7.js} +1 -1
- package/dist/web/assets/{UiSegmented-B49yYjJ3.js → UiSegmented-BZ-jqnPE.js} +1 -1
- package/dist/web/assets/{UiWeight-DRIwuLUX.js → UiWeight-BRO3oVMZ.js} +1 -1
- package/dist/web/assets/{VirtualDirectoryList-Dieq64pn.js → VirtualDirectoryList-BkV3gj5E.js} +1 -1
- package/dist/web/assets/{VisuallyHidden-DIWFV5lV.js → VisuallyHidden-B8wfJ_mU.js} +1 -1
- package/dist/web/assets/{VisuallyHiddenInput-WxcAZDj2.js → VisuallyHiddenInput-Bdcr9CwC.js} +1 -1
- package/dist/web/assets/WidgetSlot-DFojQaSo.js +2 -0
- package/dist/web/assets/_plugin-vue_export-helper-B9AJmZbc.js +9 -0
- package/dist/web/assets/{agent-apps-CXhZLNMa.js → agent-apps-CKGFfySp.js} +1 -1
- package/dist/web/assets/{agent-avatar-xTnj6P4n.js → agent-avatar-V6M_DF3r.js} +1 -1
- package/dist/web/assets/agent-occupation-PZ2YAIM8.js +1 -0
- package/dist/web/assets/{agent-pins-CMBM9w6b.js → agent-pins-8KX0ynzy.js} +1 -1
- package/dist/web/assets/agent-profile-Clb-gYu-.css +1 -0
- package/dist/web/assets/{agent-roster-records-pCYzR1as.js → agent-roster-records-PfAgndHp.js} +1 -1
- package/dist/web/assets/{agent-workflows-IeF737kp.js → agent-workflows-DQlqVOoA.js} +1 -1
- package/dist/web/assets/{attach-closest-edge-B34lttZK.js → attach-closest-edge-D2qlayPy.js} +1 -1
- package/dist/web/assets/{attention-store-BTKBC8TZ.js → attention-store-BnZ8l3kk.js} +1 -1
- package/dist/web/assets/{badge-Bnc2nVhV.js → badge-DX_xrLV6.js} +1 -1
- package/dist/web/assets/button-CEkPBC1E.js +1 -0
- package/dist/web/assets/button-CoXXgtY5.css +1 -0
- package/dist/web/assets/{card-B2JIXyum.js → card-DNQ0_6vT.js} +1 -1
- package/dist/web/assets/{catalog-C8eUDXUx.js → catalog-KnpBkv5t.js} +1 -1
- package/dist/web/assets/{checkbox-Blw3CguI.js → checkbox-DPyLHneg.js} +1 -1
- package/dist/web/assets/{client-AaxCWoEF.js → client-CSQcWFRh.js} +2 -2
- package/dist/web/assets/client-connection-model-vO2cap6a.js +1 -0
- package/dist/web/assets/{client-links-store-CmP5Qsfa.js → client-links-store-DMqe0MbK.js} +1 -1
- package/dist/web/assets/combobox-zUq9bkyM.js +1 -0
- package/dist/web/assets/{console-DtxpKdVW.js → console-DaoAO-EO.js} +1 -1
- package/dist/web/assets/{context-menu-DSGaOBX2.js → context-menu-CcGDnF_k.js} +1 -1
- package/dist/web/assets/{conversation-launcher-settings-DAL9Kf4y.js → conversation-launcher-settings-CXFE-q_A.js} +1 -1
- package/dist/web/assets/{dialog-CwFuZvhM.js → dialog-CxhKMo0D.js} +1 -1
- package/dist/web/assets/dist-B9GqMC5C.js +1 -0
- package/dist/web/assets/dist-DIJqkL4O.js +1 -0
- package/dist/web/assets/dropdown-menu-CXmMnCBh.js +1 -0
- package/dist/web/assets/field-LNsBZqam.js +1 -0
- package/dist/web/assets/{format-bytes-N7zRFzUD.js → format-bytes-Bqefdt37.js} +1 -1
- package/dist/web/assets/{identity-BUFzZs1s.js → identity-DRfhWjty.js} +1 -1
- package/dist/web/assets/index-B4AMPpl_.css +1 -0
- package/dist/web/assets/index-BYIOAXnn.js +2 -0
- package/dist/web/assets/{input-Db1wVnd4.js → input-UoZ-0Xne.js} +1 -1
- package/dist/web/assets/{label--RjFNYxb.js → label-DpjbTOxt.js} +1 -1
- package/dist/web/assets/label-table-BnWNYfyk.js +1 -0
- package/dist/web/assets/{model-crzN3PVX.js → model-13BQndfF.js} +1 -1
- package/dist/web/assets/{model-KuA63FiT.js → model-B5g0CFcM.js} +1 -1
- package/dist/web/assets/model-BYKHVgJr.js +1 -0
- package/dist/web/assets/{model-B5f68kqL.js → model-CDevUwUw.js} +1 -1
- package/dist/web/assets/model-CpuIG8Du.js +4 -0
- package/dist/web/assets/{model-B5dQs6Zt.js → model-P5fSGsiJ.js} +1 -1
- package/dist/web/assets/{model-DOf6QDiY.js → model-pJ6k3zYD.js} +1 -1
- package/dist/web/assets/{motion-CeLn8y1x.js → motion-C-ZimCUS.js} +1 -1
- package/dist/web/assets/{motion-wEp9RlID.js → motion-QY5FKKko.js} +1 -1
- package/dist/web/assets/{motion-preference-DfUreaML.js → motion-preference-BQiiwhab.js} +1 -1
- package/dist/web/assets/{occupation-catalog-Crs_Zc8R.js → occupation-catalog-uDDhZwKK.js} +1 -1
- package/dist/web/assets/{option-DCSIgajR.js → option-CcHPBOo6.js} +1 -1
- package/dist/web/assets/{orchestration-filters-Cu9KEzWE.js → orchestration-filters-DmF4Qs8E.js} +1 -1
- package/dist/web/assets/{page-title-Bvm24KbY.js → page-title-NXphgeQI.js} +1 -1
- package/dist/web/assets/{person-profile-Cf0Sytyw.js → person-profile-DXXfpvta.js} +1 -1
- package/dist/web/assets/popover-xSRzcSmY.js +1 -0
- package/dist/web/assets/popup-host-Bmvrf-2t.js +1 -0
- package/dist/web/assets/{profile-model-DkDH6Qth.js → profile-model-6gTmScHC.js} +1 -1
- package/dist/web/assets/{project-board-layout-OeuzohUI.js → project-board-layout-DBQeP_QP.js} +1 -1
- package/dist/web/assets/{project-capture-BQAqeAJf.js → project-capture-BhYsDWwJ.js} +1 -1
- package/dist/web/assets/{project-origin-CENDtRuK.js → project-origin-D8jy8EF_.js} +1 -1
- package/dist/web/assets/{quick-edit-api-Qndjqk1h.js → quick-edit-api-WLh_88w6.js} +1 -1
- package/dist/web/assets/{radio-group-pfWejLFt.js → radio-group-B4r78nDh.js} +1 -1
- package/dist/web/assets/{role-names-aIXV-sMx.js → role-names-PECaMfQo.js} +1 -1
- package/dist/web/assets/{roundtable-live-D7Asm_GB.js → roundtable-live-DFeDF56c.js} +1 -1
- package/dist/web/assets/{runtime-dom.esm-bundler-BS2lpl87.js → runtime-dom.esm-bundler-f39i44Mt.js} +1 -1
- package/dist/web/assets/save-file-rPduHi2f.js +1 -0
- package/dist/web/assets/select-_JO3Mxdp.js +1 -0
- package/dist/web/assets/{session-launch-offers-kLW-dRsW.js → session-launch-offers-X9b0DwF1.js} +1 -1
- package/dist/web/assets/settings-restart-BnwcTv3i.js +1 -0
- package/dist/web/assets/shared-report-BxNVLalR.js +3 -0
- package/dist/web/assets/shared-report-mYIyRY9C.css +1 -0
- package/dist/web/assets/{source-adapters-CUxqZHz7.js → source-adapters-aupsL146.js} +1 -1
- package/dist/web/assets/{switch-Cdz4-JcE.js → switch-B3Y3oE_n.js} +1 -1
- package/dist/web/assets/{tabs-C3w1-eMu.js → tabs-BlcZiEMY.js} +1 -1
- package/dist/web/assets/{task-board-model-DSr4P56O.js → task-board-model-CmMKsWdY.js} +1 -1
- package/dist/web/assets/task-card-fields-DAx6zMLz.js +1 -0
- package/dist/web/assets/task-labels-BdDFvSAy.js +1 -0
- package/dist/web/assets/{task-reason-BywD_kfi.js → task-reason-7WnPreht.js} +1 -1
- package/dist/web/assets/{team-sheets-D8Y--CP4.js → team-sheets-Cr0ZTPw3.js} +1 -1
- package/dist/web/assets/{textarea-C228nxbD.js → textarea-CRzFqL9a.js} +1 -1
- package/dist/web/assets/{ui-BM8jZcP6.js → ui-BopQuQfc.js} +1 -1
- package/dist/web/assets/{useAgentRecords-D7x4xQ9O.js → useAgentRecords-CMtpd3Fj.js} +1 -1
- package/dist/web/assets/{useAgentWorkSummary-pc1i6nr0.js → useAgentWorkSummary-BQbhaHov.js} +1 -1
- package/dist/web/assets/{useApi-CROJJdhE-DZtkWJZv.js → useApi-CROJJdhE-CRCgNOqq.js} +1 -1
- package/dist/web/assets/{useClipboardCopy-sTthF_MD.js → useClipboardCopy-DkqKK3wY.js} +1 -1
- package/dist/web/assets/{useFocusReturn-BoyUh5y3.js → useFocusReturn-BZpVmQnM.js} +1 -1
- package/dist/web/assets/{useForwardExpose-CqXuqZvd.js → useForwardExpose-Di-MnbTz.js} +1 -1
- package/dist/web/assets/{useForwardPropsEmits-0F_e7unJ.js → useForwardPropsEmits-L9XcB5DG.js} +1 -1
- package/dist/web/assets/useForwardScopeId-CUQFIAIj.js +1 -0
- package/dist/web/assets/useKnowledgeItemPeek-PmQJixw5.js +1 -0
- package/dist/web/assets/{useMinimumLoadingDisplay-CzfqbQPs.js → useMinimumLoadingDisplay-CWPiOaDl.js} +1 -1
- package/dist/web/assets/useProjectAgentRoster-CWVpSsQ3.js +1 -0
- package/dist/web/assets/{useRoutePeek-BDgll9Fy.js → useRoutePeek-DxLVksbJ.js} +1 -1
- package/dist/web/assets/useTeamPeople-CDISP0PM.js +1 -0
- package/dist/web/assets/{useTeamWork-BSFi27vj.js → useTeamWork-BTZd_wKs.js} +1 -1
- package/dist/web/assets/{useTypeahead-D_g4j3Xp.js → useTypeahead-pEZNpBls.js} +1 -1
- package/dist/web/assets/{utils-C6vsxGrE.js → utils-B4pBTmyh.js} +1 -1
- package/dist/web/assets/utils-BsxOjD1Q.js +1 -0
- package/dist/web/assets/version-db3QWWjt.js +1 -0
- package/dist/web/assets/{vue-router-BPhQ0Qow.js → vue-router-B79HWW1l.js} +1 -1
- package/dist/web/assets/website-YgovUEcN.js +1 -0
- package/dist/web/index.html +71 -66
- package/docs/agent-interface-architecture.md +13 -4
- package/docs/client-connections.md +3 -2
- package/docs/employee-agents.md +11 -9
- package/docs/judgment-and-autonomy.md +4 -4
- package/graph-provider/fuli_graph/app.py +4 -0
- package/graph-provider/fuli_graph/collaboration_context.py +3 -7
- package/graph-provider/fuli_graph/graph_field_contract.py +10 -2
- package/graph-provider/fuli_graph/graph_format_builtin_occupations.py +33 -1
- package/graph-provider/fuli_graph/graph_format_migrations.py +18 -0
- package/graph-provider/fuli_graph/graph_query.py +3 -12
- package/graph-provider/fuli_graph/knowledge_index_scan.py +120 -0
- package/graph-provider/fuli_graph/knowledge_outdated.py +9 -1
- package/graph-provider/fuli_graph/knowledge_retrieval_models.py +95 -0
- package/graph-provider/fuli_graph/knowledge_retrieval_terms.py +116 -0
- package/graph-provider/fuli_graph/knowledge_search.py +220 -39
- package/graph-provider/fuli_graph/knowledge_semantic.py +87 -0
- package/graph-provider/fuli_graph/knowledge_semantic_index.py +98 -0
- package/graph-provider/fuli_graph/knowledge_semantic_models.py +72 -0
- package/graph-provider/fuli_graph/knowledge_semantic_query.py +19 -0
- package/graph-provider/fuli_graph/knowledge_versions.py +14 -7
- package/graph-provider/fuli_graph/models.py +4 -0
- package/graph-provider/fuli_graph/occupation_catalog.py +6 -3
- package/graph-provider/fuli_graph/personal_global_preferences.py +3 -7
- package/graph-provider/fuli_graph/preference_versions.py +110 -0
- package/graph-provider/fuli_graph/project_agent_models.py +3 -0
- package/graph-provider/fuli_graph/project_agent_recruitment_occupation.py +1 -1
- package/graph-provider/fuli_graph/provider_values.py +7 -0
- package/graph-provider/fuli_graph/search_projection.py +2 -6
- package/graph-provider/fuli_graph/store_knowledge.py +10 -1
- package/graph-provider/fuli_graph/task_context_routes.py +1 -1
- package/graph-provider/pyproject.toml +1 -1
- package/native/win32/fuli-win-helper.exe +0 -0
- package/npm-shrinkwrap.json +3 -4
- package/package.json +2 -1
- package/skills/capturing-session-knowledge/SKILL.md +14 -7
- package/skills/capturing-session-knowledge/references/capture.md +12 -2
- package/skills/capturing-session-knowledge/references/retrieval.md +13 -4
- package/skills/grilling-project/SKILL.md +2 -0
- package/skills/operating-fuli/SKILL.md +36 -8
- package/skills/operating-fuli/references/workflow-recipes.md +10 -9
- package/src/agent-apps/host-tools/catalog.js +3 -0
- package/src/agent-delegation/agent-tool.js +12 -2
- package/src/agent-delegation/delegation-header.js +32 -8
- package/src/agent-delegation/entry-prompts.js +54 -0
- package/src/agent-delegation/operation-log.js +17 -7
- package/src/agent-delegation/person-words.js +38 -0
- package/src/agent-delegation/port.js +6 -4
- package/src/agent-delegation/refusals.js +14 -0
- package/src/agent-kits/client-detection.js +7 -0
- package/src/agent-kits/client-installer.js +13 -0
- package/src/agent-tools/delegation-definitions.js +5 -3
- package/src/agent-tools/diagnostic-definitions.js +23 -0
- package/src/agent-tools/graph-definitions.js +4 -0
- package/src/agent-tools/graph-handlers.js +6 -1
- package/src/agent-tools/interface-catalog.js +47 -17
- package/src/agent-tools/model-backend-definitions.js +1 -1
- package/src/agent-tools/old-data-definitions.js +16 -0
- package/src/agent-tools/task-entry-definitions.js +1 -1
- package/src/agent-tools/work-surface-definitions.js +1 -1
- package/src/agents/claude-code/lifecycle-hook.js +19 -5
- package/src/agents/claude-code/transcript-format-probe.js +31 -0
- package/src/agents/codex/lifecycle-hook.js +27 -7
- package/src/agents/codex/transcript-format-probe.js +29 -0
- package/src/agents/cursor/lifecycle-hook.js +4 -1
- package/src/agents/lifecycle-failure.js +27 -0
- package/src/agents/lifecycle-message.js +10 -0
- package/src/agents/opencode/lifecycle-hook.js +18 -2
- package/src/agents/transcript-format-registry.js +34 -0
- package/src/agents/transcript-format-scan.js +71 -0
- package/src/cli/command-registry.js +3 -0
- package/src/cli/diagnostics-command.js +59 -0
- package/src/cli/setup-command.js +3 -0
- package/src/cli.js +5 -0
- package/src/conversations/entry-budget.js +1 -1
- package/src/conversations/entry-detail-readers.js +22 -0
- package/src/conversations/entry-inline-budget.js +24 -12
- package/src/conversations/entry-skeleton.js +27 -9
- package/src/conversations/preference-lifecycle.js +2 -1
- package/src/conversations/preference-session.js +5 -2
- package/src/conversations/preference-snapshot.js +4 -1
- package/src/conversations/preference-view.js +5 -1
- package/src/conversations/reply-citations.js +21 -0
- package/src/conversations/stop-auto-close.js +21 -9
- package/src/conversations/task-context-view.js +31 -0
- package/src/data-format/backup-retention.js +8 -0
- package/src/data-format/local-stores.js +24 -2
- package/src/debug-turns/fuli-surface.js +23 -0
- package/src/debug-turns/model-capture.js +84 -0
- package/src/debug-turns/model-request.js +97 -0
- package/src/debug-turns/record.js +178 -0
- package/src/debug-turns/recorder.js +53 -0
- package/src/debug-turns/store.js +91 -0
- package/src/debug-turns/transcript-reader.js +64 -0
- package/src/debug-turns/trigger.js +25 -0
- package/src/diagnostics/agent-tool.js +14 -0
- package/src/diagnostics/event-log.js +133 -0
- package/src/diagnostics/failure-records.js +43 -0
- package/src/diagnostics/query.js +114 -0
- package/src/diagnostics/safe-event.js +83 -0
- package/src/dreaming/run.js +310 -0
- package/src/dreaming/scheduler.js +58 -0
- package/src/employees/builtin/jefa/board-store.js +78 -19
- package/src/employees/builtin/jefa/http.js +8 -5
- package/src/employees/builtin/jefa/project-board.js +2 -0
- package/src/employees/builtin/jefa/tools.js +7 -6
- package/src/employees/recruitment.js +20 -2
- package/src/employees/service.js +11 -1
- package/src/graphiti/agent-growth.js +64 -0
- package/src/graphiti/collaboration-preference-projection.js +7 -0
- package/src/graphiti/collaboration-preference-workflow.js +3 -3
- package/src/graphiti/current-project-knowledge-search.js +24 -1
- package/src/graphiti/federated-application.js +19 -1
- package/src/graphiti/federated-search.js +8 -1
- package/src/graphiti/local-runtimes.js +13 -0
- package/src/graphiti/personal-projects.js +11 -0
- package/src/graphiti/project-agent-mapping.js +1 -0
- package/src/graphiti/project-agent-task-sheets.js +6 -2
- package/src/graphiti/project-agent-workflows.js +22 -4
- package/src/graphiti/project-profile-authors.js +14 -7
- package/src/graphiti/provider-client.js +36 -0
- package/src/graphiti/session-knowledge-migration.js +103 -3
- package/src/graphiti/session-migration-notices.js +65 -0
- package/src/graphiti/session-records.js +22 -4
- package/src/graphiti/task-context-entry.js +5 -1
- package/src/graphiti/task-entry-preferences.js +31 -2
- package/src/graphiti/task-entry-read-only.js +28 -0
- package/src/graphiti/task-knowledge-checkpoint.js +2 -0
- package/src/graphiti/task-knowledge-recall.js +96 -19
- package/src/graphiti/task-remember.js +7 -2
- package/src/graphiti/task-update-request.js +13 -0
- package/src/graphiti/temporary-project-scope.js +7 -1
- package/src/graphiti/turn-receipt-delivery.js +5 -3
- package/src/http/agent-delegation-gate.js +5 -4
- package/src/http/agent-growth-api-router.js +17 -0
- package/src/http/api-router.js +18 -2
- package/src/http/capture-onboarding-api-router.js +3 -2
- package/src/http/debug-turns-api-router.js +70 -0
- package/src/http/diagnostic-events-api-router.js +27 -0
- package/src/http/dreaming-api-router.js +32 -0
- package/src/http/graph-api-router.js +35 -1
- package/src/http/knowledge-item-api-router.js +19 -2
- package/src/http/knowledge-scope-api-router.js +3 -2
- package/src/http/old-data-api-router.js +47 -0
- package/src/http/person-profile-api-router.js +3 -2
- package/src/http/retrieval-terms-api-router.js +37 -0
- package/src/http/semantic-api-router.js +26 -0
- package/src/judgment/agent-view.js +1 -1
- package/src/judgment/backend.js +30 -0
- package/src/judgment/http.js +2 -1
- package/src/judgment/review-prompt.js +2 -0
- package/src/judgment/routing.js +10 -2
- package/src/judgment/service.js +8 -2
- package/src/judgment/store.js +17 -7
- package/src/local-runtime/lifecycle.js +3 -0
- package/src/local-runtime/windows-process-handle.js +9 -3
- package/src/mcp/create-mcp-server.js +42 -25
- package/src/mcp/process-registry.js +45 -3
- package/src/mcp/runtime.js +2 -1
- package/src/mcp/stdio-relay.js +4 -1
- package/src/mcp/tool-annotations.js +2 -0
- package/src/model-backends/adapters/anthropic-messages.js +1 -1
- package/src/model-backends/adapters/exchange.js +2 -2
- package/src/model-backends/adapters/openai-chat.js +1 -1
- package/src/model-backends/adapters/openai-embeddings.js +60 -0
- package/src/model-backends/adapters/registry.js +3 -1
- package/src/model-backends/adapters/typesafe-systemone.js +1 -1
- package/src/model-backends/budget.js +14 -8
- package/src/model-backends/config.js +49 -15
- package/src/model-backends/decision-contract.js +2 -1
- package/src/model-backends/http.js +19 -1
- package/src/model-backends/model-fetch.js +37 -0
- package/src/model-backends/port.js +165 -67
- package/src/model-backends/prompt.js +4 -3
- package/src/model-backends/request.js +42 -3
- package/src/native-runtime/runtime.js +28 -4
- package/src/old-data/agent-tools.js +17 -0
- package/src/old-data/backup-reader.js +78 -0
- package/src/old-data/console-actions.js +53 -0
- package/src/old-data/guarded-stores.js +18 -0
- package/src/old-data/inventory.js +142 -0
- package/src/old-data/port.js +53 -0
- package/src/person-profile/port.js +2 -1
- package/src/presence/windows-helper-pin.js +1 -1
- package/src/project-change-log/port.js +65 -0
- package/src/project-change-log/store.js +60 -0
- package/src/retrieval-terms/fill.js +102 -0
- package/src/retrieval-terms/runner.js +50 -0
- package/src/retrieval-terms/terms-model.js +99 -0
- package/src/security/sensitive-content.js +11 -0
- package/src/semantic/scheduler.js +50 -0
- package/src/semantic/semantic-index.js +94 -0
- package/src/server.js +20 -1
- package/src/setup/paths.js +1 -1
- package/src/setup/setup.js +7 -0
- package/src/system/client-connection-status.js +6 -4
- package/src/system/doctor-repair.js +16 -4
- package/src/system/doctor.js +75 -3
- package/src/system/log-paths.js +11 -0
- package/src/system/log-retention.js +2 -8
- package/src/system/mcp-process-scan.js +55 -0
- package/src/system/resource-monitor.js +18 -2
- package/src/system/system-service.js +39 -7
- package/src/system/windows-data-acl.js +109 -0
- package/src/work-surfaces/port.js +17 -11
- package/src/work-surfaces/sources.js +4 -3
- package/dist/web/assets/AboutSectionHeading-BOXKE5Le.js +0 -1
- package/dist/web/assets/AboutSectionHeading-CiD3M3eG.css +0 -1
- package/dist/web/assets/AgentAppsPage-DS2X485q.js +0 -1
- package/dist/web/assets/AgentConversations-D7QJVFIo.js +0 -2
- package/dist/web/assets/AgentConversations-oZFXZE1X.css +0 -1
- package/dist/web/assets/AgentMentionCopy-O6pAjjYE.js +0 -1
- package/dist/web/assets/AgentProfilePage-CKCTcTzc.js +0 -2
- package/dist/web/assets/AgentProfilePage-D1ha8O3z.css +0 -1
- package/dist/web/assets/AgentServicesPage-C3npKkHp.js +0 -1
- package/dist/web/assets/AgentWorkbench-CJ4TYQA1.css +0 -1
- package/dist/web/assets/AgentWorkbench-D9HGRW-n.js +0 -2
- package/dist/web/assets/AppViewerPage-Al4TzYJF.js +0 -1
- package/dist/web/assets/BoardMoveMenu-ncWgEitd.js +0 -1
- package/dist/web/assets/Breadcrumb-QzjzIJdS.js +0 -1
- package/dist/web/assets/Breadcrumb-bsc0JKtG.css +0 -1
- package/dist/web/assets/CaptureChangePage-BQdqH2qC.js +0 -1
- package/dist/web/assets/ConnectionsPage-Be8jIb93.js +0 -1
- package/dist/web/assets/DataFormatPage-0Ne27K6I.css +0 -1
- package/dist/web/assets/DataFormatPage-C92rwzHa.js +0 -2
- package/dist/web/assets/EmployeeScopeDialog-DdR2DzcW.js +0 -1
- package/dist/web/assets/EmployeeTaskBoard-Bo8JT36K.js +0 -3
- package/dist/web/assets/EmployeeTaskBoard-Dljjy_L7.css +0 -1
- package/dist/web/assets/EmployeeWorkbenchPage-B249Mgle.js +0 -3
- package/dist/web/assets/EmployeeWorkbenchPage-BBjZJ6Od.css +0 -1
- package/dist/web/assets/FieldRoot-YdKVCBhW.js +0 -1
- package/dist/web/assets/FlaTaskSheets-Cm5SLq7J.js +0 -1
- package/dist/web/assets/FlasPage-C57gTN5X.js +0 -1
- package/dist/web/assets/HowtoPage-CDJScY6b.js +0 -1
- package/dist/web/assets/KnowledgeDeleteButton-5EtCPPl4.js +0 -1
- package/dist/web/assets/KnowledgeHardDeleteSection-r0lZ7ijb.js +0 -1
- package/dist/web/assets/KnowledgeItemEditPage-BStIRllM.js +0 -1
- package/dist/web/assets/KnowledgeOrganizerPage-BByk8hbw.js +0 -1
- package/dist/web/assets/KnowledgePage-DuWS3bRP.js +0 -1
- package/dist/web/assets/KnowledgePeek-BycBJ2xR.js +0 -1
- package/dist/web/assets/KnowledgePeek-EvumfJER.css +0 -1
- package/dist/web/assets/KnowledgeTurnReceiptPage-DTcDN-pG.js +0 -1
- package/dist/web/assets/KnowledgeWorkspace-CJo-6xdn.js +0 -4
- package/dist/web/assets/KnowledgeWorkspace-DPBq-At0.css +0 -1
- package/dist/web/assets/ModelSettingsPage-C1ghraAh.js +0 -1
- package/dist/web/assets/ModelSettingsPage-ConWy_ec.css +0 -1
- package/dist/web/assets/OccupationsPage-BY1jej7i.js +0 -1
- package/dist/web/assets/OverviewPage-C7YJf-Cq.css +0 -1
- package/dist/web/assets/OverviewPage-Dl-H0EBe.js +0 -1
- package/dist/web/assets/PersonalProfilePage-BcaVzKM6.js +0 -1
- package/dist/web/assets/PersonalProjectsPage-CO4ZYVAI.js +0 -1
- package/dist/web/assets/ProjectAgentDetailPage-Bgh78Mr5.js +0 -8
- package/dist/web/assets/ProjectAgentDetailPage-h7hr9iee.css +0 -1
- package/dist/web/assets/ProjectAgentDialog--T6mU-FW.css +0 -1
- package/dist/web/assets/ProjectAgentDialog-DzTor5ky.js +0 -5
- package/dist/web/assets/ProjectAgentsPage-CzN183pa.js +0 -1
- package/dist/web/assets/ProjectJudgmentPolicy-BMlEBJM3.js +0 -2
- package/dist/web/assets/PublicProjectsPage-DAHT31B8.js +0 -1
- package/dist/web/assets/SessionMigrationPage-IW07XhmD.js +0 -1
- package/dist/web/assets/SessionRecordsPage-Du76tewc.js +0 -1
- package/dist/web/assets/SettingsPage-CJNXe313.js +0 -1
- package/dist/web/assets/SettingsPage-D3AYCNTC.css +0 -1
- package/dist/web/assets/SharedJefaReportPage-dzHSSGhu.js +0 -1
- package/dist/web/assets/TagVocabularyPage-C_oV6GFs.js +0 -1
- package/dist/web/assets/TeamCard-CdO0RiNB.js +0 -1
- package/dist/web/assets/TeamCardsWidget-Cg_kJmb-.js +0 -1
- package/dist/web/assets/UiDialog-CUgrU6SQ.js +0 -1
- package/dist/web/assets/UiIcon-DPv0eZIU.js +0 -1
- package/dist/web/assets/WidgetSlot-BSU_-l_4.js +0 -2
- package/dist/web/assets/_plugin-vue_export-helper-DQENg-QE.js +0 -9
- package/dist/web/assets/agent-occupation-BvOgDW-q.js +0 -1
- package/dist/web/assets/agent-profile-BBqkfac0.css +0 -1
- package/dist/web/assets/agent-task-board-Cf9il_1i.js +0 -1
- package/dist/web/assets/button-N4FjuQuJ.js +0 -1
- package/dist/web/assets/client-connection-model-C3gpYYl7.js +0 -1
- package/dist/web/assets/combobox-DHwWXUpj.js +0 -1
- package/dist/web/assets/desktop-client-DnfjyLBX.js +0 -1
- package/dist/web/assets/dist-BInsvNsv.js +0 -1
- package/dist/web/assets/dist-Dc8jFf8M.js +0 -1
- package/dist/web/assets/field-BQLn7Hfw.js +0 -1
- package/dist/web/assets/index-CXPYDcyq.js +0 -2
- package/dist/web/assets/index-x95VDmzK.css +0 -1
- package/dist/web/assets/judgment-api-CK9yqrpU.js +0 -1
- package/dist/web/assets/label-table-KdyaCTvK.js +0 -1
- package/dist/web/assets/model-D4kKYvpj.js +0 -1
- package/dist/web/assets/popover-D4YFkL_5.js +0 -1
- package/dist/web/assets/project-board-settings-DPP6xKLz.js +0 -1
- package/dist/web/assets/project-team-api-7ybLH-uJ.js +0 -1
- package/dist/web/assets/save-file-CRxAsski.js +0 -1
- package/dist/web/assets/select-CUy1AIwE.js +0 -1
- package/dist/web/assets/settings-restart-JYH81qB-.js +0 -1
- package/dist/web/assets/shared-report-8p3nBKr-.js +0 -1
- package/dist/web/assets/source-coverage-4PsHC9TK.js +0 -1
- package/dist/web/assets/task-labels-CXBG2chm.js +0 -1
- package/dist/web/assets/useForwardScopeId-DVUFcuwO.js +0 -1
- package/dist/web/assets/useKnowledgeItemPeek-KZveY8Wz.js +0 -1
- package/dist/web/assets/useTeamPeople-Dna3Yrm3.js +0 -1
- package/dist/web/assets/utils-BX1QI2N6.js +0 -1
- package/dist/web/assets/version-CBPeq5nI.js +0 -1
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
|
|
1
3
|
import { ApplicationError, ApplicationErrorCode } from '../app/application-error.js';
|
|
2
4
|
import { receiptConsoleUrl } from '../agents/identity-receipt.js';
|
|
3
5
|
import { requiredString } from '../validation/values.js';
|
|
4
6
|
import { providerReaderFields, taskKnowledgeReader } from './knowledge-reader.js';
|
|
7
|
+
import { sessionFuliState } from './session-layer-decision.js';
|
|
5
8
|
import { isTemporaryProjectId } from './temporary-project-scope.js';
|
|
6
9
|
|
|
7
10
|
// rec#20 part 2: what a host session saved while nobody chose where it applies
|
|
@@ -12,11 +15,15 @@ import { isTemporaryProjectId } from './temporary-project-scope.js';
|
|
|
12
15
|
// the session holds and moves each chosen item through the quick edit's scope
|
|
13
16
|
// change, in one transaction; an item that changed since the page read it
|
|
14
17
|
// refuses the whole batch (409 stale_version, naming every such item).
|
|
18
|
+
// rec#82: a move that succeeded is recorded for the session whose items moved
|
|
19
|
+
// (session-migration-notices.js), and that session's next task entry says so
|
|
20
|
+
// in one line of its receipt; the page shows whether it was delivered yet.
|
|
15
21
|
|
|
16
22
|
const ITEM_KINDS = new Set(['entity', 'relationship']);
|
|
17
23
|
const MAX_SESSION_ID = 256;
|
|
18
24
|
const MAX_CLIENT = 32;
|
|
19
25
|
const MAX_PROJECT_ID = 128;
|
|
26
|
+
const MAX_MIGRATION_ID = 128;
|
|
20
27
|
// The Provider's limit for one migration (SessionMigrationApply).
|
|
21
28
|
const MAX_ITEMS = 100;
|
|
22
29
|
|
|
@@ -30,7 +37,11 @@ export function readSessionMigration(application, ownerReads, input) {
|
|
|
30
37
|
}
|
|
31
38
|
|
|
32
39
|
// scopeConsole: the console port that sends it on the human-review channel (src/knowledge-scope).
|
|
33
|
-
|
|
40
|
+
// ownerReads: the console's read port, for what the session still holds afterwards.
|
|
41
|
+
// migrationId: the page's id for this confirm; a repeat of a recorded one
|
|
42
|
+
// answers that move again and sends nothing. A caller without one (a
|
|
43
|
+
// delegated call) gets a fresh id, so its move is recorded once too.
|
|
44
|
+
export async function applySessionMigration(application, scopeConsole, input, { ownerReads = null } = {}) {
|
|
34
45
|
if (!Array.isArray(input.items) || !input.items.length || input.items.length > MAX_ITEMS) {
|
|
35
46
|
invalid(`items names 1 to ${MAX_ITEMS} held items`);
|
|
36
47
|
}
|
|
@@ -45,8 +56,97 @@ export function applySessionMigration(application, scopeConsole, input) {
|
|
|
45
56
|
if (new Set(items.map(item => `${item.item_kind}:${item.item_id}`)).size !== items.length) {
|
|
46
57
|
invalid('each item is named once');
|
|
47
58
|
}
|
|
48
|
-
|
|
49
|
-
|
|
59
|
+
const migrationId = input.migrationId === undefined ? randomUUID()
|
|
60
|
+
: requiredString(input.migrationId, 'migrationId', MAX_MIGRATION_ID);
|
|
61
|
+
const reason = requiredString(input.reason, 'reason', 2000);
|
|
62
|
+
const providerInput = target(application, input);
|
|
63
|
+
const session = noticeSession(providerInput);
|
|
64
|
+
const notices = application.sessionMigrationNotices;
|
|
65
|
+
const earlier = notices?.find(session, migrationId);
|
|
66
|
+
if (earlier && earlier.targetProjectId !== providerInput.target_project_id) {
|
|
67
|
+
invalid('migrationId names another migration');
|
|
68
|
+
}
|
|
69
|
+
if (earlier) return migrationAnswer(application, earlier, session, migrationId);
|
|
70
|
+
const result = await scopeConsole.applySessionMigration({ ...providerInput, reason, items, operation_actor: 'human' });
|
|
71
|
+
const moved = result.moved.map(({ item_kind, item_id }) => ({ item_kind, item_id }));
|
|
72
|
+
const event = { migrationId, targetProjectId: result.target_project_id, moved,
|
|
73
|
+
heldCount: await stillHeld(ownerReads, providerInput) };
|
|
74
|
+
let recorded = null;
|
|
75
|
+
try { recorded = notices?.record(session, event) ?? null; } catch { /* the move stands; the page says it was not recorded */ }
|
|
76
|
+
return migrationAnswer(application, recorded ?? event, session, migrationId, { recorded: Boolean(recorded) });
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Whether the session that holds the items was told of one confirmed migration.
|
|
80
|
+
export function readSessionMigrationDelivery(application, input) {
|
|
81
|
+
const session = noticeSession(target(application, input));
|
|
82
|
+
const migrationId = requiredString(input.migrationId, 'migrationId', MAX_MIGRATION_ID);
|
|
83
|
+
const event = application.sessionMigrationNotices?.find(session, migrationId) ?? null;
|
|
84
|
+
return { migration_id: migrationId, delivery: delivery(application, event, session) };
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// rec#82: the line a session's next task entry carries for the migrations a
|
|
88
|
+
// person confirmed for it: what moved and what still waits there. Plain text,
|
|
89
|
+
// no link and no instruction; nothing at all when none waits.
|
|
90
|
+
export function sessionMigrationNotice(application, task) {
|
|
91
|
+
if (!task?.sessionId || !task.token) return null;
|
|
92
|
+
try {
|
|
93
|
+
const events = application.sessionMigrationNotices?.claim(noticeSession({
|
|
94
|
+
source_application: task.sourceApplication ?? 'other', session_id: task.sessionId }), task.token) ?? [];
|
|
95
|
+
return events.length ? migrationNoticeLine(task, events) : null;
|
|
96
|
+
} catch {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function migrationNoticeLine(task, events) {
|
|
102
|
+
const byProject = new Map();
|
|
103
|
+
for (const event of events) {
|
|
104
|
+
byProject.set(event.targetProjectId, (byProject.get(event.targetProjectId) ?? 0) + event.moved.length);
|
|
105
|
+
}
|
|
106
|
+
const moved = [...byProject].map(([projectId, count]) =>
|
|
107
|
+
`${count} 条迁入${projectId === task.personalProjectId ? '当前项目' : `项目 ${projectId}`}`).join(',');
|
|
108
|
+
const held = events.at(-1).heldCount;
|
|
109
|
+
const left = held === null ? '' : held ? `,仍有 ${held} 条暂存待定范围` : ',临时项目已清空';
|
|
110
|
+
return `FULI 迁移已确认:${moved}${left}`;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
async function stillHeld(ownerReads, providerInput) {
|
|
114
|
+
if (!ownerReads) return null;
|
|
115
|
+
try {
|
|
116
|
+
const held = (await ownerReads.sessionMigration({ ...providerInput, include_items: false }))?.held_count;
|
|
117
|
+
return Number.isInteger(held) ? held : null;
|
|
118
|
+
} catch {
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function migrationAnswer(application, event, session, migrationId, { recorded = true } = {}) {
|
|
124
|
+
return { migration_id: migrationId, target_project_id: event.targetProjectId, moved: event.moved,
|
|
125
|
+
held_count: event.heldCount, delivery: recorded ? delivery(application, event, session)
|
|
126
|
+
: { state: 'unreachable', reason: 'not_recorded' } };
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// waiting: recorded, the session has not started a task since. delivered: its
|
|
130
|
+
// task entry carried the line. unreachable: nothing recorded it, or FULI is
|
|
131
|
+
// stopped in that session, so no entry of it reads anything until it starts again.
|
|
132
|
+
function delivery(application, event, session) {
|
|
133
|
+
if (!event) return { state: 'unreachable', reason: 'not_recorded' };
|
|
134
|
+
if (event.delivery) return { state: 'delivered', delivered_at: event.delivery.at };
|
|
135
|
+
return sessionStopped(application, session.sessionId)
|
|
136
|
+
? { state: 'unreachable', reason: 'session_stopped' } : { state: 'waiting' };
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// An unreadable switch is not taken for stopped: the line still waits for the session's next entry.
|
|
140
|
+
function sessionStopped(application, sessionId) {
|
|
141
|
+
try {
|
|
142
|
+
return sessionFuliState(application, sessionId).enabled === false;
|
|
143
|
+
} catch {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function noticeSession(providerInput) {
|
|
149
|
+
return { sourceApplication: providerInput.source_application, sessionId: providerInput.session_id };
|
|
50
150
|
}
|
|
51
151
|
|
|
52
152
|
// The receipt line that links the person to the migration page, or null.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { dirname, join, resolve } from 'node:path';
|
|
3
|
+
|
|
4
|
+
import { contentHash } from '../../packages/roundtable/src/canonical-json.js';
|
|
5
|
+
import { sha256Bytes } from '../security/digest.js';
|
|
6
|
+
import { jsonFormat, readJsonRecord, updateVersionedJsonFileAtomic } from '../storage/json-format.js';
|
|
7
|
+
|
|
8
|
+
// rec#82: a person's confirmed session migration, kept for the host session
|
|
9
|
+
// that holds the items until that session's next task entry claims it. One
|
|
10
|
+
// file per client and host session, named by their hash, so an entry reads
|
|
11
|
+
// and claims only its own session's events and a session with none reads
|
|
12
|
+
// nothing. An event holds counts and ids only, never knowledge text, and
|
|
13
|
+
// grants nothing. The first task entry to claim an event keeps it; a retry
|
|
14
|
+
// of that same task sees it again, any other task never does.
|
|
15
|
+
|
|
16
|
+
export const SESSION_MIGRATION_NOTICE_FORMAT = jsonFormat({ store: 'session-migration-notice', versions: [1] });
|
|
17
|
+
export const SESSION_MIGRATION_NOTICE_DIRECTORY = 'session-migration-notices';
|
|
18
|
+
const FORMAT_VERSION = 1;
|
|
19
|
+
// A session confirms few migrations; the oldest beyond this are dropped.
|
|
20
|
+
const MAX_EVENTS = 20;
|
|
21
|
+
|
|
22
|
+
export function sessionMigrationNoticesForRuntime(runtimeConfigPath) {
|
|
23
|
+
return createSessionMigrationNotices(runtimeConfigPath
|
|
24
|
+
? join(dirname(resolve(runtimeConfigPath)), SESSION_MIGRATION_NOTICE_DIRECTORY) : null);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// directory: where the session files live, or null when this application has
|
|
28
|
+
// no data directory; then nothing is recorded and nothing can be delivered.
|
|
29
|
+
function createSessionMigrationNotices(directory, { now = () => new Date().toISOString() } = {}) {
|
|
30
|
+
const path = ({ sourceApplication, sessionId }) => join(directory,
|
|
31
|
+
`${contentHash({ purpose: 'session-migration-notice-v1', sourceApplication, sessionId })}.json`);
|
|
32
|
+
const events = session => readJsonRecord(path(session), SESSION_MIGRATION_NOTICE_FORMAT)?.events ?? [];
|
|
33
|
+
return Object.freeze({
|
|
34
|
+
available: Boolean(directory),
|
|
35
|
+
// The completed migration, once per migration id: a repeated record returns the first one unchanged.
|
|
36
|
+
record(session, { migrationId, targetProjectId, moved, heldCount }) {
|
|
37
|
+
if (!directory) return null;
|
|
38
|
+
let stored = null;
|
|
39
|
+
updateVersionedJsonFileAtomic(path(session), SESSION_MIGRATION_NOTICE_FORMAT, current => {
|
|
40
|
+
const kept = current?.events ?? [];
|
|
41
|
+
stored = kept.find(event => event.migrationId === migrationId) ?? null;
|
|
42
|
+
if (stored) return undefined;
|
|
43
|
+
stored = { migrationId, targetProjectId, moved, heldCount, appliedAt: now(), delivery: null };
|
|
44
|
+
return { version: FORMAT_VERSION, events: [...kept, stored].slice(-MAX_EVENTS) };
|
|
45
|
+
});
|
|
46
|
+
return stored;
|
|
47
|
+
},
|
|
48
|
+
find(session, migrationId) {
|
|
49
|
+
if (!directory) return null;
|
|
50
|
+
return events(session).find(event => event.migrationId === migrationId) ?? null;
|
|
51
|
+
},
|
|
52
|
+
// The events this task entry delivers: those nobody claimed yet, and those this same task claimed before.
|
|
53
|
+
claim(session, taskToken) {
|
|
54
|
+
if (!directory || !existsSync(path(session))) return [];
|
|
55
|
+
const task = sha256Bytes(taskToken);
|
|
56
|
+
const result = updateVersionedJsonFileAtomic(path(session), SESSION_MIGRATION_NOTICE_FORMAT, current => {
|
|
57
|
+
if (!current?.events.some(event => !event.delivery)) return undefined;
|
|
58
|
+
const at = now();
|
|
59
|
+
return { ...current, events: current.events.map(event => event.delivery ? event
|
|
60
|
+
: { ...event, delivery: { task, at } }) };
|
|
61
|
+
});
|
|
62
|
+
return (result?.events ?? []).filter(event => event.delivery?.task === task);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
@@ -44,14 +44,32 @@ export async function readSessionRecords(application, ownerReads, { personalSpac
|
|
|
44
44
|
export async function readOwnSessionRecords(application, { taskContextToken, sourceApplication }) {
|
|
45
45
|
const task = await application.taskContextRegistry.context(requiredString(taskContextToken, 'taskContextToken', 160),
|
|
46
46
|
requiredBinding(sourceApplication, 'sourceApplication', MAX_CLIENT));
|
|
47
|
+
const { session, read } = await ownSessionRead(application, task);
|
|
48
|
+
const view = sessionRecordsView(application, session, read);
|
|
49
|
+
// The numbered lines carry every entry once; the same entries again as
|
|
50
|
+
// data would only double what the answer costs.
|
|
51
|
+
return { total: view.total, truncated: view.truncated, url: view.session.url, markdown: sessionRecordsMarkdown(view) };
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// The person's newest saved messages in a task's own session, as that task's
|
|
55
|
+
// Agent reads the session (the same turns as above), oldest first, each with
|
|
56
|
+
// the turn that holds it: what words an FLA relays as the person's decision
|
|
57
|
+
// are checked against (rec#80). A message is saved when its turn's transcript is.
|
|
58
|
+
export async function recentSessionUserMessages(application, task, limit) {
|
|
59
|
+
const { read } = await ownSessionRead(application, task);
|
|
60
|
+
return read.turns.filter(turn => !turn.hidden).flatMap(turn => turn.messages
|
|
61
|
+
.filter(message => message.role === 'user')
|
|
62
|
+
.map(message => ({ text: message.text, ref: { taskId: turn.task_id ?? null,
|
|
63
|
+
conversationId: turn.conversation_id ?? null, at: message.created_at ?? null } })))
|
|
64
|
+
.sort((left, right) => time(left.ref.at) - time(right.ref.at)).slice(-limit);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async function ownSessionRead(application, task) {
|
|
47
68
|
const session = { sourceApplication: task.sourceApplication, sessionId: task.sessionId };
|
|
48
69
|
const reader = providerReaderFields(taskKnowledgeReader(task));
|
|
49
70
|
const read = await providerRead(application, session,
|
|
50
71
|
body => application.personal.readSessionRecords({ ...body, ...reader }));
|
|
51
|
-
|
|
52
|
-
// The numbered lines carry every entry once; the same entries again as
|
|
53
|
-
// data would only double what the answer costs.
|
|
54
|
-
return { total: view.total, truncated: view.truncated, url: view.session.url, markdown: sessionRecordsMarkdown(view) };
|
|
72
|
+
return { session, read: withinReader(read, task) };
|
|
55
73
|
}
|
|
56
74
|
|
|
57
75
|
async function providerRead(application, session, readRecords) {
|
|
@@ -2,6 +2,7 @@ import { taskAgentAssignment, withRouteMarkers } from './task-agent-assignment.j
|
|
|
2
2
|
import { FLA_ROUTE } from './task-entry-named-fla.js';
|
|
3
3
|
import { beginConversation } from './agent-conversations.js';
|
|
4
4
|
import { REMEMBER_GUIDANCE, rememberRequested } from './task-remember.js';
|
|
5
|
+
import { UPDATE_GUIDANCE, updateRequested } from './task-update-request.js';
|
|
5
6
|
import { withRecoveredSource } from './task-knowledge-recall.js';
|
|
6
7
|
import { entryAgentReceipt } from './turn-receipt-delivery.js';
|
|
7
8
|
import { taskPreferenceScope } from '../mcp/provider-task-context-registry.js';
|
|
@@ -113,7 +114,9 @@ export async function beginTaskFromPreferences(application, preferences, {
|
|
|
113
114
|
// coordination associations. Missing metadata keeps the legacy requirement.
|
|
114
115
|
// A request to keep something is never a routine auto-closed task.
|
|
115
116
|
const remembering = rememberRequested(taskPrompt);
|
|
116
|
-
const
|
|
117
|
+
const updating = updateRequested(taskPrompt);
|
|
118
|
+
const autoClosed = !remembering && !updating
|
|
119
|
+
&& ((entryVia === 'hook' && task.entryVia === 'hook') || task.routineAutoCloseEligible === true);
|
|
117
120
|
const conversation = await beginConversation(application, task);
|
|
118
121
|
const receipt = preferences.agent_receipt ? await entryAgentReceipt(application, task, preferences.agent_receipt) : null;
|
|
119
122
|
return withPreferenceScope({
|
|
@@ -123,6 +126,7 @@ export async function beginTaskFromPreferences(application, preferences, {
|
|
|
123
126
|
checkpoint_required: !autoClosed && task.checkpoint?.phase !== 'complete',
|
|
124
127
|
...(autoClosed ? { checkpoint_guidance: STOP_HOOK_CHECKPOINT_GUIDANCE } : {}),
|
|
125
128
|
...(remembering ? { remember_guidance: REMEMBER_GUIDANCE } : {}),
|
|
129
|
+
...(updating ? { update_guidance: UPDATE_GUIDANCE } : {}),
|
|
126
130
|
resumed_checkpoint: Boolean(resumed),
|
|
127
131
|
previous_checkpoint_missing: task.previousCheckpointMissing,
|
|
128
132
|
...preferences, ...(receipt ? { agent_receipt: receipt } : {}),
|
|
@@ -19,13 +19,23 @@ import { withSharedProjectList } from './shared-project-list.js';
|
|
|
19
19
|
import { clearSessionTaskBlockers } from './task-blocker-progress.js';
|
|
20
20
|
import { standingOwnerEntry } from './task-entry-standing-owner.js';
|
|
21
21
|
import { roundtableAskEntry } from './task-entry-roundtable-ask.js';
|
|
22
|
+
import { isReadOnlyRefusal, readOnlyLifecycle, readOnlyTaskEntry } from './task-entry-read-only.js';
|
|
22
23
|
|
|
23
24
|
export async function finishTaskEntryPreferences(application, preferences, input) {
|
|
24
25
|
if (!input.agentInvocation || input.agentToolName !== 'get_collaboration_preferences') return preferences;
|
|
25
26
|
if (!input.sessionId || typeof input.taskPrompt !== 'string') return { ...preferences,
|
|
26
27
|
task_lifecycle: { status: 'not_started', reason: !input.sessionId ? 'native_session_required' : 'task_prompt_required',
|
|
27
28
|
guidance: 'Preferences were loaded, but no task token was created. Supply the current host sessionId and taskPrompt to get_collaboration_preferences. Do not guess a session ID, use an MCP process ID or reuse an earlier task token.' } };
|
|
28
|
-
|
|
29
|
+
let entry;
|
|
30
|
+
try {
|
|
31
|
+
entry = await beginTaskFromPreferences(application, preferences, input);
|
|
32
|
+
} catch (error) {
|
|
33
|
+
if (!isReadOnlyRefusal(error)) throw error;
|
|
34
|
+
return { ...preferences, checkpoint_required: false, task_lifecycle: readOnlyLifecycle() };
|
|
35
|
+
}
|
|
36
|
+
// An Agent's own entry keeps no prompt; it drops what the session's earlier task kept.
|
|
37
|
+
keepEntryPrompt(application, entry, input, null);
|
|
38
|
+
return withEntryHint(application, entry, input);
|
|
29
39
|
}
|
|
30
40
|
|
|
31
41
|
// begin_task_context and the lifecycle hooks: the same hints, once per session each.
|
|
@@ -34,7 +44,14 @@ export async function finishTaskEntryPreferences(application, preferences, input
|
|
|
34
44
|
export function beginTaskEntry(application, input) {
|
|
35
45
|
return withSharedProjectList(async () => {
|
|
36
46
|
if (input.projectPath !== undefined && input.projectPath !== null) application.listPersonalProjects().catch(() => {});
|
|
37
|
-
|
|
47
|
+
let entry;
|
|
48
|
+
try {
|
|
49
|
+
entry = await beginTaskContext(application, input);
|
|
50
|
+
} catch (error) {
|
|
51
|
+
if (!isReadOnlyRefusal(error)) throw error;
|
|
52
|
+
return readOnlyTaskEntry(application, input);
|
|
53
|
+
}
|
|
54
|
+
keepEntryPrompt(application, entry, input, input.taskPrompt);
|
|
38
55
|
// Its task and opening writes are done: a hook deadline from here on
|
|
39
56
|
// delivers the token instead of nothing (entry-budget.js).
|
|
40
57
|
noteEntryTask(entry);
|
|
@@ -46,6 +63,18 @@ export function beginTaskEntry(application, input) {
|
|
|
46
63
|
});
|
|
47
64
|
}
|
|
48
65
|
|
|
66
|
+
// The prompt the relay check reads in this same turn (entry-prompts.js);
|
|
67
|
+
// kept only for a hook's entry, never failing the entry.
|
|
68
|
+
function keepEntryPrompt(application, entry, input, prompt) {
|
|
69
|
+
if (!application.entryPrompts || typeof entry?.taskContextToken !== 'string' || !input.sessionId) return;
|
|
70
|
+
try {
|
|
71
|
+
application.entryPrompts.enter({ token: entry.taskContextToken, sessionId: input.sessionId,
|
|
72
|
+
sourceApplication: input.sourceApplication ?? 'other' }, prompt);
|
|
73
|
+
} catch {
|
|
74
|
+
// Ignore: without it a same-turn relay asks the person again.
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
49
78
|
// The person replied in this session; the clear is one of its writes, so it
|
|
50
79
|
// asks the same capture decision as the entry's other writes.
|
|
51
80
|
async function clearReplyBlockers(application, input) {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { getCollaborationPreferences } from './collaboration-preference-workflow.js';
|
|
2
|
+
import { resolvePreferenceProject } from './preference-project-resolution.js';
|
|
3
|
+
|
|
4
|
+
// While a graph format step waits for the person the graph is read-only, and a
|
|
5
|
+
// task lives in the graph, so no task can begin. The graph stays read-only: a
|
|
6
|
+
// write in the old format is what the wait protects against. What an Agent needs
|
|
7
|
+
// from the entry is all reads, though, so it keeps the person's preferences and
|
|
8
|
+
// recall, records nothing, and says why instead of failing.
|
|
9
|
+
export const READ_ONLY_REASON = 'data_format_read_only';
|
|
10
|
+
const GUIDANCE = 'FULI is waiting for the person to confirm a data format update, so this task is not recorded. '
|
|
11
|
+
+ 'Reads and searches work; saving knowledge is refused until then. There is no task token, so make no checkpoint. '
|
|
12
|
+
+ 'Tell the person once to confirm it in the FULI console under Settings, Data format. / '
|
|
13
|
+
+ 'FULI 的数据格式更新在等用户确认,这次任务不会被记录。读取和搜索照常,保存知识会被拒绝。没有任务 token,不用 checkpoint。'
|
|
14
|
+
+ '请告诉用户一次:到 FULI 控制台的「设置 › 数据格式」确认。';
|
|
15
|
+
|
|
16
|
+
export const isReadOnlyRefusal = error => error?.code === READ_ONLY_REASON;
|
|
17
|
+
export const readOnlyLifecycle = () => ({ status: 'not_started', reason: READ_ONLY_REASON, guidance: GUIDANCE });
|
|
18
|
+
|
|
19
|
+
export async function readOnlyTaskEntry(application, { personalProjectId = null, projectPath, taskPrompt = null, sessionId = null,
|
|
20
|
+
sourceSessionId = null, sourceApplication = null, projectAgentId = null, workKind = null, workflow = null }) {
|
|
21
|
+
const projectResolution = await resolvePreferenceProject(application, { personalProjectId, projectPath });
|
|
22
|
+
const preferences = await getCollaborationPreferences(application, projectResolution,
|
|
23
|
+
{ projectAgentId, taskPrompt, sessionId, sourceSessionId, workKind, workflow, sourceApplication }, () => {});
|
|
24
|
+
return { context: { personal_space_id: application.config.personal.spaceId, personal_project_id: projectResolution.personalProjectId ?? null },
|
|
25
|
+
effective_preferences: preferences.effective_preferences, scope_unknown: preferences.scope_unknown,
|
|
26
|
+
...(preferences.task_knowledge_recall ? { task_knowledge_recall: preferences.task_knowledge_recall } : {}),
|
|
27
|
+
checkpoint_required: false, task_lifecycle: readOnlyLifecycle() };
|
|
28
|
+
}
|
|
@@ -91,6 +91,8 @@ export async function checkpointTaskKnowledge(application, {
|
|
|
91
91
|
);
|
|
92
92
|
}
|
|
93
93
|
const finish = async (result, checkpointTask = task, memory = null) => {
|
|
94
|
+
// The turn is finished: the prompt kept for the relay check goes (rec#80).
|
|
95
|
+
try { application.entryPrompts?.checkpointed(task); } catch { /* the next entry replaces it */ }
|
|
94
96
|
const team = await taskTeam(application, checkpointTask, collaborators);
|
|
95
97
|
const effectiveLog = workLog ?? { status: 'reported', summary: reason };
|
|
96
98
|
const conversation = captureCheck.allowed ? await checkpointConversation(application, task, effectiveLog, team)
|
|
@@ -8,6 +8,7 @@ import { NEUTRAL, usagePriorLookup } from '../knowledge-impressions/ranking-prio
|
|
|
8
8
|
|
|
9
9
|
const MAX_QUERIES = 4;
|
|
10
10
|
const MAX_ITEMS_PER_KIND = 3;
|
|
11
|
+
const TOPIC_ONLY = plan => plan.trigger_categories.length === 1 && plan.trigger_categories[0] === 'topic';
|
|
11
12
|
const MAX_ITEM_TEXT = 1000;
|
|
12
13
|
const CONFIRMED = new Set(['confirmed', 'agent_confirmed']);
|
|
13
14
|
// People confirmed every returned item; reading files only to re-check them costs the tokens recall saves.
|
|
@@ -43,6 +44,14 @@ const RECALL_INTENTS = Object.freeze([
|
|
|
43
44
|
pattern: /(?:怎么(?:做|办|处理|操作|走)?|如何(?:做|处理|操作|进行)?|怎样(?:做|处理|操作)?|(?:什么|哪(?:个|种)|有没有|是否有|给我|提供|使用|采用|遵循|按照|沿用|走).{0,16}(?:方法|方式|流程|步骤)|(?:方法|方式|流程|步骤).{0,16}(?:是什么|有哪些|怎么|如何|怎样|吗|呢|?|\?)|\brunbook\b|\bprocedure\b|\bhow\s+to\b|(?:what|which|show|give|use|follow|existing|documented).{0,24}\bworkflow\b)/iu,
|
|
44
45
|
queries: ['方法 方式 流程 步骤 runbook workflow procedure']
|
|
45
46
|
},
|
|
47
|
+
{
|
|
48
|
+
// rec#63: "our error code convention", "the team that owns the ledger
|
|
49
|
+
// code", "the way we release beta builds" name a stored project fact
|
|
50
|
+
// without saying "previously".
|
|
51
|
+
category: 'project_convention',
|
|
52
|
+
pattern: /(?:约定|规范|惯例|规则|负责人|谁负责|谁来审|我们的|我们(?:一般|通常|都)|convention|policy|\bour\s+[a-z]|\bowns?\b|\bowner\b|who (?:owns|reviews|approves)|the way we|we (?:always|usually|use|agreed|decided))/iu,
|
|
53
|
+
queries: ['约定 规范 规则 负责人 convention policy rule owner']
|
|
54
|
+
},
|
|
46
55
|
{
|
|
47
56
|
category: 'prior_context',
|
|
48
57
|
pattern: /(?:之前|以前|上次|已经存|保存过|记得|照旧|同样|还是用|不用再|先前|约定|定好的|previous|earlier|\bprior\b|last time|remember|same as|again|we (?:decided|agreed|settled|chose))/iu,
|
|
@@ -88,6 +97,9 @@ const INDEX_TITLE_BYTES = 40;
|
|
|
88
97
|
// search leaves the recall not_needed.
|
|
89
98
|
const INDEX_MIN_REMAINING_MS = 2000;
|
|
90
99
|
const INDEX_READ = 'Titles of one bounded search: read one with search_current_project_knowledge before relying on it.';
|
|
100
|
+
// rec#63: after "searched, no match" models stopped looking and copied a
|
|
101
|
+
// stale value from the repository; one quick search is not the whole store.
|
|
102
|
+
const MISS_NEXT = 'One quick search only. Before taking a project value or rule (port, command, owner, convention) from repo files, search_current_project_knowledge for it.';
|
|
91
103
|
|
|
92
104
|
export const TASK_KNOWLEDGE_RETRIEVAL_GUIDANCE = Object.freeze({
|
|
93
105
|
before_reasking:
|
|
@@ -118,12 +130,26 @@ export function planTaskKnowledgeRecall(taskPrompt) {
|
|
|
118
130
|
};
|
|
119
131
|
const matched = RECALL_INTENTS.filter(({ category, pattern }) =>
|
|
120
132
|
pattern.test(intentPrompt[category] ?? prompt));
|
|
133
|
+
// rec#88: 16 of 20 held-out misses were never searched because the prompt
|
|
134
|
+
// had no cue word. A prompt with words of its own is searched by them; one
|
|
135
|
+
// with none ("继续") has nothing to search for.
|
|
121
136
|
if (!matched.length) {
|
|
122
|
-
|
|
137
|
+
const own = clauseQueries(leadParagraph(taskPrompt).replace(CODE_SPAN, ' '));
|
|
138
|
+
return own.length ? { status: 'planned', trigger_categories: ['topic'], queries: own.slice(0, MAX_QUERIES) }
|
|
139
|
+
: { status: 'not_needed', trigger_categories: [], queries: [] };
|
|
123
140
|
}
|
|
124
|
-
|
|
125
|
-
//
|
|
126
|
-
|
|
141
|
+
// Named targets already focus every query; otherwise the prompt's own
|
|
142
|
+
// clauses go first. File paths and code names are no target: a fact is
|
|
143
|
+
// stored under its concept ("retry policy", "staging port"), so a query
|
|
144
|
+
// of paths and category words matched none of it (rec#63). Focus, targets and
|
|
145
|
+
// clauses read the lead paragraph (focus falls back to the whole prompt when
|
|
146
|
+
// it names nothing): a name in trailing notes ("WSL Ubuntu", "Windows
|
|
147
|
+
// Node" in pasted environment rules) is not what the task is about.
|
|
148
|
+
const statement = leadParagraph(taskPrompt);
|
|
149
|
+
const leadTerms = distinctivePromptTerms(statement);
|
|
150
|
+
const focus = (leadTerms.length ? leadTerms : distinctivePromptTerms(prompt)).join(' ').slice(0, 180);
|
|
151
|
+
const ownWords = namedTarget(statement) ? [] : clauseQueries(statement.replace(CODE_SPAN, ' '));
|
|
152
|
+
const queries = unique([...ownWords, ...matched.flatMap(({ queries: values }) => values)
|
|
127
153
|
.map((query) => focus ? `${focus} ${query}` : query)]);
|
|
128
154
|
return {
|
|
129
155
|
status: 'planned',
|
|
@@ -165,11 +191,12 @@ function withoutRelativeWhere(prompt) {
|
|
|
165
191
|
|
|
166
192
|
export async function recallTaskKnowledge(application, resolution, taskPrompt, { sourceApplication = null, sessionId = null } = {}) {
|
|
167
193
|
const plan = planTaskKnowledgeRecall(taskPrompt);
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
}
|
|
194
|
+
const unasked = () => knowledgeIndexRecall(application, resolution, taskPrompt, { sourceApplication, sessionId })
|
|
195
|
+
.then(index => index ?? recallWithoutSearch('not_needed', { trigger_categories: [], queries: [] }));
|
|
196
|
+
if (plan.status === 'not_needed') return await unasked();
|
|
172
197
|
if (plan.status !== 'planned') return recallWithoutSearch(plan.status, plan);
|
|
198
|
+
// Without a project, a prompt no cue asked about reads as before.
|
|
199
|
+
if (!resolution.personalProjectId && TOPIC_ONLY(plan)) return await unasked();
|
|
173
200
|
if (!resolution.personalProjectId) {
|
|
174
201
|
return {
|
|
175
202
|
status: 'project_unresolved',
|
|
@@ -218,6 +245,13 @@ export async function recallTaskKnowledge(application, resolution, taskPrompt, {
|
|
|
218
245
|
entities,
|
|
219
246
|
projectScopePriority: 'strict'
|
|
220
247
|
});
|
|
248
|
+
// A search by the prompt's own words that found nothing, or failed, costs the
|
|
249
|
+
// entry nothing: it reads as before, when no cue asked for one.
|
|
250
|
+
if (TOPIC_ONLY(plan) && !facts.length && !entities.length) {
|
|
251
|
+
// A search that failed (a stopped hook, a Provider down) asks for no index either.
|
|
252
|
+
return failedQueryCount === settlements.length ? recallWithoutSearch('not_needed', { trigger_categories: [], queries: [] })
|
|
253
|
+
: await unasked();
|
|
254
|
+
}
|
|
221
255
|
const searched = results.length > 0;
|
|
222
256
|
const result = {
|
|
223
257
|
status: facts.length || entities.length
|
|
@@ -235,6 +269,7 @@ export async function recallTaskKnowledge(application, resolution, taskPrompt, {
|
|
|
235
269
|
})
|
|
236
270
|
} : {}),
|
|
237
271
|
...(pendingSlots.length ? { pending_fallback: { slots: pendingSlots, note: PENDING_NOTE } } : {}),
|
|
272
|
+
...(searched && !facts.length && !entities.length ? { next: MISS_NEXT } : {}),
|
|
238
273
|
...(answersFromConfirmed(application) && confirmedByPeople([...facts, ...entities])
|
|
239
274
|
? { confirmed_use: CONFIRMED_USE } : {}),
|
|
240
275
|
facts,
|
|
@@ -460,18 +495,60 @@ function distinctivePromptTerms(prompt) {
|
|
|
460
495
|
// words appear in it, so one long query of every word matches nothing.
|
|
461
496
|
const MAX_CLAUSE_QUERIES = 3;
|
|
462
497
|
const CLAUSE_WORD_LIMIT = 5;
|
|
463
|
-
const
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
498
|
+
const CLAUSE_HAN_LIMIT = 16;
|
|
499
|
+
// Asking and doing words: they say what to do with a fact, never which one.
|
|
500
|
+
const CLAUSE_STOP_WORDS = new Set(('about add adding after also answer because been before bullet bullets could create '
|
|
501
|
+
+ 'does entry existing exporting file folder following from full have here into just keep know like line list make more '
|
|
502
|
+
+ 'most much need new now one only please reply repo return returns saying short should show some sure tell than that '
|
|
503
|
+
+ 'their them then there these they this those three throw update use using what when where which while will with '
|
|
504
|
+
+ 'would write your').split(' '));
|
|
505
|
+
const CLAUSE_HAN_FILLERS = /请|帮我|帮忙|麻烦|一下|我们|你们|这个|那个|一个|然后|还有|的|了|吗|呢|吧/gu;
|
|
506
|
+
// A clause naming a kept fact ("the retry policy we agreed", "who owns it")
|
|
507
|
+
// queries first, so a long change request does not spend the slots on its
|
|
508
|
+
// other clauses.
|
|
509
|
+
const KNOWN_FACT_CUE = /(?:agreed|decided|convention|policy|rule|owns?\b|owner|\breview|the way we|\bour\b|port\b|command|channel|region|约定|规范|规则|负责|端口|地址|命令|渠道|策略|惯例|决定)/iu;
|
|
510
|
+
|
|
511
|
+
// When some clauses name a kept fact, only they query: the rest of a change
|
|
512
|
+
// request ("so tests do not wait") would bring back unrelated items.
|
|
467
513
|
function clauseQueries(prompt) {
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
.filter(
|
|
473
|
-
.slice(0, MAX_CLAUSE_QUERIES)
|
|
474
|
-
|
|
514
|
+
const clauses = prompt.split(/[,;:,;:。!?!?]|\.(?:\s|$)|\b(?:and|or|then)\b/iu);
|
|
515
|
+
const cued = clauses.filter((clause) => KNOWN_FACT_CUE.test(clause));
|
|
516
|
+
return (cued.length ? cued : clauses)
|
|
517
|
+
.map(clauseQuery)
|
|
518
|
+
.filter(Boolean)
|
|
519
|
+
.slice(0, MAX_CLAUSE_QUERIES);
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
function clauseQuery(clause) {
|
|
523
|
+
const words = unique((clause.toLocaleLowerCase('en-US').match(/[a-z][a-z0-9-]{2,}/gu) ?? [])
|
|
524
|
+
.filter((word) => !CLAUSE_STOP_WORDS.has(word) && !['the', 'who', 'how', 'for', 'are', 'was'].includes(word)))
|
|
525
|
+
.slice(0, CLAUSE_WORD_LIMIT);
|
|
526
|
+
// The Provider matches Chinese by character pairs, so the clause's own
|
|
527
|
+
// characters, without filler, are the query.
|
|
528
|
+
const han = (clause.match(/[\p{Script=Han}]+/gu) ?? []).join('').replace(CLAUSE_HAN_FILLERS, '').slice(0, CLAUSE_HAN_LIMIT);
|
|
529
|
+
const query = [han.length >= 4 ? han : '', words.length >= 2 || han.length >= 4 ? words.join(' ') : ''].filter(Boolean).join(' ');
|
|
530
|
+
return query || null;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
// A name the person gave (a quoted phrase, a product, a URL, a version, an
|
|
534
|
+
// uncommon acronym), not a file path or code identifier.
|
|
535
|
+
const CODE_SPAN = /`[^`]*`/gu;
|
|
536
|
+
const COMMON_ACRONYMS = new Set(['API', 'CI', 'CLI', 'CODEOWNERS', 'CSS', 'CSV', 'HTML', 'HTTP', 'HTTPS', 'ID', 'ISO', 'JS',
|
|
537
|
+
'JSON', 'NPM', 'PR', 'README', 'SDK', 'SQL', 'TS', 'UI', 'URL', 'UTC', 'YAML']);
|
|
538
|
+
|
|
539
|
+
// The text before the first blank line, as one line; the whole prompt when
|
|
540
|
+
// it has no later paragraph.
|
|
541
|
+
function leadParagraph(taskPrompt) {
|
|
542
|
+
const [lead] = taskPrompt.trim().split(/\r?\n[ \t]*\r?\n/u);
|
|
543
|
+
return singleLine(lead).slice(0, 8192);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
function namedTarget(prompt) {
|
|
547
|
+
const text = prompt.replace(CODE_SPAN, ' ');
|
|
548
|
+
const identifiers = new Set(text.match(/\b[A-Za-z][A-Za-z0-9]{0,63}[_./-][A-Za-z0-9_.\/-]{1,127}\b/gu) ?? []);
|
|
549
|
+
// A quoted heading or snippet ("## Release") is markup, not a name.
|
|
550
|
+
return distinctivePromptTerms(text).some((term) => !identifiers.has(term) && !COMMON_ACRONYMS.has(term)
|
|
551
|
+
&& /^[\p{L}\p{N}]/u.test(term));
|
|
475
552
|
}
|
|
476
553
|
|
|
477
554
|
// On unless the person asked for every answer to be checked against the files.
|
|
@@ -15,8 +15,13 @@ const MAX_ITEMS = 8;
|
|
|
15
15
|
// Hosts such as Claude Code keep their own memory files; a request to keep
|
|
16
16
|
// something must still reach FULI. Detected only on the prompt, so ordinary
|
|
17
17
|
// tasks carry no extra entry text.
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
// rec#63: "make sure this decision is remembered" and "keep this for later
|
|
19
|
+
// sessions" were missed, and the model wrote only a repository file.
|
|
20
|
+
const REMEMBER_REQUEST = new RegExp('(?:记住|记一下|记下来|记好|别忘|以后要用|今后|往后|以后(?:都|也|就)?(?:要|按|用|这样)|下次(?:也|还)?(?:要|按|用)'
|
|
21
|
+
+ '|\\bremember(?:ed|s|ing)?\\b|keep in mind|don\'?t forget|from now on|going forward'
|
|
22
|
+
+ '|\\b(?:keep|save|note) (?:this|it|that)(?: \\w+){0,2} for (?:later|next time|future)'
|
|
23
|
+
+ '|\\bfor (?:later|future) (?:sessions?|work|tasks?|reference)|\\bfuture (?:sessions?|work)\\b)', 'iu');
|
|
24
|
+
export const REMEMBER_GUIDANCE = 'The user asked to keep something: record it with checkpoint_task_knowledge remember (preference or project_fact) before finishing; a repository file or the host memory files are not FULI memory.';
|
|
20
25
|
|
|
21
26
|
export function rememberRequested(taskPrompt) {
|
|
22
27
|
return typeof taskPrompt === 'string' && REMEMBER_REQUEST.test(taskPrompt);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// A prompt that says a kept fact changed ("the channel moved", "now deploys
|
|
2
|
+
// to X, not the region recorded earlier", 改成). In the rec#63 eval the model
|
|
3
|
+
// captured the new statement beside the old one, so both stayed current.
|
|
4
|
+
// Detected only on the prompt, so ordinary tasks carry no extra entry text.
|
|
5
|
+
const UPDATE_REQUEST = new RegExp('(?:\\bmoved\\b|\\binstead of\\b|\\bno longer\\b|\\bcorrection\\b|\\bcorrected\\b'
|
|
6
|
+
+ '|\\bnot the (?:\\w+ ){0,3}(?:recorded|remembered|stored|old|previous)|\\bchanged (?:to|from)\\b|\\bhas changed\\b'
|
|
7
|
+
+ '|\\bupdate (?:what is remembered|the (?:project )?knowledge|the (?:stored|remembered|recorded)\\b)'
|
|
8
|
+
+ '|改成|改为|换成|换到|搬到|不再|更正|纠正|已经变|变成了)', 'iu');
|
|
9
|
+
export const UPDATE_GUIDANCE = 'The user says something kept may have changed: find the current item with search_current_project_knowledge and revise it with revise_personal_knowledge (action update); capture a new item only when none matches, so the old one does not stay current beside it.';
|
|
10
|
+
|
|
11
|
+
export function updateRequested(taskPrompt) {
|
|
12
|
+
return typeof taskPrompt === 'string' && UPDATE_REQUEST.test(taskPrompt);
|
|
13
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createHash } from 'node:crypto';
|
|
2
|
+
import { ApplicationError } from '../app/application-error.js';
|
|
2
3
|
|
|
3
4
|
export const temporaryProjectScope = Object.freeze({
|
|
4
5
|
type: 'temporary', lifetime: 'task', persisted: true
|
|
@@ -13,6 +14,11 @@ export function isTemporaryProjectId(projectId) {
|
|
|
13
14
|
|
|
14
15
|
// Explicit coordination owns provisioning. Preference and discovery reads never
|
|
15
16
|
// create projects. Identity contains no filesystem paths, prompts or host IDs.
|
|
17
|
+
// A task coordinates only in its own project (rec#86: this surfaced as
|
|
18
|
+
// internal_error); it says what to do instead.
|
|
19
|
+
export const otherProjectTask = () => new ApplicationError('task_context_other_project',
|
|
20
|
+
'This task belongs to another project. Begin a task in the target project with begin_task_context, then coordinate from it.');
|
|
21
|
+
|
|
16
22
|
export async function resolveCoordinationScope(application, resolution, input, entryTask) {
|
|
17
23
|
const projectId = resolution.personal_project_id ?? resolution.personalProjectId;
|
|
18
24
|
if (projectId) {
|
|
@@ -24,7 +30,7 @@ export async function resolveCoordinationScope(application, resolution, input, e
|
|
|
24
30
|
}
|
|
25
31
|
if (!['unmatched', 'not_provided'].includes(resolution.status)) return resolution;
|
|
26
32
|
if (entryTask?.personalProjectId && entryTask.projectScope?.type !== 'temporary') {
|
|
27
|
-
throw
|
|
33
|
+
throw otherProjectTask();
|
|
28
34
|
}
|
|
29
35
|
const scopeKey = createHash('sha256').update(JSON.stringify([
|
|
30
36
|
'fuli-temporary-task-v1', application.config.personal.spaceId,
|
|
@@ -2,7 +2,7 @@ import { deferredTurnReceipt, MAX_LIST_EPISODES, readEpisodeReceipts, readTurnRe
|
|
|
2
2
|
from '../agents/turn-receipt.js';
|
|
3
3
|
import { withReceiptLines, withTurnReceipt } from '../agents/identity-receipt.js';
|
|
4
4
|
import { taskKnowledgeReader } from './knowledge-reader.js';
|
|
5
|
-
import { formalTask, sessionMigrationLine, sessionMigrationOffer } from './session-knowledge-migration.js';
|
|
5
|
+
import { formalTask, sessionMigrationLine, sessionMigrationNotice, sessionMigrationOffer } from './session-knowledge-migration.js';
|
|
6
6
|
import { receiptFormatNotices } from '../data-format/format-notices.js';
|
|
7
7
|
|
|
8
8
|
// When a turn's receipt reaches a reply, exactly once (rec#20). The Provider
|
|
@@ -43,13 +43,15 @@ async function savedTurnReceipt(application, task, results, { memory, agentName
|
|
|
43
43
|
|
|
44
44
|
// A task entry's receipt: the identity line, then what earlier turns saved but
|
|
45
45
|
// never showed, then the offer to migrate what the session's temporary project
|
|
46
|
-
// holds once the session linked to a formal project (rec#20 part 2)
|
|
46
|
+
// holds once the session linked to a formal project (rec#20 part 2), and
|
|
47
|
+
// what a person confirmed moving for this session since its last entry (rec#82).
|
|
47
48
|
export async function entryAgentReceipt(application, task, receipt) {
|
|
48
49
|
const format = await receiptFormatNotices(application, { taskId: task.token, includePending: false });
|
|
49
50
|
if (format.length) receipt = { ...receipt, markdown: [receipt.markdown, ...format].join(' · ') };
|
|
50
51
|
const late = await unreadTurnReceipt(application, task);
|
|
52
|
+
const confirmed = sessionMigrationNotice(application, task);
|
|
51
53
|
const migration = await sessionMigrationOffer(application, task);
|
|
52
|
-
return withReceiptLines(withTurnReceipt(receipt, late),
|
|
54
|
+
return withReceiptLines(withTurnReceipt(receipt, late), [confirmed, migration].filter(Boolean));
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
// What earlier turns of this session saved but never showed. Each receipt is
|