mesh-llm-plugin 0.75.0

Plugin protocol and runtime primitives for mesh-llm
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
syntax = "proto3";

package meshllm.plugin.v1;

message Envelope {
  uint32 protocol_version = 1;
  string plugin_id = 2;
  uint64 request_id = 3;

  oneof payload {
    InitializeRequest initialize_request = 10;
    InitializeResponse initialize_response = 11;
    HealthRequest health_request = 12;
    HealthResponse health_response = 13;
    ShutdownRequest shutdown_request = 14;
    ShutdownResponse shutdown_response = 15;
    MeshEvent mesh_event = 16;
    RpcRequest rpc_request = 17;
    RpcResponse rpc_response = 18;
    RpcNotification rpc_notification = 19;
    ErrorResponse error_response = 20;
    ChannelMessage channel_message = 21;
    BulkTransferMessage bulk_transfer_message = 22;
    OpenStreamRequest open_stream_request = 23;
    OpenStreamResponse open_stream_response = 24;
    CancelStreamNotification cancel_stream_notification = 25;
    CloseStreamNotification close_stream_notification = 26;
    StreamError stream_error = 27;
    InvokeServiceRequest invoke_service_request = 28;
    InvokeServiceResponse invoke_service_response = 29;
    OpenMeshStreamRequest open_mesh_stream_request = 30;
    OpenMeshStreamResponse open_mesh_stream_response = 31;
  }
}

message Empty {}

enum MeshVisibility {
  MESH_VISIBILITY_UNSPECIFIED = 0;
  PRIVATE = 1;
  PUBLIC = 2;
}

message InitializeRequest {
  uint32 host_protocol_version = 1;
  string host_version = 2;
  string host_info_json = 3;
  MeshVisibility mesh_visibility = 4;
}

message InitializeResponse {
  string plugin_id = 1;
  uint32 plugin_protocol_version = 2;
  string plugin_version = 3;
  string server_info_json = 4;
  repeated string capabilities = 5;
  PluginManifest manifest = 6;
}

message HealthRequest {}

message HealthResponse {
  enum Status {
    STATUS_UNSPECIFIED = 0;
    STATUS_OK = 1;
    STATUS_DEGRADED = 2;
    STATUS_UNHEALTHY = 3;
  }

  Status status = 1;
  string detail = 2;
}

message ShutdownRequest {
  string reason = 1;
}

message ShutdownResponse {}

message MeshPeer {
  string peer_id = 1;
  string version = 2;
  repeated string capabilities = 3;
  string role = 4;
  uint64 vram_bytes = 5;
  repeated string models = 6;
  repeated string serving_models = 7;
  repeated string available_models = 8;
  repeated string requested_models = 9;
  optional uint32 rtt_ms = 10;
  string model_source = 11;
  repeated string hosted_models = 12;
  optional bool hosted_models_known = 13;
}

message MeshEvent {
  enum Kind {
    KIND_UNSPECIFIED = 0;
    PEER_UP = 1;
    PEER_DOWN = 2;
    PEER_UPDATED = 3;
    LOCAL_ACCEPTING = 4;
    LOCAL_STANDBY = 5;
    MESH_ID_UPDATED = 6;
  }

  Kind kind = 1;
  MeshPeer peer = 2;
  string local_peer_id = 3;
  string mesh_id = 4;
  string detail_json = 5;
}

message RpcRequest {
  string method = 1;
  string params_json = 2;
}

message RpcResponse {
  string result_json = 1;
}

message RpcNotification {
  string method = 1;
  string params_json = 2;
}

message ChannelMessage {
  string channel = 1;
  string source_peer_id = 2;
  string target_peer_id = 3;
  string content_type = 4;
  bytes body = 5;
  string message_kind = 6;
  string correlation_id = 7;
  string metadata_json = 8;
}

message MeshChannelFrame {
  string plugin_id = 1;
  string message_id = 2;
  ChannelMessage message = 3;
}

message BulkTransferMessage {
  enum Kind {
    KIND_UNSPECIFIED = 0;
    OFFER = 1;
    ACCEPT = 2;
    REJECT = 3;
    CHUNK = 4;
    COMPLETE = 5;
    CANCEL = 6;
    ERROR = 7;
  }

  Kind kind = 1;
  string transfer_id = 2;
  string channel = 3;
  string source_peer_id = 4;
  string target_peer_id = 5;
  string content_type = 6;
  string correlation_id = 7;
  string metadata_json = 8;
  uint64 total_bytes = 9;
  uint64 offset = 10;
  bytes body = 11;
  bool final_chunk = 12;
}

