@cchistory/lite 0.8.3 → 0.9.0

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 (149) hide show
  1. package/INSTALL.md +1 -1
  2. package/apps/lite-cli/dist/version.d.ts +1 -1
  3. package/apps/lite-cli/dist/version.js +1 -1
  4. package/apps/lite-tui/dist/render.d.ts +1 -1
  5. package/apps/lite-tui/dist/version.d.ts +1 -1
  6. package/apps/lite-tui/dist/version.js +1 -1
  7. package/node_modules/@cchistory/canonical/dist/query.js +1 -1
  8. package/node_modules/@cchistory/canonical/dist/query.js.map +1 -1
  9. package/node_modules/@cchistory/canonical/dist/tool-call-summary.d.ts.map +1 -1
  10. package/node_modules/@cchistory/canonical/dist/tool-call-summary.js +10 -2
  11. package/node_modules/@cchistory/canonical/dist/tool-call-summary.js.map +1 -1
  12. package/node_modules/@cchistory/canonical/dist/usage-anomalies.d.ts.map +1 -1
  13. package/node_modules/@cchistory/canonical/dist/usage-anomalies.js +2 -0
  14. package/node_modules/@cchistory/canonical/dist/usage-anomalies.js.map +1 -1
  15. package/node_modules/@cchistory/canonical/dist/usage-call-evaluation.d.ts.map +1 -1
  16. package/node_modules/@cchistory/canonical/dist/usage-call-evaluation.js +4 -1
  17. package/node_modules/@cchistory/canonical/dist/usage-call-evaluation.js.map +1 -1
  18. package/node_modules/@cchistory/canonical/dist/usage-trace.d.ts.map +1 -1
  19. package/node_modules/@cchistory/canonical/dist/usage-trace.js +3 -1
  20. package/node_modules/@cchistory/canonical/dist/usage-trace.js.map +1 -1
  21. package/node_modules/@cchistory/canonical/dist/usage-trace.test.js +73 -0
  22. package/node_modules/@cchistory/canonical/dist/usage-trace.test.js.map +1 -1
  23. package/node_modules/@cchistory/canonical/dist/usage.d.ts +1 -0
  24. package/node_modules/@cchistory/canonical/dist/usage.d.ts.map +1 -1
  25. package/node_modules/@cchistory/canonical/dist/usage.js +23 -17
  26. package/node_modules/@cchistory/canonical/dist/usage.js.map +1 -1
  27. package/node_modules/@cchistory/canonical/package.json +1 -1
  28. package/node_modules/@cchistory/domain/dist/index.d.ts +3 -1
  29. package/node_modules/@cchistory/domain/dist/index.d.ts.map +1 -1
  30. package/node_modules/@cchistory/domain/dist/index.js.map +1 -1
  31. package/node_modules/@cchistory/domain/dist/index.test.js +10 -1
  32. package/node_modules/@cchistory/domain/dist/index.test.js.map +1 -1
  33. package/node_modules/@cchistory/domain/dist/token-evidence.d.ts.map +1 -1
  34. package/node_modules/@cchistory/domain/dist/token-evidence.js +3 -1
  35. package/node_modules/@cchistory/domain/dist/token-evidence.js.map +1 -1
  36. package/node_modules/@cchistory/domain/package.json +1 -1
  37. package/node_modules/@cchistory/live-runtime/dist/index.d.ts +2 -0
  38. package/node_modules/@cchistory/live-runtime/dist/index.d.ts.map +1 -1
  39. package/node_modules/@cchistory/live-runtime/dist/index.js +1 -0
  40. package/node_modules/@cchistory/live-runtime/dist/index.js.map +1 -1
  41. package/node_modules/@cchistory/live-runtime/dist/index.test.js +266 -38
  42. package/node_modules/@cchistory/live-runtime/dist/index.test.js.map +1 -1
  43. package/node_modules/@cchistory/live-runtime/package.json +1 -1
  44. package/node_modules/@cchistory/source-adapters/dist/core/conversation-seeds.d.ts +3 -0
  45. package/node_modules/@cchistory/source-adapters/dist/core/conversation-seeds.d.ts.map +1 -1
  46. package/node_modules/@cchistory/source-adapters/dist/core/conversation-seeds.js.map +1 -1
  47. package/node_modules/@cchistory/source-adapters/dist/core/discovery.d.ts.map +1 -1
  48. package/node_modules/@cchistory/source-adapters/dist/core/discovery.js +60 -4
  49. package/node_modules/@cchistory/source-adapters/dist/core/discovery.js.map +1 -1
  50. package/node_modules/@cchistory/source-adapters/dist/core/parser.d.ts +1 -1
  51. package/node_modules/@cchistory/source-adapters/dist/core/parser.d.ts.map +1 -1
  52. package/node_modules/@cchistory/source-adapters/dist/core/parser.js +198 -1
  53. package/node_modules/@cchistory/source-adapters/dist/core/parser.js.map +1 -1
  54. package/node_modules/@cchistory/source-adapters/dist/core/probe.d.ts.map +1 -1
  55. package/node_modules/@cchistory/source-adapters/dist/core/probe.js +85 -5
  56. package/node_modules/@cchistory/source-adapters/dist/core/probe.js.map +1 -1
  57. package/node_modules/@cchistory/source-adapters/dist/core/registry.test.js +17 -1
  58. package/node_modules/@cchistory/source-adapters/dist/core/registry.test.js.map +1 -1
  59. package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.d.ts.map +1 -1
  60. package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.js +44 -0
  61. package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.js.map +1 -1
  62. package/node_modules/@cchistory/source-adapters/dist/core/source-identity.d.ts.map +1 -1
  63. package/node_modules/@cchistory/source-adapters/dist/core/source-identity.js +12 -0
  64. package/node_modules/@cchistory/source-adapters/dist/core/source-identity.js.map +1 -1
  65. package/node_modules/@cchistory/source-adapters/dist/index.test.d.ts +4 -0
  66. package/node_modules/@cchistory/source-adapters/dist/index.test.d.ts.map +1 -1
  67. package/node_modules/@cchistory/source-adapters/dist/index.test.js +4 -0
  68. package/node_modules/@cchistory/source-adapters/dist/index.test.js.map +1 -1
  69. package/node_modules/@cchistory/source-adapters/dist/platforms/cursor-agent.test.js +2 -0
  70. package/node_modules/@cchistory/source-adapters/dist/platforms/cursor-agent.test.js.map +1 -1
  71. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness/reader.d.ts +28 -0
  72. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness/reader.d.ts.map +1 -0
  73. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness/reader.js +443 -0
  74. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness/reader.js.map +1 -0
  75. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness/runtime.d.ts +4 -0
  76. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness/runtime.d.ts.map +1 -0
  77. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness/runtime.js +370 -0
  78. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness/runtime.js.map +1 -0
  79. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness.d.ts +3 -0
  80. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness.d.ts.map +1 -0
  81. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness.js +78 -0
  82. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness.js.map +1 -0
  83. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness.test.d.ts +2 -0
  84. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness.test.d.ts.map +1 -0
  85. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness.test.js +313 -0
  86. package/node_modules/@cchistory/source-adapters/dist/platforms/deepseek-harness.test.js.map +1 -0
  87. package/node_modules/@cchistory/source-adapters/dist/platforms/generic/runtime.d.ts.map +1 -1
  88. package/node_modules/@cchistory/source-adapters/dist/platforms/generic/runtime.js +14 -0
  89. package/node_modules/@cchistory/source-adapters/dist/platforms/generic/runtime.js.map +1 -1
  90. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes/runtime.d.ts +4 -0
  91. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes/runtime.d.ts.map +1 -0
  92. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes/runtime.js +306 -0
  93. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes/runtime.js.map +1 -0
  94. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes/sqlite.d.ts +8 -0
  95. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes/sqlite.d.ts.map +1 -0
  96. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes/sqlite.js +499 -0
  97. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes/sqlite.js.map +1 -0
  98. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes.d.ts +9 -0
  99. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes.d.ts.map +1 -0
  100. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes.js +53 -0
  101. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes.js.map +1 -0
  102. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes.test.d.ts +2 -0
  103. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes.test.d.ts.map +1 -0
  104. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes.test.js +314 -0
  105. package/node_modules/@cchistory/source-adapters/dist/platforms/hermes.test.js.map +1 -0
  106. package/node_modules/@cchistory/source-adapters/dist/platforms/oh-my-pi.d.ts +9 -0
  107. package/node_modules/@cchistory/source-adapters/dist/platforms/oh-my-pi.d.ts.map +1 -0
  108. package/node_modules/@cchistory/source-adapters/dist/platforms/oh-my-pi.js +84 -0
  109. package/node_modules/@cchistory/source-adapters/dist/platforms/oh-my-pi.js.map +1 -0
  110. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode/sqlite-records.d.ts +50 -0
  111. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode/sqlite-records.d.ts.map +1 -0
  112. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode/sqlite-records.js +291 -0
  113. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode/sqlite-records.js.map +1 -0
  114. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode/sqlite.d.ts +8 -0
  115. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode/sqlite.d.ts.map +1 -0
  116. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode/sqlite.js +321 -0
  117. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode/sqlite.js.map +1 -0
  118. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode-sqlite.test.d.ts +2 -0
  119. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode-sqlite.test.d.ts.map +1 -0
  120. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode-sqlite.test.js +245 -0
  121. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode-sqlite.test.js.map +1 -0
  122. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode.d.ts.map +1 -1
  123. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode.js +30 -7
  124. package/node_modules/@cchistory/source-adapters/dist/platforms/opencode.js.map +1 -1
  125. package/node_modules/@cchistory/source-adapters/dist/platforms/pi-family/reader.d.ts +44 -0
  126. package/node_modules/@cchistory/source-adapters/dist/platforms/pi-family/reader.d.ts.map +1 -0
  127. package/node_modules/@cchistory/source-adapters/dist/platforms/pi-family/reader.js +533 -0
  128. package/node_modules/@cchistory/source-adapters/dist/platforms/pi-family/reader.js.map +1 -0
  129. package/node_modules/@cchistory/source-adapters/dist/platforms/pi-family/runtime.d.ts +4 -0
  130. package/node_modules/@cchistory/source-adapters/dist/platforms/pi-family/runtime.d.ts.map +1 -0
  131. package/node_modules/@cchistory/source-adapters/dist/platforms/pi-family/runtime.js +375 -0
  132. package/node_modules/@cchistory/source-adapters/dist/platforms/pi-family/runtime.js.map +1 -0
  133. package/node_modules/@cchistory/source-adapters/dist/platforms/pi-family.test.d.ts +2 -0
  134. package/node_modules/@cchistory/source-adapters/dist/platforms/pi-family.test.d.ts.map +1 -0
  135. package/node_modules/@cchistory/source-adapters/dist/platforms/pi-family.test.js +346 -0
  136. package/node_modules/@cchistory/source-adapters/dist/platforms/pi-family.test.js.map +1 -0
  137. package/node_modules/@cchistory/source-adapters/dist/platforms/pi.d.ts +8 -0
  138. package/node_modules/@cchistory/source-adapters/dist/platforms/pi.d.ts.map +1 -0
  139. package/node_modules/@cchistory/source-adapters/dist/platforms/pi.js +60 -0
  140. package/node_modules/@cchistory/source-adapters/dist/platforms/pi.js.map +1 -0
  141. package/node_modules/@cchistory/source-adapters/dist/platforms/registry.d.ts.map +1 -1
  142. package/node_modules/@cchistory/source-adapters/dist/platforms/registry.js +8 -0
  143. package/node_modules/@cchistory/source-adapters/dist/platforms/registry.js.map +1 -1
  144. package/node_modules/@cchistory/source-adapters/dist/platforms/types.d.ts +3 -1
  145. package/node_modules/@cchistory/source-adapters/dist/platforms/types.d.ts.map +1 -1
  146. package/node_modules/@cchistory/source-adapters/dist/platforms/types.js +5 -1
  147. package/node_modules/@cchistory/source-adapters/dist/platforms/types.js.map +1 -1
  148. package/node_modules/@cchistory/source-adapters/package.json +1 -1
  149. package/package.json +5 -5
