@aipper/aiws 0.0.19 → 0.0.21

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/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@aipper/aiws",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
4
4
  "description": "AI Workspace CLI (init/update/validate) for Claude Code / OpenCode / Codex / iFlow.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "aiws": "./bin/aiws.js"
8
8
  },
9
9
  "dependencies": {
10
- "@aipper/aiws-spec": "0.0.19"
10
+ "@aipper/aiws-spec": "0.0.21"
11
11
  },
12
12
  "files": [
13
13
  "bin",
package/src/cli.js CHANGED
@@ -17,16 +17,19 @@ import { hooksStatusCommand } from "./commands/hooks-status.js";
17
17
  import { dashboardServeCommand } from "./commands/dashboard.js";
18
18
  import {
19
19
  changeArchiveCommand,
20
+ changeEvidenceCommand,
20
21
  changeFinishCommand,
21
22
  changeListCommand,
22
23
  changeNewCommand,
23
24
  changeNextCommand,
25
+ changeStateCommand,
24
26
  changeStartCommand,
25
27
  changeStatusCommand,
26
28
  changeSyncCommand,
27
29
  changeTemplatesInitCommand,
28
30
  changeTemplatesWhichCommand,
29
31
  changeValidateCommand,
32
+ metricsSummaryCommand,
30
33
  } from "./commands/change.js";
31
34
 
32
35
  /**
@@ -51,6 +54,10 @@ export async function cliMain(argv) {
51
54
  printChangeHelp();
52
55
  return 0;
53
56
  }
57
+ if (args[0] === "metrics" && (args.includes("-h") || args.includes("--help"))) {
58
+ printMetricsHelp();
59
+ return 0;
60
+ }
54
61
  if (args.length === 0 || args.includes("-h") || args.includes("--help") || args[0] === "help") {
55
62
  printHelp();
56
63
  return 0;
@@ -306,15 +313,38 @@ export async function cliMain(argv) {
306
313
  const { positionals, options } = parseArgs(args, {
307
314
  strict: { type: "boolean" },
308
315
  "allow-truth-drift": { type: "boolean" },
316
+ "check-evidence": { type: "boolean" },
317
+ "check-scope": { type: "boolean" },
309
318
  });
310
319
  const changeId = positionals[0];
311
320
  await changeValidateCommand({
312
321
  changeId,
313
322
  strict: options.strict === true,
314
323
  allowTruthDrift: options["allow-truth-drift"] === true,
324
+ checkEvidence: options["check-evidence"] === true,
325
+ checkScope: options["check-scope"] === true,
315
326
  });
316
327
  return 0;
317
328
  }
329
+ case "evidence": {
330
+ const { positionals, options } = parseArgs(args, {
331
+ "no-validate": { type: "boolean" },
332
+ "allow-fail": { type: "boolean" },
333
+ });
334
+ const changeId = positionals[0];
335
+ await changeEvidenceCommand({
336
+ changeId,
337
+ noValidate: options["no-validate"] === true,
338
+ allowFail: options["allow-fail"] === true,
339
+ });
340
+ return 0;
341
+ }
342
+ case "state": {
343
+ const { positionals, options } = parseArgs(args, { write: { type: "boolean" } });
344
+ const changeId = positionals[0];
345
+ await changeStateCommand({ changeId, write: options.write === true });
346
+ return 0;
347
+ }
318
348
  case "sync": {
319
349
  const { positionals } = parseArgs(args, {});
320
350
  const changeId = positionals[0];
@@ -368,6 +398,19 @@ export async function cliMain(argv) {
368
398
  throw new UserError(`Unknown change subcommand: ${sub}`, { details: "Use `aiws change --help` to see available subcommands." });
369
399
  }
370
400
  }
401
+ case "metrics": {
402
+ const sub = args.shift();
403
+ if (!sub || sub === "help" || sub === "--help" || sub === "-h") {
404
+ printMetricsHelp();
405
+ return 0;
406
+ }
407
+ if (sub === "summary") {
408
+ const { options } = parseArgs(args, { since: { type: "string" } });
409
+ await metricsSummaryCommand({ since: options.since });
410
+ return 0;
411
+ }
412
+ throw new UserError(`Unknown metrics subcommand: ${sub}`, { details: "Use `aiws metrics --help` to see available subcommands." });
413
+ }
371
414
  default:
372
415
  throw new UserError(`Unknown command: ${cmd}`, { details: "Use --help to see available commands." });
373
416
  }
@@ -382,6 +425,7 @@ Usage:
382
425
  aiws validate [path] [--stamp]
383
426
  aiws rollback [path] <timestamp|latest>
384
427
  aiws change <subcommand>
428
+ aiws metrics <subcommand>
385
429
  aiws dashboard <subcommand>
386
430
  aiws codex <subcommand>
387
431
  aiws hooks <subcommand>
@@ -451,7 +495,9 @@ Usage:
451
495
  aiws change new <change-id> [--title <title>] [--no-design]
452
496
  aiws change status [change-id]
453
497
  aiws change next [change-id]
454
- aiws change validate [change-id] [--strict] [--allow-truth-drift]
498
+ aiws change validate [change-id] [--strict] [--allow-truth-drift] [--check-evidence] [--check-scope]
499
+ aiws change evidence [change-id] [--no-validate] [--allow-fail]
500
+ aiws change state [change-id] [--write]
455
501
  aiws change sync [change-id]
456
502
  aiws change archive [change-id] [--date YYYY-MM-DD] [--force]
457
503
  aiws change templates which
@@ -471,6 +517,17 @@ Notes:
471
517
  `);
472
518
  }
473
519
 
520
+ function printMetricsHelp() {
521
+ console.log(`aiws metrics
522
+
523
+ Usage:
524
+ aiws metrics summary [--since YYYY-MM-DD]
525
+
526
+ Notes:
527
+ - Reads changes/*/metrics.json (and changes/archive/*/metrics.json) and prints a best-effort summary.
528
+ `);
529
+ }
530
+
474
531
  /**
475
532
  * Minimal argv parser:
476
533
  * - supports: --k=v, --k v