cc-transcript 0.7.0__tar.gz → 0.7.1__tar.gz

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 (49) hide show
  1. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/PKG-INFO +1 -1
  2. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/domains/mining/__init__.py +2 -0
  3. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/domains/mining/context.py +51 -3
  4. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/pyproject.toml +1 -1
  5. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/Cargo.lock +0 -0
  6. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/Cargo.toml +0 -0
  7. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/LICENSE +0 -0
  8. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/README.md +0 -0
  9. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/__init__.py +0 -0
  10. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/_parser_rs.pyi +0 -0
  11. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/backend.py +0 -0
  12. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/builders.py +0 -0
  13. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/discovery.py +0 -0
  14. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/domains/__init__.py +0 -0
  15. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/domains/mining/candidates.py +0 -0
  16. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/domains/mining/confidence.py +0 -0
  17. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/domains/mining/formats.py +0 -0
  18. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/domains/mining/markers.py +0 -0
  19. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/domains/mining/nav.py +0 -0
  20. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/domains/mining/signals.py +0 -0
  21. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/domains/mining/sourcekind.py +0 -0
  22. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/domains/mining/store.py +0 -0
  23. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/domains/sentiment/__init__.py +0 -0
  24. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/domains/sentiment/buckets.py +0 -0
  25. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/domains/sentiment/engine.py +0 -0
  26. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/domains/sentiment/lexicon.py +0 -0
  27. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/domains/sentiment/scorespec.py +0 -0
  28. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/filters.py +0 -0
  29. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/filterspec.py +0 -0
  30. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/messages.py +0 -0
  31. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/models.py +0 -0
  32. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/parser.py +0 -0
  33. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/py.typed +0 -0
  34. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/rust.py +0 -0
  35. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/sentiment/__init__.py +0 -0
  36. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/sentiment/buckets.py +0 -0
  37. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/sentiment/lexicon.py +0 -0
  38. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/sentiment/messages.py +0 -0
  39. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/cc_transcript/store.py +0 -0
  40. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/rust/Cargo.toml +0 -0
  41. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/rust/data/afinn-en-165.tsv +0 -0
  42. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/rust/data/domain_overrides.tsv +0 -0
  43. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/rust/src/event.rs +0 -0
  44. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/rust/src/filter.rs +0 -0
  45. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/rust/src/lexicon.rs +0 -0
  46. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/rust/src/lib.rs +0 -0
  47. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/rust/src/model.rs +0 -0
  48. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/rust/src/score.rs +0 -0
  49. {cc_transcript-0.7.0 → cc_transcript-0.7.1}/rust/src/value.rs +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cc-transcript
3
- Version: 0.7.0
3
+ Version: 0.7.1
4
4
  Classifier: Development Status :: 3 - Alpha
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: Operating System :: OS Independent
@@ -29,9 +29,11 @@ from cc_transcript.domains.mining.confidence import (
29
29
  weak,
30
30
  )
31
31
  from cc_transcript.domains.mining.context import (
32
+ TOOL_INPUT_LIMIT,
32
33
  ContextSnapshot,
33
34
  ContextTurn,
34
35
  build_snapshot,
36
+ summarize_tool_input,
35
37
  trigger_for,
36
38
  turn_for,
37
39
  )
@@ -15,6 +15,7 @@ if TYPE_CHECKING:
15
15
  from cc_transcript.models import TranscriptEvent
16
16
 
17
17
  ASSISTANT_TEXT_LIMIT = 2000
18
+ TOOL_INPUT_LIMIT = 1500
18
19
 
19
20
 
20
21
  @dataclass(frozen=True, slots=True)
@@ -25,11 +26,13 @@ class ContextTurn:
25
26
  role: Whether the turn came from the user, the assistant, or a tool.
26
27
  text: The turn's text content.
27
28
  tool_calls: The names of the tools the turn invoked, in order.
