fuli-context 0.20.0-beta.8 → 0.20.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/README.md +2 -0
- package/README.zh-CN.md +1 -0
- package/dist/web/assets/{AboutPage-Dy3drTbS.css → AboutPage-Bxm7RJZg.css} +1 -1
- package/dist/web/assets/{AboutPage-BybzKsx-.js → AboutPage-CjDenGS_.js} +1 -1
- package/dist/web/assets/{AgentName-CXf8heW-.js → AgentName-DdlJlpT3.js} +1 -1
- package/dist/web/assets/{AgentProfilePage-D0YyiAA6.js → AgentProfilePage-Cx_Uf5Vf.js} +1 -1
- package/dist/web/assets/{AgentProfilePage-B2yMnmQP.css → AgentProfilePage-DXvLQu-C.css} +1 -1
- package/dist/web/assets/{AgentsDirectoryPage-DvPJNJm-.css → AgentsDirectoryPage-BwF-0nFO.css} +1 -1
- package/dist/web/assets/{AgentsDirectoryPage-LU-bRYPw.js → AgentsDirectoryPage-DylT-GSW.js} +1 -1
- package/dist/web/assets/{BackLink-Dgc1V1EN.js → BackLink-D7oAvDG5.js} +1 -1
- package/dist/web/assets/{BoardMoveMenu-XrAiFzGj.js → BoardMoveMenu-B0pA7LLx.js} +1 -1
- package/dist/web/assets/CaptureChangePage-Cch3mT4b.css +1 -0
- package/dist/web/assets/{CaptureChangePage-DcJKvaGf.js → CaptureChangePage-DEuqPb14.js} +1 -1
- package/dist/web/assets/{Card-96u8qomm.js → Card-BZFLZ_2I.js} +1 -1
- package/dist/web/assets/{CardHeader-4je7E12I.js → CardHeader-C_c0keQn.js} +1 -1
- package/dist/web/assets/{CardTitle-bjMusOR6.js → CardTitle-yXOhV577.js} +1 -1
- package/dist/web/assets/ConnectionsPage-DlnHdtwn.js +1 -0
- package/dist/web/assets/{CreateProjectDialog-BDwT_wZd.js → CreateProjectDialog-BVJqWdlT.js} +1 -1
- package/dist/web/assets/{DataFormatPage-PxwqDWeZ.js → DataFormatPage-BdcjcyhZ.js} +1 -1
- package/dist/web/assets/DataFormatPage-Dp7mePUw.css +1 -0
- package/dist/web/assets/{DialogFooter-DwgFgHdH.js → DialogFooter-DYawfDCD.js} +1 -1
- package/dist/web/assets/{EmployeeRecruitDialog-DjX_wOWx.js → EmployeeRecruitDialog-CB4ARFkM.js} +1 -1
- package/dist/web/assets/{EmployeeWorkbenchPage-DWhBevwY.js → EmployeeWorkbenchPage-BUMfMBc8.js} +2 -2
- package/dist/web/assets/{EmployeeWorkbenchPage-l_LYqBnr.css → EmployeeWorkbenchPage-BenZP7De.css} +1 -1
- package/dist/web/assets/{GrowthLoading-DssogOkP.js → GrowthLoading-smW3-Gfp.js} +1 -1
- package/dist/web/assets/{InboxPage-fFg4gETv.css → InboxPage-CbbiHgTr.css} +1 -1
- package/dist/web/assets/{InboxPage-BF38gnSV.js → InboxPage-Crn1UU7s.js} +2 -2
- package/dist/web/assets/{Input-DHF3Ivr3.js → Input-F1oftPWh.js} +1 -1
- package/dist/web/assets/{KnowledgeEditDialog-uAzeQbMB.js → KnowledgeEditDialog-VdQwbX4E.js} +1 -1
- package/dist/web/assets/{KnowledgeHardDeleteSection-qGeE1YrK.js → KnowledgeHardDeleteSection-CXRmNnZF.js} +1 -1
- package/dist/web/assets/{KnowledgeItemEditPage-Cj5uNVo6.js → KnowledgeItemEditPage-CQo3TbCJ.js} +1 -1
- package/dist/web/assets/{KnowledgeItemSummaryCard-CeOSN36n.js → KnowledgeItemSummaryCard-Dd2McM-d.js} +1 -1
- package/dist/web/assets/{KnowledgeOrganizerPage-7VC_JAWQ.css → KnowledgeOrganizerPage-BIOaMzgQ.css} +1 -1
- package/dist/web/assets/{KnowledgeOrganizerPage-BVLMc2jL.js → KnowledgeOrganizerPage-BVgAyu6U.js} +1 -1
- package/dist/web/assets/KnowledgePage-Bfbfz_Z8.js +1 -0
- package/dist/web/assets/{KnowledgePeek-BD2zoQqA.js → KnowledgePeek-BNBkh1ey.js} +1 -1
- package/dist/web/assets/KnowledgeTurnReceiptPage-Ckw_olrt.js +1 -0
- package/dist/web/assets/{KnowledgeWorkspace-CgFI31jK.js → KnowledgeWorkspace-pH2tAFld.js} +1 -1
- package/dist/web/assets/{Label-DM1yZ2CL.js → Label-yDCtlpkb.js} +1 -1
- package/dist/web/assets/ModelSettingsPage-C3eBDWRL.js +1 -0
- package/dist/web/assets/ModelSettingsPage-DZkrJw7R.css +1 -0
- package/dist/web/assets/NotFoundPage-8gVVukRR.js +1 -0
- package/dist/web/assets/OccupationsPage-BTormZIO.css +1 -0
- package/dist/web/assets/{OccupationsPage-CHgGGvDu.js → OccupationsPage-PNoqE21Y.js} +1 -1
- package/dist/web/assets/{OverviewPage-E0tfzQRr.js → OverviewPage-DiwYSnhh.js} +2 -2
- package/dist/web/assets/{OverviewPage-CpHmwB7u.css → OverviewPage-YBQHyU7s.css} +1 -1
- package/dist/web/assets/{PersonalProfilePage-CfqsnB1K.css → PersonalProfilePage-CGW50MHm.css} +1 -1
- package/dist/web/assets/{PersonalProfilePage-o5Gpo9nJ.js → PersonalProfilePage-C_v2BFee.js} +1 -1
- package/dist/web/assets/PersonalProjectsPage-Cf5mrQmy.css +1 -0
- package/dist/web/assets/{PersonalProjectsPage-Boj9kG6I.js → PersonalProjectsPage-DGRV8cM5.js} +1 -1
- package/dist/web/assets/{PopperContent-BDOio_9z.js → PopperContent-5zqbtnYr.js} +1 -1
- package/dist/web/assets/{Presence-Bk6m9rvx.js → Presence-BYfYJNMD.js} +1 -1
- package/dist/web/assets/{ProjectAgentDetailPage-Cyl3ZPBO.js → ProjectAgentDetailPage-BQ9ffaCX.js} +2 -2
- package/dist/web/assets/{ProjectAgentDetailPage-Ns2ATys8.css → ProjectAgentDetailPage-CRFE6n-s.css} +1 -1
- package/dist/web/assets/{ProjectAgentDialog-C1_KluEx.js → ProjectAgentDialog-BGckQDTq.js} +1 -1
- package/dist/web/assets/{ProjectAgentFirstTask-CXKvWwhZ.js → ProjectAgentFirstTask-DrSd3nR-.js} +1 -1
- package/dist/web/assets/{ProjectAgentsPage-DKNDXWow.css → ProjectAgentsPage-BBzKAhZx.css} +1 -1
- package/dist/web/assets/{ProjectAgentsPage-DHTo0uNy.js → ProjectAgentsPage-U4Om3EPu.js} +1 -1
- package/dist/web/assets/{ProjectScopePicker-GjK7Hm4N.js → ProjectScopePicker-D0oxbwOd.js} +1 -1
- package/dist/web/assets/{PublicProjectsPage-BuJo0ReR.js → PublicProjectsPage-CvkQ3E8I.js} +1 -1
- package/dist/web/assets/{PublicProjectsPage-yA6Md4oM.css → PublicProjectsPage-Ditr0SY-.css} +1 -1
- package/dist/web/assets/{RadioGroupItem-DxktHt0c.js → RadioGroupItem-CBpbQlHx.js} +1 -1
- package/dist/web/assets/{RoundtablesPage-Bd3XCn7B.js → RoundtablesPage-BEUaKOjI.js} +1 -1
- package/dist/web/assets/RoundtablesPage-BMYSDYH8.css +1 -0
- package/dist/web/assets/{RovingFocusGroup-DyZDm-Bn.js → RovingFocusGroup-X9U-ufYr.js} +1 -1
- package/dist/web/assets/{RovingFocusItem-BKyXKG9n.js → RovingFocusItem-_uA_OCLT.js} +1 -1
- package/dist/web/assets/SessionMigrationPage-WVFSDcUO.js +1 -0
- package/dist/web/assets/{SessionRecordsPage-CvGaB3h3.js → SessionRecordsPage-Bs2eLXEi.js} +1 -1
- package/dist/web/assets/{SettingsPage-DG3ialW3.css → SettingsPage-BbX9ysTX.css} +1 -1
- package/dist/web/assets/{SettingsPage-OasIZiIz.js → SettingsPage-DlIwICIz.js} +1 -1
- package/dist/web/assets/{SharedJefaReportPage-_f2bnFY-.js → SharedJefaReportPage-B_rreEep.js} +1 -1
- package/dist/web/assets/{TabsContent-CTM6GBGk.js → TabsContent-8pXwYJPz.js} +1 -1
- package/dist/web/assets/{TabsTrigger-BFj6S2XJ.js → TabsTrigger-Cd6SI2yI.js} +1 -1
- package/dist/web/assets/{TagVocabularyPage-Cp1UVDoe.js → TagVocabularyPage-BQiuKG-4.js} +1 -1
- package/dist/web/assets/{TaskExecutionPlan-D_MbMVvj.js → TaskExecutionPlan-CupxJeyo.js} +1 -1
- package/dist/web/assets/TaskSchedulesPage-DcmDdY10.css +1 -0
- package/dist/web/assets/{TaskSchedulesPage-Dd38ntqQ.js → TaskSchedulesPage-zYQs7s6T.js} +1 -1
- package/dist/web/assets/{Teleport-D5d1fEVm.js → Teleport-BZX1Eb7R.js} +1 -1
- package/dist/web/assets/{TextField-DUZTbKVz.js → TextField-CielK4l3.js} +1 -1
- package/dist/web/assets/{UiDialog-CU8nqGKC.js → UiDialog-BSDblUpR.js} +1 -1
- package/dist/web/assets/{UiDisclosure-DbxNZe0B.js → UiDisclosure-DLmVwmy1.js} +1 -1
- package/dist/web/assets/{UiIcon-DSkB5Juh.js → UiIcon-B8eZeuGI.js} +1 -1
- package/dist/web/assets/{UiIconButton-Bgy8Hoy4.js → UiIconButton-e754Tmnq.js} +1 -1
- package/dist/web/assets/{UiSegmented-BwkPHeLK.js → UiSegmented-D1HD-qin.js} +1 -1
- package/dist/web/assets/{UiSelect-CW3HNsRZ.js → UiSelect-CbkTsi2e.js} +1 -1
- package/dist/web/assets/{UiToggle--Z_LpW41.js → UiToggle-Dz93aXFK.js} +1 -1
- package/dist/web/assets/{UiWeight-D8U0orbz.js → UiWeight-CUvyApSB.js} +1 -1
- package/dist/web/assets/{UnassignedConversationsPanel-BeWzhuBr.js → UnassignedConversationsPanel-xY7gsFot.js} +1 -1
- package/dist/web/assets/{VirtualDirectoryList-BT099Zuk.js → VirtualDirectoryList-Dv6PwLjU.js} +1 -1
- package/dist/web/assets/{Workbench3D-BAb5m-Qk.js → Workbench3D--4N_uKzp.js} +1 -1
- package/dist/web/assets/WritingTastePage-B7KojA4r.js +1 -0
- package/dist/web/assets/{WritingTastePage-Dh1qW6bK.css → WritingTastePage-asIa-2U5.css} +1 -1
- package/dist/web/assets/{_plugin-vue_export-helper-Crd8aFkh.js → _plugin-vue_export-helper-BmfQlfI8.js} +1 -1
- package/dist/web/assets/{accordion-C-pFa1cg.js → accordion-gXElbGP_.js} +1 -1
- package/dist/web/assets/{agent-occupation-BooDHzf0.js → agent-occupation-ChN-1QjC.js} +1 -1
- package/dist/web/assets/{agent-pins-CFO-xYmz.js → agent-pins-Chh_rdBi.js} +1 -1
- package/dist/web/assets/{agent-profile-Bi--2zRQ.css → agent-profile-LzhgJINr.css} +1 -1
- package/dist/web/assets/{agent-profile.css_vue_type_style_index_0_src_true_lang-BKk2RVxy.js → agent-profile.css_vue_type_style_index_0_src_true_lang-DWlz7UoN.js} +1 -1
- package/dist/web/assets/{agent-work-summary-BIZoVGaT.js → agent-work-summary-C9yMf019.js} +1 -1
- package/dist/web/assets/{attention-store-dDH6VA6Z.js → attention-store-CG9cF6DX.js} +1 -1
- package/dist/web/assets/{badge-BnU2j9Nh.js → badge-DvvDq2Wb.js} +1 -1
- package/dist/web/assets/{button-B4gCj85U.js → button-CFEnxtio.js} +1 -1
- package/dist/web/assets/{checkbox-CzVOT2cF.js → checkbox-DovdRz8u.js} +1 -1
- package/dist/web/assets/{client-Cg0bLxrO.js → client-lh80ewvs.js} +1 -1
- package/dist/web/assets/{console-k05BnLkZ.js → console-CQMgYkk9.js} +1 -1
- package/dist/web/assets/{conversation-launcher-settings-C745vZJa.js → conversation-launcher-settings-B1QM-wZB.js} +1 -1
- package/dist/web/assets/{design-lab-CJiqHzsm.js → design-lab-BDKwIbI8.js} +1 -1
- package/dist/web/assets/{dialog-DQaUWk4W.js → dialog-D2mO6m3B.js} +1 -1
- package/dist/web/assets/{dist-2CLFk118.js → dist-PmK0PfVA.js} +1 -1
- package/dist/web/assets/{dropdown-menu-CN5wjWUD.js → dropdown-menu-YzCnvjAb.js} +1 -1
- package/dist/web/assets/{field-6gOLsuT_.js → field-BMEFEyVC.js} +1 -1
- package/dist/web/assets/{identity-NbL1GGSB.js → identity-bK-fJdnj.js} +1 -1
- package/dist/web/assets/index-BhekqRSJ.js +2 -0
- package/dist/web/assets/index-DedvhyS3.css +1 -0
- package/dist/web/assets/{judgment-types-DfSuVLnV.js → judgment-types-DJnAr9c0.js} +1 -1
- package/dist/web/assets/{model-BjNAHvfb.js → model-BwNZZZNP.js} +1 -1
- package/dist/web/assets/{model-DrZFCNN6.js → model-CPMYnu3S.js} +1 -1
- package/dist/web/assets/{model-DPykou4S.js → model-Cengn9fg.js} +1 -1
- package/dist/web/assets/{model-YYqd0CSe.js → model-CuY1vtEy.js} +1 -1
- package/dist/web/assets/{model-2BvryZbU.js → model-DpVrfbnj.js} +1 -1
- package/dist/web/assets/{model-BsfqK9w_.js → model-rumuELTi.js} +1 -1
- package/dist/web/assets/{motion-preference-CxKthhLy.js → motion-preference-A1AMssSH.js} +1 -1
- package/dist/web/assets/{occupation-catalog-JHFMVvBn.js → occupation-catalog-DxwlYD1L.js} +1 -1
- package/dist/web/assets/{orchestration-filters-B7ZbjZKo.js → orchestration-filters-DZpJ0FN3.js} +1 -1
- package/dist/web/assets/{page-title-BawJ25Bw.js → page-title-Bg-mVyrS.js} +1 -1
- package/dist/web/assets/{personal-profile-graph-BEjSAQMe.js → personal-profile-graph-tMneNj_m.js} +1 -1
- package/dist/web/assets/{project-capture-BUtkhbr1.js → project-capture-QgMw6qvo.js} +1 -1
- package/dist/web/assets/{project-origin-DI7ft7I8.js → project-origin-ppsYHpYL.js} +1 -1
- package/dist/web/assets/project-team-api-DwP0O3rn.js +1 -0
- package/dist/web/assets/{quick-edit-api-CTMfc9uz.js → quick-edit-api-BiyK3ih-.js} +1 -1
- package/dist/web/assets/{shared-report-o1Tvfyn-.js → shared-report-D3Hem1t5.js} +3 -3
- package/dist/web/assets/{task-labels-dW28Ybet.js → task-labels-7KyNw9id.js} +1 -1
- package/dist/web/assets/{ui-BkbPVq3y.js → ui-Ck58paqr.js} +1 -1
- package/dist/web/assets/{useAgentRecords-D6BTApmV.js → useAgentRecords-C6RrZwwv.js} +1 -1
- package/dist/web/assets/{useApi-CROJJdhE-BMswzZdS.js → useApi-CROJJdhE-BujjnKN_.js} +1 -1
- package/dist/web/assets/{useFocusReturn-DQOtrYO8.js → useFocusReturn-D9IOIg17.js} +1 -1
- package/dist/web/assets/{useKnowledgeItemPeek-CGzVMWJz.js → useKnowledgeItemPeek-C6nAzvDL.js} +1 -1
- package/dist/web/assets/{useMinimumLoadingDisplay-DEBBYuGI.js → useMinimumLoadingDisplay-HnxkDut6.js} +1 -1
- package/dist/web/assets/{useRoutePeek-R9W605pr.js → useRoutePeek-BvYFc1BA.js} +1 -1
- package/dist/web/assets/{vue-router-BUjBh_Iw.js → vue-router-Bl55c88B.js} +1 -1
- package/dist/web/index.html +33 -33
- package/docs/agent-apps.md +110 -0
- package/docs/employee-agents.md +1 -1
- package/graph-provider/fuli_graph/app.py +16 -11
- package/graph-provider/fuli_graph/graph_query.py +30 -2
- package/graph-provider/fuli_graph/knowledge_audit.py +9 -1
- package/graph-provider/fuli_graph/knowledge_item_routes.py +10 -6
- package/graph-provider/fuli_graph/knowledge_item_view.py +41 -12
- package/graph-provider/fuli_graph/knowledge_item_view_models.py +3 -3
- package/graph-provider/fuli_graph/knowledge_review.py +47 -10
- package/graph-provider/fuli_graph/knowledge_search.py +18 -22
- package/graph-provider/fuli_graph/knowledge_session_migration.py +14 -4
- package/graph-provider/fuli_graph/knowledge_session_migration_models.py +2 -2
- package/graph-provider/fuli_graph/knowledge_tag_routes.py +7 -5
- package/graph-provider/fuli_graph/knowledge_tags.py +8 -4
- package/graph-provider/fuli_graph/knowledge_visibility.py +195 -0
- package/graph-provider/fuli_graph/models.py +12 -2
- package/graph-provider/fuli_graph/preference_conflicts.py +50 -4
- package/graph-provider/fuli_graph/publication_source_copies.py +36 -0
- package/graph-provider/fuli_graph/session_records.py +33 -13
- package/graph-provider/fuli_graph/session_records_models.py +4 -2
- package/graph-provider/fuli_graph/store_knowledge.py +5 -1
- package/graph-provider/fuli_graph/store_publication.py +70 -12
- package/graph-provider/fuli_graph/task_context_models.py +2 -0
- package/graph-provider/fuli_graph/task_session_hints.py +7 -3
- package/graph-provider/pyproject.toml +1 -1
- package/native/win32/fuli-win-helper.exe +0 -0
- package/npm-shrinkwrap.json +8 -8
- package/package.json +3 -2
- package/skills/capturing-session-knowledge/references/retrieval.md +6 -0
- package/src/agent-apps/activation.js +3 -3
- package/src/agent-apps/app-host.js +2 -0
- package/src/agent-apps/app-launcher.js +25 -0
- package/src/agent-apps/authorization.js +6 -4
- package/src/agent-apps/bounded-wait.js +13 -0
- package/src/agent-apps/{verified-decisions.js → confirmed-decisions.js} +100 -55
- package/src/agent-apps/decision-source.js +17 -17
- package/src/agent-apps/host-identity.js +8 -2
- package/src/agent-apps/instances.js +218 -29
- package/src/agent-apps/operations.js +4 -3
- package/src/agent-apps/run-gate.js +25 -20
- package/src/agent-apps/service.js +40 -16
- package/src/agent-apps/store.js +28 -14
- package/src/agent-apps/trust-terms.js +23 -0
- package/src/agent-apps/trusted-runner.js +136 -0
- package/src/agent-apps/versions.js +5 -4
- package/src/agent-apps/views.js +11 -6
- package/src/agent-tools/agent-app-definitions.js +1 -1
- package/src/agent-tools/graph-definitions.js +4 -4
- package/src/agent-tools/interface-catalog.js +2 -2
- package/src/agent-tools/interface-definitions.js +2 -1
- package/src/agent-tools/session-fuli-gate.js +55 -26
- package/src/agent-tools.js +2 -4
- package/src/agents/claude-code/lifecycle-hook.js +29 -12
- package/src/agents/codex/lifecycle-hook.js +25 -10
- package/src/agents/lifecycle-message.js +18 -0
- package/src/agents/turn-receipt.js +15 -8
- package/src/app/agent-request-context.js +18 -0
- package/src/cli/app-command.js +46 -61
- package/src/cli/remote-mcp-command.js +6 -2
- package/src/cli/setup-command.js +6 -0
- package/src/cli/terminal-io.js +22 -0
- package/src/cli/update-command.js +14 -1
- package/src/cli/update-installation.js +46 -2
- package/src/conversations/entry-budget.js +116 -0
- package/src/conversations/preference-evidence.js +6 -2
- package/src/conversations/task-context-view.js +13 -8
- package/src/data-format/local-stores.js +2 -0
- package/src/graphiti/agent-conversations.js +24 -3
- package/src/graphiti/assistant-project-candidate.js +5 -2
- package/src/graphiti/capture-notice.js +4 -1
- package/src/graphiti/entry-hint-claim.js +13 -0
- package/src/graphiti/federated-application.js +55 -62
- package/src/graphiti/human-review-channel.js +9 -5
- package/src/graphiti/jefa-board-match.js +4 -1
- package/src/graphiti/knowledge-item-edit.js +7 -4
- package/src/graphiti/knowledge-reader.js +46 -0
- package/src/graphiti/knowledge-result-budget.js +63 -12
- package/src/graphiti/knowledge-tags.js +12 -1
- package/src/graphiti/provider-client.js +18 -25
- package/src/graphiti/publication-draft-capture.js +28 -0
- package/src/graphiti/session-knowledge-migration.js +7 -3
- package/src/graphiti/session-layer-decision.js +28 -6
- package/src/graphiti/session-records.js +26 -15
- package/src/graphiti/shared-project-list.js +36 -0
- package/src/graphiti/task-entry-preferences.js +87 -46
- package/src/graphiti/turn-receipt-delivery.js +5 -2
- package/src/graphiti/writing-taste-profile-workflow.js +13 -7
- package/src/http/api-router.js +2 -1
- package/src/http/graph-api-router.js +13 -10
- package/src/http/knowledge-item-api-router.js +17 -4
- package/src/http/knowledge-tags-api-router.js +21 -9
- package/src/http/request-policy.js +18 -2
- package/src/http/session-records-api-router.js +7 -3
- package/src/judgment/review-prompt.js +21 -1
- package/src/knowledge-owner-reads/console-port.js +51 -0
- package/src/knowledge-tags/console-port.js +3 -2
- package/src/mcp/preference-delivery.js +7 -4
- package/src/mcp/provider-task-context-registry.js +23 -0
- package/src/mcp/tool-result.js +3 -3
- package/src/presence/platforms.js +3 -2
- package/src/presence/port.js +2 -1
- package/src/presence/windows-helper-pin.js +1 -1
- package/src/server.js +14 -2
- package/src/standing-assignments/port.js +146 -0
- package/src/standing-assignments/store.js +151 -0
- package/src/standing-assignments/term-match.js +28 -0
- package/src/text/name-identity.js +33 -0
- package/dist/web/assets/CaptureChangePage-C833Eiqu.css +0 -1
- package/dist/web/assets/ConnectionsPage-EFMP-UeV.js +0 -1
- package/dist/web/assets/DataFormatPage-DERqhmng.css +0 -1
- package/dist/web/assets/KnowledgePage-8ct5iO0F.js +0 -1
- package/dist/web/assets/KnowledgeTurnReceiptPage-Yn3jhDyx.js +0 -1
- package/dist/web/assets/ModelSettingsPage-5RkvgNYN.js +0 -1
- package/dist/web/assets/ModelSettingsPage-BqtWIKEA.css +0 -1
- package/dist/web/assets/NotFoundPage-BUUf2-MZ.js +0 -1
- package/dist/web/assets/OccupationsPage-B55DftFp.css +0 -1
- package/dist/web/assets/PersonalProjectsPage-aU1rApzX.css +0 -1
- package/dist/web/assets/RoundtablesPage-BmmsB1mW.css +0 -1
- package/dist/web/assets/SessionMigrationPage-CQhrJ1OQ.js +0 -1
- package/dist/web/assets/TaskSchedulesPage-CDalUfNj.css +0 -1
- package/dist/web/assets/WritingTastePage-BsekLhC3.js +0 -1
- package/dist/web/assets/index-BczJo3GN.js +0 -2
- package/dist/web/assets/index-C2rHjaT6.css +0 -1
- package/dist/web/assets/project-team-api-BZMMPuUd.js +0 -1
- package/src/agent-apps/isolation.js +0 -23
|
@@ -997,7 +997,17 @@ class CollaborationContextResult(StrictModel):
|
|
|
997
997
|
truncated: bool = False
|
|
998
998
|
|
|
999
999
|
|
|
1000
|
-
class
|
|
1000
|
+
class AgentReaderRef(StrictModel):
|
|
1001
|
+
"""The Agent reading: an FLA in its project, or neither for a plain
|
|
1002
|
+
session. The person's console names no reader; it proves itself with the
|
|
1003
|
+
human-review channel instead (knowledge_visibility)."""
|
|
1004
|
+
reader_project_id: str | None = Field(default=None, min_length=1, max_length=128)
|
|
1005
|
+
reader_agent_id: str | None = Field(default=None, min_length=1, max_length=128)
|
|
1006
|
+
|
|
1007
|
+
|
|
1008
|
+
# A conflict's write names its reader too: one naming an item this reader may
|
|
1009
|
+
# not see answers as missing, before anything is written or returned (0.20.1).
|
|
1010
|
+
class PreferenceConflictDeferCreate(AgentReaderRef):
|
|
1001
1011
|
personal_space_id: str = Field(min_length=1, max_length=128)
|
|
1002
1012
|
conflict_id: str = Field(min_length=1, max_length=1024)
|
|
1003
1013
|
preference_key: str = Field(min_length=1, max_length=512)
|
|
@@ -1024,7 +1034,7 @@ class PreferenceConflictDeferCreate(StrictModel):
|
|
|
1024
1034
|
return self
|
|
1025
1035
|
|
|
1026
1036
|
|
|
1027
|
-
class PreferenceConflictResolveCreate(
|
|
1037
|
+
class PreferenceConflictResolveCreate(AgentReaderRef):
|
|
1028
1038
|
personal_space_id: str = Field(min_length=1, max_length=128)
|
|
1029
1039
|
resolution: PreferenceConflictResolutionAction
|
|
1030
1040
|
reason: str = Field(min_length=1, max_length=2000)
|
|
@@ -16,6 +16,13 @@ from .models import (
|
|
|
16
16
|
PreferenceConflictResolveCreate,
|
|
17
17
|
PreferenceScopeChange,
|
|
18
18
|
)
|
|
19
|
+
from .knowledge_visibility import (
|
|
20
|
+
fla_visible_ids_cypher,
|
|
21
|
+
hidden_refs,
|
|
22
|
+
knowledge_reader,
|
|
23
|
+
reader_parameter,
|
|
24
|
+
request_reader,
|
|
25
|
+
)
|
|
19
26
|
from .provider_values import native_datetime as _native_datetime
|
|
20
27
|
|
|
21
28
|
|
|
@@ -42,6 +49,14 @@ async def defer_preference_conflict(
|
|
|
42
49
|
request.personal_space_id,
|
|
43
50
|
'maintainer',
|
|
44
51
|
)
|
|
52
|
+
# Neither the items it names nor a conflict already kept under this id
|
|
53
|
+
# may be another FLA's: that answers as missing, and nothing is written.
|
|
54
|
+
reader = await request_reader(store, actor, space, request)
|
|
55
|
+
if reader is not None:
|
|
56
|
+
existing = await _stored_conflict(store, space['id'], request.conflict_id)
|
|
57
|
+
await _require_visible(store, space, reader, [
|
|
58
|
+
(request.left_item_kind, request.left_item_id), (request.right_item_kind, request.right_item_id),
|
|
59
|
+
*(_conflict_items(existing) if existing else [])])
|
|
45
60
|
left = await _active_preference_item(
|
|
46
61
|
store,
|
|
47
62
|
space,
|
|
@@ -140,23 +155,30 @@ async def list_preference_conflicts(
|
|
|
140
155
|
limit: int = 500,
|
|
141
156
|
offset: int = 0,
|
|
142
157
|
) -> list[PreferenceConflictRecord]:
|
|
143
|
-
await _authorize_personal_space(
|
|
158
|
+
space = await _authorize_personal_space(
|
|
144
159
|
store,
|
|
145
160
|
actor,
|
|
146
161
|
personal_space_id,
|
|
147
162
|
'reader',
|
|
148
163
|
)
|
|
164
|
+
# An Agent reads as a plain session: no conflict naming any FLA's own
|
|
165
|
+
# item (an FLA meets those over its own preferences in its task context).
|
|
166
|
+
# The console reads them all with the human-review proof. Cut before the page.
|
|
167
|
+
reader = await knowledge_reader(store, actor, space, personal_project_id=None, project_agent_id=None)
|
|
149
168
|
records, _, _ = await store.runtime.driver.execute_query(
|
|
150
169
|
'''
|
|
151
170
|
MATCH (:FuliSpace {id: $space_id, kind: 'personal'})-
|
|
152
171
|
[:HAS_PREFERENCE_CONFLICT]->(conflict:FuliPreferenceConflict)
|
|
153
|
-
WHERE $status IS NULL OR conflict.status = $status
|
|
172
|
+
WHERE ($status IS NULL OR conflict.status = $status)
|
|
173
|
+
AND ''' + fla_visible_ids_cypher('[conflict.left_item_id, conflict.right_item_id]') + '''
|
|
154
174
|
RETURN conflict
|
|
155
175
|
ORDER BY conflict.updated_at DESC, conflict.id ASC
|
|
156
176
|
SKIP $offset
|
|
157
177
|
LIMIT $limit
|
|
158
178
|
''',
|
|
159
179
|
space_id=personal_space_id,
|
|
180
|
+
group_id=space['group_id'],
|
|
181
|
+
reader=reader_parameter(reader),
|
|
160
182
|
status=status,
|
|
161
183
|
limit=min(max(limit, 1), 1000),
|
|
162
184
|
offset=max(offset, 0),
|
|
@@ -216,6 +238,10 @@ async def resolve_preference_conflict(
|
|
|
216
238
|
'maintainer',
|
|
217
239
|
)
|
|
218
240
|
conflict = await _read_conflict(store, space['id'], conflict_id)
|
|
241
|
+
# Before anything is returned, a resolved retry included: a conflict
|
|
242
|
+
# naming another FLA's item answers as missing.
|
|
243
|
+
await _require_visible(store, space, await request_reader(store, actor, space, request),
|
|
244
|
+
_conflict_items(conflict))
|
|
219
245
|
if conflict.status == 'resolved':
|
|
220
246
|
return conflict
|
|
221
247
|
if conflict.status != 'ai_pending':
|
|
@@ -266,6 +292,10 @@ async def complete_preference_conflict(
|
|
|
266
292
|
'maintainer',
|
|
267
293
|
)
|
|
268
294
|
conflict = await _read_conflict(store, space['id'], conflict_id)
|
|
295
|
+
# The person completes any conflict with the console's proof; without it
|
|
296
|
+
# the caller reads as a plain session.
|
|
297
|
+
await _require_visible(store, space, await knowledge_reader(
|
|
298
|
+
store, actor, space, personal_project_id=None, project_agent_id=None), _conflict_items(conflict))
|
|
269
299
|
return await _complete(
|
|
270
300
|
store,
|
|
271
301
|
space['id'],
|
|
@@ -467,6 +497,13 @@ async def _complete(
|
|
|
467
497
|
|
|
468
498
|
|
|
469
499
|
async def _read_conflict(store, space_id, conflict_id):
|
|
500
|
+
conflict = await _stored_conflict(store, space_id, conflict_id)
|
|
501
|
+
if conflict is None:
|
|
502
|
+
raise HTTPException(status_code=404, detail='preference conflict not found')
|
|
503
|
+
return conflict
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
async def _stored_conflict(store, space_id, conflict_id):
|
|
470
507
|
records, _, _ = await store.runtime.driver.execute_query(
|
|
471
508
|
'''
|
|
472
509
|
MATCH (:FuliSpace {id: $space_id, kind: 'personal'})-
|
|
@@ -478,9 +515,18 @@ async def _read_conflict(store, space_id, conflict_id):
|
|
|
478
515
|
conflict_id=conflict_id,
|
|
479
516
|
routing_='r',
|
|
480
517
|
)
|
|
481
|
-
if
|
|
518
|
+
return _record(records[0]['conflict']) if records else None
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
def _conflict_items(conflict) -> list[tuple[str, str]]:
|
|
522
|
+
return [(conflict.left_item_kind, conflict.left_item_id),
|
|
523
|
+
(conflict.right_item_kind, conflict.right_item_id)]
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
async def _require_visible(store, space, reader, items) -> None:
|
|
527
|
+
"""A conflict naming an item this reader may not see is, to it, missing."""
|
|
528
|
+
if await hidden_refs(store, space, reader, items):
|
|
482
529
|
raise HTTPException(status_code=404, detail='preference conflict not found')
|
|
483
|
-
return _record(records[0]['conflict'])
|
|
484
530
|
|
|
485
531
|
|
|
486
532
|
async def _active_preference_item(store, space, item_id, item_kind):
|
|
@@ -21,6 +21,42 @@ def publication_source_identity(group_id, episode):
|
|
|
21
21
|
return identity
|
|
22
22
|
|
|
23
23
|
|
|
24
|
+
PROJECT_AGENT, PLAIN, UNRESOLVED = 'project_agent', 'plain', 'unresolved'
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
async def draft_sources(store, space, identities) -> list[str]:
|
|
28
|
+
"""Whose work each of these draft source identities is, from the personal
|
|
29
|
+
episode it names and the session turn it came from (0.20.1):
|
|
30
|
+
PROJECT_AGENT when either is an FLA's, PLAIN only when one of them is
|
|
31
|
+
found and neither is, and UNRESOLVED when neither is found (erased, or
|
|
32
|
+
never recorded, as for a capture made only for a team project). Nothing
|
|
33
|
+
is ever taken as plain for want of a source."""
|
|
34
|
+
sources = [{'index': index, 'episode_id': identity.get('episode_id'),
|
|
35
|
+
'turn_id': identity.get('source_turn_id'),
|
|
36
|
+
'session_node': store._task_session_id(space['id'], identity['source_application'],
|
|
37
|
+
identity['session_id'])
|
|
38
|
+
if identity.get('source_application') and identity.get('session_id') else None}
|
|
39
|
+
for index, identity in enumerate(identities)]
|
|
40
|
+
if not sources:
|
|
41
|
+
return []
|
|
42
|
+
records, _, _ = await store.runtime.driver.execute_query(
|
|
43
|
+
'''
|
|
44
|
+
UNWIND $sources AS source
|
|
45
|
+
OPTIONAL MATCH (episode:Episodic {group_id: $group_id, uuid: source.episode_id})
|
|
46
|
+
OPTIONAL MATCH (:FuliSpace {id: $space_id, kind: 'personal'})-[:HAS_TASK_CONTEXT_SESSION]->
|
|
47
|
+
(:FuliTaskContextSession {id: source.session_node})-[:HAS_CONTEXT]->
|
|
48
|
+
(task:FuliTaskContext {turn_id: source.turn_id})
|
|
49
|
+
WITH source, collect(DISTINCT episode) AS episodes, collect(DISTINCT task) AS tasks
|
|
50
|
+
RETURN source.index AS index,
|
|
51
|
+
any(episode IN episodes WHERE episode.fuli_project_agent_id IS NOT NULL)
|
|
52
|
+
OR any(task IN tasks WHERE task.project_agent_id IS NOT NULL) AS project_agent,
|
|
53
|
+
size(episodes) + size(tasks) > 0 AS found
|
|
54
|
+
''', sources=sources, group_id=space['group_id'], space_id=space['id'], routing_='r')
|
|
55
|
+
found = {record['index']: (PROJECT_AGENT if record['project_agent'] else PLAIN if record['found'] else UNRESOLVED)
|
|
56
|
+
for record in records}
|
|
57
|
+
return [found.get(index, UNRESOLVED) for index in range(len(sources))]
|
|
58
|
+
|
|
59
|
+
|
|
24
60
|
async def drafts_for_sources(store, space, sources, *, source_range=None):
|
|
25
61
|
"""Read copies by exact source identity; all statuses participate in erasure.
|
|
26
62
|
Legacy drafts derive their identity from payload until first scrubbed.
|
|
@@ -22,6 +22,13 @@ from .knowledge_item_view import (
|
|
|
22
22
|
scope_projects,
|
|
23
23
|
)
|
|
24
24
|
from .knowledge_management import _read_item
|
|
25
|
+
from .knowledge_visibility import (
|
|
26
|
+
fla_episode_visible_cypher,
|
|
27
|
+
fla_own_work_cypher,
|
|
28
|
+
hidden_refs,
|
|
29
|
+
reader_parameter,
|
|
30
|
+
request_reader,
|
|
31
|
+
)
|
|
25
32
|
from .models import SourceApplication
|
|
26
33
|
from .provider_values import native_datetime
|
|
27
34
|
from .session_records_models import (
|
|
@@ -55,15 +62,19 @@ NOT_RECORDED_EVENT = re.compile(r':not_recorded$')
|
|
|
55
62
|
|
|
56
63
|
async def read_session_records(store, actor: dict, request: SessionRecordsRead) -> SessionRecords:
|
|
57
64
|
space = await personal_reader_space(store, actor, request.personal_space_id)
|
|
65
|
+
# An Agent reads only the turns of its own FLA (a plain session: turns
|
|
66
|
+
# under no FLA), and none of another FLA's episodes or items. Each is cut
|
|
67
|
+
# before its page, so neither a count nor a gap shows what was left out.
|
|
68
|
+
reader = await request_reader(store, actor, space, request)
|
|
58
69
|
if request.source_application is None:
|
|
59
70
|
clients = await _session_clients(store, space, request.session_id)
|
|
60
71
|
if len(clients) != 1:
|
|
61
72
|
return SessionRecords(session_id=request.session_id, clients=clients)
|
|
62
73
|
request = request.model_copy(update={'source_application': clients[0]})
|
|
63
|
-
tasks, more_turns = await _session_tasks(store, space, request)
|
|
74
|
+
tasks, more_turns = await _session_tasks(store, space, request, reader)
|
|
64
75
|
turns, more_events = await _turns(store, space, tasks)
|
|
65
|
-
episodes, more_episodes = await _session_episodes(store, space, request, tasks)
|
|
66
|
-
items, more_items = await _items(store, space, episodes)
|
|
76
|
+
episodes, more_episodes = await _session_episodes(store, space, request, tasks, reader)
|
|
77
|
+
items, more_items = await _items(store, space, episodes, reader)
|
|
67
78
|
project_ids = {turn.personal_project_id for turn in turns} | {item.origin_project_id for item in items}
|
|
68
79
|
return SessionRecords(
|
|
69
80
|
session_id=request.session_id, source_application=request.source_application,
|
|
@@ -89,16 +100,17 @@ async def _session_clients(store, space, session_id):
|
|
|
89
100
|
return sorted(nodes[record['id']] for record in records)
|
|
90
101
|
|
|
91
102
|
|
|
92
|
-
async def _session_tasks(store, space, request):
|
|
103
|
+
async def _session_tasks(store, space, request, reader):
|
|
93
104
|
records, _, _ = await store.runtime.driver.execute_query(
|
|
94
105
|
'''
|
|
95
106
|
MATCH (:FuliSpace {id: $space_id, kind: 'personal'})-[:HAS_TASK_CONTEXT_SESSION]->
|
|
96
107
|
(:FuliTaskContextSession {id: $session_node})-[:HAS_CONTEXT]->(task:FuliTaskContext)
|
|
108
|
+
WHERE ''' + fla_own_work_cypher('task.project_agent_id', 'task.personal_project_id') + '''
|
|
97
109
|
WITH task ORDER BY task.created_at DESC, task.id LIMIT $limit
|
|
98
110
|
RETURN task.id AS id, task.token AS token, task.turn_id AS turn_id, task.created_at AS created_at,
|
|
99
111
|
task.personal_project_id AS project_id, task.project_agent_id AS agent_id,
|
|
100
112
|
task.record_json AS record_json
|
|
101
|
-
''', space_id=space['id'], limit=MAX_TURNS + 1,
|
|
113
|
+
''', space_id=space['id'], limit=MAX_TURNS + 1, reader=reader_parameter(reader),
|
|
102
114
|
session_node=store._task_session_id(space['id'], request.source_application, request.session_id),
|
|
103
115
|
routing_='r')
|
|
104
116
|
tasks = []
|
|
@@ -136,7 +148,7 @@ async def _turns(store, space, tasks):
|
|
|
136
148
|
events = events_by_token.get(task['token'], [])
|
|
137
149
|
turns.append(SessionTurn(
|
|
138
150
|
task_id=task['id'], turn_id=task['turn_id'], created_at=task['created_at'],
|
|
139
|
-
personal_project_id=task['project_id'],
|
|
151
|
+
personal_project_id=task['project_id'], project_agent_id=task['agent_id'],
|
|
140
152
|
conversation_id=events[0]['conversation_id'] if events else None,
|
|
141
153
|
capture_off=task['capture_off'], **_turn_events(events)))
|
|
142
154
|
return turns, truncated
|
|
@@ -186,21 +198,25 @@ def _bounded(text, limit):
|
|
|
186
198
|
return text if len(text) <= limit else f'{text[:limit]}…'
|
|
187
199
|
|
|
188
200
|
|
|
189
|
-
async def _session_episodes(store, space, request, tasks):
|
|
201
|
+
async def _session_episodes(store, space, request, tasks, reader):
|
|
190
202
|
"""The episodes the session's checkpoints committed and those that name the
|
|
191
203
|
session as their source, newest last, each with the turn it belongs to."""
|
|
192
204
|
task_by_episode = {episode_id: task for task in tasks for episode_id in task['episode_ids']}
|
|
193
205
|
records, _, _ = await store.runtime.driver.execute_query(
|
|
194
206
|
'''
|
|
195
207
|
MATCH (episode:Episodic {group_id: $group_id})
|
|
196
|
-
WHERE episode.uuid IN $episode_ids
|
|
197
|
-
|
|
208
|
+
WHERE (episode.uuid IN $episode_ids
|
|
209
|
+
OR (episode.fuli_session_id = $session_id AND episode.fuli_source_application = $source_application
|
|
210
|
+
AND ''' + fla_own_work_cypher('episode.fuli_project_agent_id',
|
|
211
|
+
'episode.fuli_personal_project_id') + '''))
|
|
212
|
+
AND ''' + fla_episode_visible_cypher('episode') + '''
|
|
198
213
|
WITH episode ORDER BY episode.created_at DESC, episode.uuid LIMIT $limit
|
|
199
214
|
RETURN episode.uuid AS id, episode.created_at AS created_at,
|
|
200
215
|
episode.fuli_personal_project_id AS project_id, episode.fuli_conversation_id AS conversation_id,
|
|
201
216
|
episode.fuli_source_excerpt AS excerpt
|
|
202
217
|
''', group_id=space['group_id'], episode_ids=list(task_by_episode), session_id=request.session_id,
|
|
203
|
-
source_application=request.source_application, limit=MAX_EPISODES + 1,
|
|
218
|
+
source_application=request.source_application, limit=MAX_EPISODES + 1, reader=reader_parameter(reader),
|
|
219
|
+
routing_='r')
|
|
204
220
|
episodes = []
|
|
205
221
|
for record in reversed(records[:MAX_EPISODES]):
|
|
206
222
|
created_at = native_datetime(record['created_at'])
|
|
@@ -221,7 +237,7 @@ def _task_at(tasks, moment):
|
|
|
221
237
|
return started[-1] if started else None
|
|
222
238
|
|
|
223
239
|
|
|
224
|
-
async def _items(store, space, episodes):
|
|
240
|
+
async def _items(store, space, episodes, reader):
|
|
225
241
|
"""What each episode created or updated, and the preferences it only cited
|
|
226
242
|
again (its words became their evidence). Other items mentioned again
|
|
227
243
|
changed nothing and are left out. An item is listed once with every
|
|
@@ -229,7 +245,11 @@ async def _items(store, space, episodes):
|
|
|
229
245
|
turn and project, so a reader allowed fewer projects still finds its own."""
|
|
230
246
|
items = {}
|
|
231
247
|
for episode in episodes:
|
|
232
|
-
|
|
248
|
+
changes = await episode_changes(store, space, [episode['id']])
|
|
249
|
+
hidden = await hidden_refs(store, space, reader, [(item_kind, item_id) for item_kind, item_id, _ in changes])
|
|
250
|
+
for item_kind, item_id, change in changes:
|
|
251
|
+
if (item_kind, item_id) in hidden:
|
|
252
|
+
continue
|
|
233
253
|
item = items.get((item_kind, item_id))
|
|
234
254
|
if item is None:
|
|
235
255
|
if len(items) == MAX_ITEMS:
|
|
@@ -237,7 +257,7 @@ async def _items(store, space, episodes):
|
|
|
237
257
|
current = await _read_item(store, space, item_id, item_kind)
|
|
238
258
|
if current is None or (change is None and not current.get('profile_aspect')):
|
|
239
259
|
continue
|
|
240
|
-
_, source_ids = await item_evidence(store, space, item_kind, item_id, limit=0)
|
|
260
|
+
_, source_ids = await item_evidence(store, space, item_kind, item_id, limit=0, reader=reader)
|
|
241
261
|
summary = await item_summary(store, space, item_kind, item_id, current, source_ids=source_ids)
|
|
242
262
|
item = items[(item_kind, item_id)] = {'summary': summary, 'sources': []}
|
|
243
263
|
elif change is None and not item['summary'].profile_aspect:
|
|
@@ -12,14 +12,14 @@ from pydantic import Field
|
|
|
12
12
|
|
|
13
13
|
from .knowledge_item_view_models import KnowledgeItemSummary, KnowledgeScopeProject
|
|
14
14
|
from .model_base import StrictModel
|
|
15
|
-
from .models import SourceApplication
|
|
15
|
+
from .models import AgentReaderRef, SourceApplication
|
|
16
16
|
|
|
17
17
|
# 'evidence': the episode only cited an existing preference again, so its words
|
|
18
18
|
# became evidence for it without changing it.
|
|
19
19
|
SessionRecordChange = Literal['created', 'updated', 'evidence']
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
class SessionRecordsRead(
|
|
22
|
+
class SessionRecordsRead(AgentReaderRef):
|
|
23
23
|
personal_space_id: str = Field(min_length=1, max_length=128)
|
|
24
24
|
# None: the link named only the session; its one client is found.
|
|
25
25
|
source_application: SourceApplication | None = None
|
|
@@ -54,6 +54,8 @@ class SessionTurn(StrictModel):
|
|
|
54
54
|
turn_id: str | None = None
|
|
55
55
|
created_at: datetime | None = None
|
|
56
56
|
personal_project_id: str | None = None
|
|
57
|
+
# The FLA the turn worked under, if any: an Agent reader re-checks it.
|
|
58
|
+
project_agent_id: str | None = None
|
|
57
59
|
conversation_id: str | None = None
|
|
58
60
|
# Set when capture was off for this turn's checkpoint.
|
|
59
61
|
capture_off: SessionCaptureOff | None = None
|
|
@@ -118,9 +118,13 @@ class StoreKnowledge:
|
|
|
118
118
|
limit: int | None = None,
|
|
119
119
|
personal_project_id: str | None = None,
|
|
120
120
|
offset: int | None = None,
|
|
121
|
+
*,
|
|
122
|
+
reader_project_id: str | None = None,
|
|
123
|
+
reader_agent_id: str | None = None,
|
|
121
124
|
) -> GraphResult:
|
|
122
125
|
return await read_graph(
|
|
123
|
-
self, actor, space_id, limit, personal_project_id, offset
|
|
126
|
+
self, actor, space_id, limit, personal_project_id, offset,
|
|
127
|
+
reader_project_id=reader_project_id, reader_agent_id=reader_agent_id,
|
|
124
128
|
)
|
|
125
129
|
|
|
126
130
|
async def collaboration_context(
|
|
@@ -15,19 +15,43 @@ from .models import (
|
|
|
15
15
|
SubscriptionRecord,
|
|
16
16
|
)
|
|
17
17
|
from .provider_values import json_object, native_datetime, now_utc, stable_uuid
|
|
18
|
-
from .publication_source_copies import publication_source_identity
|
|
18
|
+
from .publication_source_copies import PLAIN, PROJECT_AGENT, draft_sources, publication_source_identity
|
|
19
19
|
from .knowledge_source_fence import require_source_available
|
|
20
20
|
from .knowledge_versions import lock_knowledge
|
|
21
21
|
from .store_transactions import query_store_transaction
|
|
22
22
|
from .publication_submission import decide_submission
|
|
23
23
|
from .publication_submission_models import PublicationSubmissionDecision
|
|
24
24
|
|
|
25
|
+
# An FLA's own knowledge stays in the personal graph; Node refuses to queue it
|
|
26
|
+
# for a team project and so does the Provider (0.20.1).
|
|
27
|
+
_PROJECT_AGENT_KNOWLEDGE = {'code': 'project_agent_knowledge_personal_only',
|
|
28
|
+
'message': 'Project Agent knowledge can only be captured in the personal graph'}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def _draft_identity(space, draft) -> dict:
|
|
32
|
+
"""A stored draft's source identity; older drafts derive it from the payload."""
|
|
33
|
+
return {**publication_source_identity(space['group_id'], json_object(draft.get('payload'))),
|
|
34
|
+
**json_object(draft.get('source_identity'))}
|
|
35
|
+
|
|
25
36
|
|
|
26
37
|
class StorePublication:
|
|
38
|
+
async def _project_agent_drafts(self, actor, space, drafts) -> set[int]:
|
|
39
|
+
"""The positions among these drafts a reader without the human-review
|
|
40
|
+
proof may not see: every one whose source is not positively plain
|
|
41
|
+
work. A draft of an FLA's work (made before the Provider refused them),
|
|
42
|
+
and one whose source is erased or was never recorded here, is the
|
|
43
|
+
person's alone, its body, source and submission metadata alike; the
|
|
44
|
+
console's port lists, reads, submits and settles it."""
|
|
45
|
+
if actor.get('_human_review_verified') is True:
|
|
46
|
+
return set()
|
|
47
|
+
owners = await draft_sources(self, space, [_draft_identity(space, draft) for draft in drafts])
|
|
48
|
+
return {index for index, owner in enumerate(owners) if owner != PLAIN}
|
|
49
|
+
|
|
27
50
|
async def decide_publication_submission(self, actor, personal_space_id, draft_id, decision):
|
|
28
51
|
"""Internal submission protocol; every transition serializes with erasure."""
|
|
29
52
|
self._require_personal()
|
|
30
53
|
space = await self.authorize(actor, personal_space_id, 'maintainer')
|
|
54
|
+
await self._refuse_project_agent_draft(actor, space, draft_id, decision.decision)
|
|
31
55
|
refusal = None
|
|
32
56
|
async with query_store_transaction(self) as scoped:
|
|
33
57
|
await lock_knowledge(scoped, space)
|
|
@@ -62,9 +86,13 @@ class StorePublication:
|
|
|
62
86
|
await require_source_available(scoped, space, episode_id=identity.get('episode_id'),
|
|
63
87
|
source_application=identity.get('source_application'), session_id=identity.get('session_id'),
|
|
64
88
|
source_turn_id=identity.get('source_turn_id'))
|
|
89
|
+
if (await draft_sources(scoped, space, [identity])) == [PROJECT_AGENT]:
|
|
90
|
+
raise HTTPException(status_code=422, detail=_PROJECT_AGENT_KNOWLEDGE)
|
|
65
91
|
records, _, _ = await scoped.runtime.driver.execute_query(
|
|
66
92
|
'''
|
|
67
93
|
MATCH (space:FuliSpace {id: $personal_space_id, kind: 'personal'})
|
|
94
|
+
OPTIONAL MATCH (stored:FuliPublicationDraft {id: $id})
|
|
95
|
+
WITH space, stored IS NOT NULL AS existed
|
|
68
96
|
MERGE (draft:FuliPublicationDraft {id: $id})
|
|
69
97
|
ON CREATE SET draft.personal_space_id = $personal_space_id,
|
|
70
98
|
draft.target_project_id = $target_project_id,
|
|
@@ -74,7 +102,7 @@ class StorePublication:
|
|
|
74
102
|
draft.source_identity = $source_identity,
|
|
75
103
|
draft.created_at = $created_at
|
|
76
104
|
MERGE (space)-[:HAS_PUBLICATION_DRAFT]->(draft)
|
|
77
|
-
RETURN draft
|
|
105
|
+
RETURN draft, existed
|
|
78
106
|
''',
|
|
79
107
|
personal_space_id=request.personal_space_id,
|
|
80
108
|
id=draft_id,
|
|
@@ -84,7 +112,14 @@ class StorePublication:
|
|
|
84
112
|
source_identity=json.dumps(identity, sort_keys=True, separators=(',', ':')),
|
|
85
113
|
created_at=created_at,
|
|
86
114
|
)
|
|
87
|
-
|
|
115
|
+
draft = dict(records[0]['draft'])
|
|
116
|
+
# A retry of a key already drafted gets the stored draft back unchanged, so it is judged by
|
|
117
|
+
# the STORED row's provenance, not the request's. One this caller may not read is answered
|
|
118
|
+
# exactly as a draft that does not exist, whatever the request claims about its source: a
|
|
119
|
+
# self-reported identity is no proof that it is the same create (0.20.1).
|
|
120
|
+
if records[0]['existed'] and await self._project_agent_drafts(actor, space, [draft]):
|
|
121
|
+
raise HTTPException(status_code=404, detail='publication draft not found')
|
|
122
|
+
return self._publication_draft(draft)
|
|
88
123
|
|
|
89
124
|
async def list_publication_drafts(
|
|
90
125
|
self,
|
|
@@ -107,10 +142,11 @@ class StorePublication:
|
|
|
107
142
|
status=draft_status,
|
|
108
143
|
routing_='r',
|
|
109
144
|
)
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
145
|
+
drafts = [dict(record['draft']) for record in records]
|
|
146
|
+
hidden = await self._project_agent_drafts(actor, space, drafts)
|
|
147
|
+
return [self._publication_draft({**draft, 'source_identity': json.dumps(_draft_identity(space, draft))},
|
|
148
|
+
metadata_only=metadata_only)
|
|
149
|
+
for index, draft in enumerate(drafts) if index not in hidden]
|
|
114
150
|
|
|
115
151
|
async def get_publication_draft(
|
|
116
152
|
self,
|
|
@@ -119,7 +155,30 @@ class StorePublication:
|
|
|
119
155
|
draft_id: str,
|
|
120
156
|
) -> PublicationDraftRecord:
|
|
121
157
|
self._require_personal()
|
|
122
|
-
await self.authorize(actor, personal_space_id, 'reader')
|
|
158
|
+
space = await self.authorize(actor, personal_space_id, 'reader')
|
|
159
|
+
draft = await self._stored_draft(space, draft_id)
|
|
160
|
+
if draft is None or await self._project_agent_drafts(actor, space, [draft]):
|
|
161
|
+
raise HTTPException(status_code=404, detail='publication draft not found')
|
|
162
|
+
return self._publication_draft(draft)
|
|
163
|
+
|
|
164
|
+
async def _refuse_project_agent_draft(self, actor, space, draft_id, decision: str) -> None:
|
|
165
|
+
"""A decision on a draft whose source is not positively plain work: to
|
|
166
|
+
a caller without the human-review proof it does not exist, so no reply
|
|
167
|
+
carries its body, source or attempt. The person's console decides it;
|
|
168
|
+
a draft of an FLA's work it settles, keeps or ignores, but never starts
|
|
169
|
+
publishing. A missing draft is left to the decision's own answer."""
|
|
170
|
+
draft = await self._stored_draft(space, draft_id)
|
|
171
|
+
if draft is None:
|
|
172
|
+
return
|
|
173
|
+
[owner] = await draft_sources(self, space, [_draft_identity(space, draft)])
|
|
174
|
+
if owner == PLAIN:
|
|
175
|
+
return
|
|
176
|
+
if actor.get('_human_review_verified') is not True:
|
|
177
|
+
raise HTTPException(status_code=404, detail='publication draft not found')
|
|
178
|
+
if owner == PROJECT_AGENT and decision == 'begin_submit_public':
|
|
179
|
+
raise HTTPException(status_code=422, detail=_PROJECT_AGENT_KNOWLEDGE)
|
|
180
|
+
|
|
181
|
+
async def _stored_draft(self, space, draft_id) -> dict | None:
|
|
123
182
|
records, _, _ = await self.runtime.driver.execute_query(
|
|
124
183
|
'''
|
|
125
184
|
MATCH (:FuliSpace {id: $personal_space_id, kind: 'personal'})-
|
|
@@ -127,13 +186,11 @@ class StorePublication:
|
|
|
127
186
|
(draft:FuliPublicationDraft {id: $draft_id})
|
|
128
187
|
RETURN draft
|
|
129
188
|
''',
|
|
130
|
-
personal_space_id=
|
|
189
|
+
personal_space_id=space['id'],
|
|
131
190
|
draft_id=draft_id,
|
|
132
191
|
routing_='r',
|
|
133
192
|
)
|
|
134
|
-
if
|
|
135
|
-
raise HTTPException(status_code=404, detail='publication draft not found')
|
|
136
|
-
return self._publication_draft(records[0]['draft'])
|
|
193
|
+
return dict(records[0]['draft']) if records else None
|
|
137
194
|
|
|
138
195
|
async def decide_publication_draft(
|
|
139
196
|
self,
|
|
@@ -146,6 +203,7 @@ class StorePublication:
|
|
|
146
203
|
return await self.decide_publication_submission(actor, personal_space_id, draft_id, decision)
|
|
147
204
|
self._require_personal()
|
|
148
205
|
space = await self.authorize(actor, personal_space_id, 'maintainer')
|
|
206
|
+
await self._refuse_project_agent_draft(actor, space, draft_id, decision.decision)
|
|
149
207
|
records, _, _ = await self.runtime.driver.execute_query(
|
|
150
208
|
'''
|
|
151
209
|
MATCH (:FuliSpace {id: $personal_space_id, kind: 'personal'})-
|
|
@@ -157,3 +157,5 @@ class SessionTurnReceiptClaim(TurnReceiptClaim):
|
|
|
157
157
|
class SessionHintClaim(TurnReceiptClaim):
|
|
158
158
|
"""A hint a built-in Agent shows once per host session (rec#10 D-26.4)."""
|
|
159
159
|
operation: Literal['project_candidate', 'board_match']
|
|
160
|
+
# Whether the claim is still open, without taking it.
|
|
161
|
+
peek: bool = False
|
|
@@ -19,7 +19,8 @@ HINTS_KEY = 'session_hints'
|
|
|
19
19
|
|
|
20
20
|
async def claim_session_hint(store, actor: dict, token: str, request) -> dict:
|
|
21
21
|
"""claimed is True for exactly one current entry of the session; a
|
|
22
|
-
superseded task (404) or an earlier claim of the operation gets nothing.
|
|
22
|
+
superseded task (404) or an earlier claim of the operation gets nothing.
|
|
23
|
+
A peek takes nothing and says whether a claim would still win."""
|
|
23
24
|
store._require_personal()
|
|
24
25
|
await store.authorize(actor, request.personal_space_id, 'maintainer')
|
|
25
26
|
async with query_store_transaction(store) as scoped:
|
|
@@ -34,8 +35,11 @@ async def claim_session_hint(store, actor: dict, token: str, request) -> dict:
|
|
|
34
35
|
WHERE task.record_json CONTAINS $key
|
|
35
36
|
RETURN task.record_json AS record_json
|
|
36
37
|
''', space_id=request.personal_space_id, token=token, key=f'"{HINTS_KEY}"')
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
used = any(hint.get('operation') == request.operation
|
|
39
|
+
for row in rows for hint in json.loads(row['record_json']).get(HINTS_KEY) or [])
|
|
40
|
+
if request.peek:
|
|
41
|
+
return {'claimed': False, 'available': not used}
|
|
42
|
+
if used:
|
|
39
43
|
return {'claimed': False}
|
|
40
44
|
record[HINTS_KEY] = [*(record.get(HINTS_KEY) or []),
|
|
41
45
|
{'operation': request.operation, 'at': now_utc().isoformat()}]
|
|
Binary file
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fuli-context",
|
|
3
|
-
"version": "0.20.0
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "fuli-context",
|
|
9
|
-
"version": "0.20.0
|
|
9
|
+
"version": "0.20.0",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@a2a-js/sdk": "1.3.0",
|
|
@@ -4128,9 +4128,9 @@
|
|
|
4128
4128
|
"license": "MIT"
|
|
4129
4129
|
},
|
|
4130
4130
|
"node_modules/fast-uri": {
|
|
4131
|
-
"version": "3.1.
|
|
4132
|
-
"resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.
|
|
4133
|
-
"integrity": "sha512-
|
|
4131
|
+
"version": "3.1.9",
|
|
4132
|
+
"resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.9.tgz",
|
|
4133
|
+
"integrity": "sha512-hS/0Wt3Ya043oKXs0sIxrMpKQITXhMLIrVAKKXi4gozGC9v7YRWVnXIZzjNPTO02M9BdxLCWqK1yRXgNziVyJQ==",
|
|
4134
4134
|
"funding": [
|
|
4135
4135
|
{
|
|
4136
4136
|
"type": "github",
|
|
@@ -6427,9 +6427,9 @@
|
|
|
6427
6427
|
"license": "ISC"
|
|
6428
6428
|
},
|
|
6429
6429
|
"node_modules/undici": {
|
|
6430
|
-
"version": "7.30.
|
|
6431
|
-
"resolved": "https://registry.npmjs.org/undici/-/undici-7.30.
|
|
6432
|
-
"integrity": "sha512-
|
|
6430
|
+
"version": "7.30.1",
|
|
6431
|
+
"resolved": "https://registry.npmjs.org/undici/-/undici-7.30.1.tgz",
|
|
6432
|
+
"integrity": "sha512-03KrMbjIFDWQR5RNPrSw3bd1r12JpyFQl9/yxjUbJtqkjmllqC5lFjZh6ujeuJCKr8EOQvRW872Oy/az+nLYxg==",
|
|
6433
6433
|
"dev": true,
|
|
6434
6434
|
"license": "MIT",
|
|
6435
6435
|
"engines": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fuli-context",
|
|
3
|
-
"version": "0.20.0
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"description": "Local-first collaboration relationship graph for AI agents.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"docs/project-agent-memory.md",
|
|
18
18
|
"docs/agent-conversations-and-collaboration.md",
|
|
19
19
|
"docs/employee-agents.md",
|
|
20
|
+
"docs/agent-apps.md",
|
|
20
21
|
"docs/agent-interface-architecture.md",
|
|
21
22
|
"docs/agent-roundtable.md",
|
|
22
23
|
"examples/external-knowledge/markdown-folder.mjs",
|
|
@@ -130,7 +131,7 @@
|
|
|
130
131
|
"@hono/node-server": "2.0.12"
|
|
131
132
|
},
|
|
132
133
|
"brace-expansion": "$brace-expansion",
|
|
133
|
-
"fast-uri": "3.1.
|
|
134
|
+
"fast-uri": "3.1.9",
|
|
134
135
|
"qs": "6.16.1"
|
|
135
136
|
}
|
|
136
137
|
}
|
|
@@ -33,6 +33,12 @@ identifier, and likely runbook category. Never pass the full conversational requ
|
|
|
33
33
|
query. For example, a version-release request should search release/publish and push/commit
|
|
34
34
|
runbook concepts separately instead of searching the entire sentence.
|
|
35
35
|
|
|
36
|
+
Its response states `retrievalGuidance`, `noMatchSourceMarker` and the shared scope fields once
|
|
37
|
+
at the top level; each entry in `results` keeps its own `query`, records and `sourceMarker`. On a
|
|
38
|
+
bounded page (`next_cursor` present), a query with nothing on that page shows only `query` and
|
|
39
|
+
`total_items`; its records arrive on a later page. Long project ID lists name a prefix and count
|
|
40
|
+
the rest in `project_ids_omitted`.
|
|
41
|
+
|
|
36
42
|
Pending knowledge is eligible for on-demand retrieval and must remain visibly marked.
|
|
37
43
|
`agent_confirmed` knowledge is usable but ranks below user or authoritative-source
|
|
38
44
|
confirmation.
|