@probelabs/visor 0.1.176-ee → 0.1.177-ee

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 (52) hide show
  1. package/dist/frontends/slack-frontend.d.ts.map +1 -1
  2. package/dist/index.js +126 -23
  3. package/dist/sdk/a2a-frontend-BPWLYLCG.mjs +1658 -0
  4. package/dist/sdk/a2a-frontend-BPWLYLCG.mjs.map +1 -0
  5. package/dist/sdk/{check-provider-registry-X7WH3PXQ.mjs → check-provider-registry-G64PWDCZ.mjs} +5 -5
  6. package/dist/sdk/{check-provider-registry-VE6LQPLY.mjs → check-provider-registry-HW4QPPSA.mjs} +2 -2
  7. package/dist/sdk/chunk-GVTWESYN.mjs +516 -0
  8. package/dist/sdk/chunk-GVTWESYN.mjs.map +1 -0
  9. package/dist/sdk/{chunk-KQAT6H3S.mjs → chunk-IYXOLUDJ.mjs} +73 -28
  10. package/dist/sdk/chunk-IYXOLUDJ.mjs.map +1 -0
  11. package/dist/sdk/chunk-OHOBWVPP.mjs +1502 -0
  12. package/dist/sdk/chunk-OHOBWVPP.mjs.map +1 -0
  13. package/dist/sdk/chunk-OPI632LK.mjs +739 -0
  14. package/dist/sdk/chunk-OPI632LK.mjs.map +1 -0
  15. package/dist/sdk/{chunk-OK4MLC3R.mjs → chunk-Y6PVSFCS.mjs} +49 -9
  16. package/dist/sdk/chunk-Y6PVSFCS.mjs.map +1 -0
  17. package/dist/sdk/failure-condition-evaluator-HL33X7MH.mjs +18 -0
  18. package/dist/sdk/github-frontend-U2U42CKV.mjs +1386 -0
  19. package/dist/sdk/github-frontend-U2U42CKV.mjs.map +1 -0
  20. package/dist/sdk/{host-LRWIKURZ.mjs → host-HFOJQIOF.mjs} +4 -4
  21. package/dist/sdk/routing-SFP4D6O3.mjs +26 -0
  22. package/dist/sdk/{schedule-tool-INVLVX3G.mjs → schedule-tool-45NAALKS.mjs} +2 -2
  23. package/dist/sdk/{schedule-tool-R7NSHTPJ.mjs → schedule-tool-7O7SWSJ4.mjs} +5 -5
  24. package/dist/sdk/{schedule-tool-handler-4SSRQXFJ.mjs → schedule-tool-handler-6MPP5DXK.mjs} +2 -2
  25. package/dist/sdk/{schedule-tool-handler-5GTQ6SFI.mjs → schedule-tool-handler-KYDXJ2ZL.mjs} +5 -5
  26. package/dist/sdk/sdk.js +74 -14
  27. package/dist/sdk/sdk.js.map +1 -1
  28. package/dist/sdk/sdk.mjs +4 -4
  29. package/dist/sdk/slack-frontend-XKSIOUXB.mjs +910 -0
  30. package/dist/sdk/slack-frontend-XKSIOUXB.mjs.map +1 -0
  31. package/dist/sdk/trace-helpers-L3EOYW5P.mjs +29 -0
  32. package/dist/sdk/trace-helpers-L3EOYW5P.mjs.map +1 -0
  33. package/dist/sdk/{workflow-check-provider-IWZSZQ7N.mjs → workflow-check-provider-JIXZJNV5.mjs} +5 -5
  34. package/dist/sdk/workflow-check-provider-JIXZJNV5.mjs.map +1 -0
  35. package/dist/sdk/{workflow-check-provider-EY6VSMNG.mjs → workflow-check-provider-OA33MESM.mjs} +2 -2
  36. package/dist/sdk/workflow-check-provider-OA33MESM.mjs.map +1 -0
  37. package/dist/utils/workspace-manager.d.ts +5 -1
  38. package/dist/utils/workspace-manager.d.ts.map +1 -1
  39. package/dist/utils/worktree-manager.d.ts +5 -1
  40. package/dist/utils/worktree-manager.d.ts.map +1 -1
  41. package/package.json +2 -2
  42. package/dist/sdk/chunk-KQAT6H3S.mjs.map +0 -1
  43. package/dist/sdk/chunk-OK4MLC3R.mjs.map +0 -1
  44. /package/dist/sdk/{check-provider-registry-VE6LQPLY.mjs.map → check-provider-registry-G64PWDCZ.mjs.map} +0 -0
  45. /package/dist/sdk/{check-provider-registry-X7WH3PXQ.mjs.map → check-provider-registry-HW4QPPSA.mjs.map} +0 -0
  46. /package/dist/sdk/{schedule-tool-INVLVX3G.mjs.map → failure-condition-evaluator-HL33X7MH.mjs.map} +0 -0
  47. /package/dist/sdk/{host-LRWIKURZ.mjs.map → host-HFOJQIOF.mjs.map} +0 -0
  48. /package/dist/sdk/{schedule-tool-R7NSHTPJ.mjs.map → routing-SFP4D6O3.mjs.map} +0 -0
  49. /package/dist/sdk/{schedule-tool-handler-4SSRQXFJ.mjs.map → schedule-tool-45NAALKS.mjs.map} +0 -0
  50. /package/dist/sdk/{schedule-tool-handler-5GTQ6SFI.mjs.map → schedule-tool-7O7SWSJ4.mjs.map} +0 -0
  51. /package/dist/sdk/{workflow-check-provider-EY6VSMNG.mjs.map → schedule-tool-handler-6MPP5DXK.mjs.map} +0 -0
  52. /package/dist/sdk/{workflow-check-provider-IWZSZQ7N.mjs.map → schedule-tool-handler-KYDXJ2ZL.mjs.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"slack-frontend.d.ts","sourceRoot":"","sources":["file:///home/runner/work/visor/visor/src/frontends/slack-frontend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAYxD,KAAK,mBAAmB,GAAG;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,SAAS,CAAC,EAAE;QACV,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,CAAC;CACH,CAAC;AAEF,qBAAa,aAAc,YAAW,QAAQ;IAC5C,SAAgB,IAAI,WAAW;IAC/B,OAAO,CAAC,IAAI,CAAsC;IAClD,OAAO,CAAC,GAAG,CAAsB;IAEjC,OAAO,CAAC,KAAK,CAAkB;IAC/B,OAAO,CAAC,MAAM,CAAgD;IAC9D,OAAO,CAAC,OAAO,CAAkB;IACjC,OAAO,CAAC,QAAQ,CAAsB;IACtC,OAAO,CAAC,aAAa,CAAkB;IACvC,OAAO,CAAC,eAAe,CAAoD;gBAE/D,MAAM,CAAC,EAAE,mBAAmB;IAIxC,KAAK,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI;IA6JjC,IAAI,IAAI,IAAI;IAKZ,OAAO,CAAC,QAAQ;IAchB,OAAO,CAAC,sBAAsB;IAY9B,OAAO,CAAC,oBAAoB;IAW5B,OAAO,CAAC,kBAAkB;YAcZ,cAAc;IA2D5B,OAAO,CAAC,uBAAuB;YAcjB,yBAAyB;YAgCzB,qBAAqB;YAsCrB,iBAAiB;IA6B/B;;;;OAIG;YACW,oBAAoB;IAsPlC,OAAO,CAAC,YAAY;CAWrB"}
1
+ {"version":3,"file":"slack-frontend.d.ts","sourceRoot":"","sources":["file:///home/runner/work/visor/visor/src/frontends/slack-frontend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAYxD,KAAK,mBAAmB,GAAG;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,SAAS,CAAC,EAAE;QACV,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,CAAC;CACH,CAAC;AAEF,qBAAa,aAAc,YAAW,QAAQ;IAC5C,SAAgB,IAAI,WAAW;IAC/B,OAAO,CAAC,IAAI,CAAsC;IAClD,OAAO,CAAC,GAAG,CAAsB;IAEjC,OAAO,CAAC,KAAK,CAAkB;IAC/B,OAAO,CAAC,MAAM,CAAgD;IAC9D,OAAO,CAAC,OAAO,CAAkB;IACjC,OAAO,CAAC,QAAQ,CAAsB;IACtC,OAAO,CAAC,aAAa,CAAkB;IACvC,OAAO,CAAC,eAAe,CAAoD;gBAE/D,MAAM,CAAC,EAAE,mBAAmB;IAIxC,KAAK,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI;IA6JjC,IAAI,IAAI,IAAI;IAKZ,OAAO,CAAC,QAAQ;IAchB,OAAO,CAAC,sBAAsB;IAY9B,OAAO,CAAC,oBAAoB;IAW5B,OAAO,CAAC,kBAAkB;YAcZ,cAAc;IA2D5B,OAAO,CAAC,uBAAuB;YAcjB,yBAAyB;YAgCzB,qBAAqB;YAsCrB,iBAAiB;IA6B/B;;;;OAIG;YACW,oBAAoB;IA0QlC,OAAO,CAAC,YAAY;CAWrB"}
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- process.env.VISOR_VERSION = '0.1.176';
3
- process.env.PROBE_VERSION = '0.6.0-rc291';
4
- process.env.VISOR_COMMIT_SHA = 'e7bb0fe8d7a8a33772178036a26d756882ad454b';
5
- process.env.VISOR_COMMIT_SHORT = 'e7bb0fe';
2
+ process.env.VISOR_VERSION = '0.1.177';
3
+ process.env.PROBE_VERSION = '0.6.0-rc292';
4
+ process.env.VISOR_COMMIT_SHA = '5ceed041c645b4c6f1ed2b2cf327a7f376437656';
5
+ process.env.VISOR_COMMIT_SHORT = '5ceed04';
6
6
  /******/ (() => { // webpackBootstrap
7
7
  /******/ var __webpack_modules__ = ({
8
8
 
@@ -315154,6 +315154,20 @@ class SlackFrontend {
315154
315154
  if (out && typeof out._rawOutput === 'string' && out._rawOutput.trim().length > 0) {
315155
315155
  text = (text || '') + '\n\n' + out._rawOutput.trim();
315156
315156
  }
315157
+ // Fallback: if no text was extracted, check for error issues (e.g. timeout)
315158
+ // and post an error message so the user isn't left with silence.
315159
+ if (!text) {
315160
+ const issues = result?.issues || [];
315161
+ const errorIssues = issues.filter((i) => i.severity === 'error' &&
315162
+ (i.ruleId?.startsWith('system/') || i.ruleId?.endsWith('/error')));
315163
+ if (errorIssues.length > 0) {
315164
+ const errorMessages = errorIssues.map((i) => i.message).join('\n');
315165
+ text = `:warning: Something went wrong while processing your request:\n${errorMessages}`;
315166
+ // Prevent maybePostExecutionFailure from double-posting the same error
315167
+ this.errorNotified = true;
315168
+ ctx.logger.warn(`[slack-frontend] posting error fallback for ${checkId}: ${errorIssues.length} system error(s)`);
315169
+ }
315170
+ }
315157
315171
  if (!text) {
315158
315172
  ctx.logger.info(`[slack-frontend] skip posting AI reply for ${checkId}: no renderable text in check output`);
315159
315173
  return;
@@ -350407,7 +350421,7 @@ async function executeSingleCheck(checkId, context, state, emitEvent, transition
350407
350421
  workflowInputs,
350408
350422
  ai: {
350409
350423
  ...(checkConfig.ai || {}),
350410
- timeout: checkConfig.ai?.timeout || 1800000,
350424
+ timeout: checkConfig.timeout || checkConfig.ai?.timeout || 1800000,
350411
350425
  debug: !!context.debug,
350412
350426
  },
350413
350427
  };
@@ -350500,7 +350514,7 @@ async function executeSingleCheck(checkId, context, state, emitEvent, transition
350500
350514
  session_id: context.sessionId,
350501
350515
  wave: state.wave,
350502
350516
  }, async (span) => {
350503
- const res = await (0, sandbox_routing_1.executeWithSandboxRouting)(checkId, checkConfig, context, prInfo, dependencyResults, checkConfig.ai?.timeout || 1800000, () => provider.execute(prInfo, providerConfig, dependencyResults, executionContext));
350517
+ const res = await (0, sandbox_routing_1.executeWithSandboxRouting)(checkId, checkConfig, context, prInfo, dependencyResults, checkConfig.timeout || checkConfig.ai?.timeout || 1800000, () => provider.execute(prInfo, providerConfig, dependencyResults, executionContext));
350504
350518
  // Capture output in span for trace visualization
350505
350519
  try {
350506
350520
  (0, state_capture_1.captureCheckOutput)(span, res.output);
@@ -350868,7 +350882,7 @@ async function executeCheckWithForEachItems(checkId, forEachParent, forEachItems
350868
350882
  workflowInputs,
350869
350883
  ai: {
350870
350884
  ...(checkConfig.ai || {}),
350871
- timeout: checkConfig.ai?.timeout || 1800000,
350885
+ timeout: checkConfig.timeout || checkConfig.ai?.timeout || 1800000,
350872
350886
  debug: !!context.debug,
350873
350887
  },
350874
350888
  };
@@ -350948,7 +350962,7 @@ async function executeCheckWithForEachItems(checkId, forEachParent, forEachItems
350948
350962
  session_id: context.sessionId,
350949
350963
  wave: state.wave,
350950
350964
  }, async (span) => {
350951
- const res = await (0, sandbox_routing_1.executeWithSandboxRouting)(checkId, checkConfig, context, prInfo, dependencyResults, checkConfig.ai?.timeout || 1800000, () => provider.execute(prInfo, providerConfig, dependencyResults, executionContext));
350965
+ const res = await (0, sandbox_routing_1.executeWithSandboxRouting)(checkId, checkConfig, context, prInfo, dependencyResults, checkConfig.timeout || checkConfig.ai?.timeout || 1800000, () => provider.execute(prInfo, providerConfig, dependencyResults, executionContext));
350952
350966
  try {
350953
350967
  (0, state_capture_1.captureCheckOutput)(span, res.output);
350954
350968
  }
@@ -351439,7 +351453,7 @@ async function executeInvocation(item, context, scope, prInfo, dependencyResults
351439
351453
  __outputHistory: outputHistory,
351440
351454
  ai: {
351441
351455
  ...(stepConfig.ai || {}),
351442
- timeout: stepConfig.ai?.timeout || 1800000,
351456
+ timeout: stepConfig.timeout || stepConfig.ai?.timeout || 1800000,
351443
351457
  debug: !!context.debug,
351444
351458
  },
351445
351459
  };
@@ -353326,7 +353340,7 @@ async function executeCheckWithForEachItems(checkId, forEachParent, forEachItems
353326
353340
  workflowInputs,
353327
353341
  ai: {
353328
353342
  ...(checkConfig.ai || {}),
353329
- timeout: checkConfig.ai?.timeout || 1800000,
353343
+ timeout: checkConfig.timeout || checkConfig.ai?.timeout || 1800000,
353330
353344
  debug: !!context.debug,
353331
353345
  },
353332
353346
  };
@@ -353357,16 +353371,17 @@ async function executeCheckWithForEachItems(checkId, forEachParent, forEachItems
353357
353371
  const conv = slackConv || telegramConv;
353358
353372
  if (conv) {
353359
353373
  const event = payload?.event;
353360
- const messageCount = Array.isArray(conv?.messages)
353361
- ? conv.messages.length
353362
- : 0;
353374
+ const messageCount = Array.isArray(conv?.messages) ? conv.messages.length : 0;
353363
353375
  if (context.debug) {
353364
353376
  logger_1.logger.info(`[LevelDispatch] Conversation extracted (${conv?.transport || 'unknown'}): ${messageCount} messages`);
353365
353377
  }
353366
353378
  // Build transport-specific context
353367
353379
  const transportCtx = slackConv
353368
353380
  ? { slack: { event: event || {}, conversation: slackConv } }
353369
- : { telegram: { event: event || {}, conversation: telegramConv }, webhook: payload };
353381
+ : {
353382
+ telegram: { event: event || {}, conversation: telegramConv },
353383
+ webhook: payload,
353384
+ };
353370
353385
  providerConfig.eventContext = {
353371
353386
  ...providerConfig.eventContext,
353372
353387
  ...transportCtx,
@@ -353541,7 +353556,7 @@ async function executeCheckWithForEachItems(checkId, forEachParent, forEachItems
353541
353556
  session_id: context.sessionId,
353542
353557
  wave: state.wave,
353543
353558
  }, async (span) => {
353544
- const res = await (0, sandbox_routing_1.executeWithSandboxRouting)(checkId, checkConfig, context, prInfo, dependencyResults, checkConfig.ai?.timeout || 1800000, () => provider.execute(prInfo, providerConfig, dependencyResults, executionContext));
353559
+ const res = await (0, sandbox_routing_1.executeWithSandboxRouting)(checkId, checkConfig, context, prInfo, dependencyResults, checkConfig.timeout || checkConfig.ai?.timeout || 1800000, () => provider.execute(prInfo, providerConfig, dependencyResults, executionContext));
353545
353560
  try {
353546
353561
  (0, state_capture_1.captureCheckOutput)(span, res.output);
353547
353562
  }
@@ -354560,7 +354575,7 @@ async function executeSingleCheck(checkId, context, state, emitEvent, transition
354560
354575
  workflowInputs,
354561
354576
  ai: {
354562
354577
  ...(checkConfig.ai || {}),
354563
- timeout: checkConfig.ai?.timeout || 1800000,
354578
+ timeout: checkConfig.timeout || checkConfig.ai?.timeout || 1800000,
354564
354579
  debug: !!context.debug,
354565
354580
  },
354566
354581
  };
@@ -354742,7 +354757,7 @@ async function executeSingleCheck(checkId, context, state, emitEvent, transition
354742
354757
  session_id: context.sessionId,
354743
354758
  wave: state.wave,
354744
354759
  }, async (span) => {
354745
- const res = await (0, sandbox_routing_1.executeWithSandboxRouting)(checkId, checkConfig, context, prInfo, dependencyResults, checkConfig.ai?.timeout || 1800000, () => provider.execute(prInfo, providerConfig, dependencyResults, executionContext));
354760
+ const res = await (0, sandbox_routing_1.executeWithSandboxRouting)(checkId, checkConfig, context, prInfo, dependencyResults, checkConfig.timeout || checkConfig.ai?.timeout || 1800000, () => provider.execute(prInfo, providerConfig, dependencyResults, executionContext));
354746
354761
  try {
354747
354762
  (0, state_capture_1.captureCheckOutput)(span, res.output);
354748
354763
  }
@@ -374535,10 +374550,26 @@ class WorkspaceManager {
374535
374550
  await this.deleteLocalBranches(worktreePath);
374536
374551
  }
374537
374552
  /**
374538
- * Delete all local branches in a worktree.
374553
+ * Delete local branches in a worktree that are safe to remove.
374554
+ * IMPORTANT: Git worktrees share the branch namespace with the main repo
374555
+ * and all other worktrees. We must NOT delete branches that are checked out
374556
+ * in the main working tree or any other worktree — doing so would destroy
374557
+ * the user's work.
374539
374558
  */
374540
374559
  async deleteLocalBranches(worktreePath) {
374541
374560
  const escapedPath = shellEscape(worktreePath);
374561
+ // First, discover which branches are checked out in ANY worktree (including main).
374562
+ // `git worktree list --porcelain` output contains "branch refs/heads/<name>" lines.
374563
+ const worktreeListResult = await command_executor_1.commandExecutor.execute(`git -C ${escapedPath} worktree list --porcelain`, { timeout: 10000 });
374564
+ const protectedBranches = new Set();
374565
+ if (worktreeListResult.exitCode === 0) {
374566
+ for (const line of worktreeListResult.stdout.split('\n')) {
374567
+ const match = line.match(/^branch refs\/heads\/(.+)$/);
374568
+ if (match) {
374569
+ protectedBranches.add(match[1]);
374570
+ }
374571
+ }
374572
+ }
374542
374573
  const listResult = await command_executor_1.commandExecutor.execute(`git -C ${escapedPath} branch --list --format='%(refname:short)'`, { timeout: 10000 });
374543
374574
  if (listResult.exitCode !== 0 || !listResult.stdout.trim()) {
374544
374575
  return;
@@ -374549,6 +374580,10 @@ class WorkspaceManager {
374549
374580
  .map(b => b.trim())
374550
374581
  .filter(b => b.length > 0);
374551
374582
  for (const branch of branches) {
374583
+ if (protectedBranches.has(branch)) {
374584
+ logger_1.logger.debug(`[Workspace] Skipping branch '${branch}' — checked out in another worktree`);
374585
+ continue;
374586
+ }
374552
374587
  const deleteResult = await command_executor_1.commandExecutor.execute(`git -C ${escapedPath} branch -D ${shellEscape(branch)}`, { timeout: 10000 });
374553
374588
  if (deleteResult.exitCode === 0) {
374554
374589
  logger_1.logger.debug(`[Workspace] Deleted local branch '${branch}' from worktree`);
@@ -375248,11 +375283,28 @@ class WorktreeManager {
375248
375283
  await this.deleteLocalBranches(worktreePath);
375249
375284
  }
375250
375285
  /**
375251
- * Delete all local branches in a worktree.
375286
+ * Delete local branches in a worktree that are safe to remove.
375252
375287
  * Worktrees are always used in detached HEAD state, so any local branches
375253
375288
  * were unintentionally created and should be cleaned up.
375289
+ * IMPORTANT: Git worktrees share the branch namespace with the main repo
375290
+ * and all other worktrees. We must NOT delete branches that are checked out
375291
+ * in the main working tree or any other worktree — doing so would destroy
375292
+ * the user's work.
375254
375293
  */
375255
375294
  async deleteLocalBranches(worktreePath) {
375295
+ // First, discover which branches are checked out in ANY worktree (including main).
375296
+ // `git worktree list --porcelain` output contains "branch refs/heads/<name>" lines.
375297
+ const worktreeListCmd = `git -C ${this.escapeShellArg(worktreePath)} worktree list --porcelain`;
375298
+ const worktreeListResult = await this.executeGitCommand(worktreeListCmd, { timeout: 10000 });
375299
+ const protectedBranches = new Set();
375300
+ if (worktreeListResult.exitCode === 0) {
375301
+ for (const line of worktreeListResult.stdout.split('\n')) {
375302
+ const match = line.match(/^branch refs\/heads\/(.+)$/);
375303
+ if (match) {
375304
+ protectedBranches.add(match[1]);
375305
+ }
375306
+ }
375307
+ }
375256
375308
  const listCmd = `git -C ${this.escapeShellArg(worktreePath)} branch --list --format='%(refname:short)'`;
375257
375309
  const listResult = await this.executeGitCommand(listCmd, { timeout: 10000 });
375258
375310
  if (listResult.exitCode !== 0 || !listResult.stdout.trim()) {
@@ -375264,6 +375316,10 @@ class WorktreeManager {
375264
375316
  .map(b => b.trim())
375265
375317
  .filter(b => b.length > 0);
375266
375318
  for (const branch of branches) {
375319
+ if (protectedBranches.has(branch)) {
375320
+ logger_1.logger.debug(`Skipping branch '${branch}' — checked out in another worktree`);
375321
+ continue;
375322
+ }
375267
375323
  const deleteCmd = `git -C ${this.escapeShellArg(worktreePath)} branch -D ${this.escapeShellArg(branch)}`;
375268
375324
  const deleteResult = await this.executeGitCommand(deleteCmd, { timeout: 10000 });
375269
375325
  if (deleteResult.exitCode === 0) {
@@ -542066,7 +542122,12 @@ function generateSandboxGlobals(options) {
542066
542122
  }
542067
542123
  return tryParseJSONValue(text);
542068
542124
  };
542069
- globals[name15] = traceToolCall(name15, rawMcpFn, tracer, logFn);
542125
+ const tracedFn = traceToolCall(name15, rawMcpFn, tracer, logFn);
542126
+ globals[name15] = tracedFn;
542127
+ const sanitized = name15.replace(/[^a-zA-Z0-9_$]/g, "_");
542128
+ if (sanitized !== name15) {
542129
+ globals[sanitized] = tracedFn;
542130
+ }
542070
542131
  }
542071
542132
  }
542072
542133
  if (llmCall) {
@@ -542421,9 +542482,17 @@ ${validation.errors.join("\n")}`,
542421
542482
  "dsl.duration_ms": elapsed,
542422
542483
  "dsl.error": e.message?.substring(0, 500)
542423
542484
  });
542485
+ let errorMsg = `Execution failed: ${e.message}`;
542486
+ if (e.message && e.message.includes("is not defined")) {
542487
+ const globalNames = Object.keys(toolGlobals).sort();
542488
+ errorMsg += `
542489
+ Available functions: ${globalNames.join(", ")}`;
542490
+ errorMsg += `
542491
+ Note: Tools with hyphens (e.g. "my-tool") are available with underscores: my_tool()`;
542492
+ }
542424
542493
  return {
542425
542494
  status: "error",
542426
- error: `Execution failed: ${e.message}`,
542495
+ error: errorMsg,
542427
542496
  logs
542428
542497
  };
542429
542498
  }
@@ -551740,7 +551809,14 @@ function lineTrimmedMatch(contentLines, searchLines) {
551740
551809
  }
551741
551810
  }
551742
551811
  if (allMatch) {
551743
- const matchedText = contentLines.slice(i, i + windowSize).join("\n");
551812
+ const windowLines = contentLines.slice(i, i + windowSize);
551813
+ const windowMinIndent = getMinIndent(windowLines);
551814
+ const searchMinIndent = getMinIndent(searchLines);
551815
+ const indentDiff = Math.abs(windowMinIndent - searchMinIndent);
551816
+ if (isIndentDiffTooLarge(windowLines, searchLines, indentDiff)) {
551817
+ continue;
551818
+ }
551819
+ const matchedText = windowLines.join("\n");
551744
551820
  matches.push(matchedText);
551745
551821
  }
551746
551822
  }
@@ -551770,6 +551846,15 @@ function whitespaceNormalizedMatch(content, search2) {
551770
551846
  actualEnd++;
551771
551847
  }
551772
551848
  const matchedText = content.substring(originalStart, actualEnd);
551849
+ const matchedLines = matchedText.split("\n");
551850
+ const searchLines = search2.split("\n");
551851
+ const matchMinIndent = getMinIndent(matchedLines);
551852
+ const searchMinIndent = getMinIndent(searchLines);
551853
+ const indentDiff = Math.abs(matchMinIndent - searchMinIndent);
551854
+ if (isIndentDiffTooLarge(matchedLines, searchLines, indentDiff)) {
551855
+ searchStart = idx + 1;
551856
+ continue;
551857
+ }
551773
551858
  matches.push(matchedText);
551774
551859
  searchStart = idx + 1;
551775
551860
  }
@@ -551821,6 +551906,10 @@ function indentFlexibleMatch(contentLines, searchLines) {
551821
551906
  }
551822
551907
  }
551823
551908
  if (allMatch) {
551909
+ const indentDiff = Math.abs(windowMinIndent - searchMinIndent);
551910
+ if (isIndentDiffTooLarge(windowLines, searchLines, indentDiff)) {
551911
+ continue;
551912
+ }
551824
551913
  const matchedText = windowLines.join("\n");
551825
551914
  matches.push(matchedText);
551826
551915
  }
@@ -551831,6 +551920,14 @@ function indentFlexibleMatch(contentLines, searchLines) {
551831
551920
  count: matches.length
551832
551921
  };
551833
551922
  }
551923
+ function isIndentDiffTooLarge(linesA, linesB, indentDiff) {
551924
+ if (indentDiff <= 0) return false;
551925
+ const sampleA = linesA.find((l) => l.trim().length > 0) || "";
551926
+ const sampleB = linesB.find((l) => l.trim().length > 0) || "";
551927
+ const useTabs = sampleA.startsWith(" ") || sampleB.startsWith(" ");
551928
+ const maxAllowedDiff = useTabs ? 1 : 4;
551929
+ return indentDiff > maxAllowedDiff;
551930
+ }
551834
551931
  function getMinIndent(lines) {
551835
551932
  let min = Infinity;
551836
551933
  for (const line of lines) {
@@ -551905,6 +552002,12 @@ function restoreIndentation(newStr, originalLines) {
551905
552002
  const targetIndent = detectBaseIndent(originalCode);
551906
552003
  const newIndent = detectBaseIndent(newStr);
551907
552004
  if (targetIndent !== newIndent) {
552005
+ const indentDiff = Math.abs(targetIndent.length - newIndent.length);
552006
+ const useTabs = targetIndent.includes(" ") || newIndent.includes(" ");
552007
+ const maxAllowedDiff = useTabs ? 1 : 4;
552008
+ if (indentDiff > maxAllowedDiff) {
552009
+ return { result: newStr, modifications };
552010
+ }
551908
552011
  const reindented = reindent(newStr, targetIndent);
551909
552012
  if (reindented !== newStr) {
551910
552013
  modifications.push(`reindented from "${newIndent}" to "${targetIndent}"`);
@@ -610577,7 +610680,7 @@ module.exports = /*#__PURE__*/JSON.parse('["aaa","aarp","abb","abbott","abbvie",
610577
610680
  /***/ ((module) => {
610578
610681
 
610579
610682
  "use strict";
610580
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@probelabs/visor","version":"0.1.42","main":"dist/index.js","bin":{"visor":"./dist/index.js"},"exports":{".":{"require":"./dist/index.js","import":"./dist/index.js"},"./sdk":{"types":"./dist/sdk/sdk.d.ts","import":"./dist/sdk/sdk.mjs","require":"./dist/sdk/sdk.js"},"./cli":{"require":"./dist/index.js"}},"files":["dist/","defaults/","action.yml","README.md","LICENSE"],"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"scripts":{"build:cli":"ncc build src/index.ts -o dist && cp -r defaults dist/ && cp -r output dist/ && cp -r docs dist/ && cp -r examples dist/ && cp -r src/debug-visualizer/ui dist/debug-visualizer/ && node scripts/inject-version.js && echo \'#!/usr/bin/env node\' | cat - dist/index.js > temp && mv temp dist/index.js && chmod +x dist/index.js","build:sdk":"tsup src/sdk.ts --dts --sourcemap --format esm,cjs --out-dir dist/sdk","build":"./scripts/build-oss.sh","build:ee":"npm run build:cli && npm run build:sdk","test":"jest && npm run test:yaml","test:unit":"jest","prepublishOnly":"npm run build","test:watch":"jest --watch","test:coverage":"jest --coverage","test:ee":"jest --testPathPatterns=\'tests/ee\' --testPathIgnorePatterns=\'/node_modules/\' --no-coverage","test:manual:bash":"RUN_MANUAL_TESTS=true jest tests/manual/bash-config-manual.test.ts","lint":"eslint src tests --ext .ts","lint:fix":"eslint src tests --ext .ts --fix","format":"prettier --write src tests","format:check":"prettier --check src tests","clean":"","clean:traces":"node scripts/clean-traces.js","prebuild":"npm run clean && node scripts/generate-config-schema.js","pretest":"npm run clean:traces && node scripts/generate-config-schema.js && npm run build:cli","pretest:unit":"npm run clean:traces && node scripts/generate-config-schema.js && npm run build:cli","test:with-build":"npm run build:cli && jest","test:yaml":"node dist/index.js test --progress compact","test:yaml:parallel":"node dist/index.js test --progress compact --max-parallel 4","prepare":"husky","pre-commit":"lint-staged","deploy:site":"cd site && npx wrangler pages deploy . --project-name=visor-site --commit-dirty=true","deploy:worker":"npx wrangler deploy","deploy":"npm run deploy:site && npm run deploy:worker","publish:ee":"./scripts/publish-ee.sh","release":"./scripts/release.sh","release:patch":"./scripts/release.sh patch","release:minor":"./scripts/release.sh minor","release:major":"./scripts/release.sh major","release:prerelease":"./scripts/release.sh prerelease","docs:validate":"node scripts/validate-readme-links.js","workshop:setup":"npm install -D reveal-md@6.1.2","workshop:serve":"cd workshop && reveal-md slides.md -w","workshop:export":"reveal-md workshop/slides.md --static workshop/build","workshop:pdf":"reveal-md workshop/slides.md --print workshop/Visor-Workshop.pdf --print-size letter","workshop:pdf:ci":"reveal-md workshop/slides.md --print workshop/Visor-Workshop.pdf --print-size letter --puppeteer-launch-args=\\"--no-sandbox --disable-dev-shm-usage\\"","workshop:pdf:a4":"reveal-md workshop/slides.md --print workshop/Visor-Workshop-A4.pdf --print-size A4","workshop:build":"npm run workshop:export && npm run workshop:pdf","simulate:issue":"TS_NODE_TRANSPILE_ONLY=1 ts-node scripts/simulate-gh-run.ts --event issues --action opened --debug","simulate:comment":"TS_NODE_TRANSPILE_ONLY=1 ts-node scripts/simulate-gh-run.ts --event issue_comment --action created --debug"},"keywords":["code-review","ai","github-action","cli","pr-review","visor"],"author":"Probe Labs","license":"MIT","description":"AI workflow engine for code review, assistants, and automation — orchestrate checks, MCP tools, and AI providers with YAML-driven pipelines","repository":{"type":"git","url":"git+https://github.com/probelabs/visor.git"},"bugs":{"url":"https://github.com/probelabs/visor/issues"},"homepage":"https://github.com/probelabs/visor#readme","dependencies":{"@actions/core":"^1.11.1","@apidevtools/swagger-parser":"^12.1.0","@grammyjs/runner":"^2.0.3","@modelcontextprotocol/sdk":"^1.25.3","@nyariv/sandboxjs":"github:probelabs/SandboxJS#23c4bb611f7d05f3cb8c523917b5f57103e48108","@octokit/action":"^8.0.2","@octokit/auth-app":"^8.1.0","@octokit/core":"^7.0.3","@octokit/rest":"^22.0.0","@opentelemetry/api":"^1.9.0","@opentelemetry/api-logs":"^0.203.0","@opentelemetry/core":"^1.30.1","@opentelemetry/exporter-logs-otlp-http":"^0.203.0","@opentelemetry/exporter-metrics-otlp-http":"^0.203.0","@opentelemetry/exporter-trace-otlp-grpc":"^0.203.0","@opentelemetry/exporter-trace-otlp-http":"^0.203.0","@opentelemetry/instrumentation":"^0.203.0","@opentelemetry/resources":"^1.30.1","@opentelemetry/sdk-logs":"^0.203.0","@opentelemetry/sdk-metrics":"^1.30.1","@opentelemetry/sdk-node":"^0.203.0","@opentelemetry/sdk-trace-base":"^1.30.1","@opentelemetry/semantic-conventions":"^1.30.1","@probelabs/probe":"^0.6.0-rc291","@types/commander":"^2.12.0","@types/uuid":"^10.0.0","acorn":"^8.16.0","acorn-walk":"^8.3.5","ajv":"^8.17.1","ajv-formats":"^3.0.1","better-sqlite3":"^11.0.0","blessed":"^0.1.81","botbuilder":"^4.23.3","botframework-connector":"^4.23.3","cli-table3":"^0.6.5","commander":"^14.0.0","deepmerge":"^4.3.1","dotenv":"^17.2.3","grammy":"^1.41.1","ignore":"^7.0.5","imapflow":"^1.2.12","js-yaml":"^4.1.0","jsonpath-plus":"^10.4.0","liquidjs":"^10.21.1","mailparser":"^3.9.3","minimatch":"^10.2.2","node-cron":"^3.0.3","nodemailer":"^8.0.1","open":"^9.1.0","resend":"^6.9.3","simple-git":"^3.28.0","uuid":"^11.1.0","ws":"^8.18.3"},"optionalDependencies":{"@anthropic/claude-code-sdk":"npm:null@*","@open-policy-agent/opa-wasm":"^1.10.0","knex":"^3.1.0","mysql2":"^3.11.0","pg":"^8.13.0","tedious":"^19.0.0"},"devDependencies":{"@eslint/js":"^9.34.0","@kie/act-js":"^2.6.2","@kie/mock-github":"^2.0.1","@swc/core":"^1.13.2","@swc/jest":"^0.2.37","@types/better-sqlite3":"^7.6.0","@types/blessed":"^0.1.27","@types/jest":"^30.0.0","@types/js-yaml":"^4.0.9","@types/mailparser":"^3.4.6","@types/node":"^24.3.0","@types/node-cron":"^3.0.11","@types/nodemailer":"^7.0.11","@types/ws":"^8.18.1","@typescript-eslint/eslint-plugin":"^8.42.0","@typescript-eslint/parser":"^8.42.0","@vercel/ncc":"^0.38.4","eslint":"^9.34.0","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.4","husky":"^9.1.7","jest":"^30.1.3","lint-staged":"^16.1.6","prettier":"^3.6.2","reveal-md":"^6.1.2","ts-json-schema-generator":"^1.5.1","ts-node":"^10.9.2","tsup":"^8.5.0","typescript":"^5.9.2","wrangler":"^3.0.0"},"peerDependenciesMeta":{"@anthropic/claude-code-sdk":{"optional":true}},"directories":{"test":"tests"},"lint-staged":{"src/**/*.{ts,js}":["eslint --fix","prettier --write"],"tests/**/*.{ts,js}":["eslint --fix","prettier --write"],"*.{json,md,yml,yaml}":["prettier --write"]}}');
610683
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@probelabs/visor","version":"0.1.42","main":"dist/index.js","bin":{"visor":"./dist/index.js"},"exports":{".":{"require":"./dist/index.js","import":"./dist/index.js"},"./sdk":{"types":"./dist/sdk/sdk.d.ts","import":"./dist/sdk/sdk.mjs","require":"./dist/sdk/sdk.js"},"./cli":{"require":"./dist/index.js"}},"files":["dist/","defaults/","action.yml","README.md","LICENSE"],"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"scripts":{"build:cli":"ncc build src/index.ts -o dist && cp -r defaults dist/ && cp -r output dist/ && cp -r docs dist/ && cp -r examples dist/ && cp -r src/debug-visualizer/ui dist/debug-visualizer/ && node scripts/inject-version.js && echo \'#!/usr/bin/env node\' | cat - dist/index.js > temp && mv temp dist/index.js && chmod +x dist/index.js","build:sdk":"tsup src/sdk.ts --dts --sourcemap --format esm,cjs --out-dir dist/sdk","build":"./scripts/build-oss.sh","build:ee":"npm run build:cli && npm run build:sdk","test":"jest && npm run test:yaml","test:unit":"jest","prepublishOnly":"npm run build","test:watch":"jest --watch","test:coverage":"jest --coverage","test:ee":"jest --testPathPatterns=\'tests/ee\' --testPathIgnorePatterns=\'/node_modules/\' --no-coverage","test:manual:bash":"RUN_MANUAL_TESTS=true jest tests/manual/bash-config-manual.test.ts","lint":"eslint src tests --ext .ts","lint:fix":"eslint src tests --ext .ts --fix","format":"prettier --write src tests","format:check":"prettier --check src tests","clean":"","clean:traces":"node scripts/clean-traces.js","prebuild":"npm run clean && node scripts/generate-config-schema.js","pretest":"npm run clean:traces && node scripts/generate-config-schema.js && npm run build:cli","pretest:unit":"npm run clean:traces && node scripts/generate-config-schema.js && npm run build:cli","test:with-build":"npm run build:cli && jest","test:yaml":"node dist/index.js test --progress compact","test:yaml:parallel":"node dist/index.js test --progress compact --max-parallel 4","prepare":"husky","pre-commit":"lint-staged","deploy:site":"cd site && npx wrangler pages deploy . --project-name=visor-site --commit-dirty=true","deploy:worker":"npx wrangler deploy","deploy":"npm run deploy:site && npm run deploy:worker","publish:ee":"./scripts/publish-ee.sh","release":"./scripts/release.sh","release:patch":"./scripts/release.sh patch","release:minor":"./scripts/release.sh minor","release:major":"./scripts/release.sh major","release:prerelease":"./scripts/release.sh prerelease","docs:validate":"node scripts/validate-readme-links.js","workshop:setup":"npm install -D reveal-md@6.1.2","workshop:serve":"cd workshop && reveal-md slides.md -w","workshop:export":"reveal-md workshop/slides.md --static workshop/build","workshop:pdf":"reveal-md workshop/slides.md --print workshop/Visor-Workshop.pdf --print-size letter","workshop:pdf:ci":"reveal-md workshop/slides.md --print workshop/Visor-Workshop.pdf --print-size letter --puppeteer-launch-args=\\"--no-sandbox --disable-dev-shm-usage\\"","workshop:pdf:a4":"reveal-md workshop/slides.md --print workshop/Visor-Workshop-A4.pdf --print-size A4","workshop:build":"npm run workshop:export && npm run workshop:pdf","simulate:issue":"TS_NODE_TRANSPILE_ONLY=1 ts-node scripts/simulate-gh-run.ts --event issues --action opened --debug","simulate:comment":"TS_NODE_TRANSPILE_ONLY=1 ts-node scripts/simulate-gh-run.ts --event issue_comment --action created --debug"},"keywords":["code-review","ai","github-action","cli","pr-review","visor"],"author":"Probe Labs","license":"MIT","description":"AI workflow engine for code review, assistants, and automation — orchestrate checks, MCP tools, and AI providers with YAML-driven pipelines","repository":{"type":"git","url":"git+https://github.com/probelabs/visor.git"},"bugs":{"url":"https://github.com/probelabs/visor/issues"},"homepage":"https://github.com/probelabs/visor#readme","dependencies":{"@actions/core":"^1.11.1","@apidevtools/swagger-parser":"^12.1.0","@grammyjs/runner":"^2.0.3","@modelcontextprotocol/sdk":"^1.25.3","@nyariv/sandboxjs":"github:probelabs/SandboxJS#23c4bb611f7d05f3cb8c523917b5f57103e48108","@octokit/action":"^8.0.2","@octokit/auth-app":"^8.1.0","@octokit/core":"^7.0.3","@octokit/rest":"^22.0.0","@opentelemetry/api":"^1.9.0","@opentelemetry/api-logs":"^0.203.0","@opentelemetry/core":"^1.30.1","@opentelemetry/exporter-logs-otlp-http":"^0.203.0","@opentelemetry/exporter-metrics-otlp-http":"^0.203.0","@opentelemetry/exporter-trace-otlp-grpc":"^0.203.0","@opentelemetry/exporter-trace-otlp-http":"^0.203.0","@opentelemetry/instrumentation":"^0.203.0","@opentelemetry/resources":"^1.30.1","@opentelemetry/sdk-logs":"^0.203.0","@opentelemetry/sdk-metrics":"^1.30.1","@opentelemetry/sdk-node":"^0.203.0","@opentelemetry/sdk-trace-base":"^1.30.1","@opentelemetry/semantic-conventions":"^1.30.1","@probelabs/probe":"^0.6.0-rc292","@types/commander":"^2.12.0","@types/uuid":"^10.0.0","acorn":"^8.16.0","acorn-walk":"^8.3.5","ajv":"^8.17.1","ajv-formats":"^3.0.1","better-sqlite3":"^11.0.0","blessed":"^0.1.81","botbuilder":"^4.23.3","botframework-connector":"^4.23.3","cli-table3":"^0.6.5","commander":"^14.0.0","deepmerge":"^4.3.1","dotenv":"^17.2.3","grammy":"^1.41.1","ignore":"^7.0.5","imapflow":"^1.2.12","js-yaml":"^4.1.0","jsonpath-plus":"^10.4.0","liquidjs":"^10.21.1","mailparser":"^3.9.3","minimatch":"^10.2.2","node-cron":"^3.0.3","nodemailer":"^8.0.1","open":"^9.1.0","resend":"^6.9.3","simple-git":"^3.28.0","uuid":"^11.1.0","ws":"^8.18.3"},"optionalDependencies":{"@anthropic/claude-code-sdk":"npm:null@*","@open-policy-agent/opa-wasm":"^1.10.0","knex":"^3.1.0","mysql2":"^3.11.0","pg":"^8.13.0","tedious":"^19.0.0"},"devDependencies":{"@eslint/js":"^9.34.0","@kie/act-js":"^2.6.2","@kie/mock-github":"^2.0.1","@swc/core":"^1.13.2","@swc/jest":"^0.2.37","@types/better-sqlite3":"^7.6.0","@types/blessed":"^0.1.27","@types/jest":"^30.0.0","@types/js-yaml":"^4.0.9","@types/mailparser":"^3.4.6","@types/node":"^24.3.0","@types/node-cron":"^3.0.11","@types/nodemailer":"^7.0.11","@types/ws":"^8.18.1","@typescript-eslint/eslint-plugin":"^8.42.0","@typescript-eslint/parser":"^8.42.0","@vercel/ncc":"^0.38.4","eslint":"^9.34.0","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.4","husky":"^9.1.7","jest":"^30.1.3","lint-staged":"^16.1.6","prettier":"^3.6.2","reveal-md":"^6.1.2","ts-json-schema-generator":"^1.5.1","ts-node":"^10.9.2","tsup":"^8.5.0","typescript":"^5.9.2","wrangler":"^3.0.0"},"peerDependenciesMeta":{"@anthropic/claude-code-sdk":{"optional":true}},"directories":{"test":"tests"},"lint-staged":{"src/**/*.{ts,js}":["eslint --fix","prettier --write"],"tests/**/*.{ts,js}":["eslint --fix","prettier --write"],"*.{json,md,yml,yaml}":["prettier --write"]}}');
610581
610684
 
610582
610685
  /***/ })
610583
610686