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
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `npm run preview:machines -w @harness/system-fs`: the Machines page in the web app, on the mock hub, with metrics
|
|
3
|
+
* drawn from a seeded store, shot at phone (390px) and desktop (1280px) widths in light and dark into
|
|
4
|
+
* `client/preview/shots/`, checking the web app's layout rules (no sideways page scroll, no overlapping controls).
|
|
5
|
+
*
|
|
6
|
+
* It seeds a SQLite store (in a temp folder) with 90 days of a made-up machine through the real round robin, reads
|
|
7
|
+
* it back through fs's real `MachineMetrics` for each `fs/metrics_*` read the page makes, builds fs's client bundle,
|
|
8
|
+
* and serves the app (Vite) and the mock hub on ports of their own (`FS_PREVIEW_WEB_PORT`, `FS_PREVIEW_HUB_PORT`).
|
|
9
|
+
* `FS_PREVIEW_KEEP=true` leaves them running to look at by hand (sign in as admin@harness.test / harness-admin-1).
|
|
10
|
+
*
|
|
11
|
+
* The Files tab is shot too, over the fake machine of its tests (`machines/files/fakes.ts`): a folder, code with a
|
|
12
|
+
* comment thread, a picture being marked up, the Changes view and History. `FS_PREVIEW_ONLY=files` (or `metrics`)
|
|
13
|
+
* shoots one tab.
|
|
14
|
+
*/
|
|
15
|
+
import { mkdir, rm } from 'node:fs/promises';
|
|
16
|
+
import { readdirSync } from 'node:fs';
|
|
17
|
+
import { tmpdir } from 'node:os';
|
|
18
|
+
import { join } from 'node:path';
|
|
19
|
+
import { fileURLToPath } from 'node:url';
|
|
20
|
+
import { env } from '@ayepi/env';
|
|
21
|
+
import { InstanceName, Json, ReadFnArgs, SystemPageView, type PageInstance } from '@harness/core';
|
|
22
|
+
import { encodeValue } from '@harness/sdk';
|
|
23
|
+
import { buildClient } from '@harness/sdk/build';
|
|
24
|
+
import { testStore } from '@harness/sdk/server/testing';
|
|
25
|
+
import vue from '@vitejs/plugin-vue';
|
|
26
|
+
import puppeteer, { type Page } from 'puppeteer';
|
|
27
|
+
import { createServer } from 'vite';
|
|
28
|
+
import { z } from 'zod';
|
|
29
|
+
import type * as MockHubModule from '../../../../packages/web/e2e/mockHub.ts';
|
|
30
|
+
import { layoutProblems } from '../../../../packages/web/e2e/harness.ts';
|
|
31
|
+
import { MACHINES_PAGE, MachineNow, MetricsList, MetricsRead, TopProcesses, type MachineSampleValue } from '../../shared/metrics.ts';
|
|
32
|
+
import { metricValues } from '../../server/metrics/collector.ts';
|
|
33
|
+
import { MachineMetrics, metricMeta } from '../../server/metrics/index.ts';
|
|
34
|
+
import { RoundRobin } from '../../server/metrics/rrd.ts';
|
|
35
|
+
import { FakeOs, FakeTimers } from '../../server/metrics/testing.ts';
|
|
36
|
+
import { fsMigrations } from '../../server/snapshots.ts';
|
|
37
|
+
import { FakeFilesApi, LOGO_URL } from '../machines/files/fakes.ts';
|
|
38
|
+
|
|
39
|
+
const settings = env({
|
|
40
|
+
FS_PREVIEW_WEB_PORT: z.number().int().min(1).default(4742),
|
|
41
|
+
FS_PREVIEW_HUB_PORT: z.number().int().min(1).default(4743),
|
|
42
|
+
FS_PREVIEW_HEADLESS: z.boolean().default(true),
|
|
43
|
+
FS_PREVIEW_KEEP: z.boolean().default(false),
|
|
44
|
+
/** Shoot only one tab's scenes. */
|
|
45
|
+
FS_PREVIEW_ONLY: z.enum(['all', 'metrics', 'files']).default('all'),
|
|
46
|
+
}).parse();
|
|
47
|
+
const here = fileURLToPath(new URL('.', import.meta.url));
|
|
48
|
+
const shots = join(here, 'shots');
|
|
49
|
+
const cache = join(tmpdir(), 'harness-fs-preview-machines');
|
|
50
|
+
const web = fileURLToPath(new URL('../../../../packages/web/', import.meta.url));
|
|
51
|
+
const NOW = Date.now();
|
|
52
|
+
|
|
53
|
+
// the mock hub imports the web app's own .vue fakes, which tsx can't load: Vite's SSR loader reads it instead
|
|
54
|
+
const loader = await createServer({ root: web, configFile: false, plugins: [vue()], logLevel: 'warn', appType: 'custom', server: { middlewareMode: true, hmr: false } });
|
|
55
|
+
/** Whether what ssrLoadModule gave (untyped) is the mock hub's module: it exports what this script uses. */
|
|
56
|
+
function isMockHub(loaded: Record<string, unknown>): loaded is typeof MockHubModule {
|
|
57
|
+
return typeof loaded['serveMockHub'] === 'function' && typeof loaded['MOCK_ADMIN'] === 'object';
|
|
58
|
+
}
|
|
59
|
+
const loaded: Record<string, unknown> = await loader.ssrLoadModule(fileURLToPath(new URL('../../../../packages/web/e2e/mockHub.ts', import.meta.url)));
|
|
60
|
+
if (!isMockHub(loaded)) { throw new Error('packages/web/e2e/mockHub.ts no longer exports serveMockHub and MOCK_ADMIN'); }
|
|
61
|
+
const { MOCK_ADMIN, serveMockHub } = loaded;
|
|
62
|
+
const DAY = 86_400_000;
|
|
63
|
+
|
|
64
|
+
/** A seeded random number in [0, 1). */
|
|
65
|
+
function seeded(seed: number): () => number {
|
|
66
|
+
let s = seed >>> 0;
|
|
67
|
+
return () => { s = (s * 1664525 + 1013904223) >>> 0; return s / 2 ** 32; };
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** A made-up workstation's sample at `t`: busy in working hours, a GPU job in the evenings, a backup at night. */
|
|
71
|
+
function sampleAt(t: number, rand: () => number): MachineSampleValue {
|
|
72
|
+
const hour = new Date(t).getHours() + new Date(t).getMinutes() / 60;
|
|
73
|
+
const work = hour > 9 && hour < 18 ? 1 : 0.25;
|
|
74
|
+
const evening = hour > 19 && hour < 23 ? 1 : 0;
|
|
75
|
+
const cores = Array.from({ length: 16 }, (_, i) => Math.min(100, Math.max(0, work * (25 + 30 * Math.sin(t / 3.6e6 + i)) + rand() * 25 + (i < 4 ? evening * 30 : 0))));
|
|
76
|
+
const total = cores.reduce((a, b) => a + b, 0) / cores.length;
|
|
77
|
+
const night = hour > 2 && hour < 3 ? 1 : 0;
|
|
78
|
+
return {
|
|
79
|
+
at: new Date(t),
|
|
80
|
+
cpu: { total, cores },
|
|
81
|
+
memory: { used: 28e9 + work * 14e9 + rand() * 3e9, total: 64 * 2 ** 30 },
|
|
82
|
+
drives: [{ name: 'C:', total: 2e12, free: 6.1e11 - (t % DAY) / DAY * 1e9 }, { name: 'D:', total: 4e12, free: 3.1e11 }],
|
|
83
|
+
network: [
|
|
84
|
+
{ adapter: 'Realtek PCIe 2.5GbE Family Controller', rx: (work * 4e5 + rand() * 2e5) * (1 + night * 20), tx: work * 8e4 + rand() * 4e4 + night * 6e6 },
|
|
85
|
+
{ adapter: 'Intel(R) Wi-Fi 6E AX211 160MHz', rx: rand() * 2e4, tx: rand() * 5e3 },
|
|
86
|
+
],
|
|
87
|
+
disk: { read: work * 6e6 + rand() * 3e6 + night * 9e7, write: work * 3e6 + rand() * 2e6 + night * 4e7 },
|
|
88
|
+
gpus: [{ index: 0, name: 'NVIDIA GeForce RTX 4080', source: 'nvidia', use: Math.min(100, evening * 70 + rand() * 12 + work * 8), memUsed: 3e9 + evening * 9e9, memTotal: 16 * 2 ** 30, temp: 38 + evening * 30 + rand() * 4, power: 22 + evening * 220 + rand() * 15 }],
|
|
89
|
+
processes: 300 + Math.round(rand() * 40),
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** Seed a store with 90 days at 10 minutes, the last 2 days at a minute and the last hour at 5 seconds. */
|
|
94
|
+
async function seed(): Promise<Awaited<ReturnType<typeof testStore>>> {
|
|
95
|
+
await rm(cache, { recursive: true, force: true });
|
|
96
|
+
await mkdir(cache, { recursive: true });
|
|
97
|
+
const store = await testStore(fsMigrations, { dir: cache });
|
|
98
|
+
const rr = new RoundRobin();
|
|
99
|
+
const rand = seeded(7);
|
|
100
|
+
const times: number[] = [];
|
|
101
|
+
for (let t = NOW - 90 * DAY; t < NOW - 2 * DAY; t += 10 * 60_000) { times.push(t); }
|
|
102
|
+
for (let t = NOW - 2 * DAY; t < NOW - 3_600_000; t += 60_000) { times.push(t); }
|
|
103
|
+
for (let t = NOW - 3_600_000; t <= NOW; t += 5_000) { times.push(t); }
|
|
104
|
+
// a day the machine was off, to show a gap
|
|
105
|
+
const off = (t: number) => t > NOW - 12 * DAY && t < NOW - 11 * DAY;
|
|
106
|
+
for (const [i, t] of times.entries()) {
|
|
107
|
+
if (!off(t)) { rr.record(t, metricValues(sampleAt(t, rand)), metricMeta); }
|
|
108
|
+
if (i % 2_000 === 0) { await rr.sync(store.store); }
|
|
109
|
+
}
|
|
110
|
+
await rr.sync(store.store);
|
|
111
|
+
return store;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** The busiest processes of the made-up machine. */
|
|
115
|
+
function processes() {
|
|
116
|
+
const rows = [['node', 4120, 182, 1.2e9], ['chrome', 9001, 46, 3.4e9], ['Code', 5520, 31, 1.9e9], ['blender', 7788, 120, 6.1e9], ['postgres', 3010, 12, 8.4e8], ['explorer', 1200, 3, 2.1e8], ['Teams', 6610, 9, 9.8e8], ['MsMpEng', 4400, 6, 3.3e8]] as const;
|
|
117
|
+
const list = rows.map(([name, pid, cpu, memory]) => ({ pid, name, cpu, memory }));
|
|
118
|
+
return { at: new Date(NOW), count: 318, byCpu: [...list].sort((a, b) => b.cpu - a.cpu), byMemory: [...list].sort((a, b) => b.memory - a.memory) };
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const store = await seed();
|
|
122
|
+
const os = new FakeOs('win32');
|
|
123
|
+
const metrics = new MachineMetrics({ os, now: () => Date.now(), timers: new FakeTimers({ now: NOW }) });
|
|
124
|
+
metrics.attach(store.store);
|
|
125
|
+
metrics.configure({ record: true });
|
|
126
|
+
const latest = sampleAt(NOW, seeded(11));
|
|
127
|
+
|
|
128
|
+
/** The fs reads the page makes, answered from the seeded store on `studio`; `nas` doesn't record. */
|
|
129
|
+
async function read(args: ReadFnArgs): Promise<Json | undefined> {
|
|
130
|
+
if (!args.fn.startsWith('fs/')) { return undefined; }
|
|
131
|
+
const on = args.on ?? 'studio';
|
|
132
|
+
const machine = { ...metrics.collector.info(), hostname: on, cpuModel: 'AMD Ryzen 9 7950X 16-Core Processor', cores: 16, memory: 64 * 2 ** 30, uptime: (4 * DAY + 5 * 3_600_000) / 1000 };
|
|
133
|
+
const recording = on === 'studio';
|
|
134
|
+
switch (args.fn) {
|
|
135
|
+
case 'fs/metrics_list': {
|
|
136
|
+
const list = recording ? await metrics.list() : { recording: false, machine, syncEvery: 60_000, metrics: [] };
|
|
137
|
+
return Json.parse(encodeValue(MetricsList, { ...list, machine }));
|
|
138
|
+
}
|
|
139
|
+
case 'fs/metrics_read': {
|
|
140
|
+
if (!recording) { return Json.parse(encodeValue(MetricsRead, { step: 60, from: new Date(NOW - DAY), to: new Date(NOW), series: new Map() })); }
|
|
141
|
+
const asked = z.object({ metrics: z.array(z.string()), last: z.string().optional() }).parse(args.args);
|
|
142
|
+
return Json.parse(encodeValue(MetricsRead, await metrics.read(asked)));
|
|
143
|
+
}
|
|
144
|
+
case 'fs/machine_now': return Json.parse(encodeValue(MachineNow, { recording, machine, sample: recording ? latest : null, recent: [] }));
|
|
145
|
+
case 'fs/processes': return Json.parse(encodeValue(TopProcesses, processes()));
|
|
146
|
+
default: return undefined;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/** The Files tab's reads, answered from the fake machine of its tests; keyed by fn and args whatever their order. */
|
|
151
|
+
const fileAnswers = new Map<string, Json>();
|
|
152
|
+
const canon = (fn: string, args: Json): string => JSON.stringify([fn, Object.entries(z.record(z.string(), Json).catch({}).parse(args)).sort(([a], [b]) => a.localeCompare(b))]);
|
|
153
|
+
async function seedFiles(): Promise<void> {
|
|
154
|
+
const files = new FakeFilesApi();
|
|
155
|
+
const put = async (fn: string, args: Record<string, Json>, answer: Promise<unknown>) => { fileAnswers.set(canon(`fs/${fn}`, args), Json.parse(JSON.parse(JSON.stringify(await answer)))); };
|
|
156
|
+
for (const path of ['', 'app', 'app/src', 'app/assets', 'app/data', 'app/docs']) { await put('files_folder', { path }, files.folder(path)); }
|
|
157
|
+
for (const path of ['app/src/main.ts', 'app/assets/logo.png', 'app/README.md']) {
|
|
158
|
+
await put('comments', { path, status: 'all', limit: 200 }, files.comments(path));
|
|
159
|
+
await put('git_diff', { path }, files.diff(path));
|
|
160
|
+
}
|
|
161
|
+
await put('git_diff', { path: 'app/src/cart.ts' }, files.diff('app/src/cart.ts'));
|
|
162
|
+
await put('files_file', { path: 'app/src/main.ts' }, files.file('app/src/main.ts'));
|
|
163
|
+
// the picture as an SVG drawn from its text, since the mock hub has no download of a machine's file
|
|
164
|
+
const logo = await files.file('app/assets/logo.png');
|
|
165
|
+
await put('files_file', { path: 'app/assets/logo.png' }, Promise.resolve({ ...logo, kind: 'svg', mime: 'image/svg+xml', text: decodeURIComponent(LOGO_URL.slice(LOGO_URL.indexOf(',') + 1)) }));
|
|
166
|
+
await put('git_status', {}, files.status());
|
|
167
|
+
const history = await files.history();
|
|
168
|
+
await put('git_history', { root: 'app', skip: 0, limit: 50 }, Promise.resolve(history));
|
|
169
|
+
for (const commit of [...history.commits, ...history.incoming]) { await put('git_commit', { root: 'app', rev: commit.hash }, files.commit('app', commit.hash)); }
|
|
170
|
+
}
|
|
171
|
+
await seedFiles();
|
|
172
|
+
|
|
173
|
+
// fs's client, as the hub would serve it
|
|
174
|
+
const bundle = join(cache, 'client');
|
|
175
|
+
await buildClient({ entry: fileURLToPath(new URL('../index.ts', import.meta.url)), outDir: bundle });
|
|
176
|
+
const clients = Object.fromEntries(readdirSync(bundle).map((name) => [`fs-machines/${name}`, join(bundle, name)]));
|
|
177
|
+
const page = SystemPageView.parse({
|
|
178
|
+
segment: MACHINES_PAGE, title: 'Machines', icon: 'monitor', nav: 'main', access: 'everyone', component: 'MachinesPage', system: 'fs',
|
|
179
|
+
client: { url: '/api/mock-clients/fs-machines/index.js', hash: 'preview-machines' },
|
|
180
|
+
});
|
|
181
|
+
const instances: PageInstance[] = [
|
|
182
|
+
{ instance: InstanceName.parse('nas'), description: 'The basement NAS', online: true, version: '0.2.0' },
|
|
183
|
+
{ instance: InstanceName.parse('studio'), description: 'The studio workstation', online: true, version: '0.2.0' },
|
|
184
|
+
{ instance: InstanceName.parse('laptop'), description: '', online: false, version: '0.2.0' },
|
|
185
|
+
];
|
|
186
|
+
// the page's reads are async; the mock answers synchronously, so each is worked out before it is asked
|
|
187
|
+
const answers = new Map<string, Json | undefined>();
|
|
188
|
+
const keyOf = (args: ReadFnArgs) => JSON.stringify([args.fn, args.on, args.args]);
|
|
189
|
+
for (const on of ['nas', 'studio']) {
|
|
190
|
+
for (const fn of ['fs/metrics_list', 'fs/machine_now', 'fs/processes']) {
|
|
191
|
+
for (const args of [{}, { watch: true }]) {
|
|
192
|
+
const asked = ReadFnArgs.parse({ fn, args, on });
|
|
193
|
+
answers.set(keyOf(asked), await read(asked));
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
for (const last of ['1h', '6h', '1d', '7d', '30d', '1y']) {
|
|
197
|
+
const asked = ReadFnArgs.parse({ fn: 'fs/metrics_read', args: { metrics: ['cpu', 'cpu.*', 'memory', 'net.*', 'disk.*', 'gpu.*', 'drive.*'], last }, on });
|
|
198
|
+
answers.set(keyOf(asked), await read(asked));
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
const hub = serveMockHub(settings.FS_PREVIEW_HUB_PORT, {
|
|
202
|
+
needsAdmin: false, notifyEvery: 0, logEvery: 0,
|
|
203
|
+
pages: {
|
|
204
|
+
pages: [page], instances: { fs: instances }, clients,
|
|
205
|
+
// machine_now's `since` changes each poll: it is answered as the first one was
|
|
206
|
+
read: (args) => answers.get(keyOf(args)) ?? fileAnswers.get(canon(args.fn, args.args)) ?? (args.fn === 'fs/machine_now' ? answers.get(keyOf({ ...args, args: { watch: true } })) : undefined),
|
|
207
|
+
},
|
|
208
|
+
});
|
|
209
|
+
const hubUrl = `http://127.0.0.1:${String(settings.FS_PREVIEW_HUB_PORT)}`;
|
|
210
|
+
const proxy = Object.fromEntries(['/api', '/_files', '/clients', '/manifest.webmanifest'].map((path) => [path, { target: hubUrl, changeOrigin: true }]));
|
|
211
|
+
const server = await createServer({
|
|
212
|
+
root: web, configFile: false, plugins: [vue()], logLevel: 'warn', resolve: { dedupe: ['vue', 'zod'] },
|
|
213
|
+
server: { host: '127.0.0.1', port: settings.FS_PREVIEW_WEB_PORT, strictPort: true, proxy: { ...proxy, '/ws': { target: hubUrl.replace('http', 'ws'), ws: true } } },
|
|
214
|
+
});
|
|
215
|
+
await server.listen();
|
|
216
|
+
const base = `http://127.0.0.1:${String(settings.FS_PREVIEW_WEB_PORT)}`;
|
|
217
|
+
console.info('preview.machines.serving', { web: base, admin: MOCK_ADMIN.email });
|
|
218
|
+
|
|
219
|
+
/** Sign in through the sign-in page, then open the Machines page and wait for what `ready` names. */
|
|
220
|
+
async function open(page_: Page, path: string, ready = '[data-testid="card-cpu"] canvas'): Promise<void> {
|
|
221
|
+
await page_.goto(`${base}/sign-in`, { waitUntil: 'networkidle0' });
|
|
222
|
+
// the browser keeps the sign-in after the first page
|
|
223
|
+
if (await page_.$('input[type="email"]') !== null) {
|
|
224
|
+
await page_.type('input[type="email"]', MOCK_ADMIN.email);
|
|
225
|
+
await page_.type('input[type="password"]', MOCK_ADMIN.password);
|
|
226
|
+
await page_.click('button[type="submit"]');
|
|
227
|
+
await page_.waitForFunction(() => location.pathname !== '/sign-in', { timeout: 30_000 });
|
|
228
|
+
}
|
|
229
|
+
await page_.goto(`${base}${path}`, { waitUntil: 'networkidle0' });
|
|
230
|
+
await page_.waitForSelector(ready, { timeout: 60_000 });
|
|
231
|
+
// the charts draw on their next frame
|
|
232
|
+
await new Promise((resolve) => { setTimeout(resolve, 1_500); });
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/** Click the first of `selector` whose text is `label`. */
|
|
236
|
+
async function press(tab: Page, selector: string, label: string): Promise<void> {
|
|
237
|
+
for (const button of await tab.$$(selector)) {
|
|
238
|
+
if ((await button.evaluate((el) => el.textContent.trim())) === label) { await button.click(); return; }
|
|
239
|
+
}
|
|
240
|
+
throw new Error(`no "${label}" in ${selector}`);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/** The Files tab's scenes: where each starts, what is done before its shot, and what it waits for first. */
|
|
244
|
+
const FILES = '/s/fs/machines?on=studio&tab=files';
|
|
245
|
+
const FILE_SCENES: ReadonlyArray<{ name: string; path: string; ready: string; act?: (tab: Page) => Promise<void> }> = [
|
|
246
|
+
{ name: 'files-folder', path: `${FILES}&dir=app`, ready: '.folder .entry' },
|
|
247
|
+
{ name: 'files-code-thread', path: `${FILES}&dir=app/src&open=app/src/main.ts`, ready: '.thread-row [data-comment]' },
|
|
248
|
+
{
|
|
249
|
+
name: 'files-image-markup', path: `${FILES}&dir=app/assets&open=app/assets/logo.png`, ready: '.image .stage img',
|
|
250
|
+
act: async (tab) => {
|
|
251
|
+
await press(tab, '.image .tools button', 'Mark an area');
|
|
252
|
+
await tab.waitForSelector('canvas.ink');
|
|
253
|
+
const box = await (await tab.$('canvas.ink'))?.boundingBox();
|
|
254
|
+
if (box === null || box === undefined) { throw new Error('no canvas to draw on'); }
|
|
255
|
+
// a loop around the title bars
|
|
256
|
+
const loop = [[0.5, 0.25], [0.7, 0.22], [0.88, 0.3], [0.9, 0.55], [0.8, 0.7], [0.6, 0.72], [0.5, 0.6], [0.5, 0.25]] as const;
|
|
257
|
+
await tab.mouse.move(box.x + box.width * loop[0][0], box.y + box.height * loop[0][1]);
|
|
258
|
+
await tab.mouse.down();
|
|
259
|
+
for (const [fx, fy] of loop.slice(1)) { await tab.mouse.move(box.x + box.width * fx, box.y + box.height * fy, { steps: 8 }); }
|
|
260
|
+
await tab.mouse.up();
|
|
261
|
+
await tab.type('.image .composer textarea', 'Give the title more room: shrink the circle a little.');
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
{ name: 'files-changes', path: `${FILES}&fview=changes`, ready: '.changes .file', act: async (tab) => { await tab.click('.changes .file'); await tab.waitForSelector('.changes .patch'); } },
|
|
265
|
+
{
|
|
266
|
+
name: 'files-history', path: `${FILES}&fview=history&dir=app`, ready: '.history .commit',
|
|
267
|
+
act: async (tab) => { const rows = await tab.$$('.history .commit'); await rows[1]?.click(); await tab.waitForSelector('.history .shown .files'); },
|
|
268
|
+
},
|
|
269
|
+
];
|
|
270
|
+
|
|
271
|
+
const browser = await puppeteer.launch({ headless: settings.FS_PREVIEW_HEADLESS });
|
|
272
|
+
let failed = 0;
|
|
273
|
+
const written: string[] = [];
|
|
274
|
+
await mkdir(shots, { recursive: true });
|
|
275
|
+
try {
|
|
276
|
+
const views = [{ name: 'phone', width: 390, height: 844, deviceScaleFactor: 2, isMobile: true, hasTouch: true }, { name: 'desktop', width: 1280, height: 900, deviceScaleFactor: 1, isMobile: false, hasTouch: false }] as const;
|
|
277
|
+
for (const view of views) {
|
|
278
|
+
for (const theme of ['light', 'dark'] as const) {
|
|
279
|
+
const metricScenes = [['day', '/s/fs/machines?on=studio'], ['hour', '/s/fs/machines?on=studio&range=1h'], ['off', '/s/fs/machines?on=nas']] as const;
|
|
280
|
+
const scenes = [
|
|
281
|
+
...(settings.FS_PREVIEW_ONLY === 'files' ? [] : metricScenes.map(([name, path]) => ({ name, path, ready: undefined, act: undefined }))),
|
|
282
|
+
...(settings.FS_PREVIEW_ONLY === 'metrics' ? [] : FILE_SCENES),
|
|
283
|
+
];
|
|
284
|
+
for (const { name, path, ready, act } of scenes) {
|
|
285
|
+
const tab = await browser.newPage();
|
|
286
|
+
await tab.evaluateOnNewDocument('globalThis.__name = (fn) => fn;');
|
|
287
|
+
await tab.setViewport({ width: view.width, height: view.height, deviceScaleFactor: view.deviceScaleFactor, isMobile: view.isMobile, hasTouch: view.hasTouch });
|
|
288
|
+
await tab.emulateMediaFeatures([{ name: 'prefers-color-scheme', value: theme }]);
|
|
289
|
+
if (name === 'off') {
|
|
290
|
+
await open(tab, '/s/fs/machines?on=studio');
|
|
291
|
+
await tab.goto(`${base}${path}`, { waitUntil: 'networkidle0' });
|
|
292
|
+
await tab.waitForSelector('[data-testid="metrics-off"]', { timeout: 30_000 });
|
|
293
|
+
} else {
|
|
294
|
+
await open(tab, path, ready);
|
|
295
|
+
await act?.(tab);
|
|
296
|
+
await new Promise((resolve) => { setTimeout(resolve, 800); });
|
|
297
|
+
}
|
|
298
|
+
const problems = (await layoutProblems(tab)).map((p) => `${p.rule}: ${p.detail}`);
|
|
299
|
+
// the app scrolls inside its own frame, so a whole-page shot needs a window as tall as what scrolls there
|
|
300
|
+
const tall = await tab.evaluate(() => Math.max(document.documentElement.scrollHeight, ...[...document.querySelectorAll('*')].map((el) => (el.scrollHeight > el.clientHeight + 4 ? el.scrollHeight + el.getBoundingClientRect().top : 0))));
|
|
301
|
+
await tab.setViewport({ width: view.width, height: Math.ceil(tall), deviceScaleFactor: view.deviceScaleFactor, isMobile: view.isMobile, hasTouch: view.hasTouch });
|
|
302
|
+
await new Promise((resolve) => { setTimeout(resolve, 1_500); });
|
|
303
|
+
const file = join(shots, `${name.startsWith('files-') ? name : `machines-${name}`}-${view.name}-${theme}.png`);
|
|
304
|
+
await tab.screenshot({ path: file, fullPage: true });
|
|
305
|
+
written.push(file);
|
|
306
|
+
if (problems.length > 0) { failed += 1; }
|
|
307
|
+
console.info(problems.length > 0 ? 'preview.failed' : 'preview.passed', { shot: file, problems });
|
|
308
|
+
await tab.close();
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
} finally {
|
|
313
|
+
await browser.close();
|
|
314
|
+
if (!settings.FS_PREVIEW_KEEP) {
|
|
315
|
+
await server.close();
|
|
316
|
+
await hub.stop();
|
|
317
|
+
await loader.close();
|
|
318
|
+
await metrics.stop();
|
|
319
|
+
await store.close();
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
console.info('preview.machines.shots', { written });
|
|
323
|
+
process.exitCode = failed === 0 ? 0 : 1;
|
|
@@ -4,6 +4,10 @@ key: "authoring"
|
|
|
4
4
|
title: "Writing a harness system"
|
|
5
5
|
description: "How to write, test and install a harness system: start at a topic group, then load only the parts the work needs."
|
|
6
6
|
summary: "How to write, test and install a harness system: start at a topic group, then load only the parts the work needs."
|
|
7
|
+
question: "How do I write, test and install a harness system?"
|
|
8
|
+
when: "When the person asks to make, change, test or install a harness system (a system adds fns, types, context and screens to the hub), or runs /new-system."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
7
11
|
fns: ["fs/read", "fs/write", "fs/edit", "fs/bash", "fs/install_system", "fs/system_status"]
|
|
8
12
|
tags: ["authoring"]
|
|
9
13
|
niche: "developer"
|
|
@@ -4,6 +4,10 @@ key: "authoring.actions"
|
|
|
4
4
|
title: "Actions"
|
|
5
5
|
description: "Writing a harness system: Actions."
|
|
6
6
|
summary: "Actions: stored buttons that call the system later."
|
|
7
|
+
question: "How does a message offer a button that calls the system later?"
|
|
8
|
+
when: "When a message or a run's card offers a button that calls the system when it is pressed."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
7
11
|
parent: "fs/authoring.topics.declare"
|
|
8
12
|
next: "fs/authoring.providers"
|
|
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: Model providers."
|
|
17
21
|
---
|
|
18
22
|
|
|
19
|
-
##
|
|
23
|
+
## 17. Actions
|
|
20
24
|
|
|
21
25
|
An **action** is a typed message the system's renderers send it ("pin", "approve", "load more"). Declare it with
|
|
22
26
|
`action({ description, input, returns?, state?, expires? })`: without `returns` it returns nothing, `state` declares
|
|
@@ -4,6 +4,10 @@ key: "authoring.actions.reference"
|
|
|
4
4
|
title: "Actions: reference"
|
|
5
5
|
description: "The API reference of Actions: every export with its TSDoc and signature."
|
|
6
6
|
summary: "Signatures and options for actions."
|
|
7
|
+
question: "What are the exact signatures and options in the API of actions?"
|
|
8
|
+
when: "When writing code for actions and an exact signature, field or option is needed."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
7
11
|
parent: "fs/authoring.actions"
|
|
8
12
|
suggest: "none"
|
|
9
13
|
tags: ["authoring", "reference"]
|
|
@@ -51,7 +55,7 @@ type · `import { ActionImpl } from '@harness/sdk'`
|
|
|
51
55
|
An action's implementation.
|
|
52
56
|
|
|
53
57
|
```ts
|
|
54
|
-
type ActionImpl<I, R, St extends object, Cfg = unknown, O extends
|
|
58
|
+
type ActionImpl<I, R, St extends object, Cfg = unknown, O extends AnyOwn = Own> = (input: I, ctx: ActionCtx<St, Cfg, O>) => Promise<R>;
|
|
55
59
|
```
|
|
56
60
|
|
|
57
61
|
#### `ActionCtx`
|
|
@@ -61,7 +65,7 @@ interface · `import { ActionCtx } from '@harness/sdk'`
|
|
|
61
65
|
What an action's implementation gets.
|
|
62
66
|
|
|
63
67
|
```ts
|
|
64
|
-
interface ActionCtx<St extends object, Cfg = unknown, O extends
|
|
68
|
+
interface ActionCtx<St extends object, Cfg = unknown, O extends AnyOwn = Own> extends SystemCtx<Cfg, O>, AskerCtx, Omit<Services, 'log' | 'llm' | 'resources' | 'types'> {
|
|
65
69
|
readonly delivery: DeliveryId;
|
|
66
70
|
/** The run whose renderer sent it, if any. */
|
|
67
71
|
readonly run: RunId | undefined;
|
|
@@ -4,6 +4,10 @@ key: "authoring.calling"
|
|
|
4
4
|
title: "Calling other fns"
|
|
5
5
|
description: "Writing a harness system: Calling other fns."
|
|
6
6
|
summary: "Calling other fns from a run, with deps and handlers."
|
|
7
|
+
question: "How does a fn call another fn from its run?"
|
|
8
|
+
when: "When a fn calls another system's fn (or a hub fn) with deps and handlers."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
7
11
|
parent: "fs/authoring.topics.fns"
|
|
8
12
|
next: "fs/authoring.lifecycle"
|
|
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: Config, events, lifecycle and data."
|
|
17
21
|
---
|
|
18
22
|
|
|
19
|
-
##
|
|
23
|
+
## 23. Calling other fns
|
|
20
24
|
|
|
21
25
|
A fn calls another fn (of its own system, another system or the hub) by declaring it as a **dep** with its ref, then
|
|
22
26
|
calling it through `ctx.fns`. Nothing else can be called, and the args, result and handlers are typed by the ref:
|
|
@@ -4,6 +4,10 @@ key: "authoring.calling.reference"
|
|
|
4
4
|
title: "Calling other fns: reference"
|
|
5
5
|
description: "The API reference of Calling other fns: every export with its TSDoc and signature."
|
|
6
6
|
summary: "Signatures and options for calling other fns."
|
|
7
|
+
question: "What are the exact signatures and options in the API of calling other fns?"
|
|
8
|
+
when: "When writing code for calling other fns and an exact signature, field or option is needed."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-28"
|
|
7
11
|
parent: "fs/authoring.calling"
|
|
8
12
|
suggest: "none"
|
|
9
13
|
tags: ["authoring", "reference"]
|
|
@@ -4,6 +4,10 @@ key: "authoring.client"
|
|
|
4
4
|
title: "The client: renderers, inputs, resource views and pages"
|
|
5
5
|
description: "Writing a harness system: The client: renderers, inputs, resource views and pages."
|
|
6
6
|
summary: "Vue renderers, inputs and resource views, typed by the contract."
|
|
7
|
+
question: "How do I write a system's Vue renderers, inputs and views?"
|
|
8
|
+
when: "When writing a system's client/ components: renderers, inputs, resource views and pages."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-29"
|
|
7
11
|
parent: "fs/authoring.topics.client"
|
|
8
12
|
next: "fs/authoring.widgets"
|
|
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: Visuals and widgets."
|
|
17
21
|
---
|
|
18
22
|
|
|
19
|
-
##
|
|
23
|
+
## 27. The client: renderers, inputs, resource views and pages
|
|
20
24
|
|
|
21
25
|
A system can draw its things in the chat with **Vue 3 components**. `client(contract, renderers)` in `client/index.ts`
|
|
22
26
|
(default export) registers them, and each component's props are typed by the contract, so a component with the wrong
|
|
@@ -125,8 +129,10 @@ starts a new run of one of the system's fns in the renderer's session, as a pers
|
|
|
125
129
|
|
|
126
130
|
**Results.** A result renderer draws only what a finished run gave, under the chat's own run line (its status, cost and
|
|
127
131
|
args stay the chat's); a fn renderer, which draws the whole run as it goes, wins over it. It may draw with the app's
|
|
128
|
-
result view, `inject(RESULT_VIEW)` (`ResultViewProps`: a result table or a
|
|
129
|
-
and row actions; `keepLook` lets Settings keep the look picked there
|
|
132
|
+
result view, `inject(RESULT_VIEW)` (`ResultViewProps`: a result table or a shown result, core's `ShownResult`, with its
|
|
133
|
+
visuals, pager, drill and row actions; `keepLook` lets Settings keep the look picked there; its `controls` slot,
|
|
134
|
+
`ResultControls`, is where the renderer draws its own controls and runs the result again with other args, as the
|
|
135
|
+
widgets system's chips do; `client({ resultItems })` adds an item to plain result tables' menus), and with the app's controls,
|
|
130
136
|
`inject(APP_COMPONENTS)` (the same `SharedComponents` a page has as `host.components`). In a chat, `inject(CHAT_HOST)` asks the agent
|
|
131
137
|
(`ask(text, send)`), waits for a run the renderer started to end (`settled(run)` gives a `RunOutcome`) and moves the app
|
|
132
138
|
(`navigate(path)`). The widgets system draws a `make_widget` proposal's card with Save this way, and a saved widget's
|
|
@@ -143,6 +149,10 @@ viewer either replaces the hub's preview for its format (`mode: 'replace'`) or a
|
|
|
143
149
|
`label`); a bare component replaces. `view.forms` lists the forms the hub made of the resource and `view.text(form)` reads
|
|
144
150
|
one (the notes system's `client/WordCount.vue` adds a Words tab to every markdown resource). Inside any
|
|
145
151
|
renderer, `inject(RESOURCE_VIEWER)` gives the component that shows any resource (`<ResourceViewer :uri="uri" compact />`).
|
|
152
|
+
A renderer or page that draws code itself (line numbers, change bars, a selection) highlights it with the app's Shiki
|
|
153
|
+
through `inject(CODE_HIGHLIGHTER)` (`CodeHighlighter`): `tokens(code, language)` answers at once with what is loaded,
|
|
154
|
+
as `CodeToken`s drawn as text with the `tok-<kind>` classes, and `prepare(language)` resolves true once a grammar has
|
|
155
|
+
loaded and `tokens` would answer better.
|
|
146
156
|
|
|
147
157
|
**Look.** Renderers sit inside the chat, so use its design tokens (`var(--space-2)`, `var(--surface)`, `var(--border)`,
|
|
148
158
|
`var(--text-dim)`, `var(--accent)`, `var(--danger)`, `var(--radius)`, `var(--text-sm)`, …) in scoped styles, so they
|
|
@@ -163,16 +173,32 @@ Each must be listed in the contract's `contributes` with a declared shape (`visu
|
|
|
163
173
|
the shape alone judges and ranks a fit, the same in the hub, the widget agent and the browser. `veto(table, facts)` may
|
|
164
174
|
only take a fit away, with a reason; keep it cheap and pure. The chat's runtime lists the visuals a result may use
|
|
165
175
|
(`visuals(registry, table, facts)`, in load order), leaving out a vetoed one and one whose veto throws; the result view
|
|
166
|
-
ranks them with the built-in
|
|
176
|
+
ranks them with the built-in table and value cards (every chart, the widgets system's included, comes this way). How to
|
|
177
|
+
draw one with ECharts is in [Visuals and widgets](context:fs/authoring.widgets).
|
|
167
178
|
|
|
168
179
|
**Pages.** A system can add whole pages to the app, each at `/s/<system>/<segment>`. Declare each in the contract's
|
|
169
180
|
`pages` (`segment`, `title`, `description?`, `icon?`, `nav`: `main` puts it in the sidebar, `hidden` leaves it for links
|
|
170
|
-
such as one item's page; `access`: `everyone` or `admin`; and `component`), and give
|
|
181
|
+
such as one item's page; `access`: `everyone` or `admin`; `area`: `app`, the default, or `admin`; and `component`), and give
|
|
182
|
+
the component in
|
|
171
183
|
`client(contract, { pages: { NotesPage } })`. `client()` throws when a declared page has no component, or a component
|
|
172
184
|
no page names. The hub lists a page while its system is installed and live with its renderers on (an admin reviews and
|
|
173
185
|
can switch off each page like any component), so the page and its sidebar entry appear and disappear with the system;
|
|
174
186
|
an old link to a page whose system is gone keeps its URL and says the system isn't installed.
|
|
175
187
|
|
|
188
|
+
**Admin pages.** A page with `area: 'admin'` is drawn inside the admin area, at `/admin/s/<system>/<segment>`, for admins
|
|
189
|
+
only (whatever `access` says), and a `main` one joins the admin nav's Systems group while the system is live. The mcp
|
|
190
|
+
system's MCP servers page (`/admin/s/mcp/servers`) and the api system's API services page (`/admin/s/api/services`) are
|
|
191
|
+
drawn this way: one page each, the list at its root and one item under it (`servers/<instance>/<tab>`). Beside the
|
|
192
|
+
host, the app provides `AppParts` (`inject(APP_PARTS)`): the admin pages' own parts (`Tabs`, `Segmented`, `Switch`,
|
|
193
|
+
`ChipInput`, `IconButton`, `Card`, `FnList`, `Facts`, `Confirm`), `href(place)` / `go(place)` to the app's own places
|
|
194
|
+
(`AppPlace`: a fn's page, an instance, a connections page, the resource browser under a root, a context item) and
|
|
195
|
+
`bytes(count)`. `@harness/sdk/client-ui` holds what such pages share, bundled into each client build: `useParts()` (the
|
|
196
|
+
host's components and the admin parts together), `useAppParts()`, `usePageHost()`, `plainClick`, the state helpers
|
|
197
|
+
(`Loaded`, `Task`, `problemText`, `checkPaths`, `draftFields`), and for a remote service's forms the sign-in draft and
|
|
198
|
+
kept secrets (`authDraft`, `authCandidate`, `checkConfig`, `withoutKept`) with `RemoteAuthFields`, `PairRowsEditor`,
|
|
199
|
+
`InstanceNameField`, `AddServiceDialog` and `ServiceRows`. Its tests use `@harness/sdk/client-ui/testing` (`fakeHub`,
|
|
200
|
+
`fakeHost`: mount with `global: { provide: made.provide }`).
|
|
201
|
+
|
|
176
202
|
_From `scripts/docs/example/shared/index.ts`:_
|
|
177
203
|
|
|
178
204
|
```ts
|
|
@@ -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
3
|
key: "authoring.client.reference.client"
|
|
4
|
-
title: "The client: renderers, inputs, resource views and pages: reference: client …
|
|
4
|
+
title: "The client: renderers, inputs, resource views and pages: reference: client … VisualSource"
|
|
5
5
|
description: "The client: renderers, inputs, resource views and pages: reference, the part on client, ClientRenderers, ClientModule, Renderer, FnView, FnViewOf, AttachmentView, AttachmentViewOf, InputView, InputViewOf, MentionView, ResourceView, SystemClient, WithSystem, Delivery, ResourceViewerEntry, BareViewer, ResourceViewerMode, RESOURCE_VIEWER_MODES, RESOURCE_VIEWER, ResourceViewerProps, INPUT_ANSWERS,…"
|
|
6
6
|
summary: "The client: renderers, inputs, resource views and pages: reference: client, ClientRenderers, ClientModule, Renderer, FnView, FnViewOf, AttachmentView,…"
|
|
7
|
+
question: "What are the exact signatures and options of client, ClientRenderers, ClientModule, Renderer, FnView, FnViewOf and 34 more?"
|
|
8
|
+
when: "When code uses client, ClientRenderers, ClientModule, Renderer, FnView, FnViewOf and 34 more and needs an exact signature, field or option."
|
|
9
|
+
askedBy: "system"
|
|
10
|
+
lastModified: "2026-11-29"
|
|
7
11
|
parent: "fs/authoring.client.reference"
|
|
8
|
-
next: "fs/authoring.client.reference.
|
|
12
|
+
next: "fs/authoring.client.reference.visuals"
|
|
9
13
|
suggest: "none"
|
|
10
14
|
tags: ["authoring", "reference"]
|
|
11
15
|
niche: "developer"
|
|
@@ -58,6 +62,8 @@ interface ClientRenderers<C extends ContractShape> {
|
|
|
58
62
|
* the contract's `contributes`, which is how the hub and the web app know to load this bundle for that registry.
|
|
59
63
|
*/
|
|
60
64
|
visuals?: Readonly<Record<QualifiedName, Readonly<Record<string, VisualEntry<C>>>>>;
|
|
65
|
+
/** Items this system adds to plain result tables' 3-dot menus, by name (`ResultItemEntry`: the widgets system's "Make a widget"). */
|
|
66
|
+
resultItems?: Readonly<Record<string, ResultItemEntry>>;
|
|
61
67
|
/**
|
|
62
68
|
* Config components by name. The one the contract's `configComponent` names is drawn for the system's config; it must
|
|
63
69
|
* be here, and every component here must be the one named.
|
|
@@ -625,14 +631,3 @@ interface VisualSource {
|
|
|
625
631
|
```
|
|
626
632
|
|
|
627
633
|
Refers to: [`QualifiedName`](context:fs/authoring.core-types.primitives-ts#core-qualifiedname), [`ResultFacts`](context:fs/authoring.core-types.visuals-ts#core-resultfacts), [`ResultTable`](context:fs/authoring.core-types.registries-ts#core-resulttable).
|
|
628
|
-
|
|
629
|
-
#### `VISUALS`
|
|
630
|
-
|
|
631
|
-
const · `import { VISUALS } from '@harness/sdk'`
|
|
632
|
-
|
|
633
|
-
Every loaded system's visuals for a registry (the chat provides its client runtime's), so a result view can offer
|
|
634
|
-
visuals other systems contribute. Without it, a view falls back on its own system's visuals.
|
|
635
|
-
|
|
636
|
-
```ts
|
|
637
|
-
const VISUALS: InjectionKey<VisualSource>;
|
|
638
|
-
```
|