29
+ tool_inputs: One input summary per tool call, in the same order.
28
30
  """
29
31
 
30
32
  role: Literal["user", "assistant", "tool"]
31
33
  text: str
32
34
  tool_calls: tuple[str, ...] = ()
35
+ tool_inputs: tuple[str, ...] = ()
33
36
 
34
37
 
35
38
  @dataclass(frozen=True, slots=True)
@@ -68,11 +71,54 @@ class ContextSnapshot:
68
71
 
69
72
 
70
73
  def turn_to_dict(turn: ContextTurn) -> dict[str, Any]:
71
- return {"role": turn.role, "text": turn.text, "tool_calls": list(turn.tool_calls)}
74
+ return {
75
+ "role": turn.role,
76
+ "text": turn.text,
77
+ "tool_calls": list(turn.tool_calls),
78
+ "tool_inputs": list(turn.tool_inputs),
79
+ }
72
80
 
73
81
 
74
82
  def turn_from_dict(data: Mapping[str, Any]) -> ContextTurn:
75
- return ContextTurn(role=data["role"], text=data["text"], tool_calls=tuple(data["tool_calls"]))
83
+ return ContextTurn(
84
+ role=data["role"],
85
+ text=data["text"],
86
+ tool_calls=tuple(data["tool_calls"]),
87
+ tool_inputs=tuple(data.get("tool_inputs", ())),
88
+ )
89
+
90
+
91
+ def summarize_tool_input(name: str, input: Mapping[str, Any]) -> str:
92
+ """Summarizes one tool call's input for context snapshots.
93
+
94
+ Extracts the field that captures what the tool actually did — the Bash
95
+ command, the Edit diff, the plan body — falling back to the raw JSON for
96
+ unrecognized tools, truncated to :data:`TOOL_INPUT_LIMIT`.
97
+
98
+ Args:
99
+ name: The tool's name as recorded in the transcript.
100
+ input: The tool call's input mapping, preserved verbatim by the parser.
101
+
102
+ Returns:
103
+ The bounded one-string summary of the call.
104
+ """
105
+ match name:
106
+ case "Bash":
107
+ summary = str(input.get("command", ""))
108
+ case "Edit":
109
+ summary = f"{input.get('file_path', '')}\n- {input.get('old_string', '')}\n+ {input.get('new_string', '')}"
110
+ case "MultiEdit":
111
+ first: Mapping[str, Any] = next(iter(input.get("edits") or ()), {})
112
+ summary = f"{input.get('file_path', '')}\n- {first.get('old_string', '')}\n+ {first.get('new_string', '')}"
113
+ case "Write":
114
+ summary = f"{input.get('file_path', '')}\n{input.get('content', '')}"
115
+ case "ExitPlanMode":
116
+ summary = str(input.get("plan", ""))
117
+ case "Task" | "Agent":
118
+ summary = str(input.get("prompt", ""))
119
+ case _:
120
+ summary = json.dumps(dict(input))
121
+ return summary[:TOOL_INPUT_LIMIT]
76
122
 
77
123
 
78
124
  def turn_for(event: UserEvent | AssistantEvent) -> ContextTurn:
@@ -80,10 +126,12 @@ def turn_for(event: UserEvent | AssistantEvent) -> ContextTurn:
80
126
  case UserEvent():
81
127
  return ContextTurn(role="user", text=event.text)
82
128
  case AssistantEvent():
129
+ uses = tuple(block for block in event.blocks if isinstance(block, ToolUseBlock))
83
130
  return ContextTurn(
84
131
  role="assistant",
85
132
  text=event.text[:ASSISTANT_TEXT_LIMIT],
86
- tool_calls=tuple(block.name for block in event.blocks if isinstance(block, ToolUseBlock)),
133
+ tool_calls=tuple(use.name for use in uses),
134
+ tool_inputs=tuple(summarize_tool_input(use.name, use.input) for use in uses),
87
135
  )
88
136
 
89
137
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "cc-transcript"
3
- version = "0.7.0"
3
+ version = "0.7.1"
4
4
  description = "Typed events for Claude Code transcripts: discovery, a superset JSONL parser (Python + Rust), and ingestion-state tracking."
5
5
  readme = "README.md"
6
6
  license = "PolyForm-Noncommercial-1.0.0"
File without changes
File without changes
File without changes
File without changes