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
|
@@ -4,6 +4,10 @@ key: "authoring.remote"
|
|
|
4
4
|
title: "Remote services: fleets, sign-in and connections per instance"
|
|
5
5
|
description: "Writing a harness system: Remote services: fleets, sign-in and connections per instance."
|
|
6
6
|
summary: "Fleets of remote services (MCP servers, APIs): sign-in, per-instance connections and credentials."
|
|
7
|
+
question: "How does a system reach a remote service people sign in to?"
|
|
8
|
+
when: "When each instance of a system calls a remote service (an MCP server, an API) with its own connection and credentials."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-29"
|
|
7
11
|
parent: "fs/authoring.topics.server"
|
|
8
12
|
next: "fs/authoring.client"
|
|
9
13
|
fns: ["fs/read", "fs/write", "fs/edit", "fs/bash"]
|
|
@@ -16,14 +20,14 @@ choices:
|
|
|
16
20
|
when: "Pick this to go on in order: The client: renderers, inputs, resource views and pages."
|
|
17
21
|
---
|
|
18
22
|
|
|
19
|
-
##
|
|
23
|
+
## 26. Remote services: fleets, sign-in and connections per instance
|
|
20
24
|
|
|
21
25
|
A system that calls a remote service it was set up for (an MCP server) is a fleet: one instance per service, added from
|
|
22
26
|
the browser with its config (`instances: "many"` in `system.json`). A system that authors code calling many services
|
|
23
|
-
(the `api` system) runs one instance and keeps its services as records instead: see **Connections per key** below. Its sign-in is
|
|
27
|
+
(the `api` system) runs one instance and keeps its services as records instead: see **Connections per key** below. Its sign-in is the SDK's `RemoteAuth` in that config:
|
|
24
28
|
`none`, `bearer` (a token), `headers` (named header values) or `oauth`, each `per: 'shared'` (the instance's own config
|
|
25
29
|
secrets, the same for everyone) or `per: 'person'` (each person connects their own). List the secret paths in
|
|
26
|
-
`configSecrets` (
|
|
30
|
+
`configSecrets` (`REMOTE_AUTH_SECRETS` under `auth`), so the hub seals them and never shows them again.
|
|
27
31
|
|
|
28
32
|
**Connections per instance.** Declare `connect` with `scope: 'instance'`: then every fn that runs on the instance acts
|
|
29
33
|
as the person, and each instance tells the hub how people connect to it with `ctx.instanceConnect(...)`
|
|
@@ -34,7 +38,7 @@ OAuth (an admin's sign-in shared with everyone when `per: 'shared'`), a form for
|
|
|
34
38
|
finds the instance's fns unavailable until they connect on the Connections page.
|
|
35
39
|
|
|
36
40
|
**Connections per key.** Declare `connect` with `scope: 'key'` and `keys: { type: '<system>/<Type>' }`, a stored type of
|
|
37
|
-
yours whose records each carry `name` (the key), `label` and `auth` (
|
|
41
|
+
yours whose records each carry `name` (the key), `label` and `auth` (`ConnectKeyRecord`; use `RecordAuth`, the
|
|
38
42
|
`TypedAuth` with no secret in it, since a record never holds one). The hub reads the records from its database and
|
|
39
43
|
shows a card per key on the Connections page, worked out with `keyConnectOf(label, auth)`: a per-person token or headers
|
|
40
44
|
is each person's own form, and a shared one is one admin's form, shared with everyone. A fn acts through its key:
|
|
@@ -43,7 +47,7 @@ fn's service): the run gets the person's (or the shared) connection to that key,
|
|
|
43
47
|
the key needs one (fail with `code: 'not-connected'`). `connectFinish` gets the `key`; read the shared form with `credentialsFromForm(auth, form, 'any')`.
|
|
44
48
|
|
|
45
49
|
**Credentials.** A form connection's `connectFinish` reads the filled form with `credentialsFromForm(auth, form)` into
|
|
46
|
-
|
|
50
|
+
`RemoteCredentials` (or a problem to show), which the hub keeps as the person's connection; `accountLabel` names
|
|
47
51
|
it without the secret. In a run, `ctx.connection.credentials` carries it back: `readCredentials` reads it and `credentialHeaders`
|
|
48
52
|
turns it into the headers to send; `sharedHeaders(auth)` gives the instance's own. OAuth tokens a run refreshes go back
|
|
49
53
|
with `ctx.updateConnection`. Never log a secret: `maskHeaders(headers, secretHeaderNames(auth))` is what a trace or a
|
|
@@ -4,6 +4,10 @@ key: "authoring.remote.reference"
|
|
|
4
4
|
title: "Remote services: fleets, sign-in and connections per instance: reference"
|
|
5
5
|
description: "The API reference of Remote services: fleets, sign-in and connections per instance: every export with its TSDoc and signature."
|
|
6
6
|
summary: "Signatures and options for remote services: fleets, sign-in and connections per instance."
|
|
7
|
+
question: "What are the exact signatures and options in the API of remote services: fleets, sign-in and connections per instance?"
|
|
8
|
+
when: "When writing code for remote services: fleets, sign-in and connections per instance and an exact signature, field or option is needed."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-29"
|
|
7
11
|
parent: "fs/authoring.remote"
|
|
8
12
|
suggest: "none"
|
|
9
13
|
tags: ["authoring", "reference"]
|
|
@@ -12,6 +16,202 @@ niche: "developer"
|
|
|
12
16
|
|
|
13
17
|
### Reference: remote services: fleets, sign-in and connections per instance
|
|
14
18
|
|
|
19
|
+
#### `RemoteAuth`
|
|
20
|
+
|
|
21
|
+
const, type · `import { RemoteAuth } from '@harness/sdk'`
|
|
22
|
+
|
|
23
|
+
How an instance signs in to its remote service.
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
type RemoteAuth = {
|
|
27
|
+
kind: "none";
|
|
28
|
+
} | {
|
|
29
|
+
kind: "bearer";
|
|
30
|
+
per: "shared" | "person";
|
|
31
|
+
token?: string | undefined;
|
|
32
|
+
} | {
|
|
33
|
+
kind: "headers";
|
|
34
|
+
per: "shared" | "person";
|
|
35
|
+
names: string[];
|
|
36
|
+
values?: Record<string, string> | undefined;
|
|
37
|
+
} | {
|
|
38
|
+
kind: "oauth";
|
|
39
|
+
per: "shared" | "person";
|
|
40
|
+
scopes?: string[] | undefined;
|
|
41
|
+
clientId?: string | undefined;
|
|
42
|
+
clientSecret?: string | undefined;
|
|
43
|
+
};
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
#### `RemoteAuthPer`
|
|
47
|
+
|
|
48
|
+
const, type · `import { RemoteAuthPer } from '@harness/sdk'`
|
|
49
|
+
|
|
50
|
+
Whose credentials a call uses: one set for everyone (`shared`) or each caller's own (`person`).
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
type RemoteAuthPer = "shared" | "person";
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
#### `TypedAuth`
|
|
57
|
+
|
|
58
|
+
const, type · `import { TypedAuth } from '@harness/sdk'`
|
|
59
|
+
|
|
60
|
+
The sign-ins that need no browser flow: none, a token or header values. A service whose OAuth endpoints are not
|
|
61
|
+
found from the server itself (an API service, unlike an MCP server) signs in with one of these.
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
type TypedAuth = {
|
|
65
|
+
kind: "none";
|
|
66
|
+
} | {
|
|
67
|
+
kind: "bearer";
|
|
68
|
+
per: "shared" | "person";
|
|
69
|
+
token?: string | undefined;
|
|
70
|
+
} | {
|
|
71
|
+
kind: "headers";
|
|
72
|
+
per: "shared" | "person";
|
|
73
|
+
names: string[];
|
|
74
|
+
values?: Record<string, string> | undefined;
|
|
75
|
+
};
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
#### `RecordAuth`
|
|
79
|
+
|
|
80
|
+
const, type · `import { RecordAuth } from '@harness/sdk'`
|
|
81
|
+
|
|
82
|
+
A `TypedAuth` with no secret in it: how a record (which never holds a secret) says its service signs in. A shared
|
|
83
|
+
token or shared header values are then one admin's connection shared with everyone (`InstanceConnect.share`), and a
|
|
84
|
+
per-person one each person's own connection, both kept by the hub as secrets.
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
type RecordAuth = {
|
|
88
|
+
kind: "none";
|
|
89
|
+
} | {
|
|
90
|
+
kind: "bearer";
|
|
91
|
+
per: "shared" | "person";
|
|
92
|
+
} | {
|
|
93
|
+
kind: "headers";
|
|
94
|
+
per: "shared" | "person";
|
|
95
|
+
names: string[];
|
|
96
|
+
};
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
#### `HeaderName`
|
|
100
|
+
|
|
101
|
+
const, type · `import { HeaderName } from '@harness/sdk'`
|
|
102
|
+
|
|
103
|
+
A header's name (`X-Api-Key`).
|
|
104
|
+
|
|
105
|
+
```ts
|
|
106
|
+
type HeaderName = string;
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
#### `HeaderValues`
|
|
110
|
+
|
|
111
|
+
const, type · `import { HeaderValues } from '@harness/sdk'`
|
|
112
|
+
|
|
113
|
+
Header values by name. Shared values are config secrets; per-person values are left out here.
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
type HeaderValues = {
|
|
117
|
+
[x: string]: string;
|
|
118
|
+
};
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
#### `REMOTE_AUTH_SECRETS`
|
|
122
|
+
|
|
123
|
+
const · `import { REMOTE_AUTH_SECRETS } from '@harness/sdk'`
|
|
124
|
+
|
|
125
|
+
The config paths (under an instance's `auth` field) that hold secrets: sealed by the hub, never shown again.
|
|
126
|
+
|
|
127
|
+
```ts
|
|
128
|
+
const REMOTE_AUTH_SECRETS: readonly ["auth.token", "auth.values", "auth.clientSecret"];
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Refers to: [`ConfigPath`](context:fs/authoring.core-types.config-secrets-ts#core-configpath).
|
|
132
|
+
|
|
133
|
+
#### `TYPED_AUTH_SECRETS`
|
|
134
|
+
|
|
135
|
+
const · `import { TYPED_AUTH_SECRETS } from '@harness/sdk'`
|
|
136
|
+
|
|
137
|
+
The config paths (under an instance's `auth` field) that hold a `TypedAuth`'s secrets.
|
|
138
|
+
|
|
139
|
+
```ts
|
|
140
|
+
const TYPED_AUTH_SECRETS: readonly ["auth.token", "auth.values"];
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Refers to: [`ConfigPath`](context:fs/authoring.core-types.config-secrets-ts#core-configpath).
|
|
144
|
+
|
|
145
|
+
#### `connectFlowOf`
|
|
146
|
+
|
|
147
|
+
function · `import { connectFlowOf } from '@harness/sdk'`
|
|
148
|
+
|
|
149
|
+
What a person connects with for an auth that is per person (or an OAuth shared through one connection): the connect
|
|
150
|
+
flow it maps to. `undefined` when calls need no connection at all.
|
|
151
|
+
|
|
152
|
+
```ts
|
|
153
|
+
function connectFlowOf(auth: RemoteAuth): "oauth" | "form" | undefined;
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
#### `RemoteCredentials`
|
|
157
|
+
|
|
158
|
+
const, type · `import { RemoteCredentials } from '@harness/sdk'`
|
|
159
|
+
|
|
160
|
+
Per-person credentials kept by the hub for a `form` connection: the token or the header values the person typed.
|
|
161
|
+
|
|
162
|
+
```ts
|
|
163
|
+
type RemoteCredentials = {
|
|
164
|
+
token: string;
|
|
165
|
+
} | {
|
|
166
|
+
headers: Record<string, string>;
|
|
167
|
+
} | {
|
|
168
|
+
accessToken: string;
|
|
169
|
+
tokenType: string;
|
|
170
|
+
refreshToken?: string | undefined;
|
|
171
|
+
clientId?: string | undefined;
|
|
172
|
+
};
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
#### `ConnectKeyRecord`
|
|
176
|
+
|
|
177
|
+
const, type · `import { ConnectKeyRecord } from '@harness/sdk'`
|
|
178
|
+
|
|
179
|
+
What the hub reads of each record of a key-scoped system's key type (`ConnectDecl.keys.type`): the key, the words on
|
|
180
|
+
its card, and how it signs in (`RemoteAuth`, from which the hub works out how people connect). Optional: `baseUrl`,
|
|
181
|
+
where its requests go (the card shows its host, so people see where a token goes before they type it), and
|
|
182
|
+
`privateTo`, the one person who sees and connects to it (absent: everyone who sees the system). Other fields are the
|
|
183
|
+
system's own.
|
|
184
|
+
|
|
185
|
+
```ts
|
|
186
|
+
type ConnectKeyRecord = {
|
|
187
|
+
[x: string]: unknown;
|
|
188
|
+
name: ConnectKey;
|
|
189
|
+
label: string;
|
|
190
|
+
auth: {
|
|
191
|
+
kind: "none";
|
|
192
|
+
} | {
|
|
193
|
+
kind: "bearer";
|
|
194
|
+
per: "shared" | "person";
|
|
195
|
+
token?: string | undefined;
|
|
196
|
+
} | {
|
|
197
|
+
kind: "headers";
|
|
198
|
+
per: "shared" | "person";
|
|
199
|
+
names: string[];
|
|
200
|
+
values?: Record<string, string> | undefined;
|
|
201
|
+
} | {
|
|
202
|
+
kind: "oauth";
|
|
203
|
+
per: "shared" | "person";
|
|
204
|
+
scopes?: string[] | undefined;
|
|
205
|
+
clientId?: string | undefined;
|
|
206
|
+
clientSecret?: string | undefined;
|
|
207
|
+
};
|
|
208
|
+
baseUrl?: string | undefined;
|
|
209
|
+
privateTo?: string | undefined;
|
|
210
|
+
};
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Refers to: [`ActorId`](context:fs/authoring.core-types.primitives-ts#core-actorid), [`ConnectKey`](context:fs/authoring.core-types.connections-ts#core-connectkey).
|
|
214
|
+
|
|
15
215
|
#### `InstanceConnects`
|
|
16
216
|
|
|
17
217
|
interface · `import { InstanceConnects } from '@harness/sdk'`
|
|
@@ -40,7 +240,7 @@ How people connect to an instance, for `ctx.instanceConnect`: OAuth (shared thro
|
|
|
40
240
|
function instanceConnectOf(label: string, auth: RemoteAuth): z.input<typeof InstanceConnect>;
|
|
41
241
|
```
|
|
42
242
|
|
|
43
|
-
Refers to: [`InstanceConnect`](context:fs/authoring.core-types.connections-ts#core-instanceconnect)
|
|
243
|
+
Refers to: [`InstanceConnect`](context:fs/authoring.core-types.connections-ts#core-instanceconnect).
|
|
44
244
|
|
|
45
245
|
#### `keyConnectOf`
|
|
46
246
|
|
|
@@ -54,7 +254,7 @@ token or headers as one admin's form, shared with everyone; OAuth as `instanceCo
|
|
|
54
254
|
function keyConnectOf(label: string, auth: RemoteAuth): z.input<typeof InstanceConnect>;
|
|
55
255
|
```
|
|
56
256
|
|
|
57
|
-
Refers to: [`InstanceConnect`](context:fs/authoring.core-types.connections-ts#core-instanceconnect)
|
|
257
|
+
Refers to: [`InstanceConnect`](context:fs/authoring.core-types.connections-ts#core-instanceconnect).
|
|
58
258
|
|
|
59
259
|
#### `connectForm`
|
|
60
260
|
|
|
@@ -66,8 +266,6 @@ The form to connect with a typed token or header values (`FormFor`); `undefined`
|
|
|
66
266
|
function connectForm(auth: RemoteAuth, who?: FormFor): GinType<Record<string, string>> | undefined;
|
|
67
267
|
```
|
|
68
268
|
|
|
69
|
-
Refers to: [`RemoteAuth`](context:fs/authoring.core-types.remote-auth-ts#core-remoteauth).
|
|
70
|
-
|
|
71
269
|
#### `FormFor`
|
|
72
270
|
|
|
73
271
|
type · `import { FormFor } from '@harness/sdk'`
|
|
@@ -89,8 +287,6 @@ Whether calls use a person's connection (their own, or the one an admin shares)
|
|
|
89
287
|
function usesConnections(auth: RemoteAuth): boolean;
|
|
90
288
|
```
|
|
91
289
|
|
|
92
|
-
Refers to: [`RemoteAuth`](context:fs/authoring.core-types.remote-auth-ts#core-remoteauth).
|
|
93
|
-
|
|
94
290
|
#### `credentialsFromForm`
|
|
95
291
|
|
|
96
292
|
function · `import { credentialsFromForm } from '@harness/sdk'`
|
|
@@ -101,7 +297,7 @@ The credentials a filled connect form makes, or what is wrong with it.
|
|
|
101
297
|
function credentialsFromForm(auth: RemoteAuth, form: Json, who?: FormFor): { readonly credentials: RemoteCredentials; } | { readonly problem: string; };
|
|
102
298
|
```
|
|
103
299
|
|
|
104
|
-
Refers to: [`Json`](context:fs/authoring.core-types.primitives-ts#core-json)
|
|
300
|
+
Refers to: [`Json`](context:fs/authoring.core-types.primitives-ts#core-json).
|
|
105
301
|
|
|
106
302
|
#### `readCredentials`
|
|
107
303
|
|
|
@@ -113,7 +309,7 @@ A connection's credentials, read; `undefined` when they aren't `RemoteCredential
|
|
|
113
309
|
function readCredentials(value: Json): RemoteCredentials | undefined;
|
|
114
310
|
```
|
|
115
311
|
|
|
116
|
-
Refers to: [`Json`](context:fs/authoring.core-types.primitives-ts#core-json)
|
|
312
|
+
Refers to: [`Json`](context:fs/authoring.core-types.primitives-ts#core-json).
|
|
117
313
|
|
|
118
314
|
#### `credentialHeaders`
|
|
119
315
|
|
|
@@ -125,8 +321,6 @@ The headers a person's credentials send.
|
|
|
125
321
|
function credentialHeaders(credentials: RemoteCredentials): Record<string, string>;
|
|
126
322
|
```
|
|
127
323
|
|
|
128
|
-
Refers to: [`RemoteCredentials`](context:fs/authoring.core-types.remote-auth-ts#core-remotecredentials).
|
|
129
|
-
|
|
130
324
|
#### `sharedHeaders`
|
|
131
325
|
|
|
132
326
|
function · `import { sharedHeaders } from '@harness/sdk'`
|
|
@@ -137,8 +331,6 @@ The headers the instance's own config sends: a shared token or shared header val
|
|
|
137
331
|
function sharedHeaders(auth: RemoteAuth): Record<string, string>;
|
|
138
332
|
```
|
|
139
333
|
|
|
140
|
-
Refers to: [`RemoteAuth`](context:fs/authoring.core-types.remote-auth-ts#core-remoteauth).
|
|
141
|
-
|
|
142
334
|
#### `accountLabel`
|
|
143
335
|
|
|
144
336
|
function · `import { accountLabel } from '@harness/sdk'`
|
|
@@ -149,8 +341,6 @@ A short label for an account connected with a token or headers ("Token ending 4f
|
|
|
149
341
|
function accountLabel(credentials: RemoteCredentials): string;
|
|
150
342
|
```
|
|
151
343
|
|
|
152
|
-
Refers to: [`RemoteCredentials`](context:fs/authoring.core-types.remote-auth-ts#core-remotecredentials).
|
|
153
|
-
|
|
154
344
|
#### `secretHeaderNames`
|
|
155
345
|
|
|
156
346
|
function · `import { secretHeaderNames } from '@harness/sdk'`
|
|
@@ -162,8 +352,6 @@ key headers. Compare in lower case.
|
|
|
162
352
|
function secretHeaderNames(auth: RemoteAuth): ReadonlySet<string>;
|
|
163
353
|
```
|
|
164
354
|
|
|
165
|
-
Refers to: [`RemoteAuth`](context:fs/authoring.core-types.remote-auth-ts#core-remoteauth).
|
|
166
|
-
|
|
167
355
|
#### `maskHeaders`
|
|
168
356
|
|
|
169
357
|
function · `import { maskHeaders } from '@harness/sdk'`
|
|
@@ -4,6 +4,10 @@ key: "authoring.resources"
|
|
|
4
4
|
title: "Resources, embedders and sectioners"
|
|
5
5
|
description: "Writing a harness system: Resources, embedders and sectioners."
|
|
6
6
|
summary: "Resources, embedders and sectioners a system serves."
|
|
7
|
+
question: "How does a system serve files or documents as resources?"
|
|
8
|
+
when: "When a system serves files or documents as resources, or adds an embedder or a sectioner."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
7
11
|
parent: "fs/authoring.topics.declare"
|
|
8
12
|
next: "fs/authoring.hub"
|
|
9
13
|
fns: ["fs/read", "fs/write", "fs/edit", "fs/bash"]
|
|
@@ -16,7 +20,7 @@ choices:
|
|
|
16
20
|
when: "Pick this to go on in order: The hub contract."
|
|
17
21
|
---
|
|
18
22
|
|
|
19
|
-
##
|
|
23
|
+
## 19. Resources, embedders and sectioners
|
|
20
24
|
|
|
21
25
|
### Resources
|
|
22
26
|
|
|
@@ -4,6 +4,10 @@ key: "authoring.resources.reference"
|
|
|
4
4
|
title: "Resources, embedders and sectioners: reference"
|
|
5
5
|
description: "The API reference of Resources, embedders and sectioners: every export with its TSDoc and signature."
|
|
6
6
|
summary: "Signatures and options for resources, embedders and sectioners."
|
|
7
|
+
question: "What are the exact signatures and options in the API of resources, embedders and sectioners?"
|
|
8
|
+
when: "When writing code for resources, embedders and sectioners and an exact signature, field or option is needed."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
7
11
|
parent: "fs/authoring.resources"
|
|
8
12
|
suggest: "none"
|
|
9
13
|
tags: ["authoring", "reference"]
|
|
@@ -4,6 +4,10 @@ key: "authoring.server"
|
|
|
4
4
|
title: "The server: serve and the implementation"
|
|
5
5
|
description: "Writing a harness system: The server: serve and the implementation."
|
|
6
6
|
summary: "serve() and the implementation object the contract types."
|
|
7
|
+
question: "How do I write a system's server/impl.ts and server/main.ts?"
|
|
8
|
+
when: "When writing serve() and the implementation object the contract types."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
7
11
|
parent: "fs/authoring.topics.server"
|
|
8
12
|
next: "fs/authoring.ctx"
|
|
9
13
|
fns: ["fs/read", "fs/write", "fs/edit", "fs/bash"]
|
|
@@ -16,7 +20,7 @@ choices:
|
|
|
16
20
|
when: "Pick this to go on in order: The run context and services."
|
|
17
21
|
---
|
|
18
22
|
|
|
19
|
-
##
|
|
23
|
+
## 21. The server: serve and the implementation
|
|
20
24
|
|
|
21
25
|
`serve(contract, impl, options, host?)` (from `@harness/sdk/server`) connects to the hub, pairs the first time, sends the
|
|
22
26
|
manifest (or nothing when the hub already has this version of it), and serves the implementation over the link. It
|
|
@@ -65,14 +69,14 @@ const { host, log } = loggedHost(notes.name);
|
|
|
65
69
|
const impl = createNotesImpl({ settings });
|
|
66
70
|
|
|
67
71
|
// the renderers, built into the state folder and uploaded to the hub on connect
|
|
68
|
-
const clientFolder = join(settings.
|
|
72
|
+
const clientFolder = join(settings.FNLOOM_SYSTEM_STATE, 'client');
|
|
69
73
|
await buildClient({ entry: fileURLToPath(new URL('../client/index.ts', import.meta.url)), outDir: clientFolder });
|
|
70
74
|
|
|
71
75
|
const running = await serve(notes, impl, {
|
|
72
|
-
hub: settings.
|
|
73
|
-
state: settings.
|
|
76
|
+
hub: settings.FNLOOM_HUB,
|
|
77
|
+
state: settings.FNLOOM_SYSTEM_STATE,
|
|
74
78
|
client: clientFolder,
|
|
75
|
-
...(settings.
|
|
79
|
+
...(settings.FNLOOM_PAIRING_TOKEN === undefined ? {} : { pairingToken: settings.FNLOOM_PAIRING_TOKEN }),
|
|
76
80
|
}, host);
|
|
77
81
|
running.onStatus((status) => { log.info('notes.status', { status }); });
|
|
78
82
|
|
|
@@ -88,10 +92,10 @@ outcome journal), `pairingToken` (a one-time token an admin made), `client` (the
|
|
|
88
92
|
`version` (default: from `package.json`), `mcp` (also serve its native fns as an MCP server over stdio or HTTP),
|
|
89
93
|
`connectTimeout`, and seams for `files` and `fetch`.
|
|
90
94
|
|
|
91
|
-
**Env.** A system's tunables are an `@ayepi/env` slice that spreads `systemFields()` (the hub URL `
|
|
92
|
-
instance `
|
|
95
|
+
**Env.** A system's tunables are an `@ayepi/env` slice that spreads `systemFields()` (the hub URL `FNLOOM_HUB`, the
|
|
96
|
+
instance `FNLOOM_INSTANCE`, the pairing token `FNLOOM_PAIRING_TOKEN`, the data and cache folders) and its own, each a
|
|
93
97
|
zod schema with a default and a TSDoc line, then adds `systemState('<name>')`: the state folder
|
|
94
|
-
`
|
|
98
|
+
`FNLOOM_SYSTEM_STATE`, which defaults to one of its own per instance. Feature code never reads `process.env`:
|
|
95
99
|
|
|
96
100
|
_From `scripts/docs/example/server/env.ts`:_
|
|
97
101
|
|
|
@@ -4,6 +4,10 @@ key: "authoring.server.reference"
|
|
|
4
4
|
title: "The server: serve and the implementation: reference"
|
|
5
5
|
description: "The API reference of The server: serve and the implementation: every export with its TSDoc and signature."
|
|
6
6
|
summary: "Signatures and options for the server: serve and the implementation."
|
|
7
|
+
question: "What are the exact signatures and options in the API of the server: serve and the implementation?"
|
|
8
|
+
when: "When writing code for the server: serve and the implementation and an exact signature, field or option is needed."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
7
11
|
parent: "fs/authoring.server"
|
|
8
12
|
suggest: "none"
|
|
9
13
|
tags: ["authoring", "reference"]
|
|
@@ -22,7 +26,7 @@ against the contract and this process's instance here (a mismatch throws `Packag
|
|
|
22
26
|
connects). A static fn with no example is refused too (`MissingExamplesError`, from the host), so every fn has one.
|
|
23
27
|
|
|
24
28
|
```ts
|
|
25
|
-
function serve<N extends string, C extends ContractShape>(contract: SystemContract<N, C>, impl: SystemImpl<C>, options: ServeOptions, host?: SystemHost): Promise<RunningSystem<N>>;
|
|
29
|
+
function serve<N extends string, C extends ContractShape, Db extends StoreDb = StoreDb>(contract: SystemContract<N, C>, impl: SystemImpl<C, Db>, options: ServeOptions, host?: SystemHost): Promise<RunningSystem<N>>;
|
|
26
30
|
```
|
|
27
31
|
|
|
28
32
|
#### `ServeOptions`
|
|
@@ -64,9 +68,15 @@ interface ServeOptions {
|
|
|
64
68
|
/**
|
|
65
69
|
* The system's context folder (markdown files with YAML headers, `context-files.ts`), sent as its context; `false`
|
|
66
70
|
* for none. Default: `context/` beside its `system.json`, when there is one. A folder with problems stops the start;
|
|
67
|
-
* with `
|
|
71
|
+
* with `FNLOOM_CONTEXT_WATCH` its changes go to the hub live.
|
|
68
72
|
*/
|
|
69
73
|
context?: string | false;
|
|
74
|
+
/**
|
|
75
|
+
* For a contract that declares a store (`store()`): its migrations, in order (`[migration('001-notes', ...)]`). The
|
|
76
|
+
* store opens where the hub says, its pending migrations run, and only then does the system take calls and run
|
|
77
|
+
* `started`. Required with a store, refused without one.
|
|
78
|
+
*/
|
|
79
|
+
store?: StoreServeOptions;
|
|
70
80
|
}
|
|
71
81
|
```
|
|
72
82
|
|
|
@@ -76,7 +86,7 @@ Refers to: [`Duration`](context:fs/authoring.core-types.primitives-ts#core-durat
|
|
|
76
86
|
|
|
77
87
|
type · `import { McpServe } from '@harness/sdk/server'`
|
|
78
88
|
|
|
79
|
-
Where the MCP face listens: stdin/stdout, or MCP Streamable HTTP on a port (any path; body limit `
|
|
89
|
+
Where the MCP face listens: stdin/stdout, or MCP Streamable HTTP on a port (any path; body limit `FNLOOM_MCP_MAX_BODY`).
|
|
80
90
|
|
|
81
91
|
```ts
|
|
82
92
|
type McpServe = { stdio: true } | { http: { port: number; host?: string } };
|
|
@@ -153,7 +163,7 @@ const, type · `import { RunningStatus } from '@harness/sdk/server'`
|
|
|
153
163
|
Where a running system is (`RunningSystem.status`).
|
|
154
164
|
|
|
155
165
|
```ts
|
|
156
|
-
type RunningStatus = "pairing" | "needs-config" | "connected" | "disconnected" | "
|
|
166
|
+
type RunningStatus = "pairing" | "stopped" | "needs-config" | "connected" | "disconnected" | "connecting";
|
|
157
167
|
```
|
|
158
168
|
|
|
159
169
|
#### `SystemImpl`
|
|
@@ -162,26 +172,26 @@ type · `import { SystemImpl } from '@harness/sdk'`
|
|
|
162
172
|
|
|
163
173
|
A system's implementation, computed from its contract. It must implement exactly what the contract declares: every
|
|
164
174
|
native fn, every method of its types, every kind, every dynamic context, hook, mention provider,
|
|
165
|
-
sectioner, action and model provider.
|
|
175
|
+
sectioner, action and model provider. `Db` is its store's tables, for a contract that declares a store (`ctx.store`).
|
|
166
176
|
|
|
167
177
|
```ts
|
|
168
|
-
type SystemImpl<C extends ContractShape> =
|
|
169
|
-
Needs<'fns', { readonly [K in NativeFnKeys<C['fns']>]: FnImpl<TypesOf<C['fns'][K]>, ConfigOf<C>, OwnOf<C>> }> &
|
|
170
|
-
Needs<'kinds', { readonly [K in keyof C['kinds']]: C['kinds'][K] extends KindDef<infer P> ? KindImpl<P, ConfigOf<C>, OwnOf<C>> : never }> &
|
|
171
|
-
Needs<'context', { readonly [K in DynamicContextKeys<C['context']>]: C['context'][K] extends ContextDef<infer A, true> ? ContextImpl<A, ConfigOf<C>, OwnOf<C>> : never }> &
|
|
172
|
-
Needs<'hooks', { readonly [K in keyof C['hooks']]: HookImpl<ConfigOf<C>, OwnOf<C>> }> &
|
|
173
|
-
Needs<'mentions', { readonly [K in keyof C['mentions']]: C['mentions'][K] extends MentionDef<infer T, infer V> ? MentionImpl<T, V, ConfigOf<C>, OwnOf<C>> : never }> &
|
|
174
|
-
Needs<'types', { readonly [K in TypesWithMethods<C['types']>]: C['types'][K] extends TypeDef<infer V, infer M extends Methods> ? { readonly [J in keyof M]: MethodImpl<V, TypesOf<M[J]>, ConfigOf<C>, OwnOf<C>> } : never }> &
|
|
178
|
+
type SystemImpl<C extends ContractShape, Db extends StoreDb = StoreDb> =
|
|
179
|
+
Needs<'fns', { readonly [K in NativeFnKeys<C['fns']>]: FnImpl<TypesOf<C['fns'][K]>, ConfigOf<C>, OwnOf<C, Db>> }> &
|
|
180
|
+
Needs<'kinds', { readonly [K in keyof C['kinds']]: C['kinds'][K] extends KindDef<infer P> ? KindImpl<P, ConfigOf<C>, OwnOf<C, Db>> : never }> &
|
|
181
|
+
Needs<'context', { readonly [K in DynamicContextKeys<C['context']>]: C['context'][K] extends ContextDef<infer A, true> ? ContextImpl<A, ConfigOf<C>, OwnOf<C, Db>> : never }> &
|
|
182
|
+
Needs<'hooks', { readonly [K in keyof C['hooks']]: HookImpl<ConfigOf<C>, OwnOf<C, Db>> }> &
|
|
183
|
+
Needs<'mentions', { readonly [K in keyof C['mentions']]: C['mentions'][K] extends MentionDef<infer T, infer V> ? MentionImpl<T, V, ConfigOf<C>, OwnOf<C, Db>> : never }> &
|
|
184
|
+
Needs<'types', { readonly [K in TypesWithMethods<C['types']>]: C['types'][K] extends TypeDef<infer V, infer M extends Methods> ? { readonly [J in keyof M]: MethodImpl<V, TypesOf<M[J]>, ConfigOf<C>, OwnOf<C, Db>> } : never }> &
|
|
175
185
|
Needs<'sectioners', { readonly [K in keyof C['sectioners']]: SectionerImpl }> &
|
|
176
|
-
Needs<'actions', { readonly [K in keyof C['actions']]: C['actions'][K] extends ActionDef<infer I, infer R, infer St> ? ActionImpl<I, R, St, ConfigOf<C>, OwnOf<C>> : never }> &
|
|
177
|
-
Needs<'providers', { readonly [K in keyof C['providers']]: ProviderImpl<ConfigOf<C>, OwnOf<C>> }> &
|
|
178
|
-
(C['connect'] extends ConnectDecl ? { readonly connect: ConnectImpl<ConfigOf<C>, OwnOf<C>> } : { readonly connect?: never }) &
|
|
186
|
+
Needs<'actions', { readonly [K in keyof C['actions']]: C['actions'][K] extends ActionDef<infer I, infer R, infer St> ? ActionImpl<I, R, St, ConfigOf<C>, OwnOf<C, Db>> : never }> &
|
|
187
|
+
Needs<'providers', { readonly [K in keyof C['providers']]: ProviderImpl<ConfigOf<C>, OwnOf<C, Db>> }> &
|
|
188
|
+
(C['connect'] extends ConnectDecl ? { readonly connect: ConnectImpl<ConfigOf<C>, OwnOf<C, Db>> } : { readonly connect?: never }) &
|
|
179
189
|
{
|
|
180
190
|
/** Resources this system serves. */
|
|
181
191
|
readonly resources?: ResourceProvider;
|
|
182
192
|
/** Hub events to receive. */
|
|
183
|
-
readonly events?: EventHandlers<ConfigOf<C>, OwnOf<C>>;
|
|
184
|
-
readonly lifecycle?: Lifecycle<ConfigOf<C>, OwnOf<C>>;
|
|
193
|
+
readonly events?: EventHandlers<ConfigOf<C>, OwnOf<C, Db>>;
|
|
194
|
+
readonly lifecycle?: Lifecycle<ConfigOf<C>, OwnOf<C, Db>>;
|
|
185
195
|
};
|
|
186
196
|
```
|
|
187
197
|
|
|
@@ -200,7 +210,7 @@ that clash run one after another. `check` exactly when it declares `check`: what
|
|
|
200
210
|
their type, asked by the hub before the policies and any approval.
|
|
201
211
|
|
|
202
212
|
```ts
|
|
203
|
-
type FnImpl<T extends FnTypes, Cfg = unknown, O extends
|
|
213
|
+
type FnImpl<T extends FnTypes, Cfg = unknown, O extends AnyOwn = Own> =
|
|
204
214
|
{
|
|
205
215
|
run(args: T['args'], ctx: FnCtx<T, Cfg, O>): Promise<Outcome<T>>;
|
|
206
216
|
preview?(args: T['args'], ctx: PreviewCtx<Cfg, O>): Promise<PreviewAnswer>;
|
|
@@ -208,7 +218,7 @@ type FnImpl<T extends FnTypes, Cfg = unknown, O extends Own = Own> =
|
|
|
208
218
|
claims?(args: T['args'], ctx: ClaimsCtx<Cfg, O>): ToolClaims | Promise<ToolClaims>;
|
|
209
219
|
} &
|
|
210
220
|
CheckImpl<T, Cfg> &
|
|
211
|
-
([T['undo']] extends [never] ? { undo?: never } : { undo(payload: T['undo'], ctx: UndoCtx<Cfg>): Promise<UndoOutcome> });
|
|
221
|
+
([T['undo']] extends [never] ? { undo?: never } : { undo(payload: T['undo'], ctx: UndoCtx<Cfg, O['store']>): Promise<UndoOutcome> });
|
|
212
222
|
```
|
|
213
223
|
|
|
214
224
|
Refers to: [`PreviewAnswer`](context:fs/authoring.core-types.lifecycle-ts#core-previewanswer), [`SensitivityFlag`](context:fs/authoring.core-types.sensitivity-ts#core-sensitivityflag), [`UndoOutcome`](context:fs/authoring.core-types.run-ts#core-undooutcome).
|
|
@@ -223,7 +233,7 @@ query, or the form) into the account and credentials, or a problem in words; `di
|
|
|
223
233
|
where the provider can (best effort).
|
|
224
234
|
|
|
225
235
|
```ts
|
|
226
|
-
interface ConnectImpl<Cfg, O extends
|
|
236
|
+
interface ConnectImpl<Cfg, O extends AnyOwn = Own> {
|
|
227
237
|
start(request: ConnectStart, ctx: SystemCtx<Cfg, O>): Promise<{ url: string }> | { url: string };
|
|
228
238
|
finish(request: ConnectFinish, ctx: SystemCtx<Cfg, O>): Promise<ConnectResult>;
|
|
229
239
|
disconnect(connection: Pick<RunConnection, 'id' | 'owner' | 'credentials'>, ctx: SystemCtx<Cfg, O>): Promise<void>;
|
|
@@ -267,7 +277,7 @@ The link fields of a system's env slice, for spreading into it, followed by its
|
|
|
267
277
|
machine's default port, the instance to `main`.
|
|
268
278
|
|
|
269
279
|
```ts
|
|
270
|
-
function systemFields(): { readonly
|
|
280
|
+
function systemFields(): { readonly FNLOOM_SYSTEM_DATA: z.ZodOptional<z.ZodString>; readonly FNLOOM_SYSTEM_CACHE: z.ZodOptional<z.ZodString>; readonly FNLOOM_HUB: z.ZodDefault<z.ZodString>; readonly FNLOOM_INSTANCE: z.ZodDefault<z.core.$ZodBranded<z.ZodString, "InstanceName", "out">>; readonly FNLOOM_PAIRING_TOKEN: z.ZodOptional<z.ZodString>; };
|
|
271
281
|
```
|
|
272
282
|
|
|
273
283
|
#### `systemState`
|
|
@@ -279,7 +289,7 @@ A system's state folder, where it keeps its key pair, outcome journal and anythi
|
|
|
279
289
|
hand on one machine never share a key pair. A group of its own because it reads the instance (`systemFields`).
|
|
280
290
|
|
|
281
291
|
```ts
|
|
282
|
-
function systemState(name: string): { readonly
|
|
292
|
+
function systemState(name: string): { readonly FNLOOM_SYSTEM_STATE: (e: { readonly [SYSTEM_ENV.instance]: InstanceName; }) => z.ZodDefault<z.ZodString>; };
|
|
283
293
|
```
|
|
284
294
|
|
|
285
295
|
#### `defaultStateFolder`
|
|
@@ -304,18 +314,23 @@ so the names can't drift.
|
|
|
304
314
|
|
|
305
315
|
```ts
|
|
306
316
|
const SYSTEM_ENV = {
|
|
307
|
-
hub: '
|
|
308
|
-
state: '
|
|
317
|
+
hub: 'FNLOOM_HUB',
|
|
318
|
+
state: 'FNLOOM_SYSTEM_STATE',
|
|
309
319
|
/** Which copy of the system this process is (`main` when unset); a fleet's instances each have their own. */
|
|
310
|
-
instance: '
|
|
320
|
+
instance: 'FNLOOM_INSTANCE',
|
|
311
321
|
/** The instance's own data folder, outside the package, kept across upgrades and exported with its data. */
|
|
312
|
-
data: '
|
|
322
|
+
data: 'FNLOOM_SYSTEM_DATA',
|
|
313
323
|
/** The instance's cache folder: rebuildable, never exported. */
|
|
314
|
-
cache: '
|
|
315
|
-
name: '
|
|
316
|
-
pairingToken: '
|
|
317
|
-
supervised: '
|
|
318
|
-
restartCode: '
|
|
324
|
+
cache: 'FNLOOM_SYSTEM_CACHE',
|
|
325
|
+
name: 'FNLOOM_SYSTEM_NAME',
|
|
326
|
+
pairingToken: 'FNLOOM_PAIRING_TOKEN',
|
|
327
|
+
supervised: 'FNLOOM_SUPERVISED',
|
|
328
|
+
restartCode: 'FNLOOM_RESTART_CODE',
|
|
329
|
+
/**
|
|
330
|
+
* The hub's folder of database drivers (`pg`, `tedious`, `tarn`), which it installs when a store is placed in
|
|
331
|
+
* Postgres or SQL Server: a store that opens there loads them from it when the system has none of its own.
|
|
332
|
+
*/
|
|
333
|
+
storeDrivers: 'FNLOOM_STORE_DRIVERS',
|
|
319
334
|
} as const;
|
|
320
335
|
```
|
|
321
336
|
|
|
@@ -369,7 +384,7 @@ Runs systems. `LinkHost` is the real one; tests pass their own.
|
|
|
369
384
|
|
|
370
385
|
```ts
|
|
371
386
|
interface SystemHost {
|
|
372
|
-
start<N extends string, C extends ContractShape>(contract: SystemContract<N, C>, impl: SystemImpl<C>, options: ServeOptions): Promise<RunningSystem<N>>;
|
|
387
|
+
start<N extends string, C extends ContractShape, Db extends StoreDb = StoreDb>(contract: SystemContract<N, C>, impl: SystemImpl<C, Db>, options: ServeOptions): Promise<RunningSystem<N>>;
|
|
373
388
|
}
|
|
374
389
|
```
|
|
375
390
|
|
|
@@ -382,7 +397,7 @@ Runs systems over the WebSocket link.
|
|
|
382
397
|
```ts
|
|
383
398
|
class LinkHost implements SystemHost {
|
|
384
399
|
constructor(deps: LinkHostDeps = {});
|
|
385
|
-
start<N extends string, C extends ContractShape>(contract: SystemContract<N, C>, impl: SystemImpl<C>, options: ServeOptions): Promise<RunningSystem<N>>;
|
|
400
|
+
start<N extends string, C extends ContractShape, Db extends StoreDb = StoreDb>(contract: SystemContract<N, C>, impl: SystemImpl<C, Db>, options: ServeOptions): Promise<RunningSystem<N>>;
|
|
386
401
|
}
|
|
387
402
|
```
|
|
388
403
|
|
|
@@ -408,12 +423,18 @@ interface LinkHostDeps {
|
|
|
408
423
|
readonly env?: SdkEnv;
|
|
409
424
|
/** The process logger. Default: console, plus the hub while connected. */
|
|
410
425
|
readonly logger?: (sink: (line: LogLine) => void) => Logger;
|
|
411
|
-
/** Shows a pending pairing. Default: a QR code on a terminal (`
|
|
426
|
+
/** Shows a pending pairing. Default: a QR code on a terminal (`FNLOOM_PAIRING_QR`), else a log line. */
|
|
412
427
|
readonly pairing?: PairingDisplay;
|
|
413
428
|
/** Makes the instance's data and cache folders before the system starts. Default: `mkdir -p` each. */
|
|
414
429
|
readonly folders?: (dirs: readonly string[]) => Promise<void>;
|
|
415
430
|
/** Refuse a contract with a static fn that has no example (`checkExamples`). Default true; a test hub's fixtures may skip it. */
|
|
416
431
|
readonly requireExamples?: boolean;
|
|
432
|
+
/**
|
|
433
|
+
* Opens the store with the system (the `system` placement): a test's store in memory (`openMemoryStore`) or in a
|
|
434
|
+
* folder of its own (`localStoreConnect(dir)`). Default: SQLite in `<data>/store/store.db`. A store on the hub or in
|
|
435
|
+
* an external database always opens on the real engines, so a move between placements works the same in a test.
|
|
436
|
+
*/
|
|
437
|
+
readonly storeConnect?: () => Promise<StoreConnection>;
|
|
417
438
|
}
|
|
418
439
|
```
|
|
419
440
|
|
|
@@ -4,6 +4,10 @@ key: "authoring.settings-attachments"
|
|
|
4
4
|
title: "Settings and attachments"
|
|
5
5
|
description: "Writing a harness system: Settings and attachments."
|
|
6
6
|
summary: "Settings people set, and attachments a run adds."
|
|
7
|
+
question: "How do a system's settings and a run's attachments work?"
|
|
8
|
+
when: "When a system has a setting people set, or a run attaches data for renderers and later fns."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
7
11
|
parent: "fs/authoring.topics.declare"
|
|
8
12
|
next: "fs/authoring.context"
|
|
9
13
|
fns: ["fs/read", "fs/write", "fs/edit", "fs/bash"]
|
|
@@ -16,7 +20,7 @@ choices:
|
|
|
16
20
|
when: "Pick this to go on in order: Context and commands."
|
|
17
21
|
---
|
|
18
22
|
|
|
19
|
-
##
|
|
23
|
+
## 13. Settings and attachments
|
|
20
24
|
|
|
21
25
|
### Settings
|
|
22
26
|
|