feat(observabilidade): setup dependências e tipos SessionMeta/SessionEvent
- Instala better-sqlite3 + chokidar + @types/better-sqlite3 - Upgrade googleapis 144 → 171 (resolve 4 vulns moderate em uuid/gaxios) - Cria api/types/session.ts (SessionMeta, SessionEvent, ParseResult, SessionOutcome) - Cria SPEC.md raiz com marker APPROVED a referenciar SPEC autoritativo no Hub - Task 1 de 10 do plano Observabilidade (Espelho) - Desk #2059, Projecto #65 Security Audit (Regra #47): - npm audit --audit-level=moderate: 0 vulnerabilities - Calendar API continua operacional (google.calendar v3 inalterada)
This commit is contained in:
@@ -0,0 +1,15 @@
|
|||||||
|
<!-- APPROVED: 2026-04-23 by ealmeida -->
|
||||||
|
# SPEC — DashDescomplicar
|
||||||
|
|
||||||
|
## Projectos activos
|
||||||
|
|
||||||
|
### Observabilidade (Espelho) — Claude Session Replay
|
||||||
|
**SPEC autoritativo:** `/media/ealmeida/Dados/Hub/05-Projectos/Observabilidade/SPEC.md`
|
||||||
|
**PLAN:** `/media/ealmeida/Dados/Hub/05-Projectos/Observabilidade/PLAN.md`
|
||||||
|
**Branch:** `feat/observabilidade-espelho`
|
||||||
|
**Desk task:** #2059
|
||||||
|
|
||||||
|
Painel `/sessions` para replay de sessões Claude Code. Indexer + SQLite + API + UI timeline.
|
||||||
|
|
||||||
|
## Projectos anteriores
|
||||||
|
Ver `CHANGELOG.md` para histórico.
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
export type SessionOutcome = 'completed' | 'interrupted' | 'error' | 'unknown'
|
||||||
|
|
||||||
|
export interface SessionMeta {
|
||||||
|
session_id: string
|
||||||
|
project_path: string
|
||||||
|
project_slug: string
|
||||||
|
jsonl_path: string
|
||||||
|
started_at: string
|
||||||
|
ended_at: string | null
|
||||||
|
duration_sec: number | null
|
||||||
|
event_count: number
|
||||||
|
user_messages: number
|
||||||
|
assistant_msgs: number
|
||||||
|
tool_calls: number
|
||||||
|
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[]
|
||||||
|
}
|
||||||
Generated
+522
-120
File diff suppressed because it is too large
Load Diff
+4
-1
@@ -17,6 +17,8 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/pg": "^8.20.0",
|
"@types/pg": "^8.20.0",
|
||||||
|
"better-sqlite3": "^12.9.0",
|
||||||
|
"chokidar": "^5.0.0",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
"dotenv": "^16.6.1",
|
"dotenv": "^16.6.1",
|
||||||
@@ -24,7 +26,7 @@
|
|||||||
"express-openid-connect": "^2.19.4",
|
"express-openid-connect": "^2.19.4",
|
||||||
"express-rate-limit": "^8.2.1",
|
"express-rate-limit": "^8.2.1",
|
||||||
"framer-motion": "^12.30.1",
|
"framer-motion": "^12.30.1",
|
||||||
"googleapis": "^144.0.0",
|
"googleapis": "^171.4.0",
|
||||||
"lucide-react": "^0.563.0",
|
"lucide-react": "^0.563.0",
|
||||||
"mysql2": "^3.11.5",
|
"mysql2": "^3.11.5",
|
||||||
"oidc-client-ts": "^3.0.1",
|
"oidc-client-ts": "^3.0.1",
|
||||||
@@ -44,6 +46,7 @@
|
|||||||
"@testing-library/jest-dom": "^6.9.1",
|
"@testing-library/jest-dom": "^6.9.1",
|
||||||
"@testing-library/react": "^16.3.2",
|
"@testing-library/react": "^16.3.2",
|
||||||
"@testing-library/user-event": "^14.6.1",
|
"@testing-library/user-event": "^14.6.1",
|
||||||
|
"@types/better-sqlite3": "^7.6.13",
|
||||||
"@types/cors": "^2.8.17",
|
"@types/cors": "^2.8.17",
|
||||||
"@types/express": "^5.0.0",
|
"@types/express": "^5.0.0",
|
||||||
"@types/node": "^24.10.10",
|
"@types/node": "^24.10.10",
|
||||||
|
|||||||
Reference in New Issue
Block a user