@deftai/directive 0.59.0 → 0.60.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/change-init.d.ts +3 -0
- package/dist/change-init.js +59 -0
- package/dist/changelog-check.d.ts +3 -0
- package/dist/changelog-check.js +44 -0
- package/dist/cli-router/index.js +4 -1
- package/dist/cli-router/route-argv.js +2 -2
- package/dist/commit-lint.d.ts +3 -0
- package/dist/commit-lint.js +44 -0
- package/dist/dispatch.d.ts +61 -2
- package/dist/dispatch.js +396 -2
- package/dist/doc-cli-parity.js +1 -1
- package/dist/doctor-parity.d.ts +5 -1
- package/dist/doctor-parity.js +4 -3
- package/dist/install-cli/coverage-map.js +3 -2
- package/dist/install-uninstall.d.ts +3 -0
- package/dist/install-uninstall.js +44 -0
- package/dist/install-upgrade.d.ts +9 -0
- package/dist/install-upgrade.js +67 -0
- package/dist/migrate-preflight.d.ts +10 -0
- package/dist/migrate-preflight.js +84 -0
- package/dist/session-start.d.ts +13 -0
- package/dist/session-start.js +111 -0
- package/dist/toolchain-check.d.ts +1 -1
- package/dist/toolchain-check.js +3 -2
- package/package.json +3 -3
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { runChangeInit } from "@deftai/directive-core/task-surface";
|
|
5
|
+
function parseArgs(argv) {
|
|
6
|
+
let projectRoot = ".";
|
|
7
|
+
let name = "";
|
|
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 { projectRoot, name, error: "argument --project-root: expected one argument" };
|
|
14
|
+
}
|
|
15
|
+
projectRoot = value;
|
|
16
|
+
i += 1;
|
|
17
|
+
}
|
|
18
|
+
else if (arg.startsWith("--project-root=")) {
|
|
19
|
+
projectRoot = arg.slice("--project-root=".length);
|
|
20
|
+
}
|
|
21
|
+
else if (arg === "--name") {
|
|
22
|
+
const value = argv[i + 1];
|
|
23
|
+
if (value === undefined) {
|
|
24
|
+
return { projectRoot, name, error: "argument --name: expected one argument" };
|
|
25
|
+
}
|
|
26
|
+
name = value;
|
|
27
|
+
i += 1;
|
|
28
|
+
}
|
|
29
|
+
else if (arg.startsWith("--name=")) {
|
|
30
|
+
name = arg.slice("--name=".length);
|
|
31
|
+
}
|
|
32
|
+
else if (!arg.startsWith("-") && name.length === 0) {
|
|
33
|
+
name = arg;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
return { projectRoot, name, error: `unrecognized argument: ${arg}` };
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return { projectRoot, name };
|
|
40
|
+
}
|
|
41
|
+
export function run(argv) {
|
|
42
|
+
const args = parseArgs(argv);
|
|
43
|
+
if (args.error !== undefined) {
|
|
44
|
+
process.stderr.write(`change-init: ${args.error}\n`);
|
|
45
|
+
return 2;
|
|
46
|
+
}
|
|
47
|
+
return runChangeInit(resolve(args.projectRoot), args.name, {
|
|
48
|
+
writeOut: (text) => {
|
|
49
|
+
process.stdout.write(text);
|
|
50
|
+
},
|
|
51
|
+
writeErr: (text) => {
|
|
52
|
+
process.stderr.write(text);
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
57
|
+
process.exit(run(process.argv.slice(2)));
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=change-init.js.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { runChangelogCheck } from "@deftai/directive-core/task-surface";
|
|
5
|
+
function parseProjectRoot(argv) {
|
|
6
|
+
let projectRoot = ".";
|
|
7
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
8
|
+
const arg = argv[i] ?? "";
|
|
9
|
+
if (arg === "--project-root") {
|
|
10
|
+
const value = argv[i + 1];
|
|
11
|
+
if (value === undefined) {
|
|
12
|
+
return { projectRoot, error: "argument --project-root: expected one argument" };
|
|
13
|
+
}
|
|
14
|
+
projectRoot = value;
|
|
15
|
+
i += 1;
|
|
16
|
+
}
|
|
17
|
+
else if (arg.startsWith("--project-root=")) {
|
|
18
|
+
projectRoot = arg.slice("--project-root=".length);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
return { projectRoot, error: `unrecognized argument: ${arg}` };
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return { projectRoot };
|
|
25
|
+
}
|
|
26
|
+
export function run(argv) {
|
|
27
|
+
const args = parseProjectRoot(argv);
|
|
28
|
+
if (args.error !== undefined) {
|
|
29
|
+
process.stderr.write(`changelog-check: ${args.error}\n`);
|
|
30
|
+
return 2;
|
|
31
|
+
}
|
|
32
|
+
return runChangelogCheck(resolve(args.projectRoot), {
|
|
33
|
+
writeOut: (text) => {
|
|
34
|
+
process.stdout.write(text);
|
|
35
|
+
},
|
|
36
|
+
writeErr: (text) => {
|
|
37
|
+
process.stderr.write(text);
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
42
|
+
process.exit(run(process.argv.slice(2)));
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=changelog-check.js.map
|
package/dist/cli-router/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* CLI router entry: `directive <namespace> <verb>` → flat dispatcher (#1670 / #11 S3).
|
|
3
3
|
*/
|
|
4
|
-
import { dispatch } from "../dispatch.js";
|
|
4
|
+
import { dispatch, runDirectiveBootstrap } from "../dispatch.js";
|
|
5
5
|
import { runInit } from "../init-cli/init.js";
|
|
6
6
|
import { runMigrate } from "../init-cli/migrate.js";
|
|
7
7
|
import { runUpdate } from "../init-cli/update.js";
|
|
@@ -36,6 +36,9 @@ export async function routeAndDispatch(argv, io) {
|
|
|
36
36
|
if (first === "migrate") {
|
|
37
37
|
return runMigrate(rest, io ?? defaultIo());
|
|
38
38
|
}
|
|
39
|
+
if (first === "bootstrap") {
|
|
40
|
+
return runDirectiveBootstrap(rest, io ?? defaultIo());
|
|
41
|
+
}
|
|
39
42
|
return dispatch(routed.argv, io);
|
|
40
43
|
}
|
|
41
44
|
//# sourceMappingURL=index.js.map
|
|
@@ -17,7 +17,7 @@ export const TOP_LEVEL_UX_VERBS = [
|
|
|
17
17
|
/** Stubbed until a later story lands the handler (#1670 / #11). */
|
|
18
18
|
export const STUBBED_TOP_LEVEL_VERBS = new Set([]);
|
|
19
19
|
/** Registered but not yet implemented as TS handlers. */
|
|
20
|
-
export const DEFERRED_TOP_LEVEL_VERBS = new Set(["
|
|
20
|
+
export const DEFERRED_TOP_LEVEL_VERBS = new Set(["feature"]);
|
|
21
21
|
/** scope:* lifecycle verbs routed through scope-lifecycle handler. */
|
|
22
22
|
export const SCOPE_LIFECYCLE_VERBS = new Set([
|
|
23
23
|
"promote",
|
|
@@ -91,7 +91,7 @@ function routeTopLevel(first, rest) {
|
|
|
91
91
|
if (first === "check" || first === "doctor") {
|
|
92
92
|
return { kind: "dispatch", argv: [first, ...rest] };
|
|
93
93
|
}
|
|
94
|
-
if (first === "init" || first === "update" || first === "migrate") {
|
|
94
|
+
if (first === "init" || first === "update" || first === "migrate" || first === "bootstrap") {
|
|
95
95
|
return { kind: "dispatch", argv: [first, ...rest] };
|
|
96
96
|
}
|
|
97
97
|
if (STUBBED_TOP_LEVEL_VERBS.has(first)) {
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { runCommitLint } from "@deftai/directive-core/task-surface";
|
|
5
|
+
function parseProjectRoot(argv) {
|
|
6
|
+
let projectRoot = ".";
|
|
7
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
8
|
+
const arg = argv[i] ?? "";
|
|
9
|
+
if (arg === "--project-root") {
|
|
10
|
+
const value = argv[i + 1];
|
|
11
|
+
if (value === undefined) {
|
|
12
|
+
return { projectRoot, error: "argument --project-root: expected one argument" };
|
|
13
|
+
}
|
|
14
|
+
projectRoot = value;
|
|
15
|
+
i += 1;
|
|
16
|
+
}
|
|
17
|
+
else if (arg.startsWith("--project-root=")) {
|
|
18
|
+
projectRoot = arg.slice("--project-root=".length);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
return { projectRoot, error: `unrecognized argument: ${arg}` };
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return { projectRoot };
|
|
25
|
+
}
|
|
26
|
+
export function run(argv) {
|
|
27
|
+
const args = parseProjectRoot(argv);
|
|
28
|
+
if (args.error !== undefined) {
|
|
29
|
+
process.stderr.write(`commit-lint: ${args.error}\n`);
|
|
30
|
+
return 2;
|
|
31
|
+
}
|
|
32
|
+
return runCommitLint(resolve(args.projectRoot), {
|
|
33
|
+
writeOut: (text) => {
|
|
34
|
+
process.stdout.write(text);
|
|
35
|
+
},
|
|
36
|
+
writeErr: (text) => {
|
|
37
|
+
process.stderr.write(text);
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
42
|
+
process.exit(run(process.argv.slice(2)));
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=commit-lint.js.map
|
package/dist/dispatch.d.ts
CHANGED
|
@@ -2,17 +2,76 @@
|
|
|
2
2
|
* Unified `directive <verb> [args]` dispatcher (#1828 s0).
|
|
3
3
|
* Routes to ported command modules in packages/cli and packages/core.
|
|
4
4
|
*/
|
|
5
|
+
import { spawnSync } from "node:child_process";
|
|
6
|
+
import { type WhichFn } from "@deftai/directive-core/scm";
|
|
5
7
|
export type CommandHandler = (argv: string[]) => number | Promise<number>;
|
|
6
8
|
export interface DispatchIo {
|
|
7
9
|
writeOut: (text: string) => void;
|
|
8
10
|
writeErr: (text: string) => void;
|
|
9
11
|
}
|
|
10
12
|
/** CLI modules in packages/cli/src (excluding parity harnesses and bin/index). */
|
|
11
|
-
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", "parity", "policy", "pr-closing-keywords", "pr-merge-readiness", "pr-monitor", "pr-protected-issues", "pr-wait-mergeable", "preflight-cache", "preflight-gh", "probe-session", "release", "release-e2e", "release-publish", "release-rollback", "scope-lifecycle", "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-hooks-installed", "verify-investigation", "verify-judgment-gates", "verify-no-task-runtime", "validate-links", "validate-strategy-output", "verify-bridge-drift", "verify-capacity", "verify-content-manifest", "verify-go-freeze", "verify-scm-boundary", "verify-session-ritual", "verify-stubs", "rule-ownership-lint", "verify-story-ready", "verify-tools", "verify-wip-cap"];
|
|
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", "changelog-check", "change-init", "commit-lint", "parity", "policy", "pr-closing-keywords", "pr-merge-readiness", "pr-monitor", "pr-protected-issues", "pr-wait-mergeable", "preflight-cache", "preflight-gh", "probe-session", "release", "release-e2e", "release-publish", "release-rollback", "scope-lifecycle", "session-start", "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-hooks-installed", "verify-investigation", "verify-judgment-gates", "verify-no-task-runtime", "validate-links", "validate-strategy-output", "verify-bridge-drift", "verify-capacity", "verify-content-manifest", "verify-go-freeze", "verify-scm-boundary", "verify-session-ritual", "verify-stubs", "rule-ownership-lint", "verify-story-ready", "verify-tools", "verify-wip-cap"];
|
|
12
14
|
/** Core-only CLI entrypoints without a packages/cli wrapper. */
|
|
13
|
-
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-readiness", "swarm-routing-verify", "swarm-routing-set", "swarm-verify-review-clean", "swarm-worktrees", "framework-commands", "pack-render", "packs-slice", "prd-render", "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", "scope-undo", "scope-demote", "scope-decompose", "changelog-resolve-unreleased", "architecture-preflight-sor"];
|
|
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-readiness", "swarm-routing-verify", "swarm-routing-set", "swarm-verify-review-clean", "swarm-worktrees", "framework-commands", "pack-render", "packs-slice", "prd-render", "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"];
|
|
14
16
|
/** Task-style aliases (framework_commands / Taskfile names). */
|
|
15
17
|
export declare const VERB_ALIASES: Readonly<Record<string, string>>;
|
|
18
|
+
/** Pinned ghx version — keep in lockstep with .github/workflows/ci.yml env.GHX_VERSION. */
|
|
19
|
+
export declare const GHX_VERSION = "v1.5.1";
|
|
20
|
+
export declare const INSTALL_PS1_URL = "https://raw.githubusercontent.com/brunoborges/ghx/v1.5.1/install.ps1";
|
|
21
|
+
export declare const INSTALL_SH_URL = "https://raw.githubusercontent.com/brunoborges/ghx/v1.5.1/install.sh";
|
|
22
|
+
export type SetupGhxHost = "windows" | "darwin" | "linux" | string;
|
|
23
|
+
export interface SetupGhxDeps {
|
|
24
|
+
whichFn?: WhichFn;
|
|
25
|
+
readConsentLine?: () => string;
|
|
26
|
+
runInstall?: (host: SetupGhxHost) => number;
|
|
27
|
+
}
|
|
28
|
+
export declare function ghxPresent(whichFn?: WhichFn): boolean;
|
|
29
|
+
export declare function detectSetupGhxHost(): SetupGhxHost;
|
|
30
|
+
export declare function promptSetupGhxConsent(io: DispatchIo, readLine?: () => string): boolean;
|
|
31
|
+
export declare function buildSetupGhxInstallCommand(host: SetupGhxHost, whichFn?: WhichFn): string[];
|
|
32
|
+
export declare function installSetupGhx(host: SetupGhxHost, whichFn?: WhichFn, runner?: typeof spawnSync): number;
|
|
33
|
+
/** Native `setup:ghx` handler (replaces scripts/setup_ghx.py shell-out, #2022 Phase 1). */
|
|
34
|
+
export declare function runSetupGhx(argv: string[], io: DispatchIo, deps?: SetupGhxDeps): number;
|
|
35
|
+
export declare const SETUP_SKILL_REL_PATH = ".deft/core/skills/deft-directive-setup/SKILL.md";
|
|
36
|
+
export type BootstrapPhaseLabel = "user" | "project" | "spec";
|
|
37
|
+
export type BootstrapReEntry = "none" | "prompt" | "reconfigure" | "force";
|
|
38
|
+
export interface DirectiveBootstrapArgs {
|
|
39
|
+
projectRoot: string;
|
|
40
|
+
jumpProject: boolean;
|
|
41
|
+
strategy: string | null;
|
|
42
|
+
reconfigure: boolean;
|
|
43
|
+
force: boolean;
|
|
44
|
+
json: boolean;
|
|
45
|
+
error?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface DirectiveBootstrapPlan {
|
|
48
|
+
phase: 1 | 2 | 3;
|
|
49
|
+
phaseLabel: BootstrapPhaseLabel;
|
|
50
|
+
reEntry: BootstrapReEntry;
|
|
51
|
+
strategy: string | null;
|
|
52
|
+
}
|
|
53
|
+
export interface DirectiveBootstrapHandoff {
|
|
54
|
+
handoff: "deft-directive-setup";
|
|
55
|
+
skill_path: string;
|
|
56
|
+
project_root: string;
|
|
57
|
+
deposited: boolean;
|
|
58
|
+
phase: 1 | 2 | 3;
|
|
59
|
+
phase_label: BootstrapPhaseLabel;
|
|
60
|
+
re_entry: BootstrapReEntry;
|
|
61
|
+
strategy: string | null;
|
|
62
|
+
}
|
|
63
|
+
export interface DirectiveBootstrapDeps {
|
|
64
|
+
deftCorePresent?: (projectRoot: string) => boolean;
|
|
65
|
+
userMdPresent?: (projectRoot: string) => boolean;
|
|
66
|
+
projectDefPresent?: (projectRoot: string) => boolean;
|
|
67
|
+
runInitDeposit?: (projectRoot: string, io: DispatchIo) => Promise<number>;
|
|
68
|
+
}
|
|
69
|
+
/** Parse `directive bootstrap` argv (#2022 Phase 4). */
|
|
70
|
+
export declare function parseDirectiveBootstrapArgs(argv: readonly string[]): DirectiveBootstrapArgs;
|
|
71
|
+
/** Resolve phase intent and deliberate re-entry signal from parsed args + on-disk state. */
|
|
72
|
+
export declare function resolveDirectiveBootstrapPlan(args: DirectiveBootstrapArgs, deps: Required<DirectiveBootstrapDeps>): DirectiveBootstrapPlan;
|
|
73
|
+
/** Native `directive bootstrap` handler (#2022 Phase 4). */
|
|
74
|
+
export declare function runDirectiveBootstrap(argv: string[], io: DispatchIo, deps?: DirectiveBootstrapDeps): Promise<number>;
|
|
16
75
|
/** Native `policy-set` dispatcher (replaces the policy_set.py shell-out, #2022 Phase 1). */
|
|
17
76
|
export declare function runPolicySet(argv: string[], io: DispatchIo): number;
|
|
18
77
|
/** Resolve a user-facing verb to its canonical handler key. */
|
package/dist/dispatch.js
CHANGED
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
* Unified `directive <verb> [args]` dispatcher (#1828 s0).
|
|
3
3
|
* Routes to ported command modules in packages/cli and packages/core.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { spawnSync } from "node:child_process";
|
|
6
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, readSync, statSync, writeFileSync, } from "node:fs";
|
|
6
7
|
import { homedir } from "node:os";
|
|
7
8
|
import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
8
9
|
import { engineInfo } from "@deftai/directive-core";
|
|
10
|
+
import { parseInitArgv, runInitDepositCli, userConfigDir, } from "@deftai/directive-core/init-deposit";
|
|
9
11
|
import { appendAuditLog, disclosureLine, projectDefinitionPath, resolvePolicy, resolveWipCap, setPolicy, } from "@deftai/directive-core/policy";
|
|
12
|
+
import { defaultWhich } from "@deftai/directive-core/scm";
|
|
10
13
|
import { KNOWN_SUBAGENT_BACKEND_IDS, probeSubagentBackends, resolveSwarmSubagentBackend, } from "@deftai/directive-core/swarm";
|
|
11
14
|
const HANDLER_KEYS = [
|
|
12
15
|
"run",
|
|
@@ -31,6 +34,12 @@ export const CLI_MODULE_VERBS = [
|
|
|
31
34
|
"codebase-projection-registry",
|
|
32
35
|
"codebase-provider",
|
|
33
36
|
"doctor",
|
|
37
|
+
"install-upgrade",
|
|
38
|
+
"install-uninstall",
|
|
39
|
+
"migrate-preflight",
|
|
40
|
+
"changelog-check",
|
|
41
|
+
"change-init",
|
|
42
|
+
"commit-lint",
|
|
34
43
|
"parity",
|
|
35
44
|
"policy",
|
|
36
45
|
"pr-closing-keywords",
|
|
@@ -46,6 +55,7 @@ export const CLI_MODULE_VERBS = [
|
|
|
46
55
|
"release-publish",
|
|
47
56
|
"release-rollback",
|
|
48
57
|
"scope-lifecycle",
|
|
58
|
+
"session-start",
|
|
49
59
|
"slice",
|
|
50
60
|
"subagent-monitor",
|
|
51
61
|
"toolchain-check",
|
|
@@ -120,6 +130,7 @@ export const CORE_MODULE_VERBS = [
|
|
|
120
130
|
"pack-migrate-patterns",
|
|
121
131
|
"pack-migrate-swarm-spec",
|
|
122
132
|
"policy-set",
|
|
133
|
+
"setup-ghx",
|
|
123
134
|
"scope-undo",
|
|
124
135
|
"scope-demote",
|
|
125
136
|
"scope-decompose",
|
|
@@ -163,7 +174,9 @@ export const VERB_ALIASES = {
|
|
|
163
174
|
"triage:accept": "triage-actions",
|
|
164
175
|
"triage:status": "triage-actions",
|
|
165
176
|
"agents:refresh": "agents-refresh",
|
|
166
|
-
"
|
|
177
|
+
"migrate:preflight": "migrate-preflight",
|
|
178
|
+
upgrade: "install-upgrade",
|
|
179
|
+
"session:start": "session-start",
|
|
167
180
|
"toolchain:check": "toolchain-check",
|
|
168
181
|
"ts:check-lane": "ts-check-lane",
|
|
169
182
|
"spec:validate": "spec-validate",
|
|
@@ -172,6 +185,7 @@ export const VERB_ALIASES = {
|
|
|
172
185
|
"project:render": "project-render",
|
|
173
186
|
doctor: "doctor",
|
|
174
187
|
build: "framework-commands",
|
|
188
|
+
"setup:ghx": "setup-ghx",
|
|
175
189
|
};
|
|
176
190
|
/** CLI modules living under verify-source-cli/ or content-validate-cli/ subdirs. */
|
|
177
191
|
const SUBDIR_CLI_STEMS = {
|
|
@@ -1072,6 +1086,384 @@ function runPackMigrateSwarmSpec(argv, io) {
|
|
|
1072
1086
|
return 0;
|
|
1073
1087
|
}
|
|
1074
1088
|
// ===========================================================================
|
|
1089
|
+
// Native setup:ghx handler (#2022 Phase 1).
|
|
1090
|
+
//
|
|
1091
|
+
// Port of scripts/setup_ghx.py to native TypeScript: consent-gated ghx proxy
|
|
1092
|
+
// installer with three-state exit (0 ok / 1 install failure / 2 config error).
|
|
1093
|
+
// ===========================================================================
|
|
1094
|
+
/** Pinned ghx version — keep in lockstep with .github/workflows/ci.yml env.GHX_VERSION. */
|
|
1095
|
+
export const GHX_VERSION = "v1.5.1";
|
|
1096
|
+
export const INSTALL_PS1_URL = `https://raw.githubusercontent.com/brunoborges/ghx/${GHX_VERSION}/install.ps1`;
|
|
1097
|
+
export const INSTALL_SH_URL = `https://raw.githubusercontent.com/brunoborges/ghx/${GHX_VERSION}/install.sh`;
|
|
1098
|
+
function parseSetupGhxArgs(argv) {
|
|
1099
|
+
let yes = false;
|
|
1100
|
+
let check = false;
|
|
1101
|
+
for (const arg of argv) {
|
|
1102
|
+
if (arg === "--yes") {
|
|
1103
|
+
yes = true;
|
|
1104
|
+
}
|
|
1105
|
+
else if (arg === "--check") {
|
|
1106
|
+
check = true;
|
|
1107
|
+
}
|
|
1108
|
+
else {
|
|
1109
|
+
return { yes, check, error: `unrecognized argument: ${arg}` };
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
return { yes, check };
|
|
1113
|
+
}
|
|
1114
|
+
export function ghxPresent(whichFn = defaultWhich) {
|
|
1115
|
+
return whichFn("ghx") !== null;
|
|
1116
|
+
}
|
|
1117
|
+
export function detectSetupGhxHost() {
|
|
1118
|
+
if (process.platform === "win32")
|
|
1119
|
+
return "windows";
|
|
1120
|
+
if (process.platform === "darwin")
|
|
1121
|
+
return "darwin";
|
|
1122
|
+
if (process.platform === "linux")
|
|
1123
|
+
return "linux";
|
|
1124
|
+
return process.platform;
|
|
1125
|
+
}
|
|
1126
|
+
function readConsentLineFromStdin() {
|
|
1127
|
+
const buf = Buffer.alloc(256);
|
|
1128
|
+
try {
|
|
1129
|
+
const n = readSync(0, buf, 0, 256, null);
|
|
1130
|
+
if (n === null || n <= 0)
|
|
1131
|
+
return "";
|
|
1132
|
+
return buf.toString("utf8", 0, n);
|
|
1133
|
+
}
|
|
1134
|
+
catch {
|
|
1135
|
+
return "";
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
export function promptSetupGhxConsent(io, readLine = readConsentLineFromStdin) {
|
|
1139
|
+
io.writeOut("\n[setup_ghx] ghx is the recommended GitHub CLI cache proxy for deft " +
|
|
1140
|
+
"maintainers (prevents rate-limiting in multi-agent swarms; speeds up " +
|
|
1141
|
+
"scm:* calls). Consumer projects only require gh.\n");
|
|
1142
|
+
io.writeOut(`[setup_ghx] Upstream: https://github.com/brunoborges/ghx (${GHX_VERSION})\n`);
|
|
1143
|
+
io.writeOut("[setup_ghx] Install ghx via the upstream installer? [y/N]: ");
|
|
1144
|
+
const answer = readLine().trim().toLowerCase();
|
|
1145
|
+
return answer === "y" || answer === "yes";
|
|
1146
|
+
}
|
|
1147
|
+
export function buildSetupGhxInstallCommand(host, whichFn = defaultWhich) {
|
|
1148
|
+
if (host === "windows") {
|
|
1149
|
+
const psBin = whichFn("pwsh") ?? whichFn("powershell") ?? "powershell";
|
|
1150
|
+
return [
|
|
1151
|
+
psBin,
|
|
1152
|
+
"-NoProfile",
|
|
1153
|
+
"-ExecutionPolicy",
|
|
1154
|
+
"Bypass",
|
|
1155
|
+
"-Command",
|
|
1156
|
+
`irm ${INSTALL_PS1_URL} | iex`,
|
|
1157
|
+
];
|
|
1158
|
+
}
|
|
1159
|
+
if (host === "darwin" || host === "linux") {
|
|
1160
|
+
return ["bash", "-c", `curl -fsSL ${INSTALL_SH_URL} | bash`];
|
|
1161
|
+
}
|
|
1162
|
+
throw new Error(`no upstream ghx installer available for host '${host}'; ` +
|
|
1163
|
+
"see https://github.com/brunoborges/ghx#install for manual options");
|
|
1164
|
+
}
|
|
1165
|
+
export function installSetupGhx(host, whichFn = defaultWhich, runner = spawnSync) {
|
|
1166
|
+
const cmd = buildSetupGhxInstallCommand(host, whichFn);
|
|
1167
|
+
const proc = runner(cmd[0] ?? "", cmd.slice(1), {
|
|
1168
|
+
env: { ...process.env, GHX_VERSION },
|
|
1169
|
+
stdio: "inherit",
|
|
1170
|
+
});
|
|
1171
|
+
return proc.status ?? 1;
|
|
1172
|
+
}
|
|
1173
|
+
/** Native `setup:ghx` handler (replaces scripts/setup_ghx.py shell-out, #2022 Phase 1). */
|
|
1174
|
+
export function runSetupGhx(argv, io, deps = {}) {
|
|
1175
|
+
const args = parseSetupGhxArgs(argv);
|
|
1176
|
+
if (args.error !== undefined) {
|
|
1177
|
+
io.writeErr(`setup-ghx: ${args.error}\n`);
|
|
1178
|
+
return 2;
|
|
1179
|
+
}
|
|
1180
|
+
if (args.yes && args.check) {
|
|
1181
|
+
io.writeErr("[setup_ghx] error: --yes and --check are mutually exclusive.\n");
|
|
1182
|
+
return 2;
|
|
1183
|
+
}
|
|
1184
|
+
const whichFn = deps.whichFn ?? defaultWhich;
|
|
1185
|
+
if (ghxPresent(whichFn)) {
|
|
1186
|
+
io.writeOut("[setup_ghx] ghx already on PATH -- skipping install.\n");
|
|
1187
|
+
return 0;
|
|
1188
|
+
}
|
|
1189
|
+
if (args.check) {
|
|
1190
|
+
if (whichFn("gh") !== null) {
|
|
1191
|
+
io.writeOut("[setup_ghx] gh is on PATH but ghx is not; ghx is the recommended GitHub CLI " +
|
|
1192
|
+
"cache proxy. Install with `directive setup:ghx` (or `task setup:ghx`). Refs #884.\n");
|
|
1193
|
+
}
|
|
1194
|
+
else {
|
|
1195
|
+
io.writeOut("[setup_ghx] ghx not on PATH; recommended for speed -- run `directive setup:ghx` " +
|
|
1196
|
+
"to opt in. Consumer projects only require gh. Refs #884.\n");
|
|
1197
|
+
}
|
|
1198
|
+
return 0;
|
|
1199
|
+
}
|
|
1200
|
+
let consent;
|
|
1201
|
+
if (args.yes) {
|
|
1202
|
+
consent = true;
|
|
1203
|
+
io.writeOut("[setup_ghx] --yes provided; skipping interactive consent prompt.\n");
|
|
1204
|
+
}
|
|
1205
|
+
else {
|
|
1206
|
+
const skip = (process.env.DEFT_SETUP_GHX_SKIP ?? "").trim();
|
|
1207
|
+
if (skip === "1" || skip.toLowerCase() === "true" || skip.toLowerCase() === "yes") {
|
|
1208
|
+
io.writeOut("[setup_ghx] DEFT_SETUP_GHX_SKIP set; skipping ghx install. Refs #884.\n");
|
|
1209
|
+
return 0;
|
|
1210
|
+
}
|
|
1211
|
+
const readLine = deps.readConsentLine ?? readConsentLineFromStdin;
|
|
1212
|
+
consent = promptSetupGhxConsent(io, readLine);
|
|
1213
|
+
}
|
|
1214
|
+
if (!consent) {
|
|
1215
|
+
io.writeOut("[setup_ghx] Skipping ghx install. ghx is recommended for speed for maintainers and " +
|
|
1216
|
+
"swarm runs; consumer projects only require gh " +
|
|
1217
|
+
"(see https://github.com/brunoborges/ghx, #884).\n");
|
|
1218
|
+
return 0;
|
|
1219
|
+
}
|
|
1220
|
+
const host = detectSetupGhxHost();
|
|
1221
|
+
const runInstall = deps.runInstall ?? ((h) => installSetupGhx(h, whichFn));
|
|
1222
|
+
try {
|
|
1223
|
+
const rc = runInstall(host);
|
|
1224
|
+
if (rc !== 0) {
|
|
1225
|
+
io.writeErr(`[setup_ghx] error: upstream installer exited ${rc}. ` +
|
|
1226
|
+
"See https://github.com/brunoborges/ghx#install for manual options.\n");
|
|
1227
|
+
return 1;
|
|
1228
|
+
}
|
|
1229
|
+
io.writeOut("[setup_ghx] ghx installed. Open a fresh shell so the updated PATH takes effect, " +
|
|
1230
|
+
"then re-run `task setup` to verify.\n");
|
|
1231
|
+
return 0;
|
|
1232
|
+
}
|
|
1233
|
+
catch (err) {
|
|
1234
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
1235
|
+
io.writeErr(`[setup_ghx] error: ${message}\n`);
|
|
1236
|
+
return 1;
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
// ===========================================================================
|
|
1240
|
+
// Native directive bootstrap launcher (#2022 Phase 4).
|
|
1241
|
+
//
|
|
1242
|
+
// Thin operator entry: deposit-if-absent, carry phase intent + deliberate
|
|
1243
|
+
// re-entry signal, then hand off to deft-directive-setup (agent-driven).
|
|
1244
|
+
// ===========================================================================
|
|
1245
|
+
export const SETUP_SKILL_REL_PATH = ".deft/core/skills/deft-directive-setup/SKILL.md";
|
|
1246
|
+
function bootstrapPhaseLabel(phase) {
|
|
1247
|
+
if (phase === 1)
|
|
1248
|
+
return "user";
|
|
1249
|
+
if (phase === 2)
|
|
1250
|
+
return "project";
|
|
1251
|
+
return "spec";
|
|
1252
|
+
}
|
|
1253
|
+
function resolveBootstrapUserMdPath() {
|
|
1254
|
+
const override = process.env.DEFT_USER_PATH?.trim();
|
|
1255
|
+
if (override)
|
|
1256
|
+
return resolve(override);
|
|
1257
|
+
return join(userConfigDir(), "USER.md");
|
|
1258
|
+
}
|
|
1259
|
+
function defaultBootstrapDeps() {
|
|
1260
|
+
return {
|
|
1261
|
+
deftCorePresent: (projectRoot) => isDirSafe(join(resolve(projectRoot), ".deft", "core")),
|
|
1262
|
+
userMdPresent: () => isFileSafe(resolveBootstrapUserMdPath()),
|
|
1263
|
+
projectDefPresent: (projectRoot) => isFileSafe(projectDefinitionPath(projectRoot)),
|
|
1264
|
+
runInitDeposit: async (projectRoot, io) => {
|
|
1265
|
+
const initArgs = parseInitArgv(["--yes", "--repo-root", projectRoot, "--json"], []);
|
|
1266
|
+
return runInitDepositCli({
|
|
1267
|
+
...initArgs,
|
|
1268
|
+
writeOut: io.writeOut,
|
|
1269
|
+
writeErr: io.writeErr,
|
|
1270
|
+
});
|
|
1271
|
+
},
|
|
1272
|
+
};
|
|
1273
|
+
}
|
|
1274
|
+
/** Parse `directive bootstrap` argv (#2022 Phase 4). */
|
|
1275
|
+
export function parseDirectiveBootstrapArgs(argv) {
|
|
1276
|
+
let projectRoot = ".";
|
|
1277
|
+
let jumpProject = false;
|
|
1278
|
+
let strategy = null;
|
|
1279
|
+
let reconfigure = false;
|
|
1280
|
+
let force = false;
|
|
1281
|
+
let json = false;
|
|
1282
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
1283
|
+
const arg = argv[i];
|
|
1284
|
+
if (arg === "--project") {
|
|
1285
|
+
jumpProject = true;
|
|
1286
|
+
}
|
|
1287
|
+
else if (arg === "--reconfigure") {
|
|
1288
|
+
reconfigure = true;
|
|
1289
|
+
}
|
|
1290
|
+
else if (arg === "--force") {
|
|
1291
|
+
force = true;
|
|
1292
|
+
}
|
|
1293
|
+
else if (arg === "--json") {
|
|
1294
|
+
json = true;
|
|
1295
|
+
}
|
|
1296
|
+
else if (arg === "--project-root") {
|
|
1297
|
+
const value = argv[i + 1];
|
|
1298
|
+
if (value === undefined) {
|
|
1299
|
+
return {
|
|
1300
|
+
projectRoot,
|
|
1301
|
+
jumpProject,
|
|
1302
|
+
strategy,
|
|
1303
|
+
reconfigure,
|
|
1304
|
+
force,
|
|
1305
|
+
json,
|
|
1306
|
+
error: "argument --project-root: expected one argument",
|
|
1307
|
+
};
|
|
1308
|
+
}
|
|
1309
|
+
projectRoot = value;
|
|
1310
|
+
i += 1;
|
|
1311
|
+
}
|
|
1312
|
+
else if (arg?.startsWith("--project-root=")) {
|
|
1313
|
+
projectRoot = arg.slice("--project-root=".length);
|
|
1314
|
+
}
|
|
1315
|
+
else if (arg === "--strategy") {
|
|
1316
|
+
const value = argv[i + 1];
|
|
1317
|
+
if (value === undefined) {
|
|
1318
|
+
return {
|
|
1319
|
+
projectRoot,
|
|
1320
|
+
jumpProject,
|
|
1321
|
+
strategy,
|
|
1322
|
+
reconfigure,
|
|
1323
|
+
force,
|
|
1324
|
+
json,
|
|
1325
|
+
error: "argument --strategy: expected one argument",
|
|
1326
|
+
};
|
|
1327
|
+
}
|
|
1328
|
+
strategy = value;
|
|
1329
|
+
i += 1;
|
|
1330
|
+
}
|
|
1331
|
+
else if (arg?.startsWith("--strategy=")) {
|
|
1332
|
+
strategy = arg.slice("--strategy=".length);
|
|
1333
|
+
}
|
|
1334
|
+
else if (arg === "--help" || arg === "-h") {
|
|
1335
|
+
return {
|
|
1336
|
+
projectRoot,
|
|
1337
|
+
jumpProject,
|
|
1338
|
+
strategy,
|
|
1339
|
+
reconfigure,
|
|
1340
|
+
force,
|
|
1341
|
+
json,
|
|
1342
|
+
error: "__help__",
|
|
1343
|
+
};
|
|
1344
|
+
}
|
|
1345
|
+
else {
|
|
1346
|
+
return {
|
|
1347
|
+
projectRoot,
|
|
1348
|
+
jumpProject,
|
|
1349
|
+
strategy,
|
|
1350
|
+
reconfigure,
|
|
1351
|
+
force,
|
|
1352
|
+
json,
|
|
1353
|
+
error: `unrecognized argument: ${arg}`,
|
|
1354
|
+
};
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
return {
|
|
1358
|
+
projectRoot: resolve(projectRoot),
|
|
1359
|
+
jumpProject,
|
|
1360
|
+
strategy,
|
|
1361
|
+
reconfigure,
|
|
1362
|
+
force,
|
|
1363
|
+
json,
|
|
1364
|
+
};
|
|
1365
|
+
}
|
|
1366
|
+
/** Resolve phase intent and deliberate re-entry signal from parsed args + on-disk state. */
|
|
1367
|
+
export function resolveDirectiveBootstrapPlan(args, deps) {
|
|
1368
|
+
let phase;
|
|
1369
|
+
if (args.jumpProject) {
|
|
1370
|
+
phase = 2;
|
|
1371
|
+
}
|
|
1372
|
+
else if (args.strategy !== null) {
|
|
1373
|
+
phase = 3;
|
|
1374
|
+
}
|
|
1375
|
+
else if (!deps.userMdPresent(args.projectRoot)) {
|
|
1376
|
+
phase = 1;
|
|
1377
|
+
}
|
|
1378
|
+
else if (!deps.projectDefPresent(args.projectRoot)) {
|
|
1379
|
+
phase = 2;
|
|
1380
|
+
}
|
|
1381
|
+
else {
|
|
1382
|
+
phase = 3;
|
|
1383
|
+
}
|
|
1384
|
+
let reEntry = "none";
|
|
1385
|
+
if (args.force) {
|
|
1386
|
+
reEntry = "force";
|
|
1387
|
+
}
|
|
1388
|
+
else if (args.reconfigure) {
|
|
1389
|
+
reEntry = "reconfigure";
|
|
1390
|
+
}
|
|
1391
|
+
else {
|
|
1392
|
+
const artifactExists = phase === 1
|
|
1393
|
+
? deps.userMdPresent(args.projectRoot)
|
|
1394
|
+
: phase === 2
|
|
1395
|
+
? deps.projectDefPresent(args.projectRoot)
|
|
1396
|
+
: deps.projectDefPresent(args.projectRoot);
|
|
1397
|
+
if (artifactExists) {
|
|
1398
|
+
reEntry = "prompt";
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
return {
|
|
1402
|
+
phase,
|
|
1403
|
+
phaseLabel: bootstrapPhaseLabel(phase),
|
|
1404
|
+
reEntry,
|
|
1405
|
+
strategy: args.strategy,
|
|
1406
|
+
};
|
|
1407
|
+
}
|
|
1408
|
+
function printDirectiveBootstrapHelp(io) {
|
|
1409
|
+
io.writeOut("Usage: directive bootstrap [--project-root <path>] [--project] [--strategy <name>] [--reconfigure] [--force] [--json]\n\n" +
|
|
1410
|
+
"Deposit the framework when absent, then hand off to deft-directive-setup.\n\n" +
|
|
1411
|
+
" --project Jump to Phase 2 (project configuration)\n" +
|
|
1412
|
+
" --strategy Jump to Phase 3 (scope vBRIEF / spec interview)\n" +
|
|
1413
|
+
" --reconfigure Deliberate re-entry — agent should reconfigure existing artifacts\n" +
|
|
1414
|
+
" --force Skip reconfigure-or-keep prompt; overwrite allowed\n" +
|
|
1415
|
+
" --json Emit structured handoff JSON on stdout\n");
|
|
1416
|
+
}
|
|
1417
|
+
function emitBootstrapHandoff(handoff, io, json) {
|
|
1418
|
+
if (json) {
|
|
1419
|
+
io.writeOut(`${JSON.stringify(handoff, null, 2)}\n`);
|
|
1420
|
+
return;
|
|
1421
|
+
}
|
|
1422
|
+
io.writeOut("[directive bootstrap] Setup launcher — hand off to deft-directive-setup\n\n");
|
|
1423
|
+
io.writeOut(`project_root: ${handoff.project_root}\n`);
|
|
1424
|
+
io.writeOut(`deposited: ${handoff.deposited}\n`);
|
|
1425
|
+
io.writeOut(`phase: ${handoff.phase} (${handoff.phase_label})\n`);
|
|
1426
|
+
io.writeOut(`re_entry: ${handoff.re_entry}\n`);
|
|
1427
|
+
if (handoff.strategy !== null) {
|
|
1428
|
+
io.writeOut(`strategy: ${handoff.strategy}\n`);
|
|
1429
|
+
}
|
|
1430
|
+
io.writeOut(`\nNext: Read and follow ${handoff.skill_path}\n`);
|
|
1431
|
+
}
|
|
1432
|
+
/** Native `directive bootstrap` handler (#2022 Phase 4). */
|
|
1433
|
+
export async function runDirectiveBootstrap(argv, io, deps = {}) {
|
|
1434
|
+
const merged = { ...defaultBootstrapDeps(), ...deps };
|
|
1435
|
+
const args = parseDirectiveBootstrapArgs(argv);
|
|
1436
|
+
if (args.error === "__help__") {
|
|
1437
|
+
printDirectiveBootstrapHelp(io);
|
|
1438
|
+
return 0;
|
|
1439
|
+
}
|
|
1440
|
+
if (args.error !== undefined) {
|
|
1441
|
+
io.writeErr(`directive bootstrap: ${args.error}\n`);
|
|
1442
|
+
return 2;
|
|
1443
|
+
}
|
|
1444
|
+
const plan = resolveDirectiveBootstrapPlan(args, merged);
|
|
1445
|
+
let deposited = false;
|
|
1446
|
+
if (!merged.deftCorePresent(args.projectRoot)) {
|
|
1447
|
+
const initCode = await merged.runInitDeposit(args.projectRoot, io);
|
|
1448
|
+
if (initCode !== 0) {
|
|
1449
|
+
return initCode;
|
|
1450
|
+
}
|
|
1451
|
+
deposited = true;
|
|
1452
|
+
}
|
|
1453
|
+
const handoff = {
|
|
1454
|
+
handoff: "deft-directive-setup",
|
|
1455
|
+
skill_path: SETUP_SKILL_REL_PATH,
|
|
1456
|
+
project_root: args.projectRoot,
|
|
1457
|
+
deposited,
|
|
1458
|
+
phase: plan.phase,
|
|
1459
|
+
phase_label: plan.phaseLabel,
|
|
1460
|
+
re_entry: plan.reEntry,
|
|
1461
|
+
strategy: plan.strategy,
|
|
1462
|
+
};
|
|
1463
|
+
emitBootstrapHandoff(handoff, io, args.json);
|
|
1464
|
+
return 0;
|
|
1465
|
+
}
|
|
1466
|
+
// ===========================================================================
|
|
1075
1467
|
// Native policy-set handler (#2022 Phase 1).
|
|
1076
1468
|
//
|
|
1077
1469
|
// Port of scripts/policy_set.py to native TypeScript so the typed-policy write
|
|
@@ -1604,6 +1996,8 @@ async function loadCoreModuleHandler(verb, io) {
|
|
|
1604
1996
|
return (argv) => runPackMigrateSwarmSpec(argv, io);
|
|
1605
1997
|
case "policy-set":
|
|
1606
1998
|
return (argv) => runPolicySet(argv, io);
|
|
1999
|
+
case "setup-ghx":
|
|
2000
|
+
return (argv) => runSetupGhx(argv, io);
|
|
1607
2001
|
case "scope-undo": {
|
|
1608
2002
|
const { undoMain } = await import("@deftai/directive-core/dist/scope/main.js");
|
|
1609
2003
|
return undoMain;
|
package/dist/doc-cli-parity.js
CHANGED
|
@@ -15,7 +15,7 @@ import { registeredVerbs, resolveCanonicalVerb, VERB_ALIASES } from "./dispatch.
|
|
|
15
15
|
export const LEGACY_DOC_VERB_KEYS = new Set(["setup", "upgrade", "relocate"]);
|
|
16
16
|
const CLI_PREFIX_RE = /^(?:directive|deft|npx @deftai\/directive)\s+/;
|
|
17
17
|
const BACKTICK_COMMAND_RE = /`((?:directive|deft|npx @deftai\/directive)\s+[^`]+)`/g;
|
|
18
|
-
const TOP_LEVEL_UX = new Set(["init", "update", "migrate"]);
|
|
18
|
+
const TOP_LEVEL_UX = new Set(["init", "update", "migrate", "bootstrap"]);
|
|
19
19
|
function repoRootFromModule() {
|
|
20
20
|
return resolve(import.meta.dirname, "..", "..", "..");
|
|
21
21
|
}
|
package/dist/doctor-parity.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ export interface ParityScenario {
|
|
|
11
11
|
readonly cwd?: string;
|
|
12
12
|
readonly env?: Record<string, string | undefined>;
|
|
13
13
|
readonly setup?: (root: string) => void;
|
|
14
|
+
/** When true, stdout may diverge (TS-only consumer probes post #2022 Phase 3). */
|
|
15
|
+
readonly exitCodeOnly?: boolean;
|
|
14
16
|
}
|
|
15
17
|
export interface ParityResult {
|
|
16
18
|
readonly ok: boolean;
|
|
@@ -27,7 +29,9 @@ export interface ParityResult {
|
|
|
27
29
|
export declare const PARITY_SCENARIOS: readonly ParityScenario[];
|
|
28
30
|
/** Normalise volatile lines while preserving doctor semantics. */
|
|
29
31
|
export declare function normaliseStdout(text: string): string;
|
|
30
|
-
export declare function diffParity(python: ScenarioResult, ts: ScenarioResult
|
|
32
|
+
export declare function diffParity(python: ScenarioResult, ts: ScenarioResult, options?: {
|
|
33
|
+
exitCodeOnly?: boolean;
|
|
34
|
+
}): {
|
|
31
35
|
exitMismatch: boolean;
|
|
32
36
|
stdoutMismatch: boolean;
|
|
33
37
|
pythonStdout: string;
|
package/dist/doctor-parity.js
CHANGED
|
@@ -18,6 +18,7 @@ export const PARITY_SCENARIOS = [
|
|
|
18
18
|
{
|
|
19
19
|
name: "full-json-consumer-fixture",
|
|
20
20
|
argv: ["--full", "--json"],
|
|
21
|
+
exitCodeOnly: true,
|
|
21
22
|
setup(root) {
|
|
22
23
|
writeFileSync(join(root, "AGENTS.md"), "<!-- deft:managed-section v3 -->\nbody\n<!-- /deft:managed-section -->\n", "utf8");
|
|
23
24
|
mkdirSync(join(root, ".deft", "core"), { recursive: true });
|
|
@@ -93,12 +94,12 @@ function runScenario(deftRoot, scenario) {
|
|
|
93
94
|
}
|
|
94
95
|
}
|
|
95
96
|
}
|
|
96
|
-
export function diffParity(python, ts) {
|
|
97
|
+
export function diffParity(python, ts, options = {}) {
|
|
97
98
|
const pythonStdout = normaliseStdout(python.stdout);
|
|
98
99
|
const tsStdout = normaliseStdout(ts.stdout);
|
|
99
100
|
return {
|
|
100
101
|
exitMismatch: python.exitCode !== ts.exitCode,
|
|
101
|
-
stdoutMismatch: pythonStdout !== tsStdout,
|
|
102
|
+
stdoutMismatch: options.exitCodeOnly ? false : pythonStdout !== tsStdout,
|
|
102
103
|
pythonStdout,
|
|
103
104
|
tsStdout,
|
|
104
105
|
};
|
|
@@ -112,7 +113,7 @@ export function runParity() {
|
|
|
112
113
|
name: scenario.name,
|
|
113
114
|
pythonExit: ran.python.exitCode,
|
|
114
115
|
tsExit: ran.ts.exitCode,
|
|
115
|
-
...diffParity(ran.python, ran.ts),
|
|
116
|
+
...diffParity(ran.python, ran.ts, { exitCodeOnly: scenario.exitCodeOnly }),
|
|
116
117
|
});
|
|
117
118
|
}
|
|
118
119
|
const ok = scenarios.every((s) => !s.exitMismatch && !s.stdoutMismatch);
|
|
@@ -22,8 +22,9 @@ export const INSTALL_CLI_TAIL_COVERAGE_MAP = [
|
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
pythonTest: "tests/cli/test_migrate_preflight.py",
|
|
25
|
-
classification: "
|
|
26
|
-
rationale: "scripts/migrate_preflight.py agent-side migrate:vbrief gate —
|
|
25
|
+
classification: "retarget",
|
|
26
|
+
rationale: "scripts/migrate_preflight.py agent-side migrate:vbrief gate — retargeted to deft-ts migrate-preflight on consumer task path (#2022 Phase 2).",
|
|
27
|
+
vitestSpec: "packages/cli/src/migrate-task-surface.test.ts",
|
|
27
28
|
},
|
|
28
29
|
{
|
|
29
30
|
pythonTest: "tests/cli/test_precutover_guard.py",
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { runInstallUninstall } from "@deftai/directive-core/task-surface";
|
|
5
|
+
function parseProjectRoot(argv) {
|
|
6
|
+
let projectRoot = ".";
|
|
7
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
8
|
+
const arg = argv[i] ?? "";
|
|
9
|
+
if (arg === "--project-root") {
|
|
10
|
+
const value = argv[i + 1];
|
|
11
|
+
if (value === undefined) {
|
|
12
|
+
return { projectRoot, error: "argument --project-root: expected one argument" };
|
|
13
|
+
}
|
|
14
|
+
projectRoot = value;
|
|
15
|
+
i += 1;
|
|
16
|
+
}
|
|
17
|
+
else if (arg.startsWith("--project-root=")) {
|
|
18
|
+
projectRoot = arg.slice("--project-root=".length);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
return { projectRoot, error: `unrecognized argument: ${arg}` };
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return { projectRoot };
|
|
25
|
+
}
|
|
26
|
+
export function run(argv) {
|
|
27
|
+
const args = parseProjectRoot(argv);
|
|
28
|
+
if (args.error !== undefined) {
|
|
29
|
+
process.stderr.write(`install-uninstall: ${args.error}\n`);
|
|
30
|
+
return 2;
|
|
31
|
+
}
|
|
32
|
+
return runInstallUninstall(resolve(args.projectRoot), {
|
|
33
|
+
writeOut: (text) => {
|
|
34
|
+
process.stdout.write(text);
|
|
35
|
+
},
|
|
36
|
+
writeErr: (text) => {
|
|
37
|
+
process.stderr.write(text);
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
42
|
+
process.exit(run(process.argv.slice(2)));
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=install-uninstall.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export interface ParsedInstallUpgradeArgs {
|
|
3
|
+
projectRoot: string;
|
|
4
|
+
frameworkRoot: string;
|
|
5
|
+
error?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function parseArgs(argv: readonly string[]): ParsedInstallUpgradeArgs;
|
|
8
|
+
export declare function run(argv: readonly string[]): number;
|
|
9
|
+
//# sourceMappingURL=install-upgrade.d.ts.map
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { runInstallUpgrade } from "@deftai/directive-core/install-upgrade";
|
|
5
|
+
export function parseArgs(argv) {
|
|
6
|
+
let projectRoot = ".";
|
|
7
|
+
let frameworkRoot = resolve(import.meta.dirname, "..", "..", "..");
|
|
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 {
|
|
14
|
+
projectRoot,
|
|
15
|
+
frameworkRoot,
|
|
16
|
+
error: "argument --project-root: expected one argument",
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
projectRoot = value;
|
|
20
|
+
i += 1;
|
|
21
|
+
}
|
|
22
|
+
else if (arg.startsWith("--project-root=")) {
|
|
23
|
+
projectRoot = arg.slice("--project-root=".length);
|
|
24
|
+
}
|
|
25
|
+
else if (arg === "--framework-root") {
|
|
26
|
+
const value = argv[i + 1];
|
|
27
|
+
if (value === undefined) {
|
|
28
|
+
return {
|
|
29
|
+
projectRoot,
|
|
30
|
+
frameworkRoot,
|
|
31
|
+
error: "argument --framework-root: expected one argument",
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
frameworkRoot = value;
|
|
35
|
+
i += 1;
|
|
36
|
+
}
|
|
37
|
+
else if (arg.startsWith("--framework-root=")) {
|
|
38
|
+
frameworkRoot = arg.slice("--framework-root=".length);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
return { projectRoot, frameworkRoot, error: `unrecognized argument: ${arg}` };
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (process.env.DEFT_ROOT && process.env.DEFT_ROOT.length > 0) {
|
|
45
|
+
frameworkRoot = process.env.DEFT_ROOT;
|
|
46
|
+
}
|
|
47
|
+
return { projectRoot, frameworkRoot };
|
|
48
|
+
}
|
|
49
|
+
export function run(argv) {
|
|
50
|
+
const args = parseArgs(argv);
|
|
51
|
+
if (args.error !== undefined) {
|
|
52
|
+
process.stderr.write(`install-upgrade: ${args.error}\n`);
|
|
53
|
+
return 2;
|
|
54
|
+
}
|
|
55
|
+
return runInstallUpgrade({ projectRoot: args.projectRoot, frameworkRoot: args.frameworkRoot }, {
|
|
56
|
+
writeOut: (text) => {
|
|
57
|
+
process.stdout.write(text);
|
|
58
|
+
},
|
|
59
|
+
writeErr: (text) => {
|
|
60
|
+
process.stderr.write(text);
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
65
|
+
process.exit(run(process.argv.slice(2)));
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=install-upgrade.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export interface ParsedMigratePreflightArgs {
|
|
3
|
+
projectRoot: string;
|
|
4
|
+
deftRoot: string;
|
|
5
|
+
quiet: boolean;
|
|
6
|
+
error?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function parseArgs(argv: readonly string[]): ParsedMigratePreflightArgs;
|
|
9
|
+
export declare function run(argv: readonly string[]): number;
|
|
10
|
+
//# sourceMappingURL=migrate-preflight.d.ts.map
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { emitMigratePreflight, runMigratePreflight, } from "@deftai/directive-core/migrate-preflight";
|
|
5
|
+
export function parseArgs(argv) {
|
|
6
|
+
let projectRoot = ".";
|
|
7
|
+
let deftRoot = resolve(import.meta.dirname, "..", "..", "..");
|
|
8
|
+
let quiet = false;
|
|
9
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
10
|
+
const arg = argv[i] ?? "";
|
|
11
|
+
if (arg === "--quiet") {
|
|
12
|
+
quiet = true;
|
|
13
|
+
}
|
|
14
|
+
else if (arg === "--project-root") {
|
|
15
|
+
const value = argv[i + 1];
|
|
16
|
+
if (value === undefined) {
|
|
17
|
+
return {
|
|
18
|
+
projectRoot,
|
|
19
|
+
deftRoot,
|
|
20
|
+
quiet,
|
|
21
|
+
error: "argument --project-root: expected one argument",
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
projectRoot = value;
|
|
25
|
+
i += 1;
|
|
26
|
+
}
|
|
27
|
+
else if (arg.startsWith("--project-root=")) {
|
|
28
|
+
projectRoot = arg.slice("--project-root=".length);
|
|
29
|
+
}
|
|
30
|
+
else if (arg === "--deft-root") {
|
|
31
|
+
const value = argv[i + 1];
|
|
32
|
+
if (value === undefined) {
|
|
33
|
+
return {
|
|
34
|
+
projectRoot,
|
|
35
|
+
deftRoot,
|
|
36
|
+
quiet,
|
|
37
|
+
error: "argument --deft-root: expected one argument",
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
deftRoot = value;
|
|
41
|
+
i += 1;
|
|
42
|
+
}
|
|
43
|
+
else if (arg.startsWith("--deft-root=")) {
|
|
44
|
+
deftRoot = arg.slice("--deft-root=".length);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
return { projectRoot, deftRoot, quiet, error: `unrecognized argument: ${arg}` };
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (process.env.DEFT_ROOT &&
|
|
51
|
+
process.env.DEFT_ROOT.length > 0 &&
|
|
52
|
+
!argv.some((a) => a.startsWith("--deft-root"))) {
|
|
53
|
+
deftRoot = process.env.DEFT_ROOT;
|
|
54
|
+
}
|
|
55
|
+
return { projectRoot, deftRoot, quiet };
|
|
56
|
+
}
|
|
57
|
+
export function run(argv) {
|
|
58
|
+
const args = parseArgs(argv);
|
|
59
|
+
if (args.error !== undefined) {
|
|
60
|
+
process.stderr.write(`migrate-preflight: ${args.error}\n`);
|
|
61
|
+
return 2;
|
|
62
|
+
}
|
|
63
|
+
const outcome = runMigratePreflight({
|
|
64
|
+
projectRoot: args.projectRoot,
|
|
65
|
+
deftRoot: args.deftRoot,
|
|
66
|
+
quiet: args.quiet,
|
|
67
|
+
});
|
|
68
|
+
if (outcome.kind === "config") {
|
|
69
|
+
process.stderr.write(`migrate-preflight: ${outcome.message}\n`);
|
|
70
|
+
return 2;
|
|
71
|
+
}
|
|
72
|
+
return emitMigratePreflight(outcome, {
|
|
73
|
+
writeOut: (text) => {
|
|
74
|
+
process.stdout.write(text);
|
|
75
|
+
},
|
|
76
|
+
writeErr: (text) => {
|
|
77
|
+
process.stderr.write(text);
|
|
78
|
+
},
|
|
79
|
+
}, args.quiet);
|
|
80
|
+
}
|
|
81
|
+
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
82
|
+
process.exit(run(process.argv.slice(2)));
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=migrate-preflight.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export interface ParsedSessionStartArgs {
|
|
3
|
+
projectRoot: string;
|
|
4
|
+
deferValues: string[];
|
|
5
|
+
emitJson: boolean;
|
|
6
|
+
noHistory: boolean;
|
|
7
|
+
error?: string;
|
|
8
|
+
}
|
|
9
|
+
/** Parse session:start CLI args, mirroring scripts/session_start.py. */
|
|
10
|
+
export declare function parseArgs(argv: readonly string[]): ParsedSessionStartArgs;
|
|
11
|
+
/** Native session:start handler (#2032 — replaces framework-commands Python bridge). */
|
|
12
|
+
export declare function run(argv: readonly string[]): number;
|
|
13
|
+
//# sourceMappingURL=session-start.d.ts.map
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { parseDeferrals, ritualStatePath, runSessionStart } from "@deftai/directive-core/session";
|
|
5
|
+
/** Parse session:start CLI args, mirroring scripts/session_start.py. */
|
|
6
|
+
export function parseArgs(argv) {
|
|
7
|
+
const parsed = {
|
|
8
|
+
projectRoot: ".",
|
|
9
|
+
deferValues: [],
|
|
10
|
+
emitJson: false,
|
|
11
|
+
noHistory: false,
|
|
12
|
+
};
|
|
13
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
14
|
+
const arg = argv[i];
|
|
15
|
+
if (arg === "--json") {
|
|
16
|
+
parsed.emitJson = true;
|
|
17
|
+
}
|
|
18
|
+
else if (arg === "--no-history") {
|
|
19
|
+
parsed.noHistory = 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 === "--defer") {
|
|
33
|
+
const value = argv[i + 1];
|
|
34
|
+
if (value === undefined) {
|
|
35
|
+
return { ...parsed, error: "argument --defer: expected one argument" };
|
|
36
|
+
}
|
|
37
|
+
parsed.deferValues.push(value);
|
|
38
|
+
i += 1;
|
|
39
|
+
}
|
|
40
|
+
else if (arg?.startsWith("--defer=")) {
|
|
41
|
+
parsed.deferValues.push(arg.slice("--defer=".length));
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
return { ...parsed, error: `unrecognized argument: ${arg}` };
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return parsed;
|
|
48
|
+
}
|
|
49
|
+
/** Native session:start handler (#2032 — replaces framework-commands Python bridge). */
|
|
50
|
+
export function run(argv) {
|
|
51
|
+
const args = parseArgs(argv);
|
|
52
|
+
if (args.error !== undefined) {
|
|
53
|
+
process.stderr.write(`session_start: ${args.error}\n`);
|
|
54
|
+
return 2;
|
|
55
|
+
}
|
|
56
|
+
const projectRoot = resolve(args.projectRoot);
|
|
57
|
+
const { deferrals, errors } = parseDeferrals(args.deferValues);
|
|
58
|
+
if (errors.length > 0) {
|
|
59
|
+
for (const error of errors) {
|
|
60
|
+
process.stderr.write(`${error}\n`);
|
|
61
|
+
}
|
|
62
|
+
return 2;
|
|
63
|
+
}
|
|
64
|
+
const capturedStdout = [];
|
|
65
|
+
const prevWrite = process.stdout.write.bind(process.stdout);
|
|
66
|
+
process.stdout.write = ((chunk, encoding, callback) => {
|
|
67
|
+
capturedStdout.push(String(chunk));
|
|
68
|
+
const cb = typeof encoding === "function" ? encoding : callback;
|
|
69
|
+
if (typeof cb === "function") {
|
|
70
|
+
cb();
|
|
71
|
+
}
|
|
72
|
+
return true;
|
|
73
|
+
});
|
|
74
|
+
let result;
|
|
75
|
+
try {
|
|
76
|
+
result = runSessionStart(projectRoot, {
|
|
77
|
+
deferrals,
|
|
78
|
+
writeHistory: !args.noHistory,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
finally {
|
|
82
|
+
process.stdout.write = prevWrite;
|
|
83
|
+
}
|
|
84
|
+
const lines = [...result.lines];
|
|
85
|
+
const stray = capturedStdout.join("").trim();
|
|
86
|
+
if (stray) {
|
|
87
|
+
lines.push(stray);
|
|
88
|
+
}
|
|
89
|
+
if (args.emitJson) {
|
|
90
|
+
const sorted = Object.keys(result.payload)
|
|
91
|
+
.sort()
|
|
92
|
+
.reduce((acc, key) => {
|
|
93
|
+
acc[key] = result.payload[key];
|
|
94
|
+
return acc;
|
|
95
|
+
}, {});
|
|
96
|
+
process.stdout.write(`${JSON.stringify(sorted)}\n`);
|
|
97
|
+
return result.code;
|
|
98
|
+
}
|
|
99
|
+
const sink = result.code === 0 ? process.stdout : process.stderr;
|
|
100
|
+
for (const line of lines) {
|
|
101
|
+
sink.write(`${line}\n`);
|
|
102
|
+
}
|
|
103
|
+
if (result.code === 0) {
|
|
104
|
+
process.stdout.write(`[deft] session ritual recorded at ${ritualStatePath(projectRoot)}\n`);
|
|
105
|
+
}
|
|
106
|
+
return result.code;
|
|
107
|
+
}
|
|
108
|
+
if (process.argv[1] !== undefined && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
109
|
+
process.exit(run(process.argv.slice(2)));
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=session-start.js.map
|
package/dist/toolchain-check.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
3
|
import { runToolchainCheck } from "@deftai/directive-core/verify-env";
|
|
4
|
-
export function run() {
|
|
5
|
-
const
|
|
4
|
+
export function run(argv = process.argv.slice(2)) {
|
|
5
|
+
const consumer = argv.includes("--consumer");
|
|
6
|
+
const result = runToolchainCheck(undefined, { consumer });
|
|
6
7
|
for (const line of result.lines) {
|
|
7
8
|
process.stdout.write(`${line}\n`);
|
|
8
9
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deftai/directive",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.60.0",
|
|
4
4
|
"description": "Directive CLI — npm install path for the Deft Directive framework.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"provenance": true
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@deftai/directive-core": "^0.
|
|
46
|
-
"@deftai/directive-content": "^0.
|
|
45
|
+
"@deftai/directive-core": "^0.60.0",
|
|
46
|
+
"@deftai/directive-content": "^0.60.0"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "tsc -b"
|