log-llm-config-staging 1.4.1 → 1.4.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.
|
@@ -43,6 +43,8 @@ export function normalizeAgentToken(raw) {
|
|
|
43
43
|
return 'copilot';
|
|
44
44
|
if (s === 'opencode')
|
|
45
45
|
return 'opencode';
|
|
46
|
+
if (s === 'codex')
|
|
47
|
+
return 'codex';
|
|
46
48
|
return '';
|
|
47
49
|
}
|
|
48
50
|
function currentAgentFromEnv() {
|
|
@@ -58,6 +60,8 @@ function currentAgentFromEnv() {
|
|
|
58
60
|
return 'copilot';
|
|
59
61
|
if (hookType === 'opencode')
|
|
60
62
|
return 'opencode';
|
|
63
|
+
if (hookType === 'codex')
|
|
64
|
+
return 'codex';
|
|
61
65
|
return 'claude';
|
|
62
66
|
}
|
|
63
67
|
function targetsCurrentAgent(entry, agent) {
|
|
@@ -6,7 +6,7 @@ function normalizeToken(raw) {
|
|
|
6
6
|
return 'claude';
|
|
7
7
|
if (s === 'github_copilot')
|
|
8
8
|
return 'copilot';
|
|
9
|
-
if (s === 'cursor' || s === 'claude' || s === 'copilot' || s === 'opencode')
|
|
9
|
+
if (s === 'cursor' || s === 'claude' || s === 'copilot' || s === 'opencode' || s === 'codex')
|
|
10
10
|
return s;
|
|
11
11
|
// Legacy hooks set OPTIMUS_AGENT=Cursor (display casing)
|
|
12
12
|
if (raw.trim() === 'Cursor')
|
|
@@ -24,5 +24,7 @@ export function resolveHookTypeFromEnv(env = process.env) {
|
|
|
24
24
|
return 'copilot';
|
|
25
25
|
if (token === 'opencode')
|
|
26
26
|
return 'opencode';
|
|
27
|
+
if (token === 'codex')
|
|
28
|
+
return 'codex';
|
|
27
29
|
return 'claude';
|
|
28
30
|
}
|
|
@@ -36,6 +36,8 @@ function currentAgentFromEnv() {
|
|
|
36
36
|
return 'copilot';
|
|
37
37
|
if (override === 'opencode')
|
|
38
38
|
return 'opencode';
|
|
39
|
+
if (override === 'codex')
|
|
40
|
+
return 'codex';
|
|
39
41
|
if (override === 'claude' || override === 'claude_desktop')
|
|
40
42
|
return 'claude';
|
|
41
43
|
const hookType = normalizeAgentToken(process.env.OPTIMUS_HOOK_TYPE);
|
|
@@ -45,6 +47,8 @@ function currentAgentFromEnv() {
|
|
|
45
47
|
return 'copilot';
|
|
46
48
|
if (hookType === 'opencode')
|
|
47
49
|
return 'opencode';
|
|
50
|
+
if (hookType === 'codex')
|
|
51
|
+
return 'codex';
|
|
48
52
|
return 'claude';
|
|
49
53
|
}
|
|
50
54
|
/** Spawn each trusted command detached (same pattern as former compliance_prompt_gate fireRestartCommands). */
|
package/package.json
CHANGED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* npm/npx --package=... sets lifecycle env vars that break unrelated scoped `npx @scope/pkg`
|
|
3
|
-
* (e.g. MCP servers). Strip before spawning shells that may reopen Cursor or run other npx.
|
|
4
|
-
*/
|
|
5
|
-
export const NPM_EXEC_POLLUTION_KEYS = [
|
|
6
|
-
'npm_command',
|
|
7
|
-
'npm_config_local_prefix',
|
|
8
|
-
'npm_config_package',
|
|
9
|
-
'npm_lifecycle_event',
|
|
10
|
-
'npm_lifecycle_script',
|
|
11
|
-
'npm_lifecycle_inject_node',
|
|
12
|
-
'npm_package_json',
|
|
13
|
-
'npm_execpath',
|
|
14
|
-
'npm_config_yes',
|
|
15
|
-
'npm_config_node_gyp',
|
|
16
|
-
'npm_config_npm_version',
|
|
17
|
-
'npm_config_user_agent',
|
|
18
|
-
'NPM_COMMAND',
|
|
19
|
-
'NPM_CONFIG_LOCAL_PREFIX',
|
|
20
|
-
'NPM_CONFIG_PACKAGE',
|
|
21
|
-
'NPM_LIFECYCLE_EVENT',
|
|
22
|
-
'NPM_LIFECYCLE_SCRIPT',
|
|
23
|
-
'NPM_EXECPATH',
|
|
24
|
-
'NPM_CONFIG_YES',
|
|
25
|
-
];
|
|
26
|
-
export function envWithoutNpmExecPollution(env) {
|
|
27
|
-
const clean = { ...env };
|
|
28
|
-
for (const key of NPM_EXEC_POLLUTION_KEYS) {
|
|
29
|
-
delete clean[key];
|
|
30
|
-
}
|
|
31
|
-
return clean;
|
|
32
|
-
}
|
|
33
|
-
/** Bash prefix: unset lifecycle vars before running npx in deferred restart shells. */
|
|
34
|
-
export const DEFERRED_RESTART_UNSET_NPM_ENV = 'unset npm_command npm_config_local_prefix npm_config_package npm_lifecycle_event ' +
|
|
35
|
-
'npm_lifecycle_script npm_lifecycle_inject_node npm_package_json npm_execpath npm_config_yes ' +
|
|
36
|
-
'npm_config_node_gyp npm_config_npm_version npm_config_user_agent ' +
|
|
37
|
-
'NPM_COMMAND NPM_CONFIG_LOCAL_PREFIX NPM_CONFIG_PACKAGE NPM_LIFECYCLE_EVENT NPM_LIFECYCLE_SCRIPT NPM_EXECPATH 2>/dev/null; ';
|
|
38
|
-
/** Bash wrapper for npx in deferred restart (env -u strips inherited npm exec state). */
|
|
39
|
-
export const DEFERRED_RESTART_NPX = 'env -u npm_command -u npm_config_local_prefix -u npm_config_package -u npm_lifecycle_event ' +
|
|
40
|
-
'-u npm_lifecycle_script -u npm_lifecycle_inject_node -u npm_package_json -u npm_execpath npx';
|