@deftai/directive 0.73.0 → 0.73.1
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 +2 -0
- package/dist/dispatch.js +24 -10
- package/dist/policy.js +9 -7
- package/package.json +3 -3
package/dist/dispatch.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ export declare const CLI_MODULE_VERBS: readonly ["agents-refresh", "cache", "che
|
|
|
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). */
|
|
17
17
|
export declare const TRIAGE_ACTION_ALIAS_SUBCOMMANDS: Readonly<Record<string, string>>;
|
|
18
|
+
/** Colon aliases for policy subcommands (mirrors cli-router SUBCOMMAND_ROUTES). */
|
|
19
|
+
export declare const POLICY_ACTION_ALIAS_SUBCOMMANDS: Readonly<Record<string, string>>;
|
|
18
20
|
/** Task-style aliases (framework_commands / Taskfile names). */
|
|
19
21
|
export declare const VERB_ALIASES: Readonly<Record<string, string>>;
|
|
20
22
|
/** Pinned ghx version (display only) — keep in lockstep with .github/workflows/ci.yml env.GHX_VERSION. */
|
package/dist/dispatch.js
CHANGED
|
@@ -9,7 +9,7 @@ import { homedir, tmpdir } from "node:os";
|
|
|
9
9
|
import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
10
10
|
import { engineInfo, userConfig } from "@deftai/directive-core";
|
|
11
11
|
import { parseInitArgv, runInitDepositCli } from "@deftai/directive-core/init-deposit";
|
|
12
|
-
import { appendAuditLog, disclosureLine, migrateLegacyPolicyKey, PLAN_POLICY_KEY, projectDefinitionPath, resolvePolicy, resolveWipCap, setPolicy, } from "@deftai/directive-core/policy";
|
|
12
|
+
import { appendAuditLog, disclosureLine, migrateLegacyPolicyKey, PLAN_POLICY_KEY, policyColonInvocation, policySetInvocation, projectDefinitionPath, resolvePolicy, resolveWipCap, setPolicy, } from "@deftai/directive-core/policy";
|
|
13
13
|
import { defaultWhich } from "@deftai/directive-core/scm";
|
|
14
14
|
import { KNOWN_SUBAGENT_BACKEND_IDS, probeSubagentBackends, resolveSwarmSubagentBackend, } from "@deftai/directive-core/swarm";
|
|
15
15
|
const HANDLER_KEYS = [
|
|
@@ -168,6 +168,14 @@ export const TRIAGE_ACTION_ALIAS_SUBCOMMANDS = {
|
|
|
168
168
|
"triage:history": "history",
|
|
169
169
|
};
|
|
170
170
|
const TRIAGE_ACTION_COLON_ALIASES = Object.fromEntries(Object.keys(TRIAGE_ACTION_ALIAS_SUBCOMMANDS).map((alias) => [alias, "triage-actions"]));
|
|
171
|
+
/** Colon aliases for policy subcommands (mirrors cli-router SUBCOMMAND_ROUTES). */
|
|
172
|
+
export const POLICY_ACTION_ALIAS_SUBCOMMANDS = {
|
|
173
|
+
"policy:show": "show",
|
|
174
|
+
"policy:enforce-branches": "enforce-branches",
|
|
175
|
+
"policy:allow-direct-commits": "allow-direct-commits",
|
|
176
|
+
"policy:enable-value-feedback": "enable-value-feedback",
|
|
177
|
+
};
|
|
178
|
+
const POLICY_ACTION_COLON_ALIASES = Object.fromEntries(Object.keys(POLICY_ACTION_ALIAS_SUBCOMMANDS).map((alias) => [alias, "policy"]));
|
|
171
179
|
/** Task-style aliases (framework_commands / Taskfile names). */
|
|
172
180
|
export const VERB_ALIASES = {
|
|
173
181
|
"verify:encoding": "verify-encoding",
|
|
@@ -211,6 +219,7 @@ export const VERB_ALIASES = {
|
|
|
211
219
|
"triage:queue": "triage-queue",
|
|
212
220
|
"triage:scope": "triage-scope",
|
|
213
221
|
...TRIAGE_ACTION_COLON_ALIASES,
|
|
222
|
+
...POLICY_ACTION_COLON_ALIASES,
|
|
214
223
|
"agents:refresh": "agents-refresh",
|
|
215
224
|
"migrate:preflight": "migrate-preflight",
|
|
216
225
|
"migrate:xbrief": "migrate-xbrief",
|
|
@@ -1747,7 +1756,9 @@ const POLICY_CAPABILITY_COST_DISCLOSURE = "\u26a0 Capability-cost disclosure --
|
|
|
1747
1756
|
" \u2022 verify:branch will pass on the default branch.\n" +
|
|
1748
1757
|
" \u2022 The CI sanity check (head_ref != base_ref) is still independent and " +
|
|
1749
1758
|
"will continue to flag master->master PRs.\n" +
|
|
1750
|
-
" \u2022 This change is reversible: run `
|
|
1759
|
+
" \u2022 This change is reversible: run `" +
|
|
1760
|
+
policyColonInvocation("enforce-branches") +
|
|
1761
|
+
"` to " +
|
|
1751
1762
|
"re-enable the gate.\n" +
|
|
1752
1763
|
" \u2022 The change is recorded to meta/policy-changes.log for auditability.";
|
|
1753
1764
|
const POLICY_WIP_CAP_DISCLOSURE = "\u26a0 Capability-cost disclosure -- changing plan.policy.wipCap " +
|
|
@@ -1802,15 +1813,15 @@ function sanitizeNote(note) {
|
|
|
1802
1813
|
function defaultPolicySetActor(cmd) {
|
|
1803
1814
|
switch (cmd) {
|
|
1804
1815
|
case "enforce-branches":
|
|
1805
|
-
return "
|
|
1816
|
+
return policyColonInvocation("enforce-branches");
|
|
1806
1817
|
case "allow-direct-commits":
|
|
1807
|
-
return "
|
|
1818
|
+
return policyColonInvocation("allow-direct-commits");
|
|
1808
1819
|
case "wip-cap":
|
|
1809
|
-
return "
|
|
1820
|
+
return policySetInvocation("wip-cap");
|
|
1810
1821
|
case "subagent-backend":
|
|
1811
|
-
return "
|
|
1822
|
+
return policySetInvocation("subagent-backend");
|
|
1812
1823
|
case "subagent-backends":
|
|
1813
|
-
return "
|
|
1824
|
+
return policySetInvocation("subagent-backends");
|
|
1814
1825
|
}
|
|
1815
1826
|
}
|
|
1816
1827
|
/** Mirror Python `Path(...).expanduser()` for a leading `~` / `~/` segment. */
|
|
@@ -2027,7 +2038,7 @@ function applyBranchPolicy(args, io) {
|
|
|
2027
2038
|
if (!args.confirm) {
|
|
2028
2039
|
io.writeOut(`${POLICY_CAPABILITY_COST_DISCLOSURE}\n`);
|
|
2029
2040
|
io.writeOut("\n");
|
|
2030
|
-
io.writeOut(
|
|
2041
|
+
io.writeOut(`Re-run with --confirm to apply: ${policyColonInvocation("allow-direct-commits", " -- --confirm")}\n`);
|
|
2031
2042
|
return 1;
|
|
2032
2043
|
}
|
|
2033
2044
|
target = true;
|
|
@@ -2071,7 +2082,7 @@ function applyWipCap(args, io) {
|
|
|
2071
2082
|
if (!args.confirm) {
|
|
2072
2083
|
io.writeOut(`${POLICY_WIP_CAP_DISCLOSURE}\n`);
|
|
2073
2084
|
io.writeOut("\n");
|
|
2074
|
-
io.writeOut(`Re-run with --confirm to apply:
|
|
2085
|
+
io.writeOut(`Re-run with --confirm to apply: ${policySetInvocation("wip-cap", ` -- --set ${cap} --confirm`)}\n`);
|
|
2075
2086
|
return 1;
|
|
2076
2087
|
}
|
|
2077
2088
|
let res;
|
|
@@ -2401,11 +2412,14 @@ export async function dispatch(argv, io = defaultIo()) {
|
|
|
2401
2412
|
try {
|
|
2402
2413
|
const handler = await loadHandler(canonical, io);
|
|
2403
2414
|
const triageSubcommand = verb !== undefined ? TRIAGE_ACTION_ALIAS_SUBCOMMANDS[verb] : undefined;
|
|
2415
|
+
const policySubcommand = verb !== undefined ? POLICY_ACTION_ALIAS_SUBCOMMANDS[verb] : undefined;
|
|
2404
2416
|
const handlerArgv = canonical === "framework-commands" && verb !== undefined && verb !== canonical
|
|
2405
2417
|
? [verb, ...rest]
|
|
2406
2418
|
: triageSubcommand !== undefined && canonical === "triage-actions"
|
|
2407
2419
|
? [triageSubcommand, ...rest]
|
|
2408
|
-
:
|
|
2420
|
+
: policySubcommand !== undefined && canonical === "policy"
|
|
2421
|
+
? [policySubcommand, ...rest]
|
|
2422
|
+
: rest;
|
|
2409
2423
|
return await invokeHandler(handler, handlerArgv);
|
|
2410
2424
|
}
|
|
2411
2425
|
catch (err) {
|
package/dist/policy.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { existsSync } from "node:fs";
|
|
7
7
|
import { resolve as pathResolve, relative } from "node:path";
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
9
|
-
import { describeShadowedPlanExtension, detectShadowedPlanExtensions, disclosureLine, enableValueFeedback, FIELD_VALUE_FEEDBACK, FIELD_VALUE_FEEDBACK_CLI_ALIAS, formatValueFeedbackStatusLine, inspectAllPolicies, inspectOnePolicy, loadProjectDefinition, projectDefinitionPath, pythonListRepr, pythonStringRepr, registeredPolicyNames, renderJson, renderText, resolvePolicy, resolveValueFeedback, setPolicy, } from "@deftai/directive-core/policy";
|
|
9
|
+
import { describeShadowedPlanExtension, detectShadowedPlanExtensions, disclosureLine, enableValueFeedback, FIELD_VALUE_FEEDBACK, FIELD_VALUE_FEEDBACK_CLI_ALIAS, formatValueFeedbackStatusLine, inspectAllPolicies, inspectOnePolicy, loadProjectDefinition, policyColonInvocation, projectDefinitionPath, pythonListRepr, pythonStringRepr, registeredPolicyNames, renderJson, renderText, resolvePolicy, resolveValueFeedback, setPolicy, } from "@deftai/directive-core/policy";
|
|
10
10
|
const CAPABILITY_COST_DISCLOSURE = "\u26a0 Capability-cost disclosure -- enabling direct commits to the default " +
|
|
11
11
|
"branch turns OFF the deft branch-protection policy.\n" +
|
|
12
12
|
" \u2022 Pre-commit + pre-push hooks will no longer block default-branch " +
|
|
@@ -14,7 +14,9 @@ const CAPABILITY_COST_DISCLOSURE = "\u26a0 Capability-cost disclosure -- enablin
|
|
|
14
14
|
" \u2022 verify:branch will pass on the default branch.\n" +
|
|
15
15
|
" \u2022 The CI sanity check (head_ref != base_ref) is still independent and " +
|
|
16
16
|
"will continue to flag master->master PRs.\n" +
|
|
17
|
-
" \u2022 This change is reversible: run `
|
|
17
|
+
" \u2022 This change is reversible: run `" +
|
|
18
|
+
policyColonInvocation("enforce-branches") +
|
|
19
|
+
"` to " +
|
|
18
20
|
"re-enable the gate.\n" +
|
|
19
21
|
" \u2022 The change is recorded to meta/policy-changes.log for auditability.";
|
|
20
22
|
function makeSetError(message) {
|
|
@@ -121,7 +123,7 @@ export function parseArgs(argv) {
|
|
|
121
123
|
return {
|
|
122
124
|
cmd: "show",
|
|
123
125
|
confirm: false,
|
|
124
|
-
actor: "
|
|
126
|
+
actor: policyColonInvocation("show"),
|
|
125
127
|
note: "",
|
|
126
128
|
projectRoot: show.projectRoot,
|
|
127
129
|
format: show.format,
|
|
@@ -149,10 +151,10 @@ export function parseArgs(argv) {
|
|
|
149
151
|
cmd === "enable-value-feedback") {
|
|
150
152
|
let confirm = false;
|
|
151
153
|
let actor = cmd === "enforce-branches"
|
|
152
|
-
? "
|
|
154
|
+
? policyColonInvocation("enforce-branches")
|
|
153
155
|
: cmd === "allow-direct-commits"
|
|
154
|
-
? "
|
|
155
|
-
: "
|
|
156
|
+
? policyColonInvocation("allow-direct-commits")
|
|
157
|
+
: policyColonInvocation("enable-value-feedback");
|
|
156
158
|
let note = "";
|
|
157
159
|
let projectRoot = ".";
|
|
158
160
|
for (let i = 1; i < argv.length; i += 1) {
|
|
@@ -291,7 +293,7 @@ function runSet(args) {
|
|
|
291
293
|
const projectRoot = pathResolve(args.projectRoot);
|
|
292
294
|
if (args.cmd === "allow-direct-commits" && !args.confirm) {
|
|
293
295
|
process.stdout.write(`${CAPABILITY_COST_DISCLOSURE}\n\n`);
|
|
294
|
-
process.stdout.write(
|
|
296
|
+
process.stdout.write(`Re-run with --confirm to apply: ${policyColonInvocation("allow-direct-commits", " -- --confirm")}\n`);
|
|
295
297
|
return 1;
|
|
296
298
|
}
|
|
297
299
|
const target = args.cmd === "allow-direct-commits";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deftai/directive",
|
|
3
|
-
"version": "0.73.
|
|
3
|
+
"version": "0.73.1",
|
|
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.
|
|
35
|
-
"@deftai/directive-content": "^0.73.
|
|
34
|
+
"@deftai/directive-core": "^0.73.1",
|
|
35
|
+
"@deftai/directive-content": "^0.73.1"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "tsc -b"
|