@blockrun/clawrouter 0.8.1 → 0.8.3
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/dist/index.js +12 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3501,6 +3501,10 @@ function isCompletionMode() {
|
|
|
3501
3501
|
const args = process.argv;
|
|
3502
3502
|
return args.some((arg, i) => arg === "completion" && i >= 1 && i <= 3);
|
|
3503
3503
|
}
|
|
3504
|
+
function isInstallMode() {
|
|
3505
|
+
const args = process.argv;
|
|
3506
|
+
return args.some((arg) => arg === "plugins") && args.some((arg) => arg === "install" || arg === "uninstall");
|
|
3507
|
+
}
|
|
3504
3508
|
function injectModelsConfig(logger) {
|
|
3505
3509
|
const configDir = join5(homedir4(), ".openclaw");
|
|
3506
3510
|
const configPath = join5(configDir, "openclaw.json");
|
|
@@ -3925,18 +3929,21 @@ var plugin = {
|
|
|
3925
3929
|
}
|
|
3926
3930
|
}
|
|
3927
3931
|
});
|
|
3928
|
-
|
|
3929
|
-
|
|
3932
|
+
if (isInstallMode()) {
|
|
3933
|
+
api.logger.info("Installation mode \u2014 proxy will start when gateway runs");
|
|
3934
|
+
return;
|
|
3935
|
+
}
|
|
3936
|
+
startProxyInBackground(api).then(async () => {
|
|
3930
3937
|
const port = getProxyPort();
|
|
3931
|
-
const healthy = await waitForProxyHealth(port);
|
|
3938
|
+
const healthy = await waitForProxyHealth(port, 5e3);
|
|
3932
3939
|
if (!healthy) {
|
|
3933
3940
|
api.logger.warn(`Proxy health check timed out, commands may not work immediately`);
|
|
3934
3941
|
}
|
|
3935
|
-
}
|
|
3942
|
+
}).catch((err) => {
|
|
3936
3943
|
api.logger.error(
|
|
3937
3944
|
`Failed to start BlockRun proxy: ${err instanceof Error ? err.message : String(err)}`
|
|
3938
3945
|
);
|
|
3939
|
-
}
|
|
3946
|
+
});
|
|
3940
3947
|
}
|
|
3941
3948
|
};
|
|
3942
3949
|
var index_default = plugin;
|