layermap 0.1.55 → 0.1.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -17,7 +17,7 @@
17
17
  <p align="center"><sub>A real Claude Code session on <a href="https://github.com/miniflux/v2">Miniflux</a>, replayed: one map call finds every endpoint, then the agent confirms them in source.</sub></p>
18
18
 
19
19
  A layered map of your codebase for coding agents. LayerMap gives Claude Code, Codex, CodeBuddy
20
- Code, Pi, DeepSeek Harness and other MCP clients read-only tools that answer, in one call, what an agent otherwise works out
20
+ Code, Pi, DeepSeek Harness, Antigravity and other MCP clients read-only tools that answer, in one call, what an agent otherwise works out
21
21
  with dozens of searches:
22
22
 
23
23
  - **What calls this, and what does changing it affect?** Callers traced up to 8 levels, to the
@@ -150,6 +150,18 @@ npx layermap setup dsh
150
150
  This adds LayerMap to every dsh profile. Each session maps the project dsh was started in, and
151
151
  `npx layermap remove dsh` undoes it.
152
152
 
153
+ **Antigravity**
154
+
155
+ ```
156
+ npx layermap setup antigravity
157
+ ```
158
+
159
+ Antigravity has no command that installs a plugin, so this writes LayerMap's plugin into
160
+ `~/.gemini/config/plugins/layermap`, which Antigravity loads by itself; `npx layermap remove
161
+ antigravity` deletes it. Antigravity asks before each map tool's first use; choose to always allow
162
+ it. It starts the server outside the project, so the plugin's rule tells the agent to give absolute
163
+ paths.
164
+
153
165
  In every agent, start a new session in a Git repository and ask as usual. LayerMap tells the agent
154
166
  when the map helps. A session started in a folder holding several repositories, or one that moves
155
167
  to another repository, works too: each map tool call maps the repository its path names. The first
@@ -180,7 +192,7 @@ CodeBuddy Code the plugin asks the agent once, before it finishes, to run this c
180
192
  and has not checked since, whether through its edit tools or shell commands, which count for the code files they name
181
193
  (changes another session makes in the same work tree do not count); the Pi extension does the same after the agent's own
182
194
  edits. Set `LAYERMAP_STOP_CHECK=0` to turn that
183
- off. Codex and DeepSeek Harness are told to run it.
195
+ off. Codex, DeepSeek Harness and Antigravity are told to run it.
184
196
 
185
197
  **Without plugins:** run `npx layermap setup claude` or `npx layermap setup codex`. Setup does three
186
198
  things:
