fnloom 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (587) hide show
  1. package/README.md +27 -20
  2. package/package.json +14 -11
  3. package/packages/build/package.json +2 -2
  4. package/packages/build/src/tests.ts +2 -2
  5. package/packages/cli/package.json +1 -1
  6. package/packages/cli/src/cli.ts +2 -2
  7. package/packages/cli/src/command.ts +2 -2
  8. package/packages/cli/src/commands/install.ts +1 -1
  9. package/packages/cli/src/commands/mcp.ts +6 -6
  10. package/packages/cli/src/commands/store.ts +3 -3
  11. package/packages/cli/src/hub.ts +25 -25
  12. package/packages/cli/src/index.ts +1 -1
  13. package/packages/cli/src/io.ts +2 -2
  14. package/packages/cli/src/local.ts +7 -7
  15. package/packages/cli/src/premade.ts +1 -1
  16. package/packages/core/package.json +4 -4
  17. package/packages/core/src/auto-pair.ts +1 -1
  18. package/packages/core/src/connections.ts +1 -14
  19. package/packages/core/src/context-graph.ts +1 -1
  20. package/packages/core/src/data.ts +1 -1
  21. package/packages/core/src/https.ts +2 -2
  22. package/packages/core/src/identity.ts +1 -1
  23. package/packages/core/src/image-embeddings.ts +1 -1
  24. package/packages/core/src/index.ts +5 -7
  25. package/packages/core/src/link.ts +1 -1
  26. package/packages/core/src/manifest.ts +2 -2
  27. package/packages/core/src/mention-search.ts +1 -1
  28. package/packages/core/src/model-calls.ts +1 -1
  29. package/packages/core/src/package.ts +1 -1
  30. package/packages/core/src/ports.ts +2 -2
  31. package/packages/core/src/query.ts +1 -1
  32. package/packages/core/src/records/chat.ts +1 -1
  33. package/packages/core/src/records/runs.ts +1 -1
  34. package/packages/core/src/records/spend.ts +4 -0
  35. package/packages/core/src/registries.ts +9 -3
  36. package/packages/core/src/sso.ts +2 -2
  37. package/packages/core/src/stores.ts +1 -1
  38. package/packages/core/src/suggestions.ts +2 -2
  39. package/packages/core/src/system-pages.ts +32 -6
  40. package/packages/core/src/tables.ts +233 -0
  41. package/packages/core/src/visuals.ts +47 -139
  42. package/packages/core/src/web.ts +2 -2
  43. package/packages/core/src/widgets-v1.ts +78 -1
  44. package/packages/hub/package.json +13 -11
  45. package/packages/hub/src/api/admin-ops.ts +5 -5
  46. package/packages/hub/src/api/auth.ts +2 -2
  47. package/packages/hub/src/api/https.ts +6 -6
  48. package/packages/hub/src/api/identities.ts +1 -1
  49. package/packages/hub/src/api/reads.ts +1 -1
  50. package/packages/hub/src/api/secrets.ts +1 -1
  51. package/packages/hub/src/api/serve.ts +2 -2
  52. package/packages/hub/src/api/sso-route.ts +2 -2
  53. package/packages/hub/src/api/sso.ts +6 -6
  54. package/packages/hub/src/api/testing/rig.ts +1 -1
  55. package/packages/hub/src/api/tls.ts +2 -2
  56. package/packages/hub/src/api/web/auth.ts +1 -1
  57. package/packages/hub/src/api/web/find.ts +1 -1
  58. package/packages/hub/src/api/web/pages.ts +4 -3
  59. package/packages/hub/src/api/web/pickers.ts +4 -4
  60. package/packages/hub/src/boot/env.ts +82 -78
  61. package/packages/hub/src/boot/hub-fns.ts +1 -1
  62. package/packages/hub/src/boot/identity.ts +2 -2
  63. package/packages/hub/src/boot/index.ts +1 -1
  64. package/packages/hub/src/boot/info.ts +1 -1
  65. package/packages/hub/src/boot/keys.ts +6 -6
  66. package/packages/hub/src/boot/log.ts +4 -4
  67. package/packages/hub/src/boot/modules.ts +4 -4
  68. package/packages/hub/src/boot/services.ts +9 -9
  69. package/packages/hub/src/boot/start.ts +23 -23
  70. package/packages/hub/src/chat/cache.ts +1 -1
  71. package/packages/hub/src/chat/chat.ts +1 -1
  72. package/packages/hub/src/chat/compare.ts +2 -2
  73. package/packages/hub/src/chat/deliveries.ts +1 -1
  74. package/packages/hub/src/chat/deps.ts +3 -3
  75. package/packages/hub/src/chat/enrich.ts +7 -7
  76. package/packages/hub/src/chat/env.ts +20 -20
  77. package/packages/hub/src/chat/mention-requests.ts +1 -1
  78. package/packages/hub/src/chat/mention-search.ts +1 -1
  79. package/packages/hub/src/chat/mentions.ts +3 -3
  80. package/packages/hub/src/chat/notifications.ts +2 -2
  81. package/packages/hub/src/chat/presence.ts +2 -2
  82. package/packages/hub/src/chat/sessions.ts +2 -2
  83. package/packages/hub/src/chat/suggestions.ts +8 -8
  84. package/packages/hub/src/chat/testing.ts +1 -1
  85. package/packages/hub/src/chat/turns.ts +6 -6
  86. package/packages/hub/src/chat/undo.ts +1 -1
  87. package/packages/hub/src/connections/create.ts +1 -1
  88. package/packages/hub/src/connections/env.ts +2 -2
  89. package/packages/hub/src/connections/service.ts +5 -9
  90. package/packages/hub/src/contextor/contextors.ts +9 -9
  91. package/packages/hub/src/contextor/crawl.ts +1 -1
  92. package/packages/hub/src/contextor/create.ts +5 -5
  93. package/packages/hub/src/contextor/dynamic.ts +5 -5
  94. package/packages/hub/src/contextor/env.ts +46 -46
  95. package/packages/hub/src/contextor/injected.ts +1 -1
  96. package/packages/hub/src/contextor/limits.ts +9 -9
  97. package/packages/hub/src/contextor/planner.ts +11 -11
  98. package/packages/hub/src/contextor/testing.ts +1 -1
  99. package/packages/hub/src/data/env.ts +3 -3
  100. package/packages/hub/src/data/service.ts +5 -5
  101. package/packages/hub/src/execution/agent.ts +8 -8
  102. package/packages/hub/src/execution/ai.ts +7 -7
  103. package/packages/hub/src/execution/create.ts +11 -6
  104. package/packages/hub/src/execution/env.ts +16 -16
  105. package/packages/hub/src/execution/executors.ts +2 -2
  106. package/packages/hub/src/execution/gateway.ts +1 -1
  107. package/packages/hub/src/execution/index.ts +1 -1
  108. package/packages/hub/src/execution/ledger.ts +2 -2
  109. package/packages/hub/src/execution/limits.ts +2 -2
  110. package/packages/hub/src/execution/models.ts +2 -2
  111. package/packages/hub/src/execution/ports.ts +1 -1
  112. package/packages/hub/src/execution/providers.ts +55 -11
  113. package/packages/hub/src/execution/queues.ts +6 -6
  114. package/packages/hub/src/execution/runs.ts +10 -10
  115. package/packages/hub/src/execution/stream-guard.ts +2 -2
  116. package/packages/hub/src/execution/testing.ts +5 -5
  117. package/packages/hub/src/execution/wire.ts +3 -3
  118. package/packages/hub/src/fns/auto.ts +2 -2
  119. package/packages/hub/src/fns/client-logs.ts +2 -2
  120. package/packages/hub/src/fns/create.ts +2 -2
  121. package/packages/hub/src/fns/decided.ts +2 -2
  122. package/packages/hub/src/fns/env.ts +14 -14
  123. package/packages/hub/src/fns/examples.ts +3 -3
  124. package/packages/hub/src/fns/facts.ts +5 -5
  125. package/packages/hub/src/fns/search.ts +5 -5
  126. package/packages/hub/src/graph/graph.ts +1 -1
  127. package/packages/hub/src/index/context-sections.ts +1 -1
  128. package/packages/hub/src/index/embedders.ts +3 -3
  129. package/packages/hub/src/index/env.ts +12 -12
  130. package/packages/hub/src/index/index.ts +1 -1
  131. package/packages/hub/src/index/indexer.ts +4 -4
  132. package/packages/hub/src/index/search.ts +1 -1
  133. package/packages/hub/src/index/testing.ts +2 -2
  134. package/packages/hub/src/link/build.ts +32 -32
  135. package/packages/hub/src/link/env.ts +14 -14
  136. package/packages/hub/src/link/grants.ts +10 -10
  137. package/packages/hub/src/link/lifecycle.ts +4 -4
  138. package/packages/hub/src/link/migrate-api.ts +55 -15
  139. package/packages/hub/src/link/pairing.ts +1 -1
  140. package/packages/hub/src/link/process.ts +1 -1
  141. package/packages/hub/src/link/rig.ts +12 -12
  142. package/packages/hub/src/link/supervisor.ts +1 -1
  143. package/packages/hub/src/mcp/calls.ts +6 -6
  144. package/packages/hub/src/mcp/create.ts +5 -5
  145. package/packages/hub/src/mcp/env.ts +6 -6
  146. package/packages/hub/src/mcp/fns.ts +2 -2
  147. package/packages/hub/src/mcp/index.ts +2 -2
  148. package/packages/hub/src/mcp/sources.ts +3 -3
  149. package/packages/hub/src/mcp/tokens.ts +1 -1
  150. package/packages/hub/src/models/create.ts +1 -1
  151. package/packages/hub/src/models/decide.ts +2 -2
  152. package/packages/hub/src/models/index.ts +1 -1
  153. package/packages/hub/src/models/roles.ts +12 -12
  154. package/packages/hub/src/query/env.ts +5 -5
  155. package/packages/hub/src/query/sources.ts +3 -3
  156. package/packages/hub/src/questions/plans.ts +1 -1
  157. package/packages/hub/src/questions/worker.ts +2 -2
  158. package/packages/hub/src/resources/context.ts +3 -3
  159. package/packages/hub/src/resources/converters.ts +2 -2
  160. package/packages/hub/src/resources/create.ts +6 -6
  161. package/packages/hub/src/resources/env.ts +15 -15
  162. package/packages/hub/src/resources/fetch.ts +5 -5
  163. package/packages/hub/src/resources/forms.ts +5 -5
  164. package/packages/hub/src/resources/index.ts +1 -1
  165. package/packages/hub/src/resources/library.ts +2 -2
  166. package/packages/hub/src/resources/raw.ts +1 -1
  167. package/packages/hub/src/resources/reader.ts +2 -2
  168. package/packages/hub/src/resources/sqlite-files.ts +1 -1
  169. package/packages/hub/src/resources/storage.ts +5 -5
  170. package/packages/hub/src/resources/testing.ts +6 -6
  171. package/packages/hub/src/store/env.ts +4 -4
  172. package/packages/hub/src/store/hybrid.ts +4 -4
  173. package/packages/hub/src/store/sqlite.ts +3 -3
  174. package/packages/hub/src/stores/drivers.ts +2 -2
  175. package/packages/hub/src/stores/host.ts +3 -3
  176. package/packages/hub/src/stores/moves.ts +2 -2
  177. package/packages/hub/src/stores/service.ts +2 -2
  178. package/packages/hub/src/tables/env.ts +3 -3
  179. package/packages/hub/src/tables/index.ts +5 -5
  180. package/packages/hub/src/tables/service.ts +7 -7
  181. package/packages/sdk/AUTHORING.md +1206 -881
  182. package/packages/sdk/package.json +11 -8
  183. package/packages/sdk/src/agent.ts +1 -1
  184. package/packages/sdk/src/app-parts.ts +95 -0
  185. package/packages/sdk/src/authored.ts +26 -0
  186. package/packages/sdk/src/authoring.ts +13 -30
  187. package/packages/sdk/src/client-runtime.ts +24 -1
  188. package/packages/sdk/src/client-ui/AddServiceDialog.vue +43 -0
  189. package/packages/sdk/src/client-ui/InstanceNameField.vue +29 -0
  190. package/packages/sdk/src/client-ui/PairRowsEditor.vue +74 -0
  191. package/packages/sdk/src/client-ui/RemoteAuthFields.vue +95 -0
  192. package/packages/sdk/src/client-ui/ServiceRows.vue +57 -0
  193. package/packages/sdk/src/client-ui/draft.ts +10 -0
  194. package/packages/sdk/src/client-ui/host.ts +37 -0
  195. package/packages/sdk/src/client-ui/index.ts +19 -0
  196. package/packages/sdk/src/client-ui/loaded.ts +69 -0
  197. package/packages/sdk/src/client-ui/problems.ts +98 -0
  198. package/packages/sdk/src/client-ui/remote-config.ts +199 -0
  199. package/packages/sdk/src/client-ui/service-rows.ts +25 -0
  200. package/packages/sdk/src/client-ui/state.ts +14 -0
  201. package/packages/sdk/src/client-ui/testing.ts +147 -0
  202. package/packages/sdk/src/client-ui/vue-shim.d.ts +13 -0
  203. package/packages/sdk/src/client.ts +82 -11
  204. package/packages/sdk/src/hub.ts +4 -4
  205. package/packages/sdk/src/index.ts +13 -9
  206. package/packages/sdk/src/page-parts.ts +4 -0
  207. package/packages/sdk/src/program/env.ts +7 -7
  208. package/packages/sdk/src/program/runtime.ts +5 -5
  209. package/packages/sdk/src/program/tools.ts +3 -3
  210. package/packages/sdk/src/remote-auth.ts +128 -7
  211. package/packages/sdk/src/server/context-files.ts +1 -1
  212. package/packages/sdk/src/server/env.ts +36 -36
  213. package/packages/sdk/src/server/fake-hub-widgets.ts +7 -6
  214. package/packages/sdk/src/server/host.ts +28 -28
  215. package/packages/sdk/src/server/index.ts +2 -2
  216. package/packages/sdk/src/server/live.ts +4 -4
  217. package/packages/sdk/src/server/llm-wire.ts +4 -4
  218. package/packages/sdk/src/server/pairing.ts +1 -1
  219. package/packages/sdk/src/server/results.ts +4 -4
  220. package/packages/sdk/src/server/socket-guard.ts +1 -1
  221. package/packages/sdk/src/server/start-gate.ts +2 -2
  222. package/packages/sdk/src/server/store/engines.ts +2 -2
  223. package/packages/sdk/src/server/store/keeper.ts +2 -2
  224. package/packages/sdk/src/server/supervise.ts +4 -4
  225. package/packages/sdk/src/testing/env.ts +6 -6
  226. package/packages/sdk/src/testing/hub.ts +3 -1
  227. package/packages/sdk/src/testing/models.ts +3 -3
  228. package/packages/sdk/src/testing/openrouter.ts +3 -2
  229. package/packages/sdk/src/testing/preview.ts +7 -7
  230. package/packages/sdk/src/widgets.ts +21 -136
  231. package/packages/sdk/tsconfig.json +2 -2
  232. package/packages/web/dist/assets/{ActorSettingsView-v2k7v454.js → ActorSettingsView-CDszUbHz.js} +2 -2
  233. package/packages/web/dist/assets/AdminLayout-CFIz4GsQ.js +2 -0
  234. package/packages/web/dist/assets/{AdminLayout-1hbRPV3d.css → AdminLayout-ggcdQGlQ.css} +1 -1
  235. package/packages/web/dist/assets/{AppPage-CFmKZS8G.js → AppPage-BvoVTk6h.js} +2 -2
  236. package/packages/web/dist/assets/{AutoPairPicker-C61gihmh.js → AutoPairPicker-CLjD-muP.js} +2 -2
  237. package/packages/web/dist/assets/{BrowserFrame-Sq9EmQRT.js → BrowserFrame-BcN-A76X.js} +2 -2
  238. package/packages/web/dist/assets/ChatPage-DhTpAyM2.js +4 -0
  239. package/packages/web/dist/assets/{ChatPage-CbsRmktV.css → ChatPage-DjPv238m.css} +1 -1
  240. package/packages/web/dist/assets/{CodeViewer-tUNXZB77.js → CodeViewer-K9jrTmFO.js} +2 -2
  241. package/packages/web/dist/assets/ConfigWithCustom-BvrvSVIp.js +3 -0
  242. package/packages/web/dist/assets/{ConfirmDialog-Dd3E4sJt.js → ConfirmDialog-BDvLleYf.js} +2 -2
  243. package/packages/web/dist/assets/{ConnectPage-CX9acyQH.js → ConnectPage-Dg6IPNNh.js} +2 -2
  244. package/packages/web/dist/assets/ContextItemPage-qisBQetR.js +2 -0
  245. package/packages/web/dist/assets/ContextPage-DXa6Yqk-.js +3 -0
  246. package/packages/web/dist/assets/{ContextRow-DrtPumZ5.js → ContextRow-DDYnYRaL.js} +2 -2
  247. package/packages/web/dist/assets/{DataPage-DDSsxHro.js → DataPage-DOE_pKAY.js} +2 -2
  248. package/packages/web/dist/assets/DataTypePage-BnP_JELT.js +2 -0
  249. package/packages/web/dist/assets/{DataTypePage-Cr238Hx_.css → DataTypePage-CWrWvUPs.css} +1 -1
  250. package/packages/web/dist/assets/{DesignPage-6e0XbOFC.js → DesignPage-B9MJbF10.js} +3 -3
  251. package/packages/web/dist/assets/{ExplorePage-B7ND0W0l.js → ExplorePage-cRDQZRea.js} +2 -2
  252. package/packages/web/dist/assets/{FnPill-Cp3KuLmP.js → FnPill-CbLZCXYM.js} +2 -2
  253. package/packages/web/dist/assets/{FnView-C0XZdnsS.js → FnView-CG_wBKTP.js} +2 -2
  254. package/packages/web/dist/assets/{FnsView-GTH3p7a0.js → FnsView-BybyK12w.js} +2 -2
  255. package/packages/web/dist/assets/{GinExprView-DGxns6lH.js → GinExprView-BYCKSD_n.js} +2 -2
  256. package/packages/web/dist/assets/{GinForm-BDBUzuDP.js → GinForm-CXjYVf2_.js} +2 -2
  257. package/packages/web/dist/assets/{GinTypeView-CUsymbVf.js → GinTypeView-Bmbmx9e_.js} +2 -2
  258. package/packages/web/dist/assets/{GinValueView-jsKIfiEA.js → GinValueView-CWUzS7ti.js} +2 -2
  259. package/packages/web/dist/assets/{GraphPage-BCcPPsHu.js → GraphPage-D6OhckfJ.js} +2 -2
  260. package/packages/web/dist/assets/GraphPanel-BTitgA-K.js +2 -0
  261. package/packages/web/dist/assets/{HubPicker-EoOErgmk.js → HubPicker-DVly8dLD.js} +2 -2
  262. package/packages/web/dist/assets/{InboxApprovals-Dkq7DFp_.js → InboxApprovals-BF84edZU.js} +2 -2
  263. package/packages/web/dist/assets/{InboxPage-CHhslePq.js → InboxPage-DohZ9EDP.js} +2 -2
  264. package/packages/web/dist/assets/InjectedList-e6qr1kdU.js +2 -0
  265. package/packages/web/dist/assets/{InstallDialog-D-VwfZYF.js → InstallDialog-JJCKYs2s.js} +2 -2
  266. package/packages/web/dist/assets/InstanceTypes-BqUzx87o.js +2 -0
  267. package/packages/web/dist/assets/InstanceView-C73pev7A.js +2 -0
  268. package/packages/web/dist/assets/{ItemHistory-NQAP69ma.js → ItemHistory-dbGgOZsw.js} +2 -2
  269. package/packages/web/dist/assets/LimitsView-Ddp5WakY.js +2 -0
  270. package/packages/web/dist/assets/{ListSearch-BunVrDO0.js → ListSearch-CYNNAuMB.js} +2 -2
  271. package/packages/web/dist/assets/{LlmCallDetails-BoVNDTVs.js → LlmCallDetails-C9H5Hc2J.js} +2 -2
  272. package/packages/web/dist/assets/{LlmCallsView-BGpV92RC.js → LlmCallsView-CBqyZ8Cj.js} +2 -2
  273. package/packages/web/dist/assets/{LoadState-h-K9bTYc.js → LoadState-B2YhZlyC.js} +2 -2
  274. package/packages/web/dist/assets/McpDialog-DhlLklIq.js +2 -0
  275. package/packages/web/dist/assets/{McpView-GPXdCMne.js → McpView-D_ZmNO56.js} +2 -2
  276. package/packages/web/dist/assets/{McpsView-DJIR2JX5.js → McpsView-9_gwBuzw.js} +2 -2
  277. package/packages/web/dist/assets/{MemoryDialog-BTeIHQyA.js → MemoryDialog-pTHIxKEX.js} +2 -2
  278. package/packages/web/dist/assets/{ModelCallsView-DMcnwF2S.js → ModelCallsView-FHv2XWRX.js} +2 -2
  279. package/packages/web/dist/assets/{ModelPicker-CgkMFxSO.js → ModelPicker-EqOuvVnE.js} +2 -2
  280. package/packages/web/dist/assets/ModelsView-D9UaL4PX.js +2 -0
  281. package/packages/web/dist/assets/{NotFoundPage-Tk92K7HN.js → NotFoundPage-BsuJysan.js} +2 -2
  282. package/packages/web/dist/assets/{PairPage-D0BK8CCw.js → PairPage-B_ZXsbL4.js} +2 -2
  283. package/packages/web/dist/assets/{PanelHost-C-gKrxAk.js → PanelHost-Dx-vNNl5.js} +2 -2
  284. package/packages/web/dist/assets/PeopleView-D6dmEgMs.js +2 -0
  285. package/packages/web/dist/assets/{PeopleView-CJ8yArTh.css → PeopleView-DBxdbT1C.css} +1 -1
  286. package/packages/web/dist/assets/{PoliciesView-BRi-QAuo.js → PoliciesView-Bn4rm-ao.js} +2 -2
  287. package/packages/web/dist/assets/{RefusalList-DVO0bmeB.js → RefusalList-aosRD1ie.js} +2 -2
  288. package/packages/web/dist/assets/RendererHost-Ym_SMkhp.css +1 -0
  289. package/packages/web/dist/assets/RendererHost-rjnpSgyQ.js +2 -0
  290. package/packages/web/dist/assets/{ResourceViewer-Do0chYxU.js → ResourceViewer-C4tRColf.js} +2 -2
  291. package/packages/web/dist/assets/ResourcesPage-7mCLBORZ.js +2 -0
  292. package/packages/web/dist/assets/ResultGrid-CL2WSYQH.css +1 -0
  293. package/packages/web/dist/assets/ResultGrid-GIMoQUAr.js +2 -0
  294. package/packages/web/dist/assets/{ReviewSummaryStrip-DO3p64Qj.js → ReviewSummaryStrip-Bvjn3Iq8.js} +2 -2
  295. package/packages/web/dist/assets/ReviewView-DIqsUedT.js +3 -0
  296. package/packages/web/dist/assets/{RuleRow-DX9v4iGP.js → RuleRow-zRg-e8Vj.js} +2 -2
  297. package/packages/web/dist/assets/RunCard-C7wOGaw8.js +2 -0
  298. package/packages/web/dist/assets/RunCard-CSDiz-Nt.css +1 -0
  299. package/packages/web/dist/assets/{RunDetails-DjR206q6.js → RunDetails-W4GbE6AE.js} +2 -2
  300. package/packages/web/dist/assets/{RunDot-lHRICdM5.js → RunDot-C46uzzNM.js} +2 -2
  301. package/packages/web/dist/assets/{RunPage-CbAQ_WPR.js → RunPage-DPLtZpeB.js} +2 -2
  302. package/packages/web/dist/assets/{RunProgress-C3-B4tQf.js → RunProgress-Cr_6TBaF.js} +2 -2
  303. package/packages/web/dist/assets/{RunsView-DMkPmkqX.js → RunsView-tU350TPK.js} +2 -2
  304. package/packages/web/dist/assets/SettingsPage-B8QmmMN3.js +3 -0
  305. package/packages/web/dist/assets/{SettingsPage-t03BqXw8.css → SettingsPage-BTl3Ie4F.css} +1 -1
  306. package/packages/web/dist/assets/SignInPage-CXxLf7Rp.css +1 -0
  307. package/packages/web/dist/assets/{SignInPage-ByqGEZfj.js → SignInPage-DTwdqlnB.js} +2 -2
  308. package/packages/web/dist/assets/{StatusBadge-CXne0sRZ.js → StatusBadge-D7wKMAcD.js} +2 -2
  309. package/packages/web/dist/assets/{StorePlacementStep-B6SwTmdM.js → StorePlacementStep-C04nRU-u.js} +2 -2
  310. package/packages/web/dist/assets/{SystemConfig-vQDL_eUl.js → SystemConfig-CE3keXWq.js} +2 -2
  311. package/packages/web/dist/assets/SystemPageHost-CEhz4li8.js +2 -0
  312. package/packages/web/dist/assets/SystemPageHost-DX7LrFoN.css +1 -0
  313. package/packages/web/dist/assets/SystemView-CBFzEGfm.js +2 -0
  314. package/packages/web/dist/assets/SystemsView-0G8JntMV.js +2 -0
  315. package/packages/web/dist/assets/TableView-BK0uwLHl.js +3 -0
  316. package/packages/web/dist/assets/TableView-B_4MViVb.css +1 -0
  317. package/packages/web/dist/assets/{TableViewer-Boxx86f5.js → TableViewer-nbMInGJJ.js} +3 -3
  318. package/packages/web/dist/assets/{ThemePicker-CIg_oRQX.js → ThemePicker-fZpVSYqG.js} +2 -2
  319. package/packages/web/dist/assets/{TurnTree-Ecm0yA5g.js → TurnTree-Co-iBqhT.js} +2 -2
  320. package/packages/web/dist/assets/{UserMessage-BtECa8ka.css → UserMessage-B63G9sxC.css} +1 -1
  321. package/packages/web/dist/assets/{UserMessage-BlnqZDVU.js → UserMessage-CDjUxKY0.js} +6 -6
  322. package/packages/web/dist/assets/{ValueVisual-C-MWpp7c.js → ValueVisual-EJnCKgSy.js} +2 -2
  323. package/packages/web/dist/assets/{fn-modal-B98MR7JN.js → fn-modal-DtE65mFt.js} +2 -2
  324. package/packages/web/dist/assets/{fn-notices-CfTa1E8y.js → fn-notices-CCZ-DFbi.js} +2 -2
  325. package/packages/web/dist/assets/{formats-JwoKfXIq.js → formats-CyHV2siv.js} +2 -2
  326. package/packages/web/dist/assets/index-BY7M8QUk.css +1 -0
  327. package/packages/web/dist/assets/index-OZS2EluT.js +4 -0
  328. package/packages/web/dist/assets/{labels-BFbk11BE.js → labels-CT7_K0Pt.js} +2 -2
  329. package/packages/web/dist/assets/{layout-D1gf481r.js → layout-B6fBDg80.js} +2 -2
  330. package/packages/web/dist/assets/loaded-LaPjk6mK.js +2 -0
  331. package/packages/web/dist/assets/{metrics-CBPX3W5Y.js → metrics-9n8bKI7u.js} +2 -2
  332. package/packages/web/dist/assets/problems--AW4igVY.js +2 -0
  333. package/packages/web/dist/assets/{push-payload-BeU1ADYt.js → push-payload-B3EcrsVz.js} +64 -64
  334. package/packages/web/dist/assets/record-edits-B-FWAbxR.js +2 -0
  335. package/packages/web/dist/assets/{review-fP-l9D6H.js → review-uLESCEz1.js} +3 -3
  336. package/packages/web/dist/assets/routes-B7Zmt8wh.js +4 -0
  337. package/packages/web/dist/assets/{runs-CveC2kKo.js → runs-CUb2PTFg.js} +2 -2
  338. package/packages/web/dist/assets/{shared-LbaIHjbV.js → shared-Bxhw_9et.js} +2 -2
  339. package/packages/web/dist/assets/{sources-VPrtgLIi.js → sources-YgkjgFLe.js} +2 -2
  340. package/packages/web/dist/assets/src-DY1fSFJS.js +43 -0
  341. package/packages/web/dist/assets/state-ChQDWWj-.js +2 -0
  342. package/packages/web/dist/assets/{systems-BqE3WTSF.js → systems-CjwjRySu.js} +2 -2
  343. package/packages/web/dist/assets/table-host-B_D9dmCz.js +2 -0
  344. package/packages/web/dist/assets/tables-CaxIuHdw.js +2 -0
  345. package/packages/web/dist/assets/{ui-BzgWquIU.js → ui-DWjytmDS.js} +5 -5
  346. package/packages/web/dist/assets/{url-DKGcECT1.js → url-DbGOI14W.js} +2 -2
  347. package/packages/web/dist/index.html +49 -47
  348. package/packages/web/dist/sw.js +1 -1
  349. package/packages/web/package.json +2 -4
  350. package/premade/claude.zip +0 -0
  351. package/premade/database.zip +0 -0
  352. package/premade/web.zip +0 -0
  353. package/scripts/dev-env.ts +9 -9
  354. package/scripts/run-stack.ts +15 -15
  355. package/scripts/stack.ts +3 -3
  356. package/scripts/start.ts +18 -18
  357. package/systems/api/client/ApiServiceForm.vue +55 -0
  358. package/systems/api/client/ServiceList.vue +90 -0
  359. package/systems/api/client/ServicePage.vue +142 -0
  360. package/systems/api/client/ServicesPage.vue +32 -0
  361. package/systems/api/client/index.ts +15 -0
  362. package/systems/api/client/logic.ts +140 -0
  363. package/systems/api/client/state.ts +92 -0
  364. package/systems/api/package.json +9 -6
  365. package/systems/api/server/authoring.ts +2 -1
  366. package/systems/api/server/env.ts +1 -1
  367. package/systems/api/server/guard.ts +1 -1
  368. package/systems/api/server/http.ts +3 -2
  369. package/systems/api/server/impl.ts +3 -2
  370. package/systems/api/server/main.ts +11 -7
  371. package/systems/api/server/openapi.ts +1 -1
  372. package/systems/api/server/program.ts +2 -1
  373. package/systems/api/server/services.ts +2 -1
  374. package/systems/api/shared/http.ts +2 -1
  375. package/systems/api/shared/index.ts +15 -5
  376. package/{packages/core/src/programs.ts → systems/api/shared/services.ts} +7 -51
  377. package/systems/api/system.json +2 -1
  378. package/systems/api/tsconfig.json +2 -2
  379. package/systems/code/package.json +4 -3
  380. package/systems/code/server/authoring.ts +2 -1
  381. package/systems/code/server/impl.ts +2 -1
  382. package/systems/code/server/main.ts +5 -5
  383. package/systems/code/shared/index.ts +2 -3
  384. package/systems/code/shared/program.ts +23 -0
  385. package/systems/embedder/package.json +1 -1
  386. package/systems/embedder/server/env.ts +1 -1
  387. package/systems/embedder/server/main.ts +5 -5
  388. package/systems/embedder/shared/index.ts +1 -1
  389. package/systems/fs/client/machines/fakes.ts +1 -1
  390. package/systems/fs/client/machines/files/fakes.ts +1 -1
  391. package/systems/fs/client/machines/palette.ts +3 -2
  392. package/systems/fs/context/authoring/parts/client.md +23 -5
  393. package/systems/fs/context/authoring/parts/client.reference/client.md +7 -16
  394. package/systems/fs/context/authoring/parts/client.reference/pageinbox.md +524 -0
  395. package/systems/fs/context/authoring/parts/client.reference/{resultview.md → visuals.md} +85 -116
  396. package/systems/fs/context/authoring/parts/client.reference.md +8 -8
  397. package/systems/fs/context/authoring/parts/context.md +1 -1
  398. package/systems/fs/context/authoring/parts/contract.md +1 -1
  399. package/systems/fs/context/authoring/parts/core-types/admin-ts.md +2 -2
  400. package/systems/fs/context/authoring/parts/core-types/connections-ts.md +12 -1
  401. package/systems/fs/context/authoring/parts/core-types/context-files-ts.md +2 -2
  402. package/systems/fs/context/authoring/parts/core-types/context-graph-ts.md +2 -2
  403. package/systems/fs/context/authoring/parts/core-types/contextdecl.md +2 -2
  404. package/systems/fs/context/authoring/parts/core-types/lifecycle-ts.md +27 -2
  405. package/systems/fs/context/authoring/parts/core-types/manifest.md +27 -2
  406. package/systems/fs/context/authoring/parts/core-types/manifestpatch.md +26 -2
  407. package/systems/fs/context/authoring/parts/core-types/modes-ts.md +3 -3
  408. package/systems/fs/context/authoring/parts/core-types/records-systems-ts.md +145 -1
  409. package/systems/fs/context/authoring/parts/core-types/registries-ts.md +98 -2
  410. package/systems/fs/context/authoring/parts/core-types/run-ts.md +2 -2
  411. package/systems/fs/context/authoring/parts/core-types/system-pages-ts.md +4 -2
  412. package/systems/fs/context/authoring/parts/core-types/system-providers-ts.md +2 -2
  413. package/systems/fs/context/authoring/parts/core-types/tables-ts.md +91 -0
  414. package/systems/fs/context/authoring/parts/core-types/web-ts.md +1 -2
  415. package/systems/fs/context/authoring/parts/core-types.md +5 -8
  416. package/systems/fs/context/authoring/parts/examples/server-main-ts.md +4 -4
  417. package/systems/fs/context/authoring/parts/examples/systems-fs-shared-index-ts-lines-568-660.md +1 -1
  418. package/systems/fs/context/authoring/parts/fns.md +1 -1
  419. package/systems/fs/context/authoring/parts/folder.md +6 -6
  420. package/systems/fs/context/authoring/parts/hub/hub-ctx-from-resource.md +2 -2
  421. package/systems/fs/context/authoring/parts/hub/hub-install-package.md +2 -2
  422. package/systems/fs/context/authoring/parts/hub.reference.md +3 -3
  423. package/systems/fs/context/authoring/parts/internals/manifestof.md +2 -2
  424. package/systems/fs/context/authoring/parts/internals/permissionargs.md +4 -4
  425. package/systems/fs/context/authoring/parts/kinds-agents.md +1 -1
  426. package/systems/fs/context/authoring/parts/kinds-agents.reference/authoringsession.md +7 -5
  427. package/systems/fs/context/authoring/parts/kinds-agents.reference/kind.md +4 -4
  428. package/systems/fs/context/authoring/parts/outcomes.md +2 -2
  429. package/systems/fs/context/authoring/parts/outcomes.reference.md +2 -2
  430. package/systems/fs/context/authoring/parts/packaging.md +4 -4
  431. package/systems/fs/context/authoring/parts/remote.md +5 -5
  432. package/systems/fs/context/authoring/parts/remote.reference.md +201 -17
  433. package/systems/fs/context/authoring/parts/server.md +7 -7
  434. package/systems/fs/context/authoring/parts/server.reference.md +15 -15
  435. package/systems/fs/context/authoring/parts/testing.reference/equal.md +3 -3
  436. package/systems/fs/context/authoring/parts/testing.reference/fakehub.md +1 -1
  437. package/systems/fs/context/authoring/parts/testing.reference/kindprops.md +22 -10
  438. package/systems/fs/context/authoring/parts/testing.reference/{openmemorystore.md → storeconnection.md} +7 -19
  439. package/systems/fs/context/authoring/parts/testing.reference.md +5 -5
  440. package/systems/fs/context/authoring/parts/widgets.md +32 -22
  441. package/systems/fs/context/authoring/parts/widgets.reference.md +503 -9
  442. package/systems/fs/package.json +3 -3
  443. package/systems/fs/server/hosting.ts +10 -10
  444. package/systems/fs/server/main.ts +8 -8
  445. package/systems/fs/server/shell.ts +1 -1
  446. package/systems/fs/shared/index.ts +1 -1
  447. package/systems/google-calendar/package.json +1 -1
  448. package/systems/google-calendar/server/main.ts +4 -4
  449. package/systems/input/package.json +3 -3
  450. package/systems/input/server/main.ts +6 -6
  451. package/systems/mcp/client/McpServerForm.vue +99 -0
  452. package/systems/mcp/client/ServerList.vue +78 -0
  453. package/systems/mcp/client/ServerPage.vue +194 -0
  454. package/systems/mcp/client/ServersPage.vue +32 -0
  455. package/systems/mcp/client/index.ts +15 -0
  456. package/systems/mcp/client/logic.ts +224 -0
  457. package/systems/mcp/client/state.ts +128 -0
  458. package/systems/mcp/package.json +9 -6
  459. package/systems/mcp/server/dial.ts +1 -1
  460. package/systems/mcp/server/impl.ts +2 -1
  461. package/systems/mcp/server/instance.ts +3 -5
  462. package/systems/mcp/server/main.ts +10 -6
  463. package/systems/mcp/server/mirror.ts +2 -3
  464. package/systems/mcp/server/oauth.ts +2 -1
  465. package/systems/mcp/server/server-link.ts +2 -1
  466. package/systems/mcp/shared/index.ts +15 -2
  467. package/{packages/core/src/mcp-servers.ts → systems/mcp/shared/servers.ts} +6 -5
  468. package/systems/mcp/system.json +2 -1
  469. package/systems/mcp/tsconfig.json +2 -2
  470. package/systems/ollama/package.json +3 -3
  471. package/systems/ollama/server/main.ts +5 -5
  472. package/systems/schedule/package.json +3 -3
  473. package/systems/schedule/server/main.ts +6 -6
  474. package/systems/template/README.md +2 -2
  475. package/systems/template/package.json +1 -1
  476. package/systems/template/server/main.ts +4 -4
  477. package/systems/widgets/client/ChipRow.vue +22 -0
  478. package/systems/widgets/client/ProposalCard.vue +6 -5
  479. package/systems/widgets/client/SavedWidget.vue +11 -8
  480. package/systems/widgets/client/WidgetChips.vue +137 -0
  481. package/systems/widgets/client/WidgetView.vue +32 -0
  482. package/systems/widgets/client/charts/ChartVisual.vue +157 -0
  483. package/systems/widgets/client/charts/chart-data.ts +230 -0
  484. package/systems/widgets/client/charts/echarts-setup.ts +69 -0
  485. package/systems/widgets/client/charts/export.ts +36 -0
  486. package/systems/widgets/client/charts/families/calendar.ts +105 -0
  487. package/systems/widgets/client/charts/families/category.ts +186 -0
  488. package/systems/widgets/client/charts/families/crosstab.ts +113 -0
  489. package/systems/widgets/client/charts/families/distribution.ts +160 -0
  490. package/systems/widgets/client/charts/families/finance.ts +96 -0
  491. package/systems/widgets/client/charts/families/gauge.ts +75 -0
  492. package/systems/widgets/client/charts/families/hierarchy.ts +166 -0
  493. package/systems/widgets/client/charts/families/index.ts +21 -0
  494. package/systems/widgets/client/charts/families/network.ts +140 -0
  495. package/systems/widgets/client/charts/families/part.ts +61 -0
  496. package/systems/widgets/client/charts/families/profile.ts +30 -0
  497. package/systems/widgets/client/charts/families/progress.ts +76 -0
  498. package/systems/widgets/client/charts/families/range.ts +107 -0
  499. package/systems/widgets/client/charts/families/time.ts +177 -0
  500. package/systems/widgets/client/charts/families/timeline.ts +114 -0
  501. package/systems/widgets/client/charts/families/wide.ts +41 -0
  502. package/systems/widgets/client/charts/index.ts +37 -0
  503. package/systems/widgets/client/charts/maths.ts +139 -0
  504. package/systems/widgets/client/charts/size.ts +39 -0
  505. package/systems/widgets/client/chips.ts +150 -0
  506. package/systems/widgets/client/index.ts +18 -5
  507. package/systems/widgets/client/proposal.ts +2 -1
  508. package/systems/widgets/package.json +7 -4
  509. package/systems/widgets/server/authoring.ts +13 -7
  510. package/systems/widgets/server/env.ts +1 -1
  511. package/systems/widgets/server/impl.ts +10 -6
  512. package/systems/widgets/server/main.ts +6 -6
  513. package/systems/widgets/server/run.ts +16 -9
  514. package/systems/widgets/server/upgrade.ts +34 -0
  515. package/systems/widgets/shared/args.ts +137 -0
  516. package/systems/widgets/shared/charts.ts +243 -0
  517. package/systems/widgets/shared/index.ts +12 -3
  518. package/{packages/sdk/src → systems/widgets/shared}/relative-dates.ts +2 -1
  519. package/systems/widgets/shared/spec.ts +208 -0
  520. package/{packages/sdk/src → systems/widgets/shared}/widget-check.ts +7 -9
  521. package/{packages/sdk/src → systems/widgets/shared}/widget-schema.ts +4 -4
  522. package/packages/core/src/remote-auth.ts +0 -111
  523. package/packages/core/src/widgets.ts +0 -427
  524. package/packages/web/dist/assets/AdminLayout-B6Jrc_4W.js +0 -2
  525. package/packages/web/dist/assets/ApiServiceForm-BxprSaAq.css +0 -1
  526. package/packages/web/dist/assets/ApiServiceForm-CuuQgOJc.js +0 -2
  527. package/packages/web/dist/assets/ApiServiceView-7bTHSO_Z.js +0 -2
  528. package/packages/web/dist/assets/ApiServiceView-BVmdRCjR.css +0 -1
  529. package/packages/web/dist/assets/ApiServicesView-BTLV6c8n.css +0 -1
  530. package/packages/web/dist/assets/ApiServicesView-BXi24n49.js +0 -2
  531. package/packages/web/dist/assets/ChartVisual-BnFG9aFi.css +0 -1
  532. package/packages/web/dist/assets/ChartVisual-C4mgw4wh.js +0 -11
  533. package/packages/web/dist/assets/ChatPage-CAhHE03Z.js +0 -4
  534. package/packages/web/dist/assets/ConfigWithCustom-D_-rY66L.js +0 -3
  535. package/packages/web/dist/assets/ContextItemPage-rUI3-T_L.js +0 -2
  536. package/packages/web/dist/assets/ContextPage-CtefzyKg.js +0 -3
  537. package/packages/web/dist/assets/DataTypePage-BW9fWaz8.js +0 -2
  538. package/packages/web/dist/assets/FnList-BCnb4kOB.css +0 -1
  539. package/packages/web/dist/assets/FnList-Bx6H-kux.js +0 -2
  540. package/packages/web/dist/assets/GraphPanel-9tztGHmu.js +0 -2
  541. package/packages/web/dist/assets/InjectedList-CSWqRiON.js +0 -2
  542. package/packages/web/dist/assets/InstanceTypes-D3rAEiE7.js +0 -2
  543. package/packages/web/dist/assets/InstanceView-DoH8C-1j.js +0 -2
  544. package/packages/web/dist/assets/LimitsView-DY2C9nYS.js +0 -2
  545. package/packages/web/dist/assets/McpDialog-DhOCk6_E.js +0 -2
  546. package/packages/web/dist/assets/McpServerForm-Cor3fI7s.js +0 -2
  547. package/packages/web/dist/assets/McpServerForm-DsHaf5Um.css +0 -1
  548. package/packages/web/dist/assets/McpServerView-7I76EznB.css +0 -1
  549. package/packages/web/dist/assets/McpServerView-ewXRPEmZ.js +0 -2
  550. package/packages/web/dist/assets/McpServersView-Dd0xmfws.js +0 -2
  551. package/packages/web/dist/assets/ModelsView-cMHygeiK.js +0 -2
  552. package/packages/web/dist/assets/PeopleView-DRfeNWK5.js +0 -2
  553. package/packages/web/dist/assets/RemoteAuthFields-CgiufuqQ.js +0 -2
  554. package/packages/web/dist/assets/RemoteAuthFields-Dm44vz2t.css +0 -1
  555. package/packages/web/dist/assets/ResourcesPage-BBx2u2mw.js +0 -2
  556. package/packages/web/dist/assets/ResultGrid-Bj-0I5HY.js +0 -2
  557. package/packages/web/dist/assets/ResultGrid-CuUQyTjW.css +0 -1
  558. package/packages/web/dist/assets/ReviewView-DZF9E1hb.js +0 -3
  559. package/packages/web/dist/assets/RunCard-BnrtK2Yp.js +0 -2
  560. package/packages/web/dist/assets/RunCard-CfyRaDLS.css +0 -1
  561. package/packages/web/dist/assets/ServiceRows-4WythFpF.js +0 -2
  562. package/packages/web/dist/assets/ServiceRows-HPQ0pN6b.css +0 -1
  563. package/packages/web/dist/assets/SettingsPage-BN4oSzoL.js +0 -3
  564. package/packages/web/dist/assets/SignInPage-Djx-M-0U.css +0 -1
  565. package/packages/web/dist/assets/SystemPageHost-BeZ-6N0-.css +0 -1
  566. package/packages/web/dist/assets/SystemPageHost-DrMrEPyh.js +0 -2
  567. package/packages/web/dist/assets/SystemView-Be6TBM4j.js +0 -2
  568. package/packages/web/dist/assets/SystemsView-DZtT3laz.js +0 -2
  569. package/packages/web/dist/assets/WidgetView-DQUDeFkB.css +0 -1
  570. package/packages/web/dist/assets/WidgetView-DX4ejNb6.js +0 -3
  571. package/packages/web/dist/assets/export-BwFkEtcm.js +0 -15
  572. package/packages/web/dist/assets/index-6ScWTFy2.js +0 -4
  573. package/packages/web/dist/assets/index-CEslGcrX.css +0 -1
  574. package/packages/web/dist/assets/problems-t1E_ovSz.js +0 -2
  575. package/packages/web/dist/assets/record-edits-Bfsi4lU3.js +0 -2
  576. package/packages/web/dist/assets/remote-config-BNQhSDzB.js +0 -2
  577. package/packages/web/dist/assets/routes-DV4IJpwe.js +0 -4
  578. package/packages/web/dist/assets/size-Bh__w5aI.js +0 -2
  579. package/packages/web/dist/assets/src-CT3TeFaM.js +0 -43
  580. package/packages/web/dist/assets/state-xfQqaQPX.js +0 -2
  581. package/packages/web/dist/assets/widget-host-B87MTaTn.js +0 -2
  582. package/packages/web/dist/assets/widgets-BBCuSS6E.js +0 -2
  583. package/systems/fs/context/authoring/parts/client.reference/textareaprops.md +0 -195
  584. package/systems/fs/context/authoring/parts/core-types/remote-auth-ts.md +0 -64
  585. package/systems/fs/context/authoring/parts/core-types/widgets-ts.md +0 -303
  586. package/systems/fs/context/authoring/parts/widgets.reference/hub-visuals.md +0 -627
  587. package/systems/fs/context/authoring/parts/widgets.reference/sourcecompatible.md +0 -154
