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