plexus-agent-config 0.0.2 → 0.0.3

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 (160) hide show
  1. package/dist/bin.js +2 -1
  2. package/dist/bin.js.map +1 -1
  3. package/package.json +2 -10
  4. package/vendor/plexus-agent-config-core/package.json +1 -1
  5. package/vendor/plexus-agent-config-web/.next/BUILD_ID +1 -1
  6. package/vendor/plexus-agent-config-web/.next/app-path-routes-manifest.json +10 -10
  7. package/vendor/plexus-agent-config-web/.next/build-manifest.json +2 -2
  8. package/vendor/plexus-agent-config-web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  9. package/vendor/plexus-agent-config-web/.next/server/app/_global-error.html +1 -1
  10. package/vendor/plexus-agent-config-web/.next/server/app/_global-error.rsc +1 -1
  11. package/vendor/plexus-agent-config-web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  12. package/vendor/plexus-agent-config-web/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  13. package/vendor/plexus-agent-config-web/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  14. package/vendor/plexus-agent-config-web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  15. package/vendor/plexus-agent-config-web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  16. package/vendor/plexus-agent-config-web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  17. package/vendor/plexus-agent-config-web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  18. package/vendor/plexus-agent-config-web/.next/server/app/about/page_client-reference-manifest.js +1 -1
  19. package/vendor/plexus-agent-config-web/.next/server/app/agents/[id]/page_client-reference-manifest.js +1 -1
  20. package/vendor/plexus-agent-config-web/.next/server/app/api/debug/route.js +1 -1
  21. package/vendor/plexus-agent-config-web/.next/server/app/backups/page_client-reference-manifest.js +1 -1
  22. package/vendor/plexus-agent-config-web/.next/server/app/debug/page.js +1 -1
  23. package/vendor/plexus-agent-config-web/.next/server/app/debug/page_client-reference-manifest.js +1 -1
  24. package/vendor/plexus-agent-config-web/.next/server/app/mcp/page_client-reference-manifest.js +1 -1
  25. package/vendor/plexus-agent-config-web/.next/server/app/mirror/page_client-reference-manifest.js +1 -1
  26. package/vendor/plexus-agent-config-web/.next/server/app/page_client-reference-manifest.js +1 -1
  27. package/vendor/plexus-agent-config-web/.next/server/app/rules/page_client-reference-manifest.js +1 -1
  28. package/vendor/plexus-agent-config-web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  29. package/vendor/plexus-agent-config-web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  30. package/vendor/plexus-agent-config-web/.next/server/app/spread/page_client-reference-manifest.js +1 -1
  31. package/vendor/plexus-agent-config-web/.next/server/app/team/page_client-reference-manifest.js +1 -1
  32. package/vendor/plexus-agent-config-web/.next/server/app-paths-manifest.json +10 -10
  33. package/vendor/plexus-agent-config-web/.next/server/chunks/620.js +1 -1
  34. package/vendor/plexus-agent-config-web/.next/server/middleware-build-manifest.js +1 -1
  35. package/vendor/plexus-agent-config-web/.next/server/pages/500.html +1 -1
  36. package/vendor/plexus-agent-config-web/.next/static/chunks/app/{layout-2d0506b46622a8c9.js → layout-c148ba3a96b46ad6.js} +1 -1
  37. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/adapters/base.d.ts +38 -0
  38. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/adapters/base.d.ts.map +1 -0
  39. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/adapters/base.js +125 -0
  40. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/adapters/base.js.map +1 -0
  41. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/adapters/codex.d.ts +9 -0
  42. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/adapters/codex.d.ts.map +1 -0
  43. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/adapters/codex.js +96 -0
  44. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/adapters/codex.js.map +1 -0
  45. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/adapters/index.d.ts +8 -0
  46. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/adapters/index.d.ts.map +1 -0
  47. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/adapters/index.js +12 -0
  48. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/adapters/index.js.map +1 -0
  49. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/adapters/json-mcp.d.ts +25 -0
  50. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/adapters/json-mcp.d.ts.map +1 -0
  51. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/adapters/json-mcp.js +182 -0
  52. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/adapters/json-mcp.js.map +1 -0
  53. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/catalog.d.ts +15 -0
  54. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/catalog.d.ts.map +1 -0
  55. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/catalog.js +153 -0
  56. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/catalog.js.map +1 -0
  57. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/detect.d.ts +14 -0
  58. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/detect.d.ts.map +1 -0
  59. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/detect.js +92 -0
  60. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/detect.js.map +1 -0
  61. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/index.d.ts +5 -0
  62. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/index.d.ts.map +1 -0
  63. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/index.js +5 -0
  64. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/index.js.map +1 -0
  65. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/inspect.d.ts +74 -0
  66. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/inspect.d.ts.map +1 -0
  67. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/inspect.js +169 -0
  68. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/agents/inspect.js.map +1 -0
  69. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/backup/index.d.ts +70 -0
  70. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/backup/index.d.ts.map +1 -0
  71. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/backup/index.js +258 -0
  72. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/backup/index.js.map +1 -0
  73. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/debug/index.d.ts +71 -0
  74. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/debug/index.d.ts.map +1 -0
  75. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/debug/index.js +263 -0
  76. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/debug/index.js.map +1 -0
  77. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/effective/index.d.ts +65 -0
  78. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/effective/index.d.ts.map +1 -0
  79. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/effective/index.js +227 -0
  80. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/effective/index.js.map +1 -0
  81. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/import/from-agents.d.ts +59 -0
  82. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/import/from-agents.d.ts.map +1 -0
  83. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/import/from-agents.js +212 -0
  84. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/import/from-agents.js.map +1 -0
  85. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/import/index.d.ts +26 -0
  86. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/import/index.d.ts.map +1 -0
  87. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/import/index.js +100 -0
  88. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/import/index.js.map +1 -0
  89. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/index.d.ts +12 -0
  90. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/index.d.ts.map +1 -0
  91. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/index.js +12 -0
  92. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/index.js.map +1 -0
  93. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/rules/index.d.ts +6 -0
  94. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/rules/index.d.ts.map +1 -0
  95. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/rules/index.js +292 -0
  96. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/rules/index.js.map +1 -0
  97. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/spread/index.d.ts +38 -0
  98. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/spread/index.d.ts.map +1 -0
  99. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/spread/index.js +190 -0
  100. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/spread/index.js.map +1 -0
  101. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/config.d.ts +5 -0
  102. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/config.d.ts.map +1 -0
  103. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/config.js +62 -0
  104. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/config.js.map +1 -0
  105. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/custom-agents.d.ts +45 -0
  106. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/custom-agents.d.ts.map +1 -0
  107. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/custom-agents.js +103 -0
  108. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/custom-agents.js.map +1 -0
  109. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/fs-utils.d.ts +16 -0
  110. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/fs-utils.d.ts.map +1 -0
  111. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/fs-utils.js +45 -0
  112. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/fs-utils.js.map +1 -0
  113. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/index.d.ts +9 -0
  114. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/index.d.ts.map +1 -0
  115. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/index.js +9 -0
  116. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/index.js.map +1 -0
  117. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/mcp.d.ts +5 -0
  118. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/mcp.d.ts.map +1 -0
  119. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/mcp.js +30 -0
  120. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/mcp.js.map +1 -0
  121. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/merge.d.ts +15 -0
  122. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/merge.d.ts.map +1 -0
  123. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/merge.js +28 -0
  124. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/merge.js.map +1 -0
  125. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/paths.d.ts +22 -0
  126. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/paths.d.ts.map +1 -0
  127. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/paths.js +107 -0
  128. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/paths.js.map +1 -0
  129. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/rules.d.ts +12 -0
  130. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/rules.d.ts.map +1 -0
  131. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/rules.js +32 -0
  132. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/rules.js.map +1 -0
  133. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/scaffolding.d.ts +11 -0
  134. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/scaffolding.d.ts.map +1 -0
  135. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/scaffolding.js +32 -0
  136. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/scaffolding.js.map +1 -0
  137. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/skills.d.ts +13 -0
  138. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/skills.d.ts.map +1 -0
  139. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/skills.js +84 -0
  140. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/store/skills.js.map +1 -0
  141. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/sync/index.d.ts +89 -0
  142. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/sync/index.d.ts.map +1 -0
  143. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/sync/index.js +423 -0
  144. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/sync/index.js.map +1 -0
  145. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/team/git.d.ts +23 -0
  146. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/team/git.d.ts.map +1 -0
  147. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/team/git.js +132 -0
  148. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/team/git.js.map +1 -0
  149. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/team/index.d.ts +2 -0
  150. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/team/index.d.ts.map +1 -0
  151. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/team/index.js +2 -0
  152. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/team/index.js.map +1 -0
  153. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/types.d.ts +142 -0
  154. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/types.d.ts.map +1 -0
  155. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/types.js +13 -0
  156. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/dist/types.js.map +1 -0
  157. package/vendor/plexus-agent-config-web/node_modules/plexus-agent-config-core/package.json +29 -0
  158. package/vendor/plexus-agent-config-web/package.json +1 -1
  159. /package/vendor/plexus-agent-config-web/.next/static/{FKr7yvzxSzNS1oAjTyP1N → cYvZNrsyPRNUjzvxkVMIa}/_buildManifest.js +0 -0
  160. /package/vendor/plexus-agent-config-web/.next/static/{FKr7yvzxSzNS1oAjTyP1N → cYvZNrsyPRNUjzvxkVMIa}/_ssgManifest.js +0 -0
