discoclaw 1.2.4 → 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 (87) hide show
  1. package/.context/voice.md +30 -2
  2. package/.env.example +7 -3
  3. package/.env.example.full +13 -32
  4. package/README.md +1 -1
  5. package/dist/cli/dashboard.js +7 -1
  6. package/dist/cli/dashboard.test.js +0 -4
  7. package/dist/cli/init-wizard.js +4 -8
  8. package/dist/cli/init-wizard.test.js +4 -10
  9. package/dist/config.js +5 -38
  10. package/dist/config.test.js +8 -72
  11. package/dist/cron/executor.js +72 -1
  12. package/dist/dashboard/api/metrics.js +7 -0
  13. package/dist/dashboard/api/metrics.test.js +16 -0
  14. package/dist/dashboard/api/traces.js +14 -0
  15. package/dist/dashboard/api/traces.test.js +40 -0
  16. package/dist/dashboard/page.js +187 -8
  17. package/dist/dashboard/server.js +82 -19
  18. package/dist/dashboard/server.test.js +123 -10
  19. package/dist/discord/actions.js +112 -6
  20. package/dist/discord/actions.test.js +117 -1
  21. package/dist/discord/deferred-runner.js +306 -219
  22. package/dist/discord/help-command.js +1 -1
  23. package/dist/discord/message-coordinator.js +4 -36
  24. package/dist/discord/models-command.js +1 -1
  25. package/dist/discord/reaction-handler.js +83 -5
  26. package/dist/discord/reaction-handler.test.js +55 -0
  27. package/dist/discord/verify-push.js +31 -36
  28. package/dist/discord/verify-push.test.js +34 -6
  29. package/dist/discord/voice-command.js +1 -31
  30. package/dist/discord/voice-command.test.js +21 -259
  31. package/dist/discord/voice-status-command.js +3 -22
  32. package/dist/discord/voice-status-command.test.js +16 -124
  33. package/dist/discord-followup.test.js +133 -0
  34. package/dist/health/config-doctor.js +5 -27
  35. package/dist/health/config-doctor.test.js +1 -4
  36. package/dist/index.js +15 -28
  37. package/dist/observability/trace-store.js +56 -0
  38. package/dist/observability/trace-utils.js +31 -0
  39. package/dist/runtime/codex-cli.js +3 -2
  40. package/dist/runtime/codex-cli.test.js +33 -0
  41. package/dist/runtime/model-tiers.js +1 -1
  42. package/dist/runtime/model-tiers.test.js +9 -0
  43. package/dist/runtime/openai-tool-schemas.js +17 -0
  44. package/dist/runtime-overrides.js +2 -3
  45. package/dist/runtime-overrides.test.js +27 -193
  46. package/dist/tasks/store.js +10 -6
  47. package/dist/tasks/store.test.js +44 -0
  48. package/dist/tasks/task-action-executor.test.js +162 -50
  49. package/dist/tasks/task-action-mutations.js +22 -2
  50. package/dist/tasks/task-action-read-ops.js +7 -1
  51. package/dist/tasks/task-action-runner-types.js +19 -1
  52. package/dist/voice/audio-pipeline.js +183 -96
  53. package/dist/voice/audio-receiver.js +8 -0
  54. package/dist/voice/audio-receiver.test.js +16 -0
  55. package/dist/voice/conversation-buffer.js +16 -6
  56. package/dist/voice/providers/gemini-live-provider.js +481 -0
  57. package/dist/voice/providers/gemini-live-provider.test.js +834 -0
  58. package/dist/voice/providers/gemini-live-responder.js +267 -0
  59. package/dist/voice/providers/gemini-live-responder.test.js +615 -0
  60. package/dist/voice/providers/gemini-live-token-estimator.js +100 -0
  61. package/dist/voice/providers/gemini-live-token-estimator.test.js +160 -0
  62. package/dist/voice/providers/gemini-live-types.js +32 -0
  63. package/dist/voice/providers/gemini-tool-mapper.js +91 -0
  64. package/dist/voice/providers/gemini-tool-mapper.test.js +253 -0
  65. package/dist/voice/providers/index.js +3 -0
  66. package/dist/voice/voice-prompt-builder.js +26 -17
  67. package/dist/voice/voice-prompt-builder.test.js +16 -1
  68. package/docs/configuration.md +4 -9
  69. package/docs/official-docs.md +6 -9
  70. package/docs/runtime-switching.md +1 -1
  71. package/package.json +1 -1
  72. package/dist/voice/audio-pipeline.test.js +0 -619
  73. package/dist/voice/stt-deepgram.js +0 -154
  74. package/dist/voice/stt-deepgram.test.js +0 -275
  75. package/dist/voice/stt-factory.js +0 -42
  76. package/dist/voice/stt-factory.test.js +0 -45
  77. package/dist/voice/stt-openai.js +0 -156
  78. package/dist/voice/stt-openai.test.js +0 -281
  79. package/dist/voice/tts-cartesia.js +0 -169
  80. package/dist/voice/tts-cartesia.test.js +0 -228
  81. package/dist/voice/tts-deepgram.js +0 -84
  82. package/dist/voice/tts-deepgram.test.js +0 -220
  83. package/dist/voice/tts-factory.js +0 -52
  84. package/dist/voice/tts-factory.test.js +0 -53
  85. package/dist/voice/tts-openai.js +0 -70
  86. package/dist/voice/tts-openai.test.js +0 -138
  87. package/dist/voice/types.test.js +0 -84
