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
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Agent apps
|
|
2
|
+
|
|
3
|
+
An Agent app is a small tool, page or resident service that a FULI Agent builds for a real, repeated need. An Agent can
|
|
4
|
+
only submit an immutable version (`submit_agent_app_version`) and read the list (`list_agent_apps`). Approving,
|
|
5
|
+
rolling back, disabling and deleting belong to the local user, in a terminal (`fuli app`) or the local console.
|
|
6
|
+
|
|
7
|
+
## Trusted mode: no sandbox in this version
|
|
8
|
+
|
|
9
|
+
This version has no system sandbox. **An approved app runs in trusted mode: as an ordinary process of your own OS
|
|
10
|
+
account, with your account's permissions. FULI does not isolate it.** This is the same footing as an installed
|
|
11
|
+
[Agent workbench package](employee-agents.md), which is trusted JavaScript running with the host's privileges. Approve
|
|
12
|
+
only apps you trust.
|
|
13
|
+
|
|
14
|
+
Approval shows one warning:
|
|
15
|
+
|
|
16
|
+
> 这个应用会用你的账户权限在本机运行,FULI 不会隔离它。只批准你信任的应用。
|
|
17
|
+
> This app runs on this computer with your account's permissions, and FULI does not isolate it. Approve only apps you trust.
|
|
18
|
+
|
|
19
|
+
### What FULI's fences cover, and what they do not
|
|
20
|
+
|
|
21
|
+
FULI's tool allowlist (an app is never granted a tool marked egress, model or launch, nor any tool that grows or
|
|
22
|
+
manages apps), its permission checks, its egress checks, its injection isolation and its hard-delete fence apply
|
|
23
|
+
**only to what an app asks of the FULI Host API**: the calls it makes through its app token, its data directory port
|
|
24
|
+
and the scope FULI injects into each call.
|
|
25
|
+
|
|
26
|
+
They do **not** stop a trusted app from reading or writing files, using the network or starting processes by itself.
|
|
27
|
+
Nothing in FULI is a system isolation of trusted code, and nothing in FULI should be read as one. A refused
|
|
28
|
+
`network` field in a manifest means the FULI host grants no network access; it does not mean the app has none.
|
|
29
|
+
|
|
30
|
+
Sandboxed runners (AppContainer on Windows, bwrap on Linux, sandbox-exec on macOS) are planned for a later version
|
|
31
|
+
(rec#37); they will plug into the same runner contract (`src/agent-apps/trusted-runner.js`).
|
|
32
|
+
|
|
33
|
+
## Approving: the terminal confirmation flow
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
fl app list
|
|
37
|
+
fl app show <app-id>
|
|
38
|
+
fl app approve <app-id> <version> [--hello]
|
|
39
|
+
fl app rollback <app-id> <version> [--hello]
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
`approve` and `rollback` work the same way on Windows, macOS and Linux, and only in an interactive terminal:
|
|
43
|
+
|
|
44
|
+
1. A resident service and an irreversible data migration each get their own yes/no question first.
|
|
45
|
+
2. FULI shows the app name, a short summary of this version's terms (package digest, permissions, data directory,
|
|
46
|
+
resident service), the trusted-mode warning above and this notice:
|
|
47
|
+
> 输入应用名即完成终端确认流程。这不证明是真人操作,也不能抵御以同一账户运行的其他程序。
|
|
48
|
+
> Typing the app name completes the terminal confirmation flow. This does not prove a person did it, and it does not
|
|
49
|
+
> protect against other programs running under the same account.
|
|
50
|
+
3. You type the app name (the package name, for example `dispatch-log`) to confirm. Enter on an empty line or Ctrl-C
|
|
51
|
+
cancels.
|
|
52
|
+
|
|
53
|
+
Each attempt uses a one-time challenge that expires after 10 minutes. It binds the exact action, the package digest,
|
|
54
|
+
the terms version and `trustMode: 'trusted'`. It is committed in two steps (claim, then finalize), so of concurrent
|
|
55
|
+
attempts exactly one can approve. A wrong name, a cancellation, an expired challenge, a replay, or terms or a package
|
|
56
|
+
that changed after the prompt approves nothing and leaves the challenge used.
|
|
57
|
+
|
|
58
|
+
`--hello` adds Windows Hello on Windows after the name is typed, and records the approval as presence `hello`. It is
|
|
59
|
+
optional and never required; if you ask for it and Hello fails or is cancelled, that decision is refused. Other
|
|
60
|
+
platforms have no `--hello`.
|
|
61
|
+
|
|
62
|
+
An approval from the local console completes no terminal confirmation, so the run gate refuses that version until
|
|
63
|
+
`fl app approve` or `fl app rollback` confirms it.
|
|
64
|
+
|
|
65
|
+
## When an app runs
|
|
66
|
+
|
|
67
|
+
Every start of an app (on demand, an idle restart, a resident launch) passes the run gate. It runs only when:
|
|
68
|
+
|
|
69
|
+
- the active version has an approval that completed the terminal confirmation flow under this version's terms
|
|
70
|
+
(`trustMode: 'trusted'`, the current terms version), recorded with its consumed challenge;
|
|
71
|
+
- that approval covers the version's digest, permissions, data scope and resident service;
|
|
72
|
+
- the package on disk still has the approved digest.
|
|
73
|
+
|
|
74
|
+
Otherwise the gate answers `confirmation_required`, `reconfirmation_required` or `challenge_mismatch`, and no app code
|
|
75
|
+
starts. The app process gets only `FULI_APP_ID`, `FULI_APP_INSTANCE` and `FULI_APP_TOKEN` from FULI, plus the
|
|
76
|
+
platform basics (`PATH`, temp and home directories); none of FULI's own tokens or keys. It runs in its package
|
|
77
|
+
directory and ends when the FULI process that started it exits.
|
|
78
|
+
|
|
79
|
+
## After upgrading from an earlier FULI
|
|
80
|
+
|
|
81
|
+
Approvals made before trusted mode (the isolated mode of the previous version, Windows Hello approvals included) are
|
|
82
|
+
**not** converted. Consent to code that was to run isolated is not consent to run it with your own permissions. The
|
|
83
|
+
registry migrates by itself (format 8 adds the trust mode and terms version to each approval; the earlier ones keep
|
|
84
|
+
none), and each such version answers `reconfirmation_required` until you confirm it again:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
fl app rollback <app-id> <active-version>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Stopping
|
|
91
|
+
|
|
92
|
+
When FULI itself shuts down, it takes no new start, call or decision, lets work in flight finish (30 seconds at most),
|
|
93
|
+
then seals and stops every app it started and releases them, so another FULI process can start them without a takeover.
|
|
94
|
+
A start that returns after that is stopped at once. If FULI cannot confirm that an app process it started has stopped,
|
|
95
|
+
the shutdown says so and names the app instead of reporting a clean close; closing again retries the stop.
|
|
96
|
+
|
|
97
|
+
An app that ends by itself ends its instance. The app's details show the exit code, the signal and one of three fixed
|
|
98
|
+
categories with a fixed message: `load_failed` (it ended before its entry finished loading), `crashed` (it ended with
|
|
99
|
+
an error after that) or `exited` (it finished with code 0). FULI does not read or keep anything the app writes to its
|
|
100
|
+
output. It can then be started again.
|
|
101
|
+
|
|
102
|
+
An entry has finished loading once its module, including any top-level `await`, has settled. An entry whose top-level
|
|
103
|
+
`await` never settles (a server loop awaited at the top level, for example) never counts as loaded, so a later crash is
|
|
104
|
+
labelled `load_failed`. Finish top-level initialization promptly and keep long-running work in callbacks, timers or
|
|
105
|
+
servers that keep the process alive.
|
|
106
|
+
|
|
107
|
+
`fl app stop <app-id>` seals the instance (no new call verifies; a write tool in progress finishes first), stops the
|
|
108
|
+
app process through the handle FULI holds and ends its tokens. `--force` is not supported on any platform in this
|
|
109
|
+
version: when another FULI process holds the app, stop that FULI process first. FULI never ends a process by PID; if
|
|
110
|
+
an app process an exited FULI started is still running, end it yourself and try again.
|
package/docs/employee-agents.md
CHANGED
|
@@ -56,7 +56,7 @@ Packages live under the configured FULI data directory, separately from employee
|
|
|
56
56
|
|
|
57
57
|
Only a regular `.installation.json` at the package root is excluded from content identity as host-generated metadata. File-type validation still rejects receipt symlinks before installation can write through them. Files with that name in subdirectories remain package content: changes require an explicit replacement, and directory contents still undergo normal validation.
|
|
58
58
|
|
|
59
|
-
**Installed runtimes are trusted JavaScript running with the host's privileges, not sandboxed plugins.** Only install trusted packages. Path confinement, manifest validation, size limits, rejection of symlinks, `.env`, `.git` and `node_modules` protect the installation boundary; they do not make malicious runtime code safe.
|
|
59
|
+
**Installed runtimes are trusted JavaScript running with the host's privileges, not sandboxed plugins.** Only install trusted packages. Path confinement, manifest validation, size limits, rejection of symlinks, `.env`, `.git` and `node_modules` protect the installation boundary; they do not make malicious runtime code safe. Manifest permissions and FULI's permission, egress, injection and hard-delete checks constrain only what a runtime asks of the FULI host; they do not stop trusted code from reading files, using the network or starting processes itself. [Agent apps](agent-apps.md) run on the same trusted footing in this version.
|
|
60
60
|
|
|
61
61
|
## Manifest API v1
|
|
62
62
|
|
|
@@ -366,20 +366,20 @@ def create_app(settings: Settings | None = None) -> FastAPI:
|
|
|
366
366
|
register_graph_format_routes(application, runtime, resolved_settings, Actor, HumanReviewer)
|
|
367
367
|
register_project_agent_routes(application, store, Actor)
|
|
368
368
|
register_knowledge_tag_routes(application, store, Actor, ReviewAwareActor, HumanReviewer)
|
|
369
|
-
register_knowledge_item_routes(application, store, Actor, HumanReviewer)
|
|
369
|
+
register_knowledge_item_routes(application, store, Actor, ReviewAwareActor, HumanReviewer)
|
|
370
370
|
register_knowledge_hard_delete_routes(application, store, HumanReviewer)
|
|
371
371
|
register_knowledge_deletion_watermark_route(application, store, Actor)
|
|
372
372
|
|
|
373
373
|
@application.post('/v1/publication-drafts', response_model=PublicationDraftRecord)
|
|
374
374
|
async def create_publication_draft(
|
|
375
375
|
request: PublicationDraftCreate,
|
|
376
|
-
actor:
|
|
376
|
+
actor: ReviewAwareActor,
|
|
377
377
|
) -> PublicationDraftRecord:
|
|
378
378
|
return await store.create_publication_draft(actor, request)
|
|
379
379
|
|
|
380
380
|
@application.get('/v1/publication-drafts', response_model=list[PublicationDraftRecord])
|
|
381
381
|
async def list_publication_drafts(
|
|
382
|
-
actor:
|
|
382
|
+
actor: ReviewAwareActor,
|
|
383
383
|
personal_space_id: Annotated[str, Query(min_length=1, max_length=128)],
|
|
384
384
|
draft_status: Annotated[str, Query(alias='status')] = 'pending',
|
|
385
385
|
metadata_only: bool = False,
|
|
@@ -392,7 +392,7 @@ def create_app(settings: Settings | None = None) -> FastAPI:
|
|
|
392
392
|
)
|
|
393
393
|
async def get_publication_draft(
|
|
394
394
|
draft_id: str,
|
|
395
|
-
actor:
|
|
395
|
+
actor: ReviewAwareActor,
|
|
396
396
|
personal_space_id: Annotated[str, Query(min_length=1, max_length=128)],
|
|
397
397
|
) -> PublicationDraftRecord:
|
|
398
398
|
return await store.get_publication_draft(actor, personal_space_id, draft_id)
|
|
@@ -404,7 +404,7 @@ def create_app(settings: Settings | None = None) -> FastAPI:
|
|
|
404
404
|
async def decide_publication_draft(
|
|
405
405
|
draft_id: str,
|
|
406
406
|
request: PublicationSubmissionDecision,
|
|
407
|
-
actor:
|
|
407
|
+
actor: ReviewAwareActor,
|
|
408
408
|
personal_space_id: Annotated[str, Query(min_length=1, max_length=128)],
|
|
409
409
|
) -> PublicationDraftRecord:
|
|
410
410
|
return await store.decide_publication_draft(
|
|
@@ -659,7 +659,7 @@ def create_app(settings: Settings | None = None) -> FastAPI:
|
|
|
659
659
|
)
|
|
660
660
|
async def review_decision(
|
|
661
661
|
request: KnowledgeReviewDecisionLookup,
|
|
662
|
-
actor:
|
|
662
|
+
actor: ReviewAwareActor,
|
|
663
663
|
) -> KnowledgeReviewDecisionLookupResult:
|
|
664
664
|
return await read_knowledge_review_decision(store, actor, request)
|
|
665
665
|
|
|
@@ -809,7 +809,7 @@ def create_app(settings: Settings | None = None) -> FastAPI:
|
|
|
809
809
|
)
|
|
810
810
|
async def defer_conflict(
|
|
811
811
|
request: PreferenceConflictDeferCreate,
|
|
812
|
-
actor:
|
|
812
|
+
actor: ReviewAwareActor,
|
|
813
813
|
) -> PreferenceConflictRecord:
|
|
814
814
|
return await defer_preference_conflict(store, actor, request)
|
|
815
815
|
|
|
@@ -818,7 +818,7 @@ def create_app(settings: Settings | None = None) -> FastAPI:
|
|
|
818
818
|
response_model=list[PreferenceConflictRecord],
|
|
819
819
|
)
|
|
820
820
|
async def preference_conflicts(
|
|
821
|
-
actor:
|
|
821
|
+
actor: ReviewAwareActor,
|
|
822
822
|
personal_space_id: Annotated[str, Query(min_length=1, max_length=128)],
|
|
823
823
|
status: Annotated[str | None, Query(pattern='^(ai_pending|resolved)$')] = None,
|
|
824
824
|
limit: Annotated[int, Query(ge=1, le=1000)] = 500,
|
|
@@ -856,7 +856,7 @@ def create_app(settings: Settings | None = None) -> FastAPI:
|
|
|
856
856
|
async def complete_conflict(
|
|
857
857
|
conflict_id: str,
|
|
858
858
|
request: PreferenceConflictCompleteCreate,
|
|
859
|
-
actor:
|
|
859
|
+
actor: ReviewAwareActor,
|
|
860
860
|
) -> PreferenceConflictRecord:
|
|
861
861
|
return await complete_preference_conflict(
|
|
862
862
|
store,
|
|
@@ -985,12 +985,17 @@ def create_app(settings: Settings | None = None) -> FastAPI:
|
|
|
985
985
|
@application.get('/v1/spaces/{space_id}/graph', response_model=GraphResult)
|
|
986
986
|
async def graph(
|
|
987
987
|
space_id: str,
|
|
988
|
-
|
|
988
|
+
# The console's full read carries the human-review proof; any other
|
|
989
|
+
# read is an Agent's: a plain session, or the FLA it names.
|
|
990
|
+
actor: ReviewAwareActor,
|
|
989
991
|
limit: Annotated[int | None, Query(ge=1, le=2000)] = None,
|
|
990
992
|
personal_project_id: Annotated[str | None, Query(min_length=1, max_length=128)] = None,
|
|
991
993
|
offset: Annotated[int | None, Query(ge=0)] = None,
|
|
994
|
+
reader_project_id: Annotated[str | None, Query(min_length=1, max_length=128)] = None,
|
|
995
|
+
reader_agent_id: Annotated[str | None, Query(min_length=1, max_length=128)] = None,
|
|
992
996
|
) -> GraphResult:
|
|
993
|
-
return await store.graph(actor, space_id, limit, personal_project_id, offset
|
|
997
|
+
return await store.graph(actor, space_id, limit, personal_project_id, offset,
|
|
998
|
+
reader_project_id=reader_project_id, reader_agent_id=reader_agent_id)
|
|
994
999
|
|
|
995
1000
|
return application
|
|
996
1001
|
|
|
@@ -28,6 +28,13 @@ from .project_knowledge import (
|
|
|
28
28
|
read_personal_project_relations,
|
|
29
29
|
read_project_references,
|
|
30
30
|
)
|
|
31
|
+
from .knowledge_visibility import (
|
|
32
|
+
fla_episode_visible_cypher,
|
|
33
|
+
fla_relationship_visible_cypher,
|
|
34
|
+
fla_visible_cypher,
|
|
35
|
+
knowledge_reader,
|
|
36
|
+
reader_parameter,
|
|
37
|
+
)
|
|
31
38
|
from .knowledge_weight import effective_confirmation_status, knowledge_weight
|
|
32
39
|
from .negative_feedback_block import agent_authority_suspension
|
|
33
40
|
|
|
@@ -39,11 +46,18 @@ async def read_graph(
|
|
|
39
46
|
limit: int | None = None,
|
|
40
47
|
personal_project_id: str | None = None,
|
|
41
48
|
offset: int | None = None,
|
|
49
|
+
*,
|
|
50
|
+
reader_project_id: str | None = None,
|
|
51
|
+
reader_agent_id: str | None = None,
|
|
42
52
|
) -> GraphResult:
|
|
43
53
|
space = await store.authorize(actor, space_id, 'reader')
|
|
44
54
|
project = None
|
|
45
55
|
if personal_project_id:
|
|
46
56
|
project = await authorize_personal_project(store, actor, space, personal_project_id)
|
|
57
|
+
# An Agent sees no other FLA's knowledge; hidden items are cut in the
|
|
58
|
+
# queries, so a page, its edges and its evidence never reveal them.
|
|
59
|
+
reader = reader_parameter(await knowledge_reader(
|
|
60
|
+
store, actor, space, personal_project_id=reader_project_id, project_agent_id=reader_agent_id))
|
|
47
61
|
bounded_limit = min(limit or store.settings.graph_limit, store.settings.graph_limit)
|
|
48
62
|
paginated = offset is not None
|
|
49
63
|
page_offset = offset or 0
|
|
@@ -52,6 +66,7 @@ async def read_graph(
|
|
|
52
66
|
space_id=space_id,
|
|
53
67
|
group_id=space['group_id'],
|
|
54
68
|
project_id=personal_project_id,
|
|
69
|
+
reader=reader,
|
|
55
70
|
limit=bounded_limit + 1,
|
|
56
71
|
offset=page_offset,
|
|
57
72
|
routing_='r',
|
|
@@ -71,6 +86,7 @@ async def read_graph(
|
|
|
71
86
|
project_id=personal_project_id,
|
|
72
87
|
node_ids=node_ids,
|
|
73
88
|
episode_ids=episode_ids,
|
|
89
|
+
reader=reader,
|
|
74
90
|
limit=bounded_limit + 1 if paginated else bounded_limit,
|
|
75
91
|
offset=page_offset,
|
|
76
92
|
routing_='r',
|
|
@@ -83,7 +99,14 @@ async def read_graph(
|
|
|
83
99
|
*episode_ids,
|
|
84
100
|
*(episode_id for record in edge_records for episode_id in (record.get('episodes') or [])),
|
|
85
101
|
})
|
|
86
|
-
evidence = await _read_evidence(store, all_episode_ids, space['group_id'])
|
|
102
|
+
evidence = await _read_evidence(store, all_episode_ids, space['group_id'], reader)
|
|
103
|
+
if reader is not None:
|
|
104
|
+
# A visible item keeps no other FLA's episode, as evidence or as an id.
|
|
105
|
+
node_records, edge_records = (
|
|
106
|
+
[dict(record) | {'episodes': [item for item in record.get('episodes') or [] if item in evidence]}
|
|
107
|
+
for record in records]
|
|
108
|
+
for records in (node_records, edge_records)
|
|
109
|
+
)
|
|
87
110
|
item_ids = node_ids + [record['id'] for record in edge_records]
|
|
88
111
|
revisions = await _read_revisions(store, space_id, item_ids)
|
|
89
112
|
assignments = await _read_assignments(store, space_id, item_ids)
|
|
@@ -218,6 +241,7 @@ def _node_query(project_scoped: bool, paginated: bool = False) -> str:
|
|
|
218
241
|
'''
|
|
219
242
|
pagination = 'SKIP $offset LIMIT $limit' if paginated else 'LIMIT $limit'
|
|
220
243
|
return match + '''
|
|
244
|
+
WITH node, episodes WHERE ''' + fla_visible_cypher('node', 'entity') + '''
|
|
221
245
|
RETURN node.uuid AS id, node.name AS name, node.group_id AS group_id,
|
|
222
246
|
coalesce(node.fuli_type, 'Entity') AS type,
|
|
223
247
|
coalesce(node.summary, '') AS summary,
|
|
@@ -348,6 +372,8 @@ def _edge_query(project_scoped: bool, paginated: bool = False) -> str:
|
|
|
348
372
|
''' if project_scoped else ''
|
|
349
373
|
pagination = 'SKIP $offset LIMIT $limit' if paginated else 'LIMIT $limit'
|
|
350
374
|
return match + project_filter + '''
|
|
375
|
+
WITH source, edge, target
|
|
376
|
+
WHERE ''' + fla_relationship_visible_cypher('edge', 'source', 'target') + '''
|
|
351
377
|
RETURN edge.uuid AS id, source.uuid AS source, target.uuid AS target,
|
|
352
378
|
source.name AS source_name, target.name AS target_name,
|
|
353
379
|
edge.name AS type, edge.fact AS fact,
|
|
@@ -433,12 +459,13 @@ async def _personal_projects(store, space: dict) -> list[dict]:
|
|
|
433
459
|
return [dict(record['project']) for record in records]
|
|
434
460
|
|
|
435
461
|
|
|
436
|
-
async def _read_evidence(store, episode_ids: list[str], group_id: str) -> dict[str, GraphEvidence]:
|
|
462
|
+
async def _read_evidence(store, episode_ids: list[str], group_id: str, reader=None) -> dict[str, GraphEvidence]:
|
|
437
463
|
if not episode_ids:
|
|
438
464
|
return {}
|
|
439
465
|
records, _, _ = await store.runtime.driver.execute_query(
|
|
440
466
|
'''
|
|
441
467
|
MATCH (episode:Episodic {group_id: $group_id}) WHERE episode.uuid IN $episode_ids
|
|
468
|
+
AND ''' + fla_episode_visible_cypher('episode') + '''
|
|
442
469
|
RETURN episode.uuid AS id, episode.name AS name,
|
|
443
470
|
episode.source_description AS source_description,
|
|
444
471
|
coalesce(episode.fuli_source_kind, 'unknown') AS source_kind,
|
|
@@ -454,6 +481,7 @@ async def _read_evidence(store, episode_ids: list[str], group_id: str) -> dict[s
|
|
|
454
481
|
''',
|
|
455
482
|
episode_ids=episode_ids,
|
|
456
483
|
group_id=group_id,
|
|
484
|
+
reader=reader,
|
|
457
485
|
routing_='r',
|
|
458
486
|
)
|
|
459
487
|
return {
|
|
@@ -28,6 +28,9 @@ from .negative_feedback_block import (
|
|
|
28
28
|
agent_authority_suspension,
|
|
29
29
|
negative_feedback_block_json,
|
|
30
30
|
)
|
|
31
|
+
from .knowledge_visibility import (
|
|
32
|
+
PLAIN_SESSION, fla_relationship_visible_cypher, fla_visible_cypher, reader_parameter,
|
|
33
|
+
)
|
|
31
34
|
from .provider_values import json_object, native_datetime, stable_uuid
|
|
32
35
|
from .store_transactions import query_store_transaction
|
|
33
36
|
|
|
@@ -553,6 +556,9 @@ async def search_human_changes(
|
|
|
553
556
|
'status': request.status,
|
|
554
557
|
'search_query': needle,
|
|
555
558
|
'limit': request.limit,
|
|
559
|
+
# Only an Agent searches human changes, and as no FLA: every FLA's own
|
|
560
|
+
# knowledge stays out of it (knowledge_visibility).
|
|
561
|
+
'reader': reader_parameter(PLAIN_SESSION),
|
|
556
562
|
'routing_': 'r',
|
|
557
563
|
}
|
|
558
564
|
entity_records, _, _ = await store.runtime.driver.execute_query(
|
|
@@ -996,6 +1002,7 @@ WHERE item.fuli_human_edited = true
|
|
|
996
1002
|
WHERE toLower(coalesce(audit.reason, '')) CONTAINS $search_query
|
|
997
1003
|
}
|
|
998
1004
|
)
|
|
1005
|
+
AND ''' + fla_visible_cypher('item', 'entity') + '''
|
|
999
1006
|
RETURN item.uuid AS item_id,
|
|
1000
1007
|
item.name AS title,
|
|
1001
1008
|
coalesce(item.summary, '') AS body,
|
|
@@ -1011,7 +1018,7 @@ LIMIT $limit
|
|
|
1011
1018
|
|
|
1012
1019
|
|
|
1013
1020
|
_HUMAN_RELATIONSHIP_SEARCH = '''
|
|
1014
|
-
MATCH ()-[item:RELATES_TO {group_id: $group_id}]->()
|
|
1021
|
+
MATCH (item_source)-[item:RELATES_TO {group_id: $group_id}]->(item_target)
|
|
1015
1022
|
WHERE item.fuli_human_edited = true
|
|
1016
1023
|
AND (
|
|
1017
1024
|
$status IN ['all', 'human_changed']
|
|
@@ -1029,6 +1036,7 @@ WHERE item.fuli_human_edited = true
|
|
|
1029
1036
|
WHERE toLower(coalesce(audit.reason, '')) CONTAINS $search_query
|
|
1030
1037
|
}
|
|
1031
1038
|
)
|
|
1039
|
+
AND ''' + fla_relationship_visible_cypher('item', 'item_source', 'item_target') + '''
|
|
1032
1040
|
RETURN item.uuid AS item_id,
|
|
1033
1041
|
item.name AS title,
|
|
1034
1042
|
coalesce(item.fact, '') AS body,
|
|
@@ -4,7 +4,10 @@ the scope quick edit and a session's batch migration into a formal project
|
|
|
4
4
|
queries like the other Provider queries; every scope write names its expected
|
|
5
5
|
version and reason. A scope write is audited as the person's own change, so
|
|
6
6
|
it takes the human-review channel the local console holds (as a hard delete
|
|
7
|
-
does); an Agent's access token alone is refused (rec#11 D-22, dot P1-1).
|
|
7
|
+
does); an Agent's access token alone is refused (rec#11 D-22, dot P1-1).
|
|
8
|
+
An item view, a receipt, a session's records and its migration preview are
|
|
9
|
+
read in full only with that proof; without it the reader is an Agent and sees
|
|
10
|
+
no other FLA's knowledge, and a wrong proof is refused (knowledge_visibility)."""
|
|
8
11
|
|
|
9
12
|
from typing import Any
|
|
10
13
|
|
|
@@ -28,13 +31,14 @@ from .session_records import read_session_records
|
|
|
28
31
|
from .session_records_models import SessionRecords, SessionRecordsRead
|
|
29
32
|
|
|
30
33
|
|
|
31
|
-
def register_knowledge_item_routes(application, store, Actor: Any,
|
|
34
|
+
def register_knowledge_item_routes(application, store, Actor: Any, ReviewAwareActor: Any,
|
|
35
|
+
HumanReviewer: Any) -> None:
|
|
32
36
|
@application.post('/v1/knowledge/item-views', response_model=KnowledgeItemView)
|
|
33
|
-
async def item_view(request: KnowledgeItemRef, actor:
|
|
37
|
+
async def item_view(request: KnowledgeItemRef, actor: ReviewAwareActor):
|
|
34
38
|
return await read_knowledge_item_view(store, actor, request)
|
|
35
39
|
|
|
36
40
|
@application.post('/v1/knowledge/turn-receipts', response_model=KnowledgeTurnReceipt)
|
|
37
|
-
async def turn_receipt(request: KnowledgeTurnReceiptRead, actor:
|
|
41
|
+
async def turn_receipt(request: KnowledgeTurnReceiptRead, actor: ReviewAwareActor):
|
|
38
42
|
return await read_turn_receipt(store, actor, request)
|
|
39
43
|
|
|
40
44
|
@application.post('/v1/knowledge/items/{item_id}/scope')
|
|
@@ -42,7 +46,7 @@ def register_knowledge_item_routes(application, store, Actor: Any, HumanReviewer
|
|
|
42
46
|
return await change_knowledge_scope(store, actor, item_id, request)
|
|
43
47
|
|
|
44
48
|
@application.post('/v1/knowledge/session-migrations/preview', response_model=SessionMigrationPreview)
|
|
45
|
-
async def session_migration_preview(request: SessionMigrationRead, actor:
|
|
49
|
+
async def session_migration_preview(request: SessionMigrationRead, actor: ReviewAwareActor):
|
|
46
50
|
return await preview_session_migration(store, actor, request)
|
|
47
51
|
|
|
48
52
|
@application.post('/v1/knowledge/session-migrations/apply', response_model=SessionMigrationResult)
|
|
@@ -50,5 +54,5 @@ def register_knowledge_item_routes(application, store, Actor: Any, HumanReviewer
|
|
|
50
54
|
return await apply_session_migration(store, actor, request)
|
|
51
55
|
|
|
52
56
|
@application.post('/v1/session-records', response_model=SessionRecords)
|
|
53
|
-
async def session_records(request: SessionRecordsRead, actor:
|
|
57
|
+
async def session_records(request: SessionRecordsRead, actor: ReviewAwareActor):
|
|
54
58
|
return await read_session_records(store, actor, request)
|
|
@@ -32,6 +32,13 @@ from .knowledge_project_scope import knowledge_project_ids
|
|
|
32
32
|
from .knowledge_search import search_knowledge
|
|
33
33
|
from .knowledge_tags import PERSONAL_NAMESPACE, project_namespace
|
|
34
34
|
from .knowledge_versions import item_revisions, version_chain, version_status
|
|
35
|
+
from .knowledge_visibility import (
|
|
36
|
+
fla_episode_visible_cypher,
|
|
37
|
+
hidden_refs,
|
|
38
|
+
reader_parameter,
|
|
39
|
+
request_reader,
|
|
40
|
+
visible_episode_ids,
|
|
41
|
+
)
|
|
35
42
|
from .knowledge_weight import effective_confirmation_status, knowledge_weight
|
|
36
43
|
from .provider_values import json_object, native_datetime
|
|
37
44
|
|
|
@@ -44,26 +51,37 @@ _RULE_TYPE = re.compile(r'rule|policy|convention|constraint|guideline|standard',
|
|
|
44
51
|
|
|
45
52
|
async def read_knowledge_item_view(store, actor: dict, request: KnowledgeItemRef) -> KnowledgeItemView:
|
|
46
53
|
space = await personal_reader_space(store, actor, request.personal_space_id)
|
|
54
|
+
# An Agent sees another FLA's item as missing, and nothing of it in this
|
|
55
|
+
# view's evidence, versions, dependents or bases (knowledge_visibility).
|
|
56
|
+
reader = await request_reader(store, actor, space, request)
|
|
57
|
+
if reader is not None and request.query_tags is not None:
|
|
58
|
+
raise HTTPException(status_code=403, detail='a ranking explanation is read on the human-review channel')
|
|
47
59
|
# The deletion trace is authoritative: a deleted ID answers 410 whatever
|
|
48
60
|
# else is stored now (rec#5 C9).
|
|
49
61
|
await require_not_hard_deleted(store, space, request.item_id)
|
|
50
62
|
current = await _read_item(store, space, request.item_id, request.item_kind)
|
|
51
|
-
if current is None:
|
|
63
|
+
if current is None or await hidden_refs(store, space, reader, [(request.item_kind, request.item_id)]):
|
|
52
64
|
raise HTTPException(status_code=404, detail='knowledge item not found')
|
|
53
|
-
evidence, source_ids = await item_evidence(store, space, request.item_kind, request.item_id)
|
|
65
|
+
evidence, source_ids = await item_evidence(store, space, request.item_kind, request.item_id, reader=reader)
|
|
54
66
|
revisions = (await item_revisions(store, space, request.item_kind, [request.item_id])).get(request.item_id, [])
|
|
55
67
|
summary = await item_summary(store, space, request.item_kind, request.item_id, current,
|
|
56
68
|
source_ids=source_ids, revisions=revisions)
|
|
57
69
|
versions = await version_chain(store, space, request.item_kind, request.item_id)
|
|
58
70
|
head = next((version['item_id'] for version in versions if version['status'] == 'current'), None)
|
|
71
|
+
dependents = await dependents_of(store, space, request.item_kind, head or request.item_id)
|
|
72
|
+
bases = await item_bases(store, space, request.item_kind, request.item_id, current)
|
|
73
|
+
hidden = await hidden_refs(store, space, reader, [
|
|
74
|
+
*((request.item_kind, version['item_id']) for version in versions), *dependents,
|
|
75
|
+
*((basis['item_kind'], basis['item_id']) for basis in bases if basis['status'] != 'deleted')])
|
|
59
76
|
view = KnowledgeItemView(
|
|
60
77
|
basis_review=basis_review(current, revisions),
|
|
61
|
-
dependent_count=len(
|
|
78
|
+
dependent_count=len([dependent for dependent in dependents if dependent not in hidden]),
|
|
62
79
|
**summary.model_dump(), evidence=evidence, evidence_count=len(source_ids),
|
|
63
80
|
unavailable_sources=await unavailable_source_bases(store, space, current.get('unresolved_bases') or []),
|
|
64
|
-
revisions=revisions[:REVISION_LIMIT],
|
|
65
|
-
|
|
66
|
-
|
|
81
|
+
revisions=revisions[:REVISION_LIMIT],
|
|
82
|
+
versions=[version for version in versions if (request.item_kind, version['item_id']) not in hidden],
|
|
83
|
+
current_item_id=None if (request.item_kind, head) in hidden else head,
|
|
84
|
+
bases=[basis for basis in bases if (basis['item_kind'], basis['item_id']) not in hidden])
|
|
67
85
|
if request.query_tags is not None:
|
|
68
86
|
# Run the normal visibility pipeline again. These ranks describe the
|
|
69
87
|
# current query and graph, never a replay of an earlier search result.
|
|
@@ -79,18 +97,25 @@ async def read_knowledge_item_view(store, actor: dict, request: KnowledgeItemRef
|
|
|
79
97
|
|
|
80
98
|
async def read_turn_receipt(store, actor: dict, request: KnowledgeTurnReceiptRead) -> KnowledgeTurnReceipt:
|
|
81
99
|
space = await personal_reader_space(store, actor, request.personal_space_id)
|
|
100
|
+
# For an Agent, another FLA's episodes and items are neither listed nor counted.
|
|
101
|
+
reader = await request_reader(store, actor, space, request)
|
|
102
|
+
episode_ids = await visible_episode_ids(store, space, reader, request.episode_ids)
|
|
103
|
+
changes = await episode_changes(store, space, episode_ids)
|
|
104
|
+
hidden = await hidden_refs(store, space, reader, [(item_kind, item_id) for item_kind, item_id, _ in changes])
|
|
82
105
|
entries, unchanged = [], 0
|
|
83
|
-
for item_kind, item_id, change in
|
|
106
|
+
for item_kind, item_id, change in changes:
|
|
107
|
+
if (item_kind, item_id) in hidden:
|
|
108
|
+
continue
|
|
84
109
|
if change is None:
|
|
85
110
|
unchanged += 1
|
|
86
111
|
continue
|
|
87
112
|
current = await _read_item(store, space, item_id, item_kind)
|
|
88
113
|
if current is None:
|
|
89
114
|
continue
|
|
90
|
-
_, source_ids = await item_evidence(store, space, item_kind, item_id, limit=0)
|
|
115
|
+
_, source_ids = await item_evidence(store, space, item_kind, item_id, limit=0, reader=reader)
|
|
91
116
|
summary = await item_summary(store, space, item_kind, item_id, current, source_ids=source_ids)
|
|
92
117
|
entries.append(KnowledgeReceiptEntry(**summary.model_dump(), change=change))
|
|
93
|
-
deletions = await hard_deletions_in_episodes(store, space,
|
|
118
|
+
deletions = await hard_deletions_in_episodes(store, space, episode_ids)
|
|
94
119
|
return KnowledgeTurnReceipt(entries=entries, unchanged_count=unchanged, deleted_count=len(deletions),
|
|
95
120
|
deletion_ids=deletions)
|
|
96
121
|
|
|
@@ -236,7 +261,9 @@ async def episode_changes(store, space, episode_ids):
|
|
|
236
261
|
]
|
|
237
262
|
|
|
238
263
|
|
|
239
|
-
async def item_evidence(store, space, item_kind, item_id, *, limit=EVIDENCE_LIMIT):
|
|
264
|
+
async def item_evidence(store, space, item_kind, item_id, *, limit=EVIDENCE_LIMIT, reader=None):
|
|
265
|
+
"""The item's source episodes, newest first. An Agent reader gets none
|
|
266
|
+
that another FLA wrote, in the list or in the ids it counts."""
|
|
240
267
|
match = (
|
|
241
268
|
'MATCH (episode:Episodic {group_id: $group_id})-[:MENTIONS]->(:Entity {uuid: $item_id, group_id: $group_id})'
|
|
242
269
|
if item_kind == 'entity' else
|
|
@@ -246,13 +273,15 @@ async def item_evidence(store, space, item_kind, item_id, *, limit=EVIDENCE_LIMI
|
|
|
246
273
|
'OR item.uuid IN coalesce(episode.entity_edges, [])')
|
|
247
274
|
records, _, _ = await store.runtime.driver.execute_query(
|
|
248
275
|
match + '''
|
|
249
|
-
WITH DISTINCT episode
|
|
276
|
+
WITH DISTINCT episode WHERE ''' + fla_episode_visible_cypher('episode') + '''
|
|
277
|
+
WITH episode ORDER BY episode.created_at DESC
|
|
250
278
|
WITH collect(episode) AS episodes
|
|
251
279
|
RETURN [episode IN episodes | episode.uuid] AS ids, [episode IN episodes[..$limit] | episode {
|
|
252
280
|
.uuid, .created_at, .fuli_source_kind, .fuli_source_application, .fuli_session_id,
|
|
253
281
|
.fuli_conversation_id, .fuli_source_turn_id, .fuli_source_excerpt, .fuli_personal_project_id
|
|
254
282
|
}] AS episodes
|
|
255
|
-
''', group_id=space['group_id'], item_id=item_id, limit=limit,
|
|
283
|
+
''', group_id=space['group_id'], item_id=item_id, limit=limit, reader=reader_parameter(reader),
|
|
284
|
+
routing_='r')
|
|
256
285
|
if not records:
|
|
257
286
|
return [], []
|
|
258
287
|
return [KnowledgeEvidenceSource(
|
|
@@ -12,7 +12,7 @@ from pydantic import Field, model_serializer, model_validator
|
|
|
12
12
|
from .knowledge_audit_models import KnowledgeChangeActor, KnowledgeItemKind, KnowledgeRevisionRecord
|
|
13
13
|
from .knowledge_tag_models import KnowledgeTagReference
|
|
14
14
|
from .model_base import StrictModel
|
|
15
|
-
from .models import ConfirmationStatus, ContentSource, SearchRequest
|
|
15
|
+
from .models import AgentReaderRef, ConfirmationStatus, ContentSource, SearchRequest
|
|
16
16
|
|
|
17
17
|
# What kind of content an item holds, for its label. Derived from the item's
|
|
18
18
|
# stored profile aspect or type; not a separate Rule model.
|
|
@@ -29,7 +29,7 @@ MAX_SCOPE_PROJECTS = 16
|
|
|
29
29
|
MAX_RECEIPT_EPISODES = 3
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
class KnowledgeItemRef(
|
|
32
|
+
class KnowledgeItemRef(AgentReaderRef):
|
|
33
33
|
personal_space_id: str = Field(min_length=1, max_length=128)
|
|
34
34
|
item_kind: KnowledgeItemKind
|
|
35
35
|
item_id: str = Field(min_length=1, max_length=256)
|
|
@@ -174,7 +174,7 @@ class KnowledgeItemView(KnowledgeItemSummary):
|
|
|
174
174
|
dependent_count: int = 0
|
|
175
175
|
|
|
176
176
|
|
|
177
|
-
class KnowledgeTurnReceiptRead(
|
|
177
|
+
class KnowledgeTurnReceiptRead(AgentReaderRef):
|
|
178
178
|
personal_space_id: str = Field(min_length=1, max_length=128)
|
|
179
179
|
episode_ids: list[str] = Field(min_length=1, max_length=MAX_RECEIPT_EPISODES)
|
|
180
180
|
|