@m1kad0/hannah-proto 3.4.0 → 3.6.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 +15 -1
- package/dist/agent.js +81 -1
- package/dist/compat_versions.js +2 -0
- package/dist/descriptor.binpb +0 -0
- package/dist/hannah.d.ts +57 -1
- package/dist/hannah.js +28 -0
- package/dist/wakeword_capture.d.ts +47 -0
- package/dist/wakeword_capture.js +283 -1
- package/package.json +1 -1
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
|
};
|
package/dist/compat_versions.js
CHANGED
|
@@ -61,6 +61,8 @@ exports.REQUIRED_COMPAT_VERSIONS = {
|
|
|
61
61
|
"ReleaseSatelliteCapture": 1,
|
|
62
62
|
"StreamSatelliteAudio": 1,
|
|
63
63
|
"TriggerPlink": 1,
|
|
64
|
+
"CollectorConnect": 1,
|
|
65
|
+
"TriggerCollectorCapture": 1,
|
|
64
66
|
"RegisterProxy": 1,
|
|
65
67
|
"SubmitSatelliteAudio": 1,
|
|
66
68
|
"NotifySatelliteRegistered": 1,
|
package/dist/descriptor.binpb
CHANGED
|
Binary file
|
package/dist/hannah.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ import { EnrollVoiceprintRequest } from "./speaker_enrollment";
|
|
|
14
14
|
import { DeleteTimerRequest, GetTimersRequest, GetTimersResponse } from "./timer_admin";
|
|
15
15
|
import { TimerCommand, TimerMessage } from "./timer_service";
|
|
16
16
|
import { CreateUserRequest, CreateUserResponse, DeleteUserRequest, GetResidentsResponse, GetUserRequest, GetUsersRequest, GetUsersResponse, LinkAccountRequest, LoginRequest, SetAutomationRequest, SetSystemMessagesRequest, SetTrustLevelRequest, UnlinkAccountRequest, UpdateUserRequest, UserResponse } from "./user_registry";
|
|
17
|
-
import { SatelliteAudioChunk, SatelliteCaptureRequest, SatelliteCaptureResponse, TriggerPlinkRequest } from "./wakeword_capture";
|
|
17
|
+
import { CaptureCommand, CollectorMessage, SatelliteAudioChunk, SatelliteCaptureRequest, SatelliteCaptureResponse, TriggerPlinkRequest } from "./wakeword_capture";
|
|
18
18
|
export declare const protobufPackage = "hannah";
|
|
19
19
|
export type HannahServiceService = typeof HannahServiceService;
|
|
20
20
|
export declare const HannahServiceService: {
|
|
@@ -604,6 +604,34 @@ export declare const HannahServiceService: {
|
|
|
604
604
|
readonly responseSerialize: (value: StatusResponse) => Buffer;
|
|
605
605
|
readonly responseDeserialize: (value: Buffer) => StatusResponse;
|
|
606
606
|
};
|
|
607
|
+
/**
|
|
608
|
+
* Bidirectional stream between the Collector and Hannah Core, analogous to TimerConnect.
|
|
609
|
+
* The Collector initiates and holds the connection open; Hannah pushes CaptureCommands
|
|
610
|
+
* down to start/stop satellite captures instead of the Collector polling for them.
|
|
611
|
+
*/
|
|
612
|
+
readonly collectorConnect: {
|
|
613
|
+
readonly path: "/hannah.HannahService/CollectorConnect";
|
|
614
|
+
readonly requestStream: true;
|
|
615
|
+
readonly responseStream: true;
|
|
616
|
+
readonly requestSerialize: (value: CollectorMessage) => Buffer;
|
|
617
|
+
readonly requestDeserialize: (value: Buffer) => CollectorMessage;
|
|
618
|
+
readonly responseSerialize: (value: CaptureCommand) => Buffer;
|
|
619
|
+
readonly responseDeserialize: (value: Buffer) => CaptureCommand;
|
|
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
|
+
};
|
|
607
635
|
/**
|
|
608
636
|
* --- Satellite Proxy (Go gRPC proxy) ---
|
|
609
637
|
* Bidirectional keepalive stream. Proxy sends heartbeats; Hannah sends TTS
|
|
@@ -908,6 +936,18 @@ export interface HannahServiceServer extends UntypedServiceImplementation {
|
|
|
908
936
|
* Returns after PTT is released — Collector calls this in a loop for guided hey-hannah collection.
|
|
909
937
|
*/
|
|
910
938
|
triggerPlink: handleUnaryCall<TriggerPlinkRequest, StatusResponse>;
|
|
939
|
+
/**
|
|
940
|
+
* Bidirectional stream between the Collector and Hannah Core, analogous to TimerConnect.
|
|
941
|
+
* The Collector initiates and holds the connection open; Hannah pushes CaptureCommands
|
|
942
|
+
* down to start/stop satellite captures instead of the Collector polling for them.
|
|
943
|
+
*/
|
|
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>;
|
|
911
951
|
/**
|
|
912
952
|
* --- Satellite Proxy (Go gRPC proxy) ---
|
|
913
953
|
* Bidirectional keepalive stream. Proxy sends heartbeats; Hannah sends TTS
|
|
@@ -1220,6 +1260,22 @@ export interface HannahServiceClient extends Client {
|
|
|
1220
1260
|
triggerPlink(request: TriggerPlinkRequest, callback: (error: ServiceError | null, response: StatusResponse) => void): ClientUnaryCall;
|
|
1221
1261
|
triggerPlink(request: TriggerPlinkRequest, metadata: Metadata, callback: (error: ServiceError | null, response: StatusResponse) => void): ClientUnaryCall;
|
|
1222
1262
|
triggerPlink(request: TriggerPlinkRequest, metadata: Metadata, options: Partial<CallOptions>, callback: (error: ServiceError | null, response: StatusResponse) => void): ClientUnaryCall;
|
|
1263
|
+
/**
|
|
1264
|
+
* Bidirectional stream between the Collector and Hannah Core, analogous to TimerConnect.
|
|
1265
|
+
* The Collector initiates and holds the connection open; Hannah pushes CaptureCommands
|
|
1266
|
+
* down to start/stop satellite captures instead of the Collector polling for them.
|
|
1267
|
+
*/
|
|
1268
|
+
collectorConnect(): ClientDuplexStream<CollectorMessage, CaptureCommand>;
|
|
1269
|
+
collectorConnect(options: Partial<CallOptions>): ClientDuplexStream<CollectorMessage, CaptureCommand>;
|
|
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;
|
|
1223
1279
|
/**
|
|
1224
1280
|
* --- Satellite Proxy (Go gRPC proxy) ---
|
|
1225
1281
|
* Bidirectional keepalive stream. Proxy sends heartbeats; Hannah sends TTS
|
package/dist/hannah.js
CHANGED
|
@@ -612,6 +612,34 @@ exports.HannahServiceService = {
|
|
|
612
612
|
responseSerialize: (value) => Buffer.from(shared_1.StatusResponse.encode(value).finish()),
|
|
613
613
|
responseDeserialize: (value) => shared_1.StatusResponse.decode(value),
|
|
614
614
|
},
|
|
615
|
+
/**
|
|
616
|
+
* Bidirectional stream between the Collector and Hannah Core, analogous to TimerConnect.
|
|
617
|
+
* The Collector initiates and holds the connection open; Hannah pushes CaptureCommands
|
|
618
|
+
* down to start/stop satellite captures instead of the Collector polling for them.
|
|
619
|
+
*/
|
|
620
|
+
collectorConnect: {
|
|
621
|
+
path: "/hannah.HannahService/CollectorConnect",
|
|
622
|
+
requestStream: true,
|
|
623
|
+
responseStream: true,
|
|
624
|
+
requestSerialize: (value) => Buffer.from(wakeword_capture_1.CollectorMessage.encode(value).finish()),
|
|
625
|
+
requestDeserialize: (value) => wakeword_capture_1.CollectorMessage.decode(value),
|
|
626
|
+
responseSerialize: (value) => Buffer.from(wakeword_capture_1.CaptureCommand.encode(value).finish()),
|
|
627
|
+
responseDeserialize: (value) => wakeword_capture_1.CaptureCommand.decode(value),
|
|
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
|
+
},
|
|
615
643
|
/**
|
|
616
644
|
* --- Satellite Proxy (Go gRPC proxy) ---
|
|
617
645
|
* Bidirectional keepalive stream. Proxy sends heartbeats; Hannah sends TTS
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
2
|
export declare const protobufPackage = "hannah";
|
|
3
|
+
export declare enum CaptureMode {
|
|
4
|
+
CAPTURE_MODE_UNSPECIFIED = 0,
|
|
5
|
+
CAPTURE_MODE_MANUAL = 1,
|
|
6
|
+
CAPTURE_MODE_PTT = 2,
|
|
7
|
+
CAPTURE_MODE_PLINK = 3,
|
|
8
|
+
UNRECOGNIZED = -1
|
|
9
|
+
}
|
|
3
10
|
export interface SatelliteCaptureRequest {
|
|
4
11
|
deviceId: string;
|
|
5
12
|
/**
|
|
@@ -32,10 +39,50 @@ export interface SatelliteAudioChunk {
|
|
|
32
39
|
/** true = PTT released, utterance boundary */
|
|
33
40
|
endOfUtterance: boolean;
|
|
34
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Sent by Hannah Core over the CollectorConnect stream to start or stop a
|
|
44
|
+
* satellite capture — the Collector-side counterpart to RequestSatelliteCapture/
|
|
45
|
+
* ReleaseSatelliteCapture, pushed proactively instead of polled.
|
|
46
|
+
* capture_mode is only meaningful when sample_type is hey_hannah.
|
|
47
|
+
*/
|
|
48
|
+
export interface CaptureCommand {
|
|
49
|
+
deviceId: string;
|
|
50
|
+
sampleType: SampleType | undefined;
|
|
51
|
+
captureMode: CaptureMode;
|
|
52
|
+
stop: boolean;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Deliberately a oneof of (currently empty) payload messages rather than a plain
|
|
56
|
+
* enum — leaves room to attach per-sample-type data later without a breaking change.
|
|
57
|
+
*/
|
|
58
|
+
export interface SampleType {
|
|
59
|
+
noise?: NoiseSample | undefined;
|
|
60
|
+
heyHannah?: HeyHannahSample | undefined;
|
|
61
|
+
}
|
|
62
|
+
export interface NoiseSample {
|
|
63
|
+
}
|
|
64
|
+
export interface HeyHannahSample {
|
|
65
|
+
}
|
|
66
|
+
/** Sent by the Collector over the CollectorConnect stream. */
|
|
67
|
+
export interface CollectorMessage {
|
|
68
|
+
/** initial confirmation when stream is established */
|
|
69
|
+
ack?: CollectorAck | undefined;
|
|
70
|
+
}
|
|
71
|
+
/** Sent once by the Collector after the CollectorConnect stream is established. */
|
|
72
|
+
export interface CollectorAck {
|
|
73
|
+
/** human-readable status */
|
|
74
|
+
message: string;
|
|
75
|
+
}
|
|
35
76
|
export declare const SatelliteCaptureRequest: MessageFns<SatelliteCaptureRequest>;
|
|
36
77
|
export declare const TriggerPlinkRequest: MessageFns<TriggerPlinkRequest>;
|
|
37
78
|
export declare const SatelliteCaptureResponse: MessageFns<SatelliteCaptureResponse>;
|
|
38
79
|
export declare const SatelliteAudioChunk: MessageFns<SatelliteAudioChunk>;
|
|
80
|
+
export declare const CaptureCommand: MessageFns<CaptureCommand>;
|
|
81
|
+
export declare const SampleType: MessageFns<SampleType>;
|
|
82
|
+
export declare const NoiseSample: MessageFns<NoiseSample>;
|
|
83
|
+
export declare const HeyHannahSample: MessageFns<HeyHannahSample>;
|
|
84
|
+
export declare const CollectorMessage: MessageFns<CollectorMessage>;
|
|
85
|
+
export declare const CollectorAck: MessageFns<CollectorAck>;
|
|
39
86
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
40
87
|
export type DeepPartial<T> = T extends bigint ? string | number | bigint : T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
41
88
|
[K in keyof T]?: DeepPartial<T[K]>;
|
package/dist/wakeword_capture.js
CHANGED
|
@@ -5,10 +5,18 @@
|
|
|
5
5
|
// protoc unknown
|
|
6
6
|
// source: hannah/wakeword_capture.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.SatelliteAudioChunk = exports.SatelliteCaptureResponse = exports.TriggerPlinkRequest = exports.SatelliteCaptureRequest = exports.protobufPackage = void 0;
|
|
8
|
+
exports.CollectorAck = exports.CollectorMessage = exports.HeyHannahSample = exports.NoiseSample = exports.SampleType = exports.CaptureCommand = exports.SatelliteAudioChunk = exports.SatelliteCaptureResponse = exports.TriggerPlinkRequest = exports.SatelliteCaptureRequest = exports.CaptureMode = exports.protobufPackage = void 0;
|
|
9
9
|
/* eslint-disable */
|
|
10
10
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
11
|
exports.protobufPackage = "hannah";
|
|
12
|
+
var CaptureMode;
|
|
13
|
+
(function (CaptureMode) {
|
|
14
|
+
CaptureMode[CaptureMode["CAPTURE_MODE_UNSPECIFIED"] = 0] = "CAPTURE_MODE_UNSPECIFIED";
|
|
15
|
+
CaptureMode[CaptureMode["CAPTURE_MODE_MANUAL"] = 1] = "CAPTURE_MODE_MANUAL";
|
|
16
|
+
CaptureMode[CaptureMode["CAPTURE_MODE_PTT"] = 2] = "CAPTURE_MODE_PTT";
|
|
17
|
+
CaptureMode[CaptureMode["CAPTURE_MODE_PLINK"] = 3] = "CAPTURE_MODE_PLINK";
|
|
18
|
+
CaptureMode[CaptureMode["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
19
|
+
})(CaptureMode || (exports.CaptureMode = CaptureMode = {}));
|
|
12
20
|
function createBaseSatelliteCaptureRequest() {
|
|
13
21
|
return { deviceId: "", sampleType: "" };
|
|
14
22
|
}
|
|
@@ -228,3 +236,277 @@ exports.SatelliteAudioChunk = {
|
|
|
228
236
|
return message;
|
|
229
237
|
},
|
|
230
238
|
};
|
|
239
|
+
function createBaseCaptureCommand() {
|
|
240
|
+
return { deviceId: "", sampleType: undefined, captureMode: 0, stop: false };
|
|
241
|
+
}
|
|
242
|
+
exports.CaptureCommand = {
|
|
243
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
244
|
+
if (message.deviceId !== "") {
|
|
245
|
+
writer.uint32(10).string(message.deviceId);
|
|
246
|
+
}
|
|
247
|
+
if (message.sampleType !== undefined) {
|
|
248
|
+
exports.SampleType.encode(message.sampleType, writer.uint32(18).fork()).join();
|
|
249
|
+
}
|
|
250
|
+
if (message.captureMode !== 0) {
|
|
251
|
+
writer.uint32(24).int32(message.captureMode);
|
|
252
|
+
}
|
|
253
|
+
if (message.stop !== false) {
|
|
254
|
+
writer.uint32(32).bool(message.stop);
|
|
255
|
+
}
|
|
256
|
+
return writer;
|
|
257
|
+
},
|
|
258
|
+
decode(input, length) {
|
|
259
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
260
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
261
|
+
const message = createBaseCaptureCommand();
|
|
262
|
+
while (reader.pos < end) {
|
|
263
|
+
const tag = reader.uint32();
|
|
264
|
+
switch (tag >>> 3) {
|
|
265
|
+
case 1: {
|
|
266
|
+
if (tag !== 10) {
|
|
267
|
+
break;
|
|
268
|
+
}
|
|
269
|
+
message.deviceId = reader.string();
|
|
270
|
+
continue;
|
|
271
|
+
}
|
|
272
|
+
case 2: {
|
|
273
|
+
if (tag !== 18) {
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
message.sampleType = exports.SampleType.decode(reader, reader.uint32());
|
|
277
|
+
continue;
|
|
278
|
+
}
|
|
279
|
+
case 3: {
|
|
280
|
+
if (tag !== 24) {
|
|
281
|
+
break;
|
|
282
|
+
}
|
|
283
|
+
message.captureMode = reader.int32();
|
|
284
|
+
continue;
|
|
285
|
+
}
|
|
286
|
+
case 4: {
|
|
287
|
+
if (tag !== 32) {
|
|
288
|
+
break;
|
|
289
|
+
}
|
|
290
|
+
message.stop = reader.bool();
|
|
291
|
+
continue;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
295
|
+
break;
|
|
296
|
+
}
|
|
297
|
+
reader.skip(tag & 7);
|
|
298
|
+
}
|
|
299
|
+
return message;
|
|
300
|
+
},
|
|
301
|
+
create(base) {
|
|
302
|
+
return exports.CaptureCommand.fromPartial(base ?? {});
|
|
303
|
+
},
|
|
304
|
+
fromPartial(object) {
|
|
305
|
+
const message = createBaseCaptureCommand();
|
|
306
|
+
message.deviceId = object.deviceId ?? "";
|
|
307
|
+
message.sampleType = (object.sampleType !== undefined && object.sampleType !== null)
|
|
308
|
+
? exports.SampleType.fromPartial(object.sampleType)
|
|
309
|
+
: undefined;
|
|
310
|
+
message.captureMode = object.captureMode ?? 0;
|
|
311
|
+
message.stop = object.stop ?? false;
|
|
312
|
+
return message;
|
|
313
|
+
},
|
|
314
|
+
};
|
|
315
|
+
function createBaseSampleType() {
|
|
316
|
+
return { noise: undefined, heyHannah: undefined };
|
|
317
|
+
}
|
|
318
|
+
exports.SampleType = {
|
|
319
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
320
|
+
if (message.noise !== undefined) {
|
|
321
|
+
exports.NoiseSample.encode(message.noise, writer.uint32(10).fork()).join();
|
|
322
|
+
}
|
|
323
|
+
if (message.heyHannah !== undefined) {
|
|
324
|
+
exports.HeyHannahSample.encode(message.heyHannah, writer.uint32(18).fork()).join();
|
|
325
|
+
}
|
|
326
|
+
return writer;
|
|
327
|
+
},
|
|
328
|
+
decode(input, length) {
|
|
329
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
330
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
331
|
+
const message = createBaseSampleType();
|
|
332
|
+
while (reader.pos < end) {
|
|
333
|
+
const tag = reader.uint32();
|
|
334
|
+
switch (tag >>> 3) {
|
|
335
|
+
case 1: {
|
|
336
|
+
if (tag !== 10) {
|
|
337
|
+
break;
|
|
338
|
+
}
|
|
339
|
+
message.noise = exports.NoiseSample.decode(reader, reader.uint32());
|
|
340
|
+
continue;
|
|
341
|
+
}
|
|
342
|
+
case 2: {
|
|
343
|
+
if (tag !== 18) {
|
|
344
|
+
break;
|
|
345
|
+
}
|
|
346
|
+
message.heyHannah = exports.HeyHannahSample.decode(reader, reader.uint32());
|
|
347
|
+
continue;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
351
|
+
break;
|
|
352
|
+
}
|
|
353
|
+
reader.skip(tag & 7);
|
|
354
|
+
}
|
|
355
|
+
return message;
|
|
356
|
+
},
|
|
357
|
+
create(base) {
|
|
358
|
+
return exports.SampleType.fromPartial(base ?? {});
|
|
359
|
+
},
|
|
360
|
+
fromPartial(object) {
|
|
361
|
+
const message = createBaseSampleType();
|
|
362
|
+
message.noise = (object.noise !== undefined && object.noise !== null)
|
|
363
|
+
? exports.NoiseSample.fromPartial(object.noise)
|
|
364
|
+
: undefined;
|
|
365
|
+
message.heyHannah = (object.heyHannah !== undefined && object.heyHannah !== null)
|
|
366
|
+
? exports.HeyHannahSample.fromPartial(object.heyHannah)
|
|
367
|
+
: undefined;
|
|
368
|
+
return message;
|
|
369
|
+
},
|
|
370
|
+
};
|
|
371
|
+
function createBaseNoiseSample() {
|
|
372
|
+
return {};
|
|
373
|
+
}
|
|
374
|
+
exports.NoiseSample = {
|
|
375
|
+
encode(_, writer = new wire_1.BinaryWriter()) {
|
|
376
|
+
return writer;
|
|
377
|
+
},
|
|
378
|
+
decode(input, length) {
|
|
379
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
380
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
381
|
+
const message = createBaseNoiseSample();
|
|
382
|
+
while (reader.pos < end) {
|
|
383
|
+
const tag = reader.uint32();
|
|
384
|
+
switch (tag >>> 3) {
|
|
385
|
+
}
|
|
386
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
387
|
+
break;
|
|
388
|
+
}
|
|
389
|
+
reader.skip(tag & 7);
|
|
390
|
+
}
|
|
391
|
+
return message;
|
|
392
|
+
},
|
|
393
|
+
create(base) {
|
|
394
|
+
return exports.NoiseSample.fromPartial(base ?? {});
|
|
395
|
+
},
|
|
396
|
+
fromPartial(_) {
|
|
397
|
+
const message = createBaseNoiseSample();
|
|
398
|
+
return message;
|
|
399
|
+
},
|
|
400
|
+
};
|
|
401
|
+
function createBaseHeyHannahSample() {
|
|
402
|
+
return {};
|
|
403
|
+
}
|
|
404
|
+
exports.HeyHannahSample = {
|
|
405
|
+
encode(_, writer = new wire_1.BinaryWriter()) {
|
|
406
|
+
return writer;
|
|
407
|
+
},
|
|
408
|
+
decode(input, length) {
|
|
409
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
410
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
411
|
+
const message = createBaseHeyHannahSample();
|
|
412
|
+
while (reader.pos < end) {
|
|
413
|
+
const tag = reader.uint32();
|
|
414
|
+
switch (tag >>> 3) {
|
|
415
|
+
}
|
|
416
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
417
|
+
break;
|
|
418
|
+
}
|
|
419
|
+
reader.skip(tag & 7);
|
|
420
|
+
}
|
|
421
|
+
return message;
|
|
422
|
+
},
|
|
423
|
+
create(base) {
|
|
424
|
+
return exports.HeyHannahSample.fromPartial(base ?? {});
|
|
425
|
+
},
|
|
426
|
+
fromPartial(_) {
|
|
427
|
+
const message = createBaseHeyHannahSample();
|
|
428
|
+
return message;
|
|
429
|
+
},
|
|
430
|
+
};
|
|
431
|
+
function createBaseCollectorMessage() {
|
|
432
|
+
return { ack: undefined };
|
|
433
|
+
}
|
|
434
|
+
exports.CollectorMessage = {
|
|
435
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
436
|
+
if (message.ack !== undefined) {
|
|
437
|
+
exports.CollectorAck.encode(message.ack, writer.uint32(10).fork()).join();
|
|
438
|
+
}
|
|
439
|
+
return writer;
|
|
440
|
+
},
|
|
441
|
+
decode(input, length) {
|
|
442
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
443
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
444
|
+
const message = createBaseCollectorMessage();
|
|
445
|
+
while (reader.pos < end) {
|
|
446
|
+
const tag = reader.uint32();
|
|
447
|
+
switch (tag >>> 3) {
|
|
448
|
+
case 1: {
|
|
449
|
+
if (tag !== 10) {
|
|
450
|
+
break;
|
|
451
|
+
}
|
|
452
|
+
message.ack = exports.CollectorAck.decode(reader, reader.uint32());
|
|
453
|
+
continue;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
457
|
+
break;
|
|
458
|
+
}
|
|
459
|
+
reader.skip(tag & 7);
|
|
460
|
+
}
|
|
461
|
+
return message;
|
|
462
|
+
},
|
|
463
|
+
create(base) {
|
|
464
|
+
return exports.CollectorMessage.fromPartial(base ?? {});
|
|
465
|
+
},
|
|
466
|
+
fromPartial(object) {
|
|
467
|
+
const message = createBaseCollectorMessage();
|
|
468
|
+
message.ack = (object.ack !== undefined && object.ack !== null) ? exports.CollectorAck.fromPartial(object.ack) : undefined;
|
|
469
|
+
return message;
|
|
470
|
+
},
|
|
471
|
+
};
|
|
472
|
+
function createBaseCollectorAck() {
|
|
473
|
+
return { message: "" };
|
|
474
|
+
}
|
|
475
|
+
exports.CollectorAck = {
|
|
476
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
477
|
+
if (message.message !== "") {
|
|
478
|
+
writer.uint32(10).string(message.message);
|
|
479
|
+
}
|
|
480
|
+
return writer;
|
|
481
|
+
},
|
|
482
|
+
decode(input, length) {
|
|
483
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
484
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
485
|
+
const message = createBaseCollectorAck();
|
|
486
|
+
while (reader.pos < end) {
|
|
487
|
+
const tag = reader.uint32();
|
|
488
|
+
switch (tag >>> 3) {
|
|
489
|
+
case 1: {
|
|
490
|
+
if (tag !== 10) {
|
|
491
|
+
break;
|
|
492
|
+
}
|
|
493
|
+
message.message = reader.string();
|
|
494
|
+
continue;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
498
|
+
break;
|
|
499
|
+
}
|
|
500
|
+
reader.skip(tag & 7);
|
|
501
|
+
}
|
|
502
|
+
return message;
|
|
503
|
+
},
|
|
504
|
+
create(base) {
|
|
505
|
+
return exports.CollectorAck.fromPartial(base ?? {});
|
|
506
|
+
},
|
|
507
|
+
fromPartial(object) {
|
|
508
|
+
const message = createBaseCollectorAck();
|
|
509
|
+
message.message = object.message ?? "";
|
|
510
|
+
return message;
|
|
511
|
+
},
|
|
512
|
+
};
|
package/package.json
CHANGED