neural-loom 0.2.55 → 0.2.56

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.
Files changed (49) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/cache/.previewinfo +1 -1
  4. package/.next/cache/.rscinfo +1 -1
  5. package/.next/cache/.tsbuildinfo +1 -1
  6. package/.next/diagnostics/route-bundle-stats.json +2 -2
  7. package/.next/fallback-build-manifest.json +3 -3
  8. package/.next/prerender-manifest.json +3 -3
  9. package/.next/server/app/_global-error.html +1 -1
  10. package/.next/server/app/_global-error.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  15. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  16. package/.next/server/app/_not-found.html +1 -1
  17. package/.next/server/app/_not-found.rsc +1 -1
  18. package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  19. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  20. package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  21. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  22. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  23. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  24. package/.next/server/app/index.html +1 -1
  25. package/.next/server/app/index.rsc +2 -2
  26. package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  27. package/.next/server/app/index.segments/_full.segment.rsc +2 -2
  28. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  29. package/.next/server/app/index.segments/_index.segment.rsc +1 -1
  30. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  31. package/.next/server/app/page_client-reference-manifest.js +1 -1
  32. package/.next/server/chunks/[root-of-the-server]__0_o7_jj._.js +1 -1
  33. package/.next/server/chunks/[root-of-the-server]__0_o7_jj._.js.map +1 -1
  34. package/.next/server/chunks/ssr/_0t7oqy6._.js +6 -1
  35. package/.next/server/chunks/ssr/_0t7oqy6._.js.map +1 -1
  36. package/.next/server/middleware-build-manifest.js +3 -3
  37. package/.next/server/pages/404.html +1 -1
  38. package/.next/server/pages/500.html +1 -1
  39. package/.next/server/server-reference-manifest.js +1 -1
  40. package/.next/server/server-reference-manifest.json +1 -1
  41. package/.next/static/chunks/162be8draqhn..js +11 -0
  42. package/.next/trace +1 -1
  43. package/.next/trace-build +1 -1
  44. package/package.json +1 -1
  45. package/src/app/components/DbExplorer.tsx +293 -16
  46. package/.next/static/chunks/0ulfmf9nsz_o-.js +0 -6
  47. /package/.next/static/{PtixAwrSwsBc6DJtUuNCf → E5W0YoY_yEbo_xJeWaMEB}/_buildManifest.js +0 -0
  48. /package/.next/static/{PtixAwrSwsBc6DJtUuNCf → E5W0YoY_yEbo_xJeWaMEB}/_clientMiddlewareManifest.js +0 -0
  49. /package/.next/static/{PtixAwrSwsBc6DJtUuNCf → E5W0YoY_yEbo_xJeWaMEB}/_ssgManifest.js +0 -0
@@ -64,6 +64,9 @@ export default function DbExplorer({ workspaceRoot }: DbExplorerProps) {
64
64
  affectedRows?: number;
65
65
  } | null>(null);
66
66
 
67
+ const [editingCell, setEditingCell] = useState<{ rowIndex: number; field: string; value: string } | null>(null);
68
+ const [editStatus, setEditStatus] = useState<{ rowIndex: number; field: string; status: 'saving' | 'success' | 'error'; message?: string } | null>(null);
69
+
67
70
  // Connection management modal state
68
71
  const [showAddModal, setShowAddModal] = useState(false);
69
72
  const [isNewGlobal, setIsNewGlobal] = useState(false);
@@ -293,6 +296,181 @@ export default function DbExplorer({ workspaceRoot }: DbExplorerProps) {
293
296
  }
294
297
  };
295
298
 
299
+ const parseTableName = (sqlQuery: string): string | null => {
300
+ const match = sqlQuery.match(/from\s+([a-zA-Z0-9_\`"\[\]\.]+)/i);
301
+ if (!match) return null;
302
+ let tbl = match[1].trim();
303
+ tbl = tbl.replace(/[\`"\[\]]/g, "");
304
+ const parts = tbl.split(".");
305
+ return parts[parts.length - 1];
306
+ };
307
+
308
+ const handleCellSubmit = async (rowIndex: number, field: string, newValue: string, oldValue: any) => {
309
+ if (activeProfile?.readOnly) {
310
+ alert("Database connection is Read-Only. Updates are disabled.");
311
+ return;
312
+ }
313
+
314
+ const tableName = parseTableName(sql);
315
+ if (!tableName) {
316
+ alert("Could not extract table name from query for inline edit. Please ensure your query includes 'FROM tableName'.");
317
+ return;
318
+ }
319
+
320
+ setEditStatus({ rowIndex, field, status: 'saving' });
321
+
322
+ try {
323
+ let cols = tableColumns[tableName];
324
+ if (!cols) {
325
+ const res = await fetch(
326
+ `/api/sql/schema?action=describe_table&table=${encodeURIComponent(tableName)}&root=${encodeURIComponent(
327
+ workspaceRoot
328
+ )}`
329
+ );
330
+ if (res.ok) {
331
+ const data = await res.json();
332
+ if (data.success && data.columns) {
333
+ cols = data.columns;
334
+ setTableColumns((prev) => ({ ...prev, [tableName]: data.columns }));
335
+ }
336
+ }
337
+ }
338
+
339
+ if (!cols) {
340
+ throw new Error(`Could not load schema columns for table "${tableName}".`);
341
+ }
342
+
343
+ const pkCol = cols.find((c) => c.isPrimaryKey);
344
+ if (!pkCol) {
345
+ throw new Error(`Table "${tableName}" does not have a primary key. Inline editing requires a primary key.`);
346
+ }
347
+
348
+ const row = queryResult?.rows[rowIndex];
349
+ if (!row || !(pkCol.name in row)) {
350
+ throw new Error(`Primary key column "${pkCol.name}" was not returned in the query results. Please include it in your SELECT statement.`);
351
+ }
352
+
353
+ const pkValue = row[pkCol.name];
354
+ const targetColSchema = cols.find((c) => c.name === field);
355
+ if (!targetColSchema) {
356
+ throw new Error(`Column "${field}" was not found in schema columns.`);
357
+ }
358
+
359
+ const isNumeric = (type: string) => {
360
+ const t = type.toLowerCase();
361
+ return t.includes("int") || t.includes("decimal") || t.includes("numeric") || t.includes("float") || t.includes("double") || t.includes("real");
362
+ };
363
+
364
+ let setExpr = "";
365
+ if (newValue.toUpperCase() === "NULL") {
366
+ setExpr = `${field} = NULL`;
367
+ } else if (isNumeric(targetColSchema.type)) {
368
+ if (newValue === "" || isNaN(Number(newValue))) {
369
+ throw new Error(`Value "${newValue}" is not a valid number for column "${field}".`);
370
+ }
371
+ setExpr = `${field} = ${newValue}`;
372
+ } else {
373
+ setExpr = `${field} = '${newValue.replace(/'/g, "''")}'`;
374
+ }
375
+
376
+ let pkExpr = "";
377
+ if (isNumeric(pkCol.type)) {
378
+ pkExpr = `${pkCol.name} = ${pkValue}`;
379
+ } else {
380
+ pkExpr = `${pkCol.name} = '${String(pkValue).replace(/'/g, "''")}'`;
381
+ }
382
+
383
+ const updateSql = `UPDATE ${tableName} SET ${setExpr} WHERE ${pkExpr};`;
384
+
385
+ const res = await fetch("/api/sql/query", {
386
+ method: "POST",
387
+ headers: { "Content-Type": "application/json" },
388
+ body: JSON.stringify({
389
+ sql: updateSql,
390
+ root: workspaceRoot,
391
+ }),
392
+ });
393
+
394
+ const data = await res.json();
395
+ if (res.ok && data.success) {
396
+ if (queryResult) {
397
+ const updatedRows = [...queryResult.rows];
398
+ let typedVal: any = newValue;
399
+ if (newValue.toUpperCase() === "NULL") {
400
+ typedVal = null;
401
+ } else if (isNumeric(targetColSchema.type)) {
402
+ typedVal = Number(newValue);
403
+ }
404
+ updatedRows[rowIndex] = {
405
+ ...updatedRows[rowIndex],
406
+ [field]: typedVal,
407
+ };
408
+ setQueryResult({
409
+ ...queryResult,
410
+ rows: updatedRows,
411
+ });
412
+ }
413
+ setEditStatus({ rowIndex, field, status: 'success' });
414
+ setTimeout(() => setEditStatus(null), 1500);
415
+ } else {
416
+ throw new Error(data.error || "Update database query failed.");
417
+ }
418
+ } catch (err) {
419
+ const error = err as Error;
420
+ setEditStatus({ rowIndex, field, status: 'error', message: error.message });
421
+ alert(`Inline Update Failed:\n${error.message}`);
422
+ }
423
+ };
424
+
425
+ const handleExportCSV = () => {
426
+ if (!queryResult || queryResult.rows.length === 0) return;
427
+ try {
428
+ const headers = queryResult.fields.join(",");
429
+ const lines = queryResult.rows.map((row) => {
430
+ return queryResult.fields.map((f) => {
431
+ const val = row[f];
432
+ if (val === null) return "NULL";
433
+ const str = String(val);
434
+ if (str.includes(",") || str.includes('"') || str.includes("\n") || str.includes("\r")) {
435
+ return `"${str.replace(/"/g, '""')}"`;
436
+ }
437
+ return str;
438
+ }).join(",");
439
+ });
440
+
441
+ const csvContent = [headers, ...lines].join("\r\n");
442
+ const blob = new Blob([csvContent], { type: "text/csv;charset=utf-8;" });
443
+ const url = URL.createObjectURL(blob);
444
+ const link = document.createElement("a");
445
+ link.setAttribute("href", url);
446
+ link.setAttribute("download", `query-results-${Date.now()}.csv`);
447
+ document.body.appendChild(link);
448
+ link.click();
449
+ document.body.removeChild(link);
450
+ } catch (err) {
451
+ console.error("Export CSV failed:", err);
452
+ alert("Failed to export as CSV");
453
+ }
454
+ };
455
+
456
+ const handleExportJSON = () => {
457
+ if (!queryResult || queryResult.rows.length === 0) return;
458
+ try {
459
+ const jsonContent = JSON.stringify(queryResult.rows, null, 2);
460
+ const blob = new Blob([jsonContent], { type: "application/json;charset=utf-8;" });
461
+ const url = URL.createObjectURL(blob);
462
+ const link = document.createElement("a");
463
+ link.setAttribute("href", url);
464
+ link.setAttribute("download", `query-results-${Date.now()}.json`);
465
+ document.body.appendChild(link);
466
+ link.click();
467
+ document.body.removeChild(link);
468
+ } catch (err) {
469
+ console.error("Export JSON failed:", err);
470
+ alert("Failed to export as JSON");
471
+ }
472
+ };
473
+
296
474
  // Run SQL Query
