@opencode-ai/util 0.0.0-dev-18089 → 0.0.0-dev-18092

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.
@@ -2,5 +2,5 @@ import { Effect, FileSystem, Logger } from "effect";
2
2
  export declare function file(local?: boolean, channel?: string): string;
3
3
  export declare function fileLogger(target?: string, id?: string): Effect.Effect<Logger.Logger<unknown, void>, import("effect/PlatformError").PlatformError, FileSystem.FileSystem | import("effect/Scope").Scope>;
4
4
  export declare function minimumLogLevel(): "Error" | "Warn" | "Info" | "Debug";
5
- export declare function loggers(local?: boolean, channel?: string): (Effect.Effect<Logger.Logger<unknown, void>, import("effect/PlatformError").PlatformError, FileSystem.FileSystem | import("effect/Scope").Scope> | Logger.Logger<unknown, boolean>)[];
5
+ export declare function loggers(local?: boolean, channel?: string): (Logger.Logger<unknown, void> | Effect.Effect<Logger.Logger<unknown, void>, import("effect/PlatformError").PlatformError, FileSystem.FileSystem | import("effect/Scope").Scope>)[];
6
6
  export * as Logging from "./logging.js";
@@ -53,7 +53,11 @@ export function fileLogger(target = file(), id = runID()) {
53
53
  return yield* Logger.toFile(formatter(id), target, { flag: "a" });
54
54
  });
55
55
  }
56
- const stderrLogger = Logger.make((options) => process.stderr.write(formatter().log(options) + "\n"));
56
+ const stderrLogger = Logger.make((options) => {
57
+ if (process.env.OPENCODE_PRINT_LOGS !== "1")
58
+ return;
59
+ process.stderr.write(formatter().log(options) + "\n");
60
+ });
57
61
  export function minimumLogLevel() {
58
62
  const value = process.env.OPENCODE_LOG_LEVEL?.toUpperCase();
59
63
  const levels = {
@@ -65,7 +69,6 @@ export function minimumLogLevel() {
65
69
  return value && value in levels ? levels[value] : levels.INFO;
66
70
  }
67
71
  export function loggers(local = true, channel = "local") {
68
- const logger = fileLogger(file(local, channel));
69
- return process.env.OPENCODE_PRINT_LOGS === "1" ? [logger, stderrLogger] : [logger];
72
+ return [fileLogger(file(local, channel)), stderrLogger];
70
73
  }
71
74
  export * as Logging from "./logging.js";
@@ -0,0 +1,2 @@
1
+ export declare function importModule(_specifier: string): Promise<unknown>;
2
+ export declare function resolveModule(_specifier: string, _directory: string): string;
@@ -0,0 +1,7 @@
1
+ const unavailable = () => new Error("Dynamic module loading is unavailable on workerd");
2
+ export function importModule(_specifier) {
3
+ return Promise.reject(unavailable());
4
+ }
5
+ export function resolveModule(_specifier, _directory) {
6
+ throw unavailable();
7
+ }
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-dev-18089",
4
+ "version": "0.0.0-dev-18092",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -31,7 +31,7 @@
31
31
  "default": "./dist/global-roots.js"
32
32
  },
33
33
  "#runtime-import": {
34
- "workerd": "./dist/runtime/import.bun.js",
34
+ "workerd": "./dist/runtime/import.workerd.js",
35
35
  "bun": "./dist/runtime/import.bun.js",
36
36
  "node": "./dist/runtime/import.node.js",
37
37
  "default": "./dist/runtime/import.bun.js"