@workit-dev/codex 2.27.6 → 2.27.8
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.
package/dist/launch-mcp.js
CHANGED
|
@@ -33075,6 +33075,54 @@ var gap = (part) => ({ workit: null, gap: part });
|
|
|
33075
33075
|
var READ = new Map;
|
|
33076
33076
|
var NOT_PLAIN = gap("a ytrack call that is not a plain command of its own (a wrapper, loop, substitution or script around it can change or repeat it)");
|
|
33077
33077
|
|
|
33078
|
+
// packages/workit-core/src/hooks/hook-entry.ts
|
|
33079
|
+
var RUNNERS2 = new Set([
|
|
33080
|
+
"node",
|
|
33081
|
+
"nodejs",
|
|
33082
|
+
"bun",
|
|
33083
|
+
"deno",
|
|
33084
|
+
"tsx",
|
|
33085
|
+
"ts-node",
|
|
33086
|
+
"sh",
|
|
33087
|
+
"bash",
|
|
33088
|
+
"zsh",
|
|
33089
|
+
"dash",
|
|
33090
|
+
"ksh",
|
|
33091
|
+
"fish",
|
|
33092
|
+
"source",
|
|
33093
|
+
"."
|
|
33094
|
+
]);
|
|
33095
|
+
var PACKAGE_RUNNERS2 = new Set(["npx", "bunx", "pnpx"]);
|
|
33096
|
+
var NO_RUN = new Set([
|
|
33097
|
+
"build",
|
|
33098
|
+
"test",
|
|
33099
|
+
"fmt",
|
|
33100
|
+
"lint",
|
|
33101
|
+
"check",
|
|
33102
|
+
"doc",
|
|
33103
|
+
"info",
|
|
33104
|
+
"install",
|
|
33105
|
+
"add",
|
|
33106
|
+
"pm"
|
|
33107
|
+
]);
|
|
33108
|
+
var MORE_WRAPPERS = new Set(["strace", "ltrace", "watch", "unshare", "firejail", "xargs", "&"]);
|
|
33109
|
+
var KEYWORDS2 = new Set([
|
|
33110
|
+
"{",
|
|
33111
|
+
"}",
|
|
33112
|
+
"if",
|
|
33113
|
+
"then",
|
|
33114
|
+
"elif",
|
|
33115
|
+
"else",
|
|
33116
|
+
"fi",
|
|
33117
|
+
"while",
|
|
33118
|
+
"until",
|
|
33119
|
+
"do",
|
|
33120
|
+
"done",
|
|
33121
|
+
"esac",
|
|
33122
|
+
"!"
|
|
33123
|
+
]);
|
|
33124
|
+
var READERS2 = new Set(("cat less more head tail ls dir stat file wc grep egrep fgrep rg ag diff cmp sha256sum md5sum " + "shasum du bat echo printf cp mv rm chmod touch mkdir realpath readlink dirname basename tee " + "oxfmt oxlint prettier eslint tsc gh jq sort uniq cut tr nl od xxd hexdump strings code vim " + "nano sed get-content gc type select-string get-childitem test-path").split(" "));
|
|
33125
|
+
|
|
33078
33126
|
// packages/workit-core/src/hooks/identity-env.ts
|
|
33079
33127
|
var NAMES = "WORKIT_(?:AGENT_ID|HOST|SESSION_ID|SESSION_TOKEN)";
|
|
33080
33128
|
var HOST_NAMES = "(?:OPENCODE_SESSION_ID|PI_SESSION_ID|CODEX_THREAD_ID|CLAUDECODE|CLAUDE_CODE_ENTRYPOINT)";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// packages/workit-core/src/hooks/hook-entry-hint.ts
|
|
4
|
+
var HOOK_ENTRY_TEXT = /workit-hook|workit-(?:codex|cursor)-hook|session-start|launch(?:-runtime)?\.mjs|\b(?:run|hook|launcher)\.ts\b|PLUGIN_ROOT|@workit-dev\//u;
|
|
5
|
+
var RUNS_SCRIPT = /(?:^|[\s;&|(`])(?:\S*[\\/])?(?:node|bunx?|deno|npx|pnpx|tsx|ts-node)(?:\.exe)?\s[^\n;&|]*(?:[*?[$`]|\.[cm]?[jt]s\b)/u;
|
|
6
|
+
var REMOVES_ABOVE = /\b(?:rm|rmdir|rd|mv|unlink|shred|rsync|remove-item|move-item|ri|mi|del|erase)\b[^\n;&|]*\s(?:\.{1,2}(?:[\\/\s]|$)|[~/$*?]|[A-Za-z]:)|\bfind\b[^\n;&|]*\s-(?:delete|exec)/iu;
|
|
7
|
+
var mayHitHookGuard = (text) => {
|
|
8
|
+
const bare = text.replace(/['"\\]/gu, "");
|
|
9
|
+
return [text, bare].some((all) => HOOK_ENTRY_TEXT.test(all) || RUNS_SCRIPT.test(all) || REMOVES_ABOVE.test(all));
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
mayHitHookGuard
|
|
13
|
+
};
|