fnloom 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +123 -19
- package/package.json +15 -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 +4 -3
- package/packages/cli/src/command.ts +4 -2
- package/packages/cli/src/commands/install.ts +104 -8
- package/packages/cli/src/commands/manage.ts +7 -5
- package/packages/cli/src/commands/mcp.ts +6 -6
- package/packages/cli/src/commands/store.ts +172 -0
- package/packages/cli/src/hub.ts +45 -26
- package/packages/cli/src/index.ts +1 -1
- package/packages/cli/src/io.ts +3 -2
- package/packages/cli/src/local.ts +7 -7
- package/packages/cli/src/premade.ts +1 -1
- package/packages/cli/src/testing.ts +2 -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-files.ts +3 -1
- package/packages/core/src/context-graph.ts +5 -1
- package/packages/core/src/context-plan.ts +451 -0
- package/packages/core/src/context-questions.ts +305 -0
- package/packages/core/src/data.ts +1 -1
- package/packages/core/src/fn-facts.ts +32 -4
- package/packages/core/src/https.ts +2 -2
- package/packages/core/src/identity.ts +2 -2
- package/packages/core/src/image-embeddings.ts +1 -1
- package/packages/core/src/index.ts +9 -8
- package/packages/core/src/link.ts +71 -1
- package/packages/core/src/manifest.ts +22 -3
- package/packages/core/src/mention-search.ts +1 -1
- package/packages/core/src/model-calls.ts +11 -2
- package/packages/core/src/package.ts +11 -1
- package/packages/core/src/ports.ts +2 -2
- package/packages/core/src/query.ts +4 -3
- package/packages/core/src/records/chat.ts +1 -1
- package/packages/core/src/records/content.ts +10 -2
- package/packages/core/src/records/runs.ts +12 -0
- package/packages/core/src/records/spend.ts +4 -0
- package/packages/core/src/records/systems.ts +87 -5
- package/packages/core/src/registries.ts +9 -3
- package/packages/core/src/run.ts +5 -0
- package/packages/core/src/sso.ts +2 -2
- package/packages/core/src/stores.ts +473 -0
- package/packages/core/src/suggestions.ts +5 -2
- package/packages/core/src/system-pages.ts +46 -7
- package/packages/core/src/tables.ts +233 -0
- package/packages/core/src/visuals.ts +47 -139
- package/packages/core/src/web.ts +116 -11
- package/packages/core/src/widgets-v1.ts +78 -1
- package/packages/hub/package.json +15 -12
- package/packages/hub/src/access/hits.ts +1 -1
- package/packages/hub/src/api/admin-ops.ts +41 -9
- package/packages/hub/src/api/auth.ts +10 -6
- package/packages/hub/src/api/https.ts +6 -6
- package/packages/hub/src/api/identities.ts +1 -1
- package/packages/hub/src/api/person-ops.ts +6 -0
- 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 +54 -0
- package/packages/hub/src/api/testing/rig.ts +3 -3
- package/packages/hub/src/api/tls.ts +4 -4
- package/packages/hub/src/api/web/auth.ts +1 -1
- package/packages/hub/src/api/web/build5.ts +2 -1
- package/packages/hub/src/api/web/context-plans.ts +25 -0
- package/packages/hub/src/api/web/context-review.ts +43 -0
- package/packages/hub/src/api/web/find.ts +1 -1
- package/packages/hub/src/api/web/index.ts +4 -0
- package/packages/hub/src/api/web/pages.ts +17 -3
- package/packages/hub/src/api/web/pickers.ts +4 -4
- package/packages/hub/src/api/web/review.ts +16 -0
- package/packages/hub/src/api/web/systems.ts +14 -2
- package/packages/hub/src/boot/admin-fns.ts +8 -0
- package/packages/hub/src/boot/admin-secrets.ts +10 -4
- package/packages/hub/src/boot/env.ts +82 -73
- package/packages/hub/src/boot/hub-fns.ts +4 -4
- package/packages/hub/src/boot/hub-groups.ts +2 -2
- package/packages/hub/src/boot/identity.ts +2 -2
- package/packages/hub/src/boot/index.ts +10 -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 +16 -7
- package/packages/hub/src/boot/person-fns.ts +5 -0
- package/packages/hub/src/boot/plan-fns.ts +39 -0
- package/packages/hub/src/boot/services.ts +9 -9
- package/packages/hub/src/boot/start.ts +25 -24
- package/packages/hub/src/catalog/catalog.ts +44 -14
- package/packages/hub/src/catalog/index.ts +6 -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 +3 -3
- 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/brought.ts +5 -3
- 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 +5 -5
- 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 +13 -6
- package/packages/hub/src/execution/env.ts +16 -14
- package/packages/hub/src/execution/errors.ts +12 -0
- package/packages/hub/src/execution/executors.ts +16 -4
- package/packages/hub/src/execution/gateway.ts +1 -1
- package/packages/hub/src/execution/index.ts +9 -1
- package/packages/hub/src/execution/ledger.ts +2 -2
- package/packages/hub/src/execution/limits.ts +2 -2
- package/packages/hub/src/execution/link-handlers.ts +16 -4
- 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 +216 -15
- package/packages/hub/src/execution/stream-guard.ts +2 -2
- package/packages/hub/src/execution/testing.ts +7 -6
- 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 +28 -9
- package/packages/hub/src/graph/graph.ts +3 -3
- 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 +10 -3
- package/packages/hub/src/index/indexer.ts +71 -20
- package/packages/hub/src/index/search.ts +2 -1
- package/packages/hub/src/index/suggester.ts +2 -2
- package/packages/hub/src/index/testing.ts +2 -2
- package/packages/hub/src/link/build.ts +71 -34
- package/packages/hub/src/link/connections.ts +41 -3
- package/packages/hub/src/link/describer.ts +19 -2
- package/packages/hub/src/link/env.ts +21 -11
- package/packages/hub/src/link/grants.ts +10 -10
- package/packages/hub/src/link/handlers.ts +6 -0
- package/packages/hub/src/link/index.ts +16 -4
- package/packages/hub/src/link/lifecycle.ts +15 -8
- package/packages/hub/src/link/migrate-api.ts +55 -15
- package/packages/hub/src/link/packages.ts +17 -4
- package/packages/hub/src/link/pairing.ts +3 -3
- package/packages/hub/src/link/process.ts +11 -5
- package/packages/hub/src/link/rig.ts +15 -11
- package/packages/hub/src/link/status.ts +14 -0
- package/packages/hub/src/link/supervisor.ts +17 -1
- package/packages/hub/src/link/systems.ts +16 -5
- 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 +78 -11
- package/packages/hub/src/query/columns.ts +4 -1
- package/packages/hub/src/query/contexts.ts +10 -3
- package/packages/hub/src/query/env.ts +5 -5
- package/packages/hub/src/query/sources.ts +3 -3
- package/packages/hub/src/questions/apply.ts +163 -0
- package/packages/hub/src/questions/carry.ts +30 -0
- package/packages/hub/src/questions/duplicates.ts +181 -0
- package/packages/hub/src/questions/index.ts +112 -0
- package/packages/hub/src/questions/metadata.ts +142 -0
- package/packages/hub/src/questions/pending.ts +64 -0
- package/packages/hub/src/questions/plan-match.ts +79 -0
- package/packages/hub/src/questions/plan-prompts.ts +110 -0
- package/packages/hub/src/questions/planner.ts +382 -0
- package/packages/hub/src/questions/plans.ts +353 -0
- package/packages/hub/src/questions/review.ts +253 -0
- package/packages/hub/src/questions/setting.ts +50 -0
- package/packages/hub/src/questions/testing.ts +131 -0
- package/packages/hub/src/questions/worker.ts +182 -0
- package/packages/hub/src/resources/context.ts +61 -23
- package/packages/hub/src/resources/converters.ts +2 -2
- package/packages/hub/src/resources/create.ts +20 -8
- package/packages/hub/src/resources/env.ts +15 -11
- package/packages/hub/src/resources/fetch.ts +5 -5
- package/packages/hub/src/resources/fns.ts +6 -2
- package/packages/hub/src/resources/forms.ts +5 -5
- package/packages/hub/src/resources/index.ts +9 -3
- 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 +22 -6
- package/packages/hub/src/store/codec.ts +23 -5
- package/packages/hub/src/store/context-status.ts +56 -0
- package/packages/hub/src/store/derived.ts +53 -0
- package/packages/hub/src/store/env.ts +4 -4
- package/packages/hub/src/store/hybrid.ts +37 -10
- package/packages/hub/src/store/lists.ts +2 -1
- package/packages/hub/src/store/migrate-fn-names.ts +5 -2
- package/packages/hub/src/store/rows.ts +8 -1
- package/packages/hub/src/store/schema.ts +2 -1
- package/packages/hub/src/store/sqlite.ts +5 -4
- package/packages/hub/src/stores/backups.ts +163 -0
- package/packages/hub/src/stores/drivers.ts +100 -0
- package/packages/hub/src/stores/guard.ts +116 -0
- package/packages/hub/src/stores/host.ts +459 -0
- package/packages/hub/src/stores/moves.ts +380 -0
- package/packages/hub/src/stores/plugin.ts +42 -0
- package/packages/hub/src/stores/service.ts +340 -0
- package/packages/hub/src/stores/testing.ts +149 -0
- 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 +3229 -1309
- package/packages/sdk/package.json +15 -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/build.ts +3 -0
- 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 +104 -11
- package/packages/sdk/src/ctx.ts +51 -17
- package/packages/sdk/src/declare.ts +36 -12
- package/packages/sdk/src/hub.ts +226 -14
- package/packages/sdk/src/impl.ts +3 -3
- package/packages/sdk/src/index.ts +19 -12
- package/packages/sdk/src/manifest.ts +5 -0
- 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/providers.ts +2 -2
- package/packages/sdk/src/remote-auth.ts +128 -7
- package/packages/sdk/src/server/asks.ts +12 -1
- package/packages/sdk/src/server/context-files.ts +1 -1
- package/packages/sdk/src/server/env.ts +47 -35
- package/packages/sdk/src/server/fake-hub-widgets.ts +7 -6
- package/packages/sdk/src/server/host.ts +106 -35
- package/packages/sdk/src/server/index.ts +23 -4
- package/packages/sdk/src/server/live.ts +4 -4
- package/packages/sdk/src/server/llm-wire.ts +4 -4
- package/packages/sdk/src/server/package.ts +11 -2
- package/packages/sdk/src/server/pairing.ts +1 -1
- package/packages/sdk/src/server/results.ts +4 -4
- package/packages/sdk/src/server/run.ts +6 -1
- package/packages/sdk/src/server/runtime.ts +78 -22
- package/packages/sdk/src/server/socket-guard.ts +1 -1
- package/packages/sdk/src/server/start-gate.ts +174 -0
- package/packages/sdk/src/server/store/checksum.ts +162 -0
- package/packages/sdk/src/server/store/engines.ts +400 -0
- package/packages/sdk/src/server/store/extend.ts +25 -0
- package/packages/sdk/src/server/store/keeper.ts +392 -0
- package/packages/sdk/src/server/store/link-driver.ts +142 -0
- package/packages/sdk/src/server/store/measure.ts +45 -0
- package/packages/sdk/src/server/store/migrations.ts +238 -0
- package/packages/sdk/src/server/store/move.ts +488 -0
- package/packages/sdk/src/server/store/portable.ts +288 -0
- package/packages/sdk/src/server/store/stable.ts +146 -0
- package/packages/sdk/src/server/store/tables.ts +28 -0
- package/packages/sdk/src/server/store/vectors.ts +185 -0
- package/packages/sdk/src/server/store/work-checks.ts +288 -0
- package/packages/sdk/src/server/store/work.ts +369 -0
- package/packages/sdk/src/server/supervise.ts +4 -4
- package/packages/sdk/src/server/table.ts +3 -1
- package/packages/sdk/src/server/testing.ts +116 -3
- package/packages/sdk/src/store.ts +91 -0
- package/packages/sdk/src/system.ts +58 -30
- package/packages/sdk/src/testing/env.ts +6 -6
- package/packages/sdk/src/testing/hub.ts +21 -6
- 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-BuMYRDqv.js → ActorSettingsView-CDszUbHz.js} +2 -2
- package/packages/web/dist/assets/AdminLayout-CFIz4GsQ.js +2 -0
- package/packages/web/dist/assets/{AdminLayout-1hbRPV3d.css → AdminLayout-ggcdQGlQ.css} +1 -1
- package/packages/web/dist/assets/{AppPage-DSzDKCFz.js → AppPage-BvoVTk6h.js} +2 -2
- package/packages/web/dist/assets/{AutoPairPicker-nV38ALjl.js → AutoPairPicker-CLjD-muP.js} +2 -2
- package/packages/web/dist/assets/{BrowserFrame-Bic7U7jN.js → BrowserFrame-BcN-A76X.js} +2 -2
- package/packages/web/dist/assets/ChatPage-DhTpAyM2.js +4 -0
- package/packages/web/dist/assets/{ChatPage-CbsRmktV.css → ChatPage-DjPv238m.css} +1 -1
- package/packages/web/dist/assets/{CodeViewer-xHS3Xah9.js → CodeViewer-K9jrTmFO.js} +2 -2
- package/packages/web/dist/assets/ConfigWithCustom-BvrvSVIp.js +3 -0
- package/packages/web/dist/assets/{ConfirmDialog-DjQUzNqk.js → ConfirmDialog-BDvLleYf.js} +2 -2
- package/packages/web/dist/assets/{ConnectPage-CfRDrXvJ.js → ConnectPage-Dg6IPNNh.js} +2 -2
- package/packages/web/dist/assets/ContextItemPage-Cv4G0k_o.css +1 -0
- package/packages/web/dist/assets/ContextItemPage-qisBQetR.js +2 -0
- package/packages/web/dist/assets/ContextPage-C8u0UnYl.css +1 -0
- package/packages/web/dist/assets/ContextPage-DXa6Yqk-.js +3 -0
- package/packages/web/dist/assets/ContextRow-Chx99Xac.css +1 -0
- package/packages/web/dist/assets/ContextRow-DDYnYRaL.js +2 -0
- package/packages/web/dist/assets/{DataPage-wSIoGcb5.js → DataPage-DOE_pKAY.js} +2 -2
- package/packages/web/dist/assets/DataTypePage-BnP_JELT.js +2 -0
- package/packages/web/dist/assets/{DataTypePage-Cr238Hx_.css → DataTypePage-CWrWvUPs.css} +1 -1
- package/packages/web/dist/assets/{DesignPage-DidMUX8m.js → DesignPage-B9MJbF10.js} +3 -3
- package/packages/web/dist/assets/{ExplorePage-MUyVydVB.js → ExplorePage-cRDQZRea.js} +2 -2
- package/packages/web/dist/assets/{FnPill-BshAvm2I.js → FnPill-CbLZCXYM.js} +2 -2
- package/packages/web/dist/assets/{FnView-B8MGAOoB.js → FnView-CG_wBKTP.js} +2 -2
- package/packages/web/dist/assets/{FnsView-CeqIoaBT.js → FnsView-BybyK12w.js} +2 -2
- package/packages/web/dist/assets/{GinExprView-DYVUwZrd.js → GinExprView-BYCKSD_n.js} +2 -2
- package/packages/web/dist/assets/{GinForm-D3mwMRTQ.js → GinForm-CXjYVf2_.js} +2 -2
- package/packages/web/dist/assets/{GinTypeView-C0YifSmE.js → GinTypeView-Bmbmx9e_.js} +2 -2
- package/packages/web/dist/assets/{GinValueView-HfEPq9le.js → GinValueView-CWUzS7ti.js} +2 -2
- package/packages/web/dist/assets/{GraphPage-ySnuA4Hp.js → GraphPage-D6OhckfJ.js} +2 -2
- package/packages/web/dist/assets/GraphPanel-BTitgA-K.js +2 -0
- package/packages/web/dist/assets/{HubPicker-C_vA752L.js → HubPicker-DVly8dLD.js} +2 -2
- package/packages/web/dist/assets/{InboxApprovals-DcPCCmZ5.js → InboxApprovals-BF84edZU.js} +2 -2
- package/packages/web/dist/assets/{InboxPage-C2DT2nuF.js → InboxPage-DohZ9EDP.js} +2 -2
- package/packages/web/dist/assets/InjectedList-e6qr1kdU.js +2 -0
- package/packages/web/dist/assets/InstallDialog-JJCKYs2s.js +2 -0
- package/packages/web/dist/assets/{InstallDialog-yWLZK_zN.css → InstallDialog-K-j0sdHm.css} +1 -1
- package/packages/web/dist/assets/InstanceTypes-BqUzx87o.js +2 -0
- package/packages/web/dist/assets/InstanceTypes-CwVSAULg.css +1 -0
- package/packages/web/dist/assets/InstanceView-C73pev7A.js +2 -0
- package/packages/web/dist/assets/InstanceView-_9uE70tS.css +1 -0
- package/packages/web/dist/assets/{ItemHistory-CUGa8b6s.js → ItemHistory-dbGgOZsw.js} +2 -2
- package/packages/web/dist/assets/LimitsView-Ddp5WakY.js +2 -0
- package/packages/web/dist/assets/ListSearch-CYNNAuMB.js +2 -0
- package/packages/web/dist/assets/{LlmCallDetails-2yQftCqd.js → LlmCallDetails-C9H5Hc2J.js} +2 -2
- package/packages/web/dist/assets/{LlmCallsView-DOHX3r0K.js → LlmCallsView-CBqyZ8Cj.js} +2 -2
- package/packages/web/dist/assets/{LoadState-DeXfLvYv.js → LoadState-B2YhZlyC.js} +2 -2
- package/packages/web/dist/assets/McpDialog-DhlLklIq.js +2 -0
- package/packages/web/dist/assets/{McpView-CC2oNOMa.js → McpView-D_ZmNO56.js} +2 -2
- package/packages/web/dist/assets/{McpsView-CwJvyyxV.js → McpsView-9_gwBuzw.js} +2 -2
- package/packages/web/dist/assets/{MemoryDialog-Dbvh5uLq.js → MemoryDialog-pTHIxKEX.js} +2 -2
- package/packages/web/dist/assets/{ModelCallsView-RvnW3EBP.js → ModelCallsView-FHv2XWRX.js} +2 -2
- package/packages/web/dist/assets/{ModelPicker-DcjwQFHC.js → ModelPicker-EqOuvVnE.js} +2 -2
- package/packages/web/dist/assets/ModelsView-D9UaL4PX.js +2 -0
- package/packages/web/dist/assets/{NotFoundPage-CeSwzTV-.js → NotFoundPage-BsuJysan.js} +2 -2
- package/packages/web/dist/assets/PairPage-B_ZXsbL4.js +2 -0
- package/packages/web/dist/assets/PairPage-D_aPS1Ot.css +1 -0
- package/packages/web/dist/assets/{PanelHost-BkrFAnPa.js → PanelHost-Dx-vNNl5.js} +2 -2
- package/packages/web/dist/assets/PeopleView-D6dmEgMs.js +2 -0
- package/packages/web/dist/assets/{PeopleView-CJ8yArTh.css → PeopleView-DBxdbT1C.css} +1 -1
- package/packages/web/dist/assets/PoliciesView-Bn4rm-ao.js +2 -0
- package/packages/web/dist/assets/{RefusalList-DQoyUoPG.js → RefusalList-aosRD1ie.js} +2 -2
- package/packages/web/dist/assets/RendererHost-Ym_SMkhp.css +1 -0
- package/packages/web/dist/assets/RendererHost-rjnpSgyQ.js +2 -0
- package/packages/web/dist/assets/{ResourceViewer-Po24y4pj.js → ResourceViewer-C4tRColf.js} +2 -2
- package/packages/web/dist/assets/ResourcesPage-7mCLBORZ.js +2 -0
- package/packages/web/dist/assets/ResultGrid-CL2WSYQH.css +1 -0
- package/packages/web/dist/assets/ResultGrid-GIMoQUAr.js +2 -0
- package/packages/web/dist/assets/{ReviewSummaryStrip-k3HevESg.js → ReviewSummaryStrip-Bvjn3Iq8.js} +2 -2
- package/packages/web/dist/assets/ReviewView-DIqsUedT.js +3 -0
- package/packages/web/dist/assets/{RuleRow-CoXDA-SH.js → RuleRow-zRg-e8Vj.js} +2 -2
- package/packages/web/dist/assets/RunCard-C7wOGaw8.js +2 -0
- package/packages/web/dist/assets/RunCard-CSDiz-Nt.css +1 -0
- package/packages/web/dist/assets/{RunDetails-CGhQQ6OI.js → RunDetails-W4GbE6AE.js} +2 -2
- package/packages/web/dist/assets/{RunDot-Ch_45985.js → RunDot-C46uzzNM.js} +2 -2
- package/packages/web/dist/assets/{RunPage-C_t20pB7.js → RunPage-DPLtZpeB.js} +2 -2
- package/packages/web/dist/assets/{RunProgress-VrZUHUEC.js → RunProgress-Cr_6TBaF.js} +2 -2
- package/packages/web/dist/assets/RunsView-tU350TPK.js +2 -0
- package/packages/web/dist/assets/{SettingsPage-CykfuYj1.js → SettingsPage-B8QmmMN3.js} +2 -2
- 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-DrXZ1sG2.js → SignInPage-DTwdqlnB.js} +2 -2
- package/packages/web/dist/assets/{StatusBadge-Dpb9uG5e.js → StatusBadge-D7wKMAcD.js} +2 -2
- package/packages/web/dist/assets/StorePlacementStep-C04nRU-u.js +2 -0
- package/packages/web/dist/assets/StorePlacementStep-D_G4e3ue.css +1 -0
- package/packages/web/dist/assets/{SystemConfig-72qKRkUk.js → SystemConfig-CE3keXWq.js} +2 -2
- package/packages/web/dist/assets/SystemPageHost-CEhz4li8.js +2 -0
- package/packages/web/dist/assets/SystemPageHost-DX7LrFoN.css +1 -0
- package/packages/web/dist/assets/SystemView-CBFzEGfm.js +2 -0
- package/packages/web/dist/assets/{SystemView-C8ScHUe2.css → SystemView-_9q6eDfV.css} +1 -1
- package/packages/web/dist/assets/SystemsView-0G8JntMV.js +2 -0
- package/packages/web/dist/assets/{SystemsView-B6HEL9VS.css → SystemsView-CWKnupLW.css} +1 -1
- package/packages/web/dist/assets/TableView-BK0uwLHl.js +3 -0
- package/packages/web/dist/assets/TableView-B_4MViVb.css +1 -0
- package/packages/web/dist/assets/{TableViewer-BQ7bYLOP.js → TableViewer-nbMInGJJ.js} +2 -2
- package/packages/web/dist/assets/{ThemePicker-C2nJ21Vd.js → ThemePicker-fZpVSYqG.js} +2 -2
- package/packages/web/dist/assets/{TurnTree-CORdfTHj.js → TurnTree-Co-iBqhT.js} +2 -2
- package/packages/web/dist/assets/{UserMessage-BtECa8ka.css → UserMessage-B63G9sxC.css} +1 -1
- package/packages/web/dist/assets/{UserMessage-qyc8dG5D.js → UserMessage-CDjUxKY0.js} +6 -6
- package/packages/web/dist/assets/{ValueVisual-aXEUaQ5Y.js → ValueVisual-EJnCKgSy.js} +2 -2
- package/packages/web/dist/assets/actor-names-OdvpVZeb.js +4 -0
- package/packages/web/dist/assets/{fn-modal-DqcxUhOQ.js → fn-modal-DtE65mFt.js} +2 -2
- package/packages/web/dist/assets/{fn-notices-BYaH6IoA.js → fn-notices-CCZ-DFbi.js} +2 -2
- package/packages/web/dist/assets/{formats-DI__ADVG.js → formats-CyHV2siv.js} +2 -2
- package/packages/web/dist/assets/index-BY7M8QUk.css +1 -0
- package/packages/web/dist/assets/index-OZS2EluT.js +4 -0
- package/packages/web/dist/assets/{labels-BhJpmLWA.js → labels-CT7_K0Pt.js} +2 -2
- package/packages/web/dist/assets/{layout-DQKldU13.js → layout-B6fBDg80.js} +2 -2
- package/packages/web/dist/assets/loaded-LaPjk6mK.js +2 -0
- package/packages/web/dist/assets/{metrics-Cio5ykX6.js → metrics-9n8bKI7u.js} +2 -2
- package/packages/web/dist/assets/problems--AW4igVY.js +2 -0
- package/packages/web/dist/assets/{push-payload-D5efGCzd.js → push-payload-B3EcrsVz.js} +64 -64
- package/packages/web/dist/assets/record-edits-B-FWAbxR.js +2 -0
- package/packages/web/dist/assets/{review-CGUGvRV9.js → review-uLESCEz1.js} +3 -3
- package/packages/web/dist/assets/routes-B7Zmt8wh.js +4 -0
- package/packages/web/dist/assets/runs-CUb2PTFg.js +2 -0
- package/packages/web/dist/assets/{shared-DTpYDMc_.js → shared-Bxhw_9et.js} +2 -2
- package/packages/web/dist/assets/{sources-Bm-TrxhL.js → sources-YgkjgFLe.js} +2 -2
- package/packages/web/dist/assets/src-DY1fSFJS.js +43 -0
- package/packages/web/dist/assets/state-ChQDWWj-.js +2 -0
- package/packages/web/dist/assets/{systems-DIp94AET.js → systems-CjwjRySu.js} +2 -2
- package/packages/web/dist/assets/table-host-B_D9dmCz.js +2 -0
- package/packages/web/dist/assets/tables-CaxIuHdw.js +2 -0
- package/packages/web/dist/assets/ui-DWjytmDS.js +17 -0
- package/packages/web/dist/assets/{ui-C7ZH_6oC.css → ui-DycHjPTZ.css} +1 -1
- package/packages/web/dist/assets/{url-BIg5IhGs.js → url-DbGOI14W.js} +2 -2
- package/packages/web/dist/index.html +52 -50
- 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 +17 -16
- package/scripts/stack.ts +76 -19
- package/scripts/start.ts +27 -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/fakes.ts +2 -0
- package/systems/fs/client/index.ts +4 -2
- package/systems/fs/client/machines/CoreHeatmap.vue +94 -0
- package/systems/fs/client/machines/MachineFiles.vue +121 -0
- package/systems/fs/client/machines/MachineMetrics.vue +330 -0
- package/systems/fs/client/machines/MachinesPage.vue +119 -0
- package/systems/fs/client/machines/TimeChart.vue +128 -0
- package/systems/fs/client/machines/fakes.ts +95 -0
- package/systems/fs/client/machines/files/ChangesPane.vue +90 -0
- package/systems/fs/client/machines/files/CodeView.vue +158 -0
- package/systems/fs/client/machines/files/CommentComposer.vue +86 -0
- package/systems/fs/client/machines/files/CommentThread.vue +115 -0
- package/systems/fs/client/machines/files/CommitPane.vue +80 -0
- package/systems/fs/client/machines/files/ComparePane.vue +81 -0
- package/systems/fs/client/machines/files/FileHistory.vue +89 -0
- package/systems/fs/client/machines/files/FilePane.vue +199 -0
- package/systems/fs/client/machines/files/FileTree.vue +26 -0
- package/systems/fs/client/machines/files/FolderPane.vue +154 -0
- package/systems/fs/client/machines/files/HistoryPane.vue +106 -0
- package/systems/fs/client/machines/files/ImageView.vue +160 -0
- package/systems/fs/client/machines/files/PatchView.vue +31 -0
- package/systems/fs/client/machines/files/QuickOpen.vue +67 -0
- package/systems/fs/client/machines/files/SearchPane.vue +87 -0
- package/systems/fs/client/machines/files/TreeNode.vue +72 -0
- package/systems/fs/client/machines/files/api.ts +127 -0
- package/systems/fs/client/machines/files/fake-kinds.ts +16 -0
- package/systems/fs/client/machines/files/fakes.ts +305 -0
- package/systems/fs/client/machines/files/ink.ts +117 -0
- package/systems/fs/client/machines/files/logic.ts +205 -0
- package/systems/fs/client/machines/files/state.ts +187 -0
- package/systems/fs/client/machines/files/viewers/CsvView.vue +29 -0
- package/systems/fs/client/machines/files/viewers/HexView.vue +27 -0
- package/systems/fs/client/machines/files/viewers/HtmlView.vue +17 -0
- package/systems/fs/client/machines/files/viewers/JsonNode.vue +45 -0
- package/systems/fs/client/machines/files/viewers/JsonView.vue +25 -0
- package/systems/fs/client/machines/metrics.ts +245 -0
- package/systems/fs/client/machines/palette.ts +98 -0
- package/systems/fs/client/preview/machines.ts +323 -0
- package/systems/fs/context/authoring/index.md +4 -0
- package/systems/fs/context/authoring/parts/actions.md +5 -1
- package/systems/fs/context/authoring/parts/actions.reference.md +6 -2
- package/systems/fs/context/authoring/parts/calling.md +5 -1
- package/systems/fs/context/authoring/parts/calling.reference.md +4 -0
- package/systems/fs/context/authoring/parts/client.md +31 -5
- package/systems/fs/context/authoring/parts/client.reference/client.md +8 -13
- package/systems/fs/context/authoring/parts/client.reference/pageinbox.md +524 -0
- package/systems/fs/context/authoring/parts/client.reference/{resultview.md → visuals.md} +135 -163
- package/systems/fs/context/authoring/parts/client.reference.md +11 -7
- package/systems/fs/context/authoring/parts/context/questions.md +49 -0
- package/systems/fs/context/authoring/parts/context.md +24 -2
- package/systems/fs/context/authoring/parts/context.reference.md +27 -3
- package/systems/fs/context/authoring/parts/contract.md +11 -1
- package/systems/fs/context/authoring/parts/contract.reference.md +26 -9
- package/systems/fs/context/authoring/parts/core-types/access-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/admin-ts.md +6 -2
- package/systems/fs/context/authoring/parts/core-types/api-index-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/approvals-ts.md +11 -7
- package/systems/fs/context/authoring/parts/core-types/auto-pair-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/checks-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/claims-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/config-secrets-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/connections-ts.md +15 -0
- package/systems/fs/context/authoring/parts/core-types/context-files-ts.md +9 -1
- package/systems/fs/context/authoring/parts/core-types/context-graph-ts.md +6 -2
- package/systems/fs/context/authoring/parts/core-types/context-questions-ts.md +26 -0
- package/systems/fs/context/authoring/parts/core-types/contextdecl.md +10 -2
- package/systems/fs/context/authoring/parts/core-types/data-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/decisions-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/fn-block-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/fn-facts-ts.md +11 -0
- package/systems/fs/context/authoring/parts/core-types/gin-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/grants-ts.md +5 -1
- package/systems/fs/context/authoring/parts/core-types/lifecycle-ts.md +44 -6
- package/systems/fs/context/authoring/parts/core-types/link-ts.md +7 -3
- package/systems/fs/context/authoring/parts/core-types/llm-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/manifest.md +41 -3
- package/systems/fs/context/authoring/parts/core-types/manifestpatch.md +34 -2
- package/systems/fs/context/authoring/parts/core-types/mention-search-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/model-calls-ts.md +5 -1
- package/systems/fs/context/authoring/parts/core-types/model-names-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/modes-ts.md +6 -2
- package/systems/fs/context/authoring/parts/core-types/owner-runs-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/package-ts.md +9 -0
- package/systems/fs/context/authoring/parts/core-types/primitives-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/query-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/records-actors-ts.md +7 -3
- package/systems/fs/context/authoring/parts/core-types/records-chat-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/records-content-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/records-runs-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/records-systems-ts.md +148 -0
- package/systems/fs/context/authoring/parts/core-types/registries-ts.md +101 -1
- package/systems/fs/context/authoring/parts/core-types/resources-ts.md +5 -1
- package/systems/fs/context/authoring/parts/core-types/run-ts.md +8 -1
- package/systems/fs/context/authoring/parts/core-types/sensitivity-ts.md +5 -1
- package/systems/fs/context/authoring/parts/core-types/stores-ts.md +199 -0
- package/systems/fs/context/authoring/parts/core-types/system-events-ts.md +8 -1
- package/systems/fs/context/authoring/parts/core-types/system-pages-ts.md +7 -1
- package/systems/fs/context/authoring/parts/core-types/system-providers-ts.md +5 -1
- package/systems/fs/context/authoring/parts/core-types/tables-ts.md +91 -0
- package/systems/fs/context/authoring/parts/core-types/validation-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/visuals-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/web-ts.md +4 -1
- package/systems/fs/context/authoring/parts/core-types.md +15 -8
- package/systems/fs/context/authoring/parts/ctx/update-result.md +33 -0
- package/systems/fs/context/authoring/parts/ctx.md +11 -1
- package/systems/fs/context/authoring/parts/ctx.reference/{hubai.md → adminnotices.md} +45 -4
- package/systems/fs/context/authoring/parts/ctx.reference/fnctx.md +21 -23
- package/systems/fs/context/authoring/parts/ctx.reference.md +8 -4
- package/systems/fs/context/authoring/parts/data.md +11 -6
- package/systems/fs/context/authoring/parts/data.reference.md +4 -0
- package/systems/fs/context/authoring/parts/examples/client-findview-vue.md +4 -0
- package/systems/fs/context/authoring/parts/examples/client-index-ts.md +4 -0
- package/systems/fs/context/authoring/parts/examples/client-notecard-vue.md +4 -0
- package/systems/fs/context/authoring/parts/examples/client-noteinput-vue.md +4 -0
- package/systems/fs/context/authoring/parts/examples/client-notespage-vue.md +4 -0
- package/systems/fs/context/authoring/parts/examples/client-reviewform-vue.md +4 -0
- package/systems/fs/context/authoring/parts/examples/client-wordcount-vue.md +4 -0
- package/systems/fs/context/authoring/parts/examples/package-json.md +4 -0
- package/systems/fs/context/authoring/parts/examples/server-env-ts.md +4 -0
- package/systems/fs/context/authoring/parts/examples/server-impl-ts.md +4 -0
- package/systems/fs/context/authoring/parts/examples/server-index-ts.md +4 -0
- package/systems/fs/context/authoring/parts/examples/server-main-ts.md +8 -4
- package/systems/fs/context/authoring/parts/examples/server-notes-test-ts.md +4 -0
- package/systems/fs/context/authoring/parts/examples/shared-index-ts.md +10 -0
- package/systems/fs/context/authoring/parts/examples/system-json.md +4 -0
- package/systems/fs/context/authoring/parts/examples/{systems-fs-shared-index-ts-lines-1-189.md → systems-fs-shared-index-ts-lines-1-178.md} +23 -30
- package/systems/fs/context/authoring/parts/examples/{systems-fs-shared-index-ts-lines-190-370.md → systems-fs-shared-index-ts-lines-179-382.md} +33 -6
- package/systems/fs/context/authoring/parts/examples/systems-fs-shared-index-ts-lines-383-567.md +210 -0
- package/systems/fs/context/authoring/parts/examples/systems-fs-shared-index-ts-lines-568-660.md +117 -0
- package/systems/fs/context/authoring/parts/examples/tsconfig-json.md +5 -1
- package/systems/fs/context/authoring/parts/examples.md +18 -11
- package/systems/fs/context/authoring/parts/fns.md +6 -2
- package/systems/fs/context/authoring/parts/fns.reference/fillclaims.md +5 -1
- package/systems/fs/context/authoring/parts/fns.reference/fn.md +6 -2
- package/systems/fs/context/authoring/parts/fns.reference.md +4 -0
- package/systems/fs/context/authoring/parts/folder.md +10 -6
- package/systems/fs/context/authoring/parts/gin.md +4 -0
- package/systems/fs/context/authoring/parts/gin.reference.md +4 -0
- package/systems/fs/context/authoring/parts/handlers-progress.md +5 -1
- package/systems/fs/context/authoring/parts/handlers-progress.reference.md +4 -0
- package/systems/fs/context/authoring/parts/hooks.md +5 -1
- package/systems/fs/context/authoring/parts/hooks.reference.md +5 -1
- package/systems/fs/context/authoring/parts/hub/context-questions.md +40 -0
- package/systems/fs/context/authoring/parts/hub/{hub-run-background.md → hub-ctx-from-resource.md} +52 -57
- package/systems/fs/context/authoring/parts/hub/hub-fns-load.md +35 -42
- package/systems/fs/context/authoring/parts/hub/hub-install-package.md +327 -0
- package/systems/fs/context/authoring/parts/hub/kinds-of-hub.md +8 -0
- package/systems/fs/context/authoring/parts/hub.md +14 -8
- package/systems/fs/context/authoring/parts/hub.reference.md +11 -2
- package/systems/fs/context/authoring/parts/internals/manifestof.md +6 -2
- package/systems/fs/context/authoring/parts/internals/permissionargs.md +8 -4
- package/systems/fs/context/authoring/parts/internals/usagefromwire.md +47 -2
- package/systems/fs/context/authoring/parts/internals.md +6 -2
- package/systems/fs/context/authoring/parts/kinds-agents.md +6 -2
- package/systems/fs/context/authoring/parts/kinds-agents.reference/authoringsession.md +10 -4
- package/systems/fs/context/authoring/parts/kinds-agents.reference/kind.md +11 -7
- package/systems/fs/context/authoring/parts/kinds-agents.reference.md +4 -0
- package/systems/fs/context/authoring/parts/lifecycle.md +8 -3
- package/systems/fs/context/authoring/parts/lifecycle.reference.md +6 -2
- package/systems/fs/context/authoring/parts/mentions.md +5 -1
- package/systems/fs/context/authoring/parts/mentions.reference.md +6 -2
- package/systems/fs/context/authoring/parts/mistakes.md +7 -2
- package/systems/fs/context/authoring/parts/named-types.md +4 -0
- package/systems/fs/context/authoring/parts/named-types.reference.md +6 -2
- package/systems/fs/context/authoring/parts/outcomes.md +7 -3
- package/systems/fs/context/authoring/parts/outcomes.reference.md +6 -2
- package/systems/fs/context/authoring/parts/owner-runs.md +5 -1
- package/systems/fs/context/authoring/parts/owner-runs.reference.md +36 -11
- package/systems/fs/context/authoring/parts/packaging.md +14 -7
- package/systems/fs/context/authoring/parts/packaging.reference.md +7 -2
- package/systems/fs/context/authoring/parts/providers.md +5 -1
- package/systems/fs/context/authoring/parts/providers.reference.md +5 -1
- package/systems/fs/context/authoring/parts/remote.md +9 -5
- package/systems/fs/context/authoring/parts/remote.reference.md +204 -16
- package/systems/fs/context/authoring/parts/resources.md +5 -1
- package/systems/fs/context/authoring/parts/resources.reference.md +4 -0
- package/systems/fs/context/authoring/parts/server.md +12 -8
- package/systems/fs/context/authoring/parts/server.reference.md +55 -34
- package/systems/fs/context/authoring/parts/settings-attachments.md +5 -1
- package/systems/fs/context/authoring/parts/settings-attachments.reference.md +4 -0
- package/systems/fs/context/authoring/parts/start.md +5 -1
- package/systems/fs/context/authoring/parts/state-forms.md +5 -1
- package/systems/fs/context/authoring/parts/state-forms.reference.md +4 -0
- package/systems/fs/context/authoring/parts/store/ctx-store.md +49 -0
- package/systems/fs/context/authoring/parts/store/declare.md +32 -0
- package/systems/fs/context/authoring/parts/store/engines.md +25 -0
- package/systems/fs/context/authoring/parts/store/migrations.md +53 -0
- package/systems/fs/context/authoring/parts/store/moves.md +38 -0
- package/systems/fs/context/authoring/parts/store/placement.md +25 -0
- package/systems/fs/context/authoring/parts/store/serve.md +30 -0
- package/systems/fs/context/authoring/parts/store/store-tables.md +24 -0
- package/systems/fs/context/authoring/parts/store/vectors.md +32 -0
- package/systems/fs/context/authoring/parts/store/when-to-use.md +27 -0
- package/systems/fs/context/authoring/parts/store/work.md +37 -0
- package/systems/fs/context/authoring/parts/store.md +65 -0
- package/systems/fs/context/authoring/parts/store.reference.md +459 -0
- package/systems/fs/context/authoring/parts/testing.md +14 -1
- package/systems/fs/context/authoring/parts/testing.reference/{memoryjournal.md → equal.md} +57 -50
- package/systems/fs/context/authoring/parts/testing.reference/fakehub.md +27 -46
- package/systems/fs/context/authoring/parts/testing.reference/{toolcall.md → kindprops.md} +128 -9
- package/systems/fs/context/authoring/parts/testing.reference/storeconnection.md +93 -0
- package/systems/fs/context/authoring/parts/testing.reference.md +16 -9
- package/systems/fs/context/authoring/parts/widgets.md +36 -22
- package/systems/fs/context/authoring/parts/widgets.reference.md +506 -8
- package/systems/fs/context/authoring/topics/begin.md +4 -0
- package/systems/fs/context/authoring/topics/client.md +4 -0
- package/systems/fs/context/authoring/topics/declare.md +4 -0
- package/systems/fs/context/authoring/topics/examples.md +4 -0
- package/systems/fs/context/authoring/topics/fns.md +4 -0
- package/systems/fs/context/authoring/topics/server.md +4 -0
- package/systems/fs/context/authoring/topics/types.md +8 -1
- package/systems/fs/context/comments/answer.md +21 -0
- package/systems/fs/context/comments/find.md +23 -0
- package/systems/fs/context/comments/read.md +26 -0
- package/systems/fs/context/comments.md +23 -0
- package/systems/fs/context/files-page.md +30 -0
- package/systems/fs/context/guide/attachments.md +16 -0
- package/systems/fs/context/guide/change.md +23 -0
- package/systems/fs/context/guide/commands.md +19 -0
- package/systems/fs/context/guide/documents.md +21 -0
- package/systems/fs/context/guide/find.md +25 -0
- package/systems/fs/context/guide/paths.md +24 -0
- package/systems/fs/context/guide/read.md +21 -0
- package/systems/fs/context/machine/history.md +25 -0
- package/systems/fs/context/machine/now.md +25 -0
- package/systems/fs/context/machine/processes.md +20 -0
- package/systems/fs/context/machine/recording.md +19 -0
- package/systems/fs/context/machine.md +24 -0
- package/systems/fs/package.json +5 -3
- package/systems/fs/server/files-page/browse.ts +391 -0
- package/systems/fs/server/files-page/comments.ts +439 -0
- package/systems/fs/server/files-page/fns.ts +158 -0
- package/systems/fs/server/files-page/git-view.ts +391 -0
- package/systems/fs/server/files-page/kinds.ts +56 -0
- package/systems/fs/server/hosting.ts +10 -10
- package/systems/fs/server/impl.ts +66 -7
- package/systems/fs/server/main.ts +28 -12
- package/systems/fs/server/metrics/collector.ts +424 -0
- package/systems/fs/server/metrics/index.ts +181 -0
- package/systems/fs/server/metrics/os.ts +144 -0
- package/systems/fs/server/metrics/parsers.ts +268 -0
- package/systems/fs/server/metrics/rrd.ts +363 -0
- package/systems/fs/server/metrics/testing.ts +80 -0
- package/systems/fs/server/shell.ts +1 -1
- package/systems/fs/server/snapshots.ts +216 -33
- package/systems/fs/server/testing.ts +15 -9
- package/systems/fs/shared/files-page.ts +506 -0
- package/systems/fs/shared/index.ts +138 -11
- package/systems/fs/shared/metrics.ts +179 -0
- package/systems/fs/system.json +10 -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 +3 -2
- 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 -4
- package/systems/schedule/server/env.ts +1 -1
- package/systems/schedule/server/fns.ts +5 -4
- package/systems/schedule/server/impl.ts +2 -2
- package/systems/schedule/server/import.ts +189 -0
- package/systems/schedule/server/index.ts +2 -0
- package/systems/schedule/server/main.ts +9 -7
- package/systems/schedule/server/placements.ts +41 -0
- package/systems/schedule/server/store.ts +159 -79
- package/systems/schedule/server/timer.ts +142 -107
- package/systems/schedule/shared/index.ts +2 -1
- package/systems/schedule/system.json +5 -1
- package/systems/schedule/tsconfig.json +1 -1
- 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-sLjVTrmV.js +0 -2
- package/packages/web/dist/assets/ApiServiceForm-BrMTU-7u.js +0 -2
- package/packages/web/dist/assets/ApiServiceForm-BxprSaAq.css +0 -1
- package/packages/web/dist/assets/ApiServiceView-BMF2zD6Q.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-bjLAWO_j.js +0 -2
- package/packages/web/dist/assets/ChartVisual-BnFG9aFi.css +0 -1
- package/packages/web/dist/assets/ChartVisual-DWw7WsfN.js +0 -11
- package/packages/web/dist/assets/ChatPage-7Yebk7rl.js +0 -4
- package/packages/web/dist/assets/ConfigWithCustom-DreTUdf0.js +0 -3
- package/packages/web/dist/assets/ContextItemPage-B6rJG3OT.js +0 -2
- package/packages/web/dist/assets/ContextItemPage-BRsWxOmu.css +0 -1
- package/packages/web/dist/assets/ContextPage-CloIZ_2y.js +0 -2
- package/packages/web/dist/assets/ContextPage-rYKxjiVI.css +0 -1
- package/packages/web/dist/assets/ContextRow-Byz_7HG-.css +0 -1
- package/packages/web/dist/assets/ContextRow-Dvv8CTFk.js +0 -2
- package/packages/web/dist/assets/DataTypePage-Ba_zBV4b.js +0 -4
- package/packages/web/dist/assets/FnList-BCnb4kOB.css +0 -1
- package/packages/web/dist/assets/FnList-CjQRwYaT.js +0 -2
- package/packages/web/dist/assets/GraphPanel-Cy5-KGo1.js +0 -2
- package/packages/web/dist/assets/InjectedList-CJsEFEbz.js +0 -2
- package/packages/web/dist/assets/InstallDialog-C9GDoUI2.js +0 -2
- package/packages/web/dist/assets/InstanceTypes-D8Jcxn70.js +0 -2
- package/packages/web/dist/assets/InstanceTypes-DAowwLB7.css +0 -1
- package/packages/web/dist/assets/InstanceView-CuBD3JPU.css +0 -1
- package/packages/web/dist/assets/InstanceView-p7tMaylE.js +0 -2
- package/packages/web/dist/assets/LimitsView-DsZG6u5P.js +0 -2
- package/packages/web/dist/assets/ListSearch-BK4p7Nxa.js +0 -2
- package/packages/web/dist/assets/McpDialog-CA_0WKWF.js +0 -2
- package/packages/web/dist/assets/McpServerForm-CAG8Wp2N.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-CD8qw6W_.js +0 -2
- package/packages/web/dist/assets/McpServersView-DNycG35u.js +0 -2
- package/packages/web/dist/assets/ModelsView-C_iN19xt.js +0 -2
- package/packages/web/dist/assets/PairPage-Bs2KuRjC.css +0 -1
- package/packages/web/dist/assets/PairPage-TEXPpsqi.js +0 -2
- package/packages/web/dist/assets/PeopleView-D1QGPYp7.js +0 -2
- package/packages/web/dist/assets/PoliciesView-BU1fudNF.js +0 -2
- package/packages/web/dist/assets/RemoteAuthFields-Dm44vz2t.css +0 -1
- package/packages/web/dist/assets/RemoteAuthFields-nxGWfmhf.js +0 -2
- package/packages/web/dist/assets/ResourcesPage-YluNBqIv.js +0 -2
- package/packages/web/dist/assets/ResultGrid-CuUQyTjW.css +0 -1
- package/packages/web/dist/assets/ResultGrid-uoq4yUYj.js +0 -2
- package/packages/web/dist/assets/ReviewView-79Z5rU1v.js +0 -3
- package/packages/web/dist/assets/RunCard-CBSGdwdQ.js +0 -2
- package/packages/web/dist/assets/RunCard-CfyRaDLS.css +0 -1
- package/packages/web/dist/assets/RunsView-Dz9Xsvu5.js +0 -2
- package/packages/web/dist/assets/ServiceRows-6BU4-MeL.css +0 -1
- package/packages/web/dist/assets/ServiceRows-DNzDiutg.js +0 -2
- 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-DLNg2FYK.js +0 -2
- package/packages/web/dist/assets/SystemView-Es5wtkYU.js +0 -2
- package/packages/web/dist/assets/SystemsView-CeuSFhlF.js +0 -2
- package/packages/web/dist/assets/WidgetView-BZyDyYRI.js +0 -3
- package/packages/web/dist/assets/WidgetView-DQUDeFkB.css +0 -1
- package/packages/web/dist/assets/export-BwFkEtcm.js +0 -15
- package/packages/web/dist/assets/index-Bv42jNvr.js +0 -4
- package/packages/web/dist/assets/index-CSisx5mi.css +0 -1
- package/packages/web/dist/assets/problems-BZY0Dwif.js +0 -2
- package/packages/web/dist/assets/record-edits-CveFEsal.js +0 -2
- package/packages/web/dist/assets/remote-config-BkaarDf3.js +0 -2
- package/packages/web/dist/assets/routes-qP_j74V5.js +0 -4
- package/packages/web/dist/assets/runs-k76usGfd.js +0 -2
- package/packages/web/dist/assets/size-BwnshyOe.js +0 -2
- package/packages/web/dist/assets/src-DLK1P7oz.js +0 -43
- package/packages/web/dist/assets/state-CjE-qA2w.js +0 -2
- package/packages/web/dist/assets/ui-W12UYhVu.js +0 -17
- package/packages/web/dist/assets/widget-host-BCf6Tlt5.js +0 -2
- package/packages/web/dist/assets/widgets-CrbkovMT.js +0 -2
- package/systems/fs/context/authoring/parts/client.reference/fnpillprops.md +0 -141
- package/systems/fs/context/authoring/parts/core-types/remote-auth-ts.md +0 -60
- package/systems/fs/context/authoring/parts/core-types/widgets-ts.md +0 -299
- package/systems/fs/context/authoring/parts/examples/systems-fs-shared-index-ts-lines-371-533.md +0 -183
- package/systems/fs/context/authoring/parts/hub/hub-auto-pair-revoke.md +0 -189
- package/systems/fs/context/authoring/parts/widgets.reference/hub-visuals.md +0 -623
- package/systems/fs/context/authoring/parts/widgets.reference/sourcecompatible.md +0 -150
|
@@ -61,7 +61,7 @@ export async function ensureHubActor(store: HubStore, clock: () => number, name:
|
|
|
61
61
|
|
|
62
62
|
/** The web build folder: the setting, or `packages/web/dist` beside the hub package. */
|
|
63
63
|
export function webDist(settings: HubSettings): string {
|
|
64
|
-
return settings.httpEnv.
|
|
64
|
+
return settings.httpEnv.FNLOOM_WEB_DIST === '' ? join(HUB_PACKAGE_DIR, '..', 'web', 'dist') : settings.httpEnv.FNLOOM_WEB_DIST;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
/** An empty ayepi server that plugins are installed into. */
|
|
@@ -99,7 +99,7 @@ export async function startHub(options: StartOptions & StartSeams): Promise<Runn
|
|
|
99
99
|
|
|
100
100
|
const store = await options.modules.store({
|
|
101
101
|
// vector tables are sized by the embedder's declaration once the index knows it (`vectors.ensure`)
|
|
102
|
-
file: settings.hubEnv.
|
|
102
|
+
file: settings.hubEnv.FNLOOM_DB_FILE, now: clock, log,
|
|
103
103
|
tuning: settings.storeEnv,
|
|
104
104
|
});
|
|
105
105
|
/** Once the lifecycle starts, stopping it closes the store and the log. */
|
|
@@ -107,50 +107,51 @@ export async function startHub(options: StartOptions & StartSeams): Promise<Runn
|
|
|
107
107
|
try {
|
|
108
108
|
await store.migrate();
|
|
109
109
|
const keys = await loadKeys(settings, options.keyMaker ?? { secret: randomSecret, vapid: generateVapidKeys });
|
|
110
|
-
const identity = await readHubIdentity(store, settings.hubEnv.
|
|
110
|
+
const identity = await readHubIdentity(store, settings.hubEnv.FNLOOM_NAME, HUB_INFO.version);
|
|
111
111
|
const hubActor = await ensureHubActor(store, clock, identity.name);
|
|
112
112
|
|
|
113
113
|
// the API docs take the name the hub started with
|
|
114
|
-
const web = emptyServer({ docs: settings.httpEnv.
|
|
115
|
-
thresholdMs: settings.httpEnv.
|
|
114
|
+
const web = emptyServer({ docs: settings.httpEnv.FNLOOM_DOCS ? { info: { title: identity.name, version: identity.version } } : false, shed: {
|
|
115
|
+
thresholdMs: settings.httpEnv.FNLOOM_SHED_THRESHOLD, sustainedMs: settings.httpEnv.FNLOOM_SHED_SUSTAINED, recoverMs: settings.httpEnv.FNLOOM_SHED_RECOVER,
|
|
116
116
|
response: () => Response.json({ error: { code: 'OVERLOADED', message: 'the hub is busy; try again shortly' } }, { status: 503, headers: { 'retry-after': '1' } }),
|
|
117
117
|
} });
|
|
118
118
|
const systems = peers(systemLinkSpec);
|
|
119
119
|
const link = emptyServer({ peers: systems });
|
|
120
|
-
// raw content and forms: files by default, the hub's database with
|
|
120
|
+
// raw content and forms: files by default, the hub's database with FNLOOM_CONTENT_AT=database
|
|
121
121
|
const contentFiles = openContentFiles({
|
|
122
|
-
at: settings.resourcesEnv.
|
|
123
|
-
busyTimeout: settings.storeEnv.
|
|
122
|
+
at: settings.resourcesEnv.FNLOOM_CONTENT_AT, dir: settings.hubEnv.FNLOOM_FILES_DIR, database: settings.hubEnv.FNLOOM_DB_FILE,
|
|
123
|
+
busyTimeout: settings.storeEnv.FNLOOM_DB_BUSY_TIMEOUT, clock, onError: (error, op, key) => { log.warn('files.failed', { op, key }, error); },
|
|
124
124
|
});
|
|
125
125
|
const files = new NamedContentFiles(contentFiles.files);
|
|
126
|
-
const mounted = mountFiles(web, files, { secret: keys.filesSecret, basePath: FILES_PATH, expiresIn: Math.round(settings.httpEnv.
|
|
126
|
+
const mounted = mountFiles(web, files, { secret: keys.filesSecret, basePath: FILES_PATH, expiresIn: Math.round(settings.httpEnv.FNLOOM_PRESIGN_TTL / 1000), now: clock });
|
|
127
127
|
|
|
128
128
|
const base: BaseServices = { settings, log, clock, bus, store };
|
|
129
|
-
const api = apiServices(base, { keys, files, presign: mounted.presign, pushSender: options.pushSender ?? webPushSender({ ...keys.vapid, subject: settings.pushEnv.
|
|
129
|
+
const api = apiServices(base, { keys, files, presign: mounted.presign, pushSender: options.pushSender ?? webPushSender({ ...keys.vapid, subject: settings.pushEnv.FNLOOM_VAPID_SUBJECT }) });
|
|
130
130
|
const { hub, builds } = assemble(base, api, options.modules, {
|
|
131
|
-
peers: systems, hubActor, systemTokens: new JwtSystemTokens({ secret: keys.jwtSecret, ttl: settings.authEnv.
|
|
131
|
+
peers: systems, hubActor, systemTokens: new JwtSystemTokens({ secret: keys.jwtSecret, ttl: settings.authEnv.FNLOOM_ACCESS_TTL }),
|
|
132
132
|
});
|
|
133
133
|
const modules = builds();
|
|
134
134
|
|
|
135
|
-
const {
|
|
136
|
-
|
|
135
|
+
const { FNLOOM_ADMIN_EMAIL: email, FNLOOM_ADMIN_PASSWORD: password } = settings.authEnv;
|
|
136
|
+
// the admin `fnloom start` makes is on this machine, so they get its time zone
|
|
137
|
+
if (email !== undefined && password !== undefined && await api.auth.bootstrap({ email, password, timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone })) {
|
|
137
138
|
log.info('auth.admin.bootstrapped', { email });
|
|
138
139
|
}
|
|
139
|
-
await announceSetup(api.auth, { file: join(settings.hubEnv.
|
|
140
|
+
await announceSetup(api.auth, { file: join(settings.hubEnv.FNLOOM_DATA, SETUP_FILE), hubUrl: settings.hubEnv.FNLOOM_URL, log });
|
|
140
141
|
|
|
141
142
|
const lc = updown<ComponentName>({
|
|
142
|
-
signals: options.signals === true ? SIGNALS : false, exit: options.signals === true, timeout: settings.httpEnv.
|
|
143
|
+
signals: options.signals === true ? SIGNALS : false, exit: options.signals === true, timeout: settings.httpEnv.FNLOOM_SHUTDOWN_TIMEOUT,
|
|
143
144
|
onError: (error, phase, component) => { log.error('lifecycle.failed', { phase, component }, error); },
|
|
144
145
|
});
|
|
145
146
|
// https on the port follows the admin's switch, read before the first connection
|
|
146
147
|
await api.https.load();
|
|
147
148
|
const front = new HttpFront({
|
|
148
|
-
web, link, mcp: { fetch: (request) => hub.mcp.endpoints.handle(request) }, health: { live: () => lc.isLive(), ready: () => lc.isReady() }, heartbeat: settings.httpEnv.
|
|
149
|
-
tokenMargin: settings.httpEnv.
|
|
150
|
-
maxMessage: { browser: settings.httpEnv.
|
|
149
|
+
web, link, mcp: { fetch: (request) => hub.mcp.endpoints.handle(request) }, health: { live: () => lc.isLive(), ready: () => lc.isReady() }, heartbeat: settings.httpEnv.FNLOOM_WS_HEARTBEAT,
|
|
150
|
+
tokenMargin: settings.httpEnv.FNLOOM_WS_TOKEN_MARGIN, clock, log,
|
|
151
|
+
maxMessage: { browser: settings.httpEnv.FNLOOM_WS_MAX_MESSAGE, link: settings.linkEnv.FNLOOM_MAX_FRAME }, linkGate: hub.link.gate,
|
|
151
152
|
files: [
|
|
152
153
|
new ConnectCallbackRoute(() => hub.connections), new SsoRoute(() => api.sso), new ClientBuildRoute({ content: api.content, lifecycle: () => hub.link.lifecycle }),
|
|
153
|
-
new AuthorityRoute(() => api.https.authority(), api.https.host), new WebAppRoute(webDist(settings), api.identity, settings.hubEnv.
|
|
154
|
+
new AuthorityRoute(() => api.https.authority(), api.https.host), new WebAppRoute(webDist(settings), api.identity, settings.hubEnv.FNLOOM_URL),
|
|
154
155
|
],
|
|
155
156
|
tls: api.https,
|
|
156
157
|
tokenExpiry: (token) => accessTokenExpiry(token, keys.jwtSecret),
|
|
@@ -158,7 +159,7 @@ export async function startHub(options: StartOptions & StartSeams): Promise<Runn
|
|
|
158
159
|
const onError = (error: unknown, phase: string, plugin: string): void => { log.warn('plugin.teardown.failed', { phase, plugin }, error); };
|
|
159
160
|
const webHost = createPluginHost(web, { onError });
|
|
160
161
|
const linkHost = createPluginHost(link, { onError });
|
|
161
|
-
let port = options.port ?? settings.hubEnv.
|
|
162
|
+
let port = options.port ?? settings.hubEnv.FNLOOM_PORT;
|
|
162
163
|
let sweeper: NodeJS.Timeout | undefined;
|
|
163
164
|
let certCheck: NodeJS.Timeout | undefined;
|
|
164
165
|
const work = moduleHooks(modules, 'work');
|
|
@@ -183,18 +184,18 @@ export async function startHub(options: StartOptions & StartSeams): Promise<Runn
|
|
|
183
184
|
{
|
|
184
185
|
name: COMPONENTS.http, deps: [COMPONENTS.work],
|
|
185
186
|
up: async () => {
|
|
186
|
-
port = await front.listen(port, settings.hubEnv.
|
|
187
|
+
port = await front.listen(port, settings.hubEnv.FNLOOM_HOST);
|
|
187
188
|
sweeper = setInterval(() => {
|
|
188
189
|
api.content.sweep().then((removed) => { if (removed > 0) { log.info('content.uploads.swept', { removed }); } }, (error: unknown) => {
|
|
189
190
|
log.warn('content.uploads.sweep.failed', {}, error);
|
|
190
191
|
});
|
|
191
|
-
}, settings.httpEnv.
|
|
192
|
+
}, settings.httpEnv.FNLOOM_PRESIGN_TTL);
|
|
192
193
|
sweeper.unref();
|
|
193
194
|
api.https.listening(port);
|
|
194
195
|
// a new Wi-Fi or Tailscale address needs a certificate that names it
|
|
195
196
|
certCheck = setInterval(() => { front.refreshTls(); }, TLS_RECHECK);
|
|
196
197
|
certCheck.unref();
|
|
197
|
-
log.info('hub.listening', { port, host: settings.hubEnv.
|
|
198
|
+
log.info('hub.listening', { port, host: settings.hubEnv.FNLOOM_HOST, version: HUB_INFO.version, https: api.https.enabled() ? api.https.source : 'off' });
|
|
198
199
|
},
|
|
199
200
|
pre: () => {
|
|
200
201
|
clearInterval(sweeper);
|
|
@@ -206,7 +207,7 @@ export async function startHub(options: StartOptions & StartSeams): Promise<Runn
|
|
|
206
207
|
{
|
|
207
208
|
name: COMPONENTS.links, deps: [COMPONENTS.http], up: links.up, post: links.post,
|
|
208
209
|
pre: async () => {
|
|
209
|
-
await hub.link.connections.stopAll('shutdown', settings.linkEnv.
|
|
210
|
+
await hub.link.connections.stopAll('shutdown', settings.linkEnv.FNLOOM_STOP_TIMEOUT);
|
|
210
211
|
await links.pre();
|
|
211
212
|
},
|
|
212
213
|
},
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import type { Type } from '@aeye/gin';
|
|
7
7
|
import type { Logger } from '@ayepi/log';
|
|
8
8
|
import {
|
|
9
|
-
apiContextName, dottedPath, ginValueCheck, injectTargetProblems, Json, MANIFEST_SECTION_NAMES, noFnStats, QualifiedName, qualify, roleLinkTo, runtimeNames, splitName, type ModelRole,
|
|
9
|
+
apiContextName, dottedPath, ginValueCheck, injectTargetProblems, Json, lastModifiedOf, MANIFEST_SECTION_NAMES, noFnStats, QualifiedName, qualify, roleLinkTo, runtimeNames, splitName, withStatus, type ModelRole,
|
|
10
10
|
type ActorId, type Availability, type ContextDecl, type ContextRecord, type FnDecl, type FnRecord, type GinTypeDef, type ImportReport,
|
|
11
11
|
type KindDecl, type KindRecord, type Manifest, type ManifestPatch, type ManifestSection, type SectionDecl,
|
|
12
12
|
type InstanceName, SystemName, type SystemProviderDecl, type TypeDecl, type TypeRecord, type DeclaredBy, type FnLink, type ApiGroupDecl,
|
|
@@ -17,7 +17,9 @@ import type { EventBus } from '../bus.ts';
|
|
|
17
17
|
import { removeLinksFrom, writeDerivedLinks } from '../contextor/graph.ts';
|
|
18
18
|
import { contextTokens } from '../contextor/tokens.ts';
|
|
19
19
|
import type { HubStore } from '../store/index.ts';
|
|
20
|
-
import { AvailabilityRules, heldFns, sameAvailability, systemAvailability, systemOf, unavailable } from './availability.ts';
|
|
20
|
+
import { AvailabilityRules, heldFns, HUB_SYSTEM, sameAvailability, systemAvailability, systemOf, unavailable } from './availability.ts';
|
|
21
|
+
import { carriedDecl, carriedFields } from '../questions/carry.ts';
|
|
22
|
+
import { readNewContextStatus, statusOnWrite } from '../questions/setting.ts';
|
|
21
23
|
import type { Catalog, CatalogEntry, CatalogFnNames, FnFilter, FnSignature, KindDescriber } from './index.ts';
|
|
22
24
|
import { StoreFnNames } from './fn-names.ts';
|
|
23
25
|
import { allRows, rows } from '../store/rows.ts';
|
|
@@ -147,6 +149,11 @@ interface ImportWork {
|
|
|
147
149
|
readonly describedTypes: Map<string, readonly string[]>;
|
|
148
150
|
/** The model names this import gave out so far, so two of its fns can't share one. */
|
|
149
151
|
readonly claimed: Map<string, QualifiedName>;
|
|
152
|
+
/**
|
|
153
|
+
* Someone is authoring a fn (`declare`): its kind's system is waited for while its store gets ready. The catalog's
|
|
154
|
+
* own work (imports, re-describing) never waits on a store, since the store's readiness reports wait on that work.
|
|
155
|
+
*/
|
|
156
|
+
readonly authoring: boolean;
|
|
150
157
|
/** The agents an injection may target: the stored ones and this import's, worked out at the first injection checked. */
|
|
151
158
|
agents?: QualifiedName[];
|
|
152
159
|
}
|
|
@@ -336,7 +343,7 @@ export class StoreCatalog implements Catalog {
|
|
|
336
343
|
return this.#serial.run(async () => {
|
|
337
344
|
await this.#load();
|
|
338
345
|
const name = qualify(system, decl.name);
|
|
339
|
-
const work = this.#work(system, true, this.#storedLookup, await this.#storedKinds());
|
|
346
|
+
const work = this.#work(system, true, this.#storedLookup, await this.#storedKinds(), true);
|
|
340
347
|
const existing = await this.fn(name);
|
|
341
348
|
if (existing?.origin === 'contract') { return { ...emptyReport(), refused: [{ name, problems: ['a fn of the contract has this name'] }] }; }
|
|
342
349
|
const problems = await this.#checkFn(work, decl, existing);
|
|
@@ -675,6 +682,8 @@ export class StoreCatalog implements Catalog {
|
|
|
675
682
|
const systemRow = await store.table('systems').get(system);
|
|
676
683
|
// an installed system's context stays off with the rest of it until it goes live
|
|
677
684
|
const contextSwitchedOff = systemRow?.enabled.context === false || systemRow?.stage === 'installed';
|
|
685
|
+
// what a new item starts as: the admin's setting for new context, except the hub's own, which is always in use
|
|
686
|
+
const newStatus = system === HUB_SYSTEM ? 'active' : (await readNewContextStatus(store)).value;
|
|
678
687
|
await store.tx(async (tx) => {
|
|
679
688
|
for (const decl of accepted.types) {
|
|
680
689
|
const name = qualify(system, decl.name);
|
|
@@ -702,15 +711,23 @@ export class StoreCatalog implements Catalog {
|
|
|
702
711
|
const name = qualify(system, decl.name);
|
|
703
712
|
const existing = await tx.table('context').get(name);
|
|
704
713
|
const by = declaredBy('context', decl.name);
|
|
705
|
-
if (changedNames.has(name) || force || existing?.declaredBy !== by) {
|
|
706
|
-
|
|
714
|
+
if (changedNames.has(name) || force || existing?.declaredBy !== by || existing.status === 'pending_removal') {
|
|
715
|
+
const version = await hashOf(decl);
|
|
716
|
+
// a new declaration keeps what people set on the item (its status, its system's switch) and what the hub found
|
|
717
|
+
// about it (metadata, flags, splits); a new item starts as the admin's setting for new context says
|
|
707
718
|
const kept: Partial<ContextRecord> = {
|
|
708
719
|
...(existing?.origin === undefined ? {} : { origin: existing.origin }),
|
|
709
|
-
...(existing
|
|
720
|
+
...statusOnWrite(existing, newStatus),
|
|
721
|
+
...carriedFields(existing),
|
|
722
|
+
// who asks its question, when the system says so (else what the metadata model found, carried above)
|
|
723
|
+
...(decl.askedBy === undefined ? {} : { askedBy: decl.askedBy }),
|
|
710
724
|
// a new item of a system whose context is switched off starts off with it
|
|
711
725
|
...(existing?.systemOff === undefined ? (contextSwitchedOff ? { systemOff: true } : {}) : { systemOff: existing.systemOff }),
|
|
726
|
+
// when its current version was first seen, unless it says when it was last modified
|
|
727
|
+
lastModified: decl.lastModified ?? (existing !== undefined && existing.version === version ? lastModifiedOf(existing) : now),
|
|
712
728
|
};
|
|
713
|
-
const
|
|
729
|
+
const made = await this.#contextRecord(tx, system, carriedDecl(existing, decl), accepted.context, now);
|
|
730
|
+
const record = await tx.table('context').put({ ...made, ...kept, declaredBy: by, version });
|
|
714
731
|
// the context graph's declared and mentioned edges are rewritten in the same transaction, so they never drift
|
|
715
732
|
await writeDerivedLinks(tx, record, now);
|
|
716
733
|
}
|
|
@@ -727,7 +744,18 @@ export class StoreCatalog implements Catalog {
|
|
|
727
744
|
apiChanged.push(...await this.#writeApiIndex(tx, system, accepted.context, next.groups ?? [], now, contextSwitchedOff));
|
|
728
745
|
for (const name of removedFrom.get('types') ?? []) { await tx.table('types').remove(name); }
|
|
729
746
|
for (const name of removedFrom.get('kinds') ?? []) { await tx.table('kinds').remove(name); }
|
|
730
|
-
for (const name of removedFrom.get('context') ?? []) {
|
|
747
|
+
for (const name of removedFrom.get('context') ?? []) {
|
|
748
|
+
const gone = await tx.table('context').get(name);
|
|
749
|
+
// plan `context-questions`: an item its system dropped keeps working until an admin confirms the removal
|
|
750
|
+
// (`hub/ctx_status`); one never approved, the hub's own, or one with no system actor to name goes at once
|
|
751
|
+
if (gone !== undefined && system !== HUB_SYSTEM && systemRow !== undefined && gone.status !== 'pending_approval' && gone.status !== 'pending_removal') {
|
|
752
|
+
await tx.table('context').put(withStatus(gone, 'pending_removal', { by: systemRow.actor, reason: `${system} no longer declares it (version ${next.version}).`, at: now }));
|
|
753
|
+
continue;
|
|
754
|
+
}
|
|
755
|
+
if (gone?.status === 'pending_removal') { continue; }
|
|
756
|
+
await tx.table('context').remove(name);
|
|
757
|
+
await removeLinksFrom(tx, name);
|
|
758
|
+
}
|
|
731
759
|
await tx.table('manifests').put({ system, manifest: stored, importedAt: now });
|
|
732
760
|
// every item that changed gets a version (a type's keeps its meta: a table's schema hash at that version)
|
|
733
761
|
await writeItemVersions(tx, system, itemChanges(previous, stored), now);
|
|
@@ -780,7 +808,8 @@ export class StoreCatalog implements Catalog {
|
|
|
780
808
|
if (existing !== undefined && sameDecl(existing.decl, decl)) { continue; }
|
|
781
809
|
const record = await table.put({
|
|
782
810
|
...await this.#contextRecord(tx, system, decl, decls, now), origin: { type: 'system' }, declaredBy: 'runtime', version: await hashOf(decl),
|
|
783
|
-
|
|
811
|
+
// the hub writes API index items itself: they are in use at once, and keep the status a person gave them
|
|
812
|
+
...statusOnWrite(existing, 'active'), lastModified: now,
|
|
784
813
|
...(existing?.systemOff === undefined ? (off ? { systemOff: true } : {}) : { systemOff: existing.systemOff }),
|
|
785
814
|
});
|
|
786
815
|
await writeDerivedLinks(tx, record, now);
|
|
@@ -894,7 +923,8 @@ export class StoreCatalog implements Catalog {
|
|
|
894
923
|
/**
|
|
895
924
|
* Check a fn of a kind against the kind's payload type, then have the kind's system describe it. The description
|
|
896
925
|
* must fit the args and result the author declared. Native fns need neither. A kind whose system can't be reached
|
|
897
|
-
* leaves the fn as declared; it is described when that system connects
|
|
926
|
+
* leaves the fn as declared; it is described when that system connects, or when its store is ready (a system whose
|
|
927
|
+
* store isn't ready can't be reached for the catalog's own work: see `ImportWork.authoring`).
|
|
898
928
|
*/
|
|
899
929
|
async #describe(work: ImportWork, decl: FnDecl): Promise<string[]> {
|
|
900
930
|
if (decl.kind === 'native') { return []; }
|
|
@@ -905,7 +935,7 @@ export class StoreCatalog implements Catalog {
|
|
|
905
935
|
if (payloadProblems.length > 0) { return payloadProblems.map((p) => `payload: ${p}`); }
|
|
906
936
|
let answer: Awaited<ReturnType<KindDescriber['describe']>>;
|
|
907
937
|
try {
|
|
908
|
-
answer = await this.options.describer.describe(decl.kind, decl.payload, decl.routing?.to === 'instance' ? decl.routing.instance : undefined);
|
|
938
|
+
answer = await this.options.describer.describe(decl.kind, decl.payload, decl.routing?.to === 'instance' ? decl.routing.instance : undefined, { wait: work.authoring });
|
|
909
939
|
} catch (error) {
|
|
910
940
|
this.options.log.info('catalog.describe.unreachable', { fn: qualify(work.system, decl.name), kind: decl.kind, error: messageOf(error) });
|
|
911
941
|
return [];
|
|
@@ -1012,13 +1042,13 @@ export class StoreCatalog implements Catalog {
|
|
|
1012
1042
|
if ((await store.table('fns').get(name)) !== undefined) { fns.push(name); }
|
|
1013
1043
|
else if (ownContext.has(name) || (await store.table('context').get(name)) !== undefined) { context.push(name); }
|
|
1014
1044
|
}
|
|
1015
|
-
return { name: qualify(system, decl.name), system, decl, mentions: { context, fns }, tokens: contextTokens(decl), stale: false, updatedAt: now };
|
|
1045
|
+
return { name: qualify(system, decl.name), system, decl, status: 'active', mentions: { context, fns }, tokens: contextTokens(decl), stale: false, updatedAt: now };
|
|
1016
1046
|
}
|
|
1017
1047
|
|
|
1018
1048
|
// ─── Loading ──────────────────────────────────────────────────────────────
|
|
1019
1049
|
|
|
1020
|
-
#work(system: SystemName, force: boolean, lookup: TypeLookup, kinds: Map<string, KindDecl
|
|
1021
|
-
return { system, force, lookup, kinds, described: new Map(), describedTypes: new Map(), claimed: new Map() };
|
|
1050
|
+
#work(system: SystemName, force: boolean, lookup: TypeLookup, kinds: Map<string, KindDecl>, authoring = false): ImportWork {
|
|
1051
|
+
return { system, force, lookup, kinds, described: new Map(), describedTypes: new Map(), claimed: new Map(), authoring };
|
|
1022
1052
|
}
|
|
1023
1053
|
|
|
1024
1054
|
async #storedKinds(): Promise<Map<string, KindDecl>> {
|
|
@@ -39,8 +39,12 @@ export interface FnSignature {
|
|
|
39
39
|
|
|
40
40
|
/** Asks a kind's system to check and describe a payload (over the link). */
|
|
41
41
|
export interface KindDescriber {
|
|
42
|
-
/**
|
|
43
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Describe a payload of a kind; `instance` is the fleet instance the fn belongs to (`routing.to = 'instance'`), which
|
|
44
|
+
* knows its tables. With `wait`, a call to a system whose store isn't ready waits for it (someone authoring a fn);
|
|
45
|
+
* without, such a system is unreachable at once (the catalog's own bookkeeping, which runs again once it is ready).
|
|
46
|
+
*/
|
|
47
|
+
describe(kind: QualifiedName, payload: Json, instance?: InstanceName, options?: { readonly wait?: boolean }): Promise<{ problems: string[]; description?: KindDescription | undefined }>;
|
|
44
48
|
}
|
|
45
49
|
|
|
46
50
|
/**
|
|
@@ -38,7 +38,7 @@ function payloadOf(payload: unknown): Pick<LlmPayload, 'mode' | 'contextor'> {
|
|
|
38
38
|
/** The cache miss of an assistant message's first model call, if it was one. */
|
|
39
39
|
export async function cacheMissOf(deps: Pick<ChatDeps, 'store' | 'catalog' | 'settings'>, message: Pick<ChatMessage, 'session' | 'turn' | 'createdAt'>): Promise<ChatMessage['cacheMiss']> {
|
|
40
40
|
const calls = deps.store.table('modelCalls');
|
|
41
|
-
const lookback = deps.settings.chat.
|
|
41
|
+
const lookback = deps.settings.chat.FNLOOM_CACHE_LOOKBACK;
|
|
42
42
|
const mine = await calls.find({ where: { session: message.session, turn: message.turn, modality: 'chat', startedAt: { gte: message.createdAt } }, order: [['startedAt', 'asc']], limit: lookback });
|
|
43
43
|
const first = mine.items.find(agentChat);
|
|
44
44
|
if (first?.units.modality !== 'chat' || first.units.caching !== 'yes' || cachedOf(first) > 0) return undefined;
|
|
@@ -54,7 +54,7 @@ export function createChat(given: ChatDeps): ChatModule {
|
|
|
54
54
|
const reply = new SessionReplyRule();
|
|
55
55
|
const suggestions = new HubSuggestions(deps);
|
|
56
56
|
const enrich = new HubMessageEnricher(deps, suggestions);
|
|
57
|
-
const mentionRequests = new StoreMentionRequests({ keys: () => deps.store.ports.work.store, ttl: deps.settings.chat.
|
|
57
|
+
const mentionRequests = new StoreMentionRequests({ keys: () => deps.store.ports.work.store, ttl: deps.settings.chat.FNLOOM_MENTION_REQUEST_TTL, ...(deps.random === undefined ? {} : { random: deps.random }) });
|
|
58
58
|
const mentions = new ChatMentions(deps, people, [new HubMentions(deps), new LinkedMentions(deps, mentionRequests)]);
|
|
59
59
|
const notifications = new StoreNotifications(deps, presence);
|
|
60
60
|
const state = new TableStateService(deps);
|
|
@@ -236,7 +236,7 @@ export class StoreCompareService implements CompareService {
|
|
|
236
236
|
if (own === undefined) { throw new ChatError('not-found', `No turn ${variant.turn}.`); }
|
|
237
237
|
// a chosen variant's messages have moved to the compared turn
|
|
238
238
|
const answers = turn.compare?.chosen === variant.variant ? turn.id : own.id;
|
|
239
|
-
const messages = (await store.table('messages').find({ where: { turn: answers, role: 'assistant' }, order: [['createdAt', 'asc']], limit: settings.chat.
|
|
239
|
+
const messages = (await store.table('messages').find({ where: { turn: answers, role: 'assistant' }, order: [['createdAt', 'asc']], limit: settings.chat.FNLOOM_MESSAGE_PAGE })).items;
|
|
240
240
|
const root = own.root === undefined ? undefined : await store.table('runs').get(own.root);
|
|
241
241
|
const asking = await allRows(store.table('runs'), { where: { turn: answers, status: 'awaiting-approval' } });
|
|
242
242
|
const approvals = (await Promise.all(asking.map(async (run) => allRows(store.table('approvals'), { where: { run: run.id, status: 'pending' } })))).flat();
|
|
@@ -265,7 +265,7 @@ export class StoreCompareService implements CompareService {
|
|
|
265
265
|
|
|
266
266
|
/** What a variant did that stays done: its tool runs that finished and change things (not reads, not agents). */
|
|
267
267
|
async #effects(turn: TurnId): Promise<CompareEffect[]> {
|
|
268
|
-
const runs = await someRows(this.#deps.store.table('runs'), { where: { turn, status: 'done' }, order: [['createdAt', 'asc']] }, this.#deps.settings.chat.
|
|
268
|
+
const runs = await someRows(this.#deps.store.table('runs'), { where: { turn, status: 'done' }, order: [['createdAt', 'asc']] }, this.#deps.settings.chat.FNLOOM_UNDO_RUNS);
|
|
269
269
|
const effects: CompareEffect[] = [];
|
|
270
270
|
for (const run of runs) { if (await this.#changes(run)) { effects.push({ run: run.id, fn: run.fn }); } }
|
|
271
271
|
return effects;
|
|
@@ -166,7 +166,7 @@ export class LinkDeliveryService implements DeliveryService {
|
|
|
166
166
|
|
|
167
167
|
/** Call the system: an action with its asker (its result checked against the action's type), or a form. */
|
|
168
168
|
async #send(delivery: DeliveryRecord): Promise<Json | undefined> {
|
|
169
|
-
const timeout = this.#deps.settings.chat.
|
|
169
|
+
const timeout = this.#deps.settings.chat.FNLOOM_DELIVERY_TIMEOUT;
|
|
170
170
|
const { kind } = delivery;
|
|
171
171
|
if ('form' in kind) {
|
|
172
172
|
await callSystem(this.#deps.link, delivery.system, timeout, (c, signal) => c.peer.call('form', { delivery: delivery.id, run: kind.form, value: kind.value }, { signal }));
|
|
@@ -19,8 +19,8 @@ import type { ChatEnv } from './env.ts';
|
|
|
19
19
|
/** The hub settings chat reads: its own slice, and the shared ones it follows. */
|
|
20
20
|
export interface ChatSettings {
|
|
21
21
|
readonly chat: ChatEnv;
|
|
22
|
-
readonly queue: Pick<HubSettings['queueEnv'], '
|
|
23
|
-
readonly model: Pick<HubSettings['modelEnv'], '
|
|
22
|
+
readonly queue: Pick<HubSettings['queueEnv'], 'FNLOOM_ACTIVE_WINDOW'>;
|
|
23
|
+
readonly model: Pick<HubSettings['modelEnv'], 'FNLOOM_SUGGESTIONS'>;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
/** Everything chat uses, by the interface that provides it. */
|
|
@@ -52,7 +52,7 @@ export interface ChatDeps {
|
|
|
52
52
|
* The room, in tokens, the prompt for a message has besides its fixed part (the session's agent model's window less
|
|
53
53
|
* its output, reasoning, margin, instructions, tools and the message itself: the contextor's flexible budget), so
|
|
54
54
|
* context a suggestions chooser loads into the message is sized to it. Undefined when it can't be told (no agent, no
|
|
55
|
-
* planner); then only `
|
|
55
|
+
* planner); then only `FNLOOM_AUTOLOAD_TOKENS` holds it.
|
|
56
56
|
*/
|
|
57
57
|
readonly promptRoom?: (input: { session: SessionId; text: string; actor: ActorId }) => Promise<number | undefined>;
|
|
58
58
|
/**
|
|
@@ -331,8 +331,8 @@ export class HubMessageEnricher implements MessageEnricher {
|
|
|
331
331
|
}
|
|
332
332
|
|
|
333
333
|
/**
|
|
334
|
-
* The person's memories whose meaning is closest to the message (iteration 4): up to `
|
|
335
|
-
* at or over `
|
|
334
|
+
* The person's memories whose meaning is closest to the message (iteration 4): up to `FNLOOM_RECALL_MEMORIES`, each
|
|
335
|
+
* at or over `FNLOOM_RECALL_THRESHOLD`, brought in as their text (`<loaded_for_you>`, `by: 'recall'`), so a kept
|
|
336
336
|
* preference, limit or detail is in front of the model in a new chat without it having to think of searching
|
|
337
337
|
* (iteration 3, case 28: the model searched in the chat it saved the memory in, never in the next one). Only memories
|
|
338
338
|
* the person may see in this chat (a session memory only in its own chat), on, and not suggested, loaded or recalled
|
|
@@ -341,7 +341,7 @@ export class HubMessageEnricher implements MessageEnricher {
|
|
|
341
341
|
* fits. Undefined when nothing fits or the search fails (logged).
|
|
342
342
|
*/
|
|
343
343
|
async #recall(at: { session: Session; actor: ActorId; toolset: ChatModeType; text: string }, taken: readonly QualifiedName[]): Promise<LoadedForYouPart | undefined> {
|
|
344
|
-
const {
|
|
344
|
+
const { FNLOOM_RECALL_MEMORIES: most, FNLOOM_RECALL_THRESHOLD: least } = this.#deps.settings.chat;
|
|
345
345
|
if (most === 0 || at.text.trim() === '') return undefined;
|
|
346
346
|
const { session } = at;
|
|
347
347
|
const seen: string[] = [...new Set<string>([...(session.suggested ?? []), ...session.context, ...(session.fixed?.injected ?? []), ...taken])];
|
|
@@ -376,16 +376,16 @@ export class HubMessageEnricher implements MessageEnricher {
|
|
|
376
376
|
}
|
|
377
377
|
|
|
378
378
|
/**
|
|
379
|
-
* The most tokens of context text a chooser may load into one message: `
|
|
380
|
-
* `
|
|
379
|
+
* The most tokens of context text a chooser may load into one message: `FNLOOM_AUTOLOAD_TOKENS`, and no more than
|
|
380
|
+
* `FNLOOM_AUTOLOAD_ROOM_SHARE` of the room the prompt has besides its fixed part (`ChatDeps.promptRoom`), so the
|
|
381
381
|
* contextor's plan, which counts the message in its fixed part, still has room for the history.
|
|
382
382
|
*/
|
|
383
383
|
async #contextRoom(at: { session: Session; actor: ActorId; text: string }): Promise<number> {
|
|
384
|
-
const cap = this.#deps.settings.chat.
|
|
384
|
+
const cap = this.#deps.settings.chat.FNLOOM_AUTOLOAD_TOKENS;
|
|
385
385
|
if (cap === 0 || this.#deps.promptRoom === undefined) return cap;
|
|
386
386
|
try {
|
|
387
387
|
const room = await this.#deps.promptRoom({ session: at.session.id, text: at.text, actor: at.actor });
|
|
388
|
-
return room === undefined ? cap : Math.max(0, Math.min(cap, Math.floor(room * this.#deps.settings.chat.
|
|
388
|
+
return room === undefined ? cap : Math.max(0, Math.min(cap, Math.floor(room * this.#deps.settings.chat.FNLOOM_AUTOLOAD_ROOM_SHARE)));
|
|
389
389
|
} catch (error) {
|
|
390
390
|
this.#deps.log.warn('chat.suggest.room-unknown', { session: at.session.id, error: messageOf(error) });
|
|
391
391
|
return cap;
|
|
@@ -7,26 +7,26 @@ import { z } from 'zod';
|
|
|
7
7
|
|
|
8
8
|
/** Chat tunables. */
|
|
9
9
|
export const chatEnv = env({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
10
|
+
FNLOOM_MENTION_TIMEOUT: z.number().int().min(100).default(5_000).describe('How long a system has to write a mention\'s LLM text when a message is sent.'),
|
|
11
|
+
FNLOOM_MENTION_SEARCH_TIMEOUT: z.number().int().min(100).default(3_000).describe('How long a system has to answer `@` search and hover.'),
|
|
12
|
+
FNLOOM_MENTION_REQUEST_TTL: z.number().int().min(1_000).default(120_000).describe('How long a system may search the hub\'s resources for an `@` search the hub sent it, as the person mentioning.'),
|
|
13
|
+
FNLOOM_DELIVERY_TIMEOUT: z.number().int().min(100).default(30_000).describe('How long a system has to answer one delivered action or form.'),
|
|
14
|
+
FNLOOM_MESSAGE_PAGE: z.number().int().min(1).max(200).default(50).describe('Messages per page when a request gives no limit.'),
|
|
15
|
+
FNLOOM_SESSION_PAGE: z.number().int().min(1).max(200).default(30).describe('Sessions per page when a request gives no limit.'),
|
|
16
|
+
FNLOOM_TITLE_LENGTH: z.number().int().min(8).default(60).describe('A session titled by its first message keeps this many characters of it.'),
|
|
17
|
+
FNLOOM_FILE_INLINE_CHARS: z.number().int().min(0).default(4_000).describe('An attached text file (plain text, markdown, CSV, JSON…) is put in the message for the model up to this many characters (the rest read with hub/resource_read); 0 puts none in.'),
|
|
18
|
+
FNLOOM_TURN_ERRORS: z.number().int().min(0).default(3).describe('A turn stops after this many failed runs; 0 keeps feeding errors back to the agent.'),
|
|
19
|
+
FNLOOM_SUGGEST_THRESHOLD: z.number().min(0).max(1).default(0.3).describe('The least score (its similarity of meaning to the message, 0 to 1) a fn or context item needs to be suggested with a message when no model picks suggestions, or the one that does fails. With EmbeddingGemma a close fit scores 0.35 to 0.7, a relevant general fn 0.2 to 0.3, and the median item 0.09 to 0.19 (measured 2026-11-22).'),
|
|
20
|
+
FNLOOM_SUGGEST_DECISION_TIMEOUT: z.number().int().min(500).default(4_000).describe('How long the suggestion decision model has to choose before the score decides; a sent message waits this long at most before it shows.'),
|
|
21
|
+
FNLOOM_AUTOLOAD_TOKENS: z.number().int().min(0).default(6_000).describe('The most tokens of context text a suggestions chooser whose action is `load` may bring into one message (estimated); what doesn\'t fit is suggested instead. 0 loads no context (fns still load).'),
|
|
22
|
+
FNLOOM_AUTOLOAD_ROOM_SHARE: z.number().min(0).max(1).default(0.25).describe('The share of the prompt\'s room (the agent model\'s window less its output, reasoning, margin, instructions, tools and the message) that context loaded into a message may take, under FNLOOM_AUTOLOAD_TOKENS, so it never crowds out the chat\'s history.'),
|
|
23
|
+
FNLOOM_RECALL_MEMORIES: z.number().int().min(0).max(20).default(3).describe('The most memories of the person\'s brought into a message as their text (`<loaded_for_you>`) because their meaning is close to it, each once a chat, whatever picks suggestions; 0 recalls none (memories are then found only by search). Memories are not otherwise in front of the model in a new chat.'),
|
|
24
|
+
FNLOOM_RECALL_THRESHOLD: z.number().min(0).max(1).default(0.2).describe('The least similarity of meaning (0 to 1) a memory needs to its message to be recalled into it. Lower than FNLOOM_SUGGEST_THRESHOLD: a memory is one short sentence about the person, and a message that depends on it rarely restates it (iteration 3: a kept fact about what to avoid scored 0.24 to 0.27 to the later request it bore on, under the 0.3 suggestion threshold, and was missed in all three runs).'),
|
|
25
|
+
FNLOOM_CACHE_LOOKBACK: z.number().int().min(1).max(500).default(50).describe('How many of a session\'s model calls are looked through to tell whether a reply missed the prompt cache.'),
|
|
26
|
+
FNLOOM_CONFIG_NOTICE_GRACE: z.number().int().min(0).default(30_000).describe('How long a system may sit in "needs config" before the admins get an inbox notice; a system that connects configured within it gets none (as a fresh hub\'s systems usually do).'),
|
|
27
|
+
FNLOOM_CITE_HOLD_CHARS: z.number().int().min(64).default(2_000).describe('How long a cite (from <cite to </cite>) may run while an answer streams: until it closes the text is held back; longer, it was no cite and shows as text.'),
|
|
28
|
+
FNLOOM_CITE_VALUE_CHARS: z.number().int().min(0).default(4_000).describe('The most characters of JSON a cited value may take to be kept on its message; a larger one is read from its run\'s result.'),
|
|
29
|
+
FNLOOM_UNDO_RUNS: z.number().int().min(1).default(500).describe('The most runs one turn\'s undo looks at.'),
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
/** The parsed chat tunables. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Mention requests (build 8, `core/mention-search.ts`): each `@` search the hub sends a system gets an id tied to the
|
|
3
3
|
* person asking, their session and the system asked, kept in the hub's key/value store for
|
|
4
|
-
* `
|
|
4
|
+
* `FNLOOM_MENTION_REQUEST_TTL`. While it is fresh the system may search the hub's resources for it
|
|
5
5
|
* (`mentionResources` on the hub link), and the search runs as that person, so a system can only ever search for the
|
|
6
6
|
* person it was asked about.
|
|
7
7
|
*/
|
|
@@ -44,7 +44,7 @@ export async function searchForMention(deps: MentionSearchDeps, data: MentionRes
|
|
|
44
44
|
const seen = keepSeen(access, { context: (name) => deps.catalog().context(name), type: (name) => deps.catalog().type(name) }, session.id);
|
|
45
45
|
const roots = data.roots;
|
|
46
46
|
const found = await deps.search().search({
|
|
47
|
-
// words alone: an `@` search answers as the person types, inside
|
|
47
|
+
// words alone: an `@` search answers as the person types, inside FNLOOM_MENTION_SEARCH_TIMEOUT, which waiting on the
|
|
48
48
|
// embedder for the query's vector would use up
|
|
49
49
|
text: data.query, kinds: ['section'], limit: data.limit, systems: searchSystems(session), match: 'text',
|
|
50
50
|
// inside the roots the system asked for, as the person may see them; checked before the limit counts
|
|
@@ -158,16 +158,16 @@ export class LinkedMentions implements MentionProvider {
|
|
|
158
158
|
async search(ask: MentionAsk, query: string): Promise<MentionOption[]> {
|
|
159
159
|
// the search is tied to the person asking, so the system may search the hub's resources for them (`mentionResources`)
|
|
160
160
|
const request = await this.#requests.mint({ system: SystemName.parse(splitName(ask.provider).system), actor: ask.actor, session: ask.session });
|
|
161
|
-
return this.#call(ask, this.#deps.settings.chat.
|
|
161
|
+
return this.#call(ask, this.#deps.settings.chat.FNLOOM_MENTION_SEARCH_TIMEOUT, (peer, body, signal) => peer.call('mentions', { ...body, query, request }, { signal }));
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
async hover(ask: MentionAsk, target: Json): Promise<MentionHover | undefined> {
|
|
165
|
-
const { hover } = await this.#call(ask, this.#deps.settings.chat.
|
|
165
|
+
const { hover } = await this.#call(ask, this.#deps.settings.chat.FNLOOM_MENTION_SEARCH_TIMEOUT, (peer, body, signal) => peer.call('mentionHover', { ...body, target }, { signal }));
|
|
166
166
|
return hover;
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
async text(ask: MentionAsk, target: Json): Promise<string> {
|
|
170
|
-
const { text } = await this.#call(ask, this.#deps.settings.chat.
|
|
170
|
+
const { text } = await this.#call(ask, this.#deps.settings.chat.FNLOOM_MENTION_TIMEOUT, (peer, body, signal) => peer.call('mentionText', { ...body, target }, { signal }));
|
|
171
171
|
return text;
|
|
172
172
|
}
|
|
173
173
|
|
|
@@ -85,7 +85,7 @@ export class StoreNotifications implements NotificationService {
|
|
|
85
85
|
readonly #deps: Pick<ChatDeps, 'store' | 'clock' | 'random' | 'bus' | 'push' | 'log' | 'settings'>;
|
|
86
86
|
readonly #presence: PresenceTracker;
|
|
87
87
|
readonly #seen = new RecentSet(REMEMBERED);
|
|
88
|
-
/** Systems in "needs config" whose notice waits out the grace (`
|
|
88
|
+
/** Systems in "needs config" whose notice waits out the grace (`FNLOOM_CONFIG_NOTICE_GRACE`). */
|
|
89
89
|
readonly #waiting = new Map<SystemName, ReturnType<typeof setTimeout>>();
|
|
90
90
|
|
|
91
91
|
constructor(deps: Pick<ChatDeps, 'store' | 'clock' | 'random' | 'bus' | 'push' | 'log' | 'settings'>, presence: PresenceTracker) {
|
|
@@ -239,7 +239,7 @@ export class StoreNotifications implements NotificationService {
|
|
|
239
239
|
await this.#admins((user) => this.notify({ user, reason: 'system-disconnected', title: `${system} disconnected`, body: 'Its fns are unavailable until it connects again.', link: { system } }));
|
|
240
240
|
}
|
|
241
241
|
if (status !== 'needs-config') { return; }
|
|
242
|
-
const grace = this.#deps.settings.chat.
|
|
242
|
+
const grace = this.#deps.settings.chat.FNLOOM_CONFIG_NOTICE_GRACE;
|
|
243
243
|
if (grace === 0) { await this.#configNeeded(system); return; }
|
|
244
244
|
// a fresh hub's systems often connect before their config arrives: tell the admins only if it stays that way
|
|
245
245
|
this.#waiting.set(system, setTimeout(() => {
|
|
@@ -31,7 +31,7 @@ export class MemoryPresence implements PresenceTracker {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
#focused(match: (presence: Presence) => boolean): boolean {
|
|
34
|
-
const since = this.#deps.clock() - this.#deps.settings.queue.
|
|
34
|
+
const since = this.#deps.clock() - this.#deps.settings.queue.FNLOOM_ACTIVE_WINDOW;
|
|
35
35
|
for (const presence of this.#seen.values()) {
|
|
36
36
|
if (presence.focused && presence.lastActiveAt >= since && match(presence)) { return true; }
|
|
37
37
|
}
|
|
@@ -40,7 +40,7 @@ export class MemoryPresence implements PresenceTracker {
|
|
|
40
40
|
|
|
41
41
|
/** Forget presence older than the active window, so the map stays as small as the people here. */
|
|
42
42
|
#prune(now: number): void {
|
|
43
|
-
const since = now - this.#deps.settings.queue.
|
|
43
|
+
const since = now - this.#deps.settings.queue.FNLOOM_ACTIVE_WINDOW;
|
|
44
44
|
for (const [key, presence] of this.#seen) {
|
|
45
45
|
if (presence.lastActiveAt < since) { this.#seen.delete(key); }
|
|
46
46
|
}
|
|
@@ -98,7 +98,7 @@ export class StoreSessionService implements SessionService {
|
|
|
98
98
|
async list(viewer: ActorId, query: Compact<SessionListQuery>): Promise<Page<SessionSummary>> {
|
|
99
99
|
const page = await filteredPage(
|
|
100
100
|
this.#deps.store.table('sessions'),
|
|
101
|
-
{ where: { owner: viewer, archived: false, forkOf: { exists: false } }, order: [['updatedAt', 'desc']], limit: query.limit ?? this.#deps.settings.chat.
|
|
101
|
+
{ where: { owner: viewer, archived: false, forkOf: { exists: false } }, order: [['updatedAt', 'desc']], limit: query.limit ?? this.#deps.settings.chat.FNLOOM_SESSION_PAGE, cursor: query.cursor },
|
|
102
102
|
() => true,
|
|
103
103
|
);
|
|
104
104
|
return { items: page.items.map((s) => SessionSummary.parse(s)), ...(page.cursor === undefined ? {} : { cursor: page.cursor }) };
|
|
@@ -172,7 +172,7 @@ export class StoreSessionService implements SessionService {
|
|
|
172
172
|
async messages(session: SessionId, viewer: ActorId, query: Compact<Omit<MessageListQuery, 'session'>>): Promise<Page<ChatMessage>> {
|
|
173
173
|
await this.require(session, viewer);
|
|
174
174
|
const page = await this.#deps.store.table('messages').find({
|
|
175
|
-
where: { session }, order: [['createdAt', 'desc']], limit: query.limit ?? this.#deps.settings.chat.
|
|
175
|
+
where: { session }, order: [['createdAt', 'desc']], limit: query.limit ?? this.#deps.settings.chat.FNLOOM_MESSAGE_PAGE, cursor: query.cursor,
|
|
176
176
|
});
|
|
177
177
|
return { items: page.items.map((m) => this.#streams.overlay(m)), ...(page.cursor === undefined ? {} : { cursor: page.cursor }) };
|
|
178
178
|
}
|