@the-open-engine/zeroshot 6.11.0 → 6.13.0

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.
Files changed (76) hide show
  1. package/cli/commands/providers.js +13 -13
  2. package/cli/index.js +77 -35
  3. package/cli/lib/first-run.js +12 -11
  4. package/cli/lib/update-checker.js +517 -132
  5. package/lib/agent-cli-provider/adapters/opencode.d.ts.map +1 -1
  6. package/lib/agent-cli-provider/adapters/opencode.js +3 -0
  7. package/lib/agent-cli-provider/adapters/opencode.js.map +1 -1
  8. package/lib/agent-cli-provider/types.d.ts +1 -0
  9. package/lib/agent-cli-provider/types.d.ts.map +1 -1
  10. package/lib/agent-cli-provider/types.js.map +1 -1
  11. package/lib/cluster/client.cjs +146 -0
  12. package/lib/cluster/client.d.ts +44 -0
  13. package/lib/cluster/client.mjs +141 -0
  14. package/lib/cluster/connection.cjs +382 -0
  15. package/lib/cluster/connection.d.ts +41 -0
  16. package/lib/cluster/connection.mjs +378 -0
  17. package/lib/cluster/errors.cjs +44 -0
  18. package/lib/cluster/errors.d.ts +23 -0
  19. package/lib/cluster/errors.mjs +32 -0
  20. package/lib/cluster/frames.cjs +49 -0
  21. package/lib/cluster/frames.d.ts +12 -0
  22. package/lib/cluster/frames.mjs +45 -0
  23. package/lib/cluster/generated/protocol-schema.cjs +5 -0
  24. package/lib/cluster/generated/protocol-schema.d.ts +1 -0
  25. package/lib/cluster/generated/protocol-schema.mjs +2 -0
  26. package/lib/cluster/generated/protocol.cjs +22 -0
  27. package/lib/cluster/generated/protocol.d.ts +781 -0
  28. package/lib/cluster/generated/protocol.mjs +19 -0
  29. package/lib/cluster/index.cjs +40 -0
  30. package/lib/cluster/index.d.ts +10 -0
  31. package/lib/cluster/index.mjs +6 -0
  32. package/lib/cluster/queue.cjs +71 -0
  33. package/lib/cluster/queue.d.ts +15 -0
  34. package/lib/cluster/queue.mjs +67 -0
  35. package/lib/cluster/socket.cjs +15 -0
  36. package/lib/cluster/socket.d.ts +11 -0
  37. package/lib/cluster/socket.mjs +12 -0
  38. package/lib/cluster/subscriptions.cjs +270 -0
  39. package/lib/cluster/subscriptions.d.ts +69 -0
  40. package/lib/cluster/subscriptions.mjs +264 -0
  41. package/lib/cluster/validators.cjs +46 -0
  42. package/lib/cluster/validators.d.ts +3 -0
  43. package/lib/cluster/validators.mjs +42 -0
  44. package/lib/settings.js +195 -23
  45. package/lib/setup-apply.js +45 -32
  46. package/lib/setup-undo.js +25 -16
  47. package/package.json +25 -3
  48. package/scripts/build-cluster.js +43 -0
  49. package/scripts/generate-cluster-types.js +203 -0
  50. package/scripts/release-dry-run.js +6 -6
  51. package/scripts/rust-distribution.js +933 -0
  52. package/src/agent/agent-hook-executor.js +14 -6
  53. package/src/agent/agent-lifecycle.js +25 -8
  54. package/src/agent/agent-task-executor.js +711 -139
  55. package/src/agent/output-reformatter.js +54 -41
  56. package/src/agent/pr-verification.js +11 -3
  57. package/src/agent/task-execution-handle.js +373 -0
  58. package/src/agent-cli-provider/adapters/opencode.ts +3 -0
  59. package/src/agent-cli-provider/types.ts +1 -0
  60. package/src/agent-wrapper.js +5 -2
  61. package/src/cluster/client.ts +199 -0
  62. package/src/cluster/connection.ts +300 -0
  63. package/src/cluster/errors.ts +32 -0
  64. package/src/cluster/frames.ts +44 -0
  65. package/src/cluster/generated/protocol-schema.ts +2 -0
  66. package/src/cluster/generated/protocol.ts +183 -0
  67. package/src/cluster/index.ts +38 -0
  68. package/src/cluster/queue.ts +84 -0
  69. package/src/cluster/socket.ts +31 -0
  70. package/src/cluster/subscriptions.ts +256 -0
  71. package/src/cluster/validators.ts +56 -0
  72. package/src/cluster/ws.d.ts +7 -0
  73. package/src/isolation-manager.js +16 -0
  74. package/src/issue-providers/jira-provider.js +1 -1
  75. package/src/issue-providers/linear-provider.js +4 -4
  76. package/task-lib/runner.js +3 -0
