@contractspec/example.agent-console 3.7.7 → 3.8.4

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 (191) hide show
  1. package/.turbo/turbo-build.log +126 -105
  2. package/AGENTS.md +3 -1
  3. package/CHANGELOG.md +57 -0
  4. package/README.md +46 -9
  5. package/dist/agent/agent.handler.d.ts +3 -0
  6. package/dist/agent/agent.handler.js +730 -1
  7. package/dist/agent/index.js +73 -72
  8. package/dist/agent.feature.js +179 -0
  9. package/dist/browser/agent/agent.handler.js +730 -1
  10. package/dist/browser/agent/index.js +73 -72
  11. package/dist/browser/agent.feature.js +179 -0
  12. package/dist/browser/docs/agent-console.docblock.js +11 -8
  13. package/dist/browser/docs/index.js +11 -8
  14. package/dist/browser/example.js +2 -3
  15. package/dist/browser/handlers/agent.handlers.js +1883 -2
  16. package/dist/browser/handlers/index.js +2142 -8
  17. package/dist/browser/index.js +3347 -2433
  18. package/dist/browser/presentations/index.js +49 -49
  19. package/dist/browser/run/index.js +818 -812
  20. package/dist/browser/run/run.handler.js +666 -1
  21. package/dist/browser/shared/index.js +293 -1
  22. package/dist/browser/shared/mock-runs.js +5 -0
  23. package/dist/browser/tool/index.js +331 -331
  24. package/dist/browser/tool/tool.handler.js +479 -3
  25. package/dist/browser/ui/AgentDashboard.js +1204 -319
  26. package/dist/browser/ui/AgentDashboard.visualizations.js +217 -0
  27. package/dist/browser/ui/AgentRunList.js +359 -127
  28. package/dist/browser/ui/hooks/index.js +468 -18
  29. package/dist/browser/ui/hooks/useAgentMutations.js +443 -8
  30. package/dist/browser/ui/hooks/useRunList.js +25 -10
  31. package/dist/browser/ui/index.js +1293 -390
  32. package/dist/browser/ui/renderers/agent-list.markdown.js +14 -5
  33. package/dist/browser/ui/renderers/dashboard.markdown.js +207 -36
  34. package/dist/browser/ui/renderers/index.js +245 -49
  35. package/dist/browser/ui/renderers/run-list.markdown.js +9 -4
  36. package/dist/browser/ui/renderers/tool-registry.markdown.js +15 -4
  37. package/dist/browser/ui/views/RunDataTable.js +326 -0
  38. package/dist/browser/ui/views/RunListView.js +359 -127
  39. package/dist/browser/ui/views/index.js +406 -174
  40. package/dist/browser/ui/views/run-data-table.columns.js +271 -0
  41. package/dist/browser/ui/views/run-list.shared.js +177 -0
  42. package/dist/browser/visualizations/catalog.js +134 -0
  43. package/dist/browser/visualizations/index.js +187 -0
  44. package/dist/browser/visualizations/selectors.js +181 -0
  45. package/dist/docs/agent-console.docblock.js +11 -8
  46. package/dist/docs/index.js +11 -8
  47. package/dist/example.js +2 -3
  48. package/dist/example.test.d.ts +1 -0
  49. package/dist/handlers/agent.handlers.d.ts +2 -0
  50. package/dist/handlers/agent.handlers.js +1883 -2
  51. package/dist/handlers/index.d.ts +1 -3
  52. package/dist/handlers/index.js +2142 -8
  53. package/dist/handlers/mock-handlers.test.d.ts +1 -0
  54. package/dist/index.d.ts +2 -0
  55. package/dist/index.js +3347 -2433
  56. package/dist/node/agent/agent.handler.js +730 -1
  57. package/dist/node/agent/index.js +73 -72
  58. package/dist/node/agent.feature.js +179 -0
  59. package/dist/node/docs/agent-console.docblock.js +11 -8
  60. package/dist/node/docs/index.js +11 -8
  61. package/dist/node/example.js +2 -3
  62. package/dist/node/handlers/agent.handlers.js +1883 -2
  63. package/dist/node/handlers/index.js +2142 -8
  64. package/dist/node/index.js +3347 -2433
  65. package/dist/node/presentations/index.js +49 -49
  66. package/dist/node/run/index.js +818 -812
  67. package/dist/node/run/run.handler.js +666 -1
  68. package/dist/node/shared/index.js +293 -1
  69. package/dist/node/shared/mock-runs.js +5 -0
  70. package/dist/node/tool/index.js +331 -331
  71. package/dist/node/tool/tool.handler.js +479 -3
  72. package/dist/node/ui/AgentDashboard.js +1204 -319
  73. package/dist/node/ui/AgentDashboard.visualizations.js +217 -0
  74. package/dist/node/ui/AgentRunList.js +359 -127
  75. package/dist/node/ui/hooks/index.js +468 -18
  76. package/dist/node/ui/hooks/useAgentMutations.js +443 -8
  77. package/dist/node/ui/hooks/useRunList.js +25 -10
  78. package/dist/node/ui/index.js +1293 -390
  79. package/dist/node/ui/renderers/agent-list.markdown.js +14 -5
  80. package/dist/node/ui/renderers/dashboard.markdown.js +207 -36
  81. package/dist/node/ui/renderers/index.js +245 -49
  82. package/dist/node/ui/renderers/run-list.markdown.js +9 -4
  83. package/dist/node/ui/renderers/tool-registry.markdown.js +15 -4
  84. package/dist/node/ui/views/RunDataTable.js +326 -0
  85. package/dist/node/ui/views/RunListView.js +359 -127
  86. package/dist/node/ui/views/index.js +406 -174
  87. package/dist/node/ui/views/run-data-table.columns.js +271 -0
  88. package/dist/node/ui/views/run-list.shared.js +177 -0
  89. package/dist/node/visualizations/catalog.js +134 -0
  90. package/dist/node/visualizations/index.js +187 -0
  91. package/dist/node/visualizations/selectors.js +181 -0
  92. package/dist/presentations/index.js +49 -49
  93. package/dist/proof/index.d.ts +2 -0
  94. package/dist/proof/meetup-proof.d.ts +10 -0
  95. package/dist/proof/meetup-proof.runtime.d.ts +22 -0
  96. package/dist/proof/meetup-proof.scenario.d.ts +2 -0
  97. package/dist/proof/meetup-proof.suite.d.ts +1 -0
  98. package/dist/proof/meetup-proof.test.d.ts +1 -0
  99. package/dist/run/index.js +818 -812
  100. package/dist/run/run.handler.d.ts +4 -0
  101. package/dist/run/run.handler.js +666 -1
  102. package/dist/shared/demo-dashboard-data.d.ts +16 -0
  103. package/dist/shared/demo-runtime-seed.d.ts +17 -0
  104. package/dist/shared/demo-runtime.d.ts +8 -0
  105. package/dist/shared/demo-runtime.test.d.ts +1 -0
  106. package/dist/shared/index.d.ts +3 -0
  107. package/dist/shared/index.js +293 -1
  108. package/dist/shared/mock-runs.d.ts +4 -0
  109. package/dist/shared/mock-runs.js +5 -0
  110. package/dist/tool/index.js +331 -331
  111. package/dist/tool/tool.handler.d.ts +4 -1
  112. package/dist/tool/tool.handler.js +479 -3
  113. package/dist/ui/AgentDashboard.js +1204 -319
  114. package/dist/ui/AgentDashboard.sandbox.test.d.ts +1 -0
  115. package/dist/ui/AgentDashboard.visualizations.d.ts +4 -0
  116. package/dist/ui/AgentDashboard.visualizations.js +218 -0
  117. package/dist/ui/AgentRunList.js +359 -127
  118. package/dist/ui/hooks/index.js +468 -18
  119. package/dist/ui/hooks/useAgentMutations.js +443 -8
  120. package/dist/ui/hooks/useRunList.d.ts +8 -2
  121. package/dist/ui/hooks/useRunList.js +25 -10
  122. package/dist/ui/index.js +1293 -390
  123. package/dist/ui/renderers/agent-list.markdown.d.ts +1 -1
  124. package/dist/ui/renderers/agent-list.markdown.js +14 -5
  125. package/dist/ui/renderers/agent-list.renderer.d.ts +1 -1
  126. package/dist/ui/renderers/dashboard.markdown.d.ts +1 -1
  127. package/dist/ui/renderers/dashboard.markdown.js +207 -36
  128. package/dist/ui/renderers/index.js +245 -49
  129. package/dist/ui/renderers/run-list.markdown.d.ts +1 -1
  130. package/dist/ui/renderers/run-list.markdown.js +9 -4
  131. package/dist/ui/renderers/tool-registry.markdown.d.ts +2 -2
  132. package/dist/ui/renderers/tool-registry.markdown.js +15 -4
  133. package/dist/ui/views/RunDataTable.d.ts +18 -0
  134. package/dist/ui/views/RunDataTable.js +327 -0
  135. package/dist/ui/views/RunListView.js +359 -127
  136. package/dist/ui/views/index.js +406 -174
  137. package/dist/ui/views/run-data-table.columns.d.ts +3 -0
  138. package/dist/ui/views/run-data-table.columns.js +272 -0
  139. package/dist/ui/views/run-list.shared.d.ts +14 -0
  140. package/dist/ui/views/run-list.shared.js +178 -0
  141. package/dist/visualizations/catalog.d.ts +10 -0
  142. package/dist/visualizations/catalog.js +135 -0
  143. package/dist/visualizations/index.d.ts +2 -0
  144. package/dist/visualizations/index.js +188 -0
  145. package/dist/visualizations/selectors.d.ts +3 -0
  146. package/dist/visualizations/selectors.js +182 -0
  147. package/dist/visualizations/selectors.test.d.ts +1 -0
  148. package/package.json +114 -11
  149. package/proofs/agent-console-meetup.replay.json +220 -0
  150. package/src/agent/agent.handler.ts +18 -1
  151. package/src/agent.feature.ts +3 -0
  152. package/src/docs/agent-console.docblock.ts +11 -8
  153. package/src/example.test.ts +75 -0
  154. package/src/example.ts +2 -3
  155. package/src/handlers/agent.handlers.ts +55 -2
  156. package/src/handlers/index.ts +18 -2
  157. package/src/handlers/mock-handlers.test.ts +77 -0
  158. package/src/index.ts +2 -0
  159. package/src/proof/index.ts +2 -0
  160. package/src/proof/meetup-proof.runtime.ts +196 -0
  161. package/src/proof/meetup-proof.scenario.ts +99 -0
  162. package/src/proof/meetup-proof.suite.ts +29 -0
  163. package/src/proof/meetup-proof.test.ts +28 -0
  164. package/src/proof/meetup-proof.ts +130 -0
  165. package/src/run/run.handler.ts +17 -1
  166. package/src/shared/demo-dashboard-data.ts +58 -0
  167. package/src/shared/demo-runtime-seed.ts +139 -0
  168. package/src/shared/demo-runtime.test.ts +169 -0
  169. package/src/shared/demo-runtime.ts +260 -0
  170. package/src/shared/index.ts +11 -0
  171. package/src/shared/mock-runs.ts +5 -0
  172. package/src/tool/tool.handler.ts +21 -4
  173. package/src/ui/AgentDashboard.sandbox.test.tsx +312 -0
  174. package/src/ui/AgentDashboard.tsx +4 -1
  175. package/src/ui/AgentDashboard.visualizations.tsx +35 -0
  176. package/src/ui/hooks/useAgentMutations.ts +19 -11
  177. package/src/ui/hooks/useRunList.ts +41 -9
  178. package/src/ui/renderers/agent-list.markdown.ts +32 -13
  179. package/src/ui/renderers/agent-list.renderer.tsx +1 -1
  180. package/src/ui/renderers/dashboard.markdown.ts +38 -43
  181. package/src/ui/renderers/run-list.markdown.ts +17 -9
  182. package/src/ui/renderers/tool-registry.markdown.ts +22 -10
  183. package/src/ui/views/RunDataTable.tsx +74 -0
  184. package/src/ui/views/RunListView.tsx +37 -111
  185. package/src/ui/views/run-data-table.columns.tsx +102 -0
  186. package/src/ui/views/run-list.shared.tsx +139 -0
  187. package/src/visualizations/catalog.ts +132 -0
  188. package/src/visualizations/index.ts +2 -0
  189. package/src/visualizations/selectors.test.ts +12 -0
  190. package/src/visualizations/selectors.ts +70 -0
  191. package/tsdown.config.js +17 -0
