@opencode/util 2.0.16 → 2.0.17

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.
@@ -1,3 +1,7 @@
1
1
  import { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner";
2
+ export declare class KilledBySignal extends Error {
3
+ readonly signal: NodeJS.Signals;
4
+ constructor(signal: NodeJS.Signals);
5
+ }
2
6
  export declare const node: import("./effect/layer-node.js").Provider<ChildProcessSpawner, never, import("./effect/layer-node.js").Tag<"global">>;
3
7
  export * as CrossSpawnSpawner from "./cross-spawn-spawner.js";
@@ -67,6 +67,13 @@ const toPlatformError = (method, err, command) => {
67
67
  cause: err,
68
68
  });
69
69
  };
70
+ export class KilledBySignal extends Error {
71
+ signal;
72
+ constructor(signal) {
73
+ super(`Process interrupted due to receipt of signal: '${signal}'`);
74
+ this.signal = signal;
75
+ }
76
+ }
70
77
  const makeCrossSpawnSpawner = Effect.gen(function* () {
71
78
  const fs = yield* FileSystem.FileSystem;
72
79
  const path = yield* Path.Path;
@@ -377,7 +384,8 @@ const makeCrossSpawnSpawner = Effect.gen(function* () {
377
384
  exitCode: Effect.flatMap(completion, ([code, signal]) => {
378
385
  if (Predicate.isNotNull(code))
379
386
  return Effect.succeed(ExitCode(code));
380
- return Effect.fail(toPlatformError("exitCode", new Error(`Process interrupted due to receipt of signal: '${signal}'`), command));
387
+ // Node reports a signal whenever the exit code is null.
388
+ return Effect.fail(toPlatformError("exitCode", new KilledBySignal(signal), command));
381
389
  }),
382
390
  kill: (opts) => stop(command, proc, closed, stopOutput, opts),
383
391
  unref: Effect.sync(() => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode/util",
4
- "version": "2.0.16",
4
+ "version": "2.0.17",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {