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.
- package/.context/voice.md +30 -2
- package/.env.example +7 -3
- package/.env.example.full +13 -32
- package/README.md +1 -1
- package/dist/cli/dashboard.js +7 -1
- package/dist/cli/dashboard.test.js +0 -4
- package/dist/cli/init-wizard.js +4 -8
- package/dist/cli/init-wizard.test.js +4 -10
- package/dist/config.js +5 -38
- package/dist/config.test.js +8 -72
- package/dist/cron/executor.js +72 -1
- package/dist/dashboard/api/metrics.js +7 -0
- package/dist/dashboard/api/metrics.test.js +16 -0
- package/dist/dashboard/api/traces.js +14 -0
- package/dist/dashboard/api/traces.test.js +40 -0
- package/dist/dashboard/page.js +187 -8
- package/dist/dashboard/server.js +82 -19
- package/dist/dashboard/server.test.js +123 -10
- package/dist/discord/actions.js +112 -6
- package/dist/discord/actions.test.js +117 -1
- package/dist/discord/deferred-runner.js +306 -219
- package/dist/discord/help-command.js +1 -1
- package/dist/discord/message-coordinator.js +4 -36
- package/dist/discord/models-command.js +1 -1
- package/dist/discord/reaction-handler.js +83 -5
- package/dist/discord/reaction-handler.test.js +55 -0
- package/dist/discord/verify-push.js +31 -36
- package/dist/discord/verify-push.test.js +34 -6
- package/dist/discord/voice-command.js +1 -31
- package/dist/discord/voice-command.test.js +21 -259
- package/dist/discord/voice-status-command.js +3 -22
- package/dist/discord/voice-status-command.test.js +16 -124
- package/dist/discord-followup.test.js +133 -0
- package/dist/health/config-doctor.js +5 -27
- package/dist/health/config-doctor.test.js +1 -4
- package/dist/index.js +15 -28
- package/dist/observability/trace-store.js +56 -0
- package/dist/observability/trace-utils.js +31 -0
- package/dist/runtime/codex-cli.js +3 -2
- package/dist/runtime/codex-cli.test.js +33 -0
- package/dist/runtime/model-tiers.js +1 -1
- package/dist/runtime/model-tiers.test.js +9 -0
- package/dist/runtime/openai-tool-schemas.js +17 -0
- package/dist/runtime-overrides.js +2 -3
- package/dist/runtime-overrides.test.js +27 -193
- package/dist/tasks/store.js +10 -6
- package/dist/tasks/store.test.js +44 -0
- package/dist/tasks/task-action-executor.test.js +162 -50
- package/dist/tasks/task-action-mutations.js +22 -2
- package/dist/tasks/task-action-read-ops.js +7 -1
- package/dist/tasks/task-action-runner-types.js +19 -1
- package/dist/voice/audio-pipeline.js +183 -96
- package/dist/voice/audio-receiver.js +8 -0
- package/dist/voice/audio-receiver.test.js +16 -0
- package/dist/voice/conversation-buffer.js +16 -6
- package/dist/voice/providers/gemini-live-provider.js +481 -0
- package/dist/voice/providers/gemini-live-provider.test.js +834 -0
- package/dist/voice/providers/gemini-live-responder.js +267 -0
- package/dist/voice/providers/gemini-live-responder.test.js +615 -0
- package/dist/voice/providers/gemini-live-token-estimator.js +100 -0
- package/dist/voice/providers/gemini-live-token-estimator.test.js +160 -0
- package/dist/voice/providers/gemini-live-types.js +32 -0
- package/dist/voice/providers/gemini-tool-mapper.js +91 -0
- package/dist/voice/providers/gemini-tool-mapper.test.js +253 -0
- package/dist/voice/providers/index.js +3 -0
- package/dist/voice/voice-prompt-builder.js +26 -17
- package/dist/voice/voice-prompt-builder.test.js +16 -1
- package/docs/configuration.md +4 -9
- package/docs/official-docs.md +6 -9
- package/docs/runtime-switching.md +1 -1
- package/package.json +1 -1
- package/dist/voice/audio-pipeline.test.js +0 -619
- package/dist/voice/stt-deepgram.js +0 -154
- package/dist/voice/stt-deepgram.test.js +0 -275
- package/dist/voice/stt-factory.js +0 -42
- package/dist/voice/stt-factory.test.js +0 -45
- package/dist/voice/stt-openai.js +0 -156
- package/dist/voice/stt-openai.test.js +0 -281
- package/dist/voice/tts-cartesia.js +0 -169
- package/dist/voice/tts-cartesia.test.js +0 -228
- package/dist/voice/tts-deepgram.js +0 -84
- package/dist/voice/tts-deepgram.test.js +0 -220
- package/dist/voice/tts-factory.js +0 -52
- package/dist/voice/tts-factory.test.js +0 -53
- package/dist/voice/tts-openai.js +0 -70
- package/dist/voice/tts-openai.test.js +0 -138
- package/dist/voice/types.test.js +0 -84
package/dist/voice/types.test.js
DELETED
|
@@ -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
|
-
});
|