@deftai/directive-content 0.73.1 → 0.74.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.
@@ -24,6 +24,22 @@ Legend (from RFC2119): !=MUST, ~=SHOULD, ≉=SHOULD NOT, ⊗=MUST NOT, ?=MAY.
24
24
  - User asks to create USER.md, PROJECT-DEFINITION.xbrief.json, or a specification
25
25
  - User clones a deft-enabled repo for the first time with no config
26
26
 
27
+ ## Consumer-first default (#1813)
28
+
29
+ ! Assume the operator is **using Deft in their project** (consumer path). Proceed directly to the Pre-Cutover Detection Guard and Phase 1 — do NOT open with a contributor-vs-consumer fork.
30
+
31
+ ~ The overwhelming majority of setup sessions are consumer installs; contributor onboarding is a separate, opt-in path (see below).
32
+
33
+ ## Contributor / framework-maintainer path (secondary)
34
+
35
+ ? Only enter this branch when the user **explicitly** says they are working on Deft itself (framework source checkout, `deftai/directive` clone, or maintainer tooling).
36
+
37
+ When that happens:
38
+
39
+ 1. ! Tell the user: "Contributor setup lives in [`CONTRIBUTING.md`](../../../CONTRIBUTING.md) and this repo's root [`AGENTS.md`](../../../AGENTS.md). Use the maintainer installer: `deft-install --yes --upgrade --maintainer --repo-root . --json`."
40
+ 2. ⊗ Continue the consumer USER.md / PROJECT-DEFINITION interview — the maintainer path does not use the first-session consumer flow.
41
+ 3. **Stop here** unless the user explicitly asks to continue with consumer setup anyway.
42
+
27
43
  ## Pre-Cutover Detection Guard
28
44
 
29
45
  ! Before proceeding with any setup phase, detect whether the project uses the pre-v0.20 document model and redirect to migration if so.
package/tasks/engine.yml CHANGED
@@ -28,12 +28,21 @@ tasks:
28
28
  process.exit(2);
29
29
  }
30
30
  const pkg=JSON.parse(fs.readFileSync(pkgPath,'utf8'));
31
+ // Cross-platform probe (#2415): do NOT use Unix `sh -c 'command -v'` —
32
+ // Windows native Task often has no `sh` on PATH, so Corepack.cmd was
33
+ // invisible after #2411. Prefer a direct spawn (POSIX / real binaries);
34
+ // fall back to shell:true so PATHEXT resolves .cmd/.exe on win32.
31
35
  const hasCmd=(name)=>{
32
36
  try{
33
- execFileSync('sh',['-c','command -v '+name],{stdio:'ignore'});
37
+ execFileSync(name,['--version'],{stdio:'ignore'});
34
38
  return true;
35
39
  }catch{
36
- return false;
40
+ try{
41
+ execFileSync(name,['--version'],{stdio:'ignore',shell:true});
42
+ return true;
43
+ }catch{
44
+ return false;
45
+ }
37
46
  }
38
47
  };
39
48
  const run=(cmd,args)=>{
@@ -100,12 +109,21 @@ tasks:
100
109
  const script='build';
101
110
  const pkgPath=root+'/package.json';
102
111
  const pkg=JSON.parse(fs.readFileSync(pkgPath,'utf8'));
112
+ // Cross-platform probe (#2415): do NOT use Unix `sh -c 'command -v'` —
113
+ // Windows native Task often has no `sh` on PATH, so Corepack.cmd was
114
+ // invisible after #2411. Prefer a direct spawn (POSIX / real binaries);
115
+ // fall back to shell:true so PATHEXT resolves .cmd/.exe on win32.
103
116
  const hasCmd=(name)=>{
104
117
  try{
105
- execFileSync('sh',['-c','command -v '+name],{stdio:'ignore'});
118
+ execFileSync(name,['--version'],{stdio:'ignore'});
106
119
  return true;
107
120
  }catch{
108
- return false;
121
+ try{
122
+ execFileSync(name,['--version'],{stdio:'ignore',shell:true});
123
+ return true;
124
+ }catch{
125
+ return false;
126
+ }
109
127
  }
110
128
  };
111
129
  const run=(cmd,args)=>{