@ranger1/dx 0.1.90 → 0.1.92
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 +2 -2
- package/lib/cli/commands/core.js +92 -0
- package/lib/cli/help.js +2 -1
- package/lib/codex-initial.js +19 -215
- package/package.json +2 -2
- package/skills/backend-layering-audit-fixer/SKILL.md +180 -0
- package/{codex/skills → skills}/doctor/SKILL.md +2 -9
- package/{codex/skills → skills}/doctor/scripts/doctor.sh +2 -253
- package/skills/git-pr-ship/SKILL.md +481 -0
- package/skills/naming-audit-fixer/SKILL.md +149 -0
- package/skills/naming-audit-fixer/references/fix-guide.md +93 -0
- package/skills/naming-audit-fixer/scripts/audit_naming.py +534 -0
- package/codex/agents/fixer.toml +0 -37
- package/codex/agents/orchestrator.toml +0 -11
- package/codex/agents/reviewer.toml +0 -52
- package/codex/agents/spark.toml +0 -18
- package/codex/skills/pr-review-loop/SKILL.md +0 -209
- package/codex/skills/pr-review-loop/agents/openai.yaml +0 -4
- package/codex/skills/pr-review-loop/references/agents/pr-context.md +0 -73
- package/codex/skills/pr-review-loop/references/agents/pr-precheck.md +0 -161
- package/codex/skills/pr-review-loop/references/agents/pr-review-aggregate.md +0 -188
- package/codex/skills/pr-review-loop/references/skill-layout.md +0 -25
- package/codex/skills/pr-review-loop/scripts/gh_review_harvest.py +0 -292
- package/codex/skills/pr-review-loop/scripts/pr_context.py +0 -351
- package/codex/skills/pr-review-loop/scripts/pr_review_aggregate.py +0 -951
- package/codex/skills/pr-review-loop/scripts/test_pr_review_aggregate.py +0 -876
- package/codex/skills/pr-review-loop/scripts/test_validate_reviewer_prompts.py +0 -92
- package/codex/skills/pr-review-loop/scripts/validate_reviewer_prompts.py +0 -87
- /package/{codex/skills → skills}/doctor/agents/openai.yaml +0 -0
- /package/{codex/skills → skills}/e2e-audit-fixer/SKILL.md +0 -0
- /package/{codex/skills → skills}/e2e-audit-fixer/agents/openai.yaml +0 -0
- /package/{codex/skills → skills}/e2e-audit-fixer/scripts/e2e_e2e_audit.py +0 -0
- /package/{codex/skills → skills}/env-accessor-audit-fixer/SKILL.md +0 -0
- /package/{codex/skills → skills}/env-accessor-audit-fixer/agents/openai.yaml +0 -0
- /package/{codex/skills → skills}/env-accessor-audit-fixer/references/bootstrap-env-foundation.md +0 -0
- /package/{codex/skills → skills}/env-accessor-audit-fixer/scripts/env_accessor_audit.py +0 -0
- /package/{codex/skills → skills}/error-handling-audit-fixer/SKILL.md +0 -0
- /package/{codex/skills → skills}/error-handling-audit-fixer/agents/openai.yaml +0 -0
- /package/{codex/skills → skills}/error-handling-audit-fixer/references/error-handling-standard.md +0 -0
- /package/{codex/skills → skills}/error-handling-audit-fixer/references/foundation-bootstrap.md +0 -0
- /package/{codex/skills → skills}/error-handling-audit-fixer/scripts/error_handling_audit.py +0 -0
- /package/{codex/skills → skills}/gh-dependabot-cleanup/SKILL.md +0 -0
- /package/{codex/skills → skills}/gh-dependabot-cleanup/agents/openai.yaml +0 -0
- /package/{codex/skills → skills}/git-commit-and-pr/SKILL.md +0 -0
- /package/{codex/skills → skills}/git-commit-and-pr/agents/openai.yaml +0 -0
- /package/{codex/skills → skills}/git-release/SKILL.md +0 -0
- /package/{codex/skills → skills}/git-release/agents/openai.yaml +0 -0
- /package/{codex/skills → skills}/online-debug-guard/SKILL.md +0 -0
- /package/{codex/skills → skills}/online-debug-guard/agents/openai.yaml +0 -0
- /package/{codex/skills → skills}/pagination-dto-audit-fixer/SKILL.md +0 -0
- /package/{codex/skills → skills}/pagination-dto-audit-fixer/agents/openai.yaml +0 -0
- /package/{codex/skills → skills}/pagination-dto-audit-fixer/references/pagination-standard.md +0 -0
- /package/{codex/skills → skills}/pagination-dto-audit-fixer/scripts/pagination_dto_audit.py +0 -0
|
@@ -217,244 +217,6 @@ ensure_multi_agent() {
|
|
|
217
217
|
echo "$line" | grep -E "experimental[[:space:]]+true" >/dev/null 2>&1
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
ensure_codex_config() {
|
|
221
|
-
local cfg_dir cfg_file tmp_file
|
|
222
|
-
cfg_dir="$CODEX_HOME"
|
|
223
|
-
cfg_file="$cfg_dir/config.toml"
|
|
224
|
-
tmp_file="$cfg_file.tmp.$$"
|
|
225
|
-
|
|
226
|
-
mkdir -p "$cfg_dir"
|
|
227
|
-
if [[ ! -f "$cfg_file" ]]; then
|
|
228
|
-
: >"$cfg_file"
|
|
229
|
-
fi
|
|
230
|
-
|
|
231
|
-
awk '
|
|
232
|
-
BEGIN {
|
|
233
|
-
in_features=0; in_agents=0; in_fixer=0; in_orch=0; in_reviewer=0; in_spark=0;
|
|
234
|
-
features_emitted=0; agents_emitted=0; fixer_emitted=0; orch_emitted=0; reviewer_emitted=0; spark_emitted=0;
|
|
235
|
-
features_multi_written=0; agents_max_threads_written=0;
|
|
236
|
-
fixer_desc_written=0; fixer_cfg_written=0;
|
|
237
|
-
orch_desc_written=0; orch_cfg_written=0;
|
|
238
|
-
reviewer_desc_written=0; reviewer_cfg_written=0;
|
|
239
|
-
spark_desc_written=0; spark_cfg_written=0;
|
|
240
|
-
}
|
|
241
|
-
function trim(s) { gsub(/^[[:space:]]+|[[:space:]]+$/, "", s); return s }
|
|
242
|
-
function reset_sections() {
|
|
243
|
-
in_features=0; in_agents=0; in_fixer=0; in_orch=0; in_reviewer=0; in_spark=0;
|
|
244
|
-
}
|
|
245
|
-
function flush_features() {
|
|
246
|
-
if (!features_emitted) return;
|
|
247
|
-
if (!features_multi_written) print "multi_agent = true";
|
|
248
|
-
}
|
|
249
|
-
function flush_agents() {
|
|
250
|
-
if (!agents_emitted) return;
|
|
251
|
-
if (!agents_max_threads_written) print "max_threads = 15";
|
|
252
|
-
}
|
|
253
|
-
function flush_fixer() {
|
|
254
|
-
if (!fixer_emitted) return;
|
|
255
|
-
if (!fixer_desc_written) print "description = \"bugfix 代理\"";
|
|
256
|
-
if (!fixer_cfg_written) print "config_file = \"agents/fixer.toml\"";
|
|
257
|
-
}
|
|
258
|
-
function flush_orch() {
|
|
259
|
-
if (!orch_emitted) return;
|
|
260
|
-
if (!orch_desc_written) print "description = \"pr 修复流程编排代理\"";
|
|
261
|
-
if (!orch_cfg_written) print "config_file = \"agents/orchestrator.toml\"";
|
|
262
|
-
}
|
|
263
|
-
function flush_reviewer() {
|
|
264
|
-
if (!reviewer_emitted) return;
|
|
265
|
-
if (!reviewer_desc_written) print "description = \"代码评审代理\"";
|
|
266
|
-
if (!reviewer_cfg_written) print "config_file = \"agents/reviewer.toml\"";
|
|
267
|
-
}
|
|
268
|
-
function flush_spark() {
|
|
269
|
-
if (!spark_emitted) return;
|
|
270
|
-
if (!spark_desc_written) print "description = \"通用执行代理\"";
|
|
271
|
-
if (!spark_cfg_written) print "config_file = \"agents/spark.toml\"";
|
|
272
|
-
}
|
|
273
|
-
function flush_active_section() {
|
|
274
|
-
if (in_features) flush_features();
|
|
275
|
-
if (in_agents) flush_agents();
|
|
276
|
-
if (in_fixer) flush_fixer();
|
|
277
|
-
if (in_orch) flush_orch();
|
|
278
|
-
if (in_reviewer) flush_reviewer();
|
|
279
|
-
if (in_spark) flush_spark();
|
|
280
|
-
}
|
|
281
|
-
function enter_section(line) {
|
|
282
|
-
if (line == "[features]") {
|
|
283
|
-
in_features=1; features_emitted=1;
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
if (line == "[agents]") {
|
|
287
|
-
in_agents=1; agents_emitted=1;
|
|
288
|
-
return;
|
|
289
|
-
}
|
|
290
|
-
if (line == "[agents.fixer]") {
|
|
291
|
-
in_fixer=1; fixer_emitted=1;
|
|
292
|
-
return;
|
|
293
|
-
}
|
|
294
|
-
if (line == "[agents.orchestrator]") {
|
|
295
|
-
in_orch=1; orch_emitted=1;
|
|
296
|
-
return;
|
|
297
|
-
}
|
|
298
|
-
if (line == "[agents.reviewer]") {
|
|
299
|
-
in_reviewer=1; reviewer_emitted=1;
|
|
300
|
-
return;
|
|
301
|
-
}
|
|
302
|
-
if (line == "[agents.spark]") {
|
|
303
|
-
in_spark=1; spark_emitted=1;
|
|
304
|
-
return;
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
{
|
|
308
|
-
line=$0;
|
|
309
|
-
t=trim(line);
|
|
310
|
-
if (match(t, /^\[[^]]+\]$/)) {
|
|
311
|
-
flush_active_section();
|
|
312
|
-
reset_sections();
|
|
313
|
-
enter_section(t);
|
|
314
|
-
print line;
|
|
315
|
-
next;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
if (in_features && match(t, /^multi_agent[[:space:]]*=/)) {
|
|
319
|
-
if (!features_multi_written) {
|
|
320
|
-
print "multi_agent = true";
|
|
321
|
-
features_multi_written=1;
|
|
322
|
-
}
|
|
323
|
-
next;
|
|
324
|
-
}
|
|
325
|
-
if (in_agents && match(t, /^max_threads[[:space:]]*=/)) {
|
|
326
|
-
if (!agents_max_threads_written) {
|
|
327
|
-
print "max_threads = 15";
|
|
328
|
-
agents_max_threads_written=1;
|
|
329
|
-
}
|
|
330
|
-
next;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
if (in_fixer && match(t, /^description[[:space:]]*=/)) {
|
|
334
|
-
if (!fixer_desc_written) { print "description = \"bugfix 代理\""; fixer_desc_written=1; }
|
|
335
|
-
next;
|
|
336
|
-
}
|
|
337
|
-
if (in_fixer && match(t, /^config_file[[:space:]]*=/)) {
|
|
338
|
-
if (!fixer_cfg_written) { print "config_file = \"agents/fixer.toml\""; fixer_cfg_written=1; }
|
|
339
|
-
next;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
if (in_orch && match(t, /^description[[:space:]]*=/)) {
|
|
343
|
-
if (!orch_desc_written) { print "description = \"pr 修复流程编排代理\""; orch_desc_written=1; }
|
|
344
|
-
next;
|
|
345
|
-
}
|
|
346
|
-
if (in_orch && match(t, /^config_file[[:space:]]*=/)) {
|
|
347
|
-
if (!orch_cfg_written) { print "config_file = \"agents/orchestrator.toml\""; orch_cfg_written=1; }
|
|
348
|
-
next;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
if (in_reviewer && match(t, /^description[[:space:]]*=/)) {
|
|
352
|
-
if (!reviewer_desc_written) { print "description = \"代码评审代理\""; reviewer_desc_written=1; }
|
|
353
|
-
next;
|
|
354
|
-
}
|
|
355
|
-
if (in_reviewer && match(t, /^config_file[[:space:]]*=/)) {
|
|
356
|
-
if (!reviewer_cfg_written) { print "config_file = \"agents/reviewer.toml\""; reviewer_cfg_written=1; }
|
|
357
|
-
next;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
if (in_spark && match(t, /^description[[:space:]]*=/)) {
|
|
361
|
-
if (!spark_desc_written) { print "description = \"通用执行代理\""; spark_desc_written=1; }
|
|
362
|
-
next;
|
|
363
|
-
}
|
|
364
|
-
if (in_spark && match(t, /^config_file[[:space:]]*=/)) {
|
|
365
|
-
if (!spark_cfg_written) { print "config_file = \"agents/spark.toml\""; spark_cfg_written=1; }
|
|
366
|
-
next;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
print line;
|
|
370
|
-
}
|
|
371
|
-
END {
|
|
372
|
-
flush_active_section();
|
|
373
|
-
|
|
374
|
-
if (!features_emitted) {
|
|
375
|
-
print "";
|
|
376
|
-
print "[features]";
|
|
377
|
-
print "multi_agent = true";
|
|
378
|
-
}
|
|
379
|
-
if (!agents_emitted) {
|
|
380
|
-
print "";
|
|
381
|
-
print "[agents]";
|
|
382
|
-
print "max_threads = 15";
|
|
383
|
-
}
|
|
384
|
-
if (!fixer_emitted) {
|
|
385
|
-
print "";
|
|
386
|
-
print "[agents.fixer]";
|
|
387
|
-
print "description = \"bugfix 代理\"";
|
|
388
|
-
print "config_file = \"agents/fixer.toml\"";
|
|
389
|
-
}
|
|
390
|
-
if (!orch_emitted) {
|
|
391
|
-
print "";
|
|
392
|
-
print "[agents.orchestrator]";
|
|
393
|
-
print "description = \"pr 修复流程编排代理\"";
|
|
394
|
-
print "config_file = \"agents/orchestrator.toml\"";
|
|
395
|
-
}
|
|
396
|
-
if (!reviewer_emitted) {
|
|
397
|
-
print "";
|
|
398
|
-
print "[agents.reviewer]";
|
|
399
|
-
print "description = \"代码评审代理\"";
|
|
400
|
-
print "config_file = \"agents/reviewer.toml\"";
|
|
401
|
-
}
|
|
402
|
-
if (!spark_emitted) {
|
|
403
|
-
print "";
|
|
404
|
-
print "[agents.spark]";
|
|
405
|
-
print "description = \"通用执行代理\"";
|
|
406
|
-
print "config_file = \"agents/spark.toml\"";
|
|
407
|
-
}
|
|
408
|
-
}' "$cfg_file" >"$tmp_file"
|
|
409
|
-
|
|
410
|
-
mv "$tmp_file" "$cfg_file"
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
check_codex_config() {
|
|
414
|
-
local cfg_file
|
|
415
|
-
cfg_file="$CODEX_HOME/config.toml"
|
|
416
|
-
[[ -f "$cfg_file" ]] || return 1
|
|
417
|
-
|
|
418
|
-
awk '
|
|
419
|
-
BEGIN {
|
|
420
|
-
in_features=0; in_agents=0; in_fixer=0; in_orch=0; in_reviewer=0; in_spark=0;
|
|
421
|
-
ok_features=0; ok_threads=0; ok_fixer_desc=0; ok_fixer_cfg=0;
|
|
422
|
-
ok_orch_desc=0; ok_orch_cfg=0; ok_reviewer_desc=0; ok_reviewer_cfg=0; ok_spark_desc=0; ok_spark_cfg=0;
|
|
423
|
-
}
|
|
424
|
-
function trim(s) { gsub(/^[[:space:]]+|[[:space:]]+$/, "", s); return s }
|
|
425
|
-
{
|
|
426
|
-
line=trim($0);
|
|
427
|
-
sub(/[[:space:]]+#.*$/, "", line);
|
|
428
|
-
if (line ~ /^\[[^]]+\]$/) {
|
|
429
|
-
in_features=(line=="[features]");
|
|
430
|
-
in_agents=(line=="[agents]");
|
|
431
|
-
in_fixer=(line=="[agents.fixer]");
|
|
432
|
-
in_orch=(line=="[agents.orchestrator]");
|
|
433
|
-
in_reviewer=(line=="[agents.reviewer]");
|
|
434
|
-
in_spark=(line=="[agents.spark]");
|
|
435
|
-
next;
|
|
436
|
-
}
|
|
437
|
-
if (in_features && line ~ /^multi_agent[[:space:]]*=[[:space:]]*true$/) ok_features=1;
|
|
438
|
-
if (in_agents && line ~ /^max_threads[[:space:]]*=[[:space:]]*15$/) ok_threads=1;
|
|
439
|
-
if (in_fixer && line ~ /^description[[:space:]]*=[[:space:]]*"bugfix 代理"$/) ok_fixer_desc=1;
|
|
440
|
-
if (in_fixer && line ~ /^config_file[[:space:]]*=[[:space:]]*"agents\/fixer\.toml"$/) ok_fixer_cfg=1;
|
|
441
|
-
if (in_orch && line ~ /^description[[:space:]]*=[[:space:]]*"pr 修复流程编排代理"$/) ok_orch_desc=1;
|
|
442
|
-
if (in_orch && line ~ /^config_file[[:space:]]*=[[:space:]]*"agents\/orchestrator\.toml"$/) ok_orch_cfg=1;
|
|
443
|
-
if (in_reviewer && line ~ /^description[[:space:]]*=[[:space:]]*"代码评审代理"$/) ok_reviewer_desc=1;
|
|
444
|
-
if (in_reviewer && line ~ /^config_file[[:space:]]*=[[:space:]]*"agents\/reviewer\.toml"$/) ok_reviewer_cfg=1;
|
|
445
|
-
if (in_spark && line ~ /^description[[:space:]]*=[[:space:]]*"通用执行代理"$/) ok_spark_desc=1;
|
|
446
|
-
if (in_spark && line ~ /^config_file[[:space:]]*=[[:space:]]*"agents\/spark\.toml"$/) ok_spark_cfg=1;
|
|
447
|
-
}
|
|
448
|
-
END {
|
|
449
|
-
ok = ok_features && ok_threads &&
|
|
450
|
-
ok_fixer_desc && ok_fixer_cfg &&
|
|
451
|
-
ok_orch_desc && ok_orch_cfg &&
|
|
452
|
-
ok_reviewer_desc && ok_reviewer_cfg &&
|
|
453
|
-
ok_spark_desc && ok_spark_cfg;
|
|
454
|
-
exit(ok ? 0 : 1);
|
|
455
|
-
}' "$cfg_file"
|
|
456
|
-
}
|
|
457
|
-
|
|
458
220
|
force_dx() {
|
|
459
221
|
local pnpm_bin dx_installed dx_cmd
|
|
460
222
|
if ! install_pnpm; then
|
|
@@ -600,20 +362,12 @@ run_parallel_checks() {
|
|
|
600
362
|
fi
|
|
601
363
|
) &
|
|
602
364
|
|
|
603
|
-
(
|
|
604
|
-
if check_codex_config; then
|
|
605
|
-
write_check_file "codex_config" "1" "$CODEX_HOME/config.toml" "ok" "$dir/codex_config.res"
|
|
606
|
-
else
|
|
607
|
-
write_check_file "codex_config" "0" "$CODEX_HOME/config.toml" "config.toml 缺失或配置不符合要求" "$dir/codex_config.res"
|
|
608
|
-
fi
|
|
609
|
-
) &
|
|
610
|
-
|
|
611
365
|
wait
|
|
612
366
|
LAST_CHECK_DIR="$dir"
|
|
613
367
|
}
|
|
614
368
|
|
|
615
369
|
all_good() {
|
|
616
|
-
local keys="python3 python_alias pnpm dx agent_browser rg multi_agent
|
|
370
|
+
local keys="python3 python_alias pnpm dx agent_browser rg multi_agent"
|
|
617
371
|
local k
|
|
618
372
|
for k in $keys; do
|
|
619
373
|
if ! check_ok "$k"; then
|
|
@@ -630,7 +384,7 @@ print_report() {
|
|
|
630
384
|
printf '%-14s | %-4s | %-40s | %s\n' "检查项" "状态" "版本" "说明"
|
|
631
385
|
printf '%-14s-+-%-4s-+-%-40s-+-%s\n' "--------------" "----" "----------------------------------------" "------------------------------"
|
|
632
386
|
|
|
633
|
-
local keys="python3 python_alias pnpm dx agent_browser rg multi_agent
|
|
387
|
+
local keys="python3 python_alias pnpm dx agent_browser rg multi_agent"
|
|
634
388
|
local k ok txt ver msg
|
|
635
389
|
for k in $keys; do
|
|
636
390
|
ok="$(read_field "$k" 2)"
|
|
@@ -689,11 +443,6 @@ for round in $(seq 1 "$MAX_ROUNDS"); do
|
|
|
689
443
|
ensure_multi_agent || true
|
|
690
444
|
fi
|
|
691
445
|
|
|
692
|
-
if ! check_ok "codex_config"; then
|
|
693
|
-
echo "[doctor] 修正 ~/.codex/config.toml 关键配置"
|
|
694
|
-
ensure_codex_config || true
|
|
695
|
-
fi
|
|
696
|
-
|
|
697
446
|
echo "[doctor] 强制执行 dx 安装与初始化"
|
|
698
447
|
force_dx || true
|
|
699
448
|
|