@contractspec/example.agent-console 3.7.6 → 3.7.7
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.
- package/.turbo/turbo-build.log +18 -18
- package/AGENTS.md +50 -31
- package/README.md +69 -77
- package/dist/agent/agent.event.js +1 -1
- package/dist/agent/agent.operation.js +1 -1
- package/dist/agent/index.d.ts +5 -5
- package/dist/agent/index.js +1 -1
- package/dist/browser/agent/agent.event.js +1 -1
- package/dist/browser/agent/agent.operation.js +1 -1
- package/dist/browser/agent/index.js +1 -1
- package/dist/browser/index.js +2145 -2145
- package/dist/browser/presentations/index.js +4 -4
- package/dist/browser/run/index.js +536 -536
- package/dist/browser/run/run.event.js +2 -2
- package/dist/browser/run/run.presentation.js +2 -2
- package/dist/browser/tool/index.js +260 -260
- package/dist/browser/tool/tool.event.js +1 -1
- package/dist/browser/tool/tool.presentation.js +2 -2
- package/dist/browser/ui/AgentDashboard.js +956 -956
- package/dist/browser/ui/AgentRunList.js +16 -16
- package/dist/browser/ui/AgentToolRegistry.js +9 -9
- package/dist/browser/ui/hooks/index.js +153 -153
- package/dist/browser/ui/hooks/useAgentList.js +1 -1
- package/dist/browser/ui/hooks/useAgentMutations.js +1 -1
- package/dist/browser/ui/hooks/useRunList.js +1 -1
- package/dist/browser/ui/hooks/useToolList.js +1 -1
- package/dist/browser/ui/index.js +1222 -1222
- package/dist/browser/ui/modals/AgentActionsModal.js +13 -13
- package/dist/browser/ui/modals/CreateAgentModal.js +15 -15
- package/dist/browser/ui/modals/index.js +297 -297
- package/dist/browser/ui/renderers/agent-list.renderer.js +7 -7
- package/dist/browser/ui/renderers/index.js +157 -157
- package/dist/browser/ui/views/AgentListView.js +7 -7
- package/dist/browser/ui/views/RunListView.js +16 -16
- package/dist/browser/ui/views/ToolRegistryView.js +9 -9
- package/dist/browser/ui/views/index.js +97 -97
- package/dist/handlers/index.d.ts +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2145 -2145
- package/dist/node/agent/agent.event.js +1 -1
- package/dist/node/agent/agent.operation.js +1 -1
- package/dist/node/agent/index.js +1 -1
- package/dist/node/index.js +2145 -2145
- package/dist/node/presentations/index.js +4 -4
- package/dist/node/run/index.js +536 -536
- package/dist/node/run/run.event.js +2 -2
- package/dist/node/run/run.presentation.js +2 -2
- package/dist/node/tool/index.js +260 -260
- package/dist/node/tool/tool.event.js +1 -1
- package/dist/node/tool/tool.presentation.js +2 -2
- package/dist/node/ui/AgentDashboard.js +956 -956
- package/dist/node/ui/AgentRunList.js +16 -16
- package/dist/node/ui/AgentToolRegistry.js +9 -9
- package/dist/node/ui/hooks/index.js +153 -153
- package/dist/node/ui/hooks/useAgentList.js +1 -1
- package/dist/node/ui/hooks/useAgentMutations.js +1 -1
- package/dist/node/ui/hooks/useRunList.js +1 -1
- package/dist/node/ui/hooks/useToolList.js +1 -1
- package/dist/node/ui/index.js +1222 -1222
- package/dist/node/ui/modals/AgentActionsModal.js +13 -13
- package/dist/node/ui/modals/CreateAgentModal.js +15 -15
- package/dist/node/ui/modals/index.js +297 -297
- package/dist/node/ui/renderers/agent-list.renderer.js +7 -7
- package/dist/node/ui/renderers/index.js +157 -157
- package/dist/node/ui/views/AgentListView.js +7 -7
- package/dist/node/ui/views/RunListView.js +16 -16
- package/dist/node/ui/views/ToolRegistryView.js +9 -9
- package/dist/node/ui/views/index.js +97 -97
- package/dist/presentations/index.d.ts +3 -5
- package/dist/presentations/index.js +4 -4
- package/dist/run/index.d.ts +7 -7
- package/dist/run/index.js +536 -536
- package/dist/run/run.event.js +2 -2
- package/dist/run/run.handler.d.ts +3 -0
- package/dist/run/run.presentation.js +2 -2
- package/dist/shared/index.d.ts +1 -1
- package/dist/tool/index.d.ts +7 -7
- package/dist/tool/index.js +260 -260
- package/dist/tool/tool.event.js +1 -1
- package/dist/tool/tool.handler.d.ts +1 -1
- package/dist/tool/tool.presentation.js +2 -2
- package/dist/ui/AgentDashboard.js +956 -956
- package/dist/ui/AgentRunList.js +16 -16
- package/dist/ui/AgentToolRegistry.js +9 -9
- package/dist/ui/hooks/index.d.ts +4 -4
- package/dist/ui/hooks/index.js +153 -153
- package/dist/ui/hooks/useAgentList.d.ts +5 -0
- package/dist/ui/hooks/useAgentList.js +1 -1
- package/dist/ui/hooks/useAgentMutations.d.ts +9 -2
- package/dist/ui/hooks/useAgentMutations.js +1 -1
- package/dist/ui/hooks/useRunList.d.ts +5 -0
- package/dist/ui/hooks/useRunList.js +1 -1
- package/dist/ui/hooks/useToolList.d.ts +5 -0
- package/dist/ui/hooks/useToolList.js +1 -1
- package/dist/ui/index.d.ts +3 -3
- package/dist/ui/index.js +1222 -1222
- package/dist/ui/modals/AgentActionsModal.js +13 -13
- package/dist/ui/modals/CreateAgentModal.js +15 -15
- package/dist/ui/modals/index.d.ts +1 -1
- package/dist/ui/modals/index.js +297 -297
- package/dist/ui/renderers/agent-list.markdown.d.ts +5 -0
- package/dist/ui/renderers/agent-list.renderer.js +7 -7
- package/dist/ui/renderers/dashboard.markdown.d.ts +5 -0
- package/dist/ui/renderers/index.d.ts +2 -2
- package/dist/ui/renderers/index.js +157 -157
- package/dist/ui/renderers/run-list.markdown.d.ts +5 -0
- package/dist/ui/renderers/tool-registry.markdown.d.ts +5 -0
- package/dist/ui/views/AgentListView.js +7 -7
- package/dist/ui/views/RunListView.js +16 -16
- package/dist/ui/views/ToolRegistryView.js +9 -9
- package/dist/ui/views/index.js +97 -97
- package/package.json +6 -6
- package/src/agent/agent.entity.ts +111 -111
- package/src/agent/agent.enum.ts +12 -12
- package/src/agent/agent.event.ts +91 -91
- package/src/agent/agent.handler.ts +123 -123
- package/src/agent/agent.operation.ts +400 -400
- package/src/agent/agent.presentation.ts +62 -62
- package/src/agent/agent.schema.ts +175 -175
- package/src/agent/agent.test-spec.ts +48 -48
- package/src/agent/index.ts +46 -51
- package/src/agent.capability.ts +11 -11
- package/src/agent.feature.ts +131 -131
- package/src/docs/agent-console.docblock.ts +42 -42
- package/src/example.ts +35 -35
- package/src/handlers/agent.handlers.ts +522 -521
- package/src/handlers/index.ts +12 -12
- package/src/index.ts +8 -9
- package/src/presentations/index.ts +11 -13
- package/src/run/index.ts +49 -54
- package/src/run/run.entity.ts +137 -137
- package/src/run/run.enum.ts +18 -18
- package/src/run/run.event.ts +174 -174
- package/src/run/run.handler.ts +92 -91
- package/src/run/run.operation.ts +474 -474
- package/src/run/run.presentation.ts +42 -42
- package/src/run/run.schema.ts +126 -126
- package/src/run/run.test-spec.ts +48 -48
- package/src/seeders/index.ts +21 -21
- package/src/shared/index.ts +1 -1
- package/src/shared/mock-agents.ts +76 -76
- package/src/shared/mock-runs.ts +102 -102
- package/src/shared/mock-tools.ts +140 -140
- package/src/shared/overlay-types.ts +23 -23
- package/src/tool/index.ts +39 -44
- package/src/tool/tool.entity.ts +73 -73
- package/src/tool/tool.enum.ts +13 -13
- package/src/tool/tool.event.ts +80 -80
- package/src/tool/tool.handler.ts +102 -102
- package/src/tool/tool.operation.ts +328 -328
- package/src/tool/tool.presentation.ts +43 -43
- package/src/tool/tool.schema.ts +106 -106
- package/src/tool/tool.test-spec.ts +48 -48
- package/src/ui/AgentDashboard.tsx +348 -348
- package/src/ui/hooks/index.ts +7 -7
- package/src/ui/hooks/useAgentList.ts +57 -56
- package/src/ui/hooks/useAgentMutations.ts +160 -159
- package/src/ui/hooks/useRunList.ts +58 -57
- package/src/ui/hooks/useToolList.ts +102 -101
- package/src/ui/index.ts +6 -9
- package/src/ui/modals/AgentActionsModal.tsx +262 -262
- package/src/ui/modals/CreateAgentModal.tsx +232 -232
- package/src/ui/modals/index.ts +1 -1
- package/src/ui/overlays/demo-overlays.ts +52 -52
- package/src/ui/renderers/agent-list.markdown.ts +61 -60
- package/src/ui/renderers/agent-list.renderer.tsx +14 -14
- package/src/ui/renderers/dashboard.markdown.ts +140 -139
- package/src/ui/renderers/index.ts +3 -4
- package/src/ui/renderers/run-list.markdown.ts +48 -47
- package/src/ui/renderers/tool-registry.markdown.ts +66 -65
- package/src/ui/views/AgentListView.tsx +90 -90
- package/src/ui/views/RunListView.tsx +141 -141
- package/src/ui/views/ToolRegistryView.tsx +113 -113
- package/tsconfig.json +7 -8
- package/tsdown.config.js +7 -3
package/dist/tool/index.js
CHANGED
|
@@ -216,6 +216,91 @@ async function mockTestToolHandler(input) {
|
|
|
216
216
|
};
|
|
217
217
|
}
|
|
218
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
|
+
|
|
219
304
|
// src/tool/tool.enum.ts
|
|
220
305
|
import { defineEnum } from "@contractspec/lib.schema";
|
|
221
306
|
var ToolCategoryEnum = defineEnum("ToolCategory", [
|
|
@@ -238,114 +323,209 @@ var ImplementationTypeEnum = defineEnum("ImplementationType", [
|
|
|
238
323
|
"workflow"
|
|
239
324
|
]);
|
|
240
325
|
|
|
241
|
-
// src/tool/tool.
|
|
326
|
+
// src/tool/tool.event.ts
|
|
327
|
+
import { defineEvent } from "@contractspec/lib.contracts-spec";
|
|
242
328
|
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
243
|
-
var
|
|
244
|
-
|
|
245
|
-
|
|
329
|
+
var OWNERS = ["@agent-console-team"];
|
|
330
|
+
var ToolCreatedPayload = defineSchemaModel({
|
|
331
|
+
name: "ToolCreatedPayload",
|
|
332
|
+
description: "Payload for tool created event",
|
|
246
333
|
fields: {
|
|
247
334
|
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
248
335
|
organizationId: {
|
|
249
336
|
type: ScalarTypeEnum.String_unsecure(),
|
|
250
337
|
isOptional: false
|
|
251
338
|
},
|
|
252
|
-
name: { type: ScalarTypeEnum.
|
|
339
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
253
340
|
slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
254
|
-
|
|
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 },
|
|
255
435
|
category: { type: ToolCategoryEnum, isOptional: false },
|
|
256
436
|
status: { type: ToolStatusEnum, isOptional: false },
|
|
257
|
-
parametersSchema: { type:
|
|
258
|
-
outputSchema: { type:
|
|
437
|
+
parametersSchema: { type: ScalarTypeEnum2.JSONObject(), isOptional: false },
|
|
438
|
+
outputSchema: { type: ScalarTypeEnum2.JSONObject(), isOptional: true },
|
|
259
439
|
implementationType: { type: ImplementationTypeEnum, isOptional: false },
|
|
260
440
|
implementationConfig: {
|
|
261
|
-
type:
|
|
441
|
+
type: ScalarTypeEnum2.JSONObject(),
|
|
262
442
|
isOptional: false
|
|
263
443
|
},
|
|
264
444
|
maxInvocationsPerMinute: {
|
|
265
|
-
type:
|
|
445
|
+
type: ScalarTypeEnum2.Int_unsecure(),
|
|
266
446
|
isOptional: true
|
|
267
447
|
},
|
|
268
448
|
timeoutMs: {
|
|
269
|
-
type:
|
|
449
|
+
type: ScalarTypeEnum2.Int_unsecure(),
|
|
270
450
|
isOptional: false,
|
|
271
451
|
defaultValue: 30000
|
|
272
452
|
},
|
|
273
|
-
version: { type:
|
|
453
|
+
version: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
|
|
274
454
|
tags: {
|
|
275
|
-
type:
|
|
455
|
+
type: ScalarTypeEnum2.String_unsecure(),
|
|
276
456
|
isArray: true,
|
|
277
457
|
isOptional: true
|
|
278
458
|
},
|
|
279
|
-
createdAt: { type:
|
|
280
|
-
updatedAt: { type:
|
|
459
|
+
createdAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false },
|
|
460
|
+
updatedAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
|
|
281
461
|
}
|
|
282
462
|
});
|
|
283
|
-
var ToolSummaryModel =
|
|
463
|
+
var ToolSummaryModel = defineSchemaModel2({
|
|
284
464
|
name: "ToolSummary",
|
|
285
465
|
description: "Summary of a tool for list views",
|
|
286
466
|
fields: {
|
|
287
|
-
id: { type:
|
|
288
|
-
name: { type:
|
|
289
|
-
slug: { type:
|
|
290
|
-
description: { type:
|
|
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 },
|
|
291
471
|
category: { type: ToolCategoryEnum, isOptional: false },
|
|
292
472
|
status: { type: ToolStatusEnum, isOptional: false },
|
|
293
|
-
version: { type:
|
|
294
|
-
createdAt: { type:
|
|
473
|
+
version: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
|
|
474
|
+
createdAt: { type: ScalarTypeEnum2.DateTime(), isOptional: false }
|
|
295
475
|
}
|
|
296
476
|
});
|
|
297
|
-
var CreateToolInputModel =
|
|
477
|
+
var CreateToolInputModel = defineSchemaModel2({
|
|
298
478
|
name: "CreateToolInput",
|
|
299
479
|
description: "Input for creating a tool",
|
|
300
480
|
fields: {
|
|
301
481
|
organizationId: {
|
|
302
|
-
type:
|
|
482
|
+
type: ScalarTypeEnum2.String_unsecure(),
|
|
303
483
|
isOptional: false
|
|
304
484
|
},
|
|
305
|
-
name: { type:
|
|
306
|
-
slug: { type:
|
|
307
|
-
description: { type:
|
|
485
|
+
name: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: false },
|
|
486
|
+
slug: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
487
|
+
description: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
308
488
|
category: { type: ToolCategoryEnum, isOptional: true },
|
|
309
|
-
parametersSchema: { type:
|
|
310
|
-
outputSchema: { type:
|
|
489
|
+
parametersSchema: { type: ScalarTypeEnum2.JSONObject(), isOptional: false },
|
|
490
|
+
outputSchema: { type: ScalarTypeEnum2.JSONObject(), isOptional: true },
|
|
311
491
|
implementationType: { type: ImplementationTypeEnum, isOptional: false },
|
|
312
492
|
implementationConfig: {
|
|
313
|
-
type:
|
|
493
|
+
type: ScalarTypeEnum2.JSONObject(),
|
|
314
494
|
isOptional: false
|
|
315
495
|
},
|
|
316
496
|
maxInvocationsPerMinute: {
|
|
317
|
-
type:
|
|
497
|
+
type: ScalarTypeEnum2.Int_unsecure(),
|
|
318
498
|
isOptional: true
|
|
319
499
|
},
|
|
320
|
-
timeoutMs: { type:
|
|
500
|
+
timeoutMs: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: true },
|
|
321
501
|
tags: {
|
|
322
|
-
type:
|
|
502
|
+
type: ScalarTypeEnum2.String_unsecure(),
|
|
323
503
|
isArray: true,
|
|
324
504
|
isOptional: true
|
|
325
505
|
}
|
|
326
506
|
}
|
|
327
507
|
});
|
|
328
|
-
var UpdateToolInputModel =
|
|
508
|
+
var UpdateToolInputModel = defineSchemaModel2({
|
|
329
509
|
name: "UpdateToolInput",
|
|
330
510
|
description: "Input for updating a tool",
|
|
331
511
|
fields: {
|
|
332
|
-
toolId: { type:
|
|
333
|
-
name: { type:
|
|
334
|
-
description: { type:
|
|
512
|
+
toolId: { type: ScalarTypeEnum2.String_unsecure(), isOptional: false },
|
|
513
|
+
name: { type: ScalarTypeEnum2.NonEmptyString(), isOptional: true },
|
|
514
|
+
description: { type: ScalarTypeEnum2.String_unsecure(), isOptional: true },
|
|
335
515
|
status: { type: ToolStatusEnum, isOptional: true },
|
|
336
|
-
parametersSchema: { type:
|
|
337
|
-
outputSchema: { type:
|
|
516
|
+
parametersSchema: { type: ScalarTypeEnum2.JSONObject(), isOptional: true },
|
|
517
|
+
outputSchema: { type: ScalarTypeEnum2.JSONObject(), isOptional: true },
|
|
338
518
|
implementationConfig: {
|
|
339
|
-
type:
|
|
519
|
+
type: ScalarTypeEnum2.JSONObject(),
|
|
340
520
|
isOptional: true
|
|
341
521
|
},
|
|
342
522
|
maxInvocationsPerMinute: {
|
|
343
|
-
type:
|
|
523
|
+
type: ScalarTypeEnum2.Int_unsecure(),
|
|
344
524
|
isOptional: true
|
|
345
525
|
},
|
|
346
|
-
timeoutMs: { type:
|
|
526
|
+
timeoutMs: { type: ScalarTypeEnum2.Int_unsecure(), isOptional: true },
|
|
347
527
|
tags: {
|
|
348
|
-
type:
|
|
528
|
+
type: ScalarTypeEnum2.String_unsecure(),
|
|
349
529
|
isArray: true,
|
|
350
530
|
isOptional: true
|
|
351
531
|
}
|
|
@@ -357,14 +537,14 @@ import {
|
|
|
357
537
|
defineCommand,
|
|
358
538
|
defineQuery
|
|
359
539
|
} from "@contractspec/lib.contracts-spec/operations";
|
|
360
|
-
import { defineSchemaModel as
|
|
361
|
-
var
|
|
540
|
+
import { defineSchemaModel as defineSchemaModel3, ScalarTypeEnum as ScalarTypeEnum3 } from "@contractspec/lib.schema";
|
|
541
|
+
var OWNERS2 = ["@agent-console-team"];
|
|
362
542
|
var CreateToolCommand = defineCommand({
|
|
363
543
|
meta: {
|
|
364
544
|
key: "agent.tool.create",
|
|
365
545
|
version: "1.0.0",
|
|
366
546
|
stability: "stable",
|
|
367
|
-
owners: [...
|
|
547
|
+
owners: [...OWNERS2],
|
|
368
548
|
tags: ["tool", "create"],
|
|
369
549
|
description: "Creates a new AI tool definition.",
|
|
370
550
|
goal: "Allow users to define new tools that agents can use.",
|
|
@@ -372,12 +552,12 @@ var CreateToolCommand = defineCommand({
|
|
|
372
552
|
},
|
|
373
553
|
io: {
|
|
374
554
|
input: CreateToolInputModel,
|
|
375
|
-
output:
|
|
555
|
+
output: defineSchemaModel3({
|
|
376
556
|
name: "CreateToolOutput",
|
|
377
557
|
fields: {
|
|
378
|
-
id: { type:
|
|
379
|
-
name: { type:
|
|
380
|
-
slug: { type:
|
|
558
|
+
id: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
559
|
+
name: { type: ScalarTypeEnum3.NonEmptyString(), isOptional: false },
|
|
560
|
+
slug: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
381
561
|
status: { type: ToolStatusEnum, isOptional: false }
|
|
382
562
|
}
|
|
383
563
|
}),
|
|
@@ -397,7 +577,7 @@ var CreateToolCommand = defineCommand({
|
|
|
397
577
|
key: "tool.created",
|
|
398
578
|
version: "1.0.0",
|
|
399
579
|
stability: "stable",
|
|
400
|
-
owners: [...
|
|
580
|
+
owners: [...OWNERS2],
|
|
401
581
|
tags: ["tool", "created"],
|
|
402
582
|
when: "Tool is successfully created",
|
|
403
583
|
payload: ToolSummaryModel
|
|
@@ -444,7 +624,7 @@ var UpdateToolCommand = defineCommand({
|
|
|
444
624
|
key: "agent.tool.update",
|
|
445
625
|
version: "1.0.0",
|
|
446
626
|
stability: "stable",
|
|
447
|
-
owners: [...
|
|
627
|
+
owners: [...OWNERS2],
|
|
448
628
|
tags: ["tool", "update"],
|
|
449
629
|
description: "Updates an existing AI tool definition.",
|
|
450
630
|
goal: "Allow users to modify tool settings and configuration.",
|
|
@@ -452,13 +632,13 @@ var UpdateToolCommand = defineCommand({
|
|
|
452
632
|
},
|
|
453
633
|
io: {
|
|
454
634
|
input: UpdateToolInputModel,
|
|
455
|
-
output:
|
|
635
|
+
output: defineSchemaModel3({
|
|
456
636
|
name: "UpdateToolOutput",
|
|
457
637
|
fields: {
|
|
458
|
-
id: { type:
|
|
459
|
-
name: { type:
|
|
638
|
+
id: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
639
|
+
name: { type: ScalarTypeEnum3.NonEmptyString(), isOptional: false },
|
|
460
640
|
status: { type: ToolStatusEnum, isOptional: false },
|
|
461
|
-
updatedAt: { type:
|
|
641
|
+
updatedAt: { type: ScalarTypeEnum3.DateTime(), isOptional: false }
|
|
462
642
|
}
|
|
463
643
|
}),
|
|
464
644
|
errors: {
|
|
@@ -477,7 +657,7 @@ var UpdateToolCommand = defineCommand({
|
|
|
477
657
|
key: "tool.updated",
|
|
478
658
|
version: "1.0.0",
|
|
479
659
|
stability: "stable",
|
|
480
|
-
owners: [...
|
|
660
|
+
owners: [...OWNERS2],
|
|
481
661
|
tags: ["tool", "updated"],
|
|
482
662
|
when: "Tool is updated",
|
|
483
663
|
payload: ToolSummaryModel
|
|
@@ -513,17 +693,17 @@ var GetToolQuery = defineQuery({
|
|
|
513
693
|
key: "agent.tool.get",
|
|
514
694
|
version: "1.0.0",
|
|
515
695
|
stability: "stable",
|
|
516
|
-
owners: [...
|
|
696
|
+
owners: [...OWNERS2],
|
|
517
697
|
tags: ["tool", "get"],
|
|
518
698
|
description: "Retrieves a tool by its ID.",
|
|
519
699
|
goal: "View detailed tool configuration.",
|
|
520
700
|
context: "Called when viewing tool details or editing."
|
|
521
701
|
},
|
|
522
702
|
io: {
|
|
523
|
-
input:
|
|
703
|
+
input: defineSchemaModel3({
|
|
524
704
|
name: "GetToolInput",
|
|
525
705
|
fields: {
|
|
526
|
-
toolId: { type:
|
|
706
|
+
toolId: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false }
|
|
527
707
|
}
|
|
528
708
|
}),
|
|
529
709
|
output: ToolModel,
|
|
@@ -565,41 +745,41 @@ var ListToolsQuery = defineQuery({
|
|
|
565
745
|
key: "agent.tool.list",
|
|
566
746
|
version: "1.0.0",
|
|
567
747
|
stability: "stable",
|
|
568
|
-
owners: [...
|
|
748
|
+
owners: [...OWNERS2],
|
|
569
749
|
tags: ["tool", "list"],
|
|
570
750
|
description: "Lists tools for an organization with optional filtering.",
|
|
571
751
|
goal: "Browse and search available tools.",
|
|
572
752
|
context: "Tool list/dashboard view."
|
|
573
753
|
},
|
|
574
754
|
io: {
|
|
575
|
-
input:
|
|
755
|
+
input: defineSchemaModel3({
|
|
576
756
|
name: "ListToolsInput",
|
|
577
757
|
fields: {
|
|
578
758
|
organizationId: {
|
|
579
|
-
type:
|
|
759
|
+
type: ScalarTypeEnum3.String_unsecure(),
|
|
580
760
|
isOptional: false
|
|
581
761
|
},
|
|
582
762
|
category: { type: ToolCategoryEnum, isOptional: true },
|
|
583
763
|
status: { type: ToolStatusEnum, isOptional: true },
|
|
584
|
-
search: { type:
|
|
764
|
+
search: { type: ScalarTypeEnum3.String_unsecure(), isOptional: true },
|
|
585
765
|
limit: {
|
|
586
|
-
type:
|
|
766
|
+
type: ScalarTypeEnum3.Int_unsecure(),
|
|
587
767
|
isOptional: true,
|
|
588
768
|
defaultValue: 20
|
|
589
769
|
},
|
|
590
770
|
offset: {
|
|
591
|
-
type:
|
|
771
|
+
type: ScalarTypeEnum3.Int_unsecure(),
|
|
592
772
|
isOptional: true,
|
|
593
773
|
defaultValue: 0
|
|
594
774
|
}
|
|
595
775
|
}
|
|
596
776
|
}),
|
|
597
|
-
output:
|
|
777
|
+
output: defineSchemaModel3({
|
|
598
778
|
name: "ListToolsOutput",
|
|
599
779
|
fields: {
|
|
600
780
|
items: { type: ToolSummaryModel, isArray: true, isOptional: false },
|
|
601
|
-
total: { type:
|
|
602
|
-
hasMore: { type:
|
|
781
|
+
total: { type: ScalarTypeEnum3.Int_unsecure(), isOptional: false },
|
|
782
|
+
hasMore: { type: ScalarTypeEnum3.Boolean(), isOptional: false }
|
|
603
783
|
}
|
|
604
784
|
})
|
|
605
785
|
},
|
|
@@ -627,27 +807,27 @@ var TestToolCommand = defineCommand({
|
|
|
627
807
|
key: "agent.tool.test",
|
|
628
808
|
version: "1.0.0",
|
|
629
809
|
stability: "stable",
|
|
630
|
-
owners: [...
|
|
810
|
+
owners: [...OWNERS2],
|
|
631
811
|
tags: ["tool", "test"],
|
|
632
812
|
description: "Tests a tool with sample input to verify it works correctly.",
|
|
633
813
|
goal: "Validate tool configuration before deployment.",
|
|
634
814
|
context: "Tool builder UI - test panel."
|
|
635
815
|
},
|
|
636
816
|
io: {
|
|
637
|
-
input:
|
|
817
|
+
input: defineSchemaModel3({
|
|
638
818
|
name: "TestToolInput",
|
|
639
819
|
fields: {
|
|
640
|
-
toolId: { type:
|
|
641
|
-
testInput: { type:
|
|
820
|
+
toolId: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
821
|
+
testInput: { type: ScalarTypeEnum3.JSONObject(), isOptional: false }
|
|
642
822
|
}
|
|
643
823
|
}),
|
|
644
|
-
output:
|
|
824
|
+
output: defineSchemaModel3({
|
|
645
825
|
name: "TestToolOutput",
|
|
646
826
|
fields: {
|
|
647
|
-
success: { type:
|
|
648
|
-
output: { type:
|
|
649
|
-
error: { type:
|
|
650
|
-
durationMs: { type:
|
|
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 }
|
|
651
831
|
}
|
|
652
832
|
}),
|
|
653
833
|
errors: {
|
|
@@ -692,190 +872,10 @@ var TestToolCommand = defineCommand({
|
|
|
692
872
|
}
|
|
693
873
|
});
|
|
694
874
|
|
|
695
|
-
// src/tool/tool.event.ts
|
|
696
|
-
import { defineEvent } from "@contractspec/lib.contracts-spec";
|
|
697
|
-
import { ScalarTypeEnum as ScalarTypeEnum3, defineSchemaModel as defineSchemaModel3 } from "@contractspec/lib.schema";
|
|
698
|
-
var OWNERS2 = ["@agent-console-team"];
|
|
699
|
-
var ToolCreatedPayload = defineSchemaModel3({
|
|
700
|
-
name: "ToolCreatedPayload",
|
|
701
|
-
description: "Payload for tool created event",
|
|
702
|
-
fields: {
|
|
703
|
-
id: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
704
|
-
organizationId: {
|
|
705
|
-
type: ScalarTypeEnum3.String_unsecure(),
|
|
706
|
-
isOptional: false
|
|
707
|
-
},
|
|
708
|
-
name: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
709
|
-
slug: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
710
|
-
category: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
711
|
-
implementationType: {
|
|
712
|
-
type: ScalarTypeEnum3.String_unsecure(),
|
|
713
|
-
isOptional: false
|
|
714
|
-
},
|
|
715
|
-
createdById: { type: ScalarTypeEnum3.String_unsecure(), isOptional: true },
|
|
716
|
-
createdAt: { type: ScalarTypeEnum3.DateTime(), isOptional: false }
|
|
717
|
-
}
|
|
718
|
-
});
|
|
719
|
-
var ToolCreatedEvent = defineEvent({
|
|
720
|
-
meta: {
|
|
721
|
-
key: "agent.tool.created",
|
|
722
|
-
version: "1.0.0",
|
|
723
|
-
description: "A new AI tool was created.",
|
|
724
|
-
stability: "stable",
|
|
725
|
-
owners: [...OWNERS2],
|
|
726
|
-
tags: ["tool", "created"]
|
|
727
|
-
},
|
|
728
|
-
payload: ToolCreatedPayload
|
|
729
|
-
});
|
|
730
|
-
var ToolUpdatedPayload = defineSchemaModel3({
|
|
731
|
-
name: "ToolUpdatedPayload",
|
|
732
|
-
description: "Payload for tool updated event",
|
|
733
|
-
fields: {
|
|
734
|
-
id: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
735
|
-
organizationId: {
|
|
736
|
-
type: ScalarTypeEnum3.String_unsecure(),
|
|
737
|
-
isOptional: false
|
|
738
|
-
},
|
|
739
|
-
name: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
740
|
-
status: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
741
|
-
updatedFields: {
|
|
742
|
-
type: ScalarTypeEnum3.String_unsecure(),
|
|
743
|
-
isArray: true,
|
|
744
|
-
isOptional: false
|
|
745
|
-
},
|
|
746
|
-
updatedAt: { type: ScalarTypeEnum3.DateTime(), isOptional: false }
|
|
747
|
-
}
|
|
748
|
-
});
|
|
749
|
-
var ToolUpdatedEvent = defineEvent({
|
|
750
|
-
meta: {
|
|
751
|
-
key: "agent.tool.updated",
|
|
752
|
-
version: "1.0.0",
|
|
753
|
-
description: "An AI tool configuration was updated.",
|
|
754
|
-
stability: "stable",
|
|
755
|
-
owners: [...OWNERS2],
|
|
756
|
-
tags: ["tool", "updated"]
|
|
757
|
-
},
|
|
758
|
-
payload: ToolUpdatedPayload
|
|
759
|
-
});
|
|
760
|
-
var ToolStatusChangedPayload = defineSchemaModel3({
|
|
761
|
-
name: "ToolStatusChangedPayload",
|
|
762
|
-
description: "Payload for tool status changed event",
|
|
763
|
-
fields: {
|
|
764
|
-
id: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
765
|
-
organizationId: {
|
|
766
|
-
type: ScalarTypeEnum3.String_unsecure(),
|
|
767
|
-
isOptional: false
|
|
768
|
-
},
|
|
769
|
-
name: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
770
|
-
previousStatus: {
|
|
771
|
-
type: ScalarTypeEnum3.String_unsecure(),
|
|
772
|
-
isOptional: false
|
|
773
|
-
},
|
|
774
|
-
newStatus: { type: ScalarTypeEnum3.String_unsecure(), isOptional: false },
|
|
775
|
-
changedAt: { type: ScalarTypeEnum3.DateTime(), isOptional: false }
|
|
776
|
-
}
|
|
777
|
-
});
|
|
778
|
-
var ToolStatusChangedEvent = defineEvent({
|
|
779
|
-
meta: {
|
|
780
|
-
key: "agent.tool.statusChanged",
|
|
781
|
-
version: "1.0.0",
|
|
782
|
-
description: "An AI tool status was changed (activated, deprecated, disabled).",
|
|
783
|
-
stability: "stable",
|
|
784
|
-
owners: [...OWNERS2],
|
|
785
|
-
tags: ["tool", "status"]
|
|
786
|
-
},
|
|
787
|
-
payload: ToolStatusChangedPayload
|
|
788
|
-
});
|
|
789
|
-
|
|
790
|
-
// src/tool/tool.entity.ts
|
|
791
|
-
import {
|
|
792
|
-
defineEntity,
|
|
793
|
-
defineEntityEnum,
|
|
794
|
-
field,
|
|
795
|
-
index
|
|
796
|
-
} from "@contractspec/lib.schema";
|
|
797
|
-
var ToolCategoryEntityEnum = defineEntityEnum({
|
|
798
|
-
name: "ToolCategory",
|
|
799
|
-
values: [
|
|
800
|
-
"RETRIEVAL",
|
|
801
|
-
"COMPUTATION",
|
|
802
|
-
"COMMUNICATION",
|
|
803
|
-
"INTEGRATION",
|
|
804
|
-
"UTILITY",
|
|
805
|
-
"CUSTOM"
|
|
806
|
-
],
|
|
807
|
-
description: "Category of tool"
|
|
808
|
-
});
|
|
809
|
-
var ToolStatusEntityEnum = defineEntityEnum({
|
|
810
|
-
name: "ToolStatus",
|
|
811
|
-
values: ["DRAFT", "ACTIVE", "DEPRECATED", "DISABLED"],
|
|
812
|
-
description: "Status of tool"
|
|
813
|
-
});
|
|
814
|
-
var ImplementationTypeEntityEnum = defineEntityEnum({
|
|
815
|
-
name: "ImplementationType",
|
|
816
|
-
values: ["http", "function", "workflow"],
|
|
817
|
-
description: "How the tool is implemented"
|
|
818
|
-
});
|
|
819
|
-
var ToolEntity = defineEntity({
|
|
820
|
-
name: "Tool",
|
|
821
|
-
schema: "agent_console",
|
|
822
|
-
description: "An AI tool that can be used by agents.",
|
|
823
|
-
fields: {
|
|
824
|
-
id: field.id(),
|
|
825
|
-
organizationId: field.string({
|
|
826
|
-
description: "Organization that owns this tool"
|
|
827
|
-
}),
|
|
828
|
-
name: field.string({ description: "Tool name" }),
|
|
829
|
-
slug: field.string({ description: "URL-safe identifier" }),
|
|
830
|
-
description: field.string({ description: "Tool description" }),
|
|
831
|
-
category: field.enum("ToolCategory", { default: "CUSTOM" }),
|
|
832
|
-
status: field.enum("ToolStatus", { default: "DRAFT" }),
|
|
833
|
-
parametersSchema: field.json({
|
|
834
|
-
description: "JSON Schema for tool parameters"
|
|
835
|
-
}),
|
|
836
|
-
outputSchema: field.json({
|
|
837
|
-
isOptional: true,
|
|
838
|
-
description: "JSON Schema for tool output"
|
|
839
|
-
}),
|
|
840
|
-
implementationType: field.enum("ImplementationType"),
|
|
841
|
-
implementationConfig: field.json({
|
|
842
|
-
description: "Implementation configuration"
|
|
843
|
-
}),
|
|
844
|
-
maxInvocationsPerMinute: field.int({
|
|
845
|
-
isOptional: true,
|
|
846
|
-
description: "Rate limit"
|
|
847
|
-
}),
|
|
848
|
-
timeoutMs: field.int({ default: 30000, description: "Execution timeout" }),
|
|
849
|
-
version: field.string({ default: "1.0.0", description: "Tool version" }),
|
|
850
|
-
tags: field.string({
|
|
851
|
-
isArray: true,
|
|
852
|
-
isOptional: true,
|
|
853
|
-
description: "Tags for categorization"
|
|
854
|
-
}),
|
|
855
|
-
createdAt: field.createdAt(),
|
|
856
|
-
updatedAt: field.updatedAt(),
|
|
857
|
-
createdById: field.string({
|
|
858
|
-
isOptional: true,
|
|
859
|
-
description: "User who created this tool"
|
|
860
|
-
}),
|
|
861
|
-
agents: field.hasMany("Agent", { description: "Agents using this tool" })
|
|
862
|
-
},
|
|
863
|
-
indexes: [
|
|
864
|
-
index.unique(["organizationId", "slug"]),
|
|
865
|
-
index.on(["organizationId", "category"]),
|
|
866
|
-
index.on(["organizationId", "status"])
|
|
867
|
-
],
|
|
868
|
-
enums: [
|
|
869
|
-
ToolCategoryEntityEnum,
|
|
870
|
-
ToolStatusEntityEnum,
|
|
871
|
-
ImplementationTypeEntityEnum
|
|
872
|
-
]
|
|
873
|
-
});
|
|
874
|
-
|
|
875
875
|
// src/tool/tool.presentation.ts
|
|
876
876
|
import {
|
|
877
|
-
|
|
878
|
-
|
|
877
|
+
definePresentation,
|
|
878
|
+
StabilityEnum
|
|
879
879
|
} from "@contractspec/lib.contracts-spec";
|
|
880
880
|
var ToolListPresentation = definePresentation({
|
|
881
881
|
meta: {
|