@ia-ccun/code-agent-cli 0.0.51-beta.1 → 0.0.51-beta.11
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/bin/cli.js +6 -5
- package/config/agent/extensions/aicode-plan.ts +897 -0
- package/config/agent/extensions/custom-footer.ts +19 -1
- package/config/agent/extensions/custom.ts +1 -4
- package/config/agent/extensions/goal.ts +450 -0
- package/config/agent/help.md +2 -0
- package/dist/config-loader.d.ts +2 -0
- package/dist/config-loader.d.ts.map +1 -1
- package/dist/config-loader.js +81 -7
- package/dist/config-loader.js.map +1 -1
- package/dist/security-logger.d.ts +69 -0
- package/dist/security-logger.d.ts.map +1 -0
- package/dist/security-logger.js +178 -0
- package/dist/security-logger.js.map +1 -0
- package/package.json +12 -2
- package/scripts/postinstall.js +126 -46
package/bin/cli.js
CHANGED
|
@@ -144,7 +144,7 @@ if (config.banner === '__default__' || config.banner !== '') {
|
|
|
144
144
|
// 检查新版本
|
|
145
145
|
async function checkForUpdates() {
|
|
146
146
|
try {
|
|
147
|
-
const {
|
|
147
|
+
const { execFileSync } = await import('child_process');
|
|
148
148
|
// 读取本地版本 - 向上查找 package.json
|
|
149
149
|
let rootDir = __dirname;
|
|
150
150
|
let localVersion = null;
|
|
@@ -158,9 +158,9 @@ async function checkForUpdates() {
|
|
|
158
158
|
}
|
|
159
159
|
if (!localVersion) return;
|
|
160
160
|
|
|
161
|
-
//
|
|
162
|
-
const registry =
|
|
163
|
-
const latestVersion =
|
|
161
|
+
// 🔒 Security: Use execFileSync instead of execSync to prevent command injection
|
|
162
|
+
const registry = execFileSync('npm', ['config', 'get', 'registry'], { encoding: 'utf8', stdio: 'pipe' }).trim();
|
|
163
|
+
const latestVersion = execFileSync('npm', ['view', '@ia-ccun/code-agent-cli', 'version', '--registry=' + registry], { encoding: 'utf8', stdio: 'pipe' }).trim();
|
|
164
164
|
|
|
165
165
|
// 比较版本号
|
|
166
166
|
const localParts = localVersion.split('.').map(Number);
|
|
@@ -175,7 +175,8 @@ async function checkForUpdates() {
|
|
|
175
175
|
try {
|
|
176
176
|
const cacheDir = join(process.env.HOME || process.env.USERPROFILE, '.aicode-cli');
|
|
177
177
|
if (!existsSync(cacheDir)) {
|
|
178
|
-
|
|
178
|
+
// 🔒 Security: Use execFileSync for mkdir instead of execSync
|
|
179
|
+
execFileSync('mkdir', ['-p', cacheDir], { stdio: 'pipe' });
|
|
179
180
|
}
|
|
180
181
|
const cacheData = {
|
|
181
182
|
localVersion,
|