traceforge-toolkit 0.1.0__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.
- traceforge/__init__.py +72 -0
- traceforge/__main__.py +5 -0
- traceforge/_generated.py +254 -0
- traceforge/adapters/__init__.py +12 -0
- traceforge/adapters/base.py +82 -0
- traceforge/adapters/genai_otel.py +164 -0
- traceforge/adapters/mapped_json.py +297 -0
- traceforge/adapters/otel.py +220 -0
- traceforge/boundary/__init__.py +46 -0
- traceforge/boundary/data/boundary-model.joblib +0 -0
- traceforge/boundary/decode.py +87 -0
- traceforge/boundary/features.py +137 -0
- traceforge/boundary/inference.py +267 -0
- traceforge/boundary/inferencer.py +146 -0
- traceforge/classify/__init__.py +95 -0
- traceforge/classify/cmd.py +109 -0
- traceforge/classify/coding.py +213 -0
- traceforge/classify/config.py +554 -0
- traceforge/classify/core.py +266 -0
- traceforge/classify/data/binary_info.yaml +358 -0
- traceforge/classify/data/canonical_tools.yaml +251 -0
- traceforge/classify/data/effect_overrides.yaml +480 -0
- traceforge/classify/data/mcp_profiles.yaml +711 -0
- traceforge/classify/data/recommendation_rules.yaml +111 -0
- traceforge/classify/data/risk.yaml +534 -0
- traceforge/classify/data/shell_defaults.yaml +95 -0
- traceforge/classify/data/shell_rules.yaml +1192 -0
- traceforge/classify/data/tool_classifications.yaml +215 -0
- traceforge/classify/data/verb_inference.yaml +218 -0
- traceforge/classify/mcp.py +181 -0
- traceforge/classify/phases.py +75 -0
- traceforge/classify/powershell.py +93 -0
- traceforge/classify/registry.py +138 -0
- traceforge/classify/risk.py +553 -0
- traceforge/classify/rules.py +215 -0
- traceforge/classify/schema.yaml +282 -0
- traceforge/classify/shell.py +503 -0
- traceforge/classify/tools.py +91 -0
- traceforge/classify/workflow.py +32 -0
- traceforge/cli/__init__.py +42 -0
- traceforge/cli/config_cmd.py +130 -0
- traceforge/cli/detect.py +46 -0
- traceforge/cli/download_cmd.py +74 -0
- traceforge/cli/factory.py +60 -0
- traceforge/cli/gate_cmd.py +30 -0
- traceforge/cli/init_cmd.py +86 -0
- traceforge/cli/replay.py +130 -0
- traceforge/cli/runner.py +181 -0
- traceforge/cli/score.py +217 -0
- traceforge/cli/status.py +65 -0
- traceforge/cli/watch.py +297 -0
- traceforge/config/__init__.py +80 -0
- traceforge/config/defaults.py +149 -0
- traceforge/config/loader.py +239 -0
- traceforge/config/mappings.py +104 -0
- traceforge/config/models.py +579 -0
- traceforge/enricher.py +576 -0
- traceforge/formatting/__init__.py +12 -0
- traceforge/formatting/budget.py +92 -0
- traceforge/formatting/density.py +154 -0
- traceforge/gate/__init__.py +17 -0
- traceforge/gate/client.py +145 -0
- traceforge/gate/external.py +305 -0
- traceforge/gate/registry.py +108 -0
- traceforge/gate/server.py +174 -0
- traceforge/gates/__init__.py +8 -0
- traceforge/gates/pii.py +352 -0
- traceforge/gates/pii_patterns.yaml +228 -0
- traceforge/governance/__init__.py +121 -0
- traceforge/governance/assessor.py +441 -0
- traceforge/governance/budget.py +59 -0
- traceforge/governance/canonical.py +56 -0
- traceforge/governance/codec.py +414 -0
- traceforge/governance/context.py +249 -0
- traceforge/governance/drift.py +196 -0
- traceforge/governance/emitter.py +234 -0
- traceforge/governance/envelope.py +138 -0
- traceforge/governance/ifc.py +364 -0
- traceforge/governance/integrity.py +162 -0
- traceforge/governance/labeler.py +250 -0
- traceforge/governance/mcp_drift.py +328 -0
- traceforge/governance/monitor.py +539 -0
- traceforge/governance/observer.py +276 -0
- traceforge/governance/persistence.py +401 -0
- traceforge/governance/phase1.py +77 -0
- traceforge/governance/pii.py +276 -0
- traceforge/governance/pipeline.py +840 -0
- traceforge/governance/registry.py +110 -0
- traceforge/governance/results.py +183 -0
- traceforge/governance/risk_wrapper.py +113 -0
- traceforge/governance/rules.py +368 -0
- traceforge/governance/scorer.py +262 -0
- traceforge/governance/shield.py +318 -0
- traceforge/governance/state.py +466 -0
- traceforge/governance/types.py +176 -0
- traceforge/mappings/__init__.py +1 -0
- traceforge/mappings/aider.yaml +216 -0
- traceforge/mappings/aider_markdown.yaml +113 -0
- traceforge/mappings/amazonq.yaml +56 -0
- traceforge/mappings/antigravity.yaml +88 -0
- traceforge/mappings/claude.yaml +93 -0
- traceforge/mappings/cline.yaml +286 -0
- traceforge/mappings/codex.yaml +158 -0
- traceforge/mappings/continue_dev.yaml +57 -0
- traceforge/mappings/copilot.yaml +266 -0
- traceforge/mappings/copilot_markdown.yaml +72 -0
- traceforge/mappings/copilot_vscode.yaml +181 -0
- traceforge/mappings/crewai.yaml +592 -0
- traceforge/mappings/goose.yaml +128 -0
- traceforge/mappings/langgraph.yaml +165 -0
- traceforge/mappings/maf.yaml +90 -0
- traceforge/mappings/maf_transcript.yaml +99 -0
- traceforge/mappings/openai_agents.yaml +144 -0
- traceforge/mappings/opencode.yaml +473 -0
- traceforge/mappings/openhands.yaml +320 -0
- traceforge/mappings/pydantic_ai.yaml +183 -0
- traceforge/mappings/smolagents.yaml +89 -0
- traceforge/mappings/sweagent.yaml +82 -0
- traceforge/migrations/__init__.py +1 -0
- traceforge/migrations/env.py +60 -0
- traceforge/migrations/models.py +145 -0
- traceforge/migrations/runner.py +44 -0
- traceforge/migrations/script.py.mako +25 -0
- traceforge/migrations/versions/0001_initial.py +176 -0
- traceforge/migrations/versions/__init__.py +4 -0
- traceforge/models.py +29 -0
- traceforge/parsers/__init__.py +21 -0
- traceforge/parsers/aider.py +416 -0
- traceforge/parsers/base.py +226 -0
- traceforge/parsers/copilot.py +314 -0
- traceforge/phase/__init__.py +50 -0
- traceforge/phase/data/phase-model.joblib +0 -0
- traceforge/phase/data/potion-base-8M/README.md +99 -0
- traceforge/phase/data/potion-base-8M/config.json +13 -0
- traceforge/phase/data/potion-base-8M/model.safetensors +0 -0
- traceforge/phase/data/potion-base-8M/modules.json +14 -0
- traceforge/phase/data/potion-base-8M/tokenizer.json +1 -0
- traceforge/phase/event_rows.py +107 -0
- traceforge/phase/features.py +468 -0
- traceforge/phase/inference.py +279 -0
- traceforge/phase/inferencer.py +171 -0
- traceforge/phase/segmentation.py +258 -0
- traceforge/pipeline.py +891 -0
- traceforge/preprocessors/__init__.py +34 -0
- traceforge/preprocessors/amazonq.py +224 -0
- traceforge/preprocessors/antigravity.py +116 -0
- traceforge/preprocessors/claude.py +95 -0
- traceforge/preprocessors/cline.py +36 -0
- traceforge/preprocessors/codex.py +311 -0
- traceforge/preprocessors/continue_dev.py +119 -0
- traceforge/preprocessors/copilot_vscode.py +171 -0
- traceforge/preprocessors/goose.py +156 -0
- traceforge/preprocessors/maf_transcript.py +84 -0
- traceforge/preprocessors/openai_agents.py +86 -0
- traceforge/preprocessors/opencode.py +85 -0
- traceforge/preprocessors/openhands.py +36 -0
- traceforge/preprocessors/pydantic_ai.py +62 -0
- traceforge/preprocessors/registry.py +24 -0
- traceforge/preprocessors/smolagents.py +90 -0
- traceforge/py.typed +0 -0
- traceforge/sdk/__init__.py +59 -0
- traceforge/sdk/gate_policy.py +63 -0
- traceforge/sdk/gate_types.py +140 -0
- traceforge/sdk/pipeline.py +265 -0
- traceforge/sdk/verdict.py +81 -0
- traceforge/sinks/__init__.py +23 -0
- traceforge/sinks/base.py +95 -0
- traceforge/sinks/callback.py +132 -0
- traceforge/sinks/console.py +112 -0
- traceforge/sinks/factory.py +94 -0
- traceforge/sinks/jsonl.py +125 -0
- traceforge/sinks/otel_exporter.py +212 -0
- traceforge/sinks/parquet.py +260 -0
- traceforge/sinks/s3.py +206 -0
- traceforge/sinks/sqlite_output.py +234 -0
- traceforge/sinks/webhook.py +136 -0
- traceforge/sources/__init__.py +18 -0
- traceforge/sources/auto_detect.py +173 -0
- traceforge/sources/base.py +45 -0
- traceforge/sources/file_poll.py +136 -0
- traceforge/sources/file_watch.py +221 -0
- traceforge/sources/http_poll.py +141 -0
- traceforge/sources/replay.py +63 -0
- traceforge/sources/sqlite.py +187 -0
- traceforge/sources/sse.py +198 -0
- traceforge/telemetry/__init__.py +192 -0
- traceforge/title/__init__.py +23 -0
- traceforge/title/_resolve.py +79 -0
- traceforge/title/context.py +295 -0
- traceforge/title/data/boilerplate_files.json +14 -0
- traceforge/title/heuristics.py +429 -0
- traceforge/title/hygiene.py +90 -0
- traceforge/title/inference.py +314 -0
- traceforge/title/inferencer.py +477 -0
- traceforge/title/naming.py +398 -0
- traceforge/trace.py +291 -0
- traceforge/tracking/__init__.py +30 -0
- traceforge/tracking/models.py +115 -0
- traceforge/tracking/phase_tracker.py +288 -0
- traceforge/types.py +315 -0
- traceforge_toolkit-0.1.0.dist-info/METADATA +188 -0
- traceforge_toolkit-0.1.0.dist-info/RECORD +205 -0
- traceforge_toolkit-0.1.0.dist-info/WHEEL +4 -0
- traceforge_toolkit-0.1.0.dist-info/entry_points.txt +2 -0
- traceforge_toolkit-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,592 @@
|
|
|
1
|
+
# CrewAI event mapping for MappedJsonAdapter
|
|
2
|
+
# Targets: crewai >= 1.0.0 (crewai_event_bus with BaseEventListener)
|
|
3
|
+
# Source: crewAIInc/crewAI lib/crewai/src/crewai/events/
|
|
4
|
+
#
|
|
5
|
+
# CrewAI 1.x ships a full event bus (crewai_event_bus) with 60+ typed events.
|
|
6
|
+
# All events inherit from BaseEvent which provides:
|
|
7
|
+
# type (Literal[...]), timestamp, event_id, parent_event_id, previous_event_id,
|
|
8
|
+
# triggered_by_event_id, emission_sequence, source_fingerprint, source_type,
|
|
9
|
+
# fingerprint_metadata, task_id, task_name, agent_id, agent_role
|
|
10
|
+
#
|
|
11
|
+
# Events are subscribed via BaseEventListener + @on(EventType) decorator.
|
|
12
|
+
# The event bus is a singleton: `from crewai.events import crewai_event_bus`
|
|
13
|
+
#
|
|
14
|
+
# NOTE: crewAI-inc/crewAI (hyphenated, 0.86) is a FROZEN FORK.
|
|
15
|
+
# The active repo is crewAIInc/crewAI (capital Inc) at 1.10+.
|
|
16
|
+
|
|
17
|
+
framework: crewai
|
|
18
|
+
framework_version: ">=1.0.0"
|
|
19
|
+
ingestion_mode: file_watch
|
|
20
|
+
type_field: type
|
|
21
|
+
timestamp_field: timestamp
|
|
22
|
+
|
|
23
|
+
motivation:
|
|
24
|
+
sources:
|
|
25
|
+
- events: ["llm_call_completed"]
|
|
26
|
+
field: output
|
|
27
|
+
role: intent
|
|
28
|
+
- events: ["llm_thinking_chunk"]
|
|
29
|
+
field: content
|
|
30
|
+
role: reasoning
|
|
31
|
+
- events: ["agent_reasoning_completed"]
|
|
32
|
+
field: plan
|
|
33
|
+
role: reasoning
|
|
34
|
+
|
|
35
|
+
events:
|
|
36
|
+
# ── Flow lifecycle (lib/crewai/src/crewai/events/types/flow_events.py) ──
|
|
37
|
+
flow_created:
|
|
38
|
+
kind: workflow.created
|
|
39
|
+
payload:
|
|
40
|
+
flow_name: flow_name
|
|
41
|
+
flow_started:
|
|
42
|
+
kind: workflow.started
|
|
43
|
+
payload:
|
|
44
|
+
flow_name: flow_name
|
|
45
|
+
inputs: inputs
|
|
46
|
+
flow_finished:
|
|
47
|
+
kind: workflow.completed
|
|
48
|
+
payload:
|
|
49
|
+
flow_name: flow_name
|
|
50
|
+
result: result
|
|
51
|
+
state: state
|
|
52
|
+
flow_paused:
|
|
53
|
+
kind: workflow.paused
|
|
54
|
+
payload:
|
|
55
|
+
flow_name: flow_name
|
|
56
|
+
method_execution_started:
|
|
57
|
+
kind: task.started
|
|
58
|
+
payload:
|
|
59
|
+
flow_name: flow_name
|
|
60
|
+
task_name: method_name
|
|
61
|
+
state: state
|
|
62
|
+
params: params
|
|
63
|
+
method_execution_finished:
|
|
64
|
+
kind: task.completed
|
|
65
|
+
payload:
|
|
66
|
+
flow_name: flow_name
|
|
67
|
+
task_name: method_name
|
|
68
|
+
result: result
|
|
69
|
+
state: state
|
|
70
|
+
method_execution_failed:
|
|
71
|
+
kind: task.failed
|
|
72
|
+
payload:
|
|
73
|
+
flow_name: flow_name
|
|
74
|
+
task_name: method_name
|
|
75
|
+
error: error
|
|
76
|
+
method_execution_paused:
|
|
77
|
+
kind: task.paused
|
|
78
|
+
payload:
|
|
79
|
+
flow_name: flow_name
|
|
80
|
+
task_name: method_name
|
|
81
|
+
|
|
82
|
+
# ── Crew lifecycle ──
|
|
83
|
+
crew_kickoff_started:
|
|
84
|
+
kind: session.started
|
|
85
|
+
payload:
|
|
86
|
+
crew_name: crew_name
|
|
87
|
+
event_id: event_id
|
|
88
|
+
crew_kickoff_completed:
|
|
89
|
+
kind: session.ended
|
|
90
|
+
payload:
|
|
91
|
+
crew_name: crew_name
|
|
92
|
+
output: output
|
|
93
|
+
crew_kickoff_failed:
|
|
94
|
+
kind: session.error
|
|
95
|
+
payload:
|
|
96
|
+
crew_name: crew_name
|
|
97
|
+
error: error
|
|
98
|
+
|
|
99
|
+
# ── Agent execution ──
|
|
100
|
+
agent_execution_started:
|
|
101
|
+
kind: agent.spawned
|
|
102
|
+
payload:
|
|
103
|
+
agent_id: agent_id
|
|
104
|
+
agent_role: agent_role
|
|
105
|
+
task_name: task_name
|
|
106
|
+
agent_execution_completed:
|
|
107
|
+
kind: agent.completed
|
|
108
|
+
payload:
|
|
109
|
+
agent_id: agent_id
|
|
110
|
+
agent_role: agent_role
|
|
111
|
+
output: output
|
|
112
|
+
agent_execution_error:
|
|
113
|
+
kind: agent.failed
|
|
114
|
+
payload:
|
|
115
|
+
agent_id: agent_id
|
|
116
|
+
agent_role: agent_role
|
|
117
|
+
error: error
|
|
118
|
+
|
|
119
|
+
# ── Task lifecycle ──
|
|
120
|
+
task_started:
|
|
121
|
+
kind: task.started
|
|
122
|
+
payload:
|
|
123
|
+
task_id: task_id
|
|
124
|
+
task_name: task_name
|
|
125
|
+
agent_role: agent_role
|
|
126
|
+
task_completed:
|
|
127
|
+
kind: task.completed
|
|
128
|
+
payload:
|
|
129
|
+
task_id: task_id
|
|
130
|
+
task_name: task_name
|
|
131
|
+
output: output
|
|
132
|
+
task_failed:
|
|
133
|
+
kind: task.failed
|
|
134
|
+
payload:
|
|
135
|
+
task_id: task_id
|
|
136
|
+
task_name: task_name
|
|
137
|
+
error: error
|
|
138
|
+
|
|
139
|
+
# ── Tool usage ──
|
|
140
|
+
tool_usage_started:
|
|
141
|
+
kind: tool.call.started
|
|
142
|
+
payload:
|
|
143
|
+
tool_name: tool_name
|
|
144
|
+
tool_call_id: event_id
|
|
145
|
+
arguments: tool_args
|
|
146
|
+
tool_usage_finished:
|
|
147
|
+
kind: tool.call.completed
|
|
148
|
+
payload:
|
|
149
|
+
tool_name: tool_name
|
|
150
|
+
result: output
|
|
151
|
+
tool_usage_error:
|
|
152
|
+
kind: tool.call.failed
|
|
153
|
+
payload:
|
|
154
|
+
tool_name: tool_name
|
|
155
|
+
error: error
|
|
156
|
+
|
|
157
|
+
# ── LLM calls ──
|
|
158
|
+
llm_call_started:
|
|
159
|
+
kind: llm.call.started
|
|
160
|
+
payload:
|
|
161
|
+
model: model
|
|
162
|
+
agent_role: agent_role
|
|
163
|
+
event_id: event_id
|
|
164
|
+
llm_call_completed:
|
|
165
|
+
kind: llm.call.completed
|
|
166
|
+
payload:
|
|
167
|
+
model: model
|
|
168
|
+
output: response
|
|
169
|
+
input_tokens: usage.prompt_tokens
|
|
170
|
+
output_tokens: usage.completion_tokens
|
|
171
|
+
llm_call_failed:
|
|
172
|
+
kind: llm.call.failed
|
|
173
|
+
payload:
|
|
174
|
+
model: model
|
|
175
|
+
error: error
|
|
176
|
+
llm_stream_chunk:
|
|
177
|
+
kind: llm.output.chunk
|
|
178
|
+
payload:
|
|
179
|
+
content: chunk
|
|
180
|
+
|
|
181
|
+
# ── Memory operations ──
|
|
182
|
+
memory_save_started:
|
|
183
|
+
kind: memory.save.started
|
|
184
|
+
payload:
|
|
185
|
+
event_id: event_id
|
|
186
|
+
memory_save_completed:
|
|
187
|
+
kind: memory.save.completed
|
|
188
|
+
payload:
|
|
189
|
+
event_id: event_id
|
|
190
|
+
memory_query_started:
|
|
191
|
+
kind: memory.query.started
|
|
192
|
+
payload:
|
|
193
|
+
event_id: event_id
|
|
194
|
+
memory_query_completed:
|
|
195
|
+
kind: memory.query.completed
|
|
196
|
+
payload:
|
|
197
|
+
event_id: event_id
|
|
198
|
+
|
|
199
|
+
# ── Knowledge retrieval ──
|
|
200
|
+
knowledge_search_query_started:
|
|
201
|
+
kind: knowledge.query.started
|
|
202
|
+
payload:
|
|
203
|
+
event_id: event_id
|
|
204
|
+
knowledge_search_query_completed:
|
|
205
|
+
kind: knowledge.query.completed
|
|
206
|
+
payload:
|
|
207
|
+
event_id: event_id
|
|
208
|
+
|
|
209
|
+
# ── MCP connections ──
|
|
210
|
+
mcp_connection_started:
|
|
211
|
+
kind: mcp.connection.started
|
|
212
|
+
payload:
|
|
213
|
+
event_id: event_id
|
|
214
|
+
mcp_connection_completed:
|
|
215
|
+
kind: mcp.connection.completed
|
|
216
|
+
payload:
|
|
217
|
+
event_id: event_id
|
|
218
|
+
mcp_connection_failed:
|
|
219
|
+
kind: mcp.connection.failed
|
|
220
|
+
payload:
|
|
221
|
+
error: error
|
|
222
|
+
mcp_tool_execution_started:
|
|
223
|
+
kind: mcp.tool.started
|
|
224
|
+
payload:
|
|
225
|
+
event_id: event_id
|
|
226
|
+
mcp_tool_execution_completed:
|
|
227
|
+
kind: mcp.tool.completed
|
|
228
|
+
payload:
|
|
229
|
+
event_id: event_id
|
|
230
|
+
mcp_tool_execution_failed:
|
|
231
|
+
kind: mcp.tool.failed
|
|
232
|
+
payload:
|
|
233
|
+
error: error
|
|
234
|
+
|
|
235
|
+
# ── Human feedback / conversation ──
|
|
236
|
+
flow_input_requested:
|
|
237
|
+
kind: input.requested
|
|
238
|
+
payload:
|
|
239
|
+
flow_name: flow_name
|
|
240
|
+
flow_input_received:
|
|
241
|
+
kind: input.received
|
|
242
|
+
payload:
|
|
243
|
+
flow_name: flow_name
|
|
244
|
+
human_feedback_requested:
|
|
245
|
+
kind: input.requested
|
|
246
|
+
payload:
|
|
247
|
+
event_id: event_id
|
|
248
|
+
human_feedback_received:
|
|
249
|
+
kind: input.received
|
|
250
|
+
payload:
|
|
251
|
+
event_id: event_id
|
|
252
|
+
conversation_message_added:
|
|
253
|
+
kind: message.user
|
|
254
|
+
payload:
|
|
255
|
+
event_id: event_id
|
|
256
|
+
|
|
257
|
+
# ── Checkpoints ──
|
|
258
|
+
checkpoint_started:
|
|
259
|
+
kind: checkpoint.started
|
|
260
|
+
payload:
|
|
261
|
+
event_id: event_id
|
|
262
|
+
checkpoint_completed:
|
|
263
|
+
kind: checkpoint.created
|
|
264
|
+
payload:
|
|
265
|
+
event_id: event_id
|
|
266
|
+
checkpoint_failed:
|
|
267
|
+
kind: checkpoint.failed
|
|
268
|
+
payload:
|
|
269
|
+
event_id: event_id
|
|
270
|
+
error: error
|
|
271
|
+
checkpoint_pruned:
|
|
272
|
+
kind: checkpoint.pruned
|
|
273
|
+
payload:
|
|
274
|
+
event_id: event_id
|
|
275
|
+
checkpoint_fork_started:
|
|
276
|
+
kind: checkpoint.fork.started
|
|
277
|
+
payload:
|
|
278
|
+
event_id: event_id
|
|
279
|
+
checkpoint_fork_completed:
|
|
280
|
+
kind: checkpoint.fork.completed
|
|
281
|
+
payload:
|
|
282
|
+
event_id: event_id
|
|
283
|
+
checkpoint_restore_started:
|
|
284
|
+
kind: checkpoint.restore.started
|
|
285
|
+
payload:
|
|
286
|
+
event_id: event_id
|
|
287
|
+
checkpoint_restore_completed:
|
|
288
|
+
kind: checkpoint.restore.completed
|
|
289
|
+
payload:
|
|
290
|
+
event_id: event_id
|
|
291
|
+
checkpoint_restore_failed:
|
|
292
|
+
kind: checkpoint.restore.failed
|
|
293
|
+
payload:
|
|
294
|
+
event_id: event_id
|
|
295
|
+
error: error
|
|
296
|
+
|
|
297
|
+
# ── Crew training/testing ──
|
|
298
|
+
crew_train_started:
|
|
299
|
+
kind: session.started
|
|
300
|
+
payload:
|
|
301
|
+
crew_name: crew_name
|
|
302
|
+
crew_train_completed:
|
|
303
|
+
kind: session.ended
|
|
304
|
+
payload:
|
|
305
|
+
crew_name: crew_name
|
|
306
|
+
crew_train_failed:
|
|
307
|
+
kind: session.error
|
|
308
|
+
payload:
|
|
309
|
+
crew_name: crew_name
|
|
310
|
+
error: error
|
|
311
|
+
crew_test_started:
|
|
312
|
+
kind: session.started
|
|
313
|
+
payload:
|
|
314
|
+
crew_name: crew_name
|
|
315
|
+
crew_test_completed:
|
|
316
|
+
kind: session.ended
|
|
317
|
+
payload:
|
|
318
|
+
crew_name: crew_name
|
|
319
|
+
crew_test_failed:
|
|
320
|
+
kind: session.error
|
|
321
|
+
payload:
|
|
322
|
+
crew_name: crew_name
|
|
323
|
+
error: error
|
|
324
|
+
crew_test_result:
|
|
325
|
+
kind: session.info
|
|
326
|
+
payload:
|
|
327
|
+
crew_name: crew_name
|
|
328
|
+
event_id: event_id
|
|
329
|
+
|
|
330
|
+
# ── Lite agent execution ──
|
|
331
|
+
lite_agent_execution_started:
|
|
332
|
+
kind: agent.spawned
|
|
333
|
+
payload:
|
|
334
|
+
agent_id: agent_id
|
|
335
|
+
agent_role: agent_role
|
|
336
|
+
lite_agent_execution_completed:
|
|
337
|
+
kind: agent.completed
|
|
338
|
+
payload:
|
|
339
|
+
agent_id: agent_id
|
|
340
|
+
output: output
|
|
341
|
+
lite_agent_execution_error:
|
|
342
|
+
kind: agent.failed
|
|
343
|
+
payload:
|
|
344
|
+
agent_id: agent_id
|
|
345
|
+
error: error
|
|
346
|
+
|
|
347
|
+
# ── Agent evaluation ──
|
|
348
|
+
agent_evaluation_started:
|
|
349
|
+
kind: agent.evaluation.started
|
|
350
|
+
payload:
|
|
351
|
+
agent_id: agent_id
|
|
352
|
+
event_id: event_id
|
|
353
|
+
agent_evaluation_completed:
|
|
354
|
+
kind: agent.evaluation.completed
|
|
355
|
+
payload:
|
|
356
|
+
agent_id: agent_id
|
|
357
|
+
event_id: event_id
|
|
358
|
+
agent_evaluation_failed:
|
|
359
|
+
kind: agent.evaluation.failed
|
|
360
|
+
payload:
|
|
361
|
+
agent_id: agent_id
|
|
362
|
+
error: error
|
|
363
|
+
|
|
364
|
+
# ── Agent reasoning ──
|
|
365
|
+
agent_reasoning_started:
|
|
366
|
+
kind: reasoning.started
|
|
367
|
+
payload:
|
|
368
|
+
agent_id: agent_id
|
|
369
|
+
event_id: event_id
|
|
370
|
+
agent_reasoning_completed:
|
|
371
|
+
kind: reasoning.completed
|
|
372
|
+
payload:
|
|
373
|
+
agent_id: agent_id
|
|
374
|
+
event_id: event_id
|
|
375
|
+
plan: plan
|
|
376
|
+
agent_reasoning_failed:
|
|
377
|
+
kind: reasoning.failed
|
|
378
|
+
payload:
|
|
379
|
+
agent_id: agent_id
|
|
380
|
+
error: error
|
|
381
|
+
|
|
382
|
+
# ── Tool errors (granular) ──
|
|
383
|
+
tool_validate_input_error:
|
|
384
|
+
kind: tool.validation.failed
|
|
385
|
+
payload:
|
|
386
|
+
tool_name: tool_name
|
|
387
|
+
error: error
|
|
388
|
+
tool_selection_error:
|
|
389
|
+
kind: tool.call.failed
|
|
390
|
+
payload:
|
|
391
|
+
error: error
|
|
392
|
+
tool_execution_error:
|
|
393
|
+
kind: tool.call.failed
|
|
394
|
+
payload:
|
|
395
|
+
tool_name: tool_name
|
|
396
|
+
error: error
|
|
397
|
+
|
|
398
|
+
# ── Memory failures ──
|
|
399
|
+
memory_save_failed:
|
|
400
|
+
kind: memory.save.failed
|
|
401
|
+
payload:
|
|
402
|
+
event_id: event_id
|
|
403
|
+
error: error
|
|
404
|
+
memory_query_failed:
|
|
405
|
+
kind: memory.query.failed
|
|
406
|
+
payload:
|
|
407
|
+
event_id: event_id
|
|
408
|
+
error: error
|
|
409
|
+
memory_retrieval_started:
|
|
410
|
+
kind: memory.query.started
|
|
411
|
+
payload:
|
|
412
|
+
event_id: event_id
|
|
413
|
+
memory_retrieval_completed:
|
|
414
|
+
kind: memory.query.completed
|
|
415
|
+
payload:
|
|
416
|
+
event_id: event_id
|
|
417
|
+
memory_retrieval_failed:
|
|
418
|
+
kind: memory.query.failed
|
|
419
|
+
payload:
|
|
420
|
+
event_id: event_id
|
|
421
|
+
error: error
|
|
422
|
+
|
|
423
|
+
# ── Knowledge failures ──
|
|
424
|
+
knowledge_query_started:
|
|
425
|
+
kind: knowledge.query.started
|
|
426
|
+
payload:
|
|
427
|
+
event_id: event_id
|
|
428
|
+
knowledge_query_completed:
|
|
429
|
+
kind: knowledge.query.completed
|
|
430
|
+
payload:
|
|
431
|
+
event_id: event_id
|
|
432
|
+
knowledge_query_failed:
|
|
433
|
+
kind: knowledge.query.failed
|
|
434
|
+
payload:
|
|
435
|
+
event_id: event_id
|
|
436
|
+
error: error
|
|
437
|
+
knowledge_search_query_failed:
|
|
438
|
+
kind: knowledge.query.failed
|
|
439
|
+
payload:
|
|
440
|
+
event_id: event_id
|
|
441
|
+
error: error
|
|
442
|
+
|
|
443
|
+
# ── LLM guardrails ──
|
|
444
|
+
llm_thinking_chunk:
|
|
445
|
+
kind: reasoning.chunk
|
|
446
|
+
payload:
|
|
447
|
+
content: chunk
|
|
448
|
+
llm_guardrail_started:
|
|
449
|
+
kind: guardrail.started
|
|
450
|
+
payload:
|
|
451
|
+
event_id: event_id
|
|
452
|
+
llm_guardrail_completed:
|
|
453
|
+
kind: guardrail.passed
|
|
454
|
+
payload:
|
|
455
|
+
event_id: event_id
|
|
456
|
+
|
|
457
|
+
# ── MCP config failure ──
|
|
458
|
+
mcp_config_fetch_failed:
|
|
459
|
+
kind: mcp.connection.failed
|
|
460
|
+
payload:
|
|
461
|
+
error: error
|
|
462
|
+
|
|
463
|
+
# ── Task evaluation ──
|
|
464
|
+
task_evaluation:
|
|
465
|
+
kind: task.evaluation
|
|
466
|
+
payload:
|
|
467
|
+
task_id: task_id
|
|
468
|
+
event_id: event_id
|
|
469
|
+
|
|
470
|
+
# ── Observation/planning events ──
|
|
471
|
+
step_observation_started:
|
|
472
|
+
kind: task.observation.started
|
|
473
|
+
payload:
|
|
474
|
+
event_id: event_id
|
|
475
|
+
step_observation_completed:
|
|
476
|
+
kind: task.observation.completed
|
|
477
|
+
payload:
|
|
478
|
+
event_id: event_id
|
|
479
|
+
step_observation_failed:
|
|
480
|
+
kind: task.observation.failed
|
|
481
|
+
payload:
|
|
482
|
+
event_id: event_id
|
|
483
|
+
error: error
|
|
484
|
+
plan_refinement:
|
|
485
|
+
kind: planning.updated
|
|
486
|
+
payload:
|
|
487
|
+
event_id: event_id
|
|
488
|
+
plan_replan_triggered:
|
|
489
|
+
kind: planning.restarted
|
|
490
|
+
payload:
|
|
491
|
+
event_id: event_id
|
|
492
|
+
goal_achieved_early:
|
|
493
|
+
kind: session.ended
|
|
494
|
+
payload:
|
|
495
|
+
event_id: event_id
|
|
496
|
+
|
|
497
|
+
# ── Flow routing ──
|
|
498
|
+
flow_plot:
|
|
499
|
+
kind: workflow.info
|
|
500
|
+
payload:
|
|
501
|
+
flow_name: flow_name
|
|
502
|
+
conversation_route_selected:
|
|
503
|
+
kind: workflow.routed
|
|
504
|
+
payload:
|
|
505
|
+
flow_name: flow_name
|
|
506
|
+
event_id: event_id
|
|
507
|
+
|
|
508
|
+
# ── Agent logging ──
|
|
509
|
+
agent_logs_started:
|
|
510
|
+
kind: agent.log.started
|
|
511
|
+
payload:
|
|
512
|
+
event_id: event_id
|
|
513
|
+
agent_logs_execution:
|
|
514
|
+
kind: agent.log.entry
|
|
515
|
+
payload:
|
|
516
|
+
event_id: event_id
|
|
517
|
+
|
|
518
|
+
# ── Plan step lifecycle (#41: sibling to step_observation_*) ──
|
|
519
|
+
plan_step_started:
|
|
520
|
+
kind: planning.step.started
|
|
521
|
+
payload:
|
|
522
|
+
event_id: event_id
|
|
523
|
+
plan_step_completed:
|
|
524
|
+
kind: planning.step.completed
|
|
525
|
+
payload:
|
|
526
|
+
event_id: event_id
|
|
527
|
+
success: success
|
|
528
|
+
result: result
|
|
529
|
+
error: error
|
|
530
|
+
|
|
531
|
+
# ── Skill system lifecycle (#41) ──
|
|
532
|
+
skill_discovery_started:
|
|
533
|
+
kind: skill.discovery.started
|
|
534
|
+
payload:
|
|
535
|
+
event_id: event_id
|
|
536
|
+
skill_discovery_completed:
|
|
537
|
+
kind: skill.discovery.completed
|
|
538
|
+
payload:
|
|
539
|
+
event_id: event_id
|
|
540
|
+
skill_loaded:
|
|
541
|
+
kind: skill.loaded
|
|
542
|
+
payload:
|
|
543
|
+
event_id: event_id
|
|
544
|
+
skill_activated:
|
|
545
|
+
kind: skill.activated
|
|
546
|
+
payload:
|
|
547
|
+
event_id: event_id
|
|
548
|
+
skill_load_failed:
|
|
549
|
+
kind: skill.load.failed
|
|
550
|
+
payload:
|
|
551
|
+
event_id: event_id
|
|
552
|
+
error: error
|
|
553
|
+
|
|
554
|
+
# ── A2A (agent-to-agent) protocol (#41/#32) ──
|
|
555
|
+
a2a_delegation_started:
|
|
556
|
+
kind: agent.delegation.started
|
|
557
|
+
payload:
|
|
558
|
+
event_id: event_id
|
|
559
|
+
a2a_delegation_completed:
|
|
560
|
+
kind: agent.delegation.completed
|
|
561
|
+
payload:
|
|
562
|
+
event_id: event_id
|
|
563
|
+
a2a_conversation_started:
|
|
564
|
+
kind: agent.conversation.started
|
|
565
|
+
payload:
|
|
566
|
+
event_id: event_id
|
|
567
|
+
a2a_conversation_completed:
|
|
568
|
+
kind: agent.conversation.completed
|
|
569
|
+
payload:
|
|
570
|
+
event_id: event_id
|
|
571
|
+
a2a_message_sent:
|
|
572
|
+
kind: agent.message.sent
|
|
573
|
+
payload:
|
|
574
|
+
event_id: event_id
|
|
575
|
+
a2a_response_received:
|
|
576
|
+
kind: agent.message.received
|
|
577
|
+
payload:
|
|
578
|
+
event_id: event_id
|
|
579
|
+
a2a_artifact_received:
|
|
580
|
+
kind: agent.artifact.received
|
|
581
|
+
payload:
|
|
582
|
+
event_id: event_id
|
|
583
|
+
a2a_connection_error:
|
|
584
|
+
kind: agent.connection.failed
|
|
585
|
+
payload:
|
|
586
|
+
event_id: event_id
|
|
587
|
+
error: error
|
|
588
|
+
a2a_authentication_failed:
|
|
589
|
+
kind: agent.authentication.failed
|
|
590
|
+
payload:
|
|
591
|
+
event_id: event_id
|
|
592
|
+
error: error
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# Goose event mapping for MappedJsonAdapter
|
|
2
|
+
# Targets: goose >= 1.0 (SQLite messages table, JSON-serialized rows)
|
|
3
|
+
# Source: block/goose crates/goose-providers/src/conversation/message.rs
|
|
4
|
+
#
|
|
5
|
+
# IMPORTANT: Real Goose only has TWO role values: "user" and "assistant".
|
|
6
|
+
# Tool calls are NESTED inside content_json as {"type": "toolRequest", ...}
|
|
7
|
+
# items within the assistant message array. They are NOT separate rows.
|
|
8
|
+
# Tool results are {"type": "toolResponse", ...} nested in user messages.
|
|
9
|
+
#
|
|
10
|
+
# The flat type_field: role approach can ONLY distinguish user/assistant.
|
|
11
|
+
# A GoosePreProcessor is needed to extract nested tool calls into separate events.
|
|
12
|
+
#
|
|
13
|
+
# Real schema: messages table columns:
|
|
14
|
+
# id, message_id, session_id, role, content_json, created_timestamp,
|
|
15
|
+
# timestamp, tokens, metadata_json
|
|
16
|
+
# Session table has: total_tokens, input_tokens, output_tokens,
|
|
17
|
+
# accumulated_total_tokens, accumulated_input_tokens, accumulated_output_tokens,
|
|
18
|
+
# accumulated_cost
|
|
19
|
+
#
|
|
20
|
+
# MessageContent variants (all in content_json array, serde tag="type" camelCase):
|
|
21
|
+
# text, image, toolRequest, toolResponse, toolConfirmationRequest,
|
|
22
|
+
# actionRequired, frontendToolRequest, thinking, redactedThinking,
|
|
23
|
+
# systemNotification
|
|
24
|
+
#
|
|
25
|
+
# Struct field serialization:
|
|
26
|
+
# ToolRequest: {type, id, toolCall: {status, value: {name, arguments}}}
|
|
27
|
+
# ToolResponse: {type, id, toolResult: {status, value: {content: [...]}}}
|
|
28
|
+
# ToolConfirmationRequest: {type, id, toolName, arguments, prompt}
|
|
29
|
+
# FrontendToolRequest: {type, id, toolCall: {status, value: {name, arguments}}}
|
|
30
|
+
# ActionRequired: {type, data: {actionType: "elicitation"|"toolConfirmation"|"elicitationResponse", ...}}
|
|
31
|
+
# SystemNotification: {type, notificationType, msg, data}
|
|
32
|
+
|
|
33
|
+
framework: goose
|
|
34
|
+
framework_version: ">=1.0"
|
|
35
|
+
ingestion_mode: poll
|
|
36
|
+
type_field: role
|
|
37
|
+
timestamp_field: created_timestamp
|
|
38
|
+
preprocessor: goose
|
|
39
|
+
|
|
40
|
+
motivation:
|
|
41
|
+
sources:
|
|
42
|
+
- events: ["assistant"]
|
|
43
|
+
field: content
|
|
44
|
+
role: intent
|
|
45
|
+
- events: ["thinking"]
|
|
46
|
+
field: content
|
|
47
|
+
role: reasoning
|
|
48
|
+
|
|
49
|
+
events:
|
|
50
|
+
# ── REAL messages (preprocessor extracts text from content_json) ──
|
|
51
|
+
user:
|
|
52
|
+
kind: message.user
|
|
53
|
+
payload:
|
|
54
|
+
content: content
|
|
55
|
+
assistant:
|
|
56
|
+
kind: message.assistant
|
|
57
|
+
payload:
|
|
58
|
+
content: content
|
|
59
|
+
|
|
60
|
+
# ── Tool events (preprocessor extracts from nested content_json) ──
|
|
61
|
+
tool_use:
|
|
62
|
+
kind: tool.call.started
|
|
63
|
+
payload:
|
|
64
|
+
tool_name: name
|
|
65
|
+
tool_call_id: id
|
|
66
|
+
arguments: input
|
|
67
|
+
tool_result:
|
|
68
|
+
kind: tool.call.completed
|
|
69
|
+
payload:
|
|
70
|
+
tool_call_id: tool_use_id
|
|
71
|
+
result: content
|
|
72
|
+
success: is_success
|
|
73
|
+
|
|
74
|
+
# ── Additional MessageContent variants (preprocessor extracts from content_json) ──
|
|
75
|
+
thinking:
|
|
76
|
+
kind: reasoning.started
|
|
77
|
+
payload:
|
|
78
|
+
content: thinking
|
|
79
|
+
image:
|
|
80
|
+
kind: message.attachment
|
|
81
|
+
payload:
|
|
82
|
+
content: data
|
|
83
|
+
tool_confirmation_request:
|
|
84
|
+
kind: permission.requested
|
|
85
|
+
payload:
|
|
86
|
+
content: content
|
|
87
|
+
tool_name: name
|
|
88
|
+
action_required:
|
|
89
|
+
kind: input.requested
|
|
90
|
+
payload:
|
|
91
|
+
content: content
|
|
92
|
+
action_type: action_type
|
|
93
|
+
frontend_tool_request:
|
|
94
|
+
kind: tool.call.started
|
|
95
|
+
payload:
|
|
96
|
+
tool_name: name
|
|
97
|
+
tool_call_id: id
|
|
98
|
+
arguments: input
|
|
99
|
+
redacted_thinking:
|
|
100
|
+
kind: reasoning.redacted
|
|
101
|
+
payload:
|
|
102
|
+
data: data
|
|
103
|
+
system_notification:
|
|
104
|
+
kind: session.info
|
|
105
|
+
payload:
|
|
106
|
+
message: content
|
|
107
|
+
|
|
108
|
+
# ── Session lifecycle (from poll metadata) ──
|
|
109
|
+
session_start:
|
|
110
|
+
kind: session.started
|
|
111
|
+
payload:
|
|
112
|
+
model: model
|
|
113
|
+
provider: provider
|
|
114
|
+
session_end:
|
|
115
|
+
kind: session.ended
|
|
116
|
+
payload:
|
|
117
|
+
reason: reason
|
|
118
|
+
|
|
119
|
+
# ── Usage/cost (from session table aggregates) ──
|
|
120
|
+
usage:
|
|
121
|
+
kind: telemetry.usage
|
|
122
|
+
payload:
|
|
123
|
+
input_tokens: input_tokens
|
|
124
|
+
output_tokens: output_tokens
|
|
125
|
+
cache_read_tokens: cache_read_tokens
|
|
126
|
+
cache_write_tokens: cache_write_tokens
|
|
127
|
+
cost_usd: cost_usd
|
|
128
|
+
model: model
|