@probelabs/visor 0.1.125 → 0.1.127

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 (82) hide show
  1. package/dist/ai-review-service.d.ts +1 -0
  2. package/dist/ai-review-service.d.ts.map +1 -1
  3. package/dist/config.d.ts.map +1 -1
  4. package/dist/docs/ai-configuration.md +23 -0
  5. package/dist/docs/slack-integration.md +6 -0
  6. package/dist/docs/workflows.md +30 -1
  7. package/dist/failure-condition-evaluator.d.ts.map +1 -1
  8. package/dist/frontends/slack-frontend.d.ts +2 -0
  9. package/dist/frontends/slack-frontend.d.ts.map +1 -1
  10. package/dist/generated/config-schema.d.ts +18 -6
  11. package/dist/generated/config-schema.d.ts.map +1 -1
  12. package/dist/generated/config-schema.json +18 -6
  13. package/dist/index.js +7138 -7865
  14. package/dist/liquid-extensions.d.ts.map +1 -1
  15. package/dist/output/traces/{run-2026-01-30T09-25-36-981Z.ndjson → run-2026-02-01T09-59-08-165Z.ndjson} +84 -84
  16. package/dist/output/traces/{run-2026-01-30T09-26-20-969Z.ndjson → run-2026-02-01T09-59-52-595Z.ndjson} +1015 -1015
  17. package/dist/providers/ai-check-provider.d.ts.map +1 -1
  18. package/dist/providers/command-check-provider.d.ts.map +1 -1
  19. package/dist/providers/custom-tool-executor.d.ts.map +1 -1
  20. package/dist/providers/http-client-provider.d.ts.map +1 -1
  21. package/dist/providers/mcp-check-provider.d.ts.map +1 -1
  22. package/dist/providers/memory-check-provider.d.ts.map +1 -1
  23. package/dist/providers/workflow-check-provider.d.ts.map +1 -1
  24. package/dist/sdk/{check-provider-registry-3KI5RKXT.mjs → check-provider-registry-CVUONJ5A.mjs} +8 -8
  25. package/dist/sdk/{chunk-7GUAFV6L.mjs → chunk-BHOKBQPB.mjs} +15 -10
  26. package/dist/sdk/chunk-BHOKBQPB.mjs.map +1 -0
  27. package/dist/sdk/{chunk-PXFIALUH.mjs → chunk-EORMDOZU.mjs} +19 -62
  28. package/dist/sdk/chunk-EORMDOZU.mjs.map +1 -0
  29. package/dist/sdk/{chunk-SWEEZ5D5.mjs → chunk-MPS4HVQI.mjs} +11 -77
  30. package/dist/sdk/chunk-MPS4HVQI.mjs.map +1 -0
  31. package/dist/sdk/{chunk-A4PGHURG.mjs → chunk-TS6BUNAI.mjs} +130 -75
  32. package/dist/sdk/chunk-TS6BUNAI.mjs.map +1 -0
  33. package/dist/sdk/{chunk-J6EVEXC2.mjs → chunk-VW2GBXQT.mjs} +56 -8
  34. package/dist/sdk/chunk-VW2GBXQT.mjs.map +1 -0
  35. package/dist/sdk/{chunk-RTKJXNZS.mjs → chunk-XWJPT5KQ.mjs} +26 -9
  36. package/dist/sdk/chunk-XWJPT5KQ.mjs.map +1 -0
  37. package/dist/sdk/{config-6CUVEH7H.mjs → config-DXX64GD3.mjs} +2 -2
  38. package/dist/sdk/{failure-condition-evaluator-HB35XRLZ.mjs → failure-condition-evaluator-G4HMJPXF.mjs} +3 -3
  39. package/dist/sdk/{github-frontend-BZ4N3BFZ.mjs → github-frontend-5PCKKHVC.mjs} +3 -3
  40. package/dist/sdk/{host-NYWXLIFC.mjs → host-H3AWNZ2F.mjs} +3 -3
  41. package/dist/sdk/{liquid-extensions-DFDEBMUI.mjs → liquid-extensions-I7O7KMHF.mjs} +3 -2
  42. package/dist/sdk/{routing-7FXPULTO.mjs → routing-QHTGDIXF.mjs} +4 -4
  43. package/dist/sdk/sdk.d.mts +6 -0
  44. package/dist/sdk/sdk.d.ts +6 -0
  45. package/dist/sdk/sdk.js +255 -214
  46. package/dist/sdk/sdk.js.map +1 -1
  47. package/dist/sdk/sdk.mjs +11 -11
  48. package/dist/sdk/{slack-frontend-J442FJWZ.mjs → slack-frontend-JUT3TYVC.mjs} +34 -6
  49. package/dist/sdk/slack-frontend-JUT3TYVC.mjs.map +1 -0
  50. package/dist/sdk/{workflow-check-provider-YUNNF4KC.mjs → workflow-check-provider-3IWBAZP7.mjs} +8 -8
  51. package/dist/sdk/{workflow-registry-6LZKCWHP.mjs → workflow-registry-KFWSDSLM.mjs} +2 -2
  52. package/dist/slack/socket-runner.d.ts +2 -0
  53. package/dist/slack/socket-runner.d.ts.map +1 -1
  54. package/dist/state-machine/dispatch/stats-manager.d.ts.map +1 -1
  55. package/dist/state-machine/states/routing.d.ts.map +1 -1
  56. package/dist/test-runner/index.d.ts.map +1 -1
  57. package/dist/test-runner/validator.d.ts.map +1 -1
  58. package/dist/traces/{run-2026-01-30T09-25-36-981Z.ndjson → run-2026-02-01T09-59-08-165Z.ndjson} +84 -84
  59. package/dist/traces/{run-2026-01-30T09-26-20-969Z.ndjson → run-2026-02-01T09-59-52-595Z.ndjson} +1015 -1015
  60. package/dist/types/config.d.ts +6 -0
  61. package/dist/types/config.d.ts.map +1 -1
  62. package/dist/utils/worktree-manager.d.ts.map +1 -1
  63. package/dist/workflow-executor.d.ts.map +1 -1
  64. package/dist/workflow-registry.d.ts +1 -0
  65. package/dist/workflow-registry.d.ts.map +1 -1
  66. package/package.json +5 -6
  67. package/dist/sdk/chunk-7GUAFV6L.mjs.map +0 -1
  68. package/dist/sdk/chunk-A4PGHURG.mjs.map +0 -1
  69. package/dist/sdk/chunk-J6EVEXC2.mjs.map +0 -1
  70. package/dist/sdk/chunk-PXFIALUH.mjs.map +0 -1
  71. package/dist/sdk/chunk-RTKJXNZS.mjs.map +0 -1
  72. package/dist/sdk/chunk-SWEEZ5D5.mjs.map +0 -1
  73. package/dist/sdk/slack-frontend-J442FJWZ.mjs.map +0 -1
  74. /package/dist/sdk/{check-provider-registry-3KI5RKXT.mjs.map → check-provider-registry-CVUONJ5A.mjs.map} +0 -0
  75. /package/dist/sdk/{config-6CUVEH7H.mjs.map → config-DXX64GD3.mjs.map} +0 -0
  76. /package/dist/sdk/{failure-condition-evaluator-HB35XRLZ.mjs.map → failure-condition-evaluator-G4HMJPXF.mjs.map} +0 -0
  77. /package/dist/sdk/{github-frontend-BZ4N3BFZ.mjs.map → github-frontend-5PCKKHVC.mjs.map} +0 -0
  78. /package/dist/sdk/{host-NYWXLIFC.mjs.map → host-H3AWNZ2F.mjs.map} +0 -0
  79. /package/dist/sdk/{liquid-extensions-DFDEBMUI.mjs.map → liquid-extensions-I7O7KMHF.mjs.map} +0 -0
  80. /package/dist/sdk/{routing-7FXPULTO.mjs.map → routing-QHTGDIXF.mjs.map} +0 -0
  81. /package/dist/sdk/{workflow-check-provider-YUNNF4KC.mjs.map → workflow-check-provider-3IWBAZP7.mjs.map} +0 -0
  82. /package/dist/sdk/{workflow-registry-6LZKCWHP.mjs.map → workflow-registry-KFWSDSLM.mjs.map} +0 -0
