@tikoci/centrs 0.1.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 (182) hide show
  1. package/CHANGELOG.md +207 -0
  2. package/GLOSSARY.txt +420 -0
  3. package/README.md +196 -0
  4. package/SECURITY.md +30 -0
  5. package/commands/AGENTS.md +50 -0
  6. package/commands/btest/README.md +257 -0
  7. package/commands/btest/examples.md +190 -0
  8. package/commands/check/README.md +59 -0
  9. package/commands/devices/README.md +405 -0
  10. package/commands/devices/examples.md +488 -0
  11. package/commands/discover/README.md +170 -0
  12. package/commands/discover/examples.md +98 -0
  13. package/commands/execute/README.md +208 -0
  14. package/commands/execute/examples.md +353 -0
  15. package/commands/mcp/README.md +260 -0
  16. package/commands/mcp/examples.md +158 -0
  17. package/commands/retrieve/README.md +209 -0
  18. package/commands/retrieve/examples.md +306 -0
  19. package/commands/settings/README.md +69 -0
  20. package/commands/stream/README.md +70 -0
  21. package/commands/terminal/README.md +177 -0
  22. package/commands/terminal/examples.md +144 -0
  23. package/commands/transfer/README.md +315 -0
  24. package/commands/transfer/examples.md +368 -0
  25. package/docs/CONSTITUTION.md +417 -0
  26. package/docs/MATRIX.md +224 -0
  27. package/docs/errors/README.md +74 -0
  28. package/docs/errors/auth/failed.md +9 -0
  29. package/docs/errors/cdb/already-exists.md +9 -0
  30. package/docs/errors/cdb/created.md +9 -0
  31. package/docs/errors/cdb/decrypt-failed.md +9 -0
  32. package/docs/errors/cdb/empty-group.md +9 -0
  33. package/docs/errors/cdb/invalid-option.md +9 -0
  34. package/docs/errors/cdb/invalid-record.md +9 -0
  35. package/docs/errors/cdb/not-found-target.md +9 -0
  36. package/docs/errors/cdb/not-found.md +9 -0
  37. package/docs/errors/cdb/override-applied.md +9 -0
  38. package/docs/errors/cdb/parse-failed.md +9 -0
  39. package/docs/errors/cdb/password-not-needed.md +9 -0
  40. package/docs/errors/cdb/password-required.md +9 -0
  41. package/docs/errors/cdb/reserved-key.md +9 -0
  42. package/docs/errors/cdb/reserved-option.md +9 -0
  43. package/docs/errors/cdb/target-not-registered.md +9 -0
  44. package/docs/errors/cdb/unknown-field.md +9 -0
  45. package/docs/errors/cdb/unknown-option.md +9 -0
  46. package/docs/errors/cdb/write-not-permitted.md +9 -0
  47. package/docs/errors/discover/broadcast-unavailable.md +9 -0
  48. package/docs/errors/discover/failed.md +9 -0
  49. package/docs/errors/identity/ambiguous.md +9 -0
  50. package/docs/errors/identity/no-match.md +9 -0
  51. package/docs/errors/input/invalid-command.md +9 -0
  52. package/docs/errors/input/invalid-match.md +9 -0
  53. package/docs/errors/input/invalid-path.md +9 -0
  54. package/docs/errors/input/invalid-routeros-path.md +9 -0
  55. package/docs/errors/input/invalid-target.md +9 -0
  56. package/docs/errors/input/local-file-not-found.md +9 -0
  57. package/docs/errors/input/mac-address.md +9 -0
  58. package/docs/errors/input/max-results-exceeded.md +9 -0
  59. package/docs/errors/internal/devices-failed.md +9 -0
  60. package/docs/errors/internal/mcp-start.md +9 -0
  61. package/docs/errors/internal/mcp-tool.md +9 -0
  62. package/docs/errors/internal/native-api-length.md +9 -0
  63. package/docs/errors/internal/unhandled.md +9 -0
  64. package/docs/errors/internal/unreachable.md +9 -0
  65. package/docs/errors/mndp/encode-failed.md +9 -0
  66. package/docs/errors/mndp/listen-failed.md +9 -0
  67. package/docs/errors/mndp/malformed.md +9 -0
  68. package/docs/errors/routeros/api-fatal.md +9 -0
  69. package/docs/errors/routeros/api-protocol.md +9 -0
  70. package/docs/errors/routeros/api-trap.md +9 -0
  71. package/docs/errors/routeros/btest-protocol.md +12 -0
  72. package/docs/errors/routeros/btest-too-many-sessions.md +9 -0
  73. package/docs/errors/routeros/command-failed.md +14 -0
  74. package/docs/errors/routeros/ec-srp5-protocol.md +11 -0
  75. package/docs/errors/routeros/error.md +9 -0
  76. package/docs/errors/routeros/invalid-value.md +14 -0
  77. package/docs/errors/routeros/mac-telnet-error.md +9 -0
  78. package/docs/errors/routeros/mac-telnet-not-ready.md +9 -0
  79. package/docs/errors/routeros/mac-telnet-protocol.md +9 -0
  80. package/docs/errors/routeros/mac-telnet-unsupported-auth.md +9 -0
  81. package/docs/errors/routeros/protocol-not-implemented.md +9 -0
  82. package/docs/errors/routeros/request-failed.md +9 -0
  83. package/docs/errors/routeros/session-closed.md +13 -0
  84. package/docs/errors/routeros/unknown-attribute.md +13 -0
  85. package/docs/errors/routeros/unknown-path.md +15 -0
  86. package/docs/errors/routeros/unsupported-capability.md +9 -0
  87. package/docs/errors/settings/invalid-boolean.md +9 -0
  88. package/docs/errors/settings/invalid-format.md +9 -0
  89. package/docs/errors/settings/invalid-integer.md +9 -0
  90. package/docs/errors/settings/invalid-timeout.md +9 -0
  91. package/docs/errors/settings/invalid-via.md +9 -0
  92. package/docs/errors/settings/unsafe-protocol-blocked.md +9 -0
  93. package/docs/errors/target/mac-not-in-arp.md +14 -0
  94. package/docs/errors/target/mac-required.md +23 -0
  95. package/docs/errors/target/mac-unresolved.md +17 -0
  96. package/docs/errors/target/unresolved.md +9 -0
  97. package/docs/errors/transport/auth-failed.md +9 -0
  98. package/docs/errors/transport/auto-method.md +9 -0
  99. package/docs/errors/transport/capability-unsupported.md +22 -0
  100. package/docs/errors/transport/checksum-unavailable.md +9 -0
  101. package/docs/errors/transport/connection-closed.md +9 -0
  102. package/docs/errors/transport/connection-refused.md +9 -0
  103. package/docs/errors/transport/dns.md +9 -0
  104. package/docs/errors/transport/host-key-mismatch.md +9 -0
  105. package/docs/errors/transport/incomplete-transfer.md +9 -0
  106. package/docs/errors/transport/insecure-trust.md +9 -0
  107. package/docs/errors/transport/local-tool-missing.md +11 -0
  108. package/docs/errors/transport/network.md +9 -0
  109. package/docs/errors/transport/timeout.md +9 -0
  110. package/docs/errors/transport/tls-certificate.md +9 -0
  111. package/docs/errors/transport/unreachable.md +9 -0
  112. package/docs/errors/transport/unsupported-operation.md +9 -0
  113. package/docs/errors/usage/confirmation-required.md +9 -0
  114. package/docs/errors/usage/conflicting-flags.md +9 -0
  115. package/docs/errors/usage/invalid-concurrency.md +9 -0
  116. package/docs/errors/usage/missing-group.md +9 -0
  117. package/docs/errors/usage/not-implemented.md +9 -0
  118. package/docs/errors/usage/target-exists.md +9 -0
  119. package/docs/errors/usage/timeout-out-of-range.md +9 -0
  120. package/docs/errors/validation/not-implemented.md +9 -0
  121. package/docs/errors/validation/option.md +9 -0
  122. package/docs/errors/validation/syntax.md +9 -0
  123. package/docs/errors/validation/unknown-attribute.md +9 -0
  124. package/docs/errors/validation/unknown-path.md +9 -0
  125. package/package.json +96 -0
  126. package/src/AGENTS.md +7 -0
  127. package/src/btest.ts +906 -0
  128. package/src/cli/btest.ts +455 -0
  129. package/src/cli/common.ts +53 -0
  130. package/src/cli/devices.ts +527 -0
  131. package/src/cli/discover.ts +186 -0
  132. package/src/cli/execute.ts +333 -0
  133. package/src/cli/mcp.ts +109 -0
  134. package/src/cli/retrieve.ts +383 -0
  135. package/src/cli/terminal.ts +303 -0
  136. package/src/cli/transfer.ts +471 -0
  137. package/src/cli.ts +115 -0
  138. package/src/core/envelope.ts +221 -0
  139. package/src/core/error-catalog.ts +469 -0
  140. package/src/core/routeros-errors.ts +268 -0
  141. package/src/data/AGENTS.md +11 -0
  142. package/src/data/dude-db.ts +0 -0
  143. package/src/data/mndp-cache.ts +132 -0
  144. package/src/data/mndp.ts +405 -0
  145. package/src/data/winbox-cdb-write.ts +200 -0
  146. package/src/data/winbox-cdb.ts +913 -0
  147. package/src/devices-schema.ts +107 -0
  148. package/src/devices.ts +1717 -0
  149. package/src/discover.ts +802 -0
  150. package/src/errors.ts +189 -0
  151. package/src/execute.ts +1350 -0
  152. package/src/index.ts +353 -0
  153. package/src/mcp/config.ts +66 -0
  154. package/src/mcp/resources.ts +98 -0
  155. package/src/mcp/safety.ts +119 -0
  156. package/src/mcp/server.ts +225 -0
  157. package/src/mcp/tools.ts +657 -0
  158. package/src/mcp.ts +33 -0
  159. package/src/protocols/AGENTS.md +14 -0
  160. package/src/protocols/adapter.ts +866 -0
  161. package/src/protocols/btest-session.ts +1493 -0
  162. package/src/protocols/btest.ts +447 -0
  163. package/src/protocols/ec-srp5.ts +466 -0
  164. package/src/protocols/index.ts +118 -0
  165. package/src/protocols/mac-telnet-console.ts +655 -0
  166. package/src/protocols/mac-telnet.ts +1299 -0
  167. package/src/protocols/mtwei.ts +47 -0
  168. package/src/protocols/native-api.ts +796 -0
  169. package/src/protocols/sftp.ts +427 -0
  170. package/src/protocols/ssh.ts +297 -0
  171. package/src/resolver/cdb.ts +580 -0
  172. package/src/resolver/comment-kv.ts +360 -0
  173. package/src/resolver/index.ts +74 -0
  174. package/src/resolver/mac.ts +227 -0
  175. package/src/resolver/settings.ts +228 -0
  176. package/src/resolver/target.ts +442 -0
  177. package/src/retrieve-fanout.ts +533 -0
  178. package/src/retrieve.ts +1215 -0
  179. package/src/terminal.ts +444 -0
  180. package/src/transfer.ts +1554 -0
  181. package/src/tui.ts +22 -0
  182. package/src/webproxy.ts +16 -0
