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.
- package/extensions/canary.ts +5 -2
- package/package.json +1 -1
package/extensions/canary.ts
CHANGED
|
@@ -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
|
|
29
|
-
return { ...defaults, ...JSON.parse((
|
|
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.
|
|
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",
|