shieldcortex 3.2.3 → 3.3.1
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/README.md +4 -1
- package/dashboard/.next/standalone/dashboard/.next/BUILD_ID +1 -1
- package/dashboard/.next/standalone/dashboard/.next/build-manifest.json +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.html +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/index.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/index.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/_full.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/pages/404.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/pages/500.html +2 -2
- package/dist/audit/mcp-config-scanner.js +44 -15
- package/dist/defence/trust/env-detector.d.ts +4 -3
- package/dist/defence/trust/env-detector.js +22 -4
- package/dist/index.d.ts +3 -0
- package/dist/index.js +11 -1
- package/dist/setup/codex.d.ts +11 -0
- package/dist/setup/codex.js +161 -0
- package/dist/setup/quickstart.js +15 -3
- package/package.json +4 -2
- /package/dashboard/.next/standalone/dashboard/.next/static/{S6fGQSuQ43LV2sjEMNTwk → 1DopxlQTqrgksB54lTtfT}/_buildManifest.js +0 -0
- /package/dashboard/.next/standalone/dashboard/.next/static/{S6fGQSuQ43LV2sjEMNTwk → 1DopxlQTqrgksB54lTtfT}/_clientMiddlewareManifest.json +0 -0
- /package/dashboard/.next/standalone/dashboard/.next/static/{S6fGQSuQ43LV2sjEMNTwk → 1DopxlQTqrgksB54lTtfT}/_ssgManifest.js +0 -0
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import type { DefenceSource } from '../types.js';
|
|
12
12
|
export interface EnvDetectionResult {
|
|
13
13
|
source: DefenceSource;
|
|
14
|
-
method: 'env:CLAUDE_CODE_ENTRYPOINT' | 'env:CLAUDE_AGENT_CONTEXT' | 'env:SHIELDCORTEX_AGENT_SOURCE' | 'default';
|
|
14
|
+
method: 'env:CLAUDE_CODE_ENTRYPOINT' | 'env:CLAUDE_AGENT_CONTEXT' | 'env:CODEX_INTERNAL_ORIGINATOR_OVERRIDE' | 'env:CODEX_THREAD_ID' | 'env:SHIELDCORTEX_AGENT_SOURCE' | 'default';
|
|
15
15
|
confidence: 'high' | 'medium' | 'low';
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
@@ -21,8 +21,9 @@ export interface EnvDetectionResult {
|
|
|
21
21
|
* 1. SHIELDCORTEX_AGENT_SOURCE — explicit override (e.g. "agent:user-spawned>task-1")
|
|
22
22
|
* 2. CLAUDE_CODE_ENTRYPOINT=subagent — Claude Code sub-agent
|
|
23
23
|
* 3. CLAUDE_AGENT_CONTEXT — generic agent context marker
|
|
24
|
-
* 4.
|
|
25
|
-
* 5.
|
|
24
|
+
* 4. Codex origin / thread vars — Codex CLI or VS Code extension
|
|
25
|
+
* 5. CLAUDE_CODE_ENTRYPOINT present (any value) — direct Claude Code CLI
|
|
26
|
+
* 6. No recognised env vars → agent:unknown (trust ~0.3, treated as untrusted agent)
|
|
26
27
|
*/
|
|
27
28
|
export declare function inferSourceFromEnvironment(): EnvDetectionResult;
|
|
28
29
|
/**
|
|
@@ -15,8 +15,9 @@
|
|
|
15
15
|
* 1. SHIELDCORTEX_AGENT_SOURCE — explicit override (e.g. "agent:user-spawned>task-1")
|
|
16
16
|
* 2. CLAUDE_CODE_ENTRYPOINT=subagent — Claude Code sub-agent
|
|
17
17
|
* 3. CLAUDE_AGENT_CONTEXT — generic agent context marker
|
|
18
|
-
* 4.
|
|
19
|
-
* 5.
|
|
18
|
+
* 4. Codex origin / thread vars — Codex CLI or VS Code extension
|
|
19
|
+
* 5. CLAUDE_CODE_ENTRYPOINT present (any value) — direct Claude Code CLI
|
|
20
|
+
* 6. No recognised env vars → agent:unknown (trust ~0.3, treated as untrusted agent)
|
|
20
21
|
*/
|
|
21
22
|
export function inferSourceFromEnvironment() {
|
|
22
23
|
// 1. Explicit ShieldCortex source override (for integrators)
|
|
@@ -52,7 +53,24 @@ export function inferSourceFromEnvironment() {
|
|
|
52
53
|
confidence: 'medium',
|
|
53
54
|
};
|
|
54
55
|
}
|
|
55
|
-
// 4.
|
|
56
|
+
// 4. Codex CLI / IDE extension
|
|
57
|
+
const codexOrigin = process.env.CODEX_INTERNAL_ORIGINATOR_OVERRIDE;
|
|
58
|
+
if (codexOrigin) {
|
|
59
|
+
const identifier = codexOrigin === 'codex_vscode' ? 'codex-vscode' : `codex:${codexOrigin}`;
|
|
60
|
+
return {
|
|
61
|
+
source: { type: 'cli', identifier },
|
|
62
|
+
method: 'env:CODEX_INTERNAL_ORIGINATOR_OVERRIDE',
|
|
63
|
+
confidence: 'high',
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
if (process.env.CODEX_THREAD_ID || process.env.CODEX_CI) {
|
|
67
|
+
return {
|
|
68
|
+
source: { type: 'cli', identifier: process.env.CODEX_THREAD_ID ? 'codex-cli' : 'codex-ci' },
|
|
69
|
+
method: 'env:CODEX_THREAD_ID',
|
|
70
|
+
confidence: 'medium',
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
// 5. Direct Claude Code CLI (entrypoint present but not subagent)
|
|
56
74
|
if (process.env.CLAUDE_CODE_ENTRYPOINT) {
|
|
57
75
|
return {
|
|
58
76
|
source: { type: 'cli', identifier: 'mcp' },
|
|
@@ -60,7 +78,7 @@ export function inferSourceFromEnvironment() {
|
|
|
60
78
|
confidence: 'high',
|
|
61
79
|
};
|
|
62
80
|
}
|
|
63
|
-
//
|
|
81
|
+
// 6. No recognised env vars — unknown caller (use 'agent' type for lower trust)
|
|
64
82
|
return {
|
|
65
83
|
source: { type: 'agent', identifier: 'unknown' },
|
|
66
84
|
method: 'default',
|
package/dist/index.d.ts
CHANGED
|
@@ -39,6 +39,9 @@
|
|
|
39
39
|
* shieldcortex copilot install # Configure MCP server for VS Code + Cursor
|
|
40
40
|
* shieldcortex copilot uninstall # Remove MCP server configuration
|
|
41
41
|
* shieldcortex copilot status # Check MCP server configuration
|
|
42
|
+
* shieldcortex codex install # Configure MCP server for Codex CLI + VS Code extension
|
|
43
|
+
* shieldcortex codex uninstall # Remove Codex MCP configuration
|
|
44
|
+
* shieldcortex codex status # Check Codex MCP configuration
|
|
42
45
|
* shieldcortex license activate <key> # Activate a licence key
|
|
43
46
|
* shieldcortex license status # Show current licence tier and features
|
|
44
47
|
* shieldcortex license deactivate # Remove licence
|
package/dist/index.js
CHANGED
|
@@ -39,6 +39,9 @@
|
|
|
39
39
|
* shieldcortex copilot install # Configure MCP server for VS Code + Cursor
|
|
40
40
|
* shieldcortex copilot uninstall # Remove MCP server configuration
|
|
41
41
|
* shieldcortex copilot status # Check MCP server configuration
|
|
42
|
+
* shieldcortex codex install # Configure MCP server for Codex CLI + VS Code extension
|
|
43
|
+
* shieldcortex codex uninstall # Remove Codex MCP configuration
|
|
44
|
+
* shieldcortex codex status # Check Codex MCP configuration
|
|
42
45
|
* shieldcortex license activate <key> # Activate a licence key
|
|
43
46
|
* shieldcortex license status # Show current licence tier and features
|
|
44
47
|
* shieldcortex license deactivate # Remove licence
|
|
@@ -61,6 +64,7 @@ import { setupClaudeMd } from './setup/claude-md.js';
|
|
|
61
64
|
import { handleHookCommand } from './setup/hooks.js';
|
|
62
65
|
import { handleOpenClawCommand } from './setup/openclaw.js';
|
|
63
66
|
import { handleCopilotCommand } from './setup/copilot.js';
|
|
67
|
+
import { handleCodexCommand } from './setup/codex.js';
|
|
64
68
|
import { createRequire } from 'module';
|
|
65
69
|
import { execSync } from 'child_process';
|
|
66
70
|
import { disposeModel, preloadModel } from './embeddings/index.js';
|
|
@@ -387,6 +391,7 @@ ${bold}COMMANDS${reset}
|
|
|
387
391
|
${cyan}uninstall${reset} Remove ShieldCortex from your project
|
|
388
392
|
${cyan}openclaw${reset} <action> Manage OpenClaw hook integration
|
|
389
393
|
${cyan}copilot${reset} <action> Set up VS Code / Cursor MCP integration
|
|
394
|
+
${cyan}codex${reset} <action> Set up Codex CLI / VS Code MCP integration
|
|
390
395
|
${cyan}graph${reset} backfill Backfill knowledge graph from memories
|
|
391
396
|
${cyan}hook${reset} <action> Manage hooks (start, stop, status)
|
|
392
397
|
${cyan}service${reset} <action> Manage background service
|
|
@@ -473,6 +478,11 @@ ${bold}DOCS${reset}
|
|
|
473
478
|
await handleCopilotCommand(process.argv[3] || '');
|
|
474
479
|
return;
|
|
475
480
|
}
|
|
481
|
+
// Handle "codex" subcommand (Codex CLI + VS Code MCP setup)
|
|
482
|
+
if (process.argv[2] === 'codex') {
|
|
483
|
+
await handleCodexCommand(process.argv[3] || '');
|
|
484
|
+
return;
|
|
485
|
+
}
|
|
476
486
|
// Handle "service" subcommand before normal mode parsing
|
|
477
487
|
if (process.argv[2] === 'service') {
|
|
478
488
|
await handleServiceCommand(process.argv[3] || '', process.argv.slice(4));
|
|
@@ -668,7 +678,7 @@ ${bold}DOCS${reset}
|
|
|
668
678
|
// Guard: if an unknown subcommand was given, show help instead of silently starting MCP
|
|
669
679
|
const knownCommands = new Set([
|
|
670
680
|
'doctor', 'quickstart', 'setup', 'install', 'migrate', 'uninstall', 'hook',
|
|
671
|
-
'openclaw', 'clawdbot', 'copilot', 'service', 'config', 'status',
|
|
681
|
+
'openclaw', 'clawdbot', 'copilot', 'codex', 'service', 'config', 'status',
|
|
672
682
|
'graph', 'license', 'licence', 'audit', 'iron-dome', 'scan', 'cloud',
|
|
673
683
|
'scan-skill', 'scan-skills', 'dashboard', 'api', 'worker',
|
|
674
684
|
]);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codex MCP installer.
|
|
3
|
+
*
|
|
4
|
+
* Configures ShieldCortex as an MCP server for Codex by updating
|
|
5
|
+
* ~/.codex/config.toml. Codex CLI and the Codex IDE extension share this
|
|
6
|
+
* configuration, so one install covers both on the same machine.
|
|
7
|
+
*/
|
|
8
|
+
export declare function installCodex(): Promise<void>;
|
|
9
|
+
export declare function uninstallCodex(): Promise<void>;
|
|
10
|
+
export declare function codexStatus(): Promise<void>;
|
|
11
|
+
export declare function handleCodexCommand(subcommand: string): Promise<void>;
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codex MCP installer.
|
|
3
|
+
*
|
|
4
|
+
* Configures ShieldCortex as an MCP server for Codex by updating
|
|
5
|
+
* ~/.codex/config.toml. Codex CLI and the Codex IDE extension share this
|
|
6
|
+
* configuration, so one install covers both on the same machine.
|
|
7
|
+
*/
|
|
8
|
+
import fs from 'fs';
|
|
9
|
+
import os from 'os';
|
|
10
|
+
import path from 'path';
|
|
11
|
+
import { fileURLToPath } from 'url';
|
|
12
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
+
const __dirname = path.dirname(__filename);
|
|
14
|
+
const SERVER_NAME = 'shieldcortex-memory';
|
|
15
|
+
const MCP_ENTRY = path.resolve(__dirname, '..', 'index.js');
|
|
16
|
+
function escapeRegExp(value) {
|
|
17
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
18
|
+
}
|
|
19
|
+
function getCodexConfigPath() {
|
|
20
|
+
return path.join(os.homedir(), '.codex', 'config.toml');
|
|
21
|
+
}
|
|
22
|
+
function readConfig() {
|
|
23
|
+
const configPath = getCodexConfigPath();
|
|
24
|
+
if (!fs.existsSync(configPath))
|
|
25
|
+
return '';
|
|
26
|
+
return fs.readFileSync(configPath, 'utf-8');
|
|
27
|
+
}
|
|
28
|
+
function writeConfig(content) {
|
|
29
|
+
const configPath = getCodexConfigPath();
|
|
30
|
+
fs.mkdirSync(path.dirname(configPath), { recursive: true });
|
|
31
|
+
fs.writeFileSync(configPath, content.endsWith('\n') ? content : `${content}\n`, 'utf-8');
|
|
32
|
+
}
|
|
33
|
+
function escapeTomlString(value) {
|
|
34
|
+
return value.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
|
|
35
|
+
}
|
|
36
|
+
function buildServerBlock() {
|
|
37
|
+
return [
|
|
38
|
+
`[mcp_servers.${SERVER_NAME}]`,
|
|
39
|
+
'command = "node"',
|
|
40
|
+
`args = ["${escapeTomlString(MCP_ENTRY)}"]`,
|
|
41
|
+
'',
|
|
42
|
+
].join('\n');
|
|
43
|
+
}
|
|
44
|
+
function parseSections(content) {
|
|
45
|
+
const lines = content.split(/\r?\n/);
|
|
46
|
+
const sections = [];
|
|
47
|
+
let current = { header: null, lines: [] };
|
|
48
|
+
for (const line of lines) {
|
|
49
|
+
const headerMatch = line.match(/^\[([^\]]+)\]\s*$/);
|
|
50
|
+
if (headerMatch) {
|
|
51
|
+
sections.push(current);
|
|
52
|
+
current = { header: headerMatch[1], lines: [line] };
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
current.lines.push(line);
|
|
56
|
+
}
|
|
57
|
+
sections.push(current);
|
|
58
|
+
return sections;
|
|
59
|
+
}
|
|
60
|
+
function normalizeContent(content) {
|
|
61
|
+
const trimmed = content.replace(/\n{3,}/g, '\n\n').trimEnd();
|
|
62
|
+
return trimmed.length > 0 ? `${trimmed}\n` : '';
|
|
63
|
+
}
|
|
64
|
+
function hasServerBlock(content) {
|
|
65
|
+
return new RegExp(`^\\[mcp_servers\\.${escapeRegExp(SERVER_NAME)}\\]\\r?$`, 'm').test(content);
|
|
66
|
+
}
|
|
67
|
+
function upsertServerBlock(content) {
|
|
68
|
+
const block = buildServerBlock().trimEnd();
|
|
69
|
+
const sections = parseSections(content);
|
|
70
|
+
const output = [];
|
|
71
|
+
let insertionIndex = -1;
|
|
72
|
+
let found = false;
|
|
73
|
+
for (const section of sections) {
|
|
74
|
+
if (section.header === `mcp_servers.${SERVER_NAME}`) {
|
|
75
|
+
if (insertionIndex === -1)
|
|
76
|
+
insertionIndex = output.length;
|
|
77
|
+
found = true;
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
const rendered = section.lines.join('\n').trimEnd();
|
|
81
|
+
if (rendered.length > 0)
|
|
82
|
+
output.push(rendered);
|
|
83
|
+
}
|
|
84
|
+
if (insertionIndex === -1)
|
|
85
|
+
insertionIndex = output.length;
|
|
86
|
+
output.splice(insertionIndex, 0, block);
|
|
87
|
+
const normalized = normalizeContent(output.join('\n\n'));
|
|
88
|
+
if (found) {
|
|
89
|
+
return { content: normalized, changed: normalized !== content };
|
|
90
|
+
}
|
|
91
|
+
return { content: normalized, changed: normalized !== content };
|
|
92
|
+
}
|
|
93
|
+
function removeServerBlock(content) {
|
|
94
|
+
const sections = parseSections(content);
|
|
95
|
+
const filtered = sections.filter((section) => section.header !== `mcp_servers.${SERVER_NAME}`);
|
|
96
|
+
if (filtered.length === sections.length) {
|
|
97
|
+
return { content, changed: false };
|
|
98
|
+
}
|
|
99
|
+
const normalized = normalizeContent(filtered
|
|
100
|
+
.map((section) => section.lines.join('\n').trimEnd())
|
|
101
|
+
.filter(Boolean)
|
|
102
|
+
.join('\n\n'));
|
|
103
|
+
return { content: normalized, changed: true };
|
|
104
|
+
}
|
|
105
|
+
export async function installCodex() {
|
|
106
|
+
if (!fs.existsSync(MCP_ENTRY)) {
|
|
107
|
+
console.error('ShieldCortex MCP entry point not found. Package may be corrupted.');
|
|
108
|
+
console.error(`Expected: ${MCP_ENTRY}`);
|
|
109
|
+
process.exit(1);
|
|
110
|
+
}
|
|
111
|
+
const existing = readConfig();
|
|
112
|
+
const result = upsertServerBlock(existing);
|
|
113
|
+
writeConfig(result.content);
|
|
114
|
+
if (result.changed) {
|
|
115
|
+
console.log(`✓ Codex — configured ShieldCortex in ${getCodexConfigPath()}`);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
console.log('· Codex — already configured');
|
|
119
|
+
}
|
|
120
|
+
console.log();
|
|
121
|
+
console.log('This Codex config is shared by the Codex CLI and IDE extension.');
|
|
122
|
+
console.log('Restart Codex / VS Code if it was already open.');
|
|
123
|
+
}
|
|
124
|
+
export async function uninstallCodex() {
|
|
125
|
+
const existing = readConfig();
|
|
126
|
+
const result = removeServerBlock(existing);
|
|
127
|
+
if (!result.changed) {
|
|
128
|
+
console.log('ShieldCortex MCP server was not configured for Codex.');
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
writeConfig(result.content);
|
|
132
|
+
console.log(`✓ Codex — removed ShieldCortex from ${getCodexConfigPath()}`);
|
|
133
|
+
}
|
|
134
|
+
export async function codexStatus() {
|
|
135
|
+
const content = readConfig();
|
|
136
|
+
console.log(`Codex config: ${getCodexConfigPath()}`);
|
|
137
|
+
console.log(` Exists: ${content.length > 0 ? 'yes' : 'no'}`);
|
|
138
|
+
console.log(` Configured: ${hasServerBlock(content) ? 'yes' : 'no'}`);
|
|
139
|
+
console.log(` MCP entry: ${MCP_ENTRY}`);
|
|
140
|
+
console.log(` Entry exists: ${fs.existsSync(MCP_ENTRY) ? 'yes' : 'no'}`);
|
|
141
|
+
}
|
|
142
|
+
export async function handleCodexCommand(subcommand) {
|
|
143
|
+
console.log();
|
|
144
|
+
switch (subcommand) {
|
|
145
|
+
case 'install':
|
|
146
|
+
await installCodex();
|
|
147
|
+
break;
|
|
148
|
+
case 'uninstall':
|
|
149
|
+
await uninstallCodex();
|
|
150
|
+
break;
|
|
151
|
+
case 'status':
|
|
152
|
+
await codexStatus();
|
|
153
|
+
break;
|
|
154
|
+
default:
|
|
155
|
+
console.log('Usage: shieldcortex codex <install|uninstall|status>');
|
|
156
|
+
console.log();
|
|
157
|
+
console.log('Configures ShieldCortex in ~/.codex/config.toml for Codex CLI');
|
|
158
|
+
console.log('and the Codex VS Code extension.');
|
|
159
|
+
process.exit(1);
|
|
160
|
+
}
|
|
161
|
+
}
|
package/dist/setup/quickstart.js
CHANGED
|
@@ -11,6 +11,7 @@ import path from 'path';
|
|
|
11
11
|
import { setupClaudeMd } from './claude-md.js';
|
|
12
12
|
import { handleOpenClawCommand } from './openclaw.js';
|
|
13
13
|
import { handleCopilotCommand } from './copilot.js';
|
|
14
|
+
import { handleCodexCommand } from './codex.js';
|
|
14
15
|
function detectEnvironment() {
|
|
15
16
|
const home = os.homedir();
|
|
16
17
|
const platform = process.platform;
|
|
@@ -18,6 +19,7 @@ function detectEnvironment() {
|
|
|
18
19
|
fs.existsSync(path.join(home, '.claude.json'));
|
|
19
20
|
const openclaw = fs.existsSync(path.join(home, '.openclaw'));
|
|
20
21
|
const cursor = fs.existsSync(path.join(home, '.cursor'));
|
|
22
|
+
const codex = fs.existsSync(path.join(home, '.codex'));
|
|
21
23
|
const vscodeDirs = platform === 'darwin'
|
|
22
24
|
? [
|
|
23
25
|
path.join(home, 'Library', 'Application Support', 'Code', 'User'),
|
|
@@ -33,7 +35,7 @@ function detectEnvironment() {
|
|
|
33
35
|
path.join(home, '.config', 'Code - Insiders', 'User'),
|
|
34
36
|
];
|
|
35
37
|
const copilot = cursor || vscodeDirs.some((dir) => fs.existsSync(dir));
|
|
36
|
-
return { claude, openclaw, copilot, cursor };
|
|
38
|
+
return { claude, openclaw, copilot, cursor, codex };
|
|
37
39
|
}
|
|
38
40
|
function printAutoGuide() {
|
|
39
41
|
const env = detectEnvironment();
|
|
@@ -42,7 +44,7 @@ function printAutoGuide() {
|
|
|
42
44
|
lines.push('ShieldCortex Quickstart');
|
|
43
45
|
lines.push('────────────────────────────────────────────────────');
|
|
44
46
|
lines.push('Goal: give your agent memory you can inspect and security you can trust.');
|
|
45
|
-
lines.push(`Detected: Claude=${env.claude ? 'yes' : 'no'} · OpenClaw=${env.openclaw ? 'yes' : 'no'} · Copilot/Cursor=${env.copilot ? 'yes' : 'no'}`);
|
|
47
|
+
lines.push(`Detected: Claude=${env.claude ? 'yes' : 'no'} · OpenClaw=${env.openclaw ? 'yes' : 'no'} · Codex=${env.codex ? 'yes' : 'no'} · Copilot/Cursor=${env.copilot ? 'yes' : 'no'}`);
|
|
46
48
|
lines.push('');
|
|
47
49
|
lines.push('Best paths:');
|
|
48
50
|
lines.push('');
|
|
@@ -64,6 +66,12 @@ function printAutoGuide() {
|
|
|
64
66
|
lines.push(' shieldcortex quickstart copilot');
|
|
65
67
|
lines.push('');
|
|
66
68
|
}
|
|
69
|
+
if (env.codex) {
|
|
70
|
+
lines.push('Codex CLI / VS Code');
|
|
71
|
+
lines.push(' Register ShieldCortex once for Codex MCP in the CLI and IDE extension:');
|
|
72
|
+
lines.push(' shieldcortex quickstart codex');
|
|
73
|
+
lines.push('');
|
|
74
|
+
}
|
|
67
75
|
lines.push('Security-only');
|
|
68
76
|
lines.push(' Scan prompts, tools, and environments without adopting memory first:');
|
|
69
77
|
lines.push(' shieldcortex quickstart security');
|
|
@@ -72,6 +80,7 @@ function printAutoGuide() {
|
|
|
72
80
|
lines.push(' shieldcortex setup');
|
|
73
81
|
lines.push(' shieldcortex openclaw install');
|
|
74
82
|
lines.push(' shieldcortex copilot install');
|
|
83
|
+
lines.push(' shieldcortex codex install');
|
|
75
84
|
lines.push(' shieldcortex dashboard');
|
|
76
85
|
lines.push('');
|
|
77
86
|
console.log(lines.join('\n'));
|
|
@@ -105,11 +114,14 @@ export async function handleQuickstartCommand(target) {
|
|
|
105
114
|
case 'copilot':
|
|
106
115
|
await handleCopilotCommand('install');
|
|
107
116
|
return;
|
|
117
|
+
case 'codex':
|
|
118
|
+
await handleCodexCommand('install');
|
|
119
|
+
return;
|
|
108
120
|
case 'security':
|
|
109
121
|
printSecurityGuide();
|
|
110
122
|
return;
|
|
111
123
|
default:
|
|
112
|
-
console.error('Usage: shieldcortex quickstart [claude|openclaw|copilot|security]');
|
|
124
|
+
console.error('Usage: shieldcortex quickstart [claude|openclaw|copilot|codex|security]');
|
|
113
125
|
process.exit(1);
|
|
114
126
|
}
|
|
115
127
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shieldcortex",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "Trustworthy memory and security for AI agents. Recall debugging, review queue, OpenClaw session capture, and memory poisoning defence for Claude Code, OpenClaw, LangChain, and MCP agents.",
|
|
3
|
+
"version": "3.3.1",
|
|
4
|
+
"description": "Trustworthy memory and security for AI agents. Recall debugging, review queue, OpenClaw session capture, and memory poisoning defence for Claude Code, Codex, OpenClaw, LangChain, and MCP agents.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -63,6 +63,8 @@
|
|
|
63
63
|
"memory-decay",
|
|
64
64
|
"context-persistence",
|
|
65
65
|
"claude-code-memory",
|
|
66
|
+
"codex",
|
|
67
|
+
"codex-vscode",
|
|
66
68
|
"claude-memory",
|
|
67
69
|
"openclaw",
|
|
68
70
|
"semantic-search",
|
|
File without changes
|
|
File without changes
|