@integrity-labs/agt-cli 0.27.160 → 0.27.162

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.
package/dist/bin/agt.js CHANGED
@@ -33,7 +33,7 @@ import {
33
33
  success,
34
34
  table,
35
35
  warn
36
- } from "../chunk-O24XVAYZ.js";
36
+ } from "../chunk-H5B4ESA5.js";
37
37
  import {
38
38
  CHANNEL_REGISTRY,
39
39
  DEPLOYMENT_TEMPLATES,
@@ -60,7 +60,7 @@ import {
60
60
  renderTemplate,
61
61
  resolveChannels,
62
62
  serializeManifestForSlackCli
63
- } from "../chunk-BC26YO7P.js";
63
+ } from "../chunk-LK7R6HLJ.js";
64
64
 
65
65
  // src/bin/agt.ts
66
66
  import { join as join21 } from "path";
@@ -5019,7 +5019,7 @@ import { execFileSync, execSync } from "child_process";
5019
5019
  import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
5020
5020
  import chalk18 from "chalk";
5021
5021
  import ora16 from "ora";
5022
- var cliVersion = true ? "0.27.160" : "dev";
5022
+ var cliVersion = true ? "0.27.162" : "dev";
5023
5023
  async function fetchLatestVersion() {
5024
5024
  const host2 = getHost();
5025
5025
  if (!host2) return null;
@@ -5942,7 +5942,7 @@ function handleError(err) {
5942
5942
  }
5943
5943
 
5944
5944
  // src/bin/agt.ts
5945
- var cliVersion2 = true ? "0.27.160" : "dev";
5945
+ var cliVersion2 = true ? "0.27.162" : "dev";
5946
5946
  var program = new Command();
5947
5947
  program.name("agt").description("Augmented CLI \u2014 agent provisioning and management").version(cliVersion2).option("--json", "Emit machine-readable JSON output (suppress spinners and colors)").option("--skip-update-check", "Skip the automatic update check on startup");
5948
5948
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  claudeModelAlias,
3
3
  isClaudeFastMode
4
- } from "./chunk-BC26YO7P.js";
4
+ } from "./chunk-LK7R6HLJ.js";
5
5
  import {
6
6
  reapOrphanChannelMcps
7
7
  } from "./chunk-XWVM4KPK.js";
@@ -1641,4 +1641,4 @@ export {
1641
1641
  stopAllSessionsAndWait,
1642
1642
  getProjectDir
1643
1643
  };
1644
- //# sourceMappingURL=chunk-7RCGHACC.js.map
1644
+ //# sourceMappingURL=chunk-AEECYKHW.js.map
@@ -14,7 +14,7 @@ import {
14
14
  registerFramework,
15
15
  resolveAvatarEnvUrl,
16
16
  wrapScheduledTaskPrompt
17
- } from "./chunk-BC26YO7P.js";
17
+ } from "./chunk-LK7R6HLJ.js";
18
18
 
19
19
  // ../../packages/core/dist/integrations/registry.js
20
20
  var INTEGRATION_REGISTRY = [
@@ -8222,4 +8222,4 @@ export {
8222
8222
  managerInstallSystemUnitCommand,
8223
8223
  managerUninstallSystemUnitCommand
8224
8224
  };
8225
- //# sourceMappingURL=chunk-O24XVAYZ.js.map
8225
+ //# sourceMappingURL=chunk-H5B4ESA5.js.map
@@ -4605,6 +4605,71 @@ function parseTranscriptUsage(jsonl) {
4605
4605
  messageCount: byId.size
4606
4606
  };
4607
4607
  }
4608
+ function sumTranscriptUsageInWindow(jsonl, startMs, endMs) {
4609
+ const byId = /* @__PURE__ */ new Map();
4610
+ let syntheticCounter = 0;
4611
+ for (const line of jsonl.split("\n")) {
4612
+ const trimmed = line.trim();
4613
+ if (!trimmed)
4614
+ continue;
4615
+ let obj;
4616
+ try {
4617
+ obj = JSON.parse(trimmed);
4618
+ } catch {
4619
+ continue;
4620
+ }
4621
+ if (typeof obj !== "object" || obj === null)
4622
+ continue;
4623
+ const record = obj;
4624
+ if (record.type !== "assistant")
4625
+ continue;
4626
+ const message = record.message;
4627
+ if (typeof message !== "object" || message === null)
4628
+ continue;
4629
+ const msg = message;
4630
+ const usage = msg.usage;
4631
+ if (typeof usage !== "object" || usage === null)
4632
+ continue;
4633
+ const u = usage;
4634
+ const ts = record.timestamp;
4635
+ if (typeof ts !== "string" || !ts)
4636
+ continue;
4637
+ const tsMs = new Date(ts).getTime();
4638
+ if (!Number.isFinite(tsMs))
4639
+ continue;
4640
+ const model = typeof msg.model === "string" && msg.model ? msg.model : "unknown";
4641
+ const id = typeof msg.id === "string" && msg.id ? msg.id : `__noid_${syntheticCounter++}`;
4642
+ byId.set(id, {
4643
+ tsMs,
4644
+ model,
4645
+ totals: {
4646
+ inputTokens: nonNegInt(u.input_tokens),
4647
+ outputTokens: nonNegInt(u.output_tokens),
4648
+ cacheCreationTokens: nonNegInt(u.cache_creation_input_tokens),
4649
+ cacheReadTokens: nonNegInt(u.cache_read_input_tokens)
4650
+ }
4651
+ });
4652
+ }
4653
+ const byModel = /* @__PURE__ */ new Map();
4654
+ const totals = emptyTotals();
4655
+ let messageCount = 0;
4656
+ for (const e of byId.values()) {
4657
+ if (e.tsMs < startMs || e.tsMs > endMs)
4658
+ continue;
4659
+ messageCount++;
4660
+ const acc = byModel.get(e.model) ?? emptyTotals();
4661
+ acc.inputTokens += e.totals.inputTokens;
4662
+ acc.outputTokens += e.totals.outputTokens;
4663
+ acc.cacheCreationTokens += e.totals.cacheCreationTokens;
4664
+ acc.cacheReadTokens += e.totals.cacheReadTokens;
4665
+ byModel.set(e.model, acc);
4666
+ totals.inputTokens += e.totals.inputTokens;
4667
+ totals.outputTokens += e.totals.outputTokens;
4668
+ totals.cacheCreationTokens += e.totals.cacheCreationTokens;
4669
+ totals.cacheReadTokens += e.totals.cacheReadTokens;
4670
+ }
4671
+ return { byModel, totals, messageCount };
4672
+ }
4608
4673
  function isEmptyTotals(totals) {
4609
4674
  return totals.inputTokens === 0 && totals.outputTokens === 0 && totals.cacheCreationTokens === 0 && totals.cacheReadTokens === 0;
4610
4675
  }
@@ -4994,6 +5059,7 @@ export {
4994
5059
  parseUsageBanner,
4995
5060
  formatRunMarker,
4996
5061
  parseTranscriptUsage,
5062
+ sumTranscriptUsageInWindow,
4997
5063
  isEmptyTotals,
4998
5064
  attributeTranscriptUsageByRun,
4999
5065
  KANBAN_CHECK_COMMAND,
@@ -5003,4 +5069,4 @@ export {
5003
5069
  coerceEnvValue,
5004
5070
  FLAGS_SCHEMA_VERSION
5005
5071
  };
5006
- //# sourceMappingURL=chunk-BC26YO7P.js.map
5072
+ //# sourceMappingURL=chunk-LK7R6HLJ.js.map