voicemode-channel 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.
- package/dist/gateway.js +1 -1
- package/dist/index.js +10 -1
- package/package.json +1 -1
package/dist/gateway.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -121,7 +121,16 @@ if (process.env.VOICEMODE_CHANNEL_ENABLED !== 'true') {
|
|
|
121
121
|
}
|
|
122
122
|
const WS_URL = process.env.VOICEMODE_CONNECT_WS_URL ?? 'wss://voicemode.dev/ws';
|
|
123
123
|
const CHANNEL_NAME = 'voicemode-channel';
|
|
124
|
-
|
|
124
|
+
// Read version from package.json at runtime to avoid hardcoded version drift
|
|
125
|
+
const CHANNEL_VERSION = (() => {
|
|
126
|
+
try {
|
|
127
|
+
const pkg_path = new URL('../package.json', import.meta.url);
|
|
128
|
+
return JSON.parse(readFileSync(pkg_path, 'utf8')).version ?? '0.0.0';
|
|
129
|
+
}
|
|
130
|
+
catch {
|
|
131
|
+
return '0.0.0';
|
|
132
|
+
}
|
|
133
|
+
})();
|
|
125
134
|
const INSTRUCTIONS = [
|
|
126
135
|
'Events from VoiceMode appear as <channel source="voicemode-channel" caller="NAME">TRANSCRIPT</channel>.',
|
|
127
136
|
'These are inbound voice messages from a user speaking on their phone or web app.',
|