@@ -0,0 +1,382 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Connection = exports.PROTOCOL_DIAGNOSTIC_CAPACITY = exports.CONNECTION_TRANSITIONS = void 0;
4
+ const protocol_js_1 = require("./generated/protocol.cjs");
5
+ const errors_js_1 = require("./errors.cjs");
6
+ const frames_js_1 = require("./frames.cjs");
7
+ const queue_js_1 = require("./queue.cjs");
8
+ const socket_js_1 = require("./socket.cjs");
9
+ const validators_js_1 = require("./validators.cjs");
10
+ if (!Object.prototype.hasOwnProperty.call(Symbol, 'asyncDispose')) {
11
+ Object.defineProperty(Symbol, 'asyncDispose', {
12
+ configurable: false, enumerable: false,
13
+ value: Symbol.for('Symbol.asyncDispose'), writable: false,
14
+ });
15
+ }
16
+ exports.CONNECTION_TRANSITIONS = Object.freeze({
17
+ OPEN: Object.freeze(['CLOSING']),
18
+ CLOSING: Object.freeze(['CLOSED']),
19
+ CLOSED: Object.freeze([]),
20
+ });
21
+ exports.PROTOCOL_DIAGNOSTIC_CAPACITY = 128;
22
+ function deferred() {
23
+ let resolve;
24
+ let reject;
25
+ const promise = new Promise((onResolve, onReject) => {
26
+ resolve = onResolve;
27
+ reject = onReject;
28
+ });
29
+ return { promise, resolve, reject };
30
+ }
31
+ class Connection {
32
+ #state = 'OPEN';
33
+ #sequence = 1;
34
+ #pending = new Map();
35
+ #subscriptions = new Map();
36
+ #lateSubscriptionReapers = new Set();
37
+ #removeSocketListeners = [];
38
+ #ownedSubscriptions = new WeakSet();
39
+ #closePromise;
40
+ closeDiagnostics = [];
41
+ protocolDiagnostics = [];
42
+ #socket;
43
+ constructor(socket) {
44
+ if (socket.readyState !== 1)
45
+ throw new errors_js_1.ClusterStateError('Connection requires an already-open WebSocket', 'SOCKET_NOT_OPEN');
46
+ this.#socket = socket;
47
+ this.#removeSocketListeners.push((0, socket_js_1.addSocketListener)(socket, 'message', (event) => this.#onMessage(event)), (0, socket_js_1.addSocketListener)(socket, 'error', () => { void this.#startClose(false); }), (0, socket_js_1.addSocketListener)(socket, 'close', () => { void this.#startClose(false); }));
48
+ }
49
+ get state() { return this.#state; }
50
+ get pendingSize() { return this.#pending.size; }
51
+ get subscriptionCount() { return this.#subscriptions.size; }
52
+ call(method, params, options = {}) {
53
+ if (!protocol_js_1.UNARY_METHODS.includes(method)) {
54
+ throw new errors_js_1.ClusterConfigError(`${method} is a subscription method`, 'INVALID_METHOD');
55
+ }
56
+ return this.#dispatch(method, params, options);
57
+ }
58
+ cancelSubscription(registration) {
59
+ if (!this.#ownedSubscriptions.has(registration)) {
60
+ return Promise.reject(new errors_js_1.ClusterStateError('subscription is not owned by this connection', 'UNOWNED_SUBSCRIPTION'));
61
+ }
62
+ if (registration.cancelSent)
63
+ return Promise.resolve();
64
+ registration.cancelSent = true;
65
+ return this.#sendNotification('subscription/cancel', { subscriptionId: registration.id });
66
+ }
67
+ openSubscription(method, params, options = {}) {
68
+ if (!protocol_js_1.SUBSCRIPTION_METHODS.includes(method)) {
69
+ throw new errors_js_1.ClusterConfigError(`${method} is not a subscription method`, 'INVALID_METHOD');
70
+ }
71
+ return this.#dispatch(method, params, options, method);
72
+ }
73
+ unregisterSubscription(id, registration) {
74
+ if (this.#subscriptions.get(id) !== registration)
75
+ return;
76
+ this.#subscriptions.delete(id);
77
+ this.#disarmSubscriptionAbort(registration);
78
+ }
79
+ recordDiagnostic(error) { this.closeDiagnostics.push(error); }
80
+ close() { return this.#startClose(true); }
81
+ #dispatch(method, params, options, subscriptionKind) {
82
+ this.#requireOpen();
83
+ if (options.signal?.aborted)
84
+ return Promise.reject((0, errors_js_1.requestAbortError)(method));
85
+ if (options.requestTimeoutMs !== undefined && options.requestTimeoutMs < 0)
86
+ return Promise.reject(new errors_js_1.ClusterConfigError('requestTimeoutMs must be non-negative', 'INVALID_TIMEOUT'));
87
+ const id = this.#allocateId();
88
+ const result = deferred();
89
+ const entry = { id, method, expectedId: id, resolve: result.resolve, reject: result.reject, settled: false, ...(subscriptionKind === undefined ? {} : { subscriptionKind }) };
90
+ this.#pending.set(id, entry);
91
+ if (options.signal) {
92
+ const onAbort = () => {
93
+ if (!this.#removeExact(id, entry))
94
+ return;
95
+ this.#settleEntry(entry);
96
+ if (entry.subscriptionKind)
97
+ this.#lateSubscriptionReapers.add(id);
98
+ entry.reject((0, errors_js_1.requestAbortError)(method));
99
+ void this.#sendNotification('$/cancelRequest', { id }).catch((error) => this.recordDiagnostic(error));
100
+ };
101
+ entry.signal = options.signal;
102
+ entry.abortHandler = onAbort;
103
+ options.signal.addEventListener('abort', onAbort, { once: true });
104
+ }
105
+ if (options.requestTimeoutMs !== undefined) {
106
+ entry.timeout = setTimeout(() => {
107
+ if (!this.#removeExact(id, entry))
108
+ return;
109
+ this.#settleEntry(entry);
110
+ if (entry.subscriptionKind)
111
+ this.#lateSubscriptionReapers.add(id);
112
+ entry.reject(new errors_js_1.ClusterTimeoutError(`${method} request timed out`, 'REQUEST_TIMEOUT'));
113
+ void this.#sendNotification('$/cancelRequest', { id }).catch((error) => this.recordDiagnostic(error));
114
+ }, options.requestTimeoutMs);
115
+ }
116
+ const request = { jsonrpc: protocol_js_1.JSON_RPC_VERSION, id, method, params };
117
+ void this.#sendFrame(request).catch((cause) => {
118
+ if (!this.#removeExact(id, entry))
119
+ return;
120
+ this.#settleEntry(entry);
121
+ entry.reject(new errors_js_1.ClusterTransportError(`failed to send ${method}`, 'SEND_FAILED', { cause }));
122
+ });
123
+ return result.promise;
124
+ }
125
+ #allocateId() { return `z${this.#sequence++}`; }
126
+ #removeExact(id, entry) { if (this.#pending.get(id) !== entry)
127
+ return false; this.#pending.delete(id); return true; }
128
+ #settleEntry(entry) {
129
+ if (entry.settled)
130
+ return;
131
+ entry.settled = true;
132
+ if (entry.timeout !== undefined)
133
+ clearTimeout(entry.timeout);
134
+ if (entry.signal && entry.abortHandler)
135
+ entry.signal.removeEventListener('abort', entry.abortHandler);
136
+ }
137
+ #requireOpen() { if (this.#state !== 'OPEN')
138
+ throw new errors_js_1.ClusterStateError(`connection is ${this.#state.toLowerCase()}`, `CONNECTION_${this.#state}`); }
139
+ async #sendFrame(value, allowClosing = false) {
140
+ if (this.#state === 'CLOSED' || (!allowClosing && this.#state !== 'OPEN'))
141
+ throw new errors_js_1.ClusterStateError(`connection is ${this.#state.toLowerCase()}`, `CONNECTION_${this.#state}`);
142
+ const payload = JSON.stringify(value);
143
+ if (this.#socket.send.length >= 2) {
144
+ await new Promise((resolve, reject) => { try {
145
+ this.#socket.send(payload, (error) => error ? reject(error) : resolve());
146
+ }
147
+ catch (error) {
148
+ reject(error);
149
+ } });
150
+ return;
151
+ }
152
+ const sent = this.#socket.send(payload);
153
+ if (sent && typeof sent.then === 'function')
154
+ await sent;
155
+ }
156
+ #sendNotification(method, params) {
157
+ return this.#sendFrame({ jsonrpc: protocol_js_1.JSON_RPC_VERSION, method, params }, true);
158
+ }
159
+ #onMessage(event) {
160
+ if (this.#state !== 'OPEN')
161
+ return;
162
+ const inbound = (0, frames_js_1.boundedFrameText)(event, protocol_js_1.MAX_FRAME_BYTES);
163
+ if (inbound.kind === 'unsupported') {
164
+ this.#recordProtocolError('WebSocket message is not text or bytes');
165
+ return;
166
+ }
167
+ if (inbound.kind === 'oversized') {
168
+ this.#recordProtocolError(`frame exceeds ${protocol_js_1.MAX_FRAME_BYTES} bytes`);
169
+ return;
170
+ }
171
+ const { text, bytes } = inbound;
172
+ let frame;
173
+ try {
174
+ frame = JSON.parse(text);
175
+ }
176
+ catch (cause) {
177
+ this.#recordProtocolError('invalid JSON frame', cause);
178
+ return;
179
+ }
180
+ if (!(0, frames_js_1.isRecord)(frame)) {
181
+ this.#recordProtocolError('invalid JSON-RPC frame');
182
+ return;
183
+ }
184
+ if ('id' in frame) {
185
+ this.#routeResponse(frame);
186
+ return;
187
+ }
188
+ if (frame.jsonrpc !== protocol_js_1.JSON_RPC_VERSION) {
189
+ this.#recordProtocolError('invalid JSON-RPC frame');
190
+ return;
191
+ }
192
+ if (typeof frame.method === 'string' && (0, frames_js_1.isRecord)(frame.params)) {
193
+ this.#routeNotification(frame.method, frame.params, frame, bytes);
194
+ return;
195
+ }
196
+ this.#recordProtocolError('unrecognized JSON-RPC frame');
197
+ }
198
+ #routeResponse(frame) {
199
+ if (typeof frame.id !== 'string') {
200
+ this.#recordProtocolError('response id is not a string');
201
+ return;
202
+ }
203
+ const entry = this.#pending.get(frame.id);
204
+ if (!entry) {
205
+ this.#reapLateSubscription(frame.id, frame.result);
206
+ return;
207
+ }
208
+ this.#removeExact(frame.id, entry);
209
+ this.#settleEntry(entry);
210
+ if (frame.id !== entry.expectedId || frame.jsonrpc !== protocol_js_1.JSON_RPC_VERSION) {
211
+ entry.reject(new errors_js_1.ClusterProtocolError('response identity mismatch', 'INVALID_RESPONSE_IDENTITY'));
212
+ return;
213
+ }
214
+ if ((0, frames_js_1.isRecord)(frame.error)) {
215
+ this.#routeRpcError(entry, frame.error);
216
+ return;
217
+ }
218
+ this.#routeSuccess(entry, frame);
219
+ }
220
+ #reapLateSubscription(id, result) {
221
+ if (!this.#lateSubscriptionReapers.delete(id) || !(0, frames_js_1.isRecord)(result))
222
+ return;
223
+ if (typeof result.subscriptionId !== 'string')
224
+ return;
225
+ void this.#sendNotification('subscription/cancel', { subscriptionId: result.subscriptionId })
226
+ .catch((error) => this.recordDiagnostic(error));
227
+ }
228
+ #routeRpcError(entry, error) {
229
+ try {
230
+ (0, validators_js_1.assertDefinition)('JsonRpcError', error);
231
+ }
232
+ catch (cause) {
233
+ entry.reject(cause);
234
+ return;
235
+ }
236
+ const data = (0, frames_js_1.isRecord)(error.data) ? error.data : undefined;
237
+ entry.reject(new errors_js_1.ClusterRpcError(error.code, error.message, data));
238
+ }
239
+ #routeSuccess(entry, frame) {
240
+ if (!('result' in frame)) {
241
+ entry.reject(new errors_js_1.ClusterProtocolError('response has neither result nor error', 'INVALID_RESPONSE'));
242
+ return;
243
+ }
244
+ try {
245
+ (0, validators_js_1.assertMethodResult)(entry.method, frame.result);
246
+ }
247
+ catch (error) {
248
+ if (entry.subscriptionKind && (0, frames_js_1.isRecord)(frame.result) && typeof frame.result.subscriptionId === 'string') {
249
+ void this.#sendNotification('subscription/cancel', { subscriptionId: frame.result.subscriptionId })
250
+ .catch((cause) => this.recordDiagnostic(cause));
251
+ }
252
+ entry.reject(error);
253
+ return;
254
+ }
255
+ if (!entry.subscriptionKind) {
256
+ entry.resolve(frame.result);
257
+ return;
258
+ }
259
+ const result = frame.result;
260
+ const registration = {
261
+ id: result.subscriptionId, kind: entry.subscriptionKind,
262
+ queue: new queue_js_1.BoundedQueue(), overflowed: false, cancelSent: false,
263
+ };
264
+ if (this.#subscriptions.has(registration.id)) {
265
+ entry.reject(new errors_js_1.ClusterProtocolError('duplicate subscriptionId', 'DUPLICATE_SUBSCRIPTION'));
266
+ return;
267
+ }
268
+ this.#ownedSubscriptions.add(registration);
269
+ this.#subscriptions.set(registration.id, registration);
270
+ this.#armSubscriptionAbort(registration, entry.signal);
271
+ entry.resolve({ result, registration });
272
+ }
273
+ #armSubscriptionAbort(registration, signal) {
274
+ if (!signal)
275
+ return;
276
+ const onAbort = () => {
277
+ if (this.#subscriptions.get(registration.id) !== registration)
278
+ return;
279
+ this.unregisterSubscription(registration.id, registration);
280
+ registration.queue.closeAndDiscard();
281
+ void this.cancelSubscription(registration).catch((error) => this.recordDiagnostic(error));
282
+ };
283
+ registration.abortSignal = signal;
284
+ registration.abortHandler = onAbort;
285
+ signal.addEventListener('abort', onAbort, { once: true });
286
+ if (signal.aborted)
287
+ onAbort();
288
+ }
289
+ #disarmSubscriptionAbort(registration) {
290
+ if (registration.abortSignal && registration.abortHandler) {
291
+ registration.abortSignal.removeEventListener('abort', registration.abortHandler);
292
+ }
293
+ delete registration.abortSignal;
294
+ delete registration.abortHandler;
295
+ }
296
+ #routeNotification(method, params, frame, bytes) {
297
+ const subscriptionId = params.subscriptionId;
298
+ if (typeof subscriptionId !== 'string') {
299
+ this.#recordProtocolError('subscription notification has no subscriptionId');
300
+ return;
301
+ }
302
+ const registration = this.#subscriptions.get(subscriptionId);
303
+ if (!registration)
304
+ return;
305
+ const terminal = method === 'subscription/closed';
306
+ const outcome = registration.queue.push(frame, bytes);
307
+ if (outcome === 'overflow') {
308
+ registration.overflowed = true;
309
+ this.unregisterSubscription(subscriptionId, registration);
310
+ registration.queue.endRetainingBuffer();
311
+ if (!terminal)
312
+ void this.cancelSubscription(registration).catch((error) => this.recordDiagnostic(error));
313
+ return;
314
+ }
315
+ if (terminal) {
316
+ this.unregisterSubscription(subscriptionId, registration);
317
+ registration.queue.endRetainingBuffer();
318
+ }
319
+ }
320
+ #recordProtocolError(message, cause) {
321
+ if (this.protocolDiagnostics.length === exports.PROTOCOL_DIAGNOSTIC_CAPACITY)
322
+ this.protocolDiagnostics.shift();
323
+ this.protocolDiagnostics.push(new errors_js_1.ClusterProtocolError(message, 'INVALID_PEER_FRAME', cause === undefined ? undefined : { cause }));
324
+ }
325
+ #startClose(sendCancels) {
326
+ if (this.#closePromise)
327
+ return this.#closePromise;
328
+ if (this.#state === 'CLOSED')
329
+ return Promise.resolve();
330
+ this.#transition('CLOSING');
331
+ this.#closePromise = Promise.resolve().then(() => this.#finishClose(sendCancels));
332
+ return this.#closePromise;
333
+ }
334
+ async #finishClose(sendCancels) {
335
+ const subscriptions = [...this.#subscriptions.values()];
336
+ this.#subscriptions.clear();
337
+ for (const subscription of subscriptions) {
338
+ this.#disarmSubscriptionAbort(subscription);
339
+ subscription.queue.closeAndDiscard();
340
+ }
341
+ const pending = [...this.#pending.values()];
342
+ this.#pending.clear();
343
+ for (const entry of pending) {
344
+ this.#settleEntry(entry);
345
+ entry.reject(new errors_js_1.ClusterTransportError('connection closed', 'CONNECTION_CLOSED'));
346
+ }
347
+ this.#lateSubscriptionReapers.clear();
348
+ if (sendCancels)
349
+ for (const subscription of subscriptions) {
350
+ try {
351
+ await this.cancelSubscription(subscription);
352
+ }
353
+ catch (error) {
354
+ this.recordDiagnostic(error);
355
+ }
356
+ }
357
+ try {
358
+ await this.#socket.close();
359
+ }
360
+ catch (error) {
361
+ this.recordDiagnostic(error);
362
+ }
363
+ for (const remove of this.#removeSocketListeners.splice(0)) {
364
+ try {
365
+ remove();
366
+ }
367
+ catch (error) {
368
+ this.recordDiagnostic(error);
369
+ }
370
+ }
371
+ this.#transition('CLOSED');
372
+ }
373
+ #transition(to) {
374
+ if (!exports.CONNECTION_TRANSITIONS[this.#state].includes(to))
375
+ throw new errors_js_1.ClusterInternalError(`illegal connection transition ${this.#state} -> ${to}`, 'ILLEGAL_STATE_TRANSITION');
376
+ this.#state = to;
377
+ }
378
+ }
379
+ exports.Connection = Connection;
380
+ Object.defineProperty(Connection.prototype, Symbol.asyncDispose, {
381
+ configurable: true, value: Connection.prototype.close,
382
+ });
@@ -0,0 +1,41 @@
1
+ import type { ClusterMethodParams, ClusterMethodResults, SubscriptionMethod, UnaryClusterMethod } from './generated/protocol.js';
2
+ import { ClusterProtocolError } from './errors.js';
3
+ import type { FrameRecord } from './frames.js';
4
+ import { BoundedQueue } from './queue.js';
5
+ import type { WebSocketLike } from './socket.js';
6
+ export type ConnectionState = 'OPEN' | 'CLOSING' | 'CLOSED';
7
+ export declare const CONNECTION_TRANSITIONS: Readonly<Record<ConnectionState, readonly ConnectionState[]>>;
8
+ export declare const PROTOCOL_DIAGNOSTIC_CAPACITY = 128;
9
+ export interface CallOptions {
10
+ readonly signal?: AbortSignal;
11
+ readonly requestTimeoutMs?: number;
12
+ }
13
+ export type SubscriptionKind = 'watch' | 'logs' | 'agent/attach';
14
+ export type SubscriptionRegistration = {
15
+ readonly id: string;
16
+ readonly kind: SubscriptionKind;
17
+ readonly queue: BoundedQueue<FrameRecord>;
18
+ overflowed: boolean;
19
+ cancelSent: boolean;
20
+ abortHandler?: () => void;
21
+ abortSignal?: AbortSignal;
22
+ };
23
+ export type EstablishedSubscription<R> = {
24
+ readonly result: R;
25
+ readonly registration: SubscriptionRegistration;
26
+ };
27
+ export declare class Connection {
28
+ #private;
29
+ readonly closeDiagnostics: unknown[];
30
+ readonly protocolDiagnostics: ClusterProtocolError[];
31
+ constructor(socket: WebSocketLike);
32
+ get state(): ConnectionState;
33
+ get pendingSize(): number;
34
+ get subscriptionCount(): number;
35
+ call<M extends UnaryClusterMethod>(method: M, params: ClusterMethodParams[M], options?: CallOptions): Promise<ClusterMethodResults[M]>;
36
+ cancelSubscription(registration: SubscriptionRegistration): Promise<void>;
37
+ openSubscription<M extends SubscriptionMethod>(method: M, params: ClusterMethodParams[M], options?: CallOptions): Promise<EstablishedSubscription<ClusterMethodResults[M]>>;
38
+ unregisterSubscription(id: string, registration: SubscriptionRegistration): void;
39
+ recordDiagnostic(error: unknown): void;
40
+ close(): Promise<void>;
41
+ }