@contrast/agent 5.4.1 → 5.4.2

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.
@@ -16,6 +16,7 @@
16
16
  'use strict';
17
17
 
18
18
  const process = require('process');
19
+ const W = require('node:worker_threads');
19
20
  const semver = require('semver');
20
21
  const _agentify = require('@contrast/agentify');
21
22
  const {
@@ -116,6 +117,12 @@ function checkImportVsLoaderVsNodeVersion() {
116
117
  }
117
118
 
118
119
  async function startAgent({ type = 'cjs' } = {}) {
120
+ if (!W.isMainThread) {
121
+ // todo : support workers
122
+ console.warn('worker thread not instrumented by contrast');
123
+ throw new Error();
124
+ }
125
+
119
126
  const core = initCore();
120
127
  const agentify = _agentify(core);
121
128
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/agent",
3
- "version": "5.4.1",
3
+ "version": "5.4.2",
4
4
  "description": "Assess and Protect agents for Node.js",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "author": "Contrast Security <nodejs@contrastsecurity.com> (https://www.contrastsecurity.com)",
@@ -21,13 +21,13 @@
21
21
  "test": "../scripts/test.sh"
22
22
  },
23
23
  "dependencies": {
24
- "@contrast/agentify": "1.22.1",
24
+ "@contrast/agentify": "1.22.2",
25
25
  "@contrast/architecture-components": "1.17.0",
26
- "@contrast/assess": "1.26.0",
26
+ "@contrast/assess": "1.26.1",
27
27
  "@contrast/library-analysis": "1.18.0",
28
- "@contrast/protect": "1.34.1",
28
+ "@contrast/protect": "1.34.2",
29
29
  "@contrast/route-coverage": "1.17.0",
30
- "@contrast/telemetry": "1.5.2",
30
+ "@contrast/telemetry": "1.5.3",
31
31
  "semver": "^7.3.7"
32
32
  }
33
33
  }