@probelabs/visor 0.1.176 → 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 (75) hide show
  1. package/dist/frontends/slack-frontend.d.ts.map +1 -1
  2. package/dist/index.js +1964 -44
  3. package/dist/sdk/{a2a-frontend-W54ZZ32L.mjs → a2a-frontend-BPWLYLCG.mjs} +2 -2
  4. package/dist/sdk/{check-provider-registry-MJYNLB37.mjs → check-provider-registry-G64PWDCZ.mjs} +5 -5
  5. package/dist/sdk/{check-provider-registry-7HSDAKHQ.mjs → check-provider-registry-HW4QPPSA.mjs} +2 -2
  6. package/dist/sdk/{chunk-Y2DYDGGY.mjs → chunk-GVTWESYN.mjs} +3 -3
  7. package/dist/sdk/chunk-GVTWESYN.mjs.map +1 -0
  8. package/dist/sdk/{chunk-4E34HRCW.mjs → chunk-IYXOLUDJ.mjs} +74 -29
  9. package/dist/sdk/chunk-IYXOLUDJ.mjs.map +1 -0
  10. package/dist/sdk/{chunk-66PTDQAO.mjs → chunk-OHOBWVPP.mjs} +3 -3
  11. package/dist/sdk/{chunk-SEA2FWEC.mjs → chunk-OPI632LK.mjs} +2 -2
  12. package/dist/sdk/{chunk-OK4MLC3R.mjs → chunk-Y6PVSFCS.mjs} +49 -9
  13. package/dist/sdk/chunk-Y6PVSFCS.mjs.map +1 -0
  14. package/dist/sdk/{failure-condition-evaluator-RTT5SLVL.mjs → failure-condition-evaluator-HL33X7MH.mjs} +3 -3
  15. package/dist/sdk/{github-frontend-C4GG62PI.mjs → github-frontend-U2U42CKV.mjs} +3 -3
  16. package/dist/sdk/{host-6GGO2BQE.mjs → host-HFOJQIOF.mjs} +4 -4
  17. package/dist/sdk/knex-store-QCEW4I4R.mjs +527 -0
  18. package/dist/sdk/knex-store-QCEW4I4R.mjs.map +1 -0
  19. package/dist/sdk/loader-Q7K76ZIY.mjs +89 -0
  20. package/dist/sdk/loader-Q7K76ZIY.mjs.map +1 -0
  21. package/dist/sdk/opa-policy-engine-QCSSIMUF.mjs +655 -0
  22. package/dist/sdk/opa-policy-engine-QCSSIMUF.mjs.map +1 -0
  23. package/dist/sdk/{routing-DXVYOXAS.mjs → routing-SFP4D6O3.mjs} +4 -4
  24. package/dist/sdk/{schedule-tool-R7NSHTPJ.mjs → schedule-tool-45NAALKS.mjs} +2 -2
  25. package/dist/sdk/{schedule-tool-LL7XDILD.mjs → schedule-tool-7O7SWSJ4.mjs} +5 -5
  26. package/dist/sdk/{schedule-tool-handler-5GTQ6SFI.mjs → schedule-tool-handler-6MPP5DXK.mjs} +2 -2
  27. package/dist/sdk/{schedule-tool-handler-O3L2R5OJ.mjs → schedule-tool-handler-KYDXJ2ZL.mjs} +5 -5
  28. package/dist/sdk/sdk.js +1729 -295
  29. package/dist/sdk/sdk.js.map +1 -1
  30. package/dist/sdk/sdk.mjs +4 -4
  31. package/dist/sdk/slack-frontend-XKSIOUXB.mjs +910 -0
  32. package/dist/sdk/slack-frontend-XKSIOUXB.mjs.map +1 -0
  33. package/dist/sdk/{trace-helpers-CECHXDLI.mjs → trace-helpers-L3EOYW5P.mjs} +2 -2
  34. package/dist/sdk/validator-XTZJZZJH.mjs +134 -0
  35. package/dist/sdk/validator-XTZJZZJH.mjs.map +1 -0
  36. package/dist/sdk/{workflow-check-provider-EY6VSMNG.mjs → workflow-check-provider-JIXZJNV5.mjs} +5 -5
  37. package/dist/sdk/{workflow-check-provider-AX7IRQEZ.mjs → workflow-check-provider-OA33MESM.mjs} +2 -2
  38. package/dist/utils/workspace-manager.d.ts +5 -1
  39. package/dist/utils/workspace-manager.d.ts.map +1 -1
  40. package/dist/utils/worktree-manager.d.ts +5 -1
  41. package/dist/utils/worktree-manager.d.ts.map +1 -1
  42. package/package.json +2 -2
  43. package/dist/output/traces/run-2026-03-10T15-37-04-236Z.ndjson +0 -138
  44. package/dist/output/traces/run-2026-03-10T15-37-44-748Z.ndjson +0 -2296
  45. package/dist/sdk/check-provider-registry-VE6LQPLY.mjs +0 -30
  46. package/dist/sdk/chunk-4E34HRCW.mjs.map +0 -1
  47. package/dist/sdk/chunk-OK4MLC3R.mjs.map +0 -1
  48. package/dist/sdk/chunk-R3FNZRE4.mjs +0 -45194
  49. package/dist/sdk/chunk-R3FNZRE4.mjs.map +0 -1
  50. package/dist/sdk/chunk-Y2DYDGGY.mjs.map +0 -1
  51. package/dist/sdk/schedule-tool-GKKVOQB7.mjs +0 -36
  52. package/dist/sdk/schedule-tool-handler-ZZGJ3UFR.mjs +0 -40
  53. package/dist/sdk/trace-helpers-CECHXDLI.mjs.map +0 -1
  54. package/dist/sdk/workflow-check-provider-AX7IRQEZ.mjs.map +0 -1
  55. package/dist/sdk/workflow-check-provider-EY6VSMNG.mjs.map +0 -1
  56. package/dist/sdk/workflow-check-provider-HZQGJFOU.mjs +0 -30
  57. package/dist/sdk/workflow-check-provider-HZQGJFOU.mjs.map +0 -1
  58. package/dist/traces/run-2026-03-10T15-37-04-236Z.ndjson +0 -138
  59. package/dist/traces/run-2026-03-10T15-37-44-748Z.ndjson +0 -2296
  60. /package/dist/sdk/{a2a-frontend-W54ZZ32L.mjs.map → a2a-frontend-BPWLYLCG.mjs.map} +0 -0
  61. /package/dist/sdk/{check-provider-registry-7HSDAKHQ.mjs.map → check-provider-registry-G64PWDCZ.mjs.map} +0 -0
  62. /package/dist/sdk/{check-provider-registry-MJYNLB37.mjs.map → check-provider-registry-HW4QPPSA.mjs.map} +0 -0
  63. /package/dist/sdk/{chunk-66PTDQAO.mjs.map → chunk-OHOBWVPP.mjs.map} +0 -0
  64. /package/dist/sdk/{chunk-SEA2FWEC.mjs.map → chunk-OPI632LK.mjs.map} +0 -0
  65. /package/dist/sdk/{check-provider-registry-VE6LQPLY.mjs.map → failure-condition-evaluator-HL33X7MH.mjs.map} +0 -0
  66. /package/dist/sdk/{github-frontend-C4GG62PI.mjs.map → github-frontend-U2U42CKV.mjs.map} +0 -0
  67. /package/dist/sdk/{host-6GGO2BQE.mjs.map → host-HFOJQIOF.mjs.map} +0 -0
  68. /package/dist/sdk/{failure-condition-evaluator-RTT5SLVL.mjs.map → routing-SFP4D6O3.mjs.map} +0 -0
  69. /package/dist/sdk/{routing-DXVYOXAS.mjs.map → schedule-tool-45NAALKS.mjs.map} +0 -0
  70. /package/dist/sdk/{schedule-tool-GKKVOQB7.mjs.map → schedule-tool-7O7SWSJ4.mjs.map} +0 -0
  71. /package/dist/sdk/{schedule-tool-LL7XDILD.mjs.map → schedule-tool-handler-6MPP5DXK.mjs.map} +0 -0
  72. /package/dist/sdk/{schedule-tool-R7NSHTPJ.mjs.map → schedule-tool-handler-KYDXJ2ZL.mjs.map} +0 -0
  73. /package/dist/sdk/{schedule-tool-handler-5GTQ6SFI.mjs.map → trace-helpers-L3EOYW5P.mjs.map} +0 -0
  74. /package/dist/sdk/{schedule-tool-handler-O3L2R5OJ.mjs.map → workflow-check-provider-JIXZJNV5.mjs.map} +0 -0
  75. /package/dist/sdk/{schedule-tool-handler-ZZGJ3UFR.mjs.map → workflow-check-provider-OA33MESM.mjs.map} +0 -0
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  FailureConditionEvaluator,
3
3
  init_failure_condition_evaluator
