@tikoci/centrs 0.1.1 → 0.1.3
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/CHANGELOG.md +107 -2
- package/GLOSSARY.txt +87 -0
- package/README.md +25 -9
- package/SECURITY.md +3 -3
- package/commands/AGENTS.md +3 -2
- package/commands/api/AGENTS.md +212 -0
- package/commands/api/README.md +177 -0
- package/commands/api/examples.md +428 -0
- package/commands/btest/README.md +56 -31
- package/commands/btest/examples.md +35 -10
- package/commands/check/README.md +371 -53
- package/commands/check/examples.md +390 -0
- package/commands/devices/README.md +177 -37
- package/commands/devices/examples.md +148 -0
- package/commands/execute/README.md +48 -7
- package/commands/execute/examples.md +90 -6
- package/commands/retrieve/README.md +37 -51
- package/commands/retrieve/examples.md +40 -9
- package/commands/settings/README.md +286 -22
- package/commands/settings/examples.md +408 -0
- package/commands/terminal/README.md +6 -0
- package/commands/transfer/README.md +32 -2
- package/commands/transfer/examples.md +66 -0
- package/docs/CONSTITUTION.md +40 -15
- package/docs/MATRIX.md +69 -142
- package/docs/errors/README.md +2 -1
- package/docs/errors/cdb/empty-selection.md +19 -0
- package/docs/errors/input/incomplete-gps.md +9 -0
- package/docs/errors/input/invalid-altitude.md +9 -0
- package/docs/errors/input/invalid-bbox.md +9 -0
- package/docs/errors/input/invalid-coordinate.md +9 -0
- package/docs/errors/input/invalid-radius.md +9 -0
- package/docs/errors/internal/settings-failed.md +9 -0
- package/docs/errors/routeros/btest-connection-count-single-stream.md +22 -0
- package/docs/errors/routeros/btest-udp-tx-size-ignored.md +15 -0
- package/docs/errors/settings/consequential-value.md +26 -0
- package/docs/errors/settings/invalid-boolean.md +21 -3
- package/docs/errors/settings/invalid-format.md +18 -3
- package/docs/errors/settings/invalid-integer.md +18 -3
- package/docs/errors/settings/invalid-timeout.md +20 -3
- package/docs/errors/settings/invalid-via.md +22 -3
- package/docs/errors/settings/reserved-key.md +29 -0
- package/docs/errors/settings/skip-env-file-active.md +25 -0
- package/docs/errors/settings/unknown-key.md +25 -0
- package/docs/errors/usage/fanout-not-supported.md +16 -0
- package/docs/errors/usage/invalid-method.md +23 -0
- package/package.json +9 -9
- package/src/api-fanout.ts +454 -0
- package/src/api.ts +1627 -0
- package/src/btest.ts +61 -1
- package/src/cli/api.ts +660 -0
- package/src/cli/btest.ts +20 -2
- package/src/cli/common.ts +75 -0
- package/src/cli/devices.ts +235 -6
- package/src/cli/discover.ts +3 -1
- package/src/cli/execute.ts +107 -6
- package/src/cli/mcp.ts +8 -1
- package/src/cli/retrieve.ts +135 -90
- package/src/cli/selection.ts +200 -0
- package/src/cli/settings.ts +286 -0
- package/src/cli/terminal.ts +22 -7
- package/src/cli/transfer.ts +171 -47
- package/src/cli.ts +29 -0
- package/src/core/error-catalog.ts +69 -0
- package/src/core/fanout.ts +301 -0
- package/src/core/inspect.ts +170 -0
- package/src/devices.ts +212 -20
- package/src/discover.ts +7 -2
- package/src/execute-fanout.ts +438 -0
- package/src/execute.ts +134 -70
- package/src/index.ts +166 -9
- package/src/mcp/config.ts +12 -2
- package/src/mcp/tools.ts +137 -2
- package/src/protocols/adapter.ts +357 -9
- package/src/protocols/btest-session.ts +279 -46
- package/src/protocols/btest.ts +6 -2
- package/src/protocols/index.ts +11 -5
- package/src/protocols/native-api.ts +223 -30
- package/src/resolver/cdb.ts +10 -2
- package/src/resolver/comment-kv.ts +58 -4
- package/src/resolver/config-file.ts +136 -0
- package/src/resolver/facts.ts +78 -0
- package/src/resolver/geo.ts +453 -0
- package/src/resolver/index.ts +46 -0
- package/src/resolver/mac.ts +12 -3
- package/src/resolver/selection.ts +304 -0
- package/src/resolver/settings.ts +54 -5
- package/src/resolver/target.ts +20 -2
- package/src/retrieve-fanout.ts +232 -268
- package/src/retrieve.ts +69 -94
- package/src/settings.ts +1078 -0
- package/src/terminal.ts +11 -1
- package/src/transfer-fanout.ts +527 -0
- package/src/transfer.ts +61 -11
- package/commands/stream/README.md +0 -70
package/src/btest.ts
CHANGED
|
@@ -138,6 +138,8 @@ export interface BtestClientData {
|
|
|
138
138
|
stopReason: BtestStopReason;
|
|
139
139
|
serverUdpPort?: number;
|
|
140
140
|
clientUdpPort?: number;
|
|
141
|
+
/** TCP data connections actually driven (1 + joined secondaries). */
|
|
142
|
+
activeConnections: number;
|
|
141
143
|
}
|
|
142
144
|
|
|
143
145
|
export interface BtestClientOperationMeta {
|
|
@@ -215,9 +217,37 @@ export async function btestClient(
|
|
|
215
217
|
controlPort,
|
|
216
218
|
};
|
|
217
219
|
|
|
220
|
+
const warnings: {
|
|
221
|
+
code: string;
|
|
222
|
+
message: string;
|
|
223
|
+
context?: Record<string, unknown>;
|
|
224
|
+
}[] = [];
|
|
225
|
+
|
|
218
226
|
try {
|
|
219
227
|
validateClientOptions(request);
|
|
220
228
|
|
|
229
|
+
// The btest wire command carries a single tx-size field; --remote-udp-tx-size
|
|
230
|
+
// and --local-udp-tx-size map to it separately only for receive (remote wins)
|
|
231
|
+
// and transmit (local wins). For both, localUdpTxSize wins and
|
|
232
|
+
// remoteUdpTxSize is silently discarded — warn when they differ so the user
|
|
233
|
+
// knows which size the server will actually use.
|
|
234
|
+
if (
|
|
235
|
+
protocol === "udp" &&
|
|
236
|
+
direction === "both" &&
|
|
237
|
+
request.remoteUdpTxSize !== undefined &&
|
|
238
|
+
request.localUdpTxSize !== undefined &&
|
|
239
|
+
request.remoteUdpTxSize !== request.localUdpTxSize
|
|
240
|
+
) {
|
|
241
|
+
warnings.push({
|
|
242
|
+
code: "routeros/btest-udp-tx-size-ignored",
|
|
243
|
+
message: `--remote-udp-tx-size (${request.remoteUdpTxSize}) is ignored for --direction both; the btest wire protocol carries a single tx-size and --local-udp-tx-size (${request.localUdpTxSize}) is used for both directions.`,
|
|
244
|
+
context: {
|
|
245
|
+
ignored: request.remoteUdpTxSize,
|
|
246
|
+
used: request.localUdpTxSize,
|
|
247
|
+
},
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
|
|
221
251
|
const cdbResolution = await resolveCdb(
|
|
222
252
|
{
|
|
223
253
|
targetInput: request.targetInput,
|
|
@@ -273,6 +303,9 @@ export async function btestClient(
|
|
|
273
303
|
? { statusIntervalMs: request.intervalMs }
|
|
274
304
|
: {}),
|
|
275
305
|
...(txSize !== undefined ? { txSize } : {}),
|
|
306
|
+
...(request.connectionCount !== undefined
|
|
307
|
+
? { tcpConnectionCount: request.connectionCount }
|
|
308
|
+
: {}),
|
|
276
309
|
...(request.localTxSpeed !== undefined
|
|
277
310
|
? { localTxSpeed: request.localTxSpeed }
|
|
278
311
|
: {}),
|
|
@@ -301,6 +334,7 @@ export async function btestClient(
|
|
|
301
334
|
txTotalAvgBps: secs > 0 ? (summary.totalTxBytes * 8) / secs : 0,
|
|
302
335
|
rxTotalAvgBps: secs > 0 ? (summary.totalRxBytes * 8) / secs : 0,
|
|
303
336
|
stopReason: summary.stopReason,
|
|
337
|
+
activeConnections: summary.activeConnections,
|
|
304
338
|
};
|
|
305
339
|
if (summary.username !== undefined) data.user = summary.username;
|
|
306
340
|
if (summary.serverUdpPort !== undefined)
|
|
@@ -308,10 +342,36 @@ export async function btestClient(
|
|
|
308
342
|
if (summary.clientUdpPort !== undefined)
|
|
309
343
|
data.clientUdpPort = summary.clientUdpPort;
|
|
310
344
|
|
|
345
|
+
// TCP multi-connection: centrs now opens the negotiated extra data
|
|
346
|
+
// connections (fan-out). It still degrades to a single stream when the server
|
|
347
|
+
// negotiates no session token — notably authenticated (EC-SRP5) sessions,
|
|
348
|
+
// whose post-auth token centrs does not yet capture. Warn only when the
|
|
349
|
+
// realized fan-out fell short of the request, with the actual count.
|
|
350
|
+
if (
|
|
351
|
+
protocol === "tcp" &&
|
|
352
|
+
request.connectionCount !== undefined &&
|
|
353
|
+
request.connectionCount > 1 &&
|
|
354
|
+
summary.activeConnections < request.connectionCount
|
|
355
|
+
) {
|
|
356
|
+
const single = summary.activeConnections === 1;
|
|
357
|
+
warnings.push({
|
|
358
|
+
code: "routeros/btest-connection-count-single-stream",
|
|
359
|
+
message: `--connection-count (${request.connectionCount}) requested, but ${summary.activeConnections} TCP data connection(s) are active${
|
|
360
|
+
single && summary.authKind !== "none"
|
|
361
|
+
? " — authenticated multi-connection is not yet supported"
|
|
362
|
+
: ""
|
|
363
|
+
}; throughput will not scale to the full count.`,
|
|
364
|
+
context: {
|
|
365
|
+
requested: request.connectionCount,
|
|
366
|
+
active: summary.activeConnections,
|
|
367
|
+
},
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
|
|
311
371
|
return {
|
|
312
372
|
ok: true,
|
|
313
373
|
data,
|
|
314
|
-
warnings:
|
|
374
|
+
warnings: warnings.map((w) => ({ ...w })),
|
|
315
375
|
tips: [],
|
|
316
376
|
meta: clientMeta(target.host, controlPort, operation, auth.username),
|
|
317
377
|
};
|