@smoothbricks/nx-plugin 0.4.22 → 0.4.24

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.
Files changed (72) hide show
  1. package/README.md +93 -33
  2. package/dist/bin/smoo-nx-exec.js +35 -11
  3. package/dist/bin/smoo-nx-nextest-extract.d.ts +3 -0
  4. package/dist/bin/smoo-nx-nextest-extract.d.ts.map +1 -0
  5. package/dist/bin/smoo-nx-nextest-extract.js +41 -0
  6. package/dist/cargo-closure-input.d.ts +63 -0
  7. package/dist/cargo-closure-input.d.ts.map +1 -0
  8. package/dist/cargo-closure-input.js +197 -0
  9. package/dist/cargo-source-hash.d.ts +37 -0
  10. package/dist/cargo-source-hash.d.ts.map +1 -1
  11. package/dist/cargo-source-hash.js +108 -190
  12. package/dist/cross-check-policy.d.ts +14 -0
  13. package/dist/cross-check-policy.d.ts.map +1 -1
  14. package/dist/cross-check-policy.js +15 -1
  15. package/dist/ensure-built.d.ts +3 -2
  16. package/dist/ensure-built.d.ts.map +1 -1
  17. package/dist/ensure-built.js +33 -56
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +152 -91
  20. package/dist/managed-files/ci-workflow.d.ts.map +1 -1
  21. package/dist/managed-files/ci-workflow.js +12 -15
  22. package/dist/managed-files/files.d.ts.map +1 -1
  23. package/dist/managed-files/files.js +10 -0
  24. package/dist/managed-files/publish-workflow.d.ts.map +1 -1
  25. package/dist/managed-files/publish-workflow.js +12 -6
  26. package/dist/manifest-hash.d.ts.map +1 -1
  27. package/dist/manifest-hash.js +24 -30
  28. package/dist/nextest-extraction.d.ts +101 -0
  29. package/dist/nextest-extraction.d.ts.map +1 -0
  30. package/dist/nextest-extraction.js +268 -0
  31. package/dist/package-target-policy.js +1 -1
  32. package/dist/platform-targets.d.ts +7 -0
  33. package/dist/platform-targets.d.ts.map +1 -1
  34. package/dist/platform-targets.js +7 -0
  35. package/dist/workspace-config-policy.d.ts +1 -1
  36. package/dist/workspace-config-policy.d.ts.map +1 -1
  37. package/dist/workspace-config-policy.js +1 -1
  38. package/managed/raw/envrc +38 -1
  39. package/managed/raw/tooling/direnv/developer-links.ts +201 -0
  40. package/managed/raw/tooling/direnv/devenv.smoo.nix +75 -51
  41. package/managed/raw/tooling/direnv/secret-references.ts +3 -1
  42. package/managed/raw/tooling/direnv/setup-environment.ts +562 -78
  43. package/managed/raw/tooling/direnv/shared-caches.sh +53 -0
  44. package/managed/raw/tooling/git-hooks/pre-push.sh +22 -1
  45. package/managed/templates/github/workflows/managed-files.yml +4 -3
  46. package/nextest.toml +5 -5
  47. package/package.json +4 -3
  48. package/src/__tests__/fixture-nx-env.ts +31 -0
  49. package/src/__tests__/in-process-nx-index.ts +9 -0
  50. package/src/bin/smoo-nx-exec.ts +40 -11
  51. package/src/bin/smoo-nx-nextest-extract.ts +43 -0
  52. package/src/bounded-test-policy.test.ts +4 -1
  53. package/src/cargo-closure-input.test.ts +184 -0
  54. package/src/cargo-closure-input.ts +247 -0
  55. package/src/cargo-source-hash.test.ts +8 -9
  56. package/src/cargo-source-hash.ts +146 -47
  57. package/src/cross-check-policy.ts +15 -3
  58. package/src/ensure-built.test.ts +65 -5
  59. package/src/ensure-built.ts +40 -85
  60. package/src/index.test.ts +222 -75
  61. package/src/index.ts +213 -101
  62. package/src/managed-files/ci-workflow.ts +12 -15
  63. package/src/managed-files/files.ts +10 -0
  64. package/src/managed-files/generator.test.ts +29 -0
  65. package/src/managed-files/publish-workflow.ts +17 -6
  66. package/src/manifest-hash.test.ts +21 -1
  67. package/src/manifest-hash.ts +26 -29
  68. package/src/nextest-extraction.test.ts +74 -0
  69. package/src/nextest-extraction.ts +329 -0
  70. package/src/package-target-policy.ts +1 -1
  71. package/src/platform-targets.ts +8 -0
  72. package/src/workspace-config-policy.ts +6 -1
