@hunsu/bridge 0.2.0-next.11 → 0.2.0-next.2
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 +2 -14
- package/dist/cli.js +107 -409
- package/dist/index.d.ts +3 -25
- package/dist/index.js +108 -410
- package/package.json +3 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
export const HUNSU_BRIDGE_VERSION: "0.2.0-next.
|
|
1
|
+
export const HUNSU_BRIDGE_VERSION: "0.2.0-next.2";
|
|
2
2
|
export const HUNSU_BRIDGE_PROTOCOL_VERSION: "local-bridge-v1";
|
|
3
3
|
export const BRIDGE_CLI_RESULT_SCHEMA: "hunsu.bridge.cli-result.v1";
|
|
4
|
-
export const BRIDGE_DEPLOYMENT_PROFILES: readonly ["production", "preview"];
|
|
5
|
-
|
|
6
|
-
export type BridgeDeploymentProfile = "production" | "preview";
|
|
7
|
-
export type BridgeDeploymentEndpoints = Readonly<{
|
|
8
|
-
webUrl: string;
|
|
9
|
-
connectApiUrl: string;
|
|
10
|
-
connectWsUrl: string;
|
|
11
|
-
connectTicketIssuer: string;
|
|
12
|
-
connectTicketSigningKeyId: string;
|
|
13
|
-
connectTicketSigningPublicJwk: Readonly<{ kty: "EC"; crv: "P-256"; x: string; y: string }>;
|
|
14
|
-
}>;
|
|
15
4
|
|
|
16
5
|
export type BridgeCliResult<T = unknown> =
|
|
17
6
|
| { schema: "hunsu.bridge.cli-result.v1"; ok: true; code: string; message: string; value?: T }
|
|
@@ -48,7 +37,6 @@ export type BridgeHealth = {
|
|
|
48
37
|
service: "hunsu-bridge";
|
|
49
38
|
version: string;
|
|
50
39
|
protocolVersion: "local-bridge-v1";
|
|
51
|
-
deploymentProfile: BridgeDeploymentProfile;
|
|
52
40
|
};
|
|
53
41
|
|
|
54
42
|
export type ControlEndpointProbe =
|
|
@@ -70,30 +58,24 @@ export type BridgeControlClient = {
|
|
|
70
58
|
request<T = unknown>(path: string, input?: BridgeControlRequest): Promise<BridgeCliResult<T>>;
|
|
71
59
|
};
|
|
72
60
|
|
|
73
|
-
export type
|
|
61
|
+
export type RelaySocket = {
|
|
74
62
|
readyState: number;
|
|
75
63
|
send(data: string): void;
|
|
76
64
|
close(code?: number, reason?: string): void;
|
|
77
65
|
addEventListener(type: "open" | "close" | "error" | "message", listener: (event: { data?: unknown }) => void): void;
|
|
78
66
|
};
|
|
79
67
|
|
|
80
|
-
export type ConnectSocketFactory = (input: {
|
|
81
|
-
url: string;
|
|
82
|
-
headers: Readonly<Record<string, string>>;
|
|
83
|
-
}) => ConnectSocket | Promise<ConnectSocket>;
|
|
84
|
-
|
|
85
68
|
export type BridgeDaemonOptions = HunsuPathInput & {
|
|
86
69
|
host?: string;
|
|
87
70
|
port?: number;
|
|
88
71
|
cwd?: string;
|
|
89
72
|
runtimePath?: string;
|
|
90
73
|
webUrl?: string;
|
|
91
|
-
deploymentProfile?: BridgeDeploymentProfile;
|
|
92
74
|
development?: boolean;
|
|
93
75
|
serviceManager?: "windows-task-scheduler" | "macos-launch-agent" | "linux-systemd-user" | "development";
|
|
94
76
|
fetchImpl?: typeof fetch;
|
|
95
77
|
openBrowser?: (url: string) => Promise<void>;
|
|
96
|
-
socketFactory?:
|
|
78
|
+
socketFactory?: (url: string) => RelaySocket;
|
|
97
79
|
};
|
|
98
80
|
|
|
99
81
|
export type BridgeRuntimeIdentity = {
|
|
@@ -102,7 +84,6 @@ export type BridgeRuntimeIdentity = {
|
|
|
102
84
|
daemonPid: number;
|
|
103
85
|
version: string;
|
|
104
86
|
protocolVersion: "local-bridge-v1";
|
|
105
|
-
deploymentProfile: BridgeDeploymentProfile;
|
|
106
87
|
startedAt: string;
|
|
107
88
|
endpoint: string;
|
|
108
89
|
runtimePath: string;
|
|
@@ -119,9 +100,6 @@ export type RunningBridgeDaemon = {
|
|
|
119
100
|
};
|
|
120
101
|
|
|
121
102
|
export function resolveHunsuHome(input?: HunsuPathInput): string;
|
|
122
|
-
export function isBridgeDeploymentProfile(value: unknown): value is BridgeDeploymentProfile;
|
|
123
|
-
export function bridgeDeploymentEndpoints(profile: BridgeDeploymentProfile): BridgeDeploymentEndpoints;
|
|
124
|
-
export function bridgeSetupPackageTag(profile: BridgeDeploymentProfile): "next" | "candidate-next";
|
|
125
103
|
export function resolveHunsuPaths(input?: HunsuPathInput): HunsuPaths;
|
|
126
104
|
export function createBridgeControlClient(options?: HunsuPathInput & {
|
|
127
105
|
paths?: HunsuPaths;
|