weave-typescript 0.51.2 → 0.52.0

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 (185) hide show
  1. package/dist/google/protobuf/duration.pb.d.ts +99 -0
  2. package/dist/google/protobuf/duration.pb.js +93 -0
  3. package/dist/index.d.ts +1 -0
  4. package/dist/index.js +2 -1
  5. package/dist/weave/authz/v1/index.d.ts +1 -0
  6. package/dist/weave/authz/v1/index.js +38 -0
  7. package/dist/weave/authz/v1/options.pb.d.ts +52 -0
  8. package/dist/weave/authz/v1/options.pb.js +403 -0
  9. package/dist/weave/filter/v1/index.d.ts +1 -0
  10. package/dist/weave/filter/v1/index.js +38 -0
  11. package/dist/{weaveapi/atc/v1/message.pb.d.ts → weave/filter/v1/options.pb.d.ts} +33 -21
  12. package/dist/weave/filter/v1/options.pb.js +417 -0
  13. package/dist/weave/index.d.ts +2 -0
  14. package/dist/weave/index.js +39 -0
  15. package/dist/weaveapi/agent/v1/agent.pb.d.ts +137 -188
  16. package/dist/weaveapi/agent/v1/agent.pb.js +891 -2151
  17. package/dist/weaveapi/agent/v1/index.d.ts +1 -1
  18. package/dist/weaveapi/agent/v1/index.js +2 -2
  19. package/dist/weaveapi/agent/v1/run.pb.d.ts +289 -0
  20. package/dist/weaveapi/agent/v1/run.pb.js +2763 -0
  21. package/dist/weaveapi/auth/v1/auth.pb.d.ts +67 -14
  22. package/dist/weaveapi/auth/v1/auth.pb.js +829 -89
  23. package/dist/weaveapi/auth/v1/index.d.ts +4 -1
  24. package/dist/weaveapi/auth/v1/index.js +5 -2
  25. package/dist/weaveapi/auth/v1/{service.pb.d.ts → organization_admin.pb.d.ts} +39 -530
  26. package/dist/weaveapi/auth/v1/{service.pb.js → organization_admin.pb.js} +2978 -5812
  27. package/dist/weaveapi/auth/v1/personal_access_token.pb.d.ts +114 -0
  28. package/dist/weaveapi/auth/v1/personal_access_token.pb.js +750 -0
  29. package/dist/weaveapi/auth/v1/profile.pb.d.ts +161 -0
  30. package/dist/weaveapi/auth/v1/profile.pb.js +1007 -0
  31. package/dist/weaveapi/auth/v1/session.pb.d.ts +460 -0
  32. package/dist/weaveapi/auth/v1/session.pb.js +3544 -0
  33. package/dist/weaveapi/chat/v1/chat.pb.d.ts +377 -149
  34. package/dist/weaveapi/chat/v1/chat.pb.js +3492 -1614
  35. package/dist/weaveapi/chat/v1/index.d.ts +0 -1
  36. package/dist/weaveapi/chat/v1/index.js +1 -2
  37. package/dist/weaveapi/consolidation/v1/consolidation.pb.d.ts +95 -0
  38. package/dist/weaveapi/consolidation/v1/consolidation.pb.js +770 -1
  39. package/dist/weaveapi/consolidation/v1/index.d.ts +0 -1
  40. package/dist/weaveapi/consolidation/v1/index.js +1 -2
  41. package/dist/weaveapi/content/v1/content.pb.d.ts +63 -0
  42. package/dist/weaveapi/content/v1/content.pb.js +470 -0
  43. package/dist/weaveapi/content/v1/index.d.ts +1 -0
  44. package/dist/weaveapi/content/v1/index.js +38 -0
  45. package/dist/weaveapi/gateway/v1/gateway.pb.d.ts +247 -523
  46. package/dist/weaveapi/gateway/v1/gateway.pb.js +1648 -5783
  47. package/dist/weaveapi/gateway/v1/index.d.ts +0 -1
  48. package/dist/weaveapi/gateway/v1/index.js +1 -2
  49. package/dist/weaveapi/index.d.ts +5 -5
  50. package/dist/weaveapi/index.js +6 -6
  51. package/dist/weaveapi/inference/v1/generate.pb.d.ts +120 -0
  52. package/dist/weaveapi/inference/v1/generate.pb.js +1159 -0
  53. package/dist/weaveapi/inference/v1/index.d.ts +4 -0
  54. package/dist/weaveapi/{provider → inference}/v1/index.js +4 -2
  55. package/dist/weaveapi/{model → inference}/v1/model.pb.d.ts +52 -15
  56. package/dist/weaveapi/{model → inference}/v1/model.pb.js +529 -116
  57. package/dist/weaveapi/{model/v1/service.pb.d.ts → inference/v1/model_route.pb.d.ts} +182 -110
  58. package/dist/weaveapi/{model/v1/service.pb.js → inference/v1/model_route.pb.js} +2197 -1061
  59. package/dist/weaveapi/inference/v1/provider.pb.d.ts +264 -0
  60. package/dist/weaveapi/inference/v1/provider.pb.js +2590 -0
  61. package/dist/weaveapi/ingestion/v1/index.d.ts +0 -2
  62. package/dist/weaveapi/ingestion/v1/index.js +1 -3
  63. package/dist/weaveapi/ingestion/v1/ingestion.pb.d.ts +543 -0
  64. package/dist/weaveapi/ingestion/v1/ingestion.pb.js +5550 -16
  65. package/dist/weaveapi/initialization/v1/index.d.ts +1 -0
  66. package/dist/weaveapi/initialization/v1/index.js +38 -0
  67. package/dist/weaveapi/initialization/v1/initialization.pb.d.ts +99 -0
  68. package/dist/weaveapi/initialization/v1/initialization.pb.js +510 -0
  69. package/dist/weaveapi/organization/v1/index.d.ts +0 -1
  70. package/dist/weaveapi/organization/v1/index.js +1 -2
  71. package/dist/weaveapi/organization/v1/organization.pb.d.ts +241 -0
  72. package/dist/weaveapi/organization/v1/organization.pb.js +1838 -1
  73. package/dist/weaveapi/reporting/index.d.ts +1 -0
  74. package/dist/weaveapi/reporting/index.js +38 -0
  75. package/dist/weaveapi/{task → reporting}/v1/index.d.ts +1 -1
  76. package/dist/weaveapi/{model → reporting}/v1/index.js +2 -2
  77. package/dist/weaveapi/reporting/v1/service.pb.d.ts +38 -0
  78. package/dist/weaveapi/reporting/v1/service.pb.js +167 -0
  79. package/dist/weaveapi/reporting/v1/usage.pb.d.ts +150 -0
  80. package/dist/weaveapi/reporting/v1/usage.pb.js +1837 -0
  81. package/dist/weaveapi/retrieval/v1/index.d.ts +0 -1
  82. package/dist/weaveapi/retrieval/v1/index.js +1 -2
  83. package/dist/weaveapi/retrieval/v1/retrieval.pb.d.ts +96 -2
  84. package/dist/weaveapi/retrieval/v1/retrieval.pb.js +690 -10
  85. package/dist/weaveapi/tool/index.d.ts +1 -0
  86. package/dist/weaveapi/tool/index.js +38 -0
  87. package/dist/weaveapi/tool/v1/index.d.ts +1 -0
  88. package/dist/weaveapi/tool/v1/index.js +38 -0
  89. package/dist/weaveapi/tool/v1/tool.pb.d.ts +370 -0
  90. package/dist/weaveapi/tool/v1/tool.pb.js +2717 -0
  91. package/dist/weaveapi/workflow/v1/index.d.ts +1 -1
  92. package/dist/weaveapi/workflow/v1/index.js +2 -2
  93. package/dist/weaveapi/workflow/v1/run.pb.d.ts +244 -0
  94. package/dist/weaveapi/workflow/v1/run.pb.js +2084 -0
  95. package/dist/weaveapi/workflow/v1/workflow.pb.d.ts +122 -275
  96. package/dist/weaveapi/workflow/v1/workflow.pb.js +790 -3261
  97. package/dist/weavesql/weavedb/agent_sql.d.ts +173 -477
  98. package/dist/weavesql/weavedb/agent_sql.js +281 -758
  99. package/dist/weavesql/weavedb/authorization_outbox_sql.d.ts +261 -0
  100. package/dist/weavesql/weavedb/authorization_outbox_sql.js +445 -0
  101. package/dist/weavesql/weavedb/chat_sql.d.ts +103 -345
  102. package/dist/weavesql/weavedb/chat_sql.js +312 -597
  103. package/dist/weavesql/weavedb/document_consolidation_sql.d.ts +217 -0
  104. package/dist/weavesql/weavedb/document_consolidation_sql.js +486 -0
  105. package/dist/weavesql/weavedb/document_ingestion_sql.d.ts +1433 -0
  106. package/dist/weavesql/weavedb/document_ingestion_sql.js +3488 -0
  107. package/dist/weavesql/weavedb/document_retrieval_sql.d.ts +314 -0
  108. package/dist/weavesql/weavedb/document_retrieval_sql.js +965 -0
  109. package/dist/weavesql/weavedb/document_table_sql.d.ts +6 -6
  110. package/dist/weavesql/weavedb/document_table_sql.js +12 -12
  111. package/dist/weavesql/weavedb/identity_sql.d.ts +1014 -0
  112. package/dist/weavesql/weavedb/identity_sql.js +1811 -0
  113. package/dist/weavesql/weavedb/inference_model_route_sql.d.ts +161 -0
  114. package/dist/weavesql/weavedb/inference_model_route_sql.js +408 -0
  115. package/dist/weavesql/weavedb/inference_provider_sql.d.ts +125 -0
  116. package/dist/weavesql/weavedb/inference_provider_sql.js +228 -0
  117. package/dist/weavesql/weavedb/initialization_sql.d.ts +15 -0
  118. package/dist/weavesql/weavedb/initialization_sql.js +33 -0
  119. package/dist/weavesql/weavedb/model_catalog_sql.d.ts +6 -6
  120. package/dist/weavesql/weavedb/model_catalog_sql.js +6 -6
  121. package/dist/weavesql/weavedb/organization_sql.d.ts +22 -102
  122. package/dist/weavesql/weavedb/organization_sql.js +54 -262
  123. package/dist/weavesql/weavedb/tool_sql.d.ts +209 -0
  124. package/dist/weavesql/weavedb/tool_sql.js +407 -0
  125. package/dist/weavesql/weavedb/usage_sql.d.ts +356 -0
  126. package/dist/weavesql/weavedb/usage_sql.js +568 -0
  127. package/dist/weavesql/weavedb/workflow_sql.d.ts +159 -546
  128. package/dist/weavesql/weavedb/workflow_sql.js +281 -909
  129. package/package.json +2 -2
  130. package/dist/weaveapi/agent/v1/service.pb.d.ts +0 -397
  131. package/dist/weaveapi/agent/v1/service.pb.js +0 -3152
  132. package/dist/weaveapi/atc/v1/event.pb.d.ts +0 -134
  133. package/dist/weaveapi/atc/v1/event.pb.js +0 -1124
  134. package/dist/weaveapi/atc/v1/index.d.ts +0 -5
  135. package/dist/weaveapi/atc/v1/index.js +0 -42
  136. package/dist/weaveapi/atc/v1/message.pb.js +0 -287
  137. package/dist/weaveapi/atc/v1/process.pb.d.ts +0 -91
  138. package/dist/weaveapi/atc/v1/process.pb.js +0 -658
  139. package/dist/weaveapi/atc/v1/run.pb.d.ts +0 -71
  140. package/dist/weaveapi/atc/v1/run.pb.js +0 -525
  141. package/dist/weaveapi/atc/v1/service.pb.d.ts +0 -472
  142. package/dist/weaveapi/atc/v1/service.pb.js +0 -3093
  143. package/dist/weaveapi/chat/v1/service.pb.d.ts +0 -345
  144. package/dist/weaveapi/chat/v1/service.pb.js +0 -2545
  145. package/dist/weaveapi/consolidation/v1/service.pb.d.ts +0 -93
  146. package/dist/weaveapi/consolidation/v1/service.pb.js +0 -427
  147. package/dist/weaveapi/gateway/v1/service.pb.d.ts +0 -235
  148. package/dist/weaveapi/gateway/v1/service.pb.js +0 -651
  149. package/dist/weaveapi/ingestion/v1/service.pb.d.ts +0 -420
  150. package/dist/weaveapi/ingestion/v1/service.pb.js +0 -2311
  151. package/dist/weaveapi/ingestion/v1/table.pb.d.ts +0 -121
  152. package/dist/weaveapi/ingestion/v1/table.pb.js +0 -1478
  153. package/dist/weaveapi/model/v1/index.d.ts +0 -2
  154. package/dist/weaveapi/organization/v1/service.pb.d.ts +0 -261
  155. package/dist/weaveapi/organization/v1/service.pb.js +0 -1561
  156. package/dist/weaveapi/project/v1/index.d.ts +0 -2
  157. package/dist/weaveapi/project/v1/index.js +0 -39
  158. package/dist/weaveapi/project/v1/project.pb.d.ts +0 -105
  159. package/dist/weaveapi/project/v1/project.pb.js +0 -1004
  160. package/dist/weaveapi/project/v1/service.pb.d.ts +0 -247
  161. package/dist/weaveapi/project/v1/service.pb.js +0 -1994
  162. package/dist/weaveapi/provider/v1/index.d.ts +0 -2
  163. package/dist/weaveapi/provider/v1/provider.pb.d.ts +0 -137
  164. package/dist/weaveapi/provider/v1/provider.pb.js +0 -1000
  165. package/dist/weaveapi/provider/v1/service.pb.d.ts +0 -223
  166. package/dist/weaveapi/provider/v1/service.pb.js +0 -1888
  167. package/dist/weaveapi/retrieval/v1/service.pb.d.ts +0 -93
  168. package/dist/weaveapi/retrieval/v1/service.pb.js +0 -385
  169. package/dist/weaveapi/task/v1/index.js +0 -39
  170. package/dist/weaveapi/task/v1/service.pb.d.ts +0 -172
  171. package/dist/weaveapi/task/v1/service.pb.js +0 -1436
  172. package/dist/weaveapi/task/v1/task.pb.d.ts +0 -85
  173. package/dist/weaveapi/task/v1/task.pb.js +0 -802
  174. package/dist/weaveapi/workflow/v1/service.pb.d.ts +0 -392
  175. package/dist/weaveapi/workflow/v1/service.pb.js +0 -3146
  176. /package/dist/{weaveapi/atc → weave/authz}/index.d.ts +0 -0
  177. /package/dist/{weaveapi/atc → weave/authz}/index.js +0 -0
  178. /package/dist/{weaveapi/model → weave/filter}/index.d.ts +0 -0
  179. /package/dist/{weaveapi/model → weave/filter}/index.js +0 -0
  180. /package/dist/weaveapi/{project → content}/index.d.ts +0 -0
  181. /package/dist/weaveapi/{project → content}/index.js +0 -0
  182. /package/dist/weaveapi/{provider → inference}/index.d.ts +0 -0
  183. /package/dist/weaveapi/{provider → inference}/index.js +0 -0
  184. /package/dist/weaveapi/{task → initialization}/index.d.ts +0 -0
  185. /package/dist/weaveapi/{task → initialization}/index.js +0 -0
