dsh-mesh-node 0.0.1 → 0.0.3
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/package.json +1 -1
- package/src/core/cluster.js +341 -340
- package/src/core/hardware.js +57 -0
- package/src/core/sakura-api.js +103 -0
- package/src/core/tunnels.js +212 -0
- package/src/server.js +317 -313
- package/src/tools/core.js +2 -0
- package/src/tools/host.js +3 -1
package/src/tools/core.js
CHANGED
|
@@ -3,6 +3,7 @@ import { basename } from 'node:path'
|
|
|
3
3
|
import { z } from 'zod'
|
|
4
4
|
import { MESH_VERSION, configPath } from '../core/config.js'
|
|
5
5
|
import { describeCert } from '../core/tls.js'
|
|
6
|
+
import { hardwareInfo } from '../core/hardware.js'
|
|
6
7
|
import { auditPath, auditSummary } from '../core/audit.js'
|
|
7
8
|
import { ok } from '../core/result.js'
|
|
8
9
|
|
|
@@ -30,6 +31,7 @@ export function buildCore(ctx) {
|
|
|
30
31
|
configPath: configPath(ctx.home),
|
|
31
32
|
auditPath: auditPath(ctx.home)
|
|
32
33
|
},
|
|
34
|
+
hardware: hardwareInfo(),
|
|
33
35
|
host: {
|
|
34
36
|
hostname: hostname(),
|
|
35
37
|
platform: platform(),
|
package/src/tools/host.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod'
|
|
2
|
+
import { hardwareInfo } from '../core/hardware.js'
|
|
2
3
|
import { createHostClient, hostInstances, hostTokenPath, HostError } from '../core/host-agent.js'
|
|
3
4
|
import { buildSessionProfile, classifySession, sessionBlock } from '../core/session-profile.js'
|
|
4
5
|
import { fail, ok } from '../core/result.js'
|
|
@@ -91,7 +92,8 @@ export function buildHost(ctx) {
|
|
|
91
92
|
inputSchema: z.object({ instance: instanceSchema }),
|
|
92
93
|
handler: async ({ instance }) => {
|
|
93
94
|
try {
|
|
94
|
-
|
|
95
|
+
const data = await hostClient(ctx, instance).self()
|
|
96
|
+
return ok({ ...data, hardware: hardwareInfo() })
|
|
95
97
|
} catch (error) {
|
|
96
98
|
return hostError(error)
|
|
97
99
|
}
|