starpc 0.52.0 → 0.52.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.
Files changed (65) hide show
  1. package/dist/echo/client-test.d.ts +1 -1
  2. package/dist/echo/client-test.js +110 -2
  3. package/dist/integration/cross-language/tcp-packet-stream.d.ts +3 -0
  4. package/dist/integration/cross-language/tcp-packet-stream.js +112 -0
  5. package/dist/integration/cross-language/tcp-packet-stream.test.d.ts +1 -0
  6. package/dist/integration/cross-language/tcp-packet-stream.test.js +121 -0
  7. package/dist/integration/cross-language/ts-client.js +50 -37
  8. package/dist/integration/cross-language/ts-server.js +1 -36
  9. package/dist/rpcstream/rpcstream.d.ts +5 -1
  10. package/dist/rpcstream/rpcstream.js +75 -28
  11. package/dist/rpcstream/rpcstream.test.d.ts +1 -0
  12. package/dist/rpcstream/rpcstream.test.js +92 -0
  13. package/dist/srpc/client.js +18 -4
  14. package/dist/srpc/common-rpc.test.js +2 -0
  15. package/dist/srpc/packet-codec.test.d.ts +1 -0
  16. package/dist/srpc/packet-codec.test.js +75 -0
  17. package/dist/srpc/packet.d.ts +1 -1
  18. package/dist/srpc/packet.js +11 -1
  19. package/dist/srpc/server.js +19 -6
  20. package/dist/srpc/server.test.js +43 -0
  21. package/dist/srpc/stream.d.ts +4 -1
  22. package/dist/srpc/stream.js +62 -3
  23. package/dist/srpc/stream.test.js +110 -1
  24. package/dist/srpc/termination.d.ts +27 -0
  25. package/dist/srpc/termination.js +56 -0
  26. package/dist/srpc/termination.test.d.ts +1 -0
  27. package/dist/srpc/termination.test.js +24 -0
  28. package/dist/testdata/packet-codec-vectors.json +64 -0
  29. package/echo/client-test.ts +124 -2
  30. package/echo/echo_pb2.py +40 -0
  31. package/echo/echo_pb2.pyi +13 -0
  32. package/echo/echo_srpc.py +306 -0
  33. package/echo/echo_srpc.pyi +85 -0
  34. package/go.mod +2 -2
  35. package/go.sum +14 -0
  36. package/integration/cross-language/go-client/main.go +79 -3
  37. package/integration/cross-language/python-client.py +146 -0
  38. package/integration/cross-language/python-server.py +140 -0
  39. package/integration/cross-language/run.bash +190 -65
  40. package/integration/cross-language/tcp-packet-stream.test.ts +154 -0
  41. package/integration/cross-language/tcp-packet-stream.ts +121 -0
  42. package/integration/cross-language/ts-client.ts +62 -40
  43. package/integration/cross-language/ts-server.ts +1 -45
  44. package/mock/mock_pb2.py +38 -0
  45. package/mock/mock_pb2.pyi +11 -0
  46. package/mock/mock_srpc.py +71 -0
  47. package/mock/mock_srpc.pyi +27 -0
  48. package/package.json +19 -5
  49. package/srpc/__init__.py +0 -0
  50. package/srpc/client.ts +20 -4
  51. package/srpc/codec.rs +6 -0
  52. package/srpc/common-rpc.test.ts +2 -0
  53. package/srpc/packet-codec-vectors_test.go +195 -0
  54. package/srpc/packet-codec.test.ts +139 -0
  55. package/srpc/packet-rw.go +9 -2
  56. package/srpc/packet.ts +15 -2
  57. package/srpc/py.typed +0 -0
  58. package/srpc/rpcproto_pb2.py +40 -0
  59. package/srpc/rpcproto_pb2.pyi +40 -0
  60. package/srpc/server.test.ts +50 -0
  61. package/srpc/server.ts +22 -6
  62. package/srpc/stream.test.ts +132 -1
  63. package/srpc/stream.ts +65 -9
  64. package/srpc/termination.test.ts +30 -0
  65. package/srpc/termination.ts +70 -0
