@m1kad0/hannah-proto 4.8.0 → 5.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 (60) hide show
  1. package/README.md +20 -12
  2. package/dist/compat_interceptor.js +1 -1
  3. package/dist/compat_versions.js +89 -89
  4. package/dist/descriptor.binpb +0 -0
  5. package/dist/index.d.ts +1 -22
  6. package/dist/index.js +2 -23
  7. package/dist/{activity_log.d.ts → v2/activity_log.d.ts} +1 -1
  8. package/dist/{activity_log.js → v2/activity_log.js} +2 -2
  9. package/dist/{agent.d.ts → v2/agent.d.ts} +61 -86
  10. package/dist/{agent.js → v2/agent.js} +224 -426
  11. package/dist/{automation.d.ts → v2/automation.d.ts} +1 -1
  12. package/dist/{automation.js → v2/automation.js} +2 -2
  13. package/dist/{car_state.d.ts → v2/car_state.d.ts} +1 -1
  14. package/dist/{car_state.js → v2/car_state.js} +2 -2
  15. package/dist/{channel.d.ts → v2/channel.d.ts} +1 -1
  16. package/dist/{channel.js → v2/channel.js} +2 -2
  17. package/dist/{control.d.ts → v2/control.d.ts} +1 -1
  18. package/dist/{control.js → v2/control.js} +2 -2
  19. package/dist/v2/device_control_menu.d.ts +69 -0
  20. package/dist/v2/device_control_menu.js +339 -0
  21. package/dist/v2/device_model.d.ts +240 -0
  22. package/dist/v2/device_model.js +777 -0
  23. package/dist/{event_stream.d.ts → v2/event_stream.d.ts} +1 -1
  24. package/dist/{event_stream.js → v2/event_stream.js} +2 -2
  25. package/dist/{hannah.d.ts → v2/hannah.d.ts} +86 -86
  26. package/dist/{hannah.js → v2/hannah.js} +88 -88
  27. package/dist/v2/index.d.ts +23 -0
  28. package/dist/v2/index.js +59 -0
  29. package/dist/{infrastructure.d.ts → v2/infrastructure.d.ts} +1 -1
  30. package/dist/{infrastructure.js → v2/infrastructure.js} +2 -2
  31. package/dist/{logging.d.ts → v2/logging.d.ts} +4 -4
  32. package/dist/{logging.js → v2/logging.js} +6 -6
  33. package/dist/{messages.d.ts → v2/messages.d.ts} +1 -1
  34. package/dist/{messages.js → v2/messages.js} +2 -2
  35. package/dist/{satellite.d.ts → v2/satellite.d.ts} +1 -1
  36. package/dist/{satellite.js → v2/satellite.js} +2 -2
  37. package/dist/{satellite_provisioning.d.ts → v2/satellite_provisioning.d.ts} +1 -1
  38. package/dist/{satellite_provisioning.js → v2/satellite_provisioning.js} +2 -2
  39. package/dist/{satellite_proxy.d.ts → v2/satellite_proxy.d.ts} +1 -1
  40. package/dist/{satellite_proxy.js → v2/satellite_proxy.js} +2 -2
  41. package/dist/{shared.d.ts → v2/shared.d.ts} +1 -28
  42. package/dist/v2/shared.js +113 -0
  43. package/dist/{speaker_enrollment.d.ts → v2/speaker_enrollment.d.ts} +1 -1
  44. package/dist/{speaker_enrollment.js → v2/speaker_enrollment.js} +2 -2
  45. package/dist/{timer_admin.d.ts → v2/timer_admin.d.ts} +1 -1
  46. package/dist/{timer_admin.js → v2/timer_admin.js} +2 -2
  47. package/dist/{timer_service.d.ts → v2/timer_service.d.ts} +1 -1
  48. package/dist/{timer_service.js → v2/timer_service.js} +2 -2
  49. package/dist/{user_registry.d.ts → v2/user_registry.d.ts} +1 -1
  50. package/dist/{user_registry.js → v2/user_registry.js} +2 -2
  51. package/dist/{wakeword_capture.d.ts → v2/wakeword_capture.d.ts} +1 -1
  52. package/dist/{wakeword_capture.js → v2/wakeword_capture.js} +2 -2
  53. package/dist/{weather.d.ts → v2/weather.d.ts} +1 -1
  54. package/dist/{weather.js → v2/weather.js} +2 -2
  55. package/dist/version.d.ts +1 -1
  56. package/dist/version.js +1 -1
  57. package/package.json +2 -2
  58. package/dist/device_control_menu.d.ts +0 -88
  59. package/dist/device_control_menu.js +0 -629
  60. package/dist/shared.js +0 -249
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Protobuf/gRPC schema definitions for the Hannah voice assistant ecosystem (Core, satellites, WebUI, ioBroker adapter, Telegram bot, and other consumers). This repo is the single source of truth for the wire protocol shared across all of them.
4
4
 
5
- The `.proto` files live under `hannah/`, one per functional area — satellite control, event streaming, the ioBroker agent bridge, user registry, timers, automations, and so on. Nothing here is application code, just schema.
5
+ The `.proto` files live under `hannah/` (per API generation in `hannah/v2/` and `hannah/v1/`), one per functional area — satellite control, event streaming, the ioBroker agent bridge, user registry, timers, automations, and so on. Nothing here is application code, just schema.
6
6
 
7
7
  ## Distribution
8
8
 
@@ -16,26 +16,34 @@ Three independent, tag-triggered publish targets — pick whichever matches your
16
16
 
17
17
  Go has no separate package registry, so that tagged GitHub repo *is* the package — `go get` resolves it directly.
18
18
 
19
- ## API generations: hannah.v1
19
+ ## API generations: hannah.v1 and hannah.v2
20
20
 
21
- The schema exists in two packages side by side:
21
+ The schema lives in versioned packages side by side:
22
22
 
23
23
  | Package | Files | Status |
24
24
  |---|---|---|
25
- | `hannah.v1` | `hannah/v1/*.proto` | **current generation** — all changes go here |
26
- | `hannah` (unversioned) | `hannah/*.proto` | frozen (N−1), kept so older components keep working |
25
+ | `hannah.v2` | `hannah/v2/*.proto` | **current generation (N)** — all changes go here |
26
+ | `hannah.v1` | `hannah/v1/*.proto` | frozen (N−1), kept so older components keep working |
27
27
 
28
- Both carry the same services and messages, but under different gRPC method paths (`/hannah.v1.HannahService/...` vs `/hannah.HannahService/...`), so a server can serve both at once and gRPC routes each call to the right one. Hannah Core serves the current generation and the one before it (N and N−1, never more). Clients use the current generation and fall back to the previous one if Core answers `UNIMPLEMENTED` (Core too old).
28
+ The unversioned `hannah` package is gone since `hannah.v2`: a generation older than N−1 is removed. Only `hannah/options.proto` (the `compat_version` extension) is left in `hannah/`, shared by both generations and not copied.
29
29
 
30
- A breaking change never happens inside a generation — it starts the next one (`hannah.v2`), and the oldest one is removed. `hannah/options.proto` (the `compat_version` extension) is shared by both packages, not copied. The API generation is independent of the package version: `hannah.v1` ships in 4.x.
30
+ Both carry the same services, but under different gRPC method paths (`/hannah.v2.HannahService/...` vs `/hannah.v1.HannahService/...`), so a server can serve both at once and gRPC routes each call to the right one. Hannah Core serves the current generation and the one before it (N and N−1, never more). Clients use the current generation and fall back to the previous one if Core answers `UNIMPLEMENTED` (Core too old).
31
31
 
32
- | Language | Current generation | Previous generation |
32
+ A breaking change never happens inside a generation — it starts the next one (`hannah.v3`), and the oldest one is removed. The API generation is independent of the package version: `hannah.v2` ships in 5.x, `hannah.v1` in 4.x and 5.x.
33
+
34
+ | Language | Current generation (N) | Previous generation (N−1) |
33
35
  |---|---|---|
34
- | Python | `from hannah_proto.v1 import hannah_pb2` | `from hannah_proto import hannah_pb2` |
35
- | TypeScript | `import { v1 } from '@m1kad0/hannah-proto'` → `v1.agent.AgentMessage` | `import { agent } from '@m1kad0/hannah-proto'` |
36
- | Go | `github.com/NurPech/hannah-proto-go/v4/hannahv1` | `github.com/NurPech/hannah-proto-go/v4` |
36
+ | Python | `from hannah_proto.v2 import hannah_pb2` | `from hannah_proto.v1 import hannah_pb2` |
37
+ | TypeScript | `import { v2 } from '@m1kad0/hannah-proto'` → `v2.agent.AgentMessage` | `import { v1 } from '@m1kad0/hannah-proto'` |
38
+ | Go | `github.com/NurPech/hannah-proto-go/v5/hannahv2` | `github.com/NurPech/hannah-proto-go/v5/hannahv1` |
39
+
40
+ CI rejects any change under `hannah/` outside `hannah/v2/` (deletions are allowed — that is how an old generation leaves).
41
+
42
+ ### What `hannah.v2` changes against `hannah.v1`
37
43
 
38
- CI rejects any change under `hannah/` outside `hannah/v1/`.
44
+ - **Typed device model** (`hannah/v2/device_model.proto`): Hannah defines fixed device classes (`DeviceClass`) with slots (`SlotKind`, `Slot`, `SlotValue`) and their scales and units. The ioBroker adapter maps ioBroker objects onto them, normalizes the values and writes slot commands (`SetSlot`) back to the real states; Hannah Core never sees ioBroker state IDs for devices. The agent stream carries `TypedDeviceSnapshot`, `SlotUpdate` and `DeviceAvailability` (adapter → Core) and `SetSlot` (Core → adapter); `GetDevices`/`ControlDevice` work on slots.
45
+ - **Removed:** the state-based device model (`AgentDevice`, `AgentDeviceSnapshot`, `canonical_key`, `StateType`, `EnumValues`), `AgentSetResident.presence_state`, all `reserved` entries and all `compat_version` options (a new generation starts at the implicit `1`). `AgentStateUpdate`, `AgentSetState` and `AgentWatchMore` stay for arbitrary watched states.
46
+ - **Field numbers** of a changed message are not reused with another meaning inside the same lineage (`DeviceInfo`, `ControlDeviceRequest`), so bytes of one generation are never silently misread as the other. Between the generations, methods whose messages differ need a real translator, not a byte bridge.
39
47
 
40
48
  ## Versioning: PROTO_VERSION
