osborn 0.9.180 → 0.9.182
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/dist/config.d.ts +6 -46
- package/dist/config.js +20 -56
- package/dist/index.js +94 -849
- package/dist/pipeline-fastbrain.d.ts +10 -17
- package/dist/pipeline-fastbrain.js +269 -246
- package/dist/turn-detector-shim.js +6 -2
- package/dist/voice-io.d.ts +3 -34
- package/dist/voice-io.js +30 -76
- package/package.json +3 -5
- package/tests/autocompact-pct.test.ts +0 -77
- package/tests/voice-io-stt-config.test.ts +0 -177
package/dist/config.d.ts
CHANGED
|
@@ -1,18 +1,9 @@
|
|
|
1
1
|
import type { McpServerConfig } from './claude-handler.js';
|
|
2
|
-
export type VoiceMode = '
|
|
2
|
+
export type VoiceMode = 'pipeline';
|
|
3
3
|
export type EditMode = 'read-only' | 'edit';
|
|
4
4
|
export type AgentMode = 'plan' | 'execute' | 'research';
|
|
5
|
-
export type RealtimeProvider = 'openai' | 'gemini';
|
|
6
5
|
export type STTProvider = 'deepgram' | 'groq-whisper' | 'openai-whisper';
|
|
7
|
-
export type TTSProvider = '
|
|
8
|
-
export type BridgeLLMProvider = 'gemini-pro' | 'gpt-4o';
|
|
9
|
-
export interface RealtimeConfig {
|
|
10
|
-
provider?: RealtimeProvider;
|
|
11
|
-
openaiVoice?: 'alloy' | 'echo' | 'fable' | 'onyx' | 'nova' | 'shimmer';
|
|
12
|
-
openaiModel?: string;
|
|
13
|
-
geminiVoice?: 'Aoede' | 'Charon' | 'Kore' | 'Fenrir' | 'Puck';
|
|
14
|
-
geminiModel?: string;
|
|
15
|
-
}
|
|
6
|
+
export type TTSProvider = 'openai' | 'deepgram';
|
|
16
7
|
export interface DirectConfig {
|
|
17
8
|
stt?: {
|
|
18
9
|
provider?: STTProvider;
|
|
@@ -25,35 +16,11 @@ export interface DirectConfig {
|
|
|
25
16
|
voice?: string;
|
|
26
17
|
};
|
|
27
18
|
}
|
|
28
|
-
export interface PipelineDirectConfig extends DirectConfig {
|
|
29
|
-
enableCollisionGuard?: boolean;
|
|
30
|
-
}
|
|
31
|
-
export interface PipelinedConfig {
|
|
32
|
-
stt?: {
|
|
33
|
-
provider?: STTProvider;
|
|
34
|
-
model?: string;
|
|
35
|
-
language?: string;
|
|
36
|
-
};
|
|
37
|
-
llm?: {
|
|
38
|
-
provider?: BridgeLLMProvider;
|
|
39
|
-
model?: string;
|
|
40
|
-
};
|
|
41
|
-
tts?: {
|
|
42
|
-
provider?: TTSProvider;
|
|
43
|
-
model?: string;
|
|
44
|
-
voice?: string;
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
19
|
export interface OsbornConfig {
|
|
48
20
|
workingDirectory?: string;
|
|
49
21
|
mcpServers?: Record<string, McpServerConfigYaml>;
|
|
50
|
-
defaultProvider?: 'gemini' | 'openai';
|
|
51
|
-
defaultCodingAgent?: 'claude' | 'codex';
|
|
52
22
|
voiceMode?: VoiceMode;
|
|
53
|
-
realtime?: RealtimeConfig;
|
|
54
23
|
direct?: DirectConfig;
|
|
55
|
-
'pipeline-direct'?: PipelineDirectConfig;
|
|
56
|
-
pipelined?: PipelinedConfig;
|
|
57
24
|
}
|
|
58
25
|
interface McpServerConfigYaml {
|
|
59
26
|
enabled?: boolean;
|
|
@@ -103,19 +70,11 @@ export declare function getMcpServers(config: OsbornConfig): Record<string, McpS
|
|
|
103
70
|
*/
|
|
104
71
|
export declare function getEnabledMcpServerNames(config: OsbornConfig): string[];
|
|
105
72
|
/**
|
|
106
|
-
* Get
|
|
107
|
-
*/
|
|
108
|
-
export declare function getPipelinedConfig(config: OsbornConfig): Required<PipelinedConfig>;
|
|
109
|
-
/**
|
|
110
|
-
* Get voice mode from config
|
|
111
|
-
*/
|
|
112
|
-
export declare function getVoiceMode(config: OsbornConfig): VoiceMode;
|
|
113
|
-
/**
|
|
114
|
-
* Get realtime config with defaults merged
|
|
73
|
+
* Get voice mode from config (always pipeline)
|
|
115
74
|
*/
|
|
116
|
-
export declare function
|
|
75
|
+
export declare function getVoiceMode(_config: OsbornConfig): VoiceMode;
|
|
117
76
|
/**
|
|
118
|
-
* Get
|
|
77
|
+
* Get pipeline mode config with defaults merged
|
|
119
78
|
*/
|
|
120
79
|
export declare function getDirectConfig(config: OsbornConfig): Required<DirectConfig>;
|
|
121
80
|
/**
|
|
@@ -179,6 +138,7 @@ export interface ClaudeSessionEntry {
|
|
|
179
138
|
filePath: string;
|
|
180
139
|
fileSize: number;
|
|
181
140
|
}
|
|
141
|
+
export declare function invalidateSessionListCache(): void;
|
|
182
142
|
/**
|
|
183
143
|
* Scan ALL Claude Code projects for sessions.
|
|
184
144
|
* Returns lightweight metadata for every main session JSONL across all projects.
|
package/dist/config.js
CHANGED
|
@@ -44,26 +44,16 @@ export const MCP_CATALOG = [
|
|
|
44
44
|
// Leaving it undefined lets the runtime self-heal in index.ts resolve it on every boot
|
|
45
45
|
// from OSBORN_CWD → process.cwd() at the actual time the agent starts.
|
|
46
46
|
const DEFAULT_CONFIG = {
|
|
47
|
-
|
|
48
|
-
defaultCodingAgent: 'claude',
|
|
49
|
-
// Voice mode: 'direct' (Claude Agent SDK) or 'realtime' (OpenAI/Gemini native)
|
|
50
|
-
voiceMode: 'direct',
|
|
51
|
-
// Realtime mode config (used when voiceMode='realtime')
|
|
52
|
-
realtime: {
|
|
53
|
-
provider: 'openai',
|
|
54
|
-
openaiVoice: 'alloy',
|
|
55
|
-
geminiVoice: 'Aoede',
|
|
56
|
-
geminiModel: 'gemini-2.5-flash-native-audio-preview-12-2025',
|
|
57
|
-
},
|
|
58
|
-
// Direct mode config (used when voiceMode='direct')
|
|
47
|
+
voiceMode: 'pipeline',
|
|
59
48
|
direct: {
|
|
60
49
|
stt: {
|
|
61
50
|
provider: 'deepgram',
|
|
62
51
|
model: 'nova-3',
|
|
63
52
|
},
|
|
64
53
|
tts: {
|
|
65
|
-
provider: '
|
|
66
|
-
|
|
54
|
+
provider: 'openai',
|
|
55
|
+
model: 'tts-1-hd',
|
|
56
|
+
voice: 'fable',
|
|
67
57
|
},
|
|
68
58
|
},
|
|
69
59
|
mcpServers: {
|
|
@@ -193,50 +183,13 @@ export function getEnabledMcpServerNames(config) {
|
|
|
193
183
|
.map(([name, _]) => name);
|
|
194
184
|
}
|
|
195
185
|
/**
|
|
196
|
-
* Get
|
|
197
|
-
*/
|
|
198
|
-
export function getPipelinedConfig(config) {
|
|
199
|
-
const defaults = DEFAULT_CONFIG.pipelined;
|
|
200
|
-
const userConfig = config.pipelined || {};
|
|
201
|
-
return {
|
|
202
|
-
stt: {
|
|
203
|
-
provider: userConfig.stt?.provider || defaults.stt.provider,
|
|
204
|
-
model: userConfig.stt?.model,
|
|
205
|
-
language: userConfig.stt?.language || 'en',
|
|
206
|
-
},
|
|
207
|
-
llm: {
|
|
208
|
-
provider: userConfig.llm?.provider || defaults.llm.provider,
|
|
209
|
-
model: userConfig.llm?.model,
|
|
210
|
-
},
|
|
211
|
-
tts: {
|
|
212
|
-
provider: userConfig.tts?.provider || defaults.tts.provider,
|
|
213
|
-
model: userConfig.tts?.model,
|
|
214
|
-
voice: userConfig.tts?.voice || defaults.tts.voice,
|
|
215
|
-
},
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* Get voice mode from config
|
|
220
|
-
*/
|
|
221
|
-
export function getVoiceMode(config) {
|
|
222
|
-
return config.voiceMode || 'direct';
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
* Get realtime config with defaults merged
|
|
186
|
+
* Get voice mode from config (always pipeline)
|
|
226
187
|
*/
|
|
227
|
-
export function
|
|
228
|
-
|
|
229
|
-
const userConfig = config.realtime || {};
|
|
230
|
-
return {
|
|
231
|
-
provider: userConfig.provider || defaults.provider,
|
|
232
|
-
openaiVoice: userConfig.openaiVoice || defaults.openaiVoice,
|
|
233
|
-
openaiModel: userConfig.openaiModel || 'gpt-4o-realtime-preview',
|
|
234
|
-
geminiVoice: userConfig.geminiVoice || defaults.geminiVoice,
|
|
235
|
-
geminiModel: userConfig.geminiModel || defaults.geminiModel,
|
|
236
|
-
};
|
|
188
|
+
export function getVoiceMode(_config) {
|
|
189
|
+
return 'pipeline';
|
|
237
190
|
}
|
|
238
191
|
/**
|
|
239
|
-
* Get
|
|
192
|
+
* Get pipeline mode config with defaults merged
|
|
240
193
|
*/
|
|
241
194
|
export function getDirectConfig(config) {
|
|
242
195
|
const defaults = DEFAULT_CONFIG.direct;
|
|
@@ -588,6 +541,13 @@ async function extractCwd(filePath) {
|
|
|
588
541
|
rl.on('error', () => done(''));
|
|
589
542
|
});
|
|
590
543
|
}
|
|
544
|
+
// In-memory cache for the session list — invalidated on new session creation or import.
|
|
545
|
+
// Avoids re-crawling all JSONL files on every agent connect / dashboard load.
|
|
546
|
+
let _sessionListCache = null;
|
|
547
|
+
const SESSION_LIST_TTL_MS = 300_000;
|
|
548
|
+
export function invalidateSessionListCache() {
|
|
549
|
+
_sessionListCache = null;
|
|
550
|
+
}
|
|
591
551
|
/**
|
|
592
552
|
* Scan ALL Claude Code projects for sessions.
|
|
593
553
|
* Returns lightweight metadata for every main session JSONL across all projects.
|
|
@@ -596,6 +556,9 @@ async function extractCwd(filePath) {
|
|
|
596
556
|
* @param limit - Max sessions to return (default 100, sorted by recency)
|
|
597
557
|
*/
|
|
598
558
|
export async function listAllClaudeSessions(limit = 1000) {
|
|
559
|
+
if (_sessionListCache && Date.now() < _sessionListCache.expiresAt) {
|
|
560
|
+
return _sessionListCache.data.slice(0, limit);
|
|
561
|
+
}
|
|
599
562
|
const projectsDir = getClaudeProjectsDir();
|
|
600
563
|
if (!existsSync(projectsDir))
|
|
601
564
|
return [];
|
|
@@ -702,7 +665,8 @@ export async function listAllClaudeSessions(limit = 1000) {
|
|
|
702
665
|
fileSize: c.size,
|
|
703
666
|
});
|
|
704
667
|
}
|
|
705
|
-
|
|
668
|
+
_sessionListCache = { data: sessions, expiresAt: Date.now() + SESSION_LIST_TTL_MS };
|
|
669
|
+
return sessions.slice(0, limit);
|
|
706
670
|
}
|
|
707
671
|
/**
|
|
708
672
|
* Get a summary of a session for context briefing
|