pi-canary 1.0.2 → 1.0.3

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.
@@ -15,6 +15,9 @@
15
15
  */
16
16
 
17
17
  import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
18
+ import { readFileSync } from "node:fs";
19
+ import { dirname, join } from "node:path";
20
+ import { fileURLToPath } from "node:url";
18
21
 
19
22
  // Loaded from sibling JSON at startup; /set overrides for the current session only
20
23
  const cfg = (() => {
@@ -25,8 +28,8 @@ const cfg = (() => {
25
28
  FAIL_COMPACT: 0,
26
29
  };
27
30
  try {
28
- const url = new URL("canary.json", import.meta.url);
29
- return { ...defaults, ...JSON.parse((globalThis as any).Deno.readTextFileSync(url)) };
31
+ const extDir = dirname(fileURLToPath(import.meta.url));
32
+ return { ...defaults, ...JSON.parse(readFileSync(join(extDir, "canary.json"), "utf-8")) };
30
33
  } catch {
31
34
  return defaults;
32
35
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-canary",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
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",