rhombus-node-mcp 0.1.55 → 0.1.57
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/dist/api/access-control-tool-api.js +231 -32
- package/dist/api/alarm-monitoring-tool-api.js +50 -1
- package/dist/api/automated-prompts-tool-api.js +9 -17
- package/dist/api/camera-policy-tool-api.js +122 -0
- package/dist/api/camera-tool-api.js +3 -5
- package/dist/api/camera-uptime-tool-api.js +62 -25
- package/dist/api/clips-tool-api.js +45 -9
- package/dist/api/create-tool-api.js +55 -7
- package/dist/api/door-tool-api.js +74 -13
- package/dist/api/entity-lookup-tool-api.js +8 -1
- package/dist/api/events-tool-api.js +79 -6
- package/dist/api/faces-tool-api.js +112 -7
- package/dist/api/get-accessible-apps.js +68 -6
- package/dist/api/get-entity-tool-api.js +12 -12
- package/dist/api/get-org-information-tool-api.js +2 -2
- package/dist/api/guest-management-tool-api.js +75 -1
- package/dist/api/location-tool-api.js +120 -28
- package/dist/api/lpr-tool-api.js +71 -16
- package/dist/api/policy-alerts-tool-api.js +7 -3
- package/dist/api/report-tool-api.js +4 -1
- package/dist/api/rules-tool-api.js +6 -16
- package/dist/api/schedule-tool-api.js +107 -0
- package/dist/api/search-tool-api.js +5 -13
- package/dist/api/update-tool-api.js +96 -1
- package/dist/api/user-tool-api.js +58 -13
- package/dist/createServer.js +18 -6
- package/dist/filtering-utils.js +421 -29
- package/dist/index.js +1 -1
- package/dist/network/network.js +122 -10
- package/dist/network/org-reference-cache.js +74 -0
- package/dist/telemetry/tracingProxy.js +4 -0
- package/dist/tools/entity-lookup-tool.js +8 -4
- package/dist/tools/get-entity-tool.js +46 -21
- package/dist/tools/get-org-information-tool.js +36 -3
- package/dist/tools/time-conversion-tool.js +65 -37
- package/dist/tools/time-tool.js +18 -4
- package/dist/tools/user-tool.js +101 -1
- package/dist/tools-console/access-anomaly-tool.js +4 -19
- package/dist/tools-console/access-control-tool.js +330 -2
- package/dist/tools-console/alarm-monitoring-tool.js +73 -1
- package/dist/tools-console/analytics-tool.js +4 -2
- package/dist/tools-console/automated-prompts-tool.js +2 -0
- package/dist/tools-console/badge-timeline-tool.js +4 -21
- package/dist/tools-console/camera-policy-tool.js +252 -0
- package/dist/tools-console/camera-tool.js +113 -89
- package/dist/tools-console/camera-uptime-tool.js +2 -0
- package/dist/tools-console/clips-tool.js +23 -31
- package/dist/tools-console/count-tool.js +19 -6
- package/dist/tools-console/create-camera-policy-tool.js +304 -122
- package/dist/tools-console/door-schedule-exception-tool.js +4 -33
- package/dist/tools-console/door-tool.js +131 -1
- package/dist/tools-console/elements-access-anomaly-tool.js +4 -19
- package/dist/tools-console/elements-badge-timeline-tool.js +4 -21
- package/dist/tools-console/elements-lost-badge-tool.js +4 -17
- package/dist/tools-console/elements-tool.js +4 -29
- package/dist/tools-console/events-tool.js +24 -101
- package/dist/tools-console/faces-tool.js +255 -27
- package/dist/tools-console/guest-management-tool.js +128 -1
- package/dist/tools-console/location-tool.js +161 -35
- package/dist/tools-console/lost-badge-tool.js +4 -17
- package/dist/tools-console/lpr-tool.js +90 -22
- package/dist/tools-console/netbox-access-anomaly-tool.js +4 -19
- package/dist/tools-console/netbox-badge-timeline-tool.js +4 -21
- package/dist/tools-console/netbox-lost-badge-tool.js +4 -17
- package/dist/tools-console/netbox-tool.js +4 -29
- package/dist/tools-console/onguard-tool.js +4 -30
- package/dist/tools-console/person-tracking-tool.js +4 -2
- package/dist/tools-console/policy-alerts-tool.js +6 -28
- package/dist/tools-console/reboot-cameras-tool.js +23 -3
- package/dist/tools-console/report-tool.js +12 -40
- package/dist/tools-console/rules-tool.js +2 -0
- package/dist/tools-console/schedule-tool.js +190 -0
- package/dist/tools-console/search-tool.js +2 -0
- package/dist/tools-console/update-tool.js +300 -168
- package/dist/tools-console/user-access-trail-tool.js +2 -0
- package/dist/tools-console/user-audit-tool.js +2 -0
- package/dist/tools-console/video-walls-tool.js +94 -20
- package/dist/types/access-anomaly-tool-types.js +22 -2
- package/dist/types/access-control-tool-types.js +116 -1
- package/dist/types/alarm-monitoring-tool-types.js +42 -1
- package/dist/types/badge-timeline-tool-types.js +18 -3
- package/dist/types/camera-policy-tool-types.js +104 -0
- package/dist/types/camera-tool-types.js +80 -1
- package/dist/types/clips-tool-types.js +27 -3
- package/dist/types/create-camera-policy-tool-types.js +275 -26
- package/dist/types/door-schedule-exception-tool-types.js +20 -6
- package/dist/types/door-tool-types.js +36 -4
- package/dist/types/entity-lookup-tool-types.js +6 -1
- package/dist/types/events-tools-types.js +24 -16
- package/dist/types/faces-tools-types.js +106 -3
- package/dist/types/get-entity-tool-types.js +76 -12
- package/dist/types/guest-management-tool-types.js +103 -1
- package/dist/types/location-tool-types.js +100 -14
- package/dist/types/lost-badge-tool-types.js +17 -2
- package/dist/types/lpr-tool-types.js +47 -8
- package/dist/types/onguard-tool-types.js +21 -1
- package/dist/types/policy-alerts-tool-types.js +1 -1
- package/dist/types/report-tool-types.js +29 -1
- package/dist/types/schedule-tool-types.js +370 -0
- package/dist/types/schema.js +479 -9
- package/dist/types/time-conversion-tool-types.js +3 -4
- package/dist/types/update-tool-types.js +40 -18
- package/dist/types/user-tool-types.js +44 -1
- package/dist/types/video-walls-tool-types.js +30 -2
- package/dist/types/zod-schemas.js +5128 -996
- package/dist/util.js +62 -3
- package/dist/utils/entity-name-match.js +11 -0
- package/package.json +3 -1
package/dist/util.js
CHANGED
|
@@ -2,8 +2,8 @@ import { z } from "zod";
|
|
|
2
2
|
import fs from "fs";
|
|
3
3
|
import path from "path";
|
|
4
4
|
import { DateTime } from "luxon";
|
|
5
|
-
import { filterIncludedFields, applyFilterBy } from "./filtering-utils.js";
|
|
6
|
-
export { INCLUDE_FIELDS_ARG, FILTER_BY_ARG, filterIncludedFields, applyFilterBy, zodToDotNotationPaths, createFilteringProxy } from "./filtering-utils.js";
|
|
5
|
+
import { filterIncludedFields, applyFilterBy, applyGroupBy } from "./filtering-utils.js";
|
|
6
|
+
export { INCLUDE_FIELDS_ARG, FILTER_BY_ARG, GROUP_BY_ARG, filterIncludedFields, applyFilterBy, applyGroupBy, zodToDotNotationPaths, createFilteringProxy } from "./filtering-utils.js";
|
|
7
7
|
export function generateRandomString(length) {
|
|
8
8
|
const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
9
9
|
let result = "";
|
|
@@ -61,10 +61,20 @@ export function getFilePathsInDirectory(dirPath) {
|
|
|
61
61
|
// Tool content helpers
|
|
62
62
|
// ---------------------------------------------------------------------------
|
|
63
63
|
/**
|
|
64
|
-
* Returns an object in the form expected by `server.tool
|
|
64
|
+
* Returns an object in the form expected by `server.tool`, for the text-only
|
|
65
|
+
* results tools use to report a bad/missing argument.
|
|
66
|
+
*
|
|
67
|
+
* `isError` is REQUIRED here, not cosmetic. Every tool that calls this also
|
|
68
|
+
* registers an `outputSchema`, and the SDK's post-handler validation throws
|
|
69
|
+
* "MCP error -32602: ... no structured content was provided" for any result
|
|
70
|
+
* that lacks `structuredContent` — unless `isError` is set, which short-circuits
|
|
71
|
+
* that check (see validateToolOutput in @modelcontextprotocol/sdk server/mcp.js).
|
|
72
|
+
* Without it the -32602 REPLACES this text, so the model sees a protocol crash
|
|
73
|
+
* instead of "doorControllerUuid is required" and cannot correct its call.
|
|
65
74
|
*/
|
|
66
75
|
export function createToolTextContent(content) {
|
|
67
76
|
return {
|
|
77
|
+
isError: true,
|
|
68
78
|
content: [
|
|
69
79
|
{
|
|
70
80
|
type: "text",
|
|
@@ -90,6 +100,9 @@ export function createToolStructuredContent(content, opts) {
|
|
|
90
100
|
if (opts?.filterBy?.length) {
|
|
91
101
|
result = applyFilterBy(result, opts.filterBy) ?? result;
|
|
92
102
|
}
|
|
103
|
+
if (opts?.groupBy) {
|
|
104
|
+
result = applyGroupBy(result, opts.groupBy) ?? result;
|
|
105
|
+
}
|
|
93
106
|
if (opts?.includeFields?.length) {
|
|
94
107
|
result = filterIncludedFields(result, opts.includeFields) ?? result;
|
|
95
108
|
}
|
|
@@ -168,6 +181,52 @@ export function formatTimestamp(timestampMs, timeZone) {
|
|
|
168
181
|
locale: "en-US",
|
|
169
182
|
});
|
|
170
183
|
}
|
|
184
|
+
// ---------------------------------------------------------------------------
|
|
185
|
+
// Weekly minute intervals
|
|
186
|
+
// ---------------------------------------------------------------------------
|
|
187
|
+
const MINUTES_PER_DAY = 24 * 60;
|
|
188
|
+
const MINUTES_PER_WEEK = 7 * MINUTES_PER_DAY;
|
|
189
|
+
/**
|
|
190
|
+
* Rhombus weekly schedules store their windows as "minute of week" integers.
|
|
191
|
+
* Minute 0 is **Monday 00:00** — the order of `RhombusDayOfWeekEnum` in the
|
|
192
|
+
* api2 spec, which matches `java.time.DayOfWeek`.
|
|
193
|
+
*/
|
|
194
|
+
const WEEKDAY_NAMES = [
|
|
195
|
+
"Monday",
|
|
196
|
+
"Tuesday",
|
|
197
|
+
"Wednesday",
|
|
198
|
+
"Thursday",
|
|
199
|
+
"Friday",
|
|
200
|
+
"Saturday",
|
|
201
|
+
"Sunday",
|
|
202
|
+
];
|
|
203
|
+
/** "27000" -> "Wednesday 18:00". */
|
|
204
|
+
export function formatMinuteOfWeek(minuteOfWeek) {
|
|
205
|
+
// Negative or past-end values are normalised rather than rejected: the caller
|
|
206
|
+
// is rendering whatever api2 stored, and a wrapped window is legitimate.
|
|
207
|
+
const normalized = ((Math.trunc(minuteOfWeek) % MINUTES_PER_WEEK) + MINUTES_PER_WEEK) %
|
|
208
|
+
MINUTES_PER_WEEK;
|
|
209
|
+
const day = WEEKDAY_NAMES[Math.floor(normalized / MINUTES_PER_DAY)];
|
|
210
|
+
const minuteOfDay = normalized % MINUTES_PER_DAY;
|
|
211
|
+
const hours = String(Math.floor(minuteOfDay / 60)).padStart(2, "0");
|
|
212
|
+
const minutes = String(minuteOfDay % 60).padStart(2, "0");
|
|
213
|
+
return `${day} ${hours}:${minutes}`;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Human-readable form of one weekly window, e.g. "Monday 09:00 – Monday 17:00".
|
|
217
|
+
*
|
|
218
|
+
* Tools should emit this ALONGSIDE the raw `minuteOfWeekStart`/`Stop` integers,
|
|
219
|
+
* never instead of them: a bare 27000 is unreadable to the model, but if the
|
|
220
|
+
* Monday-is-day-0 convention above is ever wrong the formatted string would let
|
|
221
|
+
* it state the wrong day with full confidence. Keeping both makes that
|
|
222
|
+
* checkable.
|
|
223
|
+
*/
|
|
224
|
+
export function describeWeeklyInterval(minuteOfWeekStart, minuteOfWeekStop) {
|
|
225
|
+
if (typeof minuteOfWeekStart !== "number" || typeof minuteOfWeekStop !== "number") {
|
|
226
|
+
return undefined;
|
|
227
|
+
}
|
|
228
|
+
return `${formatMinuteOfWeek(minuteOfWeekStart)} – ${formatMinuteOfWeek(minuteOfWeekStop)}`;
|
|
229
|
+
}
|
|
171
230
|
/**
|
|
172
231
|
* Formats a timestamp in milliseconds to an ISO 8601 string with timezone offset.
|
|
173
232
|
* Format: "2025-04-21T10:57:00.000-07:00"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Match human names despite capitalization, spacing, or punctuation differences. */
|
|
2
|
+
export function matchesEntityName(name, query) {
|
|
3
|
+
const lowerName = name.toLowerCase();
|
|
4
|
+
const lowerQuery = query.toLowerCase();
|
|
5
|
+
if (lowerName.includes(lowerQuery))
|
|
6
|
+
return true;
|
|
7
|
+
const compact = (value) => value.normalize("NFKC").replace(/[^\p{L}\p{N}]/gu, "");
|
|
8
|
+
const compactQuery = compact(lowerQuery);
|
|
9
|
+
// Do not turn punctuation-only or tiny queries into broad matches.
|
|
10
|
+
return compactQuery.length >= 3 && compact(lowerName).includes(compactQuery);
|
|
11
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rhombus-node-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.57",
|
|
4
4
|
"description": "MCP server for Rhombus API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"test:watch": "vitest",
|
|
36
36
|
"watch": "npm run clean && tsc --watch",
|
|
37
37
|
"generate-schemas": "npx tsx scripts/generate-zod-schemas.ts",
|
|
38
|
+
"generate-openapi-types": "npx tsx scripts/generate-openapi-types.ts",
|
|
38
39
|
"scrape-sitemaps": "npx tsx scripts/scrape-sitemaps.ts",
|
|
39
40
|
"scrape-content": "npx tsx scripts/scrape-content.ts",
|
|
40
41
|
"scrape-progress": "npx tsx scripts/scrape-content.ts --progress",
|
|
@@ -70,6 +71,7 @@
|
|
|
70
71
|
"@types/express": "^5.0.3",
|
|
71
72
|
"@types/luxon": "^3.6.2",
|
|
72
73
|
"@types/node": "^22.14.0",
|
|
74
|
+
"openapi-typescript": "^7.13.0",
|
|
73
75
|
"openapi-typescript-codegen": "^0.29.0",
|
|
74
76
|
"openapi-zod-client": "^1.17.0",
|
|
75
77
|
"prettier": "3.5.3",
|