@datatechsolutions/ui 2.11.61 → 2.11.63
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 +66 -3
- package/dist/astrlabe/contracts.d.ts +66 -3
- package/dist/astrlabe/index.js +180 -160
- package/dist/astrlabe/index.js.map +1 -1
- package/dist/astrlabe/index.mjs +36 -16
- package/dist/astrlabe/index.mjs.map +1 -1
- package/dist/astrlabe/workflow-canvas.js +4 -4
- package/dist/astrlabe/workflow-canvas.mjs +3 -3
- package/dist/{chunk-CC3SGQ2Q.mjs → chunk-BZX5WQOL.mjs} +591 -106
- package/dist/chunk-BZX5WQOL.mjs.map +1 -0
- package/dist/{chunk-GUKB6TLR.js → chunk-JMWGZRYA.js} +641 -156
- package/dist/chunk-JMWGZRYA.js.map +1 -0
- package/dist/{chunk-3BR5TG34.js → chunk-KTGWGJZ6.js} +861 -68
- package/dist/chunk-KTGWGJZ6.js.map +1 -0
- package/dist/{chunk-REZMAQKJ.mjs → chunk-T5SX6BD6.mjs} +853 -70
- package/dist/chunk-T5SX6BD6.mjs.map +1 -0
- package/dist/index.d.mts +67 -1
- package/dist/index.d.ts +67 -1
- package/dist/index.js +778 -738
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-3BR5TG34.js.map +0 -1
- package/dist/chunk-CC3SGQ2Q.mjs.map +0 -1
- package/dist/chunk-GUKB6TLR.js.map +0 -1
- package/dist/chunk-REZMAQKJ.mjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkKTGWGJZ6_js = require('./chunk-KTGWGJZ6.js');
|
|
5
5
|
var chunkYXN2K77G_js = require('./chunk-YXN2K77G.js');
|
|
6
6
|
var chunkP4YYEM4B_js = require('./chunk-P4YYEM4B.js');
|
|
7
7
|
var chunkC7BI5LQ6_js = require('./chunk-C7BI5LQ6.js');
|
|
@@ -1234,7 +1234,15 @@ function DatasourceNodeConfigForm({
|
|
|
1234
1234
|
const [selectedColumns, setSelectedColumns] = react.useState([...config.selectedColumns ?? []]);
|
|
1235
1235
|
const [outputVariable, setOutputVariable] = react.useState(config.outputVariable);
|
|
1236
1236
|
const [limit, setLimit] = react.useState(config.limit);
|
|
1237
|
-
const [
|
|
1237
|
+
const [filters, setFilters] = react.useState(() => {
|
|
1238
|
+
if (config.filters && config.filters.length > 0) return [...config.filters];
|
|
1239
|
+
const legacy = Object.entries(config.filterVariables ?? {}).filter(([variableName, column]) => variableName && column).map(([variableName, column]) => ({
|
|
1240
|
+
column,
|
|
1241
|
+
op: "eq",
|
|
1242
|
+
value: `{{ inputs.${variableName} }}`
|
|
1243
|
+
}));
|
|
1244
|
+
return legacy;
|
|
1245
|
+
});
|
|
1238
1246
|
const [tableSearch, setTableSearch] = react.useState("");
|
|
1239
1247
|
const [columnSearch, setColumnSearch] = react.useState("");
|
|
1240
1248
|
const allColumnNames = availableColumns.map((column) => column.name);
|
|
@@ -1276,7 +1284,7 @@ function DatasourceNodeConfigForm({
|
|
|
1276
1284
|
setAvailableTables([]);
|
|
1277
1285
|
setAvailableColumns([]);
|
|
1278
1286
|
setSelectedColumns([]);
|
|
1279
|
-
|
|
1287
|
+
setFilters([]);
|
|
1280
1288
|
setTableSearch("");
|
|
1281
1289
|
setColumnSearch("");
|
|
1282
1290
|
};
|
|
@@ -1284,7 +1292,7 @@ function DatasourceNodeConfigForm({
|
|
|
1284
1292
|
setSelectedTable(table);
|
|
1285
1293
|
setAvailableColumns([]);
|
|
1286
1294
|
setSelectedColumns([]);
|
|
1287
|
-
|
|
1295
|
+
setFilters([]);
|
|
1288
1296
|
setColumnSearch("");
|
|
1289
1297
|
};
|
|
1290
1298
|
const handleToggleColumn = (columnName) => {
|
|
@@ -1293,32 +1301,46 @@ function DatasourceNodeConfigForm({
|
|
|
1293
1301
|
);
|
|
1294
1302
|
};
|
|
1295
1303
|
const handleAddFilter = () => {
|
|
1296
|
-
|
|
1304
|
+
setFilters((previous) => [...previous, { column: "", op: "eq", value: "" }]);
|
|
1297
1305
|
};
|
|
1298
|
-
const
|
|
1299
|
-
|
|
1300
|
-
const updated = { ...previous };
|
|
1301
|
-
const value = updated[oldKey] ?? "";
|
|
1302
|
-
delete updated[oldKey];
|
|
1303
|
-
updated[newKey] = value;
|
|
1304
|
-
return updated;
|
|
1305
|
-
});
|
|
1306
|
+
const handleUpdateFilterColumn = (index, nextColumn) => {
|
|
1307
|
+
setFilters((previous) => previous.map((row, i) => i === index ? { ...row, column: nextColumn } : row));
|
|
1306
1308
|
};
|
|
1307
|
-
const
|
|
1308
|
-
|
|
1309
|
+
const handleUpdateFilterOp = (index, nextOp) => {
|
|
1310
|
+
setFilters((previous) => previous.map((row, i) => {
|
|
1311
|
+
if (i !== index) return row;
|
|
1312
|
+
if (nextOp === "in") {
|
|
1313
|
+
const arr = Array.isArray(row.value) ? row.value : row.value == null || row.value === "" ? [] : [row.value];
|
|
1314
|
+
return { ...row, op: nextOp, value: arr };
|
|
1315
|
+
}
|
|
1316
|
+
if (Array.isArray(row.value)) {
|
|
1317
|
+
return { ...row, op: nextOp, value: row.value[0] ?? "" };
|
|
1318
|
+
}
|
|
1319
|
+
return { ...row, op: nextOp };
|
|
1320
|
+
}));
|
|
1309
1321
|
};
|
|
1310
|
-
const
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1322
|
+
const handleUpdateFilterValue = (index, nextValue) => {
|
|
1323
|
+
setFilters((previous) => previous.map((row, i) => {
|
|
1324
|
+
if (i !== index) return row;
|
|
1325
|
+
if (row.op === "in") {
|
|
1326
|
+
const arr = nextValue.split(",").map((s) => s.trim()).filter((s) => s.length > 0);
|
|
1327
|
+
return { ...row, value: arr };
|
|
1328
|
+
}
|
|
1329
|
+
return { ...row, value: nextValue };
|
|
1330
|
+
}));
|
|
1331
|
+
};
|
|
1332
|
+
const handleRemoveFilter = (index) => {
|
|
1333
|
+
setFilters((previous) => previous.filter((_, i) => i !== index));
|
|
1316
1334
|
};
|
|
1317
1335
|
const handleSave = () => {
|
|
1318
|
-
const
|
|
1319
|
-
|
|
1320
|
-
if (
|
|
1321
|
-
|
|
1336
|
+
const cleaned = filters.filter((row) => row.column.trim()).map((row) => {
|
|
1337
|
+
const op = row.op ?? "eq";
|
|
1338
|
+
if (op === "in") {
|
|
1339
|
+
const arr = Array.isArray(row.value) ? row.value : [];
|
|
1340
|
+
return { column: row.column.trim(), op, value: arr };
|
|
1341
|
+
}
|
|
1342
|
+
return { column: row.column.trim(), op, value: row.value ?? "" };
|
|
1343
|
+
});
|
|
1322
1344
|
onSave({
|
|
1323
1345
|
...config,
|
|
1324
1346
|
datasourceId: selectedDatasourceId,
|
|
@@ -1327,10 +1349,13 @@ function DatasourceNodeConfigForm({
|
|
|
1327
1349
|
selectedColumns,
|
|
1328
1350
|
outputVariable: outputVariable.trim(),
|
|
1329
1351
|
limit,
|
|
1330
|
-
|
|
1352
|
+
filters: cleaned,
|
|
1353
|
+
// Clear the legacy field so the engine's back-compat path doesn't
|
|
1354
|
+
// double-apply filters after a round-trip through this form.
|
|
1355
|
+
filterVariables: void 0
|
|
1331
1356
|
});
|
|
1332
1357
|
};
|
|
1333
|
-
const filterEntries =
|
|
1358
|
+
const filterEntries = filters;
|
|
1334
1359
|
const canSave = selectedDatasourceId && selectedTable && selectedColumns.length > 0;
|
|
1335
1360
|
function renderSection() {
|
|
1336
1361
|
switch (activeSectionId) {
|
|
@@ -1504,42 +1529,65 @@ function DatasourceNodeConfigForm({
|
|
|
1504
1529
|
]
|
|
1505
1530
|
}
|
|
1506
1531
|
)
|
|
1507
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: filterEntries.map((
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1532
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: filterEntries.map((row, index) => {
|
|
1533
|
+
const currentOp = row.op ?? "eq";
|
|
1534
|
+
const valueDisplay = Array.isArray(row.value) ? row.value.map(String).join(", ") : row.value == null ? "" : String(row.value);
|
|
1535
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 rounded-xl border border-gray-200 bg-white px-3 py-2 dark:border-white/10 dark:bg-white/[0.03]", children: [
|
|
1536
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1537
|
+
"select",
|
|
1538
|
+
{
|
|
1539
|
+
value: row.column,
|
|
1540
|
+
onChange: (event) => handleUpdateFilterColumn(index, event.target.value),
|
|
1541
|
+
disabled: readOnly,
|
|
1542
|
+
className: "w-[28%] rounded bg-transparent text-xs text-gray-900 outline-none disabled:opacity-60 dark:text-white",
|
|
1543
|
+
children: [
|
|
1544
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: t("columnName") }),
|
|
1545
|
+
availableColumns.map((column) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: column.name, children: column.name }, column.name))
|
|
1546
|
+
]
|
|
1547
|
+
}
|
|
1548
|
+
),
|
|
1549
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1550
|
+
"select",
|
|
1551
|
+
{
|
|
1552
|
+
value: currentOp,
|
|
1553
|
+
onChange: (event) => handleUpdateFilterOp(index, event.target.value),
|
|
1554
|
+
disabled: readOnly,
|
|
1555
|
+
className: "w-[18%] rounded bg-gray-50 px-1 text-center text-[10px] font-semibold uppercase text-gray-700 outline-none disabled:opacity-60 dark:bg-white/[0.05] dark:text-gray-200",
|
|
1556
|
+
title: t("filterOperator", { _: "Filter operator" }),
|
|
1557
|
+
children: [
|
|
1558
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "eq", children: "= (eq)" }),
|
|
1559
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "neq", children: "\u2260 (neq)" }),
|
|
1560
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "lt", children: "< (lt)" }),
|
|
1561
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "lte", children: "\u2264 (lte)" }),
|
|
1562
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "gt", children: "> (gt)" }),
|
|
1563
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "gte", children: "\u2265 (gte)" }),
|
|
1564
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "like", children: "LIKE" }),
|
|
1565
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "in", children: "IN (\u2026)" })
|
|
1566
|
+
]
|
|
1567
|
+
}
|
|
1568
|
+
),
|
|
1569
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1570
|
+
"input",
|
|
1571
|
+
{
|
|
1572
|
+
type: "text",
|
|
1573
|
+
value: valueDisplay,
|
|
1574
|
+
onChange: (event) => handleUpdateFilterValue(index, event.target.value),
|
|
1575
|
+
placeholder: currentOp === "in" ? "comma-separated, e.g. SP, RJ, MG" : t("variableReference"),
|
|
1576
|
+
readOnly,
|
|
1577
|
+
className: "flex-1 bg-transparent text-xs text-gray-900 outline-none placeholder:text-gray-400 dark:text-white dark:placeholder:text-gray-500"
|
|
1578
|
+
}
|
|
1579
|
+
),
|
|
1580
|
+
!readOnly && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1581
|
+
"button",
|
|
1582
|
+
{
|
|
1583
|
+
type: "button",
|
|
1584
|
+
onClick: () => handleRemoveFilter(index),
|
|
1585
|
+
className: "shrink-0 rounded-md p-1 text-gray-400 transition-colors hover:bg-red-50 hover:text-red-500 dark:hover:bg-red-900/20",
|
|
1586
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(outline.XMarkIcon, { className: "h-3 w-3" })
|
|
1587
|
+
}
|
|
1588
|
+
)
|
|
1589
|
+
] }, index);
|
|
1590
|
+
}) })
|
|
1543
1591
|
] });
|
|
1544
1592
|
case "output":
|
|
1545
1593
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-5", children: [
|
|
@@ -1624,7 +1672,7 @@ function DatasourceNodeConfigForm({
|
|
|
1624
1672
|
}
|
|
1625
1673
|
const logo = getDatasourceLogo(selectedDatasourceId, selectedDatasource?.dialect);
|
|
1626
1674
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1627
|
-
|
|
1675
|
+
chunkKTGWGJZ6_js.GlassModal,
|
|
1628
1676
|
{
|
|
1629
1677
|
open,
|
|
1630
1678
|
onClose: onCancel,
|
|
@@ -1639,8 +1687,8 @@ function DatasourceNodeConfigForm({
|
|
|
1639
1687
|
onSectionChange: setActiveSectionId
|
|
1640
1688
|
},
|
|
1641
1689
|
footer: readOnly ? void 0 : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2 px-6 py-3", children: [
|
|
1642
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1643
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1690
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkKTGWGJZ6_js.Button, { outline: true, onClick: onCancel, children: t("cancel") }),
|
|
1691
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkKTGWGJZ6_js.Button, { color: "cyan", onClick: handleSave, disabled: !canSave, children: t("save") })
|
|
1644
1692
|
] }),
|
|
1645
1693
|
children: renderSection()
|
|
1646
1694
|
}
|
|
@@ -2147,7 +2195,7 @@ var AgentToolFlowNode = react.memo(function AgentToolFlowNode2({ id, data, selec
|
|
|
2147
2195
|
event.stopPropagation();
|
|
2148
2196
|
},
|
|
2149
2197
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2150
|
-
|
|
2198
|
+
chunkKTGWGJZ6_js.ToggleSwitch,
|
|
2151
2199
|
{
|
|
2152
2200
|
checked: Boolean(agentTool.enabled),
|
|
2153
2201
|
onChange: () => data.onToggle?.(agentTool),
|
|
@@ -2255,7 +2303,7 @@ var ToolFlowNode = react.memo(function ToolFlowNode2({ id, data, selected }) {
|
|
|
2255
2303
|
event.preventDefault();
|
|
2256
2304
|
},
|
|
2257
2305
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2258
|
-
|
|
2306
|
+
chunkKTGWGJZ6_js.ToggleSwitch,
|
|
2259
2307
|
{
|
|
2260
2308
|
checked: Boolean(tool.enabled),
|
|
2261
2309
|
onChange: () => onToggle(tool),
|
|
@@ -2407,7 +2455,7 @@ var RuleFlowNode = react.memo(function RuleFlowNode2({ id, data, selected }) {
|
|
|
2407
2455
|
event.preventDefault();
|
|
2408
2456
|
},
|
|
2409
2457
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2410
|
-
|
|
2458
|
+
chunkKTGWGJZ6_js.ToggleSwitch,
|
|
2411
2459
|
{
|
|
2412
2460
|
checked: Boolean(rule.enabled),
|
|
2413
2461
|
onChange: () => onToggle(rule),
|
|
@@ -2675,7 +2723,9 @@ var CodeFlowNode = react.memo(function CodeFlowNode2({ id, data, selected }) {
|
|
|
2675
2723
|
const t = chunkYXN2K77G_js.useTranslations("agents.workflow");
|
|
2676
2724
|
const { config, label, onDelete, onEdit } = data;
|
|
2677
2725
|
const isCompact = data.displayMode === "compact";
|
|
2678
|
-
const
|
|
2726
|
+
const isScripted = "language" in config;
|
|
2727
|
+
const badgeLabel = isScripted ? config.language : config.operation;
|
|
2728
|
+
const codePreview = isScripted && config.code ? config.code.slice(0, 30) : "";
|
|
2679
2729
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2680
2730
|
/* @__PURE__ */ jsxRuntime.jsx(NodeRunningIndicator, { nodeId: id }),
|
|
2681
2731
|
/* @__PURE__ */ jsxRuntime.jsx(WorkflowHandle, { type: "target", position: react$1.Position.Left, id: "left-in", colorClass: "!bg-cyan-500" }),
|
|
@@ -2701,7 +2751,7 @@ var CodeFlowNode = react.memo(function CodeFlowNode2({ id, data, selected }) {
|
|
|
2701
2751
|
/* @__PURE__ */ jsxRuntime.jsxs(NodeCardMeta, { compact: isCompact, children: [
|
|
2702
2752
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2703
2753
|
/* @__PURE__ */ jsxRuntime.jsx(NodeCardBadge, { tone: "code", children: t("codeNode") }),
|
|
2704
|
-
/* @__PURE__ */ jsxRuntime.jsx(NodeCardBadge, { tone: "code", soft: true, children:
|
|
2754
|
+
/* @__PURE__ */ jsxRuntime.jsx(NodeCardBadge, { tone: "code", soft: true, children: badgeLabel }),
|
|
2705
2755
|
codePreview && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "truncate text-[10px] text-gray-400 dark:text-gray-500", children: [
|
|
2706
2756
|
codePreview,
|
|
2707
2757
|
"..."
|
|
@@ -3405,7 +3455,7 @@ var DatasourceFlowNode = react.memo(function DatasourceFlowNode2({ id, data, sel
|
|
|
3405
3455
|
event.preventDefault();
|
|
3406
3456
|
},
|
|
3407
3457
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3408
|
-
|
|
3458
|
+
chunkKTGWGJZ6_js.ToggleSwitch,
|
|
3409
3459
|
{
|
|
3410
3460
|
checked: true,
|
|
3411
3461
|
onChange: () => {
|
|
@@ -3733,8 +3783,8 @@ function ConfigFormActions({
|
|
|
3733
3783
|
saveDisabled = false
|
|
3734
3784
|
}) {
|
|
3735
3785
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2 border-t border-gray-200 pt-4 dark:border-gray-700", children: [
|
|
3736
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3737
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3786
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkKTGWGJZ6_js.Button, { type: "button", outline: true, onClick: onCancel, children: cancelLabel }),
|
|
3787
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkKTGWGJZ6_js.Button, { type: "button", onClick: onSave, disabled: saveDisabled, children: saveLabel })
|
|
3738
3788
|
] });
|
|
3739
3789
|
}
|
|
3740
3790
|
var COLOR_CLASSES = {
|
|
@@ -3981,7 +4031,7 @@ function IfElseNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
3981
4031
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-3 flex items-center justify-between", children: [
|
|
3982
4032
|
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: t("conditionsLabel") }),
|
|
3983
4033
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3984
|
-
|
|
4034
|
+
chunkKTGWGJZ6_js.Button,
|
|
3985
4035
|
{
|
|
3986
4036
|
type: "button",
|
|
3987
4037
|
onClick: handleAddCondition,
|
|
@@ -3992,7 +4042,7 @@ function IfElseNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
3992
4042
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: conditions.map((condition, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-2 rounded-lg border border-gray-200 bg-gray-50 p-3 dark:border-gray-700 dark:bg-gray-800/50", children: [
|
|
3993
4043
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid flex-1 grid-cols-3 gap-2", children: [
|
|
3994
4044
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3995
|
-
|
|
4045
|
+
chunkKTGWGJZ6_js.FormInput,
|
|
3996
4046
|
{
|
|
3997
4047
|
type: "text",
|
|
3998
4048
|
label: t("variableLabel"),
|
|
@@ -4003,7 +4053,7 @@ function IfElseNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
4003
4053
|
}
|
|
4004
4054
|
) }),
|
|
4005
4055
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4006
|
-
|
|
4056
|
+
chunkKTGWGJZ6_js.FormSelect,
|
|
4007
4057
|
{
|
|
4008
4058
|
label: t("operatorLabel"),
|
|
4009
4059
|
value: condition.operator,
|
|
@@ -4013,7 +4063,7 @@ function IfElseNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
4013
4063
|
}
|
|
4014
4064
|
) }),
|
|
4015
4065
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4016
|
-
|
|
4066
|
+
chunkKTGWGJZ6_js.FormInput,
|
|
4017
4067
|
{
|
|
4018
4068
|
type: "text",
|
|
4019
4069
|
label: t("valueLabel"),
|
|
@@ -4025,7 +4075,7 @@ function IfElseNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
4025
4075
|
) })
|
|
4026
4076
|
] }),
|
|
4027
4077
|
conditions.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4028
|
-
|
|
4078
|
+
chunkKTGWGJZ6_js.IconButton,
|
|
4029
4079
|
{
|
|
4030
4080
|
onClick: () => handleRemoveCondition(index),
|
|
4031
4081
|
icon: /* @__PURE__ */ jsxRuntime.jsx(outline.TrashIcon, { className: "h-4 w-4" }),
|
|
@@ -4082,59 +4132,274 @@ function IfElseNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
4082
4132
|
] });
|
|
4083
4133
|
}
|
|
4084
4134
|
var LANGUAGE_OPTIONS = ["javascript", "python", "typescript"];
|
|
4135
|
+
var OPERATION_OPTIONS = [
|
|
4136
|
+
{ value: "passthrough", label: "passthrough", help: "Emit the incoming value unchanged." },
|
|
4137
|
+
{ value: "return", label: "return", help: "Emit a literal JSON value." },
|
|
4138
|
+
{ value: "merge", label: "merge", help: "Shallow-merge incoming + a literal object." },
|
|
4139
|
+
{ value: "pick", label: "pick", help: "Project specific keys off the incoming object." },
|
|
4140
|
+
{ value: "parse_json", label: "parse_json", help: "Parse a stringified JSON out of an upstream field (e.g. an agent's `.text`)." },
|
|
4141
|
+
{ value: "regex_extract", label: "regex_extract", help: "Run a regex over `from`, return the capture group." },
|
|
4142
|
+
{ value: "xml_titles", label: "xml_titles", help: "Extract every `<title>` from an RSS/Atom body." }
|
|
4143
|
+
];
|
|
4144
|
+
function hasLanguage(config) {
|
|
4145
|
+
return "language" in config && typeof config.language === "string";
|
|
4146
|
+
}
|
|
4147
|
+
function hasOperation(config) {
|
|
4148
|
+
return "operation" in config && typeof config.operation === "string";
|
|
4149
|
+
}
|
|
4085
4150
|
function CodeNodeConfigForm({ config, onSave, onCancel }) {
|
|
4086
4151
|
const t = chunkYXN2K77G_js.useTranslations("agents.workflow.codeNodeConfig");
|
|
4087
|
-
const
|
|
4088
|
-
const [
|
|
4152
|
+
const initialMode = hasOperation(config) ? "operation" : "scripted";
|
|
4153
|
+
const [mode, setMode] = react.useState(initialMode);
|
|
4154
|
+
const [language, setLanguage] = react.useState(
|
|
4155
|
+
hasLanguage(config) ? config.language : "javascript"
|
|
4156
|
+
);
|
|
4157
|
+
const [code, setCode] = react.useState(hasLanguage(config) ? config.code : "");
|
|
4158
|
+
const op0 = hasOperation(config) ? config : void 0;
|
|
4159
|
+
const [operation, setOperation] = react.useState(op0?.operation ?? "passthrough");
|
|
4160
|
+
const [from, setFrom] = react.useState(op0?.from ?? "");
|
|
4161
|
+
const [valueText, setValueText] = react.useState(
|
|
4162
|
+
op0?.value !== void 0 ? JSON.stringify(op0.value, null, 2) : ""
|
|
4163
|
+
);
|
|
4164
|
+
const [fieldsText, setFieldsText] = react.useState((op0?.fields ?? []).join(", "));
|
|
4165
|
+
const [pattern, setPattern] = react.useState(op0?.pattern ?? "");
|
|
4166
|
+
const [flags, setFlags] = react.useState(op0?.flags ?? "");
|
|
4167
|
+
const [group, setGroup] = react.useState(op0?.group ?? 1);
|
|
4168
|
+
const [output, setOutput] = react.useState(op0?.output ?? "");
|
|
4169
|
+
const [keepChannel, setKeepChannel] = react.useState(op0?.keepChannel ?? false);
|
|
4170
|
+
const selectedOpHelp = react.useMemo(
|
|
4171
|
+
() => OPERATION_OPTIONS.find((o) => o.value === operation)?.help ?? "",
|
|
4172
|
+
[operation]
|
|
4173
|
+
);
|
|
4089
4174
|
const handleSave = () => {
|
|
4090
|
-
|
|
4175
|
+
if (mode === "scripted") {
|
|
4176
|
+
onSave({ type: "code", language, code });
|
|
4177
|
+
return;
|
|
4178
|
+
}
|
|
4179
|
+
const next = { type: "code", operation };
|
|
4180
|
+
if (from.trim()) next.from = from.trim();
|
|
4181
|
+
if (operation === "return" && valueText.trim()) {
|
|
4182
|
+
try {
|
|
4183
|
+
next.value = JSON.parse(valueText);
|
|
4184
|
+
} catch {
|
|
4185
|
+
next.value = valueText;
|
|
4186
|
+
}
|
|
4187
|
+
}
|
|
4188
|
+
if (operation === "merge" && valueText.trim()) {
|
|
4189
|
+
try {
|
|
4190
|
+
next.value = JSON.parse(valueText);
|
|
4191
|
+
} catch {
|
|
4192
|
+
next.value = valueText;
|
|
4193
|
+
}
|
|
4194
|
+
}
|
|
4195
|
+
if (operation === "pick") {
|
|
4196
|
+
next.fields = fieldsText.split(",").map((s) => s.trim()).filter(Boolean);
|
|
4197
|
+
}
|
|
4198
|
+
if (operation === "regex_extract") {
|
|
4199
|
+
next.pattern = pattern;
|
|
4200
|
+
if (flags.trim()) next.flags = flags.trim();
|
|
4201
|
+
if (group !== 1) next.group = group;
|
|
4202
|
+
}
|
|
4203
|
+
if (operation === "xml_titles" && keepChannel) next.keepChannel = true;
|
|
4204
|
+
if ((operation === "regex_extract" || operation === "xml_titles") && output.trim()) {
|
|
4205
|
+
next.output = output.trim();
|
|
4206
|
+
}
|
|
4207
|
+
onSave(next);
|
|
4091
4208
|
};
|
|
4209
|
+
const labelClass = "mb-1 block text-xs font-medium text-gray-700 dark:text-gray-300";
|
|
4210
|
+
const inputClass = "w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 placeholder-gray-400 outline-none focus:border-indigo-400 focus:ring-2 focus:ring-indigo-400/20 dark:border-gray-600 dark:bg-gray-800 dark:text-white dark:placeholder-gray-500";
|
|
4211
|
+
const textareaClass = `${inputClass} font-mono text-xs`;
|
|
4092
4212
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
4093
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
4094
|
-
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300", children: t("languageLabel") }),
|
|
4095
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4096
|
-
"select",
|
|
4097
|
-
{
|
|
4098
|
-
value: language,
|
|
4099
|
-
onChange: (event) => setLanguage(event.target.value),
|
|
4100
|
-
className: "w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 placeholder-gray-400 outline-none focus:border-indigo-400 focus:ring-2 focus:ring-indigo-400/20 dark:border-gray-600 dark:bg-gray-800 dark:text-white dark:placeholder-gray-500",
|
|
4101
|
-
children: LANGUAGE_OPTIONS.map((option) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: option, children: option }, option))
|
|
4102
|
-
}
|
|
4103
|
-
)
|
|
4104
|
-
] }),
|
|
4105
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
4106
|
-
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300", children: t("codeLabel") }),
|
|
4107
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4108
|
-
"textarea",
|
|
4109
|
-
{
|
|
4110
|
-
value: code,
|
|
4111
|
-
onChange: (event) => setCode(event.target.value),
|
|
4112
|
-
placeholder: t("codePlaceholder"),
|
|
4113
|
-
rows: 10,
|
|
4114
|
-
className: "w-full rounded-lg border border-gray-300 bg-white px-3 py-2 font-mono text-xs text-gray-900 placeholder-gray-400 outline-none focus:border-indigo-400 focus:ring-2 focus:ring-indigo-400/20 dark:border-gray-600 dark:bg-gray-800 dark:text-white dark:placeholder-gray-500"
|
|
4115
|
-
}
|
|
4116
|
-
)
|
|
4117
|
-
] }),
|
|
4118
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2 pt-4 border-t border-gray-200 dark:border-gray-700", children: [
|
|
4213
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2 rounded-lg bg-gray-100 p-1 text-sm dark:bg-gray-800", children: [
|
|
4119
4214
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4120
4215
|
"button",
|
|
4121
4216
|
{
|
|
4122
4217
|
type: "button",
|
|
4123
|
-
onClick:
|
|
4124
|
-
className:
|
|
4125
|
-
children: t("
|
|
4218
|
+
onClick: () => setMode("operation"),
|
|
4219
|
+
className: `flex-1 rounded-md px-3 py-1.5 font-medium transition ${mode === "operation" ? "bg-white text-indigo-600 shadow-sm dark:bg-gray-900 dark:text-indigo-400" : "text-gray-600 dark:text-gray-400"}`,
|
|
4220
|
+
children: t("modeOperation", { _: "Operation" })
|
|
4126
4221
|
}
|
|
4127
4222
|
),
|
|
4128
4223
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4129
4224
|
"button",
|
|
4130
4225
|
{
|
|
4131
4226
|
type: "button",
|
|
4132
|
-
onClick:
|
|
4133
|
-
className:
|
|
4134
|
-
children: t("
|
|
4227
|
+
onClick: () => setMode("scripted"),
|
|
4228
|
+
className: `flex-1 rounded-md px-3 py-1.5 font-medium transition ${mode === "scripted" ? "bg-white text-indigo-600 shadow-sm dark:bg-gray-900 dark:text-indigo-400" : "text-gray-600 dark:text-gray-400"}`,
|
|
4229
|
+
children: t("modeScripted", { _: "Scripted" })
|
|
4135
4230
|
}
|
|
4136
4231
|
)
|
|
4137
|
-
] })
|
|
4232
|
+
] }),
|
|
4233
|
+
mode === "scripted" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4234
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
4235
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: labelClass, children: t("languageLabel") }),
|
|
4236
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4237
|
+
"select",
|
|
4238
|
+
{
|
|
4239
|
+
value: language,
|
|
4240
|
+
onChange: (event) => setLanguage(event.target.value),
|
|
4241
|
+
className: inputClass,
|
|
4242
|
+
children: LANGUAGE_OPTIONS.map((option) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: option, children: option }, option))
|
|
4243
|
+
}
|
|
4244
|
+
),
|
|
4245
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-[11px] text-amber-600 dark:text-amber-400", children: "The engine has no embedded script runtime \u2014 scripted nodes fail at execution today. Prefer the Operation mode for real graphs." })
|
|
4246
|
+
] }),
|
|
4247
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
4248
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: labelClass, children: t("codeLabel") }),
|
|
4249
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4250
|
+
"textarea",
|
|
4251
|
+
{
|
|
4252
|
+
value: code,
|
|
4253
|
+
onChange: (event) => setCode(event.target.value),
|
|
4254
|
+
placeholder: t("codePlaceholder"),
|
|
4255
|
+
rows: 10,
|
|
4256
|
+
className: textareaClass
|
|
4257
|
+
}
|
|
4258
|
+
)
|
|
4259
|
+
] })
|
|
4260
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4261
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
4262
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: labelClass, children: "Operation" }),
|
|
4263
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4264
|
+
"select",
|
|
4265
|
+
{
|
|
4266
|
+
value: operation,
|
|
4267
|
+
onChange: (event) => setOperation(event.target.value),
|
|
4268
|
+
className: inputClass,
|
|
4269
|
+
children: OPERATION_OPTIONS.map((o) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: o.value, children: o.label }, o.value))
|
|
4270
|
+
}
|
|
4271
|
+
),
|
|
4272
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-[11px] text-gray-500 dark:text-gray-400", children: selectedOpHelp })
|
|
4273
|
+
] }),
|
|
4274
|
+
operation !== "return" && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
4275
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: labelClass, children: "from" }),
|
|
4276
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4277
|
+
"input",
|
|
4278
|
+
{
|
|
4279
|
+
type: "text",
|
|
4280
|
+
value: from,
|
|
4281
|
+
onChange: (event) => setFrom(event.target.value),
|
|
4282
|
+
placeholder: "e.g. http-news.body",
|
|
4283
|
+
className: inputClass
|
|
4284
|
+
}
|
|
4285
|
+
),
|
|
4286
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-[11px] text-gray-500 dark:text-gray-400", children: "Dotted reference into the variable pool. Leave blank to read the sole incoming edge." })
|
|
4287
|
+
] }),
|
|
4288
|
+
(operation === "return" || operation === "merge") && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
4289
|
+
/* @__PURE__ */ jsxRuntime.jsxs("label", { className: labelClass, children: [
|
|
4290
|
+
"value ",
|
|
4291
|
+
operation === "merge" ? "(object to merge in)" : "(literal JSON)"
|
|
4292
|
+
] }),
|
|
4293
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4294
|
+
"textarea",
|
|
4295
|
+
{
|
|
4296
|
+
value: valueText,
|
|
4297
|
+
onChange: (event) => setValueText(event.target.value),
|
|
4298
|
+
placeholder: '{"recommendedPrice": 6.29}',
|
|
4299
|
+
rows: 6,
|
|
4300
|
+
className: textareaClass
|
|
4301
|
+
}
|
|
4302
|
+
)
|
|
4303
|
+
] }),
|
|
4304
|
+
operation === "pick" && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
4305
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: labelClass, children: "fields" }),
|
|
4306
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4307
|
+
"input",
|
|
4308
|
+
{
|
|
4309
|
+
type: "text",
|
|
4310
|
+
value: fieldsText,
|
|
4311
|
+
onChange: (event) => setFieldsText(event.target.value),
|
|
4312
|
+
placeholder: "id, name, state",
|
|
4313
|
+
className: inputClass
|
|
4314
|
+
}
|
|
4315
|
+
),
|
|
4316
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-[11px] text-gray-500 dark:text-gray-400", children: "Comma-separated keys to project." })
|
|
4317
|
+
] }),
|
|
4318
|
+
operation === "regex_extract" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
4319
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
4320
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: labelClass, children: "pattern" }),
|
|
4321
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4322
|
+
"input",
|
|
4323
|
+
{
|
|
4324
|
+
type: "text",
|
|
4325
|
+
value: pattern,
|
|
4326
|
+
onChange: (event) => setPattern(event.target.value),
|
|
4327
|
+
placeholder: `R\\$(\\d+\\.\\d+)`,
|
|
4328
|
+
className: `${inputClass} font-mono text-xs`
|
|
4329
|
+
}
|
|
4330
|
+
)
|
|
4331
|
+
] }),
|
|
4332
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
4333
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
4334
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: labelClass, children: "flags" }),
|
|
4335
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4336
|
+
"input",
|
|
4337
|
+
{
|
|
4338
|
+
type: "text",
|
|
4339
|
+
value: flags,
|
|
4340
|
+
onChange: (event) => setFlags(event.target.value),
|
|
4341
|
+
placeholder: "e.g. i or ims",
|
|
4342
|
+
className: inputClass
|
|
4343
|
+
}
|
|
4344
|
+
),
|
|
4345
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-[11px] text-gray-500 dark:text-gray-400", children: "i, m, s, x, U, R (g is implicit)." })
|
|
4346
|
+
] }),
|
|
4347
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
4348
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: labelClass, children: "group" }),
|
|
4349
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4350
|
+
"input",
|
|
4351
|
+
{
|
|
4352
|
+
type: "number",
|
|
4353
|
+
value: group,
|
|
4354
|
+
onChange: (event) => setGroup(Number(event.target.value) || 0),
|
|
4355
|
+
min: 0,
|
|
4356
|
+
className: inputClass
|
|
4357
|
+
}
|
|
4358
|
+
),
|
|
4359
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-[11px] text-gray-500 dark:text-gray-400", children: "0 = whole match, 1 = first capture group (default)." })
|
|
4360
|
+
] })
|
|
4361
|
+
] })
|
|
4362
|
+
] }),
|
|
4363
|
+
operation === "xml_titles" && /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-center gap-2 text-sm text-gray-700 dark:text-gray-300", children: [
|
|
4364
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4365
|
+
"input",
|
|
4366
|
+
{
|
|
4367
|
+
type: "checkbox",
|
|
4368
|
+
checked: keepChannel,
|
|
4369
|
+
onChange: (event) => setKeepChannel(event.target.checked),
|
|
4370
|
+
className: "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-500 dark:border-gray-600"
|
|
4371
|
+
}
|
|
4372
|
+
),
|
|
4373
|
+
"Keep channel/feed title (default: drop the first `<title>`)."
|
|
4374
|
+
] }),
|
|
4375
|
+
(operation === "regex_extract" || operation === "xml_titles") && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
4376
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: labelClass, children: "output key" }),
|
|
4377
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4378
|
+
"input",
|
|
4379
|
+
{
|
|
4380
|
+
type: "text",
|
|
4381
|
+
value: output,
|
|
4382
|
+
onChange: (event) => setOutput(event.target.value),
|
|
4383
|
+
placeholder: operation === "regex_extract" ? "matches" : "titles",
|
|
4384
|
+
className: inputClass
|
|
4385
|
+
}
|
|
4386
|
+
),
|
|
4387
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "mt-1 text-[11px] text-gray-500 dark:text-gray-400", children: [
|
|
4388
|
+
"Defaults to `",
|
|
4389
|
+
operation === "regex_extract" ? "matches" : "titles",
|
|
4390
|
+
"` if left blank."
|
|
4391
|
+
] })
|
|
4392
|
+
] })
|
|
4393
|
+
] }),
|
|
4394
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4395
|
+
ConfigFormActions,
|
|
4396
|
+
{
|
|
4397
|
+
cancelLabel: t("cancel"),
|
|
4398
|
+
saveLabel: t("save"),
|
|
4399
|
+
onCancel,
|
|
4400
|
+
onSave: handleSave
|
|
4401
|
+
}
|
|
4402
|
+
)
|
|
4138
4403
|
] });
|
|
4139
4404
|
}
|
|
4140
4405
|
var HTTP_METHODS = ["GET", "POST", "PUT", "DELETE"];
|
|
@@ -4182,7 +4447,7 @@ function HttpRequestNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
4182
4447
|
};
|
|
4183
4448
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
4184
4449
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4185
|
-
|
|
4450
|
+
chunkKTGWGJZ6_js.FormSelect,
|
|
4186
4451
|
{
|
|
4187
4452
|
label: t("methodLabel"),
|
|
4188
4453
|
value: method,
|
|
@@ -4191,7 +4456,7 @@ function HttpRequestNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
4191
4456
|
}
|
|
4192
4457
|
),
|
|
4193
4458
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4194
|
-
|
|
4459
|
+
chunkKTGWGJZ6_js.FormInput,
|
|
4195
4460
|
{
|
|
4196
4461
|
type: "text",
|
|
4197
4462
|
label: t("urlLabel"),
|
|
@@ -4204,7 +4469,7 @@ function HttpRequestNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
4204
4469
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
4205
4470
|
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: t("headersLabel") }),
|
|
4206
4471
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4207
|
-
|
|
4472
|
+
chunkKTGWGJZ6_js.Button,
|
|
4208
4473
|
{
|
|
4209
4474
|
type: "button",
|
|
4210
4475
|
onClick: handleAddHeader,
|
|
@@ -4214,7 +4479,7 @@ function HttpRequestNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
4214
4479
|
] }),
|
|
4215
4480
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: headerEntries.map((entry, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
4216
4481
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4217
|
-
|
|
4482
|
+
chunkKTGWGJZ6_js.FormInput,
|
|
4218
4483
|
{
|
|
4219
4484
|
type: "text",
|
|
4220
4485
|
value: entry.key,
|
|
@@ -4224,7 +4489,7 @@ function HttpRequestNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
4224
4489
|
}
|
|
4225
4490
|
),
|
|
4226
4491
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4227
|
-
|
|
4492
|
+
chunkKTGWGJZ6_js.FormInput,
|
|
4228
4493
|
{
|
|
4229
4494
|
type: "text",
|
|
4230
4495
|
value: entry.value,
|
|
@@ -4234,7 +4499,7 @@ function HttpRequestNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
4234
4499
|
}
|
|
4235
4500
|
),
|
|
4236
4501
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4237
|
-
|
|
4502
|
+
chunkKTGWGJZ6_js.IconButton,
|
|
4238
4503
|
{
|
|
4239
4504
|
onClick: () => handleRemoveHeader(index),
|
|
4240
4505
|
icon: /* @__PURE__ */ jsxRuntime.jsx(outline.TrashIcon, { className: "h-4 w-4" }),
|
|
@@ -4246,7 +4511,7 @@ function HttpRequestNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
4246
4511
|
] }, index)) })
|
|
4247
4512
|
] }),
|
|
4248
4513
|
method !== "GET" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4249
|
-
|
|
4514
|
+
chunkKTGWGJZ6_js.FormTextarea,
|
|
4250
4515
|
{
|
|
4251
4516
|
label: t("bodyLabel"),
|
|
4252
4517
|
value: body,
|
|
@@ -4257,7 +4522,7 @@ function HttpRequestNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
4257
4522
|
}
|
|
4258
4523
|
),
|
|
4259
4524
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4260
|
-
|
|
4525
|
+
chunkKTGWGJZ6_js.FormInput,
|
|
4261
4526
|
{
|
|
4262
4527
|
type: "number",
|
|
4263
4528
|
label: t("timeoutLabel"),
|
|
@@ -4269,7 +4534,7 @@ function HttpRequestNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
4269
4534
|
}
|
|
4270
4535
|
),
|
|
4271
4536
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4272
|
-
|
|
4537
|
+
chunkKTGWGJZ6_js.FormSelect,
|
|
4273
4538
|
{
|
|
4274
4539
|
label: t("parseResponseLabel"),
|
|
4275
4540
|
value: parseResponse,
|
|
@@ -4300,7 +4565,7 @@ function TemplateTransformNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
4300
4565
|
};
|
|
4301
4566
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
4302
4567
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4303
|
-
|
|
4568
|
+
chunkKTGWGJZ6_js.FormTextarea,
|
|
4304
4569
|
{
|
|
4305
4570
|
label: t("templateLabel"),
|
|
4306
4571
|
value: template,
|
|
@@ -4311,7 +4576,7 @@ function TemplateTransformNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
4311
4576
|
}
|
|
4312
4577
|
),
|
|
4313
4578
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4314
|
-
|
|
4579
|
+
chunkKTGWGJZ6_js.FormInput,
|
|
4315
4580
|
{
|
|
4316
4581
|
type: "text",
|
|
4317
4582
|
label: t("outputVariableLabel"),
|
|
@@ -4340,7 +4605,7 @@ function IterationNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
4340
4605
|
};
|
|
4341
4606
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
4342
4607
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4343
|
-
|
|
4608
|
+
chunkKTGWGJZ6_js.FormInput,
|
|
4344
4609
|
{
|
|
4345
4610
|
type: "text",
|
|
4346
4611
|
label: t("iteratorVariableLabel"),
|
|
@@ -4350,7 +4615,7 @@ function IterationNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
4350
4615
|
}
|
|
4351
4616
|
),
|
|
4352
4617
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4353
|
-
|
|
4618
|
+
chunkKTGWGJZ6_js.FormInput,
|
|
4354
4619
|
{
|
|
4355
4620
|
type: "number",
|
|
4356
4621
|
label: t("maxIterationsLabel"),
|
|
@@ -4381,7 +4646,7 @@ function KnowledgeBaseNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
4381
4646
|
};
|
|
4382
4647
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
4383
4648
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4384
|
-
|
|
4649
|
+
chunkKTGWGJZ6_js.FormInput,
|
|
4385
4650
|
{
|
|
4386
4651
|
type: "text",
|
|
4387
4652
|
label: t("sourceIdLabel"),
|
|
@@ -4391,7 +4656,7 @@ function KnowledgeBaseNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
4391
4656
|
}
|
|
4392
4657
|
),
|
|
4393
4658
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4394
|
-
|
|
4659
|
+
chunkKTGWGJZ6_js.FormInput,
|
|
4395
4660
|
{
|
|
4396
4661
|
type: "number",
|
|
4397
4662
|
label: t("topKLabel"),
|
|
@@ -4402,7 +4667,7 @@ function KnowledgeBaseNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
4402
4667
|
}
|
|
4403
4668
|
),
|
|
4404
4669
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4405
|
-
|
|
4670
|
+
chunkKTGWGJZ6_js.FormInput,
|
|
4406
4671
|
{
|
|
4407
4672
|
type: "number",
|
|
4408
4673
|
label: t("similarityThresholdLabel"),
|
|
@@ -4433,7 +4698,7 @@ function AnswerNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
4433
4698
|
};
|
|
4434
4699
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
4435
4700
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4436
|
-
|
|
4701
|
+
chunkKTGWGJZ6_js.FormTextarea,
|
|
4437
4702
|
{
|
|
4438
4703
|
label: t("outputTemplateLabel"),
|
|
4439
4704
|
hint: t("outputTemplateHelp"),
|
|
@@ -4867,7 +5132,7 @@ function VariableAggregatorNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
4867
5132
|
}
|
|
4868
5133
|
),
|
|
4869
5134
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4870
|
-
|
|
5135
|
+
chunkKTGWGJZ6_js.FormInput,
|
|
4871
5136
|
{
|
|
4872
5137
|
type: "text",
|
|
4873
5138
|
label: t("outputVariableLabel"),
|
|
@@ -4877,7 +5142,7 @@ function VariableAggregatorNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
4877
5142
|
}
|
|
4878
5143
|
),
|
|
4879
5144
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4880
|
-
|
|
5145
|
+
chunkKTGWGJZ6_js.FormSelect,
|
|
4881
5146
|
{
|
|
4882
5147
|
label: t("aggregationModeLabel"),
|
|
4883
5148
|
value: aggregationMode,
|
|
@@ -4910,7 +5175,7 @@ function DocumentExtractorNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
4910
5175
|
};
|
|
4911
5176
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
4912
5177
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4913
|
-
|
|
5178
|
+
chunkKTGWGJZ6_js.FormSelect,
|
|
4914
5179
|
{
|
|
4915
5180
|
label: t("extractionModeLabel"),
|
|
4916
5181
|
value: extractionMode,
|
|
@@ -4919,7 +5184,7 @@ function DocumentExtractorNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
4919
5184
|
}
|
|
4920
5185
|
),
|
|
4921
5186
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4922
|
-
|
|
5187
|
+
chunkKTGWGJZ6_js.FormInput,
|
|
4923
5188
|
{
|
|
4924
5189
|
type: "text",
|
|
4925
5190
|
label: t("outputVariableLabel"),
|
|
@@ -4939,7 +5204,7 @@ function DocumentExtractorNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
4939
5204
|
)
|
|
4940
5205
|
] });
|
|
4941
5206
|
}
|
|
4942
|
-
var
|
|
5207
|
+
var OPERATION_OPTIONS2 = ["filter", "map", "sort", "limit", "deduplicate", "flatten"];
|
|
4943
5208
|
var SORT_ORDER_OPTIONS = ["asc", "desc"];
|
|
4944
5209
|
function ListOperatorNodeConfigForm({ config, onSave, onCancel }) {
|
|
4945
5210
|
const t = chunkYXN2K77G_js.useTranslations("agents.workflow.listOperatorNodeConfig");
|
|
@@ -4981,7 +5246,7 @@ function ListOperatorNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
4981
5246
|
value: operation,
|
|
4982
5247
|
onChange: (event) => setOperation(event.target.value),
|
|
4983
5248
|
className: "w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 placeholder-gray-400 outline-none focus:border-indigo-400 focus:ring-2 focus:ring-indigo-400/20 dark:border-gray-600 dark:bg-gray-800 dark:text-white dark:placeholder-gray-500",
|
|
4984
|
-
children:
|
|
5249
|
+
children: OPERATION_OPTIONS2.map((operationOption) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: operationOption, children: t(`operation_${operationOption}`) }, operationOption))
|
|
4985
5250
|
}
|
|
4986
5251
|
)
|
|
4987
5252
|
] }),
|
|
@@ -5096,7 +5361,7 @@ function IterationStartNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
5096
5361
|
};
|
|
5097
5362
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
5098
5363
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5099
|
-
|
|
5364
|
+
chunkKTGWGJZ6_js.FormInput,
|
|
5100
5365
|
{
|
|
5101
5366
|
type: "text",
|
|
5102
5367
|
label: t("iteratorVariableLabel"),
|
|
@@ -5106,7 +5371,7 @@ function IterationStartNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
5106
5371
|
}
|
|
5107
5372
|
),
|
|
5108
5373
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5109
|
-
|
|
5374
|
+
chunkKTGWGJZ6_js.FormInput,
|
|
5110
5375
|
{
|
|
5111
5376
|
type: "text",
|
|
5112
5377
|
label: t("itemVariableLabel"),
|
|
@@ -5116,7 +5381,7 @@ function IterationStartNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
5116
5381
|
}
|
|
5117
5382
|
),
|
|
5118
5383
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5119
|
-
|
|
5384
|
+
chunkKTGWGJZ6_js.FormInput,
|
|
5120
5385
|
{
|
|
5121
5386
|
type: "text",
|
|
5122
5387
|
label: t("indexVariableLabel"),
|
|
@@ -5388,7 +5653,7 @@ function GroupNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
5388
5653
|
};
|
|
5389
5654
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
5390
5655
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5391
|
-
|
|
5656
|
+
chunkKTGWGJZ6_js.FormInput,
|
|
5392
5657
|
{
|
|
5393
5658
|
type: "text",
|
|
5394
5659
|
label: translations("labelField"),
|
|
@@ -5398,7 +5663,7 @@ function GroupNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
5398
5663
|
}
|
|
5399
5664
|
),
|
|
5400
5665
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5401
|
-
|
|
5666
|
+
chunkKTGWGJZ6_js.FormTextarea,
|
|
5402
5667
|
{
|
|
5403
5668
|
label: translations("descriptionField"),
|
|
5404
5669
|
value: description,
|
|
@@ -5556,7 +5821,7 @@ function ModelProviderNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
5556
5821
|
};
|
|
5557
5822
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
5558
5823
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5559
|
-
|
|
5824
|
+
chunkKTGWGJZ6_js.FormInput,
|
|
5560
5825
|
{
|
|
5561
5826
|
type: "text",
|
|
5562
5827
|
label: t("nameLabel"),
|
|
@@ -5566,7 +5831,7 @@ function ModelProviderNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
5566
5831
|
}
|
|
5567
5832
|
),
|
|
5568
5833
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5569
|
-
|
|
5834
|
+
chunkKTGWGJZ6_js.FormSelect,
|
|
5570
5835
|
{
|
|
5571
5836
|
label: t("providerTypeLabel"),
|
|
5572
5837
|
value: providerType,
|
|
@@ -5575,7 +5840,7 @@ function ModelProviderNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
5575
5840
|
}
|
|
5576
5841
|
),
|
|
5577
5842
|
showRegion && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5578
|
-
|
|
5843
|
+
chunkKTGWGJZ6_js.FormSelect,
|
|
5579
5844
|
{
|
|
5580
5845
|
label: t("regionLabel"),
|
|
5581
5846
|
value: region,
|
|
@@ -5584,7 +5849,7 @@ function ModelProviderNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
5584
5849
|
}
|
|
5585
5850
|
),
|
|
5586
5851
|
showEndpoint && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5587
|
-
|
|
5852
|
+
chunkKTGWGJZ6_js.FormInput,
|
|
5588
5853
|
{
|
|
5589
5854
|
type: "text",
|
|
5590
5855
|
label: t("endpointLabel"),
|
|
@@ -5594,7 +5859,7 @@ function ModelProviderNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
5594
5859
|
}
|
|
5595
5860
|
),
|
|
5596
5861
|
showApiKey && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5597
|
-
|
|
5862
|
+
chunkKTGWGJZ6_js.FormInput,
|
|
5598
5863
|
{
|
|
5599
5864
|
type: "password",
|
|
5600
5865
|
label: t("apiKeyLabel"),
|
|
@@ -5604,7 +5869,7 @@ function ModelProviderNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
5604
5869
|
}
|
|
5605
5870
|
),
|
|
5606
5871
|
showCredentialRef && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5607
|
-
|
|
5872
|
+
chunkKTGWGJZ6_js.FormInput,
|
|
5608
5873
|
{
|
|
5609
5874
|
type: "text",
|
|
5610
5875
|
label: t("credentialRefLabel"),
|
|
@@ -5650,6 +5915,220 @@ function ModelProviderNodeConfigForm({ config, onSave, onCancel }) {
|
|
|
5650
5915
|
)
|
|
5651
5916
|
] });
|
|
5652
5917
|
}
|
|
5918
|
+
function RuleNodeConfigForm({ config, onSave, onCancel, availableRules }) {
|
|
5919
|
+
const t = chunkYXN2K77G_js.useTranslations("agents.workflow.ruleNodeConfig");
|
|
5920
|
+
const [ruleId, setRuleId] = react.useState(config.ruleId ?? "");
|
|
5921
|
+
const [priority, setPriority] = react.useState(config.priority ?? 1);
|
|
5922
|
+
const [enabled, setEnabled] = react.useState(config.enabled ?? true);
|
|
5923
|
+
const handleSave = () => {
|
|
5924
|
+
const next = { ...config, type: "rule", ruleId: ruleId.trim(), priority, enabled };
|
|
5925
|
+
onSave(next);
|
|
5926
|
+
};
|
|
5927
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
5928
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
5929
|
+
/* @__PURE__ */ jsxRuntime.jsx("label", { className: "mb-1 block text-xs font-medium text-gray-700 dark:text-gray-300", children: t("ruleIdLabel", { _: "Rule" }) }),
|
|
5930
|
+
availableRules && availableRules.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5931
|
+
"select",
|
|
5932
|
+
{
|
|
5933
|
+
value: ruleId,
|
|
5934
|
+
onChange: (event) => setRuleId(event.target.value),
|
|
5935
|
+
className: "w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 outline-none focus:border-indigo-400 focus:ring-2 focus:ring-indigo-400/20 dark:border-gray-600 dark:bg-gray-800 dark:text-white",
|
|
5936
|
+
children: [
|
|
5937
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: t("rulePickPrompt", { _: "Choose a rule\u2026" }) }),
|
|
5938
|
+
availableRules.map((rule) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: rule.ruleId, children: rule.name ? `${rule.name} (${rule.ruleId})` : rule.ruleId }, rule.ruleId))
|
|
5939
|
+
]
|
|
5940
|
+
}
|
|
5941
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
5942
|
+
chunkKTGWGJZ6_js.FormInput,
|
|
5943
|
+
{
|
|
5944
|
+
type: "text",
|
|
5945
|
+
value: ruleId,
|
|
5946
|
+
onValueChange: setRuleId,
|
|
5947
|
+
placeholder: "e.g. peak_hours"
|
|
5948
|
+
}
|
|
5949
|
+
),
|
|
5950
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { className: "mt-1 text-[11px] text-gray-500 dark:text-gray-400", children: [
|
|
5951
|
+
"References an ",
|
|
5952
|
+
/* @__PURE__ */ jsxRuntime.jsx("code", { children: "astrlabe.agent_rules.rule_id" }),
|
|
5953
|
+
" row in this organization."
|
|
5954
|
+
] })
|
|
5955
|
+
] }),
|
|
5956
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
5957
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5958
|
+
chunkKTGWGJZ6_js.FormInput,
|
|
5959
|
+
{
|
|
5960
|
+
type: "number",
|
|
5961
|
+
label: t("priorityLabel", { _: "Priority" }),
|
|
5962
|
+
value: String(priority),
|
|
5963
|
+
onValueChange: (value) => setPriority(Number(value) || 0),
|
|
5964
|
+
min: 0
|
|
5965
|
+
}
|
|
5966
|
+
),
|
|
5967
|
+
/* @__PURE__ */ jsxRuntime.jsxs("label", { className: "flex items-end gap-2 pb-2 text-sm text-gray-700 dark:text-gray-300", children: [
|
|
5968
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5969
|
+
"input",
|
|
5970
|
+
{
|
|
5971
|
+
type: "checkbox",
|
|
5972
|
+
checked: enabled,
|
|
5973
|
+
onChange: (event) => setEnabled(event.target.checked),
|
|
5974
|
+
className: "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-500 dark:border-gray-600"
|
|
5975
|
+
}
|
|
5976
|
+
),
|
|
5977
|
+
t("enabledLabel", { _: "Enabled" })
|
|
5978
|
+
] })
|
|
5979
|
+
] }),
|
|
5980
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5981
|
+
ConfigFormActions,
|
|
5982
|
+
{
|
|
5983
|
+
cancelLabel: t("cancel"),
|
|
5984
|
+
saveLabel: t("save"),
|
|
5985
|
+
onCancel,
|
|
5986
|
+
onSave: handleSave
|
|
5987
|
+
}
|
|
5988
|
+
)
|
|
5989
|
+
] });
|
|
5990
|
+
}
|
|
5991
|
+
function AgentNodeConfigForm({
|
|
5992
|
+
config,
|
|
5993
|
+
onSave,
|
|
5994
|
+
onCancel,
|
|
5995
|
+
availableAgents,
|
|
5996
|
+
availableConnections
|
|
5997
|
+
}) {
|
|
5998
|
+
const t = chunkYXN2K77G_js.useTranslations("agents.workflow.agentNodeConfig");
|
|
5999
|
+
const [agentId, setAgentId] = react.useState(config.agentId ?? "");
|
|
6000
|
+
const [connectionId, setConnectionId] = react.useState(config.connectionId ?? "");
|
|
6001
|
+
const [modelId, setModelId] = react.useState(config.modelId ?? "");
|
|
6002
|
+
const [systemPrompt, setSystemPrompt] = react.useState(config.systemPrompt ?? "");
|
|
6003
|
+
const [userPrompt, setUserPrompt] = react.useState(config.userPrompt ?? "");
|
|
6004
|
+
const [maxTokens, setMaxTokens] = react.useState(config.maxTokens ?? 1024);
|
|
6005
|
+
const [temperature, setTemperature] = react.useState(config.temperature ?? 0.2);
|
|
6006
|
+
const handleSave = () => {
|
|
6007
|
+
const next = {
|
|
6008
|
+
...config,
|
|
6009
|
+
type: "agent",
|
|
6010
|
+
agentId: agentId.trim() || void 0,
|
|
6011
|
+
connectionId: connectionId.trim() || void 0,
|
|
6012
|
+
modelId: modelId.trim() || void 0,
|
|
6013
|
+
systemPrompt: systemPrompt || void 0,
|
|
6014
|
+
userPrompt: userPrompt || void 0,
|
|
6015
|
+
maxTokens,
|
|
6016
|
+
temperature
|
|
6017
|
+
};
|
|
6018
|
+
onSave(next);
|
|
6019
|
+
};
|
|
6020
|
+
const agentOptions = (availableAgents ?? []).map((agent) => ({
|
|
6021
|
+
value: agent.id,
|
|
6022
|
+
label: agent.name ?? agent.slug ?? agent.id
|
|
6023
|
+
}));
|
|
6024
|
+
const connOptions = (availableConnections ?? []).map((conn) => ({
|
|
6025
|
+
value: conn.id,
|
|
6026
|
+
label: conn.providerType ? `${conn.name ?? conn.id} (${conn.providerType})` : conn.name ?? conn.id
|
|
6027
|
+
}));
|
|
6028
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
|
|
6029
|
+
agentOptions.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
6030
|
+
chunkKTGWGJZ6_js.FormSelect,
|
|
6031
|
+
{
|
|
6032
|
+
label: t("agentLabel", { _: "Agent" }),
|
|
6033
|
+
value: agentId,
|
|
6034
|
+
onValueChange: setAgentId,
|
|
6035
|
+
options: [{ value: "", label: t("agentPickPrompt", { _: "Choose an agent\u2026" }) }, ...agentOptions]
|
|
6036
|
+
}
|
|
6037
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
6038
|
+
chunkKTGWGJZ6_js.FormInput,
|
|
6039
|
+
{
|
|
6040
|
+
type: "text",
|
|
6041
|
+
label: t("agentIdLabel", { _: "Agent ID" }),
|
|
6042
|
+
value: agentId,
|
|
6043
|
+
onValueChange: setAgentId,
|
|
6044
|
+
placeholder: "UUID of an astrlabe.agents row"
|
|
6045
|
+
}
|
|
6046
|
+
),
|
|
6047
|
+
connOptions.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
6048
|
+
chunkKTGWGJZ6_js.FormSelect,
|
|
6049
|
+
{
|
|
6050
|
+
label: t("connectionLabel", { _: "Model provider connection" }),
|
|
6051
|
+
value: connectionId,
|
|
6052
|
+
onValueChange: setConnectionId,
|
|
6053
|
+
options: [{ value: "", label: t("connectionPickPrompt", { _: "Inline model (no connection)" }) }, ...connOptions]
|
|
6054
|
+
}
|
|
6055
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
6056
|
+
chunkKTGWGJZ6_js.FormInput,
|
|
6057
|
+
{
|
|
6058
|
+
type: "text",
|
|
6059
|
+
label: t("connectionIdLabel", { _: "Connection ID" }),
|
|
6060
|
+
value: connectionId,
|
|
6061
|
+
onValueChange: setConnectionId,
|
|
6062
|
+
placeholder: "UUID of a model_provider_connections row"
|
|
6063
|
+
}
|
|
6064
|
+
),
|
|
6065
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6066
|
+
chunkKTGWGJZ6_js.FormInput,
|
|
6067
|
+
{
|
|
6068
|
+
type: "text",
|
|
6069
|
+
label: t("modelIdLabel", { _: "Model override (optional)" }),
|
|
6070
|
+
value: modelId,
|
|
6071
|
+
onValueChange: setModelId,
|
|
6072
|
+
placeholder: "amazon.nova-lite-v1:0"
|
|
6073
|
+
}
|
|
6074
|
+
),
|
|
6075
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6076
|
+
chunkKTGWGJZ6_js.FormTextarea,
|
|
6077
|
+
{
|
|
6078
|
+
label: t("systemPromptLabel", { _: "System prompt" }),
|
|
6079
|
+
value: systemPrompt,
|
|
6080
|
+
onValueChange: setSystemPrompt,
|
|
6081
|
+
placeholder: "You are a data analyst. Base every sentence on the provided data \u2014 no speculation.",
|
|
6082
|
+
rows: 4
|
|
6083
|
+
}
|
|
6084
|
+
),
|
|
6085
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6086
|
+
chunkKTGWGJZ6_js.FormTextarea,
|
|
6087
|
+
{
|
|
6088
|
+
label: t("userPromptLabel", { _: "User prompt" }),
|
|
6089
|
+
value: userPrompt,
|
|
6090
|
+
onValueChange: setUserPrompt,
|
|
6091
|
+
placeholder: "Station profile:\n{{ ds-station.station }}\n\nProduce a \u2264120-word briefing\u2026",
|
|
6092
|
+
rows: 8
|
|
6093
|
+
}
|
|
6094
|
+
),
|
|
6095
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
6096
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6097
|
+
chunkKTGWGJZ6_js.FormInput,
|
|
6098
|
+
{
|
|
6099
|
+
type: "number",
|
|
6100
|
+
label: t("maxTokensLabel", { _: "Max output tokens" }),
|
|
6101
|
+
value: String(maxTokens),
|
|
6102
|
+
onValueChange: (value) => setMaxTokens(Number(value) || 0),
|
|
6103
|
+
min: 1,
|
|
6104
|
+
max: 8192,
|
|
6105
|
+
step: 32
|
|
6106
|
+
}
|
|
6107
|
+
),
|
|
6108
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6109
|
+
chunkKTGWGJZ6_js.FormInput,
|
|
6110
|
+
{
|
|
6111
|
+
type: "number",
|
|
6112
|
+
label: t("temperatureLabel", { _: "Temperature" }),
|
|
6113
|
+
value: String(temperature),
|
|
6114
|
+
onValueChange: (value) => setTemperature(Number(value) || 0),
|
|
6115
|
+
min: 0,
|
|
6116
|
+
max: 2,
|
|
6117
|
+
step: 0.1
|
|
6118
|
+
}
|
|
6119
|
+
)
|
|
6120
|
+
] }),
|
|
6121
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6122
|
+
ConfigFormActions,
|
|
6123
|
+
{
|
|
6124
|
+
cancelLabel: t("cancel"),
|
|
6125
|
+
saveLabel: t("save"),
|
|
6126
|
+
onCancel,
|
|
6127
|
+
onSave: handleSave
|
|
6128
|
+
}
|
|
6129
|
+
)
|
|
6130
|
+
] });
|
|
6131
|
+
}
|
|
5653
6132
|
var NODE_TITLE_KEYS = {
|
|
5654
6133
|
start: "startNodeConfig",
|
|
5655
6134
|
end: "endNodeConfig",
|
|
@@ -5670,7 +6149,9 @@ var NODE_TITLE_KEYS = {
|
|
|
5670
6149
|
entity: "entityNodeConfig",
|
|
5671
6150
|
datasource: "datasourceNodeConfig",
|
|
5672
6151
|
group: "groupNodeConfig",
|
|
5673
|
-
model_provider: "modelProviderNodeConfig"
|
|
6152
|
+
model_provider: "modelProviderNodeConfig",
|
|
6153
|
+
rule: "ruleNodeConfig",
|
|
6154
|
+
agent: "agentNodeConfig"
|
|
5674
6155
|
};
|
|
5675
6156
|
function LogicNodeModal({ onSave, entities = [], datasources = [], onLoadTables, onLoadSchema }) {
|
|
5676
6157
|
const t = chunkYXN2K77G_js.useTranslations("agents.workflow");
|
|
@@ -5731,12 +6212,16 @@ function LogicNodeModal({ onSave, entities = [], datasources = [], onLoadTables,
|
|
|
5731
6212
|
return /* @__PURE__ */ jsxRuntime.jsx(GroupNodeConfigForm, { config, onSave: handleSave, onCancel: closeModal });
|
|
5732
6213
|
case "model_provider":
|
|
5733
6214
|
return /* @__PURE__ */ jsxRuntime.jsx(ModelProviderNodeConfigForm, { config, onSave: handleSave, onCancel: closeModal });
|
|
6215
|
+
case "rule":
|
|
6216
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RuleNodeConfigForm, { config, onSave: handleSave, onCancel: closeModal });
|
|
6217
|
+
case "agent":
|
|
6218
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AgentNodeConfigForm, { config, onSave: handleSave, onCancel: closeModal });
|
|
5734
6219
|
default:
|
|
5735
6220
|
return null;
|
|
5736
6221
|
}
|
|
5737
6222
|
};
|
|
5738
6223
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5739
|
-
|
|
6224
|
+
chunkKTGWGJZ6_js.GlassModal,
|
|
5740
6225
|
{
|
|
5741
6226
|
open,
|
|
5742
6227
|
onClose: closeModal,
|
|
@@ -5796,7 +6281,7 @@ function NodeContextMenu({ position, targetId, onClose, onEdit, onDuplicate, onC
|
|
|
5796
6281
|
}
|
|
5797
6282
|
];
|
|
5798
6283
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5799
|
-
|
|
6284
|
+
chunkKTGWGJZ6_js.ContextMenu,
|
|
5800
6285
|
{
|
|
5801
6286
|
position,
|
|
5802
6287
|
onClose,
|
|
@@ -5853,7 +6338,7 @@ function PanelContextMenu({ position, onClose, onPaste, onSelectAll, onFitView,
|
|
|
5853
6338
|
}
|
|
5854
6339
|
];
|
|
5855
6340
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5856
|
-
|
|
6341
|
+
chunkKTGWGJZ6_js.ContextMenu,
|
|
5857
6342
|
{
|
|
5858
6343
|
position,
|
|
5859
6344
|
onClose,
|
|
@@ -6000,7 +6485,7 @@ function SelectionContextMenu({
|
|
|
6000
6485
|
}
|
|
6001
6486
|
];
|
|
6002
6487
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6003
|
-
|
|
6488
|
+
chunkKTGWGJZ6_js.ContextMenu,
|
|
6004
6489
|
{
|
|
6005
6490
|
position,
|
|
6006
6491
|
onClose,
|
|
@@ -7908,5 +8393,5 @@ exports.useModalStore = useModalStore;
|
|
|
7908
8393
|
exports.useWorkflowBuilderClient = useWorkflowBuilderClient;
|
|
7909
8394
|
exports.useWorkflowBuilderClientOptional = useWorkflowBuilderClientOptional;
|
|
7910
8395
|
exports.useWorkflowStore = useWorkflowStore;
|
|
7911
|
-
//# sourceMappingURL=chunk-
|
|
7912
|
-
//# sourceMappingURL=chunk-
|
|
8396
|
+
//# sourceMappingURL=chunk-JMWGZRYA.js.map
|
|
8397
|
+
//# sourceMappingURL=chunk-JMWGZRYA.js.map
|