@milkenjoyer/toolchain 0.8.0 → 0.10.0

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 CHANGED
@@ -33,3 +33,13 @@ Before deployment, save the active generated stub's bytes and executable mode. C
33
33
  Run `GH_TOKEN="$(gh auth token)" vp exec proof <owner/repo> <files>` to upload screenshots and video as Git objects under a hidden `refs/proof/<commit>` ref and print inline Markdown for the PR. The repository must be private; media stays private to repo members. The command accepts `GH_TOKEN` or `GITHUB_TOKEN`. Video uploads include a GIF preview capped at 30 seconds and 720 pixels and need ffmpeg on the runner.
34
34
 
35
35
  In CI, give the job `permissions: contents: write`, set `GH_TOKEN: ${{ github.token }}`, and run `vp exec proof ${{ github.repository }} <files>` after generating the media.
36
+
37
+ ## Verification check
38
+
39
+ The `verdict` bin posts a `verdict` commit status of `success` on the PR head SHA for Renovate or changes containing only docs, art, media, fonts or changesets. Files under any `skills/` directory require a live run and do not qualify for the docs exemption. Unknown or truncated file lists do not qualify for the docs exemption either. Code PRs post no status and wait for an independent live verdict. Rerunning CI cannot overwrite a live verdict on a code PR.
40
+
41
+ On `pull_request`, run this before any docs-only scope skip. Give the job `permissions: statuses: write` alongside `contents: read`, set `GH_TOKEN: ${{ github.token }}`, and run `vp exec verdict`. It reads `GITHUB_EVENT_PATH` and accepts `GITHUB_TOKEN` as a fallback. Other events exit successfully without posting.
42
+
43
+ The `verification` check requires a code-tier PR body to contain a `## Verification` section naming at least one real run in backticks. Record each command or verifier recipe and its outcome. Renovate PRs and PRs changing only Markdown, MDX, LICENSE files, art, media or fonts outside `skills/` directories are exempt. Changeset-only PRs are exempt. An unknown or truncated file list requires verification. HTML comments do not count as runs.
44
+
45
+ In the PR job, set `permissions: contents: read` and `GH_TOKEN: ${{ github.token }}`, then run `vp exec verification`. The check reads the original pull request event and compares its base and head through the GitHub API. After editing a failing body, push again because a rerun reads the body from the original event.
@@ -0,0 +1,3 @@
1
+ import { i as VerificationError } from "./verification-MNG9WKEH.mjs";
2
+ import * as Effect from "effect/Effect";
3
+ export declare const checkVerdict: Effect.Effect<number, import("effect/Config").ConfigError | import("effect/PlatformError").PlatformError | import("effect/Schema").SchemaError | VerificationError, import("effect/FileSystem").FileSystem>;
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env bun
2
+ import { a as readPullRequest, i as github, n as autoPass } from "./verification-2bhNnJr-.mjs";
3
+ import * as Effect from "effect/Effect";
4
+ import { NodeServices } from "@effect/platform-node";
5
+ import * as Cause from "effect/Cause";
6
+ import * as Exit from "effect/Exit";
7
+ import * as Console from "effect/Console";
8
+ // src/verdict.ts
9
+ const checkVerdict = Effect.gen(function* () {
10
+ const request = yield* readPullRequest;
11
+ if (request === void 0) return 0;
12
+ const { octokit, owner, repo, number, sha, pr } = request;
13
+ const reason = autoPass(pr);
14
+ if (reason === void 0) {
15
+ yield* Console.log(`PR #${number} at ${sha} waits for an independent live verdict.`);
16
+ return 0;
17
+ }
18
+ const description = `PASS: auto, ${reason}`.slice(0, 139);
19
+ yield* github(() => octokit.rest.repos.createCommitStatus({
20
+ owner,
21
+ repo,
22
+ sha,
23
+ context: "verdict",
24
+ state: "success",
25
+ description
26
+ }));
27
+ yield* Console.log(`Posted verdict: success on PR #${number} at ${sha}: ${description}`);
28
+ return 0;
29
+ });
30
+ if (import.meta.main) {
31
+ const exit = await Effect.runPromiseExit(checkVerdict.pipe(Effect.provide(NodeServices.layer)));
32
+ if (Exit.isSuccess(exit)) process.exitCode = exit.value;
33
+ else {
34
+ const error = Cause.squash(exit.cause);
35
+ process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
36
+ process.exitCode = 1;
37
+ }
38
+ }
39
+ export { checkVerdict };
@@ -0,0 +1,111 @@
1
+ import * as Data from "effect/Data";
2
+ import * as Schema from "effect/Schema";
3
+ import * as Effect from "effect/Effect";
4
+ import { FileSystem } from "effect/FileSystem";
5
+ import { NodeServices } from "@effect/platform-node";
6
+ import { Octokit } from "@octokit/rest";
7
+ import * as Cause from "effect/Cause";
8
+ import * as Config from "effect/Config";
9
+ import * as Exit from "effect/Exit";
10
+ import * as Redacted from "effect/Redacted";
11
+ import * as Console from "effect/Console";
12
+ // src/verification.ts
13
+ const exemptions = [{
14
+ reason: "Renovate PR",
15
+ applies: (pr) => pr.author === "renovate[bot]"
16
+ }, {
17
+ reason: "changes only docs, content or art",
18
+ applies: (pr) => pr.files !== void 0 && pr.files.length > 0 && pr.files.every((file) => !file.split("/").includes("skills") && /^(?:LICENSE.*|.*\.(?:md|mdx|png|jpg|jpeg|gif|webp|avif|svg|ico|mp4|webm|mov|mp3|wav|ogg|woff|woff2|ttf|otf))$/iu.test(file.split("/").at(-1) ?? ""))
19
+ }];
20
+ const autoPass = (pr) => exemptions.find((entry) => entry.applies(pr))?.reason;
21
+ const verdict = (pr) => {
22
+ const exemption = autoPass(pr);
23
+ if (exemption !== void 0) return {
24
+ _tag: "Exempt",
25
+ reason: exemption
26
+ };
27
+ const lines = (pr.body ?? "").replaceAll(/<!--[\s\S]*?-->/gu, "").split(/\r?\n/u);
28
+ const start = lines.findIndex((line) => /^##\s+Verification\s*$/iu.test(line));
29
+ if (start === -1) return {
30
+ _tag: "Unproven",
31
+ reason: "has no ## Verification section"
32
+ };
33
+ const fencedRun = "\0";
34
+ const [section = ""] = lines.slice(start + 1).join("\n").replaceAll(/^ {0,3}(`{3,}|~{3,})[^\n]*\n([\s\S]*?)^ {0,3}\1[ \t]*$/gmu, (_fence, _marker, content) => content.trim() === "" ? "" : fencedRun).split(/^(?:# |## )/mu);
35
+ return section.includes(fencedRun) || /`[^`\s][^`]*`/u.test(section) ? { _tag: "Proven" } : {
36
+ _tag: "Unproven",
37
+ reason: "names no run"
38
+ };
39
+ };
40
+ var VerificationError = class extends Data.TaggedError("VerificationError") {};
41
+ const github = (request) => Effect.tryPromise({
42
+ try: request,
43
+ catch: (cause) => new VerificationError({ message: cause instanceof Error ? cause.message : String(cause) })
44
+ });
45
+ const PullRequestEvent = Schema.fromJsonString(Schema.Struct({
46
+ pull_request: Schema.Struct({
47
+ number: Schema.Finite,
48
+ body: Schema.NullOr(Schema.String),
49
+ user: Schema.Struct({ login: Schema.String }),
50
+ base: Schema.Struct({ sha: Schema.String }),
51
+ head: Schema.Struct({ sha: Schema.String })
52
+ }),
53
+ repository: Schema.Struct({ full_name: Schema.String })
54
+ }));
55
+ const readPullRequest = Effect.gen(function* () {
56
+ if ((yield* Config.String("GITHUB_EVENT_NAME").pipe(Config.withDefault(""))) !== "pull_request") {
57
+ yield* Console.log("Not a pull_request event, so there is no PR to check.");
58
+ return;
59
+ }
60
+ const fs = yield* FileSystem;
61
+ const eventPath = yield* Config.String("GITHUB_EVENT_PATH");
62
+ const payload = yield* fs.readFileString(eventPath);
63
+ const { pull_request: pr, repository } = yield* Schema.decodeEffect(PullRequestEvent)(payload);
64
+ const [, owner, repo] = /^([^/\s]+)\/([^/\s]+)$/u.exec(repository.full_name) ?? [];
65
+ if (owner === void 0 || repo === void 0) return yield* new VerificationError({ message: "Invalid repository.full_name" });
66
+ const token = yield* Config.schema(Schema.Redacted(Schema.NonEmptyString), "GH_TOKEN").pipe(Config.orElse(() => Config.schema(Schema.Redacted(Schema.NonEmptyString), "GITHUB_TOKEN")), Effect.mapError(() => new VerificationError({ message: "Missing GH_TOKEN or GITHUB_TOKEN" })));
67
+ const octokit = new Octokit({ auth: Redacted.value(token) });
68
+ const { data } = yield* github(() => octokit.rest.repos.compareCommitsWithBasehead({
69
+ owner,
70
+ repo,
71
+ basehead: `${pr.base.sha}...${pr.head.sha}`
72
+ }));
73
+ return {
74
+ octokit,
75
+ owner,
76
+ repo,
77
+ number: pr.number,
78
+ sha: pr.head.sha,
79
+ pr: {
80
+ author: pr.user.login,
81
+ body: pr.body,
82
+ files: data.files === void 0 || data.files.length >= 300 ? void 0 : data.files.map((file) => file.filename)
83
+ }
84
+ };
85
+ });
86
+ const checkVerification = Effect.gen(function* () {
87
+ const request = yield* readPullRequest;
88
+ if (request === void 0) return 0;
89
+ const { number } = request;
90
+ const result = verdict(request.pr);
91
+ if (result._tag === "Exempt") {
92
+ yield* Console.log(`PR #${number} is exempt: ${result.reason}.`);
93
+ return 0;
94
+ }
95
+ if (result._tag === "Proven") {
96
+ yield* Console.log(`PR #${number}'s ## Verification names a run.`);
97
+ return 0;
98
+ }
99
+ yield* Console.error(`PR #${number} ${result.reason}. Add a ## Verification section naming each real run (the command or verifier recipe in backticks) and its outcome, then push again after editing the body: a rerun reads the body from the original event.`);
100
+ return 1;
101
+ });
102
+ if (import.meta.main) {
103
+ const exit = await Effect.runPromiseExit(checkVerification.pipe(Effect.provide(NodeServices.layer)));
104
+ if (Exit.isSuccess(exit)) process.exitCode = exit.value;
105
+ else {
106
+ const error = Cause.squash(exit.cause);
107
+ process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
108
+ process.exitCode = 1;
109
+ }
110
+ }
111
+ export { readPullRequest as a, github as i, autoPass as n, verdict as o, checkVerification as r, VerificationError as t };
@@ -0,0 +1,40 @@
1
+ import * as Schema from "effect/Schema";
2
+ import * as Effect from "effect/Effect";
3
+ import { FileSystem } from "effect/FileSystem";
4
+ import { Octokit } from "@octokit/rest";
5
+ import * as Cause from "effect/Cause";
6
+ import * as Config from "effect/Config";
7
+ type PullRequest = {
8
+ readonly author: string;
9
+ readonly body: string | null;
10
+ readonly files: ReadonlyArray<string> | undefined;
11
+ };
12
+ type Verdict = {
13
+ readonly _tag: "Exempt";
14
+ readonly reason: string;
15
+ } | {
16
+ readonly _tag: "Proven";
17
+ } | {
18
+ readonly _tag: "Unproven";
19
+ readonly reason: string;
20
+ };
21
+ declare const autoPass: (pr: PullRequest) => string | undefined;
22
+ declare const verdict: (pr: PullRequest) => Verdict;
23
+ declare const VerificationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => Cause.YieldableError & {
24
+ readonly _tag: "VerificationError";
25
+ } & Readonly<A>;
26
+ declare class VerificationError extends VerificationError_base<{
27
+ readonly message: string;
28
+ }> {}
29
+ declare const github: <A>(request: () => Promise<A>) => Effect.Effect<A, VerificationError, never>;
30
+ type PullRequestContext = {
31
+ readonly octokit: Octokit;
32
+ readonly owner: string;
33
+ readonly repo: string;
34
+ readonly number: number;
35
+ readonly sha: string;
36
+ readonly pr: PullRequest;
37
+ };
38
+ declare const readPullRequest: Effect.Effect<PullRequestContext | undefined, Config.ConfigError | import("effect/PlatformError").PlatformError | Schema.SchemaError | VerificationError, FileSystem>;
39
+ declare const checkVerification: Effect.Effect<0 | 1, Config.ConfigError | import("effect/PlatformError").PlatformError | Schema.SchemaError | VerificationError, FileSystem>;
40
+ export { autoPass as a, readPullRequest as c, VerificationError as i, verdict as l, PullRequestContext as n, checkVerification as o, Verdict as r, github as s, PullRequest as t };
@@ -0,0 +1,2 @@
1
+ import { a as autoPass, c as readPullRequest, i as VerificationError, l as verdict, n as PullRequestContext, o as checkVerification, r as Verdict, s as github, t as PullRequest } from "./verification-MNG9WKEH.mjs";
2
+ export { PullRequest, PullRequestContext, Verdict, VerificationError, autoPass, checkVerification, github, readPullRequest, verdict };
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env bun
2
+ export { t as VerificationError, n as autoPass, r as checkVerification, i as github, a as readPullRequest, o as verdict } from "./verification-2bhNnJr-.mjs";
package/package.json CHANGED
@@ -1,13 +1,15 @@
1
1
  {
2
2
  "name": "@milkenjoyer/toolchain",
3
- "version": "0.8.0",
3
+ "version": "0.10.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/birbprophet/agent-kit.git",
7
7
  "directory": "packages/toolchain"
8
8
  },
9
9
  "bin": {
10
- "proof": "./src/proof.ts"
10
+ "proof": "./src/proof.ts",
11
+ "verdict": "./src/verdict.ts",
12
+ "verification": "./src/verification.ts"
11
13
  },
12
14
  "files": [
13
15
  "dist",
@@ -15,6 +17,8 @@
15
17
  "node-version",
16
18
  "renovate.json",
17
19
  "src/proof.ts",
20
+ "src/verdict.ts",
21
+ "src/verification.ts",
18
22
  "tsconfig.base.json",
19
23
  "vscode/extensions.json",
20
24
  "vscode/settings.json"
package/src/verdict.ts ADDED
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env bun
2
+ import { NodeServices } from "@effect/platform-node";
3
+ import * as Cause from "effect/Cause";
4
+ import * as Console from "effect/Console";
5
+ import * as Effect from "effect/Effect";
6
+ import * as Exit from "effect/Exit";
7
+
8
+ import { autoPass, github, readPullRequest } from "./verification.ts";
9
+
10
+ export const checkVerdict = Effect.gen(function* () {
11
+ const request = yield* readPullRequest;
12
+ if (request === undefined) return 0;
13
+ const { octokit, owner, repo, number, sha, pr } = request;
14
+ const reason = autoPass(pr);
15
+ if (reason === undefined) {
16
+ yield* Console.log(
17
+ `PR #${number} at ${sha} waits for an independent live verdict.`
18
+ );
19
+ return 0;
20
+ }
21
+ const description = `PASS: auto, ${reason}`.slice(0, 139);
22
+ yield* github(() =>
23
+ octokit.rest.repos.createCommitStatus({
24
+ owner,
25
+ repo,
26
+ sha,
27
+ context: "verdict",
28
+ state: "success",
29
+ description,
30
+ })
31
+ );
32
+ yield* Console.log(
33
+ `Posted verdict: success on PR #${number} at ${sha}: ${description}`
34
+ );
35
+ return 0;
36
+ });
37
+
38
+ if (import.meta.main) {
39
+ const exit = await Effect.runPromiseExit(
40
+ checkVerdict.pipe(Effect.provide(NodeServices.layer))
41
+ );
42
+ if (Exit.isSuccess(exit)) process.exitCode = exit.value;
43
+ else {
44
+ const error = Cause.squash(exit.cause);
45
+ process.stderr.write(
46
+ `${error instanceof Error ? error.message : String(error)}\n`
47
+ );
48
+ process.exitCode = 1;
49
+ }
50
+ }
@@ -0,0 +1,200 @@
1
+ #!/usr/bin/env bun
2
+ import { NodeServices } from "@effect/platform-node";
3
+ import { Octokit } from "@octokit/rest";
4
+ import * as Cause from "effect/Cause";
5
+ import * as Config from "effect/Config";
6
+ import * as Console from "effect/Console";
7
+ import * as Data from "effect/Data";
8
+ import * as Effect from "effect/Effect";
9
+ import * as Exit from "effect/Exit";
10
+ import { FileSystem } from "effect/FileSystem";
11
+ import * as Redacted from "effect/Redacted";
12
+ import * as Schema from "effect/Schema";
13
+
14
+ export type PullRequest = {
15
+ readonly author: string;
16
+ readonly body: string | null;
17
+ readonly files: ReadonlyArray<string> | undefined;
18
+ };
19
+
20
+ export type Verdict =
21
+ | { readonly _tag: "Exempt"; readonly reason: string }
22
+ | { readonly _tag: "Proven" }
23
+ | { readonly _tag: "Unproven"; readonly reason: string };
24
+
25
+ const exemptions: ReadonlyArray<{
26
+ readonly reason: string;
27
+ readonly applies: (pr: PullRequest) => boolean;
28
+ }> = [
29
+ {
30
+ reason: "Renovate PR",
31
+ applies: (pr) => pr.author === "renovate[bot]",
32
+ },
33
+ {
34
+ reason: "changes only docs, content or art",
35
+ applies: (pr) =>
36
+ pr.files !== undefined &&
37
+ pr.files.length > 0 &&
38
+ pr.files.every(
39
+ (file) =>
40
+ !file.split("/").includes("skills") &&
41
+ /^(?:LICENSE.*|.*\.(?:md|mdx|png|jpg|jpeg|gif|webp|avif|svg|ico|mp4|webm|mov|mp3|wav|ogg|woff|woff2|ttf|otf))$/iu.test(
42
+ file.split("/").at(-1) ?? ""
43
+ )
44
+ ),
45
+ },
46
+ ];
47
+
48
+ export const autoPass = (pr: PullRequest): string | undefined =>
49
+ exemptions.find((entry) => entry.applies(pr))?.reason;
50
+
51
+ export const verdict = (pr: PullRequest): Verdict => {
52
+ const exemption = autoPass(pr);
53
+ if (exemption !== undefined) return { _tag: "Exempt", reason: exemption };
54
+ const lines = (pr.body ?? "")
55
+ .replaceAll(/<!--[\s\S]*?-->/gu, "")
56
+ .split(/\r?\n/u);
57
+ const start = lines.findIndex((line) =>
58
+ /^##\s+Verification\s*$/iu.test(line)
59
+ );
60
+ if (start === -1)
61
+ return { _tag: "Unproven", reason: "has no ## Verification section" };
62
+ const fencedRun = "\u0000";
63
+ const rest = lines
64
+ .slice(start + 1)
65
+ .join("\n")
66
+ .replaceAll(
67
+ /^ {0,3}(`{3,}|~{3,})[^\n]*\n([\s\S]*?)^ {0,3}\1[ \t]*$/gmu,
68
+ (_fence, _marker, content: string) =>
69
+ content.trim() === "" ? "" : fencedRun
70
+ );
71
+ const [section = ""] = rest.split(/^(?:# |## )/mu);
72
+ return section.includes(fencedRun) || /`[^`\s][^`]*`/u.test(section)
73
+ ? { _tag: "Proven" }
74
+ : { _tag: "Unproven", reason: "names no run" };
75
+ };
76
+
77
+ export class VerificationError extends Data.TaggedError("VerificationError")<{
78
+ readonly message: string;
79
+ }> {}
80
+
81
+ export const github = <A>(request: () => Promise<A>) =>
82
+ Effect.tryPromise({
83
+ try: request,
84
+ catch: (cause) =>
85
+ new VerificationError({
86
+ message: cause instanceof Error ? cause.message : String(cause),
87
+ }),
88
+ });
89
+
90
+ const PullRequestEvent = Schema.fromJsonString(
91
+ Schema.Struct({
92
+ pull_request: Schema.Struct({
93
+ number: Schema.Finite,
94
+ body: Schema.NullOr(Schema.String),
95
+ user: Schema.Struct({ login: Schema.String }),
96
+ base: Schema.Struct({ sha: Schema.String }),
97
+ head: Schema.Struct({ sha: Schema.String }),
98
+ }),
99
+ repository: Schema.Struct({ full_name: Schema.String }),
100
+ })
101
+ );
102
+
103
+ export type PullRequestContext = {
104
+ readonly octokit: Octokit;
105
+ readonly owner: string;
106
+ readonly repo: string;
107
+ readonly number: number;
108
+ readonly sha: string;
109
+ readonly pr: PullRequest;
110
+ };
111
+
112
+ export const readPullRequest = Effect.gen(function* () {
113
+ const event = yield* Config.String("GITHUB_EVENT_NAME").pipe(
114
+ Config.withDefault("")
115
+ );
116
+ if (event !== "pull_request") {
117
+ yield* Console.log("Not a pull_request event, so there is no PR to check.");
118
+ return undefined;
119
+ }
120
+ const fs = yield* FileSystem;
121
+ const eventPath = yield* Config.String("GITHUB_EVENT_PATH");
122
+ const payload = yield* fs.readFileString(eventPath);
123
+ const { pull_request: pr, repository } =
124
+ yield* Schema.decodeEffect(PullRequestEvent)(payload);
125
+ const [, owner, repo] =
126
+ /^([^/\s]+)\/([^/\s]+)$/u.exec(repository.full_name) ?? [];
127
+ if (owner === undefined || repo === undefined)
128
+ return yield* new VerificationError({
129
+ message: "Invalid repository.full_name",
130
+ });
131
+ const token = yield* Config.schema(
132
+ Schema.Redacted(Schema.NonEmptyString),
133
+ "GH_TOKEN"
134
+ ).pipe(
135
+ Config.orElse(() =>
136
+ Config.schema(Schema.Redacted(Schema.NonEmptyString), "GITHUB_TOKEN")
137
+ ),
138
+ Effect.mapError(
139
+ () =>
140
+ new VerificationError({ message: "Missing GH_TOKEN or GITHUB_TOKEN" })
141
+ )
142
+ );
143
+ const octokit = new Octokit({ auth: Redacted.value(token) });
144
+ const { data } = yield* github(() =>
145
+ octokit.rest.repos.compareCommitsWithBasehead({
146
+ owner,
147
+ repo,
148
+ basehead: `${pr.base.sha}...${pr.head.sha}`,
149
+ })
150
+ );
151
+ const request: PullRequestContext = {
152
+ octokit,
153
+ owner,
154
+ repo,
155
+ number: pr.number,
156
+ sha: pr.head.sha,
157
+ pr: {
158
+ author: pr.user.login,
159
+ body: pr.body,
160
+ files:
161
+ data.files === undefined || data.files.length >= 300
162
+ ? undefined
163
+ : data.files.map((file) => file.filename),
164
+ },
165
+ };
166
+ return request;
167
+ });
168
+
169
+ export const checkVerification = Effect.gen(function* () {
170
+ const request = yield* readPullRequest;
171
+ if (request === undefined) return 0;
172
+ const { number } = request;
173
+ const result = verdict(request.pr);
174
+ if (result._tag === "Exempt") {
175
+ yield* Console.log(`PR #${number} is exempt: ${result.reason}.`);
176
+ return 0;
177
+ }
178
+ if (result._tag === "Proven") {
179
+ yield* Console.log(`PR #${number}'s ## Verification names a run.`);
180
+ return 0;
181
+ }
182
+ yield* Console.error(
183
+ `PR #${number} ${result.reason}. Add a ## Verification section naming each real run (the command or verifier recipe in backticks) and its outcome, then push again after editing the body: a rerun reads the body from the original event.`
184
+ );
185
+ return 1;
186
+ });
187
+
188
+ if (import.meta.main) {
189
+ const exit = await Effect.runPromiseExit(
190
+ checkVerification.pipe(Effect.provide(NodeServices.layer))
191
+ );
192
+ if (Exit.isSuccess(exit)) process.exitCode = exit.value;
193
+ else {
194
+ const error = Cause.squash(exit.cause);
195
+ process.stderr.write(
196
+ `${error instanceof Error ? error.message : String(error)}\n`
197
+ );
198
+ process.exitCode = 1;
199
+ }
200
+ }