message MeshBulkFrame {
  string plugin_id = 1;
  string message_id = 2;
  BulkTransferMessage message = 3;
}

message PluginManifest {
  repeated OperationManifest operations = 1;
  repeated ResourceManifest resources = 2;
  repeated ResourceTemplateManifest resource_templates = 3;
  repeated PromptManifest prompts = 4;
  repeated CompletionManifest completions = 5;
  repeated HttpBindingManifest http_bindings = 6;
  repeated EndpointManifest endpoints = 7;
  repeated string capabilities = 8;
  repeated MeshChannelManifest mesh_channels = 9;
  repeated MeshEventSubscriptionManifest mesh_event_subscriptions = 10;
  optional PluginConfigSchemaManifest config_schema = 11;
  optional PluginWebUiManifest web_ui = 12;
}

message PluginWebUiManifest {
  repeated PluginWebUiPageManifest pages = 1;
  repeated PluginWebUiConfigSectionManifest config_sections = 2;
  repeated PluginWebUiBundleManifest bundles = 3;
}

message PluginWebUiPageManifest {
  string id = 1;
  string label = 2;
  optional string icon = 3;
  string route = 4;
  string bundle_id = 5;
  string entry_script = 6;
}

message PluginWebUiConfigSectionManifest {
  string id = 1;
  string title = 2;
  string entry_script = 3;
  optional string parent_tab = 4;
  string bundle_id = 5;
}

message PluginWebUiBundleManifest {
  string id = 1;
  string root_path = 2;
}

message PluginConfigSchemaManifest {
  string plugin_name = 1;
  uint32 schema_version = 2;
  bool allow_unvalidated_config = 3;
  repeated PluginConfigSettingManifest settings = 4;
}

message PluginConfigSettingManifest {
  string key = 1;
  PluginConfigValueSchema value_schema = 2;
  bool required = 3;
  optional string default_json = 4;
  repeated PluginConfigConstraintManifest constraints = 5;
  PluginConfigApplyMode apply_mode = 6;
  PluginConfigRestartScope restart_scope = 7;
  PluginConfigVisibility visibility = 8;
  optional string description = 9;
  optional PluginConfigPresentationManifest presentation = 10;
  optional PluginConfigControlBehavior control_behavior = 11;
}

message PluginConfigControlBehavior {
  optional PluginConfigNumericControl numeric = 1;
  optional PluginConfigTextFormat text_format = 2;
  optional PluginConfigOptionsSource options_source = 3;
  optional PluginConfigControlAvailability availability = 4;
  repeated PluginConfigControlCondition enable_when = 5;
  repeated PluginConfigConditionalDisable disable_when = 6;
  repeated PluginConfigConflictRule conflicts = 7;
  optional PluginConfigDisabledWritePolicy write_policy = 8;
}

message PluginConfigNumericControl {
  optional double min = 1;
  optional double max = 2;
  optional double step = 3;
  optional double soft_min = 4;
  optional double soft_max = 5;
  optional string unit = 6;
}

enum PluginConfigTextFormat {
  PLUGIN_CONFIG_TEXT_FORMAT_UNSPECIFIED = 0;
  PLUGIN_CONFIG_TEXT_FORMAT_PLAIN = 1;
  PLUGIN_CONFIG_TEXT_FORMAT_PATH = 2;
  PLUGIN_CONFIG_TEXT_FORMAT_URL = 3;
  PLUGIN_CONFIG_TEXT_FORMAT_SOCKET_ADDR = 4;
  PLUGIN_CONFIG_TEXT_FORMAT_SEMVER = 5;
  PLUGIN_CONFIG_TEXT_FORMAT_ED25519_KEY = 6;
  PLUGIN_CONFIG_TEXT_FORMAT_CSV_POSITIVE_INTS = 7;
}

enum PluginConfigOptionsSource {
  PLUGIN_CONFIG_OPTIONS_SOURCE_UNSPECIFIED = 0;
  PLUGIN_CONFIG_OPTIONS_SOURCE_STATIC = 1;
  PLUGIN_CONFIG_OPTIONS_SOURCE_RUNTIME_GPUS = 2;
  PLUGIN_CONFIG_OPTIONS_SOURCE_RUNTIME_NATIVE_BACKENDS = 3;
  PLUGIN_CONFIG_OPTIONS_SOURCE_RUNTIME_LOCAL_MODELS = 4;
  PLUGIN_CONFIG_OPTIONS_SOURCE_RUNTIME_INSTALLED_PLUGINS = 5;
  PLUGIN_CONFIG_OPTIONS_SOURCE_RUNTIME_MESH_PEERS = 6;
}

