fuli-context 0.22.1 → 0.23.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.
Files changed (365) hide show
  1. package/dist/web/assets/AboutPage-CRIF2M8n.js +1 -0
  2. package/dist/web/assets/AgentHand-Dp9TFS4q.js +1 -0
  3. package/dist/web/assets/AgentMentionCopy-BXOrsEWh.css +1 -0
  4. package/dist/web/assets/AgentMentionCopy-C7N92Shm.js +1 -0
  5. package/dist/web/assets/AgentName-CbsQ9vDy.js +1 -0
  6. package/dist/web/assets/{AgentProfilePage-MkP7Lgo6.css → AgentProfilePage-B_V-Dm8v.css} +1 -1
  7. package/dist/web/assets/AgentProfilePage-DOpq0b3j.js +2 -0
  8. package/dist/web/assets/AgentServicesPage-Dr9WU0f9.js +1 -0
  9. package/dist/web/assets/AgentWorkbench-CMoeT-BY.css +1 -0
  10. package/dist/web/assets/AgentWorkbench-DTWZFf1A.js +2 -0
  11. package/dist/web/assets/AgentsDirectoryPage-CxDOdNxT.js +1 -0
  12. package/dist/web/assets/{AgentsDirectoryPage-Cq1z926q.css → AgentsDirectoryPage-DjEfG9dC.css} +1 -1
  13. package/dist/web/assets/BackLink-ByRr21Sw.js +1 -0
  14. package/dist/web/assets/BoardMoveMenu-Bd1T62eA.js +1 -0
  15. package/dist/web/assets/CaptureChangePage-DyuSSSDE.js +1 -0
  16. package/dist/web/assets/Card-BD5ohuk8.js +1 -0
  17. package/dist/web/assets/CardHeader-DTVqXpsf.js +1 -0
  18. package/dist/web/assets/CardTitle-C5REIVlp.js +1 -0
  19. package/dist/web/assets/ConnectionsPage-CKruAjBF.js +1 -0
  20. package/dist/web/assets/CreateProjectDialog-D6JS3RtH.js +2 -0
  21. package/dist/web/assets/DataFormatPage-DNaogYjf.js +2 -0
  22. package/dist/web/assets/DialogFooter-C5AIwQ5R.js +1 -0
  23. package/dist/web/assets/EmployeeScopeDialog-Lmfos9SA.js +1 -0
  24. package/dist/web/assets/EmployeeTaskBoard-U3KmfQG3.js +3 -0
  25. package/dist/web/assets/EmployeeWorkbenchPage-O9DEMzLT.js +3 -0
  26. package/dist/web/assets/FieldDescription-_fuW5MBO.js +1 -0
  27. package/dist/web/assets/GrowthLoading--m-lSUeo.js +1 -0
  28. package/dist/web/assets/InboxPage-DmJfYzaK.js +4 -0
  29. package/dist/web/assets/Input-DqjML-Qy.js +1 -0
  30. package/dist/web/assets/KnowledgeHardDeleteSection-AFg1ybWc.js +1 -0
  31. package/dist/web/assets/KnowledgeItemEditPage-B29px-r0.js +1 -0
  32. package/dist/web/assets/KnowledgeItemSummaryCard-BhHet9HU.js +1 -0
  33. package/dist/web/assets/KnowledgeOrganizerPage-BfD42JmC.js +1 -0
  34. package/dist/web/assets/KnowledgePage-nbTejsvV.js +1 -0
  35. package/dist/web/assets/KnowledgePeek-ByakOiOO.js +2 -0
  36. package/dist/web/assets/{KnowledgePeek-DdxwAWYs.css → KnowledgePeek-CK2RKeRx.css} +1 -1
  37. package/dist/web/assets/KnowledgeTurnReceiptPage-B1fMTy2W.js +1 -0
  38. package/dist/web/assets/KnowledgeWorkspace-DCzwenHE.js +4 -0
  39. package/dist/web/assets/{KnowledgeWorkspace-CA8oxVht.css → KnowledgeWorkspace-j8xlGwtg.css} +1 -1
  40. package/dist/web/assets/Label-CufKLEgT.js +1 -0
  41. package/dist/web/assets/ModelSettingsPage-jQKn4MsB.js +1 -0
  42. package/dist/web/assets/NotFoundPage-B4KkZO2q.js +1 -0
  43. package/dist/web/assets/OccupationsPage-5Ja81Cfg.js +1 -0
  44. package/dist/web/assets/OverviewPage-C-K4KDNM.js +2 -0
  45. package/dist/web/assets/PersonalProfilePage-BVZ3WHmf.js +1 -0
  46. package/dist/web/assets/PersonalProjectsPage-C1J8Poj8.js +1 -0
  47. package/dist/web/assets/PopperContent-C-KMpRbF.js +1 -0
  48. package/dist/web/assets/Presence-B4aVQMT8.js +3 -0
  49. package/dist/web/assets/ProjectAgentDetailPage-B6bTOIhe.js +8 -0
  50. package/dist/web/assets/ProjectAgentDialog-CWuqScFD.js +5 -0
  51. package/dist/web/assets/ProjectAgentFirstTask-C7qzXCQ6.js +1 -0
  52. package/dist/web/assets/ProjectAgentsPage-BNtWbct5.js +1 -0
  53. package/dist/web/assets/ProjectAgentsPage-Bym-IM4-.css +1 -0
  54. package/dist/web/assets/ProjectJudgmentPolicy-L_plkldY.js +1 -0
  55. package/dist/web/assets/ProjectScopePicker-BXy07CHg.js +1 -0
  56. package/dist/web/assets/PublicProjectsPage-Cftk4zLX.js +1 -0
  57. package/dist/web/assets/RadioGroupItem-DoOqLMbZ.js +1 -0
  58. package/dist/web/assets/RoundtablesPage-RCtrPHxs.js +1 -0
  59. package/dist/web/assets/RovingFocusGroup-BeCLKMQA.js +1 -0
  60. package/dist/web/assets/RovingFocusItem-BN-h70s_.js +1 -0
  61. package/dist/web/assets/SessionMigrationPage-Dcjylswy.js +1 -0
  62. package/dist/web/assets/SessionRecordsPage-jrFse2a1.js +1 -0
  63. package/dist/web/assets/SettingsPage-BkHm8GV4.js +1 -0
  64. package/dist/web/assets/{SettingsPage-DpVeP2OZ.css → SettingsPage-BxAXf6EF.css} +1 -1
  65. package/dist/web/assets/SharedJefaReportPage-_KXsTVGF.js +1 -0
  66. package/dist/web/assets/Switch-BPAVVtqu.js +1 -0
  67. package/dist/web/assets/TableHeader-P9d7xF7t.js +1 -0
  68. package/dist/web/assets/TabsContent-Casnps6y.js +1 -0
  69. package/dist/web/assets/TabsTrigger-AQwqcZRn.js +1 -0
  70. package/dist/web/assets/TagVocabularyPage-CsDJkbU3.js +1 -0
  71. package/dist/web/assets/TaskBlockerClear-wqHV47Vx.js +1 -0
  72. package/dist/web/assets/TaskBlockerNotice-DJytDDst.js +1 -0
  73. package/dist/web/assets/TaskExecutionPlan-8dwc8_Jf.css +1 -0
  74. package/dist/web/assets/TaskExecutionPlan-BPnu-yfT.js +2 -0
  75. package/dist/web/assets/TaskReason-C5g8DpOy.js +1 -0
  76. package/dist/web/assets/Teleport-BV0XYmdS.js +1 -0
  77. package/dist/web/assets/TextField-C69MdaFy.js +1 -0
  78. package/dist/web/assets/Textarea-D1Kzx_7L.js +1 -0
  79. package/dist/web/assets/UiChip-BqOpp18Q.js +1 -0
  80. package/dist/web/assets/UiDialog-BAWkdfF-.js +1 -0
  81. package/dist/web/assets/UiDisclosure-mGmGItAv.js +1 -0
  82. package/dist/web/assets/UiIcon-BUYpKd4D.js +1 -0
  83. package/dist/web/assets/UiIconButton-CeiP7Vmj.js +1 -0
  84. package/dist/web/assets/UiNotice-BlznzX5i.js +1 -0
  85. package/dist/web/assets/UiSegmented-DlgYMxnc.js +1 -0
  86. package/dist/web/assets/UiSelect-BWViyott.js +1 -0
  87. package/dist/web/assets/UiWeight-DZwt7cIP.js +1 -0
  88. package/dist/web/assets/UnassignedConversationsPanel-DV2CpIdb.js +1 -0
  89. package/dist/web/assets/VirtualDirectoryList-D-3X_X7D.js +1 -0
  90. package/dist/web/assets/VisuallyHiddenInput-BjPsr2D4.js +1 -0
  91. package/dist/web/assets/Workbench3D-CVlnk7bc.js +2 -0
  92. package/dist/web/assets/_plugin-vue_export-helper-lED7mxHY.js +9 -0
  93. package/dist/web/assets/accordion-GR6gjqFY.js +1 -0
  94. package/dist/web/assets/agent-pins-D2cylMl0.js +1 -0
  95. package/dist/web/assets/{agent-profile.css_vue_type_style_index_0_src_true_lang-Cmz1y1IL.js → agent-profile.css_vue_type_style_index_0_src_true_lang-w5YilVWS.js} +1 -1
  96. package/dist/web/assets/{agent-roster-records-DVgD9i6q.js → agent-roster-records-DgWGHLHW.js} +1 -1
  97. package/dist/web/assets/agent-task-board-DCS97QK2.js +1 -0
  98. package/dist/web/assets/{agent-work-summary-CUMg6XKp.js → agent-work-summary-QPOQuybY.js} +1 -1
  99. package/dist/web/assets/{attach-closest-edge-BqQXNoAj.js → attach-closest-edge-B5hSH5Q1.js} +1 -1
  100. package/dist/web/assets/{attention-store-C0D-sZNV.js → attention-store-DKza0N1e.js} +1 -1
  101. package/dist/web/assets/badge-CG2m9xwC.js +1 -0
  102. package/dist/web/assets/button-CZBMEiSm.js +1 -0
  103. package/dist/web/assets/checkbox-3VSDPUJw.js +1 -0
  104. package/dist/web/assets/{client-BgxDxCVo.js → client-Dwnwq6uu.js} +1 -1
  105. package/dist/web/assets/{client-links-store-BoDDNO2M.js → client-links-store-DG6AhNPP.js} +1 -1
  106. package/dist/web/assets/console-ny5TvCWK.js +1 -0
  107. package/dist/web/assets/conversation-launcher-settings-Ds-piWNR.js +1 -0
  108. package/dist/web/assets/{design-lab-B-njEjVo.js → design-lab-DrVlcS2x.js} +1 -1
  109. package/dist/web/assets/dialog-C3x9ziBB.js +1 -0
  110. package/dist/web/assets/dist-CB11Zet2.js +1 -0
  111. package/dist/web/assets/dropdown-menu-Cdtg4lAd.js +1 -0
  112. package/dist/web/assets/field-DMSD3CwL.js +1 -0
  113. package/dist/web/assets/{identity-IcZw_zYG.js → identity-DI_OdSEg.js} +1 -1
  114. package/dist/web/assets/index-B5zVxSJb.css +1 -0
  115. package/dist/web/assets/index-S0AnueS1.js +2 -0
  116. package/dist/web/assets/is-equal-8VOV02sH.js +1 -0
  117. package/dist/web/assets/{judgment-api-ldtIv-Jc.js → judgment-api-CwnpLQOf.js} +1 -1
  118. package/dist/web/assets/label-table-vGnKmYm3.js +1 -0
  119. package/dist/web/assets/{model-DvzuuyNk.js → model-BOXKOC62.js} +1 -1
  120. package/dist/web/assets/{model-mDDN02UJ.js → model-BlAV3okF.js} +1 -1
  121. package/dist/web/assets/{model-D2VmKHYm.js → model-C7hgak_o.js} +1 -1
  122. package/dist/web/assets/{model-2gNC7xGH.js → model-CmYu_CSs.js} +1 -1
  123. package/dist/web/assets/{model-DL29Qg9K.js → model-DSSYQ-i_.js} +1 -1
  124. package/dist/web/assets/{model-DvwLThbs.js → model-kV1gs-y2.js} +1 -1
  125. package/dist/web/assets/{motion-preference-BquW2Vpx.js → motion-preference-fHFXX4cl.js} +1 -1
  126. package/dist/web/assets/{occupation-catalog-CwMNzUWJ.js → occupation-catalog-DOk8egq8.js} +1 -1
  127. package/dist/web/assets/{orchestration-filters-DhxYUaNx.js → orchestration-filters-BqUPBFf1.js} +1 -1
  128. package/dist/web/assets/page-title-D1CadCvf.js +1 -0
  129. package/dist/web/assets/profile-model-DGbpJdVC.js +1 -0
  130. package/dist/web/assets/{project-board-layout-LQu5EwBM.js → project-board-layout-Dtyrl2is.js} +1 -1
  131. package/dist/web/assets/project-board-settings-CNVNKEfm.js +1 -0
  132. package/dist/web/assets/{project-capture-DHvCDGGz.js → project-capture-BpaGUI-m.js} +1 -1
  133. package/dist/web/assets/{project-origin-DDVfUP1_.js → project-origin-DJ4d13mb.js} +1 -1
  134. package/dist/web/assets/project-team-api-yJVsib_j.js +1 -0
  135. package/dist/web/assets/{quick-edit-api-DPb69BlT.js → quick-edit-api-CBMbWX0d.js} +1 -1
  136. package/dist/web/assets/rolldown-runtime-4tVxZq34.js +1 -0
  137. package/dist/web/assets/runtime-dom.esm-bundler-ClO7ICIC.js +2 -0
  138. package/dist/web/assets/select-CCN-VOqx.js +1 -0
  139. package/dist/web/assets/shared-report-BRgNEV5m.js +1 -0
  140. package/dist/web/assets/source-adapters-8UHmhZTa.js +1 -0
  141. package/dist/web/assets/task-labels-pCGKthln.js +1 -0
  142. package/dist/web/assets/ui-Bfbk4_Xk.js +1 -0
  143. package/dist/web/assets/{useAgentRecords-D3upwp_U.js → useAgentRecords-DZPebmJ_.js} +1 -1
  144. package/dist/web/assets/useApi-CROJJdhE-CpF4ddpD.js +1 -0
  145. package/dist/web/assets/useDirection-DXu4lssv.js +1 -0
  146. package/dist/web/assets/useFocusReturn-DVcg2RDp.js +1 -0
  147. package/dist/web/assets/useForwardExpose-CNq5826B.js +1 -0
  148. package/dist/web/assets/useKnowledgeItemPeek-CxwXNZqm.js +1 -0
  149. package/dist/web/assets/useMinimumLoadingDisplay-SSJELjga.js +1 -0
  150. package/dist/web/assets/usePrimitiveElement-WBpNZTN_.js +1 -0
  151. package/dist/web/assets/useRoutePeek-U71ADWt0.js +1 -0
  152. package/dist/web/assets/{useTypeahead-C4mRUlUC.js → useTypeahead-CJkAiAa9.js} +1 -1
  153. package/dist/web/assets/utils-CfVEk15i.js +1 -0
  154. package/dist/web/assets/vue-router-BFTYTsOL.js +1 -0
  155. package/dist/web/index.html +46 -41
  156. package/docs/agent-conversations-and-collaboration.md +23 -9
  157. package/docs/agent-interface-architecture.md +25 -0
  158. package/docs/client-connections.md +47 -0
  159. package/docs/client-links.md +4 -0
  160. package/docs/employee-agents.md +1 -1
  161. package/graph-provider/fuli_graph/agent_conversation_models.py +2 -1
  162. package/graph-provider/fuli_graph/conversation_context.py +40 -90
  163. package/graph-provider/fuli_graph/store_agent_conversations.py +26 -15
  164. package/graph-provider/pyproject.toml +1 -1
  165. package/native/win32/fuli-win-helper.exe +0 -0
  166. package/npm-shrinkwrap.json +31 -31
  167. package/package.json +3 -3
  168. package/skills/capturing-session-knowledge/SKILL.md +7 -0
  169. package/skills/capturing-session-knowledge/references/coordination.md +4 -0
  170. package/skills/capturing-session-knowledge/references/retrieval.md +7 -0
  171. package/skills/operating-fuli/SKILL.md +3 -2
  172. package/skills/operating-fuli/references/workflow-recipes.md +4 -1
  173. package/src/agent-apps/host-tools/catalog.js +4 -0
  174. package/src/agent-kits/client-installer.js +29 -0
  175. package/src/agent-kits/derived-file.js +15 -0
  176. package/src/agent-kits/executable-download.js +53 -0
  177. package/src/agent-kits/executables.js +87 -0
  178. package/src/agent-kits/fuli-installer-manifest.json +125 -0
  179. package/src/agent-kits/installer-manifest.js +36 -0
  180. package/src/agent-kits/installer-shadow.js +82 -0
  181. package/src/agent-kits/launcher-host-config.js +56 -0
  182. package/src/agent-kits/pins.js +49 -0
  183. package/src/agent-kits/ports.js +13 -0
  184. package/src/agent-kits/session-clients.js +57 -0
  185. package/src/agent-kits/session-launcher.js +55 -0
  186. package/src/agent-kits/session-offers.js +67 -0
  187. package/src/agent-kits/vendor/agent-installer/LICENSE +21 -0
  188. package/src/agent-kits/vendor/agent-installer/README.md +9 -0
  189. package/src/agent-kits/vendor/agent-installer/index.d.ts +129 -0
  190. package/src/agent-kits/vendor/agent-installer/index.mjs +188 -0
  191. package/src/agent-kits/vendor/agent-session-launcher/LICENSE +21 -0
  192. package/src/agent-kits/vendor/agent-session-launcher/README.md +9 -0
  193. package/src/agent-kits/vendor/agent-session-launcher/index.d.ts +101 -0
  194. package/src/agent-kits/vendor/agent-session-launcher/index.mjs +159 -0
  195. package/src/agent-tools/agent-conversation-definitions.js +1 -1
  196. package/src/agent-tools/agent-workflow-definitions.js +49 -0
  197. package/src/agent-tools/graph-definitions.js +2 -0
  198. package/src/agent-tools/graph-handlers.js +2 -0
  199. package/src/agent-tools/interface-catalog.js +4 -1
  200. package/src/agent-tools/knowledge-definitions.js +7 -0
  201. package/src/agent-workflows/agent-tools.js +59 -0
  202. package/src/agent-workflows/port.js +179 -0
  203. package/src/agent-workflows/store.js +156 -0
  204. package/src/agents/claude-code/conversation-transcript.js +8 -0
  205. package/src/agents/claude-code/lifecycle-hook.js +9 -0
  206. package/src/agents/claude-code/session-client.js +29 -0
  207. package/src/agents/codex/conversation-transcript.js +6 -0
  208. package/src/agents/identity-receipt.js +1 -0
  209. package/src/data-format/local-stores.js +7 -1
  210. package/src/desktop/windows-desktop-client.js +120 -0
  211. package/src/desktop/windows-rollback-command.js +6 -2
  212. package/src/desktop/windows-rollback.js +7 -1
  213. package/src/desktop/windows-tray-update.js +19 -31
  214. package/src/desktop/windows-uninstall-command.js +2 -1
  215. package/src/desktop/windows-uninstall.js +10 -4
  216. package/src/desktop/windows-update-command.js +7 -2
  217. package/src/desktop/windows-update-lock.js +9 -7
  218. package/src/desktop/windows-update.js +7 -1
  219. package/src/employees/recruitment.js +12 -3
  220. package/src/graphiti/agent-conversations.js +1 -1
  221. package/src/graphiti/current-project-knowledge-search.js +3 -2
  222. package/src/graphiti/federated-search.js +4 -2
  223. package/src/graphiti/fla-mention.js +25 -8
  224. package/src/graphiti/fla-picker.js +25 -4
  225. package/src/graphiti/knowledge-result-budget.js +63 -9
  226. package/src/graphiti/local-runtimes.js +4 -0
  227. package/src/graphiti/project-agent-task-entry.js +8 -3
  228. package/src/graphiti/task-entry-named-fla.js +41 -19
  229. package/src/http/agent-workflows-api-router.js +36 -0
  230. package/src/http/api-router.js +9 -0
  231. package/src/http/doctor-api-router.js +31 -0
  232. package/src/http/session-launch-api-router.js +36 -0
  233. package/src/mcp/process-registry.js +12 -6
  234. package/src/mcp/session-id.js +1 -0
  235. package/src/mcp/tool-annotations.js +2 -0
  236. package/src/native-runtime/neo4j-install.js +6 -23
  237. package/src/native-runtime/resumable-download.js +24 -0
  238. package/src/native-runtime/windows-assets.js +30 -13
  239. package/src/native-runtime/windows-processes.js +5 -2
  240. package/src/presence/windows-helper-pin.js +1 -1
  241. package/src/server.js +2 -1
  242. package/src/setup/paths.js +3 -0
  243. package/src/system/console-update.js +10 -2
  244. package/src/system/detached-job.js +8 -0
  245. package/src/system/doctor-repair.js +61 -0
  246. package/src/system/doctor.js +119 -0
  247. package/src/system/package-version-checker.js +8 -1
  248. package/src/system/system-service.js +52 -13
  249. package/src/text/token-estimate.js +11 -0
  250. package/dist/web/assets/AboutPage-45tAvgRN.js +0 -1
  251. package/dist/web/assets/AgentHand-CQbDVBYv.js +0 -1
  252. package/dist/web/assets/AgentMentionCopy-BHFp527T.js +0 -1
  253. package/dist/web/assets/AgentMentionCopy-BIWsPf22.css +0 -1
  254. package/dist/web/assets/AgentName-ChhbnrG9.js +0 -1
  255. package/dist/web/assets/AgentProfilePage-ZzEtdSKe.js +0 -1
  256. package/dist/web/assets/AgentServicesPage-B92EXg56.js +0 -1
  257. package/dist/web/assets/AgentsDirectoryPage-B841hRHZ.js +0 -1
  258. package/dist/web/assets/BackLink-C0mcoSn4.js +0 -1
  259. package/dist/web/assets/BoardMoveMenu-CX8jKv0V.js +0 -1
  260. package/dist/web/assets/CaptureChangePage-B9wtEGy3.js +0 -1
  261. package/dist/web/assets/Card-BOk3WbC1.js +0 -1
  262. package/dist/web/assets/CardHeader-79hIs3Wc.js +0 -1
  263. package/dist/web/assets/CardTitle-CMWcRH62.js +0 -1
  264. package/dist/web/assets/ConnectionsPage-CCSZ-v6k.js +0 -1
  265. package/dist/web/assets/CreateProjectDialog-vDAHEZ6t.js +0 -2
  266. package/dist/web/assets/DataFormatPage-oRc6mBRh.js +0 -2
  267. package/dist/web/assets/DialogFooter-mK0XBX_L.js +0 -1
  268. package/dist/web/assets/EmployeeScopeDialog-Bp0zLRG5.js +0 -1
  269. package/dist/web/assets/EmployeeWorkbenchPage-D34173ED.js +0 -3
  270. package/dist/web/assets/FieldDescription-C33NBGIe.js +0 -1
  271. package/dist/web/assets/GrowthLoading-CTsRhLfj.js +0 -1
  272. package/dist/web/assets/InboxPage-CekhZG9R.js +0 -4
  273. package/dist/web/assets/Input-jNvD1lEt.js +0 -1
  274. package/dist/web/assets/KnowledgeHardDeleteSection-OgNe3xoA.js +0 -1
  275. package/dist/web/assets/KnowledgeItemEditPage-CxUFvj7Q.js +0 -1
  276. package/dist/web/assets/KnowledgeItemSummaryCard-CkD55bXQ.js +0 -1
  277. package/dist/web/assets/KnowledgeOrganizerPage-DTfhmq7x.js +0 -1
  278. package/dist/web/assets/KnowledgePage-D_XPxm7U.js +0 -1
  279. package/dist/web/assets/KnowledgePeek-fE8eZ9yB.js +0 -1
  280. package/dist/web/assets/KnowledgeTurnReceiptPage-CNoJA8j_.js +0 -1
  281. package/dist/web/assets/KnowledgeWorkspace-CizF6YnE.js +0 -4
  282. package/dist/web/assets/Label-BuJcMh9m.js +0 -1
  283. package/dist/web/assets/ModelSettingsPage-adiuhTSX.js +0 -1
  284. package/dist/web/assets/NotFoundPage-JAy5KIL8.js +0 -1
  285. package/dist/web/assets/OccupationsPage-DG0uQx85.js +0 -1
  286. package/dist/web/assets/OverviewPage-DwCiWNdy.js +0 -2
  287. package/dist/web/assets/PersonalProfilePage-Cb-AKL4K.js +0 -1
  288. package/dist/web/assets/PersonalProjectsPage-BT7ebQUu.js +0 -1
  289. package/dist/web/assets/PopperContent-Dtpk5py4.js +0 -1
  290. package/dist/web/assets/Presence-9_BFOmAz.js +0 -3
  291. package/dist/web/assets/ProjectAgentDetailPage-WmxfcCCM.js +0 -8
  292. package/dist/web/assets/ProjectAgentDialog-BgdFB7il.js +0 -5
  293. package/dist/web/assets/ProjectAgentFirstTask-BfX-v_g5.js +0 -1
  294. package/dist/web/assets/ProjectAgentsPage-DAlfUVqM.js +0 -1
  295. package/dist/web/assets/ProjectAgentsPage-DvJh40Xl.css +0 -1
  296. package/dist/web/assets/ProjectJudgmentPolicy-DGFTRTvW.js +0 -1
  297. package/dist/web/assets/ProjectScopePicker-wlhLR465.js +0 -1
  298. package/dist/web/assets/PublicProjectsPage-LTXsYNme.js +0 -1
  299. package/dist/web/assets/RadioGroupItem-CUyRbWCt.js +0 -1
  300. package/dist/web/assets/RoundtablesPage-slbD8isz.js +0 -1
  301. package/dist/web/assets/RovingFocusGroup-DJ9gp0xI.js +0 -1
  302. package/dist/web/assets/RovingFocusItem-BGt9xXis.js +0 -1
  303. package/dist/web/assets/SessionMigrationPage-HxM5zSjY.js +0 -1
  304. package/dist/web/assets/SessionRecordsPage-CbZ4xiIb.js +0 -1
  305. package/dist/web/assets/SettingsPage-BSXZinjo.js +0 -1
  306. package/dist/web/assets/SharedJefaReportPage-4MylH5Ao.js +0 -1
  307. package/dist/web/assets/TableHeader-aFcD9wsQ.js +0 -1
  308. package/dist/web/assets/TabsContent-ZCMehxYx.js +0 -1
  309. package/dist/web/assets/TabsTrigger-BTZQbe9n.js +0 -1
  310. package/dist/web/assets/TagVocabularyPage-CCm1HBg3.js +0 -1
  311. package/dist/web/assets/TaskBlockerClear-Dg1T2rcU.js +0 -1
  312. package/dist/web/assets/TaskBlockerNotice-DVYIiv3y.js +0 -1
  313. package/dist/web/assets/TaskExecutionPlan-B411P1VJ.js +0 -2
  314. package/dist/web/assets/TaskExecutionPlan-uimNYWdr.css +0 -1
  315. package/dist/web/assets/TaskReason-CVnoUuFe.js +0 -1
  316. package/dist/web/assets/Teleport-Co_blCnp.js +0 -1
  317. package/dist/web/assets/TextField-BqL6E9zF.js +0 -1
  318. package/dist/web/assets/Textarea-DIra6o5H.js +0 -1
  319. package/dist/web/assets/UiChip-FMcrDGe6.js +0 -1
  320. package/dist/web/assets/UiDialog-CvESkb45.js +0 -1
  321. package/dist/web/assets/UiDisclosure-D3xZRwVK.js +0 -1
  322. package/dist/web/assets/UiIcon-CSLaDsID.js +0 -1
  323. package/dist/web/assets/UiIconButton-C1o6HJ39.js +0 -1
  324. package/dist/web/assets/UiNotice-CR_4j5lF.js +0 -1
  325. package/dist/web/assets/UiSegmented-Iu9IH18R.js +0 -1
  326. package/dist/web/assets/UiSelect-Cs53P6h-.js +0 -1
  327. package/dist/web/assets/UiToggle-B2sPCVZe.css +0 -1
  328. package/dist/web/assets/UiToggle-CSb7ErVS.js +0 -1
  329. package/dist/web/assets/UiWeight-BsbP9h9p.js +0 -1
  330. package/dist/web/assets/UnassignedConversationsPanel-D2Y2Vs-z.js +0 -1
  331. package/dist/web/assets/VirtualDirectoryList-DLhTuyoY.js +0 -1
  332. package/dist/web/assets/VisuallyHiddenInput-DoZPyFZU.js +0 -1
  333. package/dist/web/assets/Workbench3D-BBEJ0vTb.js +0 -2
  334. package/dist/web/assets/_plugin-vue_export-helper-DKHjpKWY.js +0 -10
  335. package/dist/web/assets/accordion-DX4SO0oU.js +0 -1
  336. package/dist/web/assets/agent-pins-Djo8-s9j.js +0 -1
  337. package/dist/web/assets/badge-CBT_nrTA.js +0 -1
  338. package/dist/web/assets/button-BXkZ6rdB.js +0 -1
  339. package/dist/web/assets/checkbox-BPKmRFwj.js +0 -1
  340. package/dist/web/assets/console-KIWUM9xy.js +0 -1
  341. package/dist/web/assets/conversation-launcher-settings-Dfhkli80.js +0 -1
  342. package/dist/web/assets/dialog-BSKT8LUI.js +0 -1
  343. package/dist/web/assets/dist-KV3E0kAK.js +0 -1
  344. package/dist/web/assets/dropdown-menu-BMeAsFQe.js +0 -1
  345. package/dist/web/assets/field-D_zmve89.js +0 -1
  346. package/dist/web/assets/index-CyoKfCXy.js +0 -2
  347. package/dist/web/assets/index-DuLqKIn8.css +0 -1
  348. package/dist/web/assets/label-table-BAIaH-tx.js +0 -1
  349. package/dist/web/assets/page-title-B2inyRB1.js +0 -1
  350. package/dist/web/assets/profile-model-C7xYkCgE.js +0 -1
  351. package/dist/web/assets/project-team-api-DNSZitOp.js +0 -1
  352. package/dist/web/assets/select-ByHJaNRv.js +0 -1
  353. package/dist/web/assets/shared-report-ClDt0UMJ.js +0 -3
  354. package/dist/web/assets/task-labels-De_F8I3O.js +0 -1
  355. package/dist/web/assets/ui-CMR2UkVp.js +0 -1
  356. package/dist/web/assets/useApi-CROJJdhE-lwt7Bu-G.js +0 -1
  357. package/dist/web/assets/useDirection-DhUUV4Jm.js +0 -1
  358. package/dist/web/assets/useFocusReturn-ChxuGVqv.js +0 -1
  359. package/dist/web/assets/useForwardExpose-BRdp7olV.js +0 -1
  360. package/dist/web/assets/useKnowledgeItemPeek-CRNR9LmU.js +0 -1
  361. package/dist/web/assets/useMinimumLoadingDisplay-DejHIUi_.js +0 -1
  362. package/dist/web/assets/useRoutePeek-B5Ukp8vX.js +0 -1
  363. package/dist/web/assets/utils-BH3OkU12.js +0 -1
  364. package/dist/web/assets/vue-router-B6l0ZzTV.js +0 -1
  365. /package/dist/web/assets/{shared-report-CjLAmGZI.css → EmployeeTaskBoard-CjLAmGZI.css} +0 -0