@@ -142,164 +142,6 @@ var MOCK_TOOLS = [
142
142
  }
143
143
  ];
144
144
 
145
- // src/tool/tool.handler.ts
146
- async function mockListToolsHandler(input) {
147
- const {
148
- organizationId,
149
- category,
150
- status,
151
- search,
152
- limit = 20,
153
- offset = 0
154
- } = input;
155
- let filtered = MOCK_TOOLS.filter((t) => t.organizationId === organizationId);
156
- if (category)
157
- filtered = filtered.filter((t) => t.category === category);
158
- if (status)
159
- filtered = filtered.filter((t) => t.status === status);
160
- if (search) {
161
- const q = search.toLowerCase();
162
- filtered = filtered.filter((t) => t.name.toLowerCase().includes(q) || t.description.toLowerCase().includes(q));
163
- }
164
- const total = filtered.length;
165
- const items = filtered.slice(offset, offset + limit).map((t) => ({
166
- id: t.id,
167
- name: t.name,
168
- slug: t.slug,
169
- description: t.description,
170
- category: t.category,
171
- status: t.status,
172
- version: t.version,
173
- createdAt: t.createdAt
174
- }));
175
- return { items, total, hasMore: offset + limit < total };
176
- }
177
- async function mockGetToolHandler(input) {
178
- const tool = MOCK_TOOLS.find((t) => t.id === input.toolId);
179
- if (!tool)
180
- throw new Error("TOOL_NOT_FOUND");
181
- return tool;
182
- }
183
- async function mockCreateToolHandler(input) {
184
- const exists = MOCK_TOOLS.some((t) => t.organizationId === input.organizationId && t.slug === input.slug);
185
- if (exists)
186
- throw new Error("SLUG_EXISTS");
187
- return {
188
- id: `tool-${Date.now()}`,
189
- name: input.name,
190
- slug: input.slug,
191
- status: "DRAFT"
192
- };
193
- }
194
- async function mockUpdateToolHandler(input) {
195
- const tool = MOCK_TOOLS.find((t) => t.id === input.toolId);
196
- if (!tool)
197
- throw new Error("TOOL_NOT_FOUND");
198
- return {
199
- id: tool.id,
200
- name: input.name ?? tool.name,
201
- status: input.status ?? tool.status,
202
- updatedAt: new Date
203
- };
204
- }
205
- async function mockTestToolHandler(input) {
206
- const tool = MOCK_TOOLS.find((t) => t.id === input.toolId);
207
- if (!tool)
208
- throw new Error("TOOL_NOT_FOUND");
209
- const startTime = Date.now();
210
- await new Promise((resolve) => setTimeout(resolve, 100));
211
- return {
212
- success: true,
213
- output: { result: "Test successful", input: input.testInput },
214
- durationMs: Date.now() - startTime
215
- };
216
- }
217
-
218
- // src/tool/tool.entity.ts
219
- import {
220
- defineEntity,
221
- defineEntityEnum,
222
- field,
223
- index
224
- } from "@contractspec/lib.schema";
225
- var ToolCategoryEntityEnum = defineEntityEnum({
226
- name: "ToolCategory",
227
- values: [
228
- "RETRIEVAL",
229
- "COMPUTATION",
230
- "COMMUNICATION",
231
- "INTEGRATION",
232
- "UTILITY",
233
- "CUSTOM"
234
- ],
235
- description: "Category of tool"
236
- });
237
- var ToolStatusEntityEnum = defineEntityEnum({
238
- name: "ToolStatus",
239
- values: ["DRAFT", "ACTIVE", "DEPRECATED", "DISABLED"],
240
- description: "Status of tool"
241
- });
242
- var ImplementationTypeEntityEnum = defineEntityEnum({
243
- name: "ImplementationType",
244
- values: ["http", "function", "workflow"],
245
- description: "How the tool is implemented"
246
- });
247
- var ToolEntity = defineEntity({
248
- name: "Tool",
249
- schema: "agent_console",
250
- description: "An AI tool that can be used by agents.",
251
- fields: {
252
- id: field.id(),
253
- organizationId: field.string({
254
- description: "Organization that owns this tool"
255
- }),
256
- name: field.string({ description: "Tool name" }),
257
- slug: field.string({ description: "URL-safe identifier" }),
258
- description: field.string({ description: "Tool description" }),
259
- category: field.enum("ToolCategory", { default: "CUSTOM" }),
260
- status: field.enum("ToolStatus", { default: "DRAFT" }),
261
- parametersSchema: field.json({
262
- description: "JSON Schema for tool parameters"
263
- }),
264
- outputSchema: field.json({
265
- isOptional: true,
266
- description: "JSON Schema for tool output"
267
- }),
268
- implementationType: field.enum("ImplementationType"),
269
- implementationConfig: field.json({
270
- description: "Implementation configuration"
271
- }),
272
- maxInvocationsPerMinute: field.int({
273
- isOptional: true,
274
- description: "Rate limit"
275
- }),
276
- timeoutMs: field.int({ default: 30000, description: "Execution timeout" }),
277
- version: field.string({ default: "1.0.0", description: "Tool version" }),
278
- tags: field.string({
279
- isArray: true,
280
- isOptional: true,
281
- description: "Tags for categorization"
282
- }),
283
- createdAt: field.createdAt(),
284
- updatedAt: field.updatedAt(),
285
- createdById: field.string({
286
- isOptional: true,
287
- description: "User who created this tool"
288
- }),
289
- agents: field.hasMany("Agent", { description: "Agents using this tool" })
290
- },
291
- indexes: [
292
- index.unique(["organizationId", "slug"]),
293
- index.on(["organizationId", "category"]),
294
- index.on(["organizationId", "status"])
295
- ],
296
- enums: [
297
- ToolCategoryEntityEnum,
298
- ToolStatusEntityEnum,
299
- ImplementationTypeEntityEnum
300
- ]
301
- });
302
-
303
145
  // src/tool/tool.enum.ts