message PluginConfigControlAvailability {
  bool enabled = 1;
  optional string reason = 2;
  optional string note = 3;
  PluginConfigControlAvailabilitySource source = 4;
}

enum PluginConfigControlAvailabilitySource {
  PLUGIN_CONFIG_CONTROL_AVAILABILITY_SOURCE_UNSPECIFIED = 0;
  PLUGIN_CONFIG_CONTROL_AVAILABILITY_SOURCE_STATIC = 1;
  PLUGIN_CONFIG_CONTROL_AVAILABILITY_SOURCE_RUNTIME = 2;
  PLUGIN_CONFIG_CONTROL_AVAILABILITY_SOURCE_DEPENDENCY = 3;
  PLUGIN_CONFIG_CONTROL_AVAILABILITY_SOURCE_CONFLICT = 4;
}

message PluginConfigControlCondition {
  string key = 1;
  PluginConfigConditionOperator operator = 2;
  repeated PluginConfigConditionValue values = 3;
}

enum PluginConfigConditionOperator {
  PLUGIN_CONFIG_CONDITION_OPERATOR_UNSPECIFIED = 0;
  PLUGIN_CONFIG_CONDITION_OPERATOR_EQUALS = 1;
  PLUGIN_CONFIG_CONDITION_OPERATOR_NOT_EQUALS = 2;
  PLUGIN_CONFIG_CONDITION_OPERATOR_IN = 3;
  PLUGIN_CONFIG_CONDITION_OPERATOR_NOT_IN = 4;
  PLUGIN_CONFIG_CONDITION_OPERATOR_PRESENT = 5;
  PLUGIN_CONFIG_CONDITION_OPERATOR_ABSENT = 6;
  PLUGIN_CONFIG_CONDITION_OPERATOR_TRUTHY = 7;
  PLUGIN_CONFIG_CONDITION_OPERATOR_FALSY = 8;
  PLUGIN_CONFIG_CONDITION_OPERATOR_RANGE = 9;
}

message PluginConfigConditionValue {
  oneof value {
    bool bool_value = 1;
    int64 integer_value = 2;
    double float_value = 3;
    string string_value = 4;
  }
}

message PluginConfigConditionalDisable {
  optional PluginConfigControlCondition condition = 1;
  string reason = 2;
  optional string note = 3;
  PluginConfigDisabledWritePolicy write_policy = 4;
}

message PluginConfigConflictRule {
  string group = 1;
  optional PluginConfigControlCondition condition = 2;
  string reason = 3;
  optional string preferred_key = 4;
}

enum PluginConfigDisabledWritePolicy {
  PLUGIN_CONFIG_DISABLED_WRITE_POLICY_UNSPECIFIED = 0;
  PLUGIN_CONFIG_DISABLED_WRITE_POLICY_PRESERVE_EXISTING = 1;
  PLUGIN_CONFIG_DISABLED_WRITE_POLICY_OMIT_WHEN_DISABLED = 2;
  PLUGIN_CONFIG_DISABLED_WRITE_POLICY_REJECT_WHEN_DISABLED = 3;
}

message PluginConfigPresentationManifest {
  optional string label = 1;
  optional string help = 2;
  optional string category_id = 3;
  optional string category_label = 4;
  optional string category_summary = 5;
  optional uint32 category_order = 6;
  optional uint32 setting_order = 7;
  optional string unit = 8;
  optional string placeholder = 9;
  optional string control_hint = 10;
  optional string renderer_id = 11;
}

message PluginConfigValueSchema {
  PluginConfigValueKind kind = 1;
  repeated string enum_values = 2;
  optional PluginConfigValueSchema items = 3;
  repeated PluginConfigObjectProperty object_properties = 4;
  bool allow_additional_properties = 5;
}

message PluginConfigObjectProperty {
  string key = 1;
  PluginConfigValueSchema value_schema = 2;
  bool required = 3;
  optional string description = 4;
}

