@alfe.ai/openclaw-voice 0.1.14 → 0.2.0

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
@@ -1,54 +1,37 @@
1
- # packages/openclaw-voice (`@alfe.ai/openclaw-voice`)
1
+ # `@alfe.ai/openclaw-voice`
2
2
 
3
- OpenClaw voice plugin for Alfe Discord audio, Twilio phone calls, and meeting bots.
3
+ OpenClaw tools for Alfe's agent-authenticated one-shot voice endpoints.
4
4
 
5
- ## What It Does
5
+ The plugin registers two tools:
6
6
 
7
- OpenClaw plugin that integrates voice capabilities into the agent runtime. All heavy voice logic lives in `voice-service` this package is the OpenClaw integration layer.
7
+ - `voice_tts` converts 1–5000 characters to a new workspace-relative WAV or
8
+ raw PCM file.
9
+ - `voice_stt` transcribes a workspace-relative WAV or raw mono 16-bit PCM file
10
+ of at most 10 MiB.
8
11
 
9
- On activation, the plugin:
12
+ Both tools resolve the agent API key and voice-service URL from
13
+ `@alfe.ai/config`, call through `AgentApiClient`, and leave billing to the
14
+ server. The plugin has no provider credential fields, gateway RPC, daemon
15
+ connection, or channel-specific call controls.
10
16
 
11
- - **Registers voice tools** `voice_hangup`, `voice_transfer` (Twilio), `voice_dtmf` (Twilio)
12
- - **Registers HTTP routes** `/twilio/inbound` and `/twilio/status` webhook handlers
13
- - **Registers gateway RPC** `voice.speak` for TTS and direct audio output
14
- - **Hooks into OpenClaw events** — auto-joins/leaves Discord voice on session start/end, auto-injects session IDs into tool calls
15
- - **Connects to Alfe daemon IPC** — registers voice capabilities; gracefully degrades if unavailable
17
+ File arguments are treated as model-controlled input: real paths must stay
18
+ inside the current workspace, input files must be regular files within the
19
+ size cap, and TTS creates output exclusively without replacing existing files.
16
20
 
17
- Follows the standard OpenClaw plugin pattern: exports `id`, `name`, `activate`, `deactivate`.
18
-
19
- ## Key Files
20
-
21
- ```
22
- src/
23
- ├── plugin.ts # Plugin entry point (activate/deactivate lifecycle, tools, routes, hooks)
24
- └── index.ts # Public re-exports
25
- ```
26
-
27
- ## Session Management
28
-
29
- The plugin maintains bidirectional maps between OpenClaw session keys and voice session IDs. On `before_tool_call`, it auto-injects `sessionId` into voice tool parameters so the agent doesn't need to track sessions explicitly.
30
-
31
- Discord sessions are detected via the pattern `voice-discord:{guildId}:{channelId}`.
21
+ Channel voice sessions, calls, barge-in, and streaming audio live in the voice
22
+ service and channel adapters; they are not part of this tool-only package.
32
23
 
33
24
  ## Development
34
25
 
35
- ```bash
36
- pnpm install
37
- pnpm --filter @alfe.ai/openclaw-voice build
38
- ```
39
-
40
- ## Testing
41
-
42
26
  ```bash
43
27
  pnpm --filter @alfe.ai/openclaw-voice test
28
+ pnpm --filter @alfe.ai/openclaw-voice lint
29
+ pnpm --filter @alfe.ai/openclaw-voice build
44
30
  ```
45
31
 
46
- ## Dependencies
47
-
48
- - **voice-service** — core voice logic (TTS, audio pipeline, Discord/Twilio adapters)
49
- - **@alfe.ai/openclaw** — OpenClaw runtime plugin API
32
+ See [`DEVELOPING.md`](DEVELOPING.md) for the file-I/O and runtime contracts.
50
33
 
51
34
  ## Links
52
35
 
