@apteva/apteva-kit 0.1.89 → 0.1.91
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.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +215 -165
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +135 -85
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1230,117 +1230,138 @@ function Image({ widget }) {
|
|
|
1230
1230
|
|
|
1231
1231
|
function StepIcon({ type, status }) {
|
|
1232
1232
|
if (status === "completed") {
|
|
1233
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: "w-3.5 h-3.5 text-emerald-
|
|
1233
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: "w-3.5 h-3.5 text-emerald-500", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2.5, d: "M5 13l4 4L19 7" }) });
|
|
1234
1234
|
}
|
|
1235
1235
|
if (status === "error") {
|
|
1236
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: "w-3.5 h-3.5 text-red-
|
|
1236
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: "w-3.5 h-3.5 text-red-500", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2.5, d: "M6 18L18 6M6 6l12 12" }) });
|
|
1237
1237
|
}
|
|
1238
1238
|
if (status === "active") {
|
|
1239
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-3 h-3 rounded-full bg-blue-
|
|
1239
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-3 h-3 rounded-full bg-blue-500 animate-pulse" });
|
|
1240
1240
|
}
|
|
1241
|
-
|
|
1242
|
-
|
|
1241
|
+
const iconClass = "w-3.5 h-3.5";
|
|
1242
|
+
if (type === "time" || type === "schedule" || type === "clock") {
|
|
1243
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: iconClass, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" }) });
|
|
1244
|
+
}
|
|
1245
|
+
if (type === "recurring" || type === "repeat") {
|
|
1246
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: iconClass, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" }) });
|
|
1243
1247
|
}
|
|
1244
1248
|
if (type === "agent" || _optionalChain([type, 'optionalAccess', _28 => _28.startsWith, 'call', _29 => _29("@")])) {
|
|
1245
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className:
|
|
1249
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: iconClass, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z" }) });
|
|
1246
1250
|
}
|
|
1247
1251
|
if (type === "email" || type === "mail") {
|
|
1248
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className:
|
|
1252
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: iconClass, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" }) });
|
|
1253
|
+
}
|
|
1254
|
+
if (type === "slack" || type === "message" || type === "chat") {
|
|
1255
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: iconClass, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "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" }) });
|
|
1249
1256
|
}
|
|
1250
|
-
if (type === "
|
|
1251
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className:
|
|
1257
|
+
if (type === "webhook" || type === "api") {
|
|
1258
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: iconClass, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1" }) });
|
|
1252
1259
|
}
|
|
1253
|
-
if (type === "build" || type === "compile") {
|
|
1254
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className:
|
|
1260
|
+
if (type === "build" || type === "compile" || type === "package") {
|
|
1261
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: iconClass, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4" }) });
|
|
1255
1262
|
}
|
|
1256
|
-
if (type === "test") {
|
|
1257
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className:
|
|
1263
|
+
if (type === "test" || type === "check" || type === "verify") {
|
|
1264
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: iconClass, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4" }) });
|
|
1258
1265
|
}
|
|
1259
|
-
if (type === "deploy" || type === "rocket") {
|
|
1260
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className:
|
|
1266
|
+
if (type === "deploy" || type === "rocket" || type === "launch") {
|
|
1267
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: iconClass, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 10V3L4 14h7v7l9-11h-7z" }) });
|
|
1261
1268
|
}
|
|
1262
|
-
if (type === "push" || type === "upload") {
|
|
1263
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className:
|
|
1269
|
+
if (type === "push" || type === "upload" || type === "cloud") {
|
|
1270
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: iconClass, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12" }) });
|
|
1264
1271
|
}
|
|
1265
|
-
if (type === "generate" || type === "create" || type === "document") {
|
|
1266
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className:
|
|
1272
|
+
if (type === "generate" || type === "create" || type === "document" || type === "file") {
|
|
1273
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: iconClass, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" }) });
|
|
1267
1274
|
}
|
|
1268
|
-
if (type === "review" || type === "
|
|
1269
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { className:
|
|
1275
|
+
if (type === "review" || type === "inspect" || type === "eye") {
|
|
1276
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "svg", { className: iconClass, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: [
|
|
1270
1277
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }),
|
|
1271
1278
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" })
|
|
1272
1279
|
] });
|
|
1273
1280
|
}
|
|
1274
|
-
if (type === "analyze" || type === "research") {
|
|
1275
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className:
|
|
1281
|
+
if (type === "analyze" || type === "research" || type === "chart") {
|
|
1282
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: iconClass, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" }) });
|
|
1283
|
+
}
|
|
1284
|
+
if (type === "scrape" || type === "crawl" || type === "spider") {
|
|
1285
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: iconClass, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9" }) });
|
|
1286
|
+
}
|
|
1287
|
+
if (type === "data" || type === "database" || type === "storage") {
|
|
1288
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: iconClass, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4" }) });
|
|
1289
|
+
}
|
|
1290
|
+
if (type === "notification" || type === "bell" || type === "alert") {
|
|
1291
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: iconClass, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9" }) });
|
|
1276
1292
|
}
|
|
1277
|
-
|
|
1293
|
+
if (type === "transform" || type === "process" || type === "convert") {
|
|
1294
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: iconClass, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4" }) });
|
|
1295
|
+
}
|
|
1296
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-2 h-2 rounded-full bg-current opacity-50" });
|
|
1278
1297
|
}
|
|
1279
1298
|
function HeaderIcon({ icon }) {
|
|
1280
1299
|
const baseClass = "w-5 h-5";
|
|
1281
|
-
if (icon === "research" || icon === "multi-agent") {
|
|
1282
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-8 h-8 rounded-lg bg-purple-500/20 flex items-center justify-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: `${baseClass} text-purple-400`, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 10V3L4 14h7v7l9-11h-7z" }) }) });
|
|
1300
|
+
if (icon === "research" || icon === "multi-agent" || icon === "agents") {
|
|
1301
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-8 h-8 rounded-lg bg-purple-100 dark:bg-purple-500/20 flex items-center justify-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: `${baseClass} text-purple-600 dark:text-purple-400`, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 10V3L4 14h7v7l9-11h-7z" }) }) });
|
|
1302
|
+
}
|
|
1303
|
+
if (icon === "schedule" || icon === "report" || icon === "calendar") {
|
|
1304
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-8 h-8 rounded-lg bg-amber-100 dark:bg-amber-500/20 flex items-center justify-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: `${baseClass} text-amber-600 dark:text-amber-400`, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }) });
|
|
1305
|
+
}
|
|
1306
|
+
if (icon === "recurring" || icon === "repeat" || icon === "sync") {
|
|
1307
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-8 h-8 rounded-lg bg-cyan-100 dark:bg-cyan-500/20 flex items-center justify-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: `${baseClass} text-cyan-600 dark:text-cyan-400`, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" }) }) });
|
|
1308
|
+
}
|
|
1309
|
+
if (icon === "analyze" || icon === "analysis" || icon === "chart") {
|
|
1310
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-8 h-8 rounded-lg bg-cyan-100 dark:bg-cyan-500/20 flex items-center justify-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: `${baseClass} text-cyan-600 dark:text-cyan-400`, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" }) }) });
|
|
1283
1311
|
}
|
|
1284
|
-
if (icon === "
|
|
1285
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-8 h-8 rounded-lg bg-
|
|
1312
|
+
if (icon === "deploy" || icon === "rocket" || icon === "launch") {
|
|
1313
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-8 h-8 rounded-lg bg-blue-100 dark:bg-blue-500/20 flex items-center justify-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: `${baseClass} text-blue-600 dark:text-blue-400`, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 10V3L4 14h7v7l9-11h-7z" }) }) });
|
|
1286
1314
|
}
|
|
1287
|
-
if (icon === "
|
|
1288
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-8 h-8 rounded-lg bg-
|
|
1315
|
+
if (icon === "automation" || icon === "workflow" || icon === "process") {
|
|
1316
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-8 h-8 rounded-lg bg-indigo-100 dark:bg-indigo-500/20 flex items-center justify-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: `${baseClass} text-indigo-600 dark:text-indigo-400`, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z" }) }) });
|
|
1289
1317
|
}
|
|
1290
|
-
if (icon === "
|
|
1291
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-8 h-8 rounded-lg bg-
|
|
1318
|
+
if (icon === "data" || icon === "pipeline" || icon === "etl") {
|
|
1319
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-8 h-8 rounded-lg bg-emerald-100 dark:bg-emerald-500/20 flex items-center justify-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: `${baseClass} text-emerald-600 dark:text-emerald-400`, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4" }) }) });
|
|
1292
1320
|
}
|
|
1293
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-8 h-8 rounded-lg bg-
|
|
1321
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "w-8 h-8 rounded-lg bg-neutral-100 dark:bg-neutral-700 flex items-center justify-center", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: `${baseClass} text-neutral-600 dark:text-neutral-300`, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2" }) }) });
|
|
1294
1322
|
}
|
|
1295
1323
|
function Chevron() {
|
|
1296
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: "w-3 h-3 text-neutral-500 flex-shrink-0", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) });
|
|
1324
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: "w-3 h-3 text-neutral-400 dark:text-neutral-500 flex-shrink-0", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) });
|
|
1297
1325
|
}
|
|
1298
|
-
function
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1326
|
+
function getStepColors(step, stepType) {
|
|
1327
|
+
if (step.color) {
|
|
1328
|
+
const colorMap = {
|
|
1329
|
+
blue: { bg: "bg-blue-50 dark:bg-blue-500/10", text: "text-blue-700 dark:text-blue-300", border: "border-blue-200 dark:border-blue-500/30" },
|
|
1330
|
+
purple: { bg: "bg-purple-50 dark:bg-purple-500/10", text: "text-purple-700 dark:text-purple-300", border: "border-purple-200 dark:border-purple-500/30" },
|
|
1331
|
+
cyan: { bg: "bg-cyan-50 dark:bg-cyan-500/10", text: "text-cyan-700 dark:text-cyan-300", border: "border-cyan-200 dark:border-cyan-500/30" },
|
|
1332
|
+
amber: { bg: "bg-amber-50 dark:bg-amber-500/10", text: "text-amber-700 dark:text-amber-300", border: "border-amber-200 dark:border-amber-500/30" },
|
|
1333
|
+
emerald: { bg: "bg-emerald-50 dark:bg-emerald-500/10", text: "text-emerald-700 dark:text-emerald-300", border: "border-emerald-200 dark:border-emerald-500/30" },
|
|
1334
|
+
rose: { bg: "bg-rose-50 dark:bg-rose-500/10", text: "text-rose-700 dark:text-rose-300", border: "border-rose-200 dark:border-rose-500/30" },
|
|
1335
|
+
indigo: { bg: "bg-indigo-50 dark:bg-indigo-500/10", text: "text-indigo-700 dark:text-indigo-300", border: "border-indigo-200 dark:border-indigo-500/30" },
|
|
1336
|
+
orange: { bg: "bg-orange-50 dark:bg-orange-500/10", text: "text-orange-700 dark:text-orange-300", border: "border-orange-200 dark:border-orange-500/30" }
|
|
1337
|
+
};
|
|
1338
|
+
return colorMap[step.color] || colorMap.blue;
|
|
1339
|
+
}
|
|
1340
|
+
if (stepType === "time" || stepType === "schedule" || stepType === "clock") {
|
|
1341
|
+
return { bg: "bg-blue-50 dark:bg-blue-500/10", text: "text-blue-700 dark:text-blue-300", border: "border-blue-200 dark:border-blue-500/30" };
|
|
1342
|
+
}
|
|
1343
|
+
if (stepType === "agent" || _optionalChain([stepType, 'optionalAccess', _30 => _30.startsWith, 'call', _31 => _31("@")])) {
|
|
1344
|
+
return { bg: "bg-purple-50 dark:bg-purple-500/10", text: "text-purple-700 dark:text-purple-300", border: "border-purple-200 dark:border-purple-500/30" };
|
|
1345
|
+
}
|
|
1346
|
+
if (stepType === "email" || stepType === "slack" || stepType === "message" || stepType === "notification") {
|
|
1347
|
+
return { bg: "bg-cyan-50 dark:bg-cyan-500/10", text: "text-cyan-700 dark:text-cyan-300", border: "border-cyan-200 dark:border-cyan-500/30" };
|
|
1348
|
+
}
|
|
1349
|
+
if (stepType === "generate" || stepType === "document" || stepType === "create") {
|
|
1350
|
+
return { bg: "bg-amber-50 dark:bg-amber-500/10", text: "text-amber-700 dark:text-amber-300", border: "border-amber-200 dark:border-amber-500/30" };
|
|
1351
|
+
}
|
|
1352
|
+
if (stepType === "deploy" || stepType === "rocket" || stepType === "launch") {
|
|
1353
|
+
return { bg: "bg-rose-50 dark:bg-rose-500/10", text: "text-rose-700 dark:text-rose-300", border: "border-rose-200 dark:border-rose-500/30" };
|
|
1354
|
+
}
|
|
1355
|
+
return { bg: "bg-neutral-50 dark:bg-neutral-800", text: "text-neutral-700 dark:text-neutral-300", border: "border-neutral-200 dark:border-neutral-700" };
|
|
1356
|
+
}
|
|
1357
|
+
function Flow({ widget }) {
|
|
1358
|
+
const { title, subtitle, icon, steps } = widget.props;
|
|
1359
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "rounded-xl bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-800 overflow-hidden shadow-sm", children: [
|
|
1318
1360
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "px-4 py-3 flex items-center gap-3", children: [
|
|
1319
1361
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, HeaderIcon, { icon }),
|
|
1320
1362
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex-1 min-w-0", children: [
|
|
1321
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "font-semibold text-sm text-white truncate", children: title }),
|
|
1322
|
-
subtitle && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-neutral-400 truncate", children: subtitle })
|
|
1323
|
-
] }),
|
|
1324
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
|
|
1325
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1326
|
-
"button",
|
|
1327
|
-
{
|
|
1328
|
-
onClick: handleDismiss,
|
|
1329
|
-
className: "p-1.5 text-neutral-500 hover:text-neutral-300 transition-colors",
|
|
1330
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
|
|
1331
|
-
}
|
|
1332
|
-
),
|
|
1333
|
-
primaryAction && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1334
|
-
"button",
|
|
1335
|
-
{
|
|
1336
|
-
onClick: () => handleAction(primaryAction.type),
|
|
1337
|
-
className: "px-3 py-1.5 bg-blue-600 hover:bg-blue-500 text-white text-xs font-medium rounded-lg flex items-center gap-1.5 transition-colors",
|
|
1338
|
-
children: [
|
|
1339
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: "w-3 h-3", fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M8 5v14l11-7z" }) }),
|
|
1340
|
-
primaryAction.label
|
|
1341
|
-
]
|
|
1342
|
-
}
|
|
1343
|
-
)
|
|
1363
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "font-semibold text-sm text-neutral-900 dark:text-white truncate", children: title }),
|
|
1364
|
+
subtitle && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-xs text-neutral-500 dark:text-neutral-400 truncate", children: subtitle })
|
|
1344
1365
|
] })
|
|
1345
1366
|
] }),
|
|
1346
1367
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "px-4 pb-4", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex flex-wrap items-center gap-2", children: steps.map((step, index) => {
|
|
@@ -1353,17 +1374,46 @@ function Flow({ widget, onAction }) {
|
|
|
1353
1374
|
let stepType = step.type;
|
|
1354
1375
|
if (!stepType) {
|
|
1355
1376
|
if (label.startsWith("@")) stepType = "agent";
|
|
1356
|
-
else if (
|
|
1357
|
-
else
|
|
1358
|
-
|
|
1377
|
+
else if (/^\d+[ap]m$/i.test(label) || /^(mon|tue|wed|thu|fri|sat|sun)/i.test(label)) stepType = "time";
|
|
1378
|
+
else {
|
|
1379
|
+
const lowerLabel = label.toLowerCase();
|
|
1380
|
+
const typeMap = {
|
|
1381
|
+
"test": "test",
|
|
1382
|
+
"build": "build",
|
|
1383
|
+
"push": "push",
|
|
1384
|
+
"deploy": "deploy",
|
|
1385
|
+
"email": "email",
|
|
1386
|
+
"slack": "slack",
|
|
1387
|
+
"generate": "generate",
|
|
1388
|
+
"review": "review",
|
|
1389
|
+
"analyze": "analyze",
|
|
1390
|
+
"scrape": "scrape",
|
|
1391
|
+
"transform": "transform",
|
|
1392
|
+
"notify": "notification",
|
|
1393
|
+
"alert": "notification",
|
|
1394
|
+
"webhook": "webhook",
|
|
1395
|
+
"api": "api",
|
|
1396
|
+
"data": "data",
|
|
1397
|
+
"process": "process"
|
|
1398
|
+
};
|
|
1399
|
+
stepType = typeMap[lowerLabel];
|
|
1359
1400
|
}
|
|
1360
1401
|
}
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1402
|
+
let pillClasses;
|
|
1403
|
+
if (isActive) {
|
|
1404
|
+
pillClasses = "bg-blue-100 dark:bg-blue-500/20 text-blue-700 dark:text-blue-300 border-blue-300 dark:border-blue-500/50 ring-2 ring-blue-300 dark:ring-blue-500/30";
|
|
1405
|
+
} else if (isCompleted) {
|
|
1406
|
+
pillClasses = "bg-emerald-50 dark:bg-emerald-500/15 text-emerald-700 dark:text-emerald-300 border-emerald-200 dark:border-emerald-500/30";
|
|
1407
|
+
} else if (isError) {
|
|
1408
|
+
pillClasses = "bg-red-50 dark:bg-red-500/15 text-red-700 dark:text-red-300 border-red-200 dark:border-red-500/30";
|
|
1409
|
+
} else if (isSkipped) {
|
|
1410
|
+
pillClasses = "bg-neutral-100 dark:bg-neutral-700/50 text-neutral-400 dark:text-neutral-500 border-neutral-200 dark:border-neutral-600 line-through";
|
|
1411
|
+
} else {
|
|
1412
|
+
const colors = getStepColors(step, stepType);
|
|
1413
|
+
pillClasses = `${colors.bg} ${colors.text} ${colors.border}`;
|
|
1414
|
+
}
|
|
1365
1415
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2", children: [
|
|
1366
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: pillClasses
|
|
1416
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "span", { className: `inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-all ${pillClasses}`, children: [
|
|
1367
1417
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, StepIcon, { type: stepType, status: step.status }),
|
|
1368
1418
|
label
|
|
1369
1419
|
] }),
|
|
@@ -1420,7 +1470,7 @@ function Widgets({
|
|
|
1420
1470
|
}) {
|
|
1421
1471
|
_react.useEffect.call(void 0, () => {
|
|
1422
1472
|
widgets.forEach((widget) => {
|
|
1423
|
-
_optionalChain([onWidgetMount, 'optionalCall',
|
|
1473
|
+
_optionalChain([onWidgetMount, 'optionalCall', _32 => _32(widget.id)]);
|
|
1424
1474
|
});
|
|
1425
1475
|
}, [widgets, onWidgetMount]);
|
|
1426
1476
|
const layoutClasses = {
|
|
@@ -1746,8 +1796,8 @@ function ToolCall({ name, status, isReceiving = false, inputLength = 0, streamOu
|
|
|
1746
1796
|
|
|
1747
1797
|
function Message({ message, onAction, enableWidgets, onWidgetRender }) {
|
|
1748
1798
|
const isUser = message.role === "user";
|
|
1749
|
-
const contentSegments = _optionalChain([message, 'access',
|
|
1750
|
-
const isStreaming = _optionalChain([message, 'access',
|
|
1799
|
+
const contentSegments = _optionalChain([message, 'access', _33 => _33.metadata, 'optionalAccess', _34 => _34.content_segments]);
|
|
1800
|
+
const isStreaming = _optionalChain([message, 'access', _35 => _35.metadata, 'optionalAccess', _36 => _36.isStreaming]) === true;
|
|
1751
1801
|
const hasContent = message.content || contentSegments && contentSegments.length > 0;
|
|
1752
1802
|
const reportedWidgetsRef = _react.useRef.call(void 0, /* @__PURE__ */ new Set());
|
|
1753
1803
|
const parsedWidgets = _react.useMemo.call(void 0, () => {
|
|
@@ -1827,7 +1877,7 @@ function Message({ message, onAction, enableWidgets, onWidgetRender }) {
|
|
|
1827
1877
|
}
|
|
1828
1878
|
return elements.length > 0 ? elements : null;
|
|
1829
1879
|
};
|
|
1830
|
-
const attachments = _optionalChain([message, 'access',
|
|
1880
|
+
const attachments = _optionalChain([message, 'access', _37 => _37.metadata, 'optionalAccess', _38 => _38.attachments]) || [];
|
|
1831
1881
|
const hasAttachments = attachments.length > 0;
|
|
1832
1882
|
const renderAttachments = () => {
|
|
1833
1883
|
if (!hasAttachments) return null;
|
|
@@ -2234,7 +2284,7 @@ function Composer({ onSendMessage, placeholder = "Type a message...", disabled =
|
|
|
2234
2284
|
setFileError(errors.join(", "));
|
|
2235
2285
|
setTimeout(() => setFileError(null), 5e3);
|
|
2236
2286
|
}
|
|
2237
|
-
_optionalChain([onFileUpload, 'optionalCall',
|
|
2287
|
+
_optionalChain([onFileUpload, 'optionalCall', _39 => _39(e.target.files)]);
|
|
2238
2288
|
setShowMenu(false);
|
|
2239
2289
|
e.target.value = "";
|
|
2240
2290
|
}
|
|
@@ -2304,15 +2354,15 @@ function Composer({ onSendMessage, placeholder = "Type a message...", disabled =
|
|
|
2304
2354
|
{
|
|
2305
2355
|
className: "apteva-composer-menu fixed bg-neutral-800 dark:bg-neutral-800 rounded-xl shadow-lg overflow-hidden z-[9999] min-w-[200px]",
|
|
2306
2356
|
style: {
|
|
2307
|
-
left: _nullishCoalesce(_optionalChain([menuButtonRef, 'access',
|
|
2308
|
-
top: (_nullishCoalesce(_optionalChain([menuButtonRef, 'access',
|
|
2357
|
+
left: _nullishCoalesce(_optionalChain([menuButtonRef, 'access', _40 => _40.current, 'optionalAccess', _41 => _41.getBoundingClientRect, 'call', _42 => _42(), 'access', _43 => _43.left]), () => ( 0)),
|
|
2358
|
+
top: (_nullishCoalesce(_optionalChain([menuButtonRef, 'access', _44 => _44.current, 'optionalAccess', _45 => _45.getBoundingClientRect, 'call', _46 => _46(), 'access', _47 => _47.bottom]), () => ( 0))) + 8
|
|
2309
2359
|
},
|
|
2310
2360
|
children: [
|
|
2311
2361
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2312
2362
|
"button",
|
|
2313
2363
|
{
|
|
2314
2364
|
onClick: () => {
|
|
2315
|
-
_optionalChain([fileInputRef, 'access',
|
|
2365
|
+
_optionalChain([fileInputRef, 'access', _48 => _48.current, 'optionalAccess', _49 => _49.click, 'call', _50 => _50()]);
|
|
2316
2366
|
setShowMenu(false);
|
|
2317
2367
|
},
|
|
2318
2368
|
className: "w-full flex items-center gap-3 px-4 py-3 hover:bg-neutral-700 dark:hover:bg-neutral-700 transition-colors !text-white text-left",
|
|
@@ -2430,8 +2480,8 @@ function CommandComposer({
|
|
|
2430
2480
|
}
|
|
2431
2481
|
};
|
|
2432
2482
|
const handleNewCommand = () => {
|
|
2433
|
-
_optionalChain([onReset, 'optionalCall',
|
|
2434
|
-
_optionalChain([inputRef, 'access',
|
|
2483
|
+
_optionalChain([onReset, 'optionalCall', _51 => _51()]);
|
|
2484
|
+
_optionalChain([inputRef, 'access', _52 => _52.current, 'optionalAccess', _53 => _53.focus, 'call', _54 => _54()]);
|
|
2435
2485
|
};
|
|
2436
2486
|
const handleInputChange = (value) => {
|
|
2437
2487
|
setInput(value);
|
|
@@ -2545,15 +2595,15 @@ function CommandComposer({
|
|
|
2545
2595
|
{
|
|
2546
2596
|
className: "apteva-composer-menu fixed bg-neutral-800 dark:bg-neutral-800 rounded-xl shadow-lg overflow-hidden z-[9999] min-w-[200px]",
|
|
2547
2597
|
style: {
|
|
2548
|
-
left: _nullishCoalesce(_optionalChain([menuButtonRef, 'access',
|
|
2549
|
-
top: (_nullishCoalesce(_optionalChain([menuButtonRef, 'access',
|
|
2598
|
+
left: _nullishCoalesce(_optionalChain([menuButtonRef, 'access', _55 => _55.current, 'optionalAccess', _56 => _56.getBoundingClientRect, 'call', _57 => _57(), 'access', _58 => _58.left]), () => ( 0)),
|
|
2599
|
+
top: (_nullishCoalesce(_optionalChain([menuButtonRef, 'access', _59 => _59.current, 'optionalAccess', _60 => _60.getBoundingClientRect, 'call', _61 => _61(), 'access', _62 => _62.bottom]), () => ( 0))) + 8
|
|
2550
2600
|
},
|
|
2551
2601
|
children: [
|
|
2552
2602
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
2553
2603
|
"button",
|
|
2554
2604
|
{
|
|
2555
2605
|
onClick: () => {
|
|
2556
|
-
_optionalChain([fileInputRef, 'access',
|
|
2606
|
+
_optionalChain([fileInputRef, 'access', _63 => _63.current, 'optionalAccess', _64 => _64.click, 'call', _65 => _65()]);
|
|
2557
2607
|
setShowMenu(false);
|
|
2558
2608
|
},
|
|
2559
2609
|
className: "w-full flex items-center gap-3 px-4 py-3 hover:bg-neutral-700 dark:hover:bg-neutral-700 transition-colors !text-white text-left",
|
|
@@ -2794,7 +2844,7 @@ var AptevaClient = class {
|
|
|
2794
2844
|
const error = await response.json().catch(() => ({ error: "Request failed" }));
|
|
2795
2845
|
throw new Error(error.error || `Request failed with status ${response.status}`);
|
|
2796
2846
|
}
|
|
2797
|
-
const reader = _optionalChain([response, 'access',
|
|
2847
|
+
const reader = _optionalChain([response, 'access', _66 => _66.body, 'optionalAccess', _67 => _67.getReader, 'call', _68 => _68()]);
|
|
2798
2848
|
if (!reader) {
|
|
2799
2849
|
throw new Error("Response body is not readable");
|
|
2800
2850
|
}
|
|
@@ -2812,7 +2862,7 @@ var AptevaClient = class {
|
|
|
2812
2862
|
if (line.startsWith("data: ")) {
|
|
2813
2863
|
const data = line.slice(6);
|
|
2814
2864
|
if (data === "[DONE]") {
|
|
2815
|
-
_optionalChain([onComplete, 'optionalCall',
|
|
2865
|
+
_optionalChain([onComplete, 'optionalCall', _69 => _69(threadId)]);
|
|
2816
2866
|
return;
|
|
2817
2867
|
}
|
|
2818
2868
|
try {
|
|
@@ -2827,10 +2877,10 @@ var AptevaClient = class {
|
|
|
2827
2877
|
}
|
|
2828
2878
|
}
|
|
2829
2879
|
}
|
|
2830
|
-
_optionalChain([onComplete, 'optionalCall',
|
|
2880
|
+
_optionalChain([onComplete, 'optionalCall', _70 => _70(threadId)]);
|
|
2831
2881
|
} catch (error) {
|
|
2832
2882
|
const err = error instanceof Error ? error : new Error("Unknown error");
|
|
2833
|
-
_optionalChain([onError, 'optionalCall',
|
|
2883
|
+
_optionalChain([onError, 'optionalCall', _71 => _71(err)]);
|
|
2834
2884
|
throw err;
|
|
2835
2885
|
}
|
|
2836
2886
|
}
|
|
@@ -2990,7 +3040,7 @@ ${widgetContext}` : widgetContext;
|
|
|
2990
3040
|
}, [apiUrl, apiKey]);
|
|
2991
3041
|
_react.useEffect.call(void 0, () => {
|
|
2992
3042
|
if (threadId) {
|
|
2993
|
-
_optionalChain([onThreadChange, 'optionalCall',
|
|
3043
|
+
_optionalChain([onThreadChange, 'optionalCall', _72 => _72(threadId)]);
|
|
2994
3044
|
}
|
|
2995
3045
|
}, [threadId, onThreadChange]);
|
|
2996
3046
|
_react.useEffect.call(void 0, () => {
|
|
@@ -3008,7 +3058,7 @@ ${widgetContext}` : widgetContext;
|
|
|
3008
3058
|
}, [showSettingsMenu]);
|
|
3009
3059
|
const handleModeChange = (newMode) => {
|
|
3010
3060
|
setMode(newMode);
|
|
3011
|
-
_optionalChain([onModeChange, 'optionalCall',
|
|
3061
|
+
_optionalChain([onModeChange, 'optionalCall', _73 => _73(newMode)]);
|
|
3012
3062
|
if (newMode === "command") {
|
|
3013
3063
|
setCommandState("idle");
|
|
3014
3064
|
setCommandResult(null);
|
|
@@ -3033,7 +3083,7 @@ ${widgetContext}` : widgetContext;
|
|
|
3033
3083
|
metadata: hasFiles ? { attachments } : void 0
|
|
3034
3084
|
};
|
|
3035
3085
|
setMessages((prev) => [...prev, userMessage]);
|
|
3036
|
-
_optionalChain([onMessageSent, 'optionalCall',
|
|
3086
|
+
_optionalChain([onMessageSent, 'optionalCall', _74 => _74(userMessage)]);
|
|
3037
3087
|
}
|
|
3038
3088
|
setIsLoading(true);
|
|
3039
3089
|
try {
|
|
@@ -3101,7 +3151,7 @@ ${widgetContext}` : widgetContext;
|
|
|
3101
3151
|
responseThreadId = chunk.thread_id;
|
|
3102
3152
|
if (!currentThreadId) {
|
|
3103
3153
|
setCurrentThreadId(chunk.thread_id);
|
|
3104
|
-
_optionalChain([onThreadChange, 'optionalCall',
|
|
3154
|
+
_optionalChain([onThreadChange, 'optionalCall', _75 => _75(chunk.thread_id)]);
|
|
3105
3155
|
}
|
|
3106
3156
|
}
|
|
3107
3157
|
break;
|
|
@@ -3127,7 +3177,7 @@ ${widgetContext}` : widgetContext;
|
|
|
3127
3177
|
contentSegments.push({ type: "tool", id: chunk.tool_id, name: displayName, status: "preparing" });
|
|
3128
3178
|
toolInputBuffers[chunk.tool_id] = "";
|
|
3129
3179
|
setChatToolName(displayName);
|
|
3130
|
-
_optionalChain([onToolCall, 'optionalCall',
|
|
3180
|
+
_optionalChain([onToolCall, 'optionalCall', _76 => _76(chunk.tool_name, chunk.tool_id)]);
|
|
3131
3181
|
updateMessage();
|
|
3132
3182
|
}
|
|
3133
3183
|
break;
|
|
@@ -3187,7 +3237,7 @@ ${widgetContext}` : widgetContext;
|
|
|
3187
3237
|
toolSegment.result = chunk.content;
|
|
3188
3238
|
toolSegment.status = "completed";
|
|
3189
3239
|
toolSegment.isReceiving = false;
|
|
3190
|
-
_optionalChain([onToolResult, 'optionalCall',
|
|
3240
|
+
_optionalChain([onToolResult, 'optionalCall', _77 => _77(toolSegment.name, chunk.content)]);
|
|
3191
3241
|
}
|
|
3192
3242
|
setChatToolName(null);
|
|
3193
3243
|
updateMessage();
|
|
@@ -3230,7 +3280,7 @@ ${widgetContext}` : widgetContext;
|
|
|
3230
3280
|
});
|
|
3231
3281
|
if (threadId2 && threadId2 !== currentThreadId) {
|
|
3232
3282
|
setCurrentThreadId(threadId2);
|
|
3233
|
-
_optionalChain([onThreadChange, 'optionalCall',
|
|
3283
|
+
_optionalChain([onThreadChange, 'optionalCall', _78 => _78(threadId2)]);
|
|
3234
3284
|
}
|
|
3235
3285
|
setIsLoading(false);
|
|
3236
3286
|
setCurrentRequestId(null);
|
|
@@ -3254,7 +3304,7 @@ ${widgetContext}` : widgetContext;
|
|
|
3254
3304
|
setIsLoading(false);
|
|
3255
3305
|
setCurrentRequestId(null);
|
|
3256
3306
|
setChatToolName(null);
|
|
3257
|
-
_optionalChain([onError, 'optionalCall',
|
|
3307
|
+
_optionalChain([onError, 'optionalCall', _79 => _79(error)]);
|
|
3258
3308
|
}
|
|
3259
3309
|
);
|
|
3260
3310
|
}
|
|
@@ -3267,7 +3317,7 @@ ${widgetContext}` : widgetContext;
|
|
|
3267
3317
|
metadata: { error: true }
|
|
3268
3318
|
};
|
|
3269
3319
|
setMessages((prev) => [...prev, errorMessage]);
|
|
3270
|
-
_optionalChain([onError, 'optionalCall',
|
|
3320
|
+
_optionalChain([onError, 'optionalCall', _80 => _80(error instanceof Error ? error : new Error("Unknown error"))]);
|
|
3271
3321
|
} finally {
|
|
3272
3322
|
setIsLoading(false);
|
|
3273
3323
|
}
|
|
@@ -3313,7 +3363,7 @@ ${planningInstruction}` : planningInstruction;
|
|
|
3313
3363
|
const error = err instanceof Error ? err : new Error("Failed to generate plan");
|
|
3314
3364
|
setCommandError(error);
|
|
3315
3365
|
setCommandState("error");
|
|
3316
|
-
_optionalChain([onError, 'optionalCall',
|
|
3366
|
+
_optionalChain([onError, 'optionalCall', _81 => _81(error)]);
|
|
3317
3367
|
}
|
|
3318
3368
|
}
|
|
3319
3369
|
return;
|
|
@@ -3346,12 +3396,12 @@ ${planningInstruction}` : planningInstruction;
|
|
|
3346
3396
|
setCommandResult(result);
|
|
3347
3397
|
setCommandState("success");
|
|
3348
3398
|
setProgress(100);
|
|
3349
|
-
_optionalChain([onComplete, 'optionalCall',
|
|
3399
|
+
_optionalChain([onComplete, 'optionalCall', _82 => _82(result)]);
|
|
3350
3400
|
},
|
|
3351
3401
|
(error) => {
|
|
3352
3402
|
setCommandError(error);
|
|
3353
3403
|
setCommandState("error");
|
|
3354
|
-
_optionalChain([onError, 'optionalCall',
|
|
3404
|
+
_optionalChain([onError, 'optionalCall', _83 => _83(error)]);
|
|
3355
3405
|
}
|
|
3356
3406
|
);
|
|
3357
3407
|
} else {
|
|
@@ -3364,7 +3414,7 @@ ${planningInstruction}` : planningInstruction;
|
|
|
3364
3414
|
setCommandResult(result);
|
|
3365
3415
|
setCommandState("success");
|
|
3366
3416
|
setProgress(100);
|
|
3367
|
-
_optionalChain([onComplete, 'optionalCall',
|
|
3417
|
+
_optionalChain([onComplete, 'optionalCall', _84 => _84(result)]);
|
|
3368
3418
|
}
|
|
3369
3419
|
} else {
|
|
3370
3420
|
const commandInstruction = `CRITICAL COMMAND MODE: Maximum 10 words per response. Execute the command immediately. Make reasonable assumptions based on context. Use sensible defaults for missing details. DO NOT ask questions unless something is truly impossible without user input (e.g., missing required password). State what you're doing or the result. Examples: "Analyzing customer data from last quarter..." or "Created 5 new database entries successfully" or "Search complete: found 12 matching results". NO greetings, NO filler words, NO clarification requests. Action/result only.`;
|
|
@@ -3394,16 +3444,16 @@ ${commandInstruction}` : commandInstruction;
|
|
|
3394
3444
|
const displayName = chunk.tool_display_name || chunk.tool_name;
|
|
3395
3445
|
lastToolName = chunk.tool_name;
|
|
3396
3446
|
setCurrentToolName(displayName);
|
|
3397
|
-
_optionalChain([onToolCall, 'optionalCall',
|
|
3447
|
+
_optionalChain([onToolCall, 'optionalCall', _85 => _85(chunk.tool_name, chunk.tool_id || "")]);
|
|
3398
3448
|
accumulatedContent = "";
|
|
3399
3449
|
setStreamedContent("");
|
|
3400
3450
|
} else if (chunk.type === "tool_result") {
|
|
3401
|
-
_optionalChain([onToolResult, 'optionalCall',
|
|
3451
|
+
_optionalChain([onToolResult, 'optionalCall', _86 => _86(lastToolName, chunk.content)]);
|
|
3402
3452
|
setCurrentToolName(null);
|
|
3403
3453
|
} else if (chunk.type === "thread_id" && chunk.thread_id) {
|
|
3404
3454
|
if (!currentThreadId) {
|
|
3405
3455
|
setCurrentThreadId(chunk.thread_id);
|
|
3406
|
-
_optionalChain([onThreadChange, 'optionalCall',
|
|
3456
|
+
_optionalChain([onThreadChange, 'optionalCall', _87 => _87(chunk.thread_id)]);
|
|
3407
3457
|
}
|
|
3408
3458
|
} else if (chunk.type === "request_id" && chunk.request_id) {
|
|
3409
3459
|
setCurrentRequestId(chunk.request_id);
|
|
@@ -3419,13 +3469,13 @@ ${commandInstruction}` : commandInstruction;
|
|
|
3419
3469
|
setCommandState("success");
|
|
3420
3470
|
setProgress(100);
|
|
3421
3471
|
setCurrentRequestId(null);
|
|
3422
|
-
_optionalChain([onComplete, 'optionalCall',
|
|
3472
|
+
_optionalChain([onComplete, 'optionalCall', _88 => _88(result)]);
|
|
3423
3473
|
},
|
|
3424
3474
|
(error) => {
|
|
3425
3475
|
setCommandError(error);
|
|
3426
3476
|
setCommandState("error");
|
|
3427
3477
|
setCurrentRequestId(null);
|
|
3428
|
-
_optionalChain([onError, 'optionalCall',
|
|
3478
|
+
_optionalChain([onError, 'optionalCall', _89 => _89(error)]);
|
|
3429
3479
|
}
|
|
3430
3480
|
);
|
|
3431
3481
|
} else {
|
|
@@ -3445,14 +3495,14 @@ ${commandInstruction}` : commandInstruction;
|
|
|
3445
3495
|
setCommandResult(result);
|
|
3446
3496
|
setCommandState("success");
|
|
3447
3497
|
setProgress(100);
|
|
3448
|
-
_optionalChain([onComplete, 'optionalCall',
|
|
3498
|
+
_optionalChain([onComplete, 'optionalCall', _90 => _90(result)]);
|
|
3449
3499
|
}
|
|
3450
3500
|
}
|
|
3451
3501
|
} catch (err) {
|
|
3452
3502
|
const error = err instanceof Error ? err : new Error("Unknown error");
|
|
3453
3503
|
setCommandError(error);
|
|
3454
3504
|
setCommandState("error");
|
|
3455
|
-
_optionalChain([onError, 'optionalCall',
|
|
3505
|
+
_optionalChain([onError, 'optionalCall', _91 => _91(error)]);
|
|
3456
3506
|
}
|
|
3457
3507
|
};
|
|
3458
3508
|
const resetCommand = () => {
|
|
@@ -3544,8 +3594,8 @@ ${planToExecute}`;
|
|
|
3544
3594
|
executeCommand(text, files);
|
|
3545
3595
|
},
|
|
3546
3596
|
state: commandState,
|
|
3547
|
-
response: _optionalChain([commandResult, 'optionalAccess',
|
|
3548
|
-
error: _optionalChain([commandError, 'optionalAccess',
|
|
3597
|
+
response: _optionalChain([commandResult, 'optionalAccess', _92 => _92.data, 'optionalAccess', _93 => _93.summary]) || _optionalChain([commandResult, 'optionalAccess', _94 => _94.message]),
|
|
3598
|
+
error: _optionalChain([commandError, 'optionalAccess', _95 => _95.message]),
|
|
3549
3599
|
plan,
|
|
3550
3600
|
streamedContent,
|
|
3551
3601
|
toolName: currentToolName,
|
|
@@ -3713,13 +3763,13 @@ ${planningInstruction}` : planningInstruction;
|
|
|
3713
3763
|
const error2 = err instanceof Error ? err : new Error("Failed to generate plan");
|
|
3714
3764
|
setError(error2);
|
|
3715
3765
|
setState("error");
|
|
3716
|
-
_optionalChain([onError, 'optionalCall',
|
|
3766
|
+
_optionalChain([onError, 'optionalCall', _96 => _96(error2)]);
|
|
3717
3767
|
});
|
|
3718
3768
|
} catch (err) {
|
|
3719
3769
|
const error2 = err instanceof Error ? err : new Error("Failed to generate plan");
|
|
3720
3770
|
setError(error2);
|
|
3721
3771
|
setState("error");
|
|
3722
|
-
_optionalChain([onError, 'optionalCall',
|
|
3772
|
+
_optionalChain([onError, 'optionalCall', _97 => _97(error2)]);
|
|
3723
3773
|
}
|
|
3724
3774
|
}
|
|
3725
3775
|
return;
|
|
@@ -3730,7 +3780,7 @@ ${planningInstruction}` : planningInstruction;
|
|
|
3730
3780
|
setStreamedContent("");
|
|
3731
3781
|
setCommand("");
|
|
3732
3782
|
setUploadedFiles([]);
|
|
3733
|
-
_optionalChain([onStart, 'optionalCall',
|
|
3783
|
+
_optionalChain([onStart, 'optionalCall', _98 => _98()]);
|
|
3734
3784
|
try {
|
|
3735
3785
|
if (useMock) {
|
|
3736
3786
|
if (enableStreaming) {
|
|
@@ -3741,16 +3791,16 @@ ${planningInstruction}` : planningInstruction;
|
|
|
3741
3791
|
if (chunk.type === "token" && chunk.content) {
|
|
3742
3792
|
accumulatedContent += chunk.content;
|
|
3743
3793
|
setStreamedContent(accumulatedContent);
|
|
3744
|
-
_optionalChain([onChunk, 'optionalCall',
|
|
3794
|
+
_optionalChain([onChunk, 'optionalCall', _99 => _99(chunk.content)]);
|
|
3745
3795
|
const estimatedProgress = Math.min(Math.round(accumulatedContent.length / 10), 90);
|
|
3746
3796
|
setProgress(estimatedProgress);
|
|
3747
|
-
_optionalChain([onProgress, 'optionalCall',
|
|
3797
|
+
_optionalChain([onProgress, 'optionalCall', _100 => _100(estimatedProgress)]);
|
|
3748
3798
|
} else if (chunk.type === "widget" && chunk.widget) {
|
|
3749
3799
|
const widget = chunk.widget;
|
|
3750
3800
|
setResult((prev) => ({
|
|
3751
3801
|
success: true,
|
|
3752
|
-
data: _optionalChain([prev, 'optionalAccess',
|
|
3753
|
-
widgets: [..._optionalChain([prev, 'optionalAccess',
|
|
3802
|
+
data: _optionalChain([prev, 'optionalAccess', _101 => _101.data]) || {},
|
|
3803
|
+
widgets: [..._optionalChain([prev, 'optionalAccess', _102 => _102.widgets]) || [], widget],
|
|
3754
3804
|
message: accumulatedContent || "Command executed successfully"
|
|
3755
3805
|
}));
|
|
3756
3806
|
}
|
|
@@ -3770,19 +3820,19 @@ ${planningInstruction}` : planningInstruction;
|
|
|
3770
3820
|
setResult(result2);
|
|
3771
3821
|
setState("success");
|
|
3772
3822
|
setProgress(100);
|
|
3773
|
-
_optionalChain([onComplete, 'optionalCall',
|
|
3823
|
+
_optionalChain([onComplete, 'optionalCall', _103 => _103(result2)]);
|
|
3774
3824
|
},
|
|
3775
3825
|
(error2) => {
|
|
3776
3826
|
setError(error2);
|
|
3777
3827
|
setState("error");
|
|
3778
|
-
_optionalChain([onError, 'optionalCall',
|
|
3828
|
+
_optionalChain([onError, 'optionalCall', _104 => _104(error2)]);
|
|
3779
3829
|
}
|
|
3780
3830
|
);
|
|
3781
3831
|
} else {
|
|
3782
3832
|
const progressInterval = setInterval(() => {
|
|
3783
3833
|
setProgress((prev) => {
|
|
3784
3834
|
const next = Math.min(prev + 10, 90);
|
|
3785
|
-
_optionalChain([onProgress, 'optionalCall',
|
|
3835
|
+
_optionalChain([onProgress, 'optionalCall', _105 => _105(next)]);
|
|
3786
3836
|
return next;
|
|
3787
3837
|
});
|
|
3788
3838
|
}, 200);
|
|
@@ -3806,7 +3856,7 @@ ${planningInstruction}` : planningInstruction;
|
|
|
3806
3856
|
setResult(result2);
|
|
3807
3857
|
setState("success");
|
|
3808
3858
|
setProgress(100);
|
|
3809
|
-
_optionalChain([onComplete, 'optionalCall',
|
|
3859
|
+
_optionalChain([onComplete, 'optionalCall', _106 => _106(result2)]);
|
|
3810
3860
|
}
|
|
3811
3861
|
} else {
|
|
3812
3862
|
if (enableStreaming) {
|
|
@@ -3852,16 +3902,16 @@ ${commandInstruction}` : commandInstruction;
|
|
|
3852
3902
|
if (chunk.type === "token" && chunk.content) {
|
|
3853
3903
|
accumulatedContent += chunk.content;
|
|
3854
3904
|
setStreamedContent(accumulatedContent);
|
|
3855
|
-
_optionalChain([onChunk, 'optionalCall',
|
|
3905
|
+
_optionalChain([onChunk, 'optionalCall', _107 => _107(chunk.content)]);
|
|
3856
3906
|
const estimatedProgress = Math.min(Math.round(accumulatedContent.length / 10), 90);
|
|
3857
3907
|
setProgress(estimatedProgress);
|
|
3858
|
-
_optionalChain([onProgress, 'optionalCall',
|
|
3908
|
+
_optionalChain([onProgress, 'optionalCall', _108 => _108(estimatedProgress)]);
|
|
3859
3909
|
} else if (chunk.type === "widget" && chunk.widget) {
|
|
3860
3910
|
const widget = chunk.widget;
|
|
3861
3911
|
setResult((prev) => ({
|
|
3862
3912
|
success: true,
|
|
3863
|
-
data: _optionalChain([prev, 'optionalAccess',
|
|
3864
|
-
widgets: [..._optionalChain([prev, 'optionalAccess',
|
|
3913
|
+
data: _optionalChain([prev, 'optionalAccess', _109 => _109.data]) || {},
|
|
3914
|
+
widgets: [..._optionalChain([prev, 'optionalAccess', _110 => _110.widgets]) || [], widget],
|
|
3865
3915
|
message: accumulatedContent || "Command executed successfully"
|
|
3866
3916
|
}));
|
|
3867
3917
|
}
|
|
@@ -3881,20 +3931,20 @@ ${commandInstruction}` : commandInstruction;
|
|
|
3881
3931
|
setResult(result2);
|
|
3882
3932
|
setState("success");
|
|
3883
3933
|
setProgress(100);
|
|
3884
|
-
_optionalChain([onComplete, 'optionalCall',
|
|
3934
|
+
_optionalChain([onComplete, 'optionalCall', _111 => _111(result2)]);
|
|
3885
3935
|
},
|
|
3886
3936
|
(error2) => {
|
|
3887
3937
|
const err = error2 instanceof Error ? error2 : new Error("Unknown error");
|
|
3888
3938
|
setError(err);
|
|
3889
3939
|
setState("error");
|
|
3890
|
-
_optionalChain([onError, 'optionalCall',
|
|
3940
|
+
_optionalChain([onError, 'optionalCall', _112 => _112(err)]);
|
|
3891
3941
|
}
|
|
3892
3942
|
);
|
|
3893
3943
|
} else {
|
|
3894
3944
|
const progressInterval = setInterval(() => {
|
|
3895
3945
|
setProgress((prev) => {
|
|
3896
3946
|
const next = Math.min(prev + 10, 90);
|
|
3897
|
-
_optionalChain([onProgress, 'optionalCall',
|
|
3947
|
+
_optionalChain([onProgress, 'optionalCall', _113 => _113(next)]);
|
|
3898
3948
|
return next;
|
|
3899
3949
|
});
|
|
3900
3950
|
}, 200);
|
|
@@ -3950,14 +4000,14 @@ ${commandInstruction}` : commandInstruction;
|
|
|
3950
4000
|
setResult(result2);
|
|
3951
4001
|
setState("success");
|
|
3952
4002
|
setProgress(100);
|
|
3953
|
-
_optionalChain([onComplete, 'optionalCall',
|
|
4003
|
+
_optionalChain([onComplete, 'optionalCall', _114 => _114(result2)]);
|
|
3954
4004
|
}
|
|
3955
4005
|
}
|
|
3956
4006
|
} catch (err) {
|
|
3957
4007
|
const error2 = err instanceof Error ? err : new Error("Unknown error");
|
|
3958
4008
|
setError(error2);
|
|
3959
4009
|
setState("error");
|
|
3960
|
-
_optionalChain([onError, 'optionalCall',
|
|
4010
|
+
_optionalChain([onError, 'optionalCall', _115 => _115(error2)]);
|
|
3961
4011
|
}
|
|
3962
4012
|
};
|
|
3963
4013
|
const resetCommand = () => {
|
|
@@ -3990,14 +4040,14 @@ ${planToExecute}`;
|
|
|
3990
4040
|
};
|
|
3991
4041
|
const handleFileSelect = async (e) => {
|
|
3992
4042
|
if (e.target.files && e.target.files.length > 0) {
|
|
3993
|
-
_optionalChain([onFileUpload, 'optionalCall',
|
|
4043
|
+
_optionalChain([onFileUpload, 'optionalCall', _116 => _116(e.target.files)]);
|
|
3994
4044
|
const files = [];
|
|
3995
4045
|
for (let i = 0; i < e.target.files.length; i++) {
|
|
3996
4046
|
const file = e.target.files[i];
|
|
3997
4047
|
const reader = new FileReader();
|
|
3998
4048
|
await new Promise((resolve) => {
|
|
3999
4049
|
reader.onload = (event) => {
|
|
4000
|
-
if (_optionalChain([event, 'access',
|
|
4050
|
+
if (_optionalChain([event, 'access', _117 => _117.target, 'optionalAccess', _118 => _118.result])) {
|
|
4001
4051
|
const fullDataUrl = event.target.result;
|
|
4002
4052
|
const base64Data = fullDataUrl.split(",")[1];
|
|
4003
4053
|
if (file.type.startsWith("image/")) {
|
|
@@ -4091,7 +4141,7 @@ ${planToExecute}`;
|
|
|
4091
4141
|
enableFileUpload && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4092
4142
|
"button",
|
|
4093
4143
|
{
|
|
4094
|
-
onClick: () => _optionalChain([fileInputRef, 'access',
|
|
4144
|
+
onClick: () => _optionalChain([fileInputRef, 'access', _119 => _119.current, 'optionalAccess', _120 => _120.click, 'call', _121 => _121()]),
|
|
4095
4145
|
className: "w-8 h-8 rounded-lg flex items-center justify-center transition-all flex-shrink-0 !text-neutral-500 dark:!text-neutral-500 hover:bg-neutral-100 dark:hover:bg-neutral-800",
|
|
4096
4146
|
title: "Attach file",
|
|
4097
4147
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M8.4 2.8L4.4 6.8C3.736 7.464 3.736 8.536 4.4 9.2C5.064 9.864 6.136 9.864 6.8 9.2L11.6 4.4C12.704 3.296 12.704 1.504 11.6 0.4C10.496 -0.704 8.704 -0.704 7.6 0.4L2.8 5.2C1.256 6.744 1.256 9.256 2.8 10.8C4.344 12.344 6.856 12.344 8.4 10.8L12.4 6.8", stroke: "currentColor", strokeWidth: "1.2", strokeLinecap: "round", strokeLinejoin: "round", transform: "translate(1.6, 2.4)" }) })
|
|
@@ -4310,7 +4360,7 @@ ${planToExecute}`;
|
|
|
4310
4360
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { className: "w-5 h-5 text-red-600 mt-0.5 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }),
|
|
4311
4361
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { children: [
|
|
4312
4362
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "h3", { className: "text-sm font-semibold text-red-800 dark:text-red-400", children: "Error" }),
|
|
4313
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-red-700 dark:text-red-300 text-sm mt-1", children: _optionalChain([error, 'optionalAccess',
|
|
4363
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-red-700 dark:text-red-300 text-sm mt-1", children: _optionalChain([error, 'optionalAccess', _122 => _122.message]) })
|
|
4314
4364
|
] })
|
|
4315
4365
|
] }) }),
|
|
4316
4366
|
allowInput && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -4338,7 +4388,7 @@ ${planToExecute}`;
|
|
|
4338
4388
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-green-700 dark:text-green-300 text-sm", children: "Command executed successfully" })
|
|
4339
4389
|
] })
|
|
4340
4390
|
] }),
|
|
4341
|
-
_optionalChain([result, 'access',
|
|
4391
|
+
_optionalChain([result, 'access', _123 => _123.data, 'optionalAccess', _124 => _124.summary]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "text-neutral-700 dark:text-neutral-300 text-sm leading-relaxed whitespace-pre-line", children: result.data.summary }),
|
|
4342
4392
|
result.widgets && result.widgets.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "space-y-3", children: result.widgets.map((widget) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4343
4393
|
WidgetRenderer,
|
|
4344
4394
|
{
|
|
@@ -4389,7 +4439,7 @@ ${planToExecute}`;
|
|
|
4389
4439
|
enableFileUpload && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4390
4440
|
"button",
|
|
4391
4441
|
{
|
|
4392
|
-
onClick: () => _optionalChain([fileInputRef, 'access',
|
|
4442
|
+
onClick: () => _optionalChain([fileInputRef, 'access', _125 => _125.current, 'optionalAccess', _126 => _126.click, 'call', _127 => _127()]),
|
|
4393
4443
|
className: "w-8 h-8 rounded-lg flex items-center justify-center transition-all flex-shrink-0 !text-neutral-500 dark:!text-neutral-500 hover:bg-neutral-100 dark:hover:bg-neutral-800",
|
|
4394
4444
|
title: "Attach file",
|
|
4395
4445
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "path", { d: "M8.4 2.8L4.4 6.8C3.736 7.464 3.736 8.536 4.4 9.2C5.064 9.864 6.136 9.864 6.8 9.2L11.6 4.4C12.704 3.296 12.704 1.504 11.6 0.4C10.496 -0.704 8.704 -0.704 7.6 0.4L2.8 5.2C1.256 6.744 1.256 9.256 2.8 10.8C4.344 12.344 6.856 12.344 8.4 10.8L12.4 6.8", stroke: "currentColor", strokeWidth: "1.2", strokeLinecap: "round", strokeLinejoin: "round", transform: "translate(1.6, 2.4)" }) })
|
|
@@ -4575,25 +4625,25 @@ function Prompt({
|
|
|
4575
4625
|
const newValue = e.target.value;
|
|
4576
4626
|
if (!maxLength || newValue.length <= maxLength) {
|
|
4577
4627
|
setValue(newValue);
|
|
4578
|
-
_optionalChain([onChange, 'optionalCall',
|
|
4628
|
+
_optionalChain([onChange, 'optionalCall', _128 => _128(newValue)]);
|
|
4579
4629
|
}
|
|
4580
4630
|
};
|
|
4581
4631
|
const handleSubmit = async () => {
|
|
4582
4632
|
if (value.length < minLength) return;
|
|
4583
|
-
_optionalChain([onSubmit, 'optionalCall',
|
|
4633
|
+
_optionalChain([onSubmit, 'optionalCall', _129 => _129(value)]);
|
|
4584
4634
|
setIsLoading(true);
|
|
4585
4635
|
try {
|
|
4586
4636
|
if (useMock) {
|
|
4587
4637
|
await new Promise((resolve) => setTimeout(resolve, 1500));
|
|
4588
4638
|
const mockResult = `Enhanced version: ${value} [AI-generated content]`;
|
|
4589
|
-
_optionalChain([onResult, 'optionalCall',
|
|
4639
|
+
_optionalChain([onResult, 'optionalCall', _130 => _130(mockResult)]);
|
|
4590
4640
|
setValue("");
|
|
4591
4641
|
} else {
|
|
4592
4642
|
const response = await aptevaClient.chat({
|
|
4593
4643
|
agent_id: agentId,
|
|
4594
4644
|
message: value
|
|
4595
4645
|
});
|
|
4596
|
-
_optionalChain([onResult, 'optionalCall',
|
|
4646
|
+
_optionalChain([onResult, 'optionalCall', _131 => _131(response.message)]);
|
|
4597
4647
|
setValue("");
|
|
4598
4648
|
}
|
|
4599
4649
|
} catch (error) {
|
|
@@ -4688,7 +4738,7 @@ function Stream({
|
|
|
4688
4738
|
}, [autoStart]);
|
|
4689
4739
|
const startStreaming = async () => {
|
|
4690
4740
|
setIsStreaming(true);
|
|
4691
|
-
_optionalChain([onStart, 'optionalCall',
|
|
4741
|
+
_optionalChain([onStart, 'optionalCall', _132 => _132()]);
|
|
4692
4742
|
try {
|
|
4693
4743
|
if (useMock) {
|
|
4694
4744
|
const mockText = "This is a simulated streaming response from the AI agent. In a real implementation, this would stream data from your backend API. The text appears word by word to simulate the streaming effect. You can customize the typing speed and styling based on your needs.";
|
|
@@ -4696,13 +4746,13 @@ function Stream({
|
|
|
4696
4746
|
mockText,
|
|
4697
4747
|
(chunk) => {
|
|
4698
4748
|
setText((prev) => prev + chunk);
|
|
4699
|
-
_optionalChain([onChunk, 'optionalCall',
|
|
4749
|
+
_optionalChain([onChunk, 'optionalCall', _133 => _133(chunk)]);
|
|
4700
4750
|
},
|
|
4701
4751
|
typingSpeed
|
|
4702
4752
|
);
|
|
4703
4753
|
setIsComplete(true);
|
|
4704
4754
|
setIsStreaming(false);
|
|
4705
|
-
_optionalChain([onComplete, 'optionalCall',
|
|
4755
|
+
_optionalChain([onComplete, 'optionalCall', _134 => _134(text + mockText)]);
|
|
4706
4756
|
} else {
|
|
4707
4757
|
let accumulatedText = "";
|
|
4708
4758
|
await aptevaClient.chatStream(
|
|
@@ -4715,24 +4765,24 @@ function Stream({
|
|
|
4715
4765
|
if (chunk.type === "token" && chunk.content) {
|
|
4716
4766
|
accumulatedText += chunk.content;
|
|
4717
4767
|
setText(accumulatedText);
|
|
4718
|
-
_optionalChain([onChunk, 'optionalCall',
|
|
4768
|
+
_optionalChain([onChunk, 'optionalCall', _135 => _135(chunk.content)]);
|
|
4719
4769
|
}
|
|
4720
4770
|
},
|
|
4721
4771
|
() => {
|
|
4722
4772
|
setIsComplete(true);
|
|
4723
4773
|
setIsStreaming(false);
|
|
4724
|
-
_optionalChain([onComplete, 'optionalCall',
|
|
4774
|
+
_optionalChain([onComplete, 'optionalCall', _136 => _136(accumulatedText)]);
|
|
4725
4775
|
},
|
|
4726
4776
|
(error) => {
|
|
4727
4777
|
const err = error instanceof Error ? error : new Error("Streaming error");
|
|
4728
|
-
_optionalChain([onError, 'optionalCall',
|
|
4778
|
+
_optionalChain([onError, 'optionalCall', _137 => _137(err)]);
|
|
4729
4779
|
setIsStreaming(false);
|
|
4730
4780
|
}
|
|
4731
4781
|
);
|
|
4732
4782
|
}
|
|
4733
4783
|
} catch (error) {
|
|
4734
4784
|
const err = error instanceof Error ? error : new Error("Streaming error");
|
|
4735
|
-
_optionalChain([onError, 'optionalCall',
|
|
4785
|
+
_optionalChain([onError, 'optionalCall', _138 => _138(err)]);
|
|
4736
4786
|
setIsStreaming(false);
|
|
4737
4787
|
}
|
|
4738
4788
|
};
|
|
@@ -4824,7 +4874,7 @@ function ThreadList({
|
|
|
4824
4874
|
}) {
|
|
4825
4875
|
const [searchQuery, setSearchQuery] = _react.useState.call(void 0, "");
|
|
4826
4876
|
const filteredThreads = threads.filter(
|
|
4827
|
-
(thread) => thread.title.toLowerCase().includes(searchQuery.toLowerCase()) || _optionalChain([thread, 'access',
|
|
4877
|
+
(thread) => thread.title.toLowerCase().includes(searchQuery.toLowerCase()) || _optionalChain([thread, 'access', _139 => _139.preview, 'optionalAccess', _140 => _140.toLowerCase, 'call', _141 => _141(), 'access', _142 => _142.includes, 'call', _143 => _143(searchQuery.toLowerCase())])
|
|
4828
4878
|
);
|
|
4829
4879
|
const groupedThreads = groupBy === "date" ? groupThreadsByDate(filteredThreads) : { All: filteredThreads };
|
|
4830
4880
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col h-full", children: [
|
|
@@ -4846,8 +4896,8 @@ function ThreadList({
|
|
|
4846
4896
|
{
|
|
4847
4897
|
thread,
|
|
4848
4898
|
isActive: thread.id === currentThreadId,
|
|
4849
|
-
onSelect: () => _optionalChain([onThreadSelect, 'optionalCall',
|
|
4850
|
-
onDelete: () => _optionalChain([onThreadDelete, 'optionalCall',
|
|
4899
|
+
onSelect: () => _optionalChain([onThreadSelect, 'optionalCall', _144 => _144(thread.id)]),
|
|
4900
|
+
onDelete: () => _optionalChain([onThreadDelete, 'optionalCall', _145 => _145(thread.id)])
|
|
4851
4901
|
},
|
|
4852
4902
|
thread.id
|
|
4853
4903
|
))
|
|
@@ -4909,7 +4959,7 @@ function Threads({
|
|
|
4909
4959
|
threads.slice(0, 5).map((thread) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
4910
4960
|
"button",
|
|
4911
4961
|
{
|
|
4912
|
-
onClick: () => _optionalChain([onThreadSelect, 'optionalCall',
|
|
4962
|
+
onClick: () => _optionalChain([onThreadSelect, 'optionalCall', _146 => _146(thread.id)]),
|
|
4913
4963
|
className: cn(
|
|
4914
4964
|
"px-4 py-2 whitespace-nowrap font-medium transition-colors",
|
|
4915
4965
|
thread.id === currentThreadId ? "border-b-2 border-apteva-500 text-apteva-500" : "text-neutral-600 hover:text-neutral-900"
|