oh-my-codex 0.15.2 → 0.15.3
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/Cargo.lock +5 -5
- package/Cargo.toml +1 -1
- package/dist/agents/__tests__/native-config.test.js +33 -0
- package/dist/agents/__tests__/native-config.test.js.map +1 -1
- package/dist/catalog/__tests__/plugin-bundle-ssot.test.js +9 -1
- package/dist/catalog/__tests__/plugin-bundle-ssot.test.js.map +1 -1
- package/dist/cli/__tests__/doctor-context-window-warning.test.d.ts +2 -0
- package/dist/cli/__tests__/doctor-context-window-warning.test.d.ts.map +1 -0
- package/dist/cli/__tests__/doctor-context-window-warning.test.js +122 -0
- package/dist/cli/__tests__/doctor-context-window-warning.test.js.map +1 -0
- package/dist/cli/__tests__/doctor-warning-copy.test.js +2 -2
- package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -1
- package/dist/cli/__tests__/exec.test.js +1 -0
- package/dist/cli/__tests__/exec.test.js.map +1 -1
- package/dist/cli/__tests__/explore.test.js +40 -17
- package/dist/cli/__tests__/explore.test.js.map +1 -1
- package/dist/cli/__tests__/index.test.js +141 -8
- package/dist/cli/__tests__/index.test.js.map +1 -1
- package/dist/cli/__tests__/mcp-serve.test.js +27 -1
- package/dist/cli/__tests__/mcp-serve.test.js.map +1 -1
- package/dist/cli/__tests__/ralph.test.js +59 -1
- package/dist/cli/__tests__/ralph.test.js.map +1 -1
- package/dist/cli/__tests__/setup-scope.test.js +2 -1
- package/dist/cli/__tests__/setup-scope.test.js.map +1 -1
- package/dist/cli/__tests__/team.test.js +55 -10
- package/dist/cli/__tests__/team.test.js.map +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +46 -3
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/index.d.ts +16 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +126 -15
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/mcp-serve.d.ts +1 -0
- package/dist/cli/mcp-serve.d.ts.map +1 -1
- package/dist/cli/mcp-serve.js +8 -0
- package/dist/cli/mcp-serve.js.map +1 -1
- package/dist/cli/ralph.d.ts +2 -0
- package/dist/cli/ralph.d.ts.map +1 -1
- package/dist/cli/ralph.js +17 -1
- package/dist/cli/ralph.js.map +1 -1
- package/dist/cli/team.d.ts +4 -0
- package/dist/cli/team.d.ts.map +1 -1
- package/dist/cli/team.js +47 -22
- package/dist/cli/team.js.map +1 -1
- package/dist/config/__tests__/generator-idempotent.test.js +27 -5
- package/dist/config/__tests__/generator-idempotent.test.js.map +1 -1
- package/dist/config/generator.d.ts +11 -2
- package/dist/config/generator.d.ts.map +1 -1
- package/dist/config/generator.js +114 -58
- package/dist/config/generator.js.map +1 -1
- package/dist/hooks/__tests__/agents-overlay.test.js +59 -0
- package/dist/hooks/__tests__/agents-overlay.test.js.map +1 -1
- package/dist/hooks/__tests__/anti-slop-workflow.test.js +109 -18
- package/dist/hooks/__tests__/anti-slop-workflow.test.js.map +1 -1
- package/dist/hooks/agents-overlay.d.ts.map +1 -1
- package/dist/hooks/agents-overlay.js +21 -0
- package/dist/hooks/agents-overlay.js.map +1 -1
- package/dist/hud/__tests__/index.test.js +30 -14
- package/dist/hud/__tests__/index.test.js.map +1 -1
- package/dist/openclaw/__tests__/dispatcher.test.js +1 -1
- package/dist/openclaw/__tests__/dispatcher.test.js.map +1 -1
- package/dist/pipeline/__tests__/stages.test.js +398 -14
- package/dist/pipeline/__tests__/stages.test.js.map +1 -1
- package/dist/pipeline/stages/team-exec.d.ts +8 -4
- package/dist/pipeline/stages/team-exec.d.ts.map +1 -1
- package/dist/pipeline/stages/team-exec.js +198 -13
- package/dist/pipeline/stages/team-exec.js.map +1 -1
- package/dist/planning/__tests__/artifacts.test.js +246 -1
- package/dist/planning/__tests__/artifacts.test.js.map +1 -1
- package/dist/planning/artifact-names.d.ts +13 -0
- package/dist/planning/artifact-names.d.ts.map +1 -0
- package/dist/planning/artifact-names.js +108 -0
- package/dist/planning/artifact-names.js.map +1 -0
- package/dist/planning/artifacts.d.ts +22 -1
- package/dist/planning/artifacts.d.ts.map +1 -1
- package/dist/planning/artifacts.js +165 -50
- package/dist/planning/artifacts.js.map +1 -1
- package/dist/ralph/__tests__/persistence.test.js +21 -1
- package/dist/ralph/__tests__/persistence.test.js.map +1 -1
- package/dist/ralph/persistence.d.ts.map +1 -1
- package/dist/ralph/persistence.js +6 -4
- package/dist/ralph/persistence.js.map +1 -1
- package/dist/scripts/__tests__/codex-native-hook.test.js +352 -2
- package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -1
- package/dist/scripts/codex-native-hook.d.ts.map +1 -1
- package/dist/scripts/codex-native-hook.js +85 -6
- package/dist/scripts/codex-native-hook.js.map +1 -1
- package/dist/scripts/codex-native-pre-post.d.ts.map +1 -1
- package/dist/scripts/codex-native-pre-post.js +123 -0
- package/dist/scripts/codex-native-pre-post.js.map +1 -1
- package/dist/scripts/notify-hook/team-worker-posttooluse.js +1 -1
- package/dist/scripts/notify-hook/team-worker-posttooluse.js.map +1 -1
- package/dist/scripts/notify-hook.js +1 -1
- package/dist/scripts/notify-hook.js.map +1 -1
- package/dist/scripts/sync-plugin-mirror.d.ts +1 -0
- package/dist/scripts/sync-plugin-mirror.d.ts.map +1 -1
- package/dist/scripts/sync-plugin-mirror.js +8 -2
- package/dist/scripts/sync-plugin-mirror.js.map +1 -1
- package/dist/state/__tests__/skill-active.test.js +41 -0
- package/dist/state/__tests__/skill-active.test.js.map +1 -1
- package/dist/team/__tests__/api-interop.test.js +220 -0
- package/dist/team/__tests__/api-interop.test.js.map +1 -1
- package/dist/team/__tests__/model-contract.test.js +40 -9
- package/dist/team/__tests__/model-contract.test.js.map +1 -1
- package/dist/team/__tests__/repo-aware-decomposition.test.js +41 -0
- package/dist/team/__tests__/repo-aware-decomposition.test.js.map +1 -1
- package/dist/team/__tests__/runtime-cli.test.js +24 -0
- package/dist/team/__tests__/runtime-cli.test.js.map +1 -1
- package/dist/team/__tests__/runtime.test.js +446 -67
- package/dist/team/__tests__/runtime.test.js.map +1 -1
- package/dist/team/__tests__/state.test.js +13 -0
- package/dist/team/__tests__/state.test.js.map +1 -1
- package/dist/team/__tests__/team-identity.test.d.ts +2 -0
- package/dist/team/__tests__/team-identity.test.d.ts.map +1 -0
- package/dist/team/__tests__/team-identity.test.js +166 -0
- package/dist/team/__tests__/team-identity.test.js.map +1 -0
- package/dist/team/__tests__/tmux-session.test.js +55 -1
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/__tests__/worker-bootstrap.test.js +12 -0
- package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -1
- package/dist/team/api-interop.d.ts +1 -0
- package/dist/team/api-interop.d.ts.map +1 -1
- package/dist/team/api-interop.js +159 -129
- package/dist/team/api-interop.js.map +1 -1
- package/dist/team/delivery-log.d.ts +1 -1
- package/dist/team/delivery-log.d.ts.map +1 -1
- package/dist/team/delivery-log.js.map +1 -1
- package/dist/team/repo-aware-decomposition.d.ts +3 -0
- package/dist/team/repo-aware-decomposition.d.ts.map +1 -1
- package/dist/team/repo-aware-decomposition.js +2 -0
- package/dist/team/repo-aware-decomposition.js.map +1 -1
- package/dist/team/runtime-cli.d.ts +32 -2
- package/dist/team/runtime-cli.d.ts.map +1 -1
- package/dist/team/runtime-cli.js +78 -26
- package/dist/team/runtime-cli.js.map +1 -1
- package/dist/team/runtime.d.ts +1 -1
- package/dist/team/runtime.d.ts.map +1 -1
- package/dist/team/runtime.js +338 -35
- package/dist/team/runtime.js.map +1 -1
- package/dist/team/state.d.ts +9 -0
- package/dist/team/state.d.ts.map +1 -1
- package/dist/team/state.js +21 -0
- package/dist/team/state.js.map +1 -1
- package/dist/team/team-identity.d.ts +26 -0
- package/dist/team/team-identity.d.ts.map +1 -0
- package/dist/team/team-identity.js +169 -0
- package/dist/team/team-identity.js.map +1 -0
- package/dist/team/tmux-session.d.ts +18 -0
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +61 -1
- package/dist/team/tmux-session.js.map +1 -1
- package/dist/team/worker-bootstrap.d.ts +2 -0
- package/dist/team/worker-bootstrap.d.ts.map +1 -1
- package/dist/team/worker-bootstrap.js +10 -1
- package/dist/team/worker-bootstrap.js.map +1 -1
- package/package.json +1 -1
- package/plugins/oh-my-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/oh-my-codex/skills/ai-slop-cleaner/SKILL.md +30 -5
- package/skills/ai-slop-cleaner/SKILL.md +30 -5
- package/src/scripts/__tests__/codex-native-hook.test.ts +398 -2
- package/src/scripts/codex-native-hook.ts +115 -5
- package/src/scripts/codex-native-pre-post.ts +121 -0
- package/src/scripts/notify-hook/team-worker-posttooluse.ts +1 -1
- package/src/scripts/notify-hook.ts +1 -1
- package/src/scripts/sync-plugin-mirror.ts +11 -2
|
@@ -616,6 +616,125 @@ function buildDocumentRefreshPreToolUseOutput(
|
|
|
616
616
|
return buildDocumentRefreshAdvisoryOutput(warning, "PreToolUse");
|
|
617
617
|
}
|
|
618
618
|
|
|
619
|
+
|
|
620
|
+
const SLOPPY_FALLBACK_PHRASE_PATTERNS = [
|
|
621
|
+
/\bquick hack\b/i,
|
|
622
|
+
/\bhacky\b/i,
|
|
623
|
+
/\bworkaround for now\b/i,
|
|
624
|
+
/\btemporary workaround\b/i,
|
|
625
|
+
/\btemporary fallback\b/i,
|
|
626
|
+
/\bjust bypass\b/i,
|
|
627
|
+
/\bjust skip\b/i,
|
|
628
|
+
/\bskip (?:the )?(?:failing )?(?:test|validation|checks?)\b/i,
|
|
629
|
+
/\bfallback if (?:it|this|that) fails\b/i,
|
|
630
|
+
/\bfor now,? just\b/i,
|
|
631
|
+
/\bbypass (?:the )?(?:failing )?(?:test|validation|checks?)\b/i,
|
|
632
|
+
] as const;
|
|
633
|
+
|
|
634
|
+
const SLOPPY_FALLBACK_IMPLEMENTATION_CONTEXT_PATTERNS = [
|
|
635
|
+
/\badd\b/i,
|
|
636
|
+
/\bimplement\b/i,
|
|
637
|
+
/\bpatch\b/i,
|
|
638
|
+
/\bwrite\b/i,
|
|
639
|
+
/\bchange\b/i,
|
|
640
|
+
/\bfix\b/i,
|
|
641
|
+
/\bbypass\b/i,
|
|
642
|
+
/\bfallback\b/i,
|
|
643
|
+
/\bworkaround\b/i,
|
|
644
|
+
/\bskip\b/i,
|
|
645
|
+
/\bdisable\b/i,
|
|
646
|
+
] as const;
|
|
647
|
+
|
|
648
|
+
const SLOPPY_FALLBACK_GROUNDING_PATTERNS = [
|
|
649
|
+
/\btested\b/i,
|
|
650
|
+
/\btests? pass(?:ed)?\b/i,
|
|
651
|
+
/\bnpm (?:run )?test\b/i,
|
|
652
|
+
/\bnode --test\b/i,
|
|
653
|
+
/\bunit tests?\b/i,
|
|
654
|
+
/\bintegration tests?\b/i,
|
|
655
|
+
/\bregression tests?\b/i,
|
|
656
|
+
/\bcoverage\b/i,
|
|
657
|
+
/\bspec(?:ification)?\b/i,
|
|
658
|
+
/\bADR\b/,
|
|
659
|
+
/\barchitecture\b/i,
|
|
660
|
+
/\barchitect\b/i,
|
|
661
|
+
/\bdesign\b/i,
|
|
662
|
+
/\bbecause\b/i,
|
|
663
|
+
/\bcompatib(?:le|ility)\b/i,
|
|
664
|
+
/\bbackward-compatible\b/i,
|
|
665
|
+
/\bfail-safe\b/i,
|
|
666
|
+
/\bfailsafe\b/i,
|
|
667
|
+
/\benvironment issue\b/i,
|
|
668
|
+
/\benv(?:ironment)? problem\b/i,
|
|
669
|
+
/\buser approved\b/i,
|
|
670
|
+
/\bapproved by (?:the )?user\b/i,
|
|
671
|
+
/(?:^|\s)#\d+\b/,
|
|
672
|
+
/\bPR\s*#?\d+\b/i,
|
|
673
|
+
] as const;
|
|
674
|
+
|
|
675
|
+
const READ_ONLY_COMMAND_TOKENS = new Set([
|
|
676
|
+
"cat",
|
|
677
|
+
"find",
|
|
678
|
+
"grep",
|
|
679
|
+
"head",
|
|
680
|
+
"less",
|
|
681
|
+
"ls",
|
|
682
|
+
"rg",
|
|
683
|
+
"sed",
|
|
684
|
+
"tail",
|
|
685
|
+
]);
|
|
686
|
+
|
|
687
|
+
function commandStartsWithReadOnlyInspection(command: string): boolean {
|
|
688
|
+
if (commandHasWriteLikeIntent(command)) return false;
|
|
689
|
+
const tokens = tokenizeShellCommand(command);
|
|
690
|
+
if (!tokens || tokens.length === 0) return false;
|
|
691
|
+
let commandToken = tokens[0] ?? "";
|
|
692
|
+
if (commandToken === "env") {
|
|
693
|
+
const nextCommand = tokens.find((token, index) => index > 0 && !token.startsWith("-") && !isInlineShellEnvAssignment(token));
|
|
694
|
+
commandToken = nextCommand ?? commandToken;
|
|
695
|
+
}
|
|
696
|
+
const basename = commandToken.replace(/\\/g, "/").split("/").pop()?.toLowerCase() ?? commandToken.toLowerCase();
|
|
697
|
+
if (!READ_ONLY_COMMAND_TOKENS.has(basename)) return false;
|
|
698
|
+
if (basename === "sed" && tokens.some((token) => token === "-i" || token.startsWith("-i"))) return false;
|
|
699
|
+
if (basename === "cat" && /(?:^|[;&|]\s*)cat\b[\s\S]{0,200}>\s*[^\s&|;]+/.test(command)) return false;
|
|
700
|
+
return !/\|\s*(?:sh|bash|zsh|python3?|node|perl|ruby|apply_patch)\b/i.test(command);
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
function commandHasWriteLikeIntent(command: string): boolean {
|
|
704
|
+
return /\bapply_patch\b/.test(command)
|
|
705
|
+
|| /(?:^|[;&|]\s*)(?:cat|printf|echo)\b[\s\S]{0,200}>\s*[^\s&|;]+/.test(command)
|
|
706
|
+
|| /\btee\s+(?:-a\s+)?[^\s&|;]+/.test(command)
|
|
707
|
+
|| /\bsed\s+(?:[^\n;&|]*\s)?-i(?:\b|['"])/.test(command)
|
|
708
|
+
|| /\b(?:python3?|node|perl|ruby)\b[\s\S]{0,240}\b(?:writeFileSync|writeFile|write_text|open\([^)]*["']w|File\.write|Path\()/.test(command)
|
|
709
|
+
|| /<<['"]?[A-Za-z0-9_ -]+['"]?[\s\S]*(?:^|\n)(?:\+\+\+\s|---\s|import\s|export\s|function\s|const\s|class\s|interface\s)/m.test(command);
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
function hasAnyPattern(text: string, patterns: readonly RegExp[]): boolean {
|
|
713
|
+
return patterns.some((pattern) => pattern.test(text));
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
function detectSloppyFallbackFraming(command: string): boolean {
|
|
717
|
+
const trimmed = command.trim();
|
|
718
|
+
if (!trimmed) return false;
|
|
719
|
+
if (commandStartsWithReadOnlyInspection(trimmed)) return false;
|
|
720
|
+
if (!commandHasWriteLikeIntent(trimmed)) return false;
|
|
721
|
+
if (!hasAnyPattern(trimmed, SLOPPY_FALLBACK_PHRASE_PATTERNS)) return false;
|
|
722
|
+
if (!hasAnyPattern(trimmed, SLOPPY_FALLBACK_IMPLEMENTATION_CONTEXT_PATTERNS)) return false;
|
|
723
|
+
if (hasAnyPattern(trimmed, SLOPPY_FALLBACK_GROUNDING_PATTERNS)) return false;
|
|
724
|
+
return true;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
function buildSloppyFallbackPreToolUseOutput(commandText: string): Record<string, unknown> | null {
|
|
728
|
+
if (!detectSloppyFallbackFraming(commandText)) return null;
|
|
729
|
+
return {
|
|
730
|
+
hookSpecificOutput: {
|
|
731
|
+
hookEventName: "PreToolUse",
|
|
732
|
+
},
|
|
733
|
+
systemMessage:
|
|
734
|
+
"Sloppy fallback/workaround framing detected: don't make potential slop. Consult an architect for a concrete architecture, or ask the user if this is an environment issue before adding bypass/fallback code.",
|
|
735
|
+
};
|
|
736
|
+
}
|
|
737
|
+
|
|
619
738
|
function commandInvokesOmxQuestion(command: string): boolean {
|
|
620
739
|
const tokens = tokenizeShellCommand(command)?.map((token) => token.toLowerCase()) ?? [];
|
|
621
740
|
for (let index = 0; index < tokens.length; index += 1) {
|
|
@@ -746,6 +865,8 @@ export function buildNativePreToolUseOutput(
|
|
|
746
865
|
safeString(payload.cwd).trim() || process.cwd(),
|
|
747
866
|
);
|
|
748
867
|
if (documentRefreshWarning) return documentRefreshWarning;
|
|
868
|
+
const sloppyFallbackWarning = buildSloppyFallbackPreToolUseOutput(normalized.normalizedCommand);
|
|
869
|
+
if (sloppyFallbackWarning) return sloppyFallbackWarning;
|
|
749
870
|
if (!matchesDestructiveFixture(normalized.normalizedCommand)) return null;
|
|
750
871
|
|
|
751
872
|
return {
|
|
@@ -400,7 +400,7 @@ export async function handleTeamWorkerPostToolUseSuccess(
|
|
|
400
400
|
if (readToolName(payload) !== 'Bash') return { handled: false, status: 'skipped', reason: 'not_bash', operationKinds: [] };
|
|
401
401
|
if (readExitCode(payload) !== 0) return { handled: false, status: 'skipped', reason: 'nonzero_exit', operationKinds: [] };
|
|
402
402
|
|
|
403
|
-
const parsedWorker = parseTeamWorkerEnv(env.OMX_TEAM_WORKER);
|
|
403
|
+
const parsedWorker = parseTeamWorkerEnv(env.OMX_TEAM_INTERNAL_WORKER ?? env.OMX_TEAM_WORKER);
|
|
404
404
|
if (!parsedWorker) return { handled: false, status: 'skipped', reason: 'missing_worker_env', operationKinds: [] };
|
|
405
405
|
|
|
406
406
|
const resolvedStateRoot = await resolveWorkerTeamStateRoot(cwd, parsedWorker, env);
|
|
@@ -179,7 +179,7 @@ async function main() {
|
|
|
179
179
|
const isTurnComplete = isTurnCompletePayload(payload);
|
|
180
180
|
|
|
181
181
|
// Team worker detection via environment variable
|
|
182
|
-
const teamWorkerEnv = process.env.OMX_TEAM_WORKER; // e.g., "fix-ts/worker-1"
|
|
182
|
+
const teamWorkerEnv = process.env.OMX_TEAM_INTERNAL_WORKER || process.env.OMX_TEAM_WORKER; // e.g., "fix-ts/worker-1"
|
|
183
183
|
const parsedTeamWorker = parseTeamWorkerEnv(teamWorkerEnv);
|
|
184
184
|
const isTeamWorker = !!parsedTeamWorker;
|
|
185
185
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
3
|
import { cp, mkdir, readFile, readdir, rm, writeFile } from "node:fs/promises";
|
|
4
|
-
import { dirname, join } from "node:path";
|
|
4
|
+
import { dirname, join, resolve } from "node:path";
|
|
5
5
|
import process from "node:process";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
6
7
|
import {
|
|
7
8
|
getSetupInstallableSkillNames,
|
|
8
9
|
isCatalogInstallableStatus,
|
|
@@ -345,7 +346,15 @@ function parseArgs(argv: string[]): SyncPluginMirrorOptions {
|
|
|
345
346
|
};
|
|
346
347
|
}
|
|
347
348
|
|
|
348
|
-
|
|
349
|
+
export function isDirectCliInvocation(
|
|
350
|
+
importMetaUrl: string,
|
|
351
|
+
argvPath: string | undefined,
|
|
352
|
+
): boolean {
|
|
353
|
+
if (!argvPath) return false;
|
|
354
|
+
return fileURLToPath(importMetaUrl) === resolve(argvPath);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
if (isDirectCliInvocation(import.meta.url, process.argv[1])) {
|
|
349
358
|
syncPluginMirror(parseArgs(process.argv.slice(2)))
|
|
350
359
|
.then((result) => {
|
|
351
360
|
const action = result.checked ? "verified" : "synced";
|