@saluzi/saluzi-edu 0.7.4 → 0.7.6

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 (165) hide show
  1. package/dist/cli.js +93 -61
  2. package/dist/rcs-schema.sql +42 -0
  3. package/dist/rcs-web/assets/{AdminPanel-B9YWaqlO.js → AdminPanel-D0i_28O2.js} +1 -1
  4. package/dist/rcs-web/assets/{ArtifactView-B8lAeS5B.js → ArtifactView-Dd6d3O3z.js} +1 -1
  5. package/{packages/remote-control-server/web/dist/assets/ArtifactsGallery-CNd9-Awp.js → dist/rcs-web/assets/ArtifactsGallery-BTVS7sar.js} +1 -1
  6. package/{packages/remote-control-server/web/dist/assets/Claim-Dq08pl4W.js → dist/rcs-web/assets/Claim-CkuDG_ay.js} +1 -1
  7. package/dist/rcs-web/assets/{Dashboard-JZcrtByh.js → Dashboard-BBZHnmut.js} +2 -2
  8. package/dist/rcs-web/assets/{Join-DgvRnpyb.js → Join-DbBj-5mj.js} +1 -1
  9. package/{packages/remote-control-server/web/dist/assets/Login-CZbz6Wms.js → dist/rcs-web/assets/Login-Csvt3wvz.js} +1 -1
  10. package/dist/rcs-web/assets/MemoriesGallery-C5cT73hA.js +1 -0
  11. package/dist/rcs-web/assets/{Register-DD7uiwEj.js → Register-Cmp7ogoN.js} +1 -1
  12. package/dist/rcs-web/assets/{RegisterEmpty-BrBfeQXp.js → RegisterEmpty-BoIy42g_.js} +2 -2
  13. package/dist/rcs-web/assets/SessionDetail-CocGah-8.js +83 -0
  14. package/dist/rcs-web/assets/{SessionVisibilityBadge-kSo9esvT.js → SessionVisibilityBadge-C873QvnC.js} +2 -2
  15. package/dist/rcs-web/assets/{Setup-Ca30VUSF.js → Setup-DOU0qTNX.js} +1 -1
  16. package/dist/rcs-web/assets/{ShareLanding-C_vlxFAM.js → ShareLanding-DMR9eh0F.js} +1 -1
  17. package/{packages/remote-control-server/web/dist/assets/TeamDetail-8T_kKUcX.js → dist/rcs-web/assets/TeamDetail-MPfqesJf.js} +2 -2
  18. package/dist/rcs-web/assets/{TeamList-DRXGQCJi.js → TeamList-CgWVmdPU.js} +1 -1
  19. package/dist/rcs-web/assets/{TeamSettings-Byhon5C1.js → TeamSettings-V3L0H8Nb.js} +1 -1
  20. package/dist/rcs-web/assets/{UserSearchInput-wixyd_8w.js → UserSearchInput-xqtDX6Bz.js} +2 -2
  21. package/dist/rcs-web/assets/{UserSettings-Ds2retFk.js → UserSettings-Cfqs_5af.js} +1 -1
  22. package/dist/rcs-web/assets/{arc-CThS8KNL.js → arc-Bl97za3P.js} +1 -1
  23. package/dist/rcs-web/assets/{architectureDiagram-3BPJPVTR-Bko99SuX.js → architectureDiagram-3BPJPVTR-B8IQfxi6.js} +1 -1
  24. package/{packages/remote-control-server/web/dist/assets/blockDiagram-GPEHLZMM-CqCAgp0i.js → dist/rcs-web/assets/blockDiagram-GPEHLZMM-DNfBHM8J.js} +1 -1
  25. package/{packages/remote-control-server/web/dist/assets/c4Diagram-AAUBKEIU-C1pGDG-L.js → dist/rcs-web/assets/c4Diagram-AAUBKEIU-CO4HDUF2.js} +1 -1
  26. package/dist/rcs-web/assets/channel-DcTKV8fL.js +1 -0
  27. package/dist/rcs-web/assets/{chunk-2J33WTMH-Bz0kJwEY.js → chunk-2J33WTMH-4CBnqzb3.js} +1 -1
  28. package/dist/rcs-web/assets/{chunk-4BX2VUAB-DYnlidI7.js → chunk-4BX2VUAB-ClbIGQlY.js} +1 -1
  29. package/dist/rcs-web/assets/{chunk-55IACEB6-cMV4HRvm.js → chunk-55IACEB6-BnrTfmFM.js} +1 -1
  30. package/{packages/remote-control-server/web/dist/assets/chunk-727SXJPM-Bgz9JRYO.js → dist/rcs-web/assets/chunk-727SXJPM-C17NZOQL.js} +1 -1
  31. package/{packages/remote-control-server/web/dist/assets/chunk-AQP2D5EJ-DIFGJlEF.js → dist/rcs-web/assets/chunk-AQP2D5EJ-CljirtnS.js} +1 -1
  32. package/dist/rcs-web/assets/{chunk-FMBD7UC4-BUC7O7T0.js → chunk-FMBD7UC4-Bb20ipZI.js} +1 -1
  33. package/dist/rcs-web/assets/{chunk-ND2GUHAM-kGqgVnBZ.js → chunk-ND2GUHAM-L3q9_xAn.js} +1 -1
  34. package/dist/rcs-web/assets/{chunk-QZHKN3VN-B01O0qXh.js → chunk-QZHKN3VN-FyYNxzak.js} +1 -1
  35. package/dist/rcs-web/assets/classDiagram-4FO5ZUOK-5DsQRSDS.js +1 -0
  36. package/dist/rcs-web/assets/classDiagram-v2-Q7XG4LA2-5DsQRSDS.js +1 -0
  37. package/dist/rcs-web/assets/{code-block-IT6T5CEO-CscK0pCh.js → code-block-IT6T5CEO-CQVTEZwg.js} +1 -1
  38. package/dist/rcs-web/assets/{copy-CvmA5P_Q.js → copy-CFZBXuu9.js} +1 -1
  39. package/dist/rcs-web/assets/{cose-bilkent-S5V4N54A-BsBsVccW.js → cose-bilkent-S5V4N54A-Cs2MVxlS.js} +1 -1
  40. package/{packages/remote-control-server/web/dist/assets/dagre-BM42HDAG-Bn4B33S-.js → dist/rcs-web/assets/dagre-BM42HDAG-CWZcIIf5.js} +1 -1
  41. package/dist/rcs-web/assets/{diagram-2AECGRRQ-DAuAIPR6.js → diagram-2AECGRRQ-DpumSk2d.js} +1 -1
  42. package/dist/rcs-web/assets/{diagram-5GNKFQAL-w3k2b4gC.js → diagram-5GNKFQAL-DcF2qwdh.js} +1 -1
  43. package/{packages/remote-control-server/web/dist/assets/diagram-KO2AKTUF-CMLav2KT.js → dist/rcs-web/assets/diagram-KO2AKTUF-BGnqGSPz.js} +1 -1
  44. package/dist/rcs-web/assets/{diagram-LMA3HP47-D14sXWdh.js → diagram-LMA3HP47-k-UxYOZ9.js} +1 -1
  45. package/{packages/remote-control-server/web/dist/assets/diagram-OG6HWLK6-BexFwBQa.js → dist/rcs-web/assets/diagram-OG6HWLK6-BMPzmD6S.js} +1 -1
  46. package/dist/rcs-web/assets/{dialog-B4hKrd7w.js → dialog-DKk230y5.js} +1 -1
  47. package/dist/rcs-web/assets/{erDiagram-TEJ5UH35-BA8ANmoV.js → erDiagram-TEJ5UH35-BvmA6W9Z.js} +1 -1
  48. package/{packages/remote-control-server/web/dist/assets/flowDiagram-I6XJVG4X-dTQIvKsj.js → dist/rcs-web/assets/flowDiagram-I6XJVG4X-ptAnksiF.js} +1 -1
  49. package/dist/rcs-web/assets/{ganttDiagram-6RSMTGT7-8SDHYxXc.js → ganttDiagram-6RSMTGT7-Bhgrzcs3.js} +1 -1
  50. package/dist/rcs-web/assets/{gitGraphDiagram-PVQCEYII-Bu7LyvTG.js → gitGraphDiagram-PVQCEYII-B8-vcbF-.js} +1 -1
  51. package/dist/rcs-web/assets/{infoDiagram-5YYISTIA-BuQuDvuX.js → infoDiagram-5YYISTIA-DaW0unc2.js} +1 -1
  52. package/dist/rcs-web/assets/{ishikawaDiagram-YF4QCWOH-QjafGk8V.js → ishikawaDiagram-YF4QCWOH-4oYGuWP6.js} +1 -1
  53. package/{packages/remote-control-server/web/dist/assets/journeyDiagram-JHISSGLW-_FOXjXDF.js → dist/rcs-web/assets/journeyDiagram-JHISSGLW-B9YXpw0W.js} +1 -1
  54. package/dist/rcs-web/assets/{kanban-definition-UN3LZRKU-CbqJqyY6.js → kanban-definition-UN3LZRKU-Cglus7wI.js} +1 -1
  55. package/dist/rcs-web/assets/{linear-H6F41eb2.js → linear-CRTJd3_G.js} +1 -1
  56. package/dist/rcs-web/assets/{main-BopVSHhX.js → main-BKbA2ddo.js} +65 -65
  57. package/dist/rcs-web/assets/main-CP31AzxJ.css +1 -0
  58. package/{packages/remote-control-server/web/dist/assets/mermaid-VLURNSYL-5FH_DIq9.js → dist/rcs-web/assets/mermaid-VLURNSYL-D0JeVL0B.js} +4 -4
  59. package/dist/rcs-web/assets/{mermaid.core-C004NitB.js → mermaid.core-CobUk_K5.js} +5 -5
  60. package/dist/rcs-web/assets/{mindmap-definition-RKZ34NQL-utqEJ2a8.js → mindmap-definition-RKZ34NQL-B1s-et_p.js} +1 -1
  61. package/dist/rcs-web/assets/{notifications-DOBs9HVf.js → notifications-BrgRJuzQ.js} +1 -1
  62. package/dist/rcs-web/assets/{pieDiagram-4H26LBE5-OlbTwDZQ.js → pieDiagram-4H26LBE5-PcBs9RT_.js} +1 -1
  63. package/dist/rcs-web/assets/{quadrantDiagram-W4KKPZXB-BOe2DhrU.js → quadrantDiagram-W4KKPZXB-B2GxITjv.js} +1 -1
  64. package/dist/rcs-web/assets/{refresh-cw-BSwpDl-7.js → refresh-cw-BwmFF3kw.js} +1 -1
  65. package/{packages/remote-control-server/web/dist/assets/requirementDiagram-4Y6WPE33-s6V1yWUG.js → dist/rcs-web/assets/requirementDiagram-4Y6WPE33-BfyZiasB.js} +1 -1
  66. package/{packages/remote-control-server/web/dist/assets/sankeyDiagram-5OEKKPKP-CdJD78Mx.js → dist/rcs-web/assets/sankeyDiagram-5OEKKPKP-Br7tRtmq.js} +1 -1
  67. package/{packages/remote-control-server/web/dist/assets/sequenceDiagram-3UESZ5HK-DvGV6Dhl.js → dist/rcs-web/assets/sequenceDiagram-3UESZ5HK-CN1NSfHS.js} +1 -1
  68. package/{packages/remote-control-server/web/dist/assets/stateDiagram-AJRCARHV-Bj-_Ulcn.js → dist/rcs-web/assets/stateDiagram-AJRCARHV-C4S8hKUx.js} +1 -1
  69. package/dist/rcs-web/assets/{stateDiagram-v2-BHNVJYJU-BLGWynk-.js → stateDiagram-v2-BHNVJYJU-CbEMz-jf.js} +1 -1
  70. package/dist/rcs-web/assets/{timeline-definition-PNZ67QCA-B6VAH6Ka.js → timeline-definition-PNZ67QCA-mTiK0HwD.js} +1 -1
  71. package/dist/rcs-web/assets/{vennDiagram-CIIHVFJN-DUwaLI6R.js → vennDiagram-CIIHVFJN-DCe95URb.js} +1 -1
  72. package/dist/rcs-web/assets/{wardleyDiagram-YWT4CUSO-CBetJore.js → wardleyDiagram-YWT4CUSO-Cct1r0Ax.js} +1 -1
  73. package/dist/rcs-web/assets/{workerType-BF4aY_R_.js → workerType-DW9l12WG.js} +1 -1
  74. package/dist/rcs-web/assets/{xychartDiagram-2RQKCTM6-BBnx6V66.js → xychartDiagram-2RQKCTM6-CVc0eQYa.js} +1 -1
  75. package/dist/rcs-web/index.html +2 -2
  76. package/package.json +1 -1
  77. package/packages/remote-control-server/src/__tests__/memories.test.ts +654 -0
  78. package/packages/remote-control-server/src/db/rcs-schema.sql +42 -0
  79. package/packages/remote-control-server/src/registerRoutes.ts +6 -0
  80. package/packages/remote-control-server/src/routes/v1/memories.ts +132 -0
  81. package/packages/remote-control-server/src/routes/web/memories.ts +321 -0
  82. package/packages/remote-control-server/src/services/memories.ts +747 -0
  83. package/packages/remote-control-server/web/dist/assets/{AdminPanel-B9YWaqlO.js → AdminPanel-D0i_28O2.js} +1 -1
  84. package/packages/remote-control-server/web/dist/assets/{ArtifactView-B8lAeS5B.js → ArtifactView-Dd6d3O3z.js} +1 -1
  85. package/{dist/rcs-web/assets/ArtifactsGallery-CNd9-Awp.js → packages/remote-control-server/web/dist/assets/ArtifactsGallery-BTVS7sar.js} +1 -1
  86. package/{dist/rcs-web/assets/Claim-Dq08pl4W.js → packages/remote-control-server/web/dist/assets/Claim-CkuDG_ay.js} +1 -1
  87. package/packages/remote-control-server/web/dist/assets/{Dashboard-JZcrtByh.js → Dashboard-BBZHnmut.js} +2 -2
  88. package/packages/remote-control-server/web/dist/assets/{Join-DgvRnpyb.js → Join-DbBj-5mj.js} +1 -1
  89. package/{dist/rcs-web/assets/Login-CZbz6Wms.js → packages/remote-control-server/web/dist/assets/Login-Csvt3wvz.js} +1 -1
  90. package/packages/remote-control-server/web/dist/assets/MemoriesGallery-C5cT73hA.js +1 -0
  91. package/packages/remote-control-server/web/dist/assets/{Register-DD7uiwEj.js → Register-Cmp7ogoN.js} +1 -1
  92. package/packages/remote-control-server/web/dist/assets/{RegisterEmpty-BrBfeQXp.js → RegisterEmpty-BoIy42g_.js} +2 -2
  93. package/packages/remote-control-server/web/dist/assets/SessionDetail-CocGah-8.js +83 -0
  94. package/packages/remote-control-server/web/dist/assets/{SessionVisibilityBadge-kSo9esvT.js → SessionVisibilityBadge-C873QvnC.js} +2 -2
  95. package/packages/remote-control-server/web/dist/assets/{Setup-Ca30VUSF.js → Setup-DOU0qTNX.js} +1 -1
  96. package/packages/remote-control-server/web/dist/assets/{ShareLanding-C_vlxFAM.js → ShareLanding-DMR9eh0F.js} +1 -1
  97. package/{dist/rcs-web/assets/TeamDetail-8T_kKUcX.js → packages/remote-control-server/web/dist/assets/TeamDetail-MPfqesJf.js} +2 -2
  98. package/packages/remote-control-server/web/dist/assets/{TeamList-DRXGQCJi.js → TeamList-CgWVmdPU.js} +1 -1
  99. package/packages/remote-control-server/web/dist/assets/{TeamSettings-Byhon5C1.js → TeamSettings-V3L0H8Nb.js} +1 -1
  100. package/packages/remote-control-server/web/dist/assets/{UserSearchInput-wixyd_8w.js → UserSearchInput-xqtDX6Bz.js} +2 -2
  101. package/packages/remote-control-server/web/dist/assets/{UserSettings-Ds2retFk.js → UserSettings-Cfqs_5af.js} +1 -1
  102. package/packages/remote-control-server/web/dist/assets/{arc-CThS8KNL.js → arc-Bl97za3P.js} +1 -1
  103. package/packages/remote-control-server/web/dist/assets/{architectureDiagram-3BPJPVTR-Bko99SuX.js → architectureDiagram-3BPJPVTR-B8IQfxi6.js} +1 -1
  104. package/{dist/rcs-web/assets/blockDiagram-GPEHLZMM-CqCAgp0i.js → packages/remote-control-server/web/dist/assets/blockDiagram-GPEHLZMM-DNfBHM8J.js} +1 -1
  105. package/{dist/rcs-web/assets/c4Diagram-AAUBKEIU-C1pGDG-L.js → packages/remote-control-server/web/dist/assets/c4Diagram-AAUBKEIU-CO4HDUF2.js} +1 -1
  106. package/packages/remote-control-server/web/dist/assets/channel-DcTKV8fL.js +1 -0
  107. package/packages/remote-control-server/web/dist/assets/{chunk-2J33WTMH-Bz0kJwEY.js → chunk-2J33WTMH-4CBnqzb3.js} +1 -1
  108. package/packages/remote-control-server/web/dist/assets/{chunk-4BX2VUAB-DYnlidI7.js → chunk-4BX2VUAB-ClbIGQlY.js} +1 -1
  109. package/packages/remote-control-server/web/dist/assets/{chunk-55IACEB6-cMV4HRvm.js → chunk-55IACEB6-BnrTfmFM.js} +1 -1
  110. package/{dist/rcs-web/assets/chunk-727SXJPM-Bgz9JRYO.js → packages/remote-control-server/web/dist/assets/chunk-727SXJPM-C17NZOQL.js} +1 -1
  111. package/{dist/rcs-web/assets/chunk-AQP2D5EJ-DIFGJlEF.js → packages/remote-control-server/web/dist/assets/chunk-AQP2D5EJ-CljirtnS.js} +1 -1
  112. package/packages/remote-control-server/web/dist/assets/{chunk-FMBD7UC4-BUC7O7T0.js → chunk-FMBD7UC4-Bb20ipZI.js} +1 -1
  113. package/packages/remote-control-server/web/dist/assets/{chunk-ND2GUHAM-kGqgVnBZ.js → chunk-ND2GUHAM-L3q9_xAn.js} +1 -1
  114. package/packages/remote-control-server/web/dist/assets/{chunk-QZHKN3VN-B01O0qXh.js → chunk-QZHKN3VN-FyYNxzak.js} +1 -1
  115. package/packages/remote-control-server/web/dist/assets/classDiagram-4FO5ZUOK-5DsQRSDS.js +1 -0
  116. package/packages/remote-control-server/web/dist/assets/classDiagram-v2-Q7XG4LA2-5DsQRSDS.js +1 -0
  117. package/packages/remote-control-server/web/dist/assets/{code-block-IT6T5CEO-CscK0pCh.js → code-block-IT6T5CEO-CQVTEZwg.js} +1 -1
  118. package/packages/remote-control-server/web/dist/assets/{copy-CvmA5P_Q.js → copy-CFZBXuu9.js} +1 -1
  119. package/packages/remote-control-server/web/dist/assets/{cose-bilkent-S5V4N54A-BsBsVccW.js → cose-bilkent-S5V4N54A-Cs2MVxlS.js} +1 -1
  120. package/{dist/rcs-web/assets/dagre-BM42HDAG-Bn4B33S-.js → packages/remote-control-server/web/dist/assets/dagre-BM42HDAG-CWZcIIf5.js} +1 -1
  121. package/packages/remote-control-server/web/dist/assets/{diagram-2AECGRRQ-DAuAIPR6.js → diagram-2AECGRRQ-DpumSk2d.js} +1 -1
  122. package/packages/remote-control-server/web/dist/assets/{diagram-5GNKFQAL-w3k2b4gC.js → diagram-5GNKFQAL-DcF2qwdh.js} +1 -1
  123. package/{dist/rcs-web/assets/diagram-KO2AKTUF-CMLav2KT.js → packages/remote-control-server/web/dist/assets/diagram-KO2AKTUF-BGnqGSPz.js} +1 -1
  124. package/packages/remote-control-server/web/dist/assets/{diagram-LMA3HP47-D14sXWdh.js → diagram-LMA3HP47-k-UxYOZ9.js} +1 -1
  125. package/{dist/rcs-web/assets/diagram-OG6HWLK6-BexFwBQa.js → packages/remote-control-server/web/dist/assets/diagram-OG6HWLK6-BMPzmD6S.js} +1 -1
  126. package/packages/remote-control-server/web/dist/assets/{dialog-B4hKrd7w.js → dialog-DKk230y5.js} +1 -1
  127. package/packages/remote-control-server/web/dist/assets/{erDiagram-TEJ5UH35-BA8ANmoV.js → erDiagram-TEJ5UH35-BvmA6W9Z.js} +1 -1
  128. package/{dist/rcs-web/assets/flowDiagram-I6XJVG4X-dTQIvKsj.js → packages/remote-control-server/web/dist/assets/flowDiagram-I6XJVG4X-ptAnksiF.js} +1 -1
  129. package/packages/remote-control-server/web/dist/assets/{ganttDiagram-6RSMTGT7-8SDHYxXc.js → ganttDiagram-6RSMTGT7-Bhgrzcs3.js} +1 -1
  130. package/packages/remote-control-server/web/dist/assets/{gitGraphDiagram-PVQCEYII-Bu7LyvTG.js → gitGraphDiagram-PVQCEYII-B8-vcbF-.js} +1 -1
  131. package/packages/remote-control-server/web/dist/assets/{infoDiagram-5YYISTIA-BuQuDvuX.js → infoDiagram-5YYISTIA-DaW0unc2.js} +1 -1
  132. package/packages/remote-control-server/web/dist/assets/{ishikawaDiagram-YF4QCWOH-QjafGk8V.js → ishikawaDiagram-YF4QCWOH-4oYGuWP6.js} +1 -1
  133. package/{dist/rcs-web/assets/journeyDiagram-JHISSGLW-_FOXjXDF.js → packages/remote-control-server/web/dist/assets/journeyDiagram-JHISSGLW-B9YXpw0W.js} +1 -1
  134. package/packages/remote-control-server/web/dist/assets/{kanban-definition-UN3LZRKU-CbqJqyY6.js → kanban-definition-UN3LZRKU-Cglus7wI.js} +1 -1
  135. package/packages/remote-control-server/web/dist/assets/{linear-H6F41eb2.js → linear-CRTJd3_G.js} +1 -1
  136. package/packages/remote-control-server/web/dist/assets/{main-BopVSHhX.js → main-BKbA2ddo.js} +65 -65
  137. package/packages/remote-control-server/web/dist/assets/main-CP31AzxJ.css +1 -0
  138. package/{dist/rcs-web/assets/mermaid-VLURNSYL-5FH_DIq9.js → packages/remote-control-server/web/dist/assets/mermaid-VLURNSYL-D0JeVL0B.js} +4 -4
  139. package/packages/remote-control-server/web/dist/assets/{mermaid.core-C004NitB.js → mermaid.core-CobUk_K5.js} +5 -5
  140. package/packages/remote-control-server/web/dist/assets/{mindmap-definition-RKZ34NQL-utqEJ2a8.js → mindmap-definition-RKZ34NQL-B1s-et_p.js} +1 -1
  141. package/packages/remote-control-server/web/dist/assets/{notifications-DOBs9HVf.js → notifications-BrgRJuzQ.js} +1 -1
  142. package/packages/remote-control-server/web/dist/assets/{pieDiagram-4H26LBE5-OlbTwDZQ.js → pieDiagram-4H26LBE5-PcBs9RT_.js} +1 -1
  143. package/packages/remote-control-server/web/dist/assets/{quadrantDiagram-W4KKPZXB-BOe2DhrU.js → quadrantDiagram-W4KKPZXB-B2GxITjv.js} +1 -1
  144. package/packages/remote-control-server/web/dist/assets/{refresh-cw-BSwpDl-7.js → refresh-cw-BwmFF3kw.js} +1 -1
  145. package/{dist/rcs-web/assets/requirementDiagram-4Y6WPE33-s6V1yWUG.js → packages/remote-control-server/web/dist/assets/requirementDiagram-4Y6WPE33-BfyZiasB.js} +1 -1
  146. package/{dist/rcs-web/assets/sankeyDiagram-5OEKKPKP-CdJD78Mx.js → packages/remote-control-server/web/dist/assets/sankeyDiagram-5OEKKPKP-Br7tRtmq.js} +1 -1
  147. package/{dist/rcs-web/assets/sequenceDiagram-3UESZ5HK-DvGV6Dhl.js → packages/remote-control-server/web/dist/assets/sequenceDiagram-3UESZ5HK-CN1NSfHS.js} +1 -1
  148. package/{dist/rcs-web/assets/stateDiagram-AJRCARHV-Bj-_Ulcn.js → packages/remote-control-server/web/dist/assets/stateDiagram-AJRCARHV-C4S8hKUx.js} +1 -1
  149. package/packages/remote-control-server/web/dist/assets/{stateDiagram-v2-BHNVJYJU-BLGWynk-.js → stateDiagram-v2-BHNVJYJU-CbEMz-jf.js} +1 -1
  150. package/packages/remote-control-server/web/dist/assets/{timeline-definition-PNZ67QCA-B6VAH6Ka.js → timeline-definition-PNZ67QCA-mTiK0HwD.js} +1 -1
  151. package/packages/remote-control-server/web/dist/assets/{vennDiagram-CIIHVFJN-DUwaLI6R.js → vennDiagram-CIIHVFJN-DCe95URb.js} +1 -1
  152. package/packages/remote-control-server/web/dist/assets/{wardleyDiagram-YWT4CUSO-CBetJore.js → wardleyDiagram-YWT4CUSO-Cct1r0Ax.js} +1 -1
  153. package/packages/remote-control-server/web/dist/assets/{workerType-BF4aY_R_.js → workerType-DW9l12WG.js} +1 -1
  154. package/packages/remote-control-server/web/dist/assets/{xychartDiagram-2RQKCTM6-BBnx6V66.js → xychartDiagram-2RQKCTM6-CVc0eQYa.js} +1 -1
  155. package/packages/remote-control-server/web/dist/index.html +2 -2
  156. package/dist/rcs-web/assets/SessionDetail-BbnQBjP1.js +0 -78
  157. package/dist/rcs-web/assets/channel-D6RbJTfV.js +0 -1
  158. package/dist/rcs-web/assets/classDiagram-4FO5ZUOK-BlCPk6aR.js +0 -1
  159. package/dist/rcs-web/assets/classDiagram-v2-Q7XG4LA2-BlCPk6aR.js +0 -1
  160. package/dist/rcs-web/assets/main-C0n90aVY.css +0 -1
  161. package/packages/remote-control-server/web/dist/assets/SessionDetail-BbnQBjP1.js +0 -78
  162. package/packages/remote-control-server/web/dist/assets/channel-D6RbJTfV.js +0 -1
  163. package/packages/remote-control-server/web/dist/assets/classDiagram-4FO5ZUOK-BlCPk6aR.js +0 -1
  164. package/packages/remote-control-server/web/dist/assets/classDiagram-v2-Q7XG4LA2-BlCPk6aR.js +0 -1
  165. package/packages/remote-control-server/web/dist/assets/main-C0n90aVY.css +0 -1