@@ -1,84 +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('VoiceConfig accepts minimal shape (optional fields omitted)', () => {
17
- const cfg = {
18
- enabled: false,
19
- sttProvider: 'whisper',
20
- ttsProvider: 'kokoro',
21
- };
22
- expect(cfg.homeChannel).toBeUndefined();
23
- expect(cfg.deepgramApiKey).toBeUndefined();
24
- expect(cfg.cartesiaApiKey).toBeUndefined();
25
- });
26
- it('AudioFrame is assignable in expected shape', () => {
27
- const frame = {
28
- buffer: Buffer.alloc(320),
29
- sampleRate: 16000,
30
- channels: 1,
31
- };
32
- const frame2 = frame;
33
- expect(frame2).toBe(frame);
34
- });
35
- it('TranscriptionResult is assignable in expected shape', () => {
36
- const result = {
37
- text: 'hello world',
38
- confidence: 0.95,
39
- isFinal: true,
40
- };
41
- const result2 = result;
42
- expect(result2).toBe(result);
43
- });
44
- it('TranscriptionResult works without optional confidence', () => {
45
- const result = {
46
- text: 'partial',
47
- isFinal: false,
48
- };
49
- expect(result.confidence).toBeUndefined();
50
- });
51
- it('mock SttProvider satisfies the interface', async () => {
52
- let cb;
53
- const provider = {
54
- start: async () => { },
55
- feedAudio: () => { },
56
- onTranscription: (callback) => { cb = callback; },
57
- stop: async () => { },
58
- };
59
- await provider.start();
60
- const frame = { buffer: Buffer.alloc(160), sampleRate: 16000, channels: 1 };
61
- provider.feedAudio(frame);
62
- const results = [];
63
- provider.onTranscription((r) => results.push(r));
64
- // Simulate a transcription arriving
65
- cb({ text: 'test', isFinal: true });
66
- expect(results).toHaveLength(1);
67
- expect(results[0].text).toBe('test');
68
- await provider.stop();
69
- });
70
- it('mock TtsProvider satisfies the interface', async () => {
71
- const provider = {
72
- async *synthesize(_text) {
73
- yield { buffer: Buffer.alloc(320), sampleRate: 24000, channels: 1 };
74
- yield { buffer: Buffer.alloc(320), sampleRate: 24000, channels: 1 };
75
- },
76
- };
77
- const frames = [];
78
- for await (const frame of provider.synthesize('hello')) {
79
- frames.push(frame);
80
- }
81
- expect(frames).toHaveLength(2);
82
- expect(frames[0].sampleRate).toBe(24000);
83
- });
84
- });