@source-repo/rpc-cli 3.0.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.
- package/LICENSE +21 -0
- package/README.md +1131 -0
- package/dist/bench.d.ts +66 -0
- package/dist/bench.d.ts.map +1 -0
- package/dist/bench.js +109 -0
- package/dist/bench.js.map +1 -0
- package/dist/broker.d.ts +61 -0
- package/dist/broker.d.ts.map +1 -0
- package/dist/broker.js +56 -0
- package/dist/broker.js.map +1 -0
- package/dist/bus.d.ts +142 -0
- package/dist/bus.d.ts.map +1 -0
- package/dist/bus.js +272 -0
- package/dist/bus.js.map +1 -0
- package/dist/bus.types.json +269 -0
- package/dist/conform.d.ts +75 -0
- package/dist/conform.d.ts.map +1 -0
- package/dist/conform.js +152 -0
- package/dist/conform.js.map +1 -0
- package/dist/console.d.ts +285 -0
- package/dist/console.d.ts.map +1 -0
- package/dist/console.js +686 -0
- package/dist/console.js.map +1 -0
- package/dist/console.types.json +1730 -0
- package/dist/extract.d.ts +37 -0
- package/dist/extract.d.ts.map +1 -0
- package/dist/extract.js +272 -0
- package/dist/extract.js.map +1 -0
- package/dist/fake.d.ts +58 -0
- package/dist/fake.d.ts.map +1 -0
- package/dist/fake.js +164 -0
- package/dist/fake.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +905 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp.d.ts +15 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +507 -0
- package/dist/mcp.js.map +1 -0
- package/dist/network.d.ts +58 -0
- package/dist/network.d.ts.map +1 -0
- package/dist/network.js +64 -0
- package/dist/network.js.map +1 -0
- package/dist/record.d.ts +74 -0
- package/dist/record.d.ts.map +1 -0
- package/dist/record.js +221 -0
- package/dist/record.js.map +1 -0
- package/dist/tapping.d.ts +11 -0
- package/dist/tapping.d.ts.map +1 -0
- package/dist/tapping.js +71 -0
- package/dist/tapping.js.map +1 -0
- package/dist/verbs.d.ts +59 -0
- package/dist/verbs.d.ts.map +1 -0
- package/dist/verbs.js +324 -0
- package/dist/verbs.js.map +1 -0
- package/dist/web/app.css +1 -0
- package/dist/web/app.js +2063 -0
- package/dist/web/app.js.map +1 -0
- package/dist/web/index.html +13 -0
- package/package.json +65 -0
package/dist/bus.js
ADDED
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
2
|
+
var useValue = arguments.length > 2;
|
|
3
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
4
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
5
|
+
}
|
|
6
|
+
return useValue ? value : void 0;
|
|
7
|
+
};
|
|
8
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
9
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
10
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
11
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
12
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
13
|
+
var _, done = false;
|
|
14
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
15
|
+
var context = {};
|
|
16
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
17
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
18
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
19
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
20
|
+
if (kind === "accessor") {
|
|
21
|
+
if (result === void 0) continue;
|
|
22
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
23
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
24
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
25
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
26
|
+
}
|
|
27
|
+
else if (_ = accept(result)) {
|
|
28
|
+
if (kind === "field") initializers.unshift(_);
|
|
29
|
+
else descriptor[key] = _;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
33
|
+
done = true;
|
|
34
|
+
};
|
|
35
|
+
import { EventEmitter } from 'events';
|
|
36
|
+
import { rpc, rpcNamespace, RpcMessageType } from '@source-repo/rpc';
|
|
37
|
+
/** Exported so the console can give its own record of a tap the same life as the tap itself. */
|
|
38
|
+
export const DEFAULT_TAP_TTL = 300;
|
|
39
|
+
const DEFAULT_TTL = DEFAULT_TAP_TTL;
|
|
40
|
+
const MAX_TTL = 3600;
|
|
41
|
+
/**
|
|
42
|
+
* How many calls are remembered while waiting for their replies. A call whose reply never comes
|
|
43
|
+
* would otherwise be held forever, and this runs on a bus with no upper bound on traffic.
|
|
44
|
+
*/
|
|
45
|
+
const MAX_PENDING = 5000;
|
|
46
|
+
/** The kinds, as the wire writes them, so a filter can name them without importing the enum. */
|
|
47
|
+
const KINDS = new Set([RpcMessageType.CallInstanceMethod, RpcMessageType.success, RpcMessageType.error, RpcMessageType.event]);
|
|
48
|
+
let BusService = (() => {
|
|
49
|
+
let _classDecorators = [rpcNamespace('bus', { version: '1' })];
|
|
50
|
+
let _classDescriptor;
|
|
51
|
+
let _classExtraInitializers = [];
|
|
52
|
+
let _classThis;
|
|
53
|
+
let _classSuper = EventEmitter;
|
|
54
|
+
let _instanceExtraInitializers = [];
|
|
55
|
+
let _tap_decorators;
|
|
56
|
+
let _untap_decorators;
|
|
57
|
+
let _taps_decorators;
|
|
58
|
+
var BusService = class extends _classSuper {
|
|
59
|
+
static { _classThis = this; }
|
|
60
|
+
static {
|
|
61
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
62
|
+
_tap_decorators = [rpc];
|
|
63
|
+
_untap_decorators = [rpc];
|
|
64
|
+
_taps_decorators = [rpc];
|
|
65
|
+
__esDecorate(this, null, _tap_decorators, { kind: "method", name: "tap", static: false, private: false, access: { has: obj => "tap" in obj, get: obj => obj.tap }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
66
|
+
__esDecorate(this, null, _untap_decorators, { kind: "method", name: "untap", static: false, private: false, access: { has: obj => "untap" in obj, get: obj => obj.untap }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
67
|
+
__esDecorate(this, null, _taps_decorators, { kind: "method", name: "taps", static: false, private: false, access: { has: obj => "taps" in obj, get: obj => obj.taps }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
68
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
69
|
+
BusService = _classThis = _classDescriptor.value;
|
|
70
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
71
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
72
|
+
}
|
|
73
|
+
busName = __runInitializers(this, _instanceExtraInitializers);
|
|
74
|
+
active = new Map();
|
|
75
|
+
/** Calls seen and not yet answered, so a reply can be given the time it took and the method. */
|
|
76
|
+
pending = new Map();
|
|
77
|
+
counter = 0;
|
|
78
|
+
constructor(
|
|
79
|
+
/** Named in what `taps()` reports, so a reader knows which broker they are looking at. */
|
|
80
|
+
busName) {
|
|
81
|
+
super();
|
|
82
|
+
this.busName = busName;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Opened when the first tap starts and closed after the last one ends, for a source that costs
|
|
86
|
+
* something to hold open - an MQTT subscription to every peer's traffic, in particular. A broker
|
|
87
|
+
* needs none of this: it is already forwarding the frames, and `observe` returns on its first
|
|
88
|
+
* line when nothing is watching.
|
|
89
|
+
*/
|
|
90
|
+
onDemand;
|
|
91
|
+
/**
|
|
92
|
+
* Starts or stops the source to match whether anything is watching.
|
|
93
|
+
*
|
|
94
|
+
* Failures on the way down are swallowed and failures on the way up are not: a tap that could
|
|
95
|
+
* not subscribe has to say so, or it reports an empty network and looks like a quiet one.
|
|
96
|
+
*/
|
|
97
|
+
async settleSource(wasActive) {
|
|
98
|
+
const active = this.active.size > 0;
|
|
99
|
+
if (active === wasActive || !this.onDemand)
|
|
100
|
+
return;
|
|
101
|
+
if (active)
|
|
102
|
+
await this.onDemand.start();
|
|
103
|
+
else
|
|
104
|
+
await this.onDemand.stop().catch(() => undefined);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Start watching. Returns a token: several people can tap at once with different filters, and
|
|
108
|
+
* untapping has to remove yours rather than everyone's.
|
|
109
|
+
*/
|
|
110
|
+
async tap(filter) {
|
|
111
|
+
const requested = filter ?? {};
|
|
112
|
+
for (const kind of requested.kinds ?? [])
|
|
113
|
+
if (!KINDS.has(kind))
|
|
114
|
+
throw Object.assign(new Error(`unknown kind '${kind}'`), { code: 'InvalidParams' });
|
|
115
|
+
// Bounded rather than taken as given: a ttl of a year is a leak with a number on it.
|
|
116
|
+
const ttl = Math.min(Math.max(requested.ttl ?? DEFAULT_TTL, 1), MAX_TTL);
|
|
117
|
+
const token = `tap-${++this.counter}`;
|
|
118
|
+
const wasActive = this.active.size > 0;
|
|
119
|
+
this.active.set(token, { token, filter: { ...requested, ttl }, expires: Date.now() + ttl * 1000, frames: 0 });
|
|
120
|
+
try {
|
|
121
|
+
await this.settleSource(wasActive);
|
|
122
|
+
}
|
|
123
|
+
catch (e) {
|
|
124
|
+
// Rolled back rather than left as a tap watching nothing, which would report a quiet
|
|
125
|
+
// network instead of a source that could not be opened.
|
|
126
|
+
this.active.delete(token);
|
|
127
|
+
throw e;
|
|
128
|
+
}
|
|
129
|
+
return { token, expires: Date.now() + ttl * 1000, filter: { ...requested, ttl } };
|
|
130
|
+
}
|
|
131
|
+
async untap(token) {
|
|
132
|
+
const wasActive = this.active.size > 0;
|
|
133
|
+
const had = this.active.delete(token);
|
|
134
|
+
if (!this.active.size)
|
|
135
|
+
this.pending.clear();
|
|
136
|
+
await this.settleSource(wasActive);
|
|
137
|
+
return { tapping: false, already: !had };
|
|
138
|
+
}
|
|
139
|
+
/** Who is watching what, including how much each tap has seen. */
|
|
140
|
+
async taps() {
|
|
141
|
+
this.expire();
|
|
142
|
+
return { bus: this.busName, taps: [...this.active.values()], pending: this.pending.size };
|
|
143
|
+
}
|
|
144
|
+
/** Whether anything is listening, so the broker can leave the transport hook unattached. */
|
|
145
|
+
get tapping() {
|
|
146
|
+
this.expire();
|
|
147
|
+
return this.active.size > 0;
|
|
148
|
+
}
|
|
149
|
+
expire() {
|
|
150
|
+
const now = Date.now();
|
|
151
|
+
const wasActive = this.active.size > 0;
|
|
152
|
+
for (const [token, record] of this.active)
|
|
153
|
+
if (record.expires <= now)
|
|
154
|
+
this.active.delete(token);
|
|
155
|
+
if (!this.active.size)
|
|
156
|
+
this.pending.clear();
|
|
157
|
+
// Not awaited: expiry is noticed from the frame path and from taps(), neither of which can
|
|
158
|
+
// wait on a broker connection closing. Failures on the way down are swallowed anyway.
|
|
159
|
+
if (wasActive && !this.active.size)
|
|
160
|
+
void this.settleSource(wasActive);
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* One relayed frame, from the transport that forwarded it.
|
|
164
|
+
*
|
|
165
|
+
* Everything here is best-effort reading of someone else's message: a frame whose payload is
|
|
166
|
+
* not the shape we expect is reported with what could be read rather than dropped, since a
|
|
167
|
+
* malformed frame on the bus is exactly the sort of thing a tap exists to show.
|
|
168
|
+
*/
|
|
169
|
+
observe(relayed) {
|
|
170
|
+
this.expire();
|
|
171
|
+
if (!this.active.size)
|
|
172
|
+
return;
|
|
173
|
+
const frame = this.readFrame(relayed);
|
|
174
|
+
if (!frame)
|
|
175
|
+
return;
|
|
176
|
+
const matched = [...this.active.values()].filter((record) => this.matches(record.filter, frame));
|
|
177
|
+
if (!matched.length)
|
|
178
|
+
return;
|
|
179
|
+
// Payloads are carried only if at least one of the taps that matched asked for them.
|
|
180
|
+
if (!matched.some((record) => record.filter.payloads)) {
|
|
181
|
+
delete frame.params;
|
|
182
|
+
delete frame.result;
|
|
183
|
+
}
|
|
184
|
+
frame.taps = matched.map((record) => record.token);
|
|
185
|
+
for (const record of matched)
|
|
186
|
+
record.frames++;
|
|
187
|
+
this.emit('frame', frame);
|
|
188
|
+
}
|
|
189
|
+
matches(filter, frame) {
|
|
190
|
+
if (filter.peer && frame.source !== filter.peer && frame.target !== filter.peer)
|
|
191
|
+
return false;
|
|
192
|
+
if (filter.namespace && frame.namespace !== filter.namespace)
|
|
193
|
+
return false;
|
|
194
|
+
if (filter.kinds?.length && !filter.kinds.includes(frame.kind))
|
|
195
|
+
return false;
|
|
196
|
+
return true;
|
|
197
|
+
}
|
|
198
|
+
readFrame({ source, target, message }) {
|
|
199
|
+
const payload = message.payload;
|
|
200
|
+
if (!payload || typeof payload !== 'object' || typeof payload.type !== 'string')
|
|
201
|
+
return undefined;
|
|
202
|
+
const at = Date.now();
|
|
203
|
+
const frame = { at, source, target, kind: payload.type, taps: [] };
|
|
204
|
+
switch (payload.type) {
|
|
205
|
+
case RpcMessageType.CallInstanceMethod: {
|
|
206
|
+
const call = payload;
|
|
207
|
+
frame.namespace = call.path;
|
|
208
|
+
frame.method = call.method;
|
|
209
|
+
frame.id = call.id;
|
|
210
|
+
frame.params = call.params;
|
|
211
|
+
// Remembered so the reply can be given a duration and the method it answers.
|
|
212
|
+
if (this.pending.size >= MAX_PENDING) {
|
|
213
|
+
const oldest = this.pending.keys().next();
|
|
214
|
+
if (!oldest.done)
|
|
215
|
+
this.pending.delete(oldest.value);
|
|
216
|
+
}
|
|
217
|
+
if (call.id)
|
|
218
|
+
this.pending.set(call.id, { at, namespace: call.path, method: call.method, source });
|
|
219
|
+
break;
|
|
220
|
+
}
|
|
221
|
+
case RpcMessageType.success: {
|
|
222
|
+
const success = payload;
|
|
223
|
+
frame.id = success.id;
|
|
224
|
+
frame.result = success.result;
|
|
225
|
+
this.pair(frame);
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
228
|
+
case RpcMessageType.error: {
|
|
229
|
+
const failure = payload;
|
|
230
|
+
frame.id = failure.id;
|
|
231
|
+
frame.code = failure.code;
|
|
232
|
+
frame.error = failure.error?.message;
|
|
233
|
+
this.pair(frame);
|
|
234
|
+
break;
|
|
235
|
+
}
|
|
236
|
+
case RpcMessageType.event: {
|
|
237
|
+
const event = payload;
|
|
238
|
+
frame.event = event.event;
|
|
239
|
+
frame.namespace = event.path;
|
|
240
|
+
frame.params = event.params;
|
|
241
|
+
break;
|
|
242
|
+
}
|
|
243
|
+
default:
|
|
244
|
+
// An unrecognised kind is still traffic, and still worth showing.
|
|
245
|
+
break;
|
|
246
|
+
}
|
|
247
|
+
return frame;
|
|
248
|
+
}
|
|
249
|
+
/** Fills in what a reply does not carry: the method it answers, and how long it took. */
|
|
250
|
+
pair(frame) {
|
|
251
|
+
if (!frame.id)
|
|
252
|
+
return;
|
|
253
|
+
const call = this.pending.get(frame.id);
|
|
254
|
+
if (!call)
|
|
255
|
+
return;
|
|
256
|
+
this.pending.delete(frame.id);
|
|
257
|
+
frame.ms = frame.at - call.at;
|
|
258
|
+
frame.namespace = call.namespace;
|
|
259
|
+
frame.method = call.method;
|
|
260
|
+
}
|
|
261
|
+
/** Drops every tap, so a broker shutting down stops building frames for nobody. */
|
|
262
|
+
async releaseAll() {
|
|
263
|
+
const wasActive = this.active.size > 0;
|
|
264
|
+
this.active.clear();
|
|
265
|
+
this.pending.clear();
|
|
266
|
+
await this.settleSource(wasActive);
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
return BusService = _classThis;
|
|
270
|
+
})();
|
|
271
|
+
export { BusService };
|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,CAAA;YACtC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAA;YACnB,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAA;YACpB,MAAM,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAA;QACtC,CAAC;;;;SA/LQ,UAAU"}
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": 1,
|
|
3
|
+
"types": {
|
|
4
|
+
"TapFilter": {
|
|
5
|
+
"kind": "object",
|
|
6
|
+
"fields": {
|
|
7
|
+
"peer": {
|
|
8
|
+
"type": {
|
|
9
|
+
"kind": "string"
|
|
10
|
+
},
|
|
11
|
+
"optional": true
|
|
12
|
+
},
|
|
13
|
+
"namespace": {
|
|
14
|
+
"type": {
|
|
15
|
+
"kind": "string"
|
|
16
|
+
},
|
|
17
|
+
"optional": true
|
|
18
|
+
},
|
|
19
|
+
"kinds": {
|
|
20
|
+
"type": {
|
|
21
|
+
"kind": "array",
|
|
22
|
+
"items": {
|
|
23
|
+
"kind": "string"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"optional": true
|
|
27
|
+
},
|
|
28
|
+
"payloads": {
|
|
29
|
+
"type": {
|
|
30
|
+
"kind": "boolean"
|
|
31
|
+
},
|
|
32
|
+
"optional": true
|
|
33
|
+
},
|
|
34
|
+
"ttl": {
|
|
35
|
+
"type": {
|
|
36
|
+
"kind": "number"
|
|
37
|
+
},
|
|
38
|
+
"optional": true
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"TapRecord": {
|
|
43
|
+
"kind": "object",
|
|
44
|
+
"fields": {
|
|
45
|
+
"token": {
|
|
46
|
+
"type": {
|
|
47
|
+
"kind": "string"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"filter": {
|
|
51
|
+
"type": {
|
|
52
|
+
"kind": "ref",
|
|
53
|
+
"name": "TapFilter"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"expires": {
|
|
57
|
+
"type": {
|
|
58
|
+
"kind": "number"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"frames": {
|
|
62
|
+
"type": {
|
|
63
|
+
"kind": "number"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"TappedFrame": {
|
|
69
|
+
"kind": "object",
|
|
70
|
+
"fields": {
|
|
71
|
+
"at": {
|
|
72
|
+
"type": {
|
|
73
|
+
"kind": "number"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"source": {
|
|
77
|
+
"type": {
|
|
78
|
+
"kind": "string"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"target": {
|
|
82
|
+
"type": {
|
|
83
|
+
"kind": "string"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"kind": {
|
|
87
|
+
"type": {
|
|
88
|
+
"kind": "string"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"namespace": {
|
|
92
|
+
"type": {
|
|
93
|
+
"kind": "string"
|
|
94
|
+
},
|
|
95
|
+
"optional": true
|
|
96
|
+
},
|
|
97
|
+
"method": {
|
|
98
|
+
"type": {
|
|
99
|
+
"kind": "string"
|
|
100
|
+
},
|
|
101
|
+
"optional": true
|
|
102
|
+
},
|
|
103
|
+
"event": {
|
|
104
|
+
"type": {
|
|
105
|
+
"kind": "string"
|
|
106
|
+
},
|
|
107
|
+
"optional": true
|
|
108
|
+
},
|
|
109
|
+
"id": {
|
|
110
|
+
"type": {
|
|
111
|
+
"kind": "string"
|
|
112
|
+
},
|
|
113
|
+
"optional": true
|
|
114
|
+
},
|
|
115
|
+
"ms": {
|
|
116
|
+
"type": {
|
|
117
|
+
"kind": "number"
|
|
118
|
+
},
|
|
119
|
+
"optional": true
|
|
120
|
+
},
|
|
121
|
+
"code": {
|
|
122
|
+
"type": {
|
|
123
|
+
"kind": "string"
|
|
124
|
+
},
|
|
125
|
+
"optional": true
|
|
126
|
+
},
|
|
127
|
+
"error": {
|
|
128
|
+
"type": {
|
|
129
|
+
"kind": "string"
|
|
130
|
+
},
|
|
131
|
+
"optional": true
|
|
132
|
+
},
|
|
133
|
+
"params": {
|
|
134
|
+
"type": {
|
|
135
|
+
"kind": "array",
|
|
136
|
+
"items": {
|
|
137
|
+
"kind": "any"
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"optional": true
|
|
141
|
+
},
|
|
142
|
+
"result": {
|
|
143
|
+
"type": {
|
|
144
|
+
"kind": "any"
|
|
145
|
+
},
|
|
146
|
+
"optional": true
|
|
147
|
+
},
|
|
148
|
+
"taps": {
|
|
149
|
+
"type": {
|
|
150
|
+
"kind": "array",
|
|
151
|
+
"items": {
|
|
152
|
+
"kind": "string"
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"namespaces": {
|
|
160
|
+
"bus": {
|
|
161
|
+
"version": "1",
|
|
162
|
+
"methods": {
|
|
163
|
+
"tap": {
|
|
164
|
+
"params": [
|
|
165
|
+
{
|
|
166
|
+
"kind": "union",
|
|
167
|
+
"options": [
|
|
168
|
+
{
|
|
169
|
+
"kind": "ref",
|
|
170
|
+
"name": "TapFilter"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"kind": "literal",
|
|
174
|
+
"value": null
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
}
|
|
178
|
+
],
|
|
179
|
+
"paramNames": [
|
|
180
|
+
"filter"
|
|
181
|
+
],
|
|
182
|
+
"returns": {
|
|
183
|
+
"kind": "object",
|
|
184
|
+
"fields": {
|
|
185
|
+
"token": {
|
|
186
|
+
"type": {
|
|
187
|
+
"kind": "string"
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
"expires": {
|
|
191
|
+
"type": {
|
|
192
|
+
"kind": "number"
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
"filter": {
|
|
196
|
+
"type": {
|
|
197
|
+
"kind": "ref",
|
|
198
|
+
"name": "TapFilter"
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
"untap": {
|
|
205
|
+
"params": [
|
|
206
|
+
{
|
|
207
|
+
"kind": "string"
|
|
208
|
+
}
|
|
209
|
+
],
|
|
210
|
+
"paramNames": [
|
|
211
|
+
"token"
|
|
212
|
+
],
|
|
213
|
+
"returns": {
|
|
214
|
+
"kind": "object",
|
|
215
|
+
"fields": {
|
|
216
|
+
"tapping": {
|
|
217
|
+
"type": {
|
|
218
|
+
"kind": "boolean"
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
"already": {
|
|
222
|
+
"type": {
|
|
223
|
+
"kind": "boolean"
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
"taps": {
|
|
230
|
+
"params": [],
|
|
231
|
+
"returns": {
|
|
232
|
+
"kind": "object",
|
|
233
|
+
"fields": {
|
|
234
|
+
"bus": {
|
|
235
|
+
"type": {
|
|
236
|
+
"kind": "string"
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
"taps": {
|
|
240
|
+
"type": {
|
|
241
|
+
"kind": "array",
|
|
242
|
+
"items": {
|
|
243
|
+
"kind": "ref",
|
|
244
|
+
"name": "TapRecord"
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
"pending": {
|
|
249
|
+
"type": {
|
|
250
|
+
"kind": "number"
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
"events": {
|
|
258
|
+
"frame": {
|
|
259
|
+
"params": [
|
|
260
|
+
{
|
|
261
|
+
"kind": "ref",
|
|
262
|
+
"name": "TappedFrame"
|
|
263
|
+
}
|
|
264
|
+
]
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { type Incompatibility, type RpcSchema, type ServerDescription } from '@source-repo/rpc';
|
|
2
|
+
import { type ConnectedNetwork, type NetworkOptions } from './network.js';
|
|
3
|
+
/**
|
|
4
|
+
* A live peer's self-description as a schema the compatibility check can read.
|
|
5
|
+
*
|
|
6
|
+
* The two are nearly the same information in different shapes - describe() returns lists because a
|
|
7
|
+
* console renders them in order, a schema uses dictionaries because dispatch looks methods up by
|
|
8
|
+
* name.
|
|
9
|
+
*/
|
|
10
|
+
export declare const schemaFromDescription: (description: ServerDescription) => RpcSchema;
|
|
11
|
+
export interface ConformanceProblem extends Incompatibility {
|
|
12
|
+
namespace: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ConformanceReport {
|
|
15
|
+
peer: string;
|
|
16
|
+
/** True when the peer serves its methods without a published contract, so nothing was compared. */
|
|
17
|
+
undescribed: string[];
|
|
18
|
+
problems: ConformanceProblem[];
|
|
19
|
+
/** Namespaces the stored contract has and the peer does not serve at all. */
|
|
20
|
+
missing: string[];
|
|
21
|
+
checked: string[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Compares what a peer says it serves with the contract callers were built against.
|
|
25
|
+
*
|
|
26
|
+
* The stored contract is the caller's side and the device is the current side, which is the same
|
|
27
|
+
* orientation `check` uses against source - so "argument 0 narrowed" means the same thing here as
|
|
28
|
+
* it does in CI, and means it about the box rather than the branch.
|
|
29
|
+
*/
|
|
30
|
+
export declare const checkPeerOn: (connected: ConnectedNetwork, options: {
|
|
31
|
+
peer: string;
|
|
32
|
+
stored: RpcSchema;
|
|
33
|
+
wait?: number;
|
|
34
|
+
}) => Promise<ConformanceReport>;
|
|
35
|
+
/** The same, opening a connection of its own - what the command line wants. */
|
|
36
|
+
export declare const checkPeer: (options: NetworkOptions & {
|
|
37
|
+
peer: string;
|
|
38
|
+
stored: RpcSchema;
|
|
39
|
+
wait?: number;
|
|
40
|
+
}) => Promise<ConformanceReport>;
|
|
41
|
+
export interface PeerDifference {
|
|
42
|
+
namespace: string;
|
|
43
|
+
/** The method or event, or undefined when a whole namespace is on one side only. */
|
|
44
|
+
member?: string;
|
|
45
|
+
/** How it reads on each side; absent means it is not there at all. */
|
|
46
|
+
left?: string;
|
|
47
|
+
right?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* What two live peers offer differently - the "why does cell 3 behave differently from cell 2"
|
|
51
|
+
* question, which is usually answered by one of them running last season's firmware.
|
|
52
|
+
*
|
|
53
|
+
* Signatures are compared as they read rather than structurally, because the answer is going to be
|
|
54
|
+
* read by a person standing in front of two cabinets.
|
|
55
|
+
*/
|
|
56
|
+
export declare const diffPeersOn: (connected: ConnectedNetwork, options: {
|
|
57
|
+
left: string;
|
|
58
|
+
right: string;
|
|
59
|
+
wait?: number;
|
|
60
|
+
}) => Promise<{
|
|
61
|
+
left: string;
|
|
62
|
+
right: string;
|
|
63
|
+
differences: PeerDifference[];
|
|
64
|
+
}>;
|
|
65
|
+
/** The same, opening a connection of its own - what the command line wants. */
|
|
66
|
+
export declare const diffPeers: (options: NetworkOptions & {
|
|
67
|
+
left: string;
|
|
68
|
+
right: string;
|
|
69
|
+
wait?: number;
|
|
70
|
+
}) => Promise<{
|
|
71
|
+
left: string;
|
|
72
|
+
right: string;
|
|
73
|
+
differences: PeerDifference[];
|
|
74
|
+
}>;
|
|
75
|
+
//# sourceMappingURL=conform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conform.d.ts","sourceRoot":"","sources":["../src/conform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,eAAe,EAAwB,KAAK,SAAS,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACxI,OAAO,EAA6B,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc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