throughline 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "throughline",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "type": "module",
5
5
  "description": "Claude Code hooks plugin for structured context compression (/clear-safe persistent memory)",
6
6
  "keywords": [
@@ -453,3 +453,17 @@ export const _internal = {
453
453
  needsRerender,
454
454
  resetRenderKeyCache,
455
455
  };
456
+
457
+ // --- エントリポイント自動起動 ---
458
+ // `node src/token-monitor.mjs` 直接起動(VSCode タスク .vscode/tasks.json が使うパターン)
459
+ // のとき main() を自動実行する。
460
+ // dispatcher 経由(`throughline monitor`)は bin/throughline.mjs が明示的に main() を呼ぶ。
461
+ // テスト import(`node --test src/token-monitor.test.mjs`)は argv[1] が `.test.mjs` で終わる。
462
+ // argv[1] が 'token-monitor.mjs' で終わって '.test.mjs' でないケースだけ auto-run する。
463
+ {
464
+ const argv1 = (process.argv[1] || '').replace(/\\/g, '/');
465
+ const isDirectEntry = argv1.endsWith('token-monitor.mjs') && !argv1.endsWith('.test.mjs');
466
+ if (isDirectEntry) {
467
+ main();
468
+ }
469
+ }