@theholocron/cli 5.0.0-alpha.598 → 5.0.0-alpha.599
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/dist/cli.mjs +13 -13
- package/dist/cli.mjs.map +1 -1
- package/package.json +5 -5
package/dist/cli.mjs
CHANGED
|
@@ -4769,6 +4769,8 @@ function notificationsOnlyConfig(resolved) {
|
|
|
4769
4769
|
// src/observability/command-run-deps/command-run-deps.ts
|
|
4770
4770
|
/** The channel a command run is posted to; the layout declares it (`.holocron/notifications.ts`). */
|
|
4771
4771
|
const AGENT_LOG_CHANNEL = "agent-log";
|
|
4772
|
+
/** The name of the channel's webhook secret, less the `HOLOCRON_` prefix: `NOTIFY_WEBHOOK_AGENT_LOG`. */
|
|
4773
|
+
const AGENT_LOG_WEBHOOK_NAME = `NOTIFY_WEBHOOK_${AGENT_LOG_CHANNEL.toUpperCase().replaceAll("-", "_")}`;
|
|
4772
4774
|
/** Whether a provider has the three methods a command thread needs. */
|
|
4773
4775
|
function canThread$1(provider) {
|
|
4774
4776
|
return typeof provider.sendWithId === "function" && typeof provider.startThread === "function" && typeof provider.postToThread === "function";
|
|
@@ -4778,8 +4780,8 @@ function canThread$1(provider) {
|
|
|
4778
4780
|
* while the command runs. The config is read at most once, and only when the recorder or the thread asks for a setting
|
|
4779
4781
|
* (a run that is left out for CI, test or the skip list never does); the plugin loader is built only when a post or a
|
|
4780
4782
|
* thread is due, so a human run in the default modes never builds one. The post goes to every configured
|
|
4781
|
-
* `notifications` provider through its `send`,
|
|
4782
|
-
*
|
|
4783
|
+
* `notifications` provider through its `send`, given the channel's webhook (`HOLOCRON_NOTIFY_WEBHOOK_AGENT_LOG`, read through `resolveValue()`); with none, nothing
|
|
4784
|
+
* is sent. A thread is opened on the first provider that has `sendWithId`,
|
|
4783
4785
|
* `startThread` and `postToThread`, and the CLI logger's lines are copied into it through the log tap. Provider tokens
|
|
4784
4786
|
* given with `--token` are not passed on.
|
|
4785
4787
|
*/
|
|
@@ -4821,7 +4823,9 @@ function createCommandRunDeps(input) {
|
|
|
4821
4823
|
thread,
|
|
4822
4824
|
mode: async () => (await load()).resolved.notifications?.commandLog ?? "agents",
|
|
4823
4825
|
post: async (line) => {
|
|
4824
|
-
|
|
4826
|
+
const url = resolveValue$2([AGENT_LOG_WEBHOOK_NAME], void 0, { prefix: PREFIX$1 });
|
|
4827
|
+
if (!url) return;
|
|
4828
|
+
await Promise.all((await notifications()).map((provider) => provider.send(url, line)));
|
|
4825
4829
|
}
|
|
4826
4830
|
};
|
|
4827
4831
|
}
|
|
@@ -18152,14 +18156,10 @@ function workflowNameProblems(text) {
|
|
|
18152
18156
|
});
|
|
18153
18157
|
}
|
|
18154
18158
|
// src/commands/notifications-workflow-checks/notifications-workflow-checks.ts
|
|
18155
|
-
/** Where the workflow that posts failed runs and
|
|
18159
|
+
/** Where the workflow that posts failed runs and deploys lives, on the default branch. */
|
|
18156
18160
|
const NOTIFICATIONS_WORKFLOW_PATH = ".github/workflows/platform.notifications.yml";
|
|
18157
|
-
/** The webhook secrets the workflow posts through: failed runs
|
|
18158
|
-
const WEBHOOK_SECRETS = [
|
|
18159
|
-
"HOLOCRON_NOTIFY_WEBHOOK_ALERTS",
|
|
18160
|
-
"HOLOCRON_NOTIFY_WEBHOOK_DEPLOYS",
|
|
18161
|
-
"HOLOCRON_NOTIFY_WEBHOOK_RELEASES"
|
|
18162
|
-
];
|
|
18161
|
+
/** The webhook secrets the workflow posts through: failed runs and deploys. A release is announced by the release job. */
|
|
18162
|
+
const WEBHOOK_SECRETS = ["HOLOCRON_NOTIFY_WEBHOOK_ALERTS", "HOLOCRON_NOTIFY_WEBHOOK_DEPLOYS"];
|
|
18163
18163
|
const PRESENT_ID = "notifications-workflow";
|
|
18164
18164
|
const PRESENT_TITLE = "Notifications workflow is on the default branch";
|
|
18165
18165
|
const WIRED_ID = "notifications-workflow-wiring";
|
|
@@ -18169,10 +18169,10 @@ const NAMES_TITLE = "Notifications workflow lists only task ids";
|
|
|
18169
18169
|
const shown$3 = (s) => sanitizeDetail(s);
|
|
18170
18170
|
const upper = (names) => new Set(names.map((n) => n.toUpperCase()));
|
|
18171
18171
|
/**
|
|
18172
|
-
* The steps of `doctor notifications` that check the workflow which posts failed runs and
|
|
18172
|
+
* The steps of `doctor notifications` that check the workflow which posts failed runs and deploys: the file is on
|
|
18173
18173
|
* the default branch, and the `HOLOCRON_NOTIFY_*` secrets it reads are the ones the layout fills (so every channel it
|
|
18174
18174
|
* writes to is in the layout, and a channel the layout wires for it is one it posts to). Read-only. No rows when the
|
|
18175
|
-
* layout fills
|
|
18175
|
+
* layout fills neither the alerts nor the deploys webhook, because then nothing is meant to reach those channels.
|
|
18176
18176
|
*/
|
|
18177
18177
|
async function notificationsWorkflowChecks(input) {
|
|
18178
18178
|
const filled = upper(layoutSecretNames(input.layout));
|
|
@@ -18205,7 +18205,7 @@ async function notificationsWorkflowChecks(input) {
|
|
|
18205
18205
|
];
|
|
18206
18206
|
}
|
|
18207
18207
|
if (text === void 0) return [
|
|
18208
|
-
resultRow(PRESENT_ID, PRESENT_TITLE, [`${NOTIFICATIONS_WORKFLOW_PATH} is missing: without it a failed run or a
|
|
18208
|
+
resultRow(PRESENT_ID, PRESENT_TITLE, [`${NOTIFICATIONS_WORKFLOW_PATH} is missing: without it a failed run or a deploy posts nothing to Discord`], ""),
|
|
18209
18209
|
skipRow$1(WIRED_ID, WIRED_TITLE, "not checked: the workflow is missing"),
|
|
18210
18210
|
skipRow$1(NAMES_ID, NAMES_TITLE, "not checked: the workflow is missing")
|
|
18211
18211
|
];
|