@opencode-ai/util 0.0.0-beta-17498 → 0.0.0-beta-17570

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.
@@ -213,7 +213,7 @@ const makeCrossSpawnSpawner = Effect.gen(function* () {
213
213
  stderr = Stream.transduce(stderr, err.stream);
214
214
  return { stdout, stderr, all: Stream.merge(stdout, stderr) };
215
215
  };
216
- const spawn = (command, opts) => Effect.callback((resume) => {
216
+ const launchProcess = (command, opts) => Effect.callback((resume) => {
217
217
  const signal = Deferred.makeUnsafe();
218
218
  const proc = launch(command.command, command.args, opts);
219
219
  let end = false;
@@ -237,6 +237,10 @@ const makeCrossSpawnSpawner = Effect.gen(function* () {
237
237
  proc.kill("SIGTERM");
238
238
  });
239
239
  });
240
+ const spawn = Effect.fnUntraced(function* (command, opts) {
241
+ yield* Effect.logInfo("spawning process", { command: command.command, args: command.args, cwd: opts.cwd });
242
+ return yield* launchProcess(command, opts);
243
+ });
240
244
  const killGroup = (command, proc, signal) => {
241
245
  if (globalThis.process.platform === "win32") {
242
246
  return Effect.callback((resume) => {
@@ -11,17 +11,17 @@ export var EffectFlock;
11
11
  // ---------------------------------------------------------------------------
12
12
  // Errors
13
13
  // ---------------------------------------------------------------------------
14
- class LockTimeoutError extends Schema.TaggedErrorClass()("LockTimeoutError", {
14
+ class LockTimeoutError extends Schema.TaggedError()("LockTimeoutError", {
15
15
  key: Schema.String,
16
16
  }) {
17
17
  }
18
18
  EffectFlock.LockTimeoutError = LockTimeoutError;
19
- class LockCompromisedError extends Schema.TaggedErrorClass()("LockCompromisedError", {
19
+ class LockCompromisedError extends Schema.TaggedError()("LockCompromisedError", {
20
20
  detail: Schema.String,
21
21
  }) {
22
22
  }
23
23
  EffectFlock.LockCompromisedError = LockCompromisedError;
24
- class ReleaseError extends Schema.TaggedErrorClass()("ReleaseError", {
24
+ class ReleaseError extends Schema.TaggedError()("ReleaseError", {
25
25
  detail: Schema.String,
26
26
  cause: Schema.optional(Schema.Defect()),
27
27
  }) {
@@ -30,7 +30,7 @@ export var EffectFlock;
30
30
  }
31
31
  }
32
32
  /** Internal: signals "lock is held, retry later". Never leaks to callers. */
33
- class NotAcquired extends Schema.TaggedErrorClass()("NotAcquired", {}) {
33
+ class NotAcquired extends Schema.TaggedError()("NotAcquired", {}) {
34
34
  }
35
35
  // ---------------------------------------------------------------------------
36
36
  // Timing defaults
package/dist/fs-util.js CHANGED
@@ -10,7 +10,7 @@ import { makeGlobalNode } from "./effect/app-node.js";
10
10
  import { filesystem } from "./effect/app-node-platform.js";
11
11
  export var FSUtil;
12
12
  (function (FSUtil) {
13
- class FileSystemError extends Schema.TaggedErrorClass()("FileSystemError", {
13
+ class FileSystemError extends Schema.TaggedError()("FileSystemError", {
14
14
  method: Schema.String,
15
15
  cause: Schema.optional(Schema.Defect()),
16
16
  }) {
package/dist/npm.js CHANGED
@@ -11,7 +11,7 @@ import { LayerNode } from "./effect/layer-node.js";
11
11
  import { makeRuntime } from "./effect/runtime.js";
12
12
  import { NpmConfig } from "./npm-config.js";
13
13
  import { resolveModule } from "#runtime-import";
14
- export class InstallFailedError extends Schema.TaggedErrorClass()("NpmInstallFailedError", {
14
+ export class InstallFailedError extends Schema.TaggedError()("NpmInstallFailedError", {
15
15
  add: Schema.Array(Schema.String).pipe(Schema.optional),
16
16
  dir: Schema.String,
17
17
  cause: Schema.optional(Schema.Defect()),
@@ -13,6 +13,6 @@ export declare function resource(app?: App): {
13
13
  serviceVersion: string;
14
14
  attributes: Record<string, string>;
15
15
  };
16
- export declare function loggers(options: Options | undefined, app: App): Effect.Effect<import("effect/Logger").Logger<unknown, void>, never, import("effect/unstable/http/HttpClient").HttpClient | Scope.Scope | import("effect/unstable/observability/OtlpSerialization").OtlpSerialization>[];
16
+ export declare function loggers(options: Options | undefined, app: App): Effect.Effect<import("effect/Logger").Logger<unknown, void>, never, import("effect/unstable/http/HttpClient").HttpClient | Scope.Scope | import("effect/unstable/observability/OtlpExporter").Flusher | import("effect/unstable/observability/OtlpSerialization").OtlpSerialization>[];
17
17
  export declare const tracingLayer: (options: Options | undefined, app: App) => Effect.Effect<Layer.Layer<never, never, never>, never, never>;
18
18
  export * as Otlp from "./otlp.js";
@@ -3,7 +3,7 @@ import * as NodeFileSystem from "@effect/platform-node/NodeFileSystem";
3
3
  import { LayerNode } from "./effect/layer-node.js";
4
4
  import { Effect, Layer, Logger, References, Schema } from "effect";
5
5
  import { FetchHttpClient } from "effect/unstable/http";
6
- import { OtlpSerialization } from "effect/unstable/observability";
6
+ import { OtlpExporter, OtlpSerialization } from "effect/unstable/observability";
7
7
  import { Logging } from "./observability/logging.js";
8
8
  import { Otlp } from "./observability/otlp.js";
9
9
  export const Options = Schema.Struct({
@@ -24,7 +24,7 @@ export function layer(options = {
24
24
  };
25
25
  const local = Logger.layer(Logging.loggers(app.channel === "local", app.channel), { mergeWithExisting: false }).pipe(Layer.provide(NodeFileSystem.layer), Layer.orDie, Layer.merge(Layer.succeed(References.MinimumLogLevel, Logging.minimumLogLevel())));
26
26
  return Layer.unwrap(Effect.gen(function* () {
27
- const logs = Logger.layer([...Logging.loggers(app.channel === "local", app.channel), ...Otlp.loggers(options, app)], { mergeWithExisting: false }).pipe(Layer.provide(NodeFileSystem.layer), Layer.provide(OtlpSerialization.layerJson), Layer.provide(FetchHttpClient.layer), Layer.orDie, Layer.merge(Layer.succeed(References.MinimumLogLevel, Logging.minimumLogLevel())));
27
+ const logs = Logger.layer([...Logging.loggers(app.channel === "local", app.channel), ...Otlp.loggers(options, app)], { mergeWithExisting: false }).pipe(Layer.provide(NodeFileSystem.layer), Layer.provide(OtlpSerialization.layerJson), Layer.provide(FetchHttpClient.layer), Layer.provide(OtlpExporter.layerFlusher), Layer.orDie, Layer.merge(Layer.succeed(References.MinimumLogLevel, Logging.minimumLogLevel())));
28
28
  return Layer.merge(logs, yield* Otlp.tracingLayer(options, app));
29
29
  })).pipe(Layer.catchCause(() => local));
30
30
  }
package/dist/patch.js CHANGED
@@ -1,14 +1,14 @@
1
1
  export * as Patch from "./patch.js";
2
2
  import { Result, Schema } from "effect";
3
3
  import { Bom } from "./bom.js";
4
- export class BoundaryError extends Schema.TaggedErrorClass()("Patch.BoundaryError", {
4
+ export class BoundaryError extends Schema.TaggedError()("Patch.BoundaryError", {
5
5
  boundary: Schema.Literals(["first", "last"]),
6
6
  }) {
7
7
  get message() {
8
8
  return `The ${this.boundary} line of the patch must be '${this.boundary === "first" ? "*** Begin Patch" : "*** End Patch"}'`;
9
9
  }
10
10
  }
11
- export class InvalidHunkError extends Schema.TaggedErrorClass()("Patch.InvalidHunkError", {
11
+ export class InvalidHunkError extends Schema.TaggedError()("Patch.InvalidHunkError", {
12
12
  line: Schema.String,
13
13
  lineNumber: Schema.Number,
14
14
  reason: Schema.optional(Schema.String),
package/dist/process.js CHANGED
@@ -3,7 +3,7 @@ import { ChildProcess } from "effect/unstable/process";
3
3
  import { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner";
4
4
  import { CrossSpawnSpawner } from "./cross-spawn-spawner.js";
5
5
  import { makeGlobalNode } from "./effect/app-node.js";
6
- export class AppProcessError extends Schema.TaggedErrorClass()("AppProcessError", {
6
+ export class AppProcessError extends Schema.TaggedError()("AppProcessError", {
7
7
  command: Schema.String,
8
8
  exitCode: Schema.optional(Schema.Number),
9
9
  stderr: Schema.optional(Schema.String),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode-ai/util",
4
- "version": "0.0.0-beta-17498",
4
+ "version": "0.0.0-beta-17570",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -43,8 +43,8 @@
43
43
  "typecheck": "tsgo --noEmit"
44
44
  },
45
45
  "dependencies": {
46
- "@effect/opentelemetry": "4.0.0-beta.101",
47
- "@effect/platform-node": "4.0.0-beta.101",
46
+ "@effect/opentelemetry": "4.0.0-beta.107",
47
+ "@effect/platform-node": "4.0.0-beta.107",
48
48
  "@npmcli/arborist": "9.4.0",
49
49
  "@npmcli/config": "10.8.1",
50
50
  "@opentelemetry/api": "1.9.0",
@@ -53,7 +53,7 @@
53
53
  "@opentelemetry/sdk-trace-base": "2.6.1",
54
54
  "@opentelemetry/sdk-trace-node": "2.6.1",
55
55
  "cross-spawn": "7.0.6",
56
- "effect": "4.0.0-beta.101",
56
+ "effect": "4.0.0-beta.107",
57
57
  "glob": "13.0.5",
58
58
  "mime-types": "3.0.2",
59
59
  "minimatch": "10.2.5",