diff --git a/packages/coding-agent/CHANGELOG.md b/packages/coding-agent/CHANGELOG.md index 25c809467..098f93210 100644 --- a/packages/coding-agent/CHANGELOG.md +++ b/packages/coding-agent/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Fixed + +- Fixed `omp plugin install` failing extension validation for pi extensions that import `compact` from `@earendil-works/pi-coding-agent` (e.g. pi-claude-bridge) — the legacy `@oh-my-pi/pi-coding-agent` shim did not forward `compact` (it lives in `@oh-my-pi/pi-agent-core/compaction`, the same module as the already-bridged `estimateTokens`), so a named import threw Bun's static "Export named 'compact' not found" error. Added the missing `compact` re-export ([#7174](https://github.com/can1357/oh-my-pi/issues/7174)). + ## [17.2.1] - 2026-07-30 ### Added diff --git a/packages/coding-agent/src/extensibility/legacy-pi-coding-agent-shim.ts b/packages/coding-agent/src/extensibility/legacy-pi-coding-agent-shim.ts index 6c7857963..db00bb11c 100644 --- a/packages/coding-agent/src/extensibility/legacy-pi-coding-agent-shim.ts +++ b/packages/coding-agent/src/extensibility/legacy-pi-coding-agent-shim.ts @@ -1416,11 +1416,11 @@ export function getPackageDir(): string { } // Legacy pi's `@earendil-works/pi-coding-agent` re-exported `estimateTokens` -// from its package root (via `./core/compaction/index.ts`). In omp it lives in -// `@oh-my-pi/pi-agent-core/compaction`, and the coding-agent barrel below does -// not forward it, so legacy extensions importing it fail Bun's static export -// check during validation (issue #6583). -export { estimateTokens } from "@oh-my-pi/pi-agent-core/compaction"; +// and `compact` from its package root (via `./core/compaction/index.ts`). In +// omp both live in `@oh-my-pi/pi-agent-core/compaction`, and the coding-agent +// barrel below does not forward them, so legacy extensions importing either +// fail Bun's static export check during validation (issues #6583, #7174). +export { compact, estimateTokens } from "@oh-my-pi/pi-agent-core/compaction"; // Same barrel gap for two more legacy package-root exports: pi re-exported the // `CONFIG_DIR_NAME` constant and the CLI parser `parseArgs`. In omp diff --git a/packages/coding-agent/test/extensibility/legacy-pi-compaction-helpers.test.ts b/packages/coding-agent/test/extensibility/legacy-pi-compaction-helpers.test.ts index 20fcf66a2..e46773c84 100644 --- a/packages/coding-agent/test/extensibility/legacy-pi-compaction-helpers.test.ts +++ b/packages/coding-agent/test/extensibility/legacy-pi-compaction-helpers.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "bun:test"; -import { estimateTokens } from "@oh-my-pi/pi-coding-agent/extensibility/legacy-pi-coding-agent-shim"; +import { compact, estimateTokens } from "@oh-my-pi/pi-coding-agent/extensibility/legacy-pi-coding-agent-shim"; // Issue #6583: pi extensions import `estimateTokens` from // `@earendil-works/pi-coding-agent`, which aliases to this shim. Legacy pi @@ -16,4 +16,12 @@ describe("legacy shim compaction helpers", () => { const tokens = estimateTokens({ role: "user", content: "hello world", timestamp: Date.now() }); expect(tokens).toBeGreaterThan(0); }); + + // Issue #7174: `compact` (same `@oh-my-pi/pi-agent-core/compaction` module as + // `estimateTokens`) was likewise absent from the shim surface, so + // `omp plugin install npm:pi-claude-bridge` failed with "Export named + // 'compact' not found". Pin the callable re-export. + it("re-exports compact as a callable function", () => { + expect(typeof compact).toBe("function"); + }); });