@@ -0,0 +1,201 @@
1
+ /**
2
+ * The links a developer points out of this checkout, kept across every
3
+ * install smoo runs.
4
+ *
5
+ * `bun link <name>`, or a hand-made `ln -s`, replaces a dependency's entry in
6
+ * a node_modules tree with a link to a local checkout of that package: how a
7
+ * consumer runs against a build that is not published yet. Every `bun
8
+ * install` re-points every declared dependency at the lockfile's version —
9
+ * an install with nothing to do included, and before the root `preinstall`
10
+ * script runs (measured on Bun 1.4.2), so no lifecycle script ever sees the
11
+ * link. So each install smoo runs (shell entry's, a CI runner's
12
+ * frozen-lockfile one, `smoo monorepo update`'s) records these links before
13
+ * it installs and puts exactly those back afterwards. A plain `bun install`
14
+ * still relinks them: only a wrapper around bun itself could intercept that.
15
+ *
16
+ * A developer link is a symlink directly inside a node_modules tree bun
17
+ * installs (the root's or a workspace member's, scoped names included) whose
18
+ * target lies outside the project root. The target is resolved against the
19
+ * link's own directory and no further. Everything bun links there resolves
20
+ * inside the root: workspace members by relative path, packages into
21
+ * node_modules/.bun. Following the links further would misclassify: under
22
+ * `globalStore`, each .bun entry is itself a link into the shared install
23
+ * cache, outside every checkout.
24
+ *
25
+ * Nothing is recorded across installs, so the state is the filesystem itself:
26
+ * unlinking a package means removing its link, and the next install puts the
27
+ * lockfile's version there. A link whose target no longer exists is removed
28
+ * before the install, with a warning, so that install puts the lockfile's
29
+ * version in its place.
30
+ *
31
+ * Like secret-references.ts, this is a managed raw script: shell entry imports
32
+ * it before anything is installed, and `smoo monorepo update` loads the copy
33
+ * the nx-plugin ships. Because both use the one implementation, the shell and
34
+ * the command keep the same links.
35
+ */
36
+
37
+ import {
38
+ type Dirent,
39
+ existsSync,
40
+ mkdirSync,
41
+ readdirSync,
42
+ readFileSync,
43
+ readlinkSync,
44
+ rmSync,
45
+ symlinkSync,
46
+ } from 'node:fs';
47
+ import path from 'node:path';
48
+
49
+ interface DeveloperLink {
50
+ /** Where the link is, relative to the project root. */
51
+ readonly path: string;
52
+ /** The link's own text, restored byte for byte. */
53
+ readonly target: string;
54
+ }
55
+
56
+ interface DeveloperLinks {
57
+ readonly live: readonly DeveloperLink[];
58
+ /** Links whose target no longer exists. */
59
+ readonly dangling: readonly DeveloperLink[];
60
+ }
61
+
62
+ /**
63
+ * Runs `install` with every developer link under `root` kept. The links in
64
+ * place when it starts are exactly the links in place when it settles,
65
+ * whether it resolved or rejected, less those that already dangled. It then
66
+ * names them as `reportDeveloperLinks` does.
67
+ */
68
+ export async function keepDeveloperLinks<T>(root: string, install: () => Promise<T>): Promise<T> {
69
+ const { live, dangling } = findDeveloperLinks(root);
70
+ for (const link of dangling) {
71
+ rmSync(path.join(root, link.path), { force: true });
72
+ console.error(`! removed developer link ${link.path}: its target ${resolvedTarget(root, link)} no longer exists`);
73
+ }
74
+ try {
75
+ return await install();
76
+ } finally {
77
+ for (const link of live) {
78
+ restoreLink(root, link);
79
+ }
80
+ describeDeveloperLinks(root, live);
81
+ }
82
+ }
83
+
84
+ /**
85
+ * One stderr line naming each linked package and the checkout it points at,
86
+ * so a shell running a local build says so. Shell entry prints it on every
87
+ * entry that installs nothing. The entry that installs gets the same line
88
+ * from `keepDeveloperLinks`, but devenv's direnv integration runs that entry
89
+ * where its output is not shown. A dangling link is left for the next
90
+ * install to remove.
91
+ */
92
+ export function reportDeveloperLinks(root: string): void {
93
+ describeDeveloperLinks(root, findDeveloperLinks(root).live);
94
+ }
95
+
96
+ /** A package linked from many members is named once, with its count. */
97
+ function describeDeveloperLinks(root: string, links: readonly DeveloperLink[]): void {
98
+ if (links.length === 0) {
99
+ return;
100
+ }
101
+ const counts = new Map<string, number>();
102
+ for (const link of links) {
103
+ const name = link.path.slice(link.path.lastIndexOf('node_modules/') + 'node_modules/'.length);
104
+ const named = `${name} -> ${resolvedTarget(root, link)}`;
105
+ counts.set(named, (counts.get(named) ?? 0) + 1);
106
+ }
107
+ const entries = [...counts].map(([named, count]) => (count === 1 ? named : `${named} (${count} links)`));
108
+ console.error(`linked to local checkouts: ${entries.join(', ')}`);
109
+ }
110
+
111
+ function findDeveloperLinks(root: string): DeveloperLinks {
112
+ const live: DeveloperLink[] = [];
113
+ const dangling: DeveloperLink[] = [];
114
+ for (const tree of nodeModulesTrees(root)) {
115
+ for (const entry of packageLinks(root, tree)) {
116
+ const link: DeveloperLink = { path: entry, target: readlinkSync(path.join(root, entry)) };
117
+ const target = resolvedTarget(root, link);
118
+ const relative = path.relative(root, target);
119
+ if (relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) {
120
+ (existsSync(target) ? live : dangling).push(link);
121
+ }
122
+ }
123
+ }
124
+ return { live, dangling };
125
+ }
126
+
127
+ /**
128
+ * The node_modules trees the last install wrote, relative to the root: the
129
+ * root's and each workspace member's, as bun.lock names them. The lockfile,
130
+ * not the manifest's workspace globs, because it is bun's own record of the
131
+ * members it installed. A missing or unreadable lockfile leaves the root's
132
+ * tree alone; the install that follows reports the lockfile in its own words.
133
+ */
134
+ function nodeModulesTrees(root: string): string[] {
135
+ let lock: unknown;
136
+ try {
137
+ lock = Bun.JSONC.parse(readFileSync(path.join(root, 'bun.lock'), 'utf8'));
138
+ } catch {
139
+ return ['node_modules'];
140
+ }
141
+ const workspaces = typeof lock === 'object' && lock !== null ? Reflect.get(lock, 'workspaces') : undefined;
142
+ const members = typeof workspaces === 'object' && workspaces !== null ? Object.keys(workspaces) : [];
143
+ return [...new Set(['', ...members])].map((member) => path.join(member, 'node_modules'));
144
+ }
145
+
146
+ /** Every symlink a package name could be in `tree`: `name` and `@scope/name`. */
147
+ function packageLinks(root: string, tree: string): string[] {
148
+ const links: string[] = [];
149
+ for (const entry of directoryEntries(path.join(root, tree))) {
150
+ if (entry.name.startsWith('.')) {
151
+ continue;
152
+ }
153
+ if (entry.isSymbolicLink()) {
154
+ links.push(path.join(tree, entry.name));
155
+ } else if (entry.name.startsWith('@') && entry.isDirectory()) {
156
+ for (const scoped of directoryEntries(path.join(root, tree, entry.name))) {
157
+ if (scoped.isSymbolicLink()) {
158
+ links.push(path.join(tree, entry.name, scoped.name));
159
+ }
160
+ }
161
+ }
162
+ }
163
+ return links;
164
+ }
165
+
166
+ function directoryEntries(directory: string): Dirent[] {
167
+ try {
168
+ return readdirSync(directory, { withFileTypes: true });
169
+ } catch (error) {
170
+ if (error instanceof Error && 'code' in error && (error.code === 'ENOENT' || error.code === 'ENOTDIR')) {
171
+ return [];
172
+ }
173
+ throw error;
174
+ }
175
+ }
176
+
177
+ function resolvedTarget(root: string, link: DeveloperLink): string {
178
+ return path.resolve(root, path.dirname(link.path), link.target);
179
+ }
180
+
181
+ /** Puts `link` back unless the install left it as it was. */
182
+ function restoreLink(root: string, link: DeveloperLink): void {
183
+ const at = path.join(root, link.path);
184
+ let current: string | null;
185
+ try {
186
+ current = readlinkSync(at);
187
+ } catch {
188
+ // Nothing there, or no link: either way the install replaced it.
189
+ current = null;
190
+ }
191
+ if (current === link.target) {
192
+ return;
193
+ }
194
+ // What the install put there: a link into node_modules/.bun, or, under the
195
+ // hoisted linker, a copied package directory. Removing a link never
196
+ // follows it. The parent is created again for a dependency the install
197
+ // dropped along with its scope directory.
198
+ rmSync(at, { recursive: true, force: true });
199
+ mkdirSync(path.dirname(at), { recursive: true });
200
+ symlinkSync(link.target, at);
201
+ }
@@ -13,6 +13,7 @@
13
13
  # Every explanation lives out here in Nix comments. Hook bodies are exported as
