@triflux/core 10.62.0 → 10.63.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.
@@ -272,6 +272,7 @@ export async function readClaudeTranscript(transcriptPath, { requestId } = {}) {
272
272
  model: state.model,
273
273
  measuredAt: state.measuredAt,
274
274
  },
275
+ enqueued: state.queuedContent !== null,
275
276
  userSeen: state.userSeen,
276
277
  response: state.response,
277
278
  error: state.error,
@@ -137,12 +137,19 @@ function acceptCodexLine(state, line) {
137
137
  } catch {
138
138
  return false;
139
139
  }
140
+ if (entry?.type === "compacted") {
141
+ state.compactCount += 1;
142
+ state.compact = { preTokens: state.tokens, postTokens: null };
143
+ }
140
144
  if (entry?.type === "turn_context")
141
145
  state.model = entry.payload?.model || state.model;
142
146
  if (entry?.type === "event_msg" && entry.payload?.type === "token_count") {
143
147
  const info = entry.payload.info;
144
- if (Number.isFinite(info?.last_token_usage?.total_tokens))
148
+ if (Number.isFinite(info?.last_token_usage?.total_tokens)) {
145
149
  state.tokens = info.last_token_usage.total_tokens;
150
+ if (state.compact && state.compact.postTokens === null)
151
+ state.compact.postTokens = state.tokens;
152
+ }
146
153
  if (Number.isFinite(info?.model_context_window))
147
154
  state.executionContextLimitTokens = info.model_context_window;
148
155
  }
@@ -172,6 +179,8 @@ export async function readCodexContext(rolloutPath, threadId) {
172
179
  decoder: new StringDecoder("utf8"),
173
180
  model: null,
174
181
  tokens: null,
182
+ compactCount: 0,
183
+ compact: null,
175
184
  executionContextLimitTokens: null,
176
185
  };
177
186
  }
@@ -199,6 +208,8 @@ export async function readCodexContext(rolloutPath, threadId) {
199
208
  return {
200
209
  ...modelContext("codex", state.model, state.tokens),
201
210
  model: state.model,
211
+ compactCount: state.compactCount,
212
+ compact: state.compact,
202
213
  executionContextLimitTokens: state.executionContextLimitTokens,
203
214
  };
204
215
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triflux/core",
3
- "version": "10.62.0",
3
+ "version": "10.63.0",
4
4
  "description": "triflux core — CLI routing, adapters. Zero native dependencies.",
5
5
  "type": "module",
6
6
  "main": "hub/index.mjs",