openxgen 1.7.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -960,6 +960,127 @@ var init_llm = __esm({
960
960
  }
961
961
  });
962
962
 
963
+ // src/api/xgen-extra.ts
964
+ var xgen_extra_exports = {};
965
+ __export(xgen_extra_exports, {
966
+ createPrompt: () => createPrompt,
967
+ generateWorkflow: () => generateWorkflow,
968
+ getNodeCategories: () => getNodeCategories,
969
+ getNodeDetail: () => getNodeDetail,
970
+ getSchedulerStatus: () => getSchedulerStatus,
971
+ getTraceDetail: () => getTraceDetail,
972
+ getWorkflowPerformance: () => getWorkflowPerformance,
973
+ listInteractions: () => listInteractions,
974
+ listMcpSessions: () => listMcpSessions,
975
+ listNodes: () => listNodes,
976
+ listPrompts: () => listPrompts,
977
+ listSchedules: () => listSchedules,
978
+ listToolStore: () => listToolStore,
979
+ listTraces: () => listTraces,
980
+ listUserTools: () => listUserTools,
981
+ listWorkflowStore: () => listWorkflowStore,
982
+ searchNodes: () => searchNodes
983
+ });
984
+ async function listNodes() {
985
+ const client2 = getClient();
986
+ const res = await client2.get("/api/node/get");
987
+ return res.data.nodes ?? res.data ?? [];
988
+ }
989
+ async function searchNodes(query) {
990
+ const client2 = getClient();
991
+ const res = await client2.get("/api/node/search", { params: { query } });
992
+ return res.data.nodes ?? res.data ?? [];
993
+ }
994
+ async function getNodeDetail(nodeId) {
995
+ const client2 = getClient();
996
+ const res = await client2.get("/api/node/detail", { params: { node_id: nodeId } });
997
+ return res.data;
998
+ }
999
+ async function getNodeCategories() {
1000
+ const client2 = getClient();
1001
+ const res = await client2.get("/api/node/categories");
1002
+ return res.data.categories ?? res.data ?? [];
1003
+ }
1004
+ async function listPrompts(opts) {
1005
+ const client2 = getClient();
1006
+ const params = { limit: opts?.limit ?? 100 };
1007
+ if (opts?.language) params.language = opts.language;
1008
+ const res = await client2.get("/api/prompt/list", { params });
1009
+ return res.data.prompts ?? res.data ?? [];
1010
+ }
1011
+ async function createPrompt(data) {
1012
+ const client2 = getClient();
1013
+ const res = await client2.post("/api/prompt/create", data);
1014
+ return res.data;
1015
+ }
1016
+ async function listToolStore() {
1017
+ const client2 = getClient();
1018
+ const res = await client2.get("/api/tools/store/list");
1019
+ return res.data.tools ?? res.data ?? [];
1020
+ }
1021
+ async function listUserTools() {
1022
+ const client2 = getClient();
1023
+ const res = await client2.get("/api/tools/storage/list");
1024
+ return res.data.tools ?? res.data ?? [];
1025
+ }
1026
+ async function listSchedules() {
1027
+ const client2 = getClient();
1028
+ const res = await client2.get("/api/workflow/schedule/sessions");
1029
+ return res.data.sessions ?? res.data ?? [];
1030
+ }
1031
+ async function getSchedulerStatus() {
1032
+ const client2 = getClient();
1033
+ const res = await client2.get("/api/workflow/schedule/status");
1034
+ return res.data;
1035
+ }
1036
+ async function listInteractions(workflowId, limit = 20) {
1037
+ const client2 = getClient();
1038
+ const params = { limit };
1039
+ if (workflowId) params.workflow_id = workflowId;
1040
+ const res = await client2.get("/api/interaction/list", { params });
1041
+ return res.data.interactions ?? res.data ?? [];
1042
+ }
1043
+ async function listTraces(workflowId, page = 1) {
1044
+ const client2 = getClient();
1045
+ const params = { page, page_size: 20 };
1046
+ if (workflowId) params.workflow_id = workflowId;
1047
+ const res = await client2.get("/api/workflow/trace/list", { params });
1048
+ return res.data;
1049
+ }
1050
+ async function getTraceDetail(traceId) {
1051
+ const client2 = getClient();
1052
+ const res = await client2.get(`/api/workflow/trace/detail/${traceId}`);
1053
+ return res.data;
1054
+ }
1055
+ async function listWorkflowStore() {
1056
+ const client2 = getClient();
1057
+ const res = await client2.get("/api/workflow/store/list");
1058
+ return res.data.workflows ?? res.data ?? [];
1059
+ }
1060
+ async function generateWorkflow(requirements) {
1061
+ const client2 = getClient();
1062
+ const res = await client2.post("/api/workflow/auto-generation/generate", { requirements });
1063
+ return res.data;
1064
+ }
1065
+ async function getWorkflowPerformance(workflowId, workflowName) {
1066
+ const client2 = getClient();
1067
+ const res = await client2.get("/api/workflow/performance", {
1068
+ params: { workflow_id: workflowId, workflow_name: workflowName }
1069
+ });
1070
+ return res.data;
1071
+ }
1072
+ async function listMcpSessions() {
1073
+ const client2 = getClient();
1074
+ const res = await client2.get("/api/mcp/sessions");
1075
+ return res.data.sessions ?? res.data ?? [];
1076
+ }
1077
+ var init_xgen_extra = __esm({
1078
+ "src/api/xgen-extra.ts"() {
1079
+ "use strict";
1080
+ init_client();
1081
+ }
1082
+ });
1083
+
963
1084
  // src/api/document.ts
964
1085
  var document_exports = {};
