fnloom 0.3.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 +27 -20
- package/package.json +14 -11
- package/packages/build/package.json +2 -2
- package/packages/build/src/tests.ts +2 -2
- package/packages/cli/package.json +1 -1
- package/packages/cli/src/cli.ts +2 -2
- package/packages/cli/src/command.ts +2 -2
- package/packages/cli/src/commands/install.ts +1 -1
- package/packages/cli/src/commands/mcp.ts +6 -6
- package/packages/cli/src/commands/store.ts +3 -3
- package/packages/cli/src/hub.ts +25 -25
- package/packages/cli/src/index.ts +1 -1
- package/packages/cli/src/io.ts +2 -2
- package/packages/cli/src/local.ts +7 -7
- package/packages/cli/src/premade.ts +1 -1
- package/packages/core/package.json +4 -4
- package/packages/core/src/auto-pair.ts +1 -1
- package/packages/core/src/connections.ts +1 -14
- package/packages/core/src/context-graph.ts +1 -1
- package/packages/core/src/data.ts +1 -1
- package/packages/core/src/https.ts +2 -2
- package/packages/core/src/identity.ts +1 -1
- package/packages/core/src/image-embeddings.ts +1 -1
- package/packages/core/src/index.ts +5 -7
- package/packages/core/src/link.ts +1 -1
- package/packages/core/src/manifest.ts +2 -2
- package/packages/core/src/mention-search.ts +1 -1
- package/packages/core/src/model-calls.ts +1 -1
- package/packages/core/src/package.ts +1 -1
- package/packages/core/src/ports.ts +2 -2
- package/packages/core/src/query.ts +1 -1
- package/packages/core/src/records/chat.ts +1 -1
- package/packages/core/src/records/runs.ts +1 -1
- package/packages/core/src/records/spend.ts +4 -0
- package/packages/core/src/registries.ts +9 -3
- package/packages/core/src/sso.ts +2 -2
- package/packages/core/src/stores.ts +1 -1
- package/packages/core/src/suggestions.ts +2 -2
- package/packages/core/src/system-pages.ts +32 -6
- package/packages/core/src/tables.ts +233 -0
- package/packages/core/src/visuals.ts +47 -139
- package/packages/core/src/web.ts +2 -2
- package/packages/core/src/widgets-v1.ts +78 -1
- package/packages/hub/package.json +13 -11
- package/packages/hub/src/api/admin-ops.ts +5 -5
- package/packages/hub/src/api/auth.ts +2 -2
- package/packages/hub/src/api/https.ts +6 -6
- package/packages/hub/src/api/identities.ts +1 -1
- package/packages/hub/src/api/reads.ts +1 -1
- package/packages/hub/src/api/secrets.ts +1 -1
- package/packages/hub/src/api/serve.ts +2 -2
- package/packages/hub/src/api/sso-route.ts +2 -2
- package/packages/hub/src/api/sso.ts +6 -6
- package/packages/hub/src/api/testing/rig.ts +1 -1
- package/packages/hub/src/api/tls.ts +2 -2
- package/packages/hub/src/api/web/auth.ts +1 -1
- package/packages/hub/src/api/web/find.ts +1 -1
- package/packages/hub/src/api/web/pages.ts +4 -3
- package/packages/hub/src/api/web/pickers.ts +4 -4
- package/packages/hub/src/boot/env.ts +82 -78
- package/packages/hub/src/boot/hub-fns.ts +1 -1
- package/packages/hub/src/boot/identity.ts +2 -2
- package/packages/hub/src/boot/index.ts +1 -1
- package/packages/hub/src/boot/info.ts +1 -1
- package/packages/hub/src/boot/keys.ts +6 -6
- package/packages/hub/src/boot/log.ts +4 -4
- package/packages/hub/src/boot/modules.ts +4 -4
- package/packages/hub/src/boot/services.ts +9 -9
- package/packages/hub/src/boot/start.ts +23 -23
- package/packages/hub/src/chat/cache.ts +1 -1
- package/packages/hub/src/chat/chat.ts +1 -1
- package/packages/hub/src/chat/compare.ts +2 -2
- package/packages/hub/src/chat/deliveries.ts +1 -1
- package/packages/hub/src/chat/deps.ts +3 -3
- package/packages/hub/src/chat/enrich.ts +7 -7
- package/packages/hub/src/chat/env.ts +20 -20
- package/packages/hub/src/chat/mention-requests.ts +1 -1
- package/packages/hub/src/chat/mention-search.ts +1 -1
- package/packages/hub/src/chat/mentions.ts +3 -3
- package/packages/hub/src/chat/notifications.ts +2 -2
- package/packages/hub/src/chat/presence.ts +2 -2
- package/packages/hub/src/chat/sessions.ts +2 -2
- package/packages/hub/src/chat/suggestions.ts +8 -8
- package/packages/hub/src/chat/testing.ts +1 -1
- package/packages/hub/src/chat/turns.ts +6 -6
- package/packages/hub/src/chat/undo.ts +1 -1
- package/packages/hub/src/connections/create.ts +1 -1
- package/packages/hub/src/connections/env.ts +2 -2
- package/packages/hub/src/connections/service.ts +5 -9
- package/packages/hub/src/contextor/contextors.ts +9 -9
- package/packages/hub/src/contextor/crawl.ts +1 -1
- package/packages/hub/src/contextor/create.ts +5 -5
- package/packages/hub/src/contextor/dynamic.ts +5 -5
- package/packages/hub/src/contextor/env.ts +46 -46
- package/packages/hub/src/contextor/injected.ts +1 -1
- package/packages/hub/src/contextor/limits.ts +9 -9
- package/packages/hub/src/contextor/planner.ts +11 -11
- package/packages/hub/src/contextor/testing.ts +1 -1
- package/packages/hub/src/data/env.ts +3 -3
- package/packages/hub/src/data/service.ts +5 -5
- package/packages/hub/src/execution/agent.ts +8 -8
- package/packages/hub/src/execution/ai.ts +7 -7
- package/packages/hub/src/execution/create.ts +11 -6
- package/packages/hub/src/execution/env.ts +16 -16
- package/packages/hub/src/execution/executors.ts +2 -2
- package/packages/hub/src/execution/gateway.ts +1 -1
- package/packages/hub/src/execution/index.ts +1 -1
- package/packages/hub/src/execution/ledger.ts +2 -2
- package/packages/hub/src/execution/limits.ts +2 -2
- package/packages/hub/src/execution/models.ts +2 -2
- package/packages/hub/src/execution/ports.ts +1 -1
- package/packages/hub/src/execution/providers.ts +55 -11
- package/packages/hub/src/execution/queues.ts +6 -6
- package/packages/hub/src/execution/runs.ts +10 -10
- package/packages/hub/src/execution/stream-guard.ts +2 -2
- package/packages/hub/src/execution/testing.ts +5 -5
- package/packages/hub/src/execution/wire.ts +3 -3
- package/packages/hub/src/fns/auto.ts +2 -2
- package/packages/hub/src/fns/client-logs.ts +2 -2
- package/packages/hub/src/fns/create.ts +2 -2
- package/packages/hub/src/fns/decided.ts +2 -2
- package/packages/hub/src/fns/env.ts +14 -14
- package/packages/hub/src/fns/examples.ts +3 -3
- package/packages/hub/src/fns/facts.ts +5 -5
- package/packages/hub/src/fns/search.ts +5 -5
- package/packages/hub/src/graph/graph.ts +1 -1
- package/packages/hub/src/index/context-sections.ts +1 -1
- package/packages/hub/src/index/embedders.ts +3 -3
- package/packages/hub/src/index/env.ts +12 -12
- package/packages/hub/src/index/index.ts +1 -1
- package/packages/hub/src/index/indexer.ts +4 -4
- package/packages/hub/src/index/search.ts +1 -1
- package/packages/hub/src/index/testing.ts +2 -2
- package/packages/hub/src/link/build.ts +32 -32
- package/packages/hub/src/link/env.ts +14 -14
- package/packages/hub/src/link/grants.ts +10 -10
- package/packages/hub/src/link/lifecycle.ts +4 -4
- package/packages/hub/src/link/migrate-api.ts +55 -15
- package/packages/hub/src/link/pairing.ts +1 -1
- package/packages/hub/src/link/process.ts +1 -1
- package/packages/hub/src/link/rig.ts +12 -12
- package/packages/hub/src/link/supervisor.ts +1 -1
- package/packages/hub/src/mcp/calls.ts +6 -6
- package/packages/hub/src/mcp/create.ts +5 -5
- package/packages/hub/src/mcp/env.ts +6 -6
- package/packages/hub/src/mcp/fns.ts +2 -2
- package/packages/hub/src/mcp/index.ts +2 -2
- package/packages/hub/src/mcp/sources.ts +3 -3
- package/packages/hub/src/mcp/tokens.ts +1 -1
- package/packages/hub/src/models/create.ts +1 -1
- package/packages/hub/src/models/decide.ts +2 -2
- package/packages/hub/src/models/index.ts +1 -1
- package/packages/hub/src/models/roles.ts +12 -12
- package/packages/hub/src/query/env.ts +5 -5
- package/packages/hub/src/query/sources.ts +3 -3
- package/packages/hub/src/questions/plans.ts +1 -1
- package/packages/hub/src/questions/worker.ts +2 -2
- package/packages/hub/src/resources/context.ts +3 -3
- package/packages/hub/src/resources/converters.ts +2 -2
- package/packages/hub/src/resources/create.ts +6 -6
- package/packages/hub/src/resources/env.ts +15 -15
- package/packages/hub/src/resources/fetch.ts +5 -5
- package/packages/hub/src/resources/forms.ts +5 -5
- package/packages/hub/src/resources/index.ts +1 -1
- package/packages/hub/src/resources/library.ts +2 -2
- package/packages/hub/src/resources/raw.ts +1 -1
- package/packages/hub/src/resources/reader.ts +2 -2
- package/packages/hub/src/resources/sqlite-files.ts +1 -1
- package/packages/hub/src/resources/storage.ts +5 -5
- package/packages/hub/src/resources/testing.ts +6 -6
- package/packages/hub/src/store/env.ts +4 -4
- package/packages/hub/src/store/hybrid.ts +4 -4
- package/packages/hub/src/store/sqlite.ts +3 -3
- package/packages/hub/src/stores/drivers.ts +2 -2
- package/packages/hub/src/stores/host.ts +3 -3
- package/packages/hub/src/stores/moves.ts +2 -2
- package/packages/hub/src/stores/service.ts +2 -2
- package/packages/hub/src/tables/env.ts +3 -3
- package/packages/hub/src/tables/index.ts +5 -5
- package/packages/hub/src/tables/service.ts +7 -7
- package/packages/sdk/AUTHORING.md +1206 -881
- package/packages/sdk/package.json +11 -8
- package/packages/sdk/src/agent.ts +1 -1
- package/packages/sdk/src/app-parts.ts +95 -0
- package/packages/sdk/src/authored.ts +26 -0
- package/packages/sdk/src/authoring.ts +13 -30
- package/packages/sdk/src/client-runtime.ts +24 -1
- package/packages/sdk/src/client-ui/AddServiceDialog.vue +43 -0
- package/packages/sdk/src/client-ui/InstanceNameField.vue +29 -0
- package/packages/sdk/src/client-ui/PairRowsEditor.vue +74 -0
- package/packages/sdk/src/client-ui/RemoteAuthFields.vue +95 -0
- package/packages/sdk/src/client-ui/ServiceRows.vue +57 -0
- package/packages/sdk/src/client-ui/draft.ts +10 -0
- package/packages/sdk/src/client-ui/host.ts +37 -0
- package/packages/sdk/src/client-ui/index.ts +19 -0
- package/packages/sdk/src/client-ui/loaded.ts +69 -0
- package/packages/sdk/src/client-ui/problems.ts +98 -0
- package/packages/sdk/src/client-ui/remote-config.ts +199 -0
- package/packages/sdk/src/client-ui/service-rows.ts +25 -0
- package/packages/sdk/src/client-ui/state.ts +14 -0
- package/packages/sdk/src/client-ui/testing.ts +147 -0
- package/packages/sdk/src/client-ui/vue-shim.d.ts +13 -0
- package/packages/sdk/src/client.ts +82 -11
- package/packages/sdk/src/hub.ts +4 -4
- package/packages/sdk/src/index.ts +13 -9
- package/packages/sdk/src/page-parts.ts +4 -0
- package/packages/sdk/src/program/env.ts +7 -7
- package/packages/sdk/src/program/runtime.ts +5 -5
- package/packages/sdk/src/program/tools.ts +3 -3
- package/packages/sdk/src/remote-auth.ts +128 -7
- package/packages/sdk/src/server/context-files.ts +1 -1
- package/packages/sdk/src/server/env.ts +36 -36
- package/packages/sdk/src/server/fake-hub-widgets.ts +7 -6
- package/packages/sdk/src/server/host.ts +28 -28
- package/packages/sdk/src/server/index.ts +2 -2
- package/packages/sdk/src/server/live.ts +4 -4
- package/packages/sdk/src/server/llm-wire.ts +4 -4
- package/packages/sdk/src/server/pairing.ts +1 -1
- package/packages/sdk/src/server/results.ts +4 -4
- package/packages/sdk/src/server/socket-guard.ts +1 -1
- package/packages/sdk/src/server/start-gate.ts +2 -2
- package/packages/sdk/src/server/store/engines.ts +2 -2
- package/packages/sdk/src/server/store/keeper.ts +2 -2
- package/packages/sdk/src/server/supervise.ts +4 -4
- package/packages/sdk/src/testing/env.ts +6 -6
- package/packages/sdk/src/testing/hub.ts +3 -1
- package/packages/sdk/src/testing/models.ts +3 -3
- package/packages/sdk/src/testing/openrouter.ts +3 -2
- package/packages/sdk/src/testing/preview.ts +7 -7
- package/packages/sdk/src/widgets.ts +21 -136
- package/packages/sdk/tsconfig.json +2 -2
- package/packages/web/dist/assets/{ActorSettingsView-v2k7v454.js → ActorSettingsView-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-CFmKZS8G.js → AppPage-BvoVTk6h.js} +2 -2
- package/packages/web/dist/assets/{AutoPairPicker-C61gihmh.js → AutoPairPicker-CLjD-muP.js} +2 -2
- package/packages/web/dist/assets/{BrowserFrame-Sq9EmQRT.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-tUNXZB77.js → CodeViewer-K9jrTmFO.js} +2 -2
- package/packages/web/dist/assets/ConfigWithCustom-BvrvSVIp.js +3 -0
- package/packages/web/dist/assets/{ConfirmDialog-Dd3E4sJt.js → ConfirmDialog-BDvLleYf.js} +2 -2
- package/packages/web/dist/assets/{ConnectPage-CX9acyQH.js → ConnectPage-Dg6IPNNh.js} +2 -2
- package/packages/web/dist/assets/ContextItemPage-qisBQetR.js +2 -0
- package/packages/web/dist/assets/ContextPage-DXa6Yqk-.js +3 -0
- package/packages/web/dist/assets/{ContextRow-DrtPumZ5.js → ContextRow-DDYnYRaL.js} +2 -2
- package/packages/web/dist/assets/{DataPage-DDSsxHro.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-6e0XbOFC.js → DesignPage-B9MJbF10.js} +3 -3
- package/packages/web/dist/assets/{ExplorePage-B7ND0W0l.js → ExplorePage-cRDQZRea.js} +2 -2
- package/packages/web/dist/assets/{FnPill-Cp3KuLmP.js → FnPill-CbLZCXYM.js} +2 -2
- package/packages/web/dist/assets/{FnView-C0XZdnsS.js → FnView-CG_wBKTP.js} +2 -2
- package/packages/web/dist/assets/{FnsView-GTH3p7a0.js → FnsView-BybyK12w.js} +2 -2
- package/packages/web/dist/assets/{GinExprView-DGxns6lH.js → GinExprView-BYCKSD_n.js} +2 -2
- package/packages/web/dist/assets/{GinForm-BDBUzuDP.js → GinForm-CXjYVf2_.js} +2 -2
- package/packages/web/dist/assets/{GinTypeView-CUsymbVf.js → GinTypeView-Bmbmx9e_.js} +2 -2
- package/packages/web/dist/assets/{GinValueView-jsKIfiEA.js → GinValueView-CWUzS7ti.js} +2 -2
- package/packages/web/dist/assets/{GraphPage-BCcPPsHu.js → GraphPage-D6OhckfJ.js} +2 -2
- package/packages/web/dist/assets/GraphPanel-BTitgA-K.js +2 -0
- package/packages/web/dist/assets/{HubPicker-EoOErgmk.js → HubPicker-DVly8dLD.js} +2 -2
- package/packages/web/dist/assets/{InboxApprovals-Dkq7DFp_.js → InboxApprovals-BF84edZU.js} +2 -2
- package/packages/web/dist/assets/{InboxPage-CHhslePq.js → InboxPage-DohZ9EDP.js} +2 -2
- package/packages/web/dist/assets/InjectedList-e6qr1kdU.js +2 -0
- package/packages/web/dist/assets/{InstallDialog-D-VwfZYF.js → InstallDialog-JJCKYs2s.js} +2 -2
- package/packages/web/dist/assets/InstanceTypes-BqUzx87o.js +2 -0
- package/packages/web/dist/assets/InstanceView-C73pev7A.js +2 -0
- package/packages/web/dist/assets/{ItemHistory-NQAP69ma.js → ItemHistory-dbGgOZsw.js} +2 -2
- package/packages/web/dist/assets/LimitsView-Ddp5WakY.js +2 -0
- package/packages/web/dist/assets/{ListSearch-BunVrDO0.js → ListSearch-CYNNAuMB.js} +2 -2
- package/packages/web/dist/assets/{LlmCallDetails-BoVNDTVs.js → LlmCallDetails-C9H5Hc2J.js} +2 -2
- package/packages/web/dist/assets/{LlmCallsView-BGpV92RC.js → LlmCallsView-CBqyZ8Cj.js} +2 -2
- package/packages/web/dist/assets/{LoadState-h-K9bTYc.js → LoadState-B2YhZlyC.js} +2 -2
- package/packages/web/dist/assets/McpDialog-DhlLklIq.js +2 -0
- package/packages/web/dist/assets/{McpView-GPXdCMne.js → McpView-D_ZmNO56.js} +2 -2
- package/packages/web/dist/assets/{McpsView-DJIR2JX5.js → McpsView-9_gwBuzw.js} +2 -2
- package/packages/web/dist/assets/{MemoryDialog-BTeIHQyA.js → MemoryDialog-pTHIxKEX.js} +2 -2
- package/packages/web/dist/assets/{ModelCallsView-DMcnwF2S.js → ModelCallsView-FHv2XWRX.js} +2 -2
- package/packages/web/dist/assets/{ModelPicker-CgkMFxSO.js → ModelPicker-EqOuvVnE.js} +2 -2
- package/packages/web/dist/assets/ModelsView-D9UaL4PX.js +2 -0
- package/packages/web/dist/assets/{NotFoundPage-Tk92K7HN.js → NotFoundPage-BsuJysan.js} +2 -2
- package/packages/web/dist/assets/{PairPage-D0BK8CCw.js → PairPage-B_ZXsbL4.js} +2 -2
- package/packages/web/dist/assets/{PanelHost-C-gKrxAk.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-BRi-QAuo.js → PoliciesView-Bn4rm-ao.js} +2 -2
- package/packages/web/dist/assets/{RefusalList-DVO0bmeB.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-Do0chYxU.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-DO3p64Qj.js → ReviewSummaryStrip-Bvjn3Iq8.js} +2 -2
- package/packages/web/dist/assets/ReviewView-DIqsUedT.js +3 -0
- package/packages/web/dist/assets/{RuleRow-DX9v4iGP.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-DjR206q6.js → RunDetails-W4GbE6AE.js} +2 -2
- package/packages/web/dist/assets/{RunDot-lHRICdM5.js → RunDot-C46uzzNM.js} +2 -2
- package/packages/web/dist/assets/{RunPage-CbAQ_WPR.js → RunPage-DPLtZpeB.js} +2 -2
- package/packages/web/dist/assets/{RunProgress-C3-B4tQf.js → RunProgress-Cr_6TBaF.js} +2 -2
- package/packages/web/dist/assets/{RunsView-DMkPmkqX.js → RunsView-tU350TPK.js} +2 -2
- package/packages/web/dist/assets/SettingsPage-B8QmmMN3.js +3 -0
- package/packages/web/dist/assets/{SettingsPage-t03BqXw8.css → SettingsPage-BTl3Ie4F.css} +1 -1
- package/packages/web/dist/assets/SignInPage-CXxLf7Rp.css +1 -0
- package/packages/web/dist/assets/{SignInPage-ByqGEZfj.js → SignInPage-DTwdqlnB.js} +2 -2
- package/packages/web/dist/assets/{StatusBadge-CXne0sRZ.js → StatusBadge-D7wKMAcD.js} +2 -2
- package/packages/web/dist/assets/{StorePlacementStep-B6SwTmdM.js → StorePlacementStep-C04nRU-u.js} +2 -2
- package/packages/web/dist/assets/{SystemConfig-vQDL_eUl.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/SystemsView-0G8JntMV.js +2 -0
- 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-Boxx86f5.js → TableViewer-nbMInGJJ.js} +3 -3
- package/packages/web/dist/assets/{ThemePicker-CIg_oRQX.js → ThemePicker-fZpVSYqG.js} +2 -2
- package/packages/web/dist/assets/{TurnTree-Ecm0yA5g.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-BlnqZDVU.js → UserMessage-CDjUxKY0.js} +6 -6
- package/packages/web/dist/assets/{ValueVisual-C-MWpp7c.js → ValueVisual-EJnCKgSy.js} +2 -2
- package/packages/web/dist/assets/{fn-modal-B98MR7JN.js → fn-modal-DtE65mFt.js} +2 -2
- package/packages/web/dist/assets/{fn-notices-CfTa1E8y.js → fn-notices-CCZ-DFbi.js} +2 -2
- package/packages/web/dist/assets/{formats-JwoKfXIq.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-BFbk11BE.js → labels-CT7_K0Pt.js} +2 -2
- package/packages/web/dist/assets/{layout-D1gf481r.js → layout-B6fBDg80.js} +2 -2
- package/packages/web/dist/assets/loaded-LaPjk6mK.js +2 -0
- package/packages/web/dist/assets/{metrics-CBPX3W5Y.js → metrics-9n8bKI7u.js} +2 -2
- package/packages/web/dist/assets/problems--AW4igVY.js +2 -0
- package/packages/web/dist/assets/{push-payload-BeU1ADYt.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-fP-l9D6H.js → review-uLESCEz1.js} +3 -3
- package/packages/web/dist/assets/routes-B7Zmt8wh.js +4 -0
- package/packages/web/dist/assets/{runs-CveC2kKo.js → runs-CUb2PTFg.js} +2 -2
- package/packages/web/dist/assets/{shared-LbaIHjbV.js → shared-Bxhw_9et.js} +2 -2
- package/packages/web/dist/assets/{sources-VPrtgLIi.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-BqE3WTSF.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-BzgWquIU.js → ui-DWjytmDS.js} +5 -5
- package/packages/web/dist/assets/{url-DKGcECT1.js → url-DbGOI14W.js} +2 -2
- package/packages/web/dist/index.html +49 -47
- package/packages/web/dist/sw.js +1 -1
- package/packages/web/package.json +2 -4
- package/premade/claude.zip +0 -0
- package/premade/database.zip +0 -0
- package/premade/web.zip +0 -0
- package/scripts/dev-env.ts +9 -9
- package/scripts/run-stack.ts +15 -15
- package/scripts/stack.ts +3 -3
- package/scripts/start.ts +18 -18
- package/systems/api/client/ApiServiceForm.vue +55 -0
- package/systems/api/client/ServiceList.vue +90 -0
- package/systems/api/client/ServicePage.vue +142 -0
- package/systems/api/client/ServicesPage.vue +32 -0
- package/systems/api/client/index.ts +15 -0
- package/systems/api/client/logic.ts +140 -0
- package/systems/api/client/state.ts +92 -0
- package/systems/api/package.json +9 -6
- package/systems/api/server/authoring.ts +2 -1
- package/systems/api/server/env.ts +1 -1
- package/systems/api/server/guard.ts +1 -1
- package/systems/api/server/http.ts +3 -2
- package/systems/api/server/impl.ts +3 -2
- package/systems/api/server/main.ts +11 -7
- package/systems/api/server/openapi.ts +1 -1
- package/systems/api/server/program.ts +2 -1
- package/systems/api/server/services.ts +2 -1
- package/systems/api/shared/http.ts +2 -1
- package/systems/api/shared/index.ts +15 -5
- package/{packages/core/src/programs.ts → systems/api/shared/services.ts} +7 -51
- package/systems/api/system.json +2 -1
- package/systems/api/tsconfig.json +2 -2
- package/systems/code/package.json +4 -3
- package/systems/code/server/authoring.ts +2 -1
- package/systems/code/server/impl.ts +2 -1
- package/systems/code/server/main.ts +5 -5
- package/systems/code/shared/index.ts +2 -3
- package/systems/code/shared/program.ts +23 -0
- package/systems/embedder/package.json +1 -1
- package/systems/embedder/server/env.ts +1 -1
- package/systems/embedder/server/main.ts +5 -5
- package/systems/embedder/shared/index.ts +1 -1
- package/systems/fs/client/machines/fakes.ts +1 -1
- package/systems/fs/client/machines/files/fakes.ts +1 -1
- package/systems/fs/client/machines/palette.ts +3 -2
- package/systems/fs/context/authoring/parts/client.md +23 -5
- package/systems/fs/context/authoring/parts/client.reference/client.md +7 -16
- package/systems/fs/context/authoring/parts/client.reference/pageinbox.md +524 -0
- package/systems/fs/context/authoring/parts/client.reference/{resultview.md → visuals.md} +85 -116
- package/systems/fs/context/authoring/parts/client.reference.md +8 -8
- package/systems/fs/context/authoring/parts/context.md +1 -1
- package/systems/fs/context/authoring/parts/contract.md +1 -1
- package/systems/fs/context/authoring/parts/core-types/admin-ts.md +2 -2
- package/systems/fs/context/authoring/parts/core-types/connections-ts.md +12 -1
- package/systems/fs/context/authoring/parts/core-types/context-files-ts.md +2 -2
- package/systems/fs/context/authoring/parts/core-types/context-graph-ts.md +2 -2
- package/systems/fs/context/authoring/parts/core-types/contextdecl.md +2 -2
- package/systems/fs/context/authoring/parts/core-types/lifecycle-ts.md +27 -2
- package/systems/fs/context/authoring/parts/core-types/manifest.md +27 -2
- package/systems/fs/context/authoring/parts/core-types/manifestpatch.md +26 -2
- package/systems/fs/context/authoring/parts/core-types/modes-ts.md +3 -3
- package/systems/fs/context/authoring/parts/core-types/records-systems-ts.md +145 -1
- package/systems/fs/context/authoring/parts/core-types/registries-ts.md +98 -2
- package/systems/fs/context/authoring/parts/core-types/run-ts.md +2 -2
- package/systems/fs/context/authoring/parts/core-types/system-pages-ts.md +4 -2
- package/systems/fs/context/authoring/parts/core-types/system-providers-ts.md +2 -2
- package/systems/fs/context/authoring/parts/core-types/tables-ts.md +91 -0
- package/systems/fs/context/authoring/parts/core-types/web-ts.md +1 -2
- package/systems/fs/context/authoring/parts/core-types.md +5 -8
- package/systems/fs/context/authoring/parts/examples/server-main-ts.md +4 -4
- package/systems/fs/context/authoring/parts/examples/systems-fs-shared-index-ts-lines-568-660.md +1 -1
- package/systems/fs/context/authoring/parts/fns.md +1 -1
- package/systems/fs/context/authoring/parts/folder.md +6 -6
- package/systems/fs/context/authoring/parts/hub/hub-ctx-from-resource.md +2 -2
- package/systems/fs/context/authoring/parts/hub/hub-install-package.md +2 -2
- package/systems/fs/context/authoring/parts/hub.reference.md +3 -3
- package/systems/fs/context/authoring/parts/internals/manifestof.md +2 -2
- package/systems/fs/context/authoring/parts/internals/permissionargs.md +4 -4
- package/systems/fs/context/authoring/parts/kinds-agents.md +1 -1
- package/systems/fs/context/authoring/parts/kinds-agents.reference/authoringsession.md +7 -5
- package/systems/fs/context/authoring/parts/kinds-agents.reference/kind.md +4 -4
- package/systems/fs/context/authoring/parts/outcomes.md +2 -2
- package/systems/fs/context/authoring/parts/outcomes.reference.md +2 -2
- package/systems/fs/context/authoring/parts/packaging.md +4 -4
- package/systems/fs/context/authoring/parts/remote.md +5 -5
- package/systems/fs/context/authoring/parts/remote.reference.md +201 -17
- package/systems/fs/context/authoring/parts/server.md +7 -7
- package/systems/fs/context/authoring/parts/server.reference.md +15 -15
- package/systems/fs/context/authoring/parts/testing.reference/equal.md +3 -3
- package/systems/fs/context/authoring/parts/testing.reference/fakehub.md +1 -1
- package/systems/fs/context/authoring/parts/testing.reference/kindprops.md +22 -10
- package/systems/fs/context/authoring/parts/testing.reference/{openmemorystore.md → storeconnection.md} +7 -19
- package/systems/fs/context/authoring/parts/testing.reference.md +5 -5
- package/systems/fs/context/authoring/parts/widgets.md +32 -22
- package/systems/fs/context/authoring/parts/widgets.reference.md +503 -9
- package/systems/fs/package.json +3 -3
- package/systems/fs/server/hosting.ts +10 -10
- package/systems/fs/server/main.ts +8 -8
- package/systems/fs/server/shell.ts +1 -1
- package/systems/fs/shared/index.ts +1 -1
- package/systems/google-calendar/package.json +1 -1
- package/systems/google-calendar/server/main.ts +4 -4
- package/systems/input/package.json +3 -3
- package/systems/input/server/main.ts +6 -6
- package/systems/mcp/client/McpServerForm.vue +99 -0
- package/systems/mcp/client/ServerList.vue +78 -0
- package/systems/mcp/client/ServerPage.vue +194 -0
- package/systems/mcp/client/ServersPage.vue +32 -0
- package/systems/mcp/client/index.ts +15 -0
- package/systems/mcp/client/logic.ts +224 -0
- package/systems/mcp/client/state.ts +128 -0
- package/systems/mcp/package.json +9 -6
- package/systems/mcp/server/dial.ts +1 -1
- package/systems/mcp/server/impl.ts +2 -1
- package/systems/mcp/server/instance.ts +3 -5
- package/systems/mcp/server/main.ts +10 -6
- package/systems/mcp/server/mirror.ts +2 -3
- package/systems/mcp/server/oauth.ts +2 -1
- package/systems/mcp/server/server-link.ts +2 -1
- package/systems/mcp/shared/index.ts +15 -2
- package/{packages/core/src/mcp-servers.ts → systems/mcp/shared/servers.ts} +6 -5
- package/systems/mcp/system.json +2 -1
- package/systems/mcp/tsconfig.json +2 -2
- package/systems/ollama/package.json +3 -3
- package/systems/ollama/server/main.ts +5 -5
- package/systems/schedule/package.json +3 -3
- package/systems/schedule/server/main.ts +6 -6
- package/systems/template/README.md +2 -2
- package/systems/template/package.json +1 -1
- package/systems/template/server/main.ts +4 -4
- package/systems/widgets/client/ChipRow.vue +22 -0
- package/systems/widgets/client/ProposalCard.vue +6 -5
- package/systems/widgets/client/SavedWidget.vue +11 -8
- package/systems/widgets/client/WidgetChips.vue +137 -0
- package/systems/widgets/client/WidgetView.vue +32 -0
- package/systems/widgets/client/charts/ChartVisual.vue +157 -0
- package/systems/widgets/client/charts/chart-data.ts +230 -0
- package/systems/widgets/client/charts/echarts-setup.ts +69 -0
- package/systems/widgets/client/charts/export.ts +36 -0
- package/systems/widgets/client/charts/families/calendar.ts +105 -0
- package/systems/widgets/client/charts/families/category.ts +186 -0
- package/systems/widgets/client/charts/families/crosstab.ts +113 -0
- package/systems/widgets/client/charts/families/distribution.ts +160 -0
- package/systems/widgets/client/charts/families/finance.ts +96 -0
- package/systems/widgets/client/charts/families/gauge.ts +75 -0
- package/systems/widgets/client/charts/families/hierarchy.ts +166 -0
- package/systems/widgets/client/charts/families/index.ts +21 -0
- package/systems/widgets/client/charts/families/network.ts +140 -0
- package/systems/widgets/client/charts/families/part.ts +61 -0
- package/systems/widgets/client/charts/families/profile.ts +30 -0
- package/systems/widgets/client/charts/families/progress.ts +76 -0
- package/systems/widgets/client/charts/families/range.ts +107 -0
- package/systems/widgets/client/charts/families/time.ts +177 -0
- package/systems/widgets/client/charts/families/timeline.ts +114 -0
- package/systems/widgets/client/charts/families/wide.ts +41 -0
- package/systems/widgets/client/charts/index.ts +37 -0
- package/systems/widgets/client/charts/maths.ts +139 -0
- package/systems/widgets/client/charts/size.ts +39 -0
- package/systems/widgets/client/chips.ts +150 -0
- package/systems/widgets/client/index.ts +18 -5
- package/systems/widgets/client/proposal.ts +2 -1
- package/systems/widgets/package.json +7 -4
- package/systems/widgets/server/authoring.ts +13 -7
- package/systems/widgets/server/env.ts +1 -1
- package/systems/widgets/server/impl.ts +10 -6
- package/systems/widgets/server/main.ts +6 -6
- package/systems/widgets/server/run.ts +16 -9
- package/systems/widgets/server/upgrade.ts +34 -0
- package/systems/widgets/shared/args.ts +137 -0
- package/systems/widgets/shared/charts.ts +243 -0
- package/systems/widgets/shared/index.ts +12 -3
- package/{packages/sdk/src → systems/widgets/shared}/relative-dates.ts +2 -1
- package/systems/widgets/shared/spec.ts +208 -0
- package/{packages/sdk/src → systems/widgets/shared}/widget-check.ts +7 -9
- package/{packages/sdk/src → systems/widgets/shared}/widget-schema.ts +4 -4
- package/packages/core/src/remote-auth.ts +0 -111
- package/packages/core/src/widgets.ts +0 -427
- package/packages/web/dist/assets/AdminLayout-B6Jrc_4W.js +0 -2
- package/packages/web/dist/assets/ApiServiceForm-BxprSaAq.css +0 -1
- package/packages/web/dist/assets/ApiServiceForm-CuuQgOJc.js +0 -2
- package/packages/web/dist/assets/ApiServiceView-7bTHSO_Z.js +0 -2
- package/packages/web/dist/assets/ApiServiceView-BVmdRCjR.css +0 -1
- package/packages/web/dist/assets/ApiServicesView-BTLV6c8n.css +0 -1
- package/packages/web/dist/assets/ApiServicesView-BXi24n49.js +0 -2
- package/packages/web/dist/assets/ChartVisual-BnFG9aFi.css +0 -1
- package/packages/web/dist/assets/ChartVisual-C4mgw4wh.js +0 -11
- package/packages/web/dist/assets/ChatPage-CAhHE03Z.js +0 -4
- package/packages/web/dist/assets/ConfigWithCustom-D_-rY66L.js +0 -3
- package/packages/web/dist/assets/ContextItemPage-rUI3-T_L.js +0 -2
- package/packages/web/dist/assets/ContextPage-CtefzyKg.js +0 -3
- package/packages/web/dist/assets/DataTypePage-BW9fWaz8.js +0 -2
- package/packages/web/dist/assets/FnList-BCnb4kOB.css +0 -1
- package/packages/web/dist/assets/FnList-Bx6H-kux.js +0 -2
- package/packages/web/dist/assets/GraphPanel-9tztGHmu.js +0 -2
- package/packages/web/dist/assets/InjectedList-CSWqRiON.js +0 -2
- package/packages/web/dist/assets/InstanceTypes-D3rAEiE7.js +0 -2
- package/packages/web/dist/assets/InstanceView-DoH8C-1j.js +0 -2
- package/packages/web/dist/assets/LimitsView-DY2C9nYS.js +0 -2
- package/packages/web/dist/assets/McpDialog-DhOCk6_E.js +0 -2
- package/packages/web/dist/assets/McpServerForm-Cor3fI7s.js +0 -2
- package/packages/web/dist/assets/McpServerForm-DsHaf5Um.css +0 -1
- package/packages/web/dist/assets/McpServerView-7I76EznB.css +0 -1
- package/packages/web/dist/assets/McpServerView-ewXRPEmZ.js +0 -2
- package/packages/web/dist/assets/McpServersView-Dd0xmfws.js +0 -2
- package/packages/web/dist/assets/ModelsView-cMHygeiK.js +0 -2
- package/packages/web/dist/assets/PeopleView-DRfeNWK5.js +0 -2
- package/packages/web/dist/assets/RemoteAuthFields-CgiufuqQ.js +0 -2
- package/packages/web/dist/assets/RemoteAuthFields-Dm44vz2t.css +0 -1
- package/packages/web/dist/assets/ResourcesPage-BBx2u2mw.js +0 -2
- package/packages/web/dist/assets/ResultGrid-Bj-0I5HY.js +0 -2
- package/packages/web/dist/assets/ResultGrid-CuUQyTjW.css +0 -1
- package/packages/web/dist/assets/ReviewView-DZF9E1hb.js +0 -3
- package/packages/web/dist/assets/RunCard-BnrtK2Yp.js +0 -2
- package/packages/web/dist/assets/RunCard-CfyRaDLS.css +0 -1
- package/packages/web/dist/assets/ServiceRows-4WythFpF.js +0 -2
- package/packages/web/dist/assets/ServiceRows-HPQ0pN6b.css +0 -1
- package/packages/web/dist/assets/SettingsPage-BN4oSzoL.js +0 -3
- package/packages/web/dist/assets/SignInPage-Djx-M-0U.css +0 -1
- package/packages/web/dist/assets/SystemPageHost-BeZ-6N0-.css +0 -1
- package/packages/web/dist/assets/SystemPageHost-DrMrEPyh.js +0 -2
- package/packages/web/dist/assets/SystemView-Be6TBM4j.js +0 -2
- package/packages/web/dist/assets/SystemsView-DZtT3laz.js +0 -2
- package/packages/web/dist/assets/WidgetView-DQUDeFkB.css +0 -1
- package/packages/web/dist/assets/WidgetView-DX4ejNb6.js +0 -3
- package/packages/web/dist/assets/export-BwFkEtcm.js +0 -15
- package/packages/web/dist/assets/index-6ScWTFy2.js +0 -4
- package/packages/web/dist/assets/index-CEslGcrX.css +0 -1
- package/packages/web/dist/assets/problems-t1E_ovSz.js +0 -2
- package/packages/web/dist/assets/record-edits-Bfsi4lU3.js +0 -2
- package/packages/web/dist/assets/remote-config-BNQhSDzB.js +0 -2
- package/packages/web/dist/assets/routes-DV4IJpwe.js +0 -4
- package/packages/web/dist/assets/size-Bh__w5aI.js +0 -2
- package/packages/web/dist/assets/src-CT3TeFaM.js +0 -43
- package/packages/web/dist/assets/state-xfQqaQPX.js +0 -2
- package/packages/web/dist/assets/widget-host-B87MTaTn.js +0 -2
- package/packages/web/dist/assets/widgets-BBCuSS6E.js +0 -2
- package/systems/fs/context/authoring/parts/client.reference/textareaprops.md +0 -195
- package/systems/fs/context/authoring/parts/core-types/remote-auth-ts.md +0 -64
- package/systems/fs/context/authoring/parts/core-types/widgets-ts.md +0 -303
- package/systems/fs/context/authoring/parts/widgets.reference/hub-visuals.md +0 -627
- package/systems/fs/context/authoring/parts/widgets.reference/sourcecompatible.md +0 -154
package/README.md
CHANGED
|
@@ -10,8 +10,11 @@ the harness itself (from a clone of the repository), see the README in the [repo
|
|
|
10
10
|
## What you need
|
|
11
11
|
|
|
12
12
|
- **Node.js 22.21 or later** (with npm; installed systems reach the network through the hub's proxy, which needs 22.21). Check with `node -v`.
|
|
13
|
-
- **A model provider.** An [
|
|
14
|
-
|
|
13
|
+
- **A model provider.** An API key from [OpenAI](https://platform.openai.com/api-keys) (`OPENAI_API_KEY`),
|
|
14
|
+
[Anthropic](https://console.anthropic.com/settings/keys) (`ANTHROPIC_API_KEY`), [Google AI
|
|
15
|
+
Studio](https://aistudio.google.com/apikey) for Gemini (`GEMINI_API_KEY`) or [OpenRouter](https://openrouter.ai)
|
|
16
|
+
(`OPENROUTER_API_KEY`, hundreds of models with one key); AWS Bedrock and a local [Ollama](https://ollama.com) work
|
|
17
|
+
too. You can also add one after the first start.
|
|
15
18
|
|
|
16
19
|
## Install
|
|
17
20
|
|
|
@@ -49,7 +52,8 @@ fnloom is running.
|
|
|
49
52
|
```
|
|
50
53
|
|
|
51
54
|
Open the address, sign in with that email and password, and add a model provider under **Admin › Models › Add provider** (or
|
|
52
|
-
set `OPENROUTER_API_KEY` before the first start, and the hub
|
|
55
|
+
set `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GEMINI_API_KEY` or `OPENROUTER_API_KEY` before the first start, and the hub
|
|
56
|
+
configures that provider itself). Ctrl+C stops everything;
|
|
53
57
|
`fnloom start` again picks up where it left off.
|
|
54
58
|
|
|
55
59
|
**The systems are live.** A system that connects for the first time is normally *installed, not live*: nothing it
|
|
@@ -60,16 +64,19 @@ for your review.
|
|
|
60
64
|
|
|
61
65
|
| Option | Setting | Default | What it is |
|
|
62
66
|
|---|---|---|---|
|
|
63
|
-
| `--port <n>` | `
|
|
64
|
-
| `--data <dir>` | `
|
|
65
|
-
| `--root <dir>` | `
|
|
66
|
-
| `--systems <list>` | `
|
|
67
|
-
| | `
|
|
67
|
+
| `--port <n>` | `FNLOOM_PORT` | 4300 | the hub and the web app it serves (http and https on the same port) |
|
|
68
|
+
| `--data <dir>` | `FNLOOM_DATA` | `~/.harness` | the database, files, keys, logs and installed systems |
|
|
69
|
+
| `--root <dir>` | `FNLOOM_DEV_ROOT` | the folder you start in | the folder the fs system serves |
|
|
70
|
+
| `--systems <list>` | `FNLOOM_DEV_ONLY` | see below | what to run: `hub` plus lightweight system names (`fs`, `input`, `code`, `schedule`, `api`, `widgets`, `calendar`, `embedder`); `--systems hub` runs no systems. The heavy ones (database, web, claude) are installed instead, and then start with the hub |
|
|
71
|
+
| | `FNLOOM_ADMIN_EMAIL`, `FNLOOM_ADMIN_PASSWORD` | made on the first start | your own admin account instead of the generated one (set before the first start) |
|
|
72
|
+
| | `OPENAI_API_KEY` | none | configures the OpenAI provider on the first start |
|
|
73
|
+
| | `ANTHROPIC_API_KEY` | none | configures the Anthropic provider (Claude) on the first start |
|
|
74
|
+
| | `GEMINI_API_KEY` (or `GOOGLE_API_KEY`) | none | configures the Google provider (Gemini, with a key from Google AI Studio) on the first start |
|
|
68
75
|
| | `OPENROUTER_API_KEY` | none | configures the OpenRouter provider on the first start |
|
|
69
|
-
| | `
|
|
70
|
-
| | `
|
|
71
|
-
| | `
|
|
72
|
-
| | `
|
|
76
|
+
| | `FNLOOM_DEFAULT_MODEL` | `openrouter/auto` | the chat agent's model until an admin picks one |
|
|
77
|
+
| | `FNLOOM_DECIDE_MODEL` | none | the decision model (fast typed yes/no and choice answers), e.g. `typesafe/jev-1.14` on OpenRouter; used for duplicate checks, suggestions and plans |
|
|
78
|
+
| | `FNLOOM_PLAN_MODEL` | none | the model plans (`hub/ctx_plan`) write their questions and options with, e.g. `anthropic/claude-haiku-5.5` |
|
|
79
|
+
| | `FNLOOM_METADATA_MODEL` | the decision model if it can write text, else the chat model | the model that fills in each context item's question, when and the rest |
|
|
73
80
|
|
|
74
81
|
Each of these is only the starting choice: an admin can change any of them under **Admin › Models › Roles**, which
|
|
75
82
|
also shows which fallback a role is using and why.
|
|
@@ -105,7 +112,7 @@ machine that never installs web never downloads puppeteer's Chrome. `fnloom syst
|
|
|
105
112
|
| `schedule` | always | fns that run on a schedule (every day at 9, once next Friday) |
|
|
106
113
|
| `api` | always | fns that call web APIs, written from a service's OpenAPI document |
|
|
107
114
|
| `google-calendar` | when `GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET` are set | each person's own Google Calendar |
|
|
108
|
-
| `embedder` | when `
|
|
115
|
+
| `embedder` | when `FNLOOM_EMBEDDER_URL` is set | embeddings from an EmbeddingGemma service, for search and suggestions |
|
|
109
116
|
| `database` | no: install it (brings `widgets`; fetches the SQLite driver built for your machine) | SQL databases (SQLite, Postgres, SQL Server): tables as types, kept queries as fns |
|
|
110
117
|
| `widgets` | no: comes with `database` | charts and tables drawn from database queries, saved as widgets |
|
|
111
118
|
| `web` | no: install it (fetches puppeteer and its Chrome) | web search ([Tavily](https://tavily.com)), page reading and site crawls |
|
|
@@ -125,7 +132,7 @@ fnloom system install <name> [--config <file.json>]
|
|
|
125
132
|
(for database, web and claude it also runs `npm install` of their own dependencies into the system's folder, which
|
|
126
133
|
takes a minute), pairs it, gives it the config, starts it, and starts it again every time the hub starts. The command waits until it
|
|
127
134
|
has connected and says so. If the hub runs on another port or keeps its data somewhere else, say so:
|
|
128
|
-
`--hub http://127.0.0.1:4620` and `
|
|
135
|
+
`--hub http://127.0.0.1:4620` and `FNLOOM_DATA=<the data folder>` (that is where it finds `admin.json`). It then
|
|
129
136
|
puts the system live and says so.
|
|
130
137
|
|
|
131
138
|
A system that needs config and was installed without it connects and waits: fill its config on its page in the app
|
|
@@ -166,7 +173,7 @@ The config each one takes:
|
|
|
166
173
|
`fnloom system install database --config database.json`. `data: "read-only"` and `schema: "none"` keep it from
|
|
167
174
|
changing anything; `connection` can also be an existing SQLite file, Postgres or SQL Server (the system's page in
|
|
168
175
|
the app has a form for every field).
|
|
169
|
-
- **api**: nothing (it starts with `fnloom start`). Services are added in the app (**Admin › API services
|
|
176
|
+
- **api**: nothing (it starts with `fnloom start`). Services are added in the app (**Admin › Systems › API services**, the api system's own page) or by
|
|
170
177
|
asking the agent.
|
|
171
178
|
- **web**: a Tavily key for search, `fnloom system install web --config web.json` with `{ "tavilyKey": "tvly-…" }`
|
|
172
179
|
(an installed system doesn't see the hub's environment, so `TAVILY_API_KEY` there doesn't reach it). Without one
|
|
@@ -177,15 +184,15 @@ The config each one takes:
|
|
|
177
184
|
connects their own calendar on the Calendar page.
|
|
178
185
|
- **embedder**: an EmbeddingGemma service: `{ "url": "http://127.0.0.1:8760" }`. Search by meaning, suggestions
|
|
179
186
|
and plans (`hub/ctx_plan`) need an embedder, and an embedder only ever comes from a system: this one, or ollama
|
|
180
|
-
with an embedding model (name it in `
|
|
187
|
+
with an embedding model (name it in `FNLOOM_EMBEDDER_DOCUMENT` and `FNLOOM_EMBEDDER_QUERY` as `<system>/<model>`).
|
|
181
188
|
A provider set up under **Models** (OpenRouter, OpenAI) never gives the index an embedder.
|
|
182
189
|
- **ollama**: an Ollama that already runs, `{ "server": { "mode": "url", "url": "http://127.0.0.1:11434" } }`, or
|
|
183
190
|
one it installs and runs itself in its data folder once an admin approves:
|
|
184
191
|
`{ "server": { "mode": "managed", "autoStart": false } }`.
|
|
185
192
|
- **claude**: Claude Code signed in on this computer, and the folders its sessions may start in:
|
|
186
193
|
`{ "folders": [{ "path": "/home/you/projects", "label": "projects" }] }`.
|
|
187
|
-
- **mcp**: nothing to install by hand: add each MCP server under **Admin › MCP servers** (
|
|
188
|
-
hub runs one instance of the mcp system for it.
|
|
194
|
+
- **mcp**: nothing to install by hand: add each MCP server under **Admin › Systems › MCP servers** (the mcp system's own
|
|
195
|
+
page, `/admin/s/mcp/servers`; stdio, HTTP or SSE), and the hub runs one instance of the mcp system for it.
|
|
189
196
|
|
|
190
197
|
### A system's own store
|
|
191
198
|
|
|
@@ -203,7 +210,7 @@ fnloom system store move <name> --to system
|
|
|
203
210
|
fnloom system store move <name> --to external --engine postgres --url - --schema <schema> # the URL on stdin
|
|
204
211
|
```
|
|
205
212
|
|
|
206
|
-
(`--url` also reads `
|
|
213
|
+
(`--url` also reads `FNLOOM_STORE_URL`; a URL on the command line can be seen by other programs on the machine.)
|
|
207
214
|
While it moves, the system's work waits (each call up to two minutes). Runs still going get a minute to finish; if
|
|
208
215
|
some are still going after that, the move waits for you to cancel them or keep waiting (on the panel, or
|
|
209
216
|
`fnloom system store answer <name> cancel|wait`); `--cancel-runs` or `--keep-waiting` answers in advance. The old copy
|
|
@@ -254,7 +261,7 @@ Only some systems keep a store (database, for one, keeps none). For a system the
|
|
|
254
261
|
|
|
255
262
|
The base install leaves out the Postgres and SQL Server drivers, to stay small. When you put a store in one of them
|
|
256
263
|
(at install, or by moving it there), the hub installs that database's driver (`pg`, or `tedious` and `tarn`) with npm
|
|
257
|
-
into `<data>/store-drivers` (`
|
|
264
|
+
into `<data>/store-drivers` (`FNLOOM_STORE_DRIVERS_DIR`), once, and the systems it starts load it from there. This
|
|
258
265
|
needs the machine to reach the npm registry; if the install fails, the hub refuses the placement and says how to
|
|
259
266
|
install the driver by hand. A system installed from a package zip brings its own drivers.
|
|
260
267
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fnloom",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "A web-based agent harness you run yourself: one hub that owns every model call, person and permission, and systems that add fns, types, resources and screens.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -27,16 +27,18 @@
|
|
|
27
27
|
"postinstall": "node scripts/release/link.cjs"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@aeye/ai": "0.
|
|
31
|
-
"@aeye/
|
|
32
|
-
"@aeye/
|
|
33
|
-
"@aeye/
|
|
34
|
-
"@aeye/
|
|
35
|
-
"@aeye/
|
|
36
|
-
"@aeye/
|
|
37
|
-
"@aeye/
|
|
38
|
-
"@aeye/
|
|
39
|
-
"@aeye/
|
|
30
|
+
"@aeye/ai": "0.11.1",
|
|
31
|
+
"@aeye/anthropic": "0.11.1",
|
|
32
|
+
"@aeye/aws": "0.11.1",
|
|
33
|
+
"@aeye/core": "0.11.1",
|
|
34
|
+
"@aeye/gin": "0.11.1",
|
|
35
|
+
"@aeye/google": "0.11.1",
|
|
36
|
+
"@aeye/models": "0.11.1",
|
|
37
|
+
"@aeye/ollama": "0.11.1",
|
|
38
|
+
"@aeye/openai": "0.11.1",
|
|
39
|
+
"@aeye/openrouter": "0.11.1",
|
|
40
|
+
"@aeye/resources": "0.11.1",
|
|
41
|
+
"@aeye/schema": "0.11.1",
|
|
40
42
|
"@ayepi/auth": "0.6.0",
|
|
41
43
|
"@ayepi/cache": "0.6.0",
|
|
42
44
|
"@ayepi/codec": "0.6.0",
|
|
@@ -68,6 +70,7 @@
|
|
|
68
70
|
"typescript": "5.9.3",
|
|
69
71
|
"vite": "8.3.6",
|
|
70
72
|
"vue": "3.5.45",
|
|
73
|
+
"vue-echarts": "8.3.2",
|
|
71
74
|
"ws": "8.22.1",
|
|
72
75
|
"xlsx": "0.18.5",
|
|
73
76
|
"zod": "4.6.7"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
|
-
"@aeye/gin": "^0.
|
|
3
|
+
"@aeye/gin": "^0.11.1",
|
|
4
4
|
"@harness/core": "*",
|
|
5
5
|
"@harness/sdk": "*",
|
|
6
6
|
"typescript": "~5.9",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"name": "@harness/build",
|
|
11
11
|
"private": true,
|
|
12
|
-
"version": "0.
|
|
12
|
+
"version": "0.4.0",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"type": "module",
|
|
15
15
|
"description": "Building systems: typecheck, a self-contained server bundle, client renderers, the context folder check and the bundle scan. Shared by the CLI and fs.",
|
|
@@ -29,7 +29,7 @@ const CONFIG_FILES = ['vitest.config.ts', 'vitest.config.mts', 'vite.config.ts',
|
|
|
29
29
|
|
|
30
30
|
/** How to run a folder's tests. */
|
|
31
31
|
export interface TestRunOptions {
|
|
32
|
-
/** Shoot the component previews (`
|
|
32
|
+
/** Shoot the component previews (`FNLOOM_PREVIEWS`) and add them to the report. */
|
|
33
33
|
readonly previews?: boolean;
|
|
34
34
|
/** Where previews and their gallery go (default `<dir>/.harness-test/previews`). */
|
|
35
35
|
readonly previewDir?: string;
|
|
@@ -86,7 +86,7 @@ export async function runSystemTests(dir: string, files: BuildFiles, options: Te
|
|
|
86
86
|
reporters: [],
|
|
87
87
|
...(hasConfig ? {} : { config: false, include: TEST_FILES, exclude: NOT_TESTS }),
|
|
88
88
|
...(options.sandbox === undefined ? {} : { pool: 'forks', execArgv: [...options.sandbox.execArgv] }),
|
|
89
|
-
env: {
|
|
89
|
+
env: { FNLOOM_PREVIEWS: options.previews === true ? 'true' : 'false', ...(previewDir === undefined ? {} : { FNLOOM_PREVIEW_DIR: previewDir }) },
|
|
90
90
|
// a named fs allow-list stops vite searching the folders above for a workspace root, which a sandboxed run
|
|
91
91
|
// (fs's install checks, under Node's permission model) may not look at
|
|
92
92
|
}, { plugins, server: { fs: { allow: [dir] } } });
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"name": "@harness/cli",
|
|
15
15
|
"private": true,
|
|
16
|
-
"version": "0.
|
|
16
|
+
"version": "0.4.0",
|
|
17
17
|
"license": "Apache-2.0",
|
|
18
18
|
"type": "module",
|
|
19
19
|
"description": "The harness CLI: make, build, pack and install systems, export their data, and bridge a hub MCP to stdio.",
|
package/packages/cli/src/cli.ts
CHANGED
|
@@ -38,7 +38,7 @@ export function helpText(): string {
|
|
|
38
38
|
'',
|
|
39
39
|
...COMMANDS.map((c) => ` ${usageOf(c).padEnd(width)} ${c.summary}`),
|
|
40
40
|
'',
|
|
41
|
-
'Commands that talk to a hub take --hub <url> (or
|
|
41
|
+
'Commands that talk to a hub take --hub <url> (or FNLOOM_URL) and sign in with FNLOOM_TOKEN, or --token - to read the token',
|
|
42
42
|
'from stdin, or the admin account in .env. A token typed as --token <token> can be seen by other programs on this machine.',
|
|
43
43
|
].join('\n');
|
|
44
44
|
}
|
|
@@ -79,6 +79,6 @@ export async function runCli(argv: readonly string[], io: CliIo): Promise<number
|
|
|
79
79
|
async function runParsed<C extends CliCommand>(definition: C, argv: readonly string[], io: CliIo): Promise<number> {
|
|
80
80
|
const parsed = parseCommand(definition, argv);
|
|
81
81
|
const given = parsed.values['token'];
|
|
82
|
-
const token = typeof given === 'string' ? await secretOption(given, io, { flag: '--token', env: '
|
|
82
|
+
const token = typeof given === 'string' ? await secretOption(given, io, { flag: '--token', env: 'FNLOOM_TOKEN', stdin: true }) : given;
|
|
83
83
|
return definition.run(token === given ? parsed : { ...parsed, values: { ...parsed.values, token } }, io);
|
|
84
84
|
}
|
|
@@ -44,9 +44,9 @@ export interface CliIo {
|
|
|
44
44
|
|
|
45
45
|
/** The options every command that talks to a hub takes. */
|
|
46
46
|
export const HUB_OPTIONS = {
|
|
47
|
-
/** The hub's address; default `
|
|
47
|
+
/** The hub's address; default `FNLOOM_URL`. */
|
|
48
48
|
hub: z.string().optional(),
|
|
49
|
-
/** An admin access token, or `-` to read it from stdin; default `
|
|
49
|
+
/** An admin access token, or `-` to read it from stdin; default `FNLOOM_TOKEN`, else the admin account from `.env`. */
|
|
50
50
|
token: z.string().optional(),
|
|
51
51
|
} as const;
|
|
52
52
|
|
|
@@ -219,7 +219,7 @@ export const installCommand = command({
|
|
|
219
219
|
const kind = isZip ? 'zip' : found?.kind === 'folder' ? 'folder' : 'npm';
|
|
220
220
|
const hub = await io.hub(values);
|
|
221
221
|
try {
|
|
222
|
-
const wait = values.wait === undefined ? io.settings.
|
|
222
|
+
const wait = values.wait === undefined ? io.settings.FNLOOM_CLI_WAIT : Number(values.wait);
|
|
223
223
|
const about = premade === undefined ? undefined : PREMADE[target];
|
|
224
224
|
// one that `harness start` runs and the hub already has: a second copy would take over its link
|
|
225
225
|
if (about?.start !== undefined && await isInstalled(hub, target)) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `harness mcp <slug>`: bridge a hub MCP to stdin and stdout, for MCP clients that only speak stdio. Its secret is
|
|
3
|
-
* `
|
|
3
|
+
* `FNLOOM_MCP_SECRET` in the environment the MCP client starts it with (`--secret <secret>` works, with a warning: other
|
|
4
4
|
* programs can see it; stdin is the MCP stream, so it can't come from there).
|
|
5
5
|
* The bridge is built from `@ayepi/mcp` parts: an {@link McpClient} connected to the hub MCP's Streamable HTTP endpoint
|
|
6
6
|
* (`<hub>/mcp/<slug>`), offered again as an `mcpSourceServer` whose tools, resources and prompts are the hub's
|
|
@@ -183,14 +183,14 @@ export async function* linesOf(stream: AsyncIterable<Uint8Array | string> | Iter
|
|
|
183
183
|
export const mcpCommand = command({
|
|
184
184
|
path: ['mcp'],
|
|
185
185
|
summary: 'Bridge a hub MCP to stdin and stdout, for MCP clients that speak stdio only.',
|
|
186
|
-
usage: '<slug> [--hub <url>] (the secret in
|
|
186
|
+
usage: '<slug> [--hub <url>] (the secret in FNLOOM_MCP_SECRET)',
|
|
187
187
|
args: z.object({ positionals: z.tuple([McpSlug]), values: z.object({ hub: HUB_OPTIONS.hub, secret: z.string().min(1).optional() }) }),
|
|
188
188
|
async run({ positionals: [slug], values }, io) {
|
|
189
189
|
// stdin is the MCP stream: the secret comes from the environment, or (with a warning) the command line
|
|
190
|
-
const given = await secretOption(values.secret, io, { flag: '--secret', env: '
|
|
191
|
-
const secret = given ?? io.settings.
|
|
192
|
-
if (secret === undefined) { throw new Error('Set
|
|
193
|
-
const target = hubTarget(io.settings, values, { fromFile: given === undefined && io.settings.fromFile.has('
|
|
190
|
+
const given = await secretOption(values.secret, io, { flag: '--secret', env: 'FNLOOM_MCP_SECRET', stdin: false });
|
|
191
|
+
const secret = given ?? io.settings.FNLOOM_MCP_SECRET;
|
|
192
|
+
if (secret === undefined) { throw new Error('Set FNLOOM_MCP_SECRET to the secret of the hub MCP, in the environment the MCP client starts this with.'); }
|
|
193
|
+
const target = hubTarget(io.settings, values, { fromFile: given === undefined && io.settings.fromFile.has('FNLOOM_MCP_SECRET') });
|
|
194
194
|
const transport = new McpHttpClientTransport(`${target.url}/mcp/${slug}`, { headers: { authorization: `Bearer ${secret}` } });
|
|
195
195
|
await bridge(transport, io.stdin(), { write: (line) => { io.out.line(line); } });
|
|
196
196
|
return 0;
|
|
@@ -115,7 +115,7 @@ export const storeMoveCommand = command({
|
|
|
115
115
|
...TARGET,
|
|
116
116
|
to: z.enum(['hub', 'system', 'external']),
|
|
117
117
|
engine: ExternalEngine.optional(),
|
|
118
|
-
/** The external database's connection URL, or `-` to read it from stdin; default `
|
|
118
|
+
/** The external database's connection URL, or `-` to read it from stdin; default `FNLOOM_STORE_URL`. */
|
|
119
119
|
url: z.string().optional(),
|
|
120
120
|
schema: StoreSchema.optional(),
|
|
121
121
|
'cancel-runs': z.boolean().optional(),
|
|
@@ -125,9 +125,9 @@ export const storeMoveCommand = command({
|
|
|
125
125
|
run: async ({ positionals: [system], values }, io) => {
|
|
126
126
|
let to: StorePlacementInput;
|
|
127
127
|
if (values.to === 'external') {
|
|
128
|
-
const url = await secretOption(values.url, io, { flag: '--url', env: '
|
|
128
|
+
const url = await secretOption(values.url, io, { flag: '--url', env: 'FNLOOM_STORE_URL', stdin: true }) ?? io.settings.FNLOOM_STORE_URL;
|
|
129
129
|
if (values.engine === undefined || url === undefined || values.schema === undefined) {
|
|
130
|
-
io.out.warn('--to external needs --engine, --url (or
|
|
130
|
+
io.out.warn('--to external needs --engine, --url (or FNLOOM_STORE_URL) and --schema');
|
|
131
131
|
return 2;
|
|
132
132
|
}
|
|
133
133
|
to = { placement: 'external' as const, engine: values.engine, connection: url, schema: values.schema };
|
package/packages/cli/src/hub.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Reaching a hub from the CLI: its web API signed in as an admin, with uploads and downloads of content. It signs in
|
|
3
|
-
* with `
|
|
4
|
-
* with the admin account from the environment or `.env` (`
|
|
3
|
+
* with `FNLOOM_TOKEN` (or `--token -`, read from stdin; `--token <token>` works but other programs can see it), else
|
|
4
|
+
* with the admin account from the environment or `.env` (`FNLOOM_ADMIN_EMAIL`, `FNLOOM_ADMIN_PASSWORD`), as
|
|
5
5
|
* `npm run dev` does, else, for the hub `harness start` runs on this machine, with the admin account it saved in its data
|
|
6
|
-
* folder (`<
|
|
6
|
+
* folder (`<FNLOOM_DATA or ~/.harness>/admin.json`). A hub address from the folder's `.env` is only signed in to with
|
|
7
7
|
* that same file's sign-in, so a folder can't send the sign-in from the environment to a hub of its choosing.
|
|
8
8
|
*/
|
|
9
9
|
import { env } from '@ayepi/env';
|
|
@@ -18,21 +18,21 @@ import { sameLocalHub, type AdminFile } from './local.ts';
|
|
|
18
18
|
/** Where the CLI finds a hub and how it signs in. */
|
|
19
19
|
export const cliEnv = env({
|
|
20
20
|
/** The hub's address (`http://192.168.50.112:4300`). */
|
|
21
|
-
|
|
21
|
+
FNLOOM_URL: z.string().default('http://127.0.0.1:4300'),
|
|
22
22
|
/** An admin access token; without one the CLI signs in with the admin account below. */
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
FNLOOM_TOKEN: z.string().optional(),
|
|
24
|
+
FNLOOM_ADMIN_EMAIL: z.string().optional(),
|
|
25
|
+
FNLOOM_ADMIN_PASSWORD: z.string().optional(),
|
|
26
26
|
/** The data folder of the hub `harness start` runs here, where it saved its admin account (default `~/.harness`). */
|
|
27
|
-
|
|
27
|
+
FNLOOM_DATA: z.string().optional(),
|
|
28
28
|
/** A hub MCP's secret, for `harness mcp`. */
|
|
29
|
-
|
|
29
|
+
FNLOOM_MCP_SECRET: z.string().optional(),
|
|
30
30
|
/** An external store's connection URL, for `system store move --to external` (rather than `--url` on the command line). */
|
|
31
|
-
|
|
31
|
+
FNLOOM_STORE_URL: z.string().optional(),
|
|
32
32
|
/** How long `install` waits for a system to connect, in ms. */
|
|
33
|
-
|
|
33
|
+
FNLOOM_CLI_WAIT: z.number().int().min(0).default(30_000),
|
|
34
34
|
/** How long reading a system's contract (in a sandboxed child process) may take, in ms. */
|
|
35
|
-
|
|
35
|
+
FNLOOM_CLI_PROBE_TIMEOUT: z.number().int().min(1_000).default(60_000),
|
|
36
36
|
});
|
|
37
37
|
|
|
38
38
|
/** The parsed CLI settings. */
|
|
@@ -75,7 +75,7 @@ export interface HubTarget {
|
|
|
75
75
|
readonly url: string;
|
|
76
76
|
readonly token?: string | undefined;
|
|
77
77
|
readonly admin?: { readonly email: string; readonly password: string } | undefined;
|
|
78
|
-
/** False when neither `--hub` nor `
|
|
78
|
+
/** False when neither `--hub` nor `FNLOOM_URL` named the address (it is the default), so a saved admin's address is used. */
|
|
79
79
|
readonly addressGiven?: boolean | undefined;
|
|
80
80
|
/** The address of the hub the data folder's saved admin is for, when it is not this one (said when signing in fails). */
|
|
81
81
|
readonly savedUrl?: string | undefined;
|
|
@@ -83,26 +83,26 @@ export interface HubTarget {
|
|
|
83
83
|
|
|
84
84
|
/** Why a hub address from the folder's `.env` isn't signed in to with a sign-in from elsewhere. */
|
|
85
85
|
export const ENV_FILE_URL_REFUSED = 'The hub address comes from .env in this folder, but the sign-in does not. '
|
|
86
|
-
+ 'Pass --hub <url> or set
|
|
86
|
+
+ 'Pass --hub <url> or set FNLOOM_URL, or put the sign-in in the same .env.';
|
|
87
87
|
|
|
88
88
|
/**
|
|
89
89
|
* The hub target settings and options name. A secret signed in with instead (`harness mcp`'s) says where it came
|
|
90
90
|
* from. Refused when the address is from the folder's `.env` and the sign-in used isn't.
|
|
91
91
|
*/
|
|
92
92
|
export function hubTarget(settings: CliSettings, options: { hub?: string | undefined; token?: string | undefined }, secret?: { readonly fromFile: boolean }): HubTarget {
|
|
93
|
-
const token = options.token ?? settings.
|
|
94
|
-
const admin = settings.
|
|
95
|
-
? { email: settings.
|
|
96
|
-
if (options.hub === undefined && settings.fromFile.has('
|
|
93
|
+
const token = options.token ?? settings.FNLOOM_TOKEN;
|
|
94
|
+
const admin = settings.FNLOOM_ADMIN_EMAIL !== undefined && settings.FNLOOM_ADMIN_PASSWORD !== undefined
|
|
95
|
+
? { email: settings.FNLOOM_ADMIN_EMAIL, password: settings.FNLOOM_ADMIN_PASSWORD } : undefined;
|
|
96
|
+
if (options.hub === undefined && settings.fromFile.has('FNLOOM_URL') && !signInFromFile(settings, options, token, admin, secret)) {
|
|
97
97
|
throw new Error(ENV_FILE_URL_REFUSED);
|
|
98
98
|
}
|
|
99
|
-
const addressGiven = options.hub !== undefined || (settings.given?.has('
|
|
100
|
-
return { url: (options.hub ?? settings.
|
|
99
|
+
const addressGiven = options.hub !== undefined || (settings.given?.has('FNLOOM_URL') ?? true);
|
|
100
|
+
return { url: (options.hub ?? settings.FNLOOM_URL).replace(/\/$/, ''), token, admin, addressGiven };
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
/**
|
|
104
104
|
* A target with no sign-in given, signed in with the admin account `harness start` saved: at the saved account's
|
|
105
|
-
* address when no address was named (`--hub`, `
|
|
105
|
+
* address when no address was named (`--hub`, `FNLOOM_URL`), or when the one named is that same hub on this machine.
|
|
106
106
|
* A named address of another hub keeps no sign-in, and notes the saved one's address so the refusal can name it.
|
|
107
107
|
*/
|
|
108
108
|
export function withSavedAdmin(target: HubTarget, saved: AdminFile | undefined): HubTarget {
|
|
@@ -118,8 +118,8 @@ function signInFromFile(settings: CliSettings, options: { token?: string | undef
|
|
|
118
118
|
const { fromFile } = settings;
|
|
119
119
|
if (secret !== undefined) return secret.fromFile;
|
|
120
120
|
if (options.token !== undefined) return false;
|
|
121
|
-
if (token !== undefined) return fromFile.has('
|
|
122
|
-
return admin === undefined || (fromFile.has('
|
|
121
|
+
if (token !== undefined) return fromFile.has('FNLOOM_TOKEN');
|
|
122
|
+
return admin === undefined || (fromFile.has('FNLOOM_ADMIN_EMAIL') && fromFile.has('FNLOOM_ADMIN_PASSWORD'));
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
/** A secret option: its flag, the setting that gives it instead, and whether `-` reads it from stdin. */
|
|
@@ -172,10 +172,10 @@ export async function connectHub(target: HubTarget, fetcher: typeof fetch = fetc
|
|
|
172
172
|
/** Signed in as the admin account. */
|
|
173
173
|
async function adminClient(target: HubTarget): Promise<{ api: HubClient; close: () => void }> {
|
|
174
174
|
if (target.admin === undefined && target.savedUrl !== undefined) {
|
|
175
|
-
throw new Error(`Say how to sign in to ${target.url}: the admin saved in this data folder is for the hub at ${target.savedUrl}. Pass --hub ${target.savedUrl} (or set
|
|
175
|
+
throw new Error(`Say how to sign in to ${target.url}: the admin saved in this data folder is for the hub at ${target.savedUrl}. Pass --hub ${target.savedUrl} (or set FNLOOM_URL to it) to use that one, or set FNLOOM_TOKEN, or FNLOOM_ADMIN_EMAIL and FNLOOM_ADMIN_PASSWORD, for this one.`);
|
|
176
176
|
}
|
|
177
177
|
if (target.admin === undefined) {
|
|
178
|
-
throw new Error('Say how to sign in: set
|
|
178
|
+
throw new Error('Say how to sign in: set FNLOOM_TOKEN (or pass --token - and give it on stdin), or FNLOOM_ADMIN_EMAIL and FNLOOM_ADMIN_PASSWORD in the environment or .env. For the hub the start command runs here, set FNLOOM_DATA to its data folder when it is not ~/.harness.');
|
|
179
179
|
}
|
|
180
180
|
const signed = await signIn(target.url, target.admin);
|
|
181
181
|
return { api: signed.hub, close: () => { signed.close(); } };
|
|
@@ -8,6 +8,6 @@ export { NodeFiles, type CliFiles, type FileStat } from './files.ts';
|
|
|
8
8
|
export { cliEnv, cliSettings, connectHub, hubTarget, secretOption, withSavedAdmin, ENV_FILE_URL_REFUSED, type CliEnv, type CliSettings, type HubSession, type SecretFlag, type HubTarget } from './hub.ts';
|
|
9
9
|
export { nodeIo } from './io.ts';
|
|
10
10
|
export { goLiveIfInstalled, goLiveWhenPaired, liveApi, type GoLiveOutcome, type LiveApi } from './live.ts';
|
|
11
|
-
export { ADMIN_FILE, AdminFile, BUNDLED_SYSTEMS_DIR, CLI_NAME,
|
|
11
|
+
export { ADMIN_FILE, AdminFile, BUNDLED_SYSTEMS_DIR, CLI_NAME, FNLOOM_ROOT, PREMADE_DIR, START_SCRIPT, dataFolder, isStartScript, readAdminFile, sameLocalHub, type StartOptions, type StartScript } from './local.ts';
|
|
12
12
|
export { bundledSystem, bundledSystems, type BundledSystem } from './commands/available.ts';
|
|
13
13
|
export { PREMADE, componentOf, packagedSystems, startComponents, startedWhen, systemOfComponent, type Premade } from './premade.ts';
|
package/packages/cli/src/io.ts
CHANGED
|
@@ -17,12 +17,12 @@ export function nodeIo(cwd: string, environment: Readonly<Record<string, string
|
|
|
17
17
|
files,
|
|
18
18
|
env: environment,
|
|
19
19
|
cwd,
|
|
20
|
-
builder: new ViteBuilder({ probeTimeout: settings.
|
|
20
|
+
builder: new ViteBuilder({ probeTimeout: settings.FNLOOM_CLI_PROBE_TIMEOUT, probeEnv: scrubbedEnv(environment) }),
|
|
21
21
|
tests: new VitestRunner(files),
|
|
22
22
|
settings,
|
|
23
23
|
sleep: (ms) => new Promise((resolve) => { setTimeout(resolve, ms); }),
|
|
24
24
|
stdin: () => linesOf(process.stdin),
|
|
25
|
-
hub: (options) => connectHub(withSavedAdmin(hubTarget(settings, options), readAdminFile(dataFolder(cwd, settings.
|
|
25
|
+
hub: (options) => connectHub(withSavedAdmin(hubTarget(settings, options), readAdminFile(dataFolder(cwd, settings.FNLOOM_DATA, {})))),
|
|
26
26
|
// loaded only when asked: the stack's script, beside the CLI in the repository and in the published package
|
|
27
27
|
start: async (options) => {
|
|
28
28
|
const script: unknown = await import(pathToFileURL(START_SCRIPT).href);
|
|
@@ -11,7 +11,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
11
11
|
import { z } from 'zod';
|
|
12
12
|
|
|
13
13
|
/** The repository (or the installed package): this file is at `packages/cli/src/local.ts` in both. */
|
|
14
|
-
export const
|
|
14
|
+
export const FNLOOM_ROOT = fileURLToPath(new URL('../../../', import.meta.url));
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* The command people type: the root `package.json`'s bin in the published package (`release.bin`, `fnloom`), else
|
|
@@ -19,7 +19,7 @@ export const HARNESS_ROOT = fileURLToPath(new URL('../../../', import.meta.url))
|
|
|
19
19
|
*/
|
|
20
20
|
export const CLI_NAME: string = (() => {
|
|
21
21
|
try {
|
|
22
|
-
const parsed = z.object({ bin: z.record(z.string(), z.string()).optional() }).safeParse(JSON.parse(readFileSync(join(
|
|
22
|
+
const parsed = z.object({ bin: z.record(z.string(), z.string()).optional() }).safeParse(JSON.parse(readFileSync(join(FNLOOM_ROOT, 'package.json'), 'utf8')));
|
|
23
23
|
return (parsed.success ? Object.keys(parsed.data.bin ?? {})[0] : undefined) ?? 'harness';
|
|
24
24
|
} catch {
|
|
25
25
|
return 'harness';
|
|
@@ -27,19 +27,19 @@ export const CLI_NAME: string = (() => {
|
|
|
27
27
|
})();
|
|
28
28
|
|
|
29
29
|
/** The premade systems this copy of the harness carries. */
|
|
30
|
-
export const BUNDLED_SYSTEMS_DIR = join(
|
|
30
|
+
export const BUNDLED_SYSTEMS_DIR = join(FNLOOM_ROOT, 'systems');
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* The heavy premade systems as package zips (`premade/<name>.zip`), in the published package only: `harness system
|
|
34
34
|
* install <name>` installs one and the hub fetches the npm packages it left out into its own folder (`premade.ts`).
|
|
35
35
|
*/
|
|
36
|
-
export const PREMADE_DIR = join(
|
|
36
|
+
export const PREMADE_DIR = join(FNLOOM_ROOT, 'premade');
|
|
37
37
|
|
|
38
38
|
/** Folders in `systems/` that are not systems to install: the template `harness system new` copies. */
|
|
39
39
|
export const NOT_INSTALLABLE = new Set(['template']);
|
|
40
40
|
|
|
41
41
|
/** The script `harness start` runs. */
|
|
42
|
-
export const START_SCRIPT = join(
|
|
42
|
+
export const START_SCRIPT = join(FNLOOM_ROOT, 'scripts', 'start.ts');
|
|
43
43
|
|
|
44
44
|
/** Where `harness start` keeps the admin account it made, inside the data folder. */
|
|
45
45
|
export const ADMIN_FILE = 'admin.json';
|
|
@@ -48,9 +48,9 @@ export const ADMIN_FILE = 'admin.json';
|
|
|
48
48
|
export const AdminFile = z.object({ url: z.string(), email: z.email(), password: z.string().min(8) });
|
|
49
49
|
export type AdminFile = z.infer<typeof AdminFile>;
|
|
50
50
|
|
|
51
|
-
/** The data folder: the option, else `
|
|
51
|
+
/** The data folder: the option, else `FNLOOM_DATA`, else `~/.harness`. */
|
|
52
52
|
export function dataFolder(cwd: string, option: string | undefined, environment: Readonly<Record<string, string | undefined>>): string {
|
|
53
|
-
const given = option ?? environment['
|
|
53
|
+
const given = option ?? environment['FNLOOM_DATA'];
|
|
54
54
|
return given === undefined || given === '' ? join(homedir(), '.harness') : resolve(cwd, given);
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -38,7 +38,7 @@ export const PREMADE: Readonly<Record<string, Premade>> = {
|
|
|
38
38
|
schedule: { start: 'always' },
|
|
39
39
|
api: { start: 'always' },
|
|
40
40
|
'google-calendar': { start: { when: ['GOOGLE_CLIENT_ID', 'GOOGLE_CLIENT_SECRET'] }, component: 'calendar' },
|
|
41
|
-
embedder: { start: { when: ['
|
|
41
|
+
embedder: { start: { when: ['FNLOOM_EMBEDDER_URL'] } },
|
|
42
42
|
ollama: {},
|
|
43
43
|
mcp: {},
|
|
44
44
|
widgets: { note: 'widgets draws charts and tables from database queries: install database too (harness system install database --config <file.json>)' },
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
|
-
"@aeye/gin": "^0.
|
|
4
|
-
"@aeye/schema": "^0.
|
|
5
|
-
"@aeye/resources": "^0.
|
|
3
|
+
"@aeye/gin": "^0.11.1",
|
|
4
|
+
"@aeye/schema": "^0.11.1",
|
|
5
|
+
"@aeye/resources": "^0.11.1",
|
|
6
6
|
"@ayepi/auth": "^0.6.0",
|
|
7
7
|
"@ayepi/core": "^0.6.0",
|
|
8
8
|
"@ayepi/log": "^0.6.0",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"name": "@harness/core",
|
|
13
13
|
"private": true,
|
|
14
|
-
"version": "0.
|
|
14
|
+
"version": "0.4.0",
|
|
15
15
|
"license": "Apache-2.0",
|
|
16
16
|
"type": "module",
|
|
17
17
|
"description": "Wire contracts: zod schemas and ayepi specs for the system link (both directions), the web API and events. Every record and wire type is derived from them.",
|
|
@@ -11,7 +11,7 @@ import { ActorId, AutoPairId, Duration, InstanceName, SystemName, Timestamp } fr
|
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* The admin's choice at pairing: auto pair, expiring after `expiresIn` ms, never (`null`), or after the hub's default
|
|
14
|
-
* (`
|
|
14
|
+
* (`FNLOOM_AUTO_PAIR_EXPIRY`, 90 days) when absent.
|
|
15
15
|
*/
|
|
16
16
|
export const AutoPairChoice = z.object({ expiresIn: Duration.nullable().optional() });
|
|
17
17
|
export type AutoPairChoice = z.infer<typeof AutoPairChoice>;
|
|
@@ -11,7 +11,6 @@ import { ShareRule } from './access.ts';
|
|
|
11
11
|
import { GinTypeDef } from './gin.ts';
|
|
12
12
|
import { PickOption } from './pickers.ts';
|
|
13
13
|
import { ActorId, ConnectionId, InstanceName, Json, LocalName, QualifiedName, SecretId, SYSTEM_NAME_PATTERN, SystemName, Timestamp } from './primitives.ts';
|
|
14
|
-
import { RemoteAuth } from './remote-auth.ts';
|
|
15
14
|
|
|
16
15
|
/** A per-person fn's switches: whether it is on, and whether it must ask before acting. */
|
|
17
16
|
export const ConnectionFnOption = z.object({ on: z.boolean(), ask: z.boolean() });
|
|
@@ -44,18 +43,6 @@ export type InstanceConnect = z.infer<typeof InstanceConnect>;
|
|
|
44
43
|
export const ConnectKey = z.string().regex(SYSTEM_NAME_PATTERN).brand<'ConnectKey'>();
|
|
45
44
|
export type ConnectKey = z.infer<typeof ConnectKey>;
|
|
46
45
|
|
|
47
|
-
/**
|
|
48
|
-
* What the hub reads of each record of a key-scoped system's key type (`ConnectDecl.keys.type`): the key, the words on
|
|
49
|
-
* its card, and how it signs in (`RemoteAuth`, from which the hub works out how people connect). Optional: `baseUrl`,
|
|
50
|
-
* where its requests go (the card shows its host, so people see where a token goes before they type it), and
|
|
51
|
-
* `privateTo`, the one person who sees and connects to it (absent: everyone who sees the system). Other fields are the
|
|
52
|
-
* system's own.
|
|
53
|
-
*/
|
|
54
|
-
export const ConnectKeyRecord = z.looseObject({
|
|
55
|
-
name: ConnectKey, label: z.string().min(1), auth: RemoteAuth, baseUrl: z.url().optional(), privateTo: ActorId.optional(),
|
|
56
|
-
});
|
|
57
|
-
export type ConnectKeyRecord = z.infer<typeof ConnectKeyRecord>;
|
|
58
|
-
|
|
59
46
|
/**
|
|
60
47
|
* A fn's connection key, for a key-scoped system: a fixed key (an api fn's service, from its kind's description), or the
|
|
61
48
|
* arg whose value names it (a fn that takes the service to act on).
|
|
@@ -82,7 +69,7 @@ export const ConnectDecl = z.object({
|
|
|
82
69
|
* Absent, `system`: one connection per person to the whole system.
|
|
83
70
|
*/
|
|
84
71
|
scope: z.enum(['system', 'instance', 'key']).optional(),
|
|
85
|
-
/** For `scope: 'key'`: the system's stored type whose records are the keys (each
|
|
72
|
+
/** For `scope: 'key'`: the system's stored type whose records are the keys (each the SDK's `ConnectKeyRecord`). */
|
|
86
73
|
keys: z.object({ type: QualifiedName }).optional(),
|
|
87
74
|
/** Build 9: the switches of a fn `fns` does not name (the runtime fns of an instance-scoped system). */
|
|
88
75
|
defaults: ConnectionFnOption.optional(),
|
|
@@ -131,7 +131,7 @@ export const ContextLink = z.object({
|
|
|
131
131
|
relation: LinkRelation,
|
|
132
132
|
weight: z.number().min(0).max(1),
|
|
133
133
|
source: LinkSource,
|
|
134
|
-
/** For learned edges: how many turns used both ends (decays by half every `
|
|
134
|
+
/** For learned edges: how many turns used both ends (decays by half every `FNLOOM_LINK_HALF_LIFE`). */
|
|
135
135
|
uses: z.number().min(0).optional(),
|
|
136
136
|
/** For authored edges: the person who drew it. */
|
|
137
137
|
by: ActorId.optional(),
|
|
@@ -105,7 +105,7 @@ export type RecordPage = z.infer<typeof RecordPage>;
|
|
|
105
105
|
*/
|
|
106
106
|
export const RecordTableQuery = RecordQuery.extend({
|
|
107
107
|
query: ListQuery.omit({ cursor: true, limit: true }).optional(),
|
|
108
|
-
/** Offset paging, which a widget's pager drives (`
|
|
108
|
+
/** Offset paging, which a widget's pager drives (`PagingArgs`). */
|
|
109
109
|
offset: z.number().int().min(0).optional(),
|
|
110
110
|
limit: z.number().int().min(1).max(500).optional(),
|
|
111
111
|
});
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
import { ActorId, Timestamp } from './primitives.ts';
|
|
8
8
|
|
|
9
|
-
/** The hub option key of the HTTPS switch (an admin's choice; `
|
|
9
|
+
/** The hub option key of the HTTPS switch (an admin's choice; `FNLOOM_HTTPS` until one is made). */
|
|
10
10
|
export const HTTPS_OPTION = 'https';
|
|
11
11
|
|
|
12
12
|
/** Where the hub serves its authority's certificate, for a phone or computer to install. */
|
|
13
13
|
export const AUTHORITY_PATHS = { der: '/harness-ca.crt', pem: '/harness-ca.pem' } as const;
|
|
14
14
|
|
|
15
|
-
/** Where the certificate comes from: the hub's own authority, or the files in `
|
|
15
|
+
/** Where the certificate comes from: the hub's own authority, or the files in `FNLOOM_TLS_CERT` / `FNLOOM_TLS_KEY`. */
|
|
16
16
|
export const HttpsSource = z.enum(['own', 'files']);
|
|
17
17
|
export type HttpsSource = z.infer<typeof HttpsSource>;
|
|
18
18
|
|