@introspection-sdk/introspection-node 0.4.8 → 0.4.10
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.
- package/.turbo/turbo-build.log +1 -1
- package/dist/utils.d.ts +12 -6
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +11 -7
- package/dist/utils.js.map +1 -1
- package/package.json +7 -6
- package/src/proxy-from-env.d.ts +7 -0
- package/src/utils.ts +12 -8
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
> @introspection-sdk/introspection-node@0.4.
|
|
2
|
+
> @introspection-sdk/introspection-node@0.4.10 build /home/runner/work/introspection-js-sdk/introspection-js-sdk/packages/introspection-node
|
|
3
3
|
> tsc
|
|
4
4
|
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import { DiagLogger } from "@opentelemetry/api";
|
|
2
2
|
/**
|
|
3
3
|
* Attach a forward-proxy agent to OTLP exporter options when a proxy is
|
|
4
|
-
* configured
|
|
4
|
+
* configured for the exporter's endpoint.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* The OTLP proto exporters use Node's `http`/`https` stack, so this uses
|
|
7
7
|
* `HttpsProxyAgent` (an `http.Agent`) rather than the undici dispatcher from
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* `@introspection-sdk/introspection-proxy` — a dispatcher only applies to
|
|
9
|
+
* `fetch`. Unlike undici's `EnvHttpProxyAgent`, `HttpsProxyAgent` ignores
|
|
10
|
+
* `NO_PROXY`, so we resolve the proxy per-endpoint with `proxy-from-env`'s
|
|
11
|
+
* {@link getProxyForUrl}, which returns `""` when the host matches `NO_PROXY`.
|
|
12
|
+
* This keeps in-cluster endpoints (e.g. `*.svc.cluster.local`) on a direct
|
|
13
|
+
* connection instead of tunnelling them through the egress proxy, which has no
|
|
14
|
+
* route for them.
|
|
11
15
|
*/
|
|
12
|
-
export declare function withOtlpHttpsProxy<T extends
|
|
16
|
+
export declare function withOtlpHttpsProxy<T extends {
|
|
17
|
+
url?: string;
|
|
18
|
+
}>(options: T): T;
|
|
13
19
|
/**
|
|
14
20
|
* Logger for introspection-sdk package.
|
|
15
21
|
* Uses OpenTelemetry's diagnostic logger.
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAI9D
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAI9D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAQ5E;AAED;;;GAGG;AACH,cAAM,mBAAoB,YAAW,UAAU;IAC7C,OAAO,CAAC,QAAQ,CAAe;;IAS/B,OAAO,CAAC,aAAa;IAiBrB,OAAO,CAAC,SAAS;IAIjB,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAM/B,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAM9B,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAM9B,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAM/B,OAAO,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;CAKlC;AAED,eAAO,MAAM,MAAM,qBAA4B,CAAC"}
|
package/dist/utils.js
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import { DiagLogLevel } from "@opentelemetry/api";
|
|
2
2
|
import { HttpsProxyAgent } from "https-proxy-agent";
|
|
3
|
-
import {
|
|
3
|
+
import { getProxyForUrl } from "proxy-from-env";
|
|
4
4
|
/**
|
|
5
5
|
* Attach a forward-proxy agent to OTLP exporter options when a proxy is
|
|
6
|
-
* configured
|
|
6
|
+
* configured for the exporter's endpoint.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
8
|
+
* The OTLP proto exporters use Node's `http`/`https` stack, so this uses
|
|
9
9
|
* `HttpsProxyAgent` (an `http.Agent`) rather than the undici dispatcher from
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* `@introspection-sdk/introspection-proxy` — a dispatcher only applies to
|
|
11
|
+
* `fetch`. Unlike undici's `EnvHttpProxyAgent`, `HttpsProxyAgent` ignores
|
|
12
|
+
* `NO_PROXY`, so we resolve the proxy per-endpoint with `proxy-from-env`'s
|
|
13
|
+
* {@link getProxyForUrl}, which returns `""` when the host matches `NO_PROXY`.
|
|
14
|
+
* This keeps in-cluster endpoints (e.g. `*.svc.cluster.local`) on a direct
|
|
15
|
+
* connection instead of tunnelling them through the egress proxy, which has no
|
|
16
|
+
* route for them.
|
|
13
17
|
*/
|
|
14
18
|
export function withOtlpHttpsProxy(options) {
|
|
15
|
-
const proxyUrl =
|
|
19
|
+
const proxyUrl = options.url ? getProxyForUrl(options.url) : "";
|
|
16
20
|
if (!proxyUrl)
|
|
17
21
|
return options;
|
|
18
22
|
return {
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAc,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,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IAChC,CAAC;IAED,KAAK,CAAC,GAAG,IAAe;QACtB,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;YACvC,OAAO,CAAC,KAAK,CAAC,qBAAqB,EAAE,GAAG,IAAI,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;IAED,IAAI,CAAC,GAAG,IAAe;QACrB,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;YACtC,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,GAAG,IAAI,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IAED,IAAI,CAAC,GAAG,IAAe;QACrB,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;YACtC,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,GAAG,IAAI,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IAED,KAAK,CAAC,GAAG,IAAe;QACtB,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;YACvC,OAAO,CAAC,KAAK,CAAC,qBAAqB,EAAE,GAAG,IAAI,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;IAED,OAAO,CAAC,GAAG,IAAe;QACxB,IAAI,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC;YACzC,OAAO,CAAC,KAAK,CAAC,qBAAqB,EAAE,GAAG,IAAI,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;CACF;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,mBAAmB,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@introspection-sdk/introspection-node",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.10",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Introspection observability SDK for Node.js",
|
|
6
6
|
"engines": {
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"@langchain/core": "^1.1.48",
|
|
49
49
|
"@mastra/core": "^1.41.0",
|
|
50
50
|
"@mastra/observability": "^1.14.1",
|
|
51
|
-
"@earendil-works/pi-agent-core": "^0.
|
|
52
|
-
"@earendil-works/pi-ai": "^0.
|
|
51
|
+
"@earendil-works/pi-agent-core": "^0.79.0",
|
|
52
|
+
"@earendil-works/pi-ai": "^0.79.0",
|
|
53
53
|
"@anthropic-ai/sdk": "^0.102.0",
|
|
54
54
|
"@anthropic-ai/claude-agent-sdk": "^0.3.168",
|
|
55
55
|
"@google/genai": "^2.8.0",
|
|
@@ -138,9 +138,10 @@
|
|
|
138
138
|
"dependencies": {
|
|
139
139
|
"@opentelemetry/api": "^1.9.1",
|
|
140
140
|
"https-proxy-agent": "^7.0.6",
|
|
141
|
-
"
|
|
142
|
-
"@introspection-sdk/
|
|
143
|
-
"@introspection-sdk/introspection-pi": "0.4.
|
|
141
|
+
"proxy-from-env": "^2.1.0",
|
|
142
|
+
"@introspection-sdk/types": "0.4.10",
|
|
143
|
+
"@introspection-sdk/introspection-pi": "0.4.10",
|
|
144
|
+
"@introspection-sdk/introspection-proxy": "0.4.10"
|
|
144
145
|
},
|
|
145
146
|
"scripts": {
|
|
146
147
|
"lint": "eslint . --max-warnings 0",
|
package/src/utils.ts
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
import { DiagLogLevel, DiagLogger } from "@opentelemetry/api";
|
|
2
2
|
import { HttpsProxyAgent } from "https-proxy-agent";
|
|
3
|
-
import {
|
|
3
|
+
import { getProxyForUrl } from "proxy-from-env";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Attach a forward-proxy agent to OTLP exporter options when a proxy is
|
|
7
|
-
* configured
|
|
7
|
+
* configured for the exporter's endpoint.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
9
|
+
* The OTLP proto exporters use Node's `http`/`https` stack, so this uses
|
|
10
10
|
* `HttpsProxyAgent` (an `http.Agent`) rather than the undici dispatcher from
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* `@introspection-sdk/introspection-proxy` — a dispatcher only applies to
|
|
12
|
+
* `fetch`. Unlike undici's `EnvHttpProxyAgent`, `HttpsProxyAgent` ignores
|
|
13
|
+
* `NO_PROXY`, so we resolve the proxy per-endpoint with `proxy-from-env`'s
|
|
14
|
+
* {@link getProxyForUrl}, which returns `""` when the host matches `NO_PROXY`.
|
|
15
|
+
* This keeps in-cluster endpoints (e.g. `*.svc.cluster.local`) on a direct
|
|
16
|
+
* connection instead of tunnelling them through the egress proxy, which has no
|
|
17
|
+
* route for them.
|
|
14
18
|
*/
|
|
15
|
-
export function withOtlpHttpsProxy<T extends
|
|
16
|
-
const proxyUrl =
|
|
19
|
+
export function withOtlpHttpsProxy<T extends { url?: string }>(options: T): T {
|
|
20
|
+
const proxyUrl = options.url ? getProxyForUrl(options.url) : "";
|
|
17
21
|
if (!proxyUrl) return options;
|
|
18
22
|
|
|
19
23
|
return {
|