@theholocron/cli 5.0.0-alpha.593 → 5.0.0-alpha.594
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 +25 -2
- package/dist/cli.mjs +1391 -273
- package/dist/cli.mjs.map +1 -1
- package/dist/{config-system-kv3gASRw.mjs → config-system-CZ9zgh3-.mjs} +42 -0
- package/dist/{index-DlUw3HKw.d.mts → index-C5MapAsc.d.mts} +121 -3
- package/dist/index.d.mts +13 -3
- package/dist/index.mjs +120 -2
- package/dist/plugin/capabilities.d.mts +1 -1
- package/dist/presets.d.mts +1 -1
- package/dist/presets.mjs +1 -1
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -757,7 +757,7 @@ Channels fed by the error tracker add `feeds: { errors: true }` and a layout `re
|
|
|
757
757
|
|
|
758
758
|
`holocron list secrets [--scope repo|environment|organization] [--env <name>] [--json]` prints the names (never the values; GitHub does not return them) of the secrets at each scope, sorted, under a heading per scope. With no `--scope` it lists the repository, plus the organization (`--org`, `HOLOCRON_ORG` or the config's `org`) and the `--env` environment when they are known; `--scope` lists one. A scope that cannot be listed is reported under its heading and the rest are still listed; the exit code is 1 if any fails. `--json` prints `[{ scope, names, error? }]`. It is read-only, so `--dry-run` does not apply. Comparing the names with what the config expects is `doctor secrets`, which also covers the keys of the vault environments declared in `repo.secrets.sync`.
|
|
759
759
|
|
|
760
|
-
A channel with `kind: "forum"` is a forum, with `tags` (each a `name`, an `emoji` and whether it is `moderated`; the `emoji` is a Unicode character or a server emoji written `":git_merge:"`, which needs a picture declared elsewhere in the layout, in a reaction's `image` or an `emojis` entry, or `setup` refuses the layout, and which must exist on the server before the channel is written); `setup` adds and corrects the tags but never removes one, and a text channel of the same name must be deleted first, since neither kind can become the other. A forum takes no `webhook` and none of the webhook feeds (`monitoring`, `errors`); its one feed is `feeds: { prs: true }`, the pull-request feed, where Sentinel keeps one post per pull request tagged with its state. The object form `feeds: { prs: { exclude: { repos?: ["owner/name"], authors?: ["login"] } } }` leaves some pull requests out. `feeds.prs` belongs to a forum (a text channel with it is refused) and the forum's `tags` must hold all eight states, `draft`, `conflicts`, `failing`, `changes requested`, `ready`, `
|
|
760
|
+
A channel with `kind: "forum"` is a forum, with `tags` (each a `name`, an `emoji` and whether it is `moderated`; the `emoji` is a Unicode character or a server emoji written `":git_merge:"`, which needs a picture declared elsewhere in the layout, in a reaction's `image` or an `emojis` entry, or `setup` refuses the layout, and which must exist on the server before the channel is written); `setup` adds and corrects the tags but never removes one, and a text channel of the same name must be deleted first, since neither kind can become the other. A forum takes no `webhook` and none of the webhook feeds (`monitoring`, `errors`); its one feed is `feeds: { prs: true }`, the pull-request feed, where Sentinel keeps one post per pull request tagged with its state. The object form `feeds: { prs: { exclude: { repos?: ["owner/name"], authors?: ["login"] } } }` leaves some pull requests out. `feeds.prs` belongs to a forum (a text channel with it is refused) and the forum's `tags` must hold all eight states, `draft`, `conflicts`, `failing`, `changes requested`, `ready`, `in review`, `merged` and `closed`, or `setup` refuses the layout. `setup` does nothing more for it; `doctor notifications` checks that the forum exists, has those tags and that the bot can start posts and manage threads in it (`ServerInspection` `botThreads`, filled in by the Discord provider after the forum's own permission overwrites). `defaultReaction` is the emoji Discord offers on every post (its Get Started step "Set a default reaction for posts"); Discord allows only one, so `starterReactions` lists more (`["👍", "👎", "❓"]` for approve, disapprove, question) that the bot adds to the first message of each post `sync specs` makes. Existing posts are left alone, a reaction the bot cannot add is skipped, and `doctor notifications` checks `defaultReaction`. A reaction is a Unicode emoji (`"✅"`) or one of the server's own emoji written between colons (`":git_merge:"`, 2 to 32 letters, digits and underscores); the object form `{ emoji: ":git_merge:", image: ".holocron/media/emoji/git_merge.png" }` also names the file `setup` makes the emoji from when the server has none (PNG, JPEG, GIF, WebP or AVIF, at most 256 KiB, under `.holocron/media/`; checked by its bytes before anything is written; an emoji that exists is left alone unless its picture differs from the file (the Discord plugin compares it with the copy on Discord's CDN, and an emoji it cannot compare is left alone), when it is made again (new id; the old emoji and the reactions made with it are lost) after asking, or with `--yes`; `--dry-run` only previews; the bot then needs Create Guild Expressions, which the invite link asks for only when the layout gives an emoji an `image`). The layout's own `emojis: [{ emoji: ":git_commit:", image }]` declares server emoji no reaction names; `setup` makes them with the others and `doctor notifications` expects them on the server. A word without colons (`git_merge`) is refused, not sent as text. `doctor notifications` has an `emoji` row that fails by name for each server emoji the server lacks, and its `channels` row compares the default reaction in the same spelling. A forum's `autoArchiveMinutes` (`60`, `1440`, `4320` or `10080`, Discord's four values; `60` is the shortest) is its default idle time before a post is archived and leaves the list; `setup` sets it and changes nothing when it already matches, and `doctor notifications` reports a difference in the `channels` row. `feeds: { prs: { retainDays: 30 } }` names how many days after a pull request closes its post may be deleted (a positive whole number, off when absent); it is declared and checked only, and nothing deletes a post until `holocron sync prs` (#2853) is built. The pull-request tag `waiting` is now `in review`: `setup` makes the new tag and never deletes the old one, and `doctor notifications` lists a remaining `waiting` tag as information (`pr-feed-retired-tag`) so a person deletes it in Discord; an existing post is re-tagged on its next event.
|
|
761
761
|
|
|
762
762
|
`holocron sync specs [--channel <forum>] [--files <paths...>] [--pr <number>] [--refresh] [--refresh-origin] [--refresh-titles] [--withdraw] [--notify]` keeps one forum post per ADR and spec in step with the files: it makes the post (titled with the document's own title, tagged with the file's status), writes its address into the file as `discussion.url`, and turns a gatekeeper's retag into an edit of the file's `status:` line in the working tree for a pull request. `--files` syncs only those files and `--pr` names a pull request on their posts, for a pull request that is still open. `--refresh-origin` is a one-off repair: it rewrites the `PR:` line of existing posts to the one the current rule names (the optional `prLine` of `DiscussionPatch`, and of `DiscussionPost`), and nothing else in them. `--refresh-titles` is the same kind of one-off repair for the title: it renames each existing post whose title differs from the current rule's (the optional `title` of `DiscussionPatch`, and of `DiscussionPost`) and changes nothing else; a rate limit stops it cleanly, reports how many documents are left, and the next run continues. The id that opens a post is a link to the file on the default branch (`repo.defaultBranch`, else `HEAD`) once the file is there, and plain text while `--pr` names an open pull request; the normal sync rewrites a post's id line (and only that line) whenever it is not the one the rule gives and no `--pr` is given, which covers a file that moved and a post made while its pull request was open, so it needs no extra request when every post is right and `--refresh` is no longer needed for it. `--refresh` runs the `PR:`, title and id-link repairs in one pass (the id link is the optional `idLine` of `DiscussionPatch`, and of `DiscussionPost`, which changes only the message's first line); `--refresh-origin` and `--refresh-titles` still do only their own. `--withdraw` (with `--files`, on the base branch) tags the posts of a pull request closed unmerged `withdrawn` and closes them; `withdrawn` is a tag only, never a file `status:`, and the next sync puts the file's own status back. It cannot be combined with `--refresh`, `--refresh-origin` or `--refresh-titles`. `--dry-run` previews it. The posts behind it are also usable for other keys, such as a pull request (`owner/repo#123`, the state a tag name): `DiscussionPatch.body` replaces the first message's text (the provider keeps its footer), and the optional `Notifications` methods `postDiscussionMessage(channel, key, content, { quiet })` (a closed post is unarchived, written to and closed again), `readDiscussionMessages(channel, key, limit)` (text, newest first, 50 by default) and `dedupeDiscussion(channel, key)` (keeps the oldest post of the key, deletes the rest, returns how many) append to, read and repair a post, and `duplicateDiscussions(channel)` lists the keys with more than one post without deleting: `holocron cleanup posts [channel] [--provider <name>] [--yes]` uses the two to clear duplicates that are already there (the forum with `feeds.prs` by default; `--dry-run` previews it). See the [`sync specs` page](https://docs.theholocron.dev/holocron/commands/sync-specs/).
|
|
763
763
|
|
|
@@ -845,11 +845,21 @@ See the [command pages](https://theholocron.dev/holocron/commands/setup-notifica
|
|
|
845
845
|
provider, a throwing provider is a failing row and the others still run, `--dry-run` calls none, and there is no
|
|
846
846
|
confirmation (like `setup`). Run it with `--cwd <app>` for an app's own config.
|
|
847
847
|
|
|
848
|
+
## Keeping pull request posts in step
|
|
849
|
+
|
|
850
|
+
- **`holocron sync prs [--provider <name>] [--yes]`** — reads the repository's open pull requests (`source`
|
|
851
|
+
`readPullRequestState`) and the forum with `feeds.prs`, and puts each post's tag, title and first message right with the
|
|
852
|
+
same `renderPullRequest()` Sentinel's feed uses, archiving the posts of closed or merged pull requests. A tag changed by
|
|
853
|
+
hand is set back (Discord does not set a pull request's state). Reports a post whose pull request is gone and a key with
|
|
854
|
+
several posts; deletes a closed pull request's post only past `feeds.prs.retainDays` and never one a person wrote in.
|
|
855
|
+
Idempotent; `--dry-run` prints the changes; a rate limit stops it with a `left` count. See the
|
|
856
|
+
[command page](../../docs/src/content/docs/commands/sync-prs.mdx).
|
|
857
|
+
|
|
848
858
|
## Announcing releases
|
|
849
859
|
|
|
850
860
|
- **`holocron sync releases --from <sha> --to <sha> [--tag <tag>] [--channel releases] [--yes]`** — posts one message
|
|
851
861
|
in `#releases` for the public packages whose `version` differs between the two commits (private packages and apps left
|
|
852
|
-
out), ending with a `-# release [<id>]` marker, and a thread on it with a list item per package, each linking to its version on npm. Idempotent: a rerun finds
|
|
862
|
+
out), listing up to eight of the release's changes with their ticket links (read from `git log`), ending with a `-# release [<id>]` marker, and a thread on it with a list item per package, each linking to its version on npm. Idempotent: a rerun finds
|
|
853
863
|
the message by its marker, starts a thread only if it has none and posts only the missing lines. `--dry-run` prints
|
|
854
864
|
the post. Needs a `notifications` provider with `sendWithId`, `findMessage`, `startThread`, `postToThread` and
|
|
855
865
|
`readThread` (Discord); the release workflow's `announce` job runs it. See the
|
|
@@ -1037,6 +1047,19 @@ Each SDK sits behind an interface from `@theholocron/observability` —
|
|
|
1037
1047
|
(`observability/resolve-telemetry.ts`). See the
|
|
1038
1048
|
[telemetry guide](https://docs.theholocron.dev/holocron/telemetry/).
|
|
1039
1049
|
|
|
1050
|
+
### Command log
|
|
1051
|
+
|
|
1052
|
+
Every command run is recorded: the command, the flag **names** (never values or positionals), the repository, the exit code,
|
|
1053
|
+
the duration and who ran it (`agent` or `human`). It is one `command_run` event through the logger (Axiom), and an agent's
|
|
1054
|
+
run is also one line in the `#agent-log` Discord channel. `notifications.commandLog` in `holocron.config` picks whose runs are
|
|
1055
|
+
posted: `"agents"` (default), `"all"` or `"off"`. Nothing is recorded in CI or under test. See the
|
|
1056
|
+
[command log guide](https://docs.theholocron.dev/holocron/command-log/).
|
|
1057
|
+
|
|
1058
|
+
With `notifications.commandThreads` (`"off"` by default, `"agents"` or `"all"`) a run also opens a thread in `#agent-log`,
|
|
1059
|
+
named `holocron <command> — <timestamp>`, and streams the CLI logger's lines (`info` and above, the message and the numeric
|
|
1060
|
+
fields only) into it in batches while it runs. The run's `commandLog` line is the thread's last post. It is best effort,
|
|
1061
|
+
bounded by the same two second deadline at the end, and never changes the exit code or the output.
|
|
1062
|
+
|
|
1040
1063
|
### ESLint bundle options
|
|
1041
1064
|
|
|
1042
1065
|
Most repos need nothing here — `@theholocron/eslint-config`'s `library()`
|