@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.
- package/lib/run/local_executor.js +6 -4
- package/lib/wizard.js +25 -4
- package/package.json +1 -1
|
@@ -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
|
|
43
|
-
//
|
|
44
|
-
//
|
|
45
|
-
|
|
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
|
|
282
|
-
//
|
|
283
|
-
|
|
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