@workflow/utils 4.0.1-beta.5 → 4.0.1-beta.7
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/get-port.d.ts +18 -0
- package/dist/get-port.d.ts.map +1 -1
- package/dist/get-port.js +168 -78
- package/dist/get-port.js.map +1 -1
- package/package.json +1 -1
package/dist/get-port.d.ts
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gets all listening ports for the current process.
|
|
3
|
+
* @returns Array of port numbers the process is listening on, in deterministic order.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getAllPorts(): Promise<number[]>;
|
|
1
6
|
/**
|
|
2
7
|
* Gets the port number that the process is listening on.
|
|
3
8
|
* @returns The port number that the process is listening on, or undefined if the process is not listening on any port.
|
|
4
9
|
*/
|
|
5
10
|
export declare function getPort(): Promise<number | undefined>;
|
|
11
|
+
export interface ProbeOptions {
|
|
12
|
+
endpoint?: string;
|
|
13
|
+
timeout?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Gets the workflow server port by probing all listening ports.
|
|
17
|
+
* This is more reliable than getPort() when other services (like Node.js inspector)
|
|
18
|
+
* may also be listening on ports.
|
|
19
|
+
*
|
|
20
|
+
* @param options - Optional configuration for probing
|
|
21
|
+
* @returns The port number of the workflow server, or undefined if not found
|
|
22
|
+
*/
|
|
23
|
+
export declare function getWorkflowPort(options?: ProbeOptions): Promise<number | undefined>;
|
|
6
24
|
//# sourceMappingURL=get-port.d.ts.map
|
package/dist/get-port.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-port.d.ts","sourceRoot":"","sources":["../src/get-port.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get-port.d.ts","sourceRoot":"","sources":["../src/get-port.ts"],"names":[],"mappings":"AA0MA;;;GAGG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAoBrD;AAED;;;GAGG;AACH,wBAAsB,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAG3D;AAMD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAiCD;;;;;;;GAOG;AACH,wBAAsB,eAAe,CACnC,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAqC7B"}
|
package/dist/get-port.js
CHANGED
|
@@ -18,14 +18,14 @@ function parsePort(value, radix = 10) {
|
|
|
18
18
|
const join = (arr, sep) => arr.join(sep);
|
|
19
19
|
const PROC_ROOT = join(['', 'proc'], '/');
|
|
20
20
|
/**
|
|
21
|
-
* Gets listening ports for the current process on Linux by reading /proc filesystem.
|
|
22
|
-
*
|
|
21
|
+
* Gets ALL listening ports for the current process on Linux by reading /proc filesystem.
|
|
22
|
+
* Returns ports in order of file descriptor (deterministic ordering).
|
|
23
23
|
*/
|
|
24
|
-
async function
|
|
24
|
+
async function getLinuxPorts(pid) {
|
|
25
25
|
const listenState = '0A'; // TCP LISTEN state in /proc/net/tcp
|
|
26
26
|
const tcpFiles = [`${PROC_ROOT}/net/tcp`, `${PROC_ROOT}/net/tcp6`];
|
|
27
27
|
// Step 1: Get socket inodes from /proc/<pid>/fd/ in order
|
|
28
|
-
// We preserve order to maintain deterministic behavior
|
|
28
|
+
// We preserve order to maintain deterministic behavior
|
|
29
29
|
// Use both array (for order) and Set (for O(1) lookup)
|
|
30
30
|
const socketInodes = [];
|
|
31
31
|
const socketInodesSet = new Set();
|
|
@@ -53,21 +53,19 @@ async function getLinuxPort(pid) {
|
|
|
53
53
|
}
|
|
54
54
|
catch {
|
|
55
55
|
// Process might not exist or no permission
|
|
56
|
-
return
|
|
56
|
+
return [];
|
|
57
57
|
}
|
|
58
58
|
if (socketInodes.length === 0) {
|
|
59
|
-
return
|
|
59
|
+
return [];
|
|
60
60
|
}
|
|
61
61
|
// Step 2: Read /proc/net/tcp and /proc/net/tcp6 to find listening sockets
|
|
62
62
|
// Format: sl local_address rem_address st ... inode
|
|
63
63
|
// local_address is hex IP:port, st=0A means LISTEN
|
|
64
|
-
|
|
64
|
+
const inodeToPort = new Map();
|
|
65
65
|
for (const tcpFile of tcpFiles) {
|
|
66
66
|
try {
|
|
67
67
|
const content = await readFile(tcpFile, 'utf8');
|
|
68
68
|
const lines = content.split('\n').slice(1); // Skip header
|
|
69
|
-
// Build a map of inode -> port for quick lookup
|
|
70
|
-
const inodeToPort = new Map();
|
|
71
69
|
for (const line of lines) {
|
|
72
70
|
if (!line.trim())
|
|
73
71
|
continue; // Skip empty lines
|
|
@@ -93,98 +91,190 @@ async function getLinuxPort(pid) {
|
|
|
93
91
|
inodeToPort.set(inode, port);
|
|
94
92
|
}
|
|
95
93
|
}
|
|
96
|
-
// Return the first port matching our socket inodes in order
|
|
97
|
-
for (const inode of socketInodes) {
|
|
98
|
-
const port = inodeToPort.get(inode);
|
|
99
|
-
if (port !== undefined) {
|
|
100
|
-
return port;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
94
|
}
|
|
104
95
|
catch {
|
|
105
96
|
// File might not exist (e.g., no IPv6 support) - continue to next file
|
|
106
97
|
continue;
|
|
107
98
|
}
|
|
108
99
|
}
|
|
109
|
-
|
|
100
|
+
// Return all ports in socket inode order (deterministic)
|
|
101
|
+
const ports = [];
|
|
102
|
+
for (const inode of socketInodes) {
|
|
103
|
+
const port = inodeToPort.get(inode);
|
|
104
|
+
if (port !== undefined) {
|
|
105
|
+
ports.push(port);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return ports;
|
|
110
109
|
}
|
|
111
110
|
/**
|
|
112
|
-
* Gets
|
|
113
|
-
*
|
|
111
|
+
* Gets ALL listening ports for the current process on macOS using lsof.
|
|
112
|
+
* Returns ports in the order they appear in lsof output.
|
|
114
113
|
*/
|
|
115
|
-
|
|
116
|
-
const { pid, platform } = process;
|
|
117
|
-
let port;
|
|
114
|
+
async function getDarwinPorts(pid) {
|
|
118
115
|
try {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
const addr = parts[8];
|
|
141
|
-
if (addr) {
|
|
142
|
-
const colonIndex = addr.lastIndexOf(':');
|
|
143
|
-
if (colonIndex !== -1) {
|
|
144
|
-
port = parsePort(addr.slice(colonIndex + 1));
|
|
145
|
-
if (port !== undefined) {
|
|
146
|
-
break;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
116
|
+
const { stdout } = await execFileAsync('lsof', [
|
|
117
|
+
'-a',
|
|
118
|
+
'-i',
|
|
119
|
+
'-P',
|
|
120
|
+
'-n',
|
|
121
|
+
'-p',
|
|
122
|
+
pid.toString(),
|
|
123
|
+
]);
|
|
124
|
+
const ports = [];
|
|
125
|
+
const lines = stdout.split('\n');
|
|
126
|
+
for (const line of lines) {
|
|
127
|
+
if (line.includes('LISTEN')) {
|
|
128
|
+
// Column 9 (0-indexed: 8) contains the address like "*:3000" or "127.0.0.1:3000"
|
|
129
|
+
const parts = line.trim().split(/\s+/);
|
|
130
|
+
const addr = parts[8];
|
|
131
|
+
if (addr) {
|
|
132
|
+
const colonIndex = addr.lastIndexOf(':');
|
|
133
|
+
if (colonIndex !== -1) {
|
|
134
|
+
const port = parsePort(addr.slice(colonIndex + 1));
|
|
135
|
+
if (port !== undefined) {
|
|
136
|
+
ports.push(port);
|
|
149
137
|
}
|
|
150
138
|
}
|
|
151
139
|
}
|
|
152
|
-
break;
|
|
153
140
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
141
|
+
}
|
|
142
|
+
return ports;
|
|
143
|
+
}
|
|
144
|
+
catch {
|
|
145
|
+
return [];
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Gets ALL listening ports for the current process on Windows using netstat.
|
|
150
|
+
* Returns ports in the order they appear in netstat output.
|
|
151
|
+
*/
|
|
152
|
+
async function getWindowsPorts(pid) {
|
|
153
|
+
try {
|
|
154
|
+
const { stdout } = await execFileAsync('cmd', [
|
|
155
|
+
'/c',
|
|
156
|
+
`netstat -ano | findstr ${pid} | findstr LISTENING`,
|
|
157
|
+
]);
|
|
158
|
+
const ports = [];
|
|
159
|
+
const trimmedOutput = stdout.trim();
|
|
160
|
+
if (trimmedOutput) {
|
|
161
|
+
const lines = trimmedOutput.split('\n');
|
|
162
|
+
for (const line of lines) {
|
|
163
|
+
// Extract port from the local address column
|
|
164
|
+
// Matches both IPv4 (e.g., "127.0.0.1:3000") and IPv6 bracket notation (e.g., "[::1]:3000")
|
|
165
|
+
const match = line
|
|
166
|
+
.trim()
|
|
167
|
+
.match(/^\s*TCP\s+(?:\[[\da-f:]+\]|[\d.]+):(\d+)\s+/i);
|
|
168
|
+
if (match) {
|
|
169
|
+
const port = parsePort(match[1]);
|
|
170
|
+
if (port !== undefined) {
|
|
171
|
+
ports.push(port);
|
|
175
172
|
}
|
|
176
173
|
}
|
|
177
|
-
break;
|
|
178
174
|
}
|
|
179
175
|
}
|
|
176
|
+
return ports;
|
|
177
|
+
}
|
|
178
|
+
catch {
|
|
179
|
+
return [];
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Gets all listening ports for the current process.
|
|
184
|
+
* @returns Array of port numbers the process is listening on, in deterministic order.
|
|
185
|
+
*/
|
|
186
|
+
export async function getAllPorts() {
|
|
187
|
+
const { pid, platform } = process;
|
|
188
|
+
try {
|
|
189
|
+
switch (platform) {
|
|
190
|
+
case 'linux':
|
|
191
|
+
return await getLinuxPorts(pid);
|
|
192
|
+
case 'darwin':
|
|
193
|
+
return await getDarwinPorts(pid);
|
|
194
|
+
case 'win32':
|
|
195
|
+
return await getWindowsPorts(pid);
|
|
196
|
+
default:
|
|
197
|
+
return [];
|
|
198
|
+
}
|
|
180
199
|
}
|
|
181
200
|
catch (error) {
|
|
182
|
-
// In dev, it's helpful to know why detection failed
|
|
183
201
|
if (process.env.NODE_ENV === 'development') {
|
|
184
|
-
console.debug('[
|
|
202
|
+
console.debug('[getAllPorts] Detection failed:', error);
|
|
185
203
|
}
|
|
204
|
+
return [];
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Gets the port number that the process is listening on.
|
|
209
|
+
* @returns The port number that the process is listening on, or undefined if the process is not listening on any port.
|
|
210
|
+
*/
|
|
211
|
+
export async function getPort() {
|
|
212
|
+
const ports = await getAllPorts();
|
|
213
|
+
return ports[0];
|
|
214
|
+
}
|
|
215
|
+
// Configuration for HTTP probing
|
|
216
|
+
const PROBE_TIMEOUT_MS = 500;
|
|
217
|
+
const PROBE_ENDPOINT = '/.well-known/workflow/v1/flow?__health';
|
|
218
|
+
/**
|
|
219
|
+
* Probes a port to check if it's serving the workflow HTTP server.
|
|
220
|
+
* Uses HEAD request to minimize overhead.
|
|
221
|
+
*
|
|
222
|
+
* @returns true if the port responds with a 200 status from the health check endpoint
|
|
223
|
+
*/
|
|
224
|
+
async function probePort(port, options = {}) {
|
|
225
|
+
const { endpoint = PROBE_ENDPOINT, timeout = PROBE_TIMEOUT_MS } = options;
|
|
226
|
+
const controller = new AbortController();
|
|
227
|
+
const timeoutId = setTimeout(() => controller.abort(), timeout);
|
|
228
|
+
try {
|
|
229
|
+
const response = await fetch(`http://localhost:${port}${endpoint}`, {
|
|
230
|
+
method: 'HEAD',
|
|
231
|
+
signal: controller.signal,
|
|
232
|
+
});
|
|
233
|
+
// The workflow health endpoint returns 200 for healthy
|
|
234
|
+
return response.status === 200;
|
|
235
|
+
}
|
|
236
|
+
catch {
|
|
237
|
+
// Connection refused, timeout, or other error
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
finally {
|
|
241
|
+
clearTimeout(timeoutId);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Gets the workflow server port by probing all listening ports.
|
|
246
|
+
* This is more reliable than getPort() when other services (like Node.js inspector)
|
|
247
|
+
* may also be listening on ports.
|
|
248
|
+
*
|
|
249
|
+
* @param options - Optional configuration for probing
|
|
250
|
+
* @returns The port number of the workflow server, or undefined if not found
|
|
251
|
+
*/
|
|
252
|
+
export async function getWorkflowPort(options) {
|
|
253
|
+
const ports = await getAllPorts();
|
|
254
|
+
if (ports.length === 0) {
|
|
186
255
|
return undefined;
|
|
187
256
|
}
|
|
188
|
-
|
|
257
|
+
if (ports.length === 1) {
|
|
258
|
+
// Only one port, no need to probe
|
|
259
|
+
return ports[0];
|
|
260
|
+
}
|
|
261
|
+
// Probe all ports in parallel
|
|
262
|
+
const probeResults = await Promise.all(ports.map(async (port) => ({
|
|
263
|
+
port,
|
|
264
|
+
isWorkflow: await probePort(port, options),
|
|
265
|
+
})));
|
|
266
|
+
// Return first port that responded as workflow server
|
|
267
|
+
const workflowPort = probeResults.find((r) => r.isWorkflow);
|
|
268
|
+
if (workflowPort) {
|
|
269
|
+
return workflowPort.port;
|
|
270
|
+
}
|
|
271
|
+
// Fallback to first port if probing doesn't identify workflow server
|
|
272
|
+
// This handles cases where:
|
|
273
|
+
// - Server hasn't started workflow routes yet
|
|
274
|
+
// - Network issues during probing
|
|
275
|
+
if (process.env.NODE_ENV === 'development') {
|
|
276
|
+
console.debug('[getWorkflowPort] Probing failed, falling back to first port:', ports[0]);
|
|
277
|
+
}
|
|
278
|
+
return ports[0];
|
|
189
279
|
}
|
|
190
280
|
//# sourceMappingURL=get-port.js.map
|
package/dist/get-port.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-port.js","sourceRoot":"","sources":["../src/get-port.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAE1C;;GAEG;AACH,SAAS,SAAS,CAAC,KAAa,EAAE,KAAK,GAAG,EAAE;IAC1C,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACpC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,KAAK,EAAE,CAAC;QACtD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,mFAAmF;AACnF,gGAAgG;AAChG,qGAAqG;AACrG,MAAM,IAAI,GAAG,CAAC,GAAa,EAAE,GAAW,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3D,MAAM,SAAS,GAAG,IAAI,CAAC,CAAC,EAAE,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC,CAAC;AAE1C;;;GAGG;AACH,KAAK,UAAU,
|
|
1
|
+
{"version":3,"file":"get-port.js","sourceRoot":"","sources":["../src/get-port.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OA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