staklink 0.4.24 → 0.4.26

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.
@@ -60927,7 +60927,7 @@ var SSEManager = class {
60927
60927
  var sseManager = new SSEManager();
60928
60928
 
60929
60929
  // src/proxy/version.ts
60930
- var VERSION = "0.4.24";
60930
+ var VERSION = "0.4.26";
60931
60931
 
60932
60932
  // node_modules/uuid/dist/esm/stringify.js
60933
60933
  var byteToHex = [];
@@ -61046,6 +61046,7 @@ function isReqTypeBusy(req_type) {
61046
61046
 
61047
61047
  // src/agent/utils.ts
61048
61048
  var proc5 = __toESM(require("child_process"), 1);
61049
+ var COMMAND_TIMEOUT_MS = 30 * 60 * 1e3;
61049
61050
  async function executeCommand(command, cwd, env2, log_cb) {
61050
61051
  return new Promise((resolve4, reject) => {
61051
61052
  const child = proc5.spawn("sh", ["-c", command], {
@@ -61055,6 +61056,15 @@ async function executeCommand(command, cwd, env2, log_cb) {
61055
61056
  });
61056
61057
  let stdout = "";
61057
61058
  let stderr = "";
61059
+ let timedOut = false;
61060
+ const timeout = setTimeout(() => {
61061
+ timedOut = true;
61062
+ log_cb && log_cb(`\u23F1\uFE0F Command timed out after ${COMMAND_TIMEOUT_MS / 1e3}s, killing process`);
61063
+ child.kill("SIGTERM");
61064
+ setTimeout(() => {
61065
+ if (!child.killed) child.kill("SIGKILL");
61066
+ }, 5e3);
61067
+ }, COMMAND_TIMEOUT_MS);
61058
61068
  child.stdout?.on("data", (data) => {
61059
61069
  const output = data.toString();
61060
61070
  stdout += output;
@@ -61074,6 +61084,16 @@ async function executeCommand(command, cwd, env2, log_cb) {
61074
61084
  });
61075
61085
  });
61076
61086
  child.on("close", (code) => {
61087
+ clearTimeout(timeout);
61088
+ if (timedOut) {
61089
+ const error88 = new Error(
61090
+ `Command timed out after ${COMMAND_TIMEOUT_MS / 1e3}s`
61091
+ );
61092
+ log_cb && log_cb(`\u274C Error: ${error88.message}`);
61093
+ reject(`${error88.message}
61094
+ ${stderr}`);
61095
+ return;
61096
+ }
61077
61097
  if (code === 0) {
61078
61098
  resolve4({ stdout, stderr });
61079
61099
  } else {
@@ -61084,6 +61104,7 @@ ${stderr}`);
61084
61104
  }
61085
61105
  });
61086
61106
  child.on("error", (error88) => {
61107
+ clearTimeout(timeout);
61087
61108
  const errorMsg = error88.message || String(error88);
61088
61109
  log_cb && log_cb(`\u274C Error: ${errorMsg}`);
61089
61110
  reject(`${errorMsg}
@@ -11004,7 +11004,7 @@ var glob = Object.assign(glob_, {
11004
11004
  glob.glob = glob;
11005
11005
 
11006
11006
  // src/proxy/version.ts
11007
- var VERSION = "0.4.24";
11007
+ var VERSION = "0.4.26";
11008
11008
 
11009
11009
  // src/deps.ts
11010
11010
  var import_child_process = require("child_process");
@@ -11101,7 +11101,7 @@ async function ensureSkillInstalled(skillName, repo) {
11101
11101
  }
11102
11102
  console.log(`\u{1F4E6} Installing ${skillName} skill...`);
11103
11103
  try {
11104
- await execAsync(`npx skills add ${repo} --skill ${skillName} -g -y`);
11104
+ await execAsync(`npx -y skills add ${repo} --skill ${skillName} -g -y`);
11105
11105
  console.log(`\u2705 Skill "${skillName}" installed successfully`);
11106
11106
  } catch (error2) {
11107
11107
  console.error(`\u26A0\uFE0F Failed to install ${skillName} skill:`, error2);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "staklink",
3
3
  "displayName": "staklink",
4
4
  "description": "staklink process manager",
5
- "version": "0.4.24",
5
+ "version": "0.4.26",
6
6
  "type": "module",
7
7
  "publisher": "stakwork",
8
8
  "engines": {