@principal-ai/principal-view-core 0.28.8 → 0.28.10

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 (61) hide show
  1. package/dist/agent-sessions/fixture.d.ts +80 -0
  2. package/dist/agent-sessions/fixture.d.ts.map +1 -0
  3. package/dist/agent-sessions/fixture.js +130 -0
  4. package/dist/agent-sessions/fixture.js.map +1 -0
  5. package/dist/agent-sessions/index.d.ts +3 -0
  6. package/dist/agent-sessions/index.d.ts.map +1 -0
  7. package/dist/agent-sessions/index.js +6 -0
  8. package/dist/agent-sessions/index.js.map +1 -0
  9. package/dist/index.js +1 -0
  10. package/dist/index.js.map +1 -1
  11. package/dist/node.d.ts +8 -0
  12. package/dist/node.d.ts.map +1 -1
  13. package/dist/node.js +22 -2
  14. package/dist/node.js.map +1 -1
  15. package/dist/opencode/OpenCodeEventStore.d.ts +25 -0
  16. package/dist/opencode/OpenCodeEventStore.d.ts.map +1 -0
  17. package/dist/opencode/OpenCodeEventStore.js +182 -0
  18. package/dist/opencode/OpenCodeEventStore.js.map +1 -0
  19. package/dist/opencode/agent-sessions.d.ts +46 -0
  20. package/dist/opencode/agent-sessions.d.ts.map +1 -0
  21. package/dist/opencode/agent-sessions.js +219 -0
  22. package/dist/opencode/agent-sessions.js.map +1 -0
  23. package/dist/opencode/index.d.ts +6 -0
  24. package/dist/opencode/index.d.ts.map +1 -0
  25. package/dist/opencode/index.js +15 -0
  26. package/dist/opencode/index.js.map +1 -0
  27. package/dist/opencode/node-path-adapter.d.ts +25 -0
  28. package/dist/opencode/node-path-adapter.d.ts.map +1 -0
  29. package/dist/opencode/node-path-adapter.js +183 -0
  30. package/dist/opencode/node-path-adapter.js.map +1 -0
  31. package/dist/opencode/pipeline.d.ts +42 -0
  32. package/dist/opencode/pipeline.d.ts.map +1 -0
  33. package/dist/opencode/pipeline.js +90 -0
  34. package/dist/opencode/pipeline.js.map +1 -0
  35. package/dist/opencode/types.d.ts +39 -0
  36. package/dist/opencode/types.d.ts.map +1 -0
  37. package/dist/opencode/types.js +3 -0
  38. package/dist/opencode/types.js.map +1 -0
  39. package/dist/storage/topic-types.d.ts +14 -0
  40. package/dist/storage/topic-types.d.ts.map +1 -1
  41. package/dist/storage/topic-types.js +1 -0
  42. package/dist/storage/topic-types.js.map +1 -1
  43. package/dist/storage/topicStore.d.ts +1 -1
  44. package/dist/storage/topicStore.d.ts.map +1 -1
  45. package/package.json +10 -1
  46. package/src/agent-sessions/fixture.ts +225 -0
  47. package/src/agent-sessions/index.ts +10 -0
  48. package/src/index.ts +1 -0
  49. package/src/node.ts +31 -0
  50. package/src/opencode/EVENT_MAPPING.md +82 -0
  51. package/src/opencode/OpenCodeEventStore.ts +214 -0
  52. package/src/opencode/__fixtures__/event-shapes.json +443 -0
  53. package/src/opencode/__fixtures__/session-events.json +13491 -0
  54. package/src/opencode/agent-sessions.ts +282 -0
  55. package/src/opencode/index.ts +23 -0
  56. package/src/opencode/node-path-adapter.ts +199 -0
  57. package/src/opencode/pipeline.ts +141 -0
  58. package/src/opencode/types.ts +43 -0
  59. package/src/storage/topic-types.ts +15 -0
  60. package/src/storage/topicStore.test.ts +38 -1
  61. package/src/storage/topicStore.ts +1 -1
