@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,249 +1,8 @@
|
|
|
1
|
-
// src/ui/modals/
|
|
1
|
+
// src/ui/modals/AgentActionsModal.tsx
|
|
2
|
+
import { Button } from "@contractspec/lib.design-system";
|
|
2
3
|
import { useState } from "react";
|
|
3
|
-
import { Button, Input } from "@contractspec/lib.design-system";
|
|
4
4
|
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
5
5
|
"use client";
|
|
6
|
-
var MODEL_PROVIDERS = [
|
|
7
|
-
{
|
|
8
|
-
value: "openai",
|
|
9
|
-
label: "OpenAI",
|
|
10
|
-
models: ["gpt-5.4", "gpt-5-mini", "gpt-4o", "gpt-4-turbo", "gpt-3.5-turbo"]
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
value: "anthropic",
|
|
14
|
-
label: "Anthropic",
|
|
15
|
-
models: ["claude-sonnet-4-6", "claude-opus-4-6", "claude-haiku-4-5"]
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
value: "google",
|
|
19
|
-
label: "Google",
|
|
20
|
-
models: [
|
|
21
|
-
"gemini-2.5-flash",
|
|
22
|
-
"gemini-2.5-pro",
|
|
23
|
-
"gemini-pro",
|
|
24
|
-
"gemini-ultra"
|
|
25
|
-
]
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
value: "mistral",
|
|
29
|
-
label: "Mistral",
|
|
30
|
-
models: [
|
|
31
|
-
"mistral-large-2512",
|
|
32
|
-
"mistral-large-latest",
|
|
33
|
-
"mistral-medium-latest",
|
|
34
|
-
"mistral-small-latest"
|
|
35
|
-
]
|
|
36
|
-
}
|
|
37
|
-
];
|
|
38
|
-
function CreateAgentModal({
|
|
39
|
-
isOpen,
|
|
40
|
-
onClose,
|
|
41
|
-
onSubmit,
|
|
42
|
-
isLoading = false
|
|
43
|
-
}) {
|
|
44
|
-
const [name, setName] = useState("");
|
|
45
|
-
const [description, setDescription] = useState("");
|
|
46
|
-
const [modelProvider, setModelProvider] = useState("openai");
|
|
47
|
-
const [modelName, setModelName] = useState("gpt-5.4");
|
|
48
|
-
const [systemPrompt, setSystemPrompt] = useState("");
|
|
49
|
-
const [error, setError] = useState(null);
|
|
50
|
-
const selectedProvider = MODEL_PROVIDERS.find((p) => p.value === modelProvider);
|
|
51
|
-
const handleSubmit = async (e) => {
|
|
52
|
-
e.preventDefault();
|
|
53
|
-
setError(null);
|
|
54
|
-
if (!name.trim()) {
|
|
55
|
-
setError("Agent name is required");
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
try {
|
|
59
|
-
await onSubmit({
|
|
60
|
-
name: name.trim(),
|
|
61
|
-
description: description.trim() || undefined,
|
|
62
|
-
modelProvider,
|
|
63
|
-
modelName,
|
|
64
|
-
systemPrompt: systemPrompt.trim() || undefined
|
|
65
|
-
});
|
|
66
|
-
setName("");
|
|
67
|
-
setDescription("");
|
|
68
|
-
setModelProvider("openai");
|
|
69
|
-
setModelName("gpt-5.4");
|
|
70
|
-
setSystemPrompt("");
|
|
71
|
-
onClose();
|
|
72
|
-
} catch (err) {
|
|
73
|
-
setError(err instanceof Error ? err.message : "Failed to create agent");
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
const handleProviderChange = (provider) => {
|
|
77
|
-
setModelProvider(provider);
|
|
78
|
-
const providerConfig = MODEL_PROVIDERS.find((p) => p.value === provider);
|
|
79
|
-
if (providerConfig) {
|
|
80
|
-
setModelName(providerConfig.models[0]);
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
if (!isOpen)
|
|
84
|
-
return null;
|
|
85
|
-
return /* @__PURE__ */ jsxDEV("div", {
|
|
86
|
-
className: "fixed inset-0 z-50 flex items-center justify-center",
|
|
87
|
-
children: [
|
|
88
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
89
|
-
className: "bg-background/80 absolute inset-0 backdrop-blur-sm",
|
|
90
|
-
onClick: onClose,
|
|
91
|
-
role: "button",
|
|
92
|
-
tabIndex: 0,
|
|
93
|
-
onKeyDown: (e) => {
|
|
94
|
-
if (e.key === "Enter" || e.key === " ")
|
|
95
|
-
onClose();
|
|
96
|
-
},
|
|
97
|
-
"aria-label": "Close modal"
|
|
98
|
-
}, undefined, false, undefined, this),
|
|
99
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
100
|
-
className: "bg-card border-border relative z-10 max-h-[90vh] w-full max-w-lg overflow-y-auto rounded-xl border p-6 shadow-xl",
|
|
101
|
-
children: [
|
|
102
|
-
/* @__PURE__ */ jsxDEV("h2", {
|
|
103
|
-
className: "mb-4 text-xl font-semibold",
|
|
104
|
-
children: "Create New Agent"
|
|
105
|
-
}, undefined, false, undefined, this),
|
|
106
|
-
/* @__PURE__ */ jsxDEV("form", {
|
|
107
|
-
onSubmit: handleSubmit,
|
|
108
|
-
className: "space-y-4",
|
|
109
|
-
children: [
|
|
110
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
111
|
-
children: [
|
|
112
|
-
/* @__PURE__ */ jsxDEV("label", {
|
|
113
|
-
htmlFor: "agent-name",
|
|
114
|
-
className: "text-muted-foreground mb-1 block text-sm font-medium",
|
|
115
|
-
children: "Agent Name *"
|
|
116
|
-
}, undefined, false, undefined, this),
|
|
117
|
-
/* @__PURE__ */ jsxDEV(Input, {
|
|
118
|
-
id: "agent-name",
|
|
119
|
-
value: name,
|
|
120
|
-
onChange: (e) => setName(e.target.value),
|
|
121
|
-
placeholder: "e.g., Customer Support Bot",
|
|
122
|
-
disabled: isLoading
|
|
123
|
-
}, undefined, false, undefined, this)
|
|
124
|
-
]
|
|
125
|
-
}, undefined, true, undefined, this),
|
|
126
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
127
|
-
children: [
|
|
128
|
-
/* @__PURE__ */ jsxDEV("label", {
|
|
129
|
-
htmlFor: "agent-description",
|
|
130
|
-
className: "text-muted-foreground mb-1 block text-sm font-medium",
|
|
131
|
-
children: "Description"
|
|
132
|
-
}, undefined, false, undefined, this),
|
|
133
|
-
/* @__PURE__ */ jsxDEV("textarea", {
|
|
134
|
-
id: "agent-description",
|
|
135
|
-
value: description,
|
|
136
|
-
onChange: (e) => setDescription(e.target.value),
|
|
137
|
-
placeholder: "Describe what this agent does...",
|
|
138
|
-
rows: 2,
|
|
139
|
-
disabled: isLoading,
|
|
140
|
-
className: "border-input bg-background focus:ring-ring w-full rounded-md border px-3 py-2 text-sm focus:ring-2 focus:outline-none disabled:opacity-50"
|
|
141
|
-
}, undefined, false, undefined, this)
|
|
142
|
-
]
|
|
143
|
-
}, undefined, true, undefined, this),
|
|
144
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
145
|
-
className: "flex gap-3",
|
|
146
|
-
children: [
|
|
147
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
148
|
-
className: "flex-1",
|
|
149
|
-
children: [
|
|
150
|
-
/* @__PURE__ */ jsxDEV("label", {
|
|
151
|
-
htmlFor: "model-provider",
|
|
152
|
-
className: "text-muted-foreground mb-1 block text-sm font-medium",
|
|
153
|
-
children: "Provider *"
|
|
154
|
-
}, undefined, false, undefined, this),
|
|
155
|
-
/* @__PURE__ */ jsxDEV("select", {
|
|
156
|
-
id: "model-provider",
|
|
157
|
-
value: modelProvider,
|
|
158
|
-
onChange: (e) => handleProviderChange(e.target.value),
|
|
159
|
-
disabled: isLoading,
|
|
160
|
-
className: "border-input bg-background focus:ring-ring h-10 w-full rounded-md border px-3 py-2 text-sm focus:ring-2 focus:outline-none disabled:opacity-50",
|
|
161
|
-
children: MODEL_PROVIDERS.map((p) => /* @__PURE__ */ jsxDEV("option", {
|
|
162
|
-
value: p.value,
|
|
163
|
-
children: p.label
|
|
164
|
-
}, p.value, false, undefined, this))
|
|
165
|
-
}, undefined, false, undefined, this)
|
|
166
|
-
]
|
|
167
|
-
}, undefined, true, undefined, this),
|
|
168
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
169
|
-
className: "flex-1",
|
|
170
|
-
children: [
|
|
171
|
-
/* @__PURE__ */ jsxDEV("label", {
|
|
172
|
-
htmlFor: "model-name",
|
|
173
|
-
className: "text-muted-foreground mb-1 block text-sm font-medium",
|
|
174
|
-
children: "Model *"
|
|
175
|
-
}, undefined, false, undefined, this),
|
|
176
|
-
/* @__PURE__ */ jsxDEV("select", {
|
|
177
|
-
id: "model-name",
|
|
178
|
-
value: modelName,
|
|
179
|
-
onChange: (e) => setModelName(e.target.value),
|
|
180
|
-
disabled: isLoading,
|
|
181
|
-
className: "border-input bg-background focus:ring-ring h-10 w-full rounded-md border px-3 py-2 text-sm focus:ring-2 focus:outline-none disabled:opacity-50",
|
|
182
|
-
children: selectedProvider?.models.map((m) => /* @__PURE__ */ jsxDEV("option", {
|
|
183
|
-
value: m,
|
|
184
|
-
children: m
|
|
185
|
-
}, m, false, undefined, this))
|
|
186
|
-
}, undefined, false, undefined, this)
|
|
187
|
-
]
|
|
188
|
-
}, undefined, true, undefined, this)
|
|
189
|
-
]
|
|
190
|
-
}, undefined, true, undefined, this),
|
|
191
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
192
|
-
children: [
|
|
193
|
-
/* @__PURE__ */ jsxDEV("label", {
|
|
194
|
-
htmlFor: "system-prompt",
|
|
195
|
-
className: "text-muted-foreground mb-1 block text-sm font-medium",
|
|
196
|
-
children: "System Prompt"
|
|
197
|
-
}, undefined, false, undefined, this),
|
|
198
|
-
/* @__PURE__ */ jsxDEV("textarea", {
|
|
199
|
-
id: "system-prompt",
|
|
200
|
-
value: systemPrompt,
|
|
201
|
-
onChange: (e) => setSystemPrompt(e.target.value),
|
|
202
|
-
placeholder: "You are a helpful assistant that...",
|
|
203
|
-
rows: 4,
|
|
204
|
-
disabled: isLoading,
|
|
205
|
-
className: "border-input bg-background focus:ring-ring w-full rounded-md border px-3 py-2 font-mono text-sm focus:ring-2 focus:outline-none disabled:opacity-50"
|
|
206
|
-
}, undefined, false, undefined, this),
|
|
207
|
-
/* @__PURE__ */ jsxDEV("p", {
|
|
208
|
-
className: "text-muted-foreground mt-1 text-xs",
|
|
209
|
-
children: "Instructions that define the agent's behavior"
|
|
210
|
-
}, undefined, false, undefined, this)
|
|
211
|
-
]
|
|
212
|
-
}, undefined, true, undefined, this),
|
|
213
|
-
error && /* @__PURE__ */ jsxDEV("div", {
|
|
214
|
-
className: "bg-destructive/10 text-destructive rounded-md p-3 text-sm",
|
|
215
|
-
children: error
|
|
216
|
-
}, undefined, false, undefined, this),
|
|
217
|
-
/* @__PURE__ */ jsxDEV("div", {
|
|
218
|
-
className: "flex justify-end gap-3 pt-2",
|
|
219
|
-
children: [
|
|
220
|
-
/* @__PURE__ */ jsxDEV(Button, {
|
|
221
|
-
type: "button",
|
|
222
|
-
variant: "ghost",
|
|
223
|
-
onPress: onClose,
|
|
224
|
-
disabled: isLoading,
|
|
225
|
-
children: "Cancel"
|
|
226
|
-
}, undefined, false, undefined, this),
|
|
227
|
-
/* @__PURE__ */ jsxDEV(Button, {
|
|
228
|
-
type: "submit",
|
|
229
|
-
disabled: isLoading,
|
|
230
|
-
children: isLoading ? "Creating..." : "Create Agent"
|
|
231
|
-
}, undefined, false, undefined, this)
|
|
232
|
-
]
|
|
233
|
-
}, undefined, true, undefined, this)
|
|
234
|
-
]
|
|
235
|
-
}, undefined, true, undefined, this)
|
|
236
|
-
]
|
|
237
|
-
}, undefined, true, undefined, this)
|
|
238
|
-
]
|
|
239
|
-
}, undefined, true, undefined, this);
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
// src/ui/modals/AgentActionsModal.tsx
|
|
243
|
-
import { useState as useState2 } from "react";
|
|
244
|
-
import { Button as Button2 } from "@contractspec/lib.design-system";
|
|
245
|
-
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
246
|
-
"use client";
|
|
247
6
|
function getStatusColor(status) {
|
|
248
7
|
switch (status) {
|
|
249
8
|
case "ACTIVE":
|
|
@@ -268,10 +27,10 @@ function AgentActionsModal({
|
|
|
268
27
|
onExecute,
|
|
269
28
|
isLoading = false
|
|
270
29
|
}) {
|
|
271
|
-
const [mode, setMode] =
|
|
272
|
-
const [message, setMessage] =
|
|
273
|
-
const [confirmAction, setConfirmAction] =
|
|
274
|
-
const [error, setError] =
|
|
30
|
+
const [mode, setMode] = useState("menu");
|
|
31
|
+
const [message, setMessage] = useState("");
|
|
32
|
+
const [confirmAction, setConfirmAction] = useState(null);
|
|
33
|
+
const [error, setError] = useState(null);
|
|
275
34
|
const resetForm = () => {
|
|
276
35
|
setMode("menu");
|
|
277
36
|
setMessage("");
|
|
@@ -320,11 +79,11 @@ function AgentActionsModal({
|
|
|
320
79
|
};
|
|
321
80
|
if (!isOpen || !agent)
|
|
322
81
|
return null;
|
|
323
|
-
return /* @__PURE__ */
|
|
82
|
+
return /* @__PURE__ */ jsxDEV("div", {
|
|
324
83
|
className: "fixed inset-0 z-50 flex items-center justify-center",
|
|
325
84
|
children: [
|
|
326
|
-
/* @__PURE__ */
|
|
327
|
-
className: "bg-background/80
|
|
85
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
86
|
+
className: "absolute inset-0 bg-background/80 backdrop-blur-sm",
|
|
328
87
|
onClick: handleClose,
|
|
329
88
|
role: "button",
|
|
330
89
|
tabIndex: 0,
|
|
@@ -334,20 +93,20 @@ function AgentActionsModal({
|
|
|
334
93
|
},
|
|
335
94
|
"aria-label": "Close modal"
|
|
336
95
|
}, undefined, false, undefined, this),
|
|
337
|
-
/* @__PURE__ */
|
|
338
|
-
className: "
|
|
96
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
97
|
+
className: "relative z-10 w-full max-w-md rounded-xl border border-border bg-card p-6 shadow-xl",
|
|
339
98
|
children: [
|
|
340
|
-
/* @__PURE__ */
|
|
341
|
-
className: "
|
|
99
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
100
|
+
className: "mb-4 border-border border-b pb-4",
|
|
342
101
|
children: [
|
|
343
|
-
/* @__PURE__ */
|
|
344
|
-
className: "text-xl
|
|
102
|
+
/* @__PURE__ */ jsxDEV("h2", {
|
|
103
|
+
className: "font-semibold text-xl",
|
|
345
104
|
children: agent.name
|
|
346
105
|
}, undefined, false, undefined, this),
|
|
347
|
-
/* @__PURE__ */
|
|
106
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
348
107
|
className: "mt-1 flex items-center gap-2",
|
|
349
108
|
children: [
|
|
350
|
-
/* @__PURE__ */
|
|
109
|
+
/* @__PURE__ */ jsxDEV("span", {
|
|
351
110
|
className: "text-muted-foreground text-sm",
|
|
352
111
|
children: [
|
|
353
112
|
agent.modelProvider,
|
|
@@ -355,60 +114,60 @@ function AgentActionsModal({
|
|
|
355
114
|
agent.modelName
|
|
356
115
|
]
|
|
357
116
|
}, undefined, true, undefined, this),
|
|
358
|
-
/* @__PURE__ */
|
|
359
|
-
className: `rounded-full px-2 py-0.5 text-xs
|
|
117
|
+
/* @__PURE__ */ jsxDEV("span", {
|
|
118
|
+
className: `rounded-full px-2 py-0.5 font-medium text-xs ${getStatusColor(agent.status)}`,
|
|
360
119
|
children: agent.status
|
|
361
120
|
}, undefined, false, undefined, this)
|
|
362
121
|
]
|
|
363
122
|
}, undefined, true, undefined, this),
|
|
364
|
-
agent.description && /* @__PURE__ */
|
|
365
|
-
className: "text-muted-foreground
|
|
123
|
+
agent.description && /* @__PURE__ */ jsxDEV("p", {
|
|
124
|
+
className: "mt-2 text-muted-foreground text-sm",
|
|
366
125
|
children: agent.description
|
|
367
126
|
}, undefined, false, undefined, this)
|
|
368
127
|
]
|
|
369
128
|
}, undefined, true, undefined, this),
|
|
370
|
-
mode === "menu" && /* @__PURE__ */
|
|
129
|
+
mode === "menu" && /* @__PURE__ */ jsxDEV("div", {
|
|
371
130
|
className: "space-y-3",
|
|
372
131
|
children: [
|
|
373
|
-
agent.status === "ACTIVE" && /* @__PURE__ */
|
|
132
|
+
agent.status === "ACTIVE" && /* @__PURE__ */ jsxDEV(Button, {
|
|
374
133
|
className: "w-full justify-start",
|
|
375
134
|
variant: "ghost",
|
|
376
135
|
onPress: () => setMode("execute"),
|
|
377
136
|
children: [
|
|
378
|
-
/* @__PURE__ */
|
|
137
|
+
/* @__PURE__ */ jsxDEV("span", {
|
|
379
138
|
className: "mr-2",
|
|
380
139
|
children: "▶️"
|
|
381
140
|
}, undefined, false, undefined, this),
|
|
382
141
|
" Execute Agent"
|
|
383
142
|
]
|
|
384
143
|
}, undefined, true, undefined, this),
|
|
385
|
-
(agent.status === "DRAFT" || agent.status === "PAUSED") && /* @__PURE__ */
|
|
144
|
+
(agent.status === "DRAFT" || agent.status === "PAUSED") && /* @__PURE__ */ jsxDEV(Button, {
|
|
386
145
|
className: "w-full justify-start",
|
|
387
146
|
variant: "ghost",
|
|
388
147
|
onPress: () => handleStatusChange("activate"),
|
|
389
148
|
disabled: isLoading,
|
|
390
149
|
children: [
|
|
391
|
-
/* @__PURE__ */
|
|
150
|
+
/* @__PURE__ */ jsxDEV("span", {
|
|
392
151
|
className: "mr-2",
|
|
393
152
|
children: "\uD83D\uDFE2"
|
|
394
153
|
}, undefined, false, undefined, this),
|
|
395
154
|
" Activate Agent"
|
|
396
155
|
]
|
|
397
156
|
}, undefined, true, undefined, this),
|
|
398
|
-
agent.status === "ACTIVE" && /* @__PURE__ */
|
|
157
|
+
agent.status === "ACTIVE" && /* @__PURE__ */ jsxDEV(Button, {
|
|
399
158
|
className: "w-full justify-start",
|
|
400
159
|
variant: "ghost",
|
|
401
160
|
onPress: () => handleStatusChange("pause"),
|
|
402
161
|
disabled: isLoading,
|
|
403
162
|
children: [
|
|
404
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ jsxDEV("span", {
|
|
405
164
|
className: "mr-2",
|
|
406
165
|
children: "⏸️"
|
|
407
166
|
}, undefined, false, undefined, this),
|
|
408
167
|
" Pause Agent"
|
|
409
168
|
]
|
|
410
169
|
}, undefined, true, undefined, this),
|
|
411
|
-
agent.status !== "ARCHIVED" && /* @__PURE__ */
|
|
170
|
+
agent.status !== "ARCHIVED" && /* @__PURE__ */ jsxDEV(Button, {
|
|
412
171
|
className: "w-full justify-start text-yellow-600 hover:text-yellow-700",
|
|
413
172
|
variant: "ghost",
|
|
414
173
|
onPress: () => {
|
|
@@ -416,33 +175,33 @@ function AgentActionsModal({
|
|
|
416
175
|
setMode("confirm");
|
|
417
176
|
},
|
|
418
177
|
children: [
|
|
419
|
-
/* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ jsxDEV("span", {
|
|
420
179
|
className: "mr-2",
|
|
421
180
|
children: "\uD83D\uDCE6"
|
|
422
181
|
}, undefined, false, undefined, this),
|
|
423
182
|
" Archive Agent"
|
|
424
183
|
]
|
|
425
184
|
}, undefined, true, undefined, this),
|
|
426
|
-
agent.status === "ARCHIVED" && /* @__PURE__ */
|
|
185
|
+
agent.status === "ARCHIVED" && /* @__PURE__ */ jsxDEV(Button, {
|
|
427
186
|
className: "w-full justify-start",
|
|
428
187
|
variant: "ghost",
|
|
429
188
|
onPress: () => handleStatusChange("activate"),
|
|
430
189
|
disabled: isLoading,
|
|
431
190
|
children: [
|
|
432
|
-
/* @__PURE__ */
|
|
191
|
+
/* @__PURE__ */ jsxDEV("span", {
|
|
433
192
|
className: "mr-2",
|
|
434
193
|
children: "\uD83D\uDD04"
|
|
435
194
|
}, undefined, false, undefined, this),
|
|
436
195
|
" Restore Agent"
|
|
437
196
|
]
|
|
438
197
|
}, undefined, true, undefined, this),
|
|
439
|
-
error && /* @__PURE__ */
|
|
440
|
-
className: "bg-destructive/10
|
|
198
|
+
error && /* @__PURE__ */ jsxDEV("div", {
|
|
199
|
+
className: "rounded-md bg-destructive/10 p-3 text-destructive text-sm",
|
|
441
200
|
children: error
|
|
442
201
|
}, undefined, false, undefined, this),
|
|
443
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
444
203
|
className: "border-border border-t pt-3",
|
|
445
|
-
children: /* @__PURE__ */
|
|
204
|
+
children: /* @__PURE__ */ jsxDEV(Button, {
|
|
446
205
|
className: "w-full",
|
|
447
206
|
variant: "outline",
|
|
448
207
|
onPress: handleClose,
|
|
@@ -451,41 +210,41 @@ function AgentActionsModal({
|
|
|
451
210
|
}, undefined, false, undefined, this)
|
|
452
211
|
]
|
|
453
212
|
}, undefined, true, undefined, this),
|
|
454
|
-
mode === "execute" && /* @__PURE__ */
|
|
213
|
+
mode === "execute" && /* @__PURE__ */ jsxDEV("div", {
|
|
455
214
|
className: "space-y-4",
|
|
456
215
|
children: [
|
|
457
|
-
/* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
458
217
|
children: [
|
|
459
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ jsxDEV("label", {
|
|
460
219
|
htmlFor: "execute-message",
|
|
461
|
-
className: "
|
|
220
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
462
221
|
children: "Message *"
|
|
463
222
|
}, undefined, false, undefined, this),
|
|
464
|
-
/* @__PURE__ */
|
|
223
|
+
/* @__PURE__ */ jsxDEV("textarea", {
|
|
465
224
|
id: "execute-message",
|
|
466
225
|
value: message,
|
|
467
226
|
onChange: (e) => setMessage(e.target.value),
|
|
468
227
|
placeholder: "Enter your message to the agent...",
|
|
469
228
|
rows: 4,
|
|
470
229
|
disabled: isLoading,
|
|
471
|
-
className: "
|
|
230
|
+
className: "w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50"
|
|
472
231
|
}, undefined, false, undefined, this)
|
|
473
232
|
]
|
|
474
233
|
}, undefined, true, undefined, this),
|
|
475
|
-
error && /* @__PURE__ */
|
|
476
|
-
className: "bg-destructive/10
|
|
234
|
+
error && /* @__PURE__ */ jsxDEV("div", {
|
|
235
|
+
className: "rounded-md bg-destructive/10 p-3 text-destructive text-sm",
|
|
477
236
|
children: error
|
|
478
237
|
}, undefined, false, undefined, this),
|
|
479
|
-
/* @__PURE__ */
|
|
238
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
480
239
|
className: "flex justify-end gap-3 pt-2",
|
|
481
240
|
children: [
|
|
482
|
-
/* @__PURE__ */
|
|
241
|
+
/* @__PURE__ */ jsxDEV(Button, {
|
|
483
242
|
variant: "ghost",
|
|
484
243
|
onPress: () => setMode("menu"),
|
|
485
244
|
disabled: isLoading,
|
|
486
245
|
children: "Back"
|
|
487
246
|
}, undefined, false, undefined, this),
|
|
488
|
-
/* @__PURE__ */
|
|
247
|
+
/* @__PURE__ */ jsxDEV(Button, {
|
|
489
248
|
onPress: handleExecute,
|
|
490
249
|
disabled: isLoading,
|
|
491
250
|
children: isLoading ? "Executing..." : "▶️ Execute"
|
|
@@ -494,42 +253,283 @@ function AgentActionsModal({
|
|
|
494
253
|
}, undefined, true, undefined, this)
|
|
495
254
|
]
|
|
496
255
|
}, undefined, true, undefined, this),
|
|
497
|
-
mode === "confirm" && confirmAction === "archive" && /* @__PURE__ */
|
|
256
|
+
mode === "confirm" && confirmAction === "archive" && /* @__PURE__ */ jsxDEV("div", {
|
|
498
257
|
className: "space-y-4",
|
|
499
258
|
children: [
|
|
500
|
-
/* @__PURE__ */
|
|
259
|
+
/* @__PURE__ */ jsxDEV("p", {
|
|
501
260
|
className: "text-muted-foreground",
|
|
502
261
|
children: [
|
|
503
262
|
"Are you sure you want to archive",
|
|
504
263
|
" ",
|
|
505
|
-
/* @__PURE__ */
|
|
506
|
-
className: "text-foreground
|
|
264
|
+
/* @__PURE__ */ jsxDEV("span", {
|
|
265
|
+
className: "font-medium text-foreground",
|
|
507
266
|
children: agent.name
|
|
508
267
|
}, undefined, false, undefined, this),
|
|
509
268
|
"?"
|
|
510
269
|
]
|
|
511
270
|
}, undefined, true, undefined, this),
|
|
512
|
-
/* @__PURE__ */
|
|
271
|
+
/* @__PURE__ */ jsxDEV("p", {
|
|
513
272
|
className: "text-muted-foreground text-sm",
|
|
514
273
|
children: "Archived agents cannot be executed but can be restored later."
|
|
515
274
|
}, undefined, false, undefined, this),
|
|
275
|
+
error && /* @__PURE__ */ jsxDEV("div", {
|
|
276
|
+
className: "rounded-md bg-destructive/10 p-3 text-destructive text-sm",
|
|
277
|
+
children: error
|
|
278
|
+
}, undefined, false, undefined, this),
|
|
279
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
280
|
+
className: "flex justify-end gap-3 pt-2",
|
|
281
|
+
children: [
|
|
282
|
+
/* @__PURE__ */ jsxDEV(Button, {
|
|
283
|
+
variant: "ghost",
|
|
284
|
+
onPress: () => setMode("menu"),
|
|
285
|
+
disabled: isLoading,
|
|
286
|
+
children: "Cancel"
|
|
287
|
+
}, undefined, false, undefined, this),
|
|
288
|
+
/* @__PURE__ */ jsxDEV(Button, {
|
|
289
|
+
onPress: () => handleStatusChange("archive"),
|
|
290
|
+
disabled: isLoading,
|
|
291
|
+
children: isLoading ? "Archiving..." : "\uD83D\uDCE6 Archive"
|
|
292
|
+
}, undefined, false, undefined, this)
|
|
293
|
+
]
|
|
294
|
+
}, undefined, true, undefined, this)
|
|
295
|
+
]
|
|
296
|
+
}, undefined, true, undefined, this)
|
|
297
|
+
]
|
|
298
|
+
}, undefined, true, undefined, this)
|
|
299
|
+
]
|
|
300
|
+
}, undefined, true, undefined, this);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// src/ui/modals/CreateAgentModal.tsx
|
|
304
|
+
import { Button as Button2, Input } from "@contractspec/lib.design-system";
|
|
305
|
+
import { useState as useState2 } from "react";
|
|
306
|
+
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
307
|
+
"use client";
|
|
308
|
+
var MODEL_PROVIDERS = [
|
|
309
|
+
{
|
|
310
|
+
value: "openai",
|
|
311
|
+
label: "OpenAI",
|
|
312
|
+
models: ["gpt-5.4", "gpt-5-mini", "gpt-4o", "gpt-4-turbo", "gpt-3.5-turbo"]
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
value: "anthropic",
|
|
316
|
+
label: "Anthropic",
|
|
317
|
+
models: ["claude-sonnet-4-6", "claude-opus-4-6", "claude-haiku-4-5"]
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
value: "google",
|
|
321
|
+
label: "Google",
|
|
322
|
+
models: [
|
|
323
|
+
"gemini-2.5-flash",
|
|
324
|
+
"gemini-2.5-pro",
|
|
325
|
+
"gemini-pro",
|
|
326
|
+
"gemini-ultra"
|
|
327
|
+
]
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
value: "mistral",
|
|
331
|
+
label: "Mistral",
|
|
332
|
+
models: [
|
|
333
|
+
"mistral-large-2512",
|
|
334
|
+
"mistral-large-latest",
|
|
335
|
+
"mistral-medium-latest",
|
|
336
|
+
"mistral-small-latest"
|
|
337
|
+
]
|
|
338
|
+
}
|
|
339
|
+
];
|
|
340
|
+
function CreateAgentModal({
|
|
341
|
+
isOpen,
|
|
342
|
+
onClose,
|
|
343
|
+
onSubmit,
|
|
344
|
+
isLoading = false
|
|
345
|
+
}) {
|
|
346
|
+
const [name, setName] = useState2("");
|
|
347
|
+
const [description, setDescription] = useState2("");
|
|
348
|
+
const [modelProvider, setModelProvider] = useState2("openai");
|
|
349
|
+
const [modelName, setModelName] = useState2("gpt-5.4");
|
|
350
|
+
const [systemPrompt, setSystemPrompt] = useState2("");
|
|
351
|
+
const [error, setError] = useState2(null);
|
|
352
|
+
const selectedProvider = MODEL_PROVIDERS.find((p) => p.value === modelProvider);
|
|
353
|
+
const handleSubmit = async (e) => {
|
|
354
|
+
e.preventDefault();
|
|
355
|
+
setError(null);
|
|
356
|
+
if (!name.trim()) {
|
|
357
|
+
setError("Agent name is required");
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
360
|
+
try {
|
|
361
|
+
await onSubmit({
|
|
362
|
+
name: name.trim(),
|
|
363
|
+
description: description.trim() || undefined,
|
|
364
|
+
modelProvider,
|
|
365
|
+
modelName,
|
|
366
|
+
systemPrompt: systemPrompt.trim() || undefined
|
|
367
|
+
});
|
|
368
|
+
setName("");
|
|
369
|
+
setDescription("");
|
|
370
|
+
setModelProvider("openai");
|
|
371
|
+
setModelName("gpt-5.4");
|
|
372
|
+
setSystemPrompt("");
|
|
373
|
+
onClose();
|
|
374
|
+
} catch (err) {
|
|
375
|
+
setError(err instanceof Error ? err.message : "Failed to create agent");
|
|
376
|
+
}
|
|
377
|
+
};
|
|
378
|
+
const handleProviderChange = (provider) => {
|
|
379
|
+
setModelProvider(provider);
|
|
380
|
+
const providerConfig = MODEL_PROVIDERS.find((p) => p.value === provider);
|
|
381
|
+
if (providerConfig) {
|
|
382
|
+
setModelName(providerConfig.models[0]);
|
|
383
|
+
}
|
|
384
|
+
};
|
|
385
|
+
if (!isOpen)
|
|
386
|
+
return null;
|
|
387
|
+
return /* @__PURE__ */ jsxDEV2("div", {
|
|
388
|
+
className: "fixed inset-0 z-50 flex items-center justify-center",
|
|
389
|
+
children: [
|
|
390
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
391
|
+
className: "absolute inset-0 bg-background/80 backdrop-blur-sm",
|
|
392
|
+
onClick: onClose,
|
|
393
|
+
role: "button",
|
|
394
|
+
tabIndex: 0,
|
|
395
|
+
onKeyDown: (e) => {
|
|
396
|
+
if (e.key === "Enter" || e.key === " ")
|
|
397
|
+
onClose();
|
|
398
|
+
},
|
|
399
|
+
"aria-label": "Close modal"
|
|
400
|
+
}, undefined, false, undefined, this),
|
|
401
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
402
|
+
className: "relative z-10 max-h-[90vh] w-full max-w-lg overflow-y-auto rounded-xl border border-border bg-card p-6 shadow-xl",
|
|
403
|
+
children: [
|
|
404
|
+
/* @__PURE__ */ jsxDEV2("h2", {
|
|
405
|
+
className: "mb-4 font-semibold text-xl",
|
|
406
|
+
children: "Create New Agent"
|
|
407
|
+
}, undefined, false, undefined, this),
|
|
408
|
+
/* @__PURE__ */ jsxDEV2("form", {
|
|
409
|
+
onSubmit: handleSubmit,
|
|
410
|
+
className: "space-y-4",
|
|
411
|
+
children: [
|
|
412
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
413
|
+
children: [
|
|
414
|
+
/* @__PURE__ */ jsxDEV2("label", {
|
|
415
|
+
htmlFor: "agent-name",
|
|
416
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
417
|
+
children: "Agent Name *"
|
|
418
|
+
}, undefined, false, undefined, this),
|
|
419
|
+
/* @__PURE__ */ jsxDEV2(Input, {
|
|
420
|
+
id: "agent-name",
|
|
421
|
+
value: name,
|
|
422
|
+
onChange: (e) => setName(e.target.value),
|
|
423
|
+
placeholder: "e.g., Customer Support Bot",
|
|
424
|
+
disabled: isLoading
|
|
425
|
+
}, undefined, false, undefined, this)
|
|
426
|
+
]
|
|
427
|
+
}, undefined, true, undefined, this),
|
|
428
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
429
|
+
children: [
|
|
430
|
+
/* @__PURE__ */ jsxDEV2("label", {
|
|
431
|
+
htmlFor: "agent-description",
|
|
432
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
433
|
+
children: "Description"
|
|
434
|
+
}, undefined, false, undefined, this),
|
|
435
|
+
/* @__PURE__ */ jsxDEV2("textarea", {
|
|
436
|
+
id: "agent-description",
|
|
437
|
+
value: description,
|
|
438
|
+
onChange: (e) => setDescription(e.target.value),
|
|
439
|
+
placeholder: "Describe what this agent does...",
|
|
440
|
+
rows: 2,
|
|
441
|
+
disabled: isLoading,
|
|
442
|
+
className: "w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50"
|
|
443
|
+
}, undefined, false, undefined, this)
|
|
444
|
+
]
|
|
445
|
+
}, undefined, true, undefined, this),
|
|
446
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
447
|
+
className: "flex gap-3",
|
|
448
|
+
children: [
|
|
449
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
450
|
+
className: "flex-1",
|
|
451
|
+
children: [
|
|
452
|
+
/* @__PURE__ */ jsxDEV2("label", {
|
|
453
|
+
htmlFor: "model-provider",
|
|
454
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
455
|
+
children: "Provider *"
|
|
456
|
+
}, undefined, false, undefined, this),
|
|
457
|
+
/* @__PURE__ */ jsxDEV2("select", {
|
|
458
|
+
id: "model-provider",
|
|
459
|
+
value: modelProvider,
|
|
460
|
+
onChange: (e) => handleProviderChange(e.target.value),
|
|
461
|
+
disabled: isLoading,
|
|
462
|
+
className: "h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50",
|
|
463
|
+
children: MODEL_PROVIDERS.map((p) => /* @__PURE__ */ jsxDEV2("option", {
|
|
464
|
+
value: p.value,
|
|
465
|
+
children: p.label
|
|
466
|
+
}, p.value, false, undefined, this))
|
|
467
|
+
}, undefined, false, undefined, this)
|
|
468
|
+
]
|
|
469
|
+
}, undefined, true, undefined, this),
|
|
470
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
471
|
+
className: "flex-1",
|
|
472
|
+
children: [
|
|
473
|
+
/* @__PURE__ */ jsxDEV2("label", {
|
|
474
|
+
htmlFor: "model-name",
|
|
475
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
476
|
+
children: "Model *"
|
|
477
|
+
}, undefined, false, undefined, this),
|
|
478
|
+
/* @__PURE__ */ jsxDEV2("select", {
|
|
479
|
+
id: "model-name",
|
|
480
|
+
value: modelName,
|
|
481
|
+
onChange: (e) => setModelName(e.target.value),
|
|
482
|
+
disabled: isLoading,
|
|
483
|
+
className: "h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50",
|
|
484
|
+
children: selectedProvider?.models.map((m) => /* @__PURE__ */ jsxDEV2("option", {
|
|
485
|
+
value: m,
|
|
486
|
+
children: m
|
|
487
|
+
}, m, false, undefined, this))
|
|
488
|
+
}, undefined, false, undefined, this)
|
|
489
|
+
]
|
|
490
|
+
}, undefined, true, undefined, this)
|
|
491
|
+
]
|
|
492
|
+
}, undefined, true, undefined, this),
|
|
493
|
+
/* @__PURE__ */ jsxDEV2("div", {
|
|
494
|
+
children: [
|
|
495
|
+
/* @__PURE__ */ jsxDEV2("label", {
|
|
496
|
+
htmlFor: "system-prompt",
|
|
497
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
498
|
+
children: "System Prompt"
|
|
499
|
+
}, undefined, false, undefined, this),
|
|
500
|
+
/* @__PURE__ */ jsxDEV2("textarea", {
|
|
501
|
+
id: "system-prompt",
|
|
502
|
+
value: systemPrompt,
|
|
503
|
+
onChange: (e) => setSystemPrompt(e.target.value),
|
|
504
|
+
placeholder: "You are a helpful assistant that...",
|
|
505
|
+
rows: 4,
|
|
506
|
+
disabled: isLoading,
|
|
507
|
+
className: "w-full rounded-md border border-input bg-background px-3 py-2 font-mono text-sm focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50"
|
|
508
|
+
}, undefined, false, undefined, this),
|
|
509
|
+
/* @__PURE__ */ jsxDEV2("p", {
|
|
510
|
+
className: "mt-1 text-muted-foreground text-xs",
|
|
511
|
+
children: "Instructions that define the agent's behavior"
|
|
512
|
+
}, undefined, false, undefined, this)
|
|
513
|
+
]
|
|
514
|
+
}, undefined, true, undefined, this),
|
|
516
515
|
error && /* @__PURE__ */ jsxDEV2("div", {
|
|
517
|
-
className: "bg-destructive/10
|
|
516
|
+
className: "rounded-md bg-destructive/10 p-3 text-destructive text-sm",
|
|
518
517
|
children: error
|
|
519
518
|
}, undefined, false, undefined, this),
|
|
520
519
|
/* @__PURE__ */ jsxDEV2("div", {
|
|
521
520
|
className: "flex justify-end gap-3 pt-2",
|
|
522
521
|
children: [
|
|
523
522
|
/* @__PURE__ */ jsxDEV2(Button2, {
|
|
523
|
+
type: "button",
|
|
524
524
|
variant: "ghost",
|
|
525
|
-
onPress:
|
|
525
|
+
onPress: onClose,
|
|
526
526
|
disabled: isLoading,
|
|
527
527
|
children: "Cancel"
|
|
528
528
|
}, undefined, false, undefined, this),
|
|
529
529
|
/* @__PURE__ */ jsxDEV2(Button2, {
|
|
530
|
-
|
|
530
|
+
type: "submit",
|
|
531
531
|
disabled: isLoading,
|
|
532
|
-
children: isLoading ? "
|
|
532
|
+
children: isLoading ? "Creating..." : "Create Agent"
|
|
533
533
|
}, undefined, false, undefined, this)
|
|
534
534
|
]
|
|
535
535
|
}, undefined, true, undefined, this)
|