@rome-os/node-core 0.1.7 → 0.1.10
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 +4 -5
- package/dist/actions.d.ts +2 -1
- package/dist/actions.js +3 -3
- package/dist/audit.d.ts +6 -0
- package/dist/audit.js +11 -0
- package/dist/client.d.ts +2 -1
- package/dist/client.js +12 -3
- package/dist/cloud.js +1 -2
- package/dist/computer-use/audit-fields.d.ts +5 -0
- package/dist/computer-use/audit-fields.js +17 -0
- package/dist/computer-use/bridge.d.ts +53 -0
- package/dist/computer-use/bridge.js +361 -0
- package/dist/computer-use/discovery.d.ts +14 -0
- package/dist/computer-use/discovery.js +117 -0
- package/dist/computer-use/frames.d.ts +9 -0
- package/dist/computer-use/frames.js +100 -0
- package/dist/computer-use/host.d.ts +90 -0
- package/dist/computer-use/host.js +765 -0
- package/dist/computer-use/launch.d.ts +55 -0
- package/dist/computer-use/launch.js +375 -0
- package/dist/computer-use/protocol.d.ts +238 -0
- package/dist/computer-use/protocol.js +441 -0
- package/dist/connect.d.ts +10 -24
- package/dist/connect.js +8 -112
- package/dist/daemon-client.js +1 -1
- package/dist/daemon.js +15 -3
- package/dist/devices-status.d.ts +2 -1
- package/dist/devices-status.js +16 -10
- package/dist/executor.d.ts +2 -1
- package/dist/executor.js +124 -134
- package/dist/host-connection.d.ts +37 -0
- package/dist/host-connection.js +114 -0
- package/dist/host.d.ts +6 -1
- package/dist/host.js +3 -0
- package/dist/limited-host.d.ts +3 -0
- package/dist/limited-host.js +5 -0
- package/dist/limited.d.ts +10 -0
- package/dist/limited.js +43 -0
- package/dist/protocol.d.ts +13 -0
- package/dist/protocol.js +29 -0
- package/package.json +5 -1
package/dist/protocol.d.ts
CHANGED
|
@@ -26,5 +26,18 @@ export type GatewayMessage = InboundEnvelope | RouteError;
|
|
|
26
26
|
export declare function validId(value: unknown): value is string;
|
|
27
27
|
export declare function outboundEnvelope(value: unknown): OutboundEnvelope | null;
|
|
28
28
|
export declare function gatewayMessage(value: unknown): GatewayMessage | null;
|
|
29
|
+
export interface GatewayNotification {
|
|
30
|
+
title: string;
|
|
31
|
+
body: string;
|
|
32
|
+
instanceId: string;
|
|
33
|
+
level?: "active" | "passive";
|
|
34
|
+
chatId?: string;
|
|
35
|
+
}
|
|
36
|
+
export declare const NOTIFICATION_LIMITS: {
|
|
37
|
+
readonly title: 200;
|
|
38
|
+
readonly body: 2000;
|
|
39
|
+
readonly id: 128;
|
|
40
|
+
};
|
|
41
|
+
export declare function gatewayNotification(value: unknown): GatewayNotification | null;
|
|
29
42
|
export declare function byteLength(value: string): number;
|
|
30
43
|
export {};
|
package/dist/protocol.js
CHANGED
|
@@ -35,6 +35,35 @@ export function gatewayMessage(value) {
|
|
|
35
35
|
return { id: item.id, from: item.from, payload: item.payload };
|
|
36
36
|
return null;
|
|
37
37
|
}
|
|
38
|
+
export const NOTIFICATION_LIMITS = { title: 200, body: 2000, id: 128 };
|
|
39
|
+
const text = (value, max) => typeof value === "string" && value.length > 0 && value.length <= max;
|
|
40
|
+
export function gatewayNotification(value) {
|
|
41
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
42
|
+
return null;
|
|
43
|
+
const item = value;
|
|
44
|
+
if (item.type !== "notification" || Object.hasOwn(item, "id") || Object.hasOwn(item, "from"))
|
|
45
|
+
return null;
|
|
46
|
+
if (!text(item.title, NOTIFICATION_LIMITS.title) ||
|
|
47
|
+
!text(item.body, NOTIFICATION_LIMITS.body) ||
|
|
48
|
+
!text(item.instanceId, NOTIFICATION_LIMITS.id))
|
|
49
|
+
return null;
|
|
50
|
+
const notification = {
|
|
51
|
+
title: item.title,
|
|
52
|
+
body: item.body,
|
|
53
|
+
instanceId: item.instanceId,
|
|
54
|
+
};
|
|
55
|
+
if (item.level !== undefined) {
|
|
56
|
+
if (item.level !== "active" && item.level !== "passive")
|
|
57
|
+
return null;
|
|
58
|
+
notification.level = item.level;
|
|
59
|
+
}
|
|
60
|
+
if (item.chatId !== undefined) {
|
|
61
|
+
if (!text(item.chatId, NOTIFICATION_LIMITS.id))
|
|
62
|
+
return null;
|
|
63
|
+
notification.chatId = item.chatId;
|
|
64
|
+
}
|
|
65
|
+
return notification;
|
|
66
|
+
}
|
|
38
67
|
export function byteLength(value) {
|
|
39
68
|
return new TextEncoder().encode(value).byteLength;
|
|
40
69
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rome-os/node-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "JavaScript APIs for Rome device hosts and shared caller daemons",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"files": [
|
|
11
11
|
"bin",
|
|
12
12
|
"dist",
|
|
13
|
+
"!dist/**/*.app/**",
|
|
13
14
|
"README.md"
|
|
14
15
|
],
|
|
15
16
|
"exports": {
|
|
@@ -49,6 +50,9 @@
|
|
|
49
50
|
"dependencies": {
|
|
50
51
|
"ws": "^8.18.0"
|
|
51
52
|
},
|
|
53
|
+
"optionalDependencies": {
|
|
54
|
+
"@rome-os/node-core-darwin-arm64": "0.1.10"
|
|
55
|
+
},
|
|
52
56
|
"devDependencies": {
|
|
53
57
|
"@rstest/core": "^0.11.11",
|
|
54
58
|
"@types/node": "25.2.3",
|