@@ -0,0 +1,214 @@
1
+ import Database from "better-sqlite3"
2
+ import type {
3
+ OpenCodeRawEvent,
4
+ OpenCodeSessionEvents,
5
+ OpenCodeEventRetriever,
6
+ OpenCodeStoreOptions,
7
+ SessionSummary,
8
+ SessionListResult,
9
+ } from "./types"
10
+
11
+ export function defaultOpenCodeDBPath(): string {
12
+ if (process.env.OPENCODE_DATA_DIR) return `${process.env.OPENCODE_DATA_DIR}/opencode/opencode.db`
13
+ const home = process.env.HOME || process.env.USERPROFILE || "/root"
14
+ const xdgData = process.env.XDG_DATA_HOME || `${home}/.local/share`
15
+ return `${xdgData}/opencode/opencode.db`
16
+ }
17
+
18
+ export class OpenCodeEventStore implements OpenCodeEventRetriever {
19
+ private db: Database.Database
20
+
21
+ constructor(options?: OpenCodeStoreOptions) {
22
+ const path = options?.dbPath ?? defaultOpenCodeDBPath()
23
+ this.db = new Database(path, { readonly: true })
24
+ }
25
+
26
+ getSessionMeta(sessionId: string): {
27
+ slug: string
28
+ title: string
29
+ directory: string
30
+ } {
31
+ try {
32
+ const row = this.db
33
+ .prepare("SELECT slug, title, directory FROM session WHERE id = ?")
34
+ .get(sessionId) as { slug?: string; title?: string; directory?: string } | null
35
+ if (row) {
36
+ return {
37
+ slug: row.slug ?? "",
38
+ title: row.title ?? "",
39
+ directory: row.directory ?? "",
40
+ }
41
+ }
42
+ } catch {
43
+ // session table may not exist in older DBs; fall through
44
+ }
45
+ return { slug: "", title: "", directory: "" }
46
+ }
47
+
48
+ readAggregate(
49
+ sessionId: string,
50
+ options?: { after?: number; limit?: number }
51
+ ): OpenCodeSessionEvents {
52
+ const after = options?.after ?? -1
53
+ const limit = options?.limit ?? 1000
54
+
55
+ const rows = this.db
56
+ .prepare(
57
+ "SELECT id, aggregate_id, seq, type, data FROM event WHERE aggregate_id = ? AND seq > ? ORDER BY seq ASC LIMIT ?"
58
+ )
59
+ .all(sessionId, after, limit + 1) as Array<{
60
+ id: string
61
+ aggregate_id: string
62
+ seq: number
63
+ type: string
64
+ data: string
65
+ }>
66
+
67
+ const page = rows.slice(0, limit)
68
+ const events: OpenCodeRawEvent[] = page.map((row) => ({
69
+ id: row.id,
70
+ aggregateId: row.aggregate_id,
71
+ seq: row.seq,
72
+ type: row.type,
73
+ data: typeof row.data === "string" ? JSON.parse(row.data) : row.data,
74
+ }))
75
+
76
+ return {
77
+ sessionId,
78
+ events,
79
+ hasMore: rows.length > limit,
80
+ }
81
+ }
82
+
83
+ listSessionIds(limit?: number): string[] {
84
+ const rows = this.db
85
+ .prepare("SELECT DISTINCT aggregate_id FROM event ORDER BY aggregate_id LIMIT ?")
86
+ .all(limit ?? 50) as Array<{ aggregate_id: string }>
87
+ return rows.map((r) => r.aggregate_id)
88
+ }
89
+
90
+ listSessionsWithSummaries(limit?: number): SessionListResult {
91
+ const effectiveLimit = limit ?? 50
92
+
93
+ const firstEvents = this.db
94
+ .prepare(
95
+ `SELECT e.aggregate_id, e.data,
96
+ (SELECT COUNT(*) FROM event WHERE aggregate_id = e.aggregate_id) AS event_count,
97
+ (SELECT MAX(json_extract(e2.data, '$.info.time.created')) FROM event e2 WHERE e2.aggregate_id = e.aggregate_id) AS last_created
98
+ FROM event e
99
+ WHERE e.seq = (SELECT MIN(e2.seq) FROM event e2 WHERE e2.aggregate_id = e.aggregate_id)
100
+ ORDER BY COALESCE(json_extract(e.data, '$.info.time.created'), 0) DESC
101
+ LIMIT ?`
102
+ )
103
+ .all(effectiveLimit) as Array<{ aggregate_id: string; data: string; event_count: number; last_created: number | null }>
104
+
105
+ const idToSummary = new Map<string, SessionSummary>()
106
+ for (const row of firstEvents) {
107
+ let title = row.aggregate_id.slice(0, 12)
108
+ let slug = ""
109
+ let createdAt = ""
110
+ let durationMs = 0
111
+ try {
112
+ const parsed = JSON.parse(row.data) as Record<string, unknown>
113
+ const info = parsed["info"] as Record<string, unknown> | undefined
114
+ const rawTitle = info?.["title"]
115
+ if (typeof rawTitle === "string") {
116
+ title = rawTitle
117
+ }
118
+ const rawSlug = info?.["slug"]
119
+ if (typeof rawSlug === "string") {
120
+ slug = rawSlug
121
+ }
122
+ const rawTime = info?.["time"] as Record<string, unknown> | undefined
123
+ const rawCreated = rawTime?.["created"]
124
+ if (typeof rawCreated === "number") {
125
+ createdAt = new Date(rawCreated).toISOString()
126
+ if (typeof row.last_created === "number") {
127
+ durationMs = row.last_created - rawCreated
128
+ }
129
+ }
130
+ } catch {
131
+ // best-effort parse
132
+ }
133
+ if (title.startsWith("New session")) {
134
+ const promptText = this.firstUserPromptText(row.aggregate_id)
135
+ if (promptText) title = promptText
136
+ }
137
+ idToSummary.set(row.aggregate_id, { id: row.aggregate_id, title, slug, createdAt, durationMs, eventCount: row.event_count, isFinished: false, children: [] })
138
+ }
139
+
140
+ const relations = this.db
141
+ .prepare(
142
+ `SELECT DISTINCT
143
+ json_extract(data, '$.part.state.metadata.parentSessionId') AS parent_id,
144
+ json_extract(data, '$.part.state.metadata.sessionId') AS child_id,
145
+ json_extract(data, '$.part.state.status') AS status
146
+ FROM event
147
+ WHERE json_extract(data, '$.part.type') = 'tool'
148
+ AND json_extract(data, '$.part.tool') = 'task'
149
+ AND json_extract(data, '$.part.state.metadata.sessionId') IS NOT NULL`
150
+ )
151
+ .all() as Array<{ parent_id: string; child_id: string; status: string | null }>
152
+
153
+ const childIds = new Set<string>()
154
+ for (const rel of relations) {
155
+ if (!rel.parent_id || !rel.child_id) continue
156
+ const child = idToSummary.get(rel.child_id)
157
+ if (child && (rel.status === "completed" || rel.status === "error")) {
158
+ child.isFinished = true
159
+ }
160
+ childIds.add(rel.child_id)
161
+ const parent = idToSummary.get(rel.parent_id)
162
+ if (parent && child) {
163
+ parent.children.push(child)
164
+ }
165
+ }
166
+
167
+ const groups: SessionListResult["groups"] = []
168
+ const standalone: SessionSummary[] = []
169
+ for (const summary of idToSummary.values()) {
170
+ if (childIds.has(summary.id)) continue
171
+ if (summary.children.length > 0) {
172
+ groups.push({ parent: { ...summary, children: [] }, children: summary.children })
173
+ } else {
174
+ standalone.push(summary)
175
+ }
176
+ }
177
+
178
+ return { groups, standalone }
179
+ }
180
+
181
+ /**
182
+ * opencode stores a placeholder title ("New session - <iso timestamp>") on
183
+ * sessions it never generated a title for. Surface the first real user prompt
184
+ * text instead so lists read as actual tasks.
185
+ */
186
+ firstUserPromptText(aggregateId: string): string {
187
+ const userMsg = this.db
188
+ .prepare(
189
+ `SELECT json_extract(data, '$.info.id') AS id
190
+ FROM event
191
+ WHERE aggregate_id = ? AND type = 'message.updated.1'
192
+ AND json_extract(data, '$.info.role') = 'user'
193
+ ORDER BY seq ASC LIMIT 1`
194
+ )
195
+ .get(aggregateId) as { id: string | null } | null
196
+ if (!userMsg?.id) return ""
197
+ const part = this.db
198
+ .prepare(
199
+ `SELECT json_extract(data, '$.part.text') AS text
200
+ FROM event
201
+ WHERE aggregate_id = ? AND type = 'message.part.updated.1'
202
+ AND json_extract(data, '$.part.messageID') = ?
203
+ AND json_extract(data, '$.part.type') = 'text'
204
+ ORDER BY seq ASC LIMIT 1`
205
+ )
206
+ .get(aggregateId, userMsg.id) as { text: string | null } | null
207
+ if (typeof part?.text !== "string" || part.text === "") return ""
208
+ return part.text.replace(/\s+/g, " ").trim()
209
+ }
210
+
211
+ close(): void {
212
+ this.db.close()
213
+ }
214
+ }
@@ -0,0 +1,443 @@
1
+ {
2
+ "session_created": {
3
+ "id": "evt_fa94e0fc90013Nsg3RORwfYWD3",
4
+ "aggregateId": "ses_056b1f037ffeu1d00DzvJBrHq9",
5
+ "seq": 0,
6
+ "type": "session.created.1",
7
+ "data": {
8
+ "sessionID": "ses_056b1f037ffeu1d00DzvJBrHq9",
9
+ "info": {
10
+ "id": "ses_056b1f037ffeu1d00DzvJBrHq9",
11
+ "slug": "crisp-engine",
12
+ "projectID": "012780c4098d08caa4ea8c479ed0a4690489f38d",
13
+ "directory": "/Users/griever/Developer/anomalyco/opencode",
14
+ "path": "",
15
+ "parentID": "ses_05c0f9500ffeXyvesb11BZ289i",
16
+ "cost": 0,
17
+ "tokens": {
18
+ "input": 0,
19
+ "output": 0,
20
+ "reasoning": 0,
21
+ "cache": {
22
+ "read": 0,
23
+ "write": 0
24
+ }
25
+ },
26
+ "title": "Explore visual-validation project structure (@explore subagent)",
27
+ "agent": "explore",
28
+ "version": "1.18.5",
29
+ "time": {
30
+ "created": 1785251893192,
31
+ "updated": 1785251893192
32
+ },
33
+ "permission": [
34
+ {
35
+ "permission": "todowrite",
36
+ "pattern": "*",
37
+ "action": "deny"
38
+ },
39
+ {
40
+ "permission": "task",
41
+ "pattern": "*",
42
+ "action": "deny"
43
+ }
44
+ ]
45
+ }
46
+ }
47
+ },
48
+ "session_updated": {
49
+ "id": "evt_fa94e0fce0015TWrExXenXVR8Y",
50
+ "aggregateId": "ses_056b1f037ffeu1d00DzvJBrHq9",
51
+ "seq": 1,
52
+ "type": "session.updated.1",
53
+ "data": {
54
+ "sessionID": "ses_056b1f037ffeu1d00DzvJBrHq9",
55
+ "info": {
56
+ "id": "ses_056b1f037ffeu1d00DzvJBrHq9",
57
+ "slug": "crisp-engine",
58
+ "projectID": "012780c4098d08caa4ea8c479ed0a4690489f38d",
59
+ "directory": "/Users/griever/Developer/anomalyco/opencode",
60
+ "path": "",
61
+ "parentID": "ses_05c0f9500ffeXyvesb11BZ289i",
62
+ "cost": 0,
63
+ "tokens": {
64
+ "input": 0,
65
+ "output": 0,
66
+ "reasoning": 0,
67
+ "cache": {
68
+ "read": 0,
69
+ "write": 0
70
+ }
71
+ },
72
+ "title": "Explore visual-validation project structure (@explore subagent)",
73
+ "agent": "explore",
74
+ "model": {
75
+ "id": "big-pickle",
76
+ "providerID": "opencode",
77
+ "variant": "default"
78
+ },
79
+ "version": "1.18.5",
80
+ "time": {
81
+ "created": 1785251893192,
82
+ "updated": 1785251893198
83
+ },
84
+ "permission": [
85
+ {
86
+ "permission": "todowrite",
87
+ "pattern": "*",
88
+ "action": "deny"
89
+ },
90
+ {
91
+ "permission": "task",
92
+ "pattern": "*",
93
+ "action": "deny"
94
+ }
95
+ ]
96
+ }
97
+ }
98
+ },
99
+ "message_updated_user": {
100
+ "id": "evt_fa94e0fcf0016FlVbWPuul9Zzh",
101
+ "aggregateId": "ses_056b1f037ffeu1d00DzvJBrHq9",
102
+ "seq": 2,
103
+ "type": "message.updated.1",
104
+ "data": {
105
+ "sessionID": "ses_056b1f037ffeu1d00DzvJBrHq9",
106
+ "info": {
107
+ "id": "msg_fa94e0fcd001mNukFF2luJrDa9",
108
+ "sessionID": "ses_056b1f037ffeu1d00DzvJBrHq9",
109
+ "role": "user",
110
+ "time": {
111
+ "created": 1785251893198
112
+ },
113
+ "agent": "explore",
114
+ "model": {
115
+ "providerID": "opencode",
116
+ "modelID": "big-pickle"
117
+ }
118
+ }
119
+ }
120
+ },
121
+ "part_text": {
122
+ "id": "evt_fa94e0fd00013fDRfH6AbOFGtK",
123
+ "aggregateId": "ses_056b1f037ffeu1d00DzvJBrHq9",
124
+ "seq": 3,
125
+ "type": "message.part.updated.1",
126
+ "data": {
127
+ "sessionID": "ses_056b1f037ffeu1d00DzvJBrHq9",
128
+ "part": {
129
+ "id": "prt_fa94e0fcf001yrkTQHNbuochNi",
130
+ "sessionID": "ses_056b1f037ffeu1d00DzvJBrHq9",
131
+ "messageID": "msg_fa94e0fcd001mNukFF2luJrDa9",
132
+ "type": "text",
133
+ "text": "Explore the project at /Users/griever/Developer/visual-validation/principal-view-core-library thoroughly.\n\nI need to understand:\n1. The full directory tree (packages, their names, package.json \"name\" fields)\n2. How packages are organized (monorepo? workspaces?)\n3. Each package's src/ structure\n4. Whether there's a CLI package already and how it works\n5. The build system (tsconfig, bundler)\n6. Any existing patterns for how packages export and consume from each other\n7. The coding style (lint rules, formatting conventions)\n8. Whether there are any existing tests and how they run\n\nReturn all findings in detail - directory trees, key file contents (package.json files, tsconfig files, entry points, CLI setup, etc)."
134
+ },
135
+ "time": 1785251893200
136
+ }
137
+ },
138
+ "message_updated_assistant": {
139
+ "id": "evt_fa94e0fd4001RKjfpMo53ttrQp",
140
+ "aggregateId": "ses_056b1f037ffeu1d00DzvJBrHq9",
141
+ "seq": 5,
142
+ "type": "message.updated.1",
143
+ "data": {
144
+ "sessionID": "ses_056b1f037ffeu1d00DzvJBrHq9",
145
+ "info": {
146
+ "id": "msg_fa94e0fd3001KxGfrkWOlzY3nI",
147
+ "sessionID": "ses_056b1f037ffeu1d00DzvJBrHq9",
148
+ "role": "assistant",
149
+ "time": {
150
+ "created": 1785251893203
151
+ },
152
+ "parentID": "msg_fa94e0fcd001mNukFF2luJrDa9",
153
+ "modelID": "big-pickle",
154
+ "providerID": "opencode",
155
+ "mode": "explore",
156
+ "agent": "explore",
157
+ "path": {
158
+ "cwd": "/Users/griever/Developer/anomalyco/opencode",
159
+ "root": "/Users/griever/Developer/anomalyco/opencode"
160
+ },
161
+ "cost": 0,
162
+ "tokens": {
163
+ "input": 0,
164
+ "output": 0,
165
+ "reasoning": 0,
166
+ "cache": {
167
+ "read": 0,
168
+ "write": 0
169
+ }
170
+ }
171
+ }
172
+ }
173
+ },
174
+ "part_step_start": {
175
+ "id": "evt_fa94e12a5001xi82JTHXPUDY0x",
176
+ "aggregateId": "ses_056b1f037ffeu1d00DzvJBrHq9",
177
+ "seq": 8,
178
+ "type": "message.part.updated.1",
179
+ "data": {
180
+ "sessionID": "ses_056b1f037ffeu1d00DzvJBrHq9",
181
+ "part": {
182
+ "id": "prt_fa94e12a5001zOHBrA3ZhAeaFI",
183
+ "sessionID": "ses_056b1f037ffeu1d00DzvJBrHq9",
184
+ "messageID": "msg_fa94e0fd3001KxGfrkWOlzY3nI",
185
+ "type": "step-start",
186
+ "snapshot": "a852100f05c5dfef7f6f3c89cb89315d4d4b8786"
187
+ },
188
+ "time": 1785251893925
189
+ }
190
+ },
191
+ "part_reasoning": {
192
+ "id": "evt_fa94e13f8001zimaKgvd1c4Av0",
193
+ "aggregateId": "ses_056b1f037ffeu1d00DzvJBrHq9",
194
+ "seq": 9,
195
+ "type": "message.part.updated.1",
196
+ "data": {
197
+ "sessionID": "ses_056b1f037ffeu1d00DzvJBrHq9",
198
+ "part": {
199
+ "id": "prt_fa94e13f8001tHhvUrGNaUHIbJ",
200
+ "sessionID": "ses_056b1f037ffeu1d00DzvJBrHq9",
201
+ "messageID": "msg_fa94e0fd3001KxGfrkWOlzY3nI",
202
+ "type": "reasoning",
203
+ "text": "",
204
+ "time": {
205
+ "start": 1785251894264
206
+ }
207
+ },
208
+ "time": 1785251894264
209
+ }
210
+ },
211
+ "part_tool_pending": {
212
+ "id": "evt_fa94e1635001GVRqWmHJzxNKs7",
213
+ "aggregateId": "ses_056b1f037ffeu1d00DzvJBrHq9",
214
+ "seq": 12,
215
+ "type": "message.part.updated.1",
216
+ "data": {
217
+ "sessionID": "ses_056b1f037ffeu1d00DzvJBrHq9",
218
+ "part": {
219
+ "id": "prt_fa94e1635001r7u6KM55fJvfzD",
220
+ "sessionID": "ses_056b1f037ffeu1d00DzvJBrHq9",
221
+ "messageID": "msg_fa94e0fd3001KxGfrkWOlzY3nI",
222
+ "type": "tool",
223
+ "callID": "call_00_NOzeOxB9QejDnwh5ijo91971",
224
+ "tool": "read",
225
+ "state": {
226
+ "status": "pending",
227
+ "input": {},
228
+ "raw": ""
229
+ }
230
+ },
231
+ "time": 1785251894837
232
+ }
233
+ },
234
+ "part_tool_running": {
235
+ "id": "evt_fa94e16bd001oZjNe9eJ3NeBtb",
236
+ "aggregateId": "ses_056b1f037ffeu1d00DzvJBrHq9",
237
+ "seq": 13,
238
+ "type": "message.part.updated.1",
239
+ "data": {
240
+ "sessionID": "ses_056b1f037ffeu1d00DzvJBrHq9",
241
+ "part": {
242
+ "id": "prt_fa94e1635001r7u6KM55fJvfzD",
243
+ "sessionID": "ses_056b1f037ffeu1d00DzvJBrHq9",
244
+ "messageID": "msg_fa94e0fd3001KxGfrkWOlzY3nI",
245
+ "type": "tool",
246
+ "callID": "call_00_NOzeOxB9QejDnwh5ijo91971",
247
+ "tool": "read",
248
+ "state": {
249
+ "status": "running",
250
+ "input": {
251
+ "filePath": "/Users/griever/Developer/visual-validation/principal-view-core-library"
252
+ },
253
+ "time": {
254
+ "start": 1785251894973
255
+ }
256
+ }
257
+ },
258
+ "time": 1785251894973
259
+ }
260
+ },
261
+ "part_tool_completed": {
262
+ "id": "evt_fa94e2704001VbMcOKizeBLRyj",
263
+ "aggregateId": "ses_056b1f037ffeu1d00DzvJBrHq9",
264
+ "seq": 19,
265
+ "type": "message.part.updated.1",
266
+ "data": {
267
+ "sessionID": "ses_056b1f037ffeu1d00DzvJBrHq9",
268
+ "part": {
269
+ "id": "prt_fa94e1635001r7u6KM55fJvfzD",
270
+ "sessionID": "ses_056b1f037ffeu1d00DzvJBrHq9",
271
+ "messageID": "msg_fa94e0fd3001KxGfrkWOlzY3nI",
272
+ "type": "tool",
273
+ "callID": "call_00_NOzeOxB9QejDnwh5ijo91971",
274
+ "tool": "read",
275
+ "state": {
276
+ "status": "completed",
277
+ "input": {
278
+ "filePath": "/Users/griever/Developer/visual-validation/principal-view-core-library"
279
+ },
280
+ "output": "<path>/Users/griever/Developer/visual-validation/principal-view-core-library</path>\n<type>directory</type>\n<entries>\n.claude/\n.DS_Store\n.eslintignore\n.eslintrc.js\n.git/\n.github/\n.gitignore\n.husky/\n.nvmrc\n.prettierignore\n.prettierrc\n.principal-views/\n.privurc.yaml\nbacklog/\nbun.lock\nCLAUDE.md\ndocs/\nLICENSE\nnode_modules/\npackage-lock.json\npackage.json\npackages/\nREADME.md\nscripts/\nskills/\ntsconfig.base.json\n\n(26 entries)\n</entries>",
281
+ "title": "../../visual-validation/principal-view-core-library",
282
+ "metadata": {
283
+ "preview": ".claude/\n.DS_Store\n.eslintignore\n.eslintrc.js\n.git/\n.github/\n.gitignore\n.husky/\n.nvmrc\n.prettierignore\n.prettierrc\n.principal-views/\n.privurc.yaml\nbacklog/\nbun.lock\nCLAUDE.md\ndocs/\nLICENSE\nnode_modules/\npackage-lock.json",
284
+ "truncated": false,
285
+ "loaded": [],
286
+ "display": {
287
+ "type": "directory",
288
+ "path": "/Users/griever/Developer/visual-validation/principal-view-core-library",
289
+ "entries": [
290
+ ".claude/",
291
+ ".DS_Store",
292
+ ".eslintignore",
293
+ ".eslintrc.js",
294
+ ".git/",
295
+ ".github/",
296
+ ".gitignore",
297
+ ".husky/",
298
+ ".nvmrc",
299
+ ".prettierignore",
300
+ ".prettierrc",
301
+ ".principal-views/",
302
+ ".privurc.yaml",
303
+ "backlog/",
304
+ "bun.lock",
305
+ "CLAUDE.md",
306
+ "docs/",
307
+ "LICENSE",
308
+ "node_modules/",
309
+ "package-lock.json",
310
+ "package.json",
311
+ "packages/",
312
+ "README.md",
313
+ "scripts/",
314
+ "skills/",
315
+ "tsconfig.base.json"
316
+ ],
317
+ "offset": 1,
318
+ "totalEntries": 26,
319
+ "truncated": false
320
+ }
321
+ },
322
+ "time": {
323
+ "start": 1785251894973,
324
+ "end": 1785251899140
325
+ }
326
+ }
327
+ },
328
+ "time": 1785251899140
329
+ }
330
+ },
331
+ "part_step_finish": {
332
+ "id": "evt_fa94e2754001bYhIByv8sc42yQ",
333
+ "aggregateId": "ses_056b1f037ffeu1d00DzvJBrHq9",
334
+ "seq": 22,
335
+ "type": "message.part.updated.1",
336
+ "data": {
337
+ "sessionID": "ses_056b1f037ffeu1d00DzvJBrHq9",
338
+ "part": {
339
+ "id": "prt_fa94e2754001BOKZcfkTUKwRFY",
340
+ "sessionID": "ses_056b1f037ffeu1d00DzvJBrHq9",
341
+ "messageID": "msg_fa94e0fd3001KxGfrkWOlzY3nI",
342
+ "type": "step-finish",
343
+ "reason": "tool-calls",
344
+ "snapshot": "a852100f05c5dfef7f6f3c89cb89315d4d4b8786",
345
+ "cost": 0,
346
+ "tokens": {
347
+ "total": 6128,
348
+ "input": 5891,
349
+ "output": 200,
350
+ "reasoning": 37,
351
+ "cache": {
352
+ "read": 0,
353
+ "write": 0
354
+ }
355
+ }
356
+ },
357
+ "time": 1785251899220
358
+ }
359
+ },
360
+ "part_patch": {
361
+ "id": "evt_fa5cb44450016n0qj8puWZsfKJ",
362
+ "aggregateId": "ses_05a3cb415ffe72uEHtK7nMXGZH",
363
+ "seq": 295,
364
+ "type": "message.part.updated.1",
365
+ "data": {
366
+ "sessionID": "ses_05a3cb415ffe72uEHtK7nMXGZH",
367
+ "part": {
368
+ "id": "prt_fa5cb44450018vdatsgKZy3W2S",
369
+ "sessionID": "ses_05a3cb415ffe72uEHtK7nMXGZH",
370
+ "messageID": "msg_fa5cb0c050014q4mPXUVwtLyFD",
371
+ "type": "patch",
372
+ "hash": "151cdcde099944ff994c225ce448cf63abaa5f9f",
373
+ "files": [
374
+ "/Users/griever/Developer/principal-ade/industry-themed-file-city-panels/src/panels/FileCityGuidePanel/FileCityGuidePanel.stories.tsx"
375
+ ]
376
+ },
377
+ "time": 1785192989765
378
+ }
379
+ },
380
+ "part_tool_error": {
381
+ "id": "evt_fa4d13ca4001laSheFromQyD4Z",
382
+ "aggregateId": "ses_05b2ecdafffeb1XrCKHrXQScqR",
383
+ "seq": 15,
384
+ "type": "message.part.updated.1",
385
+ "data": {
386
+ "sessionID": "ses_05b2ecdafffeb1XrCKHrXQScqR",
387
+ "part": {
388
+ "id": "prt_fa4d13c8f001TWkOBPKrcjRFCM",
389
+ "sessionID": "ses_05b2ecdafffeb1XrCKHrXQScqR",
390
+ "messageID": "msg_fa4d13291001u990hpfC0kcnOb",
391
+ "type": "tool",
392
+ "callID": "b80b4829-875d-4347-80af-2311244ce849",
393
+ "tool": "grep",
394
+ "state": {
395
+ "status": "error",
396
+ "input": {
397
+ "pattern": "download",
398
+ "include": "*.html"
399
+ },
400
+ "error": "Ripgrep JSON record exceeded 65536 bytes",
401
+ "time": {
402
+ "start": 1785176603793,
403
+ "end": 1785176603812
404
+ }
405
+ }
406
+ },
407
+ "time": 1785176603812
408
+ }
409
+ },
410
+ "part_compaction": {
411
+ "id": "evt_fa4ebd44b0024vGiNP2pLu9473",
412
+ "aggregateId": "ses_05b386b56ffeNAaPIv7C7vGNFn",
413
+ "seq": 1630,
414
+ "type": "message.part.updated.1",
415
+ "data": {
416
+ "sessionID": "ses_05b386b56ffeNAaPIv7C7vGNFn",
417
+ "part": {
418
+ "id": "prt_fa4ebd44b002rFhO5RNBGMN1XD",
419
+ "sessionID": "ses_05b386b56ffeNAaPIv7C7vGNFn",
420
+ "messageID": "msg_fa4ebd44b0011LoJK562BGBI9M",
421
+ "type": "compaction",
422
+ "auto": true,
423
+ "overflow": false
424
+ },
425
+ "time": 1785178346571
426
+ }
427
+ },
428
+ "message_removed": {
429
+ "id": "evt_f5ee4c7d9001Pe0J0TgpUtjfVt",
430
+ "aggregateId": "ses_0a1b1d126ffea0vrJw6umQ0o49",
431
+ "seq": 2469,
432
+ "type": "message.removed.1",
433
+ "data": {
434
+ "sessionID": "ses_0a1b1d126ffea0vrJw6umQ0o49",
435
+ "messageID": "msg_f5ee45aed0018D71DovEqBGrfi"
436
+ }
437
+ },
438
+ "_meta": {
439
+ "extracted_from_sessions": 5,
440
+ "count": 15,
441
+ "missing": []
442
+ }
443
+ }