rhombus-node-mcp 0.1.22 → 0.1.23
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/README.md +8 -0
- package/dist/api/access-control-tool-api.js +256 -0
- package/dist/api/alarm-monitoring-tool-api.js +65 -0
- package/dist/api/camera-tool-api.js +35 -15
- package/dist/api/camera-uptime-tool-api.js +112 -0
- package/dist/api/clips-tool-api.js +110 -21
- package/dist/api/create-tool-api.js +143 -16
- package/dist/api/door-tool-api.js +66 -0
- package/dist/api/events-tool-api.js +151 -28
- package/dist/api/faces-tool-api.js +118 -90
- package/dist/api/get-entity-tool-api.js +2 -0
- package/dist/api/guest-management-tool-api.js +75 -0
- package/dist/api/location-tool-api.js +48 -1
- package/dist/api/lpr-tool-api.js +26 -0
- package/dist/api/policy-alerts-tool-api.js +54 -0
- package/dist/api/report-tool-api.js +345 -23
- package/dist/api/rules-tool-api.js +78 -0
- package/dist/api/search-tool-api.js +93 -0
- package/dist/api/time-tool-api.js +3 -1
- package/dist/api/update-tool-api.js +204 -0
- package/dist/api/user-access-trail-tool-api.js +45 -0
- package/dist/api/user-audit-tool-api.js +47 -0
- package/dist/api/user-tool-api.js +77 -0
- package/dist/createServer.js +3 -1
- package/dist/filtering-utils.js +298 -0
- package/dist/index.js +0 -9
- package/dist/logger.js +6 -5
- package/dist/network.js +18 -4
- package/dist/tools/access-control-tool.js +97 -0
- package/dist/tools/alarm-monitoring-tool.js +50 -0
- package/dist/tools/analytics-tool.js +383 -0
- package/dist/tools/camera-tool.js +27 -9
- package/dist/tools/camera-uptime-tool.js +50 -0
- package/dist/tools/clips-tool.js +46 -16
- package/dist/tools/door-tool.js +66 -0
- package/dist/tools/events-tool.js +103 -81
- package/dist/tools/faces-tool.js +175 -32
- package/dist/tools/get-entity-tool.js +6 -1
- package/dist/tools/guest-management-tool.js +50 -0
- package/dist/tools/location-tool.js +23 -4
- package/dist/tools/lpr-tool.js +26 -20
- package/dist/tools/policy-alerts-tool.js +34 -4
- package/dist/tools/report-tool.js +181 -45
- package/dist/tools/rules-tool.js +76 -0
- package/dist/tools/search-tool.js +69 -0
- package/dist/tools/update-tool.js +63 -2
- package/dist/tools/user-access-trail-tool.js +64 -0
- package/dist/tools/user-audit-tool.js +53 -0
- package/dist/tools/user-tool.js +55 -0
- package/dist/tools/video-walls-tool.js +41 -0
- package/dist/transports/streamable-http.js +25 -15
- package/dist/types/access-control-tool-types.js +120 -0
- package/dist/types/alarm-monitoring-tool-types.js +60 -0
- package/dist/types/analytics-tool-types.js +190 -0
- package/dist/types/camera-tool-types.js +3 -2
- package/dist/types/camera-uptime-tool-types.js +52 -0
- package/dist/types/clips-tool-types.js +60 -11
- package/dist/types/door-tool-types.js +64 -0
- package/dist/types/events-tools-types.js +71 -3
- package/dist/types/faces-tools-types.js +36 -0
- package/dist/types/guest-management-tool-types.js +57 -0
- package/dist/types/location-tool-types.js +10 -1
- package/dist/types/lpr-tool-types.js +14 -0
- package/dist/types/policy-alerts-tool-types.js +38 -3
- package/dist/types/report-tool-types.js +284 -42
- package/dist/types/rules-tool-types.js +58 -0
- package/dist/types/schema.js +3123 -1
- package/dist/types/search-tool-types.js +82 -0
- package/dist/types/update-tool-types.js +4 -1
- package/dist/types/user-access-trail-tool-types.js +54 -0
- package/dist/types/user-audit-tool-types.js +48 -0
- package/dist/types/user-tool-types.js +61 -0
- package/dist/types/video-walls-tool-types.js +59 -0
- package/dist/types/zod-schemas.js +3237 -986
- package/dist/types.js +0 -21
- package/dist/util.js +34 -57
- package/package.json +7 -5
- package/dist/disabled-tools/semantic-search-tool.js +0 -90
- package/dist/tools/create-tool.js +0 -30
- package/dist/types/create-tool-types.js +0 -8
- package/dist/types/schema-components.js +0 -7211
- package/dist/types/semantic-search-tool-types.js +0 -5
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ISOTimestampFormatDescription } from "../utils/timestampInput.js";
|
|
3
|
+
import { INCLUDE_FIELDS_ARG, FILTER_BY_ARG } from "../util.js";
|
|
4
|
+
export var SearchToolRequestType;
|
|
5
|
+
(function (SearchToolRequestType) {
|
|
6
|
+
SearchToolRequestType["LICENSE_PLATE"] = "license-plate";
|
|
7
|
+
SearchToolRequestType["OBJECT_BY_COLOR"] = "object-by-color";
|
|
8
|
+
SearchToolRequestType["OBJECT_BY_TEXT"] = "object-by-text";
|
|
9
|
+
SearchToolRequestType["MOTION_SEARCH"] = "motion-search";
|
|
10
|
+
})(SearchToolRequestType || (SearchToolRequestType = {}));
|
|
11
|
+
export const TOOL_ARGS = {
|
|
12
|
+
requestType: z.nativeEnum(SearchToolRequestType).describe("The type of search to perform."),
|
|
13
|
+
query: z
|
|
14
|
+
.string()
|
|
15
|
+
.nullable()
|
|
16
|
+
.describe("The search query string. Required for 'license-plate' (plate number), 'object-by-text' (text description of object), 'object-by-color' (color name)."),
|
|
17
|
+
cameraUuid: z
|
|
18
|
+
.string()
|
|
19
|
+
.nullable()
|
|
20
|
+
.describe("The UUID of the camera to search. Required for 'motion-search' and 'object-by-color'."),
|
|
21
|
+
startTime: z
|
|
22
|
+
.string()
|
|
23
|
+
.datetime({ message: "Invalid datetime string. Expected ISO 8601 format.", offset: true })
|
|
24
|
+
.nullable()
|
|
25
|
+
.describe("Start time for the search range." + ISOTimestampFormatDescription),
|
|
26
|
+
endTime: z
|
|
27
|
+
.string()
|
|
28
|
+
.datetime({ message: "Invalid datetime string. Expected ISO 8601 format.", offset: true })
|
|
29
|
+
.nullable()
|
|
30
|
+
.describe("End time for the search range." + ISOTimestampFormatDescription),
|
|
31
|
+
deviceUuids: z
|
|
32
|
+
.array(z.string())
|
|
33
|
+
.nullable()
|
|
34
|
+
.describe("Optional list of device UUIDs to filter search results."),
|
|
35
|
+
locationUuids: z
|
|
36
|
+
.array(z.string())
|
|
37
|
+
.nullable()
|
|
38
|
+
.describe("Optional list of location UUIDs to filter search results."),
|
|
39
|
+
timeZone: z
|
|
40
|
+
.string()
|
|
41
|
+
.nullable()
|
|
42
|
+
.describe("The timezone for formatting timestamps."),
|
|
43
|
+
includeFields: INCLUDE_FIELDS_ARG,
|
|
44
|
+
filterBy: FILTER_BY_ARG,
|
|
45
|
+
};
|
|
46
|
+
const TOOL_ARGS_SCHEMA = z.object(TOOL_ARGS);
|
|
47
|
+
export const OUTPUT_SCHEMA = z.object({
|
|
48
|
+
licensePlateResults: z
|
|
49
|
+
.array(z.object({
|
|
50
|
+
licensePlate: z.string().optional(),
|
|
51
|
+
deviceUuid: z.string().optional(),
|
|
52
|
+
timestampMs: z.number().optional(),
|
|
53
|
+
confidence: z.number().optional(),
|
|
54
|
+
}))
|
|
55
|
+
.optional()
|
|
56
|
+
.describe("License plate search results"),
|
|
57
|
+
objectColorResults: z
|
|
58
|
+
.array(z.object({
|
|
59
|
+
deviceUuid: z.string().optional(),
|
|
60
|
+
timestampMs: z.number().optional(),
|
|
61
|
+
objectType: z.string().optional(),
|
|
62
|
+
color: z.string().optional(),
|
|
63
|
+
}))
|
|
64
|
+
.optional()
|
|
65
|
+
.describe("Object color search results"),
|
|
66
|
+
objectTextResults: z
|
|
67
|
+
.array(z.object({
|
|
68
|
+
deviceUuid: z.string().optional(),
|
|
69
|
+
timestampMs: z.number().optional(),
|
|
70
|
+
score: z.number().optional(),
|
|
71
|
+
}))
|
|
72
|
+
.optional()
|
|
73
|
+
.describe("Object text search results"),
|
|
74
|
+
motionResults: z
|
|
75
|
+
.array(z.object({
|
|
76
|
+
timestampMs: z.number().optional(),
|
|
77
|
+
motionScore: z.number().optional(),
|
|
78
|
+
}))
|
|
79
|
+
.optional()
|
|
80
|
+
.describe("Motion search results"),
|
|
81
|
+
error: z.string().optional().describe("An error message if the request failed."),
|
|
82
|
+
});
|
|
@@ -5,6 +5,9 @@ export const ENTITY_TYPE = z.enum([
|
|
|
5
5
|
"climate-sensor",
|
|
6
6
|
"door-controller",
|
|
7
7
|
"environmental-gateway",
|
|
8
|
+
"audio-gateway",
|
|
9
|
+
"doorbell-camera",
|
|
10
|
+
"badge-reader",
|
|
8
11
|
]);
|
|
9
12
|
// Camera-specific update schemas
|
|
10
13
|
export const CameraVideoSettings = z.object({
|
|
@@ -26,7 +29,7 @@ export const CameraVideoSettings = z.object({
|
|
|
26
29
|
.optional()
|
|
27
30
|
.describe("Video resolution (width x height)"),
|
|
28
31
|
wdr_enabled: z.boolean().optional().describe("Enable Wide Dynamic Range"),
|
|
29
|
-
wdr_strength: z.number().min(0).max(128).optional().describe("WDR strength (0 to 128)"),
|
|
32
|
+
wdr_strength: z.number().min(0).max(128).optional().describe("WDR strength (0 minimum to 128 maximum)"),
|
|
30
33
|
video_persist_disabled: z.boolean().optional().describe("Disable video persistence"),
|
|
31
34
|
zero_motion_video_bitrate_percent: z
|
|
32
35
|
.number()
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { INCLUDE_FIELDS_ARG, FILTER_BY_ARG } from "../util.js";
|
|
3
|
+
export var UserAccessTrailRequestType;
|
|
4
|
+
(function (UserAccessTrailRequestType) {
|
|
5
|
+
UserAccessTrailRequestType["GET_ACCESS_EVENTS_BY_USER"] = "get-access-events-by-user";
|
|
6
|
+
UserAccessTrailRequestType["GET_ACCESS_EVENTS_BY_EMAIL"] = "get-access-events-by-email";
|
|
7
|
+
})(UserAccessTrailRequestType || (UserAccessTrailRequestType = {}));
|
|
8
|
+
export const TOOL_ARGS = {
|
|
9
|
+
requestType: z
|
|
10
|
+
.nativeEnum(UserAccessTrailRequestType)
|
|
11
|
+
.describe("The type of access trail request."),
|
|
12
|
+
userUuid: z
|
|
13
|
+
.string()
|
|
14
|
+
.nullable()
|
|
15
|
+
.describe("User UUID. Required for 'get-access-events-by-user'."),
|
|
16
|
+
email: z
|
|
17
|
+
.string()
|
|
18
|
+
.nullable()
|
|
19
|
+
.describe("User email address. Required for 'get-access-events-by-email'. Will resolve to userUuid automatically."),
|
|
20
|
+
startTimeMs: z
|
|
21
|
+
.number()
|
|
22
|
+
.nullable()
|
|
23
|
+
.describe("Start time filter in milliseconds since epoch."),
|
|
24
|
+
endTimeMs: z
|
|
25
|
+
.number()
|
|
26
|
+
.nullable()
|
|
27
|
+
.describe("End time filter in milliseconds since epoch."),
|
|
28
|
+
limit: z
|
|
29
|
+
.number()
|
|
30
|
+
.nullable()
|
|
31
|
+
.describe("Maximum number of events to return. Defaults to 100."),
|
|
32
|
+
includeFields: INCLUDE_FIELDS_ARG,
|
|
33
|
+
filterBy: FILTER_BY_ARG,
|
|
34
|
+
};
|
|
35
|
+
const TOOL_ARGS_SCHEMA = z.object(TOOL_ARGS);
|
|
36
|
+
const AccessEventSchema = z.object({
|
|
37
|
+
eventUuid: z.string().optional(),
|
|
38
|
+
eventType: z.string().optional(),
|
|
39
|
+
timestampMs: z.number().optional(),
|
|
40
|
+
locationUuid: z.string().optional(),
|
|
41
|
+
componentUuid: z.string().optional(),
|
|
42
|
+
ownerDeviceUuid: z.string().optional(),
|
|
43
|
+
authorizationResult: z.string().optional(),
|
|
44
|
+
authenticationResult: z.string().optional(),
|
|
45
|
+
});
|
|
46
|
+
export const OUTPUT_SCHEMA = z.object({
|
|
47
|
+
userUuid: z.string().optional().describe("Resolved user UUID"),
|
|
48
|
+
userName: z.string().optional().describe("Resolved user name"),
|
|
49
|
+
accessEvents: z
|
|
50
|
+
.array(AccessEventSchema)
|
|
51
|
+
.optional()
|
|
52
|
+
.describe("List of access control events for the user, ordered by time"),
|
|
53
|
+
error: z.string().optional().describe("An error message if the request failed."),
|
|
54
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { INCLUDE_FIELDS_ARG, FILTER_BY_ARG } from "../util.js";
|
|
3
|
+
export var UserAuditRequestType;
|
|
4
|
+
(function (UserAuditRequestType) {
|
|
5
|
+
UserAuditRequestType["AUDIT_BY_USER"] = "audit-by-user";
|
|
6
|
+
UserAuditRequestType["AUDIT_BY_TARGET"] = "audit-by-target";
|
|
7
|
+
})(UserAuditRequestType || (UserAuditRequestType = {}));
|
|
8
|
+
export const TOOL_ARGS = {
|
|
9
|
+
requestType: z
|
|
10
|
+
.nativeEnum(UserAuditRequestType)
|
|
11
|
+
.describe("The type of audit request to make."),
|
|
12
|
+
userUuid: z
|
|
13
|
+
.string()
|
|
14
|
+
.nullable()
|
|
15
|
+
.describe("User UUID whose actions to audit. Required for 'audit-by-user'. Use user-tool to find this."),
|
|
16
|
+
targetUuid: z
|
|
17
|
+
.string()
|
|
18
|
+
.nullable()
|
|
19
|
+
.describe("Target entity UUID (camera, door, policy, etc.) to see what has been done to it. Required for 'audit-by-target'."),
|
|
20
|
+
maxResults: z
|
|
21
|
+
.number()
|
|
22
|
+
.nullable()
|
|
23
|
+
.describe("Maximum number of audit events to return. Defaults to 50."),
|
|
24
|
+
includeFields: INCLUDE_FIELDS_ARG,
|
|
25
|
+
filterBy: FILTER_BY_ARG,
|
|
26
|
+
};
|
|
27
|
+
const TOOL_ARGS_SCHEMA = z.object(TOOL_ARGS);
|
|
28
|
+
const AuditEventSchema = z.object({
|
|
29
|
+
uuid: z.string().optional(),
|
|
30
|
+
action: z.string().optional(),
|
|
31
|
+
displayText: z.string().optional(),
|
|
32
|
+
principalName: z.string().optional(),
|
|
33
|
+
principalUuid: z.string().optional(),
|
|
34
|
+
targetName: z.string().optional(),
|
|
35
|
+
targetUuid: z.string().optional(),
|
|
36
|
+
timestamp: z.string().optional(),
|
|
37
|
+
failure: z.boolean().optional(),
|
|
38
|
+
sourceIp: z.string().optional(),
|
|
39
|
+
sourceCity: z.string().optional(),
|
|
40
|
+
sourceCountry: z.string().optional(),
|
|
41
|
+
});
|
|
42
|
+
export const OUTPUT_SCHEMA = z.object({
|
|
43
|
+
auditEvents: z
|
|
44
|
+
.array(AuditEventSchema)
|
|
45
|
+
.optional()
|
|
46
|
+
.describe("List of audit events, most recent first"),
|
|
47
|
+
error: z.string().optional().describe("An error message if the request failed."),
|
|
48
|
+
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { INCLUDE_FIELDS_ARG, FILTER_BY_ARG } from "../util.js";
|
|
3
|
+
export var UserToolRequestType;
|
|
4
|
+
(function (UserToolRequestType) {
|
|
5
|
+
UserToolRequestType["LIST_USERS"] = "list-users";
|
|
6
|
+
UserToolRequestType["FIND_BY_EMAIL"] = "find-by-email";
|
|
7
|
+
UserToolRequestType["GET_PERMISSIONS"] = "get-permissions";
|
|
8
|
+
UserToolRequestType["GET_PERMISSION_GROUPS"] = "get-permission-groups";
|
|
9
|
+
})(UserToolRequestType || (UserToolRequestType = {}));
|
|
10
|
+
export const TOOL_ARGS = {
|
|
11
|
+
requestType: z.nativeEnum(UserToolRequestType).describe("The type of user request to make."),
|
|
12
|
+
email: z
|
|
13
|
+
.string()
|
|
14
|
+
.nullable()
|
|
15
|
+
.describe("The email address of the user to find. Required for 'find-by-email'."),
|
|
16
|
+
includeFields: INCLUDE_FIELDS_ARG,
|
|
17
|
+
filterBy: FILTER_BY_ARG,
|
|
18
|
+
};
|
|
19
|
+
const TOOL_ARGS_SCHEMA = z.object(TOOL_ARGS);
|
|
20
|
+
export const OUTPUT_SCHEMA = z.object({
|
|
21
|
+
users: z
|
|
22
|
+
.array(z.object({
|
|
23
|
+
uuid: z.string().optional(),
|
|
24
|
+
email: z.string().optional(),
|
|
25
|
+
firstName: z.string().optional(),
|
|
26
|
+
lastName: z.string().optional(),
|
|
27
|
+
}))
|
|
28
|
+
.optional()
|
|
29
|
+
.describe("List of users in the organization"),
|
|
30
|
+
user: z
|
|
31
|
+
.object({
|
|
32
|
+
uuid: z.string().optional(),
|
|
33
|
+
email: z.string().optional(),
|
|
34
|
+
firstName: z.string().optional(),
|
|
35
|
+
lastName: z.string().optional(),
|
|
36
|
+
role: z.string().optional(),
|
|
37
|
+
orgUuid: z.string().optional(),
|
|
38
|
+
lastLoginMs: z.number().optional(),
|
|
39
|
+
enabled: z.boolean().optional(),
|
|
40
|
+
mfaEnabled: z.boolean().optional(),
|
|
41
|
+
})
|
|
42
|
+
.optional()
|
|
43
|
+
.describe("A single user found by email"),
|
|
44
|
+
permissions: z
|
|
45
|
+
.object({
|
|
46
|
+
role: z.string().optional(),
|
|
47
|
+
functionalityAccessMap: z.record(z.string()).optional(),
|
|
48
|
+
})
|
|
49
|
+
.optional()
|
|
50
|
+
.describe("Current user permissions"),
|
|
51
|
+
permissionGroups: z
|
|
52
|
+
.array(z.object({
|
|
53
|
+
uuid: z.string().optional(),
|
|
54
|
+
name: z.string().optional(),
|
|
55
|
+
orgUuid: z.string().optional(),
|
|
56
|
+
role: z.string().optional(),
|
|
57
|
+
}))
|
|
58
|
+
.optional()
|
|
59
|
+
.describe("List of permission groups"),
|
|
60
|
+
error: z.string().optional().describe("An error message if the request failed."),
|
|
61
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { INCLUDE_FIELDS_ARG, FILTER_BY_ARG } from "../util.js";
|
|
3
|
+
export const VideoWallSettings = z.object({
|
|
4
|
+
numVisibleDevicesAtOnce: z.number().nullable().describe(`The number of devices to display at once. If there is no rotation strategy and/or interval,
|
|
5
|
+
then this value can be null.
|
|
6
|
+
|
|
7
|
+
If there is a rotation strategy, then this value must be between 1 and the number of devices.
|
|
8
|
+
Choose something reasonable, or ask the user for input.
|
|
9
|
+
`),
|
|
10
|
+
intervalSeconds: z.number().nullable(),
|
|
11
|
+
rotateStrategy: z.enum(["none", "motion", "interval"]),
|
|
12
|
+
});
|
|
13
|
+
export const CreateVideoWallOptions = z
|
|
14
|
+
.object({
|
|
15
|
+
displayName: z.string().nullable().describe("What to call the video wall"),
|
|
16
|
+
orgUuid: z.string().describe("The uuid of the organization"),
|
|
17
|
+
deviceList: z
|
|
18
|
+
.array(z.string())
|
|
19
|
+
.min(1)
|
|
20
|
+
.describe("The list of camera uuids (unique identifiers) to exist in the video wall. You must provide this manually by prompting the user at least once."),
|
|
21
|
+
othersCanEdit: z
|
|
22
|
+
.boolean()
|
|
23
|
+
.nullable()
|
|
24
|
+
.describe("Whether or not other users can edit the wall, defaults to false"),
|
|
25
|
+
settings: VideoWallSettings,
|
|
26
|
+
})
|
|
27
|
+
.nullable()
|
|
28
|
+
.describe("The options for creating a video wall. This is required if your requestType === `create`");
|
|
29
|
+
export const TOOL_ARGS = {
|
|
30
|
+
requestType: z
|
|
31
|
+
.enum(["list", "create"])
|
|
32
|
+
.describe("The type of request to make."),
|
|
33
|
+
videoWallCreateOptions: CreateVideoWallOptions,
|
|
34
|
+
includeFields: INCLUDE_FIELDS_ARG,
|
|
35
|
+
filterBy: FILTER_BY_ARG,
|
|
36
|
+
};
|
|
37
|
+
const TOOL_ARGS_SCHEMA = z.object(TOOL_ARGS);
|
|
38
|
+
export const OUTPUT_SCHEMA = z.object({
|
|
39
|
+
error: z
|
|
40
|
+
.optional(z.string())
|
|
41
|
+
.describe("If this field exists, then an error occured and contains the error message."),
|
|
42
|
+
needUserInput: z
|
|
43
|
+
.boolean()
|
|
44
|
+
.optional()
|
|
45
|
+
.describe("If this field exists and is true, then the tool requires additional input from the user."),
|
|
46
|
+
commandForUser: z
|
|
47
|
+
.string()
|
|
48
|
+
.optional()
|
|
49
|
+
.describe("If this field exists, then the tool requires additional input from the user."),
|
|
50
|
+
videoWalls: z
|
|
51
|
+
.array(z.any())
|
|
52
|
+
.describe("If requestType is `list`, then this field will be populated with the list of video walls.")
|
|
53
|
+
.optional(),
|
|
54
|
+
videoWall: z
|
|
55
|
+
.array(z.any())
|
|
56
|
+
.describe("If requestType is `get`, then this field will be populated with the video wall.")
|
|
57
|
+
.optional(),
|
|
58
|
+
uuid: z.string().describe("The uuid of the created video wall.").optional(),
|
|
59
|
+
});
|