@probelabs/visor 0.1.170 → 0.1.171

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 (125) hide show
  1. package/defaults/code-talk.yaml +39 -238
  2. package/defaults/intent-router.yaml +1 -0
  3. package/dist/agent-protocol/task-store.d.ts +5 -0
  4. package/dist/agent-protocol/task-store.d.ts.map +1 -1
  5. package/dist/agent-protocol/tasks-cli-handler.d.ts.map +1 -1
  6. package/dist/agent-protocol/track-execution.d.ts +34 -0
  7. package/dist/agent-protocol/track-execution.d.ts.map +1 -0
  8. package/dist/cli-main.d.ts.map +1 -1
  9. package/dist/cli.d.ts.map +1 -1
  10. package/dist/defaults/code-talk.yaml +39 -238
  11. package/dist/defaults/intent-router.yaml +1 -0
  12. package/dist/frontends/host.d.ts +2 -0
  13. package/dist/frontends/host.d.ts.map +1 -1
  14. package/dist/generated/config-schema.d.ts +10 -6
  15. package/dist/generated/config-schema.d.ts.map +1 -1
  16. package/dist/generated/config-schema.json +10 -6
  17. package/dist/index.js +696 -95
  18. package/dist/output/traces/{run-2026-03-07T15-43-18-430Z.ndjson → run-2026-03-08T07-55-35-120Z.ndjson} +84 -84
  19. package/dist/{traces/run-2026-03-07T15-43-56-196Z.ndjson → output/traces/run-2026-03-08T07-56-13-035Z.ndjson} +1807 -1807
  20. package/dist/scheduler/scheduler.d.ts +4 -0
  21. package/dist/scheduler/scheduler.d.ts.map +1 -1
  22. package/dist/sdk/{a2a-frontend-YTXQGUDH.mjs → a2a-frontend-FGJ3UBHX.mjs} +20 -3
  23. package/dist/sdk/a2a-frontend-FGJ3UBHX.mjs.map +1 -0
  24. package/dist/sdk/{a2a-frontend-IPLHACI6.mjs → a2a-frontend-GUEGI5SX.mjs} +20 -3
  25. package/dist/sdk/a2a-frontend-GUEGI5SX.mjs.map +1 -0
  26. package/dist/sdk/{check-provider-registry-5CMLUEFG.mjs → check-provider-registry-PVTV5G5R.mjs} +7 -7
  27. package/dist/sdk/{check-provider-registry-STRAOYRJ.mjs → check-provider-registry-YTI4PU5F.mjs} +7 -7
  28. package/dist/sdk/{check-provider-registry-T5FWS4SW.mjs → check-provider-registry-ZUU7KSKR.mjs} +7 -7
  29. package/dist/sdk/{chunk-NYQTQYGU.mjs → chunk-2VDUNKIP.mjs} +62 -23
  30. package/dist/sdk/chunk-2VDUNKIP.mjs.map +1 -0
  31. package/dist/sdk/{chunk-WNLCRRQO.mjs → chunk-5SBX4KLG.mjs} +2 -2
  32. package/dist/sdk/{chunk-FTUGQP5L.mjs → chunk-6FDBLSGV.mjs} +2 -2
  33. package/dist/sdk/{chunk-2CNT2EB3.mjs → chunk-6FXVWL6M.mjs} +3 -3
  34. package/dist/sdk/{chunk-KFKHU6CM.mjs → chunk-6VVXKXTI.mjs} +19 -2
  35. package/dist/sdk/chunk-6VVXKXTI.mjs.map +1 -0
  36. package/dist/sdk/{chunk-SVBF7Y2R.mjs → chunk-A2YVTICA.mjs} +11 -7
  37. package/dist/sdk/chunk-A2YVTICA.mjs.map +1 -0
  38. package/dist/sdk/{chunk-47WAHGHK.mjs → chunk-AJK3FAA2.mjs} +3 -3
  39. package/dist/sdk/{chunk-DLO46M5M.mjs → chunk-CXA3WUOB.mjs} +62 -23
  40. package/dist/sdk/chunk-CXA3WUOB.mjs.map +1 -0
  41. package/dist/sdk/{chunk-62PXPI6Q.mjs → chunk-GGNR347O.mjs} +8 -2
  42. package/dist/sdk/chunk-GGNR347O.mjs.map +1 -0
  43. package/dist/sdk/{chunk-ZM7ALGTE.mjs → chunk-O72J3ORS.mjs} +9 -3
  44. package/dist/sdk/chunk-O72J3ORS.mjs.map +1 -0
  45. package/dist/sdk/{chunk-LB77GR4Q.mjs → chunk-XUQSI5SR.mjs} +62 -23
  46. package/dist/sdk/chunk-XUQSI5SR.mjs.map +1 -0
  47. package/dist/sdk/{config-IHECYTNT.mjs → config-6GWD673K.mjs} +2 -2
  48. package/dist/sdk/{failure-condition-evaluator-NJO6DSL4.mjs → failure-condition-evaluator-5HRNHZCC.mjs} +4 -3
  49. package/dist/sdk/{failure-condition-evaluator-T67YFO2Z.mjs → failure-condition-evaluator-EFMCQVAK.mjs} +4 -3
  50. package/dist/sdk/{github-frontend-BAPXDLBB.mjs → github-frontend-XG55VJ4R.mjs} +7 -7
  51. package/dist/sdk/{github-frontend-WPTKI4AY.mjs → github-frontend-ZZRU6P43.mjs} +7 -7
  52. package/dist/sdk/{host-6HV5FMD7.mjs → host-A4GGQVEN.mjs} +3 -3
  53. package/dist/sdk/host-A4GGQVEN.mjs.map +1 -0
  54. package/dist/sdk/{host-K6IZWJG3.mjs → host-A7UNRBQU.mjs} +3 -3
  55. package/dist/sdk/host-A7UNRBQU.mjs.map +1 -0
  56. package/dist/sdk/{routing-RWZEXSRZ.mjs → routing-AMRQYI7J.mjs} +5 -4
  57. package/dist/sdk/{routing-SAGHEUOA.mjs → routing-BVEHVZHK.mjs} +5 -4
  58. package/dist/sdk/{schedule-tool-JCKV47FU.mjs → schedule-tool-4MTFIHCA.mjs} +7 -7
  59. package/dist/sdk/{schedule-tool-TGWPINHO.mjs → schedule-tool-DGVJDHJM.mjs} +7 -7
  60. package/dist/sdk/{schedule-tool-H4G5ITNL.mjs → schedule-tool-PHSF5U2B.mjs} +7 -7
  61. package/dist/sdk/{schedule-tool-handler-OEBLE5AB.mjs → schedule-tool-handler-EFNCZNS7.mjs} +7 -7
  62. package/dist/sdk/{schedule-tool-handler-UQWDPFP6.mjs → schedule-tool-handler-LMXQ4BZQ.mjs} +7 -7
  63. package/dist/sdk/{schedule-tool-handler-ZDAD6SWM.mjs → schedule-tool-handler-XLCSBU3E.mjs} +7 -7
  64. package/dist/sdk/sdk.d.mts +4 -0
  65. package/dist/sdk/sdk.d.ts +4 -0
  66. package/dist/sdk/sdk.js +398 -254
  67. package/dist/sdk/sdk.js.map +1 -1
  68. package/dist/sdk/sdk.mjs +6 -6
  69. package/dist/sdk/{trace-helpers-ZYN23GBG.mjs → trace-helpers-4ZBZWH5W.mjs} +3 -2
  70. package/dist/sdk/{trace-helpers-M7RVAZQ2.mjs → trace-helpers-P5L4COO4.mjs} +3 -2
  71. package/dist/sdk/track-execution-VWLQIGY7.mjs +82 -0
  72. package/dist/sdk/track-execution-VWLQIGY7.mjs.map +1 -0
  73. package/dist/sdk/{workflow-check-provider-OAOD3A5U.mjs → workflow-check-provider-KQNLEQEY.mjs} +7 -7
  74. package/dist/sdk/{workflow-check-provider-VDSZR7Y5.mjs → workflow-check-provider-WLMTCFRA.mjs} +7 -7
  75. package/dist/sdk/{workflow-check-provider-FAO4AUGB.mjs → workflow-check-provider-X5EMAJUZ.mjs} +7 -7
  76. package/dist/slack/socket-runner.d.ts +4 -0
  77. package/dist/slack/socket-runner.d.ts.map +1 -1
  78. package/dist/telemetry/trace-helpers.d.ts.map +1 -1
  79. package/dist/traces/{run-2026-03-07T15-43-18-430Z.ndjson → run-2026-03-08T07-55-35-120Z.ndjson} +84 -84
  80. package/dist/{output/traces/run-2026-03-07T15-43-56-196Z.ndjson → traces/run-2026-03-08T07-56-13-035Z.ndjson} +1807 -1807
  81. package/dist/tui/chat-runner.d.ts +4 -0
  82. package/dist/tui/chat-runner.d.ts.map +1 -1
  83. package/dist/types/cli.d.ts +2 -0
  84. package/dist/types/cli.d.ts.map +1 -1
  85. package/dist/types/config.d.ts +4 -0
  86. package/dist/types/config.d.ts.map +1 -1
  87. package/dist/utils/instance-id.d.ts +9 -0
  88. package/dist/utils/instance-id.d.ts.map +1 -0
  89. package/package.json +2 -2
  90. package/dist/sdk/a2a-frontend-IPLHACI6.mjs.map +0 -1
  91. package/dist/sdk/a2a-frontend-YTXQGUDH.mjs.map +0 -1
  92. package/dist/sdk/chunk-62PXPI6Q.mjs.map +0 -1
  93. package/dist/sdk/chunk-DLO46M5M.mjs.map +0 -1
  94. package/dist/sdk/chunk-KFKHU6CM.mjs.map +0 -1
  95. package/dist/sdk/chunk-LB77GR4Q.mjs.map +0 -1
  96. package/dist/sdk/chunk-NYQTQYGU.mjs.map +0 -1
  97. package/dist/sdk/chunk-SVBF7Y2R.mjs.map +0 -1
  98. package/dist/sdk/chunk-ZM7ALGTE.mjs.map +0 -1
  99. package/dist/sdk/host-6HV5FMD7.mjs.map +0 -1
  100. package/dist/sdk/host-K6IZWJG3.mjs.map +0 -1
  101. /package/dist/sdk/{check-provider-registry-5CMLUEFG.mjs.map → check-provider-registry-PVTV5G5R.mjs.map} +0 -0
  102. /package/dist/sdk/{check-provider-registry-STRAOYRJ.mjs.map → check-provider-registry-YTI4PU5F.mjs.map} +0 -0
  103. /package/dist/sdk/{check-provider-registry-T5FWS4SW.mjs.map → check-provider-registry-ZUU7KSKR.mjs.map} +0 -0
  104. /package/dist/sdk/{chunk-FTUGQP5L.mjs.map → chunk-5SBX4KLG.mjs.map} +0 -0
  105. /package/dist/sdk/{chunk-WNLCRRQO.mjs.map → chunk-6FDBLSGV.mjs.map} +0 -0
  106. /package/dist/sdk/{chunk-2CNT2EB3.mjs.map → chunk-6FXVWL6M.mjs.map} +0 -0
  107. /package/dist/sdk/{chunk-47WAHGHK.mjs.map → chunk-AJK3FAA2.mjs.map} +0 -0
  108. /package/dist/sdk/{config-IHECYTNT.mjs.map → config-6GWD673K.mjs.map} +0 -0
  109. /package/dist/sdk/{failure-condition-evaluator-NJO6DSL4.mjs.map → failure-condition-evaluator-5HRNHZCC.mjs.map} +0 -0
  110. /package/dist/sdk/{failure-condition-evaluator-T67YFO2Z.mjs.map → failure-condition-evaluator-EFMCQVAK.mjs.map} +0 -0
  111. /package/dist/sdk/{github-frontend-BAPXDLBB.mjs.map → github-frontend-XG55VJ4R.mjs.map} +0 -0
  112. /package/dist/sdk/{github-frontend-WPTKI4AY.mjs.map → github-frontend-ZZRU6P43.mjs.map} +0 -0
  113. /package/dist/sdk/{routing-RWZEXSRZ.mjs.map → routing-AMRQYI7J.mjs.map} +0 -0
  114. /package/dist/sdk/{routing-SAGHEUOA.mjs.map → routing-BVEHVZHK.mjs.map} +0 -0
  115. /package/dist/sdk/{schedule-tool-H4G5ITNL.mjs.map → schedule-tool-4MTFIHCA.mjs.map} +0 -0
  116. /package/dist/sdk/{schedule-tool-JCKV47FU.mjs.map → schedule-tool-DGVJDHJM.mjs.map} +0 -0
  117. /package/dist/sdk/{schedule-tool-TGWPINHO.mjs.map → schedule-tool-PHSF5U2B.mjs.map} +0 -0
  118. /package/dist/sdk/{schedule-tool-handler-OEBLE5AB.mjs.map → schedule-tool-handler-EFNCZNS7.mjs.map} +0 -0
  119. /package/dist/sdk/{schedule-tool-handler-UQWDPFP6.mjs.map → schedule-tool-handler-LMXQ4BZQ.mjs.map} +0 -0
  120. /package/dist/sdk/{schedule-tool-handler-ZDAD6SWM.mjs.map → schedule-tool-handler-XLCSBU3E.mjs.map} +0 -0
  121. /package/dist/sdk/{trace-helpers-M7RVAZQ2.mjs.map → trace-helpers-4ZBZWH5W.mjs.map} +0 -0
  122. /package/dist/sdk/{trace-helpers-ZYN23GBG.mjs.map → trace-helpers-P5L4COO4.mjs.map} +0 -0
  123. /package/dist/sdk/{workflow-check-provider-FAO4AUGB.mjs.map → workflow-check-provider-KQNLEQEY.mjs.map} +0 -0
  124. /package/dist/sdk/{workflow-check-provider-OAOD3A5U.mjs.map → workflow-check-provider-WLMTCFRA.mjs.map} +0 -0
  125. /package/dist/sdk/{workflow-check-provider-VDSZR7Y5.mjs.map → workflow-check-provider-X5EMAJUZ.mjs.map} +0 -0
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- process.env.VISOR_VERSION = '0.1.170';
3
- process.env.PROBE_VERSION = '0.6.0-rc286';
4
- process.env.VISOR_COMMIT_SHA = '3e49bfdee61154013b28eba096637ac60cdd08ac';
5
- process.env.VISOR_COMMIT_SHORT = '3e49bfdee';
2
+ process.env.VISOR_VERSION = '0.1.171';
3
+ process.env.PROBE_VERSION = '0.6.0-rc290';
4
+ process.env.VISOR_COMMIT_SHA = '12d9273ce614376592cf397b6c874dcbfa220b8b';
5
+ process.env.VISOR_COMMIT_SHORT = '12d9273ce';
6
6
  /******/ (() => { // webpackBootstrap
7
7
  /******/ var __webpack_modules__ = ({
8
8
 
@@ -168110,6 +168110,13 @@ class SqliteTaskStore {
168110
168110
  messageText = textPart?.text ?? '';
168111
168111
  }
168112
168112
  catch { }
168113
+ let source = '-';
168114
+ let metadata = {};
168115
+ try {
168116
+ metadata = JSON.parse(r.request_metadata || '{}');
168117
+ source = metadata.source || '-';
168118
+ }
168119
+ catch { }
168113
168120
  return {
168114
168121
  id: r.id,
168115
168122
  context_id: r.context_id,
@@ -168121,6 +168128,8 @@ class SqliteTaskStore {
168121
168128
  workflow_id: r.workflow_id,
168122
168129
  run_id: r.run_id,
168123
168130
  request_message: messageText,
168131
+ source,
168132
+ metadata,
168124
168133
  };
168125
168134
  });
168126
168135
  return { rows, total };
@@ -168139,6 +168148,11 @@ class SqliteTaskStore {
168139
168148
  SET state = ?, updated_at = ?, status_message = ?
168140
168149
  WHERE id = ?`).run(newState, now, statusMessage ? JSON.stringify(statusMessage) : null, taskId);
168141
168150
  }
168151
+ claimTask(taskId, workerId) {
168152
+ const db = this.getDb();
168153
+ const now = nowISO();
168154
+ db.prepare(`UPDATE agent_tasks SET claimed_by = ?, claimed_at = ?, updated_at = ? WHERE id = ?`).run(workerId, now, now, taskId);
168155
+ }
168142
168156
  addArtifact(taskId, artifact) {
168143
168157
  const db = this.getDb();
168144
168158
  const row = db.prepare('SELECT artifacts FROM agent_tasks WHERE id = ?').get(taskId);
@@ -168396,6 +168410,7 @@ exports.handleTasksCommand = handleTasksCommand;
168396
168410
  * visor tasks help - Show usage
168397
168411
  */
168398
168412
  const logger_1 = __nccwpck_require__(86999);
168413
+ const instance_id_1 = __nccwpck_require__(89942);
168399
168414
  const task_store_1 = __nccwpck_require__(24711);
168400
168415
  const state_transitions_1 = __nccwpck_require__(68612);
168401
168416
  // ---------------------------------------------------------------------------
@@ -168477,22 +168492,34 @@ function buildFilter(flags) {
168477
168492
  // ---------------------------------------------------------------------------
168478
168493
  // Table formatting
168479
168494
  // ---------------------------------------------------------------------------
168495
+ function formatMeta(meta) {
168496
+ const parts = [];
168497
+ if (meta.slack_user)
168498
+ parts.push(`user:${meta.slack_user}`);
168499
+ if (meta.slack_channel)
168500
+ parts.push(`ch:${meta.slack_channel}`);
168501
+ if (meta.trace_id)
168502
+ parts.push(`trace:${String(meta.trace_id).slice(0, 8)}`);
168503
+ if (meta.schedule_id)
168504
+ parts.push(`sched:${meta.schedule_id}`);
168505
+ return parts.join(' ') || '-';
168506
+ }
168480
168507
  function formatTable(rows, total) {
168481
168508
  if (rows.length === 0)
168482
168509
  return 'No tasks found.';
168483
- const header = ['ID', 'State', 'Agent', 'Duration', 'Worker', 'Input'];
168510
+ const header = ['ID', 'Source', 'State', 'Workflow', 'Duration', 'Instance', 'Meta', 'Input'];
168484
168511
  const data = rows.map(r => {
168485
- const duration = r.state === 'working' && r.claimed_at
168486
- ? formatDuration(r.claimed_at)
168487
- : r.state === 'submitted'
168488
- ? formatDuration(r.created_at)
168489
- : formatDuration(r.created_at, r.updated_at);
168490
- const worker = r.claimed_by ? r.claimed_by.slice(0, 8) : '-';
168491
- const agent = r.workflow_id || '-';
168512
+ const duration = (0, state_transitions_1.isTerminalState)(r.state)
168513
+ ? formatDuration(r.created_at, r.updated_at)
168514
+ : formatDuration(r.claimed_at || r.created_at);
168515
+ const instance = r.claimed_by || '-';
168516
+ const workflow = r.workflow_id || '-';
168517
+ const source = r.source || '-';
168518
+ const meta = formatMeta(r.metadata);
168492
168519
  const input = r.request_message.length > 60
168493
168520
  ? r.request_message.slice(0, 57) + '...'
168494
168521
  : r.request_message || '-';
168495
- return [r.id.slice(0, 8), r.state, agent, duration, worker, input];
168522
+ return [r.id.slice(0, 8), source, r.state, workflow, duration, instance, meta, input];
168496
168523
  });
168497
168524
  const widths = header.map((h, i) => Math.max(h.length, ...data.map(row => row[i].length)));
168498
168525
  const sep = widths.map(w => '-'.repeat(w)).join(' ');
@@ -168505,19 +168532,19 @@ function formatTable(rows, total) {
168505
168532
  function formatMarkdown(rows, total) {
168506
168533
  if (rows.length === 0)
168507
168534
  return 'No tasks found.';
168508
- const header = ['ID', 'State', 'Agent', 'Duration', 'Worker', 'Input'];
168535
+ const header = ['ID', 'Source', 'State', 'Workflow', 'Duration', 'Instance', 'Meta', 'Input'];
168509
168536
  const data = rows.map(r => {
168510
- const duration = r.state === 'working' && r.claimed_at
168511
- ? formatDuration(r.claimed_at)
168512
- : r.state === 'submitted'
168513
- ? formatDuration(r.created_at)
168514
- : formatDuration(r.created_at, r.updated_at);
168515
- const worker = r.claimed_by ? r.claimed_by.slice(0, 8) : '-';
168516
- const agent = r.workflow_id || '-';
168537
+ const duration = (0, state_transitions_1.isTerminalState)(r.state)
168538
+ ? formatDuration(r.created_at, r.updated_at)
168539
+ : formatDuration(r.claimed_at || r.created_at);
168540
+ const instance = r.claimed_by || '-';
168541
+ const workflow = r.workflow_id || '-';
168542
+ const source = r.source || '-';
168543
+ const meta = formatMeta(r.metadata);
168517
168544
  const input = r.request_message.length > 60
168518
168545
  ? r.request_message.slice(0, 57) + '...'
168519
168546
  : r.request_message || '-';
168520
- return [r.id.slice(0, 8), r.state, agent, duration, worker, input];
168547
+ return [r.id.slice(0, 8), source, r.state, workflow, duration, instance, meta, input];
168521
168548
  });
168522
168549
  const lines = [
168523
168550
  '| ' + header.join(' | ') + ' |',
@@ -168534,16 +168561,19 @@ function formatMarkdown(rows, total) {
168534
168561
  async function handleList(flags) {
168535
168562
  const filter = buildFilter(flags);
168536
168563
  const output = typeof flags.output === 'string' ? flags.output : 'table';
168564
+ const instanceId = (0, instance_id_1.getInstanceId)();
168537
168565
  const render = async () => {
168538
168566
  await withTaskStore(async (store) => {
168539
168567
  const { rows, total } = store.listTasksRaw(filter);
168540
168568
  if (output === 'json') {
168541
- console.log(JSON.stringify({ tasks: rows, total }, null, 2));
168569
+ console.log(JSON.stringify({ instance_id: instanceId, tasks: rows, total }, null, 2));
168542
168570
  }
168543
168571
  else if (output === 'markdown') {
168572
+ console.log(`Instance: ${instanceId}\n`);
168544
168573
  console.log(formatMarkdown(rows, total));
168545
168574
  }
168546
168575
  else {
168576
+ console.log(`Instance: ${instanceId}\n`);
168547
168577
  console.log(formatTable(rows, total));
168548
168578
  }
168549
168579
  });
@@ -168551,7 +168581,7 @@ async function handleList(flags) {
168551
168581
  if (flags.watch) {
168552
168582
  const watchRender = async () => {
168553
168583
  process.stdout.write('\x1Bc'); // clear terminal
168554
- console.log(`visor tasks list (watching, Ctrl+C to exit)\n`);
168584
+ console.log(`visor tasks list (instance: ${instanceId}, watching, Ctrl+C to exit)\n`);
168555
168585
  try {
168556
168586
  await render();
168557
168587
  }
@@ -168657,17 +168687,67 @@ async function handleCancel(positional, _flags) {
168657
168687
  });
168658
168688
  }
168659
168689
  // ---------------------------------------------------------------------------
168690
+ // Subcommand: show
168691
+ // ---------------------------------------------------------------------------
168692
+ async function handleShow(positional, flags) {
168693
+ const taskId = positional[0];
168694
+ if (!taskId) {
168695
+ console.error('Usage: visor tasks show <task-id>');
168696
+ process.exitCode = 1;
168697
+ return;
168698
+ }
168699
+ const output = typeof flags.output === 'string' ? flags.output : 'table';
168700
+ await withTaskStore(async (store) => {
168701
+ // Try to find by prefix match
168702
+ const { rows } = store.listTasksRaw({ limit: 200 });
168703
+ const match = rows.find(r => r.id.startsWith(taskId));
168704
+ if (!match) {
168705
+ console.error(`Task not found: ${taskId}`);
168706
+ process.exitCode = 1;
168707
+ return;
168708
+ }
168709
+ if (output === 'json') {
168710
+ console.log(JSON.stringify(match, null, 2));
168711
+ return;
168712
+ }
168713
+ const duration = (0, state_transitions_1.isTerminalState)(match.state)
168714
+ ? formatDuration(match.created_at, match.updated_at)
168715
+ : formatDuration(match.claimed_at || match.created_at);
168716
+ console.log(`Task: ${match.id}`);
168717
+ console.log(`State: ${match.state}`);
168718
+ console.log(`Source: ${match.source}`);
168719
+ console.log(`Workflow: ${match.workflow_id || '-'}`);
168720
+ console.log(`Instance: ${match.claimed_by || '-'}`);
168721
+ console.log(`Duration: ${duration}`);
168722
+ console.log(`Created: ${match.created_at}`);
168723
+ console.log(`Updated: ${match.updated_at}`);
168724
+ if (match.run_id)
168725
+ console.log(`Run ID: ${match.run_id}`);
168726
+ console.log(`Input: ${match.request_message}`);
168727
+ // Show metadata
168728
+ const meta = match.metadata;
168729
+ const metaKeys = Object.keys(meta).filter(k => k !== 'source');
168730
+ if (metaKeys.length > 0) {
168731
+ console.log(`\nMetadata:`);
168732
+ for (const key of metaKeys) {
168733
+ console.log(` ${key}: ${JSON.stringify(meta[key])}`);
168734
+ }
168735
+ }
168736
+ });
168737
+ }
168738
+ // ---------------------------------------------------------------------------
168660
168739
  // Help
168661
168740
  // ---------------------------------------------------------------------------
168662
168741
  function printHelp() {
168663
168742
  console.log(`
168664
- Visor Tasks - Monitor and manage A2A agent tasks
168743
+ Visor Tasks - Monitor and manage agent tasks
168665
168744
 
168666
168745
  USAGE:
168667
168746
  visor tasks [command] [options]
168668
168747
 
168669
168748
  COMMANDS:
168670
168749
  list List tasks (default)
168750
+ show <task-id> Show task details (supports prefix match)
168671
168751
  stats Queue summary statistics
168672
168752
  cancel <task-id> Cancel a task
168673
168753
  help Show this help
@@ -168681,6 +168761,7 @@ OPTIONS:
168681
168761
 
168682
168762
  EXAMPLES:
168683
168763
  visor tasks List all tasks
168764
+ visor tasks show abc123 Show full task details
168684
168765
  visor tasks list --state working Show only working tasks
168685
168766
  visor tasks list --agent security-review Show tasks for a specific agent
168686
168767
  visor tasks list --output json JSON output
@@ -168704,6 +168785,9 @@ async function handleTasksCommand(argv) {
168704
168785
  case 'list':
168705
168786
  await handleList(flags);
168706
168787
  break;
168788
+ case 'show':
168789
+ await handleShow(positional, flags);
168790
+ break;
168707
168791
  case 'stats':
168708
168792
  await handleStats(flags);
168709
168793
  break;
@@ -168730,6 +168814,93 @@ async function handleTasksCommand(argv) {
168730
168814
  }
168731
168815
 
168732
168816
 
168817
+ /***/ }),
168818
+
168819
+ /***/ 7628:
168820
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
168821
+
168822
+ "use strict";
168823
+
168824
+ /**
168825
+ * Shared execution tracking helper.
168826
+ *
168827
+ * Wraps any engine execution call with task lifecycle management:
168828
+ * creates a task in 'submitted' state, transitions to 'working',
168829
+ * runs the executor, then sets terminal state (completed/failed).
168830
+ *
168831
+ * Used by CLI, Slack, TUI, and Scheduler frontends when task_tracking is enabled.
168832
+ */
168833
+ var __importDefault = (this && this.__importDefault) || function (mod) {
168834
+ return (mod && mod.__esModule) ? mod : { "default": mod };
168835
+ };
168836
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
168837
+ exports.trackExecution = trackExecution;
168838
+ const crypto_1 = __importDefault(__nccwpck_require__(76982));
168839
+ const path_1 = __importDefault(__nccwpck_require__(16928));
168840
+ const logger_1 = __nccwpck_require__(86999);
168841
+ const lazy_otel_1 = __nccwpck_require__(21084);
168842
+ const instance_id_1 = __nccwpck_require__(89942);
168843
+ /**
168844
+ * Wrap an engine execution call with task lifecycle tracking.
168845
+ *
168846
+ * Creates a task, transitions to 'working', runs the executor,
168847
+ * then sets terminal state. Returns both the task and the original result.
168848
+ * Re-throws any executor error after marking the task as failed.
168849
+ */
168850
+ async function trackExecution(opts, executor) {
168851
+ const { taskStore, source, configPath, metadata, messageText } = opts;
168852
+ const configName = configPath ? path_1.default.basename(configPath, path_1.default.extname(configPath)) : undefined;
168853
+ const workflowId = configName && opts.workflowId ? `${configName}#${opts.workflowId}` : opts.workflowId;
168854
+ const requestMessage = {
168855
+ message_id: crypto_1.default.randomUUID(),
168856
+ role: 'user',
168857
+ parts: [{ text: messageText }],
168858
+ };
168859
+ const task = taskStore.createTask({
168860
+ contextId: crypto_1.default.randomUUID(),
168861
+ requestMessage,
168862
+ workflowId,
168863
+ requestMetadata: {
168864
+ source,
168865
+ instance_id: (0, instance_id_1.getInstanceId)(),
168866
+ trace_id: lazy_otel_1.trace.getActiveSpan()?.spanContext().traceId || undefined,
168867
+ ...metadata,
168868
+ },
168869
+ });
168870
+ const instanceId = (0, instance_id_1.getInstanceId)();
168871
+ taskStore.updateTaskState(task.id, 'working');
168872
+ taskStore.claimTask(task.id, instanceId);
168873
+ logger_1.logger.info(`[TaskTracking] Task ${task.id} started (source=${source}, workflow=${workflowId || '-'}, instance=${instanceId})`);
168874
+ try {
168875
+ const result = await executor();
168876
+ const completedMsg = {
168877
+ message_id: crypto_1.default.randomUUID(),
168878
+ role: 'agent',
168879
+ parts: [{ text: 'Execution completed' }],
168880
+ };
168881
+ taskStore.updateTaskState(task.id, 'completed', completedMsg);
168882
+ logger_1.logger.info(`[TaskTracking] Task ${task.id} completed`);
168883
+ return { task, result };
168884
+ }
168885
+ catch (err) {
168886
+ const errorText = err instanceof Error ? err.message : String(err);
168887
+ const failMessage = {
168888
+ message_id: crypto_1.default.randomUUID(),
168889
+ role: 'agent',
168890
+ parts: [{ text: errorText }],
168891
+ };
168892
+ try {
168893
+ taskStore.updateTaskState(task.id, 'failed', failMessage);
168894
+ logger_1.logger.info(`[TaskTracking] Task ${task.id} failed: ${errorText}`);
168895
+ }
168896
+ catch {
168897
+ // ignore double-failure
168898
+ }
168899
+ throw err; // re-throw to preserve original behavior
168900
+ }
168901
+ }
168902
+
168903
+
168733
168904
  /***/ }),
168734
168905
 
168735
168906
  /***/ 43137:
@@ -172627,6 +172798,20 @@ async function main() {
172627
172798
  catch (err) {
172628
172799
  logger_1.logger.debug(`Startup snapshot failed: ${err}`);
172629
172800
  }
172801
+ // ---- Shared Task Store (cross-frontend tracking) ----
172802
+ let sharedTaskStore = null;
172803
+ const taskTrackingEnabled = options.taskTracking || config.task_tracking === true;
172804
+ if (taskTrackingEnabled) {
172805
+ try {
172806
+ const { SqliteTaskStore } = await Promise.resolve().then(() => __importStar(__nccwpck_require__(24711)));
172807
+ sharedTaskStore = new SqliteTaskStore();
172808
+ await sharedTaskStore.initialize();
172809
+ logger_1.logger.info('[TaskTracking] Shared task store initialized');
172810
+ }
172811
+ catch (err) {
172812
+ logger_1.logger.warn(`[TaskTracking] Failed to initialize task store: ${err instanceof Error ? err.message : err}`);
172813
+ }
172814
+ }
172630
172815
  // ---- A2A Agent Protocol Server ----
172631
172816
  let a2aFrontendInstance = null;
172632
172817
  let sharedEngine = null;
@@ -172640,7 +172825,7 @@ async function main() {
172640
172825
  process.exit(1);
172641
172826
  }
172642
172827
  const engine = new SMEngine();
172643
- const frontend = new A2AFrontend(agentConfig);
172828
+ const frontend = new A2AFrontend(agentConfig, sharedTaskStore ?? undefined);
172644
172829
  frontend.setEngine(engine);
172645
172830
  frontend.setVisorConfig(config);
172646
172831
  const eventBus = new EventBus();
@@ -172717,6 +172902,8 @@ async function main() {
172717
172902
  threads,
172718
172903
  channel_allowlist: allow,
172719
172904
  });
172905
+ if (sharedTaskStore)
172906
+ runner.setTaskStore(sharedTaskStore, options.configPath);
172720
172907
  await runner.start();
172721
172908
  console.log('✅ Slack Socket Mode is running. Press Ctrl+C to exit.');
172722
172909
  // Start config file watcher if --watch is enabled
@@ -172773,6 +172960,12 @@ async function main() {
172773
172960
  }
172774
172961
  }
