Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/__tests__/plugin.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
import { describe, expect, it } from "bun:test"
import { readFileSync } from "node:fs"
import { join } from "node:path"
import plugin from "../index.js"
import type { RequestContext } from "../types.js"

const packageVersion = JSON.parse(readFileSync(join(import.meta.dir, "..", "..", "package.json"), "utf8")).version

describe("pi-scrub onRequest", () => {
it("reports the shipped package version", () => {
expect(plugin.version).toBe(packageVersion)
})

it("preserves a foreign adapter's context object and prompt bytes", () => {
const ctx: RequestContext = {
adapter: "opencode",
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/

import type { Transform, RequestContext } from "./types.js"
import packageMetadata from "../package.json" with { type: "json" }
import { scrubPiFingerprints } from "./scrub.js"

// Re-export so consumers can import types without needing @rynfar/meridian
Expand All @@ -22,7 +23,7 @@ export type { Transform, RequestContext } from "./types.js"

const plugin: Transform = {
name: "pi-scrub",
version: "0.2.0",
version: packageMetadata.version,
description: "Strip pi-identifying fingerprints from the system prompt before it reaches Claude (all adapters; content-scoped)",
// No `adapters` restriction — undefined means all adapters. The scrub is a
// content-based no-op when no targeted block is present.
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"lib": [
"ES2022"
Expand Down
Loading