@hasna/machines 0.0.26 → 0.0.28
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/README.md +12 -3
- package/dist/cli/index.js +1502 -131
- package/dist/commands/screen.d.ts +31 -0
- package/dist/commands/screen.d.ts.map +1 -1
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/index.js +731 -10
- package/dist/mcp/index.js +650 -72
- package/dist/mcp/server.d.ts +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/package.json +2 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type MachineRouteOptions, type MachineRouteKind, type MachineRouteConfidence } from "../topology.js";
|
|
2
|
+
export declare const DEFAULT_SCREEN_SECRET_NAMESPACE = "hasna/xyz/opensource/machines/prod";
|
|
2
3
|
export interface ResolvedScreenTarget {
|
|
3
4
|
machineId: string;
|
|
4
5
|
user: string | null;
|
|
@@ -8,12 +9,35 @@ export interface ResolvedScreenTarget {
|
|
|
8
9
|
confidence: MachineRouteConfidence;
|
|
9
10
|
warnings: string[];
|
|
10
11
|
}
|
|
12
|
+
export interface ScreenCredentialResolution {
|
|
13
|
+
machineId: string;
|
|
14
|
+
user: string | null;
|
|
15
|
+
userSource: "option" | "route" | "metadata" | "missing";
|
|
16
|
+
passwordSecretKey: string;
|
|
17
|
+
passwordSecretSource: "option" | "metadata" | "default";
|
|
18
|
+
}
|
|
19
|
+
export interface ScreenEnableCommandPlan {
|
|
20
|
+
machineId: string;
|
|
21
|
+
user: string;
|
|
22
|
+
passwordSecretKey: string;
|
|
23
|
+
remoteCommand: string;
|
|
24
|
+
command: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ScreenCredentialOptions extends MachineRouteOptions {
|
|
27
|
+
user?: string;
|
|
28
|
+
passwordSecretKey?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ScreenEnableCommandOptions extends ScreenCredentialOptions {
|
|
31
|
+
secretsCommand?: string;
|
|
32
|
+
}
|
|
33
|
+
export declare function defaultScreenPasswordSecretKey(machineId: string): string;
|
|
11
34
|
/**
|
|
12
35
|
* Resolve the best screen-sharing (VNC) target for a machine.
|
|
13
36
|
* Prefers the live LAN route over Tailscale (lower latency for screen sharing),
|
|
14
37
|
* and always produces a `vnc://user@host` URL when a user is known.
|
|
15
38
|
*/
|
|
16
39
|
export declare function resolveScreenTarget(machineId: string, options?: MachineRouteOptions): ResolvedScreenTarget;
|
|
40
|
+
export declare function resolveScreenCredentials(machineId: string, options?: ScreenCredentialOptions): ScreenCredentialResolution;
|
|
17
41
|
/**
|
|
18
42
|
* Build the macOS command that opens Screen Sharing to a machine.
|
|
19
43
|
* `open vnc://user@host` launches Screen Sharing.app pointed at the resolved route.
|
|
@@ -32,4 +56,11 @@ export declare function buildScreenCommand(machineId: string, options?: MachineR
|
|
|
32
56
|
* password or runs under an already-root context).
|
|
33
57
|
*/
|
|
34
58
|
export declare function buildScreenEnableRemoteCommand(user: string, vncPassword: string): string;
|
|
59
|
+
/**
|
|
60
|
+
* Build the remote root command used by secure screen-enable plans.
|
|
61
|
+
* The VNC password is read from stdin so it is not embedded in shell history,
|
|
62
|
+
* generated command text, or the SSH remote command arguments.
|
|
63
|
+
*/
|
|
64
|
+
export declare function buildScreenEnableRemoteCommandFromStdin(user: string): string;
|
|
65
|
+
export declare function buildScreenEnableCommand(machineId: string, options?: ScreenEnableCommandOptions): ScreenEnableCommandPlan;
|
|
35
66
|
//# sourceMappingURL=screen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screen.d.ts","sourceRoot":"","sources":["../../src/commands/screen.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"screen.d.ts","sourceRoot":"","sources":["../../src/commands/screen.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC5B,MAAM,gBAAgB,CAAC;AAExB,eAAO,MAAM,+BAA+B,uC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kB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB,GAAG,MAAM,CAG/F;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAcxF;AAED;;;;GAIG;AACH,wBAAgB,uCAAuC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAe5E;AAED,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,GAAE,0BAA+B,GAAG,uBAAuB,CAc7H"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/commands/serve.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../src/commands/serve.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAWD,wBAAgB,YAAY,CAAC,OAAO,GAAE,YAAiB,GAAG,SAAS,CAyBlE;AAED,wBAAgB,mBAAmB,IAAI,MAAM,CA+J5C;AAcD,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,YAAiB,GAAG,UAAU,CAAC,OAAO,GAAG,CAAC,KAAK,CAAC,CA6H7F"}
|