@dokebi/cli 0.4.33 → 0.4.35
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/AI.md +4 -4
- package/catalog.json +129 -13
- package/dist/capability-guide.js +1 -1
- package/dist/output.d.ts +1 -1
- package/dist/output.js +1 -1
- package/dist/project.js +2 -4
- package/dist/recipe-facts.d.ts +4 -4
- package/dist/recipe-facts.js +12 -6
- package/dist/recipe-site.d.ts +2 -2
- package/dist/recipe-site.js +3 -3
- package/dist/recipe.js +2 -2
- package/package.json +1 -1
package/AI.md
CHANGED
|
@@ -56,7 +56,7 @@ When the user writes one line, such as "make me a blog with the Dokebi framework
|
|
|
56
56
|
| | admin `--admin`: none (no login or admin area; the public write form is still made), login (an admin login with @dokebi/auth; only signed-in users write; needs a database: with `--db none` it is shown unavailable and refused with `OPTION_NOT_APPLICABLE`), app-code (an admin app on its own domain whose login you write, with @dokebi/auth) | none: a request without an admin area or a login gets none (a public write form needs no login, and @dokebi/csrf protects it) |
|
|
57
57
|
| `api` | db and devInfra only (admin is none, fixed); the module `items` answers JSON (`--no-views`). It builds no browser screens (D-0098): its clients are other programs, and its answers keep `view = none` with who chose it (`--ai-chose view` when the request did not ask for an API only); the app skeleton keeps its EJS home page. A later `app add <name>` in such a project makes an app without views (it inherits `view = none`: `app.ts` and a JSON `routes.ts`, nothing recorded); `--view ejs` or `--inertia` gives it screens | as above |
|
|
58
58
|
|
|
59
|
-
The `blog` plan, depending on the answers: `init` (when the folder is not a project yet) → `add @dokebi/app [--no-first-app]` → `config set dokebi-web.port=<3000>` → [EJS, Inertia without SSR] `add @dokebi/seal` (browser apps are sealed, D-0092, D-0062) → [EJS] `config set dokebi-app.domains.main.<project>.localhost.seal=true` (the shared layout writes `<%- data.seal?.head ?? '' %>`) and `config set dokebi-web.formBody=true` (the write form posts HTML forms, sealed ones too) → [Inertia] `add @dokebi/template-inertia`, `app add main --inertia [--ssr] --domain main.<project>.localhost [--seal]` (`--seal` without SSR: `views/app.js` awaits `sealInertia` from `@dokebi/seal/http`, which `dokebiInertia()` of `vite.config.ts` maps to the served `/dokebi/seal/http.mjs`, so the first page and every visit go sealed) → `add @dokebi/module`, `module add posts [--no-views]` (Inertia: JSON routes, the Vue pages live in the app) → [a database] `add @dokebi/db --adapter <id>`, `add @dokebi/migrate`, `config set dokebi-migrate.connections.main.dialect=<db>` → [docker] `dev-infra`, `npx dokebi dev-infra up --json` → [login, app-code] `add @dokebi/session` (it writes a generated signing secret into dokebi.yaml, `dokebi-session.secrets`) → **always** `add @dokebi/csrf` (D-0076 §6: CSRF protection for the write forms, no question; its secret goes into dokebi.yaml) → [login] `add @dokebi/auth --set homePath=/admin`, `login-code` (the recipe writes user code: `src/infra/auth/extension.ts` on the app's own table `app_members` (`member_no`, `login_name`, `pass_phc`, `logout_key`, `is_active`, `role`; a project from an older recipe keeps `blog_authors` and `author_no`, D-0115) for the chosen database, a migration `src/infra/db/migrations/main/<time>_create_app_members.ts` (mongodb: the collection and a unique index), the seed `src/infra/db/seeds/main/first-admin.ts`, `src/apps/main/routes/auth.ts` with GET/POST `/login` (`auth: 'guest'`), POST `/logout` and `/admin` (`auth: 'required'`), the login and admin pages (EJS or Inertia) and `loginRoutes(route)` in `src/apps/main/routes.ts`; dokebi.yaml gets `options.first-admin` with `login: admin` and a generated `initialPassword`, never printed; the seed hashes it with `passwords.hash`; a project from an older recipe keeps `options.blog-admin`, D-0115), and with docker `npx dokebi-migrate up` and `npx dokebi-migrate seed` (url: the next steps run them after the URL is written) → [app-code] `app add admin --domain admin.<project>.localhost` (`--seal` unless SSR) → [Inertia] `npm run build`. The `report` and verify's `tellUser` say how the forms send the CSRF token (EJS: `<%- data.csrf.field %>`; Inertia: nothing to write), which hosts are sealed (EJS: their forms need no per-form code; Inertia: keep the `sealInertia` bootstrap and import `sealedFetch` from `@dokebi/seal/http`, the same served module), with `inertia-vue-ssr` that the hosts
|
|
59
|
+
The `blog` plan, depending on the answers: `init` (when the folder is not a project yet) → `add @dokebi/app [--no-first-app]` → `config set dokebi-web.port=<3000>` → [EJS, Inertia without SSR] `add @dokebi/seal` (browser apps are sealed, D-0092, D-0062) → [EJS] `config set dokebi-app.domains.main.<project>.localhost.seal=true` (the shared layout writes `<%- data.seal?.head ?? '' %>`) and `config set dokebi-web.formBody=true` (the write form posts HTML forms, sealed ones too) → [Inertia] `add @dokebi/template-inertia`, `app add main --inertia [--ssr] --domain main.<project>.localhost [--seal]` (`--seal` without SSR: `views/app.js` awaits `sealInertia` from `@dokebi/seal/http`, which `dokebiInertia()` of `vite.config.ts` maps to the served `/dokebi/seal/http.mjs`, so the first page and every visit go sealed) → `add @dokebi/module`, `module add posts [--no-views]` (Inertia: JSON routes, the Vue pages live in the app) → [a database] `add @dokebi/db --adapter <id>`, `add @dokebi/migrate`, `config set dokebi-migrate.connections.main.dialect=<db>` → [docker] `dev-infra`, `npx dokebi dev-infra up --json` → [login, app-code] `add @dokebi/session` (it writes a generated signing secret into dokebi.yaml, `dokebi-session.secrets`) → **always** `add @dokebi/csrf` (D-0076 §6: CSRF protection for the write forms, no question; its secret goes into dokebi.yaml) → [login] `add @dokebi/auth --set homePath=/admin`, `login-code` (the recipe writes user code: `src/infra/auth/extension.ts` on the app's own table `app_members` (`member_no`, `login_name`, `pass_phc`, `logout_key`, `is_active`, `role`; a project from an older recipe keeps `blog_authors` and `author_no`, D-0115) for the chosen database, a migration `src/infra/db/migrations/main/<time>_create_app_members.ts` (mongodb: the collection and a unique index), the seed `src/infra/db/seeds/main/first-admin.ts`, `src/apps/main/routes/auth.ts` with GET/POST `/login` (`auth: 'guest'`), POST `/logout` and `/admin` (`auth: 'required'`), the login and admin pages (EJS or Inertia) and `loginRoutes(route)` in `src/apps/main/routes.ts`; dokebi.yaml gets `options.first-admin` with `login: admin` and a generated `initialPassword`, never printed; the seed hashes it with `passwords.hash`; a project from an older recipe keeps `options.blog-admin`, D-0115), and with docker `npx dokebi-migrate up` and `npx dokebi-migrate seed` (url: the next steps run them after the URL is written) → [app-code] `app add admin --domain admin.<project>.localhost` (`--seal` unless SSR) → [Inertia] `npm run build`. The `report` and verify's `tellUser` say how the forms send the CSRF token (EJS: `<%- data.csrf.field %>`; Inertia: nothing to write), which hosts are sealed (EJS: their forms need no per-form code; Inertia: keep the `sealInertia` bootstrap and import `sealedFetch` from `@dokebi/seal/http`, the same served module), with `inertia-vue-ssr` that the recipe left the hosts unsealed (ask the user: sealed, such a host server renders only the pages a route renders with `{ public: true }`, D-0195; a host that only shows public pages, with no writes and no signed-in JSON, gains nothing from seal and may use SSR unsealed) and, with login, the login URL, the login name `admin` and the dokebi.yaml key of the initial password (`options.first-admin.initialPassword`) with "change it before going live". `dokebi verify` builds that line from the project again (D-0115): the section that holds `initialPassword` and its `login` or email key; when it finds none it says so and where to look, never a value that is not there. A file the recipe would write that exists with other content is `RECIPE_FILE_CONFLICT` (the template `add @dokebi/auth` wrote is replaced only while untouched). A second run skips what holds; `build`, `migrate-up` and `seed` run again and change nothing. Inertia posts JSON, so it has no form-body step, and `api` has no forms.
|
|
60
60
|
|
|
61
61
|
## 1. Commands
|
|
62
62
|
|
|
@@ -89,7 +89,7 @@ The `blog` plan, depending on the answers: `init` (when the folder is not a proj
|
|
|
89
89
|
| `dokebi remove <plugin id> [--dry-run]` | Remove a plugin. `REVERSE_DEPENDENCY` when a remaining plugin depends on it, `REQUIRED_PLUGIN` for a required part. An id that is not installed is no change; the package name of an installed plugin is `UNKNOWN_PLUGIN` (`details.fix`: `npx dokebi remove <id>`) |
|
|
90
90
|
| `dokebi migrate [--dry-run]` | Move a 0.1.x project with JSON settings to YAML |
|
|
91
91
|
| `dokebi inspect [--verbose]` / `dokebi doctor [--production] [--verbose]` | `--production` (D-0184) adds the checks of a server, on the settings the app reads there (`DOKEBI_CONFIG` merged with `DOKEBI_SECRETS`; the plugins' option checks see the merged options too): `NODE_ENV_NOT_PRODUCTION` (error: run it as the service runs), `STATE_NOT_SHARED` (error: the per-process state D-0161 refuses in production — memory sessions, auth tokens and login counts, OAuth grants, local rate limits, a local WebSocket hub, seal nonces; a warning for local lock or cache backends), `TRANSPORT_NOT_FOR_PRODUCTION` (mail `log`/`capture`), `WEB_PORT_UNSET` (port 0), `TRUST_PROXY_EMPTY` and `WEB_LISTENS_EVERYWHERE` (warnings), `STORAGE_RELATIVE` (warning: a storage folder inside the release), `PLACEHOLDER_LEFT`, `CONFIG_SECRETS_MISSING`/`_UNSAFE`/`_CONFLICT`/`_UNMATCHED` (as the start would fail), `SECRETS_MISSING` (a plugin's generated secret is not set), `SECRET_IN_CONFIG_FILE` (warning), and with @dokebi/migrate `dokebi-migrate status --json` with those settings: `MIGRATIONS_PENDING` (error: pre-deploy files), `MIGRATIONS_POST_DEPLOY_PENDING` and `MIGRATION_FILE_MISSING` (warnings), `MIGRATIONS_UNCHECKED` (error: status could not run). Read-only diagnosis. doctor exits 1 on an error diagnostic. doctor also runs each installed plugin's own option rules once its section passes the schema (D-0162: the cross-field `checks` the schema cannot say, such as `dokebi-app.unknownDomain` must be `reject` or a key of `domains`), in the same permission-restricted child as install modules: a broken rule is `INVALID_PLUGIN_OPTIONS` with `details[{instancePath, keyword, message}]` (no values) and a `hint`, the error the app would stop with; `config set` refuses such a value the same way and writes nothing. All plugins are checked in one child; a plugin whose entry cannot run there is the warning `PLUGIN_OPTIONS_CHECK_FAILED` (`details.code`; start still checks its rules). The default human output is a summary (health, error and warning counts, one line per diagnostic and plugin); `--verbose` prints everything. `--json` is always complete, with `result.summary{healthy, errors, warnings, plugins, codes}` first. **File ownership (D-0065 §11)**: skeletons that plugins and the CLI create (the shared layout `src/shared/views/layouts/main.ejs`, entry files `src/infra/<name>/…`, `src/infra/worker/tasks.ts`, `src/infra/events/types.ts`, app and module files) are `owner: user`, so editing them is no diagnostic (upgrade keeps edited files); only editing a file a manifest declares `owner: "cli"` (a file that is generated again) is a `MODIFIED_TEMPLATE` warning (`hint`). **Locks**: inspect and doctor take no lock. While another command holds `.dokebi/lock` (a `--dry-run` too), `PROJECT_LOCKED` has `details{pid, running, since, transactions}` and a `hint`: with `running: true` that command is still working (its `.dokebi/transaction-*` is not reported as `RECOVERY_REQUIRED`), so run inspect again when it has ended; with `running: false` the change was interrupted (`RECOVERY_REQUIRED` too): ask the user, never delete the lock |
|
|
92
|
-
| `dokebi app add <name> [--domain <host>]... [--template <name>] [--inertia [--ssr]] [--view <ejs\|none>] [--seal] [--answers-from <user\|defaults>] [--ai-chose view] [--ai-reason view=<why>]` | The app `src/apps/<name>` (D-0030). Its view is a product choice whose default is Inertia + Vue (`--inertia`); without `--inertia` it is EJS, except in a project whose recipe built no browser screens (the api recipe records `view = none`): there the app has no views, only `app.ts` and a `routes.ts` whose `/` answers JSON, no EJS pages and no shared layout, and nothing is recorded for it (tellUser already says the recipe's `view = none`). `--view ejs` gives EJS pages there, `--view none` an app without views anywhere (recorded like EJS: who chose it); `--view` with `--inertia`, or `--view none` with `--template`, is `USAGE`. The result's `appView{value, from}` says what the app got (`ejs`, `none`, `inertia-vue`, `inertia-vue-ssr`; `from: recipe` when the project's recipe chose it). D-0098: the view is recorded in `.dokebi/recipe.json` (`choices`) with who chose it, and verify's `tellUser` says it: `--answers-from user` (the user or the request chose it), `--ai-chose view` with `--ai-reason view=<why>` (the user left it to you; `--answers-from defaults` means the same). An EJS app without either is recorded as unstated, the result warns `VIEW_SOURCE_UNSTATED`, and tellUser says `not the default view (Inertia + Vue), and who chose it was not recorded`; an Inertia app without either records nothing (the default). `--ai-chose` names only `view` (`AI_CHOICE_UNKNOWN`); `AI_REASON_WITHOUT_CHOICE` and `INVALID_AI_REASON` as for recipes. The first app that `add @dokebi/app` creates (`main`, EJS) is recorded as unstated too; for a browser app with the default view use `add @dokebi/app --no-first-app` and then `app add <name> --inertia`. `--inertia` prepares the Vue skeleton, the Vite build and the Vue type check (`typecheck` script, `tsconfig.vue.json`, `typecheck-vue.mjs`, `src/infra/inertia/page.d.ts` for the shared page props), `--ssr` server rendering (D-0039), `--seal` writes `seal: true` on its domains (a domain with dots cannot be a `config set` path; without `@dokebi/seal` the warning `SEAL_PLUGIN_MISSING
|
|
92
|
+
| `dokebi app add <name> [--domain <host>]... [--template <name>] [--inertia [--ssr]] [--view <ejs\|none>] [--seal] [--answers-from <user\|defaults>] [--ai-chose view] [--ai-reason view=<why>]` | The app `src/apps/<name>` (D-0030). Its view is a product choice whose default is Inertia + Vue (`--inertia`); without `--inertia` it is EJS, except in a project whose recipe built no browser screens (the api recipe records `view = none`): there the app has no views, only `app.ts` and a `routes.ts` whose `/` answers JSON, no EJS pages and no shared layout, and nothing is recorded for it (tellUser already says the recipe's `view = none`). `--view ejs` gives EJS pages there, `--view none` an app without views anywhere (recorded like EJS: who chose it); `--view` with `--inertia`, or `--view none` with `--template`, is `USAGE`. The result's `appView{value, from}` says what the app got (`ejs`, `none`, `inertia-vue`, `inertia-vue-ssr`; `from: recipe` when the project's recipe chose it). D-0098: the view is recorded in `.dokebi/recipe.json` (`choices`) with who chose it, and verify's `tellUser` says it: `--answers-from user` (the user or the request chose it), `--ai-chose view` with `--ai-reason view=<why>` (the user left it to you; `--answers-from defaults` means the same). An EJS app without either is recorded as unstated, the result warns `VIEW_SOURCE_UNSTATED`, and tellUser says `not the default view (Inertia + Vue), and who chose it was not recorded`; an Inertia app without either records nothing (the default). `--ai-chose` names only `view` (`AI_CHOICE_UNKNOWN`); `AI_REASON_WITHOUT_CHOICE` and `INVALID_AI_REASON` as for recipes. The first app that `add @dokebi/app` creates (`main`, EJS) is recorded as unstated too; for a browser app with the default view use `add @dokebi/app --no-first-app` and then `app add <name> --inertia`. `--inertia` prepares the Vue skeleton, the Vite build and the Vue type check (`typecheck` script, `tsconfig.vue.json`, `typecheck-vue.mjs`, `src/infra/inertia/page.d.ts` for the shared page props), `--ssr` server rendering (D-0039), `--seal` writes `seal: true` on its domains (a domain with dots cannot be a `config set` path; without `@dokebi/seal` the warning `SEAL_PLUGIN_MISSING`). `--ssr` with `--seal` (0.4.34, D-0195; needs @dokebi/template-inertia 0.4.6, an older one fails the start with `SEAL_SSR_CONFLICT`): only the pages a route renders with `{ public: true }` are server rendered there, plain and without the visitor's props; the others stay sealed. An `@dokebi/app` whose Inertia build template predates the Vue type check (0.4.2 and older) refuses `--inertia` before anything is written: `INVALID_MANIFEST` (phase `plan`, `details.missing`, `details.fix`: `npx dokebi upgrade dokebi-app`, then the same `app add`) |
|
|
93
93
|
| `dokebi app remove <name>` · `app link <app> <domain> [--template] [--seal]` · `app unlink <domain>` · `app list` | Manage apps and domains. `app remove` fails with `APP_IN_USE` while a domain still points to the app (unlink first); it removes the registration and `options.dokebi-app.apps.<name>` (D-0061 per-app settings) from dokebi.yaml and the sample (0.2.5; otherwise the next start fails with `UNKNOWN_APP`) and the app's recorded view from `.dokebi/recipe.json`. The folder stays (user code; the result lists it in `preserved` with the warning `APP_FOLDER_KEPT`) |
|
|
94
94
|
| `dokebi module add <name> [--no-views]` · `module remove` · `module list` | Feature modules `src/shared/modules/<name>` (D-0032). `--no-views`: the routes answer JSON |
|
|
95
95
|
| `dokebi settings add <section>` · `settings sync` · `settings remove <section>` · `settings list` | The settings of the application itself in `options.<section>` (D-0155): `add` writes `src/shared/settings/<section>.ts` (core's `defineSettings` with a `defineOptions` declaration; an existing one default-exporting it is adopted), its schema `src/shared/settings/<section>.schema.json`, the defaults in dokebi.yaml and the example (with the `# reloadable` marks), and registers it, so the app checks the section at start and `config show/set/unset/secret`, doctor and reloads treat it like a plugin section. Code reads `<name>Settings.read(context.app.config)` (typed, cached per configuration, new after a reload). After changing the declaration run `settings sync` (doctor warns `SETTINGS_SCHEMA_STALE`). A value that is still the default the CLI wrote (the old schema's, such as the `pageSize: 50` and `workers: 2` placeholders of `settings add`) follows a changed default, in dokebi.yaml and the example (`sections[].followed`); a value set by hand stays. Then each section is checked against the new schema as doctor checks it: a missing required value is `configRequired`, anything else (a value set by hand above a lowered maximum, a value of an option the declaration dropped) is `INVALID_PLUGIN_OPTIONS` with `details.paths` and a `fix` (`npx dokebi config unset <paths>` or correct it by hand, then sync again), and nothing is written (AI-M49 D2: sync answered ok on what doctor and the app refuse). A section of a plugin, `logging` or `reload` is `SETTINGS_SECTION_CONFLICT`; `remove` keeps the files and the options. A section nothing declares has one code in every config command: `UNDECLARED_SECTION` (`UNKNOWN_PLUGIN` when the name is a plugin that is not installed); `config set` and `secret` refuse it, `config show` (text values hidden) and `unset` work on what is there and warn with it, and doctor and `dokebi check` (`undeclared-section`) report it |
|
|
@@ -299,7 +299,7 @@ One server, several instances (a staging and a production one), installed from t
|
|
|
299
299
|
|
|
300
300
|
`dokebi recipe site` asks `--apps` (web/admin/api combinations, or none), `--domains` (app=host pairs, or auto), `--realms` (app=realm pairs, or auto), `--view` and `--worker none|thread|job`. Text questions have `input: "text"` and an empty options list; present their question and accept a text answer. The same answer-source and wait-for-user rules apply. `auto` selects separate `<app>.<project>.localhost` domains (the development hosts of this project, [Development hosts](#development-hosts)) and realms; it is used only when explicitly answered or delegated through defaults. Duplicate domains, missing mappings and invalid realm names fail before mutation.
|
|
301
301
|
|
|
302
|
-
The site recipe creates a new project or fills a project without existing apps. Its `.dokebi/site-plan.json` checkpoint permits repeating the same choices after a partial failure; different choices require explicit app/config edits. Admin and API routes require authentication; public web routes are optional. Generated user lookups deny all logins until connected to your own user store. No account database or working login UI is claimed. Shared realms do not automatically share host-only cookies. Read `SITE.md` before running the site. The web and admin apps are sealed browser hosts (`add @dokebi/seal`, `app add <app> --domain <host> [--inertia] --seal`, D-0092 §1, D-0062; with `--view ejs` also `dokebi-web.formBody: true` in site-config). The api app stays plain, and so do the apps of `--view inertia-vue-ssr` (
|
|
302
|
+
The site recipe creates a new project or fills a project without existing apps. Its `.dokebi/site-plan.json` checkpoint permits repeating the same choices after a partial failure; different choices require explicit app/config edits. Admin and API routes require authentication; public web routes are optional. Generated user lookups deny all logins until connected to your own user store. No account database or working login UI is claimed. Shared realms do not automatically share host-only cookies. Read `SITE.md` before running the site. The web and admin apps are sealed browser hosts (`add @dokebi/seal`, `app add <app> --domain <host> [--inertia] --seal`, D-0092 §1, D-0062; with `--view ejs` also `dokebi-web.formBody: true` in site-config). The api app stays plain, and so do the apps of `--view inertia-vue-ssr` (the notice asks the user to decide: sealed, they would server render only public pages, D-0195). A thread worker uses the generated CPU task module (`src/infra/worker/tasks.ts`); a job worker is the plugin `src/infra/runtime/site-worker.ts` (registered in `src/main.ts`, so the src root keeps only `main.ts` and `dokebi.generated.ts`) and needs a configured NATS endpoint and `npx dokebi-job-provision --queue siteWorker`. Both run in the same process; `--apps none` makes a worker-only project. A project made by an older site recipe keeps its worker at `src/site-worker.ts`: it keeps working, a re-run of the same recipe keeps that file and its `SITE.md` instead of writing a second copy, and doctor reports a `LEGACY_LAYOUT` warning with `details.moveTo` naming the new place. Moving it is your step (fix its relative imports and the import in `src/main.ts`), because the file is your code.
|
|
303
303
|
|
|
304
304
|
HTTP verification treats 401/403 from this run's instance on an app domain as reachable and reports `accessDenied: true`; it does not verify login. Readiness endpoints still require 2xx/3xx, and 400/404/5xx domain responses fail. Application tests must cover authentication and authorization.
|
|
305
305
|
|
|
@@ -345,7 +345,7 @@ How the browser seals depends on the view:
|
|
|
345
345
|
apps through `dokebiInertia()`, so pages import `@dokebi/seal/http` statically like any
|
|
346
346
|
package). Never load `/dokebi/seal/http.mjs` by URL next to a bundled copy.
|
|
347
347
|
|
|
348
|
-
Resolve an explicit SSR request with the user
|
|
348
|
+
Resolve an explicit SSR request with the user: on a seal host only public pages are server rendered (D-0195: a route renders with `{ public: true }`; its first HTML is plain and holds no visitor's props, every other page stays sealed). `app add --ssr --seal` makes such an app; the recipes leave SSR hosts unsealed and say so in the report. Follow
|
|
349
349
|
`@dokebi/csrf/AI.md` for the current token header in a shared adapter; `sealedFetch` does
|
|
350
350
|
not add it automatically. Never exempt upload routes to avoid token handling. Multipart
|
|
351
351
|
bytes and GET queries are not sealed.
|
package/catalog.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$comment": "Generated by scripts/catalog/build.ts from package.json dokebiCatalog fields and packages/cli/catalog-src (D-0065). Do not edit; run node scripts/catalog/build.ts.",
|
|
3
3
|
"schemaVersion": 1,
|
|
4
|
-
"cli": "0.4.
|
|
4
|
+
"cli": "0.4.35",
|
|
5
5
|
"core": {
|
|
6
6
|
"package": "@dokebi/core",
|
|
7
7
|
"version": "0.4.6"
|
|
@@ -215,6 +215,14 @@
|
|
|
215
215
|
"summary": "password reset by e-mail (forgotten password links)",
|
|
216
216
|
"en": "password reset forgot recovery link"
|
|
217
217
|
},
|
|
218
|
+
"payment.tron-node": {
|
|
219
|
+
"summary": "a TRON node (TronGrid, Nile or mainnet) for the payment plugin: deposits, balances, energy and transfers checked before signing",
|
|
220
|
+
"en": "tron trongrid nile mainnet node blockchain usdt trc20 driver"
|
|
221
|
+
},
|
|
222
|
+
"payment.usdt-trc20": {
|
|
223
|
+
"summary": "on-chain USDT (TRC20) custody: deposit addresses per member, deposits credited into your ledger in one transaction, withdrawals, sweeps, reconciliation and a kill switch",
|
|
224
|
+
"en": "payment crypto usdt tether trc20 tron wallet deposit withdrawal custody blockchain"
|
|
225
|
+
},
|
|
218
226
|
"pdf.generate": {
|
|
219
227
|
"summary": "create PDF files (documents, invoices, reports)",
|
|
220
228
|
"en": "pdf generate create make export render document invoice report print"
|
|
@@ -434,7 +442,7 @@
|
|
|
434
442
|
{
|
|
435
443
|
"id": "dokebi-app",
|
|
436
444
|
"package": "@dokebi/app",
|
|
437
|
-
"version": "0.4.
|
|
445
|
+
"version": "0.4.6",
|
|
438
446
|
"kind": "plugin",
|
|
439
447
|
"summary": "Several apps chosen by request domain (src/apps/<app>) with a template each; installs web, controller and template-ejs with it",
|
|
440
448
|
"description": "Multiple apps per project for Dokebi: pick the app and template by request domain, with EJS and Inertia skeletons.",
|
|
@@ -807,7 +815,7 @@
|
|
|
807
815
|
{
|
|
808
816
|
"id": null,
|
|
809
817
|
"package": "@dokebi/cli",
|
|
810
|
-
"version": "0.4.
|
|
818
|
+
"version": "0.4.35",
|
|
811
819
|
"kind": "cli",
|
|
812
820
|
"summary": "Commands to create a project, browse the plugin catalog, run recipes, install plugins and verify (dokebi)",
|
|
813
821
|
"description": "Project scaffolding, plugin catalog, recipes, install and verification CLI for Dokebi.",
|
|
@@ -1359,7 +1367,7 @@
|
|
|
1359
1367
|
{
|
|
1360
1368
|
"id": "dokebi-files",
|
|
1361
1369
|
"package": "@dokebi/files",
|
|
1362
|
-
"version": "0.1.
|
|
1370
|
+
"version": "0.1.2",
|
|
1363
1371
|
"kind": "plugin",
|
|
1364
1372
|
"summary": "A record of every stored file: uploads recorded without an owner, claimed by a feature in its transaction, removals whose bytes go after the commit through @dokebi/outbox, unowned files swept after a grace, read rules per owner type in front of downloads and thumbnails, lists by owner, kind and time",
|
|
1365
1373
|
"description": "A record of every stored file for Dokebi: owners claimed in the caller's transaction, removals whose bytes are deleted after the commit (@dokebi/outbox), a sweep of unowned files after a grace, read rules per owner type, uploads, downloads and thumbnails behind them.",
|
|
@@ -1555,7 +1563,7 @@
|
|
|
1555
1563
|
{
|
|
1556
1564
|
"id": "dokebi-i18n",
|
|
1557
1565
|
"package": "@dokebi/i18n",
|
|
1558
|
-
"version": "0.2.
|
|
1566
|
+
"version": "0.2.3",
|
|
1559
1567
|
"kind": "plugin",
|
|
1560
1568
|
"summary": "Compiled translations, locale negotiation, cardinal plurals and named number/date formats",
|
|
1561
1569
|
"description": "Compiled translation catalogs, locale negotiation, cardinal plurals and named Intl formats.",
|
|
@@ -1866,7 +1874,7 @@
|
|
|
1866
1874
|
{
|
|
1867
1875
|
"id": "dokebi-mail",
|
|
1868
1876
|
"package": "@dokebi/mail",
|
|
1869
|
-
"version": "0.4.
|
|
1877
|
+
"version": "0.4.4",
|
|
1870
1878
|
"kind": "plugin",
|
|
1871
1879
|
"summary": "Mail: EJS templates per locale, SMTP with required STARTTLS (nodemailer) and Amazon SES v2, queued sending through @dokebi/job with sealed links and tokens, a development inbox and test outbox",
|
|
1872
1880
|
"description": "Mail for Dokebi apps: EJS templates per locale, SMTP (nodemailer, STARTTLS required) and Amazon SES v2, queued sending through @dokebi/job with sealed data, deterministic Message-IDs, a development inbox and test helpers.",
|
|
@@ -2372,6 +2380,113 @@
|
|
|
2372
2380
|
},
|
|
2373
2381
|
"install": "npx dokebi add @dokebi/outbox"
|
|
2374
2382
|
},
|
|
2383
|
+
{
|
|
2384
|
+
"id": "dokebi-payment",
|
|
2385
|
+
"package": "@dokebi/payment",
|
|
2386
|
+
"version": "0.2.0",
|
|
2387
|
+
"kind": "plugin",
|
|
2388
|
+
"summary": "On-chain USDT (TRC20) custody: a fixed deposit address per owner from an account xpub, deposits confirmed into the app's ledger in one transaction, withdrawals from a hot wallet with energy and retries, sweeps, daily reconciliation, alerts and a kill switch; keys in encrypted files, never on a command line",
|
|
2389
|
+
"description": "On-chain USDT (TRC20) custody for Dokebi: deposit addresses derived from an account xpub, deposits watched and confirmed into the app's ledger in one transaction, withdrawals sent from the hot wallet, sweeps, daily reconciliation, alerts and a kill switch, over @dokebi/db and @dokebi/outbox.",
|
|
2390
|
+
"keywords": [
|
|
2391
|
+
"dokebi",
|
|
2392
|
+
"dokebi-plugin",
|
|
2393
|
+
"payment",
|
|
2394
|
+
"usdt",
|
|
2395
|
+
"trc20",
|
|
2396
|
+
"tron"
|
|
2397
|
+
],
|
|
2398
|
+
"maturity": "experimental",
|
|
2399
|
+
"core": "^0.4.6",
|
|
2400
|
+
"provides": [
|
|
2401
|
+
"payment.usdt-trc20"
|
|
2402
|
+
],
|
|
2403
|
+
"variants": [],
|
|
2404
|
+
"doesNot": [
|
|
2405
|
+
"No MongoDB (PostgreSQL, MySQL 8, MariaDB 10.6+)",
|
|
2406
|
+
"Keeps no ledger: the app credits and debits in the hooks and calls",
|
|
2407
|
+
"No prices, no automatic-withdrawal limits, no member screens (the app's)",
|
|
2408
|
+
"Talks to a real TRON node only with a chain driver (@dokebi/payment-tron gives tron); built in is the mock chain",
|
|
2409
|
+
"Does not create tables at start (the migration dokebi add writes)"
|
|
2410
|
+
],
|
|
2411
|
+
"recipes": [],
|
|
2412
|
+
"requires": [
|
|
2413
|
+
{
|
|
2414
|
+
"id": "dokebi-db",
|
|
2415
|
+
"range": "^0.4.2",
|
|
2416
|
+
"package": "@dokebi/db",
|
|
2417
|
+
"automatic": true
|
|
2418
|
+
},
|
|
2419
|
+
{
|
|
2420
|
+
"id": "dokebi-outbox",
|
|
2421
|
+
"range": "^0.1.0",
|
|
2422
|
+
"package": "@dokebi/outbox",
|
|
2423
|
+
"automatic": true
|
|
2424
|
+
}
|
|
2425
|
+
],
|
|
2426
|
+
"optional": [],
|
|
2427
|
+
"optionKeys": [
|
|
2428
|
+
"alerts",
|
|
2429
|
+
"allowMainnet",
|
|
2430
|
+
"background",
|
|
2431
|
+
"chain",
|
|
2432
|
+
"cold",
|
|
2433
|
+
"connection",
|
|
2434
|
+
"credit",
|
|
2435
|
+
"energy",
|
|
2436
|
+
"halted",
|
|
2437
|
+
"keystore",
|
|
2438
|
+
"list",
|
|
2439
|
+
"mock",
|
|
2440
|
+
"network",
|
|
2441
|
+
"reconcile",
|
|
2442
|
+
"signingPaused",
|
|
2443
|
+
"sweep",
|
|
2444
|
+
"tron",
|
|
2445
|
+
"watch",
|
|
2446
|
+
"withdraw"
|
|
2447
|
+
],
|
|
2448
|
+
"docs": {
|
|
2449
|
+
"ai": "AI.md",
|
|
2450
|
+
"readme": "README.md"
|
|
2451
|
+
},
|
|
2452
|
+
"install": "npx dokebi add @dokebi/payment"
|
|
2453
|
+
},
|
|
2454
|
+
{
|
|
2455
|
+
"id": null,
|
|
2456
|
+
"package": "@dokebi/payment-tron",
|
|
2457
|
+
"version": "0.1.1",
|
|
2458
|
+
"kind": "library",
|
|
2459
|
+
"summary": "The TRON node driver of @dokebi/payment (TronGrid, Nile and mainnet): USDT deposits with their block and log index, balances, energy, transfers built by the node and decoded before signing, broadcast results sorted into refused and retryable",
|
|
2460
|
+
"description": "The TRON chain driver of @dokebi/payment: TronGrid HTTP (Nile, mainnet) for blocks, USDT deposits, balances, energy and transactions; every transaction the node builds is decoded and checked against the request before anything signs it.",
|
|
2461
|
+
"keywords": [
|
|
2462
|
+
"dokebi",
|
|
2463
|
+
"payment",
|
|
2464
|
+
"tron",
|
|
2465
|
+
"trongrid",
|
|
2466
|
+
"usdt",
|
|
2467
|
+
"trc20"
|
|
2468
|
+
],
|
|
2469
|
+
"maturity": "experimental",
|
|
2470
|
+
"core": "^0.4.6",
|
|
2471
|
+
"provides": [
|
|
2472
|
+
"payment.tron-node"
|
|
2473
|
+
],
|
|
2474
|
+
"variants": [],
|
|
2475
|
+
"doesNot": [
|
|
2476
|
+
"Not a plugin you app.register: export const chains = { tron } in src/infra/payment/extension.ts",
|
|
2477
|
+
"Holds no keys and signs nothing (@dokebi/payment's signer does)",
|
|
2478
|
+
"No energy rental: the payment plugin burns TRX for energy"
|
|
2479
|
+
],
|
|
2480
|
+
"recipes": [],
|
|
2481
|
+
"requires": [],
|
|
2482
|
+
"optional": [],
|
|
2483
|
+
"optionKeys": [],
|
|
2484
|
+
"docs": {
|
|
2485
|
+
"ai": "AI.md",
|
|
2486
|
+
"readme": "README.md"
|
|
2487
|
+
},
|
|
2488
|
+
"install": "npm install @dokebi/payment-tron"
|
|
2489
|
+
},
|
|
2375
2490
|
{
|
|
2376
2491
|
"id": "dokebi-pdf",
|
|
2377
2492
|
"package": "@dokebi/pdf",
|
|
@@ -2650,7 +2765,7 @@
|
|
|
2650
2765
|
{
|
|
2651
2766
|
"id": null,
|
|
2652
2767
|
"package": "@dokebi/rich-text",
|
|
2653
|
-
"version": "0.1.
|
|
2768
|
+
"version": "0.1.2",
|
|
2654
2769
|
"kind": "library",
|
|
2655
2770
|
"summary": "Editor documents (Tiptap or ProseMirror JSON) checked whole against a declared schema of nodes, marks, links and image sources, with coded 422 errors, then safe HTML, plain text and excerpts",
|
|
2656
2771
|
"description": "Rich text documents for Dokebi: editor JSON (Tiptap, ProseMirror) checked whole against a declared schema with coded 422 errors, then safe HTML, plain text and excerpts.",
|
|
@@ -2878,7 +2993,7 @@
|
|
|
2878
2993
|
{
|
|
2879
2994
|
"id": "dokebi-seal",
|
|
2880
2995
|
"package": "@dokebi/seal",
|
|
2881
|
-
"version": "0.4.
|
|
2996
|
+
"version": "0.4.4",
|
|
2882
2997
|
"kind": "plugin",
|
|
2883
2998
|
"summary": "Seals WebSocket frames and HTTP bodies (obfuscation, replay protection) with a browser client (WASM)",
|
|
2884
2999
|
"description": "Payload sealing (obfuscation, replay defence, in-transit encryption) for seal hosts: @dokebi/websocket frames and @dokebi/web HTTP bodies, with browser socket, fetch and Inertia clients and their WASM loader",
|
|
@@ -3166,7 +3281,7 @@
|
|
|
3166
3281
|
{
|
|
3167
3282
|
"id": "dokebi-storage",
|
|
3168
3283
|
"package": "@dokebi/storage",
|
|
3169
|
-
"version": "0.1.
|
|
3284
|
+
"version": "0.1.2",
|
|
3170
3285
|
"kind": "plugin",
|
|
3171
3286
|
"summary": "Local and S3 file storage with bounded multipart uploads and private downloads",
|
|
3172
3287
|
"description": "Bounded streaming file storage with local and S3 drivers and optional multipart uploads.",
|
|
@@ -3203,6 +3318,7 @@
|
|
|
3203
3318
|
"signedUrlMaxExpiresIn",
|
|
3204
3319
|
"sniffBytes",
|
|
3205
3320
|
"staleUploadMs",
|
|
3321
|
+
"stores",
|
|
3206
3322
|
"tempDirectory",
|
|
3207
3323
|
"timeoutMs",
|
|
3208
3324
|
"timeoutRetryAfterMs",
|
|
@@ -3266,7 +3382,7 @@
|
|
|
3266
3382
|
{
|
|
3267
3383
|
"id": "dokebi-template-inertia",
|
|
3268
3384
|
"package": "@dokebi/template-inertia",
|
|
3269
|
-
"version": "0.4.
|
|
3385
|
+
"version": "0.4.6",
|
|
3270
3386
|
"kind": "plugin",
|
|
3271
3387
|
"summary": "Inertia (v3) server adapter: Vue 3 views, Vite build files and optional server-side rendering (SSR)",
|
|
3272
3388
|
"description": "Inertia v3 server adapter for Dokebi: page JSON, Vite manifest assets and optional server-side rendering.",
|
|
@@ -3480,7 +3596,7 @@
|
|
|
3480
3596
|
{
|
|
3481
3597
|
"id": "dokebi-web",
|
|
3482
3598
|
"package": "@dokebi/web",
|
|
3483
|
-
"version": "0.4.
|
|
3599
|
+
"version": "0.4.6",
|
|
3484
3600
|
"kind": "plugin",
|
|
3485
3601
|
"summary": "Fastify 5 HTTP server (503 before ready, health paths, drain, zero-downtime cluster replacement, security headers and overload protection on by default)",
|
|
3486
3602
|
"description": "Fastify 5 HTTP server owned by a Dokebi app: 503 before ready, health routes, drain and cluster handover.",
|
|
@@ -3799,7 +3915,7 @@
|
|
|
3799
3915
|
"forms": true
|
|
3800
3916
|
},
|
|
3801
3917
|
"then": [
|
|
3802
|
-
"Web application requirements: install the i18n capability and verify sealing (the recipe installed security.seal and sealed the browser hosts). Inertia + Vue is the default view unless the user chose another: keep the sealInertia bootstrap of views/app.js before createInertiaApp and dokebiInertia() in vite.config.ts (it makes every import of @dokebi/seal/http load the served /dokebi/seal/http.mjs); the first page and every visit then go sealed. With inertia-vue-ssr the recipe left the hosts unsealed
|
|
3918
|
+
"Web application requirements: install the i18n capability and verify sealing (the recipe installed security.seal and sealed the browser hosts). Inertia + Vue is the default view unless the user chose another: keep the sealInertia bootstrap of views/app.js before createInertiaApp and dokebiInertia() in vite.config.ts (it makes every import of @dokebi/seal/http load the served /dokebi/seal/http.mjs); the first page and every visit then go sealed. With inertia-vue-ssr the recipe left the hosts unsealed: tell the user and let them choose; sealed, such a host server renders only the pages a route renders with { public: true } (D-0195). With EJS, the recipe sealed the host and turned on dokebi-web.formBody (sealed forms are form bodies); keep <%- data.seal?.head ?? '' %> in the shared layout <head> (first, before an import map of its own); it loads @dokebi/seal/forms, which seals every post form with no per-form code and moves _csrf into the x-csrf-token header of a multipart form itself. Submit from a script with form.requestSubmit() or submitSealedForm(form), never form.submit() (it goes out plain: 415); data-seal=\"off\" only for a deliberate exception, never to make a plain form post pass (a sealed host answers it 415). Application API requests use @dokebi/seal/http sealedFetch, with the same module instance as that bootstrap (Inertia: import { sealedFetch } from @dokebi/seal/http in the page; dokebiInertia() makes it the served module views/app.js uses), and the documented CSRF header. Do not substitute raw fetch or direct Inertia HTTP calls, and never turn sealing off to make a form work or a request pass",
|
|
3803
3919
|
"Provide Korean and English UI, validation messages and persistent language switching. Keep matching feature catalogs under src/shared/locales/ko and src/shared/locales/en and use the documented key/default pair. Read the installed i18n AI guide; Vue pages use useI18n() of @dokebi/template-inertia/i18n",
|
|
3804
3920
|
"Confirm single application process or process cluster and the worker count with the user. The blog recipe does not configure process topology. For cluster, discover process.cluster, install the library from its catalog entry, and read node_modules/@dokebi/cluster/AI.md. Keep the parent in src/main.ts and the worker factory in src/infra/runtime/application.ts; configure the count in YAML and share its absolute DOKEBI_CONFIG path. Provision shared state and queues actually used by the app before checking all workers and graceful shutdown. Job consumers and CPU threads are separate choices; there is no recipe --workers flag",
|
|
3805
3921
|
"Attach the module to the app: modules: { \"/posts\": posts } in src/apps/main/app.ts (posts = the default export of src/shared/modules/posts/module.ts)",
|
|
@@ -3842,7 +3958,7 @@
|
|
|
3842
3958
|
"then": [
|
|
3843
3959
|
"Connect the realm auth extensions to your own user tables before enabling login",
|
|
3844
3960
|
"Security headers and overload protection of @dokebi/web are on by default (D-0149, D-0150): keep them, and change a CSP directive in dokebi.yaml rather than turning them off. Add @dokebi/cors only when the user asks for pages on other origins (D-0148)",
|
|
3845
|
-
"For web apps, install i18n (the recipe installed security.seal and sealed the web and admin hosts; api stays plain). Use @dokebi/seal/http for application API requests and preserve its Inertia bridge on the same module instance. Inertia web and admin apps: keep the sealInertia bootstrap of views/app.js before createInertiaApp and dokebiInertia() in vite.config.ts, and import sealedFetch from @dokebi/seal/http (the plugin makes it the same served module). With server rendering (inertia-vue-ssr) the recipe left them unsealed
|
|
3961
|
+
"For web apps, install i18n (the recipe installed security.seal and sealed the web and admin hosts; api stays plain). Use @dokebi/seal/http for application API requests and preserve its Inertia bridge on the same module instance. Inertia web and admin apps: keep the sealInertia bootstrap of views/app.js before createInertiaApp and dokebiInertia() in vite.config.ts, and import sealedFetch from @dokebi/seal/http (the plugin makes it the same served module). With server rendering (inertia-vue-ssr) the recipe left them unsealed: tell the user and let them choose; sealed, such a host server renders only the pages a route renders with { public: true } (D-0195). EJS web and admin apps are sealed hosts with dokebi-web.formBody on (the recipe did both): keep <%- data.seal?.head ?? '' %> in the shared layout <head> so @dokebi/seal/forms seals their post forms (no per-form code; a multipart form gets its _csrf moved into the x-csrf-token header); submit from a script with form.requestSubmit() or submitSealedForm(form), never form.submit(); never turn sealing off to make a form work. Follow the documented CSRF header contract; resolve explicit SSR conflicts before choosing configuration",
|
|
3846
3962
|
"For web apps, implement Korean and English catalogs by feature under src/shared/locales/ko and src/shared/locales/en, translated forms and validation, and persistent language switching; verify both languages"
|
|
3847
3963
|
]
|
|
3848
3964
|
}
|
package/dist/capability-guide.js
CHANGED
|
@@ -28,7 +28,7 @@ export const INTEGRATION_RULES = [
|
|
|
28
28
|
'Scope: these are reusable engineering rules, not a product specification. Seal browser transport and Korean/English UI are explicit consumer conventions; other features remain conditional. Examples do not fix domain names, schemas, UI layout, worker count, retention duration, notification recipients or message-history policy for a new product. Apply feature-specific rules only when that feature is requested or installed; do not add uploads, hierarchies, notifications or other product features merely because they appear here. Keep domain entities, user roles, recipient rules and workflows in the project-specific requirements outside this maintained block.',
|
|
29
29
|
'',
|
|
30
30
|
'- Product planning before implementation: treat the result as a real service, not a demo. Map the intended user journeys and distinguish domain concepts before choosing tables, endpoints or screens. Define each domain concept by its purpose, ownership, lifecycle and discovery/editing flow; concepts sharing a persistence mechanism need not share a user flow. For hierarchical features, specify traversal order, sibling order and page boundaries before choosing hierarchy queries. A requested tree listing renders descendants beneath their parent in tree order; a globally time-sorted list with depth badges or parent links is not that tree. Retain parent context when a bounded page continues a branch, and test the actual rendered row order with multiple branches and interleaved creation times. Record acceptance checks for discovery/navigation, creation, editing, cancellation, deletion, permissions, empty/loading/error states and operator recovery. Validate those journeys in the actual UI (see Browser apps and the view: a service people use in a browser has screens); API tests and startup success cannot establish usable product behavior. Resolve material product ambiguity with the user, preserve existing requirements, and keep deployment claims limited to environments actually verified.',
|
|
31
|
-
"- Required browser transport (consumer convention; the core plugin remains optional): install @dokebi/seal in every browser-facing web app whose pages send data, and configure and verify seal-enabled domains. Which hosts: Seal a host whose pages send data (forms, sealedFetch, Inertia visits). A host that only shows public pages (no writes, no signed-in JSON) gains nothing from seal: leave its domain without `seal: true`. Its pages then need no seal files and no 'wasm-unsafe-eval', and may use Inertia SSR. If you do seal such a host, its read-only pages load only the two small modules (about 19 KB), never the wasm. Inertia + Vue is the default view unless the user chose another. Inertia: navigation/forms retain the official sealInertia(http) integration before createInertiaApp (the generated views/app.js imports @dokebi/seal/http when the first page is sealed, then the data-page and every visit, form post and validation error go sealed; a plain JSON body gets 415 SEAL_REQUIRED). The generated vite.config.ts has dokebiInertia() from @dokebi/template-inertia/vite: every import of @dokebi/seal/http in the app's browser code loads the module the app serves (/dokebi/seal/http.mjs), in the build and in dokebi dev, so Vue pages write a plain static import { sealedFetch } from '@dokebi/seal/http' and share the bootstrap's seal; keep that plugin in a vite config of your own (app add warns VITE_PLUGIN_MISSING without it). The plugin also limits what dokebi dev serves to the browser (D-0129): the views folders, node_modules and the files they import; dokebi.yaml, .env, keys and the server code answer 403. Never add server.fs to vite.config (strict: false, a deny list, allow: ['.']) to make a file load: put browser code under views/ or add its folder with dokebiInertia({ allow: ['src/shared/browser'] }) (dokebi check warns vite-dev-files). EJS: write <%- data.seal?.head ?? '' %> in the shared layout <head> (the template-ejs layout has it), and in the <head> of every page rendered without that layout (it is empty on a domain without seal); when a layout has its own import map, the seal head comes first, before that map and every module script. It loads the browser module @dokebi/seal/forms (served as /dokebi/seal/forms.mjs), which seals every same-origin <form method=\"post\"> with no per-form code and sends it with the request header x-dokebi-form: 1, so the form keeps its <%- data.csrf.field %> and the handlers, validation and 303/422 form flow stay those of a plain HTML form. Sealed forms are form bodies: set dokebi-web.formBody: true (without it they get 415 FORM_BODY_DISABLED). A form with a chosen file goes as multipart (file bytes are not sealed) and the forms module moves its _csrf field into the x-csrf-token header itself; write no upload-specific CSRF code. To submit from a script call form.requestSubmit() or submitSealedForm(form) from @dokebi/seal/forms, never form.submit(): it fires no submit event and goes out plain (415). Page navigation (GET) stays plain HTML. Mark a form data-seal=\"off\" only for a deliberate exception, never to make a plain form post pass: a sealed domain refuses that unsealed post (415 SEAL_REQUIRED). Never turn sealing off, set seal: false on a form route or drop the layout head to make a plain form work. Both views: use sealedFetch from @dokebi/seal/http for all application-owned HTTP requests, including REST/JSON and multipart uploads. Do not call raw fetch, Axios or Inertia http.getClient().request from application API adapters. Import bootstrap and request helpers from the same module instance, the served /dokebi/seal/http.mjs: EJS pages reach it through the import map of the seal head, Inertia apps through dokebiInertia(), so both import @dokebi/seal/http by name; never load /dokebi/seal/http.mjs by URL next to a bundled copy of @dokebi/seal/http. Preserve generated template selection and hydration contracts. Server rendering
|
|
31
|
+
"- Required browser transport (consumer convention; the core plugin remains optional): install @dokebi/seal in every browser-facing web app whose pages send data, and configure and verify seal-enabled domains. Which hosts: Seal a host whose pages send data (forms, sealedFetch, Inertia visits). A host that only shows public pages (no writes, no signed-in JSON) gains nothing from seal: leave its domain without `seal: true`. Its pages then need no seal files and no 'wasm-unsafe-eval', and may use Inertia SSR. If you do seal such a host, its read-only pages load only the two small modules (about 19 KB), never the wasm. Inertia + Vue is the default view unless the user chose another. Inertia: navigation/forms retain the official sealInertia(http) integration before createInertiaApp (the generated views/app.js imports @dokebi/seal/http when the first page is sealed, then the data-page and every visit, form post and validation error go sealed; a plain JSON body gets 415 SEAL_REQUIRED). The generated vite.config.ts has dokebiInertia() from @dokebi/template-inertia/vite: every import of @dokebi/seal/http in the app's browser code loads the module the app serves (/dokebi/seal/http.mjs), in the build and in dokebi dev, so Vue pages write a plain static import { sealedFetch } from '@dokebi/seal/http' and share the bootstrap's seal; keep that plugin in a vite config of your own (app add warns VITE_PLUGIN_MISSING without it). The plugin also limits what dokebi dev serves to the browser (D-0129): the views folders, node_modules and the files they import; dokebi.yaml, .env, keys and the server code answer 403. Never add server.fs to vite.config (strict: false, a deny list, allow: ['.']) to make a file load: put browser code under views/ or add its folder with dokebiInertia({ allow: ['src/shared/browser'] }) (dokebi check warns vite-dev-files). EJS: write <%- data.seal?.head ?? '' %> in the shared layout <head> (the template-ejs layout has it), and in the <head> of every page rendered without that layout (it is empty on a domain without seal); when a layout has its own import map, the seal head comes first, before that map and every module script. It loads the browser module @dokebi/seal/forms (served as /dokebi/seal/forms.mjs), which seals every same-origin <form method=\"post\"> with no per-form code and sends it with the request header x-dokebi-form: 1, so the form keeps its <%- data.csrf.field %> and the handlers, validation and 303/422 form flow stay those of a plain HTML form. Sealed forms are form bodies: set dokebi-web.formBody: true (without it they get 415 FORM_BODY_DISABLED). A form with a chosen file goes as multipart (file bytes are not sealed) and the forms module moves its _csrf field into the x-csrf-token header itself; write no upload-specific CSRF code. To submit from a script call form.requestSubmit() or submitSealedForm(form) from @dokebi/seal/forms, never form.submit(): it fires no submit event and goes out plain (415). Page navigation (GET) stays plain HTML. Mark a form data-seal=\"off\" only for a deliberate exception, never to make a plain form post pass: a sealed domain refuses that unsealed post (415 SEAL_REQUIRED). Never turn sealing off, set seal: false on a form route or drop the layout head to make a plain form work. Both views: use sealedFetch from @dokebi/seal/http for all application-owned HTTP requests, including REST/JSON and multipart uploads. Do not call raw fetch, Axios or Inertia http.getClient().request from application API adapters. Import bootstrap and request helpers from the same module instance, the served /dokebi/seal/http.mjs: EJS pages reach it through the import map of the seal head, Inertia apps through dokebiInertia(), so both import @dokebi/seal/http by name; never load /dokebi/seal/http.mjs by URL next to a bundled copy of @dokebi/seal/http. Preserve generated template selection and hydration contracts. Server rendering on a seal host covers public pages only (D-0195): a route that renders with { public: true } gets a plain, server-rendered first HTML without the visitor's props (auth, csrf and the entry's shared arrive right after through a sealed visit), and every other page of that host stays sealed and is not server rendered. dokebi app add --inertia --ssr --seal makes such an app; mark the routes whose first HTML crawlers must read with { public: true } and head (title, description, canonical, alternates), put only public data in their props, keep values the same for every visitor in publicShared of src/infra/inertia/shared.ts, and draw the layout before the visitor's props arrive. The recipes leave SSR hosts unsealed and say so: ask the user whether those hosts send data, and if they do, seal them and mark their public pages (a read-only public host may stay unsealed with SSR). File multipart bytes and GET queries are outside sealing; verify sealed JSON responses and errors too. sealedFetch does not add CSRF headers automatically: follow the installed @dokebi/csrf guide in one shared adapter, read the current token for each request, keep credentials same-origin, and never disable CSRF to make uploads pass.",
|
|
32
32
|
`- Recipe answers (D-0095): a request often settles some choices (for example PostgreSQL, Docker, EJS) and leaves others open. Choices the request leaves open are still the user's: ask and end your turn, unless the user said to decide them. ${ANSWER_SOURCES} The recipe records who made each choice (answeredBy user, ai, default) and verify's tellUser tells the user; never present a choice you made as the user's answer.`,
|
|
33
33
|
`- Browser apps and the view (D-0098): ${BROWSER_APPS} Outside a recipe, npx dokebi app add records the view with --answers-from user or --ai-chose view --ai-reason view=<why>; an EJS app added without either (also the first app of add @dokebi/app) is reported to the user as not the default view with its chooser unrecorded. Validate the journeys of the screens in the actual UI (Product planning).`,
|
|
34
34
|
'- Processes and shared tools: stop a process by the PID you recorded or with npx dokebi stop, never by a pattern (pkill -f, killall): other apps on the machine run the same command lines (src/main.ts, the cluster worker). Check screens in a browser you start yourself with its own temporary profile (a headless or separate Playwright browser), never in the browser the person is using, through an extension or a computer-use tool: its tabs, cookies and signed-in sessions belong to them. Close only the tabs and contexts you opened; never navigate, reuse or close tabs you did not open. Keep downloaded browsers and package caches outside the project folder.',
|
package/dist/output.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const CLI_VERSION = "0.4.
|
|
1
|
+
export declare const CLI_VERSION = "0.4.35";
|
|
2
2
|
export declare function envelope(command: string, result: unknown, ok?: boolean): object;
|
|
3
3
|
export declare function failure(command: string, error: unknown, mutationStarted: boolean): object;
|
package/dist/output.js
CHANGED
package/dist/project.js
CHANGED
|
@@ -3866,10 +3866,8 @@ export class Project {
|
|
|
3866
3866
|
warnings.push({ code: 'SEAL_PLUGIN_MISSING', path: `src/apps/${name}` });
|
|
3867
3867
|
if (options.ssr && !options.inertia)
|
|
3868
3868
|
throw new CliError('USAGE', 'Server rendering (--ssr) needs --inertia');
|
|
3869
|
-
// D-
|
|
3870
|
-
//
|
|
3871
|
-
if (options.ssr && options.seal)
|
|
3872
|
-
throw new CliError('USAGE', 'Server rendering (--ssr) cannot be sealed (--seal): SSR writes the page props into the first HTML as plain text, so the start fails with SEAL_SSR_CONFLICT. Choose one with the user.');
|
|
3869
|
+
// D-0195: --ssr with --seal is an app whose public pages (render(…, { public: true })) are
|
|
3870
|
+
// server rendered, plain; its other pages stay sealed (template-inertia 0.4.6).
|
|
3873
3871
|
if (options.inertia)
|
|
3874
3872
|
await this.#inertiaBuild(tx, session, host, warnings, options.ssr === true);
|
|
3875
3873
|
// Domains are not secrets: the shared sample keeps them so `setup` scripts see them too.
|
package/dist/recipe-facts.d.ts
CHANGED
|
@@ -47,10 +47,10 @@ export declare const SEAL_HTTP_MODULE = "/dokebi/seal/http.mjs";
|
|
|
47
47
|
*/
|
|
48
48
|
export declare function sealNotice(domains: readonly string[], view?: 'ejs' | 'inertia'): string;
|
|
49
49
|
/**
|
|
50
|
-
* Why the browser hosts of a server-rendered Inertia plan stay unsealed
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* for Seal, so the user decides
|
|
50
|
+
* Why the browser hosts of a server-rendered Inertia plan stay unsealed, and what sealing them
|
|
51
|
+
* means (D-0195): on a seal host only public pages (`render(…, { public: true })`) are server
|
|
52
|
+
* rendered, plain and without the visitor's props; every other page stays sealed. The recipe
|
|
53
|
+
* leaves them unsealed; the convention still asks for Seal, so the user decides.
|
|
54
54
|
*/
|
|
55
55
|
export declare function ssrSealNotice(domains: readonly string[]): string;
|
|
56
56
|
/**
|
package/dist/recipe-facts.js
CHANGED
|
@@ -100,12 +100,16 @@ export function sealNotice(domains, view = 'ejs') {
|
|
|
100
100
|
: `${head}the shared EJS layout writes ${SEAL_HEAD} in its <head>, which loads @dokebi/seal/forms; it sends every <form method="post"> sealed with no per-form code (the handler reads the same request.body; dokebi-web.formBody is on). Pages stay plain HTML; REST calls use sealedFetch.`;
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
|
-
* Why the browser hosts of a server-rendered Inertia plan stay unsealed
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* for Seal, so the user decides
|
|
103
|
+
* Why the browser hosts of a server-rendered Inertia plan stay unsealed, and what sealing them
|
|
104
|
+
* means (D-0195): on a seal host only public pages (`render(…, { public: true })`) are server
|
|
105
|
+
* rendered, plain and without the visitor's props; every other page stays sealed. The recipe
|
|
106
|
+
* leaves them unsealed; the convention still asks for Seal, so the user decides.
|
|
107
107
|
*/
|
|
108
108
|
export function ssrSealNotice(domains) {
|
|
109
|
+
return `Seal is off for ${domains.join(', ')}: the recipe leaves the hosts of a server-rendered plan (view inertia-vue-ssr) unsealed. Browser apps are sealed by convention: ask the user whether these hosts send data (forms, sealedFetch, Inertia visits). If they do, seal them (npx dokebi add @dokebi/seal, then seal: true on these domains in dokebi.yaml) and rebuild: on a seal host only the pages a route renders with { public: true } are server rendered, plain and without the visitor's props, and every other page stays sealed (D-0195). ${READ_ONLY_HOSTS}`;
|
|
110
|
+
}
|
|
111
|
+
/** The SSR notice as records before D-0195 hold it (recognised by `recordedFact`). */
|
|
112
|
+
function previousSsrSealNotice(domains) {
|
|
109
113
|
return `${legacySsrSealNotice(domains)} ${READ_ONLY_HOSTS}`;
|
|
110
114
|
}
|
|
111
115
|
/**
|
|
@@ -503,7 +507,7 @@ const RECORDED = new Map([
|
|
|
503
507
|
[SESSION_NOTICE, { id: 'session' }],
|
|
504
508
|
]);
|
|
505
509
|
const RECORDED_SEAL = /^Seal is on for (\S+(?:, \S+)*) \(@dokebi\/seal, /;
|
|
506
|
-
const RECORDED_SSR_SEAL = /^Seal is off for (\S+(?:, \S+)*): server rendering /;
|
|
510
|
+
const RECORDED_SSR_SEAL = /^Seal is off for (\S+(?:, \S+)*): (?:server rendering |the recipe leaves )/;
|
|
507
511
|
/** The fact of a notice a record before D-0137 holds as a sentence; undefined for any other. */
|
|
508
512
|
export function recordedFact(notice) {
|
|
509
513
|
const known = RECORDED.get(notice);
|
|
@@ -519,7 +523,9 @@ export function recordedFact(notice) {
|
|
|
519
523
|
const unsealed = RECORDED_SSR_SEAL.exec(notice);
|
|
520
524
|
if (unsealed?.[1]) {
|
|
521
525
|
const domains = unsealed[1].split(', ');
|
|
522
|
-
if (ssrSealNotice(domains) === notice ||
|
|
526
|
+
if (ssrSealNotice(domains) === notice ||
|
|
527
|
+
previousSsrSealNotice(domains) === notice ||
|
|
528
|
+
legacySsrSealNotice(domains) === notice)
|
|
523
529
|
return { id: 'ssr-seal', domains };
|
|
524
530
|
}
|
|
525
531
|
return undefined;
|
package/dist/recipe-site.d.ts
CHANGED
|
@@ -34,8 +34,8 @@ export declare const SITE_LOGIN_HINT = "Connect the realm extension to your user
|
|
|
34
34
|
export declare const siteRoutesPath: (app: string) => string;
|
|
35
35
|
/**
|
|
36
36
|
* A browser app of the site (not api): its host is sealed (D-0092 §1, D-0062), EJS and Inertia
|
|
37
|
-
* alike.
|
|
38
|
-
* recipe notice says so.
|
|
37
|
+
* alike. SSR apps stay plain (on a seal host only public pages are server rendered, D-0195,
|
|
38
|
+
* and the scaffold's pages are not public), and the recipe notice says so.
|
|
39
39
|
*/
|
|
40
40
|
export declare function sealedSiteApp(spec: ReturnType<typeof siteDefinition>, app: string): boolean;
|
|
41
41
|
/** Site reuses transactional install/app/config/file commands and the common recipe executor. */
|
package/dist/recipe-site.js
CHANGED
|
@@ -141,8 +141,8 @@ function siteGuide(spec, workerPath) {
|
|
|
141
141
|
}
|
|
142
142
|
/**
|
|
143
143
|
* A browser app of the site (not api): its host is sealed (D-0092 §1, D-0062), EJS and Inertia
|
|
144
|
-
* alike.
|
|
145
|
-
* recipe notice says so.
|
|
144
|
+
* alike. SSR apps stay plain (on a seal host only public pages are server rendered, D-0195,
|
|
145
|
+
* and the scaffold's pages are not public), and the recipe notice says so.
|
|
146
146
|
*/
|
|
147
147
|
export function sealedSiteApp(spec, app) {
|
|
148
148
|
return app !== 'api' && !spec.ssr;
|
|
@@ -200,7 +200,7 @@ export function siteSteps(catalog, _recipe, answers, context) {
|
|
|
200
200
|
// Browser apps are sealed (the consumer convention, D-0092 §1, D-0062): their hosts get
|
|
201
201
|
// seal: true. EJS forms go through @dokebi/seal/forms (the shared layout writes the seal head);
|
|
202
202
|
// Inertia pages and visits through the sealInertia bootstrap of views/app.js. The api app
|
|
203
|
-
// answers API clients, and SSR apps
|
|
203
|
+
// answers API clients, and SSR apps stay plain (D-0195: the user decides): both stay plain.
|
|
204
204
|
const sealed = (app) => sealedSiteApp(spec, app);
|
|
205
205
|
if (spec.apps.length) {
|
|
206
206
|
add('web.apps', 'apps-plugin', false);
|
package/dist/recipe.js
CHANGED
|
@@ -463,8 +463,8 @@ function steps(catalog, recipe, answers, context) {
|
|
|
463
463
|
// forms is a browser app, so @dokebi/seal is installed and its hosts get seal: true. EJS: the
|
|
464
464
|
// shared layout (template-ejs) writes the seal head and @dokebi/seal/forms seals its forms.
|
|
465
465
|
// Inertia: the generated views/app.js awaits sealInertia before createInertiaApp, which opens
|
|
466
|
-
// the sealed first page and seals every visit.
|
|
467
|
-
//
|
|
466
|
+
// the sealed first page and seals every visit. An SSR plan stays plain (on a seal host only
|
|
467
|
+
// public pages are server rendered, D-0195; the scaffold's pages are not public), and its notice
|
|
468
468
|
// tells the user. The api recipe answers API clients (Bearer, server to server) and stays plain.
|
|
469
469
|
const sealed = recipe.web.forms === true && !ssr;
|
|
470
470
|
const sealEjs = sealed && !inertia;
|