@datatechsolutions/ui 3.9.1 → 3.11.0
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/astrlabe/contracts.d.mts +18 -2
- package/dist/astrlabe/contracts.d.ts +18 -2
- package/dist/astrlabe/index.d.mts +2 -2
- package/dist/astrlabe/index.d.ts +2 -2
- package/dist/astrlabe/index.js +109 -109
- package/dist/astrlabe/index.mjs +5 -5
- package/dist/astrlabe/workflow-canvas.js +5 -5
- package/dist/astrlabe/workflow-canvas.mjs +4 -4
- package/dist/{chunk-SJ6SUS7H.mjs → chunk-2AJ73ULK.mjs} +3 -3
- package/dist/{chunk-SJ6SUS7H.mjs.map → chunk-2AJ73ULK.mjs.map} +1 -1
- package/dist/{chunk-WJENX6KB.js → chunk-35O2X7WY.js} +9 -9
- package/dist/{chunk-WJENX6KB.js.map → chunk-35O2X7WY.js.map} +1 -1
- package/dist/{chunk-ZQRUAXGP.mjs → chunk-35P352JX.mjs} +331 -200
- package/dist/chunk-35P352JX.mjs.map +1 -0
- package/dist/{chunk-6QJI5YOJ.mjs → chunk-37FWIPYO.mjs} +3 -3
- package/dist/{chunk-6QJI5YOJ.mjs.map → chunk-37FWIPYO.mjs.map} +1 -1
- package/dist/{chunk-EAIE4QGD.mjs → chunk-3US2QXEF.mjs} +20 -20
- package/dist/{chunk-EAIE4QGD.mjs.map → chunk-3US2QXEF.mjs.map} +1 -1
- package/dist/{chunk-R6GEJBFC.js → chunk-62BD4WLW.js} +34 -34
- package/dist/{chunk-R6GEJBFC.js.map → chunk-62BD4WLW.js.map} +1 -1
- package/dist/{chunk-7AM2SXEF.js → chunk-6TKCMQ75.js} +85 -85
- package/dist/{chunk-7AM2SXEF.js.map → chunk-6TKCMQ75.js.map} +1 -1
- package/dist/{chunk-OVQ4MKCV.mjs → chunk-7D52TFVL.mjs} +3 -3
- package/dist/{chunk-OVQ4MKCV.mjs.map → chunk-7D52TFVL.mjs.map} +1 -1
- package/dist/{chunk-PD3JLDA5.mjs → chunk-7KPMLHPR.mjs} +3 -3
- package/dist/{chunk-PD3JLDA5.mjs.map → chunk-7KPMLHPR.mjs.map} +1 -1
- package/dist/{chunk-DQIEVLA3.js → chunk-7MPIYSRH.js} +63 -63
- package/dist/{chunk-DQIEVLA3.js.map → chunk-7MPIYSRH.js.map} +1 -1
- package/dist/{chunk-2ZY3IQ2I.mjs → chunk-7V7WEXHS.mjs} +3 -3
- package/dist/{chunk-2ZY3IQ2I.mjs.map → chunk-7V7WEXHS.mjs.map} +1 -1
- package/dist/{chunk-T4IYOKHR.js → chunk-BCJATFZE.js} +25 -25
- package/dist/{chunk-T4IYOKHR.js.map → chunk-BCJATFZE.js.map} +1 -1
- package/dist/{chunk-ZDXEGSCF.js → chunk-BO3RXG6M.js} +45 -45
- package/dist/{chunk-ZDXEGSCF.js.map → chunk-BO3RXG6M.js.map} +1 -1
- package/dist/{chunk-CRBGZA6Y.js → chunk-G52HXPSB.js} +13 -13
- package/dist/{chunk-CRBGZA6Y.js.map → chunk-G52HXPSB.js.map} +1 -1
- package/dist/{chunk-UZIICTIY.js → chunk-GKI74CPB.js} +55 -55
- package/dist/{chunk-UZIICTIY.js.map → chunk-GKI74CPB.js.map} +1 -1
- package/dist/{chunk-RFUSH7WD.js → chunk-GTJGX7IZ.js} +10 -10
- package/dist/{chunk-RFUSH7WD.js.map → chunk-GTJGX7IZ.js.map} +1 -1
- package/dist/{chunk-U6VFS3RD.js → chunk-H475T2N7.js} +143 -143
- package/dist/chunk-H475T2N7.js.map +1 -0
- package/dist/{chunk-ZQEMKEEH.mjs → chunk-HUAWGBYL.mjs} +3 -3
- package/dist/{chunk-ZQEMKEEH.mjs.map → chunk-HUAWGBYL.mjs.map} +1 -1
- package/dist/{chunk-RHRJXK5R.mjs → chunk-IGOMJHC6.mjs} +11 -3
- package/dist/chunk-IGOMJHC6.mjs.map +1 -0
- package/dist/{chunk-6E2YH67A.js → chunk-JTD3BBVI.js} +35 -35
- package/dist/{chunk-6E2YH67A.js.map → chunk-JTD3BBVI.js.map} +1 -1
- package/dist/{chunk-2E7HYTS7.mjs → chunk-K4AJL4BH.mjs} +3 -3
- package/dist/{chunk-2E7HYTS7.mjs.map → chunk-K4AJL4BH.mjs.map} +1 -1
- package/dist/{chunk-OEZ7GAJY.mjs → chunk-KTEEXEAX.mjs} +6 -6
- package/dist/{chunk-OEZ7GAJY.mjs.map → chunk-KTEEXEAX.mjs.map} +1 -1
- package/dist/{chunk-WS3IJFPW.mjs → chunk-NM3YTQ26.mjs} +3 -3
- package/dist/{chunk-WS3IJFPW.mjs.map → chunk-NM3YTQ26.mjs.map} +1 -1
- package/dist/{chunk-BWUFLW5W.mjs → chunk-NRVV4PHB.mjs} +7 -7
- package/dist/{chunk-BWUFLW5W.mjs.map → chunk-NRVV4PHB.mjs.map} +1 -1
- package/dist/{chunk-A2RIX2RK.js → chunk-O2CUOJ74.js} +4 -4
- package/dist/{chunk-A2RIX2RK.js.map → chunk-O2CUOJ74.js.map} +1 -1
- package/dist/{chunk-CLTNCBSP.js → chunk-PHBZ3TXE.js} +4 -4
- package/dist/{chunk-CLTNCBSP.js.map → chunk-PHBZ3TXE.js.map} +1 -1
- package/dist/{chunk-ARLYOLSO.mjs → chunk-R3CGJK7D.mjs} +3 -3
- package/dist/{chunk-ARLYOLSO.mjs.map → chunk-R3CGJK7D.mjs.map} +1 -1
- package/dist/{chunk-GQWC4EKE.mjs → chunk-TCIK6WHT.mjs} +24 -22
- package/dist/chunk-TCIK6WHT.mjs.map +1 -0
- package/dist/{chunk-IVKFXPLO.js → chunk-Z6FZQOTW.js} +46 -44
- package/dist/chunk-Z6FZQOTW.js.map +1 -0
- package/dist/{chunk-MT66VKLS.js → chunk-ZGVN23J4.js} +331 -200
- package/dist/chunk-ZGVN23J4.js.map +1 -0
- package/dist/{chunk-AXBD6OAF.mjs → chunk-ZJMYLUZ2.mjs} +12 -12
- package/dist/chunk-ZJMYLUZ2.mjs.map +1 -0
- package/dist/{chunk-SY4MUT5V.js → chunk-ZUU7G3PC.js} +11 -2
- package/dist/chunk-ZUU7G3PC.js.map +1 -0
- package/dist/index.d.mts +124 -34
- package/dist/index.d.ts +124 -34
- package/dist/index.js +666 -666
- package/dist/index.mjs +3 -3
- package/dist/platform/admin/index.js +11 -11
- package/dist/platform/admin/index.mjs +5 -5
- package/dist/platform/agents-workspace.js +8 -8
- package/dist/platform/agents-workspace.mjs +7 -7
- package/dist/platform/app-shell.js +5 -5
- package/dist/platform/app-shell.mjs +4 -4
- package/dist/platform/auth/index.js +23 -23
- package/dist/platform/auth/index.mjs +5 -5
- package/dist/platform/billing/index.js +5 -5
- package/dist/platform/billing/index.mjs +4 -4
- package/dist/platform/impersonation/index.js +5 -5
- package/dist/platform/impersonation/index.mjs +4 -4
- package/dist/platform/index.js +86 -86
- package/dist/platform/index.mjs +19 -19
- package/dist/platform/pages/index.d.mts +238 -6
- package/dist/platform/pages/index.d.ts +238 -6
- package/dist/platform/pages/index.js +2093 -345
- package/dist/platform/pages/index.js.map +1 -1
- package/dist/platform/pages/index.mjs +1872 -126
- package/dist/platform/pages/index.mjs.map +1 -1
- package/dist/platform/settings/index.js +8 -8
- package/dist/platform/settings/index.mjs +7 -7
- package/dist/platform/workflow-api-client.d.mts +1 -1
- package/dist/platform/workflow-api-client.d.ts +1 -1
- package/dist/platform/workflow-api-client.js +65 -61
- package/dist/platform/workflow-api-client.mjs +1 -1
- package/dist/platform/workflow-canvas-shell.js +6 -6
- package/dist/platform/workflow-canvas-shell.mjs +5 -5
- package/dist/{rule-form-BYJzyork.d.mts → rule-form-BkKCY8Tc.d.mts} +8 -2
- package/dist/{rule-form-BYJzyork.d.ts → rule-form-CBD8wlrw.d.ts} +8 -2
- package/dist/{workflow-api-client-CpFl3WcG.d.mts → workflow-api-client-D9_0Spdz.d.mts} +16 -1
- package/dist/{workflow-api-client-uLICOanv.d.ts → workflow-api-client-E1QFRgeP.d.ts} +16 -1
- package/package.json +1 -1
- package/dist/chunk-AXBD6OAF.mjs.map +0 -1
- package/dist/chunk-GQWC4EKE.mjs.map +0 -1
- package/dist/chunk-IVKFXPLO.js.map +0 -1
- package/dist/chunk-MT66VKLS.js.map +0 -1
- package/dist/chunk-RHRJXK5R.mjs.map +0 -1
- package/dist/chunk-SY4MUT5V.js.map +0 -1
- package/dist/chunk-U6VFS3RD.js.map +0 -1
- package/dist/chunk-ZQRUAXGP.mjs.map +0 -1
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunk3T2WGL47_js = require('../../chunk-3T2WGL47.js');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
5
|
+
var chunkZ6FZQOTW_js = require('../../chunk-Z6FZQOTW.js');
|
|
6
|
+
var chunk62BD4WLW_js = require('../../chunk-62BD4WLW.js');
|
|
7
|
+
var chunkH475T2N7_js = require('../../chunk-H475T2N7.js');
|
|
8
8
|
require('../../chunk-55H6WZQP.js');
|
|
9
9
|
require('../../chunk-DJDZIRM6.js');
|
|
10
|
-
require('../../chunk-
|
|
11
|
-
var
|
|
12
|
-
require('../../chunk-
|
|
13
|
-
require('../../chunk-SY4MUT5V.js');
|
|
10
|
+
require('../../chunk-6TKCMQ75.js');
|
|
11
|
+
var chunkZGVN23J4_js = require('../../chunk-ZGVN23J4.js');
|
|
12
|
+
require('../../chunk-ZUU7G3PC.js');
|
|
14
13
|
require('../../chunk-2OZZH2IO.js');
|
|
14
|
+
require('../../chunk-YXN2K77G.js');
|
|
15
15
|
require('../../chunk-EZQ2D47U.js');
|
|
16
16
|
var chunkBHOT22QL_js = require('../../chunk-BHOT22QL.js');
|
|
17
17
|
require('../../chunk-UZ3CMNUJ.js');
|
|
@@ -27,36 +27,35 @@ function AgentsModelsPageView({ labels, models, loading }) {
|
|
|
27
27
|
const filteredModels = searchTerm.trim() ? allModels.filter((model) => model.name.toLowerCase().includes(searchTerm.trim().toLowerCase())) : allModels;
|
|
28
28
|
const isEmpty = allModels.length === 0;
|
|
29
29
|
const hero = /* @__PURE__ */ jsxRuntime.jsx(
|
|
30
|
-
|
|
30
|
+
chunkZGVN23J4_js.HeroSection,
|
|
31
31
|
{
|
|
32
32
|
icon: /* @__PURE__ */ jsxRuntime.jsx(outline.CubeTransparentIcon, { className: "h-5 w-5" }),
|
|
33
33
|
label: labels.title,
|
|
34
34
|
title: labels.title,
|
|
35
35
|
subtitle: labels.subtitle,
|
|
36
|
-
gradient: "from-emerald-500 to-teal-700"
|
|
36
|
+
gradient: "from-emerald-500 to-teal-700",
|
|
37
|
+
toolbar: !isEmpty ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
38
|
+
chunkZGVN23J4_js.SearchBar,
|
|
39
|
+
{
|
|
40
|
+
searchTerm,
|
|
41
|
+
onSearchChange: setSearchTerm,
|
|
42
|
+
placeholder: labels.searchPlaceholder ?? labels.title,
|
|
43
|
+
noBorder: true
|
|
44
|
+
}
|
|
45
|
+
) : void 0
|
|
37
46
|
}
|
|
38
47
|
);
|
|
39
|
-
const content = loading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
{
|
|
51
|
-
accentGradient: "from-emerald-500 to-teal-700",
|
|
52
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-11 w-11 items-center justify-center rounded-lg bg-emerald-500/10 text-emerald-600 dark:bg-emerald-500/20 dark:text-emerald-400", children: /* @__PURE__ */ jsxRuntime.jsx(outline.CubeTransparentIcon, { className: "h-6 w-6" }) }),
|
|
53
|
-
title: model.name,
|
|
54
|
-
subtitle: `${labels.provider}: ${model.provider}`,
|
|
55
|
-
status: /* @__PURE__ */ jsxRuntime.jsx(chunkBHOT22QL_js.Badge, { color: model.enabled ? "emerald" : "zinc", children: model.enabled ? labels.enabled : labels.disabled })
|
|
56
|
-
},
|
|
57
|
-
model.id
|
|
58
|
-
)) })
|
|
59
|
-
] });
|
|
48
|
+
const content = loading ? /* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.PageLoadingState, {}) : isEmpty ? /* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.PageEmptyState, { title: labels.empty, message: labels.subtitle, iconName: "folder-open" }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3", children: filteredModels.map((model) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
49
|
+
chunkZGVN23J4_js.EntityCard,
|
|
50
|
+
{
|
|
51
|
+
accentGradient: "from-emerald-500 to-teal-700",
|
|
52
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-11 w-11 items-center justify-center rounded-lg bg-emerald-500/10 text-emerald-600 dark:bg-emerald-500/20 dark:text-emerald-400", children: /* @__PURE__ */ jsxRuntime.jsx(outline.CubeTransparentIcon, { className: "h-6 w-6" }) }),
|
|
53
|
+
title: model.name,
|
|
54
|
+
subtitle: `${labels.provider}: ${model.provider}`,
|
|
55
|
+
status: /* @__PURE__ */ jsxRuntime.jsx(chunkBHOT22QL_js.Badge, { color: model.enabled ? "emerald" : "zinc", children: model.enabled ? labels.enabled : labels.disabled })
|
|
56
|
+
},
|
|
57
|
+
model.id
|
|
58
|
+
)) });
|
|
60
59
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
61
60
|
hero,
|
|
62
61
|
content
|
|
@@ -71,7 +70,7 @@ function AgentsConfigPageView({ labels, agents, models, loading, onCreate, onUpd
|
|
|
71
70
|
const filteredAgents = searchTerm.trim() ? allAgents.filter((agent) => String(agent.name ?? "").toLowerCase().includes(searchTerm.trim().toLowerCase())) : allAgents;
|
|
72
71
|
const isEmpty = allAgents.length === 0;
|
|
73
72
|
const hero = /* @__PURE__ */ jsxRuntime.jsx(
|
|
74
|
-
|
|
73
|
+
chunkZGVN23J4_js.HeroSection,
|
|
75
74
|
{
|
|
76
75
|
icon: /* @__PURE__ */ jsxRuntime.jsx(outline.CpuChipIcon, { className: "h-5 w-5" }),
|
|
77
76
|
label: labels.title,
|
|
@@ -79,7 +78,7 @@ function AgentsConfigPageView({ labels, agents, models, loading, onCreate, onUpd
|
|
|
79
78
|
subtitle: labels.subtitle,
|
|
80
79
|
gradient: "from-violet-500 to-indigo-700",
|
|
81
80
|
toolbar: !isEmpty ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
82
|
-
|
|
81
|
+
chunkZGVN23J4_js.SearchBar,
|
|
83
82
|
{
|
|
84
83
|
searchTerm,
|
|
85
84
|
onSearchChange: setSearchTerm,
|
|
@@ -88,7 +87,7 @@ function AgentsConfigPageView({ labels, agents, models, loading, onCreate, onUpd
|
|
|
88
87
|
}
|
|
89
88
|
) : void 0,
|
|
90
89
|
actions: /* @__PURE__ */ jsxRuntime.jsx(
|
|
91
|
-
|
|
90
|
+
chunkZGVN23J4_js.CreateActionButton,
|
|
92
91
|
{
|
|
93
92
|
mode: "desktop",
|
|
94
93
|
label: labels.addAgent,
|
|
@@ -99,7 +98,7 @@ function AgentsConfigPageView({ labels, agents, models, loading, onCreate, onUpd
|
|
|
99
98
|
}
|
|
100
99
|
);
|
|
101
100
|
const mobileAction = /* @__PURE__ */ jsxRuntime.jsx(
|
|
102
|
-
|
|
101
|
+
chunkZGVN23J4_js.CreateActionButton,
|
|
103
102
|
{
|
|
104
103
|
mode: "mobile",
|
|
105
104
|
label: labels.addAgent,
|
|
@@ -107,10 +106,10 @@ function AgentsConfigPageView({ labels, agents, models, loading, onCreate, onUpd
|
|
|
107
106
|
accent: "violet"
|
|
108
107
|
}
|
|
109
108
|
);
|
|
110
|
-
const content = loading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
109
|
+
const content = loading ? /* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.PageLoadingState, {}) : isEmpty ? /* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.PageEmptyState, { title: labels.empty, message: labels.subtitle, iconName: "folder-open" }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3", children: filteredAgents.map((agent) => {
|
|
111
110
|
const modelRecord = models.find((model) => model.id === String(agent.modelId ?? ""));
|
|
112
111
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
113
|
-
|
|
112
|
+
chunkZGVN23J4_js.EntityCard,
|
|
114
113
|
{
|
|
115
114
|
accentGradient: "from-violet-500 to-indigo-700",
|
|
116
115
|
icon: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-11 w-11 items-center justify-center rounded-lg bg-violet-500/10 text-violet-600 dark:bg-violet-500/20 dark:text-violet-400", children: /* @__PURE__ */ jsxRuntime.jsx(outline.CpuChipIcon, { className: "h-6 w-6" }) }),
|
|
@@ -147,7 +146,7 @@ function AgentsConfigPageView({ labels, agents, models, loading, onCreate, onUpd
|
|
|
147
146
|
);
|
|
148
147
|
}) });
|
|
149
148
|
const renderForm = (initial, onSubmit) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
150
|
-
|
|
149
|
+
chunkZGVN23J4_js.GlassModal,
|
|
151
150
|
{
|
|
152
151
|
open: true,
|
|
153
152
|
onClose: () => {
|
|
@@ -170,13 +169,13 @@ function AgentsConfigPageView({ labels, agents, models, loading, onCreate, onUpd
|
|
|
170
169
|
outputSchema: String(form.get("outputSchema") ?? "").trim() || void 0
|
|
171
170
|
});
|
|
172
171
|
},
|
|
173
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
174
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
175
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
176
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
177
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
178
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
179
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
172
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(chunkZGVN23J4_js.FormGrid, { children: [
|
|
173
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.FormInput, { name: "name", label: labels.name, defaultValue: initial.name ?? "", required: true }),
|
|
174
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.FormSelect, { name: "modelId", label: labels.model, options: modelOptions, defaultValue: initial.modelId ?? modelOptions[0]?.value ?? "", required: true }),
|
|
175
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.FormInput, { name: "maxTokens", label: String(labels.maxTokens), type: "number", defaultValue: String(initial.maxTokens ?? 2048) }),
|
|
176
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.FormInput, { name: "temperature", label: labels.temperature, type: "number", step: 0.1, min: 0, max: 2, defaultValue: String(initial.temperature ?? 0.2) }),
|
|
177
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.FormTextarea, { name: "systemPrompt", label: labels.systemPrompt, defaultValue: initial.systemPrompt ?? "", rows: 4 }),
|
|
178
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.FormTextarea, { name: "outputSchema", label: labels.outputSchema, placeholder: labels.outputSchemaPlaceholder, defaultValue: initial.outputSchema ?? "", rows: 4 })
|
|
180
179
|
] })
|
|
181
180
|
}
|
|
182
181
|
);
|
|
@@ -243,7 +242,7 @@ function AgentsPromptsPageView({ labels, agents, prompts, loading, onCreate, onA
|
|
|
243
242
|
}) : allPrompts;
|
|
244
243
|
const isEmpty = allPrompts.length === 0;
|
|
245
244
|
const hero = /* @__PURE__ */ jsxRuntime.jsx(
|
|
246
|
-
|
|
245
|
+
chunkZGVN23J4_js.HeroSection,
|
|
247
246
|
{
|
|
248
247
|
icon: /* @__PURE__ */ jsxRuntime.jsx(outline.ChatBubbleLeftEllipsisIcon, { className: "h-5 w-5" }),
|
|
249
248
|
label: labels.title,
|
|
@@ -251,7 +250,7 @@ function AgentsPromptsPageView({ labels, agents, prompts, loading, onCreate, onA
|
|
|
251
250
|
subtitle: labels.subtitle,
|
|
252
251
|
gradient: "from-sky-500 to-blue-700",
|
|
253
252
|
toolbar: /* @__PURE__ */ jsxRuntime.jsx(
|
|
254
|
-
|
|
253
|
+
chunkZGVN23J4_js.CreateActionButton,
|
|
255
254
|
{
|
|
256
255
|
mode: "desktop",
|
|
257
256
|
label: labels.addPrompt,
|
|
@@ -262,7 +261,7 @@ function AgentsPromptsPageView({ labels, agents, prompts, loading, onCreate, onA
|
|
|
262
261
|
}
|
|
263
262
|
);
|
|
264
263
|
const mobileAction = /* @__PURE__ */ jsxRuntime.jsx(
|
|
265
|
-
|
|
264
|
+
chunkZGVN23J4_js.CreateActionButton,
|
|
266
265
|
{
|
|
267
266
|
mode: "mobile",
|
|
268
267
|
label: labels.addPrompt,
|
|
@@ -270,9 +269,9 @@ function AgentsPromptsPageView({ labels, agents, prompts, loading, onCreate, onA
|
|
|
270
269
|
accent: "sky"
|
|
271
270
|
}
|
|
272
271
|
);
|
|
273
|
-
const content = loading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
272
|
+
const content = loading ? /* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.PageLoadingState, {}) : isEmpty ? /* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.PageEmptyState, { title: labels.empty, message: labels.subtitle, iconName: "folder-open" }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
274
273
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
275
|
-
|
|
274
|
+
chunkZGVN23J4_js.SearchBar,
|
|
276
275
|
{
|
|
277
276
|
searchTerm,
|
|
278
277
|
onSearchChange: setSearchTerm,
|
|
@@ -283,7 +282,7 @@ function AgentsPromptsPageView({ labels, agents, prompts, loading, onCreate, onA
|
|
|
283
282
|
const agentName = agentNameById.get(prompt.agentId) ?? prompt.agentId;
|
|
284
283
|
const key = `${prompt.agentId}:${prompt.locale}:${prompt.version}`;
|
|
285
284
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
286
|
-
|
|
285
|
+
chunkZGVN23J4_js.EntityCard,
|
|
287
286
|
{
|
|
288
287
|
accentGradient: "from-sky-500 to-blue-700",
|
|
289
288
|
icon: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-11 w-11 items-center justify-center rounded-lg bg-sky-500/10 text-sky-600 dark:bg-sky-500/20 dark:text-sky-400", children: /* @__PURE__ */ jsxRuntime.jsx(outline.ChatBubbleLeftEllipsisIcon, { className: "h-6 w-6" }) }),
|
|
@@ -318,7 +317,7 @@ function AgentsPromptsPageView({ labels, agents, prompts, loading, onCreate, onA
|
|
|
318
317
|
mobileAction
|
|
319
318
|
] }),
|
|
320
319
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
321
|
-
|
|
320
|
+
chunkZGVN23J4_js.GlassModal,
|
|
322
321
|
{
|
|
323
322
|
open: createOpen,
|
|
324
323
|
onClose: () => setCreateOpen(false),
|
|
@@ -342,11 +341,11 @@ function AgentsPromptsPageView({ labels, agents, prompts, loading, onCreate, onA
|
|
|
342
341
|
});
|
|
343
342
|
setCreateOpen(false);
|
|
344
343
|
},
|
|
345
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
346
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
347
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
344
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(chunkZGVN23J4_js.FormGrid, { children: [
|
|
345
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.FormSelect, { name: "agentId", label: labels.agent, options: agentOptions, required: true }),
|
|
346
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.FormSelect, { name: "locale", label: labels.locale, options: LOCALE_OPTIONS, defaultValue: "en" }),
|
|
348
347
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
349
|
-
|
|
348
|
+
chunkZGVN23J4_js.FormSelect,
|
|
350
349
|
{
|
|
351
350
|
name: "isActive",
|
|
352
351
|
label: labels.isActive,
|
|
@@ -354,10 +353,10 @@ function AgentsPromptsPageView({ labels, agents, prompts, loading, onCreate, onA
|
|
|
354
353
|
defaultValue: "true"
|
|
355
354
|
}
|
|
356
355
|
),
|
|
357
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
358
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
359
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
360
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
356
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.FormInput, { name: "reason", label: labels.reason }),
|
|
357
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.FormTextarea, { name: "systemPrompt", label: labels.systemPrompt, rows: 3 }),
|
|
358
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.FormTextarea, { name: "userTemplate", label: labels.userTemplate, rows: 3 }),
|
|
359
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.FormTextarea, { name: "prompt", label: labels.prompt, rows: 6, required: true })
|
|
361
360
|
] })
|
|
362
361
|
}
|
|
363
362
|
)
|
|
@@ -392,7 +391,7 @@ function AgentsToolDefinitionsPageView({ labels, tools, loading, onCreate, onUpd
|
|
|
392
391
|
const filteredTools = searchTerm.trim() ? allTools.filter((tool) => tool.name.toLowerCase().includes(searchTerm.trim().toLowerCase())) : allTools;
|
|
393
392
|
const isEmpty = allTools.length === 0;
|
|
394
393
|
const hero = /* @__PURE__ */ jsxRuntime.jsx(
|
|
395
|
-
|
|
394
|
+
chunkZGVN23J4_js.HeroSection,
|
|
396
395
|
{
|
|
397
396
|
icon: /* @__PURE__ */ jsxRuntime.jsx(outline.WrenchScrewdriverIcon, { className: "h-5 w-5" }),
|
|
398
397
|
label: labels.title,
|
|
@@ -400,7 +399,7 @@ function AgentsToolDefinitionsPageView({ labels, tools, loading, onCreate, onUpd
|
|
|
400
399
|
subtitle: labels.subtitle,
|
|
401
400
|
gradient: "from-amber-500 to-orange-700",
|
|
402
401
|
toolbar: /* @__PURE__ */ jsxRuntime.jsx(
|
|
403
|
-
|
|
402
|
+
chunkZGVN23J4_js.CreateActionButton,
|
|
404
403
|
{
|
|
405
404
|
mode: "desktop",
|
|
406
405
|
label: labels.addTool,
|
|
@@ -411,7 +410,7 @@ function AgentsToolDefinitionsPageView({ labels, tools, loading, onCreate, onUpd
|
|
|
411
410
|
}
|
|
412
411
|
);
|
|
413
412
|
const mobileAction = /* @__PURE__ */ jsxRuntime.jsx(
|
|
414
|
-
|
|
413
|
+
chunkZGVN23J4_js.CreateActionButton,
|
|
415
414
|
{
|
|
416
415
|
mode: "mobile",
|
|
417
416
|
label: labels.addTool,
|
|
@@ -419,9 +418,9 @@ function AgentsToolDefinitionsPageView({ labels, tools, loading, onCreate, onUpd
|
|
|
419
418
|
accent: "amber"
|
|
420
419
|
}
|
|
421
420
|
);
|
|
422
|
-
const content = loading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
421
|
+
const content = loading ? /* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.PageLoadingState, {}) : isEmpty ? /* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.PageEmptyState, { title: labels.empty, message: labels.subtitle, iconName: "folder-open" }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
423
422
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
424
|
-
|
|
423
|
+
chunkZGVN23J4_js.SearchBar,
|
|
425
424
|
{
|
|
426
425
|
searchTerm,
|
|
427
426
|
onSearchChange: setSearchTerm,
|
|
@@ -429,7 +428,7 @@ function AgentsToolDefinitionsPageView({ labels, tools, loading, onCreate, onUpd
|
|
|
429
428
|
}
|
|
430
429
|
),
|
|
431
430
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3", children: filteredTools.map((tool) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
432
|
-
|
|
431
|
+
chunkZGVN23J4_js.EntityCard,
|
|
433
432
|
{
|
|
434
433
|
accentGradient: "from-amber-500 to-orange-700",
|
|
435
434
|
icon: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-11 w-11 items-center justify-center rounded-lg bg-amber-500/10 text-amber-600 dark:bg-amber-500/20 dark:text-amber-400", children: /* @__PURE__ */ jsxRuntime.jsx(outline.WrenchScrewdriverIcon, { className: "h-6 w-6" }) }),
|
|
@@ -519,7 +518,7 @@ function ToolEditor({
|
|
|
519
518
|
setValue((v) => ({ ...v, [key]: next }));
|
|
520
519
|
};
|
|
521
520
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
522
|
-
|
|
521
|
+
chunkZGVN23J4_js.GlassModal,
|
|
523
522
|
{
|
|
524
523
|
open: true,
|
|
525
524
|
onClose,
|
|
@@ -532,9 +531,9 @@ function ToolEditor({
|
|
|
532
531
|
handleSubmit();
|
|
533
532
|
},
|
|
534
533
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-5", children: [
|
|
535
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
534
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkZGVN23J4_js.FormGrid, { children: [
|
|
536
535
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
537
|
-
|
|
536
|
+
chunkZGVN23J4_js.FormInput,
|
|
538
537
|
{
|
|
539
538
|
label: "Name",
|
|
540
539
|
required: true,
|
|
@@ -544,7 +543,7 @@ function ToolEditor({
|
|
|
544
543
|
}
|
|
545
544
|
),
|
|
546
545
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
547
|
-
|
|
546
|
+
chunkZGVN23J4_js.FormSelect,
|
|
548
547
|
{
|
|
549
548
|
label: "Tool type",
|
|
550
549
|
value: value.toolType,
|
|
@@ -554,7 +553,7 @@ function ToolEditor({
|
|
|
554
553
|
}
|
|
555
554
|
),
|
|
556
555
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
557
|
-
|
|
556
|
+
chunkZGVN23J4_js.FormSelect,
|
|
558
557
|
{
|
|
559
558
|
label: "Enabled",
|
|
560
559
|
value: value.enabled ? "true" : "false",
|
|
@@ -563,7 +562,7 @@ function ToolEditor({
|
|
|
563
562
|
}
|
|
564
563
|
),
|
|
565
564
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
566
|
-
|
|
565
|
+
chunkZGVN23J4_js.FormInput,
|
|
567
566
|
{
|
|
568
567
|
label: "Icon (optional)",
|
|
569
568
|
value: value.icon ?? "",
|
|
@@ -573,7 +572,7 @@ function ToolEditor({
|
|
|
573
572
|
)
|
|
574
573
|
] }),
|
|
575
574
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
576
|
-
|
|
575
|
+
chunkZGVN23J4_js.FormTextarea,
|
|
577
576
|
{
|
|
578
577
|
label: "Description",
|
|
579
578
|
rows: 2,
|
|
@@ -621,7 +620,7 @@ function ParametersEditor({
|
|
|
621
620
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
622
621
|
parameters.map((param, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-[1fr_160px_1fr_110px_auto] items-end gap-2", children: [
|
|
623
622
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
624
|
-
|
|
623
|
+
chunkZGVN23J4_js.FormInput,
|
|
625
624
|
{
|
|
626
625
|
label: "Name",
|
|
627
626
|
value: param.name,
|
|
@@ -630,7 +629,7 @@ function ParametersEditor({
|
|
|
630
629
|
}
|
|
631
630
|
),
|
|
632
631
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
633
|
-
|
|
632
|
+
chunkZGVN23J4_js.FormSelect,
|
|
634
633
|
{
|
|
635
634
|
label: "Type",
|
|
636
635
|
value: param.type,
|
|
@@ -639,7 +638,7 @@ function ParametersEditor({
|
|
|
639
638
|
}
|
|
640
639
|
),
|
|
641
640
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
642
|
-
|
|
641
|
+
chunkZGVN23J4_js.FormInput,
|
|
643
642
|
{
|
|
644
643
|
label: "Description",
|
|
645
644
|
value: param.description,
|
|
@@ -673,9 +672,9 @@ function HandlerConfigEditor({
|
|
|
673
672
|
if (toolType === "http") {
|
|
674
673
|
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "rounded-xl border border-slate-200 bg-slate-50/60 p-3 dark:border-slate-700 dark:bg-slate-900/40", children: [
|
|
675
674
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "mb-2 text-sm font-semibold text-slate-700 dark:text-slate-200", children: "HTTP handler" }),
|
|
676
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
675
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkZGVN23J4_js.FormGrid, { children: [
|
|
677
676
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
678
|
-
|
|
677
|
+
chunkZGVN23J4_js.FormSelect,
|
|
679
678
|
{
|
|
680
679
|
label: "Method",
|
|
681
680
|
value: stringProp(config, "method", "GET"),
|
|
@@ -684,7 +683,7 @@ function HandlerConfigEditor({
|
|
|
684
683
|
}
|
|
685
684
|
),
|
|
686
685
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
687
|
-
|
|
686
|
+
chunkZGVN23J4_js.FormInput,
|
|
688
687
|
{
|
|
689
688
|
label: "URL template",
|
|
690
689
|
value: stringProp(config, "url"),
|
|
@@ -694,7 +693,7 @@ function HandlerConfigEditor({
|
|
|
694
693
|
)
|
|
695
694
|
] }),
|
|
696
695
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
697
|
-
|
|
696
|
+
chunkZGVN23J4_js.FormTextarea,
|
|
698
697
|
{
|
|
699
698
|
label: "Headers (JSON)",
|
|
700
699
|
rows: 3,
|
|
@@ -704,7 +703,7 @@ function HandlerConfigEditor({
|
|
|
704
703
|
}
|
|
705
704
|
),
|
|
706
705
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
707
|
-
|
|
706
|
+
chunkZGVN23J4_js.FormTextarea,
|
|
708
707
|
{
|
|
709
708
|
label: "Body template",
|
|
710
709
|
rows: 3,
|
|
@@ -719,7 +718,7 @@ function HandlerConfigEditor({
|
|
|
719
718
|
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "rounded-xl border border-slate-200 bg-slate-50/60 p-3 dark:border-slate-700 dark:bg-slate-900/40", children: [
|
|
720
719
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "mb-2 text-sm font-semibold text-slate-700 dark:text-slate-200", children: "Function handler" }),
|
|
721
720
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
722
|
-
|
|
721
|
+
chunkZGVN23J4_js.FormInput,
|
|
723
722
|
{
|
|
724
723
|
label: "Implementation key",
|
|
725
724
|
value: stringProp(config, "implementationKey"),
|
|
@@ -733,9 +732,9 @@ function HandlerConfigEditor({
|
|
|
733
732
|
if (toolType === "database_query") {
|
|
734
733
|
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "rounded-xl border border-slate-200 bg-slate-50/60 p-3 dark:border-slate-700 dark:bg-slate-900/40", children: [
|
|
735
734
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "mb-2 text-sm font-semibold text-slate-700 dark:text-slate-200", children: "Database query handler" }),
|
|
736
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
735
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkZGVN23J4_js.FormGrid, { children: [
|
|
737
736
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
738
|
-
|
|
737
|
+
chunkZGVN23J4_js.FormInput,
|
|
739
738
|
{
|
|
740
739
|
label: "Datasource ID",
|
|
741
740
|
value: stringProp(config, "datasourceId"),
|
|
@@ -744,7 +743,7 @@ function HandlerConfigEditor({
|
|
|
744
743
|
}
|
|
745
744
|
),
|
|
746
745
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
747
|
-
|
|
746
|
+
chunkZGVN23J4_js.FormInput,
|
|
748
747
|
{
|
|
749
748
|
label: "Max rows",
|
|
750
749
|
type: "number",
|
|
@@ -754,7 +753,7 @@ function HandlerConfigEditor({
|
|
|
754
753
|
)
|
|
755
754
|
] }),
|
|
756
755
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
757
|
-
|
|
756
|
+
chunkZGVN23J4_js.FormTextarea,
|
|
758
757
|
{
|
|
759
758
|
label: "Query template",
|
|
760
759
|
rows: 4,
|
|
@@ -770,7 +769,7 @@ function HandlerConfigEditor({
|
|
|
770
769
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "mb-2 text-sm font-semibold text-slate-700 dark:text-slate-200", children: "Code execution handler" }),
|
|
771
770
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-2 text-xs text-amber-600 dark:text-amber-400", children: "Experimental \u2014 sandbox is not yet enforced. Only enable for trusted tools." }),
|
|
772
771
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
773
|
-
|
|
772
|
+
chunkZGVN23J4_js.FormSelect,
|
|
774
773
|
{
|
|
775
774
|
label: "Language",
|
|
776
775
|
value: stringProp(config, "language", "javascript"),
|
|
@@ -782,7 +781,7 @@ function HandlerConfigEditor({
|
|
|
782
781
|
}
|
|
783
782
|
),
|
|
784
783
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
785
|
-
|
|
784
|
+
chunkZGVN23J4_js.FormTextarea,
|
|
786
785
|
{
|
|
787
786
|
label: "Code",
|
|
788
787
|
rows: 6,
|
|
@@ -795,9 +794,9 @@ function HandlerConfigEditor({
|
|
|
795
794
|
}
|
|
796
795
|
return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "rounded-xl border border-slate-200 bg-slate-50/60 p-3 dark:border-slate-700 dark:bg-slate-900/40", children: [
|
|
797
796
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "mb-2 text-sm font-semibold text-slate-700 dark:text-slate-200", children: "API call handler" }),
|
|
798
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
797
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkZGVN23J4_js.FormGrid, { children: [
|
|
799
798
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
800
|
-
|
|
799
|
+
chunkZGVN23J4_js.FormInput,
|
|
801
800
|
{
|
|
802
801
|
label: "URL",
|
|
803
802
|
value: stringProp(config, "url"),
|
|
@@ -805,7 +804,7 @@ function HandlerConfigEditor({
|
|
|
805
804
|
}
|
|
806
805
|
),
|
|
807
806
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
808
|
-
|
|
807
|
+
chunkZGVN23J4_js.FormSelect,
|
|
809
808
|
{
|
|
810
809
|
label: "Auth",
|
|
811
810
|
value: stringProp(config, "authType", "bearer"),
|
|
@@ -819,7 +818,7 @@ function HandlerConfigEditor({
|
|
|
819
818
|
}
|
|
820
819
|
),
|
|
821
820
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
822
|
-
|
|
821
|
+
chunkZGVN23J4_js.FormInput,
|
|
823
822
|
{
|
|
824
823
|
label: "Credential secret id",
|
|
825
824
|
value: stringProp(config, "credentialRef"),
|
|
@@ -944,15 +943,19 @@ function setFromJson(set, key, raw) {
|
|
|
944
943
|
set(key, raw);
|
|
945
944
|
}
|
|
946
945
|
}
|
|
947
|
-
function RulesPageView({ labels, rules, loading, onCreate, onUpdate, onDelete }) {
|
|
946
|
+
function RulesPageView({ labels, rules, loading, onCreate, onUpdate, onDelete, onAddClick }) {
|
|
948
947
|
const [createOpen, setCreateOpen] = react.useState(false);
|
|
948
|
+
const openCreate = () => {
|
|
949
|
+
if (onAddClick) onAddClick();
|
|
950
|
+
else setCreateOpen(true);
|
|
951
|
+
};
|
|
949
952
|
const [editing, setEditing] = react.useState(null);
|
|
950
953
|
const [searchTerm, setSearchTerm] = react.useState("");
|
|
951
954
|
const allRules = rules;
|
|
952
955
|
const filteredRules = searchTerm.trim() ? allRules.filter((rule) => (rule.name ?? "").toLowerCase().includes(searchTerm.trim().toLowerCase())) : allRules;
|
|
953
956
|
const isEmpty = allRules.length === 0;
|
|
954
957
|
const hero = /* @__PURE__ */ jsxRuntime.jsx(
|
|
955
|
-
|
|
958
|
+
chunkZGVN23J4_js.HeroSection,
|
|
956
959
|
{
|
|
957
960
|
icon: /* @__PURE__ */ jsxRuntime.jsx(outline.AdjustmentsHorizontalIcon, { className: "h-5 w-5" }),
|
|
958
961
|
label: labels.title,
|
|
@@ -960,28 +963,28 @@ function RulesPageView({ labels, rules, loading, onCreate, onUpdate, onDelete })
|
|
|
960
963
|
subtitle: labels.subtitle,
|
|
961
964
|
gradient: "from-fuchsia-500 to-purple-700",
|
|
962
965
|
toolbar: /* @__PURE__ */ jsxRuntime.jsx(
|
|
963
|
-
|
|
966
|
+
chunkZGVN23J4_js.CreateActionButton,
|
|
964
967
|
{
|
|
965
968
|
mode: "desktop",
|
|
966
969
|
label: labels.addRule,
|
|
967
|
-
onClick:
|
|
970
|
+
onClick: openCreate,
|
|
968
971
|
accent: "fuchsia"
|
|
969
972
|
}
|
|
970
973
|
)
|
|
971
974
|
}
|
|
972
975
|
);
|
|
973
976
|
const mobileAction = /* @__PURE__ */ jsxRuntime.jsx(
|
|
974
|
-
|
|
977
|
+
chunkZGVN23J4_js.CreateActionButton,
|
|
975
978
|
{
|
|
976
979
|
mode: "mobile",
|
|
977
980
|
label: labels.addRule,
|
|
978
|
-
onClick:
|
|
981
|
+
onClick: openCreate,
|
|
979
982
|
accent: "fuchsia"
|
|
980
983
|
}
|
|
981
984
|
);
|
|
982
|
-
const content = loading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
985
|
+
const content = loading ? /* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.PageLoadingState, {}) : isEmpty ? /* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.PageEmptyState, { title: labels.empty, message: labels.subtitle, iconName: "folder-open" }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
983
986
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
984
|
-
|
|
987
|
+
chunkZGVN23J4_js.SearchBar,
|
|
985
988
|
{
|
|
986
989
|
searchTerm,
|
|
987
990
|
onSearchChange: setSearchTerm,
|
|
@@ -989,7 +992,7 @@ function RulesPageView({ labels, rules, loading, onCreate, onUpdate, onDelete })
|
|
|
989
992
|
}
|
|
990
993
|
),
|
|
991
994
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3", children: filteredRules.map((rule) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
992
|
-
|
|
995
|
+
chunkZGVN23J4_js.EntityCard,
|
|
993
996
|
{
|
|
994
997
|
accentGradient: "from-fuchsia-500 to-purple-700",
|
|
995
998
|
icon: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-11 w-11 items-center justify-center rounded-lg bg-fuchsia-500/10 text-fuchsia-600 dark:bg-fuchsia-500/20 dark:text-fuchsia-400", children: /* @__PURE__ */ jsxRuntime.jsx(outline.AdjustmentsHorizontalIcon, { className: "h-6 w-6" }) }),
|
|
@@ -1027,7 +1030,7 @@ function RulesPageView({ labels, rules, loading, onCreate, onUpdate, onDelete })
|
|
|
1027
1030
|
{
|
|
1028
1031
|
title: labels.createTitle,
|
|
1029
1032
|
saveLabel: labels.save,
|
|
1030
|
-
initial:
|
|
1033
|
+
initial: chunkH475T2N7_js.defaultRuleForm(),
|
|
1031
1034
|
onClose: () => setCreateOpen(false),
|
|
1032
1035
|
onSubmit: (value) => {
|
|
1033
1036
|
onCreate(value);
|
|
@@ -1059,7 +1062,7 @@ function RuleEditor({
|
|
|
1059
1062
|
}) {
|
|
1060
1063
|
const [value, setValue] = react.useState(initial);
|
|
1061
1064
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1062
|
-
|
|
1065
|
+
chunkZGVN23J4_js.GlassModal,
|
|
1063
1066
|
{
|
|
1064
1067
|
open: true,
|
|
1065
1068
|
onClose,
|
|
@@ -1071,12 +1074,12 @@ function RuleEditor({
|
|
|
1071
1074
|
event.preventDefault();
|
|
1072
1075
|
onSubmit(value);
|
|
1073
1076
|
},
|
|
1074
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1077
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunkH475T2N7_js.RuleForm, { value, onChange: setValue })
|
|
1075
1078
|
}
|
|
1076
1079
|
);
|
|
1077
1080
|
}
|
|
1078
1081
|
function ruleToFormValue(rule) {
|
|
1079
|
-
const base =
|
|
1082
|
+
const base = chunkH475T2N7_js.defaultRuleForm();
|
|
1080
1083
|
const rawCondition = rule.condition ?? rule.conditions;
|
|
1081
1084
|
const rawAction = pickAction(rule);
|
|
1082
1085
|
return {
|
|
@@ -1091,7 +1094,10 @@ function ruleToFormValue(rule) {
|
|
|
1091
1094
|
status: typeof rule.status === "string" ? rule.status : base.status,
|
|
1092
1095
|
validFrom: typeof rule.validFrom === "string" ? rule.validFrom : base.validFrom,
|
|
1093
1096
|
validUntil: typeof rule.validUntil === "string" ? rule.validUntil : base.validUntil,
|
|
1094
|
-
tags: Array.isArray(rule.tags) ? rule.tags.filter((tag) => typeof tag === "string") : base.tags
|
|
1097
|
+
tags: Array.isArray(rule.tags) ? rule.tags.filter((tag) => typeof tag === "string") : base.tags,
|
|
1098
|
+
// Round-trip recurrence (Fallback 4) — backend persists it as the
|
|
1099
|
+
// structured `{ kind, ... }` blob the wizard sends.
|
|
1100
|
+
recurrence: rule.recurrence ?? null
|
|
1095
1101
|
};
|
|
1096
1102
|
}
|
|
1097
1103
|
function pickAction(rule) {
|
|
@@ -1119,6 +1125,7 @@ var SAMPLE_DATASOURCES = [
|
|
|
1119
1125
|
timeoutMs: 3e4,
|
|
1120
1126
|
allowedTables: null,
|
|
1121
1127
|
blockedColumns: null,
|
|
1128
|
+
maskPii: null,
|
|
1122
1129
|
enabled: true,
|
|
1123
1130
|
createdAt: "2026-03-20T10:00:00Z",
|
|
1124
1131
|
updatedAt: "2026-03-20T10:00:00Z",
|
|
@@ -1135,6 +1142,7 @@ var SAMPLE_DATASOURCES = [
|
|
|
1135
1142
|
timeoutMs: 15e3,
|
|
1136
1143
|
allowedTables: null,
|
|
1137
1144
|
blockedColumns: null,
|
|
1145
|
+
maskPii: null,
|
|
1138
1146
|
enabled: true,
|
|
1139
1147
|
createdAt: "2026-03-18T08:30:00Z",
|
|
1140
1148
|
updatedAt: "2026-03-22T14:00:00Z",
|
|
@@ -1151,6 +1159,7 @@ var SAMPLE_DATASOURCES = [
|
|
|
1151
1159
|
timeoutMs: 3e4,
|
|
1152
1160
|
allowedTables: null,
|
|
1153
1161
|
blockedColumns: null,
|
|
1162
|
+
maskPii: null,
|
|
1154
1163
|
enabled: true,
|
|
1155
1164
|
createdAt: "2026-03-15T09:00:00Z",
|
|
1156
1165
|
updatedAt: "2026-03-21T11:00:00Z",
|
|
@@ -1167,6 +1176,7 @@ var SAMPLE_DATASOURCES = [
|
|
|
1167
1176
|
timeoutMs: 1e4,
|
|
1168
1177
|
allowedTables: null,
|
|
1169
1178
|
blockedColumns: null,
|
|
1179
|
+
maskPii: null,
|
|
1170
1180
|
enabled: false,
|
|
1171
1181
|
createdAt: "2026-03-10T12:00:00Z",
|
|
1172
1182
|
updatedAt: "2026-03-19T16:00:00Z",
|
|
@@ -1183,6 +1193,7 @@ var SAMPLE_DATASOURCES = [
|
|
|
1183
1193
|
timeoutMs: 5e3,
|
|
1184
1194
|
allowedTables: null,
|
|
1185
1195
|
blockedColumns: null,
|
|
1196
|
+
maskPii: null,
|
|
1186
1197
|
enabled: true,
|
|
1187
1198
|
createdAt: "2026-03-12T07:00:00Z",
|
|
1188
1199
|
updatedAt: "2026-03-23T09:00:00Z",
|
|
@@ -1199,6 +1210,7 @@ var SAMPLE_DATASOURCES = [
|
|
|
1199
1210
|
timeoutMs: 2e4,
|
|
1200
1211
|
allowedTables: null,
|
|
1201
1212
|
blockedColumns: null,
|
|
1213
|
+
maskPii: null,
|
|
1202
1214
|
enabled: true,
|
|
1203
1215
|
createdAt: "2026-03-22T15:00:00Z",
|
|
1204
1216
|
updatedAt: "2026-03-25T10:00:00Z",
|
|
@@ -1207,7 +1219,7 @@ var SAMPLE_DATASOURCES = [
|
|
|
1207
1219
|
];
|
|
1208
1220
|
function getDialectLabel(dialect) {
|
|
1209
1221
|
if (!dialect) return "Unknown";
|
|
1210
|
-
for (const category of
|
|
1222
|
+
for (const category of chunk62BD4WLW_js.DIALECT_CATEGORIES) {
|
|
1211
1223
|
const found = category.dialects.find((d) => d.value === dialect);
|
|
1212
1224
|
if (found) return found.label;
|
|
1213
1225
|
}
|
|
@@ -1215,12 +1227,12 @@ function getDialectLabel(dialect) {
|
|
|
1215
1227
|
}
|
|
1216
1228
|
function getDialectGradient(dialect) {
|
|
1217
1229
|
if (!dialect) return "from-gray-400 to-gray-500";
|
|
1218
|
-
const category =
|
|
1230
|
+
const category = chunk62BD4WLW_js.findCategory(dialect);
|
|
1219
1231
|
return category?.gradient ?? "from-gray-400 to-gray-500";
|
|
1220
1232
|
}
|
|
1221
1233
|
function getDialectIcon(dialect) {
|
|
1222
1234
|
if (!dialect) return outline.CircleStackIcon;
|
|
1223
|
-
const category =
|
|
1235
|
+
const category = chunk62BD4WLW_js.findCategory(dialect);
|
|
1224
1236
|
return category?.icon ?? outline.CircleStackIcon;
|
|
1225
1237
|
}
|
|
1226
1238
|
var DIALECT_LOGO = {
|
|
@@ -1259,9 +1271,14 @@ function DatasourcesPageView({
|
|
|
1259
1271
|
labels,
|
|
1260
1272
|
datasources: externalDatasources,
|
|
1261
1273
|
useSampleData = false,
|
|
1262
|
-
onCreate
|
|
1274
|
+
onCreate,
|
|
1275
|
+
onAddClick
|
|
1263
1276
|
}) {
|
|
1264
1277
|
const [modalOpen, setModalOpen] = react.useState(false);
|
|
1278
|
+
const openCreate = () => {
|
|
1279
|
+
if (onAddClick) onAddClick();
|
|
1280
|
+
else setModalOpen(true);
|
|
1281
|
+
};
|
|
1265
1282
|
const [searchTerm, setSearchTerm] = react.useState("");
|
|
1266
1283
|
const [localDatasources, setLocalDatasources] = react.useState(
|
|
1267
1284
|
useSampleData ? SAMPLE_DATASOURCES : []
|
|
@@ -1285,6 +1302,7 @@ function DatasourcesPageView({
|
|
|
1285
1302
|
timeoutMs: 3e4,
|
|
1286
1303
|
allowedTables: null,
|
|
1287
1304
|
blockedColumns: null,
|
|
1305
|
+
maskPii: null,
|
|
1288
1306
|
enabled: true,
|
|
1289
1307
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1290
1308
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -1294,7 +1312,7 @@ function DatasourcesPageView({
|
|
|
1294
1312
|
}
|
|
1295
1313
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
1296
1314
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1297
|
-
|
|
1315
|
+
chunkZGVN23J4_js.HeroSection,
|
|
1298
1316
|
{
|
|
1299
1317
|
icon: /* @__PURE__ */ jsxRuntime.jsx(outline.CircleStackIcon, { className: "h-5 w-5" }),
|
|
1300
1318
|
label: labels.title,
|
|
@@ -1302,27 +1320,27 @@ function DatasourcesPageView({
|
|
|
1302
1320
|
subtitle: labels.subtitle,
|
|
1303
1321
|
gradient: "from-amber-500 to-orange-600",
|
|
1304
1322
|
toolbar: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1305
|
-
|
|
1323
|
+
chunkZGVN23J4_js.CreateActionButton,
|
|
1306
1324
|
{
|
|
1307
1325
|
mode: "desktop",
|
|
1308
1326
|
label: labels.addDatasource,
|
|
1309
|
-
onClick:
|
|
1327
|
+
onClick: openCreate,
|
|
1310
1328
|
accent: "amber"
|
|
1311
1329
|
}
|
|
1312
1330
|
)
|
|
1313
1331
|
}
|
|
1314
1332
|
),
|
|
1315
1333
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1316
|
-
|
|
1334
|
+
chunkZGVN23J4_js.CreateActionButton,
|
|
1317
1335
|
{
|
|
1318
1336
|
mode: "mobile",
|
|
1319
1337
|
label: labels.addDatasource,
|
|
1320
|
-
onClick:
|
|
1338
|
+
onClick: openCreate,
|
|
1321
1339
|
accent: "amber"
|
|
1322
1340
|
}
|
|
1323
1341
|
),
|
|
1324
1342
|
!isEmpty && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1325
|
-
|
|
1343
|
+
chunkZGVN23J4_js.SearchBar,
|
|
1326
1344
|
{
|
|
1327
1345
|
searchTerm,
|
|
1328
1346
|
onSearchChange: setSearchTerm,
|
|
@@ -1330,7 +1348,7 @@ function DatasourcesPageView({
|
|
|
1330
1348
|
}
|
|
1331
1349
|
),
|
|
1332
1350
|
isEmpty ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1333
|
-
|
|
1351
|
+
chunkZGVN23J4_js.PageEmptyState,
|
|
1334
1352
|
{
|
|
1335
1353
|
title: labels.emptyTitle,
|
|
1336
1354
|
message: labels.emptyDescription,
|
|
@@ -1344,7 +1362,7 @@ function DatasourcesPageView({
|
|
|
1344
1362
|
const logoSrc = getDialectLogoSrc(ds.dialect);
|
|
1345
1363
|
const iconElement = logoSrc ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "liquid-surface flex h-11 w-11 items-center justify-center rounded-lg", children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: logoSrc, alt: dialectLabel, className: "h-7 w-7 object-contain" }) }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: `flex h-11 w-11 items-center justify-center rounded-lg bg-gradient-to-br ${gradient} shadow-lg`, children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "h-6 w-6 text-white" }) });
|
|
1346
1364
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1347
|
-
|
|
1365
|
+
chunkZGVN23J4_js.EntityCard,
|
|
1348
1366
|
{
|
|
1349
1367
|
accentGradient: gradient,
|
|
1350
1368
|
icon: iconElement,
|
|
@@ -1374,7 +1392,7 @@ function DatasourcesPageView({
|
|
|
1374
1392
|
);
|
|
1375
1393
|
}) }),
|
|
1376
1394
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1377
|
-
|
|
1395
|
+
chunk62BD4WLW_js.DatasourceModal,
|
|
1378
1396
|
{
|
|
1379
1397
|
open: modalOpen,
|
|
1380
1398
|
onClose: () => setModalOpen(false),
|
|
@@ -1403,37 +1421,36 @@ function AgentsIndexPageView({ labels }) {
|
|
|
1403
1421
|
const filteredTiles = searchTerm.trim() ? allTiles.filter((tile) => tile.title.toLowerCase().includes(searchTerm.trim().toLowerCase())) : allTiles;
|
|
1404
1422
|
const isEmpty = allTiles.length === 0;
|
|
1405
1423
|
const hero = /* @__PURE__ */ jsxRuntime.jsx(
|
|
1406
|
-
|
|
1424
|
+
chunkZGVN23J4_js.HeroSection,
|
|
1407
1425
|
{
|
|
1408
1426
|
icon: /* @__PURE__ */ jsxRuntime.jsx(outline.CpuChipIcon, { className: "h-5 w-5" }),
|
|
1409
1427
|
label: labels.title,
|
|
1410
1428
|
title: labels.title,
|
|
1411
1429
|
subtitle: labels.subtitle,
|
|
1412
|
-
gradient: "from-violet-500 to-indigo-700"
|
|
1430
|
+
gradient: "from-violet-500 to-indigo-700",
|
|
1431
|
+
toolbar: !isEmpty ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1432
|
+
chunkZGVN23J4_js.SearchBar,
|
|
1433
|
+
{
|
|
1434
|
+
searchTerm,
|
|
1435
|
+
onSearchChange: setSearchTerm,
|
|
1436
|
+
placeholder: labels.searchPlaceholder ?? labels.title,
|
|
1437
|
+
noBorder: true
|
|
1438
|
+
}
|
|
1439
|
+
) : void 0
|
|
1413
1440
|
}
|
|
1414
1441
|
);
|
|
1415
|
-
const content = /* @__PURE__ */ jsxRuntime.
|
|
1416
|
-
|
|
1417
|
-
|
|
1442
|
+
const content = /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4", children: filteredTiles.map((tile) => {
|
|
1443
|
+
const Icon = tile.icon;
|
|
1444
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Link, { href: tile.href, className: "block focus:outline-none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1445
|
+
chunkZGVN23J4_js.EntityCard,
|
|
1418
1446
|
{
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1447
|
+
accentGradient: tile.gradient,
|
|
1448
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx("div", { className: `flex h-11 w-11 items-center justify-center rounded-lg bg-gradient-to-br ${tile.gradient} shadow-lg`, children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "h-6 w-6 text-white" }) }),
|
|
1449
|
+
title: tile.title,
|
|
1450
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-slate-500 dark:text-slate-400", children: tile.subtitle })
|
|
1422
1451
|
}
|
|
1423
|
-
),
|
|
1424
|
-
|
|
1425
|
-
const Icon = tile.icon;
|
|
1426
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Link, { href: tile.href, className: "block focus:outline-none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1427
|
-
chunkMT66VKLS_js.EntityCard,
|
|
1428
|
-
{
|
|
1429
|
-
accentGradient: tile.gradient,
|
|
1430
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx("div", { className: `flex h-11 w-11 items-center justify-center rounded-lg bg-gradient-to-br ${tile.gradient} shadow-lg`, children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "h-6 w-6 text-white" }) }),
|
|
1431
|
-
title: tile.title,
|
|
1432
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-slate-500 dark:text-slate-400", children: tile.subtitle })
|
|
1433
|
-
}
|
|
1434
|
-
) }, tile.id);
|
|
1435
|
-
}) })
|
|
1436
|
-
] });
|
|
1452
|
+
) }, tile.id);
|
|
1453
|
+
}) });
|
|
1437
1454
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
1438
1455
|
hero,
|
|
1439
1456
|
content
|
|
@@ -1443,7 +1460,7 @@ function WorkflowsPageView({ labels, workflows, onCreate, onUpdateMeta, onPublis
|
|
|
1443
1460
|
const selectedWorkflow = workflows[0] ?? null;
|
|
1444
1461
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
1445
1462
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1446
|
-
|
|
1463
|
+
chunkZGVN23J4_js.SectionHeader,
|
|
1447
1464
|
{
|
|
1448
1465
|
icon: /* @__PURE__ */ jsxRuntime.jsx(outline.RectangleStackIcon, { className: "h-5 w-5 text-white" }),
|
|
1449
1466
|
title: labels.title,
|
|
@@ -1452,9 +1469,9 @@ function WorkflowsPageView({ labels, workflows, onCreate, onUpdateMeta, onPublis
|
|
|
1452
1469
|
}
|
|
1453
1470
|
),
|
|
1454
1471
|
/* @__PURE__ */ jsxRuntime.jsxs("section", { className: "liquid-surface rounded-2xl p-4 space-y-3", children: [
|
|
1455
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1472
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.Text, { className: "font-semibold text-slate-900 dark:text-slate-100", children: labels.add }),
|
|
1456
1473
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1457
|
-
|
|
1474
|
+
chunkZGVN23J4_js.Form,
|
|
1458
1475
|
{
|
|
1459
1476
|
onSubmit: (event) => {
|
|
1460
1477
|
event.preventDefault();
|
|
@@ -1465,32 +1482,32 @@ function WorkflowsPageView({ labels, workflows, onCreate, onUpdateMeta, onPublis
|
|
|
1465
1482
|
onCreate({ name, description });
|
|
1466
1483
|
event.currentTarget.reset();
|
|
1467
1484
|
},
|
|
1468
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1469
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1470
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1471
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1485
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(chunkZGVN23J4_js.FormGrid, { children: [
|
|
1486
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.FormInput, { name: "name", label: labels.workflowName, placeholder: labels.workflowNamePlaceholder, required: true }),
|
|
1487
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.FormTextarea, { name: "description", label: labels.description, placeholder: labels.workflowDescriptionPlaceholder, rows: 3 }),
|
|
1488
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.FormActionsRow, { children: /* @__PURE__ */ jsxRuntime.jsx(chunkBHOT22QL_js.Button, { type: "submit", children: labels.create }) })
|
|
1472
1489
|
] })
|
|
1473
1490
|
}
|
|
1474
1491
|
)
|
|
1475
1492
|
] }),
|
|
1476
1493
|
/* @__PURE__ */ jsxRuntime.jsxs("section", { className: "liquid-surface rounded-2xl p-4 space-y-3", children: [
|
|
1477
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1478
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1479
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1480
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1481
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1482
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1483
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1484
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1494
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.Text, { className: "font-semibold text-slate-900 dark:text-slate-100", children: labels.registry }),
|
|
1495
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkZGVN23J4_js.Table, { children: [
|
|
1496
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.TableHead, { children: /* @__PURE__ */ jsxRuntime.jsxs(chunkZGVN23J4_js.TableRow, { children: [
|
|
1497
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.TableHeader, { children: labels.name }),
|
|
1498
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.TableHeader, { children: labels.description }),
|
|
1499
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.TableHeader, { children: labels.version }),
|
|
1500
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.TableHeader, { children: labels.status }),
|
|
1501
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.TableHeader, { children: labels.actions })
|
|
1485
1502
|
] }) }),
|
|
1486
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1487
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1488
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1489
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1490
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1491
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1503
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.TableBody, { children: workflows.map((workflow) => /* @__PURE__ */ jsxRuntime.jsxs(chunkZGVN23J4_js.TableRow, { children: [
|
|
1504
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.TableCell, { children: workflow.name }),
|
|
1505
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.TableCell, { children: workflow.description }),
|
|
1506
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.TableCell, { children: String(workflow.version) }),
|
|
1507
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.TableCell, { children: /* @__PURE__ */ jsxRuntime.jsx(chunkBHOT22QL_js.Badge, { children: workflow.isDraft ? labels.statusDraft : labels.statusPublished }) }),
|
|
1508
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.TableCell, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
1492
1509
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1493
|
-
|
|
1510
|
+
chunkZGVN23J4_js.Form,
|
|
1494
1511
|
{
|
|
1495
1512
|
onSubmit: (event) => {
|
|
1496
1513
|
event.preventDefault();
|
|
@@ -1500,7 +1517,7 @@ function WorkflowsPageView({ labels, workflows, onCreate, onUpdateMeta, onPublis
|
|
|
1500
1517
|
description: workflow.description ?? ""
|
|
1501
1518
|
});
|
|
1502
1519
|
},
|
|
1503
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1520
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.InlineForm, { children: /* @__PURE__ */ jsxRuntime.jsx(chunkBHOT22QL_js.Button, { type: "submit", outline: true, children: labels.saveMeta }) })
|
|
1504
1521
|
}
|
|
1505
1522
|
),
|
|
1506
1523
|
/* @__PURE__ */ jsxRuntime.jsx(chunkBHOT22QL_js.Button, { type: "button", color: "sky", onClick: () => onPublish(workflow.id), children: labels.publish })
|
|
@@ -1509,8 +1526,8 @@ function WorkflowsPageView({ labels, workflows, onCreate, onUpdateMeta, onPublis
|
|
|
1509
1526
|
] })
|
|
1510
1527
|
] }),
|
|
1511
1528
|
/* @__PURE__ */ jsxRuntime.jsxs("section", { className: "liquid-surface rounded-2xl p-4 space-y-3", children: [
|
|
1512
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1513
|
-
selectedWorkflow ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-[680px] rounded-2xl border border-white/65 dark:border-white/12 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1529
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.Text, { className: "font-semibold text-slate-900 dark:text-slate-100", children: labels.workspace }),
|
|
1530
|
+
selectedWorkflow ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-[680px] rounded-2xl border border-white/65 dark:border-white/12 overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(chunkZ6FZQOTW_js.WorkflowWorkspace, { graph: chunk3T2WGL47_js.adaptWorkflowGraphToUi(selectedWorkflow.graph) }) }) : /* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.Text, { children: labels.empty })
|
|
1514
1531
|
] })
|
|
1515
1532
|
] });
|
|
1516
1533
|
}
|
|
@@ -1524,6 +1541,7 @@ var BADGE_COLOR = {
|
|
|
1524
1541
|
function WorkflowRunsPageView({ labels, runs, loading, onCancel, onReplay, onView, onViewTimeline }) {
|
|
1525
1542
|
const [statusFilter, setStatusFilter] = react.useState("all");
|
|
1526
1543
|
const [searchTerm, setSearchTerm] = react.useState("");
|
|
1544
|
+
const [filtersOpen, setFiltersOpen] = react.useState(false);
|
|
1527
1545
|
const statusOptions = react.useMemo(() => [
|
|
1528
1546
|
{ value: "all", label: labels.filterAll },
|
|
1529
1547
|
{ value: "pending", label: labels.statusPending },
|
|
@@ -1559,61 +1577,68 @@ function WorkflowRunsPageView({ labels, runs, loading, onCancel, onReplay, onVie
|
|
|
1559
1577
|
});
|
|
1560
1578
|
const isEmpty = allRuns.length === 0;
|
|
1561
1579
|
const hero = /* @__PURE__ */ jsxRuntime.jsx(
|
|
1562
|
-
|
|
1580
|
+
chunkZGVN23J4_js.HeroSection,
|
|
1563
1581
|
{
|
|
1564
1582
|
icon: /* @__PURE__ */ jsxRuntime.jsx(outline.ClockIcon, { className: "h-5 w-5" }),
|
|
1565
1583
|
label: labels.title,
|
|
1566
1584
|
title: labels.title,
|
|
1567
1585
|
subtitle: labels.subtitle,
|
|
1568
1586
|
gradient: "from-indigo-500 to-sky-700",
|
|
1569
|
-
toolbar:
|
|
1570
|
-
|
|
1587
|
+
toolbar: !isEmpty ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1588
|
+
chunkZGVN23J4_js.SearchBar,
|
|
1571
1589
|
{
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1590
|
+
searchTerm,
|
|
1591
|
+
onSearchChange: setSearchTerm,
|
|
1592
|
+
placeholder: labels.searchPlaceholder ?? labels.title,
|
|
1593
|
+
noBorder: true,
|
|
1594
|
+
filtersModal: {
|
|
1595
|
+
open: filtersOpen,
|
|
1596
|
+
onOpen: () => setFiltersOpen(true),
|
|
1597
|
+
onClose: () => setFiltersOpen(false),
|
|
1598
|
+
title: labels.filterStatus,
|
|
1599
|
+
count: statusFilter !== "all" ? 1 : 0,
|
|
1600
|
+
onClear: statusFilter !== "all" ? () => setStatusFilter("all") : void 0,
|
|
1601
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1602
|
+
chunkZGVN23J4_js.FormSelect,
|
|
1603
|
+
{
|
|
1604
|
+
name: "statusFilter",
|
|
1605
|
+
label: labels.filterStatus,
|
|
1606
|
+
options: statusOptions,
|
|
1607
|
+
value: statusFilter,
|
|
1608
|
+
onValueChange: setStatusFilter
|
|
1609
|
+
}
|
|
1610
|
+
)
|
|
1611
|
+
}
|
|
1577
1612
|
}
|
|
1578
|
-
)
|
|
1613
|
+
) : void 0
|
|
1579
1614
|
}
|
|
1580
1615
|
);
|
|
1581
|
-
const content = loading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
}
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
/* @__PURE__ */ jsxRuntime.jsx(chunkBHOT22QL_js.Button, { type: "button", size: "sm", outline: true, onClick: () => onReplay(run), children: labels.replay }),
|
|
1602
|
-
run.status === "running" && /* @__PURE__ */ jsxRuntime.jsx(chunkBHOT22QL_js.Button, { type: "button", size: "sm", color: "rose", onClick: () => onCancel(run), children: labels.cancel })
|
|
1616
|
+
const content = loading ? /* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.PageLoadingState, {}) : filteredRuns.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.PageEmptyState, { title: labels.empty, message: labels.subtitle, iconName: "folder-open" }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3", children: filteredRuns.map((run) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1617
|
+
chunkZGVN23J4_js.EntityCard,
|
|
1618
|
+
{
|
|
1619
|
+
accentGradient: "from-indigo-500 to-sky-700",
|
|
1620
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-11 w-11 items-center justify-center rounded-lg bg-indigo-500/10 text-indigo-600 dark:bg-indigo-500/20 dark:text-indigo-400", children: /* @__PURE__ */ jsxRuntime.jsx(outline.ClockIcon, { className: "h-6 w-6" }) }),
|
|
1621
|
+
title: run.id.slice(0, 8),
|
|
1622
|
+
subtitle: `${labels.startedAt}: ${new Date(run.createdAt).toLocaleString()}`,
|
|
1623
|
+
status: /* @__PURE__ */ jsxRuntime.jsx(chunkBHOT22QL_js.Badge, { color: BADGE_COLOR[run.status] ?? "zinc", children: statusLabelFor(run.status) }),
|
|
1624
|
+
footer: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
|
|
1625
|
+
onView && /* @__PURE__ */ jsxRuntime.jsx(chunkBHOT22QL_js.Button, { type: "button", size: "sm", outline: true, onClick: () => onView(run), children: labels.view }),
|
|
1626
|
+
onViewTimeline && labels.timeline && /* @__PURE__ */ jsxRuntime.jsx(chunkBHOT22QL_js.Button, { type: "button", size: "sm", outline: true, onClick: () => onViewTimeline(run), children: labels.timeline }),
|
|
1627
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkBHOT22QL_js.Button, { type: "button", size: "sm", outline: true, onClick: () => onReplay(run), children: labels.replay }),
|
|
1628
|
+
run.status === "running" && /* @__PURE__ */ jsxRuntime.jsx(chunkBHOT22QL_js.Button, { type: "button", size: "sm", color: "rose", onClick: () => onCancel(run), children: labels.cancel })
|
|
1629
|
+
] }),
|
|
1630
|
+
children: [
|
|
1631
|
+
/* @__PURE__ */ jsxRuntime.jsxs("dl", { className: "mt-1 grid grid-cols-2 gap-1 text-xs text-slate-500 dark:text-slate-400", children: [
|
|
1632
|
+
/* @__PURE__ */ jsxRuntime.jsx("dt", { children: labels.duration }),
|
|
1633
|
+
/* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-right", children: chunk3T2WGL47_js.formatDurationMs(run.totalDurationMs) }),
|
|
1634
|
+
/* @__PURE__ */ jsxRuntime.jsx("dt", { children: labels.triggeredBy }),
|
|
1635
|
+
/* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-right truncate", children: run.triggeredBy || "\u2014" })
|
|
1603
1636
|
] }),
|
|
1604
|
-
children:
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
/* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-right truncate", children: run.triggeredBy || "\u2014" })
|
|
1610
|
-
] }),
|
|
1611
|
-
run.error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 line-clamp-2 text-xs text-rose-600 dark:text-rose-400", children: run.error })
|
|
1612
|
-
]
|
|
1613
|
-
},
|
|
1614
|
-
run.id
|
|
1615
|
-
)) })
|
|
1616
|
-
] });
|
|
1637
|
+
run.error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 line-clamp-2 text-xs text-rose-600 dark:text-rose-400", children: run.error })
|
|
1638
|
+
]
|
|
1639
|
+
},
|
|
1640
|
+
run.id
|
|
1641
|
+
)) });
|
|
1617
1642
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
1618
1643
|
hero,
|
|
1619
1644
|
content
|
|
@@ -1621,7 +1646,7 @@ function WorkflowRunsPageView({ labels, runs, loading, onCancel, onReplay, onVie
|
|
|
1621
1646
|
}
|
|
1622
1647
|
function RunTimelinePageView({ labels, entries, loading, runId }) {
|
|
1623
1648
|
const hero = /* @__PURE__ */ jsxRuntime.jsx(
|
|
1624
|
-
|
|
1649
|
+
chunkZGVN23J4_js.HeroSection,
|
|
1625
1650
|
{
|
|
1626
1651
|
icon: /* @__PURE__ */ jsxRuntime.jsx(outline.ClockIcon, { className: "h-5 w-5" }),
|
|
1627
1652
|
label: labels.title,
|
|
@@ -1633,19 +1658,19 @@ function RunTimelinePageView({ labels, entries, loading, runId }) {
|
|
|
1633
1658
|
if (loading) {
|
|
1634
1659
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
1635
1660
|
hero,
|
|
1636
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1661
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.PageLoadingState, {})
|
|
1637
1662
|
] });
|
|
1638
1663
|
}
|
|
1639
1664
|
if (entries.length === 0) {
|
|
1640
1665
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
1641
1666
|
hero,
|
|
1642
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1667
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.PageEmptyState, { title: labels.empty ?? "", message: "", iconName: "folder-open" })
|
|
1643
1668
|
] });
|
|
1644
1669
|
}
|
|
1645
1670
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
1646
1671
|
hero,
|
|
1647
1672
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1648
|
-
|
|
1673
|
+
chunkH475T2N7_js.ExecutionTimelinePanel,
|
|
1649
1674
|
{
|
|
1650
1675
|
entries,
|
|
1651
1676
|
labels
|
|
@@ -1730,7 +1755,7 @@ function ConnectionsPageView({
|
|
|
1730
1755
|
const filteredConnections = searchTerm.trim() ? allConnections.filter((conn) => conn.name.toLowerCase().includes(searchTerm.trim().toLowerCase())) : allConnections;
|
|
1731
1756
|
const isEmpty = allConnections.length === 0;
|
|
1732
1757
|
const hero = /* @__PURE__ */ jsxRuntime.jsx(
|
|
1733
|
-
|
|
1758
|
+
chunkZGVN23J4_js.HeroSection,
|
|
1734
1759
|
{
|
|
1735
1760
|
icon: /* @__PURE__ */ jsxRuntime.jsx(outline.LinkIcon, { className: "h-5 w-5" }),
|
|
1736
1761
|
label: labels.title,
|
|
@@ -1738,7 +1763,7 @@ function ConnectionsPageView({
|
|
|
1738
1763
|
subtitle: labels.subtitle,
|
|
1739
1764
|
gradient: "from-sky-500 to-indigo-600",
|
|
1740
1765
|
toolbar: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1741
|
-
|
|
1766
|
+
chunkZGVN23J4_js.CreateActionButton,
|
|
1742
1767
|
{
|
|
1743
1768
|
mode: "desktop",
|
|
1744
1769
|
label: labels.add,
|
|
@@ -1749,7 +1774,7 @@ function ConnectionsPageView({
|
|
|
1749
1774
|
}
|
|
1750
1775
|
);
|
|
1751
1776
|
const mobileAction = /* @__PURE__ */ jsxRuntime.jsx(
|
|
1752
|
-
|
|
1777
|
+
chunkZGVN23J4_js.CreateActionButton,
|
|
1753
1778
|
{
|
|
1754
1779
|
mode: "mobile",
|
|
1755
1780
|
label: labels.add,
|
|
@@ -1757,9 +1782,9 @@ function ConnectionsPageView({
|
|
|
1757
1782
|
accent: "sky"
|
|
1758
1783
|
}
|
|
1759
1784
|
);
|
|
1760
|
-
const content = loading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1785
|
+
const content = loading ? /* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.PageLoadingState, {}) : isEmpty ? /* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.PageEmptyState, { title: labels.empty, message: labels.subtitle, iconName: "folder-open" }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1761
1786
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1762
|
-
|
|
1787
|
+
chunkZGVN23J4_js.SearchBar,
|
|
1763
1788
|
{
|
|
1764
1789
|
searchTerm,
|
|
1765
1790
|
onSearchChange: setSearchTerm,
|
|
@@ -1767,7 +1792,7 @@ function ConnectionsPageView({
|
|
|
1767
1792
|
}
|
|
1768
1793
|
),
|
|
1769
1794
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3", children: filteredConnections.map((conn) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1770
|
-
|
|
1795
|
+
chunkZGVN23J4_js.EntityCard,
|
|
1771
1796
|
{
|
|
1772
1797
|
accentGradient: "from-sky-500 to-indigo-600",
|
|
1773
1798
|
icon: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-11 w-11 items-center justify-center rounded-lg bg-sky-500/10 text-sky-600 dark:bg-sky-500/20 dark:text-sky-400", children: /* @__PURE__ */ jsxRuntime.jsx(outline.LinkIcon, { className: "h-6 w-6" }) }),
|
|
@@ -1920,7 +1945,7 @@ function ConnectionEditor({
|
|
|
1920
1945
|
return preset.exampleModels?.join(", ") ?? "";
|
|
1921
1946
|
}, [preset]);
|
|
1922
1947
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1923
|
-
|
|
1948
|
+
chunkZGVN23J4_js.GlassModal,
|
|
1924
1949
|
{
|
|
1925
1950
|
open: true,
|
|
1926
1951
|
onClose,
|
|
@@ -1933,9 +1958,9 @@ function ConnectionEditor({
|
|
|
1933
1958
|
void handleSubmit();
|
|
1934
1959
|
},
|
|
1935
1960
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
1936
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1961
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkZGVN23J4_js.FormGrid, { children: [
|
|
1937
1962
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1938
|
-
|
|
1963
|
+
chunkZGVN23J4_js.FormSelect,
|
|
1939
1964
|
{
|
|
1940
1965
|
label: "Provider",
|
|
1941
1966
|
value: value.providerSlug,
|
|
@@ -1946,7 +1971,7 @@ function ConnectionEditor({
|
|
|
1946
1971
|
}
|
|
1947
1972
|
),
|
|
1948
1973
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1949
|
-
|
|
1974
|
+
chunkZGVN23J4_js.FormInput,
|
|
1950
1975
|
{
|
|
1951
1976
|
label: "Display name",
|
|
1952
1977
|
required: true,
|
|
@@ -1956,7 +1981,7 @@ function ConnectionEditor({
|
|
|
1956
1981
|
}
|
|
1957
1982
|
),
|
|
1958
1983
|
preset.needsRegion && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1959
|
-
|
|
1984
|
+
chunkZGVN23J4_js.FormInput,
|
|
1960
1985
|
{
|
|
1961
1986
|
label: "Region",
|
|
1962
1987
|
value: value.region,
|
|
@@ -1965,7 +1990,7 @@ function ConnectionEditor({
|
|
|
1965
1990
|
}
|
|
1966
1991
|
),
|
|
1967
1992
|
preset.needsEndpoint && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1968
|
-
|
|
1993
|
+
chunkZGVN23J4_js.FormInput,
|
|
1969
1994
|
{
|
|
1970
1995
|
label: "Endpoint URL",
|
|
1971
1996
|
value: value.endpoint,
|
|
@@ -1975,7 +2000,7 @@ function ConnectionEditor({
|
|
|
1975
2000
|
)
|
|
1976
2001
|
] }),
|
|
1977
2002
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1978
|
-
|
|
2003
|
+
chunkZGVN23J4_js.FormInput,
|
|
1979
2004
|
{
|
|
1980
2005
|
label: value.credentialRef ? "Rotate API key (leave blank to keep current)" : "API key",
|
|
1981
2006
|
type: "password",
|
|
@@ -1986,7 +2011,7 @@ function ConnectionEditor({
|
|
|
1986
2011
|
}
|
|
1987
2012
|
),
|
|
1988
2013
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1989
|
-
|
|
2014
|
+
chunkZGVN23J4_js.FormInput,
|
|
1990
2015
|
{
|
|
1991
2016
|
label: "Model filter (comma-separated, optional)",
|
|
1992
2017
|
value: value.modelFilter,
|
|
@@ -1998,7 +2023,7 @@ function ConnectionEditor({
|
|
|
1998
2023
|
/* @__PURE__ */ jsxRuntime.jsxs("details", { className: "rounded-xl border border-slate-200 bg-slate-50/60 p-3 text-sm dark:border-slate-700 dark:bg-slate-900/40", children: [
|
|
1999
2024
|
/* @__PURE__ */ jsxRuntime.jsx("summary", { className: "cursor-pointer font-medium text-slate-700 dark:text-slate-200", children: "Advanced config (JSON)" }),
|
|
2000
2025
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2001
|
-
|
|
2026
|
+
chunkZGVN23J4_js.FormTextarea,
|
|
2002
2027
|
{
|
|
2003
2028
|
rows: 4,
|
|
2004
2029
|
value: value.configJson,
|
|
@@ -2068,7 +2093,7 @@ function CredentialsPageView({ labels, credentials, loading, onCreate, onRotate,
|
|
|
2068
2093
|
{ value: "password", label: labels.typePassword }
|
|
2069
2094
|
];
|
|
2070
2095
|
const hero = /* @__PURE__ */ jsxRuntime.jsx(
|
|
2071
|
-
|
|
2096
|
+
chunkZGVN23J4_js.HeroSection,
|
|
2072
2097
|
{
|
|
2073
2098
|
icon: /* @__PURE__ */ jsxRuntime.jsx(outline.KeyIcon, { className: "h-5 w-5" }),
|
|
2074
2099
|
label: labels.title,
|
|
@@ -2076,7 +2101,7 @@ function CredentialsPageView({ labels, credentials, loading, onCreate, onRotate,
|
|
|
2076
2101
|
subtitle: labels.subtitle,
|
|
2077
2102
|
gradient: "from-rose-500 to-orange-600",
|
|
2078
2103
|
toolbar: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2079
|
-
|
|
2104
|
+
chunkZGVN23J4_js.CreateActionButton,
|
|
2080
2105
|
{
|
|
2081
2106
|
mode: "desktop",
|
|
2082
2107
|
label: labels.addCredential,
|
|
@@ -2087,7 +2112,7 @@ function CredentialsPageView({ labels, credentials, loading, onCreate, onRotate,
|
|
|
2087
2112
|
}
|
|
2088
2113
|
);
|
|
2089
2114
|
const mobileAction = /* @__PURE__ */ jsxRuntime.jsx(
|
|
2090
|
-
|
|
2115
|
+
chunkZGVN23J4_js.CreateActionButton,
|
|
2091
2116
|
{
|
|
2092
2117
|
mode: "mobile",
|
|
2093
2118
|
label: labels.addCredential,
|
|
@@ -2095,9 +2120,9 @@ function CredentialsPageView({ labels, credentials, loading, onCreate, onRotate,
|
|
|
2095
2120
|
accent: "rose"
|
|
2096
2121
|
}
|
|
2097
2122
|
);
|
|
2098
|
-
const content = loading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2123
|
+
const content = loading ? /* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.PageLoadingState, {}) : isEmpty ? /* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.PageEmptyState, { title: labels.empty, message: labels.subtitle, iconName: "folder-open" }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2099
2124
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2100
|
-
|
|
2125
|
+
chunkZGVN23J4_js.SearchBar,
|
|
2101
2126
|
{
|
|
2102
2127
|
searchTerm,
|
|
2103
2128
|
onSearchChange: setSearchTerm,
|
|
@@ -2105,7 +2130,7 @@ function CredentialsPageView({ labels, credentials, loading, onCreate, onRotate,
|
|
|
2105
2130
|
}
|
|
2106
2131
|
),
|
|
2107
2132
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3", children: filteredCredentials.map((secret) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2108
|
-
|
|
2133
|
+
chunkZGVN23J4_js.EntityCard,
|
|
2109
2134
|
{
|
|
2110
2135
|
accentGradient: "from-rose-500 to-orange-700",
|
|
2111
2136
|
icon: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-11 w-11 items-center justify-center rounded-lg bg-rose-500/10 text-rose-600 dark:bg-rose-500/20 dark:text-rose-400", children: /* @__PURE__ */ jsxRuntime.jsx(outline.KeyIcon, { className: "h-6 w-6" }) }),
|
|
@@ -2113,7 +2138,7 @@ function CredentialsPageView({ labels, credentials, loading, onCreate, onRotate,
|
|
|
2113
2138
|
subtitle: secret.secretType,
|
|
2114
2139
|
status: /* @__PURE__ */ jsxRuntime.jsx(chunkBHOT22QL_js.Badge, { color: secret.disabled ? "zinc" : "emerald", children: secret.disabled ? labels.disable : "Active" }),
|
|
2115
2140
|
footer: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
2116
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2141
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.CopyableId, { id: secret.secretId }),
|
|
2117
2142
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
|
|
2118
2143
|
/* @__PURE__ */ jsxRuntime.jsxs(chunkBHOT22QL_js.Button, { type: "button", size: "sm", outline: true, onClick: () => setRotateFor(secret), children: [
|
|
2119
2144
|
/* @__PURE__ */ jsxRuntime.jsx(outline.ArrowPathIcon, { className: "mr-1 h-3.5 w-3.5" }),
|
|
@@ -2156,7 +2181,7 @@ function CredentialsPageView({ labels, credentials, loading, onCreate, onRotate,
|
|
|
2156
2181
|
mobileAction
|
|
2157
2182
|
] }),
|
|
2158
2183
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2159
|
-
|
|
2184
|
+
chunkZGVN23J4_js.GlassModal,
|
|
2160
2185
|
{
|
|
2161
2186
|
open: createOpen,
|
|
2162
2187
|
onClose: () => setCreateOpen(false),
|
|
@@ -2174,16 +2199,16 @@ function CredentialsPageView({ labels, credentials, loading, onCreate, onRotate,
|
|
|
2174
2199
|
onCreate({ name, value, secretType, description });
|
|
2175
2200
|
setCreateOpen(false);
|
|
2176
2201
|
},
|
|
2177
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2178
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2179
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2180
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2181
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2202
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(chunkZGVN23J4_js.FormGrid, { children: [
|
|
2203
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.FormInput, { name: "name", label: labels.name, placeholder: labels.namePlaceholder, required: true }),
|
|
2204
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.FormSelect, { name: "secretType", label: labels.type, options: typeOptions, defaultValue: "generic" }),
|
|
2205
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.FormInput, { name: "value", label: labels.value, placeholder: labels.valuePlaceholder, required: true, type: "password" }),
|
|
2206
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.FormTextarea, { name: "description", label: labels.description, placeholder: labels.descriptionPlaceholder, rows: 2 })
|
|
2182
2207
|
] })
|
|
2183
2208
|
}
|
|
2184
2209
|
),
|
|
2185
2210
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2186
|
-
|
|
2211
|
+
chunkZGVN23J4_js.GlassModal,
|
|
2187
2212
|
{
|
|
2188
2213
|
open: rotateFor !== null,
|
|
2189
2214
|
onClose: () => setRotateFor(null),
|
|
@@ -2198,7 +2223,7 @@ function CredentialsPageView({ labels, credentials, loading, onCreate, onRotate,
|
|
|
2198
2223
|
onRotate(rotateFor, value);
|
|
2199
2224
|
setRotateFor(null);
|
|
2200
2225
|
},
|
|
2201
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2226
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.FormGrid, { children: /* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.FormInput, { name: "value", label: labels.value, placeholder: labels.valuePlaceholder, required: true, type: "password" }) })
|
|
2202
2227
|
}
|
|
2203
2228
|
)
|
|
2204
2229
|
] });
|
|
@@ -2251,7 +2276,7 @@ function AgentsWorkspacePageView({
|
|
|
2251
2276
|
}, [agents, selectedId]);
|
|
2252
2277
|
const isEmpty = agents.length === 0;
|
|
2253
2278
|
const hero = /* @__PURE__ */ jsxRuntime.jsx(
|
|
2254
|
-
|
|
2279
|
+
chunkZGVN23J4_js.HeroSection,
|
|
2255
2280
|
{
|
|
2256
2281
|
icon: /* @__PURE__ */ jsxRuntime.jsx(outline.CpuChipIcon, { className: "h-5 w-5" }),
|
|
2257
2282
|
label: labels.title,
|
|
@@ -2259,7 +2284,7 @@ function AgentsWorkspacePageView({
|
|
|
2259
2284
|
subtitle: labels.subtitle,
|
|
2260
2285
|
gradient: "from-violet-500 to-indigo-700",
|
|
2261
2286
|
actions: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2262
|
-
|
|
2287
|
+
chunkZGVN23J4_js.CreateActionButton,
|
|
2263
2288
|
{
|
|
2264
2289
|
mode: "desktop",
|
|
2265
2290
|
label: labels.addAgent,
|
|
@@ -2270,7 +2295,7 @@ function AgentsWorkspacePageView({
|
|
|
2270
2295
|
}
|
|
2271
2296
|
);
|
|
2272
2297
|
const mobileAction = /* @__PURE__ */ jsxRuntime.jsx(
|
|
2273
|
-
|
|
2298
|
+
chunkZGVN23J4_js.CreateActionButton,
|
|
2274
2299
|
{
|
|
2275
2300
|
mode: "mobile",
|
|
2276
2301
|
label: labels.addAgent,
|
|
@@ -2278,8 +2303,8 @@ function AgentsWorkspacePageView({
|
|
|
2278
2303
|
accent: "violet"
|
|
2279
2304
|
}
|
|
2280
2305
|
);
|
|
2281
|
-
const content = loading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2282
|
-
|
|
2306
|
+
const content = loading ? /* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.PageLoadingState, {}) : isEmpty ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2307
|
+
chunkZGVN23J4_js.PageEmptyState,
|
|
2283
2308
|
{
|
|
2284
2309
|
title: labels.empty,
|
|
2285
2310
|
message: labels.emptyMessage,
|
|
@@ -2287,7 +2312,7 @@ function AgentsWorkspacePageView({
|
|
|
2287
2312
|
}
|
|
2288
2313
|
) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
2289
2314
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2290
|
-
|
|
2315
|
+
chunkZGVN23J4_js.SearchBar,
|
|
2291
2316
|
{
|
|
2292
2317
|
searchTerm,
|
|
2293
2318
|
onSearchChange: setSearchTerm,
|
|
@@ -2295,15 +2320,15 @@ function AgentsWorkspacePageView({
|
|
|
2295
2320
|
}
|
|
2296
2321
|
),
|
|
2297
2322
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 gap-4 lg:grid-cols-[20rem_minmax(0,1fr)]", children: [
|
|
2298
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "lg:sticky lg:top-4", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2323
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "lg:sticky lg:top-4", children: /* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.ListCard, { variant: "glass", children: filteredAgents.map((agent) => {
|
|
2299
2324
|
const id = String(agent.agentId ?? agent.id ?? "");
|
|
2300
2325
|
const active = id === selectedId;
|
|
2301
2326
|
const initials = deriveInitials(String(agent.name ?? id));
|
|
2302
2327
|
const modelName = models.find((m) => m.id === String(agent.modelId ?? ""))?.name ?? String(agent.modelId ?? "");
|
|
2303
2328
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2304
|
-
|
|
2329
|
+
chunkZGVN23J4_js.ListCardItem,
|
|
2305
2330
|
{
|
|
2306
|
-
leading: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2331
|
+
leading: /* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.Avatar, { tone: active ? "violet" : "slate", initials }),
|
|
2307
2332
|
trailing: agent.activePromptVersion > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(chunkBHOT22QL_js.Badge, { color: "emerald", children: [
|
|
2308
2333
|
"v",
|
|
2309
2334
|
agent.activePromptVersion
|
|
@@ -2345,7 +2370,7 @@ function AgentsWorkspacePageView({
|
|
|
2345
2370
|
},
|
|
2346
2371
|
String(selectedAgent.agentId ?? selectedAgent.id ?? "")
|
|
2347
2372
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2348
|
-
|
|
2373
|
+
chunkZGVN23J4_js.SectionCard,
|
|
2349
2374
|
{
|
|
2350
2375
|
header: {
|
|
2351
2376
|
icon: /* @__PURE__ */ jsxRuntime.jsx(outline.CpuChipIcon, { className: "h-4 w-4" }),
|
|
@@ -2353,7 +2378,7 @@ function AgentsWorkspacePageView({
|
|
|
2353
2378
|
subtitle: labels.noSelectionMessage
|
|
2354
2379
|
},
|
|
2355
2380
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2356
|
-
|
|
2381
|
+
chunkZGVN23J4_js.PageEmptyState,
|
|
2357
2382
|
{
|
|
2358
2383
|
title: labels.noSelection,
|
|
2359
2384
|
message: labels.noSelectionMessage,
|
|
@@ -2388,7 +2413,7 @@ function AgentDetail({
|
|
|
2388
2413
|
}) {
|
|
2389
2414
|
const agentId = String(agent.agentId ?? agent.id ?? "");
|
|
2390
2415
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2391
|
-
|
|
2416
|
+
chunkZGVN23J4_js.SectionCard,
|
|
2392
2417
|
{
|
|
2393
2418
|
header: {
|
|
2394
2419
|
icon: /* @__PURE__ */ jsxRuntime.jsx(outline.CpuChipIcon, { className: "h-4 w-4" }),
|
|
@@ -2413,15 +2438,15 @@ function AgentDetail({
|
|
|
2413
2438
|
]
|
|
2414
2439
|
}
|
|
2415
2440
|
),
|
|
2416
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2417
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2418
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2419
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2420
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2421
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2441
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(chunkZGVN23J4_js.Tabs, { defaultValue: "general", className: "w-full", children: [
|
|
2442
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkZGVN23J4_js.TabsList, { className: "bg-white/40 dark:bg-white/[0.06]", children: [
|
|
2443
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.TabsTrigger, { value: "general", children: labels.generalTab }),
|
|
2444
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.TabsTrigger, { value: "prompt", children: labels.promptTab }),
|
|
2445
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.TabsTrigger, { value: "tools", children: labels.toolsTab }),
|
|
2446
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.TabsTrigger, { value: "model", children: labels.modelTab })
|
|
2422
2447
|
] }),
|
|
2423
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2424
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2448
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.TabsContent, { value: "general", className: "space-y-4 pt-4", children: /* @__PURE__ */ jsxRuntime.jsx(GeneralTab, { agent, labels, onSubmit: (input) => onUpdateAgent(agentId, input) }) }),
|
|
2449
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.TabsContent, { value: "prompt", className: "space-y-4 pt-4", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2425
2450
|
PromptTab,
|
|
2426
2451
|
{
|
|
2427
2452
|
agent,
|
|
@@ -2431,7 +2456,7 @@ function AgentDetail({
|
|
|
2431
2456
|
onActivate: (promptId) => onActivatePrompt(agentId, promptId)
|
|
2432
2457
|
}
|
|
2433
2458
|
) }),
|
|
2434
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2459
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.TabsContent, { value: "tools", className: "space-y-4 pt-4", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2435
2460
|
ToolsTab,
|
|
2436
2461
|
{
|
|
2437
2462
|
agent,
|
|
@@ -2441,7 +2466,7 @@ function AgentDetail({
|
|
|
2441
2466
|
onDetach: (toolId) => onDetachTool(agentId, toolId)
|
|
2442
2467
|
}
|
|
2443
2468
|
) }),
|
|
2444
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2469
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.TabsContent, { value: "model", className: "space-y-4 pt-4", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2445
2470
|
ModelTab,
|
|
2446
2471
|
{
|
|
2447
2472
|
agent,
|
|
@@ -2473,7 +2498,7 @@ function GeneralTab({
|
|
|
2473
2498
|
const initialRole = String(agent.role ?? "");
|
|
2474
2499
|
const initialStatus = String(agent.status ?? "draft");
|
|
2475
2500
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2476
|
-
|
|
2501
|
+
chunkZGVN23J4_js.SectionCard,
|
|
2477
2502
|
{
|
|
2478
2503
|
variant: "glass",
|
|
2479
2504
|
header: {
|
|
@@ -2502,10 +2527,10 @@ function GeneralTab({
|
|
|
2502
2527
|
},
|
|
2503
2528
|
className: "space-y-4",
|
|
2504
2529
|
children: [
|
|
2505
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2506
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2530
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkZGVN23J4_js.FormGrid, { children: [
|
|
2531
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.FormInput, { name: "name", label: labels.name, defaultValue: initial.name, required: true }),
|
|
2507
2532
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2508
|
-
|
|
2533
|
+
chunkZGVN23J4_js.FormSelect,
|
|
2509
2534
|
{
|
|
2510
2535
|
name: "status",
|
|
2511
2536
|
label: labels.status,
|
|
@@ -2517,9 +2542,9 @@ function GeneralTab({
|
|
|
2517
2542
|
]
|
|
2518
2543
|
}
|
|
2519
2544
|
),
|
|
2520
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2545
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.FormInput, { name: "role", label: labels.role, placeholder: labels.rolePlaceholder, defaultValue: initialRole }),
|
|
2521
2546
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2522
|
-
|
|
2547
|
+
chunkZGVN23J4_js.FormInput,
|
|
2523
2548
|
{
|
|
2524
2549
|
name: "maxTokens",
|
|
2525
2550
|
label: labels.maxTokens,
|
|
@@ -2528,7 +2553,7 @@ function GeneralTab({
|
|
|
2528
2553
|
}
|
|
2529
2554
|
),
|
|
2530
2555
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2531
|
-
|
|
2556
|
+
chunkZGVN23J4_js.FormInput,
|
|
2532
2557
|
{
|
|
2533
2558
|
name: "temperature",
|
|
2534
2559
|
label: labels.temperature,
|
|
@@ -2540,7 +2565,7 @@ function GeneralTab({
|
|
|
2540
2565
|
}
|
|
2541
2566
|
)
|
|
2542
2567
|
] }),
|
|
2543
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2568
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.FormTextarea, { name: "description", label: labels.description, defaultValue: initialDescription, rows: 3 }),
|
|
2544
2569
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxRuntime.jsx(chunkBHOT22QL_js.Button, { type: "submit", color: "indigo", disabled: submitting, children: submitting ? labels.saving : labels.save }) })
|
|
2545
2570
|
]
|
|
2546
2571
|
}
|
|
@@ -2560,7 +2585,7 @@ function PromptTab({
|
|
|
2560
2585
|
const currentSystem = String(agent.systemPrompt ?? "");
|
|
2561
2586
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
2562
2587
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2563
|
-
|
|
2588
|
+
chunkZGVN23J4_js.SectionCard,
|
|
2564
2589
|
{
|
|
2565
2590
|
variant: "glass",
|
|
2566
2591
|
header: {
|
|
@@ -2572,7 +2597,7 @@ function PromptTab({
|
|
|
2572
2597
|
}
|
|
2573
2598
|
),
|
|
2574
2599
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2575
|
-
|
|
2600
|
+
chunkZGVN23J4_js.SectionCard,
|
|
2576
2601
|
{
|
|
2577
2602
|
variant: "glass",
|
|
2578
2603
|
header: {
|
|
@@ -2583,10 +2608,10 @@ function PromptTab({
|
|
|
2583
2608
|
/* @__PURE__ */ jsxRuntime.jsx(outline.PlusIcon, { className: "h-4 w-4" }),
|
|
2584
2609
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1.5", children: labels.addPrompt })
|
|
2585
2610
|
] }),
|
|
2586
|
-
children: prompts.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-slate-500 dark:text-slate-400", children: labels.promptVersionsEmpty }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2611
|
+
children: prompts.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-slate-500 dark:text-slate-400", children: labels.promptVersionsEmpty }) : /* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.ListCard, { children: prompts.map((prompt) => {
|
|
2587
2612
|
const id = `${prompt.agentId}:${prompt.locale}:${prompt.version}`;
|
|
2588
2613
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2589
|
-
|
|
2614
|
+
chunkZGVN23J4_js.ListCardItem,
|
|
2590
2615
|
{
|
|
2591
2616
|
leading: /* @__PURE__ */ jsxRuntime.jsxs(chunkBHOT22QL_js.Badge, { color: prompt.isActive ? "emerald" : "zinc", children: [
|
|
2592
2617
|
"v",
|
|
@@ -2604,7 +2629,7 @@ function PromptTab({
|
|
|
2604
2629
|
}
|
|
2605
2630
|
),
|
|
2606
2631
|
addOpen && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2607
|
-
|
|
2632
|
+
chunkZGVN23J4_js.GlassModal,
|
|
2608
2633
|
{
|
|
2609
2634
|
open: true,
|
|
2610
2635
|
onClose: () => setAddOpen(false),
|
|
@@ -2625,10 +2650,10 @@ function PromptTab({
|
|
|
2625
2650
|
});
|
|
2626
2651
|
setAddOpen(false);
|
|
2627
2652
|
},
|
|
2628
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2629
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2653
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(chunkZGVN23J4_js.FormGrid, { children: [
|
|
2654
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.FormSelect, { name: "locale", label: labels.promptLocale, options: LOCALE_OPTIONS2, defaultValue: "en" }),
|
|
2630
2655
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2631
|
-
|
|
2656
|
+
chunkZGVN23J4_js.FormSelect,
|
|
2632
2657
|
{
|
|
2633
2658
|
name: "isActive",
|
|
2634
2659
|
label: labels.promptIsActive,
|
|
@@ -2639,10 +2664,10 @@ function PromptTab({
|
|
|
2639
2664
|
defaultValue: "true"
|
|
2640
2665
|
}
|
|
2641
2666
|
),
|
|
2642
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2643
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2644
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2645
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2667
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.FormInput, { name: "reason", label: labels.promptReason }),
|
|
2668
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.FormTextarea, { name: "systemPrompt", label: labels.promptSystemPrompt, rows: 3 }),
|
|
2669
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.FormTextarea, { name: "userTemplate", label: labels.promptUserTemplate, rows: 3 }),
|
|
2670
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.FormTextarea, { name: "prompt", label: labels.promptText, rows: 6, required: true })
|
|
2646
2671
|
] })
|
|
2647
2672
|
}
|
|
2648
2673
|
)
|
|
@@ -2665,15 +2690,15 @@ function ToolsTab({
|
|
|
2665
2690
|
const availableTools = tools.filter((tool) => !attachedSet.has(tool.agentToolId));
|
|
2666
2691
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
2667
2692
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2668
|
-
|
|
2693
|
+
chunkZGVN23J4_js.SectionCard,
|
|
2669
2694
|
{
|
|
2670
2695
|
variant: "glass",
|
|
2671
2696
|
header: {
|
|
2672
2697
|
icon: /* @__PURE__ */ jsxRuntime.jsx(outline.WrenchScrewdriverIcon, { className: "h-4 w-4" }),
|
|
2673
2698
|
title: labels.toolsAttached
|
|
2674
2699
|
},
|
|
2675
|
-
children: attachedTools.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-slate-500 dark:text-slate-400", children: labels.toolsEmpty }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2676
|
-
|
|
2700
|
+
children: attachedTools.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-slate-500 dark:text-slate-400", children: labels.toolsEmpty }) : /* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.ListCard, { children: attachedTools.map((tool) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2701
|
+
chunkZGVN23J4_js.ListCardItem,
|
|
2677
2702
|
{
|
|
2678
2703
|
leading: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-9 w-9 items-center justify-center rounded-lg bg-amber-500/10 text-amber-600 dark:bg-amber-500/20 dark:text-amber-400", children: /* @__PURE__ */ jsxRuntime.jsx(outline.WrenchScrewdriverIcon, { className: "h-5 w-5" }) }),
|
|
2679
2704
|
trailing: /* @__PURE__ */ jsxRuntime.jsx(chunkBHOT22QL_js.Button, { type: "button", size: "sm", outline: true, onClick: () => onDetach(tool.agentToolId), children: labels.detachTool }),
|
|
@@ -2687,15 +2712,15 @@ function ToolsTab({
|
|
|
2687
2712
|
}
|
|
2688
2713
|
),
|
|
2689
2714
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2690
|
-
|
|
2715
|
+
chunkZGVN23J4_js.SectionCard,
|
|
2691
2716
|
{
|
|
2692
2717
|
variant: "glass",
|
|
2693
2718
|
header: {
|
|
2694
2719
|
icon: /* @__PURE__ */ jsxRuntime.jsx(outline.WrenchScrewdriverIcon, { className: "h-4 w-4" }),
|
|
2695
2720
|
title: labels.toolsAvailable
|
|
2696
2721
|
},
|
|
2697
|
-
children: availableTools.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-slate-500 dark:text-slate-400", children: labels.toolsEmpty }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2698
|
-
|
|
2722
|
+
children: availableTools.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-slate-500 dark:text-slate-400", children: labels.toolsEmpty }) : /* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.ListCard, { children: availableTools.map((tool) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2723
|
+
chunkZGVN23J4_js.ListCardItem,
|
|
2699
2724
|
{
|
|
2700
2725
|
leading: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex h-9 w-9 items-center justify-center rounded-lg bg-slate-500/10 text-slate-600 dark:bg-slate-500/20 dark:text-slate-300", children: /* @__PURE__ */ jsxRuntime.jsx(outline.WrenchScrewdriverIcon, { className: "h-5 w-5" }) }),
|
|
2701
2726
|
trailing: /* @__PURE__ */ jsxRuntime.jsxs(chunkBHOT22QL_js.Button, { type: "button", size: "sm", color: "indigo", onClick: () => onAttach(tool.agentToolId), children: [
|
|
@@ -2736,7 +2761,7 @@ function ModelTab({
|
|
|
2736
2761
|
return matches.length > 0 ? matches : connections;
|
|
2737
2762
|
}, [selectedModel, connections]);
|
|
2738
2763
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2739
|
-
|
|
2764
|
+
chunkZGVN23J4_js.SectionCard,
|
|
2740
2765
|
{
|
|
2741
2766
|
variant: "glass",
|
|
2742
2767
|
header: {
|
|
@@ -2757,9 +2782,9 @@ function ModelTab({
|
|
|
2757
2782
|
},
|
|
2758
2783
|
className: "space-y-4",
|
|
2759
2784
|
children: [
|
|
2760
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2785
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkZGVN23J4_js.FormGrid, { children: [
|
|
2761
2786
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2762
|
-
|
|
2787
|
+
chunkZGVN23J4_js.FormSelect,
|
|
2763
2788
|
{
|
|
2764
2789
|
label: labels.model,
|
|
2765
2790
|
value: modelId,
|
|
@@ -2768,7 +2793,7 @@ function ModelTab({
|
|
|
2768
2793
|
}
|
|
2769
2794
|
),
|
|
2770
2795
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2771
|
-
|
|
2796
|
+
chunkZGVN23J4_js.FormSelect,
|
|
2772
2797
|
{
|
|
2773
2798
|
label: labels.connection,
|
|
2774
2799
|
value: connectionId,
|
|
@@ -2820,14 +2845,14 @@ function RangeSliderField({
|
|
|
2820
2845
|
step,
|
|
2821
2846
|
zones,
|
|
2822
2847
|
trackGradient,
|
|
2823
|
-
formatValue,
|
|
2848
|
+
formatValue: formatValue2,
|
|
2824
2849
|
ariaLabel
|
|
2825
2850
|
}) {
|
|
2826
2851
|
const percent = (value - min) / (max - min) * 100;
|
|
2827
2852
|
const activeZone = zones?.find((z) => value <= z.max) ?? zones?.[zones.length - 1];
|
|
2828
2853
|
const thumbColor = activeZone?.thumbColor ?? "#6366f1";
|
|
2829
2854
|
const glow = hexToGlow(thumbColor);
|
|
2830
|
-
const displayValue =
|
|
2855
|
+
const displayValue = formatValue2 ? formatValue2(value) : value.toString();
|
|
2831
2856
|
const ariaText = activeZone ? `${displayValue} \u2014 ${activeZone.label}` : displayValue;
|
|
2832
2857
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
2833
2858
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
@@ -2970,11 +2995,9 @@ function AgentNewWizardPageView({
|
|
|
2970
2995
|
labels.wizardStep4Subtitle,
|
|
2971
2996
|
labels.wizardStep5Subtitle
|
|
2972
2997
|
];
|
|
2973
|
-
const
|
|
2998
|
+
const indicatorSteps = stepTitles.map((title, idx) => ({
|
|
2974
2999
|
id: String(idx + 1),
|
|
2975
|
-
|
|
2976
|
-
description: stepSubtitles[idx],
|
|
2977
|
-
status: idx + 1 < step ? "complete" : idx + 1 === step ? "current" : "upcoming"
|
|
3000
|
+
title
|
|
2978
3001
|
}));
|
|
2979
3002
|
function markTouched() {
|
|
2980
3003
|
if (!touched) setTouched(true);
|
|
@@ -3060,7 +3083,7 @@ function AgentNewWizardPageView({
|
|
|
3060
3083
|
}
|
|
3061
3084
|
const counter = labels.wizardStepCounter.replace("{current}", String(step)).replace("{total}", String(TOTAL_STEPS));
|
|
3062
3085
|
const hero = /* @__PURE__ */ jsxRuntime.jsx(
|
|
3063
|
-
|
|
3086
|
+
chunkZGVN23J4_js.HeroSection,
|
|
3064
3087
|
{
|
|
3065
3088
|
icon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3066
3089
|
"div",
|
|
@@ -3073,12 +3096,22 @@ function AgentNewWizardPageView({
|
|
|
3073
3096
|
label: counter,
|
|
3074
3097
|
title: labels.pageTitle,
|
|
3075
3098
|
subtitle: stepSubtitles[step - 1],
|
|
3076
|
-
gradient: activePreset.accent
|
|
3099
|
+
gradient: activePreset.accent,
|
|
3100
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3101
|
+
chunkZGVN23J4_js.StepIndicator,
|
|
3102
|
+
{
|
|
3103
|
+
accent: "indigo",
|
|
3104
|
+
currentStep: step - 1,
|
|
3105
|
+
onStepChange: (idx) => goToStep(idx + 1),
|
|
3106
|
+
progressLabel: labels.pageTitle,
|
|
3107
|
+
steps: indicatorSteps
|
|
3108
|
+
}
|
|
3109
|
+
)
|
|
3077
3110
|
}
|
|
3078
3111
|
);
|
|
3079
3112
|
function renderStep1() {
|
|
3080
3113
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3081
|
-
|
|
3114
|
+
chunkZGVN23J4_js.SectionCard,
|
|
3082
3115
|
{
|
|
3083
3116
|
variant: "glass",
|
|
3084
3117
|
header: {
|
|
@@ -3094,7 +3127,7 @@ function AgentNewWizardPageView({
|
|
|
3094
3127
|
children: AGENT_PRESETS.map((preset) => {
|
|
3095
3128
|
const selected = preset.id === presetId;
|
|
3096
3129
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3097
|
-
|
|
3130
|
+
chunkZGVN23J4_js.FilterTileButton,
|
|
3098
3131
|
{
|
|
3099
3132
|
isActive: selected,
|
|
3100
3133
|
color: preset.tileColor,
|
|
@@ -3113,7 +3146,7 @@ function AgentNewWizardPageView({
|
|
|
3113
3146
|
}
|
|
3114
3147
|
function renderStep2() {
|
|
3115
3148
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3116
|
-
|
|
3149
|
+
chunkZGVN23J4_js.SectionCard,
|
|
3117
3150
|
{
|
|
3118
3151
|
variant: "glass",
|
|
3119
3152
|
header: {
|
|
@@ -3141,9 +3174,9 @@ function AgentNewWizardPageView({
|
|
|
3141
3174
|
e
|
|
3142
3175
|
)) })
|
|
3143
3176
|
] }),
|
|
3144
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3177
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkZGVN23J4_js.FormGrid, { children: [
|
|
3145
3178
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3146
|
-
|
|
3179
|
+
chunkZGVN23J4_js.FormInput,
|
|
3147
3180
|
{
|
|
3148
3181
|
label: labels.name,
|
|
3149
3182
|
value: name,
|
|
@@ -3156,7 +3189,7 @@ function AgentNewWizardPageView({
|
|
|
3156
3189
|
}
|
|
3157
3190
|
),
|
|
3158
3191
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3159
|
-
|
|
3192
|
+
chunkZGVN23J4_js.FormInput,
|
|
3160
3193
|
{
|
|
3161
3194
|
label: labels.role,
|
|
3162
3195
|
value: role,
|
|
@@ -3169,7 +3202,7 @@ function AgentNewWizardPageView({
|
|
|
3169
3202
|
)
|
|
3170
3203
|
] }),
|
|
3171
3204
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3172
|
-
|
|
3205
|
+
chunkZGVN23J4_js.FormTextarea,
|
|
3173
3206
|
{
|
|
3174
3207
|
label: labels.descriptionLabel,
|
|
3175
3208
|
value: description,
|
|
@@ -3187,7 +3220,7 @@ function AgentNewWizardPageView({
|
|
|
3187
3220
|
}
|
|
3188
3221
|
function renderStep3() {
|
|
3189
3222
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3190
|
-
|
|
3223
|
+
chunkZGVN23J4_js.SectionCard,
|
|
3191
3224
|
{
|
|
3192
3225
|
variant: "glass",
|
|
3193
3226
|
header: {
|
|
@@ -3195,9 +3228,9 @@ function AgentNewWizardPageView({
|
|
|
3195
3228
|
subtitle: labels.connectionPickPrompt
|
|
3196
3229
|
},
|
|
3197
3230
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
3198
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3231
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkZGVN23J4_js.FormGrid, { children: [
|
|
3199
3232
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3200
|
-
|
|
3233
|
+
chunkZGVN23J4_js.FormSelect,
|
|
3201
3234
|
{
|
|
3202
3235
|
label: labels.connectionLabel,
|
|
3203
3236
|
value: connectionId,
|
|
@@ -3210,7 +3243,7 @@ function AgentNewWizardPageView({
|
|
|
3210
3243
|
}
|
|
3211
3244
|
),
|
|
3212
3245
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3213
|
-
|
|
3246
|
+
chunkZGVN23J4_js.FormSelect,
|
|
3214
3247
|
{
|
|
3215
3248
|
label: labels.frameworkLabel,
|
|
3216
3249
|
value: framework,
|
|
@@ -3222,7 +3255,7 @@ function AgentNewWizardPageView({
|
|
|
3222
3255
|
}
|
|
3223
3256
|
),
|
|
3224
3257
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3225
|
-
|
|
3258
|
+
chunkZGVN23J4_js.FormSelect,
|
|
3226
3259
|
{
|
|
3227
3260
|
label: labels.model,
|
|
3228
3261
|
value: modelId,
|
|
@@ -3235,7 +3268,7 @@ function AgentNewWizardPageView({
|
|
|
3235
3268
|
)
|
|
3236
3269
|
] }),
|
|
3237
3270
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3238
|
-
|
|
3271
|
+
chunkZGVN23J4_js.FormTextarea,
|
|
3239
3272
|
{
|
|
3240
3273
|
label: labels.outputSchemaLabel,
|
|
3241
3274
|
value: outputSchema,
|
|
@@ -3254,7 +3287,7 @@ function AgentNewWizardPageView({
|
|
|
3254
3287
|
function renderStep4() {
|
|
3255
3288
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
3256
3289
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3257
|
-
|
|
3290
|
+
chunkZGVN23J4_js.SectionCard,
|
|
3258
3291
|
{
|
|
3259
3292
|
variant: "glass",
|
|
3260
3293
|
header: {
|
|
@@ -3414,7 +3447,7 @@ function AgentNewWizardPageView({
|
|
|
3414
3447
|
}
|
|
3415
3448
|
),
|
|
3416
3449
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3417
|
-
|
|
3450
|
+
chunkZGVN23J4_js.SectionCard,
|
|
3418
3451
|
{
|
|
3419
3452
|
variant: "glass",
|
|
3420
3453
|
header: {
|
|
@@ -3457,7 +3490,7 @@ function AgentNewWizardPageView({
|
|
|
3457
3490
|
}) })
|
|
3458
3491
|
] }),
|
|
3459
3492
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3460
|
-
|
|
3493
|
+
chunkZGVN23J4_js.FormInput,
|
|
3461
3494
|
{
|
|
3462
3495
|
label: labels.tagsLabel,
|
|
3463
3496
|
value: tagsInput,
|
|
@@ -3478,7 +3511,7 @@ function AgentNewWizardPageView({
|
|
|
3478
3511
|
const connectionLabel = connectionId ? connections.find((c) => c.id === connectionId)?.name ?? labels.connectionInline : labels.connectionInline;
|
|
3479
3512
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
3480
3513
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3481
|
-
|
|
3514
|
+
chunkZGVN23J4_js.SectionCard,
|
|
3482
3515
|
{
|
|
3483
3516
|
variant: "glass",
|
|
3484
3517
|
header: {
|
|
@@ -3493,7 +3526,7 @@ function AgentNewWizardPageView({
|
|
|
3493
3526
|
}
|
|
3494
3527
|
),
|
|
3495
3528
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3496
|
-
|
|
3529
|
+
chunkZGVN23J4_js.SectionCard,
|
|
3497
3530
|
{
|
|
3498
3531
|
variant: "glass",
|
|
3499
3532
|
header: {
|
|
@@ -3522,7 +3555,7 @@ function AgentNewWizardPageView({
|
|
|
3522
3555
|
}
|
|
3523
3556
|
),
|
|
3524
3557
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3525
|
-
|
|
3558
|
+
chunkZGVN23J4_js.SectionCard,
|
|
3526
3559
|
{
|
|
3527
3560
|
variant: "glass",
|
|
3528
3561
|
header: {
|
|
@@ -3542,7 +3575,7 @@ function AgentNewWizardPageView({
|
|
|
3542
3575
|
}
|
|
3543
3576
|
),
|
|
3544
3577
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3545
|
-
|
|
3578
|
+
chunkZGVN23J4_js.SectionCard,
|
|
3546
3579
|
{
|
|
3547
3580
|
variant: "glass",
|
|
3548
3581
|
header: {
|
|
@@ -3586,22 +3619,10 @@ function AgentNewWizardPageView({
|
|
|
3586
3619
|
if (step < TOTAL_STEPS) goNext();
|
|
3587
3620
|
else void submit();
|
|
3588
3621
|
},
|
|
3589
|
-
className: "space-y-
|
|
3622
|
+
className: "space-y-4",
|
|
3590
3623
|
children: [
|
|
3591
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3592
|
-
|
|
3593
|
-
{
|
|
3594
|
-
steps: timelineSteps,
|
|
3595
|
-
progressLabel: labels.pageTitle,
|
|
3596
|
-
onStepClick: (idx) => {
|
|
3597
|
-
goToStep(idx + 1);
|
|
3598
|
-
}
|
|
3599
|
-
}
|
|
3600
|
-
),
|
|
3601
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full space-y-5", children: [
|
|
3602
|
-
stepBody,
|
|
3603
|
-
footer
|
|
3604
|
-
] })
|
|
3624
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "liquid-surface rounded-2xl p-5 sm:p-8", children: stepBody }),
|
|
3625
|
+
footer
|
|
3605
3626
|
]
|
|
3606
3627
|
}
|
|
3607
3628
|
);
|
|
@@ -3616,34 +3637,1759 @@ function ReviewRow({ label, value }) {
|
|
|
3616
3637
|
/* @__PURE__ */ jsxRuntime.jsx("dd", { className: "mt-0.5 truncate text-xs font-semibold text-gray-900 dark:text-white", children: value })
|
|
3617
3638
|
] });
|
|
3618
3639
|
}
|
|
3640
|
+
var DIALECT_LOGO_SRC = {
|
|
3641
|
+
bigquery: "/logos/datasources/bigquery.svg",
|
|
3642
|
+
postgres: "/logos/datasources/postgres.svg",
|
|
3643
|
+
postgresql: "/logos/datasources/postgres.svg",
|
|
3644
|
+
mysql: "/logos/datasources/mysql.svg",
|
|
3645
|
+
mariadb: "/logos/datasources/mariadb.svg",
|
|
3646
|
+
snowflake: "/logos/datasources/snowflake.svg",
|
|
3647
|
+
mongodb: "/logos/datasources/mongodb.svg",
|
|
3648
|
+
redis: "/logos/datasources/redis.svg",
|
|
3649
|
+
clickhouse: "/logos/datasources/clickhouse.svg",
|
|
3650
|
+
elasticsearch: "/logos/datasources/elasticsearch.svg",
|
|
3651
|
+
duckdb: "/logos/datasources/duckdb.svg",
|
|
3652
|
+
sqlite: "/logos/datasources/sqlite.svg",
|
|
3653
|
+
oracle: "/logos/datasources/oracle.svg",
|
|
3654
|
+
mssql: "/logos/datasources/mssql.svg",
|
|
3655
|
+
sqlserver: "/logos/datasources/mssql.svg",
|
|
3656
|
+
cassandra: "/logos/datasources/cassandra.svg",
|
|
3657
|
+
dynamodb: "/logos/datasources/dynamodb.svg",
|
|
3658
|
+
cockroach: "/logos/datasources/cockroachdb.svg",
|
|
3659
|
+
cockroachdb: "/logos/datasources/cockroachdb.svg",
|
|
3660
|
+
supabase: "/logos/datasources/supabase.svg",
|
|
3661
|
+
firebase: "/logos/datasources/firebase.svg",
|
|
3662
|
+
neo4j: "/logos/datasources/neo4j.svg",
|
|
3663
|
+
neptune: "/logos/datasources/neptune.svg",
|
|
3664
|
+
timestream: "/logos/datasources/timestream.svg",
|
|
3665
|
+
opensearch: "/logos/datasources/opensearch.svg"
|
|
3666
|
+
};
|
|
3667
|
+
var CATEGORY_COLOR = {
|
|
3668
|
+
relational: "blue",
|
|
3669
|
+
nosql: "emerald",
|
|
3670
|
+
warehouse: "purple",
|
|
3671
|
+
timeseries: "sky",
|
|
3672
|
+
graph: "pink",
|
|
3673
|
+
keyvalue: "red",
|
|
3674
|
+
search: "amber"
|
|
3675
|
+
};
|
|
3676
|
+
var TOTAL_STEPS2 = 4;
|
|
3677
|
+
function DatasourceNewWizardPageView({
|
|
3678
|
+
labels,
|
|
3679
|
+
initialStep,
|
|
3680
|
+
onStepChange,
|
|
3681
|
+
onSubmit,
|
|
3682
|
+
onCancel,
|
|
3683
|
+
onTestConnection
|
|
3684
|
+
}) {
|
|
3685
|
+
const clampedInitial = Math.min(TOTAL_STEPS2, Math.max(1, initialStep ?? 1));
|
|
3686
|
+
const [step, setStep] = react.useState(clampedInitial);
|
|
3687
|
+
const [dialect, setDialect] = react.useState("");
|
|
3688
|
+
const [name, setName] = react.useState("");
|
|
3689
|
+
const [host, setHost] = react.useState("");
|
|
3690
|
+
const [port, setPort] = react.useState("");
|
|
3691
|
+
const [database, setDatabase] = react.useState("");
|
|
3692
|
+
const [username, setUsername] = react.useState("");
|
|
3693
|
+
const [password, setPassword] = react.useState("");
|
|
3694
|
+
const [schema, setSchema] = react.useState("");
|
|
3695
|
+
const [connectionString, setConnectionString] = react.useState("");
|
|
3696
|
+
const [projectId, setProjectId] = react.useState("");
|
|
3697
|
+
const [dataset, setDataset] = react.useState("");
|
|
3698
|
+
const [keyFile, setKeyFile] = react.useState("");
|
|
3699
|
+
const [account, setAccount] = react.useState("");
|
|
3700
|
+
const [warehouseField, setWarehouseField] = react.useState("");
|
|
3701
|
+
const [region, setRegion] = react.useState("");
|
|
3702
|
+
const [bucket, setBucket] = react.useState("");
|
|
3703
|
+
const [token, setToken] = react.useState("");
|
|
3704
|
+
const [apiKey, setApiKey] = react.useState("");
|
|
3705
|
+
const [environment, setEnvironment] = react.useState("");
|
|
3706
|
+
const [index, setIndex] = react.useState("");
|
|
3707
|
+
const [ssl, setSsl] = react.useState(true);
|
|
3708
|
+
const [readOnly, setReadOnly] = react.useState(true);
|
|
3709
|
+
const [maxPoolSize, setMaxPoolSize] = react.useState("5");
|
|
3710
|
+
const [timeoutMs, setTimeoutMs] = react.useState("5000");
|
|
3711
|
+
const [allowedTablesItems, setAllowedTablesItems] = react.useState([]);
|
|
3712
|
+
const [allowedTablesSelected, setAllowedTablesSelected] = react.useState([]);
|
|
3713
|
+
const [blockedColumnsItems, setBlockedColumnsItems] = react.useState([]);
|
|
3714
|
+
const [blockedColumnsSelected, setBlockedColumnsSelected] = react.useState([]);
|
|
3715
|
+
const [maskPii, setMaskPii] = react.useState(false);
|
|
3716
|
+
const allowedTablesStyle = {
|
|
3717
|
+
bg: "bg-amber-500/15",
|
|
3718
|
+
text: "text-amber-700 dark:text-amber-300"
|
|
3719
|
+
};
|
|
3720
|
+
const blockedColumnsStyle = {
|
|
3721
|
+
bg: "bg-rose-500/15",
|
|
3722
|
+
text: "text-rose-700 dark:text-rose-300"
|
|
3723
|
+
};
|
|
3724
|
+
const [submitting, setSubmitting] = react.useState(false);
|
|
3725
|
+
const [touched, setTouched] = react.useState(false);
|
|
3726
|
+
const [testStatus, setTestStatus] = react.useState("idle");
|
|
3727
|
+
const dialectOption = react.useMemo(() => dialect ? chunk62BD4WLW_js.findDialect(dialect) : null, [dialect]);
|
|
3728
|
+
const category = react.useMemo(() => dialect ? chunk62BD4WLW_js.findCategory(dialect) : null, [dialect]);
|
|
3729
|
+
react.useEffect(() => {
|
|
3730
|
+
if (dialectOption?.defaultPort && (port === "" || /^[0-9]+$/.test(port))) {
|
|
3731
|
+
setPort(String(dialectOption.defaultPort));
|
|
3732
|
+
}
|
|
3733
|
+
}, [dialect]);
|
|
3734
|
+
react.useEffect(() => {
|
|
3735
|
+
const next = Math.min(TOTAL_STEPS2, Math.max(1, initialStep ?? 1));
|
|
3736
|
+
if (next !== step) setStep(next);
|
|
3737
|
+
}, [initialStep]);
|
|
3738
|
+
function markTouched() {
|
|
3739
|
+
if (!touched) setTouched(true);
|
|
3740
|
+
}
|
|
3741
|
+
const goToStep = react.useCallback((next) => {
|
|
3742
|
+
const clamped = Math.min(TOTAL_STEPS2, Math.max(1, next));
|
|
3743
|
+
setStep(clamped);
|
|
3744
|
+
onStepChange?.(clamped);
|
|
3745
|
+
}, [onStepChange]);
|
|
3746
|
+
function canAdvance(from) {
|
|
3747
|
+
if (from === 1) return Boolean(dialect);
|
|
3748
|
+
if (from === 2) return name.trim().length > 0;
|
|
3749
|
+
return true;
|
|
3750
|
+
}
|
|
3751
|
+
const goNext = react.useCallback(() => {
|
|
3752
|
+
if (!canAdvance(step)) return;
|
|
3753
|
+
if (step < TOTAL_STEPS2) goToStep(step + 1);
|
|
3754
|
+
}, [step, dialect, name]);
|
|
3755
|
+
const goBack = react.useCallback(() => {
|
|
3756
|
+
if (step > 1) goToStep(step - 1);
|
|
3757
|
+
}, [step, goToStep]);
|
|
3758
|
+
const cancelWithConfirm = react.useCallback(() => {
|
|
3759
|
+
if (touched && !window.confirm(labels.wizardCancelConfirm)) return;
|
|
3760
|
+
onCancel();
|
|
3761
|
+
}, [touched, labels.wizardCancelConfirm, onCancel]);
|
|
3762
|
+
function buildPayload() {
|
|
3763
|
+
const payload = {
|
|
3764
|
+
name: name.trim(),
|
|
3765
|
+
dialect,
|
|
3766
|
+
ssl,
|
|
3767
|
+
readOnly
|
|
3768
|
+
};
|
|
3769
|
+
if (host.trim()) payload.host = host.trim();
|
|
3770
|
+
const portNum = Number(port);
|
|
3771
|
+
if (Number.isFinite(portNum) && portNum > 0) payload.port = portNum;
|
|
3772
|
+
if (database.trim()) payload.database = database.trim();
|
|
3773
|
+
if (username.trim()) payload.username = username.trim();
|
|
3774
|
+
if (password) payload.password = password;
|
|
3775
|
+
if (schema.trim()) payload.schema = schema.trim();
|
|
3776
|
+
if (connectionString.trim()) payload.connectionString = connectionString.trim();
|
|
3777
|
+
if (projectId.trim()) payload.projectId = projectId.trim();
|
|
3778
|
+
if (dataset.trim()) payload.dataset = dataset.trim();
|
|
3779
|
+
if (keyFile.trim()) payload.keyFile = keyFile.trim();
|
|
3780
|
+
if (account.trim()) payload.account = account.trim();
|
|
3781
|
+
if (warehouseField.trim()) payload.warehouse = warehouseField.trim();
|
|
3782
|
+
if (region.trim()) payload.region = region.trim();
|
|
3783
|
+
if (bucket.trim()) payload.bucket = bucket.trim();
|
|
3784
|
+
if (token) payload.token = token;
|
|
3785
|
+
if (apiKey) payload.apiKey = apiKey;
|
|
3786
|
+
if (environment.trim()) payload.environment = environment.trim();
|
|
3787
|
+
if (index.trim()) payload.index = index.trim();
|
|
3788
|
+
const pool = Number(maxPoolSize);
|
|
3789
|
+
if (Number.isFinite(pool) && pool > 0) payload.maxPoolSize = pool;
|
|
3790
|
+
const timeout = Number(timeoutMs);
|
|
3791
|
+
if (Number.isFinite(timeout) && timeout > 0) payload.timeoutMs = timeout;
|
|
3792
|
+
if (allowedTablesSelected.length > 0) payload.allowedTables = [...allowedTablesSelected];
|
|
3793
|
+
if (blockedColumnsSelected.length > 0) payload.blockedColumns = [...blockedColumnsSelected];
|
|
3794
|
+
if (maskPii) payload.maskPii = true;
|
|
3795
|
+
return payload;
|
|
3796
|
+
}
|
|
3797
|
+
async function handleTestConnection() {
|
|
3798
|
+
setTestStatus("testing");
|
|
3799
|
+
try {
|
|
3800
|
+
const ok = onTestConnection ? await onTestConnection(buildPayload()) : await simulateTest();
|
|
3801
|
+
setTestStatus(ok ? "success" : "failed");
|
|
3802
|
+
setTimeout(() => setTestStatus("idle"), 3500);
|
|
3803
|
+
} catch {
|
|
3804
|
+
setTestStatus("failed");
|
|
3805
|
+
setTimeout(() => setTestStatus("idle"), 3500);
|
|
3806
|
+
}
|
|
3807
|
+
}
|
|
3808
|
+
async function submit() {
|
|
3809
|
+
setSubmitting(true);
|
|
3810
|
+
try {
|
|
3811
|
+
await onSubmit(buildPayload());
|
|
3812
|
+
} finally {
|
|
3813
|
+
setSubmitting(false);
|
|
3814
|
+
}
|
|
3815
|
+
}
|
|
3816
|
+
react.useEffect(() => {
|
|
3817
|
+
function onKey(e) {
|
|
3818
|
+
if (e.key === "Escape") {
|
|
3819
|
+
e.preventDefault();
|
|
3820
|
+
cancelWithConfirm();
|
|
3821
|
+
return;
|
|
3822
|
+
}
|
|
3823
|
+
if (e.key === "Enter") {
|
|
3824
|
+
const target = e.target;
|
|
3825
|
+
const tag = target?.tagName?.toLowerCase();
|
|
3826
|
+
if (tag === "textarea" || tag === "select" || tag === "input" || tag === "button") return;
|
|
3827
|
+
e.preventDefault();
|
|
3828
|
+
if (step < TOTAL_STEPS2) goNext();
|
|
3829
|
+
else void submit();
|
|
3830
|
+
}
|
|
3831
|
+
}
|
|
3832
|
+
window.addEventListener("keydown", onKey);
|
|
3833
|
+
return () => window.removeEventListener("keydown", onKey);
|
|
3834
|
+
}, [step, dialect, name, touched]);
|
|
3835
|
+
const stepTitles = [
|
|
3836
|
+
labels.wizardStep1Title,
|
|
3837
|
+
labels.wizardStep2Title,
|
|
3838
|
+
labels.wizardStep3Title,
|
|
3839
|
+
labels.wizardStep4Title
|
|
3840
|
+
];
|
|
3841
|
+
const stepSubtitles = [
|
|
3842
|
+
labels.wizardStep1Subtitle,
|
|
3843
|
+
labels.wizardStep2Subtitle,
|
|
3844
|
+
labels.wizardStep3Subtitle,
|
|
3845
|
+
labels.wizardStep4Subtitle
|
|
3846
|
+
];
|
|
3847
|
+
const indicatorSteps = stepTitles.map((title, idx) => ({
|
|
3848
|
+
id: String(idx + 1),
|
|
3849
|
+
title
|
|
3850
|
+
}));
|
|
3851
|
+
const counter = labels.wizardStepCounter.replace("{current}", String(step)).replace("{total}", String(TOTAL_STEPS2));
|
|
3852
|
+
const hero = /* @__PURE__ */ jsxRuntime.jsx(
|
|
3853
|
+
chunkZGVN23J4_js.HeroSection,
|
|
3854
|
+
{
|
|
3855
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(outline.CircleStackIcon, { className: "h-5 w-5" }),
|
|
3856
|
+
label: counter,
|
|
3857
|
+
title: labels.pageTitle,
|
|
3858
|
+
subtitle: stepSubtitles[step - 1] ?? labels.pageSubtitle,
|
|
3859
|
+
gradient: category?.gradient ?? "from-amber-500 to-orange-600",
|
|
3860
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3861
|
+
chunkZGVN23J4_js.StepIndicator,
|
|
3862
|
+
{
|
|
3863
|
+
accent: "indigo",
|
|
3864
|
+
currentStep: step - 1,
|
|
3865
|
+
onStepChange: (idx) => goToStep(idx + 1),
|
|
3866
|
+
progressLabel: labels.pageTitle,
|
|
3867
|
+
steps: indicatorSteps
|
|
3868
|
+
}
|
|
3869
|
+
)
|
|
3870
|
+
}
|
|
3871
|
+
);
|
|
3872
|
+
function renderStep1() {
|
|
3873
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-6", children: chunk62BD4WLW_js.DIALECT_CATEGORIES.map((cat) => {
|
|
3874
|
+
const color = CATEGORY_COLOR[cat.id] ?? "slate";
|
|
3875
|
+
const categoryLabel = labels[cat.labelKey] ?? cat.id;
|
|
3876
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3877
|
+
chunkZGVN23J4_js.SectionCard,
|
|
3878
|
+
{
|
|
3879
|
+
variant: "glass",
|
|
3880
|
+
header: {
|
|
3881
|
+
title: categoryLabel,
|
|
3882
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(cat.icon, { className: "h-4 w-4" }),
|
|
3883
|
+
gradient: cat.gradient
|
|
3884
|
+
},
|
|
3885
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3886
|
+
"div",
|
|
3887
|
+
{
|
|
3888
|
+
role: "radiogroup",
|
|
3889
|
+
"aria-label": categoryLabel,
|
|
3890
|
+
className: "grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4",
|
|
3891
|
+
children: cat.dialects.map((opt) => {
|
|
3892
|
+
const selected = opt.value === dialect;
|
|
3893
|
+
const logoSrc = DIALECT_LOGO_SRC[opt.value.toLowerCase()];
|
|
3894
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3895
|
+
chunkZGVN23J4_js.FilterTileButton,
|
|
3896
|
+
{
|
|
3897
|
+
isActive: selected,
|
|
3898
|
+
color,
|
|
3899
|
+
icon: logoSrc ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: logoSrc, alt: opt.label, className: "h-5 w-5 object-contain" }) : /* @__PURE__ */ jsxRuntime.jsx(outline.CircleStackIcon, { className: "h-5 w-5" }),
|
|
3900
|
+
label: opt.label,
|
|
3901
|
+
count: opt.formType.replace("-", " "),
|
|
3902
|
+
onClick: () => {
|
|
3903
|
+
setDialect(opt.value);
|
|
3904
|
+
markTouched();
|
|
3905
|
+
}
|
|
3906
|
+
},
|
|
3907
|
+
opt.value
|
|
3908
|
+
);
|
|
3909
|
+
})
|
|
3910
|
+
}
|
|
3911
|
+
)
|
|
3912
|
+
},
|
|
3913
|
+
cat.id
|
|
3914
|
+
);
|
|
3915
|
+
}) });
|
|
3916
|
+
}
|
|
3917
|
+
function renderConnectionFields() {
|
|
3918
|
+
if (!dialectOption) return null;
|
|
3919
|
+
switch (dialectOption.formType) {
|
|
3920
|
+
case "standard":
|
|
3921
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3922
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3923
|
+
chunkZGVN23J4_js.FormInput,
|
|
3924
|
+
{
|
|
3925
|
+
label: labels.fieldHost,
|
|
3926
|
+
value: host,
|
|
3927
|
+
onValueChange: (v) => {
|
|
3928
|
+
setHost(v);
|
|
3929
|
+
markTouched();
|
|
3930
|
+
},
|
|
3931
|
+
placeholder: labels.fieldHostPlaceholder,
|
|
3932
|
+
required: true
|
|
3933
|
+
}
|
|
3934
|
+
),
|
|
3935
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3936
|
+
chunkZGVN23J4_js.FormInput,
|
|
3937
|
+
{
|
|
3938
|
+
label: labels.fieldPort,
|
|
3939
|
+
type: "number",
|
|
3940
|
+
value: port,
|
|
3941
|
+
onValueChange: (v) => {
|
|
3942
|
+
setPort(v);
|
|
3943
|
+
markTouched();
|
|
3944
|
+
}
|
|
3945
|
+
}
|
|
3946
|
+
),
|
|
3947
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3948
|
+
chunkZGVN23J4_js.FormInput,
|
|
3949
|
+
{
|
|
3950
|
+
label: labels.fieldDatabase,
|
|
3951
|
+
value: database,
|
|
3952
|
+
onValueChange: (v) => {
|
|
3953
|
+
setDatabase(v);
|
|
3954
|
+
markTouched();
|
|
3955
|
+
},
|
|
3956
|
+
placeholder: labels.fieldDatabasePlaceholder,
|
|
3957
|
+
required: true
|
|
3958
|
+
}
|
|
3959
|
+
),
|
|
3960
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3961
|
+
chunkZGVN23J4_js.FormInput,
|
|
3962
|
+
{
|
|
3963
|
+
label: labels.fieldUsername,
|
|
3964
|
+
value: username,
|
|
3965
|
+
onValueChange: (v) => {
|
|
3966
|
+
setUsername(v);
|
|
3967
|
+
markTouched();
|
|
3968
|
+
},
|
|
3969
|
+
placeholder: labels.fieldUsernamePlaceholder
|
|
3970
|
+
}
|
|
3971
|
+
),
|
|
3972
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3973
|
+
chunkZGVN23J4_js.FormInput,
|
|
3974
|
+
{
|
|
3975
|
+
label: labels.fieldPassword,
|
|
3976
|
+
type: "password",
|
|
3977
|
+
value: password,
|
|
3978
|
+
onValueChange: (v) => {
|
|
3979
|
+
setPassword(v);
|
|
3980
|
+
markTouched();
|
|
3981
|
+
},
|
|
3982
|
+
placeholder: labels.fieldPasswordPlaceholder
|
|
3983
|
+
}
|
|
3984
|
+
),
|
|
3985
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3986
|
+
chunkZGVN23J4_js.FormInput,
|
|
3987
|
+
{
|
|
3988
|
+
label: labels.fieldSchema,
|
|
3989
|
+
value: schema,
|
|
3990
|
+
onValueChange: (v) => {
|
|
3991
|
+
setSchema(v);
|
|
3992
|
+
markTouched();
|
|
3993
|
+
},
|
|
3994
|
+
placeholder: labels.fieldSchemaPlaceholder
|
|
3995
|
+
}
|
|
3996
|
+
)
|
|
3997
|
+
] });
|
|
3998
|
+
case "connection-string":
|
|
3999
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-full", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4000
|
+
chunkZGVN23J4_js.FormInput,
|
|
4001
|
+
{
|
|
4002
|
+
label: labels.fieldConnectionString,
|
|
4003
|
+
value: connectionString,
|
|
4004
|
+
onValueChange: (v) => {
|
|
4005
|
+
setConnectionString(v);
|
|
4006
|
+
markTouched();
|
|
4007
|
+
},
|
|
4008
|
+
placeholder: labels.fieldConnectionStringPlaceholder,
|
|
4009
|
+
required: true
|
|
4010
|
+
}
|
|
4011
|
+
) });
|
|
4012
|
+
case "cloud-bigquery":
|
|
4013
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4014
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4015
|
+
chunkZGVN23J4_js.FormInput,
|
|
4016
|
+
{
|
|
4017
|
+
label: labels.fieldProjectId,
|
|
4018
|
+
value: projectId,
|
|
4019
|
+
onValueChange: (v) => {
|
|
4020
|
+
setProjectId(v);
|
|
4021
|
+
markTouched();
|
|
4022
|
+
},
|
|
4023
|
+
placeholder: labels.fieldProjectIdPlaceholder,
|
|
4024
|
+
required: true
|
|
4025
|
+
}
|
|
4026
|
+
),
|
|
4027
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4028
|
+
chunkZGVN23J4_js.FormInput,
|
|
4029
|
+
{
|
|
4030
|
+
label: labels.fieldDataset,
|
|
4031
|
+
value: dataset,
|
|
4032
|
+
onValueChange: (v) => {
|
|
4033
|
+
setDataset(v);
|
|
4034
|
+
markTouched();
|
|
4035
|
+
},
|
|
4036
|
+
placeholder: labels.fieldDatasetPlaceholder,
|
|
4037
|
+
required: true
|
|
4038
|
+
}
|
|
4039
|
+
),
|
|
4040
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-full", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4041
|
+
chunkZGVN23J4_js.FormInput,
|
|
4042
|
+
{
|
|
4043
|
+
label: labels.fieldKeyFile,
|
|
4044
|
+
value: keyFile,
|
|
4045
|
+
onValueChange: (v) => {
|
|
4046
|
+
setKeyFile(v);
|
|
4047
|
+
markTouched();
|
|
4048
|
+
},
|
|
4049
|
+
placeholder: labels.fieldKeyFilePlaceholder
|
|
4050
|
+
}
|
|
4051
|
+
) })
|
|
4052
|
+
] });
|
|
4053
|
+
case "cloud-snowflake":
|
|
4054
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4055
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4056
|
+
chunkZGVN23J4_js.FormInput,
|
|
4057
|
+
{
|
|
4058
|
+
label: labels.fieldAccount,
|
|
4059
|
+
value: account,
|
|
4060
|
+
onValueChange: (v) => {
|
|
4061
|
+
setAccount(v);
|
|
4062
|
+
markTouched();
|
|
4063
|
+
},
|
|
4064
|
+
placeholder: labels.fieldAccountPlaceholder,
|
|
4065
|
+
required: true
|
|
4066
|
+
}
|
|
4067
|
+
),
|
|
4068
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4069
|
+
chunkZGVN23J4_js.FormInput,
|
|
4070
|
+
{
|
|
4071
|
+
label: labels.fieldWarehouse,
|
|
4072
|
+
value: warehouseField,
|
|
4073
|
+
onValueChange: (v) => {
|
|
4074
|
+
setWarehouseField(v);
|
|
4075
|
+
markTouched();
|
|
4076
|
+
},
|
|
4077
|
+
placeholder: labels.fieldWarehousePlaceholder,
|
|
4078
|
+
required: true
|
|
4079
|
+
}
|
|
4080
|
+
),
|
|
4081
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4082
|
+
chunkZGVN23J4_js.FormInput,
|
|
4083
|
+
{
|
|
4084
|
+
label: labels.fieldDatabase,
|
|
4085
|
+
value: database,
|
|
4086
|
+
onValueChange: (v) => {
|
|
4087
|
+
setDatabase(v);
|
|
4088
|
+
markTouched();
|
|
4089
|
+
},
|
|
4090
|
+
placeholder: labels.fieldDatabasePlaceholder,
|
|
4091
|
+
required: true
|
|
4092
|
+
}
|
|
4093
|
+
),
|
|
4094
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4095
|
+
chunkZGVN23J4_js.FormInput,
|
|
4096
|
+
{
|
|
4097
|
+
label: labels.fieldUsername,
|
|
4098
|
+
value: username,
|
|
4099
|
+
onValueChange: (v) => {
|
|
4100
|
+
setUsername(v);
|
|
4101
|
+
markTouched();
|
|
4102
|
+
},
|
|
4103
|
+
placeholder: labels.fieldUsernamePlaceholder,
|
|
4104
|
+
required: true
|
|
4105
|
+
}
|
|
4106
|
+
),
|
|
4107
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4108
|
+
chunkZGVN23J4_js.FormInput,
|
|
4109
|
+
{
|
|
4110
|
+
label: labels.fieldPassword,
|
|
4111
|
+
type: "password",
|
|
4112
|
+
value: password,
|
|
4113
|
+
onValueChange: (v) => {
|
|
4114
|
+
setPassword(v);
|
|
4115
|
+
markTouched();
|
|
4116
|
+
},
|
|
4117
|
+
placeholder: labels.fieldPasswordPlaceholder
|
|
4118
|
+
}
|
|
4119
|
+
),
|
|
4120
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4121
|
+
chunkZGVN23J4_js.FormInput,
|
|
4122
|
+
{
|
|
4123
|
+
label: labels.fieldSchema,
|
|
4124
|
+
value: schema,
|
|
4125
|
+
onValueChange: (v) => {
|
|
4126
|
+
setSchema(v);
|
|
4127
|
+
markTouched();
|
|
4128
|
+
},
|
|
4129
|
+
placeholder: labels.fieldSchemaPlaceholder
|
|
4130
|
+
}
|
|
4131
|
+
)
|
|
4132
|
+
] });
|
|
4133
|
+
case "cloud-key":
|
|
4134
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4135
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4136
|
+
chunkZGVN23J4_js.FormInput,
|
|
4137
|
+
{
|
|
4138
|
+
label: labels.fieldRegion,
|
|
4139
|
+
value: region,
|
|
4140
|
+
onValueChange: (v) => {
|
|
4141
|
+
setRegion(v);
|
|
4142
|
+
markTouched();
|
|
4143
|
+
},
|
|
4144
|
+
placeholder: labels.fieldRegionPlaceholder,
|
|
4145
|
+
required: true
|
|
4146
|
+
}
|
|
4147
|
+
),
|
|
4148
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4149
|
+
chunkZGVN23J4_js.FormInput,
|
|
4150
|
+
{
|
|
4151
|
+
label: labels.fieldToken,
|
|
4152
|
+
type: "password",
|
|
4153
|
+
value: token,
|
|
4154
|
+
onValueChange: (v) => {
|
|
4155
|
+
setToken(v);
|
|
4156
|
+
markTouched();
|
|
4157
|
+
},
|
|
4158
|
+
placeholder: labels.fieldTokenPlaceholder,
|
|
4159
|
+
required: true
|
|
4160
|
+
}
|
|
4161
|
+
),
|
|
4162
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4163
|
+
chunkZGVN23J4_js.FormInput,
|
|
4164
|
+
{
|
|
4165
|
+
label: labels.fieldBucket,
|
|
4166
|
+
value: bucket,
|
|
4167
|
+
onValueChange: (v) => {
|
|
4168
|
+
setBucket(v);
|
|
4169
|
+
markTouched();
|
|
4170
|
+
},
|
|
4171
|
+
placeholder: labels.fieldBucketPlaceholder
|
|
4172
|
+
}
|
|
4173
|
+
)
|
|
4174
|
+
] });
|
|
4175
|
+
case "vector-key":
|
|
4176
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4177
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4178
|
+
chunkZGVN23J4_js.FormInput,
|
|
4179
|
+
{
|
|
4180
|
+
label: labels.fieldApiKey,
|
|
4181
|
+
type: "password",
|
|
4182
|
+
value: apiKey,
|
|
4183
|
+
onValueChange: (v) => {
|
|
4184
|
+
setApiKey(v);
|
|
4185
|
+
markTouched();
|
|
4186
|
+
},
|
|
4187
|
+
placeholder: labels.fieldApiKeyPlaceholder,
|
|
4188
|
+
required: true
|
|
4189
|
+
}
|
|
4190
|
+
),
|
|
4191
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4192
|
+
chunkZGVN23J4_js.FormInput,
|
|
4193
|
+
{
|
|
4194
|
+
label: labels.fieldEnvironment,
|
|
4195
|
+
value: environment,
|
|
4196
|
+
onValueChange: (v) => {
|
|
4197
|
+
setEnvironment(v);
|
|
4198
|
+
markTouched();
|
|
4199
|
+
},
|
|
4200
|
+
placeholder: labels.fieldEnvironmentPlaceholder,
|
|
4201
|
+
required: true
|
|
4202
|
+
}
|
|
4203
|
+
),
|
|
4204
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4205
|
+
chunkZGVN23J4_js.FormInput,
|
|
4206
|
+
{
|
|
4207
|
+
label: labels.fieldIndex,
|
|
4208
|
+
value: index,
|
|
4209
|
+
onValueChange: (v) => {
|
|
4210
|
+
setIndex(v);
|
|
4211
|
+
markTouched();
|
|
4212
|
+
},
|
|
4213
|
+
placeholder: labels.fieldIndexPlaceholder
|
|
4214
|
+
}
|
|
4215
|
+
)
|
|
4216
|
+
] });
|
|
4217
|
+
}
|
|
4218
|
+
}
|
|
4219
|
+
function renderStep2() {
|
|
4220
|
+
if (!dialectOption) {
|
|
4221
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(chunkZGVN23J4_js.SectionCard, { variant: "glass", header: { title: labels.wizardStep1Title }, children: [
|
|
4222
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-slate-700 dark:text-slate-200", children: labels.wizardStep1Subtitle }),
|
|
4223
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3", children: /* @__PURE__ */ jsxRuntime.jsx(chunkBHOT22QL_js.Button, { type: "button", outline: true, onClick: () => goToStep(1), children: labels.wizardBack }) })
|
|
4224
|
+
] });
|
|
4225
|
+
}
|
|
4226
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4227
|
+
chunkZGVN23J4_js.SectionCard,
|
|
4228
|
+
{
|
|
4229
|
+
variant: "glass",
|
|
4230
|
+
header: {
|
|
4231
|
+
title: dialectOption.label,
|
|
4232
|
+
subtitle: labels.wizardStep2Subtitle,
|
|
4233
|
+
icon: category?.icon ? /* @__PURE__ */ jsxRuntime.jsx(category.icon, { className: "h-4 w-4" }) : /* @__PURE__ */ jsxRuntime.jsx(outline.CircleStackIcon, { className: "h-4 w-4" }),
|
|
4234
|
+
gradient: category?.gradient
|
|
4235
|
+
},
|
|
4236
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
4237
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4238
|
+
chunkZGVN23J4_js.FormInput,
|
|
4239
|
+
{
|
|
4240
|
+
label: labels.fieldName,
|
|
4241
|
+
value: name,
|
|
4242
|
+
onValueChange: (v) => {
|
|
4243
|
+
setName(v);
|
|
4244
|
+
markTouched();
|
|
4245
|
+
},
|
|
4246
|
+
placeholder: labels.fieldNamePlaceholder,
|
|
4247
|
+
required: true
|
|
4248
|
+
}
|
|
4249
|
+
),
|
|
4250
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.FormGrid, { children: renderConnectionFields() }),
|
|
4251
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-6 pt-1", children: [
|
|
4252
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4253
|
+
chunkZGVN23J4_js.FormToggle,
|
|
4254
|
+
{
|
|
4255
|
+
checked: ssl,
|
|
4256
|
+
onChange: (v) => {
|
|
4257
|
+
setSsl(v);
|
|
4258
|
+
markTouched();
|
|
4259
|
+
},
|
|
4260
|
+
label: labels.fieldSsl,
|
|
4261
|
+
variant: "inline"
|
|
4262
|
+
}
|
|
4263
|
+
),
|
|
4264
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4265
|
+
chunkZGVN23J4_js.FormToggle,
|
|
4266
|
+
{
|
|
4267
|
+
checked: readOnly,
|
|
4268
|
+
onChange: (v) => {
|
|
4269
|
+
setReadOnly(v);
|
|
4270
|
+
markTouched();
|
|
4271
|
+
},
|
|
4272
|
+
label: labels.fieldReadOnly,
|
|
4273
|
+
variant: "inline"
|
|
4274
|
+
}
|
|
4275
|
+
)
|
|
4276
|
+
] }),
|
|
4277
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-slate-500 dark:text-slate-400", children: labels.fieldReadOnlyHelp }),
|
|
4278
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-3 border-t border-slate-200/60 pt-4 dark:border-white/10", children: [
|
|
4279
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4280
|
+
chunkBHOT22QL_js.Button,
|
|
4281
|
+
{
|
|
4282
|
+
type: "button",
|
|
4283
|
+
outline: true,
|
|
4284
|
+
onClick: () => void handleTestConnection(),
|
|
4285
|
+
disabled: testStatus === "testing",
|
|
4286
|
+
children: testStatus === "testing" ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-2", children: [
|
|
4287
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.Spinner, { size: "xs" }),
|
|
4288
|
+
labels.testing
|
|
4289
|
+
] }) : labels.testConnection
|
|
4290
|
+
}
|
|
4291
|
+
),
|
|
4292
|
+
testStatus === "success" && /* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.StatusBadge, { status: "success", label: labels.connectionSuccess }),
|
|
4293
|
+
testStatus === "failed" && /* @__PURE__ */ jsxRuntime.jsx(chunkZGVN23J4_js.StatusBadge, { status: "error", label: labels.connectionFailed })
|
|
4294
|
+
] })
|
|
4295
|
+
] })
|
|
4296
|
+
}
|
|
4297
|
+
);
|
|
4298
|
+
}
|
|
4299
|
+
function renderStep3() {
|
|
4300
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4301
|
+
chunkZGVN23J4_js.SectionCard,
|
|
4302
|
+
{
|
|
4303
|
+
variant: "glass",
|
|
4304
|
+
header: {
|
|
4305
|
+
title: labels.governanceSectionTitle,
|
|
4306
|
+
subtitle: labels.governanceSectionSubtitle
|
|
4307
|
+
},
|
|
4308
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
4309
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkZGVN23J4_js.FormGrid, { children: [
|
|
4310
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4311
|
+
chunkZGVN23J4_js.FormInput,
|
|
4312
|
+
{
|
|
4313
|
+
label: labels.fieldMaxPoolSize,
|
|
4314
|
+
type: "number",
|
|
4315
|
+
min: 1,
|
|
4316
|
+
max: 100,
|
|
4317
|
+
value: maxPoolSize,
|
|
4318
|
+
onValueChange: (v) => {
|
|
4319
|
+
setMaxPoolSize(v);
|
|
4320
|
+
markTouched();
|
|
4321
|
+
},
|
|
4322
|
+
hint: labels.fieldMaxPoolSizeHint
|
|
4323
|
+
}
|
|
4324
|
+
),
|
|
4325
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4326
|
+
chunkZGVN23J4_js.FormInput,
|
|
4327
|
+
{
|
|
4328
|
+
label: labels.fieldTimeoutMs,
|
|
4329
|
+
type: "number",
|
|
4330
|
+
min: 100,
|
|
4331
|
+
value: timeoutMs,
|
|
4332
|
+
onValueChange: (v) => {
|
|
4333
|
+
setTimeoutMs(v);
|
|
4334
|
+
markTouched();
|
|
4335
|
+
},
|
|
4336
|
+
hint: labels.fieldTimeoutMsHint
|
|
4337
|
+
}
|
|
4338
|
+
)
|
|
4339
|
+
] }),
|
|
4340
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
|
|
4341
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-xs font-medium text-gray-500 dark:text-gray-400", children: labels.fieldAllowedTables }),
|
|
4342
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4343
|
+
chunkZGVN23J4_js.ChipPicker,
|
|
4344
|
+
{
|
|
4345
|
+
items: allowedTablesItems,
|
|
4346
|
+
selectedIds: allowedTablesSelected,
|
|
4347
|
+
onChange: (ids) => {
|
|
4348
|
+
setAllowedTablesSelected(ids);
|
|
4349
|
+
markTouched();
|
|
4350
|
+
},
|
|
4351
|
+
onItemsChange: (items) => {
|
|
4352
|
+
setAllowedTablesItems(items);
|
|
4353
|
+
markTouched();
|
|
4354
|
+
},
|
|
4355
|
+
allowCustom: true,
|
|
4356
|
+
unselectedStyle: allowedTablesStyle,
|
|
4357
|
+
showActions: false,
|
|
4358
|
+
addPlaceholder: labels.fieldAllowedTablesPlaceholder,
|
|
4359
|
+
addAriaLabel: labels.fieldAllowedTables
|
|
4360
|
+
}
|
|
4361
|
+
),
|
|
4362
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: labels.fieldAllowedTablesHint })
|
|
4363
|
+
] }),
|
|
4364
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
|
|
4365
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-xs font-medium text-gray-500 dark:text-gray-400", children: labels.fieldBlockedColumns }),
|
|
4366
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4367
|
+
chunkZGVN23J4_js.ChipPicker,
|
|
4368
|
+
{
|
|
4369
|
+
items: blockedColumnsItems,
|
|
4370
|
+
selectedIds: blockedColumnsSelected,
|
|
4371
|
+
onChange: (ids) => {
|
|
4372
|
+
setBlockedColumnsSelected(ids);
|
|
4373
|
+
markTouched();
|
|
4374
|
+
},
|
|
4375
|
+
onItemsChange: (items) => {
|
|
4376
|
+
setBlockedColumnsItems(items);
|
|
4377
|
+
markTouched();
|
|
4378
|
+
},
|
|
4379
|
+
allowCustom: true,
|
|
4380
|
+
unselectedStyle: blockedColumnsStyle,
|
|
4381
|
+
showActions: false,
|
|
4382
|
+
addPlaceholder: labels.fieldBlockedColumnsPlaceholder,
|
|
4383
|
+
addAriaLabel: labels.fieldBlockedColumns
|
|
4384
|
+
}
|
|
4385
|
+
),
|
|
4386
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: labels.fieldBlockedColumnsHint })
|
|
4387
|
+
] }),
|
|
4388
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4389
|
+
chunkZGVN23J4_js.FormCheckbox,
|
|
4390
|
+
{
|
|
4391
|
+
checked: maskPii,
|
|
4392
|
+
onChange: (v) => {
|
|
4393
|
+
setMaskPii(v);
|
|
4394
|
+
markTouched();
|
|
4395
|
+
},
|
|
4396
|
+
label: labels.fieldMaskPii,
|
|
4397
|
+
description: labels.fieldMaskPiiDescription
|
|
4398
|
+
}
|
|
4399
|
+
)
|
|
4400
|
+
] })
|
|
4401
|
+
}
|
|
4402
|
+
);
|
|
4403
|
+
}
|
|
4404
|
+
function renderStep4() {
|
|
4405
|
+
const categoryLabel = category ? labels[category.labelKey] ?? category.id : labels.reviewNoneValue;
|
|
4406
|
+
const dialectLabel = dialectOption?.label ?? labels.reviewNoneValue;
|
|
4407
|
+
const allowed = allowedTablesSelected;
|
|
4408
|
+
const blocked = blockedColumnsSelected;
|
|
4409
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
4410
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4411
|
+
chunkZGVN23J4_js.SectionCard,
|
|
4412
|
+
{
|
|
4413
|
+
variant: "glass",
|
|
4414
|
+
header: {
|
|
4415
|
+
title: labels.wizardStep1Title,
|
|
4416
|
+
subtitle: labels.wizardStep1Subtitle
|
|
4417
|
+
},
|
|
4418
|
+
actions: /* @__PURE__ */ jsxRuntime.jsxs(chunkBHOT22QL_js.Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(1), children: [
|
|
4419
|
+
/* @__PURE__ */ jsxRuntime.jsx(outline.PencilSquareIcon, { className: "h-4 w-4" }),
|
|
4420
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
4421
|
+
] }),
|
|
4422
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
|
|
4423
|
+
/* @__PURE__ */ jsxRuntime.jsx(ReviewRow2, { label: labels.reviewCategoryLabel, value: categoryLabel }),
|
|
4424
|
+
/* @__PURE__ */ jsxRuntime.jsx(ReviewRow2, { label: labels.reviewDialectLabel, value: dialectLabel })
|
|
4425
|
+
] })
|
|
4426
|
+
}
|
|
4427
|
+
),
|
|
4428
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4429
|
+
chunkZGVN23J4_js.SectionCard,
|
|
4430
|
+
{
|
|
4431
|
+
variant: "glass",
|
|
4432
|
+
header: {
|
|
4433
|
+
title: labels.wizardStep2Title,
|
|
4434
|
+
subtitle: labels.wizardStep2Subtitle
|
|
4435
|
+
},
|
|
4436
|
+
actions: /* @__PURE__ */ jsxRuntime.jsxs(chunkBHOT22QL_js.Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(2), children: [
|
|
4437
|
+
/* @__PURE__ */ jsxRuntime.jsx(outline.PencilSquareIcon, { className: "h-4 w-4" }),
|
|
4438
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
4439
|
+
] }),
|
|
4440
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
|
|
4441
|
+
/* @__PURE__ */ jsxRuntime.jsx(ReviewRow2, { label: labels.reviewNameLabel, value: name || labels.reviewNoneValue }),
|
|
4442
|
+
/* @__PURE__ */ jsxRuntime.jsx(ReviewRow2, { label: labels.reviewCredentialsLabel, value: labels.reviewCredentialsRedacted }),
|
|
4443
|
+
/* @__PURE__ */ jsxRuntime.jsx(ReviewRow2, { label: labels.reviewSslLabel, value: ssl ? labels.reviewYes : labels.reviewNo }),
|
|
4444
|
+
/* @__PURE__ */ jsxRuntime.jsx(ReviewRow2, { label: labels.reviewReadOnlyLabel, value: readOnly ? labels.reviewYes : labels.reviewNo })
|
|
4445
|
+
] })
|
|
4446
|
+
}
|
|
4447
|
+
),
|
|
4448
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4449
|
+
chunkZGVN23J4_js.SectionCard,
|
|
4450
|
+
{
|
|
4451
|
+
variant: "glass",
|
|
4452
|
+
header: {
|
|
4453
|
+
title: labels.wizardStep3Title,
|
|
4454
|
+
subtitle: labels.wizardStep3Subtitle
|
|
4455
|
+
},
|
|
4456
|
+
actions: /* @__PURE__ */ jsxRuntime.jsxs(chunkBHOT22QL_js.Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(3), children: [
|
|
4457
|
+
/* @__PURE__ */ jsxRuntime.jsx(outline.PencilSquareIcon, { className: "h-4 w-4" }),
|
|
4458
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
4459
|
+
] }),
|
|
4460
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
|
|
4461
|
+
/* @__PURE__ */ jsxRuntime.jsx(ReviewRow2, { label: labels.reviewPoolLabel, value: maxPoolSize || labels.reviewNoneValue }),
|
|
4462
|
+
/* @__PURE__ */ jsxRuntime.jsx(ReviewRow2, { label: labels.reviewTimeoutLabel, value: timeoutMs ? `${timeoutMs}ms` : labels.reviewNoneValue }),
|
|
4463
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4464
|
+
ReviewRow2,
|
|
4465
|
+
{
|
|
4466
|
+
label: labels.reviewAllowedTablesLabel,
|
|
4467
|
+
value: allowed.length > 0 ? allowed.join(", ") : labels.reviewNoneValue
|
|
4468
|
+
}
|
|
4469
|
+
),
|
|
4470
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4471
|
+
ReviewRow2,
|
|
4472
|
+
{
|
|
4473
|
+
label: labels.reviewBlockedColumnsLabel,
|
|
4474
|
+
value: blocked.length > 0 ? blocked.join(", ") : labels.reviewNoneValue
|
|
4475
|
+
}
|
|
4476
|
+
),
|
|
4477
|
+
/* @__PURE__ */ jsxRuntime.jsx(ReviewRow2, { label: labels.reviewMaskPiiLabel, value: maskPii ? labels.reviewYes : labels.reviewNo })
|
|
4478
|
+
] })
|
|
4479
|
+
}
|
|
4480
|
+
)
|
|
4481
|
+
] });
|
|
4482
|
+
}
|
|
4483
|
+
const stepBody = step === 1 ? renderStep1() : step === 2 ? renderStep2() : step === 3 ? renderStep3() : renderStep4();
|
|
4484
|
+
const advanceDisabled = !canAdvance(step);
|
|
4485
|
+
const footer = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2 border-t border-slate-200/60 pt-4 dark:border-white/10", children: [
|
|
4486
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsx(chunkBHOT22QL_js.Button, { type: "button", outline: true, onClick: goBack, disabled: step === 1 || submitting, children: labels.wizardBack }) }),
|
|
4487
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
4488
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkBHOT22QL_js.Button, { type: "button", outline: true, onClick: cancelWithConfirm, disabled: submitting, children: labels.wizardCancel }),
|
|
4489
|
+
step < TOTAL_STEPS2 ? /* @__PURE__ */ jsxRuntime.jsx(chunkBHOT22QL_js.Button, { type: "button", color: "amber", onClick: goNext, disabled: advanceDisabled || submitting, children: labels.wizardNext }) : /* @__PURE__ */ jsxRuntime.jsx(chunkBHOT22QL_js.Button, { type: "button", color: "amber", onClick: () => void submit(), disabled: submitting || !dialect || !name.trim(), children: submitting ? labels.wizardCreate + "\u2026" : labels.wizardCreate })
|
|
4490
|
+
] })
|
|
4491
|
+
] });
|
|
4492
|
+
const content = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4493
|
+
"form",
|
|
4494
|
+
{
|
|
4495
|
+
onSubmit: (e) => {
|
|
4496
|
+
e.preventDefault();
|
|
4497
|
+
if (step < TOTAL_STEPS2) goNext();
|
|
4498
|
+
else void submit();
|
|
4499
|
+
},
|
|
4500
|
+
className: "space-y-4",
|
|
4501
|
+
children: [
|
|
4502
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "liquid-surface rounded-2xl p-5 sm:p-8", children: stepBody }),
|
|
4503
|
+
footer
|
|
4504
|
+
]
|
|
4505
|
+
}
|
|
4506
|
+
);
|
|
4507
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
4508
|
+
hero,
|
|
4509
|
+
content
|
|
4510
|
+
] });
|
|
4511
|
+
}
|
|
4512
|
+
function ReviewRow2({ label, value }) {
|
|
4513
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg border border-slate-200/60 bg-white/40 px-3 py-2 dark:border-white/10 dark:bg-white/[0.04]", children: [
|
|
4514
|
+
/* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-[10px] uppercase tracking-wider text-gray-400 dark:text-gray-500", children: label }),
|
|
4515
|
+
/* @__PURE__ */ jsxRuntime.jsx("dd", { className: "mt-0.5 truncate text-xs font-semibold text-gray-900 dark:text-white", children: value })
|
|
4516
|
+
] });
|
|
4517
|
+
}
|
|
4518
|
+
async function simulateTest() {
|
|
4519
|
+
await new Promise((r) => setTimeout(r, 1500));
|
|
4520
|
+
return true;
|
|
4521
|
+
}
|
|
4522
|
+
function RangeSliderField2({
|
|
4523
|
+
sliderId,
|
|
4524
|
+
label,
|
|
4525
|
+
value,
|
|
4526
|
+
onChange,
|
|
4527
|
+
min,
|
|
4528
|
+
max,
|
|
4529
|
+
step,
|
|
4530
|
+
zones,
|
|
4531
|
+
trackGradient,
|
|
4532
|
+
formatValue: formatValue2,
|
|
4533
|
+
ariaLabel
|
|
4534
|
+
}) {
|
|
4535
|
+
const percent = (value - min) / (max - min) * 100;
|
|
4536
|
+
const activeZone = zones?.find((z) => value <= z.max) ?? zones?.[zones.length - 1];
|
|
4537
|
+
const thumbColor = activeZone?.thumbColor ?? "#6366f1";
|
|
4538
|
+
const glow = hexToGlow2(thumbColor);
|
|
4539
|
+
const displayValue = formatValue2 ? formatValue2(value) : value.toString();
|
|
4540
|
+
const ariaText = activeZone ? `${displayValue} \u2014 ${activeZone.label}` : displayValue;
|
|
4541
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
4542
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
4543
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: sliderId, className: "text-xs font-medium text-gray-500 dark:text-gray-400", children: label }),
|
|
4544
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-bold tabular-nums text-gray-900 dark:text-white", children: displayValue })
|
|
4545
|
+
] }),
|
|
4546
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
4547
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-x-0 top-1/2 h-2 -translate-y-1/2 overflow-hidden rounded-full bg-gray-200 dark:bg-gray-700", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4548
|
+
"div",
|
|
4549
|
+
{
|
|
4550
|
+
className: "h-full rounded-full transition-all duration-300 ease-out motion-reduce:transition-none",
|
|
4551
|
+
style: {
|
|
4552
|
+
width: `${Math.max(0, Math.min(100, percent))}%`,
|
|
4553
|
+
background: trackGradient ?? `linear-gradient(90deg, ${thumbColor}, ${thumbColor})`
|
|
4554
|
+
}
|
|
4555
|
+
}
|
|
4556
|
+
) }),
|
|
4557
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4558
|
+
"input",
|
|
4559
|
+
{
|
|
4560
|
+
id: sliderId,
|
|
4561
|
+
"data-slider-id": sliderId,
|
|
4562
|
+
type: "range",
|
|
4563
|
+
min,
|
|
4564
|
+
max,
|
|
4565
|
+
step,
|
|
4566
|
+
value,
|
|
4567
|
+
onChange: (e) => onChange(parseFloat(e.target.value)),
|
|
4568
|
+
"aria-label": ariaLabel ?? label,
|
|
4569
|
+
"aria-valuemin": min,
|
|
4570
|
+
"aria-valuemax": max,
|
|
4571
|
+
"aria-valuenow": value,
|
|
4572
|
+
"aria-valuetext": ariaText,
|
|
4573
|
+
className: "relative z-10 h-5 w-full cursor-pointer appearance-none bg-transparent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 focus-visible:ring-offset-2 [&::-webkit-slider-thumb]:h-5 [&::-webkit-slider-thumb]:w-5 [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:rounded-full [&::-webkit-slider-thumb]:border-2 [&::-webkit-slider-thumb]:border-white [&::-webkit-slider-thumb]:shadow-lg dark:[&::-webkit-slider-thumb]:border-gray-900"
|
|
4574
|
+
}
|
|
4575
|
+
),
|
|
4576
|
+
/* @__PURE__ */ jsxRuntime.jsx("style", { children: `[data-slider-id="${sliderId}"]::-webkit-slider-thumb { background: ${thumbColor}; box-shadow: 0 0 8px ${glow}; } [data-slider-id="${sliderId}"]::-moz-range-thumb { background: ${thumbColor}; border: 2px solid white; box-shadow: 0 0 8px ${glow}; }` })
|
|
4577
|
+
] }),
|
|
4578
|
+
zones && zones.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 flex items-center justify-between", children: zones.map((z) => {
|
|
4579
|
+
const isActive = z.label === activeZone?.label;
|
|
4580
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4581
|
+
"span",
|
|
4582
|
+
{
|
|
4583
|
+
className: `text-[10px] font-medium transition-colors motion-reduce:transition-none ${isActive ? z.color : "text-gray-400 dark:text-gray-500"}`,
|
|
4584
|
+
children: z.label
|
|
4585
|
+
},
|
|
4586
|
+
z.label
|
|
4587
|
+
);
|
|
4588
|
+
}) })
|
|
4589
|
+
] });
|
|
4590
|
+
}
|
|
4591
|
+
function hexToGlow2(hex) {
|
|
4592
|
+
const m = /^#?([0-9a-f]{6})$/i.exec(hex);
|
|
4593
|
+
if (!m) return "rgba(99,102,241,0.5)";
|
|
4594
|
+
const int = parseInt(m[1], 16);
|
|
4595
|
+
const r = int >> 16 & 255;
|
|
4596
|
+
const g = int >> 8 & 255;
|
|
4597
|
+
const b = int & 255;
|
|
4598
|
+
return `rgba(${r},${g},${b},0.5)`;
|
|
4599
|
+
}
|
|
4600
|
+
var ACTION_TILES = [
|
|
4601
|
+
{ id: "notify", color: "sky", icon: outline.BellAlertIcon, labelKey: "actionNotifyLabel", descriptionKey: "actionNotifyDescription" },
|
|
4602
|
+
{ id: "call-webhook", color: "indigo", icon: outline.GlobeAltIcon, labelKey: "actionWebhookLabel", descriptionKey: "actionWebhookDescription" },
|
|
4603
|
+
{ id: "mutate", color: "amber", icon: outline.PencilIcon, labelKey: "actionMutateLabel", descriptionKey: "actionMutateDescription" },
|
|
4604
|
+
{ id: "escalate", color: "rose", icon: outline.ArrowUpCircleIcon, labelKey: "actionEscalateLabel", descriptionKey: "actionEscalateDescription" },
|
|
4605
|
+
{ id: "route-to-agent", color: "violet", icon: outline.SparklesIcon, labelKey: "actionRouteLabel", descriptionKey: "actionRouteDescription" }
|
|
4606
|
+
];
|
|
4607
|
+
var WEEKDAYS = [
|
|
4608
|
+
{ id: "mon", labelKey: "weekdayMon" },
|
|
4609
|
+
{ id: "tue", labelKey: "weekdayTue" },
|
|
4610
|
+
{ id: "wed", labelKey: "weekdayWed" },
|
|
4611
|
+
{ id: "thu", labelKey: "weekdayThu" },
|
|
4612
|
+
{ id: "fri", labelKey: "weekdayFri" },
|
|
4613
|
+
{ id: "sat", labelKey: "weekdaySat" },
|
|
4614
|
+
{ id: "sun", labelKey: "weekdaySun" }
|
|
4615
|
+
];
|
|
4616
|
+
var TOTAL_STEPS3 = 5;
|
|
4617
|
+
function RuleNewWizardPageView({
|
|
4618
|
+
labels,
|
|
4619
|
+
initialStep,
|
|
4620
|
+
onStepChange,
|
|
4621
|
+
onSubmit,
|
|
4622
|
+
onCancel
|
|
4623
|
+
}) {
|
|
4624
|
+
const clampedInitial = Math.min(TOTAL_STEPS3, Math.max(1, initialStep ?? 1));
|
|
4625
|
+
const [step, setStep] = react.useState(clampedInitial);
|
|
4626
|
+
const [name, setName] = react.useState("");
|
|
4627
|
+
const [description, setDescription] = react.useState("");
|
|
4628
|
+
const [priority, setPriority] = react.useState(50);
|
|
4629
|
+
const [enabled, setEnabled] = react.useState(true);
|
|
4630
|
+
const [status, setStatus] = react.useState("active");
|
|
4631
|
+
const [tagsItems, setTagsItems] = react.useState([]);
|
|
4632
|
+
const [tagsSelected, setTagsSelected] = react.useState([]);
|
|
4633
|
+
const tagsStyle = {
|
|
4634
|
+
bg: "bg-fuchsia-500/15",
|
|
4635
|
+
text: "text-fuchsia-700 dark:text-fuchsia-300"
|
|
4636
|
+
};
|
|
4637
|
+
const [combinator, setCombinator] = react.useState("and");
|
|
4638
|
+
const [condition, setCondition] = react.useState(chunkH475T2N7_js.defaultRuleCondition());
|
|
4639
|
+
const [actionTileId, setActionTileId] = react.useState("");
|
|
4640
|
+
const [action, setAction] = react.useState(chunkH475T2N7_js.defaultRuleAction());
|
|
4641
|
+
const [validFromDate, setValidFromDate] = react.useState(null);
|
|
4642
|
+
const [validFromTime, setValidFromTime] = react.useState(null);
|
|
4643
|
+
const [validUntilDate, setValidUntilDate] = react.useState(null);
|
|
4644
|
+
const [validUntilTime, setValidUntilTime] = react.useState(null);
|
|
4645
|
+
const [noExpiry, setNoExpiry] = react.useState(true);
|
|
4646
|
+
const [recurrence, setRecurrence] = react.useState("one-off");
|
|
4647
|
+
const [cronExpression, setCronExpression] = react.useState("");
|
|
4648
|
+
const [weekdays, setWeekdays] = react.useState([]);
|
|
4649
|
+
const [recurringTime, setRecurringTime] = react.useState(null);
|
|
4650
|
+
const [submitting, setSubmitting] = react.useState(false);
|
|
4651
|
+
const [touched, setTouched] = react.useState(false);
|
|
4652
|
+
function markTouched() {
|
|
4653
|
+
if (!touched) setTouched(true);
|
|
4654
|
+
}
|
|
4655
|
+
react.useEffect(() => {
|
|
4656
|
+
const next = Math.min(TOTAL_STEPS3, Math.max(1, initialStep ?? 1));
|
|
4657
|
+
if (next !== step) setStep(next);
|
|
4658
|
+
}, [initialStep]);
|
|
4659
|
+
const goToStep = react.useCallback((next) => {
|
|
4660
|
+
const clamped = Math.min(TOTAL_STEPS3, Math.max(1, next));
|
|
4661
|
+
setStep(clamped);
|
|
4662
|
+
onStepChange?.(clamped);
|
|
4663
|
+
}, [onStepChange]);
|
|
4664
|
+
function canAdvance(from) {
|
|
4665
|
+
if (from === 1) return name.trim().length > 0;
|
|
4666
|
+
if (from === 3) return actionTileId.length > 0;
|
|
4667
|
+
return true;
|
|
4668
|
+
}
|
|
4669
|
+
const goNext = react.useCallback(() => {
|
|
4670
|
+
if (!canAdvance(step)) return;
|
|
4671
|
+
if (step < TOTAL_STEPS3) goToStep(step + 1);
|
|
4672
|
+
}, [step, name, actionTileId]);
|
|
4673
|
+
const goBack = react.useCallback(() => {
|
|
4674
|
+
if (step > 1) goToStep(step - 1);
|
|
4675
|
+
}, [step, goToStep]);
|
|
4676
|
+
const cancelWithConfirm = react.useCallback(() => {
|
|
4677
|
+
if (touched && !window.confirm(labels.wizardCancelConfirm)) return;
|
|
4678
|
+
onCancel();
|
|
4679
|
+
}, [touched, labels.wizardCancelConfirm, onCancel]);
|
|
4680
|
+
function combineDateTime(date, time) {
|
|
4681
|
+
if (!date) return null;
|
|
4682
|
+
const next = new Date(date);
|
|
4683
|
+
next.setHours(time?.hours ?? 0, time?.minutes ?? 0, 0, 0);
|
|
4684
|
+
return next.toISOString();
|
|
4685
|
+
}
|
|
4686
|
+
const tags = react.useMemo(() => [...tagsSelected], [tagsSelected]);
|
|
4687
|
+
function buildPayload() {
|
|
4688
|
+
const validFrom = combineDateTime(validFromDate, validFromTime);
|
|
4689
|
+
const validUntil = noExpiry ? null : combineDateTime(validUntilDate, validUntilTime);
|
|
4690
|
+
const conditionWithCombinator = combinator === "and" ? condition : {
|
|
4691
|
+
operator: "boolean_expression",
|
|
4692
|
+
combinator,
|
|
4693
|
+
operands: [condition]
|
|
4694
|
+
};
|
|
4695
|
+
const finalAction = {
|
|
4696
|
+
type: action.type,
|
|
4697
|
+
params: {
|
|
4698
|
+
...action.params ?? {},
|
|
4699
|
+
actionVariant: actionTileId
|
|
4700
|
+
}
|
|
4701
|
+
};
|
|
4702
|
+
const recurrencePayload = recurrence === "cron" ? { kind: "cron", expression: cronExpression.trim() } : recurrence === "recurring" ? {
|
|
4703
|
+
kind: "recurring",
|
|
4704
|
+
weekdays: [...weekdays],
|
|
4705
|
+
timeOfDay: recurringTime ? `${pad(recurringTime.hours)}:${pad(recurringTime.minutes)}` : "00:00"
|
|
4706
|
+
} : { kind: "one-off" };
|
|
4707
|
+
return {
|
|
4708
|
+
name: name.trim() || "Untitled Rule",
|
|
4709
|
+
description: description.trim() || void 0,
|
|
4710
|
+
enabled,
|
|
4711
|
+
priority,
|
|
4712
|
+
// `paused` ships as-is — backend understands it natively (Fallback 2).
|
|
4713
|
+
status,
|
|
4714
|
+
validFrom,
|
|
4715
|
+
validUntil,
|
|
4716
|
+
tags,
|
|
4717
|
+
condition: conditionWithCombinator,
|
|
4718
|
+
action: finalAction,
|
|
4719
|
+
recurrence: recurrencePayload
|
|
4720
|
+
};
|
|
4721
|
+
}
|
|
4722
|
+
async function submit() {
|
|
4723
|
+
setSubmitting(true);
|
|
4724
|
+
try {
|
|
4725
|
+
await onSubmit(buildPayload());
|
|
4726
|
+
} finally {
|
|
4727
|
+
setSubmitting(false);
|
|
4728
|
+
}
|
|
4729
|
+
}
|
|
4730
|
+
react.useEffect(() => {
|
|
4731
|
+
function onKey(e) {
|
|
4732
|
+
if (e.key === "Escape") {
|
|
4733
|
+
e.preventDefault();
|
|
4734
|
+
cancelWithConfirm();
|
|
4735
|
+
return;
|
|
4736
|
+
}
|
|
4737
|
+
if (e.key === "Enter") {
|
|
4738
|
+
const target = e.target;
|
|
4739
|
+
const tag = target?.tagName?.toLowerCase();
|
|
4740
|
+
if (tag === "textarea" || tag === "select" || tag === "input" || tag === "button") return;
|
|
4741
|
+
e.preventDefault();
|
|
4742
|
+
if (step < TOTAL_STEPS3) goNext();
|
|
4743
|
+
else void submit();
|
|
4744
|
+
}
|
|
4745
|
+
}
|
|
4746
|
+
window.addEventListener("keydown", onKey);
|
|
4747
|
+
return () => window.removeEventListener("keydown", onKey);
|
|
4748
|
+
}, [step, name, actionTileId, touched]);
|
|
4749
|
+
const stepTitles = [
|
|
4750
|
+
labels.wizardStep1Title,
|
|
4751
|
+
labels.wizardStep2Title,
|
|
4752
|
+
labels.wizardStep3Title,
|
|
4753
|
+
labels.wizardStep4Title,
|
|
4754
|
+
labels.wizardStep5Title
|
|
4755
|
+
];
|
|
4756
|
+
const stepSubtitles = [
|
|
4757
|
+
labels.wizardStep1Subtitle,
|
|
4758
|
+
labels.wizardStep2Subtitle,
|
|
4759
|
+
labels.wizardStep3Subtitle,
|
|
4760
|
+
labels.wizardStep4Subtitle,
|
|
4761
|
+
labels.wizardStep5Subtitle
|
|
4762
|
+
];
|
|
4763
|
+
const indicatorSteps = stepTitles.map((title, idx) => ({
|
|
4764
|
+
id: String(idx + 1),
|
|
4765
|
+
title
|
|
4766
|
+
}));
|
|
4767
|
+
const counter = labels.wizardStepCounter.replace("{current}", String(step)).replace("{total}", String(TOTAL_STEPS3));
|
|
4768
|
+
const hero = /* @__PURE__ */ jsxRuntime.jsx(
|
|
4769
|
+
chunkZGVN23J4_js.HeroSection,
|
|
4770
|
+
{
|
|
4771
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(outline.AdjustmentsHorizontalIcon, { className: "h-5 w-5" }),
|
|
4772
|
+
label: counter,
|
|
4773
|
+
title: labels.pageTitle,
|
|
4774
|
+
subtitle: stepSubtitles[step - 1] ?? labels.pageSubtitle,
|
|
4775
|
+
gradient: "from-fuchsia-500 to-purple-700",
|
|
4776
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4777
|
+
chunkZGVN23J4_js.StepIndicator,
|
|
4778
|
+
{
|
|
4779
|
+
accent: "violet",
|
|
4780
|
+
currentStep: step - 1,
|
|
4781
|
+
onStepChange: (idx) => goToStep(idx + 1),
|
|
4782
|
+
progressLabel: labels.pageTitle,
|
|
4783
|
+
steps: indicatorSteps
|
|
4784
|
+
}
|
|
4785
|
+
)
|
|
4786
|
+
}
|
|
4787
|
+
);
|
|
4788
|
+
function renderStep1() {
|
|
4789
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4790
|
+
chunkZGVN23J4_js.SectionCard,
|
|
4791
|
+
{
|
|
4792
|
+
variant: "glass",
|
|
4793
|
+
header: {
|
|
4794
|
+
title: labels.wizardStep1Title,
|
|
4795
|
+
subtitle: labels.wizardStep1Subtitle
|
|
4796
|
+
},
|
|
4797
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
4798
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4799
|
+
chunkZGVN23J4_js.FormInput,
|
|
4800
|
+
{
|
|
4801
|
+
label: labels.nameLabel,
|
|
4802
|
+
value: name,
|
|
4803
|
+
onValueChange: (v) => {
|
|
4804
|
+
setName(v);
|
|
4805
|
+
markTouched();
|
|
4806
|
+
},
|
|
4807
|
+
placeholder: labels.namePlaceholder,
|
|
4808
|
+
required: true
|
|
4809
|
+
}
|
|
4810
|
+
),
|
|
4811
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4812
|
+
chunkZGVN23J4_js.FormTextarea,
|
|
4813
|
+
{
|
|
4814
|
+
label: labels.descriptionLabel,
|
|
4815
|
+
value: description,
|
|
4816
|
+
onValueChange: (v) => {
|
|
4817
|
+
setDescription(v);
|
|
4818
|
+
markTouched();
|
|
4819
|
+
},
|
|
4820
|
+
placeholder: labels.descriptionPlaceholder,
|
|
4821
|
+
rows: 3
|
|
4822
|
+
}
|
|
4823
|
+
),
|
|
4824
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4825
|
+
RangeSliderField2,
|
|
4826
|
+
{
|
|
4827
|
+
sliderId: "wizard-rule-priority",
|
|
4828
|
+
label: labels.priorityLabel,
|
|
4829
|
+
value: priority,
|
|
4830
|
+
onChange: (v) => {
|
|
4831
|
+
setPriority(Math.round(v));
|
|
4832
|
+
markTouched();
|
|
4833
|
+
},
|
|
4834
|
+
min: 0,
|
|
4835
|
+
max: 100,
|
|
4836
|
+
step: 1,
|
|
4837
|
+
trackGradient: "linear-gradient(90deg, #10b981, #38bdf8 33%, #f59e0b 66%, #f43f5e)",
|
|
4838
|
+
formatValue: (v) => String(Math.round(v)),
|
|
4839
|
+
zones: [
|
|
4840
|
+
{ label: labels.priorityLow, max: 25, color: "text-emerald-500", thumbColor: "#10b981" },
|
|
4841
|
+
{ label: labels.priorityNormal, max: 50, color: "text-sky-500", thumbColor: "#38bdf8" },
|
|
4842
|
+
{ label: labels.priorityHigh, max: 75, color: "text-amber-500", thumbColor: "#f59e0b" },
|
|
4843
|
+
{ label: labels.priorityCritical, max: 100, color: "text-rose-500", thumbColor: "#f43f5e" }
|
|
4844
|
+
]
|
|
4845
|
+
}
|
|
4846
|
+
),
|
|
4847
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4848
|
+
chunkZGVN23J4_js.FormToggle,
|
|
4849
|
+
{
|
|
4850
|
+
checked: enabled,
|
|
4851
|
+
onChange: (v) => {
|
|
4852
|
+
setEnabled(v);
|
|
4853
|
+
markTouched();
|
|
4854
|
+
},
|
|
4855
|
+
label: labels.enabledLabel,
|
|
4856
|
+
variant: "card"
|
|
4857
|
+
}
|
|
4858
|
+
)
|
|
4859
|
+
] })
|
|
4860
|
+
}
|
|
4861
|
+
);
|
|
4862
|
+
}
|
|
4863
|
+
function renderStep2() {
|
|
4864
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4865
|
+
chunkZGVN23J4_js.SectionCard,
|
|
4866
|
+
{
|
|
4867
|
+
variant: "glass",
|
|
4868
|
+
header: {
|
|
4869
|
+
title: labels.conditionSectionTitle,
|
|
4870
|
+
subtitle: labels.conditionSectionSubtitle
|
|
4871
|
+
},
|
|
4872
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
4873
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
4874
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.combinatorLabel }),
|
|
4875
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4876
|
+
chunkZGVN23J4_js.SegmentedControl,
|
|
4877
|
+
{
|
|
4878
|
+
segments: [
|
|
4879
|
+
{ value: "and", label: labels.combinatorAnd },
|
|
4880
|
+
{ value: "or", label: labels.combinatorOr },
|
|
4881
|
+
{ value: "not", label: labels.combinatorNot }
|
|
4882
|
+
],
|
|
4883
|
+
value: combinator,
|
|
4884
|
+
onChange: (v) => {
|
|
4885
|
+
setCombinator(v);
|
|
4886
|
+
markTouched();
|
|
4887
|
+
},
|
|
4888
|
+
size: "sm"
|
|
4889
|
+
}
|
|
4890
|
+
)
|
|
4891
|
+
] }),
|
|
4892
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4893
|
+
chunkH475T2N7_js.RuleConditionBuilder,
|
|
4894
|
+
{
|
|
4895
|
+
value: condition,
|
|
4896
|
+
onChange: (next) => {
|
|
4897
|
+
setCondition(next);
|
|
4898
|
+
markTouched();
|
|
4899
|
+
}
|
|
4900
|
+
}
|
|
4901
|
+
)
|
|
4902
|
+
] })
|
|
4903
|
+
}
|
|
4904
|
+
);
|
|
4905
|
+
}
|
|
4906
|
+
function renderStep3() {
|
|
4907
|
+
const selectedTile = ACTION_TILES.find((t) => t.id === actionTileId) ?? null;
|
|
4908
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4909
|
+
chunkZGVN23J4_js.SectionCard,
|
|
4910
|
+
{
|
|
4911
|
+
variant: "glass",
|
|
4912
|
+
header: {
|
|
4913
|
+
title: labels.actionSectionTitle,
|
|
4914
|
+
subtitle: labels.actionSectionSubtitle
|
|
4915
|
+
},
|
|
4916
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-5", children: [
|
|
4917
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4918
|
+
"div",
|
|
4919
|
+
{
|
|
4920
|
+
role: "radiogroup",
|
|
4921
|
+
"aria-label": labels.actionSectionTitle,
|
|
4922
|
+
className: "grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",
|
|
4923
|
+
children: ACTION_TILES.map((tile) => {
|
|
4924
|
+
const Icon = tile.icon;
|
|
4925
|
+
const selected = tile.id === actionTileId;
|
|
4926
|
+
const label = labels[tile.labelKey] ?? tile.id;
|
|
4927
|
+
const description2 = labels[tile.descriptionKey] ?? "";
|
|
4928
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4929
|
+
chunkZGVN23J4_js.FilterTileButton,
|
|
4930
|
+
{
|
|
4931
|
+
isActive: selected,
|
|
4932
|
+
color: tile.color,
|
|
4933
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "h-5 w-5" }),
|
|
4934
|
+
label,
|
|
4935
|
+
count: description2,
|
|
4936
|
+
onClick: () => {
|
|
4937
|
+
setActionTileId(tile.id);
|
|
4938
|
+
markTouched();
|
|
4939
|
+
}
|
|
4940
|
+
},
|
|
4941
|
+
tile.id
|
|
4942
|
+
);
|
|
4943
|
+
})
|
|
4944
|
+
}
|
|
4945
|
+
),
|
|
4946
|
+
selectedTile && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4947
|
+
chunkZGVN23J4_js.SectionCard,
|
|
4948
|
+
{
|
|
4949
|
+
variant: "glass",
|
|
4950
|
+
header: {
|
|
4951
|
+
title: labels[selectedTile.labelKey] ?? selectedTile.id,
|
|
4952
|
+
subtitle: labels.actionConfigSubtitle
|
|
4953
|
+
},
|
|
4954
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4955
|
+
chunkH475T2N7_js.RuleActionBuilder,
|
|
4956
|
+
{
|
|
4957
|
+
value: action,
|
|
4958
|
+
onChange: (next) => {
|
|
4959
|
+
setAction(next);
|
|
4960
|
+
markTouched();
|
|
4961
|
+
}
|
|
4962
|
+
}
|
|
4963
|
+
)
|
|
4964
|
+
}
|
|
4965
|
+
)
|
|
4966
|
+
] })
|
|
4967
|
+
}
|
|
4968
|
+
);
|
|
4969
|
+
}
|
|
4970
|
+
function renderStep4() {
|
|
4971
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4972
|
+
chunkZGVN23J4_js.SectionCard,
|
|
4973
|
+
{
|
|
4974
|
+
variant: "glass",
|
|
4975
|
+
header: {
|
|
4976
|
+
title: labels.scheduleSectionTitle,
|
|
4977
|
+
subtitle: labels.scheduleSectionSubtitle
|
|
4978
|
+
},
|
|
4979
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-5", children: [
|
|
4980
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkZGVN23J4_js.FormGrid, { children: [
|
|
4981
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
4982
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.validFromLabel }),
|
|
4983
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
4984
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4985
|
+
chunkZGVN23J4_js.DatePicker,
|
|
4986
|
+
{
|
|
4987
|
+
value: validFromDate,
|
|
4988
|
+
onChange: (d) => {
|
|
4989
|
+
setValidFromDate(d);
|
|
4990
|
+
markTouched();
|
|
4991
|
+
},
|
|
4992
|
+
placeholder: labels.validFromDateLabel
|
|
4993
|
+
}
|
|
4994
|
+
),
|
|
4995
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4996
|
+
chunkZGVN23J4_js.TimePicker,
|
|
4997
|
+
{
|
|
4998
|
+
value: validFromTime,
|
|
4999
|
+
onChange: (t) => {
|
|
5000
|
+
setValidFromTime(t);
|
|
5001
|
+
markTouched();
|
|
5002
|
+
},
|
|
5003
|
+
placeholder: labels.validFromTimeLabel
|
|
5004
|
+
}
|
|
5005
|
+
)
|
|
5006
|
+
] })
|
|
5007
|
+
] }),
|
|
5008
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
5009
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.validUntilLabel }),
|
|
5010
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
5011
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5012
|
+
chunkZGVN23J4_js.DatePicker,
|
|
5013
|
+
{
|
|
5014
|
+
value: validUntilDate,
|
|
5015
|
+
onChange: (d) => {
|
|
5016
|
+
setValidUntilDate(d);
|
|
5017
|
+
markTouched();
|
|
5018
|
+
},
|
|
5019
|
+
placeholder: labels.validUntilDateLabel
|
|
5020
|
+
}
|
|
5021
|
+
),
|
|
5022
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5023
|
+
chunkZGVN23J4_js.TimePicker,
|
|
5024
|
+
{
|
|
5025
|
+
value: validUntilTime,
|
|
5026
|
+
onChange: (t) => {
|
|
5027
|
+
setValidUntilTime(t);
|
|
5028
|
+
markTouched();
|
|
5029
|
+
},
|
|
5030
|
+
placeholder: labels.validUntilTimeLabel
|
|
5031
|
+
}
|
|
5032
|
+
)
|
|
5033
|
+
] })
|
|
5034
|
+
] })
|
|
5035
|
+
] }),
|
|
5036
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5037
|
+
chunkZGVN23J4_js.FormCheckbox,
|
|
5038
|
+
{
|
|
5039
|
+
checked: noExpiry,
|
|
5040
|
+
onChange: (v) => {
|
|
5041
|
+
setNoExpiry(v);
|
|
5042
|
+
markTouched();
|
|
5043
|
+
},
|
|
5044
|
+
label: labels.noExpiryLabel,
|
|
5045
|
+
description: labels.noExpiryDescription
|
|
5046
|
+
}
|
|
5047
|
+
),
|
|
5048
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
5049
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.statusLabel }),
|
|
5050
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5051
|
+
chunkZGVN23J4_js.SegmentedControl,
|
|
5052
|
+
{
|
|
5053
|
+
segments: [
|
|
5054
|
+
{ value: "active", label: labels.statusActive },
|
|
5055
|
+
{ value: "paused", label: labels.statusPaused },
|
|
5056
|
+
{ value: "archived", label: labels.statusArchived }
|
|
5057
|
+
],
|
|
5058
|
+
value: status,
|
|
5059
|
+
onChange: (v) => {
|
|
5060
|
+
setStatus(v);
|
|
5061
|
+
markTouched();
|
|
5062
|
+
},
|
|
5063
|
+
size: "sm"
|
|
5064
|
+
}
|
|
5065
|
+
)
|
|
5066
|
+
] }),
|
|
5067
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1", children: [
|
|
5068
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.tagsLabel }),
|
|
5069
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5070
|
+
chunkZGVN23J4_js.ChipPicker,
|
|
5071
|
+
{
|
|
5072
|
+
items: tagsItems,
|
|
5073
|
+
selectedIds: tagsSelected,
|
|
5074
|
+
onChange: (ids) => {
|
|
5075
|
+
setTagsSelected(ids);
|
|
5076
|
+
markTouched();
|
|
5077
|
+
},
|
|
5078
|
+
onItemsChange: (items) => {
|
|
5079
|
+
setTagsItems(items);
|
|
5080
|
+
markTouched();
|
|
5081
|
+
},
|
|
5082
|
+
allowCustom: true,
|
|
5083
|
+
unselectedStyle: tagsStyle,
|
|
5084
|
+
showActions: false,
|
|
5085
|
+
addPlaceholder: labels.tagsPlaceholder,
|
|
5086
|
+
addAriaLabel: labels.tagsLabel
|
|
5087
|
+
}
|
|
5088
|
+
),
|
|
5089
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: labels.tagsHint })
|
|
5090
|
+
] }),
|
|
5091
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
5092
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.recurrenceLabel }),
|
|
5093
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5094
|
+
chunkZGVN23J4_js.SegmentedControl,
|
|
5095
|
+
{
|
|
5096
|
+
segments: [
|
|
5097
|
+
{ value: "one-off", label: labels.recurrenceOneOff },
|
|
5098
|
+
{ value: "cron", label: labels.recurrenceCron },
|
|
5099
|
+
{ value: "recurring", label: labels.recurrenceRecurring }
|
|
5100
|
+
],
|
|
5101
|
+
value: recurrence,
|
|
5102
|
+
onChange: (v) => {
|
|
5103
|
+
setRecurrence(v);
|
|
5104
|
+
markTouched();
|
|
5105
|
+
},
|
|
5106
|
+
size: "sm"
|
|
5107
|
+
}
|
|
5108
|
+
)
|
|
5109
|
+
] }),
|
|
5110
|
+
recurrence === "cron" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5111
|
+
chunkZGVN23J4_js.FormInput,
|
|
5112
|
+
{
|
|
5113
|
+
label: labels.cronExpressionLabel,
|
|
5114
|
+
value: cronExpression,
|
|
5115
|
+
onValueChange: (v) => {
|
|
5116
|
+
setCronExpression(v);
|
|
5117
|
+
markTouched();
|
|
5118
|
+
},
|
|
5119
|
+
placeholder: labels.cronExpressionPlaceholder,
|
|
5120
|
+
hint: labels.cronExpressionHint
|
|
5121
|
+
}
|
|
5122
|
+
),
|
|
5123
|
+
recurrence === "recurring" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
|
|
5124
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
5125
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.weekdaysLabel }),
|
|
5126
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5127
|
+
chunkZGVN23J4_js.ChipPicker,
|
|
5128
|
+
{
|
|
5129
|
+
items: WEEKDAYS.map((d) => ({
|
|
5130
|
+
id: d.id,
|
|
5131
|
+
name: labels[d.labelKey] ?? d.id,
|
|
5132
|
+
style: {
|
|
5133
|
+
bg: "bg-fuchsia-500/15",
|
|
5134
|
+
text: "text-fuchsia-700 dark:text-fuchsia-300"
|
|
5135
|
+
}
|
|
5136
|
+
})),
|
|
5137
|
+
selectedIds: weekdays,
|
|
5138
|
+
onChange: (ids) => {
|
|
5139
|
+
setWeekdays(ids);
|
|
5140
|
+
markTouched();
|
|
5141
|
+
},
|
|
5142
|
+
showActions: false
|
|
5143
|
+
}
|
|
5144
|
+
)
|
|
5145
|
+
] }),
|
|
5146
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
5147
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "mb-2 block text-xs font-semibold uppercase tracking-wider text-slate-600 dark:text-slate-400", children: labels.timeOfDayLabel }),
|
|
5148
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5149
|
+
chunkZGVN23J4_js.TimePicker,
|
|
5150
|
+
{
|
|
5151
|
+
value: recurringTime,
|
|
5152
|
+
onChange: (t) => {
|
|
5153
|
+
setRecurringTime(t);
|
|
5154
|
+
markTouched();
|
|
5155
|
+
},
|
|
5156
|
+
placeholder: labels.timeOfDayLabel
|
|
5157
|
+
}
|
|
5158
|
+
)
|
|
5159
|
+
] })
|
|
5160
|
+
] })
|
|
5161
|
+
] })
|
|
5162
|
+
}
|
|
5163
|
+
) });
|
|
5164
|
+
}
|
|
5165
|
+
function renderStep5() {
|
|
5166
|
+
const payload = buildPayload();
|
|
5167
|
+
const conditionSentence = humanReadableCondition(payload.condition, labels);
|
|
5168
|
+
const actionSentence = humanReadableAction(payload.action, labels, ACTION_TILES, actionTileId);
|
|
5169
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
5170
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5171
|
+
chunkZGVN23J4_js.SectionCard,
|
|
5172
|
+
{
|
|
5173
|
+
variant: "glass",
|
|
5174
|
+
header: {
|
|
5175
|
+
title: labels.wizardStep1Title,
|
|
5176
|
+
subtitle: labels.wizardStep1Subtitle
|
|
5177
|
+
},
|
|
5178
|
+
actions: /* @__PURE__ */ jsxRuntime.jsxs(chunkBHOT22QL_js.Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(1), children: [
|
|
5179
|
+
/* @__PURE__ */ jsxRuntime.jsx(outline.PencilSquareIcon, { className: "h-4 w-4" }),
|
|
5180
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
5181
|
+
] }),
|
|
5182
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
|
|
5183
|
+
/* @__PURE__ */ jsxRuntime.jsx(ReviewRow3, { label: labels.reviewNameLabel, value: payload.name }),
|
|
5184
|
+
/* @__PURE__ */ jsxRuntime.jsx(ReviewRow3, { label: labels.reviewPriorityLabel, value: String(payload.priority) }),
|
|
5185
|
+
/* @__PURE__ */ jsxRuntime.jsx(ReviewRow3, { label: labels.reviewEnabledLabel, value: payload.enabled ? labels.reviewYes : labels.reviewNo }),
|
|
5186
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5187
|
+
ReviewRow3,
|
|
5188
|
+
{
|
|
5189
|
+
label: labels.reviewDescriptionLabel,
|
|
5190
|
+
value: payload.description ?? labels.reviewNoneValue
|
|
5191
|
+
}
|
|
5192
|
+
)
|
|
5193
|
+
] })
|
|
5194
|
+
}
|
|
5195
|
+
),
|
|
5196
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5197
|
+
chunkZGVN23J4_js.SectionCard,
|
|
5198
|
+
{
|
|
5199
|
+
variant: "glass",
|
|
5200
|
+
header: {
|
|
5201
|
+
title: labels.wizardStep2Title,
|
|
5202
|
+
subtitle: labels.wizardStep2Subtitle
|
|
5203
|
+
},
|
|
5204
|
+
actions: /* @__PURE__ */ jsxRuntime.jsxs(chunkBHOT22QL_js.Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(2), children: [
|
|
5205
|
+
/* @__PURE__ */ jsxRuntime.jsx(outline.PencilSquareIcon, { className: "h-4 w-4" }),
|
|
5206
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
5207
|
+
] }),
|
|
5208
|
+
children: [
|
|
5209
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-2 text-sm text-slate-700 dark:text-slate-200", children: conditionSentence }),
|
|
5210
|
+
/* @__PURE__ */ jsxRuntime.jsx(ReviewRow3, { label: labels.reviewCombinatorLabel, value: combinator.toUpperCase() }),
|
|
5211
|
+
/* @__PURE__ */ jsxRuntime.jsx("pre", { className: "mt-3 max-h-48 overflow-auto rounded-lg border border-slate-200/70 bg-slate-50/60 p-2 text-xs text-slate-700 dark:border-slate-700 dark:bg-slate-900/40 dark:text-slate-200", children: JSON.stringify(payload.condition, null, 2) })
|
|
5212
|
+
]
|
|
5213
|
+
}
|
|
5214
|
+
),
|
|
5215
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5216
|
+
chunkZGVN23J4_js.SectionCard,
|
|
5217
|
+
{
|
|
5218
|
+
variant: "glass",
|
|
5219
|
+
header: {
|
|
5220
|
+
title: labels.wizardStep3Title,
|
|
5221
|
+
subtitle: labels.wizardStep3Subtitle
|
|
5222
|
+
},
|
|
5223
|
+
actions: /* @__PURE__ */ jsxRuntime.jsxs(chunkBHOT22QL_js.Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(3), children: [
|
|
5224
|
+
/* @__PURE__ */ jsxRuntime.jsx(outline.PencilSquareIcon, { className: "h-4 w-4" }),
|
|
5225
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
5226
|
+
] }),
|
|
5227
|
+
children: [
|
|
5228
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-2 text-sm text-slate-700 dark:text-slate-200", children: actionSentence }),
|
|
5229
|
+
/* @__PURE__ */ jsxRuntime.jsx("pre", { className: "mt-3 max-h-48 overflow-auto rounded-lg border border-slate-200/70 bg-slate-50/60 p-2 text-xs text-slate-700 dark:border-slate-700 dark:bg-slate-900/40 dark:text-slate-200", children: JSON.stringify(payload.action, null, 2) })
|
|
5230
|
+
]
|
|
5231
|
+
}
|
|
5232
|
+
),
|
|
5233
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5234
|
+
chunkZGVN23J4_js.SectionCard,
|
|
5235
|
+
{
|
|
5236
|
+
variant: "glass",
|
|
5237
|
+
header: {
|
|
5238
|
+
title: labels.wizardStep4Title,
|
|
5239
|
+
subtitle: labels.wizardStep4Subtitle
|
|
5240
|
+
},
|
|
5241
|
+
actions: /* @__PURE__ */ jsxRuntime.jsxs(chunkBHOT22QL_js.Button, { type: "button", size: "sm", outline: true, onClick: () => goToStep(4), children: [
|
|
5242
|
+
/* @__PURE__ */ jsxRuntime.jsx(outline.PencilSquareIcon, { className: "h-4 w-4" }),
|
|
5243
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1.5", children: labels.wizardReviewEdit })
|
|
5244
|
+
] }),
|
|
5245
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("dl", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2", children: [
|
|
5246
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5247
|
+
ReviewRow3,
|
|
5248
|
+
{
|
|
5249
|
+
label: labels.reviewValidFromLabel,
|
|
5250
|
+
value: payload.validFrom ?? labels.reviewNoneValue
|
|
5251
|
+
}
|
|
5252
|
+
),
|
|
5253
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5254
|
+
ReviewRow3,
|
|
5255
|
+
{
|
|
5256
|
+
label: labels.reviewValidUntilLabel,
|
|
5257
|
+
value: payload.validUntil ?? (noExpiry ? labels.noExpiryLabel : labels.reviewNoneValue)
|
|
5258
|
+
}
|
|
5259
|
+
),
|
|
5260
|
+
/* @__PURE__ */ jsxRuntime.jsx(ReviewRow3, { label: labels.reviewStatusLabel, value: payload.status ?? "active" }),
|
|
5261
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5262
|
+
ReviewRow3,
|
|
5263
|
+
{
|
|
5264
|
+
label: labels.reviewTagsLabel,
|
|
5265
|
+
value: payload.tags && payload.tags.length > 0 ? payload.tags.join(", ") : labels.reviewNoneValue
|
|
5266
|
+
}
|
|
5267
|
+
),
|
|
5268
|
+
/* @__PURE__ */ jsxRuntime.jsx(ReviewRow3, { label: labels.reviewRecurrenceLabel, value: recurrence })
|
|
5269
|
+
] })
|
|
5270
|
+
}
|
|
5271
|
+
)
|
|
5272
|
+
] });
|
|
5273
|
+
}
|
|
5274
|
+
const stepBody = step === 1 ? renderStep1() : step === 2 ? renderStep2() : step === 3 ? renderStep3() : step === 4 ? renderStep4() : renderStep5();
|
|
5275
|
+
const advanceDisabled = !canAdvance(step);
|
|
5276
|
+
const footer = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2 border-t border-slate-200/60 pt-4 dark:border-white/10", children: [
|
|
5277
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsx(chunkBHOT22QL_js.Button, { type: "button", outline: true, onClick: goBack, disabled: step === 1 || submitting, children: labels.wizardBack }) }),
|
|
5278
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
5279
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkBHOT22QL_js.Button, { type: "button", outline: true, onClick: cancelWithConfirm, disabled: submitting, children: labels.wizardCancel }),
|
|
5280
|
+
step < TOTAL_STEPS3 ? /* @__PURE__ */ jsxRuntime.jsx(chunkBHOT22QL_js.Button, { type: "button", color: "fuchsia", onClick: goNext, disabled: advanceDisabled || submitting, children: labels.wizardNext }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
5281
|
+
chunkBHOT22QL_js.Button,
|
|
5282
|
+
{
|
|
5283
|
+
type: "button",
|
|
5284
|
+
color: "fuchsia",
|
|
5285
|
+
onClick: () => void submit(),
|
|
5286
|
+
disabled: submitting || !name.trim() || !actionTileId,
|
|
5287
|
+
children: submitting ? labels.wizardCreate + "\u2026" : labels.wizardCreate
|
|
5288
|
+
}
|
|
5289
|
+
)
|
|
5290
|
+
] })
|
|
5291
|
+
] });
|
|
5292
|
+
const content = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5293
|
+
"form",
|
|
5294
|
+
{
|
|
5295
|
+
onSubmit: (e) => {
|
|
5296
|
+
e.preventDefault();
|
|
5297
|
+
if (step < TOTAL_STEPS3) goNext();
|
|
5298
|
+
else void submit();
|
|
5299
|
+
},
|
|
5300
|
+
className: "space-y-4",
|
|
5301
|
+
children: [
|
|
5302
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "liquid-surface rounded-2xl p-5 sm:p-8", children: stepBody }),
|
|
5303
|
+
footer
|
|
5304
|
+
]
|
|
5305
|
+
}
|
|
5306
|
+
);
|
|
5307
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
5308
|
+
hero,
|
|
5309
|
+
content
|
|
5310
|
+
] });
|
|
5311
|
+
}
|
|
5312
|
+
function ReviewRow3({ label, value }) {
|
|
5313
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-lg border border-slate-200/60 bg-white/40 px-3 py-2 dark:border-white/10 dark:bg-white/[0.04]", children: [
|
|
5314
|
+
/* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-[10px] uppercase tracking-wider text-gray-400 dark:text-gray-500", children: label }),
|
|
5315
|
+
/* @__PURE__ */ jsxRuntime.jsx("dd", { className: "mt-0.5 whitespace-pre-wrap break-words text-xs font-semibold text-gray-900 dark:text-white", children: value })
|
|
5316
|
+
] });
|
|
5317
|
+
}
|
|
5318
|
+
function pad(n) {
|
|
5319
|
+
return String(n).padStart(2, "0");
|
|
5320
|
+
}
|
|
5321
|
+
function humanReadableCondition(cond, labels) {
|
|
5322
|
+
if (!cond) return labels.reviewNoneValue;
|
|
5323
|
+
if (cond.operator === "boolean_expression" && Array.isArray(cond.operands)) {
|
|
5324
|
+
const inner = cond.operands.map((o) => humanReadableCondition(o, labels)).join(` ${cond.combinator?.toUpperCase() ?? "AND"} `);
|
|
5325
|
+
return `(${inner})`;
|
|
5326
|
+
}
|
|
5327
|
+
const field = cond.field ?? "?";
|
|
5328
|
+
switch (cond.operator) {
|
|
5329
|
+
case "truthy":
|
|
5330
|
+
return `${field} is set`;
|
|
5331
|
+
case "eq":
|
|
5332
|
+
return `${field} = ${formatValue(cond.value)}`;
|
|
5333
|
+
case "neq":
|
|
5334
|
+
return `${field} \u2260 ${formatValue(cond.value)}`;
|
|
5335
|
+
case "gt":
|
|
5336
|
+
return `${field} > ${formatValue(cond.value)}`;
|
|
5337
|
+
case "gte":
|
|
5338
|
+
return `${field} \u2265 ${formatValue(cond.value)}`;
|
|
5339
|
+
case "lt":
|
|
5340
|
+
return `${field} < ${formatValue(cond.value)}`;
|
|
5341
|
+
case "lte":
|
|
5342
|
+
return `${field} \u2264 ${formatValue(cond.value)}`;
|
|
5343
|
+
case "contains":
|
|
5344
|
+
return `${field} contains "${formatValue(cond.value)}"`;
|
|
5345
|
+
case "regex_match":
|
|
5346
|
+
return `${field} matches /${cond.pattern ?? ""}/`;
|
|
5347
|
+
case "threshold":
|
|
5348
|
+
return `${field} ${cond.comparison ?? "gte"} ${formatValue(cond.value)}`;
|
|
5349
|
+
case "time_window":
|
|
5350
|
+
return `${field} within time-window(${(cond.windows ?? []).length})`;
|
|
5351
|
+
default:
|
|
5352
|
+
return `${cond.operator}(${field})`;
|
|
5353
|
+
}
|
|
5354
|
+
}
|
|
5355
|
+
function formatValue(v) {
|
|
5356
|
+
if (v === null || v === void 0) return "";
|
|
5357
|
+
return String(v);
|
|
5358
|
+
}
|
|
5359
|
+
function humanReadableAction(action, labels, tiles, actionTileId) {
|
|
5360
|
+
const tile = tiles.find((t) => t.id === actionTileId);
|
|
5361
|
+
const tileLabel = tile ? labels[tile.labelKey] ?? tile.id : action.type;
|
|
5362
|
+
const paramSummary = action.params ? Object.entries(action.params).slice(0, 3).map(([k, v]) => `${k}=${String(v)}`).join(", ") : "";
|
|
5363
|
+
return paramSummary ? `${tileLabel} \u2014 ${paramSummary}` : tileLabel;
|
|
5364
|
+
}
|
|
3619
5365
|
|
|
3620
5366
|
Object.defineProperty(exports, "RolesPageView", {
|
|
3621
5367
|
enumerable: true,
|
|
3622
|
-
get: function () { return
|
|
5368
|
+
get: function () { return chunkZ6FZQOTW_js.RolesPageView; }
|
|
3623
5369
|
});
|
|
3624
5370
|
Object.defineProperty(exports, "UsersPageView", {
|
|
3625
5371
|
enumerable: true,
|
|
3626
|
-
get: function () { return
|
|
5372
|
+
get: function () { return chunkZ6FZQOTW_js.UsersPageView; }
|
|
3627
5373
|
});
|
|
3628
5374
|
Object.defineProperty(exports, "DIALECT_CATEGORIES", {
|
|
3629
5375
|
enumerable: true,
|
|
3630
|
-
get: function () { return
|
|
5376
|
+
get: function () { return chunk62BD4WLW_js.DIALECT_CATEGORIES; }
|
|
3631
5377
|
});
|
|
3632
5378
|
Object.defineProperty(exports, "DatasourceFormModal", {
|
|
3633
5379
|
enumerable: true,
|
|
3634
|
-
get: function () { return
|
|
5380
|
+
get: function () { return chunk62BD4WLW_js.DatasourceFormModal; }
|
|
3635
5381
|
});
|
|
3636
5382
|
Object.defineProperty(exports, "DatasourceModal", {
|
|
3637
5383
|
enumerable: true,
|
|
3638
|
-
get: function () { return
|
|
5384
|
+
get: function () { return chunk62BD4WLW_js.DatasourceModal; }
|
|
3639
5385
|
});
|
|
3640
5386
|
Object.defineProperty(exports, "findCategory", {
|
|
3641
5387
|
enumerable: true,
|
|
3642
|
-
get: function () { return
|
|
5388
|
+
get: function () { return chunk62BD4WLW_js.findCategory; }
|
|
3643
5389
|
});
|
|
3644
5390
|
Object.defineProperty(exports, "findDialect", {
|
|
3645
5391
|
enumerable: true,
|
|
3646
|
-
get: function () { return
|
|
5392
|
+
get: function () { return chunk62BD4WLW_js.findDialect; }
|
|
3647
5393
|
});
|
|
3648
5394
|
exports.AgentNewWizardPageView = AgentNewWizardPageView;
|
|
3649
5395
|
exports.AgentsConfigPageView = AgentsConfigPageView;
|
|
@@ -3655,7 +5401,9 @@ exports.AgentsWorkspacePageView = AgentsWorkspacePageView;
|
|
|
3655
5401
|
exports.ConnectionsPageView = ConnectionsPageView;
|
|
3656
5402
|
exports.CredentialsPageView = CredentialsPageView;
|
|
3657
5403
|
exports.DashboardPageView = DashboardPageView;
|
|
5404
|
+
exports.DatasourceNewWizardPageView = DatasourceNewWizardPageView;
|
|
3658
5405
|
exports.DatasourcesPageView = DatasourcesPageView;
|
|
5406
|
+
exports.RuleNewWizardPageView = RuleNewWizardPageView;
|
|
3659
5407
|
exports.RulesPageView = RulesPageView;
|
|
3660
5408
|
exports.RunTimelinePageView = RunTimelinePageView;
|
|
3661
5409
|
exports.TOOL_TYPES = TOOL_TYPES;
|