antigravity-seo-kit 2.9.8 → 2.9.9

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 (2) hide show
  1. package/lib/installer.js +45 -37
  2. package/package.json +1 -1
package/lib/installer.js CHANGED
@@ -73,7 +73,7 @@ async function install(licenseKey, cwd) {
73
73
  const legacyAgentDir = path.join(cwd, '.agent');
74
74
  const newAgentsDir = path.join(cwd, '.agents');
75
75
 
76
- if (fs.existsSync(legacyAgentDir) && !fs.existsSync(newAgentsDir)) {
76
+ if (fs.existsSync(legacyAgentDir)) {
77
77
  const spinMigrate = spinner('Restructuring to .agents/ format...').start();
78
78
  try {
79
79
  fs.mkdirSync(newAgentsDir, { recursive: true });
@@ -98,7 +98,7 @@ async function install(licenseKey, cwd) {
98
98
  }
99
99
  }
100
100
 
101
- // Remove legacy .agent/
101
+ // Remove legacy .agent/ — only .agents/ should remain
102
102
  removeRecursive(legacyAgentDir);
103
103
 
104
104
  spinMigrate.succeed(`Restructured to .agents/ format (${migrateCount} files)`);
@@ -499,53 +499,61 @@ async function installPlugin(licenseKey) {
499
499
  process.exit(1);
500
500
  }
501
501
 
502
- // Step 3: Restructure into .agents/ plugin format
503
- // v3.0: Downloaded assets arrive in .agents/ structure already
504
- // Handle legacy .agent/ if server still serves old format
502
+ // Step 3: Restructure downloaded assets into global plugin format
503
+ // Tarball contains flat .agents/ structure (skills, rules, workflows, etc.)
504
+ // For global plugin: skills, rules, hooks, mcp_config plugin root
505
+ // Workspace-level dirs → prefixed with _workspace_ for setupWorkspace()
505
506
  const legacyAgentDir = path.join(globalPluginDir, '.agent');
506
507
  const newAgentsDir = path.join(globalPluginDir, '.agents');
507
508
 
508
- if (fs.existsSync(legacyAgentDir) && !fs.existsSync(newAgentsDir)) {
509
- // Legacy format: flatten .agent/ into plugin root
510
- const entries = fs.readdirSync(legacyAgentDir);
511
- for (const entry of entries) {
512
- const srcPath = path.join(legacyAgentDir, entry);
513
- const destPath = path.join(globalPluginDir, entry);
514
- if (fs.existsSync(destPath)) {
515
- removeRecursive(destPath);
509
+ const downloadedDir = fs.existsSync(newAgentsDir) ? newAgentsDir
510
+ : fs.existsSync(legacyAgentDir) ? legacyAgentDir
511
+ : null;
512
+
513
+ if (downloadedDir) {
514
+ // Plugin-level contents plugin root directly
515
+ const pluginDirs = ['skills', 'rules'];
516
+ const pluginFiles = ['hooks.json', 'mcp_config.json', 'plugin.json'];
517
+
518
+ for (const dir of pluginDirs) {
519
+ const src = path.join(downloadedDir, dir);
520
+ const dest = path.join(globalPluginDir, dir);
521
+ if (fs.existsSync(src)) {
522
+ if (fs.existsSync(dest)) removeRecursive(dest);
523
+ fs.renameSync(src, dest);
516
524
  }
517
- fs.renameSync(srcPath, destPath);
518
525
  }
519
- removeRecursive(legacyAgentDir);
520
- } else if (fs.existsSync(newAgentsDir)) {
521
- // v3.0 format: move plugin contents (skills, rules) to plugin root
522
- const pluginSrcDir = path.join(newAgentsDir, 'plugins', 'antigravity-seo-kit');
523
- if (fs.existsSync(pluginSrcDir)) {
524
- for (const entry of fs.readdirSync(pluginSrcDir)) {
525
- const srcPath = path.join(pluginSrcDir, entry);
526
- const destPath = path.join(globalPluginDir, entry);
527
- if (fs.existsSync(destPath)) {
528
- removeRecursive(destPath);
529
- }
530
- fs.renameSync(srcPath, destPath);
526
+
527
+ for (const file of pluginFiles) {
528
+ const src = path.join(downloadedDir, file);
529
+ const dest = path.join(globalPluginDir, file);
530
+ if (fs.existsSync(src)) {
531
+ if (fs.existsSync(dest)) fs.unlinkSync(dest);
532
+ fs.renameSync(src, dest);
531
533
  }
532
534
  }
533
- // Keep workspace-level dirs (agents, workflows) for setupWorkspace
535
+
536
+ // Workspace-level dirs → _workspace_ prefix (for setupWorkspace later)
534
537
  const workspaceDirs = ['agents', 'workflows', 'scripts', 'config', 'dashboard', 'docs', '.shared'];
535
538
  for (const dir of workspaceDirs) {
536
- const srcDir = path.join(newAgentsDir, dir);
537
- const destDir = path.join(globalPluginDir, `_workspace_${dir}`);
538
- if (fs.existsSync(srcDir)) {
539
- if (fs.existsSync(destDir)) removeRecursive(destDir);
540
- fs.renameSync(srcDir, destDir);
539
+ const src = path.join(downloadedDir, dir);
540
+ const dest = path.join(globalPluginDir, `_workspace_${dir}`);
541
+ if (fs.existsSync(src)) {
542
+ if (fs.existsSync(dest)) removeRecursive(dest);
543
+ fs.renameSync(src, dest);
541
544
  }
542
545
  }
543
- // Copy seo-architecture.md
544
- const archFile = path.join(newAgentsDir, 'seo-architecture.md');
545
- if (fs.existsSync(archFile)) {
546
- fs.copyFileSync(archFile, path.join(globalPluginDir, '_workspace_seo-architecture.md'));
546
+
547
+ // Workspace root files (.md) → _workspace_ prefix
548
+ for (const f of fs.readdirSync(downloadedDir)) {
549
+ const src = path.join(downloadedDir, f);
550
+ if (fs.statSync(src).isFile() && f.endsWith('.md')) {
551
+ fs.copyFileSync(src, path.join(globalPluginDir, `_workspace_${f}`));
552
+ }
547
553
  }
548
- removeRecursive(newAgentsDir);
554
+
555
+ // Clean up extracted dir
556
+ removeRecursive(downloadedDir);
549
557
  }
550
558
 
551
559
  // Step 4: Ensure plugin.json and installed_version.json
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antigravity-seo-kit",
3
- "version": "2.9.8",
3
+ "version": "2.9.9",
4
4
  "description": "Professional Agentic SEO Platform for Google Antigravity 2 AI Agent — 44 specialized skills covering technical audit, E-E-A-T, schema, GEO, local SEO & more",
5
5
  "main": "lib/installer.js",
6
6
  "bin": {