@deftai/directive 0.116.0 → 0.118.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,9 +10,9 @@ 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", "hook-dispatch", "umbrella-current-shape", "changelog-check", "change-init", "commit-lint", "coverage-hotspots", "policy", "authz", "escalation-cli", "pr-closing-keywords", "pr-merge-readiness", "pr-monitor", "pr-protected-issues", "pr-wait-mergeable", "pr-watch", "pr-finish-loop", "directive-finish-loop", "preflight-cache", "preflight-gh", "probe-session", "release", "release-e2e", "release-publish", "release-rollback", "scope-lifecycle", "scope-record-approved-scope", "scm-sync-default", "lifecycle-event", "lifecycle-stats", "session-start", "session-ready", "occupancy-steal", "occupancy-release", "occupancy-heartbeat", "occupancy-grant", "plan-sequence", "slice", "subagent-monitor", "toolchain-check", "triage-actions", "triage-bootstrap", "triage-bulk", "triage-classify", "triage-strip-withdrawn", "triage-evaluate", "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", "xbrief-create", "xbrief-verify", "verify-branch", "verify-encoding", "verify-forward-coverage", "verify-test-boundary", "verify-scope-provenance", "verify-consumer-check-contract", "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-contained-writes", "verify-telemetry-coverage", "verify-content-manifest", "verify-deposit-closure", "verify-consumer-hard-stops", "verify-closing-keywords", "verify-skill-external-fetch-gate", "verify-semantic-single-source", "verify-contract-drift", "verify-cursor-tier1", "verify-openclaw-tier1", "verify-go-freeze", "verify-scm-boundary", "verify-session-ritual", "verify-plan-sequence", "verify-stubs", "verify-xbrief-drift", "verify-spec-prd-fresh", "rule-ownership-lint", "verify-story-ready", "verify-review-monitor", "verify-l4-owner", "verify-subagent-alive", "verify-subagent-steer", "review-monitor-register", "review-monitor-release", "verify-tools", "verify-wip-cap", "verify-orphan-active", "verify-pr-closeout-attestable", "verify-lifecycle-visible", "verify-completed-tracked", "verify-completed-write-guard", "verify-literal-ac", "verify-ac", "verify-agents-md-budget", "verify-agents-md-advisory", "verify-eval-health-relocation", "verify-eval-triggers-relocation", "eval-health", "eval-run", "eval-report", "eval-triggers"];
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", "hook-dispatch", "umbrella-current-shape", "changelog-check", "change-init", "commit-lint", "coverage-hotspots", "policy", "authz", "escalation-cli", "pr-closing-keywords", "pr-merge-readiness", "pr-monitor", "pr-protected-issues", "pr-wait-mergeable", "pr-watch", "pr-finish-loop", "directive-finish-loop", "preflight-cache", "preflight-gh", "probe-session", "release", "release-e2e", "release-publish", "release-rollback", "scope-lifecycle", "scope-record-approved-scope", "scm-sync-default", "lifecycle-event", "lifecycle-stats", "session-start", "session-ready", "occupancy-steal", "occupancy-release", "occupancy-heartbeat", "occupancy-grant", "plan-sequence", "slice", "subagent-monitor", "toolchain-check", "triage-actions", "triage-bootstrap", "triage-bulk", "triage-classify", "triage-strip-withdrawn", "triage-evaluate", "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", "xbrief-create", "xbrief-verify", "verify-branch", "verify-encoding", "verify-forward-coverage", "verify-test-boundary", "verify-scope-provenance", "verify-consumer-check-contract", "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-contained-writes", "verify-telemetry-coverage", "verify-content-manifest", "verify-deposit-closure", "verify-consumer-hard-stops", "verify-closing-keywords", "verify-skill-external-fetch-gate", "verify-semantic-single-source", "verify-contract-drift", "verify-cursor-tier1", "verify-openclaw-tier1", "verify-go-freeze", "verify-scm-boundary", "verify-session-ritual", "verify-plan-sequence", "verify-stubs", "verify-xbrief-drift", "verify-spec-prd-fresh", "rule-ownership-lint", "verify-story-ready", "verify-review-monitor", "verify-l4-owner", "verify-subagent-alive", "verify-subagent-steer", "review-monitor-register", "review-monitor-release", "verify-tools", "verify-wip-cap", "verify-orphan-active", "verify-pr-closeout-attestable", "verify-lifecycle-visible", "verify-completed-tracked", "verify-completed-write-guard", "verify-literal-ac", "verify-ac", "verify-agents-md-budget", "verify-agents-md-advisory", "verify-eval-health-relocation", "verify-eval-triggers-relocation", "verify-evaluator-surface", "verify-consumer-test-lane", "eval-health", "eval-run", "eval-report", "eval-triggers"];
14
14
  /** Core-only CLI entrypoints without a packages/cli wrapper. */
