Skip to content

Commit b17df4e

Browse files
committed
Migrate Pi peer dep from @mariozechner/* to @earendil-works/* (Pi 0.74)
Pi 0.74.0 moved its npm packages and repository to a new home: @mariozechner/pi-coding-agent -> @earendil-works/pi-coding-agent @mariozechner/pi-tui -> @earendil-works/pi-tui github.com/badlogic/pi-mono -> github.com/earendil-works/pi-mono The RPC protocol (--mode rpc), ExtensionAPI, ContextEvent, ToolDefinition, and event shapes (agent_start, agent_end, message_end, etc.) are byte identical between 0.71.1 and 0.74.0; only the package scope changed. Verified locally against /Users/ufukaltinok/Work/OSS/pi at 0.74.0. Plugin: - packages/pi-plugin/package.json: peerDependencies + devDependencies + build externals bumped to @earendil-works/* ^0.74.0 - packages/pi-plugin/src/**: ~25 import sites updated - Comment references to @mariozechner/pi-ai and pi-agent-core also moved to @earendil-works/* (those subpackages migrated in the same release) CLI: - MIN_PI_VERSION raised from 0.71.0 to 0.74.0 in setup-pi and doctor-pi - Warning text now points users at `pi update --self` (0.73.1+ supports cross-scope self-update) or `npm install -g @earendil-works/pi-coding-agent@latest` - Test fixtures updated to 0.74.0 E2E harness: - pi-runner/spawn.ts: package.json resolution + Bun cache dir prefix (@earendil-works+pi-coding-agent@) updated for new scope Docs: - Root README, pi-plugin README, e2e README all point at the new repo - overflow-detection.ts comment URL updated Verification: bun install, typecheck, build, lint, full test suites all green (plugin 1394, pi 243, cli 63 — 1700 total).
1 parent 4e4e050 commit b17df4e

37 files changed

Lines changed: 102 additions & 110 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ npx @cortexkit/magic-context@latest doctor --issue
189189

190190
## Pi coding agent (beta)
191191

192-
Magic Context is also available as a [Pi](https://github.com/mariozechner/pi-mono) extension, sharing the **same SQLite database** as the OpenCode plugin. Project memories, embeddings, dreamer state, and key-file pins are pooled across both harnesses; per-session state (tags, compartments, facts, notes) stays harness-scoped.
192+
Magic Context is also available as a [Pi](https://github.com/earendil-works/pi-mono) extension, sharing the **same SQLite database** as the OpenCode plugin. Project memories, embeddings, dreamer state, and key-file pins are pooled across both harnesses; per-session state (tags, compartments, facts, notes) stays harness-scoped.
193193

194194
> ⚠️ The Pi extension is published as **beta** while it accumulates real-world usage. Core flows are validated with end-to-end tests; report issues at [github.com/cortexkit/magic-context/issues](https://github.com/cortexkit/magic-context/issues).
195195

bun.lock

Lines changed: 17 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cli/src/adapters/pi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export class PiAdapter implements HarnessAdapter {
118118
}
119119

120120
getInstallHint(): string {
121-
return "Install Pi: https://pi.coding/install (npm: @mariozechner/pi-coding-agent)";
121+
return "Install Pi: https://pi.coding/install (npm: @earendil-works/pi-coding-agent)";
122122
}
123123

124124
getPluginCacheInfo(): PluginCacheInfo {

packages/cli/src/commands/doctor-pi.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ function baseOptions(root: string, cwd: string, prompts: MockPrompts): RunDoctor
121121
path: join(root, ".pi", "bin", "pi"),
122122
source: "home",
123123
}),
124-
getPiVersion: () => "0.71.0",
124+
getPiVersion: () => "0.74.0",
125125
getLatestNpmVersion: () => "0.1.0",
126126
openDatabase: () => {
127127
currentDb = createMockDb();
@@ -165,7 +165,7 @@ describe("Pi doctor", () => {
165165

166166
expect(code).toBe(0);
167167
const output = prompts.messages.join("\n");
168-
expect(output).toContain("PASS Pi 0.71.0 detected");
168+
expect(output).toContain("PASS Pi 0.74.0 detected");
169169
expect(output).toContain("PASS npm:@cortexkit/pi-magic-context is registered");
170170
expect(output).toContain("PASS SQLite integrity_check: ok");
171171
expect(output).toContain("Summary: PASS");
@@ -264,7 +264,7 @@ describe("Pi doctor", () => {
264264
pluginVersion: "0.1.0",
265265
piInstalled: true,
266266
piPath: join(root, ".pi", "bin", "pi"),
267-
piVersion: "0.71.0",
267+
piVersion: "0.74.0",
268268
settings: {
269269
path: join(agentDir, "settings.json"),
270270
exists: true,

packages/cli/src/commands/doctor-pi.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,10 @@ import { type PromptIO, promptIO } from "../lib/prompts";
5050
import { writePiSettingsPackage } from "./setup-pi";
5151

5252
const PACKAGE_NAME = "@cortexkit/pi-magic-context";
53-
// Pi 0.71.0 introduced the `--extension` long-form flag (replacing `-x`).
54-
// Magic Context spawns subagents with `--extension <lean-entry>` to load
55-
// only the lean tool surface in subagents without recursive plugin loading,
56-
// so older Pi versions hard-fail with "Unknown option: -x". This is also
57-
// our peerDependency floor in package.json.
58-
const MIN_PI_VERSION = "0.71.0";
53+
// Pi 0.74.0 renamed the npm package scope from `@mariozechner/pi-coding-agent`
54+
// to `@earendil-works/pi-coding-agent`. Magic Context's peerDependency targets
55+
// the new scope, so older Pi installs cannot load this extension.
56+
const MIN_PI_VERSION = "0.74.0";
5957
const ROW_COUNT_TABLES = ["tags", "compartments", "memories", "notes", "dream_runs"];
6058

6159
type CheckStatus = "pass" | "warn" | "fail" | "info";
@@ -377,7 +375,7 @@ async function runHealthChecks(options: {
377375
add(
378376
results,
379377
"fail",
380-
`Pi ${version} is older than required ${MIN_PI_VERSION}. Subagents (historian/dreamer/sidekick) use the long-form \`--extension\` flag introduced in Pi 0.71.0; older versions hard-fail with "Unknown option". Run \`pi update\` (or \`npm install -g @mariozechner/pi-coding-agent@latest\`).`,
378+
`Pi ${version} is older than required ${MIN_PI_VERSION}. Subagents (historian/dreamer/sidekick) use the long-form \`--extension\` flag introduced in Pi 0.71.0; older versions hard-fail with "Unknown option". Run \`pi update\` (or \`npm install -g @earendil-works/pi-coding-agent@latest\`).`,
381379
);
382380
} else if (version) {
383381
add(results, "pass", `Pi version meets minimum ${MIN_PI_VERSION} requirement`);

packages/cli/src/commands/setup-pi.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ describe("runSetup", () => {
128128

129129
const env: SetupEnvironment = {
130130
detectPiBinary: () => ({ path: join(root, "bin", "pi"), source: "path" }),
131-
getPiVersion: () => "0.71.0",
131+
getPiVersion: () => "0.74.0",
132132
getAvailableModels: () => [
133133
"anthropic/claude-haiku-4-5",
134134
"anthropic/claude-sonnet-4-6",
@@ -183,7 +183,7 @@ describe("runSetup", () => {
183183

184184
const env: SetupEnvironment = {
185185
detectPiBinary: () => ({ path: join(root, "bin", "pi"), source: "path" }),
186-
getPiVersion: () => "0.71.0",
186+
getPiVersion: () => "0.74.0",
187187
// Only github-copilot model so buildModelSelection always picks it first
188188
getAvailableModels: () => ["github-copilot/gpt-5.4"],
189189
paths: {
@@ -229,7 +229,7 @@ describe("runSetup", () => {
229229
expect(prompts.messages.join("\n")).toContain("Pi not found");
230230
});
231231

232-
it("warns and exits when Pi version is below 0.71.0 and user declines", async () => {
232+
it("warns and exits when Pi version is below 0.74.0 and user declines", async () => {
233233
const root = makeTempRoot();
234234
const agentDir = join(root, ".pi", "agent");
235235
const env: SetupEnvironment = {
@@ -249,13 +249,13 @@ describe("runSetup", () => {
249249

250250
expect(code).toBe(0);
251251
const log = prompts.messages.join("\n");
252-
expect(log).toContain("Pi 0.69.0 is older than the required 0.71.0");
252+
expect(log).toContain("Pi 0.69.0 is older than the required 0.74.0");
253253
expect(log).toContain("outro:Setup cancelled");
254254
expect(existsSync(join(agentDir, "magic-context.jsonc"))).toBe(false);
255255
expect(existsSync(join(agentDir, "settings.json"))).toBe(false);
256256
});
257257

258-
it("continues setup when Pi version is below 0.71.0 and user opts in", async () => {
258+
it("continues setup when Pi version is below 0.74.0 and user opts in", async () => {
259259
const root = makeTempRoot();
260260
const agentDir = join(root, ".pi", "agent");
261261
const env: SetupEnvironment = {
@@ -277,7 +277,7 @@ describe("runSetup", () => {
277277
expect(code).toBe(0);
278278
expect(existsSync(join(agentDir, "magic-context.jsonc"))).toBe(true);
279279
expect(prompts.messages.join("\n")).toContain(
280-
"Pi 0.69.0 is older than the required 0.71.0",
280+
"Pi 0.69.0 is older than the required 0.74.0",
281281
);
282282
});
283283
});

packages/cli/src/commands/setup-pi.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -231,18 +231,17 @@ export async function runSetup(options: RunSetupOptions = {}): Promise<number> {
231231
const version = env.getPiVersion(pi.path);
232232
spinner.stop(version ? `Pi ${version} detected at ${pi.path}` : `Pi detected at ${pi.path}`);
233233

234-
// Pi 0.71.0 introduced the long-form `--extension` flag we use to load
235-
// the lean subagent extension. Older Pi versions hard-fail with
236-
// "Unknown option: -x" when subagents try to spawn, so warn loudly
237-
// before the user wastes time on a setup that won't run subagents.
238-
const MIN_PI_VERSION = "0.71.0";
234+
// Pi 0.74.0 moved to the `@earendil-works/pi-coding-agent` package scope.
235+
// Magic Context's peerDependency targets that scope, so older Pi versions
236+
// (on `@mariozechner/pi-coding-agent`) cannot load this extension.
237+
const MIN_PI_VERSION = "0.74.0";
239238
if (version && comparePiVersion(version, MIN_PI_VERSION) < 0) {
240239
prompts.log.warn(
241240
`Pi ${version} is older than the required ${MIN_PI_VERSION}.\n` +
242-
`Magic Context spawns subagents with \`--extension <path>\` (long form), ` +
243-
`which Pi 0.71.0 introduced. Older Pi versions hard-fail with ` +
244-
`"Unknown option" when historian/dreamer/sidekick tries to run.\n` +
245-
`Run \`pi update\` (or \`npm install -g @mariozechner/pi-coding-agent@latest\`) before continuing.`,
241+
`Pi 0.74.0 renamed the npm package from \`@mariozechner/pi-coding-agent\` ` +
242+
`to \`@earendil-works/pi-coding-agent\`. Magic Context's peer dependency ` +
243+
`targets the new scope, so older Pi installs cannot load this extension.\n` +
244+
`Run \`pi update --self\` (or \`npm install -g @earendil-works/pi-coding-agent@latest\`) before continuing.`,
246245
);
247246
const proceed = await prompts.confirm(
248247
"Continue with setup anyway? (subagents will fail at runtime)",

packages/e2e-tests/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ state directly: `getState()`, `getMessages()`, `getSessionStats()`,
5555
`compactNow()`, and `newSession()`.
5656

5757
RPC mode is available in the installed Pi peer range. The current peer is
58-
`@mariozechner/pi-coding-agent@^0.71.0`; the lockfile resolves `0.71.1`, whose
58+
`@earendil-works/pi-coding-agent@^0.71.0`; the lockfile resolves `0.71.1`, whose
5959
packaged docs specify the JSONL RPC protocol, and the changelog shows the
6060
current JSON protocol was introduced in `0.16.0`.
6161

packages/e2e-tests/src/pi-runner/spawn.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ function compareSemver(a: string, b: string): number {
2121

2222
function resolvePiPackageJson(): string {
2323
try {
24-
return require_.resolve("@mariozechner/pi-coding-agent/package.json");
24+
return require_.resolve("@earendil-works/pi-coding-agent/package.json");
2525
} catch {
2626
const bunModules = join(REPO_ROOT, "node_modules/.bun");
27-
const prefix = "@mariozechner+pi-coding-agent@";
27+
const prefix = "@earendil-works+pi-coding-agent@";
2828
const candidates = readdirSync(bunModules, { withFileTypes: true })
2929
.filter((entry) => entry.isDirectory() && entry.name.startsWith(prefix))
3030
.map((entry) => {
@@ -34,12 +34,12 @@ function resolvePiPackageJson(): string {
3434
.sort((a, b) => compareSemver(b.version, a.version));
3535
const best = candidates[0];
3636
if (best === undefined) {
37-
throw new Error(`Could not locate @mariozechner/pi-coding-agent under ${bunModules}`);
37+
throw new Error(`Could not locate @earendil-works/pi-coding-agent under ${bunModules}`);
3838
}
3939
return join(
4040
bunModules,
4141
best.name,
42-
"node_modules/@mariozechner/pi-coding-agent/package.json",
42+
"node_modules/@earendil-works/pi-coding-agent/package.json",
4343
);
4444
}
4545
}

0 commit comments

Comments
 (0)