protect-context 1.3.0 → 1.3.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
@@ -629,6 +629,7 @@ instead of leaving stale numbers in this README.
629
629
  | MCP tool missing in host | Server not started with the venv interpreter | Point `command` at `.venv/bin/python` and pass `-m protect_context.mcp_server` |
630
630
  | Extension does not load | Node older than 22.19 or pi not restarted | Check `pi list`, then restart; use `pi -ne` to start without extensions |
631
631
  | Contract edit rejected over MCP | Removing a frozen seed constraint | Seeds are protected; use the CLI or a pi slash command as the owner |
632
+ | Published, but `pi.dev/packages` says "No packages match" | The gallery index is built from npm search, and npm drops search documents whose `downloads.monthly` is `0`. A publish rewrites that document with the download figure of that moment, so publishing before npm's first download rollup pins it at `0` | Run `scripts/check-discoverability.sh`; if the document's downloads are `0` while the downloads API reports traffic, publish once the rollup exists (npm re-crawls documents on its own as well, typically within a week) |
632
633
 
633
634
  ## Limitations and security boundary
634
635
 
@@ -17,7 +17,6 @@
17
17
  import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
18
18
  import { isToolCallEventType } from "@earendil-works/pi-coding-agent";
19
19
  import { Type } from "typebox";
20
- import { StringEnum } from "@earendil-works/pi-ai";
21
20
  import { isAbsolute, relative } from "node:path";
22
21
 
23
22
  import { DEFAULT_CONFIG, type GuardConfig } from "./lib/defaults.ts";
@@ -48,6 +47,7 @@ import {
48
47
  import {
49
48
  appendJournal,
50
49
  isJournalType,
50
+ type JournalType,
51
51
  readJournal,
52
52
  recentCorrections,
53
53
  recentDecisions,
@@ -1025,7 +1025,14 @@ export default function (pi: ExtensionAPI) {
1025
1025
  "Use guard_note to record durable decisions; when corrected, log a tagged correction with type=correction.",
1026
1026
  ],
1027
1027
  parameters: Type.Object({
1028
- type: StringEnum(["decision", "correction", "risk", "note"] as const),
1028
+ // Enum as a plain string schema: providers that reject anyOf/const still
1029
+ // get `{type:"string", enum:[...]}`, and the generic keeps params.type
1030
+ // narrowed to JournalType (pi-ai's StringEnum is a pi-schema type, which
1031
+ // typebox's Object inference degrades to `unknown`).
1032
+ type: Type.Unsafe<JournalType>({
1033
+ type: "string",
1034
+ enum: ["decision", "correction", "risk", "note"],
1035
+ }),
1029
1036
  text: Type.String({ description: "What happened / what was decided" }),
1030
1037
  tags: Type.Optional(Type.Array(Type.String({ description: "Optional tags" }))),
1031
1038
  }),
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "protect-context",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "Pi extension that adds agent guardrails: context brief, verification evidence, loop blocking, diff-scope warnings, and a durable journal.",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
+ "author": "xjtlumedia <xjtlumedia@gmail.com> (https://github.com/XJTLUmedia)",
7
8
  "keywords": [
8
9
  "pi-package",
9
10
  "pi-extension",