@nacos-group/sdk-proto 1.0.0-beta.2

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 (45) hide show
  1. package/package.json +21 -0
  2. package/src/ai/agentcapabilities.ts +104 -0
  3. package/src/ai/agentcard.ts +292 -0
  4. package/src/ai/agentcarddetailinfo.ts +308 -0
  5. package/src/ai/agentendpoint.ts +134 -0
  6. package/src/ai/agentextension.ts +152 -0
  7. package/src/ai/agentinterface.ts +93 -0
  8. package/src/ai/agentprovider.ts +75 -0
  9. package/src/ai/agentskill.ts +109 -0
  10. package/src/ai/ai_request.ts +608 -0
  11. package/src/ai/ai_response.ts +466 -0
  12. package/src/ai/argument.ts +58 -0
  13. package/src/ai/encryptobject.ts +142 -0
  14. package/src/ai/frontendpointconfig.ts +93 -0
  15. package/src/ai/icon.ts +87 -0
  16. package/src/ai/input.ts +120 -0
  17. package/src/ai/keyvalueinput.ts +200 -0
  18. package/src/ai/mcpendpointinfo.ts +87 -0
  19. package/src/ai/mcpendpointspec.ts +140 -0
  20. package/src/ai/mcpresourcespecification.ts +165 -0
  21. package/src/ai/mcpserverbasicinfo.ts +268 -0
  22. package/src/ai/mcpserverdetailinfo.ts +316 -0
  23. package/src/ai/mcpserverremoteserviceconfig.ts +88 -0
  24. package/src/ai/mcpserviceref.ts +87 -0
  25. package/src/ai/mcptool.ts +289 -0
  26. package/src/ai/mcptoolannotations.ts +93 -0
  27. package/src/ai/mcptoolmeta.ts +209 -0
  28. package/src/ai/mcptoolspecification.ts +250 -0
  29. package/src/ai/package.ts +142 -0
  30. package/src/ai/prompt.ts +96 -0
  31. package/src/ai/promptvariable.ts +81 -0
  32. package/src/ai/repository.ts +87 -0
  33. package/src/ai/securityscheme.ts +142 -0
  34. package/src/ai/serverversiondetail.ts +89 -0
  35. package/src/common/common.ts +1166 -0
  36. package/src/config/config_request.ts +887 -0
  37. package/src/config/config_response.ts +781 -0
  38. package/src/google/protobuf/struct.ts +415 -0
  39. package/src/index.ts +42 -0
  40. package/src/lock/lock.ts +264 -0
  41. package/src/naming/instance.ts +199 -0
  42. package/src/naming/naming_request.ts +768 -0
  43. package/src/naming/naming_response.ts +574 -0
  44. package/src/naming/serviceinfo.ts +130 -0
  45. package/tsconfig.json +11 -0
