@introspection-sdk/introspection-node 0.4.9 → 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.
@@ -1,4 +1,4 @@
1
1
 
2
- > @introspection-sdk/introspection-node@0.4.9 build /home/runner/work/introspection-js-sdk/introspection-js-sdk/packages/introspection-node
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 in the environment.
4
+ * configured for the exporter's endpoint.
5
5
  *
6
- * Note: the OTLP proto exporters use Node's `http`/`https` stack, so this uses
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
- * `./proxy.js` — a dispatcher only applies to `fetch`. The proxy *URL* is
9
- * resolved by the shared {@link resolveForwardProxyUrl} so fetch and OTLP
10
- * traffic agree on which proxy to use.
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 object>(options: T): T;
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.
@@ -1 +1 @@
1
- {"version":3,"file":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AAI,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 { resolveForwardProxyUrl } from "@introspection-sdk/introspection-proxy";
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 in the environment.
6
+ * configured for the exporter's endpoint.
7
7
  *
8
- * Note: the OTLP proto exporters use Node's `http`/`https` stack, so this uses
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
- * `./proxy.js` — a dispatcher only applies to `fetch`. The proxy *URL* is
11
- * resolved by the shared {@link resolveForwardProxyUrl} so fetch and OTLP
12
- * traffic agree on which proxy to use.
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 = resolveForwardProxyUrl();
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
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AK,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.9",
3
+ "version": "0.4.10",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Introspection observability SDK for Node.js",
6
6
  "engines": {
@@ -56,8 +56,8 @@
56
56
  "ai": "^6.0.197",
57
57
  "openai": "^6.42.0",
58
58
  "typescript": "5.9.3",
59
- "@repo/eslint-config": "0.0.0",
60
- "@repo/typescript-config": "0.0.0"
59
+ "@repo/typescript-config": "0.0.0",
60
+ "@repo/eslint-config": "0.0.0"
61
61
  },
62
62
  "peerDependencies": {
63
63
  "@openai/agents": ">=0.0.1",
@@ -138,9 +138,10 @@
138
138
  "dependencies": {
139
139
  "@opentelemetry/api": "^1.9.1",
140
140
  "https-proxy-agent": "^7.0.6",
141
- "@introspection-sdk/types": "0.4.9",
142
- "@introspection-sdk/introspection-pi": "0.4.9",
143
- "@introspection-sdk/introspection-proxy": "0.4.9"
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",
@@ -0,0 +1,7 @@
1
+ declare module "proxy-from-env" {
2
+ /**
3
+ * Returns the forward-proxy URL that should handle a request to `url`, or an
4
+ * empty string when no proxy is configured or the host matches `NO_PROXY`.
5
+ */
6
+ export function getProxyForUrl(url: string): string;
7
+ }
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 { resolveForwardProxyUrl } from "@introspection-sdk/introspection-proxy";
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 in the environment.
7
+ * configured for the exporter's endpoint.
8
8
  *
9
- * Note: the OTLP proto exporters use Node's `http`/`https` stack, so this uses
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
- * `./proxy.js` — a dispatcher only applies to `fetch`. The proxy *URL* is
12
- * resolved by the shared {@link resolveForwardProxyUrl} so fetch and OTLP
13
- * traffic agree on which proxy to use.
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 object>(options: T): T {
16
- const proxyUrl = resolveForwardProxyUrl();
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 {