@deftai/directive 0.73.1 → 0.75.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.
@@ -10,7 +10,7 @@ export interface DispatchIo {
10
10
  writeErr: (text: string) => void;
11
11
  }
12
12
  /** CLI modules in packages/cli/src (excluding parity harnesses and bin/index). */
13
- export declare const CLI_MODULE_VERBS: readonly ["agents-refresh", "cache", "check", "capacity-backfill", "capacity-show", "codebase-default-extractor", "codebase-map", "codebase-map-fresh", "codebase-projection-registry", "codebase-provider", "doctor", "install-upgrade", "install-uninstall", "migrate-preflight", "migrate-xbrief", "migrate-category-b", "framework-check-updates", "umbrella-current-shape", "changelog-check", "change-init", "commit-lint", "policy", "pr-closing-keywords", "pr-merge-readiness", "pr-monitor", "pr-protected-issues", "pr-wait-mergeable", "pr-watch", "preflight-cache", "preflight-gh", "probe-session", "release", "release-e2e", "release-publish", "release-rollback", "scope-lifecycle", "session-start", "slice", "subagent-monitor", "toolchain-check", "triage-actions", "triage-bootstrap", "triage-bulk", "triage-classify", "triage-help", "triage-queue", "triage-reconcile", "triage-refresh", "triage-scope", "triage-scope-drift", "triage-smoketest", "triage-subscribe", "triage-summary", "triage-welcome", "ts-check-lane", "vbrief-activate", "vbrief-build", "vbrief-preflight", "vbrief-reconcile", "vbrief-validate", "vbrief-validation", "verify-branch", "verify-encoding", "verify-forward-coverage", "verify-hooks-installed", "verify-investigation", "verify-judgment-gates", "verify-no-task-runtime", "validate-links", "validate-strategy-output", "verify-biome-config", "verify-bridge-drift", "verify-capacity", "verify-content-manifest", "verify-contract-drift", "verify-cursor-tier1", "verify-go-freeze", "verify-scm-boundary", "verify-session-ritual", "verify-stubs", "verify-xbrief-drift", "rule-ownership-lint", "verify-story-ready", "verify-tools", "verify-wip-cap", "verify-agents-md-budget", "verify-agents-md-advisory", "eval-health", "eval-run", "eval-report"];
13
+ export declare const CLI_MODULE_VERBS: readonly ["agents-refresh", "cache", "check", "capacity-backfill", "capacity-show", "codebase-default-extractor", "codebase-map", "codebase-map-fresh", "codebase-projection-registry", "codebase-provider", "doctor", "install-upgrade", "install-uninstall", "migrate-preflight", "migrate-xbrief", "migrate-category-b", "framework-check-updates", "umbrella-current-shape", "changelog-check", "change-init", "commit-lint", "policy", "pr-closing-keywords", "pr-merge-readiness", "pr-monitor", "pr-protected-issues", "pr-wait-mergeable", "pr-watch", "preflight-cache", "preflight-gh", "probe-session", "release", "release-e2e", "release-publish", "release-rollback", "scope-lifecycle", "session-start", "slice", "subagent-monitor", "toolchain-check", "triage-actions", "triage-bootstrap", "triage-bulk", "triage-classify", "triage-help", "triage-queue", "triage-reconcile", "triage-refresh", "triage-scope", "triage-scope-drift", "triage-smoketest", "triage-subscribe", "triage-summary", "triage-welcome", "ts-check-lane", "vbrief-activate", "vbrief-build", "vbrief-preflight", "vbrief-reconcile", "vbrief-validate", "vbrief-validation", "verify-branch", "verify-encoding", "verify-forward-coverage", "verify-hooks-installed", "verify-investigation", "verify-judgment-gates", "verify-no-task-runtime", "validate-links", "validate-strategy-output", "verify-biome-config", "verify-bridge-drift", "verify-capacity", "verify-content-manifest", "verify-contract-drift", "verify-cursor-tier1", "verify-go-freeze", "verify-scm-boundary", "verify-session-ritual", "verify-stubs", "verify-xbrief-drift", "rule-ownership-lint", "verify-story-ready", "verify-tools", "verify-wip-cap", "verify-agents-md-budget", "verify-agents-md-advisory", "verify-eval-health-relocation", "eval-health", "eval-run", "eval-report"];
14
14
  /** Core-only CLI entrypoints without a packages/cli wrapper. */
