@contractspec/example.agent-console 0.0.0-canary-20260113170453
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$colon$bundle.log +280 -0
- package/.turbo/turbo-build.log +281 -0
- package/CHANGELOG.md +368 -0
- package/LICENSE +21 -0
- package/README.md +86 -0
- package/dist/agent/agent.entity.d.ts +55 -0
- package/dist/agent/agent.entity.d.ts.map +1 -0
- package/dist/agent/agent.entity.js +136 -0
- package/dist/agent/agent.entity.js.map +1 -0
- package/dist/agent/agent.enum.d.ts +18 -0
- package/dist/agent/agent.enum.d.ts.map +1 -0
- package/dist/agent/agent.enum.js +34 -0
- package/dist/agent/agent.enum.js.map +1 -0
- package/dist/agent/agent.event.d.ts +128 -0
- package/dist/agent/agent.event.d.ts.map +1 -0
- package/dist/agent/agent.event.js +210 -0
- package/dist/agent/agent.event.js.map +1 -0
- package/dist/agent/agent.handler.d.ts +100 -0
- package/dist/agent/agent.handler.d.ts.map +1 -0
- package/dist/agent/agent.handler.js +84 -0
- package/dist/agent/agent.handler.js.map +1 -0
- package/dist/agent/agent.operation.d.ts +471 -0
- package/dist/agent/agent.operation.d.ts.map +1 -0
- package/dist/agent/agent.operation.js +486 -0
- package/dist/agent/agent.operation.js.map +1 -0
- package/dist/agent/agent.presentation.d.ts +18 -0
- package/dist/agent/agent.presentation.d.ts.map +1 -0
- package/dist/agent/agent.presentation.js +89 -0
- package/dist/agent/agent.presentation.js.map +1 -0
- package/dist/agent/agent.schema.d.ts +401 -0
- package/dist/agent/agent.schema.d.ts.map +1 -0
- package/dist/agent/agent.schema.js +406 -0
- package/dist/agent/agent.schema.js.map +1 -0
- package/dist/agent/agent.test-spec.d.ts +8 -0
- package/dist/agent/agent.test-spec.d.ts.map +1 -0
- package/dist/agent/agent.test-spec.js +65 -0
- package/dist/agent/agent.test-spec.js.map +1 -0
- package/dist/agent/index.d.ts +8 -0
- package/dist/agent/index.js +9 -0
- package/dist/agent.capability.d.ts +7 -0
- package/dist/agent.capability.d.ts.map +1 -0
- package/dist/agent.capability.js +20 -0
- package/dist/agent.capability.js.map +1 -0
- package/dist/agent.feature.d.ts +12 -0
- package/dist/agent.feature.d.ts.map +1 -0
- package/dist/agent.feature.js +305 -0
- package/dist/agent.feature.js.map +1 -0
- package/dist/docs/agent-console.docblock.d.ts +1 -0
- package/dist/docs/agent-console.docblock.js +113 -0
- package/dist/docs/agent-console.docblock.js.map +1 -0
- package/dist/docs/index.d.ts +1 -0
- package/dist/docs/index.js +1 -0
- package/dist/example.d.ts +7 -0
- package/dist/example.d.ts.map +1 -0
- package/dist/example.js +58 -0
- package/dist/example.js.map +1 -0
- package/dist/handlers/agent.handlers.d.ts +135 -0
- package/dist/handlers/agent.handlers.d.ts.map +1 -0
- package/dist/handlers/agent.handlers.js +263 -0
- package/dist/handlers/agent.handlers.js.map +1 -0
- package/dist/handlers/index.d.ts +5 -0
- package/dist/handlers/index.js +6 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.js +50 -0
- package/dist/presentations/index.d.ts +4 -0
- package/dist/presentations/index.js +5 -0
- package/dist/run/index.d.ts +8 -0
- package/dist/run/index.js +9 -0
- package/dist/run/run.entity.d.ts +82 -0
- package/dist/run/run.entity.d.ts.map +1 -0
- package/dist/run/run.entity.js +205 -0
- package/dist/run/run.entity.js.map +1 -0
- package/dist/run/run.enum.d.ts +22 -0
- package/dist/run/run.enum.d.ts.map +1 -0
- package/dist/run/run.enum.js +45 -0
- package/dist/run/run.enum.js.map +1 -0
- package/dist/run/run.event.d.ts +290 -0
- package/dist/run/run.event.d.ts.map +1 -0
- package/dist/run/run.event.js +434 -0
- package/dist/run/run.event.js.map +1 -0
- package/dist/run/run.handler.d.ts +203 -0
- package/dist/run/run.handler.d.ts.map +1 -0
- package/dist/run/run.handler.js +83 -0
- package/dist/run/run.handler.js.map +1 -0
- package/dist/run/run.operation.d.ts +720 -0
- package/dist/run/run.operation.d.ts.map +1 -0
- package/dist/run/run.operation.js +626 -0
- package/dist/run/run.operation.js.map +1 -0
- package/dist/run/run.presentation.d.ts +14 -0
- package/dist/run/run.presentation.d.ts.map +1 -0
- package/dist/run/run.presentation.js +65 -0
- package/dist/run/run.presentation.js.map +1 -0
- package/dist/run/run.schema.d.ts +416 -0
- package/dist/run/run.schema.d.ts.map +1 -0
- package/dist/run/run.schema.js +338 -0
- package/dist/run/run.schema.js.map +1 -0
- package/dist/run/run.test-spec.d.ts +8 -0
- package/dist/run/run.test-spec.d.ts.map +1 -0
- package/dist/run/run.test-spec.js +65 -0
- package/dist/run/run.test-spec.js.map +1 -0
- package/dist/seeders/index.d.ts +10 -0
- package/dist/seeders/index.d.ts.map +1 -0
- package/dist/seeders/index.js +20 -0
- package/dist/seeders/index.js.map +1 -0
- package/dist/shared/index.d.ts +4 -0
- package/dist/shared/index.js +5 -0
- package/dist/shared/mock-agents.d.ts +88 -0
- package/dist/shared/mock-agents.d.ts.map +1 -0
- package/dist/shared/mock-agents.js +94 -0
- package/dist/shared/mock-agents.js.map +1 -0
- package/dist/shared/mock-runs.d.ts +120 -0
- package/dist/shared/mock-runs.d.ts.map +1 -0
- package/dist/shared/mock-runs.js +118 -0
- package/dist/shared/mock-runs.js.map +1 -0
- package/dist/shared/mock-tools.d.ts +244 -0
- package/dist/shared/mock-tools.d.ts.map +1 -0
- package/dist/shared/mock-tools.js +181 -0
- package/dist/shared/mock-tools.js.map +1 -0
- package/dist/shared/overlay-types.d.ts +34 -0
- package/dist/shared/overlay-types.d.ts.map +1 -0
- package/dist/shared/overlay-types.js +0 -0
- package/dist/tool/index.d.ts +8 -0
- package/dist/tool/index.js +9 -0
- package/dist/tool/tool.entity.d.ts +42 -0
- package/dist/tool/tool.entity.d.ts.map +1 -0
- package/dist/tool/tool.entity.js +105 -0
- package/dist/tool/tool.entity.js.map +1 -0
- package/dist/tool/tool.enum.d.ts +18 -0
- package/dist/tool/tool.enum.d.ts.map +1 -0
- package/dist/tool/tool.enum.js +35 -0
- package/dist/tool/tool.enum.js.map +1 -0
- package/dist/tool/tool.event.d.ts +103 -0
- package/dist/tool/tool.event.d.ts.map +1 -0
- package/dist/tool/tool.event.js +159 -0
- package/dist/tool/tool.event.js.map +1 -0
- package/dist/tool/tool.handler.d.ts +315 -0
- package/dist/tool/tool.handler.d.ts.map +1 -0
- package/dist/tool/tool.handler.js +87 -0
- package/dist/tool/tool.handler.js.map +1 -0
- package/dist/tool/tool.operation.d.ts +411 -0
- package/dist/tool/tool.operation.d.ts.map +1 -0
- package/dist/tool/tool.operation.js +406 -0
- package/dist/tool/tool.operation.js.map +1 -0
- package/dist/tool/tool.presentation.d.ts +14 -0
- package/dist/tool/tool.presentation.d.ts.map +1 -0
- package/dist/tool/tool.presentation.js +65 -0
- package/dist/tool/tool.presentation.js.map +1 -0
- package/dist/tool/tool.schema.d.ts +218 -0
- package/dist/tool/tool.schema.d.ts.map +1 -0
- package/dist/tool/tool.schema.js +236 -0
- package/dist/tool/tool.schema.js.map +1 -0
- package/dist/tool/tool.test-spec.d.ts +8 -0
- package/dist/tool/tool.test-spec.d.ts.map +1 -0
- package/dist/tool/tool.test-spec.js +65 -0
- package/dist/tool/tool.test-spec.js.map +1 -0
- package/dist/ui/AgentDashboard.d.ts +7 -0
- package/dist/ui/AgentDashboard.d.ts.map +1 -0
- package/dist/ui/AgentDashboard.js +420 -0
- package/dist/ui/AgentDashboard.js.map +1 -0
- package/dist/ui/AgentRunList.d.ts +2 -0
- package/dist/ui/AgentRunList.js +5 -0
- package/dist/ui/AgentToolRegistry.d.ts +2 -0
- package/dist/ui/AgentToolRegistry.js +5 -0
- package/dist/ui/hooks/index.d.ts +6 -0
- package/dist/ui/hooks/index.js +8 -0
- package/dist/ui/hooks/useAgentList.d.ts +28 -0
- package/dist/ui/hooks/useAgentList.d.ts.map +1 -0
- package/dist/ui/hooks/useAgentList.js +66 -0
- package/dist/ui/hooks/useAgentList.js.map +1 -0
- package/dist/ui/hooks/useAgentMutations.d.ts +29 -0
- package/dist/ui/hooks/useAgentMutations.d.ts.map +1 -0
- package/dist/ui/hooks/useAgentMutations.js +124 -0
- package/dist/ui/hooks/useAgentMutations.js.map +1 -0
- package/dist/ui/hooks/useRunList.d.ts +24 -0
- package/dist/ui/hooks/useRunList.d.ts.map +1 -0
- package/dist/ui/hooks/useRunList.js +66 -0
- package/dist/ui/hooks/useRunList.js.map +1 -0
- package/dist/ui/hooks/useToolList.d.ts +40 -0
- package/dist/ui/hooks/useToolList.d.ts.map +1 -0
- package/dist/ui/hooks/useToolList.js +96 -0
- package/dist/ui/hooks/useToolList.js.map +1 -0
- package/dist/ui/index.d.ts +24 -0
- package/dist/ui/index.js +24 -0
- package/dist/ui/modals/AgentActionsModal.d.ts +27 -0
- package/dist/ui/modals/AgentActionsModal.d.ts.map +1 -0
- package/dist/ui/modals/AgentActionsModal.js +262 -0
- package/dist/ui/modals/AgentActionsModal.js.map +1 -0
- package/dist/ui/modals/CreateAgentModal.d.ts +25 -0
- package/dist/ui/modals/CreateAgentModal.d.ts.map +1 -0
- package/dist/ui/modals/CreateAgentModal.js +214 -0
- package/dist/ui/modals/CreateAgentModal.js.map +1 -0
- package/dist/ui/modals/index.d.ts +3 -0
- package/dist/ui/modals/index.js +4 -0
- package/dist/ui/overlays/demo-overlays.d.ts +19 -0
- package/dist/ui/overlays/demo-overlays.d.ts.map +1 -0
- package/dist/ui/overlays/demo-overlays.js +73 -0
- package/dist/ui/overlays/demo-overlays.js.map +1 -0
- package/dist/ui/overlays/index.d.ts +2 -0
- package/dist/ui/overlays/index.js +3 -0
- package/dist/ui/renderers/agent-list.markdown.d.ts +15 -0
- package/dist/ui/renderers/agent-list.markdown.d.ts.map +1 -0
- package/dist/ui/renderers/agent-list.markdown.js +51 -0
- package/dist/ui/renderers/agent-list.markdown.js.map +1 -0
- package/dist/ui/renderers/agent-list.renderer.d.ts +11 -0
- package/dist/ui/renderers/agent-list.renderer.d.ts.map +1 -0
- package/dist/ui/renderers/agent-list.renderer.js +19 -0
- package/dist/ui/renderers/agent-list.renderer.js.map +1 -0
- package/dist/ui/renderers/dashboard.markdown.d.ts +15 -0
- package/dist/ui/renderers/dashboard.markdown.d.ts.map +1 -0
- package/dist/ui/renderers/dashboard.markdown.js +100 -0
- package/dist/ui/renderers/dashboard.markdown.js.map +1 -0
- package/dist/ui/renderers/index.d.ts +6 -0
- package/dist/ui/renderers/index.js +7 -0
- package/dist/ui/renderers/run-list.markdown.d.ts +15 -0
- package/dist/ui/renderers/run-list.markdown.d.ts.map +1 -0
- package/dist/ui/renderers/run-list.markdown.js +44 -0
- package/dist/ui/renderers/run-list.markdown.js.map +1 -0
- package/dist/ui/renderers/tool-registry.markdown.d.ts +15 -0
- package/dist/ui/renderers/tool-registry.markdown.d.ts.map +1 -0
- package/dist/ui/renderers/tool-registry.markdown.js +55 -0
- package/dist/ui/renderers/tool-registry.markdown.js.map +1 -0
- package/dist/ui/views/AgentListView.d.ts +7 -0
- package/dist/ui/views/AgentListView.d.ts.map +1 -0
- package/dist/ui/views/AgentListView.js +93 -0
- package/dist/ui/views/AgentListView.js.map +1 -0
- package/dist/ui/views/RunListView.d.ts +14 -0
- package/dist/ui/views/RunListView.d.ts.map +1 -0
- package/dist/ui/views/RunListView.js +165 -0
- package/dist/ui/views/RunListView.js.map +1 -0
- package/dist/ui/views/ToolRegistryView.d.ts +14 -0
- package/dist/ui/views/ToolRegistryView.d.ts.map +1 -0
- package/dist/ui/views/ToolRegistryView.js +97 -0
- package/dist/ui/views/ToolRegistryView.js.map +1 -0
- package/dist/ui/views/index.d.ts +4 -0
- package/dist/ui/views/index.js +5 -0
- package/example.ts +1 -0
- package/package.json +155 -0
- package/src/agent/agent.entity.ts +137 -0
- package/src/agent/agent.enum.ts +31 -0
- package/src/agent/agent.event.ts +142 -0
- package/src/agent/agent.handler.ts +178 -0
- package/src/agent/agent.operation.ts +444 -0
- package/src/agent/agent.presentation.ts +80 -0
- package/src/agent/agent.schema.ts +214 -0
- package/src/agent/agent.test-spec.ts +55 -0
- package/src/agent/index.ts +67 -0
- package/src/agent.capability.ts +13 -0
- package/src/agent.feature.ts +147 -0
- package/src/docs/agent-console.docblock.ts +97 -0
- package/src/docs/index.ts +1 -0
- package/src/example.ts +41 -0
- package/src/handlers/agent.handlers.ts +572 -0
- package/src/handlers/index.ts +30 -0
- package/src/index.ts +32 -0
- package/src/presentations/index.ts +26 -0
- package/src/run/index.ts +68 -0
- package/src/run/run.entity.ts +175 -0
- package/src/run/run.enum.ts +43 -0
- package/src/run/run.event.ts +264 -0
- package/src/run/run.handler.ts +138 -0
- package/src/run/run.operation.ts +524 -0
- package/src/run/run.presentation.ts +54 -0
- package/src/run/run.schema.ts +169 -0
- package/src/run/run.test-spec.ts +55 -0
- package/src/seeders/index.ts +29 -0
- package/src/shared/index.ts +6 -0
- package/src/shared/mock-agents.ts +81 -0
- package/src/shared/mock-runs.ts +107 -0
- package/src/shared/mock-tools.ts +145 -0
- package/src/shared/overlay-types.ts +39 -0
- package/src/tool/index.ts +60 -0
- package/src/tool/tool.entity.ts +99 -0
- package/src/tool/tool.enum.ts +32 -0
- package/src/tool/tool.event.ts +119 -0
- package/src/tool/tool.handler.ts +154 -0
- package/src/tool/tool.operation.ts +366 -0
- package/src/tool/tool.presentation.ts +55 -0
- package/src/tool/tool.schema.ts +133 -0
- package/src/tool/tool.test-spec.ts +55 -0
- package/src/ui/AgentDashboard.tsx +416 -0
- package/src/ui/AgentRunList.tsx +8 -0
- package/src/ui/AgentToolRegistry.tsx +8 -0
- package/src/ui/hooks/index.ts +14 -0
- package/src/ui/hooks/useAgentList.ts +80 -0
- package/src/ui/hooks/useAgentMutations.ts +156 -0
- package/src/ui/hooks/useRunList.ts +81 -0
- package/src/ui/hooks/useToolList.ts +122 -0
- package/src/ui/index.ts +21 -0
- package/src/ui/modals/AgentActionsModal.tsx +306 -0
- package/src/ui/modals/CreateAgentModal.tsx +257 -0
- package/src/ui/modals/index.ts +2 -0
- package/src/ui/overlays/demo-overlays.ts +77 -0
- package/src/ui/overlays/index.ts +1 -0
- package/src/ui/renderers/agent-list.markdown.ts +84 -0
- package/src/ui/renderers/agent-list.renderer.tsx +27 -0
- package/src/ui/renderers/dashboard.markdown.ts +169 -0
- package/src/ui/renderers/index.ts +12 -0
- package/src/ui/renderers/run-list.markdown.ts +75 -0
- package/src/ui/renderers/tool-registry.markdown.ts +91 -0
- package/src/ui/views/AgentListView.tsx +113 -0
- package/src/ui/views/RunListView.tsx +173 -0
- package/src/ui/views/ToolRegistryView.tsx +140 -0
- package/src/ui/views/index.ts +6 -0
- package/tsconfig.json +10 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/tsdown.config.js +7 -0
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import { LogLevelEnum, RunStatusEnum, RunStepTypeEnum } from "./run.enum.js";
|
|
2
|
+
import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
|
|
3
|
+
|
|
4
|
+
//#region src/run/run.schema.ts
|
|
5
|
+
/**
|
|
6
|
+
* Input data for agent execution.
|
|
7
|
+
*/
|
|
8
|
+
const RunInputModel = defineSchemaModel({
|
|
9
|
+
name: "RunInput",
|
|
10
|
+
description: "Input data for agent execution",
|
|
11
|
+
fields: {
|
|
12
|
+
message: {
|
|
13
|
+
type: ScalarTypeEnum.NonEmptyString(),
|
|
14
|
+
isOptional: false
|
|
15
|
+
},
|
|
16
|
+
context: {
|
|
17
|
+
type: ScalarTypeEnum.JSONObject(),
|
|
18
|
+
isOptional: true
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
/**
|
|
23
|
+
* Individual step within a run.
|
|
24
|
+
*/
|
|
25
|
+
const RunStepModel = defineSchemaModel({
|
|
26
|
+
name: "RunStep",
|
|
27
|
+
description: "Individual step within a run",
|
|
28
|
+
fields: {
|
|
29
|
+
id: {
|
|
30
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
31
|
+
isOptional: false
|
|
32
|
+
},
|
|
33
|
+
stepNumber: {
|
|
34
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
35
|
+
isOptional: false
|
|
36
|
+
},
|
|
37
|
+
type: {
|
|
38
|
+
type: RunStepTypeEnum,
|
|
39
|
+
isOptional: false
|
|
40
|
+
},
|
|
41
|
+
toolId: {
|
|
42
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
43
|
+
isOptional: true
|
|
44
|
+
},
|
|
45
|
+
toolName: {
|
|
46
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
47
|
+
isOptional: true
|
|
48
|
+
},
|
|
49
|
+
input: {
|
|
50
|
+
type: ScalarTypeEnum.JSONObject(),
|
|
51
|
+
isOptional: true
|
|
52
|
+
},
|
|
53
|
+
output: {
|
|
54
|
+
type: ScalarTypeEnum.JSONObject(),
|
|
55
|
+
isOptional: true
|
|
56
|
+
},
|
|
57
|
+
status: {
|
|
58
|
+
type: RunStatusEnum,
|
|
59
|
+
isOptional: false
|
|
60
|
+
},
|
|
61
|
+
errorMessage: {
|
|
62
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
63
|
+
isOptional: true
|
|
64
|
+
},
|
|
65
|
+
tokensUsed: {
|
|
66
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
67
|
+
isOptional: false,
|
|
68
|
+
defaultValue: 0
|
|
69
|
+
},
|
|
70
|
+
durationMs: {
|
|
71
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
72
|
+
isOptional: true
|
|
73
|
+
},
|
|
74
|
+
startedAt: {
|
|
75
|
+
type: ScalarTypeEnum.DateTime(),
|
|
76
|
+
isOptional: false
|
|
77
|
+
},
|
|
78
|
+
completedAt: {
|
|
79
|
+
type: ScalarTypeEnum.DateTime(),
|
|
80
|
+
isOptional: true
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
/**
|
|
85
|
+
* Execution log entry.
|
|
86
|
+
*/
|
|
87
|
+
const RunLogModel = defineSchemaModel({
|
|
88
|
+
name: "RunLog",
|
|
89
|
+
description: "Execution log entry",
|
|
90
|
+
fields: {
|
|
91
|
+
id: {
|
|
92
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
93
|
+
isOptional: false
|
|
94
|
+
},
|
|
95
|
+
stepId: {
|
|
96
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
97
|
+
isOptional: true
|
|
98
|
+
},
|
|
99
|
+
level: {
|
|
100
|
+
type: LogLevelEnum,
|
|
101
|
+
isOptional: false
|
|
102
|
+
},
|
|
103
|
+
message: {
|
|
104
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
105
|
+
isOptional: false
|
|
106
|
+
},
|
|
107
|
+
data: {
|
|
108
|
+
type: ScalarTypeEnum.JSONObject(),
|
|
109
|
+
isOptional: true
|
|
110
|
+
},
|
|
111
|
+
source: {
|
|
112
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
113
|
+
isOptional: true
|
|
114
|
+
},
|
|
115
|
+
traceId: {
|
|
116
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
117
|
+
isOptional: true
|
|
118
|
+
},
|
|
119
|
+
spanId: {
|
|
120
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
121
|
+
isOptional: true
|
|
122
|
+
},
|
|
123
|
+
timestamp: {
|
|
124
|
+
type: ScalarTypeEnum.DateTime(),
|
|
125
|
+
isOptional: false
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
/**
|
|
130
|
+
* Agent reference in a run.
|
|
131
|
+
*/
|
|
132
|
+
const RunAgentRefModel = defineSchemaModel({
|
|
133
|
+
name: "RunAgentRef",
|
|
134
|
+
description: "Agent reference in a run",
|
|
135
|
+
fields: {
|
|
136
|
+
id: {
|
|
137
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
138
|
+
isOptional: false
|
|
139
|
+
},
|
|
140
|
+
name: {
|
|
141
|
+
type: ScalarTypeEnum.NonEmptyString(),
|
|
142
|
+
isOptional: false
|
|
143
|
+
},
|
|
144
|
+
modelProvider: {
|
|
145
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
146
|
+
isOptional: false
|
|
147
|
+
},
|
|
148
|
+
modelName: {
|
|
149
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
150
|
+
isOptional: false
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
/**
|
|
155
|
+
* Agent execution instance.
|
|
156
|
+
*/
|
|
157
|
+
const RunModel = defineSchemaModel({
|
|
158
|
+
name: "Run",
|
|
159
|
+
description: "Agent execution instance",
|
|
160
|
+
fields: {
|
|
161
|
+
id: {
|
|
162
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
163
|
+
isOptional: false
|
|
164
|
+
},
|
|
165
|
+
organizationId: {
|
|
166
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
167
|
+
isOptional: false
|
|
168
|
+
},
|
|
169
|
+
agentId: {
|
|
170
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
171
|
+
isOptional: false
|
|
172
|
+
},
|
|
173
|
+
userId: {
|
|
174
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
175
|
+
isOptional: true
|
|
176
|
+
},
|
|
177
|
+
sessionId: {
|
|
178
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
179
|
+
isOptional: true
|
|
180
|
+
},
|
|
181
|
+
input: {
|
|
182
|
+
type: ScalarTypeEnum.JSONObject(),
|
|
183
|
+
isOptional: false
|
|
184
|
+
},
|
|
185
|
+
output: {
|
|
186
|
+
type: ScalarTypeEnum.JSONObject(),
|
|
187
|
+
isOptional: true
|
|
188
|
+
},
|
|
189
|
+
status: {
|
|
190
|
+
type: RunStatusEnum,
|
|
191
|
+
isOptional: false
|
|
192
|
+
},
|
|
193
|
+
errorMessage: {
|
|
194
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
195
|
+
isOptional: true
|
|
196
|
+
},
|
|
197
|
+
errorCode: {
|
|
198
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
199
|
+
isOptional: true
|
|
200
|
+
},
|
|
201
|
+
totalTokens: {
|
|
202
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
203
|
+
isOptional: false,
|
|
204
|
+
defaultValue: 0
|
|
205
|
+
},
|
|
206
|
+
promptTokens: {
|
|
207
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
208
|
+
isOptional: false,
|
|
209
|
+
defaultValue: 0
|
|
210
|
+
},
|
|
211
|
+
completionTokens: {
|
|
212
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
213
|
+
isOptional: false,
|
|
214
|
+
defaultValue: 0
|
|
215
|
+
},
|
|
216
|
+
totalIterations: {
|
|
217
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
218
|
+
isOptional: false,
|
|
219
|
+
defaultValue: 0
|
|
220
|
+
},
|
|
221
|
+
durationMs: {
|
|
222
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
223
|
+
isOptional: true
|
|
224
|
+
},
|
|
225
|
+
estimatedCostUsd: {
|
|
226
|
+
type: ScalarTypeEnum.Float_unsecure(),
|
|
227
|
+
isOptional: true
|
|
228
|
+
},
|
|
229
|
+
queuedAt: {
|
|
230
|
+
type: ScalarTypeEnum.DateTime(),
|
|
231
|
+
isOptional: false
|
|
232
|
+
},
|
|
233
|
+
startedAt: {
|
|
234
|
+
type: ScalarTypeEnum.DateTime(),
|
|
235
|
+
isOptional: true
|
|
236
|
+
},
|
|
237
|
+
completedAt: {
|
|
238
|
+
type: ScalarTypeEnum.DateTime(),
|
|
239
|
+
isOptional: true
|
|
240
|
+
},
|
|
241
|
+
metadata: {
|
|
242
|
+
type: ScalarTypeEnum.JSONObject(),
|
|
243
|
+
isOptional: true
|
|
244
|
+
},
|
|
245
|
+
steps: {
|
|
246
|
+
type: RunStepModel,
|
|
247
|
+
isArray: true,
|
|
248
|
+
isOptional: true
|
|
249
|
+
},
|
|
250
|
+
logs: {
|
|
251
|
+
type: RunLogModel,
|
|
252
|
+
isArray: true,
|
|
253
|
+
isOptional: true
|
|
254
|
+
},
|
|
255
|
+
agent: {
|
|
256
|
+
type: RunAgentRefModel,
|
|
257
|
+
isOptional: true
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
/**
|
|
262
|
+
* Summary of a run for list views.
|
|
263
|
+
*/
|
|
264
|
+
const RunSummaryModel = defineSchemaModel({
|
|
265
|
+
name: "RunSummary",
|
|
266
|
+
description: "Summary of a run for list views",
|
|
267
|
+
fields: {
|
|
268
|
+
id: {
|
|
269
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
270
|
+
isOptional: false
|
|
271
|
+
},
|
|
272
|
+
agentId: {
|
|
273
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
274
|
+
isOptional: false
|
|
275
|
+
},
|
|
276
|
+
agentName: {
|
|
277
|
+
type: ScalarTypeEnum.NonEmptyString(),
|
|
278
|
+
isOptional: false
|
|
279
|
+
},
|
|
280
|
+
status: {
|
|
281
|
+
type: RunStatusEnum,
|
|
282
|
+
isOptional: false
|
|
283
|
+
},
|
|
284
|
+
totalTokens: {
|
|
285
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
286
|
+
isOptional: false
|
|
287
|
+
},
|
|
288
|
+
durationMs: {
|
|
289
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
290
|
+
isOptional: true
|
|
291
|
+
},
|
|
292
|
+
estimatedCostUsd: {
|
|
293
|
+
type: ScalarTypeEnum.Float_unsecure(),
|
|
294
|
+
isOptional: true
|
|
295
|
+
},
|
|
296
|
+
queuedAt: {
|
|
297
|
+
type: ScalarTypeEnum.DateTime(),
|
|
298
|
+
isOptional: false
|
|
299
|
+
},
|
|
300
|
+
completedAt: {
|
|
301
|
+
type: ScalarTypeEnum.DateTime(),
|
|
302
|
+
isOptional: true
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
/**
|
|
307
|
+
* Timeline data point for metrics.
|
|
308
|
+
*/
|
|
309
|
+
const TimelineDataPointModel = defineSchemaModel({
|
|
310
|
+
name: "TimelineDataPoint",
|
|
311
|
+
description: "Timeline data point for metrics",
|
|
312
|
+
fields: {
|
|
313
|
+
period: {
|
|
314
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
315
|
+
isOptional: false
|
|
316
|
+
},
|
|
317
|
+
runs: {
|
|
318
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
319
|
+
isOptional: false
|
|
320
|
+
},
|
|
321
|
+
tokens: {
|
|
322
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
323
|
+
isOptional: false
|
|
324
|
+
},
|
|
325
|
+
costUsd: {
|
|
326
|
+
type: ScalarTypeEnum.Float_unsecure(),
|
|
327
|
+
isOptional: false
|
|
328
|
+
},
|
|
329
|
+
avgDurationMs: {
|
|
330
|
+
type: ScalarTypeEnum.Float_unsecure(),
|
|
331
|
+
isOptional: false
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
//#endregion
|
|
337
|
+
export { RunAgentRefModel, RunInputModel, RunLogModel, RunModel, RunStepModel, RunSummaryModel, TimelineDataPointModel };
|
|
338
|
+
//# sourceMappingURL=run.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.schema.js","names":[],"sources":["../../src/run/run.schema.ts"],"sourcesContent":["import { defineSchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';\nimport { RunStatusEnum, RunStepTypeEnum, LogLevelEnum } from './run.enum';\n\n/**\n * Input data for agent execution.\n */\nexport const RunInputModel = defineSchemaModel({\n name: 'RunInput',\n description: 'Input data for agent execution',\n fields: {\n message: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n context: { type: ScalarTypeEnum.JSONObject(), isOptional: true },\n },\n});\n\n/**\n * Individual step within a run.\n */\nexport const RunStepModel = defineSchemaModel({\n name: 'RunStep',\n description: 'Individual step within a run',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n stepNumber: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n type: { type: RunStepTypeEnum, isOptional: false },\n toolId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n toolName: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n input: { type: ScalarTypeEnum.JSONObject(), isOptional: true },\n output: { type: ScalarTypeEnum.JSONObject(), isOptional: true },\n status: { type: RunStatusEnum, isOptional: false },\n errorMessage: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n tokensUsed: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: false,\n defaultValue: 0,\n },\n durationMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n startedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n },\n});\n\n/**\n * Execution log entry.\n */\nexport const RunLogModel = defineSchemaModel({\n name: 'RunLog',\n description: 'Execution log entry',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n stepId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n level: { type: LogLevelEnum, isOptional: false },\n message: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n data: { type: ScalarTypeEnum.JSONObject(), isOptional: true },\n source: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n traceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n spanId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\n/**\n * Agent reference in a run.\n */\nexport const RunAgentRefModel = defineSchemaModel({\n name: 'RunAgentRef',\n description: 'Agent reference in a run',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n modelProvider: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n modelName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\n/**\n * Agent execution instance.\n */\nexport const RunModel = defineSchemaModel({\n name: 'Run',\n description: 'Agent execution instance',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n organizationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n sessionId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n input: { type: ScalarTypeEnum.JSONObject(), isOptional: false },\n output: { type: ScalarTypeEnum.JSONObject(), isOptional: true },\n status: { type: RunStatusEnum, isOptional: false },\n errorMessage: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n errorCode: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n totalTokens: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: false,\n defaultValue: 0,\n },\n promptTokens: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: false,\n defaultValue: 0,\n },\n completionTokens: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: false,\n defaultValue: 0,\n },\n totalIterations: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: false,\n defaultValue: 0,\n },\n durationMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n estimatedCostUsd: {\n type: ScalarTypeEnum.Float_unsecure(),\n isOptional: true,\n },\n queuedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n startedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n metadata: { type: ScalarTypeEnum.JSONObject(), isOptional: true },\n steps: { type: RunStepModel, isArray: true, isOptional: true },\n logs: { type: RunLogModel, isArray: true, isOptional: true },\n agent: { type: RunAgentRefModel, isOptional: true },\n },\n});\n\n/**\n * Summary of a run for list views.\n */\nexport const RunSummaryModel = defineSchemaModel({\n name: 'RunSummary',\n description: 'Summary of a run for list views',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n agentId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n agentName: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n status: { type: RunStatusEnum, isOptional: false },\n totalTokens: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n durationMs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n estimatedCostUsd: {\n type: ScalarTypeEnum.Float_unsecure(),\n isOptional: true,\n },\n queuedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n completedAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n },\n});\n\n/**\n * Timeline data point for metrics.\n */\nexport const TimelineDataPointModel = defineSchemaModel({\n name: 'TimelineDataPoint',\n description: 'Timeline data point for metrics',\n fields: {\n period: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n runs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n tokens: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n costUsd: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n avgDurationMs: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n },\n});\n"],"mappings":";;;;;;;AAMA,MAAa,gBAAgB,kBAAkB;CAC7C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,SAAS;GAAE,MAAM,eAAe,gBAAgB;GAAE,YAAY;GAAO;EACrE,SAAS;GAAE,MAAM,eAAe,YAAY;GAAE,YAAY;GAAM;EACjE;CACF,CAAC;;;;AAKF,MAAa,eAAe,kBAAkB;CAC5C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,YAAY;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAO;EACtE,MAAM;GAAE,MAAM;GAAiB,YAAY;GAAO;EAClD,QAAQ;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;G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F,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as _contractspec_lib_contracts31 from "@contractspec/lib.contracts";
|
|
2
|
+
|
|
3
|
+
//#region src/run/run.test-spec.d.ts
|
|
4
|
+
declare const runListTest: _contractspec_lib_contracts31.TestSpec;
|
|
5
|
+
declare const runGetTest: _contractspec_lib_contracts31.TestSpec;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { runGetTest, runListTest };
|
|
8
|
+
//# sourceMappingURL=run.test-spec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.test-spec.d.ts","names":[],"sources":["../../src/run/run.test-spec.ts"],"sourcesContent":[],"mappings":";;;cAEa,aAyBX,6BAAA,CAzBsB;cA2BX,YAyBX,6BAAA,CAzBqB"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { defineTestSpec } from "@contractspec/lib.contracts";
|
|
2
|
+
|
|
3
|
+
//#region src/run/run.test-spec.ts
|
|
4
|
+
const runListTest = defineTestSpec({
|
|
5
|
+
meta: {
|
|
6
|
+
key: "test.agent.run.list",
|
|
7
|
+
version: "1.0.0",
|
|
8
|
+
owners: ["@agent-console-team"],
|
|
9
|
+
description: "Test for listing runs",
|
|
10
|
+
stability: "stable",
|
|
11
|
+
tags: ["test"]
|
|
12
|
+
},
|
|
13
|
+
target: {
|
|
14
|
+
type: "operation",
|
|
15
|
+
operation: {
|
|
16
|
+
key: "agent.run.list",
|
|
17
|
+
version: "1.0.0"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
scenarios: [{
|
|
21
|
+
key: "success",
|
|
22
|
+
when: { operation: { key: "agent.run.list" } },
|
|
23
|
+
then: [{
|
|
24
|
+
type: "expectOutput",
|
|
25
|
+
match: {}
|
|
26
|
+
}]
|
|
27
|
+
}, {
|
|
28
|
+
key: "error",
|
|
29
|
+
when: { operation: { key: "agent.run.list" } },
|
|
30
|
+
then: [{ type: "expectError" }]
|
|
31
|
+
}]
|
|
32
|
+
});
|
|
33
|
+
const runGetTest = defineTestSpec({
|
|
34
|
+
meta: {
|
|
35
|
+
key: "test.agent.run.get",
|
|
36
|
+
version: "1.0.0",
|
|
37
|
+
owners: ["@agent-console-team"],
|
|
38
|
+
description: "Test for getting run",
|
|
39
|
+
stability: "stable",
|
|
40
|
+
tags: ["test"]
|
|
41
|
+
},
|
|
42
|
+
target: {
|
|
43
|
+
type: "operation",
|
|
44
|
+
operation: {
|
|
45
|
+
key: "agent.run.get",
|
|
46
|
+
version: "1.0.0"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
scenarios: [{
|
|
50
|
+
key: "success",
|
|
51
|
+
when: { operation: { key: "agent.run.get" } },
|
|
52
|
+
then: [{
|
|
53
|
+
type: "expectOutput",
|
|
54
|
+
match: {}
|
|
55
|
+
}]
|
|
56
|
+
}, {
|
|
57
|
+
key: "error",
|
|
58
|
+
when: { operation: { key: "agent.run.get" } },
|
|
59
|
+
then: [{ type: "expectError" }]
|
|
60
|
+
}]
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
//#endregion
|
|
64
|
+
export { runGetTest, runListTest };
|
|
65
|
+
//# sourceMappingURL=run.test-spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.test-spec.js","names":[],"sources":["../../src/run/run.test-spec.ts"],"sourcesContent":["import { defineTestSpec } from '@contractspec/lib.contracts';\n\nexport const runListTest = defineTestSpec({\n meta: {\n key: 'test.agent.run.list',\n version: '1.0.0',\n owners: ['@agent-console-team'],\n description: 'Test for listing runs',\n stability: 'stable',\n tags: ['test'],\n },\n target: {\n type: 'operation',\n operation: { key: 'agent.run.list', version: '1.0.0' },\n },\n scenarios: [\n {\n key: 'success',\n when: { operation: { key: 'agent.run.list' } },\n then: [{ type: 'expectOutput', match: {} }],\n },\n {\n key: 'error',\n when: { operation: { key: 'agent.run.list' } },\n then: [{ type: 'expectError' }],\n },\n ],\n});\n\nexport const runGetTest = defineTestSpec({\n meta: {\n key: 'test.agent.run.get',\n version: '1.0.0',\n owners: ['@agent-console-team'],\n description: 'Test for getting run',\n stability: 'stable',\n tags: ['test'],\n },\n target: {\n type: 'operation',\n operation: { key: 'agent.run.get', version: '1.0.0' },\n },\n scenarios: [\n {\n key: 'success',\n when: { operation: { key: 'agent.run.get' } },\n then: [{ type: 'expectOutput', match: {} }],\n },\n {\n key: 'error',\n when: { operation: { key: 'agent.run.get' } },\n then: [{ type: 'expectError' }],\n },\n ],\n});\n"],"mappings":";;;AAEA,MAAa,cAAc,eAAe;CACxC,MAAM;EACJ,KAAK;EACL,SAAS;EACT,QAAQ,CAAC,sBAAsB;EAC/B,aAAa;EACb,WAAW;EACX,MAAM,CAAC,OAAO;EACf;CACD,QAAQ;EACN,MAAM;EACN,WAAW;GAAE,KAAK;GAAkB,SAAS;GAAS;EACvD;CACD,WAAW,CACT;EACE,KAAK;EACL,MAAM,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE;EAC9C,MAAM,CAAC;GAAE,MAAM;GAAgB,OAAO,EAAE;GAAE,CAAC;EAC5C,EACD;EACE,KAAK;EACL,MAAM,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE;EAC9C,MAAM,CAAC,EAAE,MAAM,eAAe,CAAC;EAChC,CACF;CACF,CAAC;AAEF,MAAa,aAAa,eAAe;CACvC,MAAM;EACJ,KAAK;EACL,SAAS;EACT,QAAQ,CAAC,sBAAsB;EAC/B,aAAa;EACb,WAAW;EACX,MAAM,CAAC,OAAO;EACf;CACD,QAAQ;EACN,MAAM;EACN,WAAW;GAAE,KAAK;GAAiB,SAAS;GAAS;EACtD;CACD,WAAW,CACT;EACE,KAAK;EACL,MAAM,EAAE,WAAW,EAAE,KAAK,iBAAiB,EAAE;EAC7C,MAAM,CAAC;GAAE,MAAM;GAAgB,OAAO,EAAE;GAAE,CAAC;EAC5C,EACD;EACE,KAAK;EACL,MAAM,EAAE,WAAW,EAAE,KAAK,iBAAiB,EAAE;EAC7C,MAAM,CAAC,EAAE,MAAM,eAAe,CAAC;EAChC,CACF;CACF,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DatabasePort } from "@contractspec/lib.runtime-sandbox";
|
|
2
|
+
|
|
3
|
+
//#region src/seeders/index.d.ts
|
|
4
|
+
declare function seedAgentConsole(params: {
|
|
5
|
+
projectId: string;
|
|
6
|
+
db: DatabasePort;
|
|
7
|
+
}): Promise<void>;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { seedAgentConsole };
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/seeders/index.ts"],"sourcesContent":[],"mappings":";;;iBAEsB,gBAAA;;EAAA,EAAA,EAEhB,YAFgB;IAGrB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/seeders/index.ts
|
|
2
|
+
async function seedAgentConsole(params) {
|
|
3
|
+
const { projectId, db } = params;
|
|
4
|
+
if ((await db.query(`SELECT COUNT(*) as count FROM agent_definition WHERE "projectId" = $1`, [projectId])).rows[0]?.count > 0) return;
|
|
5
|
+
await db.execute(`INSERT INTO agent_definition (id, "projectId", "organizationId", name, description, "modelProvider", "modelName", status)
|
|
6
|
+
VALUES ($1, $2, $3, $4, $5, $6, $7, $8)`, [
|
|
7
|
+
"agent_1",
|
|
8
|
+
projectId,
|
|
9
|
+
"org_demo",
|
|
10
|
+
"Demo Agent",
|
|
11
|
+
"A demo AI agent",
|
|
12
|
+
"openai",
|
|
13
|
+
"gpt-4",
|
|
14
|
+
"ACTIVE"
|
|
15
|
+
]);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { seedAgentConsole };
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/seeders/index.ts"],"sourcesContent":["import type { DatabasePort } from '@contractspec/lib.runtime-sandbox';\n\nexport async function seedAgentConsole(params: {\n projectId: string;\n db: DatabasePort;\n}) {\n const { projectId, db } = params;\n\n const existing = await db.query(\n `SELECT COUNT(*) as count FROM agent_definition WHERE \"projectId\" = $1`,\n [projectId]\n );\n if ((existing.rows[0]?.count as number) > 0) return;\n\n await db.execute(\n `INSERT INTO agent_definition (id, \"projectId\", \"organizationId\", name, description, \"modelProvider\", \"modelName\", status)\n VALUES ($1, $2, $3, $4, $5, $6, $7, $8)`,\n [\n 'agent_1',\n projectId,\n 'org_demo',\n 'Demo Agent',\n 'A demo AI agent',\n 'openai',\n 'gpt-4',\n 'ACTIVE',\n ]\n );\n}\n"],"mappings":";AAEA,eAAsB,iBAAiB,QAGpC;CACD,MAAM,EAAE,WAAW,OAAO;AAM1B,MAJiB,MAAM,GAAG,MACxB,yEACA,CAAC,UAAU,CACZ,EACa,KAAK,IAAI,QAAmB,EAAG;AAE7C,OAAM,GAAG,QACP;+CAEA;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
//#region src/shared/mock-agents.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Mock agent data for testing and demos.
|
|
4
|
+
*/
|
|
5
|
+
declare const MOCK_AGENTS: ({
|
|
6
|
+
id: string;
|
|
7
|
+
organizationId: string;
|
|
8
|
+
name: string;
|
|
9
|
+
slug: string;
|
|
10
|
+
description: string;
|
|
11
|
+
status: "ACTIVE";
|
|
12
|
+
modelProvider: "OPENAI";
|
|
13
|
+
modelName: string;
|
|
14
|
+
modelConfig: {
|
|
15
|
+
temperature: number;
|
|
16
|
+
};
|
|
17
|
+
systemPrompt: string;
|
|
18
|
+
toolChoice: "auto";
|
|
19
|
+
maxIterations: number;
|
|
20
|
+
timeoutMs: number;
|
|
21
|
+
version: string;
|
|
22
|
+
tags: string[];
|
|
23
|
+
createdAt: Date;
|
|
24
|
+
updatedAt: Date;
|
|
25
|
+
} | {
|
|
26
|
+
id: string;
|
|
27
|
+
organizationId: string;
|
|
28
|
+
name: string;
|
|
29
|
+
slug: string;
|
|
30
|
+
description: string;
|
|
31
|
+
status: "ACTIVE";
|
|
32
|
+
modelProvider: "ANTHROPIC";
|
|
33
|
+
modelName: string;
|
|
34
|
+
modelConfig: {
|
|
35
|
+
temperature: number;
|
|
36
|
+
};
|
|
37
|
+
systemPrompt: string;
|
|
38
|
+
toolChoice: "auto";
|
|
39
|
+
maxIterations: number;
|
|
40
|
+
timeoutMs: number;
|
|
41
|
+
version: string;
|
|
42
|
+
tags: string[];
|
|
43
|
+
createdAt: Date;
|
|
44
|
+
updatedAt: Date;
|
|
45
|
+
} | {
|
|
46
|
+
id: string;
|
|
47
|
+
organizationId: string;
|
|
48
|
+
name: string;
|
|
49
|
+
slug: string;
|
|
50
|
+
description: string;
|
|
51
|
+
status: "PAUSED";
|
|
52
|
+
modelProvider: "OPENAI";
|
|
53
|
+
modelName: string;
|
|
54
|
+
modelConfig: {
|
|
55
|
+
temperature: number;
|
|
56
|
+
};
|
|
57
|
+
systemPrompt: string;
|
|
58
|
+
toolChoice: "required";
|
|
59
|
+
maxIterations: number;
|
|
60
|
+
timeoutMs: number;
|
|
61
|
+
version: string;
|
|
62
|
+
tags: string[];
|
|
63
|
+
createdAt: Date;
|
|
64
|
+
updatedAt: Date;
|
|
65
|
+
} | {
|
|
66
|
+
id: string;
|
|
67
|
+
organizationId: string;
|
|
68
|
+
name: string;
|
|
69
|
+
slug: string;
|
|
70
|
+
description: string;
|
|
71
|
+
status: "DRAFT";
|
|
72
|
+
modelProvider: "GOOGLE";
|
|
73
|
+
modelName: string;
|
|
74
|
+
modelConfig: {
|
|
75
|
+
temperature: number;
|
|
76
|
+
};
|
|
77
|
+
systemPrompt: string;
|
|
78
|
+
toolChoice: "auto";
|
|
79
|
+
maxIterations: number;
|
|
80
|
+
timeoutMs: number;
|
|
81
|
+
version: string;
|
|
82
|
+
tags: string[];
|
|
83
|
+
createdAt: Date;
|
|
84
|
+
updatedAt: Date;
|
|
85
|
+
})[];
|
|
86
|
+
//#endregion
|
|
87
|
+
export { MOCK_AGENTS };
|
|
88
|
+
//# sourceMappingURL=mock-agents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-agents.d.ts","names":[],"sources":["../../src/shared/mock-agents.ts"],"sourcesContent":[],"mappings":";;AAGA;;cAAa"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
//#region src/shared/mock-agents.ts
|
|
2
|
+
/**
|
|
3
|
+
* Mock agent data for testing and demos.
|
|
4
|
+
*/
|
|
5
|
+
const MOCK_AGENTS = [
|
|
6
|
+
{
|
|
7
|
+
id: "agent-1",
|
|
8
|
+
organizationId: "demo-org",
|
|
9
|
+
name: "Customer Support Bot",
|
|
10
|
+
slug: "customer-support-bot",
|
|
11
|
+
description: "Handles tier-1 customer inquiries and routes complex issues.",
|
|
12
|
+
status: "ACTIVE",
|
|
13
|
+
modelProvider: "OPENAI",
|
|
14
|
+
modelName: "gpt-4o-mini",
|
|
15
|
+
modelConfig: { temperature: .7 },
|
|
16
|
+
systemPrompt: "You are a helpful customer support assistant.",
|
|
17
|
+
toolChoice: "auto",
|
|
18
|
+
maxIterations: 10,
|
|
19
|
+
timeoutMs: 12e4,
|
|
20
|
+
version: "1.0.0",
|
|
21
|
+
tags: ["support", "tier-1"],
|
|
22
|
+
createdAt: /* @__PURE__ */ new Date("2024-01-15T10:00:00Z"),
|
|
23
|
+
updatedAt: /* @__PURE__ */ new Date("2024-03-20T14:30:00Z")
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
id: "agent-2",
|
|
27
|
+
organizationId: "demo-org",
|
|
28
|
+
name: "Code Review Assistant",
|
|
29
|
+
slug: "code-review-assistant",
|
|
30
|
+
description: "Reviews pull requests and provides actionable feedback.",
|
|
31
|
+
status: "ACTIVE",
|
|
32
|
+
modelProvider: "ANTHROPIC",
|
|
33
|
+
modelName: "claude-sonnet-4-20250514",
|
|
34
|
+
modelConfig: { temperature: .3 },
|
|
35
|
+
systemPrompt: "You are a code review expert.",
|
|
36
|
+
toolChoice: "auto",
|
|
37
|
+
maxIterations: 15,
|
|
38
|
+
timeoutMs: 18e4,
|
|
39
|
+
version: "2.1.0",
|
|
40
|
+
tags: [
|
|
41
|
+
"code",
|
|
42
|
+
"review",
|
|
43
|
+
"dev"
|
|
44
|
+
],
|
|
45
|
+
createdAt: /* @__PURE__ */ new Date("2024-02-10T09:00:00Z"),
|
|
46
|
+
updatedAt: /* @__PURE__ */ new Date("2024-04-05T11:15:00Z")
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: "agent-3",
|
|
50
|
+
organizationId: "demo-org",
|
|
51
|
+
name: "Data Analyst",
|
|
52
|
+
slug: "data-analyst",
|
|
53
|
+
description: "Queries databases and generates insights from data.",
|
|
54
|
+
status: "PAUSED",
|
|
55
|
+
modelProvider: "OPENAI",
|
|
56
|
+
modelName: "gpt-4o",
|
|
57
|
+
modelConfig: { temperature: .5 },
|
|
58
|
+
systemPrompt: "You are a data analyst expert in SQL and analytics.",
|
|
59
|
+
toolChoice: "required",
|
|
60
|
+
maxIterations: 20,
|
|
61
|
+
timeoutMs: 3e5,
|
|
62
|
+
version: "1.2.0",
|
|
63
|
+
tags: [
|
|
64
|
+
"data",
|
|
65
|
+
"analytics",
|
|
66
|
+
"sql"
|
|
67
|
+
],
|
|
68
|
+
createdAt: /* @__PURE__ */ new Date("2024-03-01T08:00:00Z"),
|
|
69
|
+
updatedAt: /* @__PURE__ */ new Date("2024-04-10T16:45:00Z")
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: "agent-4",
|
|
73
|
+
organizationId: "demo-org",
|
|
74
|
+
name: "Meeting Scheduler",
|
|
75
|
+
slug: "meeting-scheduler",
|
|
76
|
+
description: "Schedules meetings and manages calendar conflicts.",
|
|
77
|
+
status: "DRAFT",
|
|
78
|
+
modelProvider: "GOOGLE",
|
|
79
|
+
modelName: "gemini-2.0-flash",
|
|
80
|
+
modelConfig: { temperature: .2 },
|
|
81
|
+
systemPrompt: "You help schedule and organize meetings efficiently.",
|
|
82
|
+
toolChoice: "auto",
|
|
83
|
+
maxIterations: 5,
|
|
84
|
+
timeoutMs: 6e4,
|
|
85
|
+
version: "0.1.0",
|
|
86
|
+
tags: ["calendar", "scheduling"],
|
|
87
|
+
createdAt: /* @__PURE__ */ new Date("2024-04-01T12:00:00Z"),
|
|
88
|
+
updatedAt: /* @__PURE__ */ new Date("2024-04-01T12:00:00Z")
|
|
89
|
+
}
|
|
90
|
+
];
|
|
91
|
+
|
|
92
|
+
//#endregion
|
|
93
|
+
export { MOCK_AGENTS };
|
|
94
|
+
//# sourceMappingURL=mock-agents.js.map
|