dist/ directory — not the source files you edit in VS Code. If you place a probe on line 42 of src/handlers/user.ts, the agent needs to know which line in dist/handlers/user.js corresponds to that location. HyperProbe uses standard .map files generated by your TypeScript compiler or bundler to perform this mapping automatically, so you always work with your original source coordinates.
How source map resolution works
When the agent starts, one instance uploads the.map files from your build output to the HyperProbe backend. When you create a probe in VS Code pointing at a source file and line number, the backend uses the uploaded map to translate those coordinates into the compiled file and line that the running process actually executes. The agent instruments the compiled location — and the VS Code extension continues to display results in terms of the original source file.
Only one instance of the agent performs the upload. If multiple instances of your service are running, they coordinate automatically: one is designated as the uploader, the others poll until the upload is complete. This is handled entirely by the SDK — you do not need to configure it.
Prerequisites
Your build process must generate source map files (.map files) alongside your compiled output. HyperProbe requires standard V3 source maps; inline source maps embedded in the compiled file are not supported.
Step 1: Enable source maps in your build
- tsc
- esbuild
Add After building with
"sourceMap": true to your tsconfig.json:tsconfig.json
tsc, each .js file in dist/ has a corresponding .js.map file. These are the files HyperProbe reads.Step 2: Set GIT_COMMIT in your deployment
ThecommitSha value is required for source map resolution. It acts as a key that associates the uploaded source maps with a specific build, preventing probe coordinates from one deployment being applied to a different one.
Set GIT_COMMIT in your CI/CD pipeline or deployment configuration before the process starts:
- Shell / Dockerfile
- GitHub Actions
- Docker
Step 3: Configure the SDK
PasssourceMapDir and distLocation to HyperProbe.start. Both typically point to your build output directory.
src/index.ts
| Option | Env variable | Description |
|---|---|---|
sourceMapDir | HYPERPROBE_SOURCE_MAP_DIR | Directory where .map files are located. Defaults to process.cwd(). |
distLocation | HYPERPROBE_DIST_LOCATION | Directory where compiled .js files are located. |
sourceMapDir and distLocation are different (for example, if map files are published to a separate directory), set each path independently.
Verifying the upload
When source map upload succeeds, the agent logs the following at thehyperprobe:broker debug namespace:
DEBUG environment variable:
Project structure example
For a typical TypeScript project, your layout and configuration might look like this:src/handlers/user.ts, HyperProbe looks up the mapping in dist/handlers/user.js.map and instruments the correct line in dist/handlers/user.js.
