@pulsefield/protocol 0.0.1 → 0.0.3
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/LICENSE +201 -0
- package/PROTOCOL_GUIDELINES.md +123 -0
- package/Package.swift +34 -0
- package/README.md +128 -0
- package/buf.gen.yaml +13 -0
- package/buf.yaml +9 -0
- package/docs/session-scope.md +27 -0
- package/gen/python/pulsefield/protocol/py.typed +1 -0
- package/gen/python/pulsefield/protocol/v1/core_pb2.py +34 -0
- package/gen/python/pulsefield/protocol/v1/core_pb2.pyi +76 -0
- package/gen/python/pulsefield/protocol/v1/envelope_pb2.py +29 -0
- package/gen/python/pulsefield/protocol/v1/envelope_pb2.pyi +46 -0
- package/gen/python/pulsefield/protocol/v1/inference_pb2.py +48 -0
- package/gen/python/pulsefield/protocol/v1/inference_pb2.pyi +160 -0
- package/gen/python/pulsefield/protocol/v1/mapper_pb2.py +28 -0
- package/gen/python/pulsefield/protocol/v1/mapper_pb2.pyi +23 -0
- package/gen/swift/pulsefield/protocol/v1/core.pb.swift +323 -0
- package/gen/swift/pulsefield/protocol/v1/envelope.pb.swift +471 -0
- package/gen/swift/pulsefield/protocol/v1/inference.pb.swift +929 -0
- package/gen/swift/pulsefield/protocol/v1/mapper.pb.swift +143 -0
- package/package.json +59 -7
- package/proto/pulsefield/protocol/v1/core.proto +57 -0
- package/proto/pulsefield/protocol/v1/envelope.proto +49 -0
- package/proto/pulsefield/protocol/v1/inference.proto +145 -0
- package/proto/pulsefield/protocol/v1/mapper.proto +17 -0
- package/pyproject.toml +38 -0
- package/tools/check-generated.mjs +222 -0
- package/tools/check-python-package.mjs +63 -0
- package/tools/ensure-python-typed.mjs +10 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# source: pulsefield/protocol/v1/envelope.proto
|
|
4
|
+
# Protobuf Python Version: 5.26.1
|
|
5
|
+
"""Generated protocol buffer code."""
|
|
6
|
+
from google.protobuf import descriptor as _descriptor
|
|
7
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
8
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
9
|
+
from google.protobuf.internal import builder as _builder
|
|
10
|
+
# @@protoc_insertion_point(imports)
|
|
11
|
+
|
|
12
|
+
_sym_db = _symbol_database.Default()
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from pulsefield.protocol.v1 import core_pb2 as pulsefield_dot_protocol_dot_v1_dot_core__pb2
|
|
16
|
+
from pulsefield.protocol.v1 import inference_pb2 as pulsefield_dot_protocol_dot_v1_dot_inference__pb2
|
|
17
|
+
from pulsefield.protocol.v1 import mapper_pb2 as pulsefield_dot_protocol_dot_v1_dot_mapper__pb2
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n%pulsefield/protocol/v1/envelope.proto\x12\x16pulsefield.protocol.v1\x1a!pulsefield/protocol/v1/core.proto\x1a&pulsefield/protocol/v1/inference.proto\x1a#pulsefield/protocol/v1/mapper.proto\"\xf7\x07\n\x08\x45nvelope\x12\x1d\n\nsession_id\x18\x01 \x01(\tR\tsessionId\x12\x1a\n\x08sequence\x18\x02 \x01(\x04R\x08sequence\x12%\n\x0fsent_at_unix_ms\x18\x03 \x01(\x03R\x0csentAtUnixMs\x12$\n\x0esource_node_id\x18\x04 \x01(\tR\x0csourceNodeId\x12$\n\x0etarget_node_id\x18\x05 \x01(\tR\x0ctargetNodeId\x12\x1d\n\nmessage_id\x18\x06 \x01(\tR\tmessageId\x12%\n\x0e\x63orrelation_id\x18\x07 \x01(\tR\rcorrelationId\x12\x42\n\nnode_hello\x18\x08 \x01(\x0b\x32!.pulsefield.protocol.v1.NodeHelloH\x00R\tnodeHello\x12<\n\x05ready\x18\n \x01(\x0b\x32$.pulsefield.protocol.v1.ReadyRequestH\x00R\x05ready\x12<\n\x05\x61udio\x18\x0b \x01(\x0b\x32$.pulsefield.protocol.v1.AudioRequestH\x00R\x05\x61udio\x12U\n\x0ereference_time\x18\x0c \x01(\x0b\x32,.pulsefield.protocol.v1.ReferenceTimeRequestH\x00R\rreferenceTime\x12O\n\x0cstop_session\x18\r \x01(\x0b\x32*.pulsefield.protocol.v1.StopSessionRequestH\x00R\x0bstopSession\x12`\n\x13mapper_stream_begin\x18\x13 \x01(\x0b\x32..pulsefield.protocol.v1.MapperStreamBeginEventH\x00R\x11mapperStreamBegin\x12W\n\x10hit_object_token\x18\x14 \x01(\x0b\x32+.pulsefield.protocol.v1.HitObjectTokenEventH\x00R\x0ehitObjectToken\x12:\n\x05\x65rror\x18\x15 \x01(\x0b\x32\".pulsefield.protocol.v1.ErrorEventH\x00R\x05\x65rror\x12=\n\x06status\x18\x16 \x01(\x0b\x32#.pulsefield.protocol.v1.StatusEventH\x00R\x06status\x12N\n\rend_of_stream\x18\x17 \x01(\x0b\x32(.pulsefield.protocol.v1.EndOfStreamEventH\x00R\x0b\x65ndOfStreamB\t\n\x07payloadb\x06proto3')
|
|
21
|
+
|
|
22
|
+
_globals = globals()
|
|
23
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
24
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'pulsefield.protocol.v1.envelope_pb2', _globals)
|
|
25
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
26
|
+
DESCRIPTOR._loaded_options = None
|
|
27
|
+
_globals['_ENVELOPE']._serialized_start=178
|
|
28
|
+
_globals['_ENVELOPE']._serialized_end=1193
|
|
29
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
from pulsefield.protocol.v1 import core_pb2 as _core_pb2
|
|
2
|
+
from pulsefield.protocol.v1 import inference_pb2 as _inference_pb2
|
|
3
|
+
from pulsefield.protocol.v1 import mapper_pb2 as _mapper_pb2
|
|
4
|
+
from google.protobuf import descriptor as _descriptor
|
|
5
|
+
from google.protobuf import message as _message
|
|
6
|
+
from typing import ClassVar as _ClassVar, Mapping as _Mapping, Optional as _Optional, Union as _Union
|
|
7
|
+
|
|
8
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
9
|
+
|
|
10
|
+
class Envelope(_message.Message):
|
|
11
|
+
__slots__ = ("session_id", "sequence", "sent_at_unix_ms", "source_node_id", "target_node_id", "message_id", "correlation_id", "node_hello", "ready", "audio", "reference_time", "stop_session", "mapper_stream_begin", "hit_object_token", "error", "status", "end_of_stream")
|
|
12
|
+
SESSION_ID_FIELD_NUMBER: _ClassVar[int]
|
|
13
|
+
SEQUENCE_FIELD_NUMBER: _ClassVar[int]
|
|
14
|
+
SENT_AT_UNIX_MS_FIELD_NUMBER: _ClassVar[int]
|
|
15
|
+
SOURCE_NODE_ID_FIELD_NUMBER: _ClassVar[int]
|
|
16
|
+
TARGET_NODE_ID_FIELD_NUMBER: _ClassVar[int]
|
|
17
|
+
MESSAGE_ID_FIELD_NUMBER: _ClassVar[int]
|
|
18
|
+
CORRELATION_ID_FIELD_NUMBER: _ClassVar[int]
|
|
19
|
+
NODE_HELLO_FIELD_NUMBER: _ClassVar[int]
|
|
20
|
+
READY_FIELD_NUMBER: _ClassVar[int]
|
|
21
|
+
AUDIO_FIELD_NUMBER: _ClassVar[int]
|
|
22
|
+
REFERENCE_TIME_FIELD_NUMBER: _ClassVar[int]
|
|
23
|
+
STOP_SESSION_FIELD_NUMBER: _ClassVar[int]
|
|
24
|
+
MAPPER_STREAM_BEGIN_FIELD_NUMBER: _ClassVar[int]
|
|
25
|
+
HIT_OBJECT_TOKEN_FIELD_NUMBER: _ClassVar[int]
|
|
26
|
+
ERROR_FIELD_NUMBER: _ClassVar[int]
|
|
27
|
+
STATUS_FIELD_NUMBER: _ClassVar[int]
|
|
28
|
+
END_OF_STREAM_FIELD_NUMBER: _ClassVar[int]
|
|
29
|
+
session_id: str
|
|
30
|
+
sequence: int
|
|
31
|
+
sent_at_unix_ms: int
|
|
32
|
+
source_node_id: str
|
|
33
|
+
target_node_id: str
|
|
34
|
+
message_id: str
|
|
35
|
+
correlation_id: str
|
|
36
|
+
node_hello: _core_pb2.NodeHello
|
|
37
|
+
ready: _inference_pb2.ReadyRequest
|
|
38
|
+
audio: _inference_pb2.AudioRequest
|
|
39
|
+
reference_time: _inference_pb2.ReferenceTimeRequest
|
|
40
|
+
stop_session: _inference_pb2.StopSessionRequest
|
|
41
|
+
mapper_stream_begin: _mapper_pb2.MapperStreamBeginEvent
|
|
42
|
+
hit_object_token: _mapper_pb2.HitObjectTokenEvent
|
|
43
|
+
error: _inference_pb2.ErrorEvent
|
|
44
|
+
status: _inference_pb2.StatusEvent
|
|
45
|
+
end_of_stream: _inference_pb2.EndOfStreamEvent
|
|
46
|
+
def __init__(self, session_id: _Optional[str] = ..., sequence: _Optional[int] = ..., sent_at_unix_ms: _Optional[int] = ..., source_node_id: _Optional[str] = ..., target_node_id: _Optional[str] = ..., message_id: _Optional[str] = ..., correlation_id: _Optional[str] = ..., node_hello: _Optional[_Union[_core_pb2.NodeHello, _Mapping]] = ..., ready: _Optional[_Union[_inference_pb2.ReadyRequest, _Mapping]] = ..., audio: _Optional[_Union[_inference_pb2.AudioRequest, _Mapping]] = ..., reference_time: _Optional[_Union[_inference_pb2.ReferenceTimeRequest, _Mapping]] = ..., stop_session: _Optional[_Union[_inference_pb2.StopSessionRequest, _Mapping]] = ..., mapper_stream_begin: _Optional[_Union[_mapper_pb2.MapperStreamBeginEvent, _Mapping]] = ..., hit_object_token: _Optional[_Union[_mapper_pb2.HitObjectTokenEvent, _Mapping]] = ..., error: _Optional[_Union[_inference_pb2.ErrorEvent, _Mapping]] = ..., status: _Optional[_Union[_inference_pb2.StatusEvent, _Mapping]] = ..., end_of_stream: _Optional[_Union[_inference_pb2.EndOfStreamEvent, _Mapping]] = ...) -> None: ...
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# source: pulsefield/protocol/v1/inference.proto
|
|
4
|
+
# Protobuf Python Version: 5.26.1
|
|
5
|
+
"""Generated protocol buffer code."""
|
|
6
|
+
from google.protobuf import descriptor as _descriptor
|
|
7
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
8
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
9
|
+
from google.protobuf.internal import builder as _builder
|
|
10
|
+
# @@protoc_insertion_point(imports)
|
|
11
|
+
|
|
12
|
+
_sym_db = _symbol_database.Default()
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n&pulsefield/protocol/v1/inference.proto\x12\x16pulsefield.protocol.v1\"\x0e\n\x0cReadyRequest\"\xdc\x01\n\rAudioAssetRef\x12\x1f\n\nlocal_path\x18\x01 \x01(\tH\x00R\tlocalPath\x12\x12\n\x03uri\x18\x02 \x01(\tH\x00R\x03uri\x12\x1b\n\x08\x61sset_id\x18\x03 \x01(\tH\x00R\x07\x61ssetId\x12+\n\x0f\x61udio_length_ms\x18\n \x01(\rH\x01R\raudioLengthMs\x88\x01\x01\x12\"\n\nsha256_hex\x18\x0b \x01(\tH\x02R\tsha256Hex\x88\x01\x01\x42\x05\n\x03refB\x12\n\x10_audio_length_msB\r\n\x0b_sha256_hex\"\x82\x02\n\x0c\x41udioRequest\x12;\n\x05\x61udio\x18\x01 \x01(\x0b\x32%.pulsefield.protocol.v1.AudioAssetRefR\x05\x61udio\x12\x43\n\x0bsync_source\x18\x02 \x01(\x0e\x32\".pulsefield.protocol.v1.SyncSourceR\nsyncSource\x12#\n\ndifficulty\x18\x03 \x01(\x01H\x00R\ndifficulty\x88\x01\x01\x12<\n\x05route\x18\x04 \x01(\x0e\x32&.pulsefield.protocol.v1.InferenceRouteR\x05routeB\r\n\x0b_difficulty\"\xad\x01\n\x14ReferenceTimeRequest\x12\x1e\n\x0bref_time_ms\x18\x01 \x01(\rR\trefTimeMs\x12\x34\n\x17local_host_time_send_ms\x18\x02 \x01(\x04R\x13localHostTimeSendMs\x12+\n\x0f\x61udio_length_ms\x18\x03 \x01(\rH\x00R\raudioLengthMs\x88\x01\x01\x42\x12\n\x10_audio_length_ms\",\n\x12StopSessionRequest\x12\x16\n\x06reason\x18\x01 \x01(\tR\x06reason\"\xf8\x01\n\nErrorEvent\x12\x12\n\x04\x63ode\x18\x01 \x01(\tR\x04\x63ode\x12\x18\n\x07message\x18\x02 \x01(\tR\x07message\x12I\n\nerror_code\x18\x03 \x01(\x0e\x32*.pulsefield.protocol.v1.InferenceErrorCodeR\terrorCode\x12\x14\n\x05phase\x18\x04 \x01(\tR\x05phase\x12<\n\x05route\x18\x05 \x01(\x0e\x32&.pulsefield.protocol.v1.InferenceRouteR\x05route\x12\x1d\n\nerror_kind\x18\x06 \x01(\tR\terrorKind\"\xdb\x04\n\x0bStatusEvent\x12>\n\x06status\x18\x01 \x01(\x0e\x32&.pulsefield.protocol.v1.EndpointStatusR\x06status\x12\x18\n\x07message\x18\x02 \x01(\tR\x07message\x12#\n\x0bref_time_ms\x18\x03 \x01(\rH\x00R\trefTimeMs\x88\x01\x01\x12\x33\n\x13sender_monotonic_ms\x18\x04 \x01(\x04H\x01R\x11senderMonotonicMs\x88\x01\x01\x12G\n\x0b\x66rom_status\x18\x05 \x01(\x0e\x32&.pulsefield.protocol.v1.EndpointStatusR\nfromStatus\x12\x16\n\x06reason\x18\x06 \x01(\tR\x06reason\x12+\n\x0f\x61udio_length_ms\x18\x07 \x01(\rH\x02R\raudioLengthMs\x88\x01\x01\x12>\n\x19reset_sender_monotonic_ms\x18\x08 \x01(\x04H\x03R\x16resetSenderMonotonicMs\x88\x01\x01\x12<\n\x05route\x18\t \x01(\x0e\x32&.pulsefield.protocol.v1.InferenceRouteR\x05route\x12#\n\ndifficulty\x18\n \x01(\x01H\x04R\ndifficulty\x88\x01\x01\x42\x0e\n\x0c_ref_time_msB\x16\n\x14_sender_monotonic_msB\x12\n\x10_audio_length_msB\x1c\n\x1a_reset_sender_monotonic_msB\r\n\x0b_difficulty\"\x83\x01\n\x10\x45ndOfStreamEvent\x12+\n\x0f\x61udio_length_ms\x18\x01 \x01(\rH\x00R\raudioLengthMs\x88\x01\x01\x12.\n\x13\x63omplete_through_ms\x18\x02 \x01(\rR\x11\x63ompleteThroughMsB\x12\n\x10_audio_length_ms*c\n\nSyncSource\x12\x1b\n\x17SYNC_SOURCE_UNSPECIFIED\x10\x00\x12\x1a\n\x16SYNC_SOURCE_BACKGROUND\x10\x01\x12\x1c\n\x18SYNC_SOURCE_SYSTEM_AUDIO\x10\x02*n\n\x0eInferenceRoute\x12\x1f\n\x1bINFERENCE_ROUTE_UNSPECIFIED\x10\x00\x12\x1a\n\x16INFERENCE_ROUTE_MAPPER\x10\x01\x12\x1f\n\x1bINFERENCE_ROUTE_TIMING_MOCK\x10\x02*\xa4\x02\n\x0e\x45ndpointStatus\x12\x1f\n\x1b\x45NDPOINT_STATUS_UNSPECIFIED\x10\x00\x12\x19\n\x15\x45NDPOINT_STATUS_READY\x10\x01\x12#\n\x1f\x45NDPOINT_STATUS_AUDIO_PREPARING\x10\x02\x12\x1f\n\x1b\x45NDPOINT_STATUS_AUDIO_READY\x10\x03\x12\x1d\n\x19\x45NDPOINT_STATUS_STREAMING\x10\x04\x12\x1b\n\x17\x45NDPOINT_STATUS_STOPPED\x10\x05\x12\x1a\n\x16\x45NDPOINT_STATUS_FAILED\x10\x06\x12\x18\n\x14\x45NDPOINT_STATUS_COLD\x10\x07\x12\x1e\n\x1a\x45NDPOINT_STATUS_NO_SESSION\x10\x08*\x9b\x03\n\x12InferenceErrorCode\x12$\n INFERENCE_ERROR_CODE_UNSPECIFIED\x10\x00\x12\'\n#INFERENCE_ERROR_CODE_PROTOCOL_ERROR\x10\x01\x12\'\n#INFERENCE_ERROR_CODE_INVALID_DEVICE\x10\x02\x12(\n$INFERENCE_ERROR_CODE_AUDIO_NOT_FOUND\x10\x03\x12)\n%INFERENCE_ERROR_CODE_INFERENCE_FAILED\x10\x04\x12*\n&INFERENCE_ERROR_CODE_SESSION_NOT_FOUND\x10\x05\x12\x33\n/INFERENCE_ERROR_CODE_SESSION_OWNERSHIP_CONFLICT\x10\x06\x12+\n\'INFERENCE_ERROR_CODE_AUDIO_NOT_PREPARED\x10\x07\x12*\n&INFERENCE_ERROR_CODE_UNSUPPORTED_ROUTE\x10\x08\x62\x06proto3')
|
|
18
|
+
|
|
19
|
+
_globals = globals()
|
|
20
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
21
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'pulsefield.protocol.v1.inference_pb2', _globals)
|
|
22
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
23
|
+
DESCRIPTOR._loaded_options = None
|
|
24
|
+
_globals['_SYNCSOURCE']._serialized_start=1779
|
|
25
|
+
_globals['_SYNCSOURCE']._serialized_end=1878
|
|
26
|
+
_globals['_INFERENCEROUTE']._serialized_start=1880
|
|
27
|
+
_globals['_INFERENCEROUTE']._serialized_end=1990
|
|
28
|
+
_globals['_ENDPOINTSTATUS']._serialized_start=1993
|
|
29
|
+
_globals['_ENDPOINTSTATUS']._serialized_end=2285
|
|
30
|
+
_globals['_INFERENCEERRORCODE']._serialized_start=2288
|
|
31
|
+
_globals['_INFERENCEERRORCODE']._serialized_end=2699
|
|
32
|
+
_globals['_READYREQUEST']._serialized_start=66
|
|
33
|
+
_globals['_READYREQUEST']._serialized_end=80
|
|
34
|
+
_globals['_AUDIOASSETREF']._serialized_start=83
|
|
35
|
+
_globals['_AUDIOASSETREF']._serialized_end=303
|
|
36
|
+
_globals['_AUDIOREQUEST']._serialized_start=306
|
|
37
|
+
_globals['_AUDIOREQUEST']._serialized_end=564
|
|
38
|
+
_globals['_REFERENCETIMEREQUEST']._serialized_start=567
|
|
39
|
+
_globals['_REFERENCETIMEREQUEST']._serialized_end=740
|
|
40
|
+
_globals['_STOPSESSIONREQUEST']._serialized_start=742
|
|
41
|
+
_globals['_STOPSESSIONREQUEST']._serialized_end=786
|
|
42
|
+
_globals['_ERROREVENT']._serialized_start=789
|
|
43
|
+
_globals['_ERROREVENT']._serialized_end=1037
|
|
44
|
+
_globals['_STATUSEVENT']._serialized_start=1040
|
|
45
|
+
_globals['_STATUSEVENT']._serialized_end=1643
|
|
46
|
+
_globals['_ENDOFSTREAMEVENT']._serialized_start=1646
|
|
47
|
+
_globals['_ENDOFSTREAMEVENT']._serialized_end=1777
|
|
48
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
|
|
2
|
+
from google.protobuf import descriptor as _descriptor
|
|
3
|
+
from google.protobuf import message as _message
|
|
4
|
+
from typing import ClassVar as _ClassVar, Mapping as _Mapping, Optional as _Optional, Union as _Union
|
|
5
|
+
|
|
6
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
7
|
+
|
|
8
|
+
class SyncSource(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
9
|
+
__slots__ = ()
|
|
10
|
+
SYNC_SOURCE_UNSPECIFIED: _ClassVar[SyncSource]
|
|
11
|
+
SYNC_SOURCE_BACKGROUND: _ClassVar[SyncSource]
|
|
12
|
+
SYNC_SOURCE_SYSTEM_AUDIO: _ClassVar[SyncSource]
|
|
13
|
+
|
|
14
|
+
class InferenceRoute(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
15
|
+
__slots__ = ()
|
|
16
|
+
INFERENCE_ROUTE_UNSPECIFIED: _ClassVar[InferenceRoute]
|
|
17
|
+
INFERENCE_ROUTE_MAPPER: _ClassVar[InferenceRoute]
|
|
18
|
+
INFERENCE_ROUTE_TIMING_MOCK: _ClassVar[InferenceRoute]
|
|
19
|
+
|
|
20
|
+
class EndpointStatus(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
21
|
+
__slots__ = ()
|
|
22
|
+
ENDPOINT_STATUS_UNSPECIFIED: _ClassVar[EndpointStatus]
|
|
23
|
+
ENDPOINT_STATUS_READY: _ClassVar[EndpointStatus]
|
|
24
|
+
ENDPOINT_STATUS_AUDIO_PREPARING: _ClassVar[EndpointStatus]
|
|
25
|
+
ENDPOINT_STATUS_AUDIO_READY: _ClassVar[EndpointStatus]
|
|
26
|
+
ENDPOINT_STATUS_STREAMING: _ClassVar[EndpointStatus]
|
|
27
|
+
ENDPOINT_STATUS_STOPPED: _ClassVar[EndpointStatus]
|
|
28
|
+
ENDPOINT_STATUS_FAILED: _ClassVar[EndpointStatus]
|
|
29
|
+
ENDPOINT_STATUS_COLD: _ClassVar[EndpointStatus]
|
|
30
|
+
ENDPOINT_STATUS_NO_SESSION: _ClassVar[EndpointStatus]
|
|
31
|
+
|
|
32
|
+
class InferenceErrorCode(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
33
|
+
__slots__ = ()
|
|
34
|
+
INFERENCE_ERROR_CODE_UNSPECIFIED: _ClassVar[InferenceErrorCode]
|
|
35
|
+
INFERENCE_ERROR_CODE_PROTOCOL_ERROR: _ClassVar[InferenceErrorCode]
|
|
36
|
+
INFERENCE_ERROR_CODE_INVALID_DEVICE: _ClassVar[InferenceErrorCode]
|
|
37
|
+
INFERENCE_ERROR_CODE_AUDIO_NOT_FOUND: _ClassVar[InferenceErrorCode]
|
|
38
|
+
INFERENCE_ERROR_CODE_INFERENCE_FAILED: _ClassVar[InferenceErrorCode]
|
|
39
|
+
INFERENCE_ERROR_CODE_SESSION_NOT_FOUND: _ClassVar[InferenceErrorCode]
|
|
40
|
+
INFERENCE_ERROR_CODE_SESSION_OWNERSHIP_CONFLICT: _ClassVar[InferenceErrorCode]
|
|
41
|
+
INFERENCE_ERROR_CODE_AUDIO_NOT_PREPARED: _ClassVar[InferenceErrorCode]
|
|
42
|
+
INFERENCE_ERROR_CODE_UNSUPPORTED_ROUTE: _ClassVar[InferenceErrorCode]
|
|
43
|
+
SYNC_SOURCE_UNSPECIFIED: SyncSource
|
|
44
|
+
SYNC_SOURCE_BACKGROUND: SyncSource
|
|
45
|
+
SYNC_SOURCE_SYSTEM_AUDIO: SyncSource
|
|
46
|
+
INFERENCE_ROUTE_UNSPECIFIED: InferenceRoute
|
|
47
|
+
INFERENCE_ROUTE_MAPPER: InferenceRoute
|
|
48
|
+
INFERENCE_ROUTE_TIMING_MOCK: InferenceRoute
|
|
49
|
+
ENDPOINT_STATUS_UNSPECIFIED: EndpointStatus
|
|
50
|
+
ENDPOINT_STATUS_READY: EndpointStatus
|
|
51
|
+
ENDPOINT_STATUS_AUDIO_PREPARING: EndpointStatus
|
|
52
|
+
ENDPOINT_STATUS_AUDIO_READY: EndpointStatus
|
|
53
|
+
ENDPOINT_STATUS_STREAMING: EndpointStatus
|
|
54
|
+
ENDPOINT_STATUS_STOPPED: EndpointStatus
|
|
55
|
+
ENDPOINT_STATUS_FAILED: EndpointStatus
|
|
56
|
+
ENDPOINT_STATUS_COLD: EndpointStatus
|
|
57
|
+
ENDPOINT_STATUS_NO_SESSION: EndpointStatus
|
|
58
|
+
INFERENCE_ERROR_CODE_UNSPECIFIED: InferenceErrorCode
|
|
59
|
+
INFERENCE_ERROR_CODE_PROTOCOL_ERROR: InferenceErrorCode
|
|
60
|
+
INFERENCE_ERROR_CODE_INVALID_DEVICE: InferenceErrorCode
|
|
61
|
+
INFERENCE_ERROR_CODE_AUDIO_NOT_FOUND: InferenceErrorCode
|
|
62
|
+
INFERENCE_ERROR_CODE_INFERENCE_FAILED: InferenceErrorCode
|
|
63
|
+
INFERENCE_ERROR_CODE_SESSION_NOT_FOUND: InferenceErrorCode
|
|
64
|
+
INFERENCE_ERROR_CODE_SESSION_OWNERSHIP_CONFLICT: InferenceErrorCode
|
|
65
|
+
INFERENCE_ERROR_CODE_AUDIO_NOT_PREPARED: InferenceErrorCode
|
|
66
|
+
INFERENCE_ERROR_CODE_UNSUPPORTED_ROUTE: InferenceErrorCode
|
|
67
|
+
|
|
68
|
+
class ReadyRequest(_message.Message):
|
|
69
|
+
__slots__ = ()
|
|
70
|
+
def __init__(self) -> None: ...
|
|
71
|
+
|
|
72
|
+
class AudioAssetRef(_message.Message):
|
|
73
|
+
__slots__ = ("local_path", "uri", "asset_id", "audio_length_ms", "sha256_hex")
|
|
74
|
+
LOCAL_PATH_FIELD_NUMBER: _ClassVar[int]
|
|
75
|
+
URI_FIELD_NUMBER: _ClassVar[int]
|
|
76
|
+
ASSET_ID_FIELD_NUMBER: _ClassVar[int]
|
|
77
|
+
AUDIO_LENGTH_MS_FIELD_NUMBER: _ClassVar[int]
|
|
78
|
+
SHA256_HEX_FIELD_NUMBER: _ClassVar[int]
|
|
79
|
+
local_path: str
|
|
80
|
+
uri: str
|
|
81
|
+
asset_id: str
|
|
82
|
+
audio_length_ms: int
|
|
83
|
+
sha256_hex: str
|
|
84
|
+
def __init__(self, local_path: _Optional[str] = ..., uri: _Optional[str] = ..., asset_id: _Optional[str] = ..., audio_length_ms: _Optional[int] = ..., sha256_hex: _Optional[str] = ...) -> None: ...
|
|
85
|
+
|
|
86
|
+
class AudioRequest(_message.Message):
|
|
87
|
+
__slots__ = ("audio", "sync_source", "difficulty", "route")
|
|
88
|
+
AUDIO_FIELD_NUMBER: _ClassVar[int]
|
|
89
|
+
SYNC_SOURCE_FIELD_NUMBER: _ClassVar[int]
|
|
90
|
+
DIFFICULTY_FIELD_NUMBER: _ClassVar[int]
|
|
91
|
+
ROUTE_FIELD_NUMBER: _ClassVar[int]
|
|
92
|
+
audio: AudioAssetRef
|
|
93
|
+
sync_source: SyncSource
|
|
94
|
+
difficulty: float
|
|
95
|
+
route: InferenceRoute
|
|
96
|
+
def __init__(self, audio: _Optional[_Union[AudioAssetRef, _Mapping]] = ..., sync_source: _Optional[_Union[SyncSource, str]] = ..., difficulty: _Optional[float] = ..., route: _Optional[_Union[InferenceRoute, str]] = ...) -> None: ...
|
|
97
|
+
|
|
98
|
+
class ReferenceTimeRequest(_message.Message):
|
|
99
|
+
__slots__ = ("ref_time_ms", "local_host_time_send_ms", "audio_length_ms")
|
|
100
|
+
REF_TIME_MS_FIELD_NUMBER: _ClassVar[int]
|
|
101
|
+
LOCAL_HOST_TIME_SEND_MS_FIELD_NUMBER: _ClassVar[int]
|
|
102
|
+
AUDIO_LENGTH_MS_FIELD_NUMBER: _ClassVar[int]
|
|
103
|
+
ref_time_ms: int
|
|
104
|
+
local_host_time_send_ms: int
|
|
105
|
+
audio_length_ms: int
|
|
106
|
+
def __init__(self, ref_time_ms: _Optional[int] = ..., local_host_time_send_ms: _Optional[int] = ..., audio_length_ms: _Optional[int] = ...) -> None: ...
|
|
107
|
+
|
|
108
|
+
class StopSessionRequest(_message.Message):
|
|
109
|
+
__slots__ = ("reason",)
|
|
110
|
+
REASON_FIELD_NUMBER: _ClassVar[int]
|
|
111
|
+
reason: str
|
|
112
|
+
def __init__(self, reason: _Optional[str] = ...) -> None: ...
|
|
113
|
+
|
|
114
|
+
class ErrorEvent(_message.Message):
|
|
115
|
+
__slots__ = ("code", "message", "error_code", "phase", "route", "error_kind")
|
|
116
|
+
CODE_FIELD_NUMBER: _ClassVar[int]
|
|
117
|
+
MESSAGE_FIELD_NUMBER: _ClassVar[int]
|
|
118
|
+
ERROR_CODE_FIELD_NUMBER: _ClassVar[int]
|
|
119
|
+
PHASE_FIELD_NUMBER: _ClassVar[int]
|
|
120
|
+
ROUTE_FIELD_NUMBER: _ClassVar[int]
|
|
121
|
+
ERROR_KIND_FIELD_NUMBER: _ClassVar[int]
|
|
122
|
+
code: str
|
|
123
|
+
message: str
|
|
124
|
+
error_code: InferenceErrorCode
|
|
125
|
+
phase: str
|
|
126
|
+
route: InferenceRoute
|
|
127
|
+
error_kind: str
|
|
128
|
+
def __init__(self, code: _Optional[str] = ..., message: _Optional[str] = ..., error_code: _Optional[_Union[InferenceErrorCode, str]] = ..., phase: _Optional[str] = ..., route: _Optional[_Union[InferenceRoute, str]] = ..., error_kind: _Optional[str] = ...) -> None: ...
|
|
129
|
+
|
|
130
|
+
class StatusEvent(_message.Message):
|
|
131
|
+
__slots__ = ("status", "message", "ref_time_ms", "sender_monotonic_ms", "from_status", "reason", "audio_length_ms", "reset_sender_monotonic_ms", "route", "difficulty")
|
|
132
|
+
STATUS_FIELD_NUMBER: _ClassVar[int]
|
|
133
|
+
MESSAGE_FIELD_NUMBER: _ClassVar[int]
|
|
134
|
+
REF_TIME_MS_FIELD_NUMBER: _ClassVar[int]
|
|
135
|
+
SENDER_MONOTONIC_MS_FIELD_NUMBER: _ClassVar[int]
|
|
136
|
+
FROM_STATUS_FIELD_NUMBER: _ClassVar[int]
|
|
137
|
+
REASON_FIELD_NUMBER: _ClassVar[int]
|
|
138
|
+
AUDIO_LENGTH_MS_FIELD_NUMBER: _ClassVar[int]
|
|
139
|
+
RESET_SENDER_MONOTONIC_MS_FIELD_NUMBER: _ClassVar[int]
|
|
140
|
+
ROUTE_FIELD_NUMBER: _ClassVar[int]
|
|
141
|
+
DIFFICULTY_FIELD_NUMBER: _ClassVar[int]
|
|
142
|
+
status: EndpointStatus
|
|
143
|
+
message: str
|
|
144
|
+
ref_time_ms: int
|
|
145
|
+
sender_monotonic_ms: int
|
|
146
|
+
from_status: EndpointStatus
|
|
147
|
+
reason: str
|
|
148
|
+
audio_length_ms: int
|
|
149
|
+
reset_sender_monotonic_ms: int
|
|
150
|
+
route: InferenceRoute
|
|
151
|
+
difficulty: float
|
|
152
|
+
def __init__(self, status: _Optional[_Union[EndpointStatus, str]] = ..., message: _Optional[str] = ..., ref_time_ms: _Optional[int] = ..., sender_monotonic_ms: _Optional[int] = ..., from_status: _Optional[_Union[EndpointStatus, str]] = ..., reason: _Optional[str] = ..., audio_length_ms: _Optional[int] = ..., reset_sender_monotonic_ms: _Optional[int] = ..., route: _Optional[_Union[InferenceRoute, str]] = ..., difficulty: _Optional[float] = ...) -> None: ...
|
|
153
|
+
|
|
154
|
+
class EndOfStreamEvent(_message.Message):
|
|
155
|
+
__slots__ = ("audio_length_ms", "complete_through_ms")
|
|
156
|
+
AUDIO_LENGTH_MS_FIELD_NUMBER: _ClassVar[int]
|
|
157
|
+
COMPLETE_THROUGH_MS_FIELD_NUMBER: _ClassVar[int]
|
|
158
|
+
audio_length_ms: int
|
|
159
|
+
complete_through_ms: int
|
|
160
|
+
def __init__(self, audio_length_ms: _Optional[int] = ..., complete_through_ms: _Optional[int] = ...) -> None: ...
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# source: pulsefield/protocol/v1/mapper.proto
|
|
4
|
+
# Protobuf Python Version: 5.26.1
|
|
5
|
+
"""Generated protocol buffer code."""
|
|
6
|
+
from google.protobuf import descriptor as _descriptor
|
|
7
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
8
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
9
|
+
from google.protobuf.internal import builder as _builder
|
|
10
|
+
# @@protoc_insertion_point(imports)
|
|
11
|
+
|
|
12
|
+
_sym_db = _symbol_database.Default()
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#pulsefield/protocol/v1/mapper.proto\x12\x16pulsefield.protocol.v1\"\x9c\x01\n\x16MapperStreamBeginEvent\x12\x34\n\x16token_contract_version\x18\x02 \x01(\rR\x14tokenContractVersion\x12+\n\x0f\x61udio_length_ms\x18\x03 \x01(\rH\x00R\raudioLengthMs\x88\x01\x01\x42\x12\n\x10_audio_length_msJ\x04\x08\x01\x10\x02R\x05route\"x\n\x13HitObjectTokenEvent\x12\x19\n\x08token_id\x18\x01 \x01(\rR\x07tokenId\x12%\n\x0fms_in_ref_audio\x18\x02 \x01(\rR\x0cmsInRefAudio\x12\x1f\n\x0btoken_index\x18\x03 \x01(\rR\ntokenIndexb\x06proto3')
|
|
18
|
+
|
|
19
|
+
_globals = globals()
|
|
20
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
21
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'pulsefield.protocol.v1.mapper_pb2', _globals)
|
|
22
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
23
|
+
DESCRIPTOR._loaded_options = None
|
|
24
|
+
_globals['_MAPPERSTREAMBEGINEVENT']._serialized_start=64
|
|
25
|
+
_globals['_MAPPERSTREAMBEGINEVENT']._serialized_end=220
|
|
26
|
+
_globals['_HITOBJECTTOKENEVENT']._serialized_start=222
|
|
27
|
+
_globals['_HITOBJECTTOKENEVENT']._serialized_end=342
|
|
28
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from google.protobuf import descriptor as _descriptor
|
|
2
|
+
from google.protobuf import message as _message
|
|
3
|
+
from typing import ClassVar as _ClassVar, Optional as _Optional
|
|
4
|
+
|
|
5
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
|
6
|
+
|
|
7
|
+
class MapperStreamBeginEvent(_message.Message):
|
|
8
|
+
__slots__ = ("token_contract_version", "audio_length_ms")
|
|
9
|
+
TOKEN_CONTRACT_VERSION_FIELD_NUMBER: _ClassVar[int]
|
|
10
|
+
AUDIO_LENGTH_MS_FIELD_NUMBER: _ClassVar[int]
|
|
11
|
+
token_contract_version: int
|
|
12
|
+
audio_length_ms: int
|
|
13
|
+
def __init__(self, token_contract_version: _Optional[int] = ..., audio_length_ms: _Optional[int] = ...) -> None: ...
|
|
14
|
+
|
|
15
|
+
class HitObjectTokenEvent(_message.Message):
|
|
16
|
+
__slots__ = ("token_id", "ms_in_ref_audio", "token_index")
|
|
17
|
+
TOKEN_ID_FIELD_NUMBER: _ClassVar[int]
|
|
18
|
+
MS_IN_REF_AUDIO_FIELD_NUMBER: _ClassVar[int]
|
|
19
|
+
TOKEN_INDEX_FIELD_NUMBER: _ClassVar[int]
|
|
20
|
+
token_id: int
|
|
21
|
+
ms_in_ref_audio: int
|
|
22
|
+
token_index: int
|
|
23
|
+
def __init__(self, token_id: _Optional[int] = ..., ms_in_ref_audio: _Optional[int] = ..., token_index: _Optional[int] = ...) -> None: ...
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
// DO NOT EDIT.
|
|
2
|
+
// swift-format-ignore-file
|
|
3
|
+
// swiftlint:disable all
|
|
4
|
+
//
|
|
5
|
+
// Generated by the Swift generator plugin for the protocol buffer compiler.
|
|
6
|
+
// Source: pulsefield/protocol/v1/core.proto
|
|
7
|
+
//
|
|
8
|
+
// For information on using the generated types, please see the documentation:
|
|
9
|
+
// https://github.com/apple/swift-protobuf/
|
|
10
|
+
|
|
11
|
+
import SwiftProtobuf
|
|
12
|
+
|
|
13
|
+
// If the compiler emits an error on this type, it is because this file
|
|
14
|
+
// was generated by a version of the `protoc` Swift plug-in that is
|
|
15
|
+
// incompatible with the version of SwiftProtobuf to which you are linking.
|
|
16
|
+
// Please ensure that you are building against the same version of the API
|
|
17
|
+
// that was used to generate this file.
|
|
18
|
+
fileprivate nonisolated struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
|
|
19
|
+
struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
|
|
20
|
+
typealias Version = _2
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public nonisolated enum Pulsefield_Protocol_V1_NodeRole: SwiftProtobuf.Enum, Swift.CaseIterable {
|
|
24
|
+
public typealias RawValue = Int
|
|
25
|
+
case unspecified // = 0
|
|
26
|
+
case host // = 1
|
|
27
|
+
case playerClient // = 2
|
|
28
|
+
case modelService // = 3
|
|
29
|
+
case hardware // = 4
|
|
30
|
+
case debugTool // = 5
|
|
31
|
+
case UNRECOGNIZED(Int)
|
|
32
|
+
|
|
33
|
+
public init() {
|
|
34
|
+
self = .unspecified
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public init?(rawValue: Int) {
|
|
38
|
+
switch rawValue {
|
|
39
|
+
case 0: self = .unspecified
|
|
40
|
+
case 1: self = .host
|
|
41
|
+
case 2: self = .playerClient
|
|
42
|
+
case 3: self = .modelService
|
|
43
|
+
case 4: self = .hardware
|
|
44
|
+
case 5: self = .debugTool
|
|
45
|
+
default: self = .UNRECOGNIZED(rawValue)
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public var rawValue: Int {
|
|
50
|
+
switch self {
|
|
51
|
+
case .unspecified: return 0
|
|
52
|
+
case .host: return 1
|
|
53
|
+
case .playerClient: return 2
|
|
54
|
+
case .modelService: return 3
|
|
55
|
+
case .hardware: return 4
|
|
56
|
+
case .debugTool: return 5
|
|
57
|
+
case .UNRECOGNIZED(let i): return i
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// The compiler won't synthesize support with the UNRECOGNIZED case.
|
|
62
|
+
public static let allCases: [Pulsefield_Protocol_V1_NodeRole] = [
|
|
63
|
+
.unspecified,
|
|
64
|
+
.host,
|
|
65
|
+
.playerClient,
|
|
66
|
+
.modelService,
|
|
67
|
+
.hardware,
|
|
68
|
+
.debugTool,
|
|
69
|
+
]
|
|
70
|
+
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
public nonisolated enum Pulsefield_Protocol_V1_NodeCapabilityKind: SwiftProtobuf.Enum, Swift.CaseIterable {
|
|
74
|
+
public typealias RawValue = Int
|
|
75
|
+
case unspecified // = 0
|
|
76
|
+
case recognition // = 1
|
|
77
|
+
case timing // = 2
|
|
78
|
+
case mapper // = 3
|
|
79
|
+
case playerStream // = 4
|
|
80
|
+
case hardware // = 5
|
|
81
|
+
case debug // = 6
|
|
82
|
+
case UNRECOGNIZED(Int)
|
|
83
|
+
|
|
84
|
+
public init() {
|
|
85
|
+
self = .unspecified
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
public init?(rawValue: Int) {
|
|
89
|
+
switch rawValue {
|
|
90
|
+
case 0: self = .unspecified
|
|
91
|
+
case 1: self = .recognition
|
|
92
|
+
case 2: self = .timing
|
|
93
|
+
case 3: self = .mapper
|
|
94
|
+
case 4: self = .playerStream
|
|
95
|
+
case 5: self = .hardware
|
|
96
|
+
case 6: self = .debug
|
|
97
|
+
default: self = .UNRECOGNIZED(rawValue)
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
public var rawValue: Int {
|
|
102
|
+
switch self {
|
|
103
|
+
case .unspecified: return 0
|
|
104
|
+
case .recognition: return 1
|
|
105
|
+
case .timing: return 2
|
|
106
|
+
case .mapper: return 3
|
|
107
|
+
case .playerStream: return 4
|
|
108
|
+
case .hardware: return 5
|
|
109
|
+
case .debug: return 6
|
|
110
|
+
case .UNRECOGNIZED(let i): return i
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// The compiler won't synthesize support with the UNRECOGNIZED case.
|
|
115
|
+
public static let allCases: [Pulsefield_Protocol_V1_NodeCapabilityKind] = [
|
|
116
|
+
.unspecified,
|
|
117
|
+
.recognition,
|
|
118
|
+
.timing,
|
|
119
|
+
.mapper,
|
|
120
|
+
.playerStream,
|
|
121
|
+
.hardware,
|
|
122
|
+
.debug,
|
|
123
|
+
]
|
|
124
|
+
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
public nonisolated enum Pulsefield_Protocol_V1_NodeCapabilityDirection: SwiftProtobuf.Enum, Swift.CaseIterable {
|
|
128
|
+
public typealias RawValue = Int
|
|
129
|
+
case unspecified // = 0
|
|
130
|
+
case producer // = 1
|
|
131
|
+
case consumer // = 2
|
|
132
|
+
case bidirectional // = 3
|
|
133
|
+
case UNRECOGNIZED(Int)
|
|
134
|
+
|
|
135
|
+
public init() {
|
|
136
|
+
self = .unspecified
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
public init?(rawValue: Int) {
|
|
140
|
+
switch rawValue {
|
|
141
|
+
case 0: self = .unspecified
|
|
142
|
+
case 1: self = .producer
|
|
143
|
+
case 2: self = .consumer
|
|
144
|
+
case 3: self = .bidirectional
|
|
145
|
+
default: self = .UNRECOGNIZED(rawValue)
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
public var rawValue: Int {
|
|
150
|
+
switch self {
|
|
151
|
+
case .unspecified: return 0
|
|
152
|
+
case .producer: return 1
|
|
153
|
+
case .consumer: return 2
|
|
154
|
+
case .bidirectional: return 3
|
|
155
|
+
case .UNRECOGNIZED(let i): return i
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// The compiler won't synthesize support with the UNRECOGNIZED case.
|
|
160
|
+
public static let allCases: [Pulsefield_Protocol_V1_NodeCapabilityDirection] = [
|
|
161
|
+
.unspecified,
|
|
162
|
+
.producer,
|
|
163
|
+
.consumer,
|
|
164
|
+
.bidirectional,
|
|
165
|
+
]
|
|
166
|
+
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/// Capability advertised by a node before domain-specific traffic begins.
|
|
170
|
+
public nonisolated struct Pulsefield_Protocol_V1_NodeCapability: Sendable {
|
|
171
|
+
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
|
172
|
+
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
|
173
|
+
// methods supported on all messages.
|
|
174
|
+
|
|
175
|
+
public var kind: Pulsefield_Protocol_V1_NodeCapabilityKind = .unspecified
|
|
176
|
+
|
|
177
|
+
/// Stable capability identifier, such as "mapper.tuple_tokens" or "hardware.input".
|
|
178
|
+
public var name: String = String()
|
|
179
|
+
|
|
180
|
+
/// Capability-specific contract or implementation version.
|
|
181
|
+
public var version: String = String()
|
|
182
|
+
|
|
183
|
+
public var direction: Pulsefield_Protocol_V1_NodeCapabilityDirection = .unspecified
|
|
184
|
+
|
|
185
|
+
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
186
|
+
|
|
187
|
+
public init() {}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/// Initial topology announcement for apps, services, tools, and hardware bridges.
|
|
191
|
+
public nonisolated struct Pulsefield_Protocol_V1_NodeHello: Sendable {
|
|
192
|
+
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
|
193
|
+
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
|
194
|
+
// methods supported on all messages.
|
|
195
|
+
|
|
196
|
+
/// Stable node identifier within a Pulsefield graph or room.
|
|
197
|
+
public var nodeID: String = String()
|
|
198
|
+
|
|
199
|
+
public var role: Pulsefield_Protocol_V1_NodeRole = .unspecified
|
|
200
|
+
|
|
201
|
+
public var capabilities: [Pulsefield_Protocol_V1_NodeCapability] = []
|
|
202
|
+
|
|
203
|
+
/// Protocol package version spoken by this node, such as "0.0.3".
|
|
204
|
+
public var protocolVersion: String = String()
|
|
205
|
+
|
|
206
|
+
/// Stable application or service identifier, such as "pulsefield.host".
|
|
207
|
+
public var appID: String = String()
|
|
208
|
+
|
|
209
|
+
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
210
|
+
|
|
211
|
+
public init() {}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// MARK: - Code below here is support for the SwiftProtobuf runtime.
|
|
215
|
+
|
|
216
|
+
fileprivate nonisolated let _protobuf_package = "pulsefield.protocol.v1"
|
|
217
|
+
|
|
218
|
+
nonisolated extension Pulsefield_Protocol_V1_NodeRole: SwiftProtobuf._ProtoNameProviding {
|
|
219
|
+
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0NODE_ROLE_UNSPECIFIED\0\u{1}NODE_ROLE_HOST\0\u{1}NODE_ROLE_PLAYER_CLIENT\0\u{1}NODE_ROLE_MODEL_SERVICE\0\u{1}NODE_ROLE_HARDWARE\0\u{1}NODE_ROLE_DEBUG_TOOL\0")
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
nonisolated extension Pulsefield_Protocol_V1_NodeCapabilityKind: SwiftProtobuf._ProtoNameProviding {
|
|
223
|
+
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0NODE_CAPABILITY_KIND_UNSPECIFIED\0\u{1}NODE_CAPABILITY_KIND_RECOGNITION\0\u{1}NODE_CAPABILITY_KIND_TIMING\0\u{1}NODE_CAPABILITY_KIND_MAPPER\0\u{1}NODE_CAPABILITY_KIND_PLAYER_STREAM\0\u{1}NODE_CAPABILITY_KIND_HARDWARE\0\u{1}NODE_CAPABILITY_KIND_DEBUG\0")
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
nonisolated extension Pulsefield_Protocol_V1_NodeCapabilityDirection: SwiftProtobuf._ProtoNameProviding {
|
|
227
|
+
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0NODE_CAPABILITY_DIRECTION_UNSPECIFIED\0\u{1}NODE_CAPABILITY_DIRECTION_PRODUCER\0\u{1}NODE_CAPABILITY_DIRECTION_CONSUMER\0\u{1}NODE_CAPABILITY_DIRECTION_BIDIRECTIONAL\0")
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
nonisolated extension Pulsefield_Protocol_V1_NodeCapability: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
231
|
+
public static let protoMessageName: String = _protobuf_package + ".NodeCapability"
|
|
232
|
+
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}kind\0\u{1}name\0\u{1}version\0\u{1}direction\0")
|
|
233
|
+
|
|
234
|
+
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
|
235
|
+
while let fieldNumber = try decoder.nextFieldNumber() {
|
|
236
|
+
// The use of inline closures is to circumvent an issue where the compiler
|
|
237
|
+
// allocates stack space for every case branch when no optimizations are
|
|
238
|
+
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
|
239
|
+
switch fieldNumber {
|
|
240
|
+
case 1: try { try decoder.decodeSingularEnumField(value: &self.kind) }()
|
|
241
|
+
case 2: try { try decoder.decodeSingularStringField(value: &self.name) }()
|
|
242
|
+
case 3: try { try decoder.decodeSingularStringField(value: &self.version) }()
|
|
243
|
+
case 4: try { try decoder.decodeSingularEnumField(value: &self.direction) }()
|
|
244
|
+
default: break
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
250
|
+
if self.kind != .unspecified {
|
|
251
|
+
try visitor.visitSingularEnumField(value: self.kind, fieldNumber: 1)
|
|
252
|
+
}
|
|
253
|
+
if !self.name.isEmpty {
|
|
254
|
+
try visitor.visitSingularStringField(value: self.name, fieldNumber: 2)
|
|
255
|
+
}
|
|
256
|
+
if !self.version.isEmpty {
|
|
257
|
+
try visitor.visitSingularStringField(value: self.version, fieldNumber: 3)
|
|
258
|
+
}
|
|
259
|
+
if self.direction != .unspecified {
|
|
260
|
+
try visitor.visitSingularEnumField(value: self.direction, fieldNumber: 4)
|
|
261
|
+
}
|
|
262
|
+
try unknownFields.traverse(visitor: &visitor)
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
public static func ==(lhs: Pulsefield_Protocol_V1_NodeCapability, rhs: Pulsefield_Protocol_V1_NodeCapability) -> Bool {
|
|
266
|
+
if lhs.kind != rhs.kind {return false}
|
|
267
|
+
if lhs.name != rhs.name {return false}
|
|
268
|
+
if lhs.version != rhs.version {return false}
|
|
269
|
+
if lhs.direction != rhs.direction {return false}
|
|
270
|
+
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
271
|
+
return true
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
nonisolated extension Pulsefield_Protocol_V1_NodeHello: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
276
|
+
public static let protoMessageName: String = _protobuf_package + ".NodeHello"
|
|
277
|
+
public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}node_id\0\u{1}role\0\u{1}capabilities\0\u{3}protocol_version\0\u{3}app_id\0")
|
|
278
|
+
|
|
279
|
+
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
|
280
|
+
while let fieldNumber = try decoder.nextFieldNumber() {
|
|
281
|
+
// The use of inline closures is to circumvent an issue where the compiler
|
|
282
|
+
// allocates stack space for every case branch when no optimizations are
|
|
283
|
+
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
|
284
|
+
switch fieldNumber {
|
|
285
|
+
case 1: try { try decoder.decodeSingularStringField(value: &self.nodeID) }()
|
|
286
|
+
case 2: try { try decoder.decodeSingularEnumField(value: &self.role) }()
|
|
287
|
+
case 3: try { try decoder.decodeRepeatedMessageField(value: &self.capabilities) }()
|
|
288
|
+
case 4: try { try decoder.decodeSingularStringField(value: &self.protocolVersion) }()
|
|
289
|
+
case 5: try { try decoder.decodeSingularStringField(value: &self.appID) }()
|
|
290
|
+
default: break
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
296
|
+
if !self.nodeID.isEmpty {
|
|
297
|
+
try visitor.visitSingularStringField(value: self.nodeID, fieldNumber: 1)
|
|
298
|
+
}
|
|
299
|
+
if self.role != .unspecified {
|
|
300
|
+
try visitor.visitSingularEnumField(value: self.role, fieldNumber: 2)
|
|
301
|
+
}
|
|
302
|
+
if !self.capabilities.isEmpty {
|
|
303
|
+
try visitor.visitRepeatedMessageField(value: self.capabilities, fieldNumber: 3)
|
|
304
|
+
}
|
|
305
|
+
if !self.protocolVersion.isEmpty {
|
|
306
|
+
try visitor.visitSingularStringField(value: self.protocolVersion, fieldNumber: 4)
|
|
307
|
+
}
|
|
308
|
+
if !self.appID.isEmpty {
|
|
309
|
+
try visitor.visitSingularStringField(value: self.appID, fieldNumber: 5)
|
|
310
|
+
}
|
|
311
|
+
try unknownFields.traverse(visitor: &visitor)
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
public static func ==(lhs: Pulsefield_Protocol_V1_NodeHello, rhs: Pulsefield_Protocol_V1_NodeHello) -> Bool {
|
|
315
|
+
if lhs.nodeID != rhs.nodeID {return false}
|
|
316
|
+
if lhs.role != rhs.role {return false}
|
|
317
|
+
if lhs.capabilities != rhs.capabilities {return false}
|
|
318
|
+
if lhs.protocolVersion != rhs.protocolVersion {return false}
|
|
319
|
+
if lhs.appID != rhs.appID {return false}
|
|
320
|
+
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
321
|
+
return true
|
|
322
|
+
}
|
|
323
|
+
}
|