tanuki-telemetry 1.1.0

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.
Files changed (54) hide show
  1. package/Dockerfile +22 -0
  2. package/bin/tanuki.mjs +251 -0
  3. package/frontend/eslint.config.js +23 -0
  4. package/frontend/index.html +13 -0
  5. package/frontend/package.json +39 -0
  6. package/frontend/src/App.tsx +232 -0
  7. package/frontend/src/assets/hero.png +0 -0
  8. package/frontend/src/assets/react.svg +1 -0
  9. package/frontend/src/assets/vite.svg +1 -0
  10. package/frontend/src/components/ArtifactsPanel.tsx +429 -0
  11. package/frontend/src/components/ChildStreams.tsx +176 -0
  12. package/frontend/src/components/CoordinatorPage.tsx +317 -0
  13. package/frontend/src/components/Header.tsx +108 -0
  14. package/frontend/src/components/InsightsPanel.tsx +142 -0
  15. package/frontend/src/components/IterationsTable.tsx +98 -0
  16. package/frontend/src/components/KnowledgePage.tsx +308 -0
  17. package/frontend/src/components/LoginPage.tsx +55 -0
  18. package/frontend/src/components/PlanProgress.tsx +163 -0
  19. package/frontend/src/components/QualityReport.tsx +276 -0
  20. package/frontend/src/components/ScreenshotUpload.tsx +117 -0
  21. package/frontend/src/components/ScreenshotsGrid.tsx +266 -0
  22. package/frontend/src/components/SessionDetail.tsx +265 -0
  23. package/frontend/src/components/SessionList.tsx +234 -0
  24. package/frontend/src/components/SettingsPage.tsx +213 -0
  25. package/frontend/src/components/StreamComms.tsx +228 -0
  26. package/frontend/src/components/TanukiLogo.tsx +16 -0
  27. package/frontend/src/components/Timeline.tsx +416 -0
  28. package/frontend/src/components/WalkthroughPage.tsx +458 -0
  29. package/frontend/src/hooks/useApi.ts +81 -0
  30. package/frontend/src/hooks/useAuth.ts +54 -0
  31. package/frontend/src/hooks/useKnowledge.ts +33 -0
  32. package/frontend/src/hooks/useWebSocket.ts +95 -0
  33. package/frontend/src/index.css +66 -0
  34. package/frontend/src/lib/api.ts +15 -0
  35. package/frontend/src/lib/utils.ts +58 -0
  36. package/frontend/src/main.tsx +10 -0
  37. package/frontend/src/types.ts +181 -0
  38. package/frontend/tsconfig.app.json +32 -0
  39. package/frontend/tsconfig.json +7 -0
  40. package/frontend/vite.config.ts +25 -0
  41. package/install.sh +87 -0
  42. package/package.json +63 -0
  43. package/src/api-keys.ts +97 -0
  44. package/src/auth.ts +165 -0
  45. package/src/coordinator.ts +136 -0
  46. package/src/dashboard-server.ts +5 -0
  47. package/src/dashboard.ts +826 -0
  48. package/src/db.ts +1009 -0
  49. package/src/index.ts +20 -0
  50. package/src/middleware.ts +76 -0
  51. package/src/tools.ts +864 -0
  52. package/src/types-shim.d.ts +18 -0
  53. package/src/types.ts +171 -0
  54. package/tsconfig.json +19 -0
