@a5c-ai/babysitter-sdk 0.0.60 → 0.0.62

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.
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":";AAo4CA,wBAAgB,mBAAmB;eAEf,MAAM,EAAE,GAA2B,OAAO,CAAC,MAAM,CAAC;kBAyCpD,MAAM;EAIvB"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":";AAo5CA,wBAAgB,mBAAmB;eAEf,MAAM,EAAE,GAA2B,OAAO,CAAC,MAAM,CAAC;kBA6CpD,MAAM;EAIvB"}
package/dist/cli/main.js CHANGED
@@ -58,13 +58,15 @@ const USAGE = `Usage:
58
58
  babysitter task:post <runDir> <effectId> --status <ok|error> [--runs-dir <dir>] [--json] [--dry-run] [--value <file>] [--error <file>] [--stdout-ref <ref>] [--stderr-ref <ref>] [--stdout-file <file>] [--stderr-file <file>] [--started-at <iso8601>] [--finished-at <iso8601>] [--metadata <file>] [--invocation-key <key>]
59
59
  babysitter task:list <runDir> [--runs-dir <dir>] [--pending] [--kind <kind>] [--json]
60
60
  babysitter task:show <runDir> <effectId> [--runs-dir <dir>] [--json]
61
+ babysitter version
61
62
 
62
63
  Global flags:
63
64
  --runs-dir <dir> Override the runs directory (defaults to .a5c/runs).
64
65
  --json Emit JSON output when supported by the command.
65
66
  --dry-run Describe planned mutations without changing on-disk state.
66
67
  --verbose Log resolved paths and options to stderr for debugging.
67
- --help, -h Show this help text.`;
68
+ --help, -h Show this help text.
69
+ --version, -v Show CLI version.`;
68
70
  const LARGE_RESULT_PREVIEW_LIMIT = 1024 * 1024; // 1 MiB
69
71
  function parseArgs(argv) {
70
72
  const [initialCommand, ...rest] = argv;
@@ -82,6 +84,9 @@ function parseArgs(argv) {
82
84
  parsed.command = undefined;
83
85
  parsed.helpRequested = true;
84
86
  }
87
+ if (parsed.command === "--version" || parsed.command === "-v") {
88
+ parsed.command = "version";
89
+ }
85
90
  const positionals = [];
86
91
  for (let i = 0; i < rest.length; i += 1) {
87
92
  const arg = rest[i];
@@ -89,6 +94,10 @@ function parseArgs(argv) {
89
94
  parsed.helpRequested = true;
90
95
  continue;
91
96
  }
97
+ if (arg === "--version" || arg === "-v") {
98
+ parsed.command = "version";
99
+ continue;
100
+ }
92
101
  if (arg === "--runs-dir") {
93
102
  parsed.runsDir = expectFlagValue(rest, ++i, "--runs-dir");
94
103
  continue;
@@ -1294,11 +1303,21 @@ function formatEventLine(event) {
1294
1303
  function formatSeq(seq) {
1295
1304
  return seq.toString().padStart(6, "0");
1296
1305
  }
1306
+ async function readCliVersion() {
1307
+ const packagePath = path.join(__dirname, "..", "..", "package.json");
1308
+ const raw = await node_fs_1.promises.readFile(packagePath, "utf8");
1309
+ const parsed = JSON.parse(raw);
1310
+ return parsed.version ?? "unknown";
1311
+ }
1297
1312
  function createBabysitterCli() {
1298
1313
  return {
1299
1314
  async run(argv = process.argv.slice(2)) {
1300
1315
  try {
1301
1316
  const parsed = parseArgs(argv);
1317
+ if (parsed.command === "version") {
1318
+ console.log(await readCliVersion());
1319
+ return 0;
1320
+ }
1302
1321
  if (!parsed.command || parsed.helpRequested) {
1303
1322
  console.log(USAGE);
1304
1323
  return 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@a5c-ai/babysitter-sdk",
3
- "version": "0.0.60",
3
+ "version": "0.0.62",
4
4
  "description": "Storage and run-registry primitives for event-sourced babysitter workflows.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "commonjs",