@tarquinen/opencode-dcp 0.1.1 → 0.1.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
@@ -61,16 +61,27 @@ No configuration required! The plugin works out of the box with:
61
61
  - Automatic background optimization
62
62
  - Smart AI-powered analysis
63
63
 
64
- Optional: Enable debug logging by editing `lib/config.ts` in your local copy:
64
+ ### Debug Logging (Optional)
65
65
 
66
- ```typescript
67
- const defaultConfig: PluginConfig = {
68
- debug: true // Set to true to enable debug logging
69
- }
66
+ To enable debug logging, set the `OPENCODE_DCP_DEBUG` environment variable:
67
+
68
+ ```bash
69
+ # Enable debug logging for one session
70
+ OPENCODE_DCP_DEBUG=true oc
71
+
72
+ # Or export it to enable for all sessions
73
+ export OPENCODE_DCP_DEBUG=true
74
+ oc
70
75
  ```
71
76
 
72
77
  Debug logs will be written to `~/.config/opencode/logs/dynamic-context-pruning/YYYY-MM-DD.log`.
73
78
 
79
+ You can watch logs in real-time:
80
+
81
+ ```bash
82
+ tail -f ~/.config/opencode/logs/dynamic-context-pruning/$(date +%Y-%m-%d).log
83
+ ```
84
+
74
85
  ## Architecture
75
86
 
76
87
  - **Janitor**: Background process that analyzes sessions using opencode/big-pickle model
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../lib/config.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,YAAY;IACzB,KAAK,EAAE,OAAO,CAAA;CACjB;AAMD,wBAAgB,SAAS,IAAI,YAAY,CAGxC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../lib/config.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,YAAY;IACzB,KAAK,EAAE,OAAO,CAAA;CACjB;AAMD,wBAAgB,SAAS,IAAI,YAAY,CAOxC"}
@@ -1,8 +1,11 @@
1
1
  const defaultConfig = {
2
- debug: true // Set to true to enable debug logging
2
+ debug: false // Default to false, can be enabled via environment variable
3
3
  };
4
4
  export function getConfig() {
5
- // Could be extended to read from a config file or environment
6
- return defaultConfig;
5
+ // Check for environment variable
6
+ const debugEnv = process.env.OPENCODE_DCP_DEBUG;
7
+ return {
8
+ debug: debugEnv === 'true' || debugEnv === '1' || defaultConfig.debug
9
+ };
7
10
  }
8
11
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../lib/config.ts"],"names":[],"mappings":"AAKA,MAAM,aAAa,GAAiB;IAChC,KAAK,EAAE,IAAI,CAAC,sCAAsC;CACrD,CAAA;AAED,MAAM,UAAU,SAAS;IACrB,8DAA8D;IAC9D,OAAO,aAAa,CAAA;AACxB,CAAC"}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../lib/config.ts"],"names":[],"mappings":"AAKA,MAAM,aAAa,GAAiB;IAChC,KAAK,EAAE,KAAK,CAAC,4DAA4D;CAC5E,CAAA;AAED,MAAM,UAAU,SAAS;IACrB,iCAAiC;IACjC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAA;IAE/C,OAAO;QACH,KAAK,EAAE,QAAQ,KAAK,MAAM,IAAI,QAAQ,KAAK,GAAG,IAAI,aAAa,CAAC,KAAK;KACxE,CAAA;AACL,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@tarquinen/opencode-dcp",
4
- "version": "0.1.1",
4
+ "version": "0.1.2",
5
5
  "type": "module",
6
6
  "description": "OpenCode plugin that optimizes token usage by pruning obsolete tool outputs from conversation context",
7
7
  "main": "./dist/index.js",