@theholocron/cli 5.0.0-alpha.513 → 5.0.0-alpha.514
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cli.mjs +3 -0
- package/dist/cli.mjs.map +1 -1
- package/dist/{index-D_e9vKTW.d.mts → index-ur4G1f2k.d.mts} +6 -0
- package/dist/index.d.mts +1 -1
- package/dist/plugin/capabilities.d.mts +1 -1
- package/dist/presets.d.mts +1 -1
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -691,7 +691,7 @@ commands and the config are provider-neutral; Discord is the first provider.
|
|
|
691
691
|
|
|
692
692
|
Channels fed by another service are declared with `feeds` on the channel: `{ name: "uptime", webhook: true, feeds: { monitoring: true } }` (the object form `{ name?, webhook?, avatar?, alerts? }` overrides the alert channel's name, default `Message to #<channel>`, the dedicated webhook's name, default the provider's, and gives that webhook a picture, a file path or `https://` URL, or `{ url, image }` (the URL is tried first, the file in the repo is the fallback), else the provider's own icon (`Monitoring.icon`, a URL and an embedded `data:` image; Checkly provides one), else the layout's `webhookAvatar`). A channel's own `webhook.avatar` and the layout's `webhookAvatar` take the same forms, a path or `https://` URL, or `{ url, image }` (the URL first, the file in the repo as the fallback); a relative path is read from the repository root. `setup` gives the channel a dedicated webhook and hands its URL straight to the `monitoring` provider through `Monitoring.ensureAlertChannel({ name, format: "discord", url? })`, which finds an alert channel of that name or creates one and subscribes every check; the URL is never stored as a secret. It needs a `monitoring` provider that implements `ensureAlertChannel` (Checkly does). `alerts: { failure?, recovery?, degraded?, sslExpiry?, sslExpiryThreshold? }` (`MonitoringAlertSettings`, passed as `ensureAlertChannel({ ..., alerts })`) sets what the alert channel alerts about: a new channel defaults to failure, recovery and degraded on and `sslExpiry` off, and on an existing channel a setting left out is left alone. A check in the `monitoring` provider's `checks` can route itself with `alertChannels: ["Message to #uptime"]` (`MonitoringCheckInput.alertChannels`, the alert channel names): it is then subscribed to those channels only, and a name no feed declares is refused by `setup`. `inspectAlertChannel` returns the channel's `alerts` and the `misrouted` checks that `doctor notifications` reports. Two feeds may not share an alert channel name, and a feed's webhook may not share the channel's own webhook name (compared without regard to case).
|
|
693
693
|
|
|
694
|
-
Channels fed by the error tracker add `feeds: { errors: true }` and a layout `relay: { host, zone?, script?, code? }`: `setup` makes a dedicated webhook, points `host` at the Comlink Worker (a proxied DNS record via `dns`), and deploys it via `workers.deployScript` with the webhook URL as `COMLINK_<SOURCE>_WEBHOOK`. The URL never leaves the Worker's secret; other secrets on the script are kept. A service other than the error tracker is declared in `relay.sources: { <id>: { capability, name?, events?, scope?, options? } }` and carried by a channel with `feeds.relay.<id>`: `setup` asks the provider of `capability` to make the vendor's webhook (optional `ensureRelaySource`, found again by its URL, never deleted), hands the Worker `COMLINK_<ID>_SECRET` (when the provider made or chose a secret) and `COMLINK_<ID>_WEBHOOK` in the same deploy, and `doctor notifications` adds a `relay-source:<id>` row (optional `inspectRelaySource`). With `relay.errors: { projects, integration?, rule?, frequency? }` it also ensures the tracker's integration and alert rule (`errors.ensureRelay`) and deploys the Worker with the integration's signing secret. Needs `errors`, `workers` and `dns`; only one channel may be fed.
|
|
694
|
+
Channels fed by the error tracker add `feeds: { errors: true }` and a layout `relay: { host, zone?, script?, code? }`: `setup` makes a dedicated webhook, points `host` at the Comlink Worker (a proxied DNS record via `dns`), and deploys it via `workers.deployScript` with the webhook URL as `COMLINK_<SOURCE>_WEBHOOK`. The URL never leaves the Worker's secret; other secrets on the script are kept. A service other than the error tracker is declared in `relay.sources: { <id>: { capability, provider?, name?, events?, scope?, options? } }` and carried by a channel with `feeds.relay.<id>`: `provider` names the plugin for a capability the root config gives to another one (`vercel` for `deployment`; the layout check validates its shape, and loading it is the next change, #2522, #2523); `setup` asks the provider of `capability` to make the vendor's webhook (optional `ensureRelaySource`, found again by its URL, never deleted), hands the Worker `COMLINK_<ID>_SECRET` (when the provider made or chose a secret) and `COMLINK_<ID>_WEBHOOK` in the same deploy, and `doctor notifications` adds a `relay-source:<id>` row (optional `inspectRelaySource`). With `relay.errors: { projects, integration?, rule?, frequency? }` it also ensures the tracker's integration and alert rule (`errors.ensureRelay`) and deploys the Worker with the integration's signing secret. Needs `errors`, `workers` and `dns`; only one channel may be fed.
|
|
695
695
|
|
|
696
696
|
`holocron sync secrets --env <environment> --worker <script>` also sets every key of the vault environment on a deployed Worker as a secret, through the optional `Workers.setSecret(script, name, value)` (write-only; the Cloudflare plugin implements it). The Worker must already exist. Sync only adds and updates: it never removes a binding, because a Worker also holds secrets that are not in the vault (for Comlink, the `COMLINK_<SOURCE>_WEBHOOK` that `setup notifications` sets), so a key deleted from the vault must be deleted from the Worker separately. Keys are written one at a time and each is reported; if one fails, the exit code is 1 and re-running finishes the rest, since every write is idempotent.
|
|
697
697
|
|
package/dist/cli.mjs
CHANGED
|
@@ -12548,6 +12548,8 @@ const RELAY_SOURCE_CAPABILITIES = [
|
|
|
12548
12548
|
];
|
|
12549
12549
|
/** An id is a URL path segment and part of a Worker binding name, so it is lower-case letters and digits. */
|
|
12550
12550
|
const ID$1 = /^[a-z][a-z0-9]*$/;
|
|
12551
|
+
/** A plugin's name, as `providers.<capability>` spells it: lower-case letters, digits and hyphens (`vercel`, `1password`). */
|
|
12552
|
+
const PROVIDER = /^[a-z0-9][a-z0-9-]*$/;
|
|
12551
12553
|
/**
|
|
12552
12554
|
* The first reason the layout's relay sources cannot work, or undefined. `errorsSource` is the error tracker's id when a
|
|
12553
12555
|
* channel is fed by it, since the tracker's binding names are taken. Pure: it reads the layout and nothing else.
|
|
@@ -12562,6 +12564,7 @@ function relaySourcesProblem(layout, errorsSource) {
|
|
|
12562
12564
|
if (!ID$1.test(id)) return `relay source \`${id}\`: the id must be lower-case letters and digits, starting with a letter (it is a path and part of a binding name)`;
|
|
12563
12565
|
if (errorsSource !== void 0 && id === errorsSource) return `relay source \`${id}\` is the error tracker's own source — it is set up by \`relay.errors\`, not \`relay.sources\``;
|
|
12564
12566
|
if (!RELAY_SOURCE_CAPABILITIES.includes(spec?.capability)) return `relay source \`${id}\`: \`capability\` must be one of ${RELAY_SOURCE_CAPABILITIES.join(", ")}`;
|
|
12567
|
+
if (spec.provider !== void 0 && !(typeof spec.provider === "string" && PROVIDER.test(spec.provider))) return `relay source \`${id}\`: \`provider\` must be a plugin name, lower-case letters, digits and hyphens (\`vercel\`)`;
|
|
12565
12568
|
for (const key of ["events", "scope"]) {
|
|
12566
12569
|
const list = spec[key];
|
|
12567
12570
|
if (list !== void 0 && !(Array.isArray(list) && list.every((item) => typeof item === "string"))) return `relay source \`${id}\`: \`${key}\` must be a list of strings`;
|