@nextdog/node 1.0.0 → 1.1.1
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/dist/console-patch.d.ts.map +1 -1
- package/dist/console-patch.js +4 -3
- package/dist/console-patch.js.map +1 -1
- package/dist/exporter.d.ts +5 -1
- package/dist/exporter.d.ts.map +1 -1
- package/dist/exporter.js +42 -4
- package/dist/exporter.js.map +1 -1
- package/dist/index.d.ts +8 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/instrument-db.d.ts +17 -0
- package/dist/instrument-db.d.ts.map +1 -0
- package/dist/instrument-db.js +231 -0
- package/dist/instrument-db.js.map +1 -0
- package/dist/instrument-fetch.d.ts +7 -0
- package/dist/instrument-fetch.d.ts.map +1 -0
- package/dist/instrument-fetch.js +107 -0
- package/dist/instrument-fetch.js.map +1 -0
- package/dist/instrumentation.d.ts +21 -0
- package/dist/instrumentation.d.ts.map +1 -0
- package/dist/instrumentation.js +39 -0
- package/dist/instrumentation.js.map +1 -0
- package/dist/request-capture.d.ts +6 -0
- package/dist/request-capture.d.ts.map +1 -1
- package/dist/request-capture.js +172 -9
- package/dist/request-capture.js.map +1 -1
- package/dist/sidecar.d.ts +73 -1
- package/dist/sidecar.d.ts.map +1 -1
- package/dist/sidecar.js +180 -22
- package/dist/sidecar.js.map +1 -1
- package/package.json +6 -4
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single entry point an adapter calls (after `provider.register()`) to turn on
|
|
3
|
+
* all of nextdog's auto-instrumentations:
|
|
4
|
+
* - outbound fetch/HTTP (#4) — zero new deps, always on
|
|
5
|
+
* - database queries (#5) — zero new deps, only patches a driver that is
|
|
6
|
+
* actually installed (pg / mysql2)
|
|
7
|
+
*
|
|
8
|
+
* Everything here uses only `@opentelemetry/api` plus optional, lazily-loaded
|
|
9
|
+
* drivers, so nothing new ships in a consumer's production bundle.
|
|
10
|
+
*/
|
|
11
|
+
import { registerDbInstrumentation } from './instrument-db.js';
|
|
12
|
+
import { instrumentOutboundHttp } from './instrument-fetch.js';
|
|
13
|
+
/**
|
|
14
|
+
* Register outbound-HTTP and DB instrumentation. Safe to call once at startup.
|
|
15
|
+
* Returns a handle whose `restore()` undoes every patch. DB drivers load
|
|
16
|
+
* asynchronously; if a driver isn't installed it is silently skipped.
|
|
17
|
+
*/
|
|
18
|
+
export function registerInstrumentations() {
|
|
19
|
+
const restores = [];
|
|
20
|
+
// Outbound fetch/HTTP — synchronous, always available.
|
|
21
|
+
restores.push(instrumentOutboundHttp());
|
|
22
|
+
// DB drivers — async/optional. Resolve in the background; collect its restore.
|
|
23
|
+
let dbRestore;
|
|
24
|
+
registerDbInstrumentation()
|
|
25
|
+
.then((restore) => {
|
|
26
|
+
dbRestore = restore;
|
|
27
|
+
})
|
|
28
|
+
.catch(() => {
|
|
29
|
+
/* best-effort: a driver that fails to load is simply not instrumented */
|
|
30
|
+
});
|
|
31
|
+
return {
|
|
32
|
+
restore: () => {
|
|
33
|
+
for (const r of restores)
|
|
34
|
+
r();
|
|
35
|
+
dbRestore?.();
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=instrumentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instrumentation.js","sourceRoot":"","sources":["../src/instrumentation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAO/D;;;;GAIG;AACH,MAAM,UAAU,wBAAwB;IACtC,MAAM,QAAQ,GAAsB,EAAE,CAAC;IAEvC,uDAAuD;IACvD,QAAQ,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC,CAAC;IAExC,+EAA+E;IAC/E,IAAI,SAAmC,CAAC;IACxC,yBAAyB,EAAE;SACxB,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;QAChB,SAAS,GAAG,OAAO,CAAC;IACtB,CAAC,CAAC;SACD,KAAK,CAAC,GAAG,EAAE;QACV,yEAAyE;IAC3E,CAAC,CAAC,CAAC;IAEL,OAAO;QACL,OAAO,EAAE,GAAG,EAAE;YACZ,KAAK,MAAM,CAAC,IAAI,QAAQ;gBAAE,CAAC,EAAE,CAAC;YAC9B,SAAS,EAAE,EAAE,CAAC;QAChB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -4,6 +4,12 @@ export interface RequestMetadata {
|
|
|
4
4
|
headers: Record<string, string>;
|
|
5
5
|
cookies: string;
|
|
6
6
|
body?: string;
|
|
7
|
+
/** Response status code of the ORIGINAL request (what actually happened) */
|
|
8
|
+
responseStatus?: number;
|
|
9
|
+
/** Response headers of the original request */
|
|
10
|
+
responseHeaders?: Record<string, string>;
|
|
11
|
+
/** Captured response body (text/JSON only; binary is summarized; capped) */
|
|
12
|
+
responseBody?: string;
|
|
7
13
|
capturedAt: number;
|
|
8
14
|
}
|
|
9
15
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-capture.d.ts","sourceRoot":"","sources":["../src/request-capture.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;
|
|
1
|
+
{"version":3,"file":"request-capture.d.ts","sourceRoot":"","sources":["../src/request-capture.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+CAA+C;IAC/C,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,4EAA4E;IAC5E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB;AA2OD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAM3F;AAcD,wBAAgB,mBAAmB,SA8ClC"}
|
package/dist/request-capture.js
CHANGED
|
@@ -7,12 +7,46 @@
|
|
|
7
7
|
* in the exporter (since the OTel active span is not available at request time).
|
|
8
8
|
*/
|
|
9
9
|
import * as http from 'node:http';
|
|
10
|
-
import {
|
|
11
|
-
// Store captured request metadata keyed by "METHOD url" for recent lookups
|
|
12
|
-
// Multiple requests to the same URL are
|
|
10
|
+
import { createRequestContext, requestContextStorage } from './request-context.js';
|
|
11
|
+
// Store captured request metadata keyed by "METHOD url" for recent lookups.
|
|
12
|
+
// Multiple requests to the same URL are queued oldest-first (FIFO): captures are
|
|
13
|
+
// push()ed on, and getRequestMetadata shift()s the oldest matching entry off.
|
|
13
14
|
const requestStore = new Map();
|
|
14
|
-
// Max body size to capture (16KB — enough for API payloads, avoids memory issues)
|
|
15
|
+
// Max request body size to capture (16KB — enough for API payloads, avoids memory issues)
|
|
15
16
|
const MAX_BODY_SIZE = 16 * 1024;
|
|
17
|
+
// Max response body size to capture (50KB — matches the replay endpoint's cap;
|
|
18
|
+
// responses are typically larger than requests). Capped so a streaming or large
|
|
19
|
+
// response never buffers unbounded memory in the user's dev server.
|
|
20
|
+
const MAX_RESPONSE_BODY_SIZE = 50 * 1024;
|
|
21
|
+
// Content-type prefixes/fragments we consider safe to capture as text.
|
|
22
|
+
// Anything else (images, fonts, octet-stream, video, etc.) is summarized, not buffered.
|
|
23
|
+
const TEXT_CONTENT_TYPES = [
|
|
24
|
+
'application/json',
|
|
25
|
+
'application/ld+json',
|
|
26
|
+
'application/xml',
|
|
27
|
+
'application/xhtml+xml',
|
|
28
|
+
'application/javascript',
|
|
29
|
+
'application/graphql',
|
|
30
|
+
'text/',
|
|
31
|
+
'+json',
|
|
32
|
+
'+xml',
|
|
33
|
+
];
|
|
34
|
+
function isTextContentType(contentType) {
|
|
35
|
+
const ct = contentType.toLowerCase();
|
|
36
|
+
return TEXT_CONTENT_TYPES.some((t) => ct.includes(t));
|
|
37
|
+
}
|
|
38
|
+
// Content-Encoding values that mean the body is compressed (not raw text/UTF-8).
|
|
39
|
+
// We do NOT decompress — capturing the raw bytes as text would store mojibake —
|
|
40
|
+
// so a compressed body is summarized like the binary case.
|
|
41
|
+
const COMPRESSED_ENCODINGS = ['gzip', 'br', 'deflate', 'compress', 'zstd'];
|
|
42
|
+
function compressionOf(contentEncoding) {
|
|
43
|
+
const ce = contentEncoding.toLowerCase().trim();
|
|
44
|
+
if (!ce || ce === 'identity')
|
|
45
|
+
return null;
|
|
46
|
+
// content-encoding can be a comma-separated list (e.g. "gzip, br").
|
|
47
|
+
const found = COMPRESSED_ENCODINGS.find((enc) => ce.split(',').some((part) => part.trim() === enc));
|
|
48
|
+
return found ?? ce; // unknown non-identity encoding: still treat as compressed
|
|
49
|
+
}
|
|
16
50
|
// Cleanup entries older than 60s to prevent memory leaks
|
|
17
51
|
const CLEANUP_INTERVAL = 30_000;
|
|
18
52
|
const MAX_AGE = 60_000;
|
|
@@ -41,31 +75,154 @@ function captureBody(req, metadata) {
|
|
|
41
75
|
// Intercept listener registration to piggyback on whoever reads the body
|
|
42
76
|
req.on = function (event, listener) {
|
|
43
77
|
if (event === 'data') {
|
|
44
|
-
const self = this;
|
|
45
78
|
const wrappedListener = (chunk) => {
|
|
46
79
|
if (size < MAX_BODY_SIZE) {
|
|
47
80
|
chunks.push(chunk);
|
|
48
81
|
size += chunk.length;
|
|
49
82
|
}
|
|
50
|
-
return listener.call(
|
|
83
|
+
return listener.call(this, chunk);
|
|
51
84
|
};
|
|
52
85
|
return originalOn.call(this, event, wrappedListener);
|
|
53
86
|
}
|
|
54
87
|
if (event === 'end') {
|
|
55
|
-
const self = this;
|
|
56
88
|
const wrappedListener = (...args) => {
|
|
57
89
|
if (chunks.length > 0) {
|
|
58
90
|
const body = Buffer.concat(chunks).toString('utf-8');
|
|
59
91
|
metadata.body = body.length > MAX_BODY_SIZE ? body.slice(0, MAX_BODY_SIZE) : body;
|
|
60
92
|
chunks.length = 0;
|
|
61
93
|
}
|
|
62
|
-
return listener.call(
|
|
94
|
+
return listener.call(this, ...args);
|
|
63
95
|
};
|
|
64
96
|
return originalOn.call(this, event, wrappedListener);
|
|
65
97
|
}
|
|
66
98
|
return originalOn.call(this, event, listener);
|
|
67
99
|
};
|
|
68
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Passively tee the response so we record what the ORIGINAL request actually
|
|
103
|
+
* returned (status, headers, body) WITHOUT re-issuing it via Replay.
|
|
104
|
+
*
|
|
105
|
+
* This wraps res.write/res.end on the single ServerResponse instance: each chunk
|
|
106
|
+
* is observed (copied into a capped buffer) and then forwarded UNCHANGED to the
|
|
107
|
+
* original method. We never consume the stream the client needs, never alter the
|
|
108
|
+
* bytes/headers/timing the client sees, and stop buffering once the cap is hit so
|
|
109
|
+
* a large or streaming response can't exhaust memory.
|
|
110
|
+
*/
|
|
111
|
+
function captureResponse(res, metadata) {
|
|
112
|
+
const chunks = [];
|
|
113
|
+
let size = 0;
|
|
114
|
+
let overflowed = false;
|
|
115
|
+
let captured = false;
|
|
116
|
+
// Headers passed inline to writeHead(status, headers) bypass setHeader() and
|
|
117
|
+
// therefore never appear in res.getHeaders(). Capture them here so we record
|
|
118
|
+
// exactly what the client received.
|
|
119
|
+
const writeHeadHeaders = {};
|
|
120
|
+
const observe = (chunk) => {
|
|
121
|
+
if (overflowed || chunk == null)
|
|
122
|
+
return;
|
|
123
|
+
const buf = Buffer.isBuffer(chunk)
|
|
124
|
+
? chunk
|
|
125
|
+
: typeof chunk === 'string'
|
|
126
|
+
? Buffer.from(chunk)
|
|
127
|
+
: null;
|
|
128
|
+
if (!buf)
|
|
129
|
+
return;
|
|
130
|
+
if (size + buf.length > MAX_RESPONSE_BODY_SIZE) {
|
|
131
|
+
// Take what fits, then stop buffering.
|
|
132
|
+
const remaining = MAX_RESPONSE_BODY_SIZE - size;
|
|
133
|
+
if (remaining > 0) {
|
|
134
|
+
chunks.push(buf.subarray(0, remaining));
|
|
135
|
+
size += remaining;
|
|
136
|
+
}
|
|
137
|
+
overflowed = true;
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
chunks.push(buf);
|
|
141
|
+
size += buf.length;
|
|
142
|
+
};
|
|
143
|
+
const finalize = () => {
|
|
144
|
+
if (captured)
|
|
145
|
+
return;
|
|
146
|
+
captured = true;
|
|
147
|
+
metadata.responseStatus = res.statusCode;
|
|
148
|
+
const headers = {};
|
|
149
|
+
const raw = res.getHeaders();
|
|
150
|
+
for (const [key, value] of Object.entries(raw)) {
|
|
151
|
+
if (value == null)
|
|
152
|
+
continue;
|
|
153
|
+
headers[key.toLowerCase()] = Array.isArray(value) ? value.join(', ') : String(value);
|
|
154
|
+
}
|
|
155
|
+
// Merge in any headers passed inline to writeHead (setHeader-bypassing).
|
|
156
|
+
Object.assign(headers, writeHeadHeaders);
|
|
157
|
+
metadata.responseHeaders = headers;
|
|
158
|
+
const contentType = headers['content-type'] ?? '';
|
|
159
|
+
const compression = compressionOf(headers['content-encoding'] ?? '');
|
|
160
|
+
if (size === 0) {
|
|
161
|
+
// No body — leave responseBody undefined.
|
|
162
|
+
}
|
|
163
|
+
else if (compression) {
|
|
164
|
+
// Compressed body: the buffered bytes are not UTF-8 text. Decoding them
|
|
165
|
+
// would yield mojibake, so summarize instead of capturing garbage.
|
|
166
|
+
metadata.responseBody = `[compressed ${compression} response, ${size} bytes — not captured]`;
|
|
167
|
+
}
|
|
168
|
+
else if (contentType && !isTextContentType(contentType)) {
|
|
169
|
+
metadata.responseBody = `[binary ${contentType} response, ${size} bytes — not captured]`;
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
const body = Buffer.concat(chunks).toString('utf-8');
|
|
173
|
+
metadata.responseBody = overflowed ? `${body}\n... (truncated)` : body;
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
const originalWriteHead = res.writeHead.bind(res);
|
|
177
|
+
const originalWrite = res.write.bind(res);
|
|
178
|
+
const originalEnd = res.end.bind(res);
|
|
179
|
+
// res.writeHead(statusCode[, statusMessage][, headers])
|
|
180
|
+
res.writeHead = function (...args) {
|
|
181
|
+
const last = args[args.length - 1];
|
|
182
|
+
if (last && typeof last === 'object') {
|
|
183
|
+
if (Array.isArray(last)) {
|
|
184
|
+
// Flat [k1, v1, k2, v2, ...] or array of [k, v] pairs.
|
|
185
|
+
if (Array.isArray(last[0])) {
|
|
186
|
+
for (const pair of last) {
|
|
187
|
+
if (pair && pair.length === 2)
|
|
188
|
+
writeHeadHeaders[String(pair[0]).toLowerCase()] = String(pair[1]);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
for (let i = 0; i + 1 < last.length; i += 2) {
|
|
193
|
+
writeHeadHeaders[String(last[i]).toLowerCase()] = String(last[i + 1]);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
for (const [k, v] of Object.entries(last)) {
|
|
199
|
+
if (v != null)
|
|
200
|
+
writeHeadHeaders[k.toLowerCase()] = Array.isArray(v) ? v.join(', ') : String(v);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return originalWriteHead(...args);
|
|
205
|
+
};
|
|
206
|
+
// res.write(chunk[, encoding][, cb])
|
|
207
|
+
res.write = function (chunk, ...rest) {
|
|
208
|
+
observe(chunk);
|
|
209
|
+
return originalWrite(chunk, ...rest);
|
|
210
|
+
};
|
|
211
|
+
// res.end([chunk][, encoding][, cb])
|
|
212
|
+
res.end = function (...args) {
|
|
213
|
+
// The first arg is the final chunk only if it's not a callback/encoding.
|
|
214
|
+
const maybeChunk = args[0];
|
|
215
|
+
if (maybeChunk != null && (Buffer.isBuffer(maybeChunk) || typeof maybeChunk === 'string')) {
|
|
216
|
+
observe(maybeChunk);
|
|
217
|
+
}
|
|
218
|
+
const result = originalEnd(...args);
|
|
219
|
+
finalize();
|
|
220
|
+
return result;
|
|
221
|
+
};
|
|
222
|
+
// Belt-and-suspenders: also capture if the response finishes/closes without
|
|
223
|
+
// a final end() chunk path we observed (e.g. pipe()d streams).
|
|
224
|
+
res.on('finish', finalize);
|
|
225
|
+
}
|
|
69
226
|
/**
|
|
70
227
|
* Look up request metadata by method + URL path.
|
|
71
228
|
* Finds the most recent capture matching these fields.
|
|
@@ -97,16 +254,22 @@ export function startRequestCapture() {
|
|
|
97
254
|
http.Server.prototype.emit = function (event, ...args) {
|
|
98
255
|
if (event === 'request') {
|
|
99
256
|
const req = args[0];
|
|
257
|
+
const res = args[1];
|
|
100
258
|
const headers = captureHeaders(req);
|
|
101
259
|
const metadata = {
|
|
102
260
|
method: req.method ?? 'GET',
|
|
103
261
|
url: req.url ?? '/',
|
|
104
262
|
headers,
|
|
105
|
-
cookies: headers
|
|
263
|
+
cookies: headers.cookie ?? '',
|
|
106
264
|
capturedAt: Date.now(),
|
|
107
265
|
};
|
|
108
266
|
// Capture body asynchronously (mutates metadata.body when ready)
|
|
109
267
|
captureBody(req, metadata);
|
|
268
|
+
// Tee the response so we record what the original request actually
|
|
269
|
+
// returned (status/headers/body), no Replay/re-issue required.
|
|
270
|
+
if (res) {
|
|
271
|
+
captureResponse(res, metadata);
|
|
272
|
+
}
|
|
110
273
|
// Store keyed by method + url
|
|
111
274
|
const key = `${metadata.method} ${metadata.url}`;
|
|
112
275
|
const stack = requestStore.get(key);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-capture.js","sourceRoot":"","sources":["../src/request-capture.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"request-capture.js","sourceRoot":"","sources":["../src/request-capture.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAiBnF,4EAA4E;AAC5E,iFAAiF;AACjF,8EAA8E;AAC9E,MAAM,YAAY,GAAG,IAAI,GAAG,EAA6B,CAAC;AAE1D,0FAA0F;AAC1F,MAAM,aAAa,GAAG,EAAE,GAAG,IAAI,CAAC;AAEhC,+EAA+E;AAC/E,gFAAgF;AAChF,oEAAoE;AACpE,MAAM,sBAAsB,GAAG,EAAE,GAAG,IAAI,CAAC;AAEzC,uEAAuE;AACvE,wFAAwF;AACxF,MAAM,kBAAkB,GAAG;IACzB,kBAAkB;IAClB,qBAAqB;IACrB,iBAAiB;IACjB,uBAAuB;IACvB,wBAAwB;IACxB,qBAAqB;IACrB,OAAO;IACP,OAAO;IACP,MAAM;CACP,CAAC;AAEF,SAAS,iBAAiB,CAAC,WAAmB;IAC5C,MAAM,EAAE,GAAG,WAAW,CAAC,WAAW,EAAE,CAAC;IACrC,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AACxD,CAAC;AAED,iFAAiF;AACjF,gFAAgF;AAChF,2DAA2D;AAC3D,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;AAE3E,SAAS,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,OAAO,qBAAqB,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAC7F,CAAC;QAED,OAAO,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;IACpD,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/sidecar.d.ts
CHANGED
|
@@ -1,2 +1,74 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Classification of whatever is (or isn't) listening at `${url}/health`:
|
|
3
|
+
*
|
|
4
|
+
* - `nextdog`: a 2xx whose JSON body carries the NextDog `service` signature —
|
|
5
|
+
* a genuine sidecar, safe to adopt.
|
|
6
|
+
* - `foreign`: a 2xx that does NOT carry the signature (non-JSON, or JSON
|
|
7
|
+
* without the marker) — some unrelated process holds the port.
|
|
8
|
+
* - `absent`: nothing usable answered (connection refused, timeout, non-2xx).
|
|
9
|
+
*/
|
|
10
|
+
type ProbeResult = 'nextdog' | 'foreign' | 'absent';
|
|
11
|
+
/**
|
|
12
|
+
* Single source of truth for reading and classifying `${url}/health`. Both
|
|
13
|
+
* {@link isHealthy} and {@link isForeignOccupant} are thin views over this so
|
|
14
|
+
* the fetch/timeout/JSON/marker logic lives in exactly one place.
|
|
15
|
+
*
|
|
16
|
+
* @internal exported for testing.
|
|
17
|
+
*/
|
|
18
|
+
export declare function probeHealth(url: string): Promise<ProbeResult>;
|
|
19
|
+
/**
|
|
20
|
+
* Whether `${url}/health` is answered by a genuine NextDog sidecar. A 2xx alone
|
|
21
|
+
* is NOT enough: the body must be JSON carrying the `service: "nextdog"`
|
|
22
|
+
* signature, so we never silently ship telemetry to a foreign process (#17).
|
|
23
|
+
*
|
|
24
|
+
* @internal exported for testing.
|
|
25
|
+
*/
|
|
26
|
+
export declare function isHealthy(url: string): Promise<boolean>;
|
|
27
|
+
/**
|
|
28
|
+
* A `file://` URL points at a real on-disk location only if none of its path
|
|
29
|
+
* segments is a bundler-virtual placeholder. Turbopack rewrites a bundled
|
|
30
|
+
* module's `import.meta.url` to a virtual URL carrying a literal `[project]`
|
|
31
|
+
* segment (and similar `[...]` markers), so `createRequire()` on that URL
|
|
32
|
+
* resolves dependencies to non-existent `[project]/node_modules/...` paths.
|
|
33
|
+
* See issue #15.
|
|
34
|
+
*
|
|
35
|
+
* @internal exported for testing.
|
|
36
|
+
*/
|
|
37
|
+
export declare function isRealFileUrl(url: string): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Resolve the absolute path to the `@nextdog/core` CLI (`dist/cli.js`) in a way
|
|
40
|
+
* that works regardless of the bundler the host dev server uses.
|
|
41
|
+
*
|
|
42
|
+
* Resolution order, returning the first candidate that exists on disk:
|
|
43
|
+
* 1. `createRequire(anchorUrl)` — the module's own `import.meta.url`, but only
|
|
44
|
+
* when it is a real on-disk URL (skipped under Turbopack's virtual URL).
|
|
45
|
+
* 2. `createRequire(<projectRoot>/package.json)` — resolves through the real
|
|
46
|
+
* `node_modules` graph of the user's project, independent of any bundler.
|
|
47
|
+
* 3. A direct walk up the `node_modules` chain from the project root.
|
|
48
|
+
*
|
|
49
|
+
* Each candidate is validated against the filesystem before being returned, so
|
|
50
|
+
* a bundler that hands us a plausible-but-wrong path never makes it through.
|
|
51
|
+
*
|
|
52
|
+
* @internal exported for testing.
|
|
53
|
+
*/
|
|
54
|
+
export declare function resolveCoreCliPath(opts?: {
|
|
55
|
+
anchorUrl?: string;
|
|
56
|
+
projectRoot?: string;
|
|
57
|
+
}): string;
|
|
58
|
+
/**
|
|
59
|
+
* Outcome of {@link ensureSidecar}.
|
|
60
|
+
*
|
|
61
|
+
* - `ready`: a verified NextDog sidecar is reachable; telemetry is safe to send.
|
|
62
|
+
* - `foreignOccupant`: the configured port is held by a non-NextDog process, so
|
|
63
|
+
* we refused to adopt it. Callers should NOT register telemetry — it would be
|
|
64
|
+
* shipped to an unknown local process.
|
|
65
|
+
*/
|
|
66
|
+
export interface SidecarStatus {
|
|
67
|
+
ready: boolean;
|
|
68
|
+
foreignOccupant: boolean;
|
|
69
|
+
}
|
|
70
|
+
/** Exposed for tests so each case starts from a clean warning state. */
|
|
71
|
+
export declare function _resetForeignOccupantWarnings(): void;
|
|
72
|
+
export declare function ensureSidecar(url: string): Promise<SidecarStatus>;
|
|
73
|
+
export {};
|
|
2
74
|
//# sourceMappingURL=sidecar.d.ts.map
|
package/dist/sidecar.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidecar.d.ts","sourceRoot":"","sources":["../src/sidecar.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sidecar.d.ts","sourceRoot":"","sources":["../src/sidecar.ts"],"names":[],"mappings":"AAeA;;;;;;;;GAQG;AACH,KAAK,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEpD;;;;;;GAMG;AACH,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAyBnE;AAED;;;;;;GAMG;AACH,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAE7D;AA8BD;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAUlD;AAMD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,GAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO,GACtD,MAAM,CAuDR;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,OAAO,CAAC;IACf,eAAe,EAAE,OAAO,CAAC;CAC1B;AAkDD,wEAAwE;AACxE,wBAAgB,6BAA6B,IAAI,IAAI,CAEpD;AAED,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAwCvE"}
|