53
- - 🌐 Website: <https://alfe.ai>
54
- - 📚 Docs: <https://docs.alfe.ai>
36
+ - [Alfe](https://alfe.ai)
37
+ - [Documentation](https://docs.alfe.ai)
package/dist/index.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import plugin from "./plugin.cjs";
1
+ import { t as plugin } from "./plugin.cjs";
2
2
  export { plugin as default };
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import plugin from "./plugin.js";
1
+ import { t as plugin } from "./plugin.js";
2
2
  export { plugin as default };
package/dist/plugin.d.cts CHANGED
@@ -1,5 +1,26 @@
1
- import { TSchema } from "@sinclair/typebox";
1
+ //#region ../openclaw-plugin-kit/dist/index.d.ts
2
2
 
3
+ //# sourceMappingURL=types.d.ts.map
4
+ //#endregion
5
+ //#region src/tools.d.ts
6
+ /** Shape returned to OpenClaw from a tool `execute`. */
7
+ interface ToolResult {
8
+ content: {
9
+ type: "text";
10
+ text: string;
11
+ }[];
12
+ details: unknown;
13
+ isError?: boolean;
14
+ }
15
+ interface ToolDef<TParameters = unknown> {
16
+ name: string;
17
+ description: string;
18
+ label: string;
19
+ parameters: TParameters;
20
+ execute: (toolCallId: string, params: Record<string, unknown>) => Promise<ToolResult>;
21
+ }
22
+ /** Deliberately model-safe validation/usage failure. Other exceptions stay private. */
23
+ //#endregion
3
24
  //#region src/plugin.d.ts
4
25
 
5
26
  interface Logger {
@@ -8,56 +29,9 @@ interface Logger {
8
29
  error(msg: string, ...args: unknown[]): void;
9
30
  debug(msg: string, ...args: unknown[]): void;
10
31
  }
11
- interface VoicePluginConfig {
12
- voiceServiceUrl?: string;
13
- voiceServicePort?: string | number;
14
- voiceServiceApiKey?: string;
15
- daemonSocket?: string;
16
- [key: string]: unknown;
17
- }
18
- interface OpenClawConfig {
19
- plugins?: {
20
- entries?: Record<string, {
21
- config?: VoicePluginConfig;
22
- [key: string]: unknown;
23
- }>;
24
- [key: string]: unknown;
25
- };
26
- [key: string]: unknown;
27
- }
28
- interface PluginServiceContext {
29
- config: Record<string, unknown>;
30
- workspaceDir?: string;
31
- stateDir: string;
32
- logger: Logger;
33
- }
34
32
  interface OpenClawPluginApi {
35
33
  logger: Logger;
36
- registrationMode?: 'full' | 'setup-only' | 'setup-runtime' | 'cli-metadata';
37
- config?: OpenClawConfig;
38
34
  registerTool(tool: ToolDef): void;
39
- registerGatewayMethod(name: string, handler: (...args: unknown[]) => Promise<unknown>): void;
40
- registerService(service: {
41
- id: string;
42
- start: (ctx: PluginServiceContext) => void | Promise<void>;
43
- stop?: (ctx: PluginServiceContext) => void | Promise<void>;
44
- }): void;
45
- on(event: string, handler: (...args: unknown[]) => void | Promise<void>, options?: {
46
- priority?: number;
47
- }): void;
48
- }
49
- interface ToolDef {
50
- name: string;
51
- description: string;
52
- label: string;
53
- parameters: TSchema;
54
- execute: (toolCallId: string, params: Record<string, unknown>) => Promise<{
55
- content: {
56
- type: 'text';
57
- text: string;
58
- }[];
59
- details: unknown;
60
- }>;
61
35
  }
62
36
  declare const plugin: {
63
37
  id: string;
@@ -68,4 +42,4 @@ declare const plugin: {
68
42
  deactivate(api: OpenClawPluginApi): void;
69
43
  };
70
44
  //#endregion
71
- export { plugin as default };
45
+ export { plugin as t };
package/dist/plugin.d.ts CHANGED
@@ -1,5 +1,26 @@
1
- import { TSchema } from "@sinclair/typebox";
1
+ //#region ../openclaw-plugin-kit/dist/index.d.ts
2
2
 
3
+ //# sourceMappingURL=types.d.ts.map
4
+ //#endregion
5
+ //#region src/tools.d.ts
6
+ /** Shape returned to OpenClaw from a tool `execute`. */
7
+ interface ToolResult {
8
+ content: {
9
+ type: "text";
10
+ text: string;
11
+ }[];
12
+ details: unknown;
13
+ isError?: boolean;
14
+ }
15
+ interface ToolDef<TParameters = unknown> {
16
+ name: string;
17
+ description: string;
18
+ label: string;
19
+ parameters: TParameters;
20
+ execute: (toolCallId: string, params: Record<string, unknown>) => Promise<ToolResult>;
21
+ }
22
+ /** Deliberately model-safe validation/usage failure. Other exceptions stay private. */
23
+ //#endregion
3
24
  //#region src/plugin.d.ts
4
25
 
5
26
  interface Logger {
@@ -8,56 +29,9 @@ interface Logger {
8
29
  error(msg: string, ...args: unknown[]): void;
9
30
  debug(msg: string, ...args: unknown[]): void;
10
31
  }
11
- interface VoicePluginConfig {
12
- voiceServiceUrl?: string;
13
- voiceServicePort?: string | number;
14
- voiceServiceApiKey?: string;
15
- daemonSocket?: string;
16
- [key: string]: unknown;
17
- }
18
- interface OpenClawConfig {
19
- plugins?: {
20
- entries?: Record<string, {
21
- config?: VoicePluginConfig;
22
- [key: string]: unknown;
23
- }>;
24
- [key: string]: unknown;
25
- };
26
- [key: string]: unknown;
27
- }
28
- interface PluginServiceContext {
29
- config: Record<string, unknown>;
30
- workspaceDir?: string;
31
- stateDir: string;
32
- logger: Logger;
33
- }
34
32
  interface OpenClawPluginApi {
35
33
  logger: Logger;
36
- registrationMode?: 'full' | 'setup-only' | 'setup-runtime' | 'cli-metadata';
37
- config?: OpenClawConfig;
38
34
  registerTool(tool: ToolDef): void;
39
- registerGatewayMethod(name: string, handler: (...args: unknown[]) => Promise<unknown>): void;
40
- registerService(service: {
41
- id: string;
42
- start: (ctx: PluginServiceContext) => void | Promise<void>;
43
- stop?: (ctx: PluginServiceContext) => void | Promise<void>;
44
- }): void;
45
- on(event: string, handler: (...args: unknown[]) => void | Promise<void>, options?: {
46
- priority?: number;
47
- }): void;
48
- }
49
- interface ToolDef {
50
- name: string;
51
- description: string;
52
- label: string;
53
- parameters: TSchema;
54
- execute: (toolCallId: string, params: Record<string, unknown>) => Promise<{
55
- content: {
56
- type: 'text';
57
- text: string;
58
- }[];
59
- details: unknown;
60
- }>;
61
35
  }
62
36
  declare const plugin: {
63
37
  id: string;
@@ -68,4 +42,4 @@ declare const plugin: {
68
42
  deactivate(api: OpenClawPluginApi): void;
69
43
  };
70
44
  //#endregion
71
- export { plugin as default };
45
+ export { plugin as t };