15
- export declare const CORE_MODULE_VERBS: readonly ["scm", "scm-readiness", "github-auth-modes", "github-body", "issue-emit", "issue-ingest", "issue-sync-from-xbrief", "reconcile-issues", "swarm-launch", "swarm-complete-cohort", "swarm-finalize-cohort", "swarm-pre-dispatch", "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", "rule-map", "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", "product-signal", "freshness-report", "decision-write", "decision-list"];
15
+ export declare const CORE_MODULE_VERBS: readonly ["scm", "scm-readiness", "github-auth-modes", "github-body", "issue-emit", "issue-ingest", "issue-sync-from-xbrief", "reconcile-issues", "swarm-launch", "swarm-complete-cohort", "swarm-finalize-cohort", "swarm-pre-dispatch", "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", "rule-map", "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", "product-signal", "freshness-report", "decision-write", "decision-list", "docs-impact"];
16
16
  /** Colon aliases for triage-actions (mirrors cli-router SUBCOMMAND_ROUTES). */
17
17
  export declare const TRIAGE_ACTION_ALIAS_SUBCOMMANDS: Readonly<Record<string, string>>;
18
18
  /** Colon aliases for policy subcommands (mirrors cli-router SUBCOMMAND_ROUTES). */
package/dist/dispatch.js CHANGED
@@ -161,6 +161,8 @@ export const CLI_MODULE_VERBS = [
161
161
  "verify-agents-md-advisory",
162
162
  "verify-eval-health-relocation",
163
163
  "verify-eval-triggers-relocation",
164
+ "verify-evaluator-surface",
165
+ "verify-consumer-test-lane",
164
166
  "eval-health",
165
167
  "eval-run",
166
168
  "eval-report",
@@ -214,6 +216,7 @@ export const CORE_MODULE_VERBS = [
214
216
  "freshness-report",
215
217
  "decision-write",
216
218
  "decision-list",
219
+ "docs-impact",
217
220
  ];
218
221
  /** Colon aliases for triage-actions (mirrors cli-router SUBCOMMAND_ROUTES). */
219
222
  export const TRIAGE_ACTION_ALIAS_SUBCOMMANDS = {
@@ -309,6 +312,8 @@ export const VERB_ALIASES = {
309
312
  "verify:agents-md-advisory": "verify-agents-md-advisory",
310
313
  "verify:eval-health-relocation": "verify-eval-health-relocation",
311
314
  "verify:eval-triggers-relocation": "verify-eval-triggers-relocation",
315
+ "verify:evaluator-surface": "verify-evaluator-surface",
316
+ "verify:consumer-test-lane": "verify-consumer-test-lane",
312
317
  "verify:hooks-installed": "verify-hooks-installed",
313
318
  "verify:no-task-runtime": "verify-no-task-runtime",
314
319
  "vbrief:validate": "vbrief-validate",
@@ -345,6 +350,7 @@ export const VERB_ALIASES = {
345
350
  "verify:deposit-closure": "verify-deposit-closure",
346
351
  "verify:consumer-hard-stops": "verify-consumer-hard-stops",
347
352
  "verify:closing-keywords": "verify-closing-keywords",
353
+ "verify:docs-impact": "docs-impact",
348
354
  "verify:skill-external-fetch-gate": "verify-skill-external-fetch-gate",
349
355
  "verify:semantic-single-source": "verify-semantic-single-source",
350
356
  "verify:contract-drift": "verify-contract-drift",
@@ -2568,6 +2574,10 @@ async function loadCoreModuleHandler(verb, io) {
2568
2574
  const { listMainEntry } = await import("@deftai/directive-core/dist/decision/index.js");
2569
2575
  return listMainEntry;
2570
2576
  }
2577
+ case "docs-impact": {
2578
+ const { docsImpactMain } = await import("@deftai/directive-core/dist/docs/docs-impact.js");
2579
+ return (argv) => docsImpactMain(argv);
2580
+ }
2571
2581
  default:
2572
2582
  throw new Error(`unknown core verb: ${verb}`);
2573
2583
  }
@@ -2,7 +2,7 @@
2
2
  import { readFileSync } from "node:fs";
3
3
  import { resolve } from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
- import { decideHook, hookPayloadTopLevelKeys, isHookEvent, isHookHost, normalizeHookProjectRoot, parseHookStdin, projectRootFromHookPayload, renderHostDecision, } from "@deftai/directive-core/hooks";
5
+ import { decideHook, hookPayloadTopLevelKeys, isHookEvent, isHookHost, mergeHookDispatchEnviron, normalizeHookProjectRoot, parseHookStdin, projectRootFromHookPayload, renderHostDecision, } from "@deftai/directive-core/hooks";
6
6
  /**
7
7
  * How long to re-poll stdin after an empty first read before concluding the host
8
8
  * sent nothing (#2864). Keeps well under Cursor's deposited `timeout: 5` while
@@ -144,12 +144,14 @@ export function run(argv, seams = {}) {
144
144
  const cwd = (seams.cwd ?? process.cwd)();
145
145
  const { payload, context: payloadContext } = parsePayload(rawStdin);
146
146
  const projectRoot = normalizeHookProjectRoot(args.projectRoot ? resolve(args.projectRoot) : projectRootFromHookPayload(payload, cwd));
147
+ const environ = mergeHookDispatchEnviron(payload);
147
148
  const decision = decideHook({
148
149
  host: args.host,
149
150
  event: args.event,
150
151
  projectRoot,
151
152
  payload,
152
153
  payloadContext,
154
+ ...(environ !== undefined ? { environ } : {}),
153
155
  });
154
156
  const rendered = renderHostDecision(args.host, decision);
155
157
  if (rendered.length > 0)
@@ -14,6 +14,7 @@ export function printUpdateHelp(io) {
14
14
  " --json Machine-readable summary on stdout\n" +
15
15
  " --yes, --non-interactive Run without prompts\n" +
16
16
  " --dry-run, --plan Classify and print the refresh plan without writing\n" +
17
+ " --allow-dirty-no-stage Apply on a dirty tree without automatic git add\n" +
17
18
  " -h, --help Show this help\n");
18
19
  }
19
20
  export function printInitHelp(io) {
@@ -1,22 +1,31 @@
1
- import { parseUpdateArgv, runRefreshDepositCli } from "@deftai/directive-core/init-deposit";
1
+ import { parseUpdateArgv, runRefreshDepositCli, UnknownUpdateFlagError, } from "@deftai/directive-core/init-deposit";
2
2
  import { CANONICAL_UPDATE_ARGV, UPDATE_DRY_RUN_FLAGS } from "./constants.js";
3
3
  import { argvWantsHelp, printUpdateHelp } from "./help.js";
4
4
  /** True when the user argv asked for a classify-only dry-run (`--dry-run`/`--plan`). */
5
5
  export function isUpdateDryRun(argv) {
6
6
  const flags = UPDATE_DRY_RUN_FLAGS;
7
- return argv.some((arg) => flags.includes(arg));
7
+ return argv.some((arg) => flags.includes(arg) || arg === "/dry-run" || arg === "/plan");
8
8
  }
9
9
  export function runUpdate(argv, io) {
10
10
  if (argvWantsHelp(argv)) {
11
11
  printUpdateHelp(io);
12
12
  return Promise.resolve(0);
13
13
  }
14
- const args = parseUpdateArgv(CANONICAL_UPDATE_ARGV, argv);
15
- return runRefreshDepositCli({
16
- ...args,
17
- dryRun: isUpdateDryRun(argv),
18
- writeOut: io.writeOut,
19
- writeErr: io.writeErr,
20
- });
14
+ try {
15
+ const args = parseUpdateArgv(CANONICAL_UPDATE_ARGV, argv);
16
+ return runRefreshDepositCli({
17
+ ...args,
18
+ dryRun: isUpdateDryRun(argv),
19
+ writeOut: io.writeOut,
20
+ writeErr: io.writeErr,
21
+ });
22
+ }
23
+ catch (cause) {
24
+ if (cause instanceof UnknownUpdateFlagError) {
25
+ io.writeErr(`directive update: ${cause.message}\n`);
26
+ return Promise.resolve(2);
27
+ }
28
+ throw cause;
29
+ }
21
30
  }
22
31
  //# sourceMappingURL=update.js.map
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { resolve } from "node:path";
3
3
  import { grantOccupancyMembership, OCCUPANCY_JOIN_PROTOCOLS, revokeOccupancyMembership, } from "@deftai/directive-core/session";
4
+ import { occupancyUnrecognizedArgument } from "./occupancy-unrecognized.js";
4
5
  const VALUE_FLAGS = [
5
6
  "--project-root",
6
7
  "--session-id",
@@ -36,7 +37,7 @@ export function parseArgs(argv) {
36
37
  return {
37
38
  ...parsed,
38
39
  revoke: argv.includes("--revoke"),
39
- error: `unrecognized argument: ${arg}`,
40
+ error: occupancyUnrecognizedArgument(arg),
40
41
  };
41
42
  }
42
43
  const read = readValue(argv, i, flag);
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { resolve } from "node:path";
3
3
  import { heartbeatOccupancy } from "@deftai/directive-core/session";
4
+ import { occupancyUnrecognizedArgument } from "./occupancy-unrecognized.js";
4
5
  export function parseArgs(argv) {
5
6
  const parsed = { projectRoot: "." };
6
7
  for (let i = 0; i < argv.length; i += 1) {
@@ -40,7 +41,7 @@ export function parseArgs(argv) {
40
41
  parsed.sessionId = sessionId;
41
42
  }
42
43
  else {
43
- return { ...parsed, error: `unrecognized argument: ${arg}` };
44
+ return { ...parsed, error: occupancyUnrecognizedArgument(arg) };
44
45
  }
45
46
  }
46
47
  return parsed;
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { resolve } from "node:path";
3
3
  import { releaseOccupancy } from "@deftai/directive-core/session";
4
+ import { occupancyUnrecognizedArgument } from "./occupancy-unrecognized.js";
4
5
  export function parseArgs(argv) {
5
6
  const parsed = { projectRoot: "." };
6
7
  for (let i = 0; i < argv.length; i += 1) {
@@ -40,7 +41,7 @@ export function parseArgs(argv) {
40
41
  parsed.sessionId = sessionId;
41
42
  }
42
43
  else {
43
- return { ...parsed, error: `unrecognized argument: ${arg}` };
44
+ return { ...parsed, error: occupancyUnrecognizedArgument(arg) };
44
45
  }
45
46
  }
46
47
  return parsed;
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { resolve } from "node:path";
3
3
  import { stealOccupancy } from "@deftai/directive-core/session";
4
+ import { occupancyUnrecognizedArgument } from "./occupancy-unrecognized.js";
4
5
  export function parseArgs(argv) {
5
6
  const parsed = { projectRoot: ".", confirm: false, occupant: null };
6
7
  for (let i = 0; i < argv.length; i += 1) {
@@ -58,7 +59,7 @@ export function parseArgs(argv) {
58
59
  parsed.sessionId = sessionId;
59
60
  }
60
61
  else {
61
- return { ...parsed, error: `unrecognized argument: ${arg}` };
62
+ return { ...parsed, error: occupancyUnrecognizedArgument(arg) };
62
63
  }
63
64
  }
64
65
  return parsed;
@@ -0,0 +1,3 @@
1
+ /** Occupancy-namespace parse: unknown flags name the help surface (#4411). */
2
+ export declare function occupancyUnrecognizedArgument(arg: string | undefined): string;
3
+ //# sourceMappingURL=occupancy-unrecognized.d.ts.map
@@ -0,0 +1,5 @@
1
+ /** Occupancy-namespace parse: unknown flags name the help surface (#4411). */
2
+ export function occupancyUnrecognizedArgument(arg) {
3
+ return `unrecognized argument: ${arg}. See \`deft help\` or \`deft commands\`.`;
4
+ }
5
+ //# sourceMappingURL=occupancy-unrecognized.js.map
@@ -30,7 +30,7 @@ export function runPrdRenderCli(argv) {
30
30
  const parsedArgs = parsePrdArgv(remaining);
31
31
  prdRenderMain({
32
32
  ...parsedArgs,
33
- projectRoot: parsedArgs.spec === undefined ? projectRoot : undefined,
33
+ projectRoot: projectRoot ?? parsedArgs.projectRoot,
34
34
  });
35
35
  return 0;
36
36
  }
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { type CeremonyDepth, type CeremonyDialInputs } from "@deftai/directive-core/policy";
3
- import { type SessionCeremonyTier } from "@deftai/directive-core/session";
3
+ import { type PrimaryClaimException, type SessionCeremonyTier } from "@deftai/directive-core/session";
4
4
  export interface ParsedSessionStartArgs {
5
5
  projectRoot: string;
6
6
  deferValues: string[];
@@ -36,6 +36,11 @@ export interface ParsedSessionStartArgs {
36
36
  steal: boolean;
37
37
  confirm: boolean;
38
38
  occupant: string | null;
39
+ /**
40
+ * Trusted primary-claim exception from CLI argv (#4266). Closed enum;
41
+ * unknown values fail closed (exit 2).
42
+ */
43
+ primaryClaimException: PrimaryClaimException | null;
39
44
  /** #3611: explicit lifecycle owner injected by a host hook bridge. */
40
45
  sessionId: string | null;
41
46
  error?: string;
@@ -2,7 +2,7 @@
2
2
  import { resolve } from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import { CEREMONY_DEPTHS, normalizeCeremonyModelTier, normalizeCeremonyProjectShape, normalizeCeremonyTaskSize, selectCeremonyDepth, } from "@deftai/directive-core/policy";
5
- import { COLD_CEREMONY_TIER, parseDeferrals, READ_ONLY_POSTURE, REARM_CEREMONY_TIER, resolveProductionHostEffortDescriptor, ritualStatePath, runSessionStart, SESSION_CEREMONY_TIERS, } from "@deftai/directive-core/session";
5
+ import { COLD_CEREMONY_TIER, PRIMARY_CLAIM_EXCEPTIONS, parseDeferrals, READ_ONLY_POSTURE, REARM_CEREMONY_TIER, resolveProductionHostEffortDescriptor, ritualStatePath, runSessionStart, SESSION_CEREMONY_TIERS, } from "@deftai/directive-core/session";
6
6
  function parseCeremonyDepth(raw) {
7
7
  const value = raw.trim().toLowerCase();
8
8
  if (CEREMONY_DEPTHS.includes(value)) {
@@ -17,6 +17,14 @@ function parseCeremonyTier(raw) {
17
17
  }
18
18
  return null;
19
19
  }
20
+ const PRIMARY_CLAIM_EXCEPTION_HELP = PRIMARY_CLAIM_EXCEPTIONS.join("|");
21
+ function parsePrimaryClaimException(raw) {
22
+ const value = raw.trim();
23
+ if (PRIMARY_CLAIM_EXCEPTIONS.includes(value)) {
24
+ return value;
25
+ }
26
+ return null;
27
+ }
20
28
  /** Parse session:start CLI args, mirroring scripts/session_start.py. */
21
29
  export function parseArgs(argv) {
22
30
  const parsed = {
@@ -34,6 +42,7 @@ export function parseArgs(argv) {
34
42
  steal: false,
35
43
  confirm: false,
36
44
  occupant: null,
45
+ primaryClaimException: null,
37
46
  sessionId: null,
38
47
  };
39
48
  const dialInputs = {};
@@ -291,6 +300,41 @@ export function parseArgs(argv) {
291
300
  else if (arg === "--steal") {
292
301
  parsed.steal = true;
293
302
  }
303
+ else if (arg === "--primary-claim-exception") {
304
+ const value = argv[i + 1];
305
+ if (value === undefined || value.startsWith("--")) {
306
+ return {
307
+ ...parsed,
308
+ error: `argument --primary-claim-exception: expected one argument (${PRIMARY_CLAIM_EXCEPTION_HELP})`,
309
+ };
310
+ }
311
+ const exception = parsePrimaryClaimException(value);
312
+ if (exception === null) {
313
+ return {
314
+ ...parsed,
315
+ error: `argument --primary-claim-exception: expected ${PRIMARY_CLAIM_EXCEPTION_HELP}, got ${JSON.stringify(value)}`,
316
+ };
317
+ }
318
+ parsed.primaryClaimException = exception;
319
+ i += 1;
320
+ }
321
+ else if (arg?.startsWith("--primary-claim-exception=")) {
322
+ const value = arg.slice("--primary-claim-exception=".length);
323
+ if (value.length === 0 || value.startsWith("--")) {
324
+ return {
325
+ ...parsed,
326
+ error: `argument --primary-claim-exception: expected one argument (${PRIMARY_CLAIM_EXCEPTION_HELP})`,
327
+ };
328
+ }
329
+ const exception = parsePrimaryClaimException(value);
330
+ if (exception === null) {
331
+ return {
332
+ ...parsed,
333
+ error: `argument --primary-claim-exception: expected ${PRIMARY_CLAIM_EXCEPTION_HELP}, got ${JSON.stringify(value)}`,
334
+ };
335
+ }
336
+ parsed.primaryClaimException = exception;
337
+ }
294
338
  else if (arg === "--confirm") {
295
339
  parsed.confirm = true;
296
340
  }
@@ -393,6 +437,7 @@ export function run(argv) {
393
437
  steal: args.steal ? true : undefined,
394
438
  confirm: args.confirm ? true : undefined,
395
439
  occupant: args.occupant ?? undefined,
440
+ primaryClaimException: args.primaryClaimException ?? undefined,
396
441
  sessionId: args.sessionId ?? undefined,
397
442
  ...(args.ceremonyDepthOverride !== null
398
443
  ? {
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ interface ParsedArgs {
3
+ projectRoot: string;
4
+ quiet: boolean;
5
+ error?: string;
6
+ }
7
+ /** Parse verify-consumer-test-lane CLI args. */
8
+ export declare function parseArgs(argv: string[]): ParsedArgs;
9
+ /** Run the gate and return the process exit code. */
10
+ export declare function run(argv: string[]): Promise<number>;
11
+ export {};
12
+ //# sourceMappingURL=verify-consumer-test-lane.d.ts.map
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env node
2
+ import { resolve } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import { evaluate } from "@deftai/directive-core/consumer-test-lane";
5
+ /** Parse verify-consumer-test-lane CLI args. */
6
+ export function parseArgs(argv) {
7
+ const parsed = {
8
+ projectRoot: ".",
9
+ quiet: false,
10
+ };
11
+ for (let i = 0; i < argv.length; i += 1) {
12
+ const arg = argv[i];
13
+ if (arg === "--quiet") {
14
+ parsed.quiet = true;
15
+ }
16
+ else if (arg === "--project-root") {
17
+ const value = argv[i + 1];
18
+ if (value === undefined) {
19
+ return { ...parsed, error: "argument --project-root: expected one argument" };
20
+ }
21
+ parsed.projectRoot = value;
22
+ i += 1;
23
+ }
24
+ else if (arg?.startsWith("--project-root=")) {
25
+ parsed.projectRoot = arg.slice("--project-root=".length);
26
+ }
27
+ else {
28
+ return { ...parsed, error: `unrecognized argument: ${arg}` };
29
+ }
30
+ }
31
+ return parsed;
32
+ }
33
+ /** Run the gate and return the process exit code. */
34
+ export async function run(argv) {
35
+ const args = parseArgs(argv);
36
+ if (args.error !== undefined) {
37
+ process.stderr.write(`verify_consumer_test_lane: ${args.error}\n`);
38
+ return 2;
39
+ }
40
+ const result = await evaluate({
41
+ projectRoot: resolve(args.projectRoot),
42
+ quiet: args.quiet,
43
+ });
44
+ if (result.message.length > 0) {
45
+ if (result.stream === "stdout") {
46
+ process.stdout.write(`${result.message}\n`);
47
+ }
48
+ else if (result.stream === "stderr") {
49
+ process.stderr.write(`${result.message}\n`);
50
+ }
51
+ }
52
+ return result.code;
53
+ }
54
+ if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
55
+ void run(process.argv.slice(2)).then((code) => process.exit(code));
56
+ }
57
+ //# sourceMappingURL=verify-consumer-test-lane.js.map
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+ interface ParsedArgs {
3
+ projectRoot: string;
4
+ baseRef?: string;
5
+ staged: boolean;
6
+ quiet: boolean;
7
+ paths: string[];
8
+ error?: string;
9
+ }
10
+ /** Parse verify-evaluator-surface CLI args. */
11
+ export declare function parseArgs(argv: string[]): ParsedArgs;
12
+ /** Run the gate and return the process exit code. */
13
+ export declare function run(argv: string[]): number;
14
+ export {};
15
+ //# sourceMappingURL=verify-evaluator-surface.d.ts.map
@@ -0,0 +1,87 @@
1
+ #!/usr/bin/env node
2
+ import { resolve } from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import { evaluate } from "@deftai/directive-core/evaluator-surface";
5
+ /** Parse verify-evaluator-surface CLI args. */
6
+ export function parseArgs(argv) {
7
+ const parsed = {
8
+ projectRoot: ".",
9
+ staged: false,
10
+ quiet: false,
11
+ paths: [],
12
+ };
13
+ for (let i = 0; i < argv.length; i += 1) {
14
+ const arg = argv[i];
15
+ if (arg === "--quiet") {
16
+ parsed.quiet = true;
17
+ }
18
+ else if (arg === "--staged") {
19
+ parsed.staged = true;
20
+ }
21
+ else if (arg === "--project-root") {
22
+ const value = argv[i + 1];
23
+ if (value === undefined) {
24
+ return { ...parsed, error: "argument --project-root: expected one argument" };
25
+ }
26
+ parsed.projectRoot = value;
27
+ i += 1;
28
+ }
29
+ else if (arg?.startsWith("--project-root=")) {
30
+ parsed.projectRoot = arg.slice("--project-root=".length);
31
+ }
32
+ else if (arg === "--base-ref") {
33
+ const value = argv[i + 1];
34
+ if (value === undefined) {
35
+ return { ...parsed, error: "argument --base-ref: expected one argument" };
36
+ }
37
+ parsed.baseRef = value;
38
+ i += 1;
39
+ }
40
+ else if (arg?.startsWith("--base-ref=")) {
41
+ parsed.baseRef = arg.slice("--base-ref=".length);
42
+ }
43
+ else if (arg === "--path") {
44
+ const value = argv[i + 1];
45
+ if (value === undefined) {
46
+ return { ...parsed, error: "argument --path: expected one argument" };
47
+ }
48
+ parsed.paths.push(value);
49
+ i += 1;
50
+ }
51
+ else if (arg?.startsWith("--path=")) {
52
+ parsed.paths.push(arg.slice("--path=".length));
53
+ }
54
+ else {
55
+ return { ...parsed, error: `unrecognized argument: ${arg}` };
56
+ }
57
+ }
58
+ return parsed;
59
+ }
60
+ /** Run the gate and return the process exit code. */
61
+ export function run(argv) {
62
+ const args = parseArgs(argv);
63
+ if (args.error !== undefined) {
64
+ process.stderr.write(`verify_evaluator_surface: ${args.error}\n`);
65
+ return 2;
66
+ }
67
+ const result = evaluate({
68
+ projectRoot: resolve(args.projectRoot),
69
+ baseRef: args.baseRef,
70
+ staged: args.staged,
71
+ quiet: args.quiet,
72
+ paths: args.paths.length > 0 ? args.paths : undefined,
73
+ });
74
+ if (result.message.length > 0) {
75
+ if (result.stream === "stdout") {
76
+ process.stdout.write(`${result.message}\n`);
77
+ }
78
+ else if (result.stream === "stderr") {
79
+ process.stderr.write(`${result.message}\n`);
80
+ }
81
+ }
82
+ return result.code;
83
+ }
84
+ if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
85
+ process.exit(run(process.argv.slice(2)));
86
+ }
87
+ //# sourceMappingURL=verify-evaluator-surface.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deftai/directive",
3
- "version": "0.116.0",
3
+ "version": "0.118.0",
4
4
  "description": "Directive CLI — npm install path for the Deft Directive framework.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://deftai.github.io/directive/",
@@ -34,8 +34,8 @@
34
34
  "provenance": true
35
35
  },
36
36
  "dependencies": {
37
- "@deftai/directive-core": "^0.116.0",
38
- "@deftai/directive-content": "^0.116.0"
37
+ "@deftai/directive-core": "^0.118.0",
38
+ "@deftai/directive-content": "^0.118.0"
39
39
  },
40
40
  "scripts": {
41
41
  "build": "tsc -b"