@dokebi/cli 0.4.30 → 0.4.32
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 +2 -2
- package/catalog.json +99 -5
- package/dist/commands.js +2 -2
- package/dist/output.d.ts +1 -1
- package/dist/output.js +1 -1
- package/dist/project.js +41 -18
- package/package.json +1 -1
package/AI.md
CHANGED
|
@@ -68,11 +68,11 @@ The `blog` plan, depending on the answers: `init` (when the folder is not a proj
|
|
|
68
68
|
| `dokebi plugins list [--compatible] [--online]` | Every Dokebi package (`id`, `package`, `kind`, `version`, `summary`, `maturity`, `provides`, `install`, `core`, `compatible`, `installed`). The catalog is the snapshot inside this CLI (`catalog.json`); `--online` adds the latest and compatible versions from the registry (when it cannot reach it: warning `CATALOG_OFFLINE` and the snapshot) |
|
|
69
69
|
| `dokebi plugins search <word\|capability>` | `{ query, status: found\|absent\|unknown, matches[], recipes[], absent[{capability, summary, instead, message}] }`. When no package matches it returns the matching absent entries, so "not found" differs from "does not exist" |
|
|
70
70
|
| `dokebi plugins info <id\|package>` · `plugins doc <id\|package>` | One package: capabilities, variants, what it does not do, dependencies, option keys, installed version and compatibility / the AI.md of the **installed version** (`path`, `content`, `version`). Unknown: `UNKNOWN_PLUGIN` (details hold the search result and absent entries; a guessed short name of an installed package, such as `dokebi-core`, gets `details.package`, `path` and `fix`: `npx dokebi plugins doc @dokebi/core --json (or read node_modules/@dokebi/core/AI.md)`); not installed: `NOT_INSTALLED` (hint: `add --dry-run`); no AI.md: `DOC_MISSING` |
|
|
71
|
-
| `dokebi add <package\|tgz> [--set <path>=<value>]... [--adapter <
|
|
71
|
+
| `dokebi add <package\|tgz> [--set <path>=<value>]... [--adapter <id>] [--startup <required\|optional>] [--no-first-app] [--dry-run]` | Install and register a plugin. Required plugins named in the manifest (with `package`) are installed with it (`autoInstalled`). **Without a version** it picks the highest version that fits the project core (`resolved{package, version, source: registry\|snapshot, core, registry, deprecated?}`). It also has to fit the installed packages: the peers it names accept the versions the project has (`@dokebi/session` 0.4.4 needs `@dokebi/web` ^0.4.3), and the installed plugins' manifest ranges accept it. A newer version they hold back is the warning `NEWER_VERSION_HELD_BACK` (`path: <package>@<version>`, `hint`: what it needs and the commands, `npx dokebi upgrade <id>` first); when no version fits it is `INCOMPATIBLE_VERSION` (phase `plan`, `details.conflicts`, `details.fix`). The required plugins it brings (`autoInstalled`) get their versions the same way, inside the range its manifest names, in the same npm run (npm alone took the newest of the range, which could need a newer core). A named version whose peers do not fit stops in npm with `ERESOLVE`; that `NPM_FAILED` then has `details.conflicts` and `details.fix` (upgrade the installed package first) instead of the generic `hint`. The registry is the one npm really uses for that package (a scope setting such as `@dokebi:registry` first; environment, project, user and global `.npmrc`; see "Version selection" below). Pre-releases (`-rc.1` and the like) and `0.0.0-…` placeholders are never picked (name one with `add <package>@<version>`); a deprecated version only when there is no other, with the warning `DEPRECATED_VERSION`. Not in the registry: `NOT_PUBLISHED`; no version fits: `NO_COMPATIBLE_VERSION`; outside `@dokebi/`: warning `THIRD_PARTY_PACKAGE`. `--adapter` (@dokebi/db): the adapter file `src/infra/db/adapters/<id>.ts`, an entry file with the connection `main`, `connections.main` (the URL is a placeholder) and the driver (pg also gets `@types/pg`); it works on an installed db too (an edited entry file is kept: `CONNECTIONS_KEPT`). `--adapter <anthropic\|openai\|gemini>` (@dokebi/ai, D-0186): installs that provider's official SDK only (also on an installed @dokebi/ai); a plugin without adapters refuses the flag (`USAGE`), an unknown id is `UNKNOWN_ADAPTER` (`details.adapters`). `--startup <required|optional>` (with `--adapter` only, D-0127) writes `connections.main.startup`; left out, nothing is written and the default `required` applies. `--no-first-app` (@dokebi/app): no first app `main`. The version already installed is no change (`changed: []`); with `--set` it is `INVALID_SET` (`details.paths`, `details.fix`: `npx dokebi config set …`), since add writes no options then. When an installed plugin's install module names a secret option (`configSecrets`, for example @dokebi/session's `secrets`) that has no value yet, add writes a generated secret (32 random bytes, base64url, as `config secret`) into dokebi.yaml and reports `generatedSecrets[{plugin, option, file}]` (`option: '<id>.<path>'`, `file: 'dokebi.yaml'`): the name, never the value. `--dry-run` reports the same list. A plugin published before that still names an environment variable (`envSecrets`, deprecated, removed in 0.5) gets it appended to `.env` as before, with the warning `DEPRECATED_PLAN_FIELD` (`deprecated: 'envSecrets'`) |
|
|
72
72
|
| `dokebi config show [<id>[.<path>]]` | Prints the options of dokebi.yaml with every secret hidden (AI-M05): Every config command (`show`, `diff`, `set`, `unset`, `secret`) works on the settings file the app reads (M50): the file `DOKEBI_CONFIG` names when it is set and not empty (a relative path is from the project folder, as `dokebi dev`, the generated `src/main.ts` and dokebi-migrate take it), else dokebi.yaml; the result names it in `file` (and in `changed`, `paths`, `removed[].files`). A named file outside the project is read by `show` and `diff` but never written (`UNSAFE_PATH`, as with a linked dokebi.yaml); a named file that is not there is `READ_FAILED`, never dokebi.yaml instead. The sample stays the project's one dokebi.example.yaml. `{ file, path, value, defaults[], secrets[], warnings? }`. `value` is every section (installed plugins without a section too), one section or one value; options the file does not set are filled from the schema `default` and listed in `defaults` (the human YAML marks them `# default`). Hidden as `<secret: set>`: values the plugin schema marks secret (`writeOnly`, as `dokebi check` secret-in-config reads it, also through `patternProperties`, `prefixItems` or a `then`/`else` branch that may apply; a list of them is one entry of `secrets`), values under a name core's log rule masks (`redaction.isSecretField` of `@dokebi/core/libraries`, the one rule: `password`, `secret`, `token`, `apiKey`, `authorization`, `cookie`, `credentials`, `sessionId`, `jwt`, `pin`, … — text, or the text of a list or of an object whose schema does not declare its fields; a number only under a password, PIN or code name; never a boolean; `key`, `cacheKey`, `maxKeys` are not secret names), unless the schema marks the option plain (`x-dokebi-secret: false`, core option `plain`, as `secretsEnv` and `routeIds.*` are), and the recipe's first admin password (`first-admin.initialPassword`, or the older `blog-admin.initialPassword`); credentials inside text, found by core's `redaction.maskCredentials`, show as `<secret>`: `scheme://user:<secret>@host` (also a password with a raw `/` or `@`), `scheme://<secret>@host` for a user or token without a password, `Password=<secret>` of a connection string. A default under a name that would be hidden is not filled in; a default is not filled in beside a set old name of the option either (D-0071 alias: `bodyLimit` holds `maxBodyBytes`). The plugin id of the logger (`dokebi-logger`, whose section is `logging`) is `PATH_MISMATCH` with the `config show logging.<path>` to use. When a plugin's schema cannot be read, all its text is hidden (warning `OPTIONS_SCHEMA_UNREADABLE`). No value is ever printed, in the human output, `--json`, errors or debug logs. A list item is named by its index, its `name` or the `type` of an item without a name, as `config set` names it (`config show logging.targets.pretty`); a path that is not set and has no default is `UNKNOWN_OPTION` (`details.keys`; in a list `details.items`, how each item is named). Read only, no lock. **Use it instead of cat, sed, grep or head on dokebi.yaml** |
|
|
73
73
|
| `dokebi config diff [<id>] [--write [--values] [--prune] [--dry-run]]` | Compares dokebi.yaml with dokebi.example.yaml by option path (AI-M45: an agent dumped both files to compare them and printed secrets): `{ file, example, section, inSync, onlyInConfig[], onlyInExample[], different[], secrets[], exampleSecrets[], warnings? }`. A subtree one file lacks is one path, a list one value; `different` names paths both set to other non-secret values (a sample value may differ). Secrets of dokebi.yaml (as `config show` hides them) are never compared and never count as missing from the sample; a secret path that holds a value in the sample is in `exampleSecrets` (remove it; a sample value is judged by the sample's own rule: in a section nothing declares, such as one `dokebi remove` kept, by name and credentials only; a URL without a password, a `<password>` in place of one and the scaffold's `<set … here>` text, also as list items, are placeholders, not leaks). Secret names follow core's rule as in `config show` (text under them is a secret, a count such as `transientLogMaxKeys: 256` or a boolean is compared; a plain option is compared). `inSync` is true when no path is only in one file and the sample holds no secret. `warnings` are `config show`'s for either file: with `OPTIONS_SCHEMA_UNREADABLE` that plugin's text counts as secret in both files, so its sample values are in `exampleSecrets` until its schema can be read again (`npm install`), not values to remove. Values never appear in the result, errors or logs. No sample: `EXAMPLE_MISSING` `--write` (AI-M46: a builder copied set values into the sample with a script of its own) copies the paths only in dokebi.yaml into dokebi.example.yaml in one transaction, comments kept: secrets inside them are left out (a list holding one is left out whole; a path holding nothing else counts as a secret, in `secrets`), paths both files set keep the sample's value — with `--values` (Studio v2) they get dokebi.yaml's value too, every path of `different` (never a secret: secrets are not compared; a list or mapping without its secrets, or left out when one item is secret), listed in `valuesWritten`. The result adds `written` (paths) and `diff` (the comparison after the copy); a copy that would leave a secret in the sample is refused (`SAMPLE_SECRET`, nothing written). `--prune` (with `--write`) also removes from the sample only what nothing reads — a section no installed plugin, settings declaration or core reads (an old `dokebi-logger`), keys a schema does not declare and refuses (an option a plugin dropped; an object without `additionalProperties: false` takes any key, so its keys stay) — and any secret with a value in it (`exampleSecrets`, including one inside a list item such as a log target's `token`); a declared option only the sample shows stays; dokebi.yaml is never changed; the result adds `pruned`. Never edit the sample by hand: `config set` writes dokebi.yaml only, then `config diff --write [--prune]` |
|
|
74
74
|
| `dokebi config init [--dry-run]` | **A fresh copy of the project** (a clone, a CI checkout: dokebi.yaml stays out of version control, D-0163): writes dokebi.yaml (0600) from dokebi.example.yaml with a new generated secret for each one `add` writes (the install plans' `configSecrets`, such as `dokebi-session.secrets`) and each required secret of a settings section (D-0155); a secret someone supplies (an SMTP password) is never made up. `{ file, generatedSecrets[{plugin, option, file}], placeholders[], nextSteps }`: names only, values never shown; `placeholders` are the sample's `<…>` values still to fill (the database URL: `npx dokebi dev-infra`, the first next step). An existing file is `CONFIG_EXISTS` (never replaced); no sample is `EXAMPLE_MISSING`. Without dokebi.yaml, `doctor` (one `NOT_A_PROJECT` error), `dev-infra up`, `verify` and the other config commands answer `NOT_A_PROJECT` with this command in `details.fix` |
|
|
75
|
-
| `dokebi config secret <id>.<path> [--stdin] [--rotate]` | Writes a random secret (32 bytes; a one-item list when the schema wants a list) into dokebi.yaml, or with `--stdin` a secret you were given (the token of a log receiver: `config secret logging.targets.studio.token --stdin < token.txt`, or typed without echo when stdin is a terminal; one line, at most 64 KiB, nothing or several lines is `INVALID_SET`; the result has `generated: false, stdin: true`). The value never appears in output or logs; an existing value stays (`SECRET_KEPT`, with a `hint` naming `--rotate`); an empty one (`token:`, `''`, `[]`) holds no secret and is filled, and so is the sample's placeholder (`<set the postgres URL here or run npx dokebi dev-infra>`, what `config init` lists in `placeholders`). An address (a key `url` or `uri`, or one ending in `Url` or `Uri`) is never generated: without `--stdin` it is `INVALID_SET` with `details.fix` (`config secret dokebi-db.connections.main.options.url --stdin < url.txt`). Example: `config secret dokebi-websocket-hub.secret`. `logging.<path>` is `options.logging` (the @dokebi/logger options); a list item is named by its `name` (else its `type`) or its index (`logging.targets.studio.token`, `logging.targets.3.token`); a name that is not there is `INVALID_SET` with `details.items`. A secret a plugin declares (such as `dokebi-session.secrets`) is already written by `add`; run it after you removed one. `--rotate` replaces an existing value (AI-M05): a list (`dokebi-session.secrets`, `dokebi-csrf.secrets`, `dokebi-auth.secrets`: the first signs, all verify) gets the new secret **first** and keeps the previous ones after it, at most 2 (`kept`); older ones are dropped (`dropped`, warning `SECRETS_DROPPED` with `count`), and fewer are kept when the schema allows fewer items; when the schema takes no list with a kept one (only a new string or a one-item list), every previous secret is dropped and counted the same way. A string is replaced. The result is `secret{path, list, generated, rotated, kept, dropped}` and a next step to restart the app (`dev` restarts on its own); never a value. What a rotation changes: session cookies signed with a kept secret still verify and are re-signed with the new one as they are used (@dokebi/session); CSRF tokens of a kept secret still verify (@dokebi/csrf); auth stamps signed with a kept key still verify, and remember-me and API tokens are never re-signed, so keep the old key for their longest lifetime (@dokebi/auth AI.md §9). A dropped secret (or a replaced string) invalidates what it signed: sessions end, open forms fail once, logins end. An environment override of the option (`secretsEnv`), where it is set, still wins over dokebi.yaml |
|
|
75
|
+
| `dokebi config secret <id>.<path> [--stdin] [--rotate]` | Writes a random secret (32 bytes; a one-item list when the schema wants a list) into dokebi.yaml, or with `--stdin` a secret you were given (the token of a log receiver: `config secret logging.targets.studio.token --stdin < token.txt`, or typed without echo when stdin is a terminal; one line, at most 64 KiB, nothing or several lines is `INVALID_SET`; the result has `generated: false, stdin: true`). The value never appears in output or logs; an existing value stays (`SECRET_KEPT`, with a `hint` naming `--rotate`); an empty one (`token:`, `''`, `[]`) holds no secret and is filled, and so is the sample's placeholder (`<set the postgres URL here or run npx dokebi dev-infra>`, what `config init` lists in `placeholders`). An address (a key `url` or `uri`, or one ending in `Url` or `Uri`) is never generated: without `--stdin` it is `INVALID_SET` with `details.fix` (`config secret dokebi-db.connections.main.options.url --stdin < url.txt`). A key a provider issues (a key `apiKey` or `api_key`, or one ending in `ApiKey`, such as `dokebi-ai.connections.main.apiKey`) is never generated either: `INVALID_SET` with `details.fix` (`--stdin`). Example: `config secret dokebi-websocket-hub.secret`. `logging.<path>` is `options.logging` (the @dokebi/logger options); a list item is named by its `name` (else its `type`) or its index (`logging.targets.studio.token`, `logging.targets.3.token`); a name that is not there is `INVALID_SET` with `details.items`. A secret a plugin declares (such as `dokebi-session.secrets`) is already written by `add`; run it after you removed one. `--rotate` replaces an existing value (AI-M05): a list (`dokebi-session.secrets`, `dokebi-csrf.secrets`, `dokebi-auth.secrets`: the first signs, all verify) gets the new secret **first** and keeps the previous ones after it, at most 2 (`kept`); older ones are dropped (`dropped`, warning `SECRETS_DROPPED` with `count`), and fewer are kept when the schema allows fewer items; when the schema takes no list with a kept one (only a new string or a one-item list), every previous secret is dropped and counted the same way. A string is replaced. The result is `secret{path, list, generated, rotated, kept, dropped}` and a next step to restart the app (`dev` restarts on its own); never a value. What a rotation changes: session cookies signed with a kept secret still verify and are re-signed with the new one as they are used (@dokebi/session); CSRF tokens of a kept secret still verify (@dokebi/csrf); auth stamps signed with a kept key still verify, and remember-me and API tokens are never re-signed, so keep the old key for their longest lifetime (@dokebi/auth AI.md §9). A dropped secret (or a replaced string) invalidates what it signed: sessions end, open forms fail once, logins end. An environment override of the option (`secretsEnv`), where it is set, still wins over dokebi.yaml |
|
|
76
76
|
| `dokebi config set <id>.<path>=<value>...` | Non-secret options into dokebi.yaml (the value is JSON when it parses, otherwise text; checked against the plugin schema, only a missing required value becomes `configRequired`). A plugin id that is not installed is `UNKNOWN_PLUGIN`; any other section nothing declares is `UNDECLARED_SECTION` (D-0155: declare it with `npx dokebi settings add <name>`). `logging.<path>` sets `options.logging` (D-0151): with @dokebi/logger every key of its schema (`config set logging.level=debug logging.targets.file.enabled=true`; list items by `name`, else `type`, or index); without it only `logging.level` and `logging.plugins.<plugin>` (core's levels), anything else is `INVALID_SET` with the add command in `fix`. An old option name (D-0071 alias, `dokebi-web.bodyLimit` of `maxBodyBytes`) and its new name both set is `INVALID_PLUGIN_OPTIONS` (`details.errors[]` with `keyword: "conflict"` and the `field`; `fix`: `config unset` the old name), since the plugin refuses both at start; nothing is written. `add` and `upgrade` write no default beside a set old name for the same reason. The results of `config set`, `unset`, `secret` and `diff --write` carry `paths`: for each file it changed, the option paths it `removed`, `set` and `added` (`{ "dokebi.yaml": { removed: ["logging.redact"], set: [], added: [] } }`; a list is one path; never a value). A path outside the ones asked for (named list items count as their list) is `PATH_MISMATCH`: refused, or a warning in a `--dry-run`, which therefore shows exactly what a run would change. Spell paths as the files do (`npx dokebi config show`; the logger's are `logging.<path>`). |
|
|
77
77
|
| `dokebi config unset <id>[.<path>]...` | Removes options ([D-0153](https://git.nyx-zone.com/dokebi/framework/-/blob/main/docs/decisions/D-0153-config-unset.md)) from dokebi.yaml and from dokebi.example.yaml where the sample has them, in one transaction, with the mappings left empty (the plugin section stays): `{ removed: [{ option, files }], changed, warnings?, configRequired? }`. Values are never printed. A path that is not set is the warning `OPTION_NOT_SET` (a repeated call changes nothing); a secret may be removed (warning `SECRET_REMOVED`: what it signed no longer verifies; to replace one use `config secret --rotate`). The plugin need not be installed (a section `dokebi remove` kept). `logging.<path>` removes from `options.logging`, list items by `name` (else `type`) or index (`config unset logging.targets.studio` removes that target); an item that is not there is `OPTION_NOT_SET`. The removal may only leave missing required values (`configRequired`) or issues the options already had (warning `OPTIONS_STILL_INVALID` with the next `hint`); a new issue is `INVALID_PLUGIN_OPTIONS` and nothing is written. Use it for a key a plugin does not know: `INVALID_PLUGIN_OPTIONS` (from add, config set, doctor) names `npx dokebi config unset <id>.<key>` in its `fix`, and a key that moved to another plugin (`dokebi-web.files` → `dokebi-static.mounts`, D-0147) says where it went and the commands that carry it over A section a file still holds as written is that section, never the plugin the name belongs to: in a sample with the old `options.dokebi-logger` (now `options.logging`), `config unset dokebi-logger.level` removes that old key and warns `SECTION_NOT_READ`, and the live `logging.level` stays (AI-M47 report: it removed the live one before); with no such section the plugin id is `PATH_MISMATCH` (name it `logging.<path>`). List indexes and names are of each file as it is before the call, whichever name reaches the section; one item named twice (`logging.targets.studio` and its index) is removed once. A section alone (`config unset dokebi-logger`) removes a whole section nothing reads; a plugin's, the settings' or a core section (`logging`, `reload`) that way is `INVALID_SET` |
|
|
78
78
|
| `dokebi config secrets` | The secret option paths the app needs, **by name, never values** ([D-0184](https://git.nyx-zone.com/dokebi/framework/-/blob/main/docs/decisions/D-0184-production-deploy.md)): `{ file, secretsFile, listed, secrets[{path, source, listed, required, type}], missing }` from the settings the app reads (`DOKEBI_CONFIG`, else dokebi.yaml) merged with the secrets file `DOKEBI_SECRETS` names. `source` is `config`, `secrets` or `null` (not set: absent, empty or a `<placeholder>`); `listed` means the document's `secrets:` list names it (the app refuses to start without it), `required` that an installed plugin's install plan generates it (`dokebi-session.secrets`). A secret inside a list item is named by the item where the settings name it (`logging.targets.studio.token` for `logging.targets.1.token`: its `name`, else the `type` of an item without a name, when no other item shares it): the key a secrets file fills that field with, the list staying in the settings (@dokebi/config 0.4.4). `type` is the option's JSON Schema type (`string`; `array` for a list such as `dokebi-session.secrets`, `dokebi-auth.secrets`, `dokebi-csrf.secrets`, `dokebi-mail.secrets`; several as a list; `null` without a schema): a tool that writes the secrets file writes an `array` as a YAML list, even of one value (a text there is `INVALID_PLUGIN_OPTIONS`). Exit 1 with `ok: false` while `missing` is not empty. Warnings `SECRET_IN_CONFIG_FILE` (with `DOKEBI_SECRETS` set, the settings file still holds a secret) and `SECRETS_PLAN_UNREADABLE` (a plugin's install module could not run: npm install). A secrets file readable by others, the same option in both files, or a list item the settings do not have, fails as the app would (`CONFIG_SECRETS_UNSAFE`, `CONFIG_SECRETS_CONFLICT`, `CONFIG_SECRETS_UNMATCHED`) |
|
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.32",
|
|
5
5
|
"core": {
|
|
6
6
|
"package": "@dokebi/core",
|
|
7
7
|
"version": "0.4.6"
|
|
@@ -11,6 +11,22 @@
|
|
|
11
11
|
"summary": "generated admin screens (CRUD generator)",
|
|
12
12
|
"en": "admin dashboard crud backoffice"
|
|
13
13
|
},
|
|
14
|
+
"ai.anthropic": {
|
|
15
|
+
"summary": "Claude models through the official Anthropic SDK (@anthropic-ai/sdk)",
|
|
16
|
+
"en": "anthropic claude opus sonnet haiku"
|
|
17
|
+
},
|
|
18
|
+
"ai.gemini": {
|
|
19
|
+
"summary": "Google Gemini models through the official Google Gen AI SDK (@google/genai, Gemini Developer API)",
|
|
20
|
+
"en": "google gemini genai"
|
|
21
|
+
},
|
|
22
|
+
"ai.models": {
|
|
23
|
+
"summary": "one API for Claude (Anthropic), ChatGPT (OpenAI) and Gemini (Google) over their official SDKs: generate, stream, tool calls and a tool loop, structured output, image input, embeddings and token usage with named connections and coded errors",
|
|
24
|
+
"en": "ai llm large language model chatbot chat completion prompt generate stream tools function calling json schema embeddings vectors usage tokens"
|
|
25
|
+
},
|
|
26
|
+
"ai.openai": {
|
|
27
|
+
"summary": "OpenAI models through the official OpenAI SDK (openai, Responses API)",
|
|
28
|
+
"en": "openai chatgpt gpt responses"
|
|
29
|
+
},
|
|
14
30
|
"auth": {
|
|
15
31
|
"summary": "session login, route protection and permissions on your own user table (authentication and authorization)",
|
|
16
32
|
"en": "auth authentication authorization login logout user password session signin"
|
|
@@ -337,6 +353,84 @@
|
|
|
337
353
|
}
|
|
338
354
|
},
|
|
339
355
|
"packages": [
|
|
356
|
+
{
|
|
357
|
+
"id": "dokebi-ai",
|
|
358
|
+
"package": "@dokebi/ai",
|
|
359
|
+
"version": "0.1.0",
|
|
360
|
+
"kind": "plugin",
|
|
361
|
+
"summary": "One API for Claude, ChatGPT and Gemini over their official SDKs: generate, stream, tool calls and a tool loop, structured output, image input, embeddings and token usage, with named connections and coded errors",
|
|
362
|
+
"description": "One API for Claude (Anthropic), ChatGPT (OpenAI) and Gemini (Google) over their official SDKs: named connections in dokebi.yaml, text generation, streaming, tool calls and a tool loop, structured output, image input, embeddings, token usage, and coded errors.",
|
|
363
|
+
"keywords": [
|
|
364
|
+
"dokebi",
|
|
365
|
+
"dokebi-plugin",
|
|
366
|
+
"ai",
|
|
367
|
+
"llm",
|
|
368
|
+
"anthropic",
|
|
369
|
+
"claude",
|
|
370
|
+
"openai",
|
|
371
|
+
"chatgpt",
|
|
372
|
+
"gemini"
|
|
373
|
+
],
|
|
374
|
+
"maturity": "experimental",
|
|
375
|
+
"core": "^0.4.2",
|
|
376
|
+
"provides": [
|
|
377
|
+
"ai.anthropic",
|
|
378
|
+
"ai.gemini",
|
|
379
|
+
"ai.models",
|
|
380
|
+
"ai.openai"
|
|
381
|
+
],
|
|
382
|
+
"variants": [
|
|
383
|
+
{
|
|
384
|
+
"name": "anthropic",
|
|
385
|
+
"capability": "ai.anthropic",
|
|
386
|
+
"adapter": "anthropic",
|
|
387
|
+
"driver": {
|
|
388
|
+
"package": "@anthropic-ai/sdk",
|
|
389
|
+
"version": "1.5.0"
|
|
390
|
+
}
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
"name": "openai",
|
|
394
|
+
"capability": "ai.openai",
|
|
395
|
+
"adapter": "openai",
|
|
396
|
+
"driver": {
|
|
397
|
+
"package": "openai",
|
|
398
|
+
"version": "7.51.0"
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"name": "gemini",
|
|
403
|
+
"capability": "ai.gemini",
|
|
404
|
+
"adapter": "gemini",
|
|
405
|
+
"driver": {
|
|
406
|
+
"package": "@google/genai",
|
|
407
|
+
"version": "2.32.0"
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
],
|
|
411
|
+
"doesNot": [
|
|
412
|
+
"Installs no SDK by itself: npx dokebi add @dokebi/ai --adapter anthropic|openai|gemini installs the one you choose",
|
|
413
|
+
"No common temperature, top-p or stop sequences (not every provider has them): pass them in providerOptions",
|
|
414
|
+
"No embeddings on Anthropic connections (the Anthropic API has none): AI_NOT_SUPPORTED",
|
|
415
|
+
"No image URLs, audio, files, prompt caching or thinking settings in the common request: providerOptions or raw() reach them",
|
|
416
|
+
"No routes and no chat storage: the app keeps the conversation and decides who may call a model"
|
|
417
|
+
],
|
|
418
|
+
"recipes": [],
|
|
419
|
+
"requires": [],
|
|
420
|
+
"optional": [],
|
|
421
|
+
"optionKeys": [
|
|
422
|
+
"connections",
|
|
423
|
+
"default",
|
|
424
|
+
"maxEmbedInputs",
|
|
425
|
+
"maxImageBytes",
|
|
426
|
+
"maxSteps"
|
|
427
|
+
],
|
|
428
|
+
"docs": {
|
|
429
|
+
"ai": "AI.md",
|
|
430
|
+
"readme": "README.md"
|
|
431
|
+
},
|
|
432
|
+
"install": "npx dokebi add @dokebi/ai"
|
|
433
|
+
},
|
|
340
434
|
{
|
|
341
435
|
"id": "dokebi-app",
|
|
342
436
|
"package": "@dokebi/app",
|
|
@@ -473,7 +567,7 @@
|
|
|
473
567
|
{
|
|
474
568
|
"id": "dokebi-auth",
|
|
475
569
|
"package": "@dokebi/auth",
|
|
476
|
-
"version": "0.4.
|
|
570
|
+
"version": "0.4.2",
|
|
477
571
|
"kind": "plugin",
|
|
478
572
|
"summary": "Login on your own user table: sessions, remember-me, API tokens, route protection, authorize hook, password hashing, login throttling, realms; optional Google/Apple social login",
|
|
479
573
|
"description": "Login for @dokebi/web on your own user table through an extension class: sessions, remember-me, API tokens (personal, access/refresh), route protection, authorization hook, password hashing, login throttling, realms.",
|
|
@@ -713,7 +807,7 @@
|
|
|
713
807
|
{
|
|
714
808
|
"id": null,
|
|
715
809
|
"package": "@dokebi/cli",
|
|
716
|
-
"version": "0.4.
|
|
810
|
+
"version": "0.4.32",
|
|
717
811
|
"kind": "cli",
|
|
718
812
|
"summary": "Commands to create a project, browse the plugin catalog, run recipes, install plugins and verify (dokebi)",
|
|
719
813
|
"description": "Project scaffolding, plugin catalog, recipes, install and verification CLI for Dokebi.",
|
|
@@ -1772,7 +1866,7 @@
|
|
|
1772
1866
|
{
|
|
1773
1867
|
"id": "dokebi-mail",
|
|
1774
1868
|
"package": "@dokebi/mail",
|
|
1775
|
-
"version": "0.4.
|
|
1869
|
+
"version": "0.4.3",
|
|
1776
1870
|
"kind": "plugin",
|
|
1777
1871
|
"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",
|
|
1778
1872
|
"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.",
|
|
@@ -3322,7 +3416,7 @@
|
|
|
3322
3416
|
{
|
|
3323
3417
|
"id": "dokebi-two-factor",
|
|
3324
3418
|
"package": "@dokebi/two-factor",
|
|
3325
|
-
"version": "0.1.
|
|
3419
|
+
"version": "0.1.2",
|
|
3326
3420
|
"kind": "plugin",
|
|
3327
3421
|
"summary": "Two-factor sign-in for @dokebi/auth: TOTP codes of authenticator apps (secrets encrypted at rest, a code good once), ten recovery codes kept as HMACs, a second step after the password, remembered devices, lockout after wrong codes, and a code confirmation for the re-authentication page",
|
|
3328
3422
|
"description": "Two-factor sign-in for @dokebi/auth: TOTP codes of authenticator apps (secrets encrypted at rest), recovery codes stored as HMACs, a second step after the password, remembered devices, lockout, and a code confirmation for re-authentication.",
|
package/dist/commands.js
CHANGED
|
@@ -45,7 +45,7 @@ export const COMMANDS = [
|
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
name: 'add',
|
|
48
|
-
usage: 'dokebi add <package|local.tgz> [--set <path>=<value>]... [--adapter <
|
|
48
|
+
usage: 'dokebi add <package|local.tgz> [--set <path>=<value>]... [--adapter <id>] [--startup <required|optional>] [--no-first-app] [--dry-run] [--json]',
|
|
49
49
|
summary: 'Install and register a plugin (and the plugins it requires); no version picks the newest one for this core',
|
|
50
50
|
},
|
|
51
51
|
{
|
|
@@ -369,7 +369,7 @@ export const COMMAND_DETAILS = {
|
|
|
369
369
|
],
|
|
370
370
|
[
|
|
371
371
|
'--adapter <id>',
|
|
372
|
-
'@dokebi/db: pg | mysql2 | mariadb | mongodb (adapter file, connection main, driver, @types/pg)',
|
|
372
|
+
'@dokebi/db: pg | mysql2 | mariadb | mongodb (adapter file, connection main, driver, @types/pg); @dokebi/ai: anthropic | openai | gemini (the provider SDK)',
|
|
373
373
|
],
|
|
374
374
|
[
|
|
375
375
|
'--startup <required|optional>',
|
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.32";
|
|
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
|
@@ -50,6 +50,8 @@ const GENERATED = 'src/dokebi.generated.ts';
|
|
|
50
50
|
const EXAMPLE = 'dokebi.example.yaml';
|
|
51
51
|
/** An option key that holds an address (`url`, `uri`, `databaseUrl`, `endpointURI`). */
|
|
52
52
|
const URL_KEY = /^(url|uri)$|(Url|URL|Uri|URI)$/;
|
|
53
|
+
/** A key a provider issues (`apiKey` of @dokebi/ai, D-0186): never a random string. */
|
|
54
|
+
const ISSUED_KEY = /^(apiKey|api_key)$|ApiKey$/;
|
|
53
55
|
/** Previous secrets `config secret --rotate` keeps after the new one in a list (AI-M05). */
|
|
54
56
|
export const ROTATE_KEEP = 2;
|
|
55
57
|
/** The generated registration differs from what the CLI wrote (D-0116: a sentence and a fix). */
|
|
@@ -772,9 +774,10 @@ export class Project {
|
|
|
772
774
|
},
|
|
773
775
|
phase: 'plan',
|
|
774
776
|
});
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
if (options.startup !== undefined &&
|
|
777
|
+
// D-0186: --adapter picks a catalog variant of the plugin being added (the db adapter, the
|
|
778
|
+
// ai provider SDK); only @dokebi/db also writes an adapter file and a connection.
|
|
779
|
+
if (options.startup !== undefined &&
|
|
780
|
+
(options.adapter === undefined || added.id !== 'dokebi-db'))
|
|
778
781
|
throw new CliError('USAGE', '--startup applies to @dokebi/db with --adapter only');
|
|
779
782
|
const hostsApps = added.hosts?.includes('apps') === true;
|
|
780
783
|
if (options.firstApp === false && !hostsApps)
|
|
@@ -800,6 +803,13 @@ export class Project {
|
|
|
800
803
|
}
|
|
801
804
|
if (options.adapter === undefined)
|
|
802
805
|
return { changed: [], preserved: [] };
|
|
806
|
+
if (added.id !== 'dokebi-db') {
|
|
807
|
+
// Another plugin with adapters (@dokebi/ai): the variant's driver only.
|
|
808
|
+
const { variant } = await this.#adapterVariant(staging, options.adapter, added.packageName);
|
|
809
|
+
await this.#installDriver(session, staging, variant, dependencyMap(session.pkg));
|
|
810
|
+
await this.#replacePackages(session, staging, session.pkg);
|
|
811
|
+
return await this.#finish(session, { changed: tx.paths, preserved: [], ...(warnings.length ? { warnings } : {}) }, dryRun);
|
|
812
|
+
}
|
|
803
813
|
// An installed db gets its adapter now (adapter file, connection, driver).
|
|
804
814
|
const adapted = await this.#dbAdapter(session, staging, options.adapter, {
|
|
805
815
|
configSource: session.configSource,
|
|
@@ -837,7 +847,7 @@ export class Project {
|
|
|
837
847
|
// The adapter's driver joins the same staging install before the checks run.
|
|
838
848
|
const adapter = options.adapter === undefined
|
|
839
849
|
? undefined
|
|
840
|
-
: await this.#adapterVariant(staging, options.adapter);
|
|
850
|
+
: await this.#adapterVariant(staging, options.adapter, added.packageName);
|
|
841
851
|
if (adapter)
|
|
842
852
|
await this.#installDriver(session, staging, adapter.variant, dependencies);
|
|
843
853
|
const installed = await this.#installedDependencies(staging);
|
|
@@ -1077,33 +1087,38 @@ export class Project {
|
|
|
1077
1087
|
delete installed[name];
|
|
1078
1088
|
return { installed, ids, required };
|
|
1079
1089
|
}
|
|
1080
|
-
/**
|
|
1081
|
-
|
|
1090
|
+
/**
|
|
1091
|
+
* The variant of `--adapter` (from the staged package, else the CLI snapshot): a db adapter,
|
|
1092
|
+
* or the provider SDK of @dokebi/ai (D-0186). A plugin without adapters refuses the flag.
|
|
1093
|
+
*/
|
|
1094
|
+
async #adapterVariant(base, adapter, packageName = '@dokebi/db') {
|
|
1082
1095
|
let variants = [];
|
|
1083
1096
|
try {
|
|
1084
|
-
const pkg = parseObject(await readFile(await packageFile(base,
|
|
1097
|
+
const pkg = parseObject(await readFile(await packageFile(base, packageName, 'package.json'), 'utf8'), packageName);
|
|
1085
1098
|
variants = pkg.dokebiCatalog?.variants ?? [];
|
|
1086
1099
|
}
|
|
1087
1100
|
catch (error) {
|
|
1088
1101
|
if (!(error instanceof CliError) && !isMissing(error))
|
|
1089
1102
|
throw error;
|
|
1090
|
-
debug('Installed
|
|
1103
|
+
debug('Installed package has no readable catalog; using the CLI snapshot', {
|
|
1104
|
+
package: packageName,
|
|
1091
1105
|
error: describeError(error),
|
|
1092
1106
|
});
|
|
1093
1107
|
}
|
|
1094
1108
|
if (!variants.length)
|
|
1095
1109
|
variants =
|
|
1096
|
-
(await loadCatalog()).packages.find((item) => item.package ===
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
details: {
|
|
1102
|
-
adapter,
|
|
1103
|
-
adapters: variants.map((item) => item.adapter).filter(Boolean),
|
|
1104
|
-
},
|
|
1110
|
+
(await loadCatalog()).packages.find((item) => item.package === packageName)?.variants ?? [];
|
|
1111
|
+
const adapters = variants.map((item) => item.adapter).filter(Boolean);
|
|
1112
|
+
if (!adapters.length)
|
|
1113
|
+
throw new CliError('USAGE', `--adapter applies to a plugin with adapters, not ${packageName}`, {
|
|
1114
|
+
details: { package: packageName, plugins: ['@dokebi/db', '@dokebi/ai'] },
|
|
1105
1115
|
phase: 'arguments',
|
|
1106
1116
|
});
|
|
1117
|
+
const variant = variants.find((item) => item.adapter === adapter);
|
|
1118
|
+
if (!variant)
|
|
1119
|
+
throw new CliError('UNKNOWN_ADAPTER', packageName === '@dokebi/db'
|
|
1120
|
+
? `No database adapter "${adapter}"`
|
|
1121
|
+
: `No adapter "${adapter}" in ${packageName}`, { details: { adapter, package: packageName, adapters }, phase: 'arguments' });
|
|
1107
1122
|
return { name: adapter, variant };
|
|
1108
1123
|
}
|
|
1109
1124
|
/** Adds the variant's driver (and its types) to the staged project and installs them. */
|
|
@@ -1125,7 +1140,7 @@ export class Project {
|
|
|
1125
1140
|
}
|
|
1126
1141
|
if (!changed)
|
|
1127
1142
|
return;
|
|
1128
|
-
debug('Installing the
|
|
1143
|
+
debug('Installing the adapter driver', {
|
|
1129
1144
|
driver: variant.driver?.package ?? null,
|
|
1130
1145
|
types: variant.types?.package ?? null,
|
|
1131
1146
|
});
|
|
@@ -2764,6 +2779,14 @@ export class Project {
|
|
|
2764
2779
|
},
|
|
2765
2780
|
phase: 'arguments',
|
|
2766
2781
|
});
|
|
2782
|
+
if (value === undefined && ISSUED_KEY.test(path.at(-1) ?? ''))
|
|
2783
|
+
throw new CliError('INVALID_SET', `${where} is a key the provider issues, not a generated secret`, {
|
|
2784
|
+
details: {
|
|
2785
|
+
path: where,
|
|
2786
|
+
fix: `npx dokebi config secret ${where} --stdin (type it without echo, or < <file with the key>)`,
|
|
2787
|
+
},
|
|
2788
|
+
phase: 'arguments',
|
|
2789
|
+
});
|
|
2767
2790
|
const validator = new PluginOptionsValidator({ allErrors: true });
|
|
2768
2791
|
const rotated = current !== undefined && Array.isArray(current)
|
|
2769
2792
|
? await this.#rotatedList(session.root, validator, plugin, session.configSource, path, current, ...(value === undefined ? [] : [value]))
|