fnloom 0.2.0 → 0.3.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 +102 -5
- package/package.json +12 -11
- package/packages/build/package.json +2 -2
- package/packages/cli/package.json +1 -1
- package/packages/cli/src/cli.ts +2 -1
- package/packages/cli/src/command.ts +2 -0
- package/packages/cli/src/commands/install.ts +103 -7
- package/packages/cli/src/commands/manage.ts +7 -5
- package/packages/cli/src/commands/store.ts +172 -0
- package/packages/cli/src/hub.ts +26 -7
- package/packages/cli/src/io.ts +1 -0
- package/packages/cli/src/testing.ts +2 -1
- package/packages/core/package.json +4 -4
- package/packages/core/src/context-files.ts +3 -1
- package/packages/core/src/context-graph.ts +4 -0
- package/packages/core/src/context-plan.ts +451 -0
- package/packages/core/src/context-questions.ts +305 -0
- package/packages/core/src/fn-facts.ts +32 -4
- package/packages/core/src/identity.ts +1 -1
- package/packages/core/src/index.ts +4 -1
- package/packages/core/src/link.ts +70 -0
- package/packages/core/src/manifest.ts +20 -1
- package/packages/core/src/model-calls.ts +11 -2
- package/packages/core/src/package.ts +10 -0
- package/packages/core/src/query.ts +3 -2
- package/packages/core/src/records/content.ts +10 -2
- package/packages/core/src/records/runs.ts +12 -0
- package/packages/core/src/records/systems.ts +87 -5
- package/packages/core/src/run.ts +5 -0
- package/packages/core/src/stores.ts +473 -0
- package/packages/core/src/suggestions.ts +3 -0
- package/packages/core/src/system-pages.ts +14 -1
- package/packages/core/src/web.ts +114 -9
- package/packages/hub/package.json +13 -12
- package/packages/hub/src/access/hits.ts +1 -1
- package/packages/hub/src/api/admin-ops.ts +36 -4
- package/packages/hub/src/api/auth.ts +8 -4
- package/packages/hub/src/api/person-ops.ts +6 -0
- package/packages/hub/src/api/store-ops.ts +54 -0
- package/packages/hub/src/api/testing/rig.ts +2 -2
- package/packages/hub/src/api/tls.ts +2 -2
- 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/index.ts +4 -0
- package/packages/hub/src/api/web/pages.ts +14 -1
- 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 +6 -1
- package/packages/hub/src/boot/hub-fns.ts +3 -3
- package/packages/hub/src/boot/hub-groups.ts +2 -2
- package/packages/hub/src/boot/identity.ts +1 -1
- package/packages/hub/src/boot/index.ts +9 -0
- package/packages/hub/src/boot/modules.ts +12 -3
- 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/start.ts +2 -1
- package/packages/hub/src/catalog/catalog.ts +44 -14
- package/packages/hub/src/catalog/index.ts +6 -2
- package/packages/hub/src/chat/testing.ts +2 -2
- package/packages/hub/src/contextor/brought.ts +5 -3
- package/packages/hub/src/contextor/testing.ts +4 -4
- package/packages/hub/src/execution/create.ts +2 -0
- package/packages/hub/src/execution/env.ts +2 -0
- package/packages/hub/src/execution/errors.ts +12 -0
- package/packages/hub/src/execution/executors.ts +14 -2
- package/packages/hub/src/execution/index.ts +8 -0
- package/packages/hub/src/execution/link-handlers.ts +16 -4
- package/packages/hub/src/execution/runs.ts +212 -11
- package/packages/hub/src/execution/testing.ts +2 -1
- package/packages/hub/src/fns/search.ts +23 -4
- package/packages/hub/src/graph/graph.ts +2 -2
- package/packages/hub/src/index/index.ts +9 -2
- package/packages/hub/src/index/indexer.ts +67 -16
- package/packages/hub/src/index/search.ts +1 -0
- package/packages/hub/src/index/suggester.ts +2 -2
- package/packages/hub/src/link/build.ts +47 -10
- 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 +10 -0
- 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 +11 -4
- package/packages/hub/src/link/packages.ts +17 -4
- package/packages/hub/src/link/pairing.ts +2 -2
- package/packages/hub/src/link/process.ts +10 -4
- package/packages/hub/src/link/rig.ts +6 -2
- 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/models/roles.ts +74 -7
- package/packages/hub/src/query/columns.ts +4 -1
- package/packages/hub/src/query/contexts.ts +10 -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 +58 -20
- package/packages/hub/src/resources/create.ts +16 -4
- package/packages/hub/src/resources/env.ts +4 -0
- package/packages/hub/src/resources/fns.ts +6 -2
- package/packages/hub/src/resources/index.ts +8 -2
- package/packages/hub/src/resources/testing.ts +18 -2
- 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/hybrid.ts +33 -6
- 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 +2 -1
- 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/sdk/AUTHORING.md +1813 -218
- package/packages/sdk/package.json +12 -8
- package/packages/sdk/src/build.ts +3 -0
- package/packages/sdk/src/client.ts +22 -0
- package/packages/sdk/src/ctx.ts +51 -17
- package/packages/sdk/src/declare.ts +36 -12
- package/packages/sdk/src/hub.ts +222 -10
- package/packages/sdk/src/impl.ts +3 -3
- package/packages/sdk/src/index.ts +6 -3
- package/packages/sdk/src/manifest.ts +5 -0
- package/packages/sdk/src/providers.ts +2 -2
- package/packages/sdk/src/server/asks.ts +12 -1
- package/packages/sdk/src/server/env.ts +13 -1
- package/packages/sdk/src/server/host.ts +81 -10
- package/packages/sdk/src/server/index.ts +21 -2
- package/packages/sdk/src/server/package.ts +11 -2
- package/packages/sdk/src/server/run.ts +6 -1
- package/packages/sdk/src/server/runtime.ts +78 -22
- 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/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/hub.ts +18 -5
- package/packages/web/dist/assets/{ActorSettingsView-BuMYRDqv.js → ActorSettingsView-v2k7v454.js} +2 -2
- package/packages/web/dist/assets/{AdminLayout-sLjVTrmV.js → AdminLayout-B6Jrc_4W.js} +2 -2
- package/packages/web/dist/assets/{ApiServiceForm-BrMTU-7u.js → ApiServiceForm-CuuQgOJc.js} +2 -2
- package/packages/web/dist/assets/{ApiServiceView-BMF2zD6Q.js → ApiServiceView-7bTHSO_Z.js} +2 -2
- package/packages/web/dist/assets/{ApiServicesView-bjLAWO_j.js → ApiServicesView-BXi24n49.js} +2 -2
- package/packages/web/dist/assets/{AppPage-DSzDKCFz.js → AppPage-CFmKZS8G.js} +2 -2
- package/packages/web/dist/assets/{AutoPairPicker-nV38ALjl.js → AutoPairPicker-C61gihmh.js} +2 -2
- package/packages/web/dist/assets/{BrowserFrame-Bic7U7jN.js → BrowserFrame-Sq9EmQRT.js} +2 -2
- package/packages/web/dist/assets/{ChartVisual-DWw7WsfN.js → ChartVisual-C4mgw4wh.js} +4 -4
- package/packages/web/dist/assets/ChatPage-CAhHE03Z.js +4 -0
- package/packages/web/dist/assets/{CodeViewer-xHS3Xah9.js → CodeViewer-tUNXZB77.js} +2 -2
- package/packages/web/dist/assets/{ConfigWithCustom-DreTUdf0.js → ConfigWithCustom-D_-rY66L.js} +3 -3
- package/packages/web/dist/assets/{ConfirmDialog-DjQUzNqk.js → ConfirmDialog-Dd3E4sJt.js} +2 -2
- package/packages/web/dist/assets/{ConnectPage-CfRDrXvJ.js → ConnectPage-CX9acyQH.js} +2 -2
- package/packages/web/dist/assets/ContextItemPage-Cv4G0k_o.css +1 -0
- package/packages/web/dist/assets/ContextItemPage-rUI3-T_L.js +2 -0
- package/packages/web/dist/assets/ContextPage-C8u0UnYl.css +1 -0
- package/packages/web/dist/assets/ContextPage-CtefzyKg.js +3 -0
- package/packages/web/dist/assets/ContextRow-Chx99Xac.css +1 -0
- package/packages/web/dist/assets/ContextRow-DrtPumZ5.js +2 -0
- package/packages/web/dist/assets/{DataPage-wSIoGcb5.js → DataPage-DDSsxHro.js} +2 -2
- package/packages/web/dist/assets/DataTypePage-BW9fWaz8.js +2 -0
- package/packages/web/dist/assets/{DesignPage-DidMUX8m.js → DesignPage-6e0XbOFC.js} +2 -2
- package/packages/web/dist/assets/{ExplorePage-MUyVydVB.js → ExplorePage-B7ND0W0l.js} +2 -2
- package/packages/web/dist/assets/{FnList-CjQRwYaT.js → FnList-Bx6H-kux.js} +2 -2
- package/packages/web/dist/assets/{FnPill-BshAvm2I.js → FnPill-Cp3KuLmP.js} +2 -2
- package/packages/web/dist/assets/FnView-C0XZdnsS.js +2 -0
- package/packages/web/dist/assets/{FnsView-CeqIoaBT.js → FnsView-GTH3p7a0.js} +2 -2
- package/packages/web/dist/assets/{GinExprView-DYVUwZrd.js → GinExprView-DGxns6lH.js} +2 -2
- package/packages/web/dist/assets/{GinForm-D3mwMRTQ.js → GinForm-BDBUzuDP.js} +2 -2
- package/packages/web/dist/assets/{GinTypeView-C0YifSmE.js → GinTypeView-CUsymbVf.js} +2 -2
- package/packages/web/dist/assets/{GinValueView-HfEPq9le.js → GinValueView-jsKIfiEA.js} +2 -2
- package/packages/web/dist/assets/{GraphPage-ySnuA4Hp.js → GraphPage-BCcPPsHu.js} +2 -2
- package/packages/web/dist/assets/{GraphPanel-Cy5-KGo1.js → GraphPanel-9tztGHmu.js} +2 -2
- package/packages/web/dist/assets/{HubPicker-C_vA752L.js → HubPicker-EoOErgmk.js} +2 -2
- package/packages/web/dist/assets/{InboxApprovals-DcPCCmZ5.js → InboxApprovals-Dkq7DFp_.js} +2 -2
- package/packages/web/dist/assets/{InboxPage-C2DT2nuF.js → InboxPage-CHhslePq.js} +2 -2
- package/packages/web/dist/assets/{InjectedList-CJsEFEbz.js → InjectedList-CSWqRiON.js} +2 -2
- package/packages/web/dist/assets/InstallDialog-D-VwfZYF.js +2 -0
- package/packages/web/dist/assets/{InstallDialog-yWLZK_zN.css → InstallDialog-K-j0sdHm.css} +1 -1
- package/packages/web/dist/assets/InstanceTypes-CwVSAULg.css +1 -0
- package/packages/web/dist/assets/InstanceTypes-D3rAEiE7.js +2 -0
- package/packages/web/dist/assets/InstanceView-DoH8C-1j.js +2 -0
- package/packages/web/dist/assets/InstanceView-_9uE70tS.css +1 -0
- package/packages/web/dist/assets/{ItemHistory-CUGa8b6s.js → ItemHistory-NQAP69ma.js} +2 -2
- package/packages/web/dist/assets/LimitsView-DY2C9nYS.js +2 -0
- package/packages/web/dist/assets/ListSearch-BunVrDO0.js +2 -0
- package/packages/web/dist/assets/{LlmCallDetails-2yQftCqd.js → LlmCallDetails-BoVNDTVs.js} +2 -2
- package/packages/web/dist/assets/{LlmCallsView-DOHX3r0K.js → LlmCallsView-BGpV92RC.js} +2 -2
- package/packages/web/dist/assets/{LoadState-DeXfLvYv.js → LoadState-h-K9bTYc.js} +2 -2
- package/packages/web/dist/assets/{McpDialog-CA_0WKWF.js → McpDialog-DhOCk6_E.js} +2 -2
- package/packages/web/dist/assets/{McpServerForm-CAG8Wp2N.js → McpServerForm-Cor3fI7s.js} +2 -2
- package/packages/web/dist/assets/McpServerView-ewXRPEmZ.js +2 -0
- package/packages/web/dist/assets/McpServersView-Dd0xmfws.js +2 -0
- package/packages/web/dist/assets/{McpView-CC2oNOMa.js → McpView-GPXdCMne.js} +2 -2
- package/packages/web/dist/assets/{McpsView-CwJvyyxV.js → McpsView-DJIR2JX5.js} +2 -2
- package/packages/web/dist/assets/{MemoryDialog-Dbvh5uLq.js → MemoryDialog-BTeIHQyA.js} +2 -2
- package/packages/web/dist/assets/{ModelCallsView-RvnW3EBP.js → ModelCallsView-DMcnwF2S.js} +2 -2
- package/packages/web/dist/assets/{ModelPicker-DcjwQFHC.js → ModelPicker-CgkMFxSO.js} +2 -2
- package/packages/web/dist/assets/ModelsView-cMHygeiK.js +2 -0
- package/packages/web/dist/assets/{NotFoundPage-CeSwzTV-.js → NotFoundPage-Tk92K7HN.js} +2 -2
- package/packages/web/dist/assets/PairPage-D0BK8CCw.js +2 -0
- package/packages/web/dist/assets/PairPage-D_aPS1Ot.css +1 -0
- package/packages/web/dist/assets/{PanelHost-BkrFAnPa.js → PanelHost-C-gKrxAk.js} +2 -2
- package/packages/web/dist/assets/{PeopleView-D1QGPYp7.js → PeopleView-DRfeNWK5.js} +2 -2
- package/packages/web/dist/assets/PoliciesView-BRi-QAuo.js +2 -0
- package/packages/web/dist/assets/{RefusalList-DQoyUoPG.js → RefusalList-DVO0bmeB.js} +2 -2
- package/packages/web/dist/assets/{RemoteAuthFields-nxGWfmhf.js → RemoteAuthFields-CgiufuqQ.js} +2 -2
- package/packages/web/dist/assets/{ResourceViewer-Po24y4pj.js → ResourceViewer-Do0chYxU.js} +2 -2
- package/packages/web/dist/assets/ResourcesPage-BBx2u2mw.js +2 -0
- package/packages/web/dist/assets/{ResultGrid-uoq4yUYj.js → ResultGrid-Bj-0I5HY.js} +2 -2
- package/packages/web/dist/assets/{ReviewSummaryStrip-k3HevESg.js → ReviewSummaryStrip-DO3p64Qj.js} +2 -2
- package/packages/web/dist/assets/ReviewView-DZF9E1hb.js +3 -0
- package/packages/web/dist/assets/{RuleRow-CoXDA-SH.js → RuleRow-DX9v4iGP.js} +2 -2
- package/packages/web/dist/assets/{RunCard-CBSGdwdQ.js → RunCard-BnrtK2Yp.js} +2 -2
- package/packages/web/dist/assets/{RunDetails-CGhQQ6OI.js → RunDetails-DjR206q6.js} +2 -2
- package/packages/web/dist/assets/{RunDot-Ch_45985.js → RunDot-lHRICdM5.js} +2 -2
- package/packages/web/dist/assets/{RunPage-C_t20pB7.js → RunPage-CbAQ_WPR.js} +2 -2
- package/packages/web/dist/assets/{RunProgress-VrZUHUEC.js → RunProgress-C3-B4tQf.js} +2 -2
- package/packages/web/dist/assets/RunsView-DMkPmkqX.js +2 -0
- package/packages/web/dist/assets/ServiceRows-4WythFpF.js +2 -0
- package/packages/web/dist/assets/{ServiceRows-6BU4-MeL.css → ServiceRows-HPQ0pN6b.css} +1 -1
- package/packages/web/dist/assets/SettingsPage-BN4oSzoL.js +3 -0
- package/packages/web/dist/assets/{SignInPage-DrXZ1sG2.js → SignInPage-ByqGEZfj.js} +2 -2
- package/packages/web/dist/assets/{StatusBadge-Dpb9uG5e.js → StatusBadge-CXne0sRZ.js} +2 -2
- package/packages/web/dist/assets/StorePlacementStep-B6SwTmdM.js +2 -0
- package/packages/web/dist/assets/StorePlacementStep-D_G4e3ue.css +1 -0
- package/packages/web/dist/assets/{SystemConfig-72qKRkUk.js → SystemConfig-vQDL_eUl.js} +2 -2
- package/packages/web/dist/assets/{SystemPageHost-DLNg2FYK.js → SystemPageHost-DrMrEPyh.js} +2 -2
- package/packages/web/dist/assets/SystemView-Be6TBM4j.js +2 -0
- package/packages/web/dist/assets/{SystemView-C8ScHUe2.css → SystemView-_9q6eDfV.css} +1 -1
- package/packages/web/dist/assets/{SystemsView-B6HEL9VS.css → SystemsView-CWKnupLW.css} +1 -1
- package/packages/web/dist/assets/SystemsView-DZtT3laz.js +2 -0
- package/packages/web/dist/assets/{TableViewer-BQ7bYLOP.js → TableViewer-Boxx86f5.js} +3 -3
- package/packages/web/dist/assets/{ThemePicker-C2nJ21Vd.js → ThemePicker-CIg_oRQX.js} +2 -2
- package/packages/web/dist/assets/{TurnTree-CORdfTHj.js → TurnTree-Ecm0yA5g.js} +2 -2
- package/packages/web/dist/assets/UserMessage-BlnqZDVU.js +9 -0
- package/packages/web/dist/assets/{ValueVisual-aXEUaQ5Y.js → ValueVisual-C-MWpp7c.js} +2 -2
- package/packages/web/dist/assets/WidgetView-DX4ejNb6.js +3 -0
- package/packages/web/dist/assets/actor-names-OdvpVZeb.js +4 -0
- package/packages/web/dist/assets/{fn-modal-DqcxUhOQ.js → fn-modal-B98MR7JN.js} +2 -2
- package/packages/web/dist/assets/{fn-notices-BYaH6IoA.js → fn-notices-CfTa1E8y.js} +2 -2
- package/packages/web/dist/assets/{formats-DI__ADVG.js → formats-JwoKfXIq.js} +2 -2
- package/packages/web/dist/assets/index-6ScWTFy2.js +4 -0
- package/packages/web/dist/assets/{index-CSisx5mi.css → index-CEslGcrX.css} +1 -1
- package/packages/web/dist/assets/{labels-BhJpmLWA.js → labels-BFbk11BE.js} +2 -2
- package/packages/web/dist/assets/{layout-DQKldU13.js → layout-D1gf481r.js} +2 -2
- package/packages/web/dist/assets/{metrics-Cio5ykX6.js → metrics-CBPX3W5Y.js} +2 -2
- package/packages/web/dist/assets/{problems-BZY0Dwif.js → problems-t1E_ovSz.js} +2 -2
- package/packages/web/dist/assets/{push-payload-D5efGCzd.js → push-payload-BeU1ADYt.js} +64 -64
- package/packages/web/dist/assets/{record-edits-CveFEsal.js → record-edits-Bfsi4lU3.js} +2 -2
- package/packages/web/dist/assets/{remote-config-BkaarDf3.js → remote-config-BNQhSDzB.js} +2 -2
- package/packages/web/dist/assets/{review-CGUGvRV9.js → review-fP-l9D6H.js} +3 -3
- package/packages/web/dist/assets/routes-DV4IJpwe.js +4 -0
- package/packages/web/dist/assets/runs-CveC2kKo.js +2 -0
- package/packages/web/dist/assets/{shared-DTpYDMc_.js → shared-LbaIHjbV.js} +2 -2
- package/packages/web/dist/assets/{size-BwnshyOe.js → size-Bh__w5aI.js} +2 -2
- package/packages/web/dist/assets/{sources-Bm-TrxhL.js → sources-VPrtgLIi.js} +2 -2
- package/packages/web/dist/assets/src-CT3TeFaM.js +43 -0
- package/packages/web/dist/assets/state-xfQqaQPX.js +2 -0
- package/packages/web/dist/assets/{systems-DIp94AET.js → systems-BqE3WTSF.js} +2 -2
- package/packages/web/dist/assets/ui-BzgWquIU.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-DKGcECT1.js} +2 -2
- package/packages/web/dist/assets/{widget-host-BCf6Tlt5.js → widget-host-B87MTaTn.js} +2 -2
- package/packages/web/dist/assets/{widgets-CrbkovMT.js → widgets-BBCuSS6E.js} +2 -2
- package/packages/web/dist/index.html +44 -44
- package/packages/web/dist/sw.js +1 -1
- package/packages/web/package.json +2 -2
- package/premade/claude.zip +0 -0
- package/premade/database.zip +0 -0
- package/premade/web.zip +0 -0
- package/scripts/run-stack.ts +3 -2
- package/scripts/stack.ts +73 -16
- package/scripts/start.ts +11 -2
- package/systems/api/package.json +3 -3
- package/systems/code/package.json +3 -3
- package/systems/embedder/package.json +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 +97 -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 +9 -1
- package/systems/fs/context/authoring/parts/client.reference/client.md +4 -0
- package/systems/fs/context/authoring/parts/client.reference/resultview.md +56 -53
- package/systems/fs/context/authoring/parts/client.reference/{fnpillprops.md → textareaprops.md} +58 -4
- package/systems/fs/context/authoring/parts/client.reference.md +8 -4
- package/systems/fs/context/authoring/parts/context/questions.md +49 -0
- package/systems/fs/context/authoring/parts/context.md +23 -1
- package/systems/fs/context/authoring/parts/context.reference.md +27 -3
- package/systems/fs/context/authoring/parts/contract.md +10 -0
- 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 +5 -1
- 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 +4 -0
- package/systems/fs/context/authoring/parts/core-types/context-files-ts.md +8 -0
- package/systems/fs/context/authoring/parts/core-types/context-graph-ts.md +5 -1
- package/systems/fs/context/authoring/parts/core-types/context-questions-ts.md +26 -0
- package/systems/fs/context/authoring/parts/core-types/contextdecl.md +9 -1
- 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 +18 -5
- 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 +15 -2
- package/systems/fs/context/authoring/parts/core-types/manifestpatch.md +9 -1
- 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 +4 -0
- 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 +4 -0
- package/systems/fs/context/authoring/parts/core-types/registries-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/remote-auth-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/resources-ts.md +5 -1
- package/systems/fs/context/authoring/parts/core-types/run-ts.md +7 -0
- 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 +4 -0
- package/systems/fs/context/authoring/parts/core-types/system-providers-ts.md +4 -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 -0
- package/systems/fs/context/authoring/parts/core-types/widgets-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types.md +12 -2
- 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 +4 -0
- 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 +5 -1
- 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 +4 -0
- 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} +51 -56
- 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 +9 -0
- package/systems/fs/context/authoring/parts/internals/manifestof.md +4 -0
- package/systems/fs/context/authoring/parts/internals/permissionargs.md +4 -0
- 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 +5 -1
- package/systems/fs/context/authoring/parts/kinds-agents.reference/authoringsession.md +4 -0
- package/systems/fs/context/authoring/parts/kinds-agents.reference/kind.md +7 -3
- 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 +5 -1
- package/systems/fs/context/authoring/parts/outcomes.reference.md +4 -0
- 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 +10 -3
- 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 +5 -1
- package/systems/fs/context/authoring/parts/remote.reference.md +4 -0
- 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 +5 -1
- package/systems/fs/context/authoring/parts/server.reference.md +41 -20
- 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} +55 -48
- package/systems/fs/context/authoring/parts/testing.reference/fakehub.md +26 -45
- package/systems/fs/context/authoring/parts/testing.reference/{toolcall.md → kindprops.md} +111 -4
- package/systems/fs/context/authoring/parts/testing.reference/openmemorystore.md +105 -0
- package/systems/fs/context/authoring/parts/testing.reference.md +16 -9
- package/systems/fs/context/authoring/parts/widgets.md +5 -1
- package/systems/fs/context/authoring/parts/widgets.reference/hub-visuals.md +4 -0
- package/systems/fs/context/authoring/parts/widgets.reference/sourcecompatible.md +4 -0
- package/systems/fs/context/authoring/parts/widgets.reference.md +4 -0
- 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/impl.ts +66 -7
- package/systems/fs/server/main.ts +20 -4
- 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/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 +137 -10
- 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/input/package.json +3 -3
- package/systems/mcp/package.json +3 -3
- package/systems/mcp/server/oauth.ts +1 -1
- package/systems/ollama/package.json +3 -3
- 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 +3 -1
- 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/package.json +1 -1
- package/systems/widgets/package.json +3 -3
- package/packages/web/dist/assets/ChatPage-7Yebk7rl.js +0 -4
- 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/FnView-B8MGAOoB.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/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/PoliciesView-BU1fudNF.js +0 -2
- package/packages/web/dist/assets/ResourcesPage-YluNBqIv.js +0 -2
- package/packages/web/dist/assets/ReviewView-79Z5rU1v.js +0 -3
- package/packages/web/dist/assets/RunsView-Dz9Xsvu5.js +0 -2
- package/packages/web/dist/assets/ServiceRows-DNzDiutg.js +0 -2
- package/packages/web/dist/assets/SettingsPage-CykfuYj1.js +0 -3
- 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/UserMessage-qyc8dG5D.js +0 -9
- package/packages/web/dist/assets/WidgetView-BZyDyYRI.js +0 -3
- package/packages/web/dist/assets/index-Bv42jNvr.js +0 -4
- 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/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/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
|
@@ -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
|
|
@@ -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`
|
|
@@ -67,6 +71,12 @@ interface ServeOptions {
|
|
|
67
71
|
* with `HARNESS_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
|
|
|
@@ -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>;
|
|
@@ -316,6 +326,11 @@ const SYSTEM_ENV = {
|
|
|
316
326
|
pairingToken: 'HARNESS_PAIRING_TOKEN',
|
|
317
327
|
supervised: 'HARNESS_SUPERVISED',
|
|
318
328
|
restartCode: 'HARNESS_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: 'HARNESS_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
|
|
|
@@ -414,6 +429,12 @@ interface LinkHostDeps {
|
|
|
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
|
|
|
@@ -4,6 +4,10 @@ key: "authoring.settings-attachments.reference"
|
|
|
4
4
|
title: "Settings and attachments: reference"
|
|
5
5
|
description: "The API reference of Settings and attachments: every export with its TSDoc and signature."
|
|
6
6
|
summary: "Signatures and options for settings and attachments."
|
|
7
|
+
question: "What are the exact signatures and options in the API of settings and attachments?"
|
|
8
|
+
when: "When writing code for settings and attachments and an exact signature, field or option is needed."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
7
11
|
parent: "fs/authoring.settings-attachments"
|
|
8
12
|
suggest: "none"
|
|
9
13
|
tags: ["authoring", "reference"]
|
|
@@ -4,6 +4,10 @@ key: "authoring.start"
|
|
|
4
4
|
title: "Start here"
|
|
5
5
|
description: "Writing a harness system: Start here."
|
|
6
6
|
summary: "What a system is, and the steps to write one."
|
|
7
|
+
question: "What are the steps to write a harness system?"
|
|
8
|
+
when: "When about to write a harness system and needing the whole path once before the details."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
7
11
|
parent: "fs/authoring.topics.begin"
|
|
8
12
|
next: "fs/authoring.folder"
|
|
9
13
|
fns: ["fs/read", "fs/write", "fs/edit", "fs/bash"]
|
|
@@ -53,7 +57,7 @@ Four rules hold everywhere; the compiler enforces the first three:
|
|
|
53
57
|
records of a stored type (`type({ records })`), read and written with `ctx.data` and searched by the hub's database
|
|
54
58
|
([Stored types and the data system](context:fs/authoring.data)). Never keep it in a file or database of the system's own, and never load a
|
|
55
59
|
whole set to filter or search it in code: every read is a query with a page. A system's folder (`ctx.dataDir`) holds
|
|
56
|
-
only its own
|
|
60
|
+
only its own keys and caches, and working tables only its code reads go in a store of its own (`store()`).
|
|
57
61
|
|
|
58
62
|
The worked example throughout is the **notes** system (`scripts/docs/example`, shown whole in [Worked examples](context:fs/authoring.examples)): notes with
|
|
59
63
|
titles and tags, kept and searched by the hub as records of a stored type. Every code sample in this guide is a region of a file
|
|
@@ -4,6 +4,10 @@ key: "authoring.state-forms"
|
|
|
4
4
|
title: "Session state, forms and display"
|
|
5
5
|
description: "Writing a harness system: Session state, forms and display."
|
|
6
6
|
summary: "Session state, forms that ask the person, and how runs display."
|
|
7
|
+
question: "How does a fn keep session state or ask the person with a form?"
|
|
8
|
+
when: "When fns share values within a chat, a fn asks the person something with a form, or a run's display matters."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
7
11
|
parent: "fs/authoring.topics.fns"
|
|
8
12
|
next: "fs/authoring.outcomes"
|
|
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: Outcomes: done, invalid input, failed, paused, cancelled, undo."
|
|
17
21
|
---
|
|
18
22
|
|
|
19
|
-
##
|
|
23
|
+
## 10. Session state, forms and display
|
|
20
24
|
|
|
21
25
|
### Session state
|
|
22
26
|
|
|
@@ -4,6 +4,10 @@ key: "authoring.state-forms.reference"
|
|
|
4
4
|
title: "Session state, forms and display: reference"
|
|
5
5
|
description: "The API reference of Session state, forms and display: every export with its TSDoc and signature."
|
|
6
6
|
summary: "Signatures and options for session state, forms and display."
|
|
7
|
+
question: "What are the exact signatures and options in the API of session state, forms and display?"
|
|
8
|
+
when: "When writing code for session state, forms and display and an exact signature, field or option is needed."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
7
11
|
parent: "fs/authoring.state-forms"
|
|
8
12
|
suggest: "none"
|
|
9
13
|
tags: ["authoring", "reference"]
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
# Generated by scripts/docs/authoring.ts from the authoring guide (npm run docs:authoring); do not edit.
|
|
3
|
+
key: "authoring.store.ctx-store"
|
|
4
|
+
title: "How does a fn read and write its system's store?"
|
|
5
|
+
description: "Writing a harness system, A store of the system’s own: How does a fn read and write its system's store?"
|
|
6
|
+
summary: "ctx.store is Kysely over the tables plus vectors(name); transactions, and keeping ctx.store for the system's life."
|
|
7
|
+
question: "How does a fn read and write its system's store?"
|
|
8
|
+
when: "When a fn or a timer reads or writes a system's store with ctx.store, or uses a transaction."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
11
|
+
parent: "fs/authoring.store"
|
|
12
|
+
next: "fs/authoring.store.vectors"
|
|
13
|
+
fns: ["fs/read", "fs/write", "fs/edit", "fs/bash"]
|
|
14
|
+
tags: ["authoring"]
|
|
15
|
+
niche: "developer"
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
### How does a fn read and write its system's store?
|
|
19
|
+
|
|
20
|
+
**In code it is `ctx.store`**: Kysely over the tables (typed when the implementation is `contract.implement<NotesDb>`),
|
|
21
|
+
plus `vectors(name)`. Transactions carry vectors too:
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
export const createImpl = () => notes.implement<NotesDb>({
|
|
25
|
+
fns: {
|
|
26
|
+
add: {
|
|
27
|
+
async run({ title, body }, ctx) {
|
|
28
|
+
const id = crypto.randomUUID();
|
|
29
|
+
await ctx.store.transaction().execute(async (tx) => {
|
|
30
|
+
await tx.insertInto('notes').values({ id, title, tags: null, created_at: new Date() }).execute();
|
|
31
|
+
await tx.vectors('note_text').upsert(id, await embed(ctx, body));
|
|
32
|
+
});
|
|
33
|
+
return ctx.done({ id });
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`ctx.store` is one object for the system's whole life, so code may keep it (a timer or a queue set up in
|
|
41
|
+
`started`): each statement waits while the store is being opened, migrated or moved, as a held call does, and then
|
|
42
|
+
runs on the connection open at that moment, on whichever side and engine the store is on.
|
|
43
|
+
|
|
44
|
+
Inside a transaction, use its `tx` for every statement: the store is one connection, so a statement on `ctx.store`
|
|
45
|
+
waits for the transaction to end. On the hub, a transaction holds the store's file for itself under a lease (30
|
|
46
|
+
seconds between statements); one that goes quiet longer is rolled back. Keep transactions short, and never wait on a
|
|
47
|
+
person or a model inside one.
|
|
48
|
+
|
|
49
|
+
Fns for this: fn:fs/read, fn:fs/write, fn:fs/edit, fn:fs/bash.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
# Generated by scripts/docs/authoring.ts from the authoring guide (npm run docs:authoring); do not edit.
|
|
3
|
+
key: "authoring.store.declare"
|
|
4
|
+
title: "How do I declare a store in a system's contract?"
|
|
5
|
+
description: "Writing a harness system, A store of the system’s own: How do I declare a store in a system's contract?"
|
|
6
|
+
summary: "store({ description, vectors, engines }) in the contract's with()."
|
|
7
|
+
question: "How do I declare a store in a system's contract?"
|
|
8
|
+
when: "When adding a store to a system's contract, or choosing whether it keeps vectors and which engines it may run on."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
11
|
+
parent: "fs/authoring.store"
|
|
12
|
+
next: "fs/authoring.store.placement"
|
|
13
|
+
fns: ["fs/read", "fs/write", "fs/edit", "fs/bash"]
|
|
14
|
+
tags: ["authoring"]
|
|
15
|
+
niche: "developer"
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
### How do I declare a store in a system's contract?
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
export const notes = system('notes', { description: 'Keeps notes and finds them by meaning.' })
|
|
22
|
+
.with({ store: store({ description: 'Notes and their embeddings.', vectors: true }) });
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
- `description`: what the store holds, shown when the system is installed and on its Storage panel.
|
|
26
|
+
- `vectors`: whether it keeps vectors (`ctx.store.vectors(name)`); an external database must then be able to hold
|
|
27
|
+
them (pgvector, SQL Server 2025).
|
|
28
|
+
- `engines`: the engines it may run on (default all: `sqlite`, `postgres`, `sqlserver`).
|
|
29
|
+
|
|
30
|
+
A contract declares at most one store. Its tables come from the migrations the server hands to `serve`.
|
|
31
|
+
|
|
32
|
+
Fns for this: fn:fs/read, fn:fs/write, fn:fs/edit, fn:fs/bash.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
# Generated by scripts/docs/authoring.ts from the authoring guide (npm run docs:authoring); do not edit.
|
|
3
|
+
key: "authoring.store.engines"
|
|
4
|
+
title: "How does a migration handle what differs between engines?"
|
|
5
|
+
description: "Writing a harness system, A store of the system’s own: How does a migration handle what differs between engines?"
|
|
6
|
+
summary: "db.engine for identity columns and long indexed text; varchar keys and bigint times."
|
|
7
|
+
question: "How does a migration handle what differs between engines?"
|
|
8
|
+
when: "When a migration needs an identity column, indexed long text, or numbers Postgres reads back as text."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
11
|
+
parent: "fs/authoring.store"
|
|
12
|
+
next: "fs/authoring.store.serve"
|
|
13
|
+
fns: ["fs/read", "fs/write", "fs/edit", "fs/bash"]
|
|
14
|
+
tags: ["authoring"]
|
|
15
|
+
niche: "developer"
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
### How does a migration handle what differs between engines?
|
|
19
|
+
|
|
20
|
+
A migration knows its engine (`db.engine`), for what `t` doesn't cover: an identity column (`autoIncrement()` on
|
|
21
|
+
SQLite, `generatedByDefaultAsIdentity()` on Postgres, `identity()` on SQL Server), or long text that SQL Server must
|
|
22
|
+
index or call `nvarchar(max)`. Keys and anything indexed are `varchar(n)`; times as numbers are `bigint`, which
|
|
23
|
+
Postgres reads back as text, so parse them with `z.coerce.number()`.
|
|
24
|
+
|
|
25
|
+
Fns for this: fn:fs/read, fn:fs/write, fn:fs/edit, fn:fs/bash.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
# Generated by scripts/docs/authoring.ts from the authoring guide (npm run docs:authoring); do not edit.
|
|
3
|
+
key: "authoring.store.migrations"
|
|
4
|
+
title: "How do I write a store's tables and migrations?"
|
|
5
|
+
description: "Writing a harness system, A store of the system’s own: How do I write a store's tables and migrations?"
|
|
6
|
+
summary: "The tables as a TypeScript interface, forward-only migration(id, up), the t column types, checksums and snapshots."
|
|
7
|
+
question: "How do I write a store's tables and migrations?"
|
|
8
|
+
when: "When writing or changing a store's tables: its Db interface and migrations, column types that differ between engines, or a migration that was refused."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
11
|
+
parent: "fs/authoring.store"
|
|
12
|
+
next: "fs/authoring.store.engines"
|
|
13
|
+
fns: ["fs/read", "fs/write", "fs/edit", "fs/bash"]
|
|
14
|
+
tags: ["authoring"]
|
|
15
|
+
niche: "developer"
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
### How do I write a store's tables and migrations?
|
|
19
|
+
|
|
20
|
+
The server writes the tables as a TypeScript interface (Kysely's view of them) and an ordered list of
|
|
21
|
+
`migration(id, up)`, forward only; ids never change once shipped:
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
export interface NotesDb extends StoreDb {
|
|
25
|
+
notes: { id: string; title: string; tags: string[] | null; created_at: Date };
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const migrations = [
|
|
29
|
+
migration('001-notes', async (db) => {
|
|
30
|
+
await db.schema.createTable('notes')
|
|
31
|
+
.addColumn('id', 'text', (c) => c.primaryKey())
|
|
32
|
+
.addColumn('title', 'text', (c) => c.notNull())
|
|
33
|
+
.addColumn('created_at', t.timestamp(), (c) => c.notNull())
|
|
34
|
+
.execute();
|
|
35
|
+
await db.vectors.create('note_text', { dimensions: 1024 });
|
|
36
|
+
}),
|
|
37
|
+
migration('002-tags', async (db) => {
|
|
38
|
+
await db.schema.alterTable('notes').addColumn('tags', t.json()).execute();
|
|
39
|
+
}),
|
|
40
|
+
];
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
- `t.json()`, `t.timestamp()` and `t.bool()` are the column types engines disagree on; each becomes the engine's own
|
|
44
|
+
(`jsonb`, `timestamptz`, `boolean` on Postgres; text, milliseconds and 0 or 1 on SQLite) and is read back as the
|
|
45
|
+
system wrote it (the parsed value, a `Date`, a boolean). Every other type (`text`, `integer`, `real`) is written as
|
|
46
|
+
Kysely takes it.
|
|
47
|
+
- `db.vectors.create(name, { dimensions })` makes a set of vectors (sqlite-vec `vec0`, pgvector, `VECTOR(n)`).
|
|
48
|
+
- What ran is recorded inside the store, each id with a checksum of its code. A migration changed or removed after it
|
|
49
|
+
ran is refused, and the system stays down with that error: add a new migration instead.
|
|
50
|
+
- A SQLite store is snapshotted before pending migrations run (the last three kept); a migration that fails puts the
|
|
51
|
+
snapshot back and the system reports its store `failed`.
|
|
52
|
+
|
|
53
|
+
Fns for this: fn:fs/read, fn:fs/write, fn:fs/edit, fn:fs/bash.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
# Generated by scripts/docs/authoring.ts from the authoring guide (npm run docs:authoring); do not edit.
|
|
3
|
+
key: "authoring.store.moves"
|
|
4
|
+
title: "What happens to a system's store when an admin moves it?"
|
|
5
|
+
description: "Writing a harness system, A store of the system’s own: What happens to a system's store when an admin moves it?"
|
|
6
|
+
summary: "A move holds calls, copies the store, opens it on the new side and keeps a backup; what an author must keep in the store."
|
|
7
|
+
question: "What happens to a system's store when an admin moves it?"
|
|
8
|
+
when: "When a system's store may be moved by an admin, its vectors may not fit an engine, or files kept beside the store matter."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
11
|
+
parent: "fs/authoring.store"
|
|
12
|
+
next: "fs/authoring.store.migrations"
|
|
13
|
+
fns: ["fs/read", "fs/write", "fs/edit", "fs/bash"]
|
|
14
|
+
tags: ["authoring"]
|
|
15
|
+
niche: "developer"
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
### What happens to a system's store when an admin moves it?
|
|
19
|
+
|
|
20
|
+
A move (Admin › Systems › <system> › Storage, or `fnloom system store move`) holds calls to the system, gives runs
|
|
21
|
+
still going a minute to finish (then asks the admin to cancel them or keep waiting), closes the store and copies it: a
|
|
22
|
+
SQLite copy between the hub and the system, or, to or from Postgres or SQL Server, the same migrations on an empty
|
|
23
|
+
schema and then every table and vector set copied in pages, with row counts checked. The copy runs in the system's
|
|
24
|
+
own process (it reaches its file, the external database and the hub's file), and the store opens on its new side
|
|
25
|
+
before calls go again; the old copy is kept as a backup until the admin deletes it. A move that fails part-way leaves
|
|
26
|
+
the store where it was.
|
|
27
|
+
|
|
28
|
+
What this means for an author:
|
|
29
|
+
|
|
30
|
+
- Nothing in the system's code changes for a move: `ctx.store` waits while it happens and then runs on the new side.
|
|
31
|
+
- Keep what a store holds in its tables and vector sets. Files the system writes beside it stay where they are.
|
|
32
|
+
- A store with vectors can't move to an engine that can't hold them (no pgvector, SQL Server before 2025, or a vector
|
|
33
|
+
set larger than the engine takes: 1998 numbers on SQL Server, 8192 on SQLite, 16000 on Postgres), and the move is
|
|
34
|
+
refused before it starts. Pick vector sizes every engine you list in `engines` takes.
|
|
35
|
+
- When the system is removed, its store is kept by default (listed as orphaned) and picked up again when the
|
|
36
|
+
instance comes back; the admin can delete it with the removal instead.
|
|
37
|
+
|
|
38
|
+
Fns for this: fn:fs/read, fn:fs/write, fn:fs/edit, fn:fs/bash.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
# Generated by scripts/docs/authoring.ts from the authoring guide (npm run docs:authoring); do not edit.
|
|
3
|
+
key: "authoring.store.placement"
|
|
4
|
+
title: "Where does a system's store live?"
|
|
5
|
+
description: "Writing a harness system, A store of the system’s own: Where does a system's store live?"
|
|
6
|
+
summary: "The admin places it with the system, on the hub, or in Postgres or SQL Server; the code is the same everywhere."
|
|
7
|
+
question: "Where does a system's store live?"
|
|
8
|
+
when: "When wondering where a system's store is kept, who chooses, or whether code must differ between placements."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
11
|
+
parent: "fs/authoring.store"
|
|
12
|
+
next: "fs/authoring.store.moves"
|
|
13
|
+
fns: ["fs/read", "fs/write", "fs/edit", "fs/bash"]
|
|
14
|
+
tags: ["authoring"]
|
|
15
|
+
niche: "developer"
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
### Where does a system's store live?
|
|
19
|
+
|
|
20
|
+
**Where it lives is the admin's choice**, made when the system is installed: with the system (the default: SQLite
|
|
21
|
+
with sqlite-vec in its data folder), on the hub (SQLite in the hub's data folder; the system's statements go over
|
|
22
|
+
its link), or in an external Postgres or SQL Server database, in a schema the admin names. The hub tells the system
|
|
23
|
+
in its welcome; the system's code is the same in every placement, so never branch on where the store is.
|
|
24
|
+
|
|
25
|
+
Fns for this: fn:fs/read, fn:fs/write, fn:fs/edit, fn:fs/bash.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
# Generated by scripts/docs/authoring.ts from the authoring guide (npm run docs:authoring); do not edit.
|
|
3
|
+
key: "authoring.store.serve"
|
|
4
|
+
title: "What does a system with a store need before it takes calls?"
|
|
5
|
+
description: "Writing a harness system, A store of the system’s own: What does a system with a store need before it takes calls?"
|
|
6
|
+
summary: "serve({ store: { migrations } }), calls held until the store is ready, and the native packages system.json lists."
|
|
7
|
+
question: "What does a system with a store need before it takes calls?"
|
|
8
|
+
when: "When wiring a store into serve(), when calls say the system is getting its storage ready, or when listing a store's packages in system.json."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
11
|
+
parent: "fs/authoring.store"
|
|
12
|
+
next: "fs/authoring.store.ctx-store"
|
|
13
|
+
fns: ["fs/read", "fs/write", "fs/edit", "fs/bash"]
|
|
14
|
+
tags: ["authoring"]
|
|
15
|
+
niche: "developer"
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
### What does a system with a store need before it takes calls?
|
|
19
|
+
|
|
20
|
+
**`serve` takes the migrations, and nothing runs until the store is ready.** Hand them to `serve` with
|
|
21
|
+
`store: { migrations }`. The store opens where the hub says and its pending migrations run before the system takes a
|
|
22
|
+
call or runs `started`; until then the hub holds calls to it (fn runs, hooks, firings, authoring) for up to two minutes,
|
|
23
|
+
then refuses them with "<system> is getting its storage ready". A system with a store lists `better-sqlite3` and
|
|
24
|
+
`sqlite-vec` in its `system.json` `server.external` (and `pg`, or `tedious` and `tarn`, to run on an external
|
|
25
|
+
database): they carry native code, so the installer fetches them beside the bundle. A system the hub runs from its
|
|
26
|
+
source folder gets the Postgres and SQL Server drivers from the hub instead, which installs them into its drivers
|
|
27
|
+
folder when the store is placed there (they are not in the base install); the versions it installs are the ones the
|
|
28
|
+
system's `server.external` names.
|
|
29
|
+
|
|
30
|
+
Fns for this: fn:fs/read, fn:fs/write, fn:fs/edit, fn:fs/bash.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
# Generated by scripts/docs/authoring.ts from the authoring guide (npm run docs:authoring); do not edit.
|
|
3
|
+
key: "authoring.store.store-tables"
|
|
4
|
+
title: "How do I type the tables of one part of a system on their own?"
|
|
5
|
+
description: "Writing a harness system, A store of the system’s own: How do I type the tables of one part of a system on their own?"
|
|
6
|
+
summary: "storeTables<Tables>(ctx.store) types one part's tables (an index, a queue) without a cast."
|
|
7
|
+
question: "How do I type the tables of one part of a system on their own?"
|
|
8
|
+
when: "When one module of a system (an index, a queue) owns some of the store's tables and wants them typed on their own."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
11
|
+
parent: "fs/authoring.store"
|
|
12
|
+
next: "fs/authoring.store.work"
|
|
13
|
+
fns: ["fs/read", "fs/write", "fs/edit", "fs/bash"]
|
|
14
|
+
tags: ["authoring"]
|
|
15
|
+
niche: "developer"
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
### How do I type the tables of one part of a system on their own?
|
|
19
|
+
|
|
20
|
+
`storeTables<IndexTables>(ctx.store)` is Kysely's query builders over the store's executor (and
|
|
21
|
+
`storeTables<IndexTables>(tx)` inside a transaction), typed by that part's interface (an index, a queue) whatever
|
|
22
|
+
`implement<Db>` says, with no cast.
|
|
23
|
+
|
|
24
|
+
Fns for this: fn:fs/read, fn:fs/write, fn:fs/edit, fn:fs/bash.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
# Generated by scripts/docs/authoring.ts from the authoring guide (npm run docs:authoring); do not edit.
|
|
3
|
+
key: "authoring.store.vectors"
|
|
4
|
+
title: "How does a system keep vectors in its store and find the nearest ones?"
|
|
5
|
+
description: "Writing a harness system, A store of the system’s own: How does a system keep vectors in its store and find the nearest ones?"
|
|
6
|
+
summary: "vectors: true, db.vectors.create in a migration, then ctx.store.vectors(name) with upsert, remove and nearest."
|
|
7
|
+
question: "How does a system keep vectors in its store and find the nearest ones?"
|
|
8
|
+
when: "When a system keeps embeddings of its own and searches them by nearness in its store."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
11
|
+
parent: "fs/authoring.store"
|
|
12
|
+
next: "fs/authoring.store.store-tables"
|
|
13
|
+
fns: ["fs/read", "fs/write", "fs/edit", "fs/bash"]
|
|
14
|
+
tags: ["authoring"]
|
|
15
|
+
niche: "developer"
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
### How does a system keep vectors in its store and find the nearest ones?
|
|
19
|
+
|
|
20
|
+
Declare the store with `vectors: true`, and make each set in a migration with `db.vectors.create(name, { dimensions })`
|
|
21
|
+
(a name of lowercase letters, digits and underscores). Then `ctx.store.vectors(name)` (or `tx.vectors(name)` in a
|
|
22
|
+
transaction) has three methods, each keyed by a string the system chooses (usually a row's id):
|
|
23
|
+
|
|
24
|
+
- `upsert(key, vector)` adds or replaces one vector; a vector of another size than its set is refused.
|
|
25
|
+
- `remove(keys)` removes one key or a list of them.
|
|
26
|
+
- `nearest(vector, { k?, keys? })` gives the `k` nearest (default 10, at most 4096), each `{ key, distance, score }`:
|
|
27
|
+
cosine distance, and `score` as a similarity from 0 to 1. `keys` limits the search to those keys.
|
|
28
|
+
|
|
29
|
+
Make the vectors with the hub's embedders (`ctx.llm.embed(texts)`), never by calling a model provider directly.
|
|
30
|
+
Every engine computes cosine distance the same way, so the results don't change when the store moves.
|
|
31
|
+
|
|
32
|
+
Fns for this: fn:fs/read, fn:fs/write, fn:fs/edit, fn:fs/bash.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
# Generated by scripts/docs/authoring.ts from the authoring guide (npm run docs:authoring); do not edit.
|
|
3
|
+
key: "authoring.store.when-to-use"
|
|
4
|
+
title: "When should a system keep a store instead of hub records?"
|
|
5
|
+
description: "Writing a harness system, A store of the system’s own: When should a system keep a store instead of hub records?"
|
|
6
|
+
summary: "A store is for working tables only the system's code reads; data people see, search and share stays in hub records."
|
|
7
|
+
question: "When should a system keep a store instead of hub records?"
|
|
8
|
+
when: "When deciding where a system keeps what it saves: a store of its own, hub records of a stored type, or its data folder."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
11
|
+
parent: "fs/authoring.store"
|
|
12
|
+
next: "fs/authoring.store.declare"
|
|
13
|
+
fns: ["fs/read", "fs/write", "fs/edit", "fs/bash"]
|
|
14
|
+
tags: ["authoring"]
|
|
15
|
+
niche: "developer"
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
### When should a system keep a store instead of hub records?
|
|
19
|
+
|
|
20
|
+
Data people see, search and share stays in hub records ([Stored types and the data system](context:fs/authoring.data)): the hub checks,
|
|
21
|
+
versions, shares and searches them, and shows them on the Data page. A store is for what only the system's code
|
|
22
|
+
reads: a queue of work, an index, bookkeeping, vectors it searches itself. Nobody browses a store, and the hub never
|
|
23
|
+
searches it. Files the system keeps for itself (keys, a cache, copies too big for a table) stay in its data folder
|
|
24
|
+
(`ctx.dataDir`, [Config, events, lifecycle and data](context:fs/authoring.lifecycle)), and a store can index them. Never keep a SQLite file of your
|
|
25
|
+
own in the data folder: a store is that database, placed, migrated, backed up and moved by the hub.
|
|
26
|
+
|
|
27
|
+
Fns for this: fn:fs/read, fn:fs/write, fn:fs/edit, fn:fs/bash.
|