@@ -0,0 +1,9 @@
1
+ # `routeros/mac-telnet-protocol`
2
+
3
+ A MAC-Telnet packet could not be decoded.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `routeros/mac-telnet-protocol`.
@@ -0,0 +1,9 @@
1
+ # `routeros/mac-telnet-unsupported-auth`
2
+
3
+ The device requested an unsupported MAC-Telnet auth mode.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `routeros/mac-telnet-unsupported-auth`.
@@ -0,0 +1,9 @@
1
+ # `routeros/protocol-not-implemented`
2
+
3
+ The requested protocol is planned but not implemented yet.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `routeros/protocol-not-implemented`.
@@ -0,0 +1,9 @@
1
+ # `routeros/request-failed`
2
+
3
+ A RouterOS REST request failed with no more specific mapping.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `routeros/request-failed`.
@@ -0,0 +1,13 @@
1
+ # `routeros/session-closed`
2
+
3
+ RouterOS closed the session before the request completed. Over REST this maps to
4
+ the 60-second hard timeout RouterOS enforces on a single HTTP request.
5
+
6
+ ## Typical RouterOS strings
7
+
8
+ - `Session closed`
9
+
10
+ ## Fix
11
+
12
+ RouterOS enforces a 60-second hard timeout on REST sessions; reduce the scope of
13
+ the request or choose a path that completes within that ceiling.
@@ -0,0 +1,13 @@
1
+ # `routeros/unknown-attribute`
2
+
3
+ RouterOS rejected an attribute (parameter) name it does not recognize for the
4
+ target path. The offending name is captured in `context.parameter`.
5
+
6
+ ## Typical RouterOS strings
7
+
8
+ - `unknown parameter <name>`
9
+
10
+ ## Fix
11
+
12
+ Remove or rename the attribute; use `--list-attributes` to see the parameters
13
+ this RouterOS path accepts.
@@ -0,0 +1,15 @@
1
+ # `routeros/unknown-path`
2
+
3
+ RouterOS did not recognize the command path or menu item that was requested.
4
+
5
+ ## Typical RouterOS strings
6
+
7
+ - `no such command prefix`
8
+ - `no such item`
9
+ - `no such entry`
10
+ - path-shaped `... not found`
11
+
12
+ ## Fix
13
+
14
+ Check the slash-prefixed RouterOS path against the device's command tree (use
15
+ `--list-attributes` or `--no-validate` to narrow the mismatch).
@@ -0,0 +1,9 @@
1
+ # `routeros/unsupported-capability`
2
+
3
+ The chosen protocol does not support this command capability.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `routeros/unsupported-capability`.
@@ -0,0 +1,9 @@
1
+ # `settings/invalid-boolean`
2
+
3
+ A boolean-like setting received a non-boolean value.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `settings/invalid-boolean`.
@@ -0,0 +1,9 @@
1
+ # `settings/invalid-format`
2
+
3
+ An unsupported output format was requested.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `settings/invalid-format`.
@@ -0,0 +1,9 @@
1
+ # `settings/invalid-integer`
2
+
3
+ An integer setting received a non-integer or out-of-range value.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `settings/invalid-integer`.
@@ -0,0 +1,9 @@
1
+ # `settings/invalid-timeout`
2
+
3
+ A timeout setting received an invalid value.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `settings/invalid-timeout`.
@@ -0,0 +1,9 @@
1
+ # `settings/invalid-via`
2
+
3
+ An unsupported protocol identifier was supplied to --via.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `settings/invalid-via`.
@@ -0,0 +1,9 @@
1
+ # `settings/unsafe-protocol-blocked`
2
+
3
+ A cleartext protocol (e.g. ftp) was requested without the explicit ALLOW_UNSAFE_PROTOCOLS opt-in.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `settings/unsafe-protocol-blocked`.
@@ -0,0 +1,14 @@
1
+ # `target/mac-not-in-arp`
2
+
3
+ `--resolve arp` was requested for a MAC-address target, but that MAC is not
4
+ present in the host ARP cache, so it could not be resolved to an IP.
5
+
6
+ The ARP cache only holds entries for neighbors the host has communicated with
7
+ recently. A device that has not been contacted yet — or is on a different L2
8
+ segment — will not appear.
9
+
10
+ ## Fix
11
+
12
+ - Make the device reachable first (for example, `ping` its IP, or run
13
+ `centrs discover`) so the host learns its MAC → IP mapping, then retry, or
14
+ - Pass the IP address or hostname directly instead of the MAC.
@@ -0,0 +1,23 @@
1
+ # `target/mac-required`
2
+
3
+ The chosen Layer-2 transport — **mac-telnet** — addresses devices by MAC
4
+ address, but no MAC could be resolved for the target.
5
+
6
+ ## When it happens
7
+
8
+ - `--via mac-telnet` (or the mac-telnet default for a bare-MAC target) was
9
+ selected, but the `<router>` argument is not a MAC and resolves to no CDB
10
+ record carrying a MAC.
11
+ - The matched CDB record has only an IP/DNS `target` and no `mac=` comment-kv
12
+ lookup key, so there is no MAC to address.
13
+
14
+ ## Fix
15
+
16
+ - Pass the device MAC directly: `centrs execute aa:bb:cc:dd:ee:ff '<command>' --via mac-telnet`.
17
+ - Or add a `mac=aa:bb:cc:dd:ee:ff` lookup key to the device's CDB comment so it
18
+ is resolvable by identity/IP over L2.
19
+ - Or, if you actually want IP-level execution, pin an IP transport and resolve
20
+ the MAC via ARP: `--via native-api --resolve arp` (or `--via rest-api`).
21
+
22
+ The `host`/`port` for mac-telnet are only the UDP delivery endpoint (default L2
23
+ broadcast); the MAC is the device identity.
@@ -0,0 +1,17 @@
1
+ # `target/mac-unresolved`
2
+
3
+ The `<router>` target is a MAC address, but no CDB record matched it and host
4
+ ARP resolution was not requested, so it could not be turned into an IP-level
5
+ target.
6
+
7
+ centrs never silently scans the network: a MAC is resolved through the CDB
8
+ first, and only resolved via the local host ARP cache when you explicitly opt
9
+ in.
10
+
11
+ ## Fix
12
+
13
+ - Pass an IP address or hostname instead of the MAC, or
14
+ - Add a CDB record for this MAC (so identity + credentials resolve), or
15
+ - Re-run with `--resolve arp` to resolve the MAC to an IP via the host ARP
16
+ cache (for `execute`, also pin an IP transport with `--via native-api` or
17
+ `--via rest-api`).
@@ -0,0 +1,9 @@
1
+ # `target/unresolved`
2
+
3
+ No host could be resolved for the operation.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `target/unresolved`.
@@ -0,0 +1,9 @@
1
+ # `transport/auth-failed`
2
+
3
+ RouterOS rejected the credentials over the transport.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `transport/auth-failed`.
@@ -0,0 +1,9 @@
1
+ # `transport/auto-method`
2
+
3
+ Auto-selection moved the operation to a different method (informational auto-hop).
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `transport/auto-method`.
@@ -0,0 +1,22 @@
1
+ # `transport/capability-unsupported`
2
+
3
+ The pinned transport cannot perform the requested kind of operation, and centrs
4
+ will not silently switch transports (see `docs/CONSTITUTION.md`, protocol
5
+ selection).
6
+
7
+ ## When it happens
8
+
9
+ - A read/inspect operation was routed over **mac-telnet**, which is a console
10
+ (execute/terminal) transport only — it has no structured `retrieve` or
11
+ `/console/inspect` surface. centrs surfaces this rather than scraping the
12
+ interactive console for structured data.
13
+ - More generally: a `--via` was pinned to a transport that lacks the capability
14
+ the command needs.
15
+
16
+ ## Fix
17
+
18
+ - For structured reads, use an IP transport: `--via rest-api` or
19
+ `--via native-api` (add `--resolve arp` to reach a MAC target over IP).
20
+ - Use mac-telnet for `execute`/`terminal` (running CLI commands / an interactive
21
+ console), not for `retrieve`.
22
+ - Drop the `--via` pin to let centrs auto-select a capable transport.
@@ -0,0 +1,9 @@
1
+ # `transport/checksum-unavailable`
2
+
3
+ No file digest is available over the transport, so integrity was verified by size instead.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `transport/checksum-unavailable`.
@@ -0,0 +1,9 @@
1
+ # `transport/connection-closed`
2
+
3
+ The transport connection was closed before a result.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `transport/connection-closed`.
@@ -0,0 +1,9 @@
1
+ # `transport/connection-refused`
2
+
3
+ The device refused the connection.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `transport/connection-refused`.
@@ -0,0 +1,9 @@
1
+ # `transport/dns`
2
+
3
+ The device host name could not be resolved.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `transport/dns`.
@@ -0,0 +1,9 @@
1
+ # `transport/host-key-mismatch`
2
+
3
+ The device's SSH host key did not match the known key.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `transport/host-key-mismatch`.
@@ -0,0 +1,9 @@
1
+ # `transport/incomplete-transfer`
2
+
3
+ A file transfer settled at fewer bytes than expected (verify mismatch).
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `transport/incomplete-transfer`.
@@ -0,0 +1,9 @@
1
+ # `transport/insecure-trust`
2
+
3
+ Peer verification was disabled via --insecure (TLS / SSH host-key checks skipped).
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `transport/insecure-trust`.
@@ -0,0 +1,11 @@
1
+ # `transport/local-tool-missing`
2
+
3
+ A required local CLI (e.g. the OpenSSH `sftp` client) is not installed or not on
4
+ PATH.
5
+
6
+ ## Fix
7
+
8
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
9
+ contract. The SFTP transfer path shells out to the host OpenSSH `sftp` client;
10
+ install an OpenSSH client (macOS ships it; Debian/Ubuntu: `openssh-client`) so
11
+ `sftp` is on PATH, or use `--via rest` / `--via native` for files ≤60 KB.
@@ -0,0 +1,9 @@
1
+ # `transport/network`
2
+
3
+ A network request to the device failed.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `transport/network`.
@@ -0,0 +1,9 @@
1
+ # `transport/timeout`
2
+
3
+ The transport request timed out.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `transport/timeout`.
@@ -0,0 +1,9 @@
1
+ # `transport/tls-certificate`
2
+
3
+ TLS certificate validation failed for the device.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `transport/tls-certificate`.
@@ -0,0 +1,9 @@
1
+ # `transport/unreachable`
2
+
3
+ The device could not be reached over the chosen transport.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `transport/unreachable`.
@@ -0,0 +1,9 @@
1
+ # `transport/unsupported-operation`
2
+
3
+ The chosen transport does not support this operation.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `transport/unsupported-operation`.
@@ -0,0 +1,9 @@
1
+ # `usage/confirmation-required`
2
+
3
+ A write-shaped command needs explicit confirmation (pass confirm:true / --yes after review).
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `usage/confirmation-required`.
@@ -0,0 +1,9 @@
1
+ # `usage/conflicting-flags`
2
+
3
+ Two or more supplied flags conflict.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `usage/conflicting-flags`.
@@ -0,0 +1,9 @@
1
+ # `usage/invalid-concurrency`
2
+
3
+ The --concurrency value must be an integer >= 1.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `usage/invalid-concurrency`.
@@ -0,0 +1,9 @@
1
+ # `usage/missing-group`
2
+
3
+ The operation requires a non-empty --group value.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `usage/missing-group`.
@@ -0,0 +1,9 @@
1
+ # `usage/not-implemented`
2
+
3
+ A recognized command form is reserved but not implemented yet (e.g. the interactive `devices edit` editor).
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `usage/not-implemented`.
@@ -0,0 +1,9 @@
1
+ # `usage/target-exists`
2
+
3
+ The destination already exists and would be overwritten; pass --force to replace it.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `usage/target-exists`.
@@ -0,0 +1,9 @@
1
+ # `usage/timeout-out-of-range`
2
+
3
+ The requested timeout is outside the allowed range.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `usage/timeout-out-of-range`.
@@ -0,0 +1,9 @@
1
+ # `validation/not-implemented`
2
+
3
+ The requested validation feature is not implemented yet.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `validation/not-implemented`.
@@ -0,0 +1,9 @@
1
+ # `validation/option`
2
+
3
+ An unknown option value was supplied.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `validation/option`.
@@ -0,0 +1,9 @@
1
+ # `validation/syntax`
2
+
3
+ RouterOS rejected the command syntax during the :parse gate.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `validation/syntax`.
@@ -0,0 +1,9 @@
1
+ # `validation/unknown-attribute`
2
+
3
+ An attribute is not valid for the path/verb per /console/inspect.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `validation/unknown-attribute`.
@@ -0,0 +1,9 @@
1
+ # `validation/unknown-path`
2
+
3
+ The RouterOS path does not expose the requested command.
4
+
5
+ ## Fix
6
+
7
+ See [`docs/CONSTITUTION.md`](../../CONSTITUTION.md) for the centrs error
8
+ contract. This stub will be expanded with the typical trigger and remediation
9
+ for `validation/unknown-path`.
package/package.json ADDED
@@ -0,0 +1,96 @@
1
+ {
2
+ "name": "@tikoci/centrs",
3
+ "version": "0.1.0",
4
+ "main": "src/index.ts",
5
+ "module": "src/index.ts",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/tikoci/centrs.git"
9
+ },
10
+ "homepage": "https://github.com/tikoci/centrs#readme",
11
+ "bugs": "https://github.com/tikoci/centrs/issues",
12
+ "packageManager": "bun@1.3.13",
13
+ "devDependencies": {
14
+ "@agent-lint/cli": "^0.8.1",
15
+ "@biomejs/biome": "2.5.0",
16
+ "@secretlint/secretlint-rule-preset-recommend": "^13.0.2",
17
+ "@tikoci/quickchr": "^0.4.2",
18
+ "@types/bun": "^1.3.13",
19
+ "cloc": "^2.6.0-cloc",
20
+ "cspell": "^10.0.0",
21
+ "has-flag": "4.0.0",
22
+ "markdownlint-cli2": "^0.22.1",
23
+ "secretlint": "^13.0.2",
24
+ "typedoc": "^0.28.19"
25
+ },
26
+ "optionalDependencies": {},
27
+ "peerDependencies": {
28
+ "typescript": "^6.0.3"
29
+ },
30
+ "exports": {
31
+ ".": "./src/index.ts",
32
+ "./cli": "./src/cli.ts",
33
+ "./mcp": "./src/mcp.ts",
34
+ "./tui": "./src/tui.ts",
35
+ "./webproxy": "./src/webproxy.ts",
36
+ "./protocols": "./src/protocols/index.ts"
37
+ },
38
+ "bin": {
39
+ "centrs": "src/cli.ts"
40
+ },
41
+ "description": "All-in-one TypeScript library/CLI/TUI/MCP for interacting with MikroTik RouterOS devices",
42
+ "engines": {
43
+ "bun": ">=1.3.11 <2"
44
+ },
45
+ "private": false,
46
+ "files": [
47
+ "src/",
48
+ "commands/",
49
+ "docs/CONSTITUTION.md",
50
+ "docs/MATRIX.md",
51
+ "docs/errors/",
52
+ "README.md",
53
+ "CHANGELOG.md",
54
+ "SECURITY.md",
55
+ "GLOSSARY.txt"
56
+ ],
57
+ "scripts": {
58
+ "ci": "bun run lint && bun run test && bun run build",
59
+ "git:pre-commit": "bun run lint",
60
+ "git:pre-push": "bun run ci",
61
+ "lint": "bun run lint:biome && bun run lint:typecheck",
62
+ "lint:git:commit": "bun run lint",
63
+ "lint:git:push": "bun run ci",
64
+ "lint:ci": "bun run lint && bun run lint:markdownlint && bun run lint:cspell && bun run lint:secretlint && bun run lint:agents",
65
+ "lint:cspell": "cspell lint . --gitignore",
66
+ "lint:cspell:all": "cspell lint . --no-gitignore",
67
+ "lint:markdownlint": "markdownlint-cli2 \"**/*.md\" \"!.scratch/**\"",
68
+ "lint:markdownlint:fix": "markdownlint-cli2 --fix \"**/*.md\"",
69
+ "lint:typecheck": "tsc --noEmit",
70
+ "lint:biome": "biome check .",
71
+ "lint:fix": "biome check --write .",
72
+ "lint:secretlint": "secretlint \"**/*\"",
73
+ "lint:agents": "agent-lint scan --stdout",
74
+ "test": "bun test",
75
+ "test:smoke": "bun test test/integration/cli-smoke.test.ts",
76
+ "test:integration:fast": "bun test test/integration/devices.test.ts",
77
+ "test:integration:smoke": "CENTRS_RUN_FAST_INTEGRATION=1 bun test test/integration/chr-smoke.test.ts",
78
+ "test:integration": "CENTRS_RUN_FAST_INTEGRATION=1 bun test test/integration/",
79
+ "test:integration:stable": "CENTRS_CHR_CHANNEL=stable bun run test:integration",
80
+ "test:integration:long-term": "CENTRS_CHR_CHANNEL=long-term bun run test:integration",
81
+ "test:integration:testing": "CENTRS_CHR_CHANNEL=testing bun run test:integration",
82
+ "test:integration:development": "CENTRS_CHR_CHANNEL=development bun run test:integration",
83
+ "test:ci": "bun test --coverage",
84
+ "test:all": "bun run test:ci",
85
+ "build": "bun build src/index.ts src/cli.ts src/mcp.ts src/tui.ts src/webproxy.ts src/protocols/index.ts --outdir dist --target bun",
86
+ "build:doc:api": "typedoc --out docs/api src/index.ts",
87
+ "docs:errors": "bun run scripts/gen-error-pages.ts",
88
+ "security": "bun run lint:secretlint && bun run lint:markdownlint"
89
+ },
90
+ "type": "module",
91
+ "types": "src/index.ts",
92
+ "dependencies": {
93
+ "@modelcontextprotocol/sdk": "^1.29.0",
94
+ "zod": "^4.4.3"
95
+ }
96
+ }