@m1kad0/hannah-proto 0.0.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/dist/agent.d.ts +307 -0
- package/dist/agent.js +18 -0
- package/dist/car_state.d.ts +49 -0
- package/dist/car_state.js +10 -0
- package/dist/control.d.ts +343 -0
- package/dist/control.js +10 -0
- package/dist/device_control_menu.d.ts +37 -0
- package/dist/device_control_menu.js +10 -0
- package/dist/event_stream.d.ts +33 -0
- package/dist/event_stream.js +9 -0
- package/dist/hannah.d.ts +1 -0
- package/dist/hannah.js +10 -0
- package/dist/satellite_provisioning.d.ts +14 -0
- package/dist/satellite_provisioning.js +10 -0
- package/dist/satellite_proxy.d.ts +80 -0
- package/dist/satellite_proxy.js +10 -0
- package/dist/shared.d.ts +7 -0
- package/dist/shared.js +10 -0
- package/dist/speaker_enrollment.d.ts +9 -0
- package/dist/speaker_enrollment.js +10 -0
- package/dist/timer_service.d.ts +101 -0
- package/dist/timer_service.js +10 -0
- package/dist/user_registry.d.ts +120 -0
- package/dist/user_registry.js +9 -0
- package/dist/wakeword_capture.d.ts +33 -0
- package/dist/wakeword_capture.js +10 -0
- package/package.json +21 -0
package/dist/agent.d.ts
ADDED
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
export declare const protobufPackage = "hannah";
|
|
2
|
+
export declare enum ResidentType {
|
|
3
|
+
RESIDENT_TYPE_UNSPECIFIED = 0,
|
|
4
|
+
ROOMIE = 1,
|
|
5
|
+
GUEST = 2,
|
|
6
|
+
PET = 3,
|
|
7
|
+
UNRECOGNIZED = -1
|
|
8
|
+
}
|
|
9
|
+
/** Sent by the HannahAgent ioBroker adapter over the AgentConnect stream. */
|
|
10
|
+
export interface AgentMessage {
|
|
11
|
+
/** any ioBroker state changed */
|
|
12
|
+
stateUpdate?: AgentStateUpdate | undefined;
|
|
13
|
+
/** residents adapter presence changed */
|
|
14
|
+
residentUpdate?: AgentResident | undefined;
|
|
15
|
+
/** text command state changed */
|
|
16
|
+
textCommand?: AgentTextCommand | undefined;
|
|
17
|
+
/** satellite control command */
|
|
18
|
+
satelliteControl?: AgentSatelliteControl | undefined;
|
|
19
|
+
/** initial snapshot with all states */
|
|
20
|
+
sendSnapshot?: AgentDeviceSnapshot | undefined;
|
|
21
|
+
/** initial snapshot with all residents */
|
|
22
|
+
sendResidents?: AgentResidentSnapshot | undefined;
|
|
23
|
+
/** ask Resident via Hannah */
|
|
24
|
+
askResident?: AgentAskResident | undefined;
|
|
25
|
+
/** full room catalog, independent of devices */
|
|
26
|
+
sendRooms?: AgentRoomSnapshot | undefined;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Adapter instructs Hannah to control satellites in a room or a specific satellite.
|
|
30
|
+
* room: room_id (enum ID segment) or "all" for all rooms.
|
|
31
|
+
* device_id: if non-empty, only the named satellite is targeted (volume/mute only);
|
|
32
|
+
* room is still required (used for room-scoped commands and as fallback).
|
|
33
|
+
*/
|
|
34
|
+
export interface AgentSatelliteControl {
|
|
35
|
+
room: string;
|
|
36
|
+
/** optional: target a specific satellite instead of the whole room */
|
|
37
|
+
deviceId: string;
|
|
38
|
+
/** set do-not-disturb */
|
|
39
|
+
dnd?: boolean | undefined;
|
|
40
|
+
/** mute/unmute microphone */
|
|
41
|
+
mute?: boolean | undefined;
|
|
42
|
+
/** set volume (0–100) */
|
|
43
|
+
volume?: number | undefined;
|
|
44
|
+
/** speak plain-text announcement (verbatim) */
|
|
45
|
+
announcement?: string | undefined;
|
|
46
|
+
/** speak SSML announcement */
|
|
47
|
+
announcementSsml?: string | undefined;
|
|
48
|
+
/** speak announcement, text rephrased by LLM first */
|
|
49
|
+
announcementRephrase?: string | undefined;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* An ioBroker state change event. ack=true means the device confirmed the value
|
|
53
|
+
* (as opposed to ack=false which is the "desired" value). Hannah uses this to
|
|
54
|
+
* verify that a SetState command was executed successfully.
|
|
55
|
+
*/
|
|
56
|
+
export interface AgentStateUpdate {
|
|
57
|
+
/** full ioBroker state ID, e.g. "javascript.0.virtualDevice.Licht.EG.Wohnzimmer.DeckeSeite.on" */
|
|
58
|
+
stateId: string;
|
|
59
|
+
/** JSON-encoded value: "true", "42", "\"text\"" */
|
|
60
|
+
value: string;
|
|
61
|
+
/** true = confirmed by device */
|
|
62
|
+
ack: boolean;
|
|
63
|
+
/** Unix timestamp in milliseconds */
|
|
64
|
+
ts: number;
|
|
65
|
+
}
|
|
66
|
+
/** The text-command state in ioBroker changed — treat as a SubmitText call. */
|
|
67
|
+
export interface AgentTextCommand {
|
|
68
|
+
text: string;
|
|
69
|
+
}
|
|
70
|
+
/** Sent by Hannah Core over the AgentConnect stream. */
|
|
71
|
+
export interface AgentCommand {
|
|
72
|
+
/** Hannah wants to control an ioBroker device */
|
|
73
|
+
setState?: AgentSetState | undefined;
|
|
74
|
+
/** Hannah needs additional states streamed */
|
|
75
|
+
watchMore?: AgentWatchMore | undefined;
|
|
76
|
+
/** Hannah wants to set a resident's presence state */
|
|
77
|
+
setResident?: AgentSetResident | undefined;
|
|
78
|
+
/** a satellite registered or disconnected */
|
|
79
|
+
satelliteUpdate?: AgentSatelliteUpdate | undefined;
|
|
80
|
+
/** Hannah's answer to a text command */
|
|
81
|
+
textAnswer?: AgentTextAnswer | undefined;
|
|
82
|
+
/** satellite firmware version update */
|
|
83
|
+
firmwareEvent?: AgentFirmwareEvent | undefined;
|
|
84
|
+
/** BLE tag location changed */
|
|
85
|
+
bleUpdate?: AgentBleUpdate | undefined;
|
|
86
|
+
/** satellite sensor reading */
|
|
87
|
+
sensorUpdate?: AgentSensorUpdate | undefined;
|
|
88
|
+
/** answer to an ask_resident request */
|
|
89
|
+
residentAnswered?: AgentResidentAnswered | undefined;
|
|
90
|
+
/** Hannah Core deleted a satellite — adapter must remove its object tree */
|
|
91
|
+
satelliteDeleted?: AgentSatelliteDeleted | undefined;
|
|
92
|
+
/** Hannah wants to set a resident's mood, independent of presence */
|
|
93
|
+
setResidentMood?: AgentSetResidentMood | undefined;
|
|
94
|
+
}
|
|
95
|
+
export interface AgentFirmwareEvent {
|
|
96
|
+
device: string;
|
|
97
|
+
version: string;
|
|
98
|
+
/** true = newer version pending, false = current version report */
|
|
99
|
+
updateAvailable: boolean;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Hannah instructs the adapter to set an ioBroker state.
|
|
103
|
+
* The adapter calls setForeignState(); the resulting ack=true AgentStateUpdate
|
|
104
|
+
* confirms execution back to Hannah.
|
|
105
|
+
*/
|
|
106
|
+
export interface AgentSetState {
|
|
107
|
+
/** ioBroker state ID to write */
|
|
108
|
+
stateId: string;
|
|
109
|
+
/** JSON-encoded value */
|
|
110
|
+
value: string;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Hannah requests additional state IDs to be included in the AgentStateUpdate stream.
|
|
114
|
+
* Used by the trigger engine at runtime when triggers reference arbitrary state IDs
|
|
115
|
+
* (e.g. unless.state: "0_userdata.0.feeded") that aren't covered by enum discovery.
|
|
116
|
+
*/
|
|
117
|
+
export interface AgentWatchMore {
|
|
118
|
+
stateIds: string[];
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Hannah instructs the adapter to set a resident's presence state in the residents adapter.
|
|
122
|
+
* type determines whether the target path is .roomie./.guest./.pet.
|
|
123
|
+
*/
|
|
124
|
+
export interface AgentSetResident {
|
|
125
|
+
/** e.g. "leonie", "hannah" */
|
|
126
|
+
residentId: string;
|
|
127
|
+
/** residents adapter presence value (0=absent, 1=home, …) */
|
|
128
|
+
presenceState: number;
|
|
129
|
+
type: ResidentType;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Hannah instructs the adapter to set a resident's mood — separate command from
|
|
133
|
+
* AgentSetResident so it can fire independent of any presence change (e.g. when a
|
|
134
|
+
* Hannah User's linked mood changes without an arrival/departure).
|
|
135
|
+
*/
|
|
136
|
+
export interface AgentSetResidentMood {
|
|
137
|
+
/** e.g. "leonie", "hannah" */
|
|
138
|
+
residentId: string;
|
|
139
|
+
mood: number;
|
|
140
|
+
type: ResidentType;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Hannah notifies the adapter that a satellite registered or disconnected,
|
|
144
|
+
* or that a satellite's volume or mute state changed.
|
|
145
|
+
* The adapter updates hannah.<instance>.satellites.rooms.<room_id>.* states accordingly.
|
|
146
|
+
*/
|
|
147
|
+
export interface AgentSatelliteUpdate {
|
|
148
|
+
/** satellite device_id (== eFuse MAC since v0.34); adapter uses as ioBroker object-ID */
|
|
149
|
+
deviceId: string;
|
|
150
|
+
/** room_id: stable enum ID segment (e.g. "wohnzimmer"); adapter uses as ioBroker path segment */
|
|
151
|
+
room: string;
|
|
152
|
+
/** UDP address (empty if not applicable) */
|
|
153
|
+
address: string;
|
|
154
|
+
/** true = registered/online, false = gone/offline */
|
|
155
|
+
online: boolean;
|
|
156
|
+
/** current volume level (0–100); absent = no change */
|
|
157
|
+
volume?: number | undefined;
|
|
158
|
+
/** current mute state; absent = no change */
|
|
159
|
+
mute?: boolean | undefined;
|
|
160
|
+
/** human-readable name from Core DB (empty = fall back to device_id) */
|
|
161
|
+
displayName: string;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Hannah Core deleted a satellite (RoomManager.delete_satellite()) — the adapter
|
|
165
|
+
* must remove the satellite's full object tree (and its sensor tree), mirroring
|
|
166
|
+
* the room cleanup AgentSatelliteUpdate already does for online/offline changes.
|
|
167
|
+
*/
|
|
168
|
+
export interface AgentSatelliteDeleted {
|
|
169
|
+
/** satellite device_id being deleted */
|
|
170
|
+
deviceId: string;
|
|
171
|
+
/** room_id the satellite was assigned to, for room-container cleanup */
|
|
172
|
+
room: string;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Hannah sends the answer to a text command back to the adapter.
|
|
176
|
+
* The adapter sets hannah.<instance>.textAnswer accordingly.
|
|
177
|
+
*/
|
|
178
|
+
export interface AgentTextAnswer {
|
|
179
|
+
/** plain-text answer */
|
|
180
|
+
text: string;
|
|
181
|
+
/** detected intent name */
|
|
182
|
+
intent: string;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* A notification from the ioBroker adapter.
|
|
186
|
+
* direct=true: skip LLM, play text unchanged (severity ignored).
|
|
187
|
+
* direct=false: LLM reformulates text; severity controls tone ("alert"|"notify"|"info").
|
|
188
|
+
*/
|
|
189
|
+
export interface AgentNotification {
|
|
190
|
+
text: string;
|
|
191
|
+
direct: boolean;
|
|
192
|
+
/** "alert" | "notify" | "info" — only used when direct=false */
|
|
193
|
+
severity: string;
|
|
194
|
+
}
|
|
195
|
+
export interface AgentStateValue {
|
|
196
|
+
value: string;
|
|
197
|
+
ack: boolean;
|
|
198
|
+
}
|
|
199
|
+
/** A device from the ioBroker adapter */
|
|
200
|
+
export interface AgentDevice {
|
|
201
|
+
stateId: string;
|
|
202
|
+
floor: string;
|
|
203
|
+
/** room_id: stable enum ID segment, e.g. "wohnzimmer" or "living_room" */
|
|
204
|
+
room: string;
|
|
205
|
+
device: string;
|
|
206
|
+
deviceType: string;
|
|
207
|
+
functions: string[];
|
|
208
|
+
value: AgentStateValue | undefined;
|
|
209
|
+
/** all display names from ioBroker enum, e.g. {"de": "Wohnzimmer", "en": "Living Room"} */
|
|
210
|
+
roomNames: {
|
|
211
|
+
[key: string]: string;
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
export interface AgentDevice_RoomNamesEntry {
|
|
215
|
+
key: string;
|
|
216
|
+
value: string;
|
|
217
|
+
}
|
|
218
|
+
/** a list with all known devices from the ioBroker adapter */
|
|
219
|
+
export interface AgentDeviceSnapshot {
|
|
220
|
+
devices: AgentDevice[];
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* A room from the ioBroker adapter's enum.rooms.* catalog — independent of devices,
|
|
224
|
+
* so rooms without any device yet are still known to Hannah (e.g. before the first
|
|
225
|
+
* satellite is provisioned into a brand-new room).
|
|
226
|
+
*/
|
|
227
|
+
export interface AgentRoom {
|
|
228
|
+
/** enum ID segment, e.g. "wohnzimmer" */
|
|
229
|
+
roomId: string;
|
|
230
|
+
/** all display names from ioBroker enum, e.g. {"de": "Wohnzimmer", "en": "Living Room"} */
|
|
231
|
+
displayNames: {
|
|
232
|
+
[key: string]: string;
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
export interface AgentRoom_DisplayNamesEntry {
|
|
236
|
+
key: string;
|
|
237
|
+
value: string;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Full room catalog from the ioBroker adapter. Sent on AgentConnect and whenever
|
|
241
|
+
* enum.rooms.* changes, independent of AgentDeviceSnapshot.
|
|
242
|
+
*/
|
|
243
|
+
export interface AgentRoomSnapshot {
|
|
244
|
+
rooms: AgentRoom[];
|
|
245
|
+
}
|
|
246
|
+
/** A resident from the ioBroker adapter */
|
|
247
|
+
export interface AgentResident {
|
|
248
|
+
roomieId: string;
|
|
249
|
+
name: string;
|
|
250
|
+
type: ResidentType;
|
|
251
|
+
moodLevel?: number | undefined;
|
|
252
|
+
presenceState: number;
|
|
253
|
+
}
|
|
254
|
+
/** a list with all known residents */
|
|
255
|
+
export interface AgentResidentSnapshot {
|
|
256
|
+
residents: AgentResident[];
|
|
257
|
+
}
|
|
258
|
+
export interface AgentAskResident {
|
|
259
|
+
correlationId: string;
|
|
260
|
+
room: string;
|
|
261
|
+
question: string;
|
|
262
|
+
}
|
|
263
|
+
export interface AgentResidentAnswered {
|
|
264
|
+
correlationId: string;
|
|
265
|
+
answer: string;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Hannah notifies the adapter that a BLE tag's location has changed.
|
|
269
|
+
* The adapter creates/updates states under hannah.<instance>.ble.<label>.*.
|
|
270
|
+
* room and satellite are empty when the tag is no longer visible.
|
|
271
|
+
*/
|
|
272
|
+
export interface AgentBleUpdate {
|
|
273
|
+
/** human-readable tag name (from config, used as state path) */
|
|
274
|
+
label: string;
|
|
275
|
+
/** MAC address (lowercase, colon-separated) */
|
|
276
|
+
mac: string;
|
|
277
|
+
/** room name (empty = tag not visible / stale) */
|
|
278
|
+
room: string;
|
|
279
|
+
/** satellite device ID that last detected the tag */
|
|
280
|
+
satellite: string;
|
|
281
|
+
/** last known RSSI in dBm (0 when room is empty) */
|
|
282
|
+
rssi: number;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Hannah notifies the adapter of a satellite's sensor reading.
|
|
286
|
+
* The adapter creates/updates states under hannah.<instance>.satellites.<device>.sensors.*.
|
|
287
|
+
* gas_resistance is omitted (0.0) when not available (BMP280+AHT20 hardware).
|
|
288
|
+
* iaq/co2_equiv/voc_equiv are omitted (0.0) when BSEC2 is not calibrated yet.
|
|
289
|
+
*/
|
|
290
|
+
export interface AgentSensorUpdate {
|
|
291
|
+
/** satellite device ID */
|
|
292
|
+
device: string;
|
|
293
|
+
/** °C */
|
|
294
|
+
temperature: number;
|
|
295
|
+
/** hPa */
|
|
296
|
+
pressure: number;
|
|
297
|
+
/** % relative humidity (0 when not available) */
|
|
298
|
+
humidity: number;
|
|
299
|
+
/** IAQ 0–500 (BSEC2); 0 when not calibrated */
|
|
300
|
+
iaq: number;
|
|
301
|
+
/** 0=uncertain 1=low 2=medium 3=high */
|
|
302
|
+
iaqAccuracy: number;
|
|
303
|
+
/** CO₂ equivalent ppm (BSEC2); 0 when not available */
|
|
304
|
+
co2Equiv: number;
|
|
305
|
+
/** breath VOC equivalent ppm (BSEC2); 0 when not available */
|
|
306
|
+
vocEquiv: number;
|
|
307
|
+
}
|
package/dist/agent.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.12.0
|
|
5
|
+
// protoc unknown
|
|
6
|
+
// source: agent.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.ResidentType = exports.protobufPackage = void 0;
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
exports.protobufPackage = "hannah";
|
|
11
|
+
var ResidentType;
|
|
12
|
+
(function (ResidentType) {
|
|
13
|
+
ResidentType[ResidentType["RESIDENT_TYPE_UNSPECIFIED"] = 0] = "RESIDENT_TYPE_UNSPECIFIED";
|
|
14
|
+
ResidentType[ResidentType["ROOMIE"] = 1] = "ROOMIE";
|
|
15
|
+
ResidentType[ResidentType["GUEST"] = 2] = "GUEST";
|
|
16
|
+
ResidentType[ResidentType["PET"] = 3] = "PET";
|
|
17
|
+
ResidentType[ResidentType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
18
|
+
})(ResidentType || (exports.ResidentType = ResidentType = {}));
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export declare const protobufPackage = "hannah";
|
|
2
|
+
export interface CarStateResponse {
|
|
3
|
+
/** false if no MQTT data received yet */
|
|
4
|
+
available: boolean;
|
|
5
|
+
state: CarStateProto | undefined;
|
|
6
|
+
}
|
|
7
|
+
export interface GetAllCarStatesResponse {
|
|
8
|
+
states: CarStateProto[];
|
|
9
|
+
}
|
|
10
|
+
export interface CarStateProto {
|
|
11
|
+
/** position */
|
|
12
|
+
latitude: number;
|
|
13
|
+
longitude: number;
|
|
14
|
+
address: string;
|
|
15
|
+
isMoving: boolean;
|
|
16
|
+
/** Unix timestamp (seconds) */
|
|
17
|
+
positionDate: number;
|
|
18
|
+
/** status */
|
|
19
|
+
odometer: number;
|
|
20
|
+
totalRange: number;
|
|
21
|
+
isCarLocked: boolean;
|
|
22
|
+
doorLockStatus: string;
|
|
23
|
+
overallStatus: string;
|
|
24
|
+
/** doors/windows: name → true (closed) / false (open) */
|
|
25
|
+
doors: {
|
|
26
|
+
[key: string]: boolean;
|
|
27
|
+
};
|
|
28
|
+
windows: {
|
|
29
|
+
[key: string]: boolean;
|
|
30
|
+
};
|
|
31
|
+
/** Roomie-ID des Fahrzeughalters (leer = kein Owner-Filter) */
|
|
32
|
+
ownerRoomie: string;
|
|
33
|
+
/** Metadaten */
|
|
34
|
+
displayName: string;
|
|
35
|
+
/** Nummernschild */
|
|
36
|
+
plate: string;
|
|
37
|
+
/** Fahrzeug-Identifikationsnummer */
|
|
38
|
+
vin: string;
|
|
39
|
+
/** Heimadresse für "steht zu Hause"-Erkennung */
|
|
40
|
+
homeAddress: string;
|
|
41
|
+
}
|
|
42
|
+
export interface CarStateProto_DoorsEntry {
|
|
43
|
+
key: string;
|
|
44
|
+
value: boolean;
|
|
45
|
+
}
|
|
46
|
+
export interface CarStateProto_WindowsEntry {
|
|
47
|
+
key: string;
|
|
48
|
+
value: boolean;
|
|
49
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.12.0
|
|
5
|
+
// protoc unknown
|
|
6
|
+
// source: car_state.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.protobufPackage = void 0;
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
exports.protobufPackage = "hannah";
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
export declare const protobufPackage = "hannah";
|
|
2
|
+
export interface SubmitTextRequest {
|
|
3
|
+
text: string;
|
|
4
|
+
/**
|
|
5
|
+
* Identifies the calling service and its user, so Hannah can look up
|
|
6
|
+
* the corresponding roomie via linked_accounts.
|
|
7
|
+
*/
|
|
8
|
+
sourceService: string;
|
|
9
|
+
/** e.g. Telegram chat_id as string */
|
|
10
|
+
sourceUserId: string;
|
|
11
|
+
}
|
|
12
|
+
export interface SubmitTextResponse {
|
|
13
|
+
/** text to send back to the user */
|
|
14
|
+
answer: string;
|
|
15
|
+
/** e.g. "WeatherQuery", "TurnOn", "Unknown" */
|
|
16
|
+
intentName: string;
|
|
17
|
+
}
|
|
18
|
+
export interface SubmitVoiceRequest {
|
|
19
|
+
/** OGG/Opus audio bytes (from Telegram voice message) */
|
|
20
|
+
audio: Uint8Array;
|
|
21
|
+
/** e.g. "telegram" */
|
|
22
|
+
sourceService: string;
|
|
23
|
+
/** e.g. Telegram chat_id as string */
|
|
24
|
+
sourceUserId: string;
|
|
25
|
+
}
|
|
26
|
+
export interface SubmitVoiceResponse {
|
|
27
|
+
/** STT result (for display / caption) */
|
|
28
|
+
transcript: string;
|
|
29
|
+
/** text answer from Hannah */
|
|
30
|
+
answer: string;
|
|
31
|
+
/** e.g. "CarQuery" — caller may enrich the text reply */
|
|
32
|
+
intentName: string;
|
|
33
|
+
/** OGG/Opus TTS response (empty if TTS disabled or failed) */
|
|
34
|
+
audioOgg: Uint8Array;
|
|
35
|
+
}
|
|
36
|
+
export interface AnnounceRequest {
|
|
37
|
+
text: string;
|
|
38
|
+
/** satellite device name, or "all" for broadcast — legacy path, ignored if room_id or user_id is set */
|
|
39
|
+
device: string;
|
|
40
|
+
/**
|
|
41
|
+
* #31: target by room and/or Person (User) instead of a specific device. Both set = AND
|
|
42
|
+
* (only the satellite that is both in that room AND owned by that Person), not OR.
|
|
43
|
+
*/
|
|
44
|
+
roomId: string;
|
|
45
|
+
/** 0 = not set */
|
|
46
|
+
userId: number;
|
|
47
|
+
}
|
|
48
|
+
export interface Satellite {
|
|
49
|
+
deviceId: string;
|
|
50
|
+
/** live-reported room (UDP/proxy registration); empty if not connected */
|
|
51
|
+
room: string;
|
|
52
|
+
/** IP:port of the UDP satellite; empty if not connected */
|
|
53
|
+
address: string;
|
|
54
|
+
/** human-readable name from Core DB (empty if not provisioned) */
|
|
55
|
+
displayName: string;
|
|
56
|
+
/** room assigned in Core DB, "" = unassigned */
|
|
57
|
+
roomId: string;
|
|
58
|
+
/** display name of room_id */
|
|
59
|
+
roomDisplayName: string;
|
|
60
|
+
/** UTC "YYYY-MM-DD HH:MM:SS" from Core DB, "" = never seen */
|
|
61
|
+
lastSeen: string;
|
|
62
|
+
/** true if currently live (UDP or proxy) */
|
|
63
|
+
connected: boolean;
|
|
64
|
+
/** true if connected and live room differs from room_id */
|
|
65
|
+
roomMismatch: boolean;
|
|
66
|
+
/** Person (User) assigned as owner in Core DB, 0 = unassigned. #31 */
|
|
67
|
+
ownerUserId: number;
|
|
68
|
+
/** display name of owner_user_id, "" if unassigned */
|
|
69
|
+
ownerDisplayName: string;
|
|
70
|
+
}
|
|
71
|
+
export interface GetSatellitesResponse {
|
|
72
|
+
satellites: Satellite[];
|
|
73
|
+
}
|
|
74
|
+
export interface SetSatelliteRoomRequest {
|
|
75
|
+
deviceId: string;
|
|
76
|
+
/** "" = unassign */
|
|
77
|
+
roomId: string;
|
|
78
|
+
/** requestor */
|
|
79
|
+
requestorId: number;
|
|
80
|
+
}
|
|
81
|
+
export interface SetSatelliteDisplayNameRequest {
|
|
82
|
+
deviceId: string;
|
|
83
|
+
displayName: string;
|
|
84
|
+
/** requestor */
|
|
85
|
+
requestorId: number;
|
|
86
|
+
}
|
|
87
|
+
export interface SetSatelliteOwnerRequest {
|
|
88
|
+
deviceId: string;
|
|
89
|
+
/** 0 = unassign */
|
|
90
|
+
userId: number;
|
|
91
|
+
/** requestor */
|
|
92
|
+
requestorId: number;
|
|
93
|
+
}
|
|
94
|
+
export interface DeleteSatelliteRequest {
|
|
95
|
+
deviceId: string;
|
|
96
|
+
/** requestor */
|
|
97
|
+
requestorId: number;
|
|
98
|
+
}
|
|
99
|
+
export interface Room {
|
|
100
|
+
roomId: string;
|
|
101
|
+
displayName: string;
|
|
102
|
+
}
|
|
103
|
+
export interface GetRoomsResponse {
|
|
104
|
+
rooms: Room[];
|
|
105
|
+
}
|
|
106
|
+
export interface Group {
|
|
107
|
+
groupId: string;
|
|
108
|
+
displayName: string;
|
|
109
|
+
rooms: Room[];
|
|
110
|
+
}
|
|
111
|
+
export interface GetGroupsResponse {
|
|
112
|
+
groups: Group[];
|
|
113
|
+
}
|
|
114
|
+
export interface CreateGroupRequest {
|
|
115
|
+
groupId: string;
|
|
116
|
+
displayName: string;
|
|
117
|
+
}
|
|
118
|
+
export interface UpdateGroupRequest {
|
|
119
|
+
groupId: string;
|
|
120
|
+
displayName: string;
|
|
121
|
+
}
|
|
122
|
+
export interface DeleteGroupRequest {
|
|
123
|
+
groupId: string;
|
|
124
|
+
}
|
|
125
|
+
export interface SetGroupRoomsRequest {
|
|
126
|
+
groupId: string;
|
|
127
|
+
roomIds: string[];
|
|
128
|
+
}
|
|
129
|
+
export interface Routine {
|
|
130
|
+
id: number;
|
|
131
|
+
name: string;
|
|
132
|
+
triggers: string[];
|
|
133
|
+
/** JSON list[{topic,value} | {say,room}] */
|
|
134
|
+
actionsJson: string;
|
|
135
|
+
reply: string;
|
|
136
|
+
}
|
|
137
|
+
export interface GetRoutinesResponse {
|
|
138
|
+
routines: Routine[];
|
|
139
|
+
}
|
|
140
|
+
export interface CreateRoutineRequest {
|
|
141
|
+
name: string;
|
|
142
|
+
triggers: string[];
|
|
143
|
+
actionsJson: string;
|
|
144
|
+
reply: string;
|
|
145
|
+
}
|
|
146
|
+
export interface CreateRoutineResponse {
|
|
147
|
+
ok: boolean;
|
|
148
|
+
/** server-assigned, only valid when ok == true */
|
|
149
|
+
id: number;
|
|
150
|
+
message: string;
|
|
151
|
+
}
|
|
152
|
+
export interface UpdateRoutineRequest {
|
|
153
|
+
id: number;
|
|
154
|
+
name: string;
|
|
155
|
+
triggers: string[];
|
|
156
|
+
actionsJson: string;
|
|
157
|
+
reply: string;
|
|
158
|
+
}
|
|
159
|
+
export interface DeleteRoutineRequest {
|
|
160
|
+
id: number;
|
|
161
|
+
}
|
|
162
|
+
export interface Trigger {
|
|
163
|
+
/** client-assigned slug, e.g. "aussentuer_abend" */
|
|
164
|
+
id: string;
|
|
165
|
+
/** JSON condition object or list (OR'd), see trigger_engine.py */
|
|
166
|
+
whenJson: string;
|
|
167
|
+
/** JSON condition object, "" = none */
|
|
168
|
+
cancelWhenJson: string;
|
|
169
|
+
/** JSON list of response rules, "" = none */
|
|
170
|
+
onResponseJson: string;
|
|
171
|
+
/** legacy single announcement, "" once actions_json is used */
|
|
172
|
+
say: string;
|
|
173
|
+
ask: string;
|
|
174
|
+
rephrase: boolean;
|
|
175
|
+
room: string;
|
|
176
|
+
cooldown: number;
|
|
177
|
+
/** duration string e.g. "5h"/"30m"/"90s", "" = none */
|
|
178
|
+
delay: string;
|
|
179
|
+
/** JSON list[{say,room} | {set_state:{id,value}}], "" = none (falls back to say) */
|
|
180
|
+
actionsJson: string;
|
|
181
|
+
}
|
|
182
|
+
export interface GetTriggersResponse {
|
|
183
|
+
triggers: Trigger[];
|
|
184
|
+
}
|
|
185
|
+
export interface CreateTriggerRequest {
|
|
186
|
+
id: string;
|
|
187
|
+
whenJson: string;
|
|
188
|
+
cancelWhenJson: string;
|
|
189
|
+
onResponseJson: string;
|
|
190
|
+
say: string;
|
|
191
|
+
ask: string;
|
|
192
|
+
rephrase: boolean;
|
|
193
|
+
room: string;
|
|
194
|
+
cooldown: number;
|
|
195
|
+
delay: string;
|
|
196
|
+
actionsJson: string;
|
|
197
|
+
}
|
|
198
|
+
export interface UpdateTriggerRequest {
|
|
199
|
+
id: string;
|
|
200
|
+
whenJson: string;
|
|
201
|
+
cancelWhenJson: string;
|
|
202
|
+
onResponseJson: string;
|
|
203
|
+
say: string;
|
|
204
|
+
ask: string;
|
|
205
|
+
rephrase: boolean;
|
|
206
|
+
room: string;
|
|
207
|
+
cooldown: number;
|
|
208
|
+
delay: string;
|
|
209
|
+
actionsJson: string;
|
|
210
|
+
}
|
|
211
|
+
export interface DeleteTriggerRequest {
|
|
212
|
+
id: string;
|
|
213
|
+
}
|
|
214
|
+
export interface Alarm {
|
|
215
|
+
id: number;
|
|
216
|
+
satelliteId: string;
|
|
217
|
+
/** "HH:MM" */
|
|
218
|
+
time: string;
|
|
219
|
+
/** 0=Mo..6=So; leer = One-off */
|
|
220
|
+
weekdays: number[];
|
|
221
|
+
/** ISO-Daten, aus einer wiederkehrenden Serie ausgeschlossen */
|
|
222
|
+
skipDates: string[];
|
|
223
|
+
/** ISO-Datum; nur relevant wenn weekdays leer ist */
|
|
224
|
+
oneShotDate: string;
|
|
225
|
+
enabled: boolean;
|
|
226
|
+
label: string;
|
|
227
|
+
userId: number;
|
|
228
|
+
}
|
|
229
|
+
export interface GetAlarmsResponse {
|
|
230
|
+
alarms: Alarm[];
|
|
231
|
+
}
|
|
232
|
+
export interface CreateAlarmRequest {
|
|
233
|
+
satelliteId: string;
|
|
234
|
+
time: string;
|
|
235
|
+
weekdays: number[];
|
|
236
|
+
oneShotDate: string;
|
|
237
|
+
label: string;
|
|
238
|
+
userId: number;
|
|
239
|
+
}
|
|
240
|
+
export interface CreateAlarmResponse {
|
|
241
|
+
ok: boolean;
|
|
242
|
+
id: number;
|
|
243
|
+
message: string;
|
|
244
|
+
}
|
|
245
|
+
export interface UpdateAlarmRequest {
|
|
246
|
+
id: number;
|
|
247
|
+
satelliteId: string;
|
|
248
|
+
time: string;
|
|
249
|
+
weekdays: number[];
|
|
250
|
+
skipDates: string[];
|
|
251
|
+
oneShotDate: string;
|
|
252
|
+
enabled: boolean;
|
|
253
|
+
label: string;
|
|
254
|
+
}
|
|
255
|
+
export interface DeleteAlarmRequest {
|
|
256
|
+
id: number;
|
|
257
|
+
}
|
|
258
|
+
export interface Category {
|
|
259
|
+
id: number;
|
|
260
|
+
/** voller Punkt-Pfad, z.B. "ble.tags" */
|
|
261
|
+
name: string;
|
|
262
|
+
/** 0 = keine Eltern-Kategorie (Root) */
|
|
263
|
+
parentId: number;
|
|
264
|
+
}
|
|
265
|
+
export interface Setting {
|
|
266
|
+
id: number;
|
|
267
|
+
categoryId: number;
|
|
268
|
+
name: string;
|
|
269
|
+
/** JSON-encoded */
|
|
270
|
+
value: string;
|
|
271
|
+
}
|
|
272
|
+
export interface GetSettingsResponse {
|
|
273
|
+
categories: Category[];
|
|
274
|
+
settings: Setting[];
|
|
275
|
+
}
|
|
276
|
+
export interface SettingUpdate {
|
|
277
|
+
settingId: number;
|
|
278
|
+
/** JSON-encoded */
|
|
279
|
+
value: string;
|
|
280
|
+
}
|
|
281
|
+
export interface UpdateConfigRequest {
|
|
282
|
+
updates: SettingUpdate[];
|
|
283
|
+
}
|
|
284
|
+
export interface BleTag {
|
|
285
|
+
id: number;
|
|
286
|
+
macAddress: string;
|
|
287
|
+
label: string;
|
|
288
|
+
/** 0 = kein Owner zugeordnet */
|
|
289
|
+
userId: number;
|
|
290
|
+
}
|
|
291
|
+
export interface GetBleTagsResponse {
|
|
292
|
+
tags: BleTag[];
|
|
293
|
+
}
|
|
294
|
+
export interface CreateBleTagRequest {
|
|
295
|
+
macAddress: string;
|
|
296
|
+
label: string;
|
|
297
|
+
userId: number;
|
|
298
|
+
}
|
|
299
|
+
export interface CreateBleTagResponse {
|
|
300
|
+
ok: boolean;
|
|
301
|
+
id: number;
|
|
302
|
+
message: string;
|
|
303
|
+
}
|
|
304
|
+
export interface UpdateBleTagRequest {
|
|
305
|
+
id: number;
|
|
306
|
+
macAddress: string;
|
|
307
|
+
label: string;
|
|
308
|
+
userId: number;
|
|
309
|
+
}
|
|
310
|
+
export interface DeleteBleTagRequest {
|
|
311
|
+
id: number;
|
|
312
|
+
}
|
|
313
|
+
export interface Car {
|
|
314
|
+
id: number;
|
|
315
|
+
topicPrefix: string;
|
|
316
|
+
homeAddress: string;
|
|
317
|
+
ownerUserIds: number[];
|
|
318
|
+
name: string;
|
|
319
|
+
}
|
|
320
|
+
export interface GetCarsResponse {
|
|
321
|
+
cars: Car[];
|
|
322
|
+
}
|
|
323
|
+
export interface CreateCarRequest {
|
|
324
|
+
topicPrefix: string;
|
|
325
|
+
homeAddress: string;
|
|
326
|
+
ownerUserIds: number[];
|
|
327
|
+
name: string;
|
|
328
|
+
}
|
|
329
|
+
export interface CreateCarResponse {
|
|
330
|
+
ok: boolean;
|
|
331
|
+
id: number;
|
|
332
|
+
message: string;
|
|
333
|
+
}
|
|
334
|
+
export interface UpdateCarRequest {
|
|
335
|
+
id: number;
|
|
336
|
+
topicPrefix: string;
|
|
337
|
+
homeAddress: string;
|
|
338
|
+
ownerUserIds: number[];
|
|
339
|
+
name: string;
|
|
340
|
+
}
|
|
341
|
+
export interface DeleteCarRequest {
|
|
342
|
+
id: number;
|
|
343
|
+
}
|
package/dist/control.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.12.0
|
|
5
|
+
// protoc unknown
|
|
6
|
+
// source: control.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.protobufPackage = void 0;
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
exports.protobufPackage = "hannah";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare const protobufPackage = "hannah";
|
|
2
|
+
export interface DeviceInfo {
|
|
3
|
+
/** full device prefix, e.g. "javascript.0.virtualDevice.Licht.EG.Wohnzimmer.DeckeSeite" */
|
|
4
|
+
id: string;
|
|
5
|
+
/** display name, e.g. "DeckeSeite" */
|
|
6
|
+
name: string;
|
|
7
|
+
/** e.g. "Licht", "Stecker", "Temperaturen" */
|
|
8
|
+
category: string;
|
|
9
|
+
/** available state keys: "on", "level", "color", … */
|
|
10
|
+
states: string[];
|
|
11
|
+
/** current values as strings, e.g. {"on": "true", "level": "75"} */
|
|
12
|
+
current: {
|
|
13
|
+
[key: string]: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface DeviceInfo_CurrentEntry {
|
|
17
|
+
key: string;
|
|
18
|
+
value: string;
|
|
19
|
+
}
|
|
20
|
+
export interface RoomInfo {
|
|
21
|
+
/** room_id (lowercase), e.g. "wohnzimmer" */
|
|
22
|
+
key: string;
|
|
23
|
+
/** display name, e.g. "Wohnzimmer" */
|
|
24
|
+
name: string;
|
|
25
|
+
devices: DeviceInfo[];
|
|
26
|
+
}
|
|
27
|
+
export interface GetDevicesResponse {
|
|
28
|
+
rooms: RoomInfo[];
|
|
29
|
+
}
|
|
30
|
+
export interface ControlDeviceRequest {
|
|
31
|
+
/** DeviceInfo.id */
|
|
32
|
+
deviceId: string;
|
|
33
|
+
/** state key: "on", "level", "color" */
|
|
34
|
+
state: string;
|
|
35
|
+
/** string-serialised value: "true", "false", "50", "#FF0000" */
|
|
36
|
+
value: string;
|
|
37
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.12.0
|
|
5
|
+
// protoc unknown
|
|
6
|
+
// source: device_control_menu.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.protobufPackage = void 0;
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
exports.protobufPackage = "hannah";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { CarStateProto } from "./car_state";
|
|
2
|
+
export declare const protobufPackage = "hannah";
|
|
3
|
+
export interface EventFilter {
|
|
4
|
+
/** If empty, subscribe to all event types. */
|
|
5
|
+
eventTypes: string[];
|
|
6
|
+
}
|
|
7
|
+
export interface HannahEvent {
|
|
8
|
+
/** "car.parked" | "resident.arrived" | "resident.departed" | "system.notification" | "satellite.firmware" */
|
|
9
|
+
eventType: string;
|
|
10
|
+
/** ISO 8601 UTC */
|
|
11
|
+
timestamp: string;
|
|
12
|
+
carState?: CarStateProto | undefined;
|
|
13
|
+
residentEvent?: ResidentEventProto | undefined;
|
|
14
|
+
systemNotification?: SystemNotificationEvent | undefined;
|
|
15
|
+
firmwareEvent?: FirmwareEventProto | undefined;
|
|
16
|
+
}
|
|
17
|
+
export interface SystemNotificationEvent {
|
|
18
|
+
/** LLM-reformulierter Benachrichtigungstext */
|
|
19
|
+
text: string;
|
|
20
|
+
}
|
|
21
|
+
export interface FirmwareEventProto {
|
|
22
|
+
device: string;
|
|
23
|
+
version: string;
|
|
24
|
+
}
|
|
25
|
+
export interface TriggerFirmwareUpdateRequest {
|
|
26
|
+
device: string;
|
|
27
|
+
}
|
|
28
|
+
export interface ResidentEventProto {
|
|
29
|
+
roomieId: string;
|
|
30
|
+
displayName: string;
|
|
31
|
+
/** "arrived" | "departed" */
|
|
32
|
+
event: string;
|
|
33
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.12.0
|
|
5
|
+
// protoc unknown
|
|
6
|
+
// source: event_stream.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.protobufPackage = void 0;
|
|
9
|
+
exports.protobufPackage = "hannah";
|
package/dist/hannah.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const protobufPackage = "hannah";
|
package/dist/hannah.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.12.0
|
|
5
|
+
// protoc unknown
|
|
6
|
+
// source: hannah.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.protobufPackage = void 0;
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
exports.protobufPackage = "hannah";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const protobufPackage = "hannah";
|
|
2
|
+
/**
|
|
3
|
+
* Sent by the ioBroker adapter (WebFlasher) before flashing a satellite.
|
|
4
|
+
* Hannah stores the seed + pre-config; when the satellite first connects with
|
|
5
|
+
* this seed, Hannah links the hardware serial to the pre-config and clears the seed.
|
|
6
|
+
*/
|
|
7
|
+
export interface ProvisionSatelliteRequest {
|
|
8
|
+
/** random UUID, also written to NVS during flash */
|
|
9
|
+
seed: string;
|
|
10
|
+
/** pre-configured display name */
|
|
11
|
+
displayName: string;
|
|
12
|
+
/** optional: pre-configured room (room_id from ioBroker) */
|
|
13
|
+
roomId: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.12.0
|
|
5
|
+
// protoc unknown
|
|
6
|
+
// source: satellite_provisioning.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.protobufPackage = void 0;
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
exports.protobufPackage = "hannah";
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export declare const protobufPackage = "hannah";
|
|
2
|
+
/** Sent by the proxy periodically to keep the RegisterProxy stream alive. */
|
|
3
|
+
export interface ProxyHeartbeat {
|
|
4
|
+
/** human-readable identifier, e.g. "hannah-proxy-living-room" */
|
|
5
|
+
proxyId: string;
|
|
6
|
+
/**
|
|
7
|
+
* UDP address the proxy is listening on for satellite connections.
|
|
8
|
+
* When set, Hannah publishes this address to the discovery topic so
|
|
9
|
+
* satellites connect to the proxy instead of Hannah's own UDP server.
|
|
10
|
+
*/
|
|
11
|
+
udpHost: string;
|
|
12
|
+
/** UDP port, e.g. 7775 */
|
|
13
|
+
udpPort: number;
|
|
14
|
+
}
|
|
15
|
+
/** Sent by Hannah to the proxy over the RegisterProxy stream. */
|
|
16
|
+
export interface ProxyCommand {
|
|
17
|
+
/** initial confirmation when stream is established */
|
|
18
|
+
ack?: ProxyAck | undefined;
|
|
19
|
+
/** Hannah wants the proxy to play TTS on a satellite */
|
|
20
|
+
playAudio?: PlayAudioCommand | undefined;
|
|
21
|
+
}
|
|
22
|
+
/** Sent once by Hannah after RegisterProxy stream is established. */
|
|
23
|
+
export interface ProxyAck {
|
|
24
|
+
/** true = Hannah has disabled its own UDP server */
|
|
25
|
+
udpDisabled: boolean;
|
|
26
|
+
/** human-readable status, e.g. "UDP server stopped" */
|
|
27
|
+
message: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Hannah instructs the proxy to play TTS audio on a specific satellite.
|
|
31
|
+
* Used for announcements and other server-initiated audio.
|
|
32
|
+
* For streaming: Hannah sends multiple PlayAudioCommands with chunks of PCM.
|
|
33
|
+
* is_last=true on the final chunk signals the proxy to send tts_end to the satellite.
|
|
34
|
+
*/
|
|
35
|
+
export interface PlayAudioCommand {
|
|
36
|
+
/** satellite device name (as registered via UDP or proxy) */
|
|
37
|
+
deviceId: string;
|
|
38
|
+
/** raw PCM, 16-bit signed mono */
|
|
39
|
+
audioPcm: Uint8Array;
|
|
40
|
+
/** e.g. 24000 (Azure) or 16000 (Piper) */
|
|
41
|
+
sampleRate: number;
|
|
42
|
+
/** true on the last chunk of a TTS response */
|
|
43
|
+
isLast: boolean;
|
|
44
|
+
}
|
|
45
|
+
/** Sent by the proxy when a satellite has finished recording an utterance. */
|
|
46
|
+
export interface SubmitSatelliteAudioRequest {
|
|
47
|
+
/** satellite device name */
|
|
48
|
+
deviceId: string;
|
|
49
|
+
/** room name (from proxy registration / config) */
|
|
50
|
+
room: string;
|
|
51
|
+
/** raw PCM, 16-bit signed mono, 16000 Hz */
|
|
52
|
+
audioPcm: Uint8Array;
|
|
53
|
+
/** sample rate of the audio (typically 16000) */
|
|
54
|
+
sampleRate: number;
|
|
55
|
+
/**
|
|
56
|
+
* Optional: speaker identity (Hannah users.id) provided by an upstream speaker-ID service.
|
|
57
|
+
* Empty = anonymous (Hannah treats as unknown user).
|
|
58
|
+
*/
|
|
59
|
+
speakerUserId: string;
|
|
60
|
+
}
|
|
61
|
+
export interface SubmitSatelliteAudioResponse {
|
|
62
|
+
/** STT result */
|
|
63
|
+
transcript: string;
|
|
64
|
+
/** text answer from Hannah */
|
|
65
|
+
answer: string;
|
|
66
|
+
/** e.g. "TurnOn", "CarQuery", "Unknown" */
|
|
67
|
+
intentName: string;
|
|
68
|
+
/** TTS response as raw PCM, 16-bit signed mono */
|
|
69
|
+
audioPcm: Uint8Array;
|
|
70
|
+
/** sample rate of audio_pcm */
|
|
71
|
+
sampleRate: number;
|
|
72
|
+
}
|
|
73
|
+
export interface SatelliteRegistration {
|
|
74
|
+
/** satellite device_id (== eFuse MAC since v0.34), e.g. "e072a1d01adc" */
|
|
75
|
+
deviceId: string;
|
|
76
|
+
/** IP of the UDP satellite as seen by the proxy, e.g. "192.168.8.42" */
|
|
77
|
+
address: string;
|
|
78
|
+
/** one-time pairing token from NVS (empty after successful pairing) */
|
|
79
|
+
seed: string;
|
|
80
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.12.0
|
|
5
|
+
// protoc unknown
|
|
6
|
+
// source: satellite_proxy.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.protobufPackage = void 0;
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
exports.protobufPackage = "hannah";
|
package/dist/shared.d.ts
ADDED
package/dist/shared.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.12.0
|
|
5
|
+
// protoc unknown
|
|
6
|
+
// source: shared.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.protobufPackage = void 0;
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
exports.protobufPackage = "hannah";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const protobufPackage = "hannah";
|
|
2
|
+
export interface EnrollVoiceprintRequest {
|
|
3
|
+
/** Hannah user this voice sample belongs to (users.id, stable) */
|
|
4
|
+
userId: string;
|
|
5
|
+
/** raw PCM, 16-bit signed mono */
|
|
6
|
+
audioPcm: Uint8Array;
|
|
7
|
+
/** e.g. 16000 */
|
|
8
|
+
sampleRate: number;
|
|
9
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.12.0
|
|
5
|
+
// protoc unknown
|
|
6
|
+
// source: speaker_enrollment.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.protobufPackage = void 0;
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
exports.protobufPackage = "hannah";
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
export declare const protobufPackage = "hannah";
|
|
2
|
+
/** Sent by Hannah Core over the TimerConnect stream. */
|
|
3
|
+
export interface TimerCommand {
|
|
4
|
+
/** create a new timer */
|
|
5
|
+
create?: TimerCreate | undefined;
|
|
6
|
+
/** cancel an existing timer */
|
|
7
|
+
cancel?: TimerCancel | undefined;
|
|
8
|
+
/** request current timer list */
|
|
9
|
+
list?: TimerListRequest | undefined;
|
|
10
|
+
/** Hannah is ready to receive pending fired events */
|
|
11
|
+
ready?: TimerReady | undefined;
|
|
12
|
+
/** Hannah is temporarily unable to process timer firings */
|
|
13
|
+
notReady?: TimerNotReady | undefined;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Hannah signals that she is ready to receive queued TimerFired events.
|
|
17
|
+
* Sent after startup once ioBroker states are loaded. The service flushes
|
|
18
|
+
* any TimerFired events that occurred while Hannah was offline, in order.
|
|
19
|
+
*/
|
|
20
|
+
export interface TimerReady {
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Hannah signals a temporary degraded state — the Timer Service should hold
|
|
24
|
+
* any TimerFired events in its queue until a subsequent TimerReady is received.
|
|
25
|
+
* Hannah sends this when core subsystems are unavailable (e.g. ioBroker disconnected).
|
|
26
|
+
*/
|
|
27
|
+
export interface TimerNotReady {
|
|
28
|
+
/** human-readable reason, e.g. "ioBroker disconnected" */
|
|
29
|
+
reason?: string | undefined;
|
|
30
|
+
}
|
|
31
|
+
/** Hannah instructs the timer service to create a new timer. */
|
|
32
|
+
export interface TimerCreate {
|
|
33
|
+
/** UUID assigned by Hannah */
|
|
34
|
+
timerId: string;
|
|
35
|
+
/** human-readable label, e.g. "Spazieren gehen" */
|
|
36
|
+
label: string;
|
|
37
|
+
/** Unix timestamp (seconds) when to fire */
|
|
38
|
+
fireAt: number;
|
|
39
|
+
/** opaque to the Timer Service — e.g. "room", "roomie_id", "trigger_id" */
|
|
40
|
+
metadata: {
|
|
41
|
+
[key: string]: string;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export interface TimerCreate_MetadataEntry {
|
|
45
|
+
key: string;
|
|
46
|
+
value: string;
|
|
47
|
+
}
|
|
48
|
+
/** Hannah instructs the timer service to cancel a timer. */
|
|
49
|
+
export interface TimerCancel {
|
|
50
|
+
timerId: string;
|
|
51
|
+
}
|
|
52
|
+
/** Hannah requests the current list of active timers (e.g. "welche Timer habe ich?"). */
|
|
53
|
+
export interface TimerListRequest {
|
|
54
|
+
}
|
|
55
|
+
/** Sent by the Timer Service over the TimerConnect stream. */
|
|
56
|
+
export interface TimerMessage {
|
|
57
|
+
/** initial confirmation when stream is established */
|
|
58
|
+
ack?: TimerAck | undefined;
|
|
59
|
+
/** a timer has expired */
|
|
60
|
+
fired?: TimerFired | undefined;
|
|
61
|
+
/** response to TimerListRequest */
|
|
62
|
+
list?: TimerListResponse | undefined;
|
|
63
|
+
}
|
|
64
|
+
/** Sent once by the Timer Service after TimerConnect stream is established. */
|
|
65
|
+
export interface TimerAck {
|
|
66
|
+
/** human-readable status */
|
|
67
|
+
message: string;
|
|
68
|
+
/** number of timers currently tracked */
|
|
69
|
+
activeTimers: number;
|
|
70
|
+
}
|
|
71
|
+
/** Timer Service notifies Hannah that a timer has expired. */
|
|
72
|
+
export interface TimerFired {
|
|
73
|
+
timerId: string;
|
|
74
|
+
/** convenience copy for logging */
|
|
75
|
+
label: string;
|
|
76
|
+
/** echoed verbatim from TimerCreate */
|
|
77
|
+
metadata: {
|
|
78
|
+
[key: string]: string;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
export interface TimerFired_MetadataEntry {
|
|
82
|
+
key: string;
|
|
83
|
+
value: string;
|
|
84
|
+
}
|
|
85
|
+
/** Response to TimerListRequest — used for sync and "welche Timer habe ich?" queries. */
|
|
86
|
+
export interface TimerListResponse {
|
|
87
|
+
timers: TimerInfo[];
|
|
88
|
+
}
|
|
89
|
+
export interface TimerInfo {
|
|
90
|
+
timerId: string;
|
|
91
|
+
label: string;
|
|
92
|
+
/** Unix timestamp (seconds) */
|
|
93
|
+
fireAt: number;
|
|
94
|
+
metadata: {
|
|
95
|
+
[key: string]: string;
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
export interface TimerInfo_MetadataEntry {
|
|
99
|
+
key: string;
|
|
100
|
+
value: string;
|
|
101
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.12.0
|
|
5
|
+
// protoc unknown
|
|
6
|
+
// source: timer_service.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.protobufPackage = void 0;
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
exports.protobufPackage = "hannah";
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { ResidentType } from "./agent";
|
|
2
|
+
export declare const protobufPackage = "hannah";
|
|
3
|
+
export interface User {
|
|
4
|
+
id: number;
|
|
5
|
+
userName: string;
|
|
6
|
+
displayName: string;
|
|
7
|
+
trustLevel: number;
|
|
8
|
+
active: boolean;
|
|
9
|
+
/** linked_accounts: service → account_id (e.g. "telegram" → "123456789") */
|
|
10
|
+
linkedAccounts: {
|
|
11
|
+
[key: string]: string;
|
|
12
|
+
};
|
|
13
|
+
/** receives ioBroker/system notifications via Telegram */
|
|
14
|
+
systemMessages: boolean;
|
|
15
|
+
/** #27 Phase 6 */
|
|
16
|
+
email: string;
|
|
17
|
+
/** "roomie" | "guest" | "pet", #27 Phase 6 */
|
|
18
|
+
type: string;
|
|
19
|
+
}
|
|
20
|
+
export interface User_LinkedAccountsEntry {
|
|
21
|
+
key: string;
|
|
22
|
+
value: string;
|
|
23
|
+
}
|
|
24
|
+
export interface GetUsersRequest {
|
|
25
|
+
includeInactive: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface GetUsersResponse {
|
|
28
|
+
users: User[];
|
|
29
|
+
}
|
|
30
|
+
/** Exactly one of the lookup fields should be set. */
|
|
31
|
+
export interface GetUserRequest {
|
|
32
|
+
userName?: string | undefined;
|
|
33
|
+
id?: number | undefined;
|
|
34
|
+
linkedAccount?: LinkedAccountLookup | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Only meaningful together with roomie_id: roomie_id alone is not unique across
|
|
37
|
+
* types (a Guest and a Roomie can share a name). Leave UNSPECIFIED if there's no
|
|
38
|
+
* collision; required when one exists, otherwise the RPC fails with
|
|
39
|
+
* FAILED_PRECONDITION naming the colliding types.
|
|
40
|
+
*/
|
|
41
|
+
type: ResidentType;
|
|
42
|
+
}
|
|
43
|
+
export interface LinkedAccountLookup {
|
|
44
|
+
provider: string;
|
|
45
|
+
externalId: string;
|
|
46
|
+
}
|
|
47
|
+
export interface UserResponse {
|
|
48
|
+
found: boolean;
|
|
49
|
+
/** only valid when found == true */
|
|
50
|
+
user: User | undefined;
|
|
51
|
+
}
|
|
52
|
+
export interface LoginRequest {
|
|
53
|
+
username: string;
|
|
54
|
+
password: string;
|
|
55
|
+
}
|
|
56
|
+
export interface LinkAccountRequest {
|
|
57
|
+
userId: number;
|
|
58
|
+
service: string;
|
|
59
|
+
accountId: string;
|
|
60
|
+
providerPayload: string;
|
|
61
|
+
}
|
|
62
|
+
export interface UnlinkAccountRequest {
|
|
63
|
+
userId: number;
|
|
64
|
+
service: string;
|
|
65
|
+
accountId: string;
|
|
66
|
+
requestorId: number;
|
|
67
|
+
}
|
|
68
|
+
export interface SetTrustLevelRequest {
|
|
69
|
+
userId: number;
|
|
70
|
+
/** clamped to [0, 10] */
|
|
71
|
+
level: number;
|
|
72
|
+
}
|
|
73
|
+
export interface SetSystemMessagesRequest {
|
|
74
|
+
/**
|
|
75
|
+
* Always called by the user for themselves, identified beforehand via a unique
|
|
76
|
+
* linked-account lookup (GetUserRequest.linked_account) — id is already known
|
|
77
|
+
* and unambiguous, unlike roomie_id which can collide across resident types.
|
|
78
|
+
*/
|
|
79
|
+
userId: number;
|
|
80
|
+
enabled: boolean;
|
|
81
|
+
}
|
|
82
|
+
export interface CreateUserRequest {
|
|
83
|
+
username: string;
|
|
84
|
+
/** Klartext, wird serverseitig gehasht — gleicher akzeptierter Constraint wie LoginRequest */
|
|
85
|
+
password: string;
|
|
86
|
+
email: string;
|
|
87
|
+
displayName: string;
|
|
88
|
+
/** "roomie" | "guest" | "pet" */
|
|
89
|
+
type: string;
|
|
90
|
+
}
|
|
91
|
+
export interface CreateUserResponse {
|
|
92
|
+
ok: boolean;
|
|
93
|
+
/** server-assigned, only valid when ok == true */
|
|
94
|
+
id: number;
|
|
95
|
+
message: string;
|
|
96
|
+
}
|
|
97
|
+
export interface UpdateUserRequest {
|
|
98
|
+
userId: number;
|
|
99
|
+
displayName: string;
|
|
100
|
+
email: string;
|
|
101
|
+
type: string;
|
|
102
|
+
isActive: boolean;
|
|
103
|
+
/** Klartext, "" = unverändert */
|
|
104
|
+
password: string;
|
|
105
|
+
}
|
|
106
|
+
export interface DeleteUserRequest {
|
|
107
|
+
userId: number;
|
|
108
|
+
}
|
|
109
|
+
export interface Resident {
|
|
110
|
+
/** z.B. "leonie_roomie" — roomie_id + "_" + type */
|
|
111
|
+
id: string;
|
|
112
|
+
roomieId: string;
|
|
113
|
+
displayName: string;
|
|
114
|
+
/** "roomie" | "guest" | "pet" */
|
|
115
|
+
type: string;
|
|
116
|
+
home: boolean;
|
|
117
|
+
}
|
|
118
|
+
export interface GetResidentsResponse {
|
|
119
|
+
residents: Resident[];
|
|
120
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.12.0
|
|
5
|
+
// protoc unknown
|
|
6
|
+
// source: user_registry.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.protobufPackage = void 0;
|
|
9
|
+
exports.protobufPackage = "hannah";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare const protobufPackage = "hannah";
|
|
2
|
+
export interface SatelliteCaptureRequest {
|
|
3
|
+
deviceId: string;
|
|
4
|
+
/**
|
|
5
|
+
* "noise" (default) or "hey_hannah" — controls ESP streaming behaviour.
|
|
6
|
+
* noise: continuous auto-flush every 5 s.
|
|
7
|
+
* hey_hannah: stream only while PTT is held, flush on PTT release.
|
|
8
|
+
*/
|
|
9
|
+
sampleType: string;
|
|
10
|
+
}
|
|
11
|
+
export interface TriggerPlinkRequest {
|
|
12
|
+
deviceId: string;
|
|
13
|
+
/** seconds to hold virtual PTT after plink (default 3.0) */
|
|
14
|
+
recordDuration: number;
|
|
15
|
+
}
|
|
16
|
+
/** ok=false when the satellite is unknown or already captured by another client. */
|
|
17
|
+
export interface SatelliteCaptureResponse {
|
|
18
|
+
ok: boolean;
|
|
19
|
+
error: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A single audio chunk streamed from a captured satellite to the collector.
|
|
23
|
+
* end_of_utterance=true marks a PTT-release boundary — the collector should
|
|
24
|
+
* finalise and save the accumulated audio as a labelled sample at that point.
|
|
25
|
+
*/
|
|
26
|
+
export interface SatelliteAudioChunk {
|
|
27
|
+
/** raw PCM, 16-bit signed mono */
|
|
28
|
+
pcm: Uint8Array;
|
|
29
|
+
/** Hz, typically 16000 */
|
|
30
|
+
sampleRate: number;
|
|
31
|
+
/** true = PTT released, utterance boundary */
|
|
32
|
+
endOfUtterance: boolean;
|
|
33
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.12.0
|
|
5
|
+
// protoc unknown
|
|
6
|
+
// source: wakeword_capture.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.protobufPackage = void 0;
|
|
9
|
+
/* eslint-disable */
|
|
10
|
+
exports.protobufPackage = "hannah";
|
package/package.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@m1kad0/hannah-proto",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"description": "Generated TypeScript types for the Hannah voice assistant proto schema",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"ts-proto": "^2.12.0",
|
|
19
|
+
"typescript": "^5.6.0"
|
|
20
|
+
}
|
|
21
|
+
}
|