@@ -165,6 +165,48 @@ CREATE VIRTUAL TABLE IF NOT EXISTS session_events_fts USING fts5(
165
165
  session_id UNINDEXED,
166
166
  event_id UNINDEXED
167
167
  );
168
+ -- Memories — durable team/personal memory entries (agent memory system).
169
+ -- `scope_kind` discriminates the two first-class scopes; the CHECK forces
170
+ -- exactly one owner column: personal rows carry owner_user_id, team rows
171
+ -- carry team_id. `source_session_id` keeps the provenance link back to the
172
+ -- session that produced the memory (agent write-back). `archived` is a
173
+ -- soft-delete terminal state that readers treat as missing.
174
+ CREATE TABLE IF NOT EXISTS memories (
175
+ id TEXT PRIMARY KEY,
176
+ scope_kind TEXT NOT NULL CHECK (scope_kind IN ('personal', 'team')),
177
+ owner_user_id TEXT,
178
+ team_id TEXT,
179
+ name TEXT NOT NULL,
180
+ description TEXT,
181
+ type TEXT NOT NULL CHECK (type IN ('user', 'feedback', 'project', 'reference')),
182
+ layer TEXT NOT NULL DEFAULT 'semantic' CHECK (layer IN ('episodic', 'semantic', 'procedural')),
183
+ content TEXT NOT NULL,
184
+ status TEXT NOT NULL DEFAULT 'active' CHECK (status IN ('active', 'superseded', 'archived')),
185
+ source_session_id TEXT,
186
+ version INTEGER NOT NULL DEFAULT 1,
187
+ created_by TEXT,
188
+ created_at TEXT NOT NULL,
189
+ updated_at TEXT NOT NULL,
190
+ CHECK (
191
+ (scope_kind = 'personal' AND owner_user_id IS NOT NULL AND team_id IS NULL)
192
+ OR (scope_kind = 'team' AND team_id IS NOT NULL AND owner_user_id IS NULL)
193
+ )
194
+ );
195
+
196
+ CREATE INDEX IF NOT EXISTS idx_memories_personal ON memories(owner_user_id, status, updated_at);
197
+ CREATE INDEX IF NOT EXISTS idx_memories_team ON memories(team_id, status, updated_at);
198
+ CREATE INDEX IF NOT EXISTS idx_memories_session ON memories(source_session_id);
199
+
200
+ -- Full-text search over memories (name/description/content), synced on
201
+ -- write in services/memories.ts — same contentless-free pattern as
202
+ -- session_events_fts (regular fts5 with an UNINDEXED join key).
203
+ CREATE VIRTUAL TABLE IF NOT EXISTS memories_fts USING fts5(
204
+ name,
205
+ description,
206
+ content,
207
+ memory_id UNINDEXED
208
+ );
209
+
168
210
  CREATE INDEX IF NOT EXISTS idx_artifacts_session ON artifacts(session_id);
169
211
  CREATE INDEX IF NOT EXISTS idx_artifacts_team ON artifacts(team_id);
170
212
  CREATE INDEX IF NOT EXISTS idx_artifacts_expires ON artifacts(expires_at);
