@liangjie559567/ultrapower 5.4.3 → 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.3",
11
+ "version": "5.4.4",
12
12
  "source": {
13
13
  "source": "npm",
14
14
  "package": "@liangjie559567/ultrapower",
15
- "version": "5.4.3"
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.3",
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.3",
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,8 +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
- // Only include metadata fields no component paths (hooks, agents, skills, commands, mcpServers)
239
- // which cause Zod validation errors in Claude Code's plugin manifest validator.
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.
240
242
  const pluginJson = {
241
243
  name: 'ultrapower',
242
244
  description: pkg.description || '',
@@ -246,32 +248,39 @@ function fixMissingPluginJson() {
246
248
  repository: pkg.repository?.url || pkg.repository || '',
247
249
  license: pkg.license || 'MIT',
248
250
  keywords: pkg.keywords || [],
251
+ hooks: './hooks/hooks.json',
252
+ agents: './agents/',
249
253
  };
250
254
  const pluginJsonStr = JSON.stringify(pluginJson, null, 2);
251
255
 
252
- // Fields that cause validation errors if present — used to detect and repair bad cache entries
253
- const INVALID_FIELDS = ['hooks', 'agents', 'skills', 'commands', 'mcpServers'];
254
- function hasInvalidFields(jsonPath) {
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) {
255
261
  try {
256
262
  const content = JSON.parse(readFileSync(jsonPath, 'utf-8'));
257
- return INVALID_FIELDS.some(f => f in content);
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;
258
268
  } catch { return false; }
259
269
  }
260
270
 
261
271
  // 1. Write to current install location (npm-cache node_modules dir)
262
- // Also overwrite if existing file contains invalid component path fields.
272
+ // Also overwrite if existing file has missing or incorrectly formatted component paths.
263
273
  const localPluginJsonDir = join(pluginRoot, '.claude-plugin');
264
274
  const localPluginJsonPath = join(localPluginJsonDir, 'plugin.json');
265
- if (!existsSync(localPluginJsonPath) || hasInvalidFields(localPluginJsonPath)) {
275
+ if (!existsSync(localPluginJsonPath) || needsRepair(localPluginJsonPath)) {
266
276
  mkdirSync(localPluginJsonDir, { recursive: true });
267
277
  writeFileSync(localPluginJsonPath, pluginJsonStr);
268
- console.log('[OMC] Wrote clean .claude-plugin/plugin.json in install dir');
278
+ console.log('[OMC] Wrote .claude-plugin/plugin.json with correct component paths in install dir');
269
279
  }
270
280
 
271
281
  // 2. Write directly to plugin cache (marketplace: omc, plugin: ultrapower)
272
282
  // Claude Code copies from npm-cache but skips hidden dirs, so we patch the cache directly.
273
- // Also overwrite any existing cache entries that contain invalid component path fields
274
- // left over from older versions of this script.
283
+ // Also repair any existing cache entries with missing or invalid component path formats.
275
284
  const pluginCacheBase = join(CLAUDE_DIR, 'plugins/cache/omc/ultrapower');
276
285
  if (existsSync(pluginCacheBase)) {
277
286
  const versions = readdirSync(pluginCacheBase);
@@ -279,12 +288,12 @@ function fixMissingPluginJson() {
279
288
  const cacheVersionDir = join(pluginCacheBase, v);
280
289
  const cachePluginJsonDir = join(cacheVersionDir, '.claude-plugin');
281
290
  const cachePluginJsonPath = join(cachePluginJsonDir, 'plugin.json');
282
- if (!existsSync(cachePluginJsonPath) || hasInvalidFields(cachePluginJsonPath)) {
291
+ if (!existsSync(cachePluginJsonPath) || needsRepair(cachePluginJsonPath)) {
283
292
  mkdirSync(cachePluginJsonDir, { recursive: true });
284
293
  // Use version-specific content for each cached version
285
294
  const versionedPkg = { ...pluginJson, version: v };
286
295
  writeFileSync(cachePluginJsonPath, JSON.stringify(versionedPkg, null, 2));
287
- console.log(`[OMC] Wrote clean .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}`);
288
297
  }
289
298
  }
290
299
  }