@integrity-labs/agt-cli 0.28.591 → 0.28.593

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.
@@ -9262,6 +9262,39 @@ function formatRunMarker(runId) {
9262
9262
  }
9263
9263
  var RUN_MARKER_RE = /<!--\s*agt-run:([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})\s*-->/;
9264
9264
  var RUN_MARKER_RE_GLOBAL = new RegExp(RUN_MARKER_RE.source, "g");
9265
+ var MARKER_WALK_MAX_DEPTH = 6;
9266
+ var MARKER_WALK_MAX_NODES = 512;
9267
+ function findRunMarker(content) {
9268
+ let found = null;
9269
+ let nodes = 0;
9270
+ const walk = (value, depth) => {
9271
+ if (depth > MARKER_WALK_MAX_DEPTH || nodes >= MARKER_WALK_MAX_NODES)
9272
+ return;
9273
+ nodes += 1;
9274
+ if (typeof value === "string") {
9275
+ const matches = value.match(RUN_MARKER_RE_GLOBAL);
9276
+ const last = matches?.[matches.length - 1];
9277
+ if (last) {
9278
+ const id = last.match(RUN_MARKER_RE)?.[1];
9279
+ if (id)
9280
+ found = id;
9281
+ }
9282
+ return;
9283
+ }
9284
+ if (Array.isArray(value)) {
9285
+ for (const item of value)
9286
+ walk(item, depth + 1);
9287
+ return;
9288
+ }
9289
+ if (value && typeof value === "object") {
9290
+ const obj = value;
9291
+ walk(obj.text, depth + 1);
9292
+ walk(obj.content, depth + 1);
9293
+ }
9294
+ };
9295
+ walk(content, 0);
9296
+ return found;
9297
+ }
9265
9298
 
9266
9299
  // ../../packages/core/dist/claude-code-usage/transcript-parser.js
9267
9300
  function nonNegInt(value) {
@@ -15974,6 +16007,7 @@ export {
15974
16007
  SCHEDULED_TURN_MARKER_FILENAME,
15975
16008
  parseUsageBanner,
15976
16009
  formatRunMarker,
16010
+ findRunMarker,
15977
16011
  parseTranscriptUsage,
15978
16012
  sumTranscriptUsageInWindow,
15979
16013
  isEmptyTotals,
@@ -16084,4 +16118,4 @@ export {
16084
16118
  stopAllSessionsAndWait,
16085
16119
  getProjectDir
16086
16120
  };
16087
- //# sourceMappingURL=chunk-QDJEEGZB.js.map
16121
+ //# sourceMappingURL=chunk-TKWDYMM3.js.map