@0dai-dev/cli 4.4.0 → 4.4.2
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/commands/init.js +2 -2
- package/lib/onboarding.js +1 -0
- package/lib/run/local_executor.js +6 -4
- package/lib/wizard.js +27 -4
- package/package.json +1 -1
package/lib/commands/init.js
CHANGED
|
@@ -696,8 +696,8 @@ async function cmdInit(target, args = []) {
|
|
|
696
696
|
console.log(` ${D}1.${R} Check health: ${D}0dai doctor${R}`);
|
|
697
697
|
if (agents.length > 0) {
|
|
698
698
|
const a = agents[0];
|
|
699
|
-
console.log(` ${D}2.${R}
|
|
700
|
-
console.log(` ${D}(${agents.join(", ")} detected —
|
|
699
|
+
console.log(` ${D}2.${R} Run a task now: ${D}0dai run "write tests for auth" --now${R}`);
|
|
700
|
+
console.log(` ${D}(${agents.join(", ")} detected — runs ${a} locally and prints a scored receipt; drop --now to just queue)${R}`);
|
|
701
701
|
} else {
|
|
702
702
|
console.log(` ${D}2.${R} Install an agent CLI to enable delegation:`);
|
|
703
703
|
console.log(` ${D}claude:${R} npm i -g @anthropic-ai/claude-code ${D}(or Pro subscription)${R}`);
|
package/lib/onboarding.js
CHANGED
|
@@ -44,6 +44,7 @@ function showWhatsNext(mode, isAuthed) {
|
|
|
44
44
|
console.log(" \u2705 0dai initialized! Your AI agents are configured.");
|
|
45
45
|
console.log("");
|
|
46
46
|
console.log(" What's next:");
|
|
47
|
+
console.log(" \u2610 0dai run \"add a test for X\" --now \u2014 run a task locally, get a scored receipt");
|
|
47
48
|
console.log(" \u2610 0dai status \u2014 check your config");
|
|
48
49
|
console.log(" \u2610 0dai doctor \u2014 verify everything works");
|
|
49
50
|
if (mode === "local" && !isAuthed) {
|
|
@@ -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
|
// ---------------------------------------------------------------------------
|
|
@@ -255,6 +270,7 @@ function stepNext(mode) {
|
|
|
255
270
|
console.log(" ✅ 0dai is ready!");
|
|
256
271
|
console.log("");
|
|
257
272
|
console.log(" Try these commands:");
|
|
273
|
+
console.log(" 0dai run \"...\" --now — run a task locally + get a scored receipt");
|
|
258
274
|
console.log(" 0dai status — see your project config");
|
|
259
275
|
console.log(" 0dai doctor — check config health");
|
|
260
276
|
if (mode === "cloud") {
|
|
@@ -278,9 +294,14 @@ function stepNext(mode) {
|
|
|
278
294
|
async function runWizard(target, options = {}) {
|
|
279
295
|
const forceLocal = Boolean(options.forceLocal);
|
|
280
296
|
if (!isInteractive()) {
|
|
281
|
-
// Non-interactive
|
|
282
|
-
//
|
|
283
|
-
|
|
297
|
+
// Non-interactive (CI / piped / headless `init --local`): a declared
|
|
298
|
+
// --template stack (#3931) wins; otherwise resolve the stack OFFLINE via
|
|
299
|
+
// detectStackHint (#4515) so the scaffold is labeled with the real stack
|
|
300
|
+
// (python-service, go-service, …) instead of "unknown". Previously this
|
|
301
|
+
// passed [] and never detected — the dry-run promised a stack the actual
|
|
302
|
+
// init didn't deliver.
|
|
303
|
+
const stack = options.stack ? [options.stack] : detectLocalStack(target);
|
|
304
|
+
stepGenerate(target, "all", stack);
|
|
284
305
|
return { completed: true, interactive: false };
|
|
285
306
|
}
|
|
286
307
|
|
|
@@ -360,6 +381,8 @@ module.exports = {
|
|
|
360
381
|
needsWizard,
|
|
361
382
|
isInteractive,
|
|
362
383
|
stepGenerate,
|
|
384
|
+
stepNext,
|
|
385
|
+
detectLocalStack,
|
|
363
386
|
detectProjectCommands,
|
|
364
387
|
AGENTS,
|
|
365
388
|
};
|
package/package.json
CHANGED