@deftai/directive 0.119.4 → 0.119.6

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.
@@ -5,7 +5,7 @@
5
5
  import { readFileSync } from "node:fs";
6
6
  import { resolve } from "node:path";
7
7
  import { fileURLToPath } from "node:url";
8
- import { advancePlanSequence, clearPlanSequence, createPlanSequence, parsePlanSequence, readPlanSequence, writePlanSequence, } from "@deftai/directive-core/plan-sequence";
8
+ import { advancePlanSequence, clearPlanSequence, collectTerminalLifecycleOrigins, createPlanSequence, detectTerminalEntryDrift, parsePlanSequence, readPlanSequence, writePlanSequence, } from "@deftai/directive-core/plan-sequence";
9
9
  export function parseArgs(argv) {
10
10
  const parsed = {
11
11
  projectRoot: ".",
@@ -118,8 +118,25 @@ export function main(argv = process.argv.slice(2)) {
118
118
  process.stderr.write("No active ordered-plan sequence (.deft/plan-sequence.json missing).\n");
119
119
  return 1;
120
120
  }
121
+ const drift = detectTerminalEntryDrift(seq, collectTerminalLifecycleOrigins(root));
121
122
  if (parsed.emitJson) {
122
- process.stdout.write(`${JSON.stringify(seq, null, 2)}\n`);
123
+ if (drift.drifted) {
124
+ process.stdout.write(`${JSON.stringify({
125
+ ...seq,
126
+ terminal_lifecycle_drift: {
127
+ code: drift.code,
128
+ message: drift.message,
129
+ originPath: drift.originPath,
130
+ folder: drift.folder,
131
+ },
132
+ }, null, 2)}\n`);
133
+ }
134
+ else {
135
+ process.stdout.write(`${JSON.stringify(seq, null, 2)}\n`);
136
+ }
137
+ }
138
+ else if (drift.drifted) {
139
+ process.stderr.write(`${drift.message}\n`);
123
140
  }
124
141
  else {
125
142
  const cur = seq.exhausted ? null : seq.entries[seq.current_index];
@@ -132,7 +149,7 @@ export function main(argv = process.argv.slice(2)) {
132
149
  process.stdout.write("current: (exhausted — fresh approval required)\n");
133
150
  }
134
151
  }
135
- return 0;
152
+ return drift.drifted ? 1 : 0;
136
153
  }
137
154
  if (parsed.action === "clear") {
138
155
  const cleared = clearPlanSequence(root);
package/dist/policy.js CHANGED
@@ -274,7 +274,6 @@ export function parseArgs(argv) {
274
274
  host = parsedHost;
275
275
  }
276
276
  else if (arg === "--") {
277
- continue;
278
277
  }
279
278
  else {
280
279
  return makeSetError(`unrecognized argument: ${arg}`);
@@ -46,7 +46,7 @@ export function parseArgs(argv) {
46
46
  if (nextToken === "--help" || nextToken === "-h") {
47
47
  return { ...parsed, help: true };
48
48
  }
49
- if (nextToken !== undefined && nextToken.startsWith("-")) {
49
+ if (nextToken?.startsWith("-")) {
50
50
  return {
51
51
  ...parsed,
52
52
  error: "argument --vbrief-path: expected one argument",
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { resolve } from "node:path";
6
6
  import { fileURLToPath } from "node:url";
7
- import { readPlanSequence, verifyPlanTarget, } from "@deftai/directive-core/plan-sequence";
7
+ import { collectTerminalLifecycleOrigins, readPlanSequence, verifyPlanTarget, } from "@deftai/directive-core/plan-sequence";
8
8
  const KINDS = [
9
9
  "pr",
10
10
  "issue",
@@ -108,6 +108,7 @@ export function main(argv = process.argv.slice(2)) {
108
108
  const result = verifyPlanTarget(seq, {
109
109
  targetKind: parsed.targetKind,
110
110
  target: parsed.target,
111
+ terminalOrigins: collectTerminalLifecycleOrigins(resolve(parsed.projectRoot)),
111
112
  });
112
113
  if (parsed.emitJson) {
113
114
  process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deftai/directive",
3
- "version": "0.119.4",
3
+ "version": "0.119.6",
4
4
  "description": "Directive CLI — npm install path for the Deft Directive framework.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://deftai.github.io/directive/",
@@ -34,8 +34,8 @@
34
34
  "provenance": true
35
35
  },
36
36
  "dependencies": {
37
- "@deftai/directive-core": "^0.119.4",
38
- "@deftai/directive-content": "^0.119.4"
37
+ "@deftai/directive-core": "^0.119.6",
38
+ "@deftai/directive-content": "^0.119.6"
39
39
  },
40
40
  "scripts": {
41
41
  "build": "tsc -b"