@probelabs/visor 0.1.96 → 0.1.97

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 (81) hide show
  1. package/README.md +6 -5
  2. package/dist/{168.index.js → 136.index.js} +5 -5
  3. package/dist/{272.index.js → 146.index.js} +5 -5
  4. package/dist/{13.index.js → 160.index.js} +5 -5
  5. package/dist/{421.index.js → 179.index.js} +3 -3
  6. package/dist/{85.index.js → 191.index.js} +5 -5
  7. package/dist/{544.index.js → 384.index.js} +3 -3
  8. package/dist/{861.index.js → 405.index.js} +3 -3
  9. package/dist/{320.index.js → 42.index.js} +3 -3
  10. package/dist/448.index.js +48 -0
  11. package/dist/{878.index.js → 491.index.js} +5 -5
  12. package/dist/663.index.js +321 -0
  13. package/dist/69.index.js +38 -0
  14. package/dist/{54.index.js → 760.index.js} +5 -5
  15. package/dist/80.index.js +263 -0
  16. package/dist/886.index.js +81 -0
  17. package/dist/917.index.js +82 -0
  18. package/dist/955.index.js +82 -0
  19. package/dist/ai-review-service.d.ts +2 -3
  20. package/dist/ai-review-service.d.ts.map +1 -1
  21. package/dist/cli.d.ts.map +1 -1
  22. package/dist/generated/config-schema.d.ts +18 -1
  23. package/dist/generated/config-schema.d.ts.map +1 -1
  24. package/dist/generated/config-schema.json +23 -1
  25. package/dist/index.js +191599 -155303
  26. package/dist/proto/protoc-gen-validate/LICENSE +202 -0
  27. package/dist/proto/protoc-gen-validate/validate/validate.proto +797 -0
  28. package/dist/proto/xds/LICENSE +201 -0
  29. package/dist/proto/xds/xds/data/orca/v3/orca_load_report.proto +58 -0
  30. package/dist/proto/xds/xds/service/orca/v3/orca.proto +36 -0
  31. package/dist/protoc-gen-validate/LICENSE +202 -0
  32. package/dist/protoc-gen-validate/validate/validate.proto +797 -0
  33. package/dist/providers/check-provider-registry.d.ts.map +1 -1
  34. package/dist/providers/index.d.ts +1 -0
  35. package/dist/providers/index.d.ts.map +1 -1
  36. package/dist/providers/mcp-check-provider.d.ts +102 -0
  37. package/dist/providers/mcp-check-provider.d.ts.map +1 -0
  38. package/dist/sdk/check-execution-engine-S7BFPVWA.mjs +11 -0
  39. package/dist/sdk/{chunk-Q4S5A5TO.mjs → chunk-4VK6WTYU.mjs} +610 -21
  40. package/dist/sdk/chunk-4VK6WTYU.mjs.map +1 -0
  41. package/dist/sdk/chunk-IG3BFIIN.mjs +174 -0
  42. package/dist/sdk/chunk-IG3BFIIN.mjs.map +1 -0
  43. package/dist/sdk/chunk-YXOWIDEF.mjs +60 -0
  44. package/dist/sdk/chunk-YXOWIDEF.mjs.map +1 -0
  45. package/dist/sdk/{mermaid-telemetry-LZGDD35I.mjs → mermaid-telemetry-4DUEYCLE.mjs} +2 -2
  46. package/dist/sdk/sdk.d.mts +12 -1
  47. package/dist/sdk/sdk.d.ts +12 -1
  48. package/dist/sdk/sdk.js +1019 -1577
  49. package/dist/sdk/sdk.js.map +1 -1
  50. package/dist/sdk/sdk.mjs +22 -4
  51. package/dist/sdk/sdk.mjs.map +1 -1
  52. package/dist/sdk/{tracer-init-O7RLXMJ3.mjs → tracer-init-RJGAIOBP.mjs} +2 -2
  53. package/dist/session-registry.d.ts +2 -3
  54. package/dist/session-registry.d.ts.map +1 -1
  55. package/dist/traces/run-2025-10-19T14-24-36-341Z.ndjson +40 -0
  56. package/dist/traces/run-2025-10-19T14-24-48-674Z.ndjson +40 -0
  57. package/dist/traces/run-2025-10-19T14-24-49-238Z.ndjson +40 -0
  58. package/dist/traces/run-2025-10-19T14-24-49-761Z.ndjson +40 -0
  59. package/dist/traces/run-2025-10-19T14-24-50-279Z.ndjson +12 -0
  60. package/dist/types/config.d.ts +12 -1
  61. package/dist/types/config.d.ts.map +1 -1
  62. package/dist/utils/tracer-init.d.ts +3 -4
  63. package/dist/utils/tracer-init.d.ts.map +1 -1
  64. package/dist/xds/LICENSE +201 -0
  65. package/dist/xds/xds/data/orca/v3/orca_load_report.proto +58 -0
  66. package/dist/xds/xds/service/orca/v3/orca.proto +36 -0
  67. package/package.json +15 -8
  68. package/dist/sdk/check-execution-engine-NMPXJ7FQ.mjs +0 -11
  69. package/dist/sdk/chunk-KVHVCGY6.mjs +0 -103
  70. package/dist/sdk/chunk-KVHVCGY6.mjs.map +0 -1
  71. package/dist/sdk/chunk-Q4S5A5TO.mjs.map +0 -1
  72. package/dist/sdk/chunk-TWJKAYT6.mjs +0 -1124
  73. package/dist/sdk/chunk-TWJKAYT6.mjs.map +0 -1
  74. /package/dist/{traces/run-2025-10-18T20-24-27-886Z.ndjson → output/traces/run-2025-10-19T14-24-36-341Z.ndjson} +0 -0
  75. /package/dist/{traces/run-2025-10-18T20-24-38-817Z.ndjson → output/traces/run-2025-10-19T14-24-48-674Z.ndjson} +0 -0
  76. /package/dist/{traces/run-2025-10-18T20-24-39-361Z.ndjson → output/traces/run-2025-10-19T14-24-49-238Z.ndjson} +0 -0
  77. /package/dist/{traces/run-2025-10-18T20-24-39-852Z.ndjson → output/traces/run-2025-10-19T14-24-49-761Z.ndjson} +0 -0
  78. /package/dist/{traces/run-2025-10-18T20-24-40-335Z.ndjson → output/traces/run-2025-10-19T14-24-50-279Z.ndjson} +0 -0
  79. /package/dist/sdk/{check-execution-engine-NMPXJ7FQ.mjs.map → check-execution-engine-S7BFPVWA.mjs.map} +0 -0
  80. /package/dist/sdk/{mermaid-telemetry-LZGDD35I.mjs.map → mermaid-telemetry-4DUEYCLE.mjs.map} +0 -0
  81. /package/dist/sdk/{tracer-init-O7RLXMJ3.mjs.map → tracer-init-RJGAIOBP.mjs.map} +0 -0
