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/session-access.d.ts
CHANGED
|
@@ -259,6 +259,30 @@ export interface SessionTranscripts {
|
|
|
259
259
|
* @param opts.claudeDir - Override the claude directory path
|
|
260
260
|
*/
|
|
261
261
|
export declare function getSessionPaths(sessionId: string, projectDir: string, opts?: SessionAccessOptions): SessionPaths;
|
|
262
|
+
export interface SubAgentInfo {
|
|
263
|
+
agentId: string;
|
|
264
|
+
description: string;
|
|
265
|
+
status: string;
|
|
266
|
+
agentFile: string;
|
|
267
|
+
agentFileExists: boolean;
|
|
268
|
+
totalTokens: number;
|
|
269
|
+
totalToolUseCount: number;
|
|
270
|
+
durationMs: number;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Find all sub-agents spawned by a session.
|
|
274
|
+
* Extracts agentId from toolUseResult fields in the main JSONL,
|
|
275
|
+
* then checks for corresponding agent-{id}.jsonl files at the project level.
|
|
276
|
+
*
|
|
277
|
+
* Sub-agent files live at: ~/.claude/projects/{slug}/agent-{id}.jsonl
|
|
278
|
+
* (NOT inside the session subdirectory — that's only for the Osborn agent SDK path)
|
|
279
|
+
*/
|
|
280
|
+
export declare function getSessionSubAgents(sessionId: string, projectDir: string, opts?: SessionAccessOptions): SubAgentInfo[];
|
|
281
|
+
/**
|
|
282
|
+
* Get all searchable file paths for a session — main JSONL + all sub-agent JSOLs.
|
|
283
|
+
* This is what the pipeline fast brain should ripgrep across.
|
|
284
|
+
*/
|
|
285
|
+
export declare function getSessionSearchPaths(sessionId: string, projectDir: string, opts?: SessionAccessOptions): string[];
|
|
262
286
|
/**
|
|
263
287
|
* Read raw JSON objects from a JSONL file — no parsing into SessionMessage.
|
|
264
288
|
* Returns the actual JSON as-is so you can inspect the full object shapes.
|
package/dist/session-access.js
CHANGED
|
@@ -228,6 +228,80 @@ export function getSessionPaths(sessionId, projectDir, opts) {
|
|
|
228
228
|
exists: existsSync(conversationPath),
|
|
229
229
|
};
|
|
230
230
|
}
|
|
231
|
+
/**
|
|
232
|
+
* Find all sub-agents spawned by a session.
|
|
233
|
+
* Extracts agentId from toolUseResult fields in the main JSONL,
|
|
234
|
+
* then checks for corresponding agent-{id}.jsonl files at the project level.
|
|
235
|
+
*
|
|
236
|
+
* Sub-agent files live at: ~/.claude/projects/{slug}/agent-{id}.jsonl
|
|
237
|
+
* (NOT inside the session subdirectory — that's only for the Osborn agent SDK path)
|
|
238
|
+
*/
|
|
239
|
+
export function getSessionSubAgents(sessionId, projectDir, opts) {
|
|
240
|
+
const claudeDir = resolveClaudeDir(opts);
|
|
241
|
+
const slug = projectPathToSlug(projectDir);
|
|
242
|
+
const projectsDir = join(claudeDir, 'projects', slug);
|
|
243
|
+
const conversationPath = join(projectsDir, `${sessionId}.jsonl`);
|
|
244
|
+
if (!existsSync(conversationPath))
|
|
245
|
+
return [];
|
|
246
|
+
const agents = [];
|
|
247
|
+
const seenIds = new Set();
|
|
248
|
+
try {
|
|
249
|
+
const content = readFileSync(conversationPath, 'utf-8');
|
|
250
|
+
for (const line of content.split('\n')) {
|
|
251
|
+
if (!line.trim())
|
|
252
|
+
continue;
|
|
253
|
+
try {
|
|
254
|
+
const obj = JSON.parse(line);
|
|
255
|
+
const tur = obj.toolUseResult;
|
|
256
|
+
if (tur && typeof tur === 'object' && tur.agentId) {
|
|
257
|
+
const id = tur.agentId;
|
|
258
|
+
if (seenIds.has(id))
|
|
259
|
+
continue;
|
|
260
|
+
seenIds.add(id);
|
|
261
|
+
const agentFile = join(projectsDir, `agent-${id}.jsonl`);
|
|
262
|
+
agents.push({
|
|
263
|
+
agentId: id,
|
|
264
|
+
description: (tur.prompt || '').substring(0, 200),
|
|
265
|
+
status: tur.status || '',
|
|
266
|
+
agentFile,
|
|
267
|
+
agentFileExists: existsSync(agentFile),
|
|
268
|
+
totalTokens: tur.totalTokens || 0,
|
|
269
|
+
totalToolUseCount: tur.totalToolUseCount || 0,
|
|
270
|
+
durationMs: tur.totalDurationMs || 0,
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
catch { }
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
catch { }
|
|
278
|
+
return agents;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Get all searchable file paths for a session — main JSONL + all sub-agent JSOLs.
|
|
282
|
+
* This is what the pipeline fast brain should ripgrep across.
|
|
283
|
+
*/
|
|
284
|
+
export function getSessionSearchPaths(sessionId, projectDir, opts) {
|
|
285
|
+
const paths = getSessionPaths(sessionId, projectDir, opts);
|
|
286
|
+
const files = [];
|
|
287
|
+
// Main conversation
|
|
288
|
+
if (existsSync(paths.conversation)) {
|
|
289
|
+
files.push(paths.conversation);
|
|
290
|
+
}
|
|
291
|
+
// Sub-agents from session subdirectory (Osborn agent SDK path)
|
|
292
|
+
for (const f of paths.subagents) {
|
|
293
|
+
if (existsSync(f))
|
|
294
|
+
files.push(f);
|
|
295
|
+
}
|
|
296
|
+
// Sub-agents at project level (Claude Code CLI path)
|
|
297
|
+
const agents = getSessionSubAgents(sessionId, projectDir, opts);
|
|
298
|
+
for (const a of agents) {
|
|
299
|
+
if (a.agentFileExists && !files.includes(a.agentFile)) {
|
|
300
|
+
files.push(a.agentFile);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
return files;
|
|
304
|
+
}
|
|
231
305
|
// ============================================================
|
|
232
306
|
// JSONL PARSING
|
|
233
307
|
// ============================================================
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* summary-index.ts — Builds a compact searchable summary of Claude JSONL sessions
|
|
3
|
+
*
|
|
4
|
+
* Instead of ripgrepping 80MB raw JSONL, we extract one-line summaries per message
|
|
5
|
+
* into a ~1MB plain text file. Ripgrep searches this in <5ms.
|
|
6
|
+
*
|
|
7
|
+
* Format: {lineNum}|{timestamp}|{source}|{msgType}|{summary}
|
|
8
|
+
*
|
|
9
|
+
* No LLM calls — pure heuristic extraction:
|
|
10
|
+
* tool_use → tool name + key params (file path, command, query)
|
|
11
|
+
* tool_result → tool name + first 80 chars of output
|
|
12
|
+
* user → raw text (already short from voice)
|
|
13
|
+
* assistant → first 500 chars of text
|
|
14
|
+
*
|
|
15
|
+
* Per-session index stored at: .osborn/sessions/{sessionId}/.index/search-index.txt
|
|
16
|
+
*/
|
|
17
|
+
export interface IndexEntry {
|
|
18
|
+
lineNum: number;
|
|
19
|
+
byteOffset: number;
|
|
20
|
+
timestamp: string;
|
|
21
|
+
source: string;
|
|
22
|
+
msgType: string;
|
|
23
|
+
summary: string;
|
|
24
|
+
}
|
|
25
|
+
export interface SummaryIndexState {
|
|
26
|
+
indexPath: string;
|
|
27
|
+
metaPath: string;
|
|
28
|
+
main: {
|
|
29
|
+
jsonlPath: string;
|
|
30
|
+
byteOffset: number;
|
|
31
|
+
lineCount: number;
|
|
32
|
+
indexLineCount: number;
|
|
33
|
+
};
|
|
34
|
+
subAgents: Map<string, {
|
|
35
|
+
jsonlPath: string;
|
|
36
|
+
byteOffset: number;
|
|
37
|
+
lineCount: number;
|
|
38
|
+
indexLineCount: number;
|
|
39
|
+
}>;
|
|
40
|
+
toolUseIdMap: Map<string, string>;
|
|
41
|
+
}
|
|
42
|
+
export interface SummaryIndexMeta {
|
|
43
|
+
version: 1;
|
|
44
|
+
sessionId: string;
|
|
45
|
+
createdAt: string;
|
|
46
|
+
updatedAt: string;
|
|
47
|
+
main: {
|
|
48
|
+
jsonlPath: string;
|
|
49
|
+
byteOffset: number;
|
|
50
|
+
lineCount: number;
|
|
51
|
+
indexLineCount: number;
|
|
52
|
+
};
|
|
53
|
+
subAgents: Record<string, {
|
|
54
|
+
jsonlPath: string;
|
|
55
|
+
byteOffset: number;
|
|
56
|
+
lineCount: number;
|
|
57
|
+
indexLineCount: number;
|
|
58
|
+
}>;
|
|
59
|
+
toolUseIdMap: Record<string, string>;
|
|
60
|
+
}
|
|
61
|
+
export interface IndexWatcher {
|
|
62
|
+
stop(): void;
|
|
63
|
+
state: SummaryIndexState;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Build or resume a summary index for a session.
|
|
67
|
+
* Reads main JSONL + all sub-agent JSONLs, extracts summaries.
|
|
68
|
+
* If an existing index with metadata exists, resumes from last byte offset.
|
|
69
|
+
*/
|
|
70
|
+
export declare function buildSummaryIndex(sessionId: string, workingDir: string, sessionBaseDir: string, onProgress?: (msg: string) => void): SummaryIndexState;
|
|
71
|
+
/**
|
|
72
|
+
* Poll-based incremental index updater (10s interval).
|
|
73
|
+
* Checks main JSONL + sub-agents for new content, indexes in one batch.
|
|
74
|
+
* No fs.watch — avoids race conditions with concurrent writers.
|
|
75
|
+
*/
|
|
76
|
+
export declare function startIndexWatcher(sessionId: string, workingDir: string, sessionBaseDir: string, state: SummaryIndexState): IndexWatcher;
|
|
77
|
+
export declare function getIndexPath(sessionId: string, sessionBaseDir: string): string | null;
|
|
78
|
+
/**
|
|
79
|
+
* Given index search results (with byte offsets + source tags),
|
|
80
|
+
* read FULL content from raw JSONL via targeted reads — 0.5ms per result.
|
|
81
|
+
* No readFileSync of the whole file. Strips JSON noise, returns clean text.
|
|
82
|
+
*/
|
|
83
|
+
export declare function readFullContent(results: {
|
|
84
|
+
lineNum: number;
|
|
85
|
+
byteOffset: number;
|
|
86
|
+
source: string;
|
|
87
|
+
}[], sessionId: string, workingDir: string, sessionBaseDir: string, maxCharsPerResult?: number): string[];
|