@contractspec/example.agent-console 3.8.8 → 3.8.10

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 (228) hide show
  1. package/.turbo/turbo-build.log +225 -222
  2. package/CHANGELOG.md +34 -0
  3. package/dist/agent/agent.entity.js +1 -127
  4. package/dist/agent/agent.enum.js +1 -25
  5. package/dist/agent/agent.event.js +1 -116
  6. package/dist/agent/agent.handler.js +1 -1030
  7. package/dist/agent/agent.operation.js +1 -735
  8. package/dist/agent/agent.presentation.js +1 -282
  9. package/dist/agent/agent.schema.js +1 -215
  10. package/dist/agent/agent.test-spec.js +1 -58
  11. package/dist/agent/index.js +1 -1248
  12. package/dist/agent.capability.js +1 -19
  13. package/dist/agent.feature.js +1 -305
  14. package/dist/browser/agent/agent.entity.js +1 -127
  15. package/dist/browser/agent/agent.enum.js +1 -25
  16. package/dist/browser/agent/agent.event.js +1 -116
  17. package/dist/browser/agent/agent.handler.js +1 -1030
  18. package/dist/browser/agent/agent.operation.js +1 -735
  19. package/dist/browser/agent/agent.presentation.js +1 -282
  20. package/dist/browser/agent/agent.schema.js +1 -215
  21. package/dist/browser/agent/agent.test-spec.js +1 -58
  22. package/dist/browser/agent/index.js +1 -1248
  23. package/dist/browser/agent.capability.js +1 -19
  24. package/dist/browser/agent.feature.js +1 -305
  25. package/dist/browser/docs/agent-console.docblock.js +5 -49
  26. package/dist/browser/docs/index.js +5 -49
  27. package/dist/browser/example.js +1 -41
  28. package/dist/browser/handlers/agent.handlers.js +6 -2143
  29. package/dist/browser/handlers/index.js +6 -2943
  30. package/dist/browser/index.js +14 -6828
  31. package/dist/browser/presentations/index.js +1 -693
  32. package/dist/browser/run/index.js +1 -1363
  33. package/dist/browser/run/run.entity.js +1 -160
  34. package/dist/browser/run/run.enum.js +1 -34
  35. package/dist/browser/run/run.event.js +1 -217
  36. package/dist/browser/run/run.handler.js +1 -919
  37. package/dist/browser/run/run.operation.js +1 -667
  38. package/dist/browser/run/run.presentation.js +1 -223
  39. package/dist/browser/run/run.schema.js +1 -179
  40. package/dist/browser/run/run.test-spec.js +1 -58
  41. package/dist/browser/seeders/index.js +2 -21
  42. package/dist/browser/shared/index.js +1 -626
  43. package/dist/browser/shared/mock-agents.js +1 -82
  44. package/dist/browser/shared/mock-runs.js +1 -113
  45. package/dist/browser/shared/mock-tools.js +1 -146
  46. package/dist/browser/tool/index.js +1 -949
  47. package/dist/browser/tool/tool.entity.js +1 -90
  48. package/dist/browser/tool/tool.enum.js +1 -26
  49. package/dist/browser/tool/tool.event.js +1 -99
  50. package/dist/browser/tool/tool.handler.js +1 -699
  51. package/dist/browser/tool/tool.operation.js +1 -482
  52. package/dist/browser/tool/tool.presentation.js +1 -188
  53. package/dist/browser/tool/tool.schema.js +1 -141
  54. package/dist/browser/tool/tool.test-spec.js +1 -58
  55. package/dist/browser/ui/AgentDashboard.js +1 -2527
  56. package/dist/browser/ui/AgentDashboard.visualizations.js +1 -217
  57. package/dist/browser/ui/AgentRunList.js +1 -482
  58. package/dist/browser/ui/AgentToolRegistry.js +1 -212
  59. package/dist/browser/ui/ExecutionConsoleHost.js +1 -0
  60. package/dist/browser/ui/hooks/index.js +1 -740
  61. package/dist/browser/ui/hooks/useAgentList.js +1 -55
  62. package/dist/browser/ui/hooks/useAgentMutations.js +1 -530
  63. package/dist/browser/ui/hooks/useRunList.js +1 -70
  64. package/dist/browser/ui/hooks/useToolList.js +1 -85
  65. package/dist/browser/ui/index.js +5 -3018
  66. package/dist/browser/ui/modals/AgentActionsModal.js +1 -304
  67. package/dist/browser/ui/modals/CreateAgentModal.js +1 -243
  68. package/dist/browser/ui/modals/index.js +1 -546
  69. package/dist/browser/ui/overlays/demo-overlays.js +1 -64
  70. package/dist/browser/ui/overlays/index.js +1 -64
  71. package/dist/browser/ui/renderers/agent-list.markdown.js +2 -64
  72. package/dist/browser/ui/renderers/agent-list.renderer.js +1 -180
  73. package/dist/browser/ui/renderers/dashboard.markdown.js +2 -288
  74. package/dist/browser/ui/renderers/index.js +5 -642
  75. package/dist/browser/ui/renderers/run-list.markdown.js +2 -50
  76. package/dist/browser/ui/renderers/tool-registry.markdown.js +2 -64
  77. package/dist/browser/ui/views/AgentListView.js +1 -165
  78. package/dist/browser/ui/views/RunDataTable.js +1 -326
  79. package/dist/browser/ui/views/RunListView.js +1 -479
  80. package/dist/browser/ui/views/ToolRegistryView.js +1 -209
  81. package/dist/browser/ui/views/index.js +1 -851
  82. package/dist/browser/ui/views/run-data-table.columns.js +1 -271
  83. package/dist/browser/ui/views/run-list.shared.js +1 -177
  84. package/dist/browser/visualizations/catalog.js +1 -134
  85. package/dist/browser/visualizations/index.js +1 -187
  86. package/dist/browser/visualizations/selectors.js +1 -181
  87. package/dist/docs/agent-console.docblock.js +5 -49
  88. package/dist/docs/index.js +5 -49
  89. package/dist/example.js +1 -41
  90. package/dist/handlers/agent.handlers.js +6 -2143
  91. package/dist/handlers/index.js +6 -2943
  92. package/dist/index.js +14 -6828
  93. package/dist/node/agent/agent.entity.js +1 -127
  94. package/dist/node/agent/agent.enum.js +1 -25
  95. package/dist/node/agent/agent.event.js +1 -116
  96. package/dist/node/agent/agent.handler.js +1 -1030
  97. package/dist/node/agent/agent.operation.js +1 -735
  98. package/dist/node/agent/agent.presentation.js +1 -282
  99. package/dist/node/agent/agent.schema.js +1 -215
  100. package/dist/node/agent/agent.test-spec.js +1 -58
  101. package/dist/node/agent/index.js +1 -1248
  102. package/dist/node/agent.capability.js +1 -19
  103. package/dist/node/agent.feature.js +1 -305
  104. package/dist/node/docs/agent-console.docblock.js +5 -49
  105. package/dist/node/docs/index.js +5 -49
  106. package/dist/node/example.js +1 -41
  107. package/dist/node/handlers/agent.handlers.js +6 -2143
  108. package/dist/node/handlers/index.js +6 -2943
  109. package/dist/node/index.js +14 -6828
  110. package/dist/node/presentations/index.js +1 -693
  111. package/dist/node/run/index.js +1 -1363
  112. package/dist/node/run/run.entity.js +1 -160
  113. package/dist/node/run/run.enum.js +1 -34
  114. package/dist/node/run/run.event.js +1 -217
  115. package/dist/node/run/run.handler.js +1 -919
  116. package/dist/node/run/run.operation.js +1 -667
  117. package/dist/node/run/run.presentation.js +1 -223
  118. package/dist/node/run/run.schema.js +1 -179
  119. package/dist/node/run/run.test-spec.js +1 -58
  120. package/dist/node/seeders/index.js +2 -21
  121. package/dist/node/shared/index.js +1 -626
  122. package/dist/node/shared/mock-agents.js +1 -82
  123. package/dist/node/shared/mock-runs.js +1 -113
  124. package/dist/node/shared/mock-tools.js +1 -146
  125. package/dist/node/tool/index.js +1 -949
  126. package/dist/node/tool/tool.entity.js +1 -90
  127. package/dist/node/tool/tool.enum.js +1 -26
  128. package/dist/node/tool/tool.event.js +1 -99
  129. package/dist/node/tool/tool.handler.js +1 -699
  130. package/dist/node/tool/tool.operation.js +1 -482
  131. package/dist/node/tool/tool.presentation.js +1 -188
  132. package/dist/node/tool/tool.schema.js +1 -141
  133. package/dist/node/tool/tool.test-spec.js +1 -58
  134. package/dist/node/ui/AgentDashboard.js +1 -2527
  135. package/dist/node/ui/AgentDashboard.visualizations.js +1 -217
  136. package/dist/node/ui/AgentRunList.js +1 -482
  137. package/dist/node/ui/AgentToolRegistry.js +1 -212
  138. package/dist/node/ui/ExecutionConsoleHost.js +1 -0
  139. package/dist/node/ui/hooks/index.js +1 -740
  140. package/dist/node/ui/hooks/useAgentList.js +1 -55
  141. package/dist/node/ui/hooks/useAgentMutations.js +1 -530
  142. package/dist/node/ui/hooks/useRunList.js +1 -70
  143. package/dist/node/ui/hooks/useToolList.js +1 -85
  144. package/dist/node/ui/index.js +5 -3018
  145. package/dist/node/ui/modals/AgentActionsModal.js +1 -304
  146. package/dist/node/ui/modals/CreateAgentModal.js +1 -243
  147. package/dist/node/ui/modals/index.js +1 -546
  148. package/dist/node/ui/overlays/demo-overlays.js +1 -64
  149. package/dist/node/ui/overlays/index.js +1 -64
  150. package/dist/node/ui/renderers/agent-list.markdown.js +2 -64
  151. package/dist/node/ui/renderers/agent-list.renderer.js +1 -180
  152. package/dist/node/ui/renderers/dashboard.markdown.js +2 -288
  153. package/dist/node/ui/renderers/index.js +5 -642
  154. package/dist/node/ui/renderers/run-list.markdown.js +2 -50
  155. package/dist/node/ui/renderers/tool-registry.markdown.js +2 -64
  156. package/dist/node/ui/views/AgentListView.js +1 -165
  157. package/dist/node/ui/views/RunDataTable.js +1 -326
  158. package/dist/node/ui/views/RunListView.js +1 -479
  159. package/dist/node/ui/views/ToolRegistryView.js +1 -209
  160. package/dist/node/ui/views/index.js +1 -851
  161. package/dist/node/ui/views/run-data-table.columns.js +1 -271
  162. package/dist/node/ui/views/run-list.shared.js +1 -177
  163. package/dist/node/visualizations/catalog.js +1 -134
  164. package/dist/node/visualizations/index.js +1 -187
  165. package/dist/node/visualizations/selectors.js +1 -181
  166. package/dist/presentations/index.js +1 -693
  167. package/dist/run/index.js +1 -1363
  168. package/dist/run/run.entity.js +1 -160
  169. package/dist/run/run.enum.js +1 -34
  170. package/dist/run/run.event.js +1 -217
  171. package/dist/run/run.handler.js +1 -919
  172. package/dist/run/run.operation.js +1 -667
  173. package/dist/run/run.presentation.js +1 -223
  174. package/dist/run/run.schema.js +1 -179
  175. package/dist/run/run.test-spec.js +1 -58
  176. package/dist/seeders/index.js +2 -21
  177. package/dist/shared/index.js +1 -626
  178. package/dist/shared/mock-agents.js +1 -82
  179. package/dist/shared/mock-runs.js +1 -113
  180. package/dist/shared/mock-tools.js +1 -146
  181. package/dist/tool/index.js +1 -949
  182. package/dist/tool/tool.entity.js +1 -90
  183. package/dist/tool/tool.enum.js +1 -26
  184. package/dist/tool/tool.event.js +1 -99
  185. package/dist/tool/tool.handler.js +1 -699
  186. package/dist/tool/tool.operation.js +1 -482
  187. package/dist/tool/tool.presentation.js +1 -188
  188. package/dist/tool/tool.schema.js +1 -141
  189. package/dist/tool/tool.test-spec.js +1 -58
  190. package/dist/ui/AgentDashboard.js +1 -2527
  191. package/dist/ui/AgentDashboard.visualizations.js +1 -217
  192. package/dist/ui/AgentRunList.js +1 -482
  193. package/dist/ui/AgentToolRegistry.js +1 -212
  194. package/dist/ui/ExecutionConsoleHost.d.ts +1 -0
  195. package/dist/ui/ExecutionConsoleHost.js +2 -0
  196. package/dist/ui/ExecutionConsoleHost.test.d.ts +1 -0
  197. package/dist/ui/hooks/index.js +1 -740
  198. package/dist/ui/hooks/useAgentList.js +1 -55
  199. package/dist/ui/hooks/useAgentMutations.js +1 -530
  200. package/dist/ui/hooks/useRunList.js +1 -70
  201. package/dist/ui/hooks/useToolList.js +1 -85
  202. package/dist/ui/index.d.ts +1 -0
  203. package/dist/ui/index.js +5 -3018
  204. package/dist/ui/modals/AgentActionsModal.js +1 -304
  205. package/dist/ui/modals/CreateAgentModal.js +1 -243
  206. package/dist/ui/modals/index.js +1 -546
  207. package/dist/ui/overlays/demo-overlays.js +1 -64
  208. package/dist/ui/overlays/index.js +1 -64
  209. package/dist/ui/renderers/agent-list.markdown.js +2 -64
  210. package/dist/ui/renderers/agent-list.renderer.js +1 -180
  211. package/dist/ui/renderers/dashboard.markdown.js +2 -288
  212. package/dist/ui/renderers/index.js +5 -642
  213. package/dist/ui/renderers/run-list.markdown.js +2 -50
  214. package/dist/ui/renderers/tool-registry.markdown.js +2 -64
  215. package/dist/ui/views/AgentListView.js +1 -165
  216. package/dist/ui/views/RunDataTable.js +1 -326
  217. package/dist/ui/views/RunListView.js +1 -479
  218. package/dist/ui/views/ToolRegistryView.js +1 -209
  219. package/dist/ui/views/index.js +1 -851
  220. package/dist/ui/views/run-data-table.columns.js +1 -271
  221. package/dist/ui/views/run-list.shared.js +1 -177
  222. package/dist/visualizations/catalog.js +1 -134
  223. package/dist/visualizations/index.js +1 -187
  224. package/dist/visualizations/selectors.js +1 -181
  225. package/package.json +29 -13
  226. package/src/ui/ExecutionConsoleHost.test.tsx +110 -0
  227. package/src/ui/ExecutionConsoleHost.tsx +14 -0
  228. package/src/ui/index.ts +1 -1
