antigravity-seo-kit 2.9.7 → 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 +95 -127
  2. package/package.json +1 -1
package/lib/installer.js CHANGED
@@ -69,19 +69,19 @@ async function install(licenseKey, cwd) {
69
69
  process.exit(1);
70
70
  }
71
71
 
72
- // Step 3: Restructure into .agents/ format if server sent legacy .agent/
72
+ // Step 3: Restructure into .agents/ flat format if server sent legacy .agent/
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 });
80
80
 
81
- // Workspace-level dirs .agents/
82
- const workspaceDirs = ['agents', 'workflows', 'scripts', 'config', 'dashboard', 'docs', '.shared'];
81
+ // ALL dirs go directly into .agents/ (flat workspace structure)
82
+ const allDirs = ['skills', 'rules', 'agents', 'workflows', 'scripts', 'config', 'dashboard', 'docs', '.shared'];
83
83
  let migrateCount = 0;
84
- for (const dir of workspaceDirs) {
84
+ for (const dir of allDirs) {
85
85
  const src = path.join(legacyAgentDir, dir);
86
86
  const dest = path.join(newAgentsDir, dir);
87
87
  if (fs.existsSync(src)) {
@@ -89,40 +89,16 @@ async function install(licenseKey, cwd) {
89
89
  }
90
90
  }
91
91
 
92
- // Root-level .md files → .agents/
92
+ // Root-level files (.md, .json) → .agents/
93
93
  for (const f of fs.readdirSync(legacyAgentDir)) {
94
94
  const src = path.join(legacyAgentDir, f);
95
- if (fs.statSync(src).isFile() && f.endsWith('.md')) {
95
+ if (fs.statSync(src).isFile()) {
96
96
  fs.copyFileSync(src, path.join(newAgentsDir, f));
97
97
  migrateCount++;
98
98
  }
99
99
  }
100
100
 
101
- // skills + rules .agents/plugins/antigravity-seo-kit/
102
- const pluginDir = path.join(newAgentsDir, 'plugins', 'antigravity-seo-kit');
103
- fs.mkdirSync(pluginDir, { recursive: true });
104
-
105
- const skillsSrc = path.join(legacyAgentDir, 'skills');
106
- if (fs.existsSync(skillsSrc)) {
107
- migrateCount += copyRecursive(skillsSrc, path.join(pluginDir, 'skills'), { overwrite: true });
108
- }
109
- const rulesSrc = path.join(legacyAgentDir, 'rules');
110
- if (fs.existsSync(rulesSrc)) {
111
- migrateCount += copyRecursive(rulesSrc, path.join(pluginDir, 'rules'), { overwrite: true });
112
- }
113
-
114
- // Create plugin.json
115
- const pluginJsonPath = path.join(pluginDir, 'plugin.json');
116
- if (!fs.existsSync(pluginJsonPath)) {
117
- fs.writeFileSync(pluginJsonPath, JSON.stringify({
118
- name: 'antigravity-seo-kit',
119
- version: PACKAGE_VERSION,
120
- description: 'Professional Agentic SEO Platform — 44+ specialized skills',
121
- author: { name: 'Solann', email: 'admin@solann.io' },
122
- }, null, 2), 'utf-8');
123
- }
124
-
125
- // Remove legacy .agent/ (downloaded files only, not user data)
101
+ // Remove legacy .agent/ only .agents/ should remain
126
102
  removeRecursive(legacyAgentDir);
127
103
 
128
104
  spinMigrate.succeed(`Restructured to .agents/ format (${migrateCount} files)`);
@@ -250,12 +226,6 @@ async function uninstall(cwd) {
250
226
  totalRemoved += legacyUninstall(cwd);
251
227
  }
252
228
 
253
- // Also clean .agents/plugins/antigravity-seo-kit/ if it exists (v3)
254
- const v3PluginDir = path.join(cwd, '.agents', 'plugins', 'antigravity-seo-kit');
255
- if (fs.existsSync(v3PluginDir)) {
256
- totalRemoved += removeRecursive(v3PluginDir);
257
- }
258
-
259
229
  // Remove license file
260
230
  removeLicenseFile(cwd);
261
231
 
@@ -354,11 +324,6 @@ async function status(cwd) {
354
324
  }
355
325
  }
356
326
  }
357
- // Also count plugin dir if v3
358
- const pluginSkillsDir = path.join(cwd, '.agents', 'plugins', 'antigravity-seo-kit', 'skills');
359
- if (fs.existsSync(pluginSkillsDir)) {
360
- totalLegacy += fs.readdirSync(pluginSkillsDir).length;
361
- }
362
327
  console.log(` ${colorize('cyan', 'Components:')} ${totalLegacy} installed`);
363
328
  }