15
15
  export declare const CORE_MODULE_VERBS: readonly ["scm", "github-auth-modes", "github-body", "issue-emit", "issue-ingest", "reconcile-issues", "swarm-launch", "swarm-complete-cohort", "swarm-finalize-cohort", "swarm-readiness", "swarm-routing-verify", "swarm-routing-set", "swarm-verify-review-clean", "swarm-worktrees", "framework-commands", "pack-render", "packs-slice", "prd-render", "export-spec", "project-render", "roadmap-render", "spec-render", "spec-validate", "code-structure-validate", "pack-migrate-skills", "pack-migrate-rules", "pack-migrate-strategies", "pack-migrate-patterns", "pack-migrate-swarm-spec", "policy-set", "setup-ghx", "scope-undo", "scope-demote", "scope-decompose", "changelog-resolve-unreleased", "architecture-preflight-sor", "feedback-file", "value-readback"];
16
16
  /** Colon aliases for triage-actions (mirrors cli-router SUBCOMMAND_ROUTES). */
@@ -150,9 +150,21 @@ export declare function resolveCanonicalVerb(verb: string): string | null;
150
150
  /** Sorted list of all registered verb names (canonical + aliases). */
151
151
  export declare function registeredVerbs(): readonly string[];
152
152
  /**
153
- * Print dispatcher help. Leads with the three-command model (init / update /
154
- * doctor) + first-run guidance so a no-arg `directive` orients a newcomer before
155
- * the exhaustive verb list, which stays available below for power users (#2273).
153
+ * Deduplicated command names for `directive commands`, preferring colon-style
154
+ * task verbs over dash-style canonical stems when both exist (#2172).
155
+ */
156
+ export declare function preferredCommandNames(): readonly string[];
157
+ /** Major.minor label for the curated help title (#2172). */
158
+ export declare function helpVersionLabel(): string;
159
+ /**
160
+ * Print the exhaustive registered-command list for `directive commands` (#2172).
161
+ * Lists deduplicated preferred names (colon-style when available).
162
+ */
163
+ export declare function printCommandsList(io?: DispatchIo): void;
164
+ /**
165
+ * Print curated top-level help: title/version, usage, common options, grouped
166
+ * common commands, and a pointer to `directive commands` for the full list
167
+ * (#2172). Preserves the init/update/doctor first-run guidance from #2273.
156
168
  */
157
169
  export declare function printHelp(io?: DispatchIo): void;
158
170
  /** Dispatch argv to a registered verb; returns the handler exit code. */
package/dist/dispatch.js CHANGED
@@ -111,6 +111,7 @@ export const CLI_MODULE_VERBS = [
111
111
  "verify-wip-cap",
112
112
  "verify-agents-md-budget",
113
113
  "verify-agents-md-advisory",
114
+ "verify-eval-health-relocation",
114
115
  "eval-health",
115
116
  "eval-run",
116
117
  "eval-report",
@@ -185,6 +186,7 @@ export const VERB_ALIASES = {
185
186
  "verify:wip-cap": "verify-wip-cap",
186
187
  "verify:agents-md-budget": "verify-agents-md-budget",
187
188
  "verify:agents-md-advisory": "verify-agents-md-advisory",
189
+ "verify:eval-health-relocation": "verify-eval-health-relocation",
188
190
  "verify:hooks-installed": "verify-hooks-installed",
189
191
  "verify:no-task-runtime": "verify-no-task-runtime",
190
192
  "vbrief:validate": "vbrief-validate",
@@ -2357,32 +2359,126 @@ export function registeredVerbs() {
2357
2359
  ]);
2358
2360
  return [...names].sort();
2359
2361
  }
