@aipper/aiws 0.0.20 → 0.0.23

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/README.md CHANGED
@@ -47,7 +47,7 @@ aiws codex <install-skills|status-skills|uninstall-skills|install-prompts|status
47
47
 
48
48
  ## Codex(repo skills 优先)
49
49
 
50
- - `aiws init .` 会生成 `.agents/skills/`(随仓库共享),在 Codex 中可显式调用(示例):`$ws-preflight` / `$ws-plan` / `$ws-dev` / `$ws-review` / `$ws-commit`
50
+ - `aiws init .` 会生成 `.agents/skills/`(随仓库共享),在 Codex 中可显式调用(示例):`$ws-preflight` / `$ws-plan` / `$p-tasks-plan` / `$ws-handoff` / `$ws-dev` / `$ws-review` / `$ws-commit`
51
51
  - 交付收尾(submodules+superproject 分步提交 + 安全合并):`$ws-deliver`
52
52
  - 收尾(安全合并回目标分支):`$ws-finish`(底层调用 `aiws change finish`,默认 fast-forward)
53
53
  - 可选:安装全局 skills 到 `~/.codex/skills/`(或 `$CODEX_HOME/skills`):
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@aipper/aiws",
3
- "version": "0.0.20",
3
+ "version": "0.0.23",
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.20"
10
+ "@aipper/aiws-spec": "0.0.23"
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;
@@ -253,6 +260,7 @@ export async function cliMain(argv) {
253
260
  hooks: { type: "boolean" },
254
261
  "no-switch": { type: "boolean" },
255
262
  switch: { type: "boolean" },
263
+ "allow-dirty": { type: "boolean" },
256
264
  worktree: { type: "boolean" },
257
265
  "worktree-dir": { type: "string" },
258
266
  submodules: { type: "boolean" },
@@ -261,7 +269,7 @@ export async function cliMain(argv) {
261
269
  if (!changeId)
262
270
  throw new UserError("change start requires <change-id>", {
263
271
  details:
264
- "Usage: aiws change start <change-id> [--title <title>] [--no-design] [--hooks] [--no-switch] [--switch] [--worktree] [--worktree-dir <path>] [--submodules]",
272
+ "Usage: aiws change start <change-id> [--title <title>] [--no-design] [--hooks] [--no-switch] [--switch] [--allow-dirty] [--worktree] [--worktree-dir <path>] [--submodules]",
265
273
  });
266
274
  await changeStartCommand({
267
275
  changeId,
@@ -270,6 +278,7 @@ export async function cliMain(argv) {
270
278
  enableHooks: options.hooks === true,
271
279
  noSwitch: options["no-switch"] === true,
272
280
  forceSwitch: options.switch === true,
281
+ allowDirty: options["allow-dirty"] === true,
273
282
  worktree: options.worktree === true,
274
283
  worktreeDir: options["worktree-dir"],
275
284
  submodules: options.submodules === true,
@@ -306,15 +315,38 @@ export async function cliMain(argv) {
306
315
  const { positionals, options } = parseArgs(args, {
307
316
  strict: { type: "boolean" },
308
317
  "allow-truth-drift": { type: "boolean" },
318
+ "check-evidence": { type: "boolean" },
319
+ "check-scope": { type: "boolean" },
309
320
  });
310
321
  const changeId = positionals[0];
311
322
  await changeValidateCommand({
312
323
  changeId,
313
324
  strict: options.strict === true,
314
325
  allowTruthDrift: options["allow-truth-drift"] === true,
326
+ checkEvidence: options["check-evidence"] === true,
327
+ checkScope: options["check-scope"] === true,
315
328
  });
316
329
  return 0;
317
330
  }
331
+ case "evidence": {
332
+ const { positionals, options } = parseArgs(args, {
333
+ "no-validate": { type: "boolean" },
334
+ "allow-fail": { type: "boolean" },
335
+ });
336
+ const changeId = positionals[0];
337
+ await changeEvidenceCommand({
338
+ changeId,
339
+ noValidate: options["no-validate"] === true,
340
+ allowFail: options["allow-fail"] === true,
341
+ });
342
+ return 0;
343
+ }
344
+ case "state": {
345
+ const { positionals, options } = parseArgs(args, { write: { type: "boolean" } });
346
+ const changeId = positionals[0];
347
+ await changeStateCommand({ changeId, write: options.write === true });
348
+ return 0;
349
+ }
318
350
  case "sync": {
319
351
  const { positionals } = parseArgs(args, {});
320
352
  const changeId = positionals[0];
@@ -368,6 +400,19 @@ export async function cliMain(argv) {
368
400
  throw new UserError(`Unknown change subcommand: ${sub}`, { details: "Use `aiws change --help` to see available subcommands." });
369
401
  }
370
402
  }
403
+ case "metrics": {
404
+ const sub = args.shift();
405
+ if (!sub || sub === "help" || sub === "--help" || sub === "-h") {
406
+ printMetricsHelp();
407
+ return 0;
408
+ }
409
+ if (sub === "summary") {
410
+ const { options } = parseArgs(args, { since: { type: "string" } });
411
+ await metricsSummaryCommand({ since: options.since });
412
+ return 0;
413
+ }
414
+ throw new UserError(`Unknown metrics subcommand: ${sub}`, { details: "Use `aiws metrics --help` to see available subcommands." });
415
+ }
371
416
  default:
372
417
  throw new UserError(`Unknown command: ${cmd}`, { details: "Use --help to see available commands." });
373
418
  }
@@ -382,6 +427,7 @@ Usage:
382
427
  aiws validate [path] [--stamp]
383
428
  aiws rollback [path] <timestamp|latest>
384
429
  aiws change <subcommand>
430
+ aiws metrics <subcommand>
385
431
  aiws dashboard <subcommand>
386
432
  aiws codex <subcommand>
387
433
  aiws hooks <subcommand>
@@ -446,12 +492,14 @@ function printChangeHelp() {
446
492
 
447
493
  Usage:
448
494
  aiws change list
449
- aiws change start <change-id> [--title <title>] [--no-design] [--hooks] [--no-switch] [--switch] [--worktree] [--worktree-dir <path>] [--submodules]
495
+ aiws change start <change-id> [--title <title>] [--no-design] [--hooks] [--no-switch] [--switch] [--allow-dirty] [--worktree] [--worktree-dir <path>]
450
496
  aiws change finish [change-id] [--into <branch> | --base <branch>]
451
497
  aiws change new <change-id> [--title <title>] [--no-design]
452
498
  aiws change status [change-id]
453
499
  aiws change next [change-id]
454
- aiws change validate [change-id] [--strict] [--allow-truth-drift]
500
+ aiws change validate [change-id] [--strict] [--allow-truth-drift] [--check-evidence] [--check-scope]
501
+ aiws change evidence [change-id] [--no-validate] [--allow-fail]
502
+ aiws change state [change-id] [--write]
455
503
  aiws change sync [change-id]
456
504
  aiws change archive [change-id] [--date YYYY-MM-DD] [--force]
457
505
  aiws change templates which
@@ -464,6 +512,7 @@ Notes:
464
512
  - Execution quality gate first: aiws change validate [change-id] --strict
465
513
  (equivalent to running $ws-plan-verify in AI tools).
466
514
  - status/next now prioritize quality-gate guidance before coding ($ws-dev).
515
+ - start refuses to switch/create worktree with a dirty working tree (unless --allow-dirty).
467
516
  - If .gitmodules exists and you didn't specify --switch/--no-switch/--worktree,
468
517
  start will prefer --worktree (fallback: --no-switch) to avoid switching the superproject branch.
469
518
  - archive runs strict validation and (by default) requires all tasks checked.
@@ -471,6 +520,17 @@ Notes:
471
520
  `);
472
521
  }
473
522
 
523
+ function printMetricsHelp() {
524
+ console.log(`aiws metrics
525
+
526
+ Usage:
527
+ aiws metrics summary [--since YYYY-MM-DD]
528
+
529
+ Notes:
530
+ - Reads changes/*/metrics.json (and changes/archive/*/metrics.json) and prints a best-effort summary.
531
+ `);
532
+ }
533
+
474
534
  /**
475
535
  * Minimal argv parser:
476
536
  * - supports: --k=v, --k v