@rynx-ai/remote-runtime-client 0.1.9
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/browser-surface-client.d.ts +31 -0
- package/dist/browser-surface-client.js +785 -0
- package/dist/client.d.ts +86 -0
- package/dist/client.js +1915 -0
- package/dist/credential.d.ts +35 -0
- package/dist/credential.js +163 -0
- package/dist/errors.d.ts +55 -0
- package/dist/errors.js +112 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/package.json +32 -0
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { type RemoteRuntimeRpcMethod, type RemoteRuntimeRpcParams, type RemoteRuntimeRpcResultFor, type RemoteRuntimeSequencedSessionEvent, type RemoteRuntimeSessionTerminalClosedFrame, type RemoteRuntimeSessionTerminalRole } from "@rynx-ai/protocol/remote-runtime-rpc";
|
|
2
|
+
import { type DaemonStatus } from "@rynx-ai/protocol/remote-runtime";
|
|
3
|
+
import { type RuntimeEmulatorSurfaceClosedFrame, type RuntimeEmulatorSurfaceImageFrame, type RuntimeEmulatorSurfaceReadyFrame } from "@rynx-ai/protocol/runtime-emulator-surface";
|
|
4
|
+
import { type DirectRuntimeClientIdentity, type DirectRuntimeCredential } from "./credential.js";
|
|
5
|
+
export interface DirectRuntimeClientOptions {
|
|
6
|
+
/** Overall connect/handshake timeout and the default per-RPC timeout. */
|
|
7
|
+
timeoutMs?: number;
|
|
8
|
+
/** RFC 6455 control-frame liveness; primarily exposed for deployment tests. */
|
|
9
|
+
liveness?: {
|
|
10
|
+
pingIntervalMs?: number;
|
|
11
|
+
inactivityTimeoutMs?: number;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export interface DirectRuntimeCallOptions {
|
|
15
|
+
/** Per-call override for operations whose expected duration differs from the handshake. */
|
|
16
|
+
timeoutMs?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface DirectRuntimeSessionEventsOptions {
|
|
19
|
+
/** Timeout for the accepted ready barrier and cancellation acknowledgement. */
|
|
20
|
+
timeoutMs?: number;
|
|
21
|
+
}
|
|
22
|
+
export interface DirectRuntimeSessionEventsSubscription extends AsyncIterable<RemoteRuntimeSequencedSessionEvent> {
|
|
23
|
+
readonly subscriptionId: string;
|
|
24
|
+
readonly sessionId: string;
|
|
25
|
+
readonly daemonInstanceId: string;
|
|
26
|
+
/** Idempotently cancel the remote stream and wait for its close acknowledgement. */
|
|
27
|
+
close(): Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
export interface DirectRuntimeSessionTerminalOptions {
|
|
30
|
+
role: RemoteRuntimeSessionTerminalRole;
|
|
31
|
+
cols: number;
|
|
32
|
+
rows: number;
|
|
33
|
+
/** Timeout for the opened barrier and close acknowledgement. */
|
|
34
|
+
timeoutMs?: number;
|
|
35
|
+
}
|
|
36
|
+
export interface DirectRuntimeSessionTerminal extends AsyncIterable<Uint8Array> {
|
|
37
|
+
readonly attachmentId: string;
|
|
38
|
+
readonly sessionId: string;
|
|
39
|
+
readonly role: RemoteRuntimeSessionTerminalRole;
|
|
40
|
+
readonly closed: Promise<RemoteRuntimeSessionTerminalClosedFrame>;
|
|
41
|
+
write(data: Uint8Array): Promise<void>;
|
|
42
|
+
resize(cols: number, rows: number): Promise<void>;
|
|
43
|
+
/** Idempotently detach and wait for the remote close acknowledgement. */
|
|
44
|
+
close(): Promise<void>;
|
|
45
|
+
}
|
|
46
|
+
export interface DirectRuntimeEmulatorSurfaceOptions {
|
|
47
|
+
maximumFrameRate?: number;
|
|
48
|
+
timeoutMs?: number;
|
|
49
|
+
}
|
|
50
|
+
export interface DirectRuntimeEmulatorSurface extends AsyncIterable<RuntimeEmulatorSurfaceImageFrame> {
|
|
51
|
+
readonly surfaceId: string;
|
|
52
|
+
readonly sessionId: string;
|
|
53
|
+
readonly bindingId: string;
|
|
54
|
+
readonly ready: RuntimeEmulatorSurfaceReadyFrame;
|
|
55
|
+
readonly closed: Promise<RuntimeEmulatorSurfaceClosedFrame>;
|
|
56
|
+
sendTouch(point: {
|
|
57
|
+
phase: "begin" | "move" | "end";
|
|
58
|
+
x: number;
|
|
59
|
+
y: number;
|
|
60
|
+
}): Promise<void>;
|
|
61
|
+
close(): Promise<void>;
|
|
62
|
+
}
|
|
63
|
+
export interface PairDirectRuntimeOptions extends DirectRuntimeClientOptions {
|
|
64
|
+
/** Optional pre-generated identity. A fresh identity is generated when omitted. */
|
|
65
|
+
identity?: DirectRuntimeClientIdentity;
|
|
66
|
+
/** Explicitly permit an expired offer for recovery enrollment. Defaults to false. */
|
|
67
|
+
allowExpiredOffer?: boolean;
|
|
68
|
+
}
|
|
69
|
+
export interface PairDirectRuntimeResult {
|
|
70
|
+
credential: DirectRuntimeCredential;
|
|
71
|
+
status: DaemonStatus;
|
|
72
|
+
}
|
|
73
|
+
export interface DirectRuntimeConnection {
|
|
74
|
+
status(): Promise<DaemonStatus>;
|
|
75
|
+
call<M extends RemoteRuntimeRpcMethod>(method: M, params: RemoteRuntimeRpcParams<M>, options?: DirectRuntimeCallOptions): Promise<RemoteRuntimeRpcResultFor<M>>;
|
|
76
|
+
/** Backward-compatible shorthand; equivalent to `call("status.get", {})`. */
|
|
77
|
+
call(method: "status.get", params?: Record<string, never>, options?: DirectRuntimeCallOptions): Promise<DaemonStatus>;
|
|
78
|
+
subscribeSessionEvents(sessionId: string, options?: DirectRuntimeSessionEventsOptions): Promise<DirectRuntimeSessionEventsSubscription>;
|
|
79
|
+
openSessionTerminal(sessionId: string, options: DirectRuntimeSessionTerminalOptions): Promise<DirectRuntimeSessionTerminal>;
|
|
80
|
+
openEmulatorSurface(sessionId: string, bindingId: string, options?: DirectRuntimeEmulatorSurfaceOptions): Promise<DirectRuntimeEmulatorSurface>;
|
|
81
|
+
close(): Promise<void>;
|
|
82
|
+
}
|
|
83
|
+
/** Enroll a client identity, authenticate the issued grant, and probe status. */
|
|
84
|
+
export declare function pairDirectRuntime(untrustedOffer: unknown, options?: PairDirectRuntimeOptions): Promise<PairDirectRuntimeResult>;
|
|
85
|
+
/** Connect once with a persisted grant. No retry or local fallback is attempted. */
|
|
86
|
+
export declare function connectDirectRuntime(untrustedCredential: unknown, options?: DirectRuntimeClientOptions): Promise<DirectRuntimeConnection>;
|