@contractspec/example.agent-console 3.8.9 → 3.8.11
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 +30 -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 +26 -10
- package/src/ui/ExecutionConsoleHost.test.tsx +110 -0
- package/src/ui/ExecutionConsoleHost.tsx +14 -0
- package/src/ui/index.ts +1 -1
|
@@ -1,218 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
defineVisualization,
|
|
5
|
-
VisualizationRegistry
|
|
6
|
-
} from "@contractspec/lib.contracts-spec/visualizations";
|
|
7
|
-
var RUN_LIST_REF = { key: "agent.run.list", version: "1.0.0" };
|
|
8
|
-
var META = {
|
|
9
|
-
version: "1.0.0",
|
|
10
|
-
domain: "ai-ops",
|
|
11
|
-
stability: "experimental",
|
|
12
|
-
owners: ["@example.agent-console"],
|
|
13
|
-
tags: ["agent-console", "visualization", "operations"]
|
|
14
|
-
};
|
|
15
|
-
var AgentRunStatusVisualization = defineVisualization({
|
|
16
|
-
meta: {
|
|
17
|
-
...META,
|
|
18
|
-
key: "agent-console.visualization.run-status",
|
|
19
|
-
title: "Run Status Breakdown",
|
|
20
|
-
description: "Distribution of run outcomes across the current sample.",
|
|
21
|
-
goal: "Make operational success and failure mix visible at a glance.",
|
|
22
|
-
context: "Agent operations overview."
|
|
23
|
-
},
|
|
24
|
-
source: { primary: RUN_LIST_REF, resultPath: "data" },
|
|
25
|
-
visualization: {
|
|
26
|
-
kind: "pie",
|
|
27
|
-
nameDimension: "status",
|
|
28
|
-
valueMeasure: "runs",
|
|
29
|
-
dimensions: [
|
|
30
|
-
{ key: "status", label: "Status", dataPath: "status", type: "category" }
|
|
31
|
-
],
|
|
32
|
-
measures: [
|
|
33
|
-
{ key: "runs", label: "Runs", dataPath: "runs", format: "number" }
|
|
34
|
-
],
|
|
35
|
-
table: { caption: "Run counts by status." }
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
var AgentRunActivityVisualization = defineVisualization({
|
|
39
|
-
meta: {
|
|
40
|
-
...META,
|
|
41
|
-
key: "agent-console.visualization.run-activity",
|
|
42
|
-
title: "Recent Run Activity",
|
|
43
|
-
description: "Daily run volume across the current sample.",
|
|
44
|
-
goal: "Show whether agent activity is rising or slowing down.",
|
|
45
|
-
context: "Operations trend monitoring."
|
|
46
|
-
},
|
|
47
|
-
source: { primary: RUN_LIST_REF, resultPath: "data" },
|
|
48
|
-
visualization: {
|
|
49
|
-
kind: "cartesian",
|
|
50
|
-
variant: "line",
|
|
51
|
-
xDimension: "day",
|
|
52
|
-
yMeasures: ["runs"],
|
|
53
|
-
dimensions: [{ key: "day", label: "Day", dataPath: "day", type: "time" }],
|
|
54
|
-
measures: [
|
|
55
|
-
{
|
|
56
|
-
key: "runs",
|
|
57
|
-
label: "Runs",
|
|
58
|
-
dataPath: "runs",
|
|
59
|
-
format: "number",
|
|
60
|
-
color: "#0f766e"
|
|
61
|
-
}
|
|
62
|
-
],
|
|
63
|
-
table: { caption: "Daily run counts." }
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
var AgentRunEfficiencyVisualization = defineVisualization({
|
|
67
|
-
meta: {
|
|
68
|
-
...META,
|
|
69
|
-
key: "agent-console.visualization.run-efficiency",
|
|
70
|
-
title: "Duration vs Tokens",
|
|
71
|
-
description: "Scatter chart comparing token consumption and runtime.",
|
|
72
|
-
goal: "Reveal outlier runs that are slow relative to their token usage.",
|
|
73
|
-
context: "Operational performance diagnostics."
|
|
74
|
-
},
|
|
75
|
-
source: { primary: RUN_LIST_REF, resultPath: "data" },
|
|
76
|
-
visualization: {
|
|
77
|
-
kind: "cartesian",
|
|
78
|
-
variant: "scatter",
|
|
79
|
-
xDimension: "totalTokens",
|
|
80
|
-
yMeasures: ["durationMs"],
|
|
81
|
-
dimensions: [
|
|
82
|
-
{
|
|
83
|
-
key: "totalTokens",
|
|
84
|
-
label: "Total Tokens",
|
|
85
|
-
dataPath: "totalTokens",
|
|
86
|
-
type: "number"
|
|
87
|
-
}
|
|
88
|
-
],
|
|
89
|
-
measures: [
|
|
90
|
-
{
|
|
91
|
-
key: "durationMs",
|
|
92
|
-
label: "Duration",
|
|
93
|
-
dataPath: "durationMs",
|
|
94
|
-
format: "duration",
|
|
95
|
-
color: "#7c3aed"
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
key: "estimatedCostUsd",
|
|
99
|
-
label: "Cost",
|
|
100
|
-
dataPath: "estimatedCostUsd",
|
|
101
|
-
format: "currency"
|
|
102
|
-
}
|
|
103
|
-
],
|
|
104
|
-
series: [
|
|
105
|
-
{
|
|
106
|
-
key: "runs",
|
|
107
|
-
label: "Runs",
|
|
108
|
-
measure: "durationMs",
|
|
109
|
-
type: "scatter",
|
|
110
|
-
color: "#7c3aed"
|
|
111
|
-
}
|
|
112
|
-
],
|
|
113
|
-
table: { caption: "Run duration versus token usage." }
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
var AgentVisualizationSpecs = [
|
|
117
|
-
AgentRunStatusVisualization,
|
|
118
|
-
AgentRunActivityVisualization,
|
|
119
|
-
AgentRunEfficiencyVisualization
|
|
120
|
-
];
|
|
121
|
-
var AgentVisualizationRegistry = new VisualizationRegistry([
|
|
122
|
-
...AgentVisualizationSpecs
|
|
123
|
-
]);
|
|
124
|
-
var AgentVisualizationRefs = AgentVisualizationSpecs.map((spec) => ({
|
|
125
|
-
key: spec.meta.key,
|
|
126
|
-
version: spec.meta.version
|
|
127
|
-
}));
|
|
128
|
-
|
|
129
|
-
// src/visualizations/selectors.ts
|
|
130
|
-
function dayKey(value) {
|
|
131
|
-
if (!value)
|
|
132
|
-
return "unknown";
|
|
133
|
-
return value.toISOString().slice(0, 10);
|
|
134
|
-
}
|
|
135
|
-
function createAgentVisualizationItems(runs) {
|
|
136
|
-
const statusCounts = new Map;
|
|
137
|
-
const activityCounts = new Map;
|
|
138
|
-
for (const run of runs) {
|
|
139
|
-
statusCounts.set(run.status, (statusCounts.get(run.status) ?? 0) + 1);
|
|
140
|
-
activityCounts.set(dayKey(run.startedAt ?? run.queuedAt), (activityCounts.get(dayKey(run.startedAt ?? run.queuedAt)) ?? 0) + 1);
|
|
141
|
-
}
|
|
142
|
-
return [
|
|
143
|
-
{
|
|
144
|
-
key: "run-status",
|
|
145
|
-
spec: AgentRunStatusVisualization,
|
|
146
|
-
data: {
|
|
147
|
-
data: Array.from(statusCounts.entries()).map(([status, count]) => ({
|
|
148
|
-
status,
|
|
149
|
-
runs: count
|
|
150
|
-
}))
|
|
151
|
-
},
|
|
152
|
-
title: "Run Status Breakdown",
|
|
153
|
-
description: "Completed, failed, running, and cancelled runs in the sample.",
|
|
154
|
-
height: 260
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
key: "run-activity",
|
|
158
|
-
spec: AgentRunActivityVisualization,
|
|
159
|
-
data: {
|
|
160
|
-
data: Array.from(activityCounts.entries()).sort(([left], [right]) => left.localeCompare(right)).map(([day, count]) => ({ day, runs: count }))
|
|
161
|
-
},
|
|
162
|
-
title: "Recent Run Activity",
|
|
163
|
-
description: "Daily run volume derived from run start times."
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
key: "run-efficiency",
|
|
167
|
-
spec: AgentRunEfficiencyVisualization,
|
|
168
|
-
data: {
|
|
169
|
-
data: runs.filter((run) => typeof run.durationMs === "number").map((run) => ({
|
|
170
|
-
totalTokens: run.totalTokens,
|
|
171
|
-
durationMs: run.durationMs ?? 0,
|
|
172
|
-
estimatedCostUsd: run.estimatedCostUsd
|
|
173
|
-
}))
|
|
174
|
-
},
|
|
175
|
-
title: "Duration vs Tokens",
|
|
176
|
-
description: "Operational scatter plot for spotting inefficient runs."
|
|
177
|
-
}
|
|
178
|
-
];
|
|
179
|
-
}
|
|
180
|
-
// src/ui/AgentDashboard.visualizations.tsx
|
|
181
|
-
import {
|
|
182
|
-
VisualizationCard,
|
|
183
|
-
VisualizationGrid
|
|
184
|
-
} from "@contractspec/lib.design-system";
|
|
185
|
-
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
186
|
-
"use client";
|
|
187
|
-
function AgentVisualizationOverview({ runs }) {
|
|
188
|
-
const items = createAgentVisualizationItems(runs);
|
|
189
|
-
return /* @__PURE__ */ jsxDEV("section", {
|
|
190
|
-
className: "space-y-3",
|
|
191
|
-
children: [
|
|
192
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
193
|
-
children: [
|
|
194
|
-
/* @__PURE__ */ jsxDEV("h3", {
|
|
195
|
-
className: "font-semibold text-lg",
|
|
196
|
-
children: "Operational Visualizations"
|
|
197
|
-
}, undefined, false, undefined, this),
|
|
198
|
-
/* @__PURE__ */ jsxDEV("p", {
|
|
199
|
-
className: "text-muted-foreground text-sm",
|
|
200
|
-
children: "Contract-backed charts derived from recent run activity."
|
|
201
|
-
}, undefined, false, undefined, this)
|
|
202
|
-
]
|
|
203
|
-
}, undefined, true, undefined, this),
|
|
204
|
-
/* @__PURE__ */ jsxDEV(VisualizationGrid, {
|
|
205
|
-
children: items.map((item) => /* @__PURE__ */ jsxDEV(VisualizationCard, {
|
|
206
|
-
data: item.data,
|
|
207
|
-
description: item.description,
|
|
208
|
-
height: item.height,
|
|
209
|
-
spec: item.spec,
|
|
210
|
-
title: item.title
|
|
211
|
-
}, item.key, false, undefined, this))
|
|
212
|
-
}, undefined, false, undefined, this)
|
|
213
|
-
]
|
|
214
|
-
}, undefined, true, undefined, this);
|
|
215
|
-
}
|
|
216
|
-
export {
|
|
217
|
-
AgentVisualizationOverview
|
|
218
|
-
};
|
|
2
|
+
import{defineVisualization as a,VisualizationRegistry as g}from"@contractspec/lib.contracts-spec/visualizations";var s={key:"agent.run.list",version:"1.0.0"},u={version:"1.0.0",domain:"ai-ops",stability:"experimental",owners:["@example.agent-console"],tags:["agent-console","visualization","operations"]},d=a({meta:{...u,key:"agent-console.visualization.run-status",title:"Run Status Breakdown",description:"Distribution of run outcomes across the current sample.",goal:"Make operational success and failure mix visible at a glance.",context:"Agent operations overview."},source:{primary:s,resultPath:"data"},visualization:{kind:"pie",nameDimension:"status",valueMeasure:"runs",dimensions:[{key:"status",label:"Status",dataPath:"status",type:"category"}],measures:[{key:"runs",label:"Runs",dataPath:"runs",format:"number"}],table:{caption:"Run counts by status."}}}),m=a({meta:{...u,key:"agent-console.visualization.run-activity",title:"Recent Run Activity",description:"Daily run volume across the current sample.",goal:"Show whether agent activity is rising or slowing down.",context:"Operations trend monitoring."},source:{primary:s,resultPath:"data"},visualization:{kind:"cartesian",variant:"line",xDimension:"day",yMeasures:["runs"],dimensions:[{key:"day",label:"Day",dataPath:"day",type:"time"}],measures:[{key:"runs",label:"Runs",dataPath:"runs",format:"number",color:"#0f766e"}],table:{caption:"Daily run counts."}}}),c=a({meta:{...u,key:"agent-console.visualization.run-efficiency",title:"Duration vs Tokens",description:"Scatter chart comparing token consumption and runtime.",goal:"Reveal outlier runs that are slow relative to their token usage.",context:"Operational performance diagnostics."},source:{primary:s,resultPath:"data"},visualization:{kind:"cartesian",variant:"scatter",xDimension:"totalTokens",yMeasures:["durationMs"],dimensions:[{key:"totalTokens",label:"Total Tokens",dataPath:"totalTokens",type:"number"}],measures:[{key:"durationMs",label:"Duration",dataPath:"durationMs",format:"duration",color:"#7c3aed"},{key:"estimatedCostUsd",label:"Cost",dataPath:"estimatedCostUsd",format:"currency"}],series:[{key:"runs",label:"Runs",measure:"durationMs",type:"scatter",color:"#7c3aed"}],table:{caption:"Run duration versus token usage."}}}),p=[d,m,c],C=new g([...p]),b=p.map((e)=>({key:e.meta.key,version:e.meta.version}));function f(e){if(!e)return"unknown";return e.toISOString().slice(0,10)}function l(e){let n=new Map,r=new Map;for(let t of e)n.set(t.status,(n.get(t.status)??0)+1),r.set(f(t.startedAt??t.queuedAt),(r.get(f(t.startedAt??t.queuedAt))??0)+1);return[{key:"run-status",spec:d,data:{data:Array.from(n.entries()).map(([t,i])=>({status:t,runs:i}))},title:"Run Status Breakdown",description:"Completed, failed, running, and cancelled runs in the sample.",height:260},{key:"run-activity",spec:m,data:{data:Array.from(r.entries()).sort(([t],[i])=>t.localeCompare(i)).map(([t,i])=>({day:t,runs:i}))},title:"Recent Run Activity",description:"Daily run volume derived from run start times."},{key:"run-efficiency",spec:c,data:{data:e.filter((t)=>typeof t.durationMs==="number").map((t)=>({totalTokens:t.totalTokens,durationMs:t.durationMs??0,estimatedCostUsd:t.estimatedCostUsd}))},title:"Duration vs Tokens",description:"Operational scatter plot for spotting inefficient runs."}]}import{VisualizationCard as k,VisualizationGrid as h}from"@contractspec/lib.design-system";import{jsx as o,jsxs as y}from"react/jsx-runtime";function I({runs:e}){let n=l(e);return y("section",{className:"space-y-3",children:[y("div",{children:[o("h3",{className:"font-semibold text-lg",children:"Operational Visualizations"}),o("p",{className:"text-muted-foreground text-sm",children:"Contract-backed charts derived from recent run activity."})]}),o(h,{children:n.map((r)=>o(k,{data:r.data,description:r.description,height:r.height,spec:r.spec,title:r.title},r.key))})]})}export{I as AgentVisualizationOverview};
|