@@ -16,11 +16,11 @@ import {
16
16
  WorkflowRegistry,
17
17
  init_dependency_resolver,
18
18
  init_workflow_registry
19
- } from "./chunk-J6EVEXC2.mjs";
19
+ } from "./chunk-VW2GBXQT.mjs";
20
20
  import {
21
21
  config_exports,
22
22
  init_config
23
- } from "./chunk-RTKJXNZS.mjs";
23
+ } from "./chunk-XWJPT5KQ.mjs";
24
24
  import {
25
25
  getPromptStateManager,
26
26
  init_prompt_state
@@ -32,16 +32,11 @@ import {
32
32
  init_routing,
33
33
  init_snapshot_store,
34
34
  snapshot_store_exports
35
- } from "./chunk-PXFIALUH.mjs";
35
+ } from "./chunk-EORMDOZU.mjs";
36
36
  import {
37
37
  FailureConditionEvaluator,
38
38
  init_failure_condition_evaluator
39
- } from "./chunk-SWEEZ5D5.mjs";
40
- import {
41
- compileAndRun,
42
- createSecureSandbox,
43
- init_sandbox
44
- } from "./chunk-BOVFH3LI.mjs";
39
+ } from "./chunk-MPS4HVQI.mjs";
45
40
  import {
46
41
  addEvent,
47
42
  emitNdjsonFallback,
@@ -59,13 +54,18 @@ import {
59
54
  import {
60
55
  createExtendedLiquid,
61
56
  init_liquid_extensions
62
- } from "./chunk-7GUAFV6L.mjs";
57
+ } from "./chunk-BHOKBQPB.mjs";
63
58
  import {
64
59
  createPermissionHelpers,
65
60
  detectLocalMode,
66
61
  init_author_permissions,
67
62
  resolveAssociationFromEvent
68
63
  } from "./chunk-CNX7V5JK.mjs";
64
+ import {
65
+ compileAndRun,
66
+ createSecureSandbox,
67
+ init_sandbox
68
+ } from "./chunk-BOVFH3LI.mjs";
69
69
  import {
70
70
  MemoryStore,
71
71
  init_memory_store,
@@ -1534,6 +1534,9 @@ ${"=".repeat(60)}
1534
1534
  // Use systemPrompt (native in rc168+) with fallback to customPrompt for backward compat
1535
1535
  systemPrompt: systemPrompt || this.config.systemPrompt || this.config.customPrompt
1536
1536
  };
1537
+ if (this.config.maxIterations !== void 0) {
1538
+ options.maxIterations = this.config.maxIterations;
1539
+ }
1537
1540
  let traceFilePath = "";
1538
1541
  let telemetryConfig = null;
1539
1542
  let probeFileTracer = null;
@@ -2023,9 +2026,12 @@ ${"=".repeat(60)}
2023
2026
  const errMsg = parseErr instanceof Error ? parseErr.message : String(parseErr);
2024
2027
  log(`\u{1F50D} Direct JSON parsing failed: ${errMsg}`);
2025
2028
  if (response.toLowerCase().includes("i cannot") || response.toLowerCase().includes("unable to")) {
2026
- console.error("\u{1F6AB} AI refused to analyze - returning empty result");
2029
+ console.error("\u{1F6AB} AI refused to analyze - returning refusal as output");
2030
+ const trimmed2 = response.trim();
2027
2031
  return {
2028
- issues: []
2032
+ issues: [],
2033
+ output: trimmed2 ? { text: trimmed2 } : {},
2034
+ debug: debugInfo
2029
2035
  };
2030
2036
  }
2031
2037
  log("\u{1F527} Treating response as plain text (no JSON extraction)");
@@ -2844,9 +2850,7 @@ var init_custom_tool_executor = __esm({
2844
2850
  * Apply JavaScript transform to output
2845
2851
  */
2846
2852
  async applyJavaScriptTransform(transformJs, output, context2) {
2847
- if (!this.sandbox) {
2848
- this.sandbox = createSecureSandbox();
2849
- }
2853
+ this.sandbox = createSecureSandbox();
2850
2854
  const code = `
2851
2855
  const output = ${JSON.stringify(output)};
2852
2856
  const context = ${JSON.stringify(context2)};
@@ -2977,7 +2981,7 @@ async function executeWorkflowAsTool(workflowId, args, context2, argsOverrides)
2977
2981
  ...args,
2978
2982
  ...argsOverrides
2979
2983
  };
2980
- const { WorkflowCheckProvider: WorkflowCheckProvider2 } = await import("./workflow-check-provider-YUNNF4KC.mjs");
2984
+ const { WorkflowCheckProvider: WorkflowCheckProvider2 } = await import("./workflow-check-provider-3IWBAZP7.mjs");
2981
2985
  const provider = new WorkflowCheckProvider2();
2982
2986
  const checkConfig = {
2983
2987
  type: "workflow",
@@ -4097,6 +4101,10 @@ ${preview}`);
4097
4101
  if (aiAny2.timeout !== void 0) {
4098
4102
  aiConfig.timeout = aiAny2.timeout;
4099
4103
  }
4104
+ if (aiAny2.max_iterations !== void 0 || aiAny2.maxIterations !== void 0) {
4105
+ const raw = aiAny2.max_iterations ?? aiAny2.maxIterations;
4106
+ aiConfig.maxIterations = Number(raw);
4107
+ }
4100
4108
  if (aiAny2.provider !== void 0) {
4101
4109
  aiConfig.provider = aiAny2.provider;
4102
4110
  }
@@ -4231,6 +4239,9 @@ ${preview}`);
4231
4239
  if (config.ai_provider !== void 0) {
4232
4240
  aiConfig.provider = config.ai_provider;
4233
4241
  }
4242
+ if (config.ai_max_iterations !== void 0 && aiConfig.maxIterations === void 0) {
4243
+ aiConfig.maxIterations = config.ai_max_iterations;
4244
+ }
4234
4245
  const customPrompt = config.prompt;
4235
4246
  if (!customPrompt) {
4236
4247
  throw new Error(
@@ -4633,6 +4644,7 @@ ${processedPrompt}` : processedPrompt;
4633
4644
  "ai.model",
4634
4645
  "ai.apiKey",
4635
4646
  "ai.timeout",
4647
+ "ai.max_iterations",
4636
4648
  "ai.mcpServers",
4637
4649
  "ai.enableDelegate",
4638
4650
  // legacy persona/prompt keys supported in config
@@ -4640,6 +4652,7 @@ ${processedPrompt}` : processedPrompt;
4640
4652
  "ai_prompt_type",
4641
4653
  "ai_custom_prompt",
4642
4654
  "ai_system_prompt",
4655
+ "ai_max_iterations",
4643
4656
  // new provider resilience and tools toggles
4644
4657
  "ai.retry",
4645
4658
  "ai.fallback",
@@ -5326,9 +5339,7 @@ var init_http_client_provider = __esm({
5326
5339
  }
5327
5340
  if (transformJs) {
5328
5341
  try {
5329
- if (!this.sandbox) {
5330
- this.sandbox = this.createSecureSandbox();
5331
- }
5342
+ this.sandbox = this.createSecureSandbox();
5332
5343
  const jsScope = {
5333
5344
  output: data,
5334
5345
  pr: templateContext.pr,
@@ -7179,23 +7190,6 @@ ${bodyWithReturn}
7179
7190
  { injectLog: false, wrapFunction: false }
7180
7191
  );
7181
7192
  }
7182
- try {
7183
- if (finalOutput && typeof finalOutput === "object" && !Array.isArray(finalOutput) && (finalOutput.error === void 0 || finalOutput.issues === void 0)) {
7184
- const vm = await import("vm");
7185
- const vmContext = vm.createContext({ scope: jsContext });
7186
- const vmCode = `
7187
- (function(){
7188
- const output = scope.output; const pr = scope.pr; const files = scope.files; const outputs = scope.outputs; const env = scope.env; const log = ()=>{};
7189
- ${bodyWithReturn}
7190
- })()
7191
- `;
7192
- const vmResult = vm.runInContext(vmCode, vmContext, { timeout: 1e3 });
7193
- if (vmResult && typeof vmResult === "object") {
7194
- finalOutput = vmResult;
7195
- }
7196
- }
7197
- } catch {
7198
- }
7199
7193
  let finalSnapshot = null;
7200
7194
  try {
7201
7195
  if (finalOutput && typeof finalOutput === "object" && !Array.isArray(finalOutput)) {
@@ -7682,6 +7676,11 @@ ${bodyWithReturn}
7682
7676
  isTimeout = true;
7683
7677
  }
7684
7678
  }
7679
+ if (!isTimeout && error instanceof Error) {
7680
+ if (/timed out/i.test(error.message)) {
7681
+ isTimeout = true;
7682
+ }
7683
+ }
7685
7684
  let stderrOutput = "";
7686
7685
  if (error && typeof error === "object") {
7687
7686
  const execError = error;
@@ -8443,9 +8442,7 @@ var init_memory_check_provider = __esm({
8443
8442
  * Evaluate JavaScript expression in context using SandboxJS for secure execution
8444
8443
  */
8445
8444
  evaluateJavaScript(expression, context2) {
8446
- if (!this.sandbox) {
8447
- this.sandbox = this.createSecureSandbox();
8448
- }
8445
+ this.sandbox = this.createSecureSandbox();
8449
8446
  try {
8450
8447
  const scope = { ...context2 };
8451
8448
  return compileAndRun(this.sandbox, `return (${expression});`, scope, {
@@ -8678,9 +8675,7 @@ var init_mcp_check_provider = __esm({
8678
8675
  }
8679
8676
  if (cfg.transform_js) {
8680
8677
  try {
8681
- if (!this.sandbox) {
8682
- this.sandbox = this.createSecureSandbox();
8683
- }
8678
+ this.sandbox = this.createSecureSandbox();
8684
8679
  const scope = {
8685
8680
  output: finalOutput,
8686
8681
  pr: templateContext.pr,
@@ -10273,6 +10268,53 @@ var init_worktree_manager = __esm({
10273
10268
  const metadata2 = await this.loadMetadata(worktreePath);
10274
10269
  if (metadata2) {
10275
10270
  if (metadata2.ref === ref) {
10271
+ try {
10272
+ const bareRepoPath2 = metadata2.bare_repo_path || await this.getOrCreateBareRepo(
10273
+ repository,
10274
+ repoUrl,
10275
+ options.token,
10276
+ options.fetchDepth,
10277
+ options.cloneTimeoutMs
10278
+ );
10279
+ const fetched2 = await this.fetchRef(bareRepoPath2, ref);
10280
+ if (fetched2) {
10281
+ const latestCommit = await this.getCommitShaForRef(bareRepoPath2, ref);
10282
+ if (latestCommit && latestCommit !== metadata2.commit) {
10283
+ logger.info(
10284
+ `Worktree ref ${ref} advanced (${metadata2.commit} -> ${latestCommit}), updating...`
10285
+ );
10286
+ const checkoutCmd = `git -C ${this.escapeShellArg(worktreePath)} checkout --detach ${this.escapeShellArg(latestCommit)}`;
10287
+ const checkoutResult = await this.executeGitCommand(checkoutCmd, {
10288
+ timeout: 6e4
10289
+ });
10290
+ if (checkoutResult.exitCode !== 0) {
10291
+ throw new Error(`Failed to checkout updated ref: ${checkoutResult.stderr}`);
10292
+ }
10293
+ const updatedMetadata = {
10294
+ ...metadata2,
10295
+ commit: latestCommit,
10296
+ created_at: (/* @__PURE__ */ new Date()).toISOString()
10297
+ };
10298
+ await this.saveMetadata(worktreePath, updatedMetadata);
10299
+ if (options.clean) {
10300
+ logger.debug(`Cleaning updated worktree`);
10301
+ await this.cleanWorktree(worktreePath);
10302
+ }
10303
+ this.activeWorktrees.set(worktreeId, updatedMetadata);
10304
+ return {
10305
+ id: worktreeId,
10306
+ path: worktreePath,
10307
+ ref: updatedMetadata.ref,
10308
+ commit: updatedMetadata.commit,
10309
+ metadata: updatedMetadata,
10310
+ locked: false
10311
+ };
10312
+ }
10313
+ }
10314
+ } catch (error) {
10315
+ const errorMessage = error instanceof Error ? error.message : String(error);
10316
+ logger.warn(`Failed to refresh worktree, will reuse existing: ${errorMessage}`);
10317
+ }
10276
10318
  if (options.clean) {
10277
10319
  logger.debug(`Cleaning existing worktree`);
10278
10320
  await this.cleanWorktree(worktreePath);
@@ -10298,8 +10340,11 @@ var init_worktree_manager = __esm({
10298
10340
  options.fetchDepth,
10299
10341
  options.cloneTimeoutMs
10300
10342
  );
10301
- await this.fetchRef(bareRepoPath2, ref);
10343
+ const fetched2 = await this.fetchRef(bareRepoPath2, ref);
10302
10344
  const newCommit = await this.getCommitShaForRef(bareRepoPath2, ref);
10345
+ if (!fetched2) {
10346
+ logger.warn(`Using cached ref ${ref} for update; fetch failed`);
10347
+ }
10303
10348
  const checkoutCmd = `git -C ${this.escapeShellArg(worktreePath)} checkout --detach ${this.escapeShellArg(newCommit)}`;
10304
10349
  const checkoutResult = await this.executeGitCommand(checkoutCmd, { timeout: 6e4 });
10305
10350
  if (checkoutResult.exitCode !== 0) {
@@ -10337,8 +10382,11 @@ var init_worktree_manager = __esm({
10337
10382
  await fsp.rm(worktreePath, { recursive: true, force: true });
10338
10383
  }
10339
10384
  }
10340
- await this.fetchRef(bareRepoPath, ref);
10385
+ const fetched = await this.fetchRef(bareRepoPath, ref);
10341
10386
  const commit = await this.getCommitShaForRef(bareRepoPath, ref);
10387
+ if (!fetched) {
10388
+ logger.warn(`Using cached ref ${ref}; fetch failed`);
10389
+ }
10342
10390
  await this.pruneWorktrees(bareRepoPath);
10343
10391
  logger.info(`Creating worktree for ${repository}@${ref} (${commit})`);
10344
10392
  const createCmd = `git -C ${this.escapeShellArg(
@@ -10392,8 +10440,13 @@ var init_worktree_manager = __esm({
10392
10440
  async fetchRef(bareRepoPath, ref) {
10393
10441
  this.validateRef(ref);
10394
10442
  logger.debug(`Fetching ref: ${ref}`);
10395
- const fetchCmd = `git -C ${this.escapeShellArg(bareRepoPath)} fetch origin ${this.escapeShellArg(ref + ":" + ref)} 2>&1 || true`;
10396
- await this.executeGitCommand(fetchCmd, { timeout: 6e4 });
10443
+ const fetchCmd = `git -C ${this.escapeShellArg(bareRepoPath)} fetch origin ${this.escapeShellArg(ref + ":" + ref)} 2>&1`;
10444
+ const result = await this.executeGitCommand(fetchCmd, { timeout: 6e4 });
10445
+ if (result.exitCode !== 0) {
10446
+ logger.warn(`Failed to fetch ref ${ref}: ${result.stderr}`);
10447
+ return false;
10448
+ }
10449
+ return true;
10397
10450
  }
10398
10451
  /**
10399
10452
  * Clean worktree (reset and remove untracked files)
@@ -11170,7 +11223,6 @@ var init_check_provider_registry = __esm({
11170
11223
  });
11171
11224
 
11172
11225
  // src/workflow-executor.ts
11173
- import { Liquid } from "liquidjs";
11174
11226
  var WorkflowExecutor;
11175
11227
  var init_workflow_executor = __esm({
11176
11228
  "src/workflow-executor.ts"() {
@@ -11179,11 +11231,12 @@ var init_workflow_executor = __esm({
11179
11231
  init_dependency_resolver();
11180
11232
  init_logger();
11181
11233
  init_sandbox();
11234
+ init_liquid_extensions();
11182
11235
  WorkflowExecutor = class {
11183
11236
  providerRegistry = null;
11184
11237
  liquid;
11185
11238
  constructor() {
11186
- this.liquid = new Liquid();
11239
+ this.liquid = createExtendedLiquid();
11187
11240
  }
11188
11241
  /**
11189
11242
  * Lazy-load the provider registry to avoid circular dependency during initialization
@@ -12623,7 +12676,7 @@ var init_dependency_gating = __esm({
12623
12676
  // src/state-machine/dispatch/template-renderer.ts
12624
12677
  async function renderTemplateContent(checkId, checkConfig, reviewSummary) {
12625
12678
  try {
12626
- const { createExtendedLiquid: createExtendedLiquid2 } = await import("./liquid-extensions-DFDEBMUI.mjs");
12679
+ const { createExtendedLiquid: createExtendedLiquid2 } = await import("./liquid-extensions-I7O7KMHF.mjs");
12627
12680
  const fs8 = await import("fs/promises");
12628
12681
  const path9 = await import("path");
12629
12682
  const schemaRaw = checkConfig.schema || "plain";
@@ -12700,7 +12753,7 @@ function hasFatalIssues(result) {
12700
12753
  if (!result.issues) return false;
12701
12754
  return result.issues.some((issue) => {
12702
12755
  const ruleId = issue.ruleId || "";
12703
- return ruleId.endsWith("/error") || ruleId.includes("/execution_error") || ruleId.endsWith("_fail_if");
12756
+ return ruleId.endsWith("/error") || ruleId.includes("/execution_error") || ruleId.includes("timeout") || ruleId.endsWith("_fail_if");
12704
12757
  });
12705
12758
  }
12706
12759
  function updateStats(results, state, isForEachIteration = false) {
@@ -14837,6 +14890,7 @@ async function executeCheckWithForEachItems2(checkId, forEachParent, forEachItem
14837
14890
  const ruleId = issue.ruleId || "";
14838
14891
  return ruleId.endsWith("/error") || // System errors
14839
14892
  ruleId.includes("/execution_error") || // Command failures
14893
+ ruleId.includes("timeout") || // Timeouts
14840
14894
  ruleId.endsWith("_fail_if");
14841
14895
  });
14842
14896
  if (iterationHasFatalIssues && output !== void 0 && output !== null && typeof output === "object") {
@@ -14952,7 +15006,7 @@ async function executeCheckWithForEachItems2(checkId, forEachParent, forEachItem
14952
15006
  allIssues.push(failIssue);
14953
15007
  const nowHasFatalIssues = enrichedResult.issues.some((issue) => {
14954
15008
  const ruleId = issue.ruleId || "";
14955
- return ruleId.endsWith("/error") || ruleId.includes("/execution_error") || ruleId.endsWith("_fail_if");
15009
+ return ruleId.endsWith("/error") || ruleId.includes("/execution_error") || ruleId.includes("timeout") || ruleId.endsWith("_fail_if");
14956
15010
  });
14957
15011
  if (nowHasFatalIssues && output !== void 0 && output !== null && typeof output === "object" && !output.__failed) {
14958
15012
  output = { ...output, __failed: true };
@@ -15194,7 +15248,7 @@ async function executeCheckWithForEachItems2(checkId, forEachParent, forEachItem
15194
15248
  }
15195
15249
  }
15196
15250
  try {
15197
- const { evaluateTransitions } = await import("./routing-7FXPULTO.mjs");
15251
+ const { evaluateTransitions } = await import("./routing-QHTGDIXF.mjs");
15198
15252
  const transTarget = await evaluateTransitions(
15199
15253
  onFinish.transitions,
15200
15254
  forEachParent,
@@ -15254,7 +15308,7 @@ async function executeCheckWithForEachItems2(checkId, forEachParent, forEachItem
15254
15308
  `[LevelDispatch] Error evaluating on_finish transitions for ${forEachParent}: ${e instanceof Error ? e.message : String(e)}`
15255
15309
  );
15256
15310
  }
15257
- const { evaluateGoto: evaluateGoto2 } = await import("./routing-7FXPULTO.mjs");
15311
+ const { evaluateGoto: evaluateGoto2 } = await import("./routing-QHTGDIXF.mjs");
15258
15312
  if (context2.debug) {
15259
15313
  logger.info(
15260
15314
  `[LevelDispatch] Evaluating on_finish.goto_js for forEach parent: ${forEachParent}`
@@ -16329,6 +16383,7 @@ function hasFatalIssues2(result) {
16329
16383
  const ruleId = issue.ruleId || "";
16330
16384
  return ruleId.endsWith("/error") || // System errors
16331
16385
  ruleId.includes("/execution_error") || // Command failures
16386
+ ruleId.includes("timeout") || // Timeouts
16332
16387
  ruleId.endsWith("_fail_if") && ruleId !== "global_fail_if";
16333
16388
  });
16334
16389
  }
@@ -16372,6 +16427,7 @@ function updateStats2(results, state, isForEachIteration = false) {
16372
16427
  const ruleId = issue.ruleId || "";
16373
16428
  return ruleId.endsWith("/error") || // System errors, exceptions
16374
16429
  ruleId.includes("/execution_error") || // Command failures
16430
+ ruleId.includes("timeout") || // Timeouts
16375
16431
  ruleId.endsWith("_fail_if") && ruleId !== "global_fail_if";
16376
16432
  });
16377
16433
  if (error) {
@@ -16416,7 +16472,7 @@ function updateStats2(results, state, isForEachIteration = false) {
16416
16472
  }
16417
16473
  async function renderTemplateContent2(checkId, checkConfig, reviewSummary) {
16418
16474
  try {
16419
- const { createExtendedLiquid: createExtendedLiquid2 } = await import("./liquid-extensions-DFDEBMUI.mjs");
16475
+ const { createExtendedLiquid: createExtendedLiquid2 } = await import("./liquid-extensions-I7O7KMHF.mjs");
16420
16476
  const fs8 = await import("fs/promises");
16421
16477
  const path9 = await import("path");
16422
16478
  const schemaRaw = checkConfig.schema || "plain";
@@ -17047,7 +17103,6 @@ var init_runner = __esm({
17047
17103
  });
17048
17104
 
17049
17105
  // src/providers/workflow-check-provider.ts
17050
- import { Liquid as Liquid2 } from "liquidjs";
17051
17106
  var WorkflowCheckProvider;
17052
17107
  var init_workflow_check_provider = __esm({
17053
17108
  "src/providers/workflow-check-provider.ts"() {
@@ -17057,6 +17112,7 @@ var init_workflow_check_provider = __esm({
17057
17112
  init_logger();
17058
17113
  init_sandbox();
17059
17114
  init_human_id();
17115
+ init_liquid_extensions();
17060
17116
  WorkflowCheckProvider = class extends CheckProvider {
17061
17117
  registry;
17062
17118
  executor;
@@ -17065,7 +17121,7 @@ var init_workflow_check_provider = __esm({
17065
17121
  super();
17066
17122
  this.registry = WorkflowRegistry.getInstance();
17067
17123
  this.executor = new WorkflowExecutor();
17068
- this.liquid = new Liquid2();
17124
+ this.liquid = createExtendedLiquid();
17069
17125
  }
17070
17126
  getName() {
17071
17127
  return "workflow";
@@ -17490,7 +17546,6 @@ var init_workflow_check_provider = __esm({
17490
17546
  if (!workflow.outputs) {
17491
17547
  return outputs;
17492
17548
  }
17493
- const sandbox = createSecureSandbox();
17494
17549
  const flat = {};
17495
17550
  try {
17496
17551
  for (const arr of Object.values(groupedResults || {})) {
@@ -17509,6 +17564,7 @@ var init_workflow_check_provider = __esm({
17509
17564
  );
17510
17565
  for (const output of workflow.outputs) {
17511
17566
  if (output.value_js) {
17567
+ const sandbox = createSecureSandbox();
17512
17568
  outputs[output.name] = compileAndRun(
17513
17569
  sandbox,
17514
17570
  output.value_js,
@@ -17606,26 +17662,25 @@ var init_workflow_check_provider = __esm({
17606
17662
  if (rawData.imports && Array.isArray(rawData.imports)) {
17607
17663
  const configDir = path9.dirname(resolved);
17608
17664
  for (const source of rawData.imports) {
17609
- try {
17610
- const results = await this.registry.import(source, {
17611
- basePath: configDir,
17612
- validate: true
17613
- });
17614
- for (const result of results) {
17615
- if (!result.valid && result.errors) {
17616
- const errors = result.errors.map((e) => ` ${e.path}: ${e.message}`).join("\n");
17617
- throw new Error(`Failed to import workflow from '${source}':
17618
- ${errors}`);
17665
+ const results = await this.registry.import(source, {
17666
+ basePath: configDir,
17667
+ validate: true
17668
+ });
17669
+ for (const result of results) {
17670
+ if (!result.valid && result.errors) {
17671
+ const isAlreadyExists = result.errors.every(
17672
+ (e) => e.message.includes("already exists")
17673
+ );
17674
+ if (isAlreadyExists) {
17675
+ logger.debug(`Workflow from '${source}' already imported, skipping`);
17676
+ continue;
17619
17677
  }
17620
- }
17621
- logger.info(`Imported workflows from: ${source}`);
17622
- } catch (err) {
17623
- if (err.message?.includes("already exists")) {
17624
- logger.debug(`Workflow from '${source}' already imported, skipping`);
17625
- } else {
17626
- throw err;
17678
+ const errors = result.errors.map((e) => ` ${e.path}: ${e.message}`).join("\n");
17679
+ throw new Error(`Failed to import workflow from '${source}':
17680
+ ${errors}`);
17627
17681
  }
17628
17682
  }
17683
+ logger.info(`Imported workflows from: ${source}`);
17629
17684
  }
17630
17685
  }
17631
17686
  const { ConfigManager } = (init_config(), __toCommonJS(config_exports));
@@ -17664,4 +17719,4 @@ export {
17664
17719
  StateMachineRunner,
17665
17720
  init_runner
17666
17721
  };
17667
- //# sourceMappingURL=chunk-A4PGHURG.mjs.map
17722
+ //# sourceMappingURL=chunk-TS6BUNAI.mjs.map