2362
+ /** Top-level UX commands routed before the flat dispatcher (#1670). */
2363
+ const TOP_LEVEL_COMMAND_NAMES = [
2364
+ "init",
2365
+ "update",
2366
+ "migrate",
2367
+ "bootstrap",
2368
+ "doctor",
2369
+ "check",
2370
+ ];
2371
+ /** Scope lifecycle verbs exposed as scope:<verb> in help (#2172). */
2372
+ const SCOPE_COMMAND_NAMES = [
2373
+ "scope:promote",
2374
+ "scope:activate",
2375
+ "scope:complete",
2376
+ "scope:demote",
2377
+ "scope:undo",
2378
+ ];
2379
+ /**
2380
+ * Deduplicated command names for `directive commands`, preferring colon-style
2381
+ * task verbs over dash-style canonical stems when both exist (#2172).
2382
+ */
2383
+ export function preferredCommandNames() {
2384
+ const aliasKeys = Object.keys(VERB_ALIASES);
2385
+ const aliasedCanonicals = new Set(Object.values(VERB_ALIASES));
2386
+ const unaliasedCanonicals = [...CLI_MODULE_VERBS, ...CORE_MODULE_VERBS].filter((verb) => !aliasedCanonicals.has(verb));
2387
+ return [
2388
+ ...new Set([
2389
+ ...TOP_LEVEL_COMMAND_NAMES,
2390
+ ...SCOPE_COMMAND_NAMES,
2391
+ ...aliasKeys,
2392
+ ...unaliasedCanonicals,
2393
+ ]),
2394
+ ].sort();
2395
+ }
2396
+ /** Major.minor label for the curated help title (#2172). */
2397
+ export function helpVersionLabel() {
2398
+ const version = engineInfo().version;
2399
+ const match = /^(\d+\.\d+)/.exec(version);
2400
+ return match ? `v${match[1]}` : `v${version}`;
2401
+ }
2402
+ const CURATED_HELP_GROUPS = [
2403
+ {
2404
+ title: "Getting started",
2405
+ commands: [
2406
+ { name: "init", summary: "Set up Directive in the current project (first-time setup)" },
2407
+ { name: "update", summary: "Refresh an existing install and self-heal the engine" },
2408
+ { name: "doctor", summary: "Diagnose the install and print the one next step" },
2409
+ ],
2410
+ },
2411
+ {
2412
+ title: "Session & ritual",
2413
+ commands: [{ name: "session:start", summary: "Record session-start ritual state" }],
2414
+ },
2415
+ {
2416
+ title: "Quality & gates",
2417
+ commands: [{ name: "check", summary: "Run install and lifecycle quality gates" }],
2418
+ },
2419
+ {
2420
+ title: "Work queue & triage",
2421
+ commands: [
2422
+ { name: "triage:welcome", summary: "Session orientation and triage one-liner" },
2423
+ { name: "triage:queue", summary: "Ranked work queue for what to do next" },
2424
+ ],
2425
+ },
2426
+ {
2427
+ title: "Scope lifecycle",
2428
+ commands: [{ name: "scope:promote", summary: "Promote a scope xBRIEF to pending" }],
2429
+ },
2430
+ {
2431
+ title: "Project artifacts",
2432
+ commands: [
2433
+ { name: "project:render", summary: "Render PROJECT-DEFINITION projection" },
2434
+ { name: "spec:render", summary: "Render specification projection" },
2435
+ ],
2436
+ },
2437
+ ];
2438
+ function formatHelpCommand(command) {
2439
+ const padding = " ".repeat(Math.max(1, 22 - command.name.length));
2440
+ return ` ${command.name}${padding}${command.summary}\n`;
2441
+ }
2442
+ /**
2443
+ * Print the exhaustive registered-command list for `directive commands` (#2172).
2444
+ * Lists deduplicated preferred names (colon-style when available).
2445
+ */
2446
+ export function printCommandsList(io = defaultIo()) {
2447
+ io.writeOut("Registered commands:\n");
2448
+ for (const name of preferredCommandNames()) {
2449
+ io.writeOut(` ${name}\n`);
2450
+ }
2451
+ }
2360
2452
  /**
2361
- * Print dispatcher help. Leads with the three-command model (init / update /
2362
- * doctor) + first-run guidance so a no-arg `directive` orients a newcomer before
2363
- * the exhaustive verb list, which stays available below for power users (#2273).
2453
+ * Print curated top-level help: title/version, usage, common options, grouped
2454
+ * common commands, and a pointer to `directive commands` for the full list
2455
+ * (#2172). Preserves the init/update/doctor first-run guidance from #2273.
2364
2456
  */
