f733998945
- Novos indexadores hermes-indexer.ts e opencode-indexer.ts para unificar sessões Claude, Hermes Agent e OpenCode num único sessions.db - SessionMeta alargado: source (obrigatório), model, input/output_tokens, estimated_cost; project_path/jsonl_path agora nullable - Fix TS: tipos explícitos, guard jsonl_path null, dependências instaladas Security Audit (Regra #47): - npm audit executado — 0 vulnerabilities após fix - vite 7→8.0.16 (breaking upgrade, resolve esbuild CVE GHSA-gv7w-rqvm-qjhr) - vitest 4.0.18→4.1.9 (resolve esbuild interno CVE GHSA-gv7w-rqvm-qjhr) - shell-quote override ^1.8.4 via package.json#overrides (CVE GHSA-w7jw-789q-3m8p) - react-router, joi, qs, form-data, ip-address, js-yaml resolvidos via npm audit fix Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
55 lines
1.2 KiB
TypeScript
55 lines
1.2 KiB
TypeScript
export type SessionOutcome = 'completed' | 'interrupted' | 'error' | 'unknown'
|
|
|
|
export interface SessionMeta {
|
|
session_id: string
|
|
source: 'claude' | 'hermes' | 'opencode'
|
|
project_path: string | null
|
|
project_slug: string | null
|
|
jsonl_path: string | null
|
|
model: string | null
|
|
started_at: string
|
|
ended_at: string | null
|
|
duration_sec: number | null
|
|
event_count: number
|
|
user_messages: number
|
|
assistant_msgs: number
|
|
tool_calls: number
|
|
input_tokens: number | null
|
|
output_tokens: number | null
|
|
estimated_cost: number | null
|
|
first_prompt: string | null
|
|
tools_used: string[]
|
|
skills_invoked: string[]
|
|
outcome: SessionOutcome
|
|
permission_mode: string | null
|
|
file_size: number
|
|
indexed_at: string
|
|
}
|
|
|
|
export type SessionEventType =
|
|
| 'user'
|
|
| 'assistant'
|
|
| 'system'
|
|
| 'attachment'
|
|
| 'permission-mode'
|
|
| 'file-history-snapshot'
|
|
| 'unknown'
|
|
|
|
export interface SessionEvent {
|
|
index: number
|
|
type: SessionEventType
|
|
timestamp: string | null
|
|
raw: Record<string, unknown>
|
|
text: string | null
|
|
tool_name: string | null
|
|
tool_input: Record<string, unknown> | null
|
|
tool_result: unknown
|
|
skill_invoked: string | null
|
|
hook_name: string | null
|
|
}
|
|
|
|
export interface ParseResult {
|
|
meta: SessionMeta
|
|
events: SessionEvent[]
|
|
}
|