@probelabs/visor 0.1.177 → 0.1.178-ee

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/defaults/code-talk.yaml +10 -5
  2. package/dist/defaults/code-talk.yaml +10 -5
  3. package/dist/docs/ai-custom-tools.md +49 -0
  4. package/dist/docs/http.md +23 -0
  5. package/dist/docs/testing/cookbook.md +48 -0
  6. package/dist/docs/testing/dsl-reference.md +4 -2
  7. package/dist/docs/testing/flows.md +33 -1
  8. package/dist/examples/http-integration-config.yaml +16 -0
  9. package/dist/generated/config-schema.d.ts +51 -6
  10. package/dist/generated/config-schema.d.ts.map +1 -1
  11. package/dist/generated/config-schema.json +61 -6
  12. package/dist/github-comments.d.ts +5 -1
  13. package/dist/github-comments.d.ts.map +1 -1
  14. package/dist/index.js +2224 -93
  15. package/dist/providers/api-tool-executor.d.ts +2 -0
  16. package/dist/providers/api-tool-executor.d.ts.map +1 -1
  17. package/dist/providers/http-client-provider.d.ts.map +1 -1
  18. package/dist/providers/mcp-custom-sse-server.d.ts.map +1 -1
  19. package/dist/providers/workflow-check-provider.d.ts.map +1 -1
  20. package/dist/sdk/{a2a-frontend-FUJRKHJB.mjs → a2a-frontend-U3PTNCLR.mjs} +2 -2
  21. package/dist/sdk/{check-provider-registry-HW4QPPSA.mjs → check-provider-registry-SRASECAR.mjs} +6 -6
  22. package/dist/sdk/{check-provider-registry-OY2EESIO.mjs → check-provider-registry-ZX76MY2L.mjs} +6 -6
  23. package/dist/sdk/{chunk-OPI632LK.mjs → chunk-4ECMTCOM.mjs} +2 -2
  24. package/dist/sdk/{chunk-GVTWESYN.mjs → chunk-6YGCACBF.mjs} +2 -2
  25. package/dist/sdk/{chunk-65SHRIQF.mjs.map → chunk-6YGCACBF.mjs.map} +1 -1
  26. package/dist/sdk/{chunk-Y6PVSFCS.mjs → chunk-B7XHSG3L.mjs} +237 -47
  27. package/dist/sdk/chunk-B7XHSG3L.mjs.map +1 -0
  28. package/dist/sdk/{chunk-MM3TGVQ4.mjs → chunk-BMXVAJ2M.mjs} +52 -7
  29. package/dist/sdk/chunk-BMXVAJ2M.mjs.map +1 -0
  30. package/dist/sdk/{chunk-OHOBWVPP.mjs → chunk-ENSZDV3O.mjs} +3 -3
  31. package/dist/sdk/{chunk-2LCF5H5K.mjs → chunk-MGY5JAN2.mjs} +222 -37
  32. package/dist/sdk/chunk-MGY5JAN2.mjs.map +1 -0
  33. package/dist/sdk/{config-OOUMTCEA.mjs → config-DFOF7LP4.mjs} +2 -2
  34. package/dist/sdk/{failure-condition-evaluator-DL6H57NX.mjs → failure-condition-evaluator-P3MS5DRL.mjs} +3 -3
  35. package/dist/sdk/{github-frontend-FP6WKNZR.mjs → github-frontend-QTKOYB56.mjs} +11 -3
  36. package/dist/sdk/github-frontend-QTKOYB56.mjs.map +1 -0
  37. package/dist/sdk/{host-6SBCE4VK.mjs → host-I2TBBKD5.mjs} +3 -3
  38. package/dist/sdk/{host-NYUSWEE4.mjs → host-THORKOEL.mjs} +3 -3
  39. package/dist/sdk/knex-store-QCEW4I4R.mjs +527 -0
  40. package/dist/sdk/knex-store-QCEW4I4R.mjs.map +1 -0
  41. package/dist/sdk/loader-Q7K76ZIY.mjs +89 -0
  42. package/dist/sdk/loader-Q7K76ZIY.mjs.map +1 -0
  43. package/dist/sdk/opa-policy-engine-QCSSIMUF.mjs +655 -0
  44. package/dist/sdk/opa-policy-engine-QCSSIMUF.mjs.map +1 -0
  45. package/dist/sdk/{routing-PFFCQJV2.mjs → routing-2X6QF5IW.mjs} +4 -4
  46. package/dist/sdk/{schedule-tool-DN2DSXIX.mjs → schedule-tool-M6Y4YTXR.mjs} +6 -6
  47. package/dist/sdk/{schedule-tool-KVZN5LP6.mjs → schedule-tool-R6JJIDZ6.mjs} +6 -6
  48. package/dist/sdk/{schedule-tool-handler-57JBEICD.mjs → schedule-tool-handler-AOMZV3Q3.mjs} +6 -6
  49. package/dist/sdk/{schedule-tool-handler-6MPP5DXK.mjs → schedule-tool-handler-JYCVH377.mjs} +6 -6
  50. package/dist/sdk/sdk.d.mts +21 -0
  51. package/dist/sdk/sdk.d.ts +21 -0
  52. package/dist/sdk/sdk.js +1919 -307
  53. package/dist/sdk/sdk.js.map +1 -1
  54. package/dist/sdk/sdk.mjs +5 -5
  55. package/dist/sdk/{trace-helpers-L3EOYW5P.mjs → trace-helpers-K47ZVJSU.mjs} +2 -2
  56. package/dist/sdk/validator-XTZJZZJH.mjs +134 -0
  57. package/dist/sdk/validator-XTZJZZJH.mjs.map +1 -0
  58. package/dist/sdk/{workflow-check-provider-OA33MESM.mjs → workflow-check-provider-A3YH2UZJ.mjs} +6 -6
  59. package/dist/sdk/{workflow-check-provider-U3UIYLU7.mjs → workflow-check-provider-EMFC7A5K.mjs} +6 -6
  60. package/dist/state-machine/context/build-engine-context.d.ts.map +1 -1
  61. package/dist/test-runner/conversation-sugar.d.ts +3 -0
  62. package/dist/test-runner/conversation-sugar.d.ts.map +1 -1
  63. package/dist/test-runner/validator.d.ts.map +1 -1
  64. package/dist/types/config.d.ts +21 -0
  65. package/dist/types/config.d.ts.map +1 -1
  66. package/dist/utils/rate-limiter.d.ts +61 -0
  67. package/dist/utils/rate-limiter.d.ts.map +1 -0
  68. package/package.json +2 -2
  69. package/dist/output/traces/run-2026-03-10T16-21-38-082Z.ndjson +0 -138
  70. package/dist/output/traces/run-2026-03-10T16-22-15-059Z.ndjson +0 -2296
  71. package/dist/sdk/a2a-frontend-BPWLYLCG.mjs +0 -1658
  72. package/dist/sdk/a2a-frontend-FUJRKHJB.mjs.map +0 -1
  73. package/dist/sdk/a2a-frontend-HBUSNE3K.mjs +0 -1658
  74. package/dist/sdk/a2a-frontend-HBUSNE3K.mjs.map +0 -1
  75. package/dist/sdk/check-provider-registry-TRHN5ZBY.mjs +0 -30
  76. package/dist/sdk/chunk-2LCF5H5K.mjs.map +0 -1
  77. package/dist/sdk/chunk-65SHRIQF.mjs +0 -516
  78. package/dist/sdk/chunk-ADQVGGKA.mjs +0 -1502
  79. package/dist/sdk/chunk-BWC5R2UB.mjs +0 -739
  80. package/dist/sdk/chunk-EFNNJIMY.mjs +0 -739
  81. package/dist/sdk/chunk-EFNNJIMY.mjs.map +0 -1
  82. package/dist/sdk/chunk-FNBSDOQM.mjs +0 -516
  83. package/dist/sdk/chunk-FNBSDOQM.mjs.map +0 -1
  84. package/dist/sdk/chunk-GVTWESYN.mjs.map +0 -1
  85. package/dist/sdk/chunk-MM3TGVQ4.mjs.map +0 -1
  86. package/dist/sdk/chunk-OHOBWVPP.mjs.map +0 -1
  87. package/dist/sdk/chunk-OPI632LK.mjs.map +0 -1
  88. package/dist/sdk/chunk-WJIV7MKY.mjs +0 -1502
  89. package/dist/sdk/chunk-WJIV7MKY.mjs.map +0 -1
  90. package/dist/sdk/chunk-XLDVWRKQ.mjs +0 -45239
  91. package/dist/sdk/chunk-XLDVWRKQ.mjs.map +0 -1
  92. package/dist/sdk/chunk-Y6PVSFCS.mjs.map +0 -1
  93. package/dist/sdk/failure-condition-evaluator-63BECZYF.mjs +0 -18
  94. package/dist/sdk/failure-condition-evaluator-HL33X7MH.mjs +0 -18
  95. package/dist/sdk/github-frontend-F2YCPK6H.mjs +0 -1386
  96. package/dist/sdk/github-frontend-F2YCPK6H.mjs.map +0 -1
  97. package/dist/sdk/github-frontend-FP6WKNZR.mjs.map +0 -1
  98. package/dist/sdk/github-frontend-U2U42CKV.mjs +0 -1386
  99. package/dist/sdk/github-frontend-U2U42CKV.mjs.map +0 -1
  100. package/dist/sdk/host-6TBS44ER.mjs +0 -87
  101. package/dist/sdk/host-NYUSWEE4.mjs.map +0 -1
  102. package/dist/sdk/routing-GF2CF3JT.mjs +0 -26
  103. package/dist/sdk/routing-SFP4D6O3.mjs +0 -26
  104. package/dist/sdk/schedule-tool-45NAALKS.mjs +0 -36
  105. package/dist/sdk/schedule-tool-KVZN5LP6.mjs.map +0 -1
  106. package/dist/sdk/schedule-tool-handler-57JBEICD.mjs.map +0 -1
  107. package/dist/sdk/schedule-tool-handler-6MPP5DXK.mjs.map +0 -1
  108. package/dist/sdk/schedule-tool-handler-GEXHYH3X.mjs +0 -40
  109. package/dist/sdk/schedule-tool-handler-GEXHYH3X.mjs.map +0 -1
  110. package/dist/sdk/slack-frontend-6SXPTQDI.mjs +0 -895
  111. package/dist/sdk/slack-frontend-6SXPTQDI.mjs.map +0 -1
  112. package/dist/sdk/trace-helpers-FKM2MEDW.mjs +0 -29
  113. package/dist/sdk/trace-helpers-FKM2MEDW.mjs.map +0 -1
  114. package/dist/sdk/trace-helpers-L3EOYW5P.mjs.map +0 -1
  115. package/dist/sdk/trace-helpers-MYH2GPXF.mjs +0 -29
  116. package/dist/sdk/trace-helpers-MYH2GPXF.mjs.map +0 -1
  117. package/dist/sdk/workflow-check-provider-JNEFAECH.mjs +0 -30
  118. package/dist/sdk/workflow-check-provider-JNEFAECH.mjs.map +0 -1
  119. package/dist/sdk/workflow-check-provider-OA33MESM.mjs.map +0 -1
  120. package/dist/sdk/workflow-check-provider-U3UIYLU7.mjs.map +0 -1
  121. package/dist/traces/run-2026-03-10T16-21-38-082Z.ndjson +0 -138
  122. package/dist/traces/run-2026-03-10T16-22-15-059Z.ndjson +0 -2296
  123. /package/dist/sdk/{a2a-frontend-BPWLYLCG.mjs.map → a2a-frontend-U3PTNCLR.mjs.map} +0 -0
  124. /package/dist/sdk/{check-provider-registry-HW4QPPSA.mjs.map → check-provider-registry-SRASECAR.mjs.map} +0 -0
  125. /package/dist/sdk/{check-provider-registry-OY2EESIO.mjs.map → check-provider-registry-ZX76MY2L.mjs.map} +0 -0
  126. /package/dist/sdk/{chunk-BWC5R2UB.mjs.map → chunk-4ECMTCOM.mjs.map} +0 -0
  127. /package/dist/sdk/{chunk-ADQVGGKA.mjs.map → chunk-ENSZDV3O.mjs.map} +0 -0
  128. /package/dist/sdk/{check-provider-registry-TRHN5ZBY.mjs.map → config-DFOF7LP4.mjs.map} +0 -0
  129. /package/dist/sdk/{config-OOUMTCEA.mjs.map → failure-condition-evaluator-P3MS5DRL.mjs.map} +0 -0
  130. /package/dist/sdk/{host-6SBCE4VK.mjs.map → host-I2TBBKD5.mjs.map} +0 -0
  131. /package/dist/sdk/{host-6TBS44ER.mjs.map → host-THORKOEL.mjs.map} +0 -0
  132. /package/dist/sdk/{failure-condition-evaluator-63BECZYF.mjs.map → routing-2X6QF5IW.mjs.map} +0 -0
  133. /package/dist/sdk/{failure-condition-evaluator-DL6H57NX.mjs.map → schedule-tool-M6Y4YTXR.mjs.map} +0 -0
  134. /package/dist/sdk/{failure-condition-evaluator-HL33X7MH.mjs.map → schedule-tool-R6JJIDZ6.mjs.map} +0 -0
  135. /package/dist/sdk/{routing-GF2CF3JT.mjs.map → schedule-tool-handler-AOMZV3Q3.mjs.map} +0 -0
  136. /package/dist/sdk/{routing-PFFCQJV2.mjs.map → schedule-tool-handler-JYCVH377.mjs.map} +0 -0
  137. /package/dist/sdk/{routing-SFP4D6O3.mjs.map → trace-helpers-K47ZVJSU.mjs.map} +0 -0
  138. /package/dist/sdk/{schedule-tool-45NAALKS.mjs.map → workflow-check-provider-A3YH2UZJ.mjs.map} +0 -0
  139. /package/dist/sdk/{schedule-tool-DN2DSXIX.mjs.map → workflow-check-provider-EMFC7A5K.mjs.map} +0 -0
