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.
- package/README.md +27 -20
- package/package.json +14 -11
- package/packages/build/package.json +2 -2
- package/packages/build/src/tests.ts +2 -2
- package/packages/cli/package.json +1 -1
- package/packages/cli/src/cli.ts +2 -2
- package/packages/cli/src/command.ts +2 -2
- package/packages/cli/src/commands/install.ts +1 -1
- package/packages/cli/src/commands/mcp.ts +6 -6
- package/packages/cli/src/commands/store.ts +3 -3
- package/packages/cli/src/hub.ts +25 -25
- package/packages/cli/src/index.ts +1 -1
- package/packages/cli/src/io.ts +2 -2
- package/packages/cli/src/local.ts +7 -7
- package/packages/cli/src/premade.ts +1 -1
- package/packages/core/package.json +4 -4
- package/packages/core/src/auto-pair.ts +1 -1
- package/packages/core/src/connections.ts +1 -14
- package/packages/core/src/context-graph.ts +1 -1
- package/packages/core/src/data.ts +1 -1
- package/packages/core/src/https.ts +2 -2
- package/packages/core/src/identity.ts +1 -1
- package/packages/core/src/image-embeddings.ts +1 -1
- package/packages/core/src/index.ts +5 -7
- package/packages/core/src/link.ts +1 -1
- package/packages/core/src/manifest.ts +2 -2
- package/packages/core/src/mention-search.ts +1 -1
- package/packages/core/src/model-calls.ts +1 -1
- package/packages/core/src/package.ts +1 -1
- package/packages/core/src/ports.ts +2 -2
- package/packages/core/src/query.ts +1 -1
- package/packages/core/src/records/chat.ts +1 -1
- package/packages/core/src/records/runs.ts +1 -1
- package/packages/core/src/records/spend.ts +4 -0
- package/packages/core/src/registries.ts +9 -3
- package/packages/core/src/sso.ts +2 -2
- package/packages/core/src/stores.ts +1 -1
- package/packages/core/src/suggestions.ts +2 -2
- package/packages/core/src/system-pages.ts +32 -6
- package/packages/core/src/tables.ts +233 -0
- package/packages/core/src/visuals.ts +47 -139
- package/packages/core/src/web.ts +2 -2
- package/packages/core/src/widgets-v1.ts +78 -1
- package/packages/hub/package.json +13 -11
- package/packages/hub/src/api/admin-ops.ts +5 -5
- package/packages/hub/src/api/auth.ts +2 -2
- package/packages/hub/src/api/https.ts +6 -6
- package/packages/hub/src/api/identities.ts +1 -1
- package/packages/hub/src/api/reads.ts +1 -1
- package/packages/hub/src/api/secrets.ts +1 -1
- package/packages/hub/src/api/serve.ts +2 -2
- package/packages/hub/src/api/sso-route.ts +2 -2
- package/packages/hub/src/api/sso.ts +6 -6
- package/packages/hub/src/api/testing/rig.ts +1 -1
- package/packages/hub/src/api/tls.ts +2 -2
- package/packages/hub/src/api/web/auth.ts +1 -1
- package/packages/hub/src/api/web/find.ts +1 -1
- package/packages/hub/src/api/web/pages.ts +4 -3
- package/packages/hub/src/api/web/pickers.ts +4 -4
- package/packages/hub/src/boot/env.ts +82 -78
- package/packages/hub/src/boot/hub-fns.ts +1 -1
- package/packages/hub/src/boot/identity.ts +2 -2
- package/packages/hub/src/boot/index.ts +1 -1
- package/packages/hub/src/boot/info.ts +1 -1
- package/packages/hub/src/boot/keys.ts +6 -6
- package/packages/hub/src/boot/log.ts +4 -4
- package/packages/hub/src/boot/modules.ts +4 -4
- package/packages/hub/src/boot/services.ts +9 -9
- package/packages/hub/src/boot/start.ts +23 -23
- package/packages/hub/src/chat/cache.ts +1 -1
- package/packages/hub/src/chat/chat.ts +1 -1
- package/packages/hub/src/chat/compare.ts +2 -2
- package/packages/hub/src/chat/deliveries.ts +1 -1
- package/packages/hub/src/chat/deps.ts +3 -3
- package/packages/hub/src/chat/enrich.ts +7 -7
- package/packages/hub/src/chat/env.ts +20 -20
- package/packages/hub/src/chat/mention-requests.ts +1 -1
- package/packages/hub/src/chat/mention-search.ts +1 -1
- package/packages/hub/src/chat/mentions.ts +3 -3
- package/packages/hub/src/chat/notifications.ts +2 -2
- package/packages/hub/src/chat/presence.ts +2 -2
- package/packages/hub/src/chat/sessions.ts +2 -2
- package/packages/hub/src/chat/suggestions.ts +8 -8
- package/packages/hub/src/chat/testing.ts +1 -1
- package/packages/hub/src/chat/turns.ts +6 -6
- package/packages/hub/src/chat/undo.ts +1 -1
- package/packages/hub/src/connections/create.ts +1 -1
- package/packages/hub/src/connections/env.ts +2 -2
- package/packages/hub/src/connections/service.ts +5 -9
- package/packages/hub/src/contextor/contextors.ts +9 -9
- package/packages/hub/src/contextor/crawl.ts +1 -1
- package/packages/hub/src/contextor/create.ts +5 -5
- package/packages/hub/src/contextor/dynamic.ts +5 -5
- package/packages/hub/src/contextor/env.ts +46 -46
- package/packages/hub/src/contextor/injected.ts +1 -1
- package/packages/hub/src/contextor/limits.ts +9 -9
- package/packages/hub/src/contextor/planner.ts +11 -11
- package/packages/hub/src/contextor/testing.ts +1 -1
- package/packages/hub/src/data/env.ts +3 -3
- package/packages/hub/src/data/service.ts +5 -5
- package/packages/hub/src/execution/agent.ts +8 -8
- package/packages/hub/src/execution/ai.ts +7 -7
- package/packages/hub/src/execution/create.ts +11 -6
- package/packages/hub/src/execution/env.ts +16 -16
- package/packages/hub/src/execution/executors.ts +2 -2
- package/packages/hub/src/execution/gateway.ts +1 -1
- package/packages/hub/src/execution/index.ts +1 -1
- package/packages/hub/src/execution/ledger.ts +2 -2
- package/packages/hub/src/execution/limits.ts +2 -2
- package/packages/hub/src/execution/models.ts +2 -2
- package/packages/hub/src/execution/ports.ts +1 -1
- package/packages/hub/src/execution/providers.ts +55 -11
- package/packages/hub/src/execution/queues.ts +6 -6
- package/packages/hub/src/execution/runs.ts +10 -10
- package/packages/hub/src/execution/stream-guard.ts +2 -2
- package/packages/hub/src/execution/testing.ts +5 -5
- package/packages/hub/src/execution/wire.ts +3 -3
- package/packages/hub/src/fns/auto.ts +2 -2
- package/packages/hub/src/fns/client-logs.ts +2 -2
- package/packages/hub/src/fns/create.ts +2 -2
- package/packages/hub/src/fns/decided.ts +2 -2
- package/packages/hub/src/fns/env.ts +14 -14
- package/packages/hub/src/fns/examples.ts +3 -3
- package/packages/hub/src/fns/facts.ts +5 -5
- package/packages/hub/src/fns/search.ts +5 -5
- package/packages/hub/src/graph/graph.ts +1 -1
- package/packages/hub/src/index/context-sections.ts +1 -1
- package/packages/hub/src/index/embedders.ts +3 -3
- package/packages/hub/src/index/env.ts +12 -12
- package/packages/hub/src/index/index.ts +1 -1
- package/packages/hub/src/index/indexer.ts +4 -4
- package/packages/hub/src/index/search.ts +1 -1
- package/packages/hub/src/index/testing.ts +2 -2
- package/packages/hub/src/link/build.ts +32 -32
- package/packages/hub/src/link/env.ts +14 -14
- package/packages/hub/src/link/grants.ts +10 -10
- package/packages/hub/src/link/lifecycle.ts +4 -4
- package/packages/hub/src/link/migrate-api.ts +55 -15
- package/packages/hub/src/link/pairing.ts +1 -1
- package/packages/hub/src/link/process.ts +1 -1
- package/packages/hub/src/link/rig.ts +12 -12
- package/packages/hub/src/link/supervisor.ts +1 -1
- package/packages/hub/src/mcp/calls.ts +6 -6
- package/packages/hub/src/mcp/create.ts +5 -5
- package/packages/hub/src/mcp/env.ts +6 -6
- package/packages/hub/src/mcp/fns.ts +2 -2
- package/packages/hub/src/mcp/index.ts +2 -2
- package/packages/hub/src/mcp/sources.ts +3 -3
- package/packages/hub/src/mcp/tokens.ts +1 -1
- package/packages/hub/src/models/create.ts +1 -1
- package/packages/hub/src/models/decide.ts +2 -2
- package/packages/hub/src/models/index.ts +1 -1
- package/packages/hub/src/models/roles.ts +12 -12
- package/packages/hub/src/query/env.ts +5 -5
- package/packages/hub/src/query/sources.ts +3 -3
- package/packages/hub/src/questions/plans.ts +1 -1
- package/packages/hub/src/questions/worker.ts +2 -2
- package/packages/hub/src/resources/context.ts +3 -3
- package/packages/hub/src/resources/converters.ts +2 -2
- package/packages/hub/src/resources/create.ts +6 -6
- package/packages/hub/src/resources/env.ts +15 -15
- package/packages/hub/src/resources/fetch.ts +5 -5
- package/packages/hub/src/resources/forms.ts +5 -5
- package/packages/hub/src/resources/index.ts +1 -1
- package/packages/hub/src/resources/library.ts +2 -2
- package/packages/hub/src/resources/raw.ts +1 -1
- package/packages/hub/src/resources/reader.ts +2 -2
- package/packages/hub/src/resources/sqlite-files.ts +1 -1
- package/packages/hub/src/resources/storage.ts +5 -5
- package/packages/hub/src/resources/testing.ts +6 -6
- package/packages/hub/src/store/env.ts +4 -4
- package/packages/hub/src/store/hybrid.ts +4 -4
- package/packages/hub/src/store/sqlite.ts +3 -3
- package/packages/hub/src/stores/drivers.ts +2 -2
- package/packages/hub/src/stores/host.ts +3 -3
- package/packages/hub/src/stores/moves.ts +2 -2
- package/packages/hub/src/stores/service.ts +2 -2
- package/packages/hub/src/tables/env.ts +3 -3
- package/packages/hub/src/tables/index.ts +5 -5
- package/packages/hub/src/tables/service.ts +7 -7
- package/packages/sdk/AUTHORING.md +1206 -881
- package/packages/sdk/package.json +11 -8
- package/packages/sdk/src/agent.ts +1 -1
- package/packages/sdk/src/app-parts.ts +95 -0
- package/packages/sdk/src/authored.ts +26 -0
- package/packages/sdk/src/authoring.ts +13 -30
- package/packages/sdk/src/client-runtime.ts +24 -1
- package/packages/sdk/src/client-ui/AddServiceDialog.vue +43 -0
- package/packages/sdk/src/client-ui/InstanceNameField.vue +29 -0
- package/packages/sdk/src/client-ui/PairRowsEditor.vue +74 -0
- package/packages/sdk/src/client-ui/RemoteAuthFields.vue +95 -0
- package/packages/sdk/src/client-ui/ServiceRows.vue +57 -0
- package/packages/sdk/src/client-ui/draft.ts +10 -0
- package/packages/sdk/src/client-ui/host.ts +37 -0
- package/packages/sdk/src/client-ui/index.ts +19 -0
- package/packages/sdk/src/client-ui/loaded.ts +69 -0
- package/packages/sdk/src/client-ui/problems.ts +98 -0
- package/packages/sdk/src/client-ui/remote-config.ts +199 -0
- package/packages/sdk/src/client-ui/service-rows.ts +25 -0
- package/packages/sdk/src/client-ui/state.ts +14 -0
- package/packages/sdk/src/client-ui/testing.ts +147 -0
- package/packages/sdk/src/client-ui/vue-shim.d.ts +13 -0
- package/packages/sdk/src/client.ts +82 -11
- package/packages/sdk/src/hub.ts +4 -4
- package/packages/sdk/src/index.ts +13 -9
- package/packages/sdk/src/page-parts.ts +4 -0
- package/packages/sdk/src/program/env.ts +7 -7
- package/packages/sdk/src/program/runtime.ts +5 -5
- package/packages/sdk/src/program/tools.ts +3 -3
- package/packages/sdk/src/remote-auth.ts +128 -7
- package/packages/sdk/src/server/context-files.ts +1 -1
- package/packages/sdk/src/server/env.ts +36 -36
- package/packages/sdk/src/server/fake-hub-widgets.ts +7 -6
- package/packages/sdk/src/server/host.ts +28 -28
- package/packages/sdk/src/server/index.ts +2 -2
- package/packages/sdk/src/server/live.ts +4 -4
- package/packages/sdk/src/server/llm-wire.ts +4 -4
- package/packages/sdk/src/server/pairing.ts +1 -1
- package/packages/sdk/src/server/results.ts +4 -4
- package/packages/sdk/src/server/socket-guard.ts +1 -1
- package/packages/sdk/src/server/start-gate.ts +2 -2
- package/packages/sdk/src/server/store/engines.ts +2 -2
- package/packages/sdk/src/server/store/keeper.ts +2 -2
- package/packages/sdk/src/server/supervise.ts +4 -4
- package/packages/sdk/src/testing/env.ts +6 -6
- package/packages/sdk/src/testing/hub.ts +3 -1
- package/packages/sdk/src/testing/models.ts +3 -3
- package/packages/sdk/src/testing/openrouter.ts +3 -2
- package/packages/sdk/src/testing/preview.ts +7 -7
- package/packages/sdk/src/widgets.ts +21 -136
- package/packages/sdk/tsconfig.json +2 -2
- package/packages/web/dist/assets/{ActorSettingsView-v2k7v454.js → ActorSettingsView-CDszUbHz.js} +2 -2
- package/packages/web/dist/assets/AdminLayout-CFIz4GsQ.js +2 -0
- package/packages/web/dist/assets/{AdminLayout-1hbRPV3d.css → AdminLayout-ggcdQGlQ.css} +1 -1
- package/packages/web/dist/assets/{AppPage-CFmKZS8G.js → AppPage-BvoVTk6h.js} +2 -2
- package/packages/web/dist/assets/{AutoPairPicker-C61gihmh.js → AutoPairPicker-CLjD-muP.js} +2 -2
- package/packages/web/dist/assets/{BrowserFrame-Sq9EmQRT.js → BrowserFrame-BcN-A76X.js} +2 -2
- package/packages/web/dist/assets/ChatPage-DhTpAyM2.js +4 -0
- package/packages/web/dist/assets/{ChatPage-CbsRmktV.css → ChatPage-DjPv238m.css} +1 -1
- package/packages/web/dist/assets/{CodeViewer-tUNXZB77.js → CodeViewer-K9jrTmFO.js} +2 -2
- package/packages/web/dist/assets/ConfigWithCustom-BvrvSVIp.js +3 -0
- package/packages/web/dist/assets/{ConfirmDialog-Dd3E4sJt.js → ConfirmDialog-BDvLleYf.js} +2 -2
- package/packages/web/dist/assets/{ConnectPage-CX9acyQH.js → ConnectPage-Dg6IPNNh.js} +2 -2
- package/packages/web/dist/assets/ContextItemPage-qisBQetR.js +2 -0
- package/packages/web/dist/assets/ContextPage-DXa6Yqk-.js +3 -0
- package/packages/web/dist/assets/{ContextRow-DrtPumZ5.js → ContextRow-DDYnYRaL.js} +2 -2
- package/packages/web/dist/assets/{DataPage-DDSsxHro.js → DataPage-DOE_pKAY.js} +2 -2
- package/packages/web/dist/assets/DataTypePage-BnP_JELT.js +2 -0
- package/packages/web/dist/assets/{DataTypePage-Cr238Hx_.css → DataTypePage-CWrWvUPs.css} +1 -1
- package/packages/web/dist/assets/{DesignPage-6e0XbOFC.js → DesignPage-B9MJbF10.js} +3 -3
- package/packages/web/dist/assets/{ExplorePage-B7ND0W0l.js → ExplorePage-cRDQZRea.js} +2 -2
- package/packages/web/dist/assets/{FnPill-Cp3KuLmP.js → FnPill-CbLZCXYM.js} +2 -2
- package/packages/web/dist/assets/{FnView-C0XZdnsS.js → FnView-CG_wBKTP.js} +2 -2
- package/packages/web/dist/assets/{FnsView-GTH3p7a0.js → FnsView-BybyK12w.js} +2 -2
- package/packages/web/dist/assets/{GinExprView-DGxns6lH.js → GinExprView-BYCKSD_n.js} +2 -2
- package/packages/web/dist/assets/{GinForm-BDBUzuDP.js → GinForm-CXjYVf2_.js} +2 -2
- package/packages/web/dist/assets/{GinTypeView-CUsymbVf.js → GinTypeView-Bmbmx9e_.js} +2 -2
- package/packages/web/dist/assets/{GinValueView-jsKIfiEA.js → GinValueView-CWUzS7ti.js} +2 -2
- package/packages/web/dist/assets/{GraphPage-BCcPPsHu.js → GraphPage-D6OhckfJ.js} +2 -2
- package/packages/web/dist/assets/GraphPanel-BTitgA-K.js +2 -0
- package/packages/web/dist/assets/{HubPicker-EoOErgmk.js → HubPicker-DVly8dLD.js} +2 -2
- package/packages/web/dist/assets/{InboxApprovals-Dkq7DFp_.js → InboxApprovals-BF84edZU.js} +2 -2
- package/packages/web/dist/assets/{InboxPage-CHhslePq.js → InboxPage-DohZ9EDP.js} +2 -2
- package/packages/web/dist/assets/InjectedList-e6qr1kdU.js +2 -0
- package/packages/web/dist/assets/{InstallDialog-D-VwfZYF.js → InstallDialog-JJCKYs2s.js} +2 -2
- package/packages/web/dist/assets/InstanceTypes-BqUzx87o.js +2 -0
- package/packages/web/dist/assets/InstanceView-C73pev7A.js +2 -0
- package/packages/web/dist/assets/{ItemHistory-NQAP69ma.js → ItemHistory-dbGgOZsw.js} +2 -2
- package/packages/web/dist/assets/LimitsView-Ddp5WakY.js +2 -0
- package/packages/web/dist/assets/{ListSearch-BunVrDO0.js → ListSearch-CYNNAuMB.js} +2 -2
- package/packages/web/dist/assets/{LlmCallDetails-BoVNDTVs.js → LlmCallDetails-C9H5Hc2J.js} +2 -2
- package/packages/web/dist/assets/{LlmCallsView-BGpV92RC.js → LlmCallsView-CBqyZ8Cj.js} +2 -2
- package/packages/web/dist/assets/{LoadState-h-K9bTYc.js → LoadState-B2YhZlyC.js} +2 -2
- package/packages/web/dist/assets/McpDialog-DhlLklIq.js +2 -0
- package/packages/web/dist/assets/{McpView-GPXdCMne.js → McpView-D_ZmNO56.js} +2 -2
- package/packages/web/dist/assets/{McpsView-DJIR2JX5.js → McpsView-9_gwBuzw.js} +2 -2
- package/packages/web/dist/assets/{MemoryDialog-BTeIHQyA.js → MemoryDialog-pTHIxKEX.js} +2 -2
- package/packages/web/dist/assets/{ModelCallsView-DMcnwF2S.js → ModelCallsView-FHv2XWRX.js} +2 -2
- package/packages/web/dist/assets/{ModelPicker-CgkMFxSO.js → ModelPicker-EqOuvVnE.js} +2 -2
- package/packages/web/dist/assets/ModelsView-D9UaL4PX.js +2 -0
- package/packages/web/dist/assets/{NotFoundPage-Tk92K7HN.js → NotFoundPage-BsuJysan.js} +2 -2
- package/packages/web/dist/assets/{PairPage-D0BK8CCw.js → PairPage-B_ZXsbL4.js} +2 -2
- package/packages/web/dist/assets/{PanelHost-C-gKrxAk.js → PanelHost-Dx-vNNl5.js} +2 -2
- package/packages/web/dist/assets/PeopleView-D6dmEgMs.js +2 -0
- package/packages/web/dist/assets/{PeopleView-CJ8yArTh.css → PeopleView-DBxdbT1C.css} +1 -1
- package/packages/web/dist/assets/{PoliciesView-BRi-QAuo.js → PoliciesView-Bn4rm-ao.js} +2 -2
- package/packages/web/dist/assets/{RefusalList-DVO0bmeB.js → RefusalList-aosRD1ie.js} +2 -2
- package/packages/web/dist/assets/RendererHost-Ym_SMkhp.css +1 -0
- package/packages/web/dist/assets/RendererHost-rjnpSgyQ.js +2 -0
- package/packages/web/dist/assets/{ResourceViewer-Do0chYxU.js → ResourceViewer-C4tRColf.js} +2 -2
- package/packages/web/dist/assets/ResourcesPage-7mCLBORZ.js +2 -0
- package/packages/web/dist/assets/ResultGrid-CL2WSYQH.css +1 -0
- package/packages/web/dist/assets/ResultGrid-GIMoQUAr.js +2 -0
- package/packages/web/dist/assets/{ReviewSummaryStrip-DO3p64Qj.js → ReviewSummaryStrip-Bvjn3Iq8.js} +2 -2
- package/packages/web/dist/assets/ReviewView-DIqsUedT.js +3 -0
- package/packages/web/dist/assets/{RuleRow-DX9v4iGP.js → RuleRow-zRg-e8Vj.js} +2 -2
- package/packages/web/dist/assets/RunCard-C7wOGaw8.js +2 -0
- package/packages/web/dist/assets/RunCard-CSDiz-Nt.css +1 -0
- package/packages/web/dist/assets/{RunDetails-DjR206q6.js → RunDetails-W4GbE6AE.js} +2 -2
- package/packages/web/dist/assets/{RunDot-lHRICdM5.js → RunDot-C46uzzNM.js} +2 -2
- package/packages/web/dist/assets/{RunPage-CbAQ_WPR.js → RunPage-DPLtZpeB.js} +2 -2
- package/packages/web/dist/assets/{RunProgress-C3-B4tQf.js → RunProgress-Cr_6TBaF.js} +2 -2
- package/packages/web/dist/assets/{RunsView-DMkPmkqX.js → RunsView-tU350TPK.js} +2 -2
- package/packages/web/dist/assets/SettingsPage-B8QmmMN3.js +3 -0
- package/packages/web/dist/assets/{SettingsPage-t03BqXw8.css → SettingsPage-BTl3Ie4F.css} +1 -1
- package/packages/web/dist/assets/SignInPage-CXxLf7Rp.css +1 -0
- package/packages/web/dist/assets/{SignInPage-ByqGEZfj.js → SignInPage-DTwdqlnB.js} +2 -2
- package/packages/web/dist/assets/{StatusBadge-CXne0sRZ.js → StatusBadge-D7wKMAcD.js} +2 -2
- package/packages/web/dist/assets/{StorePlacementStep-B6SwTmdM.js → StorePlacementStep-C04nRU-u.js} +2 -2
- package/packages/web/dist/assets/{SystemConfig-vQDL_eUl.js → SystemConfig-CE3keXWq.js} +2 -2
- package/packages/web/dist/assets/SystemPageHost-CEhz4li8.js +2 -0
- package/packages/web/dist/assets/SystemPageHost-DX7LrFoN.css +1 -0
- package/packages/web/dist/assets/SystemView-CBFzEGfm.js +2 -0
- package/packages/web/dist/assets/SystemsView-0G8JntMV.js +2 -0
- package/packages/web/dist/assets/TableView-BK0uwLHl.js +3 -0
- package/packages/web/dist/assets/TableView-B_4MViVb.css +1 -0
- package/packages/web/dist/assets/{TableViewer-Boxx86f5.js → TableViewer-nbMInGJJ.js} +3 -3
- package/packages/web/dist/assets/{ThemePicker-CIg_oRQX.js → ThemePicker-fZpVSYqG.js} +2 -2
- package/packages/web/dist/assets/{TurnTree-Ecm0yA5g.js → TurnTree-Co-iBqhT.js} +2 -2
- package/packages/web/dist/assets/{UserMessage-BtECa8ka.css → UserMessage-B63G9sxC.css} +1 -1
- package/packages/web/dist/assets/{UserMessage-BlnqZDVU.js → UserMessage-CDjUxKY0.js} +6 -6
- package/packages/web/dist/assets/{ValueVisual-C-MWpp7c.js → ValueVisual-EJnCKgSy.js} +2 -2
- package/packages/web/dist/assets/{fn-modal-B98MR7JN.js → fn-modal-DtE65mFt.js} +2 -2
- package/packages/web/dist/assets/{fn-notices-CfTa1E8y.js → fn-notices-CCZ-DFbi.js} +2 -2
- package/packages/web/dist/assets/{formats-JwoKfXIq.js → formats-CyHV2siv.js} +2 -2
- package/packages/web/dist/assets/index-BY7M8QUk.css +1 -0
- package/packages/web/dist/assets/index-OZS2EluT.js +4 -0
- package/packages/web/dist/assets/{labels-BFbk11BE.js → labels-CT7_K0Pt.js} +2 -2
- package/packages/web/dist/assets/{layout-D1gf481r.js → layout-B6fBDg80.js} +2 -2
- package/packages/web/dist/assets/loaded-LaPjk6mK.js +2 -0
- package/packages/web/dist/assets/{metrics-CBPX3W5Y.js → metrics-9n8bKI7u.js} +2 -2
- package/packages/web/dist/assets/problems--AW4igVY.js +2 -0
- package/packages/web/dist/assets/{push-payload-BeU1ADYt.js → push-payload-B3EcrsVz.js} +64 -64
- package/packages/web/dist/assets/record-edits-B-FWAbxR.js +2 -0
- package/packages/web/dist/assets/{review-fP-l9D6H.js → review-uLESCEz1.js} +3 -3
- package/packages/web/dist/assets/routes-B7Zmt8wh.js +4 -0
- package/packages/web/dist/assets/{runs-CveC2kKo.js → runs-CUb2PTFg.js} +2 -2
- package/packages/web/dist/assets/{shared-LbaIHjbV.js → shared-Bxhw_9et.js} +2 -2
- package/packages/web/dist/assets/{sources-VPrtgLIi.js → sources-YgkjgFLe.js} +2 -2
- package/packages/web/dist/assets/src-DY1fSFJS.js +43 -0
- package/packages/web/dist/assets/state-ChQDWWj-.js +2 -0
- package/packages/web/dist/assets/{systems-BqE3WTSF.js → systems-CjwjRySu.js} +2 -2
- package/packages/web/dist/assets/table-host-B_D9dmCz.js +2 -0
- package/packages/web/dist/assets/tables-CaxIuHdw.js +2 -0
- package/packages/web/dist/assets/{ui-BzgWquIU.js → ui-DWjytmDS.js} +5 -5
- package/packages/web/dist/assets/{url-DKGcECT1.js → url-DbGOI14W.js} +2 -2
- package/packages/web/dist/index.html +49 -47
- package/packages/web/dist/sw.js +1 -1
- package/packages/web/package.json +2 -4
- package/premade/claude.zip +0 -0
- package/premade/database.zip +0 -0
- package/premade/web.zip +0 -0
- package/scripts/dev-env.ts +9 -9
- package/scripts/run-stack.ts +15 -15
- package/scripts/stack.ts +3 -3
- package/scripts/start.ts +18 -18
- package/systems/api/client/ApiServiceForm.vue +55 -0
- package/systems/api/client/ServiceList.vue +90 -0
- package/systems/api/client/ServicePage.vue +142 -0
- package/systems/api/client/ServicesPage.vue +32 -0
- package/systems/api/client/index.ts +15 -0
- package/systems/api/client/logic.ts +140 -0
- package/systems/api/client/state.ts +92 -0
- package/systems/api/package.json +9 -6
- package/systems/api/server/authoring.ts +2 -1
- package/systems/api/server/env.ts +1 -1
- package/systems/api/server/guard.ts +1 -1
- package/systems/api/server/http.ts +3 -2
- package/systems/api/server/impl.ts +3 -2
- package/systems/api/server/main.ts +11 -7
- package/systems/api/server/openapi.ts +1 -1
- package/systems/api/server/program.ts +2 -1
- package/systems/api/server/services.ts +2 -1
- package/systems/api/shared/http.ts +2 -1
- package/systems/api/shared/index.ts +15 -5
- package/{packages/core/src/programs.ts → systems/api/shared/services.ts} +7 -51
- package/systems/api/system.json +2 -1
- package/systems/api/tsconfig.json +2 -2
- package/systems/code/package.json +4 -3
- package/systems/code/server/authoring.ts +2 -1
- package/systems/code/server/impl.ts +2 -1
- package/systems/code/server/main.ts +5 -5
- package/systems/code/shared/index.ts +2 -3
- package/systems/code/shared/program.ts +23 -0
- package/systems/embedder/package.json +1 -1
- package/systems/embedder/server/env.ts +1 -1
- package/systems/embedder/server/main.ts +5 -5
- package/systems/embedder/shared/index.ts +1 -1
- package/systems/fs/client/machines/fakes.ts +1 -1
- package/systems/fs/client/machines/files/fakes.ts +1 -1
- package/systems/fs/client/machines/palette.ts +3 -2
- package/systems/fs/context/authoring/parts/client.md +23 -5
- package/systems/fs/context/authoring/parts/client.reference/client.md +7 -16
- package/systems/fs/context/authoring/parts/client.reference/pageinbox.md +524 -0
- package/systems/fs/context/authoring/parts/client.reference/{resultview.md → visuals.md} +85 -116
- package/systems/fs/context/authoring/parts/client.reference.md +8 -8
- package/systems/fs/context/authoring/parts/context.md +1 -1
- package/systems/fs/context/authoring/parts/contract.md +1 -1
- package/systems/fs/context/authoring/parts/core-types/admin-ts.md +2 -2
- package/systems/fs/context/authoring/parts/core-types/connections-ts.md +12 -1
- package/systems/fs/context/authoring/parts/core-types/context-files-ts.md +2 -2
- package/systems/fs/context/authoring/parts/core-types/context-graph-ts.md +2 -2
- package/systems/fs/context/authoring/parts/core-types/contextdecl.md +2 -2
- package/systems/fs/context/authoring/parts/core-types/lifecycle-ts.md +27 -2
- package/systems/fs/context/authoring/parts/core-types/manifest.md +27 -2
- package/systems/fs/context/authoring/parts/core-types/manifestpatch.md +26 -2
- package/systems/fs/context/authoring/parts/core-types/modes-ts.md +3 -3
- package/systems/fs/context/authoring/parts/core-types/records-systems-ts.md +145 -1
- package/systems/fs/context/authoring/parts/core-types/registries-ts.md +98 -2
- package/systems/fs/context/authoring/parts/core-types/run-ts.md +2 -2
- package/systems/fs/context/authoring/parts/core-types/system-pages-ts.md +4 -2
- package/systems/fs/context/authoring/parts/core-types/system-providers-ts.md +2 -2
- package/systems/fs/context/authoring/parts/core-types/tables-ts.md +91 -0
- package/systems/fs/context/authoring/parts/core-types/web-ts.md +1 -2
- package/systems/fs/context/authoring/parts/core-types.md +5 -8
- package/systems/fs/context/authoring/parts/examples/server-main-ts.md +4 -4
- package/systems/fs/context/authoring/parts/examples/systems-fs-shared-index-ts-lines-568-660.md +1 -1
- package/systems/fs/context/authoring/parts/fns.md +1 -1
- package/systems/fs/context/authoring/parts/folder.md +6 -6
- package/systems/fs/context/authoring/parts/hub/hub-ctx-from-resource.md +2 -2
- package/systems/fs/context/authoring/parts/hub/hub-install-package.md +2 -2
- package/systems/fs/context/authoring/parts/hub.reference.md +3 -3
- package/systems/fs/context/authoring/parts/internals/manifestof.md +2 -2
- package/systems/fs/context/authoring/parts/internals/permissionargs.md +4 -4
- package/systems/fs/context/authoring/parts/kinds-agents.md +1 -1
- package/systems/fs/context/authoring/parts/kinds-agents.reference/authoringsession.md +7 -5
- package/systems/fs/context/authoring/parts/kinds-agents.reference/kind.md +4 -4
- package/systems/fs/context/authoring/parts/outcomes.md +2 -2
- package/systems/fs/context/authoring/parts/outcomes.reference.md +2 -2
- package/systems/fs/context/authoring/parts/packaging.md +4 -4
- package/systems/fs/context/authoring/parts/remote.md +5 -5
- package/systems/fs/context/authoring/parts/remote.reference.md +201 -17
- package/systems/fs/context/authoring/parts/server.md +7 -7
- package/systems/fs/context/authoring/parts/server.reference.md +15 -15
- package/systems/fs/context/authoring/parts/testing.reference/equal.md +3 -3
- package/systems/fs/context/authoring/parts/testing.reference/fakehub.md +1 -1
- package/systems/fs/context/authoring/parts/testing.reference/kindprops.md +22 -10
- package/systems/fs/context/authoring/parts/testing.reference/{openmemorystore.md → storeconnection.md} +7 -19
- package/systems/fs/context/authoring/parts/testing.reference.md +5 -5
- package/systems/fs/context/authoring/parts/widgets.md +32 -22
- package/systems/fs/context/authoring/parts/widgets.reference.md +503 -9
- package/systems/fs/package.json +3 -3
- package/systems/fs/server/hosting.ts +10 -10
- package/systems/fs/server/main.ts +8 -8
- package/systems/fs/server/shell.ts +1 -1
- package/systems/fs/shared/index.ts +1 -1
- package/systems/google-calendar/package.json +1 -1
- package/systems/google-calendar/server/main.ts +4 -4
- package/systems/input/package.json +3 -3
- package/systems/input/server/main.ts +6 -6
- package/systems/mcp/client/McpServerForm.vue +99 -0
- package/systems/mcp/client/ServerList.vue +78 -0
- package/systems/mcp/client/ServerPage.vue +194 -0
- package/systems/mcp/client/ServersPage.vue +32 -0
- package/systems/mcp/client/index.ts +15 -0
- package/systems/mcp/client/logic.ts +224 -0
- package/systems/mcp/client/state.ts +128 -0
- package/systems/mcp/package.json +9 -6
- package/systems/mcp/server/dial.ts +1 -1
- package/systems/mcp/server/impl.ts +2 -1
- package/systems/mcp/server/instance.ts +3 -5
- package/systems/mcp/server/main.ts +10 -6
- package/systems/mcp/server/mirror.ts +2 -3
- package/systems/mcp/server/oauth.ts +2 -1
- package/systems/mcp/server/server-link.ts +2 -1
- package/systems/mcp/shared/index.ts +15 -2
- package/{packages/core/src/mcp-servers.ts → systems/mcp/shared/servers.ts} +6 -5
- package/systems/mcp/system.json +2 -1
- package/systems/mcp/tsconfig.json +2 -2
- package/systems/ollama/package.json +3 -3
- package/systems/ollama/server/main.ts +5 -5
- package/systems/schedule/package.json +3 -3
- package/systems/schedule/server/main.ts +6 -6
- package/systems/template/README.md +2 -2
- package/systems/template/package.json +1 -1
- package/systems/template/server/main.ts +4 -4
- package/systems/widgets/client/ChipRow.vue +22 -0
- package/systems/widgets/client/ProposalCard.vue +6 -5
- package/systems/widgets/client/SavedWidget.vue +11 -8
- package/systems/widgets/client/WidgetChips.vue +137 -0
- package/systems/widgets/client/WidgetView.vue +32 -0
- package/systems/widgets/client/charts/ChartVisual.vue +157 -0
- package/systems/widgets/client/charts/chart-data.ts +230 -0
- package/systems/widgets/client/charts/echarts-setup.ts +69 -0
- package/systems/widgets/client/charts/export.ts +36 -0
- package/systems/widgets/client/charts/families/calendar.ts +105 -0
- package/systems/widgets/client/charts/families/category.ts +186 -0
- package/systems/widgets/client/charts/families/crosstab.ts +113 -0
- package/systems/widgets/client/charts/families/distribution.ts +160 -0
- package/systems/widgets/client/charts/families/finance.ts +96 -0
- package/systems/widgets/client/charts/families/gauge.ts +75 -0
- package/systems/widgets/client/charts/families/hierarchy.ts +166 -0
- package/systems/widgets/client/charts/families/index.ts +21 -0
- package/systems/widgets/client/charts/families/network.ts +140 -0
- package/systems/widgets/client/charts/families/part.ts +61 -0
- package/systems/widgets/client/charts/families/profile.ts +30 -0
- package/systems/widgets/client/charts/families/progress.ts +76 -0
- package/systems/widgets/client/charts/families/range.ts +107 -0
- package/systems/widgets/client/charts/families/time.ts +177 -0
- package/systems/widgets/client/charts/families/timeline.ts +114 -0
- package/systems/widgets/client/charts/families/wide.ts +41 -0
- package/systems/widgets/client/charts/index.ts +37 -0
- package/systems/widgets/client/charts/maths.ts +139 -0
- package/systems/widgets/client/charts/size.ts +39 -0
- package/systems/widgets/client/chips.ts +150 -0
- package/systems/widgets/client/index.ts +18 -5
- package/systems/widgets/client/proposal.ts +2 -1
- package/systems/widgets/package.json +7 -4
- package/systems/widgets/server/authoring.ts +13 -7
- package/systems/widgets/server/env.ts +1 -1
- package/systems/widgets/server/impl.ts +10 -6
- package/systems/widgets/server/main.ts +6 -6
- package/systems/widgets/server/run.ts +16 -9
- package/systems/widgets/server/upgrade.ts +34 -0
- package/systems/widgets/shared/args.ts +137 -0
- package/systems/widgets/shared/charts.ts +243 -0
- package/systems/widgets/shared/index.ts +12 -3
- package/{packages/sdk/src → systems/widgets/shared}/relative-dates.ts +2 -1
- package/systems/widgets/shared/spec.ts +208 -0
- package/{packages/sdk/src → systems/widgets/shared}/widget-check.ts +7 -9
- package/{packages/sdk/src → systems/widgets/shared}/widget-schema.ts +4 -4
- package/packages/core/src/remote-auth.ts +0 -111
- package/packages/core/src/widgets.ts +0 -427
- package/packages/web/dist/assets/AdminLayout-B6Jrc_4W.js +0 -2
- package/packages/web/dist/assets/ApiServiceForm-BxprSaAq.css +0 -1
- package/packages/web/dist/assets/ApiServiceForm-CuuQgOJc.js +0 -2
- package/packages/web/dist/assets/ApiServiceView-7bTHSO_Z.js +0 -2
- package/packages/web/dist/assets/ApiServiceView-BVmdRCjR.css +0 -1
- package/packages/web/dist/assets/ApiServicesView-BTLV6c8n.css +0 -1
- package/packages/web/dist/assets/ApiServicesView-BXi24n49.js +0 -2
- package/packages/web/dist/assets/ChartVisual-BnFG9aFi.css +0 -1
- package/packages/web/dist/assets/ChartVisual-C4mgw4wh.js +0 -11
- package/packages/web/dist/assets/ChatPage-CAhHE03Z.js +0 -4
- package/packages/web/dist/assets/ConfigWithCustom-D_-rY66L.js +0 -3
- package/packages/web/dist/assets/ContextItemPage-rUI3-T_L.js +0 -2
- package/packages/web/dist/assets/ContextPage-CtefzyKg.js +0 -3
- package/packages/web/dist/assets/DataTypePage-BW9fWaz8.js +0 -2
- package/packages/web/dist/assets/FnList-BCnb4kOB.css +0 -1
- package/packages/web/dist/assets/FnList-Bx6H-kux.js +0 -2
- package/packages/web/dist/assets/GraphPanel-9tztGHmu.js +0 -2
- package/packages/web/dist/assets/InjectedList-CSWqRiON.js +0 -2
- package/packages/web/dist/assets/InstanceTypes-D3rAEiE7.js +0 -2
- package/packages/web/dist/assets/InstanceView-DoH8C-1j.js +0 -2
- package/packages/web/dist/assets/LimitsView-DY2C9nYS.js +0 -2
- package/packages/web/dist/assets/McpDialog-DhOCk6_E.js +0 -2
- package/packages/web/dist/assets/McpServerForm-Cor3fI7s.js +0 -2
- package/packages/web/dist/assets/McpServerForm-DsHaf5Um.css +0 -1
- package/packages/web/dist/assets/McpServerView-7I76EznB.css +0 -1
- package/packages/web/dist/assets/McpServerView-ewXRPEmZ.js +0 -2
- package/packages/web/dist/assets/McpServersView-Dd0xmfws.js +0 -2
- package/packages/web/dist/assets/ModelsView-cMHygeiK.js +0 -2
- package/packages/web/dist/assets/PeopleView-DRfeNWK5.js +0 -2
- package/packages/web/dist/assets/RemoteAuthFields-CgiufuqQ.js +0 -2
- package/packages/web/dist/assets/RemoteAuthFields-Dm44vz2t.css +0 -1
- package/packages/web/dist/assets/ResourcesPage-BBx2u2mw.js +0 -2
- package/packages/web/dist/assets/ResultGrid-Bj-0I5HY.js +0 -2
- package/packages/web/dist/assets/ResultGrid-CuUQyTjW.css +0 -1
- package/packages/web/dist/assets/ReviewView-DZF9E1hb.js +0 -3
- package/packages/web/dist/assets/RunCard-BnrtK2Yp.js +0 -2
- package/packages/web/dist/assets/RunCard-CfyRaDLS.css +0 -1
- package/packages/web/dist/assets/ServiceRows-4WythFpF.js +0 -2
- package/packages/web/dist/assets/ServiceRows-HPQ0pN6b.css +0 -1
- package/packages/web/dist/assets/SettingsPage-BN4oSzoL.js +0 -3
- package/packages/web/dist/assets/SignInPage-Djx-M-0U.css +0 -1
- package/packages/web/dist/assets/SystemPageHost-BeZ-6N0-.css +0 -1
- package/packages/web/dist/assets/SystemPageHost-DrMrEPyh.js +0 -2
- package/packages/web/dist/assets/SystemView-Be6TBM4j.js +0 -2
- package/packages/web/dist/assets/SystemsView-DZtT3laz.js +0 -2
- package/packages/web/dist/assets/WidgetView-DQUDeFkB.css +0 -1
- package/packages/web/dist/assets/WidgetView-DX4ejNb6.js +0 -3
- package/packages/web/dist/assets/export-BwFkEtcm.js +0 -15
- package/packages/web/dist/assets/index-6ScWTFy2.js +0 -4
- package/packages/web/dist/assets/index-CEslGcrX.css +0 -1
- package/packages/web/dist/assets/problems-t1E_ovSz.js +0 -2
- package/packages/web/dist/assets/record-edits-Bfsi4lU3.js +0 -2
- package/packages/web/dist/assets/remote-config-BNQhSDzB.js +0 -2
- package/packages/web/dist/assets/routes-DV4IJpwe.js +0 -4
- package/packages/web/dist/assets/size-Bh__w5aI.js +0 -2
- package/packages/web/dist/assets/src-CT3TeFaM.js +0 -43
- package/packages/web/dist/assets/state-xfQqaQPX.js +0 -2
- package/packages/web/dist/assets/widget-host-B87MTaTn.js +0 -2
- package/packages/web/dist/assets/widgets-BBCuSS6E.js +0 -2
- package/systems/fs/context/authoring/parts/client.reference/textareaprops.md +0 -195
- package/systems/fs/context/authoring/parts/core-types/remote-auth-ts.md +0 -64
- package/systems/fs/context/authoring/parts/core-types/widgets-ts.md +0 -303
- package/systems/fs/context/authoring/parts/widgets.reference/hub-visuals.md +0 -627
- package/systems/fs/context/authoring/parts/widgets.reference/sourcecompatible.md +0 -154
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
|
-
"@aeye/gin": "^0.
|
|
4
|
-
"@aeye/schema": "^0.
|
|
3
|
+
"@aeye/gin": "^0.11.1",
|
|
4
|
+
"@aeye/schema": "^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-input",
|
|
12
12
|
"private": true,
|
|
13
|
-
"version": "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.",
|
|
@@ -9,17 +9,17 @@ import { inputEnv } from './env.ts';
|
|
|
9
9
|
import { createInputImpl } from './impl.ts';
|
|
10
10
|
|
|
11
11
|
const settings = inputEnv.parse();
|
|
12
|
-
placeFolders(settings.
|
|
12
|
+
placeFolders(settings.FNLOOM_SYSTEM_STATE, settings);
|
|
13
13
|
const { host, log } = loggedHost(input.name);
|
|
14
14
|
|
|
15
|
-
const clientFolder = await rendererFolder({ main: import.meta.url, outDir: join(settings.
|
|
15
|
+
const clientFolder = await rendererFolder({ main: import.meta.url, outDir: join(settings.FNLOOM_SYSTEM_STATE, 'client') });
|
|
16
16
|
|
|
17
|
-
log.info('input.serving', { hub: settings.
|
|
17
|
+
log.info('input.serving', { hub: settings.FNLOOM_HUB });
|
|
18
18
|
const running = await serve(input, createInputImpl({ settings }), {
|
|
19
|
-
hub: settings.
|
|
20
|
-
state: settings.
|
|
19
|
+
hub: settings.FNLOOM_HUB,
|
|
20
|
+
state: settings.FNLOOM_SYSTEM_STATE,
|
|
21
21
|
client: clientFolder,
|
|
22
|
-
...(settings.
|
|
22
|
+
...(settings.FNLOOM_PAIRING_TOKEN === undefined ? {} : { pairingToken: settings.FNLOOM_PAIRING_TOKEN }),
|
|
23
23
|
}, host);
|
|
24
24
|
running.onStatus((status) => { log.info('input.status', { status }); });
|
|
25
25
|
await running.ready();
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* An MCP server's settings (`McpServerConfig`): its label and description; how the hub reaches it (a URL over
|
|
4
|
+
* streamable HTTP or SSE, or a command it starts, with arguments, environment values and a folder); how it signs in;
|
|
5
|
+
* which calls wait for approval and whether the server's own read-only marks are trusted; whether its prompts and
|
|
6
|
+
* resources are mirrored; and its limits. The parent checks and saves the draft; problems come by config path.
|
|
7
|
+
*/
|
|
8
|
+
import type { SegmentChoice } from '@harness/sdk';
|
|
9
|
+
import { draftFields, PairRowsEditor, RemoteAuthFields, useParts, type PathProblems } from '@harness/sdk/client-ui';
|
|
10
|
+
import { computed } from 'vue';
|
|
11
|
+
import type { McpApproval } from '../shared/servers.ts';
|
|
12
|
+
import { APPROVAL_WORDS, TRANSPORT_WORDS, type McpServerDraft, type McpTransportType } from './logic.ts';
|
|
13
|
+
|
|
14
|
+
withDefaults(defineProps<{ problems?: PathProblems }>(), { problems: () => ({}) });
|
|
15
|
+
const draft = defineModel<McpServerDraft>({ required: true });
|
|
16
|
+
const { Input, Textarea, Segmented, ChipInput, Switch } = useParts();
|
|
17
|
+
|
|
18
|
+
const TRANSPORTS: readonly SegmentChoice[] = (['http', 'sse', 'stdio'] as const).map((type) => ({ value: type, label: TRANSPORT_WORDS[type].label }));
|
|
19
|
+
const APPROVALS: readonly SegmentChoice[] = (['writes', 'always', 'never'] as const).map((value) => ({ value, label: APPROVAL_WORDS[value].label }));
|
|
20
|
+
const isTransport = (value: string): value is McpTransportType => value in TRANSPORT_WORDS;
|
|
21
|
+
const isApproval = (value: string): value is McpApproval => value in APPROVAL_WORDS;
|
|
22
|
+
|
|
23
|
+
const field = draftFields(draft);
|
|
24
|
+
const label = field('label');
|
|
25
|
+
const description = field('description');
|
|
26
|
+
const transportField = field('transport');
|
|
27
|
+
const transport = computed({ get: (): string => transportField.value, set: (next: string) => { if (isTransport(next)) { transportField.value = next; } } });
|
|
28
|
+
const command = field('command');
|
|
29
|
+
const args = field('args');
|
|
30
|
+
const env = field('env');
|
|
31
|
+
const cwd = field('cwd');
|
|
32
|
+
const url = field('url');
|
|
33
|
+
const auth = field('auth');
|
|
34
|
+
const trusted = field('trusted');
|
|
35
|
+
const approvalField = field('approval');
|
|
36
|
+
const approval = computed({ get: (): string => approvalField.value, set: (next: string) => { if (isApproval(next)) { approvalField.value = next; } } });
|
|
37
|
+
const prompts = field('prompts');
|
|
38
|
+
const resources = field('resources');
|
|
39
|
+
const maxTools = field('maxTools');
|
|
40
|
+
const timeout = field('timeout');
|
|
41
|
+
|
|
42
|
+
const approvalAbout = computed(() => APPROVAL_WORDS[draft.value.approval].about);
|
|
43
|
+
const readArg = (text: string): string | undefined => (text === '' ? undefined : text);
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<template>
|
|
47
|
+
<div class="form" data-testid="mcp-server-form">
|
|
48
|
+
<component :is="Input" v-model="label" label="Name" placeholder="Linear" required :error="problems['label'] ?? ''" data-testid="server-label" />
|
|
49
|
+
<component :is="Textarea" v-model="description" label="Description" :rows="2" placeholder="What it is for" />
|
|
50
|
+
|
|
51
|
+
<div class="group">
|
|
52
|
+
<span class="group-label">Transport</span>
|
|
53
|
+
<component :is="Segmented" v-model="transport" :options="TRANSPORTS" label="Transport" data-testid="server-transport" />
|
|
54
|
+
<p class="hint">{{ TRANSPORT_WORDS[draft.transport].about }}</p>
|
|
55
|
+
</div>
|
|
56
|
+
<component
|
|
57
|
+
:is="Input" v-if="draft.transport !== 'stdio'" v-model="url" label="URL" type="url" placeholder="https://mcp.example.com/mcp" required
|
|
58
|
+
:error="problems['transport.url'] ?? problems['transport'] ?? ''" data-testid="server-url"
|
|
59
|
+
/>
|
|
60
|
+
<template v-else>
|
|
61
|
+
<div class="pair">
|
|
62
|
+
<component :is="Input" v-model="command" label="Command" placeholder="npx" required :error="problems['transport.command'] ?? problems['transport'] ?? ''" data-testid="server-command" />
|
|
63
|
+
<component :is="Input" v-model="cwd" label="Folder" placeholder="Where it runs (optional)" />
|
|
64
|
+
</div>
|
|
65
|
+
<component :is="ChipInput" v-model="args" label="Arguments" placeholder="-y @modelcontextprotocol/server-github" hint="Enter adds one, in order." :read="readArg" refusal="Type an argument." />
|
|
66
|
+
<PairRowsEditor
|
|
67
|
+
v-model:rows="env" label="Environment" name-placeholder="GITHUB_TOKEN" secret :kept="draft.envKept"
|
|
68
|
+
hint="Credentials for a command go here; the hub seals them." :error="problems['transport.env'] ?? ''" testid="server-env"
|
|
69
|
+
@replace="draft = { ...draft, envKept: false, env: [] }"
|
|
70
|
+
/>
|
|
71
|
+
</template>
|
|
72
|
+
|
|
73
|
+
<RemoteAuthFields v-if="draft.transport !== 'stdio'" v-model="auth" :problems="problems" />
|
|
74
|
+
|
|
75
|
+
<div class="group">
|
|
76
|
+
<span class="group-label">Approval</span>
|
|
77
|
+
<component :is="Segmented" v-model="approval" :options="APPROVALS" label="Approval" data-testid="server-approval" />
|
|
78
|
+
<p class="hint">{{ approvalAbout }}</p>
|
|
79
|
+
</div>
|
|
80
|
+
<div class="switches">
|
|
81
|
+
<component :is="Switch" v-model="trusted" label="Trust its read-only marks" description="Its own annotations may let reads run without approval." />
|
|
82
|
+
<component :is="Switch" v-model="prompts" label="Prompts as /commands" description="Each prompt becomes a context item with a command." />
|
|
83
|
+
<component :is="Switch" v-model="resources" label="Resources" description="Its resources show under its own root." />
|
|
84
|
+
</div>
|
|
85
|
+
<div class="pair">
|
|
86
|
+
<component :is="Input" v-model="maxTools" label="Most tools" type="number" hint="Tools past this are left out." :error="problems['maxTools'] ?? ''" />
|
|
87
|
+
<component :is="Input" v-model="timeout" label="Call timeout (seconds)" type="number" :error="problems['timeout'] ?? ''" />
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
</template>
|
|
91
|
+
|
|
92
|
+
<style scoped>
|
|
93
|
+
.form { display: grid; gap: var(--space-4); min-width: 0; }
|
|
94
|
+
.group { display: grid; gap: var(--space-2); }
|
|
95
|
+
.group-label { font-size: var(--text-sm); font-weight: var(--weight-medium); }
|
|
96
|
+
.hint { margin: 0; color: var(--text-faint); font-size: var(--text-xs); }
|
|
97
|
+
.pair { display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
|
|
98
|
+
.switches { display: grid; gap: var(--space-3); }
|
|
99
|
+
</style>
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* The MCP servers the hub connects to, each an instance of this system: its name, where it is (a URL or a command),
|
|
4
|
+
* how it signs in, its state with its server, what it mirrors (tools, prompts, resources) and how many tools mapped
|
|
5
|
+
* only loosely; each opens its page. "Add MCP server" (`?add=1`) adds one: the hub installs, pairs, configures and
|
|
6
|
+
* starts it.
|
|
7
|
+
*/
|
|
8
|
+
import { InstanceName } from '@harness/core';
|
|
9
|
+
import { AddServiceDialog, authSummary, ServiceRows, usePageHost, type PathProblems, type ServiceRow } from '@harness/sdk/client-ui';
|
|
10
|
+
import { computed, onMounted, ref, watch } from 'vue';
|
|
11
|
+
import { countsText, mcpServerConfig, mcpServerDraft, readMcpServer, serverLook, serverPath, transportText } from './logic.ts';
|
|
12
|
+
import McpServerForm from './McpServerForm.vue';
|
|
13
|
+
import type { McpServersStore } from './state.ts';
|
|
14
|
+
|
|
15
|
+
const props = defineProps<{ store: McpServersStore }>();
|
|
16
|
+
const host = usePageHost();
|
|
17
|
+
const { Frame, Button, Empty, LoadState } = host.components;
|
|
18
|
+
const add = host.query.bind('add');
|
|
19
|
+
const adding = computed({ get: () => add.value === '1', set: (isOpen) => { host.query.set({ add: isOpen ? '1' : undefined }, { push: true }); } });
|
|
20
|
+
|
|
21
|
+
const draft = ref(mcpServerDraft());
|
|
22
|
+
const instance = ref('');
|
|
23
|
+
const problems = ref<PathProblems>({});
|
|
24
|
+
const nameError = ref('');
|
|
25
|
+
watch(adding, (isOpen) => { if (isOpen) { draft.value = mcpServerDraft(); instance.value = ''; problems.value = {}; nameError.value = ''; } });
|
|
26
|
+
|
|
27
|
+
/** Each server as its row shows it. */
|
|
28
|
+
const rows = computed(() => (props.store.list.value.value ?? []).map((view): ServiceRow => {
|
|
29
|
+
const config = readMcpServer(view.config?.value);
|
|
30
|
+
const read = props.store.statuses.value.get(view.instance);
|
|
31
|
+
const status = read !== undefined && 'status' in read ? read.status : undefined;
|
|
32
|
+
const loose = status?.degraded.length ?? 0;
|
|
33
|
+
return {
|
|
34
|
+
key: view.instance, to: { path: serverPath(view.instance) }, label: config?.label ?? view.instance, look: serverLook(view.status, read),
|
|
35
|
+
where: config === undefined ? 'Not set up' : transportText(config),
|
|
36
|
+
detail: [view.instance, config === undefined ? '' : authSummary(config.auth)].filter((part) => part !== '').join(' · '),
|
|
37
|
+
warning: loose === 0 ? undefined : `${loose} loose`, figures: status === undefined ? undefined : countsText(status),
|
|
38
|
+
};
|
|
39
|
+
}));
|
|
40
|
+
|
|
41
|
+
onMounted(() => { void props.store.load(props.store.list.value.value !== undefined); });
|
|
42
|
+
|
|
43
|
+
async function save(): Promise<void> {
|
|
44
|
+
const checked = mcpServerConfig(draft.value);
|
|
45
|
+
const name = InstanceName.safeParse(instance.value);
|
|
46
|
+
problems.value = checked.ok ? {} : checked.problems;
|
|
47
|
+
nameError.value = name.success ? '' : 'invalid';
|
|
48
|
+
if (!checked.ok || !name.success) { return; }
|
|
49
|
+
const description = draft.value.description.trim();
|
|
50
|
+
const added = await props.store.add(name.data, checked.config, description === '' ? undefined : description);
|
|
51
|
+
if (!added.ok) { return; }
|
|
52
|
+
host.notify.ok(`Added ${draft.value.label.trim()}`, 'It connects in a moment.');
|
|
53
|
+
host.go({ path: serverPath(added.value.instance), query: {} }, { replace: true });
|
|
54
|
+
}
|
|
55
|
+
</script>
|
|
56
|
+
|
|
57
|
+
<template>
|
|
58
|
+
<component :is="Frame" title="MCP servers" description="MCP servers the hub connects to: their tools become fns, their prompts /commands, their resources browsable.">
|
|
59
|
+
<template #actions>
|
|
60
|
+
<component :is="Button" variant="primary" icon="plus" data-testid="add-mcp-server" @click="adding = true">Add MCP server</component>
|
|
61
|
+
</template>
|
|
62
|
+
<component :is="LoadState" :loading="store.list.loading.value" :problem="store.list.problem.value" :ready="store.list.value.value !== undefined" :empty="rows.length === 0" @retry="store.load()">
|
|
63
|
+
<template #empty>
|
|
64
|
+
<component :is="Empty" icon="braces" title="No MCP servers yet" body="Add one by its URL or the command that starts it; its tools join the chat with approvals and visibility like any fn.">
|
|
65
|
+
<template #actions><component :is="Button" variant="primary" icon="plus" @click="adding = true">Add MCP server</component></template>
|
|
66
|
+
</component>
|
|
67
|
+
</template>
|
|
68
|
+
<ServiceRows :rows="rows" icon="braces" testid="mcp-servers" />
|
|
69
|
+
</component>
|
|
70
|
+
<AddServiceDialog
|
|
71
|
+
v-model:open="adding" v-model:instance="instance" title="Add MCP server" description="The hub connects to it and mirrors its tools, prompts and resources."
|
|
72
|
+
:label="draft.label" name-hint="Its fns are named after it (linear_create_issue); it can't change later." :name-error="nameError"
|
|
73
|
+
:busy="store.adding.busy.value" :problem="store.adding.problem.value" @save="save"
|
|
74
|
+
>
|
|
75
|
+
<McpServerForm v-model="draft" :problems="problems" />
|
|
76
|
+
</AddServiceDialog>
|
|
77
|
+
</component>
|
|
78
|
+
</template>
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* One MCP server (`servers/<instance>/<tab>`), its tab in the URL: the overview (its state with its server and why,
|
|
4
|
+
* what the server said about itself, where it is and how it signs in, what it mirrors, with links to its resources,
|
|
5
|
+
* its instance and its sign-ins page when people sign in to it), its tools (the fns it mirrors, the loosely mapped ones
|
|
6
|
+
* marked), its prompts (context items with `/commands`) and its settings (saved as the instance's config; kept secrets
|
|
7
|
+
* stay unless replaced). Removing it removes the instance.
|
|
8
|
+
*/
|
|
9
|
+
import type { InstanceName } from '@harness/core';
|
|
10
|
+
import { connectFlowOf, type AppPlace, type FactItem, type TabChoice } from '@harness/sdk';
|
|
11
|
+
import { authSummary, plainClick, useAppParts, usePageHost, useParts, type PathProblems } from '@harness/sdk/client-ui';
|
|
12
|
+
import { computed, ref, watch } from 'vue';
|
|
13
|
+
import { mcpRootOf } from '../shared/servers.ts';
|
|
14
|
+
import {
|
|
15
|
+
APPROVAL_WORDS, commandText, countsText, isDegraded, MCP, mcpServerConfig, mcpServerDraft, readMcpServer, serverLook, serverPath, ServerTab, TRANSPORT_WORDS, transportText,
|
|
16
|
+
} from './logic.ts';
|
|
17
|
+
import McpServerForm from './McpServerForm.vue';
|
|
18
|
+
import type { McpServersStore } from './state.ts';
|
|
19
|
+
|
|
20
|
+
const props = defineProps<{ store: McpServersStore; instance: InstanceName; tab: ServerTab }>();
|
|
21
|
+
const host = usePageHost();
|
|
22
|
+
const app = useAppParts();
|
|
23
|
+
const { Frame, Button, Banner, Card, Icon, Tabs, LoadState, Badge, Facts, FnList, Confirm } = useParts();
|
|
24
|
+
|
|
25
|
+
const view = computed(() => props.store.find(props.instance));
|
|
26
|
+
const config = computed(() => readMcpServer(view.value?.config?.value));
|
|
27
|
+
const read = computed(() => props.store.statuses.value.get(props.instance));
|
|
28
|
+
const status = computed(() => (read.value !== undefined && 'status' in read.value ? read.value.status : undefined));
|
|
29
|
+
const look = computed(() => (view.value === undefined ? undefined : serverLook(view.value.status, read.value)));
|
|
30
|
+
const title = computed(() => config.value?.label ?? props.instance);
|
|
31
|
+
const tools = computed(() => props.store.tools.value.value ?? []);
|
|
32
|
+
const prompts = computed(() => props.store.prompts.value.value ?? []);
|
|
33
|
+
const degraded = computed(() => tools.value.filter((fn) => isDegraded(status.value, props.instance, fn.name)));
|
|
34
|
+
const signIn = computed(() => (config.value === undefined || config.value.transport.type === 'stdio' ? undefined : connectFlowOf(config.value.auth)));
|
|
35
|
+
|
|
36
|
+
const tabs = computed<readonly TabChoice[]>(() => [
|
|
37
|
+
{ value: 'overview', label: 'Overview' },
|
|
38
|
+
{ value: 'tools', label: 'Tools', count: tools.value.length },
|
|
39
|
+
{ value: 'prompts', label: 'Prompts', count: prompts.value.length },
|
|
40
|
+
{ value: 'settings', label: 'Settings' },
|
|
41
|
+
]);
|
|
42
|
+
const tab = computed({
|
|
43
|
+
get: (): string => props.tab,
|
|
44
|
+
set: (next: string) => { const read = ServerTab.safeParse(next); if (read.success) { host.go({ path: serverPath(props.instance, read.data) }); } },
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const facts = computed<readonly FactItem[]>(() => {
|
|
48
|
+
const c = config.value;
|
|
49
|
+
const s = status.value;
|
|
50
|
+
const list: FactItem[] = [];
|
|
51
|
+
if (s?.server !== undefined) { list.push({ label: 'Server', value: `${s.server.name} ${s.server.version}`, title: `Protocol ${s.server.protocol}` }); }
|
|
52
|
+
if (c !== undefined) {
|
|
53
|
+
list.push({ label: TRANSPORT_WORDS[c.transport.type].label, value: transportText(c), code: true });
|
|
54
|
+
if (c.transport.type !== 'stdio') { list.push({ label: 'Sign-in', value: authSummary(c.auth) }); }
|
|
55
|
+
list.push({ label: 'Approval', value: `${APPROVAL_WORDS[c.approval].label}${c.trusted ? ', read-only marks trusted' : ''}` });
|
|
56
|
+
}
|
|
57
|
+
if (s !== undefined) {
|
|
58
|
+
list.push({ label: 'Mirrors', value: countsText(s) });
|
|
59
|
+
list.push({ label: 'Checked', value: host.format.relativeTime(s.checkedAt, Date.now()), title: host.format.fullTime(s.checkedAt) });
|
|
60
|
+
}
|
|
61
|
+
list.push({ label: 'Instance', value: props.instance, code: true });
|
|
62
|
+
return list;
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// the settings tab's draft: the saved config until changed
|
|
66
|
+
const draft = ref(mcpServerDraft());
|
|
67
|
+
const problems = ref<PathProblems>({});
|
|
68
|
+
const hubProblems = ref<readonly string[]>([]);
|
|
69
|
+
const removing = ref(false);
|
|
70
|
+
watch(() => view.value?.config?.version, () => { draft.value = mcpServerDraft(view.value?.config?.value); problems.value = {}; }, { immediate: true });
|
|
71
|
+
void props.store.show(props.instance);
|
|
72
|
+
|
|
73
|
+
const open = (event: MouseEvent, to: AppPlace): void => { if (plainClick(event)) { app.go(to); } };
|
|
74
|
+
const back = (event: MouseEvent): void => { if (plainClick(event)) { host.go({ path: [] }); } };
|
|
75
|
+
|
|
76
|
+
async function save(): Promise<void> {
|
|
77
|
+
const checked = mcpServerConfig(draft.value);
|
|
78
|
+
problems.value = checked.ok ? {} : checked.problems;
|
|
79
|
+
if (!checked.ok) { return; }
|
|
80
|
+
const result = await props.store.configure(props.instance, checked.config);
|
|
81
|
+
hubProblems.value = result.ok ? [] : result.problems;
|
|
82
|
+
if (!result.ok) { return; }
|
|
83
|
+
host.notify.ok('Settings saved', 'It reconnects with them.');
|
|
84
|
+
void props.store.readStatus(props.instance);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
async function remove(): Promise<void> {
|
|
88
|
+
const ok = await props.store.remove(props.instance);
|
|
89
|
+
removing.value = false;
|
|
90
|
+
if (!ok) { host.notify.error(props.store.removing.problem.value || `Couldn't remove ${title.value}.`); return; }
|
|
91
|
+
host.notify.ok(`Removed ${title.value}`, 'Its fns, prompts and resources are gone.');
|
|
92
|
+
host.go({ path: [] });
|
|
93
|
+
}
|
|
94
|
+
</script>
|
|
95
|
+
|
|
96
|
+
<template>
|
|
97
|
+
<component :is="Frame" :title="title" :description="config?.description ?? ''" keep-title>
|
|
98
|
+
<template #crumb>
|
|
99
|
+
<a :href="host.href({ path: [] })" class="crumb" data-testid="back-to-servers" @click="back"><component :is="Icon" name="chevron-left" :size="14" />MCP servers</a>
|
|
100
|
+
</template>
|
|
101
|
+
<template #actions>
|
|
102
|
+
<component :is="Button" icon="refresh" variant="ghost" data-testid="server-refresh" @click="store.readStatus(instance)">Check</component>
|
|
103
|
+
<component :is="Button" icon="trash" variant="ghost" data-testid="server-remove" @click="removing = true">Remove</component>
|
|
104
|
+
</template>
|
|
105
|
+
<component
|
|
106
|
+
:is="LoadState" :loading="store.list.loading.value" :problem="store.list.problem.value" :ready="store.list.value.value !== undefined" :empty="view === undefined"
|
|
107
|
+
empty-icon="braces" empty-title="No such MCP server" empty-body="It may have been removed." :lines="8" @retry="store.show(instance)"
|
|
108
|
+
>
|
|
109
|
+
<template v-if="view">
|
|
110
|
+
<div class="status-row">
|
|
111
|
+
<component :is="Badge" v-if="look" :tone="look.tone" dot :live="look.live" data-testid="status">{{ look.word }}</component>
|
|
112
|
+
</div>
|
|
113
|
+
<component :is="Tabs" v-model="tab" :tabs="tabs" label="MCP server" />
|
|
114
|
+
|
|
115
|
+
<template v-if="tab === 'overview'">
|
|
116
|
+
<component :is="Banner" v-if="status?.state === 'needs-auth'" tone="warn" data-testid="server-needs-auth">
|
|
117
|
+
It needs a sign-in before its tools can be used.
|
|
118
|
+
<template #actions><component :is="Button" size="sm" @click="app.go({ connect: MCP })">Sign in</component></template>
|
|
119
|
+
</component>
|
|
120
|
+
<component :is="Banner" v-else-if="status?.problem" tone="danger" data-testid="server-problem">{{ status.problem }}</component>
|
|
121
|
+
<component :is="Banner" v-else-if="read && 'problem' in read" tone="warn" data-testid="server-status-problem">{{ read.problem }}</component>
|
|
122
|
+
<component :is="Card" compact>
|
|
123
|
+
<component :is="Facts" :facts="facts" testid="server-facts" />
|
|
124
|
+
<p v-if="status?.server?.instructions" class="instructions">{{ status.server.instructions }}</p>
|
|
125
|
+
</component>
|
|
126
|
+
<div class="links">
|
|
127
|
+
<a v-if="(status?.resources ?? 0) > 0" :href="app.href({ resources: { under: mcpRootOf(instance) } })" @click="open($event, { resources: { under: mcpRootOf(instance) } })"><component :is="Icon" name="layers" :size="14" />Its resources</a>
|
|
128
|
+
<a v-if="signIn !== undefined" :href="app.href({ connect: MCP })" data-testid="server-connections" @click="open($event, { connect: MCP })"><component :is="Icon" name="key" :size="14" />Sign-ins</a>
|
|
129
|
+
<a :href="app.href({ instance: { system: MCP, instance } })" @click="open($event, { instance: { system: MCP, instance } })"><component :is="Icon" name="server" :size="14" />Its instance</a>
|
|
130
|
+
</div>
|
|
131
|
+
<p v-if="(status?.leftOut ?? 0) > 0" class="dim">{{ status?.leftOut }} tools were left out past the most tools setting.</p>
|
|
132
|
+
</template>
|
|
133
|
+
|
|
134
|
+
<template v-else-if="tab === 'tools'">
|
|
135
|
+
<component :is="Banner" v-if="degraded.length > 0" tone="warn" data-testid="server-degraded">
|
|
136
|
+
{{ degraded.length === 1 ? 'One tool takes' : `${degraded.length} tools take` }} any JSON: the server's schema did not map cleanly, so the server checks the args.
|
|
137
|
+
</component>
|
|
138
|
+
<component :is="LoadState" :loading="store.tools.loading.value" :problem="store.tools.problem.value" :ready="store.tools.value.value !== undefined" :empty="tools.length === 0" empty-icon="fn" empty-title="No tools" empty-body="It has not listed any tools yet." @retry="store.show(instance)">
|
|
139
|
+
<component :is="FnList" :fns="tools" />
|
|
140
|
+
</component>
|
|
141
|
+
</template>
|
|
142
|
+
|
|
143
|
+
<template v-else-if="tab === 'prompts'">
|
|
144
|
+
<component :is="LoadState" :loading="store.prompts.loading.value" :problem="store.prompts.problem.value" :ready="store.prompts.value.value !== undefined" :empty="prompts.length === 0" empty-icon="book" empty-title="No prompts" :empty-body="config?.prompts === false ? 'Mirroring prompts is off in its settings.' : 'It has no prompts.'" @retry="store.show(instance)">
|
|
145
|
+
<ul class="list" data-testid="server-prompts">
|
|
146
|
+
<li v-for="item in prompts" :key="item.name">
|
|
147
|
+
<a class="row" :href="app.href({ context: item.name })" @click="open($event, { context: item.name })">
|
|
148
|
+
<code class="command">{{ commandText(item) ?? item.name }}</code>
|
|
149
|
+
<span class="about">{{ item.decl.title ?? item.decl.description }}</span>
|
|
150
|
+
</a>
|
|
151
|
+
</li>
|
|
152
|
+
</ul>
|
|
153
|
+
</component>
|
|
154
|
+
</template>
|
|
155
|
+
|
|
156
|
+
<form v-else class="settings" novalidate data-testid="server-settings" @submit.prevent="save">
|
|
157
|
+
<component :is="Card" compact>
|
|
158
|
+
<McpServerForm v-model="draft" :problems="problems" />
|
|
159
|
+
</component>
|
|
160
|
+
<component :is="Banner" v-for="problem in hubProblems" :key="problem" tone="danger">{{ problem }}</component>
|
|
161
|
+
<div class="save">
|
|
162
|
+
<component :is="Button" variant="ghost" @click="draft = mcpServerDraft(view.config?.value)">Revert</component>
|
|
163
|
+
<component :is="Button" type="submit" variant="primary" :loading="store.saving.busy.value" data-testid="server-save">Save</component>
|
|
164
|
+
</div>
|
|
165
|
+
</form>
|
|
166
|
+
</template>
|
|
167
|
+
</component>
|
|
168
|
+
<component
|
|
169
|
+
:is="Confirm" v-model:open="removing" :title="`Remove ${title}?`" body="Its fns, prompts and resources leave the hub, and its settings and connections are deleted."
|
|
170
|
+
confirm="Remove" :busy="store.removing.busy.value" @confirm="remove"
|
|
171
|
+
/>
|
|
172
|
+
</component>
|
|
173
|
+
</template>
|
|
174
|
+
|
|
175
|
+
<style scoped>
|
|
176
|
+
.crumb { display: inline-flex; align-items: center; gap: 2px; margin-left: -2px; color: var(--text-dim); font-weight: var(--weight-medium); text-decoration: none; }
|
|
177
|
+
.crumb:hover { color: var(--accent); }
|
|
178
|
+
.status-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
|
|
179
|
+
.dim { color: var(--text-dim); font-size: var(--text-sm); }
|
|
180
|
+
.instructions { margin: var(--space-3) 0 0; padding-top: var(--space-3); border-top: 1px solid var(--border); color: var(--text-dim); font-size: var(--text-sm); white-space: pre-wrap; }
|
|
181
|
+
.links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); font-size: var(--text-sm); }
|
|
182
|
+
.links a { display: inline-flex; align-items: center; gap: var(--space-1); }
|
|
183
|
+
.list { display: grid; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); list-style: none; overflow: hidden; }
|
|
184
|
+
.list > li + li { border-top: 1px solid var(--border); }
|
|
185
|
+
.row { display: grid; grid-template-columns: minmax(8rem, max-content) minmax(0, 1fr); gap: var(--space-3); align-items: baseline; padding: var(--space-2) var(--space-4); color: var(--text); text-decoration: none; }
|
|
186
|
+
.row:hover { background: var(--surface-2); text-decoration: none; }
|
|
187
|
+
.command { overflow-wrap: anywhere; }
|
|
188
|
+
.about { color: var(--text-dim); font-size: var(--text-sm); }
|
|
189
|
+
.settings { display: grid; gap: var(--space-4); max-width: 48rem; }
|
|
190
|
+
.save { display: flex; justify-content: flex-end; gap: var(--space-2); }
|
|
191
|
+
@media (max-width: 479.98px) {
|
|
192
|
+
.row { grid-template-columns: minmax(0, 1fr); }
|
|
193
|
+
}
|
|
194
|
+
</style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* The MCP servers admin page (`/admin/s/mcp/servers`, in the admin nav's Systems group while this system is live): the
|
|
4
|
+
* MCP servers the hub connects to as a client, each an instance of this system. Its root is the list (`?add=1` opens
|
|
5
|
+
* the add dialog); `servers/<instance>/<tab>` is one server. The page keeps one store, so moving between them keeps
|
|
6
|
+
* what was read. The old `/admin/mcp-servers` links redirect here.
|
|
7
|
+
*/
|
|
8
|
+
import type { PageViewOf } from '@harness/sdk';
|
|
9
|
+
import { computed, onBeforeUnmount } from 'vue';
|
|
10
|
+
import type { McpContract } from '../shared/index.ts';
|
|
11
|
+
import { serversAt } from './logic.ts';
|
|
12
|
+
import ServerList from './ServerList.vue';
|
|
13
|
+
import ServerPage from './ServerPage.vue';
|
|
14
|
+
import { McpServersStore } from './state.ts';
|
|
15
|
+
|
|
16
|
+
const props = defineProps<PageViewOf<McpContract>>();
|
|
17
|
+
const store = new McpServersStore(props.host.hub);
|
|
18
|
+
const at = computed(() => serversAt(props.path));
|
|
19
|
+
props.host.live(() => { void (at.value.kind === 'server' ? store.show(at.value.instance) : store.load(true)); }, 15_000);
|
|
20
|
+
onBeforeUnmount(() => { store.close(); });
|
|
21
|
+
const { Frame, Empty, Button } = props.host.components;
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<ServerList v-if="at.kind === 'list'" :store="store" />
|
|
26
|
+
<ServerPage v-else-if="at.kind === 'server'" :key="at.instance" :store="store" :instance="at.instance" :tab="at.tab" />
|
|
27
|
+
<component :is="Frame" v-else title="MCP servers">
|
|
28
|
+
<component :is="Empty" icon="braces" title="No such page" body="This link doesn't point at an MCP server or one of its tabs.">
|
|
29
|
+
<template #actions><component :is="Button" variant="primary" @click="host.go({ path: [] })">All MCP servers</component></template>
|
|
30
|
+
</component>
|
|
31
|
+
</component>
|
|
32
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The mcp system's client: its admin page, typed by its contract. The app loads this build from the hub and draws the
|
|
3
|
+
* MCP servers page at `/admin/s/mcp/servers` (one server at `/admin/s/mcp/servers/<instance>/<tab>`) inside the admin
|
|
4
|
+
* area while the system is installed and live, with the app's own components (`host.components`) and the shared
|
|
5
|
+
* remote-service parts of `@harness/sdk/client-ui`.
|
|
6
|
+
*/
|
|
7
|
+
// typescript-eslint can't see the types of .vue modules from .ts files; vue-tsc checks this file
|
|
8
|
+
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
9
|
+
import { client } from '@harness/sdk';
|
|
10
|
+
import { mcp } from '../shared/index.ts';
|
|
11
|
+
import ServersPage from './ServersPage.vue';
|
|
12
|
+
|
|
13
|
+
export default client(mcp, {
|
|
14
|
+
pages: { ServersPage },
|
|
15
|
+
});
|