@pi-claudian/auto-save-to-markdown 0.3.1 → 0.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 +4 -0
- package/README.zh.md +3 -0
- package/debug.ts +8 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -165,6 +165,10 @@ always contains the complete conversation, not the compacted context.
|
|
|
165
165
|
PI_CLAUDIAN_DEBUG=1 pi
|
|
166
166
|
```
|
|
167
167
|
|
|
168
|
+
Any value other than an explicit false token (empty, `0`, `false`, `no`, `off` —
|
|
169
|
+
case-insensitive) enables it; unset the variable (or set one of those tokens)
|
|
170
|
+
to turn it off.
|
|
171
|
+
|
|
168
172
|
## License
|
|
169
173
|
|
|
170
174
|
MIT
|
package/README.zh.md
CHANGED
package/debug.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared debug logging for all @pi-claudian extensions.
|
|
3
3
|
*
|
|
4
|
-
* Enable by setting the PI_CLAUDIAN_DEBUG environment variable to any
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Enable by setting the PI_CLAUDIAN_DEBUG environment variable to any value
|
|
5
|
+
* other than an explicit false token (empty, "0", "false", "no", "off" —
|
|
6
|
+
* case-insensitive). Output goes to stderr via console.error, so it never
|
|
7
|
+
* mixes with pi's stdout and can be captured separately:
|
|
7
8
|
*
|
|
8
9
|
* PI_CLAUDIAN_DEBUG=1 pi # show inline
|
|
9
10
|
* PI_CLAUDIAN_DEBUG=1 pi 2>debug.log # capture to a file
|
|
@@ -15,9 +16,11 @@
|
|
|
15
16
|
*/
|
|
16
17
|
|
|
17
18
|
const TAG = "[pi-claudian]";
|
|
18
|
-
const
|
|
19
|
+
const FALSE_TOKENS = new Set(["", "0", "false", "no", "off"]);
|
|
20
|
+
const raw = process.env.PI_CLAUDIAN_DEBUG?.trim().toLowerCase();
|
|
21
|
+
const enabled = raw !== undefined && !FALSE_TOKENS.has(raw);
|
|
19
22
|
|
|
20
|
-
/** Log a debug message when PI_CLAUDIAN_DEBUG is set. */
|
|
23
|
+
/** Log a debug message when PI_CLAUDIAN_DEBUG is set to an enabling value. */
|
|
21
24
|
export function debug(...args: unknown[]): void {
|
|
22
25
|
if (!enabled) return;
|
|
23
26
|
console.error(TAG, ...args);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-claudian/auto-save-to-markdown",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Pi extension that automatically saves each completed conversation turn as a markdown file with YAML frontmatter, one file per session-tree branch.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|