2365
2457
  export function printHelp(io = defaultIo()) {
2366
- io.writeOut("directive -- the Deft Directive CLI\n" +
2367
- "\n" +
2368
- "Start here (most projects only need these three):\n" +
2369
- " directive init Set up Directive in the current project (first-time setup)\n" +
2370
- " directive update Refresh an existing install and self-heal the engine\n" +
2371
- " directive doctor Diagnose the install and print the one next step\n" +
2372
- "\n" +
2458
+ io.writeOut(`Directive ${helpVersionLabel()}\n`);
2459
+ io.writeOut("AI development framework CLI for project lifecycle, scope, and quality gates.\n\n");
2460
+ io.writeOut("Usage:\n");
2461
+ io.writeOut(" directive <command> [options]\n");
2462
+ io.writeOut(" directive help\n");
2463
+ io.writeOut(" directive commands List every registered command\n\n");
2464
+ io.writeOut("Options:\n");
2465
+ io.writeOut(" -h, --help Show this help\n");
2466
+ io.writeOut(" -V, --version Print version information\n\n");
2467
+ for (const group of CURATED_HELP_GROUPS) {
2468
+ io.writeOut(`${group.title}:\n`);
2469
+ for (const command of group.commands) {
2470
+ io.writeOut(formatHelpCommand(command));
2471
+ }
2472
+ io.writeOut("\n");
2473
+ }
2474
+ io.writeOut("Commands use colon style (e.g. triage:queue); dash-style aliases remain supported.\n" +
2475
+ "Run `directive commands` for the full registered-command list.\n\n" +
2373
2476
  "First run? From the project root:\n" +
2374
2477
  " 1. npm i -g @deftai/directive (Node >= 20)\n" +
2375
2478
  " (pnpm: pnpm add -g @deftai/directive -- ensure PNPM_HOME is on PATH, run `pnpm setup` if needed)\n" +
2376
2479
  " 2. directive init\n" +
2377
2480
  " 3. directive doctor\n" +
2378
- "New clone where `directive` will not run? Read the Cold-start bootstrap block at the top of README.md.\n" +
2379
- "\n" +
2380
- "Usage: directive <verb> [args...]\n" +
2381
- "\n" +
2382
- "Registered verbs:\n");
2383
- for (const name of registeredVerbs()) {
2384
- io.writeOut(` ${name}\n`);
2385
- }
2481
+ "New clone where `directive` will not run? Read the Cold-start bootstrap block at the top of README.md.\n");
2386
2482
  }
2387
2483
  async function invokeHandler(handler, argv) {
2388
2484
  const code = await handler(argv);
@@ -2404,6 +2500,10 @@ export async function dispatch(argv, io = defaultIo()) {
2404
2500
  return 0;
2405
2501
  }
2406
2502
  const [verb, ...rest] = argv;
2503
+ if (verb === "commands") {
2504
+ printCommandsList(io);
2505
+ return 0;
2506
+ }
2407
2507
  const canonical = resolveCanonicalVerb(verb ?? "");
2408
2508
  if (canonical === null) {
2409
2509
  io.writeErr(`directive: unknown verb '${verb}'\n`);
@@ -47,6 +47,22 @@ export function run(argv) {
47
47
  process.stderr.write(`${result.message}\n`);
48
48
  }
49
49
  }
50
+ if (result.northStarMessage !== undefined && result.northStarMessage.length > 0) {
51
+ if (result.northStarStream === "stdout") {
52
+ process.stdout.write(`${result.northStarMessage}\n`);
53
+ }
54
+ else if (result.northStarStream === "stderr") {
55
+ process.stderr.write(`${result.northStarMessage}\n`);
56
+ }
57
+ }
58
+ else if (result.advisoryMessage !== undefined && result.advisoryMessage.length > 0) {
59
+ if (result.advisoryStream === "stdout") {
60
+ process.stdout.write(`${result.advisoryMessage}\n`);
61
+ }
62
+ else if (result.advisoryStream === "stderr") {
63
+ process.stderr.write(`${result.advisoryMessage}\n`);
64
+ }
65
+ }
50
66
  return result.code;
51
67
  }
52
68
  if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env node
