@sahu-01/openpaw 1.0.2 → 1.0.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.
Files changed (2) hide show
  1. package/dist/index.js +20 -10
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -231066,12 +231066,24 @@ async function startGateway(config = {}) {
231066
231066
  if (processedFiles.length > 0) {
231067
231067
  console.log(`Decrypted ${processedFiles.length} auth-profiles.json file(s)`);
231068
231068
  }
231069
+ const isWindows = process.platform === "win32";
231070
+ const spawnOpenClaw = (command, args = []) => {
231071
+ if (isWindows) {
231072
+ return (0, import_child_process.spawn)("cmd.exe", ["/c", command, ...args], {
231073
+ stdio: "inherit",
231074
+ env: { ...process.env }
231075
+ });
231076
+ } else {
231077
+ return (0, import_child_process.spawn)(command, args, {
231078
+ stdio: "inherit",
231079
+ env: { ...process.env },
231080
+ shell: true
231081
+ });
231082
+ }
231083
+ };
231069
231084
  if (openclawBinary) {
231070
231085
  console.log(`Starting OpenClaw: ${openclawBinary}`);
231071
- openclawProcess = (0, import_child_process.spawn)(openclawBinary, [], {
231072
- stdio: "inherit",
231073
- env: { ...process.env }
231074
- });
231086
+ openclawProcess = spawnOpenClaw(openclawBinary);
231075
231087
  openclawProcess.on("exit", async (code) => {
231076
231088
  console.log(`OpenClaw exited with code ${code}`);
231077
231089
  await cleanup();
@@ -231080,14 +231092,11 @@ async function startGateway(config = {}) {
231080
231092
  openclawProcess.on("error", async (err) => {
231081
231093
  console.error(`Failed to start OpenClaw: ${err.message}`);
231082
231094
  await cleanup();
231095
+ process.exit(1);
231083
231096
  });
231084
231097
  } else {
231085
231098
  console.log("Starting OpenClaw via npx...");
231086
- openclawProcess = (0, import_child_process.spawn)("npx", ["openclaw"], {
231087
- stdio: "inherit",
231088
- env: { ...process.env },
231089
- shell: true
231090
- });
231099
+ openclawProcess = spawnOpenClaw("npx", ["openclaw"]);
231091
231100
  openclawProcess.on("exit", async (code) => {
231092
231101
  console.log(`OpenClaw exited with code ${code}`);
231093
231102
  await cleanup();
@@ -231095,7 +231104,8 @@ async function startGateway(config = {}) {
231095
231104
  });
231096
231105
  openclawProcess.on("error", async (err) => {
231097
231106
  console.error(`Failed to start OpenClaw: ${err.message}`);
231098
- console.log("OpenClaw not found. Gateway running in standalone mode.");
231107
+ await cleanup();
231108
+ process.exit(1);
231099
231109
  });
231100
231110
  }
231101
231111
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sahu-01/openpaw",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "OpenPaw CLI - Security-first wrapper for AI agents",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",