304
146
  import { defineEnum } from "@contractspec/lib.schema";
305
147
  var ToolCategoryEnum = defineEnum("ToolCategory", [
@@ -322,209 +164,114 @@ var ImplementationTypeEnum = defineEnum("ImplementationType", [
322
164
  "workflow"
323
165
  ]);
324
166
 
325
- // src/tool/tool.event.ts
326
- import { defineEvent } from "@contractspec/lib.contracts-spec";
167
+ // src/tool/tool.schema.ts
327
168
  import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
328
- var OWNERS = ["@agent-console-team"];
329
- var ToolCreatedPayload = defineSchemaModel({
330
- name: "ToolCreatedPayload",
331
- description: "Payload for tool created event",
169
+ var ToolModel = defineSchemaModel({
170
+ name: "Tool",
171
+ description: "AI tool definition",
332
172
  fields: {
333
173
  id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
334
174
  organizationId: {
335
175
  type: ScalarTypeEnum.String_unsecure(),
336
176
  isOptional: false
337
177
  },
338
- name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
178
+ name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
339
179
  slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
340
- category: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
341
- implementationType: {
342
- type: ScalarTypeEnum.String_unsecure(),
343
- isOptional: false
344
- },
345
- createdById: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
346
- createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
347
- }
348
- });
349
- var ToolCreatedEvent = defineEvent({
350
- meta: {
351
- key: "agent.tool.created",
352
- version: "1.0.0",
353
- description: "A new AI tool was created.",
354
- stability: "stable",
355
- owners: [...OWNERS],
356
- tags: ["tool", "created"]
357
- },
358
- payload: ToolCreatedPayload
359
- });
360
- var ToolUpdatedPayload = defineSchemaModel({
361
- name: "ToolUpdatedPayload",
362
- description: "Payload for tool updated event",
363
- fields: {
364
- id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
365
- organizationId: {
366
- type: ScalarTypeEnum.String_unsecure(),
367
- isOptional: false
368
- },
369
- name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
370
- status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
371
- updatedFields: {
372
- type: ScalarTypeEnum.String_unsecure(),
373
- isArray: true,
374
- isOptional: false
375
- },
376
- updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
377
- }
378
- });
379
- var ToolUpdatedEvent = defineEvent({
380
- meta: {
381
- key: "agent.tool.updated",
382
- version: "1.0.0",
383
- description: "An AI tool configuration was updated.",
384
- stability: "stable",
385
- owners: [...OWNERS],
386
- tags: ["tool", "updated"]
387
- },
388
- payload: ToolUpdatedPayload
389
- });
390
- var ToolStatusChangedPayload = defineSchemaModel({
391
- name: "ToolStatusChangedPayload",
392
- description: "Payload for tool status changed event",
393
- fields: {
394
- id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
395
- organizationId: {
396
- type: ScalarTypeEnum.String_unsecure(),
397
- isOptional: false
398
- },
399
- name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
400
- previousStatus: {
401
- type: ScalarTypeEnum.String_unsecure(),
402
- isOptional: false
403
- },
404
- newStatus: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
405
- changedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
406
- }
407
- });
408
- var ToolStatusChangedEvent = defineEvent({
409
- meta: {
410
- key: "agent.tool.statusChanged",
411
- version: "1.0.0",
412
- description: "An AI tool status was changed (activated, deprecated, disabled).",
413
- stability: "stable",
414
- owners: [...OWNERS],
415
- tags: ["tool", "status"]
416
- },
417
- payload: ToolStatusChangedPayload
418
- });
419
-
420
- // src/tool/tool.schema.ts
421
- import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
422
- var ToolModel = defineSchemaModel2({
423
- name: "Tool",
424
- description: "AI tool definition",
425
- fields: {
426
- id: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
427
- organizationId: {
428
- type: ScalarTypeEnum2.String_unsecure(),
429
- isOptional: false
430
- },
431
- name: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
432
- slug: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
433
- description: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
180
+ description: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
434
181
  category: { type: ToolCategoryEnum, isOptional: false },
435
182
  status: { type: ToolStatusEnum, isOptional: false },
436
- parametersSchema: { type: ScalarTypeEnum2.JSONObject(), isOptional: false },
437
- outputSchema: { type: ScalarTypeEnum2.JSONObject(), isOptional: true },
183
+ parametersSchema: { type: ScalarTypeEnum.JSONObject(), isOptional: false },
184
+ outputSchema: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
438
185
  implementationType: { type: ImplementationTypeEnum, isOptional: false },
439
186
  implementationConfig: {
440
- type: ScalarTypeEnum2.JSONObject(),
187
+ type: ScalarTypeEnum.JSONObject(),
441
188
  isOptional: false
442
189
  },
443
190
  maxInvocationsPerMinute: {
444
- type: ScalarTypeEnum2.Int_unsecure(),
191
+ type: ScalarTypeEnum.Int_unsecure(),
445
192
  isOptional: true
446
193
  },
447
194
  timeoutMs: {
448
- type: ScalarTypeEnum2.Int_unsecure(),
195
+ type: ScalarTypeEnum.Int_unsecure(),
449
196
  isOptional: false,
450
197
  defaultValue: 30000
451
198
  },
452
- version: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
199
+ version: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
453
200
  tags: {
454
- type: ScalarTypeEnum2.String_unsecure(),
201
+ type: ScalarTypeEnum.String_unsecure(),
455
202
  isArray: true,
456
203
  isOptional: true
457
204
  },
458
- createdAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false },
459
- updatedAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
205
+ createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
206
+ updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
460
207
  }
461
208
  });
462
- var ToolSummaryModel = defineSchemaModel2({
209
+ var ToolSummaryModel = defineSchemaModel({
463
210
  name: "ToolSummary",
464
211
  description: "Summary of a tool for list views",
465
212
  fields: {
466
- id: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
467
- name: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
468
- slug: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
469
- description: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
213
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
214
+ name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
215
+ slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
216
+ description: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
470
217
  category: { type: ToolCategoryEnum, isOptional: false },
471
218
  status: { type: ToolStatusEnum, isOptional: false },
472
- version: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
473
- createdAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
219
+ version: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
220
+ createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
474
221
  }
475
222
  });
476
- var CreateToolInputModel = defineSchemaModel2({
223
+ var CreateToolInputModel = defineSchemaModel({
477
224
  name: "CreateToolInput",
478
225
  description: "Input for creating a tool",
479
226
  fields: {
480
227
  organizationId: {
481
- type: ScalarTypeEnum2.String_unsecure(),
228
+ type: ScalarTypeEnum.String_unsecure(),
482
229
  isOptional: false
483
230
  },
484
- name: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
485
- slug: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
486
- description: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
231
+ name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
232
+ slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
233
+ description: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
487
234
  category: { type: ToolCategoryEnum, isOptional: true },
488
- parametersSchema: { type: ScalarTypeEnum2.JSONObject(), isOptional: false },
489
- outputSchema: { type: ScalarTypeEnum2.JSONObject(), isOptional: true },
235
+ parametersSchema: { type: ScalarTypeEnum.JSONObject(), isOptional: false },
236
+ outputSchema: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
490
237
  implementationType: { type: ImplementationTypeEnum, isOptional: false },
491
238
  implementationConfig: {
492
- type: ScalarTypeEnum2.JSONObject(),
239
+ type: ScalarTypeEnum.JSONObject(),
493
240
  isOptional: false
494
241
  },
495
242
  maxInvocationsPerMinute: {
496
- type: ScalarTypeEnum2.Int_unsecure(),
243
+ type: ScalarTypeEnum.Int_unsecure(),
497
244
  isOptional: true
498
245
  },
499
- timeoutMs: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: true },
246
+ timeoutMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
500
247
  tags: {
501
- type: ScalarTypeEnum2.String_unsecure(),
248
+ type: ScalarTypeEnum.String_unsecure(),
502
249
  isArray: true,
503
250
  isOptional: true
504
251
  }
505
252
  }
506
253
  });
507
- var UpdateToolInputModel = defineSchemaModel2({
254
+ var UpdateToolInputModel = defineSchemaModel({
508
255
  name: "UpdateToolInput",
509
256
  description: "Input for updating a tool",
510
257
  fields: {
511
- toolId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
512
- name: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: true },
513
- description: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
258
+ toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
259
+ name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: true },
260
+ description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
514
261
  status: { type: ToolStatusEnum, isOptional: true },
515
- parametersSchema: { type: ScalarTypeEnum2.JSONObject(), isOptional: true },
516
- outputSchema: { type: ScalarTypeEnum2.JSONObject(), isOptional: true },
262
+ parametersSchema: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
263
+ outputSchema: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
517
264
  implementationConfig: {
518
- type: ScalarTypeEnum2.JSONObject(),
265
+ type: ScalarTypeEnum.JSONObject(),
519
266
  isOptional: true
520
267
  },
521
268
  maxInvocationsPerMinute: {
522
- type: ScalarTypeEnum2.Int_unsecure(),
269
+ type: ScalarTypeEnum.Int_unsecure(),
523
270
  isOptional: true
524
271
  },
525
- timeoutMs: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: true },
272
+ timeoutMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
526
273
  tags: {
527
- type: ScalarTypeEnum2.String_unsecure(),
274
+ type: ScalarTypeEnum.String_unsecure(),
528
275
  isArray: true,
529
276
  isOptional: true
530
277
  }
@@ -536,14 +283,14 @@ import {
536
283
  defineCommand,
537
284
  defineQuery
538
285
  } from "@contractspec/lib.contracts-spec/operations";
539
- import { defineSchemaModel as defineSchemaModel3, ScalarTypeEnum as ScalarTypeEnum3 } from "@contractspec/lib.schema";
540
- var OWNERS2 = ["@agent-console-team"];
286
+ import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
287
+ var OWNERS = ["@agent-console-team"];
541
288
  var CreateToolCommand = defineCommand({
542
289
  meta: {
543
290
  key: "agent.tool.create",
544
291
  version: "1.0.0",
545
292
  stability: "stable",
546
- owners: [...OWNERS2],
293
+ owners: [...OWNERS],
547
294
  tags: ["tool", "create"],
548
295
  description: "Creates a new AI tool definition.",
549
296
  goal: "Allow users to define new tools that agents can use.",
@@ -551,12 +298,12 @@ var CreateToolCommand = defineCommand({
551
298
  },
552
299
  io: {
553
300
  input: CreateToolInputModel,
554
- output: defineSchemaModel3({
301
+ output: defineSchemaModel2({
555
302
  name: "CreateToolOutput",
556
303
  fields: {
557
- id: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
558
- name: { type: ScalarTypeEnum3.NonEmptyString(), isOptional: false },
559
- slug: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
304
+ id: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
305
+ name: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
306
+ slug: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
560
307
  status: { type: ToolStatusEnum, isOptional: false }
561
308
  }
562
309
  }),
@@ -576,7 +323,7 @@ var CreateToolCommand = defineCommand({
576
323
  key: "tool.created",
577
324
  version: "1.0.0",
578
325
  stability: "stable",
579
- owners: [...OWNERS2],
326
+ owners: [...OWNERS],
580
327
  tags: ["tool", "created"],
581
328
  when: "Tool is successfully created",
582
329
  payload: ToolSummaryModel
@@ -623,7 +370,7 @@ var UpdateToolCommand = defineCommand({
623
370
  key: "agent.tool.update",
624
371
  version: "1.0.0",
625
372
  stability: "stable",
626
- owners: [...OWNERS2],
373
+ owners: [...OWNERS],
627
374
  tags: ["tool", "update"],
628
375
  description: "Updates an existing AI tool definition.",
629
376
  goal: "Allow users to modify tool settings and configuration.",
@@ -631,13 +378,13 @@ var UpdateToolCommand = defineCommand({
631
378
  },
632
379
  io: {
633
380
  input: UpdateToolInputModel,
634
- output: defineSchemaModel3({
381
+ output: defineSchemaModel2({
635
382
  name: "UpdateToolOutput",
636
383
  fields: {
637
- id: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
638
- name: { type: ScalarTypeEnum3.NonEmptyString(), isOptional: false },
384
+ id: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
385
+ name: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
639
386
  status: { type: ToolStatusEnum, isOptional: false },
640
- updatedAt: { type: ScalarTypeEnum3.DateTime(), isOptional: false }
387
+ updatedAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
641
388
  }
642
389
  }),
643
390
  errors: {
@@ -656,7 +403,7 @@ var UpdateToolCommand = defineCommand({
656
403
  key: "tool.updated",
657
404
  version: "1.0.0",
658
405
  stability: "stable",
659
- owners: [...OWNERS2],
406
+ owners: [...OWNERS],
660
407
  tags: ["tool", "updated"],
661
408
  when: "Tool is updated",
662
409
  payload: ToolSummaryModel
@@ -692,17 +439,17 @@ var GetToolQuery = defineQuery({
692
439
  key: "agent.tool.get",
693
440
  version: "1.0.0",
694
441
  stability: "stable",
695
- owners: [...OWNERS2],
442
+ owners: [...OWNERS],
696
443
  tags: ["tool", "get"],
697
444
  description: "Retrieves a tool by its ID.",
698
445
  goal: "View detailed tool configuration.",
699
446
  context: "Called when viewing tool details or editing."
700
447
  },
701
448
  io: {
702
- input: defineSchemaModel3({
449
+ input: defineSchemaModel2({
703
450
  name: "GetToolInput",
704
451
  fields: {
705
- toolId: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false }
452
+ toolId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false }
706
453
  }
707
454
  }),
708
455
  output: ToolModel,
@@ -744,41 +491,41 @@ var ListToolsQuery = defineQuery({
744
491
  key: "agent.tool.list",
745
492
  version: "1.0.0",
746
493
  stability: "stable",
747
- owners: [...OWNERS2],
494
+ owners: [...OWNERS],
748
495
  tags: ["tool", "list"],
749
496
  description: "Lists tools for an organization with optional filtering.",
750
497
  goal: "Browse and search available tools.",
751
498
  context: "Tool list/dashboard view."
752
499
  },
753
500
  io: {
754
- input: defineSchemaModel3({
501
+ input: defineSchemaModel2({
755
502
  name: "ListToolsInput",
756
503
  fields: {
757
504
  organizationId: {
758
- type: ScalarTypeEnum3.String_unsecure(),
505
+ type: ScalarTypeEnum2.String_unsecure(),
759
506
  isOptional: false
760
507
  },
761
508
  category: { type: ToolCategoryEnum, isOptional: true },
762
509
  status: { type: ToolStatusEnum, isOptional: true },
763
- search: { type: ScalarTypeEnum3.String_unsecure(), isOptional: true },
510
+ search: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
764
511
  limit: {
765
- type: ScalarTypeEnum3.Int_unsecure(),
512
+ type: ScalarTypeEnum2.Int_unsecure(),
766
513
  isOptional: true,
767
514
  defaultValue: 20
768
515
  },
769
516
  offset: {
770
- type: ScalarTypeEnum3.Int_unsecure(),
517
+ type: ScalarTypeEnum2.Int_unsecure(),
771
518
  isOptional: true,
772
519
  defaultValue: 0
773
520
  }
774
521
  }
775
522
  }),
776
- output: defineSchemaModel3({
523
+ output: defineSchemaModel2({
777
524
  name: "ListToolsOutput",
778
525
  fields: {
779
526
  items: { type: ToolSummaryModel, isArray: true, isOptional: false },
780
- total: { type: ScalarTypeEnum3.Int_unsecure(), isOptional: false },
781
- hasMore: { type: ScalarTypeEnum3.Boolean(), isOptional: false }
527
+ total: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false },
528
+ hasMore: { type: ScalarTypeEnum2.Boolean(), isOptional: false }
782
529
  }
783
530
  })
784
531
  },
@@ -806,27 +553,27 @@ var TestToolCommand = defineCommand({
806
553
  key: "agent.tool.test",
807
554
  version: "1.0.0",
808
555
  stability: "stable",
809
- owners: [...OWNERS2],
556
+ owners: [...OWNERS],
810
557
  tags: ["tool", "test"],
811
558
  description: "Tests a tool with sample input to verify it works correctly.",
812
559
  goal: "Validate tool configuration before deployment.",
813
560
  context: "Tool builder UI - test panel."
814
561
  },
815
562
  io: {
816
- input: defineSchemaModel3({
563
+ input: defineSchemaModel2({
817
564
  name: "TestToolInput",
818
565
  fields: {
819
- toolId: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
820
- testInput: { type: ScalarTypeEnum3.JSONObject(), isOptional: false }
566
+ toolId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
567
+ testInput: { type: ScalarTypeEnum2.JSONObject(), isOptional: false }
821
568
  }
822
569
  }),
823
- output: defineSchemaModel3({
570
+ output: defineSchemaModel2({
824
571
  name: "TestToolOutput",
825
572
  fields: {
826
- success: { type: ScalarTypeEnum3.Boolean(), isOptional: false },
827
- output: { type: ScalarTypeEnum3.JSONObject(), isOptional: true },
828
- error: { type: ScalarTypeEnum3.String_unsecure(), isOptional: true },
829
- durationMs: { type: ScalarTypeEnum3.Int_unsecure(), isOptional: false }
573
+ success: { type: ScalarTypeEnum2.Boolean(), isOptional: false },
574
+ output: { type: ScalarTypeEnum2.JSONObject(), isOptional: true },
575
+ error: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
576
+ durationMs: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: false }
830
577
  }
831
578
  }),
832
579
  errors: {
@@ -871,6 +618,259 @@ var TestToolCommand = defineCommand({
871
618
  }
872
619
  });
873
620
 
621
+ // src/tool/tool.handler.ts
622
+ var nextMockToolId = MOCK_TOOLS.length + 1;
623
+ async function mockListToolsHandler(input) {
624
+ const {
625
+ organizationId,
626
+ category,
627
+ status,
628
+ search,
629
+ limit = 20,
630
+ offset = 0
631
+ } = input;
632
+ let filtered = MOCK_TOOLS.filter((t) => t.organizationId === organizationId);
633
+ if (category)
634
+ filtered = filtered.filter((t) => t.category === category);
635
+ if (status)
636
+ filtered = filtered.filter((t) => t.status === status);
637
+ if (search) {
638
+ const q = search.toLowerCase();
639
+ filtered = filtered.filter((t) => t.name.toLowerCase().includes(q) || t.description.toLowerCase().includes(q));
640
+ }
641
+ const total = filtered.length;
642
+ const items = filtered.slice(offset, offset + limit).map((t) => ({
643
+ id: t.id,
644
+ name: t.name,
645
+ slug: t.slug,
646
+ description: t.description,
647
+ category: t.category,
648
+ status: t.status,
649
+ version: t.version,
650
+ createdAt: t.createdAt
651
+ }));
652
+ return { items, total, hasMore: offset + limit < total };
653
+ }
654
+ async function mockGetToolHandler(input) {
655
+ const tool = MOCK_TOOLS.find((t) => t.id === input.toolId);
656
+ if (!tool)
657
+ throw new Error("TOOL_NOT_FOUND");
658
+ return tool;
659
+ }
660
+ async function mockCreateToolHandler(input) {
661
+ const exists = MOCK_TOOLS.some((t) => t.organizationId === input.organizationId && t.slug === input.slug);
662
+ if (exists)
663
+ throw new Error("SLUG_EXISTS");
664
+ return {
665
+ id: `tool-${nextMockToolId++}`,
666
+ name: input.name,
667
+ slug: input.slug,
668
+ status: "DRAFT"
669
+ };
670
+ }
671
+ async function mockUpdateToolHandler(input) {
672
+ const tool = MOCK_TOOLS.find((t) => t.id === input.toolId);
673
+ if (!tool)
674
+ throw new Error("TOOL_NOT_FOUND");
675
+ return {
676
+ id: tool.id,
677
+ name: input.name ?? tool.name,
678
+ status: input.status ?? tool.status,
679
+ updatedAt: new Date
680
+ };
681
+ }
682
+ async function mockTestToolHandler(input) {
683
+ const tool = MOCK_TOOLS.find((t) => t.id === input.toolId);
684
+ if (!tool)
685
+ throw new Error("TOOL_NOT_FOUND");
686
+ await new Promise((resolve) => setTimeout(resolve, 100));
687
+ return {
688
+ success: true,
689
+ output: { result: "Test successful", input: input.testInput },
690
+ durationMs: 100
691
+ };
692
+ }
693
+
694
+ // src/tool/tool.entity.ts
695
+ import {
696
+ defineEntity,
697
+ defineEntityEnum,
698
+ field,
699
+ index
700
+ } from "@contractspec/lib.schema";
701
+ var ToolCategoryEntityEnum = defineEntityEnum({
702
+ name: "ToolCategory",
703
+ values: [
704
+ "RETRIEVAL",
705
+ "COMPUTATION",
706
+ "COMMUNICATION",
707
+ "INTEGRATION",
708
+ "UTILITY",
709
+ "CUSTOM"
710
+ ],
711
+ description: "Category of tool"
712
+ });
713
+ var ToolStatusEntityEnum = defineEntityEnum({
714
+ name: "ToolStatus",
715
+ values: ["DRAFT", "ACTIVE", "DEPRECATED", "DISABLED"],
716
+ description: "Status of tool"
717
+ });
718
+ var ImplementationTypeEntityEnum = defineEntityEnum({
719
+ name: "ImplementationType",
720
+ values: ["http", "function", "workflow"],
721
+ description: "How the tool is implemented"
722
+ });
723
+ var ToolEntity = defineEntity({
724
+ name: "Tool",
725
+ schema: "agent_console",
726
+ description: "An AI tool that can be used by agents.",
727
+ fields: {
728
+ id: field.id(),
729
+ organizationId: field.string({
730
+ description: "Organization that owns this tool"
731
+ }),
732
+ name: field.string({ description: "Tool name" }),
733
+ slug: field.string({ description: "URL-safe identifier" }),
734
+ description: field.string({ description: "Tool description" }),
735
+ category: field.enum("ToolCategory", { default: "CUSTOM" }),
736
+ status: field.enum("ToolStatus", { default: "DRAFT" }),
737
+ parametersSchema: field.json({
738
+ description: "JSON Schema for tool parameters"
739
+ }),
740
+ outputSchema: field.json({
741
+ isOptional: true,
742
+ description: "JSON Schema for tool output"
743
+ }),
744
+ implementationType: field.enum("ImplementationType"),
745
+ implementationConfig: field.json({
746
+ description: "Implementation configuration"
747
+ }),
748
+ maxInvocationsPerMinute: field.int({
749
+ isOptional: true,
750
+ description: "Rate limit"
751
+ }),
752
+ timeoutMs: field.int({ default: 30000, description: "Execution timeout" }),
753
+ version: field.string({ default: "1.0.0", description: "Tool version" }),
754
+ tags: field.string({
755
+ isArray: true,
756
+ isOptional: true,
757
+ description: "Tags for categorization"
758
+ }),
759
+ createdAt: field.createdAt(),
760
+ updatedAt: field.updatedAt(),
761
+ createdById: field.string({
762
+ isOptional: true,
763
+ description: "User who created this tool"
764
+ }),
765
+ agents: field.hasMany("Agent", { description: "Agents using this tool" })
766
+ },
767
+ indexes: [
768
+ index.unique(["organizationId", "slug"]),
769
+ index.on(["organizationId", "category"]),
770
+ index.on(["organizationId", "status"])
771
+ ],
772
+ enums: [
773
+ ToolCategoryEntityEnum,
774
+ ToolStatusEntityEnum,
775
+ ImplementationTypeEntityEnum
776
+ ]
777
+ });
778
+
779
+ // src/tool/tool.event.ts
780
+ import { defineEvent } from "@contractspec/lib.contracts-spec";
781
+ import { defineSchemaModel as defineSchemaModel3, ScalarTypeEnum as ScalarTypeEnum3 } from "@contractspec/lib.schema";
782
+ var OWNERS2 = ["@agent-console-team"];
783
+ var ToolCreatedPayload = defineSchemaModel3({
784
+ name: "ToolCreatedPayload",
785
+ description: "Payload for tool created event",
786
+ fields: {
787
+ id: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
788
+ organizationId: {
789
+ type: ScalarTypeEnum3.String_unsecure(),
790
+ isOptional: false
791
+ },
792
+ name: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
793
+ slug: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
794
+ category: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
795
+ implementationType: {
796
+ type: ScalarTypeEnum3.String_unsecure(),
797
+ isOptional: false
798
+ },
799
+ createdById: { type: ScalarTypeEnum3.String_unsecure(), isOptional: true },
800
+ createdAt: { type: ScalarTypeEnum3.DateTime(), isOptional: false }
801
+ }
802
+ });
803
+ var ToolCreatedEvent = defineEvent({
804
+ meta: {
805
+ key: "agent.tool.created",
806
+ version: "1.0.0",
807
+ description: "A new AI tool was created.",
808
+ stability: "stable",
809
+ owners: [...OWNERS2],
810
+ tags: ["tool", "created"]
811
+ },
812
+ payload: ToolCreatedPayload
813
+ });
814
+ var ToolUpdatedPayload = defineSchemaModel3({
815
+ name: "ToolUpdatedPayload",
816
+ description: "Payload for tool updated event",
817
+ fields: {
818
+ id: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
819
+ organizationId: {
820
+ type: ScalarTypeEnum3.String_unsecure(),
821
+ isOptional: false
822
+ },
823
+ name: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
824
+ status: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
825
+ updatedFields: {
826
+ type: ScalarTypeEnum3.String_unsecure(),
827
+ isArray: true,
828
+ isOptional: false
829
+ },
830
+ updatedAt: { type: ScalarTypeEnum3.DateTime(), isOptional: false }
831
+ }
832
+ });
833
+ var ToolUpdatedEvent = defineEvent({
834
+ meta: {
835
+ key: "agent.tool.updated",
836
+ version: "1.0.0",
837
+ description: "An AI tool configuration was updated.",
838
+ stability: "stable",
839
+ owners: [...OWNERS2],
840
+ tags: ["tool", "updated"]
841
+ },
842
+ payload: ToolUpdatedPayload
843
+ });
844
+ var ToolStatusChangedPayload = defineSchemaModel3({
845
+ name: "ToolStatusChangedPayload",
846
+ description: "Payload for tool status changed event",
847
+ fields: {
848
+ id: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
849
+ organizationId: {
850
+ type: ScalarTypeEnum3.String_unsecure(),
851
+ isOptional: false
852
+ },
853
+ name: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
854
+ previousStatus: {
855
+ type: ScalarTypeEnum3.String_unsecure(),
856
+ isOptional: false
857
+ },
858
+ newStatus: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
859
+ changedAt: { type: ScalarTypeEnum3.DateTime(), isOptional: false }
860
+ }
861
+ });
862
+ var ToolStatusChangedEvent = defineEvent({
863
+ meta: {
864
+ key: "agent.tool.statusChanged",
865
+ version: "1.0.0",
866
+ description: "An AI tool status was changed (activated, deprecated, disabled).",
867
+ stability: "stable",
868
+ owners: [...OWNERS2],
869
+ tags: ["tool", "status"]
870
+ },
871
+ payload: ToolStatusChangedPayload
872
+ });
873
+
874
874
  // src/tool/tool.presentation.ts
875
875
  import {
876
876
  definePresentation,