enum PluginConfigValueKind {
  PLUGIN_CONFIG_VALUE_KIND_UNSPECIFIED = 0;
  PLUGIN_CONFIG_VALUE_KIND_BOOLEAN = 1;
  PLUGIN_CONFIG_VALUE_KIND_INTEGER = 2;
  PLUGIN_CONFIG_VALUE_KIND_FLOAT = 3;
  PLUGIN_CONFIG_VALUE_KIND_STRING = 4;
  PLUGIN_CONFIG_VALUE_KIND_PATH = 5;
  PLUGIN_CONFIG_VALUE_KIND_URL = 6;
  PLUGIN_CONFIG_VALUE_KIND_ENUM = 7;
  PLUGIN_CONFIG_VALUE_KIND_ARRAY = 8;
  PLUGIN_CONFIG_VALUE_KIND_OBJECT = 9;
}

enum PluginConfigApplyMode {
  PLUGIN_CONFIG_APPLY_MODE_UNSPECIFIED = 0;
  PLUGIN_CONFIG_APPLY_MODE_STATIC_ON_LOAD = 1;
  PLUGIN_CONFIG_APPLY_MODE_DYNAMIC_VALIDATION_ONLY = 2;
  PLUGIN_CONFIG_APPLY_MODE_DYNAMIC_APPLY = 3;
}

enum PluginConfigRestartScope {
  PLUGIN_CONFIG_RESTART_SCOPE_UNSPECIFIED = 0;
  PLUGIN_CONFIG_RESTART_SCOPE_NONE = 1;
  PLUGIN_CONFIG_RESTART_SCOPE_MODEL_RELOAD = 2;
  PLUGIN_CONFIG_RESTART_SCOPE_PROCESS_RESTART = 3;
  PLUGIN_CONFIG_RESTART_SCOPE_MESH_RESTART = 4;
  PLUGIN_CONFIG_RESTART_SCOPE_PLUGIN_PROCESS = 5;
}

enum PluginConfigVisibility {
  PLUGIN_CONFIG_VISIBILITY_UNSPECIFIED = 0;
  PLUGIN_CONFIG_VISIBILITY_USER = 1;
  PLUGIN_CONFIG_VISIBILITY_ADVANCED = 2;
  PLUGIN_CONFIG_VISIBILITY_HIDDEN = 3;
  PLUGIN_CONFIG_VISIBILITY_INTERNAL = 4;
}

message PluginConfigConstraintManifest {
  oneof constraint {
    PluginConfigNonEmptyConstraint non_empty = 1;
    PluginConfigPositiveConstraint positive = 2;
    PluginConfigRangeConstraint range = 3;
    PluginConfigAllowedValuesConstraint allowed_values = 4;
    PluginConfigRequiresConstraint requires = 5;
  }
}

message PluginConfigNonEmptyConstraint {}

message PluginConfigPositiveConstraint {}

message PluginConfigRangeConstraint {
  optional string min = 1;
  optional string max = 2;
}

message PluginConfigAllowedValuesConstraint {
  repeated string values = 1;
}

message PluginConfigRequiresConstraint {
  string key = 1;
}

message MeshChannelManifest {
  string name = 1;
}

message MeshEventSubscriptionManifest {
  MeshEvent.Kind kind = 1;
}

enum ServiceKind {
  SERVICE_KIND_UNSPECIFIED = 0;
  SERVICE_KIND_OPERATION = 1;
  SERVICE_KIND_PROMPT = 2;
  SERVICE_KIND_RESOURCE = 3;
  SERVICE_KIND_COMPLETION = 4;
}

message InvokeServiceRequest {
  ServiceKind kind = 1;
  string service_name = 2;
  string input_json = 3;
}

message InvokeServiceResponse {
  string output_json = 1;
  bool is_error = 2;
}

message OperationManifest {
  string name = 1;
  string description = 2;
  string input_schema_json = 3;
  optional string output_schema_json = 4;
  optional string title = 5;
}

message ResourceManifest {
  string uri = 1;
  string name = 2;
  optional string description = 3;
  optional string mime_type = 4;
}

message ResourceTemplateManifest {
  string uri_template = 1;
  string name = 2;
  optional string description = 3;
  optional string mime_type = 4;
}

message PromptManifest {
  string name = 1;
  optional string description = 2;
}

message CompletionManifest {
  string argument_ref = 1;
  optional string description = 2;
}

enum HttpMethod {
  HTTP_METHOD_UNSPECIFIED = 0;
  HTTP_METHOD_GET = 1;
  HTTP_METHOD_POST = 2;
  HTTP_METHOD_PUT = 3;
  HTTP_METHOD_PATCH = 4;
  HTTP_METHOD_DELETE = 5;
}

