elliot-stack 1.0.18 → 1.0.20

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 (50) hide show
  1. package/README.md +11 -0
  2. package/bin/install.cjs +134 -49
  3. package/package.json +1 -1
  4. package/skills/estack-read-claude-session-history/SKILL.md +203 -0
  5. package/skills/estack-read-claude-session-history/references/jsonl-schema.md +126 -0
  6. package/skills/estack-read-claude-session-history/references/modes.md +423 -0
  7. package/skills/estack-read-claude-session-history/references/recipes.md +271 -0
  8. package/skills/estack-read-claude-session-history/scripts/lib/__init__.py +1 -0
  9. package/skills/estack-read-claude-session-history/scripts/lib/parser.py +460 -0
  10. package/skills/estack-read-claude-session-history/scripts/lib/paths.py +234 -0
  11. package/skills/estack-read-claude-session-history/scripts/lib/search.py +179 -0
  12. package/skills/estack-read-claude-session-history/scripts/lib/subagents.py +88 -0
  13. package/skills/estack-read-claude-session-history/scripts/lib/tools.py +144 -0
  14. package/skills/estack-read-claude-session-history/scripts/read_transcript.py +1776 -0
  15. package/skills/estack-read-claude-session-history/scripts/tests/conftest.py +40 -0
  16. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/README.md +20 -0
  17. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/all-noise.jsonl +4 -0
  18. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/basic-session.jsonl +2 -0
  19. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/engagement-gaps.jsonl +9 -0
  20. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/engagement-noise.jsonl +7 -0
  21. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/engagement-parallel-a.jsonl +3 -0
  22. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/engagement-parallel-b.jsonl +3 -0
  23. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/engagement-waiting.jsonl +5 -0
  24. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/interrupted.jsonl +2 -0
  25. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/multi-compact.jsonl +8 -0
  26. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/pending-user.jsonl +2 -0
  27. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/subagent-no-meta/subagents/agent-aaa.jsonl +2 -0
  28. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/subagent-no-meta.jsonl +2 -0
  29. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/subagent-parent/subagents/agent-xyz123.jsonl +2 -0
  30. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/subagent-parent/subagents/agent-xyz123.meta.json +1 -0
  31. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/subagent-parent.jsonl +4 -0
  32. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/time-spread.jsonl +6 -0
  33. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/timeline-day-test.jsonl +5 -0
  34. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/tool-zoo.jsonl +10 -0
  35. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/truncated.jsonl +3 -0
  36. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/unicode.jsonl +2 -0
  37. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/with-advisor.jsonl +3 -0
  38. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/with-compact.jsonl +5 -0
  39. package/skills/estack-read-claude-session-history/scripts/tests/fixtures/with-thinking.jsonl +2 -0
  40. package/skills/estack-read-claude-session-history/scripts/tests/test_backup_roots.py +56 -0
  41. package/skills/estack-read-claude-session-history/scripts/tests/test_engagement.py +239 -0
  42. package/skills/estack-read-claude-session-history/scripts/tests/test_json_format.py +201 -0
  43. package/skills/estack-read-claude-session-history/scripts/tests/test_modes.py +199 -0
  44. package/skills/estack-read-claude-session-history/scripts/tests/test_parser.py +195 -0
  45. package/skills/estack-read-claude-session-history/scripts/tests/test_paths.py +133 -0
  46. package/skills/estack-read-claude-session-history/scripts/tests/test_search.py +78 -0
  47. package/skills/estack-read-claude-session-history/scripts/tests/test_subagents.py +43 -0
  48. package/skills/estack-read-claude-session-history/scripts/tests/test_timeline.py +179 -0
  49. package/skills/estack-read-claude-session-history/scripts/tests/test_timezone_and_project.py +212 -0
  50. package/skills/estack-read-claude-session-history/scripts/tests/test_tools.py +80 -0
@@ -0,0 +1,80 @@
1
+ """Tests for lib.tools."""
2
+
3
+ from pathlib import Path
4
+
5
+ from lib import parser as PR
6
+ from lib import tools as T
7
+
8
+
9
+ def _load(fixtures_dir, name):
10
+ return PR.parse_lines(fixtures_dir / name)
11
+
12
+
13
+ def test_extract_tool_calls_count(fixtures_dir):
14
+ lines = _load(fixtures_dir, "tool-zoo.jsonl")
15
+ calls = T.extract_tool_calls(lines)
16
+ assert len(calls) == 9
17
+
18
+
19
+ def test_format_bash():
20
+ call = {"name": "Bash", "input": {"command": "ls -la /tmp"}}
21
+ out = T.format_tool_call(call)
22
+ assert out == "Bash: ls -la /tmp"
23
+
24
+
25
+ def test_format_powershell():
26
+ call = {"name": "PowerShell", "input": {"command": "Get-ChildItem"}}
27
+ assert "PowerShell" in T.format_tool_call(call)
28
+
29
+
30
+ def test_format_read_with_lines():
31
+ call = {"name": "Read", "input": {"file_path": "C:\\foo.py", "offset": 1, "limit": 50}}
32
+ out = T.format_tool_call(call)
33
+ assert "C:\\foo.py" in out
34
+ assert "lines 1" in out
35
+
36
+
37
+ def test_format_edit_with_edits():
38
+ call = {"name": "Edit", "input": {"file_path": "C:\\foo.py", "edits": [{}, {}, {}]}}
39
+ out = T.format_tool_call(call)
40
+ assert "3 edits" in out
41
+
42
+
43
+ def test_format_write():
44
+ call = {"name": "Write", "input": {"file_path": "C:\\bar.py", "content": "print('hi')"}}
45
+ out = T.format_tool_call(call)
46
+ assert "chars" in out
47
+
48
+
49
+ def test_format_agent():
50
+ call = {"name": "Agent", "input": {"subagent_type": "Explore", "description": "Find X"}}
51
+ out = T.format_tool_call(call)
52
+ assert "Agent[Explore]" in out
53
+ assert "Find X" in out
54
+
55
+
56
+ def test_format_skill():
57
+ call = {"name": "Skill", "input": {"skill": "using-superpowers"}}
58
+ out = T.format_tool_call(call)
59
+ assert "using-superpowers" in out
60
+
61
+
62
+ def test_tool_filter(fixtures_dir):
63
+ lines = _load(fixtures_dir, "tool-zoo.jsonl")
64
+ calls = T.extract_tool_calls(lines, tool_filter={"Bash"})
65
+ assert len(calls) == 1
66
+ assert calls[0]["name"] == "Bash"
67
+
68
+
69
+ def test_files_touched(fixtures_dir):
70
+ lines = _load(fixtures_dir, "tool-zoo.jsonl")
71
+ files = T.files_touched(lines)
72
+ assert any("foo.py" in str(p) for p in files)
73
+ assert any("bar.py" in str(p) for p in files)
74
+
75
+
76
+ def test_extract_tool_results(fixtures_dir):
77
+ lines = _load(fixtures_dir, "subagent-parent.jsonl")
78
+ result = T.extract_tool_results(lines, "toolu_01abc")
79
+ assert result is not None
80
+ assert "Found it" in result