everything-dev 1.53.2 → 2.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +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 +624 -196
- 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 +613 -194
- 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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "everything-dev",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-rc.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20.11"
|
|
@@ -19,6 +19,16 @@
|
|
|
19
19
|
"import": "./dist/types.mjs",
|
|
20
20
|
"require": "./dist/types.cjs"
|
|
21
21
|
},
|
|
22
|
+
"./descriptor": {
|
|
23
|
+
"types": "./dist/descriptor/index.d.mts",
|
|
24
|
+
"import": "./dist/descriptor/index.mjs",
|
|
25
|
+
"require": "./dist/descriptor/index.cjs"
|
|
26
|
+
},
|
|
27
|
+
"./resolution": {
|
|
28
|
+
"types": "./dist/resolution/session.d.mts",
|
|
29
|
+
"import": "./dist/resolution/session.mjs",
|
|
30
|
+
"require": "./dist/resolution/session.cjs"
|
|
31
|
+
},
|
|
22
32
|
"./config": {
|
|
23
33
|
"types": "./dist/config.d.mts",
|
|
24
34
|
"import": "./dist/config.mjs",
|
|
@@ -29,6 +39,26 @@
|
|
|
29
39
|
"import": "./dist/dag.mjs",
|
|
30
40
|
"require": "./dist/dag.cjs"
|
|
31
41
|
},
|
|
42
|
+
"./bundle-cache": {
|
|
43
|
+
"types": "./dist/bundle-cache.d.mts",
|
|
44
|
+
"import": "./dist/bundle-cache.mjs",
|
|
45
|
+
"require": "./dist/bundle-cache.cjs"
|
|
46
|
+
},
|
|
47
|
+
"./fingerprint": {
|
|
48
|
+
"types": "./src/fingerprint.ts",
|
|
49
|
+
"import": "./src/fingerprint.ts",
|
|
50
|
+
"require": "./src/fingerprint.ts"
|
|
51
|
+
},
|
|
52
|
+
"./version-manifest-resolve": {
|
|
53
|
+
"types": "./src/version-manifest-resolve.ts",
|
|
54
|
+
"import": "./src/version-manifest-resolve.ts",
|
|
55
|
+
"require": "./src/version-manifest-resolve.ts"
|
|
56
|
+
},
|
|
57
|
+
"./bundle-fs-resolve": {
|
|
58
|
+
"types": "./dist/bundle-fs-resolve.d.mts",
|
|
59
|
+
"import": "./dist/bundle-fs-resolve.mjs",
|
|
60
|
+
"require": "./dist/bundle-fs-resolve.cjs"
|
|
61
|
+
},
|
|
32
62
|
"./fastkv": {
|
|
33
63
|
"types": "./dist/fastkv.d.mts",
|
|
34
64
|
"import": "./dist/fastkv.mjs",
|
|
@@ -89,6 +119,11 @@
|
|
|
89
119
|
"import": "./dist/ui/head.mjs",
|
|
90
120
|
"require": "./dist/ui/head.cjs"
|
|
91
121
|
},
|
|
122
|
+
"./ui/i18n": {
|
|
123
|
+
"types": "./dist/ui/i18n.d.mts",
|
|
124
|
+
"import": "./dist/ui/i18n.mjs",
|
|
125
|
+
"require": "./dist/ui/i18n.cjs"
|
|
126
|
+
},
|
|
92
127
|
"./ui/metadata": {
|
|
93
128
|
"types": "./dist/ui/metadata.d.mts",
|
|
94
129
|
"import": "./dist/ui/metadata.mjs",
|
|
@@ -99,11 +134,75 @@
|
|
|
99
134
|
"import": "./dist/ui/router.mjs",
|
|
100
135
|
"require": "./dist/ui/router.cjs"
|
|
101
136
|
},
|
|
137
|
+
"./ui/api": {
|
|
138
|
+
"types": "./dist/ui/api.d.mts",
|
|
139
|
+
"import": "./dist/ui/api.mjs",
|
|
140
|
+
"require": "./dist/ui/api.cjs"
|
|
141
|
+
},
|
|
142
|
+
"./ui/auth": {
|
|
143
|
+
"types": "./dist/ui/auth.d.mts",
|
|
144
|
+
"import": "./dist/ui/auth.mjs",
|
|
145
|
+
"require": "./dist/ui/auth.cjs"
|
|
146
|
+
},
|
|
147
|
+
"./api": {
|
|
148
|
+
"types": "./dist/api/auth-middleware.d.mts",
|
|
149
|
+
"import": "./dist/api/auth-middleware.mjs",
|
|
150
|
+
"require": "./dist/api/auth-middleware.cjs"
|
|
151
|
+
},
|
|
152
|
+
"./ui/tenant": {
|
|
153
|
+
"types": "./dist/ui/tenant.d.mts",
|
|
154
|
+
"import": "./dist/ui/tenant.mjs",
|
|
155
|
+
"require": "./dist/ui/tenant.cjs"
|
|
156
|
+
},
|
|
157
|
+
"./ui/entry": {
|
|
158
|
+
"types": "./dist/ui/entry.d.mts",
|
|
159
|
+
"import": "./dist/ui/entry.mjs",
|
|
160
|
+
"require": "./dist/ui/entry.cjs"
|
|
161
|
+
},
|
|
162
|
+
"./ui/hydrate": {
|
|
163
|
+
"types": "./dist/ui/hydrate.d.mts",
|
|
164
|
+
"import": "./dist/ui/hydrate.mjs",
|
|
165
|
+
"require": "./dist/ui/hydrate.cjs"
|
|
166
|
+
},
|
|
167
|
+
"./ui/router-client": {
|
|
168
|
+
"types": "./dist/ui/router-client.d.mts",
|
|
169
|
+
"import": "./dist/ui/router-client.mjs",
|
|
170
|
+
"require": "./dist/ui/router-client.cjs"
|
|
171
|
+
},
|
|
172
|
+
"./ui/router-server": {
|
|
173
|
+
"types": "./dist/ui/router-server.d.mts",
|
|
174
|
+
"import": "./dist/ui/router-server.mjs",
|
|
175
|
+
"require": "./dist/ui/router-server.cjs"
|
|
176
|
+
},
|
|
177
|
+
"./ui/router-error": {
|
|
178
|
+
"types": "./dist/ui/router-error.d.mts",
|
|
179
|
+
"import": "./dist/ui/router-error.mjs",
|
|
180
|
+
"require": "./dist/ui/router-error.cjs"
|
|
181
|
+
},
|
|
182
|
+
"./ui/router-defaults": {
|
|
183
|
+
"types": "./dist/ui/router-defaults.d.mts",
|
|
184
|
+
"import": "./dist/ui/router-defaults.mjs",
|
|
185
|
+
"require": "./dist/ui/router-defaults.cjs"
|
|
186
|
+
},
|
|
187
|
+
"./ui/manifest": {
|
|
188
|
+
"types": "./dist/ui/manifest/index.d.mts",
|
|
189
|
+
"import": "./dist/ui/manifest/index.mjs",
|
|
190
|
+
"require": "./dist/ui/manifest/index.cjs"
|
|
191
|
+
},
|
|
192
|
+
"./ui/manifest-generator": {
|
|
193
|
+
"types": "./dist/ui/manifest-generator.d.mts",
|
|
194
|
+
"import": "./dist/ui/manifest-generator.mjs",
|
|
195
|
+
"require": "./dist/ui/manifest-generator.cjs"
|
|
196
|
+
},
|
|
102
197
|
"./package.json": "./package.json",
|
|
103
198
|
"./db": {
|
|
104
|
-
"types": "./dist/db.d.mts",
|
|
105
|
-
"import": "./dist/db.mjs",
|
|
106
|
-
"require": "./dist/db.cjs"
|
|
199
|
+
"types": "./dist/db/index.d.mts",
|
|
200
|
+
"import": "./dist/db/index.mjs",
|
|
201
|
+
"require": "./dist/db/index.cjs"
|
|
202
|
+
},
|
|
203
|
+
"./ui/version-check": {
|
|
204
|
+
"types": "./src/ui/version-check.ts",
|
|
205
|
+
"import": "./src/ui/version-check.ts"
|
|
107
206
|
}
|
|
108
207
|
},
|
|
109
208
|
"files": [
|
|
@@ -135,52 +234,105 @@
|
|
|
135
234
|
},
|
|
136
235
|
"dependencies": {
|
|
137
236
|
"@clack/prompts": "^0.10.1",
|
|
138
|
-
"@
|
|
139
|
-
"@
|
|
140
|
-
"@module-federation/
|
|
141
|
-
"@module-federation/node": "^2.7.42",
|
|
142
|
-
"@module-federation/runtime-core": "^2.4.0",
|
|
237
|
+
"@module-federation/enhanced": "^2.9.0",
|
|
238
|
+
"@module-federation/node": "^2.7.50",
|
|
239
|
+
"@module-federation/runtime-core": "^2.9.0",
|
|
143
240
|
"chalk": "^5.6.2",
|
|
144
241
|
"defu": "^6.1.7",
|
|
145
242
|
"dotenv": "^17.3.1",
|
|
146
|
-
"effect": "
|
|
243
|
+
"effect": "4.0.0-rc.117",
|
|
244
|
+
"every-plugin": "^3.0.0-rc.0",
|
|
147
245
|
"execa": "^9.5.2",
|
|
148
|
-
"every-plugin": "^2.10.1",
|
|
149
246
|
"glob": "^13.0.6",
|
|
150
|
-
"
|
|
151
|
-
"ink": "^6.8.0",
|
|
247
|
+
"near-kit": "^0.20.2",
|
|
152
248
|
"pg": "^8.12.0",
|
|
153
|
-
"tar": "^7.4.3"
|
|
249
|
+
"tar": "^7.4.3",
|
|
250
|
+
"yaml": "2.9.0",
|
|
251
|
+
"zod": "4.6.5"
|
|
154
252
|
},
|
|
155
253
|
"peerDependencies": {
|
|
254
|
+
"@better-auth/api-key": "1.6.25",
|
|
255
|
+
"@better-auth/passkey": "1.6.25",
|
|
256
|
+
"@lingui/core": "5.9.0",
|
|
257
|
+
"@lingui/react": "5.9.0",
|
|
258
|
+
"@orpc/client": "2.0.0-beta.35",
|
|
259
|
+
"@orpc/contract": "2.0.0-beta.35",
|
|
260
|
+
"@orpc/tanstack-query": "2.0.0-beta.35",
|
|
156
261
|
"@tanstack/react-query": ">=5.0.0",
|
|
157
262
|
"@tanstack/react-router": ">=1.0.0",
|
|
158
|
-
"
|
|
159
|
-
"
|
|
160
|
-
"effect": "
|
|
161
|
-
"
|
|
263
|
+
"better-auth": "1.6.25",
|
|
264
|
+
"better-near-auth": "^2.0.0-rc.0",
|
|
265
|
+
"effect": "4.0.0-rc.117",
|
|
266
|
+
"react": "19.2.4",
|
|
267
|
+
"react-dom": "19.2.4",
|
|
268
|
+
"sonner": ">=2.0.0",
|
|
269
|
+
"zod": "4.6.5"
|
|
162
270
|
},
|
|
163
271
|
"peerDependenciesMeta": {
|
|
272
|
+
"@lingui/core": {
|
|
273
|
+
"optional": true
|
|
274
|
+
},
|
|
275
|
+
"@lingui/react": {
|
|
276
|
+
"optional": true
|
|
277
|
+
},
|
|
278
|
+
"@better-auth/api-key": {
|
|
279
|
+
"optional": true
|
|
280
|
+
},
|
|
281
|
+
"@better-auth/passkey": {
|
|
282
|
+
"optional": true
|
|
283
|
+
},
|
|
284
|
+
"@orpc/client": {
|
|
285
|
+
"optional": true
|
|
286
|
+
},
|
|
287
|
+
"@orpc/contract": {
|
|
288
|
+
"optional": true
|
|
289
|
+
},
|
|
290
|
+
"@orpc/tanstack-query": {
|
|
291
|
+
"optional": true
|
|
292
|
+
},
|
|
164
293
|
"@tanstack/react-query": {
|
|
165
294
|
"optional": true
|
|
166
295
|
},
|
|
167
296
|
"@tanstack/react-router": {
|
|
168
297
|
"optional": true
|
|
298
|
+
},
|
|
299
|
+
"sonner": {
|
|
300
|
+
"optional": true
|
|
301
|
+
},
|
|
302
|
+
"better-auth": {
|
|
303
|
+
"optional": true
|
|
304
|
+
},
|
|
305
|
+
"better-near-auth": {
|
|
306
|
+
"optional": true
|
|
169
307
|
}
|
|
170
308
|
},
|
|
171
309
|
"devDependencies": {
|
|
310
|
+
"@better-auth/api-key": "1.6.25",
|
|
311
|
+
"@better-auth/passkey": "1.6.25",
|
|
312
|
+
"@lingui/core": "5.9.0",
|
|
313
|
+
"@lingui/react": "5.9.0",
|
|
314
|
+
"@module-federation/rsbuild-plugin": "^2.9.0",
|
|
315
|
+
"@orpc/client": "2.0.0-beta.35",
|
|
316
|
+
"@orpc/contract": "2.0.0-beta.35",
|
|
317
|
+
"@orpc/openapi": "2.0.0-beta.35",
|
|
318
|
+
"@orpc/tanstack-query": "2.0.0-beta.35",
|
|
319
|
+
"@rsbuild/core": "2.2.8",
|
|
320
|
+
"@rsbuild/plugin-react": "2.1.0",
|
|
172
321
|
"@tanstack/intent": "^0.3.5",
|
|
173
|
-
"@tanstack/react-query": "5.
|
|
174
|
-
"@tanstack/react-router": "1.
|
|
175
|
-
"@
|
|
176
|
-
"@
|
|
177
|
-
"@types/
|
|
178
|
-
"@types/react-dom": "^19.2.3",
|
|
322
|
+
"@tanstack/react-query": "5.102.8",
|
|
323
|
+
"@tanstack/react-router": "1.170.32",
|
|
324
|
+
"@tanstack/router-generator": "1.167.33",
|
|
325
|
+
"@tanstack/router-plugin": "1.168.35",
|
|
326
|
+
"@types/node": "^25.0.3",
|
|
179
327
|
"@types/tar": "^7.0.0",
|
|
180
|
-
"
|
|
328
|
+
"better-auth": "1.6.25",
|
|
329
|
+
"better-near-auth": "^2.0.0-rc.0",
|
|
330
|
+
"jsdom": "^30.0.1",
|
|
331
|
+
"react": "19.2.4",
|
|
332
|
+
"react-dom": "19.2.4",
|
|
181
333
|
"tsdown": "^0.22.0",
|
|
182
|
-
"typescript": "^
|
|
334
|
+
"typescript": "^7.0.2",
|
|
183
335
|
"vite-tsconfig-paths": "^5.1.4",
|
|
184
|
-
"vitest": "^4.
|
|
336
|
+
"vitest": "^4.1.8"
|
|
185
337
|
}
|
|
186
338
|
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: add-a-route
|
|
3
|
+
description: Add one API endpoint end to end in everything.dev — contract route with Zod schemas, Effect-native handler in the plugin router, UI call via useApiClient, route file rendering the data, typecheck, publish. Use when adding an API endpoint, wiring a new UI page to app data, or debugging the contract/handler/client chain.
|
|
4
|
+
metadata:
|
|
5
|
+
sources: "api/src/contract.ts,api/src/index.ts,plugins/_template/src/contract.ts,plugins/_template/src/index.ts,packages/every-plugin/src/errors.ts,ui/src/routes,packages/everything-dev/skills/ui-integration/SKILL.md"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Add a route
|
|
9
|
+
|
|
10
|
+
One endpoint, end to end. The slice below is complete — copy it, rename, and
|
|
11
|
+
it runs. Everything is typed from the contract: the handler's `input`/`context`,
|
|
12
|
+
the generated client, and the UI's response shape.
|
|
13
|
+
|
|
14
|
+
## Where the route lives
|
|
15
|
+
|
|
16
|
+
| The task in front of you | Put it in |
|
|
17
|
+
|---|---|
|
|
18
|
+
| App-shell glue (health, infra) | `api/src/contract.ts` + `api/src/index.ts` |
|
|
19
|
+
| A feature (things, registry, proposals, votes, chat) | a plugin under `plugins/<name>/` |
|
|
20
|
+
|
|
21
|
+
Feature routes live in plugins; `api/` is a slim shell. New plugins: copy
|
|
22
|
+
`plugins/_template/` (`everything-dev#plugin-development`).
|
|
23
|
+
|
|
24
|
+
## The slice
|
|
25
|
+
|
|
26
|
+
### 1. Contract (`plugins/<name>/src/contract.ts`)
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
import { oc } from "@orpc/contract";
|
|
30
|
+
import { z } from "zod";
|
|
31
|
+
import { FORBIDDEN, NOT_FOUND, UNAUTHORIZED } from "every-plugin/errors";
|
|
32
|
+
|
|
33
|
+
export const WidgetSchema = z.object({
|
|
34
|
+
id: z.string(),
|
|
35
|
+
title: z.string(),
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export const contract = oc.router({
|
|
39
|
+
getWidget: oc
|
|
40
|
+
.route({ method: "GET", path: "/widgets/{id}" })
|
|
41
|
+
.input(z.object({ id: z.string().min(1) }))
|
|
42
|
+
.output(z.object({ widget: WidgetSchema }))
|
|
43
|
+
.errors({ NOT_FOUND, UNAUTHORIZED, FORBIDDEN }),
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export type ContractType = typeof contract;
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Path params (`{id}`) bind to the Zod input keys automatically.
|
|
50
|
+
|
|
51
|
+
### 2. Handler (`plugins/<name>/src/index.ts`)
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
export default createPlugin.withPlugins<PluginsClient>()({
|
|
55
|
+
// variables, secrets, context, contract — see the template
|
|
56
|
+
createRouter: (builder) => ({
|
|
57
|
+
getWidget: builder.getWidget.effect(function* ({ input, context, errors }) {
|
|
58
|
+
if (!context.userId) {
|
|
59
|
+
return yield* Effect.fail(errors.UNAUTHORIZED({ apiKeyProvided: !!context.apiKey }));
|
|
60
|
+
}
|
|
61
|
+
const widgets = yield* WidgetsService;
|
|
62
|
+
const widget = yield* widgets.getWidget(input.id);
|
|
63
|
+
return { widget };
|
|
64
|
+
}),
|
|
65
|
+
}),
|
|
66
|
+
});
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
The tag (`WidgetsService`) must be exposed from the returned `initialize`
|
|
70
|
+
layer. Handlers are Effect generators — see **Rules** below.
|
|
71
|
+
|
|
72
|
+
### 3. UI call (any component)
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
import { useApiClient } from "@/app";
|
|
76
|
+
|
|
77
|
+
const apiClient = useApiClient();
|
|
78
|
+
const { data } = await apiClient.template.listThings({ limit: 20 });
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
The client is namespaced by the plugin key in `bos.app.ts` — a `widgets`
|
|
82
|
+
plugin is `apiClient.widgets.*` — and typed from the contract;
|
|
83
|
+
`ui/src/lib/api-types.gen.ts` regenerates on `pnpm run typecheck` / `bos dev`.
|
|
84
|
+
|
|
85
|
+
### 4. Route file (`ui/src/routes/<area>.tsx`)
|
|
86
|
+
|
|
87
|
+
File-based routing — TanStack Router generates the tree. See
|
|
88
|
+
`everything-dev#ui-integration` for loaders, SSR, and the page-header/testid
|
|
89
|
+
conventions.
|
|
90
|
+
|
|
91
|
+
### 5. Verify, then publish
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
pnpm run typecheck # regenerates types, then checks everything
|
|
95
|
+
pnpm run build # the train — never per-workspace raw builds
|
|
96
|
+
pnpm run deploy # preflight → build → upload → publish → image
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## The tasks you will actually be given
|
|
100
|
+
|
|
101
|
+
**"Add a read-only endpoint for X."** Contract → handler → UI query. No auth
|
|
102
|
+
schema needed; still add `.errors({ NOT_FOUND })` for typed misses.
|
|
103
|
+
|
|
104
|
+
**"Add an endpoint only signed-in users can write."** Same slice, plus the
|
|
105
|
+
`context.userId` guard from step 2. For roles, orgs, or API-key permissions,
|
|
106
|
+
load `everything-dev#api-and-auth` for the middleware pattern.
|
|
107
|
+
|
|
108
|
+
**"The UI can't see the new route."** Types are generated: run
|
|
109
|
+
`pnpm run typecheck` (self-sufficient), or restart `bos dev`. If the client
|
|
110
|
+
name is wrong, the plugin key in `bos.app.ts` is the namespace.
|
|
111
|
+
|
|
112
|
+
## What comes back when it fails
|
|
113
|
+
|
|
114
|
+
| word | do |
|
|
115
|
+
|---|---|
|
|
116
|
+
| `Type 'DecoratedMiddleware'…` in `.use()` | middleware typing does not compose with `.use()` — use the local-middleware pattern (`plugins/proposals/src`) |
|
|
117
|
+
| `UNAUTHORIZED` type error | its `data` requires `{ apiKeyProvided: boolean }`; all-optional shapes still need explicit `data: {}` |
|
|
118
|
+
| Effect lint flags floating effects | `pnpm run lint:effect`; `tsc` clean is not enough |
|
|
119
|
+
| `ModuleFederationError` / `__webpack_modules__` | the deployed plugin's `mf-manifest.json` is older than the host's — `bos mf check`, then republish the plugin |
|
|
120
|
+
| 404 on the new route | the route lives in a plugin — the path is `/api/rpc/<pluginKey>/…` or `/api/<contract path>` |
|
|
121
|
+
|
|
122
|
+
## Rules to work by
|
|
123
|
+
|
|
124
|
+
- **`.effect(function* ...)`, never new `.handler(async)`.** Services come
|
|
125
|
+
from `yield* Tag` in generators; `Context.get(context["effect/context"], Tag)`
|
|
126
|
+
is reserved for streaming (async-generator) handlers.
|
|
127
|
+
- **`Effect.fail`, not throws.** Definitive failure exits are
|
|
128
|
+
`return yield* Effect.fail(...)`; shared shapes come from `every-plugin/errors`.
|
|
129
|
+
- **No `Effect.provide(Tag, Layer.effect(...))` for persistent deps.** Build
|
|
130
|
+
scoped services with `buildScoped(...)` inside `initialize` — transient
|
|
131
|
+
scopes release immediately.
|
|
132
|
+
- **Typecheck before publish.** `pnpm run typecheck` regenerates all types.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: api-and-auth
|
|
3
3
|
description: API architecture, oRPC contracts, auth middleware, plugin-client composition, session handling, and client-side auth. Use when adding API routes, creating middleware, calling other plugins in-process, or integrating auth in routes and UI.
|
|
4
4
|
metadata:
|
|
5
|
-
sources: "api/src/index.ts,api/src/contract.ts,
|
|
5
|
+
sources: "api/src/index.ts,api/src/contract.ts,packages/everything-dev/src/api/auth-middleware.ts,packages/every-plugin/src/errors.ts,host/src/services/auth.ts,host/src/services/plugins.ts,host/src/program.ts,ui/src/lib/auth.ts,ui/src/lib/api.ts"
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# API Architecture & Auth
|
|
@@ -17,22 +17,21 @@ export default createPlugin.withPlugins<PluginsClient>()({
|
|
|
17
17
|
secrets: z.object({ /* typed env vars, defaults for dev */ }),
|
|
18
18
|
context: z.object({ /* per-request context injected by host */ }),
|
|
19
19
|
contract,
|
|
20
|
-
initialize: (config, plugins
|
|
20
|
+
initialize: (config, plugins) =>
|
|
21
21
|
Effect.gen(function* () {
|
|
22
|
-
const registry = yield*
|
|
22
|
+
const registry = yield* buildScoped(
|
|
23
23
|
RegistryTag,
|
|
24
24
|
RegistryLive.pipe(Layer.provide(DatabaseLive(config.secrets.API_DATABASE_URL))),
|
|
25
25
|
);
|
|
26
26
|
return { registry, publisher, auth: plugins.auth, plugins };
|
|
27
27
|
}),
|
|
28
|
-
|
|
29
|
-
createRouter: (deps, builder) => ({
|
|
28
|
+
createRouter: (builder, plugins) => ({
|
|
30
29
|
ping: builder.ping.handler(async () => ({ status: "ok", timestamp })),
|
|
31
30
|
}),
|
|
32
31
|
});
|
|
33
32
|
```
|
|
34
33
|
|
|
35
|
-
Fields: `variables` (public config), `secrets` (private env), `context` (per-request host context), `contract` (oRPC router), `initialize` (startup
|
|
34
|
+
Fields: `variables` (public config), `secrets` (private env), `context` (per-request host context), `contract` (oRPC router), `initialize` (startup — build a Layer and let the runtime scope it), `createRouter` (maps procedures to handlers; `(builder, plugins)`). `plugins` in `initialize` gives typed factories for all other plugins. Use `buildScoped(tag, layer)` from `"every-plugin"` for DB-backed services, caches, and other scoped resources — teardown lives in Layer finalizers (there is no `shutdown`).
|
|
36
35
|
|
|
37
36
|
## oRPC Contract Design
|
|
38
37
|
|
|
@@ -40,8 +39,8 @@ Defined in `api/src/contract.ts`:
|
|
|
40
39
|
|
|
41
40
|
```ts
|
|
42
41
|
import { BAD_REQUEST, NOT_FOUND, UNAUTHORIZED } from "every-plugin/errors";
|
|
43
|
-
import { eventIterator, oc } from "
|
|
44
|
-
import { z } from "
|
|
42
|
+
import { eventIterator, oc } from "@orpc/contract";
|
|
43
|
+
import { z } from "zod";
|
|
45
44
|
|
|
46
45
|
export const contract = oc.router({
|
|
47
46
|
ping: oc.route({ method: "GET", path: "/ping" }).output(
|
|
@@ -95,7 +94,7 @@ Handler receives `{ input, context, signal?, lastEventId? }`.
|
|
|
95
94
|
|
|
96
95
|
## Middleware
|
|
97
96
|
|
|
98
|
-
Create auth middleware with `createAuthMiddleware(builder)` in `
|
|
97
|
+
Create auth middleware with `createAuthMiddleware(builder)` in `packages/everything-dev/src/api/auth-middleware.ts`. Each middleware narrows the context type through `.use()` — no non-null assertions needed.
|
|
99
98
|
|
|
100
99
|
```ts
|
|
101
100
|
const { requireAuth } = createAuthMiddleware(builder);
|
|
@@ -112,14 +111,14 @@ builder.authHealth.use(requireAuth).handler(...)
|
|
|
112
111
|
builder.adminAction.use(requireRole("admin")).handler(...)
|
|
113
112
|
```
|
|
114
113
|
|
|
115
|
-
See
|
|
114
|
+
See [middleware](references/middleware.md) for the full middleware table, org metadata validation, and typed context helpers.
|
|
116
115
|
|
|
117
116
|
## Error Handling
|
|
118
117
|
|
|
119
118
|
Use `ORPCError` from `every-plugin/errors`:
|
|
120
119
|
|
|
121
120
|
```ts
|
|
122
|
-
import { ORPCError } from "
|
|
121
|
+
import { ORPCError } from "@orpc/server";
|
|
123
122
|
import { BAD_REQUEST, UNAUTHORIZED } from "every-plugin/errors";
|
|
124
123
|
|
|
125
124
|
throw new ORPCError("UNAUTHORIZED", {
|
|
@@ -308,22 +307,23 @@ Rules: API owns `thingId`, `pluginId`, timestamps. Plugin owns `type` and `paylo
|
|
|
308
307
|
|
|
309
308
|
### Effect and DB Lifecycle
|
|
310
309
|
|
|
311
|
-
Prefer `Layer` for long-lived resources (DB, service singletons) and `Effect` for the work itself.
|
|
310
|
+
Prefer `Layer` for long-lived resources (DB, service singletons) and `Effect` for the work itself. Handlers are Effect-native: use `.effect()` generator handlers and access services with `yield* Tag` — oRPC bridges to async at the boundary (plain async handlers read services via `Context.get(context["effect/context"], Tag)`):
|
|
312
311
|
|
|
313
312
|
```ts
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
313
|
+
ping: builder.ping.effect(function* () {
|
|
314
|
+
const myService = yield* MyServiceTag;
|
|
315
|
+
return yield* myService.doSomething();
|
|
316
|
+
}),
|
|
317
317
|
```
|
|
318
318
|
|
|
319
|
-
Best practices: Keep service interfaces Effect-native
|
|
319
|
+
Best practices: Keep service interfaces Effect-native. Use `Context.Service<Self, Shape>()("id")` class tags for DI between services (Effect 4 removed `Context.Tag`).
|
|
320
320
|
|
|
321
|
-
**Scoped resources** — For DB pools, caches, publishers, or any resource that must live for the plugin's lifetime, build them inside `initialize` using `
|
|
321
|
+
**Scoped resources** — For DB pools, caches, publishers, or any resource that must live for the plugin's lifetime, build them inside `initialize` using `buildScoped(tag, layer)` from `"every-plugin"`. This binds the resource to the plugin lifecycle scope — it persists until plugin shutdown and is automatically released.
|
|
322
322
|
|
|
323
323
|
```ts
|
|
324
|
-
initialize: (config, plugins
|
|
324
|
+
initialize: (config, plugins) =>
|
|
325
325
|
Effect.gen(function* () {
|
|
326
|
-
const repo = yield*
|
|
326
|
+
const repo = yield* buildScoped(
|
|
327
327
|
MyRepoTag,
|
|
328
328
|
MyRepoLive.pipe(Layer.provide(DatabaseLive(config.secrets.MY_DATABASE_URL))),
|
|
329
329
|
);
|
|
@@ -331,7 +331,7 @@ initialize: (config, plugins, tools) =>
|
|
|
331
331
|
}),
|
|
332
332
|
```
|
|
333
333
|
|
|
334
|
-
Do **not** use `Effect.provide(Tag, Layer.scoped(...))` inside `initialize` for long-lived resources — it creates a transient scope that closes immediately. `
|
|
334
|
+
Do **not** use `Effect.provide(Tag, Layer.scoped(...))` inside `initialize` for long-lived resources — it creates a transient scope that closes immediately. `buildScoped(...)` uses the plugin's lifecycle scope instead.
|
|
335
335
|
|
|
336
336
|
### SSR Proxy Client
|
|
337
337
|
|
|
@@ -356,9 +356,57 @@ export function createPluginsClient(result, context) {
|
|
|
356
356
|
}
|
|
357
357
|
```
|
|
358
358
|
|
|
359
|
+
### Tenant-Scoped Data
|
|
360
|
+
|
|
361
|
+
A **tenant** is a deployment record (subdomain + NEAR account + UI/backend/SSR override
|
|
362
|
+
permissions) — distinct from an organization (a group of users) and from a user's own data.
|
|
363
|
+
If your plugin stores data that belongs to a specific tenant deployment (not just a user or
|
|
364
|
+
org), resolve the tenant and scope every query to it.
|
|
365
|
+
|
|
366
|
+
The `api` plugin owns the `tenants` table and exposes public lookup routes (no auth required —
|
|
367
|
+
tenant lookups are read-only and safe to expose):
|
|
368
|
+
|
|
369
|
+
```ts
|
|
370
|
+
// From any plugin, via pluginsClient.api (injected through withPlugins<PluginsClient>())
|
|
371
|
+
const tenant = context.organization?.activeOrganizationId
|
|
372
|
+
? await plugins.api().resolveTenantByOrgId({ orgId: context.organization.activeOrganizationId })
|
|
373
|
+
: await plugins.api().resolveTenant({ accountId: context.near?.primaryAccountId ?? "" });
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
Build a local `requireTenant` middleware in your own plugin (mirrors `requireOrganization`):
|
|
377
|
+
|
|
378
|
+
```ts
|
|
379
|
+
const requireTenant = builder.middleware(async ({ context, next }) => {
|
|
380
|
+
const activeOrgId = context.organization?.activeOrganizationId;
|
|
381
|
+
const tenant = activeOrgId
|
|
382
|
+
? await plugins.api().resolveTenantByOrgId({ orgId: activeOrgId }).catch(() => null)
|
|
383
|
+
: null;
|
|
384
|
+
if (!tenant) {
|
|
385
|
+
throw new ORPCError("FORBIDDEN", { message: "No tenant found for this organization" });
|
|
386
|
+
}
|
|
387
|
+
return next({ context: { ...context, tenant } });
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
builder.listReports.use(requireTenant).handler(async ({ context }) => {
|
|
391
|
+
return await services.reports.listByTenant(context.tenant.id); // always filtered
|
|
392
|
+
});
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
**Row-level convention (interim isolation)**: add a `tenantId` column to any table holding
|
|
396
|
+
tenant-specific application data, resolved server-side and never trusted from client input —
|
|
397
|
+
same discipline the `tenants` table itself uses for `orgId` scoping. See
|
|
398
|
+
`plugins/_template/src/db/schema.ts` for a commented example table.
|
|
399
|
+
|
|
400
|
+
**Forward path**: the target architecture (see `docs/plans/beta-v2/tenants.md`) is per-tenant-per-plugin
|
|
401
|
+
Postgres schema isolation (`tenant_<id>_plugin_<name>`, `search_path` injected per request). That
|
|
402
|
+
requires request-scoped DB access instead of the current initialize-time singleton pattern — a
|
|
403
|
+
larger change, only worth it once there's a real multi-tenant plugin ecosystem to isolate. The
|
|
404
|
+
`tenantId` column convention above is forward-compatible: when schema isolation lands, the column
|
|
405
|
+
becomes redundant and can be dropped without reworking query logic.
|
|
406
|
+
|
|
359
407
|
## Generated Types
|
|
360
408
|
|
|
361
|
-
See
|
|
409
|
+
See [generated-types](references/generated-types.md) for the full table — files, contents, and regeneration triggers.
|
|
362
410
|
|
|
363
411
|
## SSE Notes
|
|
364
412
|
|
|
@@ -375,3 +423,21 @@ for await (const event of iterator) {
|
|
|
375
423
|
## How Routes Are Mounted
|
|
376
424
|
|
|
377
425
|
The host (`host/src/program.ts`) creates RPC and OpenAPI handlers from each plugin's router, mounted at `/api/rpc/<plugin-namespace>`. The session middleware runs on `/api/*` before the RPC handlers, ensuring context is set.
|
|
426
|
+
|
|
427
|
+
## The tasks you will actually be given
|
|
428
|
+
|
|
429
|
+
**"Add an admin-only route."** Contract declares `.errors({ UNAUTHORIZED, FORBIDDEN })`; handler is `.effect(function* ...)` and guards with `return yield* Effect.fail(errors.UNAUTHORIZED({ apiKeyProvided: !!context.apiKey }))` — note all-optional error shapes still need an explicit `data: {}`. For shared middleware shapes, see `packages/everything-dev/src/api/auth-middleware.ts`.
|
|
430
|
+
|
|
431
|
+
**"Call the auth plugin from my route."** `getAuthClient(services, { reqHeaders: context.reqHeaders })` then `await authClient.getSession()` — in-process, no HTTP roundtrip.
|
|
432
|
+
|
|
433
|
+
**"Wire an SSE route."** Contract: `.output(eventIterator(Schema))`. Handler: async generator that subscribes to the publisher and yields per event, filtering server-side on `pluginId`/query params.
|
|
434
|
+
|
|
435
|
+
## What comes back when it fails
|
|
436
|
+
|
|
437
|
+
| word | do |
|
|
438
|
+
|---|---|
|
|
439
|
+
| `Type 'DecoratedMiddleware'…` on `.use()` | middleware typing does not compose with the `.use()` builder — use the local-middleware pattern (`plugins/proposals/src`) |
|
|
440
|
+
| `UNAUTHORIZED` type error on the fail call | its `data` requires `{ apiKeyProvided: boolean }`; all-optional error shapes still need explicit `data: {}` |
|
|
441
|
+
| runtime 401 with what looks like a valid session | the session middleware resolution returned nulls — check `GET /api/auth/getSession` before blaming the route |
|
|
442
|
+
| `tsc` clean but Effect diagnostics | run `pnpm run lint:effect` (oxlint type-aware) — floating effects and tag mismatches surface there |
|
|
443
|
+
| `ModuleFederationError` / `N plugin(s) failed to load` at startup | the API plugin itself failed to load — `bos mf check`, republish the lagging plugin, restart the host |
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
Pass an optional Zod schema to `createAuthMiddleware` for runtime validation:
|
|
17
17
|
|
|
18
18
|
```ts
|
|
19
|
-
import { z } from "
|
|
19
|
+
import { z } from "zod";
|
|
20
20
|
|
|
21
21
|
const orgMetaSchema = z.object({ plan: z.enum(["free", "pro"]), seats: z.number() });
|
|
22
22
|
const { requireOrganization } = createAuthMiddleware(builder, { orgMetaSchema });
|