@workit-dev/codex 1.8.0 → 1.8.2

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,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // packages/workit-codex/hooks/launcher.ts
4
- import { readFileSync } from "node:fs";
4
+ import { readFileSync, realpathSync, statSync } from "node:fs";
5
5
  import path from "node:path";
6
6
  import { fileURLToPath } from "node:url";
7
7
  var foundNode = process.env.WORKIT_HOOK_NODE_VERSION || process.versions.node;
@@ -46,8 +46,7 @@ var SHELL_TOOLS = new Set(["bash", "unified-exec"]);
46
46
  var WRITE_TOOLS = new Set(["applypatch", "edit", "write"]);
47
47
  var guarded = (text) => {
48
48
  const flat = (s) => s.replaceAll("\\", "/").toLowerCase();
49
- const all = flat(text);
50
- return /issued|workspaces\.json|\.config\/workit/.test(all) || [stateDir, configDir].some((dir) => all.includes(flat(dir(process.env))));
49
+ return [flat(text), text.replace(/['"\\]/g, "").toLowerCase()].some((all) => /issued|approvals|workspaces\.json|\.config\/workit|state\/workit/.test(all) || [stateDir, configDir].some((dir) => all.includes(flat(dir(process.env)))));
51
50
  };
52
51
  var quietEvent = () => {
53
52
  try {
@@ -73,7 +72,19 @@ var quietEvent = () => {
73
72
  return null;
74
73
  if (event === "PostToolUse")
75
74
  return /\bcommit\b/.test(text) ? null : event;
76
- return /\b(?:git|gh|glab)\b/.test(text) || guarded(text) || maybeHeavy(text, value.cwd) ? null : event;
75
+ const writes = /[>]|\b(?:cp|mv|rm|rmdir|mkdir|tee|ln|install|rsync|touch|sed|perl|dd|curl|wget|tar|unzip|truncate|patch|chmod|chown|chgrp|chattr|find|xargs|unlink|g?awk|shred|mkfifo)\b/.test(text) && (/(?:^|[\s=<>|;&("'])(?:~|\/|\$|\.\.)[^\s'"]*[*?[]|\$\{?(?:WORKIT_|XDG_|APPDATA|HOME)/.test(text) || text.split(/[\s;&|()<>`'"]+/).some((word) => {
76
+ const file = path.resolve(String(value.cwd), word);
77
+ try {
78
+ const stat = statSync(file, { throwIfNoEntry: false });
79
+ if (stat?.isFile() && stat.nlink > 1)
80
+ return true;
81
+ const real = stat ? realpathSync(file) : path.join(realpathSync(path.dirname(file)), path.basename(file));
82
+ return real !== file && guarded(real);
83
+ } catch {
84
+ return false;
85
+ }
86
+ }));
87
+ return /\b(?:git|gh|glab|node|tsx|ts-node|bash|sh|zsh|dash|ksh|ruby|perl|php|source)\b|(?:^|[;&|(\n])\s*(?:\w+=\S*\s+)*(?:(?:time|exec|sudo|nice|nohup|env|command|builtin|timeout|stdbuf|if|then|do|while|until|!)\s+(?:-\S+\s+|\d\S*\s+)*)*(?:\.\s+\S|\.{0,2}\/)/.test(text) || guarded(text) || writes || maybeHeavy(text, value.cwd) ? null : event;
77
88
  } catch {
78
89
  return null;
79
90
  }
@@ -86,7 +97,7 @@ if (quiet) {
86
97
  `);
87
98
  } else {
88
99
  try {
89
- const { runCodexHook } = await import("./workit-hook-wwmd24rf.js");
100
+ const { runCodexHook } = await import("./workit-hook-1k0ds68w.js");
90
101
  await runCodexHook([payload]);
91
102
  } catch (error) {
92
103
  const { answerRuntimeFailure } = await import("./workit-hook-9k8dtngs.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workit-dev/codex",
3
- "version": "1.8.0",
3
+ "version": "1.8.2",
4
4
  "private": false,
5
5
  "description": "Workit Codex CLI/desktop plugin — shared MCP transport, hooks, method skills, and verifier/reviewer/implementer agents",
6
6
  "keywords": [
@@ -41,8 +41,8 @@
41
41
  "build": "bun scripts/build.ts"
42
42
  },
43
43
  "devDependencies": {
44
- "@workit-dev/core": "^1.8.0",
45
- "@workit-dev/mcp": "^1.8.0"
44
+ "@workit-dev/core": "^1.8.2",
45
+ "@workit-dev/mcp": "^1.8.2"
46
46
  },
47
47
  "engines": {
48
48
  "node": ">=24"