@h-rig/hook-kit 0.0.6-alpha.156 → 0.0.6-alpha.158

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,8 +2,7 @@
2
2
  // packages/hook-kit/src/context.ts
3
3
  import { existsSync, readFileSync } from "fs";
4
4
  import { resolve } from "path";
5
- var RIG_DEFINITION_DIRNAME = "rig";
6
- var RIG_STATE_DIRNAME = ".rig";
5
+ import { RIG_DEFINITION_DIRNAME, RIG_STATE_DIRNAME } from "@rig/contracts";
7
6
  function normalizeBuildConfig(value) {
8
7
  if (!value || typeof value !== "object" || Array.isArray(value)) {
9
8
  return {};
@@ -153,7 +152,8 @@ async function readTaskConfigFromDisk(configPath) {
153
152
  return null;
154
153
  }
155
154
  try {
156
- const content = typeof Bun !== "undefined" ? await Bun.file(configPath).json() : JSON.parse(readFileSync(configPath, "utf-8"));
155
+ const bunGlobal = globalThis.Bun;
156
+ const content = bunGlobal ? await bunGlobal.file(configPath).json() : JSON.parse(readFileSync(configPath, "utf-8"));
157
157
  return isPlainObject(content) ? content : null;
158
158
  } catch {
159
159
  return null;
package/dist/src/guard.js CHANGED
@@ -15,6 +15,7 @@ function escapeRegExp(value) {
15
15
  }
16
16
 
17
17
  // packages/hook-kit/src/context.ts
18
+ import { RIG_DEFINITION_DIRNAME, RIG_STATE_DIRNAME } from "@rig/contracts";
18
19
  function normalizeBuildConfig(value) {
19
20
  if (!value || typeof value !== "object" || Array.isArray(value)) {
20
21
  return {};
package/dist/src/index.js CHANGED
@@ -29,8 +29,7 @@ async function readHookInput() {
29
29
  // packages/hook-kit/src/context.ts
30
30
  import { existsSync, readFileSync as readFileSync2 } from "fs";
31
31
  import { resolve } from "path";
32
- var RIG_DEFINITION_DIRNAME = "rig";
33
- var RIG_STATE_DIRNAME = ".rig";
32
+ import { RIG_DEFINITION_DIRNAME, RIG_STATE_DIRNAME } from "@rig/contracts";
34
33
  function normalizeBuildConfig(value) {
35
34
  if (!value || typeof value !== "object" || Array.isArray(value)) {
36
35
  return {};
@@ -180,7 +179,8 @@ async function readTaskConfigFromDisk(configPath) {
180
179
  return null;
181
180
  }
182
181
  try {
183
- const content = typeof Bun !== "undefined" ? await Bun.file(configPath).json() : JSON.parse(readFileSync2(configPath, "utf-8"));
182
+ const bunGlobal = globalThis.Bun;
183
+ const content = bunGlobal ? await bunGlobal.file(configPath).json() : JSON.parse(readFileSync2(configPath, "utf-8"));
184
184
  return isPlainObject(content) ? content : null;
185
185
  } catch {
186
186
  return null;
@@ -401,7 +401,8 @@ function resolveBunBinaryPath() {
401
401
  if (explicit) {
402
402
  return explicit;
403
403
  }
404
- const bunWhich = typeof Bun !== "undefined" ? Bun.which?.("bun") : undefined;
404
+ const bunGlobal = globalThis.Bun;
405
+ const bunWhich = bunGlobal?.which?.("bun");
405
406
  const pathBun = normalizeExecutablePath(bunWhich?.trim());
406
407
  if (pathBun && !looksLikeRuntimeGateway(pathBun)) {
407
408
  return pathBun;
@@ -4,6 +4,7 @@ import { existsSync, realpathSync } from "fs";
4
4
  import { resolve } from "path";
5
5
 
6
6
  // packages/hook-kit/src/context.ts
7
+ import { RIG_DEFINITION_DIRNAME, RIG_STATE_DIRNAME } from "@rig/contracts";
7
8
  function normalizeBuildConfig(value) {
8
9
  if (!value || typeof value !== "object" || Array.isArray(value)) {
9
10
  return {};
@@ -57,7 +58,8 @@ function resolveBunBinaryPath() {
57
58
  if (explicit) {
58
59
  return explicit;
59
60
  }
60
- const bunWhich = typeof Bun !== "undefined" ? Bun.which?.("bun") : undefined;
61
+ const bunGlobal = globalThis.Bun;
62
+ const bunWhich = bunGlobal?.which?.("bun");
61
63
  const pathBun = normalizeExecutablePath(bunWhich?.trim());
62
64
  if (pathBun && !looksLikeRuntimeGateway(pathBun)) {
63
65
  return pathBun;
package/dist/src/typed.js CHANGED
@@ -55,8 +55,7 @@ function extractToolFilePaths(toolName, input) {
55
55
  // packages/hook-kit/src/context.ts
56
56
  import { existsSync, readFileSync as readFileSync2 } from "fs";
57
57
  import { resolve } from "path";
58
- var RIG_DEFINITION_DIRNAME = "rig";
59
- var RIG_STATE_DIRNAME = ".rig";
58
+ import { RIG_DEFINITION_DIRNAME, RIG_STATE_DIRNAME } from "@rig/contracts";
60
59
  function normalizeBuildConfig(value) {
61
60
  if (!value || typeof value !== "object" || Array.isArray(value)) {
62
61
  return {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@h-rig/hook-kit",
3
- "version": "0.0.6-alpha.156",
3
+ "version": "0.0.6-alpha.158",
4
4
  "type": "module",
5
5
  "description": "Typed hook protocol helpers for Rig plugins materialized by the OMP extension; not a hook control plane.",
6
6
  "license": "UNLICENSED",
@@ -21,7 +21,7 @@
21
21
  "module": "./dist/src/index.js",
22
22
  "types": "./dist/src/index.d.ts",
23
23
  "dependencies": {
24
- "@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.156",
24
+ "@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.158",
25
25
  "effect": "4.0.0-beta.90"
26
26
  }
27
27
  }