@liangjie559567/ultrapower 5.0.18 → 5.0.20

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ultrapower",
3
3
  "description": "Disciplined multi-agent orchestration: workflow enforcement + parallel execution. Combines superpowers' TDD/debugging discipline with OMC's multi-agent execution capabilities.",
4
- "version": "5.0.18",
4
+ "version": "5.0.20",
5
5
  "author": {
6
6
  "name": "Jesse Vincent & oh-my-claudecode contributors"
7
7
  },
package/docs/CLAUDE.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <!-- OMC:START -->
2
- <!-- OMC:VERSION:5.0.18 -->
2
+ <!-- OMC:VERSION:5.0.20 -->
3
3
  # ultrapower - Multi-Agent Orchestration 智能多 Agent 编排
4
4
 
5
5
  你正在使用 ultrapower(OMC),这是 Claude Code 的多 agent 编排层。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liangjie559567/ultrapower",
3
- "version": "5.0.18",
3
+ "version": "5.0.20",
4
4
  "description": "Disciplined multi-agent orchestration: workflow enforcement + parallel execution",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -19,9 +19,12 @@ const SETTINGS_FILE = join(CLAUDE_DIR, 'settings.json');
19
19
 
20
20
  console.log('[OMC] Running post-install setup...');
21
21
 
22
- // Fix: flatten nested cache directories caused by installer wrapping content in plugin-name subdir.
23
- // The installer places npm package contents under cache/.../VERSION/ultrapower/ instead of cache/.../VERSION/
24
- // This function detects and fixes that by moving contents up one level.
22
+ // Fix: flatten nested cache directories caused by Claude Code installer bug.
23
+ // Root cause: xF6(src, dest) copies src contents to dest, but dest is a subdirectory of src.
24
+ // After mkdir -p dest, readdir(src) includes the newly created dest subdir, causing recursive copy.
25
+ // Result: cache/.../VERSION/ultrapower/VERSION/ultrapower/VERSION/... infinite nesting.
26
+ // This function detects and fixes arbitrary-depth nesting by finding the real plugin content
27
+ // and moving it up to the version directory, then removing all nested dirs.
25
28
  function fixNestedCacheDir() {
26
29
  try {
27
30
  const pluginCacheBase = join(CLAUDE_DIR, 'plugins/cache/ultrapower/ultrapower');
@@ -31,19 +34,51 @@ function fixNestedCacheDir() {
31
34
  const versionDir = join(pluginCacheBase, version);
32
35
  const nestedDir = join(versionDir, 'ultrapower');
33
36
  if (!existsSync(nestedDir)) continue;
34
- // Check if the nested dir itself has the actual plugin content (skills/, dist/, etc.)
35
- const nestedContents = readdirSync(nestedDir);
36
- const hasPluginContent = nestedContents.some(f => ['skills', 'dist', 'agents', 'hooks'].includes(f));
37
- if (!hasPluginContent) continue;
38
- console.log(`[OMC] Fixing nested cache dir for version ${version}...`);
39
- // Move contents of nestedDir up to versionDir, then remove nestedDir
40
- for (const item of nestedContents) {
41
- const src = join(nestedDir, item);
37
+
38
+ // Walk down the nesting to find the real plugin content (arbitrary depth)
39
+ // Real content has skills/, dist/, agents/, or hooks/ directly inside
40
+ const PLUGIN_MARKERS = ['skills', 'dist', 'agents', 'hooks'];
41
+ let realContentDir = null;
42
+ let searchDir = nestedDir;
43
+ let depth = 0;
44
+ while (depth < 20) {
45
+ const contents = readdirSync(searchDir);
46
+ if (contents.length === 0) {
47
+ // Empty dir - just remove it
48
+ rmSync(nestedDir, { recursive: true, force: true });
49
+ console.log(`[OMC] Removed empty nested dir for version ${version}`);
50
+ break;
51
+ }
52
+ if (contents.some(f => PLUGIN_MARKERS.includes(f))) {
53
+ realContentDir = searchDir;
54
+ break;
55
+ }
56
+ // Go deeper: look for ultrapower/ or version/ subdir
57
+ const nextDir = join(searchDir, 'ultrapower');
58
+ const nextVerDir = join(searchDir, version);
59
+ if (existsSync(nextDir)) {
60
+ searchDir = nextDir;
61
+ } else if (existsSync(nextVerDir)) {
62
+ searchDir = nextVerDir;
63
+ } else {
64
+ break;
65
+ }
66
+ depth++;
67
+ }
68
+
69
+ if (!realContentDir) continue;
70
+
71
+ console.log(`[OMC] Fixing nested cache dir for version ${version} (depth ${depth})...`);
72
+ // Move contents of realContentDir up to versionDir
73
+ const realContents = readdirSync(realContentDir);
74
+ for (const item of realContents) {
75
+ const src = join(realContentDir, item);
42
76
  const dest = join(versionDir, item);
43
77
  if (!existsSync(dest)) {
44
78
  renameSync(src, dest);
45
79
  }
46
80
  }
81
+ // Remove the entire nested ultrapower/ subtree
47
82
  rmSync(nestedDir, { recursive: true, force: true });
48
83
  console.log(`[OMC] Fixed nested cache dir for version ${version}`);
49
84
  }