htmlgraph 0.28.5__py3-none-any.whl → 0.28.7__py3-none-any.whl
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.
- htmlgraph/__init__.py +1 -1
- htmlgraph/api/main.py +28 -17
- htmlgraph/db/schema.py +7 -2
- htmlgraph/hooks/event_tracker.py +30 -25
- htmlgraph/hooks/pretooluse.py +3 -2
- {htmlgraph-0.28.5.dist-info → htmlgraph-0.28.7.dist-info}/METADATA +1 -1
- {htmlgraph-0.28.5.dist-info → htmlgraph-0.28.7.dist-info}/RECORD +13 -13
- {htmlgraph-0.28.5.data → htmlgraph-0.28.7.data}/data/htmlgraph/styles.css +0 -0
- {htmlgraph-0.28.5.data → htmlgraph-0.28.7.data}/data/htmlgraph/templates/AGENTS.md.template +0 -0
- {htmlgraph-0.28.5.data → htmlgraph-0.28.7.data}/data/htmlgraph/templates/CLAUDE.md.template +0 -0
- {htmlgraph-0.28.5.data → htmlgraph-0.28.7.data}/data/htmlgraph/templates/GEMINI.md.template +0 -0
- {htmlgraph-0.28.5.dist-info → htmlgraph-0.28.7.dist-info}/WHEEL +0 -0
- {htmlgraph-0.28.5.dist-info → htmlgraph-0.28.7.dist-info}/entry_points.txt +0 -0
htmlgraph/__init__.py
CHANGED
htmlgraph/api/main.py
CHANGED
|
@@ -85,6 +85,7 @@ class EventModel(BaseModel):
|
|
|
85
85
|
timestamp: str
|
|
86
86
|
tool_name: str | None = None
|
|
87
87
|
input_summary: str | None = None
|
|
88
|
+
tool_input: dict | None = None
|
|
88
89
|
output_summary: str | None = None
|
|
89
90
|
session_id: str
|
|
90
91
|
feature_id: str | None = None
|
|
@@ -469,7 +470,7 @@ def get_app(db_path: str) -> FastAPI:
|
|
|
469
470
|
# Optimized with column selection and proper indexing
|
|
470
471
|
query = """
|
|
471
472
|
SELECT e.event_id, e.agent_id, e.event_type, e.timestamp, e.tool_name,
|
|
472
|
-
e.input_summary, e.output_summary, e.session_id,
|
|
473
|
+
e.input_summary, e.tool_input, e.output_summary, e.session_id,
|
|
473
474
|
e.parent_event_id, e.status, e.model, e.feature_id
|
|
474
475
|
FROM agent_events e
|
|
475
476
|
WHERE 1=1
|
|
@@ -494,23 +495,33 @@ def get_app(db_path: str) -> FastAPI:
|
|
|
494
495
|
exec_time_ms = (time.time() - exec_start) * 1000
|
|
495
496
|
|
|
496
497
|
# Build result models
|
|
497
|
-
results = [
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
498
|
+
results = []
|
|
499
|
+
for row in rows:
|
|
500
|
+
# Parse tool_input JSON if present
|
|
501
|
+
tool_input = None
|
|
502
|
+
if row[6]:
|
|
503
|
+
try:
|
|
504
|
+
tool_input = json.loads(row[6])
|
|
505
|
+
except json.JSONDecodeError:
|
|
506
|
+
pass
|
|
507
|
+
|
|
508
|
+
results.append(
|
|
509
|
+
EventModel(
|
|
510
|
+
event_id=row[0],
|
|
511
|
+
agent_id=row[1] or "unknown",
|
|
512
|
+
event_type=row[2],
|
|
513
|
+
timestamp=row[3],
|
|
514
|
+
tool_name=row[4],
|
|
515
|
+
input_summary=row[5],
|
|
516
|
+
tool_input=tool_input,
|
|
517
|
+
output_summary=row[7],
|
|
518
|
+
session_id=row[8],
|
|
519
|
+
parent_event_id=row[9],
|
|
520
|
+
status=row[10],
|
|
521
|
+
model=row[11],
|
|
522
|
+
feature_id=row[12],
|
|
523
|
+
)
|
|
511
524
|
)
|
|
512
|
-
for row in rows
|
|
513
|
-
]
|
|
514
525
|
|
|
515
526
|
# Cache the results
|
|
516
527
|
cache.set(cache_key, results)
|
htmlgraph/db/schema.py
CHANGED
|
@@ -106,6 +106,7 @@ class HtmlGraphDB:
|
|
|
106
106
|
("updated_at", "DATETIME DEFAULT CURRENT_TIMESTAMP"),
|
|
107
107
|
("model", "TEXT"),
|
|
108
108
|
("claude_task_id", "TEXT"),
|
|
109
|
+
("tool_input", "JSON"),
|
|
109
110
|
]
|
|
110
111
|
|
|
111
112
|
for col_name, col_type in migrations:
|
|
@@ -232,6 +233,7 @@ class HtmlGraphDB:
|
|
|
232
233
|
timestamp DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
233
234
|
tool_name TEXT,
|
|
234
235
|
input_summary TEXT,
|
|
236
|
+
tool_input JSON,
|
|
235
237
|
output_summary TEXT,
|
|
236
238
|
context JSON,
|
|
237
239
|
session_id TEXT NOT NULL,
|
|
@@ -709,6 +711,7 @@ class HtmlGraphDB:
|
|
|
709
711
|
session_id: str,
|
|
710
712
|
tool_name: str | None = None,
|
|
711
713
|
input_summary: str | None = None,
|
|
714
|
+
tool_input: dict[str, Any] | None = None,
|
|
712
715
|
output_summary: str | None = None,
|
|
713
716
|
context: dict[str, Any] | None = None,
|
|
714
717
|
parent_agent_id: str | None = None,
|
|
@@ -735,6 +738,7 @@ class HtmlGraphDB:
|
|
|
735
738
|
session_id: Session this event belongs to
|
|
736
739
|
tool_name: Tool that was called (optional)
|
|
737
740
|
input_summary: Summary of tool input (optional)
|
|
741
|
+
tool_input: Raw tool input as JSON (optional)
|
|
738
742
|
output_summary: Summary of tool output (optional)
|
|
739
743
|
context: Additional metadata as JSON (optional)
|
|
740
744
|
parent_agent_id: Parent agent if delegated (optional)
|
|
@@ -761,9 +765,9 @@ class HtmlGraphDB:
|
|
|
761
765
|
"""
|
|
762
766
|
INSERT INTO agent_events
|
|
763
767
|
(event_id, agent_id, event_type, session_id, feature_id, tool_name,
|
|
764
|
-
input_summary, output_summary, context, parent_agent_id,
|
|
768
|
+
input_summary, tool_input, output_summary, context, parent_agent_id,
|
|
765
769
|
parent_event_id, cost_tokens, execution_duration_seconds, subagent_type, model, claude_task_id)
|
|
766
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
770
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
767
771
|
""",
|
|
768
772
|
(
|
|
769
773
|
event_id,
|
|
@@ -773,6 +777,7 @@ class HtmlGraphDB:
|
|
|
773
777
|
feature_id,
|
|
774
778
|
tool_name,
|
|
775
779
|
input_summary,
|
|
780
|
+
json.dumps(tool_input) if tool_input else None,
|
|
776
781
|
output_summary,
|
|
777
782
|
json.dumps(context) if context else None,
|
|
778
783
|
parent_agent_id,
|
htmlgraph/hooks/event_tracker.py
CHANGED
|
@@ -491,51 +491,56 @@ def extract_file_paths(tool_input: dict[str, Any], tool_name: str) -> list[str]:
|
|
|
491
491
|
def format_tool_summary(
|
|
492
492
|
tool_name: str, tool_input: dict[str, Any], tool_result: dict | None = None
|
|
493
493
|
) -> str:
|
|
494
|
-
"""
|
|
494
|
+
"""
|
|
495
|
+
Format a human-readable summary of the tool call.
|
|
496
|
+
|
|
497
|
+
Returns only the description part (without tool name prefix) since tool_name
|
|
498
|
+
is stored as a separate field in the database. Frontend can format as needed.
|
|
499
|
+
"""
|
|
495
500
|
if tool_name == "Read":
|
|
496
|
-
path = tool_input.get("file_path", "unknown")
|
|
497
|
-
return
|
|
501
|
+
path = str(tool_input.get("file_path", "unknown"))
|
|
502
|
+
return path
|
|
498
503
|
|
|
499
504
|
elif tool_name == "Write":
|
|
500
|
-
path = tool_input.get("file_path", "unknown")
|
|
501
|
-
return
|
|
505
|
+
path = str(tool_input.get("file_path", "unknown"))
|
|
506
|
+
return path
|
|
502
507
|
|
|
503
508
|
elif tool_name == "Edit":
|
|
504
|
-
path = tool_input.get("file_path", "unknown")
|
|
505
|
-
old = tool_input.get("old_string", "")[:30]
|
|
506
|
-
return f"
|
|
509
|
+
path = str(tool_input.get("file_path", "unknown"))
|
|
510
|
+
old = str(tool_input.get("old_string", ""))[:30]
|
|
511
|
+
return f"{path} ({old}...)"
|
|
507
512
|
|
|
508
513
|
elif tool_name == "Bash":
|
|
509
|
-
cmd = tool_input.get("command", "")[:60]
|
|
510
|
-
desc = tool_input.get("description", "")
|
|
514
|
+
cmd = str(tool_input.get("command", ""))[:60]
|
|
515
|
+
desc = str(tool_input.get("description", ""))
|
|
511
516
|
if desc:
|
|
512
|
-
return
|
|
513
|
-
return
|
|
517
|
+
return desc
|
|
518
|
+
return cmd
|
|
514
519
|
|
|
515
520
|
elif tool_name == "Glob":
|
|
516
|
-
pattern = tool_input.get("pattern", "")
|
|
517
|
-
return
|
|
521
|
+
pattern = str(tool_input.get("pattern", ""))
|
|
522
|
+
return pattern
|
|
518
523
|
|
|
519
524
|
elif tool_name == "Grep":
|
|
520
|
-
pattern = tool_input.get("pattern", "")
|
|
521
|
-
return
|
|
525
|
+
pattern = str(tool_input.get("pattern", ""))
|
|
526
|
+
return pattern
|
|
522
527
|
|
|
523
528
|
elif tool_name == "Task":
|
|
524
|
-
desc = tool_input.get("description", "")[:50]
|
|
525
|
-
agent = tool_input.get("subagent_type", "")
|
|
526
|
-
return f"
|
|
529
|
+
desc = str(tool_input.get("description", ""))[:50]
|
|
530
|
+
agent = str(tool_input.get("subagent_type", ""))
|
|
531
|
+
return f"({agent}): {desc}"
|
|
527
532
|
|
|
528
533
|
elif tool_name == "TodoWrite":
|
|
529
534
|
todos = tool_input.get("todos", [])
|
|
530
|
-
return f"
|
|
535
|
+
return f"{len(todos)} items"
|
|
531
536
|
|
|
532
537
|
elif tool_name == "WebSearch":
|
|
533
|
-
query = tool_input.get("query", "")[:40]
|
|
534
|
-
return
|
|
538
|
+
query = str(tool_input.get("query", ""))[:40]
|
|
539
|
+
return query
|
|
535
540
|
|
|
536
541
|
elif tool_name == "WebFetch":
|
|
537
|
-
url = tool_input.get("url", "")[:40]
|
|
538
|
-
return
|
|
542
|
+
url = str(tool_input.get("url", ""))[:40]
|
|
543
|
+
return url
|
|
539
544
|
|
|
540
545
|
elif tool_name == "UserQuery":
|
|
541
546
|
# Extract the actual prompt text from the tool_input
|
|
@@ -546,7 +551,7 @@ def format_tool_summary(
|
|
|
546
551
|
return preview
|
|
547
552
|
|
|
548
553
|
else:
|
|
549
|
-
return
|
|
554
|
+
return str(tool_input)[:50]
|
|
550
555
|
|
|
551
556
|
|
|
552
557
|
def record_event_to_sqlite(
|
htmlgraph/hooks/pretooluse.py
CHANGED
|
@@ -417,8 +417,8 @@ def create_start_event(
|
|
|
417
417
|
"""
|
|
418
418
|
INSERT INTO agent_events
|
|
419
419
|
(event_id, agent_id, event_type, timestamp, tool_name,
|
|
420
|
-
input_summary, session_id, status, parent_event_id)
|
|
421
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
420
|
+
input_summary, tool_input, session_id, status, parent_event_id)
|
|
421
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
422
422
|
""",
|
|
423
423
|
(
|
|
424
424
|
event_id,
|
|
@@ -427,6 +427,7 @@ def create_start_event(
|
|
|
427
427
|
start_time,
|
|
428
428
|
tool_name,
|
|
429
429
|
input_summary,
|
|
430
|
+
json.dumps(sanitized_input), # Store raw input as JSON
|
|
430
431
|
session_id,
|
|
431
432
|
"recorded",
|
|
432
433
|
parent_event_id, # Link to UserQuery or Task parent
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: htmlgraph
|
|
3
|
-
Version: 0.28.
|
|
3
|
+
Version: 0.28.7
|
|
4
4
|
Summary: HTML is All You Need - Graph database on web standards
|
|
5
5
|
Project-URL: Homepage, https://github.com/Shakes-tzd/htmlgraph
|
|
6
6
|
Project-URL: Documentation, https://github.com/Shakes-tzd/htmlgraph#readme
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
htmlgraph/__init__.py,sha256=
|
|
1
|
+
htmlgraph/__init__.py,sha256=bYHS0jEp8wRE4eKX-97IxEVaJLZHbpk9dXrkTfah-8Q,6595
|
|
2
2
|
htmlgraph/__init__.pyi,sha256=8JuFVuDll9jMx9s8ZQHt2tXic-geOJHiXUMB2YjmHhU,6683
|
|
3
3
|
htmlgraph/agent_detection.py,sha256=wEmrDv4hssPX2OkEnJZBHPbalxcaloiJF_hOOow_5WE,3511
|
|
4
4
|
htmlgraph/agent_registry.py,sha256=80TPYr4P0YMizPUbTH4N5wH6D84IKs-HPBLHGeeP6bY,9449
|
|
@@ -97,7 +97,7 @@ htmlgraph/api/broadcast.py,sha256=G2vsgbUFOeahy8l1GJwu5X2yBJAID02lgNXxyDMexx0,90
|
|
|
97
97
|
htmlgraph/api/broadcast_routes.py,sha256=OJQaUx6_izB_TlyL5N7tzTx3nD9sFs3RUhehlRtl_3k,11376
|
|
98
98
|
htmlgraph/api/broadcast_websocket.py,sha256=ZTHmLsYCExaCkHiDD7LNKQaAjaTQadNoO4OZOrGsU3Q,3822
|
|
99
99
|
htmlgraph/api/cost_alerts_websocket.py,sha256=jmPJ0kO7PKXYe-MwN0rReQ6ACa6E--p9DaMCqDDs3IE,14478
|
|
100
|
-
htmlgraph/api/main.py,sha256=
|
|
100
|
+
htmlgraph/api/main.py,sha256=UValgmvNF_BTqy-caB02k8-27xxt1zk5Af4efL9LF9Y,103438
|
|
101
101
|
htmlgraph/api/offline.py,sha256=u6RbmeoDPvPsFJYsTNhFZ6yoNE0bgYXFzUi2g2pmeYU,25881
|
|
102
102
|
htmlgraph/api/presence.py,sha256=eF7j5yp7lgO9tF0_VMdE0zeWrUYIAYhgOUHSKe8dr70,14246
|
|
103
103
|
htmlgraph/api/reactive.py,sha256=WW8bBCiu9RBCgNeKE-fohvklJNBnvWj_zdllPkZun2M,14941
|
|
@@ -196,7 +196,7 @@ htmlgraph/cost_analysis/__init__.py,sha256=kuAA4Fd0gUplOWOiqs3CF4eO1wwekGs_3DaiF
|
|
|
196
196
|
htmlgraph/cost_analysis/analyzer.py,sha256=TDKgRXeOQ-td5LZhkFob4ajEf-JssSCGKlMS3GysYJU,15040
|
|
197
197
|
htmlgraph/db/__init__.py,sha256=1yWTyWrN2kcmW6mVKCUf4POSUXTOSaAljwEyyC0Xs1w,1033
|
|
198
198
|
htmlgraph/db/queries.py,sha256=FtqOIBJC0EociEYNJr6gTVROqd9m5yZdVGYLxXNVSdk,22608
|
|
199
|
-
htmlgraph/db/schema.py,sha256=
|
|
199
|
+
htmlgraph/db/schema.py,sha256=ZYot5JyRmVDpujwLfZgCA0r_UVRg9VJMHja8A46ad4c,79174
|
|
200
200
|
htmlgraph/docs/API_REFERENCE.md,sha256=LYsYeHinF6GEsjMvrgdQSbgmMPsOh4ZQ1WK11niqNvo,17862
|
|
201
201
|
htmlgraph/docs/HTTP_API.md,sha256=IrX-wZckFn-K3ztCVcT-zyGqJL2TtY1qYV7dUuC7kzc,13344
|
|
202
202
|
htmlgraph/docs/INTEGRATION_GUIDE.md,sha256=uNNM0ipY0bFAkZaL1CkvnA_Wt2MVPGRBdA4927cZaHo,16910
|
|
@@ -226,7 +226,7 @@ htmlgraph/hooks/cigs_pretool_enforcer.py,sha256=LC5y5IrKdTx2aq5ht5U7Tceq0k63-7EI
|
|
|
226
226
|
htmlgraph/hooks/concurrent_sessions.py,sha256=qOiwDfynphVG0-2pVBakEzOwMORU8ebN1gMjcN4S0z0,6476
|
|
227
227
|
htmlgraph/hooks/context.py,sha256=tJ4dIL8uTFHyqyuuMc-ETDuOikeD5cN3Mdjmfg6W0HE,13108
|
|
228
228
|
htmlgraph/hooks/drift_handler.py,sha256=UchkeVmjgI6J4NE4vKNTHsY6ZorvUHvp1FOfwTEY-Cs,17626
|
|
229
|
-
htmlgraph/hooks/event_tracker.py,sha256=
|
|
229
|
+
htmlgraph/hooks/event_tracker.py,sha256=Q_K6t670XvgoLSQuZPnafKyOCAMxYpOJfrO7Ba2h97c,54425
|
|
230
230
|
htmlgraph/hooks/git_commands.py,sha256=NPzthfzGJ_bkDi7soehHOxI9FLL-6BL8Tie9Byb_zf4,4803
|
|
231
231
|
htmlgraph/hooks/hooks-config.example.json,sha256=tXpk-U-FZzGOoNJK2uiDMbIHCYEHA794J-El0fBwkqg,197
|
|
232
232
|
htmlgraph/hooks/installer.py,sha256=NdZHOER7DHFyZYXiZIS-CgLt1ZUxJ4O4ju8HcPjJajs,11816
|
|
@@ -240,7 +240,7 @@ htmlgraph/hooks/post_tool_use_handler.py,sha256=e0L8X4sU2H167HH96CgV6iYojd02AI9u
|
|
|
240
240
|
htmlgraph/hooks/posttooluse.py,sha256=DEZqGMiSAMijHd_W1BQ9WplSKu-kSj3WZ1DjudPUZSs,12876
|
|
241
241
|
htmlgraph/hooks/pre-commit.sh,sha256=gTpbnHIBFxpAl7-REhXoS0NI4Pmlqo9pQEMEngTAU_A,3865
|
|
242
242
|
htmlgraph/hooks/pre-push.sh,sha256=rNnkG8YmDtyk7OuJHOcbOYQR3MYFneaG6_w2X-Hl8Hs,660
|
|
243
|
-
htmlgraph/hooks/pretooluse.py,sha256=
|
|
243
|
+
htmlgraph/hooks/pretooluse.py,sha256=k0XPxDtAGlTICCdEvnwN9tOwqyQgWT_RWc3uBYQU4t4,27582
|
|
244
244
|
htmlgraph/hooks/prompt_analyzer.py,sha256=icvcF58SoYgCl-6V9OvY3dacptfyKtb95Gg6P_DoKd0,22834
|
|
245
245
|
htmlgraph/hooks/session_handler.py,sha256=dQJCiK14-YkRc7poDgChZxb_rOr8Hhb0uqp0VnV2Z-U,21695
|
|
246
246
|
htmlgraph/hooks/session_summary.py,sha256=YU5TF_eVbmQ3y3BS31XlLBGHjayJTd0LX2qds1myzmA,13093
|
|
@@ -341,11 +341,11 @@ htmlgraph/templates/AGENTS.md.template,sha256=f96h7V6ygwj-v-fanVI48eYMxR6t_se4be
|
|
|
341
341
|
htmlgraph/templates/CLAUDE.md.template,sha256=h1kG2hTX2XYig2KszsHBfzrwa_4Cfcq2Pj4SwqzeDlM,1984
|
|
342
342
|
htmlgraph/templates/GEMINI.md.template,sha256=gAGzE53Avki87BM_otqy5HdcYCoLsHgqaKjVzNzPMX8,1622
|
|
343
343
|
htmlgraph/templates/orchestration-view.html,sha256=DlS7LlcjH0oO_KYILjuF1X42t8QhKLH4F85rkO54alY,10472
|
|
344
|
-
htmlgraph-0.28.
|
|
345
|
-
htmlgraph-0.28.
|
|
346
|
-
htmlgraph-0.28.
|
|
347
|
-
htmlgraph-0.28.
|
|
348
|
-
htmlgraph-0.28.
|
|
349
|
-
htmlgraph-0.28.
|
|
350
|
-
htmlgraph-0.28.
|
|
351
|
-
htmlgraph-0.28.
|
|
344
|
+
htmlgraph-0.28.7.data/data/htmlgraph/styles.css,sha256=oDUSC8jG-V-hKojOBO9J88hxAeY2wJrBYTq0uCwX_Y4,7135
|
|
345
|
+
htmlgraph-0.28.7.data/data/htmlgraph/templates/AGENTS.md.template,sha256=f96h7V6ygwj-v-fanVI48eYMxR6t_se4bet1H4ZsDpI,7642
|
|
346
|
+
htmlgraph-0.28.7.data/data/htmlgraph/templates/CLAUDE.md.template,sha256=h1kG2hTX2XYig2KszsHBfzrwa_4Cfcq2Pj4SwqzeDlM,1984
|
|
347
|
+
htmlgraph-0.28.7.data/data/htmlgraph/templates/GEMINI.md.template,sha256=gAGzE53Avki87BM_otqy5HdcYCoLsHgqaKjVzNzPMX8,1622
|
|
348
|
+
htmlgraph-0.28.7.dist-info/METADATA,sha256=FOa4H2xWjkppmHIsvOAzZrCGQhdCTCvmhSi5H6Hc1oY,10220
|
|
349
|
+
htmlgraph-0.28.7.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
350
|
+
htmlgraph-0.28.7.dist-info/entry_points.txt,sha256=Wmdo5cx8pt6NoMsssVE2mZH1CZLSUsrg_3iSWatiyn0,103
|
|
351
|
+
htmlgraph-0.28.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|