364
329
 
@@ -534,53 +499,61 @@ async function installPlugin(licenseKey) {
534
499
  process.exit(1);
535
500
  }
536
501
 
537
- // Step 3: Restructure into .agents/ plugin format
538
- // v3.0: Downloaded assets arrive in .agents/ structure already
539
- // 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()
540
506
  const legacyAgentDir = path.join(globalPluginDir, '.agent');
541
507
  const newAgentsDir = path.join(globalPluginDir, '.agents');
542
508
 
543
- if (fs.existsSync(legacyAgentDir) && !fs.existsSync(newAgentsDir)) {
544
- // Legacy format: flatten .agent/ into plugin root
545
- const entries = fs.readdirSync(legacyAgentDir);
546
- for (const entry of entries) {
547
- const srcPath = path.join(legacyAgentDir, entry);
548
- const destPath = path.join(globalPluginDir, entry);
549
- if (fs.existsSync(destPath)) {
550
- 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);
551
524
  }
552
- fs.renameSync(srcPath, destPath);
553
525
  }
554
- removeRecursive(legacyAgentDir);
555
- } else if (fs.existsSync(newAgentsDir)) {
556
- // v3.0 format: move plugin contents (skills, rules) to plugin root
557
- const pluginSrcDir = path.join(newAgentsDir, 'plugins', 'antigravity-seo-kit');
558
- if (fs.existsSync(pluginSrcDir)) {
559
- for (const entry of fs.readdirSync(pluginSrcDir)) {
560
- const srcPath = path.join(pluginSrcDir, entry);
561
- const destPath = path.join(globalPluginDir, entry);
562
- if (fs.existsSync(destPath)) {
563
- removeRecursive(destPath);
564
- }
565
- 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);
566
533
  }
567
534
  }
568
- // Keep workspace-level dirs (agents, workflows) for setupWorkspace
535
+
536
+ // Workspace-level dirs → _workspace_ prefix (for setupWorkspace later)
569
537
  const workspaceDirs = ['agents', 'workflows', 'scripts', 'config', 'dashboard', 'docs', '.shared'];
570
538
  for (const dir of workspaceDirs) {
571
- const srcDir = path.join(newAgentsDir, dir);
572
- const destDir = path.join(globalPluginDir, `_workspace_${dir}`);
573
- if (fs.existsSync(srcDir)) {
574
- if (fs.existsSync(destDir)) removeRecursive(destDir);
575
- 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);
576
544
  }
577
545
  }
578
- // Copy seo-architecture.md
579
- const archFile = path.join(newAgentsDir, 'seo-architecture.md');
580
- if (fs.existsSync(archFile)) {
581
- 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
+ }
582
553
  }
583
- removeRecursive(newAgentsDir);
554
+
555
+ // Clean up extracted dir
556
+ removeRecursive(downloadedDir);
584
557
  }
585
558
 
586
559
  // Step 4: Ensure plugin.json and installed_version.json
