nomoreide 0.1.68 → 0.1.69

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 (46) hide show
  1. package/dist/core/agent-env/antigravity-reader.d.ts +7 -0
  2. package/dist/core/agent-env/antigravity-reader.js +86 -0
  3. package/dist/core/agent-env/antigravity-reader.js.map +1 -0
  4. package/dist/core/agent-env/availability.d.ts +6 -0
  5. package/dist/core/agent-env/availability.js +79 -0
  6. package/dist/core/agent-env/availability.js.map +1 -0
  7. package/dist/core/agent-env/claude-reader.d.ts +7 -0
  8. package/dist/core/agent-env/claude-reader.js +93 -0
  9. package/dist/core/agent-env/claude-reader.js.map +1 -0
  10. package/dist/core/agent-env/codex-reader.d.ts +9 -0
  11. package/dist/core/agent-env/codex-reader.js +145 -0
  12. package/dist/core/agent-env/codex-reader.js.map +1 -0
  13. package/dist/core/agent-env/index.d.ts +9 -0
  14. package/dist/core/agent-env/index.js +29 -0
  15. package/dist/core/agent-env/index.js.map +1 -0
  16. package/dist/core/agent-env/managed-plugins.d.ts +13 -0
  17. package/dist/core/agent-env/managed-plugins.js +36 -0
  18. package/dist/core/agent-env/managed-plugins.js.map +1 -0
  19. package/dist/core/agent-env/plugin-reader.d.ts +9 -0
  20. package/dist/core/agent-env/plugin-reader.js +174 -0
  21. package/dist/core/agent-env/plugin-reader.js.map +1 -0
  22. package/dist/core/agent-env/shared.d.ts +25 -0
  23. package/dist/core/agent-env/shared.js +115 -0
  24. package/dist/core/agent-env/shared.js.map +1 -0
  25. package/dist/core/agent-env/types.d.ts +66 -0
  26. package/dist/core/agent-env/types.js +7 -0
  27. package/dist/core/agent-env/types.js.map +1 -0
  28. package/dist/mcp/tools/agent-env.d.ts +8 -0
  29. package/dist/mcp/tools/agent-env.js +40 -0
  30. package/dist/mcp/tools/agent-env.js.map +1 -0
  31. package/dist/mcp/tools/index.d.ts +1 -1
  32. package/dist/mcp/tools/index.js +3 -0
  33. package/dist/mcp/tools/index.js.map +1 -1
  34. package/dist/web/client/assets/{code-editor-woFvM3aJ.js → code-editor-B4fwOZmz.js} +1 -1
  35. package/dist/web/client/assets/{index-B4hwsHPU.js → index-Bv9X1Rmi.js} +110 -110
  36. package/dist/web/client/assets/index-CNvFKnAK.css +1 -0
  37. package/dist/web/client/index.html +2 -2
  38. package/dist/web/routes/agent-env-routes.d.ts +7 -0
  39. package/dist/web/routes/agent-env-routes.js +36 -0
  40. package/dist/web/routes/agent-env-routes.js.map +1 -0
  41. package/dist/web/routes/index.js +2 -0
  42. package/dist/web/routes/index.js.map +1 -1
  43. package/dist/web/routes/shell-routes.js +1 -0
  44. package/dist/web/routes/shell-routes.js.map +1 -1
  45. package/package.json +1 -1
  46. package/dist/web/client/assets/index-CeyRPbeV.css +0 -1