enum HttpBodyMode {
  HTTP_BODY_MODE_UNSPECIFIED = 0;
  HTTP_BODY_MODE_BUFFERED = 1;
  HTTP_BODY_MODE_STREAMED = 2;
}

message HttpBindingManifest {
  string binding_id = 1;
  HttpMethod method = 2;
  string path = 3;
  optional string operation_name = 4;
  HttpBodyMode request_body_mode = 5;
  HttpBodyMode response_body_mode = 6;
  optional string request_schema_json = 7;
  optional string response_schema_json = 8;
}

enum EndpointKind {
  ENDPOINT_KIND_UNSPECIFIED = 0;
  ENDPOINT_KIND_INFERENCE = 1;
  ENDPOINT_KIND_MCP = 2;
}

enum EndpointTransportKind {
  ENDPOINT_TRANSPORT_KIND_UNSPECIFIED = 0;
  ENDPOINT_TRANSPORT_HTTP = 1;
  ENDPOINT_TRANSPORT_UNIX_SOCKET = 2;
  ENDPOINT_TRANSPORT_STDIO = 3;
  ENDPOINT_TRANSPORT_NAMED_PIPE = 4;
  ENDPOINT_TRANSPORT_TCP = 5;
}

message EndpointManifest {
  string endpoint_id = 1;
  EndpointKind kind = 2;
  EndpointTransportKind transport_kind = 3;
  optional string protocol = 4;
  optional string address = 5;
  repeated string args = 6;
  optional string namespace = 7;
  bool supports_streaming = 8;
  bool managed_by_plugin = 9;
}

enum StreamPurpose {
  STREAM_PURPOSE_UNSPECIFIED = 0;
  STREAM_PURPOSE_GENERIC = 1;
  STREAM_PURPOSE_HTTP_REQUEST_BODY = 2;
  STREAM_PURPOSE_HTTP_RESPONSE_BODY = 3;
  STREAM_PURPOSE_BULK_TRANSFER = 4;
  STREAM_PURPOSE_MCP = 5;
}

enum StreamMode {
  STREAM_MODE_UNSPECIFIED = 0;
  STREAM_MODE_RAW_BYTES = 1;
  STREAM_MODE_HTTP1 = 2;
  STREAM_MODE_EVENT_STREAM = 3;
  STREAM_MODE_CHUNKED_BYTES = 4;
}

enum StreamTransportKind {
  STREAM_TRANSPORT_KIND_UNSPECIFIED = 0;
  STREAM_UNIX_SOCKET = 1;
  STREAM_NAMED_PIPE = 2;
  STREAM_TCP = 3;
}

message OpenStreamRequest {
  string stream_id = 1;
  StreamPurpose purpose = 2;
  StreamMode mode = 3;
  bool bidirectional = 4;
  optional string content_type = 5;
  optional string correlation_id = 6;
  optional string metadata_json = 7;
  optional uint64 expected_bytes = 8;
  optional uint64 idle_timeout_ms = 9;
}

message OpenStreamResponse {
  string stream_id = 1;
  bool accepted = 2;
  StreamTransportKind transport_kind = 3;
  optional string endpoint = 4;
  optional string token = 5;
  optional uint64 expires_at_unix_ms = 6;
  optional string message = 7;
}

message OpenMeshStreamRequest {
  string stream_id = 1;
  string target_peer_id = 2;
  string plugin_id = 3;
  string channel = 4;
  StreamPurpose purpose = 5;
  StreamMode mode = 6;
  bool bidirectional = 7;
  optional string content_type = 8;
  optional string correlation_id = 9;
  optional string metadata_json = 10;
  optional uint64 expected_bytes = 11;
  optional uint64 idle_timeout_ms = 12;
}

message OpenMeshStreamResponse {
  string stream_id = 1;
  bool accepted = 2;
  StreamTransportKind transport_kind = 3;
  optional string endpoint = 4;
  optional string token = 5;
  optional uint64 expires_at_unix_ms = 6;
  optional string message = 7;
}

message CancelStreamNotification {
  string stream_id = 1;
  optional string reason = 2;
}

message CloseStreamNotification {
  string stream_id = 1;
  optional string reason = 2;
}

message StreamError {
  string stream_id = 1;
  int32 code = 2;
  string message = 3;
}

message ErrorResponse {
  int32 code = 1;
  string message = 2;
  string data_json = 3;
}