@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 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
@@ -144,6 +144,9 @@ markdown 文件只记录**一个分支**——即该分支看到的 root→leaf
144
144
  PI_CLAUDIAN_DEBUG=1 pi
145
145
  ```
146
146
 
147
+ 除显式假值(空串、`0`、`false`、`no`、`off`,忽略大小写)以外的任何值都会开启
148
+ 调试;取消该变量或将其设为其中某个假值即可关闭。
149
+
147
150
  ## 许可
148
151
 
149
152
  MIT
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 truthy
5
- * value (e.g. "1"). Output goes to stderr via console.error, so it never mixes
6
- * with pi's stdout and can be captured separately:
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 enabled = Boolean(process.env.PI_CLAUDIAN_DEBUG);
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.1",
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",