fnloom 0.3.0 → 0.4.1
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/gin-a.ts +13 -2
- 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/store-ops.ts +9 -2
- 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/catalog/catalog.ts +3 -2
- 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 +54 -5
- 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-CiWhrnP4.js} +2 -2
- package/packages/web/dist/assets/AdminLayout-CjVNzmYD.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-D_kkUatv.js} +2 -2
- package/packages/web/dist/assets/{AutoPairPicker-C61gihmh.js → AutoPairPicker-BdCHi7dL.js} +2 -2
- package/packages/web/dist/assets/{BrowserFrame-Sq9EmQRT.js → BrowserFrame-CVQvfCB8.js} +2 -2
- package/packages/web/dist/assets/ChatPage-CPZJ8ya6.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-DzWZyAp4.js} +2 -2
- package/packages/web/dist/assets/ConfigWithCustom-C49loznj.js +3 -0
- package/packages/web/dist/assets/{ConfirmDialog-Dd3E4sJt.js → ConfirmDialog-BtugUGEY.js} +2 -2
- package/packages/web/dist/assets/{ConnectPage-CX9acyQH.js → ConnectPage-D8k2nSdX.js} +2 -2
- package/packages/web/dist/assets/ContextItemPage-DC4FGi8V.js +2 -0
- package/packages/web/dist/assets/ContextPage-MlEkKMq0.js +3 -0
- package/packages/web/dist/assets/{ContextRow-DrtPumZ5.js → ContextRow-BN26Di1B.js} +2 -2
- package/packages/web/dist/assets/{DataPage-DDSsxHro.js → DataPage-CvOYkEkS.js} +2 -2
- package/packages/web/dist/assets/DataTypePage-CDEL6BHp.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-D-MsKLuP.js} +3 -3
- package/packages/web/dist/assets/{ExplorePage-B7ND0W0l.js → ExplorePage-CNQpEe_8.js} +2 -2
- package/packages/web/dist/assets/{FnPill-Cp3KuLmP.js → FnPill-Dm5mmffj.js} +2 -2
- package/packages/web/dist/assets/{FnView-C0XZdnsS.js → FnView-oiIU5vka.js} +2 -2
- package/packages/web/dist/assets/{FnsView-GTH3p7a0.js → FnsView-DgIfza4W.js} +2 -2
- package/packages/web/dist/assets/{GinExprView-DGxns6lH.js → GinExprView-C19g0UgI.js} +2 -2
- package/packages/web/dist/assets/{GinForm-BDBUzuDP.js → GinForm-p7UsKQ3s.js} +2 -2
- package/packages/web/dist/assets/{GinTypeView-CUsymbVf.js → GinTypeView-DvdHc0V4.js} +2 -2
- package/packages/web/dist/assets/{GinValueView-jsKIfiEA.js → GinValueView-D6c7E4C_.js} +2 -2
- package/packages/web/dist/assets/{GraphPage-BCcPPsHu.js → GraphPage-BTamx4d-.js} +2 -2
- package/packages/web/dist/assets/GraphPanel-DKpbijQD.js +2 -0
- package/packages/web/dist/assets/{HubPicker-EoOErgmk.js → HubPicker-DfXIcUz1.js} +2 -2
- package/packages/web/dist/assets/{InboxApprovals-Dkq7DFp_.js → InboxApprovals-B9qwPCHR.js} +2 -2
- package/packages/web/dist/assets/{InboxPage-CHhslePq.js → InboxPage-j2lF00uW.js} +2 -2
- package/packages/web/dist/assets/InjectedList-BTGvy8GB.js +2 -0
- package/packages/web/dist/assets/{InstallDialog-D-VwfZYF.js → InstallDialog-BRJXLSMJ.js} +2 -2
- package/packages/web/dist/assets/InstanceTypes-DYdolFFW.js +2 -0
- package/packages/web/dist/assets/InstanceView-C5dJLBPe.js +2 -0
- package/packages/web/dist/assets/{ItemHistory-NQAP69ma.js → ItemHistory-vsyIMjIX.js} +2 -2
- package/packages/web/dist/assets/LimitsView-BtbQzkX1.js +2 -0
- package/packages/web/dist/assets/{ListSearch-BunVrDO0.js → ListSearch-BdVW9FHD.js} +2 -2
- package/packages/web/dist/assets/{LlmCallDetails-BoVNDTVs.js → LlmCallDetails-Cd7qtybU.js} +2 -2
- package/packages/web/dist/assets/{LlmCallsView-BGpV92RC.js → LlmCallsView-CrZB_I1H.js} +2 -2
- package/packages/web/dist/assets/{LoadState-h-K9bTYc.js → LoadState-8UknKQ6e.js} +2 -2
- package/packages/web/dist/assets/McpDialog-r-qJDHOO.js +2 -0
- package/packages/web/dist/assets/{McpView-GPXdCMne.js → McpView-FeDQWGxu.js} +2 -2
- package/packages/web/dist/assets/{McpsView-DJIR2JX5.js → McpsView-Czd2yUdE.js} +2 -2
- package/packages/web/dist/assets/{MemoryDialog-BTeIHQyA.js → MemoryDialog-DDiT6wO1.js} +2 -2
- package/packages/web/dist/assets/{ModelCallsView-DMcnwF2S.js → ModelCallsView-DsdztwCR.js} +2 -2
- package/packages/web/dist/assets/{ModelPicker-CgkMFxSO.js → ModelPicker-Df_3l8nS.js} +2 -2
- package/packages/web/dist/assets/ModelsView-YXwRDgWv.js +2 -0
- package/packages/web/dist/assets/{NotFoundPage-Tk92K7HN.js → NotFoundPage-DDEOlB6B.js} +2 -2
- package/packages/web/dist/assets/{PairPage-D0BK8CCw.js → PairPage-D3uHAkh1.js} +2 -2
- package/packages/web/dist/assets/{PanelHost-C-gKrxAk.js → PanelHost-BzWYqH39.js} +2 -2
- package/packages/web/dist/assets/PeopleView-Cg9RO5SF.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-BoshL7RQ.js} +2 -2
- package/packages/web/dist/assets/{RefusalList-DVO0bmeB.js → RefusalList-DnLIfmi-.js} +2 -2
- package/packages/web/dist/assets/RendererHost-CmkaVEX0.js +2 -0
- package/packages/web/dist/assets/RendererHost-Ym_SMkhp.css +1 -0
- package/packages/web/dist/assets/{ResourceViewer-Do0chYxU.js → ResourceViewer-CSAY6xIs.js} +2 -2
- package/packages/web/dist/assets/ResourcesPage-DAoa9mDs.js +2 -0
- package/packages/web/dist/assets/ResultGrid-CL2WSYQH.css +1 -0
- package/packages/web/dist/assets/ResultGrid-DSyc0btv.js +2 -0
- package/packages/web/dist/assets/{ReviewSummaryStrip-DO3p64Qj.js → ReviewSummaryStrip-Bzy-KGz_.js} +2 -2
- package/packages/web/dist/assets/ReviewView-Cwq8Az_B.js +3 -0
- package/packages/web/dist/assets/{RuleRow-DX9v4iGP.js → RuleRow-DAvl2m9p.js} +2 -2
- package/packages/web/dist/assets/RunCard-BMyRkKxJ.js +2 -0
- package/packages/web/dist/assets/RunCard-CSDiz-Nt.css +1 -0
- package/packages/web/dist/assets/{RunDetails-DjR206q6.js → RunDetails-Bvyr1HYK.js} +2 -2
- package/packages/web/dist/assets/{RunDot-lHRICdM5.js → RunDot-Lfrt5XR3.js} +2 -2
- package/packages/web/dist/assets/{RunPage-CbAQ_WPR.js → RunPage-C0-wY6Uz.js} +2 -2
- package/packages/web/dist/assets/{RunProgress-C3-B4tQf.js → RunProgress-BbzwzrTK.js} +2 -2
- package/packages/web/dist/assets/{RunsView-DMkPmkqX.js → RunsView-so-UV2Cq.js} +2 -2
- package/packages/web/dist/assets/SettingsPage-B4SQLk09.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-Ck-v3eH0.js} +2 -2
- package/packages/web/dist/assets/{StatusBadge-CXne0sRZ.js → StatusBadge-C4NawPsO.js} +2 -2
- package/packages/web/dist/assets/{StorePlacementStep-B6SwTmdM.js → StorePlacementStep-DjLWeQF9.js} +2 -2
- package/packages/web/dist/assets/{SystemConfig-vQDL_eUl.js → SystemConfig-B5C5B3b0.js} +2 -2
- package/packages/web/dist/assets/SystemPageHost-DX7LrFoN.css +1 -0
- package/packages/web/dist/assets/SystemPageHost-DoyQlhKM.js +2 -0
- package/packages/web/dist/assets/SystemView-CTdpay8I.js +2 -0
- package/packages/web/dist/assets/SystemsView-Cnv2moRw.js +2 -0
- package/packages/web/dist/assets/TableView-BK_95qHT.js +3 -0
- package/packages/web/dist/assets/TableView-B_4MViVb.css +1 -0
- package/packages/web/dist/assets/{TableViewer-Boxx86f5.js → TableViewer-CRsIxdku.js} +3 -3
- package/packages/web/dist/assets/{ThemePicker-CIg_oRQX.js → ThemePicker-BlW7qvUd.js} +2 -2
- package/packages/web/dist/assets/{TurnTree-Ecm0yA5g.js → TurnTree-D6OYRutQ.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-DJH2bXqv.js} +6 -6
- package/packages/web/dist/assets/{ValueVisual-C-MWpp7c.js → ValueVisual-BJUrdkHO.js} +2 -2
- package/packages/web/dist/assets/{fn-modal-B98MR7JN.js → fn-modal-DFtN7Kn-.js} +2 -2
- package/packages/web/dist/assets/{fn-notices-CfTa1E8y.js → fn-notices-C8HXeo7m.js} +2 -2
- package/packages/web/dist/assets/{formats-JwoKfXIq.js → formats-CHSYhY4X.js} +2 -2
- package/packages/web/dist/assets/index-BY7M8QUk.css +1 -0
- package/packages/web/dist/assets/index-Uz-h2M5K.js +4 -0
- package/packages/web/dist/assets/{labels-BFbk11BE.js → labels-DkV96Md_.js} +2 -2
- package/packages/web/dist/assets/{layout-D1gf481r.js → layout-CTAHAwIH.js} +2 -2
- package/packages/web/dist/assets/loaded-BrwmsuZY.js +2 -0
- package/packages/web/dist/assets/{metrics-CBPX3W5Y.js → metrics-BBvD6KSk.js} +2 -2
- package/packages/web/dist/assets/problems-CI9huk1n.js +2 -0
- package/packages/web/dist/assets/{push-payload-BeU1ADYt.js → push-payload-C1ppI5V2.js} +64 -64
- package/packages/web/dist/assets/record-edits-DFJBcNnL.js +2 -0
- package/packages/web/dist/assets/{review-fP-l9D6H.js → review-DlP8FQiO.js} +3 -3
- package/packages/web/dist/assets/routes-oIISbS5Z.js +4 -0
- package/packages/web/dist/assets/{runs-CveC2kKo.js → runs-BWVBevgu.js} +2 -2
- package/packages/web/dist/assets/{shared-LbaIHjbV.js → shared-Bc4GJbiE.js} +2 -2
- package/packages/web/dist/assets/{sources-VPrtgLIi.js → sources-gONU9kk2.js} +2 -2
- package/packages/web/dist/assets/src-ClMFVauH.js +43 -0
- package/packages/web/dist/assets/state-BQlvjJzT.js +2 -0
- package/packages/web/dist/assets/{systems-BqE3WTSF.js → systems-Dt01wDhP.js} +2 -2
- package/packages/web/dist/assets/table-host-BvEY0Zxn.js +2 -0
- package/packages/web/dist/assets/tables-CkqGZ0Yq.js +2 -0
- package/packages/web/dist/assets/{ui-BzgWquIU.js → ui-CjoSgSyZ.js} +5 -5
- package/packages/web/dist/assets/{url-DKGcECT1.js → url-Deh5u3O5.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/CommentComposer.vue +6 -3
- package/systems/fs/client/machines/files/FilePane.vue +2 -2
- 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/metrics/os.ts +50 -29
- 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
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { ApiClient } from '@ayepi/core/client';
|
|
8
8
|
import { type AccessInfo, type DeliveryId, type DeliveryStatus, type FnError, type FormKind, type HubWebSpec, type Json, type MentionHover, type MessagePart, type QualifiedName, type ResourceStat, type ResourceUri, type ResultFacts, type ResultTable, type RunId, type RunStatus, type SectionKey, type SessionId, type ShareRule, type TypeDisplay, type UserView, type VisualBinding, type VisualShape } from '@harness/core';
|
|
9
|
-
import type { Component, InjectionKey } from 'vue';
|
|
9
|
+
import type { Component, InjectionKey, Ref } from 'vue';
|
|
10
10
|
import type { ActionDef, AttachmentDef, MentionDef, ValueOf } from './declare.ts';
|
|
11
11
|
import type {
|
|
12
|
-
ApprovalProps, BadgeProps, BannerProps, ButtonProps, ComposerProps, ConversationProps, DialogProps, FnPillProps, PageFormat, PageInbox, PageNotify, PageRuns, PageRunsOptions, SelectProps, SkeletonProps,
|
|
12
|
+
ApprovalProps, BadgeProps, BannerProps, ButtonProps, ComposerProps, ConversationProps, DialogProps, FnPillProps, FormProps, PopoverProps, PageFormat, PageInbox, PageNotify, PageRuns, PageRunsOptions, SelectProps, SkeletonProps,
|
|
13
13
|
TextareaProps,
|
|
14
14
|
} from './page-parts.ts';
|
|
15
15
|
import type { FnDef, FnTypes, ProgressState, TypesOf, UntypedFn } from './fn.ts';
|
|
@@ -160,8 +160,8 @@ export interface PageQuery {
|
|
|
160
160
|
|
|
161
161
|
/** Props of the app's markdown view. `navigate` handles links inside the app (`/...`). */
|
|
162
162
|
export interface MarkdownProps { source: string; navigate?: ((href: string) => void) | undefined }
|
|
163
|
-
/** Props of the app's one-line text input (`v-model` is the text); `icon` is from the app's icon set, `hideLabel` keeps the label for screen readers only. */
|
|
164
|
-
export interface InputProps { modelValue: string; label?: string; type?: 'text' | 'search' | 'email' | 'password' | 'url' | 'number' | 'tel'; placeholder?: string; icon?: string | undefined; clearable?: boolean; hideLabel?: boolean; hint?: string; error?: string; disabled?: boolean; size?: 'sm' | 'md' }
|
|
163
|
+
/** Props of the app's one-line text input (`v-model` is the text); `icon` is from the app's icon set, `hideLabel` keeps the label for screen readers only, `revealable` gives a password a show button. */
|
|
164
|
+
export interface InputProps { modelValue: string; label?: string; type?: 'text' | 'search' | 'email' | 'password' | 'url' | 'number' | 'tel'; placeholder?: string; icon?: string | undefined; clearable?: boolean; hideLabel?: boolean; hint?: string; error?: string; disabled?: boolean; size?: 'sm' | 'md'; required?: boolean; revealable?: boolean; autocomplete?: string }
|
|
165
165
|
/** Props of an app icon; `name` is from the app's icon set. */
|
|
166
166
|
export interface IconProps { name: string; size?: number; label?: string }
|
|
167
167
|
/** Props of the app's empty state. */
|
|
@@ -197,6 +197,10 @@ export interface SharedComponents {
|
|
|
197
197
|
readonly Select: Component<SelectProps>;
|
|
198
198
|
readonly Textarea: Component<TextareaProps>;
|
|
199
199
|
readonly Dialog: Component<DialogProps>;
|
|
200
|
+
/** A panel beside an element (a widget chip's editor). */
|
|
201
|
+
readonly Popover: Component<PopoverProps>;
|
|
202
|
+
/** A form for a gin type, with its submit and cancel. */
|
|
203
|
+
readonly Form: Component<FormProps>;
|
|
200
204
|
readonly Banner: Component<BannerProps>;
|
|
201
205
|
readonly Badge: Component<BadgeProps>;
|
|
202
206
|
readonly Skeleton: Component<SkeletonProps>;
|
|
@@ -400,8 +404,9 @@ export interface InputMount extends Mount<'input'> {
|
|
|
400
404
|
|
|
401
405
|
/**
|
|
402
406
|
* The colours a visual draws with, resolved for the current theme from the web app's tokens: the categorical series
|
|
403
|
-
* colours (`--chart-1` … `--chart-8`, the first the accent), the text and muted text, the grid lines
|
|
404
|
-
* behind the chart
|
|
407
|
+
* colours (`--chart-1` … `--chart-8`, the first the accent), the text and muted text, the grid lines, the surface
|
|
408
|
+
* behind the chart, a rise and a fall (`up` and `down`: the theme's ok and danger colours, for candles and changes)
|
|
409
|
+
* and the app's font. Build an ECharts theme from it; it changes when the theme does.
|
|
405
410
|
*/
|
|
406
411
|
export interface VisualPalette {
|
|
407
412
|
readonly series: readonly string[];
|
|
@@ -409,6 +414,9 @@ export interface VisualPalette {
|
|
|
409
414
|
readonly muted: string;
|
|
410
415
|
readonly grid: string;
|
|
411
416
|
readonly surface: string;
|
|
417
|
+
readonly up: string;
|
|
418
|
+
readonly down: string;
|
|
419
|
+
readonly font: string;
|
|
412
420
|
readonly dark: boolean;
|
|
413
421
|
}
|
|
414
422
|
|
|
@@ -421,7 +429,9 @@ export interface VisualRange {
|
|
|
421
429
|
/**
|
|
422
430
|
* The props of a visual (an entry of a registry such as the hub's `hub/visuals`): the rows to draw, their column facts
|
|
423
431
|
* (`resultFacts`), the columns bound to each channel (`bind`, complete: the widget's or the default binding), the style
|
|
424
|
-
* picked in the style picker, and the theme's colours
|
|
432
|
+
* picked in the style picker, and the theme's colours; the result's `title` (a chart's accessible name) and, where
|
|
433
|
+
* the page offers one, the `opener` of a row's actions (with no drill and no opener, a mark opens nothing, so it
|
|
434
|
+
* shouldn't point).
|
|
425
435
|
*/
|
|
426
436
|
export interface VisualView {
|
|
427
437
|
table: ResultTable;
|
|
@@ -429,8 +439,32 @@ export interface VisualView {
|
|
|
429
439
|
bind: VisualBinding;
|
|
430
440
|
style: string;
|
|
431
441
|
palette: VisualPalette;
|
|
442
|
+
title?: string | undefined;
|
|
443
|
+
opener?: VisualRowOpener | undefined;
|
|
432
444
|
}
|
|
433
445
|
|
|
446
|
+
/** A button on each row that opens what it offers (a widget's row actions, a record), as the page around a visual has it. */
|
|
447
|
+
export interface VisualRowOpener {
|
|
448
|
+
/** The button's label ("Actions", "Open"). */
|
|
449
|
+
readonly label: string;
|
|
450
|
+
/** Whether a row offers anything. */
|
|
451
|
+
has(row: readonly Json[]): boolean;
|
|
452
|
+
open(row: readonly Json[]): void;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
/** The kinds of image a visual can export. */
|
|
456
|
+
export type VisualImageKind = 'png' | 'svg';
|
|
457
|
+
/** An image of what a visual draws, as a data URL. */
|
|
458
|
+
export type VisualImageExport = (kind: VisualImageKind) => string;
|
|
459
|
+
/** Where the result view lets the visual it draws offer Export image (`inject(VISUAL_IMAGE)`; set while mounted, cleared on unmount). */
|
|
460
|
+
export interface VisualImageSlot {
|
|
461
|
+
set(exporter: VisualImageExport | undefined): void;
|
|
462
|
+
}
|
|
463
|
+
/** The result view's image export slot, for a visual that draws an image (a chart). */
|
|
464
|
+
export const VISUAL_IMAGE: InjectionKey<VisualImageSlot> = Symbol.for('harness.visualImage');
|
|
465
|
+
/** Whether a click on a row's mark drills into it (a widget with a drill): the widget view provides it; absent outside one. */
|
|
466
|
+
export const VISUAL_DRILLABLE: InjectionKey<Readonly<Ref<boolean>>> = Symbol.for('harness.visualDrillable');
|
|
467
|
+
|
|
434
468
|
/**
|
|
435
469
|
* What a visual emits, with the checks Vue runs on each (`defineEmits(VISUAL_EMITS)`, or `emits: VISUAL_EMITS`):
|
|
436
470
|
* `drill` with the index of the clicked row (a bar, slice or point: the widget runs its drill, else opens the row's
|
|
@@ -518,6 +552,8 @@ export interface ClientRenderers<C extends ContractShape> {
|
|
|
518
552
|
* the contract's `contributes`, which is how the hub and the web app know to load this bundle for that registry.
|
|
519
553
|
*/
|
|
520
554
|
visuals?: Readonly<Record<QualifiedName, Readonly<Record<string, VisualEntry<C>>>>>;
|
|
555
|
+
/** Items this system adds to plain result tables' 3-dot menus, by name (`ResultItemEntry`: the widgets system's "Make a widget"). */
|
|
556
|
+
resultItems?: Readonly<Record<string, ResultItemEntry>>;
|
|
521
557
|
/**
|
|
522
558
|
* Config components by name. The one the contract's `configComponent` names is drawn for the system's config; it must
|
|
523
559
|
* be here, and every component here must be the one named.
|
|
@@ -627,10 +663,45 @@ export interface ResultLook {
|
|
|
627
663
|
}
|
|
628
664
|
|
|
629
665
|
/**
|
|
630
|
-
*
|
|
631
|
-
*
|
|
632
|
-
*
|
|
633
|
-
|
|
666
|
+
* What the result view's `controls` slot gives a system's controls (the widgets system's chip row): the output the
|
|
667
|
+
* level shown was read from (to read the system's own fields), the args it ran with, whether it is reading, whether it
|
|
668
|
+
* can be run again, and `run`, which runs it again with other args (resolving whether that worked).
|
|
669
|
+
*/
|
|
670
|
+
export interface ResultControls {
|
|
671
|
+
readonly value: Json | undefined;
|
|
672
|
+
readonly args: Readonly<Record<string, Json>>;
|
|
673
|
+
readonly busy: boolean;
|
|
674
|
+
readonly editable: boolean;
|
|
675
|
+
run(args: Readonly<Record<string, Json>>): Promise<boolean>;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
/** The result a system's result item is offered on: the fn that returned it, its args and its rows. */
|
|
679
|
+
export interface ResultItemView {
|
|
680
|
+
readonly fn: QualifiedName;
|
|
681
|
+
readonly args: Json | undefined;
|
|
682
|
+
readonly table: ResultTable;
|
|
683
|
+
/** The rows came from a write. */
|
|
684
|
+
readonly readOnly: boolean;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* An item a system adds to the 3-dot menu of plain result tables (`client({ resultItems })`; the widgets system's
|
|
689
|
+
* "Make a widget"): its words and icon, whether a result offers it, and what it does, with a way to ask the agent
|
|
690
|
+
* (`ask(text, send)`, absent where no agent is open).
|
|
691
|
+
*/
|
|
692
|
+
export interface ResultItemEntry {
|
|
693
|
+
readonly label: string;
|
|
694
|
+
readonly icon?: string;
|
|
695
|
+
offered(view: ResultItemView): boolean;
|
|
696
|
+
run(view: ResultItemView, ask: (text: string, send: boolean) => Promise<boolean>): Promise<void>;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
/**
|
|
700
|
+
* The props of the app's result view, as a renderer binds them: a result table, or a shown result (core's
|
|
701
|
+
* `ShownResult`, such as a widget's run), drawn with every fitting visual, its pager, drill and row actions. With `fn`,
|
|
702
|
+
* it reads that fn again (other args, pager, refresh); without, it draws only what it has (a preview). `keepLook`
|
|
703
|
+
* offers keeping the look picked in Settings; it resolves true when it was kept (or asked for). Its `controls` slot
|
|
704
|
+
* (slot props `ResultControls`) is where a system draws its own controls above the rows (the widgets system's chips).
|
|
634
705
|
*/
|
|
635
706
|
export interface ResultViewProps {
|
|
636
707
|
value: Json;
|
package/packages/sdk/src/hub.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import {
|
|
12
12
|
ADMIN_TAG, adminSlice, AgentInjected, chatSlice, CONTENT_HASH_PATTERN, ChatModeConfig, contextorSlice, contextReviewSlice, contextSlice, ContextorConfig, type ModelRole, DETAIL_LEVELS, ERROR_CLASSES,
|
|
13
|
-
graphSlice, injectionsSlice, versionsSlice, dataSlice, ContributionView, ReadTableArgs, ResultTable, RowActionsQuery,
|
|
13
|
+
graphSlice, injectionsSlice, versionsSlice, dataSlice, ContributionView, ReadTableArgs, ResultTable, RowActionsQuery, RowActionOption, mcpsSlice, metricsSlice, accessSlice, autoPairSlice, connectionsSlice, explorerSlice, suggestionsSlice, MintMcpTokenArgs, modelsSlice, OWN_TAG, packagingSlice, READ_TAG, resourcesSlice, ResourceOutlineArgs, ResourceSendArgs, ImageReadArgs, ImageReadResult, RUN_STATUSES, runsSlice,
|
|
14
14
|
FnLive, GinTypeDef, LIST_NAMES, querySlice, Section, settingsSlice, systemsSlice, LlmContentPart, ModelLimits, LINK_TARGET_KINDS, type Display,
|
|
15
15
|
FnBlock, FnExample, FnExamplesPage, FnExamplesQuery, FnRouting, FnSearchArgs, FnSearchPage, CtxSearchArgs, LoadContextResult, LoadFnsResult, ContextCrawlArgs, ContextCrawlResult, CRAWL_BATCH_MAX, ContextPlanArgs, ContextPlan, ContextPlanGetArgs, ContextPlanView, ContextAnswerArgs, ContextAnswerResult, ContextPlanExpandArgs, PLAN_LIMIT_DEFAULTS, NameRefusal, ShareRule, type RegistryEffect,
|
|
16
16
|
type QualifiedName,
|
|
@@ -490,7 +490,7 @@ const adminReadFns = {
|
|
|
490
490
|
|
|
491
491
|
/** The hub's admin fns (`ADMIN_ENDPOINTS`), each described for the agent that offers them. */
|
|
492
492
|
const adminFns = {
|
|
493
|
-
configure_provider: adminFn('Add a model provider (OpenAI, OpenRouter, Ollama) with its API key, or replace its key. The key is stored encrypted.', 'Use it when an admin gives a provider key. Never repeat the key back or put it in a message; say only that it was stored.', ADMIN_ENDPOINTS.configure_provider, [{ args: { provider: 'ollama', baseURL: 'http://127.0.0.1:11434' }, note: 'A local Ollama.' }], changes('update', 'secrets')),
|
|
493
|
+
configure_provider: adminFn('Add a model provider (OpenAI, Anthropic, Google Gemini, OpenRouter, Amazon Bedrock, Ollama) with its API key, or replace its key. The key is stored encrypted.', 'Use it when an admin gives a provider key. Never repeat the key back or put it in a message; say only that it was stored.', ADMIN_ENDPOINTS.configure_provider, [{ args: { provider: 'ollama', baseURL: 'http://127.0.0.1:11434' }, note: 'A local Ollama.' }], changes('update', 'secrets')),
|
|
494
494
|
set_model_category: adminFn('Add a model category (a named, ordered list of models), or change the one with this id.', 'Use it to group models for a purpose (fast, cheap, best). Order matters: the first available model is tried first.', ADMIN_ENDPOINTS.set_model_category, [{ args: { name: 'small', description: 'Fast local models.', models: ['qwen2.5:3b'] } }]),
|
|
495
495
|
set_budget: adminFn('Add a spending budget for the hub, a group, a user, a session, a system, a fn or a model, or change the one with this id.', 'Use it when an admin sets a spending limit. Say the scope and period back in plain words, since a low budget stops runs.', ADMIN_ENDPOINTS.set_budget, [{ args: { target: { scope: 'system', system: 'web' }, period: 'per-turn', maxCost: 0.5, onLimit: 'ask' }, note: 'Fifty cents a message for one system.' }]),
|
|
496
496
|
set_priority: adminFn('Add a priority rule (the default and highest priority of turns at a level), or change the one with this id.', 'Use it when an admin wants some turns to run before others (a group\'s work first).', ADMIN_ENDPOINTS.set_priority, [{ args: { target: { scope: 'hub' }, default: 'normal', max: 'interactive' } }]),
|
|
@@ -649,7 +649,7 @@ export const LlmPayloadType = g.obj({
|
|
|
649
649
|
contextor: g.optional(ContextorType),
|
|
650
650
|
/**
|
|
651
651
|
* The most tokens one answer may take (as core's `ModelLimits.maxOutputTokens`, and never past the model's own
|
|
652
|
-
* limit); the hub's `
|
|
652
|
+
* limit); the hub's `FNLOOM_AGENT_MAX_OUTPUT` when absent.
|
|
653
653
|
*/
|
|
654
654
|
maxOutput: g.optional(ginAs(ModelLimits.shape.maxOutputTokens.unwrap())),
|
|
655
655
|
/**
|
|
@@ -1203,7 +1203,7 @@ const hubContract = system('hub', {
|
|
|
1203
1203
|
description: 'The actions rows of some types offer, as the run\'s person may use them: each type\'s methods, narrowed and relabelled by a widget\'s list, with any fn it binds to the row\'s columns.',
|
|
1204
1204
|
instructions: 'The widgets system calls it to give a widget\'s rows their menu. Anything that is not a read confirms first; what follows is derived (a table opens, a write refreshes).',
|
|
1205
1205
|
examples: [{ args: { types: ['tasks/Task'] }, note: 'Every method of a task.' }],
|
|
1206
|
-
args: ginAs(RowActionsQuery), returns: g.list(ginAs(
|
|
1206
|
+
args: ginAs(RowActionsQuery), returns: g.list(ginAs(RowActionOption)), tags: [READ_TAG], visibility: 'none', display: 'hidden',
|
|
1207
1207
|
}),
|
|
1208
1208
|
chat: kinds.llm.fn({
|
|
1209
1209
|
description: 'The chat agent: answers people in a session with every tool the session allows.',
|
|
@@ -14,8 +14,11 @@ export { g, json, partialOf, type OptionalField, wireType, parseValue, encodeVal
|
|
|
14
14
|
export { ginOf, ginAs, modelArgsOf, toolArgsOf, type FlatArgs, type ToolArgs } from './zod-gin.ts';
|
|
15
15
|
export { ginOfA, type ANamedTypes } from './a-gin.ts';
|
|
16
16
|
export {
|
|
17
|
+
RemoteAuthPer, HeaderName, HeaderValues, RemoteAuth, TypedAuth, RecordAuth, TYPED_AUTH_SECRETS, REMOTE_AUTH_SECRETS, connectFlowOf, RemoteCredentials, ConnectKeyRecord,
|
|
17
18
|
accountLabel, connectForm, credentialHeaders, credentialsFromForm, instanceConnectOf, keyConnectOf, type FormFor, maskHeaders, readCredentials, secretHeaderNames, sharedHeaders, usesConnections,
|
|
18
19
|
} from './remote-auth.ts';
|
|
20
|
+
/** What an authoring fn answers, for a contract that declares one (the agent itself is `@harness/sdk/server`'s). */
|
|
21
|
+
export { authoredFn, type AuthoredFn } from './authored.ts';
|
|
19
22
|
export {
|
|
20
23
|
fn, handler, linear, steps, noProgress, progressDecl, kindFn, validationOf,
|
|
21
24
|
type FnValidators,
|
|
@@ -67,24 +70,25 @@ export {
|
|
|
67
70
|
} from './manifest.ts';
|
|
68
71
|
export {
|
|
69
72
|
client, RESOURCE_VIEWER, RESOURCE_VIEWER_MODES, INPUT_ANSWERS, VALUE_EDITOR, ACCESS_INFO, SHARE_EDITOR, VISUALS, RESULT_VIEW, CHAT_HOST, APP_COMPONENTS,
|
|
70
|
-
type ResultView, type ResultViewOf, type ResultViewProps, type ResultLook, type RunOutcome, type ChatHost, type ChatStart,
|
|
73
|
+
type ResultView, type ResultViewOf, type ResultViewProps, type ResultLook, type ResultControls, type ResultItemView, type ResultItemEntry, type RunOutcome, type ChatHost, type ChatStart,
|
|
71
74
|
type InputAnswer, type InputAnswers, type ValueEditorProps, type ShareEditorProps,
|
|
72
75
|
type Renderer, type Delivery, type FnView, type SystemClient, type WithSystem, type AttachmentView, type InputView, type MentionView, type ResourceView,
|
|
73
76
|
type FnViewOf, type AttachmentViewOf, type InputViewOf, type AnyViews, type WireViews, type Mount, type InputMount, type ClientRenderers, type ClientModule, type ResourceViewerProps,
|
|
74
77
|
PAGE_HOST, CODE_HIGHLIGHTER, type CodeHighlighter, type CodeToken, type CodeTokenKind, type PageView, type PageViewOf, type PageHost, type PageLocation, type PageQuery, type QueryBinding, type HubClient, type SharedComponents,
|
|
75
78
|
type MarkdownProps, type InputProps, type IconProps, type EmptyProps, type LoadStateProps, type ReasoningProps, type TypingProps, type FrameProps,
|
|
76
|
-
type ResourceViewerEntry, type ResourceViewerMode, type BareViewer, type VisualView, type VisualEntry, VISUAL_EMITS, type VisualEmits, type VisualPalette, type VisualRange, type VisualTheme, visualTheme, type VisualOption, type VisualSource,
|
|
79
|
+
type ResourceViewerEntry, type ResourceViewerMode, type BareViewer, type VisualView, type VisualEntry, VISUAL_EMITS, type VisualEmits, type VisualPalette, type VisualRange, type VisualRowOpener, type VisualImageKind, type VisualImageExport, type VisualImageSlot, VISUAL_IMAGE, VISUAL_DRILLABLE, type VisualTheme, visualTheme, type VisualOption, type VisualSource,
|
|
77
80
|
} from './client.ts';
|
|
78
81
|
export type {
|
|
79
|
-
PageRuns, PageRunsOptions, PageInbox, PageNotify, PageFormat, PartTone, ButtonProps, SelectChoice, SelectProps, TextareaProps, DialogProps, BannerProps, BadgeProps, SkeletonProps, FnPillProps, ApprovalProps,
|
|
82
|
+
PageRuns, PageRunsOptions, PageInbox, PageNotify, PageFormat, PartTone, ButtonProps, SelectChoice, SelectProps, TextareaProps, DialogProps, PopoverProps, FormProps, BannerProps, BadgeProps, SkeletonProps, FnPillProps, ApprovalProps,
|
|
80
83
|
ConversationCall, ConversationPiece, ConversationEntry, ConversationProps, ComposerProps,
|
|
81
84
|
} from './page-parts.ts';
|
|
82
85
|
export {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
APP_PARTS, type AppParts, type AppPartComponents, type AppPlace,
|
|
87
|
+
type TabChoice, type TabsProps, type SegmentChoice, type SegmentedProps, type SwitchProps, type ChipInputProps, type IconButtonProps, type CardProps, type FnListProps, type FactItem, type FactsProps, type ConfirmProps,
|
|
88
|
+
} from './app-parts.ts';
|
|
89
|
+
export {
|
|
90
|
+
HUB_VISUALS, WINDOW_ARGS, BUILT_IN_CONTRIBUTIONS, channel, visual, ginTypeFacts, resultFacts, rankedVisuals, argsOf, pagingOf, rangeOf,
|
|
91
|
+
rowActionOptions, boundArgs, ginTypeOf, returnsTable,
|
|
92
|
+
type ChannelOptions, type VisualInput, type VisualContribution, type RankedVisual, type ArgInfo, type RowFn,
|
|
86
93
|
} from './widgets.ts';
|
|
87
|
-
export { checkWidget, sourceCompatible, type WidgetCheckInput, type WidgetCheckResult, type SourceCompatibleOptions } from './widget-check.ts';
|
|
88
|
-
export { widgetProposalSchema, type WidgetDraftInput, type WidgetProposalSchemaInput, type WidgetProposalSchema, type WidgetDraft } from './widget-schema.ts';
|
|
89
|
-
export { resolveRelative, resolveArgValue, relativeDatesFor } from './relative-dates.ts';
|
|
90
94
|
export { expectType, type Equal, type Simplify } from './util.ts';
|
|
@@ -97,6 +97,10 @@ export type SelectProps = { modelValue: string; options: readonly SelectChoice[]
|
|
|
97
97
|
export interface TextareaProps { modelValue: string; label?: string; hint?: string; error?: string; placeholder?: string; rows?: number; maxRows?: number; required?: boolean; disabled?: boolean; hideLabel?: boolean }
|
|
98
98
|
/** Props of the app's dialog (`v-model:open`); slots: the body, and `footer` for its buttons. */
|
|
99
99
|
export interface DialogProps { open: boolean; title: string; description?: string; width?: string }
|
|
100
|
+
/** Props of the app's popover (`v-model:open`), placed beside `anchor`; its slot is the panel's content. */
|
|
101
|
+
export interface PopoverProps { open: boolean; anchor: HTMLElement | null | undefined; label?: string | undefined; role?: 'dialog' | 'menu' | 'listbox' }
|
|
102
|
+
/** Props of the app's form for a gin type (`type`, a type definition), emitting `submit` with the value and `cancel`. */
|
|
103
|
+
export interface FormProps { type: unknown; initial?: Json | undefined; submitLabel?: string; label?: string; cancellable?: boolean }
|
|
100
104
|
/** Props of the app's banner; slots: the text, and `actions`. */
|
|
101
105
|
export interface BannerProps { tone?: PartTone; icon?: string | undefined }
|
|
102
106
|
/** Props of the app's badge (a status word with its dot, which pulses while `live`). */
|
|
@@ -7,22 +7,22 @@ import { z } from 'zod';
|
|
|
7
7
|
|
|
8
8
|
export const programEnv = env({
|
|
9
9
|
/** The longest one program run may take, in milliseconds (fn calls included). */
|
|
10
|
-
|
|
10
|
+
FNLOOM_PROGRAM_TIMEOUT: z.coerce.number().int().min(100).default(30_000),
|
|
11
11
|
/**
|
|
12
12
|
* The longest stretch, in milliseconds, one program run holds the thread before it lets other work on the system in
|
|
13
13
|
* (and a deadline or cancel land).
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
FNLOOM_PROGRAM_SLICE: z.coerce.number().int().min(1).max(1_000).default(10),
|
|
16
16
|
/** The most fn calls one program run may make. */
|
|
17
|
-
|
|
17
|
+
FNLOOM_PROGRAM_MAX_CALLS: z.coerce.number().int().min(0).default(50),
|
|
18
18
|
/** The most complex program accepted (gin's `complexity()`: loops and lambdas cost more). */
|
|
19
|
-
|
|
19
|
+
FNLOOM_PROGRAM_MAX_COMPLEXITY: z.coerce.number().int().min(10).default(600),
|
|
20
20
|
/** The fns one authoring search lists. */
|
|
21
|
-
|
|
21
|
+
FNLOOM_PROGRAM_SEARCH_LIMIT: z.coerce.number().int().min(1).max(50).default(8),
|
|
22
22
|
/** The characters of type definitions one load prints before it lists the rest by name. */
|
|
23
|
-
|
|
23
|
+
FNLOOM_PROGRAM_TYPE_CHARS: z.coerce.number().int().min(500).default(4_000),
|
|
24
24
|
/** The characters of a result an authoring agent is shown. */
|
|
25
|
-
|
|
25
|
+
FNLOOM_PROGRAM_PREVIEW_CHARS: z.coerce.number().int().min(200).default(2_000),
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
/** The program runtime's settings, resolved. */
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* args are encoded from gin, and the answer is parsed back through the callee's declared return type.
|
|
12
12
|
*
|
|
13
13
|
* **Limits.** A run is given gin's run signal: every loop round and fn call is a checkpoint, so the deadline
|
|
14
|
-
* (`
|
|
14
|
+
* (`FNLOOM_PROGRAM_TIMEOUT`) or the caller's cancel stops the engine there, and a long run yields to the event loop
|
|
15
15
|
* between slices, so other runs and requests on the same system go on meanwhile. On top of that, static rules keep
|
|
16
16
|
* programs plain: no while-loops (a loop over a `bool`, re-evaluated each round), no loop over a value of unknown type,
|
|
17
17
|
* no `recurse`, a complexity cap; and at run time a cap on fn calls.
|
|
@@ -407,7 +407,7 @@ export function checkProgram(program: ProgramScope, def: ExprDef, expect: Progra
|
|
|
407
407
|
if (!returns.compatible(produced)) {
|
|
408
408
|
found.push('expr.type', `It produces \`${produced.toCode(g)}\` but \`${returns.toCode(g)}\` is expected. If the program is right, its type is ${JSON.stringify(produced.toJSON())}.`);
|
|
409
409
|
}
|
|
410
|
-
const max = programEnv.get('
|
|
410
|
+
const max = programEnv.get('FNLOOM_PROGRAM_MAX_COMPLEXITY');
|
|
411
411
|
const complexity = expr.complexity();
|
|
412
412
|
const code = program.engine.toGinCode(expr);
|
|
413
413
|
const errors = found.list.filter((problem) => problem.severity === 'error');
|
|
@@ -529,8 +529,8 @@ export interface ProgramRun {
|
|
|
529
529
|
|
|
530
530
|
/** Run a checked program with these args: its result as logical JSON, checked against `returns`. */
|
|
531
531
|
export async function runProgram(run: ProgramRun, input: Json): Promise<Json> {
|
|
532
|
-
const timeout = programEnv.get('
|
|
533
|
-
const maxCalls = programEnv.get('
|
|
532
|
+
const timeout = programEnv.get('FNLOOM_PROGRAM_TIMEOUT');
|
|
533
|
+
const maxCalls = programEnv.get('FNLOOM_PROGRAM_MAX_CALLS');
|
|
534
534
|
const deadline = AbortSignal.timeout(timeout);
|
|
535
535
|
const signal = run.signal === undefined ? deadline : AbortSignal.any([run.signal, deadline]);
|
|
536
536
|
const limitError = (): ProgramError => new ProgramError(deadline.aborted ? `The program ran past ${String(timeout)} ms.` : 'The run was stopped.', 'limit');
|
|
@@ -555,7 +555,7 @@ export async function runProgram(run: ProgramRun, input: Json): Promise<Json> {
|
|
|
555
555
|
signal.addEventListener('abort', stop, { once: true });
|
|
556
556
|
cleanup = () => { signal.removeEventListener('abort', stop); };
|
|
557
557
|
});
|
|
558
|
-
const running = run.program.engine.run(run.expr, extras, { signal, slice: programEnv.get('
|
|
558
|
+
const running = run.program.engine.run(run.expr, extras, { signal, slice: programEnv.get('FNLOOM_PROGRAM_SLICE') });
|
|
559
559
|
// a run the race left behind still settles (it stops at its next checkpoint); its outcome is already answered
|
|
560
560
|
void running.catch(() => undefined);
|
|
561
561
|
let out: Value;
|
|
@@ -80,7 +80,7 @@ export type ProgramSession<S extends ProgramAuthoring, D> = AuthoringSession<S,
|
|
|
80
80
|
|
|
81
81
|
/** Type definitions printed, within the budget; the rest listed by name for a later load. */
|
|
82
82
|
function printTypes(program: ProgramScope, names: readonly string[]): string[] {
|
|
83
|
-
const budget = programEnv.get('
|
|
83
|
+
const budget = programEnv.get('FNLOOM_PROGRAM_TYPE_CHARS');
|
|
84
84
|
const lines: string[] = [];
|
|
85
85
|
const later: string[] = [];
|
|
86
86
|
let used = 0;
|
|
@@ -108,7 +108,7 @@ function searchTool<S extends ProgramAuthoring, D>(): AuthoringTool<S, D> {
|
|
|
108
108
|
schema: a.object({ text: a.string().min(1).describe('What the fn should do, in plain words.') }),
|
|
109
109
|
async call({ text }, session) {
|
|
110
110
|
const state = session.state;
|
|
111
|
-
const page = await state.host.search({ text, items: ['fn'], limit: programEnv.get('
|
|
111
|
+
const page = await state.host.search({ text, items: ['fn'], limit: programEnv.get('FNLOOM_PROGRAM_SEARCH_LIMIT') });
|
|
112
112
|
session.disclosure.markSearched(FN);
|
|
113
113
|
session.disclosure.markAware(FN, page.items.map((hit) => hit.name));
|
|
114
114
|
session.disclosure.markAware(TYPE, state.own);
|
|
@@ -263,6 +263,6 @@ export function modeOf(page: FnSearchPage, name: QualifiedName): FnMode | undefi
|
|
|
263
263
|
/** Text cut to the preview budget. */
|
|
264
264
|
export function previewText(value: Json): string {
|
|
265
265
|
const text = JSON.stringify(value);
|
|
266
|
-
const max = programEnv.get('
|
|
266
|
+
const max = programEnv.get('FNLOOM_PROGRAM_PREVIEW_CHARS');
|
|
267
267
|
return text.length > max ? `${text.slice(0, max)}…` : text;
|
|
268
268
|
}
|
|
@@ -1,14 +1,135 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Signing in to a remote service
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* Signing in to a remote service, shared by every instance-scoped system that calls one (an MCP server, an API
|
|
3
|
+
* service). The shapes moved here from core, since only those systems, their pages and the hub's key connections read
|
|
4
|
+
* them:
|
|
5
|
+
*
|
|
6
|
+
* - `RemoteAuth`: how an instance signs in. `none`: nothing to send. `bearer` / `headers`: a token or header values;
|
|
7
|
+
* shared, an admin types them into the instance's config (sealed as config secrets, `REMOTE_AUTH_SECRETS`); per
|
|
8
|
+
* person, each person types their own on the connections page (the connect `form` flow, `InstanceConnect`), kept as
|
|
9
|
+
* a secret the person owns. `oauth`: the browser flow through the hub's `/connect/callback`; per person, each person
|
|
10
|
+
* connects their own account; shared, one connection (an admin's) shared with everyone (`ShareRule`).
|
|
11
|
+
* - `TypedAuth` (no OAuth), `RecordAuth` (no secret in it, for a record), `RemoteCredentials` (what the hub keeps for a
|
|
12
|
+
* person's connection) and `ConnectKeyRecord` (what the hub reads of a key-scoped system's key records).
|
|
13
|
+
*
|
|
14
|
+
* And what the hub's Connections page shows for an instance (`instanceConnectOf`, for `ctx.instanceConnect`) or a key
|
|
15
|
+
* (`keyConnectOf`), the form a person fills for a per-person token or headers, the credentials kept for them, and the
|
|
16
|
+
* headers a call sends. Shared tokens and header values are the instance's config secrets; per-person ones and OAuth
|
|
17
|
+
* tokens are the person's connection, kept by the hub.
|
|
7
18
|
*/
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
19
|
+
import { ActorId, ConnectKey, type ConfigPath, type InstanceConnect, type Json } from '@harness/core';
|
|
20
|
+
import { z } from 'zod';
|
|
10
21
|
import { g, parseValue, wireType, type GinType } from './gin.ts';
|
|
11
22
|
|
|
23
|
+
/** Whose credentials a call uses: one set for everyone (`shared`) or each caller's own (`person`). */
|
|
24
|
+
export const RemoteAuthPer = z.enum(['shared', 'person']);
|
|
25
|
+
export type RemoteAuthPer = z.infer<typeof RemoteAuthPer>;
|
|
26
|
+
|
|
27
|
+
/** A header's name (`X-Api-Key`). */
|
|
28
|
+
export const HeaderName = z.string().regex(/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/);
|
|
29
|
+
export type HeaderName = z.infer<typeof HeaderName>;
|
|
30
|
+
|
|
31
|
+
/** Header values by name. Shared values are config secrets; per-person values are left out here. */
|
|
32
|
+
export const HeaderValues = z.record(HeaderName, z.string());
|
|
33
|
+
export type HeaderValues = z.infer<typeof HeaderValues>;
|
|
34
|
+
|
|
35
|
+
/** Nothing to send. */
|
|
36
|
+
const NoAuth = z.object({ kind: z.literal('none') });
|
|
37
|
+
|
|
38
|
+
/** A bearer token. */
|
|
39
|
+
const BearerAuth = z.object({
|
|
40
|
+
kind: z.literal('bearer'),
|
|
41
|
+
per: RemoteAuthPer,
|
|
42
|
+
/** The shared token (a config secret); absent for `per: 'person'`. */
|
|
43
|
+
token: z.string().min(1).optional(),
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
/** Header values. */
|
|
47
|
+
const HeadersAuth = z.object({
|
|
48
|
+
kind: z.literal('headers'),
|
|
49
|
+
per: RemoteAuthPer,
|
|
50
|
+
/** The header names a person fills in (`per: 'person'`), or the shared values by name (config secrets). */
|
|
51
|
+
names: z.array(HeaderName).min(1),
|
|
52
|
+
values: HeaderValues.optional(),
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
/** The browser sign-in. */
|
|
56
|
+
const OAuthAuth = z.object({
|
|
57
|
+
kind: z.literal('oauth'),
|
|
58
|
+
per: RemoteAuthPer,
|
|
59
|
+
/** Scopes to ask for; absent asks for what the server's metadata says it supports. */
|
|
60
|
+
scopes: z.array(z.string().min(1)).optional(),
|
|
61
|
+
/** A client registered by hand; absent, the instance registers itself (OAuth dynamic client registration). */
|
|
62
|
+
clientId: z.string().min(1).optional(),
|
|
63
|
+
/** That client's secret (a config secret), for a confidential client. */
|
|
64
|
+
clientSecret: z.string().min(1).optional(),
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
/** How an instance signs in to its remote service. */
|
|
68
|
+
export const RemoteAuth = z.discriminatedUnion('kind', [NoAuth, BearerAuth, HeadersAuth, OAuthAuth]);
|
|
69
|
+
export type RemoteAuth = z.infer<typeof RemoteAuth>;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The sign-ins that need no browser flow: none, a token or header values. A service whose OAuth endpoints are not
|
|
73
|
+
* found from the server itself (an API service, unlike an MCP server) signs in with one of these.
|
|
74
|
+
*/
|
|
75
|
+
export const TypedAuth = z.discriminatedUnion('kind', [NoAuth, BearerAuth, HeadersAuth]);
|
|
76
|
+
export type TypedAuth = z.infer<typeof TypedAuth>;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* A `TypedAuth` with no secret in it: how a record (which never holds a secret) says its service signs in. A shared
|
|
80
|
+
* token or shared header values are then one admin's connection shared with everyone (`InstanceConnect.share`), and a
|
|
81
|
+
* per-person one each person's own connection, both kept by the hub as secrets.
|
|
82
|
+
*/
|
|
83
|
+
export const RecordAuth = z.discriminatedUnion('kind', [
|
|
84
|
+
NoAuth,
|
|
85
|
+
BearerAuth.omit({ token: true }),
|
|
86
|
+
HeadersAuth.omit({ values: true }),
|
|
87
|
+
]);
|
|
88
|
+
export type RecordAuth = z.infer<typeof RecordAuth>;
|
|
89
|
+
|
|
90
|
+
/** The config paths (under an instance's `auth` field) that hold a `TypedAuth`'s secrets. */
|
|
91
|
+
export const TYPED_AUTH_SECRETS = ['auth.token', 'auth.values'] as const satisfies readonly ConfigPath[];
|
|
92
|
+
|
|
93
|
+
/** The config paths (under an instance's `auth` field) that hold secrets: sealed by the hub, never shown again. */
|
|
94
|
+
export const REMOTE_AUTH_SECRETS = ['auth.token', 'auth.values', 'auth.clientSecret'] as const satisfies readonly ConfigPath[];
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* What a person connects with for an auth that is per person (or an OAuth shared through one connection): the connect
|
|
98
|
+
* flow it maps to. `undefined` when calls need no connection at all.
|
|
99
|
+
*/
|
|
100
|
+
export function connectFlowOf(auth: RemoteAuth): 'oauth' | 'form' | undefined {
|
|
101
|
+
if (auth.kind === 'oauth') return 'oauth';
|
|
102
|
+
if (auth.kind === 'none' || auth.per === 'shared') return undefined;
|
|
103
|
+
return 'form';
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** Per-person credentials kept by the hub for a `form` connection: the token or the header values the person typed. */
|
|
107
|
+
export const RemoteCredentials = z.union([
|
|
108
|
+
z.object({ token: z.string().min(1) }),
|
|
109
|
+
z.object({ headers: HeaderValues }),
|
|
110
|
+
/** OAuth tokens, refreshed by the instance and handed back with `connectionUpdate`. */
|
|
111
|
+
z.object({
|
|
112
|
+
accessToken: z.string().min(1),
|
|
113
|
+
refreshToken: z.string().min(1).optional(),
|
|
114
|
+
tokenType: z.string().default('Bearer'),
|
|
115
|
+
/** The client the tokens were issued to (one the instance registered itself), needed to refresh them. */
|
|
116
|
+
clientId: z.string().min(1).optional(),
|
|
117
|
+
}),
|
|
118
|
+
]);
|
|
119
|
+
export type RemoteCredentials = z.infer<typeof RemoteCredentials>;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* What the hub reads of each record of a key-scoped system's key type (`ConnectDecl.keys.type`): the key, the words on
|
|
123
|
+
* its card, and how it signs in (`RemoteAuth`, from which the hub works out how people connect). Optional: `baseUrl`,
|
|
124
|
+
* where its requests go (the card shows its host, so people see where a token goes before they type it), and
|
|
125
|
+
* `privateTo`, the one person who sees and connects to it (absent: everyone who sees the system). Other fields are the
|
|
126
|
+
* system's own.
|
|
127
|
+
*/
|
|
128
|
+
export const ConnectKeyRecord = z.looseObject({
|
|
129
|
+
name: ConnectKey, label: z.string().min(1), auth: RemoteAuth, baseUrl: z.url().optional(), privateTo: ActorId.optional(),
|
|
130
|
+
});
|
|
131
|
+
export type ConnectKeyRecord = z.infer<typeof ConnectKeyRecord>;
|
|
132
|
+
|
|
12
133
|
/**
|
|
13
134
|
* Whose typed token or header values a connect form takes: `person`, only a per-person auth's (each person their own);
|
|
14
135
|
* `any`, a shared one's too (one admin types it for everyone, for a key whose record holds no secret: `keyConnectOf`).
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* metadata, with a stable `key` people never see) between `---` lines, then its content. `readContextFolder` reads and
|
|
4
4
|
* checks the files on their own (the header against the schema, duplicate keys), with the file and line of every
|
|
5
5
|
* problem; `@harness/build` checks the links between them on top. `serve` sends the entries as the system's context,
|
|
6
|
-
* and with `
|
|
6
|
+
* and with `FNLOOM_CONTEXT_WATCH` it watches the folder and patches the hub live, keyed by `key`, so a moved or
|
|
7
7
|
* renamed file updates the same record.
|
|
8
8
|
*/
|
|
9
9
|
import { watch, type FSWatcher } from 'node:fs';
|