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
package/packages/sdk/src/hub.ts
CHANGED
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
* `admin`). Each such fn's args and result are its endpoint's body and response: one source of truth.
|
|
10
10
|
*/
|
|
11
11
|
import {
|
|
12
|
-
ADMIN_TAG, adminSlice, AgentInjected, chatSlice, CONTENT_HASH_PATTERN, ChatModeConfig, contextorSlice, contextSlice, ContextorConfig, DETAIL_LEVELS, ERROR_CLASSES,
|
|
12
|
+
ADMIN_TAG, adminSlice, AgentInjected, chatSlice, CONTENT_HASH_PATTERN, ChatModeConfig, contextorSlice, contextReviewSlice, contextSlice, ContextorConfig, type ModelRole, DETAIL_LEVELS, ERROR_CLASSES,
|
|
13
13
|
graphSlice, injectionsSlice, versionsSlice, dataSlice, ContributionView, ReadTableArgs, ResultTable, RowActionsQuery, WidgetActionOption, mcpsSlice, metricsSlice, accessSlice, autoPairSlice, connectionsSlice, explorerSlice, suggestionsSlice, MintMcpTokenArgs, modelsSlice, OWN_TAG, packagingSlice, READ_TAG, resourcesSlice, ResourceOutlineArgs, ResourceSendArgs, ImageReadArgs, ImageReadResult, RUN_STATUSES, runsSlice,
|
|
14
14
|
FnLive, GinTypeDef, LIST_NAMES, querySlice, Section, settingsSlice, systemsSlice, LlmContentPart, ModelLimits, LINK_TARGET_KINDS, type Display,
|
|
15
|
-
FnBlock, FnExample, FnExamplesPage, FnExamplesQuery, FnRouting, FnSearchArgs, FnSearchPage, CtxSearchArgs, LoadContextResult, LoadFnsResult, ContextCrawlArgs, ContextCrawlResult, CRAWL_BATCH_MAX, NameRefusal, ShareRule, type RegistryEffect,
|
|
15
|
+
FnBlock, FnExample, FnExamplesPage, FnExamplesQuery, FnRouting, FnSearchArgs, FnSearchPage, CtxSearchArgs, LoadContextResult, LoadFnsResult, ContextCrawlArgs, ContextCrawlResult, CRAWL_BATCH_MAX, ContextPlanArgs, ContextPlan, ContextPlanGetArgs, ContextPlanView, ContextAnswerArgs, ContextAnswerResult, ContextPlanExpandArgs, PLAN_LIMIT_DEFAULTS, NameRefusal, ShareRule, type RegistryEffect,
|
|
16
16
|
type QualifiedName,
|
|
17
17
|
} from '@harness/core';
|
|
18
18
|
import { z } from 'zod';
|
|
19
19
|
import { CHAT_BASE, CHAT_SMALL_BASE } from './chat-prompt.ts';
|
|
20
|
-
import { fn, type FnExampleOf } from './fn.ts';
|
|
20
|
+
import { fn, linear, type FnExampleOf } from './fn.ts';
|
|
21
21
|
import { kind, mention, sectioner, type } from './declare.ts';
|
|
22
22
|
import { g, json, type GinType } from './gin.ts';
|
|
23
23
|
import { system } from './system.ts';
|
|
@@ -152,6 +152,11 @@ export const ADMIN_READ_ENDPOINTS = {
|
|
|
152
152
|
suggest_decision_get: suggestionsSlice.endpoints.suggestDecision,
|
|
153
153
|
search_decision_get: suggestionsSlice.endpoints.searchDecisions,
|
|
154
154
|
ctx_injections_list: injectionsSlice.endpoints.injections,
|
|
155
|
+
ctx_review: contextReviewSlice.endpoints.contextReview,
|
|
156
|
+
ctx_new_status_get: contextReviewSlice.endpoints.newContextStatus,
|
|
157
|
+
system_store: systemsSlice.endpoints.systemStore,
|
|
158
|
+
system_store_move_state: systemsSlice.endpoints.systemStoreMoveState,
|
|
159
|
+
system_store_backups: systemsSlice.endpoints.systemStoreBackups,
|
|
155
160
|
} as const satisfies Record<string, EndpointLike>;
|
|
156
161
|
|
|
157
162
|
/** An admin read fn's name. */
|
|
@@ -206,6 +211,14 @@ export const ADMIN_ENDPOINTS = {
|
|
|
206
211
|
auto_pair_revoke: autoPairSlice.endpoints.revokeAutoPair,
|
|
207
212
|
system_reimport: systemsSlice.endpoints.reimport,
|
|
208
213
|
ctx_injection_set: injectionsSlice.endpoints.setInjection,
|
|
214
|
+
ctx_status: contextReviewSlice.endpoints.setContextStatus,
|
|
215
|
+
ctx_merge: contextReviewSlice.endpoints.mergeContext,
|
|
216
|
+
ctx_not_duplicate: contextReviewSlice.endpoints.notDuplicate,
|
|
217
|
+
ctx_reextract: contextReviewSlice.endpoints.reextractContext,
|
|
218
|
+
ctx_new_status_set: contextReviewSlice.endpoints.setNewContextStatus,
|
|
219
|
+
system_store_move: systemsSlice.endpoints.systemStoreMove,
|
|
220
|
+
system_store_move_answer: systemsSlice.endpoints.systemStoreMoveAnswer,
|
|
221
|
+
system_store_backup_delete: systemsSlice.endpoints.systemStoreBackupDelete,
|
|
209
222
|
} as const satisfies Record<string, EndpointLike>;
|
|
210
223
|
|
|
211
224
|
/** An admin fn's name. */
|
|
@@ -230,7 +243,7 @@ type EndpointExample<E extends EndpointLike> = FnExampleOf<ToolArgs<E['cfg']['bo
|
|
|
230
243
|
* A fn for one web endpoint, its args and result read off the endpoint's body and response, so a system calling it
|
|
231
244
|
* gets the endpoint's types and a change to the endpoint's schema reaches every caller.
|
|
232
245
|
*/
|
|
233
|
-
function endpointFn<E extends EndpointLike>(description: string, instructions: string, endpoint: E, examples: EndpointExample<E>[], tags: readonly string[], display?: Display, registry: readonly RegistryEffect[] = []) {
|
|
246
|
+
function endpointFn<E extends EndpointLike>(description: string, instructions: string, endpoint: E, examples: EndpointExample<E>[], tags: readonly string[], display?: Display, registry: readonly RegistryEffect[] = [], roles: readonly ModelRole[] = []) {
|
|
234
247
|
return fn({
|
|
235
248
|
description,
|
|
236
249
|
instructions,
|
|
@@ -241,6 +254,8 @@ function endpointFn<E extends EndpointLike>(description: string, instructions: s
|
|
|
241
254
|
...(display === undefined ? {} : { display }),
|
|
242
255
|
// what it creates, updates or removes in the hub, so the chat and its mode know
|
|
243
256
|
...(registry.length === 0 ? {} : { effects: { registry: [...registry] } }),
|
|
257
|
+
// the model roles it needs: unavailable while one has no model
|
|
258
|
+
...(roles.length === 0 ? {} : { roles: [...roles] }),
|
|
244
259
|
});
|
|
245
260
|
}
|
|
246
261
|
|
|
@@ -265,10 +280,16 @@ function adminReadFn<E extends EndpointLike>(description: string, instructions:
|
|
|
265
280
|
}
|
|
266
281
|
|
|
267
282
|
/** A fn for an admin operation, tagged `admin`. */
|
|
268
|
-
function adminFn<E extends EndpointLike>(description: string, instructions: string, endpoint: E, examples: EndpointExample<E>[], registry: readonly RegistryEffect[] = []) {
|
|
269
|
-
return endpointFn(description, instructions, endpoint, examples, [ADMIN_TAG], undefined, registry);
|
|
283
|
+
function adminFn<E extends EndpointLike>(description: string, instructions: string, endpoint: E, examples: EndpointExample<E>[], registry: readonly RegistryEffect[] = [], roles: readonly ModelRole[] = []) {
|
|
284
|
+
return endpointFn(description, instructions, endpoint, examples, [ADMIN_TAG], undefined, registry, roles);
|
|
270
285
|
}
|
|
271
286
|
|
|
287
|
+
/**
|
|
288
|
+
* What the context Review fns tell the model about context as questions, once, so each fn's instructions can be short
|
|
289
|
+
* where they would otherwise repeat it.
|
|
290
|
+
*/
|
|
291
|
+
const CONTEXT_QUESTIONS_GUIDE = 'Context items are what the hub keeps for agents to read: guides that systems ship, memories people and agents saved, and pieces of documents. Each item is treated as the answer to one question (its `question`), with `when` saying when it is worth reading. Each has a status: `active` (in use), `hidden` (switched off by a person or merged away), `not_applicable` (a question a plan ruled out), `pending_approval` (new context from a system or a document waiting for an admin, when the admin setting asks for approval), `pending_removal` (its system or document dropped it; it keeps working until an admin confirms) or `pending_plan` (an open question of a plan). Only active and pending-removal items are searched and given to agents.';
|
|
292
|
+
|
|
272
293
|
/** The hub's read fns (`HUB_READ_ENDPOINTS`), each described for the agent that offers them. */
|
|
273
294
|
const readFns = {
|
|
274
295
|
resource_list: readFn('List resources (files, pages, uploads) from every system and the hub, filtered, grouped and paged.', 'Use it to browse what exists (the files of a root, the pages a crawl kept, the uploads of a session) when you know where to look; to find something by what it says use hub/search_resources. Filter by root, system or kind and page on rather than asking for everything.', HUB_READ_ENDPOINTS.resource_list, [{ args: { system: 'fs', under: 'file:///repo/docs', limit: 20 }, note: 'The first 20 files under one folder.' }, { args: { source: 'upload', group: 'date' }, note: 'Uploads, grouped by day.' }]),
|
|
@@ -380,8 +401,8 @@ const writeFns = {
|
|
|
380
401
|
resource_rename: writeFn('Rename a hub resource.', 'Use it when the person asks to rename a hub resource. Only hub resources (imports, uploads) can be renamed; a system\'s files are renamed through that system (fs).', HUB_WRITE_ENDPOINTS.resource_rename, [{ args: { uri: 'hub://resources/notes.md', name: 'meeting-notes.md' } }], [], changes('update', 'resources')),
|
|
381
402
|
resource_delete: writeFn('Delete a hub resource; says how many messages, context items and runs still point at it.', 'Use it only when the person asks to delete a hub resource. It reports how many messages, context items and runs still point at it: tell the person, since those links will show as gone.', HUB_WRITE_ENDPOINTS.resource_delete, [{ args: { uri: 'hub://resources/old.md' } }], [], changes('remove', 'resources')),
|
|
382
403
|
ctx_from_resource: writeFn('Make context items from a resource (one per section, under an outline parent), or update the ones made before.', 'Use it to turn a document the person wants kept as knowledge (a guide, a spec) into context items, one per section; run it again after the document changes to update them.', HUB_WRITE_ENDPOINTS.ctx_from_resource, [{ args: { uri: 'file:///repo/STYLE.md', copy: 'live', tags: ['style'] }, note: 'A style guide kept in step with its file.' }], [], [...changes('create', 'context'), ...changes('update', 'context')]),
|
|
383
|
-
remember: writeFn('Keep a fact for later as a memory (a context item): for this chat, for the person in all their chats, or for everyone.', 'Use it when the person asks you to remember something, and when they mention, even in passing while you work on something else, a lasting fact about themselves that will matter in a later chat (a preference, a limit or something to avoid, where they are, who is around them, a routine): keep it in the same step as the work and carry on. Not for what matters only to the task at hand, nor for each answer to a form or entry of a list. Choose `scope`: `session` (this chat only), `user` (the person, in every chat of theirs: the usual choice for a lasting fact about them) or `everyone` (only when they say so). One fact per memory, in a plain sentence, with a short `title`; never a password or other secret. Leave out the other args unless you need them: `about` links the memory to an item it is about (`{ "kind": "fn", "name": "database/main.tasks_create" }`; for a resource `{ "kind": "resource", "uri": … }`, with `section` only to point at one section); `command` (lower-case words joined by `-`) makes the memory the person\'s own `/command`: they type `/<command>` and its text comes with their message, a quick way to ask for something they will ask for again (then `text` is the request, in their words). In a later chat the memories closest to a message come with it (in `<loaded_for_you>`); others are found by search (hub/ctx_search with `origins: ["memory"]`). It answers with the memory\'s name.', HUB_WRITE_ENDPOINTS.remember, [{ args: { text: 'Reports go out on Fridays.', scope: 'user', title: 'Report day' }, note: 'A fact about the person, for every session of theirs.' }], [], changes('create', 'context')),
|
|
384
|
-
forget: writeFn('Forget a memory.', 'Use it when the person asks you to forget something, or a memory is wrong. Find the memory first (hub/ctx_search with `origins: ["memory"]`) and forget it by its name.', HUB_WRITE_ENDPOINTS.forget, [{ args: { name: 'memory/report-day-1a2b3c4d' } }], [], changes('update', 'context')),
|
|
404
|
+
remember: writeFn('Keep a fact for later as a memory (a context item): for this chat, for the person in all their chats, or for everyone.', 'Use it when the person asks you to remember something, and when they mention, even in passing while you work on something else, a lasting fact about themselves that will matter in a later chat (a preference, a limit or something to avoid, where they are, who is around them, a routine): keep it in the same step as the work and carry on. Not for what matters only to the task at hand, nor for each answer to a form or entry of a list. Choose `scope`: `session` (this chat only), `user` (the person, in every chat of theirs: the usual choice for a lasting fact about them) or `everyone` (only when they say so). One fact per memory, in a plain sentence, with a short `title`; never a password or other secret. You may give `question`, the question the fact answers ("Which day do reports go out?"), and `when`, the situations it matters in; when left out the hub writes them. Leave out the other args unless you need them: `about` links the memory to an item it is about (`{ "kind": "fn", "name": "database/main.tasks_create" }`; for a resource `{ "kind": "resource", "uri": … }`, with `section` only to point at one section); `command` (lower-case words joined by `-`) makes the memory the person\'s own `/command`: they type `/<command>` and its text comes with their message, a quick way to ask for something they will ask for again (then `text` is the request, in their words). In a later chat the memories closest to a message come with it (in `<loaded_for_you>`); others are found by search (hub/ctx_search with `origins: ["memory"]`). It answers with the memory\'s name.', HUB_WRITE_ENDPOINTS.remember, [{ args: { text: 'Reports go out on Fridays.', scope: 'user', title: 'Report day' }, note: 'A fact about the person, for every session of theirs.' }], [], changes('create', 'context')),
|
|
405
|
+
forget: writeFn('Forget a memory: it is hidden, so no search or agent finds it any more (an admin, or the person who wrote it, can restore it).', 'Use it when the person asks you to forget something, or a memory is wrong. Find the memory first (hub/ctx_search with `origins: ["memory"]`) and forget it by its name.', HUB_WRITE_ENDPOINTS.forget, [{ args: { name: 'memory/report-day-1a2b3c4d' } }], [], changes('update', 'context')),
|
|
385
406
|
} satisfies Record<HubWriteFnName, unknown>;
|
|
386
407
|
|
|
387
408
|
/** A person's write fns (`HUB_PERSON_ENDPOINTS`): each asks unless a policy allows it. */
|
|
@@ -431,6 +452,40 @@ const adminReadFns = {
|
|
|
431
452
|
{ args: { agent: 'hub/chat', fnMode: 'read' }, note: 'What the chat agent is told in a chat that may only read.' },
|
|
432
453
|
],
|
|
433
454
|
),
|
|
455
|
+
ctx_review: adminReadFn(
|
|
456
|
+
'The context Review queue: items that may say the same as another item (possible duplicates), items whose answers disagree with another item (contradictions), new items waiting for an admin\'s approval, and items whose system or document dropped them, waiting for an admin to confirm their removal. Each entry has the item (name, title, question, status and why, when it last changed, the start of its text), and for a duplicate or a contradiction the other item and the reason the decision model gave; the page also counts each kind.',
|
|
457
|
+
`${CONTEXT_QUESTIONS_GUIDE} Use it when an admin asks what needs reviewing in context, or before approving, hiding, merging or confirming removals. Give \`kinds\` to see one kind (\`duplicate\`, \`contradiction\`, \`pending_approval\`, \`pending_removal\`), \`systems\` for some systems' items; page with \`cursor\` set to \`next\`. Then act on what the admin decides: hub/ctx_status to approve, hide, restore or confirm a removal, hub/ctx_merge to keep one of two duplicates, hub/ctx_not_duplicate when two items flagged as duplicates are different. A possible duplicate is flagged on the older of the two items, pointing at the newer one.`,
|
|
458
|
+
ADMIN_READ_ENDPOINTS.ctx_review,
|
|
459
|
+
[
|
|
460
|
+
{ args: {}, note: 'Everything waiting for review, newest first, with the counts.' },
|
|
461
|
+
{ args: { kinds: ['duplicate', 'contradiction'] }, note: 'Only the items the decision model flagged.' },
|
|
462
|
+
{ args: { kinds: ['pending_approval'], systems: ['fs'] }, note: 'One system\'s new items waiting for approval.' },
|
|
463
|
+
],
|
|
464
|
+
),
|
|
465
|
+
ctx_new_status_get: adminReadFn(
|
|
466
|
+
'What new context from systems and from documents starts as: active (in use at once, the default), pending approval (an admin approves each item first) or hidden. Memories are always in use at once.',
|
|
467
|
+
`${CONTEXT_QUESTIONS_GUIDE} Use it to say how new context is handled, before changing it with hub/ctx_new_status_set.`,
|
|
468
|
+
ADMIN_READ_ENDPOINTS.ctx_new_status_get,
|
|
469
|
+
[{ args: {} }],
|
|
470
|
+
),
|
|
471
|
+
system_store: adminReadFn(
|
|
472
|
+
'A system\'s own store (its private database, for systems whose contract declares one): what it holds, where it lives (on the hub, with the system, or an external Postgres or SQL Server database), its state and migrations, its size, its backups and its current or last move.',
|
|
473
|
+
'Use it before moving a store or deleting a backup, or when a system says it is getting its storage ready. Name the instance for a system with several; without one it is the default instance. An external database\'s connection is never shown.',
|
|
474
|
+
ADMIN_READ_ENDPOINTS.system_store,
|
|
475
|
+
[{ args: { system: 'schedule' } }],
|
|
476
|
+
),
|
|
477
|
+
system_store_move_state: adminReadFn(
|
|
478
|
+
'How a system store\'s move stands: its phase (draining, waiting on runs, copying, switching, done or failed), the runs still going, tables and bytes copied so far, and why it failed.',
|
|
479
|
+
'Use it to follow a move started with hub/system_store_move. While it is `waiting`, runs are still going after a minute: ask the admin whether to cancel them or keep waiting, then answer with hub/system_store_move_answer.',
|
|
480
|
+
ADMIN_READ_ENDPOINTS.system_store_move_state,
|
|
481
|
+
[{ args: { system: 'schedule' } }],
|
|
482
|
+
),
|
|
483
|
+
system_store_backups: adminReadFn(
|
|
484
|
+
'A system store\'s backups, newest first: old copies moves left behind, and stores kept when their instance was removed (orphaned).',
|
|
485
|
+
'Use it before deleting a backup with hub/system_store_backup_delete. Without an instance it lists every instance\'s, removed ones too.',
|
|
486
|
+
ADMIN_READ_ENDPOINTS.system_store_backups,
|
|
487
|
+
[{ args: { system: 'schedule' } }],
|
|
488
|
+
),
|
|
434
489
|
};
|
|
435
490
|
|
|
436
491
|
/** The hub's admin fns (`ADMIN_ENDPOINTS`), each described for the agent that offers them. */
|
|
@@ -454,7 +509,7 @@ const adminFns = {
|
|
|
454
509
|
configure_system: adminFn('Set a system\'s config; refused unless it fits the system\'s config type.', 'Use it to set a system\'s config. Read its config type first (hub/system_get); secret fields are kept encrypted and never shown back.', ADMIN_ENDPOINTS.configure_system, [{ args: { system: 'database', config: { url: 'sqlite:./data.db' } } }]),
|
|
455
510
|
enable_system: adminFn('Turn a system\'s functions, its renderers and all of its context on or off.', 'Use it to turn a system\'s fns, renderers or all of its context on or off without removing it. To switch one fn or context item, use hub/switch_item.', ADMIN_ENDPOINTS.enable_system, [{ args: { system: 'web', functions: false }, note: 'Switch off its fns, keep its renderers.' }, { args: { system: 'fs', context: false }, note: 'Leave all of fs\'s context out of chats; its fns still work.' }], changes('update', 'fns', 'context')),
|
|
456
511
|
switch_item: adminFn('Turn one fn or context item of a system on or off.', 'Use it when an admin asks to switch a single fn or context item off or back on. A fn switched off cannot run; a context item switched off is never selected, searched or loaded. To switch a whole system, use hub/enable_system.', ADMIN_ENDPOINTS.switch_item, [{ args: { section: 'fns', name: 'fs/delete', on: false }, note: 'Stop fs/delete from running.' }, { args: { section: 'context', name: 'fs/guide', on: true }, note: 'Bring a context item back.' }], changes('update', 'fns', 'context')),
|
|
457
|
-
remove_system: adminFn('Remove a system; its fns become unavailable until it pairs again.', 'Use it only when an admin asks to remove a system; its fns stop working until it pairs again. To pause it, use hub/enable_system instead.', ADMIN_ENDPOINTS.remove_system, [{ args: { system: 'random' } }], changes('update', 'fns')),
|
|
512
|
+
remove_system: adminFn('Remove a system; its fns become unavailable until it pairs again. Its own store is kept unless `keepStore` is false.', 'Use it only when an admin asks to remove a system; its fns stop working until it pairs again. To pause it, use hub/enable_system instead. For a system with its own store, ask whether to keep it (the default: it is listed as a backup and picked up again if the system comes back) or delete it (`keepStore: false`); an external database is never dropped.', ADMIN_ENDPOINTS.remove_system, [{ args: { system: 'random' } }, { args: { system: 'schedule', keepStore: false }, note: 'Remove it and delete its store.' }], changes('update', 'fns')),
|
|
458
513
|
install_system: adminFn('Install a system from a folder, a package or a git repository, and start it.', 'Use it when an admin asks to install a system from a folder, a package or a git URL. It starts the system; pairing may still need approval.', ADMIN_ENDPOINTS.install_system, [{ args: { source: { package: '@acme/notes', version: '1.2.0' } } }], changes('create', 'fns', 'types', 'context', 'kinds', 'components')),
|
|
459
514
|
start_system: adminFn('Start an installed system.', 'Use it to start an installed system that is stopped, then check hub/system_get to see that it connected.', ADMIN_ENDPOINTS.start_system, [{ args: { system: 'fs' } }]),
|
|
460
515
|
stop_system: adminFn('Stop an installed system.', 'Use it to stop an installed system; its fns are unavailable until it starts again.', ADMIN_ENDPOINTS.stop_system, [{ args: { system: 'fs' } }]),
|
|
@@ -470,7 +525,7 @@ const adminFns = {
|
|
|
470
525
|
preview_mcp: adminFn('What draft hub MCP rules would expose now, with warnings, before they are saved.', 'Use it before saving hub MCP rules, to show the admin exactly what would be exposed and any warnings.', ADMIN_ENDPOINTS.preview_mcp, [{ args: { rules: { include: { systems: ['fs'] }, exclude: { fns: [{ fn: 'fs/bash' }] } } }, note: 'What an MCP with these rules would expose.' }]),
|
|
471
526
|
install_package: adminFn('Install a system package zip (made by `harness system pack`), pair it, configure it and start it.', 'Use it with a package zip made by `harness system pack`: it installs, pairs, configures and starts the system in one step.', ADMIN_ENDPOINTS.install_package, [{ args: { zip: { hash: '0000000000000000000000000000000000000000000000000000000000000000', size: 2048, mime: 'application/zip' } } }], changes('create', 'fns', 'types', 'context', 'kinds', 'components')),
|
|
472
527
|
add_instance: adminFn('Add an instance of a bundled fleet system (an MCP server, an API service) with its config: installed, paired and started on the hub machine.', 'Use it when an admin asks to add an MCP server or an API service. Ask for the secret fields only when the server needs them, and never repeat them back.', ADMIN_ENDPOINTS.add_instance, [{ args: { system: 'mcp', instance: 'linear', description: 'Linear issues', config: { label: 'Linear', transport: { type: 'http', url: 'https://mcp.linear.app/mcp' }, auth: { kind: 'oauth', per: 'person' } } }, note: 'A remote MCP server people sign in to.' }], changes('create', 'fns', 'types', 'context')),
|
|
473
|
-
remove_instance: adminFn('Remove one instance of a system.', 'Use it only when an admin asks to remove one instance of a system. Offer hub/export_system_data first so its data can be kept.', ADMIN_ENDPOINTS.remove_instance, [{ args: { system: 'database', instance: 'old' } }], changes('remove', 'fns', 'types')),
|
|
528
|
+
remove_instance: adminFn('Remove one instance of a system. Its own store is kept unless `keepStore` is false.', 'Use it only when an admin asks to remove one instance of a system. Offer hub/export_system_data first so its data can be kept. For a system with its own store, ask whether to keep the store (the default) or delete it (`keepStore: false`); an external database is never dropped.', ADMIN_ENDPOINTS.remove_instance, [{ args: { system: 'database', instance: 'old' } }], changes('remove', 'fns', 'types')),
|
|
474
529
|
suggest_decision_set: adminFn('Choose who picks what each message is offered: none (no model: the best by similarity over the threshold), a decision model (one yes/no question per candidate, the decide role\'s threshold), or an LLM; how many candidates it sees and picks; and a model\'s action: suggest (cards the chat model may load, the default) or load (what it picks is loaded for the turn: fns join the tools, context is brought into the message).', 'Use it when an admin wants a model to pick what each message is offered, or to let the score alone decide. An LLM needs a model; a decision model uses the decide role\'s unless one is named. Set action load only when the admin wants the picks loaded without the chat model asking; none (the score alone) only suggests, and context that doesn\'t fit the prompt\'s room is suggested instead.', ADMIN_ENDPOINTS.suggest_decision_set, [
|
|
475
530
|
{ args: { by: 'none' }, note: 'Let the score decide again.' },
|
|
476
531
|
{ args: { by: 'decision', messages: 3, candidates: 20, cap: 6, floor: 0.2 }, note: 'The decide role\'s decision model picks; its picks are suggested.' },
|
|
@@ -495,6 +550,66 @@ const adminFns = {
|
|
|
495
550
|
{ args: { agent: 'hub/chat', context: 'input/asking', on: true, order: null }, note: 'Back on, at its own order.' },
|
|
496
551
|
],
|
|
497
552
|
),
|
|
553
|
+
ctx_status: adminFn(
|
|
554
|
+
'Change the status of up to 200 context items at once, with a reason kept in each item\'s history: approve (an item waiting for approval goes into use), hide (switch an item off), restore (a hidden, ruled-out or pending-removal item goes back into use; for pending removal this rejects the removal) or confirm_removal (an item waiting for removal is removed for good, with its links).',
|
|
555
|
+
`${CONTEXT_QUESTIONS_GUIDE} Use it when an admin decides what to do with items in Review (hub/ctx_review) or on the Context page: give the items' names exactly as a search or Review gave them, the \`action\`, and a short \`reason\` in the admin's words when they give one (it is shown in the item's history). confirm_removal cannot be undone. Items an action doesn't fit (approving an item that isn't waiting for approval) are left as they are and listed in \`skipped\` with why; say those back.`,
|
|
556
|
+
ADMIN_ENDPOINTS.ctx_status,
|
|
557
|
+
[
|
|
558
|
+
{ args: { names: ['fs/guide.setup', 'fs/guide.paths'], action: 'approve' }, note: 'Two new items of a system go into use.' },
|
|
559
|
+
{ args: { names: ['memory/old-address-1a2b3c4d'], action: 'hide', reason: 'Out of date.' }, note: 'Switch an item off, saying why.' },
|
|
560
|
+
{ args: { names: ['resource/handbook-leave-9f8e7d6c'], action: 'confirm_removal' }, note: 'The document no longer has that section: remove its item.' },
|
|
561
|
+
],
|
|
562
|
+
[...changes('update', 'context'), ...changes('remove', 'context')],
|
|
563
|
+
),
|
|
564
|
+
ctx_merge: adminFn(
|
|
565
|
+
'Merge two context items that say the same thing: keep one, point the links that people drew to the other and the mentions of it at the kept one, move its own drawn links to the kept one, and hide the other (it can be restored with hub/ctx_status).',
|
|
566
|
+
`${CONTEXT_QUESTIONS_GUIDE} Use it when an admin decides two items flagged as duplicates (hub/ctx_review) are the same and says which to keep; when unsure which, keep the newer or the more complete one and say so. Nothing is deleted: the merged-away item is hidden with the reason given (or "Merged into …").`,
|
|
567
|
+
ADMIN_ENDPOINTS.ctx_merge,
|
|
568
|
+
[{ args: { keep: 'memory/report-day-1a2b3c4d', drop: 'memory/reports-friday-5e6f7a8b' }, note: 'Keep the newer memory, hide the older one.' }],
|
|
569
|
+
changes('update', 'context'),
|
|
570
|
+
),
|
|
571
|
+
ctx_not_duplicate: adminFn(
|
|
572
|
+
'Tell the hub that two context items flagged as possible duplicates are different: the flag is cleared and the pair is remembered, so the check never flags them again.',
|
|
573
|
+
`${CONTEXT_QUESTIONS_GUIDE} Use it when an admin looks at a possible duplicate in Review (hub/ctx_review) and says the two items are about different things. Give the flagged item as \`name\` and the other as \`of\`, as Review lists them.`,
|
|
574
|
+
ADMIN_ENDPOINTS.ctx_not_duplicate,
|
|
575
|
+
[{ args: { name: 'fs/guide.paths', of: 'memory/project-paths-2b3c4d5e' } }],
|
|
576
|
+
changes('update', 'context'),
|
|
577
|
+
),
|
|
578
|
+
ctx_reextract: adminFn(
|
|
579
|
+
'Fill the metadata of up to 20 context items again now with the metadata model: the question each answers, when it is worth reading, who would ask it, and when its answer should be checked again; an item that answers several separate questions is split into one item per question (the original is hidden so its text doesn\'t show twice). Each item is then checked again for duplicates and contradictions when a decision model is set.',
|
|
580
|
+
`${CONTEXT_QUESTIONS_GUIDE} The hub fills metadata in the background for memories and items made from documents; use this when an admin asks to redo an item's question now, or to fill a system's own item (which the background work leaves alone unless it was split before). It answers, per item, the fields filled and the items it was split into, or why it couldn't (no metadata model set, no text).`,
|
|
581
|
+
ADMIN_ENDPOINTS.ctx_reextract,
|
|
582
|
+
[{ args: { names: ['memory/report-day-1a2b3c4d'] } }, { args: { names: ['fs/guide.setup'] }, note: 'A system\'s own item: split into one item per question when it answers several.' }],
|
|
583
|
+
[...changes('update', 'context'), ...changes('create', 'context')],
|
|
584
|
+
['metadata'],
|
|
585
|
+
),
|
|
586
|
+
ctx_new_status_set: adminFn(
|
|
587
|
+
'Choose what new context from systems and from documents starts as: active (in use at once, the default), pending_approval (each new item waits in Review until an admin approves it) or hidden (off until an admin restores it). Items that exist keep their status; memories are always in use at once.',
|
|
588
|
+
`${CONTEXT_QUESTIONS_GUIDE} Use it when an admin wants to check new context before agents see it (pending_approval), or to have it all in use at once again (active). Say back what it means for new items.`,
|
|
589
|
+
ADMIN_ENDPOINTS.ctx_new_status_set,
|
|
590
|
+
[{ args: { value: 'pending_approval' }, note: 'New items wait for approval in Review.' }, { args: { value: 'active' } }],
|
|
591
|
+
),
|
|
592
|
+
system_store_move: adminFn(
|
|
593
|
+
'Move a system\'s own store to another place: on the hub, with the system, or an external Postgres or SQL Server database (its connection kept encrypted). Calls to the system wait while it moves, and the old copy is kept as a backup.',
|
|
594
|
+
'Use it only when an admin asks to move a system\'s store; read it first with hub/system_store. It is refused before anything changes when the store can\'t go there, and says why. The system\'s work waits during the move (up to two minutes per call); runs still going get a minute to finish, then the move asks (`runs: "ask"`, the default) or cancels them (`"cancel"`) or keeps waiting (`"wait"`): use `"cancel"` only when the admin said so. Follow it with hub/system_store_move_state. Never repeat an external connection back.',
|
|
595
|
+
ADMIN_ENDPOINTS.system_store_move,
|
|
596
|
+
[
|
|
597
|
+
{ args: { system: 'schedule', to: { placement: 'hub' } }, note: 'Keep the store on the hub, in its backups.' },
|
|
598
|
+
{ args: { system: 'schedule', to: { placement: 'external', engine: 'postgres', connection: 'postgres://user:pass@db:5432/harness', schema: 'schedule' } }, note: 'Into a Postgres schema of its own.' },
|
|
599
|
+
],
|
|
600
|
+
),
|
|
601
|
+
system_store_move_answer: adminFn(
|
|
602
|
+
'Answer a store move that waits on runs still going: cancel them, or keep waiting until they finish.',
|
|
603
|
+
'Use it only with the admin\'s answer, when hub/system_store_move_state says the move is `waiting`. Cancelling stops those runs part-way; say which runs they are first.',
|
|
604
|
+
ADMIN_ENDPOINTS.system_store_move_answer,
|
|
605
|
+
[{ args: { system: 'schedule', answer: 'wait' } }],
|
|
606
|
+
),
|
|
607
|
+
system_store_backup_delete: adminFn(
|
|
608
|
+
'Delete one backup of a system\'s store: an old copy a move left, or a store kept when its instance was removed.',
|
|
609
|
+
'Use it only when an admin asks to delete a backup; list them with hub/system_store_backups. A deleted backup can\'t be brought back. An external database is never dropped: deleting an external backup only takes it off the list, and the tables stay in their schema.',
|
|
610
|
+
ADMIN_ENDPOINTS.system_store_backup_delete,
|
|
611
|
+
[{ args: { system: 'schedule', backup: '2026-11-28t10-00-00-000z-1a2b3c.db' } }],
|
|
612
|
+
),
|
|
498
613
|
} satisfies Record<AdminFnName, unknown>;
|
|
499
614
|
|
|
500
615
|
/** Which model an agent or an LLM call uses: a model id, a category, or automatic selection by weights. */
|
|
@@ -643,6 +758,7 @@ const FNS_SEARCH_EXAMPLES = [
|
|
|
643
758
|
const CTX_SEARCH_GUIDE = [
|
|
644
759
|
'It searches context (guides, memories, pieces of files) of every system you can use; fns are found with hub/fns_search. Use it for a system\'s guide before you first use the system, or for memories about the person.',
|
|
645
760
|
'Put what you need in plain words in `text`; narrow only when you know how (`origins: ["memory"]` for what was remembered). Hits come best first; keep only those whose description fits. Page with `offset` set to `next`.',
|
|
761
|
+
'Each item is kept as the answer to one question: a hit says its `question`, and its `answer` in short when it has one, so you may not need to load it. Meaning is compared with the questions; ask in plain words, as a question if you like. Set `semanticOver: "content"` only to match words you expect inside an item\'s text. A hit with `status: "pending_removal"` still works but its source dropped it; `returnNotApplicable: true` also finds questions a plan ruled out, each with why (`statusReason`).',
|
|
646
762
|
'Load a hit with hub/ctx_load. A hit with `inPrompt` is in front of you already (`injected`: in your instructions; `loaded`: loaded in this chat), so don\'t load it again. When the page has `loaded`, the hub loaded those hits for you.',
|
|
647
763
|
'When you know an item\'s exact name (a system\'s guide is `<system>/guide`), give it in `names` (or as the text): an item named exactly always comes back first, marked `exact`, whatever the other filters; a name nothing you may use has is listed in `missing`.',
|
|
648
764
|
].join(' ');
|
|
@@ -666,6 +782,47 @@ const CONTEXT_CRAWL_GUIDE = [
|
|
|
666
782
|
'Without `metadataOnly` what it took is loaded into this session like hub/ctx_load, its text in front of you from your next step. With `metadataOnly: true` nothing is loaded: you get each item\'s key, title, description and size, and load what fits with hub/ctx_load.',
|
|
667
783
|
].join(' ');
|
|
668
784
|
|
|
785
|
+
/** The longest a planning run may take: the most minutes a plan may ask for, and a little to write the result. */
|
|
786
|
+
const CONTEXT_PLAN_TIMEOUT = 125 * 60_000;
|
|
787
|
+
|
|
788
|
+
/** What a plan is, for the model: told once in every plan fn, so each makes sense on its own. */
|
|
789
|
+
const CONTEXT_PLAN_SHAPE = [
|
|
790
|
+
'A plan is a decision tree the hub keeps for a request: the questions that must be answered before the work can be planned, each with its options, and under each option the questions choosing it would raise.',
|
|
791
|
+
'Every question is a context item of its own (named like `hub/plan.q-1a2b3c4d`), so a question asked anywhere else (by another branch, or another plan) is the same item and appears once; a question can therefore sit under several options.',
|
|
792
|
+
'Each question says who would answer it (`askedBy`: `person` for the person\'s own choices, `system` for how software or the harness should be set up, `research` for facts that can be looked up), its options (`o1`, `o2`, … with a label and what choosing it means), which options were picked, the person\'s own words, and its status: `pending_plan` (open, waiting for an answer), `active` (answered: agents can find the answer by searching context), or `not_applicable` (ruled out because an option above it was not picked, with the reason in `statusReason`).',
|
|
793
|
+
'`counts` says how many questions are answered, open and ruled out, and `decide`: the open questions nothing undecided sits above, which are the decisions to make now.',
|
|
794
|
+
'`stop` says why planning stopped: `complete` (every question has its options) or a limit (`open_questions`, `depth`, `time`, `cost`); an option with `later` lists questions a limit kept out, which hub/ctx_plan_expand adds.',
|
|
795
|
+
].join(' ');
|
|
796
|
+
|
|
797
|
+
/** How `hub/ctx_plan` works, for the model. */
|
|
798
|
+
const CONTEXT_PLAN_GUIDE = [
|
|
799
|
+
'Use it when a request is too open to act on at once: something to set up, build, change or decide where several choices depend on each other, and you would otherwise ask the person a long list of questions or guess.',
|
|
800
|
+
'Give `description` as the request in the person\'s words, with everything they said about it (goals, limits, what exists already): the questions are only as good as the description.',
|
|
801
|
+
'It works in steps. First the plan model lists every question that must be answered at the request\'s level before a plan can be made: questions for the person, questions about how the systems should be set up, and things that could be researched.',
|
|
802
|
+
'Each question is then matched against the context the hub already keeps, by search and the decision model: a question already answered there is reused with its answer, and one asked before (by another plan) is the same item, so nothing is asked twice.',
|
|
803
|
+
'Then, for each open question, the plan model writes its options and, for each option, the questions that choosing it would raise; those join the plan one level deeper, and so on, breadth first.',
|
|
804
|
+
`It stops at the first limit reached: \`openQuestions\` (default ${PLAN_LIMIT_DEFAULTS.openQuestions}), \`depth\` (default ${PLAN_LIMIT_DEFAULTS.depth} levels), \`minutes\` (default ${PLAN_LIMIT_DEFAULTS.minutes}) or \`cost\` in US dollars (default ${PLAN_LIMIT_DEFAULTS.cost}). Set smaller limits for a small request. It runs in the background after a short wait and its card shows how far it got.`,
|
|
805
|
+
CONTEXT_PLAN_SHAPE,
|
|
806
|
+
'The plan shows as a card in the chat (answered · open · decisions to make now). The person opens it to pick options, write their own detail and plan deeper; you do not need to repeat the questions in your reply. Say in a sentence or two what the plan covers and which decisions come first, then wait for the person, and read it again with hub/ctx_plan_get before you act on it.',
|
|
807
|
+
].join(' ');
|
|
808
|
+
|
|
809
|
+
/** How `hub/ctx_answer` works, for the model. */
|
|
810
|
+
const CONTEXT_ANSWER_GUIDE = [
|
|
811
|
+
CONTEXT_PLAN_SHAPE,
|
|
812
|
+
'Use it when the person gives you answers to questions of a plan in the chat instead of on its card: give the plan\'s `run` and, for each question (by its context name, as the plan gives it), the options they chose in `picked` (by id such as `o2`, or by label; several when more than one applies) and their own words in `text` when they said more than the option (a detail, a condition, or an answer none of the options gives).',
|
|
813
|
+
'An answered question becomes an active context item whose text is its options with the picks marked and the person\'s words, so agents find the decision later by searching context. Questions that sit only under options not picked are ruled out (`not_applicable`) with a reason written for them (You chose "X" for \'Which …?\'); give `reasons` when the person says in their own words why a ruled-out question doesn\'t apply.',
|
|
814
|
+
'Changing an answer brings back the questions under the newly picked options; `deeper` lists the questions under them that have no options yet: offer to plan deeper there (hub/ctx_plan_expand). Picks the question doesn\'t have are listed in `skipped`: say those back. `picked` empty with no `text` clears an answer. Only record what the person said; never answer for them.',
|
|
815
|
+
].join(' ');
|
|
816
|
+
|
|
817
|
+
/** How `hub/ctx_plan_expand` works, for the model. */
|
|
818
|
+
const CONTEXT_PLAN_EXPAND_GUIDE = [
|
|
819
|
+
CONTEXT_PLAN_SHAPE,
|
|
820
|
+
'Use it when the person wants more detail under part of a plan ("plan deeper here"), when a plan stopped at a limit and should go on, or after an answer changed and the questions under it should take the new answer into account.',
|
|
821
|
+
'Give the plan\'s `run` and `under`, the question to plan under (leave it out to go on with the whole plan). It writes options for the open questions under it that have none yet, adds the questions a limit kept out (`later`), and goes on breadth first, within `limits` of its own (the same defaults as hub/ctx_plan). Its `depth` is counted from the question it plans under, not from the first questions: `depth: 1` under a question on the second level adds only the questions right under it (the third level), and `depth: 3` there may reach the fifth. Without `under`, `depth` is counted from the deepest level that already has options.',
|
|
822
|
+
'With `replan: true` it first writes the options of the open questions under it again, given the answers above them now; questions that no longer come up drop out of the plan. Answered questions keep their answers.',
|
|
823
|
+
'It updates the same plan: its card in the chat shows the new questions as soon as it is done.',
|
|
824
|
+
].join(' ');
|
|
825
|
+
|
|
669
826
|
/** The hub's contract as declared (`hub` adds the refs to its own context items). */
|
|
670
827
|
const hubContract = system('hub', {
|
|
671
828
|
description: 'The hub: search and load fns and context, follow runs, ask people, and run agents.',
|
|
@@ -839,6 +996,61 @@ const hubContract = system('hub', {
|
|
|
839
996
|
// it asks the decision model which links to follow: off until an admin sets the decide role
|
|
840
997
|
roles: ['decide'],
|
|
841
998
|
}),
|
|
999
|
+
ctx_plan: fn({
|
|
1000
|
+
description: 'Turn a request into a decision tree of the questions that must be answered before it can be planned: each question with its options, and the questions each option raises if it is chosen. The person answers it on the plan\'s card.',
|
|
1001
|
+
instructions: CONTEXT_PLAN_GUIDE,
|
|
1002
|
+
examples: [
|
|
1003
|
+
{ args: { description: 'Move the team\'s weekly report from a shared spreadsheet into an app that fills itself in.' }, note: 'A plan within the default limits (60 open questions, 6 levels, 10 minutes, $2).' },
|
|
1004
|
+
{ args: { description: 'Add sign-in with a work account to the internal dashboard.', limits: { openQuestions: 20, depth: 3 } }, note: 'A smaller plan: at most 20 open questions, 3 levels deep.' },
|
|
1005
|
+
],
|
|
1006
|
+
args: ginAs(ContextPlanArgs),
|
|
1007
|
+
returns: ginAs(ContextPlan),
|
|
1008
|
+
progress: linear,
|
|
1009
|
+
// it only adds open questions, which no model sees until a person answers them
|
|
1010
|
+
tags: [READ_TAG],
|
|
1011
|
+
display: 'card',
|
|
1012
|
+
limits: { timeout: CONTEXT_PLAN_TIMEOUT },
|
|
1013
|
+
// the plan model writes the questions and options, the decision model matches them with context already kept
|
|
1014
|
+
roles: ['plan', 'decide'],
|
|
1015
|
+
}),
|
|
1016
|
+
ctx_plan_get: fn({
|
|
1017
|
+
description: 'A plan made by hub/ctx_plan as it is now (its questions, options, answers and what is ruled out), or the same as markdown.',
|
|
1018
|
+
instructions: `${CONTEXT_PLAN_SHAPE} Use it to see what the person has answered since the plan was made (they answer on its card, so the plan changes without you), before you plan the work itself, or to give the person the plan as text (\`format: "markdown"\`). \`run\` is the id of the hub/ctx_plan run that made it.`,
|
|
1019
|
+
examples: [{ args: { run: 'run_01HZX3' }, note: 'The plan with its answers so far.' }, { args: { run: 'run_01HZX3', format: 'markdown' }, note: 'The plan as markdown, to share.' }],
|
|
1020
|
+
args: ginAs(ContextPlanGetArgs),
|
|
1021
|
+
returns: ginAs(ContextPlanView),
|
|
1022
|
+
tags: [READ_TAG],
|
|
1023
|
+
display: 'hidden',
|
|
1024
|
+
}),
|
|
1025
|
+
ctx_answer: fn({
|
|
1026
|
+
description: 'Answer questions of a plan made by hub/ctx_plan: pick one or more options of each, with the person\'s own words. Questions under options not picked are ruled out, each with the reason.',
|
|
1027
|
+
instructions: CONTEXT_ANSWER_GUIDE,
|
|
1028
|
+
examples: [
|
|
1029
|
+
{ args: { run: 'run_01HZX3', answers: [{ question: 'hub/plan.q-1a2b3c4d', picked: ['o2'], text: 'Only for the people on the team.' }] }, note: 'One answer, with the person\'s words.' },
|
|
1030
|
+
{ args: { run: 'run_01HZX3', answers: [{ question: 'hub/plan.q-5e6f7a8b', picked: ['o1', 'o3'] }] }, note: 'Two options that both apply.' },
|
|
1031
|
+
{ args: { run: 'run_01HZX3', reasons: [{ question: 'hub/plan.q-9c0d1e2f', reason: 'Handled by another team.' }] }, note: 'The person\'s own reason a ruled-out question doesn\'t apply.' },
|
|
1032
|
+
],
|
|
1033
|
+
args: ginAs(ContextAnswerArgs),
|
|
1034
|
+
returns: ginAs(ContextAnswerResult),
|
|
1035
|
+
display: 'hidden',
|
|
1036
|
+
effects: { registry: [{ thing: 'context', action: 'update' }] },
|
|
1037
|
+
}),
|
|
1038
|
+
ctx_plan_expand: fn({
|
|
1039
|
+
description: 'Plan deeper: go on with a plan made by hub/ctx_plan under one of its questions (or the whole plan) with limits of its own, or write the options under a question again after its answer changed.',
|
|
1040
|
+
instructions: CONTEXT_PLAN_EXPAND_GUIDE,
|
|
1041
|
+
examples: [
|
|
1042
|
+
{ args: { run: 'run_01HZX3', under: 'hub/plan.q-1a2b3c4d' }, note: 'Plan deeper under one question, within the default limits.' },
|
|
1043
|
+
{ args: { run: 'run_01HZX3', under: 'hub/plan.q-1a2b3c4d', replan: true, limits: { depth: 2 } }, note: 'Its answer changed: write the options under it again, two levels deep.' },
|
|
1044
|
+
{ args: { run: 'run_01HZX3', limits: { minutes: 5 } }, note: 'Go on with the whole plan where it stopped, for five more minutes.' },
|
|
1045
|
+
],
|
|
1046
|
+
args: ginAs(ContextPlanExpandArgs),
|
|
1047
|
+
returns: ginAs(ContextPlanView),
|
|
1048
|
+
progress: linear,
|
|
1049
|
+
tags: [READ_TAG],
|
|
1050
|
+
display: 'card',
|
|
1051
|
+
limits: { timeout: CONTEXT_PLAN_TIMEOUT },
|
|
1052
|
+
roles: ['plan', 'decide'],
|
|
1053
|
+
}),
|
|
842
1054
|
search_resources: fn({
|
|
843
1055
|
description: 'Search files and other resources by meaning and words.',
|
|
844
1056
|
instructions: 'Use it to find files, pages and uploads by what they say, across every system. Give a plain description of what you look for; narrow to roots (a folder\'s uri, a crawl) when you know them. Each hit has a section and a preview: read the best with hub/resource_read rather than guessing from the preview.',
|
package/packages/sdk/src/impl.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** The implementation shapes a system's server writes, computed from what its contract declares. */
|
|
2
2
|
import type { ToolClaims } from '@aeye/core';
|
|
3
3
|
import type { PreviewAnswer, SensitivityFlag, UndoOutcome } from '@harness/core';
|
|
4
|
-
import type { CheckCtx, CheckProblems, ClaimsCtx, FnCtx, Own, PreviewCtx, UndoCtx } from './ctx.ts';
|
|
4
|
+
import type { AnyOwn, CheckCtx, CheckProblems, ClaimsCtx, FnCtx, Own, PreviewCtx, UndoCtx } from './ctx.ts';
|
|
5
5
|
import type { FnCheckTypes, FnTypes, Outcome } from './fn.ts';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -24,7 +24,7 @@ export type CheckImpl<T extends FnTypes, Cfg = unknown> =
|
|
|
24
24
|
* that clash run one after another. `check` exactly when it declares `check`: what is wrong with a call's args beyond
|
|
25
25
|
* their type, asked by the hub before the policies and any approval.
|
|
26
26
|
*/
|
|
27
|
-
export type FnImpl<T extends FnTypes, Cfg = unknown, O extends
|
|
27
|
+
export type FnImpl<T extends FnTypes, Cfg = unknown, O extends AnyOwn = Own> =
|
|
28
28
|
{
|
|
29
29
|
run(args: T['args'], ctx: FnCtx<T, Cfg, O>): Promise<Outcome<T>>;
|
|
30
30
|
preview?(args: T['args'], ctx: PreviewCtx<Cfg, O>): Promise<PreviewAnswer>;
|
|
@@ -32,4 +32,4 @@ export type FnImpl<T extends FnTypes, Cfg = unknown, O extends Own = Own> =
|
|
|
32
32
|
claims?(args: T['args'], ctx: ClaimsCtx<Cfg, O>): ToolClaims | Promise<ToolClaims>;
|
|
33
33
|
} &
|
|
34
34
|
CheckImpl<T, Cfg> &
|
|
35
|
-
([T['undo']] extends [never] ? { undo?: never } : { undo(payload: T['undo'], ctx: UndoCtx<Cfg>): Promise<UndoOutcome> });
|
|
35
|
+
([T['undo']] extends [never] ? { undo?: never } : { undo(payload: T['undo'], ctx: UndoCtx<Cfg, O['store']>): Promise<UndoOutcome> });
|
|
@@ -40,13 +40,16 @@ export {
|
|
|
40
40
|
type Llm, type Files, type Resources, type Types, type Log, type Services, type SystemCtx, type SessionState, type Settled, type CallOptions, type Caller,
|
|
41
41
|
type Callers, type FnCall, type BudgetInfo, type Resume, type FnCtx, type UndoCtx, type ValidateCtx, type AskerCtx, type ActionCtx, type RunStatusView, type SystemPlace,
|
|
42
42
|
type Data, type StoredRecord, type StoredType, type RecordFind,
|
|
43
|
-
type ForwardModality, type ModelInput, type ModelOutput, type PreviewCtx, type ClaimsCtx, type CheckCtx, type CheckProblems, type Proposals, type ProposeOptions, type Decisions, type DecideOptions, type Fleets, type FnSearch, type AiSource, type AdminNotices, type InstanceConnects,
|
|
44
|
-
type Own, type PayloadOf, type KindFn, type KindRuns, type StartAsOwner, type Notice, type NoticeLink, type OwnerRuns, type RunNotices,
|
|
43
|
+
type ForwardModality, type ModelInput, type ModelOutput, type PreviewCtx, type ClaimsCtx, type CheckCtx, type CheckProblems, type Proposals, type ProposeOptions, type Decisions, type DecideOptions, type Fleets, type FnSearch, type AiSource, type AdminNotices, type ResultUpdates, type InstanceConnects,
|
|
44
|
+
type Own, type AnyOwn, type PayloadOf, type KindFn, type KindRuns, type StartAsOwner, type Notice, type NoticeLink, type OwnerRuns, type RunNotices,
|
|
45
45
|
} from './ctx.ts';
|
|
46
46
|
export { ResultBlock, ResultBlockType, ResultColumnInfo, ResultFn, NextPage } from './results.ts';
|
|
47
47
|
export type { CheckImpl, FnImpl } from './impl.ts';
|
|
48
48
|
export type { ProvidedBytes, ProvidedRead, ResourceProvider } from './resources.ts';
|
|
49
49
|
export { provider, providerDecl, type ProviderDef, type ProviderInput, type ProviderImpl } from './providers.ts';
|
|
50
|
+
export {
|
|
51
|
+
store, type StoreDb, type StoreMigrationRow, type StoreTransaction, type StoreTransactionBuilder, type StoreVectors, type SystemStore, type VectorHit,
|
|
52
|
+
} from './store.ts';
|
|
50
53
|
export {
|
|
51
54
|
system, isSystemContract, CONTRACT_SECTIONS,
|
|
52
55
|
type ContractShape, type ContractSection, type EmptyContract, type Merge, type SystemRefs, type SystemContract, type AnyContract, type ConfigOf, type OwnOf,
|
|
@@ -68,7 +71,7 @@ export {
|
|
|
68
71
|
type InputAnswer, type InputAnswers, type ValueEditorProps, type ShareEditorProps,
|
|
69
72
|
type Renderer, type Delivery, type FnView, type SystemClient, type WithSystem, type AttachmentView, type InputView, type MentionView, type ResourceView,
|
|
70
73
|
type FnViewOf, type AttachmentViewOf, type InputViewOf, type AnyViews, type WireViews, type Mount, type InputMount, type ClientRenderers, type ClientModule, type ResourceViewerProps,
|
|
71
|
-
PAGE_HOST, type PageView, type PageViewOf, type PageHost, type PageLocation, type PageQuery, type QueryBinding, type HubClient, type SharedComponents,
|
|
74
|
+
PAGE_HOST, CODE_HIGHLIGHTER, type CodeHighlighter, type CodeToken, type CodeTokenKind, type PageView, type PageViewOf, type PageHost, type PageLocation, type PageQuery, type QueryBinding, type HubClient, type SharedComponents,
|
|
72
75
|
type MarkdownProps, type InputProps, type IconProps, type EmptyProps, type LoadStateProps, type ReasoningProps, type TypingProps, type FrameProps,
|
|
73
76
|
type ResourceViewerEntry, type ResourceViewerMode, type BareViewer, type VisualView, type VisualEntry, VISUAL_EMITS, type VisualEmits, type VisualPalette, type VisualRange, type VisualTheme, visualTheme, type VisualOption, type VisualSource,
|
|
74
77
|
} from './client.ts';
|
|
@@ -140,6 +140,10 @@ function contextDecl(name: string, def: AnyContextDef): ContextDecl {
|
|
|
140
140
|
...(def.links.length === 0 ? {} : {
|
|
141
141
|
links: def.links.map((link) => DeclaredLink.parse({ to: linkTarget(link.to), relation: link.relation, ...(link.weight === undefined ? {} : { weight: link.weight }) })),
|
|
142
142
|
}),
|
|
143
|
+
...(def.question === undefined ? {} : { question: def.question }),
|
|
144
|
+
...(def.when === undefined ? {} : { when: def.when }),
|
|
145
|
+
...(def.lastModified === undefined ? {} : { lastModified: def.lastModified }),
|
|
146
|
+
...(def.askedBy === undefined ? {} : { askedBy: def.askedBy }),
|
|
143
147
|
};
|
|
144
148
|
}
|
|
145
149
|
|
|
@@ -236,6 +240,7 @@ export function manifestBody(contract: AnyContract, options: ManifestOptions): O
|
|
|
236
240
|
...(contract.configComponent === undefined ? {} : { configComponent: contract.configComponent }),
|
|
237
241
|
...(contract.pages.length === 0 ? {} : { pages: contract.pages.map((page) => ({ ...page })) }),
|
|
238
242
|
...(contract.groups.length === 0 ? {} : { groups: checkedGroups(contract.name, contract.groups, fns) }),
|
|
243
|
+
...(defs.store === undefined ? {} : { store: { ...defs.store, engines: [...defs.store.engines] } }),
|
|
239
244
|
};
|
|
240
245
|
}
|
|
241
246
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import type { Provider } from '@aeye/ai';
|
|
13
13
|
import { ProviderModelDecl, type InstanceName, type SystemProviderDecl } from '@harness/core';
|
|
14
|
-
import type { Own, SystemCtx } from './ctx.ts';
|
|
14
|
+
import type { AnyOwn, Own, SystemCtx } from './ctx.ts';
|
|
15
15
|
|
|
16
16
|
/** A provider as the contract declares it. */
|
|
17
17
|
export interface ProviderDef {
|
|
@@ -57,7 +57,7 @@ export function checkedModels(input: readonly ProviderModelDecl[]): ProviderMode
|
|
|
57
57
|
* The implementation of a declared provider: make the aeye `Provider` for the current config. It is made again when
|
|
58
58
|
* the config changes, and kept otherwise.
|
|
59
59
|
*/
|
|
60
|
-
export type ProviderImpl<Cfg = unknown, O extends
|
|
60
|
+
export type ProviderImpl<Cfg = unknown, O extends AnyOwn = Own> = (ctx: SystemCtx<Cfg, O>) => Provider;
|
|
61
61
|
|
|
62
62
|
/** A provider declaration on the wire. */
|
|
63
63
|
export function providerDecl(name: SystemProviderDecl['name'], def: ProviderDef): SystemProviderDecl {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import {
|
|
7
7
|
AdminNotice, InstanceConnect, Json, LocalName, type DecideAnswer, type DecideCandidate, type FleetInstance, type FnExamplesPage, type FnSearchPage, type ProposedRun, type RunId,
|
|
8
8
|
} from '@harness/core';
|
|
9
|
-
import type { AdminNotices, DecideOptions, Decisions, Fleets, FnSearch, InstanceConnects, ProposeOptions, Proposals } from '../ctx.ts';
|
|
9
|
+
import type { AdminNotices, ResultUpdates, DecideOptions, Decisions, Fleets, FnSearch, InstanceConnects, ProposeOptions, Proposals } from '../ctx.ts';
|
|
10
10
|
import { canonicalJson, sha256 } from '../manifest.ts';
|
|
11
11
|
import type { AnyFnRef } from '../refs.ts';
|
|
12
12
|
import type { HubAccess } from './link.ts';
|
|
@@ -80,6 +80,17 @@ export function adminNotices(hub: HubAccess, signal: AbortSignal): AdminNotices
|
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
+
/** `updateResult` for a context: the value encoded with the fn's result type, then kept by the hub (which checks it again). */
|
|
84
|
+
export function resultUpdates(hub: HubAccess, signal: AbortSignal): ResultUpdates {
|
|
85
|
+
return {
|
|
86
|
+
updateResult: async (fn, run, result) => {
|
|
87
|
+
const encoded = encodeOrThrow(fn.returns, result, `The new result of ${fn.name}`);
|
|
88
|
+
const link = await hub.ready(signal);
|
|
89
|
+
return (await link.call('updateResult', { run, result: encoded }, { signal })).revision;
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
83
94
|
/** `instanceConnect` for a context: the value, checked, goes to `keep` (the host, which sends it now and on every reconnect). */
|
|
84
95
|
export function instanceConnects(keep: (connect: InstanceConnect) => Promise<void>): InstanceConnects {
|
|
85
96
|
return { instanceConnect: (connect) => keep(InstanceConnect.parse(connect)) };
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { join, resolve } from 'node:path';
|
|
6
6
|
import { env } from '@ayepi/env';
|
|
7
|
-
import { InstanceName, MAIN_INSTANCE } from '@harness/core';
|
|
7
|
+
import { InstanceName, MAIN_INSTANCE, STORE_HOLD } from '@harness/core';
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
import { PAIRING_QR_MODES } from './pairing.ts';
|
|
10
10
|
|
|
@@ -26,6 +26,11 @@ export const SYSTEM_ENV = {
|
|
|
26
26
|
pairingToken: 'HARNESS_PAIRING_TOKEN',
|
|
27
27
|
supervised: 'HARNESS_SUPERVISED',
|
|
28
28
|
restartCode: 'HARNESS_RESTART_CODE',
|
|
29
|
+
/**
|
|
30
|
+
* The hub's folder of database drivers (`pg`, `tedious`, `tarn`), which it installs when a store is placed in
|
|
31
|
+
* Postgres or SQL Server: a store that opens there loads them from it when the system has none of its own.
|
|
32
|
+
*/
|
|
33
|
+
storeDrivers: 'HARNESS_STORE_DRIVERS',
|
|
29
34
|
} as const;
|
|
30
35
|
|
|
31
36
|
/** The exit code a supervised system exits with to ask the hub for a restart, unless the hub sets another. */
|
|
@@ -94,6 +99,13 @@ export const sdkEnv = env({
|
|
|
94
99
|
HARNESS_SUPERVISE_BACKOFF_MAX: z.number().int().min(100).default(300_000),
|
|
95
100
|
/** For a system that supervises others: how many characters of a child's output are kept for its exit report. */
|
|
96
101
|
HARNESS_SUPERVISE_OUTPUT_TAIL: z.number().int().min(256).default(8_192),
|
|
102
|
+
/**
|
|
103
|
+
* How long a call waits for the system's store to be open and migrated, and for its `started` lifecycle to finish,
|
|
104
|
+
* before it is refused.
|
|
105
|
+
*/
|
|
106
|
+
HARNESS_STORE_HOLD: z.number().int().min(0).default(STORE_HOLD),
|
|
107
|
+
/** For a store in Postgres or SQL Server: the folder the hub installed their drivers in, tried when the system has none. */
|
|
108
|
+
[SYSTEM_ENV.storeDrivers]: z.string().min(1).optional(),
|
|
97
109
|
/** Which copy of the system this process is: `main` unless it is one of a fleet. */
|
|
98
110
|
[SYSTEM_ENV.instance]: InstanceName.default(MAIN_INSTANCE),
|
|
99
111
|
...placeFields,
|