@m1kad0/hannah-proto 2.0.1 → 3.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/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 flat at the repo root, 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/`, 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
 
@@ -20,6 +20,29 @@ Go has no separate package registry, so that tagged GitHub repo *is* the package
20
20
 
21
21
  Alongside the semver package/tag version, every release carries a single-integer `PROTO_VERSION` (see the `PROTO_VERSION` file). Hannah Core and its clients exchange this value on every call and reject a mismatch at runtime — that's the actual compatibility gate, not the semver tag. A breaking schema change requires bumping `PROTO_VERSION`; CI enforces this on every merge request via `buf breaking`.
22
22
 
23
+ ## Per-message compatibility: compat_version
24
+
25
+ `PROTO_VERSION` is repo-wide — any breaking change anywhere bumps it, forcing every consumer to reject, even ones that never call the affected RPC. `compat_version` (`options.proto`) is a finer-grained, independent counter set on an individual message:
26
+
27
+ ```proto
28
+ message Foo {
29
+ option (compat_version) = 2;
30
+ ...
31
+ }
32
+ ```
33
+
34
+ Bump a message's `compat_version` only when *that specific message* has an actual breaking change. A message with no `compat_version` option carries an implicit value of `1` — don't backfill the option onto messages that have never had a breaking change. This lets a consumer-side interceptor check only the messages a given RPC call actually uses instead of rejecting on any unrelated proto change.
35
+
36
+ ## Deprecating fields and RPCs
37
+
38
+ Don't remove a field or RPC the moment it's unused — that forces every consumer to bump immediately, even ones that never touched it (see the `SetGroupRooms` incident that forced 9 unrelated components to bump, `hannah-proto#9`). Instead:
39
+
40
+ 1. Mark it `deprecated = true` (protobuf's built-in field/method option) and note why + what replaces it in a comment.
41
+ 2. Leave it in place until the next planned major cleanup, not the next release.
42
+ 3. Actually remove it (a breaking change, `PROTO_VERSION` bump) only during that cleanup, batched with other accumulated deprecations rather than one at a time.
43
+
44
+ Go/TypeScript/Python codegen surface `deprecated = true` automatically (Go doc comment, TS `@deprecated` JSDoc) — no extra tooling or config needed.
45
+
23
46
  ## Compatibility checks
24
47
 
25
48
  CI runs `buf lint` and `buf breaking` (against `origin/master`) on every MR. To check a local branch against a specific released version:
package/dist/agent.d.ts CHANGED
@@ -163,6 +163,8 @@ export interface AgentSatelliteUpdate {
163
163
  mute?: boolean | undefined;
164
164
  /** human-readable name from Core DB (empty = fall back to device_id) */
165
165
  displayName: string;
166
+ /** current do-not-disturb state; absent = no change */
167
+ dnd?: boolean | undefined;
166
168
  }
167
169
  /**
168
170
  * Hannah Core deleted a satellite (RoomManager.delete_satellite()) — the adapter
package/dist/agent.js CHANGED
@@ -3,7 +3,7 @@
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.12.0
5
5
  // protoc unknown
6
- // source: agent.proto
6
+ // source: hannah/agent.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.AgentSensorUpdate = exports.AgentBleUpdate = exports.AgentResidentAnswered = exports.AgentAskResident = exports.AgentResidentSnapshot = exports.AgentResident = exports.AgentRoomSnapshot = exports.AgentRoom_DisplayNamesEntry = exports.AgentRoom = exports.AgentDeviceSnapshot = exports.AgentDevice_RoomNamesEntry = exports.AgentDevice = exports.AgentStateValue = exports.AgentNotification = exports.AgentTextAnswer = exports.AgentSatelliteDeleted = exports.AgentSatelliteUpdate = exports.AgentSetResidentMood = exports.AgentSetResident = exports.AgentWatchMore = exports.AgentSetState = exports.AgentFirmwareEvent = exports.AgentCommand = exports.AgentTextCommand = exports.AgentStateUpdate = exports.AgentSatelliteControl = exports.AgentMessage = exports.ResidentType = exports.protobufPackage = void 0;
9
9
  /* eslint-disable */
@@ -889,7 +889,16 @@ exports.AgentSetResidentMood = {
889
889
  },
890
890
  };
891
891
  function createBaseAgentSatelliteUpdate() {
892
- return { deviceId: "", room: "", address: "", online: false, volume: undefined, mute: undefined, displayName: "" };
892
+ return {
893
+ deviceId: "",
894
+ room: "",
895
+ address: "",
896
+ online: false,
897
+ volume: undefined,
898
+ mute: undefined,
899
+ displayName: "",
900
+ dnd: undefined,
901
+ };
893
902
  }
894
903
  exports.AgentSatelliteUpdate = {
895
904
  encode(message, writer = new wire_1.BinaryWriter()) {
@@ -914,6 +923,9 @@ exports.AgentSatelliteUpdate = {
914
923
  if (message.displayName !== "") {
915
924
  writer.uint32(66).string(message.displayName);
916
925
  }
926
+ if (message.dnd !== undefined) {
927
+ writer.uint32(72).bool(message.dnd);
928
+ }
917
929
  return writer;
918
930
  },
919
931
  decode(input, length) {
@@ -972,6 +984,13 @@ exports.AgentSatelliteUpdate = {
972
984
  message.displayName = reader.string();
973
985
  continue;
974
986
  }
987
+ case 9: {
988
+ if (tag !== 72) {
989
+ break;
990
+ }
991
+ message.dnd = reader.bool();
992
+ continue;
993
+ }
975
994
  }
976
995
  if ((tag & 7) === 4 || tag === 0) {
977
996
  break;
@@ -992,6 +1011,7 @@ exports.AgentSatelliteUpdate = {
992
1011
  message.volume = object.volume ?? undefined;
993
1012
  message.mute = object.mute ?? undefined;
994
1013
  message.displayName = object.displayName ?? "";
1014
+ message.dnd = object.dnd ?? undefined;
995
1015
  return message;
996
1016
  },
997
1017
  };
@@ -3,7 +3,7 @@
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.12.0
5
5
  // protoc unknown
6
- // source: automation.proto
6
+ // source: hannah/automation.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.AutomationStateChanged = exports.AutomationSnapshot = exports.AutomationCommand = exports.AutomationRegister = exports.AutomationMessage = exports.protobufPackage = void 0;
9
9
  /* eslint-disable */
package/dist/car_state.js CHANGED
@@ -3,7 +3,7 @@
3
3
  // versions:
4
4
  // protoc-gen-ts_proto v2.12.0
5
5
  // protoc unknown
6
- // source: car_state.proto
6
+ // source: hannah/car_state.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.CarStateProto_WindowsEntry = exports.CarStateProto_DoorsEntry = exports.CarStateProto = exports.GetAllCarStatesResponse = exports.CarStateResponse = exports.protobufPackage = void 0;
9
9
  /* eslint-disable */
package/dist/control.d.ts CHANGED
@@ -46,70 +46,6 @@ export interface AnnounceRequest {
46
46
  /** 0 = not set */
47
47
  userId: number;
48
48
  }
49
- export interface Satellite {
50
- deviceId: string;
51
- /** live-reported room (UDP/proxy registration); empty if not connected */
52
- room: string;
53
- /** IP:port of the UDP satellite; empty if not connected */
54
- address: string;
55
- /** human-readable name from Core DB (empty if not provisioned) */
56
- displayName: string;
57
- /** room assigned in Core DB, "" = unassigned */
58
- roomId: string;
59
- /** display name of room_id */
60
- roomDisplayName: string;
61
- /** UTC "YYYY-MM-DD HH:MM:SS" from Core DB, "" = never seen */
62
- lastSeen: string;
63
- /** true if currently live (UDP or proxy) */
64
- connected: boolean;
65
- /** true if connected and live room differs from room_id */
66
- roomMismatch: boolean;
67
- /** Person (User) assigned as owner in Core DB, 0 = unassigned. #31 */
68
- ownerUserId: number;
69
- /** display name of owner_user_id, "" if unassigned */
70
- ownerDisplayName: string;
71
- /** firmware_version of the satellite */
72
- firmwareVersion: string;
73
- /** true if the device has a new firmware available */
74
- updateAvailable: boolean;
75
- newVersion?: string | undefined;
76
- /** #158: mic reopens after a Smalltalk answer instead of waiting for wake-word/PTT again */
77
- smalltalkFollowupListen: boolean;
78
- }
79
- export interface GetSatellitesResponse {
80
- satellites: Satellite[];
81
- }
82
- export interface SetSatelliteRoomRequest {
83
- deviceId: string;
84
- /** "" = unassign */
85
- roomId: string;
86
- /** requestor */
87
- requestorId: number;
88
- }
89
- export interface SetSatelliteDisplayNameRequest {
90
- deviceId: string;
91
- displayName: string;
92
- /** requestor */
93
- requestorId: number;
94
- }
95
- export interface SetSatelliteOwnerRequest {
96
- deviceId: string;
97
- /** 0 = unassign */
98
- userId: number;
99
- /** requestor */
100
- requestorId: number;
101
- }
102
- export interface SetSatelliteSmalltalkFollowupRequest {
103
- deviceId: string;
104
- enabled: boolean;
105
- /** requestor */
106
- requestorId: number;
107
- }
108
- export interface DeleteSatelliteRequest {
109
- deviceId: string;
110
- /** requestor */
111
- requestorId: number;
112
- }
113
49
  export interface Room {
114
50
  roomId: string;
115
51
  displayName: string;
@@ -341,13 +277,6 @@ export declare const SubmitTextResponse: MessageFns<SubmitTextResponse>;
341
277
  export declare const SubmitVoiceRequest: MessageFns<SubmitVoiceRequest>;
342
278
  export declare const SubmitVoiceResponse: MessageFns<SubmitVoiceResponse>;
343
279
  export declare const AnnounceRequest: MessageFns<AnnounceRequest>;
344
- export declare const Satellite: MessageFns<Satellite>;
345
- export declare const GetSatellitesResponse: MessageFns<GetSatellitesResponse>;
346
- export declare const SetSatelliteRoomRequest: MessageFns<SetSatelliteRoomRequest>;
347
- export declare const SetSatelliteDisplayNameRequest: MessageFns<SetSatelliteDisplayNameRequest>;
348
- export declare const SetSatelliteOwnerRequest: MessageFns<SetSatelliteOwnerRequest>;
349
- export declare const SetSatelliteSmalltalkFollowupRequest: MessageFns<SetSatelliteSmalltalkFollowupRequest>;
350
- export declare const DeleteSatelliteRequest: MessageFns<DeleteSatelliteRequest>;
351
280
  export declare const Room: MessageFns<Room>;
352
281
  export declare const GetRoomsResponse: MessageFns<GetRoomsResponse>;
353
282
  export declare const GroupSatellite: MessageFns<GroupSatellite>;