pinokiod 3.10.8 → 3.10.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.
@@ -57,6 +57,7 @@ module.exports = {
57
57
  { name: "conda", },
58
58
  { name: "git", },
59
59
  { name: "node", },
60
+ { name: "py" },
60
61
  ],
61
62
  conda_requirements: [
62
63
  "node",
@@ -73,6 +74,7 @@ module.exports = {
73
74
  { name: "conda", },
74
75
  { name: "git", },
75
76
  { name: "uv", },
77
+ { name: "py" },
76
78
  ],
77
79
  conda_requirements: [
78
80
  "uv",
@@ -120,6 +122,7 @@ module.exports = {
120
122
  { name: "conda", },
121
123
  { name: "git", },
122
124
  { name: "caddy", },
125
+ { name: "py", },
123
126
  ],
124
127
  conda_requirements: [
125
128
  "git",
@@ -136,6 +139,7 @@ module.exports = {
136
139
  { name: "conda", },
137
140
  { name: "git", },
138
141
  { name: "caddy", },
142
+ { name: "py", },
139
143
  ],
140
144
  conda_requirements: [
141
145
  "git",
package/kernel/procs.js CHANGED
@@ -6,12 +6,18 @@ const platform = os.platform();
6
6
  class Procs {
7
7
  constructor () {
8
8
  console.log("Initializing procs")
9
+ this.cache = {}
9
10
  }
10
11
  async isHttp(localAddress) {
12
+ if (this.cache.hasOwnProperty(localAddress)) {
13
+ return this.cache[localAddress]
14
+ }
11
15
  try {
12
16
  await axios.head(`http://${localAddress}`, { timeout: 1000 });
17
+ this.cache[localAddress] = true
13
18
  return true;
14
19
  } catch (err) {
20
+ this.cache[localAddress] = false
15
21
  return false;
16
22
  }
17
23
  }
@@ -29,48 +35,57 @@ class Procs {
29
35
  for(let line of lines) {
30
36
  if (isWin) {
31
37
  // Skip headers
32
- if (!line.startsWith(' TCP')) continue;
33
- const parts = line.trim().split(/\s+/);
34
- const [ , localAddress, , state, pid ] = parts;
38
+ try {
39
+ if (!line.startsWith(' TCP')) continue;
40
+ const parts = line.trim().split(/\s+/);
41
+ const [ , localAddress, , state, pid ] = parts;
42
+
43
+ //if (state !== 'LISTENING') continue;
44
+ const chunks = localAddress.split(":")
45
+ const port = chunks.pop()
46
+ let ip = chunks.pop()
47
+ if (!ip || ip === "*") {
48
+ ip = "127.0.0.1:" + port
49
+ } else {
50
+ ip = localAddress
51
+ }
35
52
 
36
- //if (state !== 'LISTENING') return;
37
- let isHttp = await this.isHttp(localAddress)
38
- if (!isHttp) continue
39
- const chunks = localAddress.split(":")
40
- const port = chunks.pop()
41
- let ip = chunks.pop()
42
- if (!ip || ip === "*") {
43
- ip = "127.0.0.1:" + port
44
- } else {
45
- ip = localAddress
53
+ let isHttp = await this.isHttp(ip)
54
+ if (!isHttp) continue
55
+
56
+ if (pids.has(pid+"/"+port)) continue;
57
+ pids.add(pid+"/"+port)
58
+ results.push({ port, pid, ip });
59
+ } catch (e) {
46
60
  }
47
- if (pids.has(pid+"/"+port)) continue;
48
- pids.add(pid+"/"+port)
49
- results.push({ port, pid, ip });
50
61
  } else {
51
- //if (!/LISTEN/.test(line)) return;
52
- const parts = line.trim().split(/\s+/);
53
- const pid = parts[1];
62
+ // if (!/LISTEN/.test(line)) continue;
63
+ try {
64
+ const parts = line.trim().split(/\s+/);
65
+ const pid = parts[1];
66
+
67
+ const match = line.match(/([^\s]+:\d+)\s/);
68
+ const localAddress = match?.[1];
54
69
 
55
- const match = line.match(/([^\s]+:\d+)\s/);
56
- const localAddress = match?.[1];
70
+ const chunks = localAddress.split(":")
71
+ const port = chunks.pop()
72
+ let ip = chunks.pop()
73
+ if (!ip || ip === "*") {
74
+ ip = "127.0.0.1:" + port
75
+ } else {
76
+ ip = localAddress
77
+ }
57
78
 
58
- let isHttp = await this.isHttp(localAddress)
59
- if (!isHttp) continue;
79
+ let isHttp = await this.isHttp(ip)
80
+ if (!isHttp) continue;
60
81
 
61
- const chunks = localAddress.split(":")
62
- const port = chunks.pop()
63
- let ip = chunks.pop()
64
- if (!ip || ip === "*") {
65
- ip = "127.0.0.1:" + port
66
- } else {
67
- ip = localAddress
82
+ //const portMatch = line.match(/:(\d+)\s/);
83
+ //const port = portMatch?.[1];
84
+ if (pids.has(pid+"/"+port)) continue;
85
+ pids.add(pid+"/"+port)
86
+ if (pid && port) results.push({ port, pid, ip });
87
+ } catch (e) {
68
88
  }
69
- //const portMatch = line.match(/:(\d+)\s/);
70
- //const port = portMatch?.[1];
71
- if (pids.has(pid+"/"+port)) continue;
72
- pids.add(pid+"/"+port)
73
- if (pid && port) results.push({ port, pid, ip });
74
89
  }
75
90
  }
76
91
  callback(null, results);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.10.8",
3
+ "version": "3.10.10",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {