everything-dev 1.53.2 → 2.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -11
- package/dist/_virtual/_rolldown/runtime.cjs +17 -2
- package/dist/_virtual/_rolldown/runtime.mjs +36 -0
- package/dist/api/auth-middleware.cjs +161 -0
- package/dist/api/auth-middleware.cjs.map +1 -0
- package/dist/api/auth-middleware.d.cts +69 -0
- package/dist/api/auth-middleware.d.mts +69 -0
- package/dist/api/auth-middleware.mjs +160 -0
- package/dist/api/auth-middleware.mjs.map +1 -0
- package/dist/api-contract.cjs +250 -62
- package/dist/api-contract.cjs.map +1 -1
- package/dist/api-contract.mjs +246 -65
- package/dist/api-contract.mjs.map +1 -1
- package/dist/app.cjs +99 -26
- package/dist/app.cjs.map +1 -1
- package/dist/app.d.cts +3 -0
- package/dist/app.d.mts +3 -0
- package/dist/app.mjs +100 -27
- package/dist/app.mjs.map +1 -1
- package/dist/auth-login.cjs +163 -0
- package/dist/auth-login.cjs.map +1 -0
- package/dist/auth-login.mjs +162 -0
- package/dist/auth-login.mjs.map +1 -0
- package/dist/auth-session.cjs +64 -0
- package/dist/auth-session.cjs.map +1 -0
- package/dist/auth-session.mjs +58 -0
- package/dist/auth-session.mjs.map +1 -0
- package/dist/auth-types-gen.cjs +0 -1
- package/dist/auth-types-gen.cjs.map +1 -1
- package/dist/build.cjs +37 -173
- package/dist/build.cjs.map +1 -1
- package/dist/build.mjs +37 -171
- package/dist/build.mjs.map +1 -1
- package/dist/bundle-cache.cjs +74 -0
- package/dist/bundle-cache.cjs.map +1 -0
- package/dist/bundle-cache.d.cts +27 -0
- package/dist/bundle-cache.d.mts +27 -0
- package/dist/bundle-cache.mjs +68 -0
- package/dist/bundle-cache.mjs.map +1 -0
- package/dist/bundle-fs-resolve.cjs +209 -0
- package/dist/bundle-fs-resolve.cjs.map +1 -0
- package/dist/bundle-fs-resolve.d.cts +76 -0
- package/dist/bundle-fs-resolve.d.mts +76 -0
- package/dist/bundle-fs-resolve.mjs +202 -0
- package/dist/bundle-fs-resolve.mjs.map +1 -0
- package/dist/cdn-deploy.cjs +126 -0
- package/dist/cdn-deploy.cjs.map +1 -0
- package/dist/cdn-deploy.mjs +124 -0
- package/dist/cdn-deploy.mjs.map +1 -0
- package/dist/cli/db-doctor.cjs +19 -19
- package/dist/cli/db-doctor.cjs.map +1 -1
- package/dist/cli/db-doctor.mjs +18 -18
- package/dist/cli/db-doctor.mjs.map +1 -1
- package/dist/cli/db-repair.cjs +9 -32
- package/dist/cli/db-repair.cjs.map +1 -1
- package/dist/cli/db-repair.mjs +9 -32
- package/dist/cli/db-repair.mjs.map +1 -1
- package/dist/cli/framework-version.cjs +7 -3
- package/dist/cli/framework-version.cjs.map +1 -1
- package/dist/cli/framework-version.mjs +7 -3
- package/dist/cli/framework-version.mjs.map +1 -1
- package/dist/cli/infra.cjs +159 -251
- package/dist/cli/infra.cjs.map +1 -1
- package/dist/cli/infra.mjs +154 -242
- package/dist/cli/infra.mjs.map +1 -1
- package/dist/cli/init.cjs +627 -199
- package/dist/cli/init.cjs.map +1 -1
- package/dist/cli/init.d.cts +61 -8
- package/dist/cli/init.d.mts +61 -8
- package/dist/cli/init.mjs +616 -197
- package/dist/cli/init.mjs.map +1 -1
- package/dist/cli/parse.cjs +8 -7
- package/dist/cli/parse.cjs.map +1 -1
- package/dist/cli/parse.mjs +9 -7
- package/dist/cli/parse.mjs.map +1 -1
- package/dist/cli/prompts.cjs +14 -1
- package/dist/cli/prompts.cjs.map +1 -1
- package/dist/cli/prompts.mjs +14 -1
- package/dist/cli/prompts.mjs.map +1 -1
- package/dist/cli/prune.cjs +220 -0
- package/dist/cli/prune.cjs.map +1 -0
- package/dist/cli/prune.mjs +220 -0
- package/dist/cli/prune.mjs.map +1 -0
- package/dist/cli/snapshot.cjs +2 -1
- package/dist/cli/snapshot.cjs.map +1 -1
- package/dist/cli/snapshot.mjs +2 -1
- package/dist/cli/snapshot.mjs.map +1 -1
- package/dist/cli/status.cjs +5 -4
- package/dist/cli/status.cjs.map +1 -1
- package/dist/cli/status.mjs +6 -5
- package/dist/cli/status.mjs.map +1 -1
- package/dist/cli/sync.cjs +156 -58
- package/dist/cli/sync.cjs.map +1 -1
- package/dist/cli/sync.mjs +158 -63
- package/dist/cli/sync.mjs.map +1 -1
- package/dist/cli/timing.cjs +0 -1
- package/dist/cli/timing.cjs.map +1 -1
- package/dist/cli/upgrade.cjs +95 -69
- package/dist/cli/upgrade.cjs.map +1 -1
- package/dist/cli/upgrade.mjs +97 -72
- package/dist/cli/upgrade.mjs.map +1 -1
- package/dist/cli/utils/helpers.cjs.map +1 -1
- package/dist/cli.cjs +320 -72
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +316 -68
- package/dist/cli.mjs.map +1 -1
- package/dist/code-artifacts.cjs +76 -8
- package/dist/code-artifacts.cjs.map +1 -1
- package/dist/code-artifacts.mjs +76 -10
- package/dist/code-artifacts.mjs.map +1 -1
- package/dist/commands/build.cjs +65 -0
- package/dist/commands/build.cjs.map +1 -0
- package/dist/commands/build.mjs +65 -0
- package/dist/commands/build.mjs.map +1 -0
- package/dist/commands/config.cjs +77 -0
- package/dist/commands/config.cjs.map +1 -0
- package/dist/commands/config.d.cts +8 -0
- package/dist/commands/config.d.mts +8 -0
- package/dist/commands/config.mjs +74 -0
- package/dist/commands/config.mjs.map +1 -0
- package/dist/commands/db.cjs +107 -0
- package/dist/commands/db.cjs.map +1 -0
- package/dist/commands/db.mjs +107 -0
- package/dist/commands/db.mjs.map +1 -0
- package/dist/commands/deploy.cjs +336 -0
- package/dist/commands/deploy.cjs.map +1 -0
- package/dist/commands/deploy.mjs +334 -0
- package/dist/commands/deploy.mjs.map +1 -0
- package/dist/commands/dev.cjs +75 -0
- package/dist/commands/dev.cjs.map +1 -0
- package/dist/commands/dev.mjs +73 -0
- package/dist/commands/dev.mjs.map +1 -0
- package/dist/commands/init.cjs +234 -0
- package/dist/commands/init.cjs.map +1 -0
- package/dist/commands/init.mjs +231 -0
- package/dist/commands/init.mjs.map +1 -0
- package/dist/commands/keys.cjs +255 -0
- package/dist/commands/keys.cjs.map +1 -0
- package/dist/commands/keys.mjs +253 -0
- package/dist/commands/keys.mjs.map +1 -0
- package/dist/commands/ops.cjs +199 -0
- package/dist/commands/ops.cjs.map +1 -0
- package/dist/commands/ops.mjs +197 -0
- package/dist/commands/ops.mjs.map +1 -0
- package/dist/commands/plugins.cjs +211 -0
- package/dist/commands/plugins.cjs.map +1 -0
- package/dist/commands/plugins.mjs +211 -0
- package/dist/commands/plugins.mjs.map +1 -0
- package/dist/commands/shared.cjs +8 -0
- package/dist/commands/shared.cjs.map +1 -0
- package/dist/commands/shared.d.cts +6 -0
- package/dist/commands/shared.d.mts +6 -0
- package/dist/commands/shared.mjs +8 -0
- package/dist/commands/shared.mjs.map +1 -0
- package/dist/commands/upgrade.cjs +325 -0
- package/dist/commands/upgrade.cjs.map +1 -0
- package/dist/commands/upgrade.mjs +323 -0
- package/dist/commands/upgrade.mjs.map +1 -0
- package/dist/components/dev-render.cjs +340 -0
- package/dist/components/dev-render.cjs.map +1 -0
- package/dist/components/dev-render.mjs +332 -0
- package/dist/components/dev-render.mjs.map +1 -0
- package/dist/config.cjs +460 -221
- package/dist/config.cjs.map +1 -1
- package/dist/config.d.cts +491 -48
- package/dist/config.d.mts +491 -48
- package/dist/config.mjs +439 -212
- package/dist/config.mjs.map +1 -1
- package/dist/contract.cjs +327 -50
- package/dist/contract.cjs.map +1 -1
- package/dist/contract.d.cts +1951 -1062
- package/dist/contract.d.mts +1951 -1062
- package/dist/contract.meta.cjs +107 -12
- package/dist/contract.meta.cjs.map +1 -1
- package/dist/contract.meta.d.cts +166 -8
- package/dist/contract.meta.d.mts +166 -8
- package/dist/contract.meta.mjs +107 -11
- package/dist/contract.meta.mjs.map +1 -1
- package/dist/contract.mjs +580 -327
- package/dist/contract.mjs.map +1 -1
- package/dist/dag.cjs +5 -3
- package/dist/dag.cjs.map +1 -1
- package/dist/dag.mjs +6 -3
- package/dist/dag.mjs.map +1 -1
- package/dist/db/binding.cjs +80 -0
- package/dist/db/binding.cjs.map +1 -0
- package/dist/db/binding.d.cts +39 -0
- package/dist/db/binding.d.mts +39 -0
- package/dist/db/binding.mjs +78 -0
- package/dist/db/binding.mjs.map +1 -0
- package/dist/db/bindings.cjs +78 -0
- package/dist/db/bindings.cjs.map +1 -0
- package/dist/db/bindings.d.cts +34 -0
- package/dist/db/bindings.d.mts +34 -0
- package/dist/db/bindings.mjs +76 -0
- package/dist/db/bindings.mjs.map +1 -0
- package/dist/db/core.cjs +204 -0
- package/dist/db/core.cjs.map +1 -0
- package/dist/db/core.d.cts +69 -0
- package/dist/db/core.d.mts +69 -0
- package/dist/db/core.mjs +192 -0
- package/dist/db/core.mjs.map +1 -0
- package/dist/db/driver.cjs +167 -0
- package/dist/db/driver.cjs.map +1 -0
- package/dist/db/driver.d.cts +50 -0
- package/dist/db/driver.d.mts +50 -0
- package/dist/db/driver.mjs +165 -0
- package/dist/db/driver.mjs.map +1 -0
- package/dist/db/drizzle-kit.cjs +177 -0
- package/dist/db/drizzle-kit.cjs.map +1 -0
- package/dist/db/drizzle-kit.d.cts +25 -0
- package/dist/db/drizzle-kit.d.mts +25 -0
- package/dist/db/drizzle-kit.mjs +175 -0
- package/dist/db/drizzle-kit.mjs.map +1 -0
- package/dist/db/errors.cjs +27 -0
- package/dist/db/errors.cjs.map +1 -0
- package/dist/db/errors.d.cts +16 -0
- package/dist/db/errors.d.mts +16 -0
- package/dist/db/errors.mjs +26 -0
- package/dist/db/errors.mjs.map +1 -0
- package/dist/db/identity.cjs +55 -0
- package/dist/db/identity.cjs.map +1 -0
- package/dist/db/identity.d.cts +40 -0
- package/dist/db/identity.d.mts +40 -0
- package/dist/db/identity.mjs +53 -0
- package/dist/db/identity.mjs.map +1 -0
- package/dist/db/index.cjs +43 -0
- package/dist/db/index.d.cts +9 -0
- package/dist/db/index.d.mts +9 -0
- package/dist/db/index.mjs +10 -0
- package/dist/db/run-migrations.cjs +343 -0
- package/dist/db/run-migrations.cjs.map +1 -0
- package/dist/db/run-migrations.d.cts +87 -0
- package/dist/db/run-migrations.d.mts +87 -0
- package/dist/db/run-migrations.mjs +341 -0
- package/dist/db/run-migrations.mjs.map +1 -0
- package/dist/delegate-signer.cjs +85 -0
- package/dist/delegate-signer.cjs.map +1 -0
- package/dist/delegate-signer.mjs +84 -0
- package/dist/delegate-signer.mjs.map +1 -0
- package/dist/deploy-diff.cjs +119 -0
- package/dist/deploy-diff.cjs.map +1 -0
- package/dist/deploy-diff.mjs +109 -0
- package/dist/deploy-diff.mjs.map +1 -0
- package/dist/descriptor/constructors.cjs +49 -0
- package/dist/descriptor/constructors.cjs.map +1 -0
- package/dist/descriptor/constructors.d.cts +27 -0
- package/dist/descriptor/constructors.d.mts +27 -0
- package/dist/descriptor/constructors.mjs +45 -0
- package/dist/descriptor/constructors.mjs.map +1 -0
- package/dist/descriptor/index.cjs +24 -0
- package/dist/descriptor/index.d.cts +5 -0
- package/dist/descriptor/index.d.mts +5 -0
- package/dist/descriptor/index.mjs +6 -0
- package/dist/descriptor/resolve.cjs +258 -0
- package/dist/descriptor/resolve.cjs.map +1 -0
- package/dist/descriptor/resolve.d.cts +50 -0
- package/dist/descriptor/resolve.d.mts +50 -0
- package/dist/descriptor/resolve.mjs +252 -0
- package/dist/descriptor/resolve.mjs.map +1 -0
- package/dist/descriptor/schema.cjs +109 -0
- package/dist/descriptor/schema.cjs.map +1 -0
- package/dist/descriptor/schema.d.cts +217 -0
- package/dist/descriptor/schema.d.mts +217 -0
- package/dist/descriptor/schema.mjs +102 -0
- package/dist/descriptor/schema.mjs.map +1 -0
- package/dist/descriptor/serialize.cjs +45 -0
- package/dist/descriptor/serialize.cjs.map +1 -0
- package/dist/descriptor/serialize.d.cts +7 -0
- package/dist/descriptor/serialize.d.mts +7 -0
- package/dist/descriptor/serialize.mjs +45 -0
- package/dist/descriptor/serialize.mjs.map +1 -0
- package/dist/dev-log-pipeline.cjs +273 -0
- package/dist/dev-log-pipeline.cjs.map +1 -0
- package/dist/dev-log-pipeline.mjs +267 -0
- package/dist/dev-log-pipeline.mjs.map +1 -0
- package/dist/dev-logs.cjs +39 -8
- package/dist/dev-logs.cjs.map +1 -1
- package/dist/dev-logs.mjs +37 -9
- package/dist/dev-logs.mjs.map +1 -1
- package/dist/dev-program.cjs +405 -0
- package/dist/dev-program.cjs.map +1 -0
- package/dist/dev-program.d.cts +10 -0
- package/dist/dev-program.d.mts +10 -0
- package/dist/dev-program.mjs +395 -0
- package/dist/dev-program.mjs.map +1 -0
- package/dist/dev-session-data.d.cts +27 -0
- package/dist/dev-session-data.d.mts +27 -0
- package/dist/dev-session.cjs +178 -105
- package/dist/dev-session.cjs.map +1 -1
- package/dist/dev-session.mjs +180 -105
- package/dist/dev-session.mjs.map +1 -1
- package/dist/env/process-env.cjs +16 -0
- package/dist/env/process-env.cjs.map +1 -0
- package/dist/env/process-env.mjs +13 -0
- package/dist/env/process-env.mjs.map +1 -0
- package/dist/env/project-env.cjs +144 -0
- package/dist/env/project-env.cjs.map +1 -0
- package/dist/env/project-env.d.cts +1 -0
- package/dist/env/project-env.d.mts +1 -0
- package/dist/env/project-env.mjs +132 -0
- package/dist/env/project-env.mjs.map +1 -0
- package/dist/fastkv.cjs +59 -12
- package/dist/fastkv.cjs.map +1 -1
- package/dist/fastkv.d.cts +42 -6
- package/dist/fastkv.d.mts +42 -6
- package/dist/fastkv.mjs +58 -13
- package/dist/fastkv.mjs.map +1 -1
- package/dist/fingerprint.cjs +57 -0
- package/dist/fingerprint.cjs.map +1 -0
- package/dist/fingerprint.d.cts +14 -0
- package/dist/fingerprint.d.mts +14 -0
- package/dist/fingerprint.mjs +55 -0
- package/dist/fingerprint.mjs.map +1 -0
- package/dist/http-client.cjs +17 -17
- package/dist/http-client.cjs.map +1 -1
- package/dist/http-client.mjs +17 -17
- package/dist/http-client.mjs.map +1 -1
- package/dist/image-deploy.cjs +186 -0
- package/dist/image-deploy.cjs.map +1 -0
- package/dist/image-deploy.mjs +182 -0
- package/dist/image-deploy.mjs.map +1 -0
- package/dist/index.cjs +66 -18
- package/dist/index.d.cts +8 -7
- package/dist/index.d.mts +8 -7
- package/dist/index.mjs +6 -5
- package/dist/infra/docker.cjs +77 -0
- package/dist/infra/docker.cjs.map +1 -0
- package/dist/infra/docker.d.cts +10 -0
- package/dist/infra/docker.d.mts +10 -0
- package/dist/infra/docker.mjs +69 -0
- package/dist/infra/docker.mjs.map +1 -0
- package/dist/infra/materializer.cjs +74 -0
- package/dist/infra/materializer.cjs.map +1 -0
- package/dist/infra/materializer.mjs +70 -0
- package/dist/infra/materializer.mjs.map +1 -0
- package/dist/infra/planner.cjs +135 -103
- package/dist/infra/planner.cjs.map +1 -1
- package/dist/infra/planner.mjs +137 -104
- package/dist/infra/planner.mjs.map +1 -1
- package/dist/infra/port-ownership.cjs +57 -0
- package/dist/infra/port-ownership.cjs.map +1 -0
- package/dist/infra/port-ownership.mjs +57 -0
- package/dist/infra/port-ownership.mjs.map +1 -0
- package/dist/infra/preflight.cjs +45 -33
- package/dist/infra/preflight.cjs.map +1 -1
- package/dist/infra/preflight.d.cts +1 -0
- package/dist/infra/preflight.d.mts +1 -0
- package/dist/infra/preflight.mjs +46 -34
- package/dist/infra/preflight.mjs.map +1 -1
- package/dist/infra/types.cjs.map +1 -1
- package/dist/infra/types.d.cts +2 -0
- package/dist/infra/types.d.mts +2 -0
- package/dist/infra/types.mjs.map +1 -1
- package/dist/integrity.cjs +50 -61
- package/dist/integrity.cjs.map +1 -1
- package/dist/integrity.d.cts +16 -10
- package/dist/integrity.d.mts +16 -10
- package/dist/integrity.mjs +50 -59
- package/dist/integrity.mjs.map +1 -1
- package/dist/internal/manifest-normalizer.cjs +8 -2
- package/dist/internal/manifest-normalizer.cjs.map +1 -1
- package/dist/internal/manifest-normalizer.mjs +9 -3
- package/dist/internal/manifest-normalizer.mjs.map +1 -1
- package/dist/merge.cjs +19 -1
- package/dist/merge.cjs.map +1 -1
- package/dist/merge.d.cts +1 -1
- package/dist/merge.d.mts +1 -1
- package/dist/merge.mjs +19 -2
- package/dist/merge.mjs.map +1 -1
- package/dist/mf.cjs +190 -3
- package/dist/mf.cjs.map +1 -1
- package/dist/mf.d.cts +24 -2
- package/dist/mf.d.mts +24 -2
- package/dist/mf.mjs +189 -4
- package/dist/mf.mjs.map +1 -1
- package/dist/near-cli.cjs +59 -91
- package/dist/near-cli.cjs.map +1 -1
- package/dist/near-cli.mjs +58 -90
- package/dist/near-cli.mjs.map +1 -1
- package/dist/near-signer.cjs +73 -0
- package/dist/near-signer.cjs.map +1 -0
- package/dist/near-signer.mjs +70 -0
- package/dist/near-signer.mjs.map +1 -0
- package/dist/network.cjs +0 -1
- package/dist/network.cjs.map +1 -1
- package/dist/orchestrator.cjs +256 -87
- package/dist/orchestrator.cjs.map +1 -1
- package/dist/orchestrator.mjs +248 -87
- package/dist/orchestrator.mjs.map +1 -1
- package/dist/platform-deploy.cjs +81 -0
- package/dist/platform-deploy.cjs.map +1 -0
- package/dist/platform-deploy.mjs +80 -0
- package/dist/platform-deploy.mjs.map +1 -0
- package/dist/plugin.cjs +54 -1389
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.cts +6 -896
- package/dist/plugin.d.mts +6 -896
- package/dist/plugin.mjs +53 -1387
- package/dist/plugin.mjs.map +1 -1
- package/dist/process-kill.cjs +44 -0
- package/dist/process-kill.cjs.map +1 -0
- package/dist/process-kill.mjs +43 -0
- package/dist/process-kill.mjs.map +1 -0
- package/dist/process-registry.cjs +64 -9
- package/dist/process-registry.cjs.map +1 -1
- package/dist/process-registry.mjs +61 -10
- package/dist/process-registry.mjs.map +1 -1
- package/dist/progress.cjs +45 -0
- package/dist/progress.cjs.map +1 -0
- package/dist/progress.d.cts +13 -0
- package/dist/progress.d.mts +13 -0
- package/dist/progress.mjs +42 -0
- package/dist/progress.mjs.map +1 -0
- package/dist/publish.cjs +513 -79
- package/dist/publish.cjs.map +1 -1
- package/dist/publish.mjs +515 -82
- package/dist/publish.mjs.map +1 -1
- package/dist/registry-use.cjs +41 -0
- package/dist/registry-use.cjs.map +1 -0
- package/dist/registry-use.mjs +40 -0
- package/dist/registry-use.mjs.map +1 -0
- package/dist/resolution/session.cjs +335 -0
- package/dist/resolution/session.cjs.map +1 -0
- package/dist/resolution/session.d.cts +105 -0
- package/dist/resolution/session.d.mts +105 -0
- package/dist/resolution/session.mjs +331 -0
- package/dist/resolution/session.mjs.map +1 -0
- package/dist/rollback.cjs +131 -0
- package/dist/rollback.cjs.map +1 -0
- package/dist/rollback.mjs +128 -0
- package/dist/rollback.mjs.map +1 -0
- package/dist/sdk.cjs +7 -7
- package/dist/sdk.d.cts +3 -3
- package/dist/sdk.d.mts +3 -3
- package/dist/sdk.mjs +2 -2
- package/dist/service-descriptor.cjs +67 -34
- package/dist/service-descriptor.cjs.map +1 -1
- package/dist/service-descriptor.d.cts +4 -1
- package/dist/service-descriptor.d.mts +3 -0
- package/dist/service-descriptor.mjs +63 -35
- package/dist/service-descriptor.mjs.map +1 -1
- package/dist/shared-deps.cjs +17 -16
- package/dist/shared-deps.cjs.map +1 -1
- package/dist/shared-deps.mjs +17 -16
- package/dist/shared-deps.mjs.map +1 -1
- package/dist/start-config-source.cjs +24 -0
- package/dist/start-config-source.cjs.map +1 -0
- package/dist/start-config-source.d.cts +29 -0
- package/dist/start-config-source.d.mts +29 -0
- package/dist/start-config-source.mjs +22 -0
- package/dist/start-config-source.mjs.map +1 -0
- package/dist/storage-upload.cjs +145 -0
- package/dist/storage-upload.cjs.map +1 -0
- package/dist/storage-upload.mjs +143 -0
- package/dist/storage-upload.mjs.map +1 -0
- package/dist/types.cjs +126 -20
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +867 -585
- package/dist/types.d.mts +867 -585
- package/dist/types.mjs +307 -208
- package/dist/types.mjs.map +1 -1
- package/dist/ui/api.cjs +105 -0
- package/dist/ui/api.cjs.map +1 -0
- package/dist/ui/api.d.cts +31 -0
- package/dist/ui/api.d.mts +31 -0
- package/dist/ui/api.mjs +99 -0
- package/dist/ui/api.mjs.map +1 -0
- package/dist/ui/auth-guards.cjs +50 -0
- package/dist/ui/auth-guards.cjs.map +1 -0
- package/dist/ui/auth-guards.d.cts +39 -0
- package/dist/ui/auth-guards.d.mts +39 -0
- package/dist/ui/auth-guards.mjs +48 -0
- package/dist/ui/auth-guards.mjs.map +1 -0
- package/dist/ui/auth.cjs +197 -0
- package/dist/ui/auth.cjs.map +1 -0
- package/dist/ui/auth.d.cts +56 -0
- package/dist/ui/auth.d.mts +56 -0
- package/dist/ui/auth.mjs +179 -0
- package/dist/ui/auth.mjs.map +1 -0
- package/dist/ui/entry.cjs +16 -0
- package/dist/ui/entry.cjs.map +1 -0
- package/dist/ui/entry.d.cts +12 -0
- package/dist/ui/entry.d.mts +12 -0
- package/dist/ui/entry.mjs +15 -0
- package/dist/ui/entry.mjs.map +1 -0
- package/dist/ui/head.cjs +14 -7
- package/dist/ui/head.cjs.map +1 -1
- package/dist/ui/head.mjs +15 -7
- package/dist/ui/head.mjs.map +1 -1
- package/dist/ui/hydrate.cjs +265 -0
- package/dist/ui/hydrate.cjs.map +1 -0
- package/dist/ui/hydrate.d.cts +48 -0
- package/dist/ui/hydrate.d.mts +48 -0
- package/dist/ui/hydrate.mjs +263 -0
- package/dist/ui/hydrate.mjs.map +1 -0
- package/dist/ui/i18n.cjs +153 -0
- package/dist/ui/i18n.cjs.map +1 -0
- package/dist/ui/i18n.d.cts +29 -0
- package/dist/ui/i18n.d.mts +29 -0
- package/dist/ui/i18n.mjs +140 -0
- package/dist/ui/i18n.mjs.map +1 -0
- package/dist/ui/index.cjs +19 -1
- package/dist/ui/index.d.cts +6 -3
- package/dist/ui/index.d.mts +6 -3
- package/dist/ui/index.mjs +5 -2
- package/dist/ui/locale.cjs +53 -0
- package/dist/ui/locale.cjs.map +1 -0
- package/dist/ui/locale.d.cts +18 -0
- package/dist/ui/locale.d.mts +18 -0
- package/dist/ui/locale.mjs +49 -0
- package/dist/ui/locale.mjs.map +1 -0
- package/dist/ui/manifest/index.cjs +25 -0
- package/dist/ui/manifest/index.cjs.map +1 -0
- package/dist/ui/manifest/index.d.cts +9 -0
- package/dist/ui/manifest/index.d.mts +9 -0
- package/dist/ui/manifest/index.mjs +13 -0
- package/dist/ui/manifest/index.mjs.map +1 -0
- package/dist/ui/manifest-generator.cjs +8 -0
- package/dist/ui/manifest-generator.d.cts +1 -0
- package/dist/ui/manifest-generator.d.mts +1 -0
- package/dist/ui/manifest-generator.mjs +3 -0
- package/dist/ui/message-catalogs.cjs +8 -0
- package/dist/ui/message-catalogs.cjs.map +1 -0
- package/dist/ui/message-catalogs.d.cts +5 -0
- package/dist/ui/message-catalogs.d.mts +5 -0
- package/dist/ui/message-catalogs.mjs +8 -0
- package/dist/ui/message-catalogs.mjs.map +1 -0
- package/dist/ui/metadata.cjs +0 -1
- package/dist/ui/metadata.cjs.map +1 -1
- package/dist/ui/metadata.d.cts +1 -1
- package/dist/ui/metadata.d.mts +1 -1
- package/dist/ui/plugin-path.cjs +37 -0
- package/dist/ui/plugin-path.cjs.map +1 -0
- package/dist/ui/plugin-path.d.cts +25 -0
- package/dist/ui/plugin-path.d.mts +25 -0
- package/dist/ui/plugin-path.mjs +35 -0
- package/dist/ui/plugin-path.mjs.map +1 -0
- package/dist/ui/router-client.cjs +61 -0
- package/dist/ui/router-client.cjs.map +1 -0
- package/dist/ui/router-client.d.cts +20 -0
- package/dist/ui/router-client.d.mts +20 -0
- package/dist/ui/router-client.mjs +60 -0
- package/dist/ui/router-client.mjs.map +1 -0
- package/dist/ui/router-defaults.cjs +48 -0
- package/dist/ui/router-defaults.cjs.map +1 -0
- package/dist/ui/router-defaults.d.cts +8 -0
- package/dist/ui/router-defaults.d.mts +8 -0
- package/dist/ui/router-defaults.mjs +45 -0
- package/dist/ui/router-defaults.mjs.map +1 -0
- package/dist/ui/router-error.cjs +70 -0
- package/dist/ui/router-error.cjs.map +1 -0
- package/dist/ui/router-error.d.cts +19 -0
- package/dist/ui/router-error.d.mts +19 -0
- package/dist/ui/router-error.mjs +69 -0
- package/dist/ui/router-error.mjs.map +1 -0
- package/dist/ui/router-server.cjs +153 -0
- package/dist/ui/router-server.cjs.map +1 -0
- package/dist/ui/router-server.d.cts +38 -0
- package/dist/ui/router-server.d.mts +38 -0
- package/dist/ui/router-server.mjs +152 -0
- package/dist/ui/router-server.mjs.map +1 -0
- package/dist/ui/router.cjs +4 -16
- package/dist/ui/router.cjs.map +1 -1
- package/dist/ui/router.mjs +4 -15
- package/dist/ui/router.mjs.map +1 -1
- package/dist/ui/runtime.cjs +5 -1
- package/dist/ui/runtime.cjs.map +1 -1
- package/dist/ui/runtime.d.cts +2 -1
- package/dist/ui/runtime.d.mts +2 -1
- package/dist/ui/runtime.mjs +5 -1
- package/dist/ui/runtime.mjs.map +1 -1
- package/dist/ui/slot.cjs +34 -0
- package/dist/ui/slot.cjs.map +1 -0
- package/dist/ui/slot.d.cts +43 -0
- package/dist/ui/slot.d.mts +43 -0
- package/dist/ui/slot.mjs +34 -0
- package/dist/ui/slot.mjs.map +1 -0
- package/dist/ui/tenant.cjs +300 -0
- package/dist/ui/tenant.cjs.map +1 -0
- package/dist/ui/tenant.d.cts +122 -0
- package/dist/ui/tenant.d.mts +122 -0
- package/dist/ui/tenant.mjs +279 -0
- package/dist/ui/tenant.mjs.map +1 -0
- package/dist/ui/types.d.cts +32 -2
- package/dist/ui/types.d.mts +32 -2
- package/dist/ui/version-check.cjs +47 -0
- package/dist/ui/version-check.cjs.map +1 -0
- package/dist/ui/version-check.d.cts +23 -0
- package/dist/ui/version-check.d.mts +23 -0
- package/dist/ui/version-check.mjs +46 -0
- package/dist/ui/version-check.mjs.map +1 -0
- package/dist/utils/banner.cjs +2 -2
- package/dist/utils/banner.cjs.map +1 -1
- package/dist/utils/banner.mjs +2 -2
- package/dist/utils/banner.mjs.map +1 -1
- package/dist/utils/linkify.cjs +1 -1
- package/dist/utils/linkify.cjs.map +1 -1
- package/dist/utils/linkify.mjs +1 -0
- package/dist/utils/linkify.mjs.map +1 -1
- package/dist/utils/run.cjs +6 -6
- package/dist/utils/run.cjs.map +1 -1
- package/dist/utils/run.mjs +6 -6
- package/dist/utils/run.mjs.map +1 -1
- package/dist/utils/save-config.cjs +12 -0
- package/dist/utils/save-config.cjs.map +1 -1
- package/dist/utils/save-config.mjs +12 -0
- package/dist/utils/save-config.mjs.map +1 -1
- package/dist/utils/snapshot-hash.cjs +10 -0
- package/dist/utils/snapshot-hash.cjs.map +1 -0
- package/dist/utils/snapshot-hash.mjs +10 -0
- package/dist/utils/snapshot-hash.mjs.map +1 -0
- package/dist/utils/string.cjs +0 -1
- package/dist/utils/string.cjs.map +1 -1
- package/dist/utils/theme.cjs +30 -12
- package/dist/utils/theme.cjs.map +1 -1
- package/dist/utils/theme.mjs +30 -11
- package/dist/utils/theme.mjs.map +1 -1
- package/dist/version-manifest-deploy.cjs +50 -0
- package/dist/version-manifest-deploy.cjs.map +1 -0
- package/dist/version-manifest-deploy.mjs +49 -0
- package/dist/version-manifest-deploy.mjs.map +1 -0
- package/dist/version-manifest-resolve.cjs +42 -0
- package/dist/version-manifest-resolve.cjs.map +1 -0
- package/dist/version-manifest-resolve.d.cts +38 -0
- package/dist/version-manifest-resolve.d.mts +38 -0
- package/dist/version-manifest-resolve.mjs +40 -0
- package/dist/version-manifest-resolve.mjs.map +1 -0
- package/dist/version-status.cjs +18 -0
- package/dist/version-status.cjs.map +1 -0
- package/dist/version-status.d.cts +22 -0
- package/dist/version-status.d.mts +22 -0
- package/dist/version-status.mjs +17 -0
- package/dist/version-status.mjs.map +1 -0
- package/dist/workspace-catalog.cjs +53 -0
- package/dist/workspace-catalog.cjs.map +1 -0
- package/dist/workspace-catalog.mjs +51 -0
- package/dist/workspace-catalog.mjs.map +1 -0
- package/dist/workspace.cjs +237 -0
- package/dist/workspace.cjs.map +1 -0
- package/dist/workspace.mjs +233 -0
- package/dist/workspace.mjs.map +1 -0
- package/package.json +179 -27
- package/skills/add-a-route/SKILL.md +132 -0
- package/skills/api-and-auth/SKILL.md +87 -21
- package/skills/api-and-auth/references/middleware.md +1 -1
- package/skills/cli-reference/SKILL.md +48 -21
- package/skills/code-style/SKILL.md +8 -0
- package/skills/dev-workflow/SKILL.md +50 -26
- package/skills/extends-config/SKILL.md +31 -19
- package/skills/init-upgrade/SKILL.md +29 -16
- package/skills/plugin-development/SKILL.md +46 -112
- package/skills/plugin-development/references/database.md +82 -0
- package/skills/plugin-development/references/request-context.md +67 -0
- package/skills/publish-sync/SKILL.md +99 -22
- package/skills/registry/SKILL.md +82 -0
- package/skills/super-app/SKILL.md +25 -15
- package/skills/talk-to-the-app/SKILL.md +138 -0
- package/skills/ui-integration/SKILL.md +93 -11
- package/dist/cli/db-studio.cjs +0 -131
- package/dist/cli/db-studio.cjs.map +0 -1
- package/dist/cli/db-studio.mjs +0 -127
- package/dist/cli/db-studio.mjs.map +0 -1
- package/dist/cli/init.d.cts.map +0 -1
- package/dist/cli/init.d.mts.map +0 -1
- package/dist/components/dev-view.cjs +0 -309
- package/dist/components/dev-view.cjs.map +0 -1
- package/dist/components/dev-view.mjs +0 -309
- package/dist/components/dev-view.mjs.map +0 -1
- package/dist/components/streaming-view.cjs +0 -134
- package/dist/components/streaming-view.cjs.map +0 -1
- package/dist/components/streaming-view.mjs +0 -132
- package/dist/components/streaming-view.mjs.map +0 -1
- package/dist/config.d.cts.map +0 -1
- package/dist/config.d.mts.map +0 -1
- package/dist/contract.d.cts.map +0 -1
- package/dist/contract.d.mts.map +0 -1
- package/dist/contract.meta.d.cts.map +0 -1
- package/dist/contract.meta.d.mts.map +0 -1
- package/dist/dag.d.cts.map +0 -1
- package/dist/dag.d.mts.map +0 -1
- package/dist/db.cjs +0 -81
- package/dist/db.cjs.map +0 -1
- package/dist/db.d.cts +0 -30
- package/dist/db.d.cts.map +0 -1
- package/dist/db.d.mts +0 -30
- package/dist/db.d.mts.map +0 -1
- package/dist/db.mjs +0 -75
- package/dist/db.mjs.map +0 -1
- package/dist/fastkv.d.cts.map +0 -1
- package/dist/fastkv.d.mts.map +0 -1
- package/dist/integrity.d.cts.map +0 -1
- package/dist/integrity.d.mts.map +0 -1
- package/dist/merge.d.cts.map +0 -1
- package/dist/merge.d.mts.map +0 -1
- package/dist/mf.d.cts.map +0 -1
- package/dist/mf.d.mts.map +0 -1
- package/dist/plugin.d.cts.map +0 -1
- package/dist/plugin.d.mts.map +0 -1
- package/dist/service-descriptor.d.cts.map +0 -1
- package/dist/service-descriptor.d.mts.map +0 -1
- package/dist/types.d.cts.map +0 -1
- package/dist/types.d.mts.map +0 -1
- package/dist/ui/head.d.cts.map +0 -1
- package/dist/ui/head.d.mts.map +0 -1
- package/dist/ui/metadata.d.cts.map +0 -1
- package/dist/ui/metadata.d.mts.map +0 -1
- package/dist/ui/router.d.cts.map +0 -1
- package/dist/ui/router.d.mts.map +0 -1
- package/dist/ui/runtime.d.cts.map +0 -1
- package/dist/ui/runtime.d.mts.map +0 -1
- package/dist/ui/types.d.cts.map +0 -1
- package/dist/ui/types.d.mts.map +0 -1
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: plugin-development
|
|
3
|
-
description: Build, register, and deploy plugins within everything.dev. Covers the _template scaffold, contract/service/index pattern, database setup with Drizzle,
|
|
3
|
+
description: Build, register, and deploy plugins within everything.dev. Covers the _template scaffold, contract/service/index pattern, database setup with Drizzle, authored-config registration, plugin UI/sidebar, and CLI workflow. Use when creating new plugins, adding database-backed routes, or deploying plugins to production.
|
|
4
4
|
metadata:
|
|
5
|
-
sources: "plugins/_template/src/index.ts,plugins/_template/src/contract.ts,plugins/_template/src/service.ts,
|
|
5
|
+
sources: "plugins/_template/src/index.ts,plugins/_template/src/contract.ts,plugins/_template/src/service.ts,packages/every-plugin/src/build/rspack,plugins/_template/plugin.dev.ts,plugins/_template/src/db/schema.ts,plugins/_template/src/db/layer.ts,api/src/db/index.ts,api/src/db/migrate.ts,packages/every-plugin/src/plugin.ts,packages/everything-dev/src/cli.ts"
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
> **Config form:** the authored config is `bos.app.ts` (canonical, preferred when both exist). A legacy `bos.config.json` is still supported for older children. Where this doc says `bos.config.json` for the *local authored file*, read "the authored config". The published artifact on FastKV keeps the key name `bos.config.json`.
|
|
9
|
+
|
|
8
10
|
# Plugin Development
|
|
9
11
|
|
|
10
12
|
## Plugin Structure
|
|
@@ -45,8 +47,8 @@ Or use the CLI (no automated command yet — copy template manually).
|
|
|
45
47
|
Use `oc.router()` to define typed routes. Each route has a method, path, optional input/output schemas, and optional error declarations:
|
|
46
48
|
|
|
47
49
|
```ts
|
|
48
|
-
import { eventIterator, oc } from "
|
|
49
|
-
import { z } from "
|
|
50
|
+
import { eventIterator, oc } from "@orpc/contract";
|
|
51
|
+
import { z } from "zod";
|
|
50
52
|
|
|
51
53
|
// Define errors this plugin throws
|
|
52
54
|
const Errors = {
|
|
@@ -86,7 +88,7 @@ export type ContractType = typeof contract;
|
|
|
86
88
|
```
|
|
87
89
|
|
|
88
90
|
Key rules:
|
|
89
|
-
- Import from `every-plugin/zod`, `every-plugin/orpc`, `every-plugin/
|
|
91
|
+
- Import `z` from `zod`, `oc`/`eventIterator` from `@orpc/contract`, and `Effect`/`Layer` from `effect` directly — the `every-plugin/zod`, `every-plugin/orpc`, and `every-plugin/effect` facade barrels were deleted. Use `every-plugin/errors` for the shared error shapes
|
|
90
92
|
- Path params (`{id}`) automatically bind to Zod input keys
|
|
91
93
|
- `.output(eventIterator(Schema))` enables SSE streaming routes
|
|
92
94
|
- `.errors(Errors)` enables typed error handling in generated clients
|
|
@@ -96,7 +98,7 @@ Key rules:
|
|
|
96
98
|
Services are plain classes or functions, optionally using Effect:
|
|
97
99
|
|
|
98
100
|
```ts
|
|
99
|
-
import { Effect } from "
|
|
101
|
+
import { Effect } from "effect";
|
|
100
102
|
|
|
101
103
|
export class TemplateService {
|
|
102
104
|
constructor(
|
|
@@ -127,10 +129,10 @@ Use `Effect.runPromise(service.method())` to bridge Effect and async handlers in
|
|
|
127
129
|
## Step 4: Wire with `createPlugin` (`src/index.ts`)
|
|
128
130
|
|
|
129
131
|
```ts
|
|
132
|
+
import { ORPCError } from "@orpc/server";
|
|
133
|
+
import { Effect } from "effect";
|
|
130
134
|
import { createPlugin } from "every-plugin";
|
|
131
|
-
import {
|
|
132
|
-
import { MemoryPublisher, ORPCError } from "every-plugin/orpc";
|
|
133
|
-
import { z } from "every-plugin/zod";
|
|
135
|
+
import { z } from "zod";
|
|
134
136
|
import { contract } from "./contract";
|
|
135
137
|
import type { PluginsClient } from "./plugins-client.gen";
|
|
136
138
|
import { TemplateService } from "./service";
|
|
@@ -167,7 +169,7 @@ export default createPlugin.withPlugins<PluginsClient>()({
|
|
|
167
169
|
const publisher = new MemoryPublisher({ resumeRetentionSeconds: 120 });
|
|
168
170
|
|
|
169
171
|
// For scoped resources (DB pools, caches, repositories):
|
|
170
|
-
// const repo = yield*
|
|
172
|
+
// const repo = yield* buildScoped(MyRepoTag, MyRepoLive.pipe(...))
|
|
171
173
|
|
|
172
174
|
return { service, publisher };
|
|
173
175
|
}),
|
|
@@ -236,67 +238,21 @@ Good practice:
|
|
|
236
238
|
|
|
237
239
|
### Key Patterns
|
|
238
240
|
|
|
239
|
-
**`variables`** — Public config exposed in
|
|
241
|
+
**`variables`** — Public config exposed in the authored config (typed, with defaults).
|
|
240
242
|
**`secrets`** — Private values from `process.env` (typed, dev defaults).
|
|
241
243
|
**`context`** — Per-request context injected by the host. See "Request Context Reference" below for all available fields.
|
|
242
|
-
**`initialize`** — Effect-based startup.
|
|
243
|
-
**`tools`** — Framework-provided third argument in `initialize(config, plugins, tools)`. Use `tools.buildService(tag, layer)` to build scoped resources (DB pools, caches, repositories) that live for the plugin's lifetime.
|
|
244
|
+
**`initialize`** — Effect-based startup. Return an Effect `Layer`; the runtime builds it against the plugin's lifecycle scope. Use `buildScoped(tag, layer)` (or `buildScopedContext(layer)` for multi-service layers) from `"every-plugin"` to build scoped resources (DB pools, caches, repositories) that live for the plugin's lifetime.
|
|
244
245
|
**`createRouter`** — Maps contract procedures to handlers. Receives the value returned by `initialize` plus a pre-configured `builder`.
|
|
245
246
|
|
|
246
|
-
## Request Context
|
|
247
|
+
## Request Context
|
|
247
248
|
|
|
248
|
-
The host injects a per-request context object into every plugin. The plugin **must declare the fields it uses** in its context zod schema
|
|
249
|
+
The host injects a per-request context object into every plugin. The plugin **must declare the fields it uses** in its context zod schema — the schema is a filter; the host passes all fields, but your plugin only sees what you declare.
|
|
249
250
|
|
|
250
|
-
|
|
251
|
-
context: z.object({
|
|
252
|
-
userId: z.string().optional(),
|
|
253
|
-
user: z.object({
|
|
254
|
-
id: z.string(),
|
|
255
|
-
role: z.string().optional(), // "admin", "member", or null for anon
|
|
256
|
-
email: z.string().optional(),
|
|
257
|
-
name: z.string().optional(),
|
|
258
|
-
}).optional(),
|
|
259
|
-
organizationId: z.string().optional(), // Active organization UUID
|
|
260
|
-
organization: z.object({
|
|
261
|
-
activeOrganizationId: z.string().nullable().optional(),
|
|
262
|
-
organization: z.object({
|
|
263
|
-
id: z.string(),
|
|
264
|
-
name: z.string(),
|
|
265
|
-
slug: z.string(),
|
|
266
|
-
logo: z.string().nullable().optional(),
|
|
267
|
-
metadata: z.record(z.string(), z.unknown()).optional(), // daoAccountId lives here
|
|
268
|
-
}).nullable().optional(),
|
|
269
|
-
member: z.object({
|
|
270
|
-
id: z.string(),
|
|
271
|
-
role: z.string(), // User's role within this org ("admin", "member")
|
|
272
|
-
}).nullable().optional(),
|
|
273
|
-
isPersonal: z.boolean(),
|
|
274
|
-
hasOrganization: z.boolean(),
|
|
275
|
-
}).optional(),
|
|
276
|
-
near: z.object({
|
|
277
|
-
primaryAccountId: z.string().nullable(),
|
|
278
|
-
linkedAccounts: z.array(z.object({
|
|
279
|
-
accountId: z.string(),
|
|
280
|
-
network: z.string(),
|
|
281
|
-
publicKey: z.string(),
|
|
282
|
-
isPrimary: z.boolean(),
|
|
283
|
-
})),
|
|
284
|
-
hasNearAccount: z.boolean(),
|
|
285
|
-
}).optional(),
|
|
286
|
-
walletAddress: z.string().optional(),
|
|
287
|
-
apiKey: z.object({
|
|
288
|
-
id: z.string(),
|
|
289
|
-
name: z.string().nullable().optional(),
|
|
290
|
-
permissions: z.record(z.string(), z.array(z.string())).nullable().optional(),
|
|
291
|
-
}).optional(),
|
|
292
|
-
reqHeaders: z.custom<Headers>().optional(),
|
|
293
|
-
getRawBody: z.custom<() => Promise<string>>().optional(),
|
|
294
|
-
}),
|
|
295
|
-
```
|
|
251
|
+
Available fields: `userId`, `user` (id, role, email, name), `organizationId` / `organization` (active org envelope, `member.role`, `metadata.daoAccountId`), `near` (primaryAccountId, linkedAccounts), `walletAddress`, `apiKey` (id, name, permissions), `reqHeaders`, `getRawBody`.
|
|
296
252
|
|
|
297
|
-
|
|
253
|
+
See [request-context](references/request-context.md) for the full schema and field table. For pre-built auth/organization middleware, see the `api-and-auth` skill.
|
|
298
254
|
|
|
299
|
-
## Step 5: Register in
|
|
255
|
+
## Step 5: Register in the authored config
|
|
300
256
|
|
|
301
257
|
Add a plugin entry:
|
|
302
258
|
|
|
@@ -323,7 +279,9 @@ Add a plugin entry:
|
|
|
323
279
|
}
|
|
324
280
|
```
|
|
325
281
|
|
|
326
|
-
The CLI updates `bos.
|
|
282
|
+
The CLI updates the authored config (`bos.app.ts`) automatically when you run `bos plugin add` / `bos plugin remove`.
|
|
283
|
+
|
|
284
|
+
**Remote-only plugins:** The `development` key is optional. A plugin can be remote-only (just a `production` URL) — the host/API consume it via `pluginsClient` and HTTP, and types resolve from the deployed manifest. Plugin source does not need to live in the consuming repo. This is how plugins maintained in other repos are mounted.
|
|
327
285
|
|
|
328
286
|
## Step 6: `plugin.dev.ts`
|
|
329
287
|
|
|
@@ -393,57 +351,15 @@ export async function createDatabaseDriver(url: string) {
|
|
|
393
351
|
|
|
394
352
|
### Layer Pattern
|
|
395
353
|
|
|
396
|
-
|
|
397
|
-
// src/db/layer.ts
|
|
398
|
-
import { Effect, Layer } from "every-plugin/effect";
|
|
399
|
-
import { createDatabaseDriver } from "./index";
|
|
400
|
-
|
|
401
|
-
export class DatabaseTag extends Context.Tag("plugins/your-plugin/Database")<
|
|
402
|
-
DatabaseTag,
|
|
403
|
-
{ db: any; close: () => Promise<void> }
|
|
404
|
-
>() {}
|
|
405
|
-
|
|
406
|
-
export function DatabaseLive(url: string) {
|
|
407
|
-
return Layer.scoped(
|
|
408
|
-
DatabaseTag,
|
|
409
|
-
Effect.acquireRelease(
|
|
410
|
-
Effect.promise(async () => {
|
|
411
|
-
const driver = await createDatabaseDriver(url);
|
|
412
|
-
return driver;
|
|
413
|
-
}),
|
|
414
|
-
(driver) => Effect.promise(() => driver.close()),
|
|
415
|
-
),
|
|
416
|
-
);
|
|
417
|
-
}
|
|
418
|
-
```
|
|
354
|
+
`DatabaseLive` is a `Layer.scoped` that creates the driver, runs migrations (inside the scoped layer, so the pool stays open for migration queries), and returns the `db`. `acquireRelease` closes the driver on scope release. See [database](references/database.md) for the full implementation.
|
|
419
355
|
|
|
420
356
|
### Migration Generation
|
|
421
357
|
|
|
422
358
|
1. Create `drizzle.config.ts` in your plugin directory
|
|
423
359
|
2. Run `drizzle-kit generate` to produce SQL migration files
|
|
424
|
-
3. Store migrations in `src/db/migrations/`
|
|
425
|
-
4. Use the custom `migrate()` function during `initialize`. Pass an explicit
|
|
426
|
-
`storage` resolved from the workspace so the journal slug is reliable
|
|
427
|
-
under rspack/Module Federation bundling (the no-arg fallback reads
|
|
428
|
-
`npm_package_name`, which is unreliable in bundled remotes):
|
|
360
|
+
3. Store migrations in `src/db/migrations/` with an explicit `storage` resolved from the workspace (the no-arg fallback reads `npm_package_name`, unreliable under rspack/Module Federation bundling)
|
|
429
361
|
|
|
430
|
-
|
|
431
|
-
initialize: (config) =>
|
|
432
|
-
Effect.gen(function* () {
|
|
433
|
-
const driver = yield* DatabaseLive(config.secrets.DATABASE_URL);
|
|
434
|
-
// Or load and apply migrations directly:
|
|
435
|
-
const { loadMigrations } = yield* Effect.promise(() => import("./db/load-migrations"));
|
|
436
|
-
const { migrate } = yield* Effect.promise(() => import("./db/migrator"));
|
|
437
|
-
const { getMigrationSlug, getMigrationStorage } = yield* Effect.promise(
|
|
438
|
-
() => import("everything-dev/db"),
|
|
439
|
-
);
|
|
440
|
-
const storage = getMigrationStorage(getMigrationSlug(import.meta.dirname));
|
|
441
|
-
const migrations = yield* loadMigrations();
|
|
442
|
-
yield* migrate(driver.db, migrations, storage);
|
|
443
|
-
|
|
444
|
-
return { db: driver.db, ... };
|
|
445
|
-
}),
|
|
446
|
-
```
|
|
362
|
+
Migrations run inside `DatabaseLive`'s scoped layer. The critical rule is to **build the DB-backed service via `buildScoped`** so the scope (and the pool) lives for the plugin's lifetime. Do NOT call `DatabaseLive` directly in `initialize` and extract the driver — that creates a transient scope that releases the pool immediately. See [database](references/database.md) for correct/wrong examples.
|
|
447
363
|
|
|
448
364
|
### Per-Plugin Isolation
|
|
449
365
|
|
|
@@ -461,7 +377,7 @@ Use `createPlugin.withPlugins<PluginsClient>()` to get typed access to other plu
|
|
|
461
377
|
|
|
462
378
|
## Plugin UI
|
|
463
379
|
|
|
464
|
-
Add a UI remote via the `ui` field in
|
|
380
|
+
Add a UI remote via the `ui` field in the authored config. Sidebar items are defined manually in `ui/src/components/layout/nav-items.ts`.
|
|
465
381
|
|
|
466
382
|
## Deploy
|
|
467
383
|
|
|
@@ -470,12 +386,30 @@ bos plugin publish # Build and publish just this plugin
|
|
|
470
386
|
bos publish --deploy # Build ALL packages + deploy + publish config
|
|
471
387
|
```
|
|
472
388
|
|
|
473
|
-
|
|
389
|
+
Builds the plugin, pins the deterministic image-native production URL into the published config (`https://<domain>/bundles/<account>/<gateway>/<key>/`), and publishes to FastKV registry. Restart the host after publishing.
|
|
474
390
|
|
|
475
391
|
### CLI Lifecycle
|
|
476
392
|
|
|
477
393
|
1. `cp -r plugins/_template plugins/your-plugin` then edit names
|
|
478
|
-
2. Register in
|
|
394
|
+
2. Register in the authored config (or `bos plugin add`)
|
|
479
395
|
3. `bos types gen`
|
|
480
396
|
4. `bos dev` to develop
|
|
481
397
|
5. `bos plugin publish` to deploy
|
|
398
|
+
|
|
399
|
+
## The tasks you will actually be given
|
|
400
|
+
|
|
401
|
+
**"Add a DB-backed route."** Schema in `src/db/schema.ts` → `drizzle-kit generate` → inside `initialize`, build the repo with `buildScoped(RepoTag, RepoLive.pipe(Layer.provide(DatabaseLive(config.secrets.YOURPLUGIN_DATABASE_URL))))` → handler is `.effect(function* ...)` and does `yield* RepoTag`.
|
|
402
|
+
|
|
403
|
+
**"Register and deploy a new plugin."** `bos plugin add local:plugins/your-plugin` (writes the authored config + regenerates types) → `pnpm run typecheck` → `bos plugin publish your-plugin` → restart the host.
|
|
404
|
+
|
|
405
|
+
**"Expose a service to the host, not just oRPC."** Set `servicesTag` on the plugin definition — handlers keep accessing it with `yield* Tag` as normal.
|
|
406
|
+
|
|
407
|
+
## What comes back when it fails
|
|
408
|
+
|
|
409
|
+
| word | do |
|
|
410
|
+
|---|---|
|
|
411
|
+
| pool dead / connection released right after startup | a transient scope — you extracted the driver instead of building the service via `buildScoped(...)` inside `initialize`; rebuild it that way (see [database](references/database.md)) |
|
|
412
|
+
| `ModuleFederationError` / `__webpack_modules__[e].call` in the browser | the deployed `mf-manifest.json` is older than the host's federation runtime — `bos mf check`, then `bos plugin publish <key>`, restart the host |
|
|
413
|
+
| migration never runs | migrations execute inside `DatabaseLive`'s scoped layer at plugin boot — confirm the plugin booted and the `<YOU>_DATABASE_URL` secret resolves |
|
|
414
|
+
| handler can't see `context.userId` | the context zod schema is a filter — declare every field you use or the host's value is stripped |
|
|
415
|
+
| stale types in `plugins-client.gen.ts` | `bos types gen` (or `pnpm run typecheck`) after editing any contract |
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Database Layer Pattern
|
|
2
|
+
|
|
3
|
+
`DatabaseLive` is a `Layer.scoped` that creates the driver, runs migrations, and returns the `db`. The `acquireRelease` ensures `driver.close()` runs when the scope is released. Migrations run **inside** the scoped layer so the pool stays open for the migration queries:
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
// src/db/layer.ts
|
|
7
|
+
import { PluginIdTag } from "every-plugin";
|
|
8
|
+
import { Context, Effect, Layer } from "effect";
|
|
9
|
+
import { getMigrationStorage, pluginMigrationSlug } from "everything-dev/db";
|
|
10
|
+
import { createDatabaseDriver, type Database, DatabaseError } from "./index";
|
|
11
|
+
import { detectDrift, loadMigrations, migrate } from "./migrate";
|
|
12
|
+
|
|
13
|
+
export class DatabaseTag extends Context.Tag("Database")<Database, Database>() {}
|
|
14
|
+
|
|
15
|
+
export const DatabaseLive = (url: string) =>
|
|
16
|
+
Layer.scoped(
|
|
17
|
+
DatabaseTag,
|
|
18
|
+
Effect.gen(function* () {
|
|
19
|
+
const pluginId = yield* PluginIdTag;
|
|
20
|
+
const slug = pluginMigrationSlug(pluginId);
|
|
21
|
+
const schemaName = `plugin_${slug}`;
|
|
22
|
+
|
|
23
|
+
const driver = yield* Effect.acquireRelease(
|
|
24
|
+
Effect.tryPromise({
|
|
25
|
+
try: () => createDatabaseDriver(url, schemaName),
|
|
26
|
+
catch: (cause) => new DatabaseError({ stage: "driver", cause }),
|
|
27
|
+
}),
|
|
28
|
+
(driver) =>
|
|
29
|
+
Effect.tryPromise({
|
|
30
|
+
try: () => driver.close(),
|
|
31
|
+
catch: (cause) => new DatabaseError({ stage: "close", cause }),
|
|
32
|
+
}).pipe(Effect.ignore),
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
const storage = getMigrationStorage(slug);
|
|
36
|
+
const { migrations, source } = yield* loadMigrations();
|
|
37
|
+
|
|
38
|
+
if (migrations.length > 0) {
|
|
39
|
+
const applied = yield* migrate(driver.db, migrations, storage, schemaName);
|
|
40
|
+
yield* Effect.logInfo(
|
|
41
|
+
`[Database] Applied ${applied}/${migrations.length} migration(s) (source: ${source})`,
|
|
42
|
+
);
|
|
43
|
+
const drift = yield* detectDrift(driver.db, migrations, storage, schemaName);
|
|
44
|
+
if (drift.status === "healthy" || drift.status === "untracked-existing-schema") {
|
|
45
|
+
yield* Effect.logInfo(`[Database] Ready`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return driver.db;
|
|
50
|
+
}),
|
|
51
|
+
);
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Migration Generation
|
|
55
|
+
|
|
56
|
+
1. Create `drizzle.config.ts` in your plugin directory
|
|
57
|
+
2. Run `drizzle-kit generate` to produce SQL migration files
|
|
58
|
+
3. Store migrations in `src/db/migrations/`
|
|
59
|
+
4. Pass an explicit `storage` resolved from the workspace so the journal slug is reliable
|
|
60
|
+
under rspack/Module Federation bundling (the no-arg fallback reads
|
|
61
|
+
`npm_package_name`, which is unreliable in bundled remotes).
|
|
62
|
+
|
|
63
|
+
Migrations run inside `DatabaseLive`'s scoped layer. The critical rule is to **build the DB-backed service via `buildScoped`** so the scope (and the pool) lives for the plugin's lifetime. Do NOT call `DatabaseLive` directly in `initialize` and extract the driver — that creates a transient scope that releases the pool immediately:
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
// CORRECT — buildScoped binds the scope to the plugin lifecycle
|
|
67
|
+
initialize: (config, _plugins) =>
|
|
68
|
+
Effect.gen(function* () {
|
|
69
|
+
const database = DatabaseLive(config.secrets.DATABASE_URL);
|
|
70
|
+
const serviceLayer = MyServiceLive.pipe(Layer.provide(database));
|
|
71
|
+
const myService = yield* buildScoped(MyServiceTag, serviceLayer);
|
|
72
|
+
|
|
73
|
+
return { myService };
|
|
74
|
+
}),
|
|
75
|
+
|
|
76
|
+
// WRONG — transient scope: pool.end() fires immediately, migrations fail
|
|
77
|
+
initialize: (config) =>
|
|
78
|
+
Effect.gen(function* () {
|
|
79
|
+
const driver = yield* DatabaseLive(config.secrets.DATABASE_URL);
|
|
80
|
+
return { db: driver.db };
|
|
81
|
+
}),
|
|
82
|
+
```
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Request Context Reference
|
|
2
|
+
|
|
3
|
+
The host injects a per-request context object into every plugin. The plugin **must declare the fields it uses** in its context zod schema. Only declared fields are available to route handlers and middleware — the schema is a filter.
|
|
4
|
+
|
|
5
|
+
## Full Schema
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
context: z.object({
|
|
9
|
+
userId: z.string().optional(),
|
|
10
|
+
user: z.object({
|
|
11
|
+
id: z.string(),
|
|
12
|
+
role: z.string().optional(), // "admin", "member", or null for anon
|
|
13
|
+
email: z.string().optional(),
|
|
14
|
+
name: z.string().optional(),
|
|
15
|
+
}).optional(),
|
|
16
|
+
organizationId: z.string().optional(), // Active organization UUID
|
|
17
|
+
organization: z.object({
|
|
18
|
+
activeOrganizationId: z.string().nullable().optional(),
|
|
19
|
+
organization: z.object({
|
|
20
|
+
id: z.string(),
|
|
21
|
+
name: z.string(),
|
|
22
|
+
slug: z.string(),
|
|
23
|
+
logo: z.string().nullable().optional(),
|
|
24
|
+
metadata: z.record(z.string(), z.unknown()).optional(), // daoAccountId lives here
|
|
25
|
+
}).nullable().optional(),
|
|
26
|
+
member: z.object({
|
|
27
|
+
id: z.string(),
|
|
28
|
+
role: z.string(), // User's role within this org ("admin", "member")
|
|
29
|
+
}).nullable().optional(),
|
|
30
|
+
isPersonal: z.boolean(),
|
|
31
|
+
hasOrganization: z.boolean(),
|
|
32
|
+
}).optional(),
|
|
33
|
+
near: z.object({
|
|
34
|
+
primaryAccountId: z.string().nullable(),
|
|
35
|
+
linkedAccounts: z.array(z.object({
|
|
36
|
+
accountId: z.string(),
|
|
37
|
+
network: z.string(),
|
|
38
|
+
publicKey: z.string(),
|
|
39
|
+
isPrimary: z.boolean(),
|
|
40
|
+
})),
|
|
41
|
+
hasNearAccount: z.boolean(),
|
|
42
|
+
}).optional(),
|
|
43
|
+
walletAddress: z.string().optional(),
|
|
44
|
+
apiKey: z.object({
|
|
45
|
+
id: z.string(),
|
|
46
|
+
name: z.string().nullable().optional(),
|
|
47
|
+
permissions: z.record(z.string(), z.array(z.string())).nullable().optional(),
|
|
48
|
+
}).optional(),
|
|
49
|
+
reqHeaders: z.custom<Headers>().optional(),
|
|
50
|
+
getRawBody: z.custom<() => Promise<string>>().optional(),
|
|
51
|
+
}),
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Field Summary
|
|
55
|
+
|
|
56
|
+
| Field | Description |
|
|
57
|
+
|-------|-------------|
|
|
58
|
+
| `userId` | Authenticated user id (absent for anon) |
|
|
59
|
+
| `user` | Full user record (id, role, email, name) |
|
|
60
|
+
| `organizationId` / `organization` | Active org envelope from Better Auth: `activeOrganizationId`, org details (`metadata.daoAccountId`), and the user's `member.role` |
|
|
61
|
+
| `near` | Primary NEAR account + linked accounts (accountId, network, publicKey, isPrimary) |
|
|
62
|
+
| `walletAddress` | Primary NEAR account id, flat |
|
|
63
|
+
| `apiKey` | API key auth: `id`, `name`, `permissions` (resource → action list) |
|
|
64
|
+
| `reqHeaders` | Incoming request `Headers` (forward to auth client) |
|
|
65
|
+
| `getRawBody` | Raw body accessor (webhook-style handlers) |
|
|
66
|
+
|
|
67
|
+
For pre-built auth/organization middleware, see the `api-and-auth` skill.
|
|
@@ -1,50 +1,58 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: publish-sync
|
|
3
|
-
description: Publish bos.
|
|
3
|
+
description: Publish the authored config (bos.app.ts) to the FastKV registry, sync from upstream, and upgrade workspace packages. Use when deploying, syncing, or managing runtime configuration across projects.
|
|
4
4
|
metadata:
|
|
5
5
|
sources: "packages/everything-dev/src/plugin.ts,packages/everything-dev/src/cli/sync.ts,packages/everything-dev/src/cli/upgrade.ts,packages/everything-dev/src/fastkv.ts,packages/everything-dev/src/integrity.ts,packages/everything-dev/src/config.ts"
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
> **Config form:** the authored config is `bos.app.ts` (canonical, preferred when both exist). A legacy `bos.config.json` is still supported for older children. Where this doc says `bos.config.json` for the *local authored file*, read "the authored config". The published artifact on FastKV keeps the key name `bos.config.json`.
|
|
9
|
+
|
|
8
10
|
# everything-dev Publish & Sync
|
|
9
11
|
|
|
10
12
|
## Core Workflow
|
|
11
13
|
|
|
12
14
|
```
|
|
13
|
-
Build →
|
|
14
|
-
↓
|
|
15
|
-
rspack
|
|
16
|
-
CDN registry
|
|
15
|
+
Build → Publish → Sync
|
|
16
|
+
↓ ↓ ↓
|
|
17
|
+
rspack FastKV bos sync
|
|
17
18
|
```
|
|
18
19
|
|
|
19
20
|
## Publish
|
|
20
21
|
|
|
21
|
-
Publish
|
|
22
|
+
Publish the resolved config to the configured FastKV registry path for the app account/domain:
|
|
22
23
|
|
|
23
24
|
```bash
|
|
24
|
-
bos publish
|
|
25
|
-
bos publish --deploy
|
|
26
|
-
bos publish --
|
|
25
|
+
bos publish # Publish config only
|
|
26
|
+
bos publish --deploy # Build/deploy all workspaces first, then publish
|
|
27
|
+
bos publish --deploy --packages local # Build/deploy only the workspaces owned locally (recommended for CI)
|
|
28
|
+
bos publish --dry-run # Preview without sending
|
|
27
29
|
bos publish --network testnet
|
|
28
|
-
bos publish --packages ui,api
|
|
30
|
+
bos publish --packages ui,api # Manual subset
|
|
29
31
|
```
|
|
30
32
|
|
|
33
|
+
`--packages` accepts a comma-separated key list, `all` (default), or `local`. `local` selects only the entries whose `development` field starts with `local:`, so it auto-tracks whatever plugins or apps live in this repo without you editing workflow files when a plugin is added. CI deploy configuration should use `--packages local` exclusively; remote-only plugins can't be redeployed from this repo and will fail with a missing-local-path error.
|
|
34
|
+
|
|
35
|
+
The registry transaction is signed in-process via near-kit — key resolution order: explicit key → `NEAR_PRIVATE_KEY` / `BOS_NEAR_PRIVATE_KEY` env → `~/.near-credentials/<network>/<account>.json` → near-cli-rs OS keychain (`sign-with-keychain`, interactive only). Publishes are skipped when FastKV already holds an identical config. Reads are indexed by tx signer, so the config resolves at `bos://<account>/<gateway>` only when signed by `<account>` itself — see the `registry` skill for the namespace=signer law and composing other runtimes (`bos registry use`).
|
|
36
|
+
|
|
31
37
|
After `bos publish --deploy`:
|
|
32
|
-
1. Each workspace builds
|
|
33
|
-
2. `bos.config.json` is
|
|
38
|
+
1. Each workspace builds; the publish writes deterministic bundle URLs (`https://<domain>/bundles/<account>/<gateway>/<workspace>/`)
|
|
39
|
+
2. Pipeline state (production URLs, integrity) goes to FastKV. For legacy JSON-form projects, `bos.config.json` is also updated locally; for the authored `bos.app.ts` form, nothing is written back — the authoring surface never holds pipeline state
|
|
34
40
|
3. Config is published to the FastKV registry at `{account}/bos/gateways/{gateway}/bos.config.json`
|
|
35
41
|
|
|
36
42
|
The `--network` flag controls the NEAR network (mainnet by default). With `--network testnet`, publishes go to the NEAR testnet chain under the testnet account specified in config.
|
|
37
43
|
|
|
38
44
|
### Rollback
|
|
39
45
|
|
|
40
|
-
To revert a publish, restore the previous
|
|
46
|
+
To revert a publish, restore the previous authored config from git and re-publish:
|
|
41
47
|
|
|
42
48
|
```bash
|
|
43
|
-
git checkout HEAD~1 -- bos.
|
|
49
|
+
git checkout HEAD~1 -- bos.app.ts
|
|
44
50
|
bos publish
|
|
45
51
|
```
|
|
46
52
|
|
|
47
|
-
|
|
53
|
+
A config-only publish merges the freshly authored config over the currently published one — authored edits win, and the live pipeline state (bundle URLs, integrity) carries over. Removing a slot from the authored config requires `bos deploy`, which regenerates the payload from scratch. Legacy JSON-form children re-publish their `bos.config.json` as-is.
|
|
54
|
+
|
|
55
|
+
Or cherry-pick a specific version of the authored config and publish that snapshot. Prefer `bos rollback --previous` (or `--version <height>`) — it republishes a verified FastKV snapshot without touching git.
|
|
48
56
|
|
|
49
57
|
Lineage model:
|
|
50
58
|
- `extends` is the canonical parent edge between published runtimes
|
|
@@ -52,9 +60,28 @@ Lineage model:
|
|
|
52
60
|
- `domain` is the public ingress for that runtime
|
|
53
61
|
- a child runtime can extend a parent and still become a new tenant root on its own domain
|
|
54
62
|
|
|
63
|
+
### Self-Deployed / Tenant Publishing
|
|
64
|
+
|
|
65
|
+
You don't need to wait for CI/CD to see changes in production. Publish your own config on-chain under your own NEAR account and run your own host instance, inheriting the base platform via `extends`.
|
|
66
|
+
|
|
67
|
+
**Same gateway, own account:**
|
|
68
|
+
|
|
69
|
+
`BOS_GATEWAY` (`domain` in the authored config) is the **FastKV lookup key**, not the DNS domain your Railway instance serves on. By keeping `BOS_GATEWAY` the same as the parent while using your own `BOS_ACCOUNT`, your config lives at a separate FastKV path (`bos://<your-account>/<gateway>`) that `extends` the base runtime. You inherit the full platform — host, API, auth, plugins — and override only what you change. Your Railway URL is the ingress.
|
|
70
|
+
|
|
71
|
+
**Step-by-step:**
|
|
72
|
+
|
|
73
|
+
1. Install near-cli-rs (v0.23.5) — only needed for account creation and `bos key generate`; `bos publish` signs transactions in-process via near-kit
|
|
74
|
+
2. Create a NEAR account via near-cli-rs (testnet or mainnet; named accounts can own subaccounts, implicit hex accounts cannot)
|
|
75
|
+
3. `bos key generate` — generates a function-call key scoped to the FastKV registry contract; set the output as `NEAR_PRIVATE_KEY`
|
|
76
|
+
4. Update `bos.config.json`: set `account` to your NEAR account, add `"extends": "bos://<parent-account>/<parent-gateway>"`, keep `domain` as the parent gateway
|
|
77
|
+
5. `bos publish --deploy` — builds workspaces, writes deterministic bundle URLs, publishes config to FastKV at `bos://<your-account>/<gateway>`
|
|
78
|
+
6. Deploy to Railway (one-click template or `railway up`), set `BOS_ACCOUNT`, `BOS_GATEWAY` (same as parent), `BETTER_AUTH_SECRET` — the host fetches your config from FastKV and serves live
|
|
79
|
+
|
|
80
|
+
**Subaccount creation** (unused by the tenant wizard today — tenants are owned by the connected sputnik-dao account) requires an explicit relayer with a named account: set `siwn.relayer.{mainnet,testnet}.accountId` + a private key, and point `siwn.subAccount.parentAccount`, `siwn.recipients`, and `siwn.relayer.*.whitelistedContracts` to your account.
|
|
81
|
+
|
|
55
82
|
## Sync
|
|
56
83
|
|
|
57
|
-
Pull template updates from the parent referenced by local
|
|
84
|
+
Pull template updates from the parent referenced by the local authored config:
|
|
58
85
|
|
|
59
86
|
```bash
|
|
60
87
|
bos sync
|
|
@@ -63,7 +90,7 @@ bos sync --dry-run
|
|
|
63
90
|
```
|
|
64
91
|
|
|
65
92
|
What gets synced from the parent template:
|
|
66
|
-
- `app.*.production` —
|
|
93
|
+
- `app.*.production` — bundle URLs
|
|
67
94
|
- `app.*.ssr` — SSR URLs
|
|
68
95
|
- `shared` — shared dependency versions
|
|
69
96
|
- framework-owned files like build configs, router wiring, and shared runtime scaffolding
|
|
@@ -115,7 +142,7 @@ These are auto-generated during `bos publish --deploy` and verified at runtime b
|
|
|
115
142
|
|
|
116
143
|
## Configuration
|
|
117
144
|
|
|
118
|
-
All runtime config lives in
|
|
145
|
+
All runtime config lives in the authored config. Key sections:
|
|
119
146
|
- `account` — NEAR mainnet account
|
|
120
147
|
- `testnet` — NEAR testnet account
|
|
121
148
|
- `staging.domain` — Staging domain
|
|
@@ -153,7 +180,7 @@ For remix-host browsing with the apps plugin:
|
|
|
153
180
|
|
|
154
181
|
### What bos dev writes vs bos publish writes
|
|
155
182
|
|
|
156
|
-
See `everything-dev#extends-config` for the full table. In short: `bos dev` and `bos build` write to `.bos/bos.resolved-config.json` (gitignored); `bos publish --deploy`, `bos plugin publish`, and `bos sync` write to `bos.config.json
|
|
183
|
+
See `everything-dev#extends-config` for the full table. In short: `bos dev` and `bos build` write to `.bos/bos.resolved-config.json` (gitignored); `bos publish --deploy`, `bos plugin publish`, and `bos sync` write to the authored config — `bos.app.ts` for TS-form projects, `bos.config.json` for legacy JSON-form children. Pipeline state (deploy-injected URLs) is written back only for JSON-form.
|
|
157
184
|
|
|
158
185
|
## Troubleshooting
|
|
159
186
|
|
|
@@ -165,13 +192,13 @@ bos status # Check remote health
|
|
|
165
192
|
### FastKV publish failures
|
|
166
193
|
|
|
167
194
|
- **NEAR RPC error**: Verify the configured NEAR account has sufficient gas and the FastKV contract is deployed at `{account}/bos/gateways/{gateway}/bos.config.json`
|
|
168
|
-
- **Account mismatch**: The
|
|
195
|
+
- **Account mismatch**: The authored config's `account` field must match the on-chain account that owns the FastKV path
|
|
169
196
|
- **Network mismatch**: Ensure `--network` matches where the account is deployed (mainnet vs testnet)
|
|
170
197
|
- **Dry-run first**: Use `bos publish --dry-run` to preview before sending
|
|
171
198
|
|
|
172
199
|
### Integrity verification
|
|
173
200
|
|
|
174
|
-
During `bos publish --deploy`, integrity SRI hashes are auto-generated for each remote entry and stored in `bos.config.json
|
|
201
|
+
During `bos publish --deploy`, integrity SRI hashes are auto-generated for each remote entry and stored in the published config (FastKV; also written back to `bos.config.json` for legacy JSON-form children). At runtime, the host:
|
|
175
202
|
- Verifies integrity on first load using bounded streaming (not full-response buffering)
|
|
176
203
|
- Uses stale-while-revalidate for asset requests to avoid latency spikes
|
|
177
204
|
- Blocks HTML and SSR requests on integrity mismatch
|
|
@@ -179,10 +206,60 @@ During `bos publish --deploy`, integrity SRI hashes are auto-generated for each
|
|
|
179
206
|
|
|
180
207
|
If a remote entry fails integrity check, the host rejects it and falls back to client-rendered output without that remote.
|
|
181
208
|
|
|
209
|
+
### Federation runtime compatibility (`bos mf check`)
|
|
210
|
+
|
|
211
|
+
Each deployed bundle's `mf-manifest.json` reports `metaData.pluginVersion` — the version of `@module-federation/runtime` baked into the bundle at build time. The host is the federation **consumer**; each plugin is a **provider** loaded over `mf-manifest.json` and `remoteEntry.js`. When the host's runtime version drifts ahead of a plugin's runtime version, the plugin's `remoteEntry.js` throws:
|
|
212
|
+
|
|
213
|
+
```
|
|
214
|
+
undefined is not an object (evaluating '__webpack_modules__[e].call')
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
The host treats this as a soft failure and continues serving with the plugin missing (`⚠ N plugin(s) failed to load`). Production stays live but the plugin is dead.
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
bos mf check # exit 0 = all manifests compatible
|
|
221
|
+
bos publish --deploy --packages local # ship a fresh bundle + republish to FastKV
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
The check fetches `<host>/mf-manifest.json` and every `<plugin>/mf-manifest.json`, asserting:
|
|
225
|
+
|
|
226
|
+
- `metaData.pluginVersion` matches the host's
|
|
227
|
+
- every `shared[]` dep the host requires (`requiredVersion: ^X.Y.Z`) is provided by the plugin at a compatible version
|
|
228
|
+
|
|
229
|
+
If `bos mf check` fails for one plugin, redeploy only that plugin from this repo:
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
cd plugins/<key>
|
|
233
|
+
bos plugin publish <key> # rebuild + pin the workspace's production URL, then publish config
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
Then from the repo root: `bos publish --deploy --packages local` and `bos mf check` to confirm.
|
|
237
|
+
|
|
238
|
+
In CI, this runs as a `bos mf check` step on every push/PR (`packages/everything-dev/src/cli.ts:mfCheck`). Treat a failed run as "this bundle is stale; a plugin needs to be redeployed" — never disable.
|
|
239
|
+
|
|
182
240
|
### Process issues
|
|
183
241
|
|
|
184
242
|
```bash
|
|
185
243
|
bos kill # Kill all tracked processes
|
|
186
|
-
|
|
244
|
+
pnpm install # Reinstall deps
|
|
187
245
|
bos dev # Restart
|
|
188
246
|
```
|
|
247
|
+
|
|
248
|
+
## The tasks you will actually be given
|
|
249
|
+
|
|
250
|
+
**"Ship one plugin only."** `bos plugin publish <key>` (builds + pins the deterministic URL + publishes config), then `bos mf check` from the repo root to confirm federation compatibility.
|
|
251
|
+
|
|
252
|
+
**"Roll back a bad publish."** `bos rollback --previous` — republishes a verified FastKV snapshot without touching git; the manual path is `git checkout <ref> -- bos.app.ts` + `bos publish`.
|
|
253
|
+
|
|
254
|
+
**"Deploy my own runtime under my own account."** NEAR account + `bos key generate` → `NEAR_PRIVATE_KEY`; authored config sets your `account` + `extends` the parent and keeps `domain` as the parent gateway; `bos publish --deploy`; run the image with `BOS_ACCOUNT` / `BOS_GATEWAY`.
|
|
255
|
+
|
|
256
|
+
## What comes back when it refuses
|
|
257
|
+
|
|
258
|
+
| word | do |
|
|
259
|
+
|---|---|
|
|
260
|
+
| publish returns `status: "error"` before signing | preflight failed — key resolution (no `NEAR_PRIVATE_KEY` / credentials / keychain) or the registry read; run `bos publish --dry-run` to see the plan |
|
|
261
|
+
| config resolves to nothing at `bos://<account>/<gateway>` | namespace = signer — the tx was signed by a different account than the config's `account`; sign with the publisher's key (see the `registry` skill) |
|
|
262
|
+
| `integrity mismatch for <url>` | the remote entry's SRI hash diverges from the published config — redeploy that workspace and republish; the host blocks HTML/SSR on mismatch and client-renders without the remote |
|
|
263
|
+
| `N plugin(s) failed to load` at host startup | `bos mf check` — a plugin's `metaData.pluginVersion` lags the host; republish that plugin |
|
|
264
|
+
| `missing-local-path` error on `--packages local` | a selected entry has no `development: local:` (remote-only) — it can't be rebuilt from this repo; drop it from the selection |
|
|
265
|
+
| publish prints nothing / skips | FastKV already holds an identical config — a free no-op, nothing to fix |
|