@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,289 @@
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/mcptool.proto
6
+
7
+ /* eslint-disable */
8
+ import { McpToolAnnotations } from "./mcptoolannotations";
9
+
10
+ /** Auto-generated by proto-generator. DO NOT EDIT. */
11
+
12
+ /**
13
+ * metadata.type = "McpTool"
14
+ * Flattened from: McpTool
15
+ */
16
+ export interface McpTool {
17
+ name: string;
18
+ description: string;
19
+ inputSchema: { [key: string]: any | undefined };
20
+ outputSchema: { [key: string]: any | undefined };
21
+ meta: { [key: string]: any | undefined };
22
+ annotations: McpToolAnnotations | undefined;
23
+ }
24
+
25
+ export interface McpTool_InputSchemaEntry {
26
+ key: string;
27
+ value: any | undefined;
28
+ }
29
+
30
+ export interface McpTool_OutputSchemaEntry {
31
+ key: string;
32
+ value: any | undefined;
33
+ }
34
+
35
+ export interface McpTool_MetaEntry {
36
+ key: string;
37
+ value: any | undefined;
38
+ }
39
+
40
+ function createBaseMcpTool(): McpTool {
41
+ return { name: "", description: "", inputSchema: {}, outputSchema: {}, meta: {}, annotations: undefined };
42
+ }
43
+
44
+ export const McpTool: MessageFns<McpTool> = {
45
+ fromJSON(object: any): McpTool {
46
+ return {
47
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
48
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
49
+ inputSchema: isObject(object.inputSchema)
50
+ ? (globalThis.Object.entries(object.inputSchema) as [string, any][]).reduce(
51
+ (acc: { [key: string]: any | undefined }, [key, value]: [string, any]) => {
52
+ acc[key] = value as any | undefined;
53
+ return acc;
54
+ },
55
+ {},
56
+ )
57
+ : {},
58
+ outputSchema: isObject(object.outputSchema)
59
+ ? (globalThis.Object.entries(object.outputSchema) as [string, any][]).reduce(
60
+ (acc: { [key: string]: any | undefined }, [key, value]: [string, any]) => {
61
+ acc[key] = value as any | undefined;
62
+ return acc;
63
+ },
64
+ {},
65
+ )
66
+ : {},
67
+ meta: isObject(object.meta)
68
+ ? (globalThis.Object.entries(object.meta) as [string, any][]).reduce(
69
+ (acc: { [key: string]: any | undefined }, [key, value]: [string, any]) => {
70
+ acc[key] = value as any | undefined;
71
+ return acc;
72
+ },
73
+ {},
74
+ )
75
+ : {},
76
+ annotations: isSet(object.annotations) ? McpToolAnnotations.fromJSON(object.annotations) : undefined,
77
+ };
78
+ },
79
+
80
+ toJSON(message: McpTool): unknown {
81
+ const obj: any = {};
82
+ if (message.name !== "") {
83
+ obj.name = message.name;
84
+ }
85
+ if (message.description !== "") {
86
+ obj.description = message.description;
87
+ }
88
+ if (message.inputSchema) {
89
+ const entries = globalThis.Object.entries(message.inputSchema) as [string, any | undefined][];
90
+ if (entries.length > 0) {
91
+ obj.inputSchema = {};
92
+ entries.forEach(([k, v]) => {
93
+ obj.inputSchema[k] = v;
94
+ });
95
+ }
96
+ }
97
+ if (message.outputSchema) {
98
+ const entries = globalThis.Object.entries(message.outputSchema) as [string, any | undefined][];
99
+ if (entries.length > 0) {
100
+ obj.outputSchema = {};
101
+ entries.forEach(([k, v]) => {
102
+ obj.outputSchema[k] = v;
103
+ });
104
+ }
105
+ }
106
+ if (message.meta) {
107
+ const entries = globalThis.Object.entries(message.meta) as [string, any | undefined][];
108
+ if (entries.length > 0) {
109
+ obj.meta = {};
110
+ entries.forEach(([k, v]) => {
111
+ obj.meta[k] = v;
112
+ });
113
+ }
114
+ }
115
+ if (message.annotations !== undefined) {
116
+ obj.annotations = McpToolAnnotations.toJSON(message.annotations);
117
+ }
118
+ return obj;
119
+ },
120
+
121
+ create<I extends Exact<DeepPartial<McpTool>, I>>(base?: I): McpTool {
122
+ return McpTool.fromPartial(base ?? ({} as any));
123
+ },
124
+ fromPartial<I extends Exact<DeepPartial<McpTool>, I>>(object: I): McpTool {
125
+ const message = createBaseMcpTool();
126
+ message.name = object.name ?? "";
127
+ message.description = object.description ?? "";
128
+ message.inputSchema = (globalThis.Object.entries(object.inputSchema ?? {}) as [string, any | undefined][]).reduce(
129
+ (acc: { [key: string]: any | undefined }, [key, value]: [string, any | undefined]) => {
130
+ if (value !== undefined) {
131
+ acc[key] = value;
132
+ }
133
+ return acc;
134
+ },
135
+ {},
136
+ );
137
+ message.outputSchema = (globalThis.Object.entries(object.outputSchema ?? {}) as [string, any | undefined][]).reduce(
138
+ (acc: { [key: string]: any | undefined }, [key, value]: [string, any | undefined]) => {
139
+ if (value !== undefined) {
140
+ acc[key] = value;
141
+ }
142
+ return acc;
143
+ },
144
+ {},
145
+ );
146
+ message.meta = (globalThis.Object.entries(object.meta ?? {}) as [string, any | undefined][]).reduce(
147
+ (acc: { [key: string]: any | undefined }, [key, value]: [string, any | undefined]) => {
148
+ if (value !== undefined) {
149
+ acc[key] = value;
150
+ }
151
+ return acc;
152
+ },
153
+ {},
154
+ );
155
+ message.annotations = (object.annotations !== undefined && object.annotations !== null)
156
+ ? McpToolAnnotations.fromPartial(object.annotations)
157
+ : undefined;
158
+ return message;
159
+ },
160
+ };
161
+
162
+ function createBaseMcpTool_InputSchemaEntry(): McpTool_InputSchemaEntry {
163
+ return { key: "", value: undefined };
164
+ }
165
+
166
+ export const McpTool_InputSchemaEntry: MessageFns<McpTool_InputSchemaEntry> = {
167
+ fromJSON(object: any): McpTool_InputSchemaEntry {
168
+ return {
169
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
170
+ value: isSet(object?.value) ? object.value : undefined,
171
+ };
172
+ },
173
+
174
+ toJSON(message: McpTool_InputSchemaEntry): unknown {
175
+ const obj: any = {};
176
+ if (message.key !== "") {
177
+ obj.key = message.key;
178
+ }
179
+ if (message.value !== undefined) {
180
+ obj.value = message.value;
181
+ }
182
+ return obj;
183
+ },
184
+
185
+ create<I extends Exact<DeepPartial<McpTool_InputSchemaEntry>, I>>(base?: I): McpTool_InputSchemaEntry {
186
+ return McpTool_InputSchemaEntry.fromPartial(base ?? ({} as any));
187
+ },
188
+ fromPartial<I extends Exact<DeepPartial<McpTool_InputSchemaEntry>, I>>(object: I): McpTool_InputSchemaEntry {
189
+ const message = createBaseMcpTool_InputSchemaEntry();
190
+ message.key = object.key ?? "";
191
+ message.value = object.value ?? undefined;
192
+ return message;
193
+ },
194
+ };
195
+
196
+ function createBaseMcpTool_OutputSchemaEntry(): McpTool_OutputSchemaEntry {
197
+ return { key: "", value: undefined };
198
+ }
199
+
200
+ export const McpTool_OutputSchemaEntry: MessageFns<McpTool_OutputSchemaEntry> = {
201
+ fromJSON(object: any): McpTool_OutputSchemaEntry {
202
+ return {
203
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
204
+ value: isSet(object?.value) ? object.value : undefined,
205
+ };
206
+ },
207
+
208
+ toJSON(message: McpTool_OutputSchemaEntry): unknown {
209
+ const obj: any = {};
210
+ if (message.key !== "") {
211
+ obj.key = message.key;
212
+ }
213
+ if (message.value !== undefined) {
214
+ obj.value = message.value;
215
+ }
216
+ return obj;
217
+ },
218
+
219
+ create<I extends Exact<DeepPartial<McpTool_OutputSchemaEntry>, I>>(base?: I): McpTool_OutputSchemaEntry {
220
+ return McpTool_OutputSchemaEntry.fromPartial(base ?? ({} as any));
221
+ },
222
+ fromPartial<I extends Exact<DeepPartial<McpTool_OutputSchemaEntry>, I>>(object: I): McpTool_OutputSchemaEntry {
223
+ const message = createBaseMcpTool_OutputSchemaEntry();
224
+ message.key = object.key ?? "";
225
+ message.value = object.value ?? undefined;
226
+ return message;
227
+ },
228
+ };
229
+
230
+ function createBaseMcpTool_MetaEntry(): McpTool_MetaEntry {
231
+ return { key: "", value: undefined };
232
+ }
233
+
234
+ export const McpTool_MetaEntry: MessageFns<McpTool_MetaEntry> = {
235
+ fromJSON(object: any): McpTool_MetaEntry {
236
+ return {
237
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
238
+ value: isSet(object?.value) ? object.value : undefined,
239
+ };
240
+ },
241
+
242
+ toJSON(message: McpTool_MetaEntry): unknown {
243
+ const obj: any = {};
244
+ if (message.key !== "") {
245
+ obj.key = message.key;
246
+ }
247
+ if (message.value !== undefined) {
248
+ obj.value = message.value;
249
+ }
250
+ return obj;
251
+ },
252
+
253
+ create<I extends Exact<DeepPartial<McpTool_MetaEntry>, I>>(base?: I): McpTool_MetaEntry {
254
+ return McpTool_MetaEntry.fromPartial(base ?? ({} as any));
255
+ },
256
+ fromPartial<I extends Exact<DeepPartial<McpTool_MetaEntry>, I>>(object: I): McpTool_MetaEntry {
257
+ const message = createBaseMcpTool_MetaEntry();
258
+ message.key = object.key ?? "";
259
+ message.value = object.value ?? undefined;
260
+ return message;
261
+ },
262
+ };
263
+
264
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
265
+
266
+ type DeepPartial<T> = T extends Builtin ? T
267
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
268
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
269
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
270
+ : Partial<T>;
271
+
272
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
273
+ type Exact<P, I extends P> = P extends Builtin ? P
274
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
275
+
276
+ function isObject(value: any): boolean {
277
+ return typeof value === "object" && value !== null;
278
+ }
279
+
280
+ function isSet(value: any): boolean {
281
+ return value !== null && value !== undefined;
282
+ }
283
+
284
+ interface MessageFns<T> {
285
+ fromJSON(object: any): T;
286
+ toJSON(message: T): unknown;
287
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
288
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
289
+ }
@@ -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/mcptoolannotations.proto
6
+
7
+ /* eslint-disable */
8
+
9
+ /** Auto-generated by proto-generator. DO NOT EDIT. */
10
+
11
+ /**
12
+ * metadata.type = "McpToolAnnotations"
13
+ * Flattened from: McpToolAnnotations
14
+ */
15
+ export interface McpToolAnnotations {
16
+ title: string;
17
+ readOnlyHint: boolean;
18
+ destructiveHint: boolean;
19
+ idempotentHint: boolean;
20
+ openWorldHint: boolean;
21
+ }
22
+
23
+ function createBaseMcpToolAnnotations(): McpToolAnnotations {
24
+ return { title: "", readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false };
25
+ }
26
+
27
+ export const McpToolAnnotations: MessageFns<McpToolAnnotations> = {
28
+ fromJSON(object: any): McpToolAnnotations {
29
+ return {
30
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
31
+ readOnlyHint: isSet(object.readOnlyHint) ? globalThis.Boolean(object.readOnlyHint) : false,
32
+ destructiveHint: isSet(object.destructiveHint) ? globalThis.Boolean(object.destructiveHint) : false,
33
+ idempotentHint: isSet(object.idempotentHint) ? globalThis.Boolean(object.idempotentHint) : false,
34
+ openWorldHint: isSet(object.openWorldHint) ? globalThis.Boolean(object.openWorldHint) : false,
35
+ };
36
+ },
37
+
38
+ toJSON(message: McpToolAnnotations): unknown {
39
+ const obj: any = {};
40
+ if (message.title !== "") {
41
+ obj.title = message.title;
42
+ }
43
+ if (message.readOnlyHint !== false) {
44
+ obj.readOnlyHint = message.readOnlyHint;
45
+ }
46
+ if (message.destructiveHint !== false) {
47
+ obj.destructiveHint = message.destructiveHint;
48
+ }
49
+ if (message.idempotentHint !== false) {
50
+ obj.idempotentHint = message.idempotentHint;
51
+ }
52
+ if (message.openWorldHint !== false) {
53
+ obj.openWorldHint = message.openWorldHint;
54
+ }
55
+ return obj;
56
+ },
57
+
58
+ create<I extends Exact<DeepPartial<McpToolAnnotations>, I>>(base?: I): McpToolAnnotations {
59
+ return McpToolAnnotations.fromPartial(base ?? ({} as any));
60
+ },
61
+ fromPartial<I extends Exact<DeepPartial<McpToolAnnotations>, I>>(object: I): McpToolAnnotations {
62
+ const message = createBaseMcpToolAnnotations();
63
+ message.title = object.title ?? "";
64
+ message.readOnlyHint = object.readOnlyHint ?? false;
65
+ message.destructiveHint = object.destructiveHint ?? false;
66
+ message.idempotentHint = object.idempotentHint ?? false;
67
+ message.openWorldHint = object.openWorldHint ?? false;
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
+ }
@@ -0,0 +1,209 @@
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/mcptoolmeta.proto
6
+
7
+ /* eslint-disable */
8
+
9
+ /** Auto-generated by proto-generator. DO NOT EDIT. */
10
+
11
+ /**
12
+ * metadata.type = "McpToolMeta"
13
+ * Flattened from: McpToolMeta
14
+ */
15
+ export interface McpToolMeta {
16
+ invokeContext: { [key: string]: string };
17
+ enabled: boolean;
18
+ templates: { [key: string]: any | undefined };
19
+ }
20
+
21
+ export interface McpToolMeta_InvokeContextEntry {
22
+ key: string;
23
+ value: string;
24
+ }
25
+
26
+ export interface McpToolMeta_TemplatesEntry {
27
+ key: string;
28
+ value: any | undefined;
29
+ }
30
+
31
+ function createBaseMcpToolMeta(): McpToolMeta {
32
+ return { invokeContext: {}, enabled: false, templates: {} };
33
+ }
34
+
35
+ export const McpToolMeta: MessageFns<McpToolMeta> = {
36
+ fromJSON(object: any): McpToolMeta {
37
+ return {
38
+ invokeContext: isObject(object.invokeContext)
39
+ ? (globalThis.Object.entries(object.invokeContext) as [string, any][]).reduce(
40
+ (acc: { [key: string]: string }, [key, value]: [string, any]) => {
41
+ acc[key] = globalThis.String(value);
42
+ return acc;
43
+ },
44
+ {},
45
+ )
46
+ : {},
47
+ enabled: isSet(object.enabled) ? globalThis.Boolean(object.enabled) : false,
48
+ templates: isObject(object.templates)
49
+ ? (globalThis.Object.entries(object.templates) as [string, any][]).reduce(
50
+ (acc: { [key: string]: any | undefined }, [key, value]: [string, any]) => {
51
+ acc[key] = value as any | undefined;
52
+ return acc;
53
+ },
54
+ {},
55
+ )
56
+ : {},
57
+ };
58
+ },
59
+
60
+ toJSON(message: McpToolMeta): unknown {
61
+ const obj: any = {};
62
+ if (message.invokeContext) {
63
+ const entries = globalThis.Object.entries(message.invokeContext) as [string, string][];
64
+ if (entries.length > 0) {
65
+ obj.invokeContext = {};
66
+ entries.forEach(([k, v]) => {
67
+ obj.invokeContext[k] = v;
68
+ });
69
+ }
70
+ }
71
+ if (message.enabled !== false) {
72
+ obj.enabled = message.enabled;
73
+ }
74
+ if (message.templates) {
75
+ const entries = globalThis.Object.entries(message.templates) as [string, any | undefined][];
76
+ if (entries.length > 0) {
77
+ obj.templates = {};
78
+ entries.forEach(([k, v]) => {
79
+ obj.templates[k] = v;
80
+ });
81
+ }
82
+ }
83
+ return obj;
84
+ },
85
+
86
+ create<I extends Exact<DeepPartial<McpToolMeta>, I>>(base?: I): McpToolMeta {
87
+ return McpToolMeta.fromPartial(base ?? ({} as any));
88
+ },
89
+ fromPartial<I extends Exact<DeepPartial<McpToolMeta>, I>>(object: I): McpToolMeta {
90
+ const message = createBaseMcpToolMeta();
91
+ message.invokeContext = (globalThis.Object.entries(object.invokeContext ?? {}) as [string, string][]).reduce(
92
+ (acc: { [key: string]: string }, [key, value]: [string, string]) => {
93
+ if (value !== undefined) {
94
+ acc[key] = globalThis.String(value);
95
+ }
96
+ return acc;
97
+ },
98
+ {},
99
+ );
100
+ message.enabled = object.enabled ?? false;
101
+ message.templates = (globalThis.Object.entries(object.templates ?? {}) as [string, any | undefined][]).reduce(
102
+ (acc: { [key: string]: any | undefined }, [key, value]: [string, any | undefined]) => {
103
+ if (value !== undefined) {
104
+ acc[key] = value;
105
+ }
106
+ return acc;
107
+ },
108
+ {},
109
+ );
110
+ return message;
111
+ },
112
+ };
113
+
114
+ function createBaseMcpToolMeta_InvokeContextEntry(): McpToolMeta_InvokeContextEntry {
115
+ return { key: "", value: "" };
116
+ }
117
+
118
+ export const McpToolMeta_InvokeContextEntry: MessageFns<McpToolMeta_InvokeContextEntry> = {
119
+ fromJSON(object: any): McpToolMeta_InvokeContextEntry {
120
+ return {
121
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
122
+ value: isSet(object.value) ? globalThis.String(object.value) : "",
123
+ };
124
+ },
125
+
126
+ toJSON(message: McpToolMeta_InvokeContextEntry): unknown {
127
+ const obj: any = {};
128
+ if (message.key !== "") {
129
+ obj.key = message.key;
130
+ }
131
+ if (message.value !== "") {
132
+ obj.value = message.value;
133
+ }
134
+ return obj;
135
+ },
136
+
137
+ create<I extends Exact<DeepPartial<McpToolMeta_InvokeContextEntry>, I>>(base?: I): McpToolMeta_InvokeContextEntry {
138
+ return McpToolMeta_InvokeContextEntry.fromPartial(base ?? ({} as any));
139
+ },
140
+ fromPartial<I extends Exact<DeepPartial<McpToolMeta_InvokeContextEntry>, I>>(
141
+ object: I,
142
+ ): McpToolMeta_InvokeContextEntry {
143
+ const message = createBaseMcpToolMeta_InvokeContextEntry();
144
+ message.key = object.key ?? "";
145
+ message.value = object.value ?? "";
146
+ return message;
147
+ },
148
+ };
149
+
150
+ function createBaseMcpToolMeta_TemplatesEntry(): McpToolMeta_TemplatesEntry {
151
+ return { key: "", value: undefined };
152
+ }
153
+
154
+ export const McpToolMeta_TemplatesEntry: MessageFns<McpToolMeta_TemplatesEntry> = {
155
+ fromJSON(object: any): McpToolMeta_TemplatesEntry {
156
+ return {
157
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
158
+ value: isSet(object?.value) ? object.value : undefined,
159
+ };
160
+ },
161
+
162
+ toJSON(message: McpToolMeta_TemplatesEntry): unknown {
163
+ const obj: any = {};
164
+ if (message.key !== "") {
165
+ obj.key = message.key;
166
+ }
167
+ if (message.value !== undefined) {
168
+ obj.value = message.value;
169
+ }
170
+ return obj;
171
+ },
172
+
173
+ create<I extends Exact<DeepPartial<McpToolMeta_TemplatesEntry>, I>>(base?: I): McpToolMeta_TemplatesEntry {
174
+ return McpToolMeta_TemplatesEntry.fromPartial(base ?? ({} as any));
175
+ },
176
+ fromPartial<I extends Exact<DeepPartial<McpToolMeta_TemplatesEntry>, I>>(object: I): McpToolMeta_TemplatesEntry {
177
+ const message = createBaseMcpToolMeta_TemplatesEntry();
178
+ message.key = object.key ?? "";
179
+ message.value = object.value ?? undefined;
180
+ return message;
181
+ },
182
+ };
183
+
184
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
185
+
186
+ type DeepPartial<T> = T extends Builtin ? T
187
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
188
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
189
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
190
+ : Partial<T>;
191
+
192
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
193
+ type Exact<P, I extends P> = P extends Builtin ? P
194
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
195
+
196
+ function isObject(value: any): boolean {
197
+ return typeof value === "object" && value !== null;
198
+ }
199
+
200
+ function isSet(value: any): boolean {
201
+ return value !== null && value !== undefined;
202
+ }
203
+
204
+ interface MessageFns<T> {
205
+ fromJSON(object: any): T;
206
+ toJSON(message: T): unknown;
207
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
208
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
209
+ }