@deftai/directive 0.113.2 → 0.115.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 +2 -0
- package/dist/verify-subagent-steer.d.ts +19 -0
- package/dist/verify-subagent-steer.js +136 -0
- package/package.json +3 -3
package/dist/dispatch.d.ts
CHANGED
|
@@ -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", "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", "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", "eval-health", "eval-run", "eval-report", "eval-triggers"];
|
|
14
14
|
/** Core-only CLI entrypoints without a packages/cli wrapper. */
|
|
15
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"];
|
|
16
16
|
/** Colon aliases for triage-actions (mirrors cli-router SUBCOMMAND_ROUTES). */
|
package/dist/dispatch.js
CHANGED
|
@@ -145,6 +145,7 @@ export const CLI_MODULE_VERBS = [
|
|
|
145
145
|
"verify-review-monitor",
|
|
146
146
|
"verify-l4-owner",
|
|
147
147
|
"verify-subagent-alive",
|
|
148
|
+
"verify-subagent-steer",
|
|
148
149
|
"review-monitor-register",
|
|
149
150
|
"review-monitor-release",
|
|
150
151
|
"verify-tools",
|
|
@@ -325,6 +326,7 @@ export const VERB_ALIASES = {
|
|
|
325
326
|
"verify:review-monitor": "verify-review-monitor",
|
|
326
327
|
"verify:l4-owner": "verify-l4-owner",
|
|
327
328
|
"verify:subagent-alive": "verify-subagent-alive",
|
|
329
|
+
"verify:subagent-steer": "verify-subagent-steer",
|
|
328
330
|
"agent:monitor": "subagent-monitor",
|
|
329
331
|
"review-monitor:register": "review-monitor-register",
|
|
330
332
|
"review-monitor:release": "review-monitor-release",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export declare const SUBAGENT_STEER_HELP = "verify:subagent-steer \u2014 parent-visible unread steer flag (#4286)\n\nUsage:\n task verify:subagent-steer -- [options]\n\nOptions:\n --steer-dir PATH Inbox directory (default: .deft-scratch/subagent-steer)\n --agent ID Agent whose inbox to inspect (repeatable; default: all)\n --json Machine-readable output\n\nExit codes:\n 0 No unread unexpired steer\n 1 STEER_PENDING \u2014 unread inbox; not REDISPATCH_OK / takeover\n 2 Config error (invalid args, steer path is not a directory)\n";
|
|
3
|
+
export interface VerifySubagentSteerArgs {
|
|
4
|
+
steerDir: string | null;
|
|
5
|
+
agentIds: string[];
|
|
6
|
+
emitJson: boolean;
|
|
7
|
+
help: boolean;
|
|
8
|
+
error?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function parseVerifySubagentSteerArgs(argv: readonly string[]): VerifySubagentSteerArgs;
|
|
11
|
+
export interface SubagentSteerVerdict {
|
|
12
|
+
exitCode: number;
|
|
13
|
+
redispatchOk: false;
|
|
14
|
+
message: string;
|
|
15
|
+
json?: Record<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
export declare function evaluateSubagentSteerGate(args: VerifySubagentSteerArgs, cwd?: string): SubagentSteerVerdict;
|
|
18
|
+
export declare function run(argv: readonly string[]): number;
|
|
19
|
+
//# sourceMappingURL=verify-subagent-steer.d.ts.map
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Parent-visible unread steer flag (#4286). Exit 1 is STEER_PENDING.
|
|
4
|
+
* Never prints REDISPATCH_OK — unread steer is not missing heartbeat.
|
|
5
|
+
*/
|
|
6
|
+
import { resolve } from "node:path";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
8
|
+
import { defaultSteerDir, EXIT_STEER_CONFIG, EXIT_STEER_OK, EXIT_STEER_PENDING, renderSteerPendingText, steerPendingConfigError, sweepSteerPending, } from "@deftai/directive-core/orchestration";
|
|
9
|
+
export const SUBAGENT_STEER_HELP = `verify:subagent-steer — parent-visible unread steer flag (#4286)
|
|
10
|
+
|
|
11
|
+
Usage:
|
|
12
|
+
task verify:subagent-steer -- [options]
|
|
13
|
+
|
|
14
|
+
Options:
|
|
15
|
+
--steer-dir PATH Inbox directory (default: .deft-scratch/subagent-steer)
|
|
16
|
+
--agent ID Agent whose inbox to inspect (repeatable; default: all)
|
|
17
|
+
--json Machine-readable output
|
|
18
|
+
|
|
19
|
+
Exit codes:
|
|
20
|
+
0 No unread unexpired steer
|
|
21
|
+
1 STEER_PENDING — unread inbox; not REDISPATCH_OK / takeover
|
|
22
|
+
2 Config error (invalid args, steer path is not a directory)
|
|
23
|
+
`;
|
|
24
|
+
export function parseVerifySubagentSteerArgs(argv) {
|
|
25
|
+
const acc = {
|
|
26
|
+
steerDir: null,
|
|
27
|
+
agentIds: [],
|
|
28
|
+
emitJson: false,
|
|
29
|
+
help: false,
|
|
30
|
+
};
|
|
31
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
32
|
+
const arg = argv[i];
|
|
33
|
+
if (arg === "--help" || arg === "-h") {
|
|
34
|
+
return { ...acc, help: true };
|
|
35
|
+
}
|
|
36
|
+
if (arg === "--json") {
|
|
37
|
+
acc.emitJson = true;
|
|
38
|
+
}
|
|
39
|
+
else if (arg === "--steer-dir") {
|
|
40
|
+
const value = argv[i + 1];
|
|
41
|
+
if (value === undefined) {
|
|
42
|
+
return { ...acc, error: "argument --steer-dir: expected one argument" };
|
|
43
|
+
}
|
|
44
|
+
acc.steerDir = value;
|
|
45
|
+
i += 1;
|
|
46
|
+
}
|
|
47
|
+
else if (arg?.startsWith("--steer-dir=")) {
|
|
48
|
+
acc.steerDir = arg.slice("--steer-dir=".length);
|
|
49
|
+
}
|
|
50
|
+
else if (arg === "--agent") {
|
|
51
|
+
const value = argv[i + 1];
|
|
52
|
+
if (value === undefined) {
|
|
53
|
+
return { ...acc, error: "argument --agent: expected one argument" };
|
|
54
|
+
}
|
|
55
|
+
acc.agentIds.push(value);
|
|
56
|
+
i += 1;
|
|
57
|
+
}
|
|
58
|
+
else if (arg?.startsWith("--agent=")) {
|
|
59
|
+
acc.agentIds.push(arg.slice("--agent=".length));
|
|
60
|
+
}
|
|
61
|
+
else if (arg?.startsWith("-")) {
|
|
62
|
+
return { ...acc, error: `unrecognized argument: ${arg}` };
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
return { ...acc, error: `unrecognized argument: ${arg}` };
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return acc;
|
|
69
|
+
}
|
|
70
|
+
export function evaluateSubagentSteerGate(args, cwd = process.cwd()) {
|
|
71
|
+
if (args.error !== undefined) {
|
|
72
|
+
return {
|
|
73
|
+
exitCode: EXIT_STEER_CONFIG,
|
|
74
|
+
redispatchOk: false,
|
|
75
|
+
message: `verify_subagent_steer: ${args.error}`,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
const steerDir = resolve(cwd, args.steerDir ?? defaultSteerDir(cwd));
|
|
79
|
+
const sweep = sweepSteerPending(steerDir, {
|
|
80
|
+
agentIds: args.agentIds.length > 0 ? args.agentIds : undefined,
|
|
81
|
+
});
|
|
82
|
+
const configError = steerPendingConfigError(sweep);
|
|
83
|
+
const pending = sweep.pending.length > 0 || sweep.parse_failures.length > 0;
|
|
84
|
+
if (args.emitJson) {
|
|
85
|
+
return {
|
|
86
|
+
exitCode: configError ? EXIT_STEER_CONFIG : pending ? EXIT_STEER_PENDING : EXIT_STEER_OK,
|
|
87
|
+
redispatchOk: false,
|
|
88
|
+
message: "",
|
|
89
|
+
json: {
|
|
90
|
+
all_ok: !pending && !configError,
|
|
91
|
+
steer_pending: pending,
|
|
92
|
+
redispatch_ok: false,
|
|
93
|
+
pending_agents: sweep.pending.map((p) => p.agent_id),
|
|
94
|
+
pending: sweep.pending,
|
|
95
|
+
parse_failures: sweep.parse_failures,
|
|
96
|
+
sweep_errors: sweep.sweep_errors,
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
if (configError) {
|
|
101
|
+
return {
|
|
102
|
+
exitCode: EXIT_STEER_CONFIG,
|
|
103
|
+
redispatchOk: false,
|
|
104
|
+
message: renderSteerPendingText(sweep),
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
exitCode: pending ? EXIT_STEER_PENDING : EXIT_STEER_OK,
|
|
109
|
+
redispatchOk: false,
|
|
110
|
+
message: renderSteerPendingText(sweep),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
export function run(argv) {
|
|
114
|
+
const args = parseVerifySubagentSteerArgs(argv);
|
|
115
|
+
if (args.help) {
|
|
116
|
+
process.stdout.write(SUBAGENT_STEER_HELP);
|
|
117
|
+
return EXIT_STEER_OK;
|
|
118
|
+
}
|
|
119
|
+
const verdict = evaluateSubagentSteerGate(args);
|
|
120
|
+
if (args.emitJson && verdict.json !== undefined) {
|
|
121
|
+
process.stdout.write(`${JSON.stringify(verdict.json, null, 2)}\n`);
|
|
122
|
+
}
|
|
123
|
+
else if (verdict.message.length > 0) {
|
|
124
|
+
if (verdict.exitCode === EXIT_STEER_OK) {
|
|
125
|
+
process.stdout.write(`${verdict.message}\n`);
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
process.stderr.write(`${verdict.message}\n`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return verdict.exitCode;
|
|
132
|
+
}
|
|
133
|
+
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
134
|
+
process.exit(run(process.argv.slice(2)));
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=verify-subagent-steer.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deftai/directive",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.115.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.115.0",
|
|
38
|
+
"@deftai/directive-content": "^0.115.0"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "tsc -b"
|