@dokebi/cli 0.4.57 → 0.4.58

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/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.57",
4
+ "cli": "0.4.58",
5
5
  "core": {
6
6
  "package": "@dokebi/core",
7
7
  "version": "0.4.7"
@@ -825,7 +825,7 @@
825
825
  {
826
826
  "id": null,
827
827
  "package": "@dokebi/cli",
828
- "version": "0.4.57",
828
+ "version": "0.4.58",
829
829
  "kind": "cli",
830
830
  "summary": "Commands to create a project, browse the plugin catalog, run recipes, install plugins and verify (dokebi)",
831
831
  "description": "Project scaffolding, plugin catalog, recipes, install and verification CLI for Dokebi.",
@@ -1824,7 +1824,7 @@
1824
1824
  {
1825
1825
  "id": "dokebi-logger",
1826
1826
  "package": "@dokebi/logger",
1827
- "version": "0.1.2",
1827
+ "version": "0.1.3",
1828
1828
  "kind": "plugin",
1829
1829
  "summary": "The app logger on pino: JSON to stdout, rotating files, pretty development output and network targets (NDJSON batches to Dokebi Studio, OTLP/HTTP JSON) at once, written in worker threads with bounded buffers, secrets redacted, levels per plugin, flushed on shutdown",
1830
1830
  "description": "Production logging for Dokebi apps on pino: stdout, rotating files, pretty output and HTTP/OTLP log shipping at once, written off the event loop, with redaction, per-plugin levels and flush on shutdown.",
@@ -59,7 +59,7 @@ export const INTEGRATION_RULES = [
59
59
  '- Security headers and overload protection are built into @dokebi/web and on by default (D-0149, D-0150): every answer gets X-Content-Type-Options: nosniff, HTTPS answers Strict-Transport-Security, HTML pages a Content-Security-Policy (default-src self, frame-ancestors self, inline scripts and styles allowed), X-Frame-Options and Referrer-Policy; while the event loop stalls (dokebi-web overload.maxEventLoopDelayMs, 200 ms) requests get 503 OVERLOADED with Retry-After and health routes are served. Do not add @fastify/helmet, @fastify/under-pressure or headers of your own for this. To load from a CDN or embed a page, change dokebi-web securityHeaders.contentSecurityPolicy.directives in dokebi.yaml (npx dokebi config set) or set config: { securityHeaders: { … } } on that route; give a metrics scrape route config: { overload: false } with // dokebi-check: allow overload-off <reason> on that line (npx dokebi check reports overload-off as an error, and verify fails, without it), and never an API route. The same routes also answer while a required dependency (a database, Redis) is down or the app drains with config: { readiness: false } and // dokebi-check: allow readiness-off <reason> on the line before it; without it they are refused with 503 NOT_READY like every other route. Never turn securityHeaders off to make a page work: read which directive the browser console names and change that one.',
60
60
  '- CORS (D-0148): only when the user asks that pages on other origins call this server, install @dokebi/cors (npx dokebi add @dokebi/cors) and list the origins in dokebi-cors origins (or apps.<app>.origins per app); never * with credentials, and never register @fastify/cors yourself. Same-origin pages, server to server calls and mobile apps need no CORS. A cross-origin POST with cookies still passes dokebi-csrf: add the origin to dokebi-csrf trustedOrigins and send the token, or use Bearer tokens; SSE streams list their own origins.',
61
61
  '- Behind a tunnel or reverse proxy (Cloudflare Tunnel, ngrok, nginx): set dokebi-web.trustProxy to the proxy address as the app sees it, [127.0.0.1, ::1] for a tunnel on this machine (the tunnel may keep its HTTP Host Header localhost), and list the public host in dokebi-app.domains (in development also dokebi-template-inertia.devHosts). Without trustProxy requestHost() is localhost: the public host is not matched, sealed Inertia pages do not decrypt in the browser, and the log warns WEB_FORWARDED_HOST_IGNORED. Check that web.requestHost(request) equals the address bar host. Development HMR works through the tunnel with nothing to set. To keep a route plain on a seal host put seal: false on the route itself (route({ method, url, seal: false })), never in its config (that fails the start with INVALID_ROUTE_CONFIG).',
62
- '- App logging (D-0151): log through the logger of the plugin context (context.logger in a setup or hook) or of the app (app.logger in src/main.ts), never console.log or process.stdout.write in server code (npx dokebi check warns console-output). A new project has @dokebi/logger: src/main.ts passes createLogger(document.options) from src/dokebi.generated.ts to the Application, and options.logging in dokebi.yaml sets the level, the level per plugin (plugins: { dokebi-web: warn }), the targets (stdout JSON lines, pretty lines for dokebi dev, a rotated file) and redact (keys and dot paths besides the built-in secret names such as password, token, authorization and cookie). Write a fixed English message and a code in each record and pass the error itself (error: err keeps the name, the whole message, the stack and the causes); never log request bodies, tokens or passwords on purpose. DOKEBI_LOG_LEVEL still overrides the app level. Turn the file target on in production on a server that keeps its own log files; containers keep stdout, and under dokebi start the log writer already rotates .dokebi/run/app.log, so the file target is skipped there. To ship records to a log receiver add a network target (D-0152): type http (NDJSON batches, for Dokebi Studio url https://log.dokebi.app/v1/logs with the token of the app server as a secret token in dokebi.yaml written by npx dokebi config secret logging.targets.<name>.token --stdin, never on a command line) or type otlp (an OpenTelemetry collector); it sends from its own worker thread, adds hostname and pid, honours Retry-After and never blocks the app. Without the plugin (npx dokebi remove @dokebi/logger) the app writes with the console logger of core. Read `node_modules/@dokebi/logger/AI.md`.',
62
+ '- App logging (D-0151): log through the logger of the plugin context (context.logger in a setup or hook) or of the app (app.logger in src/main.ts), never console.log or process.stdout.write in server code (npx dokebi check warns console-output). A new project has @dokebi/logger: src/main.ts passes createLogger(document.options) from src/dokebi.generated.ts to the Application, and options.logging in dokebi.yaml sets the level, the level per plugin (plugins: { dokebi-web: warn }), the targets (stdout JSON lines, pretty lines for dokebi dev, a rotated file) and redact (keys and dot paths besides the built-in secret names such as password, token, authorization and cookie). Write a fixed English message and a code in each record and pass the error itself (error: err keeps the name, the whole message, the stack and the causes); never log request bodies, tokens or passwords on purpose. DOKEBI_LOG_LEVEL still overrides the app level. To hand records to your own code (warn and error records into an outbox item that a job sends to a central receiver in its own envelope), add a target of type sink to options.logging.targets and register its handler with sink(name, handler) of the logger plugin in the setup of the module that owns the work (the records arrive redacted, limited and level-filtered, in batches from a timer, never on the path that logs); never wrap the app logger to copy records. Turn the file target on in production on a server that keeps its own log files; containers keep stdout, and under dokebi start the log writer already rotates .dokebi/run/app.log, so the file target is skipped there. To ship records to a log receiver add a network target (D-0152): type http (NDJSON batches, for Dokebi Studio url https://log.dokebi.app/v1/logs with the token of the app server as a secret token in dokebi.yaml written by npx dokebi config secret logging.targets.<name>.token --stdin, never on a command line) or type otlp (an OpenTelemetry collector); it sends from its own worker thread, adds hostname and pid, honours Retry-After and never blocks the app. Without the plugin (npx dokebi remove @dokebi/logger) the app writes with the console logger of core. Read `node_modules/@dokebi/logger/AI.md`.',
63
63
  '- @dokebi/metrics: optional HTTP metrics; read its AI.md for collector options and endpoint exposure. Do not replace application logs or expose operational data publicly by default.',
64
64
  '- @dokebi/mail and @dokebi/auth: use queued mail and the documented reset/signup tokens, keep private links in sealed payloads, and retain mail templates even in an Inertia app.',
65
65
  '- @dokebi/cluster, @dokebi/job and @dokebi/worker solve different tasks: app processes, durable jobs and CPU threads. For multiple app workers, read `node_modules/@dokebi/cluster/AI.md`, keep the runner in src/main.ts and worker factory in src/infra/runtime/application.ts, and resolve one absolute DOKEBI_CONFIG before forking. Share session/auth/rate-limit state through configured providers. A one-use value in the session (a pending consent, a form nonce, a confirmation ticket) goes through await request.session.setOnce(key, value, { ttlMs }) and await request.session.takeOnce(key), never get then delete: of two workers or a form posted twice exactly one takes it. With @dokebi/seal, share the replay nonces of sealed requests too: set dokebi-seal nonces: { driver: redis, connection: <a dokebi-redis connection> } (no WebSocket hub needed; a hub in mode: cluster also works); per-process nonces in a cluster worker refuse to start (SEAL_NONCES_NOT_SHARED). Several workers and production need Redis for the state the processes share (D-0161): dokebi-session store, dokebi-auth tokens and throttle.store, dokebi-oauth store, dokebi-rate-limit driver, dokebi-seal nonces and dokebi-websocket-hub mode: cluster, each as { driver: redis, connection: <a dokebi-redis connection> } (auth tokens and oauth may use sql). A memory store refuses to start in a cluster worker and in a deployment with NODE_ENV=production (an app the CLI runs here, dokebi start, verify or dev, sets DOKEBI_LOCAL_RUN=1 and keeps memory); npx dokebi check reports it as shared-state-memory when application-runtime.workers is above 1. One process in development keeps memory. Development uses one worker unless DOKEBI_DEV_WORKERS is set.',
package/dist/output.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export declare const CLI_VERSION = "0.4.57";
1
+ export declare const CLI_VERSION = "0.4.58";
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
@@ -1,5 +1,5 @@
1
1
  import { CliError } from './errors.js';
2
- export const CLI_VERSION = '0.4.57';
2
+ export const CLI_VERSION = '0.4.58';
3
3
  export function envelope(command, result, ok = true) {
4
4
  return { schemaVersion: 1, cliVersion: CLI_VERSION, command, ok, result, error: null };
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dokebi/cli",
3
- "version": "0.4.57",
3
+ "version": "0.4.58",
4
4
  "description": "Project scaffolding, plugin catalog, recipes, install and verification CLI for Dokebi.",
5
5
  "keywords": [
6
6
  "dokebi",