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
|
@@ -139,10 +139,21 @@ function checkBundle(type: Type, opts: GinAOptions): Bundle<unknown, HarnessGram
|
|
|
139
139
|
return made;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
+
/** How `ginValueCheck` binds, besides how the type becomes a schema. */
|
|
143
|
+
export interface GinValueCheckOptions extends GinAOptions {
|
|
144
|
+
/**
|
|
145
|
+
* A type the value holds (a `typ`, an expression's `new`) may name any named type, not only those the type's
|
|
146
|
+
* registry lists: a program payload builds its own system's types (an api fn's `new api/HttpRequest`), which the
|
|
147
|
+
* payload type never names. Whoever checks the program resolves the names (the kind's check).
|
|
148
|
+
*/
|
|
149
|
+
readonly namedRefs?: boolean;
|
|
150
|
+
}
|
|
151
|
+
|
|
142
152
|
/** A gin type's value check bound for code (fn-name fields plain): render it `LENIENT`, the code shape, to check. */
|
|
143
|
-
export function ginValueCheck<T = unknown>(type: Type, opts:
|
|
153
|
+
export function ginValueCheck<T = unknown>(type: Type, opts: GinValueCheckOptions = {}): Bound<T> {
|
|
154
|
+
const { namedRefs, ...schema } = opts;
|
|
144
155
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- typed by the caller, as the gin type's values
|
|
145
|
-
return checkBundle(type,
|
|
156
|
+
return checkBundle(type, schema).bind(type.registry, undefined, namedRefs === true ? { namedRefs: true } : undefined) as Bound<T>;
|
|
146
157
|
}
|
|
147
158
|
|
|
148
159
|
/** One problem of a value that doesn't fit a gin type: where (a dotted path, `''` for the whole) and what. */
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
import { ActorId, Timestamp } from './primitives.ts';
|
|
8
8
|
|
|
9
|
-
/** The hub option key of the HTTPS switch (an admin's choice; `
|
|
9
|
+
/** The hub option key of the HTTPS switch (an admin's choice; `FNLOOM_HTTPS` until one is made). */
|
|
10
10
|
export const HTTPS_OPTION = 'https';
|
|
11
11
|
|
|
12
12
|
/** Where the hub serves its authority's certificate, for a phone or computer to install. */
|
|
13
13
|
export const AUTHORITY_PATHS = { der: '/harness-ca.crt', pem: '/harness-ca.pem' } as const;
|
|
14
14
|
|
|
15
|
-
/** Where the certificate comes from: the hub's own authority, or the files in `
|
|
15
|
+
/** Where the certificate comes from: the hub's own authority, or the files in `FNLOOM_TLS_CERT` / `FNLOOM_TLS_KEY`. */
|
|
16
16
|
export const HttpsSource = z.enum(['own', 'files']);
|
|
17
17
|
export type HttpsSource = z.infer<typeof HttpsSource>;
|
|
18
18
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The hub's display name (build 8): the name people see everywhere the app names itself (the brand, the sign-in and
|
|
3
3
|
* setup page, the tab title, the install name, the version line, notification titles). It comes from the admin's
|
|
4
|
-
* setting (the hub option `HUB_NAME_OPTION`) when one is set, else the env setting `
|
|
4
|
+
* setting (the hub option `HUB_NAME_OPTION`) when one is set, else the env setting `FNLOOM_NAME`, else
|
|
5
5
|
* `DEFAULT_HUB_NAME`. Code names (packages, the `harness` CLI, env prefixes, storage keys) never change.
|
|
6
6
|
*/
|
|
7
7
|
import { z } from 'zod';
|
|
@@ -59,7 +59,7 @@ export const ImageEmbeddingView = z.object({
|
|
|
59
59
|
value: ImageEmbedding,
|
|
60
60
|
setBy: ActorId.optional(),
|
|
61
61
|
updatedAt: Timestamp.optional(),
|
|
62
|
-
/** The text (document) embedder, `
|
|
62
|
+
/** The text (document) embedder, `FNLOOM_EMBEDDER_DOCUMENT`. */
|
|
63
63
|
text: QualifiedName,
|
|
64
64
|
/** Embedders connected now that embed images. */
|
|
65
65
|
options: z.array(ImageEmbedderOption),
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* from them, so changing a schema breaks, at compile time, everything that relies on it.
|
|
4
4
|
*
|
|
5
5
|
* - `primitives`: JSON, ids, units, names, priorities; `model-names`: the one name the model sees for a fn.
|
|
6
|
-
* - `ports`: the port schema, default ports and the shared `
|
|
6
|
+
* - `ports`: the port schema, default ports and the shared `FNLOOM_PORT` env field.
|
|
7
7
|
* - `gin`: gin types on the wire; `gin-record`: the harness's own `record<V>` type and the registries that define it.
|
|
8
8
|
* - `run`: who a run is for, progress, outcomes.
|
|
9
9
|
* - `labels`: friendly names for qualified names.
|
|
@@ -41,8 +41,9 @@
|
|
|
41
41
|
* - `graph`: the graph of systems' items and their relations.
|
|
42
42
|
* - build 8: `sensitivity` (sensitive files and their rules), `changes` (what a command changed), `identity` (the hub's
|
|
43
43
|
* display name), `versions` (every item's version history), `data` (the data system's records), widget pass: `visuals` (column facts,
|
|
44
|
-
* coverage-first ranking, the
|
|
45
|
-
* routing
|
|
44
|
+
* coverage-first ranking, the table and value cards), `tables` (shown results, row actions, table reads, export and
|
|
45
|
+
* routing; the widgets system's own contract is in `systems/widgets/shared/spec.ts`) and `widgets-v1` (build 8's hub
|
|
46
|
+
* widget contracts and their upgrade, for the migration), `api-index` (API groups and their index items), `mention-search` (resource
|
|
46
47
|
* search tied to a mention request).
|
|
47
48
|
*/
|
|
48
49
|
export * from './primitives.ts';
|
|
@@ -119,14 +120,11 @@ export * from './identity.ts';
|
|
|
119
120
|
export * from './versions.ts';
|
|
120
121
|
export * from './data.ts';
|
|
121
122
|
export * from './visuals.ts';
|
|
122
|
-
export * from './
|
|
123
|
+
export * from './tables.ts';
|
|
123
124
|
export * from './csv.ts';
|
|
124
125
|
export * from './widgets-v1.ts';
|
|
125
126
|
export * from './api-index.ts';
|
|
126
127
|
export * from './mention-search.ts';
|
|
127
|
-
export * from './remote-auth.ts';
|
|
128
|
-
export * from './mcp-servers.ts';
|
|
129
128
|
export * from './sso.ts';
|
|
130
129
|
export * from './stores.ts';
|
|
131
|
-
export * from './programs.ts';
|
|
132
130
|
export * from './flow.ts';
|
|
@@ -49,7 +49,7 @@ export const Hello = z.object({
|
|
|
49
49
|
protocol: z.literal(LINK_PROTOCOL),
|
|
50
50
|
name: SystemName,
|
|
51
51
|
version: z.string(),
|
|
52
|
-
/** Which copy of the system this is (`
|
|
52
|
+
/** Which copy of the system this is (`FNLOOM_INSTANCE`); a system that runs one copy is `main`. */
|
|
53
53
|
instance: InstanceName.default(MAIN_INSTANCE),
|
|
54
54
|
/** Whether the system runs one instance or a fleet (`system.json`'s `instances`); absent for a system without one. */
|
|
55
55
|
instances: InstanceMode.optional(),
|
|
@@ -238,7 +238,7 @@ export function nicheOf(decl: { readonly niche?: Niche | undefined; readonly tag
|
|
|
238
238
|
* name that must exist), worked out by its system after the args parse and before the policies decide the run.
|
|
239
239
|
* `deps` are the fns the check may call, each one of the fn's own deps whose mode is `read`; the hub refuses any other
|
|
240
240
|
* call it makes, and any call that would wait for approval. A check that can't finish (its system gone, the
|
|
241
|
-
* `
|
|
241
|
+
* `FNLOOM_ARGS_CHECK_TIMEOUT` deadline) leaves the run to go on as if it had none.
|
|
242
242
|
*/
|
|
243
243
|
export const FnArgsCheck = z.object({ deps: z.array(QualifiedName) });
|
|
244
244
|
export type FnArgsCheck = z.infer<typeof FnArgsCheck>;
|
|
@@ -295,7 +295,7 @@ export const FnDecl = z.object({
|
|
|
295
295
|
effects: FnEffects.optional(),
|
|
296
296
|
/**
|
|
297
297
|
* How many of its examples go into the model's prompt with it, the most relevant to the turn first (the
|
|
298
|
-
* hub's `
|
|
298
|
+
* hub's `FNLOOM_FN_PROMPT_EXAMPLES` when absent). The rest are a `hub/fns_examples` call away.
|
|
299
299
|
*/
|
|
300
300
|
promptExamples: z.number().int().min(0).max(20).optional(),
|
|
301
301
|
/** Build 8: the API group it is listed in (`Manifest.groups`, `api-index.ts`); `general` when absent. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Resource search for an `@` mention (build 8). When the hub asks a system for mention options (`mentions` on the
|
|
3
3
|
* system link), it mints a `MentionRequestId` tied to the asking person and session, valid for
|
|
4
|
-
* `
|
|
4
|
+
* `FNLOOM_MENTION_REQUEST_TTL`. The system may then search the hub's resources for that request
|
|
5
5
|
* (`mentionResources` on the hub link), and the hub runs the search as that person: a system can only search for the
|
|
6
6
|
* person it was asked about, and only while the request is fresh. This replaces the web system's in-memory recent pages.
|
|
7
7
|
*/
|
|
@@ -151,7 +151,7 @@ export type ModelForwardResult = z.infer<typeof ModelForwardResult>;
|
|
|
151
151
|
* `describe`: describing images. `ocr`: reading the text in images and scanned pages. `decide`: a decision model
|
|
152
152
|
* (aeye's `ai.decide`) for typed answers: suggestions when set to it, `ctx_crawl`'s links, and systems' `decide`.
|
|
153
153
|
* `metadata`: fills context items' metadata (their question, when they apply, who asked) and splits an item that
|
|
154
|
-
* answers several questions; without a model of its own (a setting, or `
|
|
154
|
+
* answers several questions; without a model of its own (a setting, or `FNLOOM_METADATA_MODEL`) it uses the decide
|
|
155
155
|
* role's model when that model can chat, else the chat role's. `plan`: `hub/ctx_plan`'s model, which lists the
|
|
156
156
|
* questions a plan needs answered and the options for each; it has no default.
|
|
157
157
|
*/
|
|
@@ -189,7 +189,7 @@ export function dataExportFileName(ref: InstanceRef): string {
|
|
|
189
189
|
|
|
190
190
|
/**
|
|
191
191
|
* Build 9: add an instance to a fleet from the browser (`addInstance`, admins): an MCP server, an API service, a
|
|
192
|
-
* Claude machine on the hub's host. The hub installs the system's bundled folder (`
|
|
192
|
+
* Claude machine on the hub's host. The hub installs the system's bundled folder (`FNLOOM_BUNDLED_SYSTEMS`, or the
|
|
193
193
|
* source of an instance it already installed) as a new instance with this config, pairs it and starts it. Only a
|
|
194
194
|
* system whose `system.json` says `instances: "many"` takes one.
|
|
195
195
|
*/
|
|
@@ -10,5 +10,5 @@ export const Port = z.number().int().min(1).max(65535);
|
|
|
10
10
|
/** Where each process listens by default: the hub (which also serves the built web app), Vite's dev server, the mock hub. */
|
|
11
11
|
export const DEFAULT_PORTS = { hub: 4300, web: 4310, mockHub: 4320 } as const satisfies Record<string, z.output<typeof Port>>;
|
|
12
12
|
|
|
13
|
-
/** The hub's port as an `@ayepi/env` field. Every slice that reads `
|
|
14
|
-
export const HUB_PORT = {
|
|
13
|
+
/** The hub's port as an `@ayepi/env` field. Every slice that reads `FNLOOM_PORT` spreads this. */
|
|
14
|
+
export const HUB_PORT = { FNLOOM_PORT: Port.default(DEFAULT_PORTS.hub) } as const;
|
|
@@ -254,7 +254,7 @@ export type QueryFnArgs = z.infer<typeof QueryFnArgs>;
|
|
|
254
254
|
|
|
255
255
|
/**
|
|
256
256
|
* What `hub/query` returns: the rows as JSON (each list's record), the sort applied, the next page's cursor, how many
|
|
257
|
-
* matched, and `partial` when the hub stopped reading at its scan bound (`
|
|
257
|
+
* matched, and `partial` when the hub stopped reading at its scan bound (`FNLOOM_QUERY_SCAN`): more rows may match,
|
|
258
258
|
* `total` is a lower bound, and a narrower filter (a date range, a system) gives the full answer.
|
|
259
259
|
*/
|
|
260
260
|
export const QueryFnResult = page(z.json()).extend({
|
|
@@ -120,7 +120,7 @@ export const INPUT_ANSWER_TAG = 'input-answer';
|
|
|
120
120
|
* suggestions. Undoing the turn takes the fns out of the tools again.
|
|
121
121
|
*
|
|
122
122
|
* `by: 'recall'` is the hub's own memory recall (iteration 4, `chat/enrich.ts`): the person's memories whose meaning is
|
|
123
|
-
* closest to the message, at or over `
|
|
123
|
+
* closest to the message, at or over `FNLOOM_RECALL_THRESHOLD`, brought in as their text (no fns), each once a chat,
|
|
124
124
|
* whatever picks suggestions. A memory is not otherwise in front of the model in a new chat.
|
|
125
125
|
*/
|
|
126
126
|
export const LoadedForYouPart = z.object({
|
|
@@ -50,7 +50,7 @@ export const Run = z.object({
|
|
|
50
50
|
status: RunStatus,
|
|
51
51
|
/**
|
|
52
52
|
* It was made while its system wasn't connected (the hub restarting, the system coming back): it waits queued, and its
|
|
53
|
-
* approval is asked only once the system connects (`
|
|
53
|
+
* approval is asked only once the system connects (`FNLOOM_RUN_SYSTEM_WAIT`). False once it went ahead.
|
|
54
54
|
*/
|
|
55
55
|
awaitingSystem: z.boolean().optional(),
|
|
56
56
|
/** What it says it is doing, resolved from its fn's status templates when it last changed phase. */
|
|
@@ -18,6 +18,10 @@ export const OLLAMA_BASE_URL = 'http://127.0.0.1:11434';
|
|
|
18
18
|
export function providerVariants<S extends z.ZodType<string>>(secret: S) {
|
|
19
19
|
return z.discriminatedUnion('provider', [
|
|
20
20
|
z.object({ provider: z.literal('openai'), apiKey: secret, baseURL: z.url().optional() }),
|
|
21
|
+
/** Anthropic's Messages API (`@aeye/anthropic`): Claude with an Anthropic API key. */
|
|
22
|
+
z.object({ provider: z.literal('anthropic'), apiKey: secret }),
|
|
23
|
+
/** Google's Gemini API (`@aeye/google`): Gemini with a Google AI Studio API key. */
|
|
24
|
+
z.object({ provider: z.literal('google'), apiKey: secret }),
|
|
21
25
|
z.object({ provider: z.literal('openrouter'), apiKey: secret }),
|
|
22
26
|
/**
|
|
23
27
|
* A local Ollama, no key: chat through its OpenAI-compatible `/v1`, limits and abilities read from `/api/show`.
|
|
@@ -50,14 +50,15 @@ export type VisualChannel = z.infer<typeof VisualChannel>;
|
|
|
50
50
|
* The closed list of conditions a visual's data must meet beyond its channels (widget pass), judged over the column
|
|
51
51
|
* facts (`columnFacts`), so the hub, an agent and the browser judge a fit alike without running a system's code:
|
|
52
52
|
*
|
|
53
|
-
* - `distinct`: the column bound to `channel` has at most `max` distinct values (a pie's slices)
|
|
53
|
+
* - `distinct`: the column bound to `channel` has at most `max` distinct values (a pie's slices), and at least `min`
|
|
54
|
+
* when given (a radar needs three axes).
|
|
54
55
|
* - `non-negative`: every value bound to `channel` is 0 or more (slices, funnels).
|
|
55
56
|
* - `bounded`: the value bound to `channel` has a known range (its type's min and max, or a bound `max` channel).
|
|
56
57
|
* - `distinct-columns`: the channels bind different columns (a sankey's source and target).
|
|
57
58
|
* - `links`: the values bound to `to` are values bound to `from` (a parent column naming rows: a tree).
|
|
58
59
|
*/
|
|
59
60
|
export const VisualRule = z.discriminatedUnion('rule', [
|
|
60
|
-
z.object({ rule: z.literal('distinct'), channel: LocalName, max: z.number().int().min(1) }),
|
|
61
|
+
z.object({ rule: z.literal('distinct'), channel: LocalName, max: z.number().int().min(1), min: z.number().int().min(1).optional() }),
|
|
61
62
|
z.object({ rule: z.literal('non-negative'), channel: LocalName }),
|
|
62
63
|
z.object({ rule: z.literal('bounded'), channel: LocalName }),
|
|
63
64
|
z.object({ rule: z.literal('distinct-columns'), channels: z.array(LocalName).min(2) }),
|
|
@@ -78,13 +79,18 @@ export type VisualSizeStrategy = z.infer<typeof VisualSizeStrategy>;
|
|
|
78
79
|
/**
|
|
79
80
|
* One style of a visual family, which the style picker offers (bar, stacked, 100%, horizontal): the same bindings,
|
|
80
81
|
* drawn another way. `whole` marks a style that states shares of the whole (100% bars), offered only for a whole
|
|
81
|
-
* result; `needs` names channels this style must have bound (a bubble's size).
|
|
82
|
+
* result; `needs` names channels this style must have bound (a bubble's size). `columns` bounds how many columns a
|
|
83
|
+
* channel binds for this style (a waterfall draws one measure and no series: `{ y: { max: 1 }, series: { max: 0 } }`;
|
|
84
|
+
* bars with a line need two measures: `{ y: { min: 2 } }`), and `rules` are rules judged only for this style (a radar
|
|
85
|
+
* needs three to sixteen categories). Ranking offers only the styles that pass (`styleProblems` in `visuals.ts`).
|
|
82
86
|
*/
|
|
83
87
|
export const VisualStyle = z.object({
|
|
84
88
|
name: LocalName,
|
|
85
89
|
label: z.string().min(1),
|
|
86
90
|
whole: z.literal(true).optional(),
|
|
87
91
|
needs: z.array(LocalName).optional(),
|
|
92
|
+
columns: z.record(LocalName, z.object({ min: z.number().int().min(0).optional(), max: z.number().int().min(0).optional() })).optional(),
|
|
93
|
+
rules: z.array(VisualRule).optional(),
|
|
88
94
|
});
|
|
89
95
|
export type VisualStyle = z.infer<typeof VisualStyle>;
|
|
90
96
|
|
package/packages/core/src/sso.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* - **Generic OIDC only.** A provider is an issuer (or its discovery URL), a client id and, for a confidential client,
|
|
5
5
|
* a secret. The relying party is `@ayepi/auth/oauth`'s `OidcClient`; nothing here knows any one provider.
|
|
6
|
-
* - **Env vars only.** Providers come from `
|
|
6
|
+
* - **Env vars only.** Providers come from `FNLOOM_SSO_PROVIDERS` (`IdentityProviderConfigs`, JSON). The admin page shows
|
|
7
7
|
* them read-only, with a check and a test sign-in.
|
|
8
8
|
* - **First sign-in is the admin's setting** (`SignInPolicy`): invite only, allowed email domains, or anyone.
|
|
9
9
|
* - **Linking** to an existing person is by email only when the provider says `email_verified` is true.
|
|
@@ -42,7 +42,7 @@ export function managesRole(map: SsoClaimMap): boolean {
|
|
|
42
42
|
return map.admin.length > 0 || map.member !== undefined;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
/** One OpenID provider, as `
|
|
45
|
+
/** One OpenID provider, as `FNLOOM_SSO_PROVIDERS` declares it. */
|
|
46
46
|
export const IdentityProviderConfig = z.object({
|
|
47
47
|
id: SsoProviderId,
|
|
48
48
|
/** What its button says: "Continue with <label>". */
|
|
@@ -317,7 +317,7 @@ export const StoreMove = z.object({
|
|
|
317
317
|
});
|
|
318
318
|
export type StoreMove = z.infer<typeof StoreMove>;
|
|
319
319
|
|
|
320
|
-
/** How long a move gives running runs to finish before it asks the admin (`
|
|
320
|
+
/** How long a move gives running runs to finish before it asks the admin (`FNLOOM_STORE_MOVE_DRAIN`). */
|
|
321
321
|
export const STORE_MOVE_DRAIN = 60_000;
|
|
322
322
|
|
|
323
323
|
/** How many bytes of a SQLite copy cross the link in one chunk (before base64). */
|
|
@@ -119,7 +119,7 @@ export type SuggestionChooser = z.infer<typeof SuggestionChooser>;
|
|
|
119
119
|
/**
|
|
120
120
|
* The suggestions setting (admins), one choice:
|
|
121
121
|
* - `none`: no model picks (the default): the best candidates by similarity of meaning at or over the hub's
|
|
122
|
-
* `
|
|
122
|
+
* `FNLOOM_SUGGEST_THRESHOLD` are suggested, up to `FNLOOM_SUGGESTIONS`.
|
|
123
123
|
* - `decision`: a decision model (`model`, else the `decide` role's) answers one yes/no question per candidate; those
|
|
124
124
|
* at or over the decide role's threshold are picked, most likely first. Calls are split by the model's `maxQuestions`.
|
|
125
125
|
* - `llm`: a chat model (`model`) reads the candidates and answers which to pick, as JSON, with reasons.
|
|
@@ -173,7 +173,7 @@ export type SearchJudge = z.infer<typeof SearchJudge>;
|
|
|
173
173
|
*
|
|
174
174
|
* A model's `action` (default `suggest`: the kept hits are returned, for the model to load) may be `load`: when
|
|
175
175
|
* `hub/fns_search` / `hub/ctx_search` runs in a chat, the best kept hits that can be used there are loaded too (fns into the tools,
|
|
176
|
-
* context into the session, as `hub/fns_load` and `hub/ctx_load` load them), up to `
|
|
176
|
+
* context into the session, as `hub/fns_load` and `hub/ctx_load` load them), up to `FNLOOM_SEARCH_LOAD_MAX` of each
|
|
177
177
|
* kind, and the page says what (`FnSearchPage.loaded`). The web's search only filters; a failed filter loads nothing.
|
|
178
178
|
*/
|
|
179
179
|
export const SearchDecision = z.discriminatedUnion('by', [
|
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
* open it, and the name of the Vue component its client build draws it with (`client({ pages })`). The hub lists the
|
|
5
5
|
* pages of live systems a person may see (`SystemPageView`), so the nav and the routes follow the systems: a page is
|
|
6
6
|
* there while its system is installed and live, and gone when the system is switched off or removed.
|
|
7
|
+
*
|
|
8
|
+
* A page sits in the app (`/s/<system>/<segment>`) or, with `area: 'admin'`, in the admin area
|
|
9
|
+
* (`/admin/s/<system>/<segment>`, under the admin nav): an admin page is for admins only, and a `main` one shows in
|
|
10
|
+
* the admin nav's Systems group while its system is live (the MCP servers and API services pages).
|
|
7
11
|
*/
|
|
8
12
|
import { z } from 'zod';
|
|
9
13
|
import { InstanceName, SystemName } from './primitives.ts';
|
|
@@ -13,13 +17,21 @@ export const PageSegment = z.string().regex(/^[a-z][a-z0-9-]{0,39}$/, 'a page se
|
|
|
13
17
|
export type PageSegment = z.infer<typeof PageSegment>;
|
|
14
18
|
|
|
15
19
|
/**
|
|
16
|
-
* Where a page shows in the nav: `main` in the sidebar
|
|
17
|
-
* link (a detail page such as one session).
|
|
20
|
+
* Where a page shows in the nav: `main` in its area's nav (the sidebar for an app page, the admin nav for an admin
|
|
21
|
+
* page); `hidden` nowhere, reached only by a link (a detail page such as one session).
|
|
18
22
|
*/
|
|
19
23
|
export const SYSTEM_PAGE_NAVS = ['main', 'hidden'] as const;
|
|
20
24
|
export const SystemPageNav = z.enum(SYSTEM_PAGE_NAVS);
|
|
21
25
|
export type SystemPageNav = z.infer<typeof SystemPageNav>;
|
|
22
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Where a page is drawn: `app` with the app's own pages (`/s/<system>/<segment>`), or `admin` in the admin area
|
|
29
|
+
* (`/admin/s/<system>/<segment>`), which only admins open whatever `access` says.
|
|
30
|
+
*/
|
|
31
|
+
export const SYSTEM_PAGE_AREAS = ['app', 'admin'] as const;
|
|
32
|
+
export const SystemPageArea = z.enum(SYSTEM_PAGE_AREAS);
|
|
33
|
+
export type SystemPageArea = z.infer<typeof SystemPageArea>;
|
|
34
|
+
|
|
23
35
|
/** Who may open a page: every person who sees the system, or admins only. */
|
|
24
36
|
export const SYSTEM_PAGE_ACCESS = ['everyone', 'admin'] as const;
|
|
25
37
|
export const SystemPageAccess = z.enum(SYSTEM_PAGE_ACCESS);
|
|
@@ -36,11 +48,16 @@ export const SystemPageDecl = z.object({
|
|
|
36
48
|
icon: z.string().min(1).optional(),
|
|
37
49
|
nav: SystemPageNav.default('main'),
|
|
38
50
|
access: SystemPageAccess.default('everyone'),
|
|
51
|
+
/**
|
|
52
|
+
* Where it is drawn; absent is `app`. Optional with no default, so a contract that leaves it out keeps the manifest
|
|
53
|
+
* (and its hash) it had before areas existed.
|
|
54
|
+
*/
|
|
55
|
+
area: SystemPageArea.optional(),
|
|
39
56
|
/** The component in the client build's `client({ pages })` that draws it. */
|
|
40
57
|
component: z.string().min(1),
|
|
41
58
|
});
|
|
42
59
|
export type SystemPageDecl = z.infer<typeof SystemPageDecl>;
|
|
43
|
-
/** A page as an author writes it: `nav` and `
|
|
60
|
+
/** A page as an author writes it: `nav`, `access` and `area` may be left out. */
|
|
44
61
|
export type SystemPageInput = z.input<typeof SystemPageDecl>;
|
|
45
62
|
|
|
46
63
|
/** The problems with a contract's pages: segments must be unique. Empty when they fit. */
|
|
@@ -79,7 +96,16 @@ export const PageInstance = z.object({
|
|
|
79
96
|
});
|
|
80
97
|
export type PageInstance = z.infer<typeof PageInstance>;
|
|
81
98
|
|
|
82
|
-
/**
|
|
83
|
-
export function
|
|
84
|
-
return
|
|
99
|
+
/** Whether only admins may open a page: an admin-only one, or any page of the admin area. */
|
|
100
|
+
export function adminOnlyPage(page: Pick<SystemPageDecl, 'access' | 'area'>): boolean {
|
|
101
|
+
return page.access === 'admin' || page.area === 'admin';
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The path of a system page (`/s/claude/sessions`), with the parts under it (`/s/claude/session/main/abc`); an admin
|
|
106
|
+
* page's is under `/admin` (`/admin/s/mcp/servers`).
|
|
107
|
+
*/
|
|
108
|
+
export function systemPagePath(system: SystemName | string, segment: string, path: readonly string[] = [], area: SystemPageArea = 'app'): string {
|
|
109
|
+
const page = ['', 's', system, segment, ...path].map(encodeURIComponent).join('/');
|
|
110
|
+
return area === 'admin' ? `/admin${page}` : page;
|
|
85
111
|
}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Result tables shown to a person (generic: the chat's run cards, the Data page's records and any system's view draw
|
|
3
|
+
* them, with or without the widgets system): what a shown result carries besides its rows (the visuals it offers, its
|
|
4
|
+
* pager, the range args a chart drives, row actions and a drill, whether it is live), the hub's row actions, table
|
|
5
|
+
* reads and streamed export, how the chat model reads a table, and the rules every row action follows. The widgets
|
|
6
|
+
* system's own contract (`WidgetSpec`, its arg plans, chips and presets, `WidgetResult`, `make_widget`'s proposal) is
|
|
7
|
+
* in `systems/widgets/shared/spec.ts` (moved out of `@harness/core` on 2026-11-29); only the hub's one-time migration's
|
|
8
|
+
* parts stay here (`widgets-v1.ts`).
|
|
9
|
+
*
|
|
10
|
+
* Actions are derived, never listed by hand: every method of a row's type is offered, and a view may narrow them, add
|
|
11
|
+
* any fn bound to columns, relabel them and declare a drill. Anything that is not a read confirms first (`confirmOf`);
|
|
12
|
+
* a write with a form shows the form, then the confirm. What follows is derived (`deriveThen`).
|
|
13
|
+
*/
|
|
14
|
+
import { z } from 'zod';
|
|
15
|
+
import { GinTypeDef } from './gin.ts';
|
|
16
|
+
import { humanize } from './labels.ts';
|
|
17
|
+
import { FnMode } from './manifest.ts';
|
|
18
|
+
import { partialNote } from './partial.ts';
|
|
19
|
+
import { InstanceName, Json, LocalName, QualifiedName, RunId } from './primitives.ts';
|
|
20
|
+
import { ResultTable } from './registries.ts';
|
|
21
|
+
import { ResultFacts, VisualBinding } from './visuals.ts';
|
|
22
|
+
|
|
23
|
+
// ─── What a shown result carries ──────────────────────────────────────────────
|
|
24
|
+
|
|
25
|
+
/** A source's range args a visual's range claim drives (a calendar's month, a zoomed time axis). */
|
|
26
|
+
export const RangeArgs = z.object({ from: LocalName, to: LocalName });
|
|
27
|
+
export type RangeArgs = z.infer<typeof RangeArgs>;
|
|
28
|
+
|
|
29
|
+
/** A source's paging args, which the buffered pager drives. */
|
|
30
|
+
export const PagingArgs = z.object({ offset: LocalName, limit: LocalName });
|
|
31
|
+
export type PagingArgs = z.infer<typeof PagingArgs>;
|
|
32
|
+
|
|
33
|
+
/** One visual a result offers: its name in `HUB_VISUALS`, the style shown, and the columns bound to each channel. */
|
|
34
|
+
export const OfferedVisual = z.object({
|
|
35
|
+
visual: LocalName,
|
|
36
|
+
style: LocalName,
|
|
37
|
+
/** The switcher's label instead of the visual's. */
|
|
38
|
+
label: z.string().min(1).optional(),
|
|
39
|
+
/** Channel → columns; a channel left out takes the default binding (`rankVisuals`). Bindings carry over between styles. */
|
|
40
|
+
bind: VisualBinding,
|
|
41
|
+
});
|
|
42
|
+
export type OfferedVisual = z.infer<typeof OfferedVisual>;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* What follows an action: `open` its rows as a new level (with a breadcrumb back), `refresh` the view, or a `status`
|
|
46
|
+
* line. Derived (`deriveThen`): rows returned open, a write refreshes, anything else is a status line.
|
|
47
|
+
*/
|
|
48
|
+
export const ActionThen = z.enum(['open', 'refresh', 'status']);
|
|
49
|
+
export type ActionThen = z.infer<typeof ActionThen>;
|
|
50
|
+
|
|
51
|
+
/** One action a view keeps, relabels or confirms: a method of the row's type, or any fn with args bound to columns. */
|
|
52
|
+
export const RowAction = z.object({
|
|
53
|
+
/** The fn: a type method (`fs/Entry.reveal`) or any fn. */
|
|
54
|
+
fn: QualifiedName,
|
|
55
|
+
label: z.string().min(1).optional(),
|
|
56
|
+
/** `true` asks before running even a read. Writes and deletes always ask. */
|
|
57
|
+
confirm: z.literal(true).optional(),
|
|
58
|
+
/** Argument → the column whose value it takes from the row (`self` for a method is bound by the row's type). */
|
|
59
|
+
bind: z.record(LocalName, z.string().min(1)),
|
|
60
|
+
/** Instead of the derived `then`. */
|
|
61
|
+
then: ActionThen.optional(),
|
|
62
|
+
});
|
|
63
|
+
export type RowAction = z.infer<typeof RowAction>;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* What clicking a bar, slice, point or row runs: a read fn returning a table, its args from the clicked row's columns,
|
|
67
|
+
* opened as a new level with a breadcrumb. Without one, a click opens the drill its rows declare, else the row's menu.
|
|
68
|
+
*/
|
|
69
|
+
export const RowDrill = z.object({ fn: QualifiedName, label: z.string().min(1), bind: z.record(LocalName, z.string().min(1)) });
|
|
70
|
+
export type RowDrill = z.infer<typeof RowDrill>;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* How the buffered pager asks for more: the paging args, the window the run applied (`limit`), and whether more may
|
|
74
|
+
* follow (a full window means there may be; a short one is the last). The pager pages locally through what it holds and
|
|
75
|
+
* runs the source again (offset = rows held) only when a page needs rows it lacks.
|
|
76
|
+
*/
|
|
77
|
+
export const ShownPager = z.object({ offset: LocalName, limit: LocalName, window: z.number().int().min(1), more: z.boolean() });
|
|
78
|
+
export type ShownPager = z.infer<typeof ShownPager>;
|
|
79
|
+
|
|
80
|
+
/** An action as a row's menu offers it: derived from the fn, narrowed and labelled by the view. */
|
|
81
|
+
export const RowActionOption = z.object({
|
|
82
|
+
fn: QualifiedName,
|
|
83
|
+
label: z.string().min(1),
|
|
84
|
+
mode: FnMode,
|
|
85
|
+
confirm: z.boolean(),
|
|
86
|
+
bind: z.record(LocalName, z.string().min(1)),
|
|
87
|
+
/** The args left for a form after binding (shown first; the confirm follows for anything above a read). */
|
|
88
|
+
form: GinTypeDef.optional(),
|
|
89
|
+
then: ActionThen,
|
|
90
|
+
});
|
|
91
|
+
export type RowActionOption = z.infer<typeof RowActionOption>;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* A fn's result that is rows shown with more than the rows (a widget's run is one): its title, the table and its facts,
|
|
95
|
+
* the source run that made it (so the pager and refresh can ask again), the visuals it offers in its order, what no
|
|
96
|
+
* longer fits, its range args, pager, row actions and drill, whether the rows came from a write (no fetching more, no
|
|
97
|
+
* drill; "Run again" asks first), how often it re-runs while shown, and one line for the chat model. The result view
|
|
98
|
+
* draws any of these, with or without the system that made it; a system may carry more (a widget's chips) and draw
|
|
99
|
+
* them itself around the app's result view.
|
|
100
|
+
*/
|
|
101
|
+
export const ShownResult = z.object({
|
|
102
|
+
title: z.string().min(1),
|
|
103
|
+
table: ResultTable,
|
|
104
|
+
/** The table's column facts (`columnFacts`, with the source's gin facts); the pager works them out again as it grows. */
|
|
105
|
+
facts: ResultFacts,
|
|
106
|
+
source: z.object({ fn: QualifiedName, run: RunId, args: z.record(z.string(), Json) }),
|
|
107
|
+
/** The visuals offered that still fit, in order; the table always last. */
|
|
108
|
+
visuals: z.array(OfferedVisual).min(1),
|
|
109
|
+
/** Bindings that no longer fit (a column gone or of another kind), in words; it still draws. */
|
|
110
|
+
problems: z.array(z.string()),
|
|
111
|
+
range: RangeArgs.optional(),
|
|
112
|
+
paging: ShownPager.optional(),
|
|
113
|
+
/** The actions on rows of the table's row types, narrowed. */
|
|
114
|
+
actions: z.array(RowActionOption),
|
|
115
|
+
drill: RowDrill.optional(),
|
|
116
|
+
/** The rows came from a write (`table.write`): no fetching more, no drill; "Run again" asks first. */
|
|
117
|
+
readOnly: z.boolean(),
|
|
118
|
+
/** How often the view re-runs it while shown, when it is live (never below the hub's floor). */
|
|
119
|
+
live: z.object({ every: z.number().int().min(1) }).optional(),
|
|
120
|
+
/** One line for the chat model ("Bar chart of count by stage, 12 rows"); `tableModelView` adds who sees the rows. */
|
|
121
|
+
summary: z.string().min(1),
|
|
122
|
+
});
|
|
123
|
+
export type ShownResult = z.infer<typeof ShownResult>;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* A result that proposes something for the person to keep (a widget proposal), with the result its preview draws;
|
|
127
|
+
* nothing is kept until they press the proposing system's Save.
|
|
128
|
+
*/
|
|
129
|
+
export const PreviewProposal = z.object({
|
|
130
|
+
name: LocalName,
|
|
131
|
+
description: z.string().min(1),
|
|
132
|
+
preview: ShownResult,
|
|
133
|
+
/** What it changes, when it edits one. */
|
|
134
|
+
replaces: z.string().min(1).optional(),
|
|
135
|
+
});
|
|
136
|
+
export type PreviewProposal = z.infer<typeof PreviewProposal>;
|
|
137
|
+
|
|
138
|
+
// ─── Fns and routes ───────────────────────────────────────────────────────────
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* The actions offered on rows of these types (hub `rowActions` and `hub/row_actions`), narrowed by a view's list. With
|
|
142
|
+
* no row types (a source with no records type or ref columns) only the fns the view binds are offered.
|
|
143
|
+
*/
|
|
144
|
+
export const RowActionsQuery = z.object({ types: z.array(QualifiedName).max(20), narrow: z.array(RowAction).optional() })
|
|
145
|
+
.refine((query) => query.types.length > 0 || (query.narrow?.length ?? 0) > 0, { message: 'name a row type or an action to offer' });
|
|
146
|
+
export type RowActionsQuery = z.infer<typeof RowActionsQuery>;
|
|
147
|
+
|
|
148
|
+
/** `hub/read_table`: run a read fn that returns a table, as a child run of the caller, as its person. */
|
|
149
|
+
export const ReadTableArgs = z.object({ fn: QualifiedName, args: z.record(z.string(), Json) });
|
|
150
|
+
export type ReadTableArgs = z.infer<typeof ReadTableArgs>;
|
|
151
|
+
|
|
152
|
+
/** The web's quiet read (`readFn`): a read fn and its args, and for a fleet the instance it runs on (`on`, else the hub picks). */
|
|
153
|
+
export const ReadFnArgs = ReadTableArgs.extend({ on: InstanceName.optional() });
|
|
154
|
+
export type ReadFnArgs = z.infer<typeof ReadFnArgs>;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* The hub's streamed export (`GET /api/export`): a read fn, its args as JSON text, its paging args, and the format. The
|
|
158
|
+
* hub runs it page by page as the person, writes each page and lets it go, and ends a file cut at the row ceiling with a
|
|
159
|
+
* line saying so.
|
|
160
|
+
*/
|
|
161
|
+
export const ExportQuery = z.object({ fn: QualifiedName, args: z.string(), offset: LocalName, limit: LocalName, format: z.literal('csv') });
|
|
162
|
+
export type ExportQuery = z.infer<typeof ExportQuery>;
|
|
163
|
+
|
|
164
|
+
// ─── Routing ──────────────────────────────────────────────────────────────────
|
|
165
|
+
|
|
166
|
+
/** The clause the chat's fn line gets for a fn whose declared return is a `ResultTable`. */
|
|
167
|
+
export const RESULT_TABLE_ROUTING = 'returns a table; the chat draws it as a chart, calendar, cards or a table chosen from its columns, every other fitting visual one click away';
|
|
168
|
+
|
|
169
|
+
/** The short instruction beside those lines. */
|
|
170
|
+
export const RESULT_TABLE_INSTRUCTION = 'To show data as a chart or table, call a fn that returns a table; never write a chart yourself. To keep one, call widgets/make_widget with that fn.';
|
|
171
|
+
|
|
172
|
+
/** What the chat model sees of a table result: one line, the columns, and the first rows. */
|
|
173
|
+
export const TableModelView = z.object({
|
|
174
|
+
summary: z.string(), columns: z.array(z.string()), rows: z.array(z.array(Json)), more: z.number().int().min(0),
|
|
175
|
+
/** When the model reads fewer rows than there are: which rows it has, how many were left out and how to read them (`partialNote`). */
|
|
176
|
+
partial: z.string().optional(),
|
|
177
|
+
});
|
|
178
|
+
export type TableModelView = z.infer<typeof TableModelView>;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* How the chat model reads table results in one run: how many rows it gets, and whether a person is watching
|
|
182
|
+
* (`RunInfo.watched`), so the table is drawn for them. Unwatched (a nested agent, a background or scheduled run) no one
|
|
183
|
+
* sees the rows, so the model gets more of them and answers from those.
|
|
184
|
+
*/
|
|
185
|
+
export interface TableReading {
|
|
186
|
+
readonly rows: number;
|
|
187
|
+
readonly watched: boolean;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* A table result as the chat model sees it: the summary with who sees the rows, the column names and the first
|
|
192
|
+
* `reading.rows` rows. Watched, the person has the whole table; unwatched, the summary says no one sees them.
|
|
193
|
+
*/
|
|
194
|
+
export function tableModelView(summary: string, table: ResultTable, reading: TableReading): TableModelView {
|
|
195
|
+
const rows = table.rows.slice(0, reading.rows);
|
|
196
|
+
const more = table.rows.length - rows.length;
|
|
197
|
+
const held = more > 0 ? `: answer from the first ${String(rows.length)}, and say the answer covers only those` : `: answer from them`;
|
|
198
|
+
const seen = reading.watched ? `${summary}, shown to the person` : `${summary}. Nobody is watching this run, so no one sees them${held}`;
|
|
199
|
+
// rows nobody sees (held back from an unwatched run, or past this page): the view says how many and how to read them;
|
|
200
|
+
// a watched run's person has the whole page, and `more` counts what the model was not given
|
|
201
|
+
const total = table.total ?? (table.truncated ? undefined : table.offset + table.rows.length);
|
|
202
|
+
const rest = `run it again narrower${table.truncated ? ` or from offset ${String(table.offset + table.rows.length)}` : ''}`;
|
|
203
|
+
const partial = (more > 0 && !reading.watched) || table.truncated
|
|
204
|
+
? partialNote({ unit: 'rows', offset: table.offset, shown: rows.length, ...(total === undefined ? {} : { total }), rest })
|
|
205
|
+
: undefined;
|
|
206
|
+
return { summary: seen, columns: table.columns.map((column) => column.name), rows, more, ...(partial === undefined ? {} : { partial }) };
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/** How many rows a table holds, as the model reads it: "12 rows (more held back)". */
|
|
210
|
+
export function rowsLine(table: Pick<ResultTable, 'rows' | 'truncated'>): string {
|
|
211
|
+
const count = table.rows.length === 1 ? '1 row' : `${String(table.rows.length)} rows`;
|
|
212
|
+
return `${count}${table.truncated ? ' (more held back)' : ''}`;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// ─── Rules ────────────────────────────────────────────────────────────────────
|
|
216
|
+
|
|
217
|
+
/** Whether an action asks first: always for anything that is not a read, else when the view says so. */
|
|
218
|
+
export function confirmOf(mode: FnMode, declared: true | undefined): boolean {
|
|
219
|
+
return mode !== 'read' || declared === true;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/** What follows an action by default: rows returned open a new level, a write refreshes, else a status line. */
|
|
223
|
+
export function deriveThen(mode: FnMode, returnsTable: boolean): ActionThen {
|
|
224
|
+
if (returnsTable) { return 'open'; }
|
|
225
|
+
return mode === 'read' ? 'status' : 'refresh';
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/** A method, fn or arg name as a label: `mark_done` → "Mark done", `Task.archive` → "Archive", `owner_id` → "Owner ID". */
|
|
229
|
+
export function actionLabel(fn: string): string {
|
|
230
|
+
const last = fn.split(/[/.]/).pop() ?? fn;
|
|
231
|
+
return humanize(last) || fn;
|
|
232
|
+
}
|
|
233
|
+
|