@contractspec/example.agent-console 3.7.6 → 3.8.2

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.
Files changed (288) hide show
  1. package/.turbo/turbo-build.log +126 -105
  2. package/AGENTS.md +52 -31
  3. package/CHANGELOG.md +29 -0
  4. package/README.md +112 -83
  5. package/dist/agent/agent.event.js +1 -1
  6. package/dist/agent/agent.handler.d.ts +3 -0
  7. package/dist/agent/agent.handler.js +730 -1
  8. package/dist/agent/agent.operation.js +1 -1
  9. package/dist/agent/index.d.ts +5 -5
  10. package/dist/agent/index.js +74 -73
  11. package/dist/agent.feature.js +179 -0
  12. package/dist/browser/agent/agent.event.js +1 -1
  13. package/dist/browser/agent/agent.handler.js +730 -1
  14. package/dist/browser/agent/agent.operation.js +1 -1
  15. package/dist/browser/agent/index.js +74 -73
  16. package/dist/browser/agent.feature.js +179 -0
  17. package/dist/browser/docs/agent-console.docblock.js +11 -8
  18. package/dist/browser/docs/index.js +11 -8
  19. package/dist/browser/example.js +2 -3
  20. package/dist/browser/handlers/agent.handlers.js +1883 -2
  21. package/dist/browser/handlers/index.js +2142 -8
  22. package/dist/browser/index.js +4075 -3161
  23. package/dist/browser/presentations/index.js +51 -51
  24. package/dist/browser/run/index.js +380 -374
  25. package/dist/browser/run/run.event.js +2 -2
  26. package/dist/browser/run/run.handler.js +666 -1
  27. package/dist/browser/run/run.presentation.js +2 -2
  28. package/dist/browser/shared/index.js +293 -1
  29. package/dist/browser/shared/mock-runs.js +5 -0
  30. package/dist/browser/tool/index.js +161 -161
  31. package/dist/browser/tool/tool.event.js +1 -1
  32. package/dist/browser/tool/tool.handler.js +479 -3
  33. package/dist/browser/tool/tool.presentation.js +2 -2
  34. package/dist/browser/ui/AgentDashboard.js +1816 -931
  35. package/dist/browser/ui/AgentDashboard.visualizations.js +217 -0
  36. package/dist/browser/ui/AgentRunList.js +360 -128
  37. package/dist/browser/ui/AgentToolRegistry.js +9 -9
  38. package/dist/browser/ui/hooks/index.js +611 -161
  39. package/dist/browser/ui/hooks/useAgentList.js +1 -1
  40. package/dist/browser/ui/hooks/useAgentMutations.js +444 -9
  41. package/dist/browser/ui/hooks/useRunList.js +26 -11
  42. package/dist/browser/ui/hooks/useToolList.js +1 -1
  43. package/dist/browser/ui/index.js +2161 -1258
  44. package/dist/browser/ui/modals/AgentActionsModal.js +13 -13
  45. package/dist/browser/ui/modals/CreateAgentModal.js +15 -15
  46. package/dist/browser/ui/modals/index.js +297 -297
  47. package/dist/browser/ui/renderers/agent-list.markdown.js +14 -5
  48. package/dist/browser/ui/renderers/agent-list.renderer.js +7 -7
  49. package/dist/browser/ui/renderers/dashboard.markdown.js +207 -36
  50. package/dist/browser/ui/renderers/index.js +359 -163
  51. package/dist/browser/ui/renderers/run-list.markdown.js +9 -4
  52. package/dist/browser/ui/renderers/tool-registry.markdown.js +15 -4
  53. package/dist/browser/ui/views/AgentListView.js +7 -7
  54. package/dist/browser/ui/views/RunDataTable.js +326 -0
  55. package/dist/browser/ui/views/RunListView.js +360 -128
  56. package/dist/browser/ui/views/ToolRegistryView.js +9 -9
  57. package/dist/browser/ui/views/index.js +478 -246
  58. package/dist/browser/ui/views/run-data-table.columns.js +271 -0
  59. package/dist/browser/ui/views/run-list.shared.js +177 -0
  60. package/dist/browser/visualizations/catalog.js +134 -0
  61. package/dist/browser/visualizations/index.js +187 -0
  62. package/dist/browser/visualizations/selectors.js +181 -0
  63. package/dist/docs/agent-console.docblock.js +11 -8
  64. package/dist/docs/index.js +11 -8
  65. package/dist/example.js +2 -3
  66. package/dist/example.test.d.ts +1 -0
  67. package/dist/handlers/agent.handlers.d.ts +2 -0
  68. package/dist/handlers/agent.handlers.js +1883 -2
  69. package/dist/handlers/index.d.ts +2 -4
  70. package/dist/handlers/index.js +2142 -8
  71. package/dist/handlers/mock-handlers.test.d.ts +1 -0
  72. package/dist/index.d.ts +6 -4
  73. package/dist/index.js +4075 -3161
  74. package/dist/node/agent/agent.event.js +1 -1
  75. package/dist/node/agent/agent.handler.js +730 -1
  76. package/dist/node/agent/agent.operation.js +1 -1
  77. package/dist/node/agent/index.js +74 -73
  78. package/dist/node/agent.feature.js +179 -0
  79. package/dist/node/docs/agent-console.docblock.js +11 -8
  80. package/dist/node/docs/index.js +11 -8
  81. package/dist/node/example.js +2 -3
  82. package/dist/node/handlers/agent.handlers.js +1883 -2
  83. package/dist/node/handlers/index.js +2142 -8
  84. package/dist/node/index.js +4075 -3161
  85. package/dist/node/presentations/index.js +51 -51
  86. package/dist/node/run/index.js +380 -374
  87. package/dist/node/run/run.event.js +2 -2
  88. package/dist/node/run/run.handler.js +666 -1
  89. package/dist/node/run/run.presentation.js +2 -2
  90. package/dist/node/shared/index.js +293 -1
  91. package/dist/node/shared/mock-runs.js +5 -0
  92. package/dist/node/tool/index.js +161 -161
  93. package/dist/node/tool/tool.event.js +1 -1
  94. package/dist/node/tool/tool.handler.js +479 -3
  95. package/dist/node/tool/tool.presentation.js +2 -2
  96. package/dist/node/ui/AgentDashboard.js +1816 -931
  97. package/dist/node/ui/AgentDashboard.visualizations.js +217 -0
  98. package/dist/node/ui/AgentRunList.js +360 -128
  99. package/dist/node/ui/AgentToolRegistry.js +9 -9
  100. package/dist/node/ui/hooks/index.js +611 -161
  101. package/dist/node/ui/hooks/useAgentList.js +1 -1
  102. package/dist/node/ui/hooks/useAgentMutations.js +444 -9
  103. package/dist/node/ui/hooks/useRunList.js +26 -11
  104. package/dist/node/ui/hooks/useToolList.js +1 -1
  105. package/dist/node/ui/index.js +2161 -1258
  106. package/dist/node/ui/modals/AgentActionsModal.js +13 -13
  107. package/dist/node/ui/modals/CreateAgentModal.js +15 -15
  108. package/dist/node/ui/modals/index.js +297 -297
  109. package/dist/node/ui/renderers/agent-list.markdown.js +14 -5
  110. package/dist/node/ui/renderers/agent-list.renderer.js +7 -7
  111. package/dist/node/ui/renderers/dashboard.markdown.js +207 -36
  112. package/dist/node/ui/renderers/index.js +359 -163
  113. package/dist/node/ui/renderers/run-list.markdown.js +9 -4
  114. package/dist/node/ui/renderers/tool-registry.markdown.js +15 -4
  115. package/dist/node/ui/views/AgentListView.js +7 -7
  116. package/dist/node/ui/views/RunDataTable.js +326 -0
  117. package/dist/node/ui/views/RunListView.js +360 -128
  118. package/dist/node/ui/views/ToolRegistryView.js +9 -9
  119. package/dist/node/ui/views/index.js +478 -246
  120. package/dist/node/ui/views/run-data-table.columns.js +271 -0
  121. package/dist/node/ui/views/run-list.shared.js +177 -0
  122. package/dist/node/visualizations/catalog.js +134 -0
  123. package/dist/node/visualizations/index.js +187 -0
  124. package/dist/node/visualizations/selectors.js +181 -0
  125. package/dist/presentations/index.d.ts +3 -5
  126. package/dist/presentations/index.js +51 -51
  127. package/dist/proof/index.d.ts +2 -0
  128. package/dist/proof/meetup-proof.d.ts +10 -0
  129. package/dist/proof/meetup-proof.runtime.d.ts +22 -0
  130. package/dist/proof/meetup-proof.scenario.d.ts +2 -0
  131. package/dist/proof/meetup-proof.suite.d.ts +1 -0
  132. package/dist/proof/meetup-proof.test.d.ts +1 -0
  133. package/dist/run/index.d.ts +7 -7
  134. package/dist/run/index.js +380 -374
  135. package/dist/run/run.event.js +2 -2
  136. package/dist/run/run.handler.d.ts +7 -0
  137. package/dist/run/run.handler.js +666 -1
  138. package/dist/run/run.presentation.js +2 -2
  139. package/dist/shared/demo-dashboard-data.d.ts +16 -0
  140. package/dist/shared/demo-runtime-seed.d.ts +17 -0
  141. package/dist/shared/demo-runtime.d.ts +8 -0
  142. package/dist/shared/demo-runtime.test.d.ts +1 -0
  143. package/dist/shared/index.d.ts +4 -1
  144. package/dist/shared/index.js +293 -1
  145. package/dist/shared/mock-runs.d.ts +4 -0
  146. package/dist/shared/mock-runs.js +5 -0
  147. package/dist/tool/index.d.ts +7 -7
  148. package/dist/tool/index.js +161 -161
  149. package/dist/tool/tool.event.js +1 -1
  150. package/dist/tool/tool.handler.d.ts +3 -0
  151. package/dist/tool/tool.handler.js +479 -3
  152. package/dist/tool/tool.presentation.js +2 -2
  153. package/dist/ui/AgentDashboard.js +1816 -931
  154. package/dist/ui/AgentDashboard.sandbox.test.d.ts +1 -0
  155. package/dist/ui/AgentDashboard.visualizations.d.ts +4 -0
  156. package/dist/ui/AgentDashboard.visualizations.js +218 -0
  157. package/dist/ui/AgentRunList.js +360 -128
  158. package/dist/ui/AgentToolRegistry.js +9 -9
  159. package/dist/ui/hooks/index.d.ts +4 -4
  160. package/dist/ui/hooks/index.js +611 -161
  161. package/dist/ui/hooks/useAgentList.d.ts +5 -0
  162. package/dist/ui/hooks/useAgentList.js +1 -1
  163. package/dist/ui/hooks/useAgentMutations.d.ts +9 -2
  164. package/dist/ui/hooks/useAgentMutations.js +444 -9
  165. package/dist/ui/hooks/useRunList.d.ts +13 -2
  166. package/dist/ui/hooks/useRunList.js +26 -11
  167. package/dist/ui/hooks/useToolList.d.ts +5 -0
  168. package/dist/ui/hooks/useToolList.js +1 -1
  169. package/dist/ui/index.d.ts +3 -3
  170. package/dist/ui/index.js +2161 -1258
  171. package/dist/ui/modals/AgentActionsModal.js +13 -13
  172. package/dist/ui/modals/CreateAgentModal.js +15 -15
  173. package/dist/ui/modals/index.d.ts +1 -1
  174. package/dist/ui/modals/index.js +297 -297
  175. package/dist/ui/renderers/agent-list.markdown.d.ts +5 -0
  176. package/dist/ui/renderers/agent-list.markdown.js +14 -5
  177. package/dist/ui/renderers/agent-list.renderer.js +7 -7
  178. package/dist/ui/renderers/dashboard.markdown.d.ts +5 -0
  179. package/dist/ui/renderers/dashboard.markdown.js +207 -36
  180. package/dist/ui/renderers/index.d.ts +2 -2
  181. package/dist/ui/renderers/index.js +359 -163
  182. package/dist/ui/renderers/run-list.markdown.d.ts +5 -0
  183. package/dist/ui/renderers/run-list.markdown.js +9 -4
  184. package/dist/ui/renderers/tool-registry.markdown.d.ts +6 -1
  185. package/dist/ui/renderers/tool-registry.markdown.js +15 -4
  186. package/dist/ui/views/AgentListView.js +7 -7
  187. package/dist/ui/views/RunDataTable.d.ts +18 -0
  188. package/dist/ui/views/RunDataTable.js +327 -0
  189. package/dist/ui/views/RunListView.js +360 -128
  190. package/dist/ui/views/ToolRegistryView.js +9 -9
  191. package/dist/ui/views/index.js +478 -246
  192. package/dist/ui/views/run-data-table.columns.d.ts +3 -0
  193. package/dist/ui/views/run-data-table.columns.js +272 -0
  194. package/dist/ui/views/run-list.shared.d.ts +14 -0
  195. package/dist/ui/views/run-list.shared.js +178 -0
  196. package/dist/visualizations/catalog.d.ts +10 -0
  197. package/dist/visualizations/catalog.js +135 -0
  198. package/dist/visualizations/index.d.ts +2 -0
  199. package/dist/visualizations/index.js +188 -0
  200. package/dist/visualizations/selectors.d.ts +3 -0
  201. package/dist/visualizations/selectors.js +182 -0
  202. package/dist/visualizations/selectors.test.d.ts +1 -0
  203. package/package.json +114 -12
  204. package/proofs/agent-console-meetup.replay.json +220 -0
  205. package/src/agent/agent.entity.ts +111 -111
  206. package/src/agent/agent.enum.ts +12 -12
  207. package/src/agent/agent.event.ts +91 -91
  208. package/src/agent/agent.handler.ts +144 -127
  209. package/src/agent/agent.operation.ts +400 -400
  210. package/src/agent/agent.presentation.ts +62 -62
  211. package/src/agent/agent.schema.ts +175 -175
  212. package/src/agent/agent.test-spec.ts +48 -48
  213. package/src/agent/index.ts +46 -51
  214. package/src/agent.capability.ts +11 -11
  215. package/src/agent.feature.ts +134 -131
  216. package/src/docs/agent-console.docblock.ts +52 -49
  217. package/src/example.test.ts +75 -0
  218. package/src/example.ts +34 -35
  219. package/src/handlers/agent.handlers.ts +576 -522
  220. package/src/handlers/index.ts +30 -14
  221. package/src/handlers/mock-handlers.test.ts +77 -0
  222. package/src/index.ts +10 -9
  223. package/src/presentations/index.ts +11 -13
  224. package/src/proof/index.ts +2 -0
  225. package/src/proof/meetup-proof.runtime.ts +196 -0
  226. package/src/proof/meetup-proof.scenario.ts +99 -0
  227. package/src/proof/meetup-proof.suite.ts +29 -0
  228. package/src/proof/meetup-proof.test.ts +28 -0
  229. package/src/proof/meetup-proof.ts +130 -0
  230. package/src/run/index.ts +49 -54
  231. package/src/run/run.entity.ts +137 -137
  232. package/src/run/run.enum.ts +18 -18
  233. package/src/run/run.event.ts +174 -174
  234. package/src/run/run.handler.ts +113 -96
  235. package/src/run/run.operation.ts +474 -474
  236. package/src/run/run.presentation.ts +42 -42
  237. package/src/run/run.schema.ts +126 -126
  238. package/src/run/run.test-spec.ts +48 -48
  239. package/src/seeders/index.ts +21 -21
  240. package/src/shared/demo-dashboard-data.ts +58 -0
  241. package/src/shared/demo-runtime-seed.ts +139 -0
  242. package/src/shared/demo-runtime.test.ts +169 -0
  243. package/src/shared/demo-runtime.ts +260 -0
  244. package/src/shared/index.ts +12 -1
  245. package/src/shared/mock-agents.ts +76 -76
  246. package/src/shared/mock-runs.ts +107 -102
  247. package/src/shared/mock-tools.ts +140 -140
  248. package/src/shared/overlay-types.ts +23 -23
  249. package/src/tool/index.ts +39 -44
  250. package/src/tool/tool.entity.ts +73 -73
  251. package/src/tool/tool.enum.ts +13 -13
  252. package/src/tool/tool.event.ts +80 -80
  253. package/src/tool/tool.handler.ts +124 -107
  254. package/src/tool/tool.operation.ts +328 -328
  255. package/src/tool/tool.presentation.ts +43 -43
  256. package/src/tool/tool.schema.ts +106 -106
  257. package/src/tool/tool.test-spec.ts +48 -48
  258. package/src/ui/AgentDashboard.sandbox.test.tsx +312 -0
  259. package/src/ui/AgentDashboard.tsx +351 -348
  260. package/src/ui/AgentDashboard.visualizations.tsx +35 -0
  261. package/src/ui/hooks/index.ts +7 -7
  262. package/src/ui/hooks/useAgentList.ts +57 -56
  263. package/src/ui/hooks/useAgentMutations.ts +168 -159
  264. package/src/ui/hooks/useRunList.ts +90 -57
  265. package/src/ui/hooks/useToolList.ts +102 -101
  266. package/src/ui/index.ts +6 -9
  267. package/src/ui/modals/AgentActionsModal.tsx +262 -262
  268. package/src/ui/modals/CreateAgentModal.tsx +232 -232
  269. package/src/ui/modals/index.ts +1 -1
  270. package/src/ui/overlays/demo-overlays.ts +52 -52
  271. package/src/ui/renderers/agent-list.markdown.ts +81 -61
  272. package/src/ui/renderers/agent-list.renderer.tsx +14 -14
  273. package/src/ui/renderers/dashboard.markdown.ts +135 -139
  274. package/src/ui/renderers/index.ts +3 -4
  275. package/src/ui/renderers/run-list.markdown.ts +56 -47
  276. package/src/ui/renderers/tool-registry.markdown.ts +79 -66
  277. package/src/ui/views/AgentListView.tsx +90 -90
  278. package/src/ui/views/RunDataTable.tsx +74 -0
  279. package/src/ui/views/RunListView.tsx +84 -158
  280. package/src/ui/views/ToolRegistryView.tsx +113 -113
  281. package/src/ui/views/run-data-table.columns.tsx +102 -0
  282. package/src/ui/views/run-list.shared.tsx +139 -0
  283. package/src/visualizations/catalog.ts +132 -0
  284. package/src/visualizations/index.ts +2 -0
  285. package/src/visualizations/selectors.test.ts +12 -0
  286. package/src/visualizations/selectors.ts +70 -0
  287. package/tsconfig.json +7 -8
  288. package/tsdown.config.js +24 -3