@@ -0,0 +1,93 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.8
4
+ // protoc v5.28.3
5
+ // source: ai/frontendpointconfig.proto
6
+
7
+ /* eslint-disable */
8
+
9
+ /** Auto-generated by proto-generator. DO NOT EDIT. */
10
+
11
+ /**
12
+ * metadata.type = "FrontEndpointConfig"
13
+ * Flattened from: FrontEndpointConfig
14
+ */
15
+ export interface FrontEndpointConfig {
16
+ type: string;
17
+ protocol: string;
18
+ endpointType: string;
19
+ endpointData: any | undefined;
20
+ path: string;
21
+ }
22
+
23
+ function createBaseFrontEndpointConfig(): FrontEndpointConfig {
24
+ return { type: "", protocol: "", endpointType: "", endpointData: undefined, path: "" };
25
+ }
26
+
27
+ export const FrontEndpointConfig: MessageFns<FrontEndpointConfig> = {
28
+ fromJSON(object: any): FrontEndpointConfig {
29
+ return {
30
+ type: isSet(object.type) ? globalThis.String(object.type) : "",
31
+ protocol: isSet(object.protocol) ? globalThis.String(object.protocol) : "",
32
+ endpointType: isSet(object.endpointType) ? globalThis.String(object.endpointType) : "",
33
+ endpointData: isSet(object?.endpointData) ? object.endpointData : undefined,
34
+ path: isSet(object.path) ? globalThis.String(object.path) : "",
35
+ };
36
+ },
37
+
38
+ toJSON(message: FrontEndpointConfig): unknown {
39
+ const obj: any = {};
40
+ if (message.type !== "") {
41
+ obj.type = message.type;
42
+ }
43
+ if (message.protocol !== "") {
44
+ obj.protocol = message.protocol;
45
+ }
46
+ if (message.endpointType !== "") {
47
+ obj.endpointType = message.endpointType;
48
+ }
49
+ if (message.endpointData !== undefined) {
50
+ obj.endpointData = message.endpointData;
51
+ }
52
+ if (message.path !== "") {
53
+ obj.path = message.path;
54
+ }
55
+ return obj;
56
+ },
57
+
58
+ create<I extends Exact<DeepPartial<FrontEndpointConfig>, I>>(base?: I): FrontEndpointConfig {
59
+ return FrontEndpointConfig.fromPartial(base ?? ({} as any));
60
+ },
61
+ fromPartial<I extends Exact<DeepPartial<FrontEndpointConfig>, I>>(object: I): FrontEndpointConfig {
62
+ const message = createBaseFrontEndpointConfig();
63
+ message.type = object.type ?? "";
64
+ message.protocol = object.protocol ?? "";
65
+ message.endpointType = object.endpointType ?? "";
66
+ message.endpointData = object.endpointData ?? undefined;
67
+ message.path = object.path ?? "";
68
+ return message;
69
+ },
70
+ };
71
+
72
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
73
+
74
+ type DeepPartial<T> = T extends Builtin ? T
75
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
76
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
77
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
78
+ : Partial<T>;
79
+
80
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
81
+ type Exact<P, I extends P> = P extends Builtin ? P
82
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
83
+
84
+ function isSet(value: any): boolean {
85
+ return value !== null && value !== undefined;
86
+ }
87
+
88
+ interface MessageFns<T> {
89
+ fromJSON(object: any): T;
90
+ toJSON(message: T): unknown;
91
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
92
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
93
+ }
package/src/ai/icon.ts ADDED
@@ -0,0 +1,87 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.8
4
+ // protoc v5.28.3
5
+ // source: ai/icon.proto
6
+
7
+ /* eslint-disable */
8
+
9
+ /** Auto-generated by proto-generator. DO NOT EDIT. */
10
+
11
+ /**
12
+ * metadata.type = "Icon"
13
+ * Flattened from: Icon
14
+ */
15
+ export interface Icon {
16
+ src: string;
17
+ mimeType: string;
18
+ sizes: string[];
19
+ theme: string;
20
+ }
21
+
22
+ function createBaseIcon(): Icon {
23
+ return { src: "", mimeType: "", sizes: [], theme: "" };
24
+ }
25
+
26
+ export const Icon: MessageFns<Icon> = {
27
+ fromJSON(object: any): Icon {
28
+ return {
29
+ src: isSet(object.src) ? globalThis.String(object.src) : "",
30
+ mimeType: isSet(object.mimeType) ? globalThis.String(object.mimeType) : "",
31
+ sizes: globalThis.Array.isArray(object?.sizes) ? object.sizes.map((e: any) => globalThis.String(e)) : [],
32
+ theme: isSet(object.theme) ? globalThis.String(object.theme) : "",
33
+ };
34
+ },
35
+
36
+ toJSON(message: Icon): unknown {
37
+ const obj: any = {};
38
+ if (message.src !== "") {
39
+ obj.src = message.src;
40
+ }
41
+ if (message.mimeType !== "") {
42
+ obj.mimeType = message.mimeType;
43
+ }
44
+ if (message.sizes?.length) {
45
+ obj.sizes = message.sizes;
46
+ }
47
+ if (message.theme !== "") {
48
+ obj.theme = message.theme;
49
+ }
50
+ return obj;
51
+ },
52
+
53
+ create<I extends Exact<DeepPartial<Icon>, I>>(base?: I): Icon {
54
+ return Icon.fromPartial(base ?? ({} as any));
55
+ },
56
+ fromPartial<I extends Exact<DeepPartial<Icon>, I>>(object: I): Icon {
57
+ const message = createBaseIcon();
58
+ message.src = object.src ?? "";
59
+ message.mimeType = object.mimeType ?? "";
60
+ message.sizes = object.sizes?.map((e) => e) || [];
61
+ message.theme = object.theme ?? "";
62
+ return message;
63
+ },
64
+ };
65
+
66
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
67
+
68
+ type DeepPartial<T> = T extends Builtin ? T
69
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
70
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
71
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
72
+ : Partial<T>;
73
+
74
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
75
+ type Exact<P, I extends P> = P extends Builtin ? P
76
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
77
+
78
+ function isSet(value: any): boolean {
79
+ return value !== null && value !== undefined;
80
+ }
81
+
82
+ interface MessageFns<T> {
83
+ fromJSON(object: any): T;
84
+ toJSON(message: T): unknown;
85
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
86
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
87
+ }
@@ -0,0 +1,120 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.8
4
+ // protoc v5.28.3
5
+ // source: ai/input.proto
6
+
7
+ /* eslint-disable */
8
+
9
+ /** Auto-generated by proto-generator. DO NOT EDIT. */
10
+
11
+ /**
12
+ * metadata.type = "Input"
13
+ * Flattened from: Input
14
+ */
15
+ export interface Input {
16
+ description: string;
17
+ isRequired: boolean;
18
+ format: string;
19
+ value: string;
20
+ isSecret: boolean;
21
+ defaultValue: string;
22
+ choices: string[];
23
+ placeholder: string;
24
+ }
25
+
26
+ function createBaseInput(): Input {
27
+ return {
28
+ description: "",
29
+ isRequired: false,
30
+ format: "",
31
+ value: "",
32
+ isSecret: false,
33
+ defaultValue: "",
34
+ choices: [],
35
+ placeholder: "",
36
+ };
37
+ }
38
+
39
+ export const Input: MessageFns<Input> = {
40
+ fromJSON(object: any): Input {
41
+ return {
42
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
43
+ isRequired: isSet(object.isRequired) ? globalThis.Boolean(object.isRequired) : false,
44
+ format: isSet(object.format) ? globalThis.String(object.format) : "",
45
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
46
+ isSecret: isSet(object.isSecret) ? globalThis.Boolean(object.isSecret) : false,
47
+ defaultValue: isSet(object.defaultValue) ? globalThis.String(object.defaultValue) : "",
48
+ choices: globalThis.Array.isArray(object?.choices) ? object.choices.map((e: any) => globalThis.String(e)) : [],
49
+ placeholder: isSet(object.placeholder) ? globalThis.String(object.placeholder) : "",
50
+ };
51
+ },
52
+
53
+ toJSON(message: Input): unknown {
54
+ const obj: any = {};
55
+ if (message.description !== "") {
56
+ obj.description = message.description;
57
+ }
58
+ if (message.isRequired !== false) {
59
+ obj.isRequired = message.isRequired;
60
+ }
61
+ if (message.format !== "") {
62
+ obj.format = message.format;
63
+ }
64
+ if (message.value !== "") {
65
+ obj.value = message.value;
66
+ }
67
+ if (message.isSecret !== false) {
68
+ obj.isSecret = message.isSecret;
69
+ }
70
+ if (message.defaultValue !== "") {
71
+ obj.defaultValue = message.defaultValue;
72
+ }
73
+ if (message.choices?.length) {
74
+ obj.choices = message.choices;
75
+ }
76
+ if (message.placeholder !== "") {
77
+ obj.placeholder = message.placeholder;
78
+ }
79
+ return obj;
80
+ },
81
+
82
+ create<I extends Exact<DeepPartial<Input>, I>>(base?: I): Input {
83
+ return Input.fromPartial(base ?? ({} as any));
84
+ },
85
+ fromPartial<I extends Exact<DeepPartial<Input>, I>>(object: I): Input {
86
+ const message = createBaseInput();
87
+ message.description = object.description ?? "";
88
+ message.isRequired = object.isRequired ?? false;
89
+ message.format = object.format ?? "";
90
+ message.value = object.value ?? "";
91
+ message.isSecret = object.isSecret ?? false;
92
+ message.defaultValue = object.defaultValue ?? "";
93
+ message.choices = object.choices?.map((e) => e) || [];
94
+ message.placeholder = object.placeholder ?? "";
95
+ return message;
96
+ },
97
+ };
98
+
99
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
100
+
101
+ type DeepPartial<T> = T extends Builtin ? T
102
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
103
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
104
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
105
+ : Partial<T>;
106
+
107
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
108
+ type Exact<P, I extends P> = P extends Builtin ? P
109
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
110
+
111
+ function isSet(value: any): boolean {
112
+ return value !== null && value !== undefined;
113
+ }
114
+
115
+ interface MessageFns<T> {
116
+ fromJSON(object: any): T;
117
+ toJSON(message: T): unknown;
118
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
119
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
120
+ }
@@ -0,0 +1,200 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.8
4
+ // protoc v5.28.3
5
+ // source: ai/keyvalueinput.proto
6
+
7
+ /* eslint-disable */
8
+ import { Input } from "./input";
9
+
10
+ /** Auto-generated by proto-generator. DO NOT EDIT. */
11
+
12
+ /**
13
+ * metadata.type = "KeyValueInput"
14
+ * Flattened from: KeyValueInput -> InputWithVariables -> Input
15
+ */
16
+ export interface KeyValueInput {
17
+ description: string;
18
+ isRequired: boolean;
19
+ format: string;
20
+ value: string;
21
+ isSecret: boolean;
22
+ defaultValue: string;
23
+ choices: string[];
24
+ placeholder: string;
25
+ variables: { [key: string]: Input };
26
+ name: string;
27
+ }
28
+
29
+ export interface KeyValueInput_VariablesEntry {
30
+ key: string;
31
+ value: Input | undefined;
32
+ }
33
+
34
+ function createBaseKeyValueInput(): KeyValueInput {
35
+ return {
36
+ description: "",
37
+ isRequired: false,
38
+ format: "",
39
+ value: "",
40
+ isSecret: false,
41
+ defaultValue: "",
42
+ choices: [],
43
+ placeholder: "",
44
+ variables: {},
45
+ name: "",
46
+ };
47
+ }
48
+
49
+ export const KeyValueInput: MessageFns<KeyValueInput> = {
50
+ fromJSON(object: any): KeyValueInput {
51
+ return {
52
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
53
+ isRequired: isSet(object.isRequired) ? globalThis.Boolean(object.isRequired) : false,
54
+ format: isSet(object.format) ? globalThis.String(object.format) : "",
55
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
56
+ isSecret: isSet(object.isSecret) ? globalThis.Boolean(object.isSecret) : false,
57
+ defaultValue: isSet(object.defaultValue) ? globalThis.String(object.defaultValue) : "",
58
+ choices: globalThis.Array.isArray(object?.choices) ? object.choices.map((e: any) => globalThis.String(e)) : [],
59
+ placeholder: isSet(object.placeholder) ? globalThis.String(object.placeholder) : "",
60
+ variables: isObject(object.variables)
61
+ ? (globalThis.Object.entries(object.variables) as [string, any][]).reduce(
62
+ (acc: { [key: string]: Input }, [key, value]: [string, any]) => {
63
+ acc[key] = Input.fromJSON(value);
64
+ return acc;
65
+ },
66
+ {},
67
+ )
68
+ : {},
69
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
70
+ };
71
+ },
72
+
73
+ toJSON(message: KeyValueInput): unknown {
74
+ const obj: any = {};
75
+ if (message.description !== "") {
76
+ obj.description = message.description;
77
+ }
78
+ if (message.isRequired !== false) {
79
+ obj.isRequired = message.isRequired;
80
+ }
81
+ if (message.format !== "") {
82
+ obj.format = message.format;
83
+ }
84
+ if (message.value !== "") {
85
+ obj.value = message.value;
86
+ }
87
+ if (message.isSecret !== false) {
88
+ obj.isSecret = message.isSecret;
89
+ }
90
+ if (message.defaultValue !== "") {
91
+ obj.defaultValue = message.defaultValue;
92
+ }
93
+ if (message.choices?.length) {
94
+ obj.choices = message.choices;
95
+ }
96
+ if (message.placeholder !== "") {
97
+ obj.placeholder = message.placeholder;
98
+ }
99
+ if (message.variables) {
100
+ const entries = globalThis.Object.entries(message.variables) as [string, Input][];
101
+ if (entries.length > 0) {
102
+ obj.variables = {};
103
+ entries.forEach(([k, v]) => {
104
+ obj.variables[k] = Input.toJSON(v);
105
+ });
106
+ }
107
+ }
108
+ if (message.name !== "") {
109
+ obj.name = message.name;
110
+ }
111
+ return obj;
112
+ },
113
+
114
+ create<I extends Exact<DeepPartial<KeyValueInput>, I>>(base?: I): KeyValueInput {
115
+ return KeyValueInput.fromPartial(base ?? ({} as any));
116
+ },
117
+ fromPartial<I extends Exact<DeepPartial<KeyValueInput>, I>>(object: I): KeyValueInput {
118
+ const message = createBaseKeyValueInput();
119
+ message.description = object.description ?? "";
120
+ message.isRequired = object.isRequired ?? false;
121
+ message.format = object.format ?? "";
122
+ message.value = object.value ?? "";
123
+ message.isSecret = object.isSecret ?? false;
124
+ message.defaultValue = object.defaultValue ?? "";
125
+ message.choices = object.choices?.map((e) => e) || [];
126
+ message.placeholder = object.placeholder ?? "";
127
+ message.variables = (globalThis.Object.entries(object.variables ?? {}) as [string, Input][]).reduce(
128
+ (acc: { [key: string]: Input }, [key, value]: [string, Input]) => {
129
+ if (value !== undefined) {
130
+ acc[key] = Input.fromPartial(value);
131
+ }
132
+ return acc;
133
+ },
134
+ {},
135
+ );
136
+ message.name = object.name ?? "";
137
+ return message;
138
+ },
139
+ };
140
+
141
+ function createBaseKeyValueInput_VariablesEntry(): KeyValueInput_VariablesEntry {
142
+ return { key: "", value: undefined };
143
+ }
144
+
145
+ export const KeyValueInput_VariablesEntry: MessageFns<KeyValueInput_VariablesEntry> = {
146
+ fromJSON(object: any): KeyValueInput_VariablesEntry {
147
+ return {
148
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
149
+ value: isSet(object.value) ? Input.fromJSON(object.value) : undefined,
150
+ };
151
+ },
152
+
153
+ toJSON(message: KeyValueInput_VariablesEntry): unknown {
154
+ const obj: any = {};
155
+ if (message.key !== "") {
156
+ obj.key = message.key;
157
+ }
158
+ if (message.value !== undefined) {
159
+ obj.value = Input.toJSON(message.value);
160
+ }
161
+ return obj;
162
+ },
163
+
164
+ create<I extends Exact<DeepPartial<KeyValueInput_VariablesEntry>, I>>(base?: I): KeyValueInput_VariablesEntry {
165
+ return KeyValueInput_VariablesEntry.fromPartial(base ?? ({} as any));
166
+ },
167
+ fromPartial<I extends Exact<DeepPartial<KeyValueInput_VariablesEntry>, I>>(object: I): KeyValueInput_VariablesEntry {
168
+ const message = createBaseKeyValueInput_VariablesEntry();
169
+ message.key = object.key ?? "";
170
+ message.value = (object.value !== undefined && object.value !== null) ? Input.fromPartial(object.value) : undefined;
171
+ return message;
172
+ },
173
+ };
174
+
175
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
176
+
177
+ type DeepPartial<T> = T extends Builtin ? T
178
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
179
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
180
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
181
+ : Partial<T>;
182
+
183
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
184
+ type Exact<P, I extends P> = P extends Builtin ? P
185
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
186
+
187
+ function isObject(value: any): boolean {
188
+ return typeof value === "object" && value !== null;
189
+ }
190
+
191
+ function isSet(value: any): boolean {
192
+ return value !== null && value !== undefined;
193
+ }
194
+
195
+ interface MessageFns<T> {
196
+ fromJSON(object: any): T;
197
+ toJSON(message: T): unknown;
198
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
199
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
200
+ }
@@ -0,0 +1,87 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.8
4
+ // protoc v5.28.3
5
+ // source: ai/mcpendpointinfo.proto
6
+
7
+ /* eslint-disable */
8
+
9
+ /** Auto-generated by proto-generator. DO NOT EDIT. */
10
+
11
+ /**
12
+ * metadata.type = "McpEndpointInfo"
13
+ * Flattened from: McpEndpointInfo
14
+ */
15
+ export interface McpEndpointInfo {
16
+ protocol: string;
17
+ address: string;
18
+ port: number;
19
+ path: string;
20
+ }
21
+
22
+ function createBaseMcpEndpointInfo(): McpEndpointInfo {
23
+ return { protocol: "", address: "", port: 0, path: "" };
24
+ }
25
+
26
+ export const McpEndpointInfo: MessageFns<McpEndpointInfo> = {
27
+ fromJSON(object: any): McpEndpointInfo {
28
+ return {
29
+ protocol: isSet(object.protocol) ? globalThis.String(object.protocol) : "",
30
+ address: isSet(object.address) ? globalThis.String(object.address) : "",
31
+ port: isSet(object.port) ? globalThis.Number(object.port) : 0,
32
+ path: isSet(object.path) ? globalThis.String(object.path) : "",
33
+ };
34
+ },
35
+
36
+ toJSON(message: McpEndpointInfo): unknown {
37
+ const obj: any = {};
38
+ if (message.protocol !== "") {
39
+ obj.protocol = message.protocol;
40
+ }
41
+ if (message.address !== "") {
42
+ obj.address = message.address;
43
+ }
44
+ if (message.port !== 0) {
45
+ obj.port = Math.round(message.port);
46
+ }
47
+ if (message.path !== "") {
48
+ obj.path = message.path;
49
+ }
50
+ return obj;
51
+ },
52
+
53
+ create<I extends Exact<DeepPartial<McpEndpointInfo>, I>>(base?: I): McpEndpointInfo {
54
+ return McpEndpointInfo.fromPartial(base ?? ({} as any));
55
+ },
56
+ fromPartial<I extends Exact<DeepPartial<McpEndpointInfo>, I>>(object: I): McpEndpointInfo {
57
+ const message = createBaseMcpEndpointInfo();
58
+ message.protocol = object.protocol ?? "";
59
+ message.address = object.address ?? "";
60
+ message.port = object.port ?? 0;
61
+ message.path = object.path ?? "";
62
+ return message;
63
+ },
64
+ };
65
+
66
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
67
+
68
+ type DeepPartial<T> = T extends Builtin ? T
69
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
70
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
71
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
72
+ : Partial<T>;
73
+
74
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
75
+ type Exact<P, I extends P> = P extends Builtin ? P
76
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
77
+
78
+ function isSet(value: any): boolean {
79
+ return value !== null && value !== undefined;
80
+ }
81
+
82
+ interface MessageFns<T> {
83
+ fromJSON(object: any): T;
84
+ toJSON(message: T): unknown;
85
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
86
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
87
+ }