@@ -1,482 +1 @@
1
- // src/tool/tool.enum.ts
2
- import { defineEnum } from "@contractspec/lib.schema";
3
- var ToolCategoryEnum = defineEnum("ToolCategory", [
4
- "RETRIEVAL",
5
- "COMPUTATION",
6
- "COMMUNICATION",
7
- "INTEGRATION",
8
- "UTILITY",
9
- "CUSTOM"
10
- ]);
11
- var ToolStatusEnum = defineEnum("ToolStatus", [
12
- "DRAFT",
13
- "ACTIVE",
14
- "DEPRECATED",
15
- "DISABLED"
16
- ]);
17
- var ImplementationTypeEnum = defineEnum("ImplementationType", [
18
- "http",
19
- "function",
20
- "workflow"
21
- ]);
22
-
23
- // src/tool/tool.schema.ts
24
- import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
25
- var ToolModel = defineSchemaModel({
26
- name: "Tool",
27
- description: "AI tool definition",
28
- fields: {
29
- id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
30
- organizationId: {
31
- type: ScalarTypeEnum.String_unsecure(),
32
- isOptional: false
33
- },
34
- name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
35
- slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
36
- description: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
37
- category: { type: ToolCategoryEnum, isOptional: false },
38
- status: { type: ToolStatusEnum, isOptional: false },
39
- parametersSchema: { type: ScalarTypeEnum.JSONObject(), isOptional: false },
40
- outputSchema: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
41
- implementationType: { type: ImplementationTypeEnum, isOptional: false },
42
- implementationConfig: {
43
- type: ScalarTypeEnum.JSONObject(),
44
- isOptional: false
45
- },
46
- maxInvocationsPerMinute: {
47
- type: ScalarTypeEnum.Int_unsecure(),
48
- isOptional: true
49
- },
50
- timeoutMs: {
51
- type: ScalarTypeEnum.Int_unsecure(),
52
- isOptional: false,
53
- defaultValue: 30000
54
- },
55
- version: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
56
- tags: {
57
- type: ScalarTypeEnum.String_unsecure(),
58
- isArray: true,
59
- isOptional: true
60
- },
61
- createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
62
- updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
63
- }
64
- });
65
- var ToolSummaryModel = defineSchemaModel({
66
- name: "ToolSummary",
67
- description: "Summary of a tool for list views",
68
- fields: {
69
- id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
70
- name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
71
- slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
72
- description: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
73
- category: { type: ToolCategoryEnum, isOptional: false },
74
- status: { type: ToolStatusEnum, isOptional: false },
75
- version: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
76
- createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
77
- }
78
- });
79
- var CreateToolInputModel = defineSchemaModel({
80
- name: "CreateToolInput",
81
- description: "Input for creating a tool",
82
- fields: {
83
- organizationId: {
84
- type: ScalarTypeEnum.String_unsecure(),
85
- isOptional: false
86
- },
87
- name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
88
- slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
89
- description: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
90
- category: { type: ToolCategoryEnum, isOptional: true },
91
- parametersSchema: { type: ScalarTypeEnum.JSONObject(), isOptional: false },
92
- outputSchema: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
93
- implementationType: { type: ImplementationTypeEnum, isOptional: false },
94
- implementationConfig: {
95
- type: ScalarTypeEnum.JSONObject(),
96
- isOptional: false
97
- },
98
- maxInvocationsPerMinute: {
99
- type: ScalarTypeEnum.Int_unsecure(),
100
- isOptional: true
101
- },
102
- timeoutMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
103
- tags: {
104
- type: ScalarTypeEnum.String_unsecure(),
105
- isArray: true,
106
- isOptional: true
107
- }
108
- }
109
- });
110
- var UpdateToolInputModel = defineSchemaModel({
111
- name: "UpdateToolInput",
112
- description: "Input for updating a tool",
113
- fields: {
114
- toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
115
- name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: true },
116
- description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
117
- status: { type: ToolStatusEnum, isOptional: true },
118
- parametersSchema: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
119
- outputSchema: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
120
- implementationConfig: {
121
- type: ScalarTypeEnum.JSONObject(),
122
- isOptional: true
123
- },
124
- maxInvocationsPerMinute: {
125
- type: ScalarTypeEnum.Int_unsecure(),
126
- isOptional: true
127
- },
128
- timeoutMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
129
- tags: {
130
- type: ScalarTypeEnum.String_unsecure(),
131
- isArray: true,
132
- isOptional: true
133
- }
134
- }
135
- });
136
-
137
- // src/tool/tool.operation.ts
138
- import {
139
- defineCommand,
140
- defineQuery
141
- } from "@contractspec/lib.contracts-spec/operations";
142
- import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
143
- var OWNERS = ["@agent-console-team"];
144
- var CreateToolCommand = defineCommand({
145
- meta: {
146
- key: "agent.tool.create",
147
- version: "1.0.0",
148
- stability: "stable",
149
- owners: [...OWNERS],
150
- tags: ["tool", "create"],
151
- description: "Creates a new AI tool definition.",
152
- goal: "Allow users to define new tools that agents can use.",
153
- context: "Called from the tool builder UI when creating a new tool."
154
- },
155
- io: {
156
- input: CreateToolInputModel,
157
- output: defineSchemaModel2({
158
- name: "CreateToolOutput",
159
- fields: {
160
- id: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
161
- name: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
162
- slug: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
163
- status: { type: ToolStatusEnum, isOptional: false }
164
- }
165
- }),
166
- errors: {
167
- SLUG_EXISTS: {
168
- description: "A tool with this slug already exists in the organization",
169
- http: 409,
170
- gqlCode: "SLUG_EXISTS",
171
- when: "Slug is already taken"
172
- }
173
- }
174
- },
175
- policy: { auth: "user" },
176
- sideEffects: {
177
- emits: [
178
- {
179
- key: "tool.created",
180
- version: "1.0.0",
181
- stability: "stable",
182
- owners: [...OWNERS],
183
- tags: ["tool", "created"],
184
- when: "Tool is successfully created",
185
- payload: ToolSummaryModel
186
- }
187
- ],
188
- audit: ["tool.created"]
189
- },
190
- acceptance: {
191
- scenarios: [
192
- {
193
- key: "create-tool-happy-path",
194
- given: ["User is authenticated", "Organization exists"],
195
- when: ["User submits valid tool configuration"],
196
- then: ["New tool is created", "ToolCreated event is emitted"]
197
- },
198
- {
199
- key: "create-tool-slug-conflict",
200
- given: ["Tool with same slug exists"],
201
- when: ["User submits tool with duplicate slug"],
202
- then: ["SLUG_EXISTS error is returned"]
203
- }
204
- ],
205
- examples: [
206
- {
207
- key: "create-api-tool",
208
- input: {
209
- name: "Weather API",
210
- slug: "weather-api",
211
- category: "api",
212
- description: "Fetches weather data"
213
- },
214
- output: {
215
- id: "tool-123",
216
- name: "Weather API",
217
- slug: "weather-api",
218
- status: "draft"
219
- }
220
- }
221
- ]
222
- }
223
- });
224
- var UpdateToolCommand = defineCommand({
225
- meta: {
226
- key: "agent.tool.update",
227
- version: "1.0.0",
228
- stability: "stable",
229
- owners: [...OWNERS],
230
- tags: ["tool", "update"],
231
- description: "Updates an existing AI tool definition.",
232
- goal: "Allow users to modify tool settings and configuration.",
233
- context: "Called from the tool settings UI."
234
- },
235
- io: {
236
- input: UpdateToolInputModel,
237
- output: defineSchemaModel2({
238
- name: "UpdateToolOutput",
239
- fields: {
240
- id: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
241
- name: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
242
- status: { type: ToolStatusEnum, isOptional: false },
243
- updatedAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
244
- }
245
- }),
246
- errors: {
247
- TOOL_NOT_FOUND: {
248
- description: "The specified tool does not exist",
249
- http: 404,
250
- gqlCode: "TOOL_NOT_FOUND",
251
- when: "Tool ID is invalid"
252
- }
253
- }
254
- },
255
- policy: { auth: "user" },
256
- sideEffects: {
257
- emits: [
258
- {
259
- key: "tool.updated",
260
- version: "1.0.0",
261
- stability: "stable",
262
- owners: [...OWNERS],
263
- tags: ["tool", "updated"],
264
- when: "Tool is updated",
265
- payload: ToolSummaryModel
266
- }
267
- ],
268
- audit: ["tool.updated"]
269
- },
270
- acceptance: {
271
- scenarios: [
272
- {
273
- key: "update-tool-happy-path",
274
- given: ["Tool exists", "User owns the tool"],
275
- when: ["User submits updated configuration"],
276
- then: ["Tool is updated", "ToolUpdated event is emitted"]
277
- }
278
- ],
279
- examples: [
280
- {
281
- key: "update-description",
282
- input: { toolId: "tool-123", description: "Updated weather API tool" },
283
- output: {
284
- id: "tool-123",
285
- name: "Weather API",
286
- status: "draft",
287
- updatedAt: "2025-01-01T00:00:00Z"
288
- }
289
- }
290
- ]
291
- }
292
- });
293
- var GetToolQuery = defineQuery({
294
- meta: {
295
- key: "agent.tool.get",
296
- version: "1.0.0",
297
- stability: "stable",
298
- owners: [...OWNERS],
299
- tags: ["tool", "get"],
300
- description: "Retrieves a tool by its ID.",
301
- goal: "View detailed tool configuration.",
302
- context: "Called when viewing tool details or editing."
303
- },
304
- io: {
305
- input: defineSchemaModel2({
306
- name: "GetToolInput",
307
- fields: {
308
- toolId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false }
309
- }
310
- }),
311
- output: ToolModel,
312
- errors: {
313
- TOOL_NOT_FOUND: {
314
- description: "The specified tool does not exist",
315
- http: 404,
316
- gqlCode: "TOOL_NOT_FOUND",
317
- when: "Tool ID is invalid"
318
- }
319
- }
320
- },
321
- policy: { auth: "user" },
322
- acceptance: {
323
- scenarios: [
324
- {
325
- key: "get-tool-happy-path",
326
- given: ["Tool exists"],
327
- when: ["User requests tool by ID"],
328
- then: ["Tool details are returned"]
329
- }
330
- ],
331
- examples: [
332
- {
333
- key: "get-basic",
334
- input: { toolId: "tool-123" },
335
- output: {
336
- id: "tool-123",
337
- name: "Weather API",
338
- status: "active",
339
- category: "api"
340
- }
341
- }
342
- ]
343
- }
344
- });
345
- var ListToolsQuery = defineQuery({
346
- meta: {
347
- key: "agent.tool.list",
348
- version: "1.0.0",
349
- stability: "stable",
350
- owners: [...OWNERS],
351
- tags: ["tool", "list"],
352
- description: "Lists tools for an organization with optional filtering.",
353
- goal: "Browse and search available tools.",
354
- context: "Tool list/dashboard view."
355
- },
356
- io: {
357
- input: defineSchemaModel2({
358
- name: "ListToolsInput",
359
- fields: {
360
- organizationId: {
361
- type: ScalarTypeEnum2.String_unsecure(),
362
- isOptional: false
363
- },
364
- category: { type: ToolCategoryEnum, isOptional: true },
365
- status: { type: ToolStatusEnum, isOptional: true },
366
- search: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
367
- limit: {
368
- type: ScalarTypeEnum2.Int_unsecure(),
369
- isOptional: true,
370
- defaultValue: 20
371
- },
372
- offset: {
373
- type: ScalarTypeEnum2.Int_unsecure(),
374
- isOptional: true,
375
- defaultValue: 0
376
- }
377
- }
378
- }),
379
- output: defineSchemaModel2({
380
- name: "ListToolsOutput",
381
- fields: {
382
- items: { type: ToolSummaryModel, isArray: true, isOptional: false },
383
- total: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
384
- hasMore: { type: ScalarTypeEnum2.Boolean(), isOptional: false }
385
- }
386
- })
387
- },
388
- policy: { auth: "user" },
389
- acceptance: {
390
- scenarios: [
391
- {
392
- key: "list-tools-happy-path",
393
- given: ["Organization has tools"],
394
- when: ["User lists tools"],
395
- then: ["Paginated list of tools is returned"]
396
- }
397
- ],
398
- examples: [
399
- {
400
- key: "list-by-category",
401
- input: { organizationId: "org-123", category: "api", limit: 10 },
402
- output: { items: [], total: 0, hasMore: false }
403
- }
404
- ]
405
- }
406
- });
407
- var TestToolCommand = defineCommand({
408
- meta: {
409
- key: "agent.tool.test",
410
- version: "1.0.0",
411
- stability: "stable",
412
- owners: [...OWNERS],
413
- tags: ["tool", "test"],
414
- description: "Tests a tool with sample input to verify it works correctly.",
415
- goal: "Validate tool configuration before deployment.",
416
- context: "Tool builder UI - test panel."
417
- },
418
- io: {
419
- input: defineSchemaModel2({
420
- name: "TestToolInput",
421
- fields: {
422
- toolId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
423
- testInput: { type: ScalarTypeEnum2.JSONObject(), isOptional: false }
424
- }
425
- }),
426
- output: defineSchemaModel2({
427
- name: "TestToolOutput",
428
- fields: {
429
- success: { type: ScalarTypeEnum2.Boolean(), isOptional: false },
430
- output: { type: ScalarTypeEnum2.JSONObject(), isOptional: true },
431
- error: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
432
- durationMs: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false }
433
- }
434
- }),
435
- errors: {
436
- TOOL_NOT_FOUND: {
437
- description: "The specified tool does not exist",
438
- http: 404,
439
- gqlCode: "TOOL_NOT_FOUND",
440
- when: "Tool ID is invalid"
441
- },
442
- TOOL_EXECUTION_ERROR: {
443
- description: "Tool execution failed",
444
- http: 500,
445
- gqlCode: "TOOL_EXECUTION_ERROR",
446
- when: "Tool returns an error"
447
- }
448
- }
449
- },
450
- policy: { auth: "user" },
451
- sideEffects: { audit: ["tool.tested"] },
452
- acceptance: {
453
- scenarios: [
454
- {
455
- key: "test-tool-success",
456
- given: ["Tool exists", "Tool is configured correctly"],
457
- when: ["User runs test with valid input"],
458
- then: ["Tool executes successfully", "Output is returned"]
459
- },
460
- {
461
- key: "test-tool-failure",
462
- given: ["Tool exists", "Tool has configuration error"],
463
- when: ["User runs test"],
464
- then: ["TOOL_EXECUTION_ERROR is returned"]
465
- }
466
- ],
467
- examples: [
468
- {
469
- key: "test-weather-api",
470
- input: { toolId: "tool-123", testInput: { city: "Paris" } },
471
- output: { success: true, output: { temperature: 22 }, durationMs: 150 }
472
- }
473
- ]
474
- }
475
- });
476
- export {
477
- UpdateToolCommand,
478
- TestToolCommand,
479
- ListToolsQuery,
480
- GetToolQuery,
481
- CreateToolCommand
482
- };
1
+ import{defineEnum as B}from"@contractspec/lib.schema";var x=B("ToolCategory",["RETRIEVAL","COMPUTATION","COMMUNICATION","INTEGRATION","UTILITY","CUSTOM"]),q=B("ToolStatus",["DRAFT","ACTIVE","DEPRECATED","DISABLED"]),D=B("ImplementationType",["http","function","workflow"]);import{defineSchemaModel as z,ScalarTypeEnum as j}from"@contractspec/lib.schema";var G=z({name:"Tool",description:"AI tool definition",fields:{id:{type:j.String_unsecure(),isOptional:!1},organizationId:{type:j.String_unsecure(),isOptional:!1},name:{type:j.NonEmptyString(),isOptional:!1},slug:{type:j.String_unsecure(),isOptional:!1},description:{type:j.String_unsecure(),isOptional:!1},category:{type:x,isOptional:!1},status:{type:q,isOptional:!1},parametersSchema:{type:j.JSONObject(),isOptional:!1},outputSchema:{type:j.JSONObject(),isOptional:!0},implementationType:{type:D,isOptional:!1},implementationConfig:{type:j.JSONObject(),isOptional:!1},maxInvocationsPerMinute:{type:j.Int_unsecure(),isOptional:!0},timeoutMs:{type:j.Int_unsecure(),isOptional:!1,defaultValue:30000},version:{type:j.NonEmptyString(),isOptional:!1},tags:{type:j.String_unsecure(),isArray:!0,isOptional:!0},createdAt:{type:j.DateTime(),isOptional:!1},updatedAt:{type:j.DateTime(),isOptional:!1}}}),A=z({name:"ToolSummary",description:"Summary of a tool for list views",fields:{id:{type:j.String_unsecure(),isOptional:!1},name:{type:j.NonEmptyString(),isOptional:!1},slug:{type:j.String_unsecure(),isOptional:!1},description:{type:j.String_unsecure(),isOptional:!1},category:{type:x,isOptional:!1},status:{type:q,isOptional:!1},version:{type:j.NonEmptyString(),isOptional:!1},createdAt:{type:j.DateTime(),isOptional:!1}}}),H=z({name:"CreateToolInput",description:"Input for creating a tool",fields:{organizationId:{type:j.String_unsecure(),isOptional:!1},name:{type:j.NonEmptyString(),isOptional:!1},slug:{type:j.String_unsecure(),isOptional:!1},description:{type:j.String_unsecure(),isOptional:!1},category:{type:x,isOptional:!0},parametersSchema:{type:j.JSONObject(),isOptional:!1},outputSchema:{type:j.JSONObject(),isOptional:!0},implementationType:{type:D,isOptional:!1},implementationConfig:{type:j.JSONObject(),isOptional:!1},maxInvocationsPerMinute:{type:j.Int_unsecure(),isOptional:!0},timeoutMs:{type:j.Int_unsecure(),isOptional:!0},tags:{type:j.String_unsecure(),isArray:!0,isOptional:!0}}}),J=z({name:"UpdateToolInput",description:"Input for updating a tool",fields:{toolId:{type:j.String_unsecure(),isOptional:!1},name:{type:j.NonEmptyString(),isOptional:!0},description:{type:j.String_unsecure(),isOptional:!0},status:{type:q,isOptional:!0},parametersSchema:{type:j.JSONObject(),isOptional:!0},outputSchema:{type:j.JSONObject(),isOptional:!0},implementationConfig:{type:j.JSONObject(),isOptional:!0},maxInvocationsPerMinute:{type:j.Int_unsecure(),isOptional:!0},timeoutMs:{type:j.Int_unsecure(),isOptional:!0},tags:{type:j.String_unsecure(),isArray:!0,isOptional:!0}}});import{defineCommand as F,defineQuery as K}from"@contractspec/lib.contracts-spec/operations";import{defineSchemaModel as v,ScalarTypeEnum as k}from"@contractspec/lib.schema";var w=["@agent-console-team"],Q=F({meta:{key:"agent.tool.create",version:"1.0.0",stability:"stable",owners:[...w],tags:["tool","create"],description:"Creates a new AI tool definition.",goal:"Allow users to define new tools that agents can use.",context:"Called from the tool builder UI when creating a new tool."},io:{input:H,output:v({name:"CreateToolOutput",fields:{id:{type:k.String_unsecure(),isOptional:!1},name:{type:k.NonEmptyString(),isOptional:!1},slug:{type:k.String_unsecure(),isOptional:!1},status:{type:q,isOptional:!1}}}),errors:{SLUG_EXISTS:{description:"A tool with this slug already exists in the organization",http:409,gqlCode:"SLUG_EXISTS",when:"Slug is already taken"}}},policy:{auth:"user"},sideEffects:{emits:[{key:"tool.created",version:"1.0.0",stability:"stable",owners:[...w],tags:["tool","created"],when:"Tool is successfully created",payload:A}],audit:["tool.created"]},acceptance:{scenarios:[{key:"create-tool-happy-path",given:["User is authenticated","Organization exists"],when:["User submits valid tool configuration"],then:["New tool is created","ToolCreated event is emitted"]},{key:"create-tool-slug-conflict",given:["Tool with same slug exists"],when:["User submits tool with duplicate slug"],then:["SLUG_EXISTS error is returned"]}],examples:[{key:"create-api-tool",input:{name:"Weather API",slug:"weather-api",category:"api",description:"Fetches weather data"},output:{id:"tool-123",name:"Weather API",slug:"weather-api",status:"draft"}}]}}),b=F({meta:{key:"agent.tool.update",version:"1.0.0",stability:"stable",owners:[...w],tags:["tool","update"],description:"Updates an existing AI tool definition.",goal:"Allow users to modify tool settings and configuration.",context:"Called from the tool settings UI."},io:{input:J,output:v({name:"UpdateToolOutput",fields:{id:{type:k.String_unsecure(),isOptional:!1},name:{type:k.NonEmptyString(),isOptional:!1},status:{type:q,isOptional:!1},updatedAt:{type:k.DateTime(),isOptional:!1}}}),errors:{TOOL_NOT_FOUND:{description:"The specified tool does not exist",http:404,gqlCode:"TOOL_NOT_FOUND",when:"Tool ID is invalid"}}},policy:{auth:"user"},sideEffects:{emits:[{key:"tool.updated",version:"1.0.0",stability:"stable",owners:[...w],tags:["tool","updated"],when:"Tool is updated",payload:A}],audit:["tool.updated"]},acceptance:{scenarios:[{key:"update-tool-happy-path",given:["Tool exists","User owns the tool"],when:["User submits updated configuration"],then:["Tool is updated","ToolUpdated event is emitted"]}],examples:[{key:"update-description",input:{toolId:"tool-123",description:"Updated weather API tool"},output:{id:"tool-123",name:"Weather API",status:"draft",updatedAt:"2025-01-01T00:00:00Z"}}]}}),g=K({meta:{key:"agent.tool.get",version:"1.0.0",stability:"stable",owners:[...w],tags:["tool","get"],description:"Retrieves a tool by its ID.",goal:"View detailed tool configuration.",context:"Called when viewing tool details or editing."},io:{input:v({name:"GetToolInput",fields:{toolId:{type:k.String_unsecure(),isOptional:!1}}}),output:G,errors:{TOOL_NOT_FOUND:{description:"The specified tool does not exist",http:404,gqlCode:"TOOL_NOT_FOUND",when:"Tool ID is invalid"}}},policy:{auth:"user"},acceptance:{scenarios:[{key:"get-tool-happy-path",given:["Tool exists"],when:["User requests tool by ID"],then:["Tool details are returned"]}],examples:[{key:"get-basic",input:{toolId:"tool-123"},output:{id:"tool-123",name:"Weather API",status:"active",category:"api"}}]}}),I=K({meta:{key:"agent.tool.list",version:"1.0.0",stability:"stable",owners:[...w],tags:["tool","list"],description:"Lists tools for an organization with optional filtering.",goal:"Browse and search available tools.",context:"Tool list/dashboard view."},io:{input:v({name:"ListToolsInput",fields:{organizationId:{type:k.String_unsecure(),isOptional:!1},category:{type:x,isOptional:!0},status:{type:q,isOptional:!0},search:{type:k.String_unsecure(),isOptional:!0},limit:{type:k.Int_unsecure(),isOptional:!0,defaultValue:20},offset:{type:k.Int_unsecure(),isOptional:!0,defaultValue:0}}}),output:v({name:"ListToolsOutput",fields:{items:{type:A,isArray:!0,isOptional:!1},total:{type:k.Int_unsecure(),isOptional:!1},hasMore:{type:k.Boolean(),isOptional:!1}}})},policy:{auth:"user"},acceptance:{scenarios:[{key:"list-tools-happy-path",given:["Organization has tools"],when:["User lists tools"],then:["Paginated list of tools is returned"]}],examples:[{key:"list-by-category",input:{organizationId:"org-123",category:"api",limit:10},output:{items:[],total:0,hasMore:!1}}]}}),N=F({meta:{key:"agent.tool.test",version:"1.0.0",stability:"stable",owners:[...w],tags:["tool","test"],description:"Tests a tool with sample input to verify it works correctly.",goal:"Validate tool configuration before deployment.",context:"Tool builder UI - test panel."},io:{input:v({name:"TestToolInput",fields:{toolId:{type:k.String_unsecure(),isOptional:!1},testInput:{type:k.JSONObject(),isOptional:!1}}}),output:v({name:"TestToolOutput",fields:{success:{type:k.Boolean(),isOptional:!1},output:{type:k.JSONObject(),isOptional:!0},error:{type:k.String_unsecure(),isOptional:!0},durationMs:{type:k.Int_unsecure(),isOptional:!1}}}),errors:{TOOL_NOT_FOUND:{description:"The specified tool does not exist",http:404,gqlCode:"TOOL_NOT_FOUND",when:"Tool ID is invalid"},TOOL_EXECUTION_ERROR:{description:"Tool execution failed",http:500,gqlCode:"TOOL_EXECUTION_ERROR",when:"Tool returns an error"}}},policy:{auth:"user"},sideEffects:{audit:["tool.tested"]},acceptance:{scenarios:[{key:"test-tool-success",given:["Tool exists","Tool is configured correctly"],when:["User runs test with valid input"],then:["Tool executes successfully","Output is returned"]},{key:"test-tool-failure",given:["Tool exists","Tool has configuration error"],when:["User runs test"],then:["TOOL_EXECUTION_ERROR is returned"]}],examples:[{key:"test-weather-api",input:{toolId:"tool-123",testInput:{city:"Paris"}},output:{success:!0,output:{temperature:22},durationMs:150}}]}});export{b as UpdateToolCommand,N as TestToolCommand,I as ListToolsQuery,g as GetToolQuery,Q as CreateToolCommand};
@@ -1,188 +1 @@
1
- // src/tool/tool.enum.ts
2
- import { defineEnum } from "@contractspec/lib.schema";
3
- var ToolCategoryEnum = defineEnum("ToolCategory", [
4
- "RETRIEVAL",
5
- "COMPUTATION",
6
- "COMMUNICATION",
7
- "INTEGRATION",
8
- "UTILITY",
9
- "CUSTOM"
10
- ]);
11
- var ToolStatusEnum = defineEnum("ToolStatus", [
12
- "DRAFT",
13
- "ACTIVE",
14
- "DEPRECATED",
15
- "DISABLED"
16
- ]);
17
- var ImplementationTypeEnum = defineEnum("ImplementationType", [
18
- "http",
19
- "function",
20
- "workflow"
21
- ]);
22
-
23
- // src/tool/tool.schema.ts
24
- import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
25
- var ToolModel = defineSchemaModel({
26
- name: "Tool",
27
- description: "AI tool definition",
28
- fields: {
29
- id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
30
- organizationId: {
31
- type: ScalarTypeEnum.String_unsecure(),
32
- isOptional: false
33
- },
34
- name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
35
- slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
36
- description: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
37
- category: { type: ToolCategoryEnum, isOptional: false },
38
- status: { type: ToolStatusEnum, isOptional: false },
39
- parametersSchema: { type: ScalarTypeEnum.JSONObject(), isOptional: false },
40
- outputSchema: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
41
- implementationType: { type: ImplementationTypeEnum, isOptional: false },
42
- implementationConfig: {
43
- type: ScalarTypeEnum.JSONObject(),
44
- isOptional: false
45
- },
46
- maxInvocationsPerMinute: {
47
- type: ScalarTypeEnum.Int_unsecure(),
48
- isOptional: true
49
- },
50
- timeoutMs: {
51
- type: ScalarTypeEnum.Int_unsecure(),
52
- isOptional: false,
53
- defaultValue: 30000
54
- },
55
- version: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
56
- tags: {
57
- type: ScalarTypeEnum.String_unsecure(),
58
- isArray: true,
59
- isOptional: true
60
- },
61
- createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
62
- updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
63
- }
64
- });
65
- var ToolSummaryModel = defineSchemaModel({
66
- name: "ToolSummary",
67
- description: "Summary of a tool for list views",
68
- fields: {
69
- id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
70
- name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
71
- slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
72
- description: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
73
- category: { type: ToolCategoryEnum, isOptional: false },
74
- status: { type: ToolStatusEnum, isOptional: false },
75
- version: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
76
- createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
77
- }
78
- });
79
- var CreateToolInputModel = defineSchemaModel({
80
- name: "CreateToolInput",
81
- description: "Input for creating a tool",
82
- fields: {
83
- organizationId: {
84
- type: ScalarTypeEnum.String_unsecure(),
85
- isOptional: false
86
- },
87
- name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
88
- slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
89
- description: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
90
- category: { type: ToolCategoryEnum, isOptional: true },
91
- parametersSchema: { type: ScalarTypeEnum.JSONObject(), isOptional: false },
92
- outputSchema: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
93
- implementationType: { type: ImplementationTypeEnum, isOptional: false },
94
- implementationConfig: {
95
- type: ScalarTypeEnum.JSONObject(),
96
- isOptional: false
97
- },
98
- maxInvocationsPerMinute: {
99
- type: ScalarTypeEnum.Int_unsecure(),
100
- isOptional: true
101
- },
102
- timeoutMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
103
- tags: {
104
- type: ScalarTypeEnum.String_unsecure(),
105
- isArray: true,
106
- isOptional: true
107
- }
108
- }
109
- });
110
- var UpdateToolInputModel = defineSchemaModel({
111
- name: "UpdateToolInput",
112
- description: "Input for updating a tool",
113
- fields: {
114
- toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
115
- name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: true },
116
- description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
117
- status: { type: ToolStatusEnum, isOptional: true },
118
- parametersSchema: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
119
- outputSchema: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
120
- implementationConfig: {
121
- type: ScalarTypeEnum.JSONObject(),
122
- isOptional: true
123
- },
124
- maxInvocationsPerMinute: {
125
- type: ScalarTypeEnum.Int_unsecure(),
126
- isOptional: true
127
- },
128
- timeoutMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
129
- tags: {
130
- type: ScalarTypeEnum.String_unsecure(),
131
- isArray: true,
132
- isOptional: true
133
- }
134
- }
135
- });
136
-
137
- // src/tool/tool.presentation.ts
138
- import {
139
- definePresentation,
140
- StabilityEnum
141
- } from "@contractspec/lib.contracts-spec";
142
- var ToolListPresentation = definePresentation({
143
- meta: {
144
- key: "agent-console.tool.list",
145
- version: "1.0.0",
146
- title: "Tool List",
147
- description: "List view of AI tools with category, status, and version info",
148
- goal: "Provide an overview of all available tools for agents.",
149
- context: "Tool management dashboard.",
150
- domain: "agent-console",
151
- owners: ["@agent-console-team"],
152
- tags: ["tool", "list", "dashboard"],
153
- stability: StabilityEnum.Experimental
154
- },
155
- source: {
156
- type: "component",
157
- framework: "react",
158
- componentKey: "ToolListView",
159
- props: ToolSummaryModel
160
- },
161
- targets: ["react", "markdown", "application/json"],
162
- policy: { flags: ["agent-console.enabled"] }
163
- });
164
- var ToolDetailPresentation = definePresentation({
165
- meta: {
166
- key: "agent-console.tool.detail",
167
- version: "1.0.0",
168
- title: "Tool Details",
169
- description: "Detailed view of an AI tool with configuration and test panel",
170
- goal: "Allow users to inspect and test a specific tool.",
171
- context: "Detailed view of a tool.",
172
- domain: "agent-console",
173
- owners: ["@agent-console-team"],
174
- tags: ["tool", "detail"],
175
- stability: StabilityEnum.Experimental
176
- },
177
- source: {
178
- type: "component",
179
- framework: "react",
180
- componentKey: "ToolDetailView"
181
- },
182
- targets: ["react", "markdown"],
183
- policy: { flags: ["agent-console.enabled"] }
184
- });
185
- export {
186
- ToolListPresentation,
187
- ToolDetailPresentation
188
- };
1
+ import{defineEnum as w}from"@contractspec/lib.schema";var k=w("ToolCategory",["RETRIEVAL","COMPUTATION","COMMUNICATION","INTEGRATION","UTILITY","CUSTOM"]),q=w("ToolStatus",["DRAFT","ACTIVE","DEPRECATED","DISABLED"]),x=w("ImplementationType",["http","function","workflow"]);import{defineSchemaModel as v,ScalarTypeEnum as j}from"@contractspec/lib.schema";var J=v({name:"Tool",description:"AI tool definition",fields:{id:{type:j.String_unsecure(),isOptional:!1},organizationId:{type:j.String_unsecure(),isOptional:!1},name:{type:j.NonEmptyString(),isOptional:!1},slug:{type:j.String_unsecure(),isOptional:!1},description:{type:j.String_unsecure(),isOptional:!1},category:{type:k,isOptional:!1},status:{type:q,isOptional:!1},parametersSchema:{type:j.JSONObject(),isOptional:!1},outputSchema:{type:j.JSONObject(),isOptional:!0},implementationType:{type:x,isOptional:!1},implementationConfig:{type:j.JSONObject(),isOptional:!1},maxInvocationsPerMinute:{type:j.Int_unsecure(),isOptional:!0},timeoutMs:{type:j.Int_unsecure(),isOptional:!1,defaultValue:30000},version:{type:j.NonEmptyString(),isOptional:!1},tags:{type:j.String_unsecure(),isArray:!0,isOptional:!0},createdAt:{type:j.DateTime(),isOptional:!1},updatedAt:{type:j.DateTime(),isOptional:!1}}}),z=v({name:"ToolSummary",description:"Summary of a tool for list views",fields:{id:{type:j.String_unsecure(),isOptional:!1},name:{type:j.NonEmptyString(),isOptional:!1},slug:{type:j.String_unsecure(),isOptional:!1},description:{type:j.String_unsecure(),isOptional:!1},category:{type:k,isOptional:!1},status:{type:q,isOptional:!1},version:{type:j.NonEmptyString(),isOptional:!1},createdAt:{type:j.DateTime(),isOptional:!1}}}),K=v({name:"CreateToolInput",description:"Input for creating a tool",fields:{organizationId:{type:j.String_unsecure(),isOptional:!1},name:{type:j.NonEmptyString(),isOptional:!1},slug:{type:j.String_unsecure(),isOptional:!1},description:{type:j.String_unsecure(),isOptional:!1},category:{type:k,isOptional:!0},parametersSchema:{type:j.JSONObject(),isOptional:!1},outputSchema:{type:j.JSONObject(),isOptional:!0},implementationType:{type:x,isOptional:!1},implementationConfig:{type:j.JSONObject(),isOptional:!1},maxInvocationsPerMinute:{type:j.Int_unsecure(),isOptional:!0},timeoutMs:{type:j.Int_unsecure(),isOptional:!0},tags:{type:j.String_unsecure(),isArray:!0,isOptional:!0}}}),L=v({name:"UpdateToolInput",description:"Input for updating a tool",fields:{toolId:{type:j.String_unsecure(),isOptional:!1},name:{type:j.NonEmptyString(),isOptional:!0},description:{type:j.String_unsecure(),isOptional:!0},status:{type:q,isOptional:!0},parametersSchema:{type:j.JSONObject(),isOptional:!0},outputSchema:{type:j.JSONObject(),isOptional:!0},implementationConfig:{type:j.JSONObject(),isOptional:!0},maxInvocationsPerMinute:{type:j.Int_unsecure(),isOptional:!0},timeoutMs:{type:j.Int_unsecure(),isOptional:!0},tags:{type:j.String_unsecure(),isArray:!0,isOptional:!0}}});import{definePresentation as A,StabilityEnum as B}from"@contractspec/lib.contracts-spec";var R=A({meta:{key:"agent-console.tool.list",version:"1.0.0",title:"Tool List",description:"List view of AI tools with category, status, and version info",goal:"Provide an overview of all available tools for agents.",context:"Tool management dashboard.",domain:"agent-console",owners:["@agent-console-team"],tags:["tool","list","dashboard"],stability:B.Experimental},source:{type:"component",framework:"react",componentKey:"ToolListView",props:z},targets:["react","markdown","application/json"],policy:{flags:["agent-console.enabled"]}}),U=A({meta:{key:"agent-console.tool.detail",version:"1.0.0",title:"Tool Details",description:"Detailed view of an AI tool with configuration and test panel",goal:"Allow users to inspect and test a specific tool.",context:"Detailed view of a tool.",domain:"agent-console",owners:["@agent-console-team"],tags:["tool","detail"],stability:B.Experimental},source:{type:"component",framework:"react",componentKey:"ToolDetailView"},targets:["react","markdown"],policy:{flags:["agent-console.enabled"]}});export{R as ToolListPresentation,U as ToolDetailPresentation};