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 @@
1
+ {"version":3,"file":"json-mcp.d.ts","sourceRoot":"","sources":["../../../src/agents/adapters/json-mcp.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAA4B,MAAM,gBAAgB,CAAC;AACxE,OAAO,EACL,KAAK,YAAY,EAMlB,MAAM,WAAW,CAAC;AAEnB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,YAAY,CA8DjE"}
@@ -0,0 +1,182 @@
1
+ import fs from "node:fs/promises";
2
+ import path from "node:path";
3
+ import { AGENT_PATHS, PLEXUS_PATHS } from "../../store/paths.js";
4
+ import { emptyResult, ensureDir, placeFileSymlink, placeLinkOrCopy, } from "./base.js";
5
+ /**
6
+ * Generic JSON-MCP + skill-directory adapter.
7
+ *
8
+ * Used by Claude Code, Cursor, Gemini CLI, Qwen Code, Factory Droid (and any future agent that
9
+ * stores MCP as `{ "mcpServers": {...} }` JSON and skills as a directory).
10
+ *
11
+ * Two MCP write modes (chosen by AGENT_PATHS[agent].mcpFileMode):
12
+ *
13
+ * - "exclusive": Plexus owns the agent's MCP file. We render a canonical
14
+ * JSON to ~/.config/plexus/.cache/mcp/<agent>.json and symlink the
15
+ * agent's path to that cache. Editing the agent's path is editing the
16
+ * same Plexus-owned file. This is appropriate for agents whose MCP
17
+ * file holds nothing else (Cursor, Factory Droid).
18
+ *
19
+ * - "shared" (default): the agent's file holds many other unrelated keys
20
+ * (for example Claude Code's ~/.claude.json carries auth/history/settings). We
21
+ * partial-write only the `mcpServers` section in place and never replace
22
+ * the whole file.
23
+ *
24
+ * Skills are always symlink-first via placeLinkOrCopy.
25
+ */
26
+ export function makeJsonMcpAdapter(agentId) {
27
+ return {
28
+ id: agentId,
29
+ async apply(ctx) {
30
+ const result = emptyResult(agentId);
31
+ const caps = AGENT_PATHS[agentId];
32
+ // ── MCP ─────────────────────────────────────────────
33
+ if (caps.mcp) {
34
+ const mode = caps.mcpFileMode ?? "shared";
35
+ try {
36
+ await ensureDir(path.dirname(caps.mcpPath));
37
+ const enabledForAgent = ctx.mcp.filter((s) => s.enabledAgents.includes(agentId));
38
+ if (mode === "exclusive") {
39
+ await writeExclusive(agentId, ctx.mcp, enabledForAgent, ctx.syncStrategy);
40
+ }
41
+ else {
42
+ await writeShared(caps.mcpPath, ctx.mcp, enabledForAgent);
43
+ }
44
+ result.applied.mcp = enabledForAgent.length;
45
+ }
46
+ catch (err) {
47
+ result.errors.push(`MCP write failed: ${err.message}`);
48
+ }
49
+ }
50
+ // ── Skills ──────────────────────────────────────────
51
+ if (caps.skills) {
52
+ try {
53
+ await ensureDir(caps.skillsDir);
54
+ const filtered = ctx.skills.filter((s) => s.enabledAgents.includes(agentId));
55
+ const disabledManagedSkillIds = new Set(ctx.skills.filter((s) => !s.enabledAgents.includes(agentId)).map((s) => s.id));
56
+ // Remove Plexus-managed skill dirs that are now disabled for this agent.
57
+ for (const id of disabledManagedSkillIds) {
58
+ const dir = path.join(caps.skillsDir, id);
59
+ await safeRemoveDir(dir);
60
+ }
61
+ for (const skill of filtered) {
62
+ const sourcePath = ctx.skillSourcePaths.get(skill.id);
63
+ if (!sourcePath) {
64
+ result.warnings.push(`No source path for skill: ${skill.id}`);
65
+ continue;
66
+ }
67
+ const destDir = path.join(caps.skillsDir, skill.id);
68
+ try {
69
+ await placeLinkOrCopy(sourcePath, destDir, ctx.syncStrategy);
70
+ result.applied.skills += 1;
71
+ }
72
+ catch (err) {
73
+ result.errors.push(`Skill ${skill.id} sync failed: ${err.message}`);
74
+ }
75
+ }
76
+ }
77
+ catch (err) {
78
+ result.errors.push(`Skills sync failed: ${err.message}`);
79
+ }
80
+ }
81
+ return result;
82
+ },
83
+ };
84
+ }
85
+ /**
86
+ * Symlink-safe directory removal. fs.rm(recursive) on a symlink behaves
87
+ * inconsistently across OS versions — explicitly handle the symlink case
88
+ * by unlinking the link itself, never the target.
89
+ */
90
+ async function safeRemoveDir(p) {
91
+ try {
92
+ const lst = await fs.lstat(p);
93
+ if (lst.isSymbolicLink()) {
94
+ await fs.unlink(p);
95
+ }
96
+ else {
97
+ await fs.rm(p, { recursive: true, force: true });
98
+ }
99
+ }
100
+ catch {
101
+ // best-effort
102
+ }
103
+ }
104
+ /** Partial-write: rewrite mcpServers section only, preserve everything else. */
105
+ async function writeShared(filePath, managed, enabledForAgent) {
106
+ const enabledIds = new Set(enabledForAgent.map((s) => s.id));
107
+ const allManagedIds = new Set(managed.map((s) => s.id));
108
+ let existing = {};
109
+ try {
110
+ const raw = await fs.readFile(filePath, "utf8");
111
+ existing = JSON.parse(raw);
112
+ }
113
+ catch {
114
+ // first write
115
+ }
116
+ const existingMcp = existing.mcpServers ?? {};
117
+ // Preserve user-added (ids Plexus does not manage) and drop ones we now disown.
118
+ const preserved = {};
119
+ for (const [k, v] of Object.entries(existingMcp)) {
120
+ if (allManagedIds.has(k))
121
+ continue; // either re-written below or removed
122
+ preserved[k] = v;
123
+ }
124
+ const written = { ...preserved };
125
+ for (const s of enabledForAgent) {
126
+ written[s.id] = serializeMcp(s);
127
+ }
128
+ void enabledIds;
129
+ const merged = { ...existing, mcpServers: written };
130
+ await fs.writeFile(filePath, JSON.stringify(merged, null, 2), "utf8");
131
+ }
132
+ /**
133
+ * Exclusive: Plexus owns the file. Render canonical to .cache/mcp/<agent>.json,
134
+ * symlink agent path to it. We still preserve user-added entries by reading
135
+ * the agent's current file first (resolving through the symlink).
136
+ */
137
+ async function writeExclusive(agentId, managed, enabledForAgent, syncStrategy) {
138
+ const caps = AGENT_PATHS[agentId];
139
+ await ensureDir(PLEXUS_PATHS.mcpCache);
140
+ const cacheFile = path.join(PLEXUS_PATHS.mcpCache, `${agentId}.json`);
141
+ const allManagedIds = new Set(managed.map((s) => s.id));
142
+ // Read current content (could be the agent's old regular file, or our
143
+ // existing cache via the symlink — either way, fs.readFile follows links).
144
+ let existing = {};
145
+ try {
146
+ const raw = await fs.readFile(caps.mcpPath, "utf8");
147
+ existing = JSON.parse(raw);
148
+ }
149
+ catch {
150
+ // first sync — fine
151
+ }
152
+ const existingMcp = existing.mcpServers ?? {};
153
+ const preserved = {};
154
+ for (const [k, v] of Object.entries(existingMcp)) {
155
+ if (allManagedIds.has(k))
156
+ continue;
157
+ preserved[k] = v;
158
+ }
159
+ const written = { ...preserved };
160
+ for (const s of enabledForAgent) {
161
+ written[s.id] = serializeMcp(s);
162
+ }
163
+ // For exclusive files we deliberately drop any non-mcpServers keys —
164
+ // by definition the file is dedicated to MCP config.
165
+ const canonical = { mcpServers: written };
166
+ await fs.writeFile(cacheFile, JSON.stringify(canonical, null, 2), "utf8");
167
+ // Now symlink the agent's path to the cache file. If the agent's file
168
+ // already points here, this is a no-op. Otherwise it's removed and
169
+ // replaced (caller has already snapshotted via the backup module).
170
+ await placeFileSymlink(cacheFile, caps.mcpPath, syncStrategy);
171
+ }
172
+ function serializeMcp(s) {
173
+ return {
174
+ ...(s.command ? { command: s.command } : {}),
175
+ ...(s.args ? { args: s.args } : {}),
176
+ ...(s.env ? { env: s.env } : {}),
177
+ ...(s.url ? { url: s.url } : {}),
178
+ ...(s.httpUrl ? { httpUrl: s.httpUrl } : {}),
179
+ ...(s.headers ? { headers: s.headers } : {}),
180
+ };
181
+ }
182
+ //# sourceMappingURL=json-mcp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-mcp.js","sourceRoot":"","sources":["../../../src/agents/adapters/json-mcp.ts"],"names":[],"mappings":"AAAA,OAA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= "full" | "instructions-only" | "manual";
2
+ export interface AgentCatalogEntry {
3
+ id: string;
4
+ displayName: string;
5
+ support: AgentCatalogSupport;
6
+ managed: boolean;
7
+ installed: boolean;
8
+ rootDir?: string;
9
+ instructionFile?: string;
10
+ mcpPath?: string;
11
+ skillsDir?: string;
12
+ note: string;
13
+ }
14
+ export declare function listAgentCatalog(): AgentCatalogEntry[];
15
+ //# sourceMappingURL=catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/agents/catalog.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,mBAAmB,GAAG,QAAQ,CAAC;AAE1E,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,mBAAmB,CAAC;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAsID,wBAAgB,gBAAgB,IAAI,iBAAiB,EAAE,CAsBtD"}
@@ -0,0 +1,153 @@
1
+ import fs from "node:fs";
2
+ import os from "node:os";
3
+ import path from "node:path";
4
+ import { AGENT_DISPLAY_NAMES, AGENT_PATHS, AGENT_ROOTS, ALL_AGENTS } from "../store/paths.js";
5
+ import { isAgentInstalled } from "./detect.js";
6
+ const home = os.homedir();
7
+ function exists(p) {
8
+ return p ? fs.existsSync(p) : false;
9
+ }
10
+ function vscodeUserDir() {
11
+ if (process.platform === "darwin") {
12
+ return path.join(home, "Library", "Application Support", "Code", "User");
13
+ }
14
+ if (process.platform === "win32") {
15
+ return path.join(process.env.APPDATA ?? home, "Code", "User");
16
+ }
17
+ return path.join(home, ".config", "Code", "User");
18
+ }
19
+ function globalStorageDir(extensionId) {
20
+ return path.join(vscodeUserDir(), "globalStorage", extensionId);
21
+ }
22
+ function zedUserDir() {
23
+ if (process.platform === "darwin") {
24
+ return path.join(home, "Library", "Application Support", "Zed");
25
+ }
26
+ return path.join(home, ".config", "zed");
27
+ }
28
+ const MANUAL_PRESETS = [
29
+ {
30
+ id: "windsurf",
31
+ displayName: "Windsurf Cascade",
32
+ support: "manual",
33
+ managed: false,
34
+ rootDir: path.join(home, ".codeium", "windsurf"),
35
+ mcpPath: path.join(home, ".codeium", "windsurf", "mcp_config.json"),
36
+ instructionFile: path.join(home, ".codeium", "windsurf", "AGENTS.md"),
37
+ note: "Catalog only for now. Windsurf uses its own Rules surface; add as custom if you want Plexus to track one instruction file.",
38
+ },
39
+ {
40
+ id: "kiro",
41
+ displayName: "Kiro",
42
+ support: "manual",
43
+ managed: false,
44
+ rootDir: path.join(home, ".kiro"),
45
+ mcpPath: path.join(home, ".kiro", "settings", "mcp.json"),
46
+ instructionFile: path.join(home, ".kiro", "steering", "plexus.md"),
47
+ note: "Catalog only for now. Kiro has user-level MCP and steering files, but Plexus does not write them yet.",
48
+ },
49
+ {
50
+ id: "vscode-copilot",
51
+ displayName: "VS Code / GitHub Copilot",
52
+ support: "manual",
53
+ managed: false,
54
+ rootDir: vscodeUserDir(),
55
+ mcpPath: path.join(vscodeUserDir(), "mcp.json"),
56
+ instructionFile: path.join(vscodeUserDir(), "AGENTS.md"),
57
+ note: "VS Code stores user MCP separately from repo instructions. Add as custom if you keep a user instruction file.",
58
+ },
59
+ {
60
+ id: "cline",
61
+ displayName: "Cline",
62
+ support: "manual",
63
+ managed: false,
64
+ rootDir: globalStorageDir("saoudrizwan.claude-dev"),
65
+ instructionFile: path.join(globalStorageDir("saoudrizwan.claude-dev"), "AGENTS.md"),
66
+ note: "VS Code extension storage varies by editor profile; use custom paths if yours differs.",
67
+ },
68
+ {
69
+ id: "roo-code",
70
+ displayName: "Roo Code",
71
+ support: "manual",
72
+ managed: false,
73
+ rootDir: globalStorageDir("rooveterinaryinc.roo-cline"),
74
+ instructionFile: path.join(globalStorageDir("rooveterinaryinc.roo-cline"), "AGENTS.md"),
75
+ note: "VS Code extension storage varies by editor profile; use custom paths if yours differs.",
76
+ },
77
+ {
78
+ id: "kilo-code",
79
+ displayName: "Kilo Code",
80
+ support: "manual",
81
+ managed: false,
82
+ rootDir: path.join(home, ".config", "kilo"),
83
+ mcpPath: path.join(home, ".config", "kilo", "kilo.jsonc"),
84
+ instructionFile: path.join(home, ".config", "kilo", "AGENTS.md"),
85
+ note: "Kilo uses JSONC and extension/project scopes; catalog entry is manual until Plexus can round-trip JSONC.",
86
+ },
87
+ {
88
+ id: "continue",
89
+ displayName: "Continue",
90
+ support: "manual",
91
+ managed: false,
92
+ rootDir: path.join(home, ".continue"),
93
+ instructionFile: path.join(home, ".continue", "AGENTS.md"),
94
+ note: "Continue configuration is flexible and often project-specific; add a custom instruction file if you use one.",
95
+ },
96
+ {
97
+ id: "aider",
98
+ displayName: "Aider",
99
+ support: "instructions-only",
100
+ managed: false,
101
+ instructionFile: path.join(home, ".aider.conf.yml"),
102
+ note: "Aider is config-file based. Plexus can track a file, but does not translate MCP or skills for Aider.",
103
+ },
104
+ {
105
+ id: "amp",
106
+ displayName: "Amp",
107
+ support: "manual",
108
+ managed: false,
109
+ rootDir: path.join(home, ".config", "amp"),
110
+ instructionFile: path.join(home, ".config", "amp", "AGENTS.md"),
111
+ note: "Amp supports agent instruction files, but local config layout can vary.",
112
+ },
113
+ {
114
+ id: "openhands",
115
+ displayName: "OpenHands",
116
+ support: "manual",
117
+ managed: false,
118
+ rootDir: path.join(home, ".openhands"),
119
+ instructionFile: path.join(home, ".openhands", "AGENTS.md"),
120
+ note: "OpenHands is usually project/container configured. Use custom paths for your local setup.",
121
+ },
122
+ {
123
+ id: "zed-ai",
124
+ displayName: "Zed AI",
125
+ support: "manual",
126
+ managed: false,
127
+ rootDir: zedUserDir(),
128
+ instructionFile: path.join(zedUserDir(), "AGENTS.md"),
129
+ note: "Catalog only. Zed and extension settings vary across platforms.",
130
+ },
131
+ ];
132
+ export function listAgentCatalog() {
133
+ const builtIn = ALL_AGENTS.map((id) => {
134
+ const caps = AGENT_PATHS[id];
135
+ return {
136
+ id,
137
+ displayName: AGENT_DISPLAY_NAMES[id],
138
+ support: "full",
139
+ managed: true,
140
+ installed: isAgentInstalled(id),
141
+ rootDir: AGENT_ROOTS[id],
142
+ mcpPath: caps.mcpPath,
143
+ skillsDir: caps.skillsDir,
144
+ note: "Built-in adapter. Plexus can sync Rules, MCP servers, and Skills.",
145
+ };
146
+ });
147
+ const manual = MANUAL_PRESETS.map((entry) => ({
148
+ ...entry,
149
+ installed: exists(entry.mcpPath) || exists(entry.instructionFile),
150
+ }));
151
+ return [...builtIn, ...manual];
152
+ }
153
+ //# sourceMappingURL=catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../src/agents/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAiB/C,MAAM,IAAI,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;AAE1B,SAAS,MAAM,CAAC,CAAU;IACxB,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AACtC,CAAC;AAED,SAAS,aAAa;IACpB,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAClC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,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entId } from "../types.js";
2
+ /**
3
+ * Detect which AI agents appear to be installed.
4
+ *
5
+ * Heuristic: any durable local signal exists:
6
+ * - native config root / MCP file / skill directory
7
+ * - known macOS app bundle for GUI-first agents
8
+ * - known CLI shim on PATH
9
+ *
10
+ * We never execute the agent binary; PATH checks only inspect file metadata.
11
+ */
12
+ export declare function detectAgents(): AgentDescriptor[];
13
+ export declare function isAgentInstalled(id: AgentId): boolean;
14
+ //# sourceMappingURL=detect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../src/agents/detect.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE5D;;;;;;;;;GASG;AACH,wBAAgB,YAAY,IAAI,eAAe,EAAE,CAQhD;AAqCD,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAOrD"}
@@ -0,0 +1,92 @@
1
+ import { constants, accessSync, existsSync, statSync } from "node:fs";
2
+ import os from "node:os";
3
+ import path from "node:path";
4
+ import { AGENT_DISPLAY_NAMES, AGENT_PATHS, AGENT_ROOTS, ALL_AGENTS } from "../store/paths.js";
5
+ /**
6
+ * Detect which AI agents appear to be installed.
7
+ *
8
+ * Heuristic: any durable local signal exists:
9
+ * - native config root / MCP file / skill directory
10
+ * - known macOS app bundle for GUI-first agents
11
+ * - known CLI shim on PATH
12
+ *
13
+ * We never execute the agent binary; PATH checks only inspect file metadata.
14
+ */
15
+ export function detectAgents() {
16
+ return ALL_AGENTS.map((id) => ({
17
+ id,
18
+ displayName: AGENT_DISPLAY_NAMES[id],
19
+ rootDir: AGENT_ROOTS[id],
20
+ installed: isAgentInstalled(id),
21
+ capabilities: AGENT_PATHS[id],
22
+ }));
23
+ }
24
+ const home = os.homedir();
25
+ const APP_PATH_HINTS = {
26
+ "claude-code": [],
27
+ cursor: process.platform === "darwin"
28
+ ? ["/Applications/Cursor.app", path.join(home, "Applications", "Cursor.app")]
29
+ : [],
30
+ codex: process.platform === "darwin"
31
+ ? ["/Applications/Codex.app", path.join(home, "Applications", "Codex.app")]
32
+ : [],
33
+ "gemini-cli": [],
34
+ "qwen-code": [],
35
+ "factory-droid": [],
36
+ };
37
+ const COMMAND_HINTS = {
38
+ "claude-code": ["claude"],
39
+ cursor: ["cursor"],
40
+ codex: ["codex"],
41
+ "gemini-cli": ["gemini"],
42
+ "qwen-code": ["qwen"],
43
+ "factory-droid": ["factory-droid", "droid"],
44
+ };
45
+ function metadataPathHints(id) {
46
+ const caps = AGENT_PATHS[id];
47
+ return [AGENT_ROOTS[id], caps.mcpPath, caps.skillsDir];
48
+ }
49
+ function useConfigOnlyDetection() {
50
+ return process.env.PLEXUS_DETECT_CONFIG_ONLY === "1";
51
+ }
52
+ export function isAgentInstalled(id) {
53
+ if (useConfigOnlyDetection()) {
54
+ return metadataPathHints(id).some((p) => existsSync(p));
55
+ }
56
+ if (APP_PATH_HINTS[id].some((p) => existsSync(p)))
57
+ return true;
58
+ return COMMAND_HINTS[id].some((cmd) => commandExistsOnPath(cmd));
59
+ }
60
+ function commandExistsOnPath(command) {
61
+ const pathValue = process.env.PATH;
62
+ if (!pathValue)
63
+ return false;
64
+ const extensions = process.platform === "win32" ? (process.env.PATHEXT ?? ".EXE;.CMD;.BAT;.COM").split(";") : [""];
65
+ for (const dir of pathValue.split(path.delimiter)) {
66
+ if (!dir)
67
+ continue;
68
+ for (const ext of extensions) {
69
+ const candidate = path.join(dir, `${command}${ext}`);
70
+ try {
71
+ const stat = statSync(candidate);
72
+ if (stat.isFile()) {
73
+ return process.platform === "win32" || canExecute(candidate);
74
+ }
75
+ }
76
+ catch {
77
+ // keep scanning PATH
78
+ }
79
+ }
80
+ }
81
+ return false;
82
+ }
83
+ function canExecute(candidate) {
84
+ try {
85
+ accessSync(candidate, constants.X_OK);
86
+ return true;
87
+ }
88
+ catch {
89
+ return false;
90
+ }
91
+ }
92
+ //# sourceMappingURL=detect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,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,qBAAqB,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAElG,KAAK,MAAM,GAAG,IAAI,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QAClD,IAAI,CAAC,GAAG;YAAE,SAAS;QACnB,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;YAC7B,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,GAAG,GAAG,EAAE,CAAC,CAAC;YACrD,IAAI,CAAC;gBACH,MAAM,IAAI,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;gBACjC,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;oBAClB,OAAO,OAAO,CAAC,QAAQ,KAAK,OAAO,IAAI,UAAU,CAAC,SAAS,CAAC,CAAC;gBAC/D,CAAC;YACH,CAAC;YAAC,MAAM,CAAC;gBACP,qBAAqB;YACvB,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,UAAU,CAAC,SAAiB;IACnC,IAAI,CAAC;QACH,UAAU,CAAC,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;QACtC,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from "./detect.js";
2
+ export * from "./catalog.js";
3
+ export * from "./adapters/index.js";
4
+ export * from "./inspect.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from "./detect.js";
2
+ export * from "./catalog.js";
3
+ export * from "./adapters/index.js";
4
+ export * from "./inspect.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC"}
@@ -0,0 +1,74 @@
1
+ import type { AgentId } from "../types.js";
2
+ /**
3
+ * "Agent inspector": everything the dashboard needs to render the
4
+ * /agents/<id> detail page in one read.
5
+ *
6
+ * Returns enough context for the UI to:
7
+ * - Show whether the MCP file is a Plexus symlink, a regular file, or
8
+ * missing entirely. If a symlink, where it points.
9
+ * - List the skill folders the agent currently exposes, with whether
10
+ * each one is symlinked or a real directory (i.e. "still owned by the
11
+ * agent" vs "managed by Plexus").
12
+ * - Surface "instruction" files Plexus does NOT yet manage but which
13
+ * users commonly hand-edit:
14
+ * Claude Code → ~/.claude/CLAUDE.md
15
+ * Cursor → ~/.cursor/AGENTS.md (and per-project .cursorrules)
16
+ * Codex → ~/.codex/AGENTS.md
17
+ * Gemini CLI → ~/.gemini/GEMINI.md
18
+ * Qwen Code → ~/.qwen/QWEN.md
19
+ * Factory Droid → ~/.factory/AGENTS.md (if user keeps one)
20
+ * These are simple read/write so the dashboard can offer a textarea.
21
+ */
22
+ export interface FileStatus {
23
+ path: string;
24
+ exists: boolean;
25
+ isSymlink: boolean;
26
+ /** If symlink, the resolved target path. */
27
+ linkTarget?: string;
28
+ /** Size in bytes (resolved through any symlink). */
29
+ size?: number;
30
+ /** Last modification time. */
31
+ mtime?: string;
32
+ }
33
+ export interface SkillEntry {
34
+ id: string;
35
+ /** Path in the agent's skills directory. */
36
+ path: string;
37
+ isSymlink: boolean;
38
+ linkTarget?: string;
39
+ /** Whether SKILL.md exists inside. */
40
+ hasSkillMd: boolean;
41
+ }
42
+ export interface InstructionFile {
43
+ /** Display label shown in the UI. */
44
+ label: string;
45
+ /** Convention (e.g. "CLAUDE.md", "AGENTS.md"). */
46
+ filename: string;
47
+ status: FileStatus;
48
+ }
49
+ export interface AgentInspection {
50
+ id: AgentId;
51
+ displayName: string;
52
+ rootDir: string;
53
+ installed: boolean;
54
+ mcpFile: FileStatus;
55
+ /** "exclusive" → Plexus owns the whole file; "shared" → partial-write. */
56
+ mcpFileMode: "exclusive" | "shared";
57
+ /** Agent skill directory (if any). */
58
+ skillsDir: FileStatus;
59
+ /** Per-skill folder entries. */
60
+ skills: SkillEntry[];
61
+ /** Instruction files the user might want to edit. */
62
+ instructionFiles: InstructionFile[];
63
+ }
64
+ export declare function instructionsForAgent(agentId: AgentId): Array<{
65
+ label: string;
66
+ filename: string;
67
+ abs: string;
68
+ }>;
69
+ export declare function inspectAgent(agentId: AgentId): Promise<AgentInspection>;
70
+ /** Read a file (small text; the UI only enables editing for instruction files & SKILL.md). */
71
+ export declare function readTextFile(absPath: string): Promise<string>;
72
+ /** Write a file, creating parent dir as needed. (Caller is responsible for backup if it cares.) */
73
+ export declare function writeTextFile(absPath: string, content: string): Promise<void>;
74
+ //# sourceMappingURL=inspect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../src/agents/inspect.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAG3C;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd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