yaver-cli 1.99.143 → 1.99.146
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/package.json +1 -1
- package/src/agent-runtime.js +8 -1
- package/src/index.js +8 -0
- package/src/postinstall.js +40 -0
package/package.json
CHANGED
package/src/agent-runtime.js
CHANGED
|
@@ -204,7 +204,7 @@ async function resolveSpawnSpec(args, options) {
|
|
|
204
204
|
function spawnAndWait(spawnSpec, args) {
|
|
205
205
|
const child = spawn(spawnSpec.command, spawnSpec.args, {
|
|
206
206
|
stdio: 'inherit',
|
|
207
|
-
env: process.env,
|
|
207
|
+
env: spawnSpec.env || process.env,
|
|
208
208
|
cwd: spawnSpec.cwd || process.cwd(),
|
|
209
209
|
});
|
|
210
210
|
|
|
@@ -416,10 +416,17 @@ function resolveLocalAgentCommand(agentArgs) {
|
|
|
416
416
|
const agentDir = path.join(repoRoot(), 'desktop', 'agent');
|
|
417
417
|
const goMod = path.join(agentDir, 'go.mod');
|
|
418
418
|
if (fs.existsSync(goMod)) {
|
|
419
|
+
// `go run` requires the module dir as cwd, so we chdir into agentDir
|
|
420
|
+
// for the Go toolchain itself. The compiled agent inherits that cwd
|
|
421
|
+
// and would lose the user's actual working directory — clobbering
|
|
422
|
+
// every command that resolves a project from os.Getwd() (wire push,
|
|
423
|
+
// wireless push, code, etc.). Pass it through as YAVER_USER_CWD so
|
|
424
|
+
// the agent can chdir back to it before any cwd-sensitive logic.
|
|
419
425
|
return {
|
|
420
426
|
command: 'go',
|
|
421
427
|
args: ['run', '.', ...agentArgs],
|
|
422
428
|
cwd: agentDir,
|
|
429
|
+
env: { ...process.env, YAVER_USER_CWD: process.cwd() },
|
|
423
430
|
};
|
|
424
431
|
}
|
|
425
432
|
|
package/src/index.js
CHANGED
|
@@ -13,6 +13,8 @@ const PUSH_HELP = `
|
|
|
13
13
|
yaver push — Push existing React Native projects to the Yaver mobile host
|
|
14
14
|
|
|
15
15
|
Commands:
|
|
16
|
+
push ios [repo-or-project-dir] Discover iOS app, build IPA, upload to TestFlight
|
|
17
|
+
push android [repo-or-project-dir] Discover Android app, build AAB, upload to Play internal testing
|
|
16
18
|
init Analyze project, show compatibility, create yaver.json
|
|
17
19
|
push [--device <ip>] [--watch] Bundle + validate + push to device
|
|
18
20
|
push --ignore-missing Push even with missing native modules
|
|
@@ -42,6 +44,8 @@ Agent commands:
|
|
|
42
44
|
|
|
43
45
|
Push-to-device commands:
|
|
44
46
|
yaver push Bundle + validate + push current RN/Expo project
|
|
47
|
+
yaver push ios Discover iOS app in the repo, build IPA, upload to TestFlight
|
|
48
|
+
yaver push android Discover Android app in the repo, build AAB, upload to Play internal testing
|
|
45
49
|
yaver push init Analyze current project and create yaver.json
|
|
46
50
|
yaver push doctor Deep compatibility report for current project
|
|
47
51
|
yaver push modules List native modules compiled into the mobile host
|
|
@@ -131,6 +135,10 @@ async function runUnified(args) {
|
|
|
131
135
|
|
|
132
136
|
if (command === 'push') {
|
|
133
137
|
const next = args[1];
|
|
138
|
+
if (next === 'ios' || next === 'android') {
|
|
139
|
+
await runAgentCommand(args);
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
134
142
|
if (!next || next.startsWith('-')) {
|
|
135
143
|
await runPushCli(['push', ...args.slice(1)]);
|
|
136
144
|
return;
|
package/src/postinstall.js
CHANGED
|
@@ -49,6 +49,21 @@ function commandExists(name) {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
function npmGlobalBinDir() {
|
|
53
|
+
const prefix = (process.env.npm_config_prefix || "").trim();
|
|
54
|
+
if (!prefix) return "";
|
|
55
|
+
return path.join(prefix, "bin");
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function addNpmGlobalBinToProcessPath() {
|
|
59
|
+
const binDir = npmGlobalBinDir();
|
|
60
|
+
if (!binDir) return;
|
|
61
|
+
const current = (process.env.PATH || "").split(path.delimiter);
|
|
62
|
+
if (!current.includes(binDir)) {
|
|
63
|
+
process.env.PATH = `${binDir}${path.delimiter}${process.env.PATH || ""}`;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
52
67
|
function installMissingCodingRunners() {
|
|
53
68
|
const missing = CODING_RUNNER_BOOTSTRAP.filter((entry) => !commandExists(entry.command));
|
|
54
69
|
if (missing.length === 0) {
|
|
@@ -64,12 +79,34 @@ function installMissingCodingRunners() {
|
|
|
64
79
|
`"${npmCmd}" install -g --no-fund --no-audit ${packages.join(" ")}`,
|
|
65
80
|
{ stdio: "inherit" },
|
|
66
81
|
);
|
|
82
|
+
addNpmGlobalBinToProcessPath();
|
|
67
83
|
log(`Installed missing coding runners: ${labels}.`);
|
|
68
84
|
} catch (error) {
|
|
69
85
|
log(`Skipping coding runner bootstrap: ${error.message}`);
|
|
70
86
|
}
|
|
71
87
|
}
|
|
72
88
|
|
|
89
|
+
async function setupMCPForInstalledRunners() {
|
|
90
|
+
const targets = [
|
|
91
|
+
{ command: "claude", client: "claude-code", label: "Claude Code" },
|
|
92
|
+
{ command: "codex", client: "codex", label: "Codex" },
|
|
93
|
+
{ command: "opencode", client: "opencode", label: "OpenCode" },
|
|
94
|
+
];
|
|
95
|
+
const configured = [];
|
|
96
|
+
for (const target of targets) {
|
|
97
|
+
if (!commandExists(target.command)) continue;
|
|
98
|
+
try {
|
|
99
|
+
await runAgentCommand(["mcp", "setup", target.client], { quiet: true });
|
|
100
|
+
configured.push(target.label);
|
|
101
|
+
} catch (error) {
|
|
102
|
+
log(`Skipping MCP setup for ${target.label}: ${error.message}`);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if (configured.length > 0) {
|
|
106
|
+
log(`Registered Yaver MCP in: ${configured.join(", ")}.`);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
73
110
|
// ensureLinuxHermescBuildDeps installs the apt packages required to
|
|
74
111
|
// compile hermesc from facebook/hermes sources on linux/arm64 (no
|
|
75
112
|
// upstream prebuilt exists for that arch). Best-effort; only runs as
|
|
@@ -281,6 +318,7 @@ async function main() {
|
|
|
281
318
|
}
|
|
282
319
|
|
|
283
320
|
ensurePathOnUnix();
|
|
321
|
+
addNpmGlobalBinToProcessPath();
|
|
284
322
|
ensureLinuxRunnerSandboxPackages();
|
|
285
323
|
ensureLinuxRunnerSandboxSupport();
|
|
286
324
|
reportLinuxRunnerSandboxStatus();
|
|
@@ -291,6 +329,7 @@ async function main() {
|
|
|
291
329
|
if (envEnabled("YAVER_SKIP_POSTINSTALL_MOBILE")) {
|
|
292
330
|
if (!envEnabled("YAVER_SKIP_POSTINSTALL_RUNNERS")) {
|
|
293
331
|
installMissingCodingRunners();
|
|
332
|
+
await setupMCPForInstalledRunners();
|
|
294
333
|
}
|
|
295
334
|
return;
|
|
296
335
|
}
|
|
@@ -317,6 +356,7 @@ async function main() {
|
|
|
317
356
|
|
|
318
357
|
if (!envEnabled("YAVER_SKIP_POSTINSTALL_RUNNERS")) {
|
|
319
358
|
installMissingCodingRunners();
|
|
359
|
+
await setupMCPForInstalledRunners();
|
|
320
360
|
}
|
|
321
361
|
|
|
322
362
|
// Vibe Preview tool stack — best-effort provisioning so a fresh
|