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.
Files changed (166) hide show
  1. package/Cargo.lock +5 -5
  2. package/Cargo.toml +1 -1
  3. package/dist/agents/__tests__/native-config.test.js +33 -0
  4. package/dist/agents/__tests__/native-config.test.js.map +1 -1
  5. package/dist/catalog/__tests__/plugin-bundle-ssot.test.js +9 -1
  6. package/dist/catalog/__tests__/plugin-bundle-ssot.test.js.map +1 -1
  7. package/dist/cli/__tests__/doctor-context-window-warning.test.d.ts +2 -0
  8. package/dist/cli/__tests__/doctor-context-window-warning.test.d.ts.map +1 -0
  9. package/dist/cli/__tests__/doctor-context-window-warning.test.js +122 -0
  10. package/dist/cli/__tests__/doctor-context-window-warning.test.js.map +1 -0
  11. package/dist/cli/__tests__/doctor-warning-copy.test.js +2 -2
  12. package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -1
  13. package/dist/cli/__tests__/exec.test.js +1 -0
  14. package/dist/cli/__tests__/exec.test.js.map +1 -1
  15. package/dist/cli/__tests__/explore.test.js +40 -17
  16. package/dist/cli/__tests__/explore.test.js.map +1 -1
  17. package/dist/cli/__tests__/index.test.js +141 -8
  18. package/dist/cli/__tests__/index.test.js.map +1 -1
  19. package/dist/cli/__tests__/mcp-serve.test.js +27 -1
  20. package/dist/cli/__tests__/mcp-serve.test.js.map +1 -1
  21. package/dist/cli/__tests__/ralph.test.js +59 -1
  22. package/dist/cli/__tests__/ralph.test.js.map +1 -1
  23. package/dist/cli/__tests__/setup-scope.test.js +2 -1
  24. package/dist/cli/__tests__/setup-scope.test.js.map +1 -1
  25. package/dist/cli/__tests__/team.test.js +55 -10
  26. package/dist/cli/__tests__/team.test.js.map +1 -1
  27. package/dist/cli/doctor.d.ts.map +1 -1
  28. package/dist/cli/doctor.js +46 -3
  29. package/dist/cli/doctor.js.map +1 -1
  30. package/dist/cli/index.d.ts +16 -1
  31. package/dist/cli/index.d.ts.map +1 -1
  32. package/dist/cli/index.js +126 -15
  33. package/dist/cli/index.js.map +1 -1
  34. package/dist/cli/mcp-serve.d.ts +1 -0
  35. package/dist/cli/mcp-serve.d.ts.map +1 -1
  36. package/dist/cli/mcp-serve.js +8 -0
  37. package/dist/cli/mcp-serve.js.map +1 -1
  38. package/dist/cli/ralph.d.ts +2 -0
  39. package/dist/cli/ralph.d.ts.map +1 -1
  40. package/dist/cli/ralph.js +17 -1
  41. package/dist/cli/ralph.js.map +1 -1
  42. package/dist/cli/team.d.ts +4 -0
  43. package/dist/cli/team.d.ts.map +1 -1
  44. package/dist/cli/team.js +47 -22
  45. package/dist/cli/team.js.map +1 -1
  46. package/dist/config/__tests__/generator-idempotent.test.js +27 -5
  47. package/dist/config/__tests__/generator-idempotent.test.js.map +1 -1
  48. package/dist/config/generator.d.ts +11 -2
  49. package/dist/config/generator.d.ts.map +1 -1
  50. package/dist/config/generator.js +114 -58
  51. package/dist/config/generator.js.map +1 -1
  52. package/dist/hooks/__tests__/agents-overlay.test.js +59 -0
  53. package/dist/hooks/__tests__/agents-overlay.test.js.map +1 -1
  54. package/dist/hooks/__tests__/anti-slop-workflow.test.js +109 -18
  55. package/dist/hooks/__tests__/anti-slop-workflow.test.js.map +1 -1
  56. package/dist/hooks/agents-overlay.d.ts.map +1 -1
  57. package/dist/hooks/agents-overlay.js +21 -0
  58. package/dist/hooks/agents-overlay.js.map +1 -1
  59. package/dist/hud/__tests__/index.test.js +30 -14
  60. package/dist/hud/__tests__/index.test.js.map +1 -1
  61. package/dist/openclaw/__tests__/dispatcher.test.js +1 -1
  62. package/dist/openclaw/__tests__/dispatcher.test.js.map +1 -1
  63. package/dist/pipeline/__tests__/stages.test.js +398 -14
  64. package/dist/pipeline/__tests__/stages.test.js.map +1 -1
  65. package/dist/pipeline/stages/team-exec.d.ts +8 -4
  66. package/dist/pipeline/stages/team-exec.d.ts.map +1 -1
  67. package/dist/pipeline/stages/team-exec.js +198 -13
  68. package/dist/pipeline/stages/team-exec.js.map +1 -1
  69. package/dist/planning/__tests__/artifacts.test.js +246 -1
  70. package/dist/planning/__tests__/artifacts.test.js.map +1 -1
  71. package/dist/planning/artifact-names.d.ts +13 -0
  72. package/dist/planning/artifact-names.d.ts.map +1 -0
  73. package/dist/planning/artifact-names.js +108 -0
  74. package/dist/planning/artifact-names.js.map +1 -0
  75. package/dist/planning/artifacts.d.ts +22 -1
  76. package/dist/planning/artifacts.d.ts.map +1 -1
  77. package/dist/planning/artifacts.js +165 -50
  78. package/dist/planning/artifacts.js.map +1 -1
  79. package/dist/ralph/__tests__/persistence.test.js +21 -1
  80. package/dist/ralph/__tests__/persistence.test.js.map +1 -1
  81. package/dist/ralph/persistence.d.ts.map +1 -1
  82. package/dist/ralph/persistence.js +6 -4
  83. package/dist/ralph/persistence.js.map +1 -1
  84. package/dist/scripts/__tests__/codex-native-hook.test.js +352 -2
  85. package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -1
  86. package/dist/scripts/codex-native-hook.d.ts.map +1 -1
  87. package/dist/scripts/codex-native-hook.js +85 -6
  88. package/dist/scripts/codex-native-hook.js.map +1 -1
  89. package/dist/scripts/codex-native-pre-post.d.ts.map +1 -1
  90. package/dist/scripts/codex-native-pre-post.js +123 -0
  91. package/dist/scripts/codex-native-pre-post.js.map +1 -1
  92. package/dist/scripts/notify-hook/team-worker-posttooluse.js +1 -1
  93. package/dist/scripts/notify-hook/team-worker-posttooluse.js.map +1 -1
  94. package/dist/scripts/notify-hook.js +1 -1
  95. package/dist/scripts/notify-hook.js.map +1 -1
  96. package/dist/scripts/sync-plugin-mirror.d.ts +1 -0
  97. package/dist/scripts/sync-plugin-mirror.d.ts.map +1 -1
  98. package/dist/scripts/sync-plugin-mirror.js +8 -2
  99. package/dist/scripts/sync-plugin-mirror.js.map +1 -1
  100. package/dist/state/__tests__/skill-active.test.js +41 -0
  101. package/dist/state/__tests__/skill-active.test.js.map +1 -1
  102. package/dist/team/__tests__/api-interop.test.js +220 -0
  103. package/dist/team/__tests__/api-interop.test.js.map +1 -1
  104. package/dist/team/__tests__/model-contract.test.js +40 -9
  105. package/dist/team/__tests__/model-contract.test.js.map +1 -1
  106. package/dist/team/__tests__/repo-aware-decomposition.test.js +41 -0
  107. package/dist/team/__tests__/repo-aware-decomposition.test.js.map +1 -1
  108. package/dist/team/__tests__/runtime-cli.test.js +24 -0
  109. package/dist/team/__tests__/runtime-cli.test.js.map +1 -1
  110. package/dist/team/__tests__/runtime.test.js +446 -67
  111. package/dist/team/__tests__/runtime.test.js.map +1 -1
  112. package/dist/team/__tests__/state.test.js +13 -0
  113. package/dist/team/__tests__/state.test.js.map +1 -1
  114. package/dist/team/__tests__/team-identity.test.d.ts +2 -0
  115. package/dist/team/__tests__/team-identity.test.d.ts.map +1 -0
  116. package/dist/team/__tests__/team-identity.test.js +166 -0
  117. package/dist/team/__tests__/team-identity.test.js.map +1 -0
  118. package/dist/team/__tests__/tmux-session.test.js +55 -1
  119. package/dist/team/__tests__/tmux-session.test.js.map +1 -1
  120. package/dist/team/__tests__/worker-bootstrap.test.js +12 -0
  121. package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -1
  122. package/dist/team/api-interop.d.ts +1 -0
  123. package/dist/team/api-interop.d.ts.map +1 -1
  124. package/dist/team/api-interop.js +159 -129
  125. package/dist/team/api-interop.js.map +1 -1
  126. package/dist/team/delivery-log.d.ts +1 -1
  127. package/dist/team/delivery-log.d.ts.map +1 -1
  128. package/dist/team/delivery-log.js.map +1 -1
  129. package/dist/team/repo-aware-decomposition.d.ts +3 -0
  130. package/dist/team/repo-aware-decomposition.d.ts.map +1 -1
  131. package/dist/team/repo-aware-decomposition.js +2 -0
  132. package/dist/team/repo-aware-decomposition.js.map +1 -1
  133. package/dist/team/runtime-cli.d.ts +32 -2
  134. package/dist/team/runtime-cli.d.ts.map +1 -1
  135. package/dist/team/runtime-cli.js +78 -26
  136. package/dist/team/runtime-cli.js.map +1 -1
  137. package/dist/team/runtime.d.ts +1 -1
  138. package/dist/team/runtime.d.ts.map +1 -1
  139. package/dist/team/runtime.js +338 -35
  140. package/dist/team/runtime.js.map +1 -1
  141. package/dist/team/state.d.ts +9 -0
  142. package/dist/team/state.d.ts.map +1 -1
  143. package/dist/team/state.js +21 -0
  144. package/dist/team/state.js.map +1 -1
  145. package/dist/team/team-identity.d.ts +26 -0
  146. package/dist/team/team-identity.d.ts.map +1 -0
  147. package/dist/team/team-identity.js +169 -0
  148. package/dist/team/team-identity.js.map +1 -0
  149. package/dist/team/tmux-session.d.ts +18 -0
  150. package/dist/team/tmux-session.d.ts.map +1 -1
  151. package/dist/team/tmux-session.js +61 -1
  152. package/dist/team/tmux-session.js.map +1 -1
  153. package/dist/team/worker-bootstrap.d.ts +2 -0
  154. package/dist/team/worker-bootstrap.d.ts.map +1 -1
  155. package/dist/team/worker-bootstrap.js +10 -1
  156. package/dist/team/worker-bootstrap.js.map +1 -1
  157. package/package.json +1 -1
  158. package/plugins/oh-my-codex/.codex-plugin/plugin.json +1 -1
  159. package/plugins/oh-my-codex/skills/ai-slop-cleaner/SKILL.md +30 -5
  160. package/skills/ai-slop-cleaner/SKILL.md +30 -5
  161. package/src/scripts/__tests__/codex-native-hook.test.ts +398 -2
  162. package/src/scripts/codex-native-hook.ts +115 -5
  163. package/src/scripts/codex-native-pre-post.ts +121 -0
  164. package/src/scripts/notify-hook/team-worker-posttooluse.ts +1 -1
  165. package/src/scripts/notify-hook.ts +1 -1
  166. 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
- if (import.meta.url === `file://${process.argv[1]}`) {
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";