@contractspec/example.agent-console 3.8.8 → 3.8.10
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 +225 -222
- package/CHANGELOG.md +34 -0
- package/dist/agent/agent.entity.js +1 -127
- package/dist/agent/agent.enum.js +1 -25
- package/dist/agent/agent.event.js +1 -116
- package/dist/agent/agent.handler.js +1 -1030
- package/dist/agent/agent.operation.js +1 -735
- package/dist/agent/agent.presentation.js +1 -282
- package/dist/agent/agent.schema.js +1 -215
- package/dist/agent/agent.test-spec.js +1 -58
- package/dist/agent/index.js +1 -1248
- package/dist/agent.capability.js +1 -19
- package/dist/agent.feature.js +1 -305
- package/dist/browser/agent/agent.entity.js +1 -127
- package/dist/browser/agent/agent.enum.js +1 -25
- package/dist/browser/agent/agent.event.js +1 -116
- package/dist/browser/agent/agent.handler.js +1 -1030
- package/dist/browser/agent/agent.operation.js +1 -735
- package/dist/browser/agent/agent.presentation.js +1 -282
- package/dist/browser/agent/agent.schema.js +1 -215
- package/dist/browser/agent/agent.test-spec.js +1 -58
- package/dist/browser/agent/index.js +1 -1248
- package/dist/browser/agent.capability.js +1 -19
- package/dist/browser/agent.feature.js +1 -305
- package/dist/browser/docs/agent-console.docblock.js +5 -49
- package/dist/browser/docs/index.js +5 -49
- package/dist/browser/example.js +1 -41
- package/dist/browser/handlers/agent.handlers.js +6 -2143
- package/dist/browser/handlers/index.js +6 -2943
- package/dist/browser/index.js +14 -6828
- package/dist/browser/presentations/index.js +1 -693
- package/dist/browser/run/index.js +1 -1363
- package/dist/browser/run/run.entity.js +1 -160
- package/dist/browser/run/run.enum.js +1 -34
- package/dist/browser/run/run.event.js +1 -217
- package/dist/browser/run/run.handler.js +1 -919
- package/dist/browser/run/run.operation.js +1 -667
- package/dist/browser/run/run.presentation.js +1 -223
- package/dist/browser/run/run.schema.js +1 -179
- package/dist/browser/run/run.test-spec.js +1 -58
- package/dist/browser/seeders/index.js +2 -21
- package/dist/browser/shared/index.js +1 -626
- package/dist/browser/shared/mock-agents.js +1 -82
- package/dist/browser/shared/mock-runs.js +1 -113
- package/dist/browser/shared/mock-tools.js +1 -146
- package/dist/browser/tool/index.js +1 -949
- package/dist/browser/tool/tool.entity.js +1 -90
- package/dist/browser/tool/tool.enum.js +1 -26
- package/dist/browser/tool/tool.event.js +1 -99
- package/dist/browser/tool/tool.handler.js +1 -699
- package/dist/browser/tool/tool.operation.js +1 -482
- package/dist/browser/tool/tool.presentation.js +1 -188
- package/dist/browser/tool/tool.schema.js +1 -141
- package/dist/browser/tool/tool.test-spec.js +1 -58
- package/dist/browser/ui/AgentDashboard.js +1 -2527
- package/dist/browser/ui/AgentDashboard.visualizations.js +1 -217
- package/dist/browser/ui/AgentRunList.js +1 -482
- package/dist/browser/ui/AgentToolRegistry.js +1 -212
- package/dist/browser/ui/ExecutionConsoleHost.js +1 -0
- package/dist/browser/ui/hooks/index.js +1 -740
- package/dist/browser/ui/hooks/useAgentList.js +1 -55
- package/dist/browser/ui/hooks/useAgentMutations.js +1 -530
- package/dist/browser/ui/hooks/useRunList.js +1 -70
- package/dist/browser/ui/hooks/useToolList.js +1 -85
- package/dist/browser/ui/index.js +5 -3018
- package/dist/browser/ui/modals/AgentActionsModal.js +1 -304
- package/dist/browser/ui/modals/CreateAgentModal.js +1 -243
- package/dist/browser/ui/modals/index.js +1 -546
- package/dist/browser/ui/overlays/demo-overlays.js +1 -64
- package/dist/browser/ui/overlays/index.js +1 -64
- package/dist/browser/ui/renderers/agent-list.markdown.js +2 -64
- package/dist/browser/ui/renderers/agent-list.renderer.js +1 -180
- package/dist/browser/ui/renderers/dashboard.markdown.js +2 -288
- package/dist/browser/ui/renderers/index.js +5 -642
- package/dist/browser/ui/renderers/run-list.markdown.js +2 -50
- package/dist/browser/ui/renderers/tool-registry.markdown.js +2 -64
- package/dist/browser/ui/views/AgentListView.js +1 -165
- package/dist/browser/ui/views/RunDataTable.js +1 -326
- package/dist/browser/ui/views/RunListView.js +1 -479
- package/dist/browser/ui/views/ToolRegistryView.js +1 -209
- package/dist/browser/ui/views/index.js +1 -851
- package/dist/browser/ui/views/run-data-table.columns.js +1 -271
- package/dist/browser/ui/views/run-list.shared.js +1 -177
- package/dist/browser/visualizations/catalog.js +1 -134
- package/dist/browser/visualizations/index.js +1 -187
- package/dist/browser/visualizations/selectors.js +1 -181
- package/dist/docs/agent-console.docblock.js +5 -49
- package/dist/docs/index.js +5 -49
- package/dist/example.js +1 -41
- package/dist/handlers/agent.handlers.js +6 -2143
- package/dist/handlers/index.js +6 -2943
- package/dist/index.js +14 -6828
- package/dist/node/agent/agent.entity.js +1 -127
- package/dist/node/agent/agent.enum.js +1 -25
- package/dist/node/agent/agent.event.js +1 -116
- package/dist/node/agent/agent.handler.js +1 -1030
- package/dist/node/agent/agent.operation.js +1 -735
- package/dist/node/agent/agent.presentation.js +1 -282
- package/dist/node/agent/agent.schema.js +1 -215
- package/dist/node/agent/agent.test-spec.js +1 -58
- package/dist/node/agent/index.js +1 -1248
- package/dist/node/agent.capability.js +1 -19
- package/dist/node/agent.feature.js +1 -305
- package/dist/node/docs/agent-console.docblock.js +5 -49
- package/dist/node/docs/index.js +5 -49
- package/dist/node/example.js +1 -41
- package/dist/node/handlers/agent.handlers.js +6 -2143
- package/dist/node/handlers/index.js +6 -2943
- package/dist/node/index.js +14 -6828
- package/dist/node/presentations/index.js +1 -693
- package/dist/node/run/index.js +1 -1363
- package/dist/node/run/run.entity.js +1 -160
- package/dist/node/run/run.enum.js +1 -34
- package/dist/node/run/run.event.js +1 -217
- package/dist/node/run/run.handler.js +1 -919
- package/dist/node/run/run.operation.js +1 -667
- package/dist/node/run/run.presentation.js +1 -223
- package/dist/node/run/run.schema.js +1 -179
- package/dist/node/run/run.test-spec.js +1 -58
- package/dist/node/seeders/index.js +2 -21
- package/dist/node/shared/index.js +1 -626
- package/dist/node/shared/mock-agents.js +1 -82
- package/dist/node/shared/mock-runs.js +1 -113
- package/dist/node/shared/mock-tools.js +1 -146
- package/dist/node/tool/index.js +1 -949
- package/dist/node/tool/tool.entity.js +1 -90
- package/dist/node/tool/tool.enum.js +1 -26
- package/dist/node/tool/tool.event.js +1 -99
- package/dist/node/tool/tool.handler.js +1 -699
- package/dist/node/tool/tool.operation.js +1 -482
- package/dist/node/tool/tool.presentation.js +1 -188
- package/dist/node/tool/tool.schema.js +1 -141
- package/dist/node/tool/tool.test-spec.js +1 -58
- package/dist/node/ui/AgentDashboard.js +1 -2527
- package/dist/node/ui/AgentDashboard.visualizations.js +1 -217
- package/dist/node/ui/AgentRunList.js +1 -482
- package/dist/node/ui/AgentToolRegistry.js +1 -212
- package/dist/node/ui/ExecutionConsoleHost.js +1 -0
- package/dist/node/ui/hooks/index.js +1 -740
- package/dist/node/ui/hooks/useAgentList.js +1 -55
- package/dist/node/ui/hooks/useAgentMutations.js +1 -530
- package/dist/node/ui/hooks/useRunList.js +1 -70
- package/dist/node/ui/hooks/useToolList.js +1 -85
- package/dist/node/ui/index.js +5 -3018
- package/dist/node/ui/modals/AgentActionsModal.js +1 -304
- package/dist/node/ui/modals/CreateAgentModal.js +1 -243
- package/dist/node/ui/modals/index.js +1 -546
- package/dist/node/ui/overlays/demo-overlays.js +1 -64
- package/dist/node/ui/overlays/index.js +1 -64
- package/dist/node/ui/renderers/agent-list.markdown.js +2 -64
- package/dist/node/ui/renderers/agent-list.renderer.js +1 -180
- package/dist/node/ui/renderers/dashboard.markdown.js +2 -288
- package/dist/node/ui/renderers/index.js +5 -642
- package/dist/node/ui/renderers/run-list.markdown.js +2 -50
- package/dist/node/ui/renderers/tool-registry.markdown.js +2 -64
- package/dist/node/ui/views/AgentListView.js +1 -165
- package/dist/node/ui/views/RunDataTable.js +1 -326
- package/dist/node/ui/views/RunListView.js +1 -479
- package/dist/node/ui/views/ToolRegistryView.js +1 -209
- package/dist/node/ui/views/index.js +1 -851
- package/dist/node/ui/views/run-data-table.columns.js +1 -271
- package/dist/node/ui/views/run-list.shared.js +1 -177
- package/dist/node/visualizations/catalog.js +1 -134
- package/dist/node/visualizations/index.js +1 -187
- package/dist/node/visualizations/selectors.js +1 -181
- package/dist/presentations/index.js +1 -693
- package/dist/run/index.js +1 -1363
- package/dist/run/run.entity.js +1 -160
- package/dist/run/run.enum.js +1 -34
- package/dist/run/run.event.js +1 -217
- package/dist/run/run.handler.js +1 -919
- package/dist/run/run.operation.js +1 -667
- package/dist/run/run.presentation.js +1 -223
- package/dist/run/run.schema.js +1 -179
- package/dist/run/run.test-spec.js +1 -58
- package/dist/seeders/index.js +2 -21
- package/dist/shared/index.js +1 -626
- package/dist/shared/mock-agents.js +1 -82
- package/dist/shared/mock-runs.js +1 -113
- package/dist/shared/mock-tools.js +1 -146
- package/dist/tool/index.js +1 -949
- package/dist/tool/tool.entity.js +1 -90
- package/dist/tool/tool.enum.js +1 -26
- package/dist/tool/tool.event.js +1 -99
- package/dist/tool/tool.handler.js +1 -699
- package/dist/tool/tool.operation.js +1 -482
- package/dist/tool/tool.presentation.js +1 -188
- package/dist/tool/tool.schema.js +1 -141
- package/dist/tool/tool.test-spec.js +1 -58
- package/dist/ui/AgentDashboard.js +1 -2527
- package/dist/ui/AgentDashboard.visualizations.js +1 -217
- package/dist/ui/AgentRunList.js +1 -482
- package/dist/ui/AgentToolRegistry.js +1 -212
- package/dist/ui/ExecutionConsoleHost.d.ts +1 -0
- package/dist/ui/ExecutionConsoleHost.js +2 -0
- package/dist/ui/ExecutionConsoleHost.test.d.ts +1 -0
- package/dist/ui/hooks/index.js +1 -740
- package/dist/ui/hooks/useAgentList.js +1 -55
- package/dist/ui/hooks/useAgentMutations.js +1 -530
- package/dist/ui/hooks/useRunList.js +1 -70
- package/dist/ui/hooks/useToolList.js +1 -85
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.js +5 -3018
- package/dist/ui/modals/AgentActionsModal.js +1 -304
- package/dist/ui/modals/CreateAgentModal.js +1 -243
- package/dist/ui/modals/index.js +1 -546
- package/dist/ui/overlays/demo-overlays.js +1 -64
- package/dist/ui/overlays/index.js +1 -64
- package/dist/ui/renderers/agent-list.markdown.js +2 -64
- package/dist/ui/renderers/agent-list.renderer.js +1 -180
- package/dist/ui/renderers/dashboard.markdown.js +2 -288
- package/dist/ui/renderers/index.js +5 -642
- package/dist/ui/renderers/run-list.markdown.js +2 -50
- package/dist/ui/renderers/tool-registry.markdown.js +2 -64
- package/dist/ui/views/AgentListView.js +1 -165
- package/dist/ui/views/RunDataTable.js +1 -326
- package/dist/ui/views/RunListView.js +1 -479
- package/dist/ui/views/ToolRegistryView.js +1 -209
- package/dist/ui/views/index.js +1 -851
- package/dist/ui/views/run-data-table.columns.js +1 -271
- package/dist/ui/views/run-list.shared.js +1 -177
- package/dist/visualizations/catalog.js +1 -134
- package/dist/visualizations/index.js +1 -187
- package/dist/visualizations/selectors.js +1 -181
- package/package.json +29 -13
- package/src/ui/ExecutionConsoleHost.test.tsx +110 -0
- package/src/ui/ExecutionConsoleHost.tsx +14 -0
- package/src/ui/index.ts +1 -1
|
@@ -1,223 +1 @@
|
|
|
1
|
-
|
|
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 {
|
|
174
|
-
definePresentation,
|
|
175
|
-
StabilityEnum
|
|
176
|
-
} from "@contractspec/lib.contracts-spec";
|
|
177
|
-
var RunListPresentation = definePresentation({
|
|
178
|
-
meta: {
|
|
179
|
-
key: "agent-console.run.list",
|
|
180
|
-
version: "1.0.0",
|
|
181
|
-
title: "Run List",
|
|
182
|
-
description: "List view of agent runs with status, tokens, and duration info",
|
|
183
|
-
goal: "Provide an overview of agent execution history and performance.",
|
|
184
|
-
context: "Run history dashboard.",
|
|
185
|
-
domain: "agent-console",
|
|
186
|
-
owners: ["@agent-console-team"],
|
|
187
|
-
tags: ["run", "list", "dashboard"],
|
|
188
|
-
stability: StabilityEnum.Experimental
|
|
189
|
-
},
|
|
190
|
-
source: {
|
|
191
|
-
type: "component",
|
|
192
|
-
framework: "react",
|
|
193
|
-
componentKey: "RunListView",
|
|
194
|
-
props: RunSummaryModel
|
|
195
|
-
},
|
|
196
|
-
targets: ["react", "markdown", "application/json"],
|
|
197
|
-
policy: { flags: ["agent-console.enabled"] }
|
|
198
|
-
});
|
|
199
|
-
var RunDetailPresentation = definePresentation({
|
|
200
|
-
meta: {
|
|
201
|
-
key: "agent-console.run.detail",
|
|
202
|
-
version: "1.0.0",
|
|
203
|
-
title: "Run Details",
|
|
204
|
-
description: "Detailed view of an agent run with steps, logs, and metrics",
|
|
205
|
-
goal: "Allow users to inspect and debug a specific agent run.",
|
|
206
|
-
context: "Detailed view of an agent run.",
|
|
207
|
-
domain: "agent-console",
|
|
208
|
-
owners: ["@agent-console-team"],
|
|
209
|
-
tags: ["run", "detail"],
|
|
210
|
-
stability: StabilityEnum.Experimental
|
|
211
|
-
},
|
|
212
|
-
source: {
|
|
213
|
-
type: "component",
|
|
214
|
-
framework: "react",
|
|
215
|
-
componentKey: "RunDetailView"
|
|
216
|
-
},
|
|
217
|
-
targets: ["react", "markdown"],
|
|
218
|
-
policy: { flags: ["agent-console.enabled"] }
|
|
219
|
-
});
|
|
220
|
-
export {
|
|
221
|
-
RunListPresentation,
|
|
222
|
-
RunDetailPresentation
|
|
223
|
-
};
|
|
1
|
+
import{defineEnum as q}from"@contractspec/lib.schema";var w=q("RunStatus",["QUEUED","IN_PROGRESS","COMPLETED","FAILED","CANCELLED","EXPIRED"]),x=q("RunStepType",["MESSAGE_CREATION","TOOL_CALL","TOOL_RESULT","ERROR"]),z=q("LogLevel",["DEBUG","INFO","WARN","ERROR"]),K=q("Granularity",["hour","day","week","month"]);import{defineSchemaModel as k,ScalarTypeEnum as j}from"@contractspec/lib.schema";var U=k({name:"RunInput",description:"Input data for agent execution",fields:{message:{type:j.NonEmptyString(),isOptional:!1},context:{type:j.JSONObject(),isOptional:!0}}}),F=k({name:"RunStep",description:"Individual step within a run",fields:{id:{type:j.String_unsecure(),isOptional:!1},stepNumber:{type:j.Int_unsecure(),isOptional:!1},type:{type:x,isOptional:!1},toolId:{type:j.String_unsecure(),isOptional:!0},toolName:{type:j.String_unsecure(),isOptional:!0},input:{type:j.JSONObject(),isOptional:!0},output:{type:j.JSONObject(),isOptional:!0},status:{type:w,isOptional:!1},errorMessage:{type:j.String_unsecure(),isOptional:!0},tokensUsed:{type:j.Int_unsecure(),isOptional:!1,defaultValue:0},durationMs:{type:j.Int_unsecure(),isOptional:!0},startedAt:{type:j.DateTime(),isOptional:!1},completedAt:{type:j.DateTime(),isOptional:!0}}}),H=k({name:"RunLog",description:"Execution log entry",fields:{id:{type:j.String_unsecure(),isOptional:!1},stepId:{type:j.String_unsecure(),isOptional:!0},level:{type:z,isOptional:!1},message:{type:j.String_unsecure(),isOptional:!1},data:{type:j.JSONObject(),isOptional:!0},source:{type:j.String_unsecure(),isOptional:!0},traceId:{type:j.String_unsecure(),isOptional:!0},spanId:{type:j.String_unsecure(),isOptional:!0},timestamp:{type:j.DateTime(),isOptional:!1}}}),I=k({name:"RunAgentRef",description:"Agent reference in a run",fields:{id:{type:j.String_unsecure(),isOptional:!1},name:{type:j.NonEmptyString(),isOptional:!1},modelProvider:{type:j.String_unsecure(),isOptional:!1},modelName:{type:j.String_unsecure(),isOptional:!1}}}),V=k({name:"Run",description:"Agent execution instance",fields:{id:{type:j.String_unsecure(),isOptional:!1},organizationId:{type:j.String_unsecure(),isOptional:!1},agentId:{type:j.String_unsecure(),isOptional:!1},userId:{type:j.String_unsecure(),isOptional:!0},sessionId:{type:j.String_unsecure(),isOptional:!0},input:{type:j.JSONObject(),isOptional:!1},output:{type:j.JSONObject(),isOptional:!0},status:{type:w,isOptional:!1},errorMessage:{type:j.String_unsecure(),isOptional:!0},errorCode:{type:j.String_unsecure(),isOptional:!0},totalTokens:{type:j.Int_unsecure(),isOptional:!1,defaultValue:0},promptTokens:{type:j.Int_unsecure(),isOptional:!1,defaultValue:0},completionTokens:{type:j.Int_unsecure(),isOptional:!1,defaultValue:0},totalIterations:{type:j.Int_unsecure(),isOptional:!1,defaultValue:0},durationMs:{type:j.Int_unsecure(),isOptional:!0},estimatedCostUsd:{type:j.Float_unsecure(),isOptional:!0},queuedAt:{type:j.DateTime(),isOptional:!1},startedAt:{type:j.DateTime(),isOptional:!0},completedAt:{type:j.DateTime(),isOptional:!0},metadata:{type:j.JSONObject(),isOptional:!0},steps:{type:F,isArray:!0,isOptional:!0},logs:{type:H,isArray:!0,isOptional:!0},agent:{type:I,isOptional:!0}}}),B=k({name:"RunSummary",description:"Summary of a run for list views",fields:{id:{type:j.String_unsecure(),isOptional:!1},agentId:{type:j.String_unsecure(),isOptional:!1},agentName:{type:j.NonEmptyString(),isOptional:!1},status:{type:w,isOptional:!1},totalTokens:{type:j.Int_unsecure(),isOptional:!1},durationMs:{type:j.Int_unsecure(),isOptional:!0},estimatedCostUsd:{type:j.Float_unsecure(),isOptional:!0},queuedAt:{type:j.DateTime(),isOptional:!1},completedAt:{type:j.DateTime(),isOptional:!0}}}),W=k({name:"TimelineDataPoint",description:"Timeline data point for metrics",fields:{period:{type:j.String_unsecure(),isOptional:!1},runs:{type:j.Int_unsecure(),isOptional:!1},tokens:{type:j.Int_unsecure(),isOptional:!1},costUsd:{type:j.Float_unsecure(),isOptional:!1},avgDurationMs:{type:j.Float_unsecure(),isOptional:!1}}});import{definePresentation as C,StabilityEnum as D}from"@contractspec/lib.contracts-spec";var _=C({meta:{key:"agent-console.run.list",version:"1.0.0",title:"Run List",description:"List view of agent runs with status, tokens, and duration info",goal:"Provide an overview of agent execution history and performance.",context:"Run history dashboard.",domain:"agent-console",owners:["@agent-console-team"],tags:["run","list","dashboard"],stability:D.Experimental},source:{type:"component",framework:"react",componentKey:"RunListView",props:B},targets:["react","markdown","application/json"],policy:{flags:["agent-console.enabled"]}}),$=C({meta:{key:"agent-console.run.detail",version:"1.0.0",title:"Run Details",description:"Detailed view of an agent run with steps, logs, and metrics",goal:"Allow users to inspect and debug a specific agent run.",context:"Detailed view of an agent run.",domain:"agent-console",owners:["@agent-console-team"],tags:["run","detail"],stability:D.Experimental},source:{type:"component",framework:"react",componentKey:"RunDetailView"},targets:["react","markdown"],policy:{flags:["agent-console.enabled"]}});export{_ as RunListPresentation,$ as RunDetailPresentation};
|
|
@@ -1,179 +1 @@
|
|
|
1
|
-
|
|
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
|
-
};
|
|
1
|
+
import{defineEnum as q}from"@contractspec/lib.schema";var w=q("RunStatus",["QUEUED","IN_PROGRESS","COMPLETED","FAILED","CANCELLED","EXPIRED"]),x=q("RunStepType",["MESSAGE_CREATION","TOOL_CALL","TOOL_RESULT","ERROR"]),z=q("LogLevel",["DEBUG","INFO","WARN","ERROR"]),H=q("Granularity",["hour","day","week","month"]);import{defineSchemaModel as k,ScalarTypeEnum as j}from"@contractspec/lib.schema";var N=k({name:"RunInput",description:"Input data for agent execution",fields:{message:{type:j.NonEmptyString(),isOptional:!1},context:{type:j.JSONObject(),isOptional:!0}}}),B=k({name:"RunStep",description:"Individual step within a run",fields:{id:{type:j.String_unsecure(),isOptional:!1},stepNumber:{type:j.Int_unsecure(),isOptional:!1},type:{type:x,isOptional:!1},toolId:{type:j.String_unsecure(),isOptional:!0},toolName:{type:j.String_unsecure(),isOptional:!0},input:{type:j.JSONObject(),isOptional:!0},output:{type:j.JSONObject(),isOptional:!0},status:{type:w,isOptional:!1},errorMessage:{type:j.String_unsecure(),isOptional:!0},tokensUsed:{type:j.Int_unsecure(),isOptional:!1,defaultValue:0},durationMs:{type:j.Int_unsecure(),isOptional:!0},startedAt:{type:j.DateTime(),isOptional:!1},completedAt:{type:j.DateTime(),isOptional:!0}}}),C=k({name:"RunLog",description:"Execution log entry",fields:{id:{type:j.String_unsecure(),isOptional:!1},stepId:{type:j.String_unsecure(),isOptional:!0},level:{type:z,isOptional:!1},message:{type:j.String_unsecure(),isOptional:!1},data:{type:j.JSONObject(),isOptional:!0},source:{type:j.String_unsecure(),isOptional:!0},traceId:{type:j.String_unsecure(),isOptional:!0},spanId:{type:j.String_unsecure(),isOptional:!0},timestamp:{type:j.DateTime(),isOptional:!1}}}),D=k({name:"RunAgentRef",description:"Agent reference in a run",fields:{id:{type:j.String_unsecure(),isOptional:!1},name:{type:j.NonEmptyString(),isOptional:!1},modelProvider:{type:j.String_unsecure(),isOptional:!1},modelName:{type:j.String_unsecure(),isOptional:!1}}}),O=k({name:"Run",description:"Agent execution instance",fields:{id:{type:j.String_unsecure(),isOptional:!1},organizationId:{type:j.String_unsecure(),isOptional:!1},agentId:{type:j.String_unsecure(),isOptional:!1},userId:{type:j.String_unsecure(),isOptional:!0},sessionId:{type:j.String_unsecure(),isOptional:!0},input:{type:j.JSONObject(),isOptional:!1},output:{type:j.JSONObject(),isOptional:!0},status:{type:w,isOptional:!1},errorMessage:{type:j.String_unsecure(),isOptional:!0},errorCode:{type:j.String_unsecure(),isOptional:!0},totalTokens:{type:j.Int_unsecure(),isOptional:!1,defaultValue:0},promptTokens:{type:j.Int_unsecure(),isOptional:!1,defaultValue:0},completionTokens:{type:j.Int_unsecure(),isOptional:!1,defaultValue:0},totalIterations:{type:j.Int_unsecure(),isOptional:!1,defaultValue:0},durationMs:{type:j.Int_unsecure(),isOptional:!0},estimatedCostUsd:{type:j.Float_unsecure(),isOptional:!0},queuedAt:{type:j.DateTime(),isOptional:!1},startedAt:{type:j.DateTime(),isOptional:!0},completedAt:{type:j.DateTime(),isOptional:!0},metadata:{type:j.JSONObject(),isOptional:!0},steps:{type:B,isArray:!0,isOptional:!0},logs:{type:C,isArray:!0,isOptional:!0},agent:{type:D,isOptional:!0}}}),P=k({name:"RunSummary",description:"Summary of a run for list views",fields:{id:{type:j.String_unsecure(),isOptional:!1},agentId:{type:j.String_unsecure(),isOptional:!1},agentName:{type:j.NonEmptyString(),isOptional:!1},status:{type:w,isOptional:!1},totalTokens:{type:j.Int_unsecure(),isOptional:!1},durationMs:{type:j.Int_unsecure(),isOptional:!0},estimatedCostUsd:{type:j.Float_unsecure(),isOptional:!0},queuedAt:{type:j.DateTime(),isOptional:!1},completedAt:{type:j.DateTime(),isOptional:!0}}}),Q=k({name:"TimelineDataPoint",description:"Timeline data point for metrics",fields:{period:{type:j.String_unsecure(),isOptional:!1},runs:{type:j.Int_unsecure(),isOptional:!1},tokens:{type:j.Int_unsecure(),isOptional:!1},costUsd:{type:j.Float_unsecure(),isOptional:!1},avgDurationMs:{type:j.Float_unsecure(),isOptional:!1}}});export{Q as TimelineDataPointModel,P as RunSummaryModel,B as RunStepModel,O as RunModel,C as RunLogModel,N as RunInputModel,D as RunAgentRefModel};
|
|
@@ -1,58 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { defineTestSpec } from "@contractspec/lib.contracts-spec/tests";
|
|
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
|
-
};
|
|
1
|
+
import{defineTestSpec as g}from"@contractspec/lib.contracts-spec/tests";var j=g({meta:{key:"test.agent.run.list",version:"1.0.0",owners:["@agent-console-team"],description:"Test for listing runs",stability:"stable",tags:["test"]},target:{type:"operation",operation:{key:"agent.run.list",version:"1.0.0"}},scenarios:[{key:"success",when:{operation:{key:"agent.run.list"}},then:[{type:"expectOutput",match:{}}]},{key:"error",when:{operation:{key:"agent.run.list"}},then:[{type:"expectError"}]}]}),k=g({meta:{key:"test.agent.run.get",version:"1.0.0",owners:["@agent-console-team"],description:"Test for getting run",stability:"stable",tags:["test"]},target:{type:"operation",operation:{key:"agent.run.get",version:"1.0.0"}},scenarios:[{key:"success",when:{operation:{key:"agent.run.get"}},then:[{type:"expectOutput",match:{}}]},{key:"error",when:{operation:{key:"agent.run.get"}},then:[{type:"expectError"}]}]});export{j as runListTest,k as runGetTest};
|
|
@@ -1,21 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
};
|
|
1
|
+
async function a(o){let{projectId:e,db:t}=o;if((await t.query('SELECT COUNT(*) as count FROM agent_definition WHERE "projectId" = $1',[e])).rows[0]?.count>0)return;await t.execute(`INSERT INTO agent_definition (id, "projectId", "organizationId", name, description, "modelProvider", "modelName", status)
|
|
2
|
+
VALUES ($1, $2, $3, $4, $5, $6, $7, $8)`,["agent_1",e,"org_demo","Demo Agent","A demo AI agent","openai","gpt-4","ACTIVE"])}export{a as seedAgentConsole};
|