package/dist/cli.mjs CHANGED
@@ -27002,6 +27002,7 @@ var mapToolDescriptions = (host) => {
27002
27002
 
27003
27003
  // src/agent/notes.ts
27004
27004
  var AGENT_MAP_NOTE = "The layermap MCP server is available here. When a task needs to know what calls a function, what a change could affect beyond the code you are editing, or where code is used, use its project_explore_map tool (direction INCOMING, depth up to 8) instead of grep, then confirm in source; a change confined to code you have read does not need it. When the edits are done, call its project_check_changes tool once before reporting the work done.";
27005
+ var antigravityMapNote = (server) => `${AGENT_MAP_NOTE} In Antigravity, call its tools through call_mcp_tool with ServerName ${server}. The server does not start in the project, so give every call an absolute path, and give project_check_changes the project's root as its path.`;
27005
27006
  var projectHeading = (project) => `Project ${project} (paths are relative to it)`;
27006
27007
 
27007
27008
  // src/agent/projects.ts
@@ -27434,6 +27435,9 @@ import { existsSync as existsSync8 } from "node:fs";
27434
27435
  import { mkdir as mkdir4, readFile as readFile7, rename as rename4, rm as rm3, writeFile as writeFile3 } from "node:fs/promises";
27435
27436
  import { homedir as homedir3 } from "node:os";
27436
27437
  import path19 from "node:path";
27438
+ var SETUP_AGENTS = ["claude", "codex", "dsh", "antigravity"];
27439
+ var REPOSITORY = "https://github.com/coffeecoproject/layermap";
27440
+ var PLUGIN_DESCRIPTION = "A layered map of your codebase for coding agents: what calls a function, what a change affects up to the HTTP routes, handlers and jobs, and what each module contains, for TypeScript, JavaScript, Go, Python and Java. Built and kept locally; read-only.";
27437
27441
  var SERVER = "layermap";
27438
27442
  var SETUP_RULE = `mcp__${SERVER}`;
27439
27443
  var PLUGIN_RULE = `mcp__plugin_${SERVER}_${SERVER}`;
@@ -27599,8 +27603,34 @@ async function removeDshPatch(file2) {
27599
27603
  await writeFile3(file2, content ? rest : `${rest}${rest.endsWith("\n") ? "" : "\n"}[]
27600
27604
  `);
27601
27605
  }
27606
+ var antigravityPlugin = (env = process.env) => path19.join(env.HOME || homedir3(), ".gemini", "config", "plugins", SERVER);
27607
+ var antigravityPluginFiles = (command, version2, note = true) => {
27608
+ const [program = "", ...args] = command;
27609
+ const json2 = (value) => `${JSON.stringify(value, null, 2)}
27610
+ `;
27611
+ return {
27612
+ "plugin.json": json2({
27613
+ name: SERVER,
27614
+ displayName: "LayerMap",
27615
+ version: version2,
27616
+ description: PLUGIN_DESCRIPTION,
27617
+ homepage: REPOSITORY,
27618
+ repository: REPOSITORY
27619
+ }),
27620
+ "mcp_config.json": json2({ mcpServers: { [SERVER]: { command: program, args } } }),
27621
+ ...note ? { [path19.join("rules", "AGENTS.md")]: `${antigravityMapNote(`${SERVER}_${SERVER}`)}
27622
+ ` } : {}
27623
+ };
27624
+ };
27602
27625
  var agentFiles = (options) => {
27603
27626
  const env = options.env ?? process.env;
27627
+ if (options.agent === "antigravity") {
27628
+ const plugin = antigravityPlugin(env);
27629
+ return {
27630
+ settings: path19.join(plugin, "mcp_config.json"),
27631
+ instructions: path19.join(plugin, "rules", "AGENTS.md")
27632
+ };
27633
+ }
27604
27634
  if (options.agent === "dsh") {
27605
27635
  const home = env.DSH_HOME || path19.join(homedir3(), ".dsh");
27606
27636
  return {
@@ -27654,6 +27684,28 @@ async function setupAgent(options) {
27654
27684
  await rename4(`${file2}.${process.pid}`, file2);
27655
27685
  };
27656
27686
  if (published) log2(`write the launcher of LayerMap ${options.version} to ${launcherFile(env)}`);
27687
+ if (options.agent === "antigravity") {
27688
+ if (options.scope !== "user") {
27689
+ log2("Antigravity loads LayerMap's plugin in every project; --scope does not apply.");
27690
+ return false;
27691
+ }
27692
+ const plugin = antigravityPlugin(env);
27693
+ log2(`write LayerMap's plugin for Antigravity to ${plugin}`);
27694
+ if (note) log2(`with a rule naming the map tools, ${instructions}`);
27695
+ if (options.dryRun) return true;
27696
+ await writeLauncher();
27697
+ await rm3(plugin, { recursive: true, force: true });
27698
+ for (const [name, content] of Object.entries(
27699
+ antigravityPluginFiles(command, options.version, note)
27700
+ )) {
27701
+ await mkdir4(path19.dirname(path19.join(plugin, name)), { recursive: true });
27702
+ await writeFile3(path19.join(plugin, name), content);
27703
+ }
27704
+ log2(
27705
+ `Done. Start a new Antigravity conversation; its map tools come from the ${SERVER}_${SERVER} server, and Antigravity asks before each one's first use.`
27706
+ );
27707
+ return true;
27708
+ }
27657
27709
  if (options.agent === "dsh") {
27658
27710
  if (options.scope !== "user") {
27659
27711
  log2("DeepSeek Harness is set up for all its profiles at once; --scope does not apply.");
@@ -27704,7 +27756,11 @@ async function setupAgent(options) {
27704
27756
  async function allowAgent(options) {
27705
27757
  if (options.agent !== "claude") {
27706
27758
  options.log(
27707
- options.agent === "codex" ? "The Codex plugin already runs LayerMap's read-only tools without a prompt." : "DeepSeek Harness runs MCP tools without a prompt."
27759
+ {
27760
+ codex: "The Codex plugin already runs LayerMap's read-only tools without a prompt.",
27761
+ dsh: "DeepSeek Harness runs MCP tools without a prompt.",
27762
+ antigravity: "Antigravity asks before each map tool's first use; choose to always allow it there."
27763
+ }[options.agent]
27708
27764
  );
27709
27765
  return true;
27710
27766
  }
@@ -27718,6 +27774,14 @@ async function allowAgent(options) {
27718
27774
  async function removeAgent(options) {
27719
27775
  const env = options.env ?? process.env;
27720
27776
  const { settings, instructions } = agentFiles(options);
27777
+ if (options.agent === "antigravity") {
27778
+ const plugin = antigravityPlugin(env);
27779
+ options.log(`remove LayerMap's plugin for Antigravity, ${plugin}`);
27780
+ if (options.dryRun) return true;
27781
+ await rm3(plugin, { recursive: true, force: true });
27782
+ options.log("Removed.");
27783
+ return true;
27784
+ }
27721
27785
  if (options.agent === "dsh") {
27722
27786
  options.log(
27723
27787
  `remove the ${SERVER} MCP server from ${settings} and its note from ${instructions}`
@@ -27743,10 +27807,10 @@ async function removeAgent(options) {
27743
27807
  var USAGE = `LayerMap \u2014 a layered map of a codebase for coding agents.
27744
27808
 
27745
27809
  Usage:
27746
- layermap setup claude|codex|dsh [--scope user|local] [--no-instructions] [--dry-run]
27810
+ layermap setup ${SETUP_AGENTS.join("|")} [--scope user|local] [--no-instructions] [--dry-run]
27747
27811
  layermap allow claude [--scope user|project|local] [--dry-run]
27748
27812
  let the plugin's read-only tools run without a prompt
27749
- layermap remove claude|codex|dsh [--scope user|project|local] [--dry-run]
27813
+ layermap remove ${SETUP_AGENTS.join("|")} [--scope user|project|local] [--dry-run]
27750
27814
  layermap setup command [--dry-run] put a layermap command in ~/.local/bin, for shells with no
27751
27815
  plugin's on their PATH (Codex's commands, a terminal): it
27752
27816
  runs the newest version the agents' plugins have installed
@@ -27841,7 +27905,7 @@ async function main(argv) {
27841
27905
  dryRun: values["dry-run"],
27842
27906
  log
27843
27907
  }) ? 0 : 1;
27844
- if (agent !== "claude" && agent !== "codex" && agent !== "dsh") return usage(1);
27908
+ if (!SETUP_AGENTS.includes(agent)) return usage(1);
27845
27909
  if (!["user", "project", "local"].includes(values.scope)) return usage(1);
27846
27910
  const done = await { setup: setupAgent, allow: allowAgent, remove: removeAgent }[command]({
27847
27911
  agent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "layermap",
3
- "version": "0.1.55",
3
+ "version": "0.1.56",
4
4
  "mcpName": "io.github.coffeecoproject/layermap",
5
5
  "description": "A layered map of a codebase for coding agents: directories, modules and call chains across TypeScript, JavaScript, Go, Python and Java.",
6
6
  "license": "Apache-2.0",
package/pi/layermap.mjs CHANGED
@@ -293,7 +293,7 @@ function layermap(pi) {
293
293
  if (server && !server.dead) return server;
294
294
  starting ??= (async () => {
295
295
  const next = new MapServer(cwd);
296
- const tools = await next.start("0.1.55");
296
+ const tools = await next.start("0.1.56");
297
297
  for (const tool of tools) {
298
298
  if (registered.has(tool.name)) continue;
299
299
  registered.add(tool.name);