14
14
  # shell text, so a comment inside one becomes part of an environment variable.
15
15
  {
16
+ config,
16
17
  inputs,
17
18
  lib,
18
19
  pkgs,
@@ -29,12 +30,29 @@
29
30
  rev = "56ab4af42157";
30
31
  hash = "sha256-ebjX+1+9axEqsnZXCRZSumA38gPNdmoz98tMt2oftN4=";
31
32
  };
33
+
34
+ # A repository that enables uv under languages.python gets its uv workspace
35
+ # synced and activated by this contract (enterShell item 5), never by
36
+ # devenv's own python tasks.
37
+ python = config.languages.python;
38
+ uvProject = python.enable && python.uv.enable;
32
39
  in {
33
40
  env = lib.mkMerge [
34
41
  {
35
42
  # Nx otherwise defaults to three workers. Scale to the cores available in each
36
43
  # developer shell or CI runner; explicit --parallel flags still take precedence.
37
44
  NX_PARALLEL = "100%";
45
+ # Every Nx daemon, when it starts, installs nx@latest from the registry
46
+ # into a temporary directory to ask the newest release whether to prompt
47
+ # for Nx Console and whether AI agent configuration is outdated, and
48
+ # `nx configure-ai-agents` and `nx init` do the same. NX_USE_LOCAL answers
49
+ # from the installed nx, so starting Nx installs nothing from the registry.
50
+ # (A daemon still runs `git ls-remote` against GitHub's
51
+ # nrwl/nx-ai-agents-config when an agent has both rules and Nx's MCP
52
+ # configured; a cowshed sandbox runs Nx without a daemon.) It also makes
53
+ # `nx migrate` run with the installed CLI instead of the newest one;
54
+ # `NX_USE_LOCAL=false nx migrate` restores that for the one command.
55
+ NX_USE_LOCAL = "true";
38
56
  TTSC_TYPESCRIPT_GO_DIR = "${typescriptGo}";
39
57
  }
40
58
  # Playwright's downloaded Ubuntu browser has no runtime closure on NixOS
@@ -255,6 +273,16 @@ in {
255
273
  ]
256
274
  ++ lib.optionals pkgs.stdenv.hostPlatform.isLinux [pkgs.chromium];
257
275
 
276
+ # devenv wraps the Python interpreter to find native libraries in
277
+ # `languages.python.libraries`, whose default is this checkout's
278
+ # `.devenv/profile`. That path then lands in the interpreter's store path, the
279
+ # profile that holds it and the uv environment built with it, so every clone
280
+ # evaluates and builds its own interpreter and profile on first entry, and its
281
+ # copied uv environment names another checkout's interpreter. Cleared, the
282
+ # interpreter is one store path in every checkout. devenv still adds the C++
283
+ # runtime; a wheel that needs another library names that library here.
284
+ languages.python.libraries = lib.mkIf uvProject (lib.mkDefault []);
285
+
258
286
  enterShell = lib.mkMerge [
259
287
  # Prologue, in order:
260
288
  #
@@ -264,47 +292,35 @@ in {
264
292
  # use, so a hook and a shell resolve one binary the same way.
265
293
  # 3. ttsc drives the native TypeScript 7 binary while Nx imports the TypeScript
266
294
  # 6 API, so the two must be named separately.
267
- # 4. On a cowshed host, Go and ttsc caches point at the shared store, so every
268
- # workspace reads one warm cache instead of growing its own copy inside its
269
- # image. Without one, ttsc stays in-tree for the CI cache action while Go
270
- # keeps its normal per-user defaults. Both Go caches are content-addressed,
271
- # so sharing them needs no patch — unlike Rust, Go keys on content and flags
272
- # rather than on where the files live. An inherited value always wins so CI
273
- # can place any of these caches itself. GOFLAGS carries -trimpath because it
274
- # is Go's stable way to keep absolute build paths out of the artifact, and
275
- # unlike Rust's trim-paths it costs no cache reuse.
276
- #
277
- # ttsc's plugin builds use the Go it bundles rather than ours, so the
278
- # repository's own Go work and ttsc's plugin builds are two toolchains by
279
- # construction. Placing both caches in the shared store is what keeps that
280
- # from costing a rebuild per workspace.
295
+ # 4. Go and ttsc caches: tooling/direnv/shared-caches.sh places them under
296
+ # the machine's shared caches root when it exists and states why.
297
+ # 5. The shared setup-environment.ts bootstraps repository dependencies. It
298
+ # runs `bun install` — and, for a uv project, `uv sync` — only when that
299
+ # installer's inputs changed since its last successful run, so an
300
+ # unchanged checkout enters in the time it takes to hash a lockfile. It
301
+ # records those inputs, and the managed .envrc watches them, so a shell
302
+ # that direnv keeps loaded re-enters exactly when one of them changes.
281
303
  #
282
- # TTSC_GO_CACHE_DIR and GOCACHE stay separate for ownership, not
283
- # correctness: both caches are content-addressed, so one directory would
284
- # compile the same bytes to the same entries. What sharing loses is an
285
- # owner. ttsc reclaims a Go build cache only when it resolved that
286
- # directory itself — `ttsc clean` takes the cache whose source is
287
- # TTSC_GO_CACHE_DIR and never one whose source is a user GOCACHE, which it
288
- # treats as someone else's property. Pointing ttsc at GOCACHE therefore
289
- # produced a directory ttsc filled and no repository verb could empty,
290
- # measured at 35G here. A dedicated directory gives ttsc's half back to
291
- # `ttsc clean` and leaves GOCACHE holding only Go work this repository does
292
- # itself, which is one module.
304
+ # The uv project environment is devenv's UV_PROJECT_ENVIRONMENT, synced
305
+ # with the interpreter devenv would use and activated here after the
306
+ # sync. It lives under this checkout and names no path of it: uv creates
307
+ # it relocatable, setup-environment.ts rewrites the editable installs of
308
+ # workspace members relative to it, and the interpreter is the same
309
+ # store path everywhere (languages.python.libraries above). A
310
+ # copy-on-write clone copies it along with everything else, installed.
311
+ # devenv's own virtualenv and uv sync tasks are refused below: they
312
+ # activate the environment from its own activation script — which in a
313
+ # clone names the original checkout — before this prologue runs, and key
314
+ # their skip on pyproject.toml alone.
293
315
  #
294
- # That buys ownership, not automatic GC: ttsc prunes opportunistically only
295
- # when it owns the whole cache root, which requires TTSC_CACHE_DIR unset,
296
- # and a pinned shared root is the point of the block below. The trade is
297
- # deliberate — one warm cache every workspace shares, reclaimed by an
298
- # explicit verb, over per-workspace caches that self-trim. Go's own build
299
- # cache trimming belongs to the go command and still applies to both.
300
- # 5. The shared setup-environment.ts bootstraps repository dependencies; a
301
- # failure aborts shell entry instead of yielding a half-working shell.
302
- # Repo-owned enterShell bodies merge after this prologue.
303
- # 6. Shell entry resolves the `shell` group of `smoo.secrets` and nothing
304
- # else. Shell entry happens on every direnv reload and every
305
- # `devenv shell -- <command>`, and a provider command that runs then is a
306
- # credential prompt on every one of them (1Password authorises per
307
- # requesting process lineage, and this one is new each time). A
316
+ # A local install failure is reported and the shell still loads, so the
317
+ # tools to repair it stay available; CI fails. Repo-owned enterShell
318
+ # bodies merge after this prologue.
319
+ # 6. Shell entry resolves the `shell` group of `smoo.secrets`, only when it
320
+ # installs, and nothing else. Shell entry happens on every direnv reload
321
+ # and every `devenv shell -- <command>`, and a provider command that runs
322
+ # then is a credential prompt on every one of them (1Password authorises
323
+ # per requesting process lineage, and this one is new each time). A
308
324
  # credential only one deliberate command needs belongs to that command:
309
325
  # `smoo secrets run <group> <command...>`. The full statement, and the
310
326
  # derivation below, live in tooling/direnv/secret-references.ts.
@@ -383,19 +399,15 @@ in {
383
399
  export TMPDIR="''${TMPDIR:-/tmp}"
384
400
  fi
385
401
  export TTSC_TSGO_BINARY="$PWD/node_modules/@typescript/native/bin/tsc"
386
- if [ -d "$HOME/.cowshed/caches" ]; then
387
- export TTSC_CACHE_DIR="''${TTSC_CACHE_DIR:-$HOME/.cowshed/caches/ttsc}"
388
- export GOCACHE="''${GOCACHE:-$HOME/.cowshed/caches/go/build}"
389
- export GOMODCACHE="''${GOMODCACHE:-$HOME/.cowshed/caches/go/mod}"
390
- mkdir -p "$GOCACHE" "$GOMODCACHE"
391
- else
392
- export TTSC_CACHE_DIR="''${TTSC_CACHE_DIR:-$PWD/.cache/ttsc}"
393
- fi
394
- export TTSC_GO_CACHE_DIR="''${TTSC_GO_CACHE_DIR:-$TTSC_CACHE_DIR/go-build}"
395
- mkdir -p "$TTSC_CACHE_DIR" "$TTSC_GO_CACHE_DIR"
396
- export GOFLAGS="''${GOFLAGS:--trimpath}"
402
+ . "$DEVENV_ROOT/shared-caches.sh" /private/cowshed/caches
397
403
  unset GOROOT
398
- bun "$DEVENV_ROOT/setup-environment.ts" || exit $?
404
+ bun "$DEVENV_ROOT/setup-environment.ts"${lib.optionalString uvProject " --python ${python.package.interpreter}"} || exit $?
405
+ ${lib.optionalString uvProject ''
406
+ if [ -f pyproject.toml ]; then
407
+ export VIRTUAL_ENV="$UV_PROJECT_ENVIRONMENT"
408
+ export PATH="$VIRTUAL_ENV/bin:$PATH"
409
+ fi
410
+ ''}
399
411
  # One socket dir per Nx workspace. DEVENV_RUNTIME is keyed to the devenv
400
412
  # ROOT, so every workspace sharing one devenv - a sibling repository, a
401
413
  # copy-on-write clone, a scratch workspace created inside this shell -
@@ -432,4 +444,16 @@ in {
432
444
  fi
433
445
  '')
434
446
  ];
447
+
448
+ assertions = [
449
+ {
450
+ assertion = !(uvProject && (python.venv.enable || python.uv.sync.enable));
451
+ message = ''
452
+ devenv.smoo.nix syncs and activates the uv project environment itself (enterShell item 5).
453
+ Set languages.python.venv.enable and languages.python.uv.sync.enable to false in devenv.nix:
454
+ devenv's tasks activate the environment from its own activation script, which in a
455
+ copy-on-write clone names the original checkout, and skip the sync while uv.lock changes.
456
+ '';
457
+ }
458
+ ];
435
459
  }
@@ -393,7 +393,9 @@ async function routeSecret(
393
393
  }
394
394
  const requested = group === context.group;
395
395
  if (requested || context.dependsOn.includes(group)) {
396
- if (isNonemptyEnvValue(env.CI)) {
396
+ // A CI runner (GitHub or Forgejo Actions, which sets GITHUB_ACTIONS too), never
397
+ // `CI`: agent harnesses set CI=true on every command they run.
398
+ if (env.GITHUB_ACTIONS === 'true') {
397
399
  return {
398
400
  name,
399
401
  group,