@@ -1,5 +1,7 @@
1
- import { describe, expect, it } from 'vitest';
1
+ import { describe, expect, it, vi } from 'vitest';
2
2
  import { pipe } from 'it-pipe';
3
+ import { pushable } from 'it-pushable';
4
+ import { streamToPacketStream } from './stream.js';
3
5
  import { ChannelStream, combineUint8ArrayListTransform, StreamConn, } from '../srpc/index.js';
4
6
  describe('StreamConn packet stream', () => {
5
7
  it('keeps yamux peer writes open after local packet source completes normally', async () => {
@@ -48,6 +50,113 @@ describe('StreamConn packet stream', () => {
48
50
  await serverDone;
49
51
  expect(serverError).toBeUndefined();
50
52
  });
53
+ it('settles a blocked packet source when closed', async () => {
54
+ const { clientConn, cleanup } = connectStreamConns({
55
+ handlePacketStream() { },
56
+ });
57
+ try {
58
+ const stream = await clientConn.openStream();
59
+ const pending = stream.source.next();
60
+ await stream.close();
61
+ await expect(pending).resolves.toEqual({ done: true, value: undefined });
62
+ }
63
+ finally {
64
+ cleanup();
65
+ }
66
+ });
67
+ it('settles a blocked packet source when aborted', async () => {
68
+ const { clientConn, cleanup } = connectStreamConns({
69
+ handlePacketStream() { },
70
+ });
71
+ try {
72
+ const stream = await clientConn.openStream();
73
+ const pending = stream.source.next();
74
+ const error = new Error('stopped');
75
+ stream.abort(error);
76
+ await expect(pending).rejects.toBe(error);
77
+ }
78
+ finally {
79
+ cleanup();
80
+ }
81
+ });
82
+ it('settles a blocked packet sink when closed', async () => {
83
+ const { clientConn, cleanup } = connectStreamConns({
84
+ handlePacketStream() { },
85
+ });
86
+ try {
87
+ const stream = await clientConn.openStream();
88
+ const input = pushable({ objectMode: true });
89
+ const pending = stream.sink(input);
90
+ await stream.close();
91
+ await expect(pending).resolves.toBeUndefined();
92
+ }
93
+ finally {
94
+ cleanup();
95
+ }
96
+ });
97
+ it('settles a packet sink blocked in the underlying write', async () => {
98
+ const sinkStarted = Promise.withResolvers();
99
+ const transport = {
100
+ source: (async function* () { })(),
101
+ sink: async (source) => {
102
+ for await (const _chunk of source) {
103
+ sinkStarted.resolve();
104
+ await new Promise(() => { });
105
+ }
106
+ },
107
+ close: vi.fn(async () => { }),
108
+ closeRead: vi.fn(async () => { }),
109
+ closeWrite: vi.fn(async () => { }),
110
+ abort: vi.fn(),
111
+ };
112
+ const stream = streamToPacketStream(transport);
113
+ const input = pushable({ objectMode: true });
114
+ input.push(new Uint8Array([1]));
115
+ const pending = stream.sink(input);
116
+ await sinkStarted.promise;
117
+ await stream.close();
118
+ await expect(pending).resolves.toBeUndefined();
119
+ });
120
+ it('rejects a blocked packet sink with the abort error', async () => {
121
+ const { clientConn, cleanup } = connectStreamConns({
122
+ handlePacketStream() { },
123
+ });
124
+ try {
125
+ const stream = await clientConn.openStream();
126
+ const input = pushable({ objectMode: true });
127
+ const pending = stream.sink(input);
128
+ const error = new Error('stopped');
129
+ stream.abort(error);
130
+ await expect(pending).rejects.toBe(error);
131
+ }
132
+ finally {
133
+ cleanup();
134
+ }
135
+ });
136
+ it('does not write ready input after close', async () => {
137
+ const serverStream = Promise.withResolvers();
138
+ const { clientConn, cleanup } = connectStreamConns({
139
+ handlePacketStream(stream) {
140
+ serverStream.resolve(stream);
141
+ },
142
+ });
143
+ try {
144
+ const stream = await clientConn.openStream();
145
+ const peer = await serverStream.promise;
146
+ const input = pushable({ objectMode: true });
147
+ input.push(new Uint8Array([1]));
148
+ const pending = stream.sink(input);
149
+ await stream.close();
150
+ await expect(pending).resolves.toBeUndefined();
151
+ await expect(nextWithTimeout(peer.source, 'server eof')).resolves.toEqual({
152
+ done: true,
153
+ value: undefined,
154
+ });
155
+ }
156
+ finally {
157
+ cleanup();
158
+ }
159
+ });
51
160
  it('aborts the yamux stream when the packet source errors', async () => {
52
161
  const request = new TextEncoder().encode('request');
53
162
  const sourceError = new Error('source failed');
@@ -0,0 +1,27 @@
1
+ import type { Source } from 'it-stream-types';
2
+ type Terminated = {
3
+ terminated: true;
4
+ error?: Error;
5
+ };
6
+ type Received<T> = {
7
+ result: IteratorResult<T>;
8
+ } | {
9
+ error: unknown;
10
+ };
11
+ type WaitResult<T> = {
12
+ result: T;
13
+ } | {
14
+ error: unknown;
15
+ };
16
+ export declare class TerminationGate {
17
+ private readonly _waiters;
18
+ private _error;
19
+ private _terminated;
20
+ get terminated(): boolean;
21
+ terminate(error?: Error): boolean;
22
+ wait<T>(promise: Promise<T>): Promise<WaitResult<T> | Terminated>;
23
+ next<T>(iterator: AsyncIterator<T>): Promise<Received<T> | Terminated>;
24
+ }
25
+ export declare function sourceIterator<T>(source: Source<T>): AsyncIterator<T>;
26
+ export declare function closeIterator<T>(iterator: AsyncIterator<T>): void;
27
+ export {};
@@ -0,0 +1,56 @@
1
+ // TerminationGate makes the first clean close or abort visible to blocked I/O.
2
+ export class TerminationGate {
3
+ _waiters = new Set();
4
+ _error;
5
+ _terminated = false;
6
+ get terminated() {
7
+ return this._terminated;
8
+ }
9
+ terminate(error) {
10
+ if (this._terminated)
11
+ return false;
12
+ this._terminated = true;
13
+ this._error = error;
14
+ for (const waiter of this._waiters)
15
+ waiter(error);
16
+ this._waiters.clear();
17
+ return true;
18
+ }
19
+ async wait(promise) {
20
+ if (this._terminated)
21
+ return { terminated: true, error: this._error };
22
+ let notify;
23
+ const terminated = new Promise((resolve) => {
24
+ notify = (error) => resolve({ terminated: true, error });
25
+ this._waiters.add(notify);
26
+ });
27
+ const received = promise.then((result) => ({ result }), (error) => ({ error }));
28
+ try {
29
+ const result = await Promise.race([received, terminated]);
30
+ if (this._terminated) {
31
+ return { terminated: true, error: this._error };
32
+ }
33
+ return result;
34
+ }
35
+ finally {
36
+ this._waiters.delete(notify);
37
+ }
38
+ }
39
+ next(iterator) {
40
+ return this.wait(iterator.next());
41
+ }
42
+ }
43
+ export function sourceIterator(source) {
44
+ if (Symbol.asyncIterator in source)
45
+ return source[Symbol.asyncIterator]();
46
+ const iterator = source[Symbol.iterator]();
47
+ return { next: async () => iterator.next() };
48
+ }
49
+ // closeIterator asks an abandoned iterator to release its upstream resources.
50
+ // Async generators may wait for an active next call before running return;
51
+ // rejection is observed here so cleanup cannot create an unhandled promise.
52
+ export function closeIterator(iterator) {
53
+ if (!iterator.return)
54
+ return;
55
+ void Promise.resolve(iterator.return()).catch(() => undefined);
56
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,24 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { TerminationGate } from './termination.js';
3
+ describe('TerminationGate', () => {
4
+ it('prioritizes termination over an already-ready result', async () => {
5
+ const gate = new TerminationGate();
6
+ const iterator = (async function* () {
7
+ yield 1;
8
+ })();
9
+ const pending = gate.next(iterator);
10
+ const error = new Error('stopped');
11
+ gate.terminate(error);
12
+ await expect(pending).resolves.toEqual({ terminated: true, error });
13
+ });
14
+ it('keeps the first termination result', async () => {
15
+ const gate = new TerminationGate();
16
+ const error = new Error('stopped');
17
+ expect(gate.terminate(error)).toBe(true);
18
+ expect(gate.terminate()).toBe(false);
19
+ await expect(gate.wait(new Promise(() => { }))).resolves.toEqual({
20
+ terminated: true,
21
+ error,
22
+ });
23
+ });
24
+ });
@@ -0,0 +1,64 @@
1
+ {
2
+ "version": 1,
3
+ "max_message_size": 10000000,
4
+ "frame_prefix": "uint32 little-endian",
5
+ "cases": [
6
+ {
7
+ "name": "call_start_data",
8
+ "packet_hex": "0a120a0373766312066d6574686f641a03616263",
9
+ "frame_hex": "140000000a120a0373766312066d6574686f641a03616263"
10
+ },
11
+ {
12
+ "name": "call_start_absent_empty",
13
+ "packet_hex": "0a0d0a0373766312066d6574686f64",
14
+ "frame_hex": "0f0000000a0d0a0373766312066d6574686f64"
15
+ },
16
+ {
17
+ "name": "call_start_present_empty",
18
+ "packet_hex": "0a0f0a0373766312066d6574686f642001",
19
+ "frame_hex": "110000000a0f0a0373766312066d6574686f642001"
20
+ },
21
+ {
22
+ "name": "call_data_terminal",
23
+ "packet_hex": "12070a036f75741801",
24
+ "frame_hex": "0900000012070a036f75741801"
25
+ },
26
+ {
27
+ "name": "call_data_error",
28
+ "packet_hex": "120a180122066661696c6564",
29
+ "frame_hex": "0c000000120a180122066661696c6564"
30
+ },
31
+ {
32
+ "name": "call_cancel",
33
+ "packet_hex": "1801",
34
+ "frame_hex": "020000001801"
35
+ },
36
+ {
37
+ "name": "malformed_complete",
38
+ "frame_hex": "030000000a01ff",
39
+ "expect_error": "malformed_packet"
40
+ },
41
+ {
42
+ "name": "invalid_zero_length",
43
+ "frame_hex": "00000000",
44
+ "expect_error": "invalid_length"
45
+ },
46
+ {
47
+ "name": "invalid_oversized_prefix",
48
+ "frame_hex": "81969800",
49
+ "expect_error": "oversized_frame"
50
+ },
51
+ {
52
+ "name": "invalid_empty_packet",
53
+ "packet_hex": "",
54
+ "expect_error": "empty_packet"
55
+ },
56
+ { "name": "invalid_empty_service_id", "expect_error": "empty_service_id" },
57
+ { "name": "invalid_empty_method_id", "expect_error": "empty_method_id" },
58
+ {
59
+ "name": "truncated_body",
60
+ "frame_hex": "040000000a01",
61
+ "expect_error": "truncated_frame"
62
+ }
63
+ ]
64
+ }
@@ -2,7 +2,10 @@ import { Client, ERR_RPC_ABORT } from '../srpc/index.js'
2
2
  import { EchoMsg } from './echo.pb.js'
3
3
  import { EchoerClient } from './echo_srpc.pb.js'
4
4
  import { pushable } from 'it-pushable'
5
- import { buildRpcStreamOpenStream } from '../rpcstream/rpcstream.js'
5
+ import {
6
+ buildRpcStreamOpenStream,
7
+ openRpcStream,
8
+ } from '../rpcstream/rpcstream.js'
6
9
  import { Message } from '@aptre/protobuf-es-lite'
7
10
 
8
11
  export async function runClientTest(client: Client) {
@@ -89,8 +92,19 @@ export async function runAbortControllerTest(client: Client) {
89
92
  })
90
93
  }
91
94
 
95
+ function requireError(
96
+ error: unknown,
97
+ label: string,
98
+ fragments: string[],
99
+ ): void {
100
+ const message = error instanceof Error ? error.message : String(error)
101
+ if (!fragments.some((fragment) => message.includes(fragment))) {
102
+ throw new Error(`${label} returned unexpected error: ${message}`)
103
+ }
104
+ }
105
+
92
106
  // runRpcStreamTest tests a RPCStream.
93
- export async function runRpcStreamTest(client: Client) {
107
+ export async function runRpcStreamTest(client: Client, release = false) {
94
108
  console.log('Calling RpcStream to open a RPC stream client...')
95
109
  const service = new EchoerClient(client)
96
110
  const openStreamFn = buildRpcStreamOpenStream(
@@ -106,4 +120,112 @@ export async function runRpcStreamTest(client: Client) {
106
120
 
107
121
  console.log('Running client test over RPC stream...')
108
122
  await runClientTest(proxiedClient)
123
+
124
+ if (release) {
125
+ let unknownRejected = false
126
+ try {
127
+ await openRpcStream('missing', service.RpcStream.bind(service), true)
128
+ } catch (error) {
129
+ unknownRejected = true
130
+ requireError(error, 'unknown component', ['unknown component: missing'])
131
+ }
132
+ if (!unknownRejected) {
133
+ throw new Error('unknown component unexpectedly succeeded')
134
+ }
135
+ }
136
+
137
+ let methodRejected = false
138
+ try {
139
+ await proxiedClient.request('missing.Service', 'Missing', new Uint8Array())
140
+ } catch (error) {
141
+ methodRejected = true
142
+ requireError(error, 'unknown nested method', [
143
+ 'missing.Service',
144
+ 'unimplemented',
145
+ ])
146
+ }
147
+ if (!methodRejected) {
148
+ throw new Error('unknown nested method unexpectedly succeeded')
149
+ }
150
+
151
+ if (release) {
152
+ const terminalService = new EchoerClient(proxiedClient)
153
+ let terminalFailed = false
154
+ try {
155
+ await terminalService.Echo({ body: '__nested_error__' })
156
+ } catch (error) {
157
+ terminalFailed = true
158
+ requireError(error, 'terminal nested error', ['nested terminal error'])
159
+ }
160
+ if (!terminalFailed) {
161
+ throw new Error('terminal nested error unexpectedly succeeded')
162
+ }
163
+ }
164
+
165
+ if (release) {
166
+ const releaseClient = new Client(
167
+ buildRpcStreamOpenStream('release', service.RpcStream.bind(service)),
168
+ )
169
+ let releaseFailed = false
170
+ const releaseService = new EchoerClient(releaseClient)
171
+ try {
172
+ await releaseService.Echo({ body: '__nested_release__' })
173
+ } catch (error) {
174
+ releaseFailed = true
175
+ requireError(error, 'release during active call', [
176
+ 'closed before completion',
177
+ 'stream closed',
178
+ 'abort',
179
+ 'cancel',
180
+ ])
181
+ }
182
+ if (!releaseFailed) {
183
+ throw new Error('release during active call unexpectedly succeeded')
184
+ }
185
+ const releaseStatus = await service.Echo({
186
+ body: '__nested_release_status__',
187
+ })
188
+ if (releaseStatus.body !== 'released') {
189
+ throw new Error(`release completion returned ${releaseStatus.body}`)
190
+ }
191
+ let releasedRejected = false
192
+ try {
193
+ await releaseService.Echo({})
194
+ } catch (error) {
195
+ releasedRejected = true
196
+ requireError(error, 'released component', ['unknown component: release'])
197
+ }
198
+ if (!releasedRejected) {
199
+ throw new Error('released component unexpectedly remained available')
200
+ }
201
+ }
202
+
203
+ const cancelled = new AbortController()
204
+ const cancelledStream = proxiedClient.bidirectionalStreamingRequest(
205
+ 'echo.Echoer',
206
+ 'EchoBidiStream',
207
+ (async function* () {
208
+ yield new Uint8Array()
209
+ await new Promise(() => undefined)
210
+ })(),
211
+ cancelled.signal,
212
+ )
213
+ const cancelledIterator = cancelledStream[Symbol.asyncIterator]()
214
+ const firstNestedResponse = await cancelledIterator.next()
215
+ if (firstNestedResponse.done) {
216
+ throw new Error('nested cancellation call ended before its first response')
217
+ }
218
+ cancelled.abort()
219
+ let cancelRejected = false
220
+ try {
221
+ while (!(await cancelledIterator.next()).done) {
222
+ // Drain until the abort reaches the nested call.
223
+ }
224
+ } catch (error) {
225
+ cancelRejected = true
226
+ requireError(error, 'nested cancellation', [ERR_RPC_ABORT])
227
+ }
228
+ if (!cancelRejected) {
229
+ throw new Error('nested cancellation unexpectedly completed normally')
230
+ }
109
231
  }
@@ -0,0 +1,40 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # NO CHECKED-IN PROTOBUF GENCODE
4
+ # source: github.com/aperturerobotics/starpc/echo/echo.proto
5
+ # Protobuf Python Version: 6.33.4
6
+ """Generated protocol buffer code."""
7
+ from google.protobuf import descriptor as _descriptor
8
+ from google.protobuf import descriptor_pool as _descriptor_pool
9
+ from google.protobuf import runtime_version as _runtime_version
10
+ from google.protobuf import symbol_database as _symbol_database
11
+ from google.protobuf.internal import builder as _builder
12
+ _runtime_version.ValidateProtobufRuntimeVersion(
13
+ _runtime_version.Domain.PUBLIC,
14
+ 6,
15
+ 33,
16
+ 4,
17
+ '',
18
+ 'github.com/aperturerobotics/starpc/echo/echo.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+ from rpcstream import rpcstream_pb2 as github_dot_com_dot_aperturerobotics_dot_starpc_dot_rpcstream_dot_rpcstream__pb2
26
+ from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
27
+
28
+
29
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n2github.com/aperturerobotics/starpc/echo/echo.proto\x12\x04\x65\x63ho\x1a<github.com/aperturerobotics/starpc/rpcstream/rpcstream.proto\x1a\x1bgoogle/protobuf/empty.proto\"\x17\n\x07\x45\x63hoMsg\x12\x0c\n\x04\x62ody\x18\x01 \x01(\t2\xd0\x02\n\x06\x45\x63hoer\x12$\n\x04\x45\x63ho\x12\r.echo.EchoMsg\x1a\r.echo.EchoMsg\x12\x32\n\x10\x45\x63hoServerStream\x12\r.echo.EchoMsg\x1a\r.echo.EchoMsg0\x01\x12\x32\n\x10\x45\x63hoClientStream\x12\r.echo.EchoMsg\x1a\r.echo.EchoMsg(\x01\x12\x32\n\x0e\x45\x63hoBidiStream\x12\r.echo.EchoMsg\x1a\r.echo.EchoMsg(\x01\x30\x01\x12G\n\tRpcStream\x12\x1a.rpcstream.RpcStreamPacket\x1a\x1a.rpcstream.RpcStreamPacket(\x01\x30\x01\x12;\n\tDoNothing\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Emptyb\x06proto3')
30
+
31
+ _globals = globals()
32
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
33
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'github.com.aperturerobotics.starpc.echo.echo_pb2', _globals)
34
+ if not _descriptor._USE_C_DESCRIPTORS:
35
+ DESCRIPTOR._loaded_options = None
36
+ _globals['_ECHOMSG']._serialized_start=151
37
+ _globals['_ECHOMSG']._serialized_end=174
38
+ _globals['_ECHOER']._serialized_start=177
39
+ _globals['_ECHOER']._serialized_end=513
40
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,13 @@
1
+ from rpcstream import rpcstream_pb2 as _rpcstream_pb2
2
+ from google.protobuf import empty_pb2 as _empty_pb2
3
+ from google.protobuf import descriptor as _descriptor
4
+ from google.protobuf import message as _message
5
+ from typing import ClassVar as _ClassVar, Optional as _Optional
6
+
7
+ DESCRIPTOR: _descriptor.FileDescriptor
8
+
9
+ class EchoMsg(_message.Message):
10
+ __slots__ = ("body",)
11
+ BODY_FIELD_NUMBER: _ClassVar[int]
12
+ body: str
13
+ def __init__(self, body: _Optional[str] = ...) -> None: ...