@alfe.ai/openclaw-voice 0.0.5 → 0.0.6
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/plugin.js +18 -20
- package/package.json +1 -1
package/dist/plugin.js
CHANGED
|
@@ -139,29 +139,27 @@ const plugin = {
|
|
|
139
139
|
description: "Voice integration — TTS/STT via the voice service, channel-specific operations via channel services",
|
|
140
140
|
version: "0.2.0",
|
|
141
141
|
activate(api) {
|
|
142
|
-
if (globalThis.__voiceGatewayActivated) {
|
|
143
|
-
api.logger.debug("Alfe Voice plugin already activated, skipping re-init");
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
globalThis.__voiceGatewayActivated = true;
|
|
147
142
|
const log = api.logger;
|
|
148
|
-
log.info("Alfe Voice plugin activating...");
|
|
149
|
-
const fullConfig = api.config ?? {};
|
|
150
|
-
const pluginConfig = fullConfig.plugins?.entries?.["@alfe.ai/openclaw-voice"]?.config ?? fullConfig.plugins?.entries?.["voice-gateway"]?.config ?? {};
|
|
151
|
-
voiceServiceUrl = pluginConfig.voiceServiceUrl ?? `http://localhost:${String(pluginConfig.voiceServicePort ?? "3100")}`;
|
|
152
|
-
voiceServiceApiKey = pluginConfig.voiceServiceApiKey ?? "";
|
|
153
|
-
log.info(`Voice service: ${voiceServiceUrl}`);
|
|
154
|
-
let alfeConfig = null;
|
|
155
|
-
try {
|
|
156
|
-
alfeConfig = resolveConfig();
|
|
157
|
-
} catch {}
|
|
158
|
-
connectToDaemon(pluginConfig.daemonSocket ?? alfeConfig?.socketPath ?? DEFAULT_SOCKET_PATH, log).then((client) => {
|
|
159
|
-
daemonIpcClient = client;
|
|
160
|
-
}).catch((err) => {
|
|
161
|
-
log.debug(`Daemon connect failed: ${err.message}`);
|
|
162
|
-
});
|
|
163
143
|
for (const tool of voiceTools) api.registerTool(tool);
|
|
164
144
|
log.info(`Registered ${String(voiceTools.length)} voice tools: ${voiceTools.map((t) => t.name).join(", ")}`);
|
|
145
|
+
if (!globalThis.__voiceGatewayActivated) {
|
|
146
|
+
globalThis.__voiceGatewayActivated = true;
|
|
147
|
+
log.info("Alfe Voice plugin activating...");
|
|
148
|
+
const fullConfig = api.config ?? {};
|
|
149
|
+
const pluginConfig = fullConfig.plugins?.entries?.["@alfe.ai/openclaw-voice"]?.config ?? fullConfig.plugins?.entries?.["voice-gateway"]?.config ?? {};
|
|
150
|
+
voiceServiceUrl = pluginConfig.voiceServiceUrl ?? `http://localhost:${String(pluginConfig.voiceServicePort ?? "3100")}`;
|
|
151
|
+
voiceServiceApiKey = pluginConfig.voiceServiceApiKey ?? "";
|
|
152
|
+
log.info(`Voice service: ${voiceServiceUrl}`);
|
|
153
|
+
let alfeConfig = null;
|
|
154
|
+
try {
|
|
155
|
+
alfeConfig = resolveConfig();
|
|
156
|
+
} catch {}
|
|
157
|
+
connectToDaemon(pluginConfig.daemonSocket ?? alfeConfig?.socketPath ?? DEFAULT_SOCKET_PATH, log).then((client) => {
|
|
158
|
+
daemonIpcClient = client;
|
|
159
|
+
}).catch((err) => {
|
|
160
|
+
log.debug(`Daemon connect failed: ${err.message}`);
|
|
161
|
+
});
|
|
162
|
+
}
|
|
165
163
|
api.registerGatewayMethod("voice.speak", async (...args) => {
|
|
166
164
|
const { text } = args[0];
|
|
167
165
|
log.info(`voice.speak RPC → text=${text?.slice(0, 50) ?? "(none)"}...`);
|