@@ -1 +1 @@
1
- import{e as d,j as e}from"./vendor-DE_-CLIE.js";import{aL as x,aM as o,a3 as m,aD as s,at as l,I as u}from"./main-BopVSHhX.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function j(){x();const[a,i]=d.useState([]),{myTeams:r,isLoading:c}=o(),n=d.useCallback(async()=>{try{const t=await m();i(t||[])}catch(t){console.error("Admin: failed to load sessions",t)}},[]);return d.useEffect(()=>{n()},[n]),e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"mx-auto max-w-5xl px-4 py-8",children:[e.jsx("h1",{className:"mb-6 font-display text-2xl font-semibold text-text-primary",children:s("admin.title")}),e.jsxs("section",{className:"mb-10",children:[e.jsxs("h2",{className:"mb-4 font-display text-lg font-semibold text-text-primary",children:[s("admin.teams")," (",r.length,")"]}),c?e.jsx("div",{className:"rounded-xl border border-border bg-surface-1 p-4 text-center text-text-muted",children:s("common.loading")}):r.length===0?e.jsx("div",{className:"rounded-xl border border-border bg-surface-1 p-4 text-center text-text-muted",children:s("admin.noTeams")}):e.jsx("div",{className:"space-y-2",children:r.map(t=>e.jsxs("a",{href:`/teams/${t.slug}`,className:"flex items-center justify-between rounded-xl border border-border bg-surface-1 px-4 py-3 no-underline transition-colors hover:border-border-light hover:bg-surface-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"font-medium text-text-primary",children:t.name}),e.jsx("span",{className:"ml-2 text-xs text-text-muted",children:t.slug})]}),e.jsx("span",{className:"text-xs text-text-muted",children:l(new Date(t.created_at).getTime()/1e3)})]},t.id))})]}),e.jsxs("section",{children:[e.jsxs("h2",{className:"mb-4 font-display text-lg font-semibold text-text-primary",children:[s("admin.sessions")," (",a.length,")"]}),a.length===0?e.jsx("div",{className:"rounded-xl border border-border bg-surface-1 p-4 text-center text-text-muted",children:s("admin.noSessions")}):e.jsx("div",{className:"space-y-2",children:a.map(t=>e.jsxs("a",{href:`/code/${t.id}`,className:"flex items-center justify-between rounded-xl border border-border bg-surface-1 px-4 py-3 no-underline transition-colors hover:border-border-light hover:bg-surface-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate font-medium text-text-primary",children:t.title||t.id}),e.jsx("span",{className:"rounded-full bg-surface-2 px-2 py-0.5 text-xs text-text-muted",children:t.source||"unknown"})]}),e.jsx("div",{className:"truncate text-xs text-text-muted",children:t.id})]}),e.jsxs("div",{className:"ml-4 flex items-center gap-3",children:[e.jsx(u,{status:t.status}),e.jsx("span",{className:"text-xs text-text-muted",children:l(t.updated_at||t.created_at)})]})]},t.id))})]})]})})}export{j as AdminPanel};
1
+ import{e as d,j as e}from"./vendor-DE_-CLIE.js";import{aR as x,aS as o,a5 as m,aJ as s,az as l,I as u}from"./main-BKbA2ddo.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function j(){x();const[a,i]=d.useState([]),{myTeams:r,isLoading:c}=o(),n=d.useCallback(async()=>{try{const t=await m();i(t||[])}catch(t){console.error("Admin: failed to load sessions",t)}},[]);return d.useEffect(()=>{n()},[n]),e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"mx-auto max-w-5xl px-4 py-8",children:[e.jsx("h1",{className:"mb-6 font-display text-2xl font-semibold text-text-primary",children:s("admin.title")}),e.jsxs("section",{className:"mb-10",children:[e.jsxs("h2",{className:"mb-4 font-display text-lg font-semibold text-text-primary",children:[s("admin.teams")," (",r.length,")"]}),c?e.jsx("div",{className:"rounded-xl border border-border bg-surface-1 p-4 text-center text-text-muted",children:s("common.loading")}):r.length===0?e.jsx("div",{className:"rounded-xl border border-border bg-surface-1 p-4 text-center text-text-muted",children:s("admin.noTeams")}):e.jsx("div",{className:"space-y-2",children:r.map(t=>e.jsxs("a",{href:`/teams/${t.slug}`,className:"flex items-center justify-between rounded-xl border border-border bg-surface-1 px-4 py-3 no-underline transition-colors hover:border-border-light hover:bg-surface-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"font-medium text-text-primary",children:t.name}),e.jsx("span",{className:"ml-2 text-xs text-text-muted",children:t.slug})]}),e.jsx("span",{className:"text-xs text-text-muted",children:l(new Date(t.created_at).getTime()/1e3)})]},t.id))})]}),e.jsxs("section",{children:[e.jsxs("h2",{className:"mb-4 font-display text-lg font-semibold text-text-primary",children:[s("admin.sessions")," (",a.length,")"]}),a.length===0?e.jsx("div",{className:"rounded-xl border border-border bg-surface-1 p-4 text-center text-text-muted",children:s("admin.noSessions")}):e.jsx("div",{className:"space-y-2",children:a.map(t=>e.jsxs("a",{href:`/code/${t.id}`,className:"flex items-center justify-between rounded-xl border border-border bg-surface-1 px-4 py-3 no-underline transition-colors hover:border-border-light hover:bg-surface-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate font-medium text-text-primary",children:t.title||t.id}),e.jsx("span",{className:"rounded-full bg-surface-2 px-2 py-0.5 text-xs text-text-muted",children:t.source||"unknown"})]}),e.jsx("div",{className:"truncate text-xs text-text-muted",children:t.id})]}),e.jsxs("div",{className:"ml-4 flex items-center gap-3",children:[e.jsx(u,{status:t.status}),e.jsx("span",{className:"text-xs text-text-muted",children:l(t.updated_at||t.created_at)})]})]},t.id))})]})]})})}export{j as AdminPanel};
@@ -1 +1 @@
1
- import{e as a,j as t}from"./vendor-DE_-CLIE.js";import{aL as A,a4 as j,aD as r,a1 as q,ao as R,P as U,N as F}from"./main-BopVSHhX.js";import{S as O,E as G,C as K}from"./ArtifactsGallery-CNd9-Awp.js";import{R as P}from"./refresh-cw-BSwpDl-7.js";import{C as J}from"./copy-CvmA5P_Q.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";import"./dialog-B4hKrd7w.js";let m=null;function M(n,c,e=0){b();const o=`/web/sessions/${n}/events`,l=new EventSource(o,{withCredentials:!0});m=l;let u=e;l.addEventListener("message",p=>{try{const x=JSON.parse(p.data);if(x.seqNum!==void 0&&x.seqNum<=u)return;x.seqNum!==void 0&&(u=x.seqNum),c(x)}catch{}}),l.addEventListener("error",()=>{console.warn("[SSE] error, readyState:",l.readyState),l.readyState===EventSource.CLOSED&&(l.close(),b())})}function b(){m&&(m.close(),m=null)}function V(n,c){const e=a.useRef(c);e.current=c;const o=a.useCallback(l=>{e.current(l)},[]);a.useEffect(()=>{if(n)return M(n,o),()=>{b()}},[n,o])}function I({artifactId:n,onBack:c}){A();const[e,o]=a.useState(null),[l,u]=a.useState(""),[p,x]=a.useState(!1),[S,f]=a.useState(0),[w,h]=a.useState(!1),[g,C]=a.useState(null),[E,k]=a.useState("template"),[d,y]=a.useState(!1);a.useEffect(()=>{let s=!1;return j(n).then(i=>{s||o(i)}).catch(i=>{s||u(i instanceof Error?i.message:r("artifacts.viewNotFound"))}),()=>{s=!0}},[n]);const v=a.useCallback(()=>{j(n).then(s=>o(s)).catch(()=>{})},[n]),_=a.useCallback(s=>{var i;s.type==="artifact_updated"&&((i=s.payload)!=null&&i.id&&s.payload.id!==n||(v(),f(D=>D+1),y(!0)))},[n,v]);V((e==null?void 0:e.session_id)??null,_),a.useEffect(()=>{if(!d)return;const s=setTimeout(()=>y(!1),2500);return()=>clearTimeout(s)},[d]);const N=a.useCallback(s=>{e&&(C(e),k(s),h(!0))},[e]),$=a.useCallback(s=>{h(!1),o(i=>i?{...i,...s}:s),f(i=>i+1)},[]),T=a.useCallback(async()=>{if(window.confirm(r("artifacts.delete")+" — "+n.slice(0,8)+"…?"))try{await q(n),c()}catch(s){alert(s instanceof Error?s.message:r("artifacts.deleteFailed"))}},[n,c]),L=a.useCallback(async()=>{if(!e)return;await R(`${window.location.origin}${e.url}`)&&(x(!0),setTimeout(()=>x(!1),1500))},[e]);return l?t.jsx("div",{className:"flex flex-1 items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-status-error",children:r("artifacts.viewNotFound")}),t.jsx("p",{className:"mt-1 text-xs text-text-muted",children:l}),t.jsx("button",{type:"button",onClick:c,className:"mt-4 rounded-md border border-border px-4 py-2 text-sm text-text-secondary hover:bg-surface-2",children:r("artifacts.backToGallery")})]})}):e?t.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b border-border bg-surface-1 px-4 py-2.5",children:[t.jsx("button",{type:"button",onClick:c,className:"text-sm text-text-muted hover:text-text-primary",children:r("artifacts.backToGallery")}),t.jsx("span",{className:"text-text-muted/40",children:"/"}),t.jsx("span",{className:"truncate font-medium text-text-primary",children:e.title||e.id.slice(0,12)}),t.jsx("span",{className:`rounded-full px-2 py-0.5 text-[10px] transition-colors ${d?"bg-status-active/15 text-status-active":"bg-surface-3 text-text-muted"}`,title:d?r("artifacts.view.liveUpdated"):void 0,children:d?`↻ v${e.version}`:`v${e.version}`}),e.session_id&&t.jsxs("a",{href:`/code/${e.session_id}`,className:"truncate font-mono text-[10px] text-text-muted hover:text-accent",title:e.session_id,children:[r("artifacts.session"),": ",e.session_id.slice(0,14),"…"]}),e.expires_at&&t.jsxs("span",{className:"text-[10px] text-text-muted",title:e.expires_at,children:[r("artifacts.expires"),": ",new Date(e.expires_at).toLocaleDateString()]}),t.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[t.jsx("button",{type:"button",onClick:()=>f(s=>s+1),className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:r("common.loading"),children:t.jsx(P,{className:"h-3.5 w-3.5"})}),t.jsx("button",{type:"button",onClick:()=>N("ai"),className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:r("artifacts.aiUpdate"),children:t.jsx(O,{className:"h-3.5 w-3.5"})}),e.can_manage&&t.jsx("button",{type:"button",onClick:()=>N("template"),className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:r("artifacts.edit"),children:t.jsx(U,{className:"h-3.5 w-3.5"})}),t.jsxs("button",{type:"button",onClick:L,className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:`${r("artifacts.copyLink")} · ${r("artifacts.linkNotice")}`,children:[t.jsx(J,{className:"h-3.5 w-3.5"}),p&&t.jsx("span",{className:"text-status-active",children:r("artifacts.copied")})]}),t.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:r("artifacts.openInNewTab"),children:t.jsx(G,{className:"h-3.5 w-3.5"})}),t.jsx("button",{type:"button",onClick:T,className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-status-error/10 hover:text-status-error",title:r("artifacts.delete"),children:t.jsx(F,{className:"h-3.5 w-3.5"})})]})]}),t.jsx("iframe",{src:`${e.url}${e.url.includes("?")?"&":"?"}_=${Date.now()}`,title:e.title||e.id,className:"min-h-0 w-full flex-1 border-0 bg-white",sandbox:"allow-scripts allow-popups allow-forms"},S),t.jsx(K,{open:w,onClose:()=>h(!1),onCreated:$,editArtifact:g,initialMode:E})]}):t.jsx("div",{className:"flex flex-1 items-center justify-center text-text-muted",children:r("common.loading")})}export{I as ArtifactView};
1
+ import{e as a,j as t}from"./vendor-DE_-CLIE.js";import{aR as A,a6 as j,aJ as r,a2 as R,au as q,P as U,N as F}from"./main-BKbA2ddo.js";import{S as O,E as G,C as J}from"./ArtifactsGallery-BTVS7sar.js";import{R as K}from"./refresh-cw-BwmFF3kw.js";import{C as P}from"./copy-CFZBXuu9.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";import"./dialog-DKk230y5.js";let m=null;function M(n,c,e=0){b();const o=`/web/sessions/${n}/events`,l=new EventSource(o,{withCredentials:!0});m=l;let u=e;l.addEventListener("message",p=>{try{const x=JSON.parse(p.data);if(x.seqNum!==void 0&&x.seqNum<=u)return;x.seqNum!==void 0&&(u=x.seqNum),c(x)}catch{}}),l.addEventListener("error",()=>{console.warn("[SSE] error, readyState:",l.readyState),l.readyState===EventSource.CLOSED&&(l.close(),b())})}function b(){m&&(m.close(),m=null)}function V(n,c){const e=a.useRef(c);e.current=c;const o=a.useCallback(l=>{e.current(l)},[]);a.useEffect(()=>{if(n)return M(n,o),()=>{b()}},[n,o])}function I({artifactId:n,onBack:c}){A();const[e,o]=a.useState(null),[l,u]=a.useState(""),[p,x]=a.useState(!1),[S,f]=a.useState(0),[w,h]=a.useState(!1),[g,C]=a.useState(null),[E,k]=a.useState("template"),[d,y]=a.useState(!1);a.useEffect(()=>{let s=!1;return j(n).then(i=>{s||o(i)}).catch(i=>{s||u(i instanceof Error?i.message:r("artifacts.viewNotFound"))}),()=>{s=!0}},[n]);const v=a.useCallback(()=>{j(n).then(s=>o(s)).catch(()=>{})},[n]),_=a.useCallback(s=>{var i;s.type==="artifact_updated"&&((i=s.payload)!=null&&i.id&&s.payload.id!==n||(v(),f(D=>D+1),y(!0)))},[n,v]);V((e==null?void 0:e.session_id)??null,_),a.useEffect(()=>{if(!d)return;const s=setTimeout(()=>y(!1),2500);return()=>clearTimeout(s)},[d]);const N=a.useCallback(s=>{e&&(C(e),k(s),h(!0))},[e]),$=a.useCallback(s=>{h(!1),o(i=>i?{...i,...s}:s),f(i=>i+1)},[]),T=a.useCallback(async()=>{if(window.confirm(r("artifacts.delete")+" — "+n.slice(0,8)+"…?"))try{await R(n),c()}catch(s){alert(s instanceof Error?s.message:r("artifacts.deleteFailed"))}},[n,c]),L=a.useCallback(async()=>{if(!e)return;await q(`${window.location.origin}${e.url}`)&&(x(!0),setTimeout(()=>x(!1),1500))},[e]);return l?t.jsx("div",{className:"flex flex-1 items-center justify-center",children:t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"text-status-error",children:r("artifacts.viewNotFound")}),t.jsx("p",{className:"mt-1 text-xs text-text-muted",children:l}),t.jsx("button",{type:"button",onClick:c,className:"mt-4 rounded-md border border-border px-4 py-2 text-sm text-text-secondary hover:bg-surface-2",children:r("artifacts.backToGallery")})]})}):e?t.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2 border-b border-border bg-surface-1 px-4 py-2.5",children:[t.jsx("button",{type:"button",onClick:c,className:"text-sm text-text-muted hover:text-text-primary",children:r("artifacts.backToGallery")}),t.jsx("span",{className:"text-text-muted/40",children:"/"}),t.jsx("span",{className:"truncate font-medium text-text-primary",children:e.title||e.id.slice(0,12)}),t.jsx("span",{className:`rounded-full px-2 py-0.5 text-[10px] transition-colors ${d?"bg-status-active/15 text-status-active":"bg-surface-3 text-text-muted"}`,title:d?r("artifacts.view.liveUpdated"):void 0,children:d?`↻ v${e.version}`:`v${e.version}`}),e.session_id&&t.jsxs("a",{href:`/code/${e.session_id}`,className:"truncate font-mono text-[10px] text-text-muted hover:text-accent",title:e.session_id,children:[r("artifacts.session"),": ",e.session_id.slice(0,14),"…"]}),e.expires_at&&t.jsxs("span",{className:"text-[10px] text-text-muted",title:e.expires_at,children:[r("artifacts.expires"),": ",new Date(e.expires_at).toLocaleDateString()]}),t.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[t.jsx("button",{type:"button",onClick:()=>f(s=>s+1),className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:r("common.loading"),children:t.jsx(K,{className:"h-3.5 w-3.5"})}),t.jsx("button",{type:"button",onClick:()=>N("ai"),className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:r("artifacts.aiUpdate"),children:t.jsx(O,{className:"h-3.5 w-3.5"})}),e.can_manage&&t.jsx("button",{type:"button",onClick:()=>N("template"),className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:r("artifacts.edit"),children:t.jsx(U,{className:"h-3.5 w-3.5"})}),t.jsxs("button",{type:"button",onClick:L,className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:`${r("artifacts.copyLink")} · ${r("artifacts.linkNotice")}`,children:[t.jsx(P,{className:"h-3.5 w-3.5"}),p&&t.jsx("span",{className:"text-status-active",children:r("artifacts.copied")})]}),t.jsx("a",{href:e.url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:r("artifacts.openInNewTab"),children:t.jsx(G,{className:"h-3.5 w-3.5"})}),t.jsx("button",{type:"button",onClick:T,className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-status-error/10 hover:text-status-error",title:r("artifacts.delete"),children:t.jsx(F,{className:"h-3.5 w-3.5"})})]})]}),t.jsx("iframe",{src:`${e.url}${e.url.includes("?")?"&":"?"}_=${Date.now()}`,title:e.title||e.id,className:"min-h-0 w-full flex-1 border-0 bg-white",sandbox:"allow-scripts allow-popups allow-forms"},S),t.jsx(J,{open:w,onClose:()=>h(!1),onCreated:$,editArtifact:g,initialMode:E})]}):t.jsx("div",{className:"flex flex-1 items-center justify-center text-text-muted",children:r("common.loading")})}export{I as ArtifactView};
@@ -1,4 +1,4 @@
1
- var pt=Object.defineProperty;var ht=(t,e,r)=>e in t?pt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var S=(t,e,r)=>ht(t,typeof e!="symbol"?e+"":e,r);import{e as k,j as o}from"./vendor-DE_-CLIE.js";import{ap as Te,au as ut,aL as Qe,aM as ft,a5 as mt,aD as f,a1 as xt,ao as gt,F as bt,i as kt,P as yt,N as wt,t as vt,a4 as St,aa as Rt,ay as Tt,a9 as $t,ai as jt,aj as Et,_ as Nt,b as Ct}from"./main-BopVSHhX.js";import{D as It,a as At,c as Lt,d as zt,b as _t}from"./dialog-B4hKrd7w.js";import{C as Dt}from"./copy-CvmA5P_Q.js";/**
1
+ var pt=Object.defineProperty;var ht=(t,e,r)=>e in t?pt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var S=(t,e,r)=>ht(t,typeof e!="symbol"?e+"":e,r);import{e as k,j as o}from"./vendor-DE_-CLIE.js";import{av as Te,aA as ut,aR as Qe,aS as ft,a7 as mt,aJ as f,a2 as xt,au as gt,F as bt,i as kt,P as yt,N as wt,t as vt,a6 as St,ae as Rt,aE as Tt,ad as $t,an as jt,ao as Et,_ as Nt,b as Ct}from"./main-BKbA2ddo.js";import{D as It,a as At,c as Lt,d as zt,b as _t}from"./dialog-DKk230y5.js";import{C as Dt}from"./copy-CFZBXuu9.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{Y as u,a3 as f}from"./main-BopVSHhX.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";const v=2e3,N=3e4;function E(){const c=window.location.pathname.split("/"),i=c[c.length-1]||"",[s,n]=r.useState("idle"),[m,l]=r.useState(null),[a,d]=r.useState(null);return r.useEffect(()=>{if(!i||!i.startsWith("clm_")){l("Invalid claim token"),n("error");return}n("claiming"),u(i).then(t=>{d(t.environment_id),n("waiting")}).catch(t=>{l(t instanceof Error?t.message:"Claim failed"),n("error")})},[i]),r.useEffect(()=>{if(s!=="waiting"||!a)return;let t=!1;const x=Date.now(),o=setInterval(()=>{if(Date.now()-x>N){clearInterval(o),t||n("timeout");return}f().then(h=>{t||(h||[]).some(p=>p.environment_id===a)&&(clearInterval(o),window.location.href="/code/")}).catch(()=>{})},v);return()=>{t=!0,clearInterval(o)}},[s,a]),s==="claiming"?e.jsx("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:e.jsx("p",{className:"text-sm text-text-muted",children:"Claiming environment..."})}):s==="error"?e.jsxs("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:[e.jsx("p",{className:"text-sm text-destructive",children:m}),e.jsx("a",{href:"/code",className:"mt-4 inline-block text-accent hover:underline",children:"Back to dashboard"})]}):s==="waiting"||s==="timeout"?e.jsxs("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:[e.jsxs("header",{className:"mb-10",children:[e.jsx("h1",{className:"font-display text-2xl font-semibold tracking-tight text-text-primary",children:"Environment claimed"}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:"You are now the owner of this environment."})]}),e.jsxs("div",{className:"space-y-4",children:[a&&e.jsx("p",{className:"font-mono text-xs text-text-muted",children:a}),s==="waiting"?e.jsxs("p",{className:"text-sm text-text-muted",children:["Waiting for the worker to create a session",e.jsx("span",{className:"animate-pulse",children:"…"})]}):e.jsx("p",{className:"text-sm text-text-muted",children:"The worker has not created a session yet — it may be offline or stopped. The session will appear on the dashboard once the worker connects."}),e.jsx("a",{href:"/code",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent/90 transition-colors",children:"Go to dashboard"})]})]}):e.jsx("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:e.jsx("p",{className:"text-sm text-text-muted",children:"Claiming environment..."})})}export{E as Claim};
1
+ import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{Y as u,a5 as f}from"./main-BKbA2ddo.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";const v=2e3,N=3e4;function E(){const c=window.location.pathname.split("/"),i=c[c.length-1]||"",[s,n]=r.useState("idle"),[m,l]=r.useState(null),[a,d]=r.useState(null);return r.useEffect(()=>{if(!i||!i.startsWith("clm_")){l("Invalid claim token"),n("error");return}n("claiming"),u(i).then(t=>{d(t.environment_id),n("waiting")}).catch(t=>{l(t instanceof Error?t.message:"Claim failed"),n("error")})},[i]),r.useEffect(()=>{if(s!=="waiting"||!a)return;let t=!1;const x=Date.now(),o=setInterval(()=>{if(Date.now()-x>N){clearInterval(o),t||n("timeout");return}f().then(h=>{t||(h||[]).some(p=>p.environment_id===a)&&(clearInterval(o),window.location.href="/code/")}).catch(()=>{})},v);return()=>{t=!0,clearInterval(o)}},[s,a]),s==="claiming"?e.jsx("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:e.jsx("p",{className:"text-sm text-text-muted",children:"Claiming environment..."})}):s==="error"?e.jsxs("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:[e.jsx("p",{className:"text-sm text-destructive",children:m}),e.jsx("a",{href:"/code",className:"mt-4 inline-block text-accent hover:underline",children:"Back to dashboard"})]}):s==="waiting"||s==="timeout"?e.jsxs("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:[e.jsxs("header",{className:"mb-10",children:[e.jsx("h1",{className:"font-display text-2xl font-semibold tracking-tight text-text-primary",children:"Environment claimed"}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:"You are now the owner of this environment."})]}),e.jsxs("div",{className:"space-y-4",children:[a&&e.jsx("p",{className:"font-mono text-xs text-text-muted",children:a}),s==="waiting"?e.jsxs("p",{className:"text-sm text-text-muted",children:["Waiting for the worker to create a session",e.jsx("span",{className:"animate-pulse",children:"…"})]}):e.jsx("p",{className:"text-sm text-text-muted",children:"The worker has not created a session yet — it may be offline or stopped. The session will appear on the dashboard once the worker connects."}),e.jsx("a",{href:"/code",className:"inline-block rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent/90 transition-colors",children:"Go to dashboard"})]})]}):e.jsx("div",{className:"px-6 py-16 sm:px-10 sm:py-20",children:e.jsx("p",{className:"text-sm text-text-muted",children:"Claiming environment..."})})}export{E as Claim};
@@ -1,6 +1,6 @@
1
- import{j as e,e as r}from"./vendor-DE_-CLIE.js";import{ap as Q,an as E,aM as I,aK as O,aD as t,U as V,at as q,aL as B,I as X,f as P,e as $,$ as Z,ah as G,a3 as J,a6 as Y,a2 as ee,S as U,X as se,aE as ae}from"./main-BopVSHhX.js";import{R as H,E as te}from"./RegisterEmpty-BrBfeQXp.js";import{g as L}from"./workerType-BF4aY_R_.js";import{S as ne}from"./SessionVisibilityBadge-kSo9esvT.js";import{D as re,a as le,d as ce}from"./dialog-B4hKrd7w.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";/**
1
+ import{j as e,e as r}from"./vendor-DE_-CLIE.js";import{av as K,at as E,aS as I,aQ as O,aJ as t,U as V,az as q,aR as B,I as J,f as P,e as U,a0 as X,am as Z,a5 as G,a8 as Y,a4 as ee,S as $,X as se,aK as ae}from"./main-BKbA2ddo.js";import{R as z,E as te}from"./RegisterEmpty-BoIy42g_.js";import{g as L}from"./workerType-DW9l12WG.js";import{S as ne}from"./SessionVisibilityBadge-C873QvnC.js";import{D as re,a as le,d as ce}from"./dialog-DKk230y5.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const de=[["path",{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",key:"1kt360"}]],ie=Q("folder",de);function oe({teamName:c,className:x}){return c?e.jsx("span",{className:E("inline-flex items-center rounded-full border border-border/60 bg-surface-2 px-2 py-0.5 text-xs text-text-muted",x),children:c}):null}function me({environments:c,onSelectEnvironment:x}){const{activeTeam:y,isAllTeams:v}=I(),{user:i}=O(),o=r.useMemo(()=>(i==null?void 0:i.role)==="admin"||v?c:y?c.filter(l=>l.team_id===y.id):c.filter(l=>!l.team_id),[c,y,v,i]);return!o||o.length===0?e.jsx(H,{title:t("dashboard.emptyEnvironmentsTitle"),hint:t("dashboard.emptyEnvironmentsHint")}):e.jsx("div",{className:"ds-reg",children:o.map(l=>{var w,N,g;const p=l.worker_type==="acp",b=L(l.worker_type),m=((w=l.directory)==null?void 0:w.trim())||null,f=((N=l.ip_address)==null?void 0:N.trim())||null,j=((g=l.owner_username)==null?void 0:g.trim())||null;return e.jsxs("div",{className:E("ds-reg-row group",p&&"opacity-80"),children:[e.jsxs("button",{type:"button",onClick:()=>x==null?void 0:x(l),disabled:p,className:E("ds-reg-main",p?"cursor-default":"cursor-pointer"),children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"min-w-0 truncate text-sm font-medium text-text-primary",children:l.machine_name||l.id}),e.jsx("span",{className:E("ds-reg-tag rounded-full",b.colorClass),children:b.fullLabel}),e.jsx(te,{status:l.status,className:"ds-reg-tag"}),e.jsx(oe,{teamName:l.team_name??null,className:"ds-reg-tag"})]}),(m||f||j)&&e.jsxs("span",{className:"ds-reg-meta flex min-w-0 items-center gap-1.5 text-xs text-text-muted",children:[m&&e.jsx("span",{className:"min-w-0 truncate font-mono",children:m}),m&&f&&e.jsx("span",{className:"ds-reg-fact-sep","aria-hidden":"true",children:"·"}),f&&e.jsx("span",{className:"shrink-0 whitespace-nowrap font-mono tabular-nums",children:f}),(m||f)&&j&&e.jsx("span",{className:"ds-reg-fact-sep","aria-hidden":"true",children:"·"}),j&&e.jsxs("span",{className:"ds-reg-owner",title:`${t("dashboard.envOwner")}: ${j}`,children:[e.jsx(V,{className:"h-3 w-3","aria-hidden":"true"}),e.jsx("span",{className:"min-w-0 truncate",children:j})]})]})]}),e.jsx("div",{className:"ds-reg-aside",children:e.jsx("span",{className:"col-start-2 whitespace-nowrap font-mono text-xs tabular-nums text-text-muted",children:q(l.created_at)})})]},l.id)})})}function he({sessions:c,environments:x,onSelect:y,onDelete:v}){B();const{activeTeam:i,isAllTeams:o,myTeams:l}=I(),{user:p}=O(),b=r.useMemo(()=>{const s=new Map;for(const h of l)s.set(h.id,h.name);return s},[l]),m=r.useMemo(()=>(p==null?void 0:p.role)==="admin"||o?c:i?c.filter(s=>s.owner_type==="team"&&s.owner_id===i.id):c.filter(s=>s.owner_type==="user"||s.access_level==="write"||s.access_level==="read"),[c,i,o,p]),{mySessions:f,sharedSessions:j}=r.useMemo(()=>{const s=[],h=[];for(const u of m)i||o?s.push(u):u.access_level==="write"||u.access_level==="read"?h.push(u):s.push(u);return{mySessions:s,sharedSessions:h}},[m,i,o]),w=new Map;for(const s of x??[])s!=null&&s.id&&s.worker_type&&w.set(s.id,s.worker_type);const N=(s,h)=>(h.updated_at||0)-(s.updated_at||0);function g(s){var D;const h=!!v&&s.access_level!=="write"&&s.access_level!=="read";let u=s.source==="acp"?"acp":(D=s.environment)==null?void 0:D.worker_type;!u&&s.environment_id&&(u=w.get(s.environment_id));const d=L(u);return e.jsxs("div",{className:"ds-reg-row group",children:[e.jsxs("button",{type:"button",onClick:()=>y(s.id),className:"ds-reg-main cursor-pointer",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"min-w-0 truncate text-sm font-medium text-text-primary",children:s.title||s.id}),s.visibility&&e.jsx(ne,{visibility:s.visibility||"private",className:"ds-reg-tag"}),e.jsx("span",{className:E("ds-reg-tag rounded-full",d.colorClass),children:d.fullLabel})]}),e.jsxs("span",{className:"ds-reg-meta flex items-center gap-2 truncate text-xs text-text-muted",children:[e.jsx("span",{className:"truncate font-mono",children:s.id}),s.owner_type==="team"&&s.owner_id&&e.jsxs("span",{className:"inline-flex items-center gap-2 truncate",children:[e.jsx("span",{className:"text-text-muted/40",children:"|"}),e.jsx("span",{className:"truncate",children:b.get(s.owner_id)||s.owner_id})]})]})]}),e.jsxs("div",{className:"ds-reg-aside",children:[e.jsx(X,{status:s.status}),e.jsx("span",{className:"whitespace-nowrap font-mono text-xs tabular-nums text-text-muted",children:q(s.created_at||s.updated_at)}),h&&e.jsx("button",{type:"button",onClick:T=>{T.stopPropagation(),v(s.id)},className:"ds-reg-delete rounded p-1 text-text-muted opacity-0 transition-all hover:text-status-error group-hover:opacity-100 focus-visible:opacity-100",title:"Delete session",children:e.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]},s.id)}if(m.length===0)return e.jsx(H,{title:t("dashboard.emptySessionsTitle"),hint:t("dashboard.emptySessionsHint")});const k=[...f].sort(N),C=[...j].sort(N);return e.jsxs("div",{className:"space-y-4",children:[k.length>0&&e.jsx("section",{className:"space-y-2",children:e.jsx("div",{className:"ds-reg",children:k.map(g)})}),C.length>0&&e.jsxs("section",{className:"space-y-2",children:[k.length>0&&e.jsx("h3",{className:"text-xs font-medium uppercase tracking-wide text-text-muted",children:t("session.sharedWithMe")}),e.jsx("div",{className:"ds-reg",children:C.map(g)})]})]})}function ue({open:c,environments:x,onClose:y,onCreated:v}){B();const{activeTeam:i,isAllTeams:o}=I(),{user:l}=O(),[p,b]=r.useState(""),[m,f]=r.useState(""),[j,w]=r.useState("same-dir"),[N,g]=r.useState(""),[k,C]=r.useState(!1),[s,h]=r.useState(!1),u=r.useMemo(()=>(l==null?void 0:l.role)==="admin"||o?x:i?x.filter(a=>a.team_id===i.id):x.filter(a=>!a.team_id),[x,i,o,l]);r.useEffect(()=>{c&&(b(""),f(""),w("same-dir"),g(""),h(!1))},[c]);const d=u.find(a=>a.id===m)||null,D=d?u.findIndex(a=>a.id===d.id)+1:null,T=async()=>{C(!0),g("");try{const a={};p.trim()&&(a.title=p.trim()),m&&(a.environment_id=m),a.spawn_mode=j;const M=(i==null?void 0:i.id)??(o?d==null?void 0:d.team_id:void 0);M&&(a.team_id=M);const S=await Z(a);v(S)}catch(a){g(a instanceof Error?a.message:t("dialog.createFailed"))}finally{C(!1)}};return e.jsx(re,{open:c,onOpenChange:a=>{a||y()},children:e.jsx(le,{className:"nsd-shell max-w-md",children:e.jsxs("div",{className:"nsd-box",children:[e.jsx(ce,{className:"nsd-h",children:t("dialog.newSession")}),e.jsxs("div",{className:"nsd-field nsd-field--env",children:[e.jsx("span",{className:"nsd-lab",children:t("dialog.environment")}),e.jsxs("button",{type:"button",className:"nsd-envtrigger","aria-expanded":s,onClick:()=>h(a=>!a),children:[e.jsx("span",{className:"nsd-env-read",children:d?e.jsxs(e.Fragment,{children:[D!==null&&e.jsxs("span",{className:"nsd-env-idx",children:["#",D]}),e.jsx("span",{className:"nsd-env-name",children:d.machine_name||d.id}),e.jsx("span",{className:E("nsd-env-type",L(d.worker_type).colorClass),children:L(d.worker_type).shortLabel})]}):e.jsx("span",{className:"nsd-env-none",children:t("dialog.envSelectEnv")})}),e.jsx(P,{className:"nsd-env-caret"})]}),(d==null?void 0:d.directory)&&e.jsx("span",{className:"nsd-env-path",children:d.directory}),s&&e.jsxs("div",{className:"nsd-envpanel",children:[e.jsx("button",{type:"button",onClick:()=>{f(""),h(!1)},className:"nsd-envrow",children:e.jsxs("span",{className:"nsd-envrow-head",children:[e.jsx("span",{className:"nsd-envrow-name",children:t("dialog.none")}),!m&&e.jsx($,{className:"ml-auto h-3.5 w-3.5 shrink-0 text-brand-text"})]})}),u.length===0?e.jsx("p",{className:"nsd-envempty",children:t("dialog.envEmpty")}):u.map((a,M)=>{const S=L(a.worker_type),R=!!a.team_id,A=a.id===m;return e.jsxs("button",{type:"button","data-selected":A?"on":void 0,onClick:()=>{f(a.id),h(!1)},className:"nsd-envrow",children:[e.jsxs("span",{className:"nsd-envrow-head",children:[e.jsxs("span",{className:"nsd-envrow-idx",children:["#",M+1]}),e.jsx("span",{className:"nsd-envrow-name",children:a.machine_name||a.id}),e.jsx("span",{className:E("nsd-envrow-type",S.colorClass),children:S.shortLabel}),e.jsx("span",{className:E("nsd-envrow-team",R?"border-border/60 bg-surface-2 text-text-muted":"border-brand/30 bg-brand/10 text-brand-text"),children:R?`${t("dialog.envTeam")}: ${a.team_name||a.team_id}`:t("dialog.envPersonal")}),A&&e.jsx($,{className:"ml-auto h-3.5 w-3.5 shrink-0 text-brand-text"})]}),a.directory&&e.jsxs("span",{className:"nsd-envrow-dir",children:[e.jsx(ie,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:"nsd-envrow-path",children:a.directory}),a.branch&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-text-muted/40",children:"·"}),e.jsx("span",{className:"nsd-envrow-path",children:a.branch})]})]})]},a.id)})]})]}),e.jsxs("label",{className:"nsd-field",children:[e.jsx("span",{className:"nsd-lab",children:t("dialog.titleOptional")}),e.jsx("input",{type:"text",value:p,onChange:a=>b(a.target.value),placeholder:t("dialog.titlePlaceholder"),className:"nsd-title"})]}),e.jsxs("label",{className:"nsd-field",children:[e.jsx("span",{className:"nsd-lab",children:t("dialog.workspaceMode")}),e.jsxs("span",{className:"nsd-modesel",children:[e.jsxs("select",{value:j,onChange:a=>w(a.target.value),className:"nsd-mode",children:[e.jsx("option",{value:"same-dir",children:t("dialog.sameDir")}),e.jsx("option",{value:"worktree",children:t("dialog.worktree")})]}),e.jsx(P,{className:"nsd-mode-caret"})]})]}),N&&e.jsx("p",{className:"nsd-error",children:N}),e.jsxs("div",{className:"nsd-foot",children:[e.jsx("button",{type:"button",onClick:y,className:"nsd-cancel",children:t("common.cancel")}),e.jsx("button",{type:"button",onClick:T,disabled:k,className:"btn-ticket nsd-create",children:k?t("common.creating"):t("common.create")})]})]})})})}function ye({onNavigateSession:c}){const x=B(),y=r.useMemo(()=>new Date().toLocaleDateString(x==="zh"?"zh-CN":"en-US",{year:"numeric",month:"long",day:"numeric",weekday:"short"}),[x]),[v,i]=r.useState([]),[o,l]=r.useState([]),[p,b]=r.useState(!1),[m,f]=r.useState(!1),[j,w]=r.useState(""),[N,g]=r.useState(null),[k,C]=r.useState(!1),s=r.useRef(0),[h,u]=r.useState(!1),d=m||h,D=r.useCallback(()=>{f(!1),w(""),u(!0)},[]),T=r.useCallback(()=>{u(!1)},[]),a=r.useRef(null),M=r.useRef(!1);r.useEffect(()=>{var n;M.current&&!d&&((n=a.current)==null||n.focus()),M.current=d},[d]),r.useEffect(()=>{const n=j.trim();if(!n){s.current+=1,g(null),C(!1);return}C(!0);const _=++s.current,F=setTimeout(()=>{G(n).then(K=>{s.current===_&&g(K.results??[])}).catch(()=>{s.current===_&&g([])}).finally(()=>{s.current===_&&C(!1)})},300);return()=>clearTimeout(F)},[j]);const S=r.useCallback(async()=>{try{const[n,_]=await Promise.all([J(),Y()]);i(n||[]),l(_||[])}catch(n){console.error("Dashboard render error:",n)}},[]);r.useEffect(()=>{S();const n=setInterval(S,5e3);return window.addEventListener("focus",S),()=>{clearInterval(n),window.removeEventListener("focus",S)}},[S]);const R=n=>{b(!1),c(n.id)},A=r.useCallback(n=>{},[]),W=r.useCallback(n=>{c(n)},[c]),z=r.useCallback(async n=>{if(window.confirm(t("dashboard.confirmDelete").replace("{id}",n)))try{await ee(n),i(_=>_.filter(F=>F.id!==n))}catch(_){alert(_ instanceof Error?_.message:t("dashboard.deleteFailed"))}},[]);return e.jsxs("div",{className:"ds-dash",children:[e.jsxs("header",{className:"ds-dash-bar hero-enter",children:[e.jsx("span",{className:"ds-dash-dateline",children:y}),e.jsxs("div",{className:"ds-dash-titlerow",children:[e.jsx("h1",{className:"ds-dash-title font-display font-semibold tracking-tight text-text-primary",children:t("dashboard.title")}),e.jsxs("div",{className:"ds-dash-counts",children:[e.jsxs("span",{children:[v.length," ",t("dashboard.sessions")]}),e.jsxs("span",{children:[o.length," ",t("dashboard.environments")]})]})]})]}),e.jsxs("section",{className:"ds-dash-row",children:[e.jsx("h2",{className:"font-display text-lg font-semibold text-text-primary",children:t("dashboard.environments")}),e.jsx(me,{environments:o,onSelectEnvironment:A})]}),e.jsxs("section",{className:"ds-dash-row",children:[e.jsxs("div",{className:"ds-dash-rowhead",children:[e.jsxs("div",{className:"ds-dash-rowlabel",children:[e.jsx("h2",{className:"font-display text-lg font-semibold text-text-primary",children:t("dashboard.sessions")}),d?e.jsxs("div",{className:E("ds-dash-search",h&&"ds-dash-search--folding"),onAnimationEnd:T,children:[e.jsx(U,{className:"h-4 w-4 flex-shrink-0 text-text-muted","aria-hidden":"true"}),e.jsx("input",{autoFocus:!0,value:j,onChange:n=>w(n.target.value),onKeyDown:n=>{n.key==="Escape"&&D()},placeholder:t("dashboard.searchPlaceholder"),"aria-label":t("dashboard.searchPlaceholder"),className:"w-full min-w-0 bg-transparent text-sm text-text-primary placeholder:text-text-muted focus:outline-none"}),k&&e.jsx("span",{className:"flex-shrink-0 text-xs text-text-muted",children:t("dashboard.searching")}),e.jsx("button",{type:"button",onClick:D,className:"ds-dash-search-close",title:t("dashboard.closeSearch"),"aria-label":t("dashboard.closeSearch"),children:e.jsx(se,{className:"h-3.5 w-3.5"})})]}):e.jsx("button",{ref:a,type:"button",onClick:()=>f(!0),className:"ds-dash-search-toggle",title:t("dashboard.searchAction"),"aria-label":t("dashboard.searchAction"),children:e.jsx(U,{className:"h-4 w-4"})})]}),e.jsx("button",{type:"button",onClick:()=>b(!0),className:"btn-ticket",children:t("dashboard.newSession")})]}),N!==null?e.jsxs("div",{className:"ds-reg",children:[N.length===0&&!k&&e.jsx("p",{className:"ds-reg-row ds-reg-empty text-sm text-text-muted",children:t("dashboard.searchNoResults")}),N.map(n=>e.jsxs("button",{type:"button",onClick:()=>c(n.session_id),className:"ds-reg-row w-full cursor-pointer",children:[e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block truncate text-sm font-medium text-text-primary",children:n.title||n.session_id}),n.snippet&&e.jsx("span",{className:"mt-1 line-clamp-2 block text-xs leading-relaxed text-text-muted",children:n.snippet})]}),e.jsx("span",{className:"whitespace-nowrap font-mono text-xs text-text-muted",children:n.match_count>0?ae("dashboard.nMatches",{n:n.match_count}):t("dashboard.nameMatch")})]},n.session_id))]}):e.jsx(he,{sessions:v,environments:o,onSelect:W,onDelete:z})]}),e.jsx(ue,{open:p,environments:o,onClose:()=>b(!1),onCreated:R})]})}export{ye as Dashboard};
6
+ */const de=[["path",{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",key:"1kt360"}]],ie=K("folder",de);function oe({teamName:c,className:x}){return c?e.jsx("span",{className:E("inline-flex items-center rounded-full border border-border/60 bg-surface-2 px-2 py-0.5 text-xs text-text-muted",x),children:c}):null}function me({environments:c,onSelectEnvironment:x}){const{activeTeam:y,isAllTeams:v}=I(),{user:i}=O(),o=r.useMemo(()=>(i==null?void 0:i.role)==="admin"||v?c:y?c.filter(l=>l.team_id===y.id):c.filter(l=>!l.team_id),[c,y,v,i]);return!o||o.length===0?e.jsx(z,{title:t("dashboard.emptyEnvironmentsTitle"),hint:t("dashboard.emptyEnvironmentsHint")}):e.jsx("div",{className:"ds-reg",children:o.map(l=>{var w,N,g;const p=l.worker_type==="acp",b=L(l.worker_type),m=((w=l.directory)==null?void 0:w.trim())||null,f=((N=l.ip_address)==null?void 0:N.trim())||null,j=((g=l.owner_username)==null?void 0:g.trim())||null;return e.jsxs("div",{className:E("ds-reg-row group",p&&"opacity-80"),children:[e.jsxs("button",{type:"button",onClick:()=>x==null?void 0:x(l),disabled:p,className:E("ds-reg-main",p?"cursor-default":"cursor-pointer"),children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"min-w-0 truncate text-sm font-medium text-text-primary",children:l.machine_name||l.id}),e.jsx("span",{className:E("ds-reg-tag rounded-full",b.colorClass),children:b.fullLabel}),e.jsx(te,{status:l.status,className:"ds-reg-tag"}),e.jsx(oe,{teamName:l.team_name??null,className:"ds-reg-tag"})]}),(m||f||j)&&e.jsxs("span",{className:"ds-reg-meta flex min-w-0 items-center gap-1.5 text-xs text-text-muted",children:[m&&e.jsx("span",{className:"min-w-0 truncate font-mono",children:m}),m&&f&&e.jsx("span",{className:"ds-reg-fact-sep","aria-hidden":"true",children:"·"}),f&&e.jsx("span",{className:"shrink-0 whitespace-nowrap font-mono tabular-nums",children:f}),(m||f)&&j&&e.jsx("span",{className:"ds-reg-fact-sep","aria-hidden":"true",children:"·"}),j&&e.jsxs("span",{className:"ds-reg-owner",title:`${t("dashboard.envOwner")}: ${j}`,children:[e.jsx(V,{className:"h-3 w-3","aria-hidden":"true"}),e.jsx("span",{className:"min-w-0 truncate",children:j})]})]})]}),e.jsx("div",{className:"ds-reg-aside",children:e.jsx("span",{className:"col-start-2 whitespace-nowrap font-mono text-xs tabular-nums text-text-muted",children:q(l.created_at)})})]},l.id)})})}function he({sessions:c,environments:x,onSelect:y,onDelete:v}){B();const{activeTeam:i,isAllTeams:o,myTeams:l}=I(),{user:p}=O(),b=r.useMemo(()=>{const s=new Map;for(const h of l)s.set(h.id,h.name);return s},[l]),m=r.useMemo(()=>(p==null?void 0:p.role)==="admin"||o?c:i?c.filter(s=>s.owner_type==="team"&&s.owner_id===i.id):c.filter(s=>s.owner_type==="user"||s.access_level==="write"||s.access_level==="read"),[c,i,o,p]),{mySessions:f,sharedSessions:j}=r.useMemo(()=>{const s=[],h=[];for(const u of m)i||o?s.push(u):u.access_level==="write"||u.access_level==="read"?h.push(u):s.push(u);return{mySessions:s,sharedSessions:h}},[m,i,o]),w=new Map;for(const s of x??[])s!=null&&s.id&&s.worker_type&&w.set(s.id,s.worker_type);const N=(s,h)=>(h.updated_at||0)-(s.updated_at||0);function g(s){var T;const h=!!v&&s.access_level!=="write"&&s.access_level!=="read";let u=s.source==="acp"?"acp":(T=s.environment)==null?void 0:T.worker_type;!u&&s.environment_id&&(u=w.get(s.environment_id));const d=L(u);return e.jsxs("div",{className:"ds-reg-row group",children:[e.jsxs("button",{type:"button",onClick:()=>y(s.id),className:"ds-reg-main cursor-pointer",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"min-w-0 truncate text-sm font-medium text-text-primary",children:s.title||s.id}),s.visibility&&e.jsx(ne,{visibility:s.visibility||"private",className:"ds-reg-tag"}),e.jsx("span",{className:E("ds-reg-tag rounded-full",d.colorClass),children:d.fullLabel})]}),e.jsxs("span",{className:"ds-reg-meta flex items-center gap-2 truncate text-xs text-text-muted",children:[e.jsx("span",{className:"truncate font-mono",children:s.id}),s.owner_type==="team"&&s.owner_id&&e.jsxs("span",{className:"inline-flex items-center gap-2 truncate",children:[e.jsx("span",{className:"text-text-muted/40",children:"|"}),e.jsx("span",{className:"truncate",children:b.get(s.owner_id)||s.owner_id})]})]})]}),e.jsxs("div",{className:"ds-reg-aside",children:[e.jsx(J,{status:s.status}),e.jsx("span",{className:"whitespace-nowrap font-mono text-xs tabular-nums text-text-muted",children:q(s.created_at||s.updated_at)}),h&&e.jsx("button",{type:"button",onClick:M=>{M.stopPropagation(),v(s.id)},className:"ds-reg-delete rounded p-1 text-text-muted opacity-0 transition-all hover:text-status-error group-hover:opacity-100 focus-visible:opacity-100",title:"Delete session",children:e.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]},s.id)}if(m.length===0)return e.jsx(z,{title:t("dashboard.emptySessionsTitle"),hint:t("dashboard.emptySessionsHint")});const k=[...f].sort(N),C=[...j].sort(N);return e.jsxs("div",{className:"space-y-4",children:[k.length>0&&e.jsx("section",{className:"space-y-2",children:e.jsx("div",{className:"ds-reg",children:k.map(g)})}),C.length>0&&e.jsxs("section",{className:"space-y-2",children:[k.length>0&&e.jsx("h3",{className:"text-xs font-medium uppercase tracking-wide text-text-muted",children:t("session.sharedWithMe")}),e.jsx("div",{className:"ds-reg",children:C.map(g)})]})]})}function ue({open:c,environments:x,onClose:y,onCreated:v}){B();const{activeTeam:i,isAllTeams:o}=I(),{user:l}=O(),[p,b]=r.useState(""),[m,f]=r.useState(""),[j,w]=r.useState("same-dir"),[N,g]=r.useState(""),[k,C]=r.useState(!1),[s,h]=r.useState(!1),u=r.useMemo(()=>(l==null?void 0:l.role)==="admin"||o?x:i?x.filter(a=>a.team_id===i.id):x.filter(a=>!a.team_id),[x,i,o,l]);r.useEffect(()=>{c&&(b(""),f(""),w("same-dir"),g(""),h(!1))},[c]);const d=u.find(a=>a.id===m)||null,T=d?u.findIndex(a=>a.id===d.id)+1:null,M=async()=>{C(!0),g("");try{const a={};p.trim()&&(a.title=p.trim()),m&&(a.environment_id=m),a.spawn_mode=j;const D=(i==null?void 0:i.id)??(o?d==null?void 0:d.team_id:void 0);D&&(a.team_id=D);const S=await X(a);v(S)}catch(a){g(a instanceof Error?a.message:t("dialog.createFailed"))}finally{C(!1)}};return e.jsx(re,{open:c,onOpenChange:a=>{a||y()},children:e.jsx(le,{className:"nsd-shell max-w-md",children:e.jsxs("div",{className:"nsd-box",children:[e.jsx(ce,{className:"nsd-h",children:t("dialog.newSession")}),e.jsxs("div",{className:"nsd-field nsd-field--env",children:[e.jsx("span",{className:"nsd-lab",children:t("dialog.environment")}),e.jsxs("button",{type:"button",className:"nsd-envtrigger","aria-expanded":s,onClick:()=>h(a=>!a),children:[e.jsx("span",{className:"nsd-env-read",children:d?e.jsxs(e.Fragment,{children:[T!==null&&e.jsxs("span",{className:"nsd-env-idx",children:["#",T]}),e.jsx("span",{className:"nsd-env-name",children:d.machine_name||d.id}),e.jsx("span",{className:E("nsd-env-type",L(d.worker_type).colorClass),children:L(d.worker_type).shortLabel})]}):e.jsx("span",{className:"nsd-env-none",children:t("dialog.envSelectEnv")})}),e.jsx(P,{className:"nsd-env-caret"})]}),(d==null?void 0:d.directory)&&e.jsx("span",{className:"nsd-env-path",children:d.directory}),s&&e.jsxs("div",{className:"nsd-envpanel",children:[e.jsx("button",{type:"button",onClick:()=>{f(""),h(!1)},className:"nsd-envrow",children:e.jsxs("span",{className:"nsd-envrow-head",children:[e.jsx("span",{className:"nsd-envrow-name",children:t("dialog.none")}),!m&&e.jsx(U,{className:"ml-auto h-3.5 w-3.5 shrink-0 text-brand-text"})]})}),u.length===0?e.jsx("p",{className:"nsd-envempty",children:t("dialog.envEmpty")}):u.map((a,D)=>{const S=L(a.worker_type),R=!!a.team_id,A=a.id===m;return e.jsxs("button",{type:"button","data-selected":A?"on":void 0,onClick:()=>{f(a.id),h(!1)},className:"nsd-envrow",children:[e.jsxs("span",{className:"nsd-envrow-head",children:[e.jsxs("span",{className:"nsd-envrow-idx",children:["#",D+1]}),e.jsx("span",{className:"nsd-envrow-name",children:a.machine_name||a.id}),e.jsx("span",{className:E("nsd-envrow-type",S.colorClass),children:S.shortLabel}),e.jsx("span",{className:E("nsd-envrow-team",R?"border-border/60 bg-surface-2 text-text-muted":"border-brand/30 bg-brand/10 text-brand-text"),children:R?`${t("dialog.envTeam")}: ${a.team_name||a.team_id}`:t("dialog.envPersonal")}),A&&e.jsx(U,{className:"ml-auto h-3.5 w-3.5 shrink-0 text-brand-text"})]}),a.directory&&e.jsxs("span",{className:"nsd-envrow-dir",children:[e.jsx(ie,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{className:"nsd-envrow-path",children:a.directory}),a.branch&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-text-muted/40",children:"·"}),e.jsx("span",{className:"nsd-envrow-path",children:a.branch})]})]})]},a.id)})]})]}),e.jsxs("label",{className:"nsd-field",children:[e.jsx("span",{className:"nsd-lab",children:t("dialog.titleOptional")}),e.jsx("input",{type:"text",value:p,onChange:a=>b(a.target.value),placeholder:t("dialog.titlePlaceholder"),className:"nsd-title"})]}),e.jsxs("label",{className:"nsd-field",children:[e.jsx("span",{className:"nsd-lab",children:t("dialog.workspaceMode")}),e.jsxs("span",{className:"nsd-modesel",children:[e.jsxs("select",{value:j,onChange:a=>w(a.target.value),className:"nsd-mode",children:[e.jsx("option",{value:"same-dir",children:t("dialog.sameDir")}),e.jsx("option",{value:"worktree",children:t("dialog.worktree")})]}),e.jsx(P,{className:"nsd-mode-caret"})]})]}),N&&e.jsx("p",{className:"nsd-error",children:N}),e.jsxs("div",{className:"nsd-foot",children:[e.jsx("button",{type:"button",onClick:y,className:"nsd-cancel",children:t("common.cancel")}),e.jsx("button",{type:"button",onClick:M,disabled:k,className:"btn-ticket nsd-create",children:k?t("common.creating"):t("common.create")})]})]})})})}function ye({onNavigateSession:c}){const x=B(),y=r.useMemo(()=>new Date().toLocaleDateString(x==="zh"?"zh-CN":"en-US",{year:"numeric",month:"long",day:"numeric",weekday:"short"}),[x]),[v,i]=r.useState([]),[o,l]=r.useState([]),[p,b]=r.useState(!1),[m,f]=r.useState(!1),[j,w]=r.useState(""),[N,g]=r.useState(null),[k,C]=r.useState(!1),s=r.useRef(0),[h,u]=r.useState(!1),d=m||h,T=r.useCallback(()=>{f(!1),w(""),u(!0)},[]),M=r.useCallback(()=>{u(!1)},[]),a=r.useRef(null),D=r.useRef(!1);r.useEffect(()=>{var n;D.current&&!d&&((n=a.current)==null||n.focus()),D.current=d},[d]),r.useEffect(()=>{const n=j.trim();if(!n){s.current+=1,g(null),C(!1);return}C(!0);const _=++s.current,F=setTimeout(()=>{Z(n).then(W=>{s.current===_&&g(W.results??[])}).catch(()=>{s.current===_&&g([])}).finally(()=>{s.current===_&&C(!1)})},300);return()=>clearTimeout(F)},[j]);const S=r.useCallback(async()=>{try{const[n,_]=await Promise.all([G(),Y()]);i(n||[]),l(_||[])}catch(n){console.error("Dashboard render error:",n)}},[]);r.useEffect(()=>{S();const n=setInterval(S,5e3);return window.addEventListener("focus",S),()=>{clearInterval(n),window.removeEventListener("focus",S)}},[S]);const R=n=>{b(!1),c(n.id)},A=r.useCallback(n=>{},[]),H=r.useCallback(n=>{c(n)},[c]),Q=r.useCallback(async n=>{if(window.confirm(t("dashboard.confirmDelete").replace("{id}",n)))try{await ee(n),i(_=>_.filter(F=>F.id!==n))}catch(_){alert(_ instanceof Error?_.message:t("dashboard.deleteFailed"))}},[]);return e.jsxs("div",{className:"ds-dash",children:[e.jsxs("header",{className:"ds-dash-bar hero-enter",children:[e.jsx("span",{className:"ds-dash-dateline",children:y}),e.jsxs("div",{className:"ds-dash-titlerow",children:[e.jsx("h1",{className:"ds-dash-title font-display font-semibold tracking-tight text-text-primary",children:t("dashboard.title")}),e.jsxs("div",{className:"ds-dash-counts",children:[e.jsxs("span",{children:[v.length," ",t("dashboard.sessions")]}),e.jsxs("span",{children:[o.length," ",t("dashboard.environments")]})]})]})]}),e.jsxs("section",{className:"ds-dash-row",children:[e.jsx("h2",{className:"font-display text-lg font-semibold text-text-primary",children:t("dashboard.environments")}),e.jsx(me,{environments:o,onSelectEnvironment:A})]}),e.jsxs("section",{className:"ds-dash-row",children:[e.jsxs("div",{className:"ds-dash-rowhead",children:[e.jsxs("div",{className:"ds-dash-rowlabel",children:[e.jsx("h2",{className:"font-display text-lg font-semibold text-text-primary",children:t("dashboard.sessions")}),d?e.jsxs("div",{className:E("ds-dash-search",h&&"ds-dash-search--folding"),onAnimationEnd:M,children:[e.jsx($,{className:"h-4 w-4 flex-shrink-0 text-text-muted","aria-hidden":"true"}),e.jsx("input",{autoFocus:!0,value:j,onChange:n=>w(n.target.value),onKeyDown:n=>{n.key==="Escape"&&T()},placeholder:t("dashboard.searchPlaceholder"),"aria-label":t("dashboard.searchPlaceholder"),className:"w-full min-w-0 bg-transparent text-sm text-text-primary placeholder:text-text-muted focus:outline-none"}),k&&e.jsx("span",{className:"flex-shrink-0 text-xs text-text-muted",children:t("dashboard.searching")}),e.jsx("button",{type:"button",onClick:T,className:"ds-dash-search-close",title:t("dashboard.closeSearch"),"aria-label":t("dashboard.closeSearch"),children:e.jsx(se,{className:"h-3.5 w-3.5"})})]}):e.jsx("button",{ref:a,type:"button",onClick:()=>f(!0),className:"ds-dash-search-toggle",title:t("dashboard.searchAction"),"aria-label":t("dashboard.searchAction"),children:e.jsx($,{className:"h-4 w-4"})})]}),e.jsx("button",{type:"button",onClick:()=>b(!0),className:"btn-ticket",children:t("dashboard.newSession")})]}),N!==null?e.jsxs("div",{className:"ds-reg",children:[N.length===0&&!k&&e.jsx("p",{className:"ds-reg-row ds-reg-empty text-sm text-text-muted",children:t("dashboard.searchNoResults")}),N.map(n=>e.jsxs("button",{type:"button",onClick:()=>c(n.session_id),className:"ds-reg-row w-full cursor-pointer",children:[e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block truncate text-sm font-medium text-text-primary",children:n.title||n.session_id}),n.snippet&&e.jsx("span",{className:"mt-1 line-clamp-2 block text-xs leading-relaxed text-text-muted",children:n.snippet})]}),e.jsx("span",{className:"whitespace-nowrap font-mono text-xs text-text-muted",children:n.match_count>0?ae("dashboard.nMatches",{n:n.match_count}):t("dashboard.nameMatch")})]},n.session_id))]}):e.jsx(he,{sessions:v,environments:o,onSelect:H,onDelete:Q})]}),e.jsx(ue,{open:p,environments:o,onClose:()=>b(!1),onCreated:R})]})}export{ye as Dashboard};
@@ -1 +1 @@
1
- import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{aK as v,c as N,aD as t}from"./main-BopVSHhX.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function P({onSuccess:h,onInvalidInvite:i}){const{join:b}=v(),[l,f]=r.useState(""),[u,w]=r.useState(""),[o,j]=r.useState(""),[c,g]=r.useState(""),[m,n]=r.useState(""),[x,p]=r.useState(!1);r.useEffect(()=>{const a=new URLSearchParams(window.location.search).get("invite");a?f(a):i()},[i]);const y=async s=>{if(s.preventDefault(),n(""),o.length<8){n(t("auth.setup.passwordTooShort"));return}if(o!==c){n(t("auth.setup.passwordMismatch"));return}p(!0);try{await b(l,u,o),h()}catch(a){const d=a instanceof Error?a.message:"Join failed";if(d.includes("Invalid invitation")||d.includes("expired")||d.includes("already used")){i();return}n(d)}finally{p(!1)}};return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface-0 px-4",children:e.jsxs("div",{className:"hero-enter w-full max-w-sm space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx(N,{className:"mx-auto mb-5 h-10 w-10"}),e.jsx("h1",{className:"font-display text-3xl font-semibold tracking-tight text-text-primary",children:t("auth.join.title")}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:t("auth.join.welcome")}),e.jsx("p",{className:"mt-1 text-sm text-text-muted",children:t("auth.join.description")})]}),e.jsxs("form",{onSubmit:y,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.join.username")}),e.jsx("input",{type:"text",value:u,onChange:s=>w(s.target.value),required:!0,autoComplete:"username",autoFocus:!0,className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.join.password")}),e.jsx("input",{type:"password",value:o,onChange:s=>j(s.target.value),required:!0,autoComplete:"new-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.join.confirmPassword")}),e.jsx("input",{type:"password",value:c,onChange:s=>g(s.target.value),required:!0,autoComplete:"new-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),m&&e.jsx("p",{className:"text-sm text-status-error",children:m}),e.jsx("button",{type:"submit",disabled:x||!l,className:"w-full rounded-lg bg-brand px-4 py-2.5 font-display text-sm font-medium text-white shadow-lg shadow-brand/25 transition-all hover:-translate-y-0.5 hover:bg-brand-light hover:shadow-brand/40 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:translate-y-0 disabled:hover:shadow-none",children:x?t("common.loading"):t("auth.join.submit")})]})]})})}export{P as Join};
1
+ import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{aQ as v,c as N,aJ as t}from"./main-BKbA2ddo.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function P({onSuccess:h,onInvalidInvite:i}){const{join:b}=v(),[l,f]=r.useState(""),[u,w]=r.useState(""),[o,j]=r.useState(""),[c,g]=r.useState(""),[m,n]=r.useState(""),[x,p]=r.useState(!1);r.useEffect(()=>{const a=new URLSearchParams(window.location.search).get("invite");a?f(a):i()},[i]);const y=async s=>{if(s.preventDefault(),n(""),o.length<8){n(t("auth.setup.passwordTooShort"));return}if(o!==c){n(t("auth.setup.passwordMismatch"));return}p(!0);try{await b(l,u,o),h()}catch(a){const d=a instanceof Error?a.message:"Join failed";if(d.includes("Invalid invitation")||d.includes("expired")||d.includes("already used")){i();return}n(d)}finally{p(!1)}};return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface-0 px-4",children:e.jsxs("div",{className:"hero-enter w-full max-w-sm space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx(N,{className:"mx-auto mb-5 h-10 w-10"}),e.jsx("h1",{className:"font-display text-3xl font-semibold tracking-tight text-text-primary",children:t("auth.join.title")}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:t("auth.join.welcome")}),e.jsx("p",{className:"mt-1 text-sm text-text-muted",children:t("auth.join.description")})]}),e.jsxs("form",{onSubmit:y,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.join.username")}),e.jsx("input",{type:"text",value:u,onChange:s=>w(s.target.value),required:!0,autoComplete:"username",autoFocus:!0,className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.join.password")}),e.jsx("input",{type:"password",value:o,onChange:s=>j(s.target.value),required:!0,autoComplete:"new-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.join.confirmPassword")}),e.jsx("input",{type:"password",value:c,onChange:s=>g(s.target.value),required:!0,autoComplete:"new-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),m&&e.jsx("p",{className:"text-sm text-status-error",children:m}),e.jsx("button",{type:"submit",disabled:x||!l,className:"w-full rounded-lg bg-brand px-4 py-2.5 font-display text-sm font-medium text-white shadow-lg shadow-brand/25 transition-all hover:-translate-y-0.5 hover:bg-brand-light hover:shadow-brand/40 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:translate-y-0 disabled:hover:shadow-none",children:x?t("common.loading"):t("auth.join.submit")})]})]})})}export{P as Join};
@@ -1 +1 @@
1
- import{e as n,j as e}from"./vendor-DE_-CLIE.js";import{aD as t,aE as y,aK as j,c as w}from"./main-BopVSHhX.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function v(r){if(!(r instanceof Error))return t("auth.login.failed");if(r instanceof TypeError)return t("auth.login.unreachable");const s=r.message;return/failed to fetch|network|load failed/i.test(s)?t("auth.login.unreachable"):/csrf/i.test(s)?t("auth.login.csrfBlocked"):/too many/i.test(s)?t("auth.login.rateLimited"):/invalid credentials/i.test(s)?t("auth.login.failed"):!s||/^login failed$/i.test(s)?t("auth.login.failed"):y("auth.login.failedWithReason",{message:s})}function C({onSuccess:r,onNavigateRegister:s}){const{login:m,registrationAllowed:x,singleUserMode:h}=j(),[o,f]=n.useState(""),[i,b]=n.useState(""),[l,d]=n.useState(""),[u,c]=n.useState(!1),g=async a=>{a.preventDefault(),d(""),c(!0);try{await m(o,i),r()}catch(p){d(v(p))}finally{c(!1)}};return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface-0 px-4",children:e.jsxs("div",{className:"hero-enter w-full max-w-sm space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx(w,{className:"mx-auto mb-5 h-10 w-10"}),e.jsx("h1",{className:"font-display text-3xl font-semibold tracking-tight text-text-primary",children:t("auth.login.title")}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:t("auth.login.description")})]}),e.jsxs("form",{onSubmit:g,className:"space-y-4",children:[h&&e.jsxs("div",{className:"rounded-lg border border-border bg-surface-2 px-3 py-2 text-xs text-text-secondary",children:[e.jsx("p",{children:t("auth.login.singleUserHint")}),e.jsx("p",{className:"mt-1 font-mono text-text-primary",children:"admin / admin123"}),e.jsx("p",{className:"mt-1 text-text-muted",children:t("auth.login.singleUserHintFooter")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.login.username")}),e.jsx("input",{type:"text",value:o,onChange:a=>f(a.target.value),required:!0,autoComplete:"username",autoFocus:!0,className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.login.password")}),e.jsx("input",{type:"password",value:i,onChange:a=>b(a.target.value),required:!0,autoComplete:"current-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),l&&e.jsx("p",{className:"text-sm text-status-error",children:l}),e.jsx("button",{type:"submit",disabled:u,className:"w-full rounded-lg bg-brand px-4 py-2.5 font-display text-sm font-medium text-white shadow-lg shadow-brand/25 transition-all hover:-translate-y-0.5 hover:bg-brand-light hover:shadow-brand/40 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:translate-y-0 disabled:hover:shadow-none",children:u?t("common.loading"):t("auth.login.submit")})]}),x&&e.jsx("button",{type:"button",onClick:s,className:"w-full text-center text-sm text-text-muted hover:text-text-primary transition-colors",children:t("auth.login.register")})]})})}export{C as Login};
1
+ import{e as n,j as e}from"./vendor-DE_-CLIE.js";import{aJ as t,aK as y,aQ as j,c as w}from"./main-BKbA2ddo.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function v(r){if(!(r instanceof Error))return t("auth.login.failed");if(r instanceof TypeError)return t("auth.login.unreachable");const s=r.message;return/failed to fetch|network|load failed/i.test(s)?t("auth.login.unreachable"):/csrf/i.test(s)?t("auth.login.csrfBlocked"):/too many/i.test(s)?t("auth.login.rateLimited"):/invalid credentials/i.test(s)?t("auth.login.failed"):!s||/^login failed$/i.test(s)?t("auth.login.failed"):y("auth.login.failedWithReason",{message:s})}function C({onSuccess:r,onNavigateRegister:s}){const{login:m,registrationAllowed:x,singleUserMode:h}=j(),[o,f]=n.useState(""),[i,b]=n.useState(""),[l,d]=n.useState(""),[u,c]=n.useState(!1),g=async a=>{a.preventDefault(),d(""),c(!0);try{await m(o,i),r()}catch(p){d(v(p))}finally{c(!1)}};return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface-0 px-4",children:e.jsxs("div",{className:"hero-enter w-full max-w-sm space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx(w,{className:"mx-auto mb-5 h-10 w-10"}),e.jsx("h1",{className:"font-display text-3xl font-semibold tracking-tight text-text-primary",children:t("auth.login.title")}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:t("auth.login.description")})]}),e.jsxs("form",{onSubmit:g,className:"space-y-4",children:[h&&e.jsxs("div",{className:"rounded-lg border border-border bg-surface-2 px-3 py-2 text-xs text-text-secondary",children:[e.jsx("p",{children:t("auth.login.singleUserHint")}),e.jsx("p",{className:"mt-1 font-mono text-text-primary",children:"admin / admin123"}),e.jsx("p",{className:"mt-1 text-text-muted",children:t("auth.login.singleUserHintFooter")})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.login.username")}),e.jsx("input",{type:"text",value:o,onChange:a=>f(a.target.value),required:!0,autoComplete:"username",autoFocus:!0,className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.login.password")}),e.jsx("input",{type:"password",value:i,onChange:a=>b(a.target.value),required:!0,autoComplete:"current-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),l&&e.jsx("p",{className:"text-sm text-status-error",children:l}),e.jsx("button",{type:"submit",disabled:u,className:"w-full rounded-lg bg-brand px-4 py-2.5 font-display text-sm font-medium text-white shadow-lg shadow-brand/25 transition-all hover:-translate-y-0.5 hover:bg-brand-light hover:shadow-brand/40 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:translate-y-0 disabled:hover:shadow-none",children:u?t("common.loading"):t("auth.login.submit")})]}),x&&e.jsx("button",{type:"button",onClick:s,className:"w-full text-center text-sm text-text-muted hover:text-text-primary transition-colors",children:t("auth.login.register")})]})})}export{C as Login};
@@ -0,0 +1 @@
1
+ import{e as a,j as e}from"./vendor-DE_-CLIE.js";import{aR as P,aS as R,a9 as q,aJ as t,a3 as G,B as H,V as L,U as J,i as V,P as z,N as K,t as Q,aa as W,ar as X,$ as Z,ah as ee}from"./main-BKbA2ddo.js";import{D as $,a as B,c as U,d as A,b as Y}from"./dialog-DKk230y5.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";const te=["user","feedback","project","reference"];function se(o){if(!o)return"—";try{return new Date(o).toLocaleString()}catch{return o}}function re(o){switch(o){case"user":return"bg-accent/15 text-accent";case"feedback":return"bg-status-warning/15 text-status-warning";case"project":return"bg-status-active/15 text-status-active";case"reference":return"bg-surface-3 text-text-muted"}}function le({sessionId:o,embedded:g=!1,refreshTick:w}){P();const[i,p]=a.useState([]),[d,h]=a.useState(!0),[x,f]=a.useState(""),[l,m]=a.useState(!1),[n,u]=a.useState(null),[j,v]=a.useState(null),{activeTeam:N,isAllTeams:k,myTeams:C}=R(),c=a.useCallback(async()=>{try{const s=await q(o?{session_id:o}:k?void 0:N?{team_id:N.id}:g?void 0:{scope:"personal"});p(s||[]),f("")}catch(s){f(s instanceof Error?s.message:t("memories.loadFailed"))}finally{h(!1)}},[o,N,k,g]);a.useEffect(()=>{c();const s=setInterval(c,15e3);return window.addEventListener("focus",c),()=>{clearInterval(s),window.removeEventListener("focus",c)}},[c]);const y=a.useRef(!1);a.useEffect(()=>{if(!y.current){y.current=!0;return}c()},[w,c]);const S=a.useCallback(s=>{m(!1),u(null),p(b=>[s,...b.filter(D=>D.id!==s.id)])},[]),E=a.useCallback(async s=>{u(s),m(!0)},[]),F=a.useCallback(()=>{m(!1),u(null)},[]),_=a.useCallback(async s=>{if(window.confirm(t("memories.delete")+" — "+s.slice(0,8)+"…?"))try{await G(s),p(b=>b.filter(D=>D.id!==s))}catch(b){alert(b instanceof Error?b.message:t("memories.deleteFailed"))}},[]),r=a.useCallback(()=>{v(null),c()},[c]),T=a.useMemo(()=>i,[i]),M=e.jsxs(e.Fragment,{children:[x&&e.jsx("p",{className:"text-status-error text-sm",children:x}),d?e.jsx("div",{className:"space-y-3",children:[0,1,2].map(s=>e.jsx("div",{className:"h-20 animate-pulse rounded-lg bg-surface-2"},s))}):T.length===0?e.jsxs("div",{className:"rounded-lg border border-dashed border-border py-12 text-center",children:[e.jsx(H,{className:"mx-auto h-8 w-8 text-text-muted/40"}),e.jsx("p",{className:"mt-3 text-sm text-text-muted",children:t("memories.empty")})]}):e.jsx("ul",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3",children:T.map(s=>{var b;return e.jsxs("li",{className:"group rounded-lg border border-border bg-surface-1 p-4 transition-colors hover:border-brand/50",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h3",{className:"truncate font-medium text-text-primary group-hover:text-accent",children:s.name}),e.jsx("p",{className:"mt-1 line-clamp-2 text-xs text-text-muted",children:s.description||((b=s.content)==null?void 0:b.slice(0,120))||"—"})]}),e.jsxs("div",{className:"flex flex-shrink-0 flex-col items-end gap-1",children:[e.jsx("span",{className:`rounded-full px-2 py-0.5 text-[10px] font-medium ${re(s.type)}`,children:t(`memories.type.${s.type}`)}),e.jsx("span",{className:"inline-flex items-center gap-1 rounded-full bg-surface-3 px-2 py-0.5 text-[10px] font-medium text-text-muted",title:s.scope_kind==="team"?t("memories.scope.team"):t("memories.scope.personal"),children:s.scope_kind==="team"?e.jsxs(e.Fragment,{children:[e.jsx(L,{className:"h-3 w-3"}),t("memories.scope.team")]}):e.jsxs(e.Fragment,{children:[e.jsx(J,{className:"h-3 w-3"}),t("memories.scope.personal")]})})]})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-3 text-xs text-text-muted",children:[s.source_session_id&&e.jsxs("a",{href:`/code/${s.source_session_id}`,className:"truncate text-text-muted hover:text-accent",title:s.source_session_id,children:[t("memories.session"),": ",s.source_session_id.slice(0,14),"…"]}),e.jsxs("span",{className:"flex items-center gap-1",title:t("memories.updatedAt"),children:[e.jsx(V,{className:"h-3 w-3"}),se(s.updated_at)]}),e.jsxs("span",{children:["v",s.version]})]}),e.jsx("div",{className:"mt-3 flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:s.can_manage&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>void E(s),className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:t("memories.edit"),children:e.jsx(z,{className:"h-3.5 w-3.5"})}),s.scope_kind==="personal"&&e.jsx("button",{type:"button",onClick:()=>v(s),className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-surface-2 hover:text-text-primary",title:t("memories.promote"),children:e.jsx(L,{className:"h-3.5 w-3.5"})}),e.jsx("button",{type:"button",onClick:()=>_(s.id),className:"ml-auto inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-status-error/10 hover:text-status-error",title:t("memories.delete"),children:e.jsx(K,{className:"h-3.5 w-3.5"})})]})})]},s.id)})})]});return g?e.jsxs("div",{children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"text-sm font-medium text-text-primary",children:t("memories.title")}),e.jsxs("button",{type:"button",onClick:()=>{u(null),m(!0)},className:"inline-flex items-center gap-1 rounded-md bg-accent px-3 py-1.5 text-sm font-medium text-white hover:bg-accent/90",children:[e.jsx(Q,{className:"h-4 w-4"}),t("memories.new")]})]}),M,e.jsx(I,{open:l,onClose:F,onSaved:S,editMemory:n}),e.jsx(O,{memory:j,teams:C,onClose:()=>v(null),onPromoted:r})]}):e.jsxs("div",{className:"ds-page",children:[e.jsxs("header",{className:"ds-page-head",children:[e.jsxs("div",{className:"ds-page-titlerow",children:[e.jsx("h1",{className:"ds-page-title font-display font-semibold tracking-tight text-text-primary",children:t("memories.title")}),e.jsx("button",{type:"button",onClick:()=>{u(null),m(!0)},className:"btn-ticket",children:t("memories.new")})]}),e.jsx("p",{className:"ds-page-sub",children:t("memories.subtitle")})]}),M,e.jsx(I,{open:l,onClose:F,onSaved:S,editMemory:n}),e.jsx(O,{memory:j,teams:C,onClose:()=>v(null),onPromoted:r})]})}function I({open:o,onClose:g,onSaved:w,editMemory:i}){P();const{myTeams:p}=R(),d=!!i,[h,x]=a.useState(""),[f,l]=a.useState(""),[m,n]=a.useState("project"),[u,j]=a.useState(""),[v,N]=a.useState(""),[k,C]=a.useState(!1),[c,y]=a.useState(""),[S,E]=a.useState(!1);a.useEffect(()=>{o&&(C(!1),y(""),i?(E(!0),x(i.name),l(i.description??""),n(i.type),j(""),N(i.team_id??""),W(i.id).then(r=>{j(r.content??""),r.can_manage===!1&&y(t("memories.updateFailed"))}).catch(()=>y(t("memories.loadFailed"))).finally(()=>E(!1))):(E(!1),x(""),l(""),n("project"),j(""),N("")))},[o,i]);const F=h.trim().length>0&&u.trim().length>0&&!k&&!S,_=async()=>{C(!0),y("");try{const r=d?await X(i.id,{name:h.trim(),description:f.trim()||void 0,type:m,content:u}):await Z({name:h.trim(),description:f.trim()||void 0,type:m,content:u,team_id:v||void 0});w(r)}catch(r){y(r instanceof Error?r.message:t(d?"memories.updateFailed":"memories.create.failed"))}finally{C(!1)}};return e.jsx($,{open:o,onOpenChange:r=>r?void 0:g(),children:e.jsxs(B,{className:"max-h-[85vh] overflow-y-auto sm:max-w-2xl",children:[e.jsx(U,{children:e.jsx(A,{children:d?t("memories.editMemory"):t("memories.create.title")})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"memory-name",children:t("memories.create.name")}),e.jsx("input",{id:"memory-name",type:"text",value:h,onChange:r=>x(r.target.value),placeholder:t("memories.create.namePlaceholder"),className:"w-full rounded-md border border-border bg-surface-1 px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"memory-description",children:t("memories.create.description")}),e.jsx("input",{id:"memory-description",type:"text",value:f,onChange:r=>l(r.target.value),placeholder:t("memories.create.descriptionPlaceholder"),className:"w-full rounded-md border border-border bg-surface-1 px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none"})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"memory-type",children:t("memories.create.type")}),e.jsx("select",{id:"memory-type",value:m,onChange:r=>n(r.target.value),className:"w-full rounded-md border border-border bg-surface-1 px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none",children:te.map(r=>e.jsx("option",{value:r,children:t(`memories.type.${r}`)},r))})]}),!d&&e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"memory-scope",children:t("memories.create.scope")}),e.jsxs("select",{id:"memory-scope",value:v,onChange:r=>N(r.target.value),className:"w-full rounded-md border border-border bg-surface-1 px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none",children:[e.jsx("option",{value:"",children:t("memories.create.scope.personal")}),p.map(r=>e.jsx("option",{value:r.id,children:r.name},r.id))]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"memory-content",children:t("memories.create.content")}),e.jsx("textarea",{id:"memory-content",value:u,onChange:r=>j(r.target.value),placeholder:t("memories.create.contentPlaceholder"),rows:10,spellCheck:!1,disabled:S,className:"w-full rounded-md border border-border bg-surface-1 px-3 py-2 font-mono text-xs text-text-primary focus:border-accent focus:outline-none disabled:opacity-50"})]}),c&&e.jsx("p",{className:"text-sm text-status-error",children:c})]}),e.jsxs(Y,{children:[e.jsx("button",{type:"button",onClick:g,className:"rounded-md border border-border px-4 py-2 text-sm text-text-secondary hover:bg-surface-2",children:t("common.cancel")}),e.jsx("button",{type:"button",onClick:_,disabled:!F,className:"rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent/90 disabled:opacity-50",children:k?t("common.creating"):d?t("memories.update"):t("memories.create.title")})]})]})})}function O({memory:o,teams:g,onClose:w,onPromoted:i}){P();const[p,d]=a.useState(""),[h,x]=a.useState(!1),[f,l]=a.useState("");if(a.useEffect(()=>{d(""),l(""),x(!1)},[o]),!o)return null;const m=async()=>{if(!p){l(t("memories.promoteTeamRequired"));return}x(!0),l("");try{const n=await ee(o.id,p);i(n)}catch(n){l(n instanceof Error?n.message:t("memories.promoteFailed"))}finally{x(!1)}};return e.jsx($,{open:!!o,onOpenChange:n=>n?void 0:w(),children:e.jsxs(B,{className:"sm:max-w-md",children:[e.jsx(U,{children:e.jsx(A,{children:t("memories.promote")})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-text-muted",children:o.name}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-primary",htmlFor:"promote-team",children:t("memories.scope.team")}),e.jsxs("select",{id:"promote-team",value:p,onChange:n=>d(n.target.value),className:"w-full rounded-md border border-border bg-surface-1 px-3 py-2 text-sm text-text-primary focus:border-accent focus:outline-none",children:[e.jsx("option",{value:"",children:"—"}),g.map(n=>e.jsx("option",{value:n.id,children:n.name},n.id))]})]}),f&&e.jsx("p",{className:"text-sm text-status-error",children:f})]}),e.jsxs(Y,{children:[e.jsx("button",{type:"button",onClick:w,className:"rounded-md border border-border px-4 py-2 text-sm text-text-secondary hover:bg-surface-2",children:t("common.cancel")}),e.jsx("button",{type:"button",onClick:m,disabled:h,className:"rounded-md bg-accent px-4 py-2 text-sm font-medium text-white hover:bg-accent/90 disabled:opacity-50",children:h?t("common.creating"):t("memories.promote")})]})]})})}export{le as MemoriesGallery};
@@ -1 +1 @@
1
- import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{aK as w,c as y,aD as t}from"./main-BopVSHhX.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function C({onSuccess:m,onBack:x}){const{register:h}=w(),[n,p]=r.useState(""),[a,b]=r.useState(""),[l,f]=r.useState(""),[d,o]=r.useState(""),[i,u]=r.useState(!1),g=async s=>{if(s.preventDefault(),o(""),a.length<8){o(t("auth.setup.passwordTooShort"));return}if(a!==l){o(t("auth.setup.passwordMismatch"));return}u(!0);try{await h(n,a),m()}catch(c){o(c instanceof Error?c.message:t("auth.register.failed"))}finally{u(!1)}};return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface-0 px-4",children:e.jsxs("div",{className:"hero-enter w-full max-w-sm space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx(y,{className:"mx-auto mb-5 h-10 w-10"}),e.jsx("h1",{className:"font-display text-3xl font-semibold tracking-tight text-text-primary",children:t("auth.register.title")}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:t("auth.register.description")})]}),e.jsxs("form",{onSubmit:g,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.login.username")}),e.jsx("input",{type:"text",value:n,onChange:s=>p(s.target.value),required:!0,autoComplete:"username",autoFocus:!0,className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.login.password")}),e.jsx("input",{type:"password",value:a,onChange:s=>b(s.target.value),required:!0,autoComplete:"new-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.join.confirmPassword")}),e.jsx("input",{type:"password",value:l,onChange:s=>f(s.target.value),required:!0,autoComplete:"new-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),d&&e.jsx("p",{className:"text-sm text-status-error",children:d}),e.jsx("button",{type:"submit",disabled:i,className:"w-full rounded-lg bg-brand px-4 py-2.5 font-display text-sm font-medium text-white shadow-lg shadow-brand/25 transition-all hover:-translate-y-0.5 hover:bg-brand-light hover:shadow-brand/40 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:translate-y-0 disabled:hover:shadow-none",children:i?t("common.loading"):t("auth.register.submit")})]}),e.jsx("button",{type:"button",onClick:x,className:"w-full text-center text-sm text-text-muted hover:text-text-primary transition-colors",children:t("auth.register.backToLogin")})]})})}export{C as Register};
1
+ import{e as r,j as e}from"./vendor-DE_-CLIE.js";import{aQ as w,c as y,aJ as t}from"./main-BKbA2ddo.js";import"./preload-helper-BiaRt2Oj.js";import"./motion-BILbV7YQ.js";function C({onSuccess:m,onBack:x}){const{register:h}=w(),[n,p]=r.useState(""),[a,b]=r.useState(""),[l,f]=r.useState(""),[d,o]=r.useState(""),[i,u]=r.useState(!1),g=async s=>{if(s.preventDefault(),o(""),a.length<8){o(t("auth.setup.passwordTooShort"));return}if(a!==l){o(t("auth.setup.passwordMismatch"));return}u(!0);try{await h(n,a),m()}catch(c){o(c instanceof Error?c.message:t("auth.register.failed"))}finally{u(!1)}};return e.jsx("div",{className:"flex min-h-screen items-center justify-center bg-surface-0 px-4",children:e.jsxs("div",{className:"hero-enter w-full max-w-sm space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx(y,{className:"mx-auto mb-5 h-10 w-10"}),e.jsx("h1",{className:"font-display text-3xl font-semibold tracking-tight text-text-primary",children:t("auth.register.title")}),e.jsx("p",{className:"mt-2 text-sm text-text-muted",children:t("auth.register.description")})]}),e.jsxs("form",{onSubmit:g,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.login.username")}),e.jsx("input",{type:"text",value:n,onChange:s=>p(s.target.value),required:!0,autoComplete:"username",autoFocus:!0,className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.login.password")}),e.jsx("input",{type:"password",value:a,onChange:s=>b(s.target.value),required:!0,autoComplete:"new-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-text-secondary",children:t("auth.join.confirmPassword")}),e.jsx("input",{type:"password",value:l,onChange:s=>f(s.target.value),required:!0,autoComplete:"new-password",className:"w-full rounded-lg border border-border bg-surface-2 px-3 py-2 text-sm text-text-primary placeholder:text-text-muted focus:border-brand focus:outline-none"})]}),d&&e.jsx("p",{className:"text-sm text-status-error",children:d}),e.jsx("button",{type:"submit",disabled:i,className:"w-full rounded-lg bg-brand px-4 py-2.5 font-display text-sm font-medium text-white shadow-lg shadow-brand/25 transition-all hover:-translate-y-0.5 hover:bg-brand-light hover:shadow-brand/40 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:translate-y-0 disabled:hover:shadow-none",children:i?t("common.loading"):t("auth.register.submit")})]}),e.jsx("button",{type:"button",onClick:x,className:"w-full text-center text-sm text-text-muted hover:text-text-primary transition-colors",children:t("auth.register.backToLogin")})]})})}export{C as Register};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./vendor-DE_-CLIE.js";import{ap as a,i as d,h as l,an as p,aD as h}from"./main-BopVSHhX.js";import{A as y}from"./workerType-BF4aY_R_.js";/**
1
+ import{j as e}from"./vendor-DE_-CLIE.js";import{av as a,i as d,h as l,at as p,aJ as h}from"./main-BKbA2ddo.js";import{A as y}from"./workerType-DW9l12WG.js";/**
2
2
  * @license lucide-react v0.555.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -23,4 +23,4 @@ import{j as e}from"./vendor-DE_-CLIE.js";import{ap as a,i as d,h as l,an as p,aD
23
23
  *
24
24
  * This source code is licensed under the ISC license.
25
25
  * See the LICENSE file in the root directory of this source tree.
26
- */const g=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],j=a("wifi",g),v={running:{label:"running",Icon:y},active:{label:"active",Icon:j},idle:{label:"idle",Icon:d},disconnected:{label:"disconnected",Icon:i},offline:{label:"offline",Icon:i},inactive:{label:"inactive",Icon:s},archived:{label:"archived",Icon:s},error:{label:"error",Icon:x,tone:"text-status-error border-status-error/40"},requires_action:{label:"requires_action",Icon:u,tone:"text-status-warning border-status-warning/40"}};function w({status:t,className:n}){const{label:r,Icon:c,tone:o}=v[t]??{label:t,Icon:l,tone:void 0};return e.jsxs("span",{className:p("inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-xs",o??"text-text-muted border-border/60",n),title:r,children:[e.jsx(c,{className:"h-3 w-3","aria-hidden":"true"}),r]})}function I({title:t,hint:n}){return e.jsx("div",{className:"ds-reg",children:e.jsxs("div",{className:"ds-reg-row ds-reg-empty",children:[e.jsxs("span",{className:"ds-reg-main",children:[e.jsx("span",{className:"ds-empty-title",children:t}),e.jsx("span",{className:"ds-reg-meta ds-empty-hint",children:n})]}),e.jsx("span",{className:"ds-reg-aside",children:e.jsx("span",{className:"ds-empty-marker",children:h("dashboard.emptyMarker")})})]})})}export{w as E,I as R};
26
+ */const g=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],v=a("wifi",g),j={running:{label:"running",Icon:y},active:{label:"active",Icon:v},idle:{label:"idle",Icon:d},disconnected:{label:"disconnected",Icon:i},offline:{label:"offline",Icon:i},inactive:{label:"inactive",Icon:s},archived:{label:"archived",Icon:s},error:{label:"error",Icon:x,tone:"text-status-error border-status-error/40"},requires_action:{label:"requires_action",Icon:u,tone:"text-status-warning border-status-warning/40"}};function w({status:t,className:n}){const{label:r,Icon:c,tone:o}=j[t]??{label:t,Icon:l,tone:void 0};return e.jsxs("span",{className:p("inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-xs",o??"text-text-muted border-border/60",n),title:r,children:[e.jsx(c,{className:"h-3 w-3","aria-hidden":"true"}),r]})}function I({title:t,hint:n}){return e.jsx("div",{className:"ds-reg",children:e.jsxs("div",{className:"ds-reg-row ds-reg-empty",children:[e.jsxs("span",{className:"ds-reg-main",children:[e.jsx("span",{className:"ds-empty-title",children:t}),e.jsx("span",{className:"ds-reg-meta ds-empty-hint",children:n})]}),e.jsx("span",{className:"ds-reg-aside",children:e.jsx("span",{className:"ds-empty-marker",children:h("dashboard.emptyMarker")})})]})})}export{w as E,I as R};