@contractspec/example.agent-console 3.7.6 → 3.7.7
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 +18 -18
- package/AGENTS.md +50 -31
- package/README.md +69 -77
- package/dist/agent/agent.event.js +1 -1
- package/dist/agent/agent.operation.js +1 -1
- package/dist/agent/index.d.ts +5 -5
- package/dist/agent/index.js +1 -1
- package/dist/browser/agent/agent.event.js +1 -1
- package/dist/browser/agent/agent.operation.js +1 -1
- package/dist/browser/agent/index.js +1 -1
- package/dist/browser/index.js +2145 -2145
- package/dist/browser/presentations/index.js +4 -4
- package/dist/browser/run/index.js +536 -536
- package/dist/browser/run/run.event.js +2 -2
- package/dist/browser/run/run.presentation.js +2 -2
- package/dist/browser/tool/index.js +260 -260
- package/dist/browser/tool/tool.event.js +1 -1
- package/dist/browser/tool/tool.presentation.js +2 -2
- package/dist/browser/ui/AgentDashboard.js +956 -956
- package/dist/browser/ui/AgentRunList.js +16 -16
- package/dist/browser/ui/AgentToolRegistry.js +9 -9
- package/dist/browser/ui/hooks/index.js +153 -153
- package/dist/browser/ui/hooks/useAgentList.js +1 -1
- package/dist/browser/ui/hooks/useAgentMutations.js +1 -1
- package/dist/browser/ui/hooks/useRunList.js +1 -1
- package/dist/browser/ui/hooks/useToolList.js +1 -1
- package/dist/browser/ui/index.js +1222 -1222
- package/dist/browser/ui/modals/AgentActionsModal.js +13 -13
- package/dist/browser/ui/modals/CreateAgentModal.js +15 -15
- package/dist/browser/ui/modals/index.js +297 -297
- package/dist/browser/ui/renderers/agent-list.renderer.js +7 -7
- package/dist/browser/ui/renderers/index.js +157 -157
- package/dist/browser/ui/views/AgentListView.js +7 -7
- package/dist/browser/ui/views/RunListView.js +16 -16
- package/dist/browser/ui/views/ToolRegistryView.js +9 -9
- package/dist/browser/ui/views/index.js +97 -97
- package/dist/handlers/index.d.ts +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2145 -2145
- package/dist/node/agent/agent.event.js +1 -1
- package/dist/node/agent/agent.operation.js +1 -1
- package/dist/node/agent/index.js +1 -1
- package/dist/node/index.js +2145 -2145
- package/dist/node/presentations/index.js +4 -4
- package/dist/node/run/index.js +536 -536
- package/dist/node/run/run.event.js +2 -2
- package/dist/node/run/run.presentation.js +2 -2
- package/dist/node/tool/index.js +260 -260
- package/dist/node/tool/tool.event.js +1 -1
- package/dist/node/tool/tool.presentation.js +2 -2
- package/dist/node/ui/AgentDashboard.js +956 -956
- package/dist/node/ui/AgentRunList.js +16 -16
- package/dist/node/ui/AgentToolRegistry.js +9 -9
- package/dist/node/ui/hooks/index.js +153 -153
- package/dist/node/ui/hooks/useAgentList.js +1 -1
- package/dist/node/ui/hooks/useAgentMutations.js +1 -1
- package/dist/node/ui/hooks/useRunList.js +1 -1
- package/dist/node/ui/hooks/useToolList.js +1 -1
- package/dist/node/ui/index.js +1222 -1222
- package/dist/node/ui/modals/AgentActionsModal.js +13 -13
- package/dist/node/ui/modals/CreateAgentModal.js +15 -15
- package/dist/node/ui/modals/index.js +297 -297
- package/dist/node/ui/renderers/agent-list.renderer.js +7 -7
- package/dist/node/ui/renderers/index.js +157 -157
- package/dist/node/ui/views/AgentListView.js +7 -7
- package/dist/node/ui/views/RunListView.js +16 -16
- package/dist/node/ui/views/ToolRegistryView.js +9 -9
- package/dist/node/ui/views/index.js +97 -97
- package/dist/presentations/index.d.ts +3 -5
- package/dist/presentations/index.js +4 -4
- package/dist/run/index.d.ts +7 -7
- package/dist/run/index.js +536 -536
- package/dist/run/run.event.js +2 -2
- package/dist/run/run.handler.d.ts +3 -0
- package/dist/run/run.presentation.js +2 -2
- package/dist/shared/index.d.ts +1 -1
- package/dist/tool/index.d.ts +7 -7
- package/dist/tool/index.js +260 -260
- package/dist/tool/tool.event.js +1 -1
- package/dist/tool/tool.handler.d.ts +1 -1
- package/dist/tool/tool.presentation.js +2 -2
- package/dist/ui/AgentDashboard.js +956 -956
- package/dist/ui/AgentRunList.js +16 -16
- package/dist/ui/AgentToolRegistry.js +9 -9
- package/dist/ui/hooks/index.d.ts +4 -4
- package/dist/ui/hooks/index.js +153 -153
- package/dist/ui/hooks/useAgentList.d.ts +5 -0
- package/dist/ui/hooks/useAgentList.js +1 -1
- package/dist/ui/hooks/useAgentMutations.d.ts +9 -2
- package/dist/ui/hooks/useAgentMutations.js +1 -1
- package/dist/ui/hooks/useRunList.d.ts +5 -0
- package/dist/ui/hooks/useRunList.js +1 -1
- package/dist/ui/hooks/useToolList.d.ts +5 -0
- package/dist/ui/hooks/useToolList.js +1 -1
- package/dist/ui/index.d.ts +3 -3
- package/dist/ui/index.js +1222 -1222
- package/dist/ui/modals/AgentActionsModal.js +13 -13
- package/dist/ui/modals/CreateAgentModal.js +15 -15
- package/dist/ui/modals/index.d.ts +1 -1
- package/dist/ui/modals/index.js +297 -297
- package/dist/ui/renderers/agent-list.markdown.d.ts +5 -0
- package/dist/ui/renderers/agent-list.renderer.js +7 -7
- package/dist/ui/renderers/dashboard.markdown.d.ts +5 -0
- package/dist/ui/renderers/index.d.ts +2 -2
- package/dist/ui/renderers/index.js +157 -157
- package/dist/ui/renderers/run-list.markdown.d.ts +5 -0
- package/dist/ui/renderers/tool-registry.markdown.d.ts +5 -0
- package/dist/ui/views/AgentListView.js +7 -7
- package/dist/ui/views/RunListView.js +16 -16
- package/dist/ui/views/ToolRegistryView.js +9 -9
- package/dist/ui/views/index.js +97 -97
- package/package.json +6 -6
- package/src/agent/agent.entity.ts +111 -111
- package/src/agent/agent.enum.ts +12 -12
- package/src/agent/agent.event.ts +91 -91
- package/src/agent/agent.handler.ts +123 -123
- package/src/agent/agent.operation.ts +400 -400
- package/src/agent/agent.presentation.ts +62 -62
- package/src/agent/agent.schema.ts +175 -175
- package/src/agent/agent.test-spec.ts +48 -48
- package/src/agent/index.ts +46 -51
- package/src/agent.capability.ts +11 -11
- package/src/agent.feature.ts +131 -131
- package/src/docs/agent-console.docblock.ts +42 -42
- package/src/example.ts +35 -35
- package/src/handlers/agent.handlers.ts +522 -521
- package/src/handlers/index.ts +12 -12
- package/src/index.ts +8 -9
- package/src/presentations/index.ts +11 -13
- package/src/run/index.ts +49 -54
- package/src/run/run.entity.ts +137 -137
- package/src/run/run.enum.ts +18 -18
- package/src/run/run.event.ts +174 -174
- package/src/run/run.handler.ts +92 -91
- package/src/run/run.operation.ts +474 -474
- package/src/run/run.presentation.ts +42 -42
- package/src/run/run.schema.ts +126 -126
- package/src/run/run.test-spec.ts +48 -48
- package/src/seeders/index.ts +21 -21
- package/src/shared/index.ts +1 -1
- package/src/shared/mock-agents.ts +76 -76
- package/src/shared/mock-runs.ts +102 -102
- package/src/shared/mock-tools.ts +140 -140
- package/src/shared/overlay-types.ts +23 -23
- package/src/tool/index.ts +39 -44
- package/src/tool/tool.entity.ts +73 -73
- package/src/tool/tool.enum.ts +13 -13
- package/src/tool/tool.event.ts +80 -80
- package/src/tool/tool.handler.ts +102 -102
- package/src/tool/tool.operation.ts +328 -328
- package/src/tool/tool.presentation.ts +43 -43
- package/src/tool/tool.schema.ts +106 -106
- package/src/tool/tool.test-spec.ts +48 -48
- package/src/ui/AgentDashboard.tsx +348 -348
- package/src/ui/hooks/index.ts +7 -7
- package/src/ui/hooks/useAgentList.ts +57 -56
- package/src/ui/hooks/useAgentMutations.ts +160 -159
- package/src/ui/hooks/useRunList.ts +58 -57
- package/src/ui/hooks/useToolList.ts +102 -101
- package/src/ui/index.ts +6 -9
- package/src/ui/modals/AgentActionsModal.tsx +262 -262
- package/src/ui/modals/CreateAgentModal.tsx +232 -232
- package/src/ui/modals/index.ts +1 -1
- package/src/ui/overlays/demo-overlays.ts +52 -52
- package/src/ui/renderers/agent-list.markdown.ts +61 -60
- package/src/ui/renderers/agent-list.renderer.tsx +14 -14
- package/src/ui/renderers/dashboard.markdown.ts +140 -139
- package/src/ui/renderers/index.ts +3 -4
- package/src/ui/renderers/run-list.markdown.ts +48 -47
- package/src/ui/renderers/tool-registry.markdown.ts +66 -65
- package/src/ui/views/AgentListView.tsx +90 -90
- package/src/ui/views/RunListView.tsx +141 -141
- package/src/ui/views/ToolRegistryView.tsx +113 -113
- package/tsconfig.json +7 -8
- package/tsdown.config.js +7 -3
|
@@ -1,15 +1,68 @@
|
|
|
1
|
-
// src/ui/hooks/
|
|
2
|
-
import { useCallback, useEffect, useState } from "react";
|
|
1
|
+
// src/ui/hooks/useAgentList.ts
|
|
3
2
|
import { useTemplateRuntime } from "@contractspec/lib.example-shared-ui";
|
|
4
|
-
|
|
3
|
+
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
4
|
+
function useAgentList(options = {}) {
|
|
5
5
|
const { handlers, projectId } = useTemplateRuntime();
|
|
6
6
|
const { agent } = handlers;
|
|
7
7
|
const [data, setData] = useState(null);
|
|
8
|
-
const [metrics, setMetrics] = useState(null);
|
|
9
8
|
const [loading, setLoading] = useState(true);
|
|
10
9
|
const [error, setError] = useState(null);
|
|
11
10
|
const [page, setPage] = useState(1);
|
|
12
11
|
const fetchData = useCallback(async () => {
|
|
12
|
+
setLoading(true);
|
|
13
|
+
setError(null);
|
|
14
|
+
try {
|
|
15
|
+
const result = await agent.listAgents({
|
|
16
|
+
projectId,
|
|
17
|
+
search: options.search,
|
|
18
|
+
status: options.status === "all" ? undefined : options.status,
|
|
19
|
+
limit: options.limit ?? 20,
|
|
20
|
+
offset: (page - 1) * (options.limit ?? 20)
|
|
21
|
+
});
|
|
22
|
+
setData(result);
|
|
23
|
+
} catch (err) {
|
|
24
|
+
setError(err instanceof Error ? err : new Error("Unknown error"));
|
|
25
|
+
} finally {
|
|
26
|
+
setLoading(false);
|
|
27
|
+
}
|
|
28
|
+
}, [agent, projectId, options.search, options.status, options.limit, page]);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
fetchData();
|
|
31
|
+
}, [fetchData]);
|
|
32
|
+
const stats = useMemo(() => {
|
|
33
|
+
if (!data)
|
|
34
|
+
return null;
|
|
35
|
+
return {
|
|
36
|
+
total: data.total,
|
|
37
|
+
active: data.items.filter((a) => a.status === "ACTIVE").length,
|
|
38
|
+
paused: data.items.filter((a) => a.status === "PAUSED").length,
|
|
39
|
+
draft: data.items.filter((a) => a.status === "DRAFT").length
|
|
40
|
+
};
|
|
41
|
+
}, [data]);
|
|
42
|
+
return {
|
|
43
|
+
data,
|
|
44
|
+
loading,
|
|
45
|
+
error,
|
|
46
|
+
stats,
|
|
47
|
+
page,
|
|
48
|
+
refetch: fetchData,
|
|
49
|
+
nextPage: () => setPage((p) => p + 1),
|
|
50
|
+
prevPage: () => page > 1 && setPage((p) => p - 1)
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// src/ui/hooks/useRunList.ts
|
|
55
|
+
import { useTemplateRuntime as useTemplateRuntime2 } from "@contractspec/lib.example-shared-ui";
|
|
56
|
+
import { useCallback as useCallback2, useEffect as useEffect2, useState as useState2 } from "react";
|
|
57
|
+
function useRunList(options = {}) {
|
|
58
|
+
const { handlers, projectId } = useTemplateRuntime2();
|
|
59
|
+
const { agent } = handlers;
|
|
60
|
+
const [data, setData] = useState2(null);
|
|
61
|
+
const [metrics, setMetrics] = useState2(null);
|
|
62
|
+
const [loading, setLoading] = useState2(true);
|
|
63
|
+
const [error, setError] = useState2(null);
|
|
64
|
+
const [page, setPage] = useState2(1);
|
|
65
|
+
const fetchData = useCallback2(async () => {
|
|
13
66
|
setLoading(true);
|
|
14
67
|
setError(null);
|
|
15
68
|
try {
|
|
@@ -36,7 +89,7 @@ function useRunList(options = {}) {
|
|
|
36
89
|
setLoading(false);
|
|
37
90
|
}
|
|
38
91
|
}, [agent, projectId, options.agentId, options.status, options.limit, page]);
|
|
39
|
-
|
|
92
|
+
useEffect2(() => {
|
|
40
93
|
fetchData();
|
|
41
94
|
}, [fetchData]);
|
|
42
95
|
return {
|
|
@@ -53,12 +106,12 @@ function useRunList(options = {}) {
|
|
|
53
106
|
|
|
54
107
|
// src/ui/views/RunListView.tsx
|
|
55
108
|
import {
|
|
56
|
-
StatCard,
|
|
57
|
-
StatCardGroup,
|
|
58
|
-
StatusChip,
|
|
59
109
|
EmptyState,
|
|
110
|
+
ErrorState,
|
|
60
111
|
LoaderBlock,
|
|
61
|
-
|
|
112
|
+
StatCard,
|
|
113
|
+
StatCardGroup,
|
|
114
|
+
StatusChip
|
|
62
115
|
} from "@contractspec/lib.design-system";
|
|
63
116
|
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
64
117
|
"use client";
|
|
@@ -143,45 +196,45 @@ function RunListView({ agentId, onRunClick }) {
|
|
|
143
196
|
]
|
|
144
197
|
}, undefined, true, undefined, this),
|
|
145
198
|
/* @__PURE__ */ jsxDEV("div", {
|
|
146
|
-
className: "
|
|
199
|
+
className: "rounded-lg border border-border",
|
|
147
200
|
children: /* @__PURE__ */ jsxDEV("table", {
|
|
148
201
|
className: "w-full",
|
|
149
202
|
children: [
|
|
150
203
|
/* @__PURE__ */ jsxDEV("thead", {
|
|
151
|
-
className: "border-border bg-muted/30
|
|
204
|
+
className: "border-border border-b bg-muted/30",
|
|
152
205
|
children: /* @__PURE__ */ jsxDEV("tr", {
|
|
153
206
|
children: [
|
|
154
207
|
/* @__PURE__ */ jsxDEV("th", {
|
|
155
|
-
className: "
|
|
208
|
+
className: "px-4 py-3 text-left font-medium text-muted-foreground text-sm",
|
|
156
209
|
children: "Run"
|
|
157
210
|
}, undefined, false, undefined, this),
|
|
158
211
|
/* @__PURE__ */ jsxDEV("th", {
|
|
159
|
-
className: "
|
|
212
|
+
className: "px-4 py-3 text-left font-medium text-muted-foreground text-sm",
|
|
160
213
|
children: "Agent"
|
|
161
214
|
}, undefined, false, undefined, this),
|
|
162
215
|
/* @__PURE__ */ jsxDEV("th", {
|
|
163
|
-
className: "
|
|
216
|
+
className: "px-4 py-3 text-left font-medium text-muted-foreground text-sm",
|
|
164
217
|
children: "Status"
|
|
165
218
|
}, undefined, false, undefined, this),
|
|
166
219
|
/* @__PURE__ */ jsxDEV("th", {
|
|
167
|
-
className: "
|
|
220
|
+
className: "px-4 py-3 text-right font-medium text-muted-foreground text-sm",
|
|
168
221
|
children: "Tokens"
|
|
169
222
|
}, undefined, false, undefined, this),
|
|
170
223
|
/* @__PURE__ */ jsxDEV("th", {
|
|
171
|
-
className: "
|
|
224
|
+
className: "px-4 py-3 text-right font-medium text-muted-foreground text-sm",
|
|
172
225
|
children: "Duration"
|
|
173
226
|
}, undefined, false, undefined, this),
|
|
174
227
|
/* @__PURE__ */ jsxDEV("th", {
|
|
175
|
-
className: "
|
|
228
|
+
className: "px-4 py-3 text-right font-medium text-muted-foreground text-sm",
|
|
176
229
|
children: "Cost"
|
|
177
230
|
}, undefined, false, undefined, this)
|
|
178
231
|
]
|
|
179
232
|
}, undefined, true, undefined, this)
|
|
180
233
|
}, undefined, false, undefined, this),
|
|
181
234
|
/* @__PURE__ */ jsxDEV("tbody", {
|
|
182
|
-
className: "divide-
|
|
235
|
+
className: "divide-y divide-border",
|
|
183
236
|
children: data.items.map((run) => /* @__PURE__ */ jsxDEV("tr", {
|
|
184
|
-
className: "hover:bg-muted/50
|
|
237
|
+
className: "cursor-pointer transition-colors hover:bg-muted/50",
|
|
185
238
|
onClick: () => onRunClick?.(run.id),
|
|
186
239
|
children: [
|
|
187
240
|
/* @__PURE__ */ jsxDEV("td", {
|
|
@@ -230,7 +283,7 @@ function RunListView({ agentId, onRunClick }) {
|
|
|
230
283
|
}, undefined, true, undefined, this)
|
|
231
284
|
}, undefined, false, undefined, this),
|
|
232
285
|
/* @__PURE__ */ jsxDEV("div", {
|
|
233
|
-
className: "text-muted-foreground text-
|
|
286
|
+
className: "text-center text-muted-foreground text-sm",
|
|
234
287
|
children: [
|
|
235
288
|
"Showing ",
|
|
236
289
|
data.items.length,
|
|
@@ -244,16 +297,16 @@ function RunListView({ agentId, onRunClick }) {
|
|
|
244
297
|
}
|
|
245
298
|
|
|
246
299
|
// src/ui/hooks/useToolList.ts
|
|
247
|
-
import {
|
|
248
|
-
import {
|
|
300
|
+
import { useTemplateRuntime as useTemplateRuntime3 } from "@contractspec/lib.example-shared-ui";
|
|
301
|
+
import { useCallback as useCallback3, useEffect as useEffect3, useMemo as useMemo2, useState as useState3 } from "react";
|
|
249
302
|
function useToolList(options = {}) {
|
|
250
|
-
const { handlers, projectId } =
|
|
303
|
+
const { handlers, projectId } = useTemplateRuntime3();
|
|
251
304
|
const { agent } = handlers;
|
|
252
|
-
const [data, setData] =
|
|
253
|
-
const [loading, setLoading] =
|
|
254
|
-
const [error, setError] =
|
|
255
|
-
const [page, setPage] =
|
|
256
|
-
const fetchData =
|
|
305
|
+
const [data, setData] = useState3(null);
|
|
306
|
+
const [loading, setLoading] = useState3(true);
|
|
307
|
+
const [error, setError] = useState3(null);
|
|
308
|
+
const [page, setPage] = useState3(1);
|
|
309
|
+
const fetchData = useCallback3(async () => {
|
|
257
310
|
setLoading(true);
|
|
258
311
|
setError(null);
|
|
259
312
|
try {
|
|
@@ -280,10 +333,10 @@ function useToolList(options = {}) {
|
|
|
280
333
|
options.limit,
|
|
281
334
|
page
|
|
282
335
|
]);
|
|
283
|
-
|
|
336
|
+
useEffect3(() => {
|
|
284
337
|
fetchData();
|
|
285
338
|
}, [fetchData]);
|
|
286
|
-
const { stats, groupedByCategory, categoryStats } =
|
|
339
|
+
const { stats, groupedByCategory, categoryStats } = useMemo2(() => {
|
|
287
340
|
if (!data)
|
|
288
341
|
return { stats: null, groupedByCategory: {}, categoryStats: [] };
|
|
289
342
|
const items = data.items;
|
|
@@ -328,14 +381,14 @@ function useToolList(options = {}) {
|
|
|
328
381
|
|
|
329
382
|
// src/ui/views/ToolRegistryView.tsx
|
|
330
383
|
import {
|
|
331
|
-
|
|
332
|
-
StatCardGroup as StatCardGroup2,
|
|
333
|
-
StatusChip as StatusChip2,
|
|
334
|
-
EntityCard,
|
|
384
|
+
Button,
|
|
335
385
|
EmptyState as EmptyState2,
|
|
336
|
-
|
|
386
|
+
EntityCard,
|
|
337
387
|
ErrorState as ErrorState2,
|
|
338
|
-
|
|
388
|
+
LoaderBlock as LoaderBlock2,
|
|
389
|
+
StatCard as StatCard2,
|
|
390
|
+
StatCardGroup as StatCardGroup2,
|
|
391
|
+
StatusChip as StatusChip2
|
|
339
392
|
} from "@contractspec/lib.design-system";
|
|
340
393
|
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
341
394
|
"use client";
|
|
@@ -415,11 +468,11 @@ function ToolRegistryView({
|
|
|
415
468
|
children: categoryIcons[category]
|
|
416
469
|
}, undefined, false, undefined, this),
|
|
417
470
|
/* @__PURE__ */ jsxDEV2("h3", {
|
|
418
|
-
className: "text-lg
|
|
471
|
+
className: "font-semibold text-lg",
|
|
419
472
|
children: category
|
|
420
473
|
}, undefined, false, undefined, this),
|
|
421
474
|
/* @__PURE__ */ jsxDEV2("span", {
|
|
422
|
-
className: "
|
|
475
|
+
className: "rounded-full bg-muted px-2 py-0.5 text-muted-foreground text-xs",
|
|
423
476
|
children: tools.length
|
|
424
477
|
}, undefined, false, undefined, this)
|
|
425
478
|
]
|
|
@@ -450,69 +503,16 @@ function ToolRegistryView({
|
|
|
450
503
|
}, undefined, true, undefined, this);
|
|
451
504
|
}
|
|
452
505
|
|
|
453
|
-
// src/ui/hooks/useAgentList.ts
|
|
454
|
-
import { useCallback as useCallback3, useEffect as useEffect3, useMemo as useMemo2, useState as useState3 } from "react";
|
|
455
|
-
import { useTemplateRuntime as useTemplateRuntime3 } from "@contractspec/lib.example-shared-ui";
|
|
456
|
-
function useAgentList(options = {}) {
|
|
457
|
-
const { handlers, projectId } = useTemplateRuntime3();
|
|
458
|
-
const { agent } = handlers;
|
|
459
|
-
const [data, setData] = useState3(null);
|
|
460
|
-
const [loading, setLoading] = useState3(true);
|
|
461
|
-
const [error, setError] = useState3(null);
|
|
462
|
-
const [page, setPage] = useState3(1);
|
|
463
|
-
const fetchData = useCallback3(async () => {
|
|
464
|
-
setLoading(true);
|
|
465
|
-
setError(null);
|
|
466
|
-
try {
|
|
467
|
-
const result = await agent.listAgents({
|
|
468
|
-
projectId,
|
|
469
|
-
search: options.search,
|
|
470
|
-
status: options.status === "all" ? undefined : options.status,
|
|
471
|
-
limit: options.limit ?? 20,
|
|
472
|
-
offset: (page - 1) * (options.limit ?? 20)
|
|
473
|
-
});
|
|
474
|
-
setData(result);
|
|
475
|
-
} catch (err) {
|
|
476
|
-
setError(err instanceof Error ? err : new Error("Unknown error"));
|
|
477
|
-
} finally {
|
|
478
|
-
setLoading(false);
|
|
479
|
-
}
|
|
480
|
-
}, [agent, projectId, options.search, options.status, options.limit, page]);
|
|
481
|
-
useEffect3(() => {
|
|
482
|
-
fetchData();
|
|
483
|
-
}, [fetchData]);
|
|
484
|
-
const stats = useMemo2(() => {
|
|
485
|
-
if (!data)
|
|
486
|
-
return null;
|
|
487
|
-
return {
|
|
488
|
-
total: data.total,
|
|
489
|
-
active: data.items.filter((a) => a.status === "ACTIVE").length,
|
|
490
|
-
paused: data.items.filter((a) => a.status === "PAUSED").length,
|
|
491
|
-
draft: data.items.filter((a) => a.status === "DRAFT").length
|
|
492
|
-
};
|
|
493
|
-
}, [data]);
|
|
494
|
-
return {
|
|
495
|
-
data,
|
|
496
|
-
loading,
|
|
497
|
-
error,
|
|
498
|
-
stats,
|
|
499
|
-
page,
|
|
500
|
-
refetch: fetchData,
|
|
501
|
-
nextPage: () => setPage((p) => p + 1),
|
|
502
|
-
prevPage: () => page > 1 && setPage((p) => p - 1)
|
|
503
|
-
};
|
|
504
|
-
}
|
|
505
|
-
|
|
506
506
|
// src/ui/views/AgentListView.tsx
|
|
507
507
|
import {
|
|
508
508
|
Button as Button2,
|
|
509
|
-
|
|
510
|
-
StatCardGroup as StatCardGroup3,
|
|
509
|
+
EmptyState as EmptyState3,
|
|
511
510
|
EntityCard as EntityCard2,
|
|
512
|
-
StatusChip as StatusChip3,
|
|
513
|
-
LoaderBlock as LoaderBlock3,
|
|
514
511
|
ErrorState as ErrorState3,
|
|
515
|
-
|
|
512
|
+
LoaderBlock as LoaderBlock3,
|
|
513
|
+
StatCard as StatCard3,
|
|
514
|
+
StatCardGroup as StatCardGroup3,
|
|
515
|
+
StatusChip as StatusChip3
|
|
516
516
|
} from "@contractspec/lib.design-system";
|
|
517
517
|
import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
|
|
518
518
|
"use client";
|
|
@@ -577,7 +577,7 @@ function AgentListView() {
|
|
|
577
577
|
className: "flex items-center justify-between",
|
|
578
578
|
children: [
|
|
579
579
|
/* @__PURE__ */ jsxDEV3("h3", {
|
|
580
|
-
className: "text-lg
|
|
580
|
+
className: "font-semibold text-lg",
|
|
581
581
|
children: "Agents"
|
|
582
582
|
}, undefined, false, undefined, this),
|
|
583
583
|
/* @__PURE__ */ jsxDEV3(Button2, {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Agent Console Presentations - re-exports from domain modules for backward compatibility.
|
|
3
3
|
*/
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export { ToolListPresentation, ToolDetailPresentation, } from '../tool/tool.presentation';
|
|
8
|
-
export { ToolListPresentation as ToolRegistryPresentation } from '../tool/tool.presentation';
|
|
4
|
+
export { AgentConsoleDashboardPresentation, AgentDetailPresentation, AgentListPresentation, } from '../agent/agent.presentation';
|
|
5
|
+
export { RunDetailPresentation, RunDetailPresentation as RunMetricsPresentation, RunListPresentation, } from '../run/run.presentation';
|
|
6
|
+
export { ToolDetailPresentation, ToolListPresentation, ToolListPresentation as ToolRegistryPresentation, } from '../tool/tool.presentation';
|
|
@@ -450,8 +450,8 @@ var TimelineDataPointModel = defineSchemaModel2({
|
|
|
450
450
|
|
|
451
451
|
// src/run/run.presentation.ts
|
|
452
452
|
import {
|
|
453
|
-
|
|
454
|
-
|
|
453
|
+
definePresentation as definePresentation2,
|
|
454
|
+
StabilityEnum as StabilityEnum2
|
|
455
455
|
} from "@contractspec/lib.contracts-spec";
|
|
456
456
|
var RunListPresentation = definePresentation2({
|
|
457
457
|
meta: {
|
|
@@ -635,8 +635,8 @@ var UpdateToolInputModel = defineSchemaModel3({
|
|
|
635
635
|
|
|
636
636
|
// src/tool/tool.presentation.ts
|
|
637
637
|
import {
|
|
638
|
-
|
|
639
|
-
|
|
638
|
+
definePresentation as definePresentation3,
|
|
639
|
+
StabilityEnum as StabilityEnum3
|
|
640
640
|
} from "@contractspec/lib.contracts-spec";
|
|
641
641
|
var ToolListPresentation = definePresentation3({
|
|
642
642
|
meta: {
|
package/dist/run/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Run domain - Agent execution and monitoring.
|
|
3
3
|
*/
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
4
|
+
export { LogLevelEntityEnum, RunEntity, RunLogEntity, RunStatusEntityEnum, RunStepEntity, RunStepTypeEntityEnum, } from './run.entity';
|
|
5
|
+
export { GranularityEnum, LogLevelEnum, RunStatusEnum, RunStepTypeEnum, } from './run.enum';
|
|
6
|
+
export { MessageGeneratedEvent, RunCancelledEvent, RunCompletedEvent, RunFailedEvent, RunStartedEvent, ToolCompletedEvent, ToolInvokedEvent, } from './run.event';
|
|
7
|
+
export { type ListRunsInput, type ListRunsOutput, mockCancelRunHandler, mockExecuteAgentHandler, mockGetRunHandler, mockListRunsHandler, type RunSummary, } from './run.handler';
|
|
8
|
+
export { CancelRunCommand, ExecuteAgentCommand, GetRunLogsQuery, GetRunMetricsQuery, GetRunQuery, GetRunStepsQuery, ListRunsQuery, } from './run.operation';
|
|
9
|
+
export { RunDetailPresentation, RunListPresentation } from './run.presentation';
|
|
10
|
+
export { RunAgentRefModel, RunInputModel, RunLogModel, RunModel, RunStepModel, RunSummaryModel, TimelineDataPointModel, } from './run.schema';
|