@probelabs/visor 0.1.83 → 0.1.84

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/sdk/sdk.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  CheckExecutionEngine,
3
3
  logger
4
- } from "./chunk-ROXFJUTY.mjs";
4
+ } from "./chunk-Q55L5EPS.mjs";
5
5
  import "./chunk-FIL2OGF6.mjs";
6
6
  import {
7
7
  ConfigMerger
@@ -250,8 +250,8 @@ var init_config_schema = __esm({
250
250
  description: "Condition to determine if check should run - runs if expression evaluates to true"
251
251
  },
252
252
  reuse_ai_session: {
253
- type: "boolean",
254
- description: "Whether to reuse AI session from dependency checks (only works with depends_on)"
253
+ type: ["string", "boolean"],
254
+ description: "Check name to reuse AI session from, or true to use first dependency (only works with depends_on)"
255
255
  },
256
256
  fail_if: {
257
257
  type: "string",
@@ -1576,7 +1576,7 @@ var ConfigManager = class {
1576
1576
  if (!checkConfig.type) {
1577
1577
  checkConfig.type = "ai";
1578
1578
  }
1579
- this.validateCheckConfig(checkName, checkConfig, errors);
1579
+ this.validateCheckConfig(checkName, checkConfig, errors, config);
1580
1580
  if (checkConfig.ai_mcp_servers) {
1581
1581
  this.validateMcpServersObject(
1582
1582
  checkConfig.ai_mcp_servers,
@@ -1676,7 +1676,7 @@ var ConfigManager = class {
1676
1676
  /**
1677
1677
  * Validate individual check configuration
1678
1678
  */
1679
- validateCheckConfig(checkName, checkConfig, errors) {
1679
+ validateCheckConfig(checkName, checkConfig, errors, config) {
1680
1680
  if (!checkConfig.type) {
1681
1681
  checkConfig.type = "ai";
1682
1682
  }
@@ -1757,12 +1757,23 @@ var ConfigManager = class {
1757
1757
  }
1758
1758
  }
1759
1759
  if (checkConfig.reuse_ai_session !== void 0) {
1760
- if (typeof checkConfig.reuse_ai_session !== "boolean") {
1760
+ const isString = typeof checkConfig.reuse_ai_session === "string";
1761
+ const isBoolean = typeof checkConfig.reuse_ai_session === "boolean";
1762
+ if (!isString && !isBoolean) {
1761
1763
  errors.push({
1762
1764
  field: `checks.${checkName}.reuse_ai_session`,
1763
- message: `Invalid reuse_ai_session value for "${checkName}": must be boolean`,
1765
+ message: `Invalid reuse_ai_session value for "${checkName}": must be string (check name) or boolean`,
1764
1766
  value: checkConfig.reuse_ai_session
1765
1767
  });
1768
+ } else if (isString) {
1769
+ const targetCheckName = checkConfig.reuse_ai_session;
1770
+ if (!config?.checks || !config.checks[targetCheckName]) {
1771
+ errors.push({
1772
+ field: `checks.${checkName}.reuse_ai_session`,
1773
+ message: `Check "${checkName}" references non-existent check "${targetCheckName}" for session reuse`,
1774
+ value: checkConfig.reuse_ai_session
1775
+ });
1776
+ }
1766
1777
  } else if (checkConfig.reuse_ai_session === true) {
1767
1778
  if (!checkConfig.depends_on || !Array.isArray(checkConfig.depends_on) || checkConfig.depends_on.length === 0) {
1768
1779
  errors.push({