@@ -0,0 +1,2717 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.11.8
5
+ // protoc unknown
6
+ // source: weaveapi/tool/v1/tool.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ToolRuntimeServiceDefinition = exports.ToolRuntimeServiceClientImpl = exports.ToolRuntimeServiceServiceName = exports.ToolServiceDefinition = exports.ToolServiceClientImpl = exports.ToolServiceServiceName = exports.AgentTool = exports.Tool = exports.ToolExecutionResult = exports.ExecuteToolResponse = exports.ToolExecutionContext = exports.ExecuteToolRequest = exports.DetachAgentToolResponse = exports.DetachAgentToolRequest = exports.ListAgentToolsResponse = exports.ListAgentToolsRequest = exports.AttachAgentToolResponse = exports.AttachAgentToolRequest = exports.ListToolsResponse = exports.ListToolsRequest = exports.DeleteToolResponse = exports.DeleteToolRequest = exports.UpdateToolResponse = exports.UpdateToolRequest = exports.GetToolResponse = exports.GetToolRequest = exports.CreateToolResponse = exports.CreateToolRequest = exports.ToolExecutionStatus = exports.ToolConfirmation = exports.ToolKind = exports.protobufPackage = void 0;
9
+ exports.toolKindFromJSON = toolKindFromJSON;
10
+ exports.toolKindToJSON = toolKindToJSON;
11
+ exports.toolConfirmationFromJSON = toolConfirmationFromJSON;
12
+ exports.toolConfirmationToJSON = toolConfirmationToJSON;
13
+ exports.toolExecutionStatusFromJSON = toolExecutionStatusFromJSON;
14
+ exports.toolExecutionStatusToJSON = toolExecutionStatusToJSON;
15
+ /* eslint-disable */
16
+ const wire_1 = require("@bufbuild/protobuf/wire");
17
+ const struct_pb_1 = require("../../../google/protobuf/struct.pb");
18
+ exports.protobufPackage = "weaveapi.tool.v1";
19
+ var ToolKind;
20
+ (function (ToolKind) {
21
+ ToolKind[ToolKind["TOOL_KIND_UNSPECIFIED"] = 0] = "TOOL_KIND_UNSPECIFIED";
22
+ ToolKind[ToolKind["TOOL_KIND_FUNCTION"] = 1] = "TOOL_KIND_FUNCTION";
23
+ ToolKind[ToolKind["TOOL_KIND_AGENT"] = 2] = "TOOL_KIND_AGENT";
24
+ ToolKind[ToolKind["TOOL_KIND_WORKFLOW"] = 3] = "TOOL_KIND_WORKFLOW";
25
+ ToolKind[ToolKind["TOOL_KIND_HTTP"] = 4] = "TOOL_KIND_HTTP";
26
+ ToolKind[ToolKind["TOOL_KIND_MCP"] = 5] = "TOOL_KIND_MCP";
27
+ ToolKind[ToolKind["TOOL_KIND_PROVIDER_NATIVE"] = 6] = "TOOL_KIND_PROVIDER_NATIVE";
28
+ ToolKind[ToolKind["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
29
+ })(ToolKind || (exports.ToolKind = ToolKind = {}));
30
+ function toolKindFromJSON(object) {
31
+ switch (object) {
32
+ case 0:
33
+ case "TOOL_KIND_UNSPECIFIED":
34
+ return ToolKind.TOOL_KIND_UNSPECIFIED;
35
+ case 1:
36
+ case "TOOL_KIND_FUNCTION":
37
+ return ToolKind.TOOL_KIND_FUNCTION;
38
+ case 2:
39
+ case "TOOL_KIND_AGENT":
40
+ return ToolKind.TOOL_KIND_AGENT;
41
+ case 3:
42
+ case "TOOL_KIND_WORKFLOW":
43
+ return ToolKind.TOOL_KIND_WORKFLOW;
44
+ case 4:
45
+ case "TOOL_KIND_HTTP":
46
+ return ToolKind.TOOL_KIND_HTTP;
47
+ case 5:
48
+ case "TOOL_KIND_MCP":
49
+ return ToolKind.TOOL_KIND_MCP;
50
+ case 6:
51
+ case "TOOL_KIND_PROVIDER_NATIVE":
52
+ return ToolKind.TOOL_KIND_PROVIDER_NATIVE;
53
+ case -1:
54
+ case "UNRECOGNIZED":
55
+ default:
56
+ return ToolKind.UNRECOGNIZED;
57
+ }
58
+ }
59
+ function toolKindToJSON(object) {
60
+ switch (object) {
61
+ case ToolKind.TOOL_KIND_UNSPECIFIED:
62
+ return "TOOL_KIND_UNSPECIFIED";
63
+ case ToolKind.TOOL_KIND_FUNCTION:
64
+ return "TOOL_KIND_FUNCTION";
65
+ case ToolKind.TOOL_KIND_AGENT:
66
+ return "TOOL_KIND_AGENT";
67
+ case ToolKind.TOOL_KIND_WORKFLOW:
68
+ return "TOOL_KIND_WORKFLOW";
69
+ case ToolKind.TOOL_KIND_HTTP:
70
+ return "TOOL_KIND_HTTP";
71
+ case ToolKind.TOOL_KIND_MCP:
72
+ return "TOOL_KIND_MCP";
73
+ case ToolKind.TOOL_KIND_PROVIDER_NATIVE:
74
+ return "TOOL_KIND_PROVIDER_NATIVE";
75
+ case ToolKind.UNRECOGNIZED:
76
+ default:
77
+ return "UNRECOGNIZED";
78
+ }
79
+ }
80
+ var ToolConfirmation;
81
+ (function (ToolConfirmation) {
82
+ ToolConfirmation[ToolConfirmation["TOOL_CONFIRMATION_UNSPECIFIED"] = 0] = "TOOL_CONFIRMATION_UNSPECIFIED";
83
+ ToolConfirmation[ToolConfirmation["TOOL_CONFIRMATION_NEVER"] = 1] = "TOOL_CONFIRMATION_NEVER";
84
+ ToolConfirmation[ToolConfirmation["TOOL_CONFIRMATION_ALWAYS"] = 2] = "TOOL_CONFIRMATION_ALWAYS";
85
+ ToolConfirmation[ToolConfirmation["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
86
+ })(ToolConfirmation || (exports.ToolConfirmation = ToolConfirmation = {}));
87
+ function toolConfirmationFromJSON(object) {
88
+ switch (object) {
89
+ case 0:
90
+ case "TOOL_CONFIRMATION_UNSPECIFIED":
91
+ return ToolConfirmation.TOOL_CONFIRMATION_UNSPECIFIED;
92
+ case 1:
93
+ case "TOOL_CONFIRMATION_NEVER":
94
+ return ToolConfirmation.TOOL_CONFIRMATION_NEVER;
95
+ case 2:
96
+ case "TOOL_CONFIRMATION_ALWAYS":
97
+ return ToolConfirmation.TOOL_CONFIRMATION_ALWAYS;
98
+ case -1:
99
+ case "UNRECOGNIZED":
100
+ default:
101
+ return ToolConfirmation.UNRECOGNIZED;
102
+ }
103
+ }
104
+ function toolConfirmationToJSON(object) {
105
+ switch (object) {
106
+ case ToolConfirmation.TOOL_CONFIRMATION_UNSPECIFIED:
107
+ return "TOOL_CONFIRMATION_UNSPECIFIED";
108
+ case ToolConfirmation.TOOL_CONFIRMATION_NEVER:
109
+ return "TOOL_CONFIRMATION_NEVER";
110
+ case ToolConfirmation.TOOL_CONFIRMATION_ALWAYS:
111
+ return "TOOL_CONFIRMATION_ALWAYS";
112
+ case ToolConfirmation.UNRECOGNIZED:
113
+ default:
114
+ return "UNRECOGNIZED";
115
+ }
116
+ }
117
+ var ToolExecutionStatus;
118
+ (function (ToolExecutionStatus) {
119
+ ToolExecutionStatus[ToolExecutionStatus["TOOL_EXECUTION_STATUS_UNSPECIFIED"] = 0] = "TOOL_EXECUTION_STATUS_UNSPECIFIED";
120
+ ToolExecutionStatus[ToolExecutionStatus["TOOL_EXECUTION_STATUS_SUCCESS"] = 1] = "TOOL_EXECUTION_STATUS_SUCCESS";
121
+ ToolExecutionStatus[ToolExecutionStatus["TOOL_EXECUTION_STATUS_FAILED"] = 2] = "TOOL_EXECUTION_STATUS_FAILED";
122
+ ToolExecutionStatus[ToolExecutionStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
123
+ })(ToolExecutionStatus || (exports.ToolExecutionStatus = ToolExecutionStatus = {}));
124
+ function toolExecutionStatusFromJSON(object) {
125
+ switch (object) {
126
+ case 0:
127
+ case "TOOL_EXECUTION_STATUS_UNSPECIFIED":
128
+ return ToolExecutionStatus.TOOL_EXECUTION_STATUS_UNSPECIFIED;
129
+ case 1:
130
+ case "TOOL_EXECUTION_STATUS_SUCCESS":
131
+ return ToolExecutionStatus.TOOL_EXECUTION_STATUS_SUCCESS;
132
+ case 2:
133
+ case "TOOL_EXECUTION_STATUS_FAILED":
134
+ return ToolExecutionStatus.TOOL_EXECUTION_STATUS_FAILED;
135
+ case -1:
136
+ case "UNRECOGNIZED":
137
+ default:
138
+ return ToolExecutionStatus.UNRECOGNIZED;
139
+ }
140
+ }
141
+ function toolExecutionStatusToJSON(object) {
142
+ switch (object) {
143
+ case ToolExecutionStatus.TOOL_EXECUTION_STATUS_UNSPECIFIED:
144
+ return "TOOL_EXECUTION_STATUS_UNSPECIFIED";
145
+ case ToolExecutionStatus.TOOL_EXECUTION_STATUS_SUCCESS:
146
+ return "TOOL_EXECUTION_STATUS_SUCCESS";
147
+ case ToolExecutionStatus.TOOL_EXECUTION_STATUS_FAILED:
148
+ return "TOOL_EXECUTION_STATUS_FAILED";
149
+ case ToolExecutionStatus.UNRECOGNIZED:
150
+ default:
151
+ return "UNRECOGNIZED";
152
+ }
153
+ }
154
+ function createBaseCreateToolRequest() {
155
+ return {
156
+ slug: "",
157
+ name: "",
158
+ kind: 0,
159
+ description: "",
160
+ inputSchema: undefined,
161
+ outputSchema: undefined,
162
+ configuration: undefined,
163
+ };
164
+ }
165
+ exports.CreateToolRequest = {
166
+ encode(message, writer = new wire_1.BinaryWriter()) {
167
+ if (message.slug !== "") {
168
+ writer.uint32(10).string(message.slug);
169
+ }
170
+ if (message.name !== "") {
171
+ writer.uint32(18).string(message.name);
172
+ }
173
+ if (message.kind !== 0) {
174
+ writer.uint32(24).int32(message.kind);
175
+ }
176
+ if (message.description !== "") {
177
+ writer.uint32(34).string(message.description);
178
+ }
179
+ if (message.inputSchema !== undefined) {
180
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.inputSchema), writer.uint32(42).fork()).join();
181
+ }
182
+ if (message.outputSchema !== undefined) {
183
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.outputSchema), writer.uint32(50).fork()).join();
184
+ }
185
+ if (message.configuration !== undefined) {
186
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.configuration), writer.uint32(58).fork()).join();
187
+ }
188
+ return writer;
189
+ },
190
+ decode(input, length) {
191
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
192
+ const end = length === undefined ? reader.len : reader.pos + length;
193
+ const message = createBaseCreateToolRequest();
194
+ while (reader.pos < end) {
195
+ const tag = reader.uint32();
196
+ switch (tag >>> 3) {
197
+ case 1: {
198
+ if (tag !== 10) {
199
+ break;
200
+ }
201
+ message.slug = reader.string();
202
+ continue;
203
+ }
204
+ case 2: {
205
+ if (tag !== 18) {
206
+ break;
207
+ }
208
+ message.name = reader.string();
209
+ continue;
210
+ }
211
+ case 3: {
212
+ if (tag !== 24) {
213
+ break;
214
+ }
215
+ message.kind = reader.int32();
216
+ continue;
217
+ }
218
+ case 4: {
219
+ if (tag !== 34) {
220
+ break;
221
+ }
222
+ message.description = reader.string();
223
+ continue;
224
+ }
225
+ case 5: {
226
+ if (tag !== 42) {
227
+ break;
228
+ }
229
+ message.inputSchema = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
230
+ continue;
231
+ }
232
+ case 6: {
233
+ if (tag !== 50) {
234
+ break;
235
+ }
236
+ message.outputSchema = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
237
+ continue;
238
+ }
239
+ case 7: {
240
+ if (tag !== 58) {
241
+ break;
242
+ }
243
+ message.configuration = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
244
+ continue;
245
+ }
246
+ }
247
+ if ((tag & 7) === 4 || tag === 0) {
248
+ break;
249
+ }
250
+ reader.skip(tag & 7);
251
+ }
252
+ return message;
253
+ },
254
+ fromJSON(object) {
255
+ return {
256
+ slug: isSet(object.slug) ? globalThis.String(object.slug) : "",
257
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
258
+ kind: isSet(object.kind) ? toolKindFromJSON(object.kind) : 0,
259
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
260
+ inputSchema: isObject(object.inputSchema)
261
+ ? object.inputSchema
262
+ : isObject(object.input_schema)
263
+ ? object.input_schema
264
+ : undefined,
265
+ outputSchema: isObject(object.outputSchema)
266
+ ? object.outputSchema
267
+ : isObject(object.output_schema)
268
+ ? object.output_schema
269
+ : undefined,
270
+ configuration: isObject(object.configuration) ? object.configuration : undefined,
271
+ };
272
+ },
273
+ toJSON(message) {
274
+ const obj = {};
275
+ if (message.slug !== "") {
276
+ obj.slug = message.slug;
277
+ }
278
+ if (message.name !== "") {
279
+ obj.name = message.name;
280
+ }
281
+ if (message.kind !== 0) {
282
+ obj.kind = toolKindToJSON(message.kind);
283
+ }
284
+ if (message.description !== "") {
285
+ obj.description = message.description;
286
+ }
287
+ if (message.inputSchema !== undefined) {
288
+ obj.inputSchema = message.inputSchema;
289
+ }
290
+ if (message.outputSchema !== undefined) {
291
+ obj.outputSchema = message.outputSchema;
292
+ }
293
+ if (message.configuration !== undefined) {
294
+ obj.configuration = message.configuration;
295
+ }
296
+ return obj;
297
+ },
298
+ create(base) {
299
+ return exports.CreateToolRequest.fromPartial(base !== null && base !== void 0 ? base : {});
300
+ },
301
+ fromPartial(object) {
302
+ var _a, _b, _c, _d, _e, _f, _g;
303
+ const message = createBaseCreateToolRequest();
304
+ message.slug = (_a = object.slug) !== null && _a !== void 0 ? _a : "";
305
+ message.name = (_b = object.name) !== null && _b !== void 0 ? _b : "";
306
+ message.kind = (_c = object.kind) !== null && _c !== void 0 ? _c : 0;
307
+ message.description = (_d = object.description) !== null && _d !== void 0 ? _d : "";
308
+ message.inputSchema = (_e = object.inputSchema) !== null && _e !== void 0 ? _e : undefined;
309
+ message.outputSchema = (_f = object.outputSchema) !== null && _f !== void 0 ? _f : undefined;
310
+ message.configuration = (_g = object.configuration) !== null && _g !== void 0 ? _g : undefined;
311
+ return message;
312
+ },
313
+ };
314
+ function createBaseCreateToolResponse() {
315
+ return { tool: undefined };
316
+ }
317
+ exports.CreateToolResponse = {
318
+ encode(message, writer = new wire_1.BinaryWriter()) {
319
+ if (message.tool !== undefined) {
320
+ exports.Tool.encode(message.tool, writer.uint32(10).fork()).join();
321
+ }
322
+ return writer;
323
+ },
324
+ decode(input, length) {
325
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
326
+ const end = length === undefined ? reader.len : reader.pos + length;
327
+ const message = createBaseCreateToolResponse();
328
+ while (reader.pos < end) {
329
+ const tag = reader.uint32();
330
+ switch (tag >>> 3) {
331
+ case 1: {
332
+ if (tag !== 10) {
333
+ break;
334
+ }
335
+ message.tool = exports.Tool.decode(reader, reader.uint32());
336
+ continue;
337
+ }
338
+ }
339
+ if ((tag & 7) === 4 || tag === 0) {
340
+ break;
341
+ }
342
+ reader.skip(tag & 7);
343
+ }
344
+ return message;
345
+ },
346
+ fromJSON(object) {
347
+ return { tool: isSet(object.tool) ? exports.Tool.fromJSON(object.tool) : undefined };
348
+ },
349
+ toJSON(message) {
350
+ const obj = {};
351
+ if (message.tool !== undefined) {
352
+ obj.tool = exports.Tool.toJSON(message.tool);
353
+ }
354
+ return obj;
355
+ },
356
+ create(base) {
357
+ return exports.CreateToolResponse.fromPartial(base !== null && base !== void 0 ? base : {});
358
+ },
359
+ fromPartial(object) {
360
+ const message = createBaseCreateToolResponse();
361
+ message.tool = (object.tool !== undefined && object.tool !== null) ? exports.Tool.fromPartial(object.tool) : undefined;
362
+ return message;
363
+ },
364
+ };
365
+ function createBaseGetToolRequest() {
366
+ return { toolId: "" };
367
+ }
368
+ exports.GetToolRequest = {
369
+ encode(message, writer = new wire_1.BinaryWriter()) {
370
+ if (message.toolId !== "") {
371
+ writer.uint32(10).string(message.toolId);
372
+ }
373
+ return writer;
374
+ },
375
+ decode(input, length) {
376
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
377
+ const end = length === undefined ? reader.len : reader.pos + length;
378
+ const message = createBaseGetToolRequest();
379
+ while (reader.pos < end) {
380
+ const tag = reader.uint32();
381
+ switch (tag >>> 3) {
382
+ case 1: {
383
+ if (tag !== 10) {
384
+ break;
385
+ }
386
+ message.toolId = reader.string();
387
+ continue;
388
+ }
389
+ }
390
+ if ((tag & 7) === 4 || tag === 0) {
391
+ break;
392
+ }
393
+ reader.skip(tag & 7);
394
+ }
395
+ return message;
396
+ },
397
+ fromJSON(object) {
398
+ return {
399
+ toolId: isSet(object.toolId)
400
+ ? globalThis.String(object.toolId)
401
+ : isSet(object.tool_id)
402
+ ? globalThis.String(object.tool_id)
403
+ : "",
404
+ };
405
+ },
406
+ toJSON(message) {
407
+ const obj = {};
408
+ if (message.toolId !== "") {
409
+ obj.toolId = message.toolId;
410
+ }
411
+ return obj;
412
+ },
413
+ create(base) {
414
+ return exports.GetToolRequest.fromPartial(base !== null && base !== void 0 ? base : {});
415
+ },
416
+ fromPartial(object) {
417
+ var _a;
418
+ const message = createBaseGetToolRequest();
419
+ message.toolId = (_a = object.toolId) !== null && _a !== void 0 ? _a : "";
420
+ return message;
421
+ },
422
+ };
423
+ function createBaseGetToolResponse() {
424
+ return { tool: undefined };
425
+ }
426
+ exports.GetToolResponse = {
427
+ encode(message, writer = new wire_1.BinaryWriter()) {
428
+ if (message.tool !== undefined) {
429
+ exports.Tool.encode(message.tool, writer.uint32(10).fork()).join();
430
+ }
431
+ return writer;
432
+ },
433
+ decode(input, length) {
434
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
435
+ const end = length === undefined ? reader.len : reader.pos + length;
436
+ const message = createBaseGetToolResponse();
437
+ while (reader.pos < end) {
438
+ const tag = reader.uint32();
439
+ switch (tag >>> 3) {
440
+ case 1: {
441
+ if (tag !== 10) {
442
+ break;
443
+ }
444
+ message.tool = exports.Tool.decode(reader, reader.uint32());
445
+ continue;
446
+ }
447
+ }
448
+ if ((tag & 7) === 4 || tag === 0) {
449
+ break;
450
+ }
451
+ reader.skip(tag & 7);
452
+ }
453
+ return message;
454
+ },
455
+ fromJSON(object) {
456
+ return { tool: isSet(object.tool) ? exports.Tool.fromJSON(object.tool) : undefined };
457
+ },
458
+ toJSON(message) {
459
+ const obj = {};
460
+ if (message.tool !== undefined) {
461
+ obj.tool = exports.Tool.toJSON(message.tool);
462
+ }
463
+ return obj;
464
+ },
465
+ create(base) {
466
+ return exports.GetToolResponse.fromPartial(base !== null && base !== void 0 ? base : {});
467
+ },
468
+ fromPartial(object) {
469
+ const message = createBaseGetToolResponse();
470
+ message.tool = (object.tool !== undefined && object.tool !== null) ? exports.Tool.fromPartial(object.tool) : undefined;
471
+ return message;
472
+ },
473
+ };
474
+ function createBaseUpdateToolRequest() {
475
+ return {
476
+ toolId: "",
477
+ slug: "",
478
+ name: "",
479
+ kind: 0,
480
+ description: "",
481
+ inputSchema: undefined,
482
+ outputSchema: undefined,
483
+ configuration: undefined,
484
+ };
485
+ }
486
+ exports.UpdateToolRequest = {
487
+ encode(message, writer = new wire_1.BinaryWriter()) {
488
+ if (message.toolId !== "") {
489
+ writer.uint32(10).string(message.toolId);
490
+ }
491
+ if (message.slug !== "") {
492
+ writer.uint32(18).string(message.slug);
493
+ }
494
+ if (message.name !== "") {
495
+ writer.uint32(26).string(message.name);
496
+ }
497
+ if (message.kind !== 0) {
498
+ writer.uint32(32).int32(message.kind);
499
+ }
500
+ if (message.description !== "") {
501
+ writer.uint32(42).string(message.description);
502
+ }
503
+ if (message.inputSchema !== undefined) {
504
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.inputSchema), writer.uint32(50).fork()).join();
505
+ }
506
+ if (message.outputSchema !== undefined) {
507
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.outputSchema), writer.uint32(58).fork()).join();
508
+ }
509
+ if (message.configuration !== undefined) {
510
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.configuration), writer.uint32(66).fork()).join();
511
+ }
512
+ return writer;
513
+ },
514
+ decode(input, length) {
515
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
516
+ const end = length === undefined ? reader.len : reader.pos + length;
517
+ const message = createBaseUpdateToolRequest();
518
+ while (reader.pos < end) {
519
+ const tag = reader.uint32();
520
+ switch (tag >>> 3) {
521
+ case 1: {
522
+ if (tag !== 10) {
523
+ break;
524
+ }
525
+ message.toolId = reader.string();
526
+ continue;
527
+ }
528
+ case 2: {
529
+ if (tag !== 18) {
530
+ break;
531
+ }
532
+ message.slug = reader.string();
533
+ continue;
534
+ }
535
+ case 3: {
536
+ if (tag !== 26) {
537
+ break;
538
+ }
539
+ message.name = reader.string();
540
+ continue;
541
+ }
542
+ case 4: {
543
+ if (tag !== 32) {
544
+ break;
545
+ }
546
+ message.kind = reader.int32();
547
+ continue;
548
+ }
549
+ case 5: {
550
+ if (tag !== 42) {
551
+ break;
552
+ }
553
+ message.description = reader.string();
554
+ continue;
555
+ }
556
+ case 6: {
557
+ if (tag !== 50) {
558
+ break;
559
+ }
560
+ message.inputSchema = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
561
+ continue;
562
+ }
563
+ case 7: {
564
+ if (tag !== 58) {
565
+ break;
566
+ }
567
+ message.outputSchema = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
568
+ continue;
569
+ }
570
+ case 8: {
571
+ if (tag !== 66) {
572
+ break;
573
+ }
574
+ message.configuration = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
575
+ continue;
576
+ }
577
+ }
578
+ if ((tag & 7) === 4 || tag === 0) {
579
+ break;
580
+ }
581
+ reader.skip(tag & 7);
582
+ }
583
+ return message;
584
+ },
585
+ fromJSON(object) {
586
+ return {
587
+ toolId: isSet(object.toolId)
588
+ ? globalThis.String(object.toolId)
589
+ : isSet(object.tool_id)
590
+ ? globalThis.String(object.tool_id)
591
+ : "",
592
+ slug: isSet(object.slug) ? globalThis.String(object.slug) : "",
593
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
594
+ kind: isSet(object.kind) ? toolKindFromJSON(object.kind) : 0,
595
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
596
+ inputSchema: isObject(object.inputSchema)
597
+ ? object.inputSchema
598
+ : isObject(object.input_schema)
599
+ ? object.input_schema
600
+ : undefined,
601
+ outputSchema: isObject(object.outputSchema)
602
+ ? object.outputSchema
603
+ : isObject(object.output_schema)
604
+ ? object.output_schema
605
+ : undefined,
606
+ configuration: isObject(object.configuration) ? object.configuration : undefined,
607
+ };
608
+ },
609
+ toJSON(message) {
610
+ const obj = {};
611
+ if (message.toolId !== "") {
612
+ obj.toolId = message.toolId;
613
+ }
614
+ if (message.slug !== "") {
615
+ obj.slug = message.slug;
616
+ }
617
+ if (message.name !== "") {
618
+ obj.name = message.name;
619
+ }
620
+ if (message.kind !== 0) {
621
+ obj.kind = toolKindToJSON(message.kind);
622
+ }
623
+ if (message.description !== "") {
624
+ obj.description = message.description;
625
+ }
626
+ if (message.inputSchema !== undefined) {
627
+ obj.inputSchema = message.inputSchema;
628
+ }
629
+ if (message.outputSchema !== undefined) {
630
+ obj.outputSchema = message.outputSchema;
631
+ }
632
+ if (message.configuration !== undefined) {
633
+ obj.configuration = message.configuration;
634
+ }
635
+ return obj;
636
+ },
637
+ create(base) {
638
+ return exports.UpdateToolRequest.fromPartial(base !== null && base !== void 0 ? base : {});
639
+ },
640
+ fromPartial(object) {
641
+ var _a, _b, _c, _d, _e, _f, _g, _h;
642
+ const message = createBaseUpdateToolRequest();
643
+ message.toolId = (_a = object.toolId) !== null && _a !== void 0 ? _a : "";
644
+ message.slug = (_b = object.slug) !== null && _b !== void 0 ? _b : "";
645
+ message.name = (_c = object.name) !== null && _c !== void 0 ? _c : "";
646
+ message.kind = (_d = object.kind) !== null && _d !== void 0 ? _d : 0;
647
+ message.description = (_e = object.description) !== null && _e !== void 0 ? _e : "";
648
+ message.inputSchema = (_f = object.inputSchema) !== null && _f !== void 0 ? _f : undefined;
649
+ message.outputSchema = (_g = object.outputSchema) !== null && _g !== void 0 ? _g : undefined;
650
+ message.configuration = (_h = object.configuration) !== null && _h !== void 0 ? _h : undefined;
651
+ return message;
652
+ },
653
+ };
654
+ function createBaseUpdateToolResponse() {
655
+ return { tool: undefined };
656
+ }
657
+ exports.UpdateToolResponse = {
658
+ encode(message, writer = new wire_1.BinaryWriter()) {
659
+ if (message.tool !== undefined) {
660
+ exports.Tool.encode(message.tool, writer.uint32(10).fork()).join();
661
+ }
662
+ return writer;
663
+ },
664
+ decode(input, length) {
665
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
666
+ const end = length === undefined ? reader.len : reader.pos + length;
667
+ const message = createBaseUpdateToolResponse();
668
+ while (reader.pos < end) {
669
+ const tag = reader.uint32();
670
+ switch (tag >>> 3) {
671
+ case 1: {
672
+ if (tag !== 10) {
673
+ break;
674
+ }
675
+ message.tool = exports.Tool.decode(reader, reader.uint32());
676
+ continue;
677
+ }
678
+ }
679
+ if ((tag & 7) === 4 || tag === 0) {
680
+ break;
681
+ }
682
+ reader.skip(tag & 7);
683
+ }
684
+ return message;
685
+ },
686
+ fromJSON(object) {
687
+ return { tool: isSet(object.tool) ? exports.Tool.fromJSON(object.tool) : undefined };
688
+ },
689
+ toJSON(message) {
690
+ const obj = {};
691
+ if (message.tool !== undefined) {
692
+ obj.tool = exports.Tool.toJSON(message.tool);
693
+ }
694
+ return obj;
695
+ },
696
+ create(base) {
697
+ return exports.UpdateToolResponse.fromPartial(base !== null && base !== void 0 ? base : {});
698
+ },
699
+ fromPartial(object) {
700
+ const message = createBaseUpdateToolResponse();
701
+ message.tool = (object.tool !== undefined && object.tool !== null) ? exports.Tool.fromPartial(object.tool) : undefined;
702
+ return message;
703
+ },
704
+ };
705
+ function createBaseDeleteToolRequest() {
706
+ return { toolId: "" };
707
+ }
708
+ exports.DeleteToolRequest = {
709
+ encode(message, writer = new wire_1.BinaryWriter()) {
710
+ if (message.toolId !== "") {
711
+ writer.uint32(10).string(message.toolId);
712
+ }
713
+ return writer;
714
+ },
715
+ decode(input, length) {
716
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
717
+ const end = length === undefined ? reader.len : reader.pos + length;
718
+ const message = createBaseDeleteToolRequest();
719
+ while (reader.pos < end) {
720
+ const tag = reader.uint32();
721
+ switch (tag >>> 3) {
722
+ case 1: {
723
+ if (tag !== 10) {
724
+ break;
725
+ }
726
+ message.toolId = reader.string();
727
+ continue;
728
+ }
729
+ }
730
+ if ((tag & 7) === 4 || tag === 0) {
731
+ break;
732
+ }
733
+ reader.skip(tag & 7);
734
+ }
735
+ return message;
736
+ },
737
+ fromJSON(object) {
738
+ return {
739
+ toolId: isSet(object.toolId)
740
+ ? globalThis.String(object.toolId)
741
+ : isSet(object.tool_id)
742
+ ? globalThis.String(object.tool_id)
743
+ : "",
744
+ };
745
+ },
746
+ toJSON(message) {
747
+ const obj = {};
748
+ if (message.toolId !== "") {
749
+ obj.toolId = message.toolId;
750
+ }
751
+ return obj;
752
+ },
753
+ create(base) {
754
+ return exports.DeleteToolRequest.fromPartial(base !== null && base !== void 0 ? base : {});
755
+ },
756
+ fromPartial(object) {
757
+ var _a;
758
+ const message = createBaseDeleteToolRequest();
759
+ message.toolId = (_a = object.toolId) !== null && _a !== void 0 ? _a : "";
760
+ return message;
761
+ },
762
+ };
763
+ function createBaseDeleteToolResponse() {
764
+ return {};
765
+ }
766
+ exports.DeleteToolResponse = {
767
+ encode(_, writer = new wire_1.BinaryWriter()) {
768
+ return writer;
769
+ },
770
+ decode(input, length) {
771
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
772
+ const end = length === undefined ? reader.len : reader.pos + length;
773
+ const message = createBaseDeleteToolResponse();
774
+ while (reader.pos < end) {
775
+ const tag = reader.uint32();
776
+ switch (tag >>> 3) {
777
+ }
778
+ if ((tag & 7) === 4 || tag === 0) {
779
+ break;
780
+ }
781
+ reader.skip(tag & 7);
782
+ }
783
+ return message;
784
+ },
785
+ fromJSON(_) {
786
+ return {};
787
+ },
788
+ toJSON(_) {
789
+ const obj = {};
790
+ return obj;
791
+ },
792
+ create(base) {
793
+ return exports.DeleteToolResponse.fromPartial(base !== null && base !== void 0 ? base : {});
794
+ },
795
+ fromPartial(_) {
796
+ const message = createBaseDeleteToolResponse();
797
+ return message;
798
+ },
799
+ };
800
+ function createBaseListToolsRequest() {
801
+ return { pageSize: 0, pageOffset: 0 };
802
+ }
803
+ exports.ListToolsRequest = {
804
+ encode(message, writer = new wire_1.BinaryWriter()) {
805
+ if (message.pageSize !== 0) {
806
+ writer.uint32(8).int32(message.pageSize);
807
+ }
808
+ if (message.pageOffset !== 0) {
809
+ writer.uint32(16).int32(message.pageOffset);
810
+ }
811
+ return writer;
812
+ },
813
+ decode(input, length) {
814
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
815
+ const end = length === undefined ? reader.len : reader.pos + length;
816
+ const message = createBaseListToolsRequest();
817
+ while (reader.pos < end) {
818
+ const tag = reader.uint32();
819
+ switch (tag >>> 3) {
820
+ case 1: {
821
+ if (tag !== 8) {
822
+ break;
823
+ }
824
+ message.pageSize = reader.int32();
825
+ continue;
826
+ }
827
+ case 2: {
828
+ if (tag !== 16) {
829
+ break;
830
+ }
831
+ message.pageOffset = reader.int32();
832
+ continue;
833
+ }
834
+ }
835
+ if ((tag & 7) === 4 || tag === 0) {
836
+ break;
837
+ }
838
+ reader.skip(tag & 7);
839
+ }
840
+ return message;
841
+ },
842
+ fromJSON(object) {
843
+ return {
844
+ pageSize: isSet(object.pageSize)
845
+ ? globalThis.Number(object.pageSize)
846
+ : isSet(object.page_size)
847
+ ? globalThis.Number(object.page_size)
848
+ : 0,
849
+ pageOffset: isSet(object.pageOffset)
850
+ ? globalThis.Number(object.pageOffset)
851
+ : isSet(object.page_offset)
852
+ ? globalThis.Number(object.page_offset)
853
+ : 0,
854
+ };
855
+ },
856
+ toJSON(message) {
857
+ const obj = {};
858
+ if (message.pageSize !== 0) {
859
+ obj.pageSize = Math.round(message.pageSize);
860
+ }
861
+ if (message.pageOffset !== 0) {
862
+ obj.pageOffset = Math.round(message.pageOffset);
863
+ }
864
+ return obj;
865
+ },
866
+ create(base) {
867
+ return exports.ListToolsRequest.fromPartial(base !== null && base !== void 0 ? base : {});
868
+ },
869
+ fromPartial(object) {
870
+ var _a, _b;
871
+ const message = createBaseListToolsRequest();
872
+ message.pageSize = (_a = object.pageSize) !== null && _a !== void 0 ? _a : 0;
873
+ message.pageOffset = (_b = object.pageOffset) !== null && _b !== void 0 ? _b : 0;
874
+ return message;
875
+ },
876
+ };
877
+ function createBaseListToolsResponse() {
878
+ return { tools: [] };
879
+ }
880
+ exports.ListToolsResponse = {
881
+ encode(message, writer = new wire_1.BinaryWriter()) {
882
+ for (const v of message.tools) {
883
+ exports.Tool.encode(v, writer.uint32(10).fork()).join();
884
+ }
885
+ return writer;
886
+ },
887
+ decode(input, length) {
888
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
889
+ const end = length === undefined ? reader.len : reader.pos + length;
890
+ const message = createBaseListToolsResponse();
891
+ while (reader.pos < end) {
892
+ const tag = reader.uint32();
893
+ switch (tag >>> 3) {
894
+ case 1: {
895
+ if (tag !== 10) {
896
+ break;
897
+ }
898
+ message.tools.push(exports.Tool.decode(reader, reader.uint32()));
899
+ continue;
900
+ }
901
+ }
902
+ if ((tag & 7) === 4 || tag === 0) {
903
+ break;
904
+ }
905
+ reader.skip(tag & 7);
906
+ }
907
+ return message;
908
+ },
909
+ fromJSON(object) {
910
+ return { tools: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.tools) ? object.tools.map((e) => exports.Tool.fromJSON(e)) : [] };
911
+ },
912
+ toJSON(message) {
913
+ var _a;
914
+ const obj = {};
915
+ if ((_a = message.tools) === null || _a === void 0 ? void 0 : _a.length) {
916
+ obj.tools = message.tools.map((e) => exports.Tool.toJSON(e));
917
+ }
918
+ return obj;
919
+ },
920
+ create(base) {
921
+ return exports.ListToolsResponse.fromPartial(base !== null && base !== void 0 ? base : {});
922
+ },
923
+ fromPartial(object) {
924
+ var _a;
925
+ const message = createBaseListToolsResponse();
926
+ message.tools = ((_a = object.tools) === null || _a === void 0 ? void 0 : _a.map((e) => exports.Tool.fromPartial(e))) || [];
927
+ return message;
928
+ },
929
+ };
930
+ function createBaseAttachAgentToolRequest() {
931
+ return { agentId: "", toolId: "", configuration: undefined, confirmation: 0 };
932
+ }
933
+ exports.AttachAgentToolRequest = {
934
+ encode(message, writer = new wire_1.BinaryWriter()) {
935
+ if (message.agentId !== "") {
936
+ writer.uint32(10).string(message.agentId);
937
+ }
938
+ if (message.toolId !== "") {
939
+ writer.uint32(18).string(message.toolId);
940
+ }
941
+ if (message.configuration !== undefined) {
942
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.configuration), writer.uint32(26).fork()).join();
943
+ }
944
+ if (message.confirmation !== 0) {
945
+ writer.uint32(32).int32(message.confirmation);
946
+ }
947
+ return writer;
948
+ },
949
+ decode(input, length) {
950
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
951
+ const end = length === undefined ? reader.len : reader.pos + length;
952
+ const message = createBaseAttachAgentToolRequest();
953
+ while (reader.pos < end) {
954
+ const tag = reader.uint32();
955
+ switch (tag >>> 3) {
956
+ case 1: {
957
+ if (tag !== 10) {
958
+ break;
959
+ }
960
+ message.agentId = reader.string();
961
+ continue;
962
+ }
963
+ case 2: {
964
+ if (tag !== 18) {
965
+ break;
966
+ }
967
+ message.toolId = reader.string();
968
+ continue;
969
+ }
970
+ case 3: {
971
+ if (tag !== 26) {
972
+ break;
973
+ }
974
+ message.configuration = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
975
+ continue;
976
+ }
977
+ case 4: {
978
+ if (tag !== 32) {
979
+ break;
980
+ }
981
+ message.confirmation = reader.int32();
982
+ continue;
983
+ }
984
+ }
985
+ if ((tag & 7) === 4 || tag === 0) {
986
+ break;
987
+ }
988
+ reader.skip(tag & 7);
989
+ }
990
+ return message;
991
+ },
992
+ fromJSON(object) {
993
+ return {
994
+ agentId: isSet(object.agentId)
995
+ ? globalThis.String(object.agentId)
996
+ : isSet(object.agent_id)
997
+ ? globalThis.String(object.agent_id)
998
+ : "",
999
+ toolId: isSet(object.toolId)
1000
+ ? globalThis.String(object.toolId)
1001
+ : isSet(object.tool_id)
1002
+ ? globalThis.String(object.tool_id)
1003
+ : "",
1004
+ configuration: isObject(object.configuration) ? object.configuration : undefined,
1005
+ confirmation: isSet(object.confirmation) ? toolConfirmationFromJSON(object.confirmation) : 0,
1006
+ };
1007
+ },
1008
+ toJSON(message) {
1009
+ const obj = {};
1010
+ if (message.agentId !== "") {
1011
+ obj.agentId = message.agentId;
1012
+ }
1013
+ if (message.toolId !== "") {
1014
+ obj.toolId = message.toolId;
1015
+ }
1016
+ if (message.configuration !== undefined) {
1017
+ obj.configuration = message.configuration;
1018
+ }
1019
+ if (message.confirmation !== 0) {
1020
+ obj.confirmation = toolConfirmationToJSON(message.confirmation);
1021
+ }
1022
+ return obj;
1023
+ },
1024
+ create(base) {
1025
+ return exports.AttachAgentToolRequest.fromPartial(base !== null && base !== void 0 ? base : {});
1026
+ },
1027
+ fromPartial(object) {
1028
+ var _a, _b, _c, _d;
1029
+ const message = createBaseAttachAgentToolRequest();
1030
+ message.agentId = (_a = object.agentId) !== null && _a !== void 0 ? _a : "";
1031
+ message.toolId = (_b = object.toolId) !== null && _b !== void 0 ? _b : "";
1032
+ message.configuration = (_c = object.configuration) !== null && _c !== void 0 ? _c : undefined;
1033
+ message.confirmation = (_d = object.confirmation) !== null && _d !== void 0 ? _d : 0;
1034
+ return message;
1035
+ },
1036
+ };
1037
+ function createBaseAttachAgentToolResponse() {
1038
+ return { agentTool: undefined };
1039
+ }
1040
+ exports.AttachAgentToolResponse = {
1041
+ encode(message, writer = new wire_1.BinaryWriter()) {
1042
+ if (message.agentTool !== undefined) {
1043
+ exports.AgentTool.encode(message.agentTool, writer.uint32(10).fork()).join();
1044
+ }
1045
+ return writer;
1046
+ },
1047
+ decode(input, length) {
1048
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1049
+ const end = length === undefined ? reader.len : reader.pos + length;
1050
+ const message = createBaseAttachAgentToolResponse();
1051
+ while (reader.pos < end) {
1052
+ const tag = reader.uint32();
1053
+ switch (tag >>> 3) {
1054
+ case 1: {
1055
+ if (tag !== 10) {
1056
+ break;
1057
+ }
1058
+ message.agentTool = exports.AgentTool.decode(reader, reader.uint32());
1059
+ continue;
1060
+ }
1061
+ }
1062
+ if ((tag & 7) === 4 || tag === 0) {
1063
+ break;
1064
+ }
1065
+ reader.skip(tag & 7);
1066
+ }
1067
+ return message;
1068
+ },
1069
+ fromJSON(object) {
1070
+ return {
1071
+ agentTool: isSet(object.agentTool)
1072
+ ? exports.AgentTool.fromJSON(object.agentTool)
1073
+ : isSet(object.agent_tool)
1074
+ ? exports.AgentTool.fromJSON(object.agent_tool)
1075
+ : undefined,
1076
+ };
1077
+ },
1078
+ toJSON(message) {
1079
+ const obj = {};
1080
+ if (message.agentTool !== undefined) {
1081
+ obj.agentTool = exports.AgentTool.toJSON(message.agentTool);
1082
+ }
1083
+ return obj;
1084
+ },
1085
+ create(base) {
1086
+ return exports.AttachAgentToolResponse.fromPartial(base !== null && base !== void 0 ? base : {});
1087
+ },
1088
+ fromPartial(object) {
1089
+ const message = createBaseAttachAgentToolResponse();
1090
+ message.agentTool = (object.agentTool !== undefined && object.agentTool !== null)
1091
+ ? exports.AgentTool.fromPartial(object.agentTool)
1092
+ : undefined;
1093
+ return message;
1094
+ },
1095
+ };
1096
+ function createBaseListAgentToolsRequest() {
1097
+ return { agentId: "" };
1098
+ }
1099
+ exports.ListAgentToolsRequest = {
1100
+ encode(message, writer = new wire_1.BinaryWriter()) {
1101
+ if (message.agentId !== "") {
1102
+ writer.uint32(10).string(message.agentId);
1103
+ }
1104
+ return writer;
1105
+ },
1106
+ decode(input, length) {
1107
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1108
+ const end = length === undefined ? reader.len : reader.pos + length;
1109
+ const message = createBaseListAgentToolsRequest();
1110
+ while (reader.pos < end) {
1111
+ const tag = reader.uint32();
1112
+ switch (tag >>> 3) {
1113
+ case 1: {
1114
+ if (tag !== 10) {
1115
+ break;
1116
+ }
1117
+ message.agentId = reader.string();
1118
+ continue;
1119
+ }
1120
+ }
1121
+ if ((tag & 7) === 4 || tag === 0) {
1122
+ break;
1123
+ }
1124
+ reader.skip(tag & 7);
1125
+ }
1126
+ return message;
1127
+ },
1128
+ fromJSON(object) {
1129
+ return {
1130
+ agentId: isSet(object.agentId)
1131
+ ? globalThis.String(object.agentId)
1132
+ : isSet(object.agent_id)
1133
+ ? globalThis.String(object.agent_id)
1134
+ : "",
1135
+ };
1136
+ },
1137
+ toJSON(message) {
1138
+ const obj = {};
1139
+ if (message.agentId !== "") {
1140
+ obj.agentId = message.agentId;
1141
+ }
1142
+ return obj;
1143
+ },
1144
+ create(base) {
1145
+ return exports.ListAgentToolsRequest.fromPartial(base !== null && base !== void 0 ? base : {});
1146
+ },
1147
+ fromPartial(object) {
1148
+ var _a;
1149
+ const message = createBaseListAgentToolsRequest();
1150
+ message.agentId = (_a = object.agentId) !== null && _a !== void 0 ? _a : "";
1151
+ return message;
1152
+ },
1153
+ };
1154
+ function createBaseListAgentToolsResponse() {
1155
+ return { agentTools: [] };
1156
+ }
1157
+ exports.ListAgentToolsResponse = {
1158
+ encode(message, writer = new wire_1.BinaryWriter()) {
1159
+ for (const v of message.agentTools) {
1160
+ exports.AgentTool.encode(v, writer.uint32(10).fork()).join();
1161
+ }
1162
+ return writer;
1163
+ },
1164
+ decode(input, length) {
1165
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1166
+ const end = length === undefined ? reader.len : reader.pos + length;
1167
+ const message = createBaseListAgentToolsResponse();
1168
+ while (reader.pos < end) {
1169
+ const tag = reader.uint32();
1170
+ switch (tag >>> 3) {
1171
+ case 1: {
1172
+ if (tag !== 10) {
1173
+ break;
1174
+ }
1175
+ message.agentTools.push(exports.AgentTool.decode(reader, reader.uint32()));
1176
+ continue;
1177
+ }
1178
+ }
1179
+ if ((tag & 7) === 4 || tag === 0) {
1180
+ break;
1181
+ }
1182
+ reader.skip(tag & 7);
1183
+ }
1184
+ return message;
1185
+ },
1186
+ fromJSON(object) {
1187
+ return {
1188
+ agentTools: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.agentTools)
1189
+ ? object.agentTools.map((e) => exports.AgentTool.fromJSON(e))
1190
+ : globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.agent_tools)
1191
+ ? object.agent_tools.map((e) => exports.AgentTool.fromJSON(e))
1192
+ : [],
1193
+ };
1194
+ },
1195
+ toJSON(message) {
1196
+ var _a;
1197
+ const obj = {};
1198
+ if ((_a = message.agentTools) === null || _a === void 0 ? void 0 : _a.length) {
1199
+ obj.agentTools = message.agentTools.map((e) => exports.AgentTool.toJSON(e));
1200
+ }
1201
+ return obj;
1202
+ },
1203
+ create(base) {
1204
+ return exports.ListAgentToolsResponse.fromPartial(base !== null && base !== void 0 ? base : {});
1205
+ },
1206
+ fromPartial(object) {
1207
+ var _a;
1208
+ const message = createBaseListAgentToolsResponse();
1209
+ message.agentTools = ((_a = object.agentTools) === null || _a === void 0 ? void 0 : _a.map((e) => exports.AgentTool.fromPartial(e))) || [];
1210
+ return message;
1211
+ },
1212
+ };
1213
+ function createBaseDetachAgentToolRequest() {
1214
+ return { agentId: "", toolId: "" };
1215
+ }
1216
+ exports.DetachAgentToolRequest = {
1217
+ encode(message, writer = new wire_1.BinaryWriter()) {
1218
+ if (message.agentId !== "") {
1219
+ writer.uint32(10).string(message.agentId);
1220
+ }
1221
+ if (message.toolId !== "") {
1222
+ writer.uint32(18).string(message.toolId);
1223
+ }
1224
+ return writer;
1225
+ },
1226
+ decode(input, length) {
1227
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1228
+ const end = length === undefined ? reader.len : reader.pos + length;
1229
+ const message = createBaseDetachAgentToolRequest();
1230
+ while (reader.pos < end) {
1231
+ const tag = reader.uint32();
1232
+ switch (tag >>> 3) {
1233
+ case 1: {
1234
+ if (tag !== 10) {
1235
+ break;
1236
+ }
1237
+ message.agentId = reader.string();
1238
+ continue;
1239
+ }
1240
+ case 2: {
1241
+ if (tag !== 18) {
1242
+ break;
1243
+ }
1244
+ message.toolId = reader.string();
1245
+ continue;
1246
+ }
1247
+ }
1248
+ if ((tag & 7) === 4 || tag === 0) {
1249
+ break;
1250
+ }
1251
+ reader.skip(tag & 7);
1252
+ }
1253
+ return message;
1254
+ },
1255
+ fromJSON(object) {
1256
+ return {
1257
+ agentId: isSet(object.agentId)
1258
+ ? globalThis.String(object.agentId)
1259
+ : isSet(object.agent_id)
1260
+ ? globalThis.String(object.agent_id)
1261
+ : "",
1262
+ toolId: isSet(object.toolId)
1263
+ ? globalThis.String(object.toolId)
1264
+ : isSet(object.tool_id)
1265
+ ? globalThis.String(object.tool_id)
1266
+ : "",
1267
+ };
1268
+ },
1269
+ toJSON(message) {
1270
+ const obj = {};
1271
+ if (message.agentId !== "") {
1272
+ obj.agentId = message.agentId;
1273
+ }
1274
+ if (message.toolId !== "") {
1275
+ obj.toolId = message.toolId;
1276
+ }
1277
+ return obj;
1278
+ },
1279
+ create(base) {
1280
+ return exports.DetachAgentToolRequest.fromPartial(base !== null && base !== void 0 ? base : {});
1281
+ },
1282
+ fromPartial(object) {
1283
+ var _a, _b;
1284
+ const message = createBaseDetachAgentToolRequest();
1285
+ message.agentId = (_a = object.agentId) !== null && _a !== void 0 ? _a : "";
1286
+ message.toolId = (_b = object.toolId) !== null && _b !== void 0 ? _b : "";
1287
+ return message;
1288
+ },
1289
+ };
1290
+ function createBaseDetachAgentToolResponse() {
1291
+ return {};
1292
+ }
1293
+ exports.DetachAgentToolResponse = {
1294
+ encode(_, writer = new wire_1.BinaryWriter()) {
1295
+ return writer;
1296
+ },
1297
+ decode(input, length) {
1298
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1299
+ const end = length === undefined ? reader.len : reader.pos + length;
1300
+ const message = createBaseDetachAgentToolResponse();
1301
+ while (reader.pos < end) {
1302
+ const tag = reader.uint32();
1303
+ switch (tag >>> 3) {
1304
+ }
1305
+ if ((tag & 7) === 4 || tag === 0) {
1306
+ break;
1307
+ }
1308
+ reader.skip(tag & 7);
1309
+ }
1310
+ return message;
1311
+ },
1312
+ fromJSON(_) {
1313
+ return {};
1314
+ },
1315
+ toJSON(_) {
1316
+ const obj = {};
1317
+ return obj;
1318
+ },
1319
+ create(base) {
1320
+ return exports.DetachAgentToolResponse.fromPartial(base !== null && base !== void 0 ? base : {});
1321
+ },
1322
+ fromPartial(_) {
1323
+ const message = createBaseDetachAgentToolResponse();
1324
+ return message;
1325
+ },
1326
+ };
1327
+ function createBaseExecuteToolRequest() {
1328
+ return { agentId: "", toolId: "", toolCallId: "", context: undefined, arguments: undefined };
1329
+ }
1330
+ exports.ExecuteToolRequest = {
1331
+ encode(message, writer = new wire_1.BinaryWriter()) {
1332
+ if (message.agentId !== "") {
1333
+ writer.uint32(10).string(message.agentId);
1334
+ }
1335
+ if (message.toolId !== "") {
1336
+ writer.uint32(18).string(message.toolId);
1337
+ }
1338
+ if (message.toolCallId !== "") {
1339
+ writer.uint32(26).string(message.toolCallId);
1340
+ }
1341
+ if (message.context !== undefined) {
1342
+ exports.ToolExecutionContext.encode(message.context, writer.uint32(34).fork()).join();
1343
+ }
1344
+ if (message.arguments !== undefined) {
1345
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.arguments), writer.uint32(42).fork()).join();
1346
+ }
1347
+ return writer;
1348
+ },
1349
+ decode(input, length) {
1350
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1351
+ const end = length === undefined ? reader.len : reader.pos + length;
1352
+ const message = createBaseExecuteToolRequest();
1353
+ while (reader.pos < end) {
1354
+ const tag = reader.uint32();
1355
+ switch (tag >>> 3) {
1356
+ case 1: {
1357
+ if (tag !== 10) {
1358
+ break;
1359
+ }
1360
+ message.agentId = reader.string();
1361
+ continue;
1362
+ }
1363
+ case 2: {
1364
+ if (tag !== 18) {
1365
+ break;
1366
+ }
1367
+ message.toolId = reader.string();
1368
+ continue;
1369
+ }
1370
+ case 3: {
1371
+ if (tag !== 26) {
1372
+ break;
1373
+ }
1374
+ message.toolCallId = reader.string();
1375
+ continue;
1376
+ }
1377
+ case 4: {
1378
+ if (tag !== 34) {
1379
+ break;
1380
+ }
1381
+ message.context = exports.ToolExecutionContext.decode(reader, reader.uint32());
1382
+ continue;
1383
+ }
1384
+ case 5: {
1385
+ if (tag !== 42) {
1386
+ break;
1387
+ }
1388
+ message.arguments = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
1389
+ continue;
1390
+ }
1391
+ }
1392
+ if ((tag & 7) === 4 || tag === 0) {
1393
+ break;
1394
+ }
1395
+ reader.skip(tag & 7);
1396
+ }
1397
+ return message;
1398
+ },
1399
+ fromJSON(object) {
1400
+ return {
1401
+ agentId: isSet(object.agentId)
1402
+ ? globalThis.String(object.agentId)
1403
+ : isSet(object.agent_id)
1404
+ ? globalThis.String(object.agent_id)
1405
+ : "",
1406
+ toolId: isSet(object.toolId)
1407
+ ? globalThis.String(object.toolId)
1408
+ : isSet(object.tool_id)
1409
+ ? globalThis.String(object.tool_id)
1410
+ : "",
1411
+ toolCallId: isSet(object.toolCallId)
1412
+ ? globalThis.String(object.toolCallId)
1413
+ : isSet(object.tool_call_id)
1414
+ ? globalThis.String(object.tool_call_id)
1415
+ : "",
1416
+ context: isSet(object.context) ? exports.ToolExecutionContext.fromJSON(object.context) : undefined,
1417
+ arguments: isObject(object.arguments) ? object.arguments : undefined,
1418
+ };
1419
+ },
1420
+ toJSON(message) {
1421
+ const obj = {};
1422
+ if (message.agentId !== "") {
1423
+ obj.agentId = message.agentId;
1424
+ }
1425
+ if (message.toolId !== "") {
1426
+ obj.toolId = message.toolId;
1427
+ }
1428
+ if (message.toolCallId !== "") {
1429
+ obj.toolCallId = message.toolCallId;
1430
+ }
1431
+ if (message.context !== undefined) {
1432
+ obj.context = exports.ToolExecutionContext.toJSON(message.context);
1433
+ }
1434
+ if (message.arguments !== undefined) {
1435
+ obj.arguments = message.arguments;
1436
+ }
1437
+ return obj;
1438
+ },
1439
+ create(base) {
1440
+ return exports.ExecuteToolRequest.fromPartial(base !== null && base !== void 0 ? base : {});
1441
+ },
1442
+ fromPartial(object) {
1443
+ var _a, _b, _c, _d;
1444
+ const message = createBaseExecuteToolRequest();
1445
+ message.agentId = (_a = object.agentId) !== null && _a !== void 0 ? _a : "";
1446
+ message.toolId = (_b = object.toolId) !== null && _b !== void 0 ? _b : "";
1447
+ message.toolCallId = (_c = object.toolCallId) !== null && _c !== void 0 ? _c : "";
1448
+ message.context = (object.context !== undefined && object.context !== null)
1449
+ ? exports.ToolExecutionContext.fromPartial(object.context)
1450
+ : undefined;
1451
+ message.arguments = (_d = object.arguments) !== null && _d !== void 0 ? _d : undefined;
1452
+ return message;
1453
+ },
1454
+ };
1455
+ function createBaseToolExecutionContext() {
1456
+ return { sessionId: "", agentRunId: "", rootAgentId: "", callerAgentId: "", defaultModelId: "" };
1457
+ }
1458
+ exports.ToolExecutionContext = {
1459
+ encode(message, writer = new wire_1.BinaryWriter()) {
1460
+ if (message.sessionId !== "") {
1461
+ writer.uint32(10).string(message.sessionId);
1462
+ }
1463
+ if (message.agentRunId !== "") {
1464
+ writer.uint32(18).string(message.agentRunId);
1465
+ }
1466
+ if (message.rootAgentId !== "") {
1467
+ writer.uint32(26).string(message.rootAgentId);
1468
+ }
1469
+ if (message.callerAgentId !== "") {
1470
+ writer.uint32(34).string(message.callerAgentId);
1471
+ }
1472
+ if (message.defaultModelId !== "") {
1473
+ writer.uint32(42).string(message.defaultModelId);
1474
+ }
1475
+ return writer;
1476
+ },
1477
+ decode(input, length) {
1478
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1479
+ const end = length === undefined ? reader.len : reader.pos + length;
1480
+ const message = createBaseToolExecutionContext();
1481
+ while (reader.pos < end) {
1482
+ const tag = reader.uint32();
1483
+ switch (tag >>> 3) {
1484
+ case 1: {
1485
+ if (tag !== 10) {
1486
+ break;
1487
+ }
1488
+ message.sessionId = reader.string();
1489
+ continue;
1490
+ }
1491
+ case 2: {
1492
+ if (tag !== 18) {
1493
+ break;
1494
+ }
1495
+ message.agentRunId = reader.string();
1496
+ continue;
1497
+ }
1498
+ case 3: {
1499
+ if (tag !== 26) {
1500
+ break;
1501
+ }
1502
+ message.rootAgentId = reader.string();
1503
+ continue;
1504
+ }
1505
+ case 4: {
1506
+ if (tag !== 34) {
1507
+ break;
1508
+ }
1509
+ message.callerAgentId = reader.string();
1510
+ continue;
1511
+ }
1512
+ case 5: {
1513
+ if (tag !== 42) {
1514
+ break;
1515
+ }
1516
+ message.defaultModelId = reader.string();
1517
+ continue;
1518
+ }
1519
+ }
1520
+ if ((tag & 7) === 4 || tag === 0) {
1521
+ break;
1522
+ }
1523
+ reader.skip(tag & 7);
1524
+ }
1525
+ return message;
1526
+ },
1527
+ fromJSON(object) {
1528
+ return {
1529
+ sessionId: isSet(object.sessionId)
1530
+ ? globalThis.String(object.sessionId)
1531
+ : isSet(object.session_id)
1532
+ ? globalThis.String(object.session_id)
1533
+ : "",
1534
+ agentRunId: isSet(object.agentRunId)
1535
+ ? globalThis.String(object.agentRunId)
1536
+ : isSet(object.agent_run_id)
1537
+ ? globalThis.String(object.agent_run_id)
1538
+ : "",
1539
+ rootAgentId: isSet(object.rootAgentId)
1540
+ ? globalThis.String(object.rootAgentId)
1541
+ : isSet(object.root_agent_id)
1542
+ ? globalThis.String(object.root_agent_id)
1543
+ : "",
1544
+ callerAgentId: isSet(object.callerAgentId)
1545
+ ? globalThis.String(object.callerAgentId)
1546
+ : isSet(object.caller_agent_id)
1547
+ ? globalThis.String(object.caller_agent_id)
1548
+ : "",
1549
+ defaultModelId: isSet(object.defaultModelId)
1550
+ ? globalThis.String(object.defaultModelId)
1551
+ : isSet(object.default_model_id)
1552
+ ? globalThis.String(object.default_model_id)
1553
+ : "",
1554
+ };
1555
+ },
1556
+ toJSON(message) {
1557
+ const obj = {};
1558
+ if (message.sessionId !== "") {
1559
+ obj.sessionId = message.sessionId;
1560
+ }
1561
+ if (message.agentRunId !== "") {
1562
+ obj.agentRunId = message.agentRunId;
1563
+ }
1564
+ if (message.rootAgentId !== "") {
1565
+ obj.rootAgentId = message.rootAgentId;
1566
+ }
1567
+ if (message.callerAgentId !== "") {
1568
+ obj.callerAgentId = message.callerAgentId;
1569
+ }
1570
+ if (message.defaultModelId !== "") {
1571
+ obj.defaultModelId = message.defaultModelId;
1572
+ }
1573
+ return obj;
1574
+ },
1575
+ create(base) {
1576
+ return exports.ToolExecutionContext.fromPartial(base !== null && base !== void 0 ? base : {});
1577
+ },
1578
+ fromPartial(object) {
1579
+ var _a, _b, _c, _d, _e;
1580
+ const message = createBaseToolExecutionContext();
1581
+ message.sessionId = (_a = object.sessionId) !== null && _a !== void 0 ? _a : "";
1582
+ message.agentRunId = (_b = object.agentRunId) !== null && _b !== void 0 ? _b : "";
1583
+ message.rootAgentId = (_c = object.rootAgentId) !== null && _c !== void 0 ? _c : "";
1584
+ message.callerAgentId = (_d = object.callerAgentId) !== null && _d !== void 0 ? _d : "";
1585
+ message.defaultModelId = (_e = object.defaultModelId) !== null && _e !== void 0 ? _e : "";
1586
+ return message;
1587
+ },
1588
+ };
1589
+ function createBaseExecuteToolResponse() {
1590
+ return { result: undefined };
1591
+ }
1592
+ exports.ExecuteToolResponse = {
1593
+ encode(message, writer = new wire_1.BinaryWriter()) {
1594
+ if (message.result !== undefined) {
1595
+ exports.ToolExecutionResult.encode(message.result, writer.uint32(10).fork()).join();
1596
+ }
1597
+ return writer;
1598
+ },
1599
+ decode(input, length) {
1600
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1601
+ const end = length === undefined ? reader.len : reader.pos + length;
1602
+ const message = createBaseExecuteToolResponse();
1603
+ while (reader.pos < end) {
1604
+ const tag = reader.uint32();
1605
+ switch (tag >>> 3) {
1606
+ case 1: {
1607
+ if (tag !== 10) {
1608
+ break;
1609
+ }
1610
+ message.result = exports.ToolExecutionResult.decode(reader, reader.uint32());
1611
+ continue;
1612
+ }
1613
+ }
1614
+ if ((tag & 7) === 4 || tag === 0) {
1615
+ break;
1616
+ }
1617
+ reader.skip(tag & 7);
1618
+ }
1619
+ return message;
1620
+ },
1621
+ fromJSON(object) {
1622
+ return { result: isSet(object.result) ? exports.ToolExecutionResult.fromJSON(object.result) : undefined };
1623
+ },
1624
+ toJSON(message) {
1625
+ const obj = {};
1626
+ if (message.result !== undefined) {
1627
+ obj.result = exports.ToolExecutionResult.toJSON(message.result);
1628
+ }
1629
+ return obj;
1630
+ },
1631
+ create(base) {
1632
+ return exports.ExecuteToolResponse.fromPartial(base !== null && base !== void 0 ? base : {});
1633
+ },
1634
+ fromPartial(object) {
1635
+ const message = createBaseExecuteToolResponse();
1636
+ message.result = (object.result !== undefined && object.result !== null)
1637
+ ? exports.ToolExecutionResult.fromPartial(object.result)
1638
+ : undefined;
1639
+ return message;
1640
+ },
1641
+ };
1642
+ function createBaseToolExecutionResult() {
1643
+ return { status: 0, summary: "", content: undefined };
1644
+ }
1645
+ exports.ToolExecutionResult = {
1646
+ encode(message, writer = new wire_1.BinaryWriter()) {
1647
+ if (message.status !== 0) {
1648
+ writer.uint32(8).int32(message.status);
1649
+ }
1650
+ if (message.summary !== "") {
1651
+ writer.uint32(18).string(message.summary);
1652
+ }
1653
+ if (message.content !== undefined) {
1654
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.content), writer.uint32(26).fork()).join();
1655
+ }
1656
+ return writer;
1657
+ },
1658
+ decode(input, length) {
1659
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1660
+ const end = length === undefined ? reader.len : reader.pos + length;
1661
+ const message = createBaseToolExecutionResult();
1662
+ while (reader.pos < end) {
1663
+ const tag = reader.uint32();
1664
+ switch (tag >>> 3) {
1665
+ case 1: {
1666
+ if (tag !== 8) {
1667
+ break;
1668
+ }
1669
+ message.status = reader.int32();
1670
+ continue;
1671
+ }
1672
+ case 2: {
1673
+ if (tag !== 18) {
1674
+ break;
1675
+ }
1676
+ message.summary = reader.string();
1677
+ continue;
1678
+ }
1679
+ case 3: {
1680
+ if (tag !== 26) {
1681
+ break;
1682
+ }
1683
+ message.content = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
1684
+ continue;
1685
+ }
1686
+ }
1687
+ if ((tag & 7) === 4 || tag === 0) {
1688
+ break;
1689
+ }
1690
+ reader.skip(tag & 7);
1691
+ }
1692
+ return message;
1693
+ },
1694
+ fromJSON(object) {
1695
+ return {
1696
+ status: isSet(object.status) ? toolExecutionStatusFromJSON(object.status) : 0,
1697
+ summary: isSet(object.summary) ? globalThis.String(object.summary) : "",
1698
+ content: isObject(object.content) ? object.content : undefined,
1699
+ };
1700
+ },
1701
+ toJSON(message) {
1702
+ const obj = {};
1703
+ if (message.status !== 0) {
1704
+ obj.status = toolExecutionStatusToJSON(message.status);
1705
+ }
1706
+ if (message.summary !== "") {
1707
+ obj.summary = message.summary;
1708
+ }
1709
+ if (message.content !== undefined) {
1710
+ obj.content = message.content;
1711
+ }
1712
+ return obj;
1713
+ },
1714
+ create(base) {
1715
+ return exports.ToolExecutionResult.fromPartial(base !== null && base !== void 0 ? base : {});
1716
+ },
1717
+ fromPartial(object) {
1718
+ var _a, _b, _c;
1719
+ const message = createBaseToolExecutionResult();
1720
+ message.status = (_a = object.status) !== null && _a !== void 0 ? _a : 0;
1721
+ message.summary = (_b = object.summary) !== null && _b !== void 0 ? _b : "";
1722
+ message.content = (_c = object.content) !== null && _c !== void 0 ? _c : undefined;
1723
+ return message;
1724
+ },
1725
+ };
1726
+ function createBaseTool() {
1727
+ return {
1728
+ id: "",
1729
+ slug: "",
1730
+ name: "",
1731
+ kind: 0,
1732
+ description: "",
1733
+ inputSchema: undefined,
1734
+ outputSchema: undefined,
1735
+ configuration: undefined,
1736
+ };
1737
+ }
1738
+ exports.Tool = {
1739
+ encode(message, writer = new wire_1.BinaryWriter()) {
1740
+ if (message.id !== "") {
1741
+ writer.uint32(10).string(message.id);
1742
+ }
1743
+ if (message.slug !== "") {
1744
+ writer.uint32(18).string(message.slug);
1745
+ }
1746
+ if (message.name !== "") {
1747
+ writer.uint32(26).string(message.name);
1748
+ }
1749
+ if (message.kind !== 0) {
1750
+ writer.uint32(32).int32(message.kind);
1751
+ }
1752
+ if (message.description !== "") {
1753
+ writer.uint32(42).string(message.description);
1754
+ }
1755
+ if (message.inputSchema !== undefined) {
1756
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.inputSchema), writer.uint32(50).fork()).join();
1757
+ }
1758
+ if (message.outputSchema !== undefined) {
1759
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.outputSchema), writer.uint32(58).fork()).join();
1760
+ }
1761
+ if (message.configuration !== undefined) {
1762
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.configuration), writer.uint32(66).fork()).join();
1763
+ }
1764
+ return writer;
1765
+ },
1766
+ decode(input, length) {
1767
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1768
+ const end = length === undefined ? reader.len : reader.pos + length;
1769
+ const message = createBaseTool();
1770
+ while (reader.pos < end) {
1771
+ const tag = reader.uint32();
1772
+ switch (tag >>> 3) {
1773
+ case 1: {
1774
+ if (tag !== 10) {
1775
+ break;
1776
+ }
1777
+ message.id = reader.string();
1778
+ continue;
1779
+ }
1780
+ case 2: {
1781
+ if (tag !== 18) {
1782
+ break;
1783
+ }
1784
+ message.slug = reader.string();
1785
+ continue;
1786
+ }
1787
+ case 3: {
1788
+ if (tag !== 26) {
1789
+ break;
1790
+ }
1791
+ message.name = reader.string();
1792
+ continue;
1793
+ }
1794
+ case 4: {
1795
+ if (tag !== 32) {
1796
+ break;
1797
+ }
1798
+ message.kind = reader.int32();
1799
+ continue;
1800
+ }
1801
+ case 5: {
1802
+ if (tag !== 42) {
1803
+ break;
1804
+ }
1805
+ message.description = reader.string();
1806
+ continue;
1807
+ }
1808
+ case 6: {
1809
+ if (tag !== 50) {
1810
+ break;
1811
+ }
1812
+ message.inputSchema = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
1813
+ continue;
1814
+ }
1815
+ case 7: {
1816
+ if (tag !== 58) {
1817
+ break;
1818
+ }
1819
+ message.outputSchema = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
1820
+ continue;
1821
+ }
1822
+ case 8: {
1823
+ if (tag !== 66) {
1824
+ break;
1825
+ }
1826
+ message.configuration = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
1827
+ continue;
1828
+ }
1829
+ }
1830
+ if ((tag & 7) === 4 || tag === 0) {
1831
+ break;
1832
+ }
1833
+ reader.skip(tag & 7);
1834
+ }
1835
+ return message;
1836
+ },
1837
+ fromJSON(object) {
1838
+ return {
1839
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
1840
+ slug: isSet(object.slug) ? globalThis.String(object.slug) : "",
1841
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
1842
+ kind: isSet(object.kind) ? toolKindFromJSON(object.kind) : 0,
1843
+ description: isSet(object.description) ? globalThis.String(object.description) : "",
1844
+ inputSchema: isObject(object.inputSchema)
1845
+ ? object.inputSchema
1846
+ : isObject(object.input_schema)
1847
+ ? object.input_schema
1848
+ : undefined,
1849
+ outputSchema: isObject(object.outputSchema)
1850
+ ? object.outputSchema
1851
+ : isObject(object.output_schema)
1852
+ ? object.output_schema
1853
+ : undefined,
1854
+ configuration: isObject(object.configuration) ? object.configuration : undefined,
1855
+ };
1856
+ },
1857
+ toJSON(message) {
1858
+ const obj = {};
1859
+ if (message.id !== "") {
1860
+ obj.id = message.id;
1861
+ }
1862
+ if (message.slug !== "") {
1863
+ obj.slug = message.slug;
1864
+ }
1865
+ if (message.name !== "") {
1866
+ obj.name = message.name;
1867
+ }
1868
+ if (message.kind !== 0) {
1869
+ obj.kind = toolKindToJSON(message.kind);
1870
+ }
1871
+ if (message.description !== "") {
1872
+ obj.description = message.description;
1873
+ }
1874
+ if (message.inputSchema !== undefined) {
1875
+ obj.inputSchema = message.inputSchema;
1876
+ }
1877
+ if (message.outputSchema !== undefined) {
1878
+ obj.outputSchema = message.outputSchema;
1879
+ }
1880
+ if (message.configuration !== undefined) {
1881
+ obj.configuration = message.configuration;
1882
+ }
1883
+ return obj;
1884
+ },
1885
+ create(base) {
1886
+ return exports.Tool.fromPartial(base !== null && base !== void 0 ? base : {});
1887
+ },
1888
+ fromPartial(object) {
1889
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1890
+ const message = createBaseTool();
1891
+ message.id = (_a = object.id) !== null && _a !== void 0 ? _a : "";
1892
+ message.slug = (_b = object.slug) !== null && _b !== void 0 ? _b : "";
1893
+ message.name = (_c = object.name) !== null && _c !== void 0 ? _c : "";
1894
+ message.kind = (_d = object.kind) !== null && _d !== void 0 ? _d : 0;
1895
+ message.description = (_e = object.description) !== null && _e !== void 0 ? _e : "";
1896
+ message.inputSchema = (_f = object.inputSchema) !== null && _f !== void 0 ? _f : undefined;
1897
+ message.outputSchema = (_g = object.outputSchema) !== null && _g !== void 0 ? _g : undefined;
1898
+ message.configuration = (_h = object.configuration) !== null && _h !== void 0 ? _h : undefined;
1899
+ return message;
1900
+ },
1901
+ };
1902
+ function createBaseAgentTool() {
1903
+ return { toolId: "", configuration: undefined, confirmation: 0, tool: undefined };
1904
+ }
1905
+ exports.AgentTool = {
1906
+ encode(message, writer = new wire_1.BinaryWriter()) {
1907
+ if (message.toolId !== "") {
1908
+ writer.uint32(10).string(message.toolId);
1909
+ }
1910
+ if (message.configuration !== undefined) {
1911
+ struct_pb_1.Struct.encode(struct_pb_1.Struct.wrap(message.configuration), writer.uint32(18).fork()).join();
1912
+ }
1913
+ if (message.confirmation !== 0) {
1914
+ writer.uint32(24).int32(message.confirmation);
1915
+ }
1916
+ if (message.tool !== undefined) {
1917
+ exports.Tool.encode(message.tool, writer.uint32(34).fork()).join();
1918
+ }
1919
+ return writer;
1920
+ },
1921
+ decode(input, length) {
1922
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
1923
+ const end = length === undefined ? reader.len : reader.pos + length;
1924
+ const message = createBaseAgentTool();
1925
+ while (reader.pos < end) {
1926
+ const tag = reader.uint32();
1927
+ switch (tag >>> 3) {
1928
+ case 1: {
1929
+ if (tag !== 10) {
1930
+ break;
1931
+ }
1932
+ message.toolId = reader.string();
1933
+ continue;
1934
+ }
1935
+ case 2: {
1936
+ if (tag !== 18) {
1937
+ break;
1938
+ }
1939
+ message.configuration = struct_pb_1.Struct.unwrap(struct_pb_1.Struct.decode(reader, reader.uint32()));
1940
+ continue;
1941
+ }
1942
+ case 3: {
1943
+ if (tag !== 24) {
1944
+ break;
1945
+ }
1946
+ message.confirmation = reader.int32();
1947
+ continue;
1948
+ }
1949
+ case 4: {
1950
+ if (tag !== 34) {
1951
+ break;
1952
+ }
1953
+ message.tool = exports.Tool.decode(reader, reader.uint32());
1954
+ continue;
1955
+ }
1956
+ }
1957
+ if ((tag & 7) === 4 || tag === 0) {
1958
+ break;
1959
+ }
1960
+ reader.skip(tag & 7);
1961
+ }
1962
+ return message;
1963
+ },
1964
+ fromJSON(object) {
1965
+ return {
1966
+ toolId: isSet(object.toolId)
1967
+ ? globalThis.String(object.toolId)
1968
+ : isSet(object.tool_id)
1969
+ ? globalThis.String(object.tool_id)
1970
+ : "",
1971
+ configuration: isObject(object.configuration) ? object.configuration : undefined,
1972
+ confirmation: isSet(object.confirmation) ? toolConfirmationFromJSON(object.confirmation) : 0,
1973
+ tool: isSet(object.tool) ? exports.Tool.fromJSON(object.tool) : undefined,
1974
+ };
1975
+ },
1976
+ toJSON(message) {
1977
+ const obj = {};
1978
+ if (message.toolId !== "") {
1979
+ obj.toolId = message.toolId;
1980
+ }
1981
+ if (message.configuration !== undefined) {
1982
+ obj.configuration = message.configuration;
1983
+ }
1984
+ if (message.confirmation !== 0) {
1985
+ obj.confirmation = toolConfirmationToJSON(message.confirmation);
1986
+ }
1987
+ if (message.tool !== undefined) {
1988
+ obj.tool = exports.Tool.toJSON(message.tool);
1989
+ }
1990
+ return obj;
1991
+ },
1992
+ create(base) {
1993
+ return exports.AgentTool.fromPartial(base !== null && base !== void 0 ? base : {});
1994
+ },
1995
+ fromPartial(object) {
1996
+ var _a, _b, _c;
1997
+ const message = createBaseAgentTool();
1998
+ message.toolId = (_a = object.toolId) !== null && _a !== void 0 ? _a : "";
1999
+ message.configuration = (_b = object.configuration) !== null && _b !== void 0 ? _b : undefined;
2000
+ message.confirmation = (_c = object.confirmation) !== null && _c !== void 0 ? _c : 0;
2001
+ message.tool = (object.tool !== undefined && object.tool !== null) ? exports.Tool.fromPartial(object.tool) : undefined;
2002
+ return message;
2003
+ },
2004
+ };
2005
+ exports.ToolServiceServiceName = "weaveapi.tool.v1.ToolService";
2006
+ class ToolServiceClientImpl {
2007
+ constructor(rpc, opts) {
2008
+ this.service = (opts === null || opts === void 0 ? void 0 : opts.service) || exports.ToolServiceServiceName;
2009
+ this.rpc = rpc;
2010
+ this.CreateTool = this.CreateTool.bind(this);
2011
+ this.GetTool = this.GetTool.bind(this);
2012
+ this.UpdateTool = this.UpdateTool.bind(this);
2013
+ this.DeleteTool = this.DeleteTool.bind(this);
2014
+ this.ListTools = this.ListTools.bind(this);
2015
+ this.AttachAgentTool = this.AttachAgentTool.bind(this);
2016
+ this.ListAgentTools = this.ListAgentTools.bind(this);
2017
+ this.DetachAgentTool = this.DetachAgentTool.bind(this);
2018
+ }
2019
+ CreateTool(request) {
2020
+ const data = exports.CreateToolRequest.encode(request).finish();
2021
+ const promise = this.rpc.request(this.service, "CreateTool", data);
2022
+ return promise.then((data) => exports.CreateToolResponse.decode(new wire_1.BinaryReader(data)));
2023
+ }
2024
+ GetTool(request) {
2025
+ const data = exports.GetToolRequest.encode(request).finish();
2026
+ const promise = this.rpc.request(this.service, "GetTool", data);
2027
+ return promise.then((data) => exports.GetToolResponse.decode(new wire_1.BinaryReader(data)));
2028
+ }
2029
+ UpdateTool(request) {
2030
+ const data = exports.UpdateToolRequest.encode(request).finish();
2031
+ const promise = this.rpc.request(this.service, "UpdateTool", data);
2032
+ return promise.then((data) => exports.UpdateToolResponse.decode(new wire_1.BinaryReader(data)));
2033
+ }
2034
+ DeleteTool(request) {
2035
+ const data = exports.DeleteToolRequest.encode(request).finish();
2036
+ const promise = this.rpc.request(this.service, "DeleteTool", data);
2037
+ return promise.then((data) => exports.DeleteToolResponse.decode(new wire_1.BinaryReader(data)));
2038
+ }
2039
+ ListTools(request) {
2040
+ const data = exports.ListToolsRequest.encode(request).finish();
2041
+ const promise = this.rpc.request(this.service, "ListTools", data);
2042
+ return promise.then((data) => exports.ListToolsResponse.decode(new wire_1.BinaryReader(data)));
2043
+ }
2044
+ AttachAgentTool(request) {
2045
+ const data = exports.AttachAgentToolRequest.encode(request).finish();
2046
+ const promise = this.rpc.request(this.service, "AttachAgentTool", data);
2047
+ return promise.then((data) => exports.AttachAgentToolResponse.decode(new wire_1.BinaryReader(data)));
2048
+ }
2049
+ ListAgentTools(request) {
2050
+ const data = exports.ListAgentToolsRequest.encode(request).finish();
2051
+ const promise = this.rpc.request(this.service, "ListAgentTools", data);
2052
+ return promise.then((data) => exports.ListAgentToolsResponse.decode(new wire_1.BinaryReader(data)));
2053
+ }
2054
+ DetachAgentTool(request) {
2055
+ const data = exports.DetachAgentToolRequest.encode(request).finish();
2056
+ const promise = this.rpc.request(this.service, "DetachAgentTool", data);
2057
+ return promise.then((data) => exports.DetachAgentToolResponse.decode(new wire_1.BinaryReader(data)));
2058
+ }
2059
+ }
2060
+ exports.ToolServiceClientImpl = ToolServiceClientImpl;
2061
+ exports.ToolServiceDefinition = {
2062
+ name: "ToolService",
2063
+ fullName: "weaveapi.tool.v1.ToolService",
2064
+ methods: {
2065
+ createTool: {
2066
+ name: "CreateTool",
2067
+ requestType: exports.CreateToolRequest,
2068
+ requestStream: false,
2069
+ responseType: exports.CreateToolResponse,
2070
+ responseStream: false,
2071
+ options: {
2072
+ _unknownFields: {
2073
+ 408002: [
2074
+ new Uint8Array([
2075
+ 35,
2076
+ 10,
2077
+ 12,
2078
+ 111,
2079
+ 114,
2080
+ 103,
2081
+ 97,
2082
+ 110,
2083
+ 105,
2084
+ 122,
2085
+ 97,
2086
+ 116,
2087
+ 105,
2088
+ 111,
2089
+ 110,
2090
+ 18,
2091
+ 15,
2092
+ 99,
2093
+ 97,
2094
+ 110,
2095
+ 95,
2096
+ 99,
2097
+ 114,
2098
+ 101,
2099
+ 97,
2100
+ 116,
2101
+ 101,
2102
+ 95,
2103
+ 116,
2104
+ 111,
2105
+ 111,
2106
+ 108,
2107
+ 26,
2108
+ 2,
2109
+ 8,
2110
+ 1,
2111
+ ]),
2112
+ ],
2113
+ 578365826: [new Uint8Array([14, 58, 1, 42, 34, 9, 47, 118, 49, 47, 116, 111, 111, 108, 115])],
2114
+ },
2115
+ },
2116
+ },
2117
+ getTool: {
2118
+ name: "GetTool",
2119
+ requestType: exports.GetToolRequest,
2120
+ requestStream: false,
2121
+ responseType: exports.GetToolResponse,
2122
+ responseStream: false,
2123
+ options: {
2124
+ _unknownFields: {
2125
+ 408002: [
2126
+ new Uint8Array([
2127
+ 27,
2128
+ 10,
2129
+ 4,
2130
+ 116,
2131
+ 111,
2132
+ 111,
2133
+ 108,
2134
+ 18,
2135
+ 8,
2136
+ 99,
2137
+ 97,
2138
+ 110,
2139
+ 95,
2140
+ 114,
2141
+ 101,
2142
+ 97,
2143
+ 100,
2144
+ 26,
2145
+ 9,
2146
+ 18,
2147
+ 7,
2148
+ 116,
2149
+ 111,
2150
+ 111,
2151
+ 108,
2152
+ 95,
2153
+ 105,
2154
+ 100,
2155
+ ]),
2156
+ ],
2157
+ 578365826: [
2158
+ new Uint8Array([
2159
+ 21,
2160
+ 18,
2161
+ 19,
2162
+ 47,
2163
+ 118,
2164
+ 49,
2165
+ 47,
2166
+ 116,
2167
+ 111,
2168
+ 111,
2169
+ 108,
2170
+ 115,
2171
+ 47,
2172
+ 123,
2173
+ 116,
2174
+ 111,
2175
+ 111,
2176
+ 108,
2177
+ 95,
2178
+ 105,
2179
+ 100,
2180
+ 125,
2181
+ ]),
2182
+ ],
2183
+ },
2184
+ },
2185
+ },
2186
+ updateTool: {
2187
+ name: "UpdateTool",
2188
+ requestType: exports.UpdateToolRequest,
2189
+ requestStream: false,
2190
+ responseType: exports.UpdateToolResponse,
2191
+ responseStream: false,
2192
+ options: {
2193
+ _unknownFields: {
2194
+ 408002: [
2195
+ new Uint8Array([
2196
+ 29,
2197
+ 10,
2198
+ 4,
2199
+ 116,
2200
+ 111,
2201
+ 111,
2202
+ 108,
2203
+ 18,
2204
+ 10,
2205
+ 99,
2206
+ 97,
2207
+ 110,
2208
+ 95,
2209
+ 117,
2210
+ 112,
2211
+ 100,
2212
+ 97,
2213
+ 116,
2214
+ 101,
2215
+ 26,
2216
+ 9,
2217
+ 18,
2218
+ 7,
2219
+ 116,
2220
+ 111,
2221
+ 111,
2222
+ 108,
2223
+ 95,
2224
+ 105,
2225
+ 100,
2226
+ ]),
2227
+ ],
2228
+ 578365826: [
2229
+ new Uint8Array([
2230
+ 24,
2231
+ 58,
2232
+ 1,
2233
+ 42,
2234
+ 50,
2235
+ 19,
2236
+ 47,
2237
+ 118,
2238
+ 49,
2239
+ 47,
2240
+ 116,
2241
+ 111,
2242
+ 111,
2243
+ 108,
2244
+ 115,
2245
+ 47,
2246
+ 123,
2247
+ 116,
2248
+ 111,
2249
+ 111,
2250
+ 108,
2251
+ 95,
2252
+ 105,
2253
+ 100,
2254
+ 125,
2255
+ ]),
2256
+ ],
2257
+ },
2258
+ },
2259
+ },
2260
+ deleteTool: {
2261
+ name: "DeleteTool",
2262
+ requestType: exports.DeleteToolRequest,
2263
+ requestStream: false,
2264
+ responseType: exports.DeleteToolResponse,
2265
+ responseStream: false,
2266
+ options: {
2267
+ _unknownFields: {
2268
+ 408002: [
2269
+ new Uint8Array([
2270
+ 29,
2271
+ 10,
2272
+ 4,
2273
+ 116,
2274
+ 111,
2275
+ 111,
2276
+ 108,
2277
+ 18,
2278
+ 10,
2279
+ 99,
2280
+ 97,
2281
+ 110,
2282
+ 95,
2283
+ 100,
2284
+ 101,
2285
+ 108,
2286
+ 101,
2287
+ 116,
2288
+ 101,
2289
+ 26,
2290
+ 9,
2291
+ 18,
2292
+ 7,
2293
+ 116,
2294
+ 111,
2295
+ 111,
2296
+ 108,
2297
+ 95,
2298
+ 105,
2299
+ 100,
2300
+ ]),
2301
+ ],
2302
+ 578365826: [
2303
+ new Uint8Array([
2304
+ 21,
2305
+ 42,
2306
+ 19,
2307
+ 47,
2308
+ 118,
2309
+ 49,
2310
+ 47,
2311
+ 116,
2312
+ 111,
2313
+ 111,
2314
+ 108,
2315
+ 115,
2316
+ 47,
2317
+ 123,
2318
+ 116,
2319
+ 111,
2320
+ 111,
2321
+ 108,
2322
+ 95,
2323
+ 105,
2324
+ 100,
2325
+ 125,
2326
+ ]),
2327
+ ],
2328
+ },
2329
+ },
2330
+ },
2331
+ listTools: {
2332
+ name: "ListTools",
2333
+ requestType: exports.ListToolsRequest,
2334
+ requestStream: false,
2335
+ responseType: exports.ListToolsResponse,
2336
+ responseStream: false,
2337
+ options: {
2338
+ _unknownFields: {
2339
+ 408002: [
2340
+ new Uint8Array([
2341
+ 34,
2342
+ 10,
2343
+ 12,
2344
+ 111,
2345
+ 114,
2346
+ 103,
2347
+ 97,
2348
+ 110,
2349
+ 105,
2350
+ 122,
2351
+ 97,
2352
+ 116,
2353
+ 105,
2354
+ 111,
2355
+ 110,
2356
+ 18,
2357
+ 14,
2358
+ 99,
2359
+ 97,
2360
+ 110,
2361
+ 95,
2362
+ 108,
2363
+ 105,
2364
+ 115,
2365
+ 116,
2366
+ 95,
2367
+ 116,
2368
+ 111,
2369
+ 111,
2370
+ 108,
2371
+ 115,
2372
+ 26,
2373
+ 2,
2374
+ 8,
2375
+ 1,
2376
+ ]),
2377
+ ],
2378
+ 578365826: [new Uint8Array([11, 18, 9, 47, 118, 49, 47, 116, 111, 111, 108, 115])],
2379
+ },
2380
+ },
2381
+ },
2382
+ attachAgentTool: {
2383
+ name: "AttachAgentTool",
2384
+ requestType: exports.AttachAgentToolRequest,
2385
+ requestStream: false,
2386
+ responseType: exports.AttachAgentToolResponse,
2387
+ responseStream: false,
2388
+ options: {
2389
+ _unknownFields: {
2390
+ 408002: [
2391
+ new Uint8Array([
2392
+ 31,
2393
+ 10,
2394
+ 5,
2395
+ 97,
2396
+ 103,
2397
+ 101,
2398
+ 110,
2399
+ 116,
2400
+ 18,
2401
+ 10,
2402
+ 99,
2403
+ 97,
2404
+ 110,
2405
+ 95,
2406
+ 117,
2407
+ 112,
2408
+ 100,
2409
+ 97,
2410
+ 116,
2411
+ 101,
2412
+ 26,
2413
+ 10,
2414
+ 18,
2415
+ 8,
2416
+ 97,
2417
+ 103,
2418
+ 101,
2419
+ 110,
2420
+ 116,
2421
+ 95,
2422
+ 105,
2423
+ 100,
2424
+ ]),
2425
+ ],
2426
+ 578365826: [
2427
+ new Uint8Array([
2428
+ 42,
2429
+ 58,
2430
+ 1,
2431
+ 42,
2432
+ 26,
2433
+ 37,
2434
+ 47,
2435
+ 118,
2436
+ 49,
2437
+ 47,
2438
+ 97,
2439
+ 103,
2440
+ 101,
2441
+ 110,
2442
+ 116,
2443
+ 115,
2444
+ 47,
2445
+ 123,
2446
+ 97,
2447
+ 103,
2448
+ 101,
2449
+ 110,
2450
+ 116,
2451
+ 95,
2452
+ 105,
2453
+ 100,
2454
+ 125,
2455
+ 47,
2456
+ 116,
2457
+ 111,
2458
+ 111,
2459
+ 108,
2460
+ 115,
2461
+ 47,
2462
+ 123,
2463
+ 116,
2464
+ 111,
2465
+ 111,
2466
+ 108,
2467
+ 95,
2468
+ 105,
2469
+ 100,
2470
+ 125,
2471
+ ]),
2472
+ ],
2473
+ },
2474
+ },
2475
+ },
2476
+ listAgentTools: {
2477
+ name: "ListAgentTools",
2478
+ requestType: exports.ListAgentToolsRequest,
2479
+ requestStream: false,
2480
+ responseType: exports.ListAgentToolsResponse,
2481
+ responseStream: false,
2482
+ options: {
2483
+ _unknownFields: {
2484
+ 408002: [
2485
+ new Uint8Array([
2486
+ 29,
2487
+ 10,
2488
+ 5,
2489
+ 97,
2490
+ 103,
2491
+ 101,
2492
+ 110,
2493
+ 116,
2494
+ 18,
2495
+ 8,
2496
+ 99,
2497
+ 97,
2498
+ 110,
2499
+ 95,
2500
+ 114,
2501
+ 101,
2502
+ 97,
2503
+ 100,
2504
+ 26,
2505
+ 10,
2506
+ 18,
2507
+ 8,
2508
+ 97,
2509
+ 103,
2510
+ 101,
2511
+ 110,
2512
+ 116,
2513
+ 95,
2514
+ 105,
2515
+ 100,
2516
+ ]),
2517
+ ],
2518
+ 578365826: [
2519
+ new Uint8Array([
2520
+ 29,
2521
+ 18,
2522
+ 27,
2523
+ 47,
2524
+ 118,
2525
+ 49,
2526
+ 47,
2527
+ 97,
2528
+ 103,
2529
+ 101,
2530
+ 110,
2531
+ 116,
2532
+ 115,
2533
+ 47,
2534
+ 123,
2535
+ 97,
2536
+ 103,
2537
+ 101,
2538
+ 110,
2539
+ 116,
2540
+ 95,
2541
+ 105,
2542
+ 100,
2543
+ 125,
2544
+ 47,
2545
+ 116,
2546
+ 111,
2547
+ 111,
2548
+ 108,
2549
+ 115,
2550
+ ]),
2551
+ ],
2552
+ },
2553
+ },
2554
+ },
2555
+ detachAgentTool: {
2556
+ name: "DetachAgentTool",
2557
+ requestType: exports.DetachAgentToolRequest,
2558
+ requestStream: false,
2559
+ responseType: exports.DetachAgentToolResponse,
2560
+ responseStream: false,
2561
+ options: {
2562
+ _unknownFields: {
2563
+ 408002: [
2564
+ new Uint8Array([
2565
+ 31,
2566
+ 10,
2567
+ 5,
2568
+ 97,
2569
+ 103,
2570
+ 101,
2571
+ 110,
2572
+ 116,
2573
+ 18,
2574
+ 10,
2575
+ 99,
2576
+ 97,
2577
+ 110,
2578
+ 95,
2579
+ 117,
2580
+ 112,
2581
+ 100,
2582
+ 97,
2583
+ 116,
2584
+ 101,
2585
+ 26,
2586
+ 10,
2587
+ 18,
2588
+ 8,
2589
+ 97,
2590
+ 103,
2591
+ 101,
2592
+ 110,
2593
+ 116,
2594
+ 95,
2595
+ 105,
2596
+ 100,
2597
+ ]),
2598
+ ],
2599
+ 578365826: [
2600
+ new Uint8Array([
2601
+ 39,
2602
+ 42,
2603
+ 37,
2604
+ 47,
2605
+ 118,
2606
+ 49,
2607
+ 47,
2608
+ 97,
2609
+ 103,
2610
+ 101,
2611
+ 110,
2612
+ 116,
2613
+ 115,
2614
+ 47,
2615
+ 123,
2616
+ 97,
2617
+ 103,
2618
+ 101,
2619
+ 110,
2620
+ 116,
2621
+ 95,
2622
+ 105,
2623
+ 100,
2624
+ 125,
2625
+ 47,
2626
+ 116,
2627
+ 111,
2628
+ 111,
2629
+ 108,
2630
+ 115,
2631
+ 47,
2632
+ 123,
2633
+ 116,
2634
+ 111,
2635
+ 111,
2636
+ 108,
2637
+ 95,
2638
+ 105,
2639
+ 100,
2640
+ 125,
2641
+ ]),
2642
+ ],
2643
+ },
2644
+ },
2645
+ },
2646
+ },
2647
+ };
2648
+ exports.ToolRuntimeServiceServiceName = "weaveapi.tool.v1.ToolRuntimeService";
2649
+ class ToolRuntimeServiceClientImpl {
2650
+ constructor(rpc, opts) {
2651
+ this.service = (opts === null || opts === void 0 ? void 0 : opts.service) || exports.ToolRuntimeServiceServiceName;
2652
+ this.rpc = rpc;
2653
+ this.ExecuteTool = this.ExecuteTool.bind(this);
2654
+ }
2655
+ ExecuteTool(request) {
2656
+ const data = exports.ExecuteToolRequest.encode(request).finish();
2657
+ const promise = this.rpc.request(this.service, "ExecuteTool", data);
2658
+ return promise.then((data) => exports.ExecuteToolResponse.decode(new wire_1.BinaryReader(data)));
2659
+ }
2660
+ }
2661
+ exports.ToolRuntimeServiceClientImpl = ToolRuntimeServiceClientImpl;
2662
+ exports.ToolRuntimeServiceDefinition = {
2663
+ name: "ToolRuntimeService",
2664
+ fullName: "weaveapi.tool.v1.ToolRuntimeService",
2665
+ methods: {
2666
+ executeTool: {
2667
+ name: "ExecuteTool",
2668
+ requestType: exports.ExecuteToolRequest,
2669
+ requestStream: false,
2670
+ responseType: exports.ExecuteToolResponse,
2671
+ responseStream: false,
2672
+ options: {
2673
+ _unknownFields: {
2674
+ 408002: [
2675
+ new Uint8Array([
2676
+ 28,
2677
+ 10,
2678
+ 5,
2679
+ 97,
2680
+ 103,
2681
+ 101,
2682
+ 110,
2683
+ 116,
2684
+ 18,
2685
+ 7,
2686
+ 99,
2687
+ 97,
2688
+ 110,
2689
+ 95,
2690
+ 114,
2691
+ 117,
2692
+ 110,
2693
+ 26,
2694
+ 10,
2695
+ 18,
2696
+ 8,
2697
+ 97,
2698
+ 103,
2699
+ 101,
2700
+ 110,
2701
+ 116,
2702
+ 95,
2703
+ 105,
2704
+ 100,
2705
+ ]),
2706
+ ],
2707
+ },
2708
+ },
2709
+ },
2710
+ },
2711
+ };
2712
+ function isObject(value) {
2713
+ return typeof value === "object" && value !== null;
2714
+ }
2715
+ function isSet(value) {
2716
+ return value !== null && value !== undefined;
2717
+ }