@@ -0,0 +1,224 @@
1
+ /**
2
+ * The MCP servers page (`/admin/s/mcp/servers`, moved here from the web app's admin): MCP servers as it shows them,
3
+ * each an instance of this system. The form's draft of an `McpServerConfig` and the config it sends, each transport
4
+ * and approval policy in words, a server's state as a badge, its prompts' names and the hub query for them, the one-line
5
+ * summary of a server on the list, and where the page's URL points (the list, or one server and its tab). Pure, so it
6
+ * is tested alone.
7
+ */
8
+ import { InstanceName, SystemName, type ContextRecord, type Json, type JsonObject, type QualifiedName, type QueryFnArgs, type SystemStatus } from '@harness/core';
9
+ import {
10
+ authCandidate, authDraft, checkConfig, keptPaths, numberOr, recordOf, rowsOf, textOr, withoutKept, type AuthDraft, type CheckedConfig, type PairRow, type StatusLook,
11
+ } from '@harness/sdk/client-ui/state';
12
+ import { z } from 'zod';
13
+ import {
14
+ MCP_CONFIG_SECRETS, MCP_SYSTEM, McpServerConfig, mcpToolFnName, type McpApproval, type McpServerState, type McpServerStatus, type McpTransport,
15
+ } from '../shared/servers.ts';
16
+
17
+ /** The `mcp` system's name. */
18
+ export const MCP = SystemName.parse(MCP_SYSTEM);
19
+
20
+ /** One server's tabs. */
21
+ export const ServerTab = z.enum(['overview', 'tools', 'prompts', 'settings']);
22
+ export type ServerTab = z.infer<typeof ServerTab>;
23
+
24
+ /** Where the page's URL points: the list, or one server on a tab. */
25
+ export type ServersAt = { readonly kind: 'list' } | { readonly kind: 'server'; readonly instance: InstanceName; readonly tab: ServerTab } | { readonly kind: 'missing' };
26
+
27
+ /** The place a page path names (`[]`, `['linear']`, `['linear', 'tools']`). */
28
+ export function serversAt(path: readonly string[]): ServersAt {
29
+ const [first, second, ...rest] = path;
30
+ if (first === undefined) { return { kind: 'list' }; }
31
+ const instance = InstanceName.safeParse(first);
32
+ const tab = second === undefined ? { success: true as const, data: 'overview' as const } : ServerTab.safeParse(second);
33
+ if (!instance.success || !tab.success || rest.length > 0) { return { kind: 'missing' }; }
34
+ return { kind: 'server', instance: instance.data, tab: tab.data };
35
+ }
36
+
37
+ /** The page path of one server on a tab (the overview has none). */
38
+ export function serverPath(instance: InstanceName, tab: ServerTab = 'overview'): string[] {
39
+ return tab === 'overview' ? [instance] : [instance, tab];
40
+ }
41
+
42
+ export type McpTransportType = McpTransport['type'];
43
+
44
+ /** Each transport in words. */
45
+ export const TRANSPORT_WORDS = {
46
+ http: { label: 'HTTP', about: 'Streamable HTTP: a URL the server answers on (MCP 2025-03-26 and later).' },
47
+ sse: { label: 'SSE', about: 'The older HTTP + SSE transport (MCP 2024-11-05).' },
48
+ stdio: { label: 'Command', about: 'A program the hub starts on its own machine; credentials go in its environment.' },
49
+ } as const satisfies Record<McpTransportType, { readonly label: string; readonly about: string }>;
50
+
51
+ /** Each approval policy in words. */
52
+ export const APPROVAL_WORDS = {
53
+ writes: { label: 'Writes', about: 'Calls wait for approval unless a trusted server marks the tool read-only.' },
54
+ always: { label: 'Always', about: 'Every call waits for approval.' },
55
+ never: { label: 'Never', about: 'No call waits (policies still apply).' },
56
+ } as const satisfies Record<McpApproval, { readonly label: string; readonly about: string }>;
57
+
58
+ /** An instance's own status as a badge (as the admin's systems pages show it). */
59
+ export const INSTANCE_LOOK = {
60
+ pairing: { tone: 'accent', word: 'Pairing', live: true },
61
+ 'needs-config': { tone: 'warn', word: 'Needs config', live: false },
62
+ connected: { tone: 'ok', word: 'Connected', live: true },
63
+ disconnected: { tone: 'neutral', word: 'Offline', live: false },
64
+ removed: { tone: 'danger', word: 'Removed', live: false },
65
+ } as const satisfies Record<SystemStatus, StatusLook>;
66
+
67
+ /** A server's state as a badge. */
68
+ export const MCP_STATE_LOOK = {
69
+ connecting: { tone: 'accent', word: 'Connecting', live: true },
70
+ connected: { tone: 'ok', word: 'Connected', live: false },
71
+ 'needs-auth': { tone: 'warn', word: 'Needs sign-in', live: false },
72
+ unreachable: { tone: 'danger', word: 'Unreachable', live: false },
73
+ failed: { tone: 'danger', word: 'Failed', live: false },
74
+ } as const satisfies Record<McpServerState, StatusLook>;
75
+
76
+ /** An MCP server's form as the inputs hold it. Numbers are text as typed; the timeout is in seconds. */
77
+ export interface McpServerDraft {
78
+ readonly label: string;
79
+ readonly description: string;
80
+ readonly transport: McpTransportType;
81
+ readonly command: string;
82
+ readonly args: readonly string[];
83
+ readonly env: readonly PairRow[];
84
+ /** The hub keeps the environment values; replacing them clears this. */
85
+ readonly envKept: boolean;
86
+ readonly cwd: string;
87
+ readonly url: string;
88
+ readonly auth: AuthDraft;
89
+ readonly trusted: boolean;
90
+ readonly approval: McpApproval;
91
+ readonly prompts: boolean;
92
+ readonly resources: boolean;
93
+ readonly maxTools: string;
94
+ readonly timeout: string;
95
+ }
96
+
97
+ /** A new server's settings: the schema's own defaults. */
98
+ const DEFAULTS = McpServerConfig.pick({ trusted: true, approval: true, prompts: true, resources: true, maxTools: true, timeout: true }).parse({});
99
+
100
+ /** The draft of a saved server config as the hub sent it (kept secrets as `SECRET_KEPT`), or a new server's. */
101
+ export function mcpServerDraft(value?: Json): McpServerDraft {
102
+ const kept = keptPaths(value, MCP_CONFIG_SECRETS);
103
+ const config = readMcpServer(value);
104
+ const t = config?.transport;
105
+ const options = config ?? DEFAULTS;
106
+ return {
107
+ label: config?.label ?? '',
108
+ description: config?.description ?? '',
109
+ transport: t?.type ?? 'http',
110
+ command: t?.type === 'stdio' ? t.command : '',
111
+ args: t?.type === 'stdio' ? t.args : [],
112
+ env: t?.type === 'stdio' ? rowsOf(t.env) : [],
113
+ envKept: kept.has('transport.env'),
114
+ cwd: t?.type === 'stdio' ? t.cwd ?? '' : '',
115
+ url: t !== undefined && t.type !== 'stdio' ? t.url : '',
116
+ auth: authDraft(config?.auth, kept),
117
+ trusted: options.trusted,
118
+ approval: options.approval,
119
+ prompts: options.prompts,
120
+ resources: options.resources,
121
+ maxTools: String(options.maxTools),
122
+ timeout: String(options.timeout / 1000),
123
+ };
124
+ }
125
+
126
+ /** The transport the draft describes (kept environment values left out). */
127
+ function transportOf(draft: McpServerDraft): JsonObject {
128
+ if (draft.transport !== 'stdio') { return { type: draft.transport, url: draft.url.trim() }; }
129
+ const env = draft.envKept ? undefined : recordOf(draft.env);
130
+ const cwd = textOr(draft.cwd);
131
+ return { type: 'stdio', command: draft.command.trim(), args: [...draft.args], ...(env === undefined ? {} : { env }), ...(cwd === undefined ? {} : { cwd }) };
132
+ }
133
+
134
+ /** The config a draft sends, checked with `McpServerConfig`; kept secrets go back as `SECRET_KEPT`. */
135
+ export function mcpServerConfig(draft: McpServerDraft): CheckedConfig {
136
+ // a command takes its credentials in its environment, so it signs in with nothing
137
+ const auth = draft.transport === 'stdio' ? { auth: { kind: 'none' }, kept: [] } : authCandidate(draft.auth);
138
+ const description = textOr(draft.description);
139
+ const maxTools = numberOr(draft.maxTools);
140
+ const timeout = numberOr(draft.timeout, 1000);
141
+ const candidate: JsonObject = {
142
+ label: draft.label.trim(),
143
+ ...(description === undefined ? {} : { description }),
144
+ transport: transportOf(draft),
145
+ auth: auth.auth,
146
+ trusted: draft.trusted,
147
+ approval: draft.approval,
148
+ prompts: draft.prompts,
149
+ resources: draft.resources,
150
+ ...(maxTools === undefined ? {} : { maxTools }),
151
+ ...(timeout === undefined ? {} : { timeout }),
152
+ };
153
+ const kept = [...auth.kept, ...(draft.transport === 'stdio' && draft.envKept ? ['transport.env'] : [])];
154
+ return checkConfig(McpServerConfig, candidate, kept);
155
+ }
156
+
157
+ /** Where a saved server is, in a few words: its URL, or its command line. */
158
+ export function transportText(config: McpServerConfig): string {
159
+ const t = config.transport;
160
+ return t.type === 'stdio' ? [t.command, ...t.args].join(' ') : t.url;
161
+ }
162
+
163
+ /** A saved server config as the hub sent it, read (kept secrets left out), or undefined when it isn't one. */
164
+ export function readMcpServer(value: Json | undefined): McpServerConfig | undefined {
165
+ const read = McpServerConfig.safeParse(withoutKept(value, MCP_CONFIG_SECRETS));
166
+ return read.success ? read.data : undefined;
167
+ }
168
+
169
+ /** A server's counts in words: tools, prompts and resources it mirrors. */
170
+ export function countsText(status: Pick<McpServerStatus, 'tools' | 'prompts' | 'resources'>): string {
171
+ const count = (n: number, one: string): string => `${n} ${n === 1 ? one : `${one}s`}`;
172
+ return [count(status.tools, 'tool'), count(status.prompts, 'prompt'), count(status.resources, 'resource')].join(' · ');
173
+ }
174
+
175
+ /**
176
+ * The start of the local name of everything a server mirrors (`linear_`): its tools are `<instance>_<tool>`, and its
177
+ * prompts are named the same way.
178
+ */
179
+ export function mirrorPrefix(instance: InstanceName): string {
180
+ return mcpToolFnName(instance, 'x').slice(0, -1);
181
+ }
182
+
183
+ /** The most prompts of one server read at once. */
184
+ export const PROMPTS_PAGE = 200;
185
+
186
+ /** The hub `contexts` list query for one server's prompts: the `mcp` system's items named with its prefix. */
187
+ export function promptsQuery(instance: InstanceName): QueryFnArgs {
188
+ return {
189
+ list: 'contexts',
190
+ query: {
191
+ filters: [{ field: 'system', op: 'is', value: MCP }, { field: 'name', op: 'contains', value: mirrorPrefix(instance) }],
192
+ sort: [{ field: 'name', dir: 'asc' }], limit: PROMPTS_PAGE,
193
+ },
194
+ };
195
+ }
196
+
197
+ /** The context items among these that are a server's prompts (by the prefix of their local name). */
198
+ export function promptsOf(items: readonly ContextRecord[], instance: InstanceName): ContextRecord[] {
199
+ const start = `${MCP}/${mirrorPrefix(instance)}`;
200
+ return items.filter((item) => item.name.startsWith(start));
201
+ }
202
+
203
+ /** A prompt's `/command`, as people type it in the chat. */
204
+ export function commandText(item: ContextRecord): string | undefined {
205
+ return item.decl.command === undefined ? undefined : `/${item.decl.command.name}`;
206
+ }
207
+
208
+ /** Whether a tool's fn is one the server's schema mapped only loosely (named in the status's `degraded`). */
209
+ export function isDegraded(status: McpServerStatus | undefined, instance: InstanceName, fn: QualifiedName): boolean {
210
+ return status?.degraded.some((tool) => fn.endsWith(`/${mcpToolFnName(instance, tool)}`)) === true;
211
+ }
212
+
213
+ /** A server's status as read: the status, or why it could not be read. */
214
+ export type StatusRead = { readonly status: McpServerStatus } | { readonly problem: string };
215
+
216
+ /**
217
+ * How a server looks on the list: its instance's own status while it is not connected to the hub (offline, needing
218
+ * config), else the state it reports with its server, else that the status could not be read.
219
+ */
220
+ export function serverLook(instance: SystemStatus, read: StatusRead | undefined): StatusLook {
221
+ if (instance !== 'connected') { return INSTANCE_LOOK[instance]; }
222
+ if (read === undefined) { return MCP_STATE_LOOK.connecting; }
223
+ return 'status' in read ? MCP_STATE_LOOK[read.status.state] : { tone: 'warn', word: 'Status unknown', live: false };
224
+ }
@@ -0,0 +1,128 @@
1
+ /**
2
+ * The MCP servers page's state, over the hub client the page host gives (calls run as the admin looking at it). The
3
+ * list is this system's instances, each with its status (`mcp/server_status` read quietly on that instance: state, what
4
+ * the server said about itself, counts, degraded tools); adding one (`addInstance`: the hub installs the bundled folder,
5
+ * pairs, configures and starts it), saving one's config (`configureSystem`, kept secrets sent back as `SECRET_KEPT`) and
6
+ * removing one. One server's page adds what it mirrors into the hub: its tools (the fns routed to it), its prompts
7
+ * (context items with `/commands`, by the hub's `contexts` list) and its resources (under `mcp://<instance>/`, browsed
8
+ * in the resource browser).
9
+ */
10
+ import { ContextRecord, QualifiedName, type FnRecord, type InstanceName, type InstanceRef, type InstanceView, type JsonObject } from '@harness/core';
11
+ import type { HubClient } from '@harness/sdk';
12
+ import { Loaded, problemText, Task, type Outcome } from '@harness/sdk/client-ui/state';
13
+ import { shallowRef } from 'vue';
14
+ import { McpServerStatus } from '../shared/servers.ts';
15
+ import { MCP, promptsOf, promptsQuery, type StatusRead } from './logic.ts';
16
+
17
+ /** The fn that answers a server's status. */
18
+ export const SERVER_STATUS_FN = QualifiedName.parse(`${MCP}/server_status`);
19
+
20
+ /** What saving a config came to: its new version, or the hub's problems with it. */
21
+ export type ConfigResult = { readonly ok: true; readonly version: number } | { readonly ok: false; readonly problems: readonly string[] };
22
+
23
+ /** The fns a fleet instance owns: those routed to it alone. */
24
+ export function instanceFns(fns: readonly FnRecord[], instance: InstanceName): FnRecord[] {
25
+ return fns.filter((fn) => fn.decl.routing?.to === 'instance' && fn.decl.routing.instance === instance);
26
+ }
27
+
28
+ /** The MCP servers, their statuses, and the open server's tools and prompts; adding, changing and removing servers. */
29
+ export class McpServersStore {
30
+ readonly #hub: Pick<HubClient, 'caller'>;
31
+ readonly list = new Loaded<readonly InstanceView[]>();
32
+ readonly adding = new Task();
33
+ readonly saving = new Task();
34
+ readonly removing = new Task();
35
+ /** Each server's last status read, by instance. */
36
+ readonly statuses = shallowRef<ReadonlyMap<InstanceName, StatusRead>>(new Map());
37
+ /** The open server. */
38
+ readonly open = shallowRef<InstanceName | undefined>(undefined);
39
+ readonly tools = new Loaded<readonly FnRecord[]>();
40
+ readonly prompts = new Loaded<readonly ContextRecord[]>();
41
+
42
+ constructor(hub: Pick<HubClient, 'caller'>) {
43
+ this.#hub = hub;
44
+ }
45
+
46
+ /** Read the servers; `quiet` keeps the loading state off (a refresh). */
47
+ async loadList(quiet = false): Promise<void> {
48
+ await this.list.load(() => this.#hub.caller('instances').call({ system: MCP }), "Couldn't load the MCP servers.", quiet);
49
+ }
50
+
51
+ /** Read the servers, then each one's status. */
52
+ async load(quiet = false): Promise<void> {
53
+ await this.loadList(quiet);
54
+ await Promise.all((this.list.value.value ?? []).map((view) => this.readStatus(view.instance)));
55
+ }
56
+
57
+ /** One server, once listed. */
58
+ find(instance: InstanceName): InstanceView | undefined {
59
+ return this.list.value.value?.find((view) => view.instance === instance);
60
+ }
61
+
62
+ /** Read one server's status from its instance. */
63
+ async readStatus(instance: InstanceName): Promise<void> {
64
+ let read: StatusRead;
65
+ try {
66
+ const result = await this.#hub.caller('readFn').call({ fn: SERVER_STATUS_FN, args: { instance } });
67
+ const parsed = McpServerStatus.safeParse(result);
68
+ read = parsed.success ? { status: parsed.data } : { problem: 'Its status came back in a shape this page does not know.' };
69
+ } catch (error) {
70
+ read = { problem: problemText(error, "Couldn't read its status.") };
71
+ }
72
+ this.statuses.value = new Map([...this.statuses.value, [instance, read]]);
73
+ }
74
+
75
+ /** The status of a server, once read. */
76
+ statusOf(instance: InstanceName): McpServerStatus | undefined {
77
+ const read = this.statuses.value.get(instance);
78
+ return read !== undefined && 'status' in read ? read.status : undefined;
79
+ }
80
+
81
+ /** Open one server's page: its status, tools and prompts (again, quietly, when it is the one open). */
82
+ async show(instance: InstanceName): Promise<void> {
83
+ const same = this.open.value === instance;
84
+ if (!same) { this.close(); }
85
+ this.open.value = instance;
86
+ await Promise.all([
87
+ this.loadList(this.list.value.value !== undefined),
88
+ this.readStatus(instance),
89
+ this.tools.load(async () => instanceFns(await this.#hub.caller('systemFns').call({ system: MCP }), instance), "Couldn't load its tools.", same),
90
+ this.prompts.load(async () => {
91
+ const page = await this.#hub.caller('query').call(promptsQuery(instance));
92
+ return promptsOf(ContextRecord.array().parse(page.items), instance);
93
+ }, "Couldn't load its prompts.", same),
94
+ ]);
95
+ }
96
+
97
+ close(): void {
98
+ this.open.value = undefined;
99
+ this.tools.reset();
100
+ this.prompts.reset();
101
+ }
102
+
103
+ /** Add a server as an instance with its config; the list is read again after. */
104
+ async add(instance: InstanceName, config: JsonObject, description?: string): Promise<Outcome<InstanceRef>> {
105
+ const result = await this.adding.run(
106
+ () => this.#hub.caller('addInstance').call({ system: MCP, instance, config, ...(description === undefined ? {} : { description }) }),
107
+ `Couldn't add ${instance}.`,
108
+ );
109
+ if (result.ok) { void this.load(true); }
110
+ return result;
111
+ }
112
+
113
+ /** Save a server's config; the hub refuses one that isn't valid for the config type, and says why. */
114
+ async configure(instance: InstanceName, config: JsonObject): Promise<ConfigResult> {
115
+ const result = await this.saving.run(() => this.#hub.caller('configureSystem').call({ system: MCP, instance, config }), "Couldn't save the settings.");
116
+ if (!result.ok) { return { ok: false, problems: [result.problem] }; }
117
+ if ('problems' in result.value) { return { ok: false, problems: result.value.problems }; }
118
+ void this.loadList(true);
119
+ return { ok: true, version: result.value.version };
120
+ }
121
+
122
+ /** Remove a server: its instance, fns, config and folders go. */
123
+ async remove(instance: InstanceName): Promise<boolean> {
124
+ const result = await this.removing.run(() => this.#hub.caller('removeInstance').call({ system: MCP, instance }), `Couldn't remove ${instance}.`);
125
+ if (result.ok && result.value.ok) { this.list.set((this.list.value.value ?? []).filter((view) => view.instance !== instance)); }
126
+ return result.ok && result.value.ok;
127
+ }
128
+ }
@@ -1,21 +1,24 @@
1
1
  {
2
2
  "dependencies": {
3
- "@aeye/gin": "^0.10.2",
4
- "@aeye/schema": "^0.10.2",
3
+ "@aeye/gin": "^0.11.1",
4
+ "@aeye/schema": "^0.11.1",
5
5
  "@ayepi/env": "^0.6.0",
6
6
  "@ayepi/mcp": "^0.6.0",
7
7
  "@harness/core": "*",
8
8
  "@harness/sdk": "*",
9
- "zod": "^4.6.7"
9
+ "zod": "^4.6.7",
10
+ "vue": "^3.5.22"
10
11
  },
11
12
  "name": "@harness/system-mcp",
12
13
  "private": true,
13
- "version": "0.3.0",
14
+ "version": "0.4.0",
14
15
  "license": "Apache-2.0",
15
16
  "type": "module",
16
- "description": "Development only: system.json holds this system's name, version and entries. Build 9 skeleton (mcp lane).",
17
+ "description": "Development only: system.json holds this system's name, version and entries. Its client draws the MCP servers admin page (/admin/s/mcp/servers).",
17
18
  "exports": {
18
19
  ".": "./shared/index.ts",
19
- "./server": "./server/index.ts"
20
+ "./servers": "./shared/servers.ts",
21
+ "./server": "./server/index.ts",
22
+ "./client": "./client/index.ts"
20
23
  }
21
24
  }
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { McpHttpClientTransport, McpSseClientTransport, type McpClientTransport } from '@ayepi/mcp';
7
7
  import { spawnStdioClient } from '@ayepi/mcp/node';
8
- import type { McpTransport } from '@harness/core';
8
+ import type { McpTransport } from '../shared/servers.ts';
9
9
 
10
10
  /** A transport to a server, and how to know it went away and to let it go. */
11
11
  export interface OpenedTransport {
@@ -5,7 +5,8 @@
5
5
  * holds the server; and the connect flow signs a person in (their token or headers, or OAuth through the hub's redirect)
6
6
  * and checks it by connecting with what they gave.
7
7
  */
8
- import { InstanceName, Json, McpServerConfig, McpToolSpec, type ImportReport } from '@harness/core';
8
+ import { InstanceName, Json, type ImportReport } from '@harness/core';
9
+ import { McpServerConfig, McpToolSpec } from '../shared/servers.ts';
9
10
  import { accountLabel, credentialsFromForm, wireType, type ConfigOf, type SystemCtx, type SystemImpl } from '@harness/sdk';
10
11
  import type { SystemPatch } from '@harness/sdk/server';
11
12
  import { ToolOutputType, type McpContract } from '../shared/index.ts';
@@ -5,11 +5,9 @@
5
5
  */
6
6
  import type { McpClient, McpElicitRequest, McpElicitResult, McpTool, McpToolResult } from '@ayepi/mcp';
7
7
  import { McpError } from '@ayepi/mcp';
8
- import {
9
- Json, JsonObject, McpServerConfig, ResourceUri, mcpRootOf, messageOf, type ConnectionUpdate, type ImportReport, type InstanceConnect, type InstanceName, type McpServerState,
10
- type McpServerStatus, type Page, type ReadWant, type RemoteCredentials, type ResourceRead, type ResourceRoot, type ResourceStat, type RunConnection, type RunInfo,
11
- } from '@harness/core';
12
- import { credentialHeaders, instanceConnectOf, readCredentials, sharedHeaders, usesConnections, type Log, type ResourceProvider } from '@harness/sdk';
8
+ import { Json, JsonObject, ResourceUri, messageOf, type ConnectionUpdate, type ImportReport, type InstanceConnect, type InstanceName, type Page, type ReadWant, type ResourceRead, type ResourceRoot, type ResourceStat, type RunConnection, type RunInfo } from '@harness/core';
9
+ import { McpServerConfig, mcpRootOf, type McpServerState, type McpServerStatus } from '../shared/servers.ts';
10
+ import { credentialHeaders, instanceConnectOf, readCredentials, sharedHeaders, usesConnections, type Log, type RemoteCredentials, type ResourceProvider } from '@harness/sdk';
13
11
  import type { SystemPatch } from '@harness/sdk/server';
14
12
  import type { z } from 'zod';
15
13
  import type { DialerFactory, Signer } from './dial.ts';
@@ -1,10 +1,12 @@
1
1
  /**
2
2
  * The MCP system's process, one per MCP server instance: real transports (a child process for stdio, signed `fetch`
3
3
  * for HTTP), served to the hub. Once serving, the lifecycle starts the instance, which connects and mirrors the
4
- * server's lists through the running system's runtime patches.
4
+ * server's lists through the running system's runtime patches. Its client (the MCP servers admin page) is built once
5
+ * into its state folder, unless it ships built, and served to the hub.
5
6
  */
7
+ import { join } from 'node:path';
6
8
  import type { ImportReport } from '@harness/core';
7
- import { loggedHost, serve, type RunningSystem, type SystemPatch } from '@harness/sdk/server';
9
+ import { loggedHost, rendererFolder, serve, type RunningSystem, type SystemPatch } from '@harness/sdk/server';
8
10
  import { mcp } from '../shared/index.ts';
9
11
  import { NodeDialers } from './dial.ts';
10
12
  import { mcpEnv } from './env.ts';
@@ -12,6 +14,7 @@ import { createMcpImpl } from './impl.ts';
12
14
 
13
15
  const settings = mcpEnv.parse();
14
16
  const { host, log } = loggedHost(mcp.name);
17
+ const clientFolder = await rendererFolder({ main: import.meta.url, outDir: join(settings.FNLOOM_SYSTEM_STATE, 'client') });
15
18
  const VERSION = '0.1.0';
16
19
 
17
20
  // the lifecycle starts the instance (and its first mirror) before `serve()` returns, so patches wait for it
@@ -26,11 +29,12 @@ const server = createMcpImpl({
26
29
  fetch: globalThis.fetch.bind(globalThis),
27
30
  });
28
31
 
29
- log.info('mcp.serving', { hub: settings.HARNESS_HUB, instance: settings.HARNESS_INSTANCE });
32
+ log.info('mcp.serving', { hub: settings.FNLOOM_HUB, instance: settings.FNLOOM_INSTANCE });
30
33
  const running = await serve(mcp, server.impl, {
31
- hub: settings.HARNESS_HUB,
32
- state: settings.HARNESS_SYSTEM_STATE,
33
- ...(settings.HARNESS_PAIRING_TOKEN === undefined ? {} : { pairingToken: settings.HARNESS_PAIRING_TOKEN }),
34
+ hub: settings.FNLOOM_HUB,
35
+ state: settings.FNLOOM_SYSTEM_STATE,
36
+ client: clientFolder,
37
+ ...(settings.FNLOOM_PAIRING_TOKEN === undefined ? {} : { pairingToken: settings.FNLOOM_PAIRING_TOKEN }),
34
38
  }, host);
35
39
  resolveRunning(running);
36
40
  running.onStatus((status) => { log.info('mcp.status', { status }); });
@@ -5,9 +5,8 @@
5
5
  * what it sent, so an unchanged entry is never sent twice and nothing is removed when a server stops listing it.
6
6
  */
7
7
  import type { McpPrompt, McpPromptResult, McpTool, McpToolResult } from '@ayepi/mcp';
8
- import {
9
- Json, mcpRootOf, ResourceUri, mcpToolFnName, type ContextDecl, type FnApproval, type FnDecl, type FnExample, type FnEffects, type FnMode, type InstanceName, type McpServerConfig, type McpToolSpec,
10
- } from '@harness/core';
8
+ import { Json, ResourceUri, type ContextDecl, type FnApproval, type FnDecl, type FnExample, type FnEffects, type FnMode, type InstanceName } from '@harness/core';
9
+ import { mcpRootOf, mcpToolFnName, type McpServerConfig, type McpToolSpec } from '../shared/servers.ts';
11
10
  import { fnDecl, sampleArgs, type GinType } from '@harness/sdk';
12
11
  import { z } from 'zod';
13
12
  import { mcp, ToolOutputType, type ToolOutput } from '../shared/index.ts';
@@ -10,7 +10,8 @@ import {
10
10
  OAuthError, authorizationUrl, discoverAuthorizationServer, discoverProtectedResource, exchangeCode, makePkce, parseBearerChallenge, refreshTokens, registerClient,
11
11
  resourceOf, tokensExpireAt, type AuthorizationServerMetadata, type BearerChallenge, type OAuthClient, type OAuthTokens,
12
12
  } from '@ayepi/mcp';
13
- import { messageOf, type ConnectFinish, type ConnectStart, type RemoteAuth, type RemoteCredentials } from '@harness/core';
13
+ import { messageOf, type ConnectFinish, type ConnectStart } from '@harness/core';
14
+ import type { RemoteAuth, RemoteCredentials } from '@harness/sdk';
14
15
  import type { McpProtocolVersion } from '@ayepi/mcp';
15
16
 
16
17
  /** The OAuth auth of an instance. */
@@ -5,7 +5,8 @@
5
5
  * used. It hears the server's `list_changed` notices and says where it is (`McpServerState`).
6
6
  */
7
7
  import { McpClient, McpError, McpHttpError, McpToolError, type McpElicitRequest, type McpElicitResult } from '@ayepi/mcp';
8
- import { messageOf, type McpServerState } from '@harness/core';
8
+ import { messageOf } from '@harness/core';
9
+ import type { McpServerState } from '../shared/servers.ts';
9
10
  import type { Dialer, OpenedTransport } from './dial.ts';
10
11
 
11
12
  /** The lists a server says changed. */
@@ -1,17 +1,25 @@
1
1
  /**
2
2
  * The MCP system's contract (`shared/`): the harness as an MCP client. Every MCP server a person adds is an instance
3
- * of this system (config core's `McpServerConfig`: stdio, HTTP or SSE; auth none, bearer, headers or OAuth, shared or
3
+ * of this system (config `McpServerConfig`, in `servers.ts`: stdio, HTTP or SSE; auth none, bearer, headers or OAuth, shared or
4
4
  * per person). The instance mirrors the server into the hub while it runs: each tool is a fn of kind `mcp/tool`
5
5
  * (`<instance>_<tool>`, run on that instance), each prompt a context item with a `/command`, each resource a hub
6
6
  * resource under `mcp://<instance>/`. Lists are mirrored again when the server says they changed; nothing is removed
7
7
  * when a server is down, so its fns stay and fail plainly until it is back. A question the server asks during a call
8
8
  * (an MCP elicitation) becomes a form on an approval card (`answer_elicitation`).
9
+ *
10
+ * Its client draws the MCP servers admin page (`/admin/s/mcp/servers`: the list, adding one, and one server's
11
+ * overview, tools, prompts and settings), in the admin nav's Systems group while the system is live.
9
12
  */
10
- import { ConnectDecl, MCP_CONFIG_SECRETS, MCP_SYSTEM, McpServerConfig, McpServerStatus, McpToolSpec } from '@harness/core';
13
+ import { ConnectDecl } from '@harness/core';
14
+ import { MCP_CONFIG_SECRETS, MCP_SYSTEM, McpServerConfig, McpServerStatus, McpToolSpec } from './servers.ts';
11
15
  import { fn, g, ginAs, kind, system, wireType } from '@harness/sdk';
12
16
  import { ElicitationReply, ElicitationSent, ServerOp, ServerTarget, ToolOutput } from './shapes.ts';
13
17
 
14
18
  export * from './shapes.ts';
19
+ export * from './servers.ts';
20
+
21
+ /** The admin page's segment: the servers at its root, one server under it (`servers/<instance>/<tab>`). */
22
+ export const MCP_SERVERS_PAGE = 'servers';
15
23
 
16
24
  /** A tool result's gin type when the tool declares no output schema. */
17
25
  export const ToolOutputType = ginAs(ToolOutput);
@@ -56,6 +64,11 @@ const declared = system(MCP_SYSTEM, {
56
64
  configSecrets: [...MCP_CONFIG_SECRETS],
57
65
  // tool calls may ask a person (elicitations) and act as their connection; each server is wherever its URL says
58
66
  grants: { hub: ['approvals', 'connections', 'resources'], network: ['*'] },
67
+ // the servers' admin page (client/ draws it): in the admin area, for admins, in its nav while the system is live
68
+ pages: [{
69
+ segment: MCP_SERVERS_PAGE, title: 'MCP servers', description: 'The MCP servers the hub connects to: adding one, where each is and how it signs in, and what it mirrors.',
70
+ icon: 'layers', nav: 'main', access: 'admin', area: 'admin', component: 'ServersPage',
71
+ }],
59
72
  })
60
73
  .with({
61
74
  config: ginAs(McpServerConfig),
@@ -9,13 +9,14 @@
9
9
  * - each resource is a resource under the instance's root `mcp://<instance>/`, read through the server.
10
10
  *
11
11
  * Elicitations the server sends during a call become a form on the call's approval card (`ProposeRun.ask`).
12
+ *
13
+ * These shapes moved here from core: only this system, its pages and the claude system (which imports Claude's MCP
14
+ * servers as instances) read them. A module of its own (`@harness/system-mcp/servers`), so a reader takes the shapes
15
+ * without the contract.
12
16
  */
17
+ import { FnLocalName, GinTypeDef, InstanceName, Json, Timestamp, type ConfigPath } from '@harness/core';
18
+ import { RemoteAuth, REMOTE_AUTH_SECRETS } from '@harness/sdk';
13
19
  import { z } from 'zod';
14
- import { GinTypeDef } from './gin.ts';
15
- import { InstanceName, Json, Timestamp } from './primitives.ts';
16
- import { FnLocalName } from './model-names.ts';
17
- import { RemoteAuth, REMOTE_AUTH_SECRETS } from './remote-auth.ts';
18
- import type { ConfigPath } from './config-secrets.ts';
19
20
 
20
21
  /** The bundled system every MCP server is an instance of. */
21
22
  export const MCP_SYSTEM = 'mcp';
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "format": 1,
3
3
  "name": "mcp",
4
- "version": "0.1.0",
4
+ "version": "0.2.0",
5
5
  "description": "Use the tools, prompts and resources of MCP servers: each server added is an instance, its tools are fns, its prompts are /commands and its resources are browsable.",
6
6
  "protocol": 1,
7
7
  "server": { "entry": "server/main.ts", "external": {} },
8
+ "client": { "entry": "client/index.ts" },
8
9
  "instances": "many",
9
10
  "permissions": { "childProcess": true }
10
11
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "extends": "../../tsconfig.base.json",
3
- "compilerOptions": { "rootDir": ".", "outDir": "../../.types/system-mcp", "tsBuildInfoFile": "../../.types/system-mcp.tsbuildinfo", "types": ["node"] },
4
- "include": ["shared", "server"],
3
+ "compilerOptions": { "rootDir": ".", "outDir": "../../.types/system-mcp", "tsBuildInfoFile": "../../.types/system-mcp.tsbuildinfo", "jsx": "preserve", "types": ["vite/client", "node"] },
4
+ "include": ["shared", "server", "client/**/*.ts", "client/**/*.vue"],
5
5
  "references": [{ "path": "../../packages/core" }, { "path": "../../packages/sdk" }]
6
6
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "dependencies": {
3
- "@aeye/ai": "^0.10.2",
4
- "@aeye/ollama": "^0.10.2",
3
+ "@aeye/ai": "^0.11.1",
4
+ "@aeye/ollama": "^0.11.1",
5
5
  "@ayepi/env": "^0.6.0",
6
6
  "@harness/core": "*",
7
7
  "@harness/sdk": "*",
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "name": "@harness/system-ollama",
12
12
  "private": true,
13
- "version": "0.3.0",
13
+ "version": "0.4.0",
14
14
  "license": "Apache-2.0",
15
15
  "type": "module",
16
16
  "description": "Development only: system.json holds this system's name, version and entries.",
@@ -48,14 +48,14 @@ const server = createOllamaImpl({
48
48
  });
49
49
 
50
50
  // the admin page, built into the state folder
51
- const clientFolder = await rendererFolder({ main: import.meta.url, outDir: join(settings.HARNESS_SYSTEM_STATE, 'client') });
51
+ const clientFolder = await rendererFolder({ main: import.meta.url, outDir: join(settings.FNLOOM_SYSTEM_STATE, 'client') });
52
52
 
53
- log.info('ollama.serving', { hub: settings.HARNESS_HUB, instance: settings.HARNESS_INSTANCE });
53
+ log.info('ollama.serving', { hub: settings.FNLOOM_HUB, instance: settings.FNLOOM_INSTANCE });
54
54
  const running = await serve(ollama, server.impl, {
55
- hub: settings.HARNESS_HUB,
56
- state: settings.HARNESS_SYSTEM_STATE,
55
+ hub: settings.FNLOOM_HUB,
56
+ state: settings.FNLOOM_SYSTEM_STATE,
57
57
  client: clientFolder,
58
- ...(settings.HARNESS_PAIRING_TOKEN === undefined ? {} : { pairingToken: settings.HARNESS_PAIRING_TOKEN }),
58
+ ...(settings.FNLOOM_PAIRING_TOKEN === undefined ? {} : { pairingToken: settings.FNLOOM_PAIRING_TOKEN }),
59
59
  }, host);
60
60
  running.onStatus((status) => { log.info('ollama.status', { status }); });
61
61
  await server.attach(async (models) => { await running.models(ollama.providers.server, models); });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "dependencies": {
3
- "@aeye/gin": "^0.10.2",
4
- "@aeye/schema": "^0.10.2",
3
+ "@aeye/gin": "^0.11.1",
4
+ "@aeye/schema": "^0.11.1",
5
5
  "@ayepi/core": "^0.6.0",
6
6
  "@ayepi/env": "^0.6.0",
7
7
  "@ayepi/work": "^0.6.0",
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "name": "@harness/system-schedule",
16
16
  "private": true,
17
- "version": "0.3.0",
17
+ "version": "0.4.0",
18
18
  "license": "Apache-2.0",
19
19
  "type": "module",
20
20
  "description": "Development only: system.json holds this system's name, version and entries.",