@apteva/apteva-kit 0.1.14 → 0.1.16
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/index.js +206 -210
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +141 -145
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1062,6 +1062,7 @@ function Composer({ onSendMessage, placeholder = "Type a message...", disabled =
|
|
|
1062
1062
|
const [fileError, setFileError] = useState(null);
|
|
1063
1063
|
const textareaRef = useRef2(null);
|
|
1064
1064
|
const fileInputRef = useRef2(null);
|
|
1065
|
+
const menuButtonRef = useRef2(null);
|
|
1065
1066
|
const handleKeyDown = (e) => {
|
|
1066
1067
|
if (e.key === "Enter" && !e.shiftKey) {
|
|
1067
1068
|
e.preventDefault();
|
|
@@ -1139,39 +1140,6 @@ function Composer({ onSendMessage, placeholder = "Type a message...", disabled =
|
|
|
1139
1140
|
/* @__PURE__ */ jsx12("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx12("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }),
|
|
1140
1141
|
/* @__PURE__ */ jsx12("span", { children: fileError })
|
|
1141
1142
|
] }) }),
|
|
1142
|
-
showMenu && /* @__PURE__ */ jsxs8(Fragment, { children: [
|
|
1143
|
-
/* @__PURE__ */ jsx12("div", { className: "fixed inset-0 z-10", onClick: () => setShowMenu(false) }),
|
|
1144
|
-
/* @__PURE__ */ jsxs8("div", { className: "absolute bottom-full left-4 mb-2 bg-gray-800 dark:bg-gray-700 rounded-xl shadow-lg overflow-hidden z-20 min-w-[240px]", children: [
|
|
1145
|
-
/* @__PURE__ */ jsxs8(
|
|
1146
|
-
"button",
|
|
1147
|
-
{
|
|
1148
|
-
onClick: () => {
|
|
1149
|
-
fileInputRef.current?.click();
|
|
1150
|
-
setShowMenu(false);
|
|
1151
|
-
},
|
|
1152
|
-
className: "w-full flex items-center gap-3 px-4 py-3 hover:bg-gray-700 dark:hover:bg-gray-600 transition-colors !text-white text-left",
|
|
1153
|
-
children: [
|
|
1154
|
-
/* @__PURE__ */ jsx12("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx12("path", { d: "M10.5 3.5L5.5 8.5C4.67157 9.32843 4.67157 10.6716 5.5 11.5C6.32843 12.3284 7.67157 12.3284 8.5 11.5L14.5 5.5C15.8807 4.11929 15.8807 1.88071 14.5 0.5C13.1193 -0.880711 10.8807 -0.880711 9.5 0.5L3.5 6.5C1.56846 8.43154 1.56846 11.5685 3.5 13.5C5.43154 15.4315 8.56846 15.4315 10.5 13.5L15.5 8.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", transform: "translate(2, 3)" }) }),
|
|
1155
|
-
/* @__PURE__ */ jsx12("span", { className: "!text-sm font-medium", children: "Add photos & files" })
|
|
1156
|
-
]
|
|
1157
|
-
}
|
|
1158
|
-
),
|
|
1159
|
-
onSwitchMode && /* @__PURE__ */ jsxs8(
|
|
1160
|
-
"button",
|
|
1161
|
-
{
|
|
1162
|
-
onClick: () => {
|
|
1163
|
-
onSwitchMode();
|
|
1164
|
-
setShowMenu(false);
|
|
1165
|
-
},
|
|
1166
|
-
className: "w-full flex items-center gap-3 px-4 py-3 hover:bg-gray-700 dark:hover:bg-gray-600 transition-colors !text-white text-left border-t border-gray-700 dark:border-gray-600",
|
|
1167
|
-
children: [
|
|
1168
|
-
/* @__PURE__ */ jsx12("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx12("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 10V3L4 14h7v7l9-11h-7z" }) }),
|
|
1169
|
-
/* @__PURE__ */ jsx12("span", { className: "!text-sm font-medium", children: "Switch to command mode" })
|
|
1170
|
-
]
|
|
1171
|
-
}
|
|
1172
|
-
)
|
|
1173
|
-
] })
|
|
1174
|
-
] }),
|
|
1175
1143
|
pendingFiles.length > 0 && /* @__PURE__ */ jsx12("div", { className: "mb-2 flex flex-wrap gap-2", children: pendingFiles.map((pf, index) => /* @__PURE__ */ jsxs8(
|
|
1176
1144
|
"div",
|
|
1177
1145
|
{
|
|
@@ -1195,16 +1163,62 @@ function Composer({ onSendMessage, placeholder = "Type a message...", disabled =
|
|
|
1195
1163
|
},
|
|
1196
1164
|
index
|
|
1197
1165
|
)) }),
|
|
1198
|
-
/* @__PURE__ */ jsxs8("div", { className: "relative border-2 border-gray-300 dark:border-gray-700
|
|
1199
|
-
/* @__PURE__ */
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1166
|
+
/* @__PURE__ */ jsxs8("div", { className: "apteva-composer relative border-2 border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-900 transition-all duration-300 flex items-center px-3 py-2 gap-3", children: [
|
|
1167
|
+
/* @__PURE__ */ jsxs8("div", { className: "relative flex-shrink-0", children: [
|
|
1168
|
+
/* @__PURE__ */ jsx12(
|
|
1169
|
+
"button",
|
|
1170
|
+
{
|
|
1171
|
+
ref: menuButtonRef,
|
|
1172
|
+
onClick: () => setShowMenu(!showMenu),
|
|
1173
|
+
className: "w-8 h-8 rounded-lg flex items-center justify-center transition-all !text-gray-700 dark:!text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800",
|
|
1174
|
+
title: "More options",
|
|
1175
|
+
children: /* @__PURE__ */ jsx12("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx12("path", { d: "M10 5v10M5 10h10", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
1176
|
+
}
|
|
1177
|
+
),
|
|
1178
|
+
showMenu && /* @__PURE__ */ jsxs8(Fragment, { children: [
|
|
1179
|
+
/* @__PURE__ */ jsx12("div", { className: "fixed inset-0 z-[9998]", onClick: () => setShowMenu(false) }),
|
|
1180
|
+
/* @__PURE__ */ jsxs8(
|
|
1181
|
+
"div",
|
|
1182
|
+
{
|
|
1183
|
+
className: "fixed bg-gray-800 dark:bg-gray-700 rounded-xl shadow-lg overflow-hidden z-[9999] min-w-[200px]",
|
|
1184
|
+
style: {
|
|
1185
|
+
left: menuButtonRef.current?.getBoundingClientRect().left ?? 0,
|
|
1186
|
+
top: (menuButtonRef.current?.getBoundingClientRect().bottom ?? 0) + 8
|
|
1187
|
+
},
|
|
1188
|
+
children: [
|
|
1189
|
+
/* @__PURE__ */ jsxs8(
|
|
1190
|
+
"button",
|
|
1191
|
+
{
|
|
1192
|
+
onClick: () => {
|
|
1193
|
+
fileInputRef.current?.click();
|
|
1194
|
+
setShowMenu(false);
|
|
1195
|
+
},
|
|
1196
|
+
className: "w-full flex items-center gap-3 px-4 py-3 hover:bg-gray-700 dark:hover:bg-gray-600 transition-colors !text-white text-left",
|
|
1197
|
+
children: [
|
|
1198
|
+
/* @__PURE__ */ jsx12("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx12("path", { d: "M10.5 3.5L5.5 8.5C4.67157 9.32843 4.67157 10.6716 5.5 11.5C6.32843 12.3284 7.67157 12.3284 8.5 11.5L14.5 5.5C15.8807 4.11929 15.8807 1.88071 14.5 0.5C13.1193 -0.880711 10.8807 -0.880711 9.5 0.5L3.5 6.5C1.56846 8.43154 1.56846 11.5685 3.5 13.5C5.43154 15.4315 8.56846 15.4315 10.5 13.5L15.5 8.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", transform: "translate(2, 3)" }) }),
|
|
1199
|
+
/* @__PURE__ */ jsx12("span", { className: "!text-sm font-medium", children: "Add photos & files" })
|
|
1200
|
+
]
|
|
1201
|
+
}
|
|
1202
|
+
),
|
|
1203
|
+
onSwitchMode && /* @__PURE__ */ jsxs8(
|
|
1204
|
+
"button",
|
|
1205
|
+
{
|
|
1206
|
+
onClick: () => {
|
|
1207
|
+
onSwitchMode();
|
|
1208
|
+
setShowMenu(false);
|
|
1209
|
+
},
|
|
1210
|
+
className: "w-full flex items-center gap-3 px-4 py-3 hover:bg-gray-700 dark:hover:bg-gray-600 transition-colors !text-white text-left border-t border-gray-700 dark:border-gray-600",
|
|
1211
|
+
children: [
|
|
1212
|
+
/* @__PURE__ */ jsx12("svg", { className: "w-4.5 h-4.5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx12("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 10V3L4 14h7v7l9-11h-7z" }) }),
|
|
1213
|
+
/* @__PURE__ */ jsx12("span", { className: "!text-sm font-medium", children: "Switch to command mode" })
|
|
1214
|
+
]
|
|
1215
|
+
}
|
|
1216
|
+
)
|
|
1217
|
+
]
|
|
1218
|
+
}
|
|
1219
|
+
)
|
|
1220
|
+
] })
|
|
1221
|
+
] }),
|
|
1208
1222
|
/* @__PURE__ */ jsx12(
|
|
1209
1223
|
"textarea",
|
|
1210
1224
|
{
|
|
@@ -1370,51 +1384,6 @@ function CommandComposer({
|
|
|
1370
1384
|
/* @__PURE__ */ jsx13("svg", { className: "w-3 h-3 flex-shrink-0", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx13("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }),
|
|
1371
1385
|
/* @__PURE__ */ jsx13("span", { children: fileError })
|
|
1372
1386
|
] }) }),
|
|
1373
|
-
showMenu && /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
1374
|
-
/* @__PURE__ */ jsx13("div", { className: "fixed inset-0 z-[9998]", onClick: () => setShowMenu(false) }),
|
|
1375
|
-
/* @__PURE__ */ jsxs9(
|
|
1376
|
-
"div",
|
|
1377
|
-
{
|
|
1378
|
-
className: "fixed bg-gray-800 dark:bg-gray-700 rounded-xl shadow-lg overflow-hidden z-[9999] min-w-[200px]",
|
|
1379
|
-
style: {
|
|
1380
|
-
bottom: "auto",
|
|
1381
|
-
left: menuButtonRef.current?.getBoundingClientRect().left ?? 0,
|
|
1382
|
-
top: (menuButtonRef.current?.getBoundingClientRect().top ?? 0) - 8,
|
|
1383
|
-
transform: "translateY(-100%)"
|
|
1384
|
-
},
|
|
1385
|
-
children: [
|
|
1386
|
-
/* @__PURE__ */ jsxs9(
|
|
1387
|
-
"button",
|
|
1388
|
-
{
|
|
1389
|
-
onClick: () => {
|
|
1390
|
-
fileInputRef.current?.click();
|
|
1391
|
-
setShowMenu(false);
|
|
1392
|
-
},
|
|
1393
|
-
className: "w-full flex items-center gap-3 px-4 py-3 hover:bg-gray-700 dark:hover:bg-gray-600 transition-colors !text-white text-left",
|
|
1394
|
-
children: [
|
|
1395
|
-
/* @__PURE__ */ jsx13("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx13("path", { d: "M10.5 3.5L5.5 8.5C4.67157 9.32843 4.67157 10.6716 5.5 11.5C6.32843 12.3284 7.67157 12.3284 8.5 11.5L14.5 5.5C15.8807 4.11929 15.8807 1.88071 14.5 0.5C13.1193 -0.880711 10.8807 -0.880711 9.5 0.5L3.5 6.5C1.56846 8.43154 1.56846 11.5685 3.5 13.5C5.43154 15.4315 8.56846 15.4315 10.5 13.5L15.5 8.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", transform: "translate(2, 3)" }) }),
|
|
1396
|
-
/* @__PURE__ */ jsx13("span", { className: "!text-sm font-medium", children: "Add photos & files" })
|
|
1397
|
-
]
|
|
1398
|
-
}
|
|
1399
|
-
),
|
|
1400
|
-
onExpand && /* @__PURE__ */ jsxs9(
|
|
1401
|
-
"button",
|
|
1402
|
-
{
|
|
1403
|
-
onClick: () => {
|
|
1404
|
-
onExpand();
|
|
1405
|
-
setShowMenu(false);
|
|
1406
|
-
},
|
|
1407
|
-
className: "w-full flex items-center gap-3 px-4 py-3 hover:bg-gray-700 dark:hover:bg-gray-600 transition-colors !text-white text-left border-t border-gray-700 dark:border-gray-600",
|
|
1408
|
-
children: [
|
|
1409
|
-
/* @__PURE__ */ jsx13("svg", { className: "w-4.5 h-4.5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx13("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }),
|
|
1410
|
-
/* @__PURE__ */ jsx13("span", { className: "!text-sm font-medium", children: "Expand to chat" })
|
|
1411
|
-
]
|
|
1412
|
-
}
|
|
1413
|
-
)
|
|
1414
|
-
]
|
|
1415
|
-
}
|
|
1416
|
-
)
|
|
1417
|
-
] }),
|
|
1418
1387
|
pendingFiles.length > 0 && state === "idle" && /* @__PURE__ */ jsx13("div", { className: "mb-2 flex flex-wrap gap-2", children: pendingFiles.map((pf, index) => /* @__PURE__ */ jsxs9(
|
|
1419
1388
|
"div",
|
|
1420
1389
|
{
|
|
@@ -1439,7 +1408,7 @@ function CommandComposer({
|
|
|
1439
1408
|
"div",
|
|
1440
1409
|
{
|
|
1441
1410
|
className: cn(
|
|
1442
|
-
"flex items-center gap-2 px-3 py-2 border-2
|
|
1411
|
+
"apteva-composer flex items-center gap-2 px-3 py-2 border-2 bg-white dark:bg-gray-900 transition-all duration-200",
|
|
1443
1412
|
state === "idle" && "border-gray-200 dark:border-gray-700",
|
|
1444
1413
|
state === "loading" && "border-blue-400 dark:border-blue-500",
|
|
1445
1414
|
state === "plan-pending" && "border-amber-400 dark:border-amber-500",
|
|
@@ -1447,18 +1416,65 @@ function CommandComposer({
|
|
|
1447
1416
|
state === "error" && "border-red-400 dark:border-red-500"
|
|
1448
1417
|
),
|
|
1449
1418
|
children: [
|
|
1450
|
-
|
|
1451
|
-
"
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1419
|
+
/* @__PURE__ */ jsxs9("div", { className: "w-8 h-8 flex items-center justify-center flex-shrink-0", children: [
|
|
1420
|
+
state === "idle" && /* @__PURE__ */ jsxs9("div", { className: "relative", children: [
|
|
1421
|
+
/* @__PURE__ */ jsx13(
|
|
1422
|
+
"button",
|
|
1423
|
+
{
|
|
1424
|
+
ref: menuButtonRef,
|
|
1425
|
+
onClick: () => setShowMenu(!showMenu),
|
|
1426
|
+
className: "w-8 h-8 rounded-lg flex items-center justify-center transition-all !text-gray-500 dark:!text-gray-400 hover:!text-gray-700 dark:hover:!text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-800",
|
|
1427
|
+
title: "More options",
|
|
1428
|
+
children: /* @__PURE__ */ jsx13("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx13("path", { d: "M10 5v10M5 10h10", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
1429
|
+
}
|
|
1430
|
+
),
|
|
1431
|
+
showMenu && /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
1432
|
+
/* @__PURE__ */ jsx13("div", { className: "fixed inset-0 z-[9998]", onClick: () => setShowMenu(false) }),
|
|
1433
|
+
/* @__PURE__ */ jsxs9(
|
|
1434
|
+
"div",
|
|
1435
|
+
{
|
|
1436
|
+
className: "fixed bg-gray-800 dark:bg-gray-700 rounded-xl shadow-lg overflow-hidden z-[9999] min-w-[200px]",
|
|
1437
|
+
style: {
|
|
1438
|
+
left: menuButtonRef.current?.getBoundingClientRect().left ?? 0,
|
|
1439
|
+
top: (menuButtonRef.current?.getBoundingClientRect().bottom ?? 0) + 8
|
|
1440
|
+
},
|
|
1441
|
+
children: [
|
|
1442
|
+
/* @__PURE__ */ jsxs9(
|
|
1443
|
+
"button",
|
|
1444
|
+
{
|
|
1445
|
+
onClick: () => {
|
|
1446
|
+
fileInputRef.current?.click();
|
|
1447
|
+
setShowMenu(false);
|
|
1448
|
+
},
|
|
1449
|
+
className: "w-full flex items-center gap-3 px-4 py-3 hover:bg-gray-700 dark:hover:bg-gray-600 transition-colors !text-white text-left",
|
|
1450
|
+
children: [
|
|
1451
|
+
/* @__PURE__ */ jsx13("svg", { width: "18", height: "18", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx13("path", { d: "M10.5 3.5L5.5 8.5C4.67157 9.32843 4.67157 10.6716 5.5 11.5C6.32843 12.3284 7.67157 12.3284 8.5 11.5L14.5 5.5C15.8807 4.11929 15.8807 1.88071 14.5 0.5C13.1193 -0.880711 10.8807 -0.880711 9.5 0.5L3.5 6.5C1.56846 8.43154 1.56846 11.5685 3.5 13.5C5.43154 15.4315 8.56846 15.4315 10.5 13.5L15.5 8.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", transform: "translate(2, 3)" }) }),
|
|
1452
|
+
/* @__PURE__ */ jsx13("span", { className: "!text-sm font-medium", children: "Add photos & files" })
|
|
1453
|
+
]
|
|
1454
|
+
}
|
|
1455
|
+
),
|
|
1456
|
+
onExpand && /* @__PURE__ */ jsxs9(
|
|
1457
|
+
"button",
|
|
1458
|
+
{
|
|
1459
|
+
onClick: () => {
|
|
1460
|
+
onExpand();
|
|
1461
|
+
setShowMenu(false);
|
|
1462
|
+
},
|
|
1463
|
+
className: "w-full flex items-center gap-3 px-4 py-3 hover:bg-gray-700 dark:hover:bg-gray-600 transition-colors !text-white text-left border-t border-gray-700 dark:border-gray-600",
|
|
1464
|
+
children: [
|
|
1465
|
+
/* @__PURE__ */ jsx13("svg", { className: "w-4.5 h-4.5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx13("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }),
|
|
1466
|
+
/* @__PURE__ */ jsx13("span", { className: "!text-sm font-medium", children: "Expand to chat" })
|
|
1467
|
+
]
|
|
1468
|
+
}
|
|
1469
|
+
)
|
|
1470
|
+
]
|
|
1471
|
+
}
|
|
1472
|
+
)
|
|
1473
|
+
] })
|
|
1474
|
+
] }),
|
|
1475
|
+
state === "loading" && !toolName && /* @__PURE__ */ jsx13("div", { className: "w-4 h-4 border-2 border-blue-200 border-t-blue-500 rounded-full animate-spin" }),
|
|
1476
|
+
state === "loading" && toolName && /* @__PURE__ */ jsx13("div", { className: "w-2 h-2 rounded-full bg-blue-500 animate-pulse" })
|
|
1477
|
+
] }),
|
|
1462
1478
|
state === "idle" ? /* @__PURE__ */ jsx13(
|
|
1463
1479
|
"textarea",
|
|
1464
1480
|
{
|
|
@@ -1494,25 +1510,24 @@ function CommandComposer({
|
|
|
1494
1510
|
] }) : displayContent
|
|
1495
1511
|
}
|
|
1496
1512
|
),
|
|
1497
|
-
/* @__PURE__ */
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
] }),
|
|
1513
|
+
/* @__PURE__ */ jsx13("div", { className: "w-8 h-8 flex items-center justify-center flex-shrink-0", children: state === "plan-pending" ? /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-1", children: [
|
|
1514
|
+
/* @__PURE__ */ jsx13(
|
|
1515
|
+
"button",
|
|
1516
|
+
{
|
|
1517
|
+
onClick: onApprove,
|
|
1518
|
+
className: "px-2 py-1 bg-amber-500 text-white rounded-lg hover:bg-amber-600 transition-colors text-xs font-medium",
|
|
1519
|
+
children: "Approve"
|
|
1520
|
+
}
|
|
1521
|
+
),
|
|
1522
|
+
/* @__PURE__ */ jsx13(
|
|
1523
|
+
"button",
|
|
1524
|
+
{
|
|
1525
|
+
onClick: onReject,
|
|
1526
|
+
className: "px-2 py-1 bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-300 dark:hover:bg-gray-600 transition-colors text-xs font-medium",
|
|
1527
|
+
children: "Modify"
|
|
1528
|
+
}
|
|
1529
|
+
)
|
|
1530
|
+
] }) : /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
1516
1531
|
(state === "success" || state === "error") && /* @__PURE__ */ jsx13(
|
|
1517
1532
|
"button",
|
|
1518
1533
|
{
|
|
@@ -1537,32 +1552,10 @@ function CommandComposer({
|
|
|
1537
1552
|
children: /* @__PURE__ */ jsx13("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx13("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 12h14M12 5l7 7-7 7" }) })
|
|
1538
1553
|
}
|
|
1539
1554
|
)
|
|
1540
|
-
] })
|
|
1555
|
+
] }) })
|
|
1541
1556
|
]
|
|
1542
1557
|
}
|
|
1543
1558
|
),
|
|
1544
|
-
state === "success" && response?.includes("weather") && /* @__PURE__ */ jsx13("div", { className: "mt-3 p-3 bg-gradient-to-r from-blue-50 to-cyan-50 dark:from-blue-900/20 dark:to-cyan-900/20 border border-blue-200 dark:border-blue-800 rounded-xl", children: /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-3", children: [
|
|
1545
|
-
/* @__PURE__ */ jsx13("div", { className: "text-3xl", children: "\u2600\uFE0F" }),
|
|
1546
|
-
/* @__PURE__ */ jsxs9("div", { className: "flex-1", children: [
|
|
1547
|
-
/* @__PURE__ */ jsx13("div", { className: "text-sm font-medium text-gray-900 dark:text-white", children: "Paris, France" }),
|
|
1548
|
-
/* @__PURE__ */ jsx13("div", { className: "text-xs text-gray-500 dark:text-gray-400", children: "Sunny, 22\xB0C" })
|
|
1549
|
-
] }),
|
|
1550
|
-
/* @__PURE__ */ jsx13("button", { className: "px-3 py-1 text-xs bg-blue-500 text-white rounded-lg hover:bg-blue-600", children: "Details" })
|
|
1551
|
-
] }) }),
|
|
1552
|
-
state === "success" && response?.includes("trip") && /* @__PURE__ */ jsxs9("div", { className: "mt-3 p-3 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-xl shadow-sm", children: [
|
|
1553
|
-
/* @__PURE__ */ jsx13("img", { src: "https://images.unsplash.com/photo-1502602898657-3e91760cbb34?w=400&h=150&fit=crop", alt: "Paris", className: "w-full h-24 object-cover rounded-lg mb-2" }),
|
|
1554
|
-
/* @__PURE__ */ jsx13("div", { className: "text-sm font-medium text-gray-900 dark:text-white", children: "Paris Weekend Getaway" }),
|
|
1555
|
-
/* @__PURE__ */ jsx13("div", { className: "text-xs text-gray-500 dark:text-gray-400 mb-2", children: "3 days \xB7 $850" }),
|
|
1556
|
-
/* @__PURE__ */ jsxs9("div", { className: "flex gap-2", children: [
|
|
1557
|
-
/* @__PURE__ */ jsx13("button", { className: "flex-1 px-2 py-1 text-xs bg-blue-500 text-white rounded-lg hover:bg-blue-600", children: "Book" }),
|
|
1558
|
-
/* @__PURE__ */ jsx13("button", { className: "flex-1 px-2 py-1 text-xs bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600", children: "Details" })
|
|
1559
|
-
] })
|
|
1560
|
-
] }),
|
|
1561
|
-
state === "success" && response?.includes("task") && /* @__PURE__ */ jsx13("div", { className: "mt-3 border border-gray-200 dark:border-gray-700 rounded-xl overflow-hidden", children: ["Review PR #123", "Update documentation", "Fix login bug"].map((task, i) => /* @__PURE__ */ jsxs9("div", { className: `flex items-center gap-2 px-3 py-2 ${i > 0 ? "border-t border-gray-100 dark:border-gray-800" : ""}`, children: [
|
|
1562
|
-
/* @__PURE__ */ jsx13("div", { className: `w-2 h-2 rounded-full ${i === 0 ? "bg-green-500" : i === 1 ? "bg-yellow-500" : "bg-red-500"}` }),
|
|
1563
|
-
/* @__PURE__ */ jsx13("span", { className: "flex-1 text-sm text-gray-700 dark:text-gray-300", children: task }),
|
|
1564
|
-
/* @__PURE__ */ jsx13("button", { className: "text-xs text-blue-500 hover:text-blue-600", children: "View" })
|
|
1565
|
-
] }, i)) }),
|
|
1566
1559
|
/* @__PURE__ */ jsx13(
|
|
1567
1560
|
"input",
|
|
1568
1561
|
{
|
|
@@ -2249,7 +2242,7 @@ ${planToExecute}`;
|
|
|
2249
2242
|
}
|
|
2250
2243
|
)
|
|
2251
2244
|
] }),
|
|
2252
|
-
mode === "command" && /* @__PURE__ */ jsx14("div", { className: "
|
|
2245
|
+
mode === "command" && /* @__PURE__ */ jsx14("div", { className: "w-full", children: /* @__PURE__ */ jsx14(
|
|
2253
2246
|
CommandComposer,
|
|
2254
2247
|
{
|
|
2255
2248
|
onExecute: (text, files) => {
|
|
@@ -2268,7 +2261,7 @@ ${planToExecute}`;
|
|
|
2268
2261
|
onExpand: showModeToggle ? () => handleModeChange("chat") : void 0,
|
|
2269
2262
|
placeholder: placeholder || "Enter your command..."
|
|
2270
2263
|
}
|
|
2271
|
-
) })
|
|
2264
|
+
) }),
|
|
2272
2265
|
/* @__PURE__ */ jsx14("style", { dangerouslySetInnerHTML: {
|
|
2273
2266
|
__html: `
|
|
2274
2267
|
@keyframes pulse-border {
|
|
@@ -2278,6 +2271,9 @@ ${planToExecute}`;
|
|
|
2278
2271
|
.animate-pulse-border {
|
|
2279
2272
|
animation: pulse-border 2s ease-in-out infinite;
|
|
2280
2273
|
}
|
|
2274
|
+
.apteva-composer {
|
|
2275
|
+
border-radius: var(--apteva-border-radius, 1rem) !important;
|
|
2276
|
+
}
|
|
2281
2277
|
`
|
|
2282
2278
|
} })
|
|
2283
2279
|
] });
|