965
1086
  __export(document_exports, {
@@ -1063,104 +1184,71 @@ __export(tui_exports, {
1063
1184
  });
1064
1185
  import blessed from "blessed";
1065
1186
  async function startTui() {
1066
- const screen = blessed.screen({
1067
- smartCSR: true,
1068
- title: "OPEN XGEN",
1069
- fullUnicode: true
1070
- });
1187
+ const screen = blessed.screen({ smartCSR: true, title: "OPEN XGEN", fullUnicode: true });
1071
1188
  const provider = getDefaultProvider();
1072
1189
  const server = getServer();
1073
1190
  const auth = getAuth();
1074
- const env = getActiveEnvironment();
1191
+ const serverDisplay = auth && server ? `${auth.username}@${server.replace("https://", "").replace("http://", "")}` : "\uBBF8\uC5F0\uACB0";
1192
+ let activeTab = "workflows";
1075
1193
  const header = blessed.box({
1076
1194
  top: 0,
1077
1195
  left: 0,
1078
1196
  width: "100%",
1079
1197
  height: 3,
1080
- content: `{center}{bold}OPEN XGEN{/bold} ${provider?.model ?? "AI \uBBF8\uC124\uC815"} \xB7 ${auth?.username ?? "\uBBF8\uC5F0\uACB0"}@${env?.name ?? server?.replace("https://", "") ?? ""}{/center}`,
1081
1198
  tags: true,
1082
- style: { fg: "white", bg: "blue" }
1199
+ style: { fg: "white", bg: "black" }
1083
1200
  });
1084
- const wfPanel = blessed.list({
1201
+ function renderHeader() {
1202
+ const wf = activeTab === "workflows" ? "{bold}{underline}\uC6CC\uD06C\uD50C\uB85C\uC6B0{/underline}{/bold}" : "{gray-fg}\uC6CC\uD06C\uD50C\uB85C\uC6B0{/gray-fg}";
1203
+ const col = activeTab === "collections" ? "{bold}{underline}\uCEEC\uB809\uC158{/underline}{/bold}" : "{gray-fg}\uCEEC\uB809\uC158{/gray-fg}";
1204
+ header.setContent(` OPEN XGEN {gray-fg}${provider?.model ?? ""}{/gray-fg} ${serverDisplay} \u2502 [1]${wf} [2]${col}`);
1205
+ screen.render();
1206
+ }
1207
+ const listPanel = blessed.list({
1085
1208
  top: 3,
1086
1209
  left: 0,
1087
1210
  width: "50%",
1088
- height: "50%-2",
1089
- label: " \uC6CC\uD06C\uD50C\uB85C\uC6B0 ",
1211
+ height: "100%-9",
1090
1212
  border: { type: "line" },
1091
1213
  style: {
1092
- border: { fg: "cyan" },
1093
- selected: { fg: "black", bg: "cyan" },
1214
+ border: { fg: "gray" },
1215
+ selected: { fg: "black", bg: "white" },
1094
1216
  item: { fg: "white" },
1095
- label: { fg: "cyan", bold: true }
1217
+ label: { fg: "white", bold: true }
1096
1218
  },
1097
1219
  keys: true,
1098
1220
  vi: true,
1099
1221
  mouse: true,
1100
- scrollbar: { ch: "\u2502", style: { fg: "cyan" } },
1222
+ scrollbar: { ch: "\u2502", style: { fg: "gray" } },
1101
1223
  tags: true
1102
1224
  });
1103
- const detailPanel = blessed.box({
1104
- top: 3,
1105
- left: "50%",
1106
- width: "50%",
1107
- height: "50%-2",
1108
- label: " \uC0C1\uC138 ",
1109
- border: { type: "line" },
1110
- scrollable: true,
1111
- alwaysScroll: true,
1112
- mouse: true,
1113
- tags: true,
1114
- style: {
1115
- border: { fg: "green" },
1116
- label: { fg: "green", bold: true }
1117
- }
1118
- });
1119
- const colPanel = blessed.list({
1120
- top: "50%+1",
1225
+ const chatInput = blessed.textbox({
1226
+ bottom: 3,
1121
1227
  left: 0,
1122
1228
  width: "50%",
1123
- height: "50%-4",
1124
- label: " \uCEEC\uB809\uC158 (\uBB38\uC11C) ",
1229
+ height: 3,
1230
+ label: " \u276F ",
1125
1231
  border: { type: "line" },
1232
+ inputOnFocus: true,
1126
1233
  style: {
1127
- border: { fg: "yellow" },
1128
- selected: { fg: "black", bg: "yellow" },
1129
- item: { fg: "white" },
1130
- label: { fg: "yellow", bold: true }
1131
- },
1132
- keys: true,
1133
- vi: true,
1134
- mouse: true,
1135
- tags: true
1234
+ border: { fg: "gray" },
1235
+ label: { fg: "white", bold: true }
1236
+ }
1136
1237
  });
1137
- const chatLog = blessed.log({
1138
- top: "50%+1",
1238
+ const detailPanel = blessed.log({
1239
+ top: 3,
1139
1240
  left: "50%",
1140
1241
  width: "50%",
1141
- height: "50%-7",
1142
- label: " AI \uCC44\uD305 ",
1242
+ height: "100%-6",
1243
+ label: " \uC0C1\uC138 ",
1143
1244
  border: { type: "line" },
1144
1245
  scrollable: true,
1145
1246
  alwaysScroll: true,
1146
1247
  mouse: true,
1147
1248
  tags: true,
1148
1249
  style: {
1149
- border: { fg: "magenta" },
1150
- label: { fg: "magenta", bold: true }
1151
- }
1152
- });
1153
- const chatInput = blessed.textbox({
1154
- bottom: 3,
1155
- left: "50%",
1156
- width: "50%",
1157
- height: 3,
1158
- label: " \uC785\uB825 ",
1159
- border: { type: "line" },
1160
- inputOnFocus: true,
1161
- style: {
1162
- border: { fg: "magenta" },
1163
- label: { fg: "magenta" }
1250
+ border: { fg: "gray" },
1251
+ label: { fg: "white", bold: true }
1164
1252
  }
1165
1253
  });
1166
1254
  const statusBar = blessed.box({
@@ -1168,176 +1256,236 @@ async function startTui() {
1168
1256
  left: 0,
1169
1257
  width: "100%",
1170
1258
  height: 3,
1171
- content: " {bold}Tab{/bold}:\uD328\uB110\uC804\uD658 {bold}Enter{/bold}:\uC120\uD0DD {bold}r{/bold}:\uC0C8\uB85C\uACE0\uCE68 {bold}c{/bold}:\uCC44\uD305 {bold}q{/bold}:\uC885\uB8CC {bold}\u2191\u2193{/bold}:\uC774\uB3D9",
1172
1259
  tags: true,
1173
- style: { fg: "white", bg: "gray" }
1260
+ style: { fg: "gray", bg: "black" }
1174
1261
  });
1262
+ function renderStatusBar(msg) {
1263
+ statusBar.setContent(msg ?? " {white-fg}{bold}1/2{/bold}{/white-fg}:\uD0ED {white-fg}{bold}Enter{/bold}{/white-fg}:\uC2E4\uD589 {white-fg}{bold}i{/bold}{/white-fg}:\uC785\uB825 {white-fg}{bold}r{/bold}{/white-fg}:\uC0C8\uB85C\uACE0\uCE68 {white-fg}{bold}Esc{/bold}{/white-fg}:\uBAA9\uB85D {white-fg}{bold}q{/bold}{/white-fg}:\uC885\uB8CC");
1264
+ screen.render();
1265
+ }
1175
1266
  screen.append(header);
1176
- screen.append(wfPanel);
1177
- screen.append(detailPanel);
1178
- screen.append(colPanel);
1179
- screen.append(chatLog);
1267
+ screen.append(listPanel);
1180
1268
  screen.append(chatInput);
1269
+ screen.append(detailPanel);
1181
1270
  screen.append(statusBar);
1182
1271
  let workflows = [];
1183
1272
  let collections = [];
1184
- async function loadData() {
1185
- if (!server || !auth) {
1186
- wfPanel.setItems(["\uC11C\uBC84 \uBBF8\uC5F0\uACB0 \u2014 q \uC885\uB8CC \uD6C4 xgen agent \u2192 /connect"]);
1187
- colPanel.setItems(["\uC11C\uBC84 \uBBF8\uC5F0\uACB0"]);
1188
- screen.render();
1189
- return;
1190
- }
1191
- statusBar.setContent(" \uB85C\uB529 \uC911...");
1192
- screen.render();
1273
+ async function loadWorkflows() {
1274
+ if (!server || !auth) return;
1193
1275
  try {
1194
1276
  const { getWorkflowListDetail: getWorkflowListDetail2 } = await Promise.resolve().then(() => (init_workflow(), workflow_exports));
1195
1277
  const wfs = await getWorkflowListDetail2();
1196
1278
  workflows = wfs.map((w) => ({
1197
1279
  name: w.workflow_name,
1198
1280
  id: (w.workflow_id ?? w.id ?? "").toString(),
1199
- deployed: !!w.is_deployed,
1200
- deployKey: w.deploy_key,
1201
- nodeCount: w.node_count
1202
- }));
1203
- wfPanel.setItems(workflows.map((w) => {
1204
- const tag = w.deployed ? "{green-fg}[\uBC30\uD3EC]{/green-fg}" : "";
1205
- return ` ${w.name} ${tag}`;
1281
+ deployed: !!w.is_deployed
1206
1282
  }));
1207
- } catch (err) {
1208
- wfPanel.setItems([`\uC624\uB958: ${err.message}`]);
1283
+ } catch {
1284
+ workflows = [];
1209
1285
  }
1286
+ }
1287
+ async function loadCollections() {
1288
+ if (!server || !auth) return;
1210
1289
  try {
1211
1290
  const { listCollections: listCollections2 } = await Promise.resolve().then(() => (init_document(), document_exports));
1212
1291
  const cols = await listCollections2();
1213
1292
  collections = cols.map((c) => ({
1214
1293
  name: c.collection_make_name,
1294
+ id: c.id,
1215
1295
  docs: c.total_documents,
1216
1296
  chunks: c.total_chunks,
1217
1297
  shared: c.is_shared,
1218
- group: c.share_group ?? void 0
1219
- }));
1220
- colPanel.setItems(collections.map((c) => {
1221
- const shared = c.shared ? `{yellow-fg}[${c.group}]{/yellow-fg}` : "";
1222
- return ` ${c.name} ${shared} \u2014 ${c.docs}\uBB38\uC11C ${c.chunks}\uCCAD\uD06C`;
1298
+ group: c.share_group ?? void 0,
1299
+ model: c.init_embedding_model ?? void 0
1223
1300
  }));
1224
1301
  } catch {
1225
- colPanel.setItems(["\uCEEC\uB809\uC158 \uB85C\uB4DC \uC2E4\uD328"]);
1302
+ collections = [];
1303
+ }
1304
+ }
1305
+ function renderList() {
1306
+ if (activeTab === "workflows") {
1307
+ listPanel.label = ` \uC6CC\uD06C\uD50C\uB85C\uC6B0 (${workflows.length}) `;
1308
+ listPanel.setItems(workflows.map((w, i) => {
1309
+ const dot = w.deployed ? "\u25CF" : "\u25CB";
1310
+ return ` ${dot} ${String(i + 1).padStart(2)}. ${w.name}`;
1311
+ }));
1312
+ } else {
1313
+ listPanel.label = ` \uCEEC\uB809\uC158 (${collections.length}) `;
1314
+ listPanel.setItems(collections.map(
1315
+ (c, i) => ` ${String(i + 1).padStart(2)}. ${c.name} {gray-fg}${c.docs}\uBB38\uC11C{/gray-fg}`
1316
+ ));
1226
1317
  }
1227
- statusBar.setContent(" {bold}Tab{/bold}:\uD328\uB110\uC804\uD658 {bold}Enter{/bold}:\uC120\uD0DD {bold}r{/bold}:\uC0C8\uB85C\uACE0\uCE68 {bold}c{/bold}:\uCC44\uD305 {bold}q{/bold}:\uC885\uB8CC {bold}\u2191\u2193{/bold}:\uC774\uB3D9");
1228
1318
  screen.render();
1229
1319
  }
1230
- wfPanel.on("select item", (_item, index) => {
1231
- const w = workflows[index];
1232
- if (!w) return;
1233
- detailPanel.setContent([
1234
- `{bold}${w.name}{/bold}`,
1235
- "",
1236
- `ID: ${w.id}`,
1237
- `\uBC30\uD3EC: ${w.deployed ? "{green-fg}Yes{/green-fg}" : "No"}`,
1238
- w.deployKey ? `Deploy Key: ${w.deployKey}` : "",
1239
- w.nodeCount ? `\uB178\uB4DC: ${w.nodeCount}\uAC1C` : "",
1240
- "",
1241
- w.deployed ? "{green-fg}Enter\uB85C \uC2E4\uD589{/green-fg}" : "{gray-fg}\uBBF8\uBC30\uD3EC \u2014 \uC2E4\uD589 \uBD88\uAC00{/gray-fg}"
1242
- ].filter(Boolean).join("\n"));
1320
+ async function loadAll() {
1321
+ renderStatusBar(" \uB85C\uB529...");
1322
+ await Promise.all([loadWorkflows(), loadCollections()]);
1323
+ renderList();
1324
+ renderHeader();
1325
+ renderStatusBar();
1326
+ }
1327
+ listPanel.on("select item", (_item, index) => {
1328
+ if (activeTab === "workflows") {
1329
+ const w = workflows[index];
1330
+ if (!w) return;
1331
+ detailPanel.setContent([
1332
+ `{bold}${w.name}{/bold}`,
1333
+ ``,
1334
+ `ID ${w.id}`,
1335
+ `\uBC30\uD3EC ${w.deployed ? "Yes" : "No"}`,
1336
+ ``,
1337
+ `Enter \u2192 \uC2E4\uD589 \uC785\uB825`
1338
+ ].join("\n"));
1339
+ } else {
1340
+ const c = collections[index];
1341
+ if (!c) return;
1342
+ detailPanel.setContent([
1343
+ `{bold}${c.name}{/bold}`,
1344
+ ``,
1345
+ `\uBB38\uC11C ${c.docs}\uAC1C`,
1346
+ `\uCCAD\uD06C ${c.chunks}\uAC1C`,
1347
+ `\uACF5\uC720 ${c.shared ? `Yes (${c.group})` : "No"}`,
1348
+ `\uBAA8\uB378 ${c.model ?? "-"}`,
1349
+ ``,
1350
+ `Enter \u2192 \uBB38\uC11C \uBAA9\uB85D`
1351
+ ].join("\n"));
1352
+ }
1243
1353
  screen.render();
1244
1354
  });
1245
- wfPanel.on("select", async (_item, index) => {
1246
- const w = workflows[index];
1247
- if (!w || !w.deployed || !w.deployKey) {
1248
- detailPanel.setContent("{red-fg}\uBC30\uD3EC\uB41C \uC6CC\uD06C\uD50C\uB85C\uC6B0\uB9CC \uC2E4\uD589 \uAC00\uB2A5\uD569\uB2C8\uB2E4.{/red-fg}");
1355
+ listPanel.on("select", async (_item, index) => {
1356
+ if (activeTab === "workflows") {
1357
+ const w = workflows[index];
1358
+ if (!w) return;
1359
+ chatInput.label = ` ${w.name} \u276F `;
1360
+ chatInput.focus();
1249
1361
  screen.render();
1250
- return;
1251
- }
1252
- detailPanel.setContent(`{yellow-fg}${w.name} \uC2E4\uD589 \uC911...{/yellow-fg}`);
1253
- screen.render();
1254
- try {
1255
- const { executeWorkflow: executeWorkflow2 } = await Promise.resolve().then(() => (init_workflow(), workflow_exports));
1256
- const { randomUUID: randomUUID4 } = await import("crypto");
1257
- const result = await executeWorkflow2({
1258
- workflow_id: w.id,
1259
- workflow_name: w.name,
1260
- input_data: "\uD14C\uC2A4\uD2B8 \uC2E4\uD589",
1261
- interaction_id: `cli_${randomUUID4().slice(0, 8)}`,
1262
- deploy_key: w.deployKey
1362
+ chatInput.once("submit", async (value) => {
1363
+ if (!value.trim()) {
1364
+ chatInput.label = " \u276F ";
1365
+ chatInput.clearValue();
1366
+ listPanel.focus();
1367
+ screen.render();
1368
+ return;
1369
+ }
1370
+ detailPanel.log(`{gray-fg}\u2500\u2500 ${w.name} \u2500\u2500{/gray-fg}`);
1371
+ detailPanel.log(`\uC785\uB825: ${value}`);
1372
+ screen.render();
1373
+ try {
1374
+ const { executeWorkflow: executeWorkflow2 } = await Promise.resolve().then(() => (init_workflow(), workflow_exports));
1375
+ const { randomUUID: randomUUID4 } = await import("crypto");
1376
+ const result = await executeWorkflow2({
1377
+ workflow_id: w.id,
1378
+ workflow_name: w.name,
1379
+ input_data: value,
1380
+ interaction_id: `tui_${randomUUID4().slice(0, 8)}`,
1381
+ user_id: auth?.userId ? parseInt(auth.userId) : 1
1382
+ });
1383
+ if (result.content) {
1384
+ detailPanel.log(`${String(result.content)}
1385
+ `);
1386
+ } else if (result.error || result.message) {
1387
+ detailPanel.log(`\uC624\uB958: ${result.error ?? result.message}
1388
+ `);
1389
+ } else {
1390
+ detailPanel.log(JSON.stringify(result, null, 2).slice(0, 800) + "\n");
1391
+ }
1392
+ } catch (err) {
1393
+ detailPanel.log(`\uC2E4\uD328: ${err.message}
1394
+ `);
1395
+ }
1396
+ chatInput.label = " \u276F ";
1397
+ chatInput.clearValue();
1398
+ listPanel.focus();
1399
+ screen.render();
1263
1400
  });
1264
- if (result.content) {
1265
- detailPanel.setContent(`{green-fg}\uACB0\uACFC:{/green-fg}
1401
+ } else {
1402
+ const c = collections[index];
1403
+ if (!c) return;
1404
+ detailPanel.setContent(`${c.name} \uBB38\uC11C \uB85C\uB529...`);
1405
+ screen.render();
1406
+ try {
1407
+ const { listDocuments: listDocuments2 } = await Promise.resolve().then(() => (init_document(), document_exports));
1408
+ const docs = await listDocuments2(c.id?.toString());
1409
+ if (!docs.length) {
1410
+ detailPanel.setContent(`{bold}${c.name}{/bold}
1266
1411
 
1267
- ${String(result.content).slice(0, 500)}`);
1268
- } else if (result.error) {
1269
- detailPanel.setContent(`{red-fg}\uC624\uB958:{/red-fg} ${result.error}`);
1270
- } else {
1271
- detailPanel.setContent(JSON.stringify(result, null, 2).slice(0, 500));
1412
+ \uBB38\uC11C \uC5C6\uC74C`);
1413
+ } else {
1414
+ const docList = docs.map((d, i) => {
1415
+ const name = d.name || d.file_name || "\uC774\uB984 \uC5C6\uC74C";
1416
+ return ` ${i + 1}. ${name}`;
1417
+ }).join("\n");
1418
+ detailPanel.setContent(`{bold}${c.name}{/bold} \u2014 ${docs.length}\uAC1C \uBB38\uC11C
1419
+
1420
+ ${docList}`);
1421
+ }
1422
+ } catch (err) {
1423
+ detailPanel.setContent(`\uBB38\uC11C \uB85C\uB4DC \uC2E4\uD328: ${err.message}`);
1272
1424
  }
1273
- } catch (err) {
1274
- detailPanel.setContent(`{red-fg}\uC2E4\uD589 \uC2E4\uD328:{/red-fg} ${err.message}`);
1425
+ screen.render();
1275
1426
  }
1276
- screen.render();
1277
- });
1278
- colPanel.on("select item", (_item, index) => {
1279
- const c = collections[index];
1280
- if (!c) return;
1281
- detailPanel.setContent([
1282
- `{bold}${c.name}{/bold}`,
1283
- "",
1284
- `\uBB38\uC11C: ${c.docs}\uAC1C`,
1285
- `\uCCAD\uD06C: ${c.chunks}\uAC1C`,
1286
- `\uACF5\uC720: ${c.shared ? `Yes (${c.group})` : "No"}`
1287
- ].join("\n"));
1288
- screen.render();
1289
1427
  });
1290
1428
  chatInput.on("submit", async (value) => {
1291
1429
  if (!value.trim()) {
1292
1430
  chatInput.clearValue();
1293
- chatInput.focus();
1431
+ listPanel.focus();
1294
1432
  screen.render();
1295
1433
  return;
1296
1434
  }
1297
- chatLog.log(`{blue-fg}You:{/blue-fg} ${value}`);
1435
+ detailPanel.log(`{white-fg}\u276F ${value}{/white-fg}`);
1298
1436
  chatInput.clearValue();
1299
1437
  screen.render();
1300
1438
  try {
1301
- const provider2 = getDefaultProvider();
1302
- if (!provider2) {
1303
- chatLog.log("{red-fg}\uD504\uB85C\uBC14\uC774\uB354 \uBBF8\uC124\uC815{/red-fg}");
1439
+ const p = getDefaultProvider();
1440
+ if (!p) {
1441
+ detailPanel.log("\uD504\uB85C\uBC14\uC774\uB354 \uBBF8\uC124\uC815");
1304
1442
  chatInput.focus();
1305
1443
  screen.render();
1306
1444
  return;
1307
1445
  }
1308
1446
  const { createLLMClient: createLLMClient2, streamChat: streamChat2 } = await Promise.resolve().then(() => (init_llm(), llm_exports));
1309
- const client2 = createLLMClient2(provider2);
1310
- const result = await streamChat2(client2, provider2.model, [
1311
- { role: "system", content: "You are OPEN XGEN. Be concise. Respond in Korean. Max 3 sentences." },
1447
+ const client2 = createLLMClient2(p);
1448
+ const result = await streamChat2(client2, p.model, [
1449
+ { role: "system", content: "You are OPEN XGEN. Concise. Korean." },
1312
1450
  { role: "user", content: value }
1313
1451
  ]);
1314
- chatLog.log(`{green-fg}AI:{/green-fg} ${result.content || "(no response)"}`);
1452
+ detailPanel.log(`${result.content || "(\uC751\uB2F5 \uC5C6\uC74C)"}
1453
+ `);
1315
1454
  } catch (err) {
1316
- chatLog.log(`{red-fg}\uC624\uB958:{/red-fg} ${err.message}`);
1455
+ detailPanel.log(`\uC624\uB958: ${err.message}
1456
+ `);
1317
1457
  }
1318
1458
  chatInput.focus();
1319
1459
  screen.render();
1320
1460
  });
1321
- const panels = [wfPanel, colPanel, chatInput];
1322
- let activePanel = 0;
1323
- function focusPanel(idx) {
1324
- activePanel = idx;
1325
- panels[idx].focus();
1326
- screen.render();
1327
- }
1461
+ screen.key(["1"], () => {
1462
+ activeTab = "workflows";
1463
+ renderList();
1464
+ renderHeader();
1465
+ listPanel.focus();
1466
+ });
1467
+ screen.key(["2"], () => {
1468
+ activeTab = "collections";
1469
+ renderList();
1470
+ renderHeader();
1471
+ listPanel.focus();
1472
+ });
1328
1473
  screen.key(["tab"], () => {
1329
- activePanel = (activePanel + 1) % panels.length;
1330
- focusPanel(activePanel);
1474
+ if (screen.focused === listPanel) chatInput.focus();
1475
+ else listPanel.focus();
1476
+ screen.render();
1331
1477
  });
1332
- screen.key(["S-tab"], () => {
1333
- activePanel = (activePanel - 1 + panels.length) % panels.length;
1334
- focusPanel(activePanel);
1478
+ screen.key(["i"], () => {
1479
+ chatInput.focus();
1480
+ screen.render();
1335
1481
  });
1336
1482
  screen.key(["r"], async () => {
1337
- await loadData();
1483
+ await loadAll();
1338
1484
  });
1339
- screen.key(["c"], () => {
1340
- focusPanel(2);
1485
+ screen.key(["escape"], () => {
1486
+ chatInput.label = " \u276F ";
1487
+ listPanel.focus();
1488
+ screen.render();
1341
1489
  });
1342
1490
  screen.key(["q", "C-c"], () => {
1343
1491
  screen.destroy();
@@ -1345,12 +1493,12 @@ ${String(result.content).slice(0, 500)}`);
1345
1493
  });
1346
1494
  setInterval(async () => {
1347
1495
  try {
1348
- await loadData();
1496
+ await loadAll();
1349
1497
  } catch {
1350
1498
  }
1351
- }, 3e4);
1352
- await loadData();
1353
- focusPanel(0);
1499
+ }, 6e4);
1500
+ await loadAll();
1501
+ listPanel.focus();
1354
1502
  screen.render();
1355
1503
  }
1356
1504
  var init_tui = __esm({
@@ -2483,165 +2631,48 @@ function getToolNames() {
2483
2631
  // src/agent/tools/xgen-api.ts
2484
2632
  init_store();
2485
2633
  var definitions = [
2486
- {
2487
- type: "function",
2488
- function: {
2489
- name: "xgen_workflow_list",
2490
- description: "XGEN \uC11C\uBC84\uC5D0\uC11C \uC6CC\uD06C\uD50C\uB85C\uC6B0 \uBAA9\uB85D\uC744 \uAC00\uC838\uC635\uB2C8\uB2E4.",
2491
- parameters: { type: "object", properties: {} }
2492
- }
2493
- },
2494
- {
2495
- type: "function",
2496
- function: {
2497
- name: "xgen_workflow_run",
2498
- description: "XGEN \uC6CC\uD06C\uD50C\uB85C\uC6B0\uB97C \uC2E4\uD589\uD569\uB2C8\uB2E4. \uBC30\uD3EC \uC5EC\uBD80\uC640 \uAD00\uACC4\uC5C6\uC774 \uBAA8\uB4E0 \uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC2E4\uD589 \uAC00\uB2A5.",
2499
- parameters: {
2500
- type: "object",
2501
- properties: {
2502
- workflow_id: { type: "string", description: "\uC6CC\uD06C\uD50C\uB85C\uC6B0 ID" },
2503
- workflow_name: { type: "string", description: "\uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC774\uB984" },
2504
- input_data: { type: "string", description: "\uC785\uB825 \uBA54\uC2DC\uC9C0" }
2505
- },
2506
- required: ["workflow_id", "workflow_name", "input_data"]
2507
- }
2508
- }
2509
- },
2510
- {
2511
- type: "function",
2512
- function: {
2513
- name: "xgen_workflow_info",
2514
- description: "\uD2B9\uC815 \uC6CC\uD06C\uD50C\uB85C\uC6B0\uC758 \uC0C1\uC138 \uC815\uBCF4(\uB178\uB4DC, \uC5E3\uC9C0 \uB4F1)\uB97C \uAC00\uC838\uC635\uB2C8\uB2E4.",
2515
- parameters: {
2516
- type: "object",
2517
- properties: {
2518
- workflow_id: { type: "string", description: "\uC6CC\uD06C\uD50C\uB85C\uC6B0 ID" }
2519
- },
2520
- required: ["workflow_id"]
2521
- }
2522
- }
2523
- },
2524
- {
2525
- type: "function",
2526
- function: {
2527
- name: "xgen_collection_list",
2528
- description: "XGEN \uC11C\uBC84\uC758 \uBB38\uC11C \uCEEC\uB809\uC158(\uC9C0\uC2DD\uBCA0\uC774\uC2A4) \uBAA9\uB85D\uC744 \uAC00\uC838\uC635\uB2C8\uB2E4. \uBB38\uC11C \uC218, \uCCAD\uD06C \uC218, \uACF5\uC720 \uC0C1\uD0DC \uB4F1 \uD3EC\uD568.",
2529
- parameters: { type: "object", properties: {} }
2530
- }
2531
- },
2532
- {
2533
- type: "function",
2534
- function: {
2535
- name: "xgen_server_status",
2536
- description: "XGEN \uC11C\uBC84 \uC0C1\uD0DC\uB97C \uD655\uC778\uD569\uB2C8\uB2E4.",
2537
- parameters: { type: "object", properties: {} }
2538
- }
2539
- },
2540
- {
2541
- type: "function",
2542
- function: {
2543
- name: "xgen_execution_history",
2544
- description: "\uD2B9\uC815 \uC6CC\uD06C\uD50C\uB85C\uC6B0\uC758 \uC2E4\uD589 \uC774\uB825\uC744 \uAC00\uC838\uC635\uB2C8\uB2E4. workflow_id\uC640 workflow_name \uD544\uC218.",
2545
- parameters: {
2546
- type: "object",
2547
- properties: {
2548
- workflow_id: { type: "string", description: "\uC6CC\uD06C\uD50C\uB85C\uC6B0 ID" },
2549
- workflow_name: { type: "string", description: "\uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC774\uB984" },
2550
- limit: { type: "number", description: "\uAC00\uC838\uC62C \uC774\uB825 \uC218 (\uAE30\uBCF8 10)" }
2551
- },
2552
- required: ["workflow_id", "workflow_name"]
2553
- }
2554
- }
2555
- },
2556
- {
2557
- type: "function",
2558
- function: {
2559
- name: "xgen_document_list",
2560
- description: "\uD2B9\uC815 \uCEEC\uB809\uC158\uC758 \uBB38\uC11C \uBAA9\uB85D\uC744 \uAC00\uC838\uC635\uB2C8\uB2E4.",
2561
- parameters: {
2562
- type: "object",
2563
- properties: {
2564
- collection_id: { type: "string", description: "\uCEEC\uB809\uC158 ID" }
2565
- }
2566
- }
2567
- }
2568
- },
2569
- {
2570
- type: "function",
2571
- function: {
2572
- name: "xgen_document_upload",
2573
- description: "\uBB38\uC11C\uB97C XGEN \uCEEC\uB809\uC158\uC5D0 \uC5C5\uB85C\uB4DC\uD569\uB2C8\uB2E4.",
2574
- parameters: {
2575
- type: "object",
2576
- properties: {
2577
- file_path: { type: "string", description: "\uC5C5\uB85C\uB4DC\uD560 \uD30C\uC77C \uACBD\uB85C" },
2578
- collection_id: { type: "string", description: "\uB300\uC0C1 \uCEEC\uB809\uC158 ID" }
2579
- },
2580
- required: ["file_path"]
2581
- }
2582
- }
2583
- },
2584
- {
2585
- type: "function",
2586
- function: {
2587
- name: "xgen_graph_rag_query",
2588
- description: "GraphRAG\uB85C \uC628\uD1A8\uB85C\uC9C0 \uC9C0\uC2DD\uADF8\uB798\uD504\uC5D0 \uC9C8\uC758\uD569\uB2C8\uB2E4.",
2589
- parameters: {
2590
- type: "object",
2591
- properties: {
2592
- query: { type: "string", description: "\uC9C8\uC758 \uB0B4\uC6A9" },
2593
- graph_id: { type: "string", description: "\uADF8\uB798\uD504 ID (\uC120\uD0DD)" }
2594
- },
2595
- required: ["query"]
2596
- }
2597
- }
2598
- },
2599
- {
2600
- type: "function",
2601
- function: {
2602
- name: "xgen_graph_stats",
2603
- description: "\uC628\uD1A8\uB85C\uC9C0 \uADF8\uB798\uD504 \uD1B5\uACC4(\uB178\uB4DC, \uC5E3\uC9C0, \uD074\uB798\uC2A4, \uC778\uC2A4\uD134\uC2A4 \uC218)\uB97C \uAC00\uC838\uC635\uB2C8\uB2E4.",
2604
- parameters: {
2605
- type: "object",
2606
- properties: {
2607
- graph_id: { type: "string", description: "\uADF8\uB798\uD504 ID" }
2608
- },
2609
- required: ["graph_id"]
2610
- }
2611
- }
2612
- }
2634
+ // === 워크플로우 ===
2635
+ { type: "function", function: { name: "xgen_workflow_list", description: "XGEN \uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC804\uCCB4 \uBAA9\uB85D. \uBC30\uD3EC \uC0C1\uD0DC \uD3EC\uD568.", parameters: { type: "object", properties: {} } } },
2636
+ { type: "function", function: { name: "xgen_workflow_run", description: "\uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC2E4\uD589. \uBC30\uD3EC/\uBE44\uBC30\uD3EC \uBAA8\uB450 \uAC00\uB2A5.", parameters: { type: "object", properties: { workflow_id: { type: "string" }, workflow_name: { type: "string" }, input_data: { type: "string", description: "\uC785\uB825 \uBA54\uC2DC\uC9C0" } }, required: ["workflow_id", "workflow_name", "input_data"] } } },
2637
+ { type: "function", function: { name: "xgen_workflow_info", description: "\uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC0C1\uC138 (\uB178\uB4DC, \uC5E3\uC9C0 \uAD6C\uC870).", parameters: { type: "object", properties: { workflow_id: { type: "string" } }, required: ["workflow_id"] } } },
2638
+ { type: "function", function: { name: "xgen_execution_history", description: "\uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC2E4\uD589 \uC774\uB825.", parameters: { type: "object", properties: { workflow_id: { type: "string" }, workflow_name: { type: "string" }, limit: { type: "number" } }, required: ["workflow_id", "workflow_name"] } } },
2639
+ { type: "function", function: { name: "xgen_workflow_performance", description: "\uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC131\uB2A5 \uD1B5\uACC4 (\uB178\uB4DC\uBCC4 \uCC98\uB9AC \uC2DC\uAC04, \uB9AC\uC18C\uC2A4 \uC0AC\uC6A9).", parameters: { type: "object", properties: { workflow_id: { type: "string" }, workflow_name: { type: "string" } }, required: ["workflow_id", "workflow_name"] } } },
2640
+ { type: "function", function: { name: "xgen_workflow_store", description: "\uACF5\uAC1C \uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC2A4\uD1A0\uC5B4 \uBAA9\uB85D.", parameters: { type: "object", properties: {} } } },
2641
+ { type: "function", function: { name: "xgen_workflow_generate", description: "\uC790\uC5F0\uC5B4 \uC694\uAD6C\uC0AC\uD56D\uC73C\uB85C \uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC790\uB3D9 \uC0DD\uC131.", parameters: { type: "object", properties: { requirements: { type: "string", description: "\uC0DD\uC131\uD560 \uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC694\uAD6C\uC0AC\uD56D" } }, required: ["requirements"] } } },
2642
+ // === 문서/컬렉션 ===
2643
+ { type: "function", function: { name: "xgen_collection_list", description: "\uBB38\uC11C \uCEEC\uB809\uC158(\uC9C0\uC2DD\uBCA0\uC774\uC2A4) \uBAA9\uB85D.", parameters: { type: "object", properties: {} } } },
2644
+ { type: "function", function: { name: "xgen_document_list", description: "\uCEEC\uB809\uC158\uC758 \uBB38\uC11C \uBAA9\uB85D.", parameters: { type: "object", properties: { collection_id: { type: "string" } } } } },
2645
+ { type: "function", function: { name: "xgen_document_upload", description: "\uBB38\uC11C \uC5C5\uB85C\uB4DC.", parameters: { type: "object", properties: { file_path: { type: "string" }, collection_id: { type: "string" } }, required: ["file_path"] } } },
2646
+ // === 노드 ===
2647
+ { type: "function", function: { name: "xgen_node_list", description: "XGEN \uB178\uB4DC \uC804\uCCB4 \uBAA9\uB85D. \uC6CC\uD06C\uD50C\uB85C\uC6B0 \uBE4C\uB529 \uBE14\uB85D.", parameters: { type: "object", properties: {} } } },
2648
+ { type: "function", function: { name: "xgen_node_search", description: "\uB178\uB4DC \uAC80\uC0C9 (\uC774\uB984, \uC124\uBA85 \uAE30\uBC18).", parameters: { type: "object", properties: { query: { type: "string" } }, required: ["query"] } } },
2649
+ { type: "function", function: { name: "xgen_node_categories", description: "\uB178\uB4DC \uCE74\uD14C\uACE0\uB9AC \uBAA9\uB85D.", parameters: { type: "object", properties: {} } } },
2650
+ // === 프롬프트 ===
2651
+ { type: "function", function: { name: "xgen_prompt_list", description: "\uD504\uB86C\uD504\uD2B8 \uB77C\uC774\uBE0C\uB7EC\uB9AC \uBAA9\uB85D.", parameters: { type: "object", properties: { language: { type: "string", description: "en \uB610\uB294 ko" } } } } },
2652
+ // === 도구/스킬 ===
2653
+ { type: "function", function: { name: "xgen_tool_store", description: "\uACF5\uAC1C \uB3C4\uAD6C \uC2A4\uD1A0\uC5B4 \uBAA9\uB85D.", parameters: { type: "object", properties: {} } } },
2654
+ { type: "function", function: { name: "xgen_user_tools", description: "\uB0B4 \uB3C4\uAD6C \uBAA9\uB85D.", parameters: { type: "object", properties: {} } } },
2655
+ // === 스케줄 ===
2656
+ { type: "function", function: { name: "xgen_schedule_list", description: "\uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC2A4\uCF00\uC904 \uBAA9\uB85D (cron \uC791\uC5C5).", parameters: { type: "object", properties: {} } } },
2657
+ // === 트레이스/인터랙션 ===
2658
+ { type: "function", function: { name: "xgen_trace_list", description: "\uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC2E4\uD589 \uD2B8\uB808\uC774\uC2A4 \uBAA9\uB85D.", parameters: { type: "object", properties: { workflow_id: { type: "string" } } } } },
2659
+ { type: "function", function: { name: "xgen_interaction_list", description: "\uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC778\uD130\uB799\uC158(\uC2E4\uD589 \uBA54\uD0C0) \uBAA9\uB85D.", parameters: { type: "object", properties: { workflow_id: { type: "string" }, limit: { type: "number" } } } } },
2660
+ // === MCP ===
2661
+ { type: "function", function: { name: "xgen_mcp_sessions", description: "XGEN MCP \uC11C\uBC84 \uC138\uC158 \uBAA9\uB85D.", parameters: { type: "object", properties: {} } } },
2662
+ // === GraphRAG ===
2663
+ { type: "function", function: { name: "xgen_graph_rag_query", description: "GraphRAG \uC628\uD1A8\uB85C\uC9C0 \uC9C8\uC758.", parameters: { type: "object", properties: { query: { type: "string" }, graph_id: { type: "string" } }, required: ["query"] } } },
2664
+ { type: "function", function: { name: "xgen_graph_stats", description: "\uC628\uD1A8\uB85C\uC9C0 \uADF8\uB798\uD504 \uD1B5\uACC4.", parameters: { type: "object", properties: { graph_id: { type: "string" } }, required: ["graph_id"] } } },
2665
+ // === 서버 ===
2666
+ { type: "function", function: { name: "xgen_server_status", description: "XGEN \uC11C\uBC84 \uC5F0\uACB0 \uC0C1\uD0DC.", parameters: { type: "object", properties: {} } } }
2613
2667
  ];
2614
2668
  async function execute8(name, args) {
2615
2669
  const server = getServer();
2616
2670
  const auth = getAuth();
2617
- if (!server || !auth) {
2618
- return "XGEN \uC11C\uBC84\uC5D0 \uC5F0\uACB0\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. /connect \uBA85\uB839\uC73C\uB85C \uC5F0\uACB0\uD558\uC138\uC694.";
2619
- }
2671
+ if (!server || !auth) return "XGEN \uC11C\uBC84\uC5D0 \uC5F0\uACB0\uB418\uC5B4 \uC788\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. /connect \uBA85\uB839\uC73C\uB85C \uC5F0\uACB0\uD558\uC138\uC694.";
2620
2672
  try {
2621
- switch (name) {
2622
- case "xgen_workflow_list":
2623
- return await workflowList2();
2624
- case "xgen_workflow_run":
2625
- return await workflowRun2(args);
2626
- case "xgen_workflow_info":
2627
- return await workflowInfo2(args);
2628
- case "xgen_collection_list":
2629
- return await collectionList();
2630
- case "xgen_server_status":
2631
- return await serverStatus();
2632
- case "xgen_execution_history":
2633
- return await executionHistory(args);
2634
- case "xgen_document_list":
2635
- return await documentList(args);
2636
- case "xgen_document_upload":
2637
- return await documentUpload(args);
2638
- case "xgen_graph_rag_query":
2639
- return await graphRagQuery(args);
2640
- case "xgen_graph_stats":
2641
- return await graphStats(args);
2642
- default:
2643
- return `Unknown XGEN tool: ${name}`;
2644
- }
2673
+ const fn = handlers[name];
2674
+ if (!fn) return `Unknown XGEN tool: ${name}`;
2675
+ return await fn(args);
2645
2676
  } catch (err) {
2646
2677
  return `XGEN API \uC624\uB958: ${err.message}`;
2647
2678
  }
@@ -2649,118 +2680,180 @@ async function execute8(name, args) {
2649
2680
  function isXgenTool(name) {
2650
2681
  return name.startsWith("xgen_");
2651
2682
  }
2652
- async function workflowList2() {
2653
- const { getWorkflowListDetail: getWorkflowListDetail2 } = await Promise.resolve().then(() => (init_workflow(), workflow_exports));
2654
- const wfs = await getWorkflowListDetail2();
2655
- if (!wfs.length) return "\uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC5C6\uC74C.";
2656
- const header = `\uCD1D ${wfs.length}\uAC1C \uC6CC\uD06C\uD50C\uB85C\uC6B0:
2657
- `;
2658
- const list = wfs.map((w, i) => {
2659
- const deployed = w.is_deployed;
2660
- const tag = deployed ? " \u25CF" : "";
2661
- return `${i + 1}. ${w.workflow_name}${tag} | ${w.workflow_id ?? w.id}`;
2662
- }).join("\n");
2663
- return header + list;
2664
- }
2665
- async function workflowRun2(args) {
2666
- const { executeWorkflow: executeWorkflow2 } = await Promise.resolve().then(() => (init_workflow(), workflow_exports));
2667
- const { randomUUID: randomUUID4 } = await import("crypto");
2668
- const { getAuth: getAuth3 } = await Promise.resolve().then(() => (init_store(), store_exports));
2669
- const auth = getAuth3();
2670
- const result = await executeWorkflow2({
2671
- workflow_id: args.workflow_id,
2672
- workflow_name: args.workflow_name,
2673
- input_data: args.input_data,
2674
- interaction_id: `cli_${randomUUID4().slice(0, 8)}`,
2675
- user_id: auth?.userId ? parseInt(auth.userId) : 1
2676
- });
2677
- if (result.content) return String(result.content);
2678
- if (result.success === false) return `\uC624\uB958: ${result.error ?? result.message}`;
2679
- if (result.message) return String(result.message);
2680
- return JSON.stringify(result, null, 2).slice(0, 2e3);
2681
- }
2682
- async function workflowInfo2(args) {
2683
- const { getWorkflowDetail: getWorkflowDetail2 } = await Promise.resolve().then(() => (init_workflow(), workflow_exports));
2684
- const detail = await getWorkflowDetail2(args.workflow_id);
2685
- const nodes = detail.nodes?.length ?? 0;
2686
- const edges = detail.edges?.length ?? 0;
2687
- return `\uC6CC\uD06C\uD50C\uB85C\uC6B0: ${detail.workflow_name}
2688
- ID: ${detail.id}
2689
- \uB178\uB4DC: ${nodes}\uAC1C
2690
- \uC5E3\uC9C0: ${edges}\uAC1C`;
2691
- }
2692
- async function collectionList() {
2693
- const { listCollections: listCollections2 } = await Promise.resolve().then(() => (init_document(), document_exports));
2694
- const cols = await listCollections2();
2695
- if (!cols.length) return "\uCEEC\uB809\uC158 \uC5C6\uC74C.";
2696
- return cols.map((c, i) => {
2697
- const shared = c.is_shared ? ` [\uACF5\uC720:${c.share_group}]` : "";
2698
- return `${i + 1}. ${c.collection_make_name}${shared}
2699
- \uBB38\uC11C: ${c.total_documents}\uAC1C \xB7 \uCCAD\uD06C: ${c.total_chunks}\uAC1C \xB7 \uBAA8\uB378: ${c.init_embedding_model ?? "-"}`;
2700
- }).join("\n");
2701
- }
2702
- async function serverStatus() {
2703
- const server = getServer();
2704
- const auth = getAuth();
2705
- return `\uC11C\uBC84: ${server}
2706
- \uC0AC\uC6A9\uC790: ${auth?.username}
2707
- User ID: ${auth?.userId}`;
2708
- }
2709
- async function executionHistory(args) {
2710
- const { getIOLogs: getIOLogs2 } = await Promise.resolve().then(() => (init_workflow(), workflow_exports));
2711
- const wfId = args.workflow_id;
2712
- const wfName = args.workflow_name;
2713
- if (!wfId || !wfName) return "workflow_id\uC640 workflow_name\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. \uBA3C\uC800 xgen_workflow_list\uB85C \uBAA9\uB85D\uC744 \uD655\uC778\uD558\uC138\uC694.";
2714
- const limit = args.limit || 10;
2715
- const logs = await getIOLogs2(wfId, wfName, limit);
2716
- if (!logs.length) return "\uC2E4\uD589 \uC774\uB825 \uC5C6\uC74C.";
2717
- return logs.map(
2718
- (l, i) => `${i + 1}. [${l.created_at ?? ""}]
2719
- \uC785\uB825: ${(l.input_data ?? "").slice(0, 80)}
2720
- \uCD9C\uB825: ${(l.output_data ?? "").slice(0, 80)}`
2721
- ).join("\n");
2722
- }
2723
- async function documentList(args) {
2724
- const { listDocuments: listDocuments2 } = await Promise.resolve().then(() => (init_document(), document_exports));
2725
- const docs = await listDocuments2(args.collection_id);
2726
- if (!docs.length) return "\uBB38\uC11C \uC5C6\uC74C.";
2727
- return docs.map((d, i) => {
2728
- const name = d.name || d.file_name || "\uC774\uB984 \uC5C6\uC74C";
2729
- const size = d.file_size ? ` (${(d.file_size / 1024).toFixed(1)}KB)` : "";
2730
- return `${i + 1}. ${name}${size}
2731
- \uC0C1\uD0DC: ${d.status ?? "-"} \xB7 \uD0C0\uC785: ${d.file_type ?? "-"}`;
2732
- }).join("\n");
2733
- }
2734
- async function documentUpload(args) {
2735
- const { uploadDocument: uploadDocument2 } = await Promise.resolve().then(() => (init_document(), document_exports));
2736
- const filePath = args.file_path;
2737
- if (!filePath) return "\uD30C\uC77C \uACBD\uB85C\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.";
2738
- const { existsSync: existsSync5 } = await import("fs");
2739
- if (!existsSync5(filePath)) return `\uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${filePath}`;
2740
- const result = await uploadDocument2(filePath, args.collection_id);
2741
- return `\uC5C5\uB85C\uB4DC \uC644\uB8CC: ${JSON.stringify(result)}`;
2742
- }
2743
- async function graphRagQuery(args) {
2744
- const { queryGraphRAG: queryGraphRAG2 } = await Promise.resolve().then(() => (init_ontology(), ontology_exports));
2745
- const query = args.query;
2746
- if (!query) return "\uC9C8\uC758 \uB0B4\uC6A9\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.";
2747
- const result = await queryGraphRAG2(query, args.graph_id);
2748
- let output = `\uB2F5\uBCC0: ${result.answer ?? "\uC5C6\uC74C"}`;
2749
- if (result.sources?.length) output += `
2750
-
2751
- \uCD9C\uCC98: ${result.sources.join(", ")}`;
2752
- if (result.triples_used?.length) output += `
2753
- \uD2B8\uB9AC\uD50C: ${result.triples_used.length}\uAC1C \uC0AC\uC6A9`;
2754
- return output;
2755
- }
2756
- async function graphStats(args) {
2757
- const { getGraphStats: getGraphStats2 } = await Promise.resolve().then(() => (init_ontology(), ontology_exports));
2758
- const stats = await getGraphStats2(args.graph_id);
2759
- return `\uB178\uB4DC: ${stats.total_nodes ?? 0}\uAC1C
2760
- \uC5E3\uC9C0: ${stats.total_edges ?? 0}\uAC1C
2761
- \uD074\uB798\uC2A4: ${stats.total_classes ?? 0}\uAC1C
2762
- \uC778\uC2A4\uD134\uC2A4: ${stats.total_instances ?? 0}\uAC1C`;
2763
- }
2683
+ var handlers = {
2684
+ xgen_workflow_list: async () => {
2685
+ const { getWorkflowListDetail: getWorkflowListDetail2 } = await Promise.resolve().then(() => (init_workflow(), workflow_exports));
2686
+ const wfs = await getWorkflowListDetail2();
2687
+ if (!wfs.length) return "\uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC5C6\uC74C.";
2688
+ return `\uCD1D ${wfs.length}\uAC1C:
2689
+ ` + wfs.map((w, i) => {
2690
+ const d = w.is_deployed ? "\u25CF" : "\u25CB";
2691
+ return `${d} ${i + 1}. ${w.workflow_name} | ${w.workflow_id ?? w.id}`;
2692
+ }).join("\n");
2693
+ },
2694
+ xgen_workflow_run: async (args) => {
2695
+ const { executeWorkflow: executeWorkflow2 } = await Promise.resolve().then(() => (init_workflow(), workflow_exports));
2696
+ const { randomUUID: randomUUID4 } = await import("crypto");
2697
+ const auth = getAuth();
2698
+ const r = await executeWorkflow2({
2699
+ workflow_id: args.workflow_id,
2700
+ workflow_name: args.workflow_name,
2701
+ input_data: args.input_data,
2702
+ interaction_id: `cli_${randomUUID4().slice(0, 8)}`,
2703
+ user_id: auth?.userId ? parseInt(auth.userId) : 1
2704
+ });
2705
+ return r.content ? String(r.content) : r.message ? String(r.message) : JSON.stringify(r, null, 2).slice(0, 2e3);
2706
+ },
2707
+ xgen_workflow_info: async (args) => {
2708
+ const { getWorkflowDetail: getWorkflowDetail2 } = await Promise.resolve().then(() => (init_workflow(), workflow_exports));
2709
+ const d = await getWorkflowDetail2(args.workflow_id);
2710
+ const nodes = d.nodes?.length ?? 0;
2711
+ const edges = d.edges?.length ?? 0;
2712
+ return `${d.workflow_name}
2713
+ ID: ${d.id}
2714
+ \uB178\uB4DC: ${nodes}\uAC1C \xB7 \uC5E3\uC9C0: ${edges}\uAC1C`;
2715
+ },
2716
+ xgen_execution_history: async (args) => {
2717
+ const { getIOLogs: getIOLogs2 } = await Promise.resolve().then(() => (init_workflow(), workflow_exports));
2718
+ if (!args.workflow_id || !args.workflow_name) return "workflow_id, workflow_name \uD544\uC218.";
2719
+ const logs = await getIOLogs2(args.workflow_id, args.workflow_name, args.limit || 10);
2720
+ if (!logs.length) return "\uC2E4\uD589 \uC774\uB825 \uC5C6\uC74C.";
2721
+ return logs.map((l, i) => `${i + 1}. [${l.created_at ?? ""}] \uC785\uB825: ${(l.input_data ?? "").slice(0, 60)} \u2192 \uCD9C\uB825: ${(l.output_data ?? "").slice(0, 60)}`).join("\n");
2722
+ },
2723
+ xgen_workflow_performance: async (args) => {
2724
+ const { getWorkflowPerformance: getWorkflowPerformance2 } = await Promise.resolve().then(() => (init_xgen_extra(), xgen_extra_exports));
2725
+ const p = await getWorkflowPerformance2(args.workflow_id, args.workflow_name);
2726
+ return JSON.stringify(p, null, 2).slice(0, 2e3);
2727
+ },
2728
+ xgen_workflow_store: async () => {
2729
+ const { listWorkflowStore: listWorkflowStore2 } = await Promise.resolve().then(() => (init_xgen_extra(), xgen_extra_exports));
2730
+ const wfs = await listWorkflowStore2();
2731
+ if (!wfs.length) return "\uACF5\uAC1C \uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC5C6\uC74C.";
2732
+ return wfs.map((w, i) => `${i + 1}. ${w.workflow_name ?? w.name ?? "\uC774\uB984\uC5C6\uC74C"}`).join("\n");
2733
+ },
2734
+ xgen_workflow_generate: async (args) => {
2735
+ const { generateWorkflow: generateWorkflow2 } = await Promise.resolve().then(() => (init_xgen_extra(), xgen_extra_exports));
2736
+ const r = await generateWorkflow2(args.requirements);
2737
+ return JSON.stringify(r, null, 2).slice(0, 3e3);
2738
+ },
2739
+ xgen_collection_list: async () => {
2740
+ const { listCollections: listCollections2 } = await Promise.resolve().then(() => (init_document(), document_exports));
2741
+ const cols = await listCollections2();
2742
+ if (!cols.length) return "\uCEEC\uB809\uC158 \uC5C6\uC74C.";
2743
+ return `\uCD1D ${cols.length}\uAC1C:
2744
+ ` + cols.map(
2745
+ (c, i) => `${i + 1}. ${c.collection_make_name} | ${c.total_documents}\uBB38\uC11C ${c.total_chunks}\uCCAD\uD06C${c.is_shared ? ` [\uACF5\uC720:${c.share_group}]` : ""}`
2746
+ ).join("\n");
2747
+ },
2748
+ xgen_document_list: async (args) => {
2749
+ const { listDocuments: listDocuments2 } = await Promise.resolve().then(() => (init_document(), document_exports));
2750
+ const docs = await listDocuments2(args.collection_id);
2751
+ if (!docs.length) return "\uBB38\uC11C \uC5C6\uC74C.";
2752
+ return docs.map((d, i) => `${i + 1}. ${d.name || d.file_name || "\uC774\uB984\uC5C6\uC74C"} ${d.file_type ?? ""} ${d.status ?? ""}`).join("\n");
2753
+ },
2754
+ xgen_document_upload: async (args) => {
2755
+ const { uploadDocument: uploadDocument2 } = await Promise.resolve().then(() => (init_document(), document_exports));
2756
+ const { existsSync: existsSync5 } = await import("fs");
2757
+ if (!args.file_path) return "\uD30C\uC77C \uACBD\uB85C \uD544\uC694.";
2758
+ if (!existsSync5(args.file_path)) return `\uD30C\uC77C \uC5C6\uC74C: ${args.file_path}`;
2759
+ const r = await uploadDocument2(args.file_path, args.collection_id);
2760
+ return `\uC5C5\uB85C\uB4DC \uC644\uB8CC: ${JSON.stringify(r)}`;
2761
+ },
2762
+ xgen_node_list: async () => {
2763
+ const { listNodes: listNodes2 } = await Promise.resolve().then(() => (init_xgen_extra(), xgen_extra_exports));
2764
+ const nodes = await listNodes2();
2765
+ if (!nodes.length) return "\uB178\uB4DC \uC5C6\uC74C.";
2766
+ return `\uCD1D ${nodes.length}\uAC1C:
2767
+ ` + nodes.slice(0, 50).map(
2768
+ (n, i) => `${i + 1}. ${n.nodeName ?? n.name ?? n.node_id ?? "?"} ${n.description ? "\u2014 " + String(n.description).slice(0, 40) : ""}`
2769
+ ).join("\n") + (nodes.length > 50 ? `
2770
+ ...(+${nodes.length - 50}\uAC1C)` : "");
2771
+ },
2772
+ xgen_node_search: async (args) => {
2773
+ const { searchNodes: searchNodes2 } = await Promise.resolve().then(() => (init_xgen_extra(), xgen_extra_exports));
2774
+ const nodes = await searchNodes2(args.query);
2775
+ if (!nodes.length) return "\uAC80\uC0C9 \uACB0\uACFC \uC5C6\uC74C.";
2776
+ return nodes.map(
2777
+ (n, i) => `${i + 1}. ${n.nodeName ?? n.name ?? "?"} \u2014 ${(n.description ?? "").slice(0, 60)}`
2778
+ ).join("\n");
2779
+ },
2780
+ xgen_node_categories: async () => {
2781
+ const { getNodeCategories: getNodeCategories2 } = await Promise.resolve().then(() => (init_xgen_extra(), xgen_extra_exports));
2782
+ const cats = await getNodeCategories2();
2783
+ return cats.map((c, i) => `${i + 1}. ${c.name ?? c.category ?? c}`).join("\n") || "\uCE74\uD14C\uACE0\uB9AC \uC5C6\uC74C.";
2784
+ },
2785
+ xgen_prompt_list: async (args) => {
2786
+ const { listPrompts: listPrompts2 } = await Promise.resolve().then(() => (init_xgen_extra(), xgen_extra_exports));
2787
+ const prompts = await listPrompts2({ language: args.language });
2788
+ if (!prompts.length) return "\uD504\uB86C\uD504\uD2B8 \uC5C6\uC74C.";
2789
+ return prompts.slice(0, 30).map(
2790
+ (p, i) => `${i + 1}. ${p.name ?? p.title ?? "?"} [${p.prompt_type ?? ""}] ${(p.content ?? "").slice(0, 40)}...`
2791
+ ).join("\n");
2792
+ },
2793
+ xgen_tool_store: async () => {
2794
+ const { listToolStore: listToolStore2 } = await Promise.resolve().then(() => (init_xgen_extra(), xgen_extra_exports));
2795
+ const tools2 = await listToolStore2();
2796
+ if (!tools2.length) return "\uACF5\uAC1C \uB3C4\uAD6C \uC5C6\uC74C.";
2797
+ return tools2.map((t, i) => `${i + 1}. ${t.name ?? t.tool_name ?? "?"} \u2014 ${(t.description ?? "").slice(0, 50)}`).join("\n");
2798
+ },
2799
+ xgen_user_tools: async () => {
2800
+ const { listUserTools: listUserTools2 } = await Promise.resolve().then(() => (init_xgen_extra(), xgen_extra_exports));
2801
+ const tools2 = await listUserTools2();
2802
+ if (!tools2.length) return "\uB0B4 \uB3C4\uAD6C \uC5C6\uC74C.";
2803
+ return tools2.map((t, i) => `${i + 1}. ${t.name ?? t.tool_name ?? "?"}`).join("\n");
2804
+ },
2805
+ xgen_schedule_list: async () => {
2806
+ const { listSchedules: listSchedules2 } = await Promise.resolve().then(() => (init_xgen_extra(), xgen_extra_exports));
2807
+ const sessions = await listSchedules2();
2808
+ if (!sessions.length) return "\uC2A4\uCF00\uC904 \uC5C6\uC74C.";
2809
+ return sessions.map((s, i) => `${i + 1}. ${s.name ?? s.session_id ?? "?"} ${s.cron_expression ?? ""} [${s.status ?? "?"}]`).join("\n");
2810
+ },
2811
+ xgen_trace_list: async (args) => {
2812
+ const { listTraces: listTraces2 } = await Promise.resolve().then(() => (init_xgen_extra(), xgen_extra_exports));
2813
+ const data = await listTraces2(args.workflow_id);
2814
+ const traces = data.traces ?? data ?? [];
2815
+ if (!traces.length) return "\uD2B8\uB808\uC774\uC2A4 \uC5C6\uC74C.";
2816
+ return traces.slice(0, 20).map(
2817
+ (t, i) => `${i + 1}. ${t.trace_id ?? t.id ?? "?"} [${t.status ?? "?"}] ${t.created_at ?? ""}`
2818
+ ).join("\n");
2819
+ },
2820
+ xgen_interaction_list: async (args) => {
2821
+ const { listInteractions: listInteractions2 } = await Promise.resolve().then(() => (init_xgen_extra(), xgen_extra_exports));
2822
+ const items = await listInteractions2(args.workflow_id, args.limit || 20);
2823
+ if (!items.length) return "\uC778\uD130\uB799\uC158 \uC5C6\uC74C.";
2824
+ return items.slice(0, 20).map(
2825
+ (it, i) => `${i + 1}. ${it.interaction_id ?? "?"} ${it.workflow_name ?? ""} [${it.status ?? "?"}]`
2826
+ ).join("\n");
2827
+ },
2828
+ xgen_mcp_sessions: async () => {
2829
+ const { listMcpSessions: listMcpSessions2 } = await Promise.resolve().then(() => (init_xgen_extra(), xgen_extra_exports));
2830
+ const sessions = await listMcpSessions2();
2831
+ if (!sessions.length) return "MCP \uC138\uC158 \uC5C6\uC74C.";
2832
+ return sessions.map(
2833
+ (s, i) => `${i + 1}. ${s.session_name ?? s.session_id ?? "?"} [${s.server_type ?? "?"}] ${s.status ?? ""}`
2834
+ ).join("\n");
2835
+ },
2836
+ xgen_graph_rag_query: async (args) => {
2837
+ const { queryGraphRAG: queryGraphRAG2 } = await Promise.resolve().then(() => (init_ontology(), ontology_exports));
2838
+ if (!args.query) return "\uC9C8\uC758 \uB0B4\uC6A9 \uD544\uC694.";
2839
+ const r = await queryGraphRAG2(args.query, args.graph_id);
2840
+ let out = `\uB2F5\uBCC0: ${r.answer ?? "\uC5C6\uC74C"}`;
2841
+ if (r.sources?.length) out += `
2842
+ \uCD9C\uCC98: ${r.sources.join(", ")}`;
2843
+ return out;
2844
+ },
2845
+ xgen_graph_stats: async (args) => {
2846
+ const { getGraphStats: getGraphStats2 } = await Promise.resolve().then(() => (init_ontology(), ontology_exports));
2847
+ const s = await getGraphStats2(args.graph_id);
2848
+ return `\uB178\uB4DC: ${s.total_nodes ?? 0} \xB7 \uC5E3\uC9C0: ${s.total_edges ?? 0} \xB7 \uD074\uB798\uC2A4: ${s.total_classes ?? 0} \xB7 \uC778\uC2A4\uD134\uC2A4: ${s.total_instances ?? 0}`;
2849
+ },
2850
+ xgen_server_status: async () => {
2851
+ const server = getServer();
2852
+ const auth = getAuth();
2853
+ return `\uC11C\uBC84: ${server}
2854
+ \uC0AC\uC6A9\uC790: ${auth?.username} (ID: ${auth?.userId})`;
2855
+ }
2856
+ };
2764
2857
 
2765
2858
  // src/mcp/client.ts
2766
2859
  import { spawn } from "child_process";
@@ -2955,24 +3048,22 @@ EXAMPLES OF GOOD RESPONSES:
2955
3048
  if (server && auth) {
2956
3049
  prompt2 += `
2957
3050
 
2958
- XGEN CONNECTED: ${server} as ${auth.username} (${env?.name ?? "default"})
3051
+ XGEN CONNECTED: ${server} as ${auth.username}
3052
+
3053
+ You have full access to XGEN platform. Available tools:
2959
3054
 
2960
- XGEN CAPABILITIES (use these tools naturally):
2961
- - xgen_workflow_list: \uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC804\uCCB4 \uBAA9\uB85D. \uBC30\uD3EC \uC0C1\uD0DC, ID \uD3EC\uD568.
2962
- - xgen_workflow_run: \uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC2E4\uD589. \uBC30\uD3EC \uC5EC\uBD80 \uBB34\uAD00\uD558\uAC8C \uBAA8\uB4E0 \uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC2E4\uD589 \uAC00\uB2A5. \uC0AC\uC6A9\uC790\uAC00 \uBC88\uD638\uB098 \uC774\uB984 \uB9D0\uD558\uBA74 \uC774\uC804 \uBAA9\uB85D\uC5D0\uC11C \uCC3E\uC544\uC11C \uBC14\uB85C \uC2E4\uD589.
2963
- - xgen_workflow_info: \uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC0C1\uC138 (\uB178\uB4DC, \uC5E3\uC9C0 \uC218 \uB4F1).
2964
- - xgen_collection_list: \uBB38\uC11C \uCEEC\uB809\uC158 \uBAA9\uB85D (RAG \uC9C0\uC2DD\uBCA0\uC774\uC2A4). \uBB38\uC11C \uC218, \uCCAD\uD06C \uC218 \uD3EC\uD568.
2965
- - xgen_document_list: \uD2B9\uC815 \uCEEC\uB809\uC158\uC758 \uBB38\uC11C \uBAA9\uB85D \uC870\uD68C.
2966
- - xgen_document_upload: \uD30C\uC77C\uC744 \uCEEC\uB809\uC158\uC5D0 \uC5C5\uB85C\uB4DC.
2967
- - xgen_graph_rag_query: GraphRAG \uC628\uD1A8\uB85C\uC9C0 \uC9C8\uC758. \uC9C0\uC2DD\uADF8\uB798\uD504 \uAE30\uBC18 \uB2F5\uBCC0.
2968
- - xgen_graph_stats: \uADF8\uB798\uD504 \uD1B5\uACC4 (\uB178\uB4DC, \uC5E3\uC9C0, \uD074\uB798\uC2A4, \uC778\uC2A4\uD134\uC2A4 \uC218).
2969
- - xgen_execution_history: \uD2B9\uC815 \uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC2E4\uD589 \uC774\uB825.
2970
- - xgen_server_status: \uC11C\uBC84 \uC5F0\uACB0 \uC0C1\uD0DC.
3055
+ WORKFLOW: xgen_workflow_list, xgen_workflow_run (\uBAA8\uB4E0 \uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC2E4\uD589 \uAC00\uB2A5, \uBC30\uD3EC \uBB34\uAD00), xgen_workflow_info, xgen_execution_history, xgen_workflow_performance, xgen_workflow_store, xgen_workflow_generate (\uC790\uC5F0\uC5B4\uB85C \uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC790\uB3D9 \uC0DD\uC131)
3056
+ DOCUMENTS: xgen_collection_list, xgen_document_list, xgen_document_upload
3057
+ NODES: xgen_node_list, xgen_node_search, xgen_node_categories
3058
+ PROMPTS: xgen_prompt_list
3059
+ TOOLS: xgen_tool_store, xgen_user_tools
3060
+ SCHEDULE: xgen_schedule_list
3061
+ TRACE: xgen_trace_list, xgen_interaction_list
3062
+ MCP: xgen_mcp_sessions
3063
+ ONTOLOGY: xgen_graph_rag_query, xgen_graph_stats
3064
+ SERVER: xgen_server_status
2971
3065
 
2972
- WORKFLOW EXECUTION NOTES:
2973
- - \uBAA8\uB4E0 \uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC2E4\uD589 \uAC00\uB2A5 (\uBC30\uD3EC/\uBE44\uBC30\uD3EC \uBB34\uAD00). deploy_key \uBD88\uD544\uC694.
2974
- - \uC2E4\uD589 \uC2DC input_data\uC5D0 \uC0AC\uC6A9\uC790 \uBA54\uC2DC\uC9C0\uB97C \uB123\uC74C.
2975
- - \uC2E4\uD589 \uACB0\uACFC\uC758 content\uAC00 \uC751\uB2F5.`;
3066
+ When user says a number \u2192 find it from previous list. "\uC2E4\uD589" \u2192 execute immediately.`;
2976
3067
  } else {
2977
3068
  prompt2 += `
2978
3069
  XGEN: Not connected. User can run /connect to connect.`;
@@ -3093,7 +3184,7 @@ async function agentRepl() {
3093
3184
  const env = getActiveEnvironment();
3094
3185
  console.log(chalk12.gray(` model ${provider.model}`));
3095
3186
  if (server && auth) {
3096
- console.log(chalk12.gray(` xgen ${chalk12.green("\u25CF")} ${auth.username}@${(env?.name ?? server).replace("https://", "")}`));
3187
+ console.log(chalk12.gray(` xgen ${chalk12.green("\u25CF")} ${auth.username}@${server.replace("https://", "").replace("http://", "")}`));
3097
3188
  } else {
3098
3189
  console.log(chalk12.gray(` xgen ${chalk12.red("\u25CB")} \uBBF8\uC5F0\uACB0`));
3099
3190
  }
@@ -3565,7 +3656,7 @@ ${result.answer}
3565
3656
  }
3566
3657
 
3567
3658
  // src/index.ts
3568
- var VERSION = "1.6.0";
3659
+ var VERSION = "2.0.0";
3569
3660
  var LOGO = chalk15.cyan(`
3570
3661
  \u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2588 \u2588\u2588
3571
3662
  \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588 \u2588\u2588\u2588\u2588 \u2588\u2588