@capybara-hq/plugin-sdk 0.1.0-rc.55 → 0.1.0-rc.56
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/dial-in.d.ts +33 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/dial-in.d.ts
CHANGED
|
@@ -95,17 +95,34 @@ export declare function parseDialInKernelFrame(text: string, maxBytes: number):
|
|
|
95
95
|
* declares `permissions.dialIn = { protocol: "<name>/<major>" }`.
|
|
96
96
|
*/
|
|
97
97
|
export interface DialInHandler {
|
|
98
|
-
/**
|
|
99
|
-
|
|
98
|
+
/**
|
|
99
|
+
* Called on the gateway replica holding the socket, after the kernel authenticated it.
|
|
100
|
+
* `connection` names the machine and the connection the hello arrived on.
|
|
101
|
+
*/
|
|
102
|
+
onHello(deviceId: string, hello: unknown, signal: AbortSignal, connection: DialInConnectionInfo): Promise<{
|
|
100
103
|
ok: true;
|
|
101
104
|
} | {
|
|
102
105
|
ok: false;
|
|
103
106
|
code: string;
|
|
104
107
|
message: string;
|
|
105
108
|
}>;
|
|
106
|
-
/** Unsolicited frames from the machine (not responses to requests). */
|
|
107
|
-
onFrame?(deviceId: string, frame: unknown): Promise<void>;
|
|
108
|
-
|
|
109
|
+
/** Unsolicited frames from the machine (not responses to requests), with their connection. */
|
|
110
|
+
onFrame?(deviceId: string, frame: unknown, connection: DialInConnectionInfo): Promise<void>;
|
|
111
|
+
/**
|
|
112
|
+
* The connection whose hello this provider accepted closed. `connection` is that connection's,
|
|
113
|
+
* so a `replaced` close names the old machine, never the one that replaced it.
|
|
114
|
+
*/
|
|
115
|
+
onClose?(deviceId: string, reason: "offline" | "replaced" | "revoked" | "deleted", connection: DialInConnectionInfo): void;
|
|
116
|
+
}
|
|
117
|
+
/** Which machine and which of its connections a {@link DialInHandler} call is about. */
|
|
118
|
+
export interface DialInConnectionInfo {
|
|
119
|
+
/**
|
|
120
|
+
* The kernel's id of the signed-in machine (its credential): a machine signing in again to the
|
|
121
|
+
* same device, or another machine replacing it, gets another id.
|
|
122
|
+
*/
|
|
123
|
+
machineId: string;
|
|
124
|
+
/** The connection id, the same the kernel sends to the machine in `ready`. */
|
|
125
|
+
connectionId: string;
|
|
109
126
|
}
|
|
110
127
|
/**
|
|
111
128
|
* `ctx.dialIn` (requires `permissions.dialIn`): talks to the machines serving this extension's
|
|
@@ -121,6 +138,17 @@ export interface DialInChannel {
|
|
|
121
138
|
signal?: AbortSignal;
|
|
122
139
|
}): Promise<unknown>;
|
|
123
140
|
online(deviceId: string): Promise<boolean>;
|
|
141
|
+
/**
|
|
142
|
+
* The negotiated frame capacity of the machine's current connection: the `maxFrameBytes` the
|
|
143
|
+
* kernel sent in that connection's `ready` (the smaller of the machine's announced
|
|
144
|
+
* `transport.maxFrameBytes` and the deployment's limit). A provider sizes its request bodies
|
|
145
|
+
* and the answers it asks for by it: a `req` frame larger than this is refused. Null when no
|
|
146
|
+
* machine holds the device now. Read from shared state at every call, so a reconnect with
|
|
147
|
+
* another capacity shows at once; it can change between this call and a later request.
|
|
148
|
+
*/
|
|
149
|
+
capacity(deviceId: string): Promise<{
|
|
150
|
+
maxFrameBytes: number;
|
|
151
|
+
} | null>;
|
|
124
152
|
stop(deviceId: string, reason: "drain" | "stop"): Promise<void>;
|
|
125
153
|
}
|
|
126
154
|
/**
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED