@liangjie559567/ultrapower 5.4.2 → 5.4.4

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.
@@ -8,11 +8,11 @@
8
8
  {
9
9
  "name": "ultrapower",
10
10
  "description": "Disciplined multi-agent orchestration: workflow enforcement + parallel execution",
11
- "version": "5.4.2",
11
+ "version": "5.4.4",
12
12
  "source": {
13
13
  "source": "npm",
14
14
  "package": "@liangjie559567/ultrapower",
15
- "version": "5.4.2"
15
+ "version": "5.4.4"
16
16
  },
17
17
  "author": {
18
18
  "name": "liangjie559567"
@@ -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.4.2",
4
+ "version": "5.4.4",
5
5
  "author": {
6
6
  "name": "liangjie559567"
7
7
  },
@@ -16,5 +16,7 @@
16
16
  "orchestration",
17
17
  "workflows",
18
18
  "ultrapower"
19
- ]
19
+ ],
20
+ "hooks": "./hooks/hooks.json",
21
+ "agents": "./agents/"
20
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liangjie559567/ultrapower",
3
- "version": "5.4.2",
3
+ "version": "5.4.4",
4
4
  "description": "Disciplined multi-agent orchestration: workflow enforcement + parallel execution",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -235,6 +235,10 @@ function fixMissingPluginJson() {
235
235
  const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
236
236
  const version = pkg.version || '0.0.0';
237
237
 
238
+ // Include metadata fields + explicit component path declarations.
239
+ // Per official docs, paths must start with './' — auto-discovery constructs paths without
240
+ // this prefix, causing Zod validation errors: "hooks: Invalid input, agents: Invalid input".
241
+ // Declaring explicit paths prevents auto-discovery from taking over.
238
242
  const pluginJson = {
239
243
  name: 'ultrapower',
240
244
  description: pkg.description || '',
@@ -244,22 +248,39 @@ function fixMissingPluginJson() {
244
248
  repository: pkg.repository?.url || pkg.repository || '',
245
249
  license: pkg.license || 'MIT',
246
250
  keywords: pkg.keywords || [],
247
- skills: './skills/',
248
- mcpServers: './.mcp.json'
251
+ hooks: './hooks/hooks.json',
252
+ agents: './agents/',
249
253
  };
250
254
  const pluginJsonStr = JSON.stringify(pluginJson, null, 2);
251
255
 
256
+ // Detect cache entries that need repair:
257
+ // - Missing hooks or agents fields (old clean format from v5.4.3)
258
+ // - hooks/agents not declared as relative string paths starting with './'
259
+ // - Old invalid inline object/array formats from v5.3.x
260
+ function needsRepair(jsonPath) {
261
+ try {
262
+ const content = JSON.parse(readFileSync(jsonPath, 'utf-8'));
263
+ // hooks must be a string path starting with './'
264
+ if (!content.hooks || typeof content.hooks !== 'string' || !content.hooks.startsWith('./')) return true;
265
+ // agents must be a string path starting with './'
266
+ if (!content.agents || typeof content.agents !== 'string' || !content.agents.startsWith('./')) return true;
267
+ return false;
268
+ } catch { return false; }
269
+ }
270
+
252
271
  // 1. Write to current install location (npm-cache node_modules dir)
272
+ // Also overwrite if existing file has missing or incorrectly formatted component paths.
253
273
  const localPluginJsonDir = join(pluginRoot, '.claude-plugin');
254
274
  const localPluginJsonPath = join(localPluginJsonDir, 'plugin.json');
255
- if (!existsSync(localPluginJsonPath)) {
275
+ if (!existsSync(localPluginJsonPath) || needsRepair(localPluginJsonPath)) {
256
276
  mkdirSync(localPluginJsonDir, { recursive: true });
257
277
  writeFileSync(localPluginJsonPath, pluginJsonStr);
258
- console.log('[OMC] Created .claude-plugin/plugin.json in install dir');
278
+ console.log('[OMC] Wrote .claude-plugin/plugin.json with correct component paths in install dir');
259
279
  }
260
280
 
261
- // 2. Write directly to plugin cache (marketplace: ultrapower, plugin: ultrapower)
281
+ // 2. Write directly to plugin cache (marketplace: omc, plugin: ultrapower)
262
282
  // Claude Code copies from npm-cache but skips hidden dirs, so we patch the cache directly.
283
+ // Also repair any existing cache entries with missing or invalid component path formats.
263
284
  const pluginCacheBase = join(CLAUDE_DIR, 'plugins/cache/omc/ultrapower');
264
285
  if (existsSync(pluginCacheBase)) {
265
286
  const versions = readdirSync(pluginCacheBase);
@@ -267,12 +288,12 @@ function fixMissingPluginJson() {
267
288
  const cacheVersionDir = join(pluginCacheBase, v);
268
289
  const cachePluginJsonDir = join(cacheVersionDir, '.claude-plugin');
269
290
  const cachePluginJsonPath = join(cachePluginJsonDir, 'plugin.json');
270
- if (!existsSync(cachePluginJsonPath)) {
291
+ if (!existsSync(cachePluginJsonPath) || needsRepair(cachePluginJsonPath)) {
271
292
  mkdirSync(cachePluginJsonDir, { recursive: true });
272
293
  // Use version-specific content for each cached version
273
294
  const versionedPkg = { ...pluginJson, version: v };
274
295
  writeFileSync(cachePluginJsonPath, JSON.stringify(versionedPkg, null, 2));
275
- console.log(`[OMC] Created .claude-plugin/plugin.json in plugin cache v${v}`);
296
+ console.log(`[OMC] Wrote .claude-plugin/plugin.json with correct component paths in plugin cache v${v}`);
276
297
  }
277
298
  }
278
299
  }