osborn 0.5.3 → 0.5.5
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/.claude/settings.local.json +9 -0
- package/.claude/skills/markdown-to-pdf/SKILL.md +29 -0
- package/.claude/skills/pdf-to-markdown/SKILL.md +28 -0
- package/.claude/skills/playwright-browser/SKILL.md +75 -0
- package/.claude/skills/youtube-transcript/SKILL.md +24 -0
- package/dist/claude-llm.d.ts +29 -1
- package/dist/claude-llm.js +334 -78
- package/dist/config.d.ts +5 -1
- package/dist/config.js +4 -1
- package/dist/fast-brain.d.ts +70 -16
- package/dist/fast-brain.js +662 -99
- package/dist/index-3-2-26-legacy.d.ts +1 -0
- package/dist/index-3-2-26-legacy.js +2233 -0
- package/dist/index.js +752 -423
- package/dist/jsonl-search.d.ts +66 -0
- package/dist/jsonl-search.js +274 -0
- package/dist/leagcyprompts2.d.ts +0 -0
- package/dist/leagcyprompts2.js +573 -0
- package/dist/pipeline-direct-llm.d.ts +77 -0
- package/dist/pipeline-direct-llm.js +216 -0
- package/dist/pipeline-fastbrain.d.ts +45 -0
- package/dist/pipeline-fastbrain.js +367 -0
- package/dist/prompts-2-25-26.d.ts +0 -0
- package/dist/prompts-2-25-26.js +518 -0
- package/dist/prompts-3-2-26.d.ts +78 -0
- package/dist/prompts-3-2-26.js +1319 -0
- package/dist/prompts.d.ts +83 -12
- package/dist/prompts.js +1991 -588
- package/dist/session-access.d.ts +24 -0
- package/dist/session-access.js +74 -0
- package/dist/summary-index.d.ts +87 -0
- package/dist/summary-index.js +570 -0
- package/dist/turn-detector-shim.d.ts +24 -0
- package/dist/turn-detector-shim.js +83 -0
- package/dist/voice-io.d.ts +9 -3
- package/dist/voice-io.js +39 -20
- package/package.json +13 -10
package/dist/fast-brain.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Fast Brain
|
|
2
|
+
* Fast Brain — Central Orchestrator for the Voice AI System
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* The sole intelligence layer between the user and all backend capabilities.
|
|
5
|
+
* The realtime voice model is a thin teleprompter — it speaks what this module returns.
|
|
6
6
|
*
|
|
7
7
|
* Capabilities:
|
|
8
8
|
* - Read/write session files (spec.md + library/)
|
|
9
9
|
* - Web search for quick factual lookups
|
|
10
10
|
* - Record user decisions and preferences into spec.md
|
|
11
|
-
* -
|
|
12
|
-
* -
|
|
11
|
+
* - Trigger deep research (via callbacks to index.ts)
|
|
12
|
+
* - Generate teleprompter scripts for ALL voice output
|
|
13
|
+
* - Post-research: synthesize findings from JSONL into spec.md + voice scripts
|
|
14
|
+
* - Generate visual documents (comparison, diagram, analysis, summary)
|
|
13
15
|
*
|
|
14
|
-
*
|
|
16
|
+
* Central function: askFastBrain() — ALL user questions route here.
|
|
17
|
+
* It returns a FastBrainResponse with a teleprompter script the voice model reads verbatim.
|
|
15
18
|
*
|
|
16
19
|
* Auth chain (tried in order):
|
|
17
20
|
* 1. ANTHROPIC_API_KEY env var → Anthropic SDK (Haiku)
|
|
18
21
|
* 2. ANTHROPIC_AUTH_TOKEN env var → Anthropic SDK (Haiku)
|
|
19
22
|
* 3. GOOGLE_API_KEY env var → Gemini Flash fallback
|
|
20
|
-
*
|
|
21
|
-
* Note: Claude Code OAuth (macOS Keychain) was tested but Anthropic's Messages API
|
|
22
|
-
* rejects OAuth tokens with 401 "OAuth authentication is currently not supported."
|
|
23
23
|
*/
|
|
24
24
|
/**
|
|
25
25
|
* Extract useful content snippets from tool responses, truncated by tool type.
|
|
@@ -31,7 +31,9 @@ export interface ConversationTurn {
|
|
|
31
31
|
role: 'user' | 'assistant';
|
|
32
32
|
text: string;
|
|
33
33
|
}
|
|
34
|
-
/**
|
|
34
|
+
/** Clear fast brain session state — call on disconnect/reconnect/session switch */
|
|
35
|
+
export declare function clearFastBrainSession(): void;
|
|
36
|
+
/** @deprecated Use clearFastBrainSession() instead */
|
|
35
37
|
export declare function clearFastBrainHistory(): void;
|
|
36
38
|
/**
|
|
37
39
|
* Ask the fast brain a question with access to session files and web search.
|
|
@@ -42,14 +44,38 @@ export declare function clearFastBrainHistory(): void;
|
|
|
42
44
|
* @param researchContext - Optional snapshot of the live research log.
|
|
43
45
|
* ~2 second response time for most queries.
|
|
44
46
|
*/
|
|
45
|
-
export declare function askHaiku(workingDir: string, sessionId: string, question: string, researchContext?: string, chatHistory?: ConversationTurn[]): Promise<string>;
|
|
47
|
+
export declare function askHaiku(workingDir: string, sessionId: string, question: string, researchContext?: string, chatHistory?: ConversationTurn[], sendToChat?: (text: string) => void, sessionBaseDir?: string): Promise<string>;
|
|
48
|
+
/** Callbacks for the fast brain to trigger side effects in index.ts */
|
|
49
|
+
export interface FastBrainCallbacks {
|
|
50
|
+
triggerResearch: (task: string) => void;
|
|
51
|
+
queueVoice: (script: string) => void;
|
|
52
|
+
sendToFrontend: (data: any) => void;
|
|
53
|
+
}
|
|
54
|
+
/** Structured response from the fast brain orchestrator */
|
|
55
|
+
export interface FastBrainResponse {
|
|
56
|
+
/** Teleprompter script for the voice model to speak */
|
|
57
|
+
script: string;
|
|
58
|
+
/** Response type for caller routing */
|
|
59
|
+
type: 'answer' | 'research_started' | 'recorded' | 'question';
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Central orchestrator — ALL user questions from the realtime model come here.
|
|
63
|
+
* Routes to: direct answer, research triggering, decision recording, or document generation.
|
|
64
|
+
* Returns a teleprompter script the voice model reads verbatim.
|
|
65
|
+
*/
|
|
66
|
+
export declare function askFastBrain(workingDir: string, sessionId: string, question: string, opts: {
|
|
67
|
+
chatHistory?: ConversationTurn[];
|
|
68
|
+
researchContext?: string;
|
|
69
|
+
callbacks: FastBrainCallbacks;
|
|
70
|
+
sessionBaseDir?: string;
|
|
71
|
+
}): Promise<FastBrainResponse>;
|
|
46
72
|
/**
|
|
47
73
|
* Process a batch of research content chunks through the fast brain.
|
|
48
74
|
* Updates spec.md and library/ files incrementally during research.
|
|
49
75
|
*
|
|
50
76
|
* @param isRefinement - true for the final post-research consolidation pass (higher token budget)
|
|
51
77
|
*/
|
|
52
|
-
export declare function processResearchChunk(workingDir: string, sessionId: string, task: string, contentChunks: string[], isRefinement?: boolean): Promise<{
|
|
78
|
+
export declare function processResearchChunk(workingDir: string, sessionId: string, task: string, contentChunks: string[], isRefinement?: boolean, sessionBaseDir?: string): Promise<{
|
|
53
79
|
spec: string | null;
|
|
54
80
|
libraryFiles: string[];
|
|
55
81
|
} | null>;
|
|
@@ -73,7 +99,7 @@ export declare function augmentResearchResult(workingDir: string, sessionId: str
|
|
|
73
99
|
*
|
|
74
100
|
* Returns { spec, libraryFiles } or null if update failed.
|
|
75
101
|
*/
|
|
76
|
-
export declare function updateSpecFromJSONL(workingDir: string, sessionId: string, task: string, researchLog: string[]): Promise<{
|
|
102
|
+
export declare function updateSpecFromJSONL(workingDir: string, sessionId: string, task: string, researchLog: string[], sessionBaseDir?: string): Promise<{
|
|
77
103
|
spec: string | null;
|
|
78
104
|
libraryFiles: string[];
|
|
79
105
|
} | null>;
|
|
@@ -99,7 +125,7 @@ export declare function checkOutputAgainstQuestions(workingDir: string, sessionI
|
|
|
99
125
|
* Returns a natural 1-2 sentence update, or null if nothing interesting to say.
|
|
100
126
|
* 3-second timeout — returns null if the LLM is too slow.
|
|
101
127
|
*/
|
|
102
|
-
export declare function contextualizeResearchUpdate(workingDir: string, sessionId: string, task: string, batchEvents: string[], researchLog: string[]): Promise<string | null>;
|
|
128
|
+
export declare function contextualizeResearchUpdate(workingDir: string, sessionId: string, task: string, batchEvents: string[], researchLog: string[], chatHistory?: ConversationTurn[], sessionBaseDir?: string): Promise<string | null>;
|
|
103
129
|
/**
|
|
104
130
|
* Generate a proactive conversational prompt to keep the user engaged during research.
|
|
105
131
|
* Called periodically (every 15s) during active research.
|
|
@@ -108,7 +134,7 @@ export declare function contextualizeResearchUpdate(workingDir: string, sessionI
|
|
|
108
134
|
* Returns null/NOTHING if nothing interesting to say.
|
|
109
135
|
* 3-second timeout.
|
|
110
136
|
*/
|
|
111
|
-
export declare function generateProactivePrompt(workingDir: string, sessionId: string, task: string, researchLog: string[], previousPrompts: string[]): Promise<string | null>;
|
|
137
|
+
export declare function generateProactivePrompt(workingDir: string, sessionId: string, task: string, researchLog: string[], previousPrompts: string[], sessionBaseDir?: string): Promise<string | null>;
|
|
112
138
|
/**
|
|
113
139
|
* Generate a structured visual document (comparison table, Mermaid diagram,
|
|
114
140
|
* analysis, or summary) from research findings.
|
|
@@ -116,7 +142,35 @@ export declare function generateProactivePrompt(workingDir: string, sessionId: s
|
|
|
116
142
|
* Reads spec.md, JSONL results, and library for context.
|
|
117
143
|
* Writes the result to library/ and returns the filename + content.
|
|
118
144
|
*/
|
|
119
|
-
export declare function generateVisualDocument(workingDir: string, sessionId: string, request: string, documentType: 'comparison' | 'diagram' | 'analysis' | 'summary'): Promise<{
|
|
145
|
+
export declare function generateVisualDocument(workingDir: string, sessionId: string, request: string, documentType: 'comparison' | 'diagram' | 'analysis' | 'summary', sessionBaseDir?: string): Promise<{
|
|
120
146
|
fileName: string;
|
|
121
147
|
content: string;
|
|
122
148
|
} | null>;
|
|
149
|
+
/**
|
|
150
|
+
* Generate a complete teleprompter script from research results.
|
|
151
|
+
* Replaces augmentResearchResult + extractPriorityContent.
|
|
152
|
+
* Reads full JSONL and produces a spoken monologue.
|
|
153
|
+
*/
|
|
154
|
+
export declare function processResearchCompletion(workingDir: string, sessionId: string, task: string, agentResult: string, chatHistory?: ConversationTurn[], sendToChat?: (text: string) => void, sessionBaseDir?: string): Promise<string>;
|
|
155
|
+
/**
|
|
156
|
+
* Process a batch of research events and decide whether to speak.
|
|
157
|
+
* Replaces contextualizeResearchUpdate — but usually returns null (silent).
|
|
158
|
+
* Only speaks when something genuinely critical is found.
|
|
159
|
+
*/
|
|
160
|
+
export declare function handleResearchBatch(workingDir: string, sessionId: string, task: string, batchEvents: string[], researchLog: string[], chatHistory?: ConversationTurn[], sessionBaseDir?: string): Promise<string | null>;
|
|
161
|
+
/**
|
|
162
|
+
* Generate a brief spoken script for session resume or switch.
|
|
163
|
+
* Replaces buildContextBriefing + getSpecForVoiceModel.
|
|
164
|
+
*/
|
|
165
|
+
export declare function prepareBriefingScript(workingDir: string, sessionId: string, conversationHistory?: {
|
|
166
|
+
role: string;
|
|
167
|
+
text: string;
|
|
168
|
+
}[], type?: 'resume' | 'switch' | 'default'): Promise<string>;
|
|
169
|
+
/**
|
|
170
|
+
* Generate a spoken script after Gemini auto-recovery.
|
|
171
|
+
* Replaces inline recovery logic in index.ts.
|
|
172
|
+
*/
|
|
173
|
+
export declare function prepareRecoveryScript(conversationHistory?: {
|
|
174
|
+
role: string;
|
|
175
|
+
text: string;
|
|
176
|
+
}[]): Promise<string>;
|