discoclaw 1.3.0 → 2.0.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.
Files changed (56) hide show
  1. package/.env.example +4 -6
  2. package/.env.example.full +13 -32
  3. package/README.md +1 -1
  4. package/dist/cli/dashboard.test.js +0 -4
  5. package/dist/cli/init-wizard.js +4 -8
  6. package/dist/cli/init-wizard.test.js +4 -10
  7. package/dist/config.js +2 -42
  8. package/dist/config.test.js +8 -72
  9. package/dist/dashboard/server.js +1 -5
  10. package/dist/dashboard/server.test.js +3 -6
  11. package/dist/discord/actions.js +112 -6
  12. package/dist/discord/actions.test.js +117 -1
  13. package/dist/discord/help-command.js +1 -1
  14. package/dist/discord/message-coordinator.js +3 -8
  15. package/dist/discord/models-command.js +1 -1
  16. package/dist/discord/reaction-handler.js +2 -2
  17. package/dist/discord/reaction-handler.test.js +55 -0
  18. package/dist/discord/verify-push.js +31 -36
  19. package/dist/discord/verify-push.test.js +34 -6
  20. package/dist/discord/voice-command.js +1 -31
  21. package/dist/discord/voice-command.test.js +21 -259
  22. package/dist/discord/voice-status-command.js +3 -22
  23. package/dist/discord/voice-status-command.test.js +16 -124
  24. package/dist/discord-followup.test.js +133 -0
  25. package/dist/health/config-doctor.js +5 -27
  26. package/dist/health/config-doctor.test.js +1 -4
  27. package/dist/index.js +1 -28
  28. package/dist/runtime-overrides.js +2 -3
  29. package/dist/runtime-overrides.test.js +27 -193
  30. package/dist/tasks/store.js +10 -6
  31. package/dist/tasks/store.test.js +44 -0
  32. package/dist/tasks/task-action-executor.test.js +162 -50
  33. package/dist/tasks/task-action-mutations.js +22 -2
  34. package/dist/tasks/task-action-read-ops.js +7 -1
  35. package/dist/tasks/task-action-runner-types.js +19 -1
  36. package/dist/voice/audio-pipeline.js +145 -298
  37. package/docs/configuration.md +4 -9
  38. package/docs/official-docs.md +6 -9
  39. package/docs/runtime-switching.md +1 -1
  40. package/package.json +1 -1
  41. package/dist/voice/audio-pipeline.test.js +0 -1100
  42. package/dist/voice/stt-deepgram.js +0 -154
  43. package/dist/voice/stt-deepgram.test.js +0 -275
  44. package/dist/voice/stt-factory.js +0 -42
  45. package/dist/voice/stt-factory.test.js +0 -45
  46. package/dist/voice/stt-openai.js +0 -156
  47. package/dist/voice/stt-openai.test.js +0 -281
  48. package/dist/voice/tts-cartesia.js +0 -169
  49. package/dist/voice/tts-cartesia.test.js +0 -228
  50. package/dist/voice/tts-deepgram.js +0 -84
  51. package/dist/voice/tts-deepgram.test.js +0 -220
  52. package/dist/voice/tts-factory.js +0 -52
  53. package/dist/voice/tts-factory.test.js +0 -53
  54. package/dist/voice/tts-openai.js +0 -70
  55. package/dist/voice/tts-openai.test.js +0 -138
  56. package/dist/voice/types.test.js +0 -90
@@ -1,90 +0,0 @@
1
- import { describe, it, expect } from 'vitest';
2
- describe('Voice types', () => {
3
- // Compile-time checks: if these compile, the interfaces are well-formed.
4
- it('VoiceConfig is assignable in expected shape', () => {
5
- const cfg = {
6
- enabled: true,
7
- sttProvider: 'deepgram',
8
- ttsProvider: 'cartesia',
9
- homeChannel: '123456789',
10
- deepgramApiKey: 'key-dg',
11
- cartesiaApiKey: 'key-cart',
12
- };
13
- const cfg2 = cfg;
14
- expect(cfg2).toBe(cfg);
15
- });
16
- it('VoicePipelineMode accepts valid values', () => {
17
- const pipeline = 'pipeline';
18
- const gemini = 'gemini-live';
19
- expect(pipeline).toBe('pipeline');
20
- expect(gemini).toBe('gemini-live');
21
- });
22
- it('VoiceConfig accepts minimal shape (optional fields omitted)', () => {
23
- const cfg = {
24
- enabled: false,
25
- sttProvider: 'whisper',
26
- ttsProvider: 'kokoro',
27
- };
28
- expect(cfg.homeChannel).toBeUndefined();
29
- expect(cfg.deepgramApiKey).toBeUndefined();
30
- expect(cfg.cartesiaApiKey).toBeUndefined();
31
- });
32
- it('AudioFrame is assignable in expected shape', () => {
33
- const frame = {
34
- buffer: Buffer.alloc(320),
35
- sampleRate: 16000,
36
- channels: 1,
37
- };
38
- const frame2 = frame;
39
- expect(frame2).toBe(frame);
40
- });
41
- it('TranscriptionResult is assignable in expected shape', () => {
42
- const result = {
43
- text: 'hello world',
44
- confidence: 0.95,
45
- isFinal: true,
46
- };
47
- const result2 = result;
48
- expect(result2).toBe(result);
49
- });
50
- it('TranscriptionResult works without optional confidence', () => {
51
- const result = {
52
- text: 'partial',
53
- isFinal: false,
54
- };
55
- expect(result.confidence).toBeUndefined();
56
- });
57
- it('mock SttProvider satisfies the interface', async () => {
58
- let cb;
59
- const provider = {
60
- start: async () => { },
61
- feedAudio: () => { },
62
- onTranscription: (callback) => { cb = callback; },
63
- stop: async () => { },
64
- };
65
- await provider.start();
66
- const frame = { buffer: Buffer.alloc(160), sampleRate: 16000, channels: 1 };
67
- provider.feedAudio(frame);
68
- const results = [];
69
- provider.onTranscription((r) => results.push(r));
70
- // Simulate a transcription arriving
71
- cb({ text: 'test', isFinal: true });
72
- expect(results).toHaveLength(1);
73
- expect(results[0].text).toBe('test');
74
- await provider.stop();
75
- });
76
- it('mock TtsProvider satisfies the interface', async () => {
77
- const provider = {
78
- async *synthesize(_text) {
79
- yield { buffer: Buffer.alloc(320), sampleRate: 24000, channels: 1 };
80
- yield { buffer: Buffer.alloc(320), sampleRate: 24000, channels: 1 };
81
- },
82
- };
83
- const frames = [];
84
- for await (const frame of provider.synthesize('hello')) {
85
- frames.push(frame);
86
- }
87
- expect(frames).toHaveLength(2);
88
- expect(frames[0].sampleRate).toBe(24000);
89
- });
90
- });