@tikoci/centrs 0.1.6 → 0.1.8-next.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/CHANGELOG.md +342 -0
- package/GLOSSARY.txt +32 -0
- package/README.md +10 -6
- package/SECURITY.md +1 -1
- package/commands/AGENTS.md +2 -1
- package/commands/api/AGENTS.md +55 -30
- package/commands/api/README.md +135 -42
- package/commands/api/examples.md +275 -19
- package/commands/devices/README.md +21 -4
- package/commands/devices/examples.md +33 -2
- package/commands/execute/README.md +60 -18
- package/commands/execute/examples.md +224 -0
- package/commands/explain/README.md +42 -5
- package/commands/mcp/README.md +2 -1
- package/commands/retrieve/README.md +348 -4
- package/commands/retrieve/examples.md +442 -5
- package/commands/terminal/README.md +14 -4
- package/commands/terminal/examples.md +22 -3
- package/commands/transfer/README.md +55 -9
- package/commands/transfer/examples.md +106 -7
- package/docs/CLI.md +29 -21
- package/docs/CONSTITUTION.md +41 -16
- package/docs/MATRIX.md +38 -1
- package/docs/errors/README.md +3 -1
- package/docs/errors/cdb/create-failed.md +20 -0
- package/docs/errors/cdb/file-exists.md +23 -0
- package/docs/errors/input/invalid-query.md +36 -0
- package/docs/errors/input/invalid-target.md +25 -3
- package/docs/errors/input/local-destination.md +20 -0
- package/docs/errors/input/unsupported-query.md +19 -0
- package/docs/errors/internal/byte-string.md +13 -0
- package/docs/errors/routeros/invalid-value.md +3 -2
- package/docs/errors/settings/invalid-timeout.md +6 -0
- package/docs/errors/transport/cancel-unacknowledged.md +24 -0
- package/docs/errors/transport/stream-overflow.md +21 -0
- package/docs/errors/usage/removed-flag.md +20 -0
- package/docs/errors/validation/menu-unavailable.md +22 -0
- package/docs/errors/validation/not-followable.md +23 -0
- package/docs/errors/validation/package-missing.md +29 -0
- package/docs/errors/validation/unknown-path.md +16 -4
- package/docs/errors/wait/deadline-exceeded.md +14 -0
- package/docs/errors/wait/interrupted.md +10 -0
- package/package.json +14 -11
- package/src/absent-menu.ts +280 -0
- package/src/api-fanout.ts +22 -12
- package/src/api.ts +603 -194
- package/src/btest.ts +19 -17
- package/src/cli/api.ts +126 -34
- package/src/cli/devices.ts +16 -3
- package/src/cli/execute.ts +18 -5
- package/src/cli/retrieve.ts +216 -22
- package/src/cli/terminal.ts +10 -5
- package/src/cli/transfer.ts +23 -8
- package/src/core/envelope.ts +14 -0
- package/src/core/error-catalog.ts +70 -1
- package/src/core/execute-command.ts +313 -6
- package/src/core/inspect.ts +65 -27
- package/src/core/query.ts +508 -0
- package/src/core/routeros-errors.ts +67 -1
- package/src/data/winbox-cdb-write.ts +22 -8
- package/src/devices.ts +148 -37
- package/src/discover.ts +7 -8
- package/src/errors.ts +116 -7
- package/src/execute-fanout.ts +14 -9
- package/src/execute.ts +128 -116
- package/src/explain/catalog.ts +64 -16
- package/src/explain/menus.ts +27 -6
- package/src/explain.ts +6 -6
- package/src/index.ts +31 -1
- package/src/mcp/tools.ts +10 -15
- package/src/protocols/adapter.ts +235 -118
- package/src/protocols/btest-session.ts +3 -2
- package/src/protocols/endpoint.ts +10 -0
- package/src/protocols/mac-telnet-console.ts +12 -7
- package/src/protocols/native-api.ts +252 -73
- package/src/protocols/sftp.ts +44 -14
- package/src/protocols/ssh.ts +42 -14
- package/src/resolver/cdb.ts +28 -7
- package/src/resolver/index.ts +1 -0
- package/src/resolver/target.ts +84 -18
- package/src/retrieve-fanout.ts +51 -12
- package/src/retrieve-follow.ts +862 -0
- package/src/retrieve-sample.ts +244 -0
- package/src/retrieve-stream.ts +115 -0
- package/src/retrieve-wait.ts +286 -0
- package/src/retrieve.ts +741 -109
- package/src/settings.ts +15 -15
- package/src/transfer-fanout.ts +40 -15
- package/src/transfer.ts +234 -32
package/src/index.ts
CHANGED
|
@@ -12,10 +12,10 @@ export {
|
|
|
12
12
|
type ApiSuccessEnvelope,
|
|
13
13
|
api,
|
|
14
14
|
apiEnvelope,
|
|
15
|
-
apiListen,
|
|
16
15
|
apiMethods,
|
|
17
16
|
apiOutputFormats,
|
|
18
17
|
apiRequestSummaryFromRequest,
|
|
18
|
+
apiStream,
|
|
19
19
|
buildApiBody,
|
|
20
20
|
buildApiErrorEnvelope,
|
|
21
21
|
buildApiErrorEnvelopeFromResolved,
|
|
@@ -85,6 +85,7 @@ export {
|
|
|
85
85
|
normalizeWarnings,
|
|
86
86
|
type SettingSource,
|
|
87
87
|
type SettingSourceKind,
|
|
88
|
+
type ValidationTrace,
|
|
88
89
|
type Warning,
|
|
89
90
|
} from "./core/envelope.ts";
|
|
90
91
|
export {
|
|
@@ -203,6 +204,7 @@ export {
|
|
|
203
204
|
type DevicesCommand,
|
|
204
205
|
type DevicesEnvelope,
|
|
205
206
|
type DevicesGroupSummary,
|
|
207
|
+
type DevicesInitData,
|
|
206
208
|
type DevicesListItem,
|
|
207
209
|
type DevicesMutationData,
|
|
208
210
|
type DevicesMutationEnvelope,
|
|
@@ -215,6 +217,7 @@ export {
|
|
|
215
217
|
defaultCdbPath,
|
|
216
218
|
devicesOutputFormats,
|
|
217
219
|
editInteractiveOnlyError,
|
|
220
|
+
initCdb,
|
|
218
221
|
type LoadCdbOptions,
|
|
219
222
|
type LoadedCdb,
|
|
220
223
|
listDevices,
|
|
@@ -574,24 +577,36 @@ export {
|
|
|
574
577
|
type TargetSelection,
|
|
575
578
|
toCoreSource,
|
|
576
579
|
} from "./resolver/index.ts";
|
|
580
|
+
export type { RetrieveWaitMeta, RetrieveWaitSettings } from "./retrieve.ts";
|
|
577
581
|
export {
|
|
578
582
|
buildResolvedRetrieve,
|
|
579
583
|
buildRetrieveErrorEnvelope,
|
|
580
584
|
buildRetrieveErrorEnvelopeFromResolved,
|
|
585
|
+
FOLLOW_SWEEP_DEFAULT_MS,
|
|
581
586
|
type ResolvedRetrieveRequest,
|
|
582
587
|
type RetrieveEnvelope,
|
|
583
588
|
type RetrieveErrorEnvelope,
|
|
589
|
+
type RetrieveFollowCounts,
|
|
590
|
+
type RetrieveFollowSettings,
|
|
591
|
+
type RetrieveFollowStopReason,
|
|
592
|
+
type RetrieveFollowSummary,
|
|
584
593
|
type RetrieveGlobalContext,
|
|
585
594
|
type RetrieveOperationMeta,
|
|
595
|
+
type RetrieveOptions,
|
|
586
596
|
type RetrieveOutputFormat,
|
|
587
597
|
type RetrieveRequest,
|
|
588
598
|
type RetrieveRequestSummary,
|
|
599
|
+
type RetrieveSampleSettings,
|
|
600
|
+
type RetrieveSampleStopReason,
|
|
601
|
+
type RetrieveSampleSummary,
|
|
602
|
+
type RetrieveStreamMeta,
|
|
589
603
|
type RetrieveSuccessEnvelope,
|
|
590
604
|
type RetrieveWarning,
|
|
591
605
|
renderRetrieveEnvelope,
|
|
592
606
|
resolveRetrieveGlobalContext,
|
|
593
607
|
resolveRetrieveRequest,
|
|
594
608
|
retrieve,
|
|
609
|
+
retrieveEnvelope,
|
|
595
610
|
retrieveOutputFormats,
|
|
596
611
|
runResolvedRetrieve,
|
|
597
612
|
validateRetrieveRequestShape,
|
|
@@ -609,6 +624,17 @@ export {
|
|
|
609
624
|
retrieveFanout,
|
|
610
625
|
retrieveGroup,
|
|
611
626
|
} from "./retrieve-fanout.ts";
|
|
627
|
+
export {
|
|
628
|
+
FOLLOW_BUFFER_LIMIT,
|
|
629
|
+
type RetrieveFollowOptions,
|
|
630
|
+
retrieveFollow,
|
|
631
|
+
} from "./retrieve-follow.ts";
|
|
632
|
+
export {
|
|
633
|
+
type RetrieveSampleOptions,
|
|
634
|
+
retrieveSample,
|
|
635
|
+
} from "./retrieve-sample.ts";
|
|
636
|
+
export { renderRetrieveStreamLine } from "./retrieve-stream.ts";
|
|
637
|
+
export { type RetrieveWaitOptions, retrieveWait } from "./retrieve-wait.ts";
|
|
612
638
|
export {
|
|
613
639
|
buildSettingsErrorEnvelope,
|
|
614
640
|
renderSettingsEnvelope,
|
|
@@ -650,10 +676,12 @@ export {
|
|
|
650
676
|
} from "./terminal.ts";
|
|
651
677
|
export {
|
|
652
678
|
buildTransferErrorEnvelope,
|
|
679
|
+
buildTransferErrorEnvelopeFromResolved,
|
|
653
680
|
FILE_READ_CHUNK_BYTES,
|
|
654
681
|
isTransferWriteVerb,
|
|
655
682
|
normalizeRemotePath,
|
|
656
683
|
REST_FILE_WRITE_CAP_BYTES,
|
|
684
|
+
type ResolvedTransferRequest,
|
|
657
685
|
renderTransferEnvelope,
|
|
658
686
|
resolveTransferRequest,
|
|
659
687
|
runResolvedTransfer,
|
|
@@ -664,11 +692,13 @@ export {
|
|
|
664
692
|
type TransferMethod,
|
|
665
693
|
type TransferOp,
|
|
666
694
|
type TransferOperationMeta,
|
|
695
|
+
type TransferOptions,
|
|
667
696
|
type TransferOutputFormat,
|
|
668
697
|
type TransferRequest,
|
|
669
698
|
type TransferSuccessEnvelope,
|
|
670
699
|
type TransferVerb,
|
|
671
700
|
transfer,
|
|
701
|
+
transferEnvelope,
|
|
672
702
|
transferMethods,
|
|
673
703
|
transferOutputFormats,
|
|
674
704
|
transferVerbs,
|
package/src/mcp/tools.ts
CHANGED
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
import type { CommentKvUpdate } from "../resolver/comment-kv.ts";
|
|
37
37
|
import { parseBbox, parseNear } from "../resolver/geo.ts";
|
|
38
38
|
import { parseDuration } from "../resolver/settings.ts";
|
|
39
|
-
import {
|
|
39
|
+
import { retrieveEnvelope } from "../retrieve.ts";
|
|
40
40
|
import {
|
|
41
41
|
buildRetrieveFanoutErrorEnvelope,
|
|
42
42
|
retrieveGroup,
|
|
@@ -264,11 +264,13 @@ export const retrieveInputShape = {
|
|
|
264
264
|
.boolean()
|
|
265
265
|
.optional()
|
|
266
266
|
.describe("Return every attribute instead of the default projection."),
|
|
267
|
-
filter: z.string().optional().describe("
|
|
267
|
+
filter: z.string().optional().describe("Alias of `query`."),
|
|
268
268
|
query: z
|
|
269
|
-
.string()
|
|
269
|
+
.union([z.string(), z.array(z.string())])
|
|
270
270
|
.optional()
|
|
271
|
-
.describe(
|
|
271
|
+
.describe(
|
|
272
|
+
"Row filter written as after `print where`, e.g. `type=ether and !disabled`; run on the router, several are AND-ed. No `~` (regex) or `in`.",
|
|
273
|
+
),
|
|
272
274
|
via: z.string().optional().describe("Override transport."),
|
|
273
275
|
timeout: z
|
|
274
276
|
.union([z.string(), z.number()])
|
|
@@ -324,18 +326,11 @@ export async function handleRetrieve(
|
|
|
324
326
|
cdbPassword: config.cdbPassword,
|
|
325
327
|
};
|
|
326
328
|
|
|
329
|
+
if (args.group === undefined) return await retrieveEnvelope(request);
|
|
327
330
|
try {
|
|
328
|
-
|
|
329
|
-
args.group !== undefined
|
|
330
|
-
? await retrieveGroup(request)
|
|
331
|
-
: await retrieve(request);
|
|
332
|
-
return envelope;
|
|
331
|
+
return await retrieveGroup(request);
|
|
333
332
|
} catch (error) {
|
|
334
|
-
|
|
335
|
-
args.group !== undefined
|
|
336
|
-
? buildRetrieveFanoutErrorEnvelope(request, error)
|
|
337
|
-
: buildRetrieveErrorEnvelope(request, error);
|
|
338
|
-
return envelope;
|
|
333
|
+
return buildRetrieveFanoutErrorEnvelope(request, error);
|
|
339
334
|
}
|
|
340
335
|
}
|
|
341
336
|
|
|
@@ -352,7 +347,7 @@ export const executeInputShape = {
|
|
|
352
347
|
.boolean()
|
|
353
348
|
.optional()
|
|
354
349
|
.describe(
|
|
355
|
-
"Required true for write-shaped commands
|
|
350
|
+
"Required true for write-shaped commands, including selector/positional and non-CRUD mutations. Reads ignore it.",
|
|
356
351
|
),
|
|
357
352
|
via: z.string().optional().describe("Override transport."),
|
|
358
353
|
timeout: z
|