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
|
@@ -163,13 +163,13 @@ The guide to every part of a system is `packages/sdk/AUTHORING.md` (in the chat:
|
|
|
163
163
|
```sh
|
|
164
164
|
npm run typecheck # from the harness repository: every project, this one included
|
|
165
165
|
npx vitest run systems/template # its tests
|
|
166
|
-
|
|
166
|
+
FNLOOM_HUB=ws://127.0.0.1:4300/link npx tsx systems/template/server/main.ts
|
|
167
167
|
```
|
|
168
168
|
|
|
169
169
|
The first time it connects, the hub has never seen the name, so the system waits to be paired: it prints a pairing
|
|
170
170
|
code and link (and a QR code). An admin opens the link, checks the code, fills in the config and approves. To skip
|
|
171
171
|
that, an admin makes a one-time token (Admin, Systems, Pairing token) and the system starts with
|
|
172
|
-
`
|
|
172
|
+
`FNLOOM_PAIRING_TOKEN=<token>`. It keeps its key in `FNLOOM_SYSTEM_STATE` (default `.harness/systems/template`), so
|
|
173
173
|
later starts sign in on their own.
|
|
174
174
|
|
|
175
175
|
## Build, pack and install
|
|
@@ -416,11 +416,11 @@ const { host, log } = loggedHost(template.name);
|
|
|
416
416
|
// TODO: build each outside dependency here and pass it to createImpl.
|
|
417
417
|
const impl = createImpl({ settings });
|
|
418
418
|
|
|
419
|
-
log.info('template.serving', { hub: settings.
|
|
419
|
+
log.info('template.serving', { hub: settings.FNLOOM_HUB });
|
|
420
420
|
const running = await serve(template, impl, {
|
|
421
|
-
hub: settings.
|
|
422
|
-
state: settings.
|
|
423
|
-
...(settings.
|
|
421
|
+
hub: settings.FNLOOM_HUB,
|
|
422
|
+
state: settings.FNLOOM_SYSTEM_STATE,
|
|
423
|
+
...(settings.FNLOOM_PAIRING_TOKEN === undefined ? {} : { pairingToken: settings.FNLOOM_PAIRING_TOKEN }),
|
|
424
424
|
// client: the folder of the built renderers (`buildClient` from `@harness/sdk/build`), once `client/` has any.
|
|
425
425
|
}, host);
|
|
426
426
|
running.onStatus((status) => { log.info('template.status', { status }); });
|
|
@@ -699,7 +699,7 @@ grants: { hub: ['data', 'fns', 'settings', 'state'], calls: ['hub/ask_user'] },
|
|
|
699
699
|
A refused call throws in the system: the hub answers 403 with the code `NOT_GRANTED` and a line saying what was
|
|
700
700
|
missing (`it didn't declare the state capability, which stateSet needs`), and a fn that doesn't catch it fails with
|
|
701
701
|
that text. Every refusal is logged where the admin reviews the system, and a system that keeps going past its grants
|
|
702
|
-
(`
|
|
702
|
+
(`FNLOOM_REFUSALS_PAUSE` refusals in `FNLOOM_REFUSALS_WINDOW`) has its fns switched off until an admin turns them back
|
|
703
703
|
on. So declare everything the code calls, and nothing more: the review page and the install card show the grants to
|
|
704
704
|
the admin, who goes live on them.
|
|
705
705
|
|
|
@@ -2839,7 +2839,7 @@ the config, named types, the log, a `deadline` with a `signal` that aborts at it
|
|
|
2839
2839
|
`check: { calls }` names; `check: true` calls nothing. Each call is a child of the waiting run (under its own
|
|
2840
2840
|
`check:` keys) and must be of a `read` fn: the hub refuses a call to any other fn, and denies one that would wait for
|
|
2841
2841
|
approval instead of asking. A check makes no model calls and changes nothing. One that can't finish (its system gone,
|
|
2842
|
-
an error, the hub's `
|
|
2842
|
+
an error, the hub's `FNLOOM_ARGS_CHECK_TIMEOUT`) is logged and the call goes on as if there were none, so `run`
|
|
2843
2843
|
still checks for itself. `kit.check('<fn>', args)` gives its problems and the calls it made (**Testing**).
|
|
2844
2844
|
|
|
2845
2845
|
```ts
|
|
@@ -4125,8 +4125,8 @@ tidy: {
|
|
|
4125
4125
|
`ResultTable`) and the model a `ResultBlock`: `resultBlock(table, { fn: { name, signature }, args })` from
|
|
4126
4126
|
`@harness/sdk/server` says what the person sees and that the model shouldn't repeat it, lists the columns, the row
|
|
4127
4127
|
count, the total when counted, whether there are more rows with the exact call for the next page (`nextPage`), the
|
|
4128
|
-
sort, and a `sample` of the first rows within `
|
|
4129
|
-
`
|
|
4128
|
+
sort, and a `sample` of the first rows within `FNLOOM_RESULT_SAMPLE_TOKENS` (long text cut at
|
|
4129
|
+
`FNLOOM_RESULT_CELL_CHARS`), with a `sampleNote` saying how much is there. `ResultBlockType` is its gin form for
|
|
4130
4130
|
`returns`.
|
|
4131
4131
|
|
|
4132
4132
|
### Reference: outcomes: done, invalid input, failed, paused, cancelled, undo
|
|
@@ -4247,9 +4247,9 @@ interface ResultBlockOptions {
|
|
|
4247
4247
|
readonly args?: Readonly<Record<string, Json>>;
|
|
4248
4248
|
/** What the person sees the rows as (default `a table`), for the sentence the model reads. */
|
|
4249
4249
|
readonly visual?: string;
|
|
4250
|
-
/** The sample's token budget. Default: `
|
|
4250
|
+
/** The sample's token budget. Default: `FNLOOM_RESULT_SAMPLE_TOKENS`. */
|
|
4251
4251
|
readonly budget?: number;
|
|
4252
|
-
/** The most characters of one text cell in the sample. Default: `
|
|
4252
|
+
/** The most characters of one text cell in the sample. Default: `FNLOOM_RESULT_CELL_CHARS`. */
|
|
4253
4253
|
readonly cellChars?: number;
|
|
4254
4254
|
/** Whether a person is watching the run (`RunInfo.watched === true`), so the rows are shown to them. Default true. */
|
|
4255
4255
|
readonly watched?: boolean;
|
|
@@ -4534,7 +4534,7 @@ is a new fn kept in the hub.
|
|
|
4534
4534
|
The agent works through fixed stages: **find** (search what exists; `reuse` answers with an existing fn), **inspect**
|
|
4535
4535
|
(load the details of what the search found), **draft** (the built-in `draft` tool, whose args are your typed `draft`
|
|
4536
4536
|
schema), **check** (your `check`, run on every draft: each problem on its own line, in words the model can act on),
|
|
4537
|
-
**fix** (a draft with problems sends the model back, up to `
|
|
4537
|
+
**fix** (a draft with problems sends the model back, up to `FNLOOM_AUTHORING_FIXES` times) and **save** (offered only
|
|
4538
4538
|
once a draft checked clean; your `save` keeps it as a fn). A tool of a stage is offered only once every stage before
|
|
4539
4539
|
it is done, so the model can't draft before it has searched, and until something is saved or reused every round must
|
|
4540
4540
|
call a tool (`toolChoice: 'required'`), so a model can't stop in words with a clean draft unsaved.
|
|
@@ -4923,7 +4923,7 @@ interface AgentInput<A, R, T extends StatusTemplates = StatusTemplates> {
|
|
|
4923
4923
|
mode?: NonNullable<LlmPayload['mode']>;
|
|
4924
4924
|
/** What goes into each prompt: plain (the hub's default), suggest, or graph (for small local models). */
|
|
4925
4925
|
contextor?: NonNullable<LlmPayload['contextor']>;
|
|
4926
|
-
/** The most tokens one answer may take (never past the model's own limit); the hub's `
|
|
4926
|
+
/** The most tokens one answer may take (never past the model's own limit); the hub's `FNLOOM_AGENT_MAX_OUTPUT` when absent. */
|
|
4927
4927
|
maxOutput?: number;
|
|
4928
4928
|
visibility?: Audience;
|
|
4929
4929
|
tags?: string[];
|
|
@@ -5072,11 +5072,11 @@ interface AuthoringAgentInput<S, D> {
|
|
|
5072
5072
|
reuse?(fn: string, session: AuthoringSession<S, D>): Promise<AuthoredFn | string>;
|
|
5073
5073
|
/** The model, the aeye way (`role/chat`, `openrouter/…`); the hub picks when absent. */
|
|
5074
5074
|
readonly model?: string;
|
|
5075
|
-
/** Failed checks it may fix; `
|
|
5075
|
+
/** Failed checks it may fix; `FNLOOM_AUTHORING_FIXES` when absent. */
|
|
5076
5076
|
readonly fixes?: number;
|
|
5077
|
-
/** Model rounds; `
|
|
5077
|
+
/** Model rounds; `FNLOOM_AUTHORING_ROUNDS` when absent. */
|
|
5078
5078
|
readonly rounds?: number;
|
|
5079
|
-
/** The most tokens one model step may write; `
|
|
5079
|
+
/** The most tokens one model step may write; `FNLOOM_AUTHORING_MAX_TOKENS` when absent. */
|
|
5080
5080
|
readonly maxTokens?: number;
|
|
5081
5081
|
/** `find: false`: the agent is handed what it builds on, so it starts in `inspect` (no find tools, no `reuse`). */
|
|
5082
5082
|
readonly stages?: { readonly find?: boolean };
|
|
@@ -5289,18 +5289,20 @@ class Disclosure {
|
|
|
5289
5289
|
|
|
5290
5290
|
#### `authoredFn`
|
|
5291
5291
|
|
|
5292
|
-
const · `import { authoredFn } from '@harness/sdk
|
|
5292
|
+
const · `import { authoredFn } from '@harness/sdk'`
|
|
5293
5293
|
|
|
5294
5294
|
What an authoring fn answers the chat model with: the saved fn, what it does, how to call it again, and a short
|
|
5295
5295
|
preview of what it gives. Never the working context.
|
|
5296
5296
|
|
|
5297
5297
|
```ts
|
|
5298
|
-
const authoredFn: ObjType<{ fn: string; version: number; signature: string; about: string; reused: boolean; call: string; preview?:
|
|
5298
|
+
const authoredFn: ObjType<{ fn: string; version: number; signature: string; about: string; reused: boolean; call: string; preview?: JSONType | undefined; }>;
|
|
5299
5299
|
```
|
|
5300
5300
|
|
|
5301
5301
|
#### `AuthoredFn`
|
|
5302
5302
|
|
|
5303
|
-
type · `import { AuthoredFn } from '@harness/sdk
|
|
5303
|
+
type · `import { AuthoredFn } from '@harness/sdk'`
|
|
5304
|
+
|
|
5305
|
+
What an authoring fn answers, for a contract that declares one (the agent itself is `@harness/sdk/server`'s).
|
|
5304
5306
|
|
|
5305
5307
|
```ts
|
|
5306
5308
|
type AuthoredFn = Infer<typeof authoredFn>;
|
|
@@ -5327,7 +5329,7 @@ const · `import { authoringEnv } from '@harness/sdk/server'`
|
|
|
5327
5329
|
The authoring agents' tunables.
|
|
5328
5330
|
|
|
5329
5331
|
```ts
|
|
5330
|
-
const authoringEnv: Env<EnvOutput<{}, { readonly
|
|
5332
|
+
const authoringEnv: Env<EnvOutput<{}, { readonly FNLOOM_AUTHORING_FIXES: z.ZodDefault<z.ZodCoercedNumber<unknown>>; readonly FNLOOM_AUTHORING_ROUNDS: z.ZodDefault<z.ZodCoercedNumber<unknown>>; readonly FNLOOM_AUTHORING_MAX_TOKENS: z.ZodDefault<z.ZodCoercedNumber<unknown>>; }>>;
|
|
5331
5333
|
```
|
|
5332
5334
|
|
|
5333
5335
|
## 13. Settings and attachments
|
|
@@ -5563,7 +5565,7 @@ Notes are plain markdown. Use fn:notes/add to add one, or read [adding notes](co
|
|
|
5563
5565
|
`harness system build` checks the folder and fails with `file:line:col` problems on a header that doesn't match, a
|
|
5564
5566
|
duplicate key, a link to a fn or context that doesn't exist (in the header, and `context:` / `fn:` references in the
|
|
5565
5567
|
body), a context that imports itself in a cycle, and a missing summary. `serve` sends the files as the system's context;
|
|
5566
|
-
with `
|
|
5568
|
+
with `FNLOOM_CONTEXT_WATCH=true` (development) it watches the folder and sends each saved change to the hub. Keep each
|
|
5567
5569
|
item to one idea with a short summary, start with a shallow index whose `choices` are worded as decisions, and let a
|
|
5568
5570
|
small model walk the graph a step at a time instead of reading one long list.
|
|
5569
5571
|
|
|
@@ -7500,7 +7502,7 @@ This is the hub contract as the SDK declares it now:
|
|
|
7500
7502
|
```text
|
|
7501
7503
|
(obj) => text
|
|
7502
7504
|
```
|
|
7503
|
-
- `hub/configure_provider`: Add a model provider (OpenAI, OpenRouter, Ollama) with its API key, or replace its key. The key is stored encrypted. Tags: `admin`.
|
|
7505
|
+
- `hub/configure_provider`: 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. Tags: `admin`.
|
|
7504
7506
|
|
|
7505
7507
|
```text
|
|
7506
7508
|
(obj{ provider, apiKey?, baseURL?, contextWindow?, decisionModels?, region?, auth?, profilePrefix? … }) => obj{models: num{whole=true}}
|
|
@@ -7889,7 +7891,7 @@ This is the hub contract as the SDK declares it now:
|
|
|
7889
7891
|
```text
|
|
7890
7892
|
(obj) => list<obj{
|
|
7891
7893
|
/* provider id */ id: text,
|
|
7892
|
-
provider: enum<text>{openai, openrouter, ollama, aws},
|
|
7894
|
+
provider: enum<text>{openai, anthropic, google, openrouter, ollama, aws},
|
|
7893
7895
|
models: num{whole=true}
|
|
7894
7896
|
}>
|
|
7895
7897
|
```
|
|
@@ -8467,7 +8469,7 @@ const LlmPayloadType = g.obj({
|
|
|
8467
8469
|
contextor: g.optional(ContextorType),
|
|
8468
8470
|
/**
|
|
8469
8471
|
* The most tokens one answer may take (as core's `ModelLimits.maxOutputTokens`, and never past the model's own
|
|
8470
|
-
* limit); the hub's `
|
|
8472
|
+
* limit); the hub's `FNLOOM_AGENT_MAX_OUTPUT` when absent.
|
|
8471
8473
|
*/
|
|
8472
8474
|
maxOutput: g.optional(ginAs(ModelLimits.shape.maxOutputTokens.unwrap())),
|
|
8473
8475
|
/**
|
|
@@ -8497,7 +8499,7 @@ const · `import { ChatModeType } from '@harness/sdk'`
|
|
|
8497
8499
|
A chat mode's settings, as a gin type: core's `ChatModeConfig` input (defaults may be left out).
|
|
8498
8500
|
|
|
8499
8501
|
```ts
|
|
8500
|
-
const ChatModeType: GinType<{ type: "tools"; } | { type: "static"; protocol?: "text" | "auto" | "native" | undefined; placement?: "system-end" | "tail" | undefined; loadDetail?: "
|
|
8502
|
+
const ChatModeType: GinType<{ type: "tools"; } | { type: "static"; protocol?: "text" | "auto" | "native" | undefined; placement?: "system-end" | "tail" | undefined; loadDetail?: "signature" | "listed" | "full" | undefined; }>;
|
|
8501
8503
|
```
|
|
8502
8504
|
|
|
8503
8505
|
Refers to: [`ChatModeConfig`](#core-chatmodeconfig).
|
|
@@ -8670,14 +8672,14 @@ const { host, log } = loggedHost(notes.name);
|
|
|
8670
8672
|
const impl = createNotesImpl({ settings });
|
|
8671
8673
|
|
|
8672
8674
|
// the renderers, built into the state folder and uploaded to the hub on connect
|
|
8673
|
-
const clientFolder = join(settings.
|
|
8675
|
+
const clientFolder = join(settings.FNLOOM_SYSTEM_STATE, 'client');
|
|
8674
8676
|
await buildClient({ entry: fileURLToPath(new URL('../client/index.ts', import.meta.url)), outDir: clientFolder });
|
|
8675
8677
|
|
|
8676
8678
|
const running = await serve(notes, impl, {
|
|
8677
|
-
hub: settings.
|
|
8678
|
-
state: settings.
|
|
8679
|
+
hub: settings.FNLOOM_HUB,
|
|
8680
|
+
state: settings.FNLOOM_SYSTEM_STATE,
|
|
8679
8681
|
client: clientFolder,
|
|
8680
|
-
...(settings.
|
|
8682
|
+
...(settings.FNLOOM_PAIRING_TOKEN === undefined ? {} : { pairingToken: settings.FNLOOM_PAIRING_TOKEN }),
|
|
8681
8683
|
}, host);
|
|
8682
8684
|
running.onStatus((status) => { log.info('notes.status', { status }); });
|
|
8683
8685
|
|
|
@@ -8693,10 +8695,10 @@ outcome journal), `pairingToken` (a one-time token an admin made), `client` (the
|
|
|
8693
8695
|
`version` (default: from `package.json`), `mcp` (also serve its native fns as an MCP server over stdio or HTTP),
|
|
8694
8696
|
`connectTimeout`, and seams for `files` and `fetch`.
|
|
8695
8697
|
|
|
8696
|
-
**Env.** A system's tunables are an `@ayepi/env` slice that spreads `systemFields()` (the hub URL `
|
|
8697
|
-
instance `
|
|
8698
|
+
**Env.** A system's tunables are an `@ayepi/env` slice that spreads `systemFields()` (the hub URL `FNLOOM_HUB`, the
|
|
8699
|
+
instance `FNLOOM_INSTANCE`, the pairing token `FNLOOM_PAIRING_TOKEN`, the data and cache folders) and its own, each a
|
|
8698
8700
|
zod schema with a default and a TSDoc line, then adds `systemState('<name>')`: the state folder
|
|
8699
|
-
`
|
|
8701
|
+
`FNLOOM_SYSTEM_STATE`, which defaults to one of its own per instance. Feature code never reads `process.env`:
|
|
8700
8702
|
|
|
8701
8703
|
_From `scripts/docs/example/server/env.ts`:_
|
|
8702
8704
|
|
|
@@ -8776,7 +8778,7 @@ interface ServeOptions {
|
|
|
8776
8778
|
/**
|
|
8777
8779
|
* The system's context folder (markdown files with YAML headers, `context-files.ts`), sent as its context; `false`
|
|
8778
8780
|
* for none. Default: `context/` beside its `system.json`, when there is one. A folder with problems stops the start;
|
|
8779
|
-
* with `
|
|
8781
|
+
* with `FNLOOM_CONTEXT_WATCH` its changes go to the hub live.
|
|
8780
8782
|
*/
|
|
8781
8783
|
context?: string | false;
|
|
8782
8784
|
/**
|
|
@@ -8794,7 +8796,7 @@ Refers to: [`Duration`](#core-duration), [`InstanceMode`](#core-instancemode).
|
|
|
8794
8796
|
|
|
8795
8797
|
type · `import { McpServe } from '@harness/sdk/server'`
|
|
8796
8798
|
|
|
8797
|
-
Where the MCP face listens: stdin/stdout, or MCP Streamable HTTP on a port (any path; body limit `
|
|
8799
|
+
Where the MCP face listens: stdin/stdout, or MCP Streamable HTTP on a port (any path; body limit `FNLOOM_MCP_MAX_BODY`).
|
|
8798
8800
|
|
|
8799
8801
|
```ts
|
|
8800
8802
|
type McpServe = { stdio: true } | { http: { port: number; host?: string } };
|
|
@@ -8985,7 +8987,7 @@ The link fields of a system's env slice, for spreading into it, followed by its
|
|
|
8985
8987
|
machine's default port, the instance to `main`.
|
|
8986
8988
|
|
|
8987
8989
|
```ts
|
|
8988
|
-
function systemFields(): { readonly
|
|
8990
|
+
function systemFields(): { readonly FNLOOM_SYSTEM_DATA: z.ZodOptional<z.ZodString>; readonly FNLOOM_SYSTEM_CACHE: z.ZodOptional<z.ZodString>; readonly FNLOOM_HUB: z.ZodDefault<z.ZodString>; readonly FNLOOM_INSTANCE: z.ZodDefault<z.core.$ZodBranded<z.ZodString, "InstanceName", "out">>; readonly FNLOOM_PAIRING_TOKEN: z.ZodOptional<z.ZodString>; };
|
|
8989
8991
|
```
|
|
8990
8992
|
|
|
8991
8993
|
#### `systemState`
|
|
@@ -8997,7 +8999,7 @@ A system's state folder, where it keeps its key pair, outcome journal and anythi
|
|
|
8997
8999
|
hand on one machine never share a key pair. A group of its own because it reads the instance (`systemFields`).
|
|
8998
9000
|
|
|
8999
9001
|
```ts
|
|
9000
|
-
function systemState(name: string): { readonly
|
|
9002
|
+
function systemState(name: string): { readonly FNLOOM_SYSTEM_STATE: (e: { readonly [SYSTEM_ENV.instance]: InstanceName; }) => z.ZodDefault<z.ZodString>; };
|
|
9001
9003
|
```
|
|
9002
9004
|
|
|
9003
9005
|
#### `defaultStateFolder`
|
|
@@ -9022,23 +9024,23 @@ so the names can't drift.
|
|
|
9022
9024
|
|
|
9023
9025
|
```ts
|
|
9024
9026
|
const SYSTEM_ENV = {
|
|
9025
|
-
hub: '
|
|
9026
|
-
state: '
|
|
9027
|
+
hub: 'FNLOOM_HUB',
|
|
9028
|
+
state: 'FNLOOM_SYSTEM_STATE',
|
|
9027
9029
|
/** Which copy of the system this process is (`main` when unset); a fleet's instances each have their own. */
|
|
9028
|
-
instance: '
|
|
9030
|
+
instance: 'FNLOOM_INSTANCE',
|
|
9029
9031
|
/** The instance's own data folder, outside the package, kept across upgrades and exported with its data. */
|
|
9030
|
-
data: '
|
|
9032
|
+
data: 'FNLOOM_SYSTEM_DATA',
|
|
9031
9033
|
/** The instance's cache folder: rebuildable, never exported. */
|
|
9032
|
-
cache: '
|
|
9033
|
-
name: '
|
|
9034
|
-
pairingToken: '
|
|
9035
|
-
supervised: '
|
|
9036
|
-
restartCode: '
|
|
9034
|
+
cache: 'FNLOOM_SYSTEM_CACHE',
|
|
9035
|
+
name: 'FNLOOM_SYSTEM_NAME',
|
|
9036
|
+
pairingToken: 'FNLOOM_PAIRING_TOKEN',
|
|
9037
|
+
supervised: 'FNLOOM_SUPERVISED',
|
|
9038
|
+
restartCode: 'FNLOOM_RESTART_CODE',
|
|
9037
9039
|
/**
|
|
9038
9040
|
* The hub's folder of database drivers (`pg`, `tedious`, `tarn`), which it installs when a store is placed in
|
|
9039
9041
|
* Postgres or SQL Server: a store that opens there loads them from it when the system has none of its own.
|
|
9040
9042
|
*/
|
|
9041
|
-
storeDrivers: '
|
|
9043
|
+
storeDrivers: 'FNLOOM_STORE_DRIVERS',
|
|
9042
9044
|
} as const;
|
|
9043
9045
|
```
|
|
9044
9046
|
|
|
@@ -9131,7 +9133,7 @@ interface LinkHostDeps {
|
|
|
9131
9133
|
readonly env?: SdkEnv;
|
|
9132
9134
|
/** The process logger. Default: console, plus the hub while connected. */
|
|
9133
9135
|
readonly logger?: (sink: (line: LogLine) => void) => Logger;
|
|
9134
|
-
/** Shows a pending pairing. Default: a QR code on a terminal (`
|
|
9136
|
+
/** Shows a pending pairing. Default: a QR code on a terminal (`FNLOOM_PAIRING_QR`), else a log line. */
|
|
9135
9137
|
readonly pairing?: PairingDisplay;
|
|
9136
9138
|
/** Makes the instance's data and cache folders before the system starts. Default: `mkdir -p` each. */
|
|
9137
9139
|
readonly folders?: (dirs: readonly string[]) => Promise<void>;
|
|
@@ -10795,10 +10797,10 @@ Refers to: [`QualifiedName`](#core-qualifiedname).
|
|
|
10795
10797
|
|
|
10796
10798
|
A system that calls a remote service it was set up for (an MCP server) is a fleet: one instance per service, added from
|
|
10797
10799
|
the browser with its config (`instances: "many"` in `system.json`). A system that authors code calling many services
|
|
10798
|
-
(the `api` system) runs one instance and keeps its services as records instead: see **Connections per key** below. Its sign-in is
|
|
10800
|
+
(the `api` system) runs one instance and keeps its services as records instead: see **Connections per key** below. Its sign-in is the SDK's `RemoteAuth` in that config:
|
|
10799
10801
|
`none`, `bearer` (a token), `headers` (named header values) or `oauth`, each `per: 'shared'` (the instance's own config
|
|
10800
10802
|
secrets, the same for everyone) or `per: 'person'` (each person connects their own). List the secret paths in
|
|
10801
|
-
`configSecrets` (
|
|
10803
|
+
`configSecrets` (`REMOTE_AUTH_SECRETS` under `auth`), so the hub seals them and never shows them again.
|
|
10802
10804
|
|
|
10803
10805
|
**Connections per instance.** Declare `connect` with `scope: 'instance'`: then every fn that runs on the instance acts
|
|
10804
10806
|
as the person, and each instance tells the hub how people connect to it with `ctx.instanceConnect(...)`
|
|
@@ -10809,7 +10811,7 @@ OAuth (an admin's sign-in shared with everyone when `per: 'shared'`), a form for
|
|
|
10809
10811
|
finds the instance's fns unavailable until they connect on the Connections page.
|
|
10810
10812
|
|
|
10811
10813
|
**Connections per key.** Declare `connect` with `scope: 'key'` and `keys: { type: '<system>/<Type>' }`, a stored type of
|
|
10812
|
-
yours whose records each carry `name` (the key), `label` and `auth` (
|
|
10814
|
+
yours whose records each carry `name` (the key), `label` and `auth` (`ConnectKeyRecord`; use `RecordAuth`, the
|
|
10813
10815
|
`TypedAuth` with no secret in it, since a record never holds one). The hub reads the records from its database and
|
|
10814
10816
|
shows a card per key on the Connections page, worked out with `keyConnectOf(label, auth)`: a per-person token or headers
|
|
10815
10817
|
is each person's own form, and a shared one is one admin's form, shared with everyone. A fn acts through its key:
|
|
@@ -10818,7 +10820,7 @@ fn's service): the run gets the person's (or the shared) connection to that key,
|
|
|
10818
10820
|
the key needs one (fail with `code: 'not-connected'`). `connectFinish` gets the `key`; read the shared form with `credentialsFromForm(auth, form, 'any')`.
|
|
10819
10821
|
|
|
10820
10822
|
**Credentials.** A form connection's `connectFinish` reads the filled form with `credentialsFromForm(auth, form)` into
|
|
10821
|
-
|
|
10823
|
+
`RemoteCredentials` (or a problem to show), which the hub keeps as the person's connection; `accountLabel` names
|
|
10822
10824
|
it without the secret. In a run, `ctx.connection.credentials` carries it back: `readCredentials` reads it and `credentialHeaders`
|
|
10823
10825
|
turns it into the headers to send; `sharedHeaders(auth)` gives the instance's own. OAuth tokens a run refreshes go back
|
|
10824
10826
|
with `ctx.updateConnection`. Never log a secret: `maskHeaders(headers, secretHeaderNames(auth))` is what a trace or a
|
|
@@ -10837,6 +10839,202 @@ its `ayepi-mcp.md` before using it.
|
|
|
10837
10839
|
|
|
10838
10840
|
### Reference: remote services: fleets, sign-in and connections per instance
|
|
10839
10841
|
|
|
10842
|
+
#### `RemoteAuth`
|
|
10843
|
+
|
|
10844
|
+
const, type · `import { RemoteAuth } from '@harness/sdk'`
|
|
10845
|
+
|
|
10846
|
+
How an instance signs in to its remote service.
|
|
10847
|
+
|
|
10848
|
+
```ts
|
|
10849
|
+
type RemoteAuth = {
|
|
10850
|
+
kind: "none";
|
|
10851
|
+
} | {
|
|
10852
|
+
kind: "bearer";
|
|
10853
|
+
per: "shared" | "person";
|
|
10854
|
+
token?: string | undefined;
|
|
10855
|
+
} | {
|
|
10856
|
+
kind: "headers";
|
|
10857
|
+
per: "shared" | "person";
|
|
10858
|
+
names: string[];
|
|
10859
|
+
values?: Record<string, string> | undefined;
|
|
10860
|
+
} | {
|
|
10861
|
+
kind: "oauth";
|
|
10862
|
+
per: "shared" | "person";
|
|
10863
|
+
scopes?: string[] | undefined;
|
|
10864
|
+
clientId?: string | undefined;
|
|
10865
|
+
clientSecret?: string | undefined;
|
|
10866
|
+
};
|
|
10867
|
+
```
|
|
10868
|
+
|
|
10869
|
+
#### `RemoteAuthPer`
|
|
10870
|
+
|
|
10871
|
+
const, type · `import { RemoteAuthPer } from '@harness/sdk'`
|
|
10872
|
+
|
|
10873
|
+
Whose credentials a call uses: one set for everyone (`shared`) or each caller's own (`person`).
|
|
10874
|
+
|
|
10875
|
+
```ts
|
|
10876
|
+
type RemoteAuthPer = "shared" | "person";
|
|
10877
|
+
```
|
|
10878
|
+
|
|
10879
|
+
#### `TypedAuth`
|
|
10880
|
+
|
|
10881
|
+
const, type · `import { TypedAuth } from '@harness/sdk'`
|
|
10882
|
+
|
|
10883
|
+
The sign-ins that need no browser flow: none, a token or header values. A service whose OAuth endpoints are not
|
|
10884
|
+
found from the server itself (an API service, unlike an MCP server) signs in with one of these.
|
|
10885
|
+
|
|
10886
|
+
```ts
|
|
10887
|
+
type TypedAuth = {
|
|
10888
|
+
kind: "none";
|
|
10889
|
+
} | {
|
|
10890
|
+
kind: "bearer";
|
|
10891
|
+
per: "shared" | "person";
|
|
10892
|
+
token?: string | undefined;
|
|
10893
|
+
} | {
|
|
10894
|
+
kind: "headers";
|
|
10895
|
+
per: "shared" | "person";
|
|
10896
|
+
names: string[];
|
|
10897
|
+
values?: Record<string, string> | undefined;
|
|
10898
|
+
};
|
|
10899
|
+
```
|
|
10900
|
+
|
|
10901
|
+
#### `RecordAuth`
|
|
10902
|
+
|
|
10903
|
+
const, type · `import { RecordAuth } from '@harness/sdk'`
|
|
10904
|
+
|
|
10905
|
+
A `TypedAuth` with no secret in it: how a record (which never holds a secret) says its service signs in. A shared
|
|
10906
|
+
token or shared header values are then one admin's connection shared with everyone (`InstanceConnect.share`), and a
|
|
10907
|
+
per-person one each person's own connection, both kept by the hub as secrets.
|
|
10908
|
+
|
|
10909
|
+
```ts
|
|
10910
|
+
type RecordAuth = {
|
|
10911
|
+
kind: "none";
|
|
10912
|
+
} | {
|
|
10913
|
+
kind: "bearer";
|
|
10914
|
+
per: "shared" | "person";
|
|
10915
|
+
} | {
|
|
10916
|
+
kind: "headers";
|
|
10917
|
+
per: "shared" | "person";
|
|
10918
|
+
names: string[];
|
|
10919
|
+
};
|
|
10920
|
+
```
|
|
10921
|
+
|
|
10922
|
+
#### `HeaderName`
|
|
10923
|
+
|
|
10924
|
+
const, type · `import { HeaderName } from '@harness/sdk'`
|
|
10925
|
+
|
|
10926
|
+
A header's name (`X-Api-Key`).
|
|
10927
|
+
|
|
10928
|
+
```ts
|
|
10929
|
+
type HeaderName = string;
|
|
10930
|
+
```
|
|
10931
|
+
|
|
10932
|
+
#### `HeaderValues`
|
|
10933
|
+
|
|
10934
|
+
const, type · `import { HeaderValues } from '@harness/sdk'`
|
|
10935
|
+
|
|
10936
|
+
Header values by name. Shared values are config secrets; per-person values are left out here.
|
|
10937
|
+
|
|
10938
|
+
```ts
|
|
10939
|
+
type HeaderValues = {
|
|
10940
|
+
[x: string]: string;
|
|
10941
|
+
};
|
|
10942
|
+
```
|
|
10943
|
+
|
|
10944
|
+
#### `REMOTE_AUTH_SECRETS`
|
|
10945
|
+
|
|
10946
|
+
const · `import { REMOTE_AUTH_SECRETS } from '@harness/sdk'`
|
|
10947
|
+
|
|
10948
|
+
The config paths (under an instance's `auth` field) that hold secrets: sealed by the hub, never shown again.
|
|
10949
|
+
|
|
10950
|
+
```ts
|
|
10951
|
+
const REMOTE_AUTH_SECRETS: readonly ["auth.token", "auth.values", "auth.clientSecret"];
|
|
10952
|
+
```
|
|
10953
|
+
|
|
10954
|
+
Refers to: [`ConfigPath`](#core-configpath).
|
|
10955
|
+
|
|
10956
|
+
#### `TYPED_AUTH_SECRETS`
|
|
10957
|
+
|
|
10958
|
+
const · `import { TYPED_AUTH_SECRETS } from '@harness/sdk'`
|
|
10959
|
+
|
|
10960
|
+
The config paths (under an instance's `auth` field) that hold a `TypedAuth`'s secrets.
|
|
10961
|
+
|
|
10962
|
+
```ts
|
|
10963
|
+
const TYPED_AUTH_SECRETS: readonly ["auth.token", "auth.values"];
|
|
10964
|
+
```
|
|
10965
|
+
|
|
10966
|
+
Refers to: [`ConfigPath`](#core-configpath).
|
|
10967
|
+
|
|
10968
|
+
#### `connectFlowOf`
|
|
10969
|
+
|
|
10970
|
+
function · `import { connectFlowOf } from '@harness/sdk'`
|
|
10971
|
+
|
|
10972
|
+
What a person connects with for an auth that is per person (or an OAuth shared through one connection): the connect
|
|
10973
|
+
flow it maps to. `undefined` when calls need no connection at all.
|
|
10974
|
+
|
|
10975
|
+
```ts
|
|
10976
|
+
function connectFlowOf(auth: RemoteAuth): "oauth" | "form" | undefined;
|
|
10977
|
+
```
|
|
10978
|
+
|
|
10979
|
+
#### `RemoteCredentials`
|
|
10980
|
+
|
|
10981
|
+
const, type · `import { RemoteCredentials } from '@harness/sdk'`
|
|
10982
|
+
|
|
10983
|
+
Per-person credentials kept by the hub for a `form` connection: the token or the header values the person typed.
|
|
10984
|
+
|
|
10985
|
+
```ts
|
|
10986
|
+
type RemoteCredentials = {
|
|
10987
|
+
token: string;
|
|
10988
|
+
} | {
|
|
10989
|
+
headers: Record<string, string>;
|
|
10990
|
+
} | {
|
|
10991
|
+
accessToken: string;
|
|
10992
|
+
tokenType: string;
|
|
10993
|
+
refreshToken?: string | undefined;
|
|
10994
|
+
clientId?: string | undefined;
|
|
10995
|
+
};
|
|
10996
|
+
```
|
|
10997
|
+
|
|
10998
|
+
#### `ConnectKeyRecord`
|
|
10999
|
+
|
|
11000
|
+
const, type · `import { ConnectKeyRecord } from '@harness/sdk'`
|
|
11001
|
+
|
|
11002
|
+
What the hub reads of each record of a key-scoped system's key type (`ConnectDecl.keys.type`): the key, the words on
|
|
11003
|
+
its card, and how it signs in (`RemoteAuth`, from which the hub works out how people connect). Optional: `baseUrl`,
|
|
11004
|
+
where its requests go (the card shows its host, so people see where a token goes before they type it), and
|
|
11005
|
+
`privateTo`, the one person who sees and connects to it (absent: everyone who sees the system). Other fields are the
|
|
11006
|
+
system's own.
|
|
11007
|
+
|
|
11008
|
+
```ts
|
|
11009
|
+
type ConnectKeyRecord = {
|
|
11010
|
+
[x: string]: unknown;
|
|
11011
|
+
name: ConnectKey;
|
|
11012
|
+
label: string;
|
|
11013
|
+
auth: {
|
|
11014
|
+
kind: "none";
|
|
11015
|
+
} | {
|
|
11016
|
+
kind: "bearer";
|
|
11017
|
+
per: "shared" | "person";
|
|
11018
|
+
token?: string | undefined;
|
|
11019
|
+
} | {
|
|
11020
|
+
kind: "headers";
|
|
11021
|
+
per: "shared" | "person";
|
|
11022
|
+
names: string[];
|
|
11023
|
+
values?: Record<string, string> | undefined;
|
|
11024
|
+
} | {
|
|
11025
|
+
kind: "oauth";
|
|
11026
|
+
per: "shared" | "person";
|
|
11027
|
+
scopes?: string[] | undefined;
|
|
11028
|
+
clientId?: string | undefined;
|
|
11029
|
+
clientSecret?: string | undefined;
|
|
11030
|
+
};
|
|
11031
|
+
baseUrl?: string | undefined;
|
|
11032
|
+
privateTo?: string | undefined;
|
|
11033
|
+
};
|
|
11034
|
+
```
|
|
11035
|
+
|
|
11036
|
+
Refers to: [`ActorId`](#core-actorid), [`ConnectKey`](#core-connectkey).
|
|
11037
|
+
|
|
10840
11038
|
#### `InstanceConnects`
|
|
10841
11039
|
|
|
10842
11040
|
interface · `import { InstanceConnects } from '@harness/sdk'`
|
|
@@ -10865,7 +11063,7 @@ How people connect to an instance, for `ctx.instanceConnect`: OAuth (shared thro
|
|
|
10865
11063
|
function instanceConnectOf(label: string, auth: RemoteAuth): z.input<typeof InstanceConnect>;
|
|
10866
11064
|
```
|
|
10867
11065
|
|
|
10868
|
-
Refers to: [`InstanceConnect`](#core-instanceconnect)
|
|
11066
|
+
Refers to: [`InstanceConnect`](#core-instanceconnect).
|
|
10869
11067
|
|
|
10870
11068
|
#### `keyConnectOf`
|
|
10871
11069
|
|
|
@@ -10879,7 +11077,7 @@ token or headers as one admin's form, shared with everyone; OAuth as `instanceCo
|
|
|
10879
11077
|
function keyConnectOf(label: string, auth: RemoteAuth): z.input<typeof InstanceConnect>;
|
|
10880
11078
|
```
|
|
10881
11079
|
|
|
10882
|
-
Refers to: [`InstanceConnect`](#core-instanceconnect)
|
|
11080
|
+
Refers to: [`InstanceConnect`](#core-instanceconnect).
|
|
10883
11081
|
|
|
10884
11082
|
#### `connectForm`
|
|
10885
11083
|
|
|
@@ -10891,8 +11089,6 @@ The form to connect with a typed token or header values (`FormFor`); `undefined`
|
|
|
10891
11089
|
function connectForm(auth: RemoteAuth, who?: FormFor): GinType<Record<string, string>> | undefined;
|
|
10892
11090
|
```
|
|
10893
11091
|
|
|
10894
|
-
Refers to: [`RemoteAuth`](#core-remoteauth).
|
|
10895
|
-
|
|
10896
11092
|
#### `FormFor`
|
|
10897
11093
|
|
|
10898
11094
|
type · `import { FormFor } from '@harness/sdk'`
|
|
@@ -10914,8 +11110,6 @@ Whether calls use a person's connection (their own, or the one an admin shares)
|
|
|
10914
11110
|
function usesConnections(auth: RemoteAuth): boolean;
|
|
10915
11111
|
```
|
|
10916
11112
|
|
|
10917
|
-
Refers to: [`RemoteAuth`](#core-remoteauth).
|
|
10918
|
-
|
|
10919
11113
|
#### `credentialsFromForm`
|
|
10920
11114
|
|
|
10921
11115
|
function · `import { credentialsFromForm } from '@harness/sdk'`
|
|
@@ -10926,7 +11120,7 @@ The credentials a filled connect form makes, or what is wrong with it.
|
|
|
10926
11120
|
function credentialsFromForm(auth: RemoteAuth, form: Json, who?: FormFor): { readonly credentials: RemoteCredentials; } | { readonly problem: string; };
|
|
10927
11121
|
```
|
|
10928
11122
|
|
|
10929
|
-
Refers to: [`Json`](#core-json)
|
|
11123
|
+
Refers to: [`Json`](#core-json).
|
|
10930
11124
|
|
|
10931
11125
|
#### `readCredentials`
|
|
10932
11126
|
|
|
@@ -10938,7 +11132,7 @@ A connection's credentials, read; `undefined` when they aren't `RemoteCredential
|
|
|
10938
11132
|
function readCredentials(value: Json): RemoteCredentials | undefined;
|
|
10939
11133
|
```
|
|
10940
11134
|
|
|
10941
|
-
Refers to: [`Json`](#core-json)
|
|
11135
|
+
Refers to: [`Json`](#core-json).
|
|
10942
11136
|
|
|
10943
11137
|
#### `credentialHeaders`
|
|
10944
11138
|
|
|
@@ -10950,8 +11144,6 @@ The headers a person's credentials send.
|
|
|
10950
11144
|
function credentialHeaders(credentials: RemoteCredentials): Record<string, string>;
|
|
10951
11145
|
```
|
|
10952
11146
|
|
|
10953
|
-
Refers to: [`RemoteCredentials`](#core-remotecredentials).
|
|
10954
|
-
|
|
10955
11147
|
#### `sharedHeaders`
|
|
10956
11148
|
|
|
10957
11149
|
function · `import { sharedHeaders } from '@harness/sdk'`
|
|
@@ -10962,8 +11154,6 @@ The headers the instance's own config sends: a shared token or shared header val
|
|
|
10962
11154
|
function sharedHeaders(auth: RemoteAuth): Record<string, string>;
|
|
10963
11155
|
```
|
|
10964
11156
|
|
|
10965
|
-
Refers to: [`RemoteAuth`](#core-remoteauth).
|
|
10966
|
-
|
|
10967
11157
|
#### `accountLabel`
|
|
10968
11158
|
|
|
10969
11159
|
function · `import { accountLabel } from '@harness/sdk'`
|
|
@@ -10974,8 +11164,6 @@ A short label for an account connected with a token or headers ("Token ending 4f
|
|
|
10974
11164
|
function accountLabel(credentials: RemoteCredentials): string;
|
|
10975
11165
|
```
|
|
10976
11166
|
|
|
10977
|
-
Refers to: [`RemoteCredentials`](#core-remotecredentials).
|
|
10978
|
-
|
|
10979
11167
|
#### `secretHeaderNames`
|
|
10980
11168
|
|
|
10981
11169
|
function · `import { secretHeaderNames } from '@harness/sdk'`
|
|
@@ -10987,8 +11175,6 @@ key headers. Compare in lower case.
|
|
|
10987
11175
|
function secretHeaderNames(auth: RemoteAuth): ReadonlySet<string>;
|
|
10988
11176
|
```
|
|
10989
11177
|
|
|
10990
|
-
Refers to: [`RemoteAuth`](#core-remoteauth).
|
|
10991
|
-
|
|
10992
11178
|
#### `maskHeaders`
|
|
10993
11179
|
|
|
10994
11180
|
function · `import { maskHeaders } from '@harness/sdk'`
|
|
@@ -11108,8 +11294,10 @@ starts a new run of one of the system's fns in the renderer's session, as a pers
|
|
|
11108
11294
|
|
|
11109
11295
|
**Results.** A result renderer draws only what a finished run gave, under the chat's own run line (its status, cost and
|
|
11110
11296
|
args stay the chat's); a fn renderer, which draws the whole run as it goes, wins over it. It may draw with the app's
|
|
11111
|
-
result view, `inject(RESULT_VIEW)` (`ResultViewProps`: a result table or a
|
|
11112
|
-
and row actions; `keepLook` lets Settings keep the look picked there
|
|
11297
|
+
result view, `inject(RESULT_VIEW)` (`ResultViewProps`: a result table or a shown result, core's `ShownResult`, with its
|
|
11298
|
+
visuals, pager, drill and row actions; `keepLook` lets Settings keep the look picked there; its `controls` slot,
|
|
11299
|
+
`ResultControls`, is where the renderer draws its own controls and runs the result again with other args, as the
|
|
11300
|
+
widgets system's chips do; `client({ resultItems })` adds an item to plain result tables' menus), and with the app's controls,
|
|
11113
11301
|
`inject(APP_COMPONENTS)` (the same `SharedComponents` a page has as `host.components`). In a chat, `inject(CHAT_HOST)` asks the agent
|
|
11114
11302
|
(`ask(text, send)`), waits for a run the renderer started to end (`settled(run)` gives a `RunOutcome`) and moves the app
|
|
11115
11303
|
(`navigate(path)`). The widgets system draws a `make_widget` proposal's card with Save this way, and a saved widget's
|
|
@@ -11150,16 +11338,32 @@ Each must be listed in the contract's `contributes` with a declared shape (`visu
|
|
|
11150
11338
|
the shape alone judges and ranks a fit, the same in the hub, the widget agent and the browser. `veto(table, facts)` may
|
|
11151
11339
|
only take a fit away, with a reason; keep it cheap and pure. The chat's runtime lists the visuals a result may use
|
|
11152
11340
|
(`visuals(registry, table, facts)`, in load order), leaving out a vetoed one and one whose veto throws; the result view
|
|
11153
|
-
ranks them with the built-in
|
|
11341
|
+
ranks them with the built-in table and value cards (every chart, the widgets system's included, comes this way). How to
|
|
11342
|
+
draw one with ECharts is in **Visuals and widgets**.
|
|
11154
11343
|
|
|
11155
11344
|
**Pages.** A system can add whole pages to the app, each at `/s/<system>/<segment>`. Declare each in the contract's
|
|
11156
11345
|
`pages` (`segment`, `title`, `description?`, `icon?`, `nav`: `main` puts it in the sidebar, `hidden` leaves it for links
|
|
11157
|
-
such as one item's page; `access`: `everyone` or `admin`; and `component`), and give
|
|
11346
|
+
such as one item's page; `access`: `everyone` or `admin`; `area`: `app`, the default, or `admin`; and `component`), and give
|
|
11347
|
+
the component in
|
|
11158
11348
|
`client(contract, { pages: { NotesPage } })`. `client()` throws when a declared page has no component, or a component
|
|
11159
11349
|
no page names. The hub lists a page while its system is installed and live with its renderers on (an admin reviews and
|
|
11160
11350
|
can switch off each page like any component), so the page and its sidebar entry appear and disappear with the system;
|
|
11161
11351
|
an old link to a page whose system is gone keeps its URL and says the system isn't installed.
|
|
11162
11352
|
|
|
11353
|
+
**Admin pages.** A page with `area: 'admin'` is drawn inside the admin area, at `/admin/s/<system>/<segment>`, for admins
|
|
11354
|
+
only (whatever `access` says), and a `main` one joins the admin nav's Systems group while the system is live. The mcp
|
|
11355
|
+
system's MCP servers page (`/admin/s/mcp/servers`) and the api system's API services page (`/admin/s/api/services`) are
|
|
11356
|
+
drawn this way: one page each, the list at its root and one item under it (`servers/<instance>/<tab>`). Beside the
|
|
11357
|
+
host, the app provides `AppParts` (`inject(APP_PARTS)`): the admin pages' own parts (`Tabs`, `Segmented`, `Switch`,
|
|
11358
|
+
`ChipInput`, `IconButton`, `Card`, `FnList`, `Facts`, `Confirm`), `href(place)` / `go(place)` to the app's own places
|
|
11359
|
+
(`AppPlace`: a fn's page, an instance, a connections page, the resource browser under a root, a context item) and
|
|
11360
|
+
`bytes(count)`. `@harness/sdk/client-ui` holds what such pages share, bundled into each client build: `useParts()` (the
|
|
11361
|
+
host's components and the admin parts together), `useAppParts()`, `usePageHost()`, `plainClick`, the state helpers
|
|
11362
|
+
(`Loaded`, `Task`, `problemText`, `checkPaths`, `draftFields`), and for a remote service's forms the sign-in draft and
|
|
11363
|
+
kept secrets (`authDraft`, `authCandidate`, `checkConfig`, `withoutKept`) with `RemoteAuthFields`, `PairRowsEditor`,
|
|
11364
|
+
`InstanceNameField`, `AddServiceDialog` and `ServiceRows`. Its tests use `@harness/sdk/client-ui/testing` (`fakeHub`,
|
|
11365
|
+
`fakeHost`: mount with `global: { provide: made.provide }`).
|
|
11366
|
+
|
|
11163
11367
|
_From `scripts/docs/example/shared/index.ts`:_
|
|
11164
11368
|
|
|
11165
11369
|
```ts
|
|
@@ -11304,6 +11508,8 @@ interface ClientRenderers<C extends ContractShape> {
|
|
|
11304
11508
|
* the contract's `contributes`, which is how the hub and the web app know to load this bundle for that registry.
|
|
11305
11509
|
*/
|
|
11306
11510
|
visuals?: Readonly<Record<QualifiedName, Readonly<Record<string, VisualEntry<C>>>>>;
|
|
11511
|
+
/** Items this system adds to plain result tables' 3-dot menus, by name (`ResultItemEntry`: the widgets system's "Make a widget"). */
|
|
11512
|
+
resultItems?: Readonly<Record<string, ResultItemEntry>>;
|
|
11307
11513
|
/**
|
|
11308
11514
|
* Config components by name. The one the contract's `configComponent` names is drawn for the system's config; it must
|
|
11309
11515
|
* be here, and every component here must be the one named.
|
|
@@ -11939,10 +12145,11 @@ const APP_COMPONENTS: InjectionKey<SharedComponents>;
|
|
|
11939
12145
|
|
|
11940
12146
|
interface · `import { ResultViewProps } from '@harness/sdk'`
|
|
11941
12147
|
|
|
11942
|
-
The props of the app's result view, as a renderer binds them: a result table, or a
|
|
11943
|
-
fitting visual, its
|
|
11944
|
-
without, it draws only what it has (a preview). `keepLook`
|
|
11945
|
-
true when it was kept (or asked for).
|
|
12148
|
+
The props of the app's result view, as a renderer binds them: a result table, or a shown result (core's
|
|
12149
|
+
`ShownResult`, such as a widget's run), drawn with every fitting visual, its pager, drill and row actions. With `fn`,
|
|
12150
|
+
it reads that fn again (other args, pager, refresh); without, it draws only what it has (a preview). `keepLook`
|
|
12151
|
+
offers keeping the look picked in Settings; it resolves true when it was kept (or asked for). Its `controls` slot
|
|
12152
|
+
(slot props `ResultControls`) is where a system draws its own controls above the rows (the widgets system's chips).
|
|
11946
12153
|
|
|
11947
12154
|
```ts
|
|
11948
12155
|
interface ResultViewProps {
|
|
@@ -11971,6 +12178,61 @@ interface ResultLook {
|
|
|
11971
12178
|
}
|
|
11972
12179
|
```
|
|
11973
12180
|
|
|
12181
|
+
#### `ResultControls`
|
|
12182
|
+
|
|
12183
|
+
interface · `import { ResultControls } from '@harness/sdk'`
|
|
12184
|
+
|
|
12185
|
+
What the result view's `controls` slot gives a system's controls (the widgets system's chip row): the output the
|
|
12186
|
+
level shown was read from (to read the system's own fields), the args it ran with, whether it is reading, whether it
|
|
12187
|
+
can be run again, and `run`, which runs it again with other args (resolving whether that worked).
|
|
12188
|
+
|
|
12189
|
+
```ts
|
|
12190
|
+
interface ResultControls {
|
|
12191
|
+
readonly value: Json | undefined;
|
|
12192
|
+
readonly args: Readonly<Record<string, Json>>;
|
|
12193
|
+
readonly busy: boolean;
|
|
12194
|
+
readonly editable: boolean;
|
|
12195
|
+
run(args: Readonly<Record<string, Json>>): Promise<boolean>;
|
|
12196
|
+
}
|
|
12197
|
+
```
|
|
12198
|
+
|
|
12199
|
+
Refers to: [`Json`](#core-json).
|
|
12200
|
+
|
|
12201
|
+
#### `ResultItemView`
|
|
12202
|
+
|
|
12203
|
+
interface · `import { ResultItemView } from '@harness/sdk'`
|
|
12204
|
+
|
|
12205
|
+
The result a system's result item is offered on: the fn that returned it, its args and its rows.
|
|
12206
|
+
|
|
12207
|
+
```ts
|
|
12208
|
+
interface ResultItemView {
|
|
12209
|
+
readonly fn: QualifiedName;
|
|
12210
|
+
readonly args: Json | undefined;
|
|
12211
|
+
readonly table: ResultTable;
|
|
12212
|
+
/** The rows came from a write. */
|
|
12213
|
+
readonly readOnly: boolean;
|
|
12214
|
+
}
|
|
12215
|
+
```
|
|
12216
|
+
|
|
12217
|
+
Refers to: [`Json`](#core-json), [`QualifiedName`](#core-qualifiedname), [`ResultTable`](#core-resulttable).
|
|
12218
|
+
|
|
12219
|
+
#### `ResultItemEntry`
|
|
12220
|
+
|
|
12221
|
+
interface · `import { ResultItemEntry } from '@harness/sdk'`
|
|
12222
|
+
|
|
12223
|
+
An item a system adds to the 3-dot menu of plain result tables (`client({ resultItems })`; the widgets system's
|
|
12224
|
+
"Make a widget"): its words and icon, whether a result offers it, and what it does, with a way to ask the agent
|
|
12225
|
+
(`ask(text, send)`, absent where no agent is open).
|
|
12226
|
+
|
|
12227
|
+
```ts
|
|
12228
|
+
interface ResultItemEntry {
|
|
12229
|
+
readonly label: string;
|
|
12230
|
+
readonly icon?: string;
|
|
12231
|
+
offered(view: ResultItemView): boolean;
|
|
12232
|
+
run(view: ResultItemView, ask: (text: string, send: boolean) => Promise<boolean>): Promise<void>;
|
|
12233
|
+
}
|
|
12234
|
+
```
|
|
12235
|
+
|
|
11974
12236
|
#### `CHAT_HOST`
|
|
11975
12237
|
|
|
11976
12238
|
const · `import { CHAT_HOST } from '@harness/sdk'`
|
|
@@ -12196,6 +12458,10 @@ interface SharedComponents {
|
|
|
12196
12458
|
readonly Select: Component<SelectProps>;
|
|
12197
12459
|
readonly Textarea: Component<TextareaProps>;
|
|
12198
12460
|
readonly Dialog: Component<DialogProps>;
|
|
12461
|
+
/** A panel beside an element (a widget chip's editor). */
|
|
12462
|
+
readonly Popover: Component<PopoverProps>;
|
|
12463
|
+
/** A form for a gin type, with its submit and cancel. */
|
|
12464
|
+
readonly Form: Component<FormProps>;
|
|
12199
12465
|
readonly Banner: Component<BannerProps>;
|
|
12200
12466
|
readonly Badge: Component<BadgeProps>;
|
|
12201
12467
|
readonly Skeleton: Component<SkeletonProps>;
|
|
@@ -12272,10 +12538,10 @@ interface FrameProps { title: string; description?: string; width?: 'readable' |
|
|
|
12272
12538
|
|
|
12273
12539
|
interface · `import { InputProps } from '@harness/sdk'`
|
|
12274
12540
|
|
|
12275
|
-
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.
|
|
12541
|
+
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.
|
|
12276
12542
|
|
|
12277
12543
|
```ts
|
|
12278
|
-
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' }
|
|
12544
|
+
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 }
|
|
12279
12545
|
```
|
|
12280
12546
|
|
|
12281
12547
|
#### `MarkdownProps`
|
|
@@ -12507,6 +12773,28 @@ Props of the app's dialog (`v-model:open`); slots: the body, and `footer` for it
|
|
|
12507
12773
|
interface DialogProps { open: boolean; title: string; description?: string; width?: string }
|
|
12508
12774
|
```
|
|
12509
12775
|
|
|
12776
|
+
#### `PopoverProps`
|
|
12777
|
+
|
|
12778
|
+
interface · `import { PopoverProps } from '@harness/sdk'`
|
|
12779
|
+
|
|
12780
|
+
Props of the app's popover (`v-model:open`), placed beside `anchor`; its slot is the panel's content.
|
|
12781
|
+
|
|
12782
|
+
```ts
|
|
12783
|
+
interface PopoverProps { open: boolean; anchor: HTMLElement | null | undefined; label?: string | undefined; role?: 'dialog' | 'menu' | 'listbox' }
|
|
12784
|
+
```
|
|
12785
|
+
|
|
12786
|
+
#### `FormProps`
|
|
12787
|
+
|
|
12788
|
+
interface · `import { FormProps } from '@harness/sdk'`
|
|
12789
|
+
|
|
12790
|
+
Props of the app's form for a gin type (`type`, a type definition), emitting `submit` with the value and `cancel`.
|
|
12791
|
+
|
|
12792
|
+
```ts
|
|
12793
|
+
interface FormProps { type: unknown; initial?: Json | undefined; submitLabel?: string; label?: string; cancellable?: boolean }
|
|
12794
|
+
```
|
|
12795
|
+
|
|
12796
|
+
Refers to: [`Json`](#core-json).
|
|
12797
|
+
|
|
12510
12798
|
#### `BannerProps`
|
|
12511
12799
|
|
|
12512
12800
|
interface · `import { BannerProps } from '@harness/sdk'`
|
|
@@ -12631,112 +12919,325 @@ the menu beside it (or a long press, or a right-click) opens the run-control pan
|
|
|
12631
12919
|
interface ComposerProps { modelValue: string; placeholder?: string; sending?: boolean; running?: boolean; stopping?: boolean; disabled?: boolean; note?: string }
|
|
12632
12920
|
```
|
|
12633
12921
|
|
|
12634
|
-
#### `
|
|
12922
|
+
#### `APP_PARTS`
|
|
12635
12923
|
|
|
12636
|
-
|
|
12924
|
+
const · `import { APP_PARTS } from '@harness/sdk'`
|
|
12637
12925
|
|
|
12638
|
-
|
|
12639
|
-
URIs (the resource viewer opens them). Refuses `javascript:`, `data:`, `vbscript:`, protocol-relative URLs and any
|
|
12640
|
-
URL with whitespace or control characters inside. Show a refused URL as plain text, never as a link.
|
|
12926
|
+
Where the app provides `AppParts` under a system page.
|
|
12641
12927
|
|
|
12642
12928
|
```ts
|
|
12643
|
-
|
|
12929
|
+
const APP_PARTS: InjectionKey<AppParts>;
|
|
12644
12930
|
```
|
|
12645
12931
|
|
|
12646
|
-
#### `
|
|
12932
|
+
#### `AppParts`
|
|
12647
12933
|
|
|
12648
|
-
|
|
12934
|
+
interface · `import { AppParts } from '@harness/sdk'`
|
|
12649
12935
|
|
|
12650
|
-
|
|
12651
|
-
scheme, then `://`; never one a browser would run or load as a page. The chat opens these in its resource viewer.
|
|
12936
|
+
What the app gives a system page beside its host: its admin parts, links to its own places, and sizes in words.
|
|
12652
12937
|
|
|
12653
12938
|
```ts
|
|
12654
|
-
|
|
12939
|
+
interface AppParts {
|
|
12940
|
+
readonly components: AppPartComponents;
|
|
12941
|
+
/** The URL of one of the app's own places, for an `<a href>`. */
|
|
12942
|
+
href(to: AppPlace): string;
|
|
12943
|
+
/** Go to one of the app's own places. */
|
|
12944
|
+
go(to: AppPlace): void;
|
|
12945
|
+
/** A size, as the app writes file sizes ("512 B", "2.0 MB"). */
|
|
12946
|
+
bytes(count: number): string;
|
|
12947
|
+
}
|
|
12655
12948
|
```
|
|
12656
12949
|
|
|
12657
|
-
#### `
|
|
12950
|
+
#### `AppPartComponents`
|
|
12658
12951
|
|
|
12659
|
-
|
|
12952
|
+
interface · `import { AppPartComponents } from '@harness/sdk'`
|
|
12660
12953
|
|
|
12661
|
-
|
|
12662
|
-
(another site).
|
|
12954
|
+
The app's form and admin parts, as `AppParts.components`.
|
|
12663
12955
|
|
|
12664
12956
|
```ts
|
|
12665
|
-
|
|
12957
|
+
interface AppPartComponents {
|
|
12958
|
+
readonly Tabs: Component<TabsProps>;
|
|
12959
|
+
readonly Segmented: Component<SegmentedProps>;
|
|
12960
|
+
readonly Switch: Component<SwitchProps>;
|
|
12961
|
+
readonly ChipInput: Component<ChipInputProps>;
|
|
12962
|
+
readonly IconButton: Component<IconButtonProps>;
|
|
12963
|
+
readonly Card: Component<CardProps>;
|
|
12964
|
+
/** The admin pages' list of fns (a system's, an instance's), each opening the fn modal and its runs. */
|
|
12965
|
+
readonly FnList: Component<FnListProps>;
|
|
12966
|
+
/** Facts as label and value pairs (a service's URL, sign-in, limits). */
|
|
12967
|
+
readonly Facts: Component<FactsProps>;
|
|
12968
|
+
/** The ask before something that can't be taken back. */
|
|
12969
|
+
readonly Confirm: Component<ConfirmProps>;
|
|
12970
|
+
}
|
|
12666
12971
|
```
|
|
12667
12972
|
|
|
12668
|
-
|
|
12973
|
+
#### `AppPlace`
|
|
12669
12974
|
|
|
12670
|
-
|
|
12671
|
-
view, which offers every **visual** that can draw it: a table, value cards and twelve chart families (part of a whole,
|
|
12672
|
-
categories, over time, distribution, cross-tab, calendar, timeline, network, hierarchy, gauge, finance), each with a
|
|
12673
|
-
style picker, plus any visual a system adds. A **widget** is a saved view of such a fn, kept by the bundled widgets
|
|
12674
|
-
system: the visuals to switch between, a plan per argument, presets, the actions on each row and what a click opens.
|
|
12975
|
+
type · `import { AppPlace } from '@harness/sdk'`
|
|
12675
12976
|
|
|
12676
|
-
|
|
12677
|
-
|
|
12678
|
-
`measure`), how many rows it draws, whether it only tells the truth about a whole result (`whole`: a pie of one page
|
|
12679
|
-
lies), rules over the values (`distinct`, `non-negative`, `bounded`, `distinct-columns`, `links`), how it stays honest
|
|
12680
|
-
when the result is bigger (`size`), its styles, the args it drives (`claims`: a time axis sets a range) and its
|
|
12681
|
-
priority. Column facts come from the source and the rows: a source may declare a column's `role` (the database knows a
|
|
12682
|
-
GROUP BY key from an aggregate) and `key`; `resultFacts(table)` works out the rest (numeric, temporal, opaque ids that
|
|
12683
|
-
are never drawn, distinct counts, ranges) and adds the column's gin facts (an enum's members, a number's range,
|
|
12684
|
-
`ginTypeFacts`). Visuals are ranked in one order everywhere (`rankedVisuals`): the most columns drawn first, then
|
|
12685
|
-
priority, then registry order. A visual that can't draw the data is not offered.
|
|
12977
|
+
One of the app's own places a page links to (`AppParts.href`, `AppParts.go`): a fn's admin page, an instance's admin
|
|
12978
|
+
page, a system's connections page, the resource browser under a root, or a context item.
|
|
12686
12979
|
|
|
12687
|
-
|
|
12688
|
-
|
|
12689
|
-
|
|
12690
|
-
|
|
12691
|
-
|
|
12692
|
-
|
|
12693
|
-
|
|
12694
|
-
|
|
12695
|
-
beside the component may refuse a fit the shape allows. Test that it is offered for its data with `kit.visuals(table)`.
|
|
12980
|
+
```ts
|
|
12981
|
+
type AppPlace =
|
|
12982
|
+
| { readonly fn: QualifiedName }
|
|
12983
|
+
| { readonly instance: { readonly system: string; readonly instance: string } }
|
|
12984
|
+
| { readonly connect: string }
|
|
12985
|
+
| { readonly resources: { readonly under: string } }
|
|
12986
|
+
| { readonly context: QualifiedName };
|
|
12987
|
+
```
|
|
12696
12988
|
|
|
12697
|
-
|
|
12989
|
+
Refers to: [`QualifiedName`](#core-qualifiedname).
|
|
12990
|
+
|
|
12991
|
+
#### `TabChoice`
|
|
12992
|
+
|
|
12993
|
+
interface · `import { TabChoice } from '@harness/sdk'`
|
|
12994
|
+
|
|
12995
|
+
One tab of the app's tabs: its value, its words, and a count after them (hidden when 0).
|
|
12698
12996
|
|
|
12699
12997
|
```ts
|
|
12700
|
-
|
|
12701
|
-
|
|
12702
|
-
|
|
12703
|
-
|
|
12704
|
-
|
|
12705
|
-
label: 'Against target',
|
|
12706
|
-
icon: 'chart',
|
|
12707
|
-
shape: {
|
|
12708
|
-
channels: [
|
|
12709
|
-
channel('x', 'Category', ['text'], { role: 'group' }),
|
|
12710
|
-
channel('value', 'Value', ['integer', 'number'], { role: 'measure' }),
|
|
12711
|
-
channel('target', 'Target', ['integer', 'number'], { role: 'measure' }),
|
|
12712
|
-
],
|
|
12713
|
-
// a phone-width axis holds a few dozen categories; past that the widget pages
|
|
12714
|
-
rows: { min: 1, max: 30 },
|
|
12715
|
-
whole: false,
|
|
12716
|
-
styles: [{ name: 'vertical', label: 'Vertical' }, { name: 'horizontal', label: 'Horizontal' }],
|
|
12717
|
-
// it binds three columns where bars bind two, so it ranks above them for data with a target
|
|
12718
|
-
priority: { band: 'encoded', terms: ['low-cardinality'] },
|
|
12719
|
-
},
|
|
12720
|
-
})],
|
|
12721
|
-
});
|
|
12998
|
+
interface TabChoice {
|
|
12999
|
+
readonly value: string;
|
|
13000
|
+
readonly label: string;
|
|
13001
|
+
readonly count?: number;
|
|
13002
|
+
}
|
|
12722
13003
|
```
|
|
12723
13004
|
|
|
12724
|
-
|
|
13005
|
+
#### `TabsProps`
|
|
13006
|
+
|
|
13007
|
+
type · `import { TabsProps } from '@harness/sdk'`
|
|
13008
|
+
|
|
13009
|
+
Props of the app's tabs (`v-model` is the chosen tab's value); the page binds it to its URL (`host.query.bind`).
|
|
12725
13010
|
|
|
12726
13011
|
```ts
|
|
12727
|
-
|
|
12728
|
-
|
|
13012
|
+
type TabsProps = { modelValue: string; tabs: readonly TabChoice[]; label: string };
|
|
13013
|
+
```
|
|
12729
13014
|
|
|
12730
|
-
|
|
13015
|
+
#### `SegmentChoice`
|
|
12731
13016
|
|
|
12732
|
-
|
|
12733
|
-
function cellOf(value: Json): string | number | null {
|
|
12734
|
-
return value === null || typeof value === 'number' || typeof value === 'string' ? value : JSON.stringify(value);
|
|
12735
|
-
}
|
|
13017
|
+
interface · `import { SegmentChoice } from '@harness/sdk'`
|
|
12736
13018
|
|
|
12737
|
-
|
|
12738
|
-
|
|
12739
|
-
|
|
13019
|
+
One choice of the app's segmented control.
|
|
13020
|
+
|
|
13021
|
+
```ts
|
|
13022
|
+
interface SegmentChoice {
|
|
13023
|
+
readonly value: string;
|
|
13024
|
+
readonly label: string;
|
|
13025
|
+
}
|
|
13026
|
+
```
|
|
13027
|
+
|
|
13028
|
+
#### `SegmentedProps`
|
|
13029
|
+
|
|
13030
|
+
type · `import { SegmentedProps } from '@harness/sdk'`
|
|
13031
|
+
|
|
13032
|
+
Props of the app's segmented control: a few choices side by side (`v-model` is the chosen value).
|
|
13033
|
+
|
|
13034
|
+
```ts
|
|
13035
|
+
type SegmentedProps = { modelValue: string; options: readonly SegmentChoice[]; label: string };
|
|
13036
|
+
```
|
|
13037
|
+
|
|
13038
|
+
#### `SwitchProps`
|
|
13039
|
+
|
|
13040
|
+
interface · `import { SwitchProps } from '@harness/sdk'`
|
|
13041
|
+
|
|
13042
|
+
Props of the app's on/off switch (`v-model`), its label and a line about it.
|
|
13043
|
+
|
|
13044
|
+
```ts
|
|
13045
|
+
interface SwitchProps { modelValue: boolean; label: string; description?: string; disabled?: boolean; hideLabel?: boolean }
|
|
13046
|
+
```
|
|
13047
|
+
|
|
13048
|
+
#### `ChipInputProps`
|
|
13049
|
+
|
|
13050
|
+
type · `import { ChipInputProps } from '@harness/sdk'`
|
|
13051
|
+
|
|
13052
|
+
Props of the app's chip input: a short list of words typed into one box (`v-model`), each a removable chip; Enter
|
|
13053
|
+
or a comma adds what `read` accepts, else `refusal` shows.
|
|
13054
|
+
|
|
13055
|
+
```ts
|
|
13056
|
+
type ChipInputProps = { modelValue: readonly string[]; label: string; placeholder?: string; hint?: string; read: (text: string) => string | undefined; refusal?: string; testid?: string };
|
|
13057
|
+
```
|
|
13058
|
+
|
|
13059
|
+
#### `IconButtonProps`
|
|
13060
|
+
|
|
13061
|
+
interface · `import { IconButtonProps } from '@harness/sdk'`
|
|
13062
|
+
|
|
13063
|
+
Props of the app's icon-only button (`@click`); `label` is its name and tooltip, `icon` from the app's icon set.
|
|
13064
|
+
|
|
13065
|
+
```ts
|
|
13066
|
+
interface IconButtonProps { icon: string; label: string; size?: 'sm' | 'md'; disabled?: boolean }
|
|
13067
|
+
```
|
|
13068
|
+
|
|
13069
|
+
#### `CardProps`
|
|
13070
|
+
|
|
13071
|
+
interface · `import { CardProps } from '@harness/sdk'`
|
|
13072
|
+
|
|
13073
|
+
Props of the app's card: a surface with an optional title and subtitle (slots: the body, `actions`, `footer`).
|
|
13074
|
+
|
|
13075
|
+
```ts
|
|
13076
|
+
interface CardProps { title?: string; subtitle?: string; interactive?: boolean; compact?: boolean; flat?: boolean; flush?: boolean }
|
|
13077
|
+
```
|
|
13078
|
+
|
|
13079
|
+
#### `FnListProps`
|
|
13080
|
+
|
|
13081
|
+
interface · `import { FnListProps } from '@harness/sdk'`
|
|
13082
|
+
|
|
13083
|
+
Props of the app's list of fns, as a system's admin page shows them: what each does, its version, whether it can be
|
|
13084
|
+
used now, its tags and how its runs have gone; its name opens the app's fn modal and its numbers its runs.
|
|
13085
|
+
|
|
13086
|
+
```ts
|
|
13087
|
+
interface FnListProps { fns: readonly FnRecord[] }
|
|
13088
|
+
```
|
|
13089
|
+
|
|
13090
|
+
Refers to: [`FnRecord`](#core-fnrecord).
|
|
13091
|
+
|
|
13092
|
+
#### `FactItem`
|
|
13093
|
+
|
|
13094
|
+
interface · `import { FactItem } from '@harness/sdk'`
|
|
13095
|
+
|
|
13096
|
+
One fact as a label and value (a URL, a sign-in, a limit); a value that is code is drawn as code, `title` on hover.
|
|
13097
|
+
|
|
13098
|
+
```ts
|
|
13099
|
+
interface FactItem {
|
|
13100
|
+
readonly label: string;
|
|
13101
|
+
readonly value: string;
|
|
13102
|
+
readonly title?: string | undefined;
|
|
13103
|
+
readonly code?: boolean | undefined;
|
|
13104
|
+
}
|
|
13105
|
+
```
|
|
13106
|
+
|
|
13107
|
+
#### `FactsProps`
|
|
13108
|
+
|
|
13109
|
+
interface · `import { FactsProps } from '@harness/sdk'`
|
|
13110
|
+
|
|
13111
|
+
Props of the admin pages' facts: label and value pairs in two columns.
|
|
13112
|
+
|
|
13113
|
+
```ts
|
|
13114
|
+
interface FactsProps { facts: readonly FactItem[]; testid: string }
|
|
13115
|
+
```
|
|
13116
|
+
|
|
13117
|
+
#### `ConfirmProps`
|
|
13118
|
+
|
|
13119
|
+
interface · `import { ConfirmProps } from '@harness/sdk'`
|
|
13120
|
+
|
|
13121
|
+
Props of the app's ask before something that can't be taken back (`v-model:open`, `@confirm`): what happens, and its button.
|
|
13122
|
+
|
|
13123
|
+
```ts
|
|
13124
|
+
interface ConfirmProps { open: boolean; title: string; body: string; confirm: string; busy?: boolean; danger?: boolean }
|
|
13125
|
+
```
|
|
13126
|
+
|
|
13127
|
+
#### `safeHref`
|
|
13128
|
+
|
|
13129
|
+
function · `import { safeHref } from '@harness/sdk'`
|
|
13130
|
+
|
|
13131
|
+
The URL if a link may go there, else `undefined`: http and https (`HttpUrl`), mail, places in the app, and resource
|
|
13132
|
+
URIs (the resource viewer opens them). Refuses `javascript:`, `data:`, `vbscript:`, protocol-relative URLs and any
|
|
13133
|
+
URL with whitespace or control characters inside. Show a refused URL as plain text, never as a link.
|
|
13134
|
+
|
|
13135
|
+
```ts
|
|
13136
|
+
function safeHref(url: string | undefined | null): string | undefined;
|
|
13137
|
+
```
|
|
13138
|
+
|
|
13139
|
+
#### `RESOURCE_LINK`
|
|
13140
|
+
|
|
13141
|
+
const · `import { RESOURCE_LINK } from '@harness/sdk'`
|
|
13142
|
+
|
|
13143
|
+
A resource URI a system serves (`fs://docs/a.md`, and `file:///C:/…`, which the fs system's resources are): a
|
|
13144
|
+
scheme, then `://`; never one a browser would run or load as a page. The chat opens these in its resource viewer.
|
|
13145
|
+
|
|
13146
|
+
```ts
|
|
13147
|
+
const RESOURCE_LINK: RegExp;
|
|
13148
|
+
```
|
|
13149
|
+
|
|
13150
|
+
#### `APP_PATH`
|
|
13151
|
+
|
|
13152
|
+
const · `import { APP_PATH } from '@harness/sdk'`
|
|
13153
|
+
|
|
13154
|
+
A place inside the app: a path or a relative path. Never `//host`, nor `/\host`, which browsers read as `//host`
|
|
13155
|
+
(another site).
|
|
13156
|
+
|
|
13157
|
+
```ts
|
|
13158
|
+
const APP_PATH: RegExp;
|
|
13159
|
+
```
|
|
13160
|
+
|
|
13161
|
+
## 28. Visuals and widgets
|
|
13162
|
+
|
|
13163
|
+
A fn that returns a `ResultTable` (a database query, `hub/records_table`, any fn of that shape) is drawn by the result
|
|
13164
|
+
view, which offers every **visual** that can draw it. The hub and the web app have only two of their own, the table and
|
|
13165
|
+
the value cards (`BUILT_IN_CONTRIBUTIONS`); every chart is a system's contribution to `hub/visuals`. The bundled
|
|
13166
|
+
widgets system contributes the chart families (part of a whole, bars, over time, distribution, cross-tab, calendar,
|
|
13167
|
+
timeline, network, hierarchy, gauge, candlestick, ranges, profiles, progress: about a hundred styles over every ECharts
|
|
13168
|
+
series but the map), each with a style picker, and draws them with the ECharts its client bundles; while it is not
|
|
13169
|
+
connected, a result is a table or value cards. Any other system may add its own the same way. A **widget** is a saved
|
|
13170
|
+
view of such a fn, kept by the widgets system: the visuals to switch between, a plan per argument, presets, the actions
|
|
13171
|
+
on each row and what a click opens.
|
|
13172
|
+
|
|
13173
|
+
**How a fit is judged.** Every visual declares the data it draws as a **shape**: its channels (`channel(name, label,
|
|
13174
|
+
kinds, { required, many, min, role })`: the column kinds each takes, and whether it wants a `group` key or a
|
|
13175
|
+
`measure`), how many rows it draws, whether it only tells the truth about a whole result (`whole`: a pie of one page
|
|
13176
|
+
lies), rules over the values (`distinct`, `non-negative`, `bounded`, `distinct-columns`, `links`), how it stays honest
|
|
13177
|
+
when the result is bigger (`size`), its styles, the args it drives (`claims`: a time axis sets a range) and its
|
|
13178
|
+
priority. A style may ask for more than its visual does: `needs` (channels bound), `columns` (how many columns a
|
|
13179
|
+
channel binds: a waterfall draws one measure and no series) and `rules` of its own (a radar needs three to sixteen
|
|
13180
|
+
categories); a style that can't draw the data is not in the picker (`styleProblems`). Column facts come from the source and the rows: a source may declare a column's `role` (the database knows a
|
|
13181
|
+
GROUP BY key from an aggregate) and `key`; `resultFacts(table)` works out the rest (numeric, temporal, opaque ids that
|
|
13182
|
+
are never drawn, distinct counts, ranges) and adds the column's gin facts (an enum's members, a number's range,
|
|
13183
|
+
`ginTypeFacts`). Visuals are ranked in one order everywhere (`rankedVisuals`): the most columns drawn first, then
|
|
13184
|
+
priority, then registry order. A visual that can't draw the data is not offered.
|
|
13185
|
+
|
|
13186
|
+
**Your own chart.** A system adds a visual by declaring it in `contributes` with `visual(...)` and drawing it in
|
|
13187
|
+
`client({ visuals: { [HUB_VISUALS]: { name: { component } } } })`, as the widgets system does for its charts. Draw it
|
|
13188
|
+
with ECharts: add `echarts` (an exact version) to the system's `package.json` and import only the charts and
|
|
13189
|
+
components it uses from `echarts/core`; the client build bundles it with the system (only `vue` and `@harness/sdk` are
|
|
13190
|
+
shared with the chat). The component gets `VisualView`: the `table`, its `facts`, the columns bound to each channel
|
|
13191
|
+
(`bind`, complete), the `style` picked, the theme's `palette` (`visualTheme(palette)` is an ECharts theme matching the
|
|
13192
|
+
widgets system's charts; draw again when the palette changes), the result's `title` and the page's row `opener`. It
|
|
13193
|
+
emits `drill(rowIndex)` when a bar, slice or point is clicked and `range({ from, to })` when the person zooms a time
|
|
13194
|
+
axis (`VISUAL_EMITS`). While it draws it may offer the result view's Export image: `inject(VISUAL_IMAGE)` and set a
|
|
13195
|
+
PNG/SVG exporter, cleared on unmount; `inject(VISUAL_DRILLABLE)` says whether a click drills. There is no SDK chart wrapper: use ECharts as it is documented. A `veto`
|
|
13196
|
+
beside the component may refuse a fit the shape allows. Test that it is offered for its data with `kit.visuals(table)`.
|
|
13197
|
+
|
|
13198
|
+
_From `scripts/docs/samples/charts.ts`:_
|
|
13199
|
+
|
|
13200
|
+
```ts
|
|
13201
|
+
/** The contract: the bullet chart, declared in `hub/visuals` with the data it draws. */
|
|
13202
|
+
export const charts = system('charts', {
|
|
13203
|
+
description: 'Charts for results.',
|
|
13204
|
+
contributes: [visual({
|
|
13205
|
+
name: 'bullet',
|
|
13206
|
+
label: 'Against target',
|
|
13207
|
+
icon: 'chart',
|
|
13208
|
+
shape: {
|
|
13209
|
+
channels: [
|
|
13210
|
+
channel('x', 'Category', ['text'], { role: 'group' }),
|
|
13211
|
+
channel('value', 'Value', ['integer', 'number'], { role: 'measure' }),
|
|
13212
|
+
channel('target', 'Target', ['integer', 'number'], { role: 'measure' }),
|
|
13213
|
+
],
|
|
13214
|
+
// a phone-width axis holds a few dozen categories; past that the widget pages
|
|
13215
|
+
rows: { min: 1, max: 30 },
|
|
13216
|
+
whole: false,
|
|
13217
|
+
styles: [{ name: 'vertical', label: 'Vertical' }, { name: 'horizontal', label: 'Horizontal' }],
|
|
13218
|
+
// it binds three columns where bars bind two, so it ranks above them for data with a target
|
|
13219
|
+
priority: { band: 'encoded', terms: ['low-cardinality'] },
|
|
13220
|
+
},
|
|
13221
|
+
})],
|
|
13222
|
+
});
|
|
13223
|
+
```
|
|
13224
|
+
|
|
13225
|
+
_From `scripts/docs/samples/charts.ts`:_
|
|
13226
|
+
|
|
13227
|
+
```ts
|
|
13228
|
+
// register only what this chart uses, so the bundle stays small
|
|
13229
|
+
use([BarChart, ScatterChart, DatasetComponent, GridComponent, TooltipComponent, CanvasRenderer]);
|
|
13230
|
+
|
|
13231
|
+
type Option = ComposeOption<BarSeriesOption | ScatterSeriesOption | DatasetComponentOption | GridComponentOption | TooltipComponentOption>;
|
|
13232
|
+
|
|
13233
|
+
/** A cell as ECharts reads one: numbers and text as they are, anything else as text. */
|
|
13234
|
+
function cellOf(value: Json): string | number | null {
|
|
13235
|
+
return value === null || typeof value === 'number' || typeof value === 'string' ? value : JSON.stringify(value);
|
|
13236
|
+
}
|
|
13237
|
+
|
|
13238
|
+
/** The bars and target marks of a view: the rows as a dataset, encoded by the bound columns. */
|
|
13239
|
+
function optionOf(view: VisualView): Option {
|
|
13240
|
+
const [x = '', value = '', target = ''] = [view.bind['x']?.[0], view.bind['value']?.[0], view.bind['target']?.[0]];
|
|
12740
13241
|
const across = view.style === 'horizontal';
|
|
12741
13242
|
const category = { type: 'category' as const };
|
|
12742
13243
|
const measure = { type: 'value' as const };
|
|
@@ -12781,21 +13282,23 @@ _From `scripts/docs/samples/charts.ts`:_
|
|
|
12781
13282
|
export default client(charts, { visuals: { [HUB_VISUALS]: { bullet: { component: BulletVisual } } } });
|
|
12782
13283
|
```
|
|
12783
13284
|
|
|
12784
|
-
**Widgets.** A widget is a fn of the widgets system's kind `widgets/widget`
|
|
12785
|
-
`
|
|
13285
|
+
**Widgets.** A widget is a fn of the widgets system's kind `widgets/widget` whose payload is a `WidgetSpec` (its
|
|
13286
|
+
contract and helpers are the widgets system's own, in `systems/widgets/shared`, not the SDK's): its `source` (a read fn returning a table), its `visuals` (each `{ visual, style, bind }`; a channel left
|
|
12786
13287
|
out takes the default binding), a plan per source arg (`args`: a chip with a label, choices with their own words and a
|
|
12787
13288
|
default, `pinned` to a value, or `hidden` when the arg has a default), `presets` (named chips that set several args),
|
|
12788
13289
|
the `range` args a time or calendar visual drives, the `paging` args (`limit` and `offset`, `WINDOW_ARGS`, which the
|
|
12789
13290
|
buffered pager drives), `actions`, a `drill` and `live`. Values may be relative dates (`today-7d`,
|
|
12790
|
-
`startOf(month)
|
|
12791
|
-
|
|
12792
|
-
|
|
12793
|
-
|
|
12794
|
-
|
|
13291
|
+
`startOf(month)`), resolved each time it runs, so a saved widget stays current. Its args are the source's minus the
|
|
13292
|
+
pinned ones, the paging and range args optional; the paging and range args are found with `pagingOf` and `rangeOf`. A
|
|
13293
|
+
run calls the source as a child run and returns a `WidgetResult`, which is core's `ShownResult` (what the app's result
|
|
13294
|
+
view draws for any shown result: the rows, offered visuals, pager, range, row actions, drill, live) with the chips and
|
|
13295
|
+
presets the widgets client draws in the result view's `controls` slot (`ResultControls`); bindings that no longer fit
|
|
13296
|
+
are listed as problems, never a failure. A widget may move to another source when every arg it plans exists there with
|
|
13297
|
+
a compatible type. Versions,
|
|
12795
13298
|
visibility, review and search come free, as for any fn. Rows that came from a write are read-only.
|
|
12796
13299
|
|
|
12797
13300
|
**Row actions** are derived, never listed by hand: each method of a row's type (a column's `ref`) is offered, labelled
|
|
12798
|
-
from its name (`actionLabel`), with a form for the args left after binding (`
|
|
13301
|
+
from its name (`actionLabel`), with a form for the args left after binding (`rowActionOptions`); a widget may also
|
|
12799
13302
|
bind any fn's args to columns. Anything that is not a read asks after its form (`confirmOf`); a widget can add a
|
|
12800
13303
|
confirm, never remove one. What follows is derived (`deriveThen`): rows returned open as a new level, a write
|
|
12801
13304
|
refreshes, else a status line. A click on a bar, slice or row runs the widget's `drill` (its args from the row,
|
|
@@ -12807,7 +13310,7 @@ rows declares its drill on its own (`database/drill_down`, through `@aeye/query`
|
|
|
12807
13310
|
|
|
12808
13311
|
**Making widgets.** People ask in the chat ("show my open tasks by owner as bars"). `widgets/make_widget` is an agent
|
|
12809
13312
|
fn handed the source: it reads a sample (`hub/read_table`) and proposes against a strict schema built for that call
|
|
12810
|
-
(`widgetProposalSchema`): only the visuals that draw the sample, each style an enum, each channel's columns an enum of
|
|
13313
|
+
(the widgets system's `widgetProposalSchema`): only the visuals that draw the sample, each style an enum, each channel's columns an enum of
|
|
12811
13314
|
the columns it may bind, a typed plan for exactly the source's unclaimed args. A broken widget can't be spelled. The
|
|
12812
13315
|
chat shows the proposal drawn as it will be; the person presses Save (`widgets/save_widget`). The agent never saves.
|
|
12813
13316
|
|
|
@@ -12827,8 +13330,9 @@ const HUB_VISUALS: "hub/visuals";
|
|
|
12827
13330
|
|
|
12828
13331
|
const · `import { BUILT_IN_CONTRIBUTIONS } from '@harness/sdk'`
|
|
12829
13332
|
|
|
12830
|
-
The
|
|
12831
|
-
|
|
13333
|
+
The visuals every result has (`BUILT_IN_VISUALS`: the table and the value cards) as the hub contributes them to
|
|
13334
|
+
`HUB_VISUALS`, in registry order. The web app draws them. Every chart is a system's: the bundled widgets system
|
|
13335
|
+
contributes the chart families (and bundles ECharts); other systems add theirs after.
|
|
12832
13336
|
|
|
12833
13337
|
```ts
|
|
12834
13338
|
const BUILT_IN_CONTRIBUTIONS: readonly ContributionDecl[];
|
|
@@ -12949,6 +13453,8 @@ interface VisualContribution {
|
|
|
12949
13453
|
readonly registry: string;
|
|
12950
13454
|
readonly name: string;
|
|
12951
13455
|
readonly label: string;
|
|
13456
|
+
/** What it draws, in a line (an authoring agent reads it beside the label). */
|
|
13457
|
+
readonly description?: string | undefined;
|
|
12952
13458
|
readonly shape?: VisualShape | undefined;
|
|
12953
13459
|
}
|
|
12954
13460
|
```
|
|
@@ -12976,7 +13482,9 @@ interface · `import { VisualView } from '@harness/sdk'`
|
|
|
12976
13482
|
|
|
12977
13483
|
The props of a visual (an entry of a registry such as the hub's `hub/visuals`): the rows to draw, their column facts
|
|
12978
13484
|
(`resultFacts`), the columns bound to each channel (`bind`, complete: the widget's or the default binding), the style
|
|
12979
|
-
picked in the style picker, and the theme's colours
|
|
13485
|
+
picked in the style picker, and the theme's colours; the result's `title` (a chart's accessible name) and, where
|
|
13486
|
+
the page offers one, the `opener` of a row's actions (with no drill and no opener, a mark opens nothing, so it
|
|
13487
|
+
shouldn't point).
|
|
12980
13488
|
|
|
12981
13489
|
```ts
|
|
12982
13490
|
interface VisualView {
|
|
@@ -12985,6 +13493,8 @@ interface VisualView {
|
|
|
12985
13493
|
bind: VisualBinding;
|
|
12986
13494
|
style: string;
|
|
12987
13495
|
palette: VisualPalette;
|
|
13496
|
+
title?: string | undefined;
|
|
13497
|
+
opener?: VisualRowOpener | undefined;
|
|
12988
13498
|
}
|
|
12989
13499
|
```
|
|
12990
13500
|
|
|
@@ -13013,8 +13523,9 @@ Refers to: [`ResultFacts`](#core-resultfacts), [`ResultTable`](#core-resulttable
|
|
|
13013
13523
|
interface · `import { VisualPalette } from '@harness/sdk'`
|
|
13014
13524
|
|
|
13015
13525
|
The colours a visual draws with, resolved for the current theme from the web app's tokens: the categorical series
|
|
13016
|
-
colours (`--chart-1` … `--chart-8`, the first the accent), the text and muted text, the grid lines
|
|
13017
|
-
behind the chart
|
|
13526
|
+
colours (`--chart-1` … `--chart-8`, the first the accent), the text and muted text, the grid lines, the surface
|
|
13527
|
+
behind the chart, a rise and a fall (`up` and `down`: the theme's ok and danger colours, for candles and changes)
|
|
13528
|
+
and the app's font. Build an ECharts theme from it; it changes when the theme does.
|
|
13018
13529
|
|
|
13019
13530
|
```ts
|
|
13020
13531
|
interface VisualPalette {
|
|
@@ -13023,6 +13534,9 @@ interface VisualPalette {
|
|
|
13023
13534
|
readonly muted: string;
|
|
13024
13535
|
readonly grid: string;
|
|
13025
13536
|
readonly surface: string;
|
|
13537
|
+
readonly up: string;
|
|
13538
|
+
readonly down: string;
|
|
13539
|
+
readonly font: string;
|
|
13026
13540
|
readonly dark: boolean;
|
|
13027
13541
|
}
|
|
13028
13542
|
```
|
|
@@ -13040,6 +13554,76 @@ interface VisualRange {
|
|
|
13040
13554
|
}
|
|
13041
13555
|
```
|
|
13042
13556
|
|
|
13557
|
+
#### `VisualRowOpener`
|
|
13558
|
+
|
|
13559
|
+
interface · `import { VisualRowOpener } from '@harness/sdk'`
|
|
13560
|
+
|
|
13561
|
+
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.
|
|
13562
|
+
|
|
13563
|
+
```ts
|
|
13564
|
+
interface VisualRowOpener {
|
|
13565
|
+
/** The button's label ("Actions", "Open"). */
|
|
13566
|
+
readonly label: string;
|
|
13567
|
+
/** Whether a row offers anything. */
|
|
13568
|
+
has(row: readonly Json[]): boolean;
|
|
13569
|
+
open(row: readonly Json[]): void;
|
|
13570
|
+
}
|
|
13571
|
+
```
|
|
13572
|
+
|
|
13573
|
+
Refers to: [`Json`](#core-json).
|
|
13574
|
+
|
|
13575
|
+
#### `VisualImageKind`
|
|
13576
|
+
|
|
13577
|
+
type · `import { VisualImageKind } from '@harness/sdk'`
|
|
13578
|
+
|
|
13579
|
+
The kinds of image a visual can export.
|
|
13580
|
+
|
|
13581
|
+
```ts
|
|
13582
|
+
type VisualImageKind = 'png' | 'svg';
|
|
13583
|
+
```
|
|
13584
|
+
|
|
13585
|
+
#### `VisualImageExport`
|
|
13586
|
+
|
|
13587
|
+
type · `import { VisualImageExport } from '@harness/sdk'`
|
|
13588
|
+
|
|
13589
|
+
An image of what a visual draws, as a data URL.
|
|
13590
|
+
|
|
13591
|
+
```ts
|
|
13592
|
+
type VisualImageExport = (kind: VisualImageKind) => string;
|
|
13593
|
+
```
|
|
13594
|
+
|
|
13595
|
+
#### `VisualImageSlot`
|
|
13596
|
+
|
|
13597
|
+
interface · `import { VisualImageSlot } from '@harness/sdk'`
|
|
13598
|
+
|
|
13599
|
+
Where the result view lets the visual it draws offer Export image (`inject(VISUAL_IMAGE)`; set while mounted, cleared on unmount).
|
|
13600
|
+
|
|
13601
|
+
```ts
|
|
13602
|
+
interface VisualImageSlot {
|
|
13603
|
+
set(exporter: VisualImageExport | undefined): void;
|
|
13604
|
+
}
|
|
13605
|
+
```
|
|
13606
|
+
|
|
13607
|
+
#### `VISUAL_IMAGE`
|
|
13608
|
+
|
|
13609
|
+
const · `import { VISUAL_IMAGE } from '@harness/sdk'`
|
|
13610
|
+
|
|
13611
|
+
The result view's image export slot, for a visual that draws an image (a chart).
|
|
13612
|
+
|
|
13613
|
+
```ts
|
|
13614
|
+
const VISUAL_IMAGE: InjectionKey<VisualImageSlot>;
|
|
13615
|
+
```
|
|
13616
|
+
|
|
13617
|
+
#### `VISUAL_DRILLABLE`
|
|
13618
|
+
|
|
13619
|
+
const · `import { VISUAL_DRILLABLE } from '@harness/sdk'`
|
|
13620
|
+
|
|
13621
|
+
Whether a click on a row's mark drills into it (a widget with a drill): the widget view provides it; absent outside one.
|
|
13622
|
+
|
|
13623
|
+
```ts
|
|
13624
|
+
const VISUAL_DRILLABLE: InjectionKey<Readonly<Ref<boolean>>>;
|
|
13625
|
+
```
|
|
13626
|
+
|
|
13043
13627
|
#### `VISUAL_EMITS`
|
|
13044
13628
|
|
|
13045
13629
|
const · `import { VISUAL_EMITS } from '@harness/sdk'`
|
|
@@ -13091,26 +13675,6 @@ interface VisualTheme {
|
|
|
13091
13675
|
}
|
|
13092
13676
|
```
|
|
13093
13677
|
|
|
13094
|
-
#### `WIDGETS_SYSTEM`
|
|
13095
|
-
|
|
13096
|
-
const · `import { WIDGETS_SYSTEM } from '@harness/sdk'`
|
|
13097
|
-
|
|
13098
|
-
The bundled system that owns widgets.
|
|
13099
|
-
|
|
13100
|
-
```ts
|
|
13101
|
-
const WIDGETS_SYSTEM: "widgets";
|
|
13102
|
-
```
|
|
13103
|
-
|
|
13104
|
-
#### `WIDGET_KIND`
|
|
13105
|
-
|
|
13106
|
-
const · `import { WIDGET_KIND } from '@harness/sdk'`
|
|
13107
|
-
|
|
13108
|
-
The widget kind.
|
|
13109
|
-
|
|
13110
|
-
```ts
|
|
13111
|
-
const WIDGET_KIND: "widgets/widget";
|
|
13112
|
-
```
|
|
13113
|
-
|
|
13114
13678
|
#### `argsOf`
|
|
13115
13679
|
|
|
13116
13680
|
function · `import { argsOf } from '@harness/sdk'`
|
|
@@ -13149,10 +13713,10 @@ const · `import { WINDOW_ARGS } from '@harness/sdk'`
|
|
|
13149
13713
|
The args a buffered pager drives, when a source has both (`limit` and `offset`, as the database's query fns name them).
|
|
13150
13714
|
|
|
13151
13715
|
```ts
|
|
13152
|
-
const WINDOW_ARGS:
|
|
13716
|
+
const WINDOW_ARGS: PagingArgs;
|
|
13153
13717
|
```
|
|
13154
13718
|
|
|
13155
|
-
Refers to: [`
|
|
13719
|
+
Refers to: [`PagingArgs`](#core-pagingargs).
|
|
13156
13720
|
|
|
13157
13721
|
#### `pagingOf`
|
|
13158
13722
|
|
|
@@ -13161,10 +13725,10 @@ function · `import { pagingOf } from '@harness/sdk'`
|
|
|
13161
13725
|
The source's paging args (`WINDOW_ARGS`, both whole-number args), or `undefined` when it doesn't page.
|
|
13162
13726
|
|
|
13163
13727
|
```ts
|
|
13164
|
-
function pagingOf(args: GinTypeDef):
|
|
13728
|
+
function pagingOf(args: GinTypeDef): PagingArgs | undefined;
|
|
13165
13729
|
```
|
|
13166
13730
|
|
|
13167
|
-
Refers to: [`GinTypeDef`](#core-gintypedef), [`
|
|
13731
|
+
Refers to: [`GinTypeDef`](#core-gintypedef), [`PagingArgs`](#core-pagingargs).
|
|
13168
13732
|
|
|
13169
13733
|
#### `rangeOf`
|
|
13170
13734
|
|
|
@@ -13175,128 +13739,14 @@ date or timestamp args named `from`/`to`, `start`/`end`, `after`/`before` or `si
|
|
|
13175
13739
|
shared prefix (`due_from`/`due_to`). `undefined` when there is none.
|
|
13176
13740
|
|
|
13177
13741
|
```ts
|
|
13178
|
-
function rangeOf(args: GinTypeDef):
|
|
13179
|
-
```
|
|
13180
|
-
|
|
13181
|
-
Refers to: [`GinTypeDef`](#core-gintypedef), [`WidgetRange`](#core-widgetrange).
|
|
13182
|
-
|
|
13183
|
-
#### `widgetArgs`
|
|
13184
|
-
|
|
13185
|
-
function · `import { widgetArgs } from '@harness/sdk'`
|
|
13186
|
-
|
|
13187
|
-
The widget's args type (the kind's `describe`): its source's args minus the pinned ones, with the paging and range
|
|
13188
|
-
args made optional (the view drives them; a run without them reads the first window of the range the widget opens
|
|
13189
|
-
on, its range chips' defaults, which `checkWidget` requires of a required range arg). An arg whose "Any" is sent as
|
|
13190
|
-
`null` (`clearsToNull`) takes `null` too.
|
|
13191
|
-
|
|
13192
|
-
```ts
|
|
13193
|
-
function widgetArgs(source: GinTypeDef, spec: Pick<WidgetSpec, "args" | "paging" | "range">): GinTypeDef;
|
|
13194
|
-
```
|
|
13195
|
-
|
|
13196
|
-
Refers to: [`GinTypeDef`](#core-gintypedef), [`WidgetSpec`](#core-widgetspec).
|
|
13197
|
-
|
|
13198
|
-
#### `widgetControls`
|
|
13199
|
-
|
|
13200
|
-
function · `import { widgetControls } from '@harness/sdk'`
|
|
13201
|
-
|
|
13202
|
-
The chip row (`WidgetResult.controls`), in the source's arg order: every arg not pinned, hidden or driven by the
|
|
13203
|
-
pager, with its plan's words and choices (an enum's members when the plan names none; an "Any" row first on an
|
|
13204
|
-
optional arg), and its value: the one the run used (`given`), else the plan's default. Range args are chips too, so
|
|
13205
|
-
a visual that doesn't draw the range still lets the person set it.
|
|
13206
|
-
|
|
13207
|
-
```ts
|
|
13208
|
-
function widgetControls(source: GinTypeDef, spec: Pick<WidgetSpec, "args" | "paging">, given?: Readonly<Record<string, Json>>): WidgetShownControl[];
|
|
13209
|
-
```
|
|
13210
|
-
|
|
13211
|
-
Refers to: [`GinTypeDef`](#core-gintypedef), [`Json`](#core-json), [`WidgetShownControl`](#core-widgetshowncontrol), [`WidgetSpec`](#core-widgetspec).
|
|
13212
|
-
|
|
13213
|
-
#### `widgetRunArgs`
|
|
13214
|
-
|
|
13215
|
-
function · `import { widgetRunArgs } from '@harness/sdk'`
|
|
13216
|
-
|
|
13217
|
-
The source args a widget run uses: pinned values, then the args given (the chips the person set), then each plan's
|
|
13218
|
-
default, relative dates resolved; an arg with none of these, or given as `null` ("Any"), is left out (it takes the
|
|
13219
|
-
source's default). A paged
|
|
13220
|
-
widget asks for `window` rows from the given offset (0 when none).
|
|
13221
|
-
|
|
13222
|
-
```ts
|
|
13223
|
-
function widgetRunArgs(source: GinTypeDef, spec: Pick<WidgetSpec, "args" | "paging">, given: Readonly<Record<string, Json>>, options: WidgetRunOptions): Record<string, Json>;
|
|
13224
|
-
```
|
|
13225
|
-
|
|
13226
|
-
Refers to: [`GinTypeDef`](#core-gintypedef), [`Json`](#core-json), [`WidgetSpec`](#core-widgetspec).
|
|
13227
|
-
|
|
13228
|
-
#### `WidgetRunOptions`
|
|
13229
|
-
|
|
13230
|
-
interface · `import { WidgetRunOptions } from '@harness/sdk'`
|
|
13231
|
-
|
|
13232
|
-
When and where a widget runs: the moment and time zone relative dates resolve in, and the pager's window.
|
|
13233
|
-
|
|
13234
|
-
```ts
|
|
13235
|
-
interface WidgetRunOptions {
|
|
13236
|
-
readonly now: Date;
|
|
13237
|
-
/** The person's time zone (an IANA name). */
|
|
13238
|
-
readonly zone: string;
|
|
13239
|
-
/** The rows a run asks for when the widget pages (its first visual's page size, or the pager's). */
|
|
13240
|
-
readonly window: number;
|
|
13241
|
-
}
|
|
13242
|
-
```
|
|
13243
|
-
|
|
13244
|
-
#### `widgetPager`
|
|
13245
|
-
|
|
13246
|
-
function · `import { widgetPager } from '@harness/sdk'`
|
|
13247
|
-
|
|
13248
|
-
The pager's state after a run that asked for `window` rows: a full window means more may follow.
|
|
13249
|
-
|
|
13250
|
-
```ts
|
|
13251
|
-
function widgetPager(paging: WidgetPaging, table: Pick<ResultTable, "rows">, window: number): WidgetPager;
|
|
13252
|
-
```
|
|
13253
|
-
|
|
13254
|
-
Refers to: [`ResultTable`](#core-resulttable), [`WidgetPager`](#core-widgetpager), [`WidgetPaging`](#core-widgetpaging).
|
|
13255
|
-
|
|
13256
|
-
#### `resolveRelative`
|
|
13257
|
-
|
|
13258
|
-
function · `import { resolveRelative } from '@harness/sdk'`
|
|
13259
|
-
|
|
13260
|
-
A relative date as a plain value at `now` in the time zone `zone` (an IANA name): `YYYY-MM-DD` for a day
|
|
13261
|
-
(`RELATIVE_DATES[expr].yields === 'day'`), ISO text in UTC for an instant. Throws on an unknown time zone.
|
|
13262
|
-
|
|
13263
|
-
```ts
|
|
13264
|
-
resolveRelative('startOf(month,today-1mo)', new Date('2026-03-15T10:00:00Z'), 'Europe/London'); // '2026-02-01'
|
|
13265
|
-
```
|
|
13266
|
-
|
|
13267
|
-
```ts
|
|
13268
|
-
function resolveRelative(expr: RelativeDate, now: Date, zone: string): string;
|
|
13742
|
+
function rangeOf(args: GinTypeDef): RangeArgs | undefined;
|
|
13269
13743
|
```
|
|
13270
13744
|
|
|
13271
|
-
Refers to: [`
|
|
13272
|
-
|
|
13273
|
-
#### `resolveArgValue`
|
|
13745
|
+
Refers to: [`GinTypeDef`](#core-gintypedef), [`RangeArgs`](#core-rangeargs).
|
|
13274
13746
|
|
|
13275
|
-
|
|
13747
|
+
#### `rowActionOptions`
|
|
13276
13748
|
|
|
13277
|
-
|
|
13278
|
-
|
|
13279
|
-
```ts
|
|
13280
|
-
function resolveArgValue(value: ArgValue, now: Date, zone: string): Json;
|
|
13281
|
-
```
|
|
13282
|
-
|
|
13283
|
-
Refers to: [`ArgValue`](#core-argvalue), [`Json`](#core-json).
|
|
13284
|
-
|
|
13285
|
-
#### `relativeDatesFor`
|
|
13286
|
-
|
|
13287
|
-
function · `import { relativeDatesFor } from '@harness/sdk'`
|
|
13288
|
-
|
|
13289
|
-
The relative dates that fill an argument of a gin type: days for `date`, instants for `timestamp`, else none.
|
|
13290
|
-
|
|
13291
|
-
```ts
|
|
13292
|
-
function relativeDatesFor(typeName: string): RelativeDate[];
|
|
13293
|
-
```
|
|
13294
|
-
|
|
13295
|
-
Refers to: [`RelativeDate`](#core-relativedate).
|
|
13296
|
-
|
|
13297
|
-
#### `widgetActionOptions`
|
|
13298
|
-
|
|
13299
|
-
function · `import { widgetActionOptions } from '@harness/sdk'`
|
|
13749
|
+
function · `import { rowActionOptions } from '@harness/sdk'`
|
|
13300
13750
|
|
|
13301
13751
|
The actions a row offers: every row fn when the widget lists none, else the listed ones in their order, each
|
|
13302
13752
|
labelled (`actionLabel` unless relabelled), confirming when `confirmOf` says so, with its bound args, a form for the
|
|
@@ -13306,10 +13756,10 @@ args left (the form comes first; the confirm follows for anything above a read),
|
|
|
13306
13756
|
is left out.
|
|
13307
13757
|
|
|
13308
13758
|
```ts
|
|
13309
|
-
function
|
|
13759
|
+
function rowActionOptions(rowFns: readonly RowFn[], actions: readonly RowAction[] | undefined): RowActionOption[];
|
|
13310
13760
|
```
|
|
13311
13761
|
|
|
13312
|
-
Refers to: [`
|
|
13762
|
+
Refers to: [`RowAction`](#core-rowaction), [`RowActionOption`](#core-rowactionoption).
|
|
13313
13763
|
|
|
13314
13764
|
#### `RowFn`
|
|
13315
13765
|
|
|
@@ -13368,197 +13818,6 @@ function ginTypeOf(def: GinTypeDef, scope?: TypeScope): GinType;
|
|
|
13368
13818
|
|
|
13369
13819
|
Refers to: [`GinTypeDef`](#core-gintypedef).
|
|
13370
13820
|
|
|
13371
|
-
#### `checkWidget`
|
|
13372
|
-
|
|
13373
|
-
function · `import { checkWidget } from '@harness/sdk'`
|
|
13374
|
-
|
|
13375
|
-
Every problem with a widget spec against its source's args and a real result (or the source's declared columns):
|
|
13376
|
-
arg plans naming args the source lacks, a required arg hidden, values that aren't the arg's type, presets setting
|
|
13377
|
-
pinned or unknown args, paging and range args of the wrong kind; visuals not in `HUB_VISUALS`, styles they don't
|
|
13378
|
-
have, bindings that don't draw (core's `bindingProblems`, a channel left out taking the default binding); action and
|
|
13379
|
-
drill bindings to columns the result lacks. A visual with a problem leaves `visuals`; the rest keep the spec's order.
|
|
13380
|
-
|
|
13381
|
-
```ts
|
|
13382
|
-
function checkWidget(spec: WidgetSpec, input: WidgetCheckInput): WidgetCheckResult;
|
|
13383
|
-
```
|
|
13384
|
-
|
|
13385
|
-
Refers to: [`WidgetSpec`](#core-widgetspec).
|
|
13386
|
-
|
|
13387
|
-
#### `WidgetCheckInput`
|
|
13388
|
-
|
|
13389
|
-
interface · `import { WidgetCheckInput } from '@harness/sdk'`
|
|
13390
|
-
|
|
13391
|
-
What `checkWidget` is given besides the spec.
|
|
13392
|
-
|
|
13393
|
-
```ts
|
|
13394
|
-
interface WidgetCheckInput {
|
|
13395
|
-
/** The source's args type. */
|
|
13396
|
-
readonly args: GinTypeDef;
|
|
13397
|
-
/** The facts of a real result of the source (`resultFacts`), or of its declared columns. */
|
|
13398
|
-
readonly facts: ResultFacts;
|
|
13399
|
-
/** Every `HUB_VISUALS` contribution (the hub's `hub/visuals`). */
|
|
13400
|
-
readonly entries: readonly VisualContribution[];
|
|
13401
|
-
/** The rows, so rules over values (a tree's parent links) are judged too. */
|
|
13402
|
-
readonly table?: Pick<ResultTable, 'rows' | 'columns'>;
|
|
13403
|
-
/** Where the args' named types resolve (the hub's scope); `g` without it. */
|
|
13404
|
-
readonly scope?: TypeScope;
|
|
13405
|
-
}
|
|
13406
|
-
```
|
|
13407
|
-
|
|
13408
|
-
Refers to: [`GinTypeDef`](#core-gintypedef), [`ResultFacts`](#core-resultfacts), [`ResultTable`](#core-resulttable).
|
|
13409
|
-
|
|
13410
|
-
#### `WidgetCheckResult`
|
|
13411
|
-
|
|
13412
|
-
interface · `import { WidgetCheckResult } from '@harness/sdk'`
|
|
13413
|
-
|
|
13414
|
-
What `checkWidget` finds: the spec's visuals that draw this result, in its order, and every problem in words.
|
|
13415
|
-
|
|
13416
|
-
```ts
|
|
13417
|
-
interface WidgetCheckResult {
|
|
13418
|
-
readonly visuals: WidgetVisual[];
|
|
13419
|
-
readonly problems: string[];
|
|
13420
|
-
}
|
|
13421
|
-
```
|
|
13422
|
-
|
|
13423
|
-
Refers to: [`WidgetVisual`](#core-widgetvisual).
|
|
13424
|
-
|
|
13425
|
-
#### `sourceCompatible`
|
|
13426
|
-
|
|
13427
|
-
function · `import { sourceCompatible } from '@harness/sdk'`
|
|
13428
|
-
|
|
13429
|
-
Why a widget can't move to a new source (authoring-edit-source), or `[]` when it can: every arg it plans, presets,
|
|
13430
|
-
pages or ranges must exist in the new source, take the values the widget stores, and (given the old args) take every
|
|
13431
|
-
value its old type did, constraints included (gin `compatible` in value mode: an enum's members, a number's range).
|
|
13432
|
-
|
|
13433
|
-
```ts
|
|
13434
|
-
function sourceCompatible(spec: WidgetSpec, args: GinTypeDef, options?: SourceCompatibleOptions): string[];
|
|
13435
|
-
```
|
|
13436
|
-
|
|
13437
|
-
Refers to: [`GinTypeDef`](#core-gintypedef), [`WidgetSpec`](#core-widgetspec).
|
|
13438
|
-
|
|
13439
|
-
#### `SourceCompatibleOptions`
|
|
13440
|
-
|
|
13441
|
-
interface · `import { SourceCompatibleOptions } from '@harness/sdk'`
|
|
13442
|
-
|
|
13443
|
-
What `sourceCompatible` is given besides the spec and the new source's args.
|
|
13444
|
-
|
|
13445
|
-
```ts
|
|
13446
|
-
interface SourceCompatibleOptions {
|
|
13447
|
-
/** The old source's args: each planned arg's new type must take every value of its old one (gin `compatible`). */
|
|
13448
|
-
readonly previous?: GinTypeDef;
|
|
13449
|
-
readonly scope?: TypeScope;
|
|
13450
|
-
}
|
|
13451
|
-
```
|
|
13452
|
-
|
|
13453
|
-
Refers to: [`GinTypeDef`](#core-gintypedef).
|
|
13454
|
-
|
|
13455
|
-
#### `widgetProposalSchema`
|
|
13456
|
-
|
|
13457
|
-
function · `import { widgetProposalSchema } from '@harness/sdk'`
|
|
13458
|
-
|
|
13459
|
-
The strict schema of one `make_widget` call, from the source's args, a real result's facts and the visuals that
|
|
13460
|
-
draw it, and how to read what it accepts as a spec. Throws when no visual draws the result.
|
|
13461
|
-
|
|
13462
|
-
```ts
|
|
13463
|
-
const ranked = rankedVisuals(entries, facts).map((r) => r.rank);
|
|
13464
|
-
const { schema, read } = widgetProposalSchema({ source, args, facts, ranked, entries });
|
|
13465
|
-
// schema is the propose tool's input; read(toolInput) is the proposal's name, description and spec
|
|
13466
|
-
```
|
|
13467
|
-
|
|
13468
|
-
```ts
|
|
13469
|
-
function widgetProposalSchema(input: WidgetProposalSchemaInput): WidgetProposalSchema;
|
|
13470
|
-
```
|
|
13471
|
-
|
|
13472
|
-
#### `WidgetProposalSchemaInput`
|
|
13473
|
-
|
|
13474
|
-
interface · `import { WidgetProposalSchemaInput } from '@harness/sdk'`
|
|
13475
|
-
|
|
13476
|
-
What `widgetProposalSchema` builds from.
|
|
13477
|
-
|
|
13478
|
-
```ts
|
|
13479
|
-
interface WidgetProposalSchemaInput {
|
|
13480
|
-
/** The source fn, a read fn returning a table. */
|
|
13481
|
-
readonly source: QualifiedName;
|
|
13482
|
-
/** Its args type. */
|
|
13483
|
-
readonly args: GinTypeDef;
|
|
13484
|
-
/** The facts of a real result of it (`resultFacts`). */
|
|
13485
|
-
readonly facts: ResultFacts;
|
|
13486
|
-
/** The visuals that draw it, best first (`rankedVisuals(entries, facts)`'s ranks). */
|
|
13487
|
-
readonly ranked: readonly VisualRank[];
|
|
13488
|
-
/** Every `HUB_VISUALS` contribution, for the visuals' shapes and labels. */
|
|
13489
|
-
readonly entries: readonly VisualContribution[];
|
|
13490
|
-
/** The sample's rows, so rules over values are judged too. */
|
|
13491
|
-
readonly table?: Pick<ResultTable, 'rows' | 'columns'>;
|
|
13492
|
-
/** The fns an action may name (the row types' methods and any fn it may bind); none: actions are derived. */
|
|
13493
|
-
readonly actions?: readonly QualifiedName[];
|
|
13494
|
-
/** The read fns returning a table a click may drill into; none: a click opens the row's action menu. */
|
|
13495
|
-
readonly drills?: readonly QualifiedName[];
|
|
13496
|
-
/** The source declares a live source (`FnDecl.live`), so the widget may re-run on its own. */
|
|
13497
|
-
readonly live?: boolean;
|
|
13498
|
-
/** Where the args' named types resolve; `g` without it. */
|
|
13499
|
-
readonly scope?: TypeScope;
|
|
13500
|
-
}
|
|
13501
|
-
```
|
|
13502
|
-
|
|
13503
|
-
Refers to: [`GinTypeDef`](#core-gintypedef), [`QualifiedName`](#core-qualifiedname), [`ResultFacts`](#core-resultfacts), [`ResultTable`](#core-resulttable), [`VisualRank`](#core-visualrank).
|
|
13504
|
-
|
|
13505
|
-
#### `WidgetProposalSchema`
|
|
13506
|
-
|
|
13507
|
-
interface · `import { WidgetProposalSchema } from '@harness/sdk'`
|
|
13508
|
-
|
|
13509
|
-
The strict schema of one call and how to read a parsed draft as a spec.
|
|
13510
|
-
|
|
13511
|
-
```ts
|
|
13512
|
-
interface WidgetProposalSchema {
|
|
13513
|
-
/** The agent's tool input: this call's strict schema, bound (its arg values typed in gin's grammar). */
|
|
13514
|
-
readonly schema: Bound<WidgetDraftInput>;
|
|
13515
|
-
/** A draft the schema accepts, as the fn name, description and spec. Throws (with the schema's message) when `value` doesn't fit. */
|
|
13516
|
-
read(value: unknown): WidgetDraft;
|
|
13517
|
-
}
|
|
13518
|
-
```
|
|
13519
|
-
|
|
13520
|
-
#### `WidgetDraftInput`
|
|
13521
|
-
|
|
13522
|
-
interface · `import { WidgetDraftInput } from '@harness/sdk'`
|
|
13523
|
-
|
|
13524
|
-
What the agent writes, as every call's schema shares it (the per-call schema narrows each part): the fn's name and
|
|
13525
|
-
description, the title, the visual shown first (its style, label, and bindings replacing the default ones), the
|
|
13526
|
-
other visuals the switcher offers (each with its default binding and first style), a plan per arg, presets, and the
|
|
13527
|
-
optional actions, drill and live flag. Its parts are core's widget types.
|
|
13528
|
-
|
|
13529
|
-
```ts
|
|
13530
|
-
interface WidgetDraftInput {
|
|
13531
|
-
readonly name: string;
|
|
13532
|
-
readonly description: string;
|
|
13533
|
-
readonly title: string;
|
|
13534
|
-
readonly choice: { readonly visual: string; readonly style: string; readonly label?: string; readonly bind?: Readonly<Record<string, readonly string[] | undefined>> };
|
|
13535
|
-
readonly more: readonly string[];
|
|
13536
|
-
readonly args: Readonly<Record<string, ArgPlan>>;
|
|
13537
|
-
readonly presets: ReadonlyArray<{ readonly label: string; readonly sets: Readonly<Record<string, ArgValue | undefined>> }>;
|
|
13538
|
-
readonly actions?: readonly WidgetAction[];
|
|
13539
|
-
readonly drill?: WidgetDrill;
|
|
13540
|
-
readonly live?: boolean;
|
|
13541
|
-
}
|
|
13542
|
-
```
|
|
13543
|
-
|
|
13544
|
-
Refers to: [`ArgPlan`](#core-argplan), [`ArgValue`](#core-argvalue), [`WidgetAction`](#core-widgetaction), [`WidgetDrill`](#core-widgetdrill).
|
|
13545
|
-
|
|
13546
|
-
#### `WidgetDraft`
|
|
13547
|
-
|
|
13548
|
-
interface · `import { WidgetDraft } from '@harness/sdk'`
|
|
13549
|
-
|
|
13550
|
-
A proposal's saved parts: the fn's name and description and the widget spec.
|
|
13551
|
-
|
|
13552
|
-
```ts
|
|
13553
|
-
interface WidgetDraft {
|
|
13554
|
-
readonly name: string;
|
|
13555
|
-
readonly description: string;
|
|
13556
|
-
readonly spec: WidgetSpec;
|
|
13557
|
-
}
|
|
13558
|
-
```
|
|
13559
|
-
|
|
13560
|
-
Refers to: [`WidgetSpec`](#core-widgetspec).
|
|
13561
|
-
|
|
13562
13821
|
## 29. Packaging: system.json, build, pack, install
|
|
13563
13822
|
|
|
13564
13823
|
### `system.json`
|
|
@@ -13700,7 +13959,7 @@ Every command, read from the CLI itself:
|
|
|
13700
13959
|
| `harness system store <system> [--instance <name>]` | Show a system’s own store: where it lives, its state, size and tables, its migrations, its backups and its move. |
|
|
13701
13960
|
| `harness system store move <system> --to hub\|system\|external [--engine postgres\|sqlserver --url <url\|-> --schema <name>] [--instance <name>] [--cancel-runs \| --keep-waiting]` | Move a system’s store to the hub, the system, or an external database, and follow the move until it ends. |
|
|
13702
13961
|
| `harness system store answer <system> cancel\|wait [--instance <name>]` | Answer a store move waiting on runs still going: cancel them, or keep waiting until they finish. |
|
|
13703
|
-
| `harness mcp <slug> [--hub <url>] (the secret in
|
|
13962
|
+
| `harness mcp <slug> [--hub <url>] (the secret in FNLOOM_MCP_SECRET)` | Bridge a hub MCP to stdin and stdout, for MCP clients that speak stdio only. |
|
|
13704
13963
|
|
|
13705
13964
|
`harness system new` fills the name in everywhere the template has `template`: as is in strings and paths, in camel
|
|
13706
13965
|
case in identifiers (`templateEnv` becomes `notesDbEnv`) and Pascal case in type names (`TemplateDeps` becomes
|
|
@@ -13726,13 +13985,13 @@ So after `fs/install_system` says it connected, tell the person what is left: an
|
|
|
13726
13985
|
`/admin/systems/<name>/review` and presses Go live (or approves the pending review, after an update). Don't call its
|
|
13727
13986
|
fns before then; they aren't offered yet.
|
|
13728
13987
|
|
|
13729
|
-
Commands that talk to a hub take `--hub <url>` and `--token <token>` (or `
|
|
13988
|
+
Commands that talk to a hub take `--hub <url>` and `--token <token>` (or `FNLOOM_URL`, `FNLOOM_TOKEN`, or the admin
|
|
13730
13989
|
account in `.env`). An installed package is code that runs as the hub's user: install only what you trust.
|
|
13731
13990
|
|
|
13732
13991
|
### Running it during development
|
|
13733
13992
|
|
|
13734
|
-
Start the process by hand against a running hub: `
|
|
13735
|
-
The first start waits for pairing (approve it in the hub's admin pages, or start it with `
|
|
13993
|
+
Start the process by hand against a running hub: `FNLOOM_HUB=ws://127.0.0.1:4300/link npx tsx systems/<name>/server/main.ts`.
|
|
13994
|
+
The first start waits for pairing (approve it in the hub's admin pages, or start it with `FNLOOM_PAIRING_TOKEN` from a
|
|
13736
13995
|
token an admin made); once paired it is installed and waits for review and Go live, like a system installed from the
|
|
13737
13996
|
chat. A system that runs under the hub (installed) restarts when it exits with `RESTART_CODE`, which
|
|
13738
13997
|
`running.restart(reason)` does for it. The fs system can edit a system's source and restart it, so an agent can add
|
|
@@ -14428,7 +14687,7 @@ function streamOf<T>(items: readonly T[]): AsyncGenerator<T>;
|
|
|
14428
14687
|
const · `import { liveEnv } from '@harness/sdk/server/testing'`
|
|
14429
14688
|
|
|
14430
14689
|
```ts
|
|
14431
|
-
const liveEnv: Env<EnvOutput<{}, { readonly OPENROUTER_API_KEY: z.ZodOptional<z.ZodString>; readonly
|
|
14690
|
+
const liveEnv: Env<EnvOutput<{}, { readonly OPENROUTER_API_KEY: z.ZodOptional<z.ZodString>; readonly FNLOOM_LIVE_MODEL: z.ZodDefault<z.ZodString>; readonly FNLOOM_LIVE_FALLBACKS: z.ZodDefault<z.ZodString>; readonly FNLOOM_LIVE_EMBEDDER_URL: z.ZodDefault<z.ZodString>; }>>;
|
|
14432
14691
|
```
|
|
14433
14692
|
|
|
14434
14693
|
#### `liveModels`
|
|
@@ -14554,7 +14813,7 @@ The hub's widget fns in memory.
|
|
|
14554
14813
|
|
|
14555
14814
|
```ts
|
|
14556
14815
|
class FakeHubWidgets {
|
|
14557
|
-
/** What `hub/visuals` answers: the
|
|
14816
|
+
/** What `hub/visuals` answers: the table and value cards as the hub contributes them; `testHub` pushes the system's own. */
|
|
14558
14817
|
readonly visuals: ContributionView[];
|
|
14559
14818
|
/** Every `hub/read_table` call, in order: the fn and the args it ran with. */
|
|
14560
14819
|
readonly reads: ReadTableArgs[];
|
|
@@ -15181,8 +15440,8 @@ Refers to: [`HubModelInfo`](#core-hubmodelinfo).
|
|
|
15181
15440
|
|
|
15182
15441
|
const · `import { realModel } from '@harness/sdk/testing'`
|
|
15183
15442
|
|
|
15184
|
-
A real free model (OpenRouter, `OPENROUTER_API_KEY`; the models of `
|
|
15185
|
-
`
|
|
15443
|
+
A real free model (OpenRouter, `OPENROUTER_API_KEY`; the models of `FNLOOM_LIVE_MODEL` and
|
|
15444
|
+
`FNLOOM_LIVE_FALLBACKS`). `realModel.it` declares a test that calls it: marked `real`, skipped without a key.
|
|
15186
15445
|
|
|
15187
15446
|
```ts
|
|
15188
15447
|
const realModel: { link(): OpenRouterModelLink | undefined; available(): boolean; it(name: string, body: RealModelTest, timeout?: number): void; };
|
|
@@ -15203,7 +15462,7 @@ type RealModelTest = (model: OpenRouterModelLink, context: TestContext) => Promi
|
|
|
15203
15462
|
function · `import { liveTurn } from '@harness/sdk/testing'`
|
|
15204
15463
|
|
|
15205
15464
|
A run's time for a call that drives a real model through an agent (authoring a fn): four minutes, like a turn on the
|
|
15206
|
-
hub (`
|
|
15465
|
+
hub (`FNLOOM_TURN_TIME`, ten minutes by default), not the test hub's 60-second default, which a real model writing
|
|
15207
15466
|
and checking a program can pass without anything being wrong. Pass it as `kit.call`'s extra.
|
|
15208
15467
|
|
|
15209
15468
|
```ts
|
|
@@ -15280,7 +15539,7 @@ interface PreviewOptions {
|
|
|
15280
15539
|
readonly viewports?: readonly PreviewViewport[];
|
|
15281
15540
|
/** Default both. */
|
|
15282
15541
|
readonly themes?: readonly PreviewTheme[];
|
|
15283
|
-
/** Force shooting on or off (default `
|
|
15542
|
+
/** Force shooting on or off (default `FNLOOM_PREVIEWS`). */
|
|
15284
15543
|
readonly shoot?: boolean;
|
|
15285
15544
|
}
|
|
15286
15545
|
```
|
|
@@ -15430,7 +15689,7 @@ Refers to: [`QualifiedName`](#core-qualifiedname).
|
|
|
15430
15689
|
const · `import { kitEnv } from '@harness/sdk/testing'`
|
|
15431
15690
|
|
|
15432
15691
|
```ts
|
|
15433
|
-
const kitEnv: Env<EnvOutput<{}, { readonly
|
|
15692
|
+
const kitEnv: Env<EnvOutput<{}, { readonly FNLOOM_PREVIEWS: z.ZodDefault<z.ZodBoolean>; readonly FNLOOM_PREVIEW_DIR: z.ZodDefault<z.ZodString>; readonly FNLOOM_PREVIEW_PHONE: z.ZodDefault<z.ZodString>; readonly FNLOOM_PREVIEW_DESKTOP: z.ZodDefault<z.ZodString>; readonly FNLOOM_PREVIEW_THEME: z.ZodOptional<z.ZodString>; }>>;
|
|
15434
15693
|
```
|
|
15435
15694
|
|
|
15436
15695
|
#### `scratchFolder`
|
|
@@ -16839,14 +17098,14 @@ const { host, log } = loggedHost(notes.name);
|
|
|
16839
17098
|
const impl = createNotesImpl({ settings });
|
|
16840
17099
|
|
|
16841
17100
|
// the renderers, built into the state folder and uploaded to the hub on connect
|
|
16842
|
-
const clientFolder = join(settings.
|
|
17101
|
+
const clientFolder = join(settings.FNLOOM_SYSTEM_STATE, 'client');
|
|
16843
17102
|
await buildClient({ entry: fileURLToPath(new URL('../client/index.ts', import.meta.url)), outDir: clientFolder });
|
|
16844
17103
|
|
|
16845
17104
|
const running = await serve(notes, impl, {
|
|
16846
|
-
hub: settings.
|
|
16847
|
-
state: settings.
|
|
17105
|
+
hub: settings.FNLOOM_HUB,
|
|
17106
|
+
state: settings.FNLOOM_SYSTEM_STATE,
|
|
16848
17107
|
client: clientFolder,
|
|
16849
|
-
...(settings.
|
|
17108
|
+
...(settings.FNLOOM_PAIRING_TOKEN === undefined ? {} : { pairingToken: settings.FNLOOM_PAIRING_TOKEN }),
|
|
16850
17109
|
}, host);
|
|
16851
17110
|
running.onStatus((status) => { log.info('notes.status', { status }); });
|
|
16852
17111
|
|
|
@@ -17917,7 +18176,7 @@ export const fs = system('fs', {
|
|
|
17917
18176
|
'',
|
|
17918
18177
|
'Answer in a few short paragraphs or a list. Quote each path with its line (`src/hub/link.ts:120`) for every claim, and say plainly what you could not find.',
|
|
17919
18178
|
'Example: asked "where is the session timeout set?", grep for `timeout`, read the config file it points to, and answer',
|
|
17920
|
-
'"The timeout is
|
|
18179
|
+
'"The timeout is FNLOOM_SESSION_TIMEOUT in packages/hub/src/env.ts:42 (default 30 minutes); packages/hub/src/auth/sessions.ts:88 reads it."',
|
|
17921
18180
|
].join('\n'),
|
|
17922
18181
|
examples: [
|
|
17923
18182
|
{ args: { question: 'How does the hub decide which instance runs a call?' } },
|
|
@@ -18577,7 +18836,7 @@ interface NodeStarterOptions {
|
|
|
18577
18836
|
readonly baseEnv: Readonly<Record<string, string | undefined>>;
|
|
18578
18837
|
/** Node flags put first when a command runs this Node binary (the parent's loader, e.g. tsx; `permissionArgs`). */
|
|
18579
18838
|
readonly nodeArgs?: readonly string[] | undefined;
|
|
18580
|
-
/** Characters of output kept for the exit report (`
|
|
18839
|
+
/** Characters of output kept for the exit report (`FNLOOM_SUPERVISE_OUTPUT_TAIL`). */
|
|
18581
18840
|
readonly outputTail: number;
|
|
18582
18841
|
}
|
|
18583
18842
|
```
|
|
@@ -18668,7 +18927,7 @@ const BASIC_ENV: readonly ["PATH", "SYSTEMROOT", "TEMP", "TMP", "TMPDIR"];
|
|
|
18668
18927
|
const · `import { SHARED_ENV } from '@harness/sdk/server'`
|
|
18669
18928
|
|
|
18670
18929
|
The harness variables a child inherits, by name: the SDK runtime tunables (`sdkEnv`: link timing, log level, ...),
|
|
18671
|
-
never the parent's instance identity. An explicit list, not a `
|
|
18930
|
+
never the parent's instance identity. An explicit list, not a `FNLOOM_` prefix, so a parent's own settings and
|
|
18672
18931
|
secrets (the hub's admin password, signing and encryption keys) never reach a child.
|
|
18673
18932
|
|
|
18674
18933
|
```ts
|
|
@@ -18732,7 +18991,7 @@ How `CrashPolicy` decides.
|
|
|
18732
18991
|
|
|
18733
18992
|
```ts
|
|
18734
18993
|
interface CrashPolicyOptions {
|
|
18735
|
-
/** The longest wait between restarts (`
|
|
18994
|
+
/** The longest wait between restarts (`FNLOOM_SUPERVISE_BACKOFF_MAX`). */
|
|
18736
18995
|
readonly maxWait: number;
|
|
18737
18996
|
/** The exit code that asks for an immediate restart (`RESTART_CODE` unless the supervisor sets another). */
|
|
18738
18997
|
readonly restartCode: number;
|
|
@@ -18758,7 +19017,7 @@ type ExitDecision =
|
|
|
18758
19017
|
|
|
18759
19018
|
const · `import { STATUS_LOG } from '@harness/sdk/server'`
|
|
18760
19019
|
|
|
18761
|
-
The log key a system writes its status changes under. A supervisor reads them from a child's JSON log lines (`
|
|
19020
|
+
The log key a system writes its status changes under. A supervisor reads them from a child's JSON log lines (`FNLOOM_LOG_JSON`).
|
|
18762
19021
|
|
|
18763
19022
|
```ts
|
|
18764
19023
|
const STATUS_LOG: "system.status";
|
|
@@ -18927,7 +19186,7 @@ const · `import { NETWORK_ALLOW_VAR } from '@harness/sdk/server'`
|
|
|
18927
19186
|
The variable a supervisor names a child's allowed endpoints in (`endpointsText`), for `hosted-network-guard.ts`.
|
|
18928
19187
|
|
|
18929
19188
|
```ts
|
|
18930
|
-
const NETWORK_ALLOW_VAR: "
|
|
19189
|
+
const NETWORK_ALLOW_VAR: "FNLOOM_NETWORK_ALLOW";
|
|
18931
19190
|
```
|
|
18932
19191
|
|
|
18933
19192
|
#### `endpointOf`
|
|
@@ -19238,7 +19497,7 @@ function isObjectSchema(schema: Bound<any>): schema is Bound<object>;
|
|
|
19238
19497
|
function · `import { schemaFromWire } from '@harness/sdk/server'`
|
|
19239
19498
|
|
|
19240
19499
|
A (lenient) JSON schema from the wire rebuilt as a bound `a` schema (`a.fromJSONSchema`), for the provider to plan
|
|
19241
|
-
for its model. The same JSON gives the same bound (kept, `
|
|
19500
|
+
for its model. The same JSON gives the same bound (kept, `FNLOOM_WIRE_SCHEMA_CACHE`), so a schema sent every round
|
|
19242
19501
|
is rebuilt once and rendered once per model dialect (a bound memoizes its renderings).
|
|
19243
19502
|
|
|
19244
19503
|
```ts
|
|
@@ -19643,7 +19902,7 @@ capability names. Only the models the system may use are listed; the hub still c
|
|
|
19643
19902
|
```ts
|
|
19644
19903
|
type HubModelInfo = {
|
|
19645
19904
|
id: string;
|
|
19646
|
-
provider: `${string}/${string}` | "openai" | "openrouter" | "ollama" | "aws";
|
|
19905
|
+
provider: `${string}/${string}` | "openai" | "anthropic" | "google" | "openrouter" | "ollama" | "aws";
|
|
19647
19906
|
name: string;
|
|
19648
19907
|
capabilities: string[];
|
|
19649
19908
|
tier: "flagship" | "efficient" | "legacy" | "experimental";
|
|
@@ -20303,6 +20562,17 @@ type ConnectionUpdate = {
|
|
|
20303
20562
|
};
|
|
20304
20563
|
```
|
|
20305
20564
|
|
|
20565
|
+
#### <a id="core-connectkey"></a>`ConnectKey`
|
|
20566
|
+
|
|
20567
|
+
const, type · declared in `packages/core/src/connections.ts`
|
|
20568
|
+
|
|
20569
|
+
A connection key: one of the things a key-scoped system (`ConnectDecl.scope: 'key'`) signs in to below its instance,
|
|
20570
|
+
named by the system's own records (an API service of the one `api` instance). People connect per key.
|
|
20571
|
+
|
|
20572
|
+
```ts
|
|
20573
|
+
type ConnectKey = ConnectKey;
|
|
20574
|
+
```
|
|
20575
|
+
|
|
20306
20576
|
#### <a id="core-connectresult"></a>`ConnectResult`
|
|
20307
20577
|
|
|
20308
20578
|
const, type · declared in `packages/core/src/connections.ts`
|
|
@@ -20434,7 +20704,7 @@ type ContextFileHeader = {
|
|
|
20434
20704
|
uri: `${string}://${string}`;
|
|
20435
20705
|
section?: SectionKey | undefined;
|
|
20436
20706
|
};
|
|
20437
|
-
relation: "
|
|
20707
|
+
relation: "about" | "next" | "parent" | "imports" | "brings" | "suggests" | "related";
|
|
20438
20708
|
weight: number;
|
|
20439
20709
|
}[] | undefined;
|
|
20440
20710
|
weight?: number | undefined;
|
|
@@ -20497,7 +20767,7 @@ type ContextFileProblemCode = "header" | "duplicate-key" | "broken-link" | "cycl
|
|
|
20497
20767
|
const, type · declared in `packages/core/src/context-graph.ts`
|
|
20498
20768
|
|
|
20499
20769
|
```ts
|
|
20500
|
-
type DeclarableRelation = "
|
|
20770
|
+
type DeclarableRelation = "about" | "next" | "parent" | "imports" | "brings" | "suggests" | "related";
|
|
20501
20771
|
```
|
|
20502
20772
|
|
|
20503
20773
|
### From `packages/core/src/context-questions.ts`
|
|
@@ -21510,7 +21780,7 @@ type PreviewAnswer = {
|
|
|
21510
21780
|
uri: `${string}://${string}`;
|
|
21511
21781
|
section?: SectionKey | undefined;
|
|
21512
21782
|
};
|
|
21513
|
-
relation: "
|
|
21783
|
+
relation: "about" | "next" | "parent" | "imports" | "brings" | "suggests" | "related";
|
|
21514
21784
|
weight: number;
|
|
21515
21785
|
}[] | undefined;
|
|
21516
21786
|
question?: string | undefined;
|
|
@@ -21641,6 +21911,7 @@ type PreviewAnswer = {
|
|
|
21641
21911
|
rule: "distinct";
|
|
21642
21912
|
channel: string;
|
|
21643
21913
|
max: number;
|
|
21914
|
+
min?: number | undefined;
|
|
21644
21915
|
} | {
|
|
21645
21916
|
rule: "non-negative";
|
|
21646
21917
|
channel: string;
|
|
@@ -21660,6 +21931,29 @@ type PreviewAnswer = {
|
|
|
21660
21931
|
label: string;
|
|
21661
21932
|
whole?: true | undefined;
|
|
21662
21933
|
needs?: string[] | undefined;
|
|
21934
|
+
columns?: Record<string, {
|
|
21935
|
+
min?: number | undefined;
|
|
21936
|
+
max?: number | undefined;
|
|
21937
|
+
}> | undefined;
|
|
21938
|
+
rules?: ({
|
|
21939
|
+
rule: "distinct";
|
|
21940
|
+
channel: string;
|
|
21941
|
+
max: number;
|
|
21942
|
+
min?: number | undefined;
|
|
21943
|
+
} | {
|
|
21944
|
+
rule: "non-negative";
|
|
21945
|
+
channel: string;
|
|
21946
|
+
} | {
|
|
21947
|
+
rule: "bounded";
|
|
21948
|
+
channel: string;
|
|
21949
|
+
} | {
|
|
21950
|
+
rule: "distinct-columns";
|
|
21951
|
+
channels: string[];
|
|
21952
|
+
} | {
|
|
21953
|
+
rule: "links";
|
|
21954
|
+
from: string;
|
|
21955
|
+
to: string;
|
|
21956
|
+
})[] | undefined;
|
|
21663
21957
|
}[];
|
|
21664
21958
|
claims: {
|
|
21665
21959
|
claim: "range";
|
|
@@ -21703,6 +21997,7 @@ type PreviewAnswer = {
|
|
|
21703
21997
|
component: string;
|
|
21704
21998
|
description?: string | undefined;
|
|
21705
21999
|
icon?: string | undefined;
|
|
22000
|
+
area?: "admin" | "app" | undefined;
|
|
21706
22001
|
}[] | undefined;
|
|
21707
22002
|
groups?: {
|
|
21708
22003
|
name: string;
|
|
@@ -22440,7 +22735,7 @@ type ContextDecl = {
|
|
|
22440
22735
|
uri: `${string}://${string}`;
|
|
22441
22736
|
section?: SectionKey | undefined;
|
|
22442
22737
|
};
|
|
22443
|
-
relation: "
|
|
22738
|
+
relation: "about" | "next" | "parent" | "imports" | "brings" | "suggests" | "related";
|
|
22444
22739
|
weight: number;
|
|
22445
22740
|
}[] | undefined;
|
|
22446
22741
|
question?: string | undefined;
|
|
@@ -23096,7 +23391,7 @@ type Manifest = {
|
|
|
23096
23391
|
uri: `${string}://${string}`;
|
|
23097
23392
|
section?: SectionKey | undefined;
|
|
23098
23393
|
};
|
|
23099
|
-
relation: "
|
|
23394
|
+
relation: "about" | "next" | "parent" | "imports" | "brings" | "suggests" | "related";
|
|
23100
23395
|
weight: number;
|
|
23101
23396
|
}[] | undefined;
|
|
23102
23397
|
question?: string | undefined;
|
|
@@ -23227,6 +23522,7 @@ type Manifest = {
|
|
|
23227
23522
|
rule: "distinct";
|
|
23228
23523
|
channel: string;
|
|
23229
23524
|
max: number;
|
|
23525
|
+
min?: number | undefined;
|
|
23230
23526
|
} | {
|
|
23231
23527
|
rule: "non-negative";
|
|
23232
23528
|
channel: string;
|
|
@@ -23246,6 +23542,29 @@ type Manifest = {
|
|
|
23246
23542
|
label: string;
|
|
23247
23543
|
whole?: true | undefined;
|
|
23248
23544
|
needs?: string[] | undefined;
|
|
23545
|
+
columns?: Record<string, {
|
|
23546
|
+
min?: number | undefined;
|
|
23547
|
+
max?: number | undefined;
|
|
23548
|
+
}> | undefined;
|
|
23549
|
+
rules?: ({
|
|
23550
|
+
rule: "distinct";
|
|
23551
|
+
channel: string;
|
|
23552
|
+
max: number;
|
|
23553
|
+
min?: number | undefined;
|
|
23554
|
+
} | {
|
|
23555
|
+
rule: "non-negative";
|
|
23556
|
+
channel: string;
|
|
23557
|
+
} | {
|
|
23558
|
+
rule: "bounded";
|
|
23559
|
+
channel: string;
|
|
23560
|
+
} | {
|
|
23561
|
+
rule: "distinct-columns";
|
|
23562
|
+
channels: string[];
|
|
23563
|
+
} | {
|
|
23564
|
+
rule: "links";
|
|
23565
|
+
from: string;
|
|
23566
|
+
to: string;
|
|
23567
|
+
})[] | undefined;
|
|
23249
23568
|
}[];
|
|
23250
23569
|
claims: {
|
|
23251
23570
|
claim: "range";
|
|
@@ -23289,6 +23608,7 @@ type Manifest = {
|
|
|
23289
23608
|
component: string;
|
|
23290
23609
|
description?: string | undefined;
|
|
23291
23610
|
icon?: string | undefined;
|
|
23611
|
+
area?: "admin" | "app" | undefined;
|
|
23292
23612
|
}[] | undefined;
|
|
23293
23613
|
groups?: {
|
|
23294
23614
|
name: string;
|
|
@@ -23549,7 +23869,7 @@ type ManifestPatch = {
|
|
|
23549
23869
|
uri: `${string}://${string}`;
|
|
23550
23870
|
section?: SectionKey | undefined;
|
|
23551
23871
|
};
|
|
23552
|
-
relation: "
|
|
23872
|
+
relation: "about" | "next" | "parent" | "imports" | "brings" | "suggests" | "related";
|
|
23553
23873
|
weight: number;
|
|
23554
23874
|
}[] | undefined;
|
|
23555
23875
|
question?: string | undefined;
|
|
@@ -23646,6 +23966,7 @@ type ManifestPatch = {
|
|
|
23646
23966
|
rule: "distinct";
|
|
23647
23967
|
channel: string;
|
|
23648
23968
|
max: number;
|
|
23969
|
+
min?: number | undefined;
|
|
23649
23970
|
} | {
|
|
23650
23971
|
rule: "non-negative";
|
|
23651
23972
|
channel: string;
|
|
@@ -23665,6 +23986,29 @@ type ManifestPatch = {
|
|
|
23665
23986
|
label: string;
|
|
23666
23987
|
whole?: true | undefined;
|
|
23667
23988
|
needs?: string[] | undefined;
|
|
23989
|
+
columns?: Record<string, {
|
|
23990
|
+
min?: number | undefined;
|
|
23991
|
+
max?: number | undefined;
|
|
23992
|
+
}> | undefined;
|
|
23993
|
+
rules?: ({
|
|
23994
|
+
rule: "distinct";
|
|
23995
|
+
channel: string;
|
|
23996
|
+
max: number;
|
|
23997
|
+
min?: number | undefined;
|
|
23998
|
+
} | {
|
|
23999
|
+
rule: "non-negative";
|
|
24000
|
+
channel: string;
|
|
24001
|
+
} | {
|
|
24002
|
+
rule: "bounded";
|
|
24003
|
+
channel: string;
|
|
24004
|
+
} | {
|
|
24005
|
+
rule: "distinct-columns";
|
|
24006
|
+
channels: string[];
|
|
24007
|
+
} | {
|
|
24008
|
+
rule: "links";
|
|
24009
|
+
from: string;
|
|
24010
|
+
to: string;
|
|
24011
|
+
})[] | undefined;
|
|
23668
24012
|
}[];
|
|
23669
24013
|
claims: {
|
|
23670
24014
|
claim: "range";
|
|
@@ -24052,7 +24396,7 @@ type ChatModeConfig = {
|
|
|
24052
24396
|
type: "static";
|
|
24053
24397
|
protocol: "text" | "auto" | "native";
|
|
24054
24398
|
placement: "system-end" | "tail";
|
|
24055
|
-
loadDetail: "
|
|
24399
|
+
loadDetail: "signature" | "listed" | "full";
|
|
24056
24400
|
};
|
|
24057
24401
|
```
|
|
24058
24402
|
|
|
@@ -24095,7 +24439,7 @@ type ContextorConfig = {
|
|
|
24095
24439
|
const, type · declared in `packages/core/src/modes.ts`
|
|
24096
24440
|
|
|
24097
24441
|
```ts
|
|
24098
|
-
type Detail = "
|
|
24442
|
+
type Detail = "signature" | "listed" | "full";
|
|
24099
24443
|
```
|
|
24100
24444
|
|
|
24101
24445
|
#### <a id="core-modellimits"></a>`ModelLimits`
|
|
@@ -24899,6 +25243,150 @@ type DeliveryStatus = "queued" | "done" | "failed" | "expired" | "delivered";
|
|
|
24899
25243
|
|
|
24900
25244
|
### From `packages/core/src/records/systems.ts`
|
|
24901
25245
|
|
|
25246
|
+
#### <a id="core-fnrecord"></a>`FnRecord`
|
|
25247
|
+
|
|
25248
|
+
const, type · declared in `packages/core/src/records/systems.ts`
|
|
25249
|
+
|
|
25250
|
+
The hub's row for a fn.
|
|
25251
|
+
|
|
25252
|
+
```ts
|
|
25253
|
+
type FnRecord = {
|
|
25254
|
+
name: `${string}/${string}`;
|
|
25255
|
+
system: SystemName;
|
|
25256
|
+
decl: {
|
|
25257
|
+
name: string;
|
|
25258
|
+
description: string;
|
|
25259
|
+
kind: `${string}/${string}` | "native";
|
|
25260
|
+
args: TypeDef$1<any>;
|
|
25261
|
+
returns: TypeDef$1<any>;
|
|
25262
|
+
deps: `${string}/${string}`[];
|
|
25263
|
+
handlers: Record<string, {
|
|
25264
|
+
description: string;
|
|
25265
|
+
args: TypeDef$1<any>;
|
|
25266
|
+
returns: TypeDef$1<any>;
|
|
25267
|
+
required: boolean;
|
|
25268
|
+
}>;
|
|
25269
|
+
progress: {
|
|
25270
|
+
type: "none";
|
|
25271
|
+
} | {
|
|
25272
|
+
type: "linear";
|
|
25273
|
+
} | {
|
|
25274
|
+
type: "steps";
|
|
25275
|
+
steps: Record<string, string>;
|
|
25276
|
+
};
|
|
25277
|
+
operations: {
|
|
25278
|
+
cancel: boolean;
|
|
25279
|
+
pause: boolean;
|
|
25280
|
+
undo: boolean;
|
|
25281
|
+
background: boolean;
|
|
25282
|
+
};
|
|
25283
|
+
display: "message" | "card" | "hidden";
|
|
25284
|
+
limits: {
|
|
25285
|
+
timeout?: number | undefined;
|
|
25286
|
+
retries?: number | undefined;
|
|
25287
|
+
cost?: number | undefined;
|
|
25288
|
+
};
|
|
25289
|
+
visibility: "user" | "llm" | "none" | "both";
|
|
25290
|
+
tags: string[];
|
|
25291
|
+
instructions?: string | undefined;
|
|
25292
|
+
payload?: z.core.util.JSONType | undefined;
|
|
25293
|
+
readable?: {
|
|
25294
|
+
language: string;
|
|
25295
|
+
code: string;
|
|
25296
|
+
} | undefined;
|
|
25297
|
+
status?: {
|
|
25298
|
+
active: {
|
|
25299
|
+
one: string;
|
|
25300
|
+
many: string;
|
|
25301
|
+
};
|
|
25302
|
+
retry: {
|
|
25303
|
+
one: string;
|
|
25304
|
+
many: string;
|
|
25305
|
+
};
|
|
25306
|
+
done: {
|
|
25307
|
+
one: string;
|
|
25308
|
+
many: string;
|
|
25309
|
+
};
|
|
25310
|
+
failed: {
|
|
25311
|
+
one: string;
|
|
25312
|
+
many: string;
|
|
25313
|
+
};
|
|
25314
|
+
} | undefined;
|
|
25315
|
+
undo?: TypeDef$1<any> | undefined;
|
|
25316
|
+
resume?: TypeDef$1<any> | undefined;
|
|
25317
|
+
state?: TypeDef$1<any> | undefined;
|
|
25318
|
+
form?: TypeDef$1<any> | undefined;
|
|
25319
|
+
niche?: "admin" | "developer" | "reference" | undefined;
|
|
25320
|
+
examples?: {
|
|
25321
|
+
args: z.core.util.JSONType;
|
|
25322
|
+
result?: z.core.util.JSONType | undefined;
|
|
25323
|
+
note?: string | undefined;
|
|
25324
|
+
}[] | undefined;
|
|
25325
|
+
validate?: {
|
|
25326
|
+
input: boolean;
|
|
25327
|
+
output: boolean;
|
|
25328
|
+
} | undefined;
|
|
25329
|
+
approval?: {
|
|
25330
|
+
preview: boolean;
|
|
25331
|
+
remember: boolean;
|
|
25332
|
+
approver?: "person" | "admins" | undefined;
|
|
25333
|
+
} | undefined;
|
|
25334
|
+
routing?: {
|
|
25335
|
+
to: "instance";
|
|
25336
|
+
instance: InstanceName;
|
|
25337
|
+
} | {
|
|
25338
|
+
to: "any";
|
|
25339
|
+
} | undefined;
|
|
25340
|
+
connectKey?: ConnectKey | {
|
|
25341
|
+
arg: string;
|
|
25342
|
+
} | undefined;
|
|
25343
|
+
effects?: {
|
|
25344
|
+
mode?: "read" | "write" | "delete" | undefined;
|
|
25345
|
+
reads?: `${string}/${string}`[] | undefined;
|
|
25346
|
+
writes?: `${string}/${string}`[] | undefined;
|
|
25347
|
+
free?: boolean | undefined;
|
|
25348
|
+
registry?: {
|
|
25349
|
+
thing: "types" | "records" | "fns" | "context" | "examples" | "kinds" | "resources" | "components" | "approvals" | "secrets" | "connections";
|
|
25350
|
+
action: "create" | "update" | "remove";
|
|
25351
|
+
kind?: `${string}/${string}` | "native" | undefined;
|
|
25352
|
+
}[] | undefined;
|
|
25353
|
+
keeps?: "resources"[] | undefined;
|
|
25354
|
+
} | undefined;
|
|
25355
|
+
promptExamples?: number | undefined;
|
|
25356
|
+
group?: string | undefined;
|
|
25357
|
+
flags?: boolean | undefined;
|
|
25358
|
+
roles?: ("metadata" | "ocr" | "chat" | "transcribe" | "dictate" | "speak" | "describe" | "decide" | "plan")[] | undefined;
|
|
25359
|
+
live?: {
|
|
25360
|
+
every: number;
|
|
25361
|
+
} | undefined;
|
|
25362
|
+
parallelClaims?: string[] | undefined;
|
|
25363
|
+
dynamicClaims?: boolean | undefined;
|
|
25364
|
+
check?: {
|
|
25365
|
+
deps: `${string}/${string}`[];
|
|
25366
|
+
} | undefined;
|
|
25367
|
+
};
|
|
25368
|
+
version: string;
|
|
25369
|
+
origin: "contract" | "runtime";
|
|
25370
|
+
available: true | {
|
|
25371
|
+
unavailable: "paused" | "system-needs-config" | "system-disconnected" | "system-removed" | "kind-missing" | "kind-system-disconnected" | "dep-unavailable" | "disabled" | "held" | "role-unset";
|
|
25372
|
+
detail: string;
|
|
25373
|
+
};
|
|
25374
|
+
paused: boolean;
|
|
25375
|
+
disabled: boolean;
|
|
25376
|
+
stats: {
|
|
25377
|
+
averageCost: number;
|
|
25378
|
+
outcomes: Record<"done" | "invalid-input" | "failed" | "cancelled", number>;
|
|
25379
|
+
averageTime: number;
|
|
25380
|
+
tokens: number;
|
|
25381
|
+
p95?: number | undefined;
|
|
25382
|
+
averageQueued?: number | undefined;
|
|
25383
|
+
lastRunAt?: number | undefined;
|
|
25384
|
+
};
|
|
25385
|
+
updatedAt: number;
|
|
25386
|
+
addedBy?: string | undefined;
|
|
25387
|
+
};
|
|
25388
|
+
```
|
|
25389
|
+
|
|
24902
25390
|
#### <a id="core-instancemode"></a>`InstanceMode`
|
|
24903
25391
|
|
|
24904
25392
|
const, type · declared in `packages/core/src/records/systems.ts`
|
|
@@ -24997,6 +25485,7 @@ type ContributionDecl = {
|
|
|
24997
25485
|
rule: "distinct";
|
|
24998
25486
|
channel: string;
|
|
24999
25487
|
max: number;
|
|
25488
|
+
min?: number | undefined;
|
|
25000
25489
|
} | {
|
|
25001
25490
|
rule: "non-negative";
|
|
25002
25491
|
channel: string;
|
|
@@ -25016,6 +25505,29 @@ type ContributionDecl = {
|
|
|
25016
25505
|
label: string;
|
|
25017
25506
|
whole?: true | undefined;
|
|
25018
25507
|
needs?: string[] | undefined;
|
|
25508
|
+
columns?: Record<string, {
|
|
25509
|
+
min?: number | undefined;
|
|
25510
|
+
max?: number | undefined;
|
|
25511
|
+
}> | undefined;
|
|
25512
|
+
rules?: ({
|
|
25513
|
+
rule: "distinct";
|
|
25514
|
+
channel: string;
|
|
25515
|
+
max: number;
|
|
25516
|
+
min?: number | undefined;
|
|
25517
|
+
} | {
|
|
25518
|
+
rule: "non-negative";
|
|
25519
|
+
channel: string;
|
|
25520
|
+
} | {
|
|
25521
|
+
rule: "bounded";
|
|
25522
|
+
channel: string;
|
|
25523
|
+
} | {
|
|
25524
|
+
rule: "distinct-columns";
|
|
25525
|
+
channels: string[];
|
|
25526
|
+
} | {
|
|
25527
|
+
rule: "links";
|
|
25528
|
+
from: string;
|
|
25529
|
+
to: string;
|
|
25530
|
+
})[] | undefined;
|
|
25019
25531
|
}[];
|
|
25020
25532
|
claims: {
|
|
25021
25533
|
claim: "range";
|
|
@@ -25064,6 +25576,7 @@ type ContributionView = {
|
|
|
25064
25576
|
rule: "distinct";
|
|
25065
25577
|
channel: string;
|
|
25066
25578
|
max: number;
|
|
25579
|
+
min?: number | undefined;
|
|
25067
25580
|
} | {
|
|
25068
25581
|
rule: "non-negative";
|
|
25069
25582
|
channel: string;
|
|
@@ -25083,6 +25596,29 @@ type ContributionView = {
|
|
|
25083
25596
|
label: string;
|
|
25084
25597
|
whole?: true | undefined;
|
|
25085
25598
|
needs?: string[] | undefined;
|
|
25599
|
+
columns?: Record<string, {
|
|
25600
|
+
min?: number | undefined;
|
|
25601
|
+
max?: number | undefined;
|
|
25602
|
+
}> | undefined;
|
|
25603
|
+
rules?: ({
|
|
25604
|
+
rule: "distinct";
|
|
25605
|
+
channel: string;
|
|
25606
|
+
max: number;
|
|
25607
|
+
min?: number | undefined;
|
|
25608
|
+
} | {
|
|
25609
|
+
rule: "non-negative";
|
|
25610
|
+
channel: string;
|
|
25611
|
+
} | {
|
|
25612
|
+
rule: "bounded";
|
|
25613
|
+
channel: string;
|
|
25614
|
+
} | {
|
|
25615
|
+
rule: "distinct-columns";
|
|
25616
|
+
channels: string[];
|
|
25617
|
+
} | {
|
|
25618
|
+
rule: "links";
|
|
25619
|
+
from: string;
|
|
25620
|
+
to: string;
|
|
25621
|
+
})[] | undefined;
|
|
25086
25622
|
}[];
|
|
25087
25623
|
claims: {
|
|
25088
25624
|
claim: "range";
|
|
@@ -25226,6 +25762,7 @@ type VisualShape = {
|
|
|
25226
25762
|
rule: "distinct";
|
|
25227
25763
|
channel: string;
|
|
25228
25764
|
max: number;
|
|
25765
|
+
min?: number | undefined;
|
|
25229
25766
|
} | {
|
|
25230
25767
|
rule: "non-negative";
|
|
25231
25768
|
channel: string;
|
|
@@ -25245,6 +25782,29 @@ type VisualShape = {
|
|
|
25245
25782
|
label: string;
|
|
25246
25783
|
whole?: true | undefined;
|
|
25247
25784
|
needs?: string[] | undefined;
|
|
25785
|
+
columns?: Record<string, {
|
|
25786
|
+
min?: number | undefined;
|
|
25787
|
+
max?: number | undefined;
|
|
25788
|
+
}> | undefined;
|
|
25789
|
+
rules?: ({
|
|
25790
|
+
rule: "distinct";
|
|
25791
|
+
channel: string;
|
|
25792
|
+
max: number;
|
|
25793
|
+
min?: number | undefined;
|
|
25794
|
+
} | {
|
|
25795
|
+
rule: "non-negative";
|
|
25796
|
+
channel: string;
|
|
25797
|
+
} | {
|
|
25798
|
+
rule: "bounded";
|
|
25799
|
+
channel: string;
|
|
25800
|
+
} | {
|
|
25801
|
+
rule: "distinct-columns";
|
|
25802
|
+
channels: string[];
|
|
25803
|
+
} | {
|
|
25804
|
+
rule: "links";
|
|
25805
|
+
from: string;
|
|
25806
|
+
to: string;
|
|
25807
|
+
})[] | undefined;
|
|
25248
25808
|
}[];
|
|
25249
25809
|
claims: {
|
|
25250
25810
|
claim: "range";
|
|
@@ -25285,6 +25845,7 @@ type VisualShapeInput = {
|
|
|
25285
25845
|
rule: "distinct";
|
|
25286
25846
|
channel: string;
|
|
25287
25847
|
max: number;
|
|
25848
|
+
min?: number | undefined;
|
|
25288
25849
|
} | {
|
|
25289
25850
|
rule: "non-negative";
|
|
25290
25851
|
channel: string;
|
|
@@ -25305,64 +25866,39 @@ type VisualShapeInput = {
|
|
|
25305
25866
|
label: string;
|
|
25306
25867
|
whole?: true | undefined;
|
|
25307
25868
|
needs?: string[] | undefined;
|
|
25308
|
-
|
|
25309
|
-
|
|
25310
|
-
|
|
25311
|
-
|
|
25312
|
-
|
|
25313
|
-
|
|
25314
|
-
|
|
25315
|
-
|
|
25316
|
-
|
|
25317
|
-
|
|
25318
|
-
|
|
25319
|
-
|
|
25320
|
-
|
|
25321
|
-
|
|
25322
|
-
|
|
25323
|
-
|
|
25324
|
-
|
|
25325
|
-
|
|
25326
|
-
|
|
25327
|
-
|
|
25328
|
-
|
|
25329
|
-
|
|
25330
|
-
|
|
25331
|
-
|
|
25332
|
-
|
|
25333
|
-
|
|
25334
|
-
|
|
25335
|
-
|
|
25336
|
-
|
|
25337
|
-
|
|
25338
|
-
|
|
25339
|
-
|
|
25340
|
-
|
|
25341
|
-
} | {
|
|
25342
|
-
kind: "oauth";
|
|
25343
|
-
per: "shared" | "person";
|
|
25344
|
-
scopes?: string[] | undefined;
|
|
25345
|
-
clientId?: string | undefined;
|
|
25346
|
-
clientSecret?: string | undefined;
|
|
25347
|
-
};
|
|
25348
|
-
```
|
|
25349
|
-
|
|
25350
|
-
#### <a id="core-remotecredentials"></a>`RemoteCredentials`
|
|
25351
|
-
|
|
25352
|
-
const, type · declared in `packages/core/src/remote-auth.ts`
|
|
25353
|
-
|
|
25354
|
-
Per-person credentials kept by the hub for a `form` connection: the token or the header values the person typed.
|
|
25355
|
-
|
|
25356
|
-
```ts
|
|
25357
|
-
type RemoteCredentials = {
|
|
25358
|
-
token: string;
|
|
25359
|
-
} | {
|
|
25360
|
-
headers: Record<string, string>;
|
|
25361
|
-
} | {
|
|
25362
|
-
accessToken: string;
|
|
25363
|
-
tokenType: string;
|
|
25364
|
-
refreshToken?: string | undefined;
|
|
25365
|
-
clientId?: string | undefined;
|
|
25869
|
+
columns?: Record<string, {
|
|
25870
|
+
min?: number | undefined;
|
|
25871
|
+
max?: number | undefined;
|
|
25872
|
+
}> | undefined;
|
|
25873
|
+
rules?: ({
|
|
25874
|
+
rule: "distinct";
|
|
25875
|
+
channel: string;
|
|
25876
|
+
max: number;
|
|
25877
|
+
min?: number | undefined;
|
|
25878
|
+
} | {
|
|
25879
|
+
rule: "non-negative";
|
|
25880
|
+
channel: string;
|
|
25881
|
+
} | {
|
|
25882
|
+
rule: "bounded";
|
|
25883
|
+
channel: string;
|
|
25884
|
+
} | {
|
|
25885
|
+
rule: "distinct-columns";
|
|
25886
|
+
channels: string[];
|
|
25887
|
+
} | {
|
|
25888
|
+
rule: "links";
|
|
25889
|
+
from: string;
|
|
25890
|
+
to: string;
|
|
25891
|
+
})[] | undefined;
|
|
25892
|
+
}[] | undefined;
|
|
25893
|
+
claims?: {
|
|
25894
|
+
claim: "range";
|
|
25895
|
+
channel: string;
|
|
25896
|
+
}[] | undefined;
|
|
25897
|
+
priority?: {
|
|
25898
|
+
band: "floor" | "structural" | "encoded" | "time-encoded";
|
|
25899
|
+
terms: ("temporal-key" | "low-cardinality" | "enum-key" | "high-null" | "many-categories")[];
|
|
25900
|
+
} | undefined;
|
|
25901
|
+
pageSize?: number | undefined;
|
|
25366
25902
|
};
|
|
25367
25903
|
```
|
|
25368
25904
|
|
|
@@ -25755,7 +26291,7 @@ type OutcomeWire = {
|
|
|
25755
26291
|
cost?: number | undefined;
|
|
25756
26292
|
expose?: {
|
|
25757
26293
|
fn: `${string}/${string}`;
|
|
25758
|
-
detail: "
|
|
26294
|
+
detail: "signature" | "listed" | "full";
|
|
25759
26295
|
}[] | undefined;
|
|
25760
26296
|
} | {
|
|
25761
26297
|
status: "invalid-input";
|
|
@@ -26341,6 +26877,7 @@ type SystemPageDecl = {
|
|
|
26341
26877
|
component: string;
|
|
26342
26878
|
description?: string | undefined;
|
|
26343
26879
|
icon?: string | undefined;
|
|
26880
|
+
area?: "admin" | "app" | undefined;
|
|
26344
26881
|
};
|
|
26345
26882
|
```
|
|
26346
26883
|
|
|
@@ -26348,7 +26885,7 @@ type SystemPageDecl = {
|
|
|
26348
26885
|
|
|
26349
26886
|
type · declared in `packages/core/src/system-pages.ts`
|
|
26350
26887
|
|
|
26351
|
-
A page as an author writes it: `nav` and `
|
|
26888
|
+
A page as an author writes it: `nav`, `access` and `area` may be left out.
|
|
26352
26889
|
|
|
26353
26890
|
```ts
|
|
26354
26891
|
type SystemPageInput = {
|
|
@@ -26359,6 +26896,7 @@ type SystemPageInput = {
|
|
|
26359
26896
|
icon?: string | undefined;
|
|
26360
26897
|
nav?: "hidden" | "main" | undefined;
|
|
26361
26898
|
access?: "admin" | "everyone" | undefined;
|
|
26899
|
+
area?: "admin" | "app" | undefined;
|
|
26362
26900
|
};
|
|
26363
26901
|
```
|
|
26364
26902
|
|
|
@@ -26396,6 +26934,81 @@ type ProviderModelDecl = {
|
|
|
26396
26934
|
};
|
|
26397
26935
|
```
|
|
26398
26936
|
|
|
26937
|
+
### From `packages/core/src/tables.ts`
|
|
26938
|
+
|
|
26939
|
+
#### <a id="core-pagingargs"></a>`PagingArgs`
|
|
26940
|
+
|
|
26941
|
+
const, type · declared in `packages/core/src/tables.ts`
|
|
26942
|
+
|
|
26943
|
+
A source's paging args, which the buffered pager drives.
|
|
26944
|
+
|
|
26945
|
+
```ts
|
|
26946
|
+
type PagingArgs = {
|
|
26947
|
+
offset: string;
|
|
26948
|
+
limit: string;
|
|
26949
|
+
};
|
|
26950
|
+
```
|
|
26951
|
+
|
|
26952
|
+
#### <a id="core-rangeargs"></a>`RangeArgs`
|
|
26953
|
+
|
|
26954
|
+
const, type · declared in `packages/core/src/tables.ts`
|
|
26955
|
+
|
|
26956
|
+
A source's range args a visual's range claim drives (a calendar's month, a zoomed time axis).
|
|
26957
|
+
|
|
26958
|
+
```ts
|
|
26959
|
+
type RangeArgs = {
|
|
26960
|
+
from: string;
|
|
26961
|
+
to: string;
|
|
26962
|
+
};
|
|
26963
|
+
```
|
|
26964
|
+
|
|
26965
|
+
#### <a id="core-readtableargs"></a>`ReadTableArgs`
|
|
26966
|
+
|
|
26967
|
+
const, type · declared in `packages/core/src/tables.ts`
|
|
26968
|
+
|
|
26969
|
+
`hub/read_table`: run a read fn that returns a table, as a child run of the caller, as its person.
|
|
26970
|
+
|
|
26971
|
+
```ts
|
|
26972
|
+
type ReadTableArgs = {
|
|
26973
|
+
fn: `${string}/${string}`;
|
|
26974
|
+
args: Record<string, z.core.util.JSONType>;
|
|
26975
|
+
};
|
|
26976
|
+
```
|
|
26977
|
+
|
|
26978
|
+
#### <a id="core-rowaction"></a>`RowAction`
|
|
26979
|
+
|
|
26980
|
+
const, type · declared in `packages/core/src/tables.ts`
|
|
26981
|
+
|
|
26982
|
+
One action a view keeps, relabels or confirms: a method of the row's type, or any fn with args bound to columns.
|
|
26983
|
+
|
|
26984
|
+
```ts
|
|
26985
|
+
type RowAction = {
|
|
26986
|
+
fn: `${string}/${string}`;
|
|
26987
|
+
bind: Record<string, string>;
|
|
26988
|
+
label?: string | undefined;
|
|
26989
|
+
confirm?: true | undefined;
|
|
26990
|
+
then?: "status" | "open" | "refresh" | undefined;
|
|
26991
|
+
};
|
|
26992
|
+
```
|
|
26993
|
+
|
|
26994
|
+
#### <a id="core-rowactionoption"></a>`RowActionOption`
|
|
26995
|
+
|
|
26996
|
+
const, type · declared in `packages/core/src/tables.ts`
|
|
26997
|
+
|
|
26998
|
+
An action as a row's menu offers it: derived from the fn, narrowed and labelled by the view.
|
|
26999
|
+
|
|
27000
|
+
```ts
|
|
27001
|
+
type RowActionOption = {
|
|
27002
|
+
fn: `${string}/${string}`;
|
|
27003
|
+
label: string;
|
|
27004
|
+
mode: "read" | "write" | "delete";
|
|
27005
|
+
confirm: boolean;
|
|
27006
|
+
bind: Record<string, string>;
|
|
27007
|
+
then: "status" | "open" | "refresh";
|
|
27008
|
+
form?: TypeDef$1<any> | undefined;
|
|
27009
|
+
};
|
|
27010
|
+
```
|
|
27011
|
+
|
|
26399
27012
|
### From `packages/core/src/validation.ts`
|
|
26400
27013
|
|
|
26401
27014
|
#### <a id="core-inputverdict"></a>`InputVerdict`
|
|
@@ -26533,291 +27146,3 @@ type · declared in `packages/core/src/web.ts`
|
|
|
26533
27146
|
```ts
|
|
26534
27147
|
type HubWebSpec = typeof hubWebSpec;
|
|
26535
27148
|
```
|
|
26536
|
-
|
|
26537
|
-
### From `packages/core/src/widgets.ts`
|
|
26538
|
-
|
|
26539
|
-
#### <a id="core-argplan"></a>`ArgPlan`
|
|
26540
|
-
|
|
26541
|
-
const, type · declared in `packages/core/src/widgets.ts`
|
|
26542
|
-
|
|
26543
|
-
How a widget shows one argument of its source: a chip in the control row (labelled, limited to choices, with a
|
|
26544
|
-
default), `pinned` to a value (it leaves the widget's args; no chip), or `hidden` (no chip; it takes its default, so
|
|
26545
|
-
only an argument with a default may be hidden). An argument with no plan is a chip with the source's own words.
|
|
26546
|
-
|
|
26547
|
-
```ts
|
|
26548
|
-
type ArgPlan = {
|
|
26549
|
-
show: "control";
|
|
26550
|
-
label?: string | undefined;
|
|
26551
|
-
choices?: {
|
|
26552
|
-
label: string;
|
|
26553
|
-
value?: {
|
|
26554
|
-
literal: z.core.util.JSONType;
|
|
26555
|
-
} | {
|
|
26556
|
-
relative: "now" | "today" | "today-1d" | "today+1d" | "today-7d" | "today-30d" | "today+7d" | "startOf(week)" | "endOf(week)" | "startOf(month)" | "endOf(month)" | "startOf(month,today-1mo)" | "startOf(quarter)" | "startOf(year)" | "now-1h" | "now-24h";
|
|
26557
|
-
} | undefined;
|
|
26558
|
-
}[] | undefined;
|
|
26559
|
-
custom?: boolean | undefined;
|
|
26560
|
-
default?: {
|
|
26561
|
-
literal: z.core.util.JSONType;
|
|
26562
|
-
} | {
|
|
26563
|
-
relative: "now" | "today" | "today-1d" | "today+1d" | "today-7d" | "today-30d" | "today+7d" | "startOf(week)" | "endOf(week)" | "startOf(month)" | "endOf(month)" | "startOf(month,today-1mo)" | "startOf(quarter)" | "startOf(year)" | "now-1h" | "now-24h";
|
|
26564
|
-
} | undefined;
|
|
26565
|
-
} | {
|
|
26566
|
-
show: "pinned";
|
|
26567
|
-
value: {
|
|
26568
|
-
literal: z.core.util.JSONType;
|
|
26569
|
-
} | {
|
|
26570
|
-
relative: "now" | "today" | "today-1d" | "today+1d" | "today-7d" | "today-30d" | "today+7d" | "startOf(week)" | "endOf(week)" | "startOf(month)" | "endOf(month)" | "startOf(month,today-1mo)" | "startOf(quarter)" | "startOf(year)" | "now-1h" | "now-24h";
|
|
26571
|
-
};
|
|
26572
|
-
} | {
|
|
26573
|
-
show: "hidden";
|
|
26574
|
-
};
|
|
26575
|
-
```
|
|
26576
|
-
|
|
26577
|
-
#### <a id="core-argvalue"></a>`ArgValue`
|
|
26578
|
-
|
|
26579
|
-
const, type · declared in `packages/core/src/widgets.ts`
|
|
26580
|
-
|
|
26581
|
-
A value for a source argument: a plain value, or a relative date resolved when the widget runs.
|
|
26582
|
-
|
|
26583
|
-
```ts
|
|
26584
|
-
type ArgValue = {
|
|
26585
|
-
literal: z.core.util.JSONType;
|
|
26586
|
-
} | {
|
|
26587
|
-
relative: "now" | "today" | "today-1d" | "today+1d" | "today-7d" | "today-30d" | "today+7d" | "startOf(week)" | "endOf(week)" | "startOf(month)" | "endOf(month)" | "startOf(month,today-1mo)" | "startOf(quarter)" | "startOf(year)" | "now-1h" | "now-24h";
|
|
26588
|
-
};
|
|
26589
|
-
```
|
|
26590
|
-
|
|
26591
|
-
#### <a id="core-readtableargs"></a>`ReadTableArgs`
|
|
26592
|
-
|
|
26593
|
-
const, type · declared in `packages/core/src/widgets.ts`
|
|
26594
|
-
|
|
26595
|
-
`hub/read_table`: run a read fn that returns a table, as a child run of the caller, as its person.
|
|
26596
|
-
|
|
26597
|
-
```ts
|
|
26598
|
-
type ReadTableArgs = {
|
|
26599
|
-
fn: `${string}/${string}`;
|
|
26600
|
-
args: Record<string, z.core.util.JSONType>;
|
|
26601
|
-
};
|
|
26602
|
-
```
|
|
26603
|
-
|
|
26604
|
-
#### <a id="core-relativedate"></a>`RelativeDate`
|
|
26605
|
-
|
|
26606
|
-
const, type · declared in `packages/core/src/widgets.ts`
|
|
26607
|
-
|
|
26608
|
-
```ts
|
|
26609
|
-
type RelativeDate = "now" | "today" | "today-1d" | "today+1d" | "today-7d" | "today-30d" | "today+7d" | "startOf(week)" | "endOf(week)" | "startOf(month)" | "endOf(month)" | "startOf(month,today-1mo)" | "startOf(quarter)" | "startOf(year)" | "now-1h" | "now-24h";
|
|
26610
|
-
```
|
|
26611
|
-
|
|
26612
|
-
#### <a id="core-widgetaction"></a>`WidgetAction`
|
|
26613
|
-
|
|
26614
|
-
const, type · declared in `packages/core/src/widgets.ts`
|
|
26615
|
-
|
|
26616
|
-
One action a widget keeps, relabels or confirms: a method of the row's type, or any fn with args bound to columns.
|
|
26617
|
-
|
|
26618
|
-
```ts
|
|
26619
|
-
type WidgetAction = {
|
|
26620
|
-
fn: `${string}/${string}`;
|
|
26621
|
-
bind: Record<string, string>;
|
|
26622
|
-
label?: string | undefined;
|
|
26623
|
-
confirm?: true | undefined;
|
|
26624
|
-
then?: "status" | "open" | "refresh" | undefined;
|
|
26625
|
-
};
|
|
26626
|
-
```
|
|
26627
|
-
|
|
26628
|
-
#### <a id="core-widgetactionoption"></a>`WidgetActionOption`
|
|
26629
|
-
|
|
26630
|
-
const, type · declared in `packages/core/src/widgets.ts`
|
|
26631
|
-
|
|
26632
|
-
An action as a row's menu offers it: derived from the fn, narrowed and labelled by the widget.
|
|
26633
|
-
|
|
26634
|
-
```ts
|
|
26635
|
-
type WidgetActionOption = {
|
|
26636
|
-
fn: `${string}/${string}`;
|
|
26637
|
-
label: string;
|
|
26638
|
-
mode: "read" | "write" | "delete";
|
|
26639
|
-
confirm: boolean;
|
|
26640
|
-
bind: Record<string, string>;
|
|
26641
|
-
then: "status" | "open" | "refresh";
|
|
26642
|
-
form?: TypeDef$1<any> | undefined;
|
|
26643
|
-
};
|
|
26644
|
-
```
|
|
26645
|
-
|
|
26646
|
-
#### <a id="core-widgetdrill"></a>`WidgetDrill`
|
|
26647
|
-
|
|
26648
|
-
const, type · declared in `packages/core/src/widgets.ts`
|
|
26649
|
-
|
|
26650
|
-
What clicking a bar, slice, point or row runs: a read fn returning a table, its args from the clicked row's columns,
|
|
26651
|
-
opened as a new level with a breadcrumb. Without one, a click opens the row's action menu.
|
|
26652
|
-
|
|
26653
|
-
```ts
|
|
26654
|
-
type WidgetDrill = {
|
|
26655
|
-
fn: `${string}/${string}`;
|
|
26656
|
-
label: string;
|
|
26657
|
-
bind: Record<string, string>;
|
|
26658
|
-
};
|
|
26659
|
-
```
|
|
26660
|
-
|
|
26661
|
-
#### <a id="core-widgetpager"></a>`WidgetPager`
|
|
26662
|
-
|
|
26663
|
-
const, type · declared in `packages/core/src/widgets.ts`
|
|
26664
|
-
|
|
26665
|
-
How the buffered pager asks for more: the paging args, the window the run applied (`limit`), and whether more may
|
|
26666
|
-
follow (a full window means there may be; a short one is the last). The pager pages locally through what it holds and
|
|
26667
|
-
runs the widget again (offset = rows held) only when a page needs rows it lacks.
|
|
26668
|
-
|
|
26669
|
-
```ts
|
|
26670
|
-
type WidgetPager = {
|
|
26671
|
-
offset: string;
|
|
26672
|
-
limit: string;
|
|
26673
|
-
window: number;
|
|
26674
|
-
more: boolean;
|
|
26675
|
-
};
|
|
26676
|
-
```
|
|
26677
|
-
|
|
26678
|
-
#### <a id="core-widgetpaging"></a>`WidgetPaging`
|
|
26679
|
-
|
|
26680
|
-
const, type · declared in `packages/core/src/widgets.ts`
|
|
26681
|
-
|
|
26682
|
-
The source's paging args, which the buffered pager drives instead of showing them as controls.
|
|
26683
|
-
|
|
26684
|
-
```ts
|
|
26685
|
-
type WidgetPaging = {
|
|
26686
|
-
offset: string;
|
|
26687
|
-
limit: string;
|
|
26688
|
-
};
|
|
26689
|
-
```
|
|
26690
|
-
|
|
26691
|
-
#### <a id="core-widgetrange"></a>`WidgetRange`
|
|
26692
|
-
|
|
26693
|
-
const, type · declared in `packages/core/src/widgets.ts`
|
|
26694
|
-
|
|
26695
|
-
The source's range args a visual's range claim drives (a calendar's month, a zoomed time axis).
|
|
26696
|
-
|
|
26697
|
-
```ts
|
|
26698
|
-
type WidgetRange = {
|
|
26699
|
-
from: string;
|
|
26700
|
-
to: string;
|
|
26701
|
-
};
|
|
26702
|
-
```
|
|
26703
|
-
|
|
26704
|
-
#### <a id="core-widgetshowncontrol"></a>`WidgetShownControl`
|
|
26705
|
-
|
|
26706
|
-
const, type · declared in `packages/core/src/widgets.ts`
|
|
26707
|
-
|
|
26708
|
-
A chip in the control row: the argument, its words and type, what it offers and what it is set to.
|
|
26709
|
-
|
|
26710
|
-
```ts
|
|
26711
|
-
type WidgetShownControl = {
|
|
26712
|
-
arg: string;
|
|
26713
|
-
label: string;
|
|
26714
|
-
argType: TypeDef$1<any>;
|
|
26715
|
-
optional: boolean;
|
|
26716
|
-
custom: boolean;
|
|
26717
|
-
relative: boolean;
|
|
26718
|
-
defaulted?: boolean | undefined;
|
|
26719
|
-
choices?: {
|
|
26720
|
-
label: string;
|
|
26721
|
-
value?: {
|
|
26722
|
-
literal: z.core.util.JSONType;
|
|
26723
|
-
} | {
|
|
26724
|
-
relative: "now" | "today" | "today-1d" | "today+1d" | "today-7d" | "today-30d" | "today+7d" | "startOf(week)" | "endOf(week)" | "startOf(month)" | "endOf(month)" | "startOf(month,today-1mo)" | "startOf(quarter)" | "startOf(year)" | "now-1h" | "now-24h";
|
|
26725
|
-
} | undefined;
|
|
26726
|
-
}[] | undefined;
|
|
26727
|
-
value?: {
|
|
26728
|
-
literal: z.core.util.JSONType;
|
|
26729
|
-
} | {
|
|
26730
|
-
relative: "now" | "today" | "today-1d" | "today+1d" | "today-7d" | "today-30d" | "today+7d" | "startOf(week)" | "endOf(week)" | "startOf(month)" | "endOf(month)" | "startOf(month,today-1mo)" | "startOf(quarter)" | "startOf(year)" | "now-1h" | "now-24h";
|
|
26731
|
-
} | undefined;
|
|
26732
|
-
};
|
|
26733
|
-
```
|
|
26734
|
-
|
|
26735
|
-
#### <a id="core-widgetspec"></a>`WidgetSpec`
|
|
26736
|
-
|
|
26737
|
-
const, type · declared in `packages/core/src/widgets.ts`
|
|
26738
|
-
|
|
26739
|
-
A saved widget: the payload of a `widgets/widget` fn.
|
|
26740
|
-
|
|
26741
|
-
```ts
|
|
26742
|
-
type WidgetSpec = {
|
|
26743
|
-
title: string;
|
|
26744
|
-
source: `${string}/${string}`;
|
|
26745
|
-
visuals: {
|
|
26746
|
-
visual: string;
|
|
26747
|
-
style: string;
|
|
26748
|
-
bind: Record<string, string[]>;
|
|
26749
|
-
label?: string | undefined;
|
|
26750
|
-
}[];
|
|
26751
|
-
args: Record<string, {
|
|
26752
|
-
show: "control";
|
|
26753
|
-
label?: string | undefined;
|
|
26754
|
-
choices?: {
|
|
26755
|
-
label: string;
|
|
26756
|
-
value?: {
|
|
26757
|
-
literal: z.core.util.JSONType;
|
|
26758
|
-
} | {
|
|
26759
|
-
relative: "now" | "today" | "today-1d" | "today+1d" | "today-7d" | "today-30d" | "today+7d" | "startOf(week)" | "endOf(week)" | "startOf(month)" | "endOf(month)" | "startOf(month,today-1mo)" | "startOf(quarter)" | "startOf(year)" | "now-1h" | "now-24h";
|
|
26760
|
-
} | undefined;
|
|
26761
|
-
}[] | undefined;
|
|
26762
|
-
custom?: boolean | undefined;
|
|
26763
|
-
default?: {
|
|
26764
|
-
literal: z.core.util.JSONType;
|
|
26765
|
-
} | {
|
|
26766
|
-
relative: "now" | "today" | "today-1d" | "today+1d" | "today-7d" | "today-30d" | "today+7d" | "startOf(week)" | "endOf(week)" | "startOf(month)" | "endOf(month)" | "startOf(month,today-1mo)" | "startOf(quarter)" | "startOf(year)" | "now-1h" | "now-24h";
|
|
26767
|
-
} | undefined;
|
|
26768
|
-
} | {
|
|
26769
|
-
show: "pinned";
|
|
26770
|
-
value: {
|
|
26771
|
-
literal: z.core.util.JSONType;
|
|
26772
|
-
} | {
|
|
26773
|
-
relative: "now" | "today" | "today-1d" | "today+1d" | "today-7d" | "today-30d" | "today+7d" | "startOf(week)" | "endOf(week)" | "startOf(month)" | "endOf(month)" | "startOf(month,today-1mo)" | "startOf(quarter)" | "startOf(year)" | "now-1h" | "now-24h";
|
|
26774
|
-
};
|
|
26775
|
-
} | {
|
|
26776
|
-
show: "hidden";
|
|
26777
|
-
}>;
|
|
26778
|
-
presets: {
|
|
26779
|
-
label: string;
|
|
26780
|
-
sets: Record<string, {
|
|
26781
|
-
literal: z.core.util.JSONType;
|
|
26782
|
-
} | {
|
|
26783
|
-
relative: "now" | "today" | "today-1d" | "today+1d" | "today-7d" | "today-30d" | "today+7d" | "startOf(week)" | "endOf(week)" | "startOf(month)" | "endOf(month)" | "startOf(month,today-1mo)" | "startOf(quarter)" | "startOf(year)" | "now-1h" | "now-24h";
|
|
26784
|
-
}>;
|
|
26785
|
-
}[];
|
|
26786
|
-
range?: {
|
|
26787
|
-
from: string;
|
|
26788
|
-
to: string;
|
|
26789
|
-
} | undefined;
|
|
26790
|
-
paging?: {
|
|
26791
|
-
offset: string;
|
|
26792
|
-
limit: string;
|
|
26793
|
-
} | undefined;
|
|
26794
|
-
actions?: {
|
|
26795
|
-
fn: `${string}/${string}`;
|
|
26796
|
-
bind: Record<string, string>;
|
|
26797
|
-
label?: string | undefined;
|
|
26798
|
-
confirm?: true | undefined;
|
|
26799
|
-
then?: "status" | "open" | "refresh" | undefined;
|
|
26800
|
-
}[] | undefined;
|
|
26801
|
-
drill?: {
|
|
26802
|
-
fn: `${string}/${string}`;
|
|
26803
|
-
label: string;
|
|
26804
|
-
bind: Record<string, string>;
|
|
26805
|
-
} | undefined;
|
|
26806
|
-
live?: true | undefined;
|
|
26807
|
-
};
|
|
26808
|
-
```
|
|
26809
|
-
|
|
26810
|
-
#### <a id="core-widgetvisual"></a>`WidgetVisual`
|
|
26811
|
-
|
|
26812
|
-
const, type · declared in `packages/core/src/widgets.ts`
|
|
26813
|
-
|
|
26814
|
-
One visual a widget offers: its name in `HUB_VISUALS`, the style shown, and the columns bound to each channel.
|
|
26815
|
-
|
|
26816
|
-
```ts
|
|
26817
|
-
type WidgetVisual = {
|
|
26818
|
-
visual: string;
|
|
26819
|
-
style: string;
|
|
26820
|
-
bind: Record<string, string[]>;
|
|
26821
|
-
label?: string | undefined;
|
|
26822
|
-
};
|
|
26823
|
-
```
|