4
- } from "./chunk-SEA2FWEC.mjs";
4
+ } from "./chunk-OPI632LK.mjs";
5
5
  import {
6
6
  addEvent,
7
7
  init_trace_helpers
8
- } from "./chunk-Y2DYDGGY.mjs";
8
+ } from "./chunk-GVTWESYN.mjs";
9
9
  import {
10
10
  createExtendedLiquid,
11
11
  init_liquid_extensions
@@ -1499,4 +1499,4 @@ export {
1499
1499
  evaluateTransitions,
1500
1500
  init_routing
1501
1501
  };
1502
- //# sourceMappingURL=chunk-66PTDQAO.mjs.map
1502
+ //# sourceMappingURL=chunk-OHOBWVPP.mjs.map
@@ -3,7 +3,7 @@ import {
3
3
  fallback_ndjson_exports,
4
4
  init_fallback_ndjson,
5
5
  init_trace_helpers
6
- } from "./chunk-Y2DYDGGY.mjs";
6
+ } from "./chunk-GVTWESYN.mjs";
7
7
  import {
8
8
  addFailIfTriggered,
9
9
  init_metrics
@@ -736,4 +736,4 @@ export {
736
736
  failure_condition_evaluator_exports,
737
737
  init_failure_condition_evaluator
738
738
  };
739
- //# sourceMappingURL=chunk-SEA2FWEC.mjs.map
739
+ //# sourceMappingURL=chunk-OPI632LK.mjs.map
@@ -4042,7 +4042,7 @@ async function executeWorkflowAsTool(workflowId, args, context2, argsOverrides)
4042
4042
  ...args,
4043
4043
  ...argsOverrides
4044
4044
  };
