@contractspec/example.agent-console 1.56.1 → 1.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +211 -277
- package/.turbo/turbo-prebuild.log +1 -0
- package/CHANGELOG.md +36 -0
- package/dist/agent/agent.entity.d.ts +35 -40
- package/dist/agent/agent.entity.d.ts.map +1 -1
- package/dist/agent/agent.entity.js +124 -132
- package/dist/agent/agent.enum.d.ts +3 -8
- package/dist/agent/agent.enum.d.ts.map +1 -1
- package/dist/agent/agent.enum.js +22 -30
- package/dist/agent/agent.event.d.ts +105 -111
- package/dist/agent/agent.event.d.ts.map +1 -1
- package/dist/agent/agent.event.js +107 -200
- package/dist/agent/agent.handler.d.ts +74 -77
- package/dist/agent/agent.handler.d.ts.map +1 -1
- package/dist/agent/agent.handler.js +293 -75
- package/dist/agent/agent.operation.d.ts +424 -430
- package/dist/agent/agent.operation.d.ts.map +1 -1
- package/dist/agent/agent.operation.js +728 -478
- package/dist/agent/agent.presentation.d.ts +3 -8
- package/dist/agent/agent.presentation.d.ts.map +1 -1
- package/dist/agent/agent.presentation.js +275 -84
- package/dist/agent/agent.schema.d.ts +371 -376
- package/dist/agent/agent.schema.d.ts.map +1 -1
- package/dist/agent/agent.schema.js +209 -399
- package/dist/agent/agent.test-spec.d.ts +2 -7
- package/dist/agent/agent.test-spec.d.ts.map +1 -1
- package/dist/agent/agent.test-spec.js +56 -62
- package/dist/agent/index.d.ts +11 -8
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/index.js +1245 -9
- package/dist/agent.capability.d.ts +1 -6
- package/dist/agent.capability.d.ts.map +1 -1
- package/dist/agent.capability.js +17 -20
- package/dist/agent.feature.d.ts +7 -7
- package/dist/agent.feature.d.ts.map +1 -1
- package/dist/agent.feature.js +117 -303
- package/dist/browser/agent/agent.entity.js +127 -0
- package/dist/browser/agent/agent.enum.js +25 -0
- package/dist/browser/agent/agent.event.js +116 -0
- package/dist/browser/agent/agent.handler.js +301 -0
- package/dist/browser/agent/agent.operation.js +735 -0
- package/dist/browser/agent/agent.presentation.js +279 -0
- package/dist/browser/agent/agent.schema.js +215 -0
- package/dist/browser/agent/agent.test-spec.js +58 -0
- package/dist/browser/agent/index.js +1244 -0
- package/dist/browser/agent.capability.js +16 -0
- package/dist/browser/agent.feature.js +118 -0
- package/dist/browser/docs/agent-console.docblock.js +93 -0
- package/dist/browser/docs/index.js +93 -0
- package/dist/browser/example.js +42 -0
- package/dist/browser/handlers/agent.handlers.js +252 -0
- package/dist/browser/handlers/index.js +799 -0
- package/dist/browser/index.js +5895 -0
- package/dist/browser/presentations/index.js +684 -0
- package/dist/browser/run/index.js +1350 -0
- package/dist/browser/run/run.entity.js +160 -0
- package/dist/browser/run/run.enum.js +34 -0
- package/dist/browser/run/run.event.js +213 -0
- package/dist/browser/run/run.handler.js +254 -0
- package/dist/browser/run/run.operation.js +667 -0
- package/dist/browser/run/run.presentation.js +220 -0
- package/dist/browser/run/run.schema.js +179 -0
- package/dist/browser/run/run.test-spec.js +58 -0
- package/dist/browser/seeders/index.js +21 -0
- package/dist/browser/shared/index.js +334 -0
- package/dist/browser/shared/mock-agents.js +82 -0
- package/dist/browser/shared/mock-runs.js +108 -0
- package/dist/browser/shared/mock-tools.js +146 -0
- package/dist/browser/shared/overlay-types.js +0 -0
- package/dist/browser/tool/index.js +946 -0
- package/dist/browser/tool/tool.entity.js +90 -0
- package/dist/browser/tool/tool.enum.js +26 -0
- package/dist/browser/tool/tool.event.js +99 -0
- package/dist/browser/tool/tool.handler.js +223 -0
- package/dist/browser/tool/tool.operation.js +482 -0
- package/dist/browser/tool/tool.presentation.js +185 -0
- package/dist/browser/tool/tool.schema.js +141 -0
- package/dist/browser/tool/tool.test-spec.js +58 -0
- package/dist/browser/ui/AgentDashboard.js +1607 -0
- package/dist/browser/ui/AgentRunList.js +250 -0
- package/dist/browser/ui/AgentToolRegistry.js +212 -0
- package/dist/browser/ui/hooks/index.js +271 -0
- package/dist/browser/ui/hooks/useAgentList.js +55 -0
- package/dist/browser/ui/hooks/useAgentMutations.js +76 -0
- package/dist/browser/ui/hooks/useRunList.js +55 -0
- package/dist/browser/ui/hooks/useToolList.js +85 -0
- package/dist/browser/ui/index.js +2080 -0
- package/dist/browser/ui/modals/AgentActionsModal.js +304 -0
- package/dist/browser/ui/modals/CreateAgentModal.js +229 -0
- package/dist/browser/ui/modals/index.js +532 -0
- package/dist/browser/ui/overlays/demo-overlays.js +64 -0
- package/dist/browser/ui/overlays/index.js +64 -0
- package/dist/browser/ui/renderers/agent-list.markdown.js +55 -0
- package/dist/browser/ui/renderers/agent-list.renderer.js +180 -0
- package/dist/browser/ui/renderers/dashboard.markdown.js +117 -0
- package/dist/browser/ui/renderers/index.js +446 -0
- package/dist/browser/ui/renderers/run-list.markdown.js +45 -0
- package/dist/browser/ui/renderers/tool-registry.markdown.js +53 -0
- package/dist/browser/ui/views/AgentListView.js +165 -0
- package/dist/browser/ui/views/RunListView.js +247 -0
- package/dist/browser/ui/views/ToolRegistryView.js +209 -0
- package/dist/browser/ui/views/index.js +619 -0
- package/dist/docs/agent-console.docblock.d.ts +2 -1
- package/dist/docs/agent-console.docblock.d.ts.map +1 -0
- package/dist/docs/agent-console.docblock.js +45 -64
- package/dist/docs/index.d.ts +2 -1
- package/dist/docs/index.d.ts.map +1 -0
- package/dist/docs/index.js +94 -1
- package/dist/example.d.ts +2 -6
- package/dist/example.d.ts.map +1 -1
- package/dist/example.js +40 -55
- package/dist/handlers/agent.handlers.d.ts +121 -121
- package/dist/handlers/agent.handlers.d.ts.map +1 -1
- package/dist/handlers/agent.handlers.js +235 -245
- package/dist/handlers/index.d.ts +8 -5
- package/dist/handlers/index.d.ts.map +1 -0
- package/dist/handlers/index.js +799 -5
- package/dist/index.d.ts +26 -48
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5896 -50
- package/dist/node/agent/agent.entity.js +127 -0
- package/dist/node/agent/agent.enum.js +25 -0
- package/dist/node/agent/agent.event.js +116 -0
- package/dist/node/agent/agent.handler.js +301 -0
- package/dist/node/agent/agent.operation.js +735 -0
- package/dist/node/agent/agent.presentation.js +279 -0
- package/dist/node/agent/agent.schema.js +215 -0
- package/dist/node/agent/agent.test-spec.js +58 -0
- package/dist/node/agent/index.js +1244 -0
- package/dist/node/agent.capability.js +16 -0
- package/dist/node/agent.feature.js +118 -0
- package/dist/node/docs/agent-console.docblock.js +93 -0
- package/dist/node/docs/index.js +93 -0
- package/dist/node/example.js +42 -0
- package/dist/node/handlers/agent.handlers.js +252 -0
- package/dist/node/handlers/index.js +799 -0
- package/dist/node/index.js +5895 -0
- package/dist/node/presentations/index.js +684 -0
- package/dist/node/run/index.js +1350 -0
- package/dist/node/run/run.entity.js +160 -0
- package/dist/node/run/run.enum.js +34 -0
- package/dist/node/run/run.event.js +213 -0
- package/dist/node/run/run.handler.js +254 -0
- package/dist/node/run/run.operation.js +667 -0
- package/dist/node/run/run.presentation.js +220 -0
- package/dist/node/run/run.schema.js +179 -0
- package/dist/node/run/run.test-spec.js +58 -0
- package/dist/node/seeders/index.js +21 -0
- package/dist/node/shared/index.js +334 -0
- package/dist/node/shared/mock-agents.js +82 -0
- package/dist/node/shared/mock-runs.js +108 -0
- package/dist/node/shared/mock-tools.js +146 -0
- package/dist/node/shared/overlay-types.js +0 -0
- package/dist/node/tool/index.js +946 -0
- package/dist/node/tool/tool.entity.js +90 -0
- package/dist/node/tool/tool.enum.js +26 -0
- package/dist/node/tool/tool.event.js +99 -0
- package/dist/node/tool/tool.handler.js +223 -0
- package/dist/node/tool/tool.operation.js +482 -0
- package/dist/node/tool/tool.presentation.js +185 -0
- package/dist/node/tool/tool.schema.js +141 -0
- package/dist/node/tool/tool.test-spec.js +58 -0
- package/dist/node/ui/AgentDashboard.js +1607 -0
- package/dist/node/ui/AgentRunList.js +250 -0
- package/dist/node/ui/AgentToolRegistry.js +212 -0
- package/dist/node/ui/hooks/index.js +271 -0
- package/dist/node/ui/hooks/useAgentList.js +55 -0
- package/dist/node/ui/hooks/useAgentMutations.js +76 -0
- package/dist/node/ui/hooks/useRunList.js +55 -0
- package/dist/node/ui/hooks/useToolList.js +85 -0
- package/dist/node/ui/index.js +2080 -0
- package/dist/node/ui/modals/AgentActionsModal.js +304 -0
- package/dist/node/ui/modals/CreateAgentModal.js +229 -0
- package/dist/node/ui/modals/index.js +532 -0
- package/dist/node/ui/overlays/demo-overlays.js +64 -0
- package/dist/node/ui/overlays/index.js +64 -0
- package/dist/node/ui/renderers/agent-list.markdown.js +55 -0
- package/dist/node/ui/renderers/agent-list.renderer.js +180 -0
- package/dist/node/ui/renderers/dashboard.markdown.js +117 -0
- package/dist/node/ui/renderers/index.js +446 -0
- package/dist/node/ui/renderers/run-list.markdown.js +45 -0
- package/dist/node/ui/renderers/tool-registry.markdown.js +53 -0
- package/dist/node/ui/views/AgentListView.js +165 -0
- package/dist/node/ui/views/RunListView.js +247 -0
- package/dist/node/ui/views/ToolRegistryView.js +209 -0
- package/dist/node/ui/views/index.js +619 -0
- package/dist/presentations/index.d.ts +9 -4
- package/dist/presentations/index.d.ts.map +1 -0
- package/dist/presentations/index.js +684 -4
- package/dist/run/index.d.ts +11 -8
- package/dist/run/index.d.ts.map +1 -0
- package/dist/run/index.js +1351 -9
- package/dist/run/run.entity.d.ts +55 -60
- package/dist/run/run.entity.d.ts.map +1 -1
- package/dist/run/run.entity.js +155 -199
- package/dist/run/run.enum.d.ts +4 -9
- package/dist/run/run.enum.d.ts.map +1 -1
- package/dist/run/run.enum.js +30 -40
- package/dist/run/run.event.d.ts +255 -261
- package/dist/run/run.event.d.ts.map +1 -1
- package/dist/run/run.event.js +198 -418
- package/dist/run/run.handler.d.ts +169 -172
- package/dist/run/run.handler.d.ts.map +1 -1
- package/dist/run/run.handler.js +246 -74
- package/dist/run/run.operation.d.ts +658 -664
- package/dist/run/run.operation.d.ts.map +1 -1
- package/dist/run/run.operation.js +659 -617
- package/dist/run/run.presentation.d.ts +2 -7
- package/dist/run/run.presentation.d.ts.map +1 -1
- package/dist/run/run.presentation.js +217 -61
- package/dist/run/run.schema.d.ts +367 -372
- package/dist/run/run.schema.d.ts.map +1 -1
- package/dist/run/run.schema.js +172 -330
- package/dist/run/run.test-spec.d.ts +2 -7
- package/dist/run/run.test-spec.d.ts.map +1 -1
- package/dist/run/run.test-spec.js +56 -62
- package/dist/seeders/index.d.ts +4 -8
- package/dist/seeders/index.d.ts.map +1 -1
- package/dist/seeders/index.js +19 -17
- package/dist/shared/index.d.ts +7 -4
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +334 -4
- package/dist/shared/mock-agents.d.ts +77 -80
- package/dist/shared/mock-agents.d.ts.map +1 -1
- package/dist/shared/mock-agents.js +82 -93
- package/dist/shared/mock-runs.d.ts +107 -110
- package/dist/shared/mock-runs.d.ts.map +1 -1
- package/dist/shared/mock-runs.js +108 -117
- package/dist/shared/mock-tools.d.ts +217 -220
- package/dist/shared/mock-tools.d.ts.map +1 -1
- package/dist/shared/mock-tools.js +146 -180
- package/dist/shared/overlay-types.d.ts +25 -28
- package/dist/shared/overlay-types.d.ts.map +1 -1
- package/dist/shared/overlay-types.js +1 -0
- package/dist/tool/index.d.ts +11 -8
- package/dist/tool/index.d.ts.map +1 -0
- package/dist/tool/index.js +947 -9
- package/dist/tool/tool.entity.d.ts +23 -28
- package/dist/tool/tool.entity.d.ts.map +1 -1
- package/dist/tool/tool.entity.js +87 -101
- package/dist/tool/tool.enum.d.ts +3 -8
- package/dist/tool/tool.enum.d.ts.map +1 -1
- package/dist/tool/tool.enum.js +23 -31
- package/dist/tool/tool.event.d.ts +84 -90
- package/dist/tool/tool.event.d.ts.map +1 -1
- package/dist/tool/tool.event.js +92 -151
- package/dist/tool/tool.handler.d.ts +266 -269
- package/dist/tool/tool.handler.d.ts.map +1 -1
- package/dist/tool/tool.handler.js +213 -76
- package/dist/tool/tool.operation.d.ts +359 -365
- package/dist/tool/tool.operation.d.ts.map +1 -1
- package/dist/tool/tool.operation.js +477 -400
- package/dist/tool/tool.presentation.d.ts +2 -7
- package/dist/tool/tool.presentation.d.ts.map +1 -1
- package/dist/tool/tool.presentation.js +182 -61
- package/dist/tool/tool.schema.d.ts +196 -201
- package/dist/tool/tool.schema.d.ts.map +1 -1
- package/dist/tool/tool.schema.js +137 -231
- package/dist/tool/tool.test-spec.d.ts +2 -7
- package/dist/tool/tool.test-spec.d.ts.map +1 -1
- package/dist/tool/tool.test-spec.js +56 -62
- package/dist/ui/AgentDashboard.d.ts +1 -6
- package/dist/ui/AgentDashboard.d.ts.map +1 -1
- package/dist/ui/AgentDashboard.js +1598 -410
- package/dist/ui/AgentRunList.d.ts +7 -2
- package/dist/ui/AgentRunList.d.ts.map +1 -0
- package/dist/ui/AgentRunList.js +249 -3
- package/dist/ui/AgentToolRegistry.d.ts +7 -2
- package/dist/ui/AgentToolRegistry.d.ts.map +1 -0
- package/dist/ui/AgentToolRegistry.js +211 -3
- package/dist/ui/hooks/index.d.ts +8 -6
- package/dist/ui/hooks/index.d.ts.map +1 -0
- package/dist/ui/hooks/index.js +270 -6
- package/dist/ui/hooks/useAgentList.d.ts +21 -25
- package/dist/ui/hooks/useAgentList.d.ts.map +1 -1
- package/dist/ui/hooks/useAgentList.js +52 -62
- package/dist/ui/hooks/useAgentMutations.d.ts +22 -25
- package/dist/ui/hooks/useAgentMutations.d.ts.map +1 -1
- package/dist/ui/hooks/useAgentMutations.js +73 -120
- package/dist/ui/hooks/useRunList.d.ts +17 -21
- package/dist/ui/hooks/useRunList.d.ts.map +1 -1
- package/dist/ui/hooks/useRunList.js +52 -62
- package/dist/ui/hooks/useToolList.d.ts +32 -36
- package/dist/ui/hooks/useToolList.d.ts.map +1 -1
- package/dist/ui/hooks/useToolList.js +82 -92
- package/dist/ui/index.d.ts +9 -24
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +2081 -24
- package/dist/ui/modals/AgentActionsModal.d.ts +11 -24
- package/dist/ui/modals/AgentActionsModal.d.ts.map +1 -1
- package/dist/ui/modals/AgentActionsModal.js +300 -257
- package/dist/ui/modals/CreateAgentModal.d.ts +12 -21
- package/dist/ui/modals/CreateAgentModal.d.ts.map +1 -1
- package/dist/ui/modals/CreateAgentModal.js +226 -210
- package/dist/ui/modals/index.d.ts +3 -3
- package/dist/ui/modals/index.d.ts.map +1 -0
- package/dist/ui/modals/index.js +532 -3
- package/dist/ui/overlays/demo-overlays.d.ts +10 -9
- package/dist/ui/overlays/demo-overlays.d.ts.map +1 -1
- package/dist/ui/overlays/demo-overlays.js +63 -71
- package/dist/ui/overlays/index.d.ts +2 -2
- package/dist/ui/overlays/index.d.ts.map +1 -0
- package/dist/ui/overlays/index.js +65 -3
- package/dist/ui/renderers/agent-list.markdown.d.ts +9 -9
- package/dist/ui/renderers/agent-list.markdown.d.ts.map +1 -1
- package/dist/ui/renderers/agent-list.markdown.js +55 -50
- package/dist/ui/renderers/agent-list.renderer.d.ts +5 -7
- package/dist/ui/renderers/agent-list.renderer.d.ts.map +1 -1
- package/dist/ui/renderers/agent-list.renderer.js +179 -17
- package/dist/ui/renderers/dashboard.markdown.d.ts +9 -9
- package/dist/ui/renderers/dashboard.markdown.d.ts.map +1 -1
- package/dist/ui/renderers/dashboard.markdown.js +115 -97
- package/dist/ui/renderers/index.d.ts +9 -6
- package/dist/ui/renderers/index.d.ts.map +1 -0
- package/dist/ui/renderers/index.js +446 -6
- package/dist/ui/renderers/run-list.markdown.d.ts +9 -9
- package/dist/ui/renderers/run-list.markdown.d.ts.map +1 -1
- package/dist/ui/renderers/run-list.markdown.js +42 -40
- package/dist/ui/renderers/tool-registry.markdown.d.ts +9 -9
- package/dist/ui/renderers/tool-registry.markdown.d.ts.map +1 -1
- package/dist/ui/renderers/tool-registry.markdown.js +52 -53
- package/dist/ui/views/AgentListView.d.ts +1 -6
- package/dist/ui/views/AgentListView.d.ts.map +1 -1
- package/dist/ui/views/AgentListView.js +161 -88
- package/dist/ui/views/RunListView.d.ts +4 -11
- package/dist/ui/views/RunListView.d.ts.map +1 -1
- package/dist/ui/views/RunListView.js +237 -154
- package/dist/ui/views/ToolRegistryView.d.ts +4 -11
- package/dist/ui/views/ToolRegistryView.d.ts.map +1 -1
- package/dist/ui/views/ToolRegistryView.js +205 -92
- package/dist/ui/views/index.d.ts +7 -4
- package/dist/ui/views/index.d.ts.map +1 -0
- package/dist/ui/views/index.js +619 -4
- package/package.json +657 -119
- package/tsdown.config.js +1 -2
- package/.turbo/turbo-build$colon$bundle.log +0 -280
- package/dist/agent/agent.entity.js.map +0 -1
- package/dist/agent/agent.enum.js.map +0 -1
- package/dist/agent/agent.event.js.map +0 -1
- package/dist/agent/agent.handler.js.map +0 -1
- package/dist/agent/agent.operation.js.map +0 -1
- package/dist/agent/agent.presentation.js.map +0 -1
- package/dist/agent/agent.schema.js.map +0 -1
- package/dist/agent/agent.test-spec.js.map +0 -1
- package/dist/agent.capability.js.map +0 -1
- package/dist/agent.feature.js.map +0 -1
- package/dist/docs/agent-console.docblock.js.map +0 -1
- package/dist/example.js.map +0 -1
- package/dist/handlers/agent.handlers.js.map +0 -1
- package/dist/run/run.entity.js.map +0 -1
- package/dist/run/run.enum.js.map +0 -1
- package/dist/run/run.event.js.map +0 -1
- package/dist/run/run.handler.js.map +0 -1
- package/dist/run/run.operation.js.map +0 -1
- package/dist/run/run.presentation.js.map +0 -1
- package/dist/run/run.schema.js.map +0 -1
- package/dist/run/run.test-spec.js.map +0 -1
- package/dist/seeders/index.js.map +0 -1
- package/dist/shared/mock-agents.js.map +0 -1
- package/dist/shared/mock-runs.js.map +0 -1
- package/dist/shared/mock-tools.js.map +0 -1
- package/dist/tool/tool.entity.js.map +0 -1
- package/dist/tool/tool.enum.js.map +0 -1
- package/dist/tool/tool.event.js.map +0 -1
- package/dist/tool/tool.handler.js.map +0 -1
- package/dist/tool/tool.operation.js.map +0 -1
- package/dist/tool/tool.presentation.js.map +0 -1
- package/dist/tool/tool.schema.js.map +0 -1
- package/dist/tool/tool.test-spec.js.map +0 -1
- package/dist/ui/AgentDashboard.js.map +0 -1
- package/dist/ui/hooks/useAgentList.js.map +0 -1
- package/dist/ui/hooks/useAgentMutations.js.map +0 -1
- package/dist/ui/hooks/useRunList.js.map +0 -1
- package/dist/ui/hooks/useToolList.js.map +0 -1
- package/dist/ui/modals/AgentActionsModal.js.map +0 -1
- package/dist/ui/modals/CreateAgentModal.js.map +0 -1
- package/dist/ui/overlays/demo-overlays.js.map +0 -1
- package/dist/ui/renderers/agent-list.markdown.js.map +0 -1
- package/dist/ui/renderers/agent-list.renderer.js.map +0 -1
- package/dist/ui/renderers/dashboard.markdown.js.map +0 -1
- package/dist/ui/renderers/run-list.markdown.js.map +0 -1
- package/dist/ui/renderers/tool-registry.markdown.js.map +0 -1
- package/dist/ui/views/AgentListView.js.map +0 -1
- package/dist/ui/views/RunListView.js.map +0 -1
- package/dist/ui/views/ToolRegistryView.js.map +0 -1
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
// src/run/run.enum.ts
|
|
2
|
+
import { defineEnum } from "@contractspec/lib.schema";
|
|
3
|
+
var RunStatusEnum = defineEnum("RunStatus", [
|
|
4
|
+
"QUEUED",
|
|
5
|
+
"IN_PROGRESS",
|
|
6
|
+
"COMPLETED",
|
|
7
|
+
"FAILED",
|
|
8
|
+
"CANCELLED",
|
|
9
|
+
"EXPIRED"
|
|
10
|
+
]);
|
|
11
|
+
var RunStepTypeEnum = defineEnum("RunStepType", [
|
|
12
|
+
"MESSAGE_CREATION",
|
|
13
|
+
"TOOL_CALL",
|
|
14
|
+
"TOOL_RESULT",
|
|
15
|
+
"ERROR"
|
|
16
|
+
]);
|
|
17
|
+
var LogLevelEnum = defineEnum("LogLevel", [
|
|
18
|
+
"DEBUG",
|
|
19
|
+
"INFO",
|
|
20
|
+
"WARN",
|
|
21
|
+
"ERROR"
|
|
22
|
+
]);
|
|
23
|
+
var GranularityEnum = defineEnum("Granularity", [
|
|
24
|
+
"hour",
|
|
25
|
+
"day",
|
|
26
|
+
"week",
|
|
27
|
+
"month"
|
|
28
|
+
]);
|
|
29
|
+
|
|
30
|
+
// src/run/run.schema.ts
|
|
31
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
32
|
+
var RunInputModel = defineSchemaModel({
|
|
33
|
+
name: "RunInput",
|
|
34
|
+
description: "Input data for agent execution",
|
|
35
|
+
fields: {
|
|
36
|
+
message: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
37
|
+
context: { type: ScalarTypeEnum.JSONObject(), isOptional: true }
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
var RunStepModel = defineSchemaModel({
|
|
41
|
+
name: "RunStep",
|
|
42
|
+
description: "Individual step within a run",
|
|
43
|
+
fields: {
|
|
44
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
45
|
+
stepNumber: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
46
|
+
type: { type: RunStepTypeEnum, isOptional: false },
|
|
47
|
+
toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
48
|
+
toolName: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
49
|
+
input: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
|
|
50
|
+
output: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
|
|
51
|
+
status: { type: RunStatusEnum, isOptional: false },
|
|
52
|
+
errorMessage: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
53
|
+
tokensUsed: {
|
|
54
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
55
|
+
isOptional: false,
|
|
56
|
+
defaultValue: 0
|
|
57
|
+
},
|
|
58
|
+
durationMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
59
|
+
startedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
60
|
+
completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true }
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
var RunLogModel = defineSchemaModel({
|
|
64
|
+
name: "RunLog",
|
|
65
|
+
description: "Execution log entry",
|
|
66
|
+
fields: {
|
|
67
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
68
|
+
stepId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
69
|
+
level: { type: LogLevelEnum, isOptional: false },
|
|
70
|
+
message: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
71
|
+
data: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
|
|
72
|
+
source: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
73
|
+
traceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
74
|
+
spanId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
75
|
+
timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
var RunAgentRefModel = defineSchemaModel({
|
|
79
|
+
name: "RunAgentRef",
|
|
80
|
+
description: "Agent reference in a run",
|
|
81
|
+
fields: {
|
|
82
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
83
|
+
name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
84
|
+
modelProvider: {
|
|
85
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
86
|
+
isOptional: false
|
|
87
|
+
},
|
|
88
|
+
modelName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
var RunModel = defineSchemaModel({
|
|
92
|
+
name: "Run",
|
|
93
|
+
description: "Agent execution instance",
|
|
94
|
+
fields: {
|
|
95
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
96
|
+
organizationId: {
|
|
97
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
98
|
+
isOptional: false
|
|
99
|
+
},
|
|
100
|
+
agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
101
|
+
userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
102
|
+
sessionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
103
|
+
input: { type: ScalarTypeEnum.JSONObject(), isOptional: false },
|
|
104
|
+
output: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
|
|
105
|
+
status: { type: RunStatusEnum, isOptional: false },
|
|
106
|
+
errorMessage: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
107
|
+
errorCode: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
108
|
+
totalTokens: {
|
|
109
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
110
|
+
isOptional: false,
|
|
111
|
+
defaultValue: 0
|
|
112
|
+
},
|
|
113
|
+
promptTokens: {
|
|
114
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
115
|
+
isOptional: false,
|
|
116
|
+
defaultValue: 0
|
|
117
|
+
},
|
|
118
|
+
completionTokens: {
|
|
119
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
120
|
+
isOptional: false,
|
|
121
|
+
defaultValue: 0
|
|
122
|
+
},
|
|
123
|
+
totalIterations: {
|
|
124
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
125
|
+
isOptional: false,
|
|
126
|
+
defaultValue: 0
|
|
127
|
+
},
|
|
128
|
+
durationMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
129
|
+
estimatedCostUsd: {
|
|
130
|
+
type: ScalarTypeEnum.Float_unsecure(),
|
|
131
|
+
isOptional: true
|
|
132
|
+
},
|
|
133
|
+
queuedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
134
|
+
startedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
135
|
+
completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
136
|
+
metadata: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
|
|
137
|
+
steps: { type: RunStepModel, isArray: true, isOptional: true },
|
|
138
|
+
logs: { type: RunLogModel, isArray: true, isOptional: true },
|
|
139
|
+
agent: { type: RunAgentRefModel, isOptional: true }
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
var RunSummaryModel = defineSchemaModel({
|
|
143
|
+
name: "RunSummary",
|
|
144
|
+
description: "Summary of a run for list views",
|
|
145
|
+
fields: {
|
|
146
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
147
|
+
agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
148
|
+
agentName: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
149
|
+
status: { type: RunStatusEnum, isOptional: false },
|
|
150
|
+
totalTokens: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
151
|
+
durationMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
152
|
+
estimatedCostUsd: {
|
|
153
|
+
type: ScalarTypeEnum.Float_unsecure(),
|
|
154
|
+
isOptional: true
|
|
155
|
+
},
|
|
156
|
+
queuedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
157
|
+
completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true }
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
var TimelineDataPointModel = defineSchemaModel({
|
|
161
|
+
name: "TimelineDataPoint",
|
|
162
|
+
description: "Timeline data point for metrics",
|
|
163
|
+
fields: {
|
|
164
|
+
period: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
165
|
+
runs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
166
|
+
tokens: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
167
|
+
costUsd: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
168
|
+
avgDurationMs: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false }
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
// src/run/run.presentation.ts
|
|
173
|
+
import { StabilityEnum, definePresentation } from "@contractspec/lib.contracts";
|
|
174
|
+
var RunListPresentation = definePresentation({
|
|
175
|
+
meta: {
|
|
176
|
+
key: "agent-console.run.list",
|
|
177
|
+
version: "1.0.0",
|
|
178
|
+
title: "Run List",
|
|
179
|
+
description: "List view of agent runs with status, tokens, and duration info",
|
|
180
|
+
goal: "Provide an overview of agent execution history and performance.",
|
|
181
|
+
context: "Run history dashboard.",
|
|
182
|
+
domain: "agent-console",
|
|
183
|
+
owners: ["@agent-console-team"],
|
|
184
|
+
tags: ["run", "list", "dashboard"],
|
|
185
|
+
stability: StabilityEnum.Experimental
|
|
186
|
+
},
|
|
187
|
+
source: {
|
|
188
|
+
type: "component",
|
|
189
|
+
framework: "react",
|
|
190
|
+
componentKey: "RunListView",
|
|
191
|
+
props: RunSummaryModel
|
|
192
|
+
},
|
|
193
|
+
targets: ["react", "markdown", "application/json"],
|
|
194
|
+
policy: { flags: ["agent-console.enabled"] }
|
|
195
|
+
});
|
|
196
|
+
var RunDetailPresentation = definePresentation({
|
|
197
|
+
meta: {
|
|
198
|
+
key: "agent-console.run.detail",
|
|
199
|
+
version: "1.0.0",
|
|
200
|
+
title: "Run Details",
|
|
201
|
+
description: "Detailed view of an agent run with steps, logs, and metrics",
|
|
202
|
+
goal: "Allow users to inspect and debug a specific agent run.",
|
|
203
|
+
context: "Detailed view of an agent run.",
|
|
204
|
+
domain: "agent-console",
|
|
205
|
+
owners: ["@agent-console-team"],
|
|
206
|
+
tags: ["run", "detail"],
|
|
207
|
+
stability: StabilityEnum.Experimental
|
|
208
|
+
},
|
|
209
|
+
source: {
|
|
210
|
+
type: "component",
|
|
211
|
+
framework: "react",
|
|
212
|
+
componentKey: "RunDetailView"
|
|
213
|
+
},
|
|
214
|
+
targets: ["react", "markdown"],
|
|
215
|
+
policy: { flags: ["agent-console.enabled"] }
|
|
216
|
+
});
|
|
217
|
+
export {
|
|
218
|
+
RunListPresentation,
|
|
219
|
+
RunDetailPresentation
|
|
220
|
+
};
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
// src/run/run.enum.ts
|
|
2
|
+
import { defineEnum } from "@contractspec/lib.schema";
|
|
3
|
+
var RunStatusEnum = defineEnum("RunStatus", [
|
|
4
|
+
"QUEUED",
|
|
5
|
+
"IN_PROGRESS",
|
|
6
|
+
"COMPLETED",
|
|
7
|
+
"FAILED",
|
|
8
|
+
"CANCELLED",
|
|
9
|
+
"EXPIRED"
|
|
10
|
+
]);
|
|
11
|
+
var RunStepTypeEnum = defineEnum("RunStepType", [
|
|
12
|
+
"MESSAGE_CREATION",
|
|
13
|
+
"TOOL_CALL",
|
|
14
|
+
"TOOL_RESULT",
|
|
15
|
+
"ERROR"
|
|
16
|
+
]);
|
|
17
|
+
var LogLevelEnum = defineEnum("LogLevel", [
|
|
18
|
+
"DEBUG",
|
|
19
|
+
"INFO",
|
|
20
|
+
"WARN",
|
|
21
|
+
"ERROR"
|
|
22
|
+
]);
|
|
23
|
+
var GranularityEnum = defineEnum("Granularity", [
|
|
24
|
+
"hour",
|
|
25
|
+
"day",
|
|
26
|
+
"week",
|
|
27
|
+
"month"
|
|
28
|
+
]);
|
|
29
|
+
|
|
30
|
+
// src/run/run.schema.ts
|
|
31
|
+
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
32
|
+
var RunInputModel = defineSchemaModel({
|
|
33
|
+
name: "RunInput",
|
|
34
|
+
description: "Input data for agent execution",
|
|
35
|
+
fields: {
|
|
36
|
+
message: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
37
|
+
context: { type: ScalarTypeEnum.JSONObject(), isOptional: true }
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
var RunStepModel = defineSchemaModel({
|
|
41
|
+
name: "RunStep",
|
|
42
|
+
description: "Individual step within a run",
|
|
43
|
+
fields: {
|
|
44
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
45
|
+
stepNumber: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
46
|
+
type: { type: RunStepTypeEnum, isOptional: false },
|
|
47
|
+
toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
48
|
+
toolName: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
49
|
+
input: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
|
|
50
|
+
output: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
|
|
51
|
+
status: { type: RunStatusEnum, isOptional: false },
|
|
52
|
+
errorMessage: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
53
|
+
tokensUsed: {
|
|
54
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
55
|
+
isOptional: false,
|
|
56
|
+
defaultValue: 0
|
|
57
|
+
},
|
|
58
|
+
durationMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
59
|
+
startedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
60
|
+
completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true }
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
var RunLogModel = defineSchemaModel({
|
|
64
|
+
name: "RunLog",
|
|
65
|
+
description: "Execution log entry",
|
|
66
|
+
fields: {
|
|
67
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
68
|
+
stepId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
69
|
+
level: { type: LogLevelEnum, isOptional: false },
|
|
70
|
+
message: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
71
|
+
data: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
|
|
72
|
+
source: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
73
|
+
traceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
74
|
+
spanId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
75
|
+
timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false }
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
var RunAgentRefModel = defineSchemaModel({
|
|
79
|
+
name: "RunAgentRef",
|
|
80
|
+
description: "Agent reference in a run",
|
|
81
|
+
fields: {
|
|
82
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
83
|
+
name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
84
|
+
modelProvider: {
|
|
85
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
86
|
+
isOptional: false
|
|
87
|
+
},
|
|
88
|
+
modelName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
var RunModel = defineSchemaModel({
|
|
92
|
+
name: "Run",
|
|
93
|
+
description: "Agent execution instance",
|
|
94
|
+
fields: {
|
|
95
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
96
|
+
organizationId: {
|
|
97
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
98
|
+
isOptional: false
|
|
99
|
+
},
|
|
100
|
+
agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
101
|
+
userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
102
|
+
sessionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
103
|
+
input: { type: ScalarTypeEnum.JSONObject(), isOptional: false },
|
|
104
|
+
output: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
|
|
105
|
+
status: { type: RunStatusEnum, isOptional: false },
|
|
106
|
+
errorMessage: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
107
|
+
errorCode: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
108
|
+
totalTokens: {
|
|
109
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
110
|
+
isOptional: false,
|
|
111
|
+
defaultValue: 0
|
|
112
|
+
},
|
|
113
|
+
promptTokens: {
|
|
114
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
115
|
+
isOptional: false,
|
|
116
|
+
defaultValue: 0
|
|
117
|
+
},
|
|
118
|
+
completionTokens: {
|
|
119
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
120
|
+
isOptional: false,
|
|
121
|
+
defaultValue: 0
|
|
122
|
+
},
|
|
123
|
+
totalIterations: {
|
|
124
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
125
|
+
isOptional: false,
|
|
126
|
+
defaultValue: 0
|
|
127
|
+
},
|
|
128
|
+
durationMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
129
|
+
estimatedCostUsd: {
|
|
130
|
+
type: ScalarTypeEnum.Float_unsecure(),
|
|
131
|
+
isOptional: true
|
|
132
|
+
},
|
|
133
|
+
queuedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
134
|
+
startedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
135
|
+
completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
136
|
+
metadata: { type: ScalarTypeEnum.JSONObject(), isOptional: true },
|
|
137
|
+
steps: { type: RunStepModel, isArray: true, isOptional: true },
|
|
138
|
+
logs: { type: RunLogModel, isArray: true, isOptional: true },
|
|
139
|
+
agent: { type: RunAgentRefModel, isOptional: true }
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
var RunSummaryModel = defineSchemaModel({
|
|
143
|
+
name: "RunSummary",
|
|
144
|
+
description: "Summary of a run for list views",
|
|
145
|
+
fields: {
|
|
146
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
147
|
+
agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
148
|
+
agentName: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
149
|
+
status: { type: RunStatusEnum, isOptional: false },
|
|
150
|
+
totalTokens: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
151
|
+
durationMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
152
|
+
estimatedCostUsd: {
|
|
153
|
+
type: ScalarTypeEnum.Float_unsecure(),
|
|
154
|
+
isOptional: true
|
|
155
|
+
},
|
|
156
|
+
queuedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
157
|
+
completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true }
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
var TimelineDataPointModel = defineSchemaModel({
|
|
161
|
+
name: "TimelineDataPoint",
|
|
162
|
+
description: "Timeline data point for metrics",
|
|
163
|
+
fields: {
|
|
164
|
+
period: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
165
|
+
runs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
166
|
+
tokens: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
|
|
167
|
+
costUsd: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
168
|
+
avgDurationMs: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false }
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
export {
|
|
172
|
+
TimelineDataPointModel,
|
|
173
|
+
RunSummaryModel,
|
|
174
|
+
RunStepModel,
|
|
175
|
+
RunModel,
|
|
176
|
+
RunLogModel,
|
|
177
|
+
RunInputModel,
|
|
178
|
+
RunAgentRefModel
|
|
179
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// src/run/run.test-spec.ts
|
|
2
|
+
import { defineTestSpec } from "@contractspec/lib.contracts";
|
|
3
|
+
var runListTest = defineTestSpec({
|
|
4
|
+
meta: {
|
|
5
|
+
key: "test.agent.run.list",
|
|
6
|
+
version: "1.0.0",
|
|
7
|
+
owners: ["@agent-console-team"],
|
|
8
|
+
description: "Test for listing runs",
|
|
9
|
+
stability: "stable",
|
|
10
|
+
tags: ["test"]
|
|
11
|
+
},
|
|
12
|
+
target: {
|
|
13
|
+
type: "operation",
|
|
14
|
+
operation: { key: "agent.run.list", version: "1.0.0" }
|
|
15
|
+
},
|
|
16
|
+
scenarios: [
|
|
17
|
+
{
|
|
18
|
+
key: "success",
|
|
19
|
+
when: { operation: { key: "agent.run.list" } },
|
|
20
|
+
then: [{ type: "expectOutput", match: {} }]
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
key: "error",
|
|
24
|
+
when: { operation: { key: "agent.run.list" } },
|
|
25
|
+
then: [{ type: "expectError" }]
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
});
|
|
29
|
+
var runGetTest = defineTestSpec({
|
|
30
|
+
meta: {
|
|
31
|
+
key: "test.agent.run.get",
|
|
32
|
+
version: "1.0.0",
|
|
33
|
+
owners: ["@agent-console-team"],
|
|
34
|
+
description: "Test for getting run",
|
|
35
|
+
stability: "stable",
|
|
36
|
+
tags: ["test"]
|
|
37
|
+
},
|
|
38
|
+
target: {
|
|
39
|
+
type: "operation",
|
|
40
|
+
operation: { key: "agent.run.get", version: "1.0.0" }
|
|
41
|
+
},
|
|
42
|
+
scenarios: [
|
|
43
|
+
{
|
|
44
|
+
key: "success",
|
|
45
|
+
when: { operation: { key: "agent.run.get" } },
|
|
46
|
+
then: [{ type: "expectOutput", match: {} }]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
key: "error",
|
|
50
|
+
when: { operation: { key: "agent.run.get" } },
|
|
51
|
+
then: [{ type: "expectError" }]
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
|
+
export {
|
|
56
|
+
runListTest,
|
|
57
|
+
runGetTest
|
|
58
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// src/seeders/index.ts
|
|
2
|
+
async function seedAgentConsole(params) {
|
|
3
|
+
const { projectId, db } = params;
|
|
4
|
+
const existing = await db.query(`SELECT COUNT(*) as count FROM agent_definition WHERE "projectId" = $1`, [projectId]);
|
|
5
|
+
if (existing.rows[0]?.count > 0)
|
|
6
|
+
return;
|
|
7
|
+
await db.execute(`INSERT INTO agent_definition (id, "projectId", "organizationId", name, description, "modelProvider", "modelName", status)
|
|
8
|
+
VALUES ($1, $2, $3, $4, $5, $6, $7, $8)`, [
|
|
9
|
+
"agent_1",
|
|
10
|
+
projectId,
|
|
11
|
+
"org_demo",
|
|
12
|
+
"Demo Agent",
|
|
13
|
+
"A demo AI agent",
|
|
14
|
+
"openai",
|
|
15
|
+
"gpt-4",
|
|
16
|
+
"ACTIVE"
|
|
17
|
+
]);
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
seedAgentConsole
|
|
21
|
+
};
|