@@ -0,0 +1,174 @@
1
+ import { readFile, readdir, stat } from "node:fs/promises";
2
+ import path from "node:path";
3
+ /** Marketplace plugins from Claude's `~/.claude/plugins/installed_plugins.json`. */
4
+ export async function readInstalledPlugins(installedPluginsPath) {
5
+ const source = await readFile(installedPluginsPath, "utf8");
6
+ const data = JSON.parse(source);
7
+ const results = [];
8
+ for (const [key, records] of Object.entries(data.plugins ?? {})) {
9
+ const [name, pluginSource] = key.split("@");
10
+ const installPath = records[0]?.installPath;
11
+ const pluginSkills = installPath ? await readPluginSkills(installPath) : [];
12
+ const pluginMcps = installPath ? await readPluginMcpKeys(installPath) : [];
13
+ const pluginAgents = installPath ? await readPluginAgentNames(installPath) : [];
14
+ const pluginCommands = installPath ? await readPluginCommandNames(installPath) : [];
15
+ results.push({
16
+ name,
17
+ source: pluginSource,
18
+ kind: "plugin",
19
+ scope: "user",
20
+ installPath,
21
+ pluginSkills,
22
+ ...(pluginMcps.length > 0 ? { pluginMcps } : {}),
23
+ ...(pluginAgents.length > 0 ? { pluginAgents } : {}),
24
+ ...(pluginCommands.length > 0 ? { pluginCommands } : {}),
25
+ });
26
+ }
27
+ return results;
28
+ }
29
+ /** Enabled Codex plugins declared in config.toml and materialized in the plugins cache. */
30
+ export async function readCodexPlugins(options) {
31
+ let tomlSource;
32
+ try {
33
+ tomlSource = await readFile(options.configTomlPath, "utf8");
34
+ }
35
+ catch {
36
+ return [];
37
+ }
38
+ const entries = [];
39
+ for (const { name, marketplace, enabled } of parseCodexPluginDeclarations(tomlSource)) {
40
+ if (!enabled)
41
+ continue;
42
+ const installPath = await resolveCodexPluginInstallPath({
43
+ pluginsCacheDir: options.pluginsCacheDir,
44
+ marketplace,
45
+ name,
46
+ });
47
+ if (!installPath)
48
+ continue;
49
+ const pluginSkills = await readPluginSkills(installPath);
50
+ const pluginMcps = await readPluginMcpKeys(installPath);
51
+ const pluginAgents = await readPluginAgentNames(installPath);
52
+ const pluginCommands = await readPluginCommandNames(installPath);
53
+ entries.push({
54
+ name,
55
+ source: marketplace,
56
+ kind: "plugin",
57
+ scope: "user",
58
+ installPath,
59
+ pluginSkills,
60
+ ...(pluginMcps.length > 0 ? { pluginMcps } : {}),
61
+ ...(pluginAgents.length > 0 ? { pluginAgents } : {}),
62
+ ...(pluginCommands.length > 0 ? { pluginCommands } : {}),
63
+ });
64
+ }
65
+ return entries.sort((left, right) => left.name.localeCompare(right.name));
66
+ }
67
+ function parseCodexPluginDeclarations(source) {
68
+ const results = [];
69
+ const lines = source.split("\n");
70
+ let current = null;
71
+ const flush = () => {
72
+ if (current) {
73
+ results.push(current);
74
+ current = null;
75
+ }
76
+ };
77
+ for (const line of lines) {
78
+ const trimmed = line.trim();
79
+ const sectionMatch = trimmed.match(/^\[plugins\."([^"@]+)@([^"]+)"\]$/);
80
+ if (sectionMatch) {
81
+ flush();
82
+ current = { name: sectionMatch[1], marketplace: sectionMatch[2], enabled: false };
83
+ continue;
84
+ }
85
+ if (/^\[/.test(trimmed)) {
86
+ flush();
87
+ continue;
88
+ }
89
+ if (!current)
90
+ continue;
91
+ const kv = trimmed.match(/^(\w+)\s*=\s*(.+)$/);
92
+ if (kv && kv[1] === "enabled") {
93
+ current.enabled = kv[2].trim() === "true";
94
+ }
95
+ }
96
+ flush();
97
+ return results;
98
+ }
99
+ async function resolveCodexPluginInstallPath(options) {
100
+ const pluginRoot = path.join(options.pluginsCacheDir, options.marketplace, options.name);
101
+ let versionDirs;
102
+ try {
103
+ const entries = await readdir(pluginRoot, { withFileTypes: true });
104
+ versionDirs = entries.filter((entry) => entry.isDirectory()).map((entry) => entry.name);
105
+ }
106
+ catch {
107
+ return null;
108
+ }
109
+ if (versionDirs.length === 0)
110
+ return null;
111
+ if (versionDirs.length === 1)
112
+ return path.join(pluginRoot, versionDirs[0]);
113
+ const stats = await Promise.all(versionDirs.map(async (dir) => {
114
+ try {
115
+ const info = await stat(path.join(pluginRoot, dir));
116
+ return { dir, mtime: info.mtimeMs };
117
+ }
118
+ catch {
119
+ return { dir, mtime: 0 };
120
+ }
121
+ }));
122
+ stats.sort((left, right) => right.mtime - left.mtime);
123
+ return path.join(pluginRoot, stats[0].dir);
124
+ }
125
+ async function readPluginSkills(installPath) {
126
+ try {
127
+ const entries = await readdir(path.join(installPath, "skills"), { withFileTypes: true });
128
+ return entries
129
+ .filter((entry) => !entry.name.startsWith(".") && entry.isDirectory())
130
+ .map((entry) => entry.name)
131
+ .sort((left, right) => left.localeCompare(right));
132
+ }
133
+ catch {
134
+ return [];
135
+ }
136
+ }
137
+ async function readPluginAgentNames(installPath) {
138
+ try {
139
+ const entries = await readdir(path.join(installPath, "agents"), { withFileTypes: true });
140
+ return entries
141
+ .filter((entry) => entry.isFile() && (entry.name.endsWith(".md") || entry.name.endsWith(".toml")))
142
+ .map((entry) => entry.name.replace(/\.(md|toml)$/, ""))
143
+ .sort((left, right) => left.localeCompare(right));
144
+ }
145
+ catch {
146
+ return [];
147
+ }
148
+ }
149
+ async function readPluginCommandNames(installPath) {
150
+ try {
151
+ const entries = await readdir(path.join(installPath, "commands"), { withFileTypes: true });
152
+ return entries
153
+ .filter((entry) => entry.isFile() && entry.name.endsWith(".md"))
154
+ .map((entry) => entry.name.replace(/\.md$/, ""))
155
+ .sort((left, right) => left.localeCompare(right));
156
+ }
157
+ catch {
158
+ return [];
159
+ }
160
+ }
161
+ export async function readPluginMcpKeys(installPath) {
162
+ try {
163
+ const source = await readFile(path.join(installPath, ".mcp.json"), "utf8");
164
+ const parsed = JSON.parse(source);
165
+ const servers = parsed.mcpServers && typeof parsed.mcpServers === "object" && !Array.isArray(parsed.mcpServers)
166
+ ? parsed.mcpServers
167
+ : parsed;
168
+ return Object.keys(servers).sort((left, right) => left.localeCompare(right));
169
+ }
170
+ catch {
171
+ return [];
172
+ }
173
+ }
174
+ //# sourceMappingURL=plugin-reader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-reader.js","sourceRoot":"","sources":["../../../src/core/agent-env/plugin-reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,IAAI,MAAM,WAAW,CAAC;AAW7B,oFAAoF;AACpF,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,oBAA4B;IAE5B,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;IAC5D,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAyB,CAAC;IACxD,MAAM,OAAO,GAAsB,EAAE,CAAC;IAEtC,KAAK,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,CAAC;QAChE,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC5C,MAAM,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC;QAC5C,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,CAAC,MAAM,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC,CA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YAChD,CAAC,CAAC,MAAM,CAAC;QACb,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/E,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { AgentMcpEntry, AgentSkillEntry, RemoteMcpEntry } from "./types.js";
2
+ export declare function parseEnvObject(value: unknown): Record<string, string> | undefined;
3
+ /** Read skill directories (Claude, Codex, and Antigravity share the SKILL.md dir convention). */
4
+ export declare function readSkillDirs(skillsDir: string, scope?: "user" | "project"): Promise<AgentSkillEntry[]>;
5
+ /**
6
+ * Walk from `cwd` up to the repo root (first ancestor containing `.git`, or
7
+ * the filesystem root) and emit skills declared in `<ancestor>/.claude/skills/`
8
+ * with `scope: "project"`. Only Claude reads project-scoped skills; the closer
9
+ * ancestor wins on name collisions.
10
+ */
11
+ export declare function readProjectSkills(cwd: string): Promise<AgentSkillEntry[]>;
12
+ export interface McpMaps {
13
+ mcpServers: Record<string, AgentMcpEntry>;
14
+ remoteMcpServers: Record<string, RemoteMcpEntry>;
15
+ projectMcpServers: Record<string, AgentMcpEntry>;
16
+ projectRemoteMcpServers: Record<string, RemoteMcpEntry>;
17
+ }
18
+ /** Drop MCP servers that a plugin owns — the plugin card already lists them. */
19
+ export declare function filterPluginOwnedMcps(maps: McpMaps, skills: AgentSkillEntry[]): McpMaps;
20
+ /**
21
+ * Project-scoped MCPs recorded by brainctl at `<cwd>/.brainctl/project-mcps.json`
22
+ * for agents without native per-project config (Codex, Antigravity). Read for
23
+ * compatibility so brainctl users see their full setup after migrating.
24
+ */
25
+ export declare function readBrainctlProjectMcps(cwd: string, agent: "codex" | "antigravity"): Promise<Pick<McpMaps, "projectMcpServers" | "projectRemoteMcpServers">>;
@@ -0,0 +1,115 @@
1
+ import { readFile, readdir, stat } from "node:fs/promises";
2
+ import path from "node:path";
3
+ export function parseEnvObject(value) {
4
+ if (!value || typeof value !== "object" || Array.isArray(value))
5
+ return undefined;
6
+ const result = {};
7
+ for (const [key, entry] of Object.entries(value)) {
8
+ result[key] = String(entry);
9
+ }
10
+ return Object.keys(result).length > 0 ? result : undefined;
11
+ }
12
+ /** Read skill directories (Claude, Codex, and Antigravity share the SKILL.md dir convention). */
13
+ export async function readSkillDirs(skillsDir, scope = "user") {
14
+ const entries = await readdir(skillsDir, { withFileTypes: true });
15
+ const skills = [];
16
+ for (const entry of entries) {
17
+ if (entry.name.startsWith("."))
18
+ continue;
19
+ const installPath = path.join(skillsDir, entry.name);
20
+ if (entry.isDirectory()) {
21
+ skills.push({ name: entry.name, source: "local", kind: "skill", scope, installPath });
22
+ }
23
+ else if (entry.isSymbolicLink()) {
24
+ skills.push({ name: entry.name, source: "linked", kind: "skill", scope, installPath });
25
+ }
26
+ }
27
+ return skills;
28
+ }
29
+ /**
30
+ * Walk from `cwd` up to the repo root (first ancestor containing `.git`, or
31
+ * the filesystem root) and emit skills declared in `<ancestor>/.claude/skills/`
32
+ * with `scope: "project"`. Only Claude reads project-scoped skills; the closer
33
+ * ancestor wins on name collisions.
34
+ */
35
+ export async function readProjectSkills(cwd) {
36
+ const seen = new Map();
37
+ let current = path.resolve(cwd);
38
+ const visited = new Set();
39
+ while (!visited.has(current)) {
40
+ visited.add(current);
41
+ const skillsDir = path.join(current, ".claude", "skills");
42
+ try {
43
+ const entries = await readSkillDirs(skillsDir, "project");
44
+ for (const entry of entries) {
45
+ if (!seen.has(entry.name))
46
+ seen.set(entry.name, entry);
47
+ }
48
+ }
49
+ catch {
50
+ // no skills dir at this level
51
+ }
52
+ try {
53
+ await stat(path.join(current, ".git"));
54
+ break;
55
+ }
56
+ catch {
57
+ // not a repo root; continue up
58
+ }
59
+ const parent = path.dirname(current);
60
+ if (parent === current)
61
+ break;
62
+ current = parent;
63
+ }
64
+ return Array.from(seen.values());
65
+ }
66
+ /** Drop MCP servers that a plugin owns — the plugin card already lists them. */
67
+ export function filterPluginOwnedMcps(maps, skills) {
68
+ const pluginOwned = new Set(skills.flatMap((skill) => skill.pluginMcps ?? []));
69
+ if (pluginOwned.size === 0)
70
+ return maps;
71
+ const notOwned = ([key]) => !pluginOwned.has(key);
72
+ return {
73
+ mcpServers: Object.fromEntries(Object.entries(maps.mcpServers).filter(notOwned)),
74
+ remoteMcpServers: Object.fromEntries(Object.entries(maps.remoteMcpServers).filter(notOwned)),
75
+ projectMcpServers: Object.fromEntries(Object.entries(maps.projectMcpServers).filter(notOwned)),
76
+ projectRemoteMcpServers: Object.fromEntries(Object.entries(maps.projectRemoteMcpServers).filter(notOwned)),
77
+ };
78
+ }
79
+ /**
80
+ * Project-scoped MCPs recorded by brainctl at `<cwd>/.brainctl/project-mcps.json`
81
+ * for agents without native per-project config (Codex, Antigravity). Read for
82
+ * compatibility so brainctl users see their full setup after migrating.
83
+ */
84
+ export async function readBrainctlProjectMcps(cwd, agent) {
85
+ try {
86
+ const filePath = path.join(cwd, ".brainctl", "project-mcps.json");
87
+ const data = JSON.parse(await readFile(filePath, "utf8"));
88
+ const agentData = (data[agent] ?? {});
89
+ const rawServers = (agentData.mcpServers ?? {});
90
+ const projectMcpServers = {};
91
+ const projectRemoteMcpServers = {};
92
+ for (const [name, entry] of Object.entries(rawServers)) {
93
+ if (typeof entry.url === "string" && entry.url) {
94
+ projectRemoteMcpServers[name] = {
95
+ transport: entry.transport ?? "http",
96
+ url: entry.url,
97
+ headers: parseEnvObject(entry.headers),
98
+ env: parseEnvObject(entry.env),
99
+ };
100
+ }
101
+ else {
102
+ projectMcpServers[name] = {
103
+ command: String(entry.command ?? ""),
104
+ args: Array.isArray(entry.args) ? entry.args.map(String) : undefined,
105
+ env: parseEnvObject(entry.env),
106
+ };
107
+ }
108
+ }
109
+ return { projectMcpServers, projectRemoteMcpServers };
110
+ }
111
+ catch {
112
+ return { projectMcpServers: {}, projectRemoteMcpServers: {} };
113
+ }
114
+ }
115
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/core/agent-env/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,IAAI,MAAM,WAAW,CAAC;AAO7B,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAClF,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAgC,CAAC,EAAE,CAAC;QAC5E,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AAC7D,CAAC;AAED,iGAAiG;AACjG,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,SAAiB,EACjB,QAA4B,MAAM;IAElC,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,SAAS,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IAClE,MAAM,MAAM,GAAsB,EAAE,CAAC;IAErC,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,SAAS;QACzC,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QACrD,IAAI,K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,CAAC;oBACpC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS;oBACpE,GAAG,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC;iBAC/B,CAAC;YACJ,CAAC;QACH,CAAC;QACD,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,CAAC;IACxD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,iBAAiB,EAAE,EAAE,EAAE,uBAAuB,EAAE,EAAE,EAAE,CAAC;IAChE,CAAC;AACH,CAAC"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Agent Environments — read-only view of coding agents' live configuration
3
+ * (MCP servers + skills) across Claude Code, Codex CLI, and Antigravity.
4
+ * Ported from brainctl's sync/agent-reader layer (see ROR-59/ROR-60).
5
+ */
6
+ export type AgentName = "claude" | "codex" | "antigravity";
7
+ export declare const AGENT_NAMES: AgentName[];
8
+ export interface AgentMcpEntry {
9
+ command: string;
10
+ args?: string[];
11
+ env?: Record<string, string>;
12
+ }
13
+ export interface RemoteMcpEntry {
14
+ transport: "http" | "sse";
15
+ url: string;
16
+ headers?: Record<string, string>;
17
+ env?: Record<string, string>;
18
+ }
19
+ export interface AgentSkillEntry {
20
+ name: string;
21
+ /** e.g. "claude-plugins-official", "local", "linked", or a marketplace id. */
22
+ source?: string;
23
+ kind?: "skill" | "plugin";
24
+ /**
25
+ * Where this skill lives:
26
+ * - "user" — `~/.<agent>/skills/` or a user-installed plugin
27
+ * - "project" — `<repo>/.claude/skills/` (Claude only)
28
+ */
29
+ scope: "user" | "project";
30
+ pluginSkills?: string[];
31
+ pluginMcps?: string[];
32
+ pluginAgents?: string[];
33
+ pluginCommands?: string[];
34
+ installPath?: string;
35
+ managed?: boolean;
36
+ }
37
+ export interface AgentLiveConfig {
38
+ agent: AgentName;
39
+ configPath: string;
40
+ exists: boolean;
41
+ mcpServers: Record<string, AgentMcpEntry>;
42
+ remoteMcpServers: Record<string, RemoteMcpEntry>;
43
+ projectMcpServers: Record<string, AgentMcpEntry>;
44
+ projectRemoteMcpServers: Record<string, RemoteMcpEntry>;
45
+ skills: AgentSkillEntry[];
46
+ }
47
+ export interface AgentAvailability {
48
+ agent: AgentName;
49
+ available: boolean;
50
+ command: string;
51
+ resolvedPath?: string;
52
+ }
53
+ export interface AgentDoctorCheck {
54
+ label: string;
55
+ status: "ok" | "warn";
56
+ message: string;
57
+ }
58
+ export interface AgentDoctorResult {
59
+ checks: AgentDoctorCheck[];
60
+ hasIssues: boolean;
61
+ }
62
+ /** Options shared by every reader; `homeDir` is injectable for tests. */
63
+ export interface AgentEnvReadOptions {
64
+ cwd: string;
65
+ homeDir?: string;
66
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Agent Environments — read-only view of coding agents' live configuration
3
+ * (MCP servers + skills) across Claude Code, Codex CLI, and Antigravity.
4
+ * Ported from brainctl's sync/agent-reader layer (see ROR-59/ROR-60).
5
+ */
6
+ export const AGENT_NAMES = ["claude", "codex", "antigravity"];
7
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/agent-env/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,CAAC,MAAM,WAAW,GAAgB,CAAC,QAAQ,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { FastMCP } from "fastmcp";
2
+ import { type ToolContext } from "./context.js";
3
+ export declare const AGENT_ENV_TOOL_NAMES: readonly ["nomoreide_agents_status", "nomoreide_agents_read_configs", "nomoreide_agents_doctor"];
4
+ /**
5
+ * Read-only (ROR-60). Mutating agent configs is Phase 2 (ROR-61) and will live
6
+ * behind the write-guarded agent-env-actions module.
7
+ */
8
+ export declare function registerAgentEnvTools(server: FastMCP, _ctx: ToolContext): void;
@@ -0,0 +1,40 @@
1
+ import { z } from "zod";
2
+ import { getAgentAvailability, readAllAgentConfigs, runAgentDoctor, } from "../../core/agent-env/index.js";
3
+ import { stringify } from "./context.js";
4
+ export const AGENT_ENV_TOOL_NAMES = [
5
+ "nomoreide_agents_status",
6
+ "nomoreide_agents_read_configs",
7
+ "nomoreide_agents_doctor",
8
+ ];
9
+ const agentEnvCwdSchema = z.object({
10
+ cwd: z
11
+ .string()
12
+ .min(1)
13
+ .optional()
14
+ .describe("Project directory used to resolve project-scoped MCPs and skills."),
15
+ });
16
+ /**
17
+ * Read-only (ROR-60). Mutating agent configs is Phase 2 (ROR-61) and will live
18
+ * behind the write-guarded agent-env-actions module.
19
+ */
20
+ export function registerAgentEnvTools(server, _ctx) {
21
+ server.addTool({
22
+ name: "nomoreide_agents_status",
23
+ description: "Check which coding agent CLIs (Claude Code, Codex, Antigravity) are installed and on PATH.",
24
+ parameters: z.object({}),
25
+ execute: async () => stringify(await getAgentAvailability()),
26
+ });
27
+ server.addTool({
28
+ name: "nomoreide_agents_read_configs",
29
+ description: "Read the live MCP servers and skills configured for each coding agent (Claude Code, Codex, Antigravity). Read-only.",
30
+ parameters: agentEnvCwdSchema,
31
+ execute: async ({ cwd }) => stringify(await readAllAgentConfigs({ cwd: cwd ?? process.cwd() })),
32
+ });
33
+ server.addTool({
34
+ name: "nomoreide_agents_doctor",
35
+ description: "Diagnose coding agent setup: CLI availability and config file presence per agent.",
36
+ parameters: agentEnvCwdSchema,
37
+ execute: async ({ cwd }) => stringify(await runAgentDoctor({ cwd: cwd ?? process.cwd() })),
38
+ });
39
+ }
40
+ //# sourceMappingURL=agent-env.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-env.js","sourceRoot":"","sources":["../../../src/mcp/tools/agent-env.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,G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AC;KACjE,CAAC,CAAC;AACL,CAAC"}
@@ -10,7 +10,7 @@ import { type ToolContext } from "./context.js";
10
10
  * a new domain module and register it below. This aggregator never grows a
11
11
  * per-tool branch.
12
12
  */
13
- export declare const NOMOREIDE_TOOL_NAMES: readonly ["nomoreide_list_services", "nomoreide_register_service", "nomoreide_start_service", "nomoreide_stop_service", "nomoreide_restart_service", "nomoreide_read_logs", "nomoreide_register_bundle", "nomoreide_start_bundle", "nomoreide_stop_bundle", "nomoreide_status", "nomoreide_service_context", "nomoreide_service_health", "nomoreide_timeline", "nomoreide_onboard_repo", "nomoreide_git_status", "nomoreide_git_branches", "nomoreide_git_switch_branch", "nomoreide_git_create_branch", "nomoreide_git_fetch", "nomoreide_git_diff", "nomoreide_git_staged_diff", "nomoreide_git_log", "nomoreide_git_stage", "nomoreide_git_unstage", "nomoreide_git_commit", "nomoreide_git_push", "nomoreide_git_clone", "nomoreide_git_register_repository", "nomoreide_git_select_repository", "nomoreide_snapshots_list", "nomoreide_snapshot_create", "nomoreide_github_set_token", "nomoreide_github_list_prs", "nomoreide_github_get_pr", "nomoreide_github_get_pr_diff", "nomoreide_github_create_pr", "nomoreide_github_merge_pr", "nomoreide_github_list_issues", "nomoreide_github_get_issue", "nomoreide_github_list_issue_comments", "nomoreide_github_add_issue_comment", "nomoreide_github_create_issue", "nomoreide_github_get_commit_ci", "nomoreide_github_list_workflow_runs", "nomoreide_list_errors", "nomoreide_error_prompt", "nomoreide_list_databases", "nomoreide_db_tables", "nomoreide_db_sample", "nomoreide_db_query", "nomoreide_docs", "nomoreide_open_ui", "nomoreide_close_ui"];
13
+ export declare const NOMOREIDE_TOOL_NAMES: readonly ["nomoreide_list_services", "nomoreide_register_service", "nomoreide_start_service", "nomoreide_stop_service", "nomoreide_restart_service", "nomoreide_read_logs", "nomoreide_register_bundle", "nomoreide_start_bundle", "nomoreide_stop_bundle", "nomoreide_status", "nomoreide_service_context", "nomoreide_service_health", "nomoreide_timeline", "nomoreide_onboard_repo", "nomoreide_git_status", "nomoreide_git_branches", "nomoreide_git_switch_branch", "nomoreide_git_create_branch", "nomoreide_git_fetch", "nomoreide_git_diff", "nomoreide_git_staged_diff", "nomoreide_git_log", "nomoreide_git_stage", "nomoreide_git_unstage", "nomoreide_git_commit", "nomoreide_git_push", "nomoreide_git_clone", "nomoreide_git_register_repository", "nomoreide_git_select_repository", "nomoreide_snapshots_list", "nomoreide_snapshot_create", "nomoreide_github_set_token", "nomoreide_github_list_prs", "nomoreide_github_get_pr", "nomoreide_github_get_pr_diff", "nomoreide_github_create_pr", "nomoreide_github_merge_pr", "nomoreide_github_list_issues", "nomoreide_github_get_issue", "nomoreide_github_list_issue_comments", "nomoreide_github_add_issue_comment", "nomoreide_github_create_issue", "nomoreide_github_get_commit_ci", "nomoreide_github_list_workflow_runs", "nomoreide_list_errors", "nomoreide_error_prompt", "nomoreide_list_databases", "nomoreide_db_tables", "nomoreide_db_sample", "nomoreide_db_query", "nomoreide_docs", "nomoreide_open_ui", "nomoreide_close_ui", "nomoreide_agents_status", "nomoreide_agents_read_configs", "nomoreide_agents_doctor"];
14
14
  interface RegisterNoMoreIdeToolsOptions extends ToolContext {
15
15
  server: FastMCP;
16
16
  toolCallStore?: ToolCallStore;
@@ -1,5 +1,6 @@
1
1
  import { wrapServerForRecording } from "./context.js";
2
2
  import { AGENT_TOOL_NAMES, registerAgentTools } from "./agent.js";
3
+ import { AGENT_ENV_TOOL_NAMES, registerAgentEnvTools } from "./agent-env.js";
3
4
  import { DATABASE_TOOL_NAMES, registerDatabaseTools } from "./database.js";
4
5
  import { DOC_TOOL_NAMES, registerDocTools } from "./docs.js";
5
6
  import { ERROR_TOOL_NAMES, registerErrorTools } from "./errors.js";
@@ -26,6 +27,7 @@ export const NOMOREIDE_TOOL_NAMES = [
26
27
  ...DATABASE_TOOL_NAMES,
27
28
  ...DOC_TOOL_NAMES,
28
29
  ...AGENT_TOOL_NAMES,
30
+ ...AGENT_ENV_TOOL_NAMES,
29
31
  ];
30
32
  export function registerNoMoreIdeTools(options) {
31
33
  const { server: rawServer, toolCallStore, agentSessions, ...ctx } = options;
@@ -41,5 +43,6 @@ export function registerNoMoreIdeTools(options) {
41
43
  registerDatabaseTools(server, ctx);
42
44
  registerDocTools(server, ctx);
43
45
  registerAgentTools(server, ctx);
46
+ registerAgentEnvTools(server, ctx);
44
47
  }
45
48
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/mcp/tools/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAoB,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE5E;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,GAAG,kBAAkB;IACrB,GAAG,kBAAkB;IACrB,GAAG,cAAc;IACjB,GAAG,mBAAmB;IACtB,GAAG,iBAAiB;IACpB,GAAG,gBAAgB;IACnB,GAAG,mBAAmB;IACtB,GAAG,cAAc;IACjB,GAAG,gBAAgB;CACX,CAAC;AAQX,MAAM,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