4045
- const { WorkflowCheckProvider: WorkflowCheckProvider2 } = await import("./workflow-check-provider-EY6VSMNG.mjs");
4045
+ const { WorkflowCheckProvider: WorkflowCheckProvider2 } = await import("./workflow-check-provider-OA33MESM.mjs");
4046
4046
  const provider = new WorkflowCheckProvider2();
4047
4047
  const checkConfig = {
4048
4048
  type: "workflow",
@@ -12733,10 +12733,27 @@ var init_workspace_manager = __esm({
12733
12733
  await this.deleteLocalBranches(worktreePath);
12734
12734
  }
12735
12735
  /**
12736
- * Delete all local branches in a worktree.
12736
+ * Delete local branches in a worktree that are safe to remove.
12737
+ * IMPORTANT: Git worktrees share the branch namespace with the main repo
12738
+ * and all other worktrees. We must NOT delete branches that are checked out
12739
+ * in the main working tree or any other worktree — doing so would destroy
12740
+ * the user's work.
12737
12741
  */
12738
12742
  async deleteLocalBranches(worktreePath) {
12739
12743
  const escapedPath = shellEscape(worktreePath);
12744
+ const worktreeListResult = await commandExecutor.execute(
12745
+ `git -C ${escapedPath} worktree list --porcelain`,
12746
+ { timeout: 1e4 }
12747
+ );
12748
+ const protectedBranches = /* @__PURE__ */ new Set();
12749
+ if (worktreeListResult.exitCode === 0) {
12750
+ for (const line of worktreeListResult.stdout.split("\n")) {
12751
+ const match = line.match(/^branch refs\/heads\/(.+)$/);
12752
+ if (match) {
12753
+ protectedBranches.add(match[1]);
12754
+ }
12755
+ }
12756
+ }
12740
12757
  const listResult = await commandExecutor.execute(
12741
12758
  `git -C ${escapedPath} branch --list --format='%(refname:short)'`,
12742
12759
  { timeout: 1e4 }
@@ -12746,6 +12763,10 @@ var init_workspace_manager = __esm({
12746
12763
  }
12747
12764
  const branches = listResult.stdout.trim().split("\n").map((b) => b.trim()).filter((b) => b.length > 0);
12748
12765
  for (const branch of branches) {
12766
+ if (protectedBranches.has(branch)) {
12767
+ logger.debug(`[Workspace] Skipping branch '${branch}' \u2014 checked out in another worktree`);
12768
+ continue;
12769
+ }
12749
12770
  const deleteResult = await commandExecutor.execute(
12750
12771
  `git -C ${escapedPath} branch -D ${shellEscape(branch)}`,
12751
12772
  { timeout: 1e4 }
@@ -13384,7 +13405,7 @@ var init_state_machine_execution_engine = __esm({
13384
13405
  try {
13385
13406
  const map = options?.webhookContext?.webhookData;
13386
13407
  if (map) {
13387
- const { CheckProviderRegistry: CheckProviderRegistry2 } = await import("./check-provider-registry-VE6LQPLY.mjs");
13408
+ const { CheckProviderRegistry: CheckProviderRegistry2 } = await import("./check-provider-registry-HW4QPPSA.mjs");
13388
13409
  const reg = CheckProviderRegistry2.getInstance();
13389
13410
  const p = reg.getProvider("http_input");
13390
13411
  if (p && typeof p.setWebhookContext === "function") p.setWebhookContext(map);
@@ -13507,7 +13528,7 @@ var init_state_machine_execution_engine = __esm({
13507
13528
  tag_filter: tagFilter
13508
13529
  } : config;
13509
13530
  try {
13510
- const { CheckProviderRegistry: CheckProviderRegistry2 } = await import("./check-provider-registry-VE6LQPLY.mjs");
13531
+ const { CheckProviderRegistry: CheckProviderRegistry2 } = await import("./check-provider-registry-HW4QPPSA.mjs");
13511
13532
  const registry = CheckProviderRegistry2.getInstance();
13512
13533
  registry.setCustomTools(configWithTagFilter.tools || {});
13513
13534
  } catch (error) {
@@ -13571,7 +13592,7 @@ var init_state_machine_execution_engine = __esm({
13571
13592
  try {
13572
13593
  const webhookData = this.executionContext?.webhookContext?.webhookData;
13573
13594
  if (webhookData instanceof Map) {
13574
- const { extractSlackContext: extractSlackContext2 } = await import("./schedule-tool-handler-5GTQ6SFI.mjs");
13595
+ const { extractSlackContext: extractSlackContext2 } = await import("./schedule-tool-handler-6MPP5DXK.mjs");
13575
13596
  const slackCtx = extractSlackContext2(webhookData);
13576
13597
  if (slackCtx) {
13577
13598
  const payload = Array.from(webhookData.values())[0];
@@ -41593,8 +41614,8 @@ function buildBuiltinGlobals(opts) {
41593
41614
  const asyncFunctionNames = /* @__PURE__ */ new Set();
41594
41615
  const scheduleFn = async (args = {}) => {
41595
41616
  try {
41596
- const { handleScheduleAction: handleScheduleAction2, buildScheduleToolContext: buildScheduleToolContext2 } = await import("./schedule-tool-R7NSHTPJ.mjs");
41597
- const { extractSlackContext: extractSlackContext2 } = await import("./schedule-tool-handler-5GTQ6SFI.mjs");
41617
+ const { handleScheduleAction: handleScheduleAction2, buildScheduleToolContext: buildScheduleToolContext2 } = await import("./schedule-tool-45NAALKS.mjs");
41618
+ const { extractSlackContext: extractSlackContext2 } = await import("./schedule-tool-handler-6MPP5DXK.mjs");
41598
41619
  const parentCtx = opts.sessionInfo?._parentContext;
41599
41620
  const webhookData = parentCtx?.prInfo?.eventContext?.webhookData;
41600
41621
  const visorCfg = parentCtx?.config;
@@ -42641,11 +42662,26 @@ var init_worktree_manager = __esm({
42641
42662
  await this.deleteLocalBranches(worktreePath);
42642
42663
  }
42643
42664
  /**
42644
- * Delete all local branches in a worktree.
42665
+ * Delete local branches in a worktree that are safe to remove.
42645
42666
  * Worktrees are always used in detached HEAD state, so any local branches
42646
42667
  * were unintentionally created and should be cleaned up.
42668
+ * IMPORTANT: Git worktrees share the branch namespace with the main repo
42669
+ * and all other worktrees. We must NOT delete branches that are checked out
42670
+ * in the main working tree or any other worktree — doing so would destroy
42671
+ * the user's work.
42647
42672
  */
42648
42673
  async deleteLocalBranches(worktreePath) {
42674
+ const worktreeListCmd = `git -C ${this.escapeShellArg(worktreePath)} worktree list --porcelain`;
42675
+ const worktreeListResult = await this.executeGitCommand(worktreeListCmd, { timeout: 1e4 });
42676
+ const protectedBranches = /* @__PURE__ */ new Set();
42677
+ if (worktreeListResult.exitCode === 0) {
42678
+ for (const line of worktreeListResult.stdout.split("\n")) {
42679
+ const match = line.match(/^branch refs\/heads\/(.+)$/);
42680
+ if (match) {
42681
+ protectedBranches.add(match[1]);
42682
+ }
42683
+ }
42684
+ }
42649
42685
  const listCmd = `git -C ${this.escapeShellArg(worktreePath)} branch --list --format='%(refname:short)'`;
42650
42686
  const listResult = await this.executeGitCommand(listCmd, { timeout: 1e4 });
42651
42687
  if (listResult.exitCode !== 0 || !listResult.stdout.trim()) {
@@ -42653,6 +42689,10 @@ var init_worktree_manager = __esm({
42653
42689
  }
42654
42690
  const branches = listResult.stdout.trim().split("\n").map((b) => b.trim()).filter((b) => b.length > 0);
42655
42691
  for (const branch of branches) {
42692
+ if (protectedBranches.has(branch)) {
42693
+ logger.debug(`Skipping branch '${branch}' \u2014 checked out in another worktree`);
42694
+ continue;
42695
+ }
42656
42696
  const deleteCmd = `git -C ${this.escapeShellArg(worktreePath)} branch -D ${this.escapeShellArg(branch)}`;
42657
42697
  const deleteResult = await this.executeGitCommand(deleteCmd, { timeout: 1e4 });
42658
42698
  if (deleteResult.exitCode === 0) {
@@ -45191,4 +45231,4 @@ undici/lib/fetch/body.js:
45191
45231
  undici/lib/websocket/frame.js:
45192
45232
  (*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> *)
45193
45233
  */
45194
- //# sourceMappingURL=chunk-OK4MLC3R.mjs.map
45234
+ //# sourceMappingURL=chunk-Y6PVSFCS.mjs.map