@0dai-dev/cli 4.4.0 → 4.4.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.
@@ -39,10 +39,12 @@ function buildInvocation(agent, prompt, opts = {}) {
39
39
  args: ["exec", "--skip-git-repo-check", "--full-auto", prompt],
40
40
  };
41
41
  case "gemini":
42
- // gemini --approval-mode enum is default|auto_edit|yolo|plan ('auto' is
43
- // rejected). yolo = auto-approve all tools (write-capable), the mode a
44
- // headless task needs to actually make changes.
45
- return { bin: "gemini", args: ["--approval-mode", "yolo", "-p", prompt] };
42
+ // gemini --approval-mode enum is version-fragile: live gemini 0.44.1
43
+ // hard-errors on 'yolo' (accepts only default|auto_edit|plan; #4514). Use
44
+ // 'auto_edit' present wherever --approval-mode exists and write-capable
45
+ // for edit tools, so it's the cross-version-safe choice for a headless
46
+ // code task ('yolo' is not guaranteed on older builds, 'auto' is invalid).
47
+ return { bin: "gemini", args: ["--approval-mode", "auto_edit", "-p", prompt] };
46
48
  case "opencode":
47
49
  return { bin: "opencode", args: ["run", prompt] };
48
50
  case "qoder":
package/lib/wizard.js CHANGED
@@ -9,9 +9,24 @@
9
9
  const fs = require("fs");
10
10
  const path = require("path");
11
11
  const readline = require("readline");
12
- const { writeFiles, ensureLiveManifestDefaults } = require("./shared");
12
+ const { writeFiles, ensureLiveManifestDefaults, collectMetadata, detectStackHint } = require("./shared");
13
13
  const { loadCanonicalCounts, mcpToolsLabel } = require("./utils/canonical-counts");
14
14
 
15
+ // Offline stack resolution for the non-interactive path. Mirrors the
16
+ // `init --local --dry-run` preview (which uses detectStackHint) so the actual
17
+ // scaffold gets the SAME real stack instead of "unknown" (#4515). Returns
18
+ // [stack] for a confident detection, or [] when genuinely unknown (a generic
19
+ // library with no framework / language marker — honest, not a wrong guess).
20
+ function detectLocalStack(target) {
21
+ try {
22
+ const meta = collectMetadata(target);
23
+ const hint = detectStackHint(meta.projectFiles, meta.manifestContents);
24
+ return hint && hint !== "unknown" ? [hint] : [];
25
+ } catch {
26
+ return [];
27
+ }
28
+ }
29
+
15
30
  // ---------------------------------------------------------------------------
16
31
  // Helpers
17
32
  // ---------------------------------------------------------------------------
@@ -278,9 +293,14 @@ function stepNext(mode) {
278
293
  async function runWizard(target, options = {}) {
279
294
  const forceLocal = Boolean(options.forceLocal);
280
295
  if (!isInteractive()) {
281
- // Non-interactive: use defaults silently. A declared --template stack (#3931)
282
- // skips detection so the scaffold is stack-labeled instead of "unknown".
283
- stepGenerate(target, "all", options.stack ? [options.stack] : []);
296
+ // Non-interactive (CI / piped / headless `init --local`): a declared
297
+ // --template stack (#3931) wins; otherwise resolve the stack OFFLINE via
298
+ // detectStackHint (#4515) so the scaffold is labeled with the real stack
299
+ // (python-service, go-service, …) instead of "unknown". Previously this
300
+ // passed [] and never detected — the dry-run promised a stack the actual
301
+ // init didn't deliver.
302
+ const stack = options.stack ? [options.stack] : detectLocalStack(target);
303
+ stepGenerate(target, "all", stack);
284
304
  return { completed: true, interactive: false };
285
305
  }
286
306
 
@@ -360,6 +380,7 @@ module.exports = {
360
380
  needsWizard,
361
381
  isInteractive,
362
382
  stepGenerate,
383
+ detectLocalStack,
363
384
  detectProjectCommands,
364
385
  AGENTS,
365
386
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0dai-dev/cli",
3
- "version": "4.4.0",
3
+ "version": "4.4.1",
4
4
  "description": "One config layer for seven AI coding agents \u2014 Claude Code, Codex, OpenCode, Gemini, Aider, Qoder, Cursor",
5
5
  "bin": {
6
6
  "0dai": "./bin/0dai.js"