@contractspec/example.agent-console 3.8.9 → 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 +18 -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,271 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { Button, StatusChip } from "@contractspec/lib.design-system";
|
|
3
|
-
import { HStack, VStack } from "@contractspec/lib.ui-kit-web/ui/stack";
|
|
4
|
-
import { Text } from "@contractspec/lib.ui-kit-web/ui/text";
|
|
5
|
-
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
6
|
-
"use client";
|
|
7
|
-
function getStatusTone(status) {
|
|
8
|
-
switch (status) {
|
|
9
|
-
case "COMPLETED":
|
|
10
|
-
return "success";
|
|
11
|
-
case "RUNNING":
|
|
12
|
-
return "warning";
|
|
13
|
-
case "QUEUED":
|
|
14
|
-
return "neutral";
|
|
15
|
-
case "FAILED":
|
|
16
|
-
case "CANCELLED":
|
|
17
|
-
return "danger";
|
|
18
|
-
default:
|
|
19
|
-
return "neutral";
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
function formatDuration(ms) {
|
|
23
|
-
if (!ms)
|
|
24
|
-
return "-";
|
|
25
|
-
if (ms < 1000)
|
|
26
|
-
return `${ms}ms`;
|
|
27
|
-
if (ms < 60000)
|
|
28
|
-
return `${(ms / 1000).toFixed(1)}s`;
|
|
29
|
-
return `${(ms / 60000).toFixed(1)}m`;
|
|
30
|
-
}
|
|
31
|
-
function formatTokens(tokens) {
|
|
32
|
-
if (tokens < 1000)
|
|
33
|
-
return tokens.toString();
|
|
34
|
-
if (tokens < 1e6)
|
|
35
|
-
return `${(tokens / 1000).toFixed(1)}K`;
|
|
36
|
-
return `${(tokens / 1e6).toFixed(2)}M`;
|
|
37
|
-
}
|
|
38
|
-
function formatCost(cost) {
|
|
39
|
-
if (!cost)
|
|
40
|
-
return "-";
|
|
41
|
-
return `$${cost.toFixed(4)}`;
|
|
42
|
-
}
|
|
43
|
-
function formatJson(value) {
|
|
44
|
-
return JSON.stringify(value ?? null, null, 2);
|
|
45
|
-
}
|
|
46
|
-
function RunExpandedContent({ run }) {
|
|
47
|
-
return /* @__PURE__ */ jsxDEV(VStack, {
|
|
48
|
-
gap: "sm",
|
|
49
|
-
className: "py-2",
|
|
50
|
-
children: [
|
|
51
|
-
/* @__PURE__ */ jsxDEV(HStack, {
|
|
52
|
-
justify: "between",
|
|
53
|
-
className: "flex-wrap",
|
|
54
|
-
children: [
|
|
55
|
-
/* @__PURE__ */ jsxDEV(StatusChip, {
|
|
56
|
-
tone: getStatusTone(run.status),
|
|
57
|
-
label: run.status
|
|
58
|
-
}, undefined, false, undefined, this),
|
|
59
|
-
/* @__PURE__ */ jsxDEV(Text, {
|
|
60
|
-
className: "text-muted-foreground text-sm",
|
|
61
|
-
children: [
|
|
62
|
-
"Queued ",
|
|
63
|
-
run.queuedAt.toLocaleString()
|
|
64
|
-
]
|
|
65
|
-
}, undefined, true, undefined, this)
|
|
66
|
-
]
|
|
67
|
-
}, undefined, true, undefined, this),
|
|
68
|
-
/* @__PURE__ */ jsxDEV(HStack, {
|
|
69
|
-
gap: "lg",
|
|
70
|
-
className: "flex-wrap",
|
|
71
|
-
children: [
|
|
72
|
-
/* @__PURE__ */ jsxDEV(Text, {
|
|
73
|
-
className: "text-muted-foreground text-sm",
|
|
74
|
-
children: [
|
|
75
|
-
"Prompt ",
|
|
76
|
-
formatTokens(run.promptTokens)
|
|
77
|
-
]
|
|
78
|
-
}, undefined, true, undefined, this),
|
|
79
|
-
/* @__PURE__ */ jsxDEV(Text, {
|
|
80
|
-
className: "text-muted-foreground text-sm",
|
|
81
|
-
children: [
|
|
82
|
-
"Completion ",
|
|
83
|
-
formatTokens(run.completionTokens)
|
|
84
|
-
]
|
|
85
|
-
}, undefined, true, undefined, this),
|
|
86
|
-
/* @__PURE__ */ jsxDEV(Text, {
|
|
87
|
-
className: "text-muted-foreground text-sm",
|
|
88
|
-
children: [
|
|
89
|
-
"Duration ",
|
|
90
|
-
formatDuration(run.durationMs)
|
|
91
|
-
]
|
|
92
|
-
}, undefined, true, undefined, this)
|
|
93
|
-
]
|
|
94
|
-
}, undefined, true, undefined, this),
|
|
95
|
-
/* @__PURE__ */ jsxDEV(VStack, {
|
|
96
|
-
gap: "xs",
|
|
97
|
-
children: [
|
|
98
|
-
/* @__PURE__ */ jsxDEV(Text, {
|
|
99
|
-
className: "font-medium text-sm",
|
|
100
|
-
children: "Input"
|
|
101
|
-
}, undefined, false, undefined, this),
|
|
102
|
-
/* @__PURE__ */ jsxDEV("pre", {
|
|
103
|
-
className: "overflow-auto rounded-md bg-muted/40 p-3 text-xs",
|
|
104
|
-
children: formatJson(run.input)
|
|
105
|
-
}, undefined, false, undefined, this)
|
|
106
|
-
]
|
|
107
|
-
}, undefined, true, undefined, this),
|
|
108
|
-
/* @__PURE__ */ jsxDEV(VStack, {
|
|
109
|
-
gap: "xs",
|
|
110
|
-
children: [
|
|
111
|
-
/* @__PURE__ */ jsxDEV(Text, {
|
|
112
|
-
className: "font-medium text-sm",
|
|
113
|
-
children: "Output"
|
|
114
|
-
}, undefined, false, undefined, this),
|
|
115
|
-
/* @__PURE__ */ jsxDEV("pre", {
|
|
116
|
-
className: "overflow-auto rounded-md bg-muted/40 p-3 text-xs",
|
|
117
|
-
children: formatJson(run.output ?? run.errorMessage ?? "Pending")
|
|
118
|
-
}, undefined, false, undefined, this)
|
|
119
|
-
]
|
|
120
|
-
}, undefined, true, undefined, this)
|
|
121
|
-
]
|
|
122
|
-
}, undefined, true, undefined, this);
|
|
123
|
-
}
|
|
124
|
-
function RunTableToolbar({
|
|
125
|
-
controller,
|
|
126
|
-
totalRuns
|
|
127
|
-
}) {
|
|
128
|
-
const firstRow = controller.rows[0];
|
|
129
|
-
const queuedColumn = controller.columns.find((column) => column.id === "queuedAt");
|
|
130
|
-
const durationColumn = controller.columns.find((column) => column.id === "durationMs");
|
|
131
|
-
const costColumn = controller.columns.find((column) => column.id === "estimatedCostUsd");
|
|
132
|
-
return /* @__PURE__ */ jsxDEV(HStack, {
|
|
133
|
-
gap: "sm",
|
|
134
|
-
className: "flex-wrap",
|
|
135
|
-
children: [
|
|
136
|
-
/* @__PURE__ */ jsxDEV(Text, {
|
|
137
|
-
className: "text-muted-foreground text-sm",
|
|
138
|
-
children: [
|
|
139
|
-
totalRuns,
|
|
140
|
-
" runs"
|
|
141
|
-
]
|
|
142
|
-
}, undefined, true, undefined, this),
|
|
143
|
-
/* @__PURE__ */ jsxDEV(Button, {
|
|
144
|
-
variant: "outline",
|
|
145
|
-
size: "sm",
|
|
146
|
-
onPress: () => firstRow?.toggleExpanded?.(!firstRow?.isExpanded),
|
|
147
|
-
children: "Expand Latest Run"
|
|
148
|
-
}, undefined, false, undefined, this),
|
|
149
|
-
/* @__PURE__ */ jsxDEV(Button, {
|
|
150
|
-
variant: "outline",
|
|
151
|
-
size: "sm",
|
|
152
|
-
onPress: () => queuedColumn?.toggleVisibility?.(!queuedColumn?.visible),
|
|
153
|
-
children: queuedColumn?.visible ? "Hide Time" : "Show Time"
|
|
154
|
-
}, undefined, false, undefined, this),
|
|
155
|
-
/* @__PURE__ */ jsxDEV(Button, {
|
|
156
|
-
variant: "outline",
|
|
157
|
-
size: "sm",
|
|
158
|
-
onPress: () => durationColumn?.toggleVisibility?.(!durationColumn?.visible),
|
|
159
|
-
children: durationColumn?.visible ? "Hide Duration" : "Show Duration"
|
|
160
|
-
}, undefined, false, undefined, this),
|
|
161
|
-
/* @__PURE__ */ jsxDEV(Button, {
|
|
162
|
-
variant: "outline",
|
|
163
|
-
size: "sm",
|
|
164
|
-
onPress: () => costColumn?.toggleVisibility?.(!costColumn?.visible),
|
|
165
|
-
children: costColumn?.visible ? "Hide Cost" : "Show Cost"
|
|
166
|
-
}, undefined, false, undefined, this)
|
|
167
|
-
]
|
|
168
|
-
}, undefined, true, undefined, this);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
// src/ui/views/run-data-table.columns.tsx
|
|
172
|
-
import { StatusChip as StatusChip2 } from "@contractspec/lib.design-system";
|
|
173
|
-
import { VStack as VStack2 } from "@contractspec/lib.ui-kit-web/ui/stack";
|
|
174
|
-
import { Text as Text2 } from "@contractspec/lib.ui-kit-web/ui/text";
|
|
175
|
-
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
176
|
-
"use client";
|
|
177
|
-
function createRunTableColumns() {
|
|
178
|
-
return [
|
|
179
|
-
{
|
|
180
|
-
id: "queuedAt",
|
|
181
|
-
header: "Run",
|
|
182
|
-
label: "Run",
|
|
183
|
-
accessor: (run) => run.queuedAt.getTime(),
|
|
184
|
-
cell: ({ item }) => /* @__PURE__ */ jsxDEV2(VStack2, {
|
|
185
|
-
gap: "xs",
|
|
186
|
-
children: [
|
|
187
|
-
/* @__PURE__ */ jsxDEV2(Text2, {
|
|
188
|
-
className: "font-mono text-sm",
|
|
189
|
-
children: item.id.slice(-8)
|
|
190
|
-
}, undefined, false, undefined, this),
|
|
191
|
-
/* @__PURE__ */ jsxDEV2(Text2, {
|
|
192
|
-
className: "text-muted-foreground text-xs",
|
|
193
|
-
children: item.queuedAt.toLocaleString()
|
|
194
|
-
}, undefined, false, undefined, this)
|
|
195
|
-
]
|
|
196
|
-
}, undefined, true, undefined, this),
|
|
197
|
-
size: 220,
|
|
198
|
-
minSize: 180,
|
|
199
|
-
canSort: true,
|
|
200
|
-
canHide: true,
|
|
201
|
-
canResize: true
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
id: "agentName",
|
|
205
|
-
header: "Agent",
|
|
206
|
-
label: "Agent",
|
|
207
|
-
accessor: (run) => run.agentName ?? "Unknown Agent",
|
|
208
|
-
cell: ({ value }) => /* @__PURE__ */ jsxDEV2(Text2, {
|
|
209
|
-
className: "font-medium",
|
|
210
|
-
children: typeof value === "string" ? value : "Unknown Agent"
|
|
211
|
-
}, undefined, false, undefined, this),
|
|
212
|
-
size: 220,
|
|
213
|
-
canSort: true,
|
|
214
|
-
canResize: true
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
id: "status",
|
|
218
|
-
header: "Status",
|
|
219
|
-
label: "Status",
|
|
220
|
-
accessorKey: "status",
|
|
221
|
-
cell: ({ value }) => {
|
|
222
|
-
const status = typeof value === "string" ? value : "QUEUED";
|
|
223
|
-
return /* @__PURE__ */ jsxDEV2(StatusChip2, {
|
|
224
|
-
tone: getStatusTone(status),
|
|
225
|
-
label: status
|
|
226
|
-
}, undefined, false, undefined, this);
|
|
227
|
-
},
|
|
228
|
-
size: 150,
|
|
229
|
-
canSort: true,
|
|
230
|
-
canResize: true
|
|
231
|
-
},
|
|
232
|
-
{
|
|
233
|
-
id: "totalTokens",
|
|
234
|
-
header: "Tokens",
|
|
235
|
-
label: "Tokens",
|
|
236
|
-
accessorKey: "totalTokens",
|
|
237
|
-
cell: ({ value }) => formatTokens(Number(value ?? 0)),
|
|
238
|
-
align: "right",
|
|
239
|
-
size: 140,
|
|
240
|
-
canSort: true,
|
|
241
|
-
canResize: true
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
id: "durationMs",
|
|
245
|
-
header: "Duration",
|
|
246
|
-
label: "Duration",
|
|
247
|
-
accessorKey: "durationMs",
|
|
248
|
-
cell: ({ value }) => formatDuration(typeof value === "number" ? value : undefined),
|
|
249
|
-
align: "right",
|
|
250
|
-
size: 140,
|
|
251
|
-
canSort: true,
|
|
252
|
-
canHide: true,
|
|
253
|
-
canResize: true
|
|
254
|
-
},
|
|
255
|
-
{
|
|
256
|
-
id: "estimatedCostUsd",
|
|
257
|
-
header: "Cost",
|
|
258
|
-
label: "Cost",
|
|
259
|
-
accessorKey: "estimatedCostUsd",
|
|
260
|
-
cell: ({ value }) => formatCost(typeof value === "number" ? value : undefined),
|
|
261
|
-
align: "right",
|
|
262
|
-
size: 140,
|
|
263
|
-
canSort: true,
|
|
264
|
-
canHide: true,
|
|
265
|
-
canResize: true
|
|
266
|
-
}
|
|
267
|
-
];
|
|
268
|
-
}
|
|
269
|
-
export {
|
|
270
|
-
createRunTableColumns
|
|
271
|
-
};
|
|
1
|
+
import{Button as I,StatusChip as $}from"@contractspec/lib.design-system";import{HStack as Q,VStack as P}from"@contractspec/lib.ui-kit-web/ui/stack";import{Text as E}from"@contractspec/lib.ui-kit-web/ui/text";import{jsx as A,jsxs as z}from"react/jsx-runtime";function U(y){switch(y){case"COMPLETED":return"success";case"RUNNING":return"warning";case"QUEUED":return"neutral";case"FAILED":case"CANCELLED":return"danger";default:return"neutral"}}function W(y){if(!y)return"-";if(y<1000)return`${y}ms`;if(y<60000)return`${(y/1000).toFixed(1)}s`;return`${(y/60000).toFixed(1)}m`}function K(y){if(y<1000)return y.toString();if(y<1e6)return`${(y/1000).toFixed(1)}K`;return`${(y/1e6).toFixed(2)}M`}function _(y){if(!y)return"-";return`$${y.toFixed(4)}`}function Z(y){return JSON.stringify(y??null,null,2)}function b({run:y}){return z(P,{gap:"sm",className:"py-2",children:[z(Q,{justify:"between",className:"flex-wrap",children:[A($,{tone:U(y.status),label:y.status}),z(E,{className:"text-muted-foreground text-sm",children:["Queued ",y.queuedAt.toLocaleString()]})]}),z(Q,{gap:"lg",className:"flex-wrap",children:[z(E,{className:"text-muted-foreground text-sm",children:["Prompt ",K(y.promptTokens)]}),z(E,{className:"text-muted-foreground text-sm",children:["Completion ",K(y.completionTokens)]}),z(E,{className:"text-muted-foreground text-sm",children:["Duration ",W(y.durationMs)]})]}),z(P,{gap:"xs",children:[A(E,{className:"font-medium text-sm",children:"Input"}),A("pre",{className:"overflow-auto rounded-md bg-muted/40 p-3 text-xs",children:Z(y.input)})]}),z(P,{gap:"xs",children:[A(E,{className:"font-medium text-sm",children:"Output"}),A("pre",{className:"overflow-auto rounded-md bg-muted/40 p-3 text-xs",children:Z(y.output??y.errorMessage??"Pending")})]})]})}function p({controller:y,totalRuns:G}){let Y=y.rows[0],M=y.columns.find((F)=>F.id==="queuedAt"),N=y.columns.find((F)=>F.id==="durationMs"),O=y.columns.find((F)=>F.id==="estimatedCostUsd");return z(Q,{gap:"sm",className:"flex-wrap",children:[z(E,{className:"text-muted-foreground text-sm",children:[G," runs"]}),A(I,{variant:"outline",size:"sm",onPress:()=>Y?.toggleExpanded?.(!Y?.isExpanded),children:"Expand Latest Run"}),A(I,{variant:"outline",size:"sm",onPress:()=>M?.toggleVisibility?.(!M?.visible),children:M?.visible?"Hide Time":"Show Time"}),A(I,{variant:"outline",size:"sm",onPress:()=>N?.toggleVisibility?.(!N?.visible),children:N?.visible?"Hide Duration":"Show Duration"}),A(I,{variant:"outline",size:"sm",onPress:()=>O?.toggleVisibility?.(!O?.visible),children:O?.visible?"Hide Cost":"Show Cost"})]})}import{StatusChip as g}from"@contractspec/lib.design-system";import{VStack as D}from"@contractspec/lib.ui-kit-web/ui/stack";import{Text as X}from"@contractspec/lib.ui-kit-web/ui/text";import{jsx as L,jsxs as J}from"react/jsx-runtime";function S(){return[{id:"queuedAt",header:"Run",label:"Run",accessor:(y)=>y.queuedAt.getTime(),cell:({item:y})=>J(D,{gap:"xs",children:[L(X,{className:"font-mono text-sm",children:y.id.slice(-8)}),L(X,{className:"text-muted-foreground text-xs",children:y.queuedAt.toLocaleString()})]}),size:220,minSize:180,canSort:!0,canHide:!0,canResize:!0},{id:"agentName",header:"Agent",label:"Agent",accessor:(y)=>y.agentName??"Unknown Agent",cell:({value:y})=>L(X,{className:"font-medium",children:typeof y==="string"?y:"Unknown Agent"}),size:220,canSort:!0,canResize:!0},{id:"status",header:"Status",label:"Status",accessorKey:"status",cell:({value:y})=>{let G=typeof y==="string"?y:"QUEUED";return L(g,{tone:U(G),label:G})},size:150,canSort:!0,canResize:!0},{id:"totalTokens",header:"Tokens",label:"Tokens",accessorKey:"totalTokens",cell:({value:y})=>K(Number(y??0)),align:"right",size:140,canSort:!0,canResize:!0},{id:"durationMs",header:"Duration",label:"Duration",accessorKey:"durationMs",cell:({value:y})=>W(typeof y==="number"?y:void 0),align:"right",size:140,canSort:!0,canHide:!0,canResize:!0},{id:"estimatedCostUsd",header:"Cost",label:"Cost",accessorKey:"estimatedCostUsd",cell:({value:y})=>_(typeof y==="number"?y:void 0),align:"right",size:140,canSort:!0,canHide:!0,canResize:!0}]}export{S as createRunTableColumns};
|
|
@@ -1,177 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { Button, StatusChip } from "@contractspec/lib.design-system";
|
|
3
|
-
import { HStack, VStack } from "@contractspec/lib.ui-kit-web/ui/stack";
|
|
4
|
-
import { Text } from "@contractspec/lib.ui-kit-web/ui/text";
|
|
5
|
-
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
6
|
-
"use client";
|
|
7
|
-
function getStatusTone(status) {
|
|
8
|
-
switch (status) {
|
|
9
|
-
case "COMPLETED":
|
|
10
|
-
return "success";
|
|
11
|
-
case "RUNNING":
|
|
12
|
-
return "warning";
|
|
13
|
-
case "QUEUED":
|
|
14
|
-
return "neutral";
|
|
15
|
-
case "FAILED":
|
|
16
|
-
case "CANCELLED":
|
|
17
|
-
return "danger";
|
|
18
|
-
default:
|
|
19
|
-
return "neutral";
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
function formatDuration(ms) {
|
|
23
|
-
if (!ms)
|
|
24
|
-
return "-";
|
|
25
|
-
if (ms < 1000)
|
|
26
|
-
return `${ms}ms`;
|
|
27
|
-
if (ms < 60000)
|
|
28
|
-
return `${(ms / 1000).toFixed(1)}s`;
|
|
29
|
-
return `${(ms / 60000).toFixed(1)}m`;
|
|
30
|
-
}
|
|
31
|
-
function formatTokens(tokens) {
|
|
32
|
-
if (tokens < 1000)
|
|
33
|
-
return tokens.toString();
|
|
34
|
-
if (tokens < 1e6)
|
|
35
|
-
return `${(tokens / 1000).toFixed(1)}K`;
|
|
36
|
-
return `${(tokens / 1e6).toFixed(2)}M`;
|
|
37
|
-
}
|
|
38
|
-
function formatCost(cost) {
|
|
39
|
-
if (!cost)
|
|
40
|
-
return "-";
|
|
41
|
-
return `$${cost.toFixed(4)}`;
|
|
42
|
-
}
|
|
43
|
-
function formatJson(value) {
|
|
44
|
-
return JSON.stringify(value ?? null, null, 2);
|
|
45
|
-
}
|
|
46
|
-
function RunExpandedContent({ run }) {
|
|
47
|
-
return /* @__PURE__ */ jsxDEV(VStack, {
|
|
48
|
-
gap: "sm",
|
|
49
|
-
className: "py-2",
|
|
50
|
-
children: [
|
|
51
|
-
/* @__PURE__ */ jsxDEV(HStack, {
|
|
52
|
-
justify: "between",
|
|
53
|
-
className: "flex-wrap",
|
|
54
|
-
children: [
|
|
55
|
-
/* @__PURE__ */ jsxDEV(StatusChip, {
|
|
56
|
-
tone: getStatusTone(run.status),
|
|
57
|
-
label: run.status
|
|
58
|
-
}, undefined, false, undefined, this),
|
|
59
|
-
/* @__PURE__ */ jsxDEV(Text, {
|
|
60
|
-
className: "text-muted-foreground text-sm",
|
|
61
|
-
children: [
|
|
62
|
-
"Queued ",
|
|
63
|
-
run.queuedAt.toLocaleString()
|
|
64
|
-
]
|
|
65
|
-
}, undefined, true, undefined, this)
|
|
66
|
-
]
|
|
67
|
-
}, undefined, true, undefined, this),
|
|
68
|
-
/* @__PURE__ */ jsxDEV(HStack, {
|
|
69
|
-
gap: "lg",
|
|
70
|
-
className: "flex-wrap",
|
|
71
|
-
children: [
|
|
72
|
-
/* @__PURE__ */ jsxDEV(Text, {
|
|
73
|
-
className: "text-muted-foreground text-sm",
|
|
74
|
-
children: [
|
|
75
|
-
"Prompt ",
|
|
76
|
-
formatTokens(run.promptTokens)
|
|
77
|
-
]
|
|
78
|
-
}, undefined, true, undefined, this),
|
|
79
|
-
/* @__PURE__ */ jsxDEV(Text, {
|
|
80
|
-
className: "text-muted-foreground text-sm",
|
|
81
|
-
children: [
|
|
82
|
-
"Completion ",
|
|
83
|
-
formatTokens(run.completionTokens)
|
|
84
|
-
]
|
|
85
|
-
}, undefined, true, undefined, this),
|
|
86
|
-
/* @__PURE__ */ jsxDEV(Text, {
|
|
87
|
-
className: "text-muted-foreground text-sm",
|
|
88
|
-
children: [
|
|
89
|
-
"Duration ",
|
|
90
|
-
formatDuration(run.durationMs)
|
|
91
|
-
]
|
|
92
|
-
}, undefined, true, undefined, this)
|
|
93
|
-
]
|
|
94
|
-
}, undefined, true, undefined, this),
|
|
95
|
-
/* @__PURE__ */ jsxDEV(VStack, {
|
|
96
|
-
gap: "xs",
|
|
97
|
-
children: [
|
|
98
|
-
/* @__PURE__ */ jsxDEV(Text, {
|
|
99
|
-
className: "font-medium text-sm",
|
|
100
|
-
children: "Input"
|
|
101
|
-
}, undefined, false, undefined, this),
|
|
102
|
-
/* @__PURE__ */ jsxDEV("pre", {
|
|
103
|
-
className: "overflow-auto rounded-md bg-muted/40 p-3 text-xs",
|
|
104
|
-
children: formatJson(run.input)
|
|
105
|
-
}, undefined, false, undefined, this)
|
|
106
|
-
]
|
|
107
|
-
}, undefined, true, undefined, this),
|
|
108
|
-
/* @__PURE__ */ jsxDEV(VStack, {
|
|
109
|
-
gap: "xs",
|
|
110
|
-
children: [
|
|
111
|
-
/* @__PURE__ */ jsxDEV(Text, {
|
|
112
|
-
className: "font-medium text-sm",
|
|
113
|
-
children: "Output"
|
|
114
|
-
}, undefined, false, undefined, this),
|
|
115
|
-
/* @__PURE__ */ jsxDEV("pre", {
|
|
116
|
-
className: "overflow-auto rounded-md bg-muted/40 p-3 text-xs",
|
|
117
|
-
children: formatJson(run.output ?? run.errorMessage ?? "Pending")
|
|
118
|
-
}, undefined, false, undefined, this)
|
|
119
|
-
]
|
|
120
|
-
}, undefined, true, undefined, this)
|
|
121
|
-
]
|
|
122
|
-
}, undefined, true, undefined, this);
|
|
123
|
-
}
|
|
124
|
-
function RunTableToolbar({
|
|
125
|
-
controller,
|
|
126
|
-
totalRuns
|
|
127
|
-
}) {
|
|
128
|
-
const firstRow = controller.rows[0];
|
|
129
|
-
const queuedColumn = controller.columns.find((column) => column.id === "queuedAt");
|
|
130
|
-
const durationColumn = controller.columns.find((column) => column.id === "durationMs");
|
|
131
|
-
const costColumn = controller.columns.find((column) => column.id === "estimatedCostUsd");
|
|
132
|
-
return /* @__PURE__ */ jsxDEV(HStack, {
|
|
133
|
-
gap: "sm",
|
|
134
|
-
className: "flex-wrap",
|
|
135
|
-
children: [
|
|
136
|
-
/* @__PURE__ */ jsxDEV(Text, {
|
|
137
|
-
className: "text-muted-foreground text-sm",
|
|
138
|
-
children: [
|
|
139
|
-
totalRuns,
|
|
140
|
-
" runs"
|
|
141
|
-
]
|
|
142
|
-
}, undefined, true, undefined, this),
|
|
143
|
-
/* @__PURE__ */ jsxDEV(Button, {
|
|
144
|
-
variant: "outline",
|
|
145
|
-
size: "sm",
|
|
146
|
-
onPress: () => firstRow?.toggleExpanded?.(!firstRow?.isExpanded),
|
|
147
|
-
children: "Expand Latest Run"
|
|
148
|
-
}, undefined, false, undefined, this),
|
|
149
|
-
/* @__PURE__ */ jsxDEV(Button, {
|
|
150
|
-
variant: "outline",
|
|
151
|
-
size: "sm",
|
|
152
|
-
onPress: () => queuedColumn?.toggleVisibility?.(!queuedColumn?.visible),
|
|
153
|
-
children: queuedColumn?.visible ? "Hide Time" : "Show Time"
|
|
154
|
-
}, undefined, false, undefined, this),
|
|
155
|
-
/* @__PURE__ */ jsxDEV(Button, {
|
|
156
|
-
variant: "outline",
|
|
157
|
-
size: "sm",
|
|
158
|
-
onPress: () => durationColumn?.toggleVisibility?.(!durationColumn?.visible),
|
|
159
|
-
children: durationColumn?.visible ? "Hide Duration" : "Show Duration"
|
|
160
|
-
}, undefined, false, undefined, this),
|
|
161
|
-
/* @__PURE__ */ jsxDEV(Button, {
|
|
162
|
-
variant: "outline",
|
|
163
|
-
size: "sm",
|
|
164
|
-
onPress: () => costColumn?.toggleVisibility?.(!costColumn?.visible),
|
|
165
|
-
children: costColumn?.visible ? "Hide Cost" : "Show Cost"
|
|
166
|
-
}, undefined, false, undefined, this)
|
|
167
|
-
]
|
|
168
|
-
}, undefined, true, undefined, this);
|
|
169
|
-
}
|
|
170
|
-
export {
|
|
171
|
-
getStatusTone,
|
|
172
|
-
formatTokens,
|
|
173
|
-
formatDuration,
|
|
174
|
-
formatCost,
|
|
175
|
-
RunTableToolbar,
|
|
176
|
-
RunExpandedContent
|
|
177
|
-
};
|
|
1
|
+
import{Button as G,StatusChip as W}from"@contractspec/lib.design-system";import{HStack as N,VStack as M}from"@contractspec/lib.ui-kit-web/ui/stack";import{Text as E}from"@contractspec/lib.ui-kit-web/ui/text";import{jsx as A,jsxs as z}from"react/jsx-runtime";function X(y){switch(y){case"COMPLETED":return"success";case"RUNNING":return"warning";case"QUEUED":return"neutral";case"FAILED":case"CANCELLED":return"danger";default:return"neutral"}}function Y(y){if(!y)return"-";if(y<1000)return`${y}ms`;if(y<60000)return`${(y/1000).toFixed(1)}s`;return`${(y/60000).toFixed(1)}m`}function P(y){if(y<1000)return y.toString();if(y<1e6)return`${(y/1000).toFixed(1)}K`;return`${(y/1e6).toFixed(2)}M`}function g(y){if(!y)return"-";return`$${y.toFixed(4)}`}function Q(y){return JSON.stringify(y??null,null,2)}function h({run:y}){return z(M,{gap:"sm",className:"py-2",children:[z(N,{justify:"between",className:"flex-wrap",children:[A(W,{tone:X(y.status),label:y.status}),z(E,{className:"text-muted-foreground text-sm",children:["Queued ",y.queuedAt.toLocaleString()]})]}),z(N,{gap:"lg",className:"flex-wrap",children:[z(E,{className:"text-muted-foreground text-sm",children:["Prompt ",P(y.promptTokens)]}),z(E,{className:"text-muted-foreground text-sm",children:["Completion ",P(y.completionTokens)]}),z(E,{className:"text-muted-foreground text-sm",children:["Duration ",Y(y.durationMs)]})]}),z(M,{gap:"xs",children:[A(E,{className:"font-medium text-sm",children:"Input"}),A("pre",{className:"overflow-auto rounded-md bg-muted/40 p-3 text-xs",children:Q(y.input)})]}),z(M,{gap:"xs",children:[A(E,{className:"font-medium text-sm",children:"Output"}),A("pre",{className:"overflow-auto rounded-md bg-muted/40 p-3 text-xs",children:Q(y.output??y.errorMessage??"Pending")})]})]})}function D({controller:y,totalRuns:U}){let O=y.rows[0],I=y.columns.find((F)=>F.id==="queuedAt"),K=y.columns.find((F)=>F.id==="durationMs"),L=y.columns.find((F)=>F.id==="estimatedCostUsd");return z(N,{gap:"sm",className:"flex-wrap",children:[z(E,{className:"text-muted-foreground text-sm",children:[U," runs"]}),A(G,{variant:"outline",size:"sm",onPress:()=>O?.toggleExpanded?.(!O?.isExpanded),children:"Expand Latest Run"}),A(G,{variant:"outline",size:"sm",onPress:()=>I?.toggleVisibility?.(!I?.visible),children:I?.visible?"Hide Time":"Show Time"}),A(G,{variant:"outline",size:"sm",onPress:()=>K?.toggleVisibility?.(!K?.visible),children:K?.visible?"Hide Duration":"Show Duration"}),A(G,{variant:"outline",size:"sm",onPress:()=>L?.toggleVisibility?.(!L?.visible),children:L?.visible?"Hide Cost":"Show Cost"})]})}export{X as getStatusTone,P as formatTokens,Y as formatDuration,g as formatCost,D as RunTableToolbar,h as RunExpandedContent};
|
|
@@ -1,134 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
defineVisualization,
|
|
4
|
-
VisualizationRegistry
|
|
5
|
-
} from "@contractspec/lib.contracts-spec/visualizations";
|
|
6
|
-
var RUN_LIST_REF = { key: "agent.run.list", version: "1.0.0" };
|
|
7
|
-
var META = {
|
|
8
|
-
version: "1.0.0",
|
|
9
|
-
domain: "ai-ops",
|
|
10
|
-
stability: "experimental",
|
|
11
|
-
owners: ["@example.agent-console"],
|
|
12
|
-
tags: ["agent-console", "visualization", "operations"]
|
|
13
|
-
};
|
|
14
|
-
var AgentRunStatusVisualization = defineVisualization({
|
|
15
|
-
meta: {
|
|
16
|
-
...META,
|
|
17
|
-
key: "agent-console.visualization.run-status",
|
|
18
|
-
title: "Run Status Breakdown",
|
|
19
|
-
description: "Distribution of run outcomes across the current sample.",
|
|
20
|
-
goal: "Make operational success and failure mix visible at a glance.",
|
|
21
|
-
context: "Agent operations overview."
|
|
22
|
-
},
|
|
23
|
-
source: { primary: RUN_LIST_REF, resultPath: "data" },
|
|
24
|
-
visualization: {
|
|
25
|
-
kind: "pie",
|
|
26
|
-
nameDimension: "status",
|
|
27
|
-
valueMeasure: "runs",
|
|
28
|
-
dimensions: [
|
|
29
|
-
{ key: "status", label: "Status", dataPath: "status", type: "category" }
|
|
30
|
-
],
|
|
31
|
-
measures: [
|
|
32
|
-
{ key: "runs", label: "Runs", dataPath: "runs", format: "number" }
|
|
33
|
-
],
|
|
34
|
-
table: { caption: "Run counts by status." }
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
var AgentRunActivityVisualization = defineVisualization({
|
|
38
|
-
meta: {
|
|
39
|
-
...META,
|
|
40
|
-
key: "agent-console.visualization.run-activity",
|
|
41
|
-
title: "Recent Run Activity",
|
|
42
|
-
description: "Daily run volume across the current sample.",
|
|
43
|
-
goal: "Show whether agent activity is rising or slowing down.",
|
|
44
|
-
context: "Operations trend monitoring."
|
|
45
|
-
},
|
|
46
|
-
source: { primary: RUN_LIST_REF, resultPath: "data" },
|
|
47
|
-
visualization: {
|
|
48
|
-
kind: "cartesian",
|
|
49
|
-
variant: "line",
|
|
50
|
-
xDimension: "day",
|
|
51
|
-
yMeasures: ["runs"],
|
|
52
|
-
dimensions: [{ key: "day", label: "Day", dataPath: "day", type: "time" }],
|
|
53
|
-
measures: [
|
|
54
|
-
{
|
|
55
|
-
key: "runs",
|
|
56
|
-
label: "Runs",
|
|
57
|
-
dataPath: "runs",
|
|
58
|
-
format: "number",
|
|
59
|
-
color: "#0f766e"
|
|
60
|
-
}
|
|
61
|
-
],
|
|
62
|
-
table: { caption: "Daily run counts." }
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
var AgentRunEfficiencyVisualization = defineVisualization({
|
|
66
|
-
meta: {
|
|
67
|
-
...META,
|
|
68
|
-
key: "agent-console.visualization.run-efficiency",
|
|
69
|
-
title: "Duration vs Tokens",
|
|
70
|
-
description: "Scatter chart comparing token consumption and runtime.",
|
|
71
|
-
goal: "Reveal outlier runs that are slow relative to their token usage.",
|
|
72
|
-
context: "Operational performance diagnostics."
|
|
73
|
-
},
|
|
74
|
-
source: { primary: RUN_LIST_REF, resultPath: "data" },
|
|
75
|
-
visualization: {
|
|
76
|
-
kind: "cartesian",
|
|
77
|
-
variant: "scatter",
|
|
78
|
-
xDimension: "totalTokens",
|
|
79
|
-
yMeasures: ["durationMs"],
|
|
80
|
-
dimensions: [
|
|
81
|
-
{
|
|
82
|
-
key: "totalTokens",
|
|
83
|
-
label: "Total Tokens",
|
|
84
|
-
dataPath: "totalTokens",
|
|
85
|
-
type: "number"
|
|
86
|
-
}
|
|
87
|
-
],
|
|
88
|
-
measures: [
|
|
89
|
-
{
|
|
90
|
-
key: "durationMs",
|
|
91
|
-
label: "Duration",
|
|
92
|
-
dataPath: "durationMs",
|
|
93
|
-
format: "duration",
|
|
94
|
-
color: "#7c3aed"
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
key: "estimatedCostUsd",
|
|
98
|
-
label: "Cost",
|
|
99
|
-
dataPath: "estimatedCostUsd",
|
|
100
|
-
format: "currency"
|
|
101
|
-
}
|
|
102
|
-
],
|
|
103
|
-
series: [
|
|
104
|
-
{
|
|
105
|
-
key: "runs",
|
|
106
|
-
label: "Runs",
|
|
107
|
-
measure: "durationMs",
|
|
108
|
-
type: "scatter",
|
|
109
|
-
color: "#7c3aed"
|
|
110
|
-
}
|
|
111
|
-
],
|
|
112
|
-
table: { caption: "Run duration versus token usage." }
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
var AgentVisualizationSpecs = [
|
|
116
|
-
AgentRunStatusVisualization,
|
|
117
|
-
AgentRunActivityVisualization,
|
|
118
|
-
AgentRunEfficiencyVisualization
|
|
119
|
-
];
|
|
120
|
-
var AgentVisualizationRegistry = new VisualizationRegistry([
|
|
121
|
-
...AgentVisualizationSpecs
|
|
122
|
-
]);
|
|
123
|
-
var AgentVisualizationRefs = AgentVisualizationSpecs.map((spec) => ({
|
|
124
|
-
key: spec.meta.key,
|
|
125
|
-
version: spec.meta.version
|
|
126
|
-
}));
|
|
127
|
-
export {
|
|
128
|
-
AgentVisualizationSpecs,
|
|
129
|
-
AgentVisualizationRegistry,
|
|
130
|
-
AgentVisualizationRefs,
|
|
131
|
-
AgentRunStatusVisualization,
|
|
132
|
-
AgentRunEfficiencyVisualization,
|
|
133
|
-
AgentRunActivityVisualization
|
|
134
|
-
};
|
|
1
|
+
import{defineVisualization as h,VisualizationRegistry as w}from"@contractspec/lib.contracts-spec/visualizations";var j={key:"agent.run.list",version:"1.0.0"},k={version:"1.0.0",domain:"ai-ops",stability:"experimental",owners:["@example.agent-console"],tags:["agent-console","visualization","operations"]},x=h({meta:{...k,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:j,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."}}}),B=h({meta:{...k,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:j,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=h({meta:{...k,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:j,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."}}}),q=[x,B,C],G=new w([...q]),H=q.map((m)=>({key:m.meta.key,version:m.meta.version}));export{q as AgentVisualizationSpecs,G as AgentVisualizationRegistry,H as AgentVisualizationRefs,x as AgentRunStatusVisualization,C as AgentRunEfficiencyVisualization,B as AgentRunActivityVisualization};
|