@workit-dev/codex 2.25.4 → 2.25.5

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,6 +1,6 @@
1
1
  {
2
2
  "name": "workit",
3
- "version": "2.25.4",
3
+ "version": "2.25.5",
4
4
  "description": "Adaptive engineering workflow rails for Codex",
5
5
  "author": {
6
6
  "name": "BrainerVirus"
@@ -14725,6 +14725,22 @@ var powershellScript = (words, stdin) => {
14725
14725
  }
14726
14726
  return null;
14727
14727
  };
14728
+ var powershellOpaque = (words) => {
14729
+ for (let index = 1;index < words.length; index++) {
14730
+ const flag = /^[-/]+(.+)/.exec(words[index])?.[1].toLowerCase();
14731
+ if (flag === undefined)
14732
+ return !/powershell/i.test(words[0]);
14733
+ if (flag === "e" || flag === "ec" || flag.length >= 2 && "encodedcommand".startsWith(flag))
14734
+ return true;
14735
+ if ("command".startsWith(flag) || flag === "cwa" || flag.startsWith("commandwith"))
14736
+ return false;
14737
+ if (flag === "f" || flag === "file")
14738
+ return true;
14739
+ if (POWERSHELL_VALUES.test(`-${flag}`))
14740
+ index++;
14741
+ }
14742
+ return false;
14743
+ };
14728
14744
  var cmdScript = (words) => {
14729
14745
  const at = words.findIndex((word, index) => index > 0 && /^\/[ck]$/i.test(word));
14730
14746
  if (at > 0)
@@ -17822,11 +17838,17 @@ var editsOf = (input) => {
17822
17838
  case "cp":
17823
17839
  case "ln":
17824
17840
  case "install": {
17825
- const into = valueOf(args, /^(?:-t|--target-directory=?)(.*)$/s);
17841
+ const into = valueOf(args, /^(?:-[a-zA-Z]*t|--target-directory=?)(.*)$/s);
17826
17842
  if (into !== undefined)
17827
17843
  return [into];
17828
- const last = operands(args).at(-1);
17829
- return last ? [last] : null;
17844
+ const files = operands(args);
17845
+ if (name === "ln" && files.length === 1)
17846
+ return [path30.basename(files[0])];
17847
+ return files.length ? [files.at(-1)] : null;
17848
+ }
17849
+ case "mklink": {
17850
+ const link = args.find((arg) => !/^\/[dhj]$/i.test(arg));
17851
+ return link ? [link] : null;
17830
17852
  }
17831
17853
  case "dd":
17832
17854
  return args.filter((item) => item.startsWith("of=")).map((item) => item.slice(3));
@@ -17855,10 +17877,15 @@ var editsOf = (input) => {
17855
17877
  case "del":
17856
17878
  case "copy-item":
17857
17879
  case "move-item": {
17858
- const flag = args.findIndex((item) => /^-(?:path|filepath|literalpath|destination)$/i.test(item));
17859
- if (flag >= 0)
17860
- return args[flag + 1] ? [args[flag + 1]] : null;
17861
- const files = operands(args);
17880
+ const named = valueOf(args, /^-(?:path|filepath|literalpath|destination)(?::(.+))?$/is);
17881
+ if (named !== undefined || args.some((item) => /^-(?:path|filepath|literalpath|destination)$/i.test(item)))
17882
+ return named ? [named] : null;
17883
+ const files = args.filter((item, at) => !item.startsWith("-") && !/^-(?:itemtype|type|value|target|encoding|name)$/i.test(args[at - 1] ?? ""));
17884
+ if (files.length === 0 && (name === "new-item" || name === "ni")) {
17885
+ const leaf = valueOf(args, /^-name(?::(.+))?$/is);
17886
+ if (leaf)
17887
+ return [leaf];
17888
+ }
17862
17889
  if (name === "move-item")
17863
17890
  return files.length ? files : null;
17864
17891
  const file = name === "copy-item" ? files.at(-1) : files[0];
@@ -18116,7 +18143,8 @@ var shellScript3 = (words) => {
18116
18143
  }
18117
18144
  return null;
18118
18145
  };
18119
- var XARGS_VALUE = /^-[IinLPdsEa]$/;
18146
+ var CMD_VAR = /%[^%\s]+%|![^!\s]+!/;
18147
+ var XARGS_VALUE = /^-[InLPdsEa]$/;
18120
18148
  var runsWriter = (words) => {
18121
18149
  const filled = [
18122
18150
  ...words.filter((word) => word !== ";" && word !== "+").map((word) => word.includes("{}") ? "eval" : word),
@@ -18129,13 +18157,17 @@ var opaqueWrites = (input, scriptOf = (index) => input[index], fed, loads = fals
18129
18157
  const words = pastLead(input);
18130
18158
  if (words[0] === "xargs") {
18131
18159
  let at = 1;
18132
- while (words[at]?.startsWith("-"))
18133
- at += XARGS_VALUE.test(words[at]) ? 2 : 1;
18134
- return runsWriter(words.slice(at)) ? ["."] : null;
18160
+ let token = "{}";
18161
+ for (;words[at]?.startsWith("-"); at += XARGS_VALUE.test(words[at]) ? 2 : 1)
18162
+ token = words[at] === "-I" ? words[at + 1] ?? token : /^-[Ii](.+)|^--replace=(.+)/s.exec(words[at])?.slice(1).join("") ?? token;
18163
+ const named = pastLead(words.slice(at))[0] ?? "";
18164
+ return named.includes(token) || named.includes("{}") || runsWriter(words.slice(at)) ? ["."] : null;
18135
18165
  }
18136
18166
  const [verb, ...args] = words;
18137
- const name = (verb?.split(/[\\/]/).at(-1) ?? "").toLowerCase();
18138
- if (/^(?:flock|watch|ssh|parallel|script|su|runuser|strace)$/.test(name))
18167
+ const name = (verb?.split(/[\\/]/).at(-1) ?? "").toLowerCase().replace(/\.exe$/, "");
18168
+ if (/^(?:flock|watch|ssh|parallel|script|su|runuser|strace|iex|invoke-expression)$/.test(name) || (name === "pwsh" || name === "powershell") && powershellOpaque(words))
18169
+ return ["."];
18170
+ if (name === "mklink" && args.some((arg) => CMD_VAR.test(arg)))
18139
18171
  return ["."];
18140
18172
  const files = operands(args);
18141
18173
  const has = (pattern) => args.some((arg) => pattern.test(arg));
@@ -18409,7 +18441,7 @@ var PATHS = /(?<![\w.~:/$-])(?:~\/|\/|[A-Za-z]:\/|\.\.(?:\/|$))[^\s'"`$),;:*?<>|
18409
18441
  var pathsIn = (text) => [...text.matchAll(PATHS)].map((match) => match[0]);
18410
18442
  var linkSources = (args, at) => {
18411
18443
  const names = operands([...args]);
18412
- const into = args.indexOf("-t");
18444
+ const into = args.findIndex((arg) => /^-[a-zA-Z]*t$/.test(arg));
18413
18445
  const dest = into >= 0 ? args[into + 1] : names.length > 1 ? names.at(-1) : ".";
18414
18446
  const sources = names.filter((name, index) => into >= 0 ? name !== dest : index < names.length - 1 || names.length === 1);
18415
18447
  const target = dest === undefined ? null : at(dest);
@@ -18992,8 +19024,10 @@ var segmentTargets = (cwd, command, dialect, depth = 0, strict = false, inherite
18992
19024
  targets.push(...segmentTargets(runIn, inner, "posix", depth + 1, strict, runIn === dir ? vars : unPwd()));
18993
19025
  const windows = strict && depth < 4 ? windowsScript(words, segment.stdin?.join(`
18994
19026
  `)) : null;
19027
+ const cmd = /^cmd(?:\.exe)?$/.test(commandName2(pastLead(words)[0] ?? ""));
18995
19028
  if (windows !== null && dir !== undefined)
18996
- targets.push(...segmentTargets(dir, windows, "powershell", depth + 1, strict, vars));
19029
+ for (const file of segmentTargets(dir, windows, "powershell", depth + 1, strict, vars))
19030
+ targets.push(cmd && CMD_VAR.test(file) ? placeholderIn(dir, `${OPAQUE_TARGET}cmd`) : file);
18997
19031
  const bare = strict && depth < 4 ? unwrapped2(words) : null;
18998
19032
  if (bare?.length && dir !== undefined)
18999
19033
  targets.push(...segmentTargets(dir, bare.flatMap((word) => expansions(word, vars, loops)).map(quoteWord2).join(" "), "posix", depth + 1, strict, vars));
@@ -101,7 +101,7 @@ if (quiet) {
101
101
  `);
102
102
  } else {
103
103
  try {
104
- const { runCodexHook } = await import("./workit-hook-sbgw8r70.js");
104
+ const { runCodexHook } = await import("./workit-hook-rwd65mxz.js");
105
105
  await runCodexHook([payload]);
106
106
  } catch (error) {
107
107
  const { answerRuntimeFailure } = await import("./workit-hook-2j7nwxvz.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workit-dev/codex",
3
- "version": "2.25.4",
3
+ "version": "2.25.5",
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": "^2.25.4",
45
- "@workit-dev/mcp": "^2.25.4"
44
+ "@workit-dev/core": "^2.25.5",
45
+ "@workit-dev/mcp": "^2.25.5"
46
46
  },
47
47
  "engines": {
48
48
  "node": ">=24"