@@ -0,0 +1,306 @@
1
+ export function parseHermesRecord(context, record, parsed, draft, helpers) {
2
+ const fragments = [];
3
+ const lossAudits = [];
4
+ const timeKey = helpers.coerceIso(parsed.timestamp) ??
5
+ helpers.coerceIso(parsed.started_at) ??
6
+ record.observed_at ??
7
+ helpers.nowIso();
8
+ const push = (fragmentKind, payload) => {
9
+ fragments.push(helpers.createFragment(context, record, fragments.length, fragmentKind, timeKey, payload));
10
+ };
11
+ const loss = (detail, diagnosticCode, severity = "info") => {
12
+ lossAudits.push(helpers.createRecordLossAudit(context, record, "unknown_fragment", detail, {
13
+ diagnosticCode,
14
+ severity,
15
+ }));
16
+ };
17
+ const kind = helpers.asString(parsed.kind) ?? recordKindFromPointer(record.record_path_or_offset);
18
+ if (kind === "session") {
19
+ appendSessionMetadata(helpers, parsed, draft, timeKey, push, loss);
20
+ return { fragments, lossAudits };
21
+ }
22
+ if (kind === "usage") {
23
+ appendSessionUsage(context, helpers, record, parsed, timeKey, fragments);
24
+ return { fragments, lossAudits };
25
+ }
26
+ if (kind === "message") {
27
+ appendMessage(helpers, parsed, push, loss);
28
+ return { fragments, lossAudits };
29
+ }
30
+ loss(`Unhandled Hermes Agent record kind: ${kind ?? "unknown"}`, "hermes_unhandled_record_kind", "warning");
31
+ return { fragments, lossAudits };
32
+ }
33
+ function recordKindFromPointer(pointer) {
34
+ if (pointer === "sqlite:sessions")
35
+ return "session";
36
+ if (pointer.startsWith("sqlite:session_model_usage") || pointer === "sqlite:sessions:usage")
37
+ return "usage";
38
+ if (pointer.startsWith("sqlite:messages["))
39
+ return "message";
40
+ return undefined;
41
+ }
42
+ function appendSessionMetadata(helpers, parsed, draft, timeKey, push, loss) {
43
+ const title = helpers.asString(parsed.title);
44
+ const model = helpers.asString(parsed.model);
45
+ const workingDirectory = helpers.asString(parsed.cwd) ?? helpers.asString(parsed.working_directory);
46
+ if (title) {
47
+ draft.title = title;
48
+ }
49
+ if (model) {
50
+ draft.model = model;
51
+ }
52
+ if (workingDirectory) {
53
+ draft.working_directory = workingDirectory;
54
+ }
55
+ push("session_meta", parsed);
56
+ if (title) {
57
+ push("title_signal", { title, title_source: "hermes_sessions_title" });
58
+ }
59
+ if (workingDirectory) {
60
+ push("workspace_signal", { path: workingDirectory });
61
+ }
62
+ if (model) {
63
+ push("model_signal", { model });
64
+ }
65
+ const lineageKind = helpers.asString(parsed.lineage_kind);
66
+ const lineageParent = helpers.asString(parsed.lineage_parent);
67
+ const sessionId = helpers.asString(parsed.id);
68
+ if (lineageKind === "delegate" && lineageParent) {
69
+ const childId = sessionId ?? helpers.asString(parsed.child_session_id);
70
+ push("session_relation", {
71
+ parent_uuid: lineageParent,
72
+ child_session_id: childId,
73
+ is_sidechain: true,
74
+ relation_source: "hermes_model_config_delegate",
75
+ });
76
+ return;
77
+ }
78
+ if (lineageKind && lineageParent) {
79
+ // Compression resets and user branches continue a conversation; they are
80
+ // not delegated work, so the continuation stays a top-level session.
81
+ loss(`Hermes session ${sessionId ?? "?"} continues a ${lineageKind} lineage of ${lineageParent}; kept as its own top-level session.`, "hermes_lineage_continuation");
82
+ }
83
+ }
84
+ function appendSessionUsage(context, helpers, record, parsed, timeKey, fragments) {
85
+ const usage = {
86
+ input_tokens: helpers.asNumber(parsed.input_tokens),
87
+ output_tokens: helpers.asNumber(parsed.output_tokens),
88
+ cache_read_input_tokens: helpers.asNumber(parsed.cache_read_tokens),
89
+ cache_creation_input_tokens: helpers.asNumber(parsed.cache_write_tokens),
90
+ reasoning_output_tokens: helpers.asNumber(parsed.reasoning_tokens),
91
+ model: helpers.asString(parsed.model),
92
+ };
93
+ // Hermes' reasoning_tokens is a subset of output_tokens, so it must not be
94
+ // added to the total a second time.
95
+ const total = [
96
+ usage.input_tokens,
97
+ usage.output_tokens,
98
+ usage.cache_read_input_tokens,
99
+ usage.cache_creation_input_tokens,
100
+ ].reduce((sum, value) => sum + (value ?? 0), 0);
101
+ if (total <= 0) {
102
+ return;
103
+ }
104
+ fragments.push(helpers.createTokenUsageFragment(context, record, fragments.length, timeKey, { ...usage, total_tokens: total }, undefined, {
105
+ // Each per-model row is an independent aggregate record. Without an
106
+ // independent identity canonical can attach it to whichever reply happens
107
+ // to be last, and loses it entirely when that reply is missing.
108
+ independent_usage_event_id: record.id,
109
+ scope: "session",
110
+ source_event_type: "hermes_session_usage",
111
+ ...(helpers.asString(parsed.provider) ? { billing_provider: helpers.asString(parsed.provider) } : {}),
112
+ ...(helpers.asNumber(parsed.api_calls) !== undefined ? { api_call_count: helpers.asNumber(parsed.api_calls) } : {}),
113
+ ...(helpers.asString(parsed.task) ? { task: helpers.asString(parsed.task) } : {}),
114
+ }));
115
+ }
116
+ function appendMessage(helpers, parsed, push, loss) {
117
+ const role = helpers.asString(parsed.role);
118
+ if (!role) {
119
+ loss("Hermes message row has no role; kept only as a diagnostic.", "hermes_message_role_missing", "warning");
120
+ return;
121
+ }
122
+ const messageId = helpers.asNumber(parsed.id);
123
+ const content = parsed.content;
124
+ if (parsed.display_only === true) {
125
+ // UI-only notifications (failed turn, internal notification, process
126
+ // completion) are evidence, not conversation turns or assistant replies.
127
+ appendContentItems(helpers, content, push, loss, {
128
+ actorKind: "system",
129
+ originKind: "source_instruction",
130
+ displayPolicy: "collapse",
131
+ messageId,
132
+ });
133
+ return;
134
+ }
135
+ const summaryContent = helpers.asString(parsed.summary_content);
136
+ if (summaryContent) {
137
+ // Compression handoff is model-facing context, not a human submission.
138
+ push("text", {
139
+ actor_kind: "system",
140
+ origin_kind: "source_instruction",
141
+ display_policy: "collapse",
142
+ synthetic: true,
143
+ text: summaryContent,
144
+ ...(messageId !== undefined ? { message_id: String(messageId) } : {}),
145
+ });
146
+ }
147
+ if (parsed.hidden === true) {
148
+ return;
149
+ }
150
+ if (role === "user") {
151
+ if (parsed.synthetic_user === true || parsed.display_only === true) {
152
+ // Compression summaries and UI-only rows are model-facing context, not
153
+ // human submissions; they must not create a turn.
154
+ appendContentItems(helpers, content, push, loss, {
155
+ actorKind: "system",
156
+ originKind: "source_instruction",
157
+ displayPolicy: "collapse",
158
+ messageId,
159
+ });
160
+ return;
161
+ }
162
+ appendContentItems(helpers, content, push, loss, {
163
+ actorKind: "user",
164
+ originKind: "user_authored",
165
+ displayPolicy: "show",
166
+ messageId,
167
+ });
168
+ return;
169
+ }
170
+ if (role === "assistant") {
171
+ appendContentItems(helpers, content, push, loss, {
172
+ actorKind: "assistant",
173
+ originKind: "assistant_authored",
174
+ displayPolicy: "show",
175
+ messageId,
176
+ stopReason: helpers.normalizeStopReason(parsed.finish_reason),
177
+ });
178
+ appendReasoning(helpers, parsed, push, messageId);
179
+ appendToolCalls(helpers, parsed, push, loss);
180
+ return;
181
+ }
182
+ if (role === "tool") {
183
+ const output = helpers.stringifyToolContent(content);
184
+ push("tool_result", {
185
+ call_id: helpers.asString(parsed.tool_call_id),
186
+ tool_name: helpers.asString(parsed.tool_name),
187
+ output,
188
+ source_event_type: "hermes_tool_message",
189
+ });
190
+ return;
191
+ }
192
+ if (role === "system") {
193
+ // System prompts are model-facing configuration, not conversation. Keep a
194
+ // diagnostic so the omission is visible instead of silent.
195
+ loss("Hermes system message was not projected as conversation evidence.", "hermes_system_message_not_projected");
196
+ return;
197
+ }
198
+ loss(`Unhandled Hermes Agent message role: ${role}`, "hermes_unhandled_message_role", "warning");
199
+ }
200
+ function appendContentItems(helpers, content, push, loss, options) {
201
+ const pushText = (text) => {
202
+ if (!text?.trim()) {
203
+ return;
204
+ }
205
+ push("text", {
206
+ actor_kind: options.actorKind,
207
+ origin_kind: options.originKind,
208
+ text,
209
+ display_policy: options.displayPolicy,
210
+ ...(options.messageId !== undefined ? { message_id: String(options.messageId) } : {}),
211
+ ...(options.stopReason ? { stop_reason: options.stopReason } : {}),
212
+ });
213
+ };
214
+ if (typeof content === "string") {
215
+ pushText(content);
216
+ return;
217
+ }
218
+ if (Array.isArray(content)) {
219
+ for (const item of content) {
220
+ if (!helpers.isObject(item)) {
221
+ continue;
222
+ }
223
+ const itemType = helpers.asString(item.type);
224
+ if (itemType === "text" || itemType === "input_text" || itemType === "output_text") {
225
+ pushText(helpers.asString(item.text));
226
+ continue;
227
+ }
228
+ if (itemType === "image_url" ||
229
+ itemType === "input_image" ||
230
+ itemType === "image") {
231
+ loss("Hermes image content was not projected as conversation text.", "hermes_image_content_not_projected");
232
+ continue;
233
+ }
234
+ if (itemType === "file" || itemType === "input_file") {
235
+ const label = helpers.asString(item.filename) ??
236
+ helpers.asString(item.path) ??
237
+ helpers.asString(item.name) ??
238
+ "file";
239
+ pushText(`[file] ${label}`);
240
+ continue;
241
+ }
242
+ loss(`Unsupported Hermes content part type: ${String(itemType)}`, "hermes_unsupported_content_part");
243
+ }
244
+ return;
245
+ }
246
+ if (helpers.isObject(content)) {
247
+ pushText(helpers.asString(content.text));
248
+ return;
249
+ }
250
+ }
251
+ function appendReasoning(helpers, parsed, push, messageId) {
252
+ const reasoning = helpers.asString(parsed.reasoning);
253
+ if (!reasoning?.trim()) {
254
+ return;
255
+ }
256
+ push("text", {
257
+ actor_kind: "assistant",
258
+ origin_kind: "assistant_authored",
259
+ text: reasoning,
260
+ display_policy: "collapse",
261
+ source_content_type: "reasoning",
262
+ ...(messageId !== undefined ? { message_id: String(messageId) } : {}),
263
+ });
264
+ }
265
+ function appendToolCalls(helpers, parsed, push, loss) {
266
+ const toolCalls = parsed.tool_calls;
267
+ if (toolCalls === null || toolCalls === undefined) {
268
+ return;
269
+ }
270
+ const calls = Array.isArray(toolCalls) ? toolCalls : helpers.isObject(toolCalls) ? [toolCalls] : [];
271
+ if (calls.length === 0) {
272
+ loss("Hermes assistant tool_calls payload was not a call list.", "hermes_tool_calls_malformed");
273
+ return;
274
+ }
275
+ for (const call of calls) {
276
+ if (!helpers.isObject(call)) {
277
+ continue;
278
+ }
279
+ const fn = helpers.isObject(call.function) ? call.function : undefined;
280
+ const name = helpers.asString(fn?.name) ?? helpers.asString(call.name) ?? "tool";
281
+ push("tool_call", {
282
+ call_id: helpers.asString(call.id) ?? helpers.asString(call.call_id),
283
+ tool_name: name,
284
+ input: parseArguments(fn?.arguments ?? call.arguments, helpers),
285
+ source_event_type: "hermes_tool_calls",
286
+ });
287
+ }
288
+ }
289
+ function parseArguments(raw, helpers) {
290
+ if (helpers.isObject(raw)) {
291
+ return raw;
292
+ }
293
+ const text = helpers.asString(raw);
294
+ if (!text) {
295
+ return {};
296
+ }
297
+ let parsed;
298
+ try {
299
+ parsed = JSON.parse(text);
300
+ }
301
+ catch {
302
+ parsed = undefined;
303
+ }
304
+ return helpers.isObject(parsed) ? parsed : { raw: text };
305
+ }
306
+ //# sourceMappingURL=runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../../src/platforms/hermes/runtime.ts"],"names":[],"mappings":"AAsBA,MAAM,UAAU,iBAAiB,CAC/B,OAAiC,EACjC,MAAiB,EACjB,MAA+B,EAC/B,KAAuB,EACvB,OAAkC;IAElC,MAAM,SAAS,GAAqB,EAAE,CAAC;IACvC,MAAM,UAAU,GAAsB,EAAE,CAAC;IACzC,MAAM,OAAO,GACX,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC;QACnC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC;QACpC,MAAM,CAAC,WAAW;QAClB,OAAO,CAAC,MAAM,EAAE,CAAC;IACnB,MAAM,IAAI,GAAiB,CAAC,YAAY,EAAE,OAAO,EAAE,EAAE;QACnD,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,C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M,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;AAC3D,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { type SourceReadBudget } from "../../core/read-budget.js";
2
+ import type { ExtractedSessionSeed } from "../../core/conversation-seeds.js";
3
+ export interface HermesSqliteReadOptions {
4
+ targetSessionRefs?: readonly string[];
5
+ budget?: SourceReadBudget;
6
+ }
7
+ export declare function extractHermesSqliteSeeds(dbPath: string, options?: HermesSqliteReadOptions): ExtractedSessionSeed[];
8
+ //# sourceMappingURL=sqlite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqlite.d.ts","sourceRoot":"","sources":["../../../src/platforms/hermes/sqlite.ts"],"names":[],"mappings":"AACA,OAAO,EAAyD,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACzH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AA0C7E,MAAM,WAAW,uBAAuB;IACtC,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B;AAQD,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,uBAA4B,GACpC,oBAAoB,EAAE,CAyDxB"}