41
49
 
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "DEFAULT_COMPAT_VERSION", { enumerable: true, get
7
7
  exports.COMPAT_VERSION_METADATA_KEY = "x-compat-version";
8
8
  /** `methodPath` is the full gRPC path (e.g. "/hannah.v1.HannahService/SubmitText"),
9
9
  * matching the keys gen-compat-versions.js writes into REQUIRED_COMPAT_VERSIONS —
10
- * the bare name would be ambiguous between hannah and hannah.v1. */
10
+ * the bare name would be ambiguous between hannah.v1 and hannah.v2. */
11
11
  function getRequiredCompatVersion(methodPath) {
12
12
  return compat_versions_1.REQUIRED_COMPAT_VERSIONS[methodPath] ?? compat_versions_1.DEFAULT_COMPAT_VERSION;
13
13
  }
@@ -4,94 +4,6 @@ exports.REQUIRED_COMPAT_VERSIONS = exports.DEFAULT_COMPAT_VERSION = void 0;
4
4
  // Generated by scripts/gen-compat-versions.js — do not edit by hand.
5
5
  exports.DEFAULT_COMPAT_VERSION = 1;
6
6
  exports.REQUIRED_COMPAT_VERSIONS = {
7
- "/hannah.HannahService/GetUsers": 1,
8
- "/hannah.HannahService/GetUser": 1,
9
- "/hannah.HannahService/LinkAccount": 1,
10
- "/hannah.HannahService/UnlinkAccount": 1,
11
- "/hannah.HannahService/CreateLinkToken": 1,
12
- "/hannah.HannahService/SetTrustLevel": 1,
13
- "/hannah.HannahService/SetSystemMessages": 1,
14
- "/hannah.HannahService/SetAutomation": 1,
15
- "/hannah.HannahService/Login": 1,
16
- "/hannah.HannahService/CreateUser": 1,
17
- "/hannah.HannahService/UpdateUser": 1,
18
- "/hannah.HannahService/DeleteUser": 1,
19
- "/hannah.HannahService/GetResidents": 1,
20
- "/hannah.HannahService/GetDevices": 1,
21
- "/hannah.HannahService/ControlDevice": 1,
22
- "/hannah.HannahService/SubmitText": 1,
23
- "/hannah.HannahService/SubmitVoice": 1,
24
- "/hannah.HannahService/Announce": 1,
25
- "/hannah.HannahService/Notify": 1,
26
- "/hannah.HannahService/GetSatellites": 1,
27
- "/hannah.HannahService/SetSatelliteRoom": 1,
28
- "/hannah.HannahService/SetSatelliteDisplayName": 1,
29
- "/hannah.HannahService/SetSatelliteOwner": 1,
30
- "/hannah.HannahService/SetSatelliteSmalltalkFollowup": 1,
31
- "/hannah.HannahService/DeleteSatellite": 1,
32
- "/hannah.HannahService/GetRooms": 1,
33
- "/hannah.HannahService/GetGroups": 1,
34
- "/hannah.HannahService/CreateGroup": 1,
35
- "/hannah.HannahService/UpdateGroup": 1,
36
- "/hannah.HannahService/DeleteGroup": 1,
37
- "/hannah.HannahService/SetGroupSatellites": 1,
38
- "/hannah.HannahService/GetTriggers": 1,
39
- "/hannah.HannahService/CreateTrigger": 2,
40
- "/hannah.HannahService/UpdateTrigger": 2,
41
- "/hannah.HannahService/DeleteTrigger": 1,
42
- "/hannah.HannahService/GetAlarms": 1,
43
- "/hannah.HannahService/CreateAlarm": 1,
44
- "/hannah.HannahService/UpdateAlarm": 1,
45
- "/hannah.HannahService/DeleteAlarm": 1,
46
- "/hannah.HannahService/GetSettings": 1,
47
- "/hannah.HannahService/UpdateConfig": 1,
48
- "/hannah.HannahService/GetBleTags": 1,
49
- "/hannah.HannahService/CreateBleTag": 1,
50
- "/hannah.HannahService/UpdateBleTag": 1,
51
- "/hannah.HannahService/DeleteBleTag": 1,
52
- "/hannah.HannahService/GetPresenceSources": 1,
53
- "/hannah.HannahService/CreatePresenceSource": 1,
54
- "/hannah.HannahService/UpdatePresenceSource": 1,
55
- "/hannah.HannahService/DeletePresenceSource": 1,
56
- "/hannah.HannahService/GetCars": 1,
57
- "/hannah.HannahService/CreateCar": 1,
58
- "/hannah.HannahService/UpdateCar": 1,
59
- "/hannah.HannahService/DeleteCar": 1,
60
- "/hannah.HannahService/GetCarState": 1,
61
- "/hannah.HannahService/GetAllCarStates": 1,
62
- "/hannah.HannahService/SubscribeEvents": 1,
63
- "/hannah.HannahService/TriggerFirmwareUpdate": 1,
64
- "/hannah.HannahService/TriggerSatelliteRestart": 1,
65
- "/hannah.HannahService/RequestSatelliteCapture": 1,
66
- "/hannah.HannahService/ReleaseSatelliteCapture": 1,
67
- "/hannah.HannahService/StreamSatelliteAudio": 1,
68
- "/hannah.HannahService/TriggerPlink": 1,
69
- "/hannah.HannahService/CollectorConnect": 2,
70
- "/hannah.HannahService/TriggerCollectorCapture": 2,
71
- "/hannah.HannahService/RegisterProxy": 1,
72
- "/hannah.HannahService/SubmitSatelliteAudio": 3,
73
- "/hannah.HannahService/NotifySatelliteRegistered": 1,
74
- "/hannah.HannahService/NotifySatelliteGone": 1,
75
- "/hannah.HannahService/ProvisionSatellite": 1,
76
- "/hannah.HannahService/StartVoiceEnrollment": 1,
77
- "/hannah.HannahService/EnrollVoiceprint": 1,
78
- "/hannah.HannahService/TimerConnect": 1,
79
- "/hannah.HannahService/GetTimers": 1,
80
- "/hannah.HannahService/DeleteTimer": 1,
81
- "/hannah.HannahService/AgentConnect": 1,
82
- "/hannah.HannahService/AutomationConnect": 1,
83
- "/hannah.HannahService/ChannelConnect": 1,
84
- "/hannah.HannahService/GetChannels": 1,
85
- "/hannah.HannahService/SubscribeInfrastructure": 1,
86
- "/hannah.HannahService/LogCollectorConnect": 1,
87
- "/hannah.HannahService/ListActivityLog": 1,
88
- "/hannah.HannahService/StreamActivityAudio": 1,
89
- "/hannah.HannahService/CreateMessage": 1,
90
- "/hannah.HannahService/ListMessages": 1,
91
- "/hannah.HannahService/DeleteMessage": 1,
92
- "/hannah.LogService/Ship": 1,
93
- "/hannah.LogService/GetSources": 1,
94
- "/hannah.LogService/Export": 1,
95
7
  "/hannah.v1.HannahService/GetUsers": 1,
96
8
  "/hannah.v1.HannahService/GetUser": 1,
97
9
  "/hannah.v1.HannahService/LinkAccount": 1,
@@ -179,5 +91,93 @@ exports.REQUIRED_COMPAT_VERSIONS = {
179
91
  "/hannah.v1.HannahService/DeleteMessage": 1,
180
92
  "/hannah.v1.LogService/Ship": 1,
181
93
  "/hannah.v1.LogService/GetSources": 1,
182
- "/hannah.v1.LogService/Export": 1
94
+ "/hannah.v1.LogService/Export": 1,
95
+ "/hannah.v2.HannahService/GetUsers": 1,
96
+ "/hannah.v2.HannahService/GetUser": 1,
97
+ "/hannah.v2.HannahService/LinkAccount": 1,
98
+ "/hannah.v2.HannahService/UnlinkAccount": 1,
99
+ "/hannah.v2.HannahService/CreateLinkToken": 1,
100
+ "/hannah.v2.HannahService/SetTrustLevel": 1,
101
+ "/hannah.v2.HannahService/SetSystemMessages": 1,
102
+ "/hannah.v2.HannahService/SetAutomation": 1,
103
+ "/hannah.v2.HannahService/Login": 1,
104
+ "/hannah.v2.HannahService/CreateUser": 1,
105
+ "/hannah.v2.HannahService/UpdateUser": 1,
106
+ "/hannah.v2.HannahService/DeleteUser": 1,
107
+ "/hannah.v2.HannahService/GetResidents": 1,
108
+ "/hannah.v2.HannahService/GetDevices": 1,
109
+ "/hannah.v2.HannahService/ControlDevice": 1,
110
+ "/hannah.v2.HannahService/SubmitText": 1,
111
+ "/hannah.v2.HannahService/SubmitVoice": 1,
112
+ "/hannah.v2.HannahService/Announce": 1,
113
+ "/hannah.v2.HannahService/Notify": 1,
114
+ "/hannah.v2.HannahService/GetSatellites": 1,
115
+ "/hannah.v2.HannahService/SetSatelliteRoom": 1,
116
+ "/hannah.v2.HannahService/SetSatelliteDisplayName": 1,
117
+ "/hannah.v2.HannahService/SetSatelliteOwner": 1,
118
+ "/hannah.v2.HannahService/SetSatelliteSmalltalkFollowup": 1,
119
+ "/hannah.v2.HannahService/DeleteSatellite": 1,
120
+ "/hannah.v2.HannahService/GetRooms": 1,
121
+ "/hannah.v2.HannahService/GetGroups": 1,
122
+ "/hannah.v2.HannahService/CreateGroup": 1,
123
+ "/hannah.v2.HannahService/UpdateGroup": 1,
124
+ "/hannah.v2.HannahService/DeleteGroup": 1,
125
+ "/hannah.v2.HannahService/SetGroupSatellites": 1,
126
+ "/hannah.v2.HannahService/GetTriggers": 1,
127
+ "/hannah.v2.HannahService/CreateTrigger": 1,
128
+ "/hannah.v2.HannahService/UpdateTrigger": 1,
129
+ "/hannah.v2.HannahService/DeleteTrigger": 1,
130
+ "/hannah.v2.HannahService/GetAlarms": 1,
131
+ "/hannah.v2.HannahService/CreateAlarm": 1,
132
+ "/hannah.v2.HannahService/UpdateAlarm": 1,
133
+ "/hannah.v2.HannahService/DeleteAlarm": 1,
134
+ "/hannah.v2.HannahService/GetSettings": 1,
135
+ "/hannah.v2.HannahService/UpdateConfig": 1,
136
+ "/hannah.v2.HannahService/GetBleTags": 1,
137
+ "/hannah.v2.HannahService/CreateBleTag": 1,
138
+ "/hannah.v2.HannahService/UpdateBleTag": 1,
139
+ "/hannah.v2.HannahService/DeleteBleTag": 1,
140
+ "/hannah.v2.HannahService/GetPresenceSources": 1,
141
+ "/hannah.v2.HannahService/CreatePresenceSource": 1,
142
+ "/hannah.v2.HannahService/UpdatePresenceSource": 1,
143
+ "/hannah.v2.HannahService/DeletePresenceSource": 1,
144
+ "/hannah.v2.HannahService/GetCars": 1,
145
+ "/hannah.v2.HannahService/CreateCar": 1,
146
+ "/hannah.v2.HannahService/UpdateCar": 1,
147
+ "/hannah.v2.HannahService/DeleteCar": 1,
148
+ "/hannah.v2.HannahService/GetCarState": 1,
149
+ "/hannah.v2.HannahService/GetAllCarStates": 1,
150
+ "/hannah.v2.HannahService/SubscribeEvents": 1,
151
+ "/hannah.v2.HannahService/TriggerFirmwareUpdate": 1,
152
+ "/hannah.v2.HannahService/TriggerSatelliteRestart": 1,
153
+ "/hannah.v2.HannahService/RequestSatelliteCapture": 1,
154
+ "/hannah.v2.HannahService/ReleaseSatelliteCapture": 1,
155
+ "/hannah.v2.HannahService/StreamSatelliteAudio": 1,
156
+ "/hannah.v2.HannahService/TriggerPlink": 1,
157
+ "/hannah.v2.HannahService/CollectorConnect": 1,
158
+ "/hannah.v2.HannahService/TriggerCollectorCapture": 1,
159
+ "/hannah.v2.HannahService/RegisterProxy": 1,
160
+ "/hannah.v2.HannahService/SubmitSatelliteAudio": 1,
161
+ "/hannah.v2.HannahService/NotifySatelliteRegistered": 1,
162
+ "/hannah.v2.HannahService/NotifySatelliteGone": 1,
163
+ "/hannah.v2.HannahService/ProvisionSatellite": 1,
164
+ "/hannah.v2.HannahService/StartVoiceEnrollment": 1,
165
+ "/hannah.v2.HannahService/EnrollVoiceprint": 1,
166
+ "/hannah.v2.HannahService/TimerConnect": 1,
167
+ "/hannah.v2.HannahService/GetTimers": 1,
168
+ "/hannah.v2.HannahService/DeleteTimer": 1,
169
+ "/hannah.v2.HannahService/AgentConnect": 1,
170
+ "/hannah.v2.HannahService/AutomationConnect": 1,
171
+ "/hannah.v2.HannahService/ChannelConnect": 1,
172
+ "/hannah.v2.HannahService/GetChannels": 1,
173
+ "/hannah.v2.HannahService/SubscribeInfrastructure": 1,
174
+ "/hannah.v2.HannahService/LogCollectorConnect": 1,
175
+ "/hannah.v2.HannahService/ListActivityLog": 1,
176
+ "/hannah.v2.HannahService/StreamActivityAudio": 1,
177
+ "/hannah.v2.HannahService/CreateMessage": 1,
178
+ "/hannah.v2.HannahService/ListMessages": 1,
179
+ "/hannah.v2.HannahService/DeleteMessage": 1,
180
+ "/hannah.v2.LogService/Ship": 1,
181
+ "/hannah.v2.LogService/GetSources": 1,
182
+ "/hannah.v2.LogService/Export": 1
183
183
  };
Binary file
package/dist/index.d.ts CHANGED
@@ -1,27 +1,6 @@
1
1
  export * from './version';
2
- export * as activity_log from './activity_log';
3
- export * as agent from './agent';
4
- export * as automation from './automation';
5
- export * as car_state from './car_state';
6
- export * as channel from './channel';
7
2
  export * as compat_interceptor from './compat_interceptor';
8
3
  export * as compat_versions from './compat_versions';
9
- export * as control from './control';
10
- export * as device_control_menu from './device_control_menu';
11
- export * as event_stream from './event_stream';
12
- export * as hannah from './hannah';
13
- export * as infrastructure from './infrastructure';
14
- export * as logging from './logging';
15
- export * as messages from './messages';
16
4
  export * as options from './options';
17
- export * as satellite from './satellite';
18
- export * as satellite_provisioning from './satellite_provisioning';
19
- export * as satellite_proxy from './satellite_proxy';
20
- export * as shared from './shared';
21
- export * as speaker_enrollment from './speaker_enrollment';
22
- export * as timer_admin from './timer_admin';
23
- export * as timer_service from './timer_service';
24
- export * as user_registry from './user_registry';
25
- export * as wakeword_capture from './wakeword_capture';
26
- export * as weather from './weather';
27
5
  export * as v1 from './v1';
6
+ export * as v2 from './v2';
package/dist/index.js CHANGED
@@ -36,31 +36,10 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.v1 = exports.weather = exports.wakeword_capture = exports.user_registry = exports.timer_service = exports.timer_admin = exports.speaker_enrollment = exports.shared = exports.satellite_proxy = exports.satellite_provisioning = exports.satellite = exports.options = exports.messages = exports.logging = exports.infrastructure = exports.hannah = exports.event_stream = exports.device_control_menu = exports.control = exports.compat_versions = exports.compat_interceptor = exports.channel = exports.car_state = exports.automation = exports.agent = exports.activity_log = void 0;
39
+ exports.v2 = exports.v1 = exports.options = exports.compat_versions = exports.compat_interceptor = void 0;
40
40
  __exportStar(require("./version"), exports);
41
- exports.activity_log = __importStar(require("./activity_log"));
42
- exports.agent = __importStar(require("./agent"));
43
- exports.automation = __importStar(require("./automation"));
44
- exports.car_state = __importStar(require("./car_state"));
45
- exports.channel = __importStar(require("./channel"));
46
41
  exports.compat_interceptor = __importStar(require("./compat_interceptor"));
47
42
  exports.compat_versions = __importStar(require("./compat_versions"));
48
- exports.control = __importStar(require("./control"));
49
- exports.device_control_menu = __importStar(require("./device_control_menu"));
50
- exports.event_stream = __importStar(require("./event_stream"));
51
- exports.hannah = __importStar(require("./hannah"));
52
- exports.infrastructure = __importStar(require("./infrastructure"));
53
- exports.logging = __importStar(require("./logging"));
54
- exports.messages = __importStar(require("./messages"));
55
43
  exports.options = __importStar(require("./options"));
56
- exports.satellite = __importStar(require("./satellite"));
57
- exports.satellite_provisioning = __importStar(require("./satellite_provisioning"));
58
- exports.satellite_proxy = __importStar(require("./satellite_proxy"));
59
- exports.shared = __importStar(require("./shared"));
60
- exports.speaker_enrollment = __importStar(require("./speaker_enrollment"));
61
- exports.timer_admin = __importStar(require("./timer_admin"));
62
- exports.timer_service = __importStar(require("./timer_service"));
63
- exports.user_registry = __importStar(require("./user_registry"));
64
- exports.wakeword_capture = __importStar(require("./wakeword_capture"));
65
- exports.weather = __importStar(require("./weather"));
66
44
  exports.v1 = __importStar(require("./v1"));
45
+ exports.v2 = __importStar(require("./v2"));
@@ -1,5 +1,5 @@
1
1
  import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
- export declare const protobufPackage = "hannah";
2
+ export declare const protobufPackage = "hannah.v2";
3
3
  export interface ActivityLogEntry {
4
4
  id: bigint;
5
5
  ts: string;
@@ -3,12 +3,12 @@
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.12.1
5
5
  // protoc unknown
6
- // source: hannah/activity_log.proto
6
+ // source: hannah/v2/activity_log.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.ActivityAudioChunk = exports.StreamActivityAudioRequest = exports.ListActivityLogResponse = exports.ListActivityLogRequest = exports.ActivityLogEntry = exports.protobufPackage = void 0;
9
9
  /* eslint-disable */
10
10
  const wire_1 = require("@bufbuild/protobuf/wire");
11
- exports.protobufPackage = "hannah";
11
+ exports.protobufPackage = "hannah.v2";
12
12
  function createBaseActivityLogEntry() {
13
13
  return {
14
14
  id: 0n,
@@ -1,8 +1,8 @@
1
1
  import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
- import { EnumValues, StateType } from "./shared";
2
+ import { DeviceAvailability, SetSlot, SlotUpdate, TypedDeviceSnapshot } from "./device_model";
3
3
  import { CaptureMode, SampleType } from "./wakeword_capture";
4
4
  import { AgentWeatherUpdate } from "./weather";
5
- export declare const protobufPackage = "hannah";
5
+ export declare const protobufPackage = "hannah.v2";
6
6
  export declare enum ResidentType {
7
7
  RESIDENT_TYPE_UNSPECIFIED = 0,
8
8
  ROOMIE = 1,
@@ -30,7 +30,7 @@ export declare enum ResidentPresenceAction {
30
30
  }
31
31
  /** Sent by the HannahAgent ioBroker adapter over the AgentConnect stream. */
32
32
  export interface AgentMessage {
33
- /** any ioBroker state changed */
33
+ /** a watched ioBroker state changed (AgentWatchMore) */
34
34
  stateUpdate?: AgentStateUpdate | undefined;
35
35
  /** residents adapter presence changed */
36
36
  residentUpdate?: AgentResident | undefined;
@@ -38,8 +38,6 @@ export interface AgentMessage {
38
38
  textCommand?: AgentTextCommand | undefined;
39
39
  /** satellite control command */
40
40
  satelliteControl?: AgentSatelliteControl | undefined;
41
- /** initial snapshot with all states */
42
- sendSnapshot?: AgentDeviceSnapshot | undefined;
43
41
  /** initial snapshot with all residents */
44
42
  sendResidents?: AgentResidentSnapshot | undefined;
45
43
  /** ask Resident via Hannah */
@@ -47,6 +45,23 @@ export interface AgentMessage {
47
45
  /** full room catalog, independent of devices */
48
46
  sendRooms?: AgentRoomSnapshot | undefined;
49
47
  weatherUpdate?: AgentWeatherUpdate | undefined;
48
+ /**
49
+ * Typed device model (device_model.proto). The adapter maps ioBroker objects
50
+ * onto device classes and slots; Core never sees ioBroker state IDs for devices.
51
+ */
52
+ typedSnapshot?: TypedDeviceSnapshot | undefined;
53
+ /** a slot of a device changed */
54
+ slotUpdate?: SlotUpdate | undefined;
55
+ /** a device became (un)reachable */
56
+ deviceAvailability?: DeviceAvailability | undefined;
57
+ /**
58
+ * Set = the adapter asks Core to reply with an AgentAck carrying the same
59
+ * ack_id, listing the fields of this message Core's schema did not know.
60
+ * Unset = no ack. A Core too old for AgentAck ignores this field and never
61
+ * replies, so the adapter must treat a missing ack (after a timeout) as
62
+ * "not supported" (hannah-proto#16).
63
+ */
64
+ ackId?: bigint | undefined;
50
65
  }
51
66
  /**
52
67
  * Adapter instructs Hannah to control satellites in a room or a specific satellite.
@@ -84,12 +99,14 @@ export interface CaptureControl {
84
99
  stop: boolean;
85
100
  }
86
101
  /**
87
- * An ioBroker state change event. ack=true means the device confirmed the value
88
- * (as opposed to ack=false which is the "desired" value). Hannah uses this to
89
- * verify that a SetState command was executed successfully.
102
+ * A state change event for a state Hannah asked to watch (AgentWatchMore), e.g. the
103
+ * trigger engine's conditions. Devices are not reported this way, they use SlotUpdate.
104
+ * ack=true means the device confirmed the value (as opposed to ack=false which is the
105
+ * "desired" value). Hannah uses this to verify that a SetState command was executed
106
+ * successfully.
90
107
  */
91
108
  export interface AgentStateUpdate {
92
- /** full ioBroker state ID, e.g. "javascript.0.virtualDevice.Licht.EG.Wohnzimmer.DeckeSeite.on" */
109
+ /** full ioBroker state ID, e.g. "0_userdata.0.feeded" */
93
110
  stateId: string;
94
111
  /** JSON-encoded value: "true", "42", "\"text\"" */
95
112
  value: string;
@@ -104,7 +121,7 @@ export interface AgentTextCommand {
104
121
  }
105
122
  /** Sent by Hannah Core over the AgentConnect stream. */
106
123
  export interface AgentCommand {
107
- /** Hannah wants to control an ioBroker device */
124
+ /** Hannah wants to write an arbitrary ioBroker state (trigger actions) */
108
125
  setState?: AgentSetState | undefined;
109
126
  /** Hannah needs additional states streamed */
110
127
  watchMore?: AgentWatchMore | undefined;
@@ -126,6 +143,33 @@ export interface AgentCommand {
126
143
  satelliteDeleted?: AgentSatelliteDeleted | undefined;
127
144
  /** Hannah wants to set a resident's mood, independent of presence */
128
145
  setResidentMood?: AgentSetResidentMood | undefined;
146
+ /** reply to an AgentMessage that set ack_id */
147
+ ack?: AgentAck | undefined;
148
+ /** Hannah wants to control a slot of a typed device */
149
+ setSlot?: SetSlot | undefined;
150
+ }
151
+ /**
152
+ * Core's reply to an AgentMessage that set ack_id: which fields of that
153
+ * message (including nested messages) Core's schema did not know and
154
+ * therefore dropped. Empty unknown_fields = every field was known.
155
+ * Core guarantees that every field it does not report is also evaluated,
156
+ * so a security-relevant field never reads as supported without being
157
+ * enforced (hannah-proto#16).
158
+ */
159
+ export interface AgentAck {
160
+ ackId: bigint;
161
+ unknownFields: UnknownFields[];
162
+ }
163
+ /**
164
+ * Unknown field numbers, aggregated per message type — a snapshot with many
165
+ * devices yields one entry for hannah.v2.TypedDevice, not one per device.
166
+ * An unknown oneof payload shows up as a field number on the enclosing message.
167
+ */
168
+ export interface UnknownFields {
169
+ /** fully qualified name, e.g. "hannah.v2.TypedDevice" */
170
+ messageType: string;
171
+ /** deduplicated */
172
+ fieldNumbers: number[];
129
173
  }
130
174
  export interface AgentFirmwareEvent {
131
175
  device: string;
@@ -159,21 +203,10 @@ export interface AgentWatchMore {
159
203
  export interface AgentSetResident {
160
204
  /** e.g. "leonie", "hannah" */
161
205
  residentId: string;
162
- /**
163
- * Legacy absolute presence value (0=absent, 1=home, 2=night) — writes the combined
164
- * presence.state, which cross-clobbers whichever of home/away/night Hannah didn't
165
- * intend to change. Superseded by `action`; kept only for adapters older than
166
- * compat_version 2, which don't understand `action` yet and ignore it entirely.
167
- * Senders should populate both until those adapters are no longer in use.
168
- *
169
- * @deprecated
170
- */
171
- presenceState: number;
172
206
  type: ResidentType;
173
207
  /**
174
- * Preferred over `presence_state`: sets only the single presence.{away,home,night}
175
- * flag this action corresponds to, letting the residents adapter's own consistency
176
- * guard handle the rest.
208
+ * Sets only the single presence.{away,home,night} flag this action corresponds to,
209
+ * letting the residents adapter's own consistency guard handle the rest.
177
210
  */
178
211
  action: ResidentPresenceAction;
179
212
  }
@@ -243,67 +276,11 @@ export interface AgentNotification {
243
276
  /** "alert" | "notify" | "info" — only used when direct=false */
244
277
  severity: string;
245
278
  }
246
- export interface AgentStateValue {
247
- value: string;
248
- ack: boolean;
249
- }
250
- /** A device from the ioBroker adapter */
251
- export interface AgentDevice {
252
- stateId: string;
253
- floor: string;
254
- /** room_id: stable enum ID segment, e.g. "wohnzimmer" or "living_room" */
255
- room: string;
256
- device: string;
257
- deviceType: string;
258
- functions: string[];
259
- value: AgentStateValue | undefined;
260
- /** all display names from ioBroker enum, e.g. {"de": "Wohnzimmer", "en": "Living Room"} */
261
- roomNames: {
262
- [key: string]: string;
263
- };
264
- /** derived from ioBroker's common.type/role/states */
265
- stateType: StateType;
266
- /** only set when state_type is ENUM or COLOR */
267
- enumValues: EnumValues | undefined;
268
- /** derived from ioBroker's common.write */
269
- writable: boolean;
270
- /**
271
- * Grouping ID for the device this state belongs to (the adapter's own
272
- * `deviceId`, one path segment up from state_id) — lets Core group sibling
273
- * states without guessing from state_id's path depth. Empty = adapter hasn't
274
- * been updated yet; Core falls back to its own path-depth heuristic (hannah#257).
275
- */
276
- deviceId: string;
277
- /**
278
- * Semantic role of this specific state (e.g. "on", "level", "color", "current",
279
- * "expected"), resolved by the adapter from the state's ioBroker common.role —
280
- * same per-state basis as device_type, not aggregated across sibling states
281
- * (a thermostat's "current" and "expected" states have different roles but
282
- * belong to one device). Empty = adapter hasn't been updated yet or role is
283
- * unresolvable; Core falls back to its iobroker.state_names default table
284
- * (hannah#256, hannah#257).
285
- */
286
- canonicalKey: string;
287
- /**
288
- * Whether this device's actuator uses the inverted convention (0%=open,
289
- * 100%=closed) instead of Hannah's default (0%=closed, 100%=open), e.g.
290
- * some Homematic/KNX shutter/awning actuators. Unset = unknown/no override,
291
- * not `false` (hannah-proto#4).
292
- */
293
- inverted?: boolean | undefined;
294
- }
295
- export interface AgentDevice_RoomNamesEntry {
296
- key: string;
297
- value: string;
298
- }
299
- /** a list with all known devices from the ioBroker adapter */
300
- export interface AgentDeviceSnapshot {
301
- devices: AgentDevice[];
302
- }
303
279
  /**
304
280
  * A room from the ioBroker adapter's enum.rooms.* catalog — independent of devices,
305
281
  * so rooms without any device yet are still known to Hannah (e.g. before the first
306
- * satellite is provisioned into a brand-new room).
282
+ * satellite is provisioned into a brand-new room). TypedDevice.room refers to
283
+ * room_id, the display names live here only.
307
284
  */
308
285
  export interface AgentRoom {
309
286
  /** enum ID segment, e.g. "wohnzimmer" */
@@ -319,7 +296,7 @@ export interface AgentRoom_DisplayNamesEntry {
319
296
  }
320
297
  /**
321
298
  * Full room catalog from the ioBroker adapter. Sent on AgentConnect and whenever
322
- * enum.rooms.* changes, independent of AgentDeviceSnapshot.
299
+ * enum.rooms.* changes, independent of TypedDeviceSnapshot.
323
300
  */
324
301
  export interface AgentRoomSnapshot {
325
302
  rooms: AgentRoom[];
@@ -392,6 +369,8 @@ export declare const CaptureControl: MessageFns<CaptureControl>;
392
369
  export declare const AgentStateUpdate: MessageFns<AgentStateUpdate>;
393
370
  export declare const AgentTextCommand: MessageFns<AgentTextCommand>;
394
371
  export declare const AgentCommand: MessageFns<AgentCommand>;
372
+ export declare const AgentAck: MessageFns<AgentAck>;
373
+ export declare const UnknownFields: MessageFns<UnknownFields>;
395
374
  export declare const AgentFirmwareEvent: MessageFns<AgentFirmwareEvent>;
396
375
  export declare const AgentSetState: MessageFns<AgentSetState>;
397
376
  export declare const AgentWatchMore: MessageFns<AgentWatchMore>;
@@ -401,10 +380,6 @@ export declare const AgentSatelliteUpdate: MessageFns<AgentSatelliteUpdate>;
401
380
  export declare const AgentSatelliteDeleted: MessageFns<AgentSatelliteDeleted>;
402
381
  export declare const AgentTextAnswer: MessageFns<AgentTextAnswer>;
403
382
  export declare const AgentNotification: MessageFns<AgentNotification>;
404
- export declare const AgentStateValue: MessageFns<AgentStateValue>;
405
- export declare const AgentDevice: MessageFns<AgentDevice>;
406
- export declare const AgentDevice_RoomNamesEntry: MessageFns<AgentDevice_RoomNamesEntry>;
407
- export declare const AgentDeviceSnapshot: MessageFns<AgentDeviceSnapshot>;
408
383
  export declare const AgentRoom: MessageFns<AgentRoom>;
409
384
  export declare const AgentRoom_DisplayNamesEntry: MessageFns<AgentRoom_DisplayNamesEntry>;
410
385
  export declare const AgentRoomSnapshot: MessageFns<AgentRoomSnapshot>;