fnloom 0.1.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 +133 -23
- package/package.json +13 -17
- 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/available.ts +63 -22
- package/packages/cli/src/commands/install.ts +182 -28
- 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/index.ts +3 -2
- package/packages/cli/src/io.ts +1 -0
- package/packages/cli/src/local.ts +6 -0
- package/packages/cli/src/premade.ts +80 -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 +15 -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/dev-env.ts +4 -4
- package/scripts/run-stack.ts +3 -2
- package/scripts/stack.ts +115 -43
- package/scripts/start.ts +36 -17
- 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/claude/client/FleetPage.vue +0 -132
- package/systems/claude/client/NewSessionForm.vue +0 -62
- package/systems/claude/client/SessionList.vue +0 -64
- package/systems/claude/client/SessionPage.vue +0 -199
- package/systems/claude/client/TaskList.vue +0 -61
- package/systems/claude/client/fakes.ts +0 -186
- package/systems/claude/client/host.ts +0 -23
- package/systems/claude/client/index.ts +0 -15
- package/systems/claude/client/logic.ts +0 -270
- package/systems/claude/client/state.ts +0 -344
- package/systems/claude/package.json +0 -23
- package/systems/claude/server/agent-sdk.ts +0 -379
- package/systems/claude/server/driver.ts +0 -153
- package/systems/claude/server/env.ts +0 -64
- package/systems/claude/server/fake-driver.ts +0 -112
- package/systems/claude/server/fleet.ts +0 -376
- package/systems/claude/server/impl.ts +0 -568
- package/systems/claude/server/index.ts +0 -8
- package/systems/claude/server/main.ts +0 -38
- package/systems/claude/server/preview.ts +0 -76
- package/systems/claude/server/questions.ts +0 -117
- package/systems/claude/server/transcript.ts +0 -83
- package/systems/claude/shared/index.ts +0 -262
- package/systems/claude/shared/session.ts +0 -284
- package/systems/claude/shared/shapes.ts +0 -106
- package/systems/claude/system.json +0 -18
- package/systems/claude/tsconfig.json +0 -6
- package/systems/database/package.json +0 -25
- package/systems/database/server/author.ts +0 -41
- package/systems/database/server/authoring.ts +0 -322
- package/systems/database/server/catalog.ts +0 -117
- package/systems/database/server/compile.ts +0 -332
- package/systems/database/server/dialects.ts +0 -17
- package/systems/database/server/drivers/database.ts +0 -71
- package/systems/database/server/drivers/index.ts +0 -23
- package/systems/database/server/drivers/postgres.ts +0 -157
- package/systems/database/server/drivers/sqlite.ts +0 -151
- package/systems/database/server/drivers/sqlserver.ts +0 -176
- package/systems/database/server/env.ts +0 -35
- package/systems/database/server/fixture.ts +0 -169
- package/systems/database/server/impl.ts +0 -793
- package/systems/database/server/index.ts +0 -7
- package/systems/database/server/instance.ts +0 -398
- package/systems/database/server/main.ts +0 -47
- package/systems/database/server/pick.ts +0 -97
- package/systems/database/server/queries.ts +0 -390
- package/systems/database/server/results.ts +0 -39
- package/systems/database/server/schema.ts +0 -59
- package/systems/database/server/table-fns.ts +0 -237
- package/systems/database/server/types.ts +0 -253
- package/systems/database/shared/index.ts +0 -544
- package/systems/database/shared/shapes.ts +0 -413
- package/systems/database/system.json +0 -14
- package/systems/database/tsconfig.json +0 -6
- 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/web/client/ReadView.vue +0 -110
- package/systems/web/client/SearchView.vue +0 -215
- package/systems/web/client/StatusChip.vue +0 -38
- package/systems/web/client/fakes.ts +0 -48
- package/systems/web/client/index.ts +0 -15
- package/systems/web/client/view.ts +0 -131
- package/systems/web/package.json +0 -22
- package/systems/web/server/chrome.ts +0 -121
- package/systems/web/server/crawl.ts +0 -333
- package/systems/web/server/env.ts +0 -63
- package/systems/web/server/guard.ts +0 -60
- package/systems/web/server/http.ts +0 -89
- package/systems/web/server/impl.ts +0 -203
- package/systems/web/server/index.ts +0 -71
- package/systems/web/server/loader.ts +0 -104
- package/systems/web/server/main.ts +0 -70
- package/systems/web/server/mentions.ts +0 -111
- package/systems/web/server/problem.ts +0 -72
- package/systems/web/server/renderer.ts +0 -243
- package/systems/web/server/robots.ts +0 -75
- package/systems/web/server/searches.ts +0 -29
- package/systems/web/server/tavily.ts +0 -144
- package/systems/web/server/testing.ts +0 -165
- package/systems/web/server/uploads.ts +0 -33
- package/systems/web/shared/index.ts +0 -343
- package/systems/web/shared/urls.ts +0 -60
- package/systems/web/system.json +0 -15
- package/systems/web/tsconfig.json +0 -6
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* the fns it and they bring (`ContextDecl.fns`). The plain, suggest and graph contextors and `hub/ctx_load` all go
|
|
4
4
|
* through here, so a context's work always has its fns and its linked context, however it got into the prompt.
|
|
5
5
|
*/
|
|
6
|
-
import { contextOff, mapConcurrent, QualifiedName, type ContextChoice, type ContextRecord } from '@harness/core';
|
|
6
|
+
import { contextOff, mapConcurrent, modelSeesContext, QualifiedName, type ContextChoice, type ContextRecord } from '@harness/core';
|
|
7
7
|
import type { Catalog } from '../catalog/index.ts';
|
|
8
8
|
|
|
9
9
|
/** A context item's choice with the token size of the item it leads to (absent when that item is gone). */
|
|
@@ -26,15 +26,17 @@ export async function withImports(catalog: Pick<Catalog, 'context'>, names: read
|
|
|
26
26
|
});
|
|
27
27
|
level.forEach((name, index) => records.set(name, found[index]));
|
|
28
28
|
// an off item's imports are not followed: what only it imports is left out
|
|
29
|
-
level = [...new Set(found.flatMap((record) => (record === undefined || contextOff(record) ? [] : record.decl.imports
|
|
29
|
+
level = [...new Set(found.flatMap((record) => (record === undefined || contextOff(record) ? [] : record.decl.imports)))].filter((name) => !records.has(name));
|
|
30
30
|
}
|
|
31
31
|
const out: string[] = [];
|
|
32
32
|
const seen = new Set<string>();
|
|
33
|
+
const asked = new Set(names);
|
|
33
34
|
const visit = (name: string): void => {
|
|
34
35
|
if (seen.has(name)) return;
|
|
35
36
|
seen.add(name);
|
|
36
37
|
const record = records.get(name);
|
|
37
|
-
|
|
38
|
+
// an item asked for by name may also be a not-applicable one with an answer (`modelSeesContext`); what it imports must be on
|
|
39
|
+
if (record !== undefined && (asked.has(name) ? !modelSeesContext(record) : contextOff(record))) return;
|
|
38
40
|
out.push(name);
|
|
39
41
|
for (const imported of record?.decl.imports ?? []) visit(imported);
|
|
40
42
|
};
|
|
@@ -28,12 +28,12 @@ export function seeded(seed: number): () => number {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/** A context record from a few fields. */
|
|
31
|
-
export function contextRecord(name: QualifiedName, fields: Partial<ContextDecl> & Partial<Pick<ContextRecord, 'origin' | '
|
|
32
|
-
const { origin,
|
|
31
|
+
export function contextRecord(name: QualifiedName, fields: Partial<ContextDecl> & Partial<Pick<ContextRecord, 'origin' | 'status' | 'mentions'>> = {}): ContextRecord {
|
|
32
|
+
const { origin, status, mentions, ...decl } = fields;
|
|
33
33
|
const slash = name.indexOf('/');
|
|
34
34
|
return {
|
|
35
|
-
name, system: SystemName.parse(name.slice(0, slash)), stale: false, updatedAt: 0, mentions: mentions ?? { context: [], fns: [] },
|
|
36
|
-
...(origin === undefined ? {} : { origin }),
|
|
35
|
+
name, system: SystemName.parse(name.slice(0, slash)), status: status ?? 'active', stale: false, updatedAt: 0, mentions: mentions ?? { context: [], fns: [] },
|
|
36
|
+
...(origin === undefined ? {} : { origin }),
|
|
37
37
|
decl: {
|
|
38
38
|
name: name.slice(slash + 1), description: `About ${name}.`, imports: [], fns: [], suggestFns: [], suggest: 'both', visible: 'both', tags: [], ...decl,
|
|
39
39
|
},
|
|
@@ -100,6 +100,7 @@ export function createExecution(input: ExecutionInput): ExecutionModule {
|
|
|
100
100
|
const agents: HubAgentLoop = new HubAgentLoop({ ...input, runs, queues, llm: engine, models });
|
|
101
101
|
const hubFns = new HubFns();
|
|
102
102
|
registerRunFns(hubFns, runs);
|
|
103
|
+
hubFns.progressTo((run, report) => runs.progress(run, report));
|
|
103
104
|
runs.use('system', new SystemExecutor(input));
|
|
104
105
|
runs.use('hub', hubFns);
|
|
105
106
|
runs.use('agent', agents);
|
|
@@ -151,6 +152,7 @@ export const EXECUTION_LINK_SPEC = spec({
|
|
|
151
152
|
progress: hubLinkSpec.endpoints.progress,
|
|
152
153
|
allow: hubLinkSpec.endpoints.allow,
|
|
153
154
|
undoWith: hubLinkSpec.endpoints.undoWith,
|
|
155
|
+
updateResult: hubLinkSpec.endpoints.updateResult,
|
|
154
156
|
llm: hubLinkSpec.endpoints.llm,
|
|
155
157
|
propose: hubLinkSpec.endpoints.propose,
|
|
156
158
|
},
|
|
@@ -15,6 +15,8 @@ export const executionEnv = env({
|
|
|
15
15
|
HARNESS_TRANSIENT_TRIES: z.number().int().min(1).max(20).default(3).describe('How many times an LLM call waits out a rate limit or a full budget (the wait it names) before it gives up.'),
|
|
16
16
|
HARNESS_BUDGET_RECHECK: z.number().int().min(1_000).default(60_000).describe('How long a call waits before checking again when a budget whose rule says `wait` is full.'),
|
|
17
17
|
HARNESS_RUN_RETRY_BASE: z.number().int().min(10).default(1_000).describe('The first delay before a failed run classed `retry` runs again (doubled on each retry).'),
|
|
18
|
+
HARNESS_RUN_SYSTEM_WAIT: z.number().int().min(1_000).default(60_000).describe('How long a run waits for its system to connect (it went away, or the hub was restarting) before it fails with "<system> isn\'t connected". It goes ahead as soon as the system connects.'),
|
|
19
|
+
HARNESS_RUN_SYSTEM_RECHECK: z.number().int().min(10).default(5_000).describe('How often a run waiting for its system looks again, besides when the system connects.'),
|
|
18
20
|
HARNESS_QUEUE_POLL: z.number().int().min(1).default(250).describe('How often the queues look for due work when idle.'),
|
|
19
21
|
HARNESS_VALIDATE_RETRIES: z.number().int().min(0).default(2).describe('How many times in a turn a fn whose output hook refused its result may be tried again before the run stops.'),
|
|
20
22
|
HARNESS_TOOL_RESULT_ROWS: z.number().int().min(0).max(100).default(5).describe('How many rows of a table result (a widget run, a fn returning a table) the model reads after its summary; the person sees the whole table.'),
|
|
@@ -32,6 +32,18 @@ export class RunRefused extends Error {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
/** A run's saved result could not be updated (`RunService.updateResult`): no such run, not done, or a value its type refuses. */
|
|
36
|
+
export class ResultUpdateRefused extends Error {
|
|
37
|
+
override readonly name = 'ResultUpdateRefused';
|
|
38
|
+
/** `not-found`, `not-done` or `invalid`. */
|
|
39
|
+
readonly code: 'not-found' | 'not-done' | 'invalid';
|
|
40
|
+
|
|
41
|
+
constructor(code: 'not-found' | 'not-done' | 'invalid', message: string) {
|
|
42
|
+
super(message);
|
|
43
|
+
this.code = code;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
35
47
|
/** An LLM call would take a budget over. `wait` is set when the budget's rule says to wait for its window. */
|
|
36
48
|
export class BudgetRefused extends Error {
|
|
37
49
|
override readonly name = 'BudgetRefused';
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { encodeValue, parseValue, type FnRef, type GinType } from '@harness/sdk';
|
|
11
11
|
import {
|
|
12
|
-
splitName, type ActorId, type InputProblem, type InvalidInput, type Json, type OutcomeWire, type QualifiedName, type Run, type RunId, type RunRequest, type UndoOutcome, type RunControlAction, type RunInfo,
|
|
12
|
+
splitName, type ActorId, type InputProblem, type InvalidInput, type Json, type OutcomeWire, type ProgressReport, type QualifiedName, type Run, type RunId, type RunRequest, type UndoOutcome, type RunControlAction, type RunInfo,
|
|
13
13
|
} from '@harness/core';
|
|
14
14
|
import type { SystemConnection } from '../link/index.ts';
|
|
15
15
|
import { causeOf, fnError, messageOf, RunRefused, RunStopped } from './errors.ts';
|
|
@@ -139,6 +139,11 @@ export interface HubFnCtx {
|
|
|
139
139
|
* payload is checked against the fn's declared undo type when the run settles.
|
|
140
140
|
*/
|
|
141
141
|
undoWith(payload: Json): void;
|
|
142
|
+
/**
|
|
143
|
+
* Report how far the run is, as a system's fn does (`ctx.progress`): a fraction with a line saying what it is doing.
|
|
144
|
+
* The chat's run card shows it while the run goes on.
|
|
145
|
+
*/
|
|
146
|
+
progress(report: ProgressReport): void;
|
|
142
147
|
}
|
|
143
148
|
|
|
144
149
|
/** What a hub fn's undo gets: the run being undone, as it ran. */
|
|
@@ -173,6 +178,13 @@ export class HubFns implements RunExecutor {
|
|
|
173
178
|
readonly #impls = new Map<QualifiedName, HubFnImpl>();
|
|
174
179
|
readonly #checks = new Map<QualifiedName, HubFnCheck<Json>>();
|
|
175
180
|
readonly #undos = new Map<QualifiedName, HubUndoImpl>();
|
|
181
|
+
/** Where hub fns' progress reports go (the run service, once it is built). */
|
|
182
|
+
#progress: (run: RunId, report: ProgressReport) => void = () => undefined;
|
|
183
|
+
|
|
184
|
+
/** Send hub fns' progress reports to the run service. */
|
|
185
|
+
progressTo(sink: (run: RunId, report: ProgressReport) => Promise<void>): void {
|
|
186
|
+
this.#progress = (run, report) => { void sink(run, report).catch(() => undefined); };
|
|
187
|
+
}
|
|
176
188
|
|
|
177
189
|
/**
|
|
178
190
|
* Implement a hub fn. Its args arrive checked and in their plain form; its result is checked on the way out. A
|
|
@@ -214,7 +226,7 @@ export class HubFns implements RunExecutor {
|
|
|
214
226
|
if (impl === undefined) return { status: 'failed', error: fnError('fatal', `the hub has no implementation of ${job.run.fn}`, 'not-implemented') };
|
|
215
227
|
let undo: Json | undefined;
|
|
216
228
|
try {
|
|
217
|
-
const result = await impl(job.request.args, { request: job.request, signal, undoWith: (payload) => { undo = payload; } });
|
|
229
|
+
const result = await impl(job.request.args, { request: job.request, signal, undoWith: (payload) => { undo = payload; }, progress: (report) => { this.#progress(job.run.id, report); } });
|
|
218
230
|
// an implementation that returns early when stopped (`run_wait`) still ends the way the stop asked
|
|
219
231
|
if (signal.aborted && signal.reason instanceof RunStopped) throw signal.reason;
|
|
220
232
|
return { status: 'done', result, ...(undo === undefined || !this.#undos.has(job.run.fn) ? {} : { undo }) };
|
|
@@ -91,6 +91,14 @@ export interface RunService {
|
|
|
91
91
|
/** Stop the caller waiting: the run goes on and reports back when it finishes. */
|
|
92
92
|
background(run: RunId): Promise<boolean>;
|
|
93
93
|
progress(run: RunId, report: ProgressReport): Promise<void>;
|
|
94
|
+
/**
|
|
95
|
+
* Replace the saved result of a finished (`done`) run, as its fn's owner decides (the hub for its own fns, a system
|
|
96
|
+
* over the link for its runs): `update` gets the result as it is now and gives the new one. Updates of one run run
|
|
97
|
+
* one at a time, so two never lose each other's change. The new result is checked with the fn's result type; the run
|
|
98
|
+
* counts the change (`resultRevision`) and every chat showing it hears `{ type: 'result' }` and reads it again.
|
|
99
|
+
* Refused (`ResultUpdateRefused`) for a run that isn't done, or a value its type doesn't accept.
|
|
100
|
+
*/
|
|
101
|
+
updateResult(run: RunId, update: (current: Json, run: Run) => Promise<Json> | Json, by: ActorId): Promise<{ readonly run: Run; readonly result: Json }>;
|
|
94
102
|
allow(run: RunId, operations: Partial<AllowedOperations>): Promise<void>;
|
|
95
103
|
undoWith(run: RunId, undo: Json): Promise<void>;
|
|
96
104
|
undo(run: RunId, by: ActorId): Promise<UndoOutcome>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The system-link endpoints the execution module serves (`hubLinkSpec`): a run's child calls, its calls to its
|
|
3
|
-
* caller's handlers, controlling its children, its progress, operations and undo payload, and the LLM forward. A system may only act on its own runs.
|
|
3
|
+
* caller's handlers, controlling its children, its progress, operations and undo payload, a finished run's saved result, and the LLM forward. A system may only act on its own runs.
|
|
4
4
|
* The link module installs these on the link server; `ChildRelay` tells a calling system about its child runs.
|
|
5
5
|
*/
|
|
6
6
|
import { reject as refuse, type HandlerFor } from '@ayepi/core';
|
|
7
7
|
import { instanceLabel, isSettled, type HubLinkSpec, type InstanceRef, type Run, type RunId, type RunSettled, type RunUpdate } from '@harness/core';
|
|
8
8
|
import { HUB_SYSTEM } from '../catalog/availability.ts';
|
|
9
|
-
import { causeOf, fnError, messageOf, RunRefused } from './errors.ts';
|
|
9
|
+
import { causeOf, fnError, messageOf, ResultUpdateRefused, RunRefused } from './errors.ts';
|
|
10
10
|
import type { LlmGateway } from './index.ts';
|
|
11
11
|
import type { HandlerRelay } from './handlers.ts';
|
|
12
12
|
import type { ExecutionDeps } from './ports.ts';
|
|
@@ -16,11 +16,11 @@ import type { HubRunService } from './runs.ts';
|
|
|
16
16
|
export type LinkHandler<K extends keyof HubLinkSpec['endpoints']> = HandlerFor<HubLinkSpec, HubLinkSpec['endpoints'][K]>;
|
|
17
17
|
|
|
18
18
|
/** The endpoints execution serves (the link module serves the handshake, contract, resources, embeddings and logs). */
|
|
19
|
-
export type ExecutionLinkEndpoints = 'call' | 'handle' | 'control' | 'progress' | 'allow' | 'undoWith' | 'llm' | 'propose';
|
|
19
|
+
export type ExecutionLinkEndpoints = 'call' | 'handle' | 'control' | 'progress' | 'allow' | 'undoWith' | 'updateResult' | 'llm' | 'propose';
|
|
20
20
|
|
|
21
21
|
/** What the handlers use. */
|
|
22
22
|
export interface LinkHandlerDeps extends Pick<ExecutionDeps, 'store' | 'log'> {
|
|
23
|
-
readonly runs: Pick<HubRunService, 'get' | 'start' | 'cancel' | 'pause' | 'progress' | 'allow' | 'undoWith' | 'propose'>;
|
|
23
|
+
readonly runs: Pick<HubRunService, 'get' | 'start' | 'cancel' | 'pause' | 'progress' | 'allow' | 'undoWith' | 'updateResult' | 'propose'>;
|
|
24
24
|
readonly gateway: Pick<LlmGateway, 'forward'>;
|
|
25
25
|
readonly handlers: Pick<HandlerRelay, 'handle'>;
|
|
26
26
|
}
|
|
@@ -95,6 +95,18 @@ export function executionLinkHandlers(deps: LinkHandlerDeps): { [K in ExecutionL
|
|
|
95
95
|
await own(data.run, link);
|
|
96
96
|
await runs.undoWith(data.run, data.undo);
|
|
97
97
|
},
|
|
98
|
+
updateResult: async ({ data, link }) => {
|
|
99
|
+
const run = await own(data.run, link);
|
|
100
|
+
try {
|
|
101
|
+
// the change is the system's own, recorded as its actor
|
|
102
|
+
const system = await store.table('systems').get(link.system);
|
|
103
|
+
const updated = await runs.updateResult(run.id, () => data.result, system?.actor ?? run.caller);
|
|
104
|
+
return { revision: updated.run.resultRevision ?? 1 };
|
|
105
|
+
} catch (error) {
|
|
106
|
+
const refused = causeOf(error, ResultUpdateRefused);
|
|
107
|
+
throw refused === undefined ? error : refuse(refused.code === 'not-found' ? 404 : refused.code === 'not-done' ? 409 : 400, 'RESULT_UPDATE_REFUSED', refused.message);
|
|
108
|
+
}
|
|
109
|
+
},
|
|
98
110
|
handle: async ({ data, link, signal }) => {
|
|
99
111
|
await own(data.run, link);
|
|
100
112
|
return deps.handlers.handle(data, signal);
|
|
@@ -20,7 +20,7 @@ import { HUB_SYSTEM, systemAvailability } from '../catalog/availability.ts';
|
|
|
20
20
|
import { installCard } from '../link/install.ts';
|
|
21
21
|
import { agentNames } from '../catalog/injections.ts';
|
|
22
22
|
import { DeadlineTimers, deadlineError, runDeadline, type RunDeadline } from './deadlines.ts';
|
|
23
|
-
import { fnError, HubStopping, messageOf, notConnected, RunRefused, RunStopped, RunTimedOut } from './errors.ts';
|
|
23
|
+
import { fnError, HubStopping, messageOf, notConnected, ResultUpdateRefused, RunRefused, RunStopped, RunTimedOut } from './errors.ts';
|
|
24
24
|
import { rows } from '../store/rows.ts';
|
|
25
25
|
import { SystemGone } from './executors.ts';
|
|
26
26
|
import { AGENT_KIND, type Ledger, type LimitResolver, type PolicyEngine, type RunInput, type RunService } from './index.ts';
|
|
@@ -30,6 +30,7 @@ import { timeInfo } from './time.ts';
|
|
|
30
30
|
import { RunWording } from './wording.ts';
|
|
31
31
|
import type { FnModeGate, ModeVerdict } from '../fns/index.ts';
|
|
32
32
|
import { fnMode } from '../link/review-summary.ts';
|
|
33
|
+
import type { AccessScope } from '../access/index.ts';
|
|
33
34
|
|
|
34
35
|
/**
|
|
35
36
|
* Whether a run is the chat's own (`RunInfo.inChat`): a chat turn's agent or a fn it called directly, on a session, not
|
|
@@ -209,8 +210,14 @@ export class HubRunService implements RunService, RunSettler, RunEvents, RunCost
|
|
|
209
210
|
readonly #handlers = new Map<RunId, readonly string[]>();
|
|
210
211
|
readonly #resumes = new Map<RunId, ResumeWire['reason']>();
|
|
211
212
|
readonly #settling = new Set<RunId>();
|
|
213
|
+
/** The update of each run's saved result under way (`updateResult`), so the next waits for it. */
|
|
214
|
+
readonly #resultUpdates = new Map<RunId, Promise<void>>();
|
|
212
215
|
/** Runs a queue job is handling now, so a second job for the same run (a resend, a redelivery) stands aside. */
|
|
213
216
|
readonly #executing = new Set<RunId>();
|
|
217
|
+
/** Runs waiting for their system to connect again, and since when (`HARNESS_RUN_SYSTEM_WAIT`). */
|
|
218
|
+
readonly #gone = new Map<RunId, number>();
|
|
219
|
+
/** Runs made while their system was away, each with its fn and its next look (`#awaitAdmission`). */
|
|
220
|
+
readonly #admitting = new Map<RunId, { readonly fn: QualifiedName; readonly look: () => void; readonly stop: () => void }>();
|
|
214
221
|
readonly #listeners = new Set<(run: Run, settled: RunSettled) => void>();
|
|
215
222
|
readonly #wording: RunWording;
|
|
216
223
|
/** A timer per started run, at its deadline (`deadlines.ts`). */
|
|
@@ -229,6 +236,12 @@ export class HubRunService implements RunService, RunSettler, RunEvents, RunCost
|
|
|
229
236
|
this.#deps = deps;
|
|
230
237
|
this.#wording = new RunWording(deps.catalog);
|
|
231
238
|
this.#deadlines = new DeadlineTimers(deps.clock);
|
|
239
|
+
// a waiting run looks again when its fn's availability changes: a system that connects is written connected (and
|
|
240
|
+
// `system.status` sends its runs) before the catalog works out what that makes available (`catalog.changed`)
|
|
241
|
+
deps.bus.subscribe('catalog.changed', ({ fns }) => {
|
|
242
|
+
const changed = new Set(fns.map((record) => record.name));
|
|
243
|
+
for (const waiting of this.#admitting.values()) { if (changed.has(waiting.fn)) waiting.look(); }
|
|
244
|
+
});
|
|
232
245
|
deps.bus.subscribe('approval', ({ approval }) => {
|
|
233
246
|
if (approval.status === 'pending') return;
|
|
234
247
|
void this.#approved(approval.run, approval.status === 'approved', approval.decisions.at(-1)).catch((error: unknown) => {
|
|
@@ -265,7 +278,11 @@ export class HubRunService implements RunService, RunSettler, RunEvents, RunCost
|
|
|
265
278
|
if (fn.disabled && !blockedCall) throw new RunRefused(fnError('caller', `${input.fn} is turned off.`, 'disabled'));
|
|
266
279
|
// an admin's test call (and what it calls) runs on an installed system, which offers nothing else yet
|
|
267
280
|
const test = input.test === true || (input.parent !== undefined && (await store.table('runs').get(input.parent))?.test === true);
|
|
268
|
-
|
|
281
|
+
// a call made while its system is coming back (the hub restarting, the system reconnecting) waits for it, queued,
|
|
282
|
+
// like a run whose system went away (`#admitWhenConnected`); anything else unavailable is refused at once
|
|
283
|
+
const refusal = fn.available === true ? undefined : fnError('retry', `${input.fn} is unavailable: ${fn.available.detail}`, 'unavailable');
|
|
284
|
+
const away = refusal !== undefined && !blockedCall && await this.#systemAway(fn);
|
|
285
|
+
if (refusal !== undefined && !blockedCall && !away && !(test && await this.#testable(fn))) throw new RunRefused(refusal);
|
|
269
286
|
const turn = await store.table('turns').get(input.turn);
|
|
270
287
|
if (turn === undefined) throw new RunRefused(fnError('fatal', `There is no turn ${input.turn}.`, 'not-found'));
|
|
271
288
|
// a fn the turn's person may not see is as good as missing to them; a per-person fn needs a connection to act as
|
|
@@ -297,6 +314,8 @@ export class HubRunService implements RunService, RunSettler, RunEvents, RunCost
|
|
|
297
314
|
// a call made while its parent's args are checked (or under such a call) only reads, and never waits for anyone
|
|
298
315
|
const checking = parent === undefined ? undefined : this.#checking.get(parent.id);
|
|
299
316
|
if (parent !== undefined && checking !== undefined) await this.#checkCall(parent, fn, checking);
|
|
317
|
+
// a call made to check args never waits for anyone, so it can't wait for its system either
|
|
318
|
+
if (away && checking !== undefined) throw new RunRefused(refusal);
|
|
300
319
|
// a check's call that comes once the hub stopped waiting for it (its deadline passed) is never run unchecked
|
|
301
320
|
if (parent !== undefined && checking === undefined && input.key.startsWith(ARGS_CHECK_KEY_PREFIX)) {
|
|
302
321
|
throw new RunRefused(fnError('caller', `${parent.fn}'s args check is over, so its calls are no longer taken.`, CHECK_CALL_CODE));
|
|
@@ -342,6 +361,7 @@ export class HubRunService implements RunService, RunSettler, RunEvents, RunCost
|
|
|
342
361
|
...(repairs.length === 0 ? {} : { repairs: [...repairs] }),
|
|
343
362
|
...(test ? { test: true } : {}),
|
|
344
363
|
status: 'queued',
|
|
364
|
+
...(away ? { awaitingSystem: true } : {}),
|
|
345
365
|
allowed: { cancel: operations.cancel, pause: operations.pause, background: operations.background },
|
|
346
366
|
cost: 0,
|
|
347
367
|
totalCost: 0,
|
|
@@ -361,31 +381,139 @@ export class HubRunService implements RunService, RunSettler, RunEvents, RunCost
|
|
|
361
381
|
// what a call under an args check calls is held to the same rules, until it settles
|
|
362
382
|
if (checking !== undefined) this.#underCheck(id, settled);
|
|
363
383
|
|
|
384
|
+
// what follows asks the system (its args check, the files it would touch, a preview) and then the policies, so a
|
|
385
|
+
// run made while its system is away does it once the system connects
|
|
386
|
+
const admit = async (): Promise<boolean> => this.#admit({ input, fn, run, turn, parent, checking, early, args, connection });
|
|
387
|
+
if (away) {
|
|
388
|
+
this.#deps.log.info('run.awaiting-system', { run: id, fn: fn.name, system });
|
|
389
|
+
this.#awaitAdmission(run, fn, test, admit);
|
|
390
|
+
if (input.background) await this.background(id);
|
|
391
|
+
return { run: id, settled };
|
|
392
|
+
}
|
|
393
|
+
if (await admit() && input.background) await this.background(id);
|
|
394
|
+
return { run: id, settled };
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
/** Whether a fn is unavailable only because its system, which has connected before, isn't connected now. */
|
|
398
|
+
async #systemAway(fn: FnRecord): Promise<boolean> {
|
|
399
|
+
if (fn.available === true || fn.available.unavailable !== 'system-disconnected') return false;
|
|
400
|
+
const record = await this.#deps.store.table('systems').get(SystemName.parse(executingSystem(fn)));
|
|
401
|
+
return record?.status === 'disconnected';
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* Whether a waiting run's fn is still held only by its system: away, or just back and connected while the catalog
|
|
406
|
+
* hasn't yet worked out that its fns are available again (it does that after `system.status`, then says so with
|
|
407
|
+
* `catalog.changed`).
|
|
408
|
+
*/
|
|
409
|
+
async #systemComing(fn: FnRecord): Promise<boolean> {
|
|
410
|
+
if (fn.available === true || fn.available.unavailable !== 'system-disconnected') return false;
|
|
411
|
+
const record = await this.#deps.store.table('systems').get(SystemName.parse(executingSystem(fn)));
|
|
412
|
+
return record?.status === 'disconnected' || record?.status === 'connected';
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* A run made while its system was away (`awaitingSystem`) waits queued, and goes ahead (`admit`) as soon as its fn
|
|
417
|
+
* is available again: it looks when the system connects (`resend`), when the fn's availability changes
|
|
418
|
+
* (`catalog.changed`, which follows the connect) and every `HARNESS_RUN_SYSTEM_RECHECK`. Once it has waited
|
|
419
|
+
* `HARNESS_RUN_SYSTEM_WAIT` it fails with "<system> isn't connected" (`not-connected`), as a run whose system went
|
|
420
|
+
* away does. A fn blocked by something else once its system is back is refused then. Its call to a system whose
|
|
421
|
+
* store is still opening is held until the store is ready (`StoreService.hold`).
|
|
422
|
+
*/
|
|
423
|
+
#awaitAdmission(run: Run, fn: FnRecord, test: boolean, admit: () => Promise<boolean>): void {
|
|
424
|
+
const { clock, log, settings, catalog } = this.#deps;
|
|
425
|
+
const { HARNESS_RUN_SYSTEM_WAIT: wait, HARNESS_RUN_SYSTEM_RECHECK: recheck } = settings.execution;
|
|
426
|
+
const since = clock();
|
|
427
|
+
let timer: ReturnType<typeof setTimeout> | undefined;
|
|
428
|
+
let busy = false;
|
|
429
|
+
// `again`: a look asked for while one is under way (the connect's, then the catalog's) runs once that one is done
|
|
430
|
+
const state = { stopped: false, again: false };
|
|
431
|
+
const look = async (): Promise<void> => {
|
|
432
|
+
if (state.stopped) return;
|
|
433
|
+
if (busy) { state.again = true; return; }
|
|
434
|
+
busy = true;
|
|
435
|
+
try {
|
|
436
|
+
if (timer !== undefined) clearTimeout(timer);
|
|
437
|
+
timer = undefined;
|
|
438
|
+
const row = await this.#deps.store.table('runs').get(run.id);
|
|
439
|
+
if (row?.status !== 'queued' || row.awaitingSystem !== true) { this.#admitting.delete(run.id); return; }
|
|
440
|
+
const now = await catalog.fn(fn.name);
|
|
441
|
+
const ready = now !== undefined && (now.available === true || (test && await this.#testable(now)));
|
|
442
|
+
if (ready) {
|
|
443
|
+
this.#admitting.delete(run.id);
|
|
444
|
+
await this.#deps.store.table('runs').update(run.id, { awaitingSystem: false });
|
|
445
|
+
log.info('run.system-back', { run: run.id, system: run.system, waited: clock() - since });
|
|
446
|
+
await admit();
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
if (now === undefined || !await this.#systemComing(now)) {
|
|
450
|
+
this.#admitting.delete(run.id);
|
|
451
|
+
const detail = now === undefined ? 'it no longer exists' : now.available === true ? 'it is installed and waits for an admin to review it' : now.available.detail;
|
|
452
|
+
await this.settle(run.id, { status: 'failed', error: fnError('caller', `${fn.name} is unavailable: ${detail}`, 'unavailable') });
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
const waited = clock() - since;
|
|
456
|
+
if (waited >= wait) {
|
|
457
|
+
this.#admitting.delete(run.id);
|
|
458
|
+
log.warn('run.system-not-connected', { run: run.id, system: run.system, waited });
|
|
459
|
+
await this.settle(run.id, { status: 'failed', error: fnError('caller', `${run.system} isn't connected, so ${run.fn} couldn't run. Try again once it is back.`, 'not-connected') });
|
|
460
|
+
return;
|
|
461
|
+
}
|
|
462
|
+
// a look after a stop returns at once, so a timer set while one was under way does nothing
|
|
463
|
+
timer = setTimeout(() => { void look(); }, Math.max(1, Math.min(recheck, wait - waited)));
|
|
464
|
+
timer.unref();
|
|
465
|
+
} catch (error) {
|
|
466
|
+
this.#admitting.delete(run.id);
|
|
467
|
+
log.error('run.admit-failed', { run: run.id, error: messageOf(error) });
|
|
468
|
+
await this.settle(run.id, { status: 'failed', error: fnError('retry', messageOf(error), 'executor') }).catch(() => undefined);
|
|
469
|
+
} finally {
|
|
470
|
+
busy = false;
|
|
471
|
+
if (state.again) {
|
|
472
|
+
state.again = false;
|
|
473
|
+
if (this.#admitting.has(run.id)) void look();
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
};
|
|
477
|
+
this.#admitting.set(run.id, { fn: fn.name, look: () => { void look(); }, stop: () => { state.stopped = true; if (timer !== undefined) clearTimeout(timer); } });
|
|
478
|
+
void look();
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* The rest of a run's start, once its system can be asked: its args check, the files it would touch, the chat's fn
|
|
483
|
+
* mode, then the policies (run now, wait for approval, or refuse). False when that settled it.
|
|
484
|
+
*/
|
|
485
|
+
async #admit(at: {
|
|
486
|
+
readonly input: RunInput; readonly fn: FnRecord; readonly run: Run; readonly turn: Turn; readonly parent: Run | undefined;
|
|
487
|
+
readonly checking: 'check' | 'under' | undefined; readonly early: InvalidInput | undefined; readonly args: Json;
|
|
488
|
+
readonly connection: ReturnType<AccessScope['connection']>;
|
|
489
|
+
}): Promise<boolean> {
|
|
490
|
+
const { input, fn, run, turn, parent, checking, early, args, connection } = at;
|
|
491
|
+
const { id } = run;
|
|
364
492
|
// a fn that checks its own args (`FnDecl.check`) does so once the run exists, before anyone is asked
|
|
365
493
|
const invalid = early ?? await this.#argsCheck(run, fn, turn.user);
|
|
366
494
|
if (invalid !== undefined) {
|
|
367
495
|
// refused input never reaches the policies or the fn: the caller hears the problems and may try again
|
|
368
496
|
this.#deps.log.info('run.invalid-input', { run: id, fn: fn.name, source: invalid.source, problems: invalid.problems.length });
|
|
369
497
|
await this.settle(id, { status: 'invalid-input', invalid });
|
|
370
|
-
return
|
|
498
|
+
return false;
|
|
371
499
|
}
|
|
372
500
|
// a fn that touches files says first which sensitive ones the call would touch: a refusal stops it here
|
|
373
501
|
const flagged = fn.decl.flags === true ? await this.#flags(run, fn, turn.user) : { flags: [] };
|
|
374
502
|
if ('refused' in flagged) {
|
|
375
503
|
await this.settle(id, flagged.refused);
|
|
376
|
-
return
|
|
504
|
+
return false;
|
|
377
505
|
}
|
|
378
506
|
const sensitive = flagsVerdict(flagged.flags);
|
|
379
507
|
if (sensitive.effect === 'refuse') {
|
|
380
508
|
this.#deps.log.info('run.flags-refused', { run: id, fn: fn.name, flags: flagged.flags.length });
|
|
381
509
|
await this.settle(id, { status: 'invalid-input', invalid: { source: 'validation', problems: [{ path: '', message: sensitive.reason }] } });
|
|
382
|
-
return
|
|
510
|
+
return false;
|
|
383
511
|
}
|
|
384
512
|
// a chat's fn mode stands in front of the policies for the calls its agent makes
|
|
385
513
|
const mode = await this.#mode(run, fn, parent, flagged.flags);
|
|
386
514
|
if (mode.effect === 'refuse') {
|
|
387
515
|
await this.settle(id, { status: 'failed', error: fnError('caller', mode.reason, 'chat-mode') });
|
|
388
|
-
return
|
|
516
|
+
return false;
|
|
389
517
|
}
|
|
390
518
|
// the preview is asked for only when an approval is made; a refusal settles the run with the system's reason
|
|
391
519
|
const previewed: { refused?: OutcomeWire; ask?: ProposalAsk } = {};
|
|
@@ -430,8 +558,7 @@ export class HubRunService implements RunService, RunSettler, RunEvents, RunCost
|
|
|
430
558
|
} else {
|
|
431
559
|
this.#enqueue(run);
|
|
432
560
|
}
|
|
433
|
-
|
|
434
|
-
return { run: id, settled };
|
|
561
|
+
return true;
|
|
435
562
|
}
|
|
436
563
|
|
|
437
564
|
/** The fns of a run and the runs above it, nearest first (what a policy's `via` is matched against). */
|
|
@@ -723,7 +850,7 @@ export class HubRunService implements RunService, RunSettler, RunEvents, RunCost
|
|
|
723
850
|
async #execute(id: RunId, signal: AbortSignal): Promise<void> {
|
|
724
851
|
const { store, catalog, queues } = this.#deps;
|
|
725
852
|
const queued = await store.table('runs').get(id);
|
|
726
|
-
if (queued?.status !== 'queued') return;
|
|
853
|
+
if (queued?.status !== 'queued' || queued.awaitingSystem === true) return;
|
|
727
854
|
this.#jobs.delete(queued.id);
|
|
728
855
|
const fn = await catalog.fn(queued.fn);
|
|
729
856
|
if (fn === undefined) {
|
|
@@ -776,17 +903,44 @@ export class HubRunService implements RunService, RunSettler, RunEvents, RunCost
|
|
|
776
903
|
await this.settle(run.id, { status: 'cancelled' });
|
|
777
904
|
} else if (stopped?.how === 'pause') {
|
|
778
905
|
await this.settle(run.id, { status: 'paused', resume: run.resume ?? null });
|
|
779
|
-
} else if (
|
|
906
|
+
} else if (signal.aborted && signal.reason instanceof HubStopping) {
|
|
780
907
|
// The system may have started it, so it is sent again as a restart, with the child calls that finished.
|
|
781
908
|
this.#resumes.set(run.id, 'restart');
|
|
782
909
|
this.#deadlines.disarm(run.id);
|
|
783
910
|
await this.#moveTo(run, { status: 'queued' });
|
|
784
911
|
this.#deps.log.warn('run.system-gone', { run: run.id, system: run.system });
|
|
912
|
+
} else if (error instanceof SystemGone) {
|
|
913
|
+
await this.#awaitSystem(run);
|
|
785
914
|
} else {
|
|
786
915
|
await this.settle(run.id, { status: 'failed', error: error instanceof RunRefused ? error.error : fnError('retry', messageOf(error), 'executor') });
|
|
787
916
|
}
|
|
788
917
|
}
|
|
789
918
|
|
|
919
|
+
/**
|
|
920
|
+
* A run's system isn't connected (it went away, or the run was made while it was coming back). The run waits queued
|
|
921
|
+
* and goes ahead as soon as the system connects (`resend`); meanwhile it looks again every
|
|
922
|
+
* `HARNESS_RUN_SYSTEM_RECHECK`, and once the system has been away `HARNESS_RUN_SYSTEM_WAIT` it fails with
|
|
923
|
+
* "<system> isn't connected". It never waits silently. The system may have started it, so it is sent as a restart.
|
|
924
|
+
*/
|
|
925
|
+
async #awaitSystem(run: Run): Promise<void> {
|
|
926
|
+
const { clock, log, settings } = this.#deps;
|
|
927
|
+
const { HARNESS_RUN_SYSTEM_WAIT: wait, HARNESS_RUN_SYSTEM_RECHECK: recheck } = settings.execution;
|
|
928
|
+
const since = this.#gone.get(run.id) ?? clock();
|
|
929
|
+
const waited = clock() - since;
|
|
930
|
+
if (waited >= wait) {
|
|
931
|
+
this.#gone.delete(run.id);
|
|
932
|
+
log.warn('run.system-not-connected', { run: run.id, system: run.system, waited });
|
|
933
|
+
await this.settle(run.id, { status: 'failed', error: fnError('caller', `${run.system} isn't connected, so ${run.fn} couldn't run. Try again once it is back.`, 'not-connected') });
|
|
934
|
+
return;
|
|
935
|
+
}
|
|
936
|
+
this.#gone.set(run.id, since);
|
|
937
|
+
this.#resumes.set(run.id, 'restart');
|
|
938
|
+
this.#deadlines.disarm(run.id);
|
|
939
|
+
const queued = await this.#moveTo(run, { status: 'queued' });
|
|
940
|
+
log.warn('run.system-gone', { run: run.id, system: run.system, waited });
|
|
941
|
+
this.#enqueue(queued, Math.max(1, Math.min(recheck, wait - waited)));
|
|
942
|
+
}
|
|
943
|
+
|
|
790
944
|
async settle(id: RunId, outcome: OutcomeWire): Promise<void> {
|
|
791
945
|
if (this.#settling.has(id)) return;
|
|
792
946
|
this.#settling.add(id);
|
|
@@ -803,6 +957,7 @@ export class HubRunService implements RunService, RunSettler, RunEvents, RunCost
|
|
|
803
957
|
if (run === undefined || isSettled(run.status)) return;
|
|
804
958
|
// settled, paused or queued to retry: either way this attempt's deadline no longer applies
|
|
805
959
|
this.#deadlines.disarm(id);
|
|
960
|
+
this.#gone.delete(id);
|
|
806
961
|
const now = clock();
|
|
807
962
|
const cost = outcome.cost ?? 0;
|
|
808
963
|
const error = outcome.status === 'failed' || outcome.status === 'cancelled' ? outcome.error : undefined;
|
|
@@ -878,6 +1033,9 @@ export class HubRunService implements RunService, RunSettler, RunEvents, RunCost
|
|
|
878
1033
|
/** Stop every run in flight for a shutdown; each stays queued, to be sent again when its system is back. */
|
|
879
1034
|
drain(): void {
|
|
880
1035
|
this.#deadlines.clear();
|
|
1036
|
+
// a run waiting for its system stays queued; the next hub fails it when the system connects (`resend`)
|
|
1037
|
+
for (const waiting of this.#admitting.values()) waiting.stop();
|
|
1038
|
+
this.#admitting.clear();
|
|
881
1039
|
for (const controller of this.#running.values()) controller.abort(new HubStopping());
|
|
882
1040
|
}
|
|
883
1041
|
|
|
@@ -967,6 +1125,37 @@ export class HubRunService implements RunService, RunSettler, RunEvents, RunCost
|
|
|
967
1125
|
this.#publish(await this.#deps.store.table('runs').update(id, { progress }), { type: 'progress', progress });
|
|
968
1126
|
}
|
|
969
1127
|
|
|
1128
|
+
async updateResult(id: RunId, update: (current: Json, run: Run) => Promise<Json> | Json, by: ActorId): Promise<{ readonly run: Run; readonly result: Json }> {
|
|
1129
|
+
// one update of a run at a time: each reads the result the one before wrote
|
|
1130
|
+
const before = this.#resultUpdates.get(id) ?? Promise.resolve();
|
|
1131
|
+
const next = before.catch(() => undefined).then(() => this.#updateResult(id, update, by));
|
|
1132
|
+
const tail = next.then(() => undefined, () => undefined);
|
|
1133
|
+
this.#resultUpdates.set(id, tail);
|
|
1134
|
+
try {
|
|
1135
|
+
return await next;
|
|
1136
|
+
} finally {
|
|
1137
|
+
if (this.#resultUpdates.get(id) === tail) this.#resultUpdates.delete(id);
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
async #updateResult(id: RunId, update: (current: Json, run: Run) => Promise<Json> | Json, by: ActorId): Promise<{ readonly run: Run; readonly result: Json }> {
|
|
1142
|
+
const { store, catalog, clock, log } = this.#deps;
|
|
1143
|
+
const run = await this.get(id);
|
|
1144
|
+
if (run === undefined) throw new ResultUpdateRefused('not-found', `There is no run ${id}.`);
|
|
1145
|
+
if (run.status !== 'done' || run.outcome?.status !== 'done') throw new ResultUpdateRefused('not-done', `Run ${id} is ${run.status}; only a finished run's result can be updated.`);
|
|
1146
|
+
const result = await update(run.outcome.result, run);
|
|
1147
|
+
const fn = await catalog.fn(run.fn);
|
|
1148
|
+
if (fn !== undefined) {
|
|
1149
|
+
const problems = await catalog.check(fn.system, fn.decl.returns, result);
|
|
1150
|
+
if (problems.length > 0) throw new ResultUpdateRefused('invalid', `The new result of ${run.fn} doesn't fit its type: ${problems.join('; ')}`);
|
|
1151
|
+
}
|
|
1152
|
+
const revision = (run.resultRevision ?? 0) + 1;
|
|
1153
|
+
const updated = await store.table('runs').update(id, { outcome: { ...run.outcome, result }, resultRevision: revision, resultUpdatedAt: clock(), resultUpdatedBy: by });
|
|
1154
|
+
log.info('run.result.updated', { run: id, fn: run.fn, revision, by });
|
|
1155
|
+
this.#publish(updated, { type: 'result', revision });
|
|
1156
|
+
return { run: updated, result };
|
|
1157
|
+
}
|
|
1158
|
+
|
|
970
1159
|
async allow(id: RunId, operations: Partial<AllowedOperations>): Promise<void> {
|
|
971
1160
|
const run = await this.get(id);
|
|
972
1161
|
if (run === undefined || isSettled(run.status)) return;
|
|
@@ -1005,7 +1194,19 @@ export class HubRunService implements RunService, RunSettler, RunEvents, RunCost
|
|
|
1005
1194
|
async resend(system: string): Promise<void> {
|
|
1006
1195
|
const { store, log } = this.#deps;
|
|
1007
1196
|
for await (const run of rows(store.table('runs'), { where: { status: { in: ['running', 'queued'] } } })) {
|
|
1008
|
-
|
|
1197
|
+
// a run made while its system was away hasn't been put through the policies: it looks now, and is never queued
|
|
1198
|
+
// as it is; one whose wait a restart cut short fails, saying so (its caller is gone with the old hub)
|
|
1199
|
+
if (run.awaitingSystem === true && run.status === 'queued') {
|
|
1200
|
+
if (run.system !== system) continue;
|
|
1201
|
+
const look = this.#admitting.get(run.id);
|
|
1202
|
+
if (look !== undefined) { look.look(); continue; }
|
|
1203
|
+
log.warn('run.system-not-connected', { run: run.id, system: run.system, waited: null });
|
|
1204
|
+
await this.settle(run.id, { status: 'failed', error: fnError('caller', `${run.system} wasn't connected when ${run.fn} was asked for, and the hub restarted before it came back. Try again.`, 'not-connected') });
|
|
1205
|
+
continue;
|
|
1206
|
+
}
|
|
1207
|
+
// a run waiting for its system has a later look queued: it goes now instead (a second job for it stands aside)
|
|
1208
|
+
const waiting = run.system === system && this.#gone.delete(run.id);
|
|
1209
|
+
if (run.system !== system || run.kind === AGENT_KIND || this.#running.has(run.id) || (this.#jobs.has(run.id) && !waiting) || this.#executing.has(run.id)) continue;
|
|
1009
1210
|
if (run.status === 'running') this.#resumes.set(run.id, 'restart');
|
|
1010
1211
|
this.#enqueue(run.status === 'running' ? await store.table('runs').update(run.id, { status: 'queued' }) : run);
|
|
1011
1212
|
log.info('run.resent', { run: run.id, system });
|
|
@@ -185,7 +185,7 @@ export class TestCatalog implements Catalog {
|
|
|
185
185
|
if (content === undefined) return Promise.resolve(undefined);
|
|
186
186
|
const { system, local } = { system: name.slice(0, name.indexOf('/')), local: name.slice(name.indexOf('/') + 1) };
|
|
187
187
|
return Promise.resolve({
|
|
188
|
-
name, system: SystemName.parse(system), stale: false, updatedAt: 0, mentions: { context: [], fns: [] },
|
|
188
|
+
name, system: SystemName.parse(system), stale: false, updatedAt: 0, mentions: { context: [], fns: [] }, status: this.contextsOff.has(name) ? 'hidden' : 'active',
|
|
189
189
|
decl: { name: local, description: local, content, imports: [], fns: [], suggestFns: [], suggest: 'both', visible: 'both', tags: [], ...this.contextDecls.get(name) },
|
|
190
190
|
});
|
|
191
191
|
}
|
|
@@ -300,6 +300,7 @@ export class TestSystem {
|
|
|
300
300
|
paired: notHere, check: notHere, context: notHere, roots: notHere, list: notHere, stat: notHere, read: notHere, sections: notHere, watch: notHere,
|
|
301
301
|
content: notHere, hook: notHere, mentions: notHere, mentionHover: notHere, mentionText: notHere, event: notHere, action: notHere,
|
|
302
302
|
form: notHere, restart: notHere, stop: notHere, configure: notHere, export: notHere, estimate: notHere,
|
|
303
|
+
storeProbe: notHere, storeMove: notHere, storeMoveEnd: notHere, storeDiscard: notHere,
|
|
303
304
|
preview: ({ data }) => { this.previews.push(data); return this.behaviour.preview(data); },
|
|
304
305
|
flags: ({ data }) => { this.flagged.push(data); return this.behaviour.flags(data); },
|
|
305
306
|
claims: ({ data }) => { this.claimed.push(data); return this.behaviour.claims(data); },
|