@@ -0,0 +1,18 @@
1
+ declare module "better-sqlite3-session-store" {
2
+ import session from "express-session";
3
+ import Database from "better-sqlite3";
4
+
5
+ interface StoreOptions {
6
+ client: Database.Database;
7
+ expired?: {
8
+ clear?: boolean;
9
+ intervalMs?: number;
10
+ };
11
+ }
12
+
13
+ function BetterSqlite3SessionStore(
14
+ session: typeof import("express-session")
15
+ ): new (options: StoreOptions) => session.Store;
16
+
17
+ export = BetterSqlite3SessionStore;
18
+ }
package/src/types.ts ADDED
@@ -0,0 +1,171 @@
1
+ export interface Session {
2
+ id: string;
3
+ worktree_name: string;
4
+ ticket_id: string | null;
5
+ ticket_title: string | null;
6
+ branch_name: string | null;
7
+ mode: "local" | "remote";
8
+ status: "in_progress" | "completed" | "failed" | "interrupted";
9
+ total_input_tokens: number;
10
+ total_output_tokens: number;
11
+ total_iterations: number;
12
+ max_iterations: number;
13
+ started_at: string;
14
+ ended_at: string | null;
15
+ duration_seconds: number | null;
16
+ final_result: string | null;
17
+ created_at: string;
18
+ parent_session_id: string | null;
19
+ user_email: string | null;
20
+ }
21
+
22
+ export interface Event {
23
+ id: number;
24
+ session_id: string;
25
+ phase: string;
26
+ event_type: EventType;
27
+ message: string;
28
+ metadata: string | null;
29
+ tokens_used: number;
30
+ timestamp: string;
31
+ }
32
+
33
+ export type EventType =
34
+ | "decision"
35
+ | "action"
36
+ | "error"
37
+ | "fix"
38
+ | "info"
39
+ | "phase_change"
40
+ | "review_pass"
41
+ | "review_flag"
42
+ | "review_dispatch"
43
+ | "error_resolve"
44
+ | "cost_checkpoint"
45
+ | "pattern_detect"
46
+ | "knowledge_extract";
47
+
48
+ export interface Iteration {
49
+ id: number;
50
+ session_id: string;
51
+ iteration_number: number;
52
+ trigger: string;
53
+ error_summary: string;
54
+ fix_description: string | null;
55
+ files_changed: string | null;
56
+ result: "pass" | "fail" | "partial";
57
+ duration_seconds: number | null;
58
+ timestamp: string;
59
+ }
60
+
61
+ export interface Screenshot {
62
+ id: number;
63
+ session_id: string;
64
+ iteration_number: number | null;
65
+ phase: string;
66
+ description: string;
67
+ file_path: string;
68
+ stored_path: string | null;
69
+ thumb_path: string | null;
70
+ event_id: number | null;
71
+ timestamp: string;
72
+ }
73
+
74
+ export interface FinalResult {
75
+ tests_passed?: boolean;
76
+ lint_passed?: boolean;
77
+ typecheck_passed?: boolean;
78
+ pr_url?: string;
79
+ pr_number?: number;
80
+ }
81
+
82
+ export interface PlanStep {
83
+ id: number;
84
+ session_id: string;
85
+ step_number: number;
86
+ title: string;
87
+ description: string;
88
+ status: "pending" | "in_progress" | "completed" | "skipped" | "failed";
89
+ parent_step: number | null;
90
+ file_targets: string | null;
91
+ outcome: string | null;
92
+ started_at: string | null;
93
+ completed_at: string | null;
94
+ duration_seconds: number | null;
95
+ created_at: string;
96
+ }
97
+
98
+ export interface Insight {
99
+ id: number;
100
+ session_id: string;
101
+ insight_type: "mistake" | "success_pattern" | "codebase_gotcha" | "optimization" | "rule_learned";
102
+ category: string;
103
+ title: string;
104
+ description: string;
105
+ evidence: string | null;
106
+ confidence: number;
107
+ times_validated: number;
108
+ file_patterns: string | null;
109
+ error_patterns: string | null;
110
+ created_at: string;
111
+ }
112
+
113
+ export interface Artifact {
114
+ id: number;
115
+ session_id: string;
116
+ artifact_type: string;
117
+ description: string;
118
+ file_path: string;
119
+ stored_path: string | null;
120
+ mime_type: string | null;
121
+ file_size: number | null;
122
+ metadata: string | null;
123
+ event_id: number | null;
124
+ timestamp: string;
125
+ }
126
+
127
+ export interface Walkthrough {
128
+ id: number;
129
+ url: string;
130
+ app_name: string | null;
131
+ scenario: string | null;
132
+ status: "in_progress" | "pass" | "fail" | "partial";
133
+ summary: string | null;
134
+ total_actions: number;
135
+ passed: number;
136
+ failed: number;
137
+ started_at: string;
138
+ ended_at: string | null;
139
+ }
140
+
141
+ export interface WalkthroughAction {
142
+ id: number;
143
+ walkthrough_id: number;
144
+ action_type: "navigate" | "click" | "type" | "assert" | "wait" | "screenshot";
145
+ target: string;
146
+ value: string | null;
147
+ status: "pass" | "fail";
148
+ message: string | null;
149
+ timestamp: string;
150
+ }
151
+
152
+ export interface WalkthroughScreenshot {
153
+ id: number;
154
+ walkthrough_id: number;
155
+ action_id: number | null;
156
+ name: string;
157
+ annotation: string | null;
158
+ stored_path: string;
159
+ timestamp: string;
160
+ }
161
+
162
+ export interface SessionSummary {
163
+ session: Session;
164
+ events: Event[];
165
+ iterations: Iteration[];
166
+ screenshots: Screenshot[];
167
+ artifacts: Artifact[];
168
+ insights: Insight[];
169
+ plan_steps: PlanStep[];
170
+ child_sessions: Session[];
171
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "Node16",
5
+ "moduleResolution": "Node16",
6
+ "outDir": "./dist",
7
+ "rootDir": "./src",
8
+ "strict": true,
9
+ "esModuleInterop": true,
10
+ "skipLibCheck": true,
11
+ "forceConsistentCasingInFileNames": true,
12
+ "resolveJsonModule": true,
13
+ "declaration": true,
14
+ "declarationMap": true,
15
+ "sourceMap": true
16
+ },
17
+ "include": ["src/**/*"],
18
+ "exclude": ["node_modules", "dist", "frontend"]
19
+ }