@moxxy/plugin-stt-whisper-codex 0.28.1 → 0.30.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/package.json +5 -5
- package/src/index.test.ts +9 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moxxy/plugin-stt-whisper-codex",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"description": "OpenAI Codex OAuth speech-to-text transcriber (Whisper family) for moxxy.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"moxxy",
|
|
@@ -63,15 +63,15 @@
|
|
|
63
63
|
]
|
|
64
64
|
},
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@moxxy/plugin-provider-openai-codex": "0.
|
|
67
|
-
"@moxxy/sdk": "0.
|
|
68
|
-
"@moxxy/plugin-stt-whisper": "0.
|
|
66
|
+
"@moxxy/plugin-provider-openai-codex": "0.30.0",
|
|
67
|
+
"@moxxy/sdk": "0.30.0",
|
|
68
|
+
"@moxxy/plugin-stt-whisper": "0.30.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@types/node": "^22.10.0",
|
|
72
72
|
"typescript": "^5.7.3",
|
|
73
73
|
"vitest": "^2.1.8",
|
|
74
|
-
"@moxxy/plugin-vault": "0.
|
|
74
|
+
"@moxxy/plugin-vault": "0.30.0",
|
|
75
75
|
"@moxxy/tsconfig": "0.0.0",
|
|
76
76
|
"@moxxy/vitest-preset": "0.0.0"
|
|
77
77
|
},
|
package/src/index.test.ts
CHANGED
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
MOXXY_PCM16_24KHZ_MIME,
|
|
20
20
|
pcm16MonoToWav,
|
|
21
21
|
} from './index.js';
|
|
22
|
+
import { assertDefined } from '@moxxy/sdk';
|
|
22
23
|
|
|
23
24
|
interface CapturedRequest {
|
|
24
25
|
readonly req: IncomingMessage;
|
|
@@ -95,8 +96,9 @@ describe('CodexOAuthTranscriber', () => {
|
|
|
95
96
|
});
|
|
96
97
|
const def = plugin.transcribers?.[0];
|
|
97
98
|
expect(def?.name).toBe('openai-codex-transcribe');
|
|
99
|
+
assertDefined(def, 'buildWhisperCodexPlugin always registers a transcriber');
|
|
98
100
|
|
|
99
|
-
const transcriber = def
|
|
101
|
+
const transcriber = def.createClient({});
|
|
100
102
|
const result = await transcriber.transcribe(new Uint8Array([1, 2, 3, 4]), {
|
|
101
103
|
mimeType: 'audio/wav',
|
|
102
104
|
});
|
|
@@ -336,9 +338,10 @@ describe('buildWhisperCodexPlugin createClient config merge', () => {
|
|
|
336
338
|
sessionIdProvider: () => 'host-session',
|
|
337
339
|
});
|
|
338
340
|
const def = plugin.transcribers?.[0];
|
|
341
|
+
assertDefined(def, 'buildWhisperCodexPlugin always registers a transcriber');
|
|
339
342
|
|
|
340
343
|
// Untrusted registry config attempts to shadow host-wired dependencies.
|
|
341
|
-
const transcriber = def
|
|
344
|
+
const transcriber = def.createClient({
|
|
342
345
|
vault: evilVault,
|
|
343
346
|
fetch: evilFetch,
|
|
344
347
|
});
|
|
@@ -378,7 +381,8 @@ describe('buildWhisperCodexPlugin createClient config merge', () => {
|
|
|
378
381
|
sessionIdProvider: () => 'host-session',
|
|
379
382
|
});
|
|
380
383
|
const def = plugin.transcribers?.[0];
|
|
381
|
-
|
|
384
|
+
assertDefined(def, 'buildWhisperCodexPlugin always registers a transcriber');
|
|
385
|
+
const transcriber = def.createClient({
|
|
382
386
|
baseUrl: configServer.baseUrl,
|
|
383
387
|
sessionIdProvider: () => 'config-session',
|
|
384
388
|
});
|
|
@@ -563,7 +567,8 @@ describe('CodexOAuthTranscriber hardening', () => {
|
|
|
563
567
|
expect((thrown as { code?: string }).code).toBe('PROVIDER_BAD_REQUEST');
|
|
564
568
|
const cause = (thrown as { cause?: { message?: string } }).cause;
|
|
565
569
|
// The full 50KB body must NOT be embedded verbatim in the cause.
|
|
566
|
-
|
|
570
|
+
const causeMessage = cause?.message;
|
|
571
|
+
expect(causeMessage?.length ?? 0).toBeLessThanOrEqual(500);
|
|
567
572
|
expect(cause?.message ?? '').not.toContain(secret);
|
|
568
573
|
} finally {
|
|
569
574
|
await server.close();
|