@@ -1,516 +0,0 @@
1
- import {
2
- getInstanceId,
3
- init_instance_id
4
- } from "./chunk-6VVXKXTI.mjs";
5
- import {
6
- init_metrics,
7
- metrics_exports
8
- } from "./chunk-34QX63WK.mjs";
9
- import {
10
- SpanStatusCode,
11
- context,
12
- init_lazy_otel,
13
- trace
14
- } from "./chunk-UCMJJ3IM.mjs";
15
- import {
16
- __commonJS,
17
- __esm,
18
- __export,
19
- __require,
20
- __toCommonJS
21
- } from "./chunk-J7LXIPZS.mjs";
22
-
23
- // src/telemetry/fallback-ndjson.ts
24
- var fallback_ndjson_exports = {};
25
- __export(fallback_ndjson_exports, {
26
- emitNdjsonFallback: () => emitNdjsonFallback,
27
- emitNdjsonSpanWithEvents: () => emitNdjsonSpanWithEvents,
28
- flushNdjson: () => flushNdjson
29
- });
30
- import * as fs from "fs";
31
- import * as path from "path";
32
- function resolveTargetPath(outDir) {
33
- if (process.env.VISOR_FALLBACK_TRACE_FILE) {
34
- CURRENT_FILE = process.env.VISOR_FALLBACK_TRACE_FILE;
35
- return CURRENT_FILE;
36
- }
37
- if (CURRENT_FILE) return CURRENT_FILE;
38
- const ts = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
39
- CURRENT_FILE = path.join(outDir, `${ts}.ndjson`);
40
- return CURRENT_FILE;
41
- }
42
- function isEnabled() {
43
- if (process.env.VISOR_FALLBACK_TRACE_FILE) return true;
44
- return process.env.VISOR_TELEMETRY_ENABLED === "true" && (process.env.VISOR_TELEMETRY_SINK || "file") === "file";
45
- }
46
- function appendAsync(outDir, line) {
47
- writeChain = writeChain.then(async () => {
48
- if (!dirReady) {
49
- try {
50
- await fs.promises.mkdir(outDir, { recursive: true });
51
- } catch {
52
- }
53
- dirReady = true;
54
- }
55
- const target = resolveTargetPath(outDir);
56
- await fs.promises.appendFile(target, line, "utf8");
57
- }).catch(() => {
58
- });
59
- }
60
- async function flushNdjson() {
61
- try {
62
- await writeChain;
63
- } catch {
64
- }
65
- }
66
- function emitNdjsonFallback(name, attrs) {
67
- try {
68
- if (!isEnabled()) return;
69
- const outDir = process.env.VISOR_TRACE_DIR || path.join(process.cwd(), "output", "traces");
70
- const line = JSON.stringify({ name, attributes: attrs }) + "\n";
71
- appendAsync(outDir, line);
72
- } catch {
73
- }
74
- }
75
- function emitNdjsonSpanWithEvents(name, attrs, events) {
76
- try {
77
- if (!isEnabled()) return;
78
- const outDir = process.env.VISOR_TRACE_DIR || path.join(process.cwd(), "output", "traces");
79
- const line = JSON.stringify({ name, attributes: attrs, events }) + "\n";
80
- appendAsync(outDir, line);
81
- } catch {
82
- }
83
- }
84
- var CURRENT_FILE, dirReady, writeChain;
85
- var init_fallback_ndjson = __esm({
86
- "src/telemetry/fallback-ndjson.ts"() {
87
- "use strict";
88
- CURRENT_FILE = null;
89
- dirReady = false;
90
- writeChain = Promise.resolve();
91
- }
92
- });
93
-
94
- // package.json
95
- var require_package = __commonJS({
96
- "package.json"(exports, module) {
97
- module.exports = {
98
- name: "@probelabs/visor",
99
- version: "0.1.42",
100
- main: "dist/index.js",
101
- bin: {
102
- visor: "./dist/index.js"
103
- },
104
- exports: {
105
- ".": {
106
- require: "./dist/index.js",
107
- import: "./dist/index.js"
108
- },
109
- "./sdk": {
110
- types: "./dist/sdk/sdk.d.ts",
111
- import: "./dist/sdk/sdk.mjs",
112
- require: "./dist/sdk/sdk.js"
113
- },
114
- "./cli": {
115
- require: "./dist/index.js"
116
- }
117
- },
118
- files: [
119
- "dist/",
120
- "defaults/",
121
- "action.yml",
122
- "README.md",
123
- "LICENSE"
124
- ],
125
- publishConfig: {
126
- access: "public",
127
- registry: "https://registry.npmjs.org/"
128
- },
129
- scripts: {
130
- "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",
131
- "build:sdk": "tsup src/sdk.ts --dts --sourcemap --format esm,cjs --out-dir dist/sdk",
132
- build: "./scripts/build-oss.sh",
133
- "build:ee": "npm run build:cli && npm run build:sdk",
134
- test: "jest && npm run test:yaml",
135
- "test:unit": "jest",
136
- prepublishOnly: "npm run build",
137
- "test:watch": "jest --watch",
138
- "test:coverage": "jest --coverage",
139
- "test:ee": "jest --testPathPatterns='tests/ee' --testPathIgnorePatterns='/node_modules/' --no-coverage",
140
- "test:manual:bash": "RUN_MANUAL_TESTS=true jest tests/manual/bash-config-manual.test.ts",
141
- lint: "eslint src tests --ext .ts",
142
- "lint:fix": "eslint src tests --ext .ts --fix",
143
- format: "prettier --write src tests",
144
- "format:check": "prettier --check src tests",
145
- clean: "",
146
- "clean:traces": "node scripts/clean-traces.js",
147
- prebuild: "npm run clean && node scripts/generate-config-schema.js",
148
- pretest: "npm run clean:traces && node scripts/generate-config-schema.js && npm run build:cli",
149
- "pretest:unit": "npm run clean:traces && node scripts/generate-config-schema.js && npm run build:cli",
150
- "test:with-build": "npm run build:cli && jest",
151
- "test:yaml": "node dist/index.js test --progress compact",
152
- "test:yaml:parallel": "node dist/index.js test --progress compact --max-parallel 4",
153
- prepare: "husky",
154
- "pre-commit": "lint-staged",
155
- "deploy:site": "cd site && npx wrangler pages deploy . --project-name=visor-site --commit-dirty=true",
156
- "deploy:worker": "npx wrangler deploy",
157
- deploy: "npm run deploy:site && npm run deploy:worker",
158
- "publish:ee": "./scripts/publish-ee.sh",
159
- release: "./scripts/release.sh",
160
- "release:patch": "./scripts/release.sh patch",
161
- "release:minor": "./scripts/release.sh minor",
162
- "release:major": "./scripts/release.sh major",
163
- "release:prerelease": "./scripts/release.sh prerelease",
164
- "docs:validate": "node scripts/validate-readme-links.js",
165
- "workshop:setup": "npm install -D reveal-md@6.1.2",
166
- "workshop:serve": "cd workshop && reveal-md slides.md -w",
167
- "workshop:export": "reveal-md workshop/slides.md --static workshop/build",
168
- "workshop:pdf": "reveal-md workshop/slides.md --print workshop/Visor-Workshop.pdf --print-size letter",
169
- "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"',
170
- "workshop:pdf:a4": "reveal-md workshop/slides.md --print workshop/Visor-Workshop-A4.pdf --print-size A4",
171
- "workshop:build": "npm run workshop:export && npm run workshop:pdf",
172
- "simulate:issue": "TS_NODE_TRANSPILE_ONLY=1 ts-node scripts/simulate-gh-run.ts --event issues --action opened --debug",
173
- "simulate:comment": "TS_NODE_TRANSPILE_ONLY=1 ts-node scripts/simulate-gh-run.ts --event issue_comment --action created --debug"
174
- },
175
- keywords: [
176
- "code-review",
177
- "ai",
178
- "github-action",
179
- "cli",
180
- "pr-review",
181
- "visor"
182
- ],
183
- author: "Probe Labs",
184
- license: "MIT",
185
- description: "AI workflow engine for code review, assistants, and automation \u2014 orchestrate checks, MCP tools, and AI providers with YAML-driven pipelines",
186
- repository: {
187
- type: "git",
188
- url: "git+https://github.com/probelabs/visor.git"
189
- },
190
- bugs: {
191
- url: "https://github.com/probelabs/visor/issues"
192
- },
193
- homepage: "https://github.com/probelabs/visor#readme",
194
- dependencies: {
195
- "@actions/core": "^1.11.1",
196
- "@apidevtools/swagger-parser": "^12.1.0",
197
- "@grammyjs/runner": "^2.0.3",
198
- "@modelcontextprotocol/sdk": "^1.25.3",
199
- "@nyariv/sandboxjs": "github:probelabs/SandboxJS#23c4bb611f7d05f3cb8c523917b5f57103e48108",
200
- "@octokit/action": "^8.0.2",
201
- "@octokit/auth-app": "^8.1.0",
202
- "@octokit/core": "^7.0.3",
203
- "@octokit/rest": "^22.0.0",
204
- "@opentelemetry/api": "^1.9.0",
205
- "@opentelemetry/api-logs": "^0.203.0",
206
- "@opentelemetry/core": "^1.30.1",
207
- "@opentelemetry/exporter-logs-otlp-http": "^0.203.0",
208
- "@opentelemetry/exporter-metrics-otlp-http": "^0.203.0",
209
- "@opentelemetry/exporter-trace-otlp-grpc": "^0.203.0",
210
- "@opentelemetry/exporter-trace-otlp-http": "^0.203.0",
211
- "@opentelemetry/instrumentation": "^0.203.0",
212
- "@opentelemetry/resources": "^1.30.1",
213
- "@opentelemetry/sdk-logs": "^0.203.0",
214
- "@opentelemetry/sdk-metrics": "^1.30.1",
215
- "@opentelemetry/sdk-node": "^0.203.0",
216
- "@opentelemetry/sdk-trace-base": "^1.30.1",
217
- "@opentelemetry/semantic-conventions": "^1.30.1",
218
- "@probelabs/probe": "^0.6.0-rc291",
219
- "@types/commander": "^2.12.0",
220
- "@types/uuid": "^10.0.0",
221
- acorn: "^8.16.0",
222
- "acorn-walk": "^8.3.5",
223
- ajv: "^8.17.1",
224
- "ajv-formats": "^3.0.1",
225
- "better-sqlite3": "^11.0.0",
226
- blessed: "^0.1.81",
227
- botbuilder: "^4.23.3",
228
- "botframework-connector": "^4.23.3",
229
- "cli-table3": "^0.6.5",
230
- commander: "^14.0.0",
231
- deepmerge: "^4.3.1",
232
- dotenv: "^17.2.3",
233
- grammy: "^1.41.1",
234
- ignore: "^7.0.5",
235
- imapflow: "^1.2.12",
236
- "js-yaml": "^4.1.0",
237
- "jsonpath-plus": "^10.4.0",
238
- liquidjs: "^10.21.1",
239
- mailparser: "^3.9.3",
240
- minimatch: "^10.2.2",
241
- "node-cron": "^3.0.3",
242
- nodemailer: "^8.0.1",
243
- open: "^9.1.0",
244
- resend: "^6.9.3",
245
- "simple-git": "^3.28.0",
246
- uuid: "^11.1.0",
247
- ws: "^8.18.3"
248
- },
249
- optionalDependencies: {
250
- "@anthropic/claude-code-sdk": "npm:null@*",
251
- "@open-policy-agent/opa-wasm": "^1.10.0",
252
- knex: "^3.1.0",
253
- mysql2: "^3.11.0",
254
- pg: "^8.13.0",
255
- tedious: "^19.0.0"
256
- },
257
- devDependencies: {
258
- "@eslint/js": "^9.34.0",
259
- "@kie/act-js": "^2.6.2",
260
- "@kie/mock-github": "^2.0.1",
261
- "@swc/core": "^1.13.2",
262
- "@swc/jest": "^0.2.37",
263
- "@types/better-sqlite3": "^7.6.0",
264
- "@types/blessed": "^0.1.27",
265
- "@types/jest": "^30.0.0",
266
- "@types/js-yaml": "^4.0.9",
267
- "@types/mailparser": "^3.4.6",
268
- "@types/node": "^24.3.0",
269
- "@types/node-cron": "^3.0.11",
270
- "@types/nodemailer": "^7.0.11",
271
- "@types/ws": "^8.18.1",
272
- "@typescript-eslint/eslint-plugin": "^8.42.0",
273
- "@typescript-eslint/parser": "^8.42.0",
274
- "@vercel/ncc": "^0.38.4",
275
- eslint: "^9.34.0",
276
- "eslint-config-prettier": "^10.1.8",
277
- "eslint-plugin-prettier": "^5.5.4",
278
- husky: "^9.1.7",
279
- jest: "^30.1.3",
280
- "lint-staged": "^16.1.6",
281
- prettier: "^3.6.2",
282
- "reveal-md": "^6.1.2",
283
- "ts-json-schema-generator": "^1.5.1",
284
- "ts-node": "^10.9.2",
285
- tsup: "^8.5.0",
286
- typescript: "^5.9.2",
287
- wrangler: "^3.0.0"
288
- },
289
- peerDependenciesMeta: {
290
- "@anthropic/claude-code-sdk": {
291
- optional: true
292
- }
293
- },
294
- directories: {
295
- test: "tests"
296
- },
297
- "lint-staged": {
298
- "src/**/*.{ts,js}": [
299
- "eslint --fix",
300
- "prettier --write"
301
- ],
302
- "tests/**/*.{ts,js}": [
303
- "eslint --fix",
304
- "prettier --write"
305
- ],
306
- "*.{json,md,yml,yaml}": [
307
- "prettier --write"
308
- ]
309
- }
310
- };
311
- }
312
- });
313
-
314
- // src/telemetry/trace-helpers.ts
315
- var trace_helpers_exports = {};
316
- __export(trace_helpers_exports, {
317
- __getOrCreateNdjsonPath: () => __getOrCreateNdjsonPath,
318
- _appendRunMarker: () => _appendRunMarker,
319
- addEvent: () => addEvent,
320
- getTracer: () => getTracer,
321
- getVisorRunAttributes: () => getVisorRunAttributes,
322
- setSpanAttributes: () => setSpanAttributes,
323
- setSpanError: () => setSpanError,
324
- withActiveSpan: () => withActiveSpan,
325
- withVisorRun: () => withVisorRun
326
- });
327
- function getTracer() {
328
- return trace.getTracer("visor");
329
- }
330
- async function withActiveSpan(name, attrs, fn) {
331
- const tracer = getTracer();
332
- return await new Promise((resolve, reject) => {
333
- const callback = async (span) => {
334
- try {
335
- const res = await fn(span);
336
- resolve(res);
337
- } catch (err) {
338
- try {
339
- if (err instanceof Error) span.recordException(err);
340
- span.setStatus({ code: SpanStatusCode.ERROR });
341
- } catch {
342
- }
343
- reject(err);
344
- } finally {
345
- try {
346
- span.end();
347
- } catch {
348
- }
349
- }
350
- };
351
- const options = attrs ? { attributes: attrs } : {};
352
- tracer.startActiveSpan(name, options, callback);
353
- });
354
- }
355
- function addEvent(name, attrs) {
356
- const span = trace.getSpan(context.active());
357
- if (span) {
358
- try {
359
- span.addEvent(name, attrs);
360
- } catch {
361
- }
362
- }
363
- try {
364
- const { emitNdjsonSpanWithEvents: emitNdjsonSpanWithEvents2 } = (init_fallback_ndjson(), __toCommonJS(fallback_ndjson_exports));
365
- emitNdjsonSpanWithEvents2("visor.event", {}, [{ name, attrs }]);
366
- if (name === "fail_if.triggered") {
367
- emitNdjsonSpanWithEvents2("visor.event", {}, [
368
- { name: "fail_if.evaluated", attrs },
369
- { name: "fail_if.triggered", attrs }
370
- ]);
371
- }
372
- } catch {
373
- }
374
- }
375
- function setSpanAttributes(attrs) {
376
- const span = trace.getSpan(context.active());
377
- if (!span) return;
378
- try {
379
- for (const [k, v] of Object.entries(attrs)) span.setAttribute(k, v);
380
- } catch {
381
- }
382
- }
383
- function setSpanError(err) {
384
- const span = trace.getSpan(context.active());
385
- if (!span) return;
386
- try {
387
- if (err instanceof Error) span.recordException(err);
388
- span.setStatus({ code: SpanStatusCode.ERROR });
389
- } catch {
390
- }
391
- }
392
- function getVisorRunAttributes() {
393
- const attrs = {};
394
- try {
395
- attrs["visor.version"] = process.env.VISOR_VERSION || (require_package()?.version ?? "dev");
396
- } catch {
397
- attrs["visor.version"] = "dev";
398
- }
399
- const commitShort = process.env.VISOR_COMMIT_SHORT || "";
400
- const commitFull = process.env.VISOR_COMMIT_SHA || process.env.VISOR_COMMIT || "";
401
- if (commitShort) {
402
- attrs["visor.commit"] = commitShort;
403
- }
404
- if (commitFull) {
405
- attrs["visor.commit.sha"] = commitFull;
406
- }
407
- attrs["visor.instance_id"] = getInstanceId();
408
- return attrs;
409
- }
410
- async function withVisorRun(attrs, runMeta, fn) {
411
- const {
412
- recordRunStart,
413
- recordRunDuration,
414
- resetRunAiCalls,
415
- recordRunAiCalls,
416
- getRunAiCalls
417
- } = (init_metrics(), __toCommonJS(metrics_exports));
418
- const instanceId = getInstanceId();
419
- recordRunStart({
420
- source: runMeta.source,
421
- userId: runMeta.userId,
422
- userName: runMeta.userName,
423
- workflowId: runMeta.workflowId,
424
- instanceId
425
- });
426
- resetRunAiCalls();
427
- const startMs = Date.now();
428
- let success = true;
429
- try {
430
- return await withActiveSpan("visor.run", attrs, async (span) => {
431
- try {
432
- return await fn(span);
433
- } finally {
434
- try {
435
- span.setAttribute("visor.run.ai_calls", getRunAiCalls());
436
- span.setAttribute("visor.run.duration_ms", Date.now() - startMs);
437
- } catch {
438
- }
439
- }
440
- });
441
- } catch (err) {
442
- success = false;
443
- throw err;
444
- } finally {
445
- recordRunAiCalls({
446
- source: runMeta.source,
447
- workflowId: runMeta.workflowId
448
- });
449
- recordRunDuration(Date.now() - startMs, {
450
- source: runMeta.source,
451
- userId: runMeta.userId,
452
- workflowId: runMeta.workflowId,
453
- success
454
- });
455
- }
456
- }
457
- function __getOrCreateNdjsonPath() {
458
- try {
459
- if (process.env.VISOR_TELEMETRY_SINK && process.env.VISOR_TELEMETRY_SINK !== "file")
460
- return null;
461
- const path2 = __require("path");
462
- const fs2 = __require("fs");
463
- if (process.env.VISOR_FALLBACK_TRACE_FILE) {
464
- __ndjsonPath = process.env.VISOR_FALLBACK_TRACE_FILE;
465
- const dir = path2.dirname(__ndjsonPath);
466
- if (!fs2.existsSync(dir)) fs2.mkdirSync(dir, { recursive: true });
467
- return __ndjsonPath;
468
- }
469
- const outDir = process.env.VISOR_TRACE_DIR || path2.join(process.cwd(), "output", "traces");
470
- if (!fs2.existsSync(outDir)) fs2.mkdirSync(outDir, { recursive: true });
471
- if (!__ndjsonPath) {
472
- const ts = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
473
- __ndjsonPath = path2.join(outDir, `${ts}.ndjson`);
474
- }
475
- return __ndjsonPath;
476
- } catch {
477
- return null;
478
- }
479
- }
480
- function _appendRunMarker() {
481
- try {
482
- const fs2 = __require("fs");
483
- const p = __getOrCreateNdjsonPath();
484
- if (!p) return;
485
- const line = { name: "visor.run", attributes: { started: true } };
486
- fs2.appendFileSync(p, JSON.stringify(line) + "\n", "utf8");
487
- } catch {
488
- }
489
- }
490
- var __ndjsonPath;
491
- var init_trace_helpers = __esm({
492
- "src/telemetry/trace-helpers.ts"() {
493
- init_lazy_otel();
494
- init_instance_id();
495
- __ndjsonPath = null;
496
- }
497
- });
498
-
499
- export {
500
- emitNdjsonFallback,
501
- emitNdjsonSpanWithEvents,
502
- fallback_ndjson_exports,
503
- init_fallback_ndjson,
504
- getTracer,
505
- withActiveSpan,
506
- addEvent,
507
- setSpanAttributes,
508
- setSpanError,
509
- getVisorRunAttributes,
510
- withVisorRun,
511
- __getOrCreateNdjsonPath,
512
- _appendRunMarker,
513
- trace_helpers_exports,
514
- init_trace_helpers
515
- };
516
- //# sourceMappingURL=chunk-65SHRIQF.mjs.map