@integrity-labs/agt-cli 0.23.2 → 0.24.2

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.
@@ -1888,6 +1888,13 @@ function validateToolsFrontmatter(data) {
1888
1888
  };
1889
1889
  }
1890
1890
 
1891
+ // ../../packages/core/dist/alerts/snooze.js
1892
+ var FIXED_SECONDS = {
1893
+ "15m": 15 * 60,
1894
+ "1h": 60 * 60,
1895
+ "4h": 4 * 60 * 60
1896
+ };
1897
+
1891
1898
  // ../../packages/core/dist/generation/charter-generator.js
1892
1899
  import { stringify as stringifyYaml } from "yaml";
1893
1900
  function generateCharterMd(input) {
@@ -3168,6 +3175,85 @@ function parseResetDateTime(humanDate, now) {
3168
3175
  return candidate;
3169
3176
  }
3170
3177
 
3178
+ // ../../packages/core/dist/claude-code-usage/transcript-parser.js
3179
+ function nonNegInt(value) {
3180
+ if (typeof value !== "number" || !Number.isFinite(value))
3181
+ return 0;
3182
+ const floored = Math.floor(value);
3183
+ return floored > 0 ? floored : 0;
3184
+ }
3185
+ function emptyTotals() {
3186
+ return { inputTokens: 0, outputTokens: 0, cacheCreationTokens: 0, cacheReadTokens: 0 };
3187
+ }
3188
+ function parseTranscriptUsage(jsonl) {
3189
+ const byId = /* @__PURE__ */ new Map();
3190
+ let sessionStartedAt = null;
3191
+ let lastObservedAt = null;
3192
+ let syntheticCounter = 0;
3193
+ const lines = jsonl.split("\n");
3194
+ for (const line of lines) {
3195
+ const trimmed = line.trim();
3196
+ if (!trimmed)
3197
+ continue;
3198
+ let obj;
3199
+ try {
3200
+ obj = JSON.parse(trimmed);
3201
+ } catch {
3202
+ continue;
3203
+ }
3204
+ if (typeof obj !== "object" || obj === null)
3205
+ continue;
3206
+ const record = obj;
3207
+ if (record.type !== "assistant")
3208
+ continue;
3209
+ const message = record.message;
3210
+ if (typeof message !== "object" || message === null)
3211
+ continue;
3212
+ const msg = message;
3213
+ const usage = msg.usage;
3214
+ if (typeof usage !== "object" || usage === null)
3215
+ continue;
3216
+ const u = usage;
3217
+ const model = typeof msg.model === "string" && msg.model ? msg.model : "unknown";
3218
+ const entry = {
3219
+ model,
3220
+ totals: {
3221
+ inputTokens: nonNegInt(u.input_tokens),
3222
+ outputTokens: nonNegInt(u.output_tokens),
3223
+ cacheCreationTokens: nonNegInt(u.cache_creation_input_tokens),
3224
+ cacheReadTokens: nonNegInt(u.cache_read_input_tokens)
3225
+ }
3226
+ };
3227
+ const id = typeof msg.id === "string" && msg.id ? msg.id : `__noid_${syntheticCounter++}`;
3228
+ byId.set(id, entry);
3229
+ const ts = record.timestamp;
3230
+ if (typeof ts === "string" && ts) {
3231
+ if (sessionStartedAt === null || ts < sessionStartedAt)
3232
+ sessionStartedAt = ts;
3233
+ if (lastObservedAt === null || ts > lastObservedAt)
3234
+ lastObservedAt = ts;
3235
+ }
3236
+ }
3237
+ const byModel = /* @__PURE__ */ new Map();
3238
+ for (const { model, totals } of byId.values()) {
3239
+ const acc = byModel.get(model) ?? emptyTotals();
3240
+ acc.inputTokens += totals.inputTokens;
3241
+ acc.outputTokens += totals.outputTokens;
3242
+ acc.cacheCreationTokens += totals.cacheCreationTokens;
3243
+ acc.cacheReadTokens += totals.cacheReadTokens;
3244
+ byModel.set(model, acc);
3245
+ }
3246
+ return {
3247
+ byModel,
3248
+ sessionStartedAt,
3249
+ lastObservedAt,
3250
+ messageCount: byId.size
3251
+ };
3252
+ }
3253
+ function isEmptyTotals(totals) {
3254
+ return totals.inputTokens === 0 && totals.outputTokens === 0 && totals.cacheCreationTokens === 0 && totals.cacheReadTokens === 0;
3255
+ }
3256
+
3171
3257
  export {
3172
3258
  wrapScheduledTaskPrompt,
3173
3259
  parseDeliveryTarget,
@@ -3206,7 +3292,9 @@ export {
3206
3292
  detectDrift,
3207
3293
  classifyOutput,
3208
3294
  parseUsageBanner,
3295
+ parseTranscriptUsage,
3296
+ isEmptyTotals,
3209
3297
  KANBAN_LOOP_COMMAND,
3210
3298
  KANBAN_CHECK_COMMAND
3211
3299
  };
3212
- //# sourceMappingURL=chunk-HSIESZMZ.js.map
3300
+ //# sourceMappingURL=chunk-ECDTRQLA.js.map