robot-resources 1.12.1 → 1.12.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/non-oc-wizard.js +24 -1
- package/package.json +1 -1
package/lib/non-oc-wizard.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { select } from '@inquirer/prompts';
|
|
4
|
-
import { isClaudeCodeInstalled, isCursorInstalled } from './detect.js';
|
|
4
|
+
import { isClaudeCodeInstalled, isCursorInstalled, detectAgentRuntime } from './detect.js';
|
|
5
5
|
import { configureClaudeCode, configureCursor } from './tool-config.js';
|
|
6
6
|
import { header, info, success, warn, blank } from './ui.js';
|
|
7
7
|
import { readConfig } from './config.mjs';
|
|
@@ -223,6 +223,29 @@ export async function runNonOcWizard({ nonInteractive = false, target = null } =
|
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
if (nonInteractive) {
|
|
226
|
+
// Phase 3.5: when project shape is unambiguous (cwd has a package.json
|
|
227
|
+
// OR a Python project file), auto-install the matching shim instead of
|
|
228
|
+
// bailing with a hint. CI/agents running `npx robot-resources` from
|
|
229
|
+
// their repo are exactly this case — making them pass `--for=` is
|
|
230
|
+
// friction we don't need.
|
|
231
|
+
//
|
|
232
|
+
// The Phase 3 noninteractive_no_target path is preserved for the case
|
|
233
|
+
// where detection finds nothing (truly empty cwd, generic shell run).
|
|
234
|
+
const runtime = detectAgentRuntime();
|
|
235
|
+
let autoTarget = null;
|
|
236
|
+
if (runtime.kind === 'node' || runtime.kind === 'both') autoTarget = 'js';
|
|
237
|
+
else if (runtime.kind === 'python') autoTarget = 'python';
|
|
238
|
+
|
|
239
|
+
if (autoTarget) {
|
|
240
|
+
// Brief context so the install step doesn't feel sudden.
|
|
241
|
+
info(`Detected a ${autoTarget === 'js' ? 'Node' : 'Python'} project — installing the matching shim automatically.`);
|
|
242
|
+
info(' Pass --for=<other> to override, or --uninstall to remove later.');
|
|
243
|
+
blank();
|
|
244
|
+
await runPath(autoTarget);
|
|
245
|
+
await emitPathChosen(autoTarget);
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
|
|
226
249
|
info('Robot Resources requires OpenClaw, which we did not detect on this machine.');
|
|
227
250
|
info('To bypass this prompt in CI / non-TTY contexts, re-run with --for=<target>:');
|
|
228
251
|
info(' npx robot-resources --for=langchain # JS/TS agent');
|