@kmmao/happy-agent 0.3.2 → 0.3.4
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/index.cjs +5 -4
- package/dist/index.d.cts +3 -46
- package/dist/index.d.mts +3 -46
- package/dist/index.mjs +5 -4
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -18,7 +18,7 @@ var path = require('path');
|
|
|
18
18
|
var fs = require('fs');
|
|
19
19
|
var os = require('os');
|
|
20
20
|
|
|
21
|
-
var version = "0.3.
|
|
21
|
+
var version = "0.3.4";
|
|
22
22
|
|
|
23
23
|
function loadConfig() {
|
|
24
24
|
const serverUrl = (process.env.HAPPY_SERVER_URL ?? "https://happyserve.xycloud.info").replace(/\/+$/, "");
|
|
@@ -1439,10 +1439,11 @@ function parseTailscaleServeStatus(raw) {
|
|
|
1439
1439
|
const port = parseInt(hostPort.slice(colonIdx + 1), 10);
|
|
1440
1440
|
if (!Number.isFinite(port)) continue;
|
|
1441
1441
|
const handlers = config.Handlers ?? {};
|
|
1442
|
-
const rootHandler = handlers["/"];
|
|
1443
|
-
const target = rootHandler?.Proxy ?? "unknown";
|
|
1444
1442
|
const funnel = allowFunnel[hostPort] === true;
|
|
1445
|
-
|
|
1443
|
+
for (const [path, handler] of Object.entries(handlers)) {
|
|
1444
|
+
const target = handler?.Proxy ?? "unknown";
|
|
1445
|
+
entries.push({ port, path, protocol: "HTTPS", target, funnel, hostname });
|
|
1446
|
+
}
|
|
1446
1447
|
}
|
|
1447
1448
|
logger.debug(`[TAILSCALE] detected ${entries.length} serve entries`);
|
|
1448
1449
|
return entries;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { MachineMetadata, DaemonState } from '@kmmao/happy-wire';
|
|
3
3
|
import { EventEmitter } from 'node:events';
|
|
4
4
|
import { Socket } from 'socket.io-client';
|
|
5
5
|
|
|
@@ -58,51 +58,7 @@ type DecryptedSession = {
|
|
|
58
58
|
dataEncryptionKey: string | null;
|
|
59
59
|
encryption: SessionEncryption;
|
|
60
60
|
};
|
|
61
|
-
|
|
62
|
-
host: z.ZodString;
|
|
63
|
-
platform: z.ZodString;
|
|
64
|
-
happyCliVersion: z.ZodString;
|
|
65
|
-
homeDir: z.ZodString;
|
|
66
|
-
happyHomeDir: z.ZodString;
|
|
67
|
-
happyLibDir: z.ZodString;
|
|
68
|
-
}, z.core.$strip>;
|
|
69
|
-
type MachineMetadata = z.infer<typeof MachineMetadataSchema>;
|
|
70
|
-
declare const DaemonStateSchema: z.ZodObject<{
|
|
71
|
-
status: z.ZodUnion<readonly [z.ZodEnum<{
|
|
72
|
-
running: "running";
|
|
73
|
-
"shutting-down": "shutting-down";
|
|
74
|
-
}>, z.ZodString]>;
|
|
75
|
-
pid: z.ZodOptional<z.ZodNumber>;
|
|
76
|
-
httpPort: z.ZodOptional<z.ZodNumber>;
|
|
77
|
-
startedAt: z.ZodOptional<z.ZodNumber>;
|
|
78
|
-
shutdownRequestedAt: z.ZodOptional<z.ZodNumber>;
|
|
79
|
-
shutdownSource: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
80
|
-
unknown: "unknown";
|
|
81
|
-
"mobile-app": "mobile-app";
|
|
82
|
-
cli: "cli";
|
|
83
|
-
"os-signal": "os-signal";
|
|
84
|
-
}>, z.ZodString]>>;
|
|
85
|
-
tailscale: z.ZodOptional<z.ZodObject<{
|
|
86
|
-
status: z.ZodEnum<{
|
|
87
|
-
connected: "connected";
|
|
88
|
-
disconnected: "disconnected";
|
|
89
|
-
"not-installed": "not-installed";
|
|
90
|
-
}>;
|
|
91
|
-
ipv4: z.ZodOptional<z.ZodString>;
|
|
92
|
-
ipv6: z.ZodOptional<z.ZodString>;
|
|
93
|
-
hostname: z.ZodOptional<z.ZodString>;
|
|
94
|
-
tailnetName: z.ZodOptional<z.ZodString>;
|
|
95
|
-
version: z.ZodOptional<z.ZodString>;
|
|
96
|
-
serves: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
97
|
-
port: z.ZodNumber;
|
|
98
|
-
protocol: z.ZodString;
|
|
99
|
-
target: z.ZodString;
|
|
100
|
-
funnel: z.ZodBoolean;
|
|
101
|
-
hostname: z.ZodString;
|
|
102
|
-
}, z.core.$strip>>>;
|
|
103
|
-
}, z.core.$strip>>;
|
|
104
|
-
}, z.core.$strip>;
|
|
105
|
-
type DaemonState = z.infer<typeof DaemonStateSchema>;
|
|
61
|
+
|
|
106
62
|
type Machine = {
|
|
107
63
|
readonly id: string;
|
|
108
64
|
readonly encryptionKey: Uint8Array;
|
|
@@ -306,6 +262,7 @@ declare class SessionClient extends EventEmitter {
|
|
|
306
262
|
type TailscaleStatus = "connected" | "disconnected" | "not-installed";
|
|
307
263
|
type TailscaleServeEntry = {
|
|
308
264
|
port: number;
|
|
265
|
+
path: string;
|
|
309
266
|
protocol: string;
|
|
310
267
|
target: string;
|
|
311
268
|
funnel: boolean;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { MachineMetadata, DaemonState } from '@kmmao/happy-wire';
|
|
3
3
|
import { EventEmitter } from 'node:events';
|
|
4
4
|
import { Socket } from 'socket.io-client';
|
|
5
5
|
|
|
@@ -58,51 +58,7 @@ type DecryptedSession = {
|
|
|
58
58
|
dataEncryptionKey: string | null;
|
|
59
59
|
encryption: SessionEncryption;
|
|
60
60
|
};
|
|
61
|
-
|
|
62
|
-
host: z.ZodString;
|
|
63
|
-
platform: z.ZodString;
|
|
64
|
-
happyCliVersion: z.ZodString;
|
|
65
|
-
homeDir: z.ZodString;
|
|
66
|
-
happyHomeDir: z.ZodString;
|
|
67
|
-
happyLibDir: z.ZodString;
|
|
68
|
-
}, z.core.$strip>;
|
|
69
|
-
type MachineMetadata = z.infer<typeof MachineMetadataSchema>;
|
|
70
|
-
declare const DaemonStateSchema: z.ZodObject<{
|
|
71
|
-
status: z.ZodUnion<readonly [z.ZodEnum<{
|
|
72
|
-
running: "running";
|
|
73
|
-
"shutting-down": "shutting-down";
|
|
74
|
-
}>, z.ZodString]>;
|
|
75
|
-
pid: z.ZodOptional<z.ZodNumber>;
|
|
76
|
-
httpPort: z.ZodOptional<z.ZodNumber>;
|
|
77
|
-
startedAt: z.ZodOptional<z.ZodNumber>;
|
|
78
|
-
shutdownRequestedAt: z.ZodOptional<z.ZodNumber>;
|
|
79
|
-
shutdownSource: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
80
|
-
unknown: "unknown";
|
|
81
|
-
"mobile-app": "mobile-app";
|
|
82
|
-
cli: "cli";
|
|
83
|
-
"os-signal": "os-signal";
|
|
84
|
-
}>, z.ZodString]>>;
|
|
85
|
-
tailscale: z.ZodOptional<z.ZodObject<{
|
|
86
|
-
status: z.ZodEnum<{
|
|
87
|
-
connected: "connected";
|
|
88
|
-
disconnected: "disconnected";
|
|
89
|
-
"not-installed": "not-installed";
|
|
90
|
-
}>;
|
|
91
|
-
ipv4: z.ZodOptional<z.ZodString>;
|
|
92
|
-
ipv6: z.ZodOptional<z.ZodString>;
|
|
93
|
-
hostname: z.ZodOptional<z.ZodString>;
|
|
94
|
-
tailnetName: z.ZodOptional<z.ZodString>;
|
|
95
|
-
version: z.ZodOptional<z.ZodString>;
|
|
96
|
-
serves: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
97
|
-
port: z.ZodNumber;
|
|
98
|
-
protocol: z.ZodString;
|
|
99
|
-
target: z.ZodString;
|
|
100
|
-
funnel: z.ZodBoolean;
|
|
101
|
-
hostname: z.ZodString;
|
|
102
|
-
}, z.core.$strip>>>;
|
|
103
|
-
}, z.core.$strip>>;
|
|
104
|
-
}, z.core.$strip>;
|
|
105
|
-
type DaemonState = z.infer<typeof DaemonStateSchema>;
|
|
61
|
+
|
|
106
62
|
type Machine = {
|
|
107
63
|
readonly id: string;
|
|
108
64
|
readonly encryptionKey: Uint8Array;
|
|
@@ -306,6 +262,7 @@ declare class SessionClient extends EventEmitter {
|
|
|
306
262
|
type TailscaleStatus = "connected" | "disconnected" | "not-installed";
|
|
307
263
|
type TailscaleServeEntry = {
|
|
308
264
|
port: number;
|
|
265
|
+
path: string;
|
|
309
266
|
protocol: string;
|
|
310
267
|
target: string;
|
|
311
268
|
funnel: boolean;
|
package/dist/index.mjs
CHANGED
|
@@ -16,7 +16,7 @@ import { join as join$1, resolve } from 'path';
|
|
|
16
16
|
import { realpathSync } from 'fs';
|
|
17
17
|
import { tmpdir } from 'os';
|
|
18
18
|
|
|
19
|
-
var version = "0.3.
|
|
19
|
+
var version = "0.3.4";
|
|
20
20
|
|
|
21
21
|
function loadConfig() {
|
|
22
22
|
const serverUrl = (process.env.HAPPY_SERVER_URL ?? "https://happyserve.xycloud.info").replace(/\/+$/, "");
|
|
@@ -1437,10 +1437,11 @@ function parseTailscaleServeStatus(raw) {
|
|
|
1437
1437
|
const port = parseInt(hostPort.slice(colonIdx + 1), 10);
|
|
1438
1438
|
if (!Number.isFinite(port)) continue;
|
|
1439
1439
|
const handlers = config.Handlers ?? {};
|
|
1440
|
-
const rootHandler = handlers["/"];
|
|
1441
|
-
const target = rootHandler?.Proxy ?? "unknown";
|
|
1442
1440
|
const funnel = allowFunnel[hostPort] === true;
|
|
1443
|
-
|
|
1441
|
+
for (const [path, handler] of Object.entries(handlers)) {
|
|
1442
|
+
const target = handler?.Proxy ?? "unknown";
|
|
1443
|
+
entries.push({ port, path, protocol: "HTTPS", target, funnel, hostname });
|
|
1444
|
+
}
|
|
1444
1445
|
}
|
|
1445
1446
|
logger.debug(`[TAILSCALE] detected ${entries.length} serve entries`);
|
|
1446
1447
|
return entries;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmmao/happy-agent",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "CLI client for controlling Happy Coder agents remotely",
|
|
5
5
|
"author": "Kirill Dubovitskiy",
|
|
6
6
|
"license": "MIT",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"release": "npx --no-install release-it"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@kmmao/happy-wire": "^0.
|
|
46
|
+
"@kmmao/happy-wire": "^0.3.0",
|
|
47
47
|
"axios": "^1.13.5",
|
|
48
48
|
"chalk": "^5.6.2",
|
|
49
49
|
"commander": "^13.1.0",
|