@vibe-cafe/vibe-usage 0.2.0 → 0.2.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/hooks.js +5 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibe-cafe/vibe-usage",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Track your AI coding tool token usage and sync to vibecafe.ai",
5
5
  "type": "module",
6
6
  "bin": {
package/src/hooks.js CHANGED
@@ -86,6 +86,8 @@ export function injectCodex() {
86
86
  }
87
87
 
88
88
  if (content.includes('vibe-usage')) {
89
+ // Fix broken [notify] → [[notify]] from previous versions
90
+ content = content.replace(/^\[notify\]$/gm, '[[notify]]');
89
91
  // Update existing command to use latest
90
92
  content = content.replace(
91
93
  /npx @vibe-cafe\/vibe-usage(?:@[\d.]+)? sync[^"']*/g,
@@ -95,12 +97,12 @@ export function injectCodex() {
95
97
  return { injected: false, reason: 'already installed (updated)' };
96
98
  }
97
99
 
98
- const notifySection = `\n[notify]\ncommand = "${SYNC_CMD}"\n`;
99
- const notifyIdx = content.indexOf('[notify]');
100
+ const notifySection = `\n[[notify]]\ncommand = "${SYNC_CMD}"\n`;
101
+ const notifyIdx = content.indexOf('[[notify]]');
100
102
  if (notifyIdx !== -1) {
101
103
  const nextSection = content.indexOf('\n[', notifyIdx + 1);
102
104
  const sectionEnd = nextSection === -1 ? content.length : nextSection;
103
- content = content.slice(0, notifyIdx) + `[notify]\ncommand = "${SYNC_CMD}"` + content.slice(sectionEnd);
105
+ content = content.slice(0, notifyIdx) + `[[notify]]\ncommand = "${SYNC_CMD}"` + content.slice(sectionEnd);
104
106
  } else {
105
107
  content += notifySection;
106
108
  }