@@ -646,17 +619,16 @@ function setupWorkspace(cwd) {
646
619
  try {
647
620
  fs.mkdirSync(localAgentsDir, { recursive: true });
648
621
 
649
- // v3.0: Copy workspace-level dirs (agents, workflows, scripts, etc.)
650
- // Plugin contents (skills, rules) stay in ~/.gemini/config/plugins/
622
+ // Copy workspace-level dirs from global plugin to local .agents/
623
+ // Skills & rules are NOT copied — Antigravity loads them from global plugin
651
624
  const workspaceDirs = ['agents', 'workflows', 'scripts', 'config', 'dashboard', 'docs', '.shared'];
652
- const filesToCopy = ['seo-architecture.md'];
625
+ const rootFiles = ['seo-architecture.md'];
653
626
 
654
627
  let count = 0;
655
628
  for (const dir of workspaceDirs) {
656
629
  // Try _workspace_ prefixed dirs first (v3.0 install format)
657
630
  let src = path.join(globalDir, `_workspace_${dir}`);
658
631
  if (!fs.existsSync(src)) {
659
- // Fallback to flat dir (v2.x compat)
660
632
  src = path.join(globalDir, dir);
661
633
  }
662
634
  const dest = path.join(localAgentsDir, dir);
@@ -664,7 +636,9 @@ function setupWorkspace(cwd) {
664
636
  count += copyRecursive(src, dest, { overwrite: true });
665
637
  }
666
638
  }
667
- for (const f of filesToCopy) {
639
+
640
+ // Copy root-level files
641
+ for (const f of rootFiles) {
668
642
  let src = path.join(globalDir, `_workspace_${f}`);
669
643
  if (!fs.existsSync(src)) {
670
644
  src = path.join(globalDir, f);
@@ -676,18 +650,35 @@ function setupWorkspace(cwd) {
676
650
  }
677
651
  }
678
652
 
679
- // Create plugin symlink/reference in workspace
680
- const pluginsDir = path.join(localAgentsDir, 'plugins', 'antigravity-seo-kit');
681
- if (!fs.existsSync(pluginsDir)) {
682
- fs.mkdirSync(pluginsDir, { recursive: true });
683
- // Write a pointer file so workspace knows where the plugin lives
684
- fs.writeFileSync(
685
- path.join(pluginsDir, '_global_ref.json'),
686
- JSON.stringify({ globalDir, version: PACKAGE_VERSION }, null, 2),
687
- 'utf-8'
688
- );
653
+ // Copy hooks.json to .agents/ root if exists in global plugin
654
+ const hooksFiles = ['hooks.json', '_workspace_hooks.json'];
655
+ for (const hf of hooksFiles) {
656
+ const hooksSrc = path.join(globalDir, hf);
657
+ if (fs.existsSync(hooksSrc)) {
658
+ const hooksDest = path.join(localAgentsDir, 'hooks.json');
659
+ if (!fs.existsSync(hooksDest)) {
660
+ fs.copyFileSync(hooksSrc, hooksDest);
661
+ count++;
662
+ }
663
+ break;
664
+ }
689
665
  }
690
666
 
667
+ // Copy mcp_config.json to .agents/ root if exists in global plugin
668
+ const mcpFiles = ['mcp_config.json', '_workspace_mcp_config.json'];
669
+ for (const mf of mcpFiles) {
670
+ const mcpSrc = path.join(globalDir, mf);
671
+ if (fs.existsSync(mcpSrc)) {
672
+ const mcpDest = path.join(localAgentsDir, 'mcp_config.json');
673
+ if (!fs.existsSync(mcpDest)) {
674
+ fs.copyFileSync(mcpSrc, mcpDest);
675
+ count++;
676
+ }
677
+ break;
678
+ }
679
+ }
680
+
681
+ // Copy license file to workspace
691
682
  const LICENSE_FILE_NAME = '.seo-kit-license';
692
683
  const globalLicense = path.join(globalDir, LICENSE_FILE_NAME);
693
684
  const localLicense = path.join(cwd, LICENSE_FILE_NAME);
@@ -696,6 +687,10 @@ function setupWorkspace(cwd) {
696
687
  }
697
688
 
698
689
  spin.succeed(`Workspace setup complete! Copied ${count} files to .agents/`);
690
+ console.log('');
691
+ info('Skills and rules are loaded from global plugin automatically.');
692
+ info('Workspace-level files (workflows, agents, scripts) are now local.');
693
+ console.log('');
699
694
  } catch (err) {
700
695
  spin.fail('Workspace setup failed');
701
696
  error(err.message);
@@ -724,11 +719,12 @@ function migrate(cwd) {
724
719
 
725
720
  const spin = spinner('Migrating .agent/ → .agents/ (v2.x → v3.0)...').start();
726
721
  try {
722
+ fs.mkdirSync(newAgentsDir, { recursive: true });
727
723
  let count = 0;
728
724
 
729
- // 1. Copy workspace-level dirs
730
- const workspaceDirs = ['agents', 'workflows', 'scripts', 'config', 'dashboard', 'docs', '.shared'];
731
- for (const dir of workspaceDirs) {
725
+ // Copy ALL directories directly into .agents/ (flat workspace structure)
726
+ const allDirs = ['skills', 'rules', 'agents', 'workflows', 'scripts', 'config', 'dashboard', 'docs', '.shared'];
727
+ for (const dir of allDirs) {
732
728
  const src = path.join(oldAgentDir, dir);
733
729
  const dest = path.join(newAgentsDir, dir);
734
730
  if (fs.existsSync(src)) {
@@ -736,43 +732,15 @@ function migrate(cwd) {
736
732
  }
737
733
  }
738
734
 
739
- // Copy root-level md files
740
- const rootFiles = fs.readdirSync(oldAgentDir).filter(f => f.endsWith('.md'));
741
- for (const f of rootFiles) {
735
+ // Copy root-level files (.md, .json, etc.)
736
+ for (const f of fs.readdirSync(oldAgentDir)) {
742
737
  const src = path.join(oldAgentDir, f);
743
- const dest = path.join(newAgentsDir, f);
744
738
  if (fs.statSync(src).isFile()) {
745
- fs.copyFileSync(src, dest);
739
+ fs.copyFileSync(src, path.join(newAgentsDir, f));
746
740
  count++;
747
741
  }
748
742
  }
749
743
 
750
- // 2. Copy skills + rules into plugin structure
751
- const pluginDir = path.join(newAgentsDir, 'plugins', 'antigravity-seo-kit');
752
- fs.mkdirSync(pluginDir, { recursive: true });
753
-
754
- const skillsSrc = path.join(oldAgentDir, 'skills');
755
- const skillsDest = path.join(pluginDir, 'skills');
756
- if (fs.existsSync(skillsSrc)) {
757
- count += copyRecursive(skillsSrc, skillsDest, { overwrite: true, mergeJson: true });
758
- }
759
-
760
- const rulesSrc = path.join(oldAgentDir, 'rules');
761
- const rulesDest = path.join(pluginDir, 'rules');
762
- if (fs.existsSync(rulesSrc)) {
763
- count += copyRecursive(rulesSrc, rulesDest, { overwrite: true });
764
- }
765
-
766
- // 3. Create plugin.json if missing
767
- const pluginJsonPath = path.join(pluginDir, 'plugin.json');
768
- if (!fs.existsSync(pluginJsonPath)) {
769
- fs.writeFileSync(pluginJsonPath, JSON.stringify({
770
- name: 'antigravity-seo-kit',
771
- version: PACKAGE_VERSION,
772
- description: 'Migrated from v2.x .agent/ structure',
773
- }, null, 2), 'utf-8');
774
- }
775
-
776
744
  spin.succeed(`Migration complete! ${count} files moved to .agents/`);
777
745
  console.log('');
778
746
  info('The old .agent/ directory has been preserved as backup.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "antigravity-seo-kit",
3
- "version": "2.9.7",
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": {