@deftai/directive 0.80.0 → 0.82.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/cli-router/route-argv.js +6 -0
- package/dist/dispatch.d.ts +4 -2
- package/dist/dispatch.js +24 -1
- package/dist/hook-dispatch.js +42 -1
- package/dist/verify-orphan-active.d.ts +14 -0
- package/dist/verify-orphan-active.js +75 -0
- package/dist/verify-source-cli/verify-skill-external-fetch-gate.d.ts +11 -0
- package/dist/verify-source-cli/verify-skill-external-fetch-gate.js +46 -0
- package/package.json +3 -3
|
@@ -72,6 +72,11 @@ export const SUBCOMMAND_ROUTES = {
|
|
|
72
72
|
"policy:enforce-branches": ["policy", "enforce-branches"],
|
|
73
73
|
"policy:allow-direct-commits": ["policy", "allow-direct-commits"],
|
|
74
74
|
"policy:enable-value-feedback": ["policy", "enable-value-feedback"],
|
|
75
|
+
"product-signal:status": ["product-signal", "status"],
|
|
76
|
+
"product-signal:enable": ["product-signal", "enable"],
|
|
77
|
+
"product-signal:consent": ["product-signal", "consent"],
|
|
78
|
+
"product-signal:submit": ["product-signal", "submit"],
|
|
79
|
+
"product-signal:bootstrap-sink": ["product-signal", "bootstrap-sink"],
|
|
75
80
|
"vbrief:reconcile-graph": ["vbrief-reconcile", "graph"],
|
|
76
81
|
"vbrief:reconcile-labels": ["vbrief-reconcile", "labels"],
|
|
77
82
|
"vbrief:reconcile-umbrellas": ["vbrief-reconcile", "umbrellas"],
|
|
@@ -79,6 +84,7 @@ export const SUBCOMMAND_ROUTES = {
|
|
|
79
84
|
"slice:list": ["slice", "list"],
|
|
80
85
|
"github-body:issue-create": ["github-body", "issue-create"],
|
|
81
86
|
"github-body:issue-edit": ["github-body", "issue-edit"],
|
|
87
|
+
"github-body:issue-fetch": ["github-body", "issue-fetch"],
|
|
82
88
|
"github-body:comment-create": ["github-body", "comment-create"],
|
|
83
89
|
"github-body:comment-edit": ["github-body", "comment-edit"],
|
|
84
90
|
"github-body:pr-edit": ["github-body", "pr-edit"],
|
package/dist/dispatch.d.ts
CHANGED
|
@@ -10,15 +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-contract-drift", "verify-cursor-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", "review-monitor-register", "verify-tools", "verify-wip-cap", "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", "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-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", "review-monitor-register", "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
|
-
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", "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"];
|
|
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", "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
20
|
/** Colon aliases for plan-sequence subcommands (#2402). */
|
|
21
21
|
export declare const PLAN_SEQUENCE_ALIAS_SUBCOMMANDS: Readonly<Record<string, string>>;
|
|
22
|
+
/** Colon aliases for product-signal subcommands (#2693). */
|
|
23
|
+
export declare const PRODUCT_SIGNAL_ALIAS_SUBCOMMANDS: Readonly<Record<string, string>>;
|
|
22
24
|
/** Task-style aliases (framework_commands / Taskfile names). */
|
|
23
25
|
export declare const VERB_ALIASES: Readonly<Record<string, string>>;
|
|
24
26
|
/** Pinned ghx version (display only) — keep in lockstep with .github/workflows/ci.yml env.GHX_VERSION. */
|
package/dist/dispatch.js
CHANGED
|
@@ -102,6 +102,7 @@ export const CLI_MODULE_VERBS = [
|
|
|
102
102
|
"verify-bridge-drift",
|
|
103
103
|
"verify-capacity",
|
|
104
104
|
"verify-content-manifest",
|
|
105
|
+
"verify-skill-external-fetch-gate",
|
|
105
106
|
"verify-contract-drift",
|
|
106
107
|
"verify-cursor-tier1",
|
|
107
108
|
"verify-go-freeze",
|
|
@@ -116,6 +117,7 @@ export const CLI_MODULE_VERBS = [
|
|
|
116
117
|
"review-monitor-register",
|
|
117
118
|
"verify-tools",
|
|
118
119
|
"verify-wip-cap",
|
|
120
|
+
"verify-orphan-active",
|
|
119
121
|
"verify-agents-md-budget",
|
|
120
122
|
"verify-agents-md-advisory",
|
|
121
123
|
"verify-eval-health-relocation",
|
|
@@ -166,6 +168,7 @@ export const CORE_MODULE_VERBS = [
|
|
|
166
168
|
"architecture-preflight-sor",
|
|
167
169
|
"feedback-file",
|
|
168
170
|
"value-readback",
|
|
171
|
+
"product-signal",
|
|
169
172
|
];
|
|
170
173
|
/** Colon aliases for triage-actions (mirrors cli-router SUBCOMMAND_ROUTES). */
|
|
171
174
|
export const TRIAGE_ACTION_ALIAS_SUBCOMMANDS = {
|
|
@@ -195,6 +198,15 @@ export const PLAN_SEQUENCE_ALIAS_SUBCOMMANDS = {
|
|
|
195
198
|
"plan-sequence:advance": "advance",
|
|
196
199
|
};
|
|
197
200
|
const PLAN_SEQUENCE_COLON_ALIASES = Object.fromEntries(Object.keys(PLAN_SEQUENCE_ALIAS_SUBCOMMANDS).map((alias) => [alias, "plan-sequence"]));
|
|
201
|
+
/** Colon aliases for product-signal subcommands (#2693). */
|
|
202
|
+
export const PRODUCT_SIGNAL_ALIAS_SUBCOMMANDS = {
|
|
203
|
+
"product-signal:status": "status",
|
|
204
|
+
"product-signal:enable": "enable",
|
|
205
|
+
"product-signal:consent": "consent",
|
|
206
|
+
"product-signal:submit": "submit",
|
|
207
|
+
"product-signal:bootstrap-sink": "bootstrap-sink",
|
|
208
|
+
};
|
|
209
|
+
const PRODUCT_SIGNAL_COLON_ALIASES = Object.fromEntries(Object.keys(PRODUCT_SIGNAL_ALIAS_SUBCOMMANDS).map((alias) => [alias, "product-signal"]));
|
|
198
210
|
/** Task-style aliases (framework_commands / Taskfile names). */
|
|
199
211
|
export const VERB_ALIASES = {
|
|
200
212
|
"hook:dispatch": "hook-dispatch",
|
|
@@ -204,6 +216,7 @@ export const VERB_ALIASES = {
|
|
|
204
216
|
"verify:branch": "verify-branch",
|
|
205
217
|
"verify:vbrief-conformance": "vbrief-validate",
|
|
206
218
|
"verify:wip-cap": "verify-wip-cap",
|
|
219
|
+
"verify:orphan-active": "verify-orphan-active",
|
|
207
220
|
"verify:agents-md-budget": "verify-agents-md-budget",
|
|
208
221
|
"verify:agents-md-advisory": "verify-agents-md-advisory",
|
|
209
222
|
"verify:eval-health-relocation": "verify-eval-health-relocation",
|
|
@@ -227,6 +240,7 @@ export const VERB_ALIASES = {
|
|
|
227
240
|
"rule:ownership-lint": "rule-ownership-lint",
|
|
228
241
|
"verify:biome-config": "verify-biome-config",
|
|
229
242
|
"verify:content-manifest": "verify-content-manifest",
|
|
243
|
+
"verify:skill-external-fetch-gate": "verify-skill-external-fetch-gate",
|
|
230
244
|
"verify:contract-drift": "verify-contract-drift",
|
|
231
245
|
"verify:cursor-tier1": "verify-cursor-tier1",
|
|
232
246
|
"verify:go-freeze": "verify-go-freeze",
|
|
@@ -248,6 +262,7 @@ export const VERB_ALIASES = {
|
|
|
248
262
|
"triage:scope": "triage-scope",
|
|
249
263
|
...TRIAGE_ACTION_COLON_ALIASES,
|
|
250
264
|
...POLICY_ACTION_COLON_ALIASES,
|
|
265
|
+
...PRODUCT_SIGNAL_COLON_ALIASES,
|
|
251
266
|
"agents:refresh": "agents-refresh",
|
|
252
267
|
"migrate:preflight": "migrate-preflight",
|
|
253
268
|
"migrate:xbrief": "migrate-xbrief",
|
|
@@ -283,6 +298,7 @@ const SUBDIR_CLI_STEMS = {
|
|
|
283
298
|
"rule-ownership-lint": "verify-source-cli/rule-ownership-lint",
|
|
284
299
|
"verify-biome-config": "verify-source-cli/verify-biome-config",
|
|
285
300
|
"verify-content-manifest": "verify-source-cli/verify-content-manifest",
|
|
301
|
+
"verify-skill-external-fetch-gate": "verify-source-cli/verify-skill-external-fetch-gate",
|
|
286
302
|
"verify-contract-drift": "verify-source-cli/verify-contract-drift",
|
|
287
303
|
"verify-cursor-tier1": "verify-source-cli/verify-cursor-tier1",
|
|
288
304
|
"verify-scm-boundary": "verify-source-cli/verify-scm-boundary",
|
|
@@ -2348,6 +2364,10 @@ async function loadCoreModuleHandler(verb, io) {
|
|
|
2348
2364
|
const { mainEntry } = await import("@deftai/directive-core/dist/value/readback.js");
|
|
2349
2365
|
return mainEntry;
|
|
2350
2366
|
}
|
|
2367
|
+
case "product-signal": {
|
|
2368
|
+
const { mainEntry } = await import("@deftai/directive-core/dist/product-signal/submit.js");
|
|
2369
|
+
return mainEntry;
|
|
2370
|
+
}
|
|
2351
2371
|
default:
|
|
2352
2372
|
throw new Error(`unknown core verb: ${verb}`);
|
|
2353
2373
|
}
|
|
@@ -2558,6 +2578,7 @@ export async function dispatch(argv, io = defaultIo()) {
|
|
|
2558
2578
|
const triageSubcommand = verb !== undefined ? TRIAGE_ACTION_ALIAS_SUBCOMMANDS[verb] : undefined;
|
|
2559
2579
|
const policySubcommand = verb !== undefined ? POLICY_ACTION_ALIAS_SUBCOMMANDS[verb] : undefined;
|
|
2560
2580
|
const planSequenceSubcommand = verb !== undefined ? PLAN_SEQUENCE_ALIAS_SUBCOMMANDS[verb] : undefined;
|
|
2581
|
+
const productSignalSubcommand = verb !== undefined ? PRODUCT_SIGNAL_ALIAS_SUBCOMMANDS[verb] : undefined;
|
|
2561
2582
|
const handlerArgv = canonical === "framework-commands" && verb !== undefined && verb !== canonical
|
|
2562
2583
|
? [verb, ...rest]
|
|
2563
2584
|
: triageSubcommand !== undefined && canonical === "triage-actions"
|
|
@@ -2566,7 +2587,9 @@ export async function dispatch(argv, io = defaultIo()) {
|
|
|
2566
2587
|
? [policySubcommand, ...rest]
|
|
2567
2588
|
: planSequenceSubcommand !== undefined && canonical === "plan-sequence"
|
|
2568
2589
|
? [planSequenceSubcommand, ...rest]
|
|
2569
|
-
:
|
|
2590
|
+
: productSignalSubcommand !== undefined && canonical === "product-signal"
|
|
2591
|
+
? [productSignalSubcommand, ...rest]
|
|
2592
|
+
: rest;
|
|
2570
2593
|
return await invokeHandler(handler, handlerArgv);
|
|
2571
2594
|
}
|
|
2572
2595
|
catch (err) {
|
package/dist/hook-dispatch.js
CHANGED
|
@@ -57,14 +57,55 @@ export function parseArgs(argv) {
|
|
|
57
57
|
return { error: "--event is required" };
|
|
58
58
|
return parsed;
|
|
59
59
|
}
|
|
60
|
+
const UTF8_BOM = "\uFEFF";
|
|
61
|
+
const APPLY_PATCH_BEGIN_MARKER = "*** Begin Patch";
|
|
62
|
+
/** Single-file Add/Update only — other *** … File: ops must fail closed (#2738 Greptile). */
|
|
63
|
+
const APPLY_PATCH_MUTATION_LINE_RE = /^\*\*\* (Add File|Update File|Delete File|Move File|Rename File): (.+)$/gm;
|
|
64
|
+
function stripUtf8Bom(raw) {
|
|
65
|
+
return raw.startsWith(UTF8_BOM) ? raw.slice(UTF8_BOM.length) : raw;
|
|
66
|
+
}
|
|
67
|
+
function trySynthesizeFreeFormApplyPatch(normalized) {
|
|
68
|
+
if (!normalized.includes(APPLY_PATCH_BEGIN_MARKER))
|
|
69
|
+
return null;
|
|
70
|
+
const mutations = [];
|
|
71
|
+
for (const match of normalized.matchAll(APPLY_PATCH_MUTATION_LINE_RE)) {
|
|
72
|
+
const op = match[1];
|
|
73
|
+
const path = match[2]?.trim();
|
|
74
|
+
if (op === undefined || !path)
|
|
75
|
+
continue;
|
|
76
|
+
mutations.push({ op, path });
|
|
77
|
+
}
|
|
78
|
+
if (mutations.length !== 1)
|
|
79
|
+
return null;
|
|
80
|
+
const sole = mutations[0];
|
|
81
|
+
if (sole === undefined || (sole.op !== "Add File" && sole.op !== "Update File"))
|
|
82
|
+
return null;
|
|
83
|
+
return {
|
|
84
|
+
payload: {
|
|
85
|
+
tool_name: "ApplyPatch",
|
|
86
|
+
tool_input: {
|
|
87
|
+
path: sole.path,
|
|
88
|
+
patch: normalized,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
context: {},
|
|
92
|
+
};
|
|
93
|
+
}
|
|
60
94
|
export function parsePayload(raw) {
|
|
61
95
|
if (raw.trim().length === 0) {
|
|
62
96
|
return { payload: {}, context: { stdinEmpty: true } };
|
|
63
97
|
}
|
|
98
|
+
const normalized = stripUtf8Bom(raw);
|
|
99
|
+
if (normalized.trim().length === 0) {
|
|
100
|
+
return { payload: {}, context: { stdinEmpty: true } };
|
|
101
|
+
}
|
|
64
102
|
try {
|
|
65
|
-
return { payload: JSON.parse(
|
|
103
|
+
return { payload: JSON.parse(normalized), context: {} };
|
|
66
104
|
}
|
|
67
105
|
catch {
|
|
106
|
+
const synthesized = trySynthesizeFreeFormApplyPatch(normalized);
|
|
107
|
+
if (synthesized !== null)
|
|
108
|
+
return synthesized;
|
|
68
109
|
// tool.before is installed only on direct-write matchers, so an unreadable
|
|
69
110
|
// payload becomes a missing-tool denial rather than a fail-open crash.
|
|
70
111
|
return { payload: {}, context: { parseFailed: true } };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
interface ParsedArgs {
|
|
3
|
+
projectRoot: string;
|
|
4
|
+
repo: string | null;
|
|
5
|
+
quiet: boolean;
|
|
6
|
+
skipGh: boolean;
|
|
7
|
+
error?: string;
|
|
8
|
+
}
|
|
9
|
+
/** Parse verify-orphan-active CLI args. */
|
|
10
|
+
export declare function parseArgs(argv: string[]): ParsedArgs;
|
|
11
|
+
/** Run the gate and return the process exit code. */
|
|
12
|
+
export declare function run(argv: string[]): number;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=verify-orphan-active.d.ts.map
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { evaluate } from "@deftai/directive-core/orphan-active";
|
|
5
|
+
/** Parse verify-orphan-active CLI args. */
|
|
6
|
+
export function parseArgs(argv) {
|
|
7
|
+
const parsed = {
|
|
8
|
+
projectRoot: ".",
|
|
9
|
+
repo: null,
|
|
10
|
+
quiet: false,
|
|
11
|
+
skipGh: false,
|
|
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 === "--skip-gh") {
|
|
19
|
+
parsed.skipGh = 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 === "--repo") {
|
|
33
|
+
const value = argv[i + 1];
|
|
34
|
+
if (value === undefined) {
|
|
35
|
+
return { ...parsed, error: "argument --repo: expected one argument" };
|
|
36
|
+
}
|
|
37
|
+
parsed.repo = value;
|
|
38
|
+
i += 1;
|
|
39
|
+
}
|
|
40
|
+
else if (arg?.startsWith("--repo=")) {
|
|
41
|
+
parsed.repo = arg.slice("--repo=".length);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
return { ...parsed, error: `unrecognized argument: ${arg}` };
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return parsed;
|
|
48
|
+
}
|
|
49
|
+
/** Run the gate and return the process exit code. */
|
|
50
|
+
export function run(argv) {
|
|
51
|
+
const args = parseArgs(argv);
|
|
52
|
+
if (args.error !== undefined) {
|
|
53
|
+
process.stderr.write(`verify_orphan_active: ${args.error}\n`);
|
|
54
|
+
return 2;
|
|
55
|
+
}
|
|
56
|
+
const projectRoot = resolve(args.projectRoot);
|
|
57
|
+
const result = evaluate(projectRoot, {
|
|
58
|
+
quiet: args.quiet,
|
|
59
|
+
repo: args.repo,
|
|
60
|
+
skipGh: args.skipGh,
|
|
61
|
+
});
|
|
62
|
+
if (result.message.length > 0) {
|
|
63
|
+
if (result.stream === "stdout") {
|
|
64
|
+
process.stdout.write(`${result.message}\n`);
|
|
65
|
+
}
|
|
66
|
+
else if (result.stream === "stderr") {
|
|
67
|
+
process.stderr.write(`${result.message}\n`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return result.code;
|
|
71
|
+
}
|
|
72
|
+
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
73
|
+
process.exit(run(process.argv.slice(2)));
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=verify-orphan-active.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
interface ParsedArgs {
|
|
3
|
+
projectRoot: string | null;
|
|
4
|
+
error?: string;
|
|
5
|
+
}
|
|
6
|
+
/** Parse verify-skill-external-fetch-gate CLI args (#1936). */
|
|
7
|
+
export declare function parseArgs(argv: string[]): ParsedArgs;
|
|
8
|
+
/** Run the gate and return the process exit code. */
|
|
9
|
+
export declare function run(argv: string[]): number;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=verify-skill-external-fetch-gate.d.ts.map
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { evaluateSkillExternalFetchGate } from "@deftai/directive-core/verify-source";
|
|
5
|
+
/** Parse verify-skill-external-fetch-gate CLI args (#1936). */
|
|
6
|
+
export function parseArgs(argv) {
|
|
7
|
+
const parsed = { projectRoot: null };
|
|
8
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
9
|
+
const arg = argv[i];
|
|
10
|
+
if (arg === "--project-root") {
|
|
11
|
+
const value = argv[i + 1];
|
|
12
|
+
if (value === undefined) {
|
|
13
|
+
return { ...parsed, error: "argument --project-root: expected one argument" };
|
|
14
|
+
}
|
|
15
|
+
parsed.projectRoot = value;
|
|
16
|
+
i += 1;
|
|
17
|
+
}
|
|
18
|
+
else if (arg?.startsWith("--project-root=")) {
|
|
19
|
+
parsed.projectRoot = arg.slice("--project-root=".length);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
return { ...parsed, error: `unrecognized argument: ${arg}` };
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return parsed;
|
|
26
|
+
}
|
|
27
|
+
/** Run the gate and return the process exit code. */
|
|
28
|
+
export function run(argv) {
|
|
29
|
+
const args = parseArgs(argv);
|
|
30
|
+
if (args.error !== undefined) {
|
|
31
|
+
process.stderr.write(`verify_skill_external_fetch_gate: ${args.error}\n`);
|
|
32
|
+
return 2;
|
|
33
|
+
}
|
|
34
|
+
const result = evaluateSkillExternalFetchGate(resolve(args.projectRoot ?? "."));
|
|
35
|
+
if (result.stream === "stdout") {
|
|
36
|
+
process.stdout.write(`${result.message}\n`);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
process.stderr.write(`${result.message}\n`);
|
|
40
|
+
}
|
|
41
|
+
return result.code;
|
|
42
|
+
}
|
|
43
|
+
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
44
|
+
process.exit(run(process.argv.slice(2)));
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=verify-skill-external-fetch-gate.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deftai/directive",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.82.0",
|
|
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.
|
|
35
|
-
"@deftai/directive-content": "^0.
|
|
34
|
+
"@deftai/directive-core": "^0.82.0",
|
|
35
|
+
"@deftai/directive-content": "^0.82.0"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "tsc -b"
|