fuli-context 0.21.0-beta.3 → 0.22.0-beta.2
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 +8 -6
- package/README.zh-CN.md +5 -4
- package/dist/web/assets/{AboutPage-D0dTwKq8.js → AboutPage-BsYF7_sz.js} +1 -1
- package/dist/web/assets/AgentHand-C5aUnyp3.js +1 -0
- package/dist/web/assets/AgentHand-CLQqBbmG.css +1 -0
- package/dist/web/assets/AgentMentionCopy-CTVGHbLe.js +1 -0
- package/dist/web/assets/AgentMentionCopy-Dv5izHzv.css +1 -0
- package/dist/web/assets/{AgentName-n4oqQUwE.js → AgentName-DcR-yXAg.js} +1 -1
- package/dist/web/assets/AgentProfilePage-Cu7q_7eQ.js +1 -0
- package/dist/web/assets/AgentProfilePage-MkP7Lgo6.css +1 -0
- package/dist/web/assets/AgentServicesPage-KPgp3aqp.css +1 -0
- package/dist/web/assets/AgentServicesPage-KuM8Gh2-.js +1 -0
- package/dist/web/assets/AgentsDirectoryPage-9YEOf4nL.js +1 -0
- package/dist/web/assets/AgentsDirectoryPage-ColciWpR.css +1 -0
- package/dist/web/assets/{BackLink-nM3e40IT.js → BackLink-plP8tjp9.js} +1 -1
- package/dist/web/assets/BoardMoveMenu-DC6_givs.js +1 -0
- package/dist/web/assets/CaptureChangePage-BV0LJpm1.js +1 -0
- package/dist/web/assets/CaptureChangePage-CGpkQJJC.css +1 -0
- package/dist/web/assets/{Card-89NKHANE.js → Card-B9fEjzdx.js} +1 -1
- package/dist/web/assets/{CardHeader-9MwjWRxl.js → CardHeader-iTzyVlAg.js} +1 -1
- package/dist/web/assets/{CardTitle-BAhmXjAK.js → CardTitle-Dq4vYfDe.js} +1 -1
- package/dist/web/assets/{ConnectionsPage-Yf4UvjDT.js → ConnectionsPage-CMVrntwM.js} +1 -1
- package/dist/web/assets/{CreateProjectDialog-crpLTyDf.js → CreateProjectDialog-dGfGAGgo.js} +1 -1
- package/dist/web/assets/DataFormatPage-BwjmmNgj.css +1 -0
- package/dist/web/assets/DataFormatPage-DuEma4K0.js +2 -0
- package/dist/web/assets/{DialogFooter-D9A9hRP4.js → DialogFooter-BwqCbMpI.js} +1 -1
- package/dist/web/assets/EmployeeScopeDialog-BoVOcccy.js +1 -0
- package/dist/web/assets/EmployeeScopeDialog-DkqAe9sJ.css +1 -0
- package/dist/web/assets/EmployeeWorkbenchPage-CmNwqk91.css +1 -0
- package/dist/web/assets/EmployeeWorkbenchPage-_h6-ZFHV.js +3 -0
- package/dist/web/assets/{GrowthLoading-Cs9brXcN.js → GrowthLoading-CL1dGObg.js} +1 -1
- package/dist/web/assets/InboxPage-DrgE7gQu.js +4 -0
- package/dist/web/assets/{Input-DGf4juEs.js → Input-14C6kRsv.js} +1 -1
- package/dist/web/assets/{KnowledgeHardDeleteSection-CSnqisUv.js → KnowledgeHardDeleteSection-DYD4BeL_.js} +1 -1
- package/dist/web/assets/KnowledgeItemEditPage-Cja2_OMd.js +1 -0
- package/dist/web/assets/{KnowledgeItemSummaryCard-BRvaf4Fw.js → KnowledgeItemSummaryCard-Bd0Ml6Ia.js} +1 -1
- package/dist/web/assets/KnowledgeOrganizerPage-MT3tMGVx.js +1 -0
- package/dist/web/assets/KnowledgePage-bWItlXy5.js +1 -0
- package/dist/web/assets/KnowledgePeek-Cj9AiG_J.js +1 -0
- package/dist/web/assets/KnowledgePeek-DdxwAWYs.css +1 -0
- package/dist/web/assets/{KnowledgeTurnReceiptPage-Dl0KeFDe.js → KnowledgeTurnReceiptPage-DTZckYql.js} +1 -1
- package/dist/web/assets/KnowledgeWorkspace-BOrKazVl.js +4 -0
- package/dist/web/assets/KnowledgeWorkspace-bhlGz1Mr.css +1 -0
- package/dist/web/assets/{Label-CafdTnDF.js → Label-WCfl_UpK.js} +1 -1
- package/dist/web/assets/ModelSettingsPage-CQZdCaiX.js +1 -0
- package/dist/web/assets/ModelSettingsPage-Ce3DK7EY.css +1 -0
- package/dist/web/assets/{NotFoundPage-TfZ2eoA2.js → NotFoundPage--X4xZoMR.js} +1 -1
- package/dist/web/assets/OccupationsPage-BvCTm4r1.css +1 -0
- package/dist/web/assets/OccupationsPage-DKuRfjeQ.js +1 -0
- package/dist/web/assets/OverviewPage-B2sbgaT-.js +2 -0
- package/dist/web/assets/OverviewPage-C2ao6sX6.css +1 -0
- package/dist/web/assets/PersonalProfilePage-DgveAPjq.js +1 -0
- package/dist/web/assets/{PersonalProfilePage-CGW50MHm.css → PersonalProfilePage-KJvkIuAm.css} +1 -1
- package/dist/web/assets/{PersonalProjectsPage-CXBOwEqC.js → PersonalProjectsPage-DJ1VBf1r.js} +1 -1
- package/dist/web/assets/PopperContent-DgnpW6vB.js +1 -0
- package/dist/web/assets/{Presence-BLar6FCs.js → Presence-Bn4pKveC.js} +1 -1
- package/dist/web/assets/ProjectAgentDetailPage-BSBpu2sZ.css +1 -0
- package/dist/web/assets/ProjectAgentDetailPage-CH57mPoo.js +8 -0
- package/dist/web/assets/{ProjectAgentDialog-Bg0V3Zr2.js → ProjectAgentDialog-3Abm-9sL.js} +1 -1
- package/dist/web/assets/ProjectAgentFirstTask-CLQFOwXi.js +1 -0
- package/dist/web/assets/ProjectAgentsPage-Cj0PTJAE.js +1 -0
- package/dist/web/assets/ProjectAgentsPage-DvJh40Xl.css +1 -0
- package/dist/web/assets/ProjectJudgmentPolicy-9BP_2AkI.js +1 -0
- package/dist/web/assets/ProjectJudgmentPolicy-BnYrRs9X.css +1 -0
- package/dist/web/assets/{ProjectScopePicker-ClDUoUHW.js → ProjectScopePicker-CyZZQW4d.js} +1 -1
- package/dist/web/assets/{PublicProjectsPage-C63vW9UZ.js → PublicProjectsPage-Te3uZA-M.js} +1 -1
- package/dist/web/assets/RadioGroupItem-CZvh557X.js +1 -0
- package/dist/web/assets/RoundtablesPage-CxjA1cGF.css +1 -0
- package/dist/web/assets/RoundtablesPage-D0LICyzx.js +1 -0
- package/dist/web/assets/RovingFocusGroup-CKuSV66n.js +1 -0
- package/dist/web/assets/{RovingFocusItem-DAumq9xD.js → RovingFocusItem-D6DzRzcZ.js} +1 -1
- package/dist/web/assets/{SessionMigrationPage-B5r2PWCF.js → SessionMigrationPage-CEP1Mr9n.js} +1 -1
- package/dist/web/assets/{SessionRecordsPage-DIc2GoCQ.js → SessionRecordsPage-DthAYkM5.js} +1 -1
- package/dist/web/assets/SettingsPage-BtJ3O9ZH.js +1 -0
- package/dist/web/assets/SettingsPage-DQMUQGfr.css +1 -0
- package/dist/web/assets/{SharedJefaReportPage-B54qEdIV.js → SharedJefaReportPage-2VMoiCJj.js} +1 -1
- package/dist/web/assets/TableHeader-D7hfNBTs.js +1 -0
- package/dist/web/assets/{TabsContent-DZQE2Iq8.js → TabsContent-vZY5Gjt-.js} +1 -1
- package/dist/web/assets/TabsTrigger-Dhi51wTn.js +1 -0
- package/dist/web/assets/TagVocabularyPage-CLe5HBs6.js +1 -0
- package/dist/web/assets/TaskBlockerNotice-CIVFwBgZ.css +1 -0
- package/dist/web/assets/TaskBlockerNotice-DgJBUFNl.js +1 -0
- package/dist/web/assets/TaskExecutionPlan-BeP4gm5O.js +2 -0
- package/dist/web/assets/TaskExecutionPlan-uimNYWdr.css +1 -0
- package/dist/web/assets/Teleport-ByKM5w1b.js +1 -0
- package/dist/web/assets/{TextField-DoKtn--E.js → TextField-CKNwSQVb.js} +1 -1
- package/dist/web/assets/Textarea-Ca7nOquD.js +1 -0
- package/dist/web/assets/{UiDialog-7pnZ-eQA.js → UiDialog-BAd1JUvO.js} +1 -1
- package/dist/web/assets/{UiDisclosure-COV4NwHI.js → UiDisclosure-DVZdIuCs.js} +1 -1
- package/dist/web/assets/UiIcon-DOwSNz_e.js +1 -0
- package/dist/web/assets/{UiIconButton-CkBP6pnX.js → UiIconButton-W1WfC7dt.js} +1 -1
- package/dist/web/assets/{UiSegmented-FwOnE2IZ.js → UiSegmented-Csh7hHda.js} +1 -1
- package/dist/web/assets/{UiSelect-BIhr03Gk.js → UiSelect-Db8o-PRU.js} +1 -1
- package/dist/web/assets/{UiToggle-bpyawyIe.js → UiToggle-DMuBZLY-.js} +1 -1
- package/dist/web/assets/{UiWeight-TyBehy3K.js → UiWeight-CfhzKts0.js} +1 -1
- package/dist/web/assets/{UnassignedConversationsPanel-B4PqImRi.js → UnassignedConversationsPanel-DWUCNfR_.js} +1 -1
- package/dist/web/assets/{VirtualDirectoryList-DNQP6X8j.js → VirtualDirectoryList-BpYcDx5H.js} +1 -1
- package/dist/web/assets/VisuallyHiddenInput-BEz-QHu_.js +1 -0
- package/dist/web/assets/{Workbench3D-DNwgymIE.js → Workbench3D-DZZDfj10.js} +1 -1
- package/dist/web/assets/_plugin-vue_export-helper-C98j5XpL.js +10 -0
- package/dist/web/assets/accordion-BqNFYBeR.js +1 -0
- package/dist/web/assets/agent-avatar-CBfHZX_0.js +1 -0
- package/dist/web/assets/{agent-pins-Bb7-1Uoz.js → agent-pins-O8E8apGs.js} +1 -1
- package/dist/web/assets/agent-profile-DSeJwkEw.css +1 -0
- package/dist/web/assets/{agent-profile.css_vue_type_style_index_0_src_true_lang-wT8gjVyZ.js → agent-profile.css_vue_type_style_index_0_src_true_lang-cZYEJ_8z.js} +1 -1
- package/dist/web/assets/agent-roster-records-D13CvTqR.js +1 -0
- package/dist/web/assets/{agent-work-summary-D0a836ik.js → agent-work-summary-BM2HS3g8.js} +1 -1
- package/dist/web/assets/attach-closest-edge-u1fTT6hT.js +5 -0
- package/dist/web/assets/{attention-store-g2-_vAhV.js → attention-store-Dexy6ybk.js} +1 -1
- package/dist/web/assets/{badge-BIoC0hjn.js → badge-DvKUKtfP.js} +1 -1
- package/dist/web/assets/{button-A2esxd6G.js → button-C1iW0ZW7.js} +1 -1
- package/dist/web/assets/checkbox-BIMU57_g.js +1 -0
- package/dist/web/assets/{client-DAoXcTUz.js → client-CrxcG5dV.js} +1 -1
- package/dist/web/assets/client-links-store-CrSwWuAU.js +1 -0
- package/dist/web/assets/{console-DiNe1hFP.js → console-DQ5fV3T8.js} +1 -1
- package/dist/web/assets/conversation-launcher-settings-Bd222WX0.js +1 -0
- package/dist/web/assets/{design-lab-UWXx2ZtA.js → design-lab-B9QfdWfU.js} +1 -1
- package/dist/web/assets/dialog-DFkjUY8h.js +1 -0
- package/dist/web/assets/dist-Cox3qxin.js +1 -0
- package/dist/web/assets/dropdown-menu-BF3zRtMG.js +1 -0
- package/dist/web/assets/{field-6mg5DSC8.js → field-CG5pHJks.js} +1 -1
- package/dist/web/assets/{identity-FG3YqHVj.js → identity-GQWezGWB.js} +1 -1
- package/dist/web/assets/index-Di5_eD7U.js +2 -0
- package/dist/web/assets/index-Dktlia0_.css +1 -0
- package/dist/web/assets/judgment-api-BzpDqFDw.js +1 -0
- package/dist/web/assets/{model-CtmCtjml.js → model-0znFleoY.js} +1 -1
- package/dist/web/assets/{model-CYJ_LZ47.js → model-BeQStl_a.js} +1 -1
- package/dist/web/assets/{model-BcMr6R8m.js → model-CYXGfox9.js} +1 -1
- package/dist/web/assets/{model-BCnsjEuP.js → model-DRuw3_ym.js} +1 -1
- package/dist/web/assets/model-LTc6Nj3z.js +1 -0
- package/dist/web/assets/{model-CeF2BATq.js → model-T6Jor9oL.js} +1 -1
- package/dist/web/assets/{motion-preference-DeZURhN7.js → motion-preference-CHiRbvgR.js} +1 -1
- package/dist/web/assets/{occupation-catalog-q0ZjGx2o.js → occupation-catalog-Caq13-kY.js} +1 -1
- package/dist/web/assets/orchestration-filters-DSnybvV3.js +1 -0
- package/dist/web/assets/{page-title-BLHrexaP.js → page-title-BflOskhA.js} +1 -1
- package/dist/web/assets/profile-model-CVx0a_P4.js +1 -0
- package/dist/web/assets/project-board-layout-DmQActFu.js +1 -0
- package/dist/web/assets/{project-capture-BvIPecIS.js → project-capture-H4qMdM1l.js} +1 -1
- package/dist/web/assets/{project-origin-JnGPwlfA.js → project-origin-DMR9fKUE.js} +1 -1
- package/dist/web/assets/project-team-api-CBnMg8k5.js +1 -0
- package/dist/web/assets/{quick-edit-api-DzpRAPsr.js → quick-edit-api-CCaH3tbK.js} +1 -1
- package/dist/web/assets/select-C369n9Ru.js +1 -0
- package/dist/web/assets/shared-report-CjLAmGZI.css +1 -0
- package/dist/web/assets/shared-report-DO2Khr8D.js +3 -0
- package/dist/web/assets/source-coverage-B8gNeptJ.js +1 -0
- package/dist/web/assets/{task-board-model-BohbBuwF.js → task-board-model-DSr4P56O.js} +1 -1
- package/dist/web/assets/task-evidence-M32pNYH0.js +1 -0
- package/dist/web/assets/task-labels-BRZad3HE.js +1 -0
- package/dist/web/assets/{ui-CE38wkv4.css → ui-CRfyX0ED.css} +1 -1
- package/dist/web/assets/{ui-CtW0tAA1.js → ui-DieLnn9C.js} +1 -1
- package/dist/web/assets/{useAgentRecords-BoOqLQcf.js → useAgentRecords-3-zWyxUu.js} +1 -1
- package/dist/web/assets/{useApi-CROJJdhE-CH5wlWTU.js → useApi-CROJJdhE-Cm-N4N7-.js} +1 -1
- package/dist/web/assets/useDirection-BGtNSPCf.js +1 -0
- package/dist/web/assets/{useFocusReturn-DX2zmPSK.js → useFocusReturn-Dq-yqBLj.js} +1 -1
- package/dist/web/assets/{useKnowledgeItemPeek-Cfvr5H1q.js → useKnowledgeItemPeek-BWbdLqAL.js} +1 -1
- package/dist/web/assets/{useMinimumLoadingDisplay-GhG1ICNJ.js → useMinimumLoadingDisplay-BEUl4UAV.js} +1 -1
- package/dist/web/assets/{useRoutePeek-DydCbUhy.js → useRoutePeek-C_9DVOKT.js} +1 -1
- package/dist/web/assets/useTypeahead-CP74zC2e.js +1 -0
- package/dist/web/assets/utils-DDDNAHy1.js +1 -0
- package/dist/web/assets/{vue-router-Dad-4p7O.js → vue-router-rg-hudCL.js} +1 -1
- package/dist/web/index.html +40 -37
- package/docs/agent-apps.md +6 -2
- package/docs/agent-conversations-and-collaboration.md +125 -0
- package/docs/agent-interface-architecture.md +9 -0
- package/docs/agent-roundtable.md +92 -3
- package/docs/client-connections.md +8 -4
- package/docs/client-links.md +101 -0
- package/docs/employee-agents.md +56 -7
- package/docs/judgment-and-autonomy.md +2 -2
- package/graph-provider/fuli_graph/app.py +21 -0
- package/graph-provider/fuli_graph/client_coverage.py +19 -0
- package/graph-provider/fuli_graph/graph_field_contract.py +6 -0
- package/graph-provider/fuli_graph/graph_format_builtin_occupations.py +80 -0
- package/graph-provider/fuli_graph/graph_format_migrations.py +15 -0
- package/graph-provider/fuli_graph/graph_format_schema.py +7 -0
- package/graph-provider/fuli_graph/graph_projection.py +10 -2
- package/graph-provider/fuli_graph/models.py +1 -1
- package/graph-provider/fuli_graph/occupation_catalog.py +6 -3
- package/graph-provider/fuli_graph/personal_project_hierarchy.py +265 -0
- package/graph-provider/fuli_graph/project_action_models.py +14 -0
- package/graph-provider/fuli_graph/project_agent_attention_models.py +5 -1
- package/graph-provider/fuli_graph/project_agent_attention_routes.py +6 -2
- package/graph-provider/fuli_graph/project_agent_delegations.py +80 -16
- package/graph-provider/fuli_graph/project_agent_hierarchy.py +28 -2
- package/graph-provider/fuli_graph/project_agent_memory_routes.py +6 -1
- package/graph-provider/fuli_graph/project_agent_models.py +4 -0
- package/graph-provider/fuli_graph/project_agent_names.py +61 -1
- package/graph-provider/fuli_graph/project_agent_routes.py +16 -21
- package/graph-provider/fuli_graph/project_agent_task_models.py +35 -6
- package/graph-provider/fuli_graph/project_agent_worker_access.py +3 -2
- package/graph-provider/fuli_graph/project_knowledge.py +18 -8
- package/graph-provider/fuli_graph/store_agent_conversations.py +2 -1
- package/graph-provider/fuli_graph/store_agent_loans.py +4 -3
- package/graph-provider/fuli_graph/store_agent_verification.py +2 -1
- package/graph-provider/fuli_graph/store_occupation_catalog.py +7 -6
- package/graph-provider/fuli_graph/store_project_agent_attention.py +26 -5
- package/graph-provider/fuli_graph/store_project_agent_executors.py +2 -1
- package/graph-provider/fuli_graph/store_project_agent_memory.py +2 -1
- package/graph-provider/fuli_graph/store_project_agent_naming.py +71 -0
- package/graph-provider/fuli_graph/store_project_agent_occupation.py +3 -2
- package/graph-provider/fuli_graph/store_project_agent_task_activity.py +67 -12
- package/graph-provider/fuli_graph/store_project_agent_task_blockers.py +130 -0
- package/graph-provider/fuli_graph/store_project_agent_task_reads.py +44 -27
- package/graph-provider/fuli_graph/store_project_agent_task_staffing.py +2 -1
- package/graph-provider/fuli_graph/store_project_agent_tasks.py +17 -20
- package/graph-provider/fuli_graph/store_project_agents.py +6 -5
- package/graph-provider/fuli_graph/store_task_contexts.py +3 -2
- package/graph-provider/fuli_graph/system_agents.py +2 -1
- package/graph-provider/fuli_graph/task_blocker.py +48 -0
- package/graph-provider/fuli_graph/task_context_adoption.py +2 -1
- package/graph-provider/fuli_graph/task_context_auto_close.py +1 -1
- package/graph-provider/fuli_graph/task_context_coordination.py +2 -1
- package/graph-provider/fuli_graph/task_context_temporary_owner.py +2 -1
- package/graph-provider/fuli_graph/task_worker_attribution.py +66 -7
- package/graph-provider/fuli_graph/workflow_observation_models.py +1 -1
- package/graph-provider/pyproject.toml +1 -1
- package/native/win32/fuli-win-helper.exe +0 -0
- package/npm-shrinkwrap.json +3 -2
- package/package.json +4 -1
- package/packages/roundtable/src/agents/claude-code/wake.js +10 -1
- package/packages/roundtable/src/host.js +4 -0
- package/packages/roundtable/src/roundtable/chat-service.js +7 -2
- package/packages/roundtable/src/roundtable/chat.js +4 -0
- package/packages/roundtable/src/roundtable/group-discussion-store.js +110 -0
- package/packages/roundtable/src/roundtable/group-discussion.js +576 -0
- package/packages/roundtable/src/roundtable/person-conversation.js +149 -0
- package/packages/roundtable/src/roundtable/service.js +76 -34
- package/packages/roundtable/src/roundtable/store.js +12 -0
- package/packages/roundtable/src/roundtable/thread-subscriptions.js +31 -0
- package/packages/roundtable/src/roundtable/wake.js +4 -4
- package/packages/roundtable/src/storage/database-migration.js +1 -1
- package/registry/client-links.json +80 -0
- package/skills/capturing-session-knowledge/SKILL.md +7 -0
- package/skills/capturing-session-knowledge/references/coordination.md +15 -0
- package/skills/operating-fuli/SKILL.md +12 -2
- package/skills/operating-fuli/references/workflow-recipes.md +3 -0
- package/src/agent-apps/host-tools/catalog.js +2 -1
- package/src/agent-apps/instances.js +22 -1
- package/src/agent-apps/service.js +4 -2
- package/src/agent-apps/trusted-runner.js +18 -5
- package/src/agent-roundtable/http.js +30 -1
- package/src/agent-roundtable/tools.js +11 -0
- package/src/agent-services/address.js +35 -0
- package/src/agent-services/agent-report.js +22 -0
- package/src/agent-services/output-tail.js +29 -0
- package/src/agent-services/port.js +266 -0
- package/src/agent-services/process-identity.js +134 -0
- package/src/agent-services/store.js +123 -0
- package/src/agent-tools/agent-service-definitions.js +23 -0
- package/src/agent-tools/graph-definitions.js +2 -2
- package/src/agent-tools/graph-handlers.js +2 -1
- package/src/agent-tools/graph-tool-fields.js +2 -1
- package/src/agent-tools/interface-catalog.js +19 -8
- package/src/agent-tools/interface-definitions.js +6 -2
- package/src/agent-tools/judgment-definitions.js +1 -1
- package/src/agent-tools/project-agent-definitions.js +11 -6
- package/src/agents/opencode/lifecycle-hook.js +164 -0
- package/src/agents/opencode/plugin-file.js +30 -0
- package/src/agents/opencode/plugin.js +311 -0
- package/src/agents/source-applications.js +19 -0
- package/src/app/application-error.js +16 -2
- package/src/cli/clients-command.js +3 -1
- package/src/cli/command-registry.js +1 -1
- package/src/cli/connect-command.js +1 -1
- package/src/cli/mcp-command.js +1 -1
- package/src/client-links/manifest.js +149 -0
- package/src/client-links/registry.js +128 -0
- package/src/conversations/human-interaction.js +11 -4
- package/src/data-format/console-restore-worker.js +8 -0
- package/src/data-format/console-restore.js +81 -0
- package/src/data-format/format-notices.js +20 -0
- package/src/data-format/format-retention.js +10 -5
- package/src/data-format/local-stores.js +10 -3
- package/src/data-format/maintenance-lock.js +1 -1
- package/src/data-format/migration-operations.js +8 -2
- package/src/desktop/windows-command-options.js +9 -1
- package/src/desktop/windows-installation-switch.js +8 -3
- package/src/desktop/windows-installation.js +4 -1
- package/src/desktop/windows-rollback.js +2 -2
- package/src/desktop/windows-running-fuli.js +119 -0
- package/src/desktop/windows-tray-release.js +84 -0
- package/src/desktop/windows-tray-update.js +69 -0
- package/src/desktop/windows-update-command.js +30 -15
- package/src/desktop/windows-update-lock.js +32 -8
- package/src/desktop/windows-update.js +2 -2
- package/src/employees/builtin/jefa/board-store.js +372 -0
- package/src/employees/builtin/jefa/http.js +84 -0
- package/src/employees/builtin/jefa/project-board.js +82 -0
- package/src/employees/builtin/jefa/runtime.js +20 -0
- package/src/employees/builtin/jefa/session-titles.js +76 -0
- package/src/employees/builtin/jefa/tools.js +104 -0
- package/src/employees/package-registry.js +15 -5
- package/src/employees/recruitment.js +7 -4
- package/src/employees/service.js +20 -0
- package/src/external-knowledge/connectors/notion.js +2 -2
- package/src/external-knowledge/connectors/retrieval-api.js +2 -2
- package/src/external-knowledge/document-mapping.js +4 -4
- package/src/graphiti/agent-attention.js +4 -1
- package/src/graphiti/agent-availability.js +10 -0
- package/src/graphiti/agent-collaboration.js +7 -4
- package/src/graphiti/assistant-identity.js +2 -0
- package/src/graphiti/capture-change-confirmation.js +18 -9
- package/src/graphiti/capture-decision.js +4 -2
- package/src/graphiti/capture-policy.js +26 -8
- package/src/graphiti/collaboration-preference-entry.js +4 -2
- package/src/graphiti/conversation-triage.js +1 -1
- package/src/graphiti/federated-application.js +0 -6
- package/src/graphiti/fla-mention.js +134 -0
- package/src/graphiti/fla-picker.js +185 -0
- package/src/graphiti/group-member-context.js +80 -0
- package/src/graphiti/group-member-recommendation.js +53 -0
- package/src/graphiti/local-runtimes.js +10 -8
- package/src/graphiti/project-agent-control-plane.js +0 -6
- package/src/graphiti/project-agent-mapping.js +23 -0
- package/src/graphiti/project-agent-memory.js +2 -1
- package/src/graphiti/project-agent-mention.js +9 -7
- package/src/graphiti/project-agent-task-entry.js +13 -13
- package/src/graphiti/project-agent-workflows.js +21 -8
- package/src/graphiti/provider-client.js +6 -6
- package/src/graphiti/roundtable-host.js +5 -0
- package/src/graphiti/task-agent-assignment.js +27 -0
- package/src/graphiti/task-blocker-progress.js +25 -0
- package/src/graphiti/task-context-entry.js +9 -5
- package/src/graphiti/task-entry-group-discussion.js +350 -0
- package/src/graphiti/task-entry-named-fla.js +326 -0
- package/src/graphiti/task-entry-preferences.js +38 -6
- package/src/graphiti/task-entry-project-scope.js +51 -22
- package/src/graphiti/task-entry-standing-owner.js +18 -13
- package/src/graphiti/task-knowledge-checkpoint.js +6 -1
- package/src/graphiti/task-knowledge-recall.js +69 -35
- package/src/graphiti/worker-task-context.js +2 -1
- package/src/http/agent-services-api-router.js +38 -0
- package/src/http/api-router.js +26 -2
- package/src/http/client-links-api-router.js +23 -0
- package/src/http/data-format-api-router.js +50 -13
- package/src/http/graph-api-router.js +0 -10
- package/src/http/project-hierarchy-api-router.js +36 -0
- package/src/judgment/acceptance.js +2 -1
- package/src/judgment/engine.js +2 -1
- package/src/judgment/http.js +12 -3
- package/src/judgment/routing.js +3 -2
- package/src/judgment/service.js +42 -8
- package/src/judgment/store.js +39 -5
- package/src/knowledge-hard-delete/console-port.js +1 -1
- package/src/knowledge-hard-delete/reconcile-local.js +2 -6
- package/src/knowledge-hard-delete/recovery-check.js +35 -0
- package/src/knowledge-hard-delete/recovery-gate.js +4 -2
- package/src/knowledge-owner-reads/owner-proof.js +2 -2
- package/src/local-runtime/lifecycle.js +6 -2
- package/src/local-runtime/windows-process-handle.js +13 -1
- package/src/mcp/session-id.js +4 -3
- package/src/mcp/tool-annotations.js +3 -3
- package/src/model-backends/http.js +3 -3
- package/src/model-backends/keys-http.js +46 -0
- package/src/model-backends/port.js +4 -3
- package/src/model-backends/secret-store.js +6 -1
- package/src/presence/windows-helper-pin.js +1 -1
- package/src/project-hierarchy/console-port.js +19 -0
- package/src/server.js +45 -9
- package/src/setup/agents/config-preview.js +3 -1
- package/src/setup/agents/config-writers.js +6 -2
- package/src/setup/agents/descriptor-adapter.js +7 -2
- package/src/setup/agents/descriptor-adapter.test.js +7 -3
- package/src/setup/agents/descriptor-packs.js +1 -1
- package/src/setup/agents/descriptor-packs.test.js +5 -4
- package/src/setup/agents/descriptor-schema.js +11 -3
- package/src/setup/agents/json-mcp.js +17 -9
- package/src/setup/agents/opencode/adapter.test.js +156 -22
- package/src/setup/agents/opencode/config-writer.js +107 -0
- package/src/setup/agents/opencode/descriptor.json +79 -0
- package/src/setup/agents/registry.js +1 -2
- package/src/setup/agents.js +27 -2
- package/src/setup/graph-runtime.js +10 -2
- package/src/setup/paths.js +1 -0
- package/src/standing-assignments/term-match.js +7 -2
- package/src/storage/json-format-migration.js +1 -1
- package/src/storage/json-format.js +1 -1
- package/src/system/console-update-worker.js +8 -0
- package/src/system/console-update.js +80 -0
- package/src/system/detached-job.js +59 -0
- package/src/system/settings-guide.js +2 -1
- package/src/system/system-service.js +9 -1
- package/src/validation/values.js +12 -4
- package/dist/web/assets/AgentProfilePage-DH54S93r.js +0 -1
- package/dist/web/assets/AgentProfilePage-DXvLQu-C.css +0 -1
- package/dist/web/assets/AgentsDirectoryPage-BwF-0nFO.css +0 -1
- package/dist/web/assets/AgentsDirectoryPage-xwIRrNb8.js +0 -1
- package/dist/web/assets/BoardMoveMenu-Cxgkbwkl.js +0 -1
- package/dist/web/assets/CaptureChangePage-Cch3mT4b.css +0 -1
- package/dist/web/assets/CaptureChangePage-DWdz9dEk.js +0 -1
- package/dist/web/assets/DataFormatPage-BPuUH0PG.js +0 -1
- package/dist/web/assets/DataFormatPage-Dp7mePUw.css +0 -1
- package/dist/web/assets/EmployeeRecruitDialog-C6ADVxkQ.css +0 -1
- package/dist/web/assets/EmployeeRecruitDialog-DeB0XHeM.js +0 -1
- package/dist/web/assets/EmployeeWorkbenchPage-0oK2RfIh.js +0 -3
- package/dist/web/assets/EmployeeWorkbenchPage-CMutwFBC.css +0 -1
- package/dist/web/assets/InboxPage-CTQ425Ez.js +0 -4
- package/dist/web/assets/KnowledgeEditDialog-Ccgj30Wu.js +0 -1
- package/dist/web/assets/KnowledgeEditDialog-D0se__D4.css +0 -1
- package/dist/web/assets/KnowledgeItemEditPage-C0Y2DsHz.js +0 -1
- package/dist/web/assets/KnowledgeOrganizerPage-CRC3mk0j.js +0 -1
- package/dist/web/assets/KnowledgePage-NsKFUWth.js +0 -1
- package/dist/web/assets/KnowledgePeek-Bc0bqyZp.js +0 -1
- package/dist/web/assets/KnowledgePeek-DEo6IbBP.css +0 -1
- package/dist/web/assets/KnowledgeWorkspace-BGlODG7G.js +0 -4
- package/dist/web/assets/KnowledgeWorkspace-C6l_yvWO.css +0 -1
- package/dist/web/assets/ModelSettingsPage-Bz1tMXtW.js +0 -1
- package/dist/web/assets/ModelSettingsPage-DJuEaw6p.css +0 -1
- package/dist/web/assets/OccupationsPage-BTormZIO.css +0 -1
- package/dist/web/assets/OccupationsPage-CnSp6362.js +0 -1
- package/dist/web/assets/OverviewPage-D5W-DhOz.js +0 -2
- package/dist/web/assets/OverviewPage-YBQHyU7s.css +0 -1
- package/dist/web/assets/PersonalProfilePage-CndOcRQ6.js +0 -1
- package/dist/web/assets/PopperContent-BXbztFFi.js +0 -1
- package/dist/web/assets/ProjectAgentDetailPage-CRFE6n-s.css +0 -1
- package/dist/web/assets/ProjectAgentDetailPage-SmZ2NYTw.js +0 -8
- package/dist/web/assets/ProjectAgentFirstTask-CbOWaP7Q.js +0 -1
- package/dist/web/assets/ProjectAgentsPage-BBzKAhZx.css +0 -1
- package/dist/web/assets/ProjectAgentsPage-Y6qCYRZj.js +0 -1
- package/dist/web/assets/RadioGroupItem-tL_2upmD.js +0 -1
- package/dist/web/assets/RoundtablesPage-2Akxagrm.js +0 -1
- package/dist/web/assets/RoundtablesPage-BMYSDYH8.css +0 -1
- package/dist/web/assets/RovingFocusGroup-D5mf9s6I.js +0 -1
- package/dist/web/assets/SettingsPage-BAxKpnBx.js +0 -1
- package/dist/web/assets/SettingsPage-BbX9ysTX.css +0 -1
- package/dist/web/assets/TabsTrigger-CHnq6mkI.js +0 -1
- package/dist/web/assets/TagVocabularyPage-BIsHYk2i.js +0 -1
- package/dist/web/assets/TaskExecutionPlan-C9kJJJKk.css +0 -1
- package/dist/web/assets/TaskExecutionPlan-IYG_JeuT.js +0 -2
- package/dist/web/assets/TaskSchedulesPage-Cxjqc8XQ.js +0 -1
- package/dist/web/assets/TaskSchedulesPage-DcmDdY10.css +0 -1
- package/dist/web/assets/Teleport-BKN3dSMk.js +0 -1
- package/dist/web/assets/UiIcon-BADOYtHM.js +0 -1
- package/dist/web/assets/WritingTastePage-D-ELo7mh.js +0 -1
- package/dist/web/assets/WritingTastePage-asIa-2U5.css +0 -1
- package/dist/web/assets/_plugin-vue_export-helper-RegzAV-H.js +0 -10
- package/dist/web/assets/accordion-DpqAdXTB.js +0 -1
- package/dist/web/assets/agent-occupation-Ba5Fl0ys.js +0 -1
- package/dist/web/assets/agent-profile-LzhgJINr.css +0 -1
- package/dist/web/assets/avatars-CUyfvsKO.js +0 -1
- package/dist/web/assets/checkbox-DxBVlC6t.js +0 -1
- package/dist/web/assets/conversation-launcher-settings-CtOlr9uP.js +0 -1
- package/dist/web/assets/dialog-DTVE8tN1.js +0 -1
- package/dist/web/assets/dist-D-8b3yGa.js +0 -1
- package/dist/web/assets/dropdown-menu-NcUrhhmG.js +0 -1
- package/dist/web/assets/index-CsXqY09Q.js +0 -2
- package/dist/web/assets/index-DedvhyS3.css +0 -1
- package/dist/web/assets/judgment-types-rLsl2Cis.js +0 -1
- package/dist/web/assets/model-t2ZvD7wL.js +0 -1
- package/dist/web/assets/orchestration-filters-CKf_Gzdl.js +0 -1
- package/dist/web/assets/personal-profile-graph-IYovB9sV.js +0 -1
- package/dist/web/assets/profile-model-kCmPHrmk.js +0 -1
- package/dist/web/assets/project-team-api-Cfn41MCR.js +0 -1
- package/dist/web/assets/shared-report-BLmBg2FG.js +0 -7
- package/dist/web/assets/shared-report-eUYPCJTS.css +0 -1
- package/dist/web/assets/task-evidence-i9SDhd3E.js +0 -1
- package/dist/web/assets/task-labels-BArOYZEW.js +0 -1
- package/src/agent-tools/task-schedule-definitions.js +0 -15
- package/src/graphiti/writing-taste-profile-workflow.js +0 -84
- package/src/graphiti/writing-taste-profile.js +0 -510
- package/src/http/task-schedules-api-router.js +0 -31
- package/src/setup/agents/opencode/index.js +0 -19
- package/src/task-schedules/dispatch.js +0 -104
- package/src/task-schedules/scheduler.js +0 -34
- package/src/task-schedules/service.js +0 -167
- package/src/task-schedules/store.js +0 -165
package/src/judgment/store.js
CHANGED
|
@@ -7,6 +7,19 @@ import { assertKnowledgeRecovery } from '../knowledge-hard-delete/recovery-gate.
|
|
|
7
7
|
|
|
8
8
|
export const DEFAULT_PINS = Object.freeze(['employee.bole', 'employee.jefa', 'employee.tonborg']);
|
|
9
9
|
export const DEFAULT_POLICY = Object.freeze({ mode: 'manual', quality: 'quality', client: 'codex' });
|
|
10
|
+
// A record's latest execution status and receipt, as get() reports them.
|
|
11
|
+
const LATEST_EXECUTION = 'FROM judgment_execution e WHERE e.decision = r.id ORDER BY e.id DESC LIMIT 1';
|
|
12
|
+
const LATEST_STATUS = `COALESCE((SELECT e.status ${LATEST_EXECUTION}), 'not_applied')`;
|
|
13
|
+
// What the console's 需要人工 / Human needed view lists; the web's
|
|
14
|
+
// isHumanNeeded (judgment-types.ts) applies the same rule to a loaded record.
|
|
15
|
+
const HUMAN_NEEDED = `(json_extract(r.body,'$.outcome') IN ('escalate','failed') OR ${LATEST_STATUS} IN ('stale','failed')
|
|
16
|
+
OR (${LATEST_STATUS} = 'not_applied' AND json_extract(r.body,'$.policy.mode') = 'manual'))`;
|
|
17
|
+
// The words a person searches records by: title, objective, conclusion,
|
|
18
|
+
// evidence, source, project id, and the latest feedback and receipt reasons.
|
|
19
|
+
const SEARCHED_TEXT = ["json_extract(r.body,'$.title')", "json_extract(r.body,'$.objective')", "json_extract(r.body,'$.summary')",
|
|
20
|
+
"json_extract(r.body,'$.evidence')", "json_extract(r.body,'$.client')", "json_extract(r.body,'$.model')", 'r.project',
|
|
21
|
+
'(SELECT f.reason FROM judgment_feedback f WHERE f.decision = r.id ORDER BY f.revision DESC LIMIT 1)',
|
|
22
|
+
`json_extract((SELECT e.receipt ${LATEST_EXECUTION}), '$.reason')`];
|
|
10
23
|
const conflict = () => new EmployeeError('This record changed. Reload and try again.', 409, 'judgment_conflict');
|
|
11
24
|
export const JUDGMENT_FORMAT = sqliteFormat({
|
|
12
25
|
store: 'judgment',
|
|
@@ -71,6 +84,12 @@ export class JudgmentStore {
|
|
|
71
84
|
return { ...(own.value ?? global.value ?? DEFAULT_POLICY), revision: own.revision,
|
|
72
85
|
globalRevision: global.revision, inherited: Boolean(project && !own.value), personalProjectId: project || null };
|
|
73
86
|
}
|
|
87
|
+
// Every project's own policy, as policy() reports it; a removed override is not one.
|
|
88
|
+
policyOverrides(space) {
|
|
89
|
+
this.#assertRecovery(space);
|
|
90
|
+
return this.db.prepare(`SELECT substr(key, ${'policy:'.length + 1}) AS project FROM judgment_settings
|
|
91
|
+
WHERE space=? AND key LIKE 'policy:_%' AND value <> 'null' ORDER BY key`).all(space).map(({ project }) => this.policy(space, project));
|
|
92
|
+
}
|
|
74
93
|
setPolicy(space, project, value, expectedRevision) {
|
|
75
94
|
this.writeSetting(space, `policy:${project}`, value, expectedRevision);
|
|
76
95
|
return this.policy(space, project);
|
|
@@ -100,12 +119,27 @@ export class JudgmentStore {
|
|
|
100
119
|
feedback: feedbackHistory.at(-1) ?? { revision: 0, vote: null, reason: '' },
|
|
101
120
|
execution: executionHistory.at(-1) ?? { status: 'not_applied' } };
|
|
102
121
|
}
|
|
103
|
-
records
|
|
122
|
+
// One page of records, newest first. after: the id of the previous page's
|
|
123
|
+
// last record (records are never deleted, so it stays a stable cursor).
|
|
124
|
+
// search: { text, projectIds } keeps records whose words, source, latest
|
|
125
|
+
// feedback or receipt reason contain the text, or whose project is one of
|
|
126
|
+
// projectIds. humanNeeded: only records that wait for the person.
|
|
127
|
+
records(space, { personalProjectId, limit = 50, after = null, search = null, humanNeeded = false } = {}) {
|
|
104
128
|
this.#assertRecovery(space);
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
129
|
+
const where = ['r.space = ?'];
|
|
130
|
+
const params = [space];
|
|
131
|
+
if (personalProjectId !== undefined) { where.push('r.project = ?'); params.push(personalProjectId ?? ''); }
|
|
132
|
+
if (after) { where.push('r.rowid < (SELECT rowid FROM judgment_records WHERE space = ? AND id = ?)'); params.push(space, after); }
|
|
133
|
+
if (humanNeeded) where.push(HUMAN_NEEDED);
|
|
134
|
+
if (search) {
|
|
135
|
+
const pattern = `%${search.text.replace(/[\\%_]/g, '\\$&')}%`;
|
|
136
|
+
const matches = SEARCHED_TEXT.map(field => `${field} LIKE ? ESCAPE '\\'`);
|
|
137
|
+
if (search.projectIds.length) matches.push(`r.project IN (${search.projectIds.map(() => '?').join(',')})`);
|
|
138
|
+
where.push(`(${matches.join(' OR ')})`);
|
|
139
|
+
params.push(...SEARCHED_TEXT.map(() => pattern), ...search.projectIds);
|
|
140
|
+
}
|
|
141
|
+
return this.db.prepare(`SELECT r.id FROM judgment_records r WHERE ${where.join(' AND ')} ORDER BY r.rowid DESC LIMIT ?`)
|
|
142
|
+
.all(...params, limit).map(({ id }) => this.get(space, id));
|
|
109
143
|
}
|
|
110
144
|
// Knowledge review verdicts the host left to the person (ai_suggested,
|
|
111
145
|
// rec#10 D-24, D-36), newest first, in every project of the space.
|
|
@@ -34,7 +34,7 @@ const ABORT_AFTER_MS = 2 * DELETE_TIMEOUT_MS;
|
|
|
34
34
|
// them as they are: preference-delivery (scope, snapshot and frame hashes),
|
|
35
35
|
// transcript-capture (capture settings versions per session), the capture
|
|
36
36
|
// settings, previews and onboarding files, model-usage.sqlite (counts), and the
|
|
37
|
-
//
|
|
37
|
+
// Agent app, employee, roundtable and peer stores (no
|
|
38
38
|
// knowledge items; an Agent's own roundtable messages are its records).
|
|
39
39
|
|
|
40
40
|
export function knowledgeHardDelete(dataDir, {
|
|
@@ -3,6 +3,7 @@ import { GraphitiProviderClient } from '../graphiti/provider-client.js';
|
|
|
3
3
|
import { personalHumanReviewChannel } from '../graphiti/human-review-channel.js';
|
|
4
4
|
import { knowledgeHardDelete } from './console-port.js';
|
|
5
5
|
import { createKnowledgeRecoveryGate } from './recovery-gate.js';
|
|
6
|
+
import { reconcileAndVerify } from './recovery-check.js';
|
|
6
7
|
import { createAgentDirectorySnapshots } from '../agents/directory-snapshots.js';
|
|
7
8
|
|
|
8
9
|
// Setup and the maintenance CLI resume the same already-confirmed deletions
|
|
@@ -22,14 +23,9 @@ export async function reconcileLocalKnowledge(paths, {
|
|
|
22
23
|
agentSnapshots: createAgentDirectorySnapshots({ root: paths.agentDirectoryRoot, providerIdentity: personal.providerUrl }),
|
|
23
24
|
personalSpaceId: () => personal.spaceId
|
|
24
25
|
});
|
|
25
|
-
await reconcile.reconcile();
|
|
26
|
-
// A reconciler result alone is not proof: verify the graph's current
|
|
27
|
-
// watermark with the ordinary credential before reporting readiness.
|
|
28
26
|
const gate = createGate({ dataDir: paths.dataDir,
|
|
29
27
|
readWatermark: (request) => provider.readHardDeletionWatermark(request) });
|
|
30
|
-
|
|
31
|
-
return state.state === 'open' ? { status: 'ready' }
|
|
32
|
-
: { status: 'pending', reason: state.reason };
|
|
28
|
+
return await reconcileAndVerify({ reconcile: () => reconcile.reconcile(), gate, spaceId: personal.spaceId });
|
|
33
29
|
} catch {
|
|
34
30
|
// Provider/config errors can contain secrets or item details. Keep the
|
|
35
31
|
// maintenance result content-free, and never turn a failed run into ready.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// The reconciliation behind `fuli migrate reconcile-knowledge`, and the
|
|
2
|
+
// console's own re-check of it. A reconciler result alone is not proof: the
|
|
3
|
+
// graph's current watermark, read with the ordinary credential, decides
|
|
4
|
+
// whether the local stores are ready.
|
|
5
|
+
export async function reconcileAndVerify({ reconcile, gate, spaceId }) {
|
|
6
|
+
await reconcile();
|
|
7
|
+
const state = await gate.refresh(spaceId, { force: true });
|
|
8
|
+
return state.state === 'open' ? { status: 'ready' } : { status: 'pending', reason: state.reason };
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// How often a closed recovery gate may start another reconciliation.
|
|
12
|
+
const RECHECK_INTERVAL_MS = 15_000;
|
|
13
|
+
|
|
14
|
+
// The console checks again by itself when a request finds recovery pending,
|
|
15
|
+
// so the person never has to run the maintenance command: one run at a time,
|
|
16
|
+
// at most one start per interval. It runs what the console already runs when
|
|
17
|
+
// it starts (it holds the data directory's maintenance lock shared for its
|
|
18
|
+
// lifetime, as the command does while it runs); a run that fails leaves the
|
|
19
|
+
// gate closed. run wraps the work, e.g. in a graph runtime lease.
|
|
20
|
+
export function createKnowledgeRecoveryCheck({ reconcile, gate, spaceId, run = (work) => work(),
|
|
21
|
+
now = () => performance.now(), intervalMs = RECHECK_INTERVAL_MS }) {
|
|
22
|
+
let running = null;
|
|
23
|
+
let startedAt = -Infinity;
|
|
24
|
+
return {
|
|
25
|
+
check() {
|
|
26
|
+
const space = spaceId();
|
|
27
|
+
if (running || !space || now() - startedAt < intervalMs) return running;
|
|
28
|
+
startedAt = now();
|
|
29
|
+
running = run(() => reconcileAndVerify({ reconcile, gate, spaceId: space }))
|
|
30
|
+
.catch(() => ({ status: 'pending', reason: 'reconciliation_unavailable' }))
|
|
31
|
+
.finally(() => { running = null; });
|
|
32
|
+
return running;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -3,8 +3,10 @@ import { join } from 'node:path';
|
|
|
3
3
|
import { ApplicationError } from '../app/application-error.js';
|
|
4
4
|
import { HARD_DELETE_LEDGER_FILE, ledgerStamp, readHardDeleteProof } from './delete-ledger.js';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
// Read by Agents and by the console (which shows its own wording); neither
|
|
7
|
+
// is told to run a command: the console re-checks by itself (recovery-check.js).
|
|
8
|
+
const WAIT = '等待图谱确认删除记录;FULI 控制台会自动重新核对,请稍后重试。 '
|
|
9
|
+
+ 'Waiting for deletion recovery; the FULI console checks again by itself, so try again shortly.';
|
|
8
10
|
const closed = reason => ({ state: 'closed', reason });
|
|
9
11
|
const open = Object.freeze({ state: 'open', reason: null });
|
|
10
12
|
|
|
@@ -19,8 +19,8 @@ import { ProviderRequestError } from '../graphiti/provider-client.js';
|
|
|
19
19
|
// The HTTP caller does not supply the proof: the server reads the token from
|
|
20
20
|
// its provider env and attaches it itself, trusting every local HTTP caller.
|
|
21
21
|
// So any local process, an Agent with a shell included, can still read these
|
|
22
|
-
// routes over loopback without reading any token.
|
|
23
|
-
//
|
|
22
|
+
// routes over loopback without reading any token. FULI is a local tool with
|
|
23
|
+
// no console login (rec#11 D-70).
|
|
24
24
|
// what: what the route shows, for the refusal's message.
|
|
25
25
|
export async function confirmConsoleOwner(ownerReads, personalSpaceId, what) {
|
|
26
26
|
const proofRequired = () => new ApplicationError('human_review_proof_required',
|
|
@@ -20,6 +20,10 @@ import { isProcessAlive, stopProcess } from './processes.js';
|
|
|
20
20
|
|
|
21
21
|
const CONSOLE_EXIT_TIMEOUT_MS = 15_000;
|
|
22
22
|
const STOPPING_CONSOLE_GRACE_MS = 3_000;
|
|
23
|
+
// Stopping waits longer for the console's identity than status does: a
|
|
24
|
+
// console busy for a few seconds is still the one to stop, and an answer
|
|
25
|
+
// missed here leaves it running (Update-Fuli: "could not be stopped").
|
|
26
|
+
const STOP_IDENTITY_TIMEOUT_MS = 10_000;
|
|
23
27
|
|
|
24
28
|
export async function startLocalRuntime(input, dependencies = {}) {
|
|
25
29
|
const deps = lifecycleDependencies(dependencies);
|
|
@@ -183,14 +187,14 @@ async function stopRecordedConsole(state, paths, deps) {
|
|
|
183
187
|
return 'not_running';
|
|
184
188
|
}
|
|
185
189
|
if (!isLoopbackConsoleUrl(state.url)) return 'unverified';
|
|
186
|
-
if (!await deps.consoleHealth(state.url, state.pid, state.version)) {
|
|
190
|
+
if (!await deps.consoleHealth(state.url, state.pid, state.version, STOP_IDENTITY_TIMEOUT_MS)) {
|
|
187
191
|
// A console that is already shutting down stops answering health checks
|
|
188
192
|
// before its process exits; wait for it instead of reporting a failure.
|
|
189
193
|
if (await deps.waitForExit(state.pid, STOPPING_CONSOLE_GRACE_MS)) {
|
|
190
194
|
deps.removeState(paths.graphRuntimeStatePath);
|
|
191
195
|
return 'not_running';
|
|
192
196
|
}
|
|
193
|
-
if (!await deps.consoleHealth(state.url, state.pid, state.version)) return 'unverified';
|
|
197
|
+
if (!await deps.consoleHealth(state.url, state.pid, state.version, STOP_IDENTITY_TIMEOUT_MS)) return 'unverified';
|
|
194
198
|
}
|
|
195
199
|
|
|
196
200
|
deps.stopProcess(state.pid);
|
|
@@ -9,7 +9,9 @@ import { basename } from 'node:path';
|
|
|
9
9
|
// the check and the termination and the wait use it. The Agent app owner
|
|
10
10
|
// lease (src/agent-apps/host-identity.js) only reads a FULI host process's
|
|
11
11
|
// exact creation time and whether it has exited (rec#7 D-28.25); it never
|
|
12
|
-
// terminates one (D-28.29, rec#11 D-36).
|
|
12
|
+
// terminates one (D-28.29, rec#11 D-36). The services manager stops a service
|
|
13
|
+
// an Agent recorded with Stop, after the person confirmed its PID and command
|
|
14
|
+
// (src/agent-services/process-identity.js, rec#11 D-71).
|
|
13
15
|
|
|
14
16
|
export function execute(command, args, options = {}) {
|
|
15
17
|
const { sensitiveValues = [], ...executionOptions } = options;
|
|
@@ -80,6 +82,16 @@ public static class FuliOwnedProcess {
|
|
|
80
82
|
return GetProcessTimes(handle, out created, out exited, out kernel, out user) ? created.ToString() : "";
|
|
81
83
|
} finally { CloseHandle(handle); }
|
|
82
84
|
}
|
|
85
|
+
// The image path as Stop compares it (a symbolic link resolved), or "".
|
|
86
|
+
public static string Image(uint pid) {
|
|
87
|
+
string failure;
|
|
88
|
+
IntPtr handle = Open(pid, QueryLimited, out failure);
|
|
89
|
+
if (handle == IntPtr.Zero) return "";
|
|
90
|
+
try {
|
|
91
|
+
int size=32768; var image=new StringBuilder(size);
|
|
92
|
+
return QueryFullProcessImageName(handle, 0, image, ref size) ? image.ToString() : "";
|
|
93
|
+
} finally { CloseHandle(handle); }
|
|
94
|
+
}
|
|
83
95
|
public static string Probe(uint pid, long expectedCreated) {
|
|
84
96
|
string failure;
|
|
85
97
|
IntPtr handle = Open(pid, QueryLimited | Synchronize, out failure);
|
package/src/mcp/session-id.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { SOURCE_APPLICATIONS } from '../agents/source-applications.js';
|
|
2
3
|
|
|
3
4
|
const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
4
5
|
const WORKFLOW_OBSERVATION_TOOL = 'record_workflow_transition_observation';
|
|
@@ -8,7 +9,7 @@ const PROJECT_AGENT_SOURCE_TOOLS = new Set([
|
|
|
8
9
|
// The caller's client decides whether its own turns are recorded.
|
|
9
10
|
'get_capture_policy',
|
|
10
11
|
'find_agents', 'message_agent', 'read_agent_messages', 'reply_agent_message',
|
|
11
|
-
'agent_chat',
|
|
12
|
+
'agent_chat', 'group_discussion',
|
|
12
13
|
'get_agent_message_status', 'cancel_agent_message',
|
|
13
14
|
'get_agent_quality_gate', 'record_agent_verification',
|
|
14
15
|
'assess_task_completion',
|
|
@@ -35,7 +36,7 @@ const PROJECT_AGENT_SOURCE_TOOLS = new Set([
|
|
|
35
36
|
'checkpoint_project_agent_memory',
|
|
36
37
|
'dismiss_project_agent',
|
|
37
38
|
// The task token is resolved for this client; its session is the conversation recorded.
|
|
38
|
-
'register_standing_assignment',
|
|
39
|
+
'register_standing_assignment', 'report_agent_service',
|
|
39
40
|
'record_project_agent_task_activity',
|
|
40
41
|
'preflight_executor',
|
|
41
42
|
'report_executor_health',
|
|
@@ -160,7 +161,7 @@ export function normalizeAgentSessionInput(
|
|
|
160
161
|
}
|
|
161
162
|
|
|
162
163
|
export function normalizeMcpSourceApplication(value) {
|
|
163
|
-
if (!
|
|
164
|
+
if (!SOURCE_APPLICATIONS.includes(value)) {
|
|
164
165
|
throw new TypeError('Unsupported MCP source application');
|
|
165
166
|
}
|
|
166
167
|
return value;
|
|
@@ -62,9 +62,9 @@ const READ_TOOLS = new Set([
|
|
|
62
62
|
]);
|
|
63
63
|
|
|
64
64
|
const WRITE_TOOLS = new Set([
|
|
65
|
-
'agent_chat',
|
|
65
|
+
'agent_chat', 'group_discussion',
|
|
66
66
|
'review_with_tonborg', 'assess_agent_action', 'assess_task_completion', 'pin_agent', 'role_work',
|
|
67
|
-
'
|
|
67
|
+
'control_project_agent_task_run', 'register_standing_assignment', 'report_agent_service',
|
|
68
68
|
'message_agent', 'reply_agent_message', 'cancel_agent_message',
|
|
69
69
|
'record_agent_verification',
|
|
70
70
|
'request_agent_loan', 'decide_agent_loan',
|
|
@@ -192,7 +192,7 @@ export function annotationsFor(name) {
|
|
|
192
192
|
name === 'checkpoint_task_knowledge' ||
|
|
193
193
|
name === 'checkpoint_project_agent_memory' ||
|
|
194
194
|
name === 'register_standing_assignment',
|
|
195
|
-
openWorldHint: name === 'agent_chat' || name === 'review_with_tonborg' || name === 'assess_agent_action' || name === 'assess_task_completion' || name === 'capture_session_knowledge' ||
|
|
195
|
+
openWorldHint: name === 'agent_chat' || name === 'group_discussion' || name === 'review_with_tonborg' || name === 'assess_agent_action' || name === 'assess_task_completion' || name === 'capture_session_knowledge' ||
|
|
196
196
|
name === 'discover_external_knowledge_sources' ||
|
|
197
197
|
name === 'create_external_knowledge_binding' ||
|
|
198
198
|
name === 'check_external_knowledge_binding' ||
|
|
@@ -15,7 +15,7 @@ import { RETENTION } from './suggestion-log.js';
|
|
|
15
15
|
// accepted only at the local process boundary (a loopback request). That
|
|
16
16
|
// does not show a person sent it and is not the human-review channel: no MCP
|
|
17
17
|
// or Agent tool calls it, but anything with local shell or HTTP access can.
|
|
18
|
-
// Keys
|
|
18
|
+
// Keys are saved by their own loopback route (keys-http.js), never here.
|
|
19
19
|
// operations: the task types each role already sends to its model.
|
|
20
20
|
// automaticOperations: the one operation per role that may apply its model's
|
|
21
21
|
// answer by itself (rec#10 D-36); modelTrust (src/model-backends/role-trust.js)
|
|
@@ -32,8 +32,8 @@ import { RETENTION } from './suggestion-log.js';
|
|
|
32
32
|
// own human-review proof for personalSpaceId, the active space the log is
|
|
33
33
|
// read in (src/knowledge-owner-reads/owner-proof.js); otherwise 403 and no
|
|
34
34
|
// data. The server attaches that proof itself and trusts local HTTP callers,
|
|
35
|
-
// so a local process can still read it over loopback;
|
|
36
|
-
//
|
|
35
|
+
// so a local process can still read it over loopback; FULI has no console
|
|
36
|
+
// login (rec#11 D-70). Agents have no tool that reads it. history lists
|
|
37
37
|
// what changed in a role's settings and execution mode and when
|
|
38
38
|
// (settings-history.js, rec#11 D-42), newest first, read only; each save and
|
|
39
39
|
// trust change answers whether its change was recorded there.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
import { refuseRemoteDecision } from '../http/request-policy.js';
|
|
4
|
+
import { readJson, sendJson } from '../http/response.js';
|
|
5
|
+
import { secretReference } from './secret-store.js';
|
|
6
|
+
|
|
7
|
+
// The model settings page's key entry: the same local store `fuli models
|
|
8
|
+
// set-key` writes (secret-store.js). A key travels once, in a loopback
|
|
9
|
+
// request body, and is never sent back, logged or put in a URL; the page
|
|
10
|
+
// learns only which references have a key. Loopback only, like every model
|
|
11
|
+
// settings change; FULI trusts local callers and has no console login
|
|
12
|
+
// (rec#11 D-70). No MCP or Agent tool reaches it.
|
|
13
|
+
const KEYS_ROUTE = '/api/model-backends/keys';
|
|
14
|
+
const KEY_ROUTE = /^\/api\/model-backends\/keys\/([^/]+)$/;
|
|
15
|
+
const KEY_BODY = z.object({ key: z.string() }).strict();
|
|
16
|
+
|
|
17
|
+
export async function handleModelKeyRequest({ request, response, url, secrets }) {
|
|
18
|
+
const reference = KEY_ROUTE.exec(url.pathname)?.[1] ?? null;
|
|
19
|
+
if (url.pathname !== KEYS_ROUTE && reference === null) return false;
|
|
20
|
+
response.setHeader('Cache-Control', 'no-store');
|
|
21
|
+
if (request.method !== (reference === null ? 'GET' : 'PUT')) {
|
|
22
|
+
sendJson(response, 405, { error: 'Method not allowed' });
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
if (refuseRemoteDecision(request, response, 'Model keys are saved only on this computer')) return true;
|
|
26
|
+
if (!secrets) {
|
|
27
|
+
sendJson(response, 503, { error: 'Model keys need a local FULI installation' });
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
try {
|
|
31
|
+
if (reference === null) {
|
|
32
|
+
sendJson(response, 200, { saved: secrets.references() });
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
secretReference(reference, 'Key reference');
|
|
36
|
+
const parsed = KEY_BODY.safeParse(await readJson(request));
|
|
37
|
+
if (!parsed.success) throw new TypeError('Send the key as { "key": "…" }');
|
|
38
|
+
await secrets.set(reference, parsed.data.key);
|
|
39
|
+
sendJson(response, 200, { reference, saved: true });
|
|
40
|
+
} catch (error) {
|
|
41
|
+
// The store's own refusals name the reference, never the key.
|
|
42
|
+
if (typeof error?.code !== 'string' || !error.code.startsWith('secret_')) throw error;
|
|
43
|
+
sendJson(response, 409, { error: error.message, code: error.code });
|
|
44
|
+
}
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
@@ -36,7 +36,8 @@ const USAGE_NOTES = 'One record per actual model API attempt; requests count dis
|
|
|
36
36
|
+ 'cachedInput, cacheWriteInput and reasoning are subsets of input or output as each provider defines them and are never added to totals. '
|
|
37
37
|
+ 'Costs are estimates from configured unit prices only; without prices the cost is unknown.';
|
|
38
38
|
|
|
39
|
-
export function createModelBackendPort({ readConfig, secrets, ledger, fetchImpl = globalThis.fetch, wait = delay,
|
|
39
|
+
export function createModelBackendPort({ readConfig, secrets, ledger, fetchImpl = globalThis.fetch, wait = delay,
|
|
40
|
+
now = () => new Date(), timeoutSignal = ms => AbortSignal.timeout(ms) }) {
|
|
40
41
|
// Endpoints that rejected json_schema output, for this process.
|
|
41
42
|
const promptOnly = new Set();
|
|
42
43
|
|
|
@@ -126,7 +127,7 @@ export function createModelBackendPort({ readConfig, secrets, ledger, fetchImpl
|
|
|
126
127
|
if (blocked) return stop('budget_exhausted', blocked);
|
|
127
128
|
|
|
128
129
|
let result;
|
|
129
|
-
const attemptSignal =
|
|
130
|
+
const attemptSignal = timeoutSignal(remainingMs);
|
|
130
131
|
try {
|
|
131
132
|
result = await adapter.call({ connection: target, secret, request, mode, signal: attemptSignal,
|
|
132
133
|
prompt: outgoing, maxOutputTokens: limits.maxOutputTokens, fetchImpl });
|
|
@@ -183,7 +184,7 @@ export function createModelBackendPort({ readConfig, secrets, ledger, fetchImpl
|
|
|
183
184
|
async function localBuildAfter(adapter, target, attemptSignal, remainingMs) {
|
|
184
185
|
if (remainingMs < LOCAL_BUILD_MIN_MS || attemptSignal.aborted) return null;
|
|
185
186
|
return adapter.observeLocalBuild({ connection: target, fetchImpl,
|
|
186
|
-
signal: AbortSignal.any([attemptSignal,
|
|
187
|
+
signal: AbortSignal.any([attemptSignal, timeoutSignal(Math.min(remainingMs, LOCAL_BUILD_MAX_MS))]) });
|
|
187
188
|
}
|
|
188
189
|
|
|
189
190
|
async function decide(input) {
|
|
@@ -48,7 +48,7 @@ export function createModelSecretStore({
|
|
|
48
48
|
const mode = ownerOnly ? fileMode(path) : null;
|
|
49
49
|
if (mode !== null && (mode & OTHER_USERS_MASK) !== 0) {
|
|
50
50
|
throw new ModelSecretError('secret_store_insecure',
|
|
51
|
-
'The model key store can be read by other users. Restrict it to the current user
|
|
51
|
+
'The model key store can be read by other users. Restrict it to the current user and try again.');
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
function records() {
|
|
@@ -60,6 +60,11 @@ export function createModelSecretStore({
|
|
|
60
60
|
return stored.secrets;
|
|
61
61
|
}
|
|
62
62
|
return {
|
|
63
|
+
// The references that have a key, never the keys.
|
|
64
|
+
references() {
|
|
65
|
+
assertPrivate();
|
|
66
|
+
return Object.keys(records()).sort();
|
|
67
|
+
},
|
|
63
68
|
async set(ref, secret) {
|
|
64
69
|
secretReference(ref, 'Key reference');
|
|
65
70
|
const value = secretValue(secret);
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
// and writes its digest here before publishing (scripts/pin-win-helper.js); a
|
|
4
4
|
// source checkout has no helper and no pin, so Windows Hello is unavailable there.
|
|
5
5
|
// The helper is not Authenticode-signed: this digest is its only integrity check.
|
|
6
|
-
export const WIN_HELPER_SHA256 = '
|
|
6
|
+
export const WIN_HELPER_SHA256 = '9d02879c4a8a1b0602f194a6b53ba212f91947758b31cc8bcd406314aabc8bf7';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { personalHumanReviewChannel, providerRefusal } from '../graphiti/human-review-channel.js';
|
|
2
|
+
|
|
3
|
+
// The person's move of a personal project in their hierarchy, from the local
|
|
4
|
+
// console's projects view. The parent decides which knowledge a project
|
|
5
|
+
// inherits, so like the other scope changes it leaves on the human-review
|
|
6
|
+
// channel (human-review-channel.js); an Agent's access token alone is refused.
|
|
7
|
+
// Only the console's loopback route uses this module; no MCP or Agent tool
|
|
8
|
+
// module imports it (test/project-hierarchy-http.test.js).
|
|
9
|
+
|
|
10
|
+
export function projectHierarchyConsole(dataDir, { send = personalHumanReviewChannel(dataDir) } = {}) {
|
|
11
|
+
return {
|
|
12
|
+
async moveProject(spaceId, projectId, body) {
|
|
13
|
+
const path = `/v1/personal-spaces/${encodeURIComponent(spaceId)}/projects/${encodeURIComponent(projectId)}/parent`;
|
|
14
|
+
const { ok, status, payload } = await send(path, body, { review: true });
|
|
15
|
+
if (ok) return payload;
|
|
16
|
+
throw providerRefusal(status, payload);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
package/src/server.js
CHANGED
|
@@ -25,18 +25,22 @@ import { listenFetchableServer } from './server/listen.js';
|
|
|
25
25
|
import { resolveSetupPaths } from './setup/paths.js';
|
|
26
26
|
import { createSystemService } from './system/system-service.js';
|
|
27
27
|
import { startJudgmentScheduler } from './judgment/scheduler.js';
|
|
28
|
-
import {
|
|
29
|
-
import { dataFormatNoticeLine, dataFormatNotices } from './data-format/format-notices.js';
|
|
28
|
+
import { dataFormatNoticeLine, dataFormatNotices, latestNotices } from './data-format/format-notices.js';
|
|
30
29
|
import { personalGraphFormat } from './data-format/graph-format-client.js';
|
|
31
30
|
import { holdDataDirectory } from './data-format/maintenance-lock.js';
|
|
32
31
|
import { dataFormatMigrations as createDataFormatMigrations } from './data-format/migration-operations.js';
|
|
32
|
+
import { consoleRestore } from './data-format/console-restore.js';
|
|
33
33
|
import { knowledgeHardDelete as createKnowledgeHardDelete } from './knowledge-hard-delete/console-port.js';
|
|
34
|
+
import { createKnowledgeRecoveryCheck } from './knowledge-hard-delete/recovery-check.js';
|
|
34
35
|
import { knowledgeScopeConsole as createKnowledgeScopeConsole } from './knowledge-scope/console-port.js';
|
|
36
|
+
import { projectHierarchyConsole as createProjectHierarchyConsole } from './project-hierarchy/console-port.js';
|
|
35
37
|
import { knowledgeOwnerReads as createKnowledgeOwnerReads } from './knowledge-owner-reads/console-port.js';
|
|
36
38
|
import { reviewUndoConsole } from './judgment/review-undo.js';
|
|
37
39
|
import { knowledgeTagsConsole as createKnowledgeTagsConsole } from './knowledge-tags/console-port.js';
|
|
38
40
|
import { createModelRoleSettings } from './model-backends/role-settings.js';
|
|
41
|
+
import { createModelSecretStore } from './model-backends/secret-store.js';
|
|
39
42
|
import { latestEvaluation } from './model-backends/evaluation-record.js';
|
|
43
|
+
import { createClientLinksRegistry } from './client-links/registry.js';
|
|
40
44
|
|
|
41
45
|
const PACKAGE_ROOT = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
42
46
|
|
|
@@ -80,13 +84,16 @@ export async function createServer(options = {}) {
|
|
|
80
84
|
const application = runtime.application;
|
|
81
85
|
// The console, not every hook or MCP process, reports the local stores this
|
|
82
86
|
// FULI cannot use as they are, named with their steps (rec#17).
|
|
83
|
-
|
|
87
|
+
// /api/health answers them without waiting on a store (latestNotices).
|
|
88
|
+
const formatNotices = options.dataFormatNotices ?? (localOptions.runtimeConfigPath
|
|
84
89
|
? dataFormatNotices(dirname(localOptions.runtimeConfigPath)) : null);
|
|
90
|
+
const dataFormats = formatNotices ? latestNotices(formatNotices) : null;
|
|
85
91
|
for (const notice of dataFormats?.() ?? []) console.warn(dataFormatNoticeLine(notice));
|
|
86
92
|
// A person's confirmed migrations, the same operations as `fuli migrate`.
|
|
87
93
|
const dataFormatMigrations = options.dataFormatMigrations ?? (localOptions.runtimeConfigPath
|
|
88
94
|
? createDataFormatMigrations(dirname(localOptions.runtimeConfigPath),
|
|
89
|
-
{ graph: personalGraphFormat(dirname(localOptions.runtimeConfigPath))
|
|
95
|
+
{ graph: personalGraphFormat(dirname(localOptions.runtimeConfigPath)),
|
|
96
|
+
restore: consoleRestore(dirname(localOptions.runtimeConfigPath)) }) : null);
|
|
90
97
|
for (const pruned of dataFormatMigrations?.prune() ?? []) {
|
|
91
98
|
if (pruned.kind === 'prune_failed') console.warn(`Format backups were not pruned: ${pruned.reason}`);
|
|
92
99
|
}
|
|
@@ -99,6 +106,9 @@ export async function createServer(options = {}) {
|
|
|
99
106
|
// A person's change of where knowledge applies (rec#20, rec#11 D-22), console only.
|
|
100
107
|
const knowledgeScope = options.knowledgeScope ?? (localOptions.runtimeConfigPath
|
|
101
108
|
? createKnowledgeScopeConsole(dirname(localOptions.runtimeConfigPath)) : null);
|
|
109
|
+
// A person's move of a project in their hierarchy (调整层级), console only.
|
|
110
|
+
const projectHierarchy = options.projectHierarchy ?? (localOptions.runtimeConfigPath
|
|
111
|
+
? createProjectHierarchyConsole(dirname(localOptions.runtimeConfigPath)) : null);
|
|
102
112
|
// The person's full knowledge reads, every FLA's included (console only).
|
|
103
113
|
const knowledgeOwnerReads = options.knowledgeOwnerReads ?? (localOptions.runtimeConfigPath
|
|
104
114
|
? createKnowledgeOwnerReads(dirname(localOptions.runtimeConfigPath)) : null);
|
|
@@ -112,6 +122,10 @@ export async function createServer(options = {}) {
|
|
|
112
122
|
const modelRoleSettings = options.modelRoleSettings ?? (localOptions.runtimeConfigPath
|
|
113
123
|
? createModelRoleSettings(resolveSetupPaths({ dataDir: dirname(localOptions.runtimeConfigPath) }).modelBackendConfigPath,
|
|
114
124
|
{ history: application.modelSettingsHistory }) : null);
|
|
125
|
+
// The model keys the settings page saves, where `fuli models set-key` saves them; reached only by the loopback route.
|
|
126
|
+
const modelSecrets = options.modelSecrets ?? (localOptions.runtimeConfigPath
|
|
127
|
+
? createModelSecretStore({ path: resolveSetupPaths({ dataDir: dirname(localOptions.runtimeConfigPath) }).modelSecretStorePath })
|
|
128
|
+
: null);
|
|
115
129
|
// The latest local evaluation of a role's model, as the model settings page shows it (rec#10 D-36.6).
|
|
116
130
|
const readModelEvaluation = options.readModelEvaluation ?? (localOptions.runtimeConfigPath
|
|
117
131
|
? key => latestEvaluation(resolveSetupPaths({ dataDir: dirname(localOptions.runtimeConfigPath) }).modelEvaluationsPath, key) : null);
|
|
@@ -119,6 +133,10 @@ export async function createServer(options = {}) {
|
|
|
119
133
|
// is settled from its recorded operation, and graph deletions the record
|
|
120
134
|
// lost are taken in again; what the graph cannot answer yet stays open for
|
|
121
135
|
// the page's retry. A damaged record is reported here and on every use.
|
|
136
|
+
// The client link manifest: bundled, updated by the person or once a day when they turned that on.
|
|
137
|
+
const clientLinks = options.clientLinks ?? (localOptions.runtimeConfigPath
|
|
138
|
+
? createClientLinksRegistry({ statePath: resolveSetupPaths({ dataDir: dirname(localOptions.runtimeConfigPath) }).clientLinksPath })
|
|
139
|
+
: null);
|
|
122
140
|
knowledgeHardDelete?.reconcile().catch((error) => {
|
|
123
141
|
console.warn(`Permanent deletes were not reconciled: ${error?.message ?? error}`);
|
|
124
142
|
});
|
|
@@ -127,13 +145,13 @@ export async function createServer(options = {}) {
|
|
|
127
145
|
let system = null;
|
|
128
146
|
let resourcesClosing = null;
|
|
129
147
|
let stopJudgment = () => {};
|
|
130
|
-
let
|
|
148
|
+
let stopClientLinkUpdates = () => {};
|
|
131
149
|
let peer = null;
|
|
132
150
|
let workerRuntime = null;
|
|
133
151
|
function closeResources() {
|
|
134
152
|
resourcesClosing ??= (async () => {
|
|
135
153
|
const failures = [];
|
|
136
|
-
for (const close of [() => stopJudgment(), () =>
|
|
154
|
+
for (const close of [() => stopJudgment(), () => stopClientLinkUpdates(), () => peer?.close(), () => workerRuntime?.close(), () => system?.close?.(), () => runtime.close(),
|
|
137
155
|
() => releaseDataDirectory()]) {
|
|
138
156
|
try {
|
|
139
157
|
const pending = close();
|
|
@@ -184,6 +202,13 @@ export async function createServer(options = {}) {
|
|
|
184
202
|
// construction or configuration validation fails, even without a listener.
|
|
185
203
|
await failStartup(error);
|
|
186
204
|
}
|
|
205
|
+
// A request that finds deletion recovery pending starts the console's own
|
|
206
|
+
// re-check, the same reconciliation it ran when it started.
|
|
207
|
+
const knowledgeRecovery = knowledgeHardDelete && application.knowledgeRecoveryGate
|
|
208
|
+
? createKnowledgeRecoveryCheck({ reconcile: () => knowledgeHardDelete.reconcile(),
|
|
209
|
+
gate: application.knowledgeRecoveryGate, spaceId: () => application.config?.personal?.spaceId ?? null,
|
|
210
|
+
...(system?.withGraphRuntimeLease ? { run: (work) => system.withGraphRuntimeLease('knowledge-recovery', work) } : {}) })
|
|
211
|
+
: null;
|
|
187
212
|
let authority = null;
|
|
188
213
|
let allowedLanAuthorities = [];
|
|
189
214
|
const server = createHttpServer((request, response) => {
|
|
@@ -199,11 +224,14 @@ export async function createServer(options = {}) {
|
|
|
199
224
|
dataFormatMigrations,
|
|
200
225
|
knowledgeHardDelete,
|
|
201
226
|
knowledgeScope,
|
|
227
|
+
projectHierarchy,
|
|
202
228
|
knowledgeOwnerReads,
|
|
203
229
|
knowledgeTags,
|
|
204
230
|
modelRoleSettings,
|
|
231
|
+
modelSecrets,
|
|
205
232
|
readModelEvaluation,
|
|
206
233
|
judgmentUndo,
|
|
234
|
+
clientLinks,
|
|
207
235
|
authority,
|
|
208
236
|
lanAuthorities: allowedLanAuthorities,
|
|
209
237
|
lanAccessToken: lanToken
|
|
@@ -215,6 +243,7 @@ export async function createServer(options = {}) {
|
|
|
215
243
|
return;
|
|
216
244
|
}
|
|
217
245
|
const mapped = mapHttpError(error);
|
|
246
|
+
if (mapped.body.code === 'knowledge_recovery_pending') void knowledgeRecovery?.check();
|
|
218
247
|
sendJson(response, mapped.status, mapped.body);
|
|
219
248
|
});
|
|
220
249
|
});
|
|
@@ -235,8 +264,9 @@ export async function createServer(options = {}) {
|
|
|
235
264
|
}
|
|
236
265
|
stopJudgment = startJudgmentScheduler({ app: application,
|
|
237
266
|
...(system?.withGraphRuntimeLease ? { withLease: (owner, run) => system.withGraphRuntimeLease(owner, run) } : {}) });
|
|
238
|
-
|
|
239
|
-
|
|
267
|
+
stopClientLinkUpdates = clientLinks?.startAutoUpdate({
|
|
268
|
+
onError: (error) => console.warn(`Client links were not updated: ${error?.message ?? error}`)
|
|
269
|
+
}) ?? (() => {});
|
|
240
270
|
// Resumes only what the owner already turned on; console LAN access never enables it.
|
|
241
271
|
if (application.peer && options.peer !== false) {
|
|
242
272
|
peer = createPeerRuntime({ host: application.roundtableHost, roundtable: application.roundtable, port: application.peer,
|
|
@@ -293,11 +323,14 @@ async function handleRequest({
|
|
|
293
323
|
dataFormatMigrations,
|
|
294
324
|
knowledgeHardDelete,
|
|
295
325
|
knowledgeScope,
|
|
326
|
+
projectHierarchy,
|
|
296
327
|
knowledgeOwnerReads,
|
|
297
328
|
knowledgeTags,
|
|
298
329
|
modelRoleSettings,
|
|
330
|
+
modelSecrets,
|
|
299
331
|
readModelEvaluation,
|
|
300
332
|
judgmentUndo,
|
|
333
|
+
clientLinks,
|
|
301
334
|
authority,
|
|
302
335
|
lanAuthorities,
|
|
303
336
|
lanAccessToken
|
|
@@ -326,11 +359,14 @@ async function handleRequest({
|
|
|
326
359
|
dataFormatMigrations,
|
|
327
360
|
knowledgeHardDelete,
|
|
328
361
|
knowledgeScope,
|
|
362
|
+
projectHierarchy,
|
|
329
363
|
knowledgeOwnerReads,
|
|
330
364
|
knowledgeTags,
|
|
331
365
|
modelRoleSettings,
|
|
366
|
+
modelSecrets,
|
|
332
367
|
readModelEvaluation,
|
|
333
|
-
judgmentUndo
|
|
368
|
+
judgmentUndo,
|
|
369
|
+
clientLinks
|
|
334
370
|
})) return;
|
|
335
371
|
serveStatic(new URL(request.url, 'http://127.0.0.1').pathname, response);
|
|
336
372
|
}
|
|
@@ -18,7 +18,9 @@ export function previewClientConfiguration(pack, agent, context) {
|
|
|
18
18
|
const writers = {
|
|
19
19
|
'codex-toml': () => previewCodexConfiguration(pack, agent, context, io),
|
|
20
20
|
'claude-code-settings': () => CONFIG_WRITERS['claude-code-settings'].connect(pack, agent, context, { readConfig: io.readJson, writeConfig: io.writeJson }),
|
|
21
|
-
'cursor-hooks': () => CONFIG_WRITERS['cursor-hooks'].connect(pack, agent, context, { readConfig: io.readJson, writeConfig: io.writeJson })
|
|
21
|
+
'cursor-hooks': () => CONFIG_WRITERS['cursor-hooks'].connect(pack, agent, context, { readConfig: io.readJson, writeConfig: io.writeJson }),
|
|
22
|
+
// A previewed target carries no OpenCode version, so its plugin is only kept current, never removed.
|
|
23
|
+
'opencode-plugin': () => CONFIG_WRITERS['opencode-plugin'].connect(pack, agent, context, { readText: io.readText, writeText: io.writeText })
|
|
22
24
|
};
|
|
23
25
|
writers[pack.configWriter]();
|
|
24
26
|
return [...after].filter(([path, text]) => text !== before.get(path)).map(([path, text]) => ({ path, before: before.get(path), after: text }));
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { claudeCodeStatus, connectClaudeCode, disconnectClaudeCode } from '../claude-code-config.js';
|
|
2
2
|
import { codexStatus, connectCodex, disconnectCodex } from '../codex-config.js';
|
|
3
3
|
import { connectCursor, cursorStatus, disconnectCursor } from '../cursor-config.js';
|
|
4
|
+
import { connectOpenCode, detectOpenCode, disconnectOpenCode, openCodeStatus } from './opencode/config-writer.js';
|
|
4
5
|
|
|
5
6
|
// The fixed code set a descriptor pack's `configWriter` chooses from (rec#18
|
|
6
7
|
// D-10). A writer owns one client file format: it renders the pack's data into
|
|
7
8
|
// that format and keeps every unrelated entry. Disconnect recognises FULI's
|
|
8
9
|
// entries by fixed markers, never by pack data, so any earlier connection can
|
|
9
|
-
// be removed. A new format is a code release, not a pack.
|
|
10
|
+
// be removed. A new format is a code release, not a pack. `detect`, when a
|
|
11
|
+
// writer has one, refines discovery for a format that chooses between files.
|
|
10
12
|
export const CONFIG_WRITERS = Object.freeze({
|
|
11
13
|
'claude-code-settings': Object.freeze({ connect: connectClaudeCode, disconnect: disconnectClaudeCode, status: claudeCodeStatus }),
|
|
12
14
|
'codex-toml': Object.freeze({ connect: connectCodex, disconnect: disconnectCodex, status: codexStatus }),
|
|
13
|
-
'cursor-hooks': Object.freeze({ connect: connectCursor, disconnect: disconnectCursor, status: cursorStatus })
|
|
15
|
+
'cursor-hooks': Object.freeze({ connect: connectCursor, disconnect: disconnectCursor, status: cursorStatus }),
|
|
16
|
+
'opencode-plugin': Object.freeze({ connect: connectOpenCode, disconnect: disconnectOpenCode, status: openCodeStatus,
|
|
17
|
+
detect: detectOpenCode })
|
|
14
18
|
});
|