@solidxai/core-ui 0.1.22-beta.4 → 0.1.22
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/dist/adapters/auth/adminEmbedSession.d.ts +16 -0
- package/dist/adapters/auth/adminEmbedSession.d.ts.map +1 -0
- package/dist/adapters/auth/adminEmbedSession.js +72 -0
- package/dist/adapters/auth/adminEmbedSession.js.map +1 -0
- package/dist/adapters/auth/adminEmbedSession.ts +67 -0
- package/dist/adapters/auth/getSession.d.ts.map +1 -1
- package/dist/adapters/auth/getSession.js +4 -1
- package/dist/adapters/auth/getSession.js.map +1 -1
- package/dist/adapters/auth/getSession.ts +4 -1
- package/dist/adapters/auth/storage.d.ts +1 -0
- package/dist/adapters/auth/storage.d.ts.map +1 -1
- package/dist/adapters/auth/storage.js +9 -3
- package/dist/adapters/auth/storage.js.map +1 -1
- package/dist/adapters/auth/storage.ts +10 -2
- package/dist/components/common/Link.d.ts.map +1 -1
- package/dist/components/common/Link.js +3 -2
- package/dist/components/common/Link.js.map +1 -1
- package/dist/components/common/Link.tsx +3 -2
- package/dist/components/core/form/SolidFormFooter.js +2 -2
- package/dist/components/core/form/SolidFormFooter.js.map +1 -1
- package/dist/components/core/form/SolidFormFooter.tsx +2 -2
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js +17 -15
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationManyToManyField.tsx +7 -5
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.d.ts.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js +13 -11
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.js.map +1 -1
- package/dist/components/core/form/fields/relations/SolidRelationOneToManyField.tsx +8 -6
- package/dist/components/core/solid-agent/browser/AgentBrowser.module.css +170 -0
- package/dist/components/core/solid-agent/browser/AgentBrowserScreen.d.ts +13 -0
- package/dist/components/core/solid-agent/browser/AgentBrowserScreen.d.ts.map +1 -0
- package/dist/components/core/solid-agent/browser/AgentBrowserScreen.js +138 -0
- package/dist/components/core/solid-agent/browser/AgentBrowserScreen.js.map +1 -0
- package/dist/components/core/solid-agent/browser/AgentBrowserScreen.tsx +162 -0
- package/dist/components/core/solid-agent/browser/DefaultAgentBrowserPanelWidget.d.ts +9 -0
- package/dist/components/core/solid-agent/browser/DefaultAgentBrowserPanelWidget.d.ts.map +1 -0
- package/dist/components/core/solid-agent/browser/DefaultAgentBrowserPanelWidget.js +59 -0
- package/dist/components/core/solid-agent/browser/DefaultAgentBrowserPanelWidget.js.map +1 -0
- package/dist/components/core/solid-agent/browser/DefaultAgentBrowserPanelWidget.tsx +159 -0
- package/dist/components/core/solid-agent/browser/useAgentBrowser.d.ts +6 -0
- package/dist/components/core/solid-agent/browser/useAgentBrowser.d.ts.map +1 -0
- package/dist/components/core/solid-agent/browser/useAgentBrowser.js +37 -0
- package/dist/components/core/solid-agent/browser/useAgentBrowser.js.map +1 -0
- package/dist/components/core/solid-agent/browser/useAgentBrowser.ts +38 -0
- package/dist/components/core/solid-agent/client/agentBrowser.d.ts +128 -0
- package/dist/components/core/solid-agent/client/agentBrowser.d.ts.map +1 -0
- package/dist/components/core/solid-agent/client/agentBrowser.js +474 -0
- package/dist/components/core/solid-agent/client/agentBrowser.js.map +1 -0
- package/dist/components/core/solid-agent/client/agentBrowser.ts +342 -0
- package/dist/components/core/solid-agent/toolFiles.d.ts +13 -0
- package/dist/components/core/solid-agent/toolFiles.d.ts.map +1 -0
- package/dist/components/core/solid-agent/toolFiles.js +54 -0
- package/dist/components/core/solid-agent/toolFiles.js.map +1 -0
- package/dist/components/core/solid-agent/toolFiles.ts +42 -0
- package/dist/components/core/solid-agent/widgets/AgentToolFiles.d.ts +9 -0
- package/dist/components/core/solid-agent/widgets/AgentToolFiles.d.ts.map +1 -0
- package/dist/components/core/solid-agent/widgets/AgentToolFiles.js +37 -0
- package/dist/components/core/solid-agent/widgets/AgentToolFiles.js.map +1 -0
- package/dist/components/core/solid-agent/widgets/AgentToolFiles.tsx +46 -0
- package/dist/components/core/solid-agent/widgets/SolidQuestionChatWidget.d.ts.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidQuestionChatWidget.js +3 -2
- package/dist/components/core/solid-agent/widgets/SolidQuestionChatWidget.js.map +1 -1
- package/dist/components/core/solid-agent/widgets/SolidQuestionChatWidget.tsx +3 -2
- package/dist/dummy.d.ts +2 -0
- package/dist/dummy.d.ts.map +1 -0
- package/dist/dummy.js +3 -0
- package/dist/dummy.js.map +1 -0
- package/dist/dummy.ts +2 -0
- package/dist/helpers/modelViewPersistence.d.ts +1 -1
- package/dist/helpers/modelViewPersistence.d.ts.map +1 -1
- package/dist/helpers/modelViewPersistence.js +5 -4
- package/dist/helpers/modelViewPersistence.js.map +1 -1
- package/dist/helpers/modelViewPersistence.ts +6 -4
- package/dist/hooks/useRouter.d.ts.map +1 -1
- package/dist/hooks/useRouter.js +5 -3
- package/dist/hooks/useRouter.js.map +1 -1
- package/dist/hooks/useRouter.ts +5 -3
- package/dist/resources/solid-custom.css +14 -1
- package/dist/routes/AppEventListener.js +1 -1
- package/dist/routes/AppEventListener.js.map +1 -1
- package/dist/routes/AppEventListener.tsx +1 -1
- package/dist/routes/pages/admin/core/AgentDeploymentPanel.d.ts +3 -4
- package/dist/routes/pages/admin/core/AgentDeploymentPanel.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/AgentDeploymentPanel.js +13 -83
- package/dist/routes/pages/admin/core/AgentDeploymentPanel.js.map +1 -1
- package/dist/routes/pages/admin/core/AgentDeploymentPanel.tsx +22 -43
- package/dist/routes/pages/admin/core/AgentJobsInboxPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/AgentJobsInboxPage.js +157 -34
- package/dist/routes/pages/admin/core/AgentJobsInboxPage.js.map +1 -1
- package/dist/routes/pages/admin/core/AgentJobsInboxPage.module.css +88 -12
- package/dist/routes/pages/admin/core/AgentJobsInboxPage.tsx +238 -26
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.css +6 -0
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.d.ts.map +1 -1
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.js +56 -49
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.js.map +1 -1
- package/dist/routes/pages/admin/core/AgentRegistryEditorPage.tsx +13 -6
- package/dist/routes/pages/embed/AdminEmbedPage.d.ts +7 -0
- package/dist/routes/pages/embed/AdminEmbedPage.d.ts.map +1 -0
- package/dist/routes/pages/embed/AdminEmbedPage.js +104 -0
- package/dist/routes/pages/embed/AdminEmbedPage.js.map +1 -0
- package/dist/routes/pages/embed/AdminEmbedPage.module.css +9 -0
- package/dist/routes/pages/embed/AdminEmbedPage.tsx +128 -0
- package/dist/routes/solidRoutes.d.ts.map +1 -1
- package/dist/routes/solidRoutes.js +2 -0
- package/dist/routes/solidRoutes.js.map +1 -1
- package/dist/routes/solidRoutes.tsx +2 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentDeploymentPanel.js","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/AgentDeploymentPanel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AgentDeploymentPanel.js","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/AgentDeploymentPanel.tsx"],"names":[],"mappings":"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","sourcesContent":["export type AgentDeployment = {\n runner?: string | null;\n minProcesses?: number;\n maxProcesses?: number | null;\n processCpu?: number | null;\n processMemory?: number | null;\n};\n\nexport function AgentDeploymentPanel({ value, onChange }: {\n value: AgentDeployment;\n onChange: (value: AgentDeployment) => void;\n}) {\n return <section className=\"agent-editor__section\">\n <h2>Deployment</h2>\n <div className=\"agent-editor__grid\">\n <label className=\"agent-editor__field\">Runner\n <select value={value.runner ?? \"\"} onChange={(event) => onChange({ ...value, runner: event.target.value || null })}>\n <option value=\"\">Installation default</option>\n <option value=\"local\">Local process</option>\n <option value=\"docker\">Docker</option>\n <option value=\"ecs\">Amazon ECS</option>\n </select>\n </label>\n <label className=\"agent-editor__field\">Minimum processes\n <input type=\"number\" min={0} required value={value.minProcesses ?? 0} onChange={(event) => onChange({ ...value, minProcesses: Number(event.target.value) })} />\n </label>\n <label className=\"agent-editor__field\">Maximum processes\n <input type=\"number\" min={1} placeholder=\"Installation default\" value={value.maxProcesses ?? \"\"} onChange={(event) => onChange({ ...value, maxProcesses: event.target.value ? Number(event.target.value) : null })} />\n </label>\n <label className=\"agent-editor__field\">CPU units\n <input type=\"number\" min={1} placeholder=\"Runner default\" value={value.processCpu ?? \"\"} onChange={(event) => onChange({ ...value, processCpu: event.target.value ? Number(event.target.value) : null })} />\n </label>\n <label className=\"agent-editor__field\">Memory (MiB)\n <input type=\"number\" min={1} placeholder=\"Runner default\" value={value.processMemory ?? \"\"} onChange={(event) => onChange({ ...value, processMemory: event.target.value ? Number(event.target.value) : null })} />\n </label>\n </div>\n <aside className=\"agent-editor__deployment-help\" aria-label=\"Deployment guidance\">\n <strong>About deployment</strong>\n <p>These settings control where new workers run and how many can be available for this agent.</p>\n <ul>\n <li><strong>Installation default:</strong> Uses the runner configured for the AgentHub installation. Choose this when the agent should follow the environment-wide default.</li>\n <li><strong>Local process:</strong> Runs workers on the AgentHub host. No separate runner setup is needed; CPU and memory overrides are not applied to local workers.</li>\n <li><strong>Docker:</strong> Requires Docker access and an <code>AGENT_HUB_DOCKER_IMAGE</code> image. Remote workers also need PostgreSQL, a reachable HTTPS manager URL, and a public gateway URL. Configure networking and shared workspace storage when needed.</li>\n <li><strong>Amazon ECS:</strong> Requires AWS access plus an ECS cluster, Fargate task definition, private subnet IDs, and security group IDs. The task definition must include the configured container (default: <code>agent</code>); remote workers also need PostgreSQL, an HTTPS manager URL, and a public gateway URL.</li>\n <li><strong>Process limits:</strong> Minimum processes keep workers warm; maximum processes caps this agent’s worker pool. Blank maximum uses the installation default. CPU units and memory (MiB) are resource overrides for Docker and ECS; blank values use runner defaults.</li>\n </ul>\n <p>Runner and resource changes affect new workers. Restart workers to replace existing ones. Save with <strong>Save Agent</strong>; saving an active agent moves it to Draft, which must be activated to create the next config version.</p>\n </aside>\n </section>;\n}\n"]}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { SolidButton } from "../../../../components/shad-cn-ui";
|
|
3
|
-
import { solidPatch } from "../../../../http/solidHttp";
|
|
4
|
-
|
|
5
1
|
export type AgentDeployment = {
|
|
6
2
|
runner?: string | null;
|
|
7
3
|
minProcesses?: number;
|
|
@@ -10,42 +6,15 @@ export type AgentDeployment = {
|
|
|
10
6
|
processMemory?: number | null;
|
|
11
7
|
};
|
|
12
8
|
|
|
13
|
-
export function AgentDeploymentPanel({
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
onSaved: () => void;
|
|
9
|
+
export function AgentDeploymentPanel({ value, onChange }: {
|
|
10
|
+
value: AgentDeployment;
|
|
11
|
+
onChange: (value: AgentDeployment) => void;
|
|
17
12
|
}) {
|
|
18
|
-
|
|
19
|
-
const [minimum, setMinimum] = React.useState(String(current.minProcesses ?? 0));
|
|
20
|
-
const [maximum, setMaximum] = React.useState(current.maxProcesses?.toString() ?? "");
|
|
21
|
-
const [cpu, setCpu] = React.useState(current.processCpu?.toString() ?? "");
|
|
22
|
-
const [memory, setMemory] = React.useState(current.processMemory?.toString() ?? "");
|
|
23
|
-
const [saving, setSaving] = React.useState(false);
|
|
24
|
-
const [status, setStatus] = React.useState<{ error: boolean; text: string }>();
|
|
25
|
-
async function save(event: React.FormEvent) {
|
|
26
|
-
event.preventDefault();
|
|
27
|
-
setSaving(true);
|
|
28
|
-
setStatus(undefined);
|
|
29
|
-
try {
|
|
30
|
-
await solidPatch(`/agent-registry/${agentId}/deployment`, {
|
|
31
|
-
runner: runner || null, minProcesses: Number(minimum), maxProcesses: maximum ? Number(maximum) : null,
|
|
32
|
-
processCpu: cpu ? Number(cpu) : null, processMemory: memory ? Number(memory) : null,
|
|
33
|
-
});
|
|
34
|
-
setStatus({ error: false, text: "Deployment settings saved." });
|
|
35
|
-
onSaved();
|
|
36
|
-
} catch (error) {
|
|
37
|
-
const detail = (error as { response?: { data?: { message?: unknown } } }).response?.data?.message;
|
|
38
|
-
setStatus({ error: true, text: typeof detail === "string" ? detail : "Could not save deployment settings." });
|
|
39
|
-
} finally {
|
|
40
|
-
setSaving(false);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return <form className="agent-editor__section" onSubmit={(event) => void save(event)}>
|
|
13
|
+
return <section className="agent-editor__section">
|
|
44
14
|
<h2>Deployment</h2>
|
|
45
|
-
<p>Runner and resource changes apply to new workers. Restart a worker to replace it using these settings.</p>
|
|
46
15
|
<div className="agent-editor__grid">
|
|
47
16
|
<label className="agent-editor__field">Runner
|
|
48
|
-
<select value={runner} onChange={(event) =>
|
|
17
|
+
<select value={value.runner ?? ""} onChange={(event) => onChange({ ...value, runner: event.target.value || null })}>
|
|
49
18
|
<option value="">Installation default</option>
|
|
50
19
|
<option value="local">Local process</option>
|
|
51
20
|
<option value="docker">Docker</option>
|
|
@@ -53,19 +22,29 @@ export function AgentDeploymentPanel({ agentId, current, onSaved }: {
|
|
|
53
22
|
</select>
|
|
54
23
|
</label>
|
|
55
24
|
<label className="agent-editor__field">Minimum processes
|
|
56
|
-
<input type="number" min={0} required value={
|
|
25
|
+
<input type="number" min={0} required value={value.minProcesses ?? 0} onChange={(event) => onChange({ ...value, minProcesses: Number(event.target.value) })} />
|
|
57
26
|
</label>
|
|
58
27
|
<label className="agent-editor__field">Maximum processes
|
|
59
|
-
<input type="number" min={1} placeholder="Installation default" value={
|
|
28
|
+
<input type="number" min={1} placeholder="Installation default" value={value.maxProcesses ?? ""} onChange={(event) => onChange({ ...value, maxProcesses: event.target.value ? Number(event.target.value) : null })} />
|
|
60
29
|
</label>
|
|
61
30
|
<label className="agent-editor__field">CPU units
|
|
62
|
-
<input type="number" min={1} placeholder="Runner default" value={
|
|
31
|
+
<input type="number" min={1} placeholder="Runner default" value={value.processCpu ?? ""} onChange={(event) => onChange({ ...value, processCpu: event.target.value ? Number(event.target.value) : null })} />
|
|
63
32
|
</label>
|
|
64
33
|
<label className="agent-editor__field">Memory (MiB)
|
|
65
|
-
<input type="number" min={1} placeholder="Runner default" value={
|
|
34
|
+
<input type="number" min={1} placeholder="Runner default" value={value.processMemory ?? ""} onChange={(event) => onChange({ ...value, processMemory: event.target.value ? Number(event.target.value) : null })} />
|
|
66
35
|
</label>
|
|
67
36
|
</div>
|
|
68
|
-
<
|
|
69
|
-
|
|
70
|
-
|
|
37
|
+
<aside className="agent-editor__deployment-help" aria-label="Deployment guidance">
|
|
38
|
+
<strong>About deployment</strong>
|
|
39
|
+
<p>These settings control where new workers run and how many can be available for this agent.</p>
|
|
40
|
+
<ul>
|
|
41
|
+
<li><strong>Installation default:</strong> Uses the runner configured for the AgentHub installation. Choose this when the agent should follow the environment-wide default.</li>
|
|
42
|
+
<li><strong>Local process:</strong> Runs workers on the AgentHub host. No separate runner setup is needed; CPU and memory overrides are not applied to local workers.</li>
|
|
43
|
+
<li><strong>Docker:</strong> Requires Docker access and an <code>AGENT_HUB_DOCKER_IMAGE</code> image. Remote workers also need PostgreSQL, a reachable HTTPS manager URL, and a public gateway URL. Configure networking and shared workspace storage when needed.</li>
|
|
44
|
+
<li><strong>Amazon ECS:</strong> Requires AWS access plus an ECS cluster, Fargate task definition, private subnet IDs, and security group IDs. The task definition must include the configured container (default: <code>agent</code>); remote workers also need PostgreSQL, an HTTPS manager URL, and a public gateway URL.</li>
|
|
45
|
+
<li><strong>Process limits:</strong> Minimum processes keep workers warm; maximum processes caps this agent’s worker pool. Blank maximum uses the installation default. CPU units and memory (MiB) are resource overrides for Docker and ECS; blank values use runner defaults.</li>
|
|
46
|
+
</ul>
|
|
47
|
+
<p>Runner and resource changes affect new workers. Restart workers to replace existing ones. Save with <strong>Save Agent</strong>; saving an active agent moves it to Draft, which must be activated to create the next config version.</p>
|
|
48
|
+
</aside>
|
|
49
|
+
</section>;
|
|
71
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentJobsInboxPage.d.ts","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/AgentJobsInboxPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AgentJobsInboxPage.d.ts","sourceRoot":"","sources":["../../../../../src/routes/pages/admin/core/AgentJobsInboxPage.tsx"],"names":[],"mappings":"AAyYA,wBAAgB,kBAAkB,4CA2OjC"}
|
|
@@ -54,11 +54,12 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
54
54
|
}
|
|
55
55
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
56
56
|
};
|
|
57
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
57
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
58
58
|
import React from "react";
|
|
59
|
-
import {
|
|
59
|
+
import { Filter, Inbox as InboxIcon, List, RefreshCw } from "lucide-react";
|
|
60
60
|
import { useSearchParams } from "react-router-dom";
|
|
61
|
-
import { SolidButton,
|
|
61
|
+
import { SolidButton, SolidDialog, SolidDialogBody, SolidSelect } from "../../../../components/shad-cn-ui";
|
|
62
|
+
import { Column, SolidDataTable } from "../../../../components/core/list/SolidDataTable";
|
|
62
63
|
import { historyToItems, isSameAssistantContent } from "../../../../components/core/solid-agent/agentEvents";
|
|
63
64
|
import { resolveAttachmentMedia } from "../../../../components/core/solid-agent/client/agentAttachmentMedia";
|
|
64
65
|
import { AgentComposer } from "../../../../components/core/solid-agent/composer/AgentComposer";
|
|
@@ -81,7 +82,48 @@ function requestItems(requests, pendingId, submitting) {
|
|
|
81
82
|
});
|
|
82
83
|
}
|
|
83
84
|
var inboxPath = "/agent-session/inbox";
|
|
84
|
-
var
|
|
85
|
+
var initialPageSize = 25;
|
|
86
|
+
var pageSizeOptions = [10, 25, 50, 100];
|
|
87
|
+
var emptyFilters = { review: false, agent: "", status: "", trigger: "", runtime: "", startedFrom: "", startedTo: "" };
|
|
88
|
+
var statuses = ["queued", "running", "active", "awaiting_input", "awaiting_approval", "completed", "failed", "cancelled", "expired"];
|
|
89
|
+
var triggers = ["api", "webhook"];
|
|
90
|
+
var runtimes = ["solidx", "agentHub"];
|
|
91
|
+
var inboxFilterKeys = ["review", "agent", "status", "trigger", "runtime", "startedFrom", "startedTo"];
|
|
92
|
+
var sortOptions = [
|
|
93
|
+
{ label: "Recent activity", value: "last_active_desc" },
|
|
94
|
+
{ label: "Old activity", value: "last_active_asc" },
|
|
95
|
+
{ label: "Newly started", value: "started_desc" },
|
|
96
|
+
{ label: "Oldest started", value: "started_asc" },
|
|
97
|
+
{ label: "Agent A–Z", value: "agent_asc" },
|
|
98
|
+
];
|
|
99
|
+
var defaultSort = "last_active_desc";
|
|
100
|
+
function readInboxFilters(search) {
|
|
101
|
+
var _a, _b;
|
|
102
|
+
var params = new URLSearchParams(search);
|
|
103
|
+
var readOption = function (key, options) {
|
|
104
|
+
var _a;
|
|
105
|
+
var value = (_a = params.get(key)) !== null && _a !== void 0 ? _a : "";
|
|
106
|
+
return options.includes(value) ? value : "";
|
|
107
|
+
};
|
|
108
|
+
var readDate = function (key) {
|
|
109
|
+
var _a;
|
|
110
|
+
var value = (_a = params.get(key)) !== null && _a !== void 0 ? _a : "";
|
|
111
|
+
var timestamp = Date.parse(value);
|
|
112
|
+
return /^\d{4}-\d{2}-\d{2}$/.test(value) && Number.isFinite(timestamp)
|
|
113
|
+
&& new Date(timestamp).toISOString().slice(0, 10) === value ? value : "";
|
|
114
|
+
};
|
|
115
|
+
var startedFrom = readDate("startedFrom");
|
|
116
|
+
var startedTo = readDate("startedTo");
|
|
117
|
+
return {
|
|
118
|
+
review: params.get("review") === "true",
|
|
119
|
+
agent: (_b = (_a = params.get("agent")) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : "",
|
|
120
|
+
status: readOption("status", statuses),
|
|
121
|
+
trigger: readOption("trigger", triggers),
|
|
122
|
+
runtime: readOption("runtime", runtimes),
|
|
123
|
+
startedFrom: startedFrom,
|
|
124
|
+
startedTo: startedFrom && startedTo && startedTo < startedFrom ? "" : startedTo,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
85
127
|
var statusLabel = function (status) {
|
|
86
128
|
var _a;
|
|
87
129
|
return ((_a = {
|
|
@@ -131,22 +173,22 @@ function runFailureMessage(error) {
|
|
|
131
173
|
function OpenRun(_a) {
|
|
132
174
|
var _this = this;
|
|
133
175
|
var _b, _c, _d, _e, _f, _g, _h;
|
|
134
|
-
var run = _a.run, revision = _a.revision, onChange = _a.onChange;
|
|
176
|
+
var run = _a.run, revision = _a.revision, onChange = _a.onChange, _j = _a.hideHeader, hideHeader = _j === void 0 ? false : _j;
|
|
135
177
|
var path = "".concat(inboxPath, "/").concat(encodeURIComponent(run.sessionId));
|
|
136
|
-
var
|
|
137
|
-
var
|
|
138
|
-
var
|
|
139
|
-
var
|
|
140
|
-
var
|
|
141
|
-
var
|
|
142
|
-
var
|
|
143
|
-
var
|
|
144
|
-
var
|
|
178
|
+
var _k = React.useState(null), detail = _k[0], setDetail = _k[1];
|
|
179
|
+
var _l = React.useState([]), messages = _l[0], setMessages = _l[1];
|
|
180
|
+
var _m = React.useState([]), transcript = _m[0], setTranscript = _m[1];
|
|
181
|
+
var _o = React.useState(false), hasOlder = _o[0], setHasOlder = _o[1];
|
|
182
|
+
var _p = React.useState(false), loadingOlder = _p[0], setLoadingOlder = _p[1];
|
|
183
|
+
var _q = React.useState(""), answerError = _q[0], setAnswerError = _q[1];
|
|
184
|
+
var _r = React.useState(false), submitting = _r[0], setSubmitting = _r[1];
|
|
185
|
+
var _s = React.useState(false), resuming = _s[0], setResuming = _s[1];
|
|
186
|
+
var _t = React.useState(null), accepted = _t[0], setAccepted = _t[1];
|
|
145
187
|
var submitLock = React.useRef(false);
|
|
146
188
|
var acceptedId = React.useRef(undefined);
|
|
147
189
|
var historyPages = React.useRef(1);
|
|
148
|
-
var
|
|
149
|
-
var
|
|
190
|
+
var _u = React.useState(""), error = _u[0], setError = _u[1];
|
|
191
|
+
var _v = React.useState("Connecting"), connection = _v[0], setConnection = _v[1];
|
|
150
192
|
var read = React.useRef(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
151
193
|
return [2 /*return*/];
|
|
152
194
|
}); }); });
|
|
@@ -445,7 +487,7 @@ function OpenRun(_a) {
|
|
|
445
487
|
}
|
|
446
488
|
return result;
|
|
447
489
|
}, [accepted, detail, hasOlder, messages, request, requestId, run.lastActiveAt, submitting, transcript]);
|
|
448
|
-
return _jsxs("section", { className: styles.panel, "aria-label": "Selected run", children: [_jsx("header", { className: styles.runHeader, children: _jsxs("div", { children: [_jsx("h2", { children: (_g = run.agentTitle) !== null && _g !== void 0 ? _g : "Agent run" }), _jsxs("div", { className: styles.runMeta, children: [_jsx(RunStatus, { status: status, hasJob: hasJob }), canConnect && _jsx("span", { role: "status", children: connection })] })] }) }), _jsxs("div", { className: styles.runBody, children: [hasJob === false && _jsx("p", { className: styles.notice, children: "This session has no job for a worker to run." }), error && _jsx("p", { className: styles.notice, role: "alert", children: error }), runFailure && _jsx("p", { className: styles.notice, role: "alert", children: runFailure }), answerError && _jsx("p", { className: styles.notice, role: "alert", children: answerError }), _jsxs("div", { className: "".concat(chatStyles.root, " ").concat(styles.chat), children: [_jsx(AgentThread, { items: items, agentName: (_h = detail === null || detail === void 0 ? void 0 : detail.agentName) !== null && _h !== void 0 ? _h : undefined, thinking: resuming || status === "running" || status === "active", working: resuming || status === "running" || status === "active", hasMore: hasOlder, loadingOlder: loadingOlder, onLoadOlder: function () { return void loadOlder(); }, emptyState: _jsx("p", { className: styles.listMessage, children: "No messages yet." }), onReply: function (widgetId, widget, value) {
|
|
490
|
+
return _jsxs("section", { className: styles.panel, "aria-label": "Selected run", children: [!hideHeader && _jsx("header", { className: styles.runHeader, children: _jsxs("div", { children: [_jsx("h2", { children: (_g = run.agentTitle) !== null && _g !== void 0 ? _g : "Agent run" }), _jsxs("div", { className: styles.runMeta, children: [_jsx(RunStatus, { status: status, hasJob: hasJob }), canConnect && _jsx("span", { role: "status", children: connection })] })] }) }), _jsxs("div", { className: styles.runBody, children: [hasJob === false && _jsx("p", { className: styles.notice, children: "This session has no job for a worker to run." }), error && _jsx("p", { className: styles.notice, role: "alert", children: error }), runFailure && _jsx("p", { className: styles.notice, role: "alert", children: runFailure }), answerError && _jsx("p", { className: styles.notice, role: "alert", children: answerError }), _jsxs("div", { className: "".concat(chatStyles.root, " ").concat(styles.chat), children: [_jsx(AgentThread, { items: items, agentName: (_h = detail === null || detail === void 0 ? void 0 : detail.agentName) !== null && _h !== void 0 ? _h : undefined, thinking: resuming || status === "running" || status === "active", working: resuming || status === "running" || status === "active", hasMore: hasOlder, loadingOlder: loadingOlder, onLoadOlder: function () { return void loadOlder(); }, emptyState: _jsx("p", { className: styles.listMessage, children: "No messages yet." }), onReply: function (widgetId, widget, value) {
|
|
449
491
|
if (!request || widgetId !== humanReviewId(request.requestId) || widget !== "SolidQuestionChatWidget" && widget !== "question"
|
|
450
492
|
|| typeof value !== "string")
|
|
451
493
|
return;
|
|
@@ -454,16 +496,31 @@ function OpenRun(_a) {
|
|
|
454
496
|
}, onPrompt: ignoreAction }), request && _jsx(AgentComposer, { working: false, disabled: submitting, canAttach: false, commands: [], placeholder: request.kind === "approval" ? "Type Approve or Reject…" : "Type your answer…", onSend: sendText, onStop: ignoreAction }, request.requestId)] })] })] });
|
|
455
497
|
}
|
|
456
498
|
export function AgentJobsInboxPage() {
|
|
457
|
-
var _a
|
|
458
|
-
var
|
|
459
|
-
var
|
|
460
|
-
var
|
|
461
|
-
|
|
462
|
-
var
|
|
499
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
500
|
+
var _j = useSearchParams(), params = _j[0], setParams = _j[1];
|
|
501
|
+
var querySearch = (_b = (_a = params.get("q")) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : "";
|
|
502
|
+
var currentSort = sortOptions.some(function (option) { return option.value === params.get("sort"); })
|
|
503
|
+
? params.get("sort") : defaultSort;
|
|
504
|
+
var _k = React.useState(querySearch), searchText = _k[0], setSearchText = _k[1];
|
|
505
|
+
var filterSearch = new URLSearchParams(inboxFilterKeys.flatMap(function (key) { return params.has(key) ? [[key, params.get(key)]] : []; })).toString();
|
|
506
|
+
var filters = React.useMemo(function () { return readInboxFilters(filterSearch); }, [filterSearch]);
|
|
507
|
+
var _l = React.useState(emptyFilters), filterDraft = _l[0], setFilterDraft = _l[1];
|
|
508
|
+
var _m = React.useState(false), filterOpen = _m[0], setFilterOpen = _m[1];
|
|
509
|
+
var _o = React.useState("inbox"), layout = _o[0], setLayout = _o[1];
|
|
510
|
+
var _p = React.useState(0), offset = _p[0], setOffset = _p[1];
|
|
511
|
+
var _q = React.useState(initialPageSize), pageSize = _q[0], setPageSize = _q[1];
|
|
512
|
+
var _r = React.useState(null), inbox = _r[0], setInbox = _r[1];
|
|
513
|
+
var _s = React.useState(""), error = _s[0], setError = _s[1];
|
|
514
|
+
var _t = React.useState(0), revision = _t[0], setRevision = _t[1];
|
|
463
515
|
var refresh = React.useCallback(function () { return setRevision(function (current) { return current + 1; }); }, []);
|
|
464
516
|
var selectedId = params.get("run");
|
|
465
|
-
var
|
|
466
|
-
var
|
|
517
|
+
var _u = React.useState(), selected = _u[0], setSelected = _u[1];
|
|
518
|
+
var _v = React.useState(null), listSelected = _v[0], setListSelected = _v[1];
|
|
519
|
+
var _w = React.useState(""), selectionError = _w[0], setSelectionError = _w[1];
|
|
520
|
+
var appliedFilterCount = Object.entries(filters).filter(function (_a) {
|
|
521
|
+
var key = _a[0], value = _a[1];
|
|
522
|
+
return key !== "review" && Boolean(value);
|
|
523
|
+
}).length;
|
|
467
524
|
var visibleRun = inbox === null || inbox === void 0 ? void 0 : inbox.runs.find(function (run) { return run.sessionId === selectedId; });
|
|
468
525
|
var open = visibleRun !== null && visibleRun !== void 0 ? visibleRun : ((selected === null || selected === void 0 ? void 0 : selected.sessionId) === selectedId ? selected : null);
|
|
469
526
|
React.useEffect(function () {
|
|
@@ -485,6 +542,24 @@ export function AgentJobsInboxPage() {
|
|
|
485
542
|
setSelectionError(errorMessage(error, "Could not open the run.")); });
|
|
486
543
|
return function () { return abort.abort(); };
|
|
487
544
|
}, [selectedId, visibleRun]);
|
|
545
|
+
React.useEffect(function () {
|
|
546
|
+
setSearchText(querySearch);
|
|
547
|
+
}, [querySearch]);
|
|
548
|
+
React.useEffect(function () {
|
|
549
|
+
var nextSearch = searchText.trim();
|
|
550
|
+
if (nextSearch === querySearch)
|
|
551
|
+
return;
|
|
552
|
+
var timer = window.setTimeout(function () {
|
|
553
|
+
var nextParams = new URLSearchParams(params);
|
|
554
|
+
if (nextSearch)
|
|
555
|
+
nextParams.set("q", nextSearch);
|
|
556
|
+
else
|
|
557
|
+
nextParams.delete("q");
|
|
558
|
+
setParams(nextParams, { replace: true });
|
|
559
|
+
setOffset(0);
|
|
560
|
+
}, 300);
|
|
561
|
+
return function () { return window.clearTimeout(timer); };
|
|
562
|
+
}, [querySearch, searchText, params, setParams]);
|
|
488
563
|
React.useEffect(function () {
|
|
489
564
|
var abort = new AbortController();
|
|
490
565
|
var reading = false;
|
|
@@ -501,7 +576,7 @@ export function AgentJobsInboxPage() {
|
|
|
501
576
|
case 1:
|
|
502
577
|
_a.trys.push([1, 3, 4, 5]);
|
|
503
578
|
return [4 /*yield*/, solidAxios.get(inboxPath, {
|
|
504
|
-
params: { review: review, offset: offset }, signal: abort.signal,
|
|
579
|
+
params: __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ review: filters.review, offset: offset, limit: pageSize }, (querySearch ? { q: querySearch } : {})), { sort: currentSort }), (filters.agent ? { agent: filters.agent } : {})), (filters.status ? { status: filters.status } : {})), (filters.trigger ? { trigger: filters.trigger } : {})), (filters.runtime ? { runtime: filters.runtime } : {})), (filters.startedFrom ? { startedFrom: filters.startedFrom } : {})), (filters.startedTo ? { startedTo: filters.startedTo } : {})), signal: abort.signal,
|
|
505
580
|
})];
|
|
506
581
|
case 2:
|
|
507
582
|
response = _a.sent();
|
|
@@ -526,14 +601,62 @@ export function AgentJobsInboxPage() {
|
|
|
526
601
|
void list();
|
|
527
602
|
var poll = window.setInterval(function () { return void list(); }, 10000);
|
|
528
603
|
return function () { abort.abort(); window.clearInterval(poll); };
|
|
529
|
-
}, [offset,
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
604
|
+
}, [offset, pageSize, filters, querySearch, currentSort, revision]);
|
|
605
|
+
var updateFilters = function (next) {
|
|
606
|
+
var nextParams = new URLSearchParams(params);
|
|
607
|
+
for (var _i = 0, inboxFilterKeys_1 = inboxFilterKeys; _i < inboxFilterKeys_1.length; _i++) {
|
|
608
|
+
var key = inboxFilterKeys_1[_i];
|
|
609
|
+
if (next[key])
|
|
610
|
+
nextParams.set(key, String(next[key]));
|
|
611
|
+
else
|
|
612
|
+
nextParams.delete(key);
|
|
613
|
+
}
|
|
614
|
+
setParams(nextParams, { replace: true });
|
|
615
|
+
setOffset(0);
|
|
616
|
+
setFilterOpen(false);
|
|
617
|
+
};
|
|
618
|
+
var applyFilters = function (event) {
|
|
619
|
+
event.preventDefault();
|
|
620
|
+
if (filterDraft.startedFrom && filterDraft.startedTo && filterDraft.startedFrom > filterDraft.startedTo)
|
|
621
|
+
return;
|
|
622
|
+
updateFilters(__assign(__assign({}, filterDraft), { agent: filterDraft.agent.trim() }));
|
|
623
|
+
};
|
|
624
|
+
var clearFilters = function () {
|
|
625
|
+
setFilterDraft(emptyFilters);
|
|
626
|
+
updateFilters(emptyFilters);
|
|
627
|
+
};
|
|
628
|
+
var handlePage = function (event) { setOffset(event.first); setPageSize(event.rows); };
|
|
629
|
+
var toggleReview = function () { return updateFilters(__assign(__assign({}, filters), { review: !filters.review })); };
|
|
630
|
+
var changeSort = function (sort) {
|
|
631
|
+
var nextParams = new URLSearchParams(params);
|
|
632
|
+
if (sort === defaultSort)
|
|
633
|
+
nextParams.delete("sort");
|
|
634
|
+
else
|
|
635
|
+
nextParams.set("sort", sort);
|
|
636
|
+
setParams(nextParams, { replace: true });
|
|
637
|
+
setOffset(0);
|
|
638
|
+
};
|
|
639
|
+
var selectRun = function (sessionId) {
|
|
640
|
+
var nextParams = new URLSearchParams(params);
|
|
641
|
+
nextParams.set("run", sessionId);
|
|
642
|
+
setParams(nextParams);
|
|
643
|
+
};
|
|
644
|
+
var first = (inbox === null || inbox === void 0 ? void 0 : inbox.total) ? offset + 1 : 0;
|
|
645
|
+
var last = inbox ? Math.min(offset + pageSize, inbox.total) : 0;
|
|
646
|
+
var reviewCountOnPage = (_c = inbox === null || inbox === void 0 ? void 0 : inbox.runs.filter(function (run) { return ["awaiting_input", "awaiting_approval"].includes(run.status); }).length) !== null && _c !== void 0 ? _c : 0;
|
|
647
|
+
return _jsxs("main", { className: styles.inbox, children: [_jsxs("header", { className: "page-header solid-list-toolbar ".concat(styles.toolbar), children: [_jsx("label", { className: styles.search, "aria-label": "Search runs", children: _jsx("input", { type: "search", value: searchText, onChange: function (event) { return setSearchText(event.currentTarget.value); }, placeholder: "Search agent, session ID, or status" }) }), _jsxs("div", { className: "solid-list-toolbar-actions", children: [_jsx(SolidButton, { variant: "secondary", size: "sm", leftIcon: _jsx(RefreshCw, { size: 16 }), onClick: refresh, "aria-label": "Refresh inbox", title: "Refresh inbox" }), _jsxs("span", { className: styles.filterAction, children: [_jsx(SolidButton, { variant: "secondary", size: "sm", leftIcon: _jsx(Filter, { size: 16 }), onClick: function () { setFilterDraft(filters); setFilterOpen(true); }, "aria-label": appliedFilterCount ? "Filters, ".concat(appliedFilterCount, " applied") : "Filters", title: "Filter runs" }), appliedFilterCount > 0 && _jsx("span", { className: styles.filterCount, "aria-hidden": "true", children: appliedFilterCount })] }), _jsx(SolidButton, { variant: "secondary", size: "sm", leftIcon: layout === "inbox" ? _jsx(List, { size: 16 }) : _jsx(InboxIcon, { size: 16 }), onClick: function () { return setLayout(function (current) { return current === "inbox" ? "list" : "inbox"; }); }, "aria-label": layout === "inbox" ? "Switch to list view" : "Switch to inbox view", title: layout === "inbox" ? "Switch to list view" : "Switch to inbox view" })] })] }), error && _jsx("p", { className: styles.notice, role: "alert", children: error }), layout === "inbox" ? _jsxs("div", { className: styles.columns, children: [_jsxs("section", { className: styles.panel, "aria-label": "Background runs", children: [_jsxs("div", { className: styles.listHeader, children: [_jsxs("div", { className: styles.listHeaderTitle, children: [_jsx("strong", { children: "Runs" }), _jsx("span", { children: (_d = inbox === null || inbox === void 0 ? void 0 : inbox.total) !== null && _d !== void 0 ? _d : 0 })] }), _jsxs("div", { className: styles.listHeaderControls, children: [_jsx(SolidButton, { size: "sm", variant: filters.review ? "primary" : "secondary", "aria-pressed": filters.review, className: filters.review ? styles.reviewToggleActive : styles.reviewToggle, onClick: toggleReview, children: "Needs review" }), _jsxs("label", { className: styles.sortLabel, children: [_jsx("span", { children: "Sort" }), _jsx(SolidSelect, { value: currentSort, onChange: function (event) { return changeSort(event.value); }, className: styles.sortSelect, options: sortOptions, native: false, menuPlacement: "bottom" })] })] })] }), _jsxs("div", { className: styles.listScroll, children: [!inbox && !error && _jsx("p", { className: styles.listMessage, role: "status", children: "Loading runs\u2026" }), (inbox === null || inbox === void 0 ? void 0 : inbox.runs.length) === 0 && _jsx("p", { className: styles.listMessage, children: filters.review ? "No runs need your review." : "No background runs match these filters." }), inbox === null || inbox === void 0 ? void 0 : inbox.runs.map(function (run) {
|
|
534
648
|
var _a;
|
|
535
|
-
return _jsxs("button", { type: "button", "aria-pressed": selectedId === run.sessionId, className: styles.row, onClick: function () { return
|
|
536
|
-
})] }), (
|
|
537
|
-
: _jsxs("div", { className: "".concat(styles.panel, " ").concat(styles.empty), children: [_jsx(InboxIcon, { size: 22, "aria-hidden": "true" }), _jsx("p", { role: selectionError ? "alert" : "status", children: selectionError || (selectedId ? "
|
|
649
|
+
return _jsxs("button", { type: "button", "aria-pressed": selectedId === run.sessionId, className: styles.row, onClick: function () { return selectRun(run.sessionId); }, children: [_jsxs("span", { className: styles.rowHeading, children: [_jsx("strong", { children: (_a = run.agentTitle) !== null && _a !== void 0 ? _a : "Agent run" }), _jsxs("span", { className: styles.runId, children: ["Run #", run.id] })] }), _jsxs("span", { className: styles.runMeta, children: [_jsx(RunStatus, { status: run.status, hasJob: run.hasJob }), _jsxs("span", { children: ["Last active ", _jsx("time", { dateTime: run.lastActiveAt, children: new Date(run.lastActiveAt).toLocaleString() })] })] })] }, run.sessionId);
|
|
650
|
+
})] }), _jsxs("div", { className: "solid-table-paginator solid-table-paginator-align-end flex items-center justify-end gap-3 text-sm rounded-md border border-border/60 px-2 sm:px-3 py-1.5 bg-background", children: [_jsxs("div", { className: "solid-paginator-meta flex items-center gap-2 sm:ml-auto", children: [_jsx("span", { className: "solid-paginator-label", children: "Rows" }), _jsx(SolidSelect, { value: pageSize, onChange: function (event) { return handlePage({ first: 0, rows: Number(event.value) }); }, className: "solid-paginator-select", options: pageSizeOptions.map(function (rows) { return ({ label: String(rows), value: rows }); }), native: false, menuPlacement: "top" }), _jsxs("span", { className: "solid-paginator-report", children: [first, "\u2013", last, " of ", (_e = inbox === null || inbox === void 0 ? void 0 : inbox.total) !== null && _e !== void 0 ? _e : 0] })] }), _jsxs("div", { className: "solid-paginator-actions flex items-center gap-2", children: [_jsx("button", { type: "button", className: "solid-paginator-btn", disabled: offset === 0, onClick: function () { return setOffset(Math.max(0, offset - pageSize)); }, children: "Previous" }), _jsx("button", { type: "button", className: "solid-paginator-btn", disabled: !(inbox === null || inbox === void 0 ? void 0 : inbox.hasMore), onClick: function () { return setOffset(offset + pageSize); }, children: "Next" })] })] })] }), open ? _jsx(OpenRun, { run: open, revision: revision, onChange: refresh }, open.sessionId)
|
|
651
|
+
: _jsxs("div", { className: "".concat(styles.panel, " ").concat(styles.empty), children: [_jsx(InboxIcon, { size: 22, "aria-hidden": "true" }), _jsx("strong", { children: selectionError ? "Could not open run" : selectedId ? "Opening run…" : "Choose a run" }), _jsx("p", { role: selectionError ? "alert" : "status", children: selectionError || (selectedId ? "Loading its latest messages and status." : "Select a run to see its messages, progress, and pending requests.") }), inbox && _jsxs("span", { className: styles.reviewSummary, children: [reviewCountOnPage, " run", reviewCountOnPage === 1 ? "" : "s", " awaiting input or approval on this page"] })] })] }) : _jsxs("section", { className: "".concat(styles.panel, " ").concat(styles.tablePanel), "aria-label": "Background runs list", style: { flexDirection: "column" }, children: [_jsxs("div", { className: styles.tableControls, children: [_jsx(SolidButton, { size: "sm", variant: filters.review ? "primary" : "secondary", "aria-pressed": filters.review, className: filters.review ? styles.reviewToggleActive : styles.reviewToggle, onClick: toggleReview, children: "Needs review" }), _jsxs("label", { className: styles.sortLabel, children: [_jsx("span", { children: "Sort" }), _jsx(SolidSelect, { value: currentSort, onChange: function (event) { return changeSort(event.value); }, className: styles.sortSelect, options: sortOptions, native: false, menuPlacement: "bottom" })] })] }), _jsx("div", { className: "solid-datatable-wrapper solid-list-table-area min-h-0 flex-1 overflow-hidden", children: _jsxs(SolidDataTable, { value: (_f = inbox === null || inbox === void 0 ? void 0 : inbox.runs) !== null && _f !== void 0 ? _f : [], dataKey: "sessionId", rows: pageSize, first: offset, totalRecords: (_g = inbox === null || inbox === void 0 ? void 0 : inbox.total) !== null && _g !== void 0 ? _g : 0, rowsPerPageOptions: pageSizeOptions, onPage: handlePage, onRowClick: function (_a) {
|
|
652
|
+
var data = _a.data;
|
|
653
|
+
return setListSelected(data);
|
|
654
|
+
}, rowClassName: function () { return styles.tableRow; }, emptyMessage: error || (filters.review ? "No runs need your review." : "No background runs match these filters."), children: [_jsx(Column, { field: "agentTitle", header: "Agent" }), _jsx(Column, { field: "status", header: "Status", body: function (run) { return _jsx(RunStatus, { status: run.status, hasJob: run.hasJob }); } }), _jsx(Column, { field: "trigger", header: "Trigger" }), _jsx(Column, { field: "runtime", header: "Runtime", body: function (run) { var _a; return (_a = run.runtime) !== null && _a !== void 0 ? _a : "Unknown"; } }), _jsx(Column, { field: "startedAt", header: "Started", body: function (run) { return run.startedAt ? new Date(run.startedAt).toLocaleString() : "—"; } }), _jsx(Column, { field: "lastActiveAt", header: "Last active", body: function (run) { return new Date(run.lastActiveAt).toLocaleString(); } }), _jsx(Column, { field: "turnCount", header: "Turns" }), _jsx(Column, { field: "totalCost", header: "Cost", body: function (run) { return typeof run.totalCost === "number" ? run.totalCost.toFixed(4) : "—"; } })] }) })] }), _jsx(SolidDialog, { className: styles.filterDialog, open: filterOpen, onOpenChange: setFilterOpen, header: "Filter runs", style: { width: "min(30rem, 94vw)" }, footer: _jsxs(_Fragment, { children: [_jsx(SolidButton, { variant: "ghost", onClick: clearFilters, children: "Clear filters" }), _jsx(SolidButton, { variant: "primary", type: "submit", form: "agent-inbox-filter-form", children: "Apply filters" })] }), children: _jsx(SolidDialogBody, { children: _jsxs("form", { id: "agent-inbox-filter-form", className: styles.filterForm, onSubmit: applyFilters, children: [_jsxs("label", { children: ["Agent name", _jsx("input", { value: filterDraft.agent, onChange: function (event) { return setFilterDraft(function (value) { return (__assign(__assign({}, value), { agent: event.currentTarget.value })); }); }, placeholder: "Search agent" })] }), _jsxs("label", { children: ["Status", _jsx(SelectFilter, { value: filterDraft.status, onChange: function (status) { return setFilterDraft(function (value) { return (__assign(__assign({}, value), { status: status })); }); }, options: statuses })] }), _jsxs("label", { children: ["Trigger", _jsx(SelectFilter, { value: filterDraft.trigger, onChange: function (trigger) { return setFilterDraft(function (value) { return (__assign(__assign({}, value), { trigger: trigger })); }); }, options: triggers })] }), _jsxs("label", { children: ["Runtime", _jsx(SelectFilter, { value: filterDraft.runtime, onChange: function (runtime) { return setFilterDraft(function (value) { return (__assign(__assign({}, value), { runtime: runtime })); }); }, options: runtimes })] }), _jsxs("label", { children: ["Started from", _jsx("input", { type: "date", value: filterDraft.startedFrom, onChange: function (event) { return setFilterDraft(function (value) { return (__assign(__assign({}, value), { startedFrom: event.currentTarget.value })); }); } })] }), _jsxs("label", { children: ["Started to", _jsx("input", { type: "date", value: filterDraft.startedTo, onChange: function (event) { return setFilterDraft(function (value) { return (__assign(__assign({}, value), { startedTo: event.currentTarget.value })); }); } })] }), filterDraft.startedFrom && filterDraft.startedTo && filterDraft.startedFrom > filterDraft.startedTo &&
|
|
655
|
+
_jsx("span", { className: styles.filterError, role: "alert", children: "Start date must be on or before end date." })] }) }) }), _jsx(SolidDialog, { open: Boolean(listSelected), onOpenChange: function (open) { if (!open)
|
|
656
|
+
setListSelected(null); }, ariaLabel: "Run conversation", header: (_h = listSelected === null || listSelected === void 0 ? void 0 : listSelected.agentTitle) !== null && _h !== void 0 ? _h : "Run conversation", className: styles.runDetailDialog, style: { width: "min(78rem, 96vw)", maxHeight: "92dvh", overflowY: "auto" }, children: _jsx(SolidDialogBody, { className: styles.detailDialogBody, children: listSelected && _jsx(OpenRun, { run: listSelected, revision: revision, onChange: refresh, hideHeader: true }, listSelected.sessionId) }) })] });
|
|
657
|
+
}
|
|
658
|
+
function SelectFilter(_a) {
|
|
659
|
+
var value = _a.value, options = _a.options, onChange = _a.onChange;
|
|
660
|
+
return _jsx(SolidSelect, { value: value, onChange: function (event) { return onChange(event.value); }, options: __spreadArray([{ label: "All", value: "" }], options.map(function (option) { return ({ label: option.replaceAll("_", " "), value: option }); }), true) });
|
|
538
661
|
}
|
|
539
662
|
//# sourceMappingURL=AgentJobsInboxPage.js.map
|