@probelabs/visor 0.1.82 → 0.1.83

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.
@@ -248,6 +248,8 @@ interface CheckConfig {
248
248
  claude_code?: ClaudeCodeConfig;
249
249
  /** Environment variables for this check */
250
250
  env?: EnvConfig;
251
+ /** Timeout in seconds for command execution (default: 60) */
252
+ timeout?: number;
251
253
  /** Check IDs that this check depends on (optional) */
252
254
  depends_on?: string[];
253
255
  /** Group name for comment separation (e.g., "code-review", "pr-overview") - optional */
package/dist/sdk/sdk.d.ts CHANGED
@@ -248,6 +248,8 @@ interface CheckConfig {
248
248
  claude_code?: ClaudeCodeConfig;
249
249
  /** Environment variables for this check */
250
250
  env?: EnvConfig;
251
+ /** Timeout in seconds for command execution (default: 60) */
252
+ timeout?: number;
251
253
  /** Check IDs that this check depends on (optional) */
252
254
  depends_on?: string[];
253
255
  /** Group name for comment separation (e.g., "code-review", "pr-overview") - optional */
package/dist/sdk/sdk.js CHANGED
@@ -4316,6 +4316,16 @@ return ${returnTarget};
4316
4316
  return result;
4317
4317
  } catch (error) {
4318
4318
  const errorMessage = error instanceof Error ? error.message : "Unknown error";
4319
+ let isTimeout = false;
4320
+ if (error && typeof error === "object") {
4321
+ const execError = error;
4322
+ if (execError.killed && execError.signal === "SIGTERM") {
4323
+ isTimeout = true;
4324
+ }
4325
+ if (execError.code === "ETIMEDOUT") {
4326
+ isTimeout = true;
4327
+ }
4328
+ }
4319
4329
  let stderrOutput = "";
4320
4330
  if (error && typeof error === "object") {
4321
4331
  const execError = error;
@@ -4323,17 +4333,32 @@ return ${returnTarget};
4323
4333
  stderrOutput = execError.stderr.trim();
4324
4334
  }
4325
4335
  }
4326
- const detailedMessage = stderrOutput ? `Command execution failed: ${errorMessage}
4336
+ let detailedMessage;
4337
+ let ruleId;
4338
+ if (isTimeout) {
4339
+ const timeoutSeconds = config.timeout || 60;
4340
+ detailedMessage = `Command execution timed out after ${timeoutSeconds} seconds`;
4341
+ if (stderrOutput) {
4342
+ detailedMessage += `
4343
+
4344
+ Stderr output:
4345
+ ${stderrOutput}`;
4346
+ }
4347
+ ruleId = "command/timeout";
4348
+ } else {
4349
+ detailedMessage = stderrOutput ? `Command execution failed: ${errorMessage}
4327
4350
 
4328
4351
  Stderr output:
4329
4352
  ${stderrOutput}` : `Command execution failed: ${errorMessage}`;
4353
+ ruleId = "command/execution_error";
4354
+ }
4330
4355
  logger.error(`\u2717 ${detailedMessage}`);
4331
4356
  return {
4332
4357
  issues: [
4333
4358
  {
4334
4359
  file: "command",
4335
4360
  line: 0,
4336
- ruleId: "command/execution_error",
4361
+ ruleId,
4337
4362
  message: detailedMessage,
4338
4363
  severity: "error",
4339
4364
  category: "logic"
@@ -9368,6 +9393,10 @@ var init_config_schema = __esm({
9368
9393
  $ref: "#/definitions/EnvConfig",
9369
9394
  description: "Environment variables for this check"
9370
9395
  },
9396
+ timeout: {
9397
+ type: "number",
9398
+ description: "Timeout in seconds for command execution (default: 60)"
9399
+ },
9371
9400
  depends_on: {
9372
9401
  type: "array",
9373
9402
  items: {