codecartographer-pi 0.1.1 → 0.1.2

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
@@ -44,14 +44,18 @@ That's it. The LLM reads the guide, checks `workflow/status.yaml` for progress,
44
44
 
45
45
  This branch also packages CodeCartographer for [Pi](https://github.com/badlogic/pi-mono/tree/main/packages/coding-agent) without changing `.codecarto/` itself. Pi is an **optional peer dependency** — if you only want the template or the MCP server, you don't need Pi installed.
46
46
 
47
- Install from a local checkout or git URL:
47
+ Install from npm, a local checkout, or a git URL:
48
48
 
49
49
  ```bash
50
+ pi install npm:codecartographer-pi
51
+ # or, from a local checkout:
50
52
  pi install /absolute/path/to/CodeCartographer
51
- # or
53
+ # or, from a git URL:
52
54
  pi install git:github.com/your-user/CodeCartographer
53
55
  ```
54
56
 
57
+ > **Don't run `npm install codecartographer-pi` for the Pi use case.** Plain `npm install` puts the package on disk but doesn't register it with Pi, so it never appears in the TUI. Use `pi install npm:codecartographer-pi` instead — Pi handles the npm install internally and writes the package into its own `settings.json` (`~/.pi/agent/settings.json` by default). Plain `npm install` is the right command only for the MCP-server use case described below.
58
+
55
59
  For extension development, you can also point Pi directly at the extension entrypoint or place it in an auto-discovered extensions directory and use `/reload`:
56
60
 
57
61
  ```bash
@@ -84,6 +88,8 @@ What the Pi extension adds:
84
88
 
85
89
  The same framework is also packaged as a [Model Context Protocol](https://modelcontextprotocol.io) server, so any MCP-compatible host (Claude Code, Claude Desktop, etc.) can drive a CodeCartographer workflow without the Pi runtime. The server imports the same `core/` primitives the Pi extension uses, so phase prompts and validation are byte-identical across both surfaces.
86
90
 
91
+ Implements MCP spec revision [`2025-11-25`](https://modelcontextprotocol.io/specification/2025-11-25) via `@modelcontextprotocol/sdk` ≥ 1.29.0. The negotiated `protocolVersion` reflects whatever the connecting client requests; the server accepts every revision the SDK supports (currently `2025-11-25`, `2025-06-18`, `2025-03-26`, `2024-11-05`, `2024-10-07`).
92
+
87
93
  Install and wire it up:
88
94
 
89
95
  ```bash
@@ -2,14 +2,31 @@
2
2
  // (so the MCP server and Pi can both copy from it on /codecarto-init), loads
3
3
  // + normalizes the per-project workspace state from disk, and provides the
4
4
  // atomic status-update primitive used by /codecarto-complete.
5
+ import { existsSync } from "node:fs";
5
6
  import { appendFile, rename, writeFile } from "node:fs/promises";
6
- import { dirname, join, relative, resolve } from "node:path";
7
+ import { dirname, join, relative } from "node:path";
7
8
  import { fileURLToPath } from "node:url";
8
9
  import { acquireLock, normalizeStatus } from "./status.js";
9
10
  import { pathExists } from "./utils.js";
10
11
  import { loadYamlFile, stringifySimpleYaml } from "./yaml.js";
12
+ // Walk up from the current file to find the package root. Needed because the
13
+ // source lives at <root>/core/workspace.ts (one level below the package root)
14
+ // but compiles to <root>/dist/core/workspace.js (two levels below). A fixed
15
+ // `..` only works in one of those layouts, so resolve `package.json` instead.
16
+ function findPackageRoot(start) {
17
+ let dir = start;
18
+ while (true) {
19
+ if (existsSync(join(dir, "package.json")))
20
+ return dir;
21
+ const parent = dirname(dir);
22
+ if (parent === dir) {
23
+ throw new Error(`Could not locate package.json starting from ${start}`);
24
+ }
25
+ dir = parent;
26
+ }
27
+ }
11
28
  const coreDir = dirname(fileURLToPath(import.meta.url));
12
- const packageRoot = resolve(coreDir, "..");
29
+ const packageRoot = findPackageRoot(coreDir);
13
30
  // Path to the packaged framework template directory. Wrappers copy this on
14
31
  // /codecarto-init.
15
32
  export const packagedWorkspaceDir = join(packageRoot, ".codecarto");
@@ -1,2 +1,2 @@
1
- import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
1
+ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
2
2
  export default function codeCartographerExtension(pi: ExtensionAPI): void;
@@ -367,7 +367,7 @@ const HANDLERS = {
367
367
  };
368
368
  // ---------- server bootstrap ----------
369
369
  export function buildServer() {
370
- const server = new Server({ name: "codecartographer", version: "0.1.1" }, { capabilities: { tools: {} } });
370
+ const server = new Server({ name: "codecartographer", version: "0.1.2" }, { capabilities: { tools: {} } });
371
371
  server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
372
372
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
373
373
  const handler = HANDLERS[request.params.name];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codecartographer-pi",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "CodeCartographer packaged for Pi as an extension-driven workflow wrapper.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -39,10 +39,10 @@
39
39
  "smoke": "node scripts/smoke-mcp.mjs"
40
40
  },
41
41
  "dependencies": {
42
- "@modelcontextprotocol/sdk": "*"
42
+ "@modelcontextprotocol/sdk": "^1.29.0"
43
43
  },
44
44
  "peerDependencies": {
45
- "@mariozechner/pi-coding-agent": "*",
45
+ "@earendil-works/pi-coding-agent": "^0.74.0",
46
46
  "@sinclair/typebox": "*"
47
47
  },
48
48
  "pi": {