agenthud 0.12.2 → 0.12.3

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/index.js CHANGED
@@ -15,4 +15,4 @@ Error: Node.js ${MIN_NODE_VERSION}+ is required (current: ${process.version})
15
15
  process.exit(1);
16
16
  }
17
17
  if (!process.env.NODE_ENV) process.env.NODE_ENV = "production";
18
- import("./main-YCUCY2QP.js");
18
+ import("./main-WHDPTTTD.js");
@@ -465,12 +465,21 @@ function formatEffectiveOptionsLine(command, fields) {
465
465
  if (fields.model) parts.push(`model=${fields.model}`);
466
466
  return `${command} \u2192 ${parts.join(" ")}`;
467
467
  }
468
+ function expandCombinedShortFlags(args) {
469
+ return args.flatMap((arg) => {
470
+ if (/^-[a-zA-Z]{2,}$/.test(arg)) {
471
+ return arg.slice(1).split("").map((ch) => `-${ch}`);
472
+ }
473
+ return arg;
474
+ });
475
+ }
468
476
  function todayLocalMidnight() {
469
477
  const now = /* @__PURE__ */ new Date();
470
478
  return new Date(now.getFullYear(), now.getMonth(), now.getDate());
471
479
  }
472
480
  function parseArgs(args, config) {
473
481
  if (args[0] === "watch") args = args.slice(1);
482
+ args = expandCombinedShortFlags(args);
474
483
  if (args.includes("--help") || args.includes("-h")) {
475
484
  return { mode: "watch", command: "help" };
476
485
  }
@@ -1670,8 +1679,7 @@ import {
1670
1679
  existsSync as existsSync6,
1671
1680
  mkdirSync as mkdirSync2,
1672
1681
  readFileSync as readFileSync7,
1673
- unlinkSync,
1674
- writeFileSync as writeFileSync3
1682
+ unlinkSync
1675
1683
  } from "fs";
1676
1684
  import { homedir as homedir3 } from "os";
1677
1685
  import { dirname as dirname2, join as join6 } from "path";
@@ -2342,29 +2350,17 @@ async function generateDailySummary(opts) {
2342
2350
  );
2343
2351
  }
2344
2352
  if (sessionCount === 0 && activityCount === 0 && commitCount === 0) {
2345
- const stub = `## Context
2346
-
2347
- No activity recorded for ${dateLabel}.
2348
- No claude call was issued \u2014 the report was empty.
2349
- `;
2350
- try {
2351
- writeFileSync3(cached, stub, "utf-8");
2352
- } catch {
2353
- }
2354
2353
  if (opts.announce) {
2355
2354
  process.stderr.write(
2356
- `${dateLabel} has no activity \u2014 wrote stub to ${cached}, skipped claude
2355
+ `${dateLabel} has no activity \u2014 skipping (no file written)
2357
2356
  `
2358
2357
  );
2359
2358
  }
2360
- if (opts.streamToStdout) {
2361
- process.stdout.write(stub);
2362
- }
2363
2359
  return {
2364
2360
  code: 0,
2365
- markdown: stub,
2361
+ markdown: "",
2366
2362
  fromCache: false,
2367
- skipped: false,
2363
+ skipped: true,
2368
2364
  usage: null
2369
2365
  };
2370
2366
  }
@@ -2451,7 +2447,8 @@ async function runSummary(options2) {
2451
2447
  detailLimit: options2.detailLimit,
2452
2448
  withGit: options2.withGit
2453
2449
  });
2454
- if (res.code === 0 && !res.skipped) {
2450
+ const indexRefreshNeeded = res.code === 0 && (!res.skipped || options2.openIndex === true);
2451
+ if (indexRefreshNeeded) {
2455
2452
  try {
2456
2453
  regenerateIndex(summariesDir());
2457
2454
  } catch {
@@ -2460,7 +2457,7 @@ async function runSummary(options2) {
2460
2457
  if (options2.open && res.code === 0 && !res.skipped) {
2461
2458
  await openInDefaultApp(dailyCachePath(options2.date));
2462
2459
  }
2463
- if (options2.openIndex && res.code === 0 && !res.skipped) {
2460
+ if (options2.openIndex && res.code === 0) {
2464
2461
  await openInDefaultApp(join6(summariesDir(), "index.md"));
2465
2462
  }
2466
2463
  return res.code;
@@ -2542,7 +2539,7 @@ async function runRangeSummary(options2) {
2542
2539
  withGit: options2.withGit
2543
2540
  });
2544
2541
  if (res.skipped) {
2545
- process.stderr.write(`agenthud: ${label} \u2014 skipped by user.
2542
+ process.stderr.write(`agenthud: ${label} \u2014 skipped.
2546
2543
  `);
2547
2544
  skippedCount++;
2548
2545
  continue;
@@ -2563,8 +2560,17 @@ async function runRangeSummary(options2) {
2563
2560
  dailyMarkdowns.push({ date: d, markdown: text });
2564
2561
  }
2565
2562
  if (dailyMarkdowns.length === 0) {
2566
- process.stderr.write("agenthud: no daily summaries to combine.\n");
2567
- return 1;
2563
+ process.stderr.write(
2564
+ "no daily activity in this range \u2014 nothing to combine\n"
2565
+ );
2566
+ if (options2.openIndex) {
2567
+ try {
2568
+ regenerateIndex(summariesDir());
2569
+ } catch {
2570
+ }
2571
+ await openInDefaultApp(join6(summariesDir(), "index.md"));
2572
+ }
2573
+ return 0;
2568
2574
  }
2569
2575
  const metaInput = dailyMarkdowns.map(({ date, markdown }) => `# ${dateKey(date)}
2570
2576
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agenthud",
3
- "version": "0.12.2",
3
+ "version": "0.12.3",
4
4
  "description": "CLI tool to monitor agent status in real-time. Works with Claude Code, multi-agent workflows, and any AI agent system.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",