172775
172962
  await runner.stop();
172963
+ if (sharedTaskStore) {
172964
+ try {
172965
+ await sharedTaskStore.shutdown();
172966
+ }
172967
+ catch { }
172968
+ }
172776
172969
  process.exit(0);
172777
172970
  };
172778
172971
  process.on('SIGINT', sig => {
@@ -173144,12 +173337,27 @@ async function main() {
173144
173337
  conversation: tuiConversation,
173145
173338
  });
173146
173339
  // Execute workflow
173147
- const rerunResult = await (0, trace_helpers_1.withActiveSpan)('visor.run', {
173340
+ const tuiExecFn = () => (0, trace_helpers_1.withActiveSpan)('visor.run', {
173148
173341
  ...(0, trace_helpers_1.getVisorRunAttributes)(),
173149
173342
  'visor.run.checks_configured': checksToRun.length,
173150
173343
  'visor.run.source': 'tui-rerun',
173151
173344
  }, async () => rerunEngine.executeGroupedChecks(prInfo, checksToRun, options.timeout, config, options.output, options.debug || false, options.maxParallelism, options.failFast, tagFilter, async () => { } // No pause gate for TUI re-runs
173152
173345
  ));
173346
+ let rerunResult;
173347
+ if (sharedTaskStore) {
173348
+ const { trackExecution } = await Promise.resolve().then(() => __importStar(__nccwpck_require__(7628)));
173349
+ const tracked = await trackExecution({
173350
+ taskStore: sharedTaskStore,
173351
+ source: 'tui',
173352
+ workflowId: checksToRun.join(','),
173353
+ configPath: options.configPath,
173354
+ messageText: message,
173355
+ }, tuiExecFn);
173356
+ rerunResult = tracked.result;
173357
+ }
173358
+ else {
173359
+ rerunResult = await tuiExecFn();
173360
+ }
173153
173361
  // Show any errors and the last result in the chat
173154
173362
  if (rerunResult?.results) {
173155
173363
  const allRerunResults = Object.values(rerunResult.results).flat();
@@ -173251,7 +173459,21 @@ async function main() {
173251
173459
  process.exit(0);
173252
173460
  }
173253
173461
  else {
173254
- executionResult = await (0, trace_helpers_1.withActiveSpan)('visor.run', { ...(0, trace_helpers_1.getVisorRunAttributes)(), 'visor.run.checks_configured': checksToRun.length }, async () => engine.executeGroupedChecks(prInfo, checksToRun, options.timeout, config, options.output, options.debug || false, options.maxParallelism, options.failFast, tagFilter, pauseGate));
173462
+ const cliExecFn = () => (0, trace_helpers_1.withActiveSpan)('visor.run', { ...(0, trace_helpers_1.getVisorRunAttributes)(), 'visor.run.checks_configured': checksToRun.length }, async () => engine.executeGroupedChecks(prInfo, checksToRun, options.timeout, config, options.output, options.debug || false, options.maxParallelism, options.failFast, tagFilter, pauseGate));
173463
+ if (sharedTaskStore) {
173464
+ const { trackExecution } = await Promise.resolve().then(() => __importStar(__nccwpck_require__(7628)));
173465
+ const tracked = await trackExecution({
173466
+ taskStore: sharedTaskStore,
173467
+ source: 'cli',
173468
+ workflowId: checksToRun.join(','),
173469
+ configPath: options.configPath,
173470
+ messageText: options.message || `CLI run: ${checksToRun.join(', ')}`,
173471
+ }, cliExecFn);
173472
+ executionResult = tracked.result;
173473
+ }
173474
+ else {
173475
+ executionResult = await cliExecFn();
173476
+ }
173255
173477
  }
173256
173478
  // Extract results and statistics from the execution result
173257
173479
  const { results: groupedResults, statistics: executionStatistics } = executionResult;
@@ -173443,6 +173665,12 @@ async function main() {
173443
173665
  return;
173444
173666
  }
173445
173667
  // Normal exit path (no debug server)
173668
+ if (sharedTaskStore) {
173669
+ try {
173670
+ await sharedTaskStore.shutdown();
173671
+ }
173672
+ catch { }
173673
+ }
173446
173674
  try {
173447
173675
  await (0, fallback_ndjson_1.flushNdjson)();
173448
173676
  }
@@ -173652,6 +173880,7 @@ class CLI {
173652
173880
  .option('--workspace-name <name>', 'Workspace directory name (overrides VISOR_WORKSPACE_NAME)')
173653
173881
  .option('--workspace-project-name <name>', 'Main project folder name inside workspace (overrides VISOR_WORKSPACE_PROJECT)')
173654
173882
  .option('--watch', 'Watch config file for changes and reload automatically (requires --config)')
173883
+ .option('--task-tracking', 'Enable cross-frontend task tracking (all executions recorded in visor tasks)')
173655
173884
  .option('--github-token <token>', 'GitHub token for API operations (env: GITHUB_TOKEN)')
173656
173885
  .option('--github-app-id <id>', 'GitHub App ID (env: GITHUB_APP_ID)')
173657
173886
  .option('--github-private-key <key>', 'GitHub App private key, PEM content or file path (env: GITHUB_APP_PRIVATE_KEY)')
@@ -173713,6 +173942,7 @@ class CLI {
173713
173942
  .option('--workspace-name <name>', 'Workspace directory name (overrides VISOR_WORKSPACE_NAME)')
173714
173943
  .option('--workspace-project-name <name>', 'Main project folder name inside workspace (overrides VISOR_WORKSPACE_PROJECT)')
173715
173944
  .option('--watch', 'Watch config file for changes and reload automatically (requires --config)')
173945
+ .option('--task-tracking', 'Enable cross-frontend task tracking (all executions recorded in visor tasks)')
173716
173946
  .option('--github-token <token>', 'GitHub token for API operations (env: GITHUB_TOKEN)')
173717
173947
  .option('--github-app-id <id>', 'GitHub App ID (env: GITHUB_APP_ID)')
173718
173948
  .option('--github-private-key <key>', 'GitHub App private key, PEM content or file path (env: GITHUB_APP_PRIVATE_KEY)')
@@ -173787,6 +174017,7 @@ class CLI {
173787
174017
  workspaceName: options.workspaceName,
173788
174018
  workspaceProjectName: options.workspaceProjectName,
173789
174019
  watch: Boolean(options.watch),
174020
+ taskTracking: Boolean(options.taskTracking),
173790
174021
  githubToken: options.githubToken,
173791
174022
  githubAppId: options.githubAppId,
173792
174023
  githubPrivateKey: options.githubPrivateKey,
@@ -179969,6 +180200,10 @@ exports.configSchema = {
179969
180200
  $ref: '#/definitions/AgentProtocolConfig',
179970
180201
  description: 'Agent protocol (A2A) server configuration',
179971
180202
  },
180203
+ task_tracking: {
180204
+ type: 'boolean',
180205
+ description: 'Enable cross-frontend task tracking (default: false). When true, all workflow executions (CLI, Slack, TUI, Scheduler) are recorded in a shared SQLite TaskStore visible via `visor tasks`.',
180206
+ },
179972
180207
  },
179973
180208
  required: ['version'],
179974
180209
  patternProperties: {
@@ -180704,7 +180939,7 @@ exports.configSchema = {
180704
180939
  description: 'Arguments/inputs for the workflow',
180705
180940
  },
180706
180941
  overrides: {
180707
- $ref: '#/definitions/Record%3Cstring%2CPartial%3Cinterface-src_types_config.ts-13844-28438-src_types_config.ts-0-55681%3E%3E',
180942
+ $ref: '#/definitions/Record%3Cstring%2CPartial%3Cinterface-src_types_config.ts-13844-28438-src_types_config.ts-0-55916%3E%3E',
180708
180943
  description: 'Override specific step configurations in the workflow',
180709
180944
  },
180710
180945
  output_mapping: {
@@ -180720,7 +180955,7 @@ exports.configSchema = {
180720
180955
  description: 'Config file path - alternative to workflow ID (loads a Visor config file as workflow)',
180721
180956
  },
180722
180957
  workflow_overrides: {
180723
- $ref: '#/definitions/Record%3Cstring%2CPartial%3Cinterface-src_types_config.ts-13844-28438-src_types_config.ts-0-55681%3E%3E',
180958
+ $ref: '#/definitions/Record%3Cstring%2CPartial%3Cinterface-src_types_config.ts-13844-28438-src_types_config.ts-0-55916%3E%3E',
180724
180959
  description: 'Alias for overrides - workflow step overrides (backward compatibility)',
180725
180960
  },
180726
180961
  ref: {
@@ -181418,7 +181653,7 @@ exports.configSchema = {
181418
181653
  description: 'Custom output name (defaults to workflow name)',
181419
181654
  },
181420
181655
  overrides: {
181421
- $ref: '#/definitions/Record%3Cstring%2CPartial%3Cinterface-src_types_config.ts-13844-28438-src_types_config.ts-0-55681%3E%3E',
181656
+ $ref: '#/definitions/Record%3Cstring%2CPartial%3Cinterface-src_types_config.ts-13844-28438-src_types_config.ts-0-55916%3E%3E',
181422
181657
  description: 'Step overrides',
181423
181658
  },
181424
181659
  output_mapping: {
@@ -181433,13 +181668,13 @@ exports.configSchema = {
181433
181668
  '^x-': {},
181434
181669
  },
181435
181670
  },
181436
- 'Record<string,Partial<interface-src_types_config.ts-13844-28438-src_types_config.ts-0-55681>>': {
181671
+ 'Record<string,Partial<interface-src_types_config.ts-13844-28438-src_types_config.ts-0-55916>>': {
181437
181672
  type: 'object',
181438
181673
  additionalProperties: {
181439
- $ref: '#/definitions/Partial%3Cinterface-src_types_config.ts-13844-28438-src_types_config.ts-0-55681%3E',
181674
+ $ref: '#/definitions/Partial%3Cinterface-src_types_config.ts-13844-28438-src_types_config.ts-0-55916%3E',
181440
181675
  },
181441
181676
  },
181442
- 'Partial<interface-src_types_config.ts-13844-28438-src_types_config.ts-0-55681>': {
181677
+ 'Partial<interface-src_types_config.ts-13844-28438-src_types_config.ts-0-55916>': {
181443
181678
  type: 'object',
181444
181679
  additionalProperties: false,
181445
181680
  },
@@ -206231,6 +206466,8 @@ class Scheduler {
206231
206466
  outputAdapters = new Map();
206232
206467
  executionContext = {};
206233
206468
  contextEnricher;
206469
+ taskStore;
206470
+ configPath;
206234
206471
  // HA fields
206235
206472
  haConfig;
206236
206473
  nodeId;
@@ -206256,6 +206493,11 @@ class Scheduler {
206256
206493
  setEngine(engine) {
206257
206494
  this.engine = engine;
206258
206495
  }
206496
+ /** Set shared task store for execution tracking. */
206497
+ setTaskStore(store, configPath) {
206498
+ this.taskStore = store;
206499
+ this.configPath = configPath;
206500
+ }
206259
206501
  /**
206260
206502
  * Set the execution context (e.g., Slack client) for workflow executions
206261
206503
  */
@@ -206843,7 +207085,7 @@ class Scheduler {
206843
207085
  // Use common preparation helper
206844
207086
  const { engine: runEngine, config: cfgForRun } = this.prepareExecution(schedule);
206845
207087
  // Execute the workflow
206846
- await runEngine.executeChecks({
207088
+ const schedExecFn = () => runEngine.executeChecks({
206847
207089
  checks: checksToRun,
206848
207090
  showDetails: true,
206849
207091
  outputFormat: 'json',
@@ -206852,6 +207094,20 @@ class Scheduler {
206852
207094
  debug: process.env.VISOR_DEBUG === 'true',
206853
207095
  inputs: schedule.workflowInputs,
206854
207096
  });
207097
+ if (this.taskStore) {
207098
+ const { trackExecution } = await Promise.resolve().then(() => __importStar(__nccwpck_require__(7628)));
207099
+ await trackExecution({
207100
+ taskStore: this.taskStore,
207101
+ source: 'scheduler',
207102
+ workflowId: schedule.workflow,
207103
+ configPath: this.configPath,
207104
+ messageText: `Scheduled: ${schedule.workflow} (${schedule.id})`,
207105
+ metadata: { schedule_id: schedule.id, is_recurring: schedule.isRecurring },
207106
+ }, schedExecFn);
207107
+ }
207108
+ else {
207109
+ await schedExecFn();
207110
+ }
206855
207111
  return { message: 'Workflow completed', workflow: schedule.workflow };
206856
207112
  }
206857
207113
  /**
@@ -206964,7 +207220,7 @@ Please provide an updated response based on the reminder above. You may referenc
206964
207220
  const { engine: runEngine, config: cfgForRun, responseRef, } = this.prepareExecution(schedule, reminderText);
206965
207221
  try {
206966
207222
  // Execute ALL checks - let the visor engine route based on config
206967
- await runEngine.executeChecks({
207223
+ const reminderExecFn = () => runEngine.executeChecks({
206968
207224
  checks: allChecks,
206969
207225
  showDetails: true,
206970
207226
  outputFormat: 'json',
@@ -206972,6 +207228,20 @@ Please provide an updated response based on the reminder above. You may referenc
206972
207228
  webhookContext: { webhookData, eventType: 'schedule' },
206973
207229
  debug: process.env.VISOR_DEBUG === 'true',
206974
207230
  });
207231
+ if (this.taskStore) {
207232
+ const { trackExecution } = await Promise.resolve().then(() => __importStar(__nccwpck_require__(7628)));
207233
+ await trackExecution({
207234
+ taskStore: this.taskStore,
207235
+ source: 'scheduler',
207236
+ workflowId: schedule.workflow,
207237
+ configPath: this.configPath,
207238
+ messageText: reminderText || `Reminder: ${schedule.id}`,
207239
+ metadata: { schedule_id: schedule.id, is_recurring: schedule.isRecurring },
207240
+ }, reminderExecFn);
207241
+ }
207242
+ else {
207243
+ await reminderExecFn();
207244
+ }
206975
207245
  // The visor pipeline handles output via frontends (Slack, etc.)
206976
207246
  // We return success - the actual response was posted by the pipeline
206977
207247
  // Save captured response for recurring reminders (previousResponse feature)
@@ -209872,6 +210142,8 @@ class SlackSocketRunner {
209872
210142
  heartbeatTimer;
209873
210143
  lastPong = 0;
209874
210144
  closing = false; // prevent duplicate reconnects
210145
+ taskStore;
210146
+ configPath;
209875
210147
  constructor(engine, cfg, opts) {
209876
210148
  const app = opts.appToken || process.env.SLACK_APP_TOKEN || '';
209877
210149
  if (!app)
@@ -209894,6 +210166,11 @@ class SlackSocketRunner {
209894
210166
  this.cfg = cfg;
209895
210167
  this.initMessageTriggersFromConfig();
209896
210168
  }
210169
+ /** Set shared task store for execution tracking. */
210170
+ setTaskStore(store, configPath) {
210171
+ this.taskStore = store;
210172
+ this.configPath = configPath;
210173
+ }
209897
210174
  /** Hot-swap the config used for future requests (does not affect in-flight ones). */
209898
210175
  updateConfig(cfg) {
209899
210176
  this.cfg = cfg;
@@ -210012,6 +210289,8 @@ class SlackSocketRunner {
210012
210289
  defaultTimezone: schedulerCfg?.default_timezone,
210013
210290
  });
210014
210291
  this.genericScheduler.setEngine(this.engine);
210292
+ if (this.taskStore)
210293
+ this.genericScheduler.setTaskStore(this.taskStore, this.configPath);
210015
210294
  // Pass Slack client to scheduler so it can inject into workflow executions
210016
210295
  this.genericScheduler.setExecutionContext({
210017
210296
  slack: this.client,
@@ -210567,7 +210846,7 @@ class SlackSocketRunner {
210567
210846
  }
210568
210847
  }
210569
210848
  // Cold run (no snapshot)
210570
- await runEngine.executeChecks({
210849
+ const execFn = () => runEngine.executeChecks({
210571
210850
  checks: allChecks,
210572
210851
  showDetails: true,
210573
210852
  outputFormat: 'json',
@@ -210575,6 +210854,24 @@ class SlackSocketRunner {
210575
210854
  webhookContext: { webhookData: map, eventType: 'manual' },
210576
210855
  debug: process.env.VISOR_DEBUG === 'true',
210577
210856
  });
210857
+ if (this.taskStore) {
210858
+ const { trackExecution } = await Promise.resolve().then(() => __importStar(__nccwpck_require__(7628)));
210859
+ await trackExecution({
210860
+ taskStore: this.taskStore,
210861
+ source: 'slack',
210862
+ workflowId: allChecks.join(','),
210863
+ configPath: this.configPath,
210864
+ messageText: String(ev.text || 'Slack message'),
210865
+ metadata: {
210866
+ slack_channel: channelId,
210867
+ slack_thread_ts: threadTs,
210868
+ slack_user: userId,
210869
+ },
210870
+ }, execFn);
210871
+ }
210872
+ else {
210873
+ await execFn();
210874
+ }
210578
210875
  });
210579
210876
  }
210580
210877
  finally {
@@ -210707,7 +211004,7 @@ class SlackSocketRunner {
210707
211004
  'slack.thread_ts': threadTs || ts,
210708
211005
  'slack.user_id': user,
210709
211006
  }, async () => {
210710
- await runEngine.executeChecks({
211007
+ const triggerExecFn = () => runEngine.executeChecks({
210711
211008
  checks: checksToRun,
210712
211009
  showDetails: true,
210713
211010
  outputFormat: 'json',
@@ -210716,6 +211013,25 @@ class SlackSocketRunner {
210716
211013
  debug: process.env.VISOR_DEBUG === 'true',
210717
211014
  inputs: trigger.inputs,
210718
211015
  });
211016
+ if (this.taskStore) {
211017
+ const { trackExecution } = await Promise.resolve().then(() => __importStar(__nccwpck_require__(7628)));
211018
+ await trackExecution({
211019
+ taskStore: this.taskStore,
211020
+ source: 'slack',
211021
+ workflowId: trigger.workflow || checksToRun.join(','),
211022
+ configPath: this.configPath,
211023
+ messageText: String(ev.text || `Trigger: ${id}`),
211024
+ metadata: {
211025
+ slack_channel: channel,
211026
+ slack_thread_ts: threadTs || ts,
211027
+ slack_user: user,
211028
+ trigger_id: id,
211029
+ },
211030
+ }, triggerExecFn);
211031
+ }
211032
+ else {
211033
+ await triggerExecFn();
211034
+ }
210719
211035
  });
210720
211036
  logger_1.logger.info(`[SlackSocket] Message trigger '${id}' workflow completed`);
210721
211037
  }
@@ -222456,6 +222772,7 @@ exports.getVisorRunAttributes = getVisorRunAttributes;
222456
222772
  exports.__getOrCreateNdjsonPath = __getOrCreateNdjsonPath;
222457
222773
  exports._appendRunMarker = _appendRunMarker;
222458
222774
  const lazy_otel_1 = __nccwpck_require__(21084);
222775
+ const instance_id_1 = __nccwpck_require__(89942);
222459
222776
  function getTracer() {
222460
222777
  return lazy_otel_1.trace.getTracer('visor');
222461
222778
  }
@@ -222563,6 +222880,7 @@ function getVisorRunAttributes() {
222563
222880
  if (commitFull) {
222564
222881
  attrs['visor.commit.sha'] = commitFull;
222565
222882
  }
222883
+ attrs['visor.instance_id'] = (0, instance_id_1.getInstanceId)();
222566
222884
  return attrs;
222567
222885
  }
222568
222886
  // Internal helper for tests: write a minimal run marker to NDJSON when using file sink
@@ -227075,10 +227393,43 @@ function validateTestsDoc(doc) {
227075
227393
  /***/ }),
227076
227394
 
227077
227395
  /***/ 20881:
227078
- /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
227396
+ /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
227079
227397
 
227080
227398
  "use strict";
227081
227399
 
227400
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
227401
+ if (k2 === undefined) k2 = k;
227402
+ var desc = Object.getOwnPropertyDescriptor(m, k);
227403
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
227404
+ desc = { enumerable: true, get: function() { return m[k]; } };
227405
+ }
227406
+ Object.defineProperty(o, k2, desc);
227407
+ }) : (function(o, m, k, k2) {
227408
+ if (k2 === undefined) k2 = k;
227409
+ o[k2] = m[k];
227410
+ }));
227411
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
227412
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
227413
+ }) : function(o, v) {
227414
+ o["default"] = v;
227415
+ });
227416
+ var __importStar = (this && this.__importStar) || (function () {
227417
+ var ownKeys = function(o) {
227418
+ ownKeys = Object.getOwnPropertyNames || function (o) {
227419
+ var ar = [];
227420
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
227421
+ return ar;
227422
+ };
227423
+ return ownKeys(o);
227424
+ };
227425
+ return function (mod) {
227426
+ if (mod && mod.__esModule) return mod;
227427
+ var result = {};
227428
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
227429
+ __setModuleDefault(result, mod);
227430
+ return result;
227431
+ };
227432
+ })();
227082
227433
  Object.defineProperty(exports, "__esModule", ({ value: true }));
227083
227434
  exports.TuiChatRunner = void 0;
227084
227435
  exports.startChatTUI = startChatTUI;
@@ -227106,6 +227457,8 @@ class TuiChatRunner {
227106
227457
  messageCounter = 0;
227107
227458
  isRunning = false;
227108
227459
  currentExecution;
227460
+ taskStore;
227461
+ configPath;
227109
227462
  constructor(config) {
227110
227463
  this.cfg = config.config;
227111
227464
  this.stateManager = config.stateManager ?? new chat_state_1.ChatStateManager();
@@ -227114,6 +227467,11 @@ class TuiChatRunner {
227114
227467
  // Set as global state manager
227115
227468
  (0, chat_state_1.setChatStateManager)(this.stateManager);
227116
227469
  }
227470
+ /** Set shared task store for execution tracking. */
227471
+ setTaskStore(store, configPath) {
227472
+ this.taskStore = store;
227473
+ this.configPath = configPath;
227474
+ }
227117
227475
  async start() {
227118
227476
  // Create ChatTUI
227119
227477
  this.chatTui = new chat_tui_1.ChatTUI({
@@ -227260,16 +227618,28 @@ class TuiChatRunner {
227260
227618
  'tui.message_id': messageId,
227261
227619
  }, async () => {
227262
227620
  try {
227263
- await runEngine.executeChecks({
227621
+ const tuiExecFn = () => runEngine.executeChecks({
227264
227622
  checks: allChecks,
227265
227623
  showDetails: true,
227266
227624
  outputFormat: 'json',
227267
227625
  config: cfgForRun,
227268
227626
  webhookContext: { webhookData, eventType: 'manual' },
227269
227627
  debug: this.debug,
227270
- // Pass conversation directly in options for TUI mode
227271
227628
  conversation: ctx.conversation,
227272
227629
  });
227630
+ if (this.taskStore) {
227631
+ const { trackExecution } = await Promise.resolve().then(() => __importStar(__nccwpck_require__(7628)));
227632
+ await trackExecution({
227633
+ taskStore: this.taskStore,
227634
+ source: 'tui',
227635
+ workflowId: allChecks.join(','),
227636
+ configPath: this.configPath,
227637
+ messageText: message,
227638
+ }, tuiExecFn);
227639
+ }
227640
+ else {
227641
+ await tuiExecFn();
227642
+ }
227273
227643
  }
227274
227644
  catch (error) {
227275
227645
  const errorMessage = error instanceof Error ? error.message : String(error);
@@ -232254,6 +232624,32 @@ function generateShortHumanId() {
232254
232624
  }
232255
232625
 
232256
232626
 
232627
+ /***/ }),
232628
+
232629
+ /***/ 89942:
232630
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
232631
+
232632
+ "use strict";
232633
+
232634
+ /**
232635
+ * Visor instance ID — unique per process lifetime.
232636
+ *
232637
+ * Used to identify which visor instance created/owns a task,
232638
+ * especially in multi-node environments.
232639
+ */
232640
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
232641
+ exports.getInstanceId = getInstanceId;
232642
+ const human_id_1 = __nccwpck_require__(30920);
232643
+ let _instanceId;
232644
+ /** Get or generate the visor instance ID for this process. */
232645
+ function getInstanceId() {
232646
+ if (!_instanceId) {
232647
+ _instanceId = (0, human_id_1.generateHumanId)();
232648
+ }
232649
+ return _instanceId;
232650
+ }
232651
+
232652
+
232257
232653
  /***/ }),
232258
232654
 
232259
232655
  /***/ 91784:
@@ -261212,7 +261608,8 @@ var init_search = __esm({
261212
261608
  session: "--session",
261213
261609
  timeout: "--timeout",
261214
261610
  language: "--language",
261215
- format: "--format"
261611
+ format: "--format",
261612
+ lsp: "--lsp"
261216
261613
  };
261217
261614
  }
261218
261615
  });
@@ -261448,7 +261845,8 @@ var init_extract = __esm({
261448
261845
  allowTests: "--allow-tests",
261449
261846
  contextLines: "--context",
261450
261847
  format: "--format",
261451
- inputFile: "--input-file"
261848
+ inputFile: "--input-file",
261849
+ lsp: "--lsp"
261452
261850
  };
261453
261851
  }
261454
261852
  });
@@ -286325,7 +286723,14 @@ function parseTargets(targets) {
286325
286723
  }
286326
286724
  function parseAndResolvePaths(pathStr, cwd) {
286327
286725
  if (!pathStr) return [];
286328
- const paths = pathStr.split(",").map((p) => p.trim()).filter((p) => p.length > 0);
286726
+ let paths = pathStr.split(",").map((p) => p.trim()).filter((p) => p.length > 0);
286727
+ paths = paths.flatMap((p) => {
286728
+ if (!/\s/.test(p)) return [p];
286729
+ const parts = p.split(/\s+/).filter(Boolean);
286730
+ if (parts.length <= 1) return [p];
286731
+ const allLookLikePaths = parts.every((part) => /[/\\]/.test(part) || /\.\w+/.test(part));
286732
+ return allLookLikePaths ? parts : [p];
286733
+ });
286329
286734
  return paths.map((p) => {
286330
286735
  if ((0, import_path5.isAbsolute)(p)) {
286331
286736
  return p;
@@ -305988,6 +306393,7 @@ var init_parser2 = __esm({
305988
306393
  { ALT: () => this.CONSUME(Identifier) },
305989
306394
  { ALT: () => this.CONSUME(Text) },
305990
306395
  { ALT: () => this.CONSUME(NumberLiteral) },
306396
+ { ALT: () => this.CONSUME(ColorValue) },
305991
306397
  // Note: RoundOpen and RoundClose (parentheses) are NOT allowed in unquoted labels
305992
306398
  // to match Mermaid's behavior - use quoted labels like ["text (with parens)"] instead
305993
306399
  // Allow HTML-like tags (e.g., <br/>) inside labels
@@ -306079,6 +306485,7 @@ var init_parser2 = __esm({
306079
306485
  { ALT: () => this.CONSUME(Identifier) },
306080
306486
  { ALT: () => this.CONSUME(Text) },
306081
306487
  { ALT: () => this.CONSUME(NumberLiteral) },
306488
+ { ALT: () => this.CONSUME(ColorValue) },
306082
306489
  // Allow HTML-like angle brackets and slashes for <br/>, <i>, etc.
306083
306490
  { ALT: () => this.CONSUME(AngleLess) },
306084
306491
  { ALT: () => this.CONSUME(AngleOpen) },
@@ -307254,13 +307661,24 @@ function mapFlowchartParserError(err, text) {
307254
307661
  length: len
307255
307662
  };
307256
307663
  }
307257
- if (tokType === "QuotedString" || tokType === "SquareOpen" || tokType === "SquareClose") {
307664
+ if (tokType === "QuotedString" || tokType === "SquareOpen" || tokType === "SquareClose" || tokType === "DiamondOpen" || tokType === "DiamondClose") {
307258
307665
  const context = err?.context;
307259
307666
  const inLinkRule = context?.ruleStack?.includes("linkTextInline") || context?.ruleStack?.includes("link") || false;
307260
307667
  const lineContent = allLines[Math.max(0, line - 1)] || "";
307261
307668
  const beforeQuote = lineContent.slice(0, Math.max(0, column - 1));
307262
307669
  const hasLinkBefore = beforeQuote.match(/--\s*$|==\s*$|-\.\s*$|-\.-\s*$|\[\s*$/);
307263
307670
  if (inLinkRule || hasLinkBefore) {
307671
+ if (tokType === "DiamondOpen" || tokType === "DiamondClose") {
307672
+ return {
307673
+ line,
307674
+ column,
307675
+ severity: "error",
307676
+ code: "FL-EDGE-LABEL-CURLY-IN-PIPES",
307677
+ message: "Curly braces { } are not supported inside pipe-delimited edge labels.",
307678
+ hint: "Use HTML entities &#123; and &#125; inside |...|, e.g., --|Resolve $&#123;VAR&#125;|-->",
307679
+ length: len
307680
+ };
307681
+ }
307264
307682
  if (tokType === "SquareOpen" || tokType === "SquareClose") {
307265
307683
  return {
307266
307684
  line,
@@ -307322,6 +307740,17 @@ function mapFlowchartParserError(err, text) {
307322
307740
  length: len
307323
307741
  };
307324
307742
  }
307743
+ if (tokType === "DiamondOpen" || tokType === "DiamondClose") {
307744
+ return {
307745
+ line,
307746
+ column,
307747
+ severity: "error",
307748
+ code: "FL-LABEL-CURLY-IN-UNQUOTED",
307749
+ message: "Curly braces are not supported inside unquoted node labels.",
307750
+ hint: "Use &#123; and &#125; for literal braces, e.g., C[Substitute &#123;params&#125;].",
307751
+ length: len
307752
+ };
307753
+ }
307325
307754
  {
307326
307755
  const caret0 = Math.max(0, column - 1);
307327
307756
  const openIdx = lineStr.lastIndexOf("[", caret0);
@@ -307363,9 +307792,20 @@ function mapFlowchartParserError(err, text) {
307363
307792
  length: len
307364
307793
  };
307365
307794
  }
307795
+ if (seg.includes("{") || seg.includes("}")) {
307796
+ return {
307797
+ line,
307798
+ column,
307799
+ severity: "error",
307800
+ code: "FL-LABEL-CURLY-IN-UNQUOTED",
307801
+ message: "Curly braces are not supported inside unquoted node labels.",
307802
+ hint: "Use &#123; and &#125; for literal braces, e.g., C[Substitute &#123;params&#125;].",
307803
+ length: len
307804
+ };
307805
+ }
307366
307806
  }
307367
307807
  }
307368
- if (tokType === "QuotedString" || tokType === "SquareOpen" || tokType === "SquareClose") {
307808
+ if (tokType === "QuotedString") {
307369
307809
  return {
307370
307810
  line,
307371
307811
  column,
@@ -307376,6 +307816,17 @@ function mapFlowchartParserError(err, text) {
307376
307816
  length: len
307377
307817
  };
307378
307818
  }
307819
+ if (tokType === "SquareOpen" || tokType === "SquareClose") {
307820
+ return {
307821
+ line,
307822
+ column,
307823
+ severity: "error",
307824
+ code: "FL-LABEL-BRACKET-IN-UNQUOTED",
307825
+ message: "Square brackets are not supported inside unquoted node labels.",
307826
+ hint: 'Use &#91; and &#93; for literal brackets or wrap the label in quotes, e.g., C["bind_paths[]"]',
307827
+ length: len
307828
+ };
307829
+ }
307379
307830
  const q = findInnerQuoteIssue("[");
307380
307831
  if (q?.kind === "escaped") {
307381
307832
  return { line, column: q.column, severity: "error", code: "FL-LABEL-ESCAPED-QUOTE", message: 'Escaped quotes (\\") in node labels are not supported by Mermaid. Use &quot; instead.', hint: 'Prefer "He said &quot;Hi&quot;".', length: 2 };
@@ -307386,7 +307837,7 @@ function mapFlowchartParserError(err, text) {
307386
307837
  return { line, column, severity: "error", code: "FL-NODE-UNCLOSED-BRACKET", message: "Unclosed '['. Add a matching ']' before the arrow or newline.", hint: "Example: A[Label] --> B", length: 1 };
307387
307838
  }
307388
307839
  if (expecting(err, "RoundClose")) {
307389
- if (tokType === "QuotedString" || tokType === "SquareOpen" || tokType === "SquareClose") {
307840
+ if (tokType === "QuotedString") {
307390
307841
  return {
307391
307842
  line,
307392
307843
  column,
@@ -307397,6 +307848,17 @@ function mapFlowchartParserError(err, text) {
307397
307848
  length: len
307398
307849
  };
307399
307850
  }
307851
+ if (tokType === "SquareOpen" || tokType === "SquareClose") {
307852
+ return {
307853
+ line,
307854
+ column,
307855
+ severity: "error",
307856
+ code: "FL-LABEL-BRACKET-IN-UNQUOTED",
307857
+ message: "Square brackets are not supported inside unquoted node labels.",
307858
+ hint: 'Use &#91; and &#93; for literal brackets or wrap the label in quotes, e.g., C["bind_paths[]"]',
307859
+ length: len
307860
+ };
307861
+ }
307400
307862
  {
307401
307863
  const caret0 = Math.max(0, column - 1);
307402
307864
  const openIdx = lineStr.lastIndexOf("(", caret0);
@@ -307425,7 +307887,7 @@ function mapFlowchartParserError(err, text) {
307425
307887
  return { line, column, severity: "error", code: "FL-NODE-UNCLOSED-BRACKET", message: "Unclosed '('. Add a matching ')'.", hint: "Example: B(Label)", length: 1 };
307426
307888
  }
307427
307889
  if (expecting(err, "DiamondClose")) {
307428
- if (tokType === "QuotedString" || tokType === "SquareOpen" || tokType === "SquareClose") {
307890
+ if (tokType === "QuotedString") {
307429
307891
  return {
307430
307892
  line,
307431
307893
  column,
@@ -307436,6 +307898,17 @@ function mapFlowchartParserError(err, text) {
307436
307898
  length: len
307437
307899
  };
307438
307900
  }
307901
+ if (tokType === "SquareOpen" || tokType === "SquareClose") {
307902
+ return {
307903
+ line,
307904
+ column,
307905
+ severity: "error",
307906
+ code: "FL-LABEL-BRACKET-IN-UNQUOTED",
307907
+ message: "Square brackets are not supported inside unquoted node labels.",
307908
+ hint: 'Use &#91; and &#93; for literal brackets or wrap the label in quotes, e.g., C["bind_paths[]"]',
307909
+ length: len
307910
+ };
307911
+ }
307439
307912
  {
307440
307913
  const caret0 = Math.max(0, column - 1);
307441
307914
  const openIdx = lineStr.lastIndexOf("{", caret0);
@@ -308278,7 +308751,7 @@ function validateFlowchart(text, options = {}) {
308278
308751
  const byLine = /* @__PURE__ */ new Map();
308279
308752
  const collect = (arr) => {
308280
308753
  for (const e of arr || []) {
308281
- if (e && (e.code === "FL-LABEL-PARENS-UNQUOTED" || e.code === "FL-LABEL-AT-IN-UNQUOTED" || e.code === "FL-LABEL-QUOTE-IN-UNQUOTED" || e.code === "FL-LABEL-SLASH-UNQUOTED")) {
308754
+ if (e && (e.code === "FL-LABEL-PARENS-UNQUOTED" || e.code === "FL-LABEL-AT-IN-UNQUOTED" || e.code === "FL-LABEL-QUOTE-IN-UNQUOTED" || e.code === "FL-LABEL-SLASH-UNQUOTED" || e.code === "FL-LABEL-CURLY-IN-UNQUOTED" || e.code === "FL-LABEL-BRACKET-IN-UNQUOTED")) {
308282
308755
  const ln = e.line ?? 0;
308283
308756
  const col = e.column ?? 1;
308284
308757
  const list = byLine.get(ln) || [];
@@ -308360,6 +308833,9 @@ function validateFlowchart(text, options = {}) {
308360
308833
  const hasParens = seg.includes("(") || seg.includes(")");
308361
308834
  const hasAt = seg.includes("@");
308362
308835
  const hasQuote = seg.includes('"');
308836
+ const hasCurly = seg.includes("{") || seg.includes("}");
308837
+ const hasBracket = seg.includes("[") || seg.includes("]");
308838
+ const isDoubleSquare = raw.slice(i, i + 2) === "[[" && raw.slice(j - 2, j) === "]]";
308363
308839
  const isSingleQuoted = /^'[^]*'$/.test(trimmed);
308364
308840
  const hasLeadingSlash = lsp === "/" || lsp === "\\";
308365
308841
  if (!covered && !isQuoted && !isParenWrapped && hasParens) {
@@ -308377,6 +308853,16 @@ function validateFlowchart(text, options = {}) {
308377
308853
  existing.push({ start: startCol, end: endCol });
308378
308854
  byLine.set(ln, existing);
308379
308855
  }
308856
+ if (!covered && !isQuoted && !isSlashPair && hasCurly) {
308857
+ errs.push({ line: ln, column: startCol, severity: "error", code: "FL-LABEL-CURLY-IN-UNQUOTED", message: "Curly braces are not supported inside unquoted node labels.", hint: "Use &#123; and &#125; for literal braces, e.g., C[Substitute &#123;params&#125;]." });
308858
+ existing.push({ start: startCol, end: endCol });
308859
+ byLine.set(ln, existing);
308860
+ }
308861
+ if (!covered && !isQuoted && !isSlashPair && !isDoubleSquare && hasBracket) {
308862
+ errs.push({ line: ln, column: startCol, severity: "error", code: "FL-LABEL-BRACKET-IN-UNQUOTED", message: "Square brackets are not supported inside unquoted node labels.", hint: 'Use &#91; and &#93; for literal brackets or wrap the label in quotes, e.g., C["bind_paths[]"]' });
308863
+ existing.push({ start: startCol, end: endCol });
308864
+ byLine.set(ln, existing);
308865
+ }
308380
308866
  if (!covered && !isQuoted && !isSlashPair && hasQuote && !isSingleQuoted) {
308381
308867
  errs.push({ line: ln, column: startCol, severity: "error", code: "FL-LABEL-QUOTE-IN-UNQUOTED", message: "Quotes are not allowed inside unquoted node labels. Use &quot; for quotes or wrap the entire label in quotes.", hint: 'Example: C["HTML Output: data-trigger-visibility=&quot;true&quot;"]' });
308382
308868
  existing.push({ start: startCol, end: endCol });
@@ -310737,7 +311223,7 @@ function computeFixes(text, errors, level = "safe") {
310737
311223
  }
310738
311224
  continue;
310739
311225
  }
310740
- if (is("FL-EDGE-LABEL-BRACKET", e)) {
311226
+ if (is("FL-EDGE-LABEL-BRACKET", e) || is("FL-EDGE-LABEL-CURLY-IN-PIPES", e)) {
310741
311227
  const lineText = lineTextAt(text, e.line);
310742
311228
  const firstBar = lineText.indexOf("|");
310743
311229
  const secondBar = firstBar >= 0 ? lineText.indexOf("|", firstBar + 1) : -1;
@@ -310745,7 +311231,8 @@ function computeFixes(text, errors, level = "safe") {
310745
311231
  const before = lineText.slice(0, firstBar + 1);
310746
311232
  const label = lineText.slice(firstBar + 1, secondBar);
310747
311233
  const after = lineText.slice(secondBar);
310748
- const fixedLabel = label.replace(/\[/g, "&#91;").replace(/\]/g, "&#93;");
311234
+ let fixedLabel = label.replace(/\[/g, "&#91;").replace(/\]/g, "&#93;");
311235
+ fixedLabel = fixedLabel.replace(/\{/g, "&#123;").replace(/\}/g, "&#125;");
310749
311236
  const fixedLine = before + fixedLabel + after;
310750
311237
  const finalLine = fixedLine.replace(/\[([^\]]*)\]/g, (m, seg) => "[" + String(seg).replace(/`/g, "") + "]");
310751
311238
  edits.push({ start: { line: e.line, column: 1 }, end: { line: e.line, column: lineText.length + 1 }, newText: finalLine });
@@ -311385,7 +311872,7 @@ function computeFixes(text, errors, level = "safe") {
311385
311872
  }
311386
311873
  continue;
311387
311874
  }
311388
- if (is("FL-LABEL-PARENS-UNQUOTED", e) || is("FL-LABEL-AT-IN-UNQUOTED", e) || is("FL-LABEL-SLASH-UNQUOTED", e)) {
311875
+ if (is("FL-LABEL-PARENS-UNQUOTED", e) || is("FL-LABEL-AT-IN-UNQUOTED", e) || is("FL-LABEL-SLASH-UNQUOTED", e) || is("FL-LABEL-CURLY-IN-UNQUOTED", e) || is("FL-LABEL-BRACKET-IN-UNQUOTED", e)) {
311389
311876
  if (level === "safe" || level === "all") {
311390
311877
  if (patchedLines.has(e.line))
311391
311878
  continue;
@@ -311426,7 +311913,7 @@ function computeFixes(text, errors, level = "safe") {
311426
311913
  if (openIdx === -1)
311427
311914
  break;
311428
311915
  const contentStart = openIdx + shape.open.length;
311429
- const closeIdx = shape.open === "(" && shape.close === ")" ? findMatchingCloser(lineText, openIdx, shape.open, shape.close) : lineText.indexOf(shape.close, contentStart);
311916
+ const closeIdx = shape.open === "(" && shape.close === ")" || shape.open === "[" && shape.close === "]" ? findMatchingCloser(lineText, openIdx, shape.open, shape.close) : lineText.indexOf(shape.close, contentStart);
311430
311917
  if (closeIdx === -1)
311431
311918
  break;
311432
311919
  if (openIdx <= caret0 && caret0 < closeIdx) {
@@ -311446,11 +311933,21 @@ function computeFixes(text, errors, level = "safe") {
311446
311933
  const isSlashPair = (l, r) => l === "/" && r === "/" || l === "\\" && r === "\\" || l === "/" && r === "\\" || l === "\\" && r === "/";
311447
311934
  const isParallelogramShape = core.length >= 2 && isSlashPair(left, right);
311448
311935
  let replaced;
311449
- if (!isParallelogramShape) {
311450
- const escaped = inner.replace(/`/g, "").replace(/\"/g, "&quot;").replace(/"/g, "&quot;");
311936
+ if (is("FL-LABEL-BRACKET-IN-UNQUOTED", e) && !isParallelogramShape) {
311937
+ const hasOtherHazards = /[(){}@]/.test(inner) || inner.includes('"') || inner.includes('\\"');
311938
+ if (hasOtherHazards) {
311939
+ const escaped = inner.replace(/`/g, "").replace(/\\"/g, "&quot;").replace(/"/g, "&quot;");
311940
+ replaced = '"' + escaped + '"';
311941
+ } else {
311942
+ replaced = inner.replace(/\[/g, "&#91;").replace(/\]/g, "&#93;");
311943
+ }
311944
+ } else if (is("FL-LABEL-CURLY-IN-UNQUOTED", e)) {
311945
+ replaced = inner.replace(/\{/g, "&#123;").replace(/\}/g, "&#125;");
311946
+ } else if (!isParallelogramShape) {
311947
+ const escaped = inner.replace(/`/g, "").replace(/\\"/g, "&quot;").replace(/"/g, "&quot;");
311451
311948
  replaced = '"' + escaped + '"';
311452
311949
  } else {
311453
- replaced = inner.replace(/`/g, "").replace(/\(/g, "&#40;").replace(/\)/g, "&#41;").replace(/\"/g, "&quot;").replace(/"/g, "&quot;");
311950
+ replaced = inner.replace(/`/g, "").replace(/\(/g, "&#40;").replace(/\)/g, "&#41;").replace(/\[/g, "&#91;").replace(/\]/g, "&#93;").replace(/\\"/g, "&quot;").replace(/"/g, "&quot;");
311454
311951
  }
311455
311952
  if (replaced !== inner) {
311456
311953
  edits.push({ start: { line: e.line, column: contentStart + 1 }, end: { line: e.line, column: closeIdx + 1 }, newText: replaced });
@@ -332239,26 +332736,46 @@ var init_prompts = __esm({
332239
332736
  CRITICAL - You are READ-ONLY:
332240
332737
  You must NEVER create, modify, delete, or write files. You are strictly an exploration and analysis tool. If asked to make changes, implement features, fix bugs, or modify a PR, refuse and explain that file modifications must be done by the engineer tool \u2014 your role is only to investigate code and answer questions. Do not attempt workarounds using bash commands (echo, cat, tee, sed, etc.) to write files.
332241
332738
 
332739
+ CRITICAL - ALWAYS search before answering:
332740
+ You must NEVER answer questions about the codebase from memory or general knowledge. ALWAYS use the search and extract tools first to find the actual code, then base your answer ONLY on what you found. Even if you think you know the answer, you MUST verify it against the actual code. Your answers must be grounded in code evidence, not assumptions.
332741
+
332242
332742
  When exploring code:
332243
332743
  - Provide clear, concise explanations based on user request
332244
332744
  - Find and highlight the most relevant code snippets, if required
332245
- - Trace function calls and data flow through the system
332745
+ - Trace function calls and data flow through the system \u2014 follow the FULL call chain, not just the entry point
332246
332746
  - Try to understand the user's intent and provide relevant information
332247
332747
  - Understand high level picture
332248
332748
  - Balance detail with clarity in your explanations
332749
+ - Search using SYNONYMS and alternative terms \u2014 code naming often differs from the concept name (e.g., "authentication" might be named verify_credentials, check_token, validate_session)
332750
+ - When you find a key function, look at what it CALLS and what CALLS it to discover the complete picture
332751
+ - Before answering, ask yourself: "Did I cover all the major components? Are there related subsystems I missed?" If yes, do one more search round.
332249
332752
 
332250
332753
  When providing answers:
332754
+ - Be EXHAUSTIVE: cover ALL components you discovered, not just the main ones. If you found 10 related files, discuss all 10, not just the top 3. Users want the complete picture.
332755
+ - After drafting your answer, do a self-check: "What did I find in my searches that I haven't mentioned yet?" Add any missing components.
332756
+ - Include data structures, configuration options, and error handling \u2014 not just the happy path.
332251
332757
  - Always include a "References" section at the end of your response
332252
332758
  - List all relevant source code locations you found during exploration
332253
332759
  - Use the format: file_path:line_number or file_path#symbol_name
332254
332760
  - Group references by file when multiple locations are from the same file
332255
332761
  - Include brief descriptions of what each reference contains`,
332256
- "code-searcher": `You are ProbeChat Code Searcher, a specialized AI assistant focused ONLY on locating relevant code. Your sole job is to find and return ALL relevant code locations. Do NOT answer questions or explain anything.
332762
+ "code-searcher": `You are ProbeChat Code Explorer & Searcher. Your job is to EXPLORE the codebase to find ALL relevant code locations for the query, then return them as JSON targets.
332763
+
332764
+ You think like a code explorer \u2014 you understand that codebases have layers:
332765
+ - Core implementations (algorithms, data structures)
332766
+ - Middleware/integration layers (request handlers, interceptors)
332767
+ - Configuration and storage backends
332768
+ - Scoping mechanisms (per-user, per-org, per-tenant, global)
332769
+ - Supporting utilities and helpers
332257
332770
 
332258
332771
  When searching:
332259
- - Use only the search tool
332260
- - Run additional searches only if needed to capture all relevant locations
332261
- - Prefer specific, focused queries
332772
+ - Search for the MAIN concept first, then think: "what RELATED subsystems would a real codebase have?"
332773
+ - Use extract to READ the code you find \u2014 look for function calls, type references, and imports that point to OTHER relevant code
332774
+ - If you find middleware, check: are there org-level or tenant-level variants?
332775
+ - If you find algorithms, check: are there different storage backends?
332776
+ - Search results are paginated \u2014 if results look relevant, call nextPage=true to check for more files
332777
+ - Stop paginating when results become irrelevant or you see "All results retrieved"
332778
+ - Search using SYNONYMS \u2014 code naming differs from concepts (e.g., "rate limiting" \u2192 throttle, quota, limiter, bucket)
332262
332779
 
332263
332780
  Output format (MANDATORY):
332264
332781
  - Return ONLY valid JSON with a single top-level key: "targets"
@@ -332268,7 +332785,8 @@ Output format (MANDATORY):
332268
332785
  - "path/to/file.ext:line"
332269
332786
  - "path/to/file.ext:start-end"
332270
332787
  - Prefer #SymbolName when a function/class name is clear; otherwise use line numbers
332271
- - Deduplicate targets and keep them concise`,
332788
+ - Deduplicate targets and keep them concise
332789
+ - Aim for 5-15 targets covering ALL aspects of the query`,
332272
332790
  "architect": `You are ProbeChat Architect, a specialized AI assistant focused on software architecture and design. Your primary function is to help users understand, analyze, and design software systems using the provided code analysis tools.
332273
332791
 
332274
332792
  When analyzing code:
@@ -357922,9 +358440,9 @@ Workspace: ${this.allowedFolders.join(", ")}`;
357922
358440
  Follow these instructions carefully:
357923
358441
  1. Analyze the user's request.
357924
358442
  2. Use the available tools step-by-step to fulfill the request.
357925
- 3. You should always prefer the search tool for code-related questions.${this.searchDelegate ? " Ask natural language questions \u2014 the search subagent handles keyword formulation and returns extracted code blocks. Use extract only to expand context or read full files." : " Search handles stemming and case variations automatically \u2014 do NOT try keyword variations manually. Read full files only if really necessary."}
357926
- 4. Ensure to get really deep and understand the full picture before answering.
357927
- 5. Once the task is fully completed, provide your final answer directly as text.
358443
+ 3. You MUST use the search tool before answering ANY code-related question. NEVER answer from memory or general knowledge \u2014 your answers must be grounded in actual code found via search/extract.${this.searchDelegate ? " Ask natural language questions \u2014 the search subagent handles keyword formulation and returns extracted code blocks. Use extract only to expand context or read full files." : " Search handles stemming and case variations automatically \u2014 do NOT try keyword variations manually. Read full files only if really necessary."}
358444
+ 4. Ensure to get really deep and understand the full picture before answering. Follow call chains \u2014 if function A calls B, search for B too. Look for related subsystems (e.g., if asked about rate limiting, also check for quota, throttling, smoothing).
358445
+ 5. Once the task is fully completed, provide your final answer directly as text. Always cite specific files and line numbers as evidence. Do NOT output planning or thinking text \u2014 go straight to the answer.
357928
358446
  6. ${this.searchDelegate ? "Ask clear, specific questions when searching. Each search should target a distinct concept or question." : "Prefer concise and focused search queries. Use specific keywords and phrases to narrow down results."}
357929
358447
  7. NEVER use bash for code exploration (no grep, cat, find, head, tail, awk, sed) \u2014 always use search and extract tools instead. Bash is only for system operations like building, running tests, or git commands.${this.allowEdit ? `
357930
358448
  7. When modifying files, choose the appropriate tool:
@@ -358310,6 +358828,22 @@ You are working with a workspace. Available paths: ${workspaceDesc}
358310
358828
  if (recentTexts.every((t) => t && t === recentTexts[0])) return true;
358311
358829
  if (recentTexts.every((t) => detectStuckResponse(t))) return true;
358312
358830
  }
358831
+ if (steps.length >= 3) {
358832
+ const last3 = steps.slice(-3);
358833
+ const allHaveTools = last3.every((s) => s.toolCalls?.length === 1);
358834
+ if (allHaveTools) {
358835
+ const signatures = last3.map((s) => {
358836
+ const tc = s.toolCalls[0];
358837
+ return `${tc.toolName}::${JSON.stringify(tc.args ?? tc.input)}`;
358838
+ });
358839
+ if (signatures[0] === signatures[1] && signatures[1] === signatures[2]) {
358840
+ if (this.debug) {
358841
+ console.log(`[DEBUG] Circuit breaker: 3 consecutive identical tool calls detected (${last3[0].toolCalls[0].toolName}), forcing stop`);
358842
+ }
358843
+ return true;
358844
+ }
358845
+ }
358846
+ }
358313
358847
  return false;
358314
358848
  },
358315
358849
  prepareStep: ({ steps, stepNumber }) => {
@@ -358318,6 +358852,22 @@ You are working with a workspace. Available paths: ${workspaceDesc}
358318
358852
  toolChoice: "none"
358319
358853
  };
358320
358854
  }
358855
+ if (steps.length >= 2) {
358856
+ const last2 = steps.slice(-2);
358857
+ if (last2.every((s) => s.toolCalls?.length === 1)) {
358858
+ const tc1 = last2[0].toolCalls[0];
358859
+ const tc2 = last2[1].toolCalls[0];
358860
+ const sig1 = `${tc1.toolName}::${JSON.stringify(tc1.args ?? tc1.input)}`;
358861
+ const sig2 = `${tc2.toolName}::${JSON.stringify(tc2.args ?? tc2.input)}`;
358862
+ if (sig1 === sig2) {
358863
+ if (this.debug) {
358864
+ console.log(`[DEBUG] prepareStep: 2 consecutive identical tool calls (${tc1.toolName}), forcing toolChoice=none`);
358865
+ console.log(`[DEBUG] sig: ${sig1.substring(0, 200)}`);
358866
+ }
358867
+ return { toolChoice: "none" };
358868
+ }
358869
+ }
358870
+ }
358321
358871
  const lastStep = steps[steps.length - 1];
358322
358872
  const modelJustStopped = lastStep?.finishReason === "stop" && (!lastStep?.toolCalls || lastStep.toolCalls.length === 0);
358323
358873
  if (modelJustStopped) {
@@ -358348,7 +358898,9 @@ ${resultToReview}
358348
358898
 
358349
358899
  Double-check your response based on the criteria above. If everything looks good, respond with your previous answer exactly as-is. If something needs to be fixed or is missing, do it now, then respond with the COMPLETE updated answer (everything you did in total, not just the fix).`;
358350
358900
  return {
358351
- userMessage: completionPromptMessage
358901
+ userMessage: completionPromptMessage,
358902
+ toolChoice: "none"
358903
+ // Force text-only review — no tool calls
358352
358904
  };
358353
358905
  }
358354
358906
  }
@@ -358390,7 +358942,11 @@ Double-check your response based on the criteria above. If everything looks good
358390
358942
  options.onStream(text);
358391
358943
  }
358392
358944
  if (this.debug) {
358393
- console.log(`[DEBUG] Step ${currentIteration}/${maxIterations} finished (reason: ${finishReason}, tools: ${toolResults?.length || 0})`);
358945
+ const toolSummary = toolCalls?.length ? toolCalls.map((tc) => {
358946
+ const args = tc.args ? JSON.stringify(tc.args) : "";
358947
+ return args ? `${tc.toolName}(${debugTruncate(args, 120)})` : tc.toolName;
358948
+ }).join(", ") : "none";
358949
+ console.log(`[DEBUG] Step ${currentIteration}/${maxIterations} finished (reason: ${finishReason}, tools: [${toolSummary}])`);
358394
358950
  if (text) {
358395
358951
  console.log(`[DEBUG] model text: ${debugTruncate(text)}`);
358396
358952
  }
@@ -358423,9 +358979,15 @@ Double-check your response based on the criteria above. If everything looks good
358423
358979
  }
358424
358980
  const executeAIRequest = async () => {
358425
358981
  const result = await this.streamTextWithRetryAndFallback(streamOptions);
358426
- const finalText = await result.text;
358982
+ const steps = await result.steps;
358983
+ let finalText;
358984
+ if (steps && steps.length > 1) {
358985
+ const lastStepText = steps[steps.length - 1].text;
358986
+ finalText = lastStepText || await result.text;
358987
+ } else {
358988
+ finalText = await result.text;
358989
+ }
358427
358990
  if (this.debug) {
358428
- const steps = await result.steps;
358429
358991
  console.log(`[DEBUG] streamText completed: ${steps?.length || 0} steps, finalText=${finalText?.length || 0} chars`);
358430
358992
  }
358431
358993
  const usage = await result.usage;
@@ -358495,12 +359057,12 @@ ${finalResult}
358495
359057
 
358496
359058
  Double-check your response based on the criteria above. If everything looks good, respond with your previous answer exactly as-is. If something needs to be fixed or is missing, do it now, then respond with the COMPLETE updated answer (everything you did in total, not just the fix).`;
358497
359059
  currentMessages.push({ role: "user", content: completionPromptMessage });
358498
- const completionMaxIterations = 5;
358499
359060
  const completionStreamOptions = {
358500
359061
  model: this.provider ? this.provider(this.model) : this.model,
358501
359062
  messages: this.prepareMessagesWithImages(currentMessages),
358502
359063
  tools: tools2,
358503
- stopWhen: (0, import_ai4.stepCountIs)(completionMaxIterations),
359064
+ toolChoice: "none",
359065
+ // Force text-only response — no tool calls during review
358504
359066
  maxTokens: maxResponseTokens,
358505
359067
  temperature: 0.3,
358506
359068
  onStepFinish: ({ toolResults, text, finishReason, usage }) => {
@@ -360169,11 +360731,9 @@ function autoQuoteSearchTerms(query2) {
360169
360731
  const result = tokens.map((token) => {
360170
360732
  if (token.startsWith('"')) return token;
360171
360733
  if (operators.has(token)) return token;
360172
- const hasUpper = /[A-Z]/.test(token);
360173
- const hasLower = /[a-z]/.test(token);
360174
360734
  const hasUnderscore = token.includes("_");
360175
- const hasMixedCase = hasUpper && hasLower;
360176
- if (hasMixedCase || hasUnderscore) {
360735
+ const hasCaseTransition = /[a-z][A-Z]/.test(token) || /[A-Z]{2,}[a-z]/.test(token);
360736
+ if (hasCaseTransition || hasUnderscore) {
360177
360737
  return `"${token}"`;
360178
360738
  }
360179
360739
  return token;
@@ -360188,11 +360748,24 @@ function normalizeTargets(targets) {
360188
360748
  if (typeof target !== "string") continue;
360189
360749
  const trimmed = target.trim();
360190
360750
  if (!trimmed || seen.has(trimmed)) continue;
360191
- seen.add(trimmed);
360192
- normalized.push(trimmed);
360751
+ const subTargets = splitSpaceSeparatedPaths(trimmed);
360752
+ for (const sub of subTargets) {
360753
+ if (!seen.has(sub)) {
360754
+ seen.add(sub);
360755
+ normalized.push(sub);
360756
+ }
360757
+ }
360193
360758
  }
360194
360759
  return normalized;
360195
360760
  }
360761
+ function splitSpaceSeparatedPaths(target) {
360762
+ if (!/\s/.test(target)) return [target];
360763
+ const parts = target.split(/\s+/).filter(Boolean);
360764
+ if (parts.length <= 1) return [target];
360765
+ const allLookLikePaths = parts.every((p) => /[/\\]/.test(p) || /\.\w+/.test(p));
360766
+ if (allLookLikePaths) return parts;
360767
+ return [target];
360768
+ }
360196
360769
  function extractJsonSnippet(text) {
360197
360770
  const jsonBlockMatch = text.match(/```json\s*([\s\S]*?)```/i);
360198
360771
  if (jsonBlockMatch) {
@@ -360275,7 +360848,7 @@ function buildSearchDelegateTask({ searchQuery, searchPath, exact, language, all
360275
360848
  "Break down complex queries into multiple searches to cover all aspects.",
360276
360849
  "",
360277
360850
  "Available tools:",
360278
- "- search: Find code matching keywords or patterns. Run multiple searches for different aspects of complex queries.",
360851
+ "- search: Find code matching keywords or patterns. Results are paginated \u2014 use nextPage=true when results are relevant to get more. Run multiple searches for different aspects.",
360279
360852
  "- extract: Verify code snippets to ensure targets are actually relevant before including them.",
360280
360853
  "- listFiles: Understand directory structure to find where relevant code might live.",
360281
360854
  "",
@@ -360296,13 +360869,14 @@ function buildSearchDelegateTask({ searchQuery, searchPath, exact, language, all
360296
360869
  "",
360297
360870
  "Combining searches with OR:",
360298
360871
  '- Multiple unquoted words use OR logic: rate limit matches files containing EITHER "rate" OR "limit".',
360299
- `- For known symbol names, quote each term to prevent splitting: '"limitDRL" "limitRedis"' matches either exact symbol.`,
360872
+ `- IMPORTANT: Multiple quoted terms use AND logic by default: '"RateLimit" "middleware"' requires BOTH in the same file.`,
360873
+ `- To search for ANY of several quoted symbols, use the explicit OR operator: '"ForwardMessage" OR "SessionLimiter"'.`,
360300
360874
  '- Without quotes, camelCase like limitDRL gets split into "limit" + "DRL" \u2014 not what you want for symbol lookup.',
360301
360875
  "- Use OR to search for multiple related symbols in ONE search instead of separate searches.",
360302
360876
  "- This is much faster than running separate searches sequentially.",
360303
- `- Example: search '"ForwardMessage" "SessionLimiter"' finds files with either exact symbol in one call.`,
360304
- `- Example: search '"limitDRL" "doRollingWindowWrite"' finds both rate limiting functions at once.`,
360305
- '- Use AND only when you need both terms to appear in the same file: "rate AND limit".',
360877
+ `- Example: search '"ForwardMessage" OR "SessionLimiter"' finds files with either exact symbol in one call.`,
360878
+ `- Example: search '"limitDRL" OR "doRollingWindowWrite"' finds both rate limiting functions at once.`,
360879
+ "- Use AND (or just put quoted terms together) when you need both terms in the same file.",
360306
360880
  "",
360307
360881
  "Parallel tool calls:",
360308
360882
  "- When you need to search for INDEPENDENT concepts, call multiple search tools IN PARALLEL (same response).",
@@ -360316,10 +360890,10 @@ function buildSearchDelegateTask({ searchQuery, searchPath, exact, language, all
360316
360890
  ' Query: "Find the IP allowlist middleware"',
360317
360891
  ' \u2192 search "allowlist middleware" (one search, probe handles IP/ip/Ip variations)',
360318
360892
  ' Query: "Find ForwardMessage and SessionLimiter"',
360319
- ` \u2192 search '"ForwardMessage" "SessionLimiter"' (one OR search finds both exact symbols)`,
360893
+ ` \u2192 search '"ForwardMessage" OR "SessionLimiter"' (one OR search finds both exact symbols)`,
360320
360894
  ' OR: search exact=true "ForwardMessage" + search exact=true "SessionLimiter" IN PARALLEL',
360321
360895
  ' Query: "Find limitDRL and limitRedis functions"',
360322
- ` \u2192 search '"limitDRL" "limitRedis"' (one OR search, quoted to prevent camelCase splitting)`,
360896
+ ` \u2192 search '"limitDRL" OR "limitRedis"' (one OR search, quoted to prevent camelCase splitting)`,
360323
360897
  ' Query: "Find ThrottleRetryLimit usage"',
360324
360898
  ' \u2192 search exact=true "ThrottleRetryLimit" (one search, if no results the symbol does not exist \u2014 stop)',
360325
360899
  ' Query: "How does BM25 scoring work with SIMD optimization?"',
@@ -360327,7 +360901,7 @@ function buildSearchDelegateTask({ searchQuery, searchPath, exact, language, all
360327
360901
  "",
360328
360902
  "BAD search strategy (never do this):",
360329
360903
  ' \u2192 search "AllowedIPs" \u2192 search "allowedIps" \u2192 search "allowed_ips" (WRONG: case/style variations, probe handles them)',
360330
- ` \u2192 search "limitDRL" \u2192 search "LimitDRL" (WRONG: case variation \u2014 combine with OR: '"limitDRL" "limitRedis"')`,
360904
+ ` \u2192 search "limitDRL" \u2192 search "LimitDRL" (WRONG: case variation \u2014 combine with OR: '"limitDRL" OR "limitRedis"')`,
360331
360905
  ' \u2192 search "throttle_retry_limit" after searching "ThrottleRetryLimit" (WRONG: snake_case variation, probe handles it)',
360332
360906
  ' \u2192 search "ThrottleRetryLimit" path=tyk \u2192 search "ThrottleRetryLimit" path=gateway \u2192 search "ThrottleRetryLimit" path=apidef (WRONG: same query on different paths \u2014 probe searches recursively)',
360333
360907
  ' \u2192 search "func (k *RateLimitAndQuotaCheck) handleRateLimitFailure" (WRONG: do not search full function signatures, just use exact=true "handleRateLimitFailure")',
@@ -360340,15 +360914,34 @@ function buildSearchDelegateTask({ searchQuery, searchPath, exact, language, all
360340
360914
  '- To bypass stopword filtering: wrap terms in quotes ("return", "struct") or set exact=true. Both disable stemming and splitting too.',
360341
360915
  '- camelCase terms are split: getUserData becomes "get", "user", "data" \u2014 so one search covers all naming styles.',
360342
360916
  '- Do NOT search for full function signatures like "func (r *Type) Method(args)". Just search for the method name with exact=true.',
360917
+ '- Do NOT search for file names (e.g., "sliding_log.go"). Use listFiles to discover files by name.',
360918
+ "",
360919
+ "PAGINATION:",
360920
+ "- Search results are paginated (~20k tokens per page).",
360921
+ "- If your search returned relevant files, call the same query with nextPage=true to check for more.",
360922
+ '- Keep paginating while results stay relevant. Stop when results are off-topic or "All results retrieved".',
360923
+ "",
360924
+ "WHEN TO STOP:",
360925
+ "- After you have explored the main concept AND related subsystems.",
360926
+ "- Once you have 5-15 targets covering different aspects of the query.",
360927
+ '- If you get a "DUPLICATE SEARCH BLOCKED" message, move on.',
360343
360928
  "",
360344
360929
  "Strategy:",
360345
- "1. Analyze the query - identify key concepts and group related symbols",
360346
- `2. Combine related symbols into OR searches: '"symbolA" "symbolB"' finds files with either (quote to prevent splitting)`,
360347
- "3. Run INDEPENDENT searches in PARALLEL \u2014 do not wait for one to finish before starting another",
360930
+ "1. Analyze the query \u2014 identify key concepts, then brainstorm SYNONYMS and alternative terms for each.",
360931
+ ' Code naming often differs from the concept: "authentication" \u2192 verify, credentials, login, auth;',
360932
+ ' "rate limiting" \u2192 throttle, quota, limiter, bucket; "error handling" \u2192 catch, recover, panic.',
360933
+ " Think about what a developer would NAME the function/struct/variable, not just the concept.",
360934
+ "2. Run INDEPENDENT searches in PARALLEL \u2014 search for the main concept AND synonyms simultaneously.",
360935
+ " After each search, check if results are relevant. If yes, call nextPage=true for more results.",
360936
+ `3. Combine related symbols into OR searches: '"symbolA" OR "symbolB"' finds files with either.`,
360348
360937
  "4. For known symbol names use exact=true. For concepts use default (exact=false).",
360349
- "5. If a search returns results, use extract to verify relevance. Run multiple extracts in parallel too.",
360350
- "6. If a search returns NO results, the term does not exist. Do NOT retry with variations, different paths, or longer strings. Move on.",
360351
- "7. Combine all relevant targets in your final response",
360938
+ "5. After your first round of searches, READ the extracted code and look for connected code:",
360939
+ " - Function calls to other important functions \u2192 include those targets.",
360940
+ " - Type references and imports \u2192 include type definitions.",
360941
+ " - Registered handlers/middleware \u2192 include all registered items.",
360942
+ "6. If a search returns results, use extract to verify relevance. Run multiple extracts in parallel too.",
360943
+ "7. If a search returns NO results, the term does not exist. Do NOT retry with variations. Move on.",
360944
+ "8. Once you have enough targets (typically 5-15), output your final JSON answer immediately.",
360352
360945
  "",
360353
360946
  `Query: ${searchQuery}`,
360354
360947
  `Search path(s): ${searchPath}`,
@@ -360357,7 +360950,9 @@ function buildSearchDelegateTask({ searchQuery, searchPath, exact, language, all
360357
360950
  'Return ONLY valid JSON: {"targets": ["path/to/file.ext#Symbol", "path/to/file.ext:line", "path/to/file.ext:start-end"]}',
360358
360951
  'IMPORTANT: Use ABSOLUTE file paths in targets (e.g., "/full/path/to/file.ext#Symbol"). If you only have relative paths, make them relative to the search path above.',
360359
360952
  "Prefer #Symbol when a function/class name is clear; otherwise use line numbers.",
360360
- "Deduplicate targets. Do NOT explain or answer - ONLY return the JSON targets."
360953
+ "Deduplicate targets. Do NOT explain or answer - ONLY return the JSON targets.",
360954
+ "",
360955
+ "Remember: if your search returned relevant results, use nextPage=true to check for more before outputting."
360361
360956
  ].join("\n");
360362
360957
  }
360363
360958
  var import_ai5, import_fs11, CODE_SEARCH_SCHEMA, searchTool, queryTool, extractTool, delegateTool, analyzeAllTool;
@@ -360402,6 +360997,7 @@ var init_vercel = __esm({
360402
360997
  return result;
360403
360998
  };
360404
360999
  const previousSearches = /* @__PURE__ */ new Set();
361000
+ let consecutiveDupBlocks = 0;
360405
361001
  const paginationCounts = /* @__PURE__ */ new Map();
360406
361002
  const MAX_PAGES_PER_QUERY = 3;
360407
361003
  return (0, import_ai5.tool)({
@@ -360454,12 +361050,17 @@ var init_vercel = __esm({
360454
361050
  const searchKey = `${searchQuery}::${exact || false}`;
360455
361051
  if (!nextPage) {
360456
361052
  if (previousSearches.has(searchKey)) {
361053
+ consecutiveDupBlocks++;
360457
361054
  if (debug) {
360458
- console.error(`[DEDUP] Blocked duplicate search: "${searchQuery}" (path: "${searchPath}")`);
361055
+ console.error(`[DEDUP] Blocked duplicate search (${consecutiveDupBlocks}x): "${searchQuery}" (path: "${searchPath}")`);
361056
+ }
361057
+ if (consecutiveDupBlocks >= 3) {
361058
+ return "STOP. You have been blocked " + consecutiveDupBlocks + " times for repeating searches. You MUST output your final JSON answer NOW with whatever targets you have found. Do NOT call any more tools.";
360459
361059
  }
360460
- return "DUPLICATE SEARCH BLOCKED: You already searched for this exact query. Changing the path does NOT give different results \u2014 probe searches recursively. Do NOT repeat the same search. Try a genuinely different keyword, use extract to examine results you already found, or provide your final answer if you have enough information.";
361060
+ return "DUPLICATE SEARCH BLOCKED (" + consecutiveDupBlocks + "x). You already searched for this. Do NOT repeat \u2014 probe searches recursively across all paths. Either: (1) use extract on results you already found, (2) try a COMPLETELY different keyword, or (3) output your final answer NOW.";
360461
361061
  }
360462
361062
  previousSearches.add(searchKey);
361063
+ consecutiveDupBlocks = 0;
360463
361064
  paginationCounts.set(searchKey, 0);
360464
361065
  } else {
360465
361066
  const pageCount = (paginationCounts.get(searchKey) || 0) + 1;
@@ -398050,7 +398651,7 @@ module.exports = /*#__PURE__*/JSON.parse('{"100":"Continue","101":"Switching Pro
398050
398651
  /***/ ((module) => {
398051
398652
 
398052
398653
  "use strict";
398053
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@probelabs/visor","version":"0.1.170","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","@modelcontextprotocol/sdk":"^1.25.3","@nyariv/sandboxjs":"github:probelabs/SandboxJS#f1c13b8eee98734a8ea024061eada4aa9a9ff2e9","@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/core":"^1.30.1","@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-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-rc286","@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","cli-table3":"^0.6.5","commander":"^14.0.0","deepmerge":"^4.3.1","dotenv":"^17.2.3","ignore":"^7.0.5","js-yaml":"^4.1.0","jsonpath-plus":"^10.4.0","liquidjs":"^10.21.1","minimatch":"^10.2.2","node-cron":"^3.0.3","open":"^9.1.0","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/node":"^24.3.0","@types/node-cron":"^3.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"]}}');
398654
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@probelabs/visor","version":"0.1.171","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","@modelcontextprotocol/sdk":"^1.25.3","@nyariv/sandboxjs":"github:probelabs/SandboxJS#f1c13b8eee98734a8ea024061eada4aa9a9ff2e9","@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/core":"^1.30.1","@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-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-rc290","@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","cli-table3":"^0.6.5","commander":"^14.0.0","deepmerge":"^4.3.1","dotenv":"^17.2.3","ignore":"^7.0.5","js-yaml":"^4.1.0","jsonpath-plus":"^10.4.0","liquidjs":"^10.21.1","minimatch":"^10.2.2","node-cron":"^3.0.3","open":"^9.1.0","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/node":"^24.3.0","@types/node-cron":"^3.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"]}}');
398054
398655
 
398055
398656
  /***/ })
398056
398657