2
+ interface ParsedArgs {
3
+ projectRoot: string;
4
+ baseRef?: string;
5
+ staged: boolean;
6
+ quiet: boolean;
7
+ seedBaseline: boolean;
8
+ paths: string[];
9
+ error?: string;
10
+ }
11
+ /** Parse verify-eval-health-relocation CLI args. */
12
+ export declare function parseArgs(argv: string[]): ParsedArgs;
13
+ /** Run the gate and return the process exit code. */
14
+ export declare function run(argv: string[]): number;
15
+ export {};
16
+ //# sourceMappingURL=verify-eval-health-relocation.d.ts.map
@@ -0,0 +1,93 @@
1
+ #!/usr/bin/env node
2
+ import { resolve } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import { evaluate } from "@deftai/directive-core/eval-health-relocation";
5
+ /** Parse verify-eval-health-relocation CLI args. */
6
+ export function parseArgs(argv) {
7
+ const parsed = {
8
+ projectRoot: ".",
9
+ staged: false,
10
+ quiet: false,
11
+ seedBaseline: false,
12
+ paths: [],
13
+ };
14
+ for (let i = 0; i < argv.length; i += 1) {
15
+ const arg = argv[i];
16
+ if (arg === "--quiet") {
17
+ parsed.quiet = true;
18
+ }
19
+ else if (arg === "--staged") {
20
+ parsed.staged = true;
21
+ }
22
+ else if (arg === "--seed-baseline") {
23
+ parsed.seedBaseline = true;
24
+ }
25
+ else if (arg === "--project-root") {
26
+ const value = argv[i + 1];
27
+ if (value === undefined) {
28
+ return { ...parsed, error: "argument --project-root: expected one argument" };
29
+ }
30
+ parsed.projectRoot = value;
31
+ i += 1;
32
+ }
33
+ else if (arg?.startsWith("--project-root=")) {
34
+ parsed.projectRoot = arg.slice("--project-root=".length);
35
+ }
36
+ else if (arg === "--base-ref") {
37
+ const value = argv[i + 1];
38
+ if (value === undefined) {
39
+ return { ...parsed, error: "argument --base-ref: expected one argument" };
40
+ }
41
+ parsed.baseRef = value;
42
+ i += 1;
43
+ }
44
+ else if (arg?.startsWith("--base-ref=")) {
45
+ parsed.baseRef = arg.slice("--base-ref=".length);
46
+ }
47
+ else if (arg === "--path") {
48
+ const value = argv[i + 1];
49
+ if (value === undefined) {
50
+ return { ...parsed, error: "argument --path: expected one argument" };
51
+ }
52
+ parsed.paths.push(value);
53
+ i += 1;
54
+ }
55
+ else if (arg?.startsWith("--path=")) {
56
+ parsed.paths.push(arg.slice("--path=".length));
57
+ }
58
+ else {
59
+ return { ...parsed, error: `unrecognized argument: ${arg}` };
60
+ }
61
+ }
62
+ return parsed;
63
+ }
64
+ /** Run the gate and return the process exit code. */
65
+ export function run(argv) {
66
+ const args = parseArgs(argv);
67
+ if (args.error !== undefined) {
68
+ process.stderr.write(`verify_eval_health_relocation: ${args.error}\n`);
69
+ return 2;
70
+ }
71
+ const projectRoot = resolve(args.projectRoot);
72
+ const result = evaluate({
73
+ projectRoot,
74
+ baseRef: args.baseRef,
75
+ staged: args.staged,
76
+ quiet: args.quiet,
77
+ seedBaseline: args.seedBaseline,
78
+ paths: args.paths.length > 0 ? args.paths : undefined,
79
+ });
80
+ if (result.message.length > 0) {
81
+ if (result.stream === "stdout") {
82
+ process.stdout.write(`${result.message}\n`);
83
+ }
84
+ else if (result.stream === "stderr") {
85
+ process.stderr.write(`${result.message}\n`);
86
+ }
87
+ }
88
+ return result.code;
89
+ }
90
+ if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
91
+ process.exit(run(process.argv.slice(2)));
92
+ }
93
+ //# sourceMappingURL=verify-eval-health-relocation.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deftai/directive",
3
- "version": "0.73.1",
3
+ "version": "0.75.0",
4
4
  "description": "Directive CLI — npm install path for the Deft Directive framework.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -31,8 +31,8 @@
31
31
  "provenance": true
32
32
  },
33
33
  "dependencies": {
34
- "@deftai/directive-core": "^0.73.1",
35
- "@deftai/directive-content": "^0.73.1"
34
+ "@deftai/directive-core": "^0.75.0",
35
+ "@deftai/directive-content": "^0.75.0"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "tsc -b"