fnloom 0.0.1 → 0.2.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/LICENSE +201 -0
- package/README.md +174 -3
- package/package.json +70 -4
- package/packages/build/package.json +31 -0
- package/packages/build/src/build-system.ts +186 -0
- package/packages/build/src/builder.ts +225 -0
- package/packages/build/src/context.ts +2 -0
- package/packages/build/src/files.ts +73 -0
- package/packages/build/src/folder.ts +52 -0
- package/packages/build/src/index.ts +20 -0
- package/packages/build/src/scan.ts +82 -0
- package/packages/build/src/tests.ts +138 -0
- package/packages/build/tsconfig.json +6 -0
- package/packages/cli/bin/harness.mjs +17 -0
- package/packages/cli/package.json +27 -0
- package/packages/cli/src/catalog.ts +35 -0
- package/packages/cli/src/cli.ts +83 -0
- package/packages/cli/src/command.ts +112 -0
- package/packages/cli/src/commands/available.ts +107 -0
- package/packages/cli/src/commands/build.ts +57 -0
- package/packages/cli/src/commands/data.ts +36 -0
- package/packages/cli/src/commands/install.ts +167 -0
- package/packages/cli/src/commands/manage.ts +104 -0
- package/packages/cli/src/commands/mcp.ts +198 -0
- package/packages/cli/src/commands/new.ts +139 -0
- package/packages/cli/src/commands/pack.ts +37 -0
- package/packages/cli/src/commands/start.ts +22 -0
- package/packages/cli/src/commands/test.ts +57 -0
- package/packages/cli/src/files.ts +5 -0
- package/packages/cli/src/hub-client.ts +84 -0
- package/packages/cli/src/hub.ts +169 -0
- package/packages/cli/src/index.ts +13 -0
- package/packages/cli/src/io.ts +32 -0
- package/packages/cli/src/live.ts +66 -0
- package/packages/cli/src/local.ts +100 -0
- package/packages/cli/src/main.ts +6 -0
- package/packages/cli/src/premade.ts +80 -0
- package/packages/cli/src/testing.ts +216 -0
- package/packages/cli/tsconfig.json +6 -0
- package/packages/core/package.json +21 -0
- package/packages/core/src/access.ts +97 -0
- package/packages/core/src/admin.ts +90 -0
- package/packages/core/src/api-index.ts +26 -0
- package/packages/core/src/approvals.ts +229 -0
- package/packages/core/src/auto-pair.ts +47 -0
- package/packages/core/src/changes.ts +61 -0
- package/packages/core/src/checks.ts +93 -0
- package/packages/core/src/claims.ts +98 -0
- package/packages/core/src/compare.ts +47 -0
- package/packages/core/src/config-secrets.ts +28 -0
- package/packages/core/src/connections.ts +193 -0
- package/packages/core/src/context-files.ts +179 -0
- package/packages/core/src/context-graph.ts +270 -0
- package/packages/core/src/csv.ts +33 -0
- package/packages/core/src/data.ts +176 -0
- package/packages/core/src/decisions.ts +98 -0
- package/packages/core/src/flow.ts +225 -0
- package/packages/core/src/fn-block.ts +51 -0
- package/packages/core/src/fn-facts.ts +533 -0
- package/packages/core/src/fn-renames.ts +102 -0
- package/packages/core/src/gin-a.ts +185 -0
- package/packages/core/src/gin-record.ts +142 -0
- package/packages/core/src/gin.ts +104 -0
- package/packages/core/src/grants.ts +84 -0
- package/packages/core/src/graph-kinds.ts +44 -0
- package/packages/core/src/graph.ts +95 -0
- package/packages/core/src/https.ts +35 -0
- package/packages/core/src/identity.ts +38 -0
- package/packages/core/src/image-embeddings.ts +96 -0
- package/packages/core/src/index.ts +129 -0
- package/packages/core/src/inject.ts +104 -0
- package/packages/core/src/issues.ts +137 -0
- package/packages/core/src/labels.ts +96 -0
- package/packages/core/src/lifecycle.ts +237 -0
- package/packages/core/src/link.ts +491 -0
- package/packages/core/src/llm.ts +167 -0
- package/packages/core/src/manifest.ts +657 -0
- package/packages/core/src/mcp-servers.ts +134 -0
- package/packages/core/src/media-types.ts +145 -0
- package/packages/core/src/mention-search.ts +27 -0
- package/packages/core/src/metrics.ts +91 -0
- package/packages/core/src/model-calls.ts +223 -0
- package/packages/core/src/model-names.ts +704 -0
- package/packages/core/src/modes.ts +325 -0
- package/packages/core/src/objects.ts +15 -0
- package/packages/core/src/owner-runs.ts +89 -0
- package/packages/core/src/package.ts +195 -0
- package/packages/core/src/partial.ts +69 -0
- package/packages/core/src/people-only.ts +52 -0
- package/packages/core/src/pickers.ts +31 -0
- package/packages/core/src/ports.ts +14 -0
- package/packages/core/src/primitives.ts +287 -0
- package/packages/core/src/programs.ts +155 -0
- package/packages/core/src/query.ts +264 -0
- package/packages/core/src/records/actors.ts +188 -0
- package/packages/core/src/records/announced.ts +39 -0
- package/packages/core/src/records/chat.ts +279 -0
- package/packages/core/src/records/citations.ts +126 -0
- package/packages/core/src/records/compare.ts +97 -0
- package/packages/core/src/records/content.ts +196 -0
- package/packages/core/src/records/injections.ts +146 -0
- package/packages/core/src/records/mcps.ts +115 -0
- package/packages/core/src/records/runs.ts +280 -0
- package/packages/core/src/records/spend.ts +158 -0
- package/packages/core/src/records/systems.ts +298 -0
- package/packages/core/src/records/tables.ts +164 -0
- package/packages/core/src/registries.ts +229 -0
- package/packages/core/src/remote-auth.ts +111 -0
- package/packages/core/src/resource-forms.ts +218 -0
- package/packages/core/src/resources.ts +166 -0
- package/packages/core/src/review-summary.ts +69 -0
- package/packages/core/src/run.ts +312 -0
- package/packages/core/src/sensitivity.ts +101 -0
- package/packages/core/src/sso.ts +268 -0
- package/packages/core/src/status.ts +158 -0
- package/packages/core/src/suggestions.ts +228 -0
- package/packages/core/src/system-events.ts +47 -0
- package/packages/core/src/system-pages.ts +72 -0
- package/packages/core/src/system-parts.ts +51 -0
- package/packages/core/src/system-providers.ts +163 -0
- package/packages/core/src/urls.ts +50 -0
- package/packages/core/src/validation.ts +39 -0
- package/packages/core/src/versions.ts +52 -0
- package/packages/core/src/visuals.ts +478 -0
- package/packages/core/src/web.ts +965 -0
- package/packages/core/src/widgets-v1.ts +73 -0
- package/packages/core/src/widgets.ts +427 -0
- package/packages/core/tsconfig.json +5 -0
- package/packages/hub/context/asking.md +16 -0
- package/packages/hub/context/attached_files.md +27 -0
- package/packages/hub/context/background_runs.md +14 -0
- package/packages/hub/context/earlier_chats.md +16 -0
- package/packages/hub/context/examples.md +13 -0
- package/packages/hub/context/finding_fns.md +18 -0
- package/packages/hub/context/images.md +24 -0
- package/packages/hub/context/later.md +27 -0
- package/packages/hub/context/limits.md +13 -0
- package/packages/hub/context/memory.md +38 -0
- package/packages/hub/context/resources.md +21 -0
- package/packages/hub/context/saved_fns.md +28 -0
- package/packages/hub/context/undo.md +20 -0
- package/packages/hub/package.json +55 -0
- package/packages/hub/src/access/create.ts +29 -0
- package/packages/hub/src/access/hits.ts +57 -0
- package/packages/hub/src/access/index.ts +119 -0
- package/packages/hub/src/access/scope.ts +133 -0
- package/packages/hub/src/access/service.ts +171 -0
- package/packages/hub/src/api/admin-ops.ts +410 -0
- package/packages/hub/src/api/auth.ts +286 -0
- package/packages/hub/src/api/client-address.ts +55 -0
- package/packages/hub/src/api/connect.ts +45 -0
- package/packages/hub/src/api/dual.ts +103 -0
- package/packages/hub/src/api/events.ts +185 -0
- package/packages/hub/src/api/files.ts +209 -0
- package/packages/hub/src/api/hash.ts +23 -0
- package/packages/hub/src/api/http.ts +171 -0
- package/packages/hub/src/api/https.ts +125 -0
- package/packages/hub/src/api/identities.ts +246 -0
- package/packages/hub/src/api/index.ts +94 -0
- package/packages/hub/src/api/injections.ts +256 -0
- package/packages/hub/src/api/mime.ts +31 -0
- package/packages/hub/src/api/person-ops.ts +153 -0
- package/packages/hub/src/api/push.ts +97 -0
- package/packages/hub/src/api/reads.ts +145 -0
- package/packages/hub/src/api/secrets.ts +71 -0
- package/packages/hub/src/api/serve.ts +280 -0
- package/packages/hub/src/api/signed.ts +66 -0
- package/packages/hub/src/api/sso-route.ts +73 -0
- package/packages/hub/src/api/sso.ts +382 -0
- package/packages/hub/src/api/system-parts.ts +97 -0
- package/packages/hub/src/api/testing/issuer.ts +128 -0
- package/packages/hub/src/api/testing/rig.ts +272 -0
- package/packages/hub/src/api/tls.ts +383 -0
- package/packages/hub/src/api/web/access.ts +84 -0
- package/packages/hub/src/api/web/admin.ts +90 -0
- package/packages/hub/src/api/web/auth.ts +103 -0
- package/packages/hub/src/api/web/build3.ts +44 -0
- package/packages/hub/src/api/web/build4.ts +24 -0
- package/packages/hub/src/api/web/build5.ts +120 -0
- package/packages/hub/src/api/web/chat.ts +144 -0
- package/packages/hub/src/api/web/content.ts +42 -0
- package/packages/hub/src/api/web/context.ts +41 -0
- package/packages/hub/src/api/web/contextor.ts +37 -0
- package/packages/hub/src/api/web/data.ts +33 -0
- package/packages/hub/src/api/web/explorer.ts +22 -0
- package/packages/hub/src/api/web/find.ts +50 -0
- package/packages/hub/src/api/web/graph.ts +17 -0
- package/packages/hub/src/api/web/https.ts +18 -0
- package/packages/hub/src/api/web/identity.ts +18 -0
- package/packages/hub/src/api/web/images.ts +18 -0
- package/packages/hub/src/api/web/inbox.ts +35 -0
- package/packages/hub/src/api/web/index.ts +137 -0
- package/packages/hub/src/api/web/injections.ts +22 -0
- package/packages/hub/src/api/web/mcps.ts +32 -0
- package/packages/hub/src/api/web/metrics.ts +24 -0
- package/packages/hub/src/api/web/models.ts +21 -0
- package/packages/hub/src/api/web/outside-images.ts +32 -0
- package/packages/hub/src/api/web/packaging.ts +31 -0
- package/packages/hub/src/api/web/pages.ts +55 -0
- package/packages/hub/src/api/web/people.ts +92 -0
- package/packages/hub/src/api/web/pickers.ts +115 -0
- package/packages/hub/src/api/web/resources.ts +42 -0
- package/packages/hub/src/api/web/review.ts +119 -0
- package/packages/hub/src/api/web/runs.ts +94 -0
- package/packages/hub/src/api/web/settings.ts +35 -0
- package/packages/hub/src/api/web/systems.ts +83 -0
- package/packages/hub/src/api/web/tables.ts +31 -0
- package/packages/hub/src/api/web/versions.ts +17 -0
- package/packages/hub/src/api/web/visibility.ts +47 -0
- package/packages/hub/src/boot/admin-fns.ts +78 -0
- package/packages/hub/src/boot/admin-secrets.ts +140 -0
- package/packages/hub/src/boot/env.ts +170 -0
- package/packages/hub/src/boot/hub-context.ts +39 -0
- package/packages/hub/src/boot/hub-fns.ts +549 -0
- package/packages/hub/src/boot/hub-groups.ts +34 -0
- package/packages/hub/src/boot/identity.ts +66 -0
- package/packages/hub/src/boot/index.ts +191 -0
- package/packages/hub/src/boot/info.ts +22 -0
- package/packages/hub/src/boot/keys.ts +60 -0
- package/packages/hub/src/boot/log.ts +31 -0
- package/packages/hub/src/boot/modules.ts +277 -0
- package/packages/hub/src/boot/person-fns.ts +78 -0
- package/packages/hub/src/boot/read-fns.ts +73 -0
- package/packages/hub/src/boot/services.ts +156 -0
- package/packages/hub/src/boot/start.ts +246 -0
- package/packages/hub/src/bus/memory.ts +60 -0
- package/packages/hub/src/bus.ts +80 -0
- package/packages/hub/src/catalog/api-index.ts +72 -0
- package/packages/hub/src/catalog/availability.ts +210 -0
- package/packages/hub/src/catalog/catalog.ts +1062 -0
- package/packages/hub/src/catalog/definitions.ts +19 -0
- package/packages/hub/src/catalog/fixtures.ts +82 -0
- package/packages/hub/src/catalog/fn-names.ts +128 -0
- package/packages/hub/src/catalog/index.ts +126 -0
- package/packages/hub/src/catalog/injections.ts +90 -0
- package/packages/hub/src/catalog/scope.ts +86 -0
- package/packages/hub/src/catalog/serial.ts +10 -0
- package/packages/hub/src/catalog/signature.ts +69 -0
- package/packages/hub/src/catalog/versions.ts +110 -0
- package/packages/hub/src/chat/announce.ts +145 -0
- package/packages/hub/src/chat/cache.ts +50 -0
- package/packages/hub/src/chat/chat.ts +72 -0
- package/packages/hub/src/chat/cite-rule.ts +64 -0
- package/packages/hub/src/chat/cites.ts +236 -0
- package/packages/hub/src/chat/compare.ts +290 -0
- package/packages/hub/src/chat/deliveries.ts +187 -0
- package/packages/hub/src/chat/deps.ts +69 -0
- package/packages/hub/src/chat/enrich.ts +601 -0
- package/packages/hub/src/chat/env.ts +33 -0
- package/packages/hub/src/chat/errors.ts +38 -0
- package/packages/hub/src/chat/files.ts +72 -0
- package/packages/hub/src/chat/index.ts +259 -0
- package/packages/hub/src/chat/mention-requests.ts +49 -0
- package/packages/hub/src/chat/mention-search.ts +64 -0
- package/packages/hub/src/chat/mentions.ts +274 -0
- package/packages/hub/src/chat/notifications.ts +278 -0
- package/packages/hub/src/chat/people.ts +59 -0
- package/packages/hub/src/chat/presence.ts +48 -0
- package/packages/hub/src/chat/reply.ts +23 -0
- package/packages/hub/src/chat/sessions.ts +306 -0
- package/packages/hub/src/chat/shown.ts +158 -0
- package/packages/hub/src/chat/state.ts +270 -0
- package/packages/hub/src/chat/streams.ts +92 -0
- package/packages/hub/src/chat/suggestions.ts +383 -0
- package/packages/hub/src/chat/support.ts +144 -0
- package/packages/hub/src/chat/testing.ts +488 -0
- package/packages/hub/src/chat/turns.ts +586 -0
- package/packages/hub/src/chat/undo.ts +177 -0
- package/packages/hub/src/connections/create.ts +25 -0
- package/packages/hub/src/connections/env.ts +14 -0
- package/packages/hub/src/connections/index.ts +86 -0
- package/packages/hub/src/connections/service.ts +536 -0
- package/packages/hub/src/contextor/brought.ts +64 -0
- package/packages/hub/src/contextor/budget.ts +74 -0
- package/packages/hub/src/contextor/calibration.ts +35 -0
- package/packages/hub/src/contextor/choose.ts +116 -0
- package/packages/hub/src/contextor/contextors.ts +550 -0
- package/packages/hub/src/contextor/crawl.ts +252 -0
- package/packages/hub/src/contextor/create.ts +113 -0
- package/packages/hub/src/contextor/dynamic.ts +102 -0
- package/packages/hub/src/contextor/env.ts +83 -0
- package/packages/hub/src/contextor/examples.ts +204 -0
- package/packages/hub/src/contextor/fns.ts +147 -0
- package/packages/hub/src/contextor/graph.ts +137 -0
- package/packages/hub/src/contextor/history.ts +211 -0
- package/packages/hub/src/contextor/index.ts +524 -0
- package/packages/hub/src/contextor/injected.ts +401 -0
- package/packages/hub/src/contextor/limits.ts +168 -0
- package/packages/hub/src/contextor/links.ts +67 -0
- package/packages/hub/src/contextor/modes.ts +520 -0
- package/packages/hub/src/contextor/planner.ts +626 -0
- package/packages/hub/src/contextor/render.ts +531 -0
- package/packages/hub/src/contextor/score.ts +93 -0
- package/packages/hub/src/contextor/testing.ts +161 -0
- package/packages/hub/src/contextor/tokens.ts +102 -0
- package/packages/hub/src/contextor/views.ts +171 -0
- package/packages/hub/src/contextor/xml.ts +140 -0
- package/packages/hub/src/data/create.ts +45 -0
- package/packages/hub/src/data/env.ts +16 -0
- package/packages/hub/src/data/fields.ts +71 -0
- package/packages/hub/src/data/fns.ts +50 -0
- package/packages/hub/src/data/index.ts +50 -0
- package/packages/hub/src/data/service.ts +348 -0
- package/packages/hub/src/execution/agent.ts +1381 -0
- package/packages/hub/src/execution/ai.ts +408 -0
- package/packages/hub/src/execution/channel.ts +38 -0
- package/packages/hub/src/execution/claims.ts +103 -0
- package/packages/hub/src/execution/create.ts +261 -0
- package/packages/hub/src/execution/deadlines.ts +74 -0
- package/packages/hub/src/execution/deciders.ts +60 -0
- package/packages/hub/src/execution/env.ts +28 -0
- package/packages/hub/src/execution/errors.ts +103 -0
- package/packages/hub/src/execution/executors.ts +246 -0
- package/packages/hub/src/execution/gateway.ts +209 -0
- package/packages/hub/src/execution/handlers.ts +154 -0
- package/packages/hub/src/execution/hub-fns.ts +50 -0
- package/packages/hub/src/execution/index.ts +244 -0
- package/packages/hub/src/execution/interactions.ts +65 -0
- package/packages/hub/src/execution/ledger.ts +168 -0
- package/packages/hub/src/execution/limits.ts +175 -0
- package/packages/hub/src/execution/link-handlers.ts +142 -0
- package/packages/hub/src/execution/media.ts +240 -0
- package/packages/hub/src/execution/models.ts +42 -0
- package/packages/hub/src/execution/policies.ts +371 -0
- package/packages/hub/src/execution/ports.ts +159 -0
- package/packages/hub/src/execution/providers.ts +106 -0
- package/packages/hub/src/execution/queues.ts +161 -0
- package/packages/hub/src/execution/runs.ts +1237 -0
- package/packages/hub/src/execution/scope.ts +152 -0
- package/packages/hub/src/execution/spend.ts +75 -0
- package/packages/hub/src/execution/stream-guard.ts +138 -0
- package/packages/hub/src/execution/testing.ts +490 -0
- package/packages/hub/src/execution/time.ts +36 -0
- package/packages/hub/src/execution/tools.ts +84 -0
- package/packages/hub/src/execution/wire.ts +99 -0
- package/packages/hub/src/execution/wording.ts +38 -0
- package/packages/hub/src/fns/auto.ts +109 -0
- package/packages/hub/src/fns/client-logs.ts +83 -0
- package/packages/hub/src/fns/costs.ts +139 -0
- package/packages/hub/src/fns/create.ts +140 -0
- package/packages/hub/src/fns/decided.ts +313 -0
- package/packages/hub/src/fns/env.ts +23 -0
- package/packages/hub/src/fns/examples.ts +184 -0
- package/packages/hub/src/fns/facts.ts +251 -0
- package/packages/hub/src/fns/gate.ts +40 -0
- package/packages/hub/src/fns/index.ts +149 -0
- package/packages/hub/src/fns/search.ts +351 -0
- package/packages/hub/src/graph/graph.ts +667 -0
- package/packages/hub/src/graph/source.ts +42 -0
- package/packages/hub/src/index/batch.ts +96 -0
- package/packages/hub/src/index/context-sections.ts +51 -0
- package/packages/hub/src/index/embedders.ts +242 -0
- package/packages/hub/src/index/env.ts +25 -0
- package/packages/hub/src/index/image-setting.ts +55 -0
- package/packages/hub/src/index/images.ts +43 -0
- package/packages/hub/src/index/index.ts +168 -0
- package/packages/hub/src/index/indexer.ts +663 -0
- package/packages/hub/src/index/search.ts +168 -0
- package/packages/hub/src/index/sectioners.ts +209 -0
- package/packages/hub/src/index/sectioning.ts +57 -0
- package/packages/hub/src/index/suggester.ts +65 -0
- package/packages/hub/src/index/testing.ts +113 -0
- package/packages/hub/src/index.ts +19 -0
- package/packages/hub/src/link/auto-pair.ts +225 -0
- package/packages/hub/src/link/build.ts +216 -0
- package/packages/hub/src/link/config-secrets.ts +171 -0
- package/packages/hub/src/link/config.ts +140 -0
- package/packages/hub/src/link/connections.ts +139 -0
- package/packages/hub/src/link/describer.ts +29 -0
- package/packages/hub/src/link/env.ts +42 -0
- package/packages/hub/src/link/events.ts +123 -0
- package/packages/hub/src/link/gate.ts +117 -0
- package/packages/hub/src/link/grants.ts +346 -0
- package/packages/hub/src/link/handlers.ts +301 -0
- package/packages/hub/src/link/index.ts +232 -0
- package/packages/hub/src/link/install.ts +92 -0
- package/packages/hub/src/link/keys.ts +32 -0
- package/packages/hub/src/link/lifecycle.ts +520 -0
- package/packages/hub/src/link/migrate-api.ts +210 -0
- package/packages/hub/src/link/migrate.ts +44 -0
- package/packages/hub/src/link/output.ts +63 -0
- package/packages/hub/src/link/owner-runs.ts +313 -0
- package/packages/hub/src/link/package/data.ts +53 -0
- package/packages/hub/src/link/package/format.ts +126 -0
- package/packages/hub/src/link/package/index.ts +9 -0
- package/packages/hub/src/link/package/zip.ts +137 -0
- package/packages/hub/src/link/packages.ts +180 -0
- package/packages/hub/src/link/pairing.ts +503 -0
- package/packages/hub/src/link/process.ts +98 -0
- package/packages/hub/src/link/reads.ts +91 -0
- package/packages/hub/src/link/resources.ts +166 -0
- package/packages/hub/src/link/review-summary.ts +279 -0
- package/packages/hub/src/link/rig.ts +335 -0
- package/packages/hub/src/link/router.ts +118 -0
- package/packages/hub/src/link/services.ts +294 -0
- package/packages/hub/src/link/status.ts +126 -0
- package/packages/hub/src/link/supervisor.ts +547 -0
- package/packages/hub/src/link/systems.ts +101 -0
- package/packages/hub/src/link/tokens.ts +30 -0
- package/packages/hub/src/main.ts +19 -0
- package/packages/hub/src/mcp/calls.ts +153 -0
- package/packages/hub/src/mcp/create.ts +51 -0
- package/packages/hub/src/mcp/endpoints.ts +206 -0
- package/packages/hub/src/mcp/env.ts +19 -0
- package/packages/hub/src/mcp/fns.ts +23 -0
- package/packages/hub/src/mcp/index.ts +76 -0
- package/packages/hub/src/mcp/registry.ts +150 -0
- package/packages/hub/src/mcp/scopes.ts +218 -0
- package/packages/hub/src/mcp/sources.ts +154 -0
- package/packages/hub/src/mcp/tokens.ts +72 -0
- package/packages/hub/src/mcp/tools.ts +173 -0
- package/packages/hub/src/metrics/calls.ts +123 -0
- package/packages/hub/src/metrics/create.ts +15 -0
- package/packages/hub/src/metrics/fn-metrics.ts +97 -0
- package/packages/hub/src/metrics/index.ts +58 -0
- package/packages/hub/src/metrics/rollup.ts +188 -0
- package/packages/hub/src/models/create.ts +65 -0
- package/packages/hub/src/models/decide.ts +134 -0
- package/packages/hub/src/models/gateway.ts +102 -0
- package/packages/hub/src/models/index.ts +82 -0
- package/packages/hub/src/models/pinned.ts +10 -0
- package/packages/hub/src/models/remote.ts +386 -0
- package/packages/hub/src/models/roles.ts +160 -0
- package/packages/hub/src/models/structured.ts +30 -0
- package/packages/hub/src/query/columns.ts +55 -0
- package/packages/hub/src/query/contexts.ts +102 -0
- package/packages/hub/src/query/env.ts +17 -0
- package/packages/hub/src/query/evaluate.ts +181 -0
- package/packages/hub/src/query/index.ts +32 -0
- package/packages/hub/src/query/service.ts +64 -0
- package/packages/hub/src/query/sources.ts +344 -0
- package/packages/hub/src/query/sql-source.ts +93 -0
- package/packages/hub/src/resources/browse.ts +131 -0
- package/packages/hub/src/resources/content.ts +183 -0
- package/packages/hub/src/resources/context.ts +405 -0
- package/packages/hub/src/resources/converters.ts +78 -0
- package/packages/hub/src/resources/create.ts +88 -0
- package/packages/hub/src/resources/env.ts +24 -0
- package/packages/hub/src/resources/fetch.ts +140 -0
- package/packages/hub/src/resources/fns.ts +172 -0
- package/packages/hub/src/resources/forms.ts +285 -0
- package/packages/hub/src/resources/images.ts +182 -0
- package/packages/hub/src/resources/index.ts +186 -0
- package/packages/hub/src/resources/library.ts +228 -0
- package/packages/hub/src/resources/models.ts +116 -0
- package/packages/hub/src/resources/pdf-pages.ts +455 -0
- package/packages/hub/src/resources/raw.ts +108 -0
- package/packages/hub/src/resources/reader.ts +224 -0
- package/packages/hub/src/resources/rules.ts +110 -0
- package/packages/hub/src/resources/sqlite-files.ts +140 -0
- package/packages/hub/src/resources/storage.ts +40 -0
- package/packages/hub/src/resources/testing.ts +292 -0
- package/packages/hub/src/store/always-for.ts +46 -0
- package/packages/hub/src/store/auxTables.ts +97 -0
- package/packages/hub/src/store/codec.ts +109 -0
- package/packages/hub/src/store/db.ts +137 -0
- package/packages/hub/src/store/env.ts +13 -0
- package/packages/hub/src/store/errors.ts +36 -0
- package/packages/hub/src/store/fixtures.ts +53 -0
- package/packages/hub/src/store/fn-renames.ts +72 -0
- package/packages/hub/src/store/hybrid.ts +130 -0
- package/packages/hub/src/store/index.ts +231 -0
- package/packages/hub/src/store/lists.ts +172 -0
- package/packages/hub/src/store/migrate-fn-names.ts +135 -0
- package/packages/hub/src/store/migrate.ts +121 -0
- package/packages/hub/src/store/ports.ts +163 -0
- package/packages/hub/src/store/query.ts +166 -0
- package/packages/hub/src/store/records.ts +119 -0
- package/packages/hub/src/store/rows.ts +105 -0
- package/packages/hub/src/store/schema.ts +184 -0
- package/packages/hub/src/store/sqlite.ts +136 -0
- package/packages/hub/src/store/table.ts +113 -0
- package/packages/hub/src/store/text.ts +92 -0
- package/packages/hub/src/store/vectors.ts +232 -0
- package/packages/hub/src/tables/env.ts +15 -0
- package/packages/hub/src/tables/fns.ts +29 -0
- package/packages/hub/src/tables/index.ts +45 -0
- package/packages/hub/src/tables/migrate.ts +105 -0
- package/packages/hub/src/tables/service.ts +245 -0
- package/packages/hub/src/testing.ts +128 -0
- package/packages/hub/tsconfig.json +6 -0
- package/packages/sdk/AUTHORING.md +25228 -0
- package/packages/sdk/package.json +58 -0
- package/packages/sdk/src/a-gin.ts +132 -0
- package/packages/sdk/src/agent.ts +121 -0
- package/packages/sdk/src/authoring.ts +546 -0
- package/packages/sdk/src/build.ts +97 -0
- package/packages/sdk/src/chat-prompt.ts +202 -0
- package/packages/sdk/src/claims.ts +20 -0
- package/packages/sdk/src/client-runtime.ts +514 -0
- package/packages/sdk/src/client.ts +672 -0
- package/packages/sdk/src/ctx.ts +659 -0
- package/packages/sdk/src/declare.ts +480 -0
- package/packages/sdk/src/fn.ts +514 -0
- package/packages/sdk/src/gin.ts +245 -0
- package/packages/sdk/src/hub.ts +1065 -0
- package/packages/sdk/src/impl.ts +35 -0
- package/packages/sdk/src/index.ts +87 -0
- package/packages/sdk/src/links.ts +35 -0
- package/packages/sdk/src/manifest.ts +372 -0
- package/packages/sdk/src/page-parts.ts +153 -0
- package/packages/sdk/src/program/env.ts +29 -0
- package/packages/sdk/src/program/index.ts +13 -0
- package/packages/sdk/src/program/lookups.ts +82 -0
- package/packages/sdk/src/program/runtime.ts +576 -0
- package/packages/sdk/src/program/tools.ts +268 -0
- package/packages/sdk/src/providers.ts +77 -0
- package/packages/sdk/src/refs.ts +161 -0
- package/packages/sdk/src/relative-dates.ts +197 -0
- package/packages/sdk/src/remote-auth.ts +113 -0
- package/packages/sdk/src/resources.ts +28 -0
- package/packages/sdk/src/results.ts +47 -0
- package/packages/sdk/src/server/address.ts +167 -0
- package/packages/sdk/src/server/asks.ts +111 -0
- package/packages/sdk/src/server/assets.ts +47 -0
- package/packages/sdk/src/server/authored-names.ts +79 -0
- package/packages/sdk/src/server/calls.ts +260 -0
- package/packages/sdk/src/server/content.ts +124 -0
- package/packages/sdk/src/server/context-check.ts +214 -0
- package/packages/sdk/src/server/context-files.ts +244 -0
- package/packages/sdk/src/server/data.ts +90 -0
- package/packages/sdk/src/server/env.ts +144 -0
- package/packages/sdk/src/server/fake-hub-fns.ts +124 -0
- package/packages/sdk/src/server/fake-hub-widgets.ts +67 -0
- package/packages/sdk/src/server/fake-models.ts +89 -0
- package/packages/sdk/src/server/fake-records.ts +217 -0
- package/packages/sdk/src/server/files.ts +118 -0
- package/packages/sdk/src/server/host.ts +742 -0
- package/packages/sdk/src/server/hosted-network-guard.ts +18 -0
- package/packages/sdk/src/server/index.ts +220 -0
- package/packages/sdk/src/server/journal.ts +131 -0
- package/packages/sdk/src/server/js-yaml.d.ts +19 -0
- package/packages/sdk/src/server/keys.ts +148 -0
- package/packages/sdk/src/server/link.ts +93 -0
- package/packages/sdk/src/server/live.ts +22 -0
- package/packages/sdk/src/server/llm-wire.ts +647 -0
- package/packages/sdk/src/server/llm.ts +555 -0
- package/packages/sdk/src/server/log.ts +108 -0
- package/packages/sdk/src/server/manifest-state.ts +113 -0
- package/packages/sdk/src/server/mcp-caller.ts +15 -0
- package/packages/sdk/src/server/mcp-prompts.ts +54 -0
- package/packages/sdk/src/server/mcp-resources.ts +130 -0
- package/packages/sdk/src/server/mcp.ts +194 -0
- package/packages/sdk/src/server/owner-runs.ts +109 -0
- package/packages/sdk/src/server/package.ts +141 -0
- package/packages/sdk/src/server/pairing.ts +97 -0
- package/packages/sdk/src/server/process.ts +53 -0
- package/packages/sdk/src/server/providers.ts +180 -0
- package/packages/sdk/src/server/proxy.ts +196 -0
- package/packages/sdk/src/server/renderers.ts +28 -0
- package/packages/sdk/src/server/resources.ts +89 -0
- package/packages/sdk/src/server/results.ts +121 -0
- package/packages/sdk/src/server/run.ts +492 -0
- package/packages/sdk/src/server/runs.ts +103 -0
- package/packages/sdk/src/server/runtime.ts +597 -0
- package/packages/sdk/src/server/socket-guard.ts +162 -0
- package/packages/sdk/src/server/state.ts +112 -0
- package/packages/sdk/src/server/supervise.ts +257 -0
- package/packages/sdk/src/server/table.ts +490 -0
- package/packages/sdk/src/server/testing.ts +883 -0
- package/packages/sdk/src/server/types.ts +26 -0
- package/packages/sdk/src/server/wire.ts +172 -0
- package/packages/sdk/src/status.ts +50 -0
- package/packages/sdk/src/system.ts +459 -0
- package/packages/sdk/src/testing/context.ts +48 -0
- package/packages/sdk/src/testing/env.ts +28 -0
- package/packages/sdk/src/testing/fixtures/NoteCard.vue +17 -0
- package/packages/sdk/src/testing/fixtures/context/guide.md +12 -0
- package/packages/sdk/src/testing/hub.ts +294 -0
- package/packages/sdk/src/testing/index.ts +30 -0
- package/packages/sdk/src/testing/models.ts +192 -0
- package/packages/sdk/src/testing/openrouter.ts +94 -0
- package/packages/sdk/src/testing/preview.ts +207 -0
- package/packages/sdk/src/testing/scratch.ts +58 -0
- package/packages/sdk/src/testing/shots.ts +17 -0
- package/packages/sdk/src/util.ts +35 -0
- package/packages/sdk/src/widget-check.ts +182 -0
- package/packages/sdk/src/widget-schema.ts +251 -0
- package/packages/sdk/src/widgets.ts +386 -0
- package/packages/sdk/src/zod-gin.ts +213 -0
- package/packages/sdk/tsconfig.json +6 -0
- package/packages/web/dist/assets/ActorSettingsView-BuMYRDqv.js +2 -0
- package/packages/web/dist/assets/ActorSettingsView-GTxPZw8N.css +1 -0
- package/packages/web/dist/assets/AdminLayout-1hbRPV3d.css +1 -0
- package/packages/web/dist/assets/AdminLayout-sLjVTrmV.js +2 -0
- package/packages/web/dist/assets/ApiServiceForm-BrMTU-7u.js +2 -0
- package/packages/web/dist/assets/ApiServiceForm-BxprSaAq.css +1 -0
- package/packages/web/dist/assets/ApiServiceView-BMF2zD6Q.js +2 -0
- package/packages/web/dist/assets/ApiServiceView-BVmdRCjR.css +1 -0
- package/packages/web/dist/assets/ApiServicesView-BTLV6c8n.css +1 -0
- package/packages/web/dist/assets/ApiServicesView-bjLAWO_j.js +2 -0
- package/packages/web/dist/assets/AppPage-BBzZ0Pru.css +1 -0
- package/packages/web/dist/assets/AppPage-DSzDKCFz.js +2 -0
- package/packages/web/dist/assets/AutoPairPicker-ClF4nB0n.css +1 -0
- package/packages/web/dist/assets/AutoPairPicker-nV38ALjl.js +2 -0
- package/packages/web/dist/assets/BrowserFrame-Bic7U7jN.js +2 -0
- package/packages/web/dist/assets/BrowserFrame-BzEdhmsF.css +1 -0
- package/packages/web/dist/assets/ChartVisual-BnFG9aFi.css +1 -0
- package/packages/web/dist/assets/ChartVisual-DWw7WsfN.js +11 -0
- package/packages/web/dist/assets/ChatPage-7Yebk7rl.js +4 -0
- package/packages/web/dist/assets/ChatPage-CbsRmktV.css +1 -0
- package/packages/web/dist/assets/CodeViewer-D6A30AJ9.css +1 -0
- package/packages/web/dist/assets/CodeViewer-xHS3Xah9.js +5 -0
- package/packages/web/dist/assets/ConfigWithCustom-C74DTXuy.css +1 -0
- package/packages/web/dist/assets/ConfigWithCustom-DreTUdf0.js +3 -0
- package/packages/web/dist/assets/ConfirmDialog-DjQUzNqk.js +2 -0
- package/packages/web/dist/assets/ConfirmDialog-oABDbIMz.css +1 -0
- package/packages/web/dist/assets/ConnectPage-CfRDrXvJ.js +2 -0
- package/packages/web/dist/assets/ConnectPage-Zz1nFbcn.css +1 -0
- package/packages/web/dist/assets/ContextItemPage-B6rJG3OT.js +2 -0
- package/packages/web/dist/assets/ContextItemPage-BRsWxOmu.css +1 -0
- package/packages/web/dist/assets/ContextPage-CloIZ_2y.js +2 -0
- package/packages/web/dist/assets/ContextPage-rYKxjiVI.css +1 -0
- package/packages/web/dist/assets/ContextRow-Byz_7HG-.css +1 -0
- package/packages/web/dist/assets/ContextRow-Dvv8CTFk.js +2 -0
- package/packages/web/dist/assets/DataPage-CLgJtQwS.css +1 -0
- package/packages/web/dist/assets/DataPage-wSIoGcb5.js +2 -0
- package/packages/web/dist/assets/DataTypePage-Ba_zBV4b.js +4 -0
- package/packages/web/dist/assets/DataTypePage-Cr238Hx_.css +1 -0
- package/packages/web/dist/assets/DesignPage-BFC4A-wO.css +1 -0
- package/packages/web/dist/assets/DesignPage-DidMUX8m.js +49 -0
- package/packages/web/dist/assets/ExplorePage-DJmOOIhs.css +1 -0
- package/packages/web/dist/assets/ExplorePage-MUyVydVB.js +2 -0
- package/packages/web/dist/assets/FactList-CeAbKajD.js +2 -0
- package/packages/web/dist/assets/FactList-DuDPr7n7.css +1 -0
- package/packages/web/dist/assets/FnList-BCnb4kOB.css +1 -0
- package/packages/web/dist/assets/FnList-CjQRwYaT.js +2 -0
- package/packages/web/dist/assets/FnPill-BNIWrqXN.css +1 -0
- package/packages/web/dist/assets/FnPill-BshAvm2I.js +2 -0
- package/packages/web/dist/assets/FnView-B8MGAOoB.js +2 -0
- package/packages/web/dist/assets/FnView-BBFbPAQz.css +1 -0
- package/packages/web/dist/assets/FnsView-CeqIoaBT.js +2 -0
- package/packages/web/dist/assets/FnsView-D575syq-.css +1 -0
- package/packages/web/dist/assets/GinExprView-DYVUwZrd.js +4 -0
- package/packages/web/dist/assets/GinExprView-dqtf5BKF.css +1 -0
- package/packages/web/dist/assets/GinForm-CVEsGoBo.css +1 -0
- package/packages/web/dist/assets/GinForm-D3mwMRTQ.js +2 -0
- package/packages/web/dist/assets/GinTypeView-B5CGqWvh.css +1 -0
- package/packages/web/dist/assets/GinTypeView-C0YifSmE.js +2 -0
- package/packages/web/dist/assets/GinValueView-HfEPq9le.js +4 -0
- package/packages/web/dist/assets/GinValueView-zhWn-X48.css +1 -0
- package/packages/web/dist/assets/GraphPage-ySnuA4Hp.js +2 -0
- package/packages/web/dist/assets/GraphPanel-B9jxpJfb.css +1 -0
- package/packages/web/dist/assets/GraphPanel-Cy5-KGo1.js +2 -0
- package/packages/web/dist/assets/HubPicker-C_vA752L.js +2 -0
- package/packages/web/dist/assets/InboxApprovals-DcPCCmZ5.js +2 -0
- package/packages/web/dist/assets/InboxApprovals-DmC94LNf.css +1 -0
- package/packages/web/dist/assets/InboxPage-C2DT2nuF.js +2 -0
- package/packages/web/dist/assets/InjectedList-BgxdlaHJ.css +1 -0
- package/packages/web/dist/assets/InjectedList-CJsEFEbz.js +2 -0
- package/packages/web/dist/assets/InstallDialog-C9GDoUI2.js +2 -0
- package/packages/web/dist/assets/InstallDialog-yWLZK_zN.css +1 -0
- package/packages/web/dist/assets/InstanceTypes-D8Jcxn70.js +2 -0
- package/packages/web/dist/assets/InstanceTypes-DAowwLB7.css +1 -0
- package/packages/web/dist/assets/InstanceView-CuBD3JPU.css +1 -0
- package/packages/web/dist/assets/InstanceView-p7tMaylE.js +2 -0
- package/packages/web/dist/assets/ItemHistory-CUGa8b6s.js +2 -0
- package/packages/web/dist/assets/ItemHistory-Czzpyiud.css +1 -0
- package/packages/web/dist/assets/LimitsView-DlPW-cLw.css +1 -0
- package/packages/web/dist/assets/LimitsView-DsZG6u5P.js +2 -0
- package/packages/web/dist/assets/ListSearch-BK4p7Nxa.js +2 -0
- package/packages/web/dist/assets/ListSearch-CdxSo6UW.css +1 -0
- package/packages/web/dist/assets/LlmCallDetails-2yQftCqd.js +2 -0
- package/packages/web/dist/assets/LlmCallDetails-gymdroc_.css +1 -0
- package/packages/web/dist/assets/LlmCallsView-B1yHEIBG.css +1 -0
- package/packages/web/dist/assets/LlmCallsView-DOHX3r0K.js +2 -0
- package/packages/web/dist/assets/LoadState-C4VYnFly.css +1 -0
- package/packages/web/dist/assets/LoadState-DeXfLvYv.js +2 -0
- package/packages/web/dist/assets/McpDialog-BSCt_jWB.css +1 -0
- package/packages/web/dist/assets/McpDialog-CA_0WKWF.js +2 -0
- package/packages/web/dist/assets/McpServerForm-CAG8Wp2N.js +2 -0
- package/packages/web/dist/assets/McpServerForm-DsHaf5Um.css +1 -0
- package/packages/web/dist/assets/McpServerView-7I76EznB.css +1 -0
- package/packages/web/dist/assets/McpServerView-CD8qw6W_.js +2 -0
- package/packages/web/dist/assets/McpServersView-DNycG35u.js +2 -0
- package/packages/web/dist/assets/McpView-CC2oNOMa.js +2 -0
- package/packages/web/dist/assets/McpView-W5PhGI4_.css +1 -0
- package/packages/web/dist/assets/McpsView-CwJvyyxV.js +2 -0
- package/packages/web/dist/assets/McpsView-yH-K4ifd.css +1 -0
- package/packages/web/dist/assets/MemoryDialog-CpfIsygL.css +1 -0
- package/packages/web/dist/assets/MemoryDialog-Dbvh5uLq.js +2 -0
- package/packages/web/dist/assets/ModelCallsView-B__CIDge.css +1 -0
- package/packages/web/dist/assets/ModelCallsView-RvnW3EBP.js +2 -0
- package/packages/web/dist/assets/ModelPicker-5BC8W10p.css +1 -0
- package/packages/web/dist/assets/ModelPicker-DcjwQFHC.js +2 -0
- package/packages/web/dist/assets/ModelsView-C_iN19xt.js +2 -0
- package/packages/web/dist/assets/ModelsView-DjD8H9vc.css +1 -0
- package/packages/web/dist/assets/NotFoundPage-CeSwzTV-.js +2 -0
- package/packages/web/dist/assets/NotFoundPage-ZUNomG9O.css +1 -0
- package/packages/web/dist/assets/PairPage-Bs2KuRjC.css +1 -0
- package/packages/web/dist/assets/PairPage-TEXPpsqi.js +2 -0
- package/packages/web/dist/assets/PanelHost-BkrFAnPa.js +2 -0
- package/packages/web/dist/assets/PanelHost-_z5RyAnS.css +1 -0
- package/packages/web/dist/assets/PeopleView-CJ8yArTh.css +1 -0
- package/packages/web/dist/assets/PeopleView-D1QGPYp7.js +2 -0
- package/packages/web/dist/assets/PoliciesView-BU1fudNF.js +2 -0
- package/packages/web/dist/assets/PoliciesView-yVE8d8mj.css +1 -0
- package/packages/web/dist/assets/RefusalList-B3OBAsYc.css +1 -0
- package/packages/web/dist/assets/RefusalList-DQoyUoPG.js +2 -0
- package/packages/web/dist/assets/RemoteAuthFields-Dm44vz2t.css +1 -0
- package/packages/web/dist/assets/RemoteAuthFields-nxGWfmhf.js +2 -0
- package/packages/web/dist/assets/ResourceViewer-A9ZSaLUH.css +1 -0
- package/packages/web/dist/assets/ResourceViewer-Po24y4pj.js +2 -0
- package/packages/web/dist/assets/ResourcesPage-YluNBqIv.js +2 -0
- package/packages/web/dist/assets/ResourcesPage-mr0U0l6U.css +1 -0
- package/packages/web/dist/assets/ResultGrid-CuUQyTjW.css +1 -0
- package/packages/web/dist/assets/ResultGrid-uoq4yUYj.js +2 -0
- package/packages/web/dist/assets/ReviewSummaryStrip-B3ZQs5wR.css +1 -0
- package/packages/web/dist/assets/ReviewSummaryStrip-k3HevESg.js +2 -0
- package/packages/web/dist/assets/ReviewView-79Z5rU1v.js +3 -0
- package/packages/web/dist/assets/ReviewView-CxbVjz_R.css +1 -0
- package/packages/web/dist/assets/RuleRow-CG_XCvUu.css +1 -0
- package/packages/web/dist/assets/RuleRow-CoXDA-SH.js +2 -0
- package/packages/web/dist/assets/RunCard-CBSGdwdQ.js +2 -0
- package/packages/web/dist/assets/RunCard-CfyRaDLS.css +1 -0
- package/packages/web/dist/assets/RunDetails-CGhQQ6OI.js +2 -0
- package/packages/web/dist/assets/RunDetails-CHHCWGrP.css +1 -0
- package/packages/web/dist/assets/RunDot-Ch_45985.js +2 -0
- package/packages/web/dist/assets/RunDot-CkNUsFwg.css +1 -0
- package/packages/web/dist/assets/RunPage-C_t20pB7.js +2 -0
- package/packages/web/dist/assets/RunPage-Cq6UV6h-.css +1 -0
- package/packages/web/dist/assets/RunProgress-Bq2yc7Il.css +1 -0
- package/packages/web/dist/assets/RunProgress-VrZUHUEC.js +2 -0
- package/packages/web/dist/assets/RunsView-Dz9Xsvu5.js +2 -0
- package/packages/web/dist/assets/RunsView-fBMrETRF.css +1 -0
- package/packages/web/dist/assets/ServiceRows-6BU4-MeL.css +1 -0
- package/packages/web/dist/assets/ServiceRows-DNzDiutg.js +2 -0
- package/packages/web/dist/assets/SettingsPage-CykfuYj1.js +3 -0
- package/packages/web/dist/assets/SettingsPage-t03BqXw8.css +1 -0
- package/packages/web/dist/assets/SignInPage-Djx-M-0U.css +1 -0
- package/packages/web/dist/assets/SignInPage-DrXZ1sG2.js +2 -0
- package/packages/web/dist/assets/StatusBadge-Dpb9uG5e.js +2 -0
- package/packages/web/dist/assets/SystemConfig-72qKRkUk.js +2 -0
- package/packages/web/dist/assets/SystemConfig-CDtMyVWy.css +1 -0
- package/packages/web/dist/assets/SystemPageHost-BeZ-6N0-.css +1 -0
- package/packages/web/dist/assets/SystemPageHost-DLNg2FYK.js +2 -0
- package/packages/web/dist/assets/SystemView-C8ScHUe2.css +1 -0
- package/packages/web/dist/assets/SystemView-Es5wtkYU.js +2 -0
- package/packages/web/dist/assets/SystemsView-B6HEL9VS.css +1 -0
- package/packages/web/dist/assets/SystemsView-CeuSFhlF.js +2 -0
- package/packages/web/dist/assets/TableViewer-1Jf5BNat.css +1 -0
- package/packages/web/dist/assets/TableViewer-BQ7bYLOP.js +6 -0
- package/packages/web/dist/assets/ThemePicker-C2nJ21Vd.js +2 -0
- package/packages/web/dist/assets/TurnTree-CORdfTHj.js +2 -0
- package/packages/web/dist/assets/TurnTree-CPivE4sF.css +1 -0
- package/packages/web/dist/assets/UserMessage-BtECa8ka.css +1 -0
- package/packages/web/dist/assets/UserMessage-qyc8dG5D.js +9 -0
- package/packages/web/dist/assets/ValueVisual-D5Rw7PlS.css +1 -0
- package/packages/web/dist/assets/ValueVisual-aXEUaQ5Y.js +2 -0
- package/packages/web/dist/assets/WidgetView-BZyDyYRI.js +3 -0
- package/packages/web/dist/assets/WidgetView-DQUDeFkB.css +1 -0
- package/packages/web/dist/assets/_plugin-vue_export-helper-BDNMzG2s.js +1 -0
- package/packages/web/dist/assets/abap-CLvhMVsD.js +2 -0
- package/packages/web/dist/assets/abnfDiagram-S7VZAUFO-CzFPJy4G.js +2 -0
- package/packages/web/dist/assets/actionscript-3-Cs6JJXT5.js +2 -0
- package/packages/web/dist/assets/ada-X3Y2mlq2.js +2 -0
- package/packages/web/dist/assets/ahk-DwADkxyd.js +2 -0
- package/packages/web/dist/assets/ahk2-_6rzW9BS.js +2 -0
- package/packages/web/dist/assets/angular-html-wiqevbIE.js +2 -0
- package/packages/web/dist/assets/angular-ts-C32iChAu.js +2 -0
- package/packages/web/dist/assets/apache-U0d_L8uA.js +2 -0
- package/packages/web/dist/assets/apex-KFGFyKwG.js +2 -0
- package/packages/web/dist/assets/apl-Bl61Unn0.js +2 -0
- package/packages/web/dist/assets/applescript-CCn79oCD.js +2 -0
- package/packages/web/dist/assets/ara-4CJ0cIlV.js +2 -0
- package/packages/web/dist/assets/architecture-WOLXFQ4H-_l4nRfFJ.js +1 -0
- package/packages/web/dist/assets/architectureDiagram-YGSQEFNW-CMpVysh5.js +37 -0
- package/packages/web/dist/assets/asciidoc-SCjQUq34.js +2 -0
- package/packages/web/dist/assets/asm-Cmm7eHzH.js +2 -0
- package/packages/web/dist/assets/astro-CojMNcHO.js +2 -0
- package/packages/web/dist/assets/awk-BWXHIvNe.js +2 -0
- package/packages/web/dist/assets/ballerina-B7ZEbQpA.js +2 -0
- package/packages/web/dist/assets/bat-qdxAdBWQ.js +2 -0
- package/packages/web/dist/assets/beancount-C2IN4Vk8.js +2 -0
- package/packages/web/dist/assets/berry-DKpUyyne.js +2 -0
- package/packages/web/dist/assets/bibtex-Ci_nEsc7.js +2 -0
- package/packages/web/dist/assets/bicep-CUHmPFLl.js +2 -0
- package/packages/web/dist/assets/bird2-CYIUgYqB.js +2 -0
- package/packages/web/dist/assets/blade-CRk3fo4p.js +2 -0
- package/packages/web/dist/assets/blockDiagram-APKKGZFW-Jua4t10S.js +141 -0
- package/packages/web/dist/assets/bpmnIcons-APHXDYXF-C0jbCElo.js +2 -0
- package/packages/web/dist/assets/browser-BHOqNy7R.js +9 -0
- package/packages/web/dist/assets/browsers-BSc3bW3l.js +2 -0
- package/packages/web/dist/assets/bsl-_VjlB9mv.js +2 -0
- package/packages/web/dist/assets/c-CiNtTPN_.js +2 -0
- package/packages/web/dist/assets/c3-D0apG41V.js +2 -0
- package/packages/web/dist/assets/c4Diagram-KJ2TOQU5-08x9w6G9.js +39 -0
- package/packages/web/dist/assets/cadence-CQ2zXKGN.js +2 -0
- package/packages/web/dist/assets/cairo-DLTphjLi.js +2 -0
- package/packages/web/dist/assets/chapel-D5ik6Ccv.js +2 -0
- package/packages/web/dist/assets/chunk-2Q5K7J3B-C1jixKkw.js +2 -0
- package/packages/web/dist/assets/chunk-5VM5RSS4-ZNzvKenW.js +16 -0
- package/packages/web/dist/assets/chunk-6MUBBAK2-BHXbrulB.js +3 -0
- package/packages/web/dist/assets/chunk-AXFCVDMN-CI0arS1F.js +63 -0
- package/packages/web/dist/assets/chunk-BG4553SI-DGn4S0JL.js +130 -0
- package/packages/web/dist/assets/chunk-DQASFODM-ClbbgMVy.js +11 -0
- package/packages/web/dist/assets/chunk-DUW6YSOI-Dgx8z5s3.js +2 -0
- package/packages/web/dist/assets/chunk-HFQBQIA3-BNltuj9p.js +2 -0
- package/packages/web/dist/assets/chunk-J5ZVWO5B-oDCd-gWO.js +2 -0
- package/packages/web/dist/assets/chunk-JWPE2WC7-DVXcaiue.js +2 -0
- package/packages/web/dist/assets/chunk-KQLB2F66-DsHe5EtY.js +3 -0
- package/packages/web/dist/assets/chunk-KS47KZWR-BZg3mYeD.js +2 -0
- package/packages/web/dist/assets/chunk-LEVMRMFU-paszafIt.js +2 -0
- package/packages/web/dist/assets/chunk-M57EVK23-qYz6TUV4.js +2 -0
- package/packages/web/dist/assets/chunk-NGNAAXSQ-DI_UYJZ4.js +137 -0
- package/packages/web/dist/assets/chunk-OY52VR5R-Ct_YDCfL.js +89 -0
- package/packages/web/dist/assets/chunk-QB3YPZ4I-i7-AWGNa.js +214 -0
- package/packages/web/dist/assets/chunk-R3KSYZAL-DW0WB_9q.js +2 -0
- package/packages/web/dist/assets/chunk-STOXU5M4-D5Gd-wq9.js +73 -0
- package/packages/web/dist/assets/chunk-TU62E6Q5-WtwDME_1.js +2 -0
- package/packages/web/dist/assets/chunk-X4PVCEUW-YYhMSieL.js +2 -0
- package/packages/web/dist/assets/chunk-XXDRQBXY-i7MKP1NY.js +2 -0
- package/packages/web/dist/assets/chunk-Y2CYZVJY-DsF7k-Jl.js +2 -0
- package/packages/web/dist/assets/clarity-CtfBBspg.js +2 -0
- package/packages/web/dist/assets/classDiagram-v2-L25IHNXF-d25-M1pJ.js +218 -0
- package/packages/web/dist/assets/clojure-DqKBuwfJ.js +2 -0
- package/packages/web/dist/assets/cmake-Bj61d0ZC.js +2 -0
- package/packages/web/dist/assets/cobol-BRB8FTbz.js +2 -0
- package/packages/web/dist/assets/codeowners-C8r90Shi.js +2 -0
- package/packages/web/dist/assets/codeql-oeQT6MSM.js +2 -0
- package/packages/web/dist/assets/coffee-B1WQFatZ.js +2 -0
- package/packages/web/dist/assets/common-lisp-Cv5bFMCO.js +2 -0
- package/packages/web/dist/assets/coq-CGaSfhwR.js +2 -0
- package/packages/web/dist/assets/core-DdF778CY.js +13 -0
- package/packages/web/dist/assets/cose-bilkent-JH36ORCC-CYLhHv3W.js +2 -0
- package/packages/web/dist/assets/cpp-CxyntmKf.js +2 -0
- package/packages/web/dist/assets/crystal-CayBj_Aw.js +2 -0
- package/packages/web/dist/assets/csharp-dmMxLVLW.js +2 -0
- package/packages/web/dist/assets/css-CB_fh0k2.js +2 -0
- package/packages/web/dist/assets/csv-Dx-8-gkx.js +2 -0
- package/packages/web/dist/assets/cue-CE9AQfxI.js +2 -0
- package/packages/web/dist/assets/cynefin-EF2NZ3EQ-BOE_VX_3.js +1 -0
- package/packages/web/dist/assets/cynefinDiagram-L36ESFBY-cDLwrPve.js +63 -0
- package/packages/web/dist/assets/cypher-ClKdZ_lG.js +2 -0
- package/packages/web/dist/assets/cytoscape.esm-DpfQbjy7.js +322 -0
- package/packages/web/dist/assets/d-qD-0Kul2.js +2 -0
- package/packages/web/dist/assets/d3-scale-CElPUUud.js +2 -0
- package/packages/web/dist/assets/d3-selection-COWvaQNI.js +2 -0
- package/packages/web/dist/assets/dagre-SPEB5RXH-ChUYszsQ.js +5 -0
- package/packages/web/dist/assets/dart-CHZY9Xhz.js +2 -0
- package/packages/web/dist/assets/dax-BkyTk9wS.js +2 -0
- package/packages/web/dist/assets/desktop-Dlh5hvp9.js +2 -0
- package/packages/web/dist/assets/diagram-3B7GL73J-C4RMi43c.js +201 -0
- package/packages/web/dist/assets/diagram-DNEMPZML-COQGGiEP.js +25 -0
- package/packages/web/dist/assets/diagram-L3MUGCDN-mowv9Itp.js +42 -0
- package/packages/web/dist/assets/diagram-LA4NIPWU-hNJQSGhv.js +25 -0
- package/packages/web/dist/assets/diagram-MHCOC4E2-Dp-COOAx.js +4 -0
- package/packages/web/dist/assets/diagram-XPFHEONP-D2wzCykS.js +31 -0
- package/packages/web/dist/assets/diff-woXpYk--.js +2 -0
- package/packages/web/dist/assets/dist-DdXDFcej.js +2 -0
- package/packages/web/dist/assets/docker-IyjqRm3v.js +2 -0
- package/packages/web/dist/assets/dotenv-CuH5my32.js +2 -0
- package/packages/web/dist/assets/dream-maker-DW3nJb8Q.js +2 -0
- package/packages/web/dist/assets/ebnfDiagram-UZSYDL2S-5WCudwet.js +2 -0
- package/packages/web/dist/assets/edge-6p6a27tD.js +2 -0
- package/packages/web/dist/assets/elixir-fXwtrlGU.js +2 -0
- package/packages/web/dist/assets/elk-XV6XMXQE-BknTcAbm.js +28 -0
- package/packages/web/dist/assets/elm-rUi9A3mh.js +2 -0
- package/packages/web/dist/assets/emacs-lisp-DR2vtWaj.js +2 -0
- package/packages/web/dist/assets/engine-javascript-C30F4iNc.js +142 -0
- package/packages/web/dist/assets/erDiagram-EYBAPDEH-UOE6iZ1t.js +100 -0
- package/packages/web/dist/assets/erb-BvmuIdN-.js +2 -0
- package/packages/web/dist/assets/erlang-Cphh6RMH.js +2 -0
- package/packages/web/dist/assets/eventmodeling-K75KTNOO-CIs2h_8S.js +1 -0
- package/packages/web/dist/assets/export-BwFkEtcm.js +15 -0
- package/packages/web/dist/assets/fennel-DQxkIbk2.js +2 -0
- package/packages/web/dist/assets/fish-BJitypiv.js +2 -0
- package/packages/web/dist/assets/flowDiagram-MALGAFMO-CQLEuZ0I.js +1 -0
- package/packages/web/dist/assets/fluent-C03EYrpw.js +2 -0
- package/packages/web/dist/assets/fn-modal-DqcxUhOQ.js +2 -0
- package/packages/web/dist/assets/fn-notices-BYaH6IoA.js +2 -0
- package/packages/web/dist/assets/fn-notices-Da4tVHqJ.css +1 -0
- package/packages/web/dist/assets/formats-DI__ADVG.js +2 -0
- package/packages/web/dist/assets/fortran-fixed-form-DEKoE2YW.js +2 -0
- package/packages/web/dist/assets/fortran-free-form-CYNrtFtB.js +2 -0
- package/packages/web/dist/assets/fsharp-D13ZGOAj.js +2 -0
- package/packages/web/dist/assets/ganttDiagram-23REXITY-KBK93CXW.js +293 -0
- package/packages/web/dist/assets/gdresource-xMC7jr7x.js +2 -0
- package/packages/web/dist/assets/gdscript-DYvRD3hg.js +2 -0
- package/packages/web/dist/assets/gdshader-CBce3t8t.js +2 -0
- package/packages/web/dist/assets/genie-CV2tkWYe.js +2 -0
- package/packages/web/dist/assets/gherkin-DExj1W_8.js +2 -0
- package/packages/web/dist/assets/git-commit-BSykSTBG.js +2 -0
- package/packages/web/dist/assets/git-rebase-B09wAERM.js +2 -0
- package/packages/web/dist/assets/gitGraph-VSP46ZUC-Dwmw1QLM.js +1 -0
- package/packages/web/dist/assets/gitGraphDiagram-STJD7YCW-B2T13-ZJ.js +107 -0
- package/packages/web/dist/assets/gleam-CSRkHgEL.js +2 -0
- package/packages/web/dist/assets/glimmer-js-CpWvy9gf.js +2 -0
- package/packages/web/dist/assets/glimmer-ts-BAH8Czr9.js +2 -0
- package/packages/web/dist/assets/glsl-CVY0WJyt.js +2 -0
- package/packages/web/dist/assets/gn-CAXYAgV-.js +2 -0
- package/packages/web/dist/assets/gnuplot-7GGW24-e.js +2 -0
- package/packages/web/dist/assets/go-rLFTqkRN.js +2 -0
- package/packages/web/dist/assets/graphlib-DS17s2tU.js +2 -0
- package/packages/web/dist/assets/graphql-CDPCtuoQ.js +2 -0
- package/packages/web/dist/assets/groovy-CacY0gHj.js +2 -0
- package/packages/web/dist/assets/hack-CLEpeEqq.js +2 -0
- package/packages/web/dist/assets/haml-Bvpgs3uG.js +2 -0
- package/packages/web/dist/assets/handlebars-vXY9zmj1.js +2 -0
- package/packages/web/dist/assets/haskell-D8IpX4py.js +2 -0
- package/packages/web/dist/assets/haxe-C8oCnwJJ.js +2 -0
- package/packages/web/dist/assets/hcl-Dh228itO.js +2 -0
- package/packages/web/dist/assets/hjson-CxZEssPk.js +2 -0
- package/packages/web/dist/assets/hlsl-Cvrh5tZx.js +2 -0
- package/packages/web/dist/assets/html-CKMeXkCW.js +2 -0
- package/packages/web/dist/assets/html-derivative-C8trdkzI.js +2 -0
- package/packages/web/dist/assets/http-UJwVfHv3.js +2 -0
- package/packages/web/dist/assets/hurl-7erhC4fM.js +2 -0
- package/packages/web/dist/assets/hxml-Dcm88srW.js +2 -0
- package/packages/web/dist/assets/hy-CZbG8q4J.js +2 -0
- package/packages/web/dist/assets/imba-DsUTQ-LC.js +2 -0
- package/packages/web/dist/assets/index-Bv42jNvr.js +4 -0
- package/packages/web/dist/assets/index-CSisx5mi.css +1 -0
- package/packages/web/dist/assets/info-OHQRW6UA-Ob4q-Ec6.js +1 -0
- package/packages/web/dist/assets/infoDiagram-KBXO4MBG-CGQ6MwL3.js +3 -0
- package/packages/web/dist/assets/ini-B5eOa1yu.js +2 -0
- package/packages/web/dist/assets/ishikawaDiagram-M35NCXHK-CuoxiCk-.js +71 -0
- package/packages/web/dist/assets/java-DGv6_9mf.js +2 -0
- package/packages/web/dist/assets/javascript-wyDA4Fnk.js +2 -0
- package/packages/web/dist/assets/jinja-CRKn4_DT.js +2 -0
- package/packages/web/dist/assets/jison-C5fjf-e-.js +2 -0
- package/packages/web/dist/assets/journeyDiagram-OPLOXDXO-zEDEMkq6.js +140 -0
- package/packages/web/dist/assets/json-B_qwZ7m_.js +2 -0
- package/packages/web/dist/assets/json5-BR5RXkoi.js +2 -0
- package/packages/web/dist/assets/jsonc-CYpm1nAK.js +2 -0
- package/packages/web/dist/assets/jsonl-CmCQp5Yx.js +2 -0
- package/packages/web/dist/assets/jsonnet-CJTPZ8u_.js +2 -0
- package/packages/web/dist/assets/jssm-DXw9l8Rf.js +2 -0
- package/packages/web/dist/assets/jsx-Ba8EQqYd.js +2 -0
- package/packages/web/dist/assets/julia-mJS6zhvp.js +2 -0
- package/packages/web/dist/assets/just-n_L73pBN.js +2 -0
- package/packages/web/dist/assets/kanban-definition-BZKZHSQY-q5yqVxKo.js +90 -0
- package/packages/web/dist/assets/katex-MEuSR36T.js +258 -0
- package/packages/web/dist/assets/kdl-CsD5j6eV.js +2 -0
- package/packages/web/dist/assets/kotlin-DhhofPvG.js +2 -0
- package/packages/web/dist/assets/kusto-C7mF5XQf.js +2 -0
- package/packages/web/dist/assets/labels-BhJpmLWA.js +2 -0
- package/packages/web/dist/assets/langs-CVIiVMBh.js +3 -0
- package/packages/web/dist/assets/latex-0iQGLWul.js +2 -0
- package/packages/web/dist/assets/layout-DQKldU13.js +2 -0
- package/packages/web/dist/assets/lean-CewbzKMR.js +2 -0
- package/packages/web/dist/assets/less-DVTAwKKz.js +2 -0
- package/packages/web/dist/assets/liquid-B8kEVR50.js +2 -0
- package/packages/web/dist/assets/live-kTMxmy8I.js +2 -0
- package/packages/web/dist/assets/llvm-DqHOMS-s.js +2 -0
- package/packages/web/dist/assets/log-BNLmms1o.js +2 -0
- package/packages/web/dist/assets/logo-Cluzi2Zq.js +2 -0
- package/packages/web/dist/assets/lua-BDnDZ8k4.js +2 -0
- package/packages/web/dist/assets/luau-VGWVLoqX.js +2 -0
- package/packages/web/dist/assets/made-DYU0Ohi4.js +2 -0
- package/packages/web/dist/assets/make-Dixweg8N.js +2 -0
- package/packages/web/dist/assets/markdown-BYOwaDjH.js +2 -0
- package/packages/web/dist/assets/marko-Bk0_iGvT.js +2 -0
- package/packages/web/dist/assets/matlab-D7qyCx1q.js +2 -0
- package/packages/web/dist/assets/mdc-DhizV3YK.js +2 -0
- package/packages/web/dist/assets/mdx-DQZ5AkYe.js +2 -0
- package/packages/web/dist/assets/mermaid-BxpfTIzt.js +2 -0
- package/packages/web/dist/assets/mermaid-parser.core-BGN5zmcs.js +8 -0
- package/packages/web/dist/assets/mermaid.core-BNF3dRf5.js +45 -0
- package/packages/web/dist/assets/metrics-Cio5ykX6.js +2 -0
- package/packages/web/dist/assets/mindmap-definition-I2QAS2VK-CoiSJ4W4.js +99 -0
- package/packages/web/dist/assets/mipsasm-BMqwQI7S.js +2 -0
- package/packages/web/dist/assets/mojo-fg40_ntQ.js +2 -0
- package/packages/web/dist/assets/moonbit-D9W784E_.js +2 -0
- package/packages/web/dist/assets/move-BYnGhZoM.js +2 -0
- package/packages/web/dist/assets/narrat-_X_XdTYD.js +2 -0
- package/packages/web/dist/assets/nextflow-CSgcYZcx.js +2 -0
- package/packages/web/dist/assets/nextflow-groovy-D7IRt6Pp.js +2 -0
- package/packages/web/dist/assets/nginx-DoalMtUh.js +2 -0
- package/packages/web/dist/assets/nim-DdsQnl3h.js +2 -0
- package/packages/web/dist/assets/nix-IvuFDN5E.js +2 -0
- package/packages/web/dist/assets/now-40JhSjx0.js +2 -0
- package/packages/web/dist/assets/nsis-CjNLYCLg.js +2 -0
- package/packages/web/dist/assets/nushell--0fT3PI1.js +2 -0
- package/packages/web/dist/assets/objective-c-D1A_Heim.js +2 -0
- package/packages/web/dist/assets/objective-cpp-BsSzOQcm.js +2 -0
- package/packages/web/dist/assets/ocaml-O90oeIOV.js +2 -0
- package/packages/web/dist/assets/odin-B1RWQWA5.js +2 -0
- package/packages/web/dist/assets/openscad-BUDT5pXO.js +2 -0
- package/packages/web/dist/assets/org-B2d-Pz26.js +2 -0
- package/packages/web/dist/assets/packet-JDAUHWVQ-kID5-AEG.js +1 -0
- package/packages/web/dist/assets/pascal-4ZHwLPI5.js +2 -0
- package/packages/web/dist/assets/pdf-YwugTw7Y.js +55 -0
- package/packages/web/dist/assets/pdf.worker.min-CIqJB0yW.mjs +28 -0
- package/packages/web/dist/assets/pdf.worker.min-UqOn5EDC.js +2 -0
- package/packages/web/dist/assets/pegDiagram-FD4XPPHP-DvO7r8qd.js +2 -0
- package/packages/web/dist/assets/perl-CpJxFnsT.js +2 -0
- package/packages/web/dist/assets/php-CG5ES-ob.js +2 -0
- package/packages/web/dist/assets/pie-XZMESJXO-By0gro0O.js +1 -0
- package/packages/web/dist/assets/pieDiagram-J4AKIIQI-f_Jeo_8D.js +40 -0
- package/packages/web/dist/assets/pkl-ot-7Btpt.js +2 -0
- package/packages/web/dist/assets/plsql-DGHpHOYJ.js +2 -0
- package/packages/web/dist/assets/po-BiJDBrnU.js +2 -0
- package/packages/web/dist/assets/polar-C7UOKdEL.js +2 -0
- package/packages/web/dist/assets/postcss-BXeXVLqQ.js +2 -0
- package/packages/web/dist/assets/powerquery-DNMTfnFr.js +2 -0
- package/packages/web/dist/assets/powershell-QtSnmXcu.js +2 -0
- package/packages/web/dist/assets/preload-helper-7y9sWmk5.js +1 -0
- package/packages/web/dist/assets/prisma-DMgNhnYS.js +2 -0
- package/packages/web/dist/assets/problems-BZY0Dwif.js +2 -0
- package/packages/web/dist/assets/prolog-iXnhIJG7.js +2 -0
- package/packages/web/dist/assets/proto-DB4EqR-F.js +2 -0
- package/packages/web/dist/assets/pug-b31sGWmp.js +2 -0
- package/packages/web/dist/assets/puppet-CDv2pdJW.js +2 -0
- package/packages/web/dist/assets/purescript-9MfHhQsQ.js +2 -0
- package/packages/web/dist/assets/push-payload-D5efGCzd.js +402 -0
- package/packages/web/dist/assets/python-gzcpVVnB.js +2 -0
- package/packages/web/dist/assets/qml-Dd7VLkrA.js +2 -0
- package/packages/web/dist/assets/qmldir-DCQb3MpD.js +2 -0
- package/packages/web/dist/assets/qss-Fe1Jh2GI.js +2 -0
- package/packages/web/dist/assets/quadrantDiagram-XTYBLID2-Cr6SWkGn.js +8 -0
- package/packages/web/dist/assets/r-yyMNTq5r.js +2 -0
- package/packages/web/dist/assets/racket-DcIDlBhZ.js +2 -0
- package/packages/web/dist/assets/radar-ABXABTNO-yHosJs_M.js +1 -0
- package/packages/web/dist/assets/railroad-I3PHUGI6-C-LR5A-v.js +1 -0
- package/packages/web/dist/assets/railroad-abnf-LNEFI6M7-DjGnF9uf.js +1 -0
- package/packages/web/dist/assets/railroad-ebnf-DWYD2UWJ-BgsDVMJk.js +1 -0
- package/packages/web/dist/assets/railroad-peg-JR7BVNR7-DkSNpypW.js +1 -0
- package/packages/web/dist/assets/railroadDiagram-MRQ6NCDL-BdGdKtFJ.js +2 -0
- package/packages/web/dist/assets/raku-B3gFvitq.js +2 -0
- package/packages/web/dist/assets/razor-B0rzWF9b.js +2 -0
- package/packages/web/dist/assets/rbs-C0MpOrj4.js +2 -0
- package/packages/web/dist/assets/record-edits-CveFEsal.js +2 -0
- package/packages/web/dist/assets/reg-CRGYupPL.js +2 -0
- package/packages/web/dist/assets/regexp-DYMieNym.js +2 -0
- package/packages/web/dist/assets/rel-BtDbiS_P.js +2 -0
- package/packages/web/dist/assets/remote-config-BkaarDf3.js +2 -0
- package/packages/web/dist/assets/requirementDiagram-Y7LWUY3S-ImkACz5a.js +85 -0
- package/packages/web/dist/assets/review-CGUGvRV9.js +4 -0
- package/packages/web/dist/assets/riscv-Ckw8ddFX.js +2 -0
- package/packages/web/dist/assets/rolldown-runtime-COiEfhsA.js +1 -0
- package/packages/web/dist/assets/ron-VUp2lXgN.js +2 -0
- package/packages/web/dist/assets/rosmsg-CAekHB0j.js +2 -0
- package/packages/web/dist/assets/rough.esm-Dy-Kn_BL.js +2 -0
- package/packages/web/dist/assets/routes-qP_j74V5.js +4 -0
- package/packages/web/dist/assets/rst-BtnuOAUZ.js +2 -0
- package/packages/web/dist/assets/ruby-Dx9fBFuB.js +2 -0
- package/packages/web/dist/assets/runs-k76usGfd.js +2 -0
- package/packages/web/dist/assets/runtime-core.esm-bundler-wlpNGAAZ.js +4 -0
- package/packages/web/dist/assets/rust-DpiIf5JO.js +2 -0
- package/packages/web/dist/assets/sankeyDiagram-WGJFYUXA-Crpx7BLQ.js +41 -0
- package/packages/web/dist/assets/sas-CYVU3X7O.js +2 -0
- package/packages/web/dist/assets/sass-DXrisJhu.js +2 -0
- package/packages/web/dist/assets/scala-BiFt_7mu.js +2 -0
- package/packages/web/dist/assets/scheme-DQCgrYNe.js +2 -0
- package/packages/web/dist/assets/scss-BAOTDanj.js +2 -0
- package/packages/web/dist/assets/sdbl-bTVj8UrX.js +2 -0
- package/packages/web/dist/assets/sequenceDiagram-5NDRBG5M-Ch5L-aWg.js +170 -0
- package/packages/web/dist/assets/shaderlab-TOUzSsQk.js +2 -0
- package/packages/web/dist/assets/shared-DTpYDMc_.js +2 -0
- package/packages/web/dist/assets/shellscript-DUxm18QR.js +2 -0
- package/packages/web/dist/assets/shellsession-DphNsVk1.js +2 -0
- package/packages/web/dist/assets/size-BwnshyOe.js +2 -0
- package/packages/web/dist/assets/sizeCapture-INFHLROL-3uHXrFqA.js +2 -0
- package/packages/web/dist/assets/smalltalk-BHpQb5nM.js +2 -0
- package/packages/web/dist/assets/smithy-Dgaz7aur.js +2 -0
- package/packages/web/dist/assets/solidity-Bj7E1mRn.js +2 -0
- package/packages/web/dist/assets/sources-Bm-TrxhL.js +2 -0
- package/packages/web/dist/assets/soy-BprueKgI.js +2 -0
- package/packages/web/dist/assets/sparql-D_iOobhT.js +2 -0
- package/packages/web/dist/assets/splunk-BC2Px7Mm.js +2 -0
- package/packages/web/dist/assets/sql-D4n2TlMc.js +2 -0
- package/packages/web/dist/assets/src-DLK1P7oz.js +43 -0
- package/packages/web/dist/assets/ssh-config-BgfXC-Er.js +2 -0
- package/packages/web/dist/assets/stata-D3X-un4D.js +2 -0
- package/packages/web/dist/assets/state-CjE-qA2w.js +2 -0
- package/packages/web/dist/assets/state-J8VdpZXA.css +1 -0
- package/packages/web/dist/assets/stateDiagram-v2-FJ4FJNEA-8fpbogV7.js +292 -0
- package/packages/web/dist/assets/stores-BMEvTe-I.js +2 -0
- package/packages/web/dist/assets/stylus-B6D30XZt.js +2 -0
- package/packages/web/dist/assets/surrealql-5--I0FKd.js +2 -0
- package/packages/web/dist/assets/svelte-DlUga76i.js +2 -0
- package/packages/web/dist/assets/swift-CyEgAFGc.js +2 -0
- package/packages/web/dist/assets/swimlanes-UMQ2AFYF-2-xKzyRO.js +2 -0
- package/packages/web/dist/assets/swimlanesDiagram-OMPLPG4O-DHJrYwQz.js +9 -0
- package/packages/web/dist/assets/system-verilog-Dh5ihWbf.js +2 -0
- package/packages/web/dist/assets/systemd-BxMlprV5.js +2 -0
- package/packages/web/dist/assets/systems-DIp94AET.js +2 -0
- package/packages/web/dist/assets/table-LcEs15kL.js +4 -0
- package/packages/web/dist/assets/talonscript-CohzipZa.js +2 -0
- package/packages/web/dist/assets/tasl-DMoTqEGO.js +2 -0
- package/packages/web/dist/assets/tcl-CZd0xW_V.js +2 -0
- package/packages/web/dist/assets/templ-SgILQMBm.js +2 -0
- package/packages/web/dist/assets/terraform-DswuEJGm.js +2 -0
- package/packages/web/dist/assets/tex-B_j0g-0C.js +2 -0
- package/packages/web/dist/assets/timeline-definition-SEUHKTQE-Czq0i_qO.js +121 -0
- package/packages/web/dist/assets/toml-CcmNWLt0.js +2 -0
- package/packages/web/dist/assets/treeView-D4JQ5SDB-B3NKij_H.js +1 -0
- package/packages/web/dist/assets/treemap-SAJKECNS-Dt7uNpkP.js +1 -0
- package/packages/web/dist/assets/ts-tags-Bb2M6NRT.js +2 -0
- package/packages/web/dist/assets/tsv-sltzmVWM.js +2 -0
- package/packages/web/dist/assets/tsx-D2H2cqPj.js +2 -0
- package/packages/web/dist/assets/turtle-ByJddavk.js +2 -0
- package/packages/web/dist/assets/twig-DqWgw3C7.js +2 -0
- package/packages/web/dist/assets/types-D1t1HqPm.js +2 -0
- package/packages/web/dist/assets/typescript-DVfyLS1i.js +2 -0
- package/packages/web/dist/assets/typespec-BGhR2SqG.js +2 -0
- package/packages/web/dist/assets/typst-Cs7gYQVT.js +2 -0
- package/packages/web/dist/assets/ui-C7ZH_6oC.css +1 -0
- package/packages/web/dist/assets/ui-W12UYhVu.js +17 -0
- package/packages/web/dist/assets/url-BIg5IhGs.js +2 -0
- package/packages/web/dist/assets/usecaseDiagram-AFA6YXN4-D3m4xj4y.js +329 -0
- package/packages/web/dist/assets/v-DBj4K9d_.js +2 -0
- package/packages/web/dist/assets/vala-zf12oZj6.js +2 -0
- package/packages/web/dist/assets/vb-DOwzaHZ0.js +2 -0
- package/packages/web/dist/assets/vennDiagram-NNMJR3RB-DeIkukMz.js +35 -0
- package/packages/web/dist/assets/verilog-B2gwz-sJ.js +2 -0
- package/packages/web/dist/assets/vhdl-BroJfC0k.js +2 -0
- package/packages/web/dist/assets/viml-DvXPmvsu.js +2 -0
- package/packages/web/dist/assets/vue-D0OpHdq8.js +2 -0
- package/packages/web/dist/assets/vue-html-DYZahZaV.js +2 -0
- package/packages/web/dist/assets/vue-vine-BsFhbSla.js +2 -0
- package/packages/web/dist/assets/vyper-CgoNMtux.js +2 -0
- package/packages/web/dist/assets/wardley-7MLQ67FV-DSzBQKe8.js +1 -0
- package/packages/web/dist/assets/wardleyDiagram-S7YFUSEH-ef9ee0JD.js +79 -0
- package/packages/web/dist/assets/wasm-ByWQv1Qj.js +2 -0
- package/packages/web/dist/assets/wenyan-C8pVoKbM.js +2 -0
- package/packages/web/dist/assets/wgsl-BsKzXJz4.js +2 -0
- package/packages/web/dist/assets/widget-host-BCf6Tlt5.js +2 -0
- package/packages/web/dist/assets/widgets-CrbkovMT.js +2 -0
- package/packages/web/dist/assets/wikitext-ClFFjSW2.js +2 -0
- package/packages/web/dist/assets/wit-DdvCle-K.js +2 -0
- package/packages/web/dist/assets/wolfram-DLL8P-h_.js +2 -0
- package/packages/web/dist/assets/xml-Cz9mX3j0.js +2 -0
- package/packages/web/dist/assets/xsl-fJeiXJlj.js +2 -0
- package/packages/web/dist/assets/xychartDiagram-GGNKY7IX-CuWtZyN1.js +8 -0
- package/packages/web/dist/assets/yaml-BtwsWWqX.js +2 -0
- package/packages/web/dist/assets/zenscript-BnlCZFoB.js +2 -0
- package/packages/web/dist/assets/zig-CMLA9XwU.js +2 -0
- package/packages/web/dist/favicon.svg +1 -0
- package/packages/web/dist/icons/apple-touch-icon.png +0 -0
- package/packages/web/dist/icons/icon-192.png +0 -0
- package/packages/web/dist/icons/icon-512.png +0 -0
- package/packages/web/dist/icons/maskable-512.png +0 -0
- package/packages/web/dist/index.html +95 -0
- package/packages/web/dist/offline.html +39 -0
- package/packages/web/dist/screenshots/narrow.png +0 -0
- package/packages/web/dist/screenshots/wide.png +0 -0
- package/packages/web/dist/sw.js +2 -0
- package/packages/web/dist/zod-config.js +7 -0
- package/packages/web/package.json +25 -0
- package/premade/claude.zip +0 -0
- package/premade/database.zip +0 -0
- package/premade/web.zip +0 -0
- package/scripts/dev-env.ts +30 -0
- package/scripts/hub-client.ts +2 -0
- package/scripts/release/link.cjs +73 -0
- package/scripts/run-stack.ts +98 -0
- package/scripts/stack.ts +317 -0
- package/scripts/start.ts +120 -0
- package/scripts/supervise.ts +98 -0
- package/systems/api/package.json +20 -0
- package/systems/api/server/authoring.ts +348 -0
- package/systems/api/server/env.ts +16 -0
- package/systems/api/server/guard.ts +44 -0
- package/systems/api/server/http.ts +274 -0
- package/systems/api/server/impl.ts +233 -0
- package/systems/api/server/index.ts +10 -0
- package/systems/api/server/main.ts +27 -0
- package/systems/api/server/openapi.ts +51 -0
- package/systems/api/server/program.ts +158 -0
- package/systems/api/server/services.ts +121 -0
- package/systems/api/shared/http.ts +61 -0
- package/systems/api/shared/index.ts +244 -0
- package/systems/api/system.json +9 -0
- package/systems/api/tsconfig.json +6 -0
- package/systems/code/package.json +20 -0
- package/systems/code/server/authoring.ts +233 -0
- package/systems/code/server/env.ts +13 -0
- package/systems/code/server/impl.ts +128 -0
- package/systems/code/server/index.ts +5 -0
- package/systems/code/server/main.ts +27 -0
- package/systems/code/shared/index.ts +130 -0
- package/systems/code/system.json +9 -0
- package/systems/code/tsconfig.json +6 -0
- package/systems/embedder/package.json +19 -0
- package/systems/embedder/server/env.ts +27 -0
- package/systems/embedder/server/http.ts +154 -0
- package/systems/embedder/server/impl.ts +104 -0
- package/systems/embedder/server/index.ts +22 -0
- package/systems/embedder/server/main.ts +37 -0
- package/systems/embedder/server/provider.ts +60 -0
- package/systems/embedder/shared/index.ts +74 -0
- package/systems/embedder/system.json +9 -0
- package/systems/embedder/tsconfig.json +6 -0
- package/systems/fs/client/BashView.vue +165 -0
- package/systems/fs/client/ChangesView.vue +132 -0
- package/systems/fs/client/DiffBody.vue +95 -0
- package/systems/fs/client/DiffView.vue +73 -0
- package/systems/fs/client/EntryInput.vue +102 -0
- package/systems/fs/client/InstallView.vue +72 -0
- package/systems/fs/client/OutputBlock.vue +65 -0
- package/systems/fs/client/bash.ts +40 -0
- package/systems/fs/client/changes.ts +87 -0
- package/systems/fs/client/diff.ts +151 -0
- package/systems/fs/client/fakes.ts +58 -0
- package/systems/fs/client/index.ts +19 -0
- package/systems/fs/client/preview/Preview.vue +70 -0
- package/systems/fs/client/preview/index.html +12 -0
- package/systems/fs/client/preview/main.ts +9 -0
- package/systems/fs/client/preview/shots.ts +71 -0
- package/systems/fs/client/rerun.ts +36 -0
- package/systems/fs/context/authoring/index.md +42 -0
- package/systems/fs/context/authoring/parts/actions.md +56 -0
- package/systems/fs/context/authoring/parts/actions.reference.md +90 -0
- package/systems/fs/context/authoring/parts/calling.md +71 -0
- package/systems/fs/context/authoring/parts/calling.reference.md +134 -0
- package/systems/fs/context/authoring/parts/client.md +273 -0
- package/systems/fs/context/authoring/parts/client.reference/client.md +638 -0
- package/systems/fs/context/authoring/parts/client.reference/fnpillprops.md +141 -0
- package/systems/fs/context/authoring/parts/client.reference/resultview.md +619 -0
- package/systems/fs/context/authoring/parts/client.reference.md +24 -0
- package/systems/fs/context/authoring/parts/context.md +119 -0
- package/systems/fs/context/authoring/parts/context.reference.md +458 -0
- package/systems/fs/context/authoring/parts/contract.md +167 -0
- package/systems/fs/context/authoring/parts/contract.reference.md +286 -0
- package/systems/fs/context/authoring/parts/core-types/access-ts.md +39 -0
- package/systems/fs/context/authoring/parts/core-types/admin-ts.md +41 -0
- package/systems/fs/context/authoring/parts/core-types/api-index-ts.md +28 -0
- package/systems/fs/context/authoring/parts/core-types/approvals-ts.md +494 -0
- package/systems/fs/context/authoring/parts/core-types/auto-pair-ts.md +28 -0
- package/systems/fs/context/authoring/parts/core-types/checks-ts.md +42 -0
- package/systems/fs/context/authoring/parts/core-types/claims-ts.md +26 -0
- package/systems/fs/context/authoring/parts/core-types/config-secrets-ts.md +24 -0
- package/systems/fs/context/authoring/parts/core-types/connections-ts.md +178 -0
- package/systems/fs/context/authoring/parts/core-types/context-files-ts.md +103 -0
- package/systems/fs/context/authoring/parts/core-types/context-graph-ts.md +22 -0
- package/systems/fs/context/authoring/parts/core-types/contextdecl.md +477 -0
- package/systems/fs/context/authoring/parts/core-types/data-ts.md +236 -0
- package/systems/fs/context/authoring/parts/core-types/decisions-ts.md +52 -0
- package/systems/fs/context/authoring/parts/core-types/fn-block-ts.md +31 -0
- package/systems/fs/context/authoring/parts/core-types/fn-facts-ts.md +228 -0
- package/systems/fs/context/authoring/parts/core-types/gin-ts.md +24 -0
- package/systems/fs/context/authoring/parts/core-types/grants-ts.md +55 -0
- package/systems/fs/context/authoring/parts/core-types/lifecycle-ts.md +658 -0
- package/systems/fs/context/authoring/parts/core-types/link-ts.md +410 -0
- package/systems/fs/context/authoring/parts/core-types/llm-ts.md +268 -0
- package/systems/fs/context/authoring/parts/core-types/manifest.md +460 -0
- package/systems/fs/context/authoring/parts/core-types/manifestpatch.md +519 -0
- package/systems/fs/context/authoring/parts/core-types/mention-search-ts.md +29 -0
- package/systems/fs/context/authoring/parts/core-types/model-calls-ts.md +200 -0
- package/systems/fs/context/authoring/parts/core-types/model-names-ts.md +31 -0
- package/systems/fs/context/authoring/parts/core-types/modes-ts.md +89 -0
- package/systems/fs/context/authoring/parts/core-types/owner-runs-ts.md +47 -0
- package/systems/fs/context/authoring/parts/core-types/package-ts.md +83 -0
- package/systems/fs/context/authoring/parts/core-types/primitives-ts.md +170 -0
- package/systems/fs/context/authoring/parts/core-types/query-ts.md +50 -0
- package/systems/fs/context/authoring/parts/core-types/records-actors-ts.md +259 -0
- package/systems/fs/context/authoring/parts/core-types/records-chat-ts.md +217 -0
- package/systems/fs/context/authoring/parts/core-types/records-content-ts.md +24 -0
- package/systems/fs/context/authoring/parts/core-types/records-runs-ts.md +24 -0
- package/systems/fs/context/authoring/parts/core-types/records-systems-ts.md +69 -0
- package/systems/fs/context/authoring/parts/core-types/registries-ts.md +376 -0
- package/systems/fs/context/authoring/parts/core-types/remote-auth-ts.md +60 -0
- package/systems/fs/context/authoring/parts/core-types/resources-ts.md +250 -0
- package/systems/fs/context/authoring/parts/core-types/run-ts.md +425 -0
- package/systems/fs/context/authoring/parts/core-types/sensitivity-ts.md +52 -0
- package/systems/fs/context/authoring/parts/core-types/system-events-ts.md +90 -0
- package/systems/fs/context/authoring/parts/core-types/system-pages-ts.md +50 -0
- package/systems/fs/context/authoring/parts/core-types/system-providers-ts.md +46 -0
- package/systems/fs/context/authoring/parts/core-types/validation-ts.md +45 -0
- package/systems/fs/context/authoring/parts/core-types/visuals-ts.md +107 -0
- package/systems/fs/context/authoring/parts/core-types/web-ts.md +22 -0
- package/systems/fs/context/authoring/parts/core-types/widgets-ts.md +299 -0
- package/systems/fs/context/authoring/parts/core-types.md +164 -0
- package/systems/fs/context/authoring/parts/ctx.md +94 -0
- package/systems/fs/context/authoring/parts/ctx.reference/fnctx.md +516 -0
- package/systems/fs/context/authoring/parts/ctx.reference/hubai.md +309 -0
- package/systems/fs/context/authoring/parts/ctx.reference.md +21 -0
- package/systems/fs/context/authoring/parts/data.md +162 -0
- package/systems/fs/context/authoring/parts/data.reference.md +119 -0
- package/systems/fs/context/authoring/parts/examples/client-findview-vue.md +77 -0
- package/systems/fs/context/authoring/parts/examples/client-index-ts.md +48 -0
- package/systems/fs/context/authoring/parts/examples/client-notecard-vue.md +43 -0
- package/systems/fs/context/authoring/parts/examples/client-noteinput-vue.md +73 -0
- package/systems/fs/context/authoring/parts/examples/client-notespage-vue.md +82 -0
- package/systems/fs/context/authoring/parts/examples/client-reviewform-vue.md +57 -0
- package/systems/fs/context/authoring/parts/examples/client-wordcount-vue.md +58 -0
- package/systems/fs/context/authoring/parts/examples/package-json.md +40 -0
- package/systems/fs/context/authoring/parts/examples/server-env-ts.md +40 -0
- package/systems/fs/context/authoring/parts/examples/server-impl-ts.md +323 -0
- package/systems/fs/context/authoring/parts/examples/server-index-ts.md +34 -0
- package/systems/fs/context/authoring/parts/examples/server-main-ts.md +57 -0
- package/systems/fs/context/authoring/parts/examples/server-notes-test-ts.md +95 -0
- package/systems/fs/context/authoring/parts/examples/shared-index-ts.md +310 -0
- package/systems/fs/context/authoring/parts/examples/system-json.md +36 -0
- package/systems/fs/context/authoring/parts/examples/systems-fs-shared-index-ts-lines-1-189.md +214 -0
- package/systems/fs/context/authoring/parts/examples/systems-fs-shared-index-ts-lines-190-370.md +202 -0
- package/systems/fs/context/authoring/parts/examples/systems-fs-shared-index-ts-lines-371-533.md +183 -0
- package/systems/fs/context/authoring/parts/examples/tsconfig-json.md +27 -0
- package/systems/fs/context/authoring/parts/examples.md +76 -0
- package/systems/fs/context/authoring/parts/fns.md +225 -0
- package/systems/fs/context/authoring/parts/fns.reference/fillclaims.md +267 -0
- package/systems/fs/context/authoring/parts/fns.reference/fn.md +530 -0
- package/systems/fs/context/authoring/parts/fns.reference.md +21 -0
- package/systems/fs/context/authoring/parts/folder.md +472 -0
- package/systems/fs/context/authoring/parts/gin.md +122 -0
- package/systems/fs/context/authoring/parts/gin.reference.md +483 -0
- package/systems/fs/context/authoring/parts/handlers-progress.md +100 -0
- package/systems/fs/context/authoring/parts/handlers-progress.reference.md +197 -0
- package/systems/fs/context/authoring/parts/hooks.md +56 -0
- package/systems/fs/context/authoring/parts/hooks.reference.md +110 -0
- package/systems/fs/context/authoring/parts/hub/hub-auto-pair-revoke.md +189 -0
- package/systems/fs/context/authoring/parts/hub/hub-fns-load.md +470 -0
- package/systems/fs/context/authoring/parts/hub/hub-run-background.md +562 -0
- package/systems/fs/context/authoring/parts/hub/kinds-of-hub.md +95 -0
- package/systems/fs/context/authoring/parts/hub.md +45 -0
- package/systems/fs/context/authoring/parts/hub.reference.md +476 -0
- package/systems/fs/context/authoring/parts/internals/manifestof.md +721 -0
- package/systems/fs/context/authoring/parts/internals/permissionargs.md +652 -0
- package/systems/fs/context/authoring/parts/internals/usagefromwire.md +257 -0
- package/systems/fs/context/authoring/parts/internals.md +39 -0
- package/systems/fs/context/authoring/parts/kinds-agents.md +278 -0
- package/systems/fs/context/authoring/parts/kinds-agents.reference/authoringsession.md +195 -0
- package/systems/fs/context/authoring/parts/kinds-agents.reference/kind.md +496 -0
- package/systems/fs/context/authoring/parts/kinds-agents.reference.md +21 -0
- package/systems/fs/context/authoring/parts/lifecycle.md +89 -0
- package/systems/fs/context/authoring/parts/lifecycle.reference.md +60 -0
- package/systems/fs/context/authoring/parts/mentions.md +76 -0
- package/systems/fs/context/authoring/parts/mentions.reference.md +105 -0
- package/systems/fs/context/authoring/parts/mistakes.md +465 -0
- package/systems/fs/context/authoring/parts/named-types.md +97 -0
- package/systems/fs/context/authoring/parts/named-types.reference.md +168 -0
- package/systems/fs/context/authoring/parts/outcomes.md +120 -0
- package/systems/fs/context/authoring/parts/outcomes.reference.md +287 -0
- package/systems/fs/context/authoring/parts/owner-runs.md +62 -0
- package/systems/fs/context/authoring/parts/owner-runs.reference.md +224 -0
- package/systems/fs/context/authoring/parts/packaging.md +201 -0
- package/systems/fs/context/authoring/parts/packaging.reference.md +206 -0
- package/systems/fs/context/authoring/parts/providers.md +63 -0
- package/systems/fs/context/authoring/parts/providers.reference.md +88 -0
- package/systems/fs/context/authoring/parts/remote.md +63 -0
- package/systems/fs/context/authoring/parts/remote.reference.md +175 -0
- package/systems/fs/context/authoring/parts/resources.md +58 -0
- package/systems/fs/context/authoring/parts/resources.reference.md +130 -0
- package/systems/fs/context/authoring/parts/server.md +120 -0
- package/systems/fs/context/authoring/parts/server.reference.md +569 -0
- package/systems/fs/context/authoring/parts/settings-attachments.md +55 -0
- package/systems/fs/context/authoring/parts/settings-attachments.reference.md +100 -0
- package/systems/fs/context/authoring/parts/start.md +67 -0
- package/systems/fs/context/authoring/parts/state-forms.md +103 -0
- package/systems/fs/context/authoring/parts/state-forms.reference.md +32 -0
- package/systems/fs/context/authoring/parts/testing.md +160 -0
- package/systems/fs/context/authoring/parts/testing.reference/fakehub.md +396 -0
- package/systems/fs/context/authoring/parts/testing.reference/memoryjournal.md +539 -0
- package/systems/fs/context/authoring/parts/testing.reference/toolcall.md +509 -0
- package/systems/fs/context/authoring/parts/testing.reference.md +24 -0
- package/systems/fs/context/authoring/parts/widgets.md +165 -0
- package/systems/fs/context/authoring/parts/widgets.reference/hub-visuals.md +623 -0
- package/systems/fs/context/authoring/parts/widgets.reference/sourcecompatible.md +150 -0
- package/systems/fs/context/authoring/parts/widgets.reference.md +21 -0
- package/systems/fs/context/authoring/topics/begin.md +37 -0
- package/systems/fs/context/authoring/topics/client.md +25 -0
- package/systems/fs/context/authoring/topics/declare.md +40 -0
- package/systems/fs/context/authoring/topics/examples.md +25 -0
- package/systems/fs/context/authoring/topics/fns.md +37 -0
- package/systems/fs/context/authoring/topics/server.md +40 -0
- package/systems/fs/context/authoring/topics/types.md +28 -0
- package/systems/fs/package.json +28 -0
- package/systems/fs/server/authoring.ts +103 -0
- package/systems/fs/server/builds.ts +101 -0
- package/systems/fs/server/changes.ts +430 -0
- package/systems/fs/server/commands.ts +133 -0
- package/systems/fs/server/documents.ts +96 -0
- package/systems/fs/server/env.ts +123 -0
- package/systems/fs/server/files.ts +218 -0
- package/systems/fs/server/git.ts +99 -0
- package/systems/fs/server/hosting.ts +742 -0
- package/systems/fs/server/impl.ts +451 -0
- package/systems/fs/server/index.ts +151 -0
- package/systems/fs/server/loader.ts +47 -0
- package/systems/fs/server/main.ts +143 -0
- package/systems/fs/server/mentions.ts +176 -0
- package/systems/fs/server/network-guard.ts +10 -0
- package/systems/fs/server/paths.ts +148 -0
- package/systems/fs/server/problem.ts +26 -0
- package/systems/fs/server/resources.ts +236 -0
- package/systems/fs/server/reveal.ts +33 -0
- package/systems/fs/server/run-tests.ts +17 -0
- package/systems/fs/server/runner.ts +221 -0
- package/systems/fs/server/safe.ts +83 -0
- package/systems/fs/server/search.ts +214 -0
- package/systems/fs/server/sections.ts +17 -0
- package/systems/fs/server/sensitive.ts +560 -0
- package/systems/fs/server/shell.ts +255 -0
- package/systems/fs/server/snapshots.ts +119 -0
- package/systems/fs/server/stale.ts +92 -0
- package/systems/fs/server/testing.ts +256 -0
- package/systems/fs/server/tests.ts +203 -0
- package/systems/fs/server/tree.ts +44 -0
- package/systems/fs/server/walk.ts +82 -0
- package/systems/fs/shared/format.ts +29 -0
- package/systems/fs/shared/hosting.ts +65 -0
- package/systems/fs/shared/index.ts +533 -0
- package/systems/fs/system.json +10 -0
- package/systems/fs/tsconfig.json +6 -0
- package/systems/google-calendar/package.json +18 -0
- package/systems/google-calendar/server/calendar.ts +164 -0
- package/systems/google-calendar/server/connector.ts +73 -0
- package/systems/google-calendar/server/env.ts +25 -0
- package/systems/google-calendar/server/fake.ts +127 -0
- package/systems/google-calendar/server/google.ts +234 -0
- package/systems/google-calendar/server/impl.ts +140 -0
- package/systems/google-calendar/server/index.ts +7 -0
- package/systems/google-calendar/server/main.ts +29 -0
- package/systems/google-calendar/shared/index.ts +198 -0
- package/systems/google-calendar/system.json +9 -0
- package/systems/google-calendar/tsconfig.json +6 -0
- package/systems/input/client/FieldInput.vue +118 -0
- package/systems/input/client/FormCard.vue +223 -0
- package/systems/input/client/form.ts +152 -0
- package/systems/input/client/host.ts +13 -0
- package/systems/input/client/index.ts +28 -0
- package/systems/input/package.json +22 -0
- package/systems/input/server/authoring.ts +240 -0
- package/systems/input/server/env.ts +17 -0
- package/systems/input/server/impl.ts +177 -0
- package/systems/input/server/index.ts +4 -0
- package/systems/input/server/main.ts +31 -0
- package/systems/input/shared/forms.ts +106 -0
- package/systems/input/shared/index.ts +389 -0
- package/systems/input/system.json +10 -0
- package/systems/input/tsconfig.json +6 -0
- package/systems/mcp/package.json +21 -0
- package/systems/mcp/server/dial.ts +102 -0
- package/systems/mcp/server/elicitation.ts +103 -0
- package/systems/mcp/server/env.ts +27 -0
- package/systems/mcp/server/fixtures/stdio-server.ts +8 -0
- package/systems/mcp/server/impl.ts +190 -0
- package/systems/mcp/server/index.ts +10 -0
- package/systems/mcp/server/instance.ts +442 -0
- package/systems/mcp/server/main.ts +42 -0
- package/systems/mcp/server/mirror.ts +179 -0
- package/systems/mcp/server/oauth.ts +163 -0
- package/systems/mcp/server/schema.ts +56 -0
- package/systems/mcp/server/server-link.ts +216 -0
- package/systems/mcp/shared/index.ts +130 -0
- package/systems/mcp/shared/shapes.ts +42 -0
- package/systems/mcp/system.json +10 -0
- package/systems/mcp/tsconfig.json +6 -0
- package/systems/ollama/client/ServersPage.vue +242 -0
- package/systems/ollama/client/index.ts +13 -0
- package/systems/ollama/client/logic.ts +108 -0
- package/systems/ollama/package.json +22 -0
- package/systems/ollama/server/api.ts +106 -0
- package/systems/ollama/server/detect.ts +59 -0
- package/systems/ollama/server/env.ts +43 -0
- package/systems/ollama/server/fakes.ts +212 -0
- package/systems/ollama/server/impl.ts +362 -0
- package/systems/ollama/server/index.ts +10 -0
- package/systems/ollama/server/install.ts +348 -0
- package/systems/ollama/server/main.ts +67 -0
- package/systems/ollama/server/models.ts +93 -0
- package/systems/ollama/server/provider.ts +42 -0
- package/systems/ollama/server/serve.ts +315 -0
- package/systems/ollama/shared/index.ts +178 -0
- package/systems/ollama/shared/schemas.ts +258 -0
- package/systems/ollama/system.json +11 -0
- package/systems/ollama/tsconfig.json +6 -0
- package/systems/schedule/client/AgendaList.vue +74 -0
- package/systems/schedule/client/AllSchedulesPage.vue +129 -0
- package/systems/schedule/client/CalendarGrid.vue +155 -0
- package/systems/schedule/client/CalendarPage.vue +203 -0
- package/systems/schedule/client/ChangeResult.vue +23 -0
- package/systems/schedule/client/FiringResult.vue +45 -0
- package/systems/schedule/client/ScheduleCard.vue +63 -0
- package/systems/schedule/client/ScheduleForm.vue +227 -0
- package/systems/schedule/client/ScheduleListResult.vue +36 -0
- package/systems/schedule/client/SchedulePage.vue +342 -0
- package/systems/schedule/client/ScheduleResult.vue +23 -0
- package/systems/schedule/client/host.ts +31 -0
- package/systems/schedule/client/index.ts +29 -0
- package/systems/schedule/client/logic.ts +655 -0
- package/systems/schedule/client/results.ts +114 -0
- package/systems/schedule/client/state.ts +372 -0
- package/systems/schedule/package.json +27 -0
- package/systems/schedule/server/args.ts +137 -0
- package/systems/schedule/server/authoring.ts +202 -0
- package/systems/schedule/server/env.ts +32 -0
- package/systems/schedule/server/fns.ts +791 -0
- package/systems/schedule/server/impl.ts +52 -0
- package/systems/schedule/server/index.ts +10 -0
- package/systems/schedule/server/kind.ts +48 -0
- package/systems/schedule/server/main.ts +33 -0
- package/systems/schedule/server/store.ts +195 -0
- package/systems/schedule/server/summary.ts +184 -0
- package/systems/schedule/server/timer.ts +893 -0
- package/systems/schedule/shared/index.ts +376 -0
- package/systems/schedule/shared/types.ts +264 -0
- package/systems/schedule/shared/when.ts +395 -0
- package/systems/schedule/shared/zoned.ts +44 -0
- package/systems/schedule/system.json +15 -0
- package/systems/schedule/tsconfig.json +6 -0
- package/systems/template/README.md +46 -0
- package/systems/template/client/index.ts +16 -0
- package/systems/template/client/vue-shim.d.ts +13 -0
- package/systems/template/package.json +20 -0
- package/systems/template/server/env.ts +19 -0
- package/systems/template/server/impl.ts +58 -0
- package/systems/template/server/index.ts +13 -0
- package/systems/template/server/main.ts +30 -0
- package/systems/template/shared/index.ts +81 -0
- package/systems/template/system.json +15 -0
- package/systems/template/tsconfig.json +6 -0
- package/systems/widgets/client/ProposalCard.vue +83 -0
- package/systems/widgets/client/SavedWidget.vue +35 -0
- package/systems/widgets/client/WidgetsPage.vue +112 -0
- package/systems/widgets/client/index.ts +19 -0
- package/systems/widgets/client/proposal.ts +52 -0
- package/systems/widgets/package.json +23 -0
- package/systems/widgets/server/authoring.ts +261 -0
- package/systems/widgets/server/env.ts +21 -0
- package/systems/widgets/server/impl.ts +252 -0
- package/systems/widgets/server/index.ts +6 -0
- package/systems/widgets/server/main.ts +32 -0
- package/systems/widgets/server/run.ts +104 -0
- package/systems/widgets/shared/index.ts +194 -0
- package/systems/widgets/system.json +10 -0
- package/systems/widgets/tsconfig.json +6 -0
- package/tsconfig.base.json +30 -0
|
@@ -0,0 +1,1065 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The hub's contract. The hub is a system too, built with the same SDK: other systems depend on its fns, use its
|
|
3
|
+
* `llm` kind (every agent is a fn of it), refer to its sectioners, and use its named types as fields
|
|
4
|
+
* (`g.nullable(hub.types.ContentRef)`). The hub implements this contract in its own process.
|
|
5
|
+
*
|
|
6
|
+
* Besides its own fns (search, load, follow runs, ask people, the static toolset's `find` / `inspect` / `load` /
|
|
7
|
+
* `unload`), the hub offers its web endpoints as fns through three maps, so the chat agent can see and do everything
|
|
8
|
+
* a person can: `HUB_READ_ENDPOINTS` (tagged `read`), `HUB_WRITE_ENDPOINTS` (they ask) and `ADMIN_ENDPOINTS` (tagged
|
|
9
|
+
* `admin`). Each such fn's args and result are its endpoint's body and response: one source of truth.
|
|
10
|
+
*/
|
|
11
|
+
import {
|
|
12
|
+
ADMIN_TAG, adminSlice, AgentInjected, chatSlice, CONTENT_HASH_PATTERN, ChatModeConfig, contextorSlice, contextSlice, ContextorConfig, DETAIL_LEVELS, ERROR_CLASSES,
|
|
13
|
+
graphSlice, injectionsSlice, versionsSlice, dataSlice, ContributionView, ReadTableArgs, ResultTable, RowActionsQuery, WidgetActionOption, mcpsSlice, metricsSlice, accessSlice, autoPairSlice, connectionsSlice, explorerSlice, suggestionsSlice, MintMcpTokenArgs, modelsSlice, OWN_TAG, packagingSlice, READ_TAG, resourcesSlice, ResourceOutlineArgs, ResourceSendArgs, ImageReadArgs, ImageReadResult, RUN_STATUSES, runsSlice,
|
|
14
|
+
FnLive, GinTypeDef, LIST_NAMES, querySlice, Section, settingsSlice, systemsSlice, LlmContentPart, ModelLimits, LINK_TARGET_KINDS, type Display,
|
|
15
|
+
FnBlock, FnExample, FnExamplesPage, FnExamplesQuery, FnRouting, FnSearchArgs, FnSearchPage, CtxSearchArgs, LoadContextResult, LoadFnsResult, ContextCrawlArgs, ContextCrawlResult, CRAWL_BATCH_MAX, NameRefusal, ShareRule, type RegistryEffect,
|
|
16
|
+
type QualifiedName,
|
|
17
|
+
} from '@harness/core';
|
|
18
|
+
import { z } from 'zod';
|
|
19
|
+
import { CHAT_BASE, CHAT_SMALL_BASE } from './chat-prompt.ts';
|
|
20
|
+
import { fn, type FnExampleOf } from './fn.ts';
|
|
21
|
+
import { kind, mention, sectioner, type } from './declare.ts';
|
|
22
|
+
import { g, json, type GinType } from './gin.ts';
|
|
23
|
+
import { system } from './system.ts';
|
|
24
|
+
import { withRefText, type ContextRef } from './refs.ts';
|
|
25
|
+
import { BUILT_IN_CONTRIBUTIONS } from './widgets.ts';
|
|
26
|
+
import { ginAs, ginOf, toolArgsOf, type ToolArgs } from './zod-gin.ts';
|
|
27
|
+
|
|
28
|
+
/** A web endpoint a hub fn stands for: its body is the fn's args and its response the fn's result. */
|
|
29
|
+
interface EndpointLike {
|
|
30
|
+
readonly cfg: { readonly body: z.ZodType; readonly response?: z.ZodType };
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The web reads the hub also offers as fns, so the chat agent can look at everything a person can: fn name →
|
|
35
|
+
* endpoint. Each is tagged `read`; the hub runs the same operation as the endpoint's handler, as the run's person.
|
|
36
|
+
*/
|
|
37
|
+
export const HUB_READ_ENDPOINTS = {
|
|
38
|
+
resource_list: resourcesSlice.endpoints.browseResources,
|
|
39
|
+
resource_read: resourcesSlice.endpoints.readResource,
|
|
40
|
+
ctx_get: contextSlice.endpoints.contextItem,
|
|
41
|
+
types_get: chatSlice.endpoints.types,
|
|
42
|
+
runs_list: adminSlice.endpoints.runs,
|
|
43
|
+
run_get: runsSlice.endpoints.run,
|
|
44
|
+
run_tree: runsSlice.endpoints.tree,
|
|
45
|
+
llm_call: runsSlice.endpoints.llmCall,
|
|
46
|
+
model_calls: metricsSlice.endpoints.modelCalls,
|
|
47
|
+
fns_metrics: metricsSlice.endpoints.fnMetrics,
|
|
48
|
+
sessions_list: chatSlice.endpoints.sessions,
|
|
49
|
+
session_messages: chatSlice.endpoints.messages,
|
|
50
|
+
systems_list: systemsSlice.endpoints.systems,
|
|
51
|
+
system_get: systemsSlice.endpoints.system,
|
|
52
|
+
system_fns: adminSlice.endpoints.systemFns,
|
|
53
|
+
system_logs: adminSlice.endpoints.systemLogs,
|
|
54
|
+
model_roles: modelsSlice.endpoints.modelRoles,
|
|
55
|
+
model_limits: contextorSlice.endpoints.modelLimits,
|
|
56
|
+
/** Any list by the query standard (`LIST_FIELDS`): filters, sort, paging. */
|
|
57
|
+
query: querySlice.endpoints.query,
|
|
58
|
+
/** The graph of systems' fns, context, types and parts, and how they connect. */
|
|
59
|
+
graph: graphSlice.endpoints.graph,
|
|
60
|
+
/** Build 8: any item's version history (fns, types, context, kinds, commands, components, ...). */
|
|
61
|
+
item_versions: versionsSlice.endpoints.itemVersions,
|
|
62
|
+
} as const satisfies Record<string, EndpointLike>;
|
|
63
|
+
|
|
64
|
+
/** A hub read fn's name. */
|
|
65
|
+
export type HubReadFnName = keyof typeof HUB_READ_ENDPOINTS;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* The web writes on resources, context and memory the hub also offers as fns: fn name → endpoint. None is tagged
|
|
69
|
+
* `read`, so unless a policy says otherwise each waits for the person's approval.
|
|
70
|
+
*/
|
|
71
|
+
export const HUB_WRITE_ENDPOINTS = {
|
|
72
|
+
resource_convert: resourcesSlice.endpoints.convertResource,
|
|
73
|
+
resource_import: resourcesSlice.endpoints.importResource,
|
|
74
|
+
resource_rename: resourcesSlice.endpoints.renameResource,
|
|
75
|
+
resource_delete: resourcesSlice.endpoints.deleteResource,
|
|
76
|
+
ctx_from_resource: resourcesSlice.endpoints.contextFromResource,
|
|
77
|
+
remember: contextSlice.endpoints.remember,
|
|
78
|
+
forget: contextSlice.endpoints.forget,
|
|
79
|
+
} as const satisfies Record<string, EndpointLike>;
|
|
80
|
+
|
|
81
|
+
/** A hub write fn's name. */
|
|
82
|
+
export type HubWriteFnName = keyof typeof HUB_WRITE_ENDPOINTS;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The rest of what a person does in the browser, as fns (fn name → endpoint), so the chat agent can do it
|
|
86
|
+
* too, as the run's person: sessions, visibility, memory and context links, undoing a turn, background runs and
|
|
87
|
+
* per-person connections. None is tagged `read`, so each asks unless a policy allows it. Answering an approval or a
|
|
88
|
+
* question is left out on purpose: an agent must never answer what it asked.
|
|
89
|
+
*/
|
|
90
|
+
export const HUB_PERSON_ENDPOINTS = {
|
|
91
|
+
session_create: chatSlice.endpoints.createSession,
|
|
92
|
+
session_update: chatSlice.endpoints.updateSession,
|
|
93
|
+
session_delete: chatSlice.endpoints.deleteSession,
|
|
94
|
+
run_background: runsSlice.endpoints.background,
|
|
95
|
+
turn_undo: runsSlice.endpoints.undoTurn,
|
|
96
|
+
memory_update: contextSlice.endpoints.updateMemory,
|
|
97
|
+
ctx_link: contextSlice.endpoints.linkContext,
|
|
98
|
+
ctx_unlink: contextSlice.endpoints.unlinkContext,
|
|
99
|
+
access_set: accessSlice.endpoints.setAccess,
|
|
100
|
+
connection_update: connectionsSlice.endpoints.updateConnection,
|
|
101
|
+
connection_disconnect: connectionsSlice.endpoints.disconnect,
|
|
102
|
+
} as const satisfies Record<string, EndpointLike>;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Build 8, the data system (`core/data.ts`) as fns: stored types and their records, as the run's person. The reads
|
|
106
|
+
* are tagged `read`; saving and removing a record ask unless a policy allows it.
|
|
107
|
+
*/
|
|
108
|
+
export const HUB_DATA_ENDPOINTS = {
|
|
109
|
+
data_sets: dataSlice.endpoints.dataSets,
|
|
110
|
+
records_find: dataSlice.endpoints.records,
|
|
111
|
+
record_get: dataSlice.endpoints.record,
|
|
112
|
+
records_table: dataSlice.endpoints.recordTable,
|
|
113
|
+
record_versions: dataSlice.endpoints.recordVersions,
|
|
114
|
+
record_save: dataSlice.endpoints.saveRecord,
|
|
115
|
+
record_update: dataSlice.endpoints.updateRecord,
|
|
116
|
+
record_remove: dataSlice.endpoints.removeRecord,
|
|
117
|
+
} as const satisfies Record<string, EndpointLike>;
|
|
118
|
+
|
|
119
|
+
/** A data fn's name. */
|
|
120
|
+
export type HubDataFnName = keyof typeof HUB_DATA_ENDPOINTS;
|
|
121
|
+
|
|
122
|
+
/** A person's write fn's name. */
|
|
123
|
+
export type HubPersonFnName = keyof typeof HUB_PERSON_ENDPOINTS;
|
|
124
|
+
|
|
125
|
+
/** The file explorer's reads as fns (tagged `read`): a system's files live, as the run's person may see them. */
|
|
126
|
+
export const HUB_EXPLORE_ENDPOINTS = {
|
|
127
|
+
explore_roots: explorerSlice.endpoints.exploreRoots,
|
|
128
|
+
explore_list: explorerSlice.endpoints.exploreList,
|
|
129
|
+
explore_read: explorerSlice.endpoints.exploreRead,
|
|
130
|
+
} as const satisfies Record<string, EndpointLike>;
|
|
131
|
+
|
|
132
|
+
/** An explorer read fn's name. */
|
|
133
|
+
export type HubExploreFnName = keyof typeof HUB_EXPLORE_ENDPOINTS;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* The admin pages' reads as fns (tagged `admin` and `read`): budgets, policies, priorities, providers,
|
|
137
|
+
* people, settings, hub MCPs, pairings, auto-pair secrets, instances and the suggestion decision model. They run only
|
|
138
|
+
* for an admin and never through a hub MCP; reading asks nobody.
|
|
139
|
+
*/
|
|
140
|
+
export const ADMIN_READ_ENDPOINTS = {
|
|
141
|
+
budgets_list: adminSlice.endpoints.budgets,
|
|
142
|
+
policies_list: adminSlice.endpoints.policies,
|
|
143
|
+
priority_rules_list: adminSlice.endpoints.priorityRules,
|
|
144
|
+
providers_list: settingsSlice.endpoints.providers,
|
|
145
|
+
actors_list: adminSlice.endpoints.actors,
|
|
146
|
+
actor_settings_list: adminSlice.endpoints.actorSettings,
|
|
147
|
+
mcps_list: mcpsSlice.endpoints.mcps,
|
|
148
|
+
mcp_sessions_list: mcpsSlice.endpoints.mcpSessions,
|
|
149
|
+
pairings_list: systemsSlice.endpoints.pairings,
|
|
150
|
+
auto_pairs_list: autoPairSlice.endpoints.autoPairs,
|
|
151
|
+
instances_list: packagingSlice.endpoints.instances,
|
|
152
|
+
suggest_decision_get: suggestionsSlice.endpoints.suggestDecision,
|
|
153
|
+
search_decision_get: suggestionsSlice.endpoints.searchDecisions,
|
|
154
|
+
ctx_injections_list: injectionsSlice.endpoints.injections,
|
|
155
|
+
} as const satisfies Record<string, EndpointLike>;
|
|
156
|
+
|
|
157
|
+
/** An admin read fn's name. */
|
|
158
|
+
export type AdminReadFnName = keyof typeof ADMIN_READ_ENDPOINTS;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* The web admin endpoints the hub also offers as fns, so whatever an admin configures can be done by asking in chat:
|
|
162
|
+
* fn name → endpoint. The endpoint's body and response are the fn's args and result, and the hub's admin fn and the
|
|
163
|
+
* web handler run the same operation. Each is tagged `admin`: never exposed through a hub MCP, run only for an admin,
|
|
164
|
+
* and it waits for the person's approval unless a policy says otherwise.
|
|
165
|
+
*/
|
|
166
|
+
export const ADMIN_ENDPOINTS = {
|
|
167
|
+
configure_provider: settingsSlice.endpoints.configureProvider,
|
|
168
|
+
set_model_category: settingsSlice.endpoints.setModelCategory,
|
|
169
|
+
set_budget: settingsSlice.endpoints.setBudget,
|
|
170
|
+
set_priority: settingsSlice.endpoints.setPriority,
|
|
171
|
+
set_policy: settingsSlice.endpoints.setPolicy,
|
|
172
|
+
set_actor_setting: settingsSlice.endpoints.setActorSetting,
|
|
173
|
+
add_user: settingsSlice.endpoints.addUser,
|
|
174
|
+
add_group: settingsSlice.endpoints.addGroup,
|
|
175
|
+
update_user: settingsSlice.endpoints.updateUser,
|
|
176
|
+
set_membership: settingsSlice.endpoints.setMembership,
|
|
177
|
+
set_sign_in_policy: settingsSlice.endpoints.setSignInPolicy,
|
|
178
|
+
set_sign_in_limits: settingsSlice.endpoints.setSignInLimits,
|
|
179
|
+
set_proxy_trust: settingsSlice.endpoints.setProxyTrust,
|
|
180
|
+
remove_rule: adminSlice.endpoints.removeRule,
|
|
181
|
+
approve_pairing: systemsSlice.endpoints.approvePairing,
|
|
182
|
+
create_pairing_token: systemsSlice.endpoints.createPairingToken,
|
|
183
|
+
configure_system: systemsSlice.endpoints.configureSystem,
|
|
184
|
+
enable_system: systemsSlice.endpoints.enableSystem,
|
|
185
|
+
switch_item: systemsSlice.endpoints.switchItem,
|
|
186
|
+
remove_system: systemsSlice.endpoints.removeSystem,
|
|
187
|
+
install_system: systemsSlice.endpoints.installSystem,
|
|
188
|
+
start_system: systemsSlice.endpoints.startSystem,
|
|
189
|
+
stop_system: systemsSlice.endpoints.stopSystem,
|
|
190
|
+
restart_system: systemsSlice.endpoints.restartSystem,
|
|
191
|
+
upgrade_system: systemsSlice.endpoints.upgradeSystem,
|
|
192
|
+
set_model_role: modelsSlice.endpoints.setModelRole,
|
|
193
|
+
clear_model_role: modelsSlice.endpoints.clearModelRole,
|
|
194
|
+
set_model_limits: contextorSlice.endpoints.setModelLimits,
|
|
195
|
+
create_mcp: mcpsSlice.endpoints.createMcp,
|
|
196
|
+
update_mcp: mcpsSlice.endpoints.updateMcp,
|
|
197
|
+
rotate_mcp_secret: mcpsSlice.endpoints.rotateMcpSecret,
|
|
198
|
+
delete_mcp: mcpsSlice.endpoints.deleteMcp,
|
|
199
|
+
preview_mcp: mcpsSlice.endpoints.previewMcp,
|
|
200
|
+
install_package: packagingSlice.endpoints.installPackage,
|
|
201
|
+
add_instance: packagingSlice.endpoints.addInstance,
|
|
202
|
+
remove_instance: packagingSlice.endpoints.removeInstance,
|
|
203
|
+
export_system_data: packagingSlice.endpoints.exportSystemData,
|
|
204
|
+
suggest_decision_set: suggestionsSlice.endpoints.setSuggestDecision,
|
|
205
|
+
search_decision_set: suggestionsSlice.endpoints.setSearchDecision,
|
|
206
|
+
auto_pair_revoke: autoPairSlice.endpoints.revokeAutoPair,
|
|
207
|
+
system_reimport: systemsSlice.endpoints.reimport,
|
|
208
|
+
ctx_injection_set: injectionsSlice.endpoints.setInjection,
|
|
209
|
+
} as const satisfies Record<string, EndpointLike>;
|
|
210
|
+
|
|
211
|
+
/** An admin fn's name. */
|
|
212
|
+
export type AdminFnName = keyof typeof ADMIN_ENDPOINTS;
|
|
213
|
+
|
|
214
|
+
/** The empty result of an endpoint with no response. */
|
|
215
|
+
const NoResponse = z.object({}).strict();
|
|
216
|
+
|
|
217
|
+
/** What an endpoint fn returns: the endpoint's response (its input side), or an empty object when it has none. */
|
|
218
|
+
export type EndpointResult<E extends EndpointLike> = z.input<E['cfg'] extends { readonly response: infer R extends z.ZodType } ? R : typeof NoResponse>;
|
|
219
|
+
|
|
220
|
+
/** The gin type of what an endpoint fn returns, typed as the endpoint declares it. */
|
|
221
|
+
function resultTypeOf<E extends EndpointLike>(endpoint: E): GinType<EndpointResult<E>> {
|
|
222
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- ginOf builds the input side of E's own response (or of none)
|
|
223
|
+
return ginOf(endpoint.cfg.response ?? NoResponse) as GinType<EndpointResult<E>>;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/** An example call of an endpoint fn: its args as the fn takes them (the endpoint's body), checked when the contract is built. */
|
|
227
|
+
type EndpointExample<E extends EndpointLike> = FnExampleOf<ToolArgs<E['cfg']['body']>, EndpointResult<E>>;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* A fn for one web endpoint, its args and result read off the endpoint's body and response, so a system calling it
|
|
231
|
+
* gets the endpoint's types and a change to the endpoint's schema reaches every caller.
|
|
232
|
+
*/
|
|
233
|
+
function endpointFn<E extends EndpointLike>(description: string, instructions: string, endpoint: E, examples: EndpointExample<E>[], tags: readonly string[], display?: Display, registry: readonly RegistryEffect[] = []) {
|
|
234
|
+
return fn({
|
|
235
|
+
description,
|
|
236
|
+
instructions,
|
|
237
|
+
args: toolArgsOf<E['cfg']['body']>(endpoint.cfg.body).args,
|
|
238
|
+
returns: resultTypeOf(endpoint),
|
|
239
|
+
examples,
|
|
240
|
+
tags: [...tags],
|
|
241
|
+
...(display === undefined ? {} : { display }),
|
|
242
|
+
// what it creates, updates or removes in the hub, so the chat and its mode know
|
|
243
|
+
...(registry.length === 0 ? {} : { effects: { registry: [...registry] } }),
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/** Effects on the hub, written short: `changes('create', 'fns', 'types')`. */
|
|
248
|
+
function changes(action: RegistryEffect['action'], ...things: Array<RegistryEffect['thing']>): RegistryEffect[] {
|
|
249
|
+
return things.map((thing) => ({ thing, action }));
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/** A fn for a web read, tagged `read`. Reads are bookkeeping the person needn't see as a card once done. */
|
|
253
|
+
function readFn<E extends EndpointLike>(description: string, instructions: string, endpoint: E, examples: EndpointExample<E>[]) {
|
|
254
|
+
return endpointFn(description, instructions, endpoint, examples, [READ_TAG], 'message');
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/** A fn for a write on resources, context or memory: it asks unless a policy allows it. */
|
|
258
|
+
function writeFn<E extends EndpointLike>(description: string, instructions: string, endpoint: E, examples: EndpointExample<E>[], tags: readonly string[] = [], registry: readonly RegistryEffect[] = []) {
|
|
259
|
+
return endpointFn(description, instructions, endpoint, examples, tags, undefined, registry);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/** A fn for an admin page's read, tagged `admin` and `read`: only for an admin, and reading asks nobody. */
|
|
263
|
+
function adminReadFn<E extends EndpointLike>(description: string, instructions: string, endpoint: E, examples: EndpointExample<E>[]) {
|
|
264
|
+
return endpointFn(description, instructions, endpoint, examples, [ADMIN_TAG, READ_TAG], 'message');
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/** A fn for an admin operation, tagged `admin`. */
|
|
268
|
+
function adminFn<E extends EndpointLike>(description: string, instructions: string, endpoint: E, examples: EndpointExample<E>[], registry: readonly RegistryEffect[] = []) {
|
|
269
|
+
return endpointFn(description, instructions, endpoint, examples, [ADMIN_TAG], undefined, registry);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/** The hub's read fns (`HUB_READ_ENDPOINTS`), each described for the agent that offers them. */
|
|
273
|
+
const readFns = {
|
|
274
|
+
resource_list: readFn('List resources (files, pages, uploads) from every system and the hub, filtered, grouped and paged.', 'Use it to browse what exists (the files of a root, the pages a crawl kept, the uploads of a session) when you know where to look; to find something by what it says use hub/search_resources. Filter by root, system or kind and page on rather than asking for everything.', HUB_READ_ENDPOINTS.resource_list, [{ args: { system: 'fs', under: 'file:///repo/docs', limit: 20 }, note: 'The first 20 files under one folder.' }, { args: { source: 'upload', group: 'date' }, note: 'Uploads, grouped by day.' }]),
|
|
275
|
+
resource_read: readFn('Read a resource as text: its primary form (markdown for pages, tables for spreadsheets, pages for a PDF) or a chosen form, whole or by sections.', 'Use it to read a resource you have the uri of: a file the person attached (uploads are `hub://resources/uploads/<day>/<name>`; find one with hub/search_resources or hub/resource_list), a page the web system read, a file a system serves. Read it before you say anything about what it holds. Leave out `form` to read its primary form; name a form only when you need that one, and only one it has (`forms` in a reply lists them: `pages` for a PDF, `table` for a spreadsheet or CSV, `markdown` for a page or document). A form it lacks is not refused: its primary form is read instead and `note` says so. For a long one, read its outline first (hub/resource_outline) and then one section, or a window, so the answer fits. When only part came back, `partial` says what part, how much was left out and how to read the rest: read on before you state anything from the rest. Images and audio are read through their text forms (description, transcript); to look at an image itself, use hub/resource_send. A resource with no text form at all is refused with what it has instead: try hub/resource_send, or hub/explore_read for a file a system serves.', HUB_READ_ENDPOINTS.resource_read, [{ args: { uri: 'file:///repo/docs/guide.md', section: 'Install' }, note: 'One section of a long file.' }, { args: { uri: 'hub://resources/uploads/2026-11-22/report.pdf', maxChars: 4000 }, note: 'The start of a long upload, in its primary form.' }, { args: { uri: 'hub://resources/uploads/2026-11-22/report.pdf', form: 'pages', offset: 4000, maxChars: 4000 }, note: 'Reading on where `partial` said the rest starts.' }]),
|
|
276
|
+
ctx_get: readFn('One context item (a guide, skill, memory or piece of a resource) with its text and its links both ways.', 'Use it to read one context item in full, with what links to it and what it links to, after a search or a mention named it. To keep it in front of you for the rest of the session use hub/load instead.', HUB_READ_ENDPOINTS.ctx_get, [{ args: { name: 'fs/authoring' }, note: 'A guide and what it brings.' }]),
|
|
277
|
+
types_get: readFn('The definitions of named types and of every type they refer to, dependencies first.', 'Use it before writing args or a payload that use a named type (a table type, fs/Entry): it gives each type\'s fields and every type they refer to, so you need one call. Ask for several names at once.', HUB_READ_ENDPOINTS.types_get, [{ args: { names: ['fs/Entry'] }, note: 'A type and the types it uses.' }]),
|
|
278
|
+
runs_list: readFn('Runs, newest first, filtered by fn, status, session or system. A member sees their own runs.', 'Use it to find earlier runs (what ran, when, how it ended), for example to see why something failed. Filter by fn, status or session, newest first, and page; then hub/run_get for one run.', HUB_READ_ENDPOINTS.runs_list, [{ args: { limit: 10 }, note: 'The ten newest runs.' }]),
|
|
279
|
+
run_get: readFn('One run: its fn, args, status, result or error, cost and timings.', 'Use it to see one run in full: its args, result or error, cost and how long it took. For a run still going use hub/run_status or hub/run_wait.', HUB_READ_ENDPOINTS.run_get, [{ args: { run: 'run_01HZX3' } }]),
|
|
280
|
+
run_tree: readFn('The tree of runs a turn made: each run with the runs it called.', 'Use it to see everything one turn did, as a tree: each run with the runs it called. Good for explaining what happened or where a chain failed.', HUB_READ_ENDPOINTS.run_tree, [{ args: { turn: 'trn_01HZX3' }, note: 'Every run one message started.' }]),
|
|
281
|
+
llm_call: readFn('One LLM call: its whole request and response, tokens, cost and timings.', 'Use it to look at one model call exactly as sent and received (messages, tools, tokens, cost) when a run\'s behaviour needs explaining. It can be long: read it only when the summary in hub/run_get is not enough.', HUB_READ_ENDPOINTS.llm_call, [{ args: { id: 'llm_01HZX3' }, note: 'What the model was sent and answered.' }]),
|
|
282
|
+
model_calls: readFn('Model calls of every kind (chat, embeddings, images, transcription, speech), newest first, with cost and timings.', 'Use it for cost and timing questions across models (what cost the most today, which calls were slow). Narrow with `run` (one run\'s calls), or with `query`: its filters and sort take only these fields: modality, model, provider, system, status, session, cost, tokens, duration and createdAt (the start; `startedAt` in a result is not a filter field). Page on; one call\'s detail is hub/llm_call. Leave out an arg you don\'t use rather than sending null.', HUB_READ_ENDPOINTS.model_calls, [{ args: { run: 'run_01HZX3' }, note: 'What one run spent on models.' }]),
|
|
283
|
+
fns_metrics: readFn('How fns have been doing: runs, outcomes, retries, durations (p50, p95), queue waits, cost and tokens.', 'Use it to say how a fn usually behaves: how often it fails, how long it usually takes (p50) and when it is slow (p95), and what it costs. Quote these numbers rather than guessing. `outcomes.failed` counts the fn\'s own failures; `outcomes.invalid-input` counts calls whose args didn\'t fit and went back to the caller to fix, which say nothing about the fn: leave them out of how often it fails.', HUB_READ_ENDPOINTS.fns_metrics, [{ args: { fn: 'fs/read', days: 7 }, note: 'A week of one fn.' }]),
|
|
284
|
+
sessions_list: readFn('The person\'s chats (sessions), most recent first, each with its id, title and when it was last used.', 'Use it when the person refers to an earlier conversation ("what did we decide about the launch?"): look for a title that fits, then read that chat with hub/session_messages. Memories are another place earlier facts may be kept (hub/ctx_search with `origins: ["memory"]`).', HUB_READ_ENDPOINTS.sessions_list, [{ args: { limit: 20 } }]),
|
|
285
|
+
session_messages: readFn('A session\'s messages, newest first, paged backwards.', 'Use it to read what was said in an earlier chat, with the session id hub/sessions_list gave. It comes newest first; page backwards for older messages, and read only as far back as the question needs. Quote or sum up what the messages say; don\'t fill gaps from memory.', HUB_READ_ENDPOINTS.session_messages, [{ args: { session: 'ses_01HZX3', limit: 30 }, note: 'The last 30 messages.' }]),
|
|
286
|
+
systems_list: readFn('Every system: whether it is connected, its version, instances and what it offers.', 'Use it to see which systems are installed, connected and configured before relying on one; a system that is not connected has no usable fns.', HUB_READ_ENDPOINTS.systems_list, [{ args: {}, note: 'Every system and its status.' }]),
|
|
287
|
+
system_get: readFn('One system: its status, version, instances, config state and what it offers.', 'Use it for one system\'s state: whether it is connected, its instances and whether its config is set. When a fn of it is unavailable this usually says why.', HUB_READ_ENDPOINTS.system_get, [{ args: { system: 'fs' } }]),
|
|
288
|
+
system_fns: readFn('A system\'s fns, with whether each can be used now and its running numbers.', 'Use it to list what one system offers and which of its fns can be used now, with how they have been doing.', HUB_READ_ENDPOINTS.system_fns, [{ args: { system: 'database' }, note: 'Everything one system offers.' }]),
|
|
289
|
+
system_logs: readFn('The end of a system\'s output, oldest first.', 'Use it to see why a system misbehaves: the end of its output. Admins only; read the end first and go further back only if needed.', HUB_READ_ENDPOINTS.system_logs, [{ args: { system: 'fs', limit: 50 }, note: 'The last 50 lines, to read a crash.' }]),
|
|
290
|
+
model_roles: readFn('Which model (and provider) the hub uses for each job: chat, transcription, dictation, speech, describing images, reading text in them.', 'Use it to say which model does which job (chat, transcription, describing images, ...); to change one an admin uses hub/set_model_role.', HUB_READ_ENDPOINTS.model_roles, [{ args: {}, note: 'Which model does what.' }]),
|
|
291
|
+
model_limits: readFn('Each model\'s context window, output limit, reasoning reserve and characters per token, with where each came from.', 'Use it when a prompt does not fit or an answer is cut: each model\'s window and output limit, and where the numbers came from.', HUB_READ_ENDPOINTS.model_limits, [{ args: { model: 'qwen2.5:3b' } }]),
|
|
292
|
+
query: readFn(`Any list (${LIST_NAMES.join(', ')}) by the query standard: free text, filters on the list's fields (is, in, >, <, between, empty, contains, ...), a sort and paging.`, 'Use it for any list question with conditions (runs that failed this week, the biggest resources, fns of one system): name the list, add filters on its fields, a sort and a small page size, and page on. Never ask for everything.', HUB_READ_ENDPOINTS.query, [{ args: { list: 'runs', query: { text: 'install', limit: 10 } }, note: 'Runs whose words match.' }, { args: { list: 'contexts', query: { limit: 20 } }, note: 'A page of context items.' }]),
|
|
293
|
+
graph: readFn(
|
|
294
|
+
'The graph of what systems add (fns, context, types, kinds, commands, components, providers) and how they connect: what brings, calls, reads, writes, creates or refers to what.',
|
|
295
|
+
'Use it to explain how things connect ("how does the fs authoring context reach the database fns?"): give `systems` for one system graph (what it references elsewhere comes back as `external`), or `focus` on one node (`fn:database/run_query`, `context:fs/authoring`, `type:database/main.projects`) with `hops` for its neighbourhood. Narrow with `text` and `filters`, the query standard over the `graph` list (the same as hub/query: fields name, system, nodeKind, edgeKind, fnKind, mode, effect, visibility, stage, on; ops is, in, notIn, contains, ...), and keep `limit` small; `more` says what was left out, so focus on that node to see it. The `label` of each edge says the relation in plain words.',
|
|
296
|
+
HUB_READ_ENDPOINTS.graph,
|
|
297
|
+
[
|
|
298
|
+
{ args: { focus: { node: 'context:fs/authoring', hops: 2 }, limit: 40 }, note: 'What a context item brings and what those reach, two hops out.' },
|
|
299
|
+
{ args: { systems: ['database'], filters: [{ field: 'nodeKind', op: 'in', values: ['fn', 'type'] }, { field: 'edgeKind', op: 'in', values: ['reads', 'writes'] }] }, note: 'Which database fns read and write which types.' },
|
|
300
|
+
{ args: { filters: [{ field: 'effect', op: 'is', value: 'fns' }, { field: 'nodeKind', op: 'in', values: ['fn', 'kind'] }] }, note: 'Every fn that creates or changes fns, and the kinds it makes.' },
|
|
301
|
+
],
|
|
302
|
+
),
|
|
303
|
+
item_versions: readFn(
|
|
304
|
+
'The version history of one item a system declared or added while running (a fn, type, context item, kind, command, component, provider, ...): each version\'s declaration, how it changed, and who saved it, newest first.',
|
|
305
|
+
'Use it to say what changed in an item and when ("what did the project form look like before?", "when did fs/read change?"): give the system, the section and the name as the system page lists it (qualified, like `input/project`, or a `/command`). Each version holds the whole declaration; compare two to say what changed. Page with a small limit.',
|
|
306
|
+
HUB_READ_ENDPOINTS.item_versions,
|
|
307
|
+
[
|
|
308
|
+
{ args: { system: 'input', section: 'fns', name: 'input/project', limit: 5 }, note: 'The last five versions of a saved form.' },
|
|
309
|
+
{ args: { system: 'fs', section: 'context', name: 'fs/authoring' }, note: 'How a guide changed over time.' },
|
|
310
|
+
],
|
|
311
|
+
),
|
|
312
|
+
} satisfies Record<HubReadFnName, unknown>;
|
|
313
|
+
|
|
314
|
+
/** The data system's fns (`HUB_DATA_ENDPOINTS`). */
|
|
315
|
+
const dataFns = {
|
|
316
|
+
data_sets: readFn(
|
|
317
|
+
'The stored types (the data system\'s record sets) you can see, each with how many records it holds and when one last changed.',
|
|
318
|
+
'Use it to find where data lives before reading or saving records: it names each stored type (`notes/Note`) with its description and its record count. Filter by `text` or `system`.',
|
|
319
|
+
HUB_DATA_ENDPOINTS.data_sets,
|
|
320
|
+
[{ args: { text: 'notes' }, note: 'The stored types about notes.' }, { args: { system: 'notes', limit: 20 } }],
|
|
321
|
+
),
|
|
322
|
+
records_find: readFn(
|
|
323
|
+
'Records of one stored type: filtered and sorted on its fields, searched by words (and meaning, when the type is embedded), a page at a time.',
|
|
324
|
+
'Use it to answer questions about stored data ("my notes about the launch", "tasks due this week"): name the `type`, put conditions in `query.filters` on its top-level fields (is, in, >, <, between, contains, empty), a `query.sort`, and words in `search`. Keep `query.limit` small and page with the cursor. For a table to draw, use hub/records_table.',
|
|
325
|
+
HUB_DATA_ENDPOINTS.records_find,
|
|
326
|
+
[
|
|
327
|
+
{ args: { type: 'notes/Note', search: 'launch plan', query: { limit: 5 } }, note: 'The five notes that best match some words.' },
|
|
328
|
+
{ args: { type: 'tasks/Task', query: { filters: [{ field: 'done', op: 'is', value: false }], sort: [{ field: 'due', dir: 'asc' }], limit: 10 } }, note: 'Open tasks, soonest first.' },
|
|
329
|
+
],
|
|
330
|
+
),
|
|
331
|
+
record_get: readFn(
|
|
332
|
+
'One record of a stored type by its id, with its value, version and who changed it last.',
|
|
333
|
+
'Use it to read one record whose id you have (from hub/records_find or a row of a table) before changing it: pass its `version` as `expect` to hub/record_save so a change made meanwhile is not lost.',
|
|
334
|
+
HUB_DATA_ENDPOINTS.record_get,
|
|
335
|
+
[{ args: { type: 'notes/Note', id: 'rec_01HZX3' } }],
|
|
336
|
+
),
|
|
337
|
+
records_table: readFn(
|
|
338
|
+
'Records of one stored type as a table (one column per field, then the record id), offset-paged: what widgets and the result view draw.',
|
|
339
|
+
'Use it when the person wants to see records laid out (a grid, a chart) or to keep them as a widget (widgets/make_widget): it takes the same filters, sort and search as hub/records_find, with `offset` and `limit` for paging. Its last column is the record id, which row actions use.',
|
|
340
|
+
HUB_DATA_ENDPOINTS.records_table,
|
|
341
|
+
[{ args: { type: 'tasks/Task', query: { sort: [{ field: 'due', dir: 'asc' }] }, limit: 20 }, note: 'The first twenty tasks as a table.' }],
|
|
342
|
+
),
|
|
343
|
+
record_versions: readFn(
|
|
344
|
+
'A record\'s history, newest first: each version\'s value, how it changed, and who changed it.',
|
|
345
|
+
'Use it to say what a record looked like before or who changed it ("what did the note say yesterday?"). Page with a small limit.',
|
|
346
|
+
HUB_DATA_ENDPOINTS.record_versions,
|
|
347
|
+
[{ args: { type: 'notes/Note', id: 'rec_01HZX3', limit: 5 } }],
|
|
348
|
+
),
|
|
349
|
+
record_save: writeFn(
|
|
350
|
+
'Add a record to a stored type, or replace one (with its id); the value is checked against the type.',
|
|
351
|
+
'Use it when the person asks to keep or change data. Leave out `id` to add a record; to change one, read it first and pass its id with the whole new value and `expect` set to the version you read, so someone else\'s change made meanwhile is refused rather than lost. A value that does not fit the type is refused with what is wrong.',
|
|
352
|
+
HUB_DATA_ENDPOINTS.record_save,
|
|
353
|
+
[
|
|
354
|
+
{ args: { type: 'notes/Note', value: { title: 'Launch plan', body: 'Draft the timeline.' } }, note: 'A new note.' },
|
|
355
|
+
{ args: { type: 'tasks/Task', id: 'rec_01HZX3', value: { title: 'Pay rent', done: true }, expect: 3 }, note: 'Mark a task done, if nobody changed it since version 3.' },
|
|
356
|
+
],
|
|
357
|
+
[],
|
|
358
|
+
[...changes('create', 'records'), ...changes('update', 'records')],
|
|
359
|
+
),
|
|
360
|
+
record_update: writeFn(
|
|
361
|
+
'Change some fields of one record in place, keeping the rest; the merged value is checked against the type.',
|
|
362
|
+
'Use it when the person changes a few fields of a record (a grid edit, "mark it done"): give its id and only the fields that change in `set`. Pass the version you read as `expect` so a change made meanwhile is refused rather than lost; without it the version it reads now is used.',
|
|
363
|
+
HUB_DATA_ENDPOINTS.record_update,
|
|
364
|
+
[{ args: { type: 'tasks/Task', id: 'rec_01HZX3', set: { done: true }, expect: 3 }, note: 'Mark a task done, if nobody changed it since version 3.' }],
|
|
365
|
+
),
|
|
366
|
+
record_remove: writeFn(
|
|
367
|
+
'Remove a record of a stored type; its history stays.',
|
|
368
|
+
'Use it only when the person asks to delete a record. Say what you removed; its versions can still be read with hub/record_versions.',
|
|
369
|
+
HUB_DATA_ENDPOINTS.record_remove,
|
|
370
|
+
[{ args: { type: 'notes/Note', id: 'rec_01HZX3' } }],
|
|
371
|
+
[],
|
|
372
|
+
changes('remove', 'records'),
|
|
373
|
+
),
|
|
374
|
+
} satisfies Record<HubDataFnName, unknown>;
|
|
375
|
+
|
|
376
|
+
/** The hub's write fns on resources, context and memory (`HUB_WRITE_ENDPOINTS`). */
|
|
377
|
+
const writeFns = {
|
|
378
|
+
resource_convert: writeFn('Make another form of a resource now (a document as markdown, a description of an image, the text read from an image, a transcript of audio); it may cost a model call.', 'Use it only when hub/resource_read says the form you need is missing (an image never described, audio not transcribed). It is not needed to look at an image: hub/resource_send shows you the image itself. Some forms need a model an admin has set up (describing images, reading text in them); when one is not set up it is refused with why: use hub/resource_send for an image instead, or tell the person.', HUB_WRITE_ENDPOINTS.resource_convert, [{ args: { uri: 'hub://resources/uploads/2026-11-22/report.pdf', kind: 'markdown' }, note: 'An uploaded PDF as markdown.' }]),
|
|
379
|
+
resource_import: writeFn('Import a URL or uploaded content as a hub resource, kept and converted by the hub.', 'Use it to keep a URL or an upload as a hub resource so it can be read, searched and linked later. It returns the uri; read it with hub/resource_read.', HUB_WRITE_ENDPOINTS.resource_import, [{ args: { url: 'https://example.com/docs', render: 'auto' }, note: 'A web page, kept as a hub resource.' }], [OWN_TAG], changes('create', 'resources')),
|
|
380
|
+
resource_rename: writeFn('Rename a hub resource.', 'Use it when the person asks to rename a hub resource. Only hub resources (imports, uploads) can be renamed; a system\'s files are renamed through that system (fs).', HUB_WRITE_ENDPOINTS.resource_rename, [{ args: { uri: 'hub://resources/notes.md', name: 'meeting-notes.md' } }], [], changes('update', 'resources')),
|
|
381
|
+
resource_delete: writeFn('Delete a hub resource; says how many messages, context items and runs still point at it.', 'Use it only when the person asks to delete a hub resource. It reports how many messages, context items and runs still point at it: tell the person, since those links will show as gone.', HUB_WRITE_ENDPOINTS.resource_delete, [{ args: { uri: 'hub://resources/old.md' } }], [], changes('remove', 'resources')),
|
|
382
|
+
ctx_from_resource: writeFn('Make context items from a resource (one per section, under an outline parent), or update the ones made before.', 'Use it to turn a document the person wants kept as knowledge (a guide, a spec) into context items, one per section; run it again after the document changes to update them.', HUB_WRITE_ENDPOINTS.ctx_from_resource, [{ args: { uri: 'file:///repo/STYLE.md', copy: 'live', tags: ['style'] }, note: 'A style guide kept in step with its file.' }], [], [...changes('create', 'context'), ...changes('update', 'context')]),
|
|
383
|
+
remember: writeFn('Keep a fact for later as a memory (a context item): for this chat, for the person in all their chats, or for everyone.', 'Use it when the person asks you to remember something, and when they mention, even in passing while you work on something else, a lasting fact about themselves that will matter in a later chat (a preference, a limit or something to avoid, where they are, who is around them, a routine): keep it in the same step as the work and carry on. Not for what matters only to the task at hand, nor for each answer to a form or entry of a list. Choose `scope`: `session` (this chat only), `user` (the person, in every chat of theirs: the usual choice for a lasting fact about them) or `everyone` (only when they say so). One fact per memory, in a plain sentence, with a short `title`; never a password or other secret. Leave out the other args unless you need them: `about` links the memory to an item it is about (`{ "kind": "fn", "name": "database/main.tasks_create" }`; for a resource `{ "kind": "resource", "uri": … }`, with `section` only to point at one section); `command` (lower-case words joined by `-`) makes the memory the person\'s own `/command`: they type `/<command>` and its text comes with their message, a quick way to ask for something they will ask for again (then `text` is the request, in their words). In a later chat the memories closest to a message come with it (in `<loaded_for_you>`); others are found by search (hub/ctx_search with `origins: ["memory"]`). It answers with the memory\'s name.', HUB_WRITE_ENDPOINTS.remember, [{ args: { text: 'Reports go out on Fridays.', scope: 'user', title: 'Report day' }, note: 'A fact about the person, for every session of theirs.' }], [], changes('create', 'context')),
|
|
384
|
+
forget: writeFn('Forget a memory.', 'Use it when the person asks you to forget something, or a memory is wrong. Find the memory first (hub/ctx_search with `origins: ["memory"]`) and forget it by its name.', HUB_WRITE_ENDPOINTS.forget, [{ args: { name: 'memory/report-day-1a2b3c4d' } }], [], changes('update', 'context')),
|
|
385
|
+
} satisfies Record<HubWriteFnName, unknown>;
|
|
386
|
+
|
|
387
|
+
/** A person's write fns (`HUB_PERSON_ENDPOINTS`): each asks unless a policy allows it. */
|
|
388
|
+
const personFns = {
|
|
389
|
+
session_create: writeFn('Start a chat session for the person, with an agent and the systems it may use.', 'Use it when the person asks for a fresh conversation, or one with only some systems. It returns the session; tell the person its title.', HUB_PERSON_ENDPOINTS.session_create, [{ args: { title: 'Quarterly report', systems: ['database', 'fs'] }, note: 'A session that uses two systems only.' }]),
|
|
390
|
+
session_update: writeFn('Change a session: its title, systems, agent, priority, model, chat mode or contextor, or archive it.', 'Use it when the person asks to rename, archive or reconfigure a session. Give only the fields that change.', HUB_PERSON_ENDPOINTS.session_update, [{ args: { session: 'ses_01HZX3', title: 'Q3 report' } }, { args: { session: 'ses_01HZX3', archived: true }, note: 'Archive it.' }]),
|
|
391
|
+
session_delete: writeFn('Delete a session and its messages.', 'Use it only when the person asks to delete a session by name; it can\'t be undone, so say which session first.', HUB_PERSON_ENDPOINTS.session_delete, [{ args: { session: 'ses_01HZX3' } }]),
|
|
392
|
+
run_background: writeFn('Move a running run to the background, so the chat can go on while it works.', 'Use it for a long run the person need not wait for; check on it later with hub/run_status.', HUB_PERSON_ENDPOINTS.run_background, [{ args: { run: 'run_01HZX3' } }]),
|
|
393
|
+
turn_undo: writeFn('Undo what one message\'s runs did, where their fns can undo, and take the message out of the chat.', 'Messages are undone newest first: one can only be undone while no later message in its chat stands, so from inside a chat this can\'t undo an earlier message of the same chat (the message you are answering is later). When the person asks to take back an earlier message, tell them to use Undo on that message in the chat (it undoes what came after it too), or reverse the one change with the fn that changes it back. It reports what was undone and what could not be.', HUB_PERSON_ENDPOINTS.turn_undo, [{ args: { turn: 'trn_01HZX3' } }]),
|
|
394
|
+
memory_update: writeFn('Change a memory: its text, title, weight, tags, the fns it brings or where it applies.', 'Use it to correct or narrow a memory rather than forgetting it and remembering again. Give its name and only what changes.', HUB_PERSON_ENDPOINTS.memory_update, [{ args: { name: 'hub/memory.report-day', text: 'Reports go out on Thursdays.' } }], [], changes('update', 'context')),
|
|
395
|
+
ctx_link: writeFn('Link a context item to another item (context, fn, type or resource), with a relation and weight.', 'Use it to say what a context item imports, brings or relates to, so it loads with its context and fns. `imports` and `brings` always load with it.', HUB_PERSON_ENDPOINTS.ctx_link, [{ args: { from: 'hub/memory.report-day', to: { kind: 'fn', name: 'database/sales_by_month' }, relation: 'brings', weight: 1 }, note: 'A memory that brings the fn its work needs.' }], [], changes('update', 'context')),
|
|
396
|
+
ctx_unlink: writeFn('Remove one link from a context item.', 'Use it when a link is wrong or no longer needed; give the link\'s target key and relation as hub/ctx_get shows them.', HUB_PERSON_ENDPOINTS.ctx_unlink, [{ args: { from: 'hub/memory.report-day', toKey: 'fn:database/sales_by_month', relation: 'brings' } }], [], changes('update', 'context')),
|
|
397
|
+
access_set: writeFn('Set who may see a system, fn, context item, resource root or connection: private, shared with some, or public.', 'Use it when the person asks to share something or make it private. Only its owner or an admin may change it; say who will see it after.', HUB_PERSON_ENDPOINTS.access_set, [{ args: { target: { kind: 'fn', fn: 'input/project_details' }, sharing: { visibility: 'shared', with: ['act_01HZX3'] } }, note: 'Share a saved form with one person.' }]),
|
|
398
|
+
connection_update: writeFn('Change one of the person\'s connected accounts: its settings, which fns use it, or who it is shared with.', 'Use it when the person asks to change how a connected account is used. Never show its credentials.', HUB_PERSON_ENDPOINTS.connection_update, [{ args: { connection: 'cnx_01HZX3', share: { visibility: 'private', with: [] } }, note: 'Stop sharing it.' }], [], changes('update', 'connections')),
|
|
399
|
+
connection_disconnect: writeFn('Disconnect one of the person\'s connected accounts.', 'Use it only when the person asks to disconnect an account; the fns that act as them stop working until they connect again.', HUB_PERSON_ENDPOINTS.connection_disconnect, [{ args: { connection: 'cnx_01HZX3' } }], [], changes('remove', 'connections')),
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
/** The explorer's reads (`HUB_EXPLORE_ENDPOINTS`), tagged `read`. */
|
|
403
|
+
const exploreFns = {
|
|
404
|
+
explore_roots: readFn('The roots one system instance serves files from (folders, sites), live.', 'Use it first to see where a system keeps its files, then list a root with hub/explore_list. Nothing is copied into the hub.', HUB_EXPLORE_ENDPOINTS.explore_roots, [{ args: { system: 'fs', instance: 'main' } }]),
|
|
405
|
+
explore_list: readFn('What a folder holds, live from the system that serves it, a page at a time.', 'Use it to walk a folder you got from hub/explore_roots or an earlier listing; page with `cursor`. To find files by what they say, use hub/search_resources.', HUB_EXPLORE_ENDPOINTS.explore_list, [{ args: { uri: 'file:///repo/docs' } }]),
|
|
406
|
+
explore_read: readFn('One file\'s text (or its bytes by content ref) or its links, live from the system that serves it, without keeping it in the hub.', 'Use it to look at a file a system serves while browsing, or when hub/resource_read has no text form of it (a PDF on disk): it asks the serving system for the text. To keep and search it later, import it with hub/resource_import.', HUB_EXPLORE_ENDPOINTS.explore_read, [{ args: { uri: 'file:///repo/README.md', want: ['text'] } }]),
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
/** The admin pages' reads (`ADMIN_READ_ENDPOINTS`), tagged `admin` and `read`. */
|
|
410
|
+
const adminReadFns = {
|
|
411
|
+
budgets_list: adminReadFn('Every budget rule with what it has spent so far.', 'Use it before changing a budget, or to say why a call was refused or is waiting.', ADMIN_READ_ENDPOINTS.budgets_list, [{ args: {} }]),
|
|
412
|
+
policies_list: adminReadFn('Every policy: who it is for, which fns, and whether they run, ask or are refused.', 'Use it to explain why a fn asks or is refused, and before adding a policy that might clash.', ADMIN_READ_ENDPOINTS.policies_list, [{ args: {} }]),
|
|
413
|
+
priority_rules_list: adminReadFn('Every priority rule: the default and highest priority of the hub, groups, people and sessions.', 'Use it before changing priorities, or to say why work waits.', ADMIN_READ_ENDPOINTS.priority_rules_list, [{ args: {} }]),
|
|
414
|
+
providers_list: adminReadFn('The model providers set up, with how many models each offers.', 'Use it to check a provider is set up before choosing its models. Keys are never shown.', ADMIN_READ_ENDPOINTS.providers_list, [{ args: {} }]),
|
|
415
|
+
actors_list: adminReadFn('People, groups, agents, systems and hub MCPs the hub knows, optionally of one kind.', 'Use it to find a person\'s or group\'s id before sharing, adding a policy or a budget.', ADMIN_READ_ENDPOINTS.actors_list, [{ args: { kind: 'user' }, note: 'Every person.' }]),
|
|
416
|
+
actor_settings_list: adminReadFn('The settings systems declare, and the values set for people and groups.', 'Use it before changing a setting with hub/set_actor_setting.', ADMIN_READ_ENDPOINTS.actor_settings_list, [{ args: {} }]),
|
|
417
|
+
mcps_list: adminReadFn('The hub MCPs: what each exposes, for whom, and whether it is on.', 'Use it before creating or changing a hub MCP.', ADMIN_READ_ENDPOINTS.mcps_list, [{ args: {} }]),
|
|
418
|
+
mcp_sessions_list: adminReadFn('The clients connected to one hub MCP now.', 'Use it to see who uses a hub MCP before switching it off.', ADMIN_READ_ENDPOINTS.mcp_sessions_list, [{ args: { mcp: 'mcp_01HZX3' } }]),
|
|
419
|
+
pairings_list: adminReadFn('Pairing requests, newest first, optionally of one status.', 'Use it to find a waiting pairing to approve with hub/approve_pairing.', ADMIN_READ_ENDPOINTS.pairings_list, [{ args: { status: 'pending' } }]),
|
|
420
|
+
auto_pairs_list: adminReadFn('The auto-pair secrets granted, optionally for one system.', 'Use it before revoking one with hub/auto_pair_revoke.', ADMIN_READ_ENDPOINTS.auto_pairs_list, [{ args: { system: 'fs' } }]),
|
|
421
|
+
instances_list: adminReadFn('One system\'s instances, with their status, version, config (secrets masked) and host.', 'Use it to see every copy of a system and who hosts each.', ADMIN_READ_ENDPOINTS.instances_list, [{ args: { system: 'database' } }]),
|
|
422
|
+
suggest_decision_get: adminReadFn('The suggestions setting: who picks what each message is offered (a decision model, an LLM, or none: the best by similarity over the threshold), and its limits.', 'Use it before changing it with hub/suggest_decision_set.', ADMIN_READ_ENDPOINTS.suggest_decision_get, [{ args: {} }]),
|
|
423
|
+
search_decision_get: adminReadFn('The search decisions: who filters search hits before they are returned, for fns and for context (none, a decision model or an LLM).', 'Use it before changing one with hub/search_decision_set.', ADMIN_READ_ENDPOINTS.search_decision_get, [{ args: {} }]),
|
|
424
|
+
ctx_injections_list: adminReadFn(
|
|
425
|
+
'What is injected into agents\' system prompts: for each agent (a fn that runs a model, such as hub/chat), the context items and hook notes the hub puts into its instructions, in order, each with its text as the model reads it, its tokens, whether an admin left it on for that agent, and why it is left out if it is (switched off, waiting for review, declined, its system off, its fns unusable, the other chat mode, replaced by another item, or no room).',
|
|
426
|
+
'Use it when an admin asks what an agent is told, why an agent knows or does not know something, or before switching an item with hub/ctx_injection_set. Give `agent` for one agent\'s list, `context` for one item in every agent it reaches (the answer then also lists its targets and the agents each hits), or both. Each entry\'s `via` is the target that took it in (an agent\'s name or a pattern such as `hub/chat*`). It shows what a new chat with that agent would be told, every system on; give `mode` (`tools` or `static`) or `fnMode` (`read`, `write`, `delete`, `none`) to see it as a chat with that setting gets it. Tokens are estimates.',
|
|
427
|
+
ADMIN_READ_ENDPOINTS.ctx_injections_list,
|
|
428
|
+
[
|
|
429
|
+
{ args: { agent: 'hub/chat' }, note: 'Everything the chat agent is told, in order.' },
|
|
430
|
+
{ args: { context: 'input/asking' }, note: 'One item: which agents get it, and how it reads in each.' },
|
|
431
|
+
{ args: { agent: 'hub/chat', fnMode: 'read' }, note: 'What the chat agent is told in a chat that may only read.' },
|
|
432
|
+
],
|
|
433
|
+
),
|
|
434
|
+
};
|
|
435
|
+
|
|
436
|
+
/** The hub's admin fns (`ADMIN_ENDPOINTS`), each described for the agent that offers them. */
|
|
437
|
+
const adminFns = {
|
|
438
|
+
configure_provider: adminFn('Add a model provider (OpenAI, OpenRouter, Ollama) with its API key, or replace its key. The key is stored encrypted.', 'Use it when an admin gives a provider key. Never repeat the key back or put it in a message; say only that it was stored.', ADMIN_ENDPOINTS.configure_provider, [{ args: { provider: 'ollama', baseURL: 'http://127.0.0.1:11434' }, note: 'A local Ollama.' }], changes('update', 'secrets')),
|
|
439
|
+
set_model_category: adminFn('Add a model category (a named, ordered list of models), or change the one with this id.', 'Use it to group models for a purpose (fast, cheap, best). Order matters: the first available model is tried first.', ADMIN_ENDPOINTS.set_model_category, [{ args: { name: 'small', description: 'Fast local models.', models: ['qwen2.5:3b'] } }]),
|
|
440
|
+
set_budget: adminFn('Add a spending budget for the hub, a group, a user, a session, a system, a fn or a model, or change the one with this id.', 'Use it when an admin sets a spending limit. Say the scope and period back in plain words, since a low budget stops runs.', ADMIN_ENDPOINTS.set_budget, [{ args: { target: { scope: 'system', system: 'web' }, period: 'per-turn', maxCost: 0.5, onLimit: 'ask' }, note: 'Fifty cents a message for one system.' }]),
|
|
441
|
+
set_priority: adminFn('Add a priority rule (the default and highest priority of turns at a level), or change the one with this id.', 'Use it when an admin wants some turns to run before others (a group\'s work first).', ADMIN_ENDPOINTS.set_priority, [{ args: { target: { scope: 'hub' }, default: 'normal', max: 'interactive' } }]),
|
|
442
|
+
set_policy: adminFn('Add a policy saying whether actors may run fns (allow, deny, or ask an approver), or change the one with this id.', 'Use it when an admin decides who may run which fns. `subject` is who: `{ "actor": … }`, `{ "group": … }`, `{ "kind": "user" }` or `{ "everyone": true }`. `target` is which fns, and every field given must match: `fn` (a fn\'s name as your tools spell it, or a glob over names such as `fs/*`, every fs fn), `system`, `kind` (`native` or a system\'s kind such as `database/query`; `*` is not a kind: leave `kind` out to cover every kind), `tags` (fns carrying all of these tags, such as `["admin"]`). There is no target for "every fn that deletes" or "everything that costs money": name the fns or systems. `decision` is `{ "effect": "allow" }`, `{ "effect": "deny", "reason": … }` or `{ "effect": "ask", "approver": { "by": "turn-user" } }`. Deny beats ask beats allow, and a narrower match beats a broader one; with no policy, fns tagged read run and the rest ask the person. Prefer ask over allow for fns that write or delete. Before saving, tell the person in plain words exactly which fns the rule covers (a glob or a system also covers fns added later that match it, a fn\'s name only that fn).', ADMIN_ENDPOINTS.set_policy, [{ args: { description: 'Members may read files without asking.', subject: { kind: 'user' }, target: { fn: 'fs/read' }, decision: { effect: 'allow' }, priority: 10 } }]),
|
|
443
|
+
set_actor_setting: adminFn('Set a setting a system declares for a user, group or agent.', 'Use it to set a system\'s declared setting for a user, group or agent. Read the setting\'s type first (hub/system_get) so the value fits.', ADMIN_ENDPOINTS.set_actor_setting, [{ args: { setting: 'fs/editor', actor: 'act_01HZX3', value: 'vim' } }]),
|
|
444
|
+
add_user: adminFn('Add a person who can sign in, with their role and groups.', 'Use it when an admin adds a person. Give the lowest role that does the job, and say what the role allows. It only adds the account: it sends no email, invitation or sign-in link, so never say one was sent; how the person signs in follows the hub\'s sign-in settings, which you know only from what a result or guide says.', ADMIN_ENDPOINTS.add_user, [{ args: { email: 'ann@example.com', name: 'Ann', role: 'member' } }]),
|
|
445
|
+
add_group: adminFn('Add a group of people.', 'Use it to make a group before adding people or rules to it.', ADMIN_ENDPOINTS.add_group, [{ args: { name: 'Finance', about: 'The finance team.' } }]),
|
|
446
|
+
update_user: adminFn('Change a person: their name, their role (admin or member), or whether they can sign in.', 'Use it when an admin renames a person, changes their role or turns their sign-in off or back on. Turning sign-in off signs them out everywhere. The break-glass admin always stays an enabled admin, and a role a sign-in provider manages is set again at their next sign-in.', ADMIN_ENDPOINTS.update_user, [{ args: { user: 'act_01HZX3', role: 'admin' }, note: 'Make Ann an admin.' }, { args: { user: 'act_01HZX3', disabled: true }, note: 'Sign Ann out and keep her out.' }]),
|
|
447
|
+
set_membership: adminFn('Put a person in a group, or take them out.', 'Use it to change who is in a group. A group a sign-in provider syncs from its claims is set again at the person\x27s next sign-in.', ADMIN_ENDPOINTS.set_membership, [{ args: { group: 'act_01HZX4', user: 'act_01HZX3', member: true }, note: 'Add Ann to Finance.' }]),
|
|
448
|
+
set_sign_in_policy: adminFn('Set who may make an account by signing in through a sign-in provider for the first time: only invited people, people at some email domains, or anyone.', 'Use it when an admin decides who can join through single sign-on. Invite only is the safest; say back what the choice lets in.', ADMIN_ENDPOINTS.set_sign_in_policy, [{ args: { mode: 'invite' }, note: 'Only people an admin added.' }, { args: { mode: 'domains', domains: ['example.com'] }, note: 'Anyone with a verified example.com email.' }]),
|
|
449
|
+
set_sign_in_limits: adminFn('Set how many password sign-ins the hub takes: tries for one email from one address, and tries from one address in all, each in a time window (ms).', 'Use it when an admin wants sign-in guessing slowed down more or less. Lower limits are safer; say back how many tries each allows and over how long.', ADMIN_ENDPOINTS.set_sign_in_limits, [{ args: { account: { limit: 10, window: 900000 }, address: { limit: 100, window: 900000 } }, note: 'The defaults: per address, 10 tries for one email and 100 in all every 15 minutes.' }]),
|
|
450
|
+
set_proxy_trust: adminFn('Set how many proxies in front of the hub say where requests come from (X-Forwarded-For); 0 means none, and the connection\'s own address counts.', 'Use it only when an admin says the hub runs behind a reverse proxy. Trusting a proxy that isn\'t there lets anyone pick the address their requests seem to come from.', ADMIN_ENDPOINTS.set_proxy_trust, [{ args: { proxies: 1 }, note: 'One reverse proxy (nginx, Caddy) in front of the hub.' }, { args: { proxies: 0 }, note: 'No proxy: the default.' }]),
|
|
451
|
+
remove_rule: adminFn('Remove a budget, priority rule, policy, model category or provider.', 'Use it only when an admin asks to remove a rule; say what stops applying once it is gone.', ADMIN_ENDPOINTS.remove_rule, [{ args: { kind: 'policy', id: 'pol_01HZX3' } }]),
|
|
452
|
+
approve_pairing: adminFn('Approve or refuse a system that asked to pair with the hub, optionally naming its instance and setting its config.', 'Use it when an admin approves or refuses a waiting system. Name the instance when there are several of one system, and set its config here if it needs one to start.', ADMIN_ENDPOINTS.approve_pairing, [{ args: { pairing: 'par_01HZX3', approve: true }, note: 'The code on the system matches.' }]),
|
|
453
|
+
create_pairing_token: adminFn('Make a one-time pairing token a new system can pair with, optionally for one system name.', 'Use it to let a new system pair. The token is shown once: give it to the admin and do not repeat it later.', ADMIN_ENDPOINTS.create_pairing_token, [{ args: { name: 'notes', expiresIn: 600000 }, note: 'A ten-minute token for one system.' }]),
|
|
454
|
+
configure_system: adminFn('Set a system\'s config; refused unless it fits the system\'s config type.', 'Use it to set a system\'s config. Read its config type first (hub/system_get); secret fields are kept encrypted and never shown back.', ADMIN_ENDPOINTS.configure_system, [{ args: { system: 'database', config: { url: 'sqlite:./data.db' } } }]),
|
|
455
|
+
enable_system: adminFn('Turn a system\'s functions, its renderers and all of its context on or off.', 'Use it to turn a system\'s fns, renderers or all of its context on or off without removing it. To switch one fn or context item, use hub/switch_item.', ADMIN_ENDPOINTS.enable_system, [{ args: { system: 'web', functions: false }, note: 'Switch off its fns, keep its renderers.' }, { args: { system: 'fs', context: false }, note: 'Leave all of fs\'s context out of chats; its fns still work.' }], changes('update', 'fns', 'context')),
|
|
456
|
+
switch_item: adminFn('Turn one fn or context item of a system on or off.', 'Use it when an admin asks to switch a single fn or context item off or back on. A fn switched off cannot run; a context item switched off is never selected, searched or loaded. To switch a whole system, use hub/enable_system.', ADMIN_ENDPOINTS.switch_item, [{ args: { section: 'fns', name: 'fs/delete', on: false }, note: 'Stop fs/delete from running.' }, { args: { section: 'context', name: 'fs/guide', on: true }, note: 'Bring a context item back.' }], changes('update', 'fns', 'context')),
|
|
457
|
+
remove_system: adminFn('Remove a system; its fns become unavailable until it pairs again.', 'Use it only when an admin asks to remove a system; its fns stop working until it pairs again. To pause it, use hub/enable_system instead.', ADMIN_ENDPOINTS.remove_system, [{ args: { system: 'random' } }], changes('update', 'fns')),
|
|
458
|
+
install_system: adminFn('Install a system from a folder, a package or a git repository, and start it.', 'Use it when an admin asks to install a system from a folder, a package or a git URL. It starts the system; pairing may still need approval.', ADMIN_ENDPOINTS.install_system, [{ args: { source: { package: '@acme/notes', version: '1.2.0' } } }], changes('create', 'fns', 'types', 'context', 'kinds', 'components')),
|
|
459
|
+
start_system: adminFn('Start an installed system.', 'Use it to start an installed system that is stopped, then check hub/system_get to see that it connected.', ADMIN_ENDPOINTS.start_system, [{ args: { system: 'fs' } }]),
|
|
460
|
+
stop_system: adminFn('Stop an installed system.', 'Use it to stop an installed system; its fns are unavailable until it starts again.', ADMIN_ENDPOINTS.stop_system, [{ args: { system: 'fs' } }]),
|
|
461
|
+
restart_system: adminFn('Restart a system instance, with the reason.', 'Use it when a system is stuck or after changing something it reads only at start. A system installed from the chat is restarted by its host with the approved code as it is. Say why in `reason`; it is kept in the log.', ADMIN_ENDPOINTS.restart_system, [{ args: { system: 'random', reason: 'it stopped answering' } }]),
|
|
462
|
+
upgrade_system: adminFn('Upgrade an installed system to a version (the latest when none is given).', 'Use it to move an installed system to a newer version; name the version when the admin asks for one.', ADMIN_ENDPOINTS.upgrade_system, [{ args: { system: 'web' }, note: 'To the newest version.' }], changes('update', 'fns', 'types', 'context', 'kinds', 'components')),
|
|
463
|
+
set_model_role: adminFn('Choose the model (and provider) for a job: chat, transcription, dictation (or the browser\'s own), speech, describing images, reading text in them.', 'Use it when an admin picks the model for a job. Check the current choices with hub/model_roles first.', ADMIN_ENDPOINTS.set_model_role, [{ args: { role: 'chat', model: { model: 'qwen2.5:3b' }, provider: 'ollama' } }]),
|
|
464
|
+
clear_model_role: adminFn('Clear a job\'s model choice, so it falls back to the hub\'s default (or is off).', 'Use it to undo a job\'s model choice so the hub\'s default applies again.', ADMIN_ENDPOINTS.clear_model_role, [{ args: { role: 'describe' } }]),
|
|
465
|
+
set_model_limits: adminFn('Set a model\'s context window, output limit, reasoning reserve or characters per token; with every field absent, clear them.', 'Use it when a model\'s known limits are wrong (answers cut, prompts refused). Leave every field empty to go back to the limits the hub found.', ADMIN_ENDPOINTS.set_model_limits, [{ args: { model: 'qwen2.5:3b', limits: { contextWindow: 32768 } } }]),
|
|
466
|
+
create_mcp: adminFn('Make a hub MCP: an MCP endpoint with its own route and secret, exposing the systems, fns, types, context and resources its rules include.', 'Use it to expose part of the hub to an MCP client. Include only what the admin asked for, and check it first with hub/preview_mcp.', ADMIN_ENDPOINTS.create_mcp, [{ args: { slug: 'notes', name: 'Notes', instructions: 'Read and search notes.', rules: { include: { systems: ['notes'] }, exclude: {} }, toolMode: 'each', user: 'act_01HZX3', grantees: [], origins: [], enabled: true } }]),
|
|
467
|
+
update_mcp: adminFn('Change a hub MCP\'s name, rules, tool mode or person, or turn it on or off.', 'Use it to change a hub MCP; preview rule changes with hub/preview_mcp first.', ADMIN_ENDPOINTS.update_mcp, [{ args: { mcp: 'mcp_01HZX3', enabled: false }, note: 'Switch one off.' }]),
|
|
468
|
+
rotate_mcp_secret: adminFn('Give a hub MCP a new secret; every open session of it ends.', 'Use it when a hub MCP\'s secret may have leaked. Every open session of it ends, so say so.', ADMIN_ENDPOINTS.rotate_mcp_secret, [{ args: { mcp: 'mcp_01HZX3' } }]),
|
|
469
|
+
delete_mcp: adminFn('Delete a hub MCP.', 'Use it only when an admin asks to delete a hub MCP; its clients stop working.', ADMIN_ENDPOINTS.delete_mcp, [{ args: { mcp: 'mcp_01HZX3' } }]),
|
|
470
|
+
preview_mcp: adminFn('What draft hub MCP rules would expose now, with warnings, before they are saved.', 'Use it before saving hub MCP rules, to show the admin exactly what would be exposed and any warnings.', ADMIN_ENDPOINTS.preview_mcp, [{ args: { rules: { include: { systems: ['fs'] }, exclude: { fns: [{ fn: 'fs/bash' }] } } }, note: 'What an MCP with these rules would expose.' }]),
|
|
471
|
+
install_package: adminFn('Install a system package zip (made by `harness system pack`), pair it, configure it and start it.', 'Use it with a package zip made by `harness system pack`: it installs, pairs, configures and starts the system in one step.', ADMIN_ENDPOINTS.install_package, [{ args: { zip: { hash: '0000000000000000000000000000000000000000000000000000000000000000', size: 2048, mime: 'application/zip' } } }], changes('create', 'fns', 'types', 'context', 'kinds', 'components')),
|
|
472
|
+
add_instance: adminFn('Add an instance of a bundled fleet system (an MCP server, an API service) with its config: installed, paired and started on the hub machine.', 'Use it when an admin asks to add an MCP server or an API service. Ask for the secret fields only when the server needs them, and never repeat them back.', ADMIN_ENDPOINTS.add_instance, [{ args: { system: 'mcp', instance: 'linear', description: 'Linear issues', config: { label: 'Linear', transport: { type: 'http', url: 'https://mcp.linear.app/mcp' }, auth: { kind: 'oauth', per: 'person' } } }, note: 'A remote MCP server people sign in to.' }], changes('create', 'fns', 'types', 'context')),
|
|
473
|
+
remove_instance: adminFn('Remove one instance of a system.', 'Use it only when an admin asks to remove one instance of a system. Offer hub/export_system_data first so its data can be kept.', ADMIN_ENDPOINTS.remove_instance, [{ args: { system: 'database', instance: 'old' } }], changes('remove', 'fns', 'types')),
|
|
474
|
+
suggest_decision_set: adminFn('Choose who picks what each message is offered: none (no model: the best by similarity over the threshold), a decision model (one yes/no question per candidate, the decide role\'s threshold), or an LLM; how many candidates it sees and picks; and a model\'s action: suggest (cards the chat model may load, the default) or load (what it picks is loaded for the turn: fns join the tools, context is brought into the message).', 'Use it when an admin wants a model to pick what each message is offered, or to let the score alone decide. An LLM needs a model; a decision model uses the decide role\'s unless one is named. Set action load only when the admin wants the picks loaded without the chat model asking; none (the score alone) only suggests, and context that doesn\'t fit the prompt\'s room is suggested instead.', ADMIN_ENDPOINTS.suggest_decision_set, [
|
|
475
|
+
{ args: { by: 'none' }, note: 'Let the score decide again.' },
|
|
476
|
+
{ args: { by: 'decision', messages: 3, candidates: 20, cap: 6, floor: 0.2 }, note: 'The decide role\'s decision model picks; its picks are suggested.' },
|
|
477
|
+
{ args: { by: 'decision', messages: 3, candidates: 20, cap: 6, floor: 0.2, action: 'load' }, note: 'The decide role\'s decision model picks, and what it picks is loaded for the turn.' },
|
|
478
|
+
]),
|
|
479
|
+
search_decision_set: adminFn('Choose who filters search hits before they are returned, for fns or for context: none (as ranked), a decision model (one yes/no question per hit, kept at the decide role\'s threshold) or an LLM; and a model\'s action: suggest (the kept hits are returned, the default) or load (hub/fns_search, for fns, and hub/ctx_search, for context, in a chat also load the best kept hits, up to the hub\'s limit, and say so).', 'Use it when an admin wants searches (hub/fns_search, hub/ctx_search and the web\'s) to drop hits that don\'t fit what was searched for, or to have the model\'s searches load what fits. Set fns and context apart; an LLM needs a model, a decision model uses the decide role\'s unless one is named. Each filter call is a model call charged to the run that searched; the web\'s search only filters.', ADMIN_ENDPOINTS.search_decision_set, [
|
|
480
|
+
{ args: { item: 'fn', value: { by: 'decision' } }, note: 'The decide role\'s decision model filters fn hits.' },
|
|
481
|
+
{ args: { item: 'context', value: { by: 'none' } }, note: 'Context hits as ranked again.' },
|
|
482
|
+
{ args: { item: 'fn', value: { by: 'decision', action: 'load' } }, note: 'The decision model filters fn hits, and hub/fns_search loads the best kept ones.' },
|
|
483
|
+
{ args: { item: 'context', value: { by: 'decision', action: 'load' } }, note: 'The decision model filters context hits, and hub/ctx_search loads the best kept ones.' },
|
|
484
|
+
]),
|
|
485
|
+
auto_pair_revoke: adminFn('Revoke an auto-pair secret, so its instance must pair again by code or token.', 'Use it when a machine is lost or retired; find the secret with hub/auto_pairs_list.', ADMIN_ENDPOINTS.auto_pair_revoke, [{ args: { id: 'apk_01HZX3' } }]),
|
|
486
|
+
system_reimport: adminFn('Import a system\'s stored contract again, re-checking every entry.', 'Use it after a hub upgrade or when a system\'s fns look stale; it reports what was added, updated, removed or refused.', ADMIN_ENDPOINTS.system_reimport, [{ args: { system: 'database' } }], changes('update', 'fns', 'types', 'context', 'kinds')),
|
|
487
|
+
export_system_data: adminFn('Zip an instance\'s data folder with its config (secret fields only when asked) and return the content.', 'Use it to back up an instance before removing or moving it. Include secret fields only when the admin asks.', ADMIN_ENDPOINTS.export_system_data, [{ args: { system: 'database', instance: 'main' } }]),
|
|
488
|
+
ctx_injection_set: adminFn(
|
|
489
|
+
'Switch one injected item off or back on for one agent, or move it earlier or later in that agent\'s instructions. Other agents keep it as they had it.',
|
|
490
|
+
'Use it when an admin asks to stop telling an agent something (or to tell it again), or to change where an item sits in what the agent is told. Find the agent and item names with hub/ctx_injections_list first. `on: false` leaves the item out of that agent\'s prompt from its next turn (its fns stop being added with it); `order` is a number from 0 to 1000, lower first (the hub\'s own items sit at 10 to 30, systems\' at 100 by default); `order: null` goes back to the item\'s own order. It answers the item as that agent now gets it.',
|
|
491
|
+
ADMIN_ENDPOINTS.ctx_injection_set,
|
|
492
|
+
[
|
|
493
|
+
{ args: { agent: 'hub/chat', context: 'hub/limits', on: false }, note: 'Stop telling the chat agent what the app can\'t do.' },
|
|
494
|
+
{ args: { agent: 'hub/chat_small', context: 'input/asking', order: 20 }, note: 'Move an item near the start for the small chat agent.' },
|
|
495
|
+
{ args: { agent: 'hub/chat', context: 'input/asking', on: true, order: null }, note: 'Back on, at its own order.' },
|
|
496
|
+
],
|
|
497
|
+
),
|
|
498
|
+
} satisfies Record<AdminFnName, unknown>;
|
|
499
|
+
|
|
500
|
+
/** Which model an agent or an LLM call uses: a model id, a category, or automatic selection by weights. */
|
|
501
|
+
export const ModelChoiceType = g.or([
|
|
502
|
+
g.obj({ model: g.text({ minLength: 1 }) }),
|
|
503
|
+
g.obj({ category: g.text({ minLength: 1 }) }),
|
|
504
|
+
g.obj({ auto: g.obj({ cost: g.optional(g.num({ min: 0 })), speed: g.optional(g.num({ min: 0 })), accuracy: g.optional(g.num({ min: 0 })) }) }),
|
|
505
|
+
]);
|
|
506
|
+
|
|
507
|
+
/** A chat mode's settings, as a gin type: core's `ChatModeConfig` input (defaults may be left out). */
|
|
508
|
+
export const ChatModeType = ginAs(ChatModeConfig);
|
|
509
|
+
/** A contextor's settings, as a gin type: core's `ContextorConfig` input (defaults may be left out). */
|
|
510
|
+
export const ContextorType = ginAs(ContextorConfig);
|
|
511
|
+
|
|
512
|
+
/** The payload of a `hub/llm` fn: an agent's instructions, model, tools, context, mode and limits. Built by `agent()`. */
|
|
513
|
+
export const LlmPayloadType = g.obj({
|
|
514
|
+
/** Handlebars; `{{args.x}}` reads the args. */
|
|
515
|
+
instructions: g.text(),
|
|
516
|
+
model: g.optional(ModelChoiceType),
|
|
517
|
+
/** Qualified fn names. */
|
|
518
|
+
tools: g.list(g.text()),
|
|
519
|
+
/** Fns the agent may add to its toolset while running. */
|
|
520
|
+
canLoad: g.or([
|
|
521
|
+
g.literal('none'),
|
|
522
|
+
g.obj({ fns: g.optional(g.list(g.text())), systems: g.optional(g.list(g.text())), tags: g.optional(g.list(g.text())) }),
|
|
523
|
+
]),
|
|
524
|
+
maxTools: g.num({ min: 1, whole: true }),
|
|
525
|
+
/** Qualified context names, always loaded. */
|
|
526
|
+
context: g.list(g.text()),
|
|
527
|
+
/** Qualified hook names to run on each user message. */
|
|
528
|
+
hooks: g.list(g.text()),
|
|
529
|
+
toolExecution: g.enum(['parallel', 'sequential']),
|
|
530
|
+
maxIterations: g.num({ min: 1, whole: true }),
|
|
531
|
+
/** How fns reach the model (strict tools or the static toolset); the hub's default (`tools`) when absent. A session may override it. */
|
|
532
|
+
mode: g.optional(ChatModeType),
|
|
533
|
+
/** What goes into each prompt (plain, suggest or graph); the hub's default (`plain`) when absent. A session may override it. */
|
|
534
|
+
contextor: g.optional(ContextorType),
|
|
535
|
+
/**
|
|
536
|
+
* The most tokens one answer may take (as core's `ModelLimits.maxOutputTokens`, and never past the model's own
|
|
537
|
+
* limit); the hub's `HARNESS_AGENT_MAX_OUTPUT` when absent.
|
|
538
|
+
*/
|
|
539
|
+
maxOutput: g.optional(ginAs(ModelLimits.shape.maxOutputTokens.unwrap())),
|
|
540
|
+
/**
|
|
541
|
+
* How it takes its injected section (`{{injectedContext}}`): `none`, or its detail (`summary` for a small window) and
|
|
542
|
+
* a cap on the section's tokens. Absent: every item in full, uncapped.
|
|
543
|
+
*/
|
|
544
|
+
injected: g.optional(ginAs(AgentInjected)),
|
|
545
|
+
});
|
|
546
|
+
|
|
547
|
+
/** A failure, as a gin type (the same shape as core's `FnError`). */
|
|
548
|
+
export const FnErrorType = g.obj({
|
|
549
|
+
class: g.enum(ERROR_CLASSES),
|
|
550
|
+
message: g.text(),
|
|
551
|
+
code: g.optional(g.text()),
|
|
552
|
+
data: g.optional(json()),
|
|
553
|
+
});
|
|
554
|
+
|
|
555
|
+
const RunStatusType = g.enum(RUN_STATUSES);
|
|
556
|
+
|
|
557
|
+
/** What `hub/inspect` can show: every kind of item a context link can point at (core's `LinkTarget`). */
|
|
558
|
+
export const FIND_KINDS = LINK_TARGET_KINDS;
|
|
559
|
+
|
|
560
|
+
/** How much of an item the model sees, as a gin type (core's `Detail`). */
|
|
561
|
+
const DetailType = g.enum(DETAIL_LEVELS);
|
|
562
|
+
|
|
563
|
+
/** One name `hub/load` or `hub/unload` could not take, and why. */
|
|
564
|
+
const RefusedName = g.obj({ name: g.text(), reason: g.text() });
|
|
565
|
+
|
|
566
|
+
/** One part of a resource sent to the model (`hub/resource_send`): an LLM message part's kind and name, and its size. */
|
|
567
|
+
const SentPart = ginAs(LlmContentPart.pick({ type: true, name: true }).extend({ chars: z.number().int().min(0) }));
|
|
568
|
+
|
|
569
|
+
/** A fn as `hub/fns_get` gives it. */
|
|
570
|
+
export const StoredFn = g.obj({
|
|
571
|
+
fn: g.fnName(),
|
|
572
|
+
kind: g.text(),
|
|
573
|
+
description: g.text(),
|
|
574
|
+
instructions: g.optional(g.text()),
|
|
575
|
+
payload: g.optional(json()),
|
|
576
|
+
/** 1 for a fn never saved again; the hub keeps every older version. */
|
|
577
|
+
version: g.num({ min: 1, whole: true }),
|
|
578
|
+
/** Who owns it (a saved fn's person); absent for a system's own fns. */
|
|
579
|
+
owner: g.optional(g.text()),
|
|
580
|
+
routing: g.optional(ginAs(FnRouting)),
|
|
581
|
+
/** Whether the run's person can use it now (as `hub/fns_search`'s hits say it); what blocks it when false, in the hub's words. */
|
|
582
|
+
available: g.bool(),
|
|
583
|
+
blocked: g.optional(ginAs(FnBlock)),
|
|
584
|
+
/** Its args type, as the hub describes it (a fn of a kind: as its kind works it out), so a widget plans each arg. */
|
|
585
|
+
args: g.optional(ginAs(GinTypeDef)),
|
|
586
|
+
/** Its declared return type, so a widget checks that it is a table. */
|
|
587
|
+
returns: g.optional(ginAs(GinTypeDef)),
|
|
588
|
+
/** Its rows change on their own (`FnDecl.live`), so a widget over it may re-run while shown. */
|
|
589
|
+
live: g.optional(ginAs(FnLive)),
|
|
590
|
+
});
|
|
591
|
+
|
|
592
|
+
/** `hub/fns_save`'s args. */
|
|
593
|
+
export const SaveFnArgs = g.obj({
|
|
594
|
+
kind: g.field(g.text({ minLength: 1 }), { docs: 'The qualified kind (`input/form`): one of the calling system\'s own kinds.' }),
|
|
595
|
+
name: g.field(g.text({ minLength: 1 }), { docs: 'Its local name (`project_details`, `main.overdue_invoices`); the hub names it `<system>/<name>`.' }),
|
|
596
|
+
description: g.text({ minLength: 1 }),
|
|
597
|
+
instructions: g.optional(g.text()),
|
|
598
|
+
payload: json(),
|
|
599
|
+
examples: g.optional(g.list(ginAs(FnExample))),
|
|
600
|
+
tags: g.optional(g.list(g.text())),
|
|
601
|
+
share: g.field(g.optional(ginAs(ShareRule)), { docs: 'Who else may use it: private to the run\'s person when absent on a new fn; saving again keeps the current sharing when absent.' }),
|
|
602
|
+
routing: g.optional(ginAs(FnRouting)),
|
|
603
|
+
replace: g.field(g.optional(g.bool()), { docs: 'Save over the fn of this name, keeping the old version; otherwise a taken name is refused.' }),
|
|
604
|
+
});
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* How a run of `hub/fns_save` is undone: the fn, the version the save made, and whether it made the fn. Undoing it puts
|
|
608
|
+
* back the version before (or removes a fn the save made), unless the fn was saved again or removed since.
|
|
609
|
+
*/
|
|
610
|
+
export const SavedFn = g.obj({ fn: g.fnName(), version: g.num({ min: 1, whole: true }), created: g.bool() });
|
|
611
|
+
|
|
612
|
+
/** What `hub/fns_remove` gives, and how its run is undone: the fn, and the version it had (the one restored). */
|
|
613
|
+
export const RemovedFn = g.obj({ fn: g.fnName(), version: g.num({ min: 1, whole: true }) });
|
|
614
|
+
|
|
615
|
+
/**
|
|
616
|
+
* What `hub/fns_allow_runs` gives, and how its run is undone: the fn, and whether its runs go ahead without asking (as
|
|
617
|
+
* it left them; the undo payload is how they were before).
|
|
618
|
+
*/
|
|
619
|
+
export const AllowedRuns = g.obj({ fn: g.fnName(), allowed: g.bool() });
|
|
620
|
+
|
|
621
|
+
/** The error code `hub/fns_save` fails with (class `caller`) when the name is taken and `replace` is not set. */
|
|
622
|
+
export const SAVE_FN_TAKEN = 'fn-taken';
|
|
623
|
+
|
|
624
|
+
/** How a model should use `hub/fns_search`. */
|
|
625
|
+
const FNS_SEARCH_GUIDE = [
|
|
626
|
+
'It searches every fn of every system you can use (fns do things; for guides, memories and pieces of files, which are context, use hub/ctx_search). Use it whenever you need a fn that is not in your tools, and before making a new fn, to reuse a saved one that already does the job. It finds fns, not the person\'s data: a hit is something you can call, never one of their records, so finding nothing that fits says nothing about what they have kept; to see what they keep, call a fn that reads it.',
|
|
627
|
+
'Put what you need in plain words in `text` (what it should do, not a fn name you guess). Leave out every filter you don\'t need. Narrow when you know how: `systems: ["database"]`, `modes: ["read"]`.',
|
|
628
|
+
'With `text`, hits come best first: `rank` is a hit\'s place in that order (1 = first, whatever it is), and `similarity`, when given, is how close its meaning is (0 to 1; under about 0.45 is likely unrelated);',
|
|
629
|
+
'read each hit\'s description and keep only those that fit what you need: the first hit is not always right. If nothing fits, search again with other words or another filter, at most once or twice, then say what you could not find. Without `text` it lists by name.',
|
|
630
|
+
'Page with `offset` set to the `next` it gave. A hit must be loaded (hub/fns_load) before you can call it, with the args its `signature` shows. In the static toolset (find, find_ctx, inspect, load, unload, run) you run a hit by its name with run.',
|
|
631
|
+
'When the page has `loaded`, the hub loaded those hits for you: call them from your next step, without loading them again.',
|
|
632
|
+
'When you know a fn\'s exact name, give it in `names` (or as the text): an item named exactly always comes back first, marked `exact`, whatever the other filters; a name no fn you may use has is listed in `missing`.',
|
|
633
|
+
'A hit with `available: false` can\'t be used now: `blocked.reason` says why, in the hub\'s words. Don\'t load or call it; if you need it, tell the person what blocks it.',
|
|
634
|
+
].join(' ');
|
|
635
|
+
|
|
636
|
+
const FNS_SEARCH_EXAMPLES = [
|
|
637
|
+
{ args: { text: 'keep a list of tasks and who does each one' }, note: 'Fns for a request in plain words.' },
|
|
638
|
+
{ args: { text: 'invoices that are overdue', systems: ['database'], limit: 5 }, note: 'The database fns closest to a question, saved queries among them.' },
|
|
639
|
+
{ args: { systems: ['fs'], modes: ['read' as const], order: 'name' as const }, note: 'Every fs fn that only reads, by name.' },
|
|
640
|
+
];
|
|
641
|
+
|
|
642
|
+
/** How a model should use `hub/ctx_search`. */
|
|
643
|
+
const CTX_SEARCH_GUIDE = [
|
|
644
|
+
'It searches context (guides, memories, pieces of files) of every system you can use; fns are found with hub/fns_search. Use it for a system\'s guide before you first use the system, or for memories about the person.',
|
|
645
|
+
'Put what you need in plain words in `text`; narrow only when you know how (`origins: ["memory"]` for what was remembered). Hits come best first; keep only those whose description fits. Page with `offset` set to `next`.',
|
|
646
|
+
'Load a hit with hub/ctx_load. A hit with `inPrompt` is in front of you already (`injected`: in your instructions; `loaded`: loaded in this chat), so don\'t load it again. When the page has `loaded`, the hub loaded those hits for you.',
|
|
647
|
+
'When you know an item\'s exact name (a system\'s guide is `<system>/guide`), give it in `names` (or as the text): an item named exactly always comes back first, marked `exact`, whatever the other filters; a name nothing you may use has is listed in `missing`.',
|
|
648
|
+
].join(' ');
|
|
649
|
+
|
|
650
|
+
const CTX_SEARCH_EXAMPLES = [
|
|
651
|
+
{ args: { text: 'how to work with tables and saved queries' }, note: 'Guides for a request in plain words.' },
|
|
652
|
+
{ args: { text: 'the person\'s preferences and constraints', origins: ['memory' as const] }, note: 'Memories about the person.' },
|
|
653
|
+
];
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* How `hub/ctx_crawl` works, for the model (plan item 7): levels, the one conditional step, the limits, and what it
|
|
657
|
+
* answers.
|
|
658
|
+
*/
|
|
659
|
+
const CONTEXT_CRAWL_GUIDE = [
|
|
660
|
+
'Use it when a task needs several connected pieces of context and you know where to start (a guide\'s key from hub/ctx_search or a choice), rather than loading choices one step at a time.',
|
|
661
|
+
'It works in levels. Level 0 is the context you name plus everything it imports (imports always come along, at every level).',
|
|
662
|
+
'Each level\'s items may list choices: links to more context, each with a condition ("load X when: …"). Every choice not loaded yet becomes one yes/no question about your `guidance`, and the decision model answers them all together',
|
|
663
|
+
`(in calls of up to ${CRAWL_BATCH_MAX} questions). The choices answered yes (at or above the admin's threshold) load, most likely first, with their imports, while they fit \`maxTokens\`; they are the next level.`,
|
|
664
|
+
'It stops when no choice is left, or at `maxDepth` levels, `maxDecisions` questions in all, or `maxTokens`. Write `guidance` as the task in one or two plain sentences: it is all the decision model reads.',
|
|
665
|
+
'It answers with what it took (`<crawled_ctx>`, each with how it was reached), the fns that context brings (`<brought_fns>`), the choices it skipped and why (`<skipped_ctx>`: declined, over the token budget, out of questions or past the last level), and why it stopped.',
|
|
666
|
+
'Without `metadataOnly` what it took is loaded into this session like hub/ctx_load, its text in front of you from your next step. With `metadataOnly: true` nothing is loaded: you get each item\'s key, title, description and size, and load what fits with hub/ctx_load.',
|
|
667
|
+
].join(' ');
|
|
668
|
+
|
|
669
|
+
/** The hub's contract as declared (`hub` adds the refs to its own context items). */
|
|
670
|
+
const hubContract = system('hub', {
|
|
671
|
+
description: 'The hub: search and load fns and context, follow runs, ask people, and run agents.',
|
|
672
|
+
registries: {
|
|
673
|
+
visuals: { description: 'Every visual a table result can be drawn with (a table, value cards, the chart families): each system adds its own, with the shape of data it draws.', data: ginAs(ResultTable) },
|
|
674
|
+
},
|
|
675
|
+
// the app's own visuals (the table, value cards and the chart families), drawn by the web app; systems add the rest
|
|
676
|
+
contributes: [...BUILT_IN_CONTRIBUTIONS],
|
|
677
|
+
})
|
|
678
|
+
.with({
|
|
679
|
+
types: {
|
|
680
|
+
ContentRef: type({
|
|
681
|
+
description: 'Stored content by reference: an upload, or an earlier version of a file.',
|
|
682
|
+
shape: g.obj({ hash: g.text({ pattern: CONTENT_HASH_PATTERN }), size: g.num({ min: 0, whole: true }), mime: g.text() }),
|
|
683
|
+
display: { label: 'Content', plural: 'Contents', icon: 'file', title: 'hash', subtitle: 'mime' },
|
|
684
|
+
}),
|
|
685
|
+
LongText: type({
|
|
686
|
+
description: 'Text that runs over many lines, such as a file body or a plan. Its input is a growing text area.',
|
|
687
|
+
shape: g.text(),
|
|
688
|
+
display: { label: 'Text', icon: 'text' },
|
|
689
|
+
}),
|
|
690
|
+
},
|
|
691
|
+
kinds: {
|
|
692
|
+
llm: kind({
|
|
693
|
+
description: 'An agent: an LLM with instructions, tools and context, callable like any fn.',
|
|
694
|
+
applicability: 'Use for work that needs judgement, reading or writing in natural language, or several tool calls.',
|
|
695
|
+
payload: LlmPayloadType,
|
|
696
|
+
status: {
|
|
697
|
+
active: { one: 'Asking {fn}…', many: 'Asking {n} agents…' },
|
|
698
|
+
retry: { one: 'Asking {fn} again…', many: 'Asking {n} agents again…' },
|
|
699
|
+
done: { one: '{fn} answered', many: '{n} agents answered' },
|
|
700
|
+
failed: { one: '{fn} could not answer', many: '{n} agents could not answer' },
|
|
701
|
+
},
|
|
702
|
+
}),
|
|
703
|
+
},
|
|
704
|
+
fns: {
|
|
705
|
+
fns_load: fn({
|
|
706
|
+
description: 'Add fns to your tools for the rest of this chat, by their names: each becomes a tool you can call from your next step.',
|
|
707
|
+
instructions: 'Use it after hub/fns_search or a suggestion, with the names of the fns you will call, exactly as the hits and suggestions spell them (`database/main.tasks_create`); they can be called from your next step. It answers with the cards of what it loaded (`<loaded_fns>`) and of each name it refused (`<refused_fns>`) with why, in the hub\'s words (no such fn, another system, waits for an admin to approve it): do not load a refused one again; tell the person what blocks it. Load only what you need: every loaded fn takes room in the prompt.',
|
|
708
|
+
examples: [{ args: { fns: ['fs/read', 'fs/edit'] }, note: 'Two fns for a file change.' }],
|
|
709
|
+
args: g.obj({ fns: g.list(g.fnName(), { minLength: 1 }) }),
|
|
710
|
+
returns: ginAs(LoadFnsResult),
|
|
711
|
+
tags: [READ_TAG],
|
|
712
|
+
display: 'hidden',
|
|
713
|
+
}),
|
|
714
|
+
fns_drop: fn({
|
|
715
|
+
description: 'Remove fns from your tools.',
|
|
716
|
+
instructions: 'Use it when you are done with fns you loaded, to free room in the prompt for the rest of the session.',
|
|
717
|
+
examples: [{ args: { fns: ['fs/edit'] } }],
|
|
718
|
+
args: g.obj({ fns: g.list(g.fnName(), { minLength: 1 }) }),
|
|
719
|
+
returns: g.obj({ dropped: g.list(g.text()) }),
|
|
720
|
+
tags: [READ_TAG],
|
|
721
|
+
display: 'hidden',
|
|
722
|
+
}),
|
|
723
|
+
fns_search: fn({
|
|
724
|
+
description: 'Search fns in the hub by words, meaning or both, best first or by name, filtered by system, instance, who shares them, the types they read or write and their mode, a page at a time.',
|
|
725
|
+
instructions: FNS_SEARCH_GUIDE,
|
|
726
|
+
args: ginAs(FnSearchArgs),
|
|
727
|
+
returns: ginAs(FnSearchPage),
|
|
728
|
+
examples: FNS_SEARCH_EXAMPLES,
|
|
729
|
+
tags: [READ_TAG],
|
|
730
|
+
display: 'message',
|
|
731
|
+
}),
|
|
732
|
+
ctx_search: fn({
|
|
733
|
+
description: 'Search context (guides, memories, pieces of files) by words or meaning, a page at a time.',
|
|
734
|
+
instructions: CTX_SEARCH_GUIDE,
|
|
735
|
+
args: ginAs(CtxSearchArgs),
|
|
736
|
+
returns: ginAs(FnSearchPage),
|
|
737
|
+
examples: CTX_SEARCH_EXAMPLES,
|
|
738
|
+
tags: [READ_TAG],
|
|
739
|
+
display: 'message',
|
|
740
|
+
}),
|
|
741
|
+
fns_examples: fn({
|
|
742
|
+
description: 'A page of one fn\'s example calls (its args, the result when kept, and what each shows), the closest to what you are about to do first.',
|
|
743
|
+
instructions: 'Use it before calling a fn whose args are long or easy to get wrong (a saved query, a form, a table\'s fns): give the fn\'s name as `fn` (it needn\'t be loaded) and what you are about to do as `query`, then follow the shape of the closest example exactly. Page with `offset` set to `next` until `next` is absent.',
|
|
744
|
+
args: ginAs(FnExamplesQuery),
|
|
745
|
+
returns: ginAs(FnExamplesPage),
|
|
746
|
+
examples: [
|
|
747
|
+
{ args: { fn: 'database/main.sales_by_month', query: 'sales for 2025 only' }, note: 'The examples closest to filtering one year come first.' },
|
|
748
|
+
{ args: { fn: 'input/project_details', offset: 10, limit: 10 }, note: 'The second page of ten.' },
|
|
749
|
+
],
|
|
750
|
+
tags: [READ_TAG],
|
|
751
|
+
display: 'message',
|
|
752
|
+
}),
|
|
753
|
+
fns_get: fn({
|
|
754
|
+
description: 'One fn as the hub keeps it: its kind, description, instructions, payload (for a fn of a kind), version and where it runs.',
|
|
755
|
+
instructions: 'Use it to look inside a saved fn (a saved form, a saved query) before reusing or changing it. Only fns the run\'s person may see are given; another is "no such fn".',
|
|
756
|
+
args: g.obj({ fn: g.fnName() }),
|
|
757
|
+
returns: StoredFn,
|
|
758
|
+
examples: [{ args: { fn: 'input/project_details' }, note: 'A saved form: its payload is the form.' }],
|
|
759
|
+
tags: [READ_TAG],
|
|
760
|
+
display: 'hidden',
|
|
761
|
+
}),
|
|
762
|
+
fns_save: fn({
|
|
763
|
+
description: 'Keep a fn of one of the calling system\'s kinds in the hub (a saved form, a saved query), owned by the run\'s person and shared as asked. Saving a name again keeps the old version in its history; undoing the run puts back the version before (or removes a fn it made).',
|
|
764
|
+
instructions: 'Only the system that owns the kind may save fns of it. Give a description and instructions a model can choose and call it by, and examples (args, and the result when there is one). The hub checks the payload with the kind before keeping it, embeds it for hub/fns_search, and keeps its examples for hub/fns_examples.',
|
|
765
|
+
args: SaveFnArgs,
|
|
766
|
+
returns: g.obj({ fn: g.fnName(), version: g.num({ min: 1, whole: true }), created: g.bool() }),
|
|
767
|
+
undo: SavedFn,
|
|
768
|
+
examples: [{
|
|
769
|
+
args: { kind: 'input/form', name: 'project_details', description: 'Asks for a project\'s name, owner, due date and priority.', payload: { title: 'Project details', type: { name: 'obj', props: {} } }, share: { visibility: 'private', with: [] } },
|
|
770
|
+
note: 'A saved form, private to its person.',
|
|
771
|
+
}],
|
|
772
|
+
tags: [OWN_TAG],
|
|
773
|
+
display: 'hidden',
|
|
774
|
+
// a fn that saves through it creates or updates fns of its kind: the hub checks that it said so
|
|
775
|
+
effects: { registry: [{ thing: 'fns', action: 'create' }, { thing: 'fns', action: 'update' }] },
|
|
776
|
+
}),
|
|
777
|
+
fns_remove: fn({
|
|
778
|
+
description: 'Remove a fn of one of the calling system\'s kinds that a person saved (a saved form, a saved query): it is no longer listed, called or run. The hub keeps its versions, and undoing the run brings back the version it had.',
|
|
779
|
+
instructions: 'Only the system that owns the kind may remove fns of it, and only for the fn\'s owner or an admin. A system\'s own fns (its contract\'s) can\'t be removed.',
|
|
780
|
+
args: g.obj({ fn: g.field(g.fnName(), { docs: 'The fn to remove, by its name.' }) }),
|
|
781
|
+
returns: RemovedFn,
|
|
782
|
+
undo: RemovedFn,
|
|
783
|
+
examples: [{ args: { fn: 'input/project_details' }, result: { fn: 'input/project_details', version: 3 }, note: 'A saved form its person no longer wants.' }],
|
|
784
|
+
tags: [OWN_TAG],
|
|
785
|
+
display: 'hidden',
|
|
786
|
+
// a fn that removes through it removes fns of its kind: the hub checks that it said so
|
|
787
|
+
effects: { mode: 'delete', registry: [{ thing: 'fns', action: 'remove' }] },
|
|
788
|
+
}),
|
|
789
|
+
fns_allow_runs: fn({
|
|
790
|
+
description: 'Let the runs of a saved fn of one of the calling system\'s kinds call other fns without asking its owner, or ask again: a policy of the owner\'s own, which any admin policy that matches (a deny, an ask) still wins over.',
|
|
791
|
+
instructions: 'Only the system that owns the kind may call it, and only for the fn\'s owner, on their own say-so (a choice they made on a card or a page, never the model\'s). Fns whose approvals are never remembered still ask. Undoing the run puts the choice back as it was.',
|
|
792
|
+
args: g.obj({
|
|
793
|
+
fn: g.field(g.fnName(), { docs: 'The saved fn whose runs it is about, by its name.' }),
|
|
794
|
+
allow: g.field(g.bool(), { docs: 'True: its runs go ahead without asking; false: they ask as before.' }),
|
|
795
|
+
}),
|
|
796
|
+
returns: AllowedRuns,
|
|
797
|
+
undo: AllowedRuns,
|
|
798
|
+
examples: [{ args: { fn: 'schedule/nightly_backup', allow: true }, result: { fn: 'schedule/nightly_backup', allowed: true }, note: 'Its owner chose to let its runs go ahead.' }],
|
|
799
|
+
tags: [OWN_TAG],
|
|
800
|
+
display: 'hidden',
|
|
801
|
+
}),
|
|
802
|
+
ctx_load: fn({
|
|
803
|
+
description: 'Load context items (guides, memories, pieces of files) into this chat by their full names: their text is in your prompt from your next step, with what they import, and the fns they bring join your tools.',
|
|
804
|
+
instructions: [
|
|
805
|
+
'Use it with names a search (hub/ctx_search) or a suggestion gave you, or a choice under "Where to go next" in a loaded context, copied exactly; load a system\'s guide before you first use the system. Their text is in front of you from the next step.',
|
|
806
|
+
'Each loads with the context it imports, and the fns it brings go into your tools; it answers with the cards of both (`<loaded_ctx>`, `<brought_fns>`). A brought fn that could not be added is named with the reason the hub gave (`available="no"`): it is not in your tools. A name you got wrong is refused with the closest names (`<refused_ctx>`).',
|
|
807
|
+
'A line copied as `name: description` is fine. Load only what the task needs, one step at a time.',
|
|
808
|
+
].join(' '),
|
|
809
|
+
examples: [
|
|
810
|
+
{ args: { context: ['database/guide'] }, note: 'A system\'s guide before its first use: its text, and the fns it brings join your tools.' },
|
|
811
|
+
{ args: { context: ['fs/authoring.kinds: how to declare a kind'] }, note: 'A choice under "Where to go next", copied with its line.' },
|
|
812
|
+
],
|
|
813
|
+
args: g.obj({ context: g.list(g.text(), { minLength: 1 }) }),
|
|
814
|
+
returns: ginAs(LoadContextResult),
|
|
815
|
+
tags: [READ_TAG],
|
|
816
|
+
display: 'hidden',
|
|
817
|
+
}),
|
|
818
|
+
ctx_drop: fn({
|
|
819
|
+
description: 'Take context items out of this chat: their text leaves your prompt from your next step.',
|
|
820
|
+
instructions: 'Use it when you are done with context you loaded (a guide, a memory, a piece of a file), to free room in the prompt for the rest of the session. The fns it brought stay in your tools: drop them with hub/fns_drop.',
|
|
821
|
+
examples: [{ args: { context: ['database/guide'] }, note: 'Done with a system\'s guide.' }],
|
|
822
|
+
args: g.obj({ context: g.list(g.text(), { minLength: 1 }) }),
|
|
823
|
+
returns: g.obj({ dropped: g.list(g.text()) }),
|
|
824
|
+
tags: [READ_TAG],
|
|
825
|
+
display: 'hidden',
|
|
826
|
+
}),
|
|
827
|
+
ctx_crawl: fn({
|
|
828
|
+
description: 'Gather the context a task needs by following context links from starting keys, a level at a time, with the decision model choosing which links to follow.',
|
|
829
|
+
instructions: CONTEXT_CRAWL_GUIDE,
|
|
830
|
+
examples: [
|
|
831
|
+
{ args: { context: ['fs/authoring'], guidance: 'Declare a new kind with a payload type and examples.' }, note: 'From a guide\'s index: follow its choices up to 3 levels, loading what the decision model says this task needs.' },
|
|
832
|
+
{ args: { context: ['database/guide'], guidance: 'Write a saved query that joins two tables.', maxDepth: 1, maxTokens: 3000 }, note: 'One level of choices, within 3000 tokens.' },
|
|
833
|
+
{ args: { context: ['fs/authoring', 'database/guide'], guidance: 'Store uploaded files as records.', metadataOnly: true, maxDecisions: 64 }, note: 'See what a crawl would find (keys, sizes, why) without loading it; load what fits with hub/ctx_load.' },
|
|
834
|
+
],
|
|
835
|
+
args: ginAs(ContextCrawlArgs),
|
|
836
|
+
returns: ginAs(ContextCrawlResult),
|
|
837
|
+
tags: [READ_TAG],
|
|
838
|
+
display: 'hidden',
|
|
839
|
+
// it asks the decision model which links to follow: off until an admin sets the decide role
|
|
840
|
+
roles: ['decide'],
|
|
841
|
+
}),
|
|
842
|
+
search_resources: fn({
|
|
843
|
+
description: 'Search files and other resources by meaning and words.',
|
|
844
|
+
instructions: 'Use it to find files, pages and uploads by what they say, across every system. Give a plain description of what you look for; narrow to roots (a folder\'s uri, a crawl) when you know them. Each hit has a section and a preview: read the best with hub/resource_read rather than guessing from the preview.',
|
|
845
|
+
examples: [{ args: { query: 'where the hub client retries requests' }, note: 'Code by what it does.' }, { args: { query: 'refund policy', roots: ['web://docs.example.com'], limit: 5 }, note: 'One crawled site only.' }],
|
|
846
|
+
args: g.obj({ query: g.text(), roots: g.optional(g.list(g.text())), limit: g.optional(g.num({ min: 1, max: 50, whole: true })) }),
|
|
847
|
+
returns: g.list(g.obj({ uri: g.text(), section: g.optional(g.text()), title: g.text(), preview: g.text(), rank: g.num() })),
|
|
848
|
+
tags: [READ_TAG],
|
|
849
|
+
}),
|
|
850
|
+
run_status: fn({
|
|
851
|
+
description: 'The status of one run (one call of a fn): running, waiting (for approval or for a form), done with its result, failed with its error, or cancelled, with its progress.',
|
|
852
|
+
instructions: 'Use it to check on a call that went to the background: its result said "Running in the background as run <id>", and `run` is that id (such as `run_01HZX3`), never a fn name. It answers at once and does not wait: to wait for the end, use hub/run_wait. You don\'t need it to learn that a background run finished: its result comes to you by itself as a `<background-result>` message.',
|
|
853
|
+
examples: [{ args: { run: 'run_01HZX3' } }],
|
|
854
|
+
args: g.obj({ run: g.text() }),
|
|
855
|
+
returns: g.obj({ status: RunStatusType, progress: g.optional(json()), result: g.optional(json()), error: g.optional(FnErrorType) }),
|
|
856
|
+
tags: [READ_TAG],
|
|
857
|
+
display: 'hidden',
|
|
858
|
+
}),
|
|
859
|
+
run_wait: fn({
|
|
860
|
+
description: 'Wait for one run (such as a call that went to the background) to finish, up to a timeout, and give its result.',
|
|
861
|
+
instructions: 'Use it when you can\'t go on without the result of a background run (`run` is the id its result named). Give a `timeout` when the person is waiting (30000 is 30 seconds). If it comes back still running, say so and how long such runs usually take (hub/fns_metrics) rather than waiting again and again; its result will still reach you as a `<background-result>` message when it ends.',
|
|
862
|
+
examples: [{ args: { run: 'run_01HZX3', timeout: 30000 }, note: 'Wait up to 30 seconds.' }],
|
|
863
|
+
args: g.obj({ run: g.text(), timeout: g.field(g.optional(g.duration()), { docs: 'How long to wait, in milliseconds (30000 is 30 seconds). Leave empty to wait as long as this call may run.' }) }),
|
|
864
|
+
returns: g.obj({ status: RunStatusType, result: g.optional(json()), error: g.optional(FnErrorType) }),
|
|
865
|
+
tags: [READ_TAG],
|
|
866
|
+
display: 'hidden',
|
|
867
|
+
}),
|
|
868
|
+
ask_user: fn({
|
|
869
|
+
description: 'Ask a person one plain question and wait for their answer: your call stays open until they reply, and the reply is its result.',
|
|
870
|
+
instructions: 'Use it in the middle of a task when one detail only the person has decides what you do next (which of two options, how many people), and you will carry on as soon as you have it. For a question you can simply put in your answer (and end your turn), just ask there. For several typed fields at once, use a form (input/get_input). Ask one short, specific question, with the options when there are some. Leave `user` out to ask the person in the chat.',
|
|
871
|
+
examples: [{ args: { question: 'Should the report cover only this quarter, or the whole year?' }, note: 'One detail that decides the next step.' }],
|
|
872
|
+
args: g.obj({ question: g.text(), user: g.optional(g.text()) }),
|
|
873
|
+
returns: g.obj({ answer: g.text() }),
|
|
874
|
+
tags: [READ_TAG],
|
|
875
|
+
}),
|
|
876
|
+
// ─── The static toolset's fns (`run` is not a fn: its calls become runs of the named fn) ───
|
|
877
|
+
inspect: fn({
|
|
878
|
+
description: 'Look at one item by its full name, at a detail: a fn\'s card, a context item\'s text, a type\'s definition, or a resource\'s outline.',
|
|
879
|
+
instructions: 'Use it on a hit from a search (hub/fns_search or hub/ctx_search, or find and find_ctx) before you run it, to see the exact args it takes. `signature` shows a fn\'s args and result; `full` adds its instructions and examples (use it for a fn whose args are long). It shows the item once and does not keep it: use hub/load to keep it in your prompt.',
|
|
880
|
+
examples: [{ args: { name: 'fs/edit', detail: 'full' }, note: 'A fn card with its examples.' }, { args: { name: 'fs/Entry' } }],
|
|
881
|
+
args: g.obj({ name: g.fnName(), detail: g.optional(DetailType) }),
|
|
882
|
+
returns: g.obj({ name: g.text(), kind: g.enum(FIND_KINDS), detail: DetailType, text: g.text() }),
|
|
883
|
+
tags: [READ_TAG],
|
|
884
|
+
display: 'message',
|
|
885
|
+
}),
|
|
886
|
+
load: fn({
|
|
887
|
+
description: 'Keep fns (as cards) and context items (as text) in your prompt from the next step on, by their full names.',
|
|
888
|
+
instructions: 'Use it for fns you will run more than once and for guides you need while you work (load a system\'s guide before you first use it). A context item brings the items it imports and its fns along. Use the lowest detail that is enough (`signature` for a fn you know how to call), since everything loaded takes room in the prompt.',
|
|
889
|
+
examples: [{ args: { names: ['fs/read', 'fs/edit'], detail: 'signature' }, note: 'Two fns for a file change.' }, { args: { names: ['database/guide'] }, note: 'A system\'s guide, before its first use.' }],
|
|
890
|
+
args: g.obj({ names: g.list(g.fnName(), { minLength: 1 }), detail: g.optional(DetailType) }),
|
|
891
|
+
returns: g.obj({ loaded: g.list(g.text()), refused: g.list(ginAs(NameRefusal)) }),
|
|
892
|
+
tags: [READ_TAG],
|
|
893
|
+
display: 'hidden',
|
|
894
|
+
}),
|
|
895
|
+
unload: fn({
|
|
896
|
+
description: 'Take fns and context out of what you keep in front of you.',
|
|
897
|
+
instructions: 'Use it when you are done with fns or context you loaded, to keep the prompt small.',
|
|
898
|
+
examples: [{ args: { names: ['fs/edit'] }, note: 'Done editing files.' }],
|
|
899
|
+
args: g.obj({ names: g.list(g.fnName(), { minLength: 1 }) }),
|
|
900
|
+
returns: g.obj({ unloaded: g.list(g.text()), refused: g.list(RefusedName) }),
|
|
901
|
+
tags: [READ_TAG],
|
|
902
|
+
display: 'hidden',
|
|
903
|
+
}),
|
|
904
|
+
// ─── Resources beyond the web endpoints ───
|
|
905
|
+
resource_outline: fn({
|
|
906
|
+
description: 'A resource\'s sections (headings, symbols, pages or tables), each with its key and place in the outline.',
|
|
907
|
+
instructions: 'Use it before reading a long resource: pick the section you need from its outline and read only that with hub/resource_read.',
|
|
908
|
+
examples: [{ args: { uri: 'file:///repo/docs/guide.md' } }],
|
|
909
|
+
args: ginAs(ResourceOutlineArgs),
|
|
910
|
+
returns: g.list(ginAs(Section)),
|
|
911
|
+
tags: [READ_TAG],
|
|
912
|
+
display: 'message',
|
|
913
|
+
}),
|
|
914
|
+
resource_send: fn({
|
|
915
|
+
description: 'Show yourself a resource (or one section of it) as it is, at your next step: an image you can see, audio, a PDF page or text.',
|
|
916
|
+
instructions: 'Use it to look at a photo, a screenshot, a chart or a scanned page the person attached, or any resource whose text form is not enough. You see it yourself at your next step: describe what you see then, with no other tool. If the model you run on can\'t see images, an image comes as an `<image id="…">` block instead: ask about it with hub/image_read. It costs prompt room, so send one section (a page) of a long document when you can. A pdf with no text in it (a scan, or a photo of paper) comes as the pictures of its pages: send section "Page 2" to see page 2.',
|
|
917
|
+
examples: [{ args: { uri: 'hub://resources/uploads/2026-11-22/photo.jpg' }, note: 'Look at a photo the person attached.' }],
|
|
918
|
+
args: ginAs(ResourceSendArgs),
|
|
919
|
+
returns: g.obj({ parts: g.list(SentPart) }),
|
|
920
|
+
tags: [READ_TAG],
|
|
921
|
+
display: 'hidden',
|
|
922
|
+
}),
|
|
923
|
+
image_read: fn({
|
|
924
|
+
description: 'Ask a question about an image you can\'t see: another model that can see images looks at it and answers.',
|
|
925
|
+
instructions: 'Use it when an image comes to you as an `<image id="…">` block instead of the picture itself (the model you run on can\'t see images). Pass the block\'s id as `image` and ask one clear question, saying exactly what you need: "What does the text in it say, word for word?", "List every item it shows with its number", "What is in the top left corner?". Ask for the exact words or numbers you need rather than a summary, and ask again with a sharper question if the answer leaves something out. The answer is only what that model saw: say so if it is unsure, and confirm anything important with the person before you act on it. It reads a pdf whose pages are pictures (a scan) too: pass the pdf\'s uri as `image` and the page number as `page` (from 1). Don\'t use it on an image you can see.',
|
|
926
|
+
examples: [
|
|
927
|
+
{ args: { image: 'hub://resources/uploads/2026-11-22/photo.jpg', question: 'Write out all of the text in this image exactly, line by line.' }, note: 'The words in an attached picture.' },
|
|
928
|
+
{ args: { image: 'file:///docs/diagram.png', question: 'What are the labelled parts, and how are they connected?' }, note: 'What a diagram shows.' },
|
|
929
|
+
{ args: { image: 'file:///docs/signed-contract.pdf', page: 2, question: 'What is this page about, and which names and dates does it show?' }, note: 'Page 2 of a scanned pdf, which has no text.' },
|
|
930
|
+
],
|
|
931
|
+
args: ginAs(ImageReadArgs),
|
|
932
|
+
returns: ginAs(ImageReadResult),
|
|
933
|
+
tags: [READ_TAG],
|
|
934
|
+
// a vision model answers: off until an admin sets the describe role
|
|
935
|
+
roles: ['describe'],
|
|
936
|
+
}),
|
|
937
|
+
// ─── Bookkeeping ───
|
|
938
|
+
system_calls: fn({
|
|
939
|
+
description: 'Holds the model calls a system makes outside its own runs (hooks, timers, start-up, its own aeye), so they are charged to its budgets and show as its.',
|
|
940
|
+
instructions: 'Never call it: the hub makes its runs itself when a system calls a model outside a run. Read them with hub/runs_list filtered by this fn to see what a system spent on its own.',
|
|
941
|
+
examples: [{ args: {}, note: 'Its runs are made by the hub; calling it is refused.' }],
|
|
942
|
+
args: g.obj({}),
|
|
943
|
+
returns: g.obj({}),
|
|
944
|
+
visibility: 'none',
|
|
945
|
+
display: 'hidden',
|
|
946
|
+
}),
|
|
947
|
+
// ─── Hub MCP session tokens for grantee systems ───
|
|
948
|
+
mint_mcp_token: fn({
|
|
949
|
+
description: 'Mint a short-lived token for a hub MCP, for a session this system starts (a Claude session, for one). Only a grantee system\'s runs may call it.',
|
|
950
|
+
instructions: 'Only a grantee system calls it, when it starts a session that should reach the hub through MCP. Pass the token to that session only and never show it to a person.',
|
|
951
|
+
args: ginAs(MintMcpTokenArgs),
|
|
952
|
+
examples: [{ args: { mcp: 'mcp_01HZX3', label: 'claude session for the release notes', ttl: 600000 }, note: 'A ten-minute token for one session.' }],
|
|
953
|
+
returns: g.obj({ token: g.text(), expiresAt: g.timestamp() }),
|
|
954
|
+
tags: [ADMIN_TAG],
|
|
955
|
+
}),
|
|
956
|
+
},
|
|
957
|
+
mentions: {
|
|
958
|
+
fns: mention({ title: 'Functions', description: 'Any fn the session can use.', target: g.obj({ fn: g.text() }) }),
|
|
959
|
+
context: mention({ title: 'Context', description: 'Guides, skills and references.', target: g.obj({ context: g.text() }) }),
|
|
960
|
+
resources: mention({ title: 'Resources', description: 'Files and other resources from every system.', target: g.obj({ uri: g.text(), section: g.optional(g.text()) }) }),
|
|
961
|
+
},
|
|
962
|
+
sectioners: {
|
|
963
|
+
whole: sectioner({ description: 'The whole resource as one section.', match: {} }),
|
|
964
|
+
headings: sectioner({ description: 'One section per heading.', match: { format: 'markdown' } }),
|
|
965
|
+
symbols: sectioner({ description: 'One section per top-level symbol (function, class, type).', match: { glob: '**/*.{ts,tsx,js,mjs,cjs,vue,py,go,rs,java,cs}' } }),
|
|
966
|
+
pages: sectioner({ description: 'One section per page.', match: { format: 'pdf' } }),
|
|
967
|
+
paragraphs: sectioner({ description: 'One section per paragraph.', match: { format: 'text' } }),
|
|
968
|
+
tables: sectioner({ description: 'One section per table (large tables in row groups, the header repeated).', match: { form: 'table' } }),
|
|
969
|
+
},
|
|
970
|
+
})
|
|
971
|
+
.with({ fns: { ...readFns, ...writeFns, ...personFns, ...exploreFns, ...dataFns } })
|
|
972
|
+
.with(({ fns, kinds }) => {
|
|
973
|
+
// the tools mode's own six: search, load and drop for fns and for context. Every other fn the chat starts with
|
|
974
|
+
// (examples, following runs, asking people…) comes with the injected item that explains it (packages/hub/context/)
|
|
975
|
+
const tools = [fns.fns_search.name, fns.fns_load.name, fns.fns_drop.name, fns.ctx_search.name, fns.ctx_load.name, fns.ctx_drop.name];
|
|
976
|
+
return {
|
|
977
|
+
fns: {
|
|
978
|
+
read_table: fn({
|
|
979
|
+
description: 'Run a read fn that returns a table, as a child run of the caller, as its person, and give the table.',
|
|
980
|
+
instructions: 'The widgets system calls it to run a widget\'s source or a sample of one. It refuses a fn that is not a read (worked out deeply) or does not return a table.',
|
|
981
|
+
examples: [{ args: { fn: 'hub/records_table', args: { type: 'tasks/Task', limit: 5 } }, note: 'Five tasks as a table.' }],
|
|
982
|
+
args: ginAs(ReadTableArgs), returns: ginAs(ResultTable), tags: [READ_TAG], visibility: 'none', display: 'hidden',
|
|
983
|
+
}),
|
|
984
|
+
visuals: fn({
|
|
985
|
+
description: 'Every visual of the hub\'s visual registry (hub/visuals), with its declared shape and the system that draws it, in registry order.',
|
|
986
|
+
instructions: 'The widgets system calls it to rank the visuals that fit a result (rankVisuals): the hub\'s own first, then each system\'s in name order.',
|
|
987
|
+
examples: [{ args: {}, note: 'The whole registry.' }],
|
|
988
|
+
args: g.obj({}), returns: g.list(ginAs(ContributionView)), tags: [READ_TAG], visibility: 'none', display: 'hidden',
|
|
989
|
+
}),
|
|
990
|
+
row_actions: fn({
|
|
991
|
+
description: 'The actions rows of some types offer, as the run\'s person may use them: each type\'s methods, narrowed and relabelled by a widget\'s list, with any fn it binds to the row\'s columns.',
|
|
992
|
+
instructions: 'The widgets system calls it to give a widget\'s rows their menu. Anything that is not a read confirms first; what follows is derived (a table opens, a write refreshes).',
|
|
993
|
+
examples: [{ args: { types: ['tasks/Task'] }, note: 'Every method of a task.' }],
|
|
994
|
+
args: ginAs(RowActionsQuery), returns: g.list(ginAs(WidgetActionOption)), tags: [READ_TAG], visibility: 'none', display: 'hidden',
|
|
995
|
+
}),
|
|
996
|
+
chat: kinds.llm.fn({
|
|
997
|
+
description: 'The chat agent: answers people in a session with every tool the session allows.',
|
|
998
|
+
instructions: 'The hub runs it for every message in a session that names no other agent. Call it from another fn only to hand a whole conversation turn to the chat agent.',
|
|
999
|
+
examples: [{ args: {}, note: 'Its input is the session itself: it takes no args.' }],
|
|
1000
|
+
payload: {
|
|
1001
|
+
instructions: CHAT_BASE,
|
|
1002
|
+
tools,
|
|
1003
|
+
canLoad: {},
|
|
1004
|
+
maxTools: 64,
|
|
1005
|
+
context: [],
|
|
1006
|
+
hooks: [],
|
|
1007
|
+
toolExecution: 'parallel',
|
|
1008
|
+
maxIterations: 24,
|
|
1009
|
+
},
|
|
1010
|
+
args: g.obj({}),
|
|
1011
|
+
returns: g.text(),
|
|
1012
|
+
}),
|
|
1013
|
+
chat_small: kinds.llm.fn({
|
|
1014
|
+
description: 'The chat agent for small local models: the static toolset and the graph contextor, so each prompt fits a small window.',
|
|
1015
|
+
instructions: 'Pick it for a session on a small local model (a few thousand tokens of window): it sees six fixed tools and only the context and fn cards that fit each prompt.',
|
|
1016
|
+
examples: [{ args: {}, note: 'Its input is the session itself: it takes no args.' }],
|
|
1017
|
+
payload: {
|
|
1018
|
+
instructions: CHAT_SMALL_BASE,
|
|
1019
|
+
tools,
|
|
1020
|
+
canLoad: {},
|
|
1021
|
+
maxTools: 64,
|
|
1022
|
+
context: [],
|
|
1023
|
+
hooks: [],
|
|
1024
|
+
toolExecution: 'sequential',
|
|
1025
|
+
maxIterations: 16,
|
|
1026
|
+
// a small window: each injected item at its summary, the section within 600 tokens
|
|
1027
|
+
injected: { detail: 'summary', maxTokens: 600 },
|
|
1028
|
+
mode: { type: 'static' },
|
|
1029
|
+
contextor: { type: 'graph' },
|
|
1030
|
+
},
|
|
1031
|
+
args: g.obj({}),
|
|
1032
|
+
returns: g.text(),
|
|
1033
|
+
}),
|
|
1034
|
+
},
|
|
1035
|
+
};
|
|
1036
|
+
})
|
|
1037
|
+
.with({ fns: { ...adminFns, ...adminReadFns } });
|
|
1038
|
+
|
|
1039
|
+
/**
|
|
1040
|
+
* The keys of the hub's own context items: the markdown files in the hub's `context/` folder, which join its manifest
|
|
1041
|
+
* at boot, so they are not declared in the contract. A test keeps this list and the folder the same.
|
|
1042
|
+
*/
|
|
1043
|
+
export const HUB_CONTEXT_KEYS = [
|
|
1044
|
+
'asking', 'attached_files', 'background_runs', 'earlier_chats', 'examples', 'finding_fns', 'images', 'later', 'limits', 'memory', 'resources',
|
|
1045
|
+
'saved_fns', 'undo',
|
|
1046
|
+
] as const;
|
|
1047
|
+
/** One of the hub's own context items, by key. */
|
|
1048
|
+
export type HubContextKey = (typeof HUB_CONTEXT_KEYS)[number];
|
|
1049
|
+
|
|
1050
|
+
/** Refs to the hub's own context items, by key. */
|
|
1051
|
+
export type HubContextRefs = { readonly [K in HubContextKey]: ContextRef<QualifiedName<'hub', K>, {}> };
|
|
1052
|
+
|
|
1053
|
+
const hubContextRefs = Object.fromEntries(HUB_CONTEXT_KEYS.map((key) => [key, withRefText({ ref: 'context' as const, name: `hub/${key}` as const })])) as HubContextRefs;
|
|
1054
|
+
|
|
1055
|
+
/**
|
|
1056
|
+
* The hub's contract, with refs to its own context items beside what it declares, so a system can name one where a
|
|
1057
|
+
* context ref is asked for (`inject: { replaces: [hub.context.later] }`).
|
|
1058
|
+
*/
|
|
1059
|
+
export const hub: Omit<typeof hubContract, 'context'> & { readonly context: (typeof hubContract)['context'] & HubContextRefs } = {
|
|
1060
|
+
...hubContract,
|
|
1061
|
+
context: { ...hubContract.context, ...hubContextRefs },
|
|
1062
|
+
};
|
|
1063
|
+
|
|
1064
|
+
/** The hub's contract type. */
|
|
1065
|
+
export type HubContract = typeof hub;
|