fuli-context 0.20.1 → 0.21.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/dist/web/assets/{AboutPage-CjDenGS_.js → AboutPage-D0dTwKq8.js} +1 -1
- package/dist/web/assets/{AgentName-DdlJlpT3.js → AgentName-n4oqQUwE.js} +1 -1
- package/dist/web/assets/{AgentProfilePage-Cx_Uf5Vf.js → AgentProfilePage-DH54S93r.js} +1 -1
- package/dist/web/assets/{AgentsDirectoryPage-DylT-GSW.js → AgentsDirectoryPage-xwIRrNb8.js} +1 -1
- package/dist/web/assets/{BackLink-D7oAvDG5.js → BackLink-nM3e40IT.js} +1 -1
- package/dist/web/assets/{BoardMoveMenu-B0pA7LLx.js → BoardMoveMenu-Cxgkbwkl.js} +1 -1
- package/dist/web/assets/{CaptureChangePage-DEuqPb14.js → CaptureChangePage-DWdz9dEk.js} +1 -1
- package/dist/web/assets/{Card-BZFLZ_2I.js → Card-89NKHANE.js} +1 -1
- package/dist/web/assets/{CardHeader-C_c0keQn.js → CardHeader-9MwjWRxl.js} +1 -1
- package/dist/web/assets/{CardTitle-yXOhV577.js → CardTitle-BAhmXjAK.js} +1 -1
- package/dist/web/assets/{ConnectionsPage-DlnHdtwn.js → ConnectionsPage-Yf4UvjDT.js} +1 -1
- package/dist/web/assets/{CreateProjectDialog-BVJqWdlT.js → CreateProjectDialog-crpLTyDf.js} +1 -1
- package/dist/web/assets/{DataFormatPage-BdcjcyhZ.js → DataFormatPage-BPuUH0PG.js} +1 -1
- package/dist/web/assets/{DialogFooter-DYawfDCD.js → DialogFooter-D9A9hRP4.js} +1 -1
- package/dist/web/assets/{EmployeeRecruitDialog-CB4ARFkM.js → EmployeeRecruitDialog-DeB0XHeM.js} +1 -1
- package/dist/web/assets/EmployeeWorkbenchPage-0oK2RfIh.js +3 -0
- package/dist/web/assets/{EmployeeWorkbenchPage-BenZP7De.css → EmployeeWorkbenchPage-CMutwFBC.css} +1 -1
- package/dist/web/assets/{GrowthLoading-smW3-Gfp.js → GrowthLoading-Cs9brXcN.js} +1 -1
- package/dist/web/assets/{InboxPage-Crn1UU7s.js → InboxPage-CTQ425Ez.js} +1 -1
- package/dist/web/assets/{Input-F1oftPWh.js → Input-DGf4juEs.js} +1 -1
- package/dist/web/assets/{KnowledgeEditDialog-VdQwbX4E.js → KnowledgeEditDialog-Ccgj30Wu.js} +1 -1
- package/dist/web/assets/{KnowledgeHardDeleteSection-CXRmNnZF.js → KnowledgeHardDeleteSection-CSnqisUv.js} +1 -1
- package/dist/web/assets/{KnowledgeItemEditPage-CQo3TbCJ.js → KnowledgeItemEditPage-C0Y2DsHz.js} +1 -1
- package/dist/web/assets/{KnowledgeItemSummaryCard-Dd2McM-d.js → KnowledgeItemSummaryCard-BRvaf4Fw.js} +1 -1
- package/dist/web/assets/{KnowledgeOrganizerPage-BVgAyu6U.js → KnowledgeOrganizerPage-CRC3mk0j.js} +1 -1
- package/dist/web/assets/KnowledgePage-NsKFUWth.js +1 -0
- package/dist/web/assets/{KnowledgePeek-BNBkh1ey.js → KnowledgePeek-Bc0bqyZp.js} +1 -1
- package/dist/web/assets/{KnowledgeTurnReceiptPage-Ckw_olrt.js → KnowledgeTurnReceiptPage-Dl0KeFDe.js} +1 -1
- package/dist/web/assets/{KnowledgeWorkspace-pH2tAFld.js → KnowledgeWorkspace-BGlODG7G.js} +1 -1
- package/dist/web/assets/{Label-yDCtlpkb.js → Label-CafdTnDF.js} +1 -1
- package/dist/web/assets/ModelSettingsPage-Bz1tMXtW.js +1 -0
- package/dist/web/assets/ModelSettingsPage-DJuEaw6p.css +1 -0
- package/dist/web/assets/{NotFoundPage-8gVVukRR.js → NotFoundPage-TfZ2eoA2.js} +1 -1
- package/dist/web/assets/{OccupationsPage-PNoqE21Y.js → OccupationsPage-CnSp6362.js} +1 -1
- package/dist/web/assets/{OverviewPage-DiwYSnhh.js → OverviewPage-D5W-DhOz.js} +2 -2
- package/dist/web/assets/{PersonalProfilePage-C_v2BFee.js → PersonalProfilePage-CndOcRQ6.js} +1 -1
- package/dist/web/assets/{PersonalProjectsPage-DGRV8cM5.js → PersonalProjectsPage-CXBOwEqC.js} +1 -1
- package/dist/web/assets/{PopperContent-5zqbtnYr.js → PopperContent-BXbztFFi.js} +1 -1
- package/dist/web/assets/{Presence-BYfYJNMD.js → Presence-BLar6FCs.js} +1 -1
- package/dist/web/assets/{ProjectAgentDetailPage-BQ9ffaCX.js → ProjectAgentDetailPage-SmZ2NYTw.js} +1 -1
- package/dist/web/assets/{ProjectAgentDialog-BGckQDTq.js → ProjectAgentDialog-Bg0V3Zr2.js} +1 -1
- package/dist/web/assets/{ProjectAgentFirstTask-DrSd3nR-.js → ProjectAgentFirstTask-CbOWaP7Q.js} +1 -1
- package/dist/web/assets/{ProjectAgentsPage-U4Om3EPu.js → ProjectAgentsPage-Y6qCYRZj.js} +1 -1
- package/dist/web/assets/{ProjectScopePicker-D0oxbwOd.js → ProjectScopePicker-ClDUoUHW.js} +1 -1
- package/dist/web/assets/{PublicProjectsPage-CvkQ3E8I.js → PublicProjectsPage-C63vW9UZ.js} +1 -1
- package/dist/web/assets/{RadioGroupItem-CBpbQlHx.js → RadioGroupItem-tL_2upmD.js} +1 -1
- package/dist/web/assets/{RoundtablesPage-BEUaKOjI.js → RoundtablesPage-2Akxagrm.js} +1 -1
- package/dist/web/assets/{RovingFocusGroup-X9U-ufYr.js → RovingFocusGroup-D5mf9s6I.js} +1 -1
- package/dist/web/assets/{RovingFocusItem-_uA_OCLT.js → RovingFocusItem-DAumq9xD.js} +1 -1
- package/dist/web/assets/{SessionMigrationPage-WVFSDcUO.js → SessionMigrationPage-B5r2PWCF.js} +1 -1
- package/dist/web/assets/{SessionRecordsPage-Bs2eLXEi.js → SessionRecordsPage-DIc2GoCQ.js} +1 -1
- package/dist/web/assets/{SettingsPage-DlIwICIz.js → SettingsPage-BAxKpnBx.js} +1 -1
- package/dist/web/assets/{SharedJefaReportPage-B_rreEep.js → SharedJefaReportPage-B54qEdIV.js} +1 -1
- package/dist/web/assets/{TabsContent-8pXwYJPz.js → TabsContent-DZQE2Iq8.js} +1 -1
- package/dist/web/assets/{TabsTrigger-Cd6SI2yI.js → TabsTrigger-CHnq6mkI.js} +1 -1
- package/dist/web/assets/{TagVocabularyPage-BQiuKG-4.js → TagVocabularyPage-BIsHYk2i.js} +1 -1
- package/dist/web/assets/{TaskExecutionPlan-CupxJeyo.js → TaskExecutionPlan-IYG_JeuT.js} +1 -1
- package/dist/web/assets/{TaskSchedulesPage-zYQs7s6T.js → TaskSchedulesPage-Cxjqc8XQ.js} +1 -1
- package/dist/web/assets/{Teleport-BZX1Eb7R.js → Teleport-BKN3dSMk.js} +1 -1
- package/dist/web/assets/{TextField-CielK4l3.js → TextField-DoKtn--E.js} +1 -1
- package/dist/web/assets/{UiDialog-BSDblUpR.js → UiDialog-7pnZ-eQA.js} +1 -1
- package/dist/web/assets/{UiDisclosure-DLmVwmy1.js → UiDisclosure-COV4NwHI.js} +1 -1
- package/dist/web/assets/{UiIcon-B8eZeuGI.js → UiIcon-BADOYtHM.js} +1 -1
- package/dist/web/assets/{UiIconButton-e754Tmnq.js → UiIconButton-CkBP6pnX.js} +1 -1
- package/dist/web/assets/{UiSegmented-D1HD-qin.js → UiSegmented-FwOnE2IZ.js} +1 -1
- package/dist/web/assets/{UiSelect-CbkTsi2e.js → UiSelect-BIhr03Gk.js} +1 -1
- package/dist/web/assets/{UiToggle-Dz93aXFK.js → UiToggle-bpyawyIe.js} +1 -1
- package/dist/web/assets/{UiWeight-CUvyApSB.js → UiWeight-TyBehy3K.js} +1 -1
- package/dist/web/assets/{UnassignedConversationsPanel-xY7gsFot.js → UnassignedConversationsPanel-B4PqImRi.js} +1 -1
- package/dist/web/assets/{VirtualDirectoryList-Dv6PwLjU.js → VirtualDirectoryList-DNQP6X8j.js} +1 -1
- package/dist/web/assets/{Workbench3D--4N_uKzp.js → Workbench3D-DNwgymIE.js} +1 -1
- package/dist/web/assets/{WritingTastePage-B7KojA4r.js → WritingTastePage-D-ELo7mh.js} +1 -1
- package/dist/web/assets/{_plugin-vue_export-helper-BmfQlfI8.js → _plugin-vue_export-helper-RegzAV-H.js} +1 -1
- package/dist/web/assets/{accordion-gXElbGP_.js → accordion-DpqAdXTB.js} +1 -1
- package/dist/web/assets/{agent-occupation-ChN-1QjC.js → agent-occupation-Ba5Fl0ys.js} +1 -1
- package/dist/web/assets/{agent-pins-Chh_rdBi.js → agent-pins-Bb7-1Uoz.js} +1 -1
- package/dist/web/assets/{agent-profile.css_vue_type_style_index_0_src_true_lang-DWlz7UoN.js → agent-profile.css_vue_type_style_index_0_src_true_lang-wT8gjVyZ.js} +1 -1
- package/dist/web/assets/{agent-work-summary-C9yMf019.js → agent-work-summary-D0a836ik.js} +1 -1
- package/dist/web/assets/{attention-store-CG9cF6DX.js → attention-store-g2-_vAhV.js} +1 -1
- package/dist/web/assets/{badge-DvvDq2Wb.js → badge-BIoC0hjn.js} +1 -1
- package/dist/web/assets/{button-CFEnxtio.js → button-A2esxd6G.js} +1 -1
- package/dist/web/assets/{checkbox-DovdRz8u.js → checkbox-DxBVlC6t.js} +1 -1
- package/dist/web/assets/{client-lh80ewvs.js → client-DAoXcTUz.js} +1 -1
- package/dist/web/assets/{console-CQMgYkk9.js → console-DiNe1hFP.js} +1 -1
- package/dist/web/assets/{conversation-launcher-settings-B1QM-wZB.js → conversation-launcher-settings-CtOlr9uP.js} +1 -1
- package/dist/web/assets/{design-lab-BDKwIbI8.js → design-lab-UWXx2ZtA.js} +1 -1
- package/dist/web/assets/{dialog-D2mO6m3B.js → dialog-DTVE8tN1.js} +1 -1
- package/dist/web/assets/{dist-PmK0PfVA.js → dist-D-8b3yGa.js} +1 -1
- package/dist/web/assets/{dropdown-menu-YzCnvjAb.js → dropdown-menu-NcUrhhmG.js} +1 -1
- package/dist/web/assets/{field-BMEFEyVC.js → field-6mg5DSC8.js} +1 -1
- package/dist/web/assets/{identity-bK-fJdnj.js → identity-FG3YqHVj.js} +1 -1
- package/dist/web/assets/index-BpQe3IT5.js +2 -0
- package/dist/web/assets/{judgment-types-DJnAr9c0.js → judgment-types-rLsl2Cis.js} +1 -1
- package/dist/web/assets/{model-Cengn9fg.js → model-BCnsjEuP.js} +1 -1
- package/dist/web/assets/{model-rumuELTi.js → model-BcMr6R8m.js} +1 -1
- package/dist/web/assets/{model-DpVrfbnj.js → model-CYJ_LZ47.js} +1 -1
- package/dist/web/assets/{model-BwNZZZNP.js → model-CeF2BATq.js} +1 -1
- package/dist/web/assets/{model-CuY1vtEy.js → model-CtmCtjml.js} +1 -1
- package/dist/web/assets/{model-CPMYnu3S.js → model-t2ZvD7wL.js} +1 -1
- package/dist/web/assets/{motion-preference-A1AMssSH.js → motion-preference-DeZURhN7.js} +1 -1
- package/dist/web/assets/{occupation-catalog-DxwlYD1L.js → occupation-catalog-q0ZjGx2o.js} +1 -1
- package/dist/web/assets/{orchestration-filters-DZpJ0FN3.js → orchestration-filters-CKf_Gzdl.js} +1 -1
- package/dist/web/assets/{page-title-Bg-mVyrS.js → page-title-BLHrexaP.js} +1 -1
- package/dist/web/assets/{personal-profile-graph-tMneNj_m.js → personal-profile-graph-IYovB9sV.js} +1 -1
- package/dist/web/assets/{project-capture-QgMw6qvo.js → project-capture-BvIPecIS.js} +1 -1
- package/dist/web/assets/{project-origin-ppsYHpYL.js → project-origin-JnGPwlfA.js} +1 -1
- package/dist/web/assets/project-team-api-Cfn41MCR.js +1 -0
- package/dist/web/assets/{quick-edit-api-BiyK3ih-.js → quick-edit-api-DzpRAPsr.js} +1 -1
- package/dist/web/assets/{shared-report-D3Hem1t5.js → shared-report-BLmBg2FG.js} +3 -3
- package/dist/web/assets/{task-labels-7KyNw9id.js → task-labels-BArOYZEW.js} +1 -1
- package/dist/web/assets/{ui-Ck58paqr.js → ui-CtW0tAA1.js} +1 -1
- package/dist/web/assets/{useAgentRecords-C6RrZwwv.js → useAgentRecords-BoOqLQcf.js} +1 -1
- package/dist/web/assets/{useApi-CROJJdhE-BujjnKN_.js → useApi-CROJJdhE-CH5wlWTU.js} +1 -1
- package/dist/web/assets/{useFocusReturn-D9IOIg17.js → useFocusReturn-DX2zmPSK.js} +1 -1
- package/dist/web/assets/{useKnowledgeItemPeek-C6nAzvDL.js → useKnowledgeItemPeek-Cfvr5H1q.js} +1 -1
- package/dist/web/assets/{useMinimumLoadingDisplay-HnxkDut6.js → useMinimumLoadingDisplay-GhG1ICNJ.js} +1 -1
- package/dist/web/assets/{useRoutePeek-BvYFc1BA.js → useRoutePeek-DydCbUhy.js} +1 -1
- package/dist/web/assets/{vue-router-Bl55c88B.js → vue-router-Dad-4p7O.js} +1 -1
- package/dist/web/index.html +32 -32
- package/docs/agent-conversations-and-collaboration.md +10 -0
- package/docs/employee-agents.md +3 -1
- package/docs/judgment-and-autonomy.md +30 -1
- package/graph-provider/fuli_graph/agent_conversation_models.py +7 -0
- package/graph-provider/fuli_graph/agent_conversation_routes.py +5 -1
- package/graph-provider/fuli_graph/default_project_lead.py +7 -3
- package/graph-provider/fuli_graph/store_agent_conversations.py +66 -34
- package/graph-provider/pyproject.toml +1 -1
- package/native/win32/fuli-win-helper.exe +0 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/packages/roundtable/src/host.js +5 -0
- package/packages/roundtable/src/peer/coordinator-service.js +20 -3
- package/packages/roundtable/src/roundtable/service.js +31 -5
- package/skills/capturing-session-knowledge/references/retrieval.md +10 -2
- package/skills/operating-fuli/references/workflow-recipes.md +2 -0
- package/src/agent-apps/host-tools/catalog.js +1 -0
- package/src/agent-tools/executor-routing-definitions.js +194 -0
- package/src/agent-tools/graph-definitions.js +20 -1279
- package/src/agent-tools/graph-handlers.js +6 -2
- package/src/agent-tools/graph-tool-fields.js +43 -0
- package/src/agent-tools/interface-catalog.js +5 -1
- package/src/agent-tools/knowledge-curation-definitions.js +167 -0
- package/src/agent-tools/knowledge-definitions.js +431 -0
- package/src/agent-tools/project-agent-tool-definitions.js +271 -0
- package/src/agent-tools/project-space-definitions.js +155 -0
- package/src/agent-tools/session-fuli-gate.js +33 -31
- package/src/agent-tools/standing-assignment-definitions.js +32 -0
- package/src/agent-tools/task-entry-definitions.js +105 -0
- package/src/agent-tools.js +5 -4
- package/src/agents/claude-code/lifecycle-hook.js +16 -2
- package/src/agents/claude-code/preference-evidence.js +11 -1
- package/src/app/application-error.js +21 -3
- package/src/conversations/capture-window.js +8 -3
- package/src/conversations/entry-budget.js +2 -10
- package/src/conversations/entry-inline-budget.js +144 -0
- package/src/conversations/entry-rules.js +1 -1
- package/src/conversations/entry-time.js +15 -0
- package/src/conversations/preference-evidence.js +19 -0
- package/src/conversations/preference-lifecycle.js +28 -7
- package/src/conversations/preference-session.js +26 -10
- package/src/conversations/preference-snapshot.js +12 -1
- package/src/conversations/sync-transcript.js +10 -6
- package/src/conversations/transcript-guard.js +4 -3
- package/src/conversations/transcript-lifecycle.js +6 -3
- package/src/data-format/local-stores.js +3 -0
- package/src/desktop/windows-installation.js +2 -1
- package/src/external-knowledge/connectors/feishu.js +3 -1
- package/src/graphiti/active-personal-space.js +5 -0
- package/src/graphiti/agent-conversations.js +23 -28
- package/src/graphiti/agent-knowledge-workflows.js +12 -1299
- package/src/graphiti/agent-project-resolution.js +11 -0
- package/src/graphiti/agent-view-records.js +19 -0
- package/src/graphiti/capture-notice.js +20 -6
- package/src/graphiti/collaboration-preference-entry.js +89 -0
- package/src/graphiti/collaboration-preference-workflow.js +1 -1
- package/src/graphiti/common-knowledge-candidates.js +222 -0
- package/src/graphiti/cross-project-knowledge-similarity.js +59 -0
- package/src/graphiti/current-project-knowledge-search.js +86 -0
- package/src/graphiti/decision-trace.js +136 -0
- package/src/graphiti/federated-application.js +158 -795
- package/src/graphiti/human-knowledge-changes.js +45 -0
- package/src/graphiti/knowledge-credential-guard.js +43 -0
- package/src/graphiti/knowledge-curation.js +178 -0
- package/src/graphiti/knowledge-feedback.js +25 -0
- package/src/graphiti/knowledge-graph-reads.js +62 -0
- package/src/graphiti/local-runtimes.js +78 -0
- package/src/graphiti/personal-global-preference-candidates.js +431 -0
- package/src/graphiti/personal-projects.js +33 -0
- package/src/graphiti/preference-conflict-requests.js +57 -0
- package/src/graphiti/preference-project-resolution.js +39 -0
- package/src/graphiti/preference-task-scope.js +18 -0
- package/src/graphiti/project-agent-control-plane.js +6 -1
- package/src/graphiti/project-agent-task-entry.js +18 -1
- package/src/graphiti/project-path-context.js +28 -9
- package/src/graphiti/provider-client.js +1 -1
- package/src/graphiti/public-project-relations.js +28 -0
- package/src/graphiti/public-projects.js +125 -0
- package/src/graphiti/publication-review-queues.js +50 -0
- package/src/graphiti/roundtable-host.js +35 -3
- package/src/graphiti/session-capture-pause-request.js +3 -2
- package/src/graphiti/session-fuli-switch.js +4 -3
- package/src/graphiti/session-knowledge-capture.js +59 -0
- package/src/graphiti/session-records.js +4 -3
- package/src/graphiti/source-marker.js +13 -3
- package/src/graphiti/standing-assignment-confirmation.js +66 -0
- package/src/graphiti/standing-assignment-correction.js +148 -0
- package/src/graphiti/standing-assignment-entry.js +223 -0
- package/src/graphiti/task-context-entry.js +114 -0
- package/src/graphiti/task-entry-preferences.js +4 -1
- package/src/graphiti/task-entry-project-mention.js +13 -2
- package/src/graphiti/task-entry-project-scope.js +12 -3
- package/src/graphiti/task-entry-standing-owner.js +141 -0
- package/src/graphiti/task-knowledge-checkpoint.js +212 -0
- package/src/graphiti/task-knowledge-guidance.js +13 -0
- package/src/graphiti/task-knowledge-recall.js +113 -2
- package/src/graphiti/task-preference-reader.js +1 -1
- package/src/graphiti/workflow-learning.js +38 -0
- package/src/graphiti/workspace-provider-client.js +10 -0
- package/src/http/api-router.js +13 -3
- package/src/http/standing-assignment-api-router.js +35 -0
- package/src/judgment/agent-view.js +29 -7
- package/src/judgment/conversation.js +8 -2
- package/src/judgment/engine.js +16 -4
- package/src/judgment/http.js +37 -5
- package/src/judgment/review-injection-precheck.js +97 -0
- package/src/judgment/review-suggestions.js +46 -0
- package/src/judgment/store.js +8 -0
- package/src/knowledge-hard-delete/delete-ledger.js +12 -3
- package/src/knowledge-hard-delete/recovery-gate.js +4 -4
- package/src/knowledge-owner-reads/console-port.js +8 -0
- package/src/knowledge-owner-reads/owner-proof.js +35 -0
- package/src/local-runtime/lifecycle.js +2 -1
- package/src/local-runtime/provider-readiness.js +35 -11
- package/src/mcp/instructions.js +3 -3
- package/src/mcp/preference-delivery.js +13 -3
- package/src/mcp/session-id.js +2 -0
- package/src/mcp/tool-annotations.js +3 -2
- package/src/model-backends/http.js +45 -8
- package/src/model-backends/role-settings.js +25 -3
- package/src/model-backends/role-trust.js +39 -6
- package/src/model-backends/runtime.js +10 -3
- package/src/model-backends/settings-history-list.js +132 -0
- package/src/model-backends/settings-history.js +175 -0
- package/src/native-runtime/java-runtime.js +4 -4
- package/src/presence/windows-helper-pin.js +1 -1
- package/src/semantic-version.js +5 -1
- package/src/server.js +3 -2
- package/src/setup/claude-code-config.js +1 -1
- package/src/setup/graph-runtime.js +42 -15
- package/src/setup/paths.js +2 -0
- package/src/standing-assignments/port.js +189 -44
- package/src/standing-assignments/store.js +12 -1
- package/src/standing-assignments/term-match.js +7 -0
- package/src/system/file-identity.js +11 -0
- package/src/system/platform-path.js +38 -0
- package/src/validation/values.js +22 -6
- package/dist/web/assets/EmployeeWorkbenchPage-BUMfMBc8.js +0 -3
- package/dist/web/assets/KnowledgePage-Bfbfz_Z8.js +0 -1
- package/dist/web/assets/ModelSettingsPage-C3eBDWRL.js +0 -1
- package/dist/web/assets/ModelSettingsPage-DZkrJw7R.css +0 -1
- package/dist/web/assets/index-r-WFOs21.js +0 -2
- package/dist/web/assets/project-team-api-DwP0O3rn.js +0 -1
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
3
|
+
|
|
4
|
+
import { canonicalJson } from '../../packages/roundtable/src/canonical-json.js';
|
|
5
|
+
import { openFormattedDatabase, sqliteFormat } from '../../packages/roundtable/src/storage/database-format.js';
|
|
6
|
+
import { MODEL_BACKEND_ROLES, configRevision } from './config.js';
|
|
7
|
+
import { historyEntries } from './settings-history-list.js';
|
|
8
|
+
|
|
9
|
+
// What changed in the built-in Agents' model settings, and when (rec#11
|
|
10
|
+
// D-42). model-backends.json and model-trust.sqlite hold only what is set
|
|
11
|
+
// now; this store keeps one immutable row per change saved from the console,
|
|
12
|
+
// never pruned. A settings save diffs every role's effective settings (its
|
|
13
|
+
// own settings and the connection it names) between the configuration
|
|
14
|
+
// before and after the save, and records one row for each role that changed:
|
|
15
|
+
// roles that share the saved connection change with it, and their rows name
|
|
16
|
+
// the role whose settings were saved (via). Its revisions are those
|
|
17
|
+
// configurations' revisions (config.js configRevision). A trust row is a
|
|
18
|
+
// 「只给建议」 switch or a warning acknowledgement; its revisions are the
|
|
19
|
+
// trust row's revisions. A key reference is recorded only as changed, never
|
|
20
|
+
// by its value; keys never pass here.
|
|
21
|
+
//
|
|
22
|
+
// A settings row is appended after the file was written, under its lock; a
|
|
23
|
+
// trust row after its change committed, with the time and revision read in
|
|
24
|
+
// that change's transaction. When the append fails the change stands and
|
|
25
|
+
// answers not_recorded; nothing here throws. A change that changes nothing
|
|
26
|
+
// records nothing. The first record also keeps each role's trust revision
|
|
27
|
+
// at that moment (its baseline), so a read can tell trust changes made
|
|
28
|
+
// before recording began from changes whose record was lost. How the
|
|
29
|
+
// history reads, with its markers, is settings-history-list.js.
|
|
30
|
+
|
|
31
|
+
export const MODEL_SETTINGS_HISTORY_FORMAT = sqliteFormat({
|
|
32
|
+
store: 'model-settings-history',
|
|
33
|
+
schema: `
|
|
34
|
+
CREATE TABLE IF NOT EXISTS settings_changes(
|
|
35
|
+
change_id TEXT PRIMARY KEY, changed_at TEXT NOT NULL, role TEXT NOT NULL,
|
|
36
|
+
kind TEXT NOT NULL CHECK(kind IN ('settings', 'suggestions_only', 'warning_acknowledged')),
|
|
37
|
+
from_revision TEXT, to_revision TEXT NOT NULL, changes TEXT NOT NULL, via TEXT);
|
|
38
|
+
CREATE INDEX IF NOT EXISTS settings_changes_role ON settings_changes(role);
|
|
39
|
+
CREATE TABLE IF NOT EXISTS trust_baselines(role TEXT PRIMARY KEY, revision INTEGER NOT NULL);
|
|
40
|
+
CREATE TRIGGER IF NOT EXISTS settings_changes_no_replace BEFORE INSERT ON settings_changes
|
|
41
|
+
WHEN EXISTS (SELECT 1 FROM settings_changes WHERE change_id = NEW.change_id)
|
|
42
|
+
BEGIN SELECT RAISE(ABORT, 'model settings changes are immutable'); END;
|
|
43
|
+
CREATE TRIGGER IF NOT EXISTS settings_changes_no_update BEFORE UPDATE ON settings_changes
|
|
44
|
+
BEGIN SELECT RAISE(ABORT, 'model settings changes are immutable'); END;
|
|
45
|
+
CREATE TRIGGER IF NOT EXISTS settings_changes_no_delete BEFORE DELETE ON settings_changes
|
|
46
|
+
BEGIN SELECT RAISE(ABORT, 'model settings changes are immutable'); END;
|
|
47
|
+
CREATE TRIGGER IF NOT EXISTS trust_baselines_no_replace BEFORE INSERT ON trust_baselines
|
|
48
|
+
WHEN EXISTS (SELECT 1 FROM trust_baselines WHERE role = NEW.role)
|
|
49
|
+
BEGIN SELECT RAISE(ABORT, 'trust baselines are immutable'); END;
|
|
50
|
+
CREATE TRIGGER IF NOT EXISTS trust_baselines_no_update BEFORE UPDATE ON trust_baselines
|
|
51
|
+
BEGIN SELECT RAISE(ABORT, 'trust baselines are immutable'); END;
|
|
52
|
+
CREATE TRIGGER IF NOT EXISTS trust_baselines_no_delete BEFORE DELETE ON trust_baselines
|
|
53
|
+
BEGIN SELECT RAISE(ABORT, 'trust baselines are immutable'); END;`
|
|
54
|
+
});
|
|
55
|
+
const LIST_LIMIT = 50;
|
|
56
|
+
export const MAX_HISTORY_LIMIT = 200;
|
|
57
|
+
// Recorded as changed only, without its value.
|
|
58
|
+
const REFERENCE_FIELDS = new Set(['connection.secretRef']);
|
|
59
|
+
|
|
60
|
+
// readConfig: the current model-backends.json as config.js reads it;
|
|
61
|
+
// readTrustRevision(role): the role's current trust row revision (role-trust.js).
|
|
62
|
+
export function createModelSettingsHistory({
|
|
63
|
+
path = ':memory:', readConfig, readTrustRevision = () => 0, now = () => new Date(),
|
|
64
|
+
warn = message => process.stderr.write(`${message}\n`)
|
|
65
|
+
}) {
|
|
66
|
+
let database = null;
|
|
67
|
+
// Opened on first change; a read of a missing file creates nothing.
|
|
68
|
+
const open = () => (database ??= openFormattedDatabase(path, MODEL_SETTINGS_HISTORY_FORMAT));
|
|
69
|
+
const readable = () => database || path === ':memory:' || existsSync(path);
|
|
70
|
+
|
|
71
|
+
// Appends the rows of one change together. 'recorded', 'unchanged', or
|
|
72
|
+
// 'not_recorded' when the store could not take them: the change itself
|
|
73
|
+
// stands. committedTrust: the role and revision a trust change started
|
|
74
|
+
// from, its baseline if this is the first record.
|
|
75
|
+
function record(kind, rows, { changedAt = now().toISOString(), committedTrust = null } = {}) {
|
|
76
|
+
if (!rows.length) return 'unchanged';
|
|
77
|
+
let db = null;
|
|
78
|
+
try {
|
|
79
|
+
db = open();
|
|
80
|
+
db.exec('BEGIN IMMEDIATE');
|
|
81
|
+
if (!db.prepare('SELECT 1 FROM trust_baselines LIMIT 1').get()) {
|
|
82
|
+
const baseline = db.prepare('INSERT INTO trust_baselines VALUES(?, ?)');
|
|
83
|
+
for (const role of MODEL_BACKEND_ROLES) {
|
|
84
|
+
baseline.run(role, role === committedTrust?.role ? committedTrust.revision : readTrustRevision(role));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const insert = db.prepare('INSERT INTO settings_changes VALUES(?, ?, ?, ?, ?, ?, ?, ?)');
|
|
88
|
+
for (const row of rows) {
|
|
89
|
+
insert.run(randomUUID(), changedAt, row.role, kind, row.fromRevision, row.toRevision, JSON.stringify(row.changes), row.via ?? null);
|
|
90
|
+
}
|
|
91
|
+
db.exec('COMMIT');
|
|
92
|
+
return 'recorded';
|
|
93
|
+
} catch (error) {
|
|
94
|
+
try {
|
|
95
|
+
if (db?.isTransaction) db.exec('ROLLBACK');
|
|
96
|
+
warn(`The ${kind} change of ${rows.map(row => row.role).join(', ')} was saved, but its change history was not recorded: `
|
|
97
|
+
+ `${error?.message ?? error}`);
|
|
98
|
+
} catch {
|
|
99
|
+
// The warning is a courtesy; the answer says not_recorded either way.
|
|
100
|
+
}
|
|
101
|
+
return 'not_recorded';
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Every row in append order, and the baselines: settings rows are
|
|
106
|
+
// appended under the file's lock, so their order is the order of the
|
|
107
|
+
// saves. A person's changes are few, so the whole store is read.
|
|
108
|
+
function stored() {
|
|
109
|
+
if (!readable()) return { rows: [], baselines: new Map() };
|
|
110
|
+
const db = open();
|
|
111
|
+
return { rows: db.prepare('SELECT rowid AS seq, * FROM settings_changes ORDER BY rowid').all(),
|
|
112
|
+
baselines: new Map(db.prepare('SELECT role, revision FROM trust_baselines').all().map(row => [row.role, row.revision])) };
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return {
|
|
116
|
+
// editedRole: the role whose settings were saved. before: the
|
|
117
|
+
// configuration as config.js read it before the save; after: the configuration written.
|
|
118
|
+
recordSettings(editedRole, before, after) {
|
|
119
|
+
const previous = before.state === 'ok' ? before.config : null;
|
|
120
|
+
const fromRevision = configRevision(before);
|
|
121
|
+
const toRevision = configRevision({ state: 'ok', config: after });
|
|
122
|
+
return record('settings', MODEL_BACKEND_ROLES
|
|
123
|
+
.map(role => ({ role, fromRevision, toRevision, changes: settingsChanges(role, previous, after),
|
|
124
|
+
via: role === editedRole ? null : editedRole }))
|
|
125
|
+
.filter(row => row.changes.length));
|
|
126
|
+
},
|
|
127
|
+
// A committed trust change from one row revision to the next at changedAt; field names the changed column.
|
|
128
|
+
recordTrust(role, kind, fromRevision, { field, before, after }, changedAt) {
|
|
129
|
+
return record(kind, before === after ? [] : [{ role, fromRevision: String(fromRevision), toRevision: String(fromRevision + 1),
|
|
130
|
+
changes: [{ field, before, after }] }], { changedAt, committedTrust: { role, revision: fromRevision } });
|
|
131
|
+
},
|
|
132
|
+
// Newest first, with the markers of changes that are not recorded. role
|
|
133
|
+
// null reads every role. A role without a baseline began recording now.
|
|
134
|
+
list({ role = null, limit = LIST_LIMIT } = {}) {
|
|
135
|
+
const { rows, baselines } = stored();
|
|
136
|
+
return historyEntries({ stored: rows, roles: role ? [role] : MODEL_BACKEND_ROLES, role, loaded: readConfig(),
|
|
137
|
+
baseline: each => baselines.get(each) ?? readTrustRevision(each), limit: Math.min(limit, MAX_HISTORY_LIMIT), readTrustRevision });
|
|
138
|
+
},
|
|
139
|
+
close() { database?.close(); database = null; }
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// A role's effective settings: its own settings, the connection it names,
|
|
144
|
+
// and that connection's fields, as { field, before, after } with dotted
|
|
145
|
+
// paths. A role in neither configuration has none.
|
|
146
|
+
function settingsChanges(role, before, after) {
|
|
147
|
+
const beforeRole = before?.roles[role] ?? null;
|
|
148
|
+
const afterRole = after.roles[role] ?? null;
|
|
149
|
+
if (!beforeRole && !afterRole) return [];
|
|
150
|
+
const { connection: beforeId = null, ...beforeSettings } = beforeRole ?? {};
|
|
151
|
+
const { connection: afterId = null, ...afterSettings } = afterRole ?? {};
|
|
152
|
+
const changes = [];
|
|
153
|
+
diff('settings', beforeRole ? beforeSettings : null, afterRole ? afterSettings : null, changes);
|
|
154
|
+
if (beforeId !== afterId) changes.push({ field: 'connection', before: beforeId, after: afterId });
|
|
155
|
+
diff('connection', beforeId ? before.connections[beforeId] : null, afterId ? after.connections[afterId] : null, changes);
|
|
156
|
+
return changes;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// Objects are compared field by field (a missing side reads as null), any
|
|
160
|
+
// other value as a whole.
|
|
161
|
+
function diff(field, before, after, changes) {
|
|
162
|
+
if (REFERENCE_FIELDS.has(field)) {
|
|
163
|
+
if ((before ?? null) !== (after ?? null)) changes.push({ field, changed: true });
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
if ((isObject(before) || isObject(after)) && (isObject(before) || before == null) && (isObject(after) || after == null)) {
|
|
167
|
+
for (const key of new Set([...Object.keys(before ?? {}), ...Object.keys(after ?? {})])) {
|
|
168
|
+
diff(`${field}.${key}`, before?.[key] ?? null, after?.[key] ?? null, changes);
|
|
169
|
+
}
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
if (canonicalJson(before ?? null) !== canonicalJson(after ?? null)) changes.push({ field, before: before ?? null, after: after ?? null });
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const isObject = value => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { execFile } from 'node:child_process';
|
|
2
2
|
import { posix } from 'node:path';
|
|
3
|
+
import { nonEmptyText } from '../validation/values.js';
|
|
3
4
|
|
|
4
5
|
// Only macOS and Linux resolve a system JDK; Windows uses the bundled runtime.
|
|
5
6
|
const { isAbsolute, join } = posix;
|
|
@@ -8,7 +9,7 @@ export async function resolveNativeJavaHome(env, {
|
|
|
8
9
|
platform = process.platform, arch = process.arch, run = commandResult
|
|
9
10
|
} = {}) {
|
|
10
11
|
if (!['arm64', 'x64'].includes(arch)) throw new Error('Unsupported native Neo4j host architecture.');
|
|
11
|
-
const configured =
|
|
12
|
+
const configured = nonEmptyText(env.FULI_NATIVE_JAVA_HOME) ?? nonEmptyText(env.JAVA_HOME);
|
|
12
13
|
if (configured) {
|
|
13
14
|
if (!isAbsolute(configured)) throw new Error('Java 21 home must be an absolute path.');
|
|
14
15
|
const home = await verifiedHome(join(configured, 'bin', 'java'));
|
|
@@ -18,7 +19,7 @@ export async function resolveNativeJavaHome(env, {
|
|
|
18
19
|
if (platform === 'darwin') {
|
|
19
20
|
for (const [command, args] of [['/usr/libexec/java_home', ['-v', '21']], ['brew', ['--prefix', 'openjdk@21']]]) {
|
|
20
21
|
const found = await run(command, args, { env });
|
|
21
|
-
const candidate =
|
|
22
|
+
const candidate = nonEmptyText(found.stdout);
|
|
22
23
|
if (found.status === 0 && candidate && isAbsolute(candidate)) {
|
|
23
24
|
const home = await verifiedHome(join(candidate, 'bin', 'java'));
|
|
24
25
|
if (home) return home;
|
|
@@ -31,7 +32,7 @@ export async function resolveNativeJavaHome(env, {
|
|
|
31
32
|
const result = await run(command, ['-XshowSettings:properties', '-version'], { env });
|
|
32
33
|
if (result.status !== 0) return null;
|
|
33
34
|
const text = `${result.stdout}\n${result.stderr}`;
|
|
34
|
-
const property = name =>
|
|
35
|
+
const property = name => nonEmptyText(new RegExp(`^\\s*${name.replaceAll('.', '\\.')}\\s*=\\s*(.+)$`, 'm').exec(text)?.[1]);
|
|
35
36
|
const version = property('java.version'), javaArch = property('os.arch'), home = property('java.home');
|
|
36
37
|
if (!/^21(?:\.|$)/.test(version ?? '') || !home || !isAbsolute(home)) return null;
|
|
37
38
|
const compatible = arch === 'arm64' ? ['aarch64', 'arm64'] : ['amd64', 'x86_64', 'x64'];
|
|
@@ -39,7 +40,6 @@ export async function resolveNativeJavaHome(env, {
|
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
function nonEmpty(value) { return typeof value === 'string' && value.trim() ? value.trim() : null; }
|
|
43
43
|
function commandResult(command, args, { env }) {
|
|
44
44
|
return new Promise(resolve => execFile(command, args, {
|
|
45
45
|
env, timeout: 10_000, encoding: 'utf8', maxBuffer: 1024 * 1024, windowsHide: true
|
|
@@ -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 = '7335d962b0b06cfc380f21bdd5540e74f8922b9d6e6de1544fbe04350dc23520';
|
package/src/semantic-version.js
CHANGED
|
@@ -35,8 +35,12 @@ export function parseSemanticVersion(value) {
|
|
|
35
35
|
if (numeric.some((part) => part.length > 1 && part.startsWith('0'))) {
|
|
36
36
|
throw new TypeError(`Invalid package version: ${text}`);
|
|
37
37
|
}
|
|
38
|
+
const prerelease = match[4]?.split('.') ?? [];
|
|
39
|
+
if (prerelease.some((part) => /^\d+$/.test(part) && part.length > 1 && part.startsWith('0'))) {
|
|
40
|
+
throw new TypeError(`Invalid package version: ${text}`);
|
|
41
|
+
}
|
|
38
42
|
return {
|
|
39
43
|
core: numeric.map((part) => BigInt(part)),
|
|
40
|
-
prerelease
|
|
44
|
+
prerelease
|
|
41
45
|
};
|
|
42
46
|
}
|
package/src/server.js
CHANGED
|
@@ -108,9 +108,10 @@ export async function createServer(options = {}) {
|
|
|
108
108
|
// The person's own tag changes and tag governance (rec#11 D-07 part 2), console only.
|
|
109
109
|
const knowledgeTags = options.knowledgeTags ?? (localOptions.runtimeConfigPath
|
|
110
110
|
? createKnowledgeTagsConsole(dirname(localOptions.runtimeConfigPath)) : null);
|
|
111
|
-
// Saves a built-in Agent's model settings; reached only by the loopback route.
|
|
111
|
+
// Saves a built-in Agent's model settings, recording what changed; reached only by the loopback route.
|
|
112
112
|
const modelRoleSettings = options.modelRoleSettings ?? (localOptions.runtimeConfigPath
|
|
113
|
-
? createModelRoleSettings(resolveSetupPaths({ dataDir: dirname(localOptions.runtimeConfigPath) }).modelBackendConfigPath
|
|
113
|
+
? createModelRoleSettings(resolveSetupPaths({ dataDir: dirname(localOptions.runtimeConfigPath) }).modelBackendConfigPath,
|
|
114
|
+
{ history: application.modelSettingsHistory }) : null);
|
|
114
115
|
// The latest local evaluation of a role's model, as the model settings page shows it (rec#10 D-36.6).
|
|
115
116
|
const readModelEvaluation = options.readModelEvaluation ?? (localOptions.runtimeConfigPath
|
|
116
117
|
? key => latestEvaluation(resolveSetupPaths({ dataDir: dirname(localOptions.runtimeConfigPath) }).modelEvaluationsPath, key) : null);
|
|
@@ -215,7 +215,7 @@ function assertHookSettings(value) {
|
|
|
215
215
|
throw new TypeError(`Claude Code hook event ${event} must be an array`);
|
|
216
216
|
}
|
|
217
217
|
for (const group of groups) {
|
|
218
|
-
assertJsonObject(group,
|
|
218
|
+
assertJsonObject(group, 'Claude Code hook group');
|
|
219
219
|
if (!Array.isArray(group.hooks)) {
|
|
220
220
|
throw new TypeError(`Claude Code ${event} hook group must contain hooks`);
|
|
221
221
|
}
|
|
@@ -57,9 +57,13 @@ export {
|
|
|
57
57
|
selectDockerEnvironment
|
|
58
58
|
} from './container-runtime.js';
|
|
59
59
|
import { isProcessAlive, stopProcess } from '../local-runtime/processes.js';
|
|
60
|
-
import { isManagedWorkspace, waitForProviderHealth } from '../local-runtime/provider-readiness.js';
|
|
60
|
+
import { isManagedWorkspace, waitForProviderHealth, waitUntilReady } from '../local-runtime/provider-readiness.js';
|
|
61
61
|
import { parseProviderEnv } from './provider-env.js';
|
|
62
62
|
|
|
63
|
+
const CONSOLE_READY_TIMEOUT_MS = 60_000;
|
|
64
|
+
const CONSOLE_READY_INTERVAL_MS = 250;
|
|
65
|
+
const CONSOLE_HEALTH_TIMEOUT_MS = 2500;
|
|
66
|
+
|
|
63
67
|
export async function ensureGraphRuntime(input, dependencies = {}) {
|
|
64
68
|
const deps = graphDependencies(dependencies);
|
|
65
69
|
const runtimeSettings = normalizeRuntimeSettings(input.runtimeSettings ??
|
|
@@ -219,9 +223,14 @@ export async function ensureGraphRuntime(input, dependencies = {}) {
|
|
|
219
223
|
env: input.env ?? process.env
|
|
220
224
|
});
|
|
221
225
|
const url = `http://127.0.0.1:${runtimeSettings.ports.console}`;
|
|
222
|
-
|
|
226
|
+
const consoleStart = Number.isInteger(child.pid) ? await waitForWeb(url, child.pid, deps) : 'abandoned';
|
|
227
|
+
if (consoleStart !== 'ready') {
|
|
223
228
|
if (Number.isInteger(child.pid)) deps.stopProcess(child.pid);
|
|
224
|
-
throw new Error(
|
|
229
|
+
throw new Error(consoleStartFailure(consoleStart, {
|
|
230
|
+
url,
|
|
231
|
+
providerUrls: input.personalOnly ? [urls.personal] : [urls.personal, urls.workspace],
|
|
232
|
+
logPath: input.paths.logPath
|
|
233
|
+
}));
|
|
225
234
|
}
|
|
226
235
|
const state = {
|
|
227
236
|
version: 4,
|
|
@@ -468,13 +477,29 @@ async function findOrCreateSpace(baseUrl, { token, name, kind, fetchImpl }) {
|
|
|
468
477
|
});
|
|
469
478
|
}
|
|
470
479
|
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
480
|
+
// The console loads the whole server before it listens; on a slow file system
|
|
481
|
+
// (WSL reading the package from /mnt) that took 16 s, so 10 s was not enough.
|
|
482
|
+
// The budget is wall-clock time: a slow health answer counts against it.
|
|
483
|
+
function waitForWeb(url, pid, deps) {
|
|
484
|
+
return waitUntilReady((budgetMs) => deps.webHealth(url, pid, 4, budgetMs), {
|
|
485
|
+
timeoutMs: CONSOLE_READY_TIMEOUT_MS,
|
|
486
|
+
intervalMs: CONSOLE_READY_INTERVAL_MS,
|
|
487
|
+
probeTimeoutMs: CONSOLE_HEALTH_TIMEOUT_MS,
|
|
488
|
+
wait: deps.wait,
|
|
489
|
+
now: deps.now,
|
|
490
|
+
abandon: () => !deps.isProcessAlive(pid)
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
// By now Neo4j and the Provider run and the graph is set up; only the console
|
|
495
|
+
// failed. Say so, so a person neither assumes nothing started nor loses track of it.
|
|
496
|
+
function consoleStartFailure(outcome, { url, providerUrls, logPath }) {
|
|
497
|
+
const problem = outcome === 'timed_out'
|
|
498
|
+
? `The Fuli console did not answer at ${url} within ${CONSOLE_READY_TIMEOUT_MS / 1000} s, so it was stopped.`
|
|
499
|
+
: 'The Fuli console exited while starting.';
|
|
500
|
+
return `${problem} Neo4j and the graph Provider are already running (${providerUrls.join(', ')}) ` +
|
|
501
|
+
`and your data is kept. The console's output is in ${logPath}. ` +
|
|
502
|
+
'Run the same command again to retry, or run `fuli stop` to stop the graph services.';
|
|
478
503
|
}
|
|
479
504
|
|
|
480
505
|
export function startGraphProviders(paths, envPath, options = {}) {
|
|
@@ -566,6 +591,8 @@ function graphDependencies(overrides) {
|
|
|
566
591
|
discoverLanAddresses,
|
|
567
592
|
createLanAccessToken: secret,
|
|
568
593
|
waitForExit: waitForProcessExit,
|
|
594
|
+
wait: delay,
|
|
595
|
+
now: Date.now,
|
|
569
596
|
...overrides
|
|
570
597
|
};
|
|
571
598
|
}
|
|
@@ -604,11 +631,11 @@ export async function readLocalConsoleVersion(url) {
|
|
|
604
631
|
}
|
|
605
632
|
}
|
|
606
633
|
|
|
607
|
-
|
|
634
|
+
// timeoutMs bounds the whole check, including the legacy state fallback.
|
|
635
|
+
export async function checkLocalConsoleHealth(url, expectedPid, stateVersion = 3, timeoutMs = CONSOLE_HEALTH_TIMEOUT_MS) {
|
|
636
|
+
const signal = AbortSignal.timeout(timeoutMs);
|
|
608
637
|
try {
|
|
609
|
-
const response = await fetch(`${url}/api/health`, {
|
|
610
|
-
signal: AbortSignal.timeout(2500)
|
|
611
|
-
});
|
|
638
|
+
const response = await fetch(`${url}/api/health`, { signal });
|
|
612
639
|
if (response.ok) {
|
|
613
640
|
const body = await response.json();
|
|
614
641
|
return body?.service === 'fuli-local-console' &&
|
|
@@ -620,7 +647,7 @@ export async function checkLocalConsoleHealth(url, expectedPid, stateVersion = 3
|
|
|
620
647
|
}
|
|
621
648
|
|
|
622
649
|
try {
|
|
623
|
-
return (await fetch(`${url}/api/state`, { signal
|
|
650
|
+
return (await fetch(`${url}/api/state`, { signal })).ok;
|
|
624
651
|
} catch {
|
|
625
652
|
return false;
|
|
626
653
|
}
|
package/src/setup/paths.js
CHANGED
|
@@ -39,6 +39,8 @@ export function resolveSetupPaths({
|
|
|
39
39
|
roleWorkPath: join(resolvedDataDir, 'role-work.sqlite'),
|
|
40
40
|
roleSuggestionsPath: join(resolvedDataDir, 'role-suggestions.sqlite'),
|
|
41
41
|
modelTrustPath: join(resolvedDataDir, 'model-trust.sqlite'),
|
|
42
|
+
modelSettingsHistoryPath: join(resolvedDataDir, 'model-settings-history.sqlite'),
|
|
43
|
+
standingAssignmentsPath: join(resolvedDataDir, 'standing-assignments.sqlite'),
|
|
42
44
|
modelEvaluationsPath: join(resolvedDataDir, 'model-evaluations.json'),
|
|
43
45
|
nativeRuntimeDir,
|
|
44
46
|
nativeRuntimeManifestPath: join(nativeRuntimeDir, 'manifest.json'),
|