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
|
@@ -28,16 +28,16 @@ export const resourcesModule: ModuleFactory<'resources'> = ({ hub, hubActor }) =
|
|
|
28
28
|
const settings = hub.settings.resourcesEnv;
|
|
29
29
|
const { store, log, clock, bus } = hub;
|
|
30
30
|
const content = hub.api.content;
|
|
31
|
-
const converters = new RegistryConverters({ maxRows: settings.
|
|
31
|
+
const converters = new RegistryConverters({ maxRows: settings.FNLOOM_TABLE_ROWS });
|
|
32
32
|
const models = new HubFormModels({ roles: () => hub.models.roles, llm: () => hub.execution.llm, gateway: () => hub.models.gateway });
|
|
33
33
|
const raw = new LinkRawReader({
|
|
34
|
-
source: (uri) => linkSource(hub.link.resources, hub.link.connections, uri), stat: (uri) => hub.link.resources.stat(uri), content, maxChunk: hub.settings.linkEnv.
|
|
34
|
+
source: (uri) => linkSource(hub.link.resources, hub.link.connections, uri), stat: (uri) => hub.link.resources.stat(uri), content, maxChunk: hub.settings.linkEnv.FNLOOM_MAX_CHUNK,
|
|
35
35
|
});
|
|
36
36
|
const forms = new StoreFormService({
|
|
37
37
|
store, content, raw, converters, models, log, clock, settings,
|
|
38
38
|
onForms: (record) => { bus.publish('resource.forms', { uri: record.uri, forms: badges(record) }); },
|
|
39
39
|
});
|
|
40
|
-
const reader = new FormReader({ store, content, forms, readChars: settings.
|
|
40
|
+
const reader = new FormReader({ store, content, forms, readChars: settings.FNLOOM_READ_CHARS });
|
|
41
41
|
const fetcher = new WebSystemFetcher({
|
|
42
42
|
webConnected: () => hub.link.connections.connection(WEB) !== undefined, runs: () => hub.execution.runs, content, hubActor,
|
|
43
43
|
fallback: new LibraryFetcher({ converters, settings }),
|
|
@@ -53,8 +53,8 @@ export const resourcesModule: ModuleFactory<'resources'> = ({ hub, hubActor }) =
|
|
|
53
53
|
decider: () => hub.models.decider, llm: () => hub.execution.llm, metadataModel: () => hub.models.roles.resolve('metadata'),
|
|
54
54
|
planModel: () => hub.models.roles.resolve('plan'), embedderReady: () => hub.index.embedders.active() !== undefined, runs: () => hub.execution.runs,
|
|
55
55
|
settings: {
|
|
56
|
-
batch: settings.
|
|
57
|
-
maxSplit: settings.
|
|
56
|
+
batch: settings.FNLOOM_CONTEXT_METADATA_BATCH, interval: settings.FNLOOM_CONTEXT_METADATA_INTERVAL,
|
|
57
|
+
maxSplit: settings.FNLOOM_CONTEXT_SPLIT_MAX, nearest: settings.FNLOOM_CONTEXT_DUPLICATE_NEAREST,
|
|
58
58
|
},
|
|
59
59
|
});
|
|
60
60
|
|
|
@@ -66,7 +66,7 @@ export const resourcesModule: ModuleFactory<'resources'> = ({ hub, hubActor }) =
|
|
|
66
66
|
},
|
|
67
67
|
primary: async (uri, signal) => {
|
|
68
68
|
try {
|
|
69
|
-
return await forms.primary(uri, { actor: hubActor }, { make: settings.
|
|
69
|
+
return await forms.primary(uri, { actor: hubActor }, { make: settings.FNLOOM_DESCRIBE_ON_INDEX, ...(signal === undefined ? {} : { signal }) });
|
|
70
70
|
} catch (error) {
|
|
71
71
|
// a system that sends no content for a resource (a file over its text cap) is still indexed, by name, as before
|
|
72
72
|
if (error instanceof ApiError && error.code === NO_CONTENT && !isHubUri(uri)) { return hub.link.resources.text(uri, signal); }
|
|
@@ -7,21 +7,21 @@ import { z } from 'zod';
|
|
|
7
7
|
|
|
8
8
|
/** Resource tunables. */
|
|
9
9
|
export const resourcesEnv = env({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
10
|
+
FNLOOM_CONTENT_AT: z.enum(['files', 'database']).default('files').describe('Where raw content and forms are kept: files under the data folder, or the hub\'s database.'),
|
|
11
|
+
FNLOOM_IMPORT_MAX: z.number().int().min(1).default(200 * 1024 * 1024).describe('The largest raw content the hub accepts, in bytes.'),
|
|
12
|
+
FNLOOM_SNAPSHOT_MAX: z.number().int().min(0).default(2 * 1024 * 1024 * 1024).describe('Bytes of system resources\' raw snapshots kept before the oldest are dropped (their forms are kept).'),
|
|
13
|
+
FNLOOM_TABLE_ROWS: z.number().int().min(10).default(5_000).describe('Rows kept per table in a `table` form; the real count is kept beside it.'),
|
|
14
|
+
FNLOOM_DESCRIBE_ON_INDEX: z.boolean().default(false).describe('Describe and read text in images while indexing (else only when someone reads them).'),
|
|
15
|
+
FNLOOM_READ_CHARS: z.number().int().min(100).max(200_000).default(20_000).describe('How many characters `hub/resource_read` gives when the caller doesn\'t say.'),
|
|
16
|
+
FNLOOM_FORM_CONCURRENCY: z.number().int().min(1).default(2).describe('Forms made at once.'),
|
|
17
|
+
FNLOOM_CONTEXT_METADATA_BATCH: z.number().int().min(1).max(100).default(4).describe('Context items the background job fills with metadata (and checks for duplicates) per pass.'),
|
|
18
|
+
FNLOOM_CONTEXT_METADATA_INTERVAL: z.number().int().min(10_000).default(5 * 60_000).describe('How often the context metadata job looks for work besides when context changes, in ms.'),
|
|
19
|
+
FNLOOM_CONTEXT_SPLIT_MAX: z.number().int().min(2).max(50).default(8).describe('The most items one context item is split into, one per question; an item answering more is kept whole.'),
|
|
20
|
+
FNLOOM_CONTEXT_DUPLICATE_NEAREST: z.number().int().min(1).max(50).default(10).describe('How many nearest context items the duplicate and contradiction check compares a new item with.'),
|
|
21
|
+
FNLOOM_CONTEXT_PIECE_TOKENS: z.number().int().min(50).default(600).describe('A section longer than this becomes a chain of context pieces (small-model friendly).'),
|
|
22
|
+
FNLOOM_FETCH_TIMEOUT: z.number().int().min(1_000).default(30_000).describe('How long a URL import waits when the web system isn\'t connected and the hub fetches itself.'),
|
|
23
|
+
FNLOOM_FETCH_REDIRECTS: z.number().int().min(0).default(8).describe('The most redirects a URL import the hub fetches itself follows.'),
|
|
24
|
+
FNLOOM_FETCH_PRIVATE: z.boolean().default(false).describe('Allow importing private and loopback addresses (off: the hub\'s own data can\'t be fetched by asking).'),
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
/** The parsed resource tunables. */
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* fetches it itself with `@aeye/resources`' `fetchResource` (no rendering).
|
|
6
6
|
*
|
|
7
7
|
* The hub's own fetch checks addresses with the SDK's rules (`addressVerdict`, the same the web system uses): it never
|
|
8
|
-
* reaches private, loopback, link-local or reserved addresses or local names unless `
|
|
8
|
+
* reaches private, loopback, link-local or reserved addresses or local names unless `FNLOOM_FETCH_PRIVATE` says so,
|
|
9
9
|
* redirects included (each hop's host is resolved and checked), so asking the LLM to fetch
|
|
10
10
|
* `http://127.0.0.1:4300/…` can't reach the hub's own data.
|
|
11
11
|
*/
|
|
@@ -59,7 +59,7 @@ export function guardedFetch(inner: FetchFn, rules: AddressRules, redirects: num
|
|
|
59
59
|
/** What the hub's own fetcher needs. */
|
|
60
60
|
export interface LibraryFetcherOptions {
|
|
61
61
|
readonly converters: Pick<Converters, 'typeOf'>;
|
|
62
|
-
readonly settings: Pick<ResourcesEnv, '
|
|
62
|
+
readonly settings: Pick<ResourcesEnv, 'FNLOOM_FETCH_TIMEOUT' | 'FNLOOM_FETCH_PRIVATE' | 'FNLOOM_FETCH_REDIRECTS' | 'FNLOOM_IMPORT_MAX'>;
|
|
63
63
|
/** The network fetch (default the global one). */
|
|
64
64
|
readonly fetch?: FetchFn;
|
|
65
65
|
/** The resolver hosts are checked with (default the machine's). */
|
|
@@ -73,14 +73,14 @@ export class LibraryFetcher implements UrlFetcher {
|
|
|
73
73
|
|
|
74
74
|
constructor(options: LibraryFetcherOptions) {
|
|
75
75
|
this.#o = options;
|
|
76
|
-
const rules: AddressRules = { lookup: options.lookup ?? systemLookup, allowPrivate: options.settings.
|
|
77
|
-
this.#fetch = guardedFetch(options.fetch ?? fetch, rules, options.settings.
|
|
76
|
+
const rules: AddressRules = { lookup: options.lookup ?? systemLookup, allowPrivate: options.settings.FNLOOM_FETCH_PRIVATE };
|
|
77
|
+
this.#fetch = guardedFetch(options.fetch ?? fetch, rules, options.settings.FNLOOM_FETCH_REDIRECTS);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
async fetch(url: string, _render: RenderMode, _who: Asking, signal?: AbortSignal): Promise<FetchedUrl> {
|
|
81
81
|
const { settings, converters } = this.#o;
|
|
82
82
|
const page = await fetchResource(url, { inferType: (location, mime) => converters.typeOf(location, mime) }, {
|
|
83
|
-
fetch: this.#fetch, timeoutMs: settings.
|
|
83
|
+
fetch: this.#fetch, timeoutMs: settings.FNLOOM_FETCH_TIMEOUT, maxBytes: settings.FNLOOM_IMPORT_MAX, render: 'never', ...(signal === undefined ? {} : { signal }),
|
|
84
84
|
});
|
|
85
85
|
return { bytes: page.source.input, mime: page.source.mimeType, finalUrl: page.url, rendered: false };
|
|
86
86
|
}
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
* are cheap and made on first look. A stored one is current while its converter is still the one that would run;
|
|
8
8
|
* a converter that declines is remembered for that hash, so raw text formats aren't asked again on every read.
|
|
9
9
|
* - **Model-made** forms (descriptions, text in images, transcripts) come from `FormModels`, only when asked for
|
|
10
|
-
* (or while indexing with `
|
|
10
|
+
* (or while indexing with `FNLOOM_DESCRIBE_ON_INDEX`), and are reused whatever model made them.
|
|
11
11
|
*
|
|
12
|
-
* One job per key runs at a time (two readers wait on one), at most `
|
|
12
|
+
* One job per key runs at a time (two readers wait on one), at most `FNLOOM_FORM_CONCURRENCY` at once, people's
|
|
13
13
|
* reads before indexing. The same bytes at two URIs share their forms. Each record's `forms` and `primary` follow
|
|
14
14
|
* what exists, and `onForms` hears when they change (the browser's badges).
|
|
15
15
|
*/
|
|
@@ -57,7 +57,7 @@ export interface StoreFormServiceOptions {
|
|
|
57
57
|
readonly models: FormModels;
|
|
58
58
|
readonly log: Logger;
|
|
59
59
|
readonly clock: () => number;
|
|
60
|
-
readonly settings: Pick<ResourcesEnv, '
|
|
60
|
+
readonly settings: Pick<ResourcesEnv, 'FNLOOM_IMPORT_MAX' | 'FNLOOM_FORM_CONCURRENCY'>;
|
|
61
61
|
/** Told when a record's forms or primary form changed. */
|
|
62
62
|
readonly onForms?: (record: ResourceRecord) => void;
|
|
63
63
|
}
|
|
@@ -80,7 +80,7 @@ export class StoreFormService implements FormService {
|
|
|
80
80
|
|
|
81
81
|
constructor(options: StoreFormServiceOptions) {
|
|
82
82
|
this.#o = options;
|
|
83
|
-
this.#doer = priorityDoer({ max: options.settings.
|
|
83
|
+
this.#doer = priorityDoer({ max: options.settings.FNLOOM_FORM_CONCURRENCY, now: options.clock });
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
async snapshot(uri: ResourceUri, _who: Asking): Promise<Snapshot> {
|
|
@@ -162,7 +162,7 @@ export class StoreFormService implements FormService {
|
|
|
162
162
|
const served = raw.bytes === undefined ? 'text' : 'bytes';
|
|
163
163
|
const bytes = raw.bytes ?? (raw.text === undefined ? undefined : utf8(raw.text));
|
|
164
164
|
if (bytes === undefined) { throw reject(422, NO_CONTENT, `${raw.system} sent no content for ${uri}`); }
|
|
165
|
-
if (bytes.length > settings.
|
|
165
|
+
if (bytes.length > settings.FNLOOM_IMPORT_MAX) { throw reject(413, 'TOO_LARGE', `${uri} is ${bytes.length} bytes, over the hub's ${settings.FNLOOM_IMPORT_MAX}`); }
|
|
166
166
|
// bytes are what their first bytes say, then what the system said, then what their name says
|
|
167
167
|
const mime = served === 'bytes' ? sniffMime(bytes) ?? raw.stat.mime ?? mimeOfName(raw.stat.name) ?? UNKNOWN_MIME : TEXT_MIME;
|
|
168
168
|
const ref = await content.put(bytes, mime);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* for people and LLMs, resources as message content, and context made from resources or written as memory.
|
|
4
4
|
*
|
|
5
5
|
* - **Raw content** of every resource the hub has read lives in the content store (`api`'s `ContentStore` over an
|
|
6
|
-
* ayepi `FileStore`): files under the data folder by default, or the hub's database (`
|
|
6
|
+
* ayepi `FileStore`): files under the data folder by default, or the hub's database (`FNLOOM_CONTENT_AT=database`,
|
|
7
7
|
* `SqliteFiles` in `sqlite-files.ts`, beside the store but outside `HUB_TABLES`; `openContentFiles` chooses).
|
|
8
8
|
* Hub resources (`hub://resources/…`: uploads, fetched pages, fn outputs) live only there; system resources keep a
|
|
9
9
|
* snapshot of what their system served, refetched when its version changes.
|
|
@@ -41,7 +41,7 @@ export interface HubResourceLibraryOptions {
|
|
|
41
41
|
readonly bus: EventBus;
|
|
42
42
|
readonly log: Logger;
|
|
43
43
|
readonly clock: () => number;
|
|
44
|
-
readonly settings: Pick<ResourcesEnv, '
|
|
44
|
+
readonly settings: Pick<ResourcesEnv, 'FNLOOM_IMPORT_MAX'>;
|
|
45
45
|
/** The hub's own actor: who keeps a fn's output. */
|
|
46
46
|
readonly hubActor: ActorId;
|
|
47
47
|
}
|
|
@@ -217,7 +217,7 @@ export class HubResourceLibrary implements ResourceLibrary {
|
|
|
217
217
|
|
|
218
218
|
/** Refuse content over the import cap. */
|
|
219
219
|
#checkSize(size: number): void {
|
|
220
|
-
const max = this.#o.settings.
|
|
220
|
+
const max = this.#o.settings.FNLOOM_IMPORT_MAX;
|
|
221
221
|
if (size > max) { throw reject(413, 'TOO_LARGE', `the hub keeps resources of up to ${max} bytes; this is ${size}`); }
|
|
222
222
|
}
|
|
223
223
|
|
|
@@ -63,7 +63,7 @@ export interface LinkRawReaderOptions {
|
|
|
63
63
|
readonly stat: (uri: ResourceUri) => Promise<ResourceStat | undefined>;
|
|
64
64
|
/** The hub's content store, where a system may have uploaded the bytes already. */
|
|
65
65
|
readonly content: Pick<ContentStore, 'has' | 'read'>;
|
|
66
|
-
/** The largest chunk asked for at once (`
|
|
66
|
+
/** The largest chunk asked for at once (`FNLOOM_MAX_CHUNK`). */
|
|
67
67
|
readonly maxChunk: number;
|
|
68
68
|
}
|
|
69
69
|
|
|
@@ -26,7 +26,7 @@ export interface FormReaderOptions {
|
|
|
26
26
|
readonly store: HubStore;
|
|
27
27
|
readonly content: ContentStore;
|
|
28
28
|
readonly forms: FormService;
|
|
29
|
-
/** How many characters a read gives when the caller doesn't say (`
|
|
29
|
+
/** How many characters a read gives when the caller doesn't say (`FNLOOM_READ_CHARS`). */
|
|
30
30
|
readonly readChars: number;
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -188,7 +188,7 @@ export class FormReader implements ResourceReader {
|
|
|
188
188
|
const table = version.tables[index];
|
|
189
189
|
if (table === undefined) { throw reject(404, 'NO_TABLE', `${uri} has no table ${rows.table} (it has ${version.tables.map((t, i) => t.name ?? String(i + 1)).join(', ')})`); }
|
|
190
190
|
const total = tableRowCounts(version)[index] ?? table.rows.length;
|
|
191
|
-
// the hub keeps the first `
|
|
191
|
+
// the hub keeps the first `FNLOOM_TABLE_ROWS` rows of a table (the library converts a sheet whole, with no row
|
|
192
192
|
// window); a range starting past them is refused, never answered empty as if the table ended there
|
|
193
193
|
if (rows.from >= table.rows.length && rows.from < total) {
|
|
194
194
|
throw reject(422, 'ROWS_NOT_KEPT', `${uri} keeps rows 0-${table.rows.length} of its ${total.toLocaleString('en-US')}; rows from ${rows.from} can't be read here (export the raw file for the rest)`);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A `FileStore` over a SQLite table, so a hub can keep raw content and forms in its database instead of files
|
|
3
|
-
* (`
|
|
3
|
+
* (`FNLOOM_CONTENT_AT=database`). One row per key in `content_blobs`: the bytes as a BLOB, the size, the media type,
|
|
4
4
|
* the user metadata as JSON text and the time it was written. The table is a file store, not a record table, so it
|
|
5
5
|
* lives outside `HUB_TABLES` and opens its own connection to the hub's database file (WAL lets both connections
|
|
6
6
|
* work at once).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Where the hub keeps raw content and forms: files under the data folder (`fsFiles`, the default) or the hub's
|
|
3
|
-
* database (`SqliteFiles`), by `
|
|
3
|
+
* database (`SqliteFiles`), by `FNLOOM_CONTENT_AT`. Everything above it (`FileContentStore`, `mountFiles`, presigned
|
|
4
4
|
* downloads with Range) takes any `FileStore`, so the choice is made here once, at boot, and nothing else changes.
|
|
5
5
|
*/
|
|
6
6
|
import { fsFiles } from '@ayepi/files/fs';
|
|
@@ -10,10 +10,10 @@ import { SqliteFiles } from './sqlite-files.ts';
|
|
|
10
10
|
|
|
11
11
|
/** What choosing the content store needs. */
|
|
12
12
|
export interface ContentFilesOptions {
|
|
13
|
-
readonly at: ResourcesEnv['
|
|
14
|
-
/** The files folder (`
|
|
13
|
+
readonly at: ResourcesEnv['FNLOOM_CONTENT_AT'];
|
|
14
|
+
/** The files folder (`FNLOOM_FILES_DIR`). */
|
|
15
15
|
readonly dir: string;
|
|
16
|
-
/** The hub's database file (`
|
|
16
|
+
/** The hub's database file (`FNLOOM_DB_FILE`). */
|
|
17
17
|
readonly database: string;
|
|
18
18
|
readonly busyTimeout: number;
|
|
19
19
|
readonly clock: () => number;
|
|
@@ -27,7 +27,7 @@ export interface ContentFiles {
|
|
|
27
27
|
close(): void;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
/** Open the content store `
|
|
30
|
+
/** Open the content store `FNLOOM_CONTENT_AT` names. */
|
|
31
31
|
export function openContentFiles(options: ContentFilesOptions): ContentFiles {
|
|
32
32
|
switch (options.at) {
|
|
33
33
|
case 'files':
|
|
@@ -201,13 +201,13 @@ export async function resourcesRig(options: { pieceTokens?: number; maxRows?: nu
|
|
|
201
201
|
const fetcher = new MapFetcher();
|
|
202
202
|
const changed: string[] = [];
|
|
203
203
|
const settings = {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
204
|
+
FNLOOM_CONTENT_AT: 'files', FNLOOM_IMPORT_MAX: 10 * 1024 * 1024, FNLOOM_SNAPSHOT_MAX: 1024 * 1024 * 1024, FNLOOM_TABLE_ROWS: options.maxRows ?? 5_000,
|
|
205
|
+
FNLOOM_DESCRIBE_ON_INDEX: false, FNLOOM_FORM_CONCURRENCY: 2, FNLOOM_READ_CHARS: 20_000, FNLOOM_CONTEXT_PIECE_TOKENS: options.pieceTokens ?? 600, FNLOOM_FETCH_TIMEOUT: 5_000,
|
|
206
|
+
FNLOOM_FETCH_REDIRECTS: 8, FNLOOM_FETCH_PRIVATE: false,
|
|
207
|
+
FNLOOM_CONTEXT_METADATA_BATCH: 4, FNLOOM_CONTEXT_METADATA_INTERVAL: 60_000, FNLOOM_CONTEXT_SPLIT_MAX: 8, FNLOOM_CONTEXT_DUPLICATE_NEAREST: 10,
|
|
208
208
|
} as const;
|
|
209
209
|
const forms = new StoreFormService({ store, content, raw, converters, models, log, clock, settings, onForms: (record) => { changed.push(record.uri); } });
|
|
210
|
-
const reader = new FormReader({ store, content, forms, readChars: settings.
|
|
210
|
+
const reader = new FormReader({ store, content, forms, readChars: settings.FNLOOM_READ_CHARS });
|
|
211
211
|
const library = new HubResourceLibrary({ store, content, forms: () => forms, fetcher, converters, indexer: () => indexer, bus, log, clock, settings, hubActor: HUB_ACTOR });
|
|
212
212
|
const contexts: QualifiedName[] = [];
|
|
213
213
|
const context = new StoreContextLibrary({
|
|
@@ -225,7 +225,7 @@ export async function resourcesRig(options: { pieceTokens?: number; maxRows?: nu
|
|
|
225
225
|
store, bus, log, clock, hubActor: HUB_ACTOR, graph: () => graph, indexer: () => indexer, search: () => storeSearch(store), decider: () => decisions.decider,
|
|
226
226
|
llm: () => chat, metadataModel: () => Promise.resolve(metadataModel.model),
|
|
227
227
|
planModel: () => Promise.resolve(planModel.model), embedderReady: () => planModel.embedder, runs: () => planRuns,
|
|
228
|
-
settings: { batch: settings.
|
|
228
|
+
settings: { batch: settings.FNLOOM_CONTEXT_METADATA_BATCH, interval: settings.FNLOOM_CONTEXT_METADATA_INTERVAL, maxSplit: settings.FNLOOM_CONTEXT_SPLIT_MAX, nearest: settings.FNLOOM_CONTEXT_DUPLICATE_NEAREST },
|
|
229
229
|
});
|
|
230
230
|
return { store, log, records, time, clock, bus, content, raw, models, converters, graph, indexer, fetcher, changed, contexts, settings, forms, reader, library, context, questions, chat, decisions, metadataModel, planModel, planRuns };
|
|
231
231
|
}
|
|
@@ -3,10 +3,10 @@ import { env } from '@ayepi/env';
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
export const storeEnv = env({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
FNLOOM_DB_BUSY_TIMEOUT: z.number().int().min(0).default(5_000).describe('How long a write waits for another process\'s write lock before failing.'),
|
|
7
|
+
FNLOOM_SEARCH_RRF_K: z.number().int().min(1).default(60).describe('Hybrid search: the reciprocal-rank constant (higher flattens the gap between ranks).'),
|
|
8
|
+
FNLOOM_SEARCH_DEPTH: z.number().int().min(1).default(4).describe('Hybrid search: each index is asked for `limit × depth` candidates before they are merged.'),
|
|
9
|
+
FNLOOM_KV_SWEEP_EVERY: z.number().int().min(1).default(1_000).describe('Expired key/value rows are swept every this many writes.'),
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
/** The parsed store tunables. */
|
|
@@ -104,9 +104,9 @@ function entries<L extends string, V>(record: Readonly<Record<L, V>>): Array<[L,
|
|
|
104
104
|
export class HybridSearch {
|
|
105
105
|
readonly #vectors: VectorIndex;
|
|
106
106
|
readonly #text: TextIndex;
|
|
107
|
-
readonly #tuning: Pick<StoreTuning, '
|
|
107
|
+
readonly #tuning: Pick<StoreTuning, 'FNLOOM_SEARCH_RRF_K' | 'FNLOOM_SEARCH_DEPTH'>;
|
|
108
108
|
|
|
109
|
-
constructor(indexes: { readonly vectors: VectorIndex; readonly text: TextIndex }, tuning: Pick<StoreTuning, '
|
|
109
|
+
constructor(indexes: { readonly vectors: VectorIndex; readonly text: TextIndex }, tuning: Pick<StoreTuning, 'FNLOOM_SEARCH_RRF_K' | 'FNLOOM_SEARCH_DEPTH'>) {
|
|
110
110
|
this.#vectors = indexes.vectors;
|
|
111
111
|
this.#text = indexes.text;
|
|
112
112
|
this.#tuning = tuning;
|
|
@@ -116,7 +116,7 @@ export class HybridSearch {
|
|
|
116
116
|
async search(query: HybridQuery): Promise<FusedHit[]> {
|
|
117
117
|
if (query.limit < 1 || query.kinds.length === 0) return [];
|
|
118
118
|
const limit = Math.floor(query.limit);
|
|
119
|
-
const depth = limit * this.#tuning.
|
|
119
|
+
const depth = limit * this.#tuning.FNLOOM_SEARCH_DEPTH;
|
|
120
120
|
const vector = query.match === 'text' ? undefined : query.vector;
|
|
121
121
|
const useText = query.match !== 'semantic' || vector === undefined;
|
|
122
122
|
const over = query.semanticOver;
|
|
@@ -127,7 +127,7 @@ export class HybridSearch {
|
|
|
127
127
|
useText ? this.#text.search({ text: query.text, kinds: query.kinds, limit: depth, within: query.within, prefix: query.prefix, excludeKeys: query.excludeKeys }) : Promise.resolve([]),
|
|
128
128
|
]);
|
|
129
129
|
const near = nearRows.map(asItem);
|
|
130
|
-
const k = this.#tuning.
|
|
130
|
+
const k = this.#tuning.FNLOOM_SEARCH_RRF_K;
|
|
131
131
|
if (vector === undefined) return fuseRanks({ text }, k).slice(0, limit);
|
|
132
132
|
const fused = (useText ? fuseRanks({ vector: near, text }, k) : fuseRanks({ vector: near }, k)).slice(0, limit);
|
|
133
133
|
const similar = await this.#similarities(vector, near, fused, query.kinds, over);
|
|
@@ -75,7 +75,7 @@ export class SqliteStore implements HubStore {
|
|
|
75
75
|
if (onDisk) mkdirSync(dirname(options.file), { recursive: true });
|
|
76
76
|
const database = new Database(options.file);
|
|
77
77
|
sqliteVec.load(database);
|
|
78
|
-
database.pragma(`busy_timeout = ${tuning.
|
|
78
|
+
database.pragma(`busy_timeout = ${tuning.FNLOOM_DB_BUSY_TIMEOUT}`);
|
|
79
79
|
if (onDisk) database.pragma('journal_mode = WAL');
|
|
80
80
|
database.pragma('synchronous = NORMAL');
|
|
81
81
|
const portOptions: SqliteOptions = options.now === undefined ? { prefix: PORT_PREFIX } : { prefix: PORT_PREFIX, now: options.now };
|
|
@@ -83,10 +83,10 @@ export class SqliteStore implements HubStore {
|
|
|
83
83
|
database,
|
|
84
84
|
options: portOptions,
|
|
85
85
|
queue: sqliteQueue(database, portOptions),
|
|
86
|
-
store: sqliteStore(database, { ...portOptions, sweepEvery: tuning.
|
|
86
|
+
store: sqliteStore(database, { ...portOptions, sweepEvery: tuning.FNLOOM_KV_SWEEP_EVERY }),
|
|
87
87
|
// one process: messages stay in memory and never touch the database
|
|
88
88
|
pubsub: sqlitePubSub(database, { ...portOptions, poll: false }),
|
|
89
|
-
rate: sqliteRateStore(database, { prefix: PORT_PREFIX, sweepEvery: tuning.
|
|
89
|
+
rate: sqliteRateStore(database, { prefix: PORT_PREFIX, sweepEvery: tuning.FNLOOM_KV_SWEEP_EVERY }),
|
|
90
90
|
};
|
|
91
91
|
const root = openKysely(database);
|
|
92
92
|
const shared: Shared = { root, raw, named: new Map(), dimensions: new Map(Object.entries(options.dimensions ?? {})), tuning, log: options.log ?? defaultLogger };
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* its source folder (fs, schedule) finds them in the hub's drivers folder instead: when its store is placed in an
|
|
8
8
|
* external database (at install, or by a move), the hub `npm install`s the engine's drivers there, at the versions the
|
|
9
9
|
* system's `system.json` lists, and the supervisor tells every system it starts where that folder is
|
|
10
|
-
* (`
|
|
10
|
+
* (`FNLOOM_STORE_DRIVERS`), so the SDK loads them from it.
|
|
11
11
|
*
|
|
12
12
|
* Nothing is installed when the driver already resolves from the system's own folder or the drivers folder. A system
|
|
13
13
|
* the hub didn't install (it runs elsewhere) brings its own; the hub can't install into its machine.
|
|
@@ -31,7 +31,7 @@ export interface DriverInstaller {
|
|
|
31
31
|
|
|
32
32
|
/** What the drivers service is built from. */
|
|
33
33
|
export interface StoreDriversOptions {
|
|
34
|
-
/** The shared drivers folder (`
|
|
34
|
+
/** The shared drivers folder (`FNLOOM_STORE_DRIVERS_DIR`). */
|
|
35
35
|
readonly dir: string;
|
|
36
36
|
readonly installer: DriverInstaller;
|
|
37
37
|
readonly log: Logger;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* One connection per file, so its statements are serialized: a plain statement waits for the one before it, and a
|
|
8
8
|
* transaction takes the file for itself under a lease (`begin`). While the lease is held only statements carrying
|
|
9
9
|
* it run; every other statement waits for it to end. Each statement of the transaction renews the lease; a lease
|
|
10
|
-
* left quiet for its length (`
|
|
10
|
+
* left quiet for its length (`FNLOOM_STORE_LEASE`, 30 s), or held longer than `STORE_LEASE_MAX` (5 minutes) in all,
|
|
11
11
|
* is rolled back and its next statement refused. A connection replaced mid-transaction has its lease ended at once.
|
|
12
12
|
*
|
|
13
13
|
* Snapshots (`VACUUM INTO`) go in `<stores>/<system>/snapshots/<instance>/`, the newest few kept; restoring one
|
|
@@ -29,11 +29,11 @@ import { statementProblem } from './guard.ts';
|
|
|
29
29
|
|
|
30
30
|
/** What the host is built with. */
|
|
31
31
|
export interface StoreHostOptions {
|
|
32
|
-
/** The folder the stores live in (`
|
|
32
|
+
/** The folder the stores live in (`FNLOOM_STORES_DIR`). */
|
|
33
33
|
readonly dir: string;
|
|
34
34
|
readonly log: Logger;
|
|
35
35
|
readonly clock: () => number;
|
|
36
|
-
/** How long a lease lasts between statements (`
|
|
36
|
+
/** How long a lease lasts between statements (`FNLOOM_STORE_LEASE`). */
|
|
37
37
|
readonly lease: number;
|
|
38
38
|
/**
|
|
39
39
|
* The longest a lease lasts in all, however busy (`STORE_LEASE_MAX`, 5 minutes): a transaction kept alive by a
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* system probes the target (`storeProbe`): reachable, empty, and able to hold the store's vectors (pgvector,
|
|
7
7
|
* SQL Server 2025, each vector set within the engine's size). Anything wrong refuses the move before it starts.
|
|
8
8
|
* 2. **Draining.** The store goes `moving` and the hub holds new calls to the instance (up to 2 minutes each, then
|
|
9
|
-
* "<system> is getting its storage ready"). Runs still going get `
|
|
9
|
+
* "<system> is getting its storage ready"). Runs still going get `FNLOOM_STORE_MOVE_DRAIN` (60 s) to finish.
|
|
10
10
|
* If some are still going then, the move waits for the admin (`waiting`): "cancel them" cancels them as the
|
|
11
11
|
* admin, "keep waiting" waits for them to finish. A move started with `runs: 'cancel'` or `'wait'` answers that
|
|
12
12
|
* itself.
|
|
@@ -63,7 +63,7 @@ export interface StoreMovesOptions {
|
|
|
63
63
|
readonly runs: () => MoveRuns;
|
|
64
64
|
readonly log: Logger;
|
|
65
65
|
readonly clock: () => number;
|
|
66
|
-
/** How long running runs get before the admin is asked (`
|
|
66
|
+
/** How long running runs get before the admin is asked (`FNLOOM_STORE_MOVE_DRAIN`). */
|
|
67
67
|
readonly drain?: number;
|
|
68
68
|
/** How often a draining move looks at the runs again, in ms. */
|
|
69
69
|
readonly poll?: number;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* latest on the instance's row (for the admin pages) and, for the live connection, in memory: a new connection
|
|
11
11
|
* starts not ready until it says otherwise.
|
|
12
12
|
* - **Holding.** A call that runs the system's code (a fn run, a hook, a firing, authoring a fn of its kinds) waits
|
|
13
|
-
* while the instance's store isn't ready, up to `
|
|
13
|
+
* while the instance's store isn't ready, up to `FNLOOM_STORE_HOLD` (2 minutes), then is refused with "<system>
|
|
14
14
|
* is getting its storage ready". A system whose contract declares no store is never held.
|
|
15
15
|
* - **On the hub.** For a store placed on the hub, the store endpoints run on its file (`host.ts`); they are refused
|
|
16
16
|
* for any other placement. The file is closed when the instance disconnects (an open transaction rolled back).
|
|
@@ -52,7 +52,7 @@ export interface SystemStoresOptions {
|
|
|
52
52
|
readonly vault: () => Pick<ConfigVault, 'store' | 'reveal' | 'remove'>;
|
|
53
53
|
readonly log: Logger;
|
|
54
54
|
readonly clock: () => number;
|
|
55
|
-
/** How long a call is held (`
|
|
55
|
+
/** How long a call is held (`FNLOOM_STORE_HOLD`). */
|
|
56
56
|
readonly hold?: number;
|
|
57
57
|
/** Installs the drivers a store placed in Postgres or SQL Server needs (`drivers.ts`); none, nothing is installed. */
|
|
58
58
|
readonly drivers?: Pick<StoreDrivers, 'ensure'>;
|
|
@@ -6,9 +6,9 @@ import { z } from 'zod';
|
|
|
6
6
|
|
|
7
7
|
/** Table result tunables. */
|
|
8
8
|
export const tablesEnv = env({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
FNLOOM_EXPORT_PAGE: z.number().int().min(1).max(500).default(500).describe('Rows per page a streamed export asks its read fn for (at most 500, the most hub/records_table gives at once); each page is written and let go before the next.'),
|
|
10
|
+
FNLOOM_QUIET_READ_TIMEOUT: z.number().int().min(1_000).default(120_000).describe('How long a quiet read (a widget page, range, drill or refresh outside a chat) or one export page may run before it is stopped; a run waiting for approval there is refused at once, since nobody can approve it.'),
|
|
11
|
+
FNLOOM_EXPORT_MAX_ROWS: z.number().int().min(1).default(100_000).describe('The most rows one export writes; a file cut there ends with a line saying so.'),
|
|
12
12
|
});
|
|
13
13
|
|
|
14
14
|
/** The parsed table tunables. */
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
* - **The visual registry** (`hub/visuals`): every `HUB_VISUALS` contribution, the hub's own first (the built-in
|
|
9
9
|
* families, `core/visuals.ts`), then each system the person may see, in name order.
|
|
10
10
|
* - **Row actions** (`hub/row_actions`, web `rowActions`): the methods of the rows' types and any fn a widget binds,
|
|
11
|
-
* as the person may use them, derived by the sdk's `
|
|
11
|
+
* as the person may use them, derived by the sdk's `rowActionOptions`.
|
|
12
12
|
* - **Streamed export** (`GET /api/export`): a read fn's whole result as CSV, page by page as the person in one turn,
|
|
13
|
-
* cut at `
|
|
13
|
+
* cut at `FNLOOM_EXPORT_MAX_ROWS` with a final line.
|
|
14
14
|
* - **The widget migration**: build 8's `hub/widget` fns become `widgets/<name>` fns of `widgets/widget`
|
|
15
15
|
* (`migrate.ts`), at start, whether or not the widgets system is paired yet.
|
|
16
16
|
*/
|
|
17
|
-
import type { ActorId, ContributionView, ExportQuery, Json, ReadFnArgs, ReadTableArgs, ResultTable, RowActionsQuery, RunInfo, UserView,
|
|
17
|
+
import type { ActorId, ContributionView, ExportQuery, Json, ReadFnArgs, ReadTableArgs, ResultTable, RowActionsQuery, RunInfo, UserView, RowActionOption } from '@harness/core';
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* The run a table is read in: its id, turn, person and caller. A source runs as a child called by the same caller (an
|
|
@@ -30,13 +30,13 @@ export interface TableService {
|
|
|
30
30
|
* Run a read fn as the person outside any session (the web's quiet read: a widget's pager, range, drill, refresh and
|
|
31
31
|
* live re-runs) in a turn of its own, and give its output; refused for a fn the person can't see or that isn't a read,
|
|
32
32
|
* and for a run that waits for an approval (nobody can give one there). The run is cancelled when `signal` aborts or
|
|
33
|
-
* it runs past `
|
|
33
|
+
* it runs past `FNLOOM_QUIET_READ_TIMEOUT`. `on` picks a fleet instance, as a run's `on` does.
|
|
34
34
|
*/
|
|
35
35
|
readAs(input: ReadFnArgs, user: UserView, signal?: AbortSignal): Promise<Json>;
|
|
36
36
|
/** Every visual of the registry the person may see: the hub's own in declared order, then each system's by name. */
|
|
37
37
|
visuals(actor: ActorId): Promise<ContributionView[]>;
|
|
38
38
|
/** The actions rows of these types offer the person, narrowed by a widget's list. */
|
|
39
|
-
rowActions(query: RowActionsQuery, actor: ActorId): Promise<
|
|
39
|
+
rowActions(query: RowActionsQuery, actor: ActorId): Promise<RowActionOption[]>;
|
|
40
40
|
/**
|
|
41
41
|
* A read fn's result as CSV, a page at a time, run as the person in one turn. Refuses (before the first byte) a fn
|
|
42
42
|
* that is not a read, args that are not a JSON object, or a first page that is not a table.
|
|
@@ -7,9 +7,9 @@ import { reject } from '@ayepi/core';
|
|
|
7
7
|
import {
|
|
8
8
|
HUB_VISUALS, Json, qualify, ResultTable, splitName, SystemName, csvHeader, csvRows,
|
|
9
9
|
type ActorId, type ContributionView, type ExportQuery, type FnRecord, type Priority, type QualifiedName, type ReadFnArgs, type ReadTableArgs, type RowActionsQuery, type RunSettled, type TurnId,
|
|
10
|
-
type UserView, type
|
|
10
|
+
type UserView, type RowActionOption,
|
|
11
11
|
} from '@harness/core';
|
|
12
|
-
import { returnsTable,
|
|
12
|
+
import { returnsTable, rowActionOptions, type RowFn } from '@harness/sdk';
|
|
13
13
|
import type { AccessScope } from '../access/index.ts';
|
|
14
14
|
import { HUB_SYSTEM } from '../catalog/availability.ts';
|
|
15
15
|
import type { Catalog } from '../catalog/index.ts';
|
|
@@ -94,7 +94,7 @@ export class HubTables implements TableService {
|
|
|
94
94
|
return all.filter((entry) => { if (seen.has(entry.name)) { return false; } seen.add(entry.name); return true; });
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
async rowActions(query: RowActionsQuery, actor: ActorId): Promise<
|
|
97
|
+
async rowActions(query: RowActionsQuery, actor: ActorId): Promise<RowActionOption[]> {
|
|
98
98
|
const access = await this.#deps.access(actor);
|
|
99
99
|
const catalog = this.#deps.catalog();
|
|
100
100
|
const usable = new Map<QualifiedName, FnRecord>();
|
|
@@ -111,14 +111,14 @@ export class HubTables implements TableService {
|
|
|
111
111
|
const fns = [...usable.values()];
|
|
112
112
|
const modes = await this.#deps.facts().modes(fns.map((fn) => fn.name));
|
|
113
113
|
const rowFns: RowFn[] = fns.map((fn) => ({ fn: fn.name, mode: modes.get(fn.name) ?? 'write', args: fn.decl.args, returnsTable: returnsTable(fn.decl.returns) }));
|
|
114
|
-
return
|
|
114
|
+
return rowActionOptions(rowFns, query.narrow);
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
async export(query: ExportQuery, user: UserView, signal?: AbortSignal): Promise<{ name: string; lines: AsyncIterable<string> }> {
|
|
118
118
|
const args = exportArgs(query.args);
|
|
119
119
|
const source = await this.#seen(query.fn, user.id, 'NOT_EXPORTABLE');
|
|
120
120
|
const turn = await this.#deps.turn(user);
|
|
121
|
-
const {
|
|
121
|
+
const { FNLOOM_EXPORT_PAGE: page, FNLOOM_EXPORT_MAX_ROWS: max } = this.#deps.settings;
|
|
122
122
|
const pageOf = async (offset: number): Promise<ResultTable> => tableOf(source.name, await this.#quiet({
|
|
123
123
|
fn: source.name, args: { ...args, [query.offset]: offset, [query.limit]: Math.min(page, max - offset) },
|
|
124
124
|
turn: turn.id, key: `export:${String(offset)}`, actor: user.id, caller: user.id, priority: turn.priority,
|
|
@@ -161,7 +161,7 @@ export class HubTables implements TableService {
|
|
|
161
161
|
/**
|
|
162
162
|
* Run a fn as the person outside any session (a quiet read or an export page) and wait for it. Nobody can approve a
|
|
163
163
|
* run there, so one that waits for an approval is cancelled and refused at once; the run is also cancelled when the
|
|
164
|
-
* caller goes away (`signal`) or it runs past `
|
|
164
|
+
* caller goes away (`signal`) or it runs past `FNLOOM_QUIET_READ_TIMEOUT` (a call inside it waiting for approval).
|
|
165
165
|
*/
|
|
166
166
|
async #quiet(input: Omit<RunInput, 'background' | 'handlers'>, signal?: AbortSignal): Promise<RunSettled> {
|
|
167
167
|
const runs = this.#deps.runs();
|
|
@@ -173,7 +173,7 @@ export class HubTables implements TableService {
|
|
|
173
173
|
if ((await runs.get(started.run))?.status === 'awaiting-approval') {
|
|
174
174
|
return stop(`${input.fn} needs an approval before it runs, and there is no chat here to give it in: ask for it in a chat instead`, NEEDS_APPROVAL);
|
|
175
175
|
}
|
|
176
|
-
const limit = AbortSignal.timeout(this.#deps.settings.
|
|
176
|
+
const limit = AbortSignal.timeout(this.#deps.settings.FNLOOM_QUIET_READ_TIMEOUT);
|
|
177
177
|
const ended = signal === undefined ? limit : AbortSignal.any([limit, signal]);
|
|
178
178
|
const outcome = await new Promise<RunSettled | 'timeout' | 'gone'>((resolve) => {
|
|
179
179
|
const quit = (): void => { resolve(limit.aborted ? 'timeout' : 'gone'); };
|