297
475
  const handleRunQuery = async () => {
298
476
  if (!sql.trim() || !activeId) return;
@@ -558,13 +736,21 @@ export default function DbExplorer({ workspaceRoot }: DbExplorerProps) {
558
736
  {queryResult && (
559
737
  <div style={styles.resultsWrapper}>
560
738
  <div style={styles.resultsMeta}>
561
- <span>
562
- Query completed.{" "}
563
- {queryResult.affectedRows !== undefined
564
- ? `Affected rows: ${queryResult.affectedRows}`
565
- : `Returned ${queryResult.rows.length} rows`}
566
- </span>
567
- <span>Duration: {queryResult.durationMs}ms</span>
739
+ <div style={{ display: "flex", alignItems: "center", gap: "0.5rem" }}>
740
+ <span>
741
+ Query completed.{" "}
742
+ {queryResult.affectedRows !== undefined
743
+ ? `Affected rows: ${queryResult.affectedRows}`
744
+ : `Returned ${queryResult.rows.length} rows`}
745
+ </span>
746
+ <span>Duration: {queryResult.durationMs}ms</span>
747
+ </div>
748
+ {queryResult.rows.length > 0 && (
749
+ <div style={{ display: "flex", gap: "0.4rem" }}>
750
+ <button onClick={handleExportCSV} style={styles.exportBtn}>📥 Export CSV</button>
751
+ <button onClick={handleExportJSON} style={styles.exportBtn}>📥 Export JSON</button>
752
+ </div>
753
+ )}
568
754
  </div>
569
755
 
570
756
  {queryResult.rows.length > 0 ? (
@@ -582,15 +768,75 @@ export default function DbExplorer({ workspaceRoot }: DbExplorerProps) {
582
768
  <tbody>
583
769
  {queryResult.rows.map((row, idx) => (
584
770
  <tr key={idx} style={idx % 2 === 0 ? styles.trEven : styles.trOdd}>
585
- {queryResult.fields.map((f) => (
586
- <td key={f} style={styles.td}>
587
- {row[f] === null
588
- ? "NULL"
589
- : typeof row[f] === "object"
590
- ? JSON.stringify(row[f])
591
- : String(row[f])}
592
- </td>
593
- ))}
771
+ {queryResult.fields.map((f) => {
772
+ const isEditing = editingCell && editingCell.rowIndex === idx && editingCell.field === f;
773
+ const isSaving = editStatus && editStatus.rowIndex === idx && editStatus.field === f && editStatus.status === 'saving';
774
+ const isSuccess = editStatus && editStatus.rowIndex === idx && editStatus.field === f && editStatus.status === 'success';
775
+ const isError = editStatus && editStatus.rowIndex === idx && editStatus.field === f && editStatus.status === 'error';
776
+
777
+ let cellStyle = { ...styles.td, ...styles.editableCell };
778
+ if (isSaving) {
779
+ cellStyle = { ...cellStyle, backgroundColor: "rgba(168, 85, 247, 0.15)" };
780
+ } else if (isSuccess) {
781
+ cellStyle = { ...cellStyle, backgroundColor: "rgba(16, 185, 129, 0.25)" };
782
+ } else if (isError) {
783
+ cellStyle = { ...cellStyle, backgroundColor: "rgba(239, 68, 68, 0.25)" };
784
+ }
785
+
786
+ return (
787
+ <td
788
+ key={f}
789
+ style={cellStyle}
790
+ onDoubleClick={() => {
791
+ if (activeProfile?.readOnly) {
792
+ alert("Database connection is Read-Only. Editing is disabled.");
793
+ return;
794
+ }
795
+ setEditingCell({
796
+ rowIndex: idx,
797
+ field: f,
798
+ value: row[f] === null ? "NULL" : String(row[f]),
799
+ });
800
+ }}
801
+ className="db-cell"
802
+ title="Double click to edit cell"
803
+ >
804
+ {isEditing ? (
805
+ <input
806
+ style={styles.cellInput}
807
+ value={editingCell.value}
808
+ autoFocus
809
+ onChange={(e) => setEditingCell({ ...editingCell, value: e.target.value })}
810
+ onKeyDown={async (e) => {
811
+ if (e.key === "Enter") {
812
+ e.preventDefault();
813
+ const newVal = editingCell.value;
814
+ setEditingCell(null);
815
+ if (newVal !== (row[f] === null ? "NULL" : String(row[f]))) {
816
+ await handleCellSubmit(idx, f, newVal, row[f]);
817
+ }
818
+ } else if (e.key === "Escape") {
819
+ setEditingCell(null);
820
+ }
821
+ }}
822
+ onBlur={async () => {
823
+ const newVal = editingCell.value;
824
+ setEditingCell(null);
825
+ if (newVal !== (row[f] === null ? "NULL" : String(row[f]))) {
826
+ await handleCellSubmit(idx, f, newVal, row[f]);
827
+ }
828
+ }}
829
+ />
830
+ ) : (
831
+ row[f] === null
832
+ ? "NULL"
833
+ : typeof row[f] === "object"
834
+ ? JSON.stringify(row[f])
835
+ : String(row[f])
836
+ )}
837
+ </td>
838
+ );
839
+ })}
594
840
  </tr>
595
841
  ))}
596
842
  </tbody>
@@ -1119,6 +1365,7 @@ const styles: { [key: string]: React.CSSProperties } = {
1119
1365
  resultsMeta: {
1120
1366
  display: "flex",
1121
1367
  justifyContent: "space-between",
1368
+ alignItems: "center",
1122
1369
  fontSize: "0.75rem",
1123
1370
  color: "var(--muted)",
1124
1371
  marginBottom: "0.5rem",
@@ -1152,6 +1399,32 @@ const styles: { [key: string]: React.CSSProperties } = {
1152
1399
  color: "#cbd5e1",
1153
1400
  whiteSpace: "nowrap",
1154
1401
  },
1402
+ exportBtn: {
1403
+ padding: "0.2rem 0.5rem",
1404
+ borderRadius: "4px",
1405
+ border: "1px solid var(--border)",
1406
+ backgroundColor: "rgba(255, 255, 255, 0.02)",
1407
+ color: "var(--muted)",
1408
+ fontSize: "0.7rem",
1409
+ fontWeight: 600,
1410
+ cursor: "pointer",
1411
+ transition: "all 0.15s ease",
1412
+ },
1413
+ cellInput: {
1414
+ width: "100%",
1415
+ backgroundColor: "#070a12",
1416
+ border: "1px solid var(--border-focus)",
1417
+ borderRadius: "3px",
1418
+ color: "#fff",
1419
+ padding: "0.1rem 0.3rem",
1420
+ fontSize: "0.8rem",
1421
+ fontFamily: "monospace",
1422
+ outline: "none",
1423
+ },
1424
+ editableCell: {
1425
+ cursor: "pointer",
1426
+ transition: "all 0.15s ease",
1427
+ },
1155
1428
  trEven: {
1156
1429
  backgroundColor: "transparent",
1157
1430
  },
@@ -1291,6 +1564,10 @@ if (typeof document !== "undefined") {
1291
1564
  0% { transform: rotate(0deg); }
1292
1565
  100% { transform: rotate(360deg); }
1293
1566
  }
1567
+ .db-cell:hover {
1568
+ background-color: rgba(255, 255, 255, 0.03) !important;
1569
+ outline: 1px dashed rgba(255, 255, 255, 0.2);
1570
+ }
1294
1571
  `;
1295
1572
  document.head.appendChild(style);
1296
1573
  }
@@ -1,6 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,66381,e=>{"use strict";var t=e.i(43476),s=e.i(71645),r=e.i(74080);let a={display:"flex",height:"100%",width:"100%",backgroundColor:"#05070a",color:"#cbd5e1",fontSize:"0.875rem",minHeight:0},n={width:"280px",borderRight:"1px solid var(--border)",display:"flex",flexDirection:"column",minHeight:0,backgroundColor:"rgba(10, 15, 24, 0.4)",flexShrink:0},l={display:"flex",flexDirection:"column",padding:"1rem",minHeight:0},o={display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"0.75rem"},i={fontWeight:700,letterSpacing:"0.05em",textTransform:"uppercase",fontSize:"0.75rem",color:"var(--muted)"},d={padding:"0.2rem 0.5rem",borderRadius:"4px",border:"1px solid var(--primary)",backgroundColor:"transparent",color:"var(--primary)",fontSize:"0.7rem",fontWeight:600,cursor:"pointer"},c={display:"flex",flexDirection:"column",gap:"0.4rem",overflowY:"auto",maxHeight:"220px"},u={fontSize:"0.65rem",fontWeight:600,color:"var(--muted)",marginTop:"0.5rem",marginBottom:"0.2rem",letterSpacing:"0.05em"},p={display:"flex",justifyContent:"space-between",alignItems:"center",padding:"0.5rem 0.6rem",borderRadius:"6px",backgroundColor:"rgba(255, 255, 255, 0.02)",border:"1px solid var(--border)",cursor:"pointer",transition:"all 0.2s ease"},m={backgroundColor:"rgba(109, 40, 217, 0.08)",border:"1px solid var(--border-focus)",boxShadow:"0 0 10px rgba(109, 40, 217, 0.1)"},h={display:"flex",flexDirection:"column",gap:"0.15rem",flex:1,minWidth:0},g={fontWeight:600,fontSize:"0.8rem",color:"#fff",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},x={fontSize:"0.7rem",color:"var(--muted)",textTransform:"uppercase"},f={background:"none",border:"none",color:"rgba(239, 68, 68, 0.4)",cursor:"pointer",fontSize:"0.75rem",padding:"0.25rem"},y={display:"flex",flexDirection:"column",gap:"0.25rem",overflowY:"auto",flex:1,minHeight:0},b={fontSize:"0.75rem",color:"var(--muted)",textAlign:"center",padding:"1rem 0"},j={display:"flex",flexDirection:"column"},v={display:"flex",alignItems:"center",padding:"0.35rem 0.5rem",borderRadius:"4px",cursor:"pointer",userSelect:"none",transition:"background 0.2s ease"},_={marginRight:"0.4rem",fontSize:"0.9rem"},w={flex:1,fontSize:"0.8rem",color:"#e2e8f0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},k={fontSize:"0.6rem",color:"var(--muted)",marginLeft:"0.25rem"},S={display:"flex",flexDirection:"column",gap:"0.2rem",paddingLeft:"1.5rem",marginTop:"0.15rem",borderLeft:"1px dashed rgba(255,255,255,0.06)",marginLeft:"0.8rem",marginBottom:"0.25rem"},C={display:"flex",alignItems:"center",padding:"0.15rem 0.25rem",fontSize:"0.75rem"},N={marginRight:"0.3rem",fontSize:"0.7rem"},W={flex:1,color:"var(--muted)",overflow:"hidden",textOverflow:"ellipsis"},R={fontSize:"0.65rem",color:"rgba(109, 40, 217, 0.75)",fontFamily:"monospace",paddingLeft:"0.5rem"},E={flex:1,display:"flex",flexDirection:"column",minHeight:0,backgroundColor:"#05070a"},T={display:"flex",justifyContent:"space-between",alignItems:"center",padding:"0.75rem 1rem",borderBottom:"1px solid var(--border)",backgroundColor:"rgba(15, 23, 42, 0.3)",flexShrink:0},P={fontSize:"0.75rem",color:"var(--muted)"},L={fontSize:"0.8rem",fontWeight:600,color:"#fff",display:"flex",alignItems:"center",gap:"0.4rem"},I={padding:"0.1rem 0.4rem",borderRadius:"4px",backgroundColor:"rgba(234, 179, 8, 0.12)",color:"#eab308",fontSize:"0.65rem",fontWeight:700,border:"1px solid rgba(234, 179, 8, 0.2)"},O={padding:"0.4rem 0.9rem",borderRadius:"6px",border:"none",backgroundColor:"var(--primary)",color:"#fff",fontSize:"0.8rem",fontWeight:600,transition:"all 0.2s ease"},D={height:"180px",borderBottom:"1px solid var(--border)",position:"relative",flexShrink:0},q={width:"100%",height:"100%",backgroundColor:"#080c14",border:"none",resize:"none",color:"#e2e8f0",fontFamily:"monospace",fontSize:"0.85rem",padding:"1rem",outline:"none",lineHeight:"1.4"},A={flex:1,display:"flex",flexDirection:"column",minHeight:0,padding:"1rem"},z={padding:"1rem",borderRadius:"8px",backgroundColor:"rgba(239, 68, 68, 0.08)",border:"1px solid rgba(239, 68, 68, 0.2)",overflowY:"auto"},B={margin:0,fontFamily:"monospace",fontSize:"0.8rem",color:"#f87171",whiteSpace:"pre-wrap"},F={marginTop:"1rem",padding:"0.75rem",borderRadius:"6px",backgroundColor:"rgba(0, 0, 0, 0.3)",border:"1px solid var(--border)"},M={display:"block",padding:"0.5rem",backgroundColor:"#090d16",borderRadius:"4px",fontFamily:"monospace",fontSize:"0.8rem",color:"var(--primary)",border:"1px solid var(--border)"},$={display:"flex",flexDirection:"column",height:"100%",minHeight:0},H={display:"flex",justifyContent:"space-between",fontSize:"0.75rem",color:"var(--muted)",marginBottom:"0.5rem"},G={flex:1,overflow:"auto",border:"1px solid var(--border)",borderRadius:"6px"},Y={width:"100%",borderCollapse:"collapse",fontFamily:"monospace",fontSize:"0.8rem"},U={padding:"0.5rem 0.75rem",textAlign:"left",backgroundColor:"#0f172a",borderBottom:"1px solid var(--border)",color:"#94a3b8",fontWeight:600,position:"sticky",top:0,zIndex:1},Q={padding:"0.4rem 0.75rem",borderBottom:"1px solid rgba(255, 255, 255, 0.03)",color:"#cbd5e1",whiteSpace:"nowrap"},J={backgroundColor:"transparent"},K={backgroundColor:"rgba(255, 255, 255, 0.01)"},V={flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--muted)",fontSize:"0.8rem",textAlign:"center"},X={flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"1rem"},Z={width:"24px",height:"24px",border:"3px solid rgba(109, 40, 217, 0.15)",borderTop:"3px solid var(--primary)",borderRadius:"50%",animation:"spin 1s linear infinite"},ee={width:"12px",height:"12px",border:"2px solid rgba(255, 255, 255, 0.1)",borderTop:"2px solid var(--muted)",borderRadius:"50%",animation:"spin 1s linear infinite"},et={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:999},es={width:"480px",backgroundColor:"#0d131f",borderRadius:"12px",border:"1px solid var(--border-focus)",padding:"1.5rem",boxShadow:"0 4px 24px rgba(0, 0, 0, 0.5)"},er={display:"flex",flexDirection:"column",gap:"0.35rem",marginBottom:"1rem"},ea={fontSize:"0.75rem",fontWeight:600,color:"var(--muted)"},en={padding:"0.5rem",borderRadius:"6px",border:"1px solid var(--border)",backgroundColor:"#070a12",color:"#fff",outline:"none",fontSize:"0.8rem"},el={padding:"0.5rem",borderRadius:"6px",border:"1px solid var(--border)",backgroundColor:"#070a12",color:"#fff",outline:"none",fontSize:"0.8rem"},eo={padding:"0.5rem",borderRadius:"6px",fontSize:"0.75rem",marginBottom:"1rem"},ei={display:"flex",justifyContent:"space-between",marginTop:"1.5rem"},ed={padding:"0.4rem 0.75rem",borderRadius:"6px",border:"1px solid var(--border)",backgroundColor:"transparent",color:"var(--muted)",fontSize:"0.75rem",fontWeight:600,cursor:"pointer"},ec={padding:"0.4rem 0.75rem",borderRadius:"6px",border:"none",backgroundColor:"transparent",color:"var(--muted)",fontSize:"0.75rem",fontWeight:600,cursor:"pointer"},eu={padding:"0.4rem 0.75rem",borderRadius:"6px",border:"none",backgroundColor:"var(--primary)",color:"#fff",fontSize:"0.75rem",fontWeight:600,cursor:"pointer"};if("u">typeof document){let e=document.createElement("style");e.innerHTML=`
2
- @keyframes spin {
3
- 0% { transform: rotate(0deg); }
4
- 100% { transform: rotate(360deg); }
5
- }
6
- `,document.head.appendChild(e)}e.s(["default",0,function({workspaceRoot:e}){let[ep,em]=(0,s.useState)({global:[],workspace:[]}),[eh,eg]=(0,s.useState)(null),[ex,ef]=(0,s.useState)(!0),[ey,eb]=(0,s.useState)([]),[ej,ev]=(0,s.useState)(null),[e_,ew]=(0,s.useState)({}),[ek,eS]=(0,s.useState)(!1),[eC,eN]=(0,s.useState)("SELECT * FROM sqlite_master;"),[eW,eR]=(0,s.useState)(!1),[eE,eT]=(0,s.useState)(null),[eP,eL]=(0,s.useState)(null),[eI,eO]=(0,s.useState)(!1),[eD,eq]=(0,s.useState)(!1),[eA,ez]=(0,s.useState)({id:"",name:"",type:"sqlite",filepath:"./dev.db",host:"localhost",port:5432,database:"postgres",username:"postgres",password:"",ssl:!1,readOnly:!0}),[eB,eF]=(0,s.useState)(!1),[eM,e$]=(0,s.useState)(null),eH=async()=>{try{let t=await fetch(`/api/sql/connections?root=${encodeURIComponent(e)}`);if(t.ok){let e=await t.json();e.success&&(em({global:e.global||[],workspace:e.workspace||[]}),eg(e.activeId),ef(e.isActiveGlobal))}}catch(e){console.error("Failed to load connection profiles:",e)}},eG=async()=>{if(!eh)return void eb([]);eS(!0);try{let t=await fetch(`/api/sql/schema?action=list_tables&root=${encodeURIComponent(e)}`);if(t.ok){let e=await t.json();e.success?(eb(e.tables||[]),eT(null)):eT(e.error||"Failed to load database schema.")}else{let e=await t.json();eT(e.error||"Failed to load database schema.")}}catch(e){console.error("Failed to load schema:",e)}finally{eS(!1)}},eY=async t=>{if(e_[t])return void ev(ej===t?null:t);try{let s=await fetch(`/api/sql/schema?action=describe_table&table=${encodeURIComponent(t)}&root=${encodeURIComponent(e)}`);if(s.ok){let e=await s.json();e.success&&(ew(s=>({...s,[t]:e.columns})),ev(t))}}catch(e){console.error(`Failed to load columns for table ${t}:`,e)}};(0,s.useEffect)(()=>{eH()},[e]),(0,s.useEffect)(()=>{eG(),eL(null),ev(null),ew({});let e=ex?ep.global.find(e=>e.id===eh):ep.workspace.find(e=>e.id===eh);e&&("sqlite"===e.type?eN("SELECT name, type FROM sqlite_master WHERE type='table';"):"mssql"===e.type?eN("SELECT * FROM sys.tables;"):eN("SELECT * FROM information_schema.tables LIMIT 10;"))},[eh,ex,ep.global.length,ep.workspace.length]);let eU=async(t,s)=>{try{(await fetch("/api/sql/connections",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"set_active",profileId:t,isGlobal:s,root:e})})).ok&&(eg(t),ef(s))}catch(e){console.error("Failed to set active profile:",e)}},eQ=async()=>{e$(null);try{let t=await fetch("/api/sql/connections",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"test",profile:eA,root:e})}),s=await t.json();s.success?e$({success:!0,message:"Connection test successful!"}):e$({success:!1,message:s.error||"Connection test failed."})}catch(e){e$({success:!1,message:e.message||"Failed to make test query."})}},eJ=async t=>{if(t.preventDefault(),!eA.name||!eA.type)return;eF(!0);let s=eA.id||`profile_${Math.random().toString(36).substring(7)}`,r={...eA,id:s,name:eA.name,type:eA.type};try{(await fetch("/api/sql/connections",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"save",profile:r,isGlobal:eD,root:e})})).ok&&(await eH(),eO(!1),eh||eU(s,eD))}catch(e){console.error("Failed to save profile:",e)}finally{eF(!1)}},eK=async(t,s)=>{if(confirm("Are you sure you want to delete this connection profile?"))try{(await fetch("/api/sql/connections",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"delete",profileId:t,isGlobal:s,root:e})})).ok&&(await eH(),eh===t&&eg(null))}catch(e){console.error("Failed to delete connection profile:",e)}},eV=async()=>{if(eC.trim()&&eh){eR(!0),eT(null),eL(null);try{let t=await fetch("/api/sql/query",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sql:eC.trim(),root:e})}),s=await t.json();t.ok&&s.success?(eL({rows:s.rows||[],fields:s.fields||[],durationMs:s.durationMs||0,affectedRows:s.affectedRows}),(eC.toLowerCase().includes("create table")||eC.toLowerCase().includes("drop table")||eC.toLowerCase().includes("alter table"))&&eG()):eT(s.error||"Failed to execute query.")}catch(e){eT(e.message||"An unexpected error occurred during execution.")}finally{eR(!1)}}},eX=ex?ep.global.find(e=>e.id===eh):ep.workspace.find(e=>e.id===eh);return(0,t.jsxs)("div",{style:a,children:[(0,t.jsxs)("div",{style:n,children:[(0,t.jsxs)("div",{style:l,children:[(0,t.jsxs)("div",{style:o,children:[(0,t.jsx)("span",{style:i,children:"Connections"}),(0,t.jsx)("button",{style:d,onClick:()=>{e$(null),ez({id:"",name:"",type:"sqlite",filepath:"./dev.db",host:"localhost",port:5432,database:"postgres",username:"postgres",password:"",ssl:!1,readOnly:!0}),eq(!1),eO(!0)},title:"Add Database Connection Profile",children:"➕ Add"})]}),(0,t.jsxs)("div",{style:c,children:[0===ep.global.length&&0===ep.workspace.length&&(0,t.jsx)("div",{style:b,children:"No connections configured. Add one to start."}),ep.workspace.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{style:u,children:"WORKSPACE CONNECTIONS"}),ep.workspace.map(e=>(0,t.jsxs)("div",{style:{...p,...eh===e.id&&!ex?m:{}},onClick:()=>eU(e.id,!1),children:[(0,t.jsxs)("div",{style:h,children:[(0,t.jsxs)("span",{style:g,children:["📁 ",e.name]}),(0,t.jsx)("span",{style:x,children:e.type})]}),(0,t.jsx)("button",{style:f,onClick:t=>{t.stopPropagation(),eK(e.id,!1)},children:"✖"})]},e.id))]}),ep.global.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{style:u,children:"GLOBAL CONNECTIONS"}),ep.global.map(e=>(0,t.jsxs)("div",{style:{...p,...eh===e.id&&ex?m:{}},onClick:()=>eU(e.id,!0),children:[(0,t.jsxs)("div",{style:h,children:[(0,t.jsxs)("span",{style:g,children:["🌐 ",e.name]}),(0,t.jsx)("span",{style:x,children:e.type})]}),(0,t.jsx)("button",{style:f,onClick:t=>{t.stopPropagation(),eK(e.id,!0)},children:"✖"})]},e.id))]})]})]}),(0,t.jsxs)("div",{style:{...l,flex:1,borderTop:"1px solid var(--border)"},children:[(0,t.jsxs)("div",{style:o,children:[(0,t.jsx)("span",{style:i,children:"Schema Tables"}),ek&&(0,t.jsx)("span",{style:ee})]}),(0,t.jsxs)("div",{style:y,children:[!eh&&(0,t.jsx)("div",{style:b,children:"Select an active connection to view tables."}),eh&&0===ey.length&&!ek&&(0,t.jsx)("div",{style:b,children:"No tables found in database schema."}),ey.map(e=>(0,t.jsxs)("div",{style:j,children:[(0,t.jsxs)("div",{style:v,onClick:()=>eY(e.name),children:[(0,t.jsx)("span",{style:_,children:"view"===e.type?"👁️":"📊"}),(0,t.jsx)("span",{style:w,children:e.name}),(0,t.jsx)("span",{style:k,children:ej===e.name?"▼":"▶"})]}),ej===e.name&&e_[e.name]&&(0,t.jsx)("div",{style:S,children:e_[e.name].map(e=>(0,t.jsxs)("div",{style:C,children:[(0,t.jsx)("span",{style:N,children:e.isPrimaryKey?"🔑":e.isForeignKey?"🔗":"▫"}),(0,t.jsx)("span",{style:W,title:e.type,children:e.name}),(0,t.jsx)("span",{style:R,children:e.type.toLowerCase().substring(0,12)})]},e.name))})]},e.name))]})]})]}),(0,t.jsxs)("div",{style:E,children:[(0,t.jsxs)("div",{style:T,children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[(0,t.jsx)("span",{style:P,children:"Active Connection:"}),eX?(0,t.jsxs)("span",{style:L,children:[ex?"🌐":"📁"," ",eX.name," (",eX.type,")",eX.readOnly&&(0,t.jsx)("span",{style:I,children:"Read-Only"})]}):(0,t.jsx)("span",{style:{...L,color:"var(--danger)"},children:"No Connection Selected"})]}),(0,t.jsx)("button",{style:{...O,opacity:!eh||eW?.6:1,cursor:!eh||eW?"not-allowed":"pointer"},onClick:eV,disabled:!eh||eW,children:eW?"⌛ Running...":"⚡ Execute Query (F5)"})]}),(0,t.jsx)("div",{style:D,children:(0,t.jsx)("textarea",{style:q,value:eC,onChange:e=>eN(e.target.value),placeholder:"Write your SQL query script here...",onKeyDown:e=>{("F5"===e.key||e.ctrlKey&&"Enter"===e.key)&&(e.preventDefault(),eV())}})}),(0,t.jsxs)("div",{style:A,children:[eE&&(0,t.jsxs)("div",{style:z,children:[(0,t.jsx)("h4",{style:{margin:"0 0 0.5rem 0",color:"var(--danger)"},children:"⚠️ Execution Error"}),(0,t.jsx)("pre",{style:B,children:eE}),eE.includes("not installed")&&(0,t.jsxs)("div",{style:F,children:[(0,t.jsx)("p",{style:{margin:"0 0 0.5rem 0"},children:"To resolve this, run this installer command in your workspace terminal:"}),(0,t.jsx)("code",{style:M,children:eX?.type==="sqlite"?"npm install better-sqlite3":eX?.type==="postgres"?"npm install pg":eX?.type==="mysql"?"npm install mysql2":"npm install mssql"})]})]}),eP&&(0,t.jsxs)("div",{style:$,children:[(0,t.jsxs)("div",{style:H,children:[(0,t.jsxs)("span",{children:["Query completed."," ",void 0!==eP.affectedRows?`Affected rows: ${eP.affectedRows}`:`Returned ${eP.rows.length} rows`]}),(0,t.jsxs)("span",{children:["Duration: ",eP.durationMs,"ms"]})]}),eP.rows.length>0?(0,t.jsx)("div",{style:G,children:(0,t.jsxs)("table",{style:Y,children:[(0,t.jsx)("thead",{children:(0,t.jsx)("tr",{children:eP.fields.map(e=>(0,t.jsx)("th",{style:U,children:e},e))})}),(0,t.jsx)("tbody",{children:eP.rows.map((e,s)=>(0,t.jsx)("tr",{style:s%2==0?J:K,children:eP.fields.map(s=>(0,t.jsx)("td",{style:Q,children:null===e[s]?"NULL":"object"==typeof e[s]?JSON.stringify(e[s]):String(e[s])},s))},s))})]})}):void 0===eP.affectedRows&&(0,t.jsx)("div",{style:V,children:"Query executed successfully, but returned 0 results."})]}),!eE&&!eP&&!eW&&(0,t.jsx)("div",{style:V,children:"Write a query script and click Execute to view table records."}),eW&&(0,t.jsxs)("div",{style:X,children:[(0,t.jsx)("span",{style:Z}),(0,t.jsx)("span",{style:{color:"var(--muted)"},children:"Running database statement..."})]})]})]}),eI&&"u">typeof document&&(0,r.createPortal)((0,t.jsx)("div",{style:et,children:(0,t.jsxs)("div",{style:es,children:[(0,t.jsxs)("h3",{style:{margin:"0 0 1rem 0",display:"flex",justifyContent:"space-between"},children:[(0,t.jsx)("span",{children:"🔌 Add Database Profile"}),(0,t.jsx)("span",{style:{cursor:"pointer"},onClick:()=>eO(!1),children:"✖"})]}),(0,t.jsxs)("form",{onSubmit:eJ,children:[(0,t.jsxs)("div",{style:er,children:[(0,t.jsx)("label",{style:ea,children:"Profile Name"}),(0,t.jsx)("input",{style:en,type:"text",required:!0,value:eA.name,onChange:e=>ez(t=>({...t,name:e.target.value})),placeholder:"e.g. Local Postgres, Dev SQLite"})]}),(0,t.jsxs)("div",{style:er,children:[(0,t.jsx)("label",{style:ea,children:"Scope Level"}),(0,t.jsxs)("div",{style:{display:"flex",gap:"1rem"},children:[(0,t.jsxs)("label",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"0.25rem"},children:[(0,t.jsx)("input",{type:"radio",checked:!eD,onChange:()=>eq(!1)}),"Workspace Local"]}),(0,t.jsxs)("label",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"0.25rem"},children:[(0,t.jsx)("input",{type:"radio",checked:eD,onChange:()=>eq(!0)}),"Global User Profile"]})]})]}),(0,t.jsxs)("div",{style:er,children:[(0,t.jsx)("label",{style:ea,children:"Database Type"}),(0,t.jsxs)("select",{style:el,value:eA.type,onChange:e=>{let t=e.target.value,s=5432;"mysql"===t&&(s=3306),"mssql"===t&&(s=1433),ez(e=>({...e,type:t,filepath:"sqlite"===t?"./dev.db":void 0,port:"sqlite"!==t?s:void 0,database:"sqlite"===t?void 0:"mssql"===t?"master":"postgres"===t?"postgres":"",username:"sqlite"===t?void 0:"mssql"===t?"sa":"postgres"===t?"postgres":"root"}))},children:[(0,t.jsx)("option",{value:"sqlite",children:"SQLite (Local File)"}),(0,t.jsx)("option",{value:"postgres",children:"PostgreSQL"}),(0,t.jsx)("option",{value:"mysql",children:"MySQL"}),(0,t.jsx)("option",{value:"mssql",children:"Microsoft SQL Server"})]})]}),"sqlite"===eA.type?(0,t.jsxs)("div",{style:er,children:[(0,t.jsx)("label",{style:ea,children:"Database File Path"}),(0,t.jsx)("input",{style:en,type:"text",required:!0,value:eA.filepath||"",onChange:e=>ez(t=>({...t,filepath:e.target.value})),placeholder:"Relative (e.g. ./data/dev.db) or Absolute path"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{style:{display:"flex",gap:"1rem"},children:[(0,t.jsxs)("div",{style:{...er,flex:3},children:[(0,t.jsx)("label",{style:ea,children:"Host IP Address"}),(0,t.jsx)("input",{style:en,type:"text",required:!0,value:eA.host||"",onChange:e=>ez(t=>({...t,host:e.target.value})),placeholder:"localhost or IP"})]}),(0,t.jsxs)("div",{style:{...er,flex:1},children:[(0,t.jsx)("label",{style:ea,children:"Port"}),(0,t.jsx)("input",{style:en,type:"number",required:!0,value:eA.port||0,onChange:e=>ez(t=>({...t,port:parseInt(e.target.value)}))})]})]}),(0,t.jsxs)("div",{style:er,children:[(0,t.jsx)("label",{style:ea,children:"Database Name"}),(0,t.jsx)("input",{style:en,type:"text",required:!0,value:eA.database||"",onChange:e=>ez(t=>({...t,database:e.target.value}))})]}),(0,t.jsxs)("div",{style:{display:"flex",gap:"1rem"},children:[(0,t.jsxs)("div",{style:{...er,flex:1},children:[(0,t.jsx)("label",{style:ea,children:"Username"}),(0,t.jsx)("input",{style:en,type:"text",required:!0,value:eA.username||"",onChange:e=>ez(t=>({...t,username:e.target.value}))})]}),(0,t.jsxs)("div",{style:{...er,flex:1},children:[(0,t.jsx)("label",{style:ea,children:"Password"}),(0,t.jsx)("input",{style:en,type:"password",value:eA.password||"",onChange:e=>ez(t=>({...t,password:e.target.value}))})]})]}),("postgres"===eA.type||"mssql"===eA.type)&&(0,t.jsx)("div",{style:er,children:(0,t.jsxs)("label",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"0.25rem"},children:[(0,t.jsx)("input",{type:"checkbox",checked:!!eA.ssl,onChange:e=>ez(t=>({...t,ssl:e.target.checked}))}),"Require SSL Secure Connection"]})})]}),(0,t.jsx)("div",{style:er,children:(0,t.jsxs)("label",{style:{cursor:"pointer",display:"flex",alignItems:"center",gap:"0.25rem"},children:[(0,t.jsx)("input",{type:"checkbox",checked:!!eA.readOnly,onChange:e=>ez(t=>({...t,readOnly:e.target.checked}))}),"Enforce Read-Only Connection (Disable mutations)"]})}),eM&&(0,t.jsx)("div",{style:{...eo,backgroundColor:eM.success?"rgba(16, 185, 129, 0.12)":"rgba(239, 68, 68, 0.12)",border:eM.success?"1px solid var(--success)":"1px solid var(--danger)",color:eM.success?"var(--success)":"var(--danger)"},children:eM.message}),(0,t.jsxs)("div",{style:ei,children:[(0,t.jsx)("button",{type:"button",style:ed,onClick:eQ,children:"🔍 Test Connection"}),(0,t.jsxs)("div",{style:{display:"flex",gap:"0.5rem"},children:[(0,t.jsx)("button",{type:"button",style:ec,onClick:()=>eO(!1),children:"Cancel"}),(0,t.jsx)("button",{type:"submit",style:eu,disabled:eB,children:eB?"Saving...":"Save Profile"})]})]})]})]})}),document.body)]})}])},67585,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"BailoutToCSR",{enumerable:!0,get:function(){return a}});let r=e.r(32061);function a({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new r.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},9885,(e,t,s)=>{"use strict";function r(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"encodeURIPath",{enumerable:!0,get:function(){return r}})},52157,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"PreloadChunks",{enumerable:!0,get:function(){return i}});let r=e.r(43476),a=e.r(74080),n=e.r(63599),l=e.r(9885),o=e.r(43369);function i({moduleIds:e}){if("u">typeof window)return null;let t=n.workAsyncStorage.getStore();if(void 0===t)return null;let s=[];if(t.reactLoadableManifest&&e){let r=t.reactLoadableManifest;for(let t of e){if(!r[t])continue;let e=r[t].files;s.push(...e)}}if(0===s.length)return null;let d=(0,o.getAssetTokenQuery)();return(0,r.jsx)(r.Fragment,{children:s.map(e=>{let s=`${t.assetPrefix}/_next/${(0,l.encodeURIPath)(e)}${d}`;return e.endsWith(".css")?(0,r.jsx)("link",{precedence:"dynamic",href:s,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,a.preload)(s,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},69093,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return d}});let r=e.r(43476),a=e.r(71645),n=e.r(67585),l=e.r(52157);function o(e){return{default:e&&"default"in e?e.default:e}}let i={loader:()=>Promise.resolve(o(()=>null)),loading:null,ssr:!0},d=function(e){let t={...i,...e},s=(0,a.lazy)(()=>t.loader().then(o)),d=t.loading;function c(e){let o=d?(0,r.jsx)(d,{isLoading:!0,pastDelay:!0,error:null}):null,i=!t.ssr||!!t.loading,c=i?a.Suspense:a.Fragment,u=t.ssr?(0,r.jsxs)(r.Fragment,{children:["u"<typeof window?(0,r.jsx)(l.PreloadChunks,{moduleIds:t.modules}):null,(0,r.jsx)(s,{...e})]}):(0,r.jsx)(n.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(s,{...e})});return(0,r.jsx)(c,{...i?{fallback:o}:{},children:u})}return c.displayName="LoadableComponent",c}},70703,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return a}});let r=e.r(55682)._(e.r(69093));function a(e,t){let s={};"function"==typeof e&&(s.loader=e);let a={...s,...t};return(0,r.default)({...a,modules:a.loadableGenerated?.modules})}("function"==typeof s.default||"object"==typeof s.default&&null!==s.default)&&void 0===s.default.__esModule&&(Object.defineProperty(s.default,"__esModule",{value:!0}),Object.assign(s.default,s),t.exports=s.default)},20897,e=>{e.v({activeBorder:"page-module___8aEwW__activeBorder",agentBadge:"page-module___8aEwW__agentBadge",agentCard:"page-module___8aEwW__agentCard",agentGrid:"page-module___8aEwW__agentGrid",agentHeader:"page-module___8aEwW__agentHeader",agentName:"page-module___8aEwW__agentName",agentStateBadge:"page-module___8aEwW__agentStateBadge",ansiCyan:"page-module___8aEwW__ansiCyan",ansiGreen:"page-module___8aEwW__ansiGreen",ansiMagenta:"page-module___8aEwW__ansiMagenta",ansiRed:"page-module___8aEwW__ansiRed",ansiYellow:"page-module___8aEwW__ansiYellow",cardBody:"page-module___8aEwW__cardBody",container:"page-module___8aEwW__container",containerActive:"page-module___8aEwW__containerActive",contextDetails:"page-module___8aEwW__contextDetails",contextItem:"page-module___8aEwW__contextItem",contextList:"page-module___8aEwW__contextList",contextMeta:"page-module___8aEwW__contextMeta",contextTitle:"page-module___8aEwW__contextTitle",dashboardGrid:"page-module___8aEwW__dashboardGrid",envGrid:"page-module___8aEwW__envGrid",envName:"page-module___8aEwW__envName",envRow:"page-module___8aEwW__envRow",envStatus:"page-module___8aEwW__envStatus",footer:"page-module___8aEwW__footer",header:"page-module___8aEwW__header",logoArea:"page-module___8aEwW__logoArea",mainPanel:"page-module___8aEwW__mainPanel",pulse:"page-module___8aEwW__pulse","pulse-attention":"page-module___8aEwW__pulse-attention","pulse-thinking":"page-module___8aEwW__pulse-thinking",pulseDot:"page-module___8aEwW__pulseDot",quickLaunchBtn:"page-module___8aEwW__quickLaunchBtn",sectionTitle:"page-module___8aEwW__sectionTitle",sidePanel:"page-module___8aEwW__sidePanel","state-complete":"page-module___8aEwW__state-complete","state-idle":"page-module___8aEwW__state-idle","state-needs-input":"page-module___8aEwW__state-needs-input","state-thinking":"page-module___8aEwW__state-thinking",statusIndicator:"page-module___8aEwW__statusIndicator",stoppedBadge:"page-module___8aEwW__stoppedBadge",subtitle:"page-module___8aEwW__subtitle",terminalContainer:"page-module___8aEwW__terminalContainer",terminalInput:"page-module___8aEwW__terminalInput",terminalInputArea:"page-module___8aEwW__terminalInputArea",terminalLine:"page-module___8aEwW__terminalLine",terminalSendBtn:"page-module___8aEwW__terminalSendBtn",title:"page-module___8aEwW__title"})},52683,e=>{"use strict";var t=e.i(43476),s=e.i(71645),r=e.i(70703),a=e.i(20897),n=e.i(66381);let l=e=>"mock"===e?"🧪":e.includes("-docker")?"🐳":e.includes("-ssh")?"🌐":"💻",o=(0,r.default)(()=>e.A(33779),{loadableGenerated:{modules:[37314]},ssr:!1,loading:()=>(0,t.jsx)("div",{style:{height:"400px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#05070a",color:"var(--muted)",border:"1px solid var(--border)",borderBottomLeftRadius:"12px",borderBottomRightRadius:"12px"},children:(0,t.jsx)("span",{children:"Initializing terminal emulator..."})})}),i=(0,r.default)(()=>e.A(39429),{loadableGenerated:{modules:[1985]},ssr:!1,loading:()=>(0,t.jsx)("div",{style:{height:"280px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"var(--card)",border:"1px solid var(--border)",borderRadius:"12px",marginTop:"1.5rem"},children:(0,t.jsx)("span",{style:{color:"var(--muted)"},children:"Initializing prompt editor..."})})}),d=(0,r.default)(()=>e.A(56915),{loadableGenerated:{modules:[99026]},ssr:!1}),c=(0,r.default)(()=>e.A(78716),{loadableGenerated:{modules:[9949]},ssr:!1}),u=(0,r.default)(()=>e.A(33789),{loadableGenerated:{modules:[20032]},ssr:!1}),p=(0,r.default)(()=>e.A(78003),{loadableGenerated:{modules:[97722]},ssr:!1});e.s(["default",0,function(){let[e,r]=(0,s.useState)([]),[m,h]=(0,s.useState)(null),[g,x]=(0,s.useState)(!1),[f,y]=(0,s.useState)(!1),[b,j]=(0,s.useState)(!1),[v,_]=(0,s.useState)(!1),[w,k]=(0,s.useState)(!1),[S,C]=(0,s.useState)(!1),[N,W]=(0,s.useState)(""),[R,E]=(0,s.useState)(3001),[T,P]=(0,s.useState)("0.2.19"),[L,I]=(0,s.useState)(null),O=e.filter(e=>"workspace-terminal"!==e.id),D=e.find(e=>e.id===m),q=O.some(e=>("claude-docker"===e.type||"aider-docker"===e.type)&&"running"===e.status),A=O.some(e=>"claude-ssh"===e.type&&"running"===e.status),z=async()=>{try{let e=await fetch("/api/sessions"),t=await e.json();t.sessions&&r(t.sessions),t.wsPort&&E(t.wsPort),t.originalCwd&&W(t.originalCwd),t.version&&P(t.version)}catch(e){console.error("Failed to fetch sessions:",e)}},B=async()=>{try{let e=await fetch("/api/recents");if(e.ok){let t=await e.json();t.success&&t.recents&&t.recents.lastSession&&I(t.recents.lastSession)}}catch(e){console.error("Failed to fetch recents:",e)}};(0,s.useEffect)(()=>{(async()=>{await z(),await B()})(),"serviceWorker"in navigator&&navigator.serviceWorker.register("/sw.js").then(e=>console.log("Service Worker registered:",e.scope)).catch(e=>console.error("Service Worker registration failed:",e));let e=setInterval(z,4e3);return()=>clearInterval(e)},[]);let F=async(e,t,s,r)=>{x(!0);try{let a=t;a||("claude"===e?a="Claude Local":"claude-docker"===e?a="Claude Docker":"claude-ssh"===e?a="Claude SSH":"aider"===e?a="Aider Local":"aider-docker"===e?a="Aider Docker":"mock"===e&&(a="Mock Session"));let n={type:e,name:a,workspaceRoot:s,scopedDirs:r};if(("aider"===e||"aider-docker"===e)&&!s)try{let e=await fetch("/api/context/aider");if(e.ok){let t=await e.json();t.success&&t.config&&(n.workspaceRoot=t.config.workspaceRoot,n.scopedDirs=t.config.scopedDirs)}}catch(e){console.error("Failed to load aider configuration before launch:",e)}let l=await fetch("/api/sessions/launch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}),o=await l.json();o.success&&(await z(),h(o.session.id),I({type:e,name:a,workspaceRoot:s,scopedDirs:r}))}catch(e){console.error("Failed to launch session:",e)}finally{x(!1)}},M=async(e,t=!1)=>{try{let s=await fetch("/api/sessions/stop",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,delete:t})});(await s.json()).success&&(t&&m===e&&h(null),await z())}catch(e){console.error("Failed to stop session:",e)}};return(0,t.jsxs)("div",{className:`${a.default.container} ${D?a.default.containerActive:""}`,children:[(0,t.jsxs)("header",{className:a.default.header,children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"1.5rem"},children:[(0,t.jsx)("img",{src:"/logo.png",alt:"NeuralLoom Logo",style:{width:"160px",height:"160px",borderRadius:"16px",objectFit:"contain"}}),(0,t.jsxs)("div",{className:a.default.logoArea,children:[(0,t.jsx)("h1",{className:a.default.title,style:{margin:0,lineHeight:1.1},children:"NeuralLoom"}),(0,t.jsx)("span",{className:a.default.subtitle,children:"Unified AI Orchestrator & Context Bridge"})]})]}),(0,t.jsxs)("div",{className:a.default.statusIndicator,children:[(0,t.jsx)("span",{className:a.default.pulseDot}),(0,t.jsx)("span",{children:"Orchestrator Online"})]})]}),D?(0,t.jsx)("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column"},children:(0,t.jsx)(p,{sessionId:D.id,workspaceRoot:D.workspaceRoot||"",scopedDirs:D.scopedDirs||[],onClose:()=>h(null),sessions:e,onSwitchSession:e=>h(e),onRefreshSessions:z,wsPort:R})}):(0,t.jsxs)("div",{className:a.default.dashboardGrid,children:[(0,t.jsxs)("main",{className:a.default.mainPanel,children:[(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:a.default.sectionTitle,children:"Active AI Agents"}),0===O.length?(0,t.jsxs)("div",{className:"card",style:{padding:"3rem 1.5rem",textAlign:"center"},children:[(0,t.jsx)("p",{style:{color:"var(--muted)",marginBottom:"1.5rem"},children:"No active agent sessions in this workspace. Launch a Claude or Aider agent session to begin."}),(0,t.jsxs)("div",{style:{display:"flex",gap:"1rem",justifyContent:"center",flexWrap:"wrap"},children:[L&&(0,t.jsx)("button",{className:a.default.quickLaunchBtn,onClick:()=>{F(L.type,L.name,L.workspaceRoot,L.scopedDirs)},disabled:g,style:{background:"linear-gradient(135deg, hsl(38, 92%, 50%) 0%, hsl(0, 84%, 60%) 100%)",border:"none",maxWidth:"200px"},title:`Re-launch: ${L.name||L.type}`,children:"⚡ Re-launch Last Session"}),(0,t.jsx)("button",{className:a.default.quickLaunchBtn,onClick:()=>{C(!1),k(!0)},disabled:g,style:{background:"linear-gradient(135deg, hsl(262, 83%, 60%) 0%, hsl(195, 100%, 45%) 100%)",border:"none",maxWidth:"200px"},children:"Launch Claude PTY"}),(0,t.jsx)("button",{className:a.default.quickLaunchBtn,onClick:()=>{_(!1),j(!0)},disabled:g,style:{background:"linear-gradient(135deg, hsl(210, 80%, 45%) 0%, hsl(262, 80%, 55%) 100%)",border:"none",maxWidth:"200px"},children:"Launch Aider PTY"})]}),(0,t.jsxs)("div",{style:{marginTop:"1.5rem",fontSize:"0.75rem",color:"var(--muted)"},children:["Want to verify layout features first?"," ",(0,t.jsx)("span",{onClick:()=>F("mock"),style:{color:"var(--primary)",cursor:"pointer",textDecoration:"underline"},children:"Start simulated sandbox session"})]})]}):(0,t.jsx)("div",{className:a.default.agentGrid,children:O.map(e=>(0,t.jsxs)("div",{className:`${a.default.agentCard} card ${m===e.id?a.default.activeBorder:""}`,children:[(0,t.jsxs)("div",{className:a.default.agentHeader,children:[(0,t.jsx)("span",{className:a.default.agentName,children:e.name}),(0,t.jsxs)("div",{style:{display:"flex",gap:"0.35rem",alignItems:"center"},children:["running"===e.status&&e.agentState&&(0,t.jsxs)("span",{className:`${a.default.agentStateBadge} ${a.default["state-"+e.agentState]}`,children:["thinking"===e.agentState&&`${l(e.type)} 💭 thinking`,"needs-input"===e.agentState&&`${l(e.type)} ⚠️ needs input`,"complete"===e.agentState&&`${l(e.type)} ✅ complete`,"idle"===e.agentState&&`${l(e.type)} 💤 idle`]}),(0,t.jsx)("span",{className:`${a.default.agentBadge} ${"stopped"===e.status?a.default.stoppedBadge:""}`,children:e.status})]})]}),(0,t.jsxs)("div",{className:a.default.cardBody,children:[(0,t.jsxs)("p",{style:{fontSize:"0.825rem",color:"var(--muted)"},children:["ID: ",(0,t.jsx)("code",{style:{fontSize:"0.75rem"},children:e.id.substring(0,8)}),(0,t.jsx)("br",{}),"Type: ","claude"===e.type?"Claude Local PTY":"claude-docker"===e.type?"Claude Docker PTY":"claude-ssh"===e.type?"Claude SSH PTY":"aider"===e.type?"Aider Local PTY":"aider-docker"===e.type?"Aider Docker PTY":"mock"===e.type?"Simulated Mock PTY":"Unknown PTY",(0,t.jsx)("br",{}),"Logs: ",e.logsCount," captured lines"]}),(0,t.jsxs)("div",{style:{display:"flex",gap:"0.5rem",marginTop:"1rem"},children:["running"===e.status?(0,t.jsx)("button",{onClick:()=>M(e.id,!1),style:{flex:1,padding:"0.4rem 0.6rem",borderRadius:"6px",border:"1px solid var(--danger)",backgroundColor:"transparent",fontSize:"0.75rem",fontWeight:600,color:"var(--danger)"},children:"Stop"}):(0,t.jsx)("button",{onClick:()=>M(e.id,!0),style:{flex:1,padding:"0.4rem 0.6rem",borderRadius:"6px",border:"1px solid var(--border)",backgroundColor:"transparent",fontSize:"0.75rem",fontWeight:600,color:"var(--muted)"},children:"Delete"}),(0,t.jsx)("button",{onClick:()=>h(e.id),style:{flex:2,padding:"0.4rem 0.6rem",borderRadius:"6px",border:"none",backgroundColor:m===e.id?"var(--border-focus)":"var(--primary)",fontSize:"0.75rem",fontWeight:600,color:"#fff"},children:m===e.id?"Connected":"Open Session"})]})]})]},e.id))})]}),m&&"workspace-terminal"!==m&&(0,t.jsxs)("section",{className:"card",style:{display:"flex",flexDirection:"column",border:"1px solid var(--border-focus)"},children:[(0,t.jsxs)("div",{className:a.default.agentHeader,style:{justifyContent:"space-between",background:"rgba(109, 40, 217, 0.08)"},children:[(0,t.jsxs)("span",{style:{fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem"},children:["🖥️ Console Bridge — ",e.find(e=>e.id===m)?.name]}),(0,t.jsxs)("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[e.find(e=>e.id===m)?.status==="stopped"&&(0,t.jsx)("button",{onClick:async()=>{try{let e=await fetch("/api/sessions/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:m})});if(e.ok)await z();else{let t=await e.json();alert(t.error||"Failed to restart session.")}}catch(e){console.error("Failed to restart session:",e),alert("Network error: failed to restart session.")}},style:{padding:"0.2rem 0.5rem",borderRadius:"4px",border:"1px solid #eab308",backgroundColor:"rgba(234, 179, 8, 0.15)",color:"#eab308",fontSize:"0.7rem",fontWeight:600,cursor:"pointer",boxShadow:"0 0 8px rgba(234, 179, 8, 0.2)"},title:"Restart the stopped session process runner",children:"⚡ Restart Session"}),(0,t.jsx)("button",{onClick:()=>h(null),style:{border:"none",background:"none",color:"var(--muted)",cursor:"pointer",fontSize:"0.75rem"},children:"Close Panel ✖"})]})]}),(0,t.jsx)(o,{sessionId:m,wsPort:R})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:a.default.sectionTitle,children:"Workspace Shell Terminal"}),(0,t.jsxs)("div",{className:"card",style:{display:"flex",flexDirection:"column",border:"1px solid var(--border)",padding:0},children:[(0,t.jsxs)("div",{className:a.default.agentHeader,style:{justifyContent:"space-between",background:"rgba(255, 255, 255, 0.02)"},children:[(0,t.jsxs)("span",{style:{fontWeight:600,display:"flex",alignItems:"center",gap:"0.5rem",fontSize:"0.85rem"},children:["💻 Local Workspace Shell (CWD: ",N||"root",")"]}),(0,t.jsx)("span",{style:{fontSize:"0.7rem",color:"var(--muted)"},children:"Pre-configured environment"})]}),(0,t.jsx)(o,{sessionId:"workspace-terminal",height:"300px",wsPort:R})]})]}),(0,t.jsxs)("section",{style:{marginTop:"2rem"},children:[(0,t.jsx)("h2",{className:a.default.sectionTitle,children:"Shared Context Hub & Slash Commands"}),(0,t.jsxs)("div",{className:a.default.contextList,children:[(0,t.jsxs)("div",{className:`${a.default.contextItem} card`,children:[(0,t.jsxs)("div",{className:a.default.contextMeta,children:[(0,t.jsx)("span",{className:a.default.contextTitle,children:"Staged Context & System Rules (/ccc)"}),(0,t.jsx)("span",{className:a.default.contextDetails,children:"Compiles AGENTS.md guidelines and project files folder hierarchy map."})]}),(0,t.jsx)("button",{onClick:async()=>{m&&await fetch("/api/sessions/inject",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:m,command:"/ccc"})})},disabled:!m,style:{padding:"0.4rem 0.8rem",borderRadius:"6px",border:"1px solid var(--primary)",backgroundColor:"transparent",color:"var(--primary)",fontSize:"0.75rem",fontWeight:600,opacity:m?1:.5,cursor:m?"pointer":"not-allowed"},children:"🚀 Mount Context (/ccc)"})]}),(0,t.jsxs)("div",{className:`${a.default.contextItem} card`,children:[(0,t.jsxs)("div",{className:a.default.contextMeta,children:[(0,t.jsx)("span",{className:a.default.contextTitle,children:"Staged Developer Prompt (/ccp)"}),(0,t.jsx)("span",{className:a.default.contextDetails,children:"Executes instructions written in .ai/neural-loom/cprompt.md."})]}),(0,t.jsx)("button",{onClick:async()=>{m&&await fetch("/api/sessions/inject",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:m,command:"/ccp"})})},disabled:!m,style:{padding:"0.4rem 0.8rem",borderRadius:"6px",border:"1px solid var(--success)",backgroundColor:"transparent",color:"var(--success)",fontSize:"0.75rem",fontWeight:600,opacity:m?1:.5,cursor:m?"pointer":"not-allowed"},children:"⚡ Trigger Prompt (/ccp)"})]})]}),(0,t.jsx)(i,{})]}),(0,t.jsxs)("section",{style:{marginTop:"2rem"},children:[(0,t.jsx)("h2",{className:a.default.sectionTitle,children:"Built-in Database Explorer & SQL Client"}),(0,t.jsx)("div",{className:"card",style:{padding:0,overflow:"hidden",height:"480px",border:"1px solid var(--border)"},children:(0,t.jsx)(n.default,{workspaceRoot:N||""})})]})]}),(0,t.jsxs)("aside",{className:a.default.sidePanel,children:[(0,t.jsxs)("section",{children:[(0,t.jsx)("h2",{className:a.default.sectionTitle,children:"Execution Environments"}),(0,t.jsxs)("div",{className:a.default.envGrid,children:[(0,t.jsxs)("div",{className:a.default.envRow,children:[(0,t.jsx)("span",{className:a.default.envName,children:"💻 Local host OS"}),(0,t.jsx)("span",{className:a.default.envStatus,style:{color:"var(--success)"},children:"Active"})]}),(0,t.jsxs)("div",{className:a.default.envRow,style:{opacity:q?1:.6},children:[(0,t.jsx)("span",{className:a.default.envName,children:"🐳 Docker Sandbox"}),(0,t.jsx)("span",{className:a.default.envStatus,style:{color:q?"var(--success)":"var(--muted)"},children:q?"Active":"Not Mounted"})]}),(0,t.jsxs)("div",{className:a.default.envRow,style:{opacity:A?1:.6},children:[(0,t.jsx)("span",{className:a.default.envName,children:"🌐 Remote VM (SSH)"}),(0,t.jsx)("span",{className:a.default.envStatus,style:{color:A?"var(--success)":"var(--muted)"},children:A?"Active":"Disconnected"})]})]})]}),(0,t.jsxs)("section",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:[(0,t.jsxs)("button",{className:a.default.quickLaunchBtn,onClick:()=>{C(!1),k(!0)},disabled:g,style:{background:"linear-gradient(135deg, hsl(262, 83%, 60%) 0%, hsl(195, 100%, 45%) 100%)",border:"none"},children:[(0,t.jsx)("span",{children:"🤖"}),(0,t.jsx)("span",{children:"Launch Claude PTY"})]}),(0,t.jsxs)("button",{className:a.default.quickLaunchBtn,onClick:()=>{C(!0),k(!0)},disabled:g,style:{background:"linear-gradient(135deg, hsl(170, 72%, 40%) 0%, hsl(195, 100%, 40%) 100%)",border:"none"},children:[(0,t.jsx)("span",{children:"🐳"}),(0,t.jsx)("span",{children:"Launch Docker PTY"})]}),(0,t.jsxs)("button",{className:a.default.quickLaunchBtn,onClick:()=>y(!0),disabled:g,style:{background:"linear-gradient(135deg, hsl(38, 92%, 50%) 0%, hsl(0, 84%, 60%) 100%)",border:"none"},children:[(0,t.jsx)("span",{children:"🌐"}),(0,t.jsx)("span",{children:"Launch SSH PTY"})]}),(0,t.jsxs)("button",{className:a.default.quickLaunchBtn,onClick:()=>{_(!1),j(!0)},disabled:g,style:{background:"linear-gradient(135deg, hsl(210, 80%, 45%) 0%, hsl(262, 80%, 55%) 100%)",border:"none"},children:[(0,t.jsx)("span",{children:"🐍"}),(0,t.jsx)("span",{children:"Launch Aider PTY"})]}),(0,t.jsxs)("button",{className:a.default.quickLaunchBtn,onClick:()=>{_(!0),j(!0)},disabled:g,style:{background:"linear-gradient(135deg, hsl(195, 100%, 40%) 0%, hsl(262, 80%, 55%) 100%)",border:"none"},children:[(0,t.jsx)("span",{children:"🐳"}),(0,t.jsx)("span",{children:"Launch Aider Docker"})]})]}),(0,t.jsxs)("section",{className:"card",style:{padding:"1.5rem",display:"flex",flexDirection:"column",gap:"0.75rem"},children:[(0,t.jsx)("h3",{style:{fontSize:"1rem",fontWeight:700},children:"Quick Actions"}),(0,t.jsxs)("ul",{style:{listStyle:"none",fontSize:"0.875rem",display:"flex",flexDirection:"column",gap:"0.5rem",color:"var(--muted)"},children:[(0,t.jsxs)("li",{style:{display:"flex",justifyContent:"space-between"},children:[(0,t.jsx)("span",{children:"Configure global API Keys"}),(0,t.jsx)("span",{style:{color:"var(--primary)",cursor:"pointer"},children:"→"})]}),(0,t.jsxs)("li",{style:{display:"flex",justifyContent:"space-between"},children:[(0,t.jsx)("span",{children:"Edit rules templates"}),(0,t.jsx)("span",{style:{color:"var(--primary)",cursor:"pointer"},children:"→"})]}),(0,t.jsxs)("li",{style:{display:"flex",justifyContent:"space-between"},children:[(0,t.jsx)("span",{children:"Inspect process locks"}),(0,t.jsx)("span",{style:{color:"var(--primary)",cursor:"pointer"},children:"→"})]})]}),(0,t.jsxs)("div",{style:{marginTop:"1.2rem",textAlign:"center",fontSize:"0.72rem",color:"var(--muted)"},children:["Need to troubleshoot?"," ",(0,t.jsx)("span",{onClick:()=>F("mock"),style:{color:"var(--primary)",cursor:"pointer",textDecoration:"underline"},children:"Launch simulated playground sandbox"})]})]})]})]}),(0,t.jsxs)("footer",{className:a.default.footer,children:[(0,t.jsxs)("span",{children:["NeuralLoom v",T," — Experimental AI Orchestrator Bridge"]}),(0,t.jsxs)("span",{children:["Directory: ",N||"Loading..."]})]}),f&&(0,t.jsx)(d,{onClose:()=>y(!1),onConfirmLaunch:()=>{y(!1),F("claude-ssh")}}),b&&(0,t.jsx)(c,{onClose:()=>j(!1),isDocker:v,onConfirmLaunch:()=>{j(!1),F(v?"aider-docker":"aider")}}),w&&(0,t.jsx)(u,{onClose:()=>k(!1),isDocker:S,onConfirmLaunch:(e,t,s)=>{k(!1),F(S?"claude-docker":"claude",e,t,s)}})]})}])},33779,e=>{e.v(t=>Promise.all(["static/chunks/03g6xpslyid3~.js","static/chunks/0-vb7c~yrtpon.js","static/chunks/0ga14ztvrhau2.css"].map(t=>e.l(t))).then(()=>t(37314)))},39429,e=>{e.v(t=>Promise.all(["static/chunks/16w4~t4h7gk13.js"].map(t=>e.l(t))).then(()=>t(1985)))},56915,e=>{e.v(t=>Promise.all(["static/chunks/0lnobx4eh3~-_.js"].map(t=>e.l(t))).then(()=>t(99026)))},78716,e=>{e.v(t=>Promise.all(["static/chunks/0k2co3uj4w81_.js"].map(t=>e.l(t))).then(()=>t(9949)))},33789,e=>{e.v(t=>Promise.all(["static/chunks/076_b43_kienv.js"].map(t=>e.l(t))).then(()=>t(20032)))},78003,e=>{e.v(t=>Promise.all(["static/chunks/0eidfx-s54367.js","static/chunks/0-vb7c~yrtpon.js","static/chunks/0st7_hghhyuv4.js","static/chunks/0ga14ztvrhau2.css"].map(t=>e.l(t))).then(()=>t(97722)))}]);