agentflow-core 0.2.2 → 0.3.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.
package/dist/cli.js CHANGED
@@ -1,8 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runTraced,
4
- startLive
5
- } from "./chunk-WOJEID7V.js";
4
+ startLive,
5
+ startWatch
6
+ } from "./chunk-NPH34CAL.js";
6
7
 
7
8
  // src/cli.ts
8
9
  import { basename } from "path";
@@ -14,8 +15,9 @@ Usage:
14
15
  agentflow <command> [options]
15
16
 
16
17
  Commands:
17
- run [options] -- <cmd> Wrap a command with automatic execution tracing
18
- live [dir...] [options] Real-time terminal monitor (auto-detects any JSON/JSONL)
18
+ run [options] -- <cmd> Wrap a command with automatic execution tracing
19
+ live [dir...] [options] Real-time terminal monitor (auto-detects any JSON/JSONL)
20
+ watch [dir...] [options] Headless alert system \u2014 detects failures, sends notifications
19
21
 
20
22
  Run \`agentflow <command> --help\` for command-specific options.
21
23
 
@@ -23,7 +25,8 @@ Examples:
23
25
  agentflow run --traces-dir ./traces -- python -m myagent process
24
26
  agentflow live ./data
25
27
  agentflow live ./traces ./cron ./workers -R
26
- agentflow live ./data --refresh 5
28
+ agentflow watch ./data --alert-on error --notify telegram
29
+ agentflow watch ./data ./cron --alert-on stale:15m --notify webhook:https://...
27
30
  `.trim());
28
31
  }
29
32
  function parseRunArgs(argv) {
@@ -161,7 +164,8 @@ async function runCommand(argv) {
161
164
  }
162
165
  async function main() {
163
166
  const argv = process.argv.slice(2);
164
- if (argv.length === 0 || argv[0] !== "run" && argv[0] !== "live" && (argv.includes("--help") || argv.includes("-h"))) {
167
+ const knownCommands = ["run", "live", "watch"];
168
+ if (argv.length === 0 || !knownCommands.includes(argv[0]) && (argv.includes("--help") || argv.includes("-h"))) {
165
169
  printHelp();
166
170
  process.exit(0);
167
171
  }
@@ -173,6 +177,9 @@ async function main() {
173
177
  case "live":
174
178
  startLive(argv);
175
179
  break;
180
+ case "watch":
181
+ startWatch(argv);
182
+ break;
176
183
  default:
177
184
  if (!subcommand?.startsWith("-")) {
178
185
  startLive(["live", ...argv]);