@@ -0,0 +1,263 @@
1
+ import fs from "node:fs/promises";
2
+ import os from "node:os";
3
+ import path from "node:path";
4
+ import { isAgentInstalled } from "../agents/detect.js";
5
+ import { instructionsForAgent } from "../agents/inspect.js";
6
+ import { listBackups } from "../backup/index.js";
7
+ import { pathExists } from "../store/fs-utils.js";
8
+ import { AGENT_DISPLAY_NAMES, AGENT_PATHS, AGENT_ROOTS, ALL_AGENTS, PLEXUS_PATHS, } from "../store/paths.js";
9
+ const HOME = os.homedir();
10
+ function tilde(p) {
11
+ if (p === HOME)
12
+ return "~";
13
+ if (p.startsWith(`${HOME}/`))
14
+ return `~/${p.slice(HOME.length + 1)}`;
15
+ return p;
16
+ }
17
+ async function statPath(p) {
18
+ const out = {
19
+ path: p,
20
+ display: tilde(p),
21
+ exists: false,
22
+ kind: "missing",
23
+ };
24
+ let lst;
25
+ try {
26
+ lst = await fs.lstat(p);
27
+ }
28
+ catch {
29
+ return out;
30
+ }
31
+ out.exists = true;
32
+ if (lst.isSymbolicLink()) {
33
+ out.kind = "symlink";
34
+ try {
35
+ const t = await fs.readlink(p);
36
+ out.linkTarget = path.isAbsolute(t) ? t : path.resolve(path.dirname(p), t);
37
+ out.linkTargetExists = await pathExists(out.linkTarget);
38
+ }
39
+ catch {
40
+ // ignore
41
+ }
42
+ try {
43
+ const s = await fs.stat(p); // follows the symlink
44
+ out.size = s.size;
45
+ out.mtime = s.mtime.toISOString();
46
+ }
47
+ catch {
48
+ // dangling
49
+ }
50
+ }
51
+ else if (lst.isDirectory()) {
52
+ out.kind = "dir";
53
+ out.mtime = lst.mtime.toISOString();
54
+ try {
55
+ const ents = await fs.readdir(p);
56
+ out.entryCount = ents.filter((n) => !n.startsWith(".") && !n.includes(".plexus-backup-")).length;
57
+ }
58
+ catch {
59
+ // ignore
60
+ }
61
+ }
62
+ else {
63
+ out.kind = "file";
64
+ out.size = lst.size;
65
+ out.mtime = lst.mtime.toISOString();
66
+ }
67
+ return out;
68
+ }
69
+ async function listDir(dir) {
70
+ if (!(await pathExists(dir)))
71
+ return [];
72
+ let names;
73
+ try {
74
+ names = await fs.readdir(dir);
75
+ }
76
+ catch {
77
+ return [];
78
+ }
79
+ const filtered = names.filter((n) => !n.startsWith(".") && !n.includes(".plexus-backup-")).sort();
80
+ const out = [];
81
+ for (const n of filtered) {
82
+ out.push(await statPath(path.join(dir, n)));
83
+ }
84
+ return out;
85
+ }
86
+ async function collectAgent(agentId) {
87
+ const caps = AGENT_PATHS[agentId];
88
+ const root = await statPath(AGENT_ROOTS[agentId]);
89
+ const instructionPath = instructionsForAgent(agentId)[0]?.abs ?? null;
90
+ const [mcpFile, instructionFile, skillsDir] = await Promise.all([
91
+ statPath(caps.mcpPath),
92
+ instructionPath ? statPath(instructionPath) : Promise.resolve(null),
93
+ statPath(caps.skillsDir),
94
+ ]);
95
+ const skillEntries = caps.skills ? await listDir(caps.skillsDir) : [];
96
+ return {
97
+ id: agentId,
98
+ displayName: AGENT_DISPLAY_NAMES[agentId],
99
+ installed: isAgentInstalled(agentId),
100
+ mcpFileMode: caps.mcpFileMode ?? "shared",
101
+ root,
102
+ mcpFile,
103
+ instructionFile,
104
+ skillsDir,
105
+ skillEntries,
106
+ };
107
+ }
108
+ async function collectPlexusStore() {
109
+ const teamMcp = path.join(PLEXUS_PATHS.team, PLEXUS_PATHS.mcpDirRel, "servers.yaml");
110
+ const personalMcp = path.join(PLEXUS_PATHS.personal, PLEXUS_PATHS.mcpDirRel, "servers.yaml");
111
+ const teamSkillsDir = path.join(PLEXUS_PATHS.team, PLEXUS_PATHS.skillsDirRel);
112
+ const personalSkillsDir = path.join(PLEXUS_PATHS.personal, PLEXUS_PATHS.skillsDirRel);
113
+ const [root, config, team, personal, cacheMcp, backups, teamMcpServers, personalMcpServers, teamSkillEntries, personalSkillEntries, cacheMcpEntries,] = await Promise.all([
114
+ statPath(PLEXUS_PATHS.root),
115
+ statPath(PLEXUS_PATHS.config),
116
+ statPath(PLEXUS_PATHS.team),
117
+ statPath(PLEXUS_PATHS.personal),
118
+ statPath(PLEXUS_PATHS.mcpCache),
119
+ statPath(PLEXUS_PATHS.backups),
120
+ statPath(teamMcp),
121
+ statPath(personalMcp),
122
+ listDir(teamSkillsDir),
123
+ listDir(personalSkillsDir),
124
+ listDir(PLEXUS_PATHS.mcpCache),
125
+ ]);
126
+ let backupCount = 0;
127
+ try {
128
+ const all = await listBackups();
129
+ backupCount = all.length;
130
+ }
131
+ catch {
132
+ // ignore
133
+ }
134
+ return {
135
+ root,
136
+ config,
137
+ team,
138
+ personal,
139
+ cacheMcp,
140
+ backups,
141
+ teamMcpServers,
142
+ personalMcpServers,
143
+ teamSkillEntries,
144
+ personalSkillEntries,
145
+ cacheMcpEntries,
146
+ backupCount,
147
+ };
148
+ }
149
+ export async function collectDebugSnapshot() {
150
+ const plexus = await collectPlexusStore();
151
+ const agents = await Promise.all(ALL_AGENTS.map(collectAgent));
152
+ return {
153
+ generatedAt: new Date().toISOString(),
154
+ host: {
155
+ platform: process.platform,
156
+ release: os.release(),
157
+ node: process.version,
158
+ home: HOME,
159
+ },
160
+ plexus,
161
+ agents,
162
+ };
163
+ }
164
+ // ---------- text formatting ----------
165
+ function fmtSize(bytes) {
166
+ if (bytes == null)
167
+ return "";
168
+ if (bytes < 1024)
169
+ return `${bytes} B`;
170
+ if (bytes < 1024 * 1024)
171
+ return `${(bytes / 1024).toFixed(1)} KB`;
172
+ return `${(bytes / 1024 / 1024).toFixed(2)} MB`;
173
+ }
174
+ function pad(s, width) {
175
+ if (s.length >= width)
176
+ return s;
177
+ return s + " ".repeat(width - s.length);
178
+ }
179
+ function fmtRow(p, indent = 0) {
180
+ const prefix = " ".repeat(indent);
181
+ const left = pad(`${prefix}${p.display}`, 56);
182
+ if (!p.exists) {
183
+ return `${left} MISSING`;
184
+ }
185
+ switch (p.kind) {
186
+ case "symlink": {
187
+ const tgt = p.linkTarget ? tilde(p.linkTarget) : "?";
188
+ const dangling = p.linkTargetExists === false ? " [DANGLING]" : "";
189
+ const meta = p.size != null ? ` ${fmtSize(p.size)} ${p.mtime ?? ""}` : "";
190
+ return `${left} LINK -> ${tgt}${dangling}${meta}`.trimEnd();
191
+ }
192
+ case "dir": {
193
+ const count = p.entryCount != null ? ` (${p.entryCount} entries)` : "";
194
+ return `${left} DIR${count}`;
195
+ }
196
+ case "file": {
197
+ const size = fmtSize(p.size);
198
+ const mtime = p.mtime ?? "";
199
+ return `${left} FILE ${pad(size, 9)} ${mtime}`.trimEnd();
200
+ }
201
+ default:
202
+ return `${left} MISSING`;
203
+ }
204
+ }
205
+ function fmtAgentBlock(a) {
206
+ const header = `[Agent: ${a.displayName} (${a.id}) | mode=${a.mcpFileMode} | installed=${a.installed}]`;
207
+ const lines = [header];
208
+ lines.push(fmtRow(a.root));
209
+ lines.push(fmtRow(a.mcpFile));
210
+ if (a.instructionFile)
211
+ lines.push(fmtRow(a.instructionFile));
212
+ lines.push(fmtRow(a.skillsDir));
213
+ if (a.skillEntries.length === 0) {
214
+ lines.push(" (no skill entries)");
215
+ }
216
+ else {
217
+ for (const e of a.skillEntries) {
218
+ lines.push(fmtRow(e, 2));
219
+ }
220
+ }
221
+ return lines.join("\n");
222
+ }
223
+ function fmtPlexusBlock(p) {
224
+ const lines = [];
225
+ lines.push("[Plexus Store]");
226
+ lines.push(fmtRow(p.root));
227
+ lines.push(fmtRow(p.config));
228
+ lines.push(fmtRow(p.team));
229
+ lines.push(fmtRow(p.teamMcpServers));
230
+ lines.push(" team skills:");
231
+ if (p.teamSkillEntries.length === 0)
232
+ lines.push(" (empty)");
233
+ for (const e of p.teamSkillEntries)
234
+ lines.push(fmtRow(e, 4));
235
+ lines.push(fmtRow(p.personal));
236
+ lines.push(fmtRow(p.personalMcpServers));
237
+ lines.push(" personal skills:");
238
+ if (p.personalSkillEntries.length === 0)
239
+ lines.push(" (empty)");
240
+ for (const e of p.personalSkillEntries)
241
+ lines.push(fmtRow(e, 4));
242
+ lines.push(fmtRow(p.cacheMcp));
243
+ for (const e of p.cacheMcpEntries)
244
+ lines.push(fmtRow(e, 2));
245
+ lines.push(fmtRow(p.backups));
246
+ lines.push(` snapshots: ${p.backupCount} (ring buffer keeps 20)`);
247
+ return lines.join("\n");
248
+ }
249
+ export function formatDebugSnapshot(s, version) {
250
+ const lines = [];
251
+ lines.push(`=== Plexus${version ? ` v${version}` : ""} — Debug Snapshot ===`);
252
+ lines.push(`generated: ${s.generatedAt}`);
253
+ lines.push(`host: ${s.host.platform} ${s.host.release} node: ${s.host.node} home: ${s.host.home}`);
254
+ lines.push("");
255
+ lines.push(fmtPlexusBlock(s.plexus));
256
+ for (const a of s.agents) {
257
+ lines.push("");
258
+ lines.push(fmtAgentBlock(a));
259
+ }
260
+ lines.push("");
261
+ return lines.join("\n");
262
+ }
263
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/debug/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACL,mBAAmB,EAC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AAC,CAAC,IAAI,CAAC,IAAI,EAAE,CACzF,CAAC;IACF,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IACrC,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;QACzB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,65 @@
1
+ import type { AgentId, SyncResult } from "../types.js";
2
+ /**
3
+ * "Effective view" = the union of items present in any agent's native
4
+ * config OR in the Plexus store. Each item is keyed by id; the row tells
5
+ * you which agents currently have it and where authority lives.
6
+ *
7
+ * This is what the MCP Servers and Skills pages show.
8
+ */
9
+ export type ItemAuthority = "personal" | "team" | "native";
10
+ export interface EffectiveMcpRow {
11
+ id: string;
12
+ command: string;
13
+ args?: string[];
14
+ env?: Record<string, string>;
15
+ /** Where the canonical record lives. */
16
+ authority: ItemAuthority;
17
+ /** Agents that currently have this item (native or via store). */
18
+ effectiveAgents: AgentId[];
19
+ /** Agents that have it natively (read from each agent's mcp config). */
20
+ nativeAgents: AgentId[];
21
+ /** If in store: the store's enabledAgents. */
22
+ enabledAgents?: AgentId[];
23
+ }
24
+ export interface EffectiveSkillRow {
25
+ id: string;
26
+ name: string;
27
+ description?: string;
28
+ authority: ItemAuthority;
29
+ effectiveAgents: AgentId[];
30
+ nativeAgents: AgentId[];
31
+ enabledAgents?: AgentId[];
32
+ }
33
+ export declare function getEffectiveMcp(): Promise<EffectiveMcpRow[]>;
34
+ export declare function getEffectiveSkills(): Promise<EffectiveSkillRow[]>;
35
+ /**
36
+ * Toggle whether `agent` should have `id` (an MCP server). Promotes a
37
+ * native-only item into the personal layer if needed, updates enabledAgents,
38
+ * and runs sync so the change is visible immediately.
39
+ *
40
+ * When promoting a native item to the personal layer for the first time, we
41
+ * sync EVERY native source agent too — that way the source agents stop
42
+ * carrying their own copies and start reading the canonical Plexus copy.
43
+ * For non-promote toggles we sync just the affected agent.
44
+ */
45
+ export declare function toggleMcpAgent(opts: {
46
+ id: string;
47
+ agent: AgentId;
48
+ enabled: boolean;
49
+ }): Promise<{
50
+ ok: boolean;
51
+ syncResult?: SyncResult;
52
+ message?: string;
53
+ }>;
54
+ /** Same idea for skills. Promote also re-syncs every native source. */
55
+ export declare function toggleSkillAgent(opts: {
56
+ id: string;
57
+ agent: AgentId;
58
+ enabled: boolean;
59
+ }): Promise<{
60
+ ok: boolean;
61
+ syncResult?: SyncResult;
62
+ message?: string;
63
+ }>;
64
+ export declare const __ALL_AGENTS: AgentId[];
65
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/effective/index.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,OAAO,EAAuC,UAAU,EAAE,MAAM,aAAa,CAAC;AAE5F;;;;;;GAMG;AAEH,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE3D,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,wCAAwC;IACxC,SAAS,EAAE,aAAa,CAAC;IACzB,kEAAkE;IAClE,eAAe,EAAE,OAAO,EAAE,CAAC;IAC3B,wEAAwE;IACxE,YAAY,EAAE,OAAO,EAAE,CAAC;IACxB,8CAA8C;IAC9C,aAAa,CAAC,EAAE,OAAO,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,aAAa,CAAC;IACzB,eAAe,EAAE,OAAO,EAAE,CAAC;IAC3B,YAAY,EAAE,OAAO,EAAE,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,EAAE,CAAC;CAC3B;AAED,wBAAsB,eAAe,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC,CA+ClE;AAED,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC,CA6CvE;AAED;;;;;;;;;GASG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;CAClB,GAAG,OAAO,CAAC;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,UAAU,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAoDtE;AAED,uEAAuE;AACvE,wBAAsB,gBAAgB,CAAC,IAAI,EAAE;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;CAClB,GAAG,OAAO,CAAC;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,UAAU,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAyCtE;AAyBD,eAAO,MAAM,YAAY,WAAa,CAAC"}
@@ -0,0 +1,227 @@
1
+ import { adapters } from "../agents/adapters/index.js";
2
+ import { detectAgents } from "../agents/detect.js";
3
+ import { snapshotAgentConfigs } from "../backup/index.js";
4
+ import { buildImportPreview } from "../import/from-agents.js";
5
+ import { readConfig } from "../store/config.js";
6
+ import { readMCP, writeMCP } from "../store/mcp.js";
7
+ import { mergeMCP, mergeSkills } from "../store/merge.js";
8
+ import { ALL_AGENTS } from "../store/paths.js";
9
+ import { readSkills, resolveSkillSourceDir, writeSkill } from "../store/skills.js";
10
+ export async function getEffectiveMcp() {
11
+ const [team, personal] = await Promise.all([readMCP("team"), readMCP("personal")]);
12
+ const merged = mergeMCP(team, personal);
13
+ const teamIds = new Set(team.map((m) => m.id));
14
+ const personalIds = new Set(personal.map((m) => m.id));
15
+ // Read native config across all agents (we reuse the import helper).
16
+ const nativePreview = await buildImportPreview({ storeMcp: [], storeSkills: [] });
17
+ const nativeById = new Map();
18
+ for (const cand of nativePreview.mcp) {
19
+ if (cand.kind !== "new")
20
+ continue;
21
+ nativeById.set(cand.item.id, {
22
+ sources: cand.sourceAgents,
23
+ first: cand.item,
24
+ });
25
+ }
26
+ const allIds = new Set([...merged.map((m) => m.id), ...nativeById.keys()]);
27
+ const rows = [];
28
+ for (const id of allIds) {
29
+ const storeRow = merged.find((m) => m.id === id);
30
+ const native = nativeById.get(id);
31
+ const nativeAgents = native?.sources ?? [];
32
+ const enabledAgents = storeRow?.enabledAgents ?? [];
33
+ const effectiveAgents = Array.from(new Set([...nativeAgents, ...enabledAgents]));
34
+ let authority;
35
+ if (personalIds.has(id))
36
+ authority = "personal";
37
+ else if (teamIds.has(id))
38
+ authority = "team";
39
+ else
40
+ authority = "native";
41
+ const base = storeRow ?? native.first;
42
+ rows.push({
43
+ id,
44
+ command: base.command,
45
+ args: base.args,
46
+ env: base.env,
47
+ authority,
48
+ effectiveAgents,
49
+ nativeAgents,
50
+ enabledAgents: storeRow ? enabledAgents : undefined,
51
+ });
52
+ }
53
+ rows.sort((a, b) => a.id.localeCompare(b.id));
54
+ return rows;
55
+ }
56
+ export async function getEffectiveSkills() {
57
+ const [team, personal] = await Promise.all([readSkills("team"), readSkills("personal")]);
58
+ const merged = mergeSkills(team, personal);
59
+ const teamIds = new Set(team.map((s) => s.id));
60
+ const personalIds = new Set(personal.map((s) => s.id));
61
+ const nativePreview = await buildImportPreview({ storeMcp: [], storeSkills: [] });
62
+ const nativeById = new Map();
63
+ for (const cand of nativePreview.skills) {
64
+ if (cand.kind !== "new")
65
+ continue;
66
+ nativeById.set(cand.item.id, {
67
+ sources: cand.sourceAgents,
68
+ first: cand.item,
69
+ });
70
+ }
71
+ const allIds = new Set([...merged.map((s) => s.id), ...nativeById.keys()]);
72
+ const rows = [];
73
+ for (const id of allIds) {
74
+ const storeRow = merged.find((s) => s.id === id);
75
+ const native = nativeById.get(id);
76
+ const nativeAgents = native?.sources ?? [];
77
+ const enabledAgents = storeRow?.enabledAgents ?? [];
78
+ const effectiveAgents = Array.from(new Set([...nativeAgents, ...enabledAgents]));
79
+ let authority;
80
+ if (personalIds.has(id))
81
+ authority = "personal";
82
+ else if (teamIds.has(id))
83
+ authority = "team";
84
+ else
85
+ authority = "native";
86
+ const base = storeRow ?? native.first;
87
+ rows.push({
88
+ id,
89
+ name: base.name,
90
+ description: base.description,
91
+ authority,
92
+ effectiveAgents,
93
+ nativeAgents,
94
+ enabledAgents: storeRow ? enabledAgents : undefined,
95
+ });
96
+ }
97
+ rows.sort((a, b) => a.id.localeCompare(b.id));
98
+ return rows;
99
+ }
100
+ /**
101
+ * Toggle whether `agent` should have `id` (an MCP server). Promotes a
102
+ * native-only item into the personal layer if needed, updates enabledAgents,
103
+ * and runs sync so the change is visible immediately.
104
+ *
105
+ * When promoting a native item to the personal layer for the first time, we
106
+ * sync EVERY native source agent too — that way the source agents stop
107
+ * carrying their own copies and start reading the canonical Plexus copy.
108
+ * For non-promote toggles we sync just the affected agent.
109
+ */
110
+ export async function toggleMcpAgent(opts) {
111
+ const personal = await readMCP("personal");
112
+ const team = await readMCP("team");
113
+ const personalIdx = personal.findIndex((m) => m.id === opts.id);
114
+ const teamRow = team.find((m) => m.id === opts.id);
115
+ const nextPersonal = [...personal];
116
+ let agentsToSync = [opts.agent];
117
+ if (personalIdx >= 0) {
118
+ const row = { ...nextPersonal[personalIdx] };
119
+ if (opts.enabled) {
120
+ if (!row.enabledAgents.includes(opts.agent)) {
121
+ row.enabledAgents = [...row.enabledAgents, opts.agent];
122
+ }
123
+ }
124
+ else {
125
+ row.enabledAgents = row.enabledAgents.filter((a) => a !== opts.agent);
126
+ }
127
+ nextPersonal[personalIdx] = row;
128
+ }
129
+ else if (teamRow) {
130
+ const enabledAgents = opts.enabled
131
+ ? Array.from(new Set([...teamRow.enabledAgents, opts.agent]))
132
+ : teamRow.enabledAgents.filter((a) => a !== opts.agent);
133
+ nextPersonal.push({ ...teamRow, layer: "personal", enabledAgents });
134
+ }
135
+ else {
136
+ // Promote: pull from any agent's native config and copy to personal.
137
+ const nativePreview = await buildImportPreview({ storeMcp: [], storeSkills: [] });
138
+ const cand = nativePreview.mcp.find((c) => c.kind === "new" && c.item.id === opts.id);
139
+ if (!cand || cand.kind !== "new") {
140
+ return { ok: false, message: `Item ${opts.id} not found in any agent's native config` };
141
+ }
142
+ const enabledAgents = opts.enabled
143
+ ? Array.from(new Set([...cand.sourceAgents, opts.agent]))
144
+ : cand.sourceAgents.filter((a) => a !== opts.agent);
145
+ nextPersonal.push({ ...cand.item, layer: "personal", enabledAgents });
146
+ // Re-sync every native source so they pick up the canonical Plexus copy.
147
+ agentsToSync = Array.from(new Set([...cand.sourceAgents, opts.agent]));
148
+ }
149
+ await writeMCP("personal", nextPersonal);
150
+ // One backup snapshot per toggle, even if we sync multiple agents.
151
+ const backup = await snapshotAgentConfigs({
152
+ reason: `toggleMcpAgent ${opts.id} ${opts.agent} ${opts.enabled}`,
153
+ }).catch(() => undefined);
154
+ const results = [];
155
+ for (const a of agentsToSync) {
156
+ const r = await syncSingleAgent(a);
157
+ if (r)
158
+ results.push(r);
159
+ }
160
+ return { ok: true, syncResult: results[0], message: backup?.dir };
161
+ }
162
+ /** Same idea for skills. Promote also re-syncs every native source. */
163
+ export async function toggleSkillAgent(opts) {
164
+ const personal = await readSkills("personal");
165
+ const team = await readSkills("team");
166
+ const personalRow = personal.find((s) => s.id === opts.id);
167
+ const teamRow = team.find((s) => s.id === opts.id);
168
+ let agentsToSync = [opts.agent];
169
+ if (personalRow) {
170
+ const enabledAgents = opts.enabled
171
+ ? Array.from(new Set([...personalRow.enabledAgents, opts.agent]))
172
+ : personalRow.enabledAgents.filter((a) => a !== opts.agent);
173
+ await writeSkill({ ...personalRow, enabledAgents });
174
+ }
175
+ else if (teamRow) {
176
+ const enabledAgents = opts.enabled
177
+ ? Array.from(new Set([...teamRow.enabledAgents, opts.agent]))
178
+ : teamRow.enabledAgents.filter((a) => a !== opts.agent);
179
+ await writeSkill({ ...teamRow, layer: "personal", enabledAgents });
180
+ }
181
+ else {
182
+ const nativePreview = await buildImportPreview({ storeMcp: [], storeSkills: [] });
183
+ const cand = nativePreview.skills.find((c) => c.kind === "new" && c.item.id === opts.id);
184
+ if (!cand || cand.kind !== "new") {
185
+ return { ok: false, message: `Skill ${opts.id} not found in any agent's native config` };
186
+ }
187
+ const enabledAgents = opts.enabled
188
+ ? Array.from(new Set([...cand.sourceAgents, opts.agent]))
189
+ : cand.sourceAgents.filter((a) => a !== opts.agent);
190
+ await writeSkill({ ...cand.item, layer: "personal", enabledAgents });
191
+ agentsToSync = Array.from(new Set([...cand.sourceAgents, opts.agent]));
192
+ }
193
+ const backup = await snapshotAgentConfigs({
194
+ reason: `toggleSkillAgent ${opts.id} ${opts.agent} ${opts.enabled}`,
195
+ }).catch(() => undefined);
196
+ const results = [];
197
+ for (const a of agentsToSync) {
198
+ const r = await syncSingleAgent(a);
199
+ if (r)
200
+ results.push(r);
201
+ }
202
+ return { ok: true, syncResult: results[0], message: backup?.dir };
203
+ }
204
+ async function syncSingleAgent(agentId) {
205
+ const config = await readConfig();
206
+ const detected = detectAgents();
207
+ const target = detected.find((d) => d.id === agentId);
208
+ if (!target?.installed || config.agents[agentId] === false)
209
+ return undefined;
210
+ const [team, personal] = await Promise.all([readMCP("team"), readMCP("personal")]);
211
+ const [teamSk, personalSk] = await Promise.all([readSkills("team"), readSkills("personal")]);
212
+ const mergedMcp = mergeMCP(team, personal);
213
+ const mergedSkills = mergeSkills(teamSk, personalSk);
214
+ const skillSourcePaths = new Map();
215
+ for (const s of mergedSkills) {
216
+ skillSourcePaths.set(s.id, resolveSkillSourceDir(s.layer, s.id));
217
+ }
218
+ return adapters[agentId].apply({
219
+ agentId,
220
+ mcp: mergedMcp,
221
+ skills: mergedSkills,
222
+ skillSourcePaths,
223
+ syncStrategy: config.syncStrategy ?? "symlink",
224
+ });
225
+ }
226
+ export const __ALL_AGENTS = ALL_AGENTS;
227
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/effective/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAsCnF,MAAM,CAAC,KAAK,UAAU,eAAe;IACnC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACnF,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,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";
2
+ /**
3
+ * Import existing on-disk configuration from each installed AI agent into
4
+ * the Plexus personal layer.
5
+ *
6
+ * Three outcomes per item id:
7
+ * - `new` id is not in the Plexus store at all → write a new entry
8
+ * (enabledAgents = union of source agents that already have it).
9
+ * - `extend` id is already in the store, but at least one source agent that
10
+ * currently has it natively is missing from `enabledAgents` →
11
+ * add those agents to `enabledAgents` of the existing entry.
12
+ * - `managed` id is in the store and every source agent already appears in
13
+ * `enabledAgents` → nothing to do (silently skipped).
14
+ *
15
+ * Importing never mutates the agents' native files. Only the Plexus personal
16
+ * layer is touched, and only by `applyImport`.
17
+ */
18
+ export interface NewItem<T> {
19
+ kind: "new";
20
+ item: T;
21
+ sourceAgents: AgentId[];
22
+ }
23
+ export interface ExtendItem<T> {
24
+ kind: "extend";
25
+ /** The id of the existing store entry. */
26
+ id: string;
27
+ displayName: string;
28
+ /** Agents to add to the existing entry's enabledAgents. */
29
+ agentsToAdd: AgentId[];
30
+ /** Existing enabledAgents (for display). */
31
+ currentAgents: AgentId[];
32
+ }
33
+ export type MCPCandidate = NewItem<MCPServerDef> | ExtendItem<MCPServerDef>;
34
+ export type SkillCandidate = NewItem<SkillDef> | ExtendItem<SkillDef>;
35
+ export interface ImportPreview {
36
+ mcp: MCPCandidate[];
37
+ skills: SkillCandidate[];
38
+ /** Per-agent counts of items found in the agent's native config. */
39
+ perAgent: Record<AgentId, {
40
+ mcp: number;
41
+ skills: number;
42
+ }>;
43
+ }
44
+ export declare function readNativeMcpFromAgent(agentId: AgentId): Promise<Array<{
45
+ id: string;
46
+ command: string;
47
+ args?: string[];
48
+ env?: Record<string, string>;
49
+ url?: string;
50
+ httpUrl?: string;
51
+ headers?: Record<string, string>;
52
+ }>>;
53
+ export declare function readNativeSkillsFromAgent(agentId: AgentId): Promise<SkillDef[]>;
54
+ export interface BuildImportPreviewArgs {
55
+ storeMcp: MCPServerDef[];
56
+ storeSkills: SkillDef[];
57
+ }
58
+ export declare function buildImportPreview(args: BuildImportPreviewArgs): Promise<ImportPreview>;
59
+ //# sourceMappingURL=from-agents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"from-agents.d.ts","sourceRoot":"","sources":["../../src/import/from-agents.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEnE;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,WAAW,OAAO,CAAC,CAAC;IACxB,IAAI,EAAE,KAAK,CAAC;IACZ,IAAI,EAAE,CAAC,CAAC;IACR,YAAY,EAAE,OAAO,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,IAAI,EAAE,QAAQ,CAAC;IACf,0CAA0C;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,2DAA2D;IAC3D,WAAW,EAAE,OAAO,EAAE,CAAC;IACvB,4CAA4C;IAC5C,aAAa,EAAE,OAAO,EAAE,CAAC;CAC1B;AAED,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;AAC5E,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;AAEtE,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,YAAY,EAAE,CAAC;IACpB,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,oEAAoE;IACpE,QAAQ,EAAE,MAAM,CAAC,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC5D;AAED,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CACrE,KAAK,CAAC;IACJ,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,E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