@@ -1,249 +1,8 @@
1
- // src/ui/modals/CreateAgentModal.tsx
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] = useState2("menu");
272
- const [message, setMessage] = useState2("");
273
- const [confirmAction, setConfirmAction] = useState2(null);
274
- const [error, setError] = useState2(null);
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__ */ jsxDEV2("div", {
82
+ return /* @__PURE__ */ jsxDEV("div", {
324
83
  className: "fixed inset-0 z-50 flex items-center justify-center",
325
84
  children: [
326
- /* @__PURE__ */ jsxDEV2("div", {
327
- className: "bg-background/80 absolute inset-0 backdrop-blur-sm",
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__ */ jsxDEV2("div", {
338
- className: "bg-card border-border relative z-10 w-full max-w-md rounded-xl border p-6 shadow-xl",
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__ */ jsxDEV2("div", {
341
- className: "border-border mb-4 border-b pb-4",
99
+ /* @__PURE__ */ jsxDEV("div", {
100
+ className: "mb-4 border-border border-b pb-4",
342
101
  children: [
343
- /* @__PURE__ */ jsxDEV2("h2", {
344
- className: "text-xl font-semibold",
102
+ /* @__PURE__ */ jsxDEV("h2", {
103
+ className: "font-semibold text-xl",
345
104
  children: agent.name
346
105
  }, undefined, false, undefined, this),
347
- /* @__PURE__ */ jsxDEV2("div", {
106
+ /* @__PURE__ */ jsxDEV("div", {
348
107
  className: "mt-1 flex items-center gap-2",
349
108
  children: [
350
- /* @__PURE__ */ jsxDEV2("span", {
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__ */ jsxDEV2("span", {
359
- className: `rounded-full px-2 py-0.5 text-xs font-medium ${getStatusColor(agent.status)}`,
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__ */ jsxDEV2("p", {
365
- className: "text-muted-foreground mt-2 text-sm",
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__ */ jsxDEV2("div", {
129
+ mode === "menu" && /* @__PURE__ */ jsxDEV("div", {
371
130
  className: "space-y-3",
372
131
  children: [
373
- agent.status === "ACTIVE" && /* @__PURE__ */ jsxDEV2(Button2, {
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__ */ jsxDEV2("span", {
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__ */ jsxDEV2(Button2, {
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__ */ jsxDEV2("span", {
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__ */ jsxDEV2(Button2, {
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__ */ jsxDEV2("span", {
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__ */ jsxDEV2(Button2, {
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__ */ jsxDEV2("span", {
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__ */ jsxDEV2(Button2, {
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__ */ jsxDEV2("span", {
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__ */ jsxDEV2("div", {
440
- className: "bg-destructive/10 text-destructive rounded-md p-3 text-sm",
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__ */ jsxDEV2("div", {
202
+ /* @__PURE__ */ jsxDEV("div", {
444
203
  className: "border-border border-t pt-3",
445
- children: /* @__PURE__ */ jsxDEV2(Button2, {
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__ */ jsxDEV2("div", {
213
+ mode === "execute" && /* @__PURE__ */ jsxDEV("div", {
455
214
  className: "space-y-4",
456
215
  children: [
457
- /* @__PURE__ */ jsxDEV2("div", {
216
+ /* @__PURE__ */ jsxDEV("div", {
458
217
  children: [
459
- /* @__PURE__ */ jsxDEV2("label", {
218
+ /* @__PURE__ */ jsxDEV("label", {
460
219
  htmlFor: "execute-message",
461
- className: "text-muted-foreground mb-1 block text-sm font-medium",
220
+ className: "mb-1 block font-medium text-muted-foreground text-sm",
462
221
  children: "Message *"
463
222
  }, undefined, false, undefined, this),
464
- /* @__PURE__ */ jsxDEV2("textarea", {
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: "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"
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__ */ jsxDEV2("div", {
476
- className: "bg-destructive/10 text-destructive rounded-md p-3 text-sm",
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__ */ jsxDEV2("div", {
238
+ /* @__PURE__ */ jsxDEV("div", {
480
239
  className: "flex justify-end gap-3 pt-2",
481
240
  children: [
482
- /* @__PURE__ */ jsxDEV2(Button2, {
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__ */ jsxDEV2(Button2, {
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__ */ jsxDEV2("div", {
256
+ mode === "confirm" && confirmAction === "archive" && /* @__PURE__ */ jsxDEV("div", {
498
257
  className: "space-y-4",
499
258
  children: [
500
- /* @__PURE__ */ jsxDEV2("p", {
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__ */ jsxDEV2("span", {
506
- className: "text-foreground font-medium",
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__ */ jsxDEV2("p", {
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 text-destructive rounded-md p-3 text-sm",
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: () => setMode("menu"),
525
+ onPress: onClose,
526
526
  disabled: isLoading,
527
527
  children: "Cancel"
528
528
  }, undefined, false, undefined, this),
529
529
  /* @__PURE__ */ jsxDEV2(Button2, {
530
- onPress: () => handleStatusChange("archive"),
530
+ type: "submit",
531
531
  disabled: isLoading,
532
- children: isLoading ? "Archiving..." : "\uD83D\uDCE6 Archive"
532
+ children: isLoading ? "Creating..." : "Create Agent"
533
533
  }, undefined, false, undefined, this)
534
534
  ]
535
535
  }, undefined, true, undefined, this)