thread-archive 0.0.2__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.
- thread_archive/__init__.py +34 -0
- thread_archive/_api.py +2235 -0
- thread_archive/_config.py +126 -0
- thread_archive/_importers/__init__.py +81 -0
- thread_archive/_importers/_continuation.py +136 -0
- thread_archive/_importers/_cursor.py +103 -0
- thread_archive/_importers/_events.py +244 -0
- thread_archive/_importers/_line_stream.py +193 -0
- thread_archive/_importers/_read.py +82 -0
- thread_archive/_importers/_result.py +17 -0
- thread_archive/_importers/_sidecar.py +113 -0
- thread_archive/_importers/_state.py +240 -0
- thread_archive/_importers/_titles.py +179 -0
- thread_archive/_importers/antigravity.py +254 -0
- thread_archive/_importers/claude_code.py +293 -0
- thread_archive/_importers/claude_science.py +330 -0
- thread_archive/_importers/cloth.py +20 -0
- thread_archive/_importers/codex.py +324 -0
- thread_archive/_importers/cowork.py +107 -0
- thread_archive/_importers/cursor.py +432 -0
- thread_archive/_importers/exports.py +389 -0
- thread_archive/_importers/grok.py +600 -0
- thread_archive/_importers/opencode.py +538 -0
- thread_archive/_knowledge/__init__.py +67 -0
- thread_archive/_knowledge/_claims.py +116 -0
- thread_archive/_knowledge/_community.py +75 -0
- thread_archive/_knowledge/graph.py +208 -0
- thread_archive/_knowledge/materialize.py +212 -0
- thread_archive/_knowledge/write.py +438 -0
- thread_archive/_launchd.py +167 -0
- thread_archive/_mcp/__init__.py +1 -0
- thread_archive/_mcp/librarian.py +151 -0
- thread_archive/_mcp/server.py +307 -0
- thread_archive/_retrieval/__init__.py +280 -0
- thread_archive/_retrieval/_classify.py +80 -0
- thread_archive/_retrieval/_codex.py +157 -0
- thread_archive/_retrieval/_context.py +123 -0
- thread_archive/_retrieval/_extract.py +184 -0
- thread_archive/_retrieval/embed.py +186 -0
- thread_archive/_retrieval/format.py +149 -0
- thread_archive/_retrieval/fts.py +538 -0
- thread_archive/_retrieval/rank.py +228 -0
- thread_archive/_retrieval/read.py +908 -0
- thread_archive/_retrieval/rerank.py +143 -0
- thread_archive/_retrieval/vectors.py +611 -0
- thread_archive/_scripts/__init__.py +1 -0
- thread_archive/_scripts/backfill_recompute.py +328 -0
- thread_archive/_scripts/backfill_reconcile.py +296 -0
- thread_archive/_scripts/denamespace_dedup_keys.py +120 -0
- thread_archive/_scripts/recover_dropped_events.py +190 -0
- thread_archive/_scripts/repair_grok_tool_names.py +118 -0
- thread_archive/_scripts/repair_grok_tool_names_backup_20260704T155625Z.json +275 -0
- thread_archive/_scripts/repair_grok_tool_names_plan_20260704.json +435 -0
- thread_archive/_setup/__init__.py +12 -0
- thread_archive/_setup/clients.py +89 -0
- thread_archive/_setup/wizard.py +474 -0
- thread_archive/_store/__init__.py +45 -0
- thread_archive/_store/_base.py +173 -0
- thread_archive/_store/_defaults.py +57 -0
- thread_archive/_store/_types.py +38 -0
- thread_archive/_store/models.py +370 -0
- thread_archive/_store/schema.py +84 -0
- thread_archive/_thread_import/__init__.py +40 -0
- thread_archive/_thread_import/api.py +78 -0
- thread_archive/_thread_import/event_builder.py +810 -0
- thread_archive/_thread_import/exporters/__init__.py +9 -0
- thread_archive/_thread_import/exporters/_cursor_kv_mixin.py +166 -0
- thread_archive/_thread_import/exporters/_cursor_parse_mixin.py +149 -0
- thread_archive/_thread_import/exporters/cursor.py +582 -0
- thread_archive/_thread_import/exporters/cursor_parse.py +145 -0
- thread_archive/_thread_import/parsers/__init__.py +191 -0
- thread_archive/_thread_import/parsers/base.py +698 -0
- thread_archive/_thread_import/parsers/chatgpt.py +722 -0
- thread_archive/_thread_import/parsers/chatgpt_content.py +332 -0
- thread_archive/_thread_import/parsers/claude.py +443 -0
- thread_archive/_thread_import/parsers/claude_code.py +1035 -0
- thread_archive/_thread_import/parsers/claude_code_blocks.py +415 -0
- thread_archive/_thread_import/parsers/claude_code_ide.py +122 -0
- thread_archive/_thread_import/parsers/claude_code_sessions.py +90 -0
- thread_archive/_thread_import/parsers/config/__init__.py +26 -0
- thread_archive/_thread_import/parsers/config/base.py +220 -0
- thread_archive/_thread_import/parsers/cursor.py +538 -0
- thread_archive/_thread_import/parsers/cursor_blocks.py +365 -0
- thread_archive/_thread_import/parsers/pipeline/__init__.py +29 -0
- thread_archive/_thread_import/parsers/pipeline/base.py +251 -0
- thread_archive/_thread_import/parsers/pipeline/interfaces.py +191 -0
- thread_archive/_thread_import/parsers/transformers/__init__.py +22 -0
- thread_archive/_thread_import/parsers/transformers/active_path.py +87 -0
- thread_archive/_thread_import/parsers/transformers/coalescing.py +389 -0
- thread_archive/_thread_import/parsers/transformers/ide_context.py +158 -0
- thread_archive/_thread_import/parsers/transformers/thinking_merge.py +68 -0
- thread_archive/_thread_import/parsers/types/__init__.py +56 -0
- thread_archive/_thread_import/parsers/types/chatgpt.py +99 -0
- thread_archive/_thread_import/parsers/types/claude.py +120 -0
- thread_archive/_thread_import/parsers/types/claude_code.py +139 -0
- thread_archive/_thread_import/parsers/types/cursor.py +109 -0
- thread_archive/_thread_import/parsers/validators/__init__.py +83 -0
- thread_archive/_thread_import/parsers/validators/base.py +168 -0
- thread_archive/_thread_import/parsers/validators/content.py +80 -0
- thread_archive/_thread_import/parsers/validators/referential.py +57 -0
- thread_archive/_thread_import/parsers/validators/thinking.py +143 -0
- thread_archive/_thread_import/parsers/validators/types.py +87 -0
- thread_archive/_thread_import/schemas/__init__.py +231 -0
- thread_archive/_thread_import/schemas/chatgpt/v1.json +197 -0
- thread_archive/_thread_import/schemas/chatgpt/v2.json +203 -0
- thread_archive/_thread_import/schemas/claude/v1.json +188 -0
- thread_archive/_thread_import/schemas/claude_code/v1.json +183 -0
- thread_archive/_thread_import/schemas/cursor/v1.json +143 -0
- thread_archive/_thread_import/schemas/cursor/v2.json +200 -0
- thread_archive/_thread_import/timestamps.py +57 -0
- thread_archive/_thread_import/tool_names.py +48 -0
- thread_archive/_truth/__init__.py +40 -0
- thread_archive/_truth/jsonl_log.py +2340 -0
- thread_archive/_truth/repair.py +322 -0
- thread_archive/_watcher/__init__.py +57 -0
- thread_archive/_watcher/base.py +65 -0
- thread_archive/_watcher/daemon.py +289 -0
- thread_archive/_watcher/export_drop.py +203 -0
- thread_archive/_watcher/exthost.py +316 -0
- thread_archive/_watcher/lazy.py +117 -0
- thread_archive/_watcher/sources.py +616 -0
- thread_archive/_web/__init__.py +15 -0
- thread_archive/_web/server.py +299 -0
- thread_archive/_web/static/assets/index-DECSH1Mz.css +10 -0
- thread_archive/_web/static/assets/index-Djq0FK0y.js +101 -0
- thread_archive/_web/static/index.html +13 -0
- thread_archive/cli.py +746 -0
- thread_archive-0.0.2.dist-info/METADATA +296 -0
- thread_archive-0.0.2.dist-info/RECORD +132 -0
- thread_archive-0.0.2.dist-info/WHEEL +4 -0
- thread_archive-0.0.2.dist-info/entry_points.txt +6 -0
- thread_archive-0.0.2.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "chatgpt_export_v2",
|
|
4
|
+
"title": "ChatGPT Export v2",
|
|
5
|
+
"description": "ChatGPT export format with o1 thinking blocks (thoughts, analysis, reasoning_recap)",
|
|
6
|
+
"type": "array",
|
|
7
|
+
"items": {
|
|
8
|
+
"$ref": "#/definitions/conversation"
|
|
9
|
+
},
|
|
10
|
+
"definitions": {
|
|
11
|
+
"conversation": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"required": ["title", "mapping"],
|
|
14
|
+
"properties": {
|
|
15
|
+
"title": {
|
|
16
|
+
"type": ["string", "null"],
|
|
17
|
+
"description": "Conversation title"
|
|
18
|
+
},
|
|
19
|
+
"create_time": {
|
|
20
|
+
"type": ["number", "null"],
|
|
21
|
+
"description": "Unix timestamp when conversation was created"
|
|
22
|
+
},
|
|
23
|
+
"update_time": {
|
|
24
|
+
"type": ["number", "null"],
|
|
25
|
+
"description": "Unix timestamp when conversation was last updated"
|
|
26
|
+
},
|
|
27
|
+
"mapping": {
|
|
28
|
+
"type": "object",
|
|
29
|
+
"additionalProperties": {
|
|
30
|
+
"$ref": "#/definitions/mappingNode"
|
|
31
|
+
},
|
|
32
|
+
"description": "Tree structure of messages"
|
|
33
|
+
},
|
|
34
|
+
"current_node": {
|
|
35
|
+
"type": ["string", "null"],
|
|
36
|
+
"description": "ID of the currently active message node"
|
|
37
|
+
},
|
|
38
|
+
"conversation_template_id": {
|
|
39
|
+
"type": ["string", "null"]
|
|
40
|
+
},
|
|
41
|
+
"gizmo_id": {
|
|
42
|
+
"type": ["string", "null"]
|
|
43
|
+
},
|
|
44
|
+
"id": {
|
|
45
|
+
"type": "string"
|
|
46
|
+
},
|
|
47
|
+
"moderation_results": {
|
|
48
|
+
"type": "array"
|
|
49
|
+
},
|
|
50
|
+
"safe_urls": {
|
|
51
|
+
"type": "array"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"mappingNode": {
|
|
56
|
+
"type": "object",
|
|
57
|
+
"properties": {
|
|
58
|
+
"id": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"description": "Node/message ID"
|
|
61
|
+
},
|
|
62
|
+
"parent": {
|
|
63
|
+
"type": ["string", "null"],
|
|
64
|
+
"description": "Parent node ID (null for root)"
|
|
65
|
+
},
|
|
66
|
+
"children": {
|
|
67
|
+
"type": "array",
|
|
68
|
+
"items": {
|
|
69
|
+
"type": "string"
|
|
70
|
+
},
|
|
71
|
+
"description": "Child node IDs"
|
|
72
|
+
},
|
|
73
|
+
"message": {
|
|
74
|
+
"oneOf": [
|
|
75
|
+
{"$ref": "#/definitions/message"},
|
|
76
|
+
{"type": "null"}
|
|
77
|
+
],
|
|
78
|
+
"description": "Message content (null for structural nodes)"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"message": {
|
|
83
|
+
"type": "object",
|
|
84
|
+
"required": ["id", "author", "content"],
|
|
85
|
+
"properties": {
|
|
86
|
+
"id": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"description": "Message ID"
|
|
89
|
+
},
|
|
90
|
+
"author": {
|
|
91
|
+
"$ref": "#/definitions/author"
|
|
92
|
+
},
|
|
93
|
+
"content": {
|
|
94
|
+
"$ref": "#/definitions/content"
|
|
95
|
+
},
|
|
96
|
+
"create_time": {
|
|
97
|
+
"type": ["number", "null"],
|
|
98
|
+
"description": "Unix timestamp when message was created"
|
|
99
|
+
},
|
|
100
|
+
"update_time": {
|
|
101
|
+
"type": ["number", "null"]
|
|
102
|
+
},
|
|
103
|
+
"status": {
|
|
104
|
+
"type": "string",
|
|
105
|
+
"enum": ["finished_successfully", "in_progress", "finished_partial_completion"]
|
|
106
|
+
},
|
|
107
|
+
"end_turn": {
|
|
108
|
+
"type": ["boolean", "null"]
|
|
109
|
+
},
|
|
110
|
+
"weight": {
|
|
111
|
+
"type": "number"
|
|
112
|
+
},
|
|
113
|
+
"metadata": {
|
|
114
|
+
"$ref": "#/definitions/metadata"
|
|
115
|
+
},
|
|
116
|
+
"recipient": {
|
|
117
|
+
"type": "string"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"author": {
|
|
122
|
+
"type": "object",
|
|
123
|
+
"required": ["role"],
|
|
124
|
+
"properties": {
|
|
125
|
+
"role": {
|
|
126
|
+
"type": "string",
|
|
127
|
+
"enum": ["user", "assistant", "system", "tool"],
|
|
128
|
+
"description": "Message author role"
|
|
129
|
+
},
|
|
130
|
+
"name": {
|
|
131
|
+
"type": ["string", "null"]
|
|
132
|
+
},
|
|
133
|
+
"metadata": {
|
|
134
|
+
"type": "object"
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"content": {
|
|
139
|
+
"type": "object",
|
|
140
|
+
"properties": {
|
|
141
|
+
"content_type": {
|
|
142
|
+
"type": "string",
|
|
143
|
+
"enum": ["text", "code", "execution_output", "tether_browsing_display", "tether_quote", "multimodal_text", "system_error", "thoughts", "analysis", "reasoning_recap"],
|
|
144
|
+
"description": "Content type - v2 adds thoughts, analysis, reasoning_recap for o1 thinking"
|
|
145
|
+
},
|
|
146
|
+
"parts": {
|
|
147
|
+
"type": "array",
|
|
148
|
+
"description": "Content parts (text strings or objects)"
|
|
149
|
+
},
|
|
150
|
+
"language": {
|
|
151
|
+
"type": "string"
|
|
152
|
+
},
|
|
153
|
+
"text": {
|
|
154
|
+
"type": "string"
|
|
155
|
+
},
|
|
156
|
+
"result": {
|
|
157
|
+
"type": "string"
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
"metadata": {
|
|
162
|
+
"type": "object",
|
|
163
|
+
"properties": {
|
|
164
|
+
"is_user_system_message": {
|
|
165
|
+
"type": "boolean",
|
|
166
|
+
"description": "True if this is user's custom instructions"
|
|
167
|
+
},
|
|
168
|
+
"user_context_message_data": {
|
|
169
|
+
"type": "object"
|
|
170
|
+
},
|
|
171
|
+
"model_slug": {
|
|
172
|
+
"type": "string"
|
|
173
|
+
},
|
|
174
|
+
"default_model_slug": {
|
|
175
|
+
"type": "string"
|
|
176
|
+
},
|
|
177
|
+
"finish_details": {
|
|
178
|
+
"type": "object"
|
|
179
|
+
},
|
|
180
|
+
"citations": {
|
|
181
|
+
"type": "array"
|
|
182
|
+
},
|
|
183
|
+
"gizmo_id": {
|
|
184
|
+
"type": ["string", "null"]
|
|
185
|
+
},
|
|
186
|
+
"message_type": {
|
|
187
|
+
"type": ["string", "null"]
|
|
188
|
+
},
|
|
189
|
+
"request_id": {
|
|
190
|
+
"type": "string"
|
|
191
|
+
},
|
|
192
|
+
"timestamp_": {
|
|
193
|
+
"type": "string"
|
|
194
|
+
},
|
|
195
|
+
"content_type": {
|
|
196
|
+
"type": "string",
|
|
197
|
+
"enum": ["thoughts", "analysis", "reasoning_recap"],
|
|
198
|
+
"description": "v2: Thinking block type indicator in metadata"
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "claude_export_v1",
|
|
4
|
+
"title": "Claude Export v1",
|
|
5
|
+
"description": "Claude data export format with conversations, memories, and projects",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"conversations": {
|
|
9
|
+
"type": "array",
|
|
10
|
+
"items": {
|
|
11
|
+
"$ref": "#/definitions/conversation"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"memories": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"properties": {
|
|
17
|
+
"project_memories": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"additionalProperties": {
|
|
20
|
+
"type": "string"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"projects": {
|
|
26
|
+
"type": "array",
|
|
27
|
+
"items": {
|
|
28
|
+
"$ref": "#/definitions/project"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"users": {
|
|
32
|
+
"type": "array",
|
|
33
|
+
"items": {
|
|
34
|
+
"$ref": "#/definitions/user"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"definitions": {
|
|
39
|
+
"conversation": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"required": ["uuid"],
|
|
42
|
+
"properties": {
|
|
43
|
+
"uuid": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"description": "Unique conversation identifier"
|
|
46
|
+
},
|
|
47
|
+
"name": {
|
|
48
|
+
"type": ["string", "null"],
|
|
49
|
+
"description": "Conversation title"
|
|
50
|
+
},
|
|
51
|
+
"summary": {
|
|
52
|
+
"type": ["string", "null"],
|
|
53
|
+
"description": "Conversation summary"
|
|
54
|
+
},
|
|
55
|
+
"created_at": {
|
|
56
|
+
"type": ["string", "null"],
|
|
57
|
+
"description": "ISO timestamp"
|
|
58
|
+
},
|
|
59
|
+
"updated_at": {
|
|
60
|
+
"type": ["string", "null"],
|
|
61
|
+
"description": "ISO timestamp"
|
|
62
|
+
},
|
|
63
|
+
"account": {
|
|
64
|
+
"type": "object",
|
|
65
|
+
"properties": {
|
|
66
|
+
"uuid": {"type": "string"}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"project": {
|
|
70
|
+
"type": ["object", "null"],
|
|
71
|
+
"properties": {
|
|
72
|
+
"uuid": {"type": "string"}
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"chat_messages": {
|
|
76
|
+
"type": "array",
|
|
77
|
+
"items": {
|
|
78
|
+
"$ref": "#/definitions/message"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"message": {
|
|
84
|
+
"type": "object",
|
|
85
|
+
"required": ["uuid", "sender"],
|
|
86
|
+
"properties": {
|
|
87
|
+
"uuid": {
|
|
88
|
+
"type": "string",
|
|
89
|
+
"description": "Unique message identifier"
|
|
90
|
+
},
|
|
91
|
+
"sender": {
|
|
92
|
+
"type": "string",
|
|
93
|
+
"enum": ["human", "assistant"],
|
|
94
|
+
"description": "Message author"
|
|
95
|
+
},
|
|
96
|
+
"text": {
|
|
97
|
+
"type": ["string", "null"],
|
|
98
|
+
"description": "Legacy text field"
|
|
99
|
+
},
|
|
100
|
+
"content": {
|
|
101
|
+
"type": "array",
|
|
102
|
+
"items": {
|
|
103
|
+
"$ref": "#/definitions/contentBlock"
|
|
104
|
+
},
|
|
105
|
+
"description": "Content blocks"
|
|
106
|
+
},
|
|
107
|
+
"created_at": {
|
|
108
|
+
"type": ["string", "null"],
|
|
109
|
+
"description": "ISO timestamp"
|
|
110
|
+
},
|
|
111
|
+
"updated_at": {
|
|
112
|
+
"type": ["string", "null"],
|
|
113
|
+
"description": "ISO timestamp"
|
|
114
|
+
},
|
|
115
|
+
"attachments": {
|
|
116
|
+
"type": "array"
|
|
117
|
+
},
|
|
118
|
+
"files": {
|
|
119
|
+
"type": "array"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"contentBlock": {
|
|
124
|
+
"type": "object",
|
|
125
|
+
"required": ["type"],
|
|
126
|
+
"properties": {
|
|
127
|
+
"type": {
|
|
128
|
+
"type": "string",
|
|
129
|
+
"enum": ["text", "tool_use", "tool_result", "token_budget"],
|
|
130
|
+
"description": "Block type"
|
|
131
|
+
},
|
|
132
|
+
"text": {
|
|
133
|
+
"type": "string"
|
|
134
|
+
},
|
|
135
|
+
"name": {
|
|
136
|
+
"type": "string"
|
|
137
|
+
},
|
|
138
|
+
"input": {
|
|
139
|
+
"type": "object"
|
|
140
|
+
},
|
|
141
|
+
"content": {},
|
|
142
|
+
"is_error": {
|
|
143
|
+
"type": "boolean"
|
|
144
|
+
},
|
|
145
|
+
"start_timestamp": {
|
|
146
|
+
"type": ["string", "null"]
|
|
147
|
+
},
|
|
148
|
+
"stop_timestamp": {
|
|
149
|
+
"type": ["string", "null"]
|
|
150
|
+
},
|
|
151
|
+
"message": {
|
|
152
|
+
"type": ["string", "null"]
|
|
153
|
+
},
|
|
154
|
+
"display_content": {}
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
"project": {
|
|
158
|
+
"type": "object",
|
|
159
|
+
"required": ["uuid"],
|
|
160
|
+
"properties": {
|
|
161
|
+
"uuid": {
|
|
162
|
+
"type": "string"
|
|
163
|
+
},
|
|
164
|
+
"name": {
|
|
165
|
+
"type": ["string", "null"]
|
|
166
|
+
},
|
|
167
|
+
"description": {
|
|
168
|
+
"type": ["string", "null"]
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"user": {
|
|
173
|
+
"type": "object",
|
|
174
|
+
"required": ["uuid"],
|
|
175
|
+
"properties": {
|
|
176
|
+
"uuid": {
|
|
177
|
+
"type": "string"
|
|
178
|
+
},
|
|
179
|
+
"full_name": {
|
|
180
|
+
"type": ["string", "null"]
|
|
181
|
+
},
|
|
182
|
+
"email": {
|
|
183
|
+
"type": ["string", "null"]
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "claude_code_export_v1",
|
|
4
|
+
"title": "Claude Code Export v1",
|
|
5
|
+
"description": "Claude Code session format (JSONL from ~/.claude/projects/)",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"provider": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"const": "claude-code"
|
|
11
|
+
},
|
|
12
|
+
"export_version": {
|
|
13
|
+
"type": "string"
|
|
14
|
+
},
|
|
15
|
+
"sessions": {
|
|
16
|
+
"type": "array",
|
|
17
|
+
"items": {
|
|
18
|
+
"$ref": "#/definitions/session"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"definitions": {
|
|
23
|
+
"session": {
|
|
24
|
+
"type": "object",
|
|
25
|
+
"required": ["session_id"],
|
|
26
|
+
"properties": {
|
|
27
|
+
"session_id": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"description": "Session identifier"
|
|
30
|
+
},
|
|
31
|
+
"project_path": {
|
|
32
|
+
"type": ["string", "null"],
|
|
33
|
+
"description": "Path to the project"
|
|
34
|
+
},
|
|
35
|
+
"is_subagent": {
|
|
36
|
+
"type": "boolean",
|
|
37
|
+
"description": "True if this is a subagent session"
|
|
38
|
+
},
|
|
39
|
+
"parent_session_id": {
|
|
40
|
+
"type": ["string", "null"],
|
|
41
|
+
"description": "Parent session ID for subagent sessions"
|
|
42
|
+
},
|
|
43
|
+
"lines": {
|
|
44
|
+
"type": "array",
|
|
45
|
+
"items": {
|
|
46
|
+
"$ref": "#/definitions/line"
|
|
47
|
+
},
|
|
48
|
+
"description": "JSONL lines from session file"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"line": {
|
|
53
|
+
"type": "object",
|
|
54
|
+
"description": "A single JSONL line from Claude Code session",
|
|
55
|
+
"properties": {
|
|
56
|
+
"type": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"enum": ["user", "assistant", "summary", "file-history-snapshot", "token_budget", "parse_error"],
|
|
59
|
+
"description": "Message type"
|
|
60
|
+
},
|
|
61
|
+
"uuid": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"description": "Message UUID"
|
|
64
|
+
},
|
|
65
|
+
"parentUuid": {
|
|
66
|
+
"type": ["string", "null"],
|
|
67
|
+
"description": "Parent message UUID"
|
|
68
|
+
},
|
|
69
|
+
"timestamp": {
|
|
70
|
+
"type": "string",
|
|
71
|
+
"description": "ISO timestamp"
|
|
72
|
+
},
|
|
73
|
+
"message": {
|
|
74
|
+
"oneOf": [
|
|
75
|
+
{"type": "string"},
|
|
76
|
+
{"$ref": "#/definitions/messageContent"}
|
|
77
|
+
],
|
|
78
|
+
"description": "Message content (string for user, object for assistant)"
|
|
79
|
+
},
|
|
80
|
+
"content": {
|
|
81
|
+
"$ref": "#/definitions/messageContent",
|
|
82
|
+
"description": "Alternative content field"
|
|
83
|
+
},
|
|
84
|
+
"cwd": {
|
|
85
|
+
"type": "string",
|
|
86
|
+
"description": "Current working directory"
|
|
87
|
+
},
|
|
88
|
+
"sessionId": {
|
|
89
|
+
"type": "string"
|
|
90
|
+
},
|
|
91
|
+
"version": {
|
|
92
|
+
"type": "string"
|
|
93
|
+
},
|
|
94
|
+
"summary": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"description": "Summary text for summary type messages"
|
|
97
|
+
},
|
|
98
|
+
"leafUuid": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"description": "Leaf UUID for summary messages"
|
|
101
|
+
},
|
|
102
|
+
"summarizes": {
|
|
103
|
+
"type": "array",
|
|
104
|
+
"items": {"type": "string"},
|
|
105
|
+
"description": "UUIDs of messages being summarized"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"messageContent": {
|
|
110
|
+
"type": "object",
|
|
111
|
+
"description": "Structured message content (assistant messages)",
|
|
112
|
+
"properties": {
|
|
113
|
+
"text": {
|
|
114
|
+
"type": "string"
|
|
115
|
+
},
|
|
116
|
+
"thinking": {
|
|
117
|
+
"type": "string",
|
|
118
|
+
"description": "Extended thinking content (REQUIRED for claude-code)"
|
|
119
|
+
},
|
|
120
|
+
"content": {
|
|
121
|
+
"type": "array",
|
|
122
|
+
"items": {
|
|
123
|
+
"$ref": "#/definitions/contentBlock"
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"model": {
|
|
127
|
+
"type": "string"
|
|
128
|
+
},
|
|
129
|
+
"costUSD": {
|
|
130
|
+
"type": "number"
|
|
131
|
+
},
|
|
132
|
+
"durationMs": {
|
|
133
|
+
"type": "number"
|
|
134
|
+
},
|
|
135
|
+
"inputTokens": {
|
|
136
|
+
"type": "number"
|
|
137
|
+
},
|
|
138
|
+
"outputTokens": {
|
|
139
|
+
"type": "number"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"contentBlock": {
|
|
144
|
+
"type": "object",
|
|
145
|
+
"description": "Content block in assistant message",
|
|
146
|
+
"properties": {
|
|
147
|
+
"type": {
|
|
148
|
+
"type": "string",
|
|
149
|
+
"enum": ["text", "thinking", "tool_use", "tool_result"],
|
|
150
|
+
"description": "Block type"
|
|
151
|
+
},
|
|
152
|
+
"text": {
|
|
153
|
+
"type": "string"
|
|
154
|
+
},
|
|
155
|
+
"thinking": {
|
|
156
|
+
"type": "string"
|
|
157
|
+
},
|
|
158
|
+
"id": {
|
|
159
|
+
"type": "string",
|
|
160
|
+
"description": "Tool use ID"
|
|
161
|
+
},
|
|
162
|
+
"name": {
|
|
163
|
+
"type": "string",
|
|
164
|
+
"description": "Tool name"
|
|
165
|
+
},
|
|
166
|
+
"input": {
|
|
167
|
+
"type": "object",
|
|
168
|
+
"description": "Tool input arguments"
|
|
169
|
+
},
|
|
170
|
+
"tool_use_id": {
|
|
171
|
+
"type": "string",
|
|
172
|
+
"description": "Reference to tool_use block"
|
|
173
|
+
},
|
|
174
|
+
"content": {
|
|
175
|
+
"description": "Tool result content"
|
|
176
|
+
},
|
|
177
|
+
"is_error": {
|
|
178
|
+
"type": "boolean"
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|