agent-space-manager 1.0.3 โ†’ 1.0.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.
package/manager.mjs CHANGED
@@ -36,6 +36,7 @@ import {
36
36
  syncMarkdownRulesBlock,
37
37
  syncOwnedFiles,
38
38
  syncJsonHooks,
39
+ syncApps,
39
40
  writeHubCommunicationFiles,
40
41
  ensureGitInfoExclude,
41
42
  parseMarkdownFrontmatter,
@@ -842,6 +843,7 @@ export function buildCategoriesRegistry(plugins = [], hubRoot = "") {
842
843
  skills: [],
843
844
  agents: [],
844
845
  rules: [],
846
+ apps: [],
845
847
  };
846
848
 
847
849
  const seenSkills = new Set();
@@ -849,6 +851,7 @@ export function buildCategoriesRegistry(plugins = [], hubRoot = "") {
849
851
  const seenHooks = new Set();
850
852
  const seenAgents = new Set();
851
853
  const seenRules = new Set();
854
+ const seenApps = new Set();
852
855
 
853
856
  for (const p of plugins) {
854
857
  categories.plugins.push({
@@ -857,12 +860,50 @@ export function buildCategoriesRegistry(plugins = [], hubRoot = "") {
857
860
  version: p.version,
858
861
  path: p.path,
859
862
  description: p.description,
863
+ componentType: p.isApp ? "app" : "plugin",
864
+ isApp: Boolean(p.isApp),
865
+ hasApp: Boolean(p.hasApp || p.isApp),
866
+ appsCount: p.isApp ? 1 : (p.apps || []).length,
860
867
  skillsCount: (p.skills || []).length,
861
868
  filesCount: (p.files || []).length,
862
869
  hasMcp: p.hasMcp,
863
870
  hasHooks: p.hasHooks,
864
871
  });
865
872
 
873
+ if (p.isApp) {
874
+ const appKey = p.id || p.name;
875
+ if (!seenApps.has(appKey)) {
876
+ seenApps.add(appKey);
877
+ categories.apps.push({
878
+ id: p.id,
879
+ name: p.name,
880
+ version: p.version,
881
+ pluginId: p.id,
882
+ pluginName: p.name,
883
+ description: p.description,
884
+ sourcePath: p.path,
885
+ upstream: p.upstream || null,
886
+ });
887
+ }
888
+ } else {
889
+ for (const a of p.apps || []) {
890
+ const appKey = `${p.id}/${a}`;
891
+ if (!seenApps.has(appKey)) {
892
+ seenApps.add(appKey);
893
+ const appDir = fs.existsSync(path.join(p.path, "apps", a))
894
+ ? path.join(p.path, "apps", a)
895
+ : path.join(p.path, "app", a);
896
+ categories.apps.push({
897
+ id: appKey,
898
+ name: a,
899
+ pluginId: p.id,
900
+ pluginName: p.name,
901
+ sourcePath: appDir,
902
+ });
903
+ }
904
+ }
905
+ }
906
+
866
907
  for (const s of p.skills || []) {
867
908
  if (!seenSkills.has(s)) {
868
909
  seenSkills.add(s);
@@ -967,6 +1008,31 @@ export function buildCategoriesRegistry(plugins = [], hubRoot = "") {
967
1008
  return categories;
968
1009
  }
969
1010
 
1011
+ /**
1012
+ * Shallow file/folder listing for standalone App directories (avoids recursing hundreds of browser/binary files).
1013
+ */
1014
+ function listShallowAppFiles(appDir) {
1015
+ if (!appDir || !fs.existsSync(appDir)) return [];
1016
+ const results = [];
1017
+ try {
1018
+ for (const e of fs.readdirSync(appDir, { withFileTypes: true })) {
1019
+ if (e.name === ".git" || e.name === "node_modules" || e.name === ".asm-owned.json") continue;
1020
+ const full = path.join(appDir, e.name);
1021
+ try {
1022
+ const st = fs.statSync(full);
1023
+ if (st.isDirectory()) {
1024
+ results.push({ name: `${e.name}/`, relPath: `${e.name}/`, size: 0, mtime: Math.round(st.mtimeMs), isDir: true });
1025
+ } else {
1026
+ results.push({ name: e.name, relPath: e.name, size: st.size, mtime: Math.round(st.mtimeMs) });
1027
+ }
1028
+ } catch {
1029
+ results.push({ name: e.name, relPath: e.name, size: 0, mtime: 0 });
1030
+ }
1031
+ }
1032
+ } catch {}
1033
+ return results;
1034
+ }
1035
+
970
1036
  /**
971
1037
  * Scans plugins directory for all standard plugin packages and root standalone components.
972
1038
  */
@@ -976,11 +1042,50 @@ export function scanPlugins(hubRoot = resolveHubRoot()) {
976
1042
  if (!cleanHub || !fs.existsSync(cleanHub)) return [];
977
1043
 
978
1044
  const rootManifestPath = path.join(cleanHub, "plugin.json");
1045
+ const rootAppManifestPath = path.join(cleanHub, "app.json");
979
1046
  const rootSkillMdPath = path.join(cleanHub, "SKILL.md");
980
1047
  const hasDirectPluginsFolder = fs.existsSync(path.join(cleanHub, "plugins"));
1048
+ const hasDirectAppFolder = fs.existsSync(path.join(cleanHub, "app"));
1049
+
1050
+ // 0. Single standalone App package directly at hubRoot
1051
+ if (!hasDirectPluginsFolder && !hasDirectAppFolder && fs.existsSync(rootAppManifestPath)) {
1052
+ const entryName = path.basename(cleanHub);
1053
+ let manifest = { name: entryName, version: "1.0.0", description: "" };
1054
+ try {
1055
+ manifest = JSON.parse(stripBom(fs.readFileSync(rootAppManifestPath, "utf8")));
1056
+ } catch {
1057
+ manifest.description = "Invalid app.json";
1058
+ }
1059
+ const files = listShallowAppFiles(cleanHub);
1060
+ return [
1061
+ {
1062
+ id: manifest.id || entryName,
1063
+ name: manifest.name || entryName,
1064
+ version: manifest.version || "1.0.0",
1065
+ description: manifest.description || `Standalone app component (${entryName})`,
1066
+ path: cleanHub,
1067
+ upstream: manifest.upstream || (typeof manifest.repository === "string" ? manifest.repository : manifest.repository?.url) || manifest.homepage || manifest.url || manifest.source || null,
1068
+ componentType: "app",
1069
+ isApp: true,
1070
+ hasApp: true,
1071
+ apps: [entryName],
1072
+ appName: entryName,
1073
+ appEnv: manifest.env || null,
1074
+ appExecutable: manifest.executable || manifest.bin || null,
1075
+ hasMcp: false,
1076
+ hasHooks: false,
1077
+ mcps: [],
1078
+ hooks: [],
1079
+ skills: [],
1080
+ rules: [],
1081
+ agents: [],
1082
+ files,
1083
+ },
1084
+ ];
1085
+ }
981
1086
 
982
1087
  // 1. Single plugin or standalone skill package directly at hubRoot
983
- if (!hasDirectPluginsFolder && (fs.existsSync(rootManifestPath) || fs.existsSync(rootSkillMdPath))) {
1088
+ if (!hasDirectPluginsFolder && !hasDirectAppFolder && (fs.existsSync(rootManifestPath) || fs.existsSync(rootSkillMdPath))) {
984
1089
  const entryName = path.basename(cleanHub);
985
1090
  let manifest = { name: entryName, version: "1.0.0", description: "" };
986
1091
  if (fs.existsSync(rootManifestPath)) {
@@ -1133,7 +1238,7 @@ export function scanPlugins(hubRoot = resolveHubRoot()) {
1133
1238
  if (hasManifest) {
1134
1239
  pluginsDir = cleanHub;
1135
1240
  isDirectHub = true;
1136
- } else if (!fs.existsSync(path.join(cleanHub, "skills"))) {
1241
+ } else if (!fs.existsSync(path.join(cleanHub, "skills")) && !fs.existsSync(path.join(cleanHub, "app"))) {
1137
1242
  return [];
1138
1243
  }
1139
1244
  } catch {
@@ -1236,6 +1341,20 @@ export function scanPlugins(hubRoot = resolveHubRoot()) {
1236
1341
  } catch {}
1237
1342
  }
1238
1343
 
1344
+ const pluginApps = [];
1345
+ for (const subAppFolder of ["apps", "app"]) {
1346
+ const pAppsDir = path.join(pluginDir, subAppFolder);
1347
+ if (fs.existsSync(pAppsDir)) {
1348
+ try {
1349
+ for (const aEnt of fs.readdirSync(pAppsDir, { withFileTypes: true })) {
1350
+ if (aEnt.isDirectory() || aEnt.isSymbolicLink()) {
1351
+ pluginApps.push(aEnt.name);
1352
+ }
1353
+ }
1354
+ } catch {}
1355
+ }
1356
+ }
1357
+
1239
1358
  const files = listFilesRecursiveRel(pluginDir, pluginDir);
1240
1359
 
1241
1360
  plugins.push({
@@ -1247,11 +1366,13 @@ export function scanPlugins(hubRoot = resolveHubRoot()) {
1247
1366
  upstream: manifest.upstream || (typeof manifest.repository === "string" ? manifest.repository : manifest.repository?.url) || manifest.homepage || manifest.url || manifest.source || null,
1248
1367
  hasMcp,
1249
1368
  hasHooks,
1369
+ hasApp: pluginApps.length > 0,
1250
1370
  mcps,
1251
1371
  hooks,
1252
1372
  skills,
1253
1373
  rules,
1254
1374
  agents,
1375
+ apps: pluginApps,
1255
1376
  files,
1256
1377
  });
1257
1378
  }
@@ -1298,6 +1419,78 @@ export function scanPlugins(hubRoot = resolveHubRoot()) {
1298
1419
  }
1299
1420
  } catch {}
1300
1421
  }
1422
+
1423
+ // Discover standalone App components in <hubRoot>/app/<app-name>/
1424
+ const rootAppDir = path.join(cleanHub, "app");
1425
+ if (fs.existsSync(rootAppDir)) {
1426
+ try {
1427
+ const existingIds = new Set(plugins.map((p) => p.id));
1428
+ for (const ae of fs.readdirSync(rootAppDir, { withFileTypes: true })) {
1429
+ if (ae.name.startsWith(".") || ae.name === "node_modules") continue;
1430
+ const appPath = path.join(rootAppDir, ae.name);
1431
+ let isDir = false;
1432
+ try {
1433
+ isDir = ae.isDirectory() || (ae.isSymbolicLink() && fs.statSync(appPath).isDirectory());
1434
+ } catch {}
1435
+ if (!isDir) continue;
1436
+
1437
+ const appManifestPath = path.join(appPath, "app.json");
1438
+ const fallbackPluginJson = path.join(appPath, "plugin.json");
1439
+ let manifest = { name: ae.name, version: "1.0.0", description: `Standalone app component (${ae.name})` };
1440
+ if (fs.existsSync(appManifestPath)) {
1441
+ try {
1442
+ manifest = JSON.parse(stripBom(fs.readFileSync(appManifestPath, "utf8")));
1443
+ } catch {
1444
+ manifest.description = "Invalid app.json";
1445
+ }
1446
+ } else if (fs.existsSync(fallbackPluginJson)) {
1447
+ try {
1448
+ manifest = JSON.parse(stripBom(fs.readFileSync(fallbackPluginJson, "utf8")));
1449
+ } catch {}
1450
+ }
1451
+
1452
+ let appId = manifest.id || ae.name;
1453
+ if (existingIds.has(appId)) {
1454
+ appId = `app-${appId}`;
1455
+ }
1456
+ existingIds.add(appId);
1457
+
1458
+ const appUpstream =
1459
+ manifest.upstream ||
1460
+ (typeof manifest.repository === "string" ? manifest.repository : manifest.repository?.url) ||
1461
+ manifest.homepage ||
1462
+ manifest.url ||
1463
+ manifest.source ||
1464
+ extractComponentUpstream(appPath, "app", manifest) ||
1465
+ null;
1466
+
1467
+ const appFiles = listShallowAppFiles(appPath);
1468
+ plugins.push({
1469
+ id: appId,
1470
+ name: manifest.name || ae.name,
1471
+ version: manifest.version || "1.0.0",
1472
+ description: manifest.description || `Standalone app component (${ae.name})`,
1473
+ path: appPath,
1474
+ upstream: appUpstream,
1475
+ componentType: "app",
1476
+ isApp: true,
1477
+ hasApp: true,
1478
+ apps: [ae.name],
1479
+ appName: ae.name,
1480
+ appEnv: manifest.env || null,
1481
+ appExecutable: manifest.executable || manifest.bin || null,
1482
+ hasMcp: false,
1483
+ hasHooks: false,
1484
+ mcps: [],
1485
+ hooks: [],
1486
+ skills: [],
1487
+ rules: [],
1488
+ agents: [],
1489
+ files: appFiles,
1490
+ });
1491
+ }
1492
+ } catch {}
1493
+ }
1301
1494
  }
1302
1495
 
1303
1496
  return plugins;
@@ -1455,8 +1648,8 @@ export function sanitizeAgentConfigDirectory(configDir, agentType = "general") {
1455
1648
  }
1456
1649
  }
1457
1650
 
1458
- // 2. Sanitize empty ghost directories left behind in plugins / skills
1459
- for (const sub of ["plugins", "skills"]) {
1651
+ // 2. Sanitize empty ghost directories left behind in plugins / skills / apps
1652
+ for (const sub of ["plugins", "skills", "apps"]) {
1460
1653
  const subDir = path.join(configDir, sub);
1461
1654
  if (fs.existsSync(subDir)) {
1462
1655
  for (const ent of fs.readdirSync(subDir)) {
@@ -1505,7 +1698,7 @@ export function syncIdePlugins(ide, allPlugins = []) {
1505
1698
  const activePluginMap = new Map();
1506
1699
  for (const plugin of allPlugins) {
1507
1700
  const isEnabled = Boolean(normalized.plugins && normalized.plugins[plugin.id] === true);
1508
- if (isEnabled && plugin.path && fs.existsSync(plugin.path) && !plugin.isRootSkills) {
1701
+ if (isEnabled && plugin.path && fs.existsSync(plugin.path) && !plugin.isRootSkills && !plugin.isApp) {
1509
1702
  activePluginMap.set(plugin.id, plugin.path);
1510
1703
  }
1511
1704
  }
@@ -1535,10 +1728,12 @@ export function syncIdePlugins(ide, allPlugins = []) {
1535
1728
  // - Harmonize skills.json without wiping user's non-hub entries
1536
1729
  const isGeminiIde = agentType === "antigravity" || primaryDir.toLowerCase().includes(".gemini");
1537
1730
  let skillLinks = [];
1731
+ let appLinks = [];
1538
1732
  let nextFiles = [];
1539
1733
  const nextJsonKeys = {};
1540
1734
  const nextBlocks = [];
1541
1735
  const components = collectEnabledComponents(allPlugins, normalized.plugins);
1736
+ const appsTargetDir = paths.apps || path.join(path.dirname(bundleDir), "apps");
1542
1737
 
1543
1738
  if (isGeminiIde) {
1544
1739
  const geminiConfigDir = path.dirname(bundleDir);
@@ -1551,7 +1746,7 @@ export function syncIdePlugins(ide, allPlugins = []) {
1551
1746
  try {
1552
1747
  if (fs.existsSync(geminiConfigDir)) {
1553
1748
  for (const entryName of fs.readdirSync(geminiConfigDir)) {
1554
- if (entryName === "plugins" || entryName === "skills" || entryName === "rules" || entryName === "agents") {
1749
+ if (entryName === "plugins" || entryName === "skills" || entryName === "rules" || entryName === "agents" || entryName === "apps") {
1555
1750
  continue;
1556
1751
  }
1557
1752
  const entryPath = path.join(geminiConfigDir, entryName);
@@ -1572,9 +1767,16 @@ export function syncIdePlugins(ide, allPlugins = []) {
1572
1767
  const prevSkillLinks = (prevState.links || []).filter(
1573
1768
  (l) => path.dirname(path.resolve(l)) === path.resolve(geminiSkillsDir)
1574
1769
  );
1770
+ const prevAppLinks = (prevState.links || []).filter(
1771
+ (l) => path.dirname(path.resolve(l)) === path.resolve(appsTargetDir)
1772
+ );
1575
1773
  for (const oldLink of prevState.links || []) {
1576
1774
  const oldParent = path.dirname(path.resolve(oldLink));
1577
- if (oldParent !== path.resolve(bundleDir) && oldParent !== path.resolve(geminiSkillsDir)) {
1775
+ if (
1776
+ oldParent !== path.resolve(bundleDir) &&
1777
+ oldParent !== path.resolve(geminiSkillsDir) &&
1778
+ oldParent !== path.resolve(appsTargetDir)
1779
+ ) {
1578
1780
  removeJunction(oldLink);
1579
1781
  }
1580
1782
  }
@@ -1644,7 +1846,24 @@ export function syncIdePlugins(ide, allPlugins = []) {
1644
1846
  if (hookRes.ownedKeys.length > 0) nextJsonKeys[paths.hooks.file] = hookRes.ownedKeys;
1645
1847
  }
1646
1848
 
1647
- const allOwnedLinks = [...bundleLinks, ...skillLinks];
1849
+ // Sync App components (e.g. ms-playwright) via directory junctions
1850
+ if (appsTargetDir) {
1851
+ const prevAppLinks = (prevState.links || []).filter(
1852
+ (l) => path.dirname(path.resolve(l)) === path.resolve(appsTargetDir)
1853
+ );
1854
+ const appSync = syncApps(
1855
+ components.apps,
1856
+ appsTargetDir,
1857
+ prevAppLinks,
1858
+ createJunction,
1859
+ removeJunction,
1860
+ allPlugins,
1861
+ ownerKey
1862
+ );
1863
+ appLinks = appSync.nextLinks;
1864
+ }
1865
+
1866
+ const allOwnedLinks = [...bundleLinks, ...skillLinks, ...appLinks];
1648
1867
  if (isGeminiIde) {
1649
1868
  const geminiConfigDir = path.dirname(bundleDir);
1650
1869
  const dupes = detectDuplicateStandalones(
@@ -1670,6 +1889,7 @@ export function syncIdePlugins(ide, allPlugins = []) {
1670
1889
  skills: skillLinks.length,
1671
1890
  rules: components.rules.length,
1672
1891
  agents: components.agents.length,
1892
+ apps: appLinks.length,
1673
1893
  conflicts: components.conflicts.length,
1674
1894
  },
1675
1895
  conflicts: components.conflicts,
@@ -1680,12 +1900,37 @@ export function syncIdePlugins(ide, allPlugins = []) {
1680
1900
  // Mode 2: Native-Format Converted Agent (Claude Code, Codex, OpenCode, Copilot, Cursor, Windsurf, Gemini CLI, Cline, Roo, Kiro, Universal, Custom)
1681
1901
  const components = collectEnabledComponents(allPlugins, normalized.plugins);
1682
1902
  const skillsTargetDir = paths.skills || primaryDir;
1903
+ const appsTargetDir = paths.apps || path.join(path.dirname(skillsTargetDir), "apps");
1904
+
1905
+ const prevSkillLinks = (prevState.links || []).filter(
1906
+ (l) => path.dirname(path.resolve(l)) === path.resolve(skillsTargetDir)
1907
+ );
1908
+ const prevAppLinks = (prevState.links || []).filter(
1909
+ (l) => path.dirname(path.resolve(l)) === path.resolve(appsTargetDir)
1910
+ );
1911
+ for (const oldLink of prevState.links || []) {
1912
+ const oldParent = path.dirname(path.resolve(oldLink));
1913
+ if (oldParent !== path.resolve(skillsTargetDir) && oldParent !== path.resolve(appsTargetDir)) {
1914
+ removeJunction(oldLink);
1915
+ }
1916
+ }
1683
1917
 
1684
1918
  // 1. Link flattened skills (<skillsTargetDir>/<skill-name>/SKILL.md)
1685
1919
  const skillSync = syncFlattenedSkills(
1686
1920
  components.skills,
1687
1921
  skillsTargetDir,
1688
- prevState.links || [],
1922
+ prevSkillLinks,
1923
+ createJunction,
1924
+ removeJunction,
1925
+ allPlugins,
1926
+ ownerKey
1927
+ );
1928
+
1929
+ // 1b. Link enabled App components (<appsTargetDir>/<app-name>)
1930
+ const appSync = syncApps(
1931
+ components.apps,
1932
+ appsTargetDir,
1933
+ prevAppLinks,
1689
1934
  createJunction,
1690
1935
  removeJunction,
1691
1936
  allPlugins,
@@ -1762,6 +2007,7 @@ export function syncIdePlugins(ide, allPlugins = []) {
1762
2007
  }
1763
2008
  }
1764
2009
 
2010
+ const allMode2Links = [...skillSync.nextLinks, ...appSync.nextLinks];
1765
2011
  const dupes = detectDuplicateStandalones(
1766
2012
  allPlugins,
1767
2013
  normalized.plugins,
@@ -1771,12 +2017,12 @@ export function syncIdePlugins(ide, allPlugins = []) {
1771
2017
  agentsDir: typeof paths.agents === "object" ? paths.agents?.dir : undefined,
1772
2018
  },
1773
2019
  nextFiles,
1774
- skillSync.nextLinks
2020
+ allMode2Links
1775
2021
  );
1776
2022
  components.conflicts.push(...dupes);
1777
2023
 
1778
2024
  saveOwnershipState(ownerKey, {
1779
- links: skillSync.nextLinks,
2025
+ links: allMode2Links,
1780
2026
  files: nextFiles,
1781
2027
  jsonKeys: nextJsonKeys,
1782
2028
  blocks: nextBlocks,
@@ -1788,6 +2034,7 @@ export function syncIdePlugins(ide, allPlugins = []) {
1788
2034
  mode: "convert",
1789
2035
  summary: {
1790
2036
  skills: skillSync.nextLinks.length,
2037
+ apps: appSync.nextLinks.length,
1791
2038
  commands: commandsSyncedCount,
1792
2039
  mcp: mcpSyncedCount,
1793
2040
  rules: rulesSyncedCount,
@@ -2457,9 +2704,9 @@ export function getComponentsStorageSnapshot(hubRoot = resolveHubRoot()) {
2457
2704
  exists: false,
2458
2705
  timestamp: Date.now(),
2459
2706
  plugins: {},
2460
- rootComponents: { skills: {}, rules: {}, agents: {}, mcp: null, hooks: null },
2707
+ rootComponents: { skills: {}, rules: {}, agents: {}, apps: {}, mcp: null, hooks: null },
2461
2708
  hash: "empty",
2462
- summary: { pluginCount: 0, skillCount: 0, ruleCount: 0, agentCount: 0, mcpCount: 0, hookCount: 0 },
2709
+ summary: { pluginCount: 0, skillCount: 0, ruleCount: 0, agentCount: 0, mcpCount: 0, hookCount: 0, appCount: 0 },
2463
2710
  };
2464
2711
  }
2465
2712
 
@@ -2492,6 +2739,7 @@ export function getComponentsStorageSnapshot(hubRoot = resolveHubRoot()) {
2492
2739
  let totalAgents = 0;
2493
2740
  let totalMcps = 0;
2494
2741
  let totalHooks = 0;
2742
+ let totalApps = 0;
2495
2743
 
2496
2744
  if (fs.existsSync(pluginsDir)) {
2497
2745
  try {
@@ -2713,10 +2961,37 @@ export function getComponentsStorageSnapshot(hubRoot = resolveHubRoot()) {
2713
2961
  } catch {}
2714
2962
  }
2715
2963
 
2964
+ const rootApps = {};
2965
+ const rootAppsDir = path.join(cleanHub, "app");
2966
+ if (fs.existsSync(rootAppsDir)) {
2967
+ try {
2968
+ for (const a of fs.readdirSync(rootAppsDir)) {
2969
+ if (a.startsWith(".") || a === "node_modules") continue;
2970
+ const aPath = path.join(rootAppsDir, a);
2971
+ try {
2972
+ const aStat = fs.statSync(aPath);
2973
+ if (aStat.isDirectory()) {
2974
+ const appManifest = path.join(aPath, "app.json");
2975
+ let amStat = null;
2976
+ if (fs.existsSync(appManifest)) {
2977
+ try { amStat = fs.statSync(appManifest); } catch {}
2978
+ }
2979
+ rootApps[a] = {
2980
+ mtime: Math.round(amStat ? amStat.mtimeMs : aStat.mtimeMs),
2981
+ size: amStat ? amStat.size : 0,
2982
+ };
2983
+ totalApps++;
2984
+ }
2985
+ } catch {}
2986
+ }
2987
+ } catch {}
2988
+ }
2989
+
2716
2990
  const rootComponents = {
2717
2991
  skills: rootSkills,
2718
2992
  rules: rootRules,
2719
2993
  agents: rootAgents,
2994
+ apps: rootApps,
2720
2995
  mcp: rootMcp,
2721
2996
  hooks: rootHooks,
2722
2997
  };
@@ -2754,6 +3029,7 @@ export function getComponentsStorageSnapshot(hubRoot = resolveHubRoot()) {
2754
3029
  agentCount: totalAgents,
2755
3030
  mcpCount: totalMcps,
2756
3031
  hookCount: totalHooks,
3032
+ appCount: totalApps,
2757
3033
  },
2758
3034
  };
2759
3035
  }
@@ -3162,24 +3438,26 @@ export function collectAllComponentsUpstream(hubRoot = resolveHubRoot()) {
3162
3438
 
3163
3439
  for (const p of plugins) {
3164
3440
  let manifest = null;
3165
- const manifestPath = path.join(p.path, "plugin.json");
3441
+ const manifestPath = path.join(p.path, p.isApp ? "app.json" : "plugin.json");
3166
3442
  if (fs.existsSync(manifestPath)) {
3167
3443
  try { manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8")); } catch {}
3168
3444
  }
3169
- const pluginUpstream = extractComponentUpstream(p.path, "plugin", manifest);
3445
+ const pluginUpstream = extractComponentUpstream(p.path, p.isApp ? "app" : "plugin", manifest);
3170
3446
 
3171
3447
  components.push({
3172
3448
  id: p.id,
3173
3449
  name: p.name || p.id,
3174
- type: "plugin",
3450
+ type: p.isApp ? "app" : "plugin",
3175
3451
  version: p.version || "1.0.0",
3176
3452
  path: p.path,
3177
3453
  upstream: pluginUpstream,
3178
3454
  skillsCount: p.skills?.length || 0,
3179
3455
  rulesCount: p.rules?.length || 0,
3180
3456
  agentsCount: p.agents?.length || 0,
3457
+ appsCount: p.isApp ? 1 : (p.apps?.length || 0),
3181
3458
  hasMcp: Boolean(p.hasMcp),
3182
3459
  hasHooks: Boolean(p.hasHooks),
3460
+ hasApp: Boolean(p.hasApp || p.isApp),
3183
3461
  });
3184
3462
 
3185
3463
  // Check individual skills in plugin
@@ -3467,8 +3745,35 @@ export function verifyPluginWorkabilityOnDisk(plugin, ide, options = {}) {
3467
3745
 
3468
3746
  const profile = AGENT_PROFILES[normalized.agentType] || AGENT_PROFILES.custom;
3469
3747
 
3470
- // 1. Bundle Mode (e.g. Antigravity)
3471
- if (profile.mode === "bundle") {
3748
+ // 0. App Component Check (standalone app in <hubRoot>/app/<app-name>)
3749
+ if (plugin.isApp) {
3750
+ const appsDir = paths.apps || path.join(path.dirname(primaryDir), "apps");
3751
+ const appName = plugin.appName || plugin.id;
3752
+ const appLinkPath = path.join(appsDir, appName);
3753
+ if (!plugin.path || !fs.existsSync(plugin.path)) {
3754
+ return {
3755
+ ...base,
3756
+ workable: false,
3757
+ color: "red",
3758
+ status: "missing_on_disk",
3759
+ summary: `App source missing for "${appName}"`,
3760
+ tooltip: `๐Ÿ”ด Connection failed / Missing source: App directory "${plugin.path || appName}" does not exist on disk.`,
3761
+ reason: `App source directory "${plugin.path || appName}" not found`,
3762
+ };
3763
+ }
3764
+ if (!fs.existsSync(appLinkPath)) {
3765
+ return {
3766
+ ...base,
3767
+ workable: false,
3768
+ color: "red",
3769
+ status: "missing_on_disk",
3770
+ summary: `App "${appName}" missing on disk in ${ide.name || ide.id}`,
3771
+ tooltip: `๐Ÿ”ด Connection failed / Missing on disk: App "${appName}" is not linked in "${appsDir}".`,
3772
+ reason: `App "${appName}" is not deployed in "${appsDir}"`,
3773
+ };
3774
+ }
3775
+ } else if (profile.mode === "bundle") {
3776
+ // 1. Bundle Mode (e.g. Antigravity)
3472
3777
  const bundleDir = paths.bundle || primaryDir;
3473
3778
  const pluginBundleDir = path.join(bundleDir, plugin.id);
3474
3779
  if (!fs.existsSync(pluginBundleDir)) {
@@ -3699,15 +4004,18 @@ export function evaluateComponentAgentWorkability(plugin, ide, options = {}) {
3699
4004
  const rawHooks = Array.isArray(plugin.hooks) ? plugin.hooks : [];
3700
4005
  const hasHooksInside = Boolean(plugin.hasHooks || rawHooks.length > 0);
3701
4006
 
3702
- const hasAnyFeature = hasSkillsInside || hasAgentsInside || hasMcpInside || hasRulesInside || hasHooksInside || (plugin.filesCount && plugin.filesCount > 0);
4007
+ const rawApps = Array.isArray(plugin.apps) ? plugin.apps : [];
4008
+ const hasAppInside = Boolean(plugin.isApp || plugin.hasApp || rawApps.length > 0);
4009
+
4010
+ const hasAnyFeature = hasSkillsInside || hasAgentsInside || hasMcpInside || hasRulesInside || hasHooksInside || hasAppInside || (plugin.filesCount && plugin.filesCount > 0);
3703
4011
  if (!hasAnyFeature && !plugin.path) {
3704
4012
  return {
3705
4013
  workable: false,
3706
4014
  color: "red",
3707
4015
  status: "failed",
3708
4016
  features: {},
3709
- quickActions: { slashCommands: [], mentions: [], hasSlash: false, hasMention: false, hasMcp: false, hasRules: false, hasHooks: false },
3710
- summary: "Empty component (no skills, MCP, rules, or agents found)",
4017
+ quickActions: { slashCommands: [], mentions: [], hasSlash: false, hasMention: false, hasMcp: false, hasRules: false, hasHooks: false, hasApp: false },
4018
+ summary: "Empty component (no skills, MCP, rules, agents, or apps found)",
3711
4019
  tooltip: `๐Ÿ”ด Connection failed: No workable components discovered in "${plugin.name || plugin.id}"`,
3712
4020
  reason: "No workable components discovered in plugin",
3713
4021
  };
@@ -3725,6 +4033,7 @@ export function evaluateComponentAgentWorkability(plugin, ide, options = {}) {
3725
4033
  rules: isBundle || customPaths.rules ? true : (profile?.capabilities?.rules ?? true),
3726
4034
  agents: isBundle || customPaths.agents ? true : (profile?.capabilities?.agents ?? true),
3727
4035
  hooks: isBundle || customPaths.hooks ? true : (profile?.capabilities?.hooks ?? true),
4036
+ apps: isBundle || customPaths.apps ? true : (profile?.capabilities?.apps ?? true),
3728
4037
  };
3729
4038
 
3730
4039
  const features = {};
@@ -3843,6 +4152,27 @@ export function evaluateComponentAgentWorkability(plugin, ide, options = {}) {
3843
4152
  };
3844
4153
  }
3845
4154
 
4155
+ // 6. Apps Check (only if present inside component)
4156
+ if (hasAppInside) {
4157
+ presentTypeCount++;
4158
+ const appNames = rawApps.length > 0 ? rawApps : [plugin.appName || plugin.name || plugin.id];
4159
+ const isSupported = capabilities.apps === true;
4160
+ if (isSupported) {
4161
+ workableCount++;
4162
+ actionParts.push(`App: ${appNames.join(", ")}`);
4163
+ detailedTooltipLines.push(`โœ“ App (${appNames.length}): ${appNames.join(", ")} active`);
4164
+ } else {
4165
+ detailedTooltipLines.push(`โœ— App (${appNames.length}): Skipped (unsupported by ${ide.name || ide.id})`);
4166
+ }
4167
+ features.apps = {
4168
+ present: true,
4169
+ count: appNames.length,
4170
+ workable: isSupported,
4171
+ items: appNames,
4172
+ reason: isSupported ? "Active" : `Unsupported by ${ide.name || ide.id}`,
4173
+ };
4174
+ }
4175
+
3846
4176
  // If component has types present but NONE of them are supported by this agent
3847
4177
  if (presentTypeCount > 0 && workableCount === 0) {
3848
4178
  return {
@@ -3858,6 +4188,7 @@ export function evaluateComponentAgentWorkability(plugin, ide, options = {}) {
3858
4188
  hasMcp: false,
3859
4189
  hasRules: false,
3860
4190
  hasHooks: false,
4191
+ hasApp: false,
3861
4192
  },
3862
4193
  summary: `Incompatible with ${ide.name || ide.id}`,
3863
4194
  tooltip: `๐Ÿ”ด Incompatible with ${ide.name || ide.id}: All component types in "${plugin.name || plugin.id}" are unsupported.`,
@@ -3870,6 +4201,7 @@ export function evaluateComponentAgentWorkability(plugin, ide, options = {}) {
3870
4201
  const hasMcp = hasMcpInside && capabilities.mcp === true;
3871
4202
  const hasRules = hasRulesInside && capabilities.rules === true;
3872
4203
  const hasHooks = hasHooksInside && capabilities.hooks === true;
4204
+ const hasApp = hasAppInside && capabilities.apps === true;
3873
4205
 
3874
4206
  const summary = `Workable in ${ide.name || ide.id}${actionParts.length > 0 ? " ยท " + actionParts.join(" ยท ") : ""}`;
3875
4207
  const baseTooltip = `๐ŸŸข Workable in ${ide.name || ide.id}: Connected & ready.${actionParts.length > 0 ? " Can be used with " + actionParts.join(" | ") : ""}`;
@@ -3888,6 +4220,7 @@ export function evaluateComponentAgentWorkability(plugin, ide, options = {}) {
3888
4220
  hasMcp,
3889
4221
  hasRules,
3890
4222
  hasHooks,
4223
+ hasApp,
3891
4224
  },
3892
4225
  summary,
3893
4226
  tooltip,
@@ -4469,13 +4802,14 @@ export function scanAgentForeignComponents(agentDef, hubConfig = null, plugins =
4469
4802
  if (normIde.configPath && fs.existsSync(normIde.configPath)) checkDirs.add(normIde.configPath);
4470
4803
  if (paths.primary && fs.existsSync(paths.primary)) checkDirs.add(paths.primary);
4471
4804
  if (paths.skills && fs.existsSync(paths.skills)) checkDirs.add(paths.skills);
4805
+ if (paths.apps && fs.existsSync(paths.apps)) checkDirs.add(paths.apps);
4472
4806
  if (paths.rules && fs.existsSync(paths.rules)) checkDirs.add(paths.rules);
4473
4807
  if (paths.agents && fs.existsSync(paths.agents)) checkDirs.add(paths.agents);
4474
4808
 
4475
- // Parent directories for plugins, skills, rules, agents subfolders
4809
+ // Parent directories for plugins, skills, rules, agents, apps subfolders
4476
4810
  for (const d of Array.from(checkDirs)) {
4477
4811
  const parent = path.dirname(d);
4478
- for (const sub of ["plugins", "skills", "rules", "agents"]) {
4812
+ for (const sub of ["plugins", "skills", "rules", "agents", "apps"]) {
4479
4813
  const subPath = path.join(parent, sub);
4480
4814
  if (fs.existsSync(subPath)) checkDirs.add(subPath);
4481
4815
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-space-manager",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Universal Agent Space Manager & Dynamic Intent-Based MCP Tool Gateway for Magpie",
5
5
  "type": "module",
6
6
  "main": "./index.mjs",