fnloom 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +123 -19
- package/package.json +15 -11
- package/packages/build/package.json +2 -2
- package/packages/build/src/tests.ts +2 -2
- package/packages/cli/package.json +1 -1
- package/packages/cli/src/cli.ts +4 -3
- package/packages/cli/src/command.ts +4 -2
- package/packages/cli/src/commands/install.ts +104 -8
- package/packages/cli/src/commands/manage.ts +7 -5
- package/packages/cli/src/commands/mcp.ts +6 -6
- package/packages/cli/src/commands/store.ts +172 -0
- package/packages/cli/src/hub.ts +45 -26
- package/packages/cli/src/index.ts +1 -1
- package/packages/cli/src/io.ts +3 -2
- package/packages/cli/src/local.ts +7 -7
- package/packages/cli/src/premade.ts +1 -1
- package/packages/cli/src/testing.ts +2 -1
- package/packages/core/package.json +4 -4
- package/packages/core/src/auto-pair.ts +1 -1
- package/packages/core/src/connections.ts +1 -14
- package/packages/core/src/context-files.ts +3 -1
- package/packages/core/src/context-graph.ts +5 -1
- package/packages/core/src/context-plan.ts +451 -0
- package/packages/core/src/context-questions.ts +305 -0
- package/packages/core/src/data.ts +1 -1
- package/packages/core/src/fn-facts.ts +32 -4
- package/packages/core/src/https.ts +2 -2
- package/packages/core/src/identity.ts +2 -2
- package/packages/core/src/image-embeddings.ts +1 -1
- package/packages/core/src/index.ts +9 -8
- package/packages/core/src/link.ts +71 -1
- package/packages/core/src/manifest.ts +22 -3
- package/packages/core/src/mention-search.ts +1 -1
- package/packages/core/src/model-calls.ts +11 -2
- package/packages/core/src/package.ts +11 -1
- package/packages/core/src/ports.ts +2 -2
- package/packages/core/src/query.ts +4 -3
- package/packages/core/src/records/chat.ts +1 -1
- package/packages/core/src/records/content.ts +10 -2
- package/packages/core/src/records/runs.ts +12 -0
- package/packages/core/src/records/spend.ts +4 -0
- package/packages/core/src/records/systems.ts +87 -5
- package/packages/core/src/registries.ts +9 -3
- package/packages/core/src/run.ts +5 -0
- package/packages/core/src/sso.ts +2 -2
- package/packages/core/src/stores.ts +473 -0
- package/packages/core/src/suggestions.ts +5 -2
- package/packages/core/src/system-pages.ts +46 -7
- package/packages/core/src/tables.ts +233 -0
- package/packages/core/src/visuals.ts +47 -139
- package/packages/core/src/web.ts +116 -11
- package/packages/core/src/widgets-v1.ts +78 -1
- package/packages/hub/package.json +15 -12
- package/packages/hub/src/access/hits.ts +1 -1
- package/packages/hub/src/api/admin-ops.ts +41 -9
- package/packages/hub/src/api/auth.ts +10 -6
- package/packages/hub/src/api/https.ts +6 -6
- package/packages/hub/src/api/identities.ts +1 -1
- package/packages/hub/src/api/person-ops.ts +6 -0
- package/packages/hub/src/api/reads.ts +1 -1
- package/packages/hub/src/api/secrets.ts +1 -1
- package/packages/hub/src/api/serve.ts +2 -2
- package/packages/hub/src/api/sso-route.ts +2 -2
- package/packages/hub/src/api/sso.ts +6 -6
- package/packages/hub/src/api/store-ops.ts +54 -0
- package/packages/hub/src/api/testing/rig.ts +3 -3
- package/packages/hub/src/api/tls.ts +4 -4
- package/packages/hub/src/api/web/auth.ts +1 -1
- package/packages/hub/src/api/web/build5.ts +2 -1
- package/packages/hub/src/api/web/context-plans.ts +25 -0
- package/packages/hub/src/api/web/context-review.ts +43 -0
- package/packages/hub/src/api/web/find.ts +1 -1
- package/packages/hub/src/api/web/index.ts +4 -0
- package/packages/hub/src/api/web/pages.ts +17 -3
- package/packages/hub/src/api/web/pickers.ts +4 -4
- package/packages/hub/src/api/web/review.ts +16 -0
- package/packages/hub/src/api/web/systems.ts +14 -2
- package/packages/hub/src/boot/admin-fns.ts +8 -0
- package/packages/hub/src/boot/admin-secrets.ts +10 -4
- package/packages/hub/src/boot/env.ts +82 -73
- package/packages/hub/src/boot/hub-fns.ts +4 -4
- package/packages/hub/src/boot/hub-groups.ts +2 -2
- package/packages/hub/src/boot/identity.ts +2 -2
- package/packages/hub/src/boot/index.ts +10 -1
- package/packages/hub/src/boot/info.ts +1 -1
- package/packages/hub/src/boot/keys.ts +6 -6
- package/packages/hub/src/boot/log.ts +4 -4
- package/packages/hub/src/boot/modules.ts +16 -7
- package/packages/hub/src/boot/person-fns.ts +5 -0
- package/packages/hub/src/boot/plan-fns.ts +39 -0
- package/packages/hub/src/boot/services.ts +9 -9
- package/packages/hub/src/boot/start.ts +25 -24
- package/packages/hub/src/catalog/catalog.ts +44 -14
- package/packages/hub/src/catalog/index.ts +6 -2
- package/packages/hub/src/chat/cache.ts +1 -1
- package/packages/hub/src/chat/chat.ts +1 -1
- package/packages/hub/src/chat/compare.ts +2 -2
- package/packages/hub/src/chat/deliveries.ts +1 -1
- package/packages/hub/src/chat/deps.ts +3 -3
- package/packages/hub/src/chat/enrich.ts +7 -7
- package/packages/hub/src/chat/env.ts +20 -20
- package/packages/hub/src/chat/mention-requests.ts +1 -1
- package/packages/hub/src/chat/mention-search.ts +1 -1
- package/packages/hub/src/chat/mentions.ts +3 -3
- package/packages/hub/src/chat/notifications.ts +2 -2
- package/packages/hub/src/chat/presence.ts +2 -2
- package/packages/hub/src/chat/sessions.ts +2 -2
- package/packages/hub/src/chat/suggestions.ts +8 -8
- package/packages/hub/src/chat/testing.ts +3 -3
- package/packages/hub/src/chat/turns.ts +6 -6
- package/packages/hub/src/chat/undo.ts +1 -1
- package/packages/hub/src/connections/create.ts +1 -1
- package/packages/hub/src/connections/env.ts +2 -2
- package/packages/hub/src/connections/service.ts +5 -9
- package/packages/hub/src/contextor/brought.ts +5 -3
- package/packages/hub/src/contextor/contextors.ts +9 -9
- package/packages/hub/src/contextor/crawl.ts +1 -1
- package/packages/hub/src/contextor/create.ts +5 -5
- package/packages/hub/src/contextor/dynamic.ts +5 -5
- package/packages/hub/src/contextor/env.ts +46 -46
- package/packages/hub/src/contextor/injected.ts +1 -1
- package/packages/hub/src/contextor/limits.ts +9 -9
- package/packages/hub/src/contextor/planner.ts +11 -11
- package/packages/hub/src/contextor/testing.ts +5 -5
- package/packages/hub/src/data/env.ts +3 -3
- package/packages/hub/src/data/service.ts +5 -5
- package/packages/hub/src/execution/agent.ts +8 -8
- package/packages/hub/src/execution/ai.ts +7 -7
- package/packages/hub/src/execution/create.ts +13 -6
- package/packages/hub/src/execution/env.ts +16 -14
- package/packages/hub/src/execution/errors.ts +12 -0
- package/packages/hub/src/execution/executors.ts +16 -4
- package/packages/hub/src/execution/gateway.ts +1 -1
- package/packages/hub/src/execution/index.ts +9 -1
- package/packages/hub/src/execution/ledger.ts +2 -2
- package/packages/hub/src/execution/limits.ts +2 -2
- package/packages/hub/src/execution/link-handlers.ts +16 -4
- package/packages/hub/src/execution/models.ts +2 -2
- package/packages/hub/src/execution/ports.ts +1 -1
- package/packages/hub/src/execution/providers.ts +55 -11
- package/packages/hub/src/execution/queues.ts +6 -6
- package/packages/hub/src/execution/runs.ts +216 -15
- package/packages/hub/src/execution/stream-guard.ts +2 -2
- package/packages/hub/src/execution/testing.ts +7 -6
- package/packages/hub/src/execution/wire.ts +3 -3
- package/packages/hub/src/fns/auto.ts +2 -2
- package/packages/hub/src/fns/client-logs.ts +2 -2
- package/packages/hub/src/fns/create.ts +2 -2
- package/packages/hub/src/fns/decided.ts +2 -2
- package/packages/hub/src/fns/env.ts +14 -14
- package/packages/hub/src/fns/examples.ts +3 -3
- package/packages/hub/src/fns/facts.ts +5 -5
- package/packages/hub/src/fns/search.ts +28 -9
- package/packages/hub/src/graph/graph.ts +3 -3
- package/packages/hub/src/index/context-sections.ts +1 -1
- package/packages/hub/src/index/embedders.ts +3 -3
- package/packages/hub/src/index/env.ts +12 -12
- package/packages/hub/src/index/index.ts +10 -3
- package/packages/hub/src/index/indexer.ts +71 -20
- package/packages/hub/src/index/search.ts +2 -1
- package/packages/hub/src/index/suggester.ts +2 -2
- package/packages/hub/src/index/testing.ts +2 -2
- package/packages/hub/src/link/build.ts +71 -34
- package/packages/hub/src/link/connections.ts +41 -3
- package/packages/hub/src/link/describer.ts +19 -2
- package/packages/hub/src/link/env.ts +21 -11
- package/packages/hub/src/link/grants.ts +10 -10
- package/packages/hub/src/link/handlers.ts +6 -0
- package/packages/hub/src/link/index.ts +16 -4
- package/packages/hub/src/link/lifecycle.ts +15 -8
- package/packages/hub/src/link/migrate-api.ts +55 -15
- package/packages/hub/src/link/packages.ts +17 -4
- package/packages/hub/src/link/pairing.ts +3 -3
- package/packages/hub/src/link/process.ts +11 -5
- package/packages/hub/src/link/rig.ts +15 -11
- package/packages/hub/src/link/status.ts +14 -0
- package/packages/hub/src/link/supervisor.ts +17 -1
- package/packages/hub/src/link/systems.ts +16 -5
- package/packages/hub/src/mcp/calls.ts +6 -6
- package/packages/hub/src/mcp/create.ts +5 -5
- package/packages/hub/src/mcp/env.ts +6 -6
- package/packages/hub/src/mcp/fns.ts +2 -2
- package/packages/hub/src/mcp/index.ts +2 -2
- package/packages/hub/src/mcp/sources.ts +3 -3
- package/packages/hub/src/mcp/tokens.ts +1 -1
- package/packages/hub/src/models/create.ts +1 -1
- package/packages/hub/src/models/decide.ts +2 -2
- package/packages/hub/src/models/index.ts +1 -1
- package/packages/hub/src/models/roles.ts +78 -11
- package/packages/hub/src/query/columns.ts +4 -1
- package/packages/hub/src/query/contexts.ts +10 -3
- package/packages/hub/src/query/env.ts +5 -5
- package/packages/hub/src/query/sources.ts +3 -3
- package/packages/hub/src/questions/apply.ts +163 -0
- package/packages/hub/src/questions/carry.ts +30 -0
- package/packages/hub/src/questions/duplicates.ts +181 -0
- package/packages/hub/src/questions/index.ts +112 -0
- package/packages/hub/src/questions/metadata.ts +142 -0
- package/packages/hub/src/questions/pending.ts +64 -0
- package/packages/hub/src/questions/plan-match.ts +79 -0
- package/packages/hub/src/questions/plan-prompts.ts +110 -0
- package/packages/hub/src/questions/planner.ts +382 -0
- package/packages/hub/src/questions/plans.ts +353 -0
- package/packages/hub/src/questions/review.ts +253 -0
- package/packages/hub/src/questions/setting.ts +50 -0
- package/packages/hub/src/questions/testing.ts +131 -0
- package/packages/hub/src/questions/worker.ts +182 -0
- package/packages/hub/src/resources/context.ts +61 -23
- package/packages/hub/src/resources/converters.ts +2 -2
- package/packages/hub/src/resources/create.ts +20 -8
- package/packages/hub/src/resources/env.ts +15 -11
- package/packages/hub/src/resources/fetch.ts +5 -5
- package/packages/hub/src/resources/fns.ts +6 -2
- package/packages/hub/src/resources/forms.ts +5 -5
- package/packages/hub/src/resources/index.ts +9 -3
- package/packages/hub/src/resources/library.ts +2 -2
- package/packages/hub/src/resources/raw.ts +1 -1
- package/packages/hub/src/resources/reader.ts +2 -2
- package/packages/hub/src/resources/sqlite-files.ts +1 -1
- package/packages/hub/src/resources/storage.ts +5 -5
- package/packages/hub/src/resources/testing.ts +22 -6
- package/packages/hub/src/store/codec.ts +23 -5
- package/packages/hub/src/store/context-status.ts +56 -0
- package/packages/hub/src/store/derived.ts +53 -0
- package/packages/hub/src/store/env.ts +4 -4
- package/packages/hub/src/store/hybrid.ts +37 -10
- package/packages/hub/src/store/lists.ts +2 -1
- package/packages/hub/src/store/migrate-fn-names.ts +5 -2
- package/packages/hub/src/store/rows.ts +8 -1
- package/packages/hub/src/store/schema.ts +2 -1
- package/packages/hub/src/store/sqlite.ts +5 -4
- package/packages/hub/src/stores/backups.ts +163 -0
- package/packages/hub/src/stores/drivers.ts +100 -0
- package/packages/hub/src/stores/guard.ts +116 -0
- package/packages/hub/src/stores/host.ts +459 -0
- package/packages/hub/src/stores/moves.ts +380 -0
- package/packages/hub/src/stores/plugin.ts +42 -0
- package/packages/hub/src/stores/service.ts +340 -0
- package/packages/hub/src/stores/testing.ts +149 -0
- package/packages/hub/src/tables/env.ts +3 -3
- package/packages/hub/src/tables/index.ts +5 -5
- package/packages/hub/src/tables/service.ts +7 -7
- package/packages/sdk/AUTHORING.md +3229 -1309
- package/packages/sdk/package.json +15 -8
- package/packages/sdk/src/agent.ts +1 -1
- package/packages/sdk/src/app-parts.ts +95 -0
- package/packages/sdk/src/authored.ts +26 -0
- package/packages/sdk/src/authoring.ts +13 -30
- package/packages/sdk/src/build.ts +3 -0
- package/packages/sdk/src/client-runtime.ts +24 -1
- package/packages/sdk/src/client-ui/AddServiceDialog.vue +43 -0
- package/packages/sdk/src/client-ui/InstanceNameField.vue +29 -0
- package/packages/sdk/src/client-ui/PairRowsEditor.vue +74 -0
- package/packages/sdk/src/client-ui/RemoteAuthFields.vue +95 -0
- package/packages/sdk/src/client-ui/ServiceRows.vue +57 -0
- package/packages/sdk/src/client-ui/draft.ts +10 -0
- package/packages/sdk/src/client-ui/host.ts +37 -0
- package/packages/sdk/src/client-ui/index.ts +19 -0
- package/packages/sdk/src/client-ui/loaded.ts +69 -0
- package/packages/sdk/src/client-ui/problems.ts +98 -0
- package/packages/sdk/src/client-ui/remote-config.ts +199 -0
- package/packages/sdk/src/client-ui/service-rows.ts +25 -0
- package/packages/sdk/src/client-ui/state.ts +14 -0
- package/packages/sdk/src/client-ui/testing.ts +147 -0
- package/packages/sdk/src/client-ui/vue-shim.d.ts +13 -0
- package/packages/sdk/src/client.ts +104 -11
- package/packages/sdk/src/ctx.ts +51 -17
- package/packages/sdk/src/declare.ts +36 -12
- package/packages/sdk/src/hub.ts +226 -14
- package/packages/sdk/src/impl.ts +3 -3
- package/packages/sdk/src/index.ts +19 -12
- package/packages/sdk/src/manifest.ts +5 -0
- package/packages/sdk/src/page-parts.ts +4 -0
- package/packages/sdk/src/program/env.ts +7 -7
- package/packages/sdk/src/program/runtime.ts +5 -5
- package/packages/sdk/src/program/tools.ts +3 -3
- package/packages/sdk/src/providers.ts +2 -2
- package/packages/sdk/src/remote-auth.ts +128 -7
- package/packages/sdk/src/server/asks.ts +12 -1
- package/packages/sdk/src/server/context-files.ts +1 -1
- package/packages/sdk/src/server/env.ts +47 -35
- package/packages/sdk/src/server/fake-hub-widgets.ts +7 -6
- package/packages/sdk/src/server/host.ts +106 -35
- package/packages/sdk/src/server/index.ts +23 -4
- package/packages/sdk/src/server/live.ts +4 -4
- package/packages/sdk/src/server/llm-wire.ts +4 -4
- package/packages/sdk/src/server/package.ts +11 -2
- package/packages/sdk/src/server/pairing.ts +1 -1
- package/packages/sdk/src/server/results.ts +4 -4
- package/packages/sdk/src/server/run.ts +6 -1
- package/packages/sdk/src/server/runtime.ts +78 -22
- package/packages/sdk/src/server/socket-guard.ts +1 -1
- package/packages/sdk/src/server/start-gate.ts +174 -0
- package/packages/sdk/src/server/store/checksum.ts +162 -0
- package/packages/sdk/src/server/store/engines.ts +400 -0
- package/packages/sdk/src/server/store/extend.ts +25 -0
- package/packages/sdk/src/server/store/keeper.ts +392 -0
- package/packages/sdk/src/server/store/link-driver.ts +142 -0
- package/packages/sdk/src/server/store/measure.ts +45 -0
- package/packages/sdk/src/server/store/migrations.ts +238 -0
- package/packages/sdk/src/server/store/move.ts +488 -0
- package/packages/sdk/src/server/store/portable.ts +288 -0
- package/packages/sdk/src/server/store/stable.ts +146 -0
- package/packages/sdk/src/server/store/tables.ts +28 -0
- package/packages/sdk/src/server/store/vectors.ts +185 -0
- package/packages/sdk/src/server/store/work-checks.ts +288 -0
- package/packages/sdk/src/server/store/work.ts +369 -0
- package/packages/sdk/src/server/supervise.ts +4 -4
- package/packages/sdk/src/server/table.ts +3 -1
- package/packages/sdk/src/server/testing.ts +116 -3
- package/packages/sdk/src/store.ts +91 -0
- package/packages/sdk/src/system.ts +58 -30
- package/packages/sdk/src/testing/env.ts +6 -6
- package/packages/sdk/src/testing/hub.ts +21 -6
- package/packages/sdk/src/testing/models.ts +3 -3
- package/packages/sdk/src/testing/openrouter.ts +3 -2
- package/packages/sdk/src/testing/preview.ts +7 -7
- package/packages/sdk/src/widgets.ts +21 -136
- package/packages/sdk/tsconfig.json +2 -2
- package/packages/web/dist/assets/{ActorSettingsView-BuMYRDqv.js → ActorSettingsView-CDszUbHz.js} +2 -2
- package/packages/web/dist/assets/AdminLayout-CFIz4GsQ.js +2 -0
- package/packages/web/dist/assets/{AdminLayout-1hbRPV3d.css → AdminLayout-ggcdQGlQ.css} +1 -1
- package/packages/web/dist/assets/{AppPage-DSzDKCFz.js → AppPage-BvoVTk6h.js} +2 -2
- package/packages/web/dist/assets/{AutoPairPicker-nV38ALjl.js → AutoPairPicker-CLjD-muP.js} +2 -2
- package/packages/web/dist/assets/{BrowserFrame-Bic7U7jN.js → BrowserFrame-BcN-A76X.js} +2 -2
- package/packages/web/dist/assets/ChatPage-DhTpAyM2.js +4 -0
- package/packages/web/dist/assets/{ChatPage-CbsRmktV.css → ChatPage-DjPv238m.css} +1 -1
- package/packages/web/dist/assets/{CodeViewer-xHS3Xah9.js → CodeViewer-K9jrTmFO.js} +2 -2
- package/packages/web/dist/assets/ConfigWithCustom-BvrvSVIp.js +3 -0
- package/packages/web/dist/assets/{ConfirmDialog-DjQUzNqk.js → ConfirmDialog-BDvLleYf.js} +2 -2
- package/packages/web/dist/assets/{ConnectPage-CfRDrXvJ.js → ConnectPage-Dg6IPNNh.js} +2 -2
- package/packages/web/dist/assets/ContextItemPage-Cv4G0k_o.css +1 -0
- package/packages/web/dist/assets/ContextItemPage-qisBQetR.js +2 -0
- package/packages/web/dist/assets/ContextPage-C8u0UnYl.css +1 -0
- package/packages/web/dist/assets/ContextPage-DXa6Yqk-.js +3 -0
- package/packages/web/dist/assets/ContextRow-Chx99Xac.css +1 -0
- package/packages/web/dist/assets/ContextRow-DDYnYRaL.js +2 -0
- package/packages/web/dist/assets/{DataPage-wSIoGcb5.js → DataPage-DOE_pKAY.js} +2 -2
- package/packages/web/dist/assets/DataTypePage-BnP_JELT.js +2 -0
- package/packages/web/dist/assets/{DataTypePage-Cr238Hx_.css → DataTypePage-CWrWvUPs.css} +1 -1
- package/packages/web/dist/assets/{DesignPage-DidMUX8m.js → DesignPage-B9MJbF10.js} +3 -3
- package/packages/web/dist/assets/{ExplorePage-MUyVydVB.js → ExplorePage-cRDQZRea.js} +2 -2
- package/packages/web/dist/assets/{FnPill-BshAvm2I.js → FnPill-CbLZCXYM.js} +2 -2
- package/packages/web/dist/assets/{FnView-B8MGAOoB.js → FnView-CG_wBKTP.js} +2 -2
- package/packages/web/dist/assets/{FnsView-CeqIoaBT.js → FnsView-BybyK12w.js} +2 -2
- package/packages/web/dist/assets/{GinExprView-DYVUwZrd.js → GinExprView-BYCKSD_n.js} +2 -2
- package/packages/web/dist/assets/{GinForm-D3mwMRTQ.js → GinForm-CXjYVf2_.js} +2 -2
- package/packages/web/dist/assets/{GinTypeView-C0YifSmE.js → GinTypeView-Bmbmx9e_.js} +2 -2
- package/packages/web/dist/assets/{GinValueView-HfEPq9le.js → GinValueView-CWUzS7ti.js} +2 -2
- package/packages/web/dist/assets/{GraphPage-ySnuA4Hp.js → GraphPage-D6OhckfJ.js} +2 -2
- package/packages/web/dist/assets/GraphPanel-BTitgA-K.js +2 -0
- package/packages/web/dist/assets/{HubPicker-C_vA752L.js → HubPicker-DVly8dLD.js} +2 -2
- package/packages/web/dist/assets/{InboxApprovals-DcPCCmZ5.js → InboxApprovals-BF84edZU.js} +2 -2
- package/packages/web/dist/assets/{InboxPage-C2DT2nuF.js → InboxPage-DohZ9EDP.js} +2 -2
- package/packages/web/dist/assets/InjectedList-e6qr1kdU.js +2 -0
- package/packages/web/dist/assets/InstallDialog-JJCKYs2s.js +2 -0
- package/packages/web/dist/assets/{InstallDialog-yWLZK_zN.css → InstallDialog-K-j0sdHm.css} +1 -1
- package/packages/web/dist/assets/InstanceTypes-BqUzx87o.js +2 -0
- package/packages/web/dist/assets/InstanceTypes-CwVSAULg.css +1 -0
- package/packages/web/dist/assets/InstanceView-C73pev7A.js +2 -0
- package/packages/web/dist/assets/InstanceView-_9uE70tS.css +1 -0
- package/packages/web/dist/assets/{ItemHistory-CUGa8b6s.js → ItemHistory-dbGgOZsw.js} +2 -2
- package/packages/web/dist/assets/LimitsView-Ddp5WakY.js +2 -0
- package/packages/web/dist/assets/ListSearch-CYNNAuMB.js +2 -0
- package/packages/web/dist/assets/{LlmCallDetails-2yQftCqd.js → LlmCallDetails-C9H5Hc2J.js} +2 -2
- package/packages/web/dist/assets/{LlmCallsView-DOHX3r0K.js → LlmCallsView-CBqyZ8Cj.js} +2 -2
- package/packages/web/dist/assets/{LoadState-DeXfLvYv.js → LoadState-B2YhZlyC.js} +2 -2
- package/packages/web/dist/assets/McpDialog-DhlLklIq.js +2 -0
- package/packages/web/dist/assets/{McpView-CC2oNOMa.js → McpView-D_ZmNO56.js} +2 -2
- package/packages/web/dist/assets/{McpsView-CwJvyyxV.js → McpsView-9_gwBuzw.js} +2 -2
- package/packages/web/dist/assets/{MemoryDialog-Dbvh5uLq.js → MemoryDialog-pTHIxKEX.js} +2 -2
- package/packages/web/dist/assets/{ModelCallsView-RvnW3EBP.js → ModelCallsView-FHv2XWRX.js} +2 -2
- package/packages/web/dist/assets/{ModelPicker-DcjwQFHC.js → ModelPicker-EqOuvVnE.js} +2 -2
- package/packages/web/dist/assets/ModelsView-D9UaL4PX.js +2 -0
- package/packages/web/dist/assets/{NotFoundPage-CeSwzTV-.js → NotFoundPage-BsuJysan.js} +2 -2
- package/packages/web/dist/assets/PairPage-B_ZXsbL4.js +2 -0
- package/packages/web/dist/assets/PairPage-D_aPS1Ot.css +1 -0
- package/packages/web/dist/assets/{PanelHost-BkrFAnPa.js → PanelHost-Dx-vNNl5.js} +2 -2
- package/packages/web/dist/assets/PeopleView-D6dmEgMs.js +2 -0
- package/packages/web/dist/assets/{PeopleView-CJ8yArTh.css → PeopleView-DBxdbT1C.css} +1 -1
- package/packages/web/dist/assets/PoliciesView-Bn4rm-ao.js +2 -0
- package/packages/web/dist/assets/{RefusalList-DQoyUoPG.js → RefusalList-aosRD1ie.js} +2 -2
- package/packages/web/dist/assets/RendererHost-Ym_SMkhp.css +1 -0
- package/packages/web/dist/assets/RendererHost-rjnpSgyQ.js +2 -0
- package/packages/web/dist/assets/{ResourceViewer-Po24y4pj.js → ResourceViewer-C4tRColf.js} +2 -2
- package/packages/web/dist/assets/ResourcesPage-7mCLBORZ.js +2 -0
- package/packages/web/dist/assets/ResultGrid-CL2WSYQH.css +1 -0
- package/packages/web/dist/assets/ResultGrid-GIMoQUAr.js +2 -0
- package/packages/web/dist/assets/{ReviewSummaryStrip-k3HevESg.js → ReviewSummaryStrip-Bvjn3Iq8.js} +2 -2
- package/packages/web/dist/assets/ReviewView-DIqsUedT.js +3 -0
- package/packages/web/dist/assets/{RuleRow-CoXDA-SH.js → RuleRow-zRg-e8Vj.js} +2 -2
- package/packages/web/dist/assets/RunCard-C7wOGaw8.js +2 -0
- package/packages/web/dist/assets/RunCard-CSDiz-Nt.css +1 -0
- package/packages/web/dist/assets/{RunDetails-CGhQQ6OI.js → RunDetails-W4GbE6AE.js} +2 -2
- package/packages/web/dist/assets/{RunDot-Ch_45985.js → RunDot-C46uzzNM.js} +2 -2
- package/packages/web/dist/assets/{RunPage-C_t20pB7.js → RunPage-DPLtZpeB.js} +2 -2
- package/packages/web/dist/assets/{RunProgress-VrZUHUEC.js → RunProgress-Cr_6TBaF.js} +2 -2
- package/packages/web/dist/assets/RunsView-tU350TPK.js +2 -0
- package/packages/web/dist/assets/{SettingsPage-CykfuYj1.js → SettingsPage-B8QmmMN3.js} +2 -2
- package/packages/web/dist/assets/{SettingsPage-t03BqXw8.css → SettingsPage-BTl3Ie4F.css} +1 -1
- package/packages/web/dist/assets/SignInPage-CXxLf7Rp.css +1 -0
- package/packages/web/dist/assets/{SignInPage-DrXZ1sG2.js → SignInPage-DTwdqlnB.js} +2 -2
- package/packages/web/dist/assets/{StatusBadge-Dpb9uG5e.js → StatusBadge-D7wKMAcD.js} +2 -2
- package/packages/web/dist/assets/StorePlacementStep-C04nRU-u.js +2 -0
- package/packages/web/dist/assets/StorePlacementStep-D_G4e3ue.css +1 -0
- package/packages/web/dist/assets/{SystemConfig-72qKRkUk.js → SystemConfig-CE3keXWq.js} +2 -2
- package/packages/web/dist/assets/SystemPageHost-CEhz4li8.js +2 -0
- package/packages/web/dist/assets/SystemPageHost-DX7LrFoN.css +1 -0
- package/packages/web/dist/assets/SystemView-CBFzEGfm.js +2 -0
- package/packages/web/dist/assets/{SystemView-C8ScHUe2.css → SystemView-_9q6eDfV.css} +1 -1
- package/packages/web/dist/assets/SystemsView-0G8JntMV.js +2 -0
- package/packages/web/dist/assets/{SystemsView-B6HEL9VS.css → SystemsView-CWKnupLW.css} +1 -1
- package/packages/web/dist/assets/TableView-BK0uwLHl.js +3 -0
- package/packages/web/dist/assets/TableView-B_4MViVb.css +1 -0
- package/packages/web/dist/assets/{TableViewer-BQ7bYLOP.js → TableViewer-nbMInGJJ.js} +2 -2
- package/packages/web/dist/assets/{ThemePicker-C2nJ21Vd.js → ThemePicker-fZpVSYqG.js} +2 -2
- package/packages/web/dist/assets/{TurnTree-CORdfTHj.js → TurnTree-Co-iBqhT.js} +2 -2
- package/packages/web/dist/assets/{UserMessage-BtECa8ka.css → UserMessage-B63G9sxC.css} +1 -1
- package/packages/web/dist/assets/{UserMessage-qyc8dG5D.js → UserMessage-CDjUxKY0.js} +6 -6
- package/packages/web/dist/assets/{ValueVisual-aXEUaQ5Y.js → ValueVisual-EJnCKgSy.js} +2 -2
- package/packages/web/dist/assets/actor-names-OdvpVZeb.js +4 -0
- package/packages/web/dist/assets/{fn-modal-DqcxUhOQ.js → fn-modal-DtE65mFt.js} +2 -2
- package/packages/web/dist/assets/{fn-notices-BYaH6IoA.js → fn-notices-CCZ-DFbi.js} +2 -2
- package/packages/web/dist/assets/{formats-DI__ADVG.js → formats-CyHV2siv.js} +2 -2
- package/packages/web/dist/assets/index-BY7M8QUk.css +1 -0
- package/packages/web/dist/assets/index-OZS2EluT.js +4 -0
- package/packages/web/dist/assets/{labels-BhJpmLWA.js → labels-CT7_K0Pt.js} +2 -2
- package/packages/web/dist/assets/{layout-DQKldU13.js → layout-B6fBDg80.js} +2 -2
- package/packages/web/dist/assets/loaded-LaPjk6mK.js +2 -0
- package/packages/web/dist/assets/{metrics-Cio5ykX6.js → metrics-9n8bKI7u.js} +2 -2
- package/packages/web/dist/assets/problems--AW4igVY.js +2 -0
- package/packages/web/dist/assets/{push-payload-D5efGCzd.js → push-payload-B3EcrsVz.js} +64 -64
- package/packages/web/dist/assets/record-edits-B-FWAbxR.js +2 -0
- package/packages/web/dist/assets/{review-CGUGvRV9.js → review-uLESCEz1.js} +3 -3
- package/packages/web/dist/assets/routes-B7Zmt8wh.js +4 -0
- package/packages/web/dist/assets/runs-CUb2PTFg.js +2 -0
- package/packages/web/dist/assets/{shared-DTpYDMc_.js → shared-Bxhw_9et.js} +2 -2
- package/packages/web/dist/assets/{sources-Bm-TrxhL.js → sources-YgkjgFLe.js} +2 -2
- package/packages/web/dist/assets/src-DY1fSFJS.js +43 -0
- package/packages/web/dist/assets/state-ChQDWWj-.js +2 -0
- package/packages/web/dist/assets/{systems-DIp94AET.js → systems-CjwjRySu.js} +2 -2
- package/packages/web/dist/assets/table-host-B_D9dmCz.js +2 -0
- package/packages/web/dist/assets/tables-CaxIuHdw.js +2 -0
- package/packages/web/dist/assets/ui-DWjytmDS.js +17 -0
- package/packages/web/dist/assets/{ui-C7ZH_6oC.css → ui-DycHjPTZ.css} +1 -1
- package/packages/web/dist/assets/{url-BIg5IhGs.js → url-DbGOI14W.js} +2 -2
- package/packages/web/dist/index.html +52 -50
- package/packages/web/dist/sw.js +1 -1
- package/packages/web/package.json +2 -4
- package/premade/claude.zip +0 -0
- package/premade/database.zip +0 -0
- package/premade/web.zip +0 -0
- package/scripts/dev-env.ts +9 -9
- package/scripts/run-stack.ts +17 -16
- package/scripts/stack.ts +76 -19
- package/scripts/start.ts +27 -18
- package/systems/api/client/ApiServiceForm.vue +55 -0
- package/systems/api/client/ServiceList.vue +90 -0
- package/systems/api/client/ServicePage.vue +142 -0
- package/systems/api/client/ServicesPage.vue +32 -0
- package/systems/api/client/index.ts +15 -0
- package/systems/api/client/logic.ts +140 -0
- package/systems/api/client/state.ts +92 -0
- package/systems/api/package.json +9 -6
- package/systems/api/server/authoring.ts +2 -1
- package/systems/api/server/env.ts +1 -1
- package/systems/api/server/guard.ts +1 -1
- package/systems/api/server/http.ts +3 -2
- package/systems/api/server/impl.ts +3 -2
- package/systems/api/server/main.ts +11 -7
- package/systems/api/server/openapi.ts +1 -1
- package/systems/api/server/program.ts +2 -1
- package/systems/api/server/services.ts +2 -1
- package/systems/api/shared/http.ts +2 -1
- package/systems/api/shared/index.ts +15 -5
- package/{packages/core/src/programs.ts → systems/api/shared/services.ts} +7 -51
- package/systems/api/system.json +2 -1
- package/systems/api/tsconfig.json +2 -2
- package/systems/code/package.json +4 -3
- package/systems/code/server/authoring.ts +2 -1
- package/systems/code/server/impl.ts +2 -1
- package/systems/code/server/main.ts +5 -5
- package/systems/code/shared/index.ts +2 -3
- package/systems/code/shared/program.ts +23 -0
- package/systems/embedder/package.json +1 -1
- package/systems/embedder/server/env.ts +1 -1
- package/systems/embedder/server/main.ts +5 -5
- package/systems/embedder/shared/index.ts +1 -1
- package/systems/fs/client/fakes.ts +2 -0
- package/systems/fs/client/index.ts +4 -2
- package/systems/fs/client/machines/CoreHeatmap.vue +94 -0
- package/systems/fs/client/machines/MachineFiles.vue +121 -0
- package/systems/fs/client/machines/MachineMetrics.vue +330 -0
- package/systems/fs/client/machines/MachinesPage.vue +119 -0
- package/systems/fs/client/machines/TimeChart.vue +128 -0
- package/systems/fs/client/machines/fakes.ts +95 -0
- package/systems/fs/client/machines/files/ChangesPane.vue +90 -0
- package/systems/fs/client/machines/files/CodeView.vue +158 -0
- package/systems/fs/client/machines/files/CommentComposer.vue +86 -0
- package/systems/fs/client/machines/files/CommentThread.vue +115 -0
- package/systems/fs/client/machines/files/CommitPane.vue +80 -0
- package/systems/fs/client/machines/files/ComparePane.vue +81 -0
- package/systems/fs/client/machines/files/FileHistory.vue +89 -0
- package/systems/fs/client/machines/files/FilePane.vue +199 -0
- package/systems/fs/client/machines/files/FileTree.vue +26 -0
- package/systems/fs/client/machines/files/FolderPane.vue +154 -0
- package/systems/fs/client/machines/files/HistoryPane.vue +106 -0
- package/systems/fs/client/machines/files/ImageView.vue +160 -0
- package/systems/fs/client/machines/files/PatchView.vue +31 -0
- package/systems/fs/client/machines/files/QuickOpen.vue +67 -0
- package/systems/fs/client/machines/files/SearchPane.vue +87 -0
- package/systems/fs/client/machines/files/TreeNode.vue +72 -0
- package/systems/fs/client/machines/files/api.ts +127 -0
- package/systems/fs/client/machines/files/fake-kinds.ts +16 -0
- package/systems/fs/client/machines/files/fakes.ts +305 -0
- package/systems/fs/client/machines/files/ink.ts +117 -0
- package/systems/fs/client/machines/files/logic.ts +205 -0
- package/systems/fs/client/machines/files/state.ts +187 -0
- package/systems/fs/client/machines/files/viewers/CsvView.vue +29 -0
- package/systems/fs/client/machines/files/viewers/HexView.vue +27 -0
- package/systems/fs/client/machines/files/viewers/HtmlView.vue +17 -0
- package/systems/fs/client/machines/files/viewers/JsonNode.vue +45 -0
- package/systems/fs/client/machines/files/viewers/JsonView.vue +25 -0
- package/systems/fs/client/machines/metrics.ts +245 -0
- package/systems/fs/client/machines/palette.ts +98 -0
- package/systems/fs/client/preview/machines.ts +323 -0
- package/systems/fs/context/authoring/index.md +4 -0
- package/systems/fs/context/authoring/parts/actions.md +5 -1
- package/systems/fs/context/authoring/parts/actions.reference.md +6 -2
- package/systems/fs/context/authoring/parts/calling.md +5 -1
- package/systems/fs/context/authoring/parts/calling.reference.md +4 -0
- package/systems/fs/context/authoring/parts/client.md +31 -5
- package/systems/fs/context/authoring/parts/client.reference/client.md +8 -13
- package/systems/fs/context/authoring/parts/client.reference/pageinbox.md +524 -0
- package/systems/fs/context/authoring/parts/client.reference/{resultview.md → visuals.md} +135 -163
- package/systems/fs/context/authoring/parts/client.reference.md +11 -7
- package/systems/fs/context/authoring/parts/context/questions.md +49 -0
- package/systems/fs/context/authoring/parts/context.md +24 -2
- package/systems/fs/context/authoring/parts/context.reference.md +27 -3
- package/systems/fs/context/authoring/parts/contract.md +11 -1
- package/systems/fs/context/authoring/parts/contract.reference.md +26 -9
- package/systems/fs/context/authoring/parts/core-types/access-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/admin-ts.md +6 -2
- package/systems/fs/context/authoring/parts/core-types/api-index-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/approvals-ts.md +11 -7
- package/systems/fs/context/authoring/parts/core-types/auto-pair-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/checks-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/claims-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/config-secrets-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/connections-ts.md +15 -0
- package/systems/fs/context/authoring/parts/core-types/context-files-ts.md +9 -1
- package/systems/fs/context/authoring/parts/core-types/context-graph-ts.md +6 -2
- package/systems/fs/context/authoring/parts/core-types/context-questions-ts.md +26 -0
- package/systems/fs/context/authoring/parts/core-types/contextdecl.md +10 -2
- package/systems/fs/context/authoring/parts/core-types/data-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/decisions-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/fn-block-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/fn-facts-ts.md +11 -0
- package/systems/fs/context/authoring/parts/core-types/gin-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/grants-ts.md +5 -1
- package/systems/fs/context/authoring/parts/core-types/lifecycle-ts.md +44 -6
- package/systems/fs/context/authoring/parts/core-types/link-ts.md +7 -3
- package/systems/fs/context/authoring/parts/core-types/llm-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/manifest.md +41 -3
- package/systems/fs/context/authoring/parts/core-types/manifestpatch.md +34 -2
- package/systems/fs/context/authoring/parts/core-types/mention-search-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/model-calls-ts.md +5 -1
- package/systems/fs/context/authoring/parts/core-types/model-names-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/modes-ts.md +6 -2
- package/systems/fs/context/authoring/parts/core-types/owner-runs-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/package-ts.md +9 -0
- package/systems/fs/context/authoring/parts/core-types/primitives-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/query-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/records-actors-ts.md +7 -3
- package/systems/fs/context/authoring/parts/core-types/records-chat-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/records-content-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/records-runs-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/records-systems-ts.md +148 -0
- package/systems/fs/context/authoring/parts/core-types/registries-ts.md +101 -1
- package/systems/fs/context/authoring/parts/core-types/resources-ts.md +5 -1
- package/systems/fs/context/authoring/parts/core-types/run-ts.md +8 -1
- package/systems/fs/context/authoring/parts/core-types/sensitivity-ts.md +5 -1
- package/systems/fs/context/authoring/parts/core-types/stores-ts.md +199 -0
- package/systems/fs/context/authoring/parts/core-types/system-events-ts.md +8 -1
- package/systems/fs/context/authoring/parts/core-types/system-pages-ts.md +7 -1
- package/systems/fs/context/authoring/parts/core-types/system-providers-ts.md +5 -1
- package/systems/fs/context/authoring/parts/core-types/tables-ts.md +91 -0
- package/systems/fs/context/authoring/parts/core-types/validation-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/visuals-ts.md +4 -0
- package/systems/fs/context/authoring/parts/core-types/web-ts.md +4 -1
- package/systems/fs/context/authoring/parts/core-types.md +15 -8
- package/systems/fs/context/authoring/parts/ctx/update-result.md +33 -0
- package/systems/fs/context/authoring/parts/ctx.md +11 -1
- package/systems/fs/context/authoring/parts/ctx.reference/{hubai.md → adminnotices.md} +45 -4
- package/systems/fs/context/authoring/parts/ctx.reference/fnctx.md +21 -23
- package/systems/fs/context/authoring/parts/ctx.reference.md +8 -4
- package/systems/fs/context/authoring/parts/data.md +11 -6
- package/systems/fs/context/authoring/parts/data.reference.md +4 -0
- package/systems/fs/context/authoring/parts/examples/client-findview-vue.md +4 -0
- package/systems/fs/context/authoring/parts/examples/client-index-ts.md +4 -0
- package/systems/fs/context/authoring/parts/examples/client-notecard-vue.md +4 -0
- package/systems/fs/context/authoring/parts/examples/client-noteinput-vue.md +4 -0
- package/systems/fs/context/authoring/parts/examples/client-notespage-vue.md +4 -0
- package/systems/fs/context/authoring/parts/examples/client-reviewform-vue.md +4 -0
- package/systems/fs/context/authoring/parts/examples/client-wordcount-vue.md +4 -0
- package/systems/fs/context/authoring/parts/examples/package-json.md +4 -0
- package/systems/fs/context/authoring/parts/examples/server-env-ts.md +4 -0
- package/systems/fs/context/authoring/parts/examples/server-impl-ts.md +4 -0
- package/systems/fs/context/authoring/parts/examples/server-index-ts.md +4 -0
- package/systems/fs/context/authoring/parts/examples/server-main-ts.md +8 -4
- package/systems/fs/context/authoring/parts/examples/server-notes-test-ts.md +4 -0
- package/systems/fs/context/authoring/parts/examples/shared-index-ts.md +10 -0
- package/systems/fs/context/authoring/parts/examples/system-json.md +4 -0
- package/systems/fs/context/authoring/parts/examples/{systems-fs-shared-index-ts-lines-1-189.md → systems-fs-shared-index-ts-lines-1-178.md} +23 -30
- package/systems/fs/context/authoring/parts/examples/{systems-fs-shared-index-ts-lines-190-370.md → systems-fs-shared-index-ts-lines-179-382.md} +33 -6
- package/systems/fs/context/authoring/parts/examples/systems-fs-shared-index-ts-lines-383-567.md +210 -0
- package/systems/fs/context/authoring/parts/examples/systems-fs-shared-index-ts-lines-568-660.md +117 -0
- package/systems/fs/context/authoring/parts/examples/tsconfig-json.md +5 -1
- package/systems/fs/context/authoring/parts/examples.md +18 -11
- package/systems/fs/context/authoring/parts/fns.md +6 -2
- package/systems/fs/context/authoring/parts/fns.reference/fillclaims.md +5 -1
- package/systems/fs/context/authoring/parts/fns.reference/fn.md +6 -2
- package/systems/fs/context/authoring/parts/fns.reference.md +4 -0
- package/systems/fs/context/authoring/parts/folder.md +10 -6
- package/systems/fs/context/authoring/parts/gin.md +4 -0
- package/systems/fs/context/authoring/parts/gin.reference.md +4 -0
- package/systems/fs/context/authoring/parts/handlers-progress.md +5 -1
- package/systems/fs/context/authoring/parts/handlers-progress.reference.md +4 -0
- package/systems/fs/context/authoring/parts/hooks.md +5 -1
- package/systems/fs/context/authoring/parts/hooks.reference.md +5 -1
- package/systems/fs/context/authoring/parts/hub/context-questions.md +40 -0
- package/systems/fs/context/authoring/parts/hub/{hub-run-background.md → hub-ctx-from-resource.md} +52 -57
- package/systems/fs/context/authoring/parts/hub/hub-fns-load.md +35 -42
- package/systems/fs/context/authoring/parts/hub/hub-install-package.md +327 -0
- package/systems/fs/context/authoring/parts/hub/kinds-of-hub.md +8 -0
- package/systems/fs/context/authoring/parts/hub.md +14 -8
- package/systems/fs/context/authoring/parts/hub.reference.md +11 -2
- package/systems/fs/context/authoring/parts/internals/manifestof.md +6 -2
- package/systems/fs/context/authoring/parts/internals/permissionargs.md +8 -4
- package/systems/fs/context/authoring/parts/internals/usagefromwire.md +47 -2
- package/systems/fs/context/authoring/parts/internals.md +6 -2
- package/systems/fs/context/authoring/parts/kinds-agents.md +6 -2
- package/systems/fs/context/authoring/parts/kinds-agents.reference/authoringsession.md +10 -4
- package/systems/fs/context/authoring/parts/kinds-agents.reference/kind.md +11 -7
- package/systems/fs/context/authoring/parts/kinds-agents.reference.md +4 -0
- package/systems/fs/context/authoring/parts/lifecycle.md +8 -3
- package/systems/fs/context/authoring/parts/lifecycle.reference.md +6 -2
- package/systems/fs/context/authoring/parts/mentions.md +5 -1
- package/systems/fs/context/authoring/parts/mentions.reference.md +6 -2
- package/systems/fs/context/authoring/parts/mistakes.md +7 -2
- package/systems/fs/context/authoring/parts/named-types.md +4 -0
- package/systems/fs/context/authoring/parts/named-types.reference.md +6 -2
- package/systems/fs/context/authoring/parts/outcomes.md +7 -3
- package/systems/fs/context/authoring/parts/outcomes.reference.md +6 -2
- package/systems/fs/context/authoring/parts/owner-runs.md +5 -1
- package/systems/fs/context/authoring/parts/owner-runs.reference.md +36 -11
- package/systems/fs/context/authoring/parts/packaging.md +14 -7
- package/systems/fs/context/authoring/parts/packaging.reference.md +7 -2
- package/systems/fs/context/authoring/parts/providers.md +5 -1
- package/systems/fs/context/authoring/parts/providers.reference.md +5 -1
- package/systems/fs/context/authoring/parts/remote.md +9 -5
- package/systems/fs/context/authoring/parts/remote.reference.md +204 -16
- package/systems/fs/context/authoring/parts/resources.md +5 -1
- package/systems/fs/context/authoring/parts/resources.reference.md +4 -0
- package/systems/fs/context/authoring/parts/server.md +12 -8
- package/systems/fs/context/authoring/parts/server.reference.md +55 -34
- package/systems/fs/context/authoring/parts/settings-attachments.md +5 -1
- package/systems/fs/context/authoring/parts/settings-attachments.reference.md +4 -0
- package/systems/fs/context/authoring/parts/start.md +5 -1
- package/systems/fs/context/authoring/parts/state-forms.md +5 -1
- package/systems/fs/context/authoring/parts/state-forms.reference.md +4 -0
- package/systems/fs/context/authoring/parts/store/ctx-store.md +49 -0
- package/systems/fs/context/authoring/parts/store/declare.md +32 -0
- package/systems/fs/context/authoring/parts/store/engines.md +25 -0
- package/systems/fs/context/authoring/parts/store/migrations.md +53 -0
- package/systems/fs/context/authoring/parts/store/moves.md +38 -0
- package/systems/fs/context/authoring/parts/store/placement.md +25 -0
- package/systems/fs/context/authoring/parts/store/serve.md +30 -0
- package/systems/fs/context/authoring/parts/store/store-tables.md +24 -0
- package/systems/fs/context/authoring/parts/store/vectors.md +32 -0
- package/systems/fs/context/authoring/parts/store/when-to-use.md +27 -0
- package/systems/fs/context/authoring/parts/store/work.md +37 -0
- package/systems/fs/context/authoring/parts/store.md +65 -0
- package/systems/fs/context/authoring/parts/store.reference.md +459 -0
- package/systems/fs/context/authoring/parts/testing.md +14 -1
- package/systems/fs/context/authoring/parts/testing.reference/{memoryjournal.md → equal.md} +57 -50
- package/systems/fs/context/authoring/parts/testing.reference/fakehub.md +27 -46
- package/systems/fs/context/authoring/parts/testing.reference/{toolcall.md → kindprops.md} +128 -9
- package/systems/fs/context/authoring/parts/testing.reference/storeconnection.md +93 -0
- package/systems/fs/context/authoring/parts/testing.reference.md +16 -9
- package/systems/fs/context/authoring/parts/widgets.md +36 -22
- package/systems/fs/context/authoring/parts/widgets.reference.md +506 -8
- package/systems/fs/context/authoring/topics/begin.md +4 -0
- package/systems/fs/context/authoring/topics/client.md +4 -0
- package/systems/fs/context/authoring/topics/declare.md +4 -0
- package/systems/fs/context/authoring/topics/examples.md +4 -0
- package/systems/fs/context/authoring/topics/fns.md +4 -0
- package/systems/fs/context/authoring/topics/server.md +4 -0
- package/systems/fs/context/authoring/topics/types.md +8 -1
- package/systems/fs/context/comments/answer.md +21 -0
- package/systems/fs/context/comments/find.md +23 -0
- package/systems/fs/context/comments/read.md +26 -0
- package/systems/fs/context/comments.md +23 -0
- package/systems/fs/context/files-page.md +30 -0
- package/systems/fs/context/guide/attachments.md +16 -0
- package/systems/fs/context/guide/change.md +23 -0
- package/systems/fs/context/guide/commands.md +19 -0
- package/systems/fs/context/guide/documents.md +21 -0
- package/systems/fs/context/guide/find.md +25 -0
- package/systems/fs/context/guide/paths.md +24 -0
- package/systems/fs/context/guide/read.md +21 -0
- package/systems/fs/context/machine/history.md +25 -0
- package/systems/fs/context/machine/now.md +25 -0
- package/systems/fs/context/machine/processes.md +20 -0
- package/systems/fs/context/machine/recording.md +19 -0
- package/systems/fs/context/machine.md +24 -0
- package/systems/fs/package.json +5 -3
- package/systems/fs/server/files-page/browse.ts +391 -0
- package/systems/fs/server/files-page/comments.ts +439 -0
- package/systems/fs/server/files-page/fns.ts +158 -0
- package/systems/fs/server/files-page/git-view.ts +391 -0
- package/systems/fs/server/files-page/kinds.ts +56 -0
- package/systems/fs/server/hosting.ts +10 -10
- package/systems/fs/server/impl.ts +66 -7
- package/systems/fs/server/main.ts +28 -12
- package/systems/fs/server/metrics/collector.ts +424 -0
- package/systems/fs/server/metrics/index.ts +181 -0
- package/systems/fs/server/metrics/os.ts +144 -0
- package/systems/fs/server/metrics/parsers.ts +268 -0
- package/systems/fs/server/metrics/rrd.ts +363 -0
- package/systems/fs/server/metrics/testing.ts +80 -0
- package/systems/fs/server/shell.ts +1 -1
- package/systems/fs/server/snapshots.ts +216 -33
- package/systems/fs/server/testing.ts +15 -9
- package/systems/fs/shared/files-page.ts +506 -0
- package/systems/fs/shared/index.ts +138 -11
- package/systems/fs/shared/metrics.ts +179 -0
- package/systems/fs/system.json +10 -1
- package/systems/google-calendar/package.json +1 -1
- package/systems/google-calendar/server/main.ts +4 -4
- package/systems/input/package.json +3 -3
- package/systems/input/server/main.ts +6 -6
- package/systems/mcp/client/McpServerForm.vue +99 -0
- package/systems/mcp/client/ServerList.vue +78 -0
- package/systems/mcp/client/ServerPage.vue +194 -0
- package/systems/mcp/client/ServersPage.vue +32 -0
- package/systems/mcp/client/index.ts +15 -0
- package/systems/mcp/client/logic.ts +224 -0
- package/systems/mcp/client/state.ts +128 -0
- package/systems/mcp/package.json +9 -6
- package/systems/mcp/server/dial.ts +1 -1
- package/systems/mcp/server/impl.ts +2 -1
- package/systems/mcp/server/instance.ts +3 -5
- package/systems/mcp/server/main.ts +10 -6
- package/systems/mcp/server/mirror.ts +2 -3
- package/systems/mcp/server/oauth.ts +3 -2
- package/systems/mcp/server/server-link.ts +2 -1
- package/systems/mcp/shared/index.ts +15 -2
- package/{packages/core/src/mcp-servers.ts → systems/mcp/shared/servers.ts} +6 -5
- package/systems/mcp/system.json +2 -1
- package/systems/mcp/tsconfig.json +2 -2
- package/systems/ollama/package.json +3 -3
- package/systems/ollama/server/main.ts +5 -5
- package/systems/schedule/package.json +3 -4
- package/systems/schedule/server/env.ts +1 -1
- package/systems/schedule/server/fns.ts +5 -4
- package/systems/schedule/server/impl.ts +2 -2
- package/systems/schedule/server/import.ts +189 -0
- package/systems/schedule/server/index.ts +2 -0
- package/systems/schedule/server/main.ts +9 -7
- package/systems/schedule/server/placements.ts +41 -0
- package/systems/schedule/server/store.ts +159 -79
- package/systems/schedule/server/timer.ts +142 -107
- package/systems/schedule/shared/index.ts +2 -1
- package/systems/schedule/system.json +5 -1
- package/systems/schedule/tsconfig.json +1 -1
- package/systems/template/README.md +2 -2
- package/systems/template/package.json +1 -1
- package/systems/template/server/main.ts +4 -4
- package/systems/widgets/client/ChipRow.vue +22 -0
- package/systems/widgets/client/ProposalCard.vue +6 -5
- package/systems/widgets/client/SavedWidget.vue +11 -8
- package/systems/widgets/client/WidgetChips.vue +137 -0
- package/systems/widgets/client/WidgetView.vue +32 -0
- package/systems/widgets/client/charts/ChartVisual.vue +157 -0
- package/systems/widgets/client/charts/chart-data.ts +230 -0
- package/systems/widgets/client/charts/echarts-setup.ts +69 -0
- package/systems/widgets/client/charts/export.ts +36 -0
- package/systems/widgets/client/charts/families/calendar.ts +105 -0
- package/systems/widgets/client/charts/families/category.ts +186 -0
- package/systems/widgets/client/charts/families/crosstab.ts +113 -0
- package/systems/widgets/client/charts/families/distribution.ts +160 -0
- package/systems/widgets/client/charts/families/finance.ts +96 -0
- package/systems/widgets/client/charts/families/gauge.ts +75 -0
- package/systems/widgets/client/charts/families/hierarchy.ts +166 -0
- package/systems/widgets/client/charts/families/index.ts +21 -0
- package/systems/widgets/client/charts/families/network.ts +140 -0
- package/systems/widgets/client/charts/families/part.ts +61 -0
- package/systems/widgets/client/charts/families/profile.ts +30 -0
- package/systems/widgets/client/charts/families/progress.ts +76 -0
- package/systems/widgets/client/charts/families/range.ts +107 -0
- package/systems/widgets/client/charts/families/time.ts +177 -0
- package/systems/widgets/client/charts/families/timeline.ts +114 -0
- package/systems/widgets/client/charts/families/wide.ts +41 -0
- package/systems/widgets/client/charts/index.ts +37 -0
- package/systems/widgets/client/charts/maths.ts +139 -0
- package/systems/widgets/client/charts/size.ts +39 -0
- package/systems/widgets/client/chips.ts +150 -0
- package/systems/widgets/client/index.ts +18 -5
- package/systems/widgets/client/proposal.ts +2 -1
- package/systems/widgets/package.json +7 -4
- package/systems/widgets/server/authoring.ts +13 -7
- package/systems/widgets/server/env.ts +1 -1
- package/systems/widgets/server/impl.ts +10 -6
- package/systems/widgets/server/main.ts +6 -6
- package/systems/widgets/server/run.ts +16 -9
- package/systems/widgets/server/upgrade.ts +34 -0
- package/systems/widgets/shared/args.ts +137 -0
- package/systems/widgets/shared/charts.ts +243 -0
- package/systems/widgets/shared/index.ts +12 -3
- package/{packages/sdk/src → systems/widgets/shared}/relative-dates.ts +2 -1
- package/systems/widgets/shared/spec.ts +208 -0
- package/{packages/sdk/src → systems/widgets/shared}/widget-check.ts +7 -9
- package/{packages/sdk/src → systems/widgets/shared}/widget-schema.ts +4 -4
- package/packages/core/src/remote-auth.ts +0 -111
- package/packages/core/src/widgets.ts +0 -427
- package/packages/web/dist/assets/AdminLayout-sLjVTrmV.js +0 -2
- package/packages/web/dist/assets/ApiServiceForm-BrMTU-7u.js +0 -2
- package/packages/web/dist/assets/ApiServiceForm-BxprSaAq.css +0 -1
- package/packages/web/dist/assets/ApiServiceView-BMF2zD6Q.js +0 -2
- package/packages/web/dist/assets/ApiServiceView-BVmdRCjR.css +0 -1
- package/packages/web/dist/assets/ApiServicesView-BTLV6c8n.css +0 -1
- package/packages/web/dist/assets/ApiServicesView-bjLAWO_j.js +0 -2
- package/packages/web/dist/assets/ChartVisual-BnFG9aFi.css +0 -1
- package/packages/web/dist/assets/ChartVisual-DWw7WsfN.js +0 -11
- package/packages/web/dist/assets/ChatPage-7Yebk7rl.js +0 -4
- package/packages/web/dist/assets/ConfigWithCustom-DreTUdf0.js +0 -3
- package/packages/web/dist/assets/ContextItemPage-B6rJG3OT.js +0 -2
- package/packages/web/dist/assets/ContextItemPage-BRsWxOmu.css +0 -1
- package/packages/web/dist/assets/ContextPage-CloIZ_2y.js +0 -2
- package/packages/web/dist/assets/ContextPage-rYKxjiVI.css +0 -1
- package/packages/web/dist/assets/ContextRow-Byz_7HG-.css +0 -1
- package/packages/web/dist/assets/ContextRow-Dvv8CTFk.js +0 -2
- package/packages/web/dist/assets/DataTypePage-Ba_zBV4b.js +0 -4
- package/packages/web/dist/assets/FnList-BCnb4kOB.css +0 -1
- package/packages/web/dist/assets/FnList-CjQRwYaT.js +0 -2
- package/packages/web/dist/assets/GraphPanel-Cy5-KGo1.js +0 -2
- package/packages/web/dist/assets/InjectedList-CJsEFEbz.js +0 -2
- package/packages/web/dist/assets/InstallDialog-C9GDoUI2.js +0 -2
- package/packages/web/dist/assets/InstanceTypes-D8Jcxn70.js +0 -2
- package/packages/web/dist/assets/InstanceTypes-DAowwLB7.css +0 -1
- package/packages/web/dist/assets/InstanceView-CuBD3JPU.css +0 -1
- package/packages/web/dist/assets/InstanceView-p7tMaylE.js +0 -2
- package/packages/web/dist/assets/LimitsView-DsZG6u5P.js +0 -2
- package/packages/web/dist/assets/ListSearch-BK4p7Nxa.js +0 -2
- package/packages/web/dist/assets/McpDialog-CA_0WKWF.js +0 -2
- package/packages/web/dist/assets/McpServerForm-CAG8Wp2N.js +0 -2
- package/packages/web/dist/assets/McpServerForm-DsHaf5Um.css +0 -1
- package/packages/web/dist/assets/McpServerView-7I76EznB.css +0 -1
- package/packages/web/dist/assets/McpServerView-CD8qw6W_.js +0 -2
- package/packages/web/dist/assets/McpServersView-DNycG35u.js +0 -2
- package/packages/web/dist/assets/ModelsView-C_iN19xt.js +0 -2
- package/packages/web/dist/assets/PairPage-Bs2KuRjC.css +0 -1
- package/packages/web/dist/assets/PairPage-TEXPpsqi.js +0 -2
- package/packages/web/dist/assets/PeopleView-D1QGPYp7.js +0 -2
- package/packages/web/dist/assets/PoliciesView-BU1fudNF.js +0 -2
- package/packages/web/dist/assets/RemoteAuthFields-Dm44vz2t.css +0 -1
- package/packages/web/dist/assets/RemoteAuthFields-nxGWfmhf.js +0 -2
- package/packages/web/dist/assets/ResourcesPage-YluNBqIv.js +0 -2
- package/packages/web/dist/assets/ResultGrid-CuUQyTjW.css +0 -1
- package/packages/web/dist/assets/ResultGrid-uoq4yUYj.js +0 -2
- package/packages/web/dist/assets/ReviewView-79Z5rU1v.js +0 -3
- package/packages/web/dist/assets/RunCard-CBSGdwdQ.js +0 -2
- package/packages/web/dist/assets/RunCard-CfyRaDLS.css +0 -1
- package/packages/web/dist/assets/RunsView-Dz9Xsvu5.js +0 -2
- package/packages/web/dist/assets/ServiceRows-6BU4-MeL.css +0 -1
- package/packages/web/dist/assets/ServiceRows-DNzDiutg.js +0 -2
- package/packages/web/dist/assets/SignInPage-Djx-M-0U.css +0 -1
- package/packages/web/dist/assets/SystemPageHost-BeZ-6N0-.css +0 -1
- package/packages/web/dist/assets/SystemPageHost-DLNg2FYK.js +0 -2
- package/packages/web/dist/assets/SystemView-Es5wtkYU.js +0 -2
- package/packages/web/dist/assets/SystemsView-CeuSFhlF.js +0 -2
- package/packages/web/dist/assets/WidgetView-BZyDyYRI.js +0 -3
- package/packages/web/dist/assets/WidgetView-DQUDeFkB.css +0 -1
- package/packages/web/dist/assets/export-BwFkEtcm.js +0 -15
- package/packages/web/dist/assets/index-Bv42jNvr.js +0 -4
- package/packages/web/dist/assets/index-CSisx5mi.css +0 -1
- package/packages/web/dist/assets/problems-BZY0Dwif.js +0 -2
- package/packages/web/dist/assets/record-edits-CveFEsal.js +0 -2
- package/packages/web/dist/assets/remote-config-BkaarDf3.js +0 -2
- package/packages/web/dist/assets/routes-qP_j74V5.js +0 -4
- package/packages/web/dist/assets/runs-k76usGfd.js +0 -2
- package/packages/web/dist/assets/size-BwnshyOe.js +0 -2
- package/packages/web/dist/assets/src-DLK1P7oz.js +0 -43
- package/packages/web/dist/assets/state-CjE-qA2w.js +0 -2
- package/packages/web/dist/assets/ui-W12UYhVu.js +0 -17
- package/packages/web/dist/assets/widget-host-BCf6Tlt5.js +0 -2
- package/packages/web/dist/assets/widgets-CrbkovMT.js +0 -2
- package/systems/fs/context/authoring/parts/client.reference/fnpillprops.md +0 -141
- package/systems/fs/context/authoring/parts/core-types/remote-auth-ts.md +0 -60
- package/systems/fs/context/authoring/parts/core-types/widgets-ts.md +0 -299
- package/systems/fs/context/authoring/parts/examples/systems-fs-shared-index-ts-lines-371-533.md +0 -183
- package/systems/fs/context/authoring/parts/hub/hub-auto-pair-revoke.md +0 -189
- package/systems/fs/context/authoring/parts/widgets.reference/hub-visuals.md +0 -623
- package/systems/fs/context/authoring/parts/widgets.reference/sourcecompatible.md +0 -150
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
# Generated by scripts/docs/authoring.ts from the authoring guide (npm run docs:authoring); do not edit.
|
|
3
|
-
key: "authoring.examples.systems-fs-shared-index-ts-lines-1-
|
|
4
|
-
title: "Worked examples: systems/fs/shared/index.ts, lines 1-
|
|
5
|
-
description: "Worked examples, the part on systems/fs/shared/index.ts, lines 1-
|
|
6
|
-
summary: "Worked examples: systems/fs/shared/index.ts, lines 1-
|
|
3
|
+
key: "authoring.examples.systems-fs-shared-index-ts-lines-1-178"
|
|
4
|
+
title: "Worked examples: systems/fs/shared/index.ts, lines 1-178"
|
|
5
|
+
description: "Worked examples, the part on systems/fs/shared/index.ts, lines 1-178."
|
|
6
|
+
summary: "Worked examples: systems/fs/shared/index.ts, lines 1-178."
|
|
7
|
+
question: "What is in the worked example file systems/fs/shared/index.ts, lines 1-178?"
|
|
8
|
+
when: "When copying from systems/fs/shared/index.ts, lines 1-178 of a working system."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
7
11
|
parent: "fs/authoring.examples"
|
|
8
|
-
next: "fs/authoring.examples.systems-fs-shared-index-ts-lines-
|
|
12
|
+
next: "fs/authoring.examples.systems-fs-shared-index-ts-lines-179-382"
|
|
9
13
|
fns: ["fs/read", "fs/write", "fs/edit", "fs/bash"]
|
|
10
14
|
tags: ["authoring"]
|
|
11
15
|
niche: "developer"
|
|
@@ -17,7 +21,7 @@ The fs system (`systems/fs`) gives agents files and a shell over chosen folders.
|
|
|
17
21
|
real system's declarations: a named type with a method, a setting, an attachment, fns with status words, undo, state,
|
|
18
22
|
progress and handlers, a hook, a mention provider, static and dynamic context, and an agent.
|
|
19
23
|
|
|
20
|
-
#### `systems/fs/shared/index.ts`, lines 1-
|
|
24
|
+
#### `systems/fs/shared/index.ts`, lines 1-178
|
|
21
25
|
|
|
22
26
|
```ts
|
|
23
27
|
/**
|
|
@@ -27,10 +31,13 @@ progress and handlers, a hook, a mention provider, static and dynamic context, a
|
|
|
27
31
|
* implements it and its client draws it.
|
|
28
32
|
*/
|
|
29
33
|
import { ChangeSet, SensitivityRule } from '@harness/core';
|
|
30
|
-
import { type Infer, type ValueOf, agent, agents, arg, attachment, context, fn, ginAs, g, handler, hook, hub, linear, mention, setting, system, type } from '@harness/sdk';
|
|
34
|
+
import { type Infer, type ValueOf, agent, agents, arg, attachment, context, fn, ginAs, g, handler, hook, hub, linear, mention, setting, store, system, type } from '@harness/sdk';
|
|
35
|
+
import { FILES_PAGE_FNS } from './files-page.ts';
|
|
31
36
|
import { HostedState, HostedStatus, InstallArgs, InstallResult, RestartArgs, StatusArgs, StopArgs, StopResult } from './hosting.ts';
|
|
37
|
+
import { MACHINES_PAGE, MachineNow, MachineNowArgs, MetricsConfig, MetricsList, MetricsRead, MetricsReadArgs, TopProcesses } from './metrics.ts';
|
|
32
38
|
|
|
33
39
|
export * from './hosting.ts';
|
|
40
|
+
export * from './metrics.ts';
|
|
34
41
|
|
|
35
42
|
/** A file or folder under one of the roots. */
|
|
36
43
|
export const Entry = type({
|
|
@@ -112,6 +119,8 @@ export const fs = system('fs', {
|
|
|
112
119
|
'Its fns read, list and search files (fs/read, fs/list, fs/glob, fs/grep), change them (fs/write, fs/edit, fs/remove: each may ask the person first, and each can be undone) and run bash commands (fs/bash, fs/cd).',
|
|
113
120
|
'Reach for it to look at or change the person\'s files, and to keep a lasting document they can open later (a note, a list, a summary) as a markdown file. It defines no fn kinds.',
|
|
114
121
|
'A file the person attached to a chat message is not an fs file: it is a hub resource, read with the hub\'s resource fns. Its fns for installing and hosting systems (fs/install_system, fs/system_status, fs/restart_system, fs/stop_system, fs/restart) are for admins and system authors.',
|
|
122
|
+
'People leave comments on files (on lines, selected text or marked areas of pictures) from the Files tab of the Machines page: fs/commented_files lists the files with comments, fs/comments and fs/comment read them, fs/comment_reply and fs/comment_resolve answer them.',
|
|
123
|
+
'When an admin turned on recording, it also says what its machine is doing (fs/machine_now, fs/metrics_list, fs/metrics_read: CPU, memory, drives, network, disk and GPU over time, and fs/processes for admins).',
|
|
115
124
|
'Load its guide (fs/guide) before the first file change.',
|
|
116
125
|
].join(' '),
|
|
117
126
|
// its authoring agents use models; installs wait for an admin and pair what they start; it keeps each person's cwd,
|
|
@@ -122,9 +131,14 @@ export const fs = system('fs', {
|
|
|
122
131
|
{ name: 'files', title: 'Files', description: 'Read, write, edit, delete and search files under the roots, and ask questions about the code.' },
|
|
123
132
|
{ name: 'shell', title: 'Shell', description: 'Run commands (builds, tests, git) in a working folder; each command lists the files it changed.' },
|
|
124
133
|
{ name: 'systems', title: 'Systems', description: 'Install, check, restart and stop the systems this machine hosts, and restart fs itself.' },
|
|
134
|
+
{ name: 'machine', title: 'Machine', description: 'What this machine is doing: CPU, memory, drives, network, disk, GPU and its busiest processes, now and over time.' },
|
|
125
135
|
],
|
|
136
|
+
// the Machines page: pick one of the connected fs machines, then its metrics or its files (client/MachinesPage.vue)
|
|
137
|
+
pages: [{ segment: MACHINES_PAGE, title: 'Machines', description: 'Each connected machine: its CPU, memory, drives, network, disk and GPU over time, and its files.', icon: 'monitor', nav: 'main', component: 'MachinesPage' }],
|
|
126
138
|
})
|
|
127
139
|
.with({
|
|
140
|
+
// the undo snapshots' index; the copies themselves stay files in its data folder
|
|
141
|
+
store: store({ description: 'The undo snapshots\' index: which file each kept copy was taken of, when, and its size. The copies stay files in its data folder.' }),
|
|
128
142
|
// set by an admin in the hub; the server gets it typed when it starts
|
|
129
143
|
config: g.obj({
|
|
130
144
|
// the folders it serves and works in; nothing outside them is reachable
|
|
@@ -143,6 +157,8 @@ export const fs = system('fs', {
|
|
|
143
157
|
commandEnv: g.field(g.optional(g.list(g.text({ minLength: 1 }))), { docs: 'Env variables commands also get, by name. Others are never passed on.' }),
|
|
144
158
|
// how many undo copies fs keeps (server/snapshots.ts); left out: SNAPSHOT_DEFAULTS
|
|
145
159
|
snapshots: g.field(g.optional(SnapshotLimits), { docs: 'How many undo copies to keep per file, and how much space they may use in all.' }),
|
|
160
|
+
// whether this machine records its metrics into the store (server/metrics/); left out: it doesn't
|
|
161
|
+
metrics: g.field(g.optional(MetricsConfig), { docs: 'Record this machine\'s metrics (CPU, memory, drives, network, disk, GPU, busiest processes) for the Machines page and the metrics fns.' }),
|
|
146
162
|
}),
|
|
147
163
|
types: { Entry },
|
|
148
164
|
settings: {
|
|
@@ -186,29 +202,6 @@ export const fs = system('fs', {
|
|
|
186
202
|
effects: { mode: 'write', free: true },
|
|
187
203
|
// the hub asks which sensitive files a call touches first (server/sensitive.ts)
|
|
188
204
|
flags: true,
|
|
189
|
-
args: g.obj({ path: path(), text: hub.types.LongText }),
|
|
190
|
-
// two changes to one file in the same step run in the model's order (server/impl.ts fileClaims)
|
|
191
|
-
dynamicClaims: true,
|
|
192
|
-
returns: g.obj({ created: g.bool() }),
|
|
193
|
-
status: {
|
|
194
|
-
active: { one: 'Writing {args.path}…', many: 'Writing {n} files…' },
|
|
195
|
-
retry: { one: 'Retrying writing {args.path}…', many: 'Retrying {n} file writes…' },
|
|
196
|
-
done: { one: 'Wrote {args.path}', many: 'Wrote {n} files' },
|
|
197
|
-
failed: { one: 'Writing {args.path} failed', many: '{n} file writes failed' },
|
|
198
|
-
},
|
|
199
|
-
undo: Previous,
|
|
200
|
-
}),
|
|
201
|
-
edit: fn({
|
|
202
|
-
group: 'files',
|
|
203
|
-
description: 'Change part of a file: replace exact text with new text. Gives how many places were replaced.',
|
|
204
|
-
instructions: 'Read the file first (fs/read) and copy `find` exactly as it is there, spaces and line breaks included, with enough around it to be unique; the edit fails when it matches nothing or (without `all`) more than once. Set `all` to replace every match (renaming a word). It can be undone.',
|
|
205
|
-
examples: [
|
|
206
|
-
{ args: { path: 'src/config.ts', find: 'timeout: 30_000,', replace: 'timeout: 60_000,' }, result: { replacements: 1 } },
|
|
207
|
-
{ args: { path: 'docs/guide.md', find: 'colour', replace: 'color', all: true }, result: { replacements: 4 }, note: 'Every match.' },
|
|
208
|
-
],
|
|
209
|
-
effects: { mode: 'write', free: true },
|
|
210
|
-
// the hub asks which sensitive files a call touches first (server/sensitive.ts)
|
|
211
|
-
flags: true,
|
|
212
205
|
```
|
|
213
206
|
|
|
214
207
|
Fns for this: fn:fs/read, fn:fs/write, fn:fs/edit, fn:fs/bash.
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
# Generated by scripts/docs/authoring.ts from the authoring guide (npm run docs:authoring); do not edit.
|
|
3
|
-
key: "authoring.examples.systems-fs-shared-index-ts-lines-
|
|
4
|
-
title: "Worked examples: systems/fs/shared/index.ts, lines
|
|
5
|
-
description: "Worked examples, the part on systems/fs/shared/index.ts, lines
|
|
6
|
-
summary: "Worked examples: systems/fs/shared/index.ts, lines
|
|
3
|
+
key: "authoring.examples.systems-fs-shared-index-ts-lines-179-382"
|
|
4
|
+
title: "Worked examples: systems/fs/shared/index.ts, lines 179-382"
|
|
5
|
+
description: "Worked examples, the part on systems/fs/shared/index.ts, lines 179-382."
|
|
6
|
+
summary: "Worked examples: systems/fs/shared/index.ts, lines 179-382."
|
|
7
|
+
question: "What is in the worked example file systems/fs/shared/index.ts, lines 179-382?"
|
|
8
|
+
when: "When copying from systems/fs/shared/index.ts, lines 179-382 of a working system."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
7
11
|
parent: "fs/authoring.examples"
|
|
8
|
-
next: "fs/authoring.examples.systems-fs-shared-index-ts-lines-
|
|
12
|
+
next: "fs/authoring.examples.systems-fs-shared-index-ts-lines-383-567"
|
|
9
13
|
fns: ["fs/read", "fs/write", "fs/edit", "fs/bash"]
|
|
10
14
|
tags: ["authoring"]
|
|
11
15
|
niche: "developer"
|
|
@@ -13,9 +17,32 @@ niche: "developer"
|
|
|
13
17
|
|
|
14
18
|
### The fs system's contract
|
|
15
19
|
|
|
16
|
-
#### `systems/fs/shared/index.ts`, lines
|
|
20
|
+
#### `systems/fs/shared/index.ts`, lines 179-382
|
|
17
21
|
|
|
18
22
|
```ts
|
|
23
|
+
args: g.obj({ path: path(), text: hub.types.LongText }),
|
|
24
|
+
// two changes to one file in the same step run in the model's order (server/impl.ts fileClaims)
|
|
25
|
+
dynamicClaims: true,
|
|
26
|
+
returns: g.obj({ created: g.bool() }),
|
|
27
|
+
status: {
|
|
28
|
+
active: { one: 'Writing {args.path}…', many: 'Writing {n} files…' },
|
|
29
|
+
retry: { one: 'Retrying writing {args.path}…', many: 'Retrying {n} file writes…' },
|
|
30
|
+
done: { one: 'Wrote {args.path}', many: 'Wrote {n} files' },
|
|
31
|
+
failed: { one: 'Writing {args.path} failed', many: '{n} file writes failed' },
|
|
32
|
+
},
|
|
33
|
+
undo: Previous,
|
|
34
|
+
}),
|
|
35
|
+
edit: fn({
|
|
36
|
+
group: 'files',
|
|
37
|
+
description: 'Change part of a file: replace exact text with new text. Gives how many places were replaced.',
|
|
38
|
+
instructions: 'Read the file first (fs/read) and copy `find` exactly as it is there, spaces and line breaks included, with enough around it to be unique; the edit fails when it matches nothing or (without `all`) more than once. Set `all` to replace every match (renaming a word). It can be undone.',
|
|
39
|
+
examples: [
|
|
40
|
+
{ args: { path: 'src/config.ts', find: 'timeout: 30_000,', replace: 'timeout: 60_000,' }, result: { replacements: 1 } },
|
|
41
|
+
{ args: { path: 'docs/guide.md', find: 'colour', replace: 'color', all: true }, result: { replacements: 4 }, note: 'Every match.' },
|
|
42
|
+
],
|
|
43
|
+
effects: { mode: 'write', free: true },
|
|
44
|
+
// the hub asks which sensitive files a call touches first (server/sensitive.ts)
|
|
45
|
+
flags: true,
|
|
19
46
|
args: g.obj({ path: path(), find: g.text({ minLength: 1 }), replace: g.text(), all: g.optional(g.bool()) }),
|
|
20
47
|
// two changes to one file in the same step run in the model's order (server/impl.ts fileClaims)
|
|
21
48
|
dynamicClaims: true,
|
package/systems/fs/context/authoring/parts/examples/systems-fs-shared-index-ts-lines-383-567.md
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
---
|
|
2
|
+
# Generated by scripts/docs/authoring.ts from the authoring guide (npm run docs:authoring); do not edit.
|
|
3
|
+
key: "authoring.examples.systems-fs-shared-index-ts-lines-383-567"
|
|
4
|
+
title: "Worked examples: systems/fs/shared/index.ts, lines 383-567"
|
|
5
|
+
description: "Worked examples, the part on systems/fs/shared/index.ts, lines 383-567."
|
|
6
|
+
summary: "Worked examples: systems/fs/shared/index.ts, lines 383-567."
|
|
7
|
+
question: "What is in the worked example file systems/fs/shared/index.ts, lines 383-567?"
|
|
8
|
+
when: "When copying from systems/fs/shared/index.ts, lines 383-567 of a working system."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
11
|
+
parent: "fs/authoring.examples"
|
|
12
|
+
next: "fs/authoring.examples.systems-fs-shared-index-ts-lines-568-660"
|
|
13
|
+
fns: ["fs/read", "fs/write", "fs/edit", "fs/bash"]
|
|
14
|
+
tags: ["authoring"]
|
|
15
|
+
niche: "developer"
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
### The fs system's contract
|
|
19
|
+
|
|
20
|
+
#### `systems/fs/shared/index.ts`, lines 383-567
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
system_status: fn({
|
|
24
|
+
group: 'systems',
|
|
25
|
+
description: 'The systems this machine hosts: each one\'s state, version, process, restarts in the last hour and the end of its output.',
|
|
26
|
+
instructions: 'Call it after install_system, restart_system or a crash to see whether a hosted system is up, and read `output` to find why it stopped. Give `system` for one; empty lists all.',
|
|
27
|
+
examples: [
|
|
28
|
+
{
|
|
29
|
+
args: { system: 'random' },
|
|
30
|
+
result: [{ system: 'random', instance: 'main', version: '0.1.0', state: 'connected', pid: 4120, restartsLastHour: 0, folder: 'C:/work/harness/systems/random', bundleHash: '9f2c…', output: 'random.serving …' }],
|
|
31
|
+
},
|
|
32
|
+
{ args: {}, note: 'Every hosted system.' },
|
|
33
|
+
],
|
|
34
|
+
args: StatusArgs,
|
|
35
|
+
returns: g.list(HostedStatus),
|
|
36
|
+
effects: { mode: 'read', free: true },
|
|
37
|
+
display: 'message',
|
|
38
|
+
tags: ['read', 'systems'],
|
|
39
|
+
}),
|
|
40
|
+
restart_system: fn({
|
|
41
|
+
group: 'systems',
|
|
42
|
+
description: 'Restart a system this machine hosts, with the code an admin approved.',
|
|
43
|
+
instructions: 'Use it when a hosted system is stuck, crashed or was disabled after too many crashes. It runs the approved bundle again; it never picks up changed code (call install_system for that). Say why in `reason`.',
|
|
44
|
+
examples: [{ args: { system: 'random', reason: 'It stopped answering after the hub restarted.' }, result: { state: 'connected' } }],
|
|
45
|
+
args: RestartArgs,
|
|
46
|
+
returns: g.obj({ state: HostedState }),
|
|
47
|
+
effects: { mode: 'write', free: true },
|
|
48
|
+
operations: { cancel: false, background: false },
|
|
49
|
+
tags: ['systems'],
|
|
50
|
+
}),
|
|
51
|
+
stop_system: fn({
|
|
52
|
+
group: 'systems',
|
|
53
|
+
description: 'Stop a system this machine hosts; with `remove`, also delete its hosted folders.',
|
|
54
|
+
instructions: 'It stays stopped (also after fs restarts) until install_system or restart_system starts it again. `remove` deletes its bundle, state and data for good, so the person is asked first; use it only when they want the system gone.',
|
|
55
|
+
examples: [
|
|
56
|
+
{ args: { system: 'random' }, result: { stopped: true, removed: false } },
|
|
57
|
+
{ args: { system: 'random', remove: true }, result: { stopped: true, removed: true }, note: 'Gone for good, after the person said yes.' },
|
|
58
|
+
],
|
|
59
|
+
args: StopArgs,
|
|
60
|
+
returns: StopResult,
|
|
61
|
+
effects: { mode: 'delete', free: true },
|
|
62
|
+
operations: { cancel: false, background: false },
|
|
63
|
+
handlers: {
|
|
64
|
+
confirm: handler({
|
|
65
|
+
description: 'Delete this hosted system\'s folders, its data included?',
|
|
66
|
+
args: g.obj({ system: g.text(), folders: g.list(g.text()) }),
|
|
67
|
+
returns: g.bool(),
|
|
68
|
+
required: false,
|
|
69
|
+
}),
|
|
70
|
+
},
|
|
71
|
+
tags: ['systems'],
|
|
72
|
+
}),
|
|
73
|
+
metrics_list: fn({
|
|
74
|
+
group: 'machine',
|
|
75
|
+
description: 'The metrics this machine records (CPU, memory, drives, network, disk, GPU), each with its unit and the time span it holds, and the machine itself.',
|
|
76
|
+
instructions: 'Call it first to learn the metric names before fs/metrics_read: they are `cpu` (all cores) and `cpu.<n>` (each core), `memory`, `drive.<name>.free`, `net.<adapter>.rx` and `.tx`, `disk.read` and `disk.write`, `gpu.<n>.use`, `.memory`, `.temp` and `.power`, and `processes`. `recording: false` means the machine records nothing new (an admin turns it on in this fs\'s config); what it recorded before is still listed. `from` and `to` say how far back each metric goes.',
|
|
77
|
+
examples: [
|
|
78
|
+
{
|
|
79
|
+
args: {},
|
|
80
|
+
result: {
|
|
81
|
+
recording: true,
|
|
82
|
+
machine: { hostname: 'studio', platform: 'win32', cpuModel: 'AMD Ryzen 9 7950X', cores: 32, memory: 68_719_476_736, uptime: 86_400 },
|
|
83
|
+
syncEvery: 60_000,
|
|
84
|
+
metrics: [{ name: 'cpu', label: 'CPU, all cores', unit: 'percent', from: new Date('2026-11-01T00:00:00Z'), to: new Date('2026-11-28T12:00:00Z') }],
|
|
85
|
+
},
|
|
86
|
+
note: 'One metric shown; a machine lists dozens.',
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
effects: { mode: 'read', free: true },
|
|
90
|
+
args: g.obj({}),
|
|
91
|
+
returns: MetricsList,
|
|
92
|
+
status: {
|
|
93
|
+
active: { one: 'Listing the machine\'s metrics…', many: 'Listing metrics on {n} machines…' },
|
|
94
|
+
retry: { one: 'Retrying the metrics list…', many: 'Retrying {n} metrics lists…' },
|
|
95
|
+
done: { one: 'Listed the machine\'s metrics', many: 'Listed metrics on {n} machines' },
|
|
96
|
+
failed: { one: 'Listing the metrics failed', many: '{n} metrics lists failed' },
|
|
97
|
+
},
|
|
98
|
+
tags: ['read', 'machine'],
|
|
99
|
+
}),
|
|
100
|
+
metrics_read: fn({
|
|
101
|
+
group: 'machine',
|
|
102
|
+
description: 'Read metrics of this machine over a timeframe: each metric\'s average and maximum per point, with the seconds between points.',
|
|
103
|
+
instructions: 'Name metrics from fs/metrics_list; a trailing `*` takes every metric that starts with what comes before it (`cpu.*` is every core, `net.*` every adapter, `gpu.0.*` all of the first GPU). Give the timeframe as `last` (`30m`, `6h`, `7d`, `1y`) or as `from` and `to`. The step follows the timeframe (5 seconds within the last hour, a minute within 2 days, 10 minutes within 31 days, an hour beyond), and `points` caps how many points each metric gets. `null` in `avg` and `max` means nothing was recorded then (the machine was off or not recording). Units: percent, bytes, bytes/s, celsius, watts, count.',
|
|
104
|
+
examples: [
|
|
105
|
+
{ args: { metrics: ['cpu', 'memory'], last: '6h' }, note: 'CPU and memory over the last six hours.' },
|
|
106
|
+
{ args: { metrics: ['cpu.*'], last: '1h', points: 60 }, note: 'Each core over the last hour, one point a minute.' },
|
|
107
|
+
{
|
|
108
|
+
args: { metrics: ['gpu.0.temp'], from: new Date('2026-11-27T00:00:00Z'), to: new Date('2026-11-28T00:00:00Z'), points: 24 },
|
|
109
|
+
result: { step: 3600, from: new Date('2026-11-27T00:00:00Z'), to: new Date('2026-11-28T00:00:00Z'), series: new Map([['gpu.0.temp', { unit: 'celsius' as const, start: new Date('2026-11-27T00:00:00Z'), avg: [41, 43, null], max: [55, 61, null] }]]) },
|
|
110
|
+
note: 'One day, a point an hour (cut to three points here); the null is an hour nothing was recorded.',
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
effects: { mode: 'read', free: true },
|
|
114
|
+
args: MetricsReadArgs,
|
|
115
|
+
returns: MetricsRead,
|
|
116
|
+
status: {
|
|
117
|
+
active: { one: 'Reading the machine\'s metrics…', many: 'Reading metrics on {n} machines…' },
|
|
118
|
+
retry: { one: 'Retrying the metrics read…', many: 'Retrying {n} metrics reads…' },
|
|
119
|
+
done: { one: 'Read the machine\'s metrics', many: 'Read metrics on {n} machines' },
|
|
120
|
+
failed: { one: 'Reading the metrics failed', many: '{n} metrics reads failed' },
|
|
121
|
+
},
|
|
122
|
+
tags: ['read', 'machine'],
|
|
123
|
+
}),
|
|
124
|
+
machine_now: fn({
|
|
125
|
+
group: 'machine',
|
|
126
|
+
description: 'What this machine is doing now: its latest sample of CPU (in total and per core), memory, drives, network, disk and GPU.',
|
|
127
|
+
instructions: 'Use it for "how busy is it right now" questions; for how it went over time use fs/metrics_read, and for which programs are busy fs/processes. `recording: false` means the machine records no metrics, so there is no sample. Network and disk are bytes per second; CPU and GPU use are percent.',
|
|
128
|
+
examples: [
|
|
129
|
+
{ args: {}, note: 'The latest sample.' },
|
|
130
|
+
{ args: { since: new Date('2026-11-28T12:00:00Z') }, note: 'Also every sample taken since then, from the last few minutes.' },
|
|
131
|
+
],
|
|
132
|
+
effects: { mode: 'read', free: true },
|
|
133
|
+
args: MachineNowArgs,
|
|
134
|
+
returns: MachineNow,
|
|
135
|
+
status: {
|
|
136
|
+
active: { one: 'Looking at the machine…', many: 'Looking at {n} machines…' },
|
|
137
|
+
retry: { one: 'Looking at the machine again…', many: 'Looking at {n} machines again…' },
|
|
138
|
+
done: { one: 'Looked at the machine', many: 'Looked at {n} machines' },
|
|
139
|
+
failed: { one: 'Looking at the machine failed', many: '{n} machine looks failed' },
|
|
140
|
+
},
|
|
141
|
+
tags: ['read', 'machine'],
|
|
142
|
+
}),
|
|
143
|
+
processes: fn({
|
|
144
|
+
group: 'machine',
|
|
145
|
+
description: 'The busiest processes on this machine now: the 15 using the most CPU and the 15 using the most memory, with their ids. For admins.',
|
|
146
|
+
instructions: 'Use it to find which program makes the machine busy or uses its memory. CPU is % of one core, so a process using several cores passes 100. It works only while the machine records metrics; the list is at most a few seconds old (`at`).',
|
|
147
|
+
examples: [
|
|
148
|
+
{
|
|
149
|
+
args: {},
|
|
150
|
+
result: { at: new Date('2026-11-28T12:00:05Z'), count: 312, byCpu: [{ pid: 4120, name: 'node', cpu: 87.5, memory: 412_000_000 }], byMemory: [{ pid: 9001, name: 'chrome', cpu: 3.1, memory: 1_800_000_000 }] },
|
|
151
|
+
note: 'One process of each list shown.',
|
|
152
|
+
},
|
|
153
|
+
],
|
|
154
|
+
effects: { mode: 'read', free: true },
|
|
155
|
+
args: g.obj({}),
|
|
156
|
+
returns: TopProcesses,
|
|
157
|
+
status: {
|
|
158
|
+
active: { one: 'Listing the busiest processes…', many: 'Listing processes on {n} machines…' },
|
|
159
|
+
retry: { one: 'Retrying the process list…', many: 'Retrying {n} process lists…' },
|
|
160
|
+
done: { one: 'Listed the busiest processes', many: 'Listed processes on {n} machines' },
|
|
161
|
+
failed: { one: 'Listing the processes failed', many: '{n} process lists failed' },
|
|
162
|
+
},
|
|
163
|
+
// only admins see and run it (the hub's ADMIN_TAG): process names and ids say what everyone on the machine runs
|
|
164
|
+
tags: ['admin', 'read', 'machine'],
|
|
165
|
+
}),
|
|
166
|
+
},
|
|
167
|
+
hooks: {
|
|
168
|
+
git: hook({
|
|
169
|
+
description: 'Adds the current branch and the changed files.',
|
|
170
|
+
// what `<fs_git>` means to the model: injected with fs's items into the agents that get the block
|
|
171
|
+
explains: '`<fs_git>` is the git state of each folder the files system serves that is a git repository: its branch, and the files changed since the last commit. The person didn\'t type it. Mention it only when it matters to the request.',
|
|
172
|
+
order: 50,
|
|
173
|
+
timeout: 500,
|
|
174
|
+
}),
|
|
175
|
+
},
|
|
176
|
+
})
|
|
177
|
+
// mentions, context and the agent use the types and fns declared above
|
|
178
|
+
.with(({ fns, types }) => ({
|
|
179
|
+
mentions: {
|
|
180
|
+
// chips and cards show as Entry: its label, icon and color, and its reveal method on the card
|
|
181
|
+
files: mention({ title: 'Files', description: 'Files and folders under the roots.', target: FileTarget, of: types.Entry }),
|
|
182
|
+
},
|
|
183
|
+
context: {
|
|
184
|
+
// the guide is one question that brings its answers: each step is an item of its own in `context/guide/`
|
|
185
|
+
// (one question each), imported so loading the guide loads them all
|
|
186
|
+
guide: context({
|
|
187
|
+
description: 'How to work with the person\'s files: find, read, then change; keeping notes and lists as files; running commands.',
|
|
188
|
+
question: 'How do I work with the person\'s files?',
|
|
189
|
+
when: 'When a request involves the person\'s files or folders in any way: finding, reading, changing, keeping a document, or running a command, and before the first change.',
|
|
190
|
+
lastModified: Date.parse('2026-11-28'),
|
|
191
|
+
askedBy: 'system',
|
|
192
|
+
content: [
|
|
193
|
+
'The fs system works only inside the folders an admin chose (its roots). Work in this order: look, read, then change, and check each result before saying it is done. Each step answers one question, and loads with this guide:',
|
|
194
|
+
'',
|
|
195
|
+
'- How do I write a path for the files system? (fs/guide.paths)',
|
|
196
|
+
'- How do I find a file or a line in the person\'s files? (fs/guide.find)',
|
|
197
|
+
'- How do I read one of the person\'s files? (fs/guide.read)',
|
|
198
|
+
'- How do I change one of the person\'s files? (fs/guide.change)',
|
|
199
|
+
'- How do I keep a note, a list or a summary for the person as a file? (fs/guide.documents)',
|
|
200
|
+
'- How do I run a command, a build, tests or git on the person\'s machine? (fs/guide.commands)',
|
|
201
|
+
'- How do I read a file the person attached to a chat message? (fs/guide.attachments)',
|
|
202
|
+
].join('\n'),
|
|
203
|
+
imports: ['paths', 'find', 'read', 'change', 'documents', 'commands', 'attachments'].map((step) => ({ ref: 'context' as const, name: `fs/guide.${step}` as const })),
|
|
204
|
+
// the guide brings the fns it is about, so finding it finds them
|
|
205
|
+
fns: [fns.read, fns.list, fns.glob, fns.grep, fns.edit, fns.write, fns.bash, fns.cd, fns.remove],
|
|
206
|
+
}),
|
|
207
|
+
// what every chat agent is told about files, in its system prompt (plan injected-context, section 5)
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Fns for this: fn:fs/read, fn:fs/write, fn:fs/edit, fn:fs/bash.
|
package/systems/fs/context/authoring/parts/examples/systems-fs-shared-index-ts-lines-568-660.md
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
---
|
|
2
|
+
# Generated by scripts/docs/authoring.ts from the authoring guide (npm run docs:authoring); do not edit.
|
|
3
|
+
key: "authoring.examples.systems-fs-shared-index-ts-lines-568-660"
|
|
4
|
+
title: "Worked examples: systems/fs/shared/index.ts, lines 568-660"
|
|
5
|
+
description: "Worked examples, the part on systems/fs/shared/index.ts, lines 568-660."
|
|
6
|
+
summary: "Worked examples: systems/fs/shared/index.ts, lines 568-660."
|
|
7
|
+
question: "What is in the worked example file systems/fs/shared/index.ts, lines 568-660?"
|
|
8
|
+
when: "When copying from systems/fs/shared/index.ts, lines 568-660 of a working system."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
11
|
+
parent: "fs/authoring.examples"
|
|
12
|
+
fns: ["fs/read", "fs/write", "fs/edit", "fs/bash"]
|
|
13
|
+
tags: ["authoring"]
|
|
14
|
+
niche: "developer"
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
### The fs system's contract
|
|
18
|
+
|
|
19
|
+
#### `systems/fs/shared/index.ts`, lines 568-660
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
basics: context({
|
|
23
|
+
title: 'Files',
|
|
24
|
+
description: 'Where the files system works (its roots), how paths are written, what can be undone, and that an attached file is not one of its files.',
|
|
25
|
+
summary: 'The files system works only in folders an admin chose: paths are relative to the first root, never `/`. Load fs/guide first.',
|
|
26
|
+
// it sits in every chat agent's prompt, so its one question is the least a model must know about files
|
|
27
|
+
question: 'What must every chat agent know before it touches the person\'s files?',
|
|
28
|
+
when: 'Always, in every chat: it is in each chat agent\'s system prompt, so a model knows where the files system works before any request about files.',
|
|
29
|
+
lastModified: Date.parse('2026-11-28'),
|
|
30
|
+
askedBy: 'system',
|
|
31
|
+
content: [
|
|
32
|
+
'The **files system** (`fs`) works only inside a few folders of the person\'s machine an admin chose (its roots). Paths are relative to the first root (`notes/todo.md`) or start with a root\'s name; `/` is outside the roots and is refused. Look before you guess a path: fs/list on `.` shows the first root, fs/glob finds files by name, and fs/read reads one.',
|
|
33
|
+
'fs/write, fs/edit and fs/remove may ask the person first, and what they change can be undone with the turn; what fs/bash changes can\'t. To keep a document for the person (a note, a list, a summary), write a markdown file and tell them its path.',
|
|
34
|
+
'A file the person attached to a message is not an fs file: it is kept by the hub, not under the roots. Load fs/guide before the first change.',
|
|
35
|
+
].join('\n'),
|
|
36
|
+
fns: [fns.list, fns.read],
|
|
37
|
+
inject: { into: [agents.startingWith(hub.fns.chat)] },
|
|
38
|
+
}),
|
|
39
|
+
tree: context({
|
|
40
|
+
description: 'The folder tree of a root, as it is now.',
|
|
41
|
+
question: 'What does the folder tree of the person\'s roots look like right now?',
|
|
42
|
+
when: 'When the person runs /tree, or the work needs the layout of a root at a glance before finding or changing files.',
|
|
43
|
+
lastModified: Date.parse('2026-11-28'),
|
|
44
|
+
askedBy: 'system',
|
|
45
|
+
command: { name: 'tree', args: { root: arg('Which root (default: all)', { required: false }) } },
|
|
46
|
+
}),
|
|
47
|
+
// the start of writing a system: it loads the guide's index (`context/authoring/`, a graph of the SDK guide) with
|
|
48
|
+
// it, and says where the template is on this machine, with the fns to write and install a system
|
|
49
|
+
'system-authoring': context({
|
|
50
|
+
description: 'How to write and install a harness system: the index of its guide, where the template system is, and how to copy it.',
|
|
51
|
+
question: 'How do I start writing a new harness system on this machine?',
|
|
52
|
+
when: 'When the person runs /new-system or asks to make a new harness system (fns, types, context and screens the hub adds), before reading the guide\'s parts.',
|
|
53
|
+
lastModified: Date.parse('2026-11-28'),
|
|
54
|
+
askedBy: 'system',
|
|
55
|
+
command: { name: 'new-system' },
|
|
56
|
+
imports: [{ ref: 'context', name: 'fs/authoring' }],
|
|
57
|
+
fns: [fns.read, fns.write, fns.edit, fns.bash, fns.install_system, fns.system_status],
|
|
58
|
+
}),
|
|
59
|
+
},
|
|
60
|
+
}))
|
|
61
|
+
.with(({ fns, context: ctx }) => ({
|
|
62
|
+
fns: {
|
|
63
|
+
explore: agent({
|
|
64
|
+
description: 'Answers questions about the code by reading it.',
|
|
65
|
+
group: 'files',
|
|
66
|
+
effects: { mode: 'read' },
|
|
67
|
+
usage: 'Use it for a question that needs several files read (how a feature works, where something is decided) so your own context stays small. Ask one clear question; the answer quotes paths and lines.',
|
|
68
|
+
args: g.obj({ question: g.text() }),
|
|
69
|
+
returns: g.text(),
|
|
70
|
+
instructions: [
|
|
71
|
+
'Answer this question about the code by reading it: {{args.question}}',
|
|
72
|
+
'',
|
|
73
|
+
'Work in this order:',
|
|
74
|
+
'1. Find where to look: grep for the names in the question (a function, a type, a message), glob for files by name, or hub/search_resources by meaning.',
|
|
75
|
+
'2. Read the files that matter, a window at a time for long ones (offset and limit), and follow the calls and imports the answer depends on.',
|
|
76
|
+
'3. Stop once you can answer; do not read everything.',
|
|
77
|
+
'',
|
|
78
|
+
'Answer in a few short paragraphs or a list. Quote each path with its line (`src/hub/link.ts:120`) for every claim, and say plainly what you could not find.',
|
|
79
|
+
'Example: asked "where is the session timeout set?", grep for `timeout`, read the config file it points to, and answer',
|
|
80
|
+
'"The timeout is FNLOOM_SESSION_TIMEOUT in packages/hub/src/env.ts:42 (default 30 minutes); packages/hub/src/auth/sessions.ts:88 reads it."',
|
|
81
|
+
].join('\n'),
|
|
82
|
+
examples: [
|
|
83
|
+
{ args: { question: 'How does the hub decide which instance runs a call?' } },
|
|
84
|
+
{ args: { question: 'Where are uploaded files stored, and how big may one be?' } },
|
|
85
|
+
],
|
|
86
|
+
tools: [fns.read, fns.glob, fns.grep, hub.fns.search_resources],
|
|
87
|
+
context: [ctx.guide],
|
|
88
|
+
}),
|
|
89
|
+
},
|
|
90
|
+
}))
|
|
91
|
+
// the Machines page's Files tab: browsing, git and comments (`files-page.ts`)
|
|
92
|
+
.with({ fns: FILES_PAGE_FNS });
|
|
93
|
+
|
|
94
|
+
/** The fs contract's type. */
|
|
95
|
+
export type FsContract = typeof fs;
|
|
96
|
+
|
|
97
|
+
/** A file or folder, as fns return it. */
|
|
98
|
+
export type EntryValue = ValueOf<typeof Entry>;
|
|
99
|
+
/** What a command printed and how it ended. */
|
|
100
|
+
export type CommandOutput = Infer<typeof CommandResult>;
|
|
101
|
+
/** The diff attachment's data. */
|
|
102
|
+
export type DiffValue = Infer<typeof DiffData>;
|
|
103
|
+
/** The shell setting's value. */
|
|
104
|
+
export type ShellPolicyValue = Infer<typeof ShellPolicy>;
|
|
105
|
+
/** How many undo copies fs keeps. */
|
|
106
|
+
export type SnapshotLimitsValue = Infer<typeof SnapshotLimits>;
|
|
107
|
+
/** The undo copies kept when the config names no limits: 20 per file, 500 MB in all. */
|
|
108
|
+
export const SNAPSHOT_DEFAULTS: SnapshotLimitsValue = { perFile: 20, totalMb: 500 };
|
|
109
|
+
/** The files mention's target. */
|
|
110
|
+
export type FileTargetValue = Infer<typeof FileTarget>;
|
|
111
|
+
/** What undo needs to put a file back. */
|
|
112
|
+
export type PreviousValue = Infer<typeof Previous>;
|
|
113
|
+
/** What `bash` returns. */
|
|
114
|
+
export type BashOutput = Infer<typeof BashResult>;
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Fns for this: fn:fs/read, fn:fs/write, fn:fs/edit, fn:fs/bash.
|
|
@@ -4,8 +4,12 @@ key: "authoring.examples.tsconfig-json"
|
|
|
4
4
|
title: "Worked examples: scripts/docs/example/tsconfig.json"
|
|
5
5
|
description: "Worked examples, the part on scripts/docs/example/tsconfig.json."
|
|
6
6
|
summary: "Worked examples: scripts/docs/example/tsconfig.json."
|
|
7
|
+
question: "What is in the worked example file scripts/docs/example/tsconfig.json?"
|
|
8
|
+
when: "When copying from scripts/docs/example/tsconfig.json of a working system."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
7
11
|
parent: "fs/authoring.examples"
|
|
8
|
-
next: "fs/authoring.examples.systems-fs-shared-index-ts-lines-1-
|
|
12
|
+
next: "fs/authoring.examples.systems-fs-shared-index-ts-lines-1-178"
|
|
9
13
|
fns: ["fs/read", "fs/write", "fs/edit", "fs/bash"]
|
|
10
14
|
tags: ["authoring"]
|
|
11
15
|
niche: "developer"
|
|
@@ -4,6 +4,10 @@ key: "authoring.examples"
|
|
|
4
4
|
title: "Worked examples"
|
|
5
5
|
description: "Writing a harness system: Worked examples."
|
|
6
6
|
summary: "Complete compiled example systems to copy from."
|
|
7
|
+
question: "What does a complete working system look like?"
|
|
8
|
+
when: "When copying from a whole working system, file by file."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
7
11
|
parent: "fs/authoring.topics.examples"
|
|
8
12
|
fns: ["fs/read", "fs/write", "fs/edit", "fs/bash"]
|
|
9
13
|
tags: ["authoring"]
|
|
@@ -41,17 +45,19 @@ choices:
|
|
|
41
45
|
when: "Pick this for scripts/docs/example/system.json."
|
|
42
46
|
- to: "fs/authoring.examples.tsconfig-json"
|
|
43
47
|
when: "Pick this for scripts/docs/example/tsconfig.json."
|
|
44
|
-
- to: "fs/authoring.examples.systems-fs-shared-index-ts-lines-1-
|
|
45
|
-
when: "Pick this for systems/fs/shared/index.ts, lines 1-
|
|
46
|
-
- to: "fs/authoring.examples.systems-fs-shared-index-ts-lines-
|
|
47
|
-
when: "Pick this for systems/fs/shared/index.ts, lines
|
|
48
|
-
- to: "fs/authoring.examples.systems-fs-shared-index-ts-lines-
|
|
49
|
-
when: "Pick this for systems/fs/shared/index.ts, lines
|
|
48
|
+
- to: "fs/authoring.examples.systems-fs-shared-index-ts-lines-1-178"
|
|
49
|
+
when: "Pick this for systems/fs/shared/index.ts, lines 1-178."
|
|
50
|
+
- to: "fs/authoring.examples.systems-fs-shared-index-ts-lines-179-382"
|
|
51
|
+
when: "Pick this for systems/fs/shared/index.ts, lines 179-382."
|
|
52
|
+
- to: "fs/authoring.examples.systems-fs-shared-index-ts-lines-383-567"
|
|
53
|
+
when: "Pick this for systems/fs/shared/index.ts, lines 383-567."
|
|
54
|
+
- to: "fs/authoring.examples.systems-fs-shared-index-ts-lines-568-660"
|
|
55
|
+
when: "Pick this for systems/fs/shared/index.ts, lines 568-660."
|
|
50
56
|
---
|
|
51
57
|
|
|
52
|
-
##
|
|
58
|
+
## 32. Worked examples
|
|
53
59
|
|
|
54
|
-
This part is in
|
|
60
|
+
This part is in 20 pieces; load the one you need:
|
|
55
61
|
|
|
56
62
|
- [scripts/docs/example/client/FindView.vue](context:fs/authoring.examples.client-findview-vue)
|
|
57
63
|
- [scripts/docs/example/client/NoteCard.vue](context:fs/authoring.examples.client-notecard-vue)
|
|
@@ -69,8 +75,9 @@ This part is in 19 pieces; load the one you need:
|
|
|
69
75
|
- [scripts/docs/example/shared/index.ts](context:fs/authoring.examples.shared-index-ts)
|
|
70
76
|
- [scripts/docs/example/system.json](context:fs/authoring.examples.system-json)
|
|
71
77
|
- [scripts/docs/example/tsconfig.json](context:fs/authoring.examples.tsconfig-json)
|
|
72
|
-
- [systems/fs/shared/index.ts, lines 1-
|
|
73
|
-
- [systems/fs/shared/index.ts, lines
|
|
74
|
-
- [systems/fs/shared/index.ts, lines
|
|
78
|
+
- [systems/fs/shared/index.ts, lines 1-178](context:fs/authoring.examples.systems-fs-shared-index-ts-lines-1-178)
|
|
79
|
+
- [systems/fs/shared/index.ts, lines 179-382](context:fs/authoring.examples.systems-fs-shared-index-ts-lines-179-382)
|
|
80
|
+
- [systems/fs/shared/index.ts, lines 383-567](context:fs/authoring.examples.systems-fs-shared-index-ts-lines-383-567)
|
|
81
|
+
- [systems/fs/shared/index.ts, lines 568-660](context:fs/authoring.examples.systems-fs-shared-index-ts-lines-568-660)
|
|
75
82
|
|
|
76
83
|
Fns for this: fn:fs/read, fn:fs/write, fn:fs/edit, fn:fs/bash.
|
|
@@ -4,6 +4,10 @@ key: "authoring.fns"
|
|
|
4
4
|
title: "Fns"
|
|
5
5
|
description: "Writing a harness system: Fns."
|
|
6
6
|
summary: "Declaring a native fn: description, instructions, args, returns, examples and every option."
|
|
7
|
+
question: "How do I declare a native fn and its options?"
|
|
8
|
+
when: "When declaring a fn: its description, instructions, args, result, examples, effects and the other options."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
7
11
|
parent: "fs/authoring.topics.fns"
|
|
8
12
|
next: "fs/authoring.handlers-progress"
|
|
9
13
|
fns: ["fs/read", "fs/write", "fs/edit", "fs/bash"]
|
|
@@ -16,7 +20,7 @@ choices:
|
|
|
16
20
|
when: "Pick this to go on in order: Handlers and progress."
|
|
17
21
|
---
|
|
18
22
|
|
|
19
|
-
##
|
|
23
|
+
## 8. Fns
|
|
20
24
|
|
|
21
25
|
A **fn** is something people, agents and code can run: a name, a description, typed args and a typed result. A
|
|
22
26
|
**native** fn is implemented in code by its own system and declared with `fn({ … })`. Only `description`, `args` and
|
|
@@ -177,7 +181,7 @@ the config, named types, the log, a `deadline` with a `signal` that aborts at it
|
|
|
177
181
|
`check: { calls }` names; `check: true` calls nothing. Each call is a child of the waiting run (under its own
|
|
178
182
|
`check:` keys) and must be of a `read` fn: the hub refuses a call to any other fn, and denies one that would wait for
|
|
179
183
|
approval instead of asking. A check makes no model calls and changes nothing. One that can't finish (its system gone,
|
|
180
|
-
an error, the hub's `
|
|
184
|
+
an error, the hub's `FNLOOM_ARGS_CHECK_TIMEOUT`) is logged and the call goes on as if there were none, so `run`
|
|
181
185
|
still checks for itself. `kit.check('<fn>', args)` gives its problems and the calls it made ([Testing](context:fs/authoring.testing)).
|
|
182
186
|
|
|
183
187
|
```ts
|
|
@@ -4,6 +4,10 @@ key: "authoring.fns.reference.fillclaims"
|
|
|
4
4
|
title: "Fns: reference: fillClaims … MissingExamplesError"
|
|
5
5
|
description: "Fns: reference, the part on fillClaims, ClaimsRequest, ClaimsInput, CheckedClaim, ClaimTokens, ToolClaims, ClaimsCtx, ALL_CLAIMS, FnCheckInput, FnCheckTypes, CheckTypesOf, CheckCtx, CheckProblems, CheckImpl, fnsMissingExamples, checkExamples, MissingExamplesError."
|
|
6
6
|
summary: "Fns: reference: fillClaims, ClaimsRequest, ClaimsInput, CheckedClaim, ClaimTokens, ToolClaims, ClaimsCtx, ALL_CLAIMS, FnCheckInput, FnCheckTypes,…"
|
|
7
|
+
question: "What are the exact signatures and options of fillClaims, ClaimsRequest, ClaimsInput, CheckedClaim, ClaimTokens, ToolClaims and 11 more?"
|
|
8
|
+
when: "When code uses fillClaims, ClaimsRequest, ClaimsInput, CheckedClaim, ClaimTokens, ToolClaims and 11 more and needs an exact signature, field or option."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
7
11
|
parent: "fs/authoring.fns.reference"
|
|
8
12
|
suggest: "none"
|
|
9
13
|
tags: ["authoring", "reference"]
|
|
@@ -107,7 +111,7 @@ What a fn's `claims(args, ctx)` gets: the system context, the person whose turn
|
|
|
107
111
|
made it and its chat. The call isn't a run yet, so it has no run of its own.
|
|
108
112
|
|
|
109
113
|
```ts
|
|
110
|
-
interface ClaimsCtx<Cfg = unknown, O extends
|
|
114
|
+
interface ClaimsCtx<Cfg = unknown, O extends AnyOwn = Own> extends SystemCtx<Cfg, O> {
|
|
111
115
|
readonly user: UserInfo;
|
|
112
116
|
/** The agent run that made the call. */
|
|
113
117
|
readonly caller: RunId;
|