@@ -2,6 +2,7 @@ import { createHash } from 'node:crypto';
2
2
  import { ApplicationError } from '../app/application-error.js';
3
3
  import { createFuliSourceMarker } from './source-marker.js';
4
4
  import { utf8Preview } from '../text/utf8-preview.js';
5
+ import { approxTokens } from '../text/token-estimate.js';
5
6
 
6
7
  export const AUTOMATIC_RECALL_BYTES = 4 * 1024;
7
8
  export const SEARCH_PAGE_BYTES = 8 * 1024;
@@ -61,11 +62,64 @@ export function budgetAutomaticRecall(value, { consoleUrl, compare }) {
61
62
  return render();
62
63
  }
63
64
 
64
- // Cursor contents are opaque hashes and offsets, never a cached authorization
65
- // or a local path. Every continuation re-runs the same scoped search first.
65
+ // view 'index' lists each record by identity, a short title and approx_tokens
66
+ // (the reading cost of its full record); ids then reads only the chosen
67
+ // records. Both narrow the same scoped search, never widen it: an id outside
68
+ // this search's results is named in ids_not_found, not read.
66
69
  export function budgetKnowledgeSearch(value, { cursor, context, consoleUrl,
67
- toolName = 'search_knowledge_graph' } = {}) {
70
+ toolName = 'search_knowledge_graph', view = 'full', ids = null } = {}) {
68
71
  value = safeSearchValue(value);
72
+ const selection = ids?.length ? selectIds(value, ids) : null;
73
+ if (selection) value = selection.value;
74
+ if (view === 'index') value = indexValue(value);
75
+ const notes = { ...(view === 'index' ? { retrieval_view: 'index', index_guidance: INDEX_GUIDANCE } : {}),
76
+ ...(selection?.missing.length ? { ids_not_found: selection.missing } : {}) };
77
+ const page = pageKnowledgeSearch(value, { cursor, consoleUrl, toolName,
78
+ context: { ...context, view, ids }, limit: SEARCH_PAGE_BYTES - jsonBytes(notes) });
79
+ return { ...page, ...notes };
80
+ }
81
+
82
+ const INDEX_GUIDANCE = 'Titles only. Pick the records this task needs by approx_tokens and relevance, '
83
+ + 'then repeat the same search and scope with ids set to them for the full records.';
84
+ const INDEX_TITLE_BYTES = 120;
85
+
86
+ // What a record's content is, without the scores and view counters a read
87
+ // itself updates.
88
+ function stableBody(item) {
89
+ const { score, weight, weight_percent, confirmed_by_person, last_agent_viewed_at, ...body } = item;
90
+ return body;
91
+ }
92
+
93
+ function indexItem(item) {
94
+ const view = itemPreview(identityPreview(item), INDEX_TITLE_BYTES);
95
+ delete view.source_uris;
96
+ delete view.source_uris_omitted;
97
+ return { ...view, approx_tokens: approxTokens(JSON.stringify(stableBody(item))) };
98
+ }
99
+
100
+ function mapGroups(value, map) {
101
+ const group = item => ({ ...item, ...Object.fromEntries(['facts', 'entities']
102
+ .filter(kind => Array.isArray(item[kind])).map(kind => [kind, map(item[kind])])) });
103
+ return Array.isArray(value.results) ? { ...value, results: value.results.map(group) } : group(value);
104
+ }
105
+
106
+ function indexValue(value) {
107
+ return mapGroups(value, items => items.map(indexItem));
108
+ }
109
+
110
+ function selectIds(value, ids) {
111
+ const wanted = new Set(ids), found = new Set();
112
+ const selected = mapGroups(value, items => items.filter(item => {
113
+ if (!wanted.has(item.id)) return false;
114
+ found.add(item.id);
115
+ return true;
116
+ }));
117
+ return { value: selected, missing: [...wanted].filter(id => !found.has(id)) };
118
+ }
119
+
120
+ // Cursor contents are opaque hashes and offsets, never a cached authorization
121
+ // or a local path. Every continuation re-runs the same scoped search first.
122
+ function pageKnowledgeSearch(value, { cursor, context, consoleUrl, toolName, limit }) {
69
123
  const compound = Array.isArray(value.results);
70
124
  const groups = compound ? value.results : [value];
71
125
  const lists = groups.map(group => {
@@ -82,7 +136,7 @@ export function budgetKnowledgeSearch(value, { cursor, context, consoleUrl,
82
136
  for (const entry of entries) {
83
137
  // Search scores/view counters are volatile; the record body stays stable
84
138
  // while a read itself updates those counters.
85
- const { score, weight, weight_percent, confirmed_by_person, last_agent_viewed_at, ...body } = entry.item;
139
+ const body = stableBody(entry.item);
86
140
  entry.serialized = JSON.stringify(body);
87
141
  }
88
142
  const digest = createHash('sha256').update(JSON.stringify({ context,
@@ -98,7 +152,7 @@ export function budgetKnowledgeSearch(value, { cursor, context, consoleUrl,
98
152
  }
99
153
  const whole = { ...(compound ? sharedScope(value, value.results) : value),
100
154
  retrieval_budget: { limit_bytes: SEARCH_PAGE_BYTES, complete: true } };
101
- if (!cursor && jsonBytes(whole) <= SEARCH_PAGE_BYTES) return whole;
155
+ if (!cursor && jsonBytes(whole) <= limit) return whole;
102
156
  const top = compound ? sharedScope(searchMetadata(value), groups.map(searchMetadata)) : null;
103
157
  const bases = compound ? top.results : [searchMetadata(value)];
104
158
  const selected = [];
@@ -119,13 +173,13 @@ export function budgetKnowledgeSearch(value, { cursor, context, consoleUrl,
119
173
  retrieval_budget: { limit_bytes: SEARCH_PAGE_BYTES, complete: !next, returned_items: selected.length,
120
174
  total_items: entries.length },
121
175
  ...(next ? { next_cursor: next, continuation_tool: 'fuli_call', continuation_tool_name: toolName,
122
- continuation_guidance: 'Repeat the same search and scope with next_cursor as cursor through fuli_call; do not widen scope.' } : {}) };
176
+ continuation_guidance: 'Repeat the same search and scope with next_cursor as cursor through fuli_call; do not widen scope. To read only some records, repeat with view index, then with their ids.' } : {}) };
123
177
  };
124
178
  for (; index < entries.length; index++, offset = 0) {
125
179
  const entry = entries[index];
126
180
  if (!offset) {
127
181
  selected.push({ ...entry, view: entry.item });
128
- if (jsonBytes(render(index + 1)) <= SEARCH_PAGE_BYTES) continue;
182
+ if (jsonBytes(render(index + 1)) <= limit) continue;
129
183
  selected.pop();
130
184
  if (selected.length) return render(index);
131
185
  }
@@ -142,14 +196,14 @@ export function budgetKnowledgeSearch(value, { cursor, context, consoleUrl,
142
196
  let low = 0, high = points.length - offset;
143
197
  while (low < high) {
144
198
  const middle = Math.ceil((low + high) / 2);
145
- if (jsonBytes(fragment(middle)) <= SEARCH_PAGE_BYTES) low = middle;
199
+ if (jsonBytes(fragment(middle)) <= limit) low = middle;
146
200
  else high = middle - 1;
147
201
  }
148
202
  if (!low) throw new ApplicationError('result_too_large', 'Search metadata exceeds the page budget; use fewer focused queries or project scopes');
149
203
  return fragment(low);
150
204
  }
151
205
  const result = render(index);
152
- if (jsonBytes(result) > SEARCH_PAGE_BYTES) throw new ApplicationError('result_too_large', 'Search metadata exceeds the page budget; use fewer focused queries');
206
+ if (jsonBytes(result) > limit) throw new ApplicationError('result_too_large', 'Search metadata exceeds the page budget; use fewer focused queries');
153
207
  return result;
154
208
  }
155
209
 
@@ -14,6 +14,7 @@ import {
14
14
  openRoleTrustAndHistory
15
15
  } from '../model-backends/runtime.js';
16
16
  import { createStandingAssignments } from '../standing-assignments/port.js';
17
+ import { createAgentWorkflows } from '../agent-workflows/port.js';
17
18
  import { createAgentDirectorySnapshots } from '../agents/directory-snapshots.js';
18
19
  import { attachExternalKnowledgeRuntime } from '../external-knowledge/runtime.js';
19
20
  import { createSessionPreferenceDelivery } from '../conversations/preference-session.js';
@@ -54,6 +55,8 @@ export function openLocalRuntimes(app, { runtimeConfigPath, paths, env, fetchImp
54
55
  app.roleSuggestions = openRoleSuggestionLog(paths, { recoveryGate: app.knowledgeRecoveryGate });
55
56
  // Opens its file on the first registration; reads before that find none.
56
57
  app.standingAssignments = createStandingAssignments({ path: paths.standingAssignmentsPath });
58
+ // Each Agent's own workflows (rec#60 D-78); the file is created by the first proposal.
59
+ app.agentWorkflows = createAgentWorkflows({ path: join(dataDir, 'agent-workflows.sqlite') });
57
60
  app.roundtableHost = createFuliRoundtableHost(app);
58
61
  app.peer = createPeerPort({ dataDir, host: app.roundtableHost });
59
62
  app.roundtable = createAgentRoundtable({
@@ -68,6 +71,7 @@ export function openLocalRuntimes(app, { runtimeConfigPath, paths, env, fetchImp
68
71
  export function closeLocalRuntimes(app) {
69
72
  app.judgment?.close();
70
73
  app.standingAssignments?.close();
74
+ app.agentWorkflows?.close();
71
75
  app.roleWork?.close();
72
76
  app.roleSuggestions?.close();
73
77
  app.modelTrust?.close();
@@ -87,13 +87,18 @@ export async function resolveTaskEntryAgent(application, resolution, input) {
87
87
  agent = projectAgentRecord(standing.agent);
88
88
  }
89
89
  }
90
+ // The client and status come first, so a scope refusal below means the scope.
91
+ const refused = agent && agentUnavailableReason(agent.profile, input.sourceApplication);
92
+ if (refused) return { status: 'agent_unavailable', reason: refused, worker_started: false };
90
93
  const employeeId = /^employee\.([a-z][a-z0-9-]{0,63})$/.exec(agent?.agentId ?? '')?.[1];
91
94
  if (employeeId && application.employees) {
92
95
  try { await application.employees.authorize({ templateId: employeeId, personalProjectId: resolution.personalProjectId }); }
93
- catch { return { status: 'agent_unavailable', worker_started: false }; }
96
+ catch (error) {
97
+ // A built-in role outside its project scope says so (rec#58); other failures stay unexplained.
98
+ return { status: 'agent_unavailable', ...(error?.code === 'assignment_required' ? { reason: 'not_responsible' } : {}),
99
+ worker_started: false };
100
+ }
94
101
  }
95
- const refused = agent && agentUnavailableReason(agent.profile, input.sourceApplication);
96
- if (refused) return { status: 'agent_unavailable', reason: refused, worker_started: false };
97
102
  return { ...value, agent, worker_started: false, ...(standingAgentUnreached ? { standingAgentUnreached } : {}) };
98
103
  } catch {
99
104
  // Preferences remain useful during an older/offline Provider upgrade, but
@@ -1,7 +1,7 @@
1
1
  import { receiptText } from '../agents/identity-receipt.js';
2
2
  import { choiceNumber, parseFlaMention } from './fla-mention.js';
3
- import { flaCandidates, flaChoice, namedAtOpening, namedByWord, narrowedByPartial, rankCandidates, typedWord,
4
- unavailableReason } from './fla-picker.js';
3
+ import { flaCandidates, flaChoice, namedAtOpening, namedByWord, narrowedByPartial, rankCandidates, roleCandidates,
4
+ typedWord, unavailableReason } from './fla-picker.js';
5
5
  import { resolveTaskAgentMention } from './project-agent-mention.js';
6
6
  import { hostInternalActivity } from './task-entry-activity-origin.js';
7
7
  import { nameableProjects } from './task-entry-project-mention.js';
@@ -50,7 +50,18 @@ const CHOOSE_GUIDANCE = 'Ask this now with the host native single-choice UI (a n
50
50
  const REASONS = Object.freeze({
51
51
  dismissed: '已被解雇', inactive: '已停用', no_project: '目前没有在任的项目',
52
52
  client_not_allowed: '不允许在当前客户端使用', not_assigned: '已不在该项目任职', not_found: '已不存在',
53
- access_denied: '无权访问该 FLA 或其项目', substituted: '服务没有选中它', unavailable: '暂时无法恢复'
53
+ access_denied: '无权访问该 FLA 或其项目', substituted: '服务没有选中它', unavailable: '暂时无法恢复',
54
+ not_responsible: '没有负责这个项目', needs_project: '只在项目里工作,当前会话不属于任何项目'
55
+ });
56
+ // The shortest legal way back, where the person has one (rec#58). Nothing here
57
+ // changes a scope or a client list: the person does that in the console.
58
+ const FIXES = Object.freeze({
59
+ client_not_allowed: ({ name }) => `可在控制台为 ${name} 允许当前客户端`,
60
+ inactive: ({ name }) => `可在控制台恢复 ${name}`,
61
+ no_project: ({ name }) => `可在控制台为 ${name} 分配项目`,
62
+ not_assigned: ({ name, project }) => `可在控制台把 ${name} 分配到 ${project}`,
63
+ not_responsible: ({ name, project }) => `可在控制台 ${name} 的「管理负责项目」里加上 ${project}`,
64
+ needs_project: ({ name }) => `请在项目文件夹里再叫 ${name}`
54
65
  });
55
66
  const QUESTIONS = Object.freeze({
56
67
  list: '要在本会话继续哪位 FLA?', partial: '找到这些 FLA,要继续哪一位?',
@@ -87,20 +98,22 @@ export async function namedFlaRequest(application, resolution, input, readSessio
87
98
  projectAgentId: home.projectAgentId ?? null } };
88
99
  let hint = null;
89
100
  if (mention || number !== null) {
90
- let candidates = null;
91
- try { candidates = await personCandidates(application); }
92
- catch { if (mention?.explicit || number !== null) return { state: 'unavailable', reason: 'unavailable', ...asked }; }
93
- if (candidates) {
94
- const ranked = rankCandidates(candidates, { currentProjectId: resolution.personalProjectId ?? null,
95
- recentAgentId: previous?.agentId ?? null });
101
+ const currentProjectId = resolution.personalProjectId ?? null;
102
+ let roster = null;
103
+ try { roster = await spaceRoster(application); }
104
+ catch { if ((mention?.explicit && !mention.inline) || number !== null) return { state: 'unavailable', reason: 'unavailable', ...asked }; }
105
+ if (roster) {
106
+ const ranked = rankCandidates(flaCandidates(roster.agents, roster.projects, roster.spaceId),
107
+ { currentProjectId, recentAgentId: previous?.agentId ?? null });
96
108
  const request = number !== null ? choose(open(ranked, input), 'choice_unknown')
97
- : mention.explicit ? explicitRequest(mention.query, ranked, resolution, input)
109
+ : mention.explicit ? explicitRequest(mention, ranked,
110
+ roleCandidates(roster.agents, roster.projects, roster.spaceId, currentProjectId), resolution, input)
98
111
  : bareRequest(mention.query, ranked, resolution, input);
99
112
  if (request) return { ...request, ...asked };
100
113
  // D-68: a bare `@word` that only starts a name stays an ordinary
101
114
  // prompt; at most it says how to choose one.
102
115
  const word = [...typedWord(mention.query)].slice(0, HINT_WORD_LIMIT).join('');
103
- if ([...word].length >= 2 && narrowedByPartial(word, open(ranked, input)).close) hint = word;
116
+ if (!mention.explicit && [...word].length >= 2 && narrowedByPartial(word, open(ranked, input)).close) hint = word;
104
117
  }
105
118
  }
106
119
  if (!previous) return hint ? { state: 'hint', query: hint } : null;
@@ -200,19 +213,23 @@ export function namedFlaReceiptNotices(task) {
200
213
  }
201
214
 
202
215
  function unavailable(target, reason, markers) {
203
- const notice = target ? `${target.name}(${target.project ?? '全局'})无法继续:${REASONS[reason] ?? REASONS.unavailable},未改用其他 FLA`
216
+ const fix = target && FIXES[reason]?.(target);
217
+ const notice = target ? `${target.name}${target.project ? `(${target.project})` : ''}无法继续:`
218
+ + `${REASONS[reason] ?? REASONS.unavailable},未改用其他 FLA${fix ? `;${fix}` : ''}`
204
219
  : reason === 'no_flas' ? '还没有可以继续的 FLA' : `无法读取你的 FLA:${REASONS[reason] ?? REASONS.unavailable}`;
205
220
  return { view: { status: 'unavailable', reason, notice, guidance: UNAVAILABLE_GUIDANCE }, notice,
206
221
  selection: { status: 'agent_unavailable', reason, worker_started: false }, markers };
207
222
  }
208
223
 
209
- // `#FLA …` / `@FLA …`: the picker, narrowed by a partial name; a single close
210
- // fit continues directly, letters in order only narrow (D-68).
211
- function explicitRequest(query, ranked, resolution, input) {
224
+ // `#FLA …` / `@FLA …`: an exact name of an FLA or of one of FULI's roles
225
+ // (rec#58), else the picker over FLAs, narrowed by a partial name; a single
226
+ // close fit continues directly, letters in order only narrow (D-68). An
227
+ // inline `#FLA` takes an exact name only: anything else is ordinary text.
228
+ function explicitRequest({ query, inline }, ranked, roles, resolution, input) {
229
+ const exact = query ? exactRequest(namedAtOpening(query, [...ranked, ...roles]), resolution, input) : null;
230
+ if (exact || inline) return exact;
212
231
  const available = open(ranked, input);
213
232
  if (!query) return choose(available, 'list');
214
- const exact = exactRequest(namedAtOpening(query, ranked), resolution, input);
215
- if (exact) return exact;
216
233
  const { close, items } = narrowedByPartial(query, available);
217
234
  if (close && items.length === 1) return { state: 'continue', target: target(items[0]), origin: 'named' };
218
235
  return items.length ? choose(items, 'partial') : choose(available, 'no_match');
@@ -283,11 +300,16 @@ async function resolvesInFolder(application, resolution, input) {
283
300
  // Every FLA of the person's own space as candidates (fla-picker.js); the
284
301
  // group discussion's member choice reads the same roster.
285
302
  export async function personCandidates(application) {
303
+ const { agents, projects, spaceId } = await spaceRoster(application);
304
+ return flaCandidates(agents, projects, spaceId);
305
+ }
306
+
307
+ // One read of the person's whole roster and nameable projects.
308
+ async function spaceRoster(application) {
286
309
  const spaceId = application.config.personal.spaceId;
287
310
  const [roster, projects] = await Promise.all([application.personal.listProjectAgents(spaceId, null),
288
311
  nameableProjects(application)]);
289
- const agents = Array.isArray(roster) ? roster : roster?.agents ?? roster?.items ?? [];
290
- return flaCandidates(agents, projects, spaceId);
312
+ return { agents: Array.isArray(roster) ? roster : roster?.agents ?? roster?.items ?? [], projects, spaceId };
291
313
  }
292
314
 
293
315
  // Read only when the FLA could not continue: its own record says why.
@@ -0,0 +1,36 @@
1
+ import { ApplicationError } from '../app/application-error.js';
2
+ import { requiredString } from '../validation/values.js';
3
+ import { refuseRemoteDecision } from './request-policy.js';
4
+ import { readJson, sendJson } from './response.js';
5
+
6
+ const LIST_PATH = '/api/agent-workflows';
7
+ const DECISION_PATH = /^\/api\/agent-workflows\/([^/]+)\/decision$/;
8
+
9
+ // An Agent's workflows on its home page (rec#60 D-78): what it proposed and
10
+ // what is active, and the person's answer to the version the page showed
11
+ // (confirm, reject, retire). Only on this computer; an Agent proposes through
12
+ // propose_agent_workflow and has no route or tool to decide.
13
+ export async function handleAgentWorkflowsRequest({ request, response, url, app }) {
14
+ const decision = url.pathname.match(DECISION_PATH);
15
+ const list = url.pathname === LIST_PATH && request.method === 'GET';
16
+ if (!list && !(decision && request.method === 'POST')) return false;
17
+ response.setHeader('Cache-Control', 'no-store');
18
+ if (refuseRemoteDecision(request, response, 'Agent workflows are decided only on this computer')) return true;
19
+ if (!app.agentWorkflows) {
20
+ sendJson(response, 503, { error: 'Agent workflows need a local FULI installation', code: 'agent_workflows_unavailable' });
21
+ return true;
22
+ }
23
+ const personalSpaceId = app.config.personal.spaceId;
24
+ if (list) {
25
+ if (url.searchParams.get('personalSpaceId') !== personalSpaceId) {
26
+ throw new ApplicationError('scope_mismatch', 'Use the active personal space', { status: 403 });
27
+ }
28
+ sendJson(response, 200, app.agentWorkflows.overview({ personalSpaceId,
29
+ agentId: requiredString(url.searchParams.get('agentId'), 'agentId', 200) }));
30
+ return true;
31
+ }
32
+ const body = await readJson(request);
33
+ sendJson(response, 200, app.agentWorkflows.decide({ personalSpaceId, workflowId: decodeURIComponent(decision[1]),
34
+ decision: body?.decision, version: body?.version }));
35
+ return true;
36
+ }
@@ -5,6 +5,8 @@ import { handleGraphApiRequest } from './graph-api-router.js';
5
5
  import { handleEmployeeApiRequest } from './employee-api-router.js';
6
6
  import { handleAgentAppApiRequest } from './agent-app-api-router.js';
7
7
  import { handleDataFormatApiRequest } from './data-format-api-router.js';
8
+ import { handleDoctorApiRequest } from './doctor-api-router.js';
9
+ import { handleSessionLaunchRequest } from './session-launch-api-router.js';
8
10
  import { handleKnowledgeHardDeleteRequest } from './knowledge-hard-delete-api-router.js';
9
11
  import { handleKnowledgeScopeRequest } from './knowledge-scope-api-router.js';
10
12
  import { handleProjectHierarchyRequest } from './project-hierarchy-api-router.js';
@@ -13,6 +15,7 @@ import { handleKnowledgeTagsRequest } from './knowledge-tags-api-router.js';
13
15
  import { handleStandingAssignmentRequest } from './standing-assignment-api-router.js';
14
16
  import { handleClientLinksRequest } from './client-links-api-router.js';
15
17
  import { handleAgentServicesRequest } from './agent-services-api-router.js';
18
+ import { handleAgentWorkflowsRequest } from './agent-workflows-api-router.js';
16
19
  import { handleRoundtableApiRequest } from '../agent-roundtable/http.js';
17
20
  import { handlePeerApiRequest } from '../agent-peer/http.js';
18
21
  import { handleJudgmentApiRequest } from '../judgment/http.js';
@@ -159,6 +162,11 @@ export async function handleApiRequest({
159
162
  return true;
160
163
  }
161
164
 
165
+ // Outside the graph runtime lease: polling the doctor never wakes a
166
+ // sleeping provider (its graph format plan then reads as unavailable).
167
+ if (await handleDoctorApiRequest({ request, response, url, system })) return true;
168
+ if (await handleSessionLaunchRequest({ request, response, url, system })) return true;
169
+
162
170
  if (system && url.pathname === '/api/system/runtime' && request.method === 'GET') {
163
171
  sendJson(response, 200, system.runtimeStatus());
164
172
  return true;
@@ -218,6 +226,7 @@ export async function handleApiRequest({
218
226
  await handleJudgmentApiRequest({ request, response, url, app, undoConsole: judgmentUndo, ownerReads: knowledgeOwnerReads }) ||
219
227
  await handleStandingAssignmentRequest({ request, response, url, app }) ||
220
228
  await handleAgentServicesRequest({ request, response, url, app }) ||
229
+ await handleAgentWorkflowsRequest({ request, response, url, app }) ||
221
230
  await handleEmployeeApiRequest({ request, response, url, app }) ||
222
231
  await handleGraphApiRequest({ request, response, url, app, ownerReads: knowledgeOwnerReads });
223
232
  if (system?.withGraphRuntimeLease && (
@@ -0,0 +1,31 @@
1
+ import { InvalidInputError } from '../app/application-error.js';
2
+ import { assertJsonObject } from '../validation/values.js';
3
+ import { refuseRemoteDecision } from './request-policy.js';
4
+ import { readJson, sendJson } from './response.js';
5
+
6
+ // FULI's 体检 (src/system/doctor.js). The read is open to the console like
7
+ // any read; the repair writes client configuration, so only a request from
8
+ // this computer may start it (local_user_only in the interface catalog).
9
+
10
+ const DOCTOR_PATH = '/api/system/doctor';
11
+ const REPAIR_PATH = '/api/system/doctor/repair';
12
+
13
+ export async function handleDoctorApiRequest({ request, response, url, system }) {
14
+ if (!system?.doctor || (url.pathname !== DOCTOR_PATH && url.pathname !== REPAIR_PATH)) return false;
15
+ response.setHeader('Cache-Control', 'no-store');
16
+ const method = url.pathname === DOCTOR_PATH ? 'GET' : 'POST';
17
+ if (request.method !== method) {
18
+ sendJson(response, 405, { error: 'Method not allowed' });
19
+ return true;
20
+ }
21
+ if (method === 'GET') {
22
+ sendJson(response, 200, await system.doctor());
23
+ return true;
24
+ }
25
+ if (refuseRemoteDecision(request, response, 'FULI is repaired only on this computer')) return true;
26
+ const body = await readJson(request);
27
+ assertJsonObject(body, 'Doctor repair');
28
+ if (Object.keys(body).length) throw new InvalidInputError('A doctor repair takes no options; send {}.');
29
+ sendJson(response, 200, await system.repairDoctor());
30
+ return true;
31
+ }
@@ -0,0 +1,36 @@
1
+ import { InvalidInputError } from '../app/application-error.js';
2
+ import { SOURCE_APPLICATIONS } from '../agents/source-applications.js';
3
+ import { CONVERSATION_LAUNCHER_APPLICATIONS } from '../system/runtime-settings.js';
4
+ import { requiredString, uniqueTextArray } from '../validation/values.js';
5
+ import { sendJson } from './response.js';
6
+
7
+ // Whether the console offers to open recorded sessions (src/agent-kits/session-offers.js).
8
+ // A read like any other: it plans links and opens nothing.
9
+ // GET /api/session-launch/offers?session=<sourceApplication>:<sessionId>&session=…
10
+ const OFFERS_PATH = '/api/session-launch/offers';
11
+ // One knowledge item's evidence; each session may start the launcher once.
12
+ const MAX_SESSIONS = 20;
13
+ const MAX_SESSION_ID = 512;
14
+ const APPLICATIONS = new Set([...SOURCE_APPLICATIONS, ...CONVERSATION_LAUNCHER_APPLICATIONS]);
15
+
16
+ export async function handleSessionLaunchRequest({ request, response, url, system }) {
17
+ if (!system?.sessionLaunchOffers || url.pathname !== OFFERS_PATH) return false;
18
+ response.setHeader('Cache-Control', 'no-store');
19
+ if (request.method !== 'GET') {
20
+ sendJson(response, 405, { error: 'Method not allowed' });
21
+ return true;
22
+ }
23
+ sendJson(response, 200, await system.sessionLaunchOffers(sessionsOf(url.searchParams.getAll('session'))));
24
+ return true;
25
+ }
26
+
27
+ function sessionsOf(values) {
28
+ return uniqueTextArray(values, 'session', MAX_SESSIONS).map((value) => {
29
+ const separator = value.indexOf(':');
30
+ const sourceApplication = value.slice(0, separator);
31
+ if (separator < 1 || !APPLICATIONS.has(sourceApplication)) {
32
+ throw new InvalidInputError('session must be <sourceApplication>:<sessionId> with a known source application');
33
+ }
34
+ return { sourceApplication, sessionId: requiredString(value.slice(separator + 1), 'session id', MAX_SESSION_ID) };
35
+ });
36
+ }
@@ -21,21 +21,27 @@ export function registerMcpProcess(runtimeConfigPath, { sourceApplication, versi
21
21
  return () => { try { rmSync(path, { force: true }); } catch { /* best effort */ } };
22
22
  }
23
23
 
24
- // Live servers of this client that run a different version; files of exited
25
- // processes are removed on the way.
26
- export function outdatedMcpProcesses(runtimeConfigPath, { sourceApplication, version, isAlive = alive }) {
24
+ // Every live server's record ({ pid, version, sourceApplication, startedAt });
25
+ // files of exited processes are removed on the way.
26
+ export function liveMcpProcesses(runtimeConfigPath, { isAlive = alive } = {}) {
27
27
  let names;
28
28
  try { names = readdirSync(directory(runtimeConfigPath)); } catch { return []; }
29
- const outdated = [];
29
+ const live = [];
30
30
  for (const name of names.filter(item => /^\d+\.json$/.test(item))) {
31
31
  const path = join(directory(runtimeConfigPath), name);
32
32
  try {
33
33
  const record = JSON.parse(readFileSync(path, 'utf8'));
34
34
  if (!isAlive(record.pid)) { rmSync(path, { force: true }); continue; }
35
- if (record.sourceApplication === sourceApplication && record.version !== version) outdated.push(record);
35
+ live.push(record);
36
36
  } catch { /* unreadable entry: skip */ }
37
37
  }
38
- return outdated;
38
+ return live;
39
+ }
40
+
41
+ // Live servers of this client that run a different version.
42
+ export function outdatedMcpProcesses(runtimeConfigPath, { sourceApplication, version, isAlive = alive }) {
43
+ return liveMcpProcesses(runtimeConfigPath, { isAlive })
44
+ .filter(record => record.sourceApplication === sourceApplication && record.version !== version);
39
45
  }
40
46
 
41
47
  // The one-time notice for this session, or null. Shown again only when the
@@ -37,6 +37,7 @@ const PROJECT_AGENT_SOURCE_TOOLS = new Set([
37
37
  'dismiss_project_agent',
38
38
  // The task token is resolved for this client; its session is the conversation recorded.
39
39
  'register_standing_assignment', 'report_agent_service',
40
+ 'propose_agent_workflow', 'list_agent_workflows', 'read_agent_workflow', 'record_agent_workflow_run',
40
41
  'record_project_agent_task_activity',
41
42
  'preflight_executor',
42
43
  'report_executor_health',
@@ -7,6 +7,7 @@ const READ_TOOLS = new Set([
7
7
  'list_agent_conversations', 'read_agent_conversation', 'get_agent_conversation_policy',
8
8
  'list_agent_attention',
9
9
  'list_project_agent_tasks',
10
+ 'list_agent_workflows', 'read_agent_workflow',
10
11
  'list_preference_conflicts',
11
12
  'list_agent_interfaces',
12
13
  'get_capture_policy',
@@ -66,6 +67,7 @@ const WRITE_TOOLS = new Set([
66
67
  'agent_chat', 'group_discussion',
67
68
  'review_with_tonborg', 'assess_agent_action', 'assess_task_completion', 'pin_agent', 'role_work',
68
69
  'control_project_agent_task_run', 'register_standing_assignment', 'report_agent_service',
70
+ 'propose_agent_workflow', 'record_agent_workflow_run',
69
71
  'message_agent', 'reply_agent_message', 'cancel_agent_message',
70
72
  'record_agent_verification',
71
73
  'request_agent_loan', 'decide_agent_loan',
@@ -1,11 +1,10 @@
1
1
  import { execFile } from 'node:child_process';
2
- import { createHash } from 'node:crypto';
3
- import { createReadStream, createWriteStream } from 'node:fs';
4
- import { access, lstat, mkdir, mkdtemp, realpath, rename, rm, stat } from 'node:fs/promises';
2
+ import { access, lstat, mkdir, mkdtemp, realpath, rename, rm } from 'node:fs/promises';
5
3
  import { constants } from 'node:fs';
6
4
  import { basename, dirname, join, resolve } from 'node:path';
7
- import { Readable } from 'node:stream';
8
- import { pipeline } from 'node:stream/promises';
5
+
6
+ import { sha256File } from '../security/digest.js';
7
+ import { downloadResumable } from './resumable-download.js';
9
8
 
10
9
  // Immutable, versioned assets only. Instance data lives outside this directory.
11
10
  export async function installNativeNeo4j({ paths, home, url, sha256 }, {
@@ -63,22 +62,6 @@ async function extractArchive(archive, destination) {
63
62
  }, error => error ? reject(new Error('Neo4j archive extraction failed.', { cause: error })) : resolveRun()));
64
63
  }
65
64
 
66
- async function downloadFile(url, destination) {
67
- const partial = `${destination}.partial`;
68
- let existingBytes = 0;
69
- try { existingBytes = (await stat(partial)).size; } catch (error) { if (error.code !== 'ENOENT') throw error; }
70
- const response = await fetch(url, {
71
- headers: existingBytes > 0 ? { range: `bytes=${existingBytes}-` } : {},
72
- signal: AbortSignal.timeout(30 * 60_000)
73
- });
74
- if (!response.ok || !response.body) throw new Error(`Neo4j download failed with HTTP ${response.status}.`);
75
- const resumed = existingBytes > 0 && response.status === 206;
76
- await pipeline(Readable.fromWeb(response.body), createWriteStream(partial, { mode: 0o600, flags: resumed ? 'a' : 'w' }));
77
- await rename(partial, destination);
78
- }
79
-
80
- async function sha256File(path) {
81
- const hash = createHash('sha256');
82
- await pipeline(createReadStream(path), hash);
83
- return hash.digest('hex');
65
+ function downloadFile(url, destination) {
66
+ return downloadResumable(url, destination, { what: 'Neo4j' });
84
67
  }
@@ -0,0 +1,24 @@
1
+ import { createWriteStream } from 'node:fs';
2
+ import { rename, stat } from 'node:fs/promises';
3
+ import { Readable } from 'node:stream';
4
+ import { pipeline } from 'node:stream/promises';
5
+
6
+ const DEFAULT_TIMEOUT_MS = 30 * 60_000;
7
+
8
+ // Downloads `url` to `destination`, resuming a `.partial` left by an earlier
9
+ // attempt when the server answers a range request. The caller verifies the
10
+ // pinned checksum; nothing here trusts the bytes. `what` names the asset in the
11
+ // error, e.g. "Neo4j".
12
+ export async function downloadResumable(url, destination, { what, timeoutMs = DEFAULT_TIMEOUT_MS, fetchImpl = fetch } = {}) {
13
+ const partial = `${destination}.partial`;
14
+ let existingBytes = 0;
15
+ try { existingBytes = (await stat(partial)).size; } catch (error) { if (error.code !== 'ENOENT') throw error; }
16
+ const response = await fetchImpl(url, {
17
+ headers: existingBytes > 0 ? { range: `bytes=${existingBytes}-` } : {},
18
+ signal: AbortSignal.timeout(timeoutMs)
19
+ });
20
+ if (!response.ok || !response.body) throw new Error(`${what} download failed with HTTP ${response.status}.`);
21
+ const resumed = existingBytes > 0 && response.status === 206;
22
+ await pipeline(Readable.fromWeb(response.body), createWriteStream(partial, { mode: 0o600, flags: resumed ? 'a' : 'w' }));
23
+ await rename(partial, destination);
24
+ }
@@ -1,6 +1,8 @@
1
1
  import { existsSync, readFileSync, readdirSync, realpathSync } from 'node:fs';
2
2
  import { isAbsolute, join, relative, resolve } from 'node:path';
3
3
 
4
+ import { AGENT_KIT_COMPONENTS } from '../agent-kits/pins.js';
5
+
4
6
  export function readWindowsNativeBundle(packageRoot) {
5
7
  const path = join(packageRoot, 'native-bundle.json');
6
8
  if (!existsSync(path)) return null;
@@ -11,19 +13,34 @@ export function readWindowsNativeBundle(packageRoot) {
11
13
  }
12
14
  const root = realpathSync(packageRoot);
13
15
  const paths = Object.fromEntries(['neo4jHome', 'javaHome', 'providerPython', 'providerSource', 'dataDir']
14
- .map(key => {
15
- const value = manifest[key];
16
- if (typeof value !== 'string' || !value.trim() || isAbsolute(value)) {
17
- throw new Error('Portable bundle paths must be relative: ' + key);
18
- }
19
- const resolved = resolve(root, value);
20
- const local = relative(root, resolved);
21
- if (!local || local.startsWith('..') || isAbsolute(local)) {
22
- throw new Error('Portable bundle paths must stay inside the bundle: ' + key);
23
- }
24
- return [key, resolved];
25
- }));
26
- return { ...paths, bundleRoot: root, providerPackaging: 'embedded', assetSource: 'portable' };
16
+ .map(key => [key, bundlePath(root, manifest[key], key)]));
17
+ return { ...paths, ...bundledAgentKits(root, manifest.agentKits), bundleRoot: root,
18
+ providerPackaging: 'embedded', assetSource: 'portable' };
19
+ }
20
+
21
+ function bundlePath(root, value, key) {
22
+ if (typeof value !== 'string' || !value.trim() || isAbsolute(value)) {
23
+ throw new Error('Portable bundle paths must be relative: ' + key);
24
+ }
25
+ const resolved = resolve(root, value);
26
+ const local = relative(root, resolved);
27
+ if (!local || local.startsWith('..') || isAbsolute(local)) {
28
+ throw new Error('Portable bundle paths must stay inside the bundle: ' + key);
29
+ }
30
+ return resolved;
31
+ }
32
+
33
+ // The shared client components' executables (src/agent-kits/pins.js). A
34
+ // bundle built before they were bundled has no `agentKits`; FULI then
35
+ // downloads them on first need.
36
+ function bundledAgentKits(root, agentKits) {
37
+ if (agentKits === undefined) return {};
38
+ if (!agentKits || typeof agentKits !== 'object' || Array.isArray(agentKits)
39
+ || Object.keys(agentKits).some(component => !AGENT_KIT_COMPONENTS.includes(component))) {
40
+ throw new Error('The portable bundle lists unknown agent kit executables.');
41
+ }
42
+ return { agentKits: Object.fromEntries(Object.entries(agentKits)
43
+ .map(([component, value]) => [component, bundlePath(root, value, 'agentKits.' + component)])) };
27
44
  }
28
45
 
29
46
  // This accepts supplied assets; downloading and installer defaults are separate.
@@ -48,8 +48,11 @@ export async function windowsNativeProcessMatches(pid, command, entry, options)
48
48
  // would also answer 127.0.0.1 is visible, not only an exact loopback bind.
49
49
  async function listeningOwners(port) {
50
50
  if (!Number.isInteger(port) || port < 1 || port > 65535) throw new Error('Invalid native service port');
51
- return powershell('$owners = @(Get-NetTCPConnection -State Listen -LocalPort ' + port
52
- + ' -ErrorAction SilentlyContinue | ForEach-Object {[pscustomobject]@{pid=[int]$_.OwningProcess;'
51
+ // A listening socket has no remote endpoint. Some Windows builds report its
52
+ // State as empty or Closed, so the State filter alone misses real listeners.
53
+ return powershell('$owners = @(Get-NetTCPConnection -LocalPort ' + port
54
+ + ' -ErrorAction SilentlyContinue | Where-Object {$_.RemotePort -eq 0 -and @(\'0.0.0.0\',\'::\') -contains $_.RemoteAddress}'
55
+ + ' | ForEach-Object {[pscustomobject]@{pid=[int]$_.OwningProcess;'
53
56
  + 'name=(Get-Process -Id $_.OwningProcess -ErrorAction SilentlyContinue).ProcessName}} | Sort-Object pid -Unique);'
54
57
  + 'ConvertTo-Json -InputObject $owners -Compress');
55
58
  }