@deftai/directive 0.88.0 → 0.90.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.
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ export declare function main(argv?: string[]): number;
3
+ export default main;
4
+ //# sourceMappingURL=authz.d.ts.map
package/dist/authz.js ADDED
@@ -0,0 +1,363 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Authz CLI (#2944 Wave 1 + #1095 Wave 4): human-origin grants + UAT lease +
4
+ * AFK closed-verb templates (mint via mintHumanOriginGrant only).
5
+ *
6
+ * deft authz:show
7
+ * deft authz:uat-start -- --campaign <id> [--actor <name>] [--note <text>]
8
+ * deft authz:uat-suspend
9
+ * deft authz:grant -- --operations edit,push --surfaces 'src/**' --cohort <id> ...
10
+ * deft authz:grant -- --template release-publish --target 0.30.0
11
+ * deft authz:grant -- --template finish-loop
12
+ * deft authz:revoke -- <grant-id>
13
+ */
14
+ import { AFK_TEMPLATE_NAMES, AUTHZ_OPERATIONS, CLOSED_VERB_TEMPLATE_NAMES, FINISH_LOOP_TEMPLATE_NAME, isAfkTemplateName, isClosedVerbTemplateName, isFinishLoopTemplateName, mintAfkTemplateGrant, mintHumanOriginGrant, revokeGrant, showAuthzSnapshot, startUatLease, suspendUatLease, } from "@deftai/directive-core/authz";
15
+ function parseOps(raw) {
16
+ const allowed = new Set(AUTHZ_OPERATIONS);
17
+ const out = [];
18
+ for (const part of raw.split(/[,\s]+/)) {
19
+ const op = part.trim().toLowerCase();
20
+ if (op.length === 0)
21
+ continue;
22
+ if (!allowed.has(op)) {
23
+ throw new Error(`unknown operation '${op}'; expected one of ${AUTHZ_OPERATIONS.join(", ")}`);
24
+ }
25
+ out.push(op);
26
+ }
27
+ return out;
28
+ }
29
+ function parseArgv(argv) {
30
+ const base = {
31
+ cmd: "show",
32
+ projectRoot: process.cwd(),
33
+ campaign: null,
34
+ actor: "operator",
35
+ note: null,
36
+ operations: [],
37
+ surfaces: [],
38
+ cohort: null,
39
+ planRef: null,
40
+ repo: null,
41
+ branch: null,
42
+ storyIds: [],
43
+ issueIds: [],
44
+ expiresAt: null,
45
+ singleUse: false,
46
+ grantId: null,
47
+ template: null,
48
+ target: null,
49
+ format: "text",
50
+ };
51
+ const args = [...argv];
52
+ // Drop leading `--` separators from task-style invocation.
53
+ while (args[0] === "--")
54
+ args.shift();
55
+ if (args.length > 0 && !args[0]?.startsWith("-")) {
56
+ const cmd = args.shift();
57
+ if (cmd === "show" ||
58
+ cmd === "uat-start" ||
59
+ cmd === "uat-suspend" ||
60
+ cmd === "grant" ||
61
+ cmd === "revoke") {
62
+ base.cmd = cmd;
63
+ }
64
+ else if (cmd.startsWith("grant-")) {
65
+ base.cmd = "revoke";
66
+ base.grantId = cmd;
67
+ }
68
+ else {
69
+ return { ...base, error: `unknown authz subcommand: ${cmd}` };
70
+ }
71
+ }
72
+ while (args[0] === "--")
73
+ args.shift();
74
+ for (let i = 0; i < args.length; i++) {
75
+ const a = args[i];
76
+ if (a === undefined)
77
+ break;
78
+ if (a === "--project-root" || a === "--projectRoot") {
79
+ base.projectRoot = args[++i] ?? base.projectRoot;
80
+ continue;
81
+ }
82
+ if (a === "--campaign") {
83
+ base.campaign = args[++i] ?? null;
84
+ continue;
85
+ }
86
+ if (a === "--actor") {
87
+ base.actor = args[++i] ?? base.actor;
88
+ continue;
89
+ }
90
+ if (a === "--note") {
91
+ base.note = args[++i] ?? null;
92
+ continue;
93
+ }
94
+ if (a === "--operations" || a === "--ops") {
95
+ try {
96
+ base.operations = parseOps(args[++i] ?? "");
97
+ }
98
+ catch (err) {
99
+ return { ...base, error: String(err) };
100
+ }
101
+ continue;
102
+ }
103
+ if (a === "--surfaces") {
104
+ const raw = args[++i] ?? "";
105
+ base.surfaces = raw
106
+ .split(/[,\s]+/)
107
+ .map((s) => s.trim())
108
+ .filter((s) => s.length > 0);
109
+ continue;
110
+ }
111
+ if (a === "--cohort") {
112
+ base.cohort = args[++i] ?? null;
113
+ continue;
114
+ }
115
+ if (a === "--plan-ref" || a === "--planRef") {
116
+ base.planRef = args[++i] ?? null;
117
+ continue;
118
+ }
119
+ if (a === "--repo") {
120
+ base.repo = args[++i] ?? null;
121
+ continue;
122
+ }
123
+ if (a === "--branch") {
124
+ base.branch = args[++i] ?? null;
125
+ continue;
126
+ }
127
+ if (a === "--stories" || a === "--story-ids") {
128
+ const raw = args[++i] ?? "";
129
+ base.storyIds = raw
130
+ .split(/[,\s]+/)
131
+ .map((s) => s.trim())
132
+ .filter((s) => s.length > 0);
133
+ continue;
134
+ }
135
+ if (a === "--issues" || a === "--issue-ids") {
136
+ const raw = args[++i] ?? "";
137
+ base.issueIds = raw
138
+ .split(/[,\s]+/)
139
+ .map((s) => Number(s.trim()))
140
+ .filter((n) => Number.isFinite(n));
141
+ continue;
142
+ }
143
+ if (a === "--expires" || a === "--expires-at") {
144
+ base.expiresAt = args[++i] ?? null;
145
+ continue;
146
+ }
147
+ if (a === "--single-use") {
148
+ base.singleUse = true;
149
+ continue;
150
+ }
151
+ if (a === "--format") {
152
+ const fmt = (args[++i] ?? "text").toLowerCase();
153
+ base.format = fmt === "json" ? "json" : "text";
154
+ continue;
155
+ }
156
+ if (a === "--grant-id") {
157
+ base.grantId = args[++i] ?? null;
158
+ continue;
159
+ }
160
+ if (a === "--template") {
161
+ base.template = args[++i] ?? null;
162
+ continue;
163
+ }
164
+ if (a === "--target") {
165
+ base.target = args[++i] ?? null;
166
+ continue;
167
+ }
168
+ if (!a.startsWith("-") && base.cmd === "revoke" && base.grantId === null) {
169
+ base.grantId = a;
170
+ continue;
171
+ }
172
+ if (a === "--help" || a === "-h") {
173
+ return { ...base, error: "help" };
174
+ }
175
+ }
176
+ return base;
177
+ }
178
+ function helpText() {
179
+ return [
180
+ "Usage:",
181
+ " deft authz:show [--format json]",
182
+ " deft authz:uat-start -- --campaign <id> [--actor <name>] [--note <text>]",
183
+ " deft authz:uat-suspend",
184
+ " deft authz:grant -- --operations edit,push --surfaces 'src/**' --cohort <id> \\",
185
+ " [--stories 2944] [--plan-ref <id>] [--repo owner/name] [--branch <b>] [--expires ISO]",
186
+ " deft authz:grant -- --template release-publish --target 0.30.0 [--actor <name>] [--expires ISO]",
187
+ " deft authz:grant -- --template finish-loop [--actor <name>] [--expires ISO]",
188
+ " deft authz:revoke -- <grant-id>",
189
+ "",
190
+ "Human-origin grants are minted only via this CLI (origin.kind=operator-cli).",
191
+ "Self-authored xBRIEF/lifecycle/dispatch tokens never satisfy implement gates (#2944).",
192
+ "",
193
+ `AFK templates (#1095 / #871): ${AFK_TEMPLATE_NAMES.join(", ")}`,
194
+ ` Closed-verb (#1095): ${CLOSED_VERB_TEMPLATE_NAMES.join(", ")} — require --target`,
195
+ ` Finish-loop (#871): ${FINISH_LOOP_TEMPLATE_NAME} — edit/push/pr/merge (no release ops)`,
196
+ " Templates call mintHumanOriginGrant only — no second session-auth mint engine.",
197
+ " Env bypass for a single shell: DEFT_ALLOW_RELEASE_PUBLISH=1 / DEFT_ALLOW_FINISH_LOOP=1.",
198
+ ].join("\n");
199
+ }
200
+ export function main(argv = process.argv.slice(2)) {
201
+ const args = parseArgv(argv);
202
+ if (args.error === "help") {
203
+ process.stdout.write(`${helpText()}\n`);
204
+ return 0;
205
+ }
206
+ if (args.error !== undefined) {
207
+ process.stderr.write(`authz: ${args.error}\n`);
208
+ process.stderr.write(`${helpText()}\n`);
209
+ return 2;
210
+ }
211
+ try {
212
+ switch (args.cmd) {
213
+ case "show": {
214
+ const snap = showAuthzSnapshot(args.projectRoot);
215
+ if (args.format === "json") {
216
+ process.stdout.write(`${JSON.stringify(snap, null, 2)}\n`);
217
+ return 0;
218
+ }
219
+ const uat = snap.state.uat;
220
+ if (uat === null) {
221
+ process.stdout.write("UAT lease: inactive\n");
222
+ }
223
+ else {
224
+ process.stdout.write(`UAT lease: ${uat.active ? "ACTIVE" : "suspended"} campaign=${uat.campaignId}\n`);
225
+ process.stdout.write(` started=${uat.startedAt} by=${uat.startedBy.actor} (${uat.startedBy.kind})\n`);
226
+ if (uat.suspendedAt)
227
+ process.stdout.write(` suspended=${uat.suspendedAt}\n`);
228
+ }
229
+ process.stdout.write(`Active human-origin grants: ${snap.activeGrants.length}\n`);
230
+ for (const g of snap.activeGrants) {
231
+ process.stdout.write(` - ${g.id} ops=[${g.scope.operations.join(",")}] ` +
232
+ `cohort=${g.scope.cohortId ?? "-"} surfaces=${g.scope.surfaces.join("|") || "*"}\n`);
233
+ }
234
+ const rejected = snap.allGrants.length - snap.activeGrants.length;
235
+ if (rejected > 0) {
236
+ process.stdout.write(`(${rejected} grant file(s) present but not active/human-origin)\n`);
237
+ }
238
+ return 0;
239
+ }
240
+ case "uat-start": {
241
+ if (args.campaign === null || args.campaign.trim().length === 0) {
242
+ process.stderr.write("authz:uat-start requires --campaign <id>\n");
243
+ return 2;
244
+ }
245
+ const { lease } = startUatLease({
246
+ projectRoot: args.projectRoot,
247
+ campaignId: args.campaign,
248
+ actor: args.actor,
249
+ note: args.note,
250
+ });
251
+ process.stdout.write(`✓ UAT lease ACTIVE campaign=${lease.campaignId} (human-origin operator-cli)\n`);
252
+ process.stdout.write(" Product edit/push/PR/merge denied until a named fix cohort grant is minted.\n");
253
+ process.stdout.write(" Tests, evidence capture, and issue filing remain allowed.\n");
254
+ return 0;
255
+ }
256
+ case "uat-suspend": {
257
+ const state = suspendUatLease({
258
+ projectRoot: args.projectRoot,
259
+ actor: args.actor,
260
+ });
261
+ if (state.uat === null) {
262
+ process.stdout.write("UAT lease was already inactive.\n");
263
+ }
264
+ else {
265
+ process.stdout.write(`✓ UAT lease suspended campaign=${state.uat.campaignId} at ${state.uat.suspendedAt}\n`);
266
+ }
267
+ return 0;
268
+ }
269
+ case "grant": {
270
+ // AFK template path (#1095 / #871): presets only — still mintHumanOriginGrant.
271
+ if (args.template !== null && args.template.trim().length > 0) {
272
+ if (!isAfkTemplateName(args.template)) {
273
+ process.stderr.write(`authz:grant unknown --template '${args.template}'; expected one of: ${AFK_TEMPLATE_NAMES.join(", ")}\n`);
274
+ return 2;
275
+ }
276
+ if (isClosedVerbTemplateName(args.template) &&
277
+ (args.target === null || args.target.trim().length === 0)) {
278
+ process.stderr.write(`authz:grant --template ${args.template} requires --target <version>\n`);
279
+ return 2;
280
+ }
281
+ const grant = mintAfkTemplateGrant({
282
+ projectRoot: args.projectRoot,
283
+ template: args.template,
284
+ target: args.target,
285
+ actor: args.actor,
286
+ expiresAt: args.expiresAt,
287
+ singleUse: args.singleUse,
288
+ planRef: args.planRef,
289
+ repo: args.repo,
290
+ branch: args.branch,
291
+ surfaces: args.surfaces,
292
+ storyIds: args.storyIds,
293
+ issueIds: args.issueIds,
294
+ cohortId: args.cohort,
295
+ });
296
+ process.stdout.write(`✓ human-origin grant minted id=${grant.id} origin=${grant.origin.kind} ` +
297
+ `template=${args.template}\n`);
298
+ if (isFinishLoopTemplateName(args.template)) {
299
+ process.stdout.write(` ops=[${grant.scope.operations.join(",")}] ` +
300
+ `(finish-loop walk-away; release-* NOT authorized)\n`);
301
+ }
302
+ else {
303
+ process.stdout.write(` ops=[${grant.scope.operations.join(",")}] target surfaces=${grant.scope.surfaces.join(", ")}\n`);
304
+ }
305
+ process.stdout.write(" Authorization SoT: Wave 1 grant store (.deft/authz/grants) — not session-auth.\n");
306
+ return 0;
307
+ }
308
+ if (args.operations.length === 0) {
309
+ process.stderr.write("authz:grant requires --operations <edit,push,...> or --template <finish-loop|release-*> \n");
310
+ return 2;
311
+ }
312
+ const grant = mintHumanOriginGrant({
313
+ projectRoot: args.projectRoot,
314
+ actor: args.actor,
315
+ operations: args.operations,
316
+ surfaces: args.surfaces,
317
+ cohortId: args.cohort,
318
+ planRef: args.planRef,
319
+ repo: args.repo,
320
+ branch: args.branch,
321
+ storyIds: args.storyIds,
322
+ issueIds: args.issueIds,
323
+ expiresAt: args.expiresAt,
324
+ singleUse: args.singleUse,
325
+ });
326
+ process.stdout.write(`✓ human-origin grant minted id=${grant.id} origin=${grant.origin.kind}\n`);
327
+ process.stdout.write(` ops=[${grant.scope.operations.join(",")}] cohort=${grant.scope.cohortId ?? "-"}\n`);
328
+ if (grant.scope.surfaces.length > 0) {
329
+ process.stdout.write(` surfaces=${grant.scope.surfaces.join(", ")}\n`);
330
+ }
331
+ return 0;
332
+ }
333
+ case "revoke": {
334
+ if (args.grantId === null) {
335
+ process.stderr.write("authz:revoke requires <grant-id>\n");
336
+ return 2;
337
+ }
338
+ const revoked = revokeGrant({
339
+ projectRoot: args.projectRoot,
340
+ grantId: args.grantId,
341
+ });
342
+ if (revoked === null) {
343
+ process.stderr.write(`authz: grant not found: ${args.grantId}\n`);
344
+ return 1;
345
+ }
346
+ process.stdout.write(`✓ grant revoked id=${revoked.id} at ${revoked.semantics.revokedAt}\n`);
347
+ return 0;
348
+ }
349
+ default:
350
+ process.stderr.write(`${helpText()}\n`);
351
+ return 2;
352
+ }
353
+ }
354
+ catch (err) {
355
+ process.stderr.write(`authz: ${String(err)}\n`);
356
+ return 1;
357
+ }
358
+ }
359
+ export default main;
360
+ if (import.meta.url === `file://${process.argv[1]?.replace(/\\/g, "/")}`) {
361
+ process.exitCode = main();
362
+ }
363
+ //# sourceMappingURL=authz.js.map
@@ -36,6 +36,7 @@ export const PR_VERB_MAP = {
36
36
  "check-closing-keywords": "pr-closing-keywords",
37
37
  "wait-mergeable-and-merge": "pr-wait-mergeable",
38
38
  watch: "pr-watch",
39
+ "finish-loop": "pr-finish-loop",
39
40
  };
40
41
  /** verify:* aliases that map to non-verify-* handler stems. */
41
42
  export const VERIFY_VERB_MAP = {
@@ -74,8 +75,18 @@ export const SUBCOMMAND_ROUTES = {
74
75
  "policy:enable-directive": ["policy", "enable-directive"],
75
76
  "policy:enforce-branches": ["policy", "enforce-branches"],
76
77
  "policy:allow-direct-commits": ["policy", "allow-direct-commits"],
78
+ "policy:allow-bot-merge": ["policy", "allow-bot-merge"],
77
79
  "policy:enable-value-feedback": ["policy", "enable-value-feedback"],
78
80
  "policy:clear-value-feedback": ["policy", "clear-value-feedback"],
81
+ "authz:show": ["authz", "show"],
82
+ "authz:uat-start": ["authz", "uat-start"],
83
+ "authz:uat-suspend": ["authz", "uat-suspend"],
84
+ "authz:grant": ["authz", "grant"],
85
+ "authz:revoke": ["authz", "revoke"],
86
+ "escalation:file": ["escalation-cli", "file"],
87
+ "escalation:list": ["escalation-cli", "list"],
88
+ "escalation:resolve": ["escalation-cli", "resolve"],
89
+ "escalation:batch-approve": ["escalation-cli", "batch-approve"],
79
90
  "product-signal:status": ["product-signal", "status"],
80
91
  "product-signal:enable": ["product-signal", "enable"],
81
92
  "product-signal:consent": ["product-signal", "consent"],
@@ -89,9 +100,11 @@ export const SUBCOMMAND_ROUTES = {
89
100
  "github-body:issue-create": ["github-body", "issue-create"],
90
101
  "github-body:issue-edit": ["github-body", "issue-edit"],
91
102
  "github-body:issue-fetch": ["github-body", "issue-fetch"],
103
+ "github-body:issue-lint": ["github-body", "issue-lint"],
92
104
  "github-body:comment-create": ["github-body", "comment-create"],
93
105
  "github-body:comment-edit": ["github-body", "comment-edit"],
94
106
  "github-body:pr-edit": ["github-body", "pr-edit"],
107
+ "github-body:pr-lint": ["github-body", "pr-lint"],
95
108
  "plan-sequence:set": ["plan-sequence", "set"],
96
109
  "plan-sequence:current": ["plan-sequence", "current"],
97
110
  "plan-sequence:clear": ["plan-sequence", "clear"],
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export declare function run(argv: string[]): number;
3
+ //# sourceMappingURL=directive-finish-loop.d.ts.map
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+ import { fileURLToPath } from "node:url";
3
+ import { cmdDirectiveFinishLoop } from "@deftai/directive-core/dist/finish-loop/main.js";
4
+ export function run(argv) {
5
+ return cmdDirectiveFinishLoop(argv);
6
+ }
7
+ if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
8
+ process.exit(run(process.argv.slice(2)));
9
+ }
10
+ //# sourceMappingURL=directive-finish-loop.js.map
@@ -10,13 +10,17 @@ 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", "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", "lifecycle-event", "session-start", "plan-sequence", "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-skill-external-fetch-gate", "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", "rule-ownership-lint", "verify-story-ready", "verify-review-monitor", "verify-subagent-alive", "review-monitor-register", "review-monitor-release", "verify-tools", "verify-wip-cap", "verify-orphan-active", "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", "lifecycle-event", "lifecycle-stats", "session-start", "session-ready", "plan-sequence", "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-contained-writes", "verify-content-manifest", "verify-skill-external-fetch-gate", "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", "rule-ownership-lint", "verify-story-ready", "verify-review-monitor", "verify-subagent-alive", "review-monitor-register", "review-monitor-release", "verify-tools", "verify-wip-cap", "verify-orphan-active", "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", "github-auth-modes", "github-body", "issue-emit", "issue-ingest", "issue-sync-from-xbrief", "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", "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"];
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). */
19
19
  export declare const POLICY_ACTION_ALIAS_SUBCOMMANDS: Readonly<Record<string, string>>;
20
+ /** Colon aliases for authz subcommands (#2944). */
21
+ export declare const AUTHZ_ACTION_ALIAS_SUBCOMMANDS: Readonly<Record<string, string>>;
22
+ /** Colon aliases for escalation subcommands (#518). */
23
+ export declare const ESCALATION_ACTION_ALIAS_SUBCOMMANDS: Readonly<Record<string, string>>;
20
24
  /** Colon aliases for plan-sequence subcommands (#2402). */
21
25
  export declare const PLAN_SEQUENCE_ALIAS_SUBCOMMANDS: Readonly<Record<string, string>>;
22
26
  /** Colon aliases for product-signal subcommands (#2693). */
package/dist/dispatch.js CHANGED
@@ -50,12 +50,16 @@ export const CLI_MODULE_VERBS = [
50
50
  "commit-lint",
51
51
  "coverage-hotspots",
52
52
  "policy",
53
+ "authz",
54
+ "escalation-cli",
53
55
  "pr-closing-keywords",
54
56
  "pr-merge-readiness",
55
57
  "pr-monitor",
56
58
  "pr-protected-issues",
57
59
  "pr-wait-mergeable",
58
60
  "pr-watch",
61
+ "pr-finish-loop",
62
+ "directive-finish-loop",
59
63
  "preflight-cache",
60
64
  "preflight-gh",
61
65
  "probe-session",
@@ -65,7 +69,9 @@ export const CLI_MODULE_VERBS = [
65
69
  "release-rollback",
66
70
  "scope-lifecycle",
67
71
  "lifecycle-event",
72
+ "lifecycle-stats",
68
73
  "session-start",
74
+ "session-ready",
69
75
  "plan-sequence",
70
76
  "slice",
71
77
  "subagent-monitor",
@@ -103,6 +109,7 @@ export const CLI_MODULE_VERBS = [
103
109
  "verify-biome-config",
104
110
  "verify-bridge-drift",
105
111
  "verify-capacity",
112
+ "verify-contained-writes",
106
113
  "verify-content-manifest",
107
114
  "verify-skill-external-fetch-gate",
108
115
  "verify-contract-drift",
@@ -193,12 +200,30 @@ export const POLICY_ACTION_ALIAS_SUBCOMMANDS = {
193
200
  "policy:show": "show",
194
201
  "policy:enforce-branches": "enforce-branches",
195
202
  "policy:allow-direct-commits": "allow-direct-commits",
203
+ "policy:allow-bot-merge": "allow-bot-merge",
196
204
  "policy:enable-value-feedback": "enable-value-feedback",
197
205
  "policy:clear-value-feedback": "clear-value-feedback",
198
206
  "policy:disable-directive": "disable-directive",
199
207
  "policy:enable-directive": "enable-directive",
200
208
  };
201
209
  const POLICY_ACTION_COLON_ALIASES = Object.fromEntries(Object.keys(POLICY_ACTION_ALIAS_SUBCOMMANDS).map((alias) => [alias, "policy"]));
210
+ /** Colon aliases for authz subcommands (#2944). */
211
+ export const AUTHZ_ACTION_ALIAS_SUBCOMMANDS = {
212
+ "authz:show": "show",
213
+ "authz:uat-start": "uat-start",
214
+ "authz:uat-suspend": "uat-suspend",
215
+ "authz:grant": "grant",
216
+ "authz:revoke": "revoke",
217
+ };
218
+ const AUTHZ_ACTION_COLON_ALIASES = Object.fromEntries(Object.keys(AUTHZ_ACTION_ALIAS_SUBCOMMANDS).map((alias) => [alias, "authz"]));
219
+ /** Colon aliases for escalation subcommands (#518). */
220
+ export const ESCALATION_ACTION_ALIAS_SUBCOMMANDS = {
221
+ "escalation:file": "file",
222
+ "escalation:list": "list",
223
+ "escalation:resolve": "resolve",
224
+ "escalation:batch-approve": "batch-approve",
225
+ };
226
+ const ESCALATION_ACTION_COLON_ALIASES = Object.fromEntries(Object.keys(ESCALATION_ACTION_ALIAS_SUBCOMMANDS).map((alias) => [alias, "escalation-cli"]));
202
227
  /** Colon aliases for plan-sequence subcommands (#2402). */
203
228
  export const PLAN_SEQUENCE_ALIAS_SUBCOMMANDS = {
204
229
  "plan-sequence:set": "set",
@@ -251,6 +276,7 @@ export const VERB_ALIASES = {
251
276
  "verify:rule-ownership": "rule-ownership-lint",
252
277
  "rule:ownership-lint": "rule-ownership-lint",
253
278
  "verify:biome-config": "verify-biome-config",
279
+ "verify:contained-writes": "verify-contained-writes",
254
280
  "verify:content-manifest": "verify-content-manifest",
255
281
  "verify:skill-external-fetch-gate": "verify-skill-external-fetch-gate",
256
282
  "verify:contract-drift": "verify-contract-drift",
@@ -275,6 +301,8 @@ export const VERB_ALIASES = {
275
301
  "triage:scope": "triage-scope",
276
302
  ...TRIAGE_ACTION_COLON_ALIASES,
277
303
  ...POLICY_ACTION_COLON_ALIASES,
304
+ ...AUTHZ_ACTION_COLON_ALIASES,
305
+ ...ESCALATION_ACTION_COLON_ALIASES,
278
306
  ...PRODUCT_SIGNAL_COLON_ALIASES,
279
307
  "agents:refresh": "agents-refresh",
280
308
  "migrate:preflight": "migrate-preflight",
@@ -285,7 +313,9 @@ export const VERB_ALIASES = {
285
313
  "issue:sync-from-xbrief": "issue-sync-from-xbrief",
286
314
  upgrade: "install-upgrade",
287
315
  "session:start": "session-start",
316
+ "session:ready": "session-ready",
288
317
  "lifecycle:event": "lifecycle-event",
318
+ "lifecycle:stats": "lifecycle-stats",
289
319
  "toolchain:check": "toolchain-check",
290
320
  "ts:check-lane": "ts-check-lane",
291
321
  "spec:validate": "spec-validate",
@@ -295,6 +325,8 @@ export const VERB_ALIASES = {
295
325
  "docs:rule-map": "rule-map",
296
326
  "project:export-spec": "export-spec",
297
327
  "pr:watch": "pr-watch",
328
+ "pr:finish-loop": "pr-finish-loop",
329
+ "directive:finish-loop": "directive-finish-loop",
298
330
  doctor: "doctor",
299
331
  "eval:health": "eval-health",
300
332
  "feedback:file": "feedback-file",
@@ -311,6 +343,7 @@ const SUBDIR_CLI_STEMS = {
311
343
  "verify-stubs": "verify-source-cli/verify-stubs",
312
344
  "rule-ownership-lint": "verify-source-cli/rule-ownership-lint",
313
345
  "verify-biome-config": "verify-source-cli/verify-biome-config",
346
+ "verify-contained-writes": "verify-source-cli/verify-contained-writes",
314
347
  "verify-content-manifest": "verify-source-cli/verify-content-manifest",
315
348
  "verify-skill-external-fetch-gate": "verify-source-cli/verify-skill-external-fetch-gate",
316
349
  "verify-contract-drift": "verify-source-cli/verify-contract-drift",
@@ -2487,10 +2520,18 @@ const CURATED_HELP_GROUPS = [
2487
2520
  title: "Session & ritual",
2488
2521
  commands: [
2489
2522
  { name: "session:start", summary: "Record session-start ritual state" },
2523
+ {
2524
+ name: "session:ready",
2525
+ summary: "One-shot recovery to gated write-ready (session + ritual + cache)",
2526
+ },
2490
2527
  {
2491
2528
  name: "lifecycle:event",
2492
2529
  summary: "Record review-cycle plan:approved approval events",
2493
2530
  },
2531
+ {
2532
+ name: "lifecycle:stats",
2533
+ summary: "Local xBRIEF lifecycle folder counts for process rollups",
2534
+ },
2494
2535
  ],
2495
2536
  },
2496
2537
  {
@@ -2598,6 +2639,8 @@ export async function dispatch(argv, io = defaultIo()) {
2598
2639
  const handler = await loadHandler(canonical, io);
2599
2640
  const triageSubcommand = verb !== undefined ? TRIAGE_ACTION_ALIAS_SUBCOMMANDS[verb] : undefined;
2600
2641
  const policySubcommand = verb !== undefined ? POLICY_ACTION_ALIAS_SUBCOMMANDS[verb] : undefined;
2642
+ const authzSubcommand = verb !== undefined ? AUTHZ_ACTION_ALIAS_SUBCOMMANDS[verb] : undefined;
2643
+ const escalationSubcommand = verb !== undefined ? ESCALATION_ACTION_ALIAS_SUBCOMMANDS[verb] : undefined;
2601
2644
  const planSequenceSubcommand = verb !== undefined ? PLAN_SEQUENCE_ALIAS_SUBCOMMANDS[verb] : undefined;
2602
2645
  const productSignalSubcommand = verb !== undefined ? PRODUCT_SIGNAL_ALIAS_SUBCOMMANDS[verb] : undefined;
2603
2646
  const handlerArgv = canonical === "framework-commands" && verb !== undefined && verb !== canonical
@@ -2606,11 +2649,15 @@ export async function dispatch(argv, io = defaultIo()) {
2606
2649
  ? [triageSubcommand, ...rest]
2607
2650
  : policySubcommand !== undefined && canonical === "policy"
2608
2651
  ? [policySubcommand, ...rest]
2609
- : planSequenceSubcommand !== undefined && canonical === "plan-sequence"
2610
- ? [planSequenceSubcommand, ...rest]
2611
- : productSignalSubcommand !== undefined && canonical === "product-signal"
2612
- ? [productSignalSubcommand, ...rest]
2613
- : rest;
2652
+ : authzSubcommand !== undefined && canonical === "authz"
2653
+ ? [authzSubcommand, ...rest]
2654
+ : escalationSubcommand !== undefined && canonical === "escalation-cli"
2655
+ ? [escalationSubcommand, ...rest]
2656
+ : planSequenceSubcommand !== undefined && canonical === "plan-sequence"
2657
+ ? [planSequenceSubcommand, ...rest]
2658
+ : productSignalSubcommand !== undefined && canonical === "product-signal"
2659
+ ? [productSignalSubcommand, ...rest]
2660
+ : rest;
2614
2661
  return await invokeHandler(handler, handlerArgv);
2615
2662
  }
2616
2663
  catch (err) {
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ export declare function main(argv?: string[]): number;
3
+ export default main;
4
+ //# sourceMappingURL=escalation-cli.d.ts.map