@industry-theme/alexandria-panels 0.1.0 → 0.1.1

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.
@@ -320,7 +320,7 @@ const createLucideIcon = (iconName, iconNode) => {
320
320
  * This source code is licensed under the ISC license.
321
321
  * See the LICENSE file in the root directory of this source tree.
322
322
  */
323
- const __iconNode$9 = [
323
+ const __iconNode$e = [
324
324
  ["path", { d: "M10 12h4", key: "a56b0p" }],
325
325
  ["path", { d: "M10 8h4", key: "1sr2af" }],
326
326
  ["path", { d: "M14 21v-3a2 2 0 0 0-4 0v3", key: "1rgiei" }],
@@ -333,47 +333,47 @@ const __iconNode$9 = [
333
333
  ],
334
334
  ["path", { d: "M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16", key: "16ra0t" }]
335
335
  ];
336
- const Building2 = createLucideIcon("building-2", __iconNode$9);
336
+ const Building2 = createLucideIcon("building-2", __iconNode$e);
337
337
  /**
338
338
  * @license lucide-react v0.552.0 - ISC
339
339
  *
340
340
  * This source code is licensed under the ISC license.
341
341
  * See the LICENSE file in the root directory of this source tree.
342
342
  */
343
- const __iconNode$8 = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
344
- const Check = createLucideIcon("check", __iconNode$8);
343
+ const __iconNode$d = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
344
+ const Check = createLucideIcon("check", __iconNode$d);
345
345
  /**
346
346
  * @license lucide-react v0.552.0 - ISC
347
347
  *
348
348
  * This source code is licensed under the ISC license.
349
349
  * See the LICENSE file in the root directory of this source tree.
350
350
  */
351
- const __iconNode$7 = [
351
+ const __iconNode$c = [
352
352
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
353
353
  ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
354
354
  ];
355
- const Copy = createLucideIcon("copy", __iconNode$7);
355
+ const Copy = createLucideIcon("copy", __iconNode$c);
356
356
  /**
357
357
  * @license lucide-react v0.552.0 - ISC
358
358
  *
359
359
  * This source code is licensed under the ISC license.
360
360
  * See the LICENSE file in the root directory of this source tree.
361
361
  */
362
- const __iconNode$6 = [
362
+ const __iconNode$b = [
363
363
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }],
364
364
  ["path", { d: "M3 7V5a2 2 0 0 1 2-2h2", key: "aa7l1z" }],
365
365
  ["path", { d: "M17 3h2a2 2 0 0 1 2 2v2", key: "4qcy5o" }],
366
366
  ["path", { d: "M21 17v2a2 2 0 0 1-2 2h-2", key: "6vwrx8" }],
367
367
  ["path", { d: "M7 21H5a2 2 0 0 1-2-2v-2", key: "ioqczr" }]
368
368
  ];
369
- const Focus = createLucideIcon("focus", __iconNode$6);
369
+ const Focus = createLucideIcon("focus", __iconNode$b);
370
370
  /**
371
371
  * @license lucide-react v0.552.0 - ISC
372
372
  *
373
373
  * This source code is licensed under the ISC license.
374
374
  * See the LICENSE file in the root directory of this source tree.
375
375
  */
376
- const __iconNode$5 = [
376
+ const __iconNode$a = [
377
377
  [
378
378
  "path",
379
379
  {
@@ -385,14 +385,14 @@ const __iconNode$5 = [
385
385
  ["path", { d: "M18 19c-2.8 0-5-2.2-5-5v8", key: "pkpw2h" }],
386
386
  ["circle", { cx: "20", cy: "19", r: "2", key: "1obnsp" }]
387
387
  ];
388
- const FolderGit2 = createLucideIcon("folder-git-2", __iconNode$5);
388
+ const FolderGit2 = createLucideIcon("folder-git-2", __iconNode$a);
389
389
  /**
390
390
  * @license lucide-react v0.552.0 - ISC
391
391
  *
392
392
  * This source code is licensed under the ISC license.
393
393
  * See the LICENSE file in the root directory of this source tree.
394
394
  */
395
- const __iconNode$4 = [
395
+ const __iconNode$9 = [
396
396
  [
397
397
  "path",
398
398
  {
@@ -401,37 +401,116 @@ const __iconNode$4 = [
401
401
  }
402
402
  ]
403
403
  ];
404
- const FolderOpen = createLucideIcon("folder-open", __iconNode$4);
404
+ const FolderOpen = createLucideIcon("folder-open", __iconNode$9);
405
405
  /**
406
406
  * @license lucide-react v0.552.0 - ISC
407
407
  *
408
408
  * This source code is licensed under the ISC license.
409
409
  * See the LICENSE file in the root directory of this source tree.
410
410
  */
411
- const __iconNode$3 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
412
- const LoaderCircle = createLucideIcon("loader-circle", __iconNode$3);
411
+ const __iconNode$8 = [
412
+ [
413
+ "path",
414
+ {
415
+ d: "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",
416
+ key: "1kt360"
417
+ }
418
+ ]
419
+ ];
420
+ const Folder = createLucideIcon("folder", __iconNode$8);
413
421
  /**
414
422
  * @license lucide-react v0.552.0 - ISC
415
423
  *
416
424
  * This source code is licensed under the ISC license.
417
425
  * See the LICENSE file in the root directory of this source tree.
418
426
  */
419
- const __iconNode$2 = [
427
+ const __iconNode$7 = [
428
+ ["path", { d: "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8", key: "5wwlr5" }],
429
+ [
430
+ "path",
431
+ {
432
+ d: "M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",
433
+ key: "r6nss1"
434
+ }
435
+ ]
436
+ ];
437
+ const House = createLucideIcon("house", __iconNode$7);
438
+ /**
439
+ * @license lucide-react v0.552.0 - ISC
440
+ *
441
+ * This source code is licensed under the ISC license.
442
+ * See the LICENSE file in the root directory of this source tree.
443
+ */
444
+ const __iconNode$6 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
445
+ const LoaderCircle = createLucideIcon("loader-circle", __iconNode$6);
446
+ /**
447
+ * @license lucide-react v0.552.0 - ISC
448
+ *
449
+ * This source code is licensed under the ISC license.
450
+ * See the LICENSE file in the root directory of this source tree.
451
+ */
452
+ const __iconNode$5 = [
453
+ ["path", { d: "M8 6L12 2L16 6", key: "1yvkyx" }],
454
+ ["path", { d: "M12 2V22", key: "r89rzk" }]
455
+ ];
456
+ const MoveUp = createLucideIcon("move-up", __iconNode$5);
457
+ /**
458
+ * @license lucide-react v0.552.0 - ISC
459
+ *
460
+ * This source code is licensed under the ISC license.
461
+ * See the LICENSE file in the root directory of this source tree.
462
+ */
463
+ const __iconNode$4 = [
464
+ [
465
+ "path",
466
+ {
467
+ d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
468
+ key: "1a8usu"
469
+ }
470
+ ],
471
+ ["path", { d: "m15 5 4 4", key: "1mk7zo" }]
472
+ ];
473
+ const Pencil = createLucideIcon("pencil", __iconNode$4);
474
+ /**
475
+ * @license lucide-react v0.552.0 - ISC
476
+ *
477
+ * This source code is licensed under the ISC license.
478
+ * See the LICENSE file in the root directory of this source tree.
479
+ */
480
+ const __iconNode$3 = [
420
481
  ["path", { d: "M5 12h14", key: "1ays0h" }],
421
482
  ["path", { d: "M12 5v14", key: "s699le" }]
422
483
  ];
423
- const Plus = createLucideIcon("plus", __iconNode$2);
484
+ const Plus = createLucideIcon("plus", __iconNode$3);
424
485
  /**
425
486
  * @license lucide-react v0.552.0 - ISC
426
487
  *
427
488
  * This source code is licensed under the ISC license.
428
489
  * See the LICENSE file in the root directory of this source tree.
429
490
  */
430
- const __iconNode$1 = [
491
+ const __iconNode$2 = [
431
492
  ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
432
493
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
433
494
  ];
434
- const Search = createLucideIcon("search", __iconNode$1);
495
+ const Search = createLucideIcon("search", __iconNode$2);
496
+ /**
497
+ * @license lucide-react v0.552.0 - ISC
498
+ *
499
+ * This source code is licensed under the ISC license.
500
+ * See the LICENSE file in the root directory of this source tree.
501
+ */
502
+ const __iconNode$1 = [
503
+ [
504
+ "path",
505
+ {
506
+ d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
507
+ key: "wmoenq"
508
+ }
509
+ ],
510
+ ["path", { d: "M12 9v4", key: "juzpu7" }],
511
+ ["path", { d: "M12 17h.01", key: "p32p05" }]
512
+ ];
513
+ const TriangleAlert = createLucideIcon("triangle-alert", __iconNode$1);
435
514
  /**
436
515
  * @license lucide-react v0.552.0 - ISC
437
516
  *
@@ -765,10 +844,10 @@ const LocalProjectCard = ({
765
844
  }
766
845
  );
767
846
  };
768
- const PANEL_ID$1 = "industry-theme.local-projects";
769
- const createPanelEvent = (type, payload) => ({
847
+ const PANEL_ID$3 = "industry-theme.local-projects";
848
+ const createPanelEvent$1 = (type, payload) => ({
770
849
  type,
771
- source: PANEL_ID$1,
850
+ source: PANEL_ID$3,
772
851
  timestamp: Date.now(),
773
852
  payload
774
853
  });
@@ -804,7 +883,7 @@ const LocalProjectsPanelContent = ({
804
883
  try {
805
884
  await panelActions.openRepository(entry);
806
885
  setWindowStates((prev) => new Map(prev).set(entry.path, "ready"));
807
- events.emit(createPanelEvent(`${PANEL_ID$1}:repository-opened`, { entry }));
886
+ events.emit(createPanelEvent$1(`${PANEL_ID$3}:repository-opened`, { entry }));
808
887
  } catch (error) {
809
888
  console.error("Error opening repository:", error);
810
889
  setWindowStates((prev) => new Map(prev).set(entry.path, "closed"));
@@ -815,14 +894,14 @@ const LocalProjectsPanelContent = ({
815
894
  useEffect(() => {
816
895
  const unsubscribers = [
817
896
  // Filter event from tools
818
- events.on(`${PANEL_ID$1}:filter`, (event) => {
897
+ events.on(`${PANEL_ID$3}:filter`, (event) => {
819
898
  var _a2;
820
899
  if (((_a2 = event.payload) == null ? void 0 : _a2.filter) !== void 0) {
821
900
  setFilter(event.payload.filter);
822
901
  }
823
902
  }),
824
903
  // Select repository event from tools
825
- events.on(`${PANEL_ID$1}:select-repository`, (event) => {
904
+ events.on(`${PANEL_ID$3}:select-repository`, (event) => {
826
905
  var _a2;
827
906
  const identifier = (_a2 = event.payload) == null ? void 0 : _a2.identifier;
828
907
  if (identifier) {
@@ -831,12 +910,12 @@ const LocalProjectsPanelContent = ({
831
910
  );
832
911
  if (entry) {
833
912
  setSelectedEntry(entry);
834
- events.emit(createPanelEvent(`${PANEL_ID$1}:repository-selected`, { entry }));
913
+ events.emit(createPanelEvent$1(`${PANEL_ID$3}:repository-selected`, { entry }));
835
914
  }
836
915
  }
837
916
  }),
838
917
  // Open repository event from tools
839
- events.on(`${PANEL_ID$1}:open-repository`, (event) => {
918
+ events.on(`${PANEL_ID$3}:open-repository`, (event) => {
840
919
  var _a2;
841
920
  const identifier = (_a2 = event.payload) == null ? void 0 : _a2.identifier;
842
921
  if (identifier) {
@@ -884,7 +963,7 @@ const LocalProjectsPanelContent = ({
884
963
  };
885
964
  const handleSelectRepository = (entry) => {
886
965
  setSelectedEntry(entry);
887
- events.emit(createPanelEvent(`${PANEL_ID$1}:repository-selected`, { entry }));
966
+ events.emit(createPanelEvent$1(`${PANEL_ID$3}:repository-selected`, { entry }));
888
967
  };
889
968
  const normalizedFilter = filter.trim().toLowerCase();
890
969
  const filteredAndSortedRepositories = useMemo(() => {
@@ -1145,7 +1224,876 @@ const LocalProjectsPanelPreview = () => {
1145
1224
  }
1146
1225
  );
1147
1226
  };
1148
- const PANEL_ID = "industry-theme.local-projects";
1227
+ const WorkspaceRepositoryCard = ({
1228
+ repository,
1229
+ workspace,
1230
+ actions,
1231
+ isEditMode = false,
1232
+ isInWorkspaceDirectory,
1233
+ onSelect,
1234
+ onOpen,
1235
+ onRemoveFromWorkspace,
1236
+ onMoveToWorkspace
1237
+ }) => {
1238
+ var _a, _b;
1239
+ const { theme: theme2 } = useTheme();
1240
+ const [isRemoving, setIsRemoving] = useState(false);
1241
+ const [copiedPath, setCopiedPath] = useState(false);
1242
+ const [isMoving, setIsMoving] = useState(false);
1243
+ const handleCardClick = () => {
1244
+ onSelect == null ? void 0 : onSelect(repository);
1245
+ };
1246
+ const handleOpenClick = (e) => {
1247
+ e.stopPropagation();
1248
+ onOpen == null ? void 0 : onOpen(repository);
1249
+ };
1250
+ const handleRemoveFromWorkspace = async (e) => {
1251
+ e.stopPropagation();
1252
+ if (!(workspace == null ? void 0 : workspace.id)) return;
1253
+ if (!confirm(
1254
+ `Remove ${repository.name} from workspace "${workspace.name}"?
1255
+
1256
+ This will not delete any files, only remove the repository from this workspace.`
1257
+ )) {
1258
+ return;
1259
+ }
1260
+ try {
1261
+ setIsRemoving(true);
1262
+ onRemoveFromWorkspace == null ? void 0 : onRemoveFromWorkspace(repository);
1263
+ } finally {
1264
+ setIsRemoving(false);
1265
+ }
1266
+ };
1267
+ const handleCopyPath = async (e) => {
1268
+ e.stopPropagation();
1269
+ try {
1270
+ if (actions.copyToClipboard) {
1271
+ await actions.copyToClipboard(repository.path);
1272
+ } else {
1273
+ await navigator.clipboard.writeText(repository.path);
1274
+ }
1275
+ setCopiedPath(true);
1276
+ setTimeout(() => setCopiedPath(false), 2e3);
1277
+ } catch (err) {
1278
+ console.error("Failed to copy path:", err);
1279
+ }
1280
+ };
1281
+ const handleMoveToWorkspace = async (e) => {
1282
+ e.stopPropagation();
1283
+ if (!(workspace == null ? void 0 : workspace.id) || !workspace.suggestedClonePath) return;
1284
+ if (!confirm(
1285
+ `Move ${repository.name} to ${workspace.suggestedClonePath}?
1286
+
1287
+ This will move all files to the workspace directory.`
1288
+ )) {
1289
+ return;
1290
+ }
1291
+ try {
1292
+ setIsMoving(true);
1293
+ onMoveToWorkspace == null ? void 0 : onMoveToWorkspace(repository);
1294
+ } finally {
1295
+ setIsMoving(false);
1296
+ }
1297
+ };
1298
+ const avatarUrl = ((_a = repository.github) == null ? void 0 : _a.owner) ? `https://github.com/${repository.github.owner}.png` : null;
1299
+ const displayPath = React2.useMemo(() => {
1300
+ if (isInWorkspaceDirectory && (workspace == null ? void 0 : workspace.suggestedClonePath)) {
1301
+ const workspacePath = workspace.suggestedClonePath;
1302
+ if (repository.path.startsWith(workspacePath)) {
1303
+ const relativePath = repository.path.slice(workspacePath.length);
1304
+ return relativePath.startsWith("/") ? relativePath.slice(1) : relativePath;
1305
+ }
1306
+ }
1307
+ return repository.path;
1308
+ }, [isInWorkspaceDirectory, workspace, repository.path]);
1309
+ return /* @__PURE__ */ jsxs(
1310
+ "div",
1311
+ {
1312
+ style: {
1313
+ display: "flex",
1314
+ alignItems: "center",
1315
+ gap: "12px",
1316
+ padding: "8px 12px",
1317
+ borderRadius: "4px",
1318
+ backgroundColor: "transparent",
1319
+ border: "1px solid transparent",
1320
+ cursor: "pointer",
1321
+ transition: "background-color 0.15s"
1322
+ },
1323
+ onClick: handleCardClick,
1324
+ onMouseEnter: (event) => {
1325
+ event.currentTarget.style.backgroundColor = theme2.colors.backgroundTertiary || theme2.colors.backgroundSecondary;
1326
+ },
1327
+ onMouseLeave: (event) => {
1328
+ event.currentTarget.style.backgroundColor = "transparent";
1329
+ },
1330
+ children: [
1331
+ /* @__PURE__ */ jsx(
1332
+ RepositoryAvatar,
1333
+ {
1334
+ customAvatarUrl: avatarUrl,
1335
+ size: 32,
1336
+ fallbackIcon: /* @__PURE__ */ jsx(
1337
+ "div",
1338
+ {
1339
+ style: {
1340
+ color: theme2.colors.textSecondary,
1341
+ fontSize: `${theme2.fontSizes[1]}px`,
1342
+ fontWeight: theme2.fontWeights.semibold,
1343
+ fontFamily: theme2.fonts.body
1344
+ },
1345
+ children: ((_b = repository.name[0]) == null ? void 0 : _b.toUpperCase()) || "?"
1346
+ }
1347
+ )
1348
+ }
1349
+ ),
1350
+ /* @__PURE__ */ jsxs(
1351
+ "div",
1352
+ {
1353
+ style: {
1354
+ flex: 1,
1355
+ minWidth: 0,
1356
+ display: "flex",
1357
+ flexDirection: "column",
1358
+ gap: "4px"
1359
+ },
1360
+ children: [
1361
+ /* @__PURE__ */ jsx(
1362
+ "div",
1363
+ {
1364
+ style: {
1365
+ display: "flex",
1366
+ alignItems: "center",
1367
+ gap: "6px",
1368
+ flexWrap: "wrap"
1369
+ },
1370
+ children: /* @__PURE__ */ jsx(
1371
+ "span",
1372
+ {
1373
+ style: {
1374
+ fontSize: `${theme2.fontSizes[2]}px`,
1375
+ fontWeight: theme2.fontWeights.medium,
1376
+ fontFamily: theme2.fonts.body,
1377
+ color: theme2.colors.text
1378
+ },
1379
+ children: repository.name
1380
+ }
1381
+ )
1382
+ }
1383
+ ),
1384
+ /* @__PURE__ */ jsxs(
1385
+ "div",
1386
+ {
1387
+ onClick: handleCopyPath,
1388
+ style: {
1389
+ fontSize: `${theme2.fontSizes[0]}px`,
1390
+ fontFamily: theme2.fonts.monospace,
1391
+ color: copiedPath ? theme2.colors.success || "#10b981" : theme2.colors.textTertiary || theme2.colors.textSecondary,
1392
+ overflow: "hidden",
1393
+ textOverflow: "ellipsis",
1394
+ whiteSpace: "nowrap",
1395
+ cursor: "pointer",
1396
+ display: "flex",
1397
+ alignItems: "center",
1398
+ gap: "4px",
1399
+ transition: "color 0.15s ease"
1400
+ },
1401
+ title: copiedPath ? "Copied!" : `Click to copy: ${repository.path}`,
1402
+ onMouseEnter: (event) => {
1403
+ if (!copiedPath) {
1404
+ event.currentTarget.style.color = theme2.colors.textSecondary;
1405
+ }
1406
+ },
1407
+ onMouseLeave: (event) => {
1408
+ if (!copiedPath) {
1409
+ event.currentTarget.style.color = theme2.colors.textTertiary || theme2.colors.textSecondary;
1410
+ }
1411
+ },
1412
+ children: [
1413
+ copiedPath ? /* @__PURE__ */ jsx(Check, { size: 12 }) : /* @__PURE__ */ jsx(Copy, { size: 12 }),
1414
+ displayPath
1415
+ ]
1416
+ }
1417
+ )
1418
+ ]
1419
+ }
1420
+ ),
1421
+ /* @__PURE__ */ jsxs(
1422
+ "div",
1423
+ {
1424
+ style: {
1425
+ display: "flex",
1426
+ gap: "4px",
1427
+ flexShrink: 0,
1428
+ alignItems: "center"
1429
+ },
1430
+ children: [
1431
+ isEditMode && workspace && workspace.suggestedClonePath && isInWorkspaceDirectory === false && /* @__PURE__ */ jsxs(
1432
+ "button",
1433
+ {
1434
+ type: "button",
1435
+ onClick: handleMoveToWorkspace,
1436
+ disabled: isMoving,
1437
+ title: `Move to ${workspace.suggestedClonePath}`,
1438
+ style: {
1439
+ display: "inline-flex",
1440
+ alignItems: "center",
1441
+ justifyContent: "center",
1442
+ padding: "6px 10px",
1443
+ gap: "4px",
1444
+ borderRadius: "4px",
1445
+ border: `1px solid ${theme2.colors.primary || "#3b82f6"}`,
1446
+ backgroundColor: `${theme2.colors.primary || "#3b82f6"}15`,
1447
+ color: theme2.colors.primary || "#3b82f6",
1448
+ fontSize: `${theme2.fontSizes[0]}px`,
1449
+ fontWeight: theme2.fontWeights.medium,
1450
+ fontFamily: theme2.fonts.body,
1451
+ cursor: isMoving ? "wait" : "pointer",
1452
+ opacity: isMoving ? 0.6 : 1,
1453
+ transition: "all 0.15s ease"
1454
+ },
1455
+ onMouseEnter: (event) => {
1456
+ if (!isMoving) {
1457
+ event.currentTarget.style.backgroundColor = `${theme2.colors.primary || "#3b82f6"}25`;
1458
+ }
1459
+ },
1460
+ onMouseLeave: (event) => {
1461
+ event.currentTarget.style.backgroundColor = `${theme2.colors.primary || "#3b82f6"}15`;
1462
+ },
1463
+ children: [
1464
+ isMoving ? /* @__PURE__ */ jsx(LoaderCircle, { size: 12, className: "animate-spin" }) : /* @__PURE__ */ jsx(MoveUp, { size: 12 }),
1465
+ isMoving ? "Moving..." : "Move"
1466
+ ]
1467
+ }
1468
+ ),
1469
+ /* @__PURE__ */ jsxs(
1470
+ "button",
1471
+ {
1472
+ type: "button",
1473
+ onClick: handleOpenClick,
1474
+ title: "Open repository",
1475
+ style: {
1476
+ display: "inline-flex",
1477
+ alignItems: "center",
1478
+ justifyContent: "center",
1479
+ padding: "6px 10px",
1480
+ gap: "4px",
1481
+ borderRadius: "4px",
1482
+ border: `1px solid ${theme2.colors.success || "#10b981"}`,
1483
+ backgroundColor: `${theme2.colors.success || "#10b981"}15`,
1484
+ color: theme2.colors.success || "#10b981",
1485
+ fontSize: `${theme2.fontSizes[0]}px`,
1486
+ fontWeight: theme2.fontWeights.medium,
1487
+ fontFamily: theme2.fonts.body,
1488
+ cursor: "pointer",
1489
+ transition: "all 0.15s ease"
1490
+ },
1491
+ onMouseEnter: (event) => {
1492
+ event.currentTarget.style.backgroundColor = `${theme2.colors.success || "#10b981"}25`;
1493
+ },
1494
+ onMouseLeave: (event) => {
1495
+ event.currentTarget.style.backgroundColor = `${theme2.colors.success || "#10b981"}15`;
1496
+ },
1497
+ children: [
1498
+ /* @__PURE__ */ jsx(FolderOpen, { size: 12 }),
1499
+ "Open"
1500
+ ]
1501
+ }
1502
+ ),
1503
+ isEditMode && workspace && /* @__PURE__ */ jsx(
1504
+ "button",
1505
+ {
1506
+ type: "button",
1507
+ onClick: handleRemoveFromWorkspace,
1508
+ disabled: isRemoving,
1509
+ title: `Remove from workspace "${workspace.name}"`,
1510
+ style: {
1511
+ display: "inline-flex",
1512
+ alignItems: "center",
1513
+ justifyContent: "center",
1514
+ width: "28px",
1515
+ height: "28px",
1516
+ padding: 0,
1517
+ borderRadius: "4px",
1518
+ border: "none",
1519
+ backgroundColor: "transparent",
1520
+ color: theme2.colors.textSecondary,
1521
+ cursor: isRemoving ? "wait" : "pointer",
1522
+ opacity: isRemoving ? 0.6 : 1,
1523
+ transition: "all 0.15s ease"
1524
+ },
1525
+ onMouseEnter: (event) => {
1526
+ if (!isRemoving) {
1527
+ event.currentTarget.style.backgroundColor = theme2.colors.error || "#ef4444";
1528
+ event.currentTarget.style.color = "#fff";
1529
+ }
1530
+ },
1531
+ onMouseLeave: (event) => {
1532
+ event.currentTarget.style.backgroundColor = "transparent";
1533
+ event.currentTarget.style.color = theme2.colors.textSecondary;
1534
+ },
1535
+ children: isRemoving ? /* @__PURE__ */ jsx(LoaderCircle, { size: 14, className: "animate-spin" }) : /* @__PURE__ */ jsx(X, { size: 14 })
1536
+ }
1537
+ )
1538
+ ]
1539
+ }
1540
+ )
1541
+ ]
1542
+ }
1543
+ );
1544
+ };
1545
+ const PANEL_ID$2 = "industry-theme.workspace-repositories";
1546
+ const createPanelEvent = (type, payload) => ({
1547
+ type,
1548
+ source: PANEL_ID$2,
1549
+ timestamp: Date.now(),
1550
+ payload
1551
+ });
1552
+ const WorkspaceRepositoriesPanelContent = ({
1553
+ context,
1554
+ actions,
1555
+ events
1556
+ }) => {
1557
+ const { theme: theme2 } = useTheme();
1558
+ const [isEditMode, setIsEditMode] = React2.useState(false);
1559
+ const [repositoryLocations, setRepositoryLocations] = React2.useState(
1560
+ /* @__PURE__ */ new Map()
1561
+ );
1562
+ const panelActions = actions;
1563
+ const workspaceSlice = context.getSlice("workspace");
1564
+ const repositoriesSlice = context.getSlice("workspaceRepositories");
1565
+ const workspace = (workspaceSlice == null ? void 0 : workspaceSlice.data) ?? null;
1566
+ const isLoading = (workspaceSlice == null ? void 0 : workspaceSlice.loading) || (repositoriesSlice == null ? void 0 : repositoriesSlice.loading) || false;
1567
+ const sortedRepositories = useMemo(() => {
1568
+ const repos = (repositoriesSlice == null ? void 0 : repositoriesSlice.data) ?? [];
1569
+ return [...repos].sort((a, b) => a.name.localeCompare(b.name));
1570
+ }, [repositoriesSlice == null ? void 0 : repositoriesSlice.data]);
1571
+ useEffect(() => {
1572
+ const checkLocations = async () => {
1573
+ if (!(workspace == null ? void 0 : workspace.id) || !panelActions.isRepositoryInWorkspaceDirectory || !sortedRepositories.length) {
1574
+ return;
1575
+ }
1576
+ const locationMap = /* @__PURE__ */ new Map();
1577
+ await Promise.all(
1578
+ sortedRepositories.map(async (repo) => {
1579
+ try {
1580
+ const isInWorkspace = await panelActions.isRepositoryInWorkspaceDirectory(repo, workspace.id);
1581
+ if (isInWorkspace !== null) {
1582
+ locationMap.set(repo.path, isInWorkspace);
1583
+ }
1584
+ } catch (error) {
1585
+ console.error(`Failed to check location for ${repo.name}:`, error);
1586
+ }
1587
+ })
1588
+ );
1589
+ setRepositoryLocations(locationMap);
1590
+ };
1591
+ checkLocations();
1592
+ }, [workspace, sortedRepositories, panelActions]);
1593
+ const { repositoriesInWorkspace, repositoriesOutsideWorkspace } = useMemo(() => {
1594
+ const inWorkspace = [];
1595
+ const outsideWorkspace = [];
1596
+ sortedRepositories.forEach((repo) => {
1597
+ const isInWorkspace = repositoryLocations.get(repo.path);
1598
+ if (isInWorkspace === true) {
1599
+ inWorkspace.push(repo);
1600
+ } else if (isInWorkspace === false) {
1601
+ outsideWorkspace.push(repo);
1602
+ }
1603
+ });
1604
+ return { repositoriesInWorkspace: inWorkspace, repositoriesOutsideWorkspace: outsideWorkspace };
1605
+ }, [sortedRepositories, repositoryLocations]);
1606
+ const handleSelectRepository = useCallback(
1607
+ (repository) => {
1608
+ var _a;
1609
+ events.emit(
1610
+ createPanelEvent("repository:selected", {
1611
+ repositoryId: ((_a = repository.github) == null ? void 0 : _a.id) || repository.name,
1612
+ repository,
1613
+ repositoryPath: repository.path
1614
+ })
1615
+ );
1616
+ },
1617
+ [events]
1618
+ );
1619
+ const handleOpenRepository = useCallback(
1620
+ (repository) => {
1621
+ var _a;
1622
+ events.emit(
1623
+ createPanelEvent("repository:opened", {
1624
+ repositoryId: ((_a = repository.github) == null ? void 0 : _a.id) || repository.name,
1625
+ repository
1626
+ })
1627
+ );
1628
+ },
1629
+ [events]
1630
+ );
1631
+ const handleRemoveFromWorkspace = useCallback(
1632
+ async (repository) => {
1633
+ var _a;
1634
+ if (!(workspace == null ? void 0 : workspace.id) || !panelActions.removeRepositoryFromWorkspace) return;
1635
+ try {
1636
+ const repositoryId = ((_a = repository.github) == null ? void 0 : _a.id) || repository.name;
1637
+ await panelActions.removeRepositoryFromWorkspace(repositoryId, workspace.id);
1638
+ } catch (error) {
1639
+ console.error("Failed to remove repository from workspace:", error);
1640
+ alert(
1641
+ `Failed to remove repository: ${error instanceof Error ? error.message : String(error)}`
1642
+ );
1643
+ }
1644
+ },
1645
+ [workspace, panelActions]
1646
+ );
1647
+ const handleMoveToWorkspace = useCallback(
1648
+ async (repository) => {
1649
+ if (!(workspace == null ? void 0 : workspace.id) || !panelActions.moveRepositoryToWorkspaceDirectory) return;
1650
+ try {
1651
+ await panelActions.moveRepositoryToWorkspaceDirectory(repository, workspace.id);
1652
+ setRepositoryLocations((prev) => new Map(prev).set(repository.path, true));
1653
+ } catch (error) {
1654
+ console.error("Failed to move repository:", error);
1655
+ alert(
1656
+ `Failed to move repository: ${error instanceof Error ? error.message : String(error)}`
1657
+ );
1658
+ }
1659
+ },
1660
+ [workspace, panelActions]
1661
+ );
1662
+ useEffect(() => {
1663
+ const unsubscribers = [
1664
+ events.on(`${PANEL_ID$2}:select-repository`, (event) => {
1665
+ var _a;
1666
+ const path = (_a = event.payload) == null ? void 0 : _a.repositoryPath;
1667
+ if (path) {
1668
+ const repository = sortedRepositories.find((r) => r.path === path);
1669
+ if (repository) {
1670
+ handleSelectRepository(repository);
1671
+ }
1672
+ }
1673
+ }),
1674
+ events.on(`${PANEL_ID$2}:open-repository`, (event) => {
1675
+ var _a;
1676
+ const path = (_a = event.payload) == null ? void 0 : _a.repositoryPath;
1677
+ if (path) {
1678
+ const repository = sortedRepositories.find((r) => r.path === path);
1679
+ if (repository) {
1680
+ handleOpenRepository(repository);
1681
+ }
1682
+ }
1683
+ })
1684
+ ];
1685
+ return () => unsubscribers.forEach((unsub) => unsub());
1686
+ }, [events, sortedRepositories, handleSelectRepository, handleOpenRepository]);
1687
+ const baseContainerStyle = {
1688
+ display: "flex",
1689
+ flexDirection: "column",
1690
+ height: "100%",
1691
+ backgroundColor: theme2.colors.backgroundSecondary
1692
+ };
1693
+ const contentContainerStyle = {
1694
+ ...baseContainerStyle,
1695
+ padding: "16px",
1696
+ gap: "12px"
1697
+ };
1698
+ if (!workspace) {
1699
+ return /* @__PURE__ */ jsx("div", { style: baseContainerStyle, children: /* @__PURE__ */ jsx(
1700
+ "div",
1701
+ {
1702
+ style: {
1703
+ flex: 1,
1704
+ display: "flex",
1705
+ alignItems: "center",
1706
+ justifyContent: "center",
1707
+ padding: "32px",
1708
+ textAlign: "center"
1709
+ },
1710
+ children: /* @__PURE__ */ jsxs(
1711
+ "div",
1712
+ {
1713
+ style: {
1714
+ display: "flex",
1715
+ flexDirection: "column",
1716
+ alignItems: "center",
1717
+ gap: "16px",
1718
+ maxWidth: "360px"
1719
+ },
1720
+ children: [
1721
+ /* @__PURE__ */ jsx(
1722
+ Folder,
1723
+ {
1724
+ size: 48,
1725
+ style: {
1726
+ color: theme2.colors.textSecondary,
1727
+ opacity: 0.5
1728
+ }
1729
+ }
1730
+ ),
1731
+ /* @__PURE__ */ jsxs("div", { children: [
1732
+ /* @__PURE__ */ jsx(
1733
+ "h3",
1734
+ {
1735
+ style: {
1736
+ margin: "0 0 8px 0",
1737
+ color: theme2.colors.text,
1738
+ fontSize: `${theme2.fontSizes[3]}px`,
1739
+ fontWeight: theme2.fontWeights.semibold,
1740
+ fontFamily: theme2.fonts.body
1741
+ },
1742
+ children: "No Workspace Selected"
1743
+ }
1744
+ ),
1745
+ /* @__PURE__ */ jsx(
1746
+ "p",
1747
+ {
1748
+ style: {
1749
+ margin: 0,
1750
+ color: theme2.colors.textSecondary,
1751
+ fontSize: `${theme2.fontSizes[1]}px`,
1752
+ fontFamily: theme2.fonts.body
1753
+ },
1754
+ children: "Select a workspace to see its repositories."
1755
+ }
1756
+ )
1757
+ ] })
1758
+ ]
1759
+ }
1760
+ )
1761
+ }
1762
+ ) });
1763
+ }
1764
+ if (isLoading) {
1765
+ return /* @__PURE__ */ jsx("div", { style: baseContainerStyle, children: /* @__PURE__ */ jsx(
1766
+ "div",
1767
+ {
1768
+ style: {
1769
+ flex: 1,
1770
+ display: "flex",
1771
+ alignItems: "center",
1772
+ justifyContent: "center",
1773
+ padding: "32px",
1774
+ textAlign: "center"
1775
+ },
1776
+ children: /* @__PURE__ */ jsx(
1777
+ "div",
1778
+ {
1779
+ style: {
1780
+ display: "flex",
1781
+ flexDirection: "column",
1782
+ alignItems: "center",
1783
+ gap: "16px",
1784
+ maxWidth: "360px"
1785
+ },
1786
+ children: /* @__PURE__ */ jsx(
1787
+ "h3",
1788
+ {
1789
+ style: {
1790
+ margin: 0,
1791
+ color: theme2.colors.text,
1792
+ fontSize: `${theme2.fontSizes[3]}px`,
1793
+ fontWeight: theme2.fontWeights.semibold,
1794
+ fontFamily: theme2.fonts.body
1795
+ },
1796
+ children: "Loading repositories..."
1797
+ }
1798
+ )
1799
+ }
1800
+ )
1801
+ }
1802
+ ) });
1803
+ }
1804
+ const handleToggleEditMode = () => {
1805
+ setIsEditMode(!isEditMode);
1806
+ };
1807
+ return /* @__PURE__ */ jsxs("div", { style: contentContainerStyle, children: [
1808
+ /* @__PURE__ */ jsxs("div", { children: [
1809
+ /* @__PURE__ */ jsxs(
1810
+ "div",
1811
+ {
1812
+ style: {
1813
+ display: "flex",
1814
+ alignItems: "flex-start",
1815
+ justifyContent: "space-between",
1816
+ gap: "16px",
1817
+ marginBottom: "4px"
1818
+ },
1819
+ children: [
1820
+ /* @__PURE__ */ jsxs(
1821
+ "div",
1822
+ {
1823
+ style: {
1824
+ display: "flex",
1825
+ alignItems: "center",
1826
+ gap: "8px"
1827
+ },
1828
+ children: [
1829
+ /* @__PURE__ */ jsx(
1830
+ "h3",
1831
+ {
1832
+ style: {
1833
+ margin: 0,
1834
+ fontSize: `${theme2.fontSizes[2]}px`,
1835
+ fontWeight: theme2.fontWeights.semibold,
1836
+ color: theme2.colors.text,
1837
+ fontFamily: theme2.fonts.body
1838
+ },
1839
+ children: workspace.name
1840
+ }
1841
+ ),
1842
+ /* @__PURE__ */ jsx(
1843
+ "button",
1844
+ {
1845
+ type: "button",
1846
+ onClick: handleToggleEditMode,
1847
+ title: isEditMode ? "Exit edit mode" : "Edit workspace",
1848
+ style: {
1849
+ display: "inline-flex",
1850
+ alignItems: "center",
1851
+ justifyContent: "center",
1852
+ width: "24px",
1853
+ height: "24px",
1854
+ padding: 0,
1855
+ borderRadius: "4px",
1856
+ border: "none",
1857
+ backgroundColor: isEditMode ? theme2.colors.backgroundTertiary || theme2.colors.backgroundSecondary : "transparent",
1858
+ color: isEditMode ? theme2.colors.primary : theme2.colors.textSecondary,
1859
+ cursor: "pointer",
1860
+ transition: "all 0.15s ease"
1861
+ },
1862
+ onMouseEnter: (event) => {
1863
+ if (!isEditMode) {
1864
+ event.currentTarget.style.backgroundColor = theme2.colors.backgroundTertiary || theme2.colors.backgroundSecondary;
1865
+ event.currentTarget.style.color = theme2.colors.text;
1866
+ }
1867
+ },
1868
+ onMouseLeave: (event) => {
1869
+ if (!isEditMode) {
1870
+ event.currentTarget.style.backgroundColor = "transparent";
1871
+ event.currentTarget.style.color = theme2.colors.textSecondary;
1872
+ }
1873
+ },
1874
+ children: /* @__PURE__ */ jsx(Pencil, { size: 14 })
1875
+ }
1876
+ )
1877
+ ]
1878
+ }
1879
+ ),
1880
+ workspace.suggestedClonePath && /* @__PURE__ */ jsxs(
1881
+ "div",
1882
+ {
1883
+ style: {
1884
+ display: "flex",
1885
+ alignItems: "center",
1886
+ gap: "6px",
1887
+ minWidth: 0
1888
+ },
1889
+ children: [
1890
+ /* @__PURE__ */ jsx(
1891
+ House,
1892
+ {
1893
+ size: 14,
1894
+ style: {
1895
+ color: theme2.colors.textSecondary,
1896
+ flexShrink: 0
1897
+ }
1898
+ }
1899
+ ),
1900
+ /* @__PURE__ */ jsx(
1901
+ "span",
1902
+ {
1903
+ style: {
1904
+ fontSize: `${theme2.fontSizes[0]}px`,
1905
+ color: theme2.colors.textSecondary,
1906
+ fontFamily: theme2.fonts.monospace,
1907
+ whiteSpace: "nowrap",
1908
+ overflow: "hidden",
1909
+ textOverflow: "ellipsis"
1910
+ },
1911
+ title: workspace.suggestedClonePath,
1912
+ children: workspace.suggestedClonePath
1913
+ }
1914
+ )
1915
+ ]
1916
+ }
1917
+ )
1918
+ ]
1919
+ }
1920
+ ),
1921
+ workspace.description && /* @__PURE__ */ jsx(
1922
+ "p",
1923
+ {
1924
+ style: {
1925
+ margin: 0,
1926
+ fontSize: `${theme2.fontSizes[1]}px`,
1927
+ color: theme2.colors.textSecondary,
1928
+ fontFamily: theme2.fonts.body
1929
+ },
1930
+ children: workspace.description
1931
+ }
1932
+ )
1933
+ ] }),
1934
+ /* @__PURE__ */ jsxs(
1935
+ "div",
1936
+ {
1937
+ style: {
1938
+ flex: 1,
1939
+ overflowY: "auto",
1940
+ display: "flex",
1941
+ flexDirection: "column",
1942
+ gap: "12px"
1943
+ },
1944
+ children: [
1945
+ sortedRepositories.length === 0 && !isLoading && /* @__PURE__ */ jsx(
1946
+ "div",
1947
+ {
1948
+ style: {
1949
+ padding: "32px",
1950
+ textAlign: "center",
1951
+ color: theme2.colors.textSecondary
1952
+ },
1953
+ children: /* @__PURE__ */ jsx("p", { style: { margin: 0 }, children: "No repositories in this workspace." })
1954
+ }
1955
+ ),
1956
+ repositoriesInWorkspace.length > 0 && /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
1957
+ /* @__PURE__ */ jsxs(
1958
+ "div",
1959
+ {
1960
+ style: {
1961
+ display: "flex",
1962
+ alignItems: "center",
1963
+ gap: "6px",
1964
+ paddingBottom: "4px"
1965
+ },
1966
+ children: [
1967
+ /* @__PURE__ */ jsx(
1968
+ House,
1969
+ {
1970
+ size: 14,
1971
+ style: {
1972
+ color: theme2.colors.success || "#10b981",
1973
+ flexShrink: 0
1974
+ }
1975
+ }
1976
+ ),
1977
+ /* @__PURE__ */ jsx(
1978
+ "h4",
1979
+ {
1980
+ style: {
1981
+ margin: 0,
1982
+ fontSize: `${theme2.fontSizes[1]}px`,
1983
+ fontWeight: theme2.fontWeights.semibold,
1984
+ color: theme2.colors.textSecondary,
1985
+ fontFamily: theme2.fonts.body,
1986
+ textTransform: "uppercase",
1987
+ letterSpacing: "0.5px"
1988
+ },
1989
+ children: "In Workspace Directory"
1990
+ }
1991
+ ),
1992
+ /* @__PURE__ */ jsx(
1993
+ "span",
1994
+ {
1995
+ style: {
1996
+ fontSize: `${theme2.fontSizes[0]}px`,
1997
+ color: theme2.colors.textTertiary || theme2.colors.textSecondary,
1998
+ fontWeight: theme2.fontWeights.medium
1999
+ },
2000
+ children: repositoriesInWorkspace.length
2001
+ }
2002
+ )
2003
+ ]
2004
+ }
2005
+ ),
2006
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: repositoriesInWorkspace.map((repository) => /* @__PURE__ */ jsx(
2007
+ WorkspaceRepositoryCard,
2008
+ {
2009
+ repository,
2010
+ workspace,
2011
+ actions: panelActions,
2012
+ isEditMode,
2013
+ isInWorkspaceDirectory: true,
2014
+ onSelect: handleSelectRepository,
2015
+ onOpen: handleOpenRepository,
2016
+ onRemoveFromWorkspace: handleRemoveFromWorkspace,
2017
+ onMoveToWorkspace: handleMoveToWorkspace
2018
+ },
2019
+ repository.path
2020
+ )) })
2021
+ ] }),
2022
+ repositoriesOutsideWorkspace.length > 0 && /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
2023
+ /* @__PURE__ */ jsxs(
2024
+ "div",
2025
+ {
2026
+ style: {
2027
+ display: "flex",
2028
+ alignItems: "center",
2029
+ gap: "6px",
2030
+ paddingBottom: "4px"
2031
+ },
2032
+ children: [
2033
+ /* @__PURE__ */ jsx(
2034
+ TriangleAlert,
2035
+ {
2036
+ size: 14,
2037
+ style: {
2038
+ color: theme2.colors.warning || "#f59e0b",
2039
+ flexShrink: 0
2040
+ }
2041
+ }
2042
+ ),
2043
+ /* @__PURE__ */ jsx(
2044
+ "h4",
2045
+ {
2046
+ style: {
2047
+ margin: 0,
2048
+ fontSize: `${theme2.fontSizes[1]}px`,
2049
+ fontWeight: theme2.fontWeights.semibold,
2050
+ color: theme2.colors.textSecondary,
2051
+ fontFamily: theme2.fonts.body,
2052
+ textTransform: "uppercase",
2053
+ letterSpacing: "0.5px"
2054
+ },
2055
+ children: "Outside Workspace Directory"
2056
+ }
2057
+ ),
2058
+ /* @__PURE__ */ jsx(
2059
+ "span",
2060
+ {
2061
+ style: {
2062
+ fontSize: `${theme2.fontSizes[0]}px`,
2063
+ color: theme2.colors.textTertiary || theme2.colors.textSecondary,
2064
+ fontWeight: theme2.fontWeights.medium
2065
+ },
2066
+ children: repositoriesOutsideWorkspace.length
2067
+ }
2068
+ )
2069
+ ]
2070
+ }
2071
+ ),
2072
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: repositoriesOutsideWorkspace.map((repository) => /* @__PURE__ */ jsx(
2073
+ WorkspaceRepositoryCard,
2074
+ {
2075
+ repository,
2076
+ workspace,
2077
+ actions: panelActions,
2078
+ isEditMode,
2079
+ isInWorkspaceDirectory: false,
2080
+ onSelect: handleSelectRepository,
2081
+ onOpen: handleOpenRepository,
2082
+ onRemoveFromWorkspace: handleRemoveFromWorkspace,
2083
+ onMoveToWorkspace: handleMoveToWorkspace
2084
+ },
2085
+ repository.path
2086
+ )) })
2087
+ ] })
2088
+ ]
2089
+ }
2090
+ )
2091
+ ] });
2092
+ };
2093
+ const WorkspaceRepositoriesPanel = (props) => {
2094
+ return /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(WorkspaceRepositoriesPanelContent, { ...props }) });
2095
+ };
2096
+ const PANEL_ID$1 = "industry-theme.local-projects";
1149
2097
  const filterProjectsTool = {
1150
2098
  name: "filter_projects",
1151
2099
  description: "Filter the local projects list by name, owner, or path",
@@ -1169,7 +2117,7 @@ const filterProjectsTool = {
1169
2117
  tags: ["filter", "search", "projects"],
1170
2118
  tool_call_template: {
1171
2119
  call_template_type: "panel_event",
1172
- event_type: `${PANEL_ID}:filter`
2120
+ event_type: `${PANEL_ID$1}:filter`
1173
2121
  }
1174
2122
  };
1175
2123
  const selectProjectTool = {
@@ -1195,7 +2143,7 @@ const selectProjectTool = {
1195
2143
  tags: ["select", "project", "navigation"],
1196
2144
  tool_call_template: {
1197
2145
  call_template_type: "panel_event",
1198
- event_type: `${PANEL_ID}:select-repository`
2146
+ event_type: `${PANEL_ID$1}:select-repository`
1199
2147
  }
1200
2148
  };
1201
2149
  const openProjectTool = {
@@ -1221,7 +2169,7 @@ const openProjectTool = {
1221
2169
  tags: ["open", "project", "workspace"],
1222
2170
  tool_call_template: {
1223
2171
  call_template_type: "panel_event",
1224
- event_type: `${PANEL_ID}:open-repository`
2172
+ event_type: `${PANEL_ID$1}:open-repository`
1225
2173
  }
1226
2174
  };
1227
2175
  const localProjectsPanelTools = [
@@ -1230,11 +2178,100 @@ const localProjectsPanelTools = [
1230
2178
  openProjectTool
1231
2179
  ];
1232
2180
  const localProjectsPanelToolsMetadata = {
1233
- id: PANEL_ID,
2181
+ id: PANEL_ID$1,
1234
2182
  name: "Local Projects Panel",
1235
2183
  description: "Tools for browsing and managing local Alexandria repositories",
1236
2184
  tools: localProjectsPanelTools
1237
2185
  };
2186
+ const PANEL_ID = "industry-theme.workspace-repositories";
2187
+ const selectRepositoryTool = {
2188
+ name: "select_workspace_repository",
2189
+ description: "Selects a repository in the workspace panel",
2190
+ inputs: {
2191
+ type: "object",
2192
+ properties: {
2193
+ repositoryPath: {
2194
+ type: "string",
2195
+ description: "Path to the repository to select"
2196
+ }
2197
+ },
2198
+ required: ["repositoryPath"]
2199
+ },
2200
+ outputs: {
2201
+ type: "object",
2202
+ properties: {
2203
+ success: { type: "boolean" },
2204
+ message: { type: "string" }
2205
+ }
2206
+ },
2207
+ tags: ["workspace", "repository", "select"],
2208
+ tool_call_template: {
2209
+ call_template_type: "panel_event",
2210
+ event_type: `${PANEL_ID}:select-repository`
2211
+ }
2212
+ };
2213
+ const refreshWorkspaceTool = {
2214
+ name: "refresh_workspace",
2215
+ description: "Refreshes the workspace repositories list",
2216
+ inputs: {
2217
+ type: "object",
2218
+ properties: {
2219
+ force: {
2220
+ type: "boolean",
2221
+ description: "Force refresh even if data is fresh"
2222
+ }
2223
+ }
2224
+ },
2225
+ outputs: {
2226
+ type: "object",
2227
+ properties: {
2228
+ success: { type: "boolean" },
2229
+ repositoryCount: { type: "number" }
2230
+ }
2231
+ },
2232
+ tags: ["workspace", "refresh"],
2233
+ tool_call_template: {
2234
+ call_template_type: "panel_event",
2235
+ event_type: `${PANEL_ID}:refresh-workspace`
2236
+ }
2237
+ };
2238
+ const openRepositoryTool = {
2239
+ name: "open_workspace_repository",
2240
+ description: "Opens a repository from the workspace",
2241
+ inputs: {
2242
+ type: "object",
2243
+ properties: {
2244
+ repositoryPath: {
2245
+ type: "string",
2246
+ description: "Path to the repository to open"
2247
+ }
2248
+ },
2249
+ required: ["repositoryPath"]
2250
+ },
2251
+ outputs: {
2252
+ type: "object",
2253
+ properties: {
2254
+ success: { type: "boolean" },
2255
+ message: { type: "string" }
2256
+ }
2257
+ },
2258
+ tags: ["workspace", "repository", "open"],
2259
+ tool_call_template: {
2260
+ call_template_type: "panel_event",
2261
+ event_type: `${PANEL_ID}:open-repository`
2262
+ }
2263
+ };
2264
+ const workspaceRepositoriesPanelTools = [
2265
+ selectRepositoryTool,
2266
+ refreshWorkspaceTool,
2267
+ openRepositoryTool
2268
+ ];
2269
+ const workspaceRepositoriesPanelToolsMetadata = {
2270
+ id: PANEL_ID,
2271
+ name: "Workspace Repositories Panel",
2272
+ description: "Tools provided by the workspace repositories panel",
2273
+ tools: workspaceRepositoriesPanelTools
2274
+ };
1238
2275
  const panels = [
1239
2276
  {
1240
2277
  metadata: {
@@ -1257,6 +2294,26 @@ const panels = [
1257
2294
  onUnmount: async (_context) => {
1258
2295
  console.log("Local Projects Panel unmounting");
1259
2296
  }
2297
+ },
2298
+ {
2299
+ metadata: {
2300
+ id: "industry-theme.workspace-repositories",
2301
+ name: "Workspace Repositories",
2302
+ icon: "FolderGit2",
2303
+ version: "0.1.0",
2304
+ author: "Industry Theme",
2305
+ description: "Workspace and repository management panel",
2306
+ slices: ["workspace", "workspaceRepositories"],
2307
+ tools: workspaceRepositoriesPanelTools
2308
+ },
2309
+ component: WorkspaceRepositoriesPanel,
2310
+ onMount: async (context) => {
2311
+ console.log("Workspace Repositories Panel mounted");
2312
+ console.log("Current scope:", context.currentScope.type);
2313
+ },
2314
+ onUnmount: async (_context) => {
2315
+ console.log("Workspace Repositories Panel unmounting");
2316
+ }
1260
2317
  }
1261
2318
  ];
1262
2319
  const onPackageLoad = async () => {
@@ -1270,13 +2327,20 @@ export {
1270
2327
  LocalProjectsPanel,
1271
2328
  LocalProjectsPanelPreview,
1272
2329
  RepositoryAvatar,
2330
+ WorkspaceRepositoriesPanel,
2331
+ WorkspaceRepositoryCard,
1273
2332
  filterProjectsTool,
1274
2333
  localProjectsPanelTools,
1275
2334
  localProjectsPanelToolsMetadata,
1276
2335
  onPackageLoad,
1277
2336
  onPackageUnload,
1278
2337
  openProjectTool,
2338
+ openRepositoryTool,
1279
2339
  panels,
1280
- selectProjectTool
2340
+ refreshWorkspaceTool,
2341
+ selectProjectTool,
2342
+ selectRepositoryTool,
2343
+ workspaceRepositoriesPanelTools,
2344
+ workspaceRepositoriesPanelToolsMetadata
1281
2345
  };
1282
2346
  //# sourceMappingURL=panels.bundle.js.map