@@ -0,0 +1,58 @@
1
+ syntax = "proto3";
2
+
3
+ package xds.data.orca.v3;
4
+
5
+ option java_outer_classname = "OrcaLoadReportProto";
6
+ option java_multiple_files = true;
7
+ option java_package = "com.github.xds.data.orca.v3";
8
+ option go_package = "github.com/cncf/xds/go/xds/data/orca/v3";
9
+
10
+ import "validate/validate.proto";
11
+
12
+ // See section `ORCA load report format` of the design document in
13
+ // :ref:`https://github.com/envoyproxy/envoy/issues/6614`.
14
+
15
+ message OrcaLoadReport {
16
+ // CPU utilization expressed as a fraction of available CPU resources. This
17
+ // should be derived from the latest sample or measurement. The value may be
18
+ // larger than 1.0 when the usage exceeds the reporter dependent notion of
19
+ // soft limits.
20
+ double cpu_utilization = 1 [(validate.rules).double.gte = 0];
21
+
22
+ // Memory utilization expressed as a fraction of available memory
23
+ // resources. This should be derived from the latest sample or measurement.
24
+ double mem_utilization = 2 [(validate.rules).double.gte = 0, (validate.rules).double.lte = 1];
25
+
26
+ // Total RPS being served by an endpoint. This should cover all services that an endpoint is
27
+ // responsible for.
28
+ // Deprecated -- use ``rps_fractional`` field instead.
29
+ uint64 rps = 3 [deprecated = true];
30
+
31
+ // Application specific requests costs. Each value is an absolute cost (e.g. 3487 bytes of
32
+ // storage) associated with the request.
33
+ map<string, double> request_cost = 4;
34
+
35
+ // Resource utilization values. Each value is expressed as a fraction of total resources
36
+ // available, derived from the latest sample or measurement.
37
+ map<string, double> utilization = 5
38
+ [(validate.rules).map.values.double.gte = 0, (validate.rules).map.values.double.lte = 1];
39
+
40
+ // Total RPS being served by an endpoint. This should cover all services that an endpoint is
41
+ // responsible for.
42
+ double rps_fractional = 6 [(validate.rules).double.gte = 0];
43
+
44
+ // Total EPS (errors/second) being served by an endpoint. This should cover
45
+ // all services that an endpoint is responsible for.
46
+ double eps = 7 [(validate.rules).double.gte = 0];
47
+
48
+ // Application specific opaque metrics.
49
+ map<string, double> named_metrics = 8;
50
+
51
+ // Application specific utilization expressed as a fraction of available
52
+ // resources. For example, an application may report the max of CPU and memory
53
+ // utilization for better load balancing if it is both CPU and memory bound.
54
+ // This should be derived from the latest sample or measurement.
55
+ // The value may be larger than 1.0 when the usage exceeds the reporter
56
+ // dependent notion of soft limits.
57
+ double application_utilization = 9 [(validate.rules).double.gte = 0];
58
+ }
@@ -0,0 +1,36 @@
1
+ syntax = "proto3";
2
+
3
+ package xds.service.orca.v3;
4
+
5
+ option java_outer_classname = "OrcaProto";
6
+ option java_multiple_files = true;
7
+ option java_package = "com.github.xds.service.orca.v3";
8
+ option go_package = "github.com/cncf/xds/go/xds/service/orca/v3";
9
+
10
+ import "xds/data/orca/v3/orca_load_report.proto";
11
+
12
+ import "google/protobuf/duration.proto";
13
+
14
+ // See section `Out-of-band (OOB) reporting` of the design document in
15
+ // :ref:`https://github.com/envoyproxy/envoy/issues/6614`.
16
+
17
+ // Out-of-band (OOB) load reporting service for the additional load reporting
18
+ // agent that does not sit in the request path. Reports are periodically sampled
19
+ // with sufficient frequency to provide temporal association with requests.
20
+ // OOB reporting compensates the limitation of in-band reporting in revealing
21
+ // costs for backends that do not provide a steady stream of telemetry such as
22
+ // long running stream operations and zero QPS services. This is a server
23
+ // streaming service, client needs to terminate current RPC and initiate
24
+ // a new call to change backend reporting frequency.
25
+ service OpenRcaService {
26
+ rpc StreamCoreMetrics(OrcaLoadReportRequest) returns (stream xds.data.orca.v3.OrcaLoadReport);
27
+ }
28
+
29
+ message OrcaLoadReportRequest {
30
+ // Interval for generating Open RCA core metric responses.
31
+ google.protobuf.Duration report_interval = 1;
32
+ // Request costs to collect. If this is empty, all known requests costs tracked by
33
+ // the load reporting agent will be returned. This provides an opportunity for
34
+ // the client to selectively obtain a subset of tracked costs.
35
+ repeated string request_cost_names = 2;
36
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@probelabs/visor",
3
- "version": "0.1.96",
3
+ "version": "0.1.97",
4
4
  "main": "dist/index.js",
5
5
  "bin": {
6
6
  "visor": "./dist/index.js"
@@ -31,7 +31,7 @@
31
31
  "registry": "https://registry.npmjs.org/"
32
32
  },
33
33
  "scripts": {
34
- "build:cli": "ncc build src/index.ts -o dist && cp -r defaults dist/ && 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",
34
+ "build:cli": "ncc build src/index.ts -o dist && cp -r defaults dist/ && cp -r output dist/ && 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",
35
35
  "build:sdk": "tsup src/sdk.ts --dts --sourcemap --format esm,cjs --out-dir dist/sdk",
36
36
  "build": "npm run build:cli && npm run build:sdk",
37
37
  "test": "jest",
@@ -85,12 +85,23 @@
85
85
  "homepage": "https://github.com/probelabs/visor#readme",
86
86
  "dependencies": {
87
87
  "@actions/core": "^1.11.1",
88
+ "@modelcontextprotocol/sdk": "^1.20.1",
88
89
  "@nyariv/sandboxjs": "^0.8.25",
89
90
  "@octokit/action": "^8.0.2",
90
91
  "@octokit/auth-app": "^8.1.0",
91
92
  "@octokit/core": "^7.0.3",
92
93
  "@octokit/rest": "^22.0.0",
93
- "@probelabs/probe": "^0.6.0-rc146",
94
+ "@opentelemetry/api": "^1.9.0",
95
+ "@opentelemetry/core": "^1.30.1",
96
+ "@opentelemetry/exporter-trace-otlp-grpc": "^0.203.0",
97
+ "@opentelemetry/exporter-trace-otlp-http": "^0.203.0",
98
+ "@opentelemetry/instrumentation": "^0.203.0",
99
+ "@opentelemetry/resources": "^1.30.1",
100
+ "@opentelemetry/sdk-metrics": "^1.30.1",
101
+ "@opentelemetry/sdk-node": "^0.203.0",
102
+ "@opentelemetry/sdk-trace-base": "^1.30.1",
103
+ "@opentelemetry/semantic-conventions": "^1.30.1",
104
+ "@probelabs/probe": "^0.6.0-rc148",
94
105
  "@types/commander": "^2.12.0",
95
106
  "@types/uuid": "^10.0.0",
96
107
  "ajv": "^8.17.1",
@@ -131,15 +142,11 @@
131
142
  "wrangler": "^3.0.0"
132
143
  },
133
144
  "peerDependencies": {
134
- "@anthropic/claude-code-sdk": "^1.0.0",
135
- "@modelcontextprotocol/sdk": "^1.0.0"
145
+ "@anthropic/claude-code-sdk": "^1.0.0"
136
146
  },
137
147
  "peerDependenciesMeta": {
138
148
  "@anthropic/claude-code-sdk": {
139
149
  "optional": true
140
- },
141
- "@modelcontextprotocol/sdk": {
142
- "optional": true
143
150
  }
144
151
  },
145
152
  "directories": {
@@ -1,11 +0,0 @@
1
- import {
2
- CheckExecutionEngine
3
- } from "./chunk-Q4S5A5TO.mjs";
4
- import "./chunk-KVHVCGY6.mjs";
5
- import "./chunk-I3GQJIR7.mjs";
6
- import "./chunk-TWJKAYT6.mjs";
7
- import "./chunk-WMJKH4XE.mjs";
8
- export {
9
- CheckExecutionEngine
10
- };
11
- //# sourceMappingURL=check-execution-engine-NMPXJ7FQ.mjs.map
@@ -1,103 +0,0 @@
1
- import {
2
- __esm
3
- } from "./chunk-WMJKH4XE.mjs";
4
-
5
- // src/utils/tracer-init.ts
6
- import * as path from "path";
7
- import * as fs from "fs";
8
- import { TelemetryConfig, AppTracer, SimpleTelemetry, SimpleAppTracer } from "@probelabs/probe";
9
- async function initializeTracer(sessionId, checkName) {
10
- try {
11
- if (TelemetryConfig && AppTracer) {
12
- const sanitizedCheckName = checkName ? path.basename(checkName) : "check";
13
- const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
14
- const traceDir = process.env.GITHUB_WORKSPACE ? path.join(process.env.GITHUB_WORKSPACE, "debug-artifacts") : path.join(process.cwd(), "debug-artifacts");
15
- if (!fs.existsSync(traceDir)) {
16
- fs.mkdirSync(traceDir, { recursive: true });
17
- }
18
- const traceFilePath = path.join(traceDir, `trace-${sanitizedCheckName}-${timestamp}.jsonl`);
19
- const resolvedTracePath = path.resolve(traceFilePath);
20
- const resolvedTraceDir = path.resolve(traceDir);
21
- if (!resolvedTracePath.startsWith(resolvedTraceDir)) {
22
- console.error(
23
- `\u26A0\uFE0F Security: Attempted path traversal detected. Check name: ${checkName}, resolved path: ${resolvedTracePath}`
24
- );
25
- return null;
26
- }
27
- const telemetryConfig = new TelemetryConfig({
28
- serviceName: "visor-ai",
29
- serviceVersion: "1.0.0",
30
- enableFile: true,
31
- filePath: traceFilePath,
32
- enableConsole: false,
33
- // Disable console to reduce noise
34
- enableRemote: false
35
- // Can be enabled via OTEL_EXPORTER_OTLP_ENDPOINT env var
36
- });
37
- telemetryConfig.initialize();
38
- const tracer = new AppTracer(telemetryConfig, sessionId);
39
- console.error(`\u{1F4CA} OpenTelemetry tracing enabled for visor-ai, saving to: ${traceFilePath}`);
40
- console.error(
41
- `\u{1F332} Trace spans will show hierarchical relationships between visor checks and probe agent operations`
42
- );
43
- if (process.env.GITHUB_ACTIONS) {
44
- console.log(
45
- `::notice title=AI Trace::OpenTelemetry trace will be saved to ${traceFilePath}`
46
- );
47
- console.log(`::set-output name=trace-path::${traceFilePath}`);
48
- }
49
- return { tracer, telemetryConfig, filePath: traceFilePath };
50
- }
51
- if (SimpleTelemetry && SimpleAppTracer) {
52
- console.warn(
53
- "\u26A0\uFE0F Using SimpleTelemetry fallback - hierarchical span relationships may not be available"
54
- );
55
- const sanitizedCheckName = checkName ? path.basename(checkName) : "check";
56
- const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
57
- const traceDir = process.env.GITHUB_WORKSPACE ? path.join(process.env.GITHUB_WORKSPACE, "debug-artifacts") : path.join(process.cwd(), "debug-artifacts");
58
- if (!fs.existsSync(traceDir)) {
59
- fs.mkdirSync(traceDir, { recursive: true });
60
- }
61
- const traceFilePath = path.join(traceDir, `trace-${sanitizedCheckName}-${timestamp}.jsonl`);
62
- const resolvedTracePath = path.resolve(traceFilePath);
63
- const resolvedTraceDir = path.resolve(traceDir);
64
- if (!resolvedTracePath.startsWith(resolvedTraceDir)) {
65
- console.error(
66
- `\u26A0\uFE0F Security: Attempted path traversal detected. Check name: ${checkName}, resolved path: ${resolvedTracePath}`
67
- );
68
- return null;
69
- }
70
- const telemetry = new SimpleTelemetry({
71
- enableFile: true,
72
- filePath: traceFilePath,
73
- enableConsole: false
74
- });
75
- const tracer = new SimpleAppTracer(telemetry, sessionId);
76
- console.error(`\u{1F4CA} Simple tracing enabled, will save to: ${traceFilePath}`);
77
- if (process.env.GITHUB_ACTIONS) {
78
- console.log(`::notice title=AI Trace::Trace will be saved to ${traceFilePath}`);
79
- console.log(`::set-output name=trace-path::${traceFilePath}`);
80
- }
81
- return {
82
- tracer,
83
- telemetryConfig: telemetry,
84
- filePath: traceFilePath
85
- };
86
- }
87
- console.error("\u26A0\uFE0F Telemetry classes not available in ProbeAgent, skipping tracing");
88
- return null;
89
- } catch (error) {
90
- console.error("\u26A0\uFE0F Warning: Failed to initialize tracing:", error);
91
- return null;
92
- }
93
- }
94
- var init_tracer_init = __esm({
95
- "src/utils/tracer-init.ts"() {
96
- }
97
- });
98
-
99
- export {
100
- initializeTracer,
101
- init_tracer_init
102
- };
103
- //# sourceMappingURL=chunk-KVHVCGY6.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/tracer-init.ts"],"sourcesContent":["import * as path from 'path';\nimport * as fs from 'fs';\nimport { TelemetryConfig, AppTracer, SimpleTelemetry, SimpleAppTracer } from '@probelabs/probe';\n\n/**\n * Safely initialize a tracer for ProbeAgent with proper path sanitization\n * Uses full OpenTelemetry integration for hierarchical span relationships\n * This prevents path traversal vulnerabilities by sanitizing the checkName\n */\nexport async function initializeTracer(\n sessionId: string,\n checkName?: string\n): Promise<{ tracer: AppTracer; telemetryConfig: TelemetryConfig; filePath: string } | null> {\n try {\n // Try to use full OpenTelemetry integration first (provides proper span hierarchy)\n if (TelemetryConfig && AppTracer) {\n // SECURITY: Sanitize checkName to prevent path traversal attacks\n // Use path.basename to strip any directory traversal characters (../, etc.)\n const sanitizedCheckName = checkName ? path.basename(checkName) : 'check';\n\n // Create trace file path in debug-artifacts directory\n const timestamp = new Date().toISOString().replace(/[:.]/g, '-');\n const traceDir = process.env.GITHUB_WORKSPACE\n ? path.join(process.env.GITHUB_WORKSPACE, 'debug-artifacts')\n : path.join(process.cwd(), 'debug-artifacts');\n\n // Create traces directory if it doesn't exist\n if (!fs.existsSync(traceDir)) {\n fs.mkdirSync(traceDir, { recursive: true });\n }\n\n // SECURITY: Use path.join to safely construct the path\n // This ensures the final path is within traceDir\n const traceFilePath = path.join(traceDir, `trace-${sanitizedCheckName}-${timestamp}.jsonl`);\n\n // SECURITY: Verify the resolved path is within the intended directory\n const resolvedTracePath = path.resolve(traceFilePath);\n const resolvedTraceDir = path.resolve(traceDir);\n if (!resolvedTracePath.startsWith(resolvedTraceDir)) {\n console.error(\n `⚠️ Security: Attempted path traversal detected. Check name: ${checkName}, resolved path: ${resolvedTracePath}`\n );\n return null;\n }\n\n // Initialize OpenTelemetry with file exporter\n // This provides proper span hierarchy and parent-child relationships\n const telemetryConfig = new TelemetryConfig({\n serviceName: 'visor-ai',\n serviceVersion: '1.0.0',\n enableFile: true,\n filePath: traceFilePath,\n enableConsole: false, // Disable console to reduce noise\n enableRemote: false, // Can be enabled via OTEL_EXPORTER_OTLP_ENDPOINT env var\n });\n\n // Initialize the OpenTelemetry SDK\n telemetryConfig.initialize();\n\n // Create the AppTracer with session ID for consistent tracing\n const tracer = new AppTracer(telemetryConfig, sessionId);\n\n console.error(`📊 OpenTelemetry tracing enabled for visor-ai, saving to: ${traceFilePath}`);\n console.error(\n `🌲 Trace spans will show hierarchical relationships between visor checks and probe agent operations`\n );\n\n // If in GitHub Actions, log the path for artifact upload\n if (process.env.GITHUB_ACTIONS) {\n console.log(\n `::notice title=AI Trace::OpenTelemetry trace will be saved to ${traceFilePath}`\n );\n console.log(`::set-output name=trace-path::${traceFilePath}`);\n }\n\n return { tracer, telemetryConfig, filePath: traceFilePath };\n }\n\n // Fallback to SimpleTelemetry if full OpenTelemetry is not available\n if (SimpleTelemetry && SimpleAppTracer) {\n console.warn(\n '⚠️ Using SimpleTelemetry fallback - hierarchical span relationships may not be available'\n );\n\n // SECURITY: Sanitize checkName to prevent path traversal attacks\n const sanitizedCheckName = checkName ? path.basename(checkName) : 'check';\n\n // Create trace file path in debug-artifacts directory\n const timestamp = new Date().toISOString().replace(/[:.]/g, '-');\n const traceDir = process.env.GITHUB_WORKSPACE\n ? path.join(process.env.GITHUB_WORKSPACE, 'debug-artifacts')\n : path.join(process.cwd(), 'debug-artifacts');\n\n // Create traces directory if it doesn't exist\n if (!fs.existsSync(traceDir)) {\n fs.mkdirSync(traceDir, { recursive: true });\n }\n\n // SECURITY: Use path.join to safely construct the path\n const traceFilePath = path.join(traceDir, `trace-${sanitizedCheckName}-${timestamp}.jsonl`);\n\n // SECURITY: Verify the resolved path is within the intended directory\n const resolvedTracePath = path.resolve(traceFilePath);\n const resolvedTraceDir = path.resolve(traceDir);\n if (!resolvedTracePath.startsWith(resolvedTraceDir)) {\n console.error(\n `⚠️ Security: Attempted path traversal detected. Check name: ${checkName}, resolved path: ${resolvedTracePath}`\n );\n return null;\n }\n\n // Initialize simple telemetry\n const telemetry = new SimpleTelemetry({\n enableFile: true,\n filePath: traceFilePath,\n enableConsole: false,\n });\n\n const tracer = new SimpleAppTracer(telemetry, sessionId);\n\n console.error(`📊 Simple tracing enabled, will save to: ${traceFilePath}`);\n\n // If in GitHub Actions, log the path for artifact upload\n if (process.env.GITHUB_ACTIONS) {\n console.log(`::notice title=AI Trace::Trace will be saved to ${traceFilePath}`);\n console.log(`::set-output name=trace-path::${traceFilePath}`);\n }\n\n // Return with proper typing for SimpleTelemetry\n return {\n tracer: tracer as any as AppTracer,\n telemetryConfig: telemetry as any as TelemetryConfig,\n filePath: traceFilePath,\n };\n }\n\n console.error('⚠️ Telemetry classes not available in ProbeAgent, skipping tracing');\n return null;\n } catch (error) {\n console.error('⚠️ Warning: Failed to initialize tracing:', error);\n return null;\n }\n}\n"],"mappings":";;;;;AAAA,YAAY,UAAU;AACtB,YAAY,QAAQ;AACpB,SAAS,iBAAiB,WAAW,iBAAiB,uBAAuB;AAO7E,eAAsB,iBACpB,WACA,WAC2F;AAC3F,MAAI;AAEF,QAAI,mBAAmB,WAAW;AAGhC,YAAM,qBAAqB,YAAiB,cAAS,SAAS,IAAI;AAGlE,YAAM,aAAY,oBAAI,KAAK,GAAE,YAAY,EAAE,QAAQ,SAAS,GAAG;AAC/D,YAAM,WAAW,QAAQ,IAAI,mBACpB,U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