@m1kad0/hannah-proto 3.5.0 → 3.6.1

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 CHANGED
@@ -1,5 +1,6 @@
1
1
  import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
2
  import { EnumValues, StateType } from "./shared";
3
+ import { CaptureMode, SampleType } from "./wakeword_capture";
3
4
  import { AgentWeatherUpdate } from "./weather";
4
5
  export declare const protobufPackage = "hannah";
5
6
  export declare enum ResidentType {
@@ -32,8 +33,9 @@ export interface AgentMessage {
32
33
  /**
33
34
  * Adapter instructs Hannah to control satellites in a room or a specific satellite.
34
35
  * room: room_id (enum ID segment) or "all" for all rooms.
35
- * device_id: if non-empty, only the named satellite is targeted (volume/mute only);
36
+ * device_id: if non-empty, only the named satellite is targeted (volume/mute/capture only);
36
37
  * room is still required (used for room-scoped commands and as fallback).
38
+ * For capture, device_id is mandatory — never room-broadcast.
37
39
  */
38
40
  export interface AgentSatelliteControl {
39
41
  room: string;
@@ -51,6 +53,17 @@ export interface AgentSatelliteControl {
51
53
  announcementSsml?: string | undefined;
52
54
  /** speak announcement, text rephrased by LLM first */
53
55
  announcementRephrase?: string | undefined;
56
+ /** start/stop a Voice Collector capture on this satellite */
57
+ capture?: CaptureControl | undefined;
58
+ }
59
+ /**
60
+ * Start or stop a Voice Collector capture — the AgentSatelliteControl counterpart
61
+ * to CaptureCommand, routed to the satellite named by AgentSatelliteControl.device_id.
62
+ */
63
+ export interface CaptureControl {
64
+ sampleType: SampleType | undefined;
65
+ captureMode: CaptureMode;
66
+ stop: boolean;
54
67
  }
55
68
  /**
56
69
  * An ioBroker state change event. ack=true means the device confirmed the value
@@ -319,6 +332,7 @@ export interface AgentSensorUpdate {
319
332
  }
320
333
  export declare const AgentMessage: MessageFns<AgentMessage>;
321
334
  export declare const AgentSatelliteControl: MessageFns<AgentSatelliteControl>;
335
+ export declare const CaptureControl: MessageFns<CaptureControl>;
322
336
  export declare const AgentStateUpdate: MessageFns<AgentStateUpdate>;
323
337
  export declare const AgentTextCommand: MessageFns<AgentTextCommand>;
324
338
  export declare const AgentCommand: MessageFns<AgentCommand>;
package/dist/agent.js CHANGED
@@ -5,10 +5,11 @@
5
5
  // protoc unknown
6
6
  // source: hannah/agent.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
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;
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.CaptureControl = exports.AgentSatelliteControl = exports.AgentMessage = exports.ResidentType = exports.protobufPackage = void 0;
9
9
  /* eslint-disable */
10
10
  const wire_1 = require("@bufbuild/protobuf/wire");
11
11
  const shared_1 = require("./shared");
12
+ const wakeword_capture_1 = require("./wakeword_capture");
12
13
  const weather_1 = require("./weather");
13
14
  exports.protobufPackage = "hannah";
14
15
  var ResidentType;
@@ -186,6 +187,7 @@ function createBaseAgentSatelliteControl() {
186
187
  announcement: undefined,
187
188
  announcementSsml: undefined,
188
189
  announcementRephrase: undefined,
190
+ capture: undefined,
189
191
  };
190
192
  }
191
193
  exports.AgentSatelliteControl = {
@@ -214,6 +216,9 @@ exports.AgentSatelliteControl = {
214
216
  if (message.announcementRephrase !== undefined) {
215
217
  writer.uint32(66).string(message.announcementRephrase);
216
218
  }
219
+ if (message.capture !== undefined) {
220
+ exports.CaptureControl.encode(message.capture, writer.uint32(74).fork()).join();
221
+ }
217
222
  return writer;
218
223
  },
219
224
  decode(input, length) {
@@ -279,6 +284,13 @@ exports.AgentSatelliteControl = {
279
284
  message.announcementRephrase = reader.string();
280
285
  continue;
281
286
  }
287
+ case 9: {
288
+ if (tag !== 74) {
289
+ break;
290
+ }
291
+ message.capture = exports.CaptureControl.decode(reader, reader.uint32());
292
+ continue;
293
+ }
282
294
  }
283
295
  if ((tag & 7) === 4 || tag === 0) {
284
296
  break;
@@ -300,6 +312,74 @@ exports.AgentSatelliteControl = {
300
312
  message.announcement = object.announcement ?? undefined;
301
313
  message.announcementSsml = object.announcementSsml ?? undefined;
302
314
  message.announcementRephrase = object.announcementRephrase ?? undefined;
315
+ message.capture = (object.capture !== undefined && object.capture !== null)
316
+ ? exports.CaptureControl.fromPartial(object.capture)
317
+ : undefined;
318
+ return message;
319
+ },
320
+ };
321
+ function createBaseCaptureControl() {
322
+ return { sampleType: undefined, captureMode: 0, stop: false };
323
+ }
324
+ exports.CaptureControl = {
325
+ encode(message, writer = new wire_1.BinaryWriter()) {
326
+ if (message.sampleType !== undefined) {
327
+ wakeword_capture_1.SampleType.encode(message.sampleType, writer.uint32(10).fork()).join();
328
+ }
329
+ if (message.captureMode !== 0) {
330
+ writer.uint32(16).int32(message.captureMode);
331
+ }
332
+ if (message.stop !== false) {
333
+ writer.uint32(24).bool(message.stop);
334
+ }
335
+ return writer;
336
+ },
337
+ decode(input, length) {
338
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
339
+ const end = length === undefined ? reader.len : reader.pos + length;
340
+ const message = createBaseCaptureControl();
341
+ while (reader.pos < end) {
342
+ const tag = reader.uint32();
343
+ switch (tag >>> 3) {
344
+ case 1: {
345
+ if (tag !== 10) {
346
+ break;
347
+ }
348
+ message.sampleType = wakeword_capture_1.SampleType.decode(reader, reader.uint32());
349
+ continue;
350
+ }
351
+ case 2: {
352
+ if (tag !== 16) {
353
+ break;
354
+ }
355
+ message.captureMode = reader.int32();
356
+ continue;
357
+ }
358
+ case 3: {
359
+ if (tag !== 24) {
360
+ break;
361
+ }
362
+ message.stop = reader.bool();
363
+ continue;
364
+ }
365
+ }
366
+ if ((tag & 7) === 4 || tag === 0) {
367
+ break;
368
+ }
369
+ reader.skip(tag & 7);
370
+ }
371
+ return message;
372
+ },
373
+ create(base) {
374
+ return exports.CaptureControl.fromPartial(base ?? {});
375
+ },
376
+ fromPartial(object) {
377
+ const message = createBaseCaptureControl();
378
+ message.sampleType = (object.sampleType !== undefined && object.sampleType !== null)
379
+ ? wakeword_capture_1.SampleType.fromPartial(object.sampleType)
380
+ : undefined;
381
+ message.captureMode = object.captureMode ?? 0;
382
+ message.stop = object.stop ?? false;
303
383
  return message;
304
384
  },
305
385
  };
@@ -62,6 +62,7 @@ exports.REQUIRED_COMPAT_VERSIONS = {
62
62
  "StreamSatelliteAudio": 1,
63
63
  "TriggerPlink": 1,
64
64
  "CollectorConnect": 1,
65
+ "TriggerCollectorCapture": 1,
65
66
  "RegisterProxy": 1,
66
67
  "SubmitSatelliteAudio": 1,
67
68
  "NotifySatelliteRegistered": 1,
Binary file
package/dist/hannah.d.ts CHANGED
@@ -618,6 +618,20 @@ export declare const HannahServiceService: {
618
618
  readonly responseSerialize: (value: CaptureCommand) => Buffer;
619
619
  readonly responseDeserialize: (value: Buffer) => CaptureCommand;
620
620
  };
621
+ /**
622
+ * Unary trigger for external callers (e.g. WebUI) that can't hold a CollectorConnect
623
+ * stream themselves — Hannah relays the command over its own CollectorConnect stream
624
+ * to the connected Collector. Fails with ok=false if no Collector is connected.
625
+ */
626
+ readonly triggerCollectorCapture: {
627
+ readonly path: "/hannah.HannahService/TriggerCollectorCapture";
628
+ readonly requestStream: false;
629
+ readonly responseStream: false;
630
+ readonly requestSerialize: (value: CaptureCommand) => Buffer;
631
+ readonly requestDeserialize: (value: Buffer) => CaptureCommand;
632
+ readonly responseSerialize: (value: StatusResponse) => Buffer;
633
+ readonly responseDeserialize: (value: Buffer) => StatusResponse;
634
+ };
621
635
  /**
622
636
  * --- Satellite Proxy (Go gRPC proxy) ---
623
637
  * Bidirectional keepalive stream. Proxy sends heartbeats; Hannah sends TTS
@@ -928,6 +942,12 @@ export interface HannahServiceServer extends UntypedServiceImplementation {
928
942
  * down to start/stop satellite captures instead of the Collector polling for them.
929
943
  */
930
944
  collectorConnect: handleBidiStreamingCall<CollectorMessage, CaptureCommand>;
945
+ /**
946
+ * Unary trigger for external callers (e.g. WebUI) that can't hold a CollectorConnect
947
+ * stream themselves — Hannah relays the command over its own CollectorConnect stream
948
+ * to the connected Collector. Fails with ok=false if no Collector is connected.
949
+ */
950
+ triggerCollectorCapture: handleUnaryCall<CaptureCommand, StatusResponse>;
931
951
  /**
932
952
  * --- Satellite Proxy (Go gRPC proxy) ---
933
953
  * Bidirectional keepalive stream. Proxy sends heartbeats; Hannah sends TTS
@@ -1248,6 +1268,14 @@ export interface HannahServiceClient extends Client {
1248
1268
  collectorConnect(): ClientDuplexStream<CollectorMessage, CaptureCommand>;
1249
1269
  collectorConnect(options: Partial<CallOptions>): ClientDuplexStream<CollectorMessage, CaptureCommand>;
1250
1270
  collectorConnect(metadata: Metadata, options?: Partial<CallOptions>): ClientDuplexStream<CollectorMessage, CaptureCommand>;
1271
+ /**
1272
+ * Unary trigger for external callers (e.g. WebUI) that can't hold a CollectorConnect
1273
+ * stream themselves — Hannah relays the command over its own CollectorConnect stream
1274
+ * to the connected Collector. Fails with ok=false if no Collector is connected.
1275
+ */
1276
+ triggerCollectorCapture(request: CaptureCommand, callback: (error: ServiceError | null, response: StatusResponse) => void): ClientUnaryCall;
1277
+ triggerCollectorCapture(request: CaptureCommand, metadata: Metadata, callback: (error: ServiceError | null, response: StatusResponse) => void): ClientUnaryCall;
1278
+ triggerCollectorCapture(request: CaptureCommand, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: StatusResponse) => void): ClientUnaryCall;
1251
1279
  /**
1252
1280
  * --- Satellite Proxy (Go gRPC proxy) ---
1253
1281
  * Bidirectional keepalive stream. Proxy sends heartbeats; Hannah sends TTS
package/dist/hannah.js CHANGED
@@ -626,6 +626,20 @@ exports.HannahServiceService = {
626
626
  responseSerialize: (value) => Buffer.from(wakeword_capture_1.CaptureCommand.encode(value).finish()),
627
627
  responseDeserialize: (value) => wakeword_capture_1.CaptureCommand.decode(value),
628
628
  },
629
+ /**
630
+ * Unary trigger for external callers (e.g. WebUI) that can't hold a CollectorConnect
631
+ * stream themselves — Hannah relays the command over its own CollectorConnect stream
632
+ * to the connected Collector. Fails with ok=false if no Collector is connected.
633
+ */
634
+ triggerCollectorCapture: {
635
+ path: "/hannah.HannahService/TriggerCollectorCapture",
636
+ requestStream: false,
637
+ responseStream: false,
638
+ requestSerialize: (value) => Buffer.from(wakeword_capture_1.CaptureCommand.encode(value).finish()),
639
+ requestDeserialize: (value) => wakeword_capture_1.CaptureCommand.decode(value),
640
+ responseSerialize: (value) => Buffer.from(shared_1.StatusResponse.encode(value).finish()),
641
+ responseDeserialize: (value) => shared_1.StatusResponse.decode(value),
642
+ },
629
643
  /**
630
644
  * --- Satellite Proxy (Go gRPC proxy) ---
631
645
  * Bidirectional keepalive stream. Proxy sends heartbeats; Hannah sends TTS
@@ -2,6 +2,12 @@ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
2
  export declare const protobufPackage = "hannah";
3
3
  export declare enum CaptureMode {
4
4
  CAPTURE_MODE_UNSPECIFIED = 0,
5
+ /**
6
+ * CAPTURE_MODE_MANUAL - Deprecated: identical in practice to CAPTURE_MODE_PTT (both mean "hand-triggered
7
+ * via the PTT button") — never produce this value, use CAPTURE_MODE_PTT instead.
8
+ *
9
+ * @deprecated
10
+ */
5
11
  CAPTURE_MODE_MANUAL = 1,
6
12
  CAPTURE_MODE_PTT = 2,
7
13
  CAPTURE_MODE_PLINK = 3,
@@ -12,6 +12,12 @@ exports.protobufPackage = "hannah";
12
12
  var CaptureMode;
13
13
  (function (CaptureMode) {
14
14
  CaptureMode[CaptureMode["CAPTURE_MODE_UNSPECIFIED"] = 0] = "CAPTURE_MODE_UNSPECIFIED";
15
+ /**
16
+ * CAPTURE_MODE_MANUAL - Deprecated: identical in practice to CAPTURE_MODE_PTT (both mean "hand-triggered
17
+ * via the PTT button") — never produce this value, use CAPTURE_MODE_PTT instead.
18
+ *
19
+ * @deprecated
20
+ */
15
21
  CaptureMode[CaptureMode["CAPTURE_MODE_MANUAL"] = 1] = "CAPTURE_MODE_MANUAL";
16
22
  CaptureMode[CaptureMode["CAPTURE_MODE_PTT"] = 2] = "CAPTURE_MODE_PTT";
17
23
  CaptureMode[CaptureMode["CAPTURE_MODE_PLINK"] = 3] = "CAPTURE_MODE_PLINK";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m1kad0/hannah-proto",
3
- "version": "3.5.0",
3
+ "version": "3.6.1",
4
4
  "description": "Generated TypeScript gRPC-js client stubs for the Hannah voice assistant proto schema",
5
5
  "license": "UNLICENSED",
6
6
  "main": "dist/index.js",