@deftai/directive 0.116.0 → 0.117.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.
- package/dist/dispatch.d.ts +1 -1
- package/dist/dispatch.js +6 -0
- package/dist/hook-dispatch.js +3 -1
- package/dist/session-start.d.ts +6 -1
- package/dist/session-start.js +46 -1
- package/package.json +3 -3
package/dist/dispatch.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export interface DispatchIo {
|
|
|
12
12
|
/** CLI modules in packages/cli/src (excluding parity harnesses and bin/index). */
|
|
13
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"];
|
|
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
|
@@ -214,6 +214,7 @@ export const CORE_MODULE_VERBS = [
|
|
|
214
214
|
"freshness-report",
|
|
215
215
|
"decision-write",
|
|
216
216
|
"decision-list",
|
|
217
|
+
"docs-impact",
|
|
217
218
|
];
|
|
218
219
|
/** Colon aliases for triage-actions (mirrors cli-router SUBCOMMAND_ROUTES). */
|
|
219
220
|
export const TRIAGE_ACTION_ALIAS_SUBCOMMANDS = {
|
|
@@ -345,6 +346,7 @@ export const VERB_ALIASES = {
|
|
|
345
346
|
"verify:deposit-closure": "verify-deposit-closure",
|
|
346
347
|
"verify:consumer-hard-stops": "verify-consumer-hard-stops",
|
|
347
348
|
"verify:closing-keywords": "verify-closing-keywords",
|
|
349
|
+
"verify:docs-impact": "docs-impact",
|
|
348
350
|
"verify:skill-external-fetch-gate": "verify-skill-external-fetch-gate",
|
|
349
351
|
"verify:semantic-single-source": "verify-semantic-single-source",
|
|
350
352
|
"verify:contract-drift": "verify-contract-drift",
|
|
@@ -2568,6 +2570,10 @@ async function loadCoreModuleHandler(verb, io) {
|
|
|
2568
2570
|
const { listMainEntry } = await import("@deftai/directive-core/dist/decision/index.js");
|
|
2569
2571
|
return listMainEntry;
|
|
2570
2572
|
}
|
|
2573
|
+
case "docs-impact": {
|
|
2574
|
+
const { docsImpactMain } = await import("@deftai/directive-core/dist/docs/docs-impact.js");
|
|
2575
|
+
return (argv) => docsImpactMain(argv);
|
|
2576
|
+
}
|
|
2571
2577
|
default:
|
|
2572
2578
|
throw new Error(`unknown core verb: ${verb}`);
|
|
2573
2579
|
}
|
package/dist/hook-dispatch.js
CHANGED
|
@@ -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)
|
package/dist/session-start.d.ts
CHANGED
|
@@ -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;
|
package/dist/session-start.js
CHANGED
|
@@ -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
|
? {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deftai/directive",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.117.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.
|
|
38
|
-
"@deftai/directive-content": "^0.
|
|
37
|
+
"@deftai/directive-core": "^0.117.0",
|
|
38
|
+
"@deftai/directive-content": "^0.117.0"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "tsc -b"
|