pi-canary 1.0.3 → 1.1.0

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.
@@ -92,6 +92,12 @@ export default function (pi: ExtensionAPI) {
92
92
  let verifyResponseTimestamp: number | null = null;
93
93
 
94
94
  pi.on("before_agent_start", (_event, _ctx) => {
95
+ // COUNT=0 disables the canary check entirely
96
+ if (cfg.COUNT === 0) {
97
+ phase = "idle";
98
+ currentTokens = null;
99
+ return;
100
+ }
95
101
  if (cfg.VARIANT === "fixed") {
96
102
  if (!fixedTokens || fixedTokens.length !== cfg.COUNT) {
97
103
  fixedTokens = Array.from({ length: cfg.COUNT }, generateToken);
@@ -273,7 +279,7 @@ export default function (pi: ExtensionAPI) {
273
279
  if (eq > 0 && val !== "") {
274
280
  if (key === "COUNT") {
275
281
  const n = parseInt(val, 10);
276
- if (n > 0) { cfg.COUNT = n; fixedTokens = null; results.push(`COUNT=${cfg.COUNT}`); }
282
+ if (n >= 0) { cfg.COUNT = n; fixedTokens = null; results.push(`COUNT=${cfg.COUNT}`); }
277
283
  else results.push(`invalid COUNT: ${val}`);
278
284
  } else if (key === "POSITION") {
279
285
  if (val === "start" || val === "equidistant" || val === "end") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-canary",
3
- "version": "1.0.3",
3
+ "version": "1.1.0",
4
4
  "description": "Pi extension: silently verifies agent context awareness every turn using hidden canary tokens. KV-cache friendly.",
5
5
  "keywords": ["pi-package", "pi", "pi-coding-agent", "extension", "context-awareness", "canary", "safety", "verification", "local-llm"],
6
6
  "license": "MIT",