@probelabs/visor 0.1.97 → 0.1.98
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/README.md +14 -14
- package/defaults/.visor.yaml +3 -2
- package/dist/check-execution-engine.d.ts.map +1 -1
- package/dist/config.d.ts +5 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/defaults/.visor.yaml +3 -2
- package/dist/generated/config-schema.d.ts +6 -2
- package/dist/generated/config-schema.d.ts.map +1 -1
- package/dist/generated/config-schema.json +5 -2
- package/dist/index.js +69 -13
- package/dist/sdk/{check-execution-engine-S7BFPVWA.mjs → check-execution-engine-W5FLIWZL.mjs} +2 -2
- package/dist/sdk/{chunk-4VK6WTYU.mjs → chunk-POYXI3MQ.mjs} +2 -2
- package/dist/sdk/{chunk-4VK6WTYU.mjs.map → chunk-POYXI3MQ.mjs.map} +1 -1
- package/dist/sdk/sdk.d.mts +4 -2
- package/dist/sdk/sdk.d.ts +4 -2
- package/dist/sdk/sdk.js +48 -9
- package/dist/sdk/sdk.js.map +1 -1
- package/dist/sdk/sdk.mjs +49 -10
- package/dist/sdk/sdk.mjs.map +1 -1
- package/dist/types/config.d.ts +4 -2
- package/dist/types/config.d.ts.map +1 -1
- package/dist/utils/config-loader.d.ts +5 -0
- package/dist/utils/config-loader.d.ts.map +1 -1
- package/package.json +1 -1
- /package/dist/output/traces/{run-2025-10-19T14-24-36-341Z.ndjson → run-2025-10-19T19-05-29-328Z.ndjson} +0 -0
- /package/dist/output/traces/{run-2025-10-19T14-24-48-674Z.ndjson → run-2025-10-19T19-05-42-253Z.ndjson} +0 -0
- /package/dist/output/traces/{run-2025-10-19T14-24-49-238Z.ndjson → run-2025-10-19T19-05-42-805Z.ndjson} +0 -0
- /package/dist/output/traces/{run-2025-10-19T14-24-49-761Z.ndjson → run-2025-10-19T19-05-43-323Z.ndjson} +0 -0
- /package/dist/output/traces/{run-2025-10-19T14-24-50-279Z.ndjson → run-2025-10-19T19-05-43-841Z.ndjson} +0 -0
- /package/dist/sdk/{check-execution-engine-S7BFPVWA.mjs.map → check-execution-engine-W5FLIWZL.mjs.map} +0 -0
- /package/dist/traces/{run-2025-10-19T14-24-36-341Z.ndjson → run-2025-10-19T19-05-29-328Z.ndjson} +0 -0
- /package/dist/traces/{run-2025-10-19T14-24-48-674Z.ndjson → run-2025-10-19T19-05-42-253Z.ndjson} +0 -0
- /package/dist/traces/{run-2025-10-19T14-24-49-238Z.ndjson → run-2025-10-19T19-05-42-805Z.ndjson} +0 -0
- /package/dist/traces/{run-2025-10-19T14-24-49-761Z.ndjson → run-2025-10-19T19-05-43-323Z.ndjson} +0 -0
- /package/dist/traces/{run-2025-10-19T14-24-50-279Z.ndjson → run-2025-10-19T19-05-43-841Z.ndjson} +0 -0
package/dist/sdk/sdk.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CheckExecutionEngine
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-POYXI3MQ.mjs";
|
|
4
4
|
import "./chunk-YXOWIDEF.mjs";
|
|
5
5
|
import {
|
|
6
6
|
init_logger,
|
|
@@ -52,9 +52,13 @@ var init_config_schema = __esm({
|
|
|
52
52
|
],
|
|
53
53
|
description: 'Extends from other configurations - can be file path, HTTP(S) URL, or "default"'
|
|
54
54
|
},
|
|
55
|
+
steps: {
|
|
56
|
+
$ref: "#/definitions/Record%3Cstring%2CCheckConfig%3E",
|
|
57
|
+
description: "Step configurations (recommended)"
|
|
58
|
+
},
|
|
55
59
|
checks: {
|
|
56
60
|
$ref: "#/definitions/Record%3Cstring%2CCheckConfig%3E",
|
|
57
|
-
description: "Check configurations"
|
|
61
|
+
description: "Check configurations (legacy, use 'steps' instead) - always populated after normalization"
|
|
58
62
|
},
|
|
59
63
|
output: {
|
|
60
64
|
$ref: "#/definitions/OutputConfig",
|
|
@@ -109,7 +113,7 @@ var init_config_schema = __esm({
|
|
|
109
113
|
description: "Optional routing defaults for retry/goto/run policies"
|
|
110
114
|
}
|
|
111
115
|
},
|
|
112
|
-
required: ["version", "
|
|
116
|
+
required: ["version", "output"],
|
|
113
117
|
additionalProperties: false,
|
|
114
118
|
description: "Main Visor configuration",
|
|
115
119
|
patternProperties: {
|
|
@@ -1296,10 +1300,11 @@ var ConfigLoader = class {
|
|
|
1296
1300
|
if (defaultConfigPath && fs.existsSync(defaultConfigPath)) {
|
|
1297
1301
|
console.error(`\u{1F4E6} Loading bundled default configuration from ${defaultConfigPath}`);
|
|
1298
1302
|
const content = fs.readFileSync(defaultConfigPath, "utf8");
|
|
1299
|
-
|
|
1303
|
+
let config = yaml.load(content);
|
|
1300
1304
|
if (!config || typeof config !== "object") {
|
|
1301
1305
|
throw new Error("Invalid default configuration");
|
|
1302
1306
|
}
|
|
1307
|
+
config = this.normalizeStepsAndChecks(config);
|
|
1303
1308
|
if (config.extends) {
|
|
1304
1309
|
return await this.processExtends(config);
|
|
1305
1310
|
}
|
|
@@ -1430,6 +1435,20 @@ var ConfigLoader = class {
|
|
|
1430
1435
|
this.loadedConfigs.clear();
|
|
1431
1436
|
this.clearCache();
|
|
1432
1437
|
}
|
|
1438
|
+
/**
|
|
1439
|
+
* Normalize 'checks' and 'steps' keys for backward compatibility
|
|
1440
|
+
* Ensures both keys are present and contain the same data
|
|
1441
|
+
*/
|
|
1442
|
+
normalizeStepsAndChecks(config) {
|
|
1443
|
+
if (config.steps && config.checks) {
|
|
1444
|
+
config.checks = config.steps;
|
|
1445
|
+
} else if (config.steps && !config.checks) {
|
|
1446
|
+
config.checks = config.steps;
|
|
1447
|
+
} else if (config.checks && !config.steps) {
|
|
1448
|
+
config.steps = config.checks;
|
|
1449
|
+
}
|
|
1450
|
+
return config;
|
|
1451
|
+
}
|
|
1433
1452
|
};
|
|
1434
1453
|
|
|
1435
1454
|
// src/config.ts
|
|
@@ -1503,6 +1522,7 @@ var ConfigManager = class {
|
|
|
1503
1522
|
parsedConfig = merger.merge(mergedConfig, configWithoutExtends);
|
|
1504
1523
|
parsedConfig = merger.removeDisabledChecks(parsedConfig);
|
|
1505
1524
|
}
|
|
1525
|
+
parsedConfig = this.normalizeStepsAndChecks(parsedConfig);
|
|
1506
1526
|
if (validate) {
|
|
1507
1527
|
this.validateConfig(parsedConfig);
|
|
1508
1528
|
}
|
|
@@ -1569,7 +1589,9 @@ var ConfigManager = class {
|
|
|
1569
1589
|
async getDefaultConfig() {
|
|
1570
1590
|
return {
|
|
1571
1591
|
version: "1.0",
|
|
1592
|
+
steps: {},
|
|
1572
1593
|
checks: {},
|
|
1594
|
+
// Keep for backward compatibility
|
|
1573
1595
|
max_parallelism: 3,
|
|
1574
1596
|
output: {
|
|
1575
1597
|
pr_comment: {
|
|
@@ -1612,10 +1634,11 @@ var ConfigManager = class {
|
|
|
1612
1634
|
if (bundledConfigPath && fs2.existsSync(bundledConfigPath)) {
|
|
1613
1635
|
console.error(`\u{1F4E6} Loading bundled default configuration from ${bundledConfigPath}`);
|
|
1614
1636
|
const configContent = fs2.readFileSync(bundledConfigPath, "utf8");
|
|
1615
|
-
|
|
1637
|
+
let parsedConfig = yaml2.load(configContent);
|
|
1616
1638
|
if (!parsedConfig || typeof parsedConfig !== "object") {
|
|
1617
1639
|
return null;
|
|
1618
1640
|
}
|
|
1641
|
+
parsedConfig = this.normalizeStepsAndChecks(parsedConfig);
|
|
1619
1642
|
this.validateConfig(parsedConfig);
|
|
1620
1643
|
return this.mergeWithDefaults(parsedConfig);
|
|
1621
1644
|
}
|
|
@@ -1647,6 +1670,20 @@ var ConfigManager = class {
|
|
|
1647
1670
|
}
|
|
1648
1671
|
return null;
|
|
1649
1672
|
}
|
|
1673
|
+
/**
|
|
1674
|
+
* Normalize 'checks' and 'steps' keys for backward compatibility
|
|
1675
|
+
* Ensures both keys are present and contain the same data
|
|
1676
|
+
*/
|
|
1677
|
+
normalizeStepsAndChecks(config) {
|
|
1678
|
+
if (config.steps && config.checks) {
|
|
1679
|
+
config.checks = config.steps;
|
|
1680
|
+
} else if (config.steps && !config.checks) {
|
|
1681
|
+
config.checks = config.steps;
|
|
1682
|
+
} else if (config.checks && !config.steps) {
|
|
1683
|
+
config.steps = config.checks;
|
|
1684
|
+
}
|
|
1685
|
+
return config;
|
|
1686
|
+
}
|
|
1650
1687
|
/**
|
|
1651
1688
|
* Merge configuration with CLI options
|
|
1652
1689
|
*/
|
|
@@ -1702,13 +1739,15 @@ var ConfigManager = class {
|
|
|
1702
1739
|
message: "Missing required field: version"
|
|
1703
1740
|
});
|
|
1704
1741
|
}
|
|
1705
|
-
if (!config.checks) {
|
|
1742
|
+
if (!config.checks && !config.steps) {
|
|
1706
1743
|
errors.push({
|
|
1707
|
-
field: "checks",
|
|
1708
|
-
message:
|
|
1744
|
+
field: "checks/steps",
|
|
1745
|
+
message: 'Missing required field: either "checks" or "steps" must be defined. "steps" is recommended for new configurations.'
|
|
1709
1746
|
});
|
|
1710
|
-
}
|
|
1711
|
-
|
|
1747
|
+
}
|
|
1748
|
+
const checksToValidate = config.checks || config.steps;
|
|
1749
|
+
if (checksToValidate) {
|
|
1750
|
+
for (const [checkName, checkConfig] of Object.entries(checksToValidate)) {
|
|
1712
1751
|
if (!checkConfig.type) {
|
|
1713
1752
|
checkConfig.type = "ai";
|
|
1714
1753
|
}
|