dorkos 0.110.0 → 0.111.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/dist/bin/cli.js +57 -17
  2. package/dist/browser/native/package-manifest.json +1 -1
  3. package/dist/browser/source-manifest.json +1 -1
  4. package/dist/client/assets/{AboutPage-C4kqKgU6.js → AboutPage-BKzqcz_A.js} +1 -1
  5. package/dist/client/assets/{ActivityErrorState-DiSxgHLa.js → ActivityErrorState-BXOZg9ve.js} +1 -1
  6. package/dist/client/assets/{ActivityPage-BQneQ83b.js → ActivityPage-CFN2MEAV.js} +1 -1
  7. package/dist/client/assets/{ActivityRow-BEKcGUIZ.js → ActivityRow-CujXx04u.js} +1 -1
  8. package/dist/client/assets/{AdapterIcon-CyEZ9jER.js → AdapterIcon-BdM7K69W.js} +1 -1
  9. package/dist/client/assets/{AdapterSetupWizard-DpnW23lt.js → AdapterSetupWizard-3Bt9HEWF.js} +1 -1
  10. package/dist/client/assets/{AgentRequestCard-DosR0AYu.js → AgentRequestCard-CAaBGC0L.js} +1 -1
  11. package/dist/client/assets/{AppearancePage-DIeNtC-G.js → AppearancePage-BEe-Gssu.js} +1 -1
  12. package/dist/client/assets/{AttentionSignalRow-B0nSHLwZ.js → AttentionSignalRow-Cp0AJs73.js} +1 -1
  13. package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-BXMeIZyY.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-CN1iW2cB.js} +1 -1
  14. package/dist/client/assets/{BlintzCanvas-D-7b_-SG.js → BlintzCanvas-B7qs2dxW.js} +1 -1
  15. package/dist/client/assets/{CanvasCsvContent-iBvH55TS.js → CanvasCsvContent-DiB5zXOC.js} +1 -1
  16. package/dist/client/assets/{CanvasFileContent-C4LA1NRl.js → CanvasFileContent-CDNfnWMW.js} +2 -2
  17. package/dist/client/assets/{CanvasModel3dContent-BqLPKItZ.js → CanvasModel3dContent-C7EINmuq.js} +2 -2
  18. package/dist/client/assets/{CodeMirrorDiff-BfF4jWmG.js → CodeMirrorDiff-BJhflpbC.js} +1 -1
  19. package/dist/client/assets/{CodeMirrorEditor-gShkyo4u.js → CodeMirrorEditor-SkdXRKSN.js} +1 -1
  20. package/dist/client/assets/{CommitmentList-Bz1qfyAm.js → CommitmentList-DsEn6iK1.js} +1 -1
  21. package/dist/client/assets/{CommitmentsPage-BFnrzM5F.js → CommitmentsPage-W5h0GjRr.js} +1 -1
  22. package/dist/client/assets/{ConnectionAccessLists-C5dmaUUD.js → ConnectionAccessLists-DVFqelmV.js} +1 -1
  23. package/dist/client/assets/{ConnectionsPage-BX_hUzvu.js → ConnectionsPage-CZhSh2mO.js} +1 -1
  24. package/dist/client/assets/{ConventionPage-DHtiOJYZ.js → ConventionPage-DcDBP-vR.js} +1 -1
  25. package/dist/client/assets/{ExtensionPageRoute-DluAWT6h.js → ExtensionPageRoute-mKN8Jqyx.js} +1 -1
  26. package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-IBBeJf7u.js → FloatingTanStackRouterDevtools-CqogiFob-CGXG-x9g.js} +1 -1
  27. package/dist/client/assets/HandlePage-Bun58ePo.js +1 -0
  28. package/dist/client/assets/{HeartbeatPage-DcispKV9.js → HeartbeatPage-DFf7Udem.js} +1 -1
  29. package/dist/client/assets/{LexicalField-CvW19ipK.js → LexicalField-vJ284m2H.js} +1 -1
  30. package/dist/client/assets/{ManagesPage-Dru8_kTd.js → ManagesPage-mDuaA2JT.js} +1 -1
  31. package/dist/client/assets/{Marketplace-UEST-d72.js → Marketplace-BoiupH2Z.js} +1 -1
  32. package/dist/client/assets/{MarketplaceSourcesView-2XwWS0fF.js → MarketplaceSourcesView-krw9hUyu.js} +1 -1
  33. package/dist/client/assets/{McpAppFrame-DcPNmy1o.js → McpAppFrame-DmHduNgp.js} +1 -1
  34. package/dist/client/assets/{McpSigninBody-YXQtYFSW.js → McpSigninBody-DoY09n4J.js} +1 -1
  35. package/dist/client/assets/{Model3dViewer-D9HznL8w.js → Model3dViewer-BZEdR7-9.js} +1 -1
  36. package/dist/client/assets/NamePage-CXyClUPJ.js +1 -0
  37. package/dist/client/assets/{NewDirectMessageMenu-DNd6s2qQ.js → NewDirectMessageMenu-BjqYwnXW.js} +1 -1
  38. package/dist/client/assets/{NotificationsPage-Dg7_d0Fo.js → NotificationsPage-CybW1eIb.js} +1 -1
  39. package/dist/client/assets/{OpenMeshSwitch-Dw8ylRP7.js → OpenMeshSwitch-DrmjsCDY.js} +1 -1
  40. package/dist/client/assets/{OperatorIdentityForm-DtA4qIAR.js → OperatorIdentityForm-byU2FeSU.js} +1 -1
  41. package/dist/client/assets/{PermissionsPage-ZEO9Crz4.js → PermissionsPage-CP3kbqyJ.js} +1 -1
  42. package/dist/client/assets/{PersonalityPopover-Cv26YoDX.js → PersonalityPopover-BLsjgaum.js} +1 -1
  43. package/dist/client/assets/PhotoPage-hn5b42qN.js +1 -0
  44. package/dist/client/assets/{PreviewRefusedNotice-CLOum_3D.js → PreviewRefusedNotice-fTN8MJ1h.js} +1 -1
  45. package/dist/client/assets/{PromptSuggestionChips-BMFNtxGR.js → PromptSuggestionChips-BZOaY5Tx.js} +1 -1
  46. package/dist/client/assets/{ReportsToPopover-CR7Exvh7.js → ReportsToPopover-B6JvfRt3.js} +1 -1
  47. package/dist/client/assets/{RoomSurface-Bq7667r4.js → RoomSurface-BM0QO_av.js} +3 -3
  48. package/dist/client/assets/{RoomsPage-DGOvUZFv.js → RoomsPage-B-NOCLXC.js} +1 -1
  49. package/dist/client/assets/{RunsOnPopover-CpS43xkI.js → RunsOnPopover-D1jQQatj.js} +1 -1
  50. package/dist/client/assets/{RuntimeSetupDialog-Bh0jopL-.js → RuntimeSetupDialog-ufwCvCJB.js} +1 -1
  51. package/dist/client/assets/{SessionsPage-Zfpi_q-8.js → SessionsPage-CBE1KHYg.js} +1 -1
  52. package/dist/client/assets/{SkillsPage-cjkbMED1.js → SkillsPage-CPTFjEUe.js} +1 -1
  53. package/dist/client/assets/{TasksPage-HQqmMSc-.js → TasksPage-BRUqs3v5.js} +1 -1
  54. package/dist/client/assets/{ToolsPage-Bo2_xjXO.js → ToolsPage-C25kL822.js} +1 -1
  55. package/dist/client/assets/{TopologyGraph-Is22VGxs.js → TopologyGraph-of6Cp5Kj.js} +1 -1
  56. package/dist/client/assets/{TourHost-DxBh58jt.js → TourHost-zwSilkjm.js} +1 -1
  57. package/dist/client/assets/{UnlinkDialog-B70UThXm.js → UnlinkDialog-BgwHAqdW.js} +1 -1
  58. package/dist/client/assets/{WidgetErrorCard-l8cP9oJc.js → WidgetErrorCard-BQwrR6PJ.js} +6 -6
  59. package/dist/client/assets/{_shell-pedi36wq.js → _shell-bcx2y7VT.js} +1 -1
  60. package/dist/client/assets/{_shell._home-9g2nykRD.js → _shell._home-BkP0NafS.js} +1 -1
  61. package/dist/client/assets/{_shell._home.activity-M0V2vwFy.js → _shell._home.activity-BO_2ciGK.js} +1 -1
  62. package/dist/client/assets/{_shell._home.index-8qVMuOhT.js → _shell._home.index-B-OFwU9u.js} +1 -1
  63. package/dist/client/assets/{_shell._home.tasks-fGzbxCP4.js → _shell._home.tasks-jAQczH7j.js} +1 -1
  64. package/dist/client/assets/{_shell._home.workspaces-BSeaYQDz.js → _shell._home.workspaces-B34Uk1SP.js} +1 -1
  65. package/dist/client/assets/{_shell.channels-DwyPOJGL.js → _shell.channels-CGzsxvXD.js} +1 -1
  66. package/dist/client/assets/_shell.connections-BNbeBrxQ.js +1 -0
  67. package/dist/client/assets/{_shell.feedback-requests-BPwtAQNY.js → _shell.feedback-requests-B71l48KB.js} +1 -1
  68. package/dist/client/assets/_shell.marketplace-3YAsNaRk.js +1 -0
  69. package/dist/client/assets/_shell.marketplace_.sources-cI3nNBXr.js +1 -0
  70. package/dist/client/assets/_shell.session-ybAc0bwn.js +66 -0
  71. package/dist/client/assets/{_shell.team-DKZ4y6kn.js → _shell.team-BE_60YS4.js} +3 -3
  72. package/dist/client/assets/_shell.x._extensionId-jiyP599c.js +1 -0
  73. package/dist/client/assets/_shell.x._extensionId_._-jiyP599c.js +1 -0
  74. package/dist/client/assets/{agent-browser-CSBlgMiw.js → agent-browser-Cs8abkZs.js} +1 -1
  75. package/dist/client/assets/{banner-D26eekSD.js → banner-CU2Nh3Kv.js} +1 -1
  76. package/dist/client/assets/{card-CTGm0Blo.js → card-BTgwskmX.js} +1 -1
  77. package/dist/client/assets/{file-B6neiwXF.js → file-DlQX-hKl.js} +1 -1
  78. package/dist/client/assets/{file-exclamation-point-B-iziRzy.js → file-exclamation-point-Dg2iCyPM.js} +1 -1
  79. package/dist/client/assets/{find-latest-widget-fence-Dw4BJ_cR.js → find-latest-widget-fence-BGiexm6r.js} +1 -1
  80. package/dist/client/assets/{git-branch-D9jctpSd.js → git-branch-Dq_w3Iyx.js} +1 -1
  81. package/dist/client/assets/{heart-cgLUdSV5.js → heart-Bp14wOx6.js} +1 -1
  82. package/dist/client/assets/{highlighted-body-KPVGNVTW-CEOricmN.js → highlighted-body-KPVGNVTW-kD1HK_wk.js} +1 -1
  83. package/dist/client/assets/{index-DcqBUr0N.js → index--3UwFg2s.js} +1 -1
  84. package/dist/client/assets/{index-CVzwL_3n.js → index-5OyUurJr.js} +1 -1
  85. package/dist/client/assets/{index-CUu6WsiU.js → index-B0OZehWe.js} +1 -1
  86. package/dist/client/assets/{index-BWnfydnq.js → index-B2JJZXsq.js} +1 -1
  87. package/dist/client/assets/{index-ZNJbhnlq.js → index-B6_ikFYj.js} +1 -1
  88. package/dist/client/assets/{index-1flHw44u.js → index-B8R78Nnj.js} +2 -2
  89. package/dist/client/assets/{index-bHlg-Jp8.js → index-BA-nPsLw.js} +1 -1
  90. package/dist/client/assets/{index-jD4A_p4E.js → index-BAjUSKoJ.js} +1 -1
  91. package/dist/client/assets/{index-CiIZQZuK.js → index-BHsZlKfx.js} +1 -1
  92. package/dist/client/assets/{index-BO2LMWbR.js → index-BeBmUxo_.js} +1 -1
  93. package/dist/client/assets/index-BpDY3eoD.js +1 -0
  94. package/dist/client/assets/{index-CqHifKay.js → index-BxUoa3yn.js} +1 -1
  95. package/dist/client/assets/{index-CLuxURdA.js → index-BxrZwUJp.js} +1 -1
  96. package/dist/client/assets/{index-vkTtWH-G.js → index-C-DN0Vg_.js} +1 -1
  97. package/dist/client/assets/{index-ClIP6HHR.js → index-C99173Ze.js} +1 -1
  98. package/dist/client/assets/{index-DKjP63zN.js → index-CAhJGlSW.js} +1 -1
  99. package/dist/client/assets/{index-CeCuaX5y.js → index-CDWsIVX7.js} +1 -1
  100. package/dist/client/assets/{index-tf4Y0hYZ.js → index-CKCMjqcu.js} +1 -1
  101. package/dist/client/assets/{index-K2hqr6x6.js → index-C_uYJzKi.js} +3 -3
  102. package/dist/client/assets/{index-CupP-VJi.js → index-Cc280M3V.js} +1 -1
  103. package/dist/client/assets/{index-D4em25Xt.js → index-CcV9S7cO.js} +1 -1
  104. package/dist/client/assets/{index-Bkfi8Myj.js → index-DHUToGjI.js} +1 -1
  105. package/dist/client/assets/{index-LP8S5WuT.js → index-DKQDBIWq.js} +1 -1
  106. package/dist/client/assets/{index-BfgOj4sK.js → index-DKlxz3u7.js} +1 -1
  107. package/dist/client/assets/{index-CBQqdBKL.js → index-DNglWRBB.js} +1 -1
  108. package/dist/client/assets/{index-CbDB1su1.js → index-DO6a5Hey.js} +1 -1
  109. package/dist/client/assets/{index-DQDCxGNh.js → index-DS-thlE8.js} +1 -1
  110. package/dist/client/assets/{index-CsjcT6BA.js → index-DSPs6GF4.js} +1 -1
  111. package/dist/client/assets/{index-DMmU6ZLq.js → index-DW6zqLoM.js} +1 -1
  112. package/dist/client/assets/{index-_nhqr_iZ.js → index-Dm53S0up.js} +1 -1
  113. package/dist/client/assets/{index-DckajKF2.js → index-DnmtTIUB.js} +1 -1
  114. package/dist/client/assets/{index-BZKMWkth.js → index-Dr-0P6rd.js} +239 -234
  115. package/dist/client/assets/{index-CGLE5zMG.js → index-F7Lcwnfm.js} +1 -1
  116. package/dist/client/assets/{index-B38pxhxw.js → index-LszRbEbX.js} +1 -1
  117. package/dist/client/assets/{index-lKqCjbqn.js → index-PxSRtDpP.js} +1 -1
  118. package/dist/client/assets/{index-BkYvXnXR.js → index-aDNEGBTK.js} +1 -1
  119. package/dist/client/assets/{index-C3tcDwG6.js → index-gu2JYnOq.js} +1 -1
  120. package/dist/client/assets/{index-BfDqp5Sv.js → index-kHXlTLUx.js} +7 -7
  121. package/dist/client/assets/{index-CSQHKTvU.js → index-knGXyHhh.js} +1 -1
  122. package/dist/client/assets/{kickoff-D-oHin9P.js → kickoff-Btbza7bw.js} +1 -1
  123. package/dist/client/assets/{layers-BpMm7sp6.js → layers-B0oCOfxz.js} +1 -1
  124. package/dist/client/assets/{lightbulb-CxP8HLlU.js → lightbulb-D80IzMqz.js} +1 -1
  125. package/dist/client/assets/{markdown-content-plNIomQc.js → markdown-content-aNzh-54y.js} +1 -1
  126. package/dist/client/assets/{mention-pill-B9c_KFvY.js → mention-pill-BxMK0xuY.js} +1 -1
  127. package/dist/client/assets/{message-square-off-8wAP6cRG.js → message-square-off-D-CJXmTq.js} +1 -1
  128. package/dist/client/assets/{owner-notice-CopwUeso.js → owner-notice-BkrTEMDm.js} +1 -1
  129. package/dist/client/assets/{package-B7amjGSw.js → package-CoTlAnXZ.js} +1 -1
  130. package/dist/client/assets/{page-container-DMx2f-Ca.js → page-container-CPxW5T9E.js} +1 -1
  131. package/dist/client/assets/{paperclip-CA9pcNn6.js → paperclip-Cj1P85mz.js} +1 -1
  132. package/dist/client/assets/{radio-B4GY45ie.js → radio-DICkTr_p.js} +1 -1
  133. package/dist/client/assets/{room-files-source-91oNy8mM.js → room-files-source-BywWQPBN.js} +1 -1
  134. package/dist/client/assets/{rotate-ccw-clock-C-ftj_rU.js → rotate-ccw-clock-cx5RyP4l.js} +1 -1
  135. package/dist/client/assets/{rotate-cw-TrlUqVdq.js → rotate-cw-DrGRGSwy.js} +1 -1
  136. package/dist/client/assets/{scroll-area-DKse0rZa.js → scroll-area-XlDz8u4m.js} +1 -1
  137. package/dist/client/assets/{search-x-DvMuhABO.js → search-x-LIKnWE64.js} +1 -1
  138. package/dist/client/assets/{shield-x-ZcQ8NB0Z.js → shield-x-DioB6qH_.js} +1 -1
  139. package/dist/client/assets/{soul-file-B_MwZHvh.js → soul-file-C7YgkNET.js} +1 -1
  140. package/dist/client/assets/{table-BJDpTBxJ.js → table-P4N5xQn2.js} +1 -1
  141. package/dist/client/assets/{use-connector-management-BZ-sfu8O.js → use-connector-management-pgVHbXoO.js} +1 -1
  142. package/dist/client/assets/{use-delete-binding-XWrr4lIB.js → use-delete-binding-DxEiOjjh.js} +1 -1
  143. package/dist/client/assets/{use-dev-links-daERqZ4e.js → use-dev-links-BImQrE6g.js} +1 -1
  144. package/dist/client/assets/{use-external-adapter-catalog-DE5zmChu.js → use-external-adapter-catalog-D8KHMSZU.js} +1 -1
  145. package/dist/client/assets/{use-full-activity-feed-DkDB2i0G.js → use-full-activity-feed-2o7GNAMe.js} +1 -1
  146. package/dist/client/assets/use-is-below-desktop-DBet5zg_.js +1 -0
  147. package/dist/client/assets/{use-jump-back-in-Dm-2B4la.js → use-jump-back-in-D9tBJ4v5.js} +1 -1
  148. package/dist/client/assets/{use-mesh-topology-DXFAk9hJ.js → use-mesh-topology-DBeqzUoy.js} +1 -1
  149. package/dist/client/assets/use-pending-read-DmrlNHS0.js +1 -0
  150. package/dist/client/assets/{use-personality-commit-CgQm9Y7m.js → use-personality-commit-Gfoi__sT.js} +1 -1
  151. package/dist/client/assets/{use-promo-activation-CZMwcIvl.js → use-promo-activation-Bv1gnqKq.js} +1 -1
  152. package/dist/client/assets/{use-pulse-freshness-CKzRoyfz.js → use-pulse-freshness-SFRdnugS.js} +1 -1
  153. package/dist/client/assets/{use-room-follow-claim-TvE0bgPq.js → use-room-follow-claim-Cf20JiJ_.js} +1 -1
  154. package/dist/client/assets/{use-roving-tab-list-DlrB639e.js → use-roving-tab-list-3Pb7ps4E.js} +1 -1
  155. package/dist/client/assets/{use-session-canvas-8hTR83y8.js → use-session-canvas-BaXuEhw8.js} +4 -4
  156. package/dist/client/assets/{use-session-diagnostics-DAd4CfKM.js → use-session-diagnostics-7xxJ6zQQ.js} +1 -1
  157. package/dist/client/assets/{use-unclaimed-chats-DKLFamqB.js → use-unclaimed-chats-D4k-EK_f.js} +1 -1
  158. package/dist/client/index.html +1 -1
  159. package/dist/server/index.js +865 -216
  160. package/dist/server/index.js.map +2 -2
  161. package/package.json +3 -3
  162. package/dist/client/assets/HandlePage-CjinTYw3.js +0 -1
  163. package/dist/client/assets/NamePage-D5q8YN0G.js +0 -1
  164. package/dist/client/assets/PhotoPage-BYtfMHJD.js +0 -1
  165. package/dist/client/assets/_shell.connections-DQ8AztAx.js +0 -6
  166. package/dist/client/assets/_shell.marketplace-CiM3PSqV.js +0 -1
  167. package/dist/client/assets/_shell.marketplace_.sources-C5u-WJmL.js +0 -1
  168. package/dist/client/assets/_shell.session-DYCz4inz.js +0 -66
  169. package/dist/client/assets/_shell.x._extensionId-C1fzIfH4.js +0 -1
  170. package/dist/client/assets/_shell.x._extensionId_._-C1fzIfH4.js +0 -1
  171. package/dist/client/assets/index-AYHwV9IU.js +0 -1
  172. package/dist/client/assets/use-is-below-desktop-B-Dt4c9S.js +0 -1
  173. package/dist/client/assets/use-pending-read-CH_0XPYp.js +0 -1
package/dist/bin/cli.js CHANGED
@@ -26324,7 +26324,7 @@ import path2 from "path";
26324
26324
  import { fileURLToPath } from "url";
26325
26325
  function resolveVersion() {
26326
26326
  if (env2.DORKOS_VERSION_OVERRIDE) return env2.DORKOS_VERSION_OVERRIDE;
26327
- if (true) return "0.110.0";
26327
+ if (true) return "0.111.0";
26328
26328
  const pkgPath = path2.join(path2.dirname(fileURLToPath(import.meta.url)), "../../package.json");
26329
26329
  return JSON.parse(readFileSync(pkgPath, "utf-8")).version;
26330
26330
  }
@@ -33470,7 +33470,7 @@ var init_marketplace_schemas = __esm({
33470
33470
  default: "runs at the most careful setting its agent offers",
33471
33471
  plan: "can only read and plan, and cannot change anything",
33472
33472
  acceptEdits: "can change files on its own, and on some agents run commands too",
33473
- dontAsk: "runs its tools without a permission prompt",
33473
+ dontAsk: "runs only the tools it is allowed, and refuses the rest without asking",
33474
33474
  bypassPermissions: "can run any command without a permission prompt",
33475
33475
  auto: "decides for itself which actions are safe to take"
33476
33476
  };
@@ -41367,7 +41367,7 @@ var init_account_usage = __esm({
41367
41367
  });
41368
41368
 
41369
41369
  // ../shared/src/chat-messages.ts
41370
- var ChatMessageKindSchema, ChatDeliverySchema, ChatMessageStatusSchema, ChatMessageSenderSchema, ChatMessageStampSchema, SentChatMessageSchema, ChatStopNoticeSchema, CHAT_MESSAGE_FENCE_LABEL, FENCE_PATTERN, ChatActivityResponseSchema;
41370
+ var ChatMessageKindSchema, ChatDeliverySchema, ChatMessageStatusSchema, ChatMessageSenderSchema, ChatMessageStampSchema, RoomMessageAuthorSchema, RoomMessageStampSchema, SentChatMessageSchema, ChatStopNoticeSchema, CHAT_MESSAGE_FENCE_LABEL, FENCE_PATTERN, ChatActivityResponseSchema;
41371
41371
  var init_chat_messages = __esm({
41372
41372
  "../shared/src/chat-messages.ts"() {
41373
41373
  "use strict";
@@ -41405,6 +41405,34 @@ var init_chat_messages = __esm({
41405
41405
  /** When it was sent (ISO 8601). */
41406
41406
  sentAt: external_exports.string()
41407
41407
  }).openapi("ChatMessageStamp");
41408
+ RoomMessageAuthorSchema = external_exports.object({
41409
+ /** The room author's id. */
41410
+ id: external_exports.string(),
41411
+ /** A person, an agent, or the room itself. */
41412
+ kind: external_exports.enum(["human", "agent", "system"]),
41413
+ /** The name the room shows for them. */
41414
+ displayName: external_exports.string(),
41415
+ /** Their `@` handle, or null when they have none. */
41416
+ handle: external_exports.string().nullable(),
41417
+ /** Their emoji face, when they chose one. */
41418
+ emoji: external_exports.string().optional(),
41419
+ /** Their identity colour, when they chose one. */
41420
+ color: external_exports.string().optional(),
41421
+ /** Agents only: the agent's Mesh id, when the room knows it, for its face. */
41422
+ agentId: external_exports.string().optional(),
41423
+ /** True when this is the person who owns this DorkOS: their own words. */
41424
+ you: external_exports.boolean()
41425
+ }).openapi("RoomMessageAuthor");
41426
+ RoomMessageStampSchema = external_exports.object({
41427
+ /** The room the message was posted in. */
41428
+ roomId: external_exports.string(),
41429
+ /** The room entry the turn answered. */
41430
+ entryId: external_exports.string(),
41431
+ /** The room's name as people see it (`#general`, or a DM's title). */
41432
+ roomLabel: external_exports.string().optional(),
41433
+ /** Who posted it. Absent when the room no longer has the entry. */
41434
+ author: RoomMessageAuthorSchema.optional()
41435
+ }).openapi("RoomMessageStamp");
41408
41436
  SentChatMessageSchema = external_exports.object({
41409
41437
  /** The receipt id. */
41410
41438
  id: external_exports.string(),
@@ -43411,7 +43439,14 @@ var init_schemas3 = __esm({
43411
43439
  * matches its own record of the send; the app draws the sender from here
43412
43440
  * and never from the text.
43413
43441
  */
43414
- chatMessages: external_exports.array(ChatMessageStampSchema).optional()
43442
+ chatMessages: external_exports.array(ChatMessageStampSchema).optional(),
43443
+ /**
43444
+ * The room post this user message carried into a room-attached chat
43445
+ * (DOR-2113). The runtime records which entry; the server fills in the
43446
+ * room and its author. The app draws the sender from here, never "You"
43447
+ * unless the room says the person wrote it.
43448
+ */
43449
+ roomMessage: RoomMessageStampSchema.optional()
43415
43450
  }).openapi("HistoryMessage");
43416
43451
  CommandEntrySchema = external_exports.object({
43417
43452
  namespace: external_exports.string().optional(),
@@ -46128,7 +46163,6 @@ function validateSlug(s2) {
46128
46163
  }
46129
46164
  var init_slug = __esm({
46130
46165
  "../skills/src/slug.ts"() {
46131
- "use strict";
46132
46166
  }
46133
46167
  });
46134
46168
 
@@ -115817,6 +115851,7 @@ function repairSecretPermissions(secretPath) {
115817
115851
  var SECRET_FILE_NAME, SECRET_FILE_MODE, SECRET_BYTES;
115818
115852
  var init_secret = __esm({
115819
115853
  "../../apps/server/src/services/core/auth/secret.ts"() {
115854
+ "use strict";
115820
115855
  init_secret_file();
115821
115856
  init_logger();
115822
115857
  SECRET_FILE_NAME = "better-auth-secret";
@@ -115922,7 +115957,6 @@ function defuseSystemTags(text3, tagNames) {
115922
115957
  var IDENTITY_MAX_LENGTH, INVISIBLE_FORMAT, CONTROL_CHARS, PATTERN_CACHE;
115923
115958
  var init_untrusted_text = __esm({
115924
115959
  "../shared/src/untrusted-text.ts"() {
115925
- "use strict";
115926
115960
  IDENTITY_MAX_LENGTH = 80;
115927
115961
  INVISIBLE_FORMAT = /[\u00ad\u200b-\u200f\u202a-\u202e\u2060-\u2064\ufeff\ufff9-\ufffb]/g;
115928
115962
  CONTROL_CHARS = /[\u0000-\u001f\u007f-\u009f]/g;
@@ -119658,7 +119692,13 @@ var init_session_stream = __esm({
119658
119692
  * `spin-off-chats` §2). Stamped by the server at the wire boundary;
119659
119693
  * never written by a runtime.
119660
119694
  */
119661
- chatMessages: external_exports.array(ChatMessageStampSchema).optional()
119695
+ chatMessages: external_exports.array(ChatMessageStampSchema).optional(),
119696
+ /**
119697
+ * The room post that opened this turn, when a room did (DOR-2113). The
119698
+ * dispatcher records the room and entry; the server fills in the author
119699
+ * at the wire boundary, as for `chatMessages`.
119700
+ */
119701
+ roomMessage: RoomMessageStampSchema.optional()
119662
119702
  }),
119663
119703
  // The end of an assistant turn.
119664
119704
  external_exports.object({
@@ -162583,7 +162623,7 @@ if (process.argv[2] === "community") {
162583
162623
  );
162584
162624
  Object.assign(childEnv, credentialEnv.pickCommunityCredentialEnv(rawProcessEnv));
162585
162625
  const exitCode = await dispatcher.runCommunityDispatcher(process.argv.slice(3), {
162586
- cliVersion: "0.110.0",
162626
+ cliVersion: "0.111.0",
162587
162627
  dorkHome: DORK_HOME,
162588
162628
  processEnv: childEnv,
162589
162629
  parseRelease: (bytes) => releaseContract.parseCompatibleCommunityReleaseManifest(
@@ -162601,7 +162641,7 @@ if (process.argv[2] === "community") {
162601
162641
  process.exit(1);
162602
162642
  }
162603
162643
  }
162604
- var cliErrorReporter = initCliErrorReporting({ dorkHome: DORK_HOME, version: "0.110.0" });
162644
+ var cliErrorReporter = initCliErrorReporting({ dorkHome: DORK_HOME, version: "0.111.0" });
162605
162645
  var uninstallCliErrorHandlers = cliErrorReporter ? installCliErrorHandlers(cliErrorReporter) : void 0;
162606
162646
  if (process.argv[2] === "doctor") {
162607
162647
  process.env.DORK_HOME = DORK_HOME;
@@ -162611,7 +162651,7 @@ if (process.argv[2] === "doctor") {
162611
162651
  if (process.argv[2] === "feedback") {
162612
162652
  process.env.DORK_HOME = DORK_HOME;
162613
162653
  const { runFeedback: runFeedback2 } = await Promise.resolve().then(() => (init_feedback2(), feedback_exports));
162614
- process.exit(await runFeedback2(DORK_HOME, "0.110.0", process.argv.slice(3)));
162654
+ process.exit(await runFeedback2(DORK_HOME, "0.111.0", process.argv.slice(3)));
162615
162655
  }
162616
162656
  if (process.argv[2] === "auth") {
162617
162657
  process.env.DORK_HOME = DORK_HOME;
@@ -162710,7 +162750,7 @@ if (process.argv[2] === "agent" || process.argv[2] === "task" || process.argv[2]
162710
162750
  }
162711
162751
  }
162712
162752
  const { runVersionDispatcher: runVersionDispatcher2 } = await Promise.resolve().then(() => (init_version5(), version_exports));
162713
- process.exit(await runVersionDispatcher2("0.110.0", DORK_HOME, subArgs));
162753
+ process.exit(await runVersionDispatcher2("0.111.0", DORK_HOME, subArgs));
162714
162754
  }
162715
162755
  function parseCliArgs() {
162716
162756
  try {
@@ -162833,14 +162873,14 @@ Examples:
162833
162873
  process.exit(0);
162834
162874
  }
162835
162875
  if (values.version) {
162836
- console.log("0.110.0");
162876
+ console.log("0.111.0");
162837
162877
  process.exit(0);
162838
162878
  }
162839
162879
  if (values["post-install-check"]) {
162840
162880
  const claudeFound = checkClaude();
162841
162881
  const coreExtensionsFound = checkCoreExtensions();
162842
162882
  const extensionsCompile = await checkExtensionCompilation();
162843
- console.log(`dorkos ${"0.110.0"}`);
162883
+ console.log(`dorkos ${"0.111.0"}`);
162844
162884
  if (!coreExtensionsFound) {
162845
162885
  console.log("Installation incomplete \u2014 bundled core extensions are missing.");
162846
162886
  }
@@ -162988,7 +163028,7 @@ if (fs34.existsSync(envPath)) {
162988
163028
  }
162989
163029
  uninstallCliErrorHandlers?.();
162990
163030
  process.env.DORKOS_CLI_ENTRYPOINT = fileURLToPath7(import.meta.url);
162991
- process.env.DORKOS_CLI_VERSION = "0.110.0";
163031
+ process.env.DORKOS_CLI_VERSION = "0.111.0";
162992
163032
  var server;
162993
163033
  try {
162994
163034
  server = await import("../server/index.js");
@@ -163013,7 +163053,7 @@ var ansiReset = "\x1B[0m";
163013
163053
  console.log("");
163014
163054
  console.log(`${purple}${logo}${ansiReset}`);
163015
163055
  console.log("");
163016
- console.log(` DorkOS v${"0.110.0"}`);
163056
+ console.log(` DorkOS v${"0.111.0"}`);
163017
163057
  console.log(` Local: ${link(localUrl, localUrl)}`);
163018
163058
  var nets = networkInterfaces();
163019
163059
  var networkUrl = null;
@@ -163039,9 +163079,9 @@ if (shouldOpenBrowser && process.stdin.isTTY) {
163039
163079
  const openCmd = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
163040
163080
  exec(`${openCmd} ${localUrl}`);
163041
163081
  }
163042
- checkForUpdate("0.110.0").then((latestVersion) => {
163082
+ checkForUpdate("0.111.0").then((latestVersion) => {
163043
163083
  if (latestVersion) {
163044
- const msg = `Update available: ${"0.110.0"} \u2192 ${latestVersion}`;
163084
+ const msg = `Update available: ${"0.111.0"} \u2192 ${latestVersion}`;
163045
163085
  const cmd = "Run npm install -g dorkos@latest to update";
163046
163086
  const width = Math.max(msg.length, cmd.length) + 6;
163047
163087
  const pad2 = (s2) => `\u2502 ${s2}${" ".repeat(width - s2.length - 6)} \u2502`;
@@ -1 +1 @@
1
- {"version":1,"controllerSHA256":"f2039ad4959766cb17ec38760ed71015657b447968d0b16f4c0f2f449a4a0420","nativeManifestSHA256":"19fb0607902e9c30bc693f3a8f7e80601f6ccfd090ffa412a5a38614e6eb7c00","platform":"darwin","arch":"arm64","availability":"available","workers":[{"name":"darwin-journal-worker.mjs","sha256":"739958b3515b48dda8cf40366aa6e34cf65366662c96dba1c951f38bc2f97603","bytes":88486},{"name":"darwin-supervisor-worker.mjs","sha256":"83b9b1e6d8969f5f909b43ebcf2d3ae6830601908bd2e4e4b2747d9ee7e55b77","bytes":74686}]}
1
+ {"version":1,"controllerSHA256":"5ed6abd2068a20dc857eea32e9018be1afd62549ae43b6ac7f606cd5c46a7003","nativeManifestSHA256":"19fb0607902e9c30bc693f3a8f7e80601f6ccfd090ffa412a5a38614e6eb7c00","platform":"darwin","arch":"arm64","availability":"available","workers":[{"name":"darwin-journal-worker.mjs","sha256":"739958b3515b48dda8cf40366aa6e34cf65366662c96dba1c951f38bc2f97603","bytes":88486},{"name":"darwin-supervisor-worker.mjs","sha256":"83b9b1e6d8969f5f909b43ebcf2d3ae6830601908bd2e4e4b2747d9ee7e55b77","bytes":74686}]}
@@ -1 +1 @@
1
- {"schemaVersion":1,"controllerSHA256":"f2039ad4959766cb17ec38760ed71015657b447968d0b16f4c0f2f449a4a0420","verifierSHA256":"5cb8f248a264a0602757ad2c0971c1b1e84bcf3185a2b8d706230d2cfac0703c"}
1
+ {"schemaVersion":1,"controllerSHA256":"5ed6abd2068a20dc857eea32e9018be1afd62549ae43b6ac7f606cd5c46a7003","verifierSHA256":"5cb8f248a264a0602757ad2c0971c1b1e84bcf3185a2b8d706230d2cfac0703c"}
@@ -1 +1 @@
1
- import{b as N,d as v,j as e,e as w,r as d,X as C,I as k,B as D,f as S}from"./index-BZKMWkth.js";function j({children:i}){return e.jsx("div",{className:"text-muted-foreground text-3xs font-medium tracking-wider uppercase",children:i})}function A({agent:i,onUpdate:t}){const[a,l]=d.useState(!1),[o,u]=d.useState(""),n=i.capabilities??[];function c(){const s=o.trim();s&&!n.includes(s)&&t({capabilities:[...n,s]}),u(""),l(!1)}return e.jsxs("div",{className:"space-y-1",children:[e.jsx(j,{children:"Capabilities"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[n.map(s=>e.jsxs("span",{className:"bg-accent text-accent-foreground inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs",children:[s,e.jsx("button",{type:"button",onClick:()=>t({capabilities:n.filter(p=>p!==s)}),className:"hover:text-destructive transition-colors","aria-label":`Remove capability ${s}`,children:e.jsx(C,{"aria-hidden":!0,className:"size-3"})})]},s)),a?e.jsx(k,{autoFocus:!0,value:o,onChange:s=>u(s.target.value),onBlur:c,onKeyDown:s=>{s.key==="Enter"&&c(),s.key==="Escape"&&l(!1)},className:"h-6 w-28 text-xs",placeholder:"Capability name","aria-label":"New capability"}):e.jsxs(D,{type:"button",variant:"ghost",size:"sm",onClick:()=>l(!0),className:"text-muted-foreground hover:text-foreground h-auto gap-0.5 px-1 py-0 text-xs",children:[e.jsx(S,{"aria-hidden":!0,className:"size-3"})," Add"]})]})]})}function b({label:i,value:t,placeholder:a,multiline:l,testId:o,onCommit:u}){const[n,c]=d.useState(t),[s,p]=d.useState(t),[m,f]=d.useState(null);s!==t&&(p(t),c(t));function x(){const r=n.trim();if(r===t.trim())return;const g=u(r);if(typeof g!="string")return f(null);c(t),f(g)}const h="border-input bg-background placeholder:text-muted-foreground focus-visible:ring-ring w-full rounded-md border px-3 py-2 text-sm focus-visible:ring-2 focus-visible:outline-none",y=m?e.jsx("p",{role:"status",className:"text-destructive text-xs",children:m}):null;return e.jsxs("div",{className:"space-y-1",children:[e.jsx(j,{children:i}),l?e.jsx("textarea",{value:n,rows:4,"data-testid":o,"aria-label":i,placeholder:a,onChange:r=>{f(null),c(r.target.value)},onBlur:x,onKeyDown:r=>{r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),x())},className:h}):e.jsx("input",{value:n,"data-testid":o,"aria-label":i,placeholder:a,onChange:r=>{f(null),c(r.target.value)},onBlur:x,onKeyDown:r=>{r.key==="Enter"&&x()},className:h}),y]})}function R({member:i,roster:t}){const{agent:a,isPending:l,update:o}=N(i),u=v(i,t)==="managed";return l?e.jsx(w,{className:"h-16 w-full"}):!u||!a?e.jsx(E,{member:i,agent:a}):e.jsxs("div",{className:"flex flex-col gap-4","data-slot":"profile-about",children:[e.jsx(b,{label:"Name",value:a.displayName??a.name,placeholder:"What you call this agent",testId:"agent-name-field",onCommit:n=>{if(!n)return"A name can’t be empty, so the old one was kept.";o({displayName:n})}}),e.jsx(b,{multiline:!0,label:"Description",value:a.description??"",placeholder:"What is this agent for?",testId:"agent-description-field",onCommit:n=>o({description:n})}),e.jsx(A,{agent:a,onUpdate:o})]})}function E({member:i,agent:t}){var l;const a=(l=t==null?void 0:t.description)==null?void 0:l.trim();return a?e.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap",children:a}):e.jsxs("p",{className:"text-muted-foreground text-sm",children:[i.displayName," has no description yet."]})}export{R as AboutPage};
1
+ import{b as N,d as v,j as e,e as w,r as d,X as C,I as k,B as D,f as S}from"./index-Dr-0P6rd.js";function j({children:i}){return e.jsx("div",{className:"text-muted-foreground text-3xs font-medium tracking-wider uppercase",children:i})}function A({agent:i,onUpdate:t}){const[a,l]=d.useState(!1),[o,u]=d.useState(""),n=i.capabilities??[];function c(){const s=o.trim();s&&!n.includes(s)&&t({capabilities:[...n,s]}),u(""),l(!1)}return e.jsxs("div",{className:"space-y-1",children:[e.jsx(j,{children:"Capabilities"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[n.map(s=>e.jsxs("span",{className:"bg-accent text-accent-foreground inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs",children:[s,e.jsx("button",{type:"button",onClick:()=>t({capabilities:n.filter(p=>p!==s)}),className:"hover:text-destructive transition-colors","aria-label":`Remove capability ${s}`,children:e.jsx(C,{"aria-hidden":!0,className:"size-3"})})]},s)),a?e.jsx(k,{autoFocus:!0,value:o,onChange:s=>u(s.target.value),onBlur:c,onKeyDown:s=>{s.key==="Enter"&&c(),s.key==="Escape"&&l(!1)},className:"h-6 w-28 text-xs",placeholder:"Capability name","aria-label":"New capability"}):e.jsxs(D,{type:"button",variant:"ghost",size:"sm",onClick:()=>l(!0),className:"text-muted-foreground hover:text-foreground h-auto gap-0.5 px-1 py-0 text-xs",children:[e.jsx(S,{"aria-hidden":!0,className:"size-3"})," Add"]})]})]})}function b({label:i,value:t,placeholder:a,multiline:l,testId:o,onCommit:u}){const[n,c]=d.useState(t),[s,p]=d.useState(t),[m,f]=d.useState(null);s!==t&&(p(t),c(t));function x(){const r=n.trim();if(r===t.trim())return;const g=u(r);if(typeof g!="string")return f(null);c(t),f(g)}const h="border-input bg-background placeholder:text-muted-foreground focus-visible:ring-ring w-full rounded-md border px-3 py-2 text-sm focus-visible:ring-2 focus-visible:outline-none",y=m?e.jsx("p",{role:"status",className:"text-destructive text-xs",children:m}):null;return e.jsxs("div",{className:"space-y-1",children:[e.jsx(j,{children:i}),l?e.jsx("textarea",{value:n,rows:4,"data-testid":o,"aria-label":i,placeholder:a,onChange:r=>{f(null),c(r.target.value)},onBlur:x,onKeyDown:r=>{r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),x())},className:h}):e.jsx("input",{value:n,"data-testid":o,"aria-label":i,placeholder:a,onChange:r=>{f(null),c(r.target.value)},onBlur:x,onKeyDown:r=>{r.key==="Enter"&&x()},className:h}),y]})}function R({member:i,roster:t}){const{agent:a,isPending:l,update:o}=N(i),u=v(i,t)==="managed";return l?e.jsx(w,{className:"h-16 w-full"}):!u||!a?e.jsx(E,{member:i,agent:a}):e.jsxs("div",{className:"flex flex-col gap-4","data-slot":"profile-about",children:[e.jsx(b,{label:"Name",value:a.displayName??a.name,placeholder:"What you call this agent",testId:"agent-name-field",onCommit:n=>{if(!n)return"A name can’t be empty, so the old one was kept.";o({displayName:n})}}),e.jsx(b,{multiline:!0,label:"Description",value:a.description??"",placeholder:"What is this agent for?",testId:"agent-description-field",onCommit:n=>o({description:n})}),e.jsx(A,{agent:a,onUpdate:o})]})}function E({member:i,agent:t}){var l;const a=(l=t==null?void 0:t.description)==null?void 0:l.trim();return a?e.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap",children:a}):e.jsxs("p",{className:"text-muted-foreground text-sm",children:[i.displayName," has no description yet."]})}export{R as AboutPage};
@@ -1 +1 @@
1
- import{eU as x,ae as o,ap as u,eV as f,j as a,Z as c,at as p,B as y}from"./index-BZKMWkth.js";const g=["Today","Yesterday","This week","Earlier"];function A(e,s){const t=new Map;for(const r of e){const n=h(new Date(r.occurredAt),s),i=t.get(n)??[];i.push(r),t.set(n,i)}return g.filter(r=>t.has(r)).map(r=>({label:r,items:t.get(r)}))}function h(e,s){const t=new Date(s);t.setHours(0,0,0,0);const r=new Date(t);r.setDate(r.getDate()-1);const n=new Date(t);return n.setDate(n.getDate()-n.getDay()),e>=t?"Today":e>=r?"Yesterday":e>=n?"This week":"Earlier"}const T={person:"user",external:"user",agent:"agent",system:"system"};function k(e){return e.source.sessionId?x({session:e.source.sessionId}):null}function w(e){return{id:e.id,occurredAt:e.at,actorType:T[e.actor.kind],actorLabel:e.actor.name,summary:e.summary,linkPath:k(e)}}const d=["audit"],l=50;function m(e){return e.pages.flatMap(s=>s.events.map(w))}function E(e={}){const s=o();return u({queryKey:[...d,"list",e],queryFn:({pageParam:t})=>s.listAuditEvents({...e,limit:l,beforeSeq:t}),initialPageParam:void 0,getNextPageParam:t=>t.nextBeforeSeq,select:m,staleTime:3e4,refetchOnWindowFocus:!0})}function P(e){const s=o();return u({queryKey:[...d,"timeline",e],queryFn:e===null?f:({pageParam:t})=>s.getAccountTimeline(e,{limit:l,beforeSeq:t}),initialPageParam:void 0,getNextPageParam:t=>t.nextBeforeSeq,select:m,staleTime:3e4,refetchOnWindowFocus:!0})}function j({label:e,className:s}){return a.jsx("div",{"data-slot":"activity-group-header",className:c("sticky top-0 z-10 -mx-4 px-4 py-2 sm:-mx-6 sm:px-6","bg-background/95 backdrop-blur-sm",s),children:a.jsx("h3",{className:"text-muted-foreground text-xs font-medium tracking-wider uppercase",children:e})})}function D({onRetry:e,className:s}){return a.jsxs("div",{"data-slot":"activity-error-state",className:c("flex flex-col items-center justify-center gap-3 py-16 text-center",s),children:[a.jsx("div",{className:"bg-destructive/10 rounded-xl p-3",children:a.jsx(p,{className:"text-destructive size-6","aria-hidden":"true"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-foreground text-sm font-medium",children:"Couldn’t load your activity"}),a.jsx("p",{className:"text-muted-foreground max-w-xs text-xs",children:"The DorkOS server didn’t answer. Check that it’s running."})]}),a.jsx(y,{variant:"outline",size:"sm",onClick:e,children:"Retry"})]})}export{D as A,j as a,E as b,A as g,P as u};
1
+ import{eU as x,ae as o,ap as u,eV as f,j as a,Z as c,at as p,B as y}from"./index-Dr-0P6rd.js";const g=["Today","Yesterday","This week","Earlier"];function A(e,s){const t=new Map;for(const r of e){const n=h(new Date(r.occurredAt),s),i=t.get(n)??[];i.push(r),t.set(n,i)}return g.filter(r=>t.has(r)).map(r=>({label:r,items:t.get(r)}))}function h(e,s){const t=new Date(s);t.setHours(0,0,0,0);const r=new Date(t);r.setDate(r.getDate()-1);const n=new Date(t);return n.setDate(n.getDate()-n.getDay()),e>=t?"Today":e>=r?"Yesterday":e>=n?"This week":"Earlier"}const T={person:"user",external:"user",agent:"agent",system:"system"};function k(e){return e.source.sessionId?x({session:e.source.sessionId}):null}function w(e){return{id:e.id,occurredAt:e.at,actorType:T[e.actor.kind],actorLabel:e.actor.name,summary:e.summary,linkPath:k(e)}}const d=["audit"],l=50;function m(e){return e.pages.flatMap(s=>s.events.map(w))}function E(e={}){const s=o();return u({queryKey:[...d,"list",e],queryFn:({pageParam:t})=>s.listAuditEvents({...e,limit:l,beforeSeq:t}),initialPageParam:void 0,getNextPageParam:t=>t.nextBeforeSeq,select:m,staleTime:3e4,refetchOnWindowFocus:!0})}function P(e){const s=o();return u({queryKey:[...d,"timeline",e],queryFn:e===null?f:({pageParam:t})=>s.getAccountTimeline(e,{limit:l,beforeSeq:t}),initialPageParam:void 0,getNextPageParam:t=>t.nextBeforeSeq,select:m,staleTime:3e4,refetchOnWindowFocus:!0})}function j({label:e,className:s}){return a.jsx("div",{"data-slot":"activity-group-header",className:c("sticky top-0 z-10 -mx-4 px-4 py-2 sm:-mx-6 sm:px-6","bg-background/95 backdrop-blur-sm",s),children:a.jsx("h3",{className:"text-muted-foreground text-xs font-medium tracking-wider uppercase",children:e})})}function D({onRetry:e,className:s}){return a.jsxs("div",{"data-slot":"activity-error-state",className:c("flex flex-col items-center justify-center gap-3 py-16 text-center",s),children:[a.jsx("div",{className:"bg-destructive/10 rounded-xl p-3",children:a.jsx(p,{className:"text-destructive size-6","aria-hidden":"true"})}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-foreground text-sm font-medium",children:"Couldn’t load your activity"}),a.jsx("p",{className:"text-muted-foreground max-w-xs text-xs",children:"The DorkOS server didn’t answer. Check that it’s running."})]}),a.jsx(y,{variant:"outline",size:"sm",onClick:e,children:"Retry"})]})}export{D as A,j as a,E as b,A as g,P as u};
@@ -1 +1 @@
1
- import{r as c,j as e,e as d,A as u,D as j,B as v,F as g}from"./index-BZKMWkth.js";import{T as N,a as A}from"./table-BJDpTBxJ.js";import{u as b,g as w,A as E,a as T}from"./ActivityErrorState-DiSxgHLa.js";import{A as B}from"./ActivityRow-BEKcGUIZ.js";function z({member:i}){var o;const r=((o=i.agent)==null?void 0:o.manifestId)??null,{data:l,isLoading:x,isError:m,refetch:p,isFetchingNextPage:n,hasNextPage:h,fetchNextPage:f}=b(r),s=c.useMemo(()=>l??[],[l]),y=c.useMemo(()=>w(s,new Date),[s]);return r===null?e.jsx("div",{className:"min-h-0 flex-1 px-4 py-3","data-slot":"profile-activity",children:e.jsx("p",{className:"text-muted-foreground text-xs",children:"Activity is kept per agent."})}):x?e.jsxs("div",{className:"min-h-0 flex-1 space-y-2 px-4 py-3","data-slot":"profile-activity","aria-busy":"true",children:[e.jsx(d,{className:"h-3 w-16"}),Array.from({length:5}).map((t,a)=>e.jsx(d,{className:"h-4 w-full"},a))]}):m&&s.length===0?e.jsx("div",{className:"min-h-0 flex-1 px-2","data-slot":"profile-activity",children:e.jsx(E,{onRetry:()=>void p()})}):s.length===0?e.jsx("div",{className:"min-h-0 flex-1 px-4 py-8","data-slot":"profile-activity",children:e.jsx(u,{icon:j,headline:"Nothing on record yet",description:`What ${i.displayName} does shows up here.`})}):e.jsxs("div",{className:"min-h-0 flex-1 px-2 py-2","data-slot":"profile-activity",children:[y.map(t=>e.jsxs("section",{children:[e.jsx(T,{label:t.label}),e.jsx(N,{children:e.jsx(A,{children:t.items.map(a=>e.jsx(B,{item:a,compact:!0},a.id))})})]},t.label)),h&&e.jsx("div",{className:"flex justify-center py-3",children:e.jsxs(v,{variant:"outline",size:"sm",onClick:()=>void f(),disabled:n,className:"gap-2",children:[n&&e.jsx(g,{size:"xs"}),"Load 50 more"]})})]})}export{z as ActivityPage};
1
+ import{r as c,j as e,e as d,A as u,D as j,B as v,F as g}from"./index-Dr-0P6rd.js";import{T as N,a as A}from"./table-P4N5xQn2.js";import{u as b,g as w,A as E,a as T}from"./ActivityErrorState-BXOZg9ve.js";import{A as B}from"./ActivityRow-CujXx04u.js";function z({member:i}){var o;const r=((o=i.agent)==null?void 0:o.manifestId)??null,{data:l,isLoading:x,isError:m,refetch:p,isFetchingNextPage:n,hasNextPage:h,fetchNextPage:f}=b(r),s=c.useMemo(()=>l??[],[l]),y=c.useMemo(()=>w(s,new Date),[s]);return r===null?e.jsx("div",{className:"min-h-0 flex-1 px-4 py-3","data-slot":"profile-activity",children:e.jsx("p",{className:"text-muted-foreground text-xs",children:"Activity is kept per agent."})}):x?e.jsxs("div",{className:"min-h-0 flex-1 space-y-2 px-4 py-3","data-slot":"profile-activity","aria-busy":"true",children:[e.jsx(d,{className:"h-3 w-16"}),Array.from({length:5}).map((t,a)=>e.jsx(d,{className:"h-4 w-full"},a))]}):m&&s.length===0?e.jsx("div",{className:"min-h-0 flex-1 px-2","data-slot":"profile-activity",children:e.jsx(E,{onRetry:()=>void p()})}):s.length===0?e.jsx("div",{className:"min-h-0 flex-1 px-4 py-8","data-slot":"profile-activity",children:e.jsx(u,{icon:j,headline:"Nothing on record yet",description:`What ${i.displayName} does shows up here.`})}):e.jsxs("div",{className:"min-h-0 flex-1 px-2 py-2","data-slot":"profile-activity",children:[y.map(t=>e.jsxs("section",{children:[e.jsx(T,{label:t.label}),e.jsx(N,{children:e.jsx(A,{children:t.items.map(a=>e.jsx(B,{item:a,compact:!0},a.id))})})]},t.label)),h&&e.jsx("div",{className:"flex justify-center py-3",children:e.jsxs(v,{variant:"outline",size:"sm",onClick:()=>void f(),disabled:n,className:"gap-2",children:[n&&e.jsx(g,{size:"xs"}),"Load 50 more"]})})]})}export{z as ActivityPage};
@@ -1 +1 @@
1
- import{b2 as x,cR as d,j as e,aa as u,Z as l,bV as m,cS as g,B as h}from"./index-BZKMWkth.js";import{b as f,c}from"./table-BJDpTBxJ.js";const k={tasks:{text:"text-purple-500",bg:"bg-purple-500/10",label:"Schedules"},relay:{text:"text-teal-500",bg:"bg-teal-500/10",label:"Messages"},agent:{text:"text-indigo-500",bg:"bg-indigo-500/10",label:"Agent"},config:{text:"text-amber-500",bg:"bg-amber-500/10",label:"Settings"},system:{text:"text-neutral-500",bg:"bg-neutral-500/10",label:"System"},permissions:{text:"text-sky-500",bg:"bg-sky-500/10",label:"Permissions"}},b={user:{text:"text-muted-foreground"},agent:{text:"text-foreground"},system:{icon:d,text:"text-neutral-500"},tasks:{icon:x,text:"text-purple-500"}};function p({actorType:s,actorLabel:r,agentColor:a,className:n}){const i=b[s],t=i.icon;return s==="user"?e.jsx(u,{shape:"pill",variant:"outline",className:l("text-muted-foreground",n),children:r}):s==="agent"?e.jsxs("span",{"data-slot":"actor-badge",className:l("inline-flex items-center gap-1.5 text-xs font-medium",i.text,n),children:[e.jsx("span",{className:"size-2 shrink-0 rounded-full",style:a?{backgroundColor:a}:void 0,"aria-hidden":!0}),e.jsx("span",{className:"truncate",children:r})]}):e.jsxs("span",{"data-slot":"actor-badge",className:l("inline-flex items-center gap-1 text-xs font-medium",i.text,n),children:[t&&e.jsx(t,{className:"size-3 shrink-0","aria-hidden":!0}),e.jsx("span",{children:r})]})}function y(s,r=new Date){const a=new Date(s),n=new Date(r);n.setHours(0,0,0,0);const i=new Date(n);i.setDate(i.getDate()-1);const t=new Date(n);t.setDate(t.getDate()-t.getDay());const o=a.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return a>=n?o:a>=i?`Yesterday ${o}`:a>=t?`${a.toLocaleDateString("en-US",{weekday:"long"})} ${o}`:a.toLocaleDateString("en-US",{month:"short",day:"numeric"})}function v({item:s,compact:r=!1,className:a}){const n=m(),i=y(s.occurredAt),t=s.linkPath?g(s.linkPath):null;return e.jsxs(f,{"data-slot":"activity-row","data-activity-row":t?"":void 0,tabIndex:t?0:void 0,onKeyDown:t?o=>{o.key==="Enter"&&n({href:t,replace:!1})}:void 0,className:l(t?"focus-visible:ring-ring focus-visible:ring-2 focus-visible:outline-none":"hover:bg-transparent",a),children:[!r&&e.jsxs(e.Fragment,{children:[e.jsx(c,{className:"w-28 py-1.5 pr-0 pl-2 max-sm:hidden",children:e.jsx("span",{className:"text-muted-foreground text-xs tabular-nums",children:i})}),e.jsx(c,{className:"w-24 py-1.5 pr-0 max-sm:hidden",children:e.jsx(p,{actorType:s.actorType,actorLabel:s.actorLabel})})]}),e.jsx(c,{className:l("max-w-0 py-1.5",r?"pl-2":"max-sm:pl-2"),children:e.jsxs("span",{className:"text-foreground/80 block truncate text-sm",children:[e.jsx("span",{className:l("text-muted-foreground mr-1 text-xs font-medium",!r&&"sm:hidden"),children:s.actorLabel}),s.summary]})}),e.jsx(c,{className:l("py-1.5 pr-2 text-right",r?"w-10":"w-16 max-sm:w-10"),children:t&&e.jsx(h,{variant:"ghost",size:"sm",className:"h-6 min-h-[44px] px-2 text-xs sm:min-h-0",onClick:()=>n({href:t,replace:!1}),children:"Open →"})})]})}export{v as A,k as C};
1
+ import{b2 as x,cR as d,j as e,aa as u,Z as l,bV as m,cS as g,B as h}from"./index-Dr-0P6rd.js";import{b as f,c}from"./table-P4N5xQn2.js";const k={tasks:{text:"text-purple-500",bg:"bg-purple-500/10",label:"Schedules"},relay:{text:"text-teal-500",bg:"bg-teal-500/10",label:"Messages"},agent:{text:"text-indigo-500",bg:"bg-indigo-500/10",label:"Agent"},config:{text:"text-amber-500",bg:"bg-amber-500/10",label:"Settings"},system:{text:"text-neutral-500",bg:"bg-neutral-500/10",label:"System"},permissions:{text:"text-sky-500",bg:"bg-sky-500/10",label:"Permissions"}},b={user:{text:"text-muted-foreground"},agent:{text:"text-foreground"},system:{icon:d,text:"text-neutral-500"},tasks:{icon:x,text:"text-purple-500"}};function p({actorType:s,actorLabel:r,agentColor:a,className:n}){const i=b[s],t=i.icon;return s==="user"?e.jsx(u,{shape:"pill",variant:"outline",className:l("text-muted-foreground",n),children:r}):s==="agent"?e.jsxs("span",{"data-slot":"actor-badge",className:l("inline-flex items-center gap-1.5 text-xs font-medium",i.text,n),children:[e.jsx("span",{className:"size-2 shrink-0 rounded-full",style:a?{backgroundColor:a}:void 0,"aria-hidden":!0}),e.jsx("span",{className:"truncate",children:r})]}):e.jsxs("span",{"data-slot":"actor-badge",className:l("inline-flex items-center gap-1 text-xs font-medium",i.text,n),children:[t&&e.jsx(t,{className:"size-3 shrink-0","aria-hidden":!0}),e.jsx("span",{children:r})]})}function y(s,r=new Date){const a=new Date(s),n=new Date(r);n.setHours(0,0,0,0);const i=new Date(n);i.setDate(i.getDate()-1);const t=new Date(n);t.setDate(t.getDate()-t.getDay());const o=a.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return a>=n?o:a>=i?`Yesterday ${o}`:a>=t?`${a.toLocaleDateString("en-US",{weekday:"long"})} ${o}`:a.toLocaleDateString("en-US",{month:"short",day:"numeric"})}function v({item:s,compact:r=!1,className:a}){const n=m(),i=y(s.occurredAt),t=s.linkPath?g(s.linkPath):null;return e.jsxs(f,{"data-slot":"activity-row","data-activity-row":t?"":void 0,tabIndex:t?0:void 0,onKeyDown:t?o=>{o.key==="Enter"&&n({href:t,replace:!1})}:void 0,className:l(t?"focus-visible:ring-ring focus-visible:ring-2 focus-visible:outline-none":"hover:bg-transparent",a),children:[!r&&e.jsxs(e.Fragment,{children:[e.jsx(c,{className:"w-28 py-1.5 pr-0 pl-2 max-sm:hidden",children:e.jsx("span",{className:"text-muted-foreground text-xs tabular-nums",children:i})}),e.jsx(c,{className:"w-24 py-1.5 pr-0 max-sm:hidden",children:e.jsx(p,{actorType:s.actorType,actorLabel:s.actorLabel})})]}),e.jsx(c,{className:l("max-w-0 py-1.5",r?"pl-2":"max-sm:pl-2"),children:e.jsxs("span",{className:"text-foreground/80 block truncate text-sm",children:[e.jsx("span",{className:l("text-muted-foreground mr-1 text-xs font-medium",!r&&"sm:hidden"),children:s.actorLabel}),s.summary]})}),e.jsx(c,{className:l("py-1.5 pr-2 text-right",r?"w-10":"w-16 max-sm:w-10"),children:t&&e.jsx(h,{variant:"ghost",size:"sm",className:"h-6 min-h-[44px] px-2 text-xs sm:min-h-0",onClick:()=>n({href:t,replace:!1}),children:"Open →"})})]})}export{v as A,k as C};
@@ -1 +1 @@
1
- import{bm as n,bn as o,j as c,bo as s,aJ as A}from"./index-BZKMWkth.js";const g={connected:n.success,disconnected:n.neutral,error:n.error,starting:`${n.warning} ${o}`,stopping:`${n.warning} ${o}`,reconnecting:`${n.warning} ${o}`},_={connected:"Connected",disconnected:"Ready",error:"Error",starting:"Connecting…",stopping:"Stopping…",reconnecting:"Reconnecting…"};function d({iconId:i,adapterType:a,size:t=16,className:r}){const e=s[i??""]??s[a??""];return e?c.jsx(e,{size:t,className:r}):c.jsx(A,{className:r,style:{width:t,height:t}})}export{d as A,g as a,_ as b};
1
+ import{bm as n,bn as o,j as c,bo as s,aJ as A}from"./index-Dr-0P6rd.js";const g={connected:n.success,disconnected:n.neutral,error:n.error,starting:`${n.warning} ${o}`,stopping:`${n.warning} ${o}`,reconnecting:`${n.warning} ${o}`},_={connected:"Connected",disconnected:"Ready",error:"Error",starting:"Connecting…",stopping:"Stopping…",reconnecting:"Reconnecting…"};function d({iconId:i,adapterType:a,size:t=16,className:r}){const e=s[i??""]??s[a??""];return e?c.jsx(e,{size:t,className:r}):c.jsx(A,{className:r,style:{width:t,height:t}})}export{d as A,g as a,_ as b};
@@ -1,2 +1,2 @@
1
- import{ae as be,af as Ne,ag as ze,ah as qe,j as e,cw as Ee,cx as Te,r as x,cy as ie,gF as $e,cz as oe,gG as le,ad as Me,cA as ce,cB as de,gH as ue,df as he,cC as pe,bl as K,a3 as Z,gI as xe,gJ as We,Z as I,dY as J,dZ as X,d_ as ee,d$ as se,e0 as te,I as re,e4 as me,$ as Ve,bk as Pe,B as k,gK as Se,e6 as De,e3 as ae,F as ke,b7 as Re,b6 as Oe,at as Le,g7 as ge,gL as _e,gM as Ge,gN as Ie,gO as Qe,gP as Ue,gQ as He,gR as Ye,gS as Ke,g3 as Ze,dw as Je,gT as Xe,cQ as G,eY as es,eZ as ss,e_ as ts,e$ as rs,f0 as as,f1 as ns,gU as fe,gV as H}from"./index-BZKMWkth.js";import{M as Q}from"./markdown-content-plNIomQc.js";function ws(s={}){const t=be(),a=Ne();return ze({mutationFn:({id:r,updates:l})=>t.updateBinding(r,l),onSuccess:()=>{a.invalidateQueries({queryKey:[...qe]})},meta:s.suppressErrorToast?{suppressErrorToast:!0}:{errorLabel:s.errorLabel??"Couldn’t update that connection"}})}function is({field:s,value:t,onChange:a,error:r,allValues:l}){const[i,n]=x.useState("");if(s.showWhen&&l[s.showWhen.field]!==s.showWhen.equals)return null;const o=`config-field-${s.key}`,v=s.type==="select"&&s.displayAs==="radio-cards",h=t!=null?String(t):"",m=h==="***",y=()=>{if(m){n("");return}if(s.pattern&&h&&!new RegExp(s.pattern).test(h)){n(s.patternMessage??"Check the format");return}n("")},d=r??i;if(s.type==="boolean")return e.jsxs("div",{children:[e.jsxs(ie,{orientation:"horizontal",className:"items-center justify-between gap-4",children:[e.jsxs($e,{className:"min-w-0",children:[e.jsxs(oe,{htmlFor:o,className:"text-sm font-medium",children:[s.label,s.required&&e.jsx("span",{"aria-hidden":"true",className:"text-destructive ml-0.5",children:"*"})]}),s.description&&e.jsx(le,{className:"text-xs",children:s.description})]}),e.jsx(Me,{id:o,checked:!!t,onCheckedChange:N=>a(s.key,N)})]}),s.helpMarkdown&&e.jsxs(ce,{children:[e.jsxs(de,{className:"text-muted-foreground hover:text-foreground mt-1 flex items-center gap-1 text-xs transition-colors",children:[e.jsx(ue,{className:"size-3"}),"Where do I find this?",e.jsx(he,{className:"size-3 transition-transform [[data-state=open]_&]:rotate-180"})]}),e.jsx(pe,{children:e.jsx("div",{className:"bg-muted/50 mt-2 rounded-md border p-3",children:e.jsx(Q,{content:s.helpMarkdown,className:"text-xs"})})})]}),e.jsx(K,{children:d&&e.jsx(Z.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.15},className:"overflow-hidden",children:e.jsx(xe,{className:"mt-1.5",children:d})})})]});const b=()=>{var N,C;switch(s.type){case"text":case"url":return e.jsx(re,{id:o,type:s.type==="url"?"url":"text",value:h,onChange:c=>a(s.key,c.target.value),placeholder:s.placeholder,"aria-invalid":!!d||void 0,"aria-required":s.required||void 0});case"password":return m?e.jsx(me,{id:o,value:h,showPassword:!1,onChange:c=>{a(s.key,c.target.value.trim()),i&&n("")},onFocus:()=>a(s.key,""),onBlur:y,placeholder:"Saved · type to replace"}):e.jsx(me,{id:o,value:h,visibleByDefault:s.visibleByDefault??!1,onChange:c=>{a(s.key,c.target.value.trim()),i&&n("")},onBlur:y,onPaste:()=>setTimeout(y,0),placeholder:s.placeholder,"aria-invalid":!!d||void 0,"aria-required":s.required||void 0});case"number":return e.jsx(re,{id:o,type:"number",value:h,onChange:c=>a(s.key,c.target.value?Number(c.target.value):void 0),placeholder:s.placeholder,"aria-invalid":!!d||void 0,"aria-required":s.required||void 0});case"select":return s.displayAs==="radio-cards"?e.jsx("div",{className:"grid grid-cols-2 gap-3",role:"radiogroup","aria-labelledby":`${o}-label`,"aria-required":s.required||void 0,children:(N=s.options)==null?void 0:N.map(c=>e.jsxs("button",{type:"button",role:"radio","aria-checked":h===c.value,onClick:()=>a(s.key,c.value),className:I("hover:bg-accent/50 focus-visible:border-ring focus-visible:ring-ring flex flex-col items-start rounded-md border p-3 text-left transition outline-none focus-visible:ring-[3px]",h===c.value&&"border-primary ring-primary bg-accent/30 ring-1"),children:[e.jsx("span",{className:"text-sm font-medium",children:c.label}),c.description&&e.jsx("span",{className:"text-muted-foreground mt-1 text-xs",children:c.description})]},c.value))}):e.jsxs(J,{value:h,onValueChange:c=>a(s.key,c),children:[e.jsx(X,{id:o,"aria-invalid":!!d||void 0,"aria-required":s.required||void 0,children:e.jsx(ee,{placeholder:s.placeholder??"Select…"})}),e.jsx(se,{children:(C=s.options)==null?void 0:C.map(c=>e.jsx(te,{value:c.value,children:c.label},c.value))})]});case"textarea":return e.jsx(We,{id:o,value:h,onChange:c=>a(s.key,c.target.value),placeholder:s.placeholder,rows:3,"aria-invalid":!!d||void 0,"aria-required":s.required||void 0});default:return null}};return e.jsxs(ie,{children:[e.jsxs(oe,{id:`${o}-label`,htmlFor:v?void 0:o,children:[s.label,s.required&&!m&&e.jsx("span",{"aria-hidden":"true",className:"text-destructive ml-0.5",children:"*"})]}),b(),s.description&&e.jsx(le,{className:"text-xs",children:s.description}),s.helpMarkdown&&e.jsxs(ce,{children:[e.jsxs(de,{className:"text-muted-foreground hover:text-foreground mt-1 flex items-center gap-1 text-xs transition-colors",children:[e.jsx(ue,{className:"size-3"}),"Where do I find this?",e.jsx(he,{className:"size-3 transition-transform [[data-state=open]_&]:rotate-180"})]}),e.jsx(pe,{children:e.jsx("div",{className:"bg-muted/50 mt-2 rounded-md border p-3",children:e.jsx(Q,{content:s.helpMarkdown,className:"text-xs"})})})]}),e.jsx(K,{children:d&&e.jsx(Z.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.15},className:"overflow-hidden",children:e.jsx(xe,{children:d})})})]})}function os(s,t){return s.showWhen?t[s.showWhen.field]===s.showWhen.equals:!0}function ls({fields:s,allValues:t,renderField:a}){const r=new Map;for(const l of s){const i=l.section;r.has(i)||r.set(i,[]),r.get(i).push(l)}return e.jsx("div",{className:"space-y-6",children:Array.from(r.entries()).map(([l,i])=>{const n=i.filter(o=>os(o,t));return n.length===0?null:e.jsxs("div",{className:"space-y-3",children:[l&&e.jsx("h4",{className:"text-sm font-semibold",children:l}),e.jsx(Ee,{children:e.jsx(Te,{children:n.map(o=>a(o))})})]},l??"__default")})})}const je=["agent","configure","test","confirm"],cs={agent:"Agent",configure:"Set up",test:"Check",confirm:"Review"};function ds({current:s,showAgentStep:t}){const a=t?je:je.filter(l=>l!=="agent"),r=a.indexOf(s);return e.jsx("div",{className:"flex items-start justify-between px-1",role:"navigation","aria-label":"Setup steps",children:a.map((l,i)=>{const n=i<r,o=i===r,v=i>r;return e.jsxs(x.Fragment,{children:[i>0&&e.jsx("div",{className:I("mt-3 h-px flex-1",n||o?"bg-primary":"border-muted-foreground/40 border-t border-dashed")}),e.jsxs("div",{className:"flex flex-col items-center gap-1",children:[e.jsx("div",{className:I("flex size-6 items-center justify-center rounded-full text-xs font-medium",n&&"bg-primary text-primary-foreground",o&&"bg-primary text-primary-foreground ring-primary/30 ring-2",v&&"border-muted-foreground text-muted-foreground border"),"aria-current":o?"step":void 0,children:n?e.jsx(Ve,{className:"size-3"}):i+1}),e.jsx("span",{className:I("text-3xs",o?"text-foreground font-medium":"text-muted-foreground"),children:cs[l]})]})]},l)})})}function us({manifest:s,label:t,onLabelChange:a,fields:r,form:l,currentSetupStep:i,hasSetupGuide:n,onOpenGuide:o}){const{Subscribe:v,AppField:h}=l;return e.jsxs("div",{className:"space-y-4",children:[s.setupInstructions&&e.jsxs("div",{className:"flex gap-2 rounded-md border border-blue-200 bg-blue-50 p-3 text-sm text-blue-800 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-200",children:[e.jsx(Pe,{className:"mt-0.5 size-4 shrink-0"}),e.jsx(Q,{content:s.setupInstructions,className:"text-sm text-blue-800 dark:text-blue-200"})]}),(s.actionButton||n)&&e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[n&&e.jsxs(k,{type:"button",variant:"outline",size:"sm",onClick:o,children:[e.jsx(Se,{className:"mr-1.5 size-3.5"}),"Setup guide"]}),s.actionButton&&e.jsx(k,{asChild:!0,type:"button",variant:"outline",size:"sm",children:e.jsx(De,{href:s.actionButton.url,children:s.actionButton.label})})]}),i&&e.jsx("h4",{className:"text-sm font-medium",children:i.title}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{htmlFor:"adapter-label",children:"Name (optional)"}),e.jsx(re,{id:"adapter-label",placeholder:s.displayName,value:t,onChange:m=>a(m.target.value)}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Helps you tell this connection apart."})]}),e.jsx(v,{selector:m=>m.values,children:m=>e.jsx(ls,{fields:r,allValues:m,renderField:y=>e.jsx(h,{name:y.key,children:d=>{var b;return e.jsx(is,{field:y,value:d.state.value,onChange:(N,C)=>d.handleChange(C),onBlur:d.handleBlur,error:d.state.meta.isTouched?(b=d.state.meta.errors[0])==null?void 0:b.toString():void 0,allValues:m})}},y.key)})})]})}function hs({isPending:s,isSuccess:t,isError:a,errorMessage:r,botUsername:l,onRetry:i}){return e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[s&&e.jsxs(e.Fragment,{children:[e.jsx(ke,{size:"lg",className:"text-muted-foreground"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Trying to reach it…"})]}),t&&e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx(Re,{className:"text-status-success size-8"}),e.jsx("p",{className:"text-status-success-fg text-sm",children:"Reachable"}),l&&e.jsx("div",{className:"flex items-center gap-2 rounded-md border px-3 py-2 text-sm",children:e.jsxs("span",{className:"font-mono",children:["@",l]})})]}),a&&e.jsxs(e.Fragment,{children:[e.jsx(Oe,{className:"text-destructive size-8"}),e.jsx("p",{className:"text-destructive text-sm",children:"Not reachable"}),r&&e.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-red-200 bg-red-50 p-3 text-xs text-red-700 dark:border-red-800 dark:bg-red-950 dark:text-red-300",children:[e.jsx(Le,{className:"mt-0.5 size-3 shrink-0"}),e.jsx("span",{children:r})]}),e.jsx(k,{variant:"outline",size:"sm",onClick:i,children:"Retry"})]})]})}function ps(s){return s.length>8?"•••• "+s.slice(-4):"•••"}function xs({manifest:s,adapterId:t,isEditMode:a,values:r,botUsername:l,agentName:i}){return e.jsxs("div",{className:"space-y-3",children:[!a&&i&&e.jsxs("p",{className:"bg-accent/30 rounded-md border px-3 py-2 text-sm",children:["Messages here go to ",e.jsx("span",{className:"font-medium",children:i}),"."]}),!a&&e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Connection ID"}),e.jsx("span",{className:"font-mono",children:t})]}),s.configFields.map(n=>{if(n.showWhen&&r[n.showWhen.field]!==n.showWhen.equals)return null;const o=String(r[n.key]??""),v=n.type==="password"?ps(o):o;return e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:n.label}),e.jsx("span",{className:"max-w-[200px] truncate font-mono",children:v})]},n.key)}),l&&s.type==="telegram"&&e.jsxs("a",{href:`https://t.me/${l}`,target:"_blank",rel:"noopener noreferrer",className:"text-primary inline-flex items-center gap-1.5 text-sm underline-offset-4 hover:underline",children:["Message @",l," in Telegram"]})]})}const ye=[{value:"per-chat",label:"One shared chat per group or channel",hint:"Everyone there shares one chat with the agent."},{value:"per-user",label:"One chat per person",hint:"Each person gets their own chat, even in a group."},{value:"stateless",label:"A fresh start every message",hint:"Nothing carries over from the message before."}];function ms({agentOptions:s,agentId:t,onAgentIdChange:a,strategy:r,onStrategyChange:l}){var n;const i=s.length===1?s[0]:void 0;return x.useEffect(()=>{i&&!t&&a(i.id)},[i,t,a]),s.length===0?e.jsx("p",{role:"alert",className:"text-muted-foreground rounded-md border border-dashed px-4 py-6 text-center text-sm",children:"No agents yet. Add one from the Team page first."}):e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-muted-foreground text-sm",children:"Messages here go to this agent."}),i?e.jsxs("div",{className:"bg-accent/30 rounded-md border px-4 py-3 text-sm",children:[e.jsx("span",{className:"font-medium",children:ge(i)})," will answer."]}):e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{htmlFor:"wizard-agent",children:"Who should answer?"}),e.jsxs(J,{value:t,onValueChange:a,children:[e.jsx(X,{id:"wizard-agent",className:"w-full",children:e.jsx(ee,{placeholder:"Pick an agent"})}),e.jsx(se,{children:s.map(o=>e.jsx(te,{value:o.id,children:ge(o)},o.id))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{htmlFor:"wizard-memory",children:"How the agent remembers"}),e.jsxs(J,{value:r,onValueChange:o=>l(o),children:[e.jsx(X,{id:"wizard-memory",className:"w-full",children:e.jsx(ee,{})}),e.jsx(se,{children:ye.map(o=>e.jsx(te,{value:o.value,children:o.label},o.value))})]}),e.jsx("p",{className:"text-muted-foreground text-xs",children:(n=ye.find(o=>o.value===r))==null?void 0:n.hint})]})]})}function gs({open:s,onOpenChange:t,title:a,content:r}){return e.jsx(_e,{open:s,onOpenChange:t,children:e.jsxs(Ge,{side:"right",className:"w-[480px] overflow-y-auto sm:max-w-lg",children:[e.jsxs(Ie,{children:[e.jsxs(Qe,{className:"flex items-center gap-2",children:[e.jsx(Se,{className:"size-4"}),a," setup guide"]}),e.jsx(Ue,{children:"Step-by-step setup instructions."})]}),e.jsx("div",{className:"mt-4 px-4",children:e.jsx(Q,{content:r})})]})})}function we(s){const t=s.setupSteps;if(!t||t.length===0)return[];const a=new Set(t.flatMap(r=>r.fields));return s.configFields.filter(r=>!a.has(r.key))}function fs(s,t){return typeof t=="string"||t===void 0||t===null?t:s.valueShape==="id-list"?Array.isArray(t)?t.join(`
1
+ import{ae as be,af as Ne,ag as ze,ah as qe,j as e,cw as Ee,cx as Te,r as x,cy as ie,gF as $e,cz as oe,gG as le,ad as Me,cA as ce,cB as de,gH as ue,df as he,cC as pe,bl as K,a3 as Z,gI as xe,gJ as We,Z as I,dY as J,dZ as X,d_ as ee,d$ as se,e0 as te,I as re,e4 as me,$ as Ve,bk as Pe,B as k,gK as Se,e6 as De,e3 as ae,F as ke,b7 as Re,b6 as Oe,at as Le,g7 as ge,gL as _e,gM as Ge,gN as Ie,gO as Qe,gP as Ue,gQ as He,gR as Ye,gS as Ke,g3 as Ze,dw as Je,gT as Xe,cQ as G,eY as es,eZ as ss,e_ as ts,e$ as rs,f0 as as,f1 as ns,gU as fe,gV as H}from"./index-Dr-0P6rd.js";import{M as Q}from"./markdown-content-aNzh-54y.js";function ws(s={}){const t=be(),a=Ne();return ze({mutationFn:({id:r,updates:l})=>t.updateBinding(r,l),onSuccess:()=>{a.invalidateQueries({queryKey:[...qe]})},meta:s.suppressErrorToast?{suppressErrorToast:!0}:{errorLabel:s.errorLabel??"Couldn’t update that connection"}})}function is({field:s,value:t,onChange:a,error:r,allValues:l}){const[i,n]=x.useState("");if(s.showWhen&&l[s.showWhen.field]!==s.showWhen.equals)return null;const o=`config-field-${s.key}`,v=s.type==="select"&&s.displayAs==="radio-cards",h=t!=null?String(t):"",m=h==="***",y=()=>{if(m){n("");return}if(s.pattern&&h&&!new RegExp(s.pattern).test(h)){n(s.patternMessage??"Check the format");return}n("")},d=r??i;if(s.type==="boolean")return e.jsxs("div",{children:[e.jsxs(ie,{orientation:"horizontal",className:"items-center justify-between gap-4",children:[e.jsxs($e,{className:"min-w-0",children:[e.jsxs(oe,{htmlFor:o,className:"text-sm font-medium",children:[s.label,s.required&&e.jsx("span",{"aria-hidden":"true",className:"text-destructive ml-0.5",children:"*"})]}),s.description&&e.jsx(le,{className:"text-xs",children:s.description})]}),e.jsx(Me,{id:o,checked:!!t,onCheckedChange:N=>a(s.key,N)})]}),s.helpMarkdown&&e.jsxs(ce,{children:[e.jsxs(de,{className:"text-muted-foreground hover:text-foreground mt-1 flex items-center gap-1 text-xs transition-colors",children:[e.jsx(ue,{className:"size-3"}),"Where do I find this?",e.jsx(he,{className:"size-3 transition-transform [[data-state=open]_&]:rotate-180"})]}),e.jsx(pe,{children:e.jsx("div",{className:"bg-muted/50 mt-2 rounded-md border p-3",children:e.jsx(Q,{content:s.helpMarkdown,className:"text-xs"})})})]}),e.jsx(K,{children:d&&e.jsx(Z.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.15},className:"overflow-hidden",children:e.jsx(xe,{className:"mt-1.5",children:d})})})]});const b=()=>{var N,C;switch(s.type){case"text":case"url":return e.jsx(re,{id:o,type:s.type==="url"?"url":"text",value:h,onChange:c=>a(s.key,c.target.value),placeholder:s.placeholder,"aria-invalid":!!d||void 0,"aria-required":s.required||void 0});case"password":return m?e.jsx(me,{id:o,value:h,showPassword:!1,onChange:c=>{a(s.key,c.target.value.trim()),i&&n("")},onFocus:()=>a(s.key,""),onBlur:y,placeholder:"Saved · type to replace"}):e.jsx(me,{id:o,value:h,visibleByDefault:s.visibleByDefault??!1,onChange:c=>{a(s.key,c.target.value.trim()),i&&n("")},onBlur:y,onPaste:()=>setTimeout(y,0),placeholder:s.placeholder,"aria-invalid":!!d||void 0,"aria-required":s.required||void 0});case"number":return e.jsx(re,{id:o,type:"number",value:h,onChange:c=>a(s.key,c.target.value?Number(c.target.value):void 0),placeholder:s.placeholder,"aria-invalid":!!d||void 0,"aria-required":s.required||void 0});case"select":return s.displayAs==="radio-cards"?e.jsx("div",{className:"grid grid-cols-2 gap-3",role:"radiogroup","aria-labelledby":`${o}-label`,"aria-required":s.required||void 0,children:(N=s.options)==null?void 0:N.map(c=>e.jsxs("button",{type:"button",role:"radio","aria-checked":h===c.value,onClick:()=>a(s.key,c.value),className:I("hover:bg-accent/50 focus-visible:border-ring focus-visible:ring-ring flex flex-col items-start rounded-md border p-3 text-left transition outline-none focus-visible:ring-[3px]",h===c.value&&"border-primary ring-primary bg-accent/30 ring-1"),children:[e.jsx("span",{className:"text-sm font-medium",children:c.label}),c.description&&e.jsx("span",{className:"text-muted-foreground mt-1 text-xs",children:c.description})]},c.value))}):e.jsxs(J,{value:h,onValueChange:c=>a(s.key,c),children:[e.jsx(X,{id:o,"aria-invalid":!!d||void 0,"aria-required":s.required||void 0,children:e.jsx(ee,{placeholder:s.placeholder??"Select…"})}),e.jsx(se,{children:(C=s.options)==null?void 0:C.map(c=>e.jsx(te,{value:c.value,children:c.label},c.value))})]});case"textarea":return e.jsx(We,{id:o,value:h,onChange:c=>a(s.key,c.target.value),placeholder:s.placeholder,rows:3,"aria-invalid":!!d||void 0,"aria-required":s.required||void 0});default:return null}};return e.jsxs(ie,{children:[e.jsxs(oe,{id:`${o}-label`,htmlFor:v?void 0:o,children:[s.label,s.required&&!m&&e.jsx("span",{"aria-hidden":"true",className:"text-destructive ml-0.5",children:"*"})]}),b(),s.description&&e.jsx(le,{className:"text-xs",children:s.description}),s.helpMarkdown&&e.jsxs(ce,{children:[e.jsxs(de,{className:"text-muted-foreground hover:text-foreground mt-1 flex items-center gap-1 text-xs transition-colors",children:[e.jsx(ue,{className:"size-3"}),"Where do I find this?",e.jsx(he,{className:"size-3 transition-transform [[data-state=open]_&]:rotate-180"})]}),e.jsx(pe,{children:e.jsx("div",{className:"bg-muted/50 mt-2 rounded-md border p-3",children:e.jsx(Q,{content:s.helpMarkdown,className:"text-xs"})})})]}),e.jsx(K,{children:d&&e.jsx(Z.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.15},className:"overflow-hidden",children:e.jsx(xe,{children:d})})})]})}function os(s,t){return s.showWhen?t[s.showWhen.field]===s.showWhen.equals:!0}function ls({fields:s,allValues:t,renderField:a}){const r=new Map;for(const l of s){const i=l.section;r.has(i)||r.set(i,[]),r.get(i).push(l)}return e.jsx("div",{className:"space-y-6",children:Array.from(r.entries()).map(([l,i])=>{const n=i.filter(o=>os(o,t));return n.length===0?null:e.jsxs("div",{className:"space-y-3",children:[l&&e.jsx("h4",{className:"text-sm font-semibold",children:l}),e.jsx(Ee,{children:e.jsx(Te,{children:n.map(o=>a(o))})})]},l??"__default")})})}const je=["agent","configure","test","confirm"],cs={agent:"Agent",configure:"Set up",test:"Check",confirm:"Review"};function ds({current:s,showAgentStep:t}){const a=t?je:je.filter(l=>l!=="agent"),r=a.indexOf(s);return e.jsx("div",{className:"flex items-start justify-between px-1",role:"navigation","aria-label":"Setup steps",children:a.map((l,i)=>{const n=i<r,o=i===r,v=i>r;return e.jsxs(x.Fragment,{children:[i>0&&e.jsx("div",{className:I("mt-3 h-px flex-1",n||o?"bg-primary":"border-muted-foreground/40 border-t border-dashed")}),e.jsxs("div",{className:"flex flex-col items-center gap-1",children:[e.jsx("div",{className:I("flex size-6 items-center justify-center rounded-full text-xs font-medium",n&&"bg-primary text-primary-foreground",o&&"bg-primary text-primary-foreground ring-primary/30 ring-2",v&&"border-muted-foreground text-muted-foreground border"),"aria-current":o?"step":void 0,children:n?e.jsx(Ve,{className:"size-3"}):i+1}),e.jsx("span",{className:I("text-3xs",o?"text-foreground font-medium":"text-muted-foreground"),children:cs[l]})]})]},l)})})}function us({manifest:s,label:t,onLabelChange:a,fields:r,form:l,currentSetupStep:i,hasSetupGuide:n,onOpenGuide:o}){const{Subscribe:v,AppField:h}=l;return e.jsxs("div",{className:"space-y-4",children:[s.setupInstructions&&e.jsxs("div",{className:"flex gap-2 rounded-md border border-blue-200 bg-blue-50 p-3 text-sm text-blue-800 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-200",children:[e.jsx(Pe,{className:"mt-0.5 size-4 shrink-0"}),e.jsx(Q,{content:s.setupInstructions,className:"text-sm text-blue-800 dark:text-blue-200"})]}),(s.actionButton||n)&&e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[n&&e.jsxs(k,{type:"button",variant:"outline",size:"sm",onClick:o,children:[e.jsx(Se,{className:"mr-1.5 size-3.5"}),"Setup guide"]}),s.actionButton&&e.jsx(k,{asChild:!0,type:"button",variant:"outline",size:"sm",children:e.jsx(De,{href:s.actionButton.url,children:s.actionButton.label})})]}),i&&e.jsx("h4",{className:"text-sm font-medium",children:i.title}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{htmlFor:"adapter-label",children:"Name (optional)"}),e.jsx(re,{id:"adapter-label",placeholder:s.displayName,value:t,onChange:m=>a(m.target.value)}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Helps you tell this connection apart."})]}),e.jsx(v,{selector:m=>m.values,children:m=>e.jsx(ls,{fields:r,allValues:m,renderField:y=>e.jsx(h,{name:y.key,children:d=>{var b;return e.jsx(is,{field:y,value:d.state.value,onChange:(N,C)=>d.handleChange(C),onBlur:d.handleBlur,error:d.state.meta.isTouched?(b=d.state.meta.errors[0])==null?void 0:b.toString():void 0,allValues:m})}},y.key)})})]})}function hs({isPending:s,isSuccess:t,isError:a,errorMessage:r,botUsername:l,onRetry:i}){return e.jsxs("div",{className:"flex flex-col items-center gap-3 py-6",children:[s&&e.jsxs(e.Fragment,{children:[e.jsx(ke,{size:"lg",className:"text-muted-foreground"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Trying to reach it…"})]}),t&&e.jsxs("div",{className:"flex flex-col items-center gap-2",children:[e.jsx(Re,{className:"text-status-success size-8"}),e.jsx("p",{className:"text-status-success-fg text-sm",children:"Reachable"}),l&&e.jsx("div",{className:"flex items-center gap-2 rounded-md border px-3 py-2 text-sm",children:e.jsxs("span",{className:"font-mono",children:["@",l]})})]}),a&&e.jsxs(e.Fragment,{children:[e.jsx(Oe,{className:"text-destructive size-8"}),e.jsx("p",{className:"text-destructive text-sm",children:"Not reachable"}),r&&e.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-red-200 bg-red-50 p-3 text-xs text-red-700 dark:border-red-800 dark:bg-red-950 dark:text-red-300",children:[e.jsx(Le,{className:"mt-0.5 size-3 shrink-0"}),e.jsx("span",{children:r})]}),e.jsx(k,{variant:"outline",size:"sm",onClick:i,children:"Retry"})]})]})}function ps(s){return s.length>8?"•••• "+s.slice(-4):"•••"}function xs({manifest:s,adapterId:t,isEditMode:a,values:r,botUsername:l,agentName:i}){return e.jsxs("div",{className:"space-y-3",children:[!a&&i&&e.jsxs("p",{className:"bg-accent/30 rounded-md border px-3 py-2 text-sm",children:["Messages here go to ",e.jsx("span",{className:"font-medium",children:i}),"."]}),!a&&e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Connection ID"}),e.jsx("span",{className:"font-mono",children:t})]}),s.configFields.map(n=>{if(n.showWhen&&r[n.showWhen.field]!==n.showWhen.equals)return null;const o=String(r[n.key]??""),v=n.type==="password"?ps(o):o;return e.jsxs("div",{className:"flex justify-between text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:n.label}),e.jsx("span",{className:"max-w-[200px] truncate font-mono",children:v})]},n.key)}),l&&s.type==="telegram"&&e.jsxs("a",{href:`https://t.me/${l}`,target:"_blank",rel:"noopener noreferrer",className:"text-primary inline-flex items-center gap-1.5 text-sm underline-offset-4 hover:underline",children:["Message @",l," in Telegram"]})]})}const ye=[{value:"per-chat",label:"One shared chat per group or channel",hint:"Everyone there shares one chat with the agent."},{value:"per-user",label:"One chat per person",hint:"Each person gets their own chat, even in a group."},{value:"stateless",label:"A fresh start every message",hint:"Nothing carries over from the message before."}];function ms({agentOptions:s,agentId:t,onAgentIdChange:a,strategy:r,onStrategyChange:l}){var n;const i=s.length===1?s[0]:void 0;return x.useEffect(()=>{i&&!t&&a(i.id)},[i,t,a]),s.length===0?e.jsx("p",{role:"alert",className:"text-muted-foreground rounded-md border border-dashed px-4 py-6 text-center text-sm",children:"No agents yet. Add one from the Team page first."}):e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-muted-foreground text-sm",children:"Messages here go to this agent."}),i?e.jsxs("div",{className:"bg-accent/30 rounded-md border px-4 py-3 text-sm",children:[e.jsx("span",{className:"font-medium",children:ge(i)})," will answer."]}):e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{htmlFor:"wizard-agent",children:"Who should answer?"}),e.jsxs(J,{value:t,onValueChange:a,children:[e.jsx(X,{id:"wizard-agent",className:"w-full",children:e.jsx(ee,{placeholder:"Pick an agent"})}),e.jsx(se,{children:s.map(o=>e.jsx(te,{value:o.id,children:ge(o)},o.id))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(ae,{htmlFor:"wizard-memory",children:"How the agent remembers"}),e.jsxs(J,{value:r,onValueChange:o=>l(o),children:[e.jsx(X,{id:"wizard-memory",className:"w-full",children:e.jsx(ee,{})}),e.jsx(se,{children:ye.map(o=>e.jsx(te,{value:o.value,children:o.label},o.value))})]}),e.jsx("p",{className:"text-muted-foreground text-xs",children:(n=ye.find(o=>o.value===r))==null?void 0:n.hint})]})]})}function gs({open:s,onOpenChange:t,title:a,content:r}){return e.jsx(_e,{open:s,onOpenChange:t,children:e.jsxs(Ge,{side:"right",className:"w-[480px] overflow-y-auto sm:max-w-lg",children:[e.jsxs(Ie,{children:[e.jsxs(Qe,{className:"flex items-center gap-2",children:[e.jsx(Se,{className:"size-4"}),a," setup guide"]}),e.jsx(Ue,{children:"Step-by-step setup instructions."})]}),e.jsx("div",{className:"mt-4 px-4",children:e.jsx(Q,{content:r})})]})})}function we(s){const t=s.setupSteps;if(!t||t.length===0)return[];const a=new Set(t.flatMap(r=>r.fields));return s.configFields.filter(r=>!a.has(r.key))}function fs(s,t){return typeof t=="string"||t===void 0||t===null?t:s.valueShape==="id-list"?Array.isArray(t)?t.join(`
2
2
  `):t:s.valueShape==="json-object"&&typeof t=="object"?JSON.stringify(t,null,2):t}function js(s,t){const a=s.setupSteps;if(!a||a.length===0)return s.configFields;const r=a[t];if(!r)return s.configFields;const l=s.configFields.filter(i=>r.fields.includes(i.key));return t!==a.length-1?l:[...l,...we(s)]}const ys="Advanced";function Y(s){const t={};for(const[a,r]of Object.entries(s)){const l=a.split(".");let i=t;for(let n=0;n<l.length-1;n++){const o=l[n];(!(o in i)||typeof i[o]!="object"||i[o]===null)&&(i[o]={}),i=i[o]}i[l[l.length-1]]=r}return t}function ve(s,t){const a=t.split(".");let r=s;for(const l of a){if(r==null||typeof r!="object")return;r=r[l]}return r}function vs(s,t){const a={};for(const r of s.configFields){const l=t?ve(t,r.key):void 0;l!==void 0&&r.type!=="password"?a[r.key]=fs(r,l):r.type==="password"&&t&&ve(t,r.key)!==void 0?a[r.key]="***":r.default!==void 0?a[r.key]=r.default:a[r.key]=r.type==="boolean"?!1:""}return a}function bs(s,t=[]){const a=s.type;if(!t.includes(a))return a;let r=2;for(;t.includes(`${a}-${r}`);)r++;return`${a}-${r}`}function Ns({manifest:s,existingInstance:t,existingAdapterIds:a=[],onOpenChange:r}){const l=!!t,[i,n]=x.useState(t?"configure":"agent"),[o,v]=x.useState(!1),[h]=x.useState(()=>(t==null?void 0:t.id)??bs(s,a)),[m,y]=x.useState(()=>{var p;return((p=t==null?void 0:t.config)==null?void 0:p.label)??""}),[d,b]=x.useState(0),[N,C]=x.useState(""),[c,D]=x.useState(""),[$,R]=x.useState("per-chat"),E=He(),z=Ye(),S=Ke(),M=Ze(),{data:F}=Je(),w=be(),q=Ne(),T=(F==null?void 0:F.agents)??[],B=s.setupSteps&&s.setupSteps.length>0,j=Xe({defaultValues:vs(s,t==null?void 0:t.config),validators:{onSubmit:({value:p})=>{const g={};for(const u of s.configFields)if(!(u.showWhen&&p[u.showWhen.field]!==u.showWhen.equals)&&u.required){const f=p[u.key];(f==null||f==="")&&(g[u.key]=`${u.label} is required`)}return Object.keys(g).length>0?{fields:g}:void 0}},onSubmit:async()=>{}}),W=x.useMemo(()=>{const p=new Set(we(s).map(g=>g.key));return js(s,d).map(g=>p.has(g.key)&&!g.section?{...g,section:ys}:g)},[s,d]),O=x.useCallback(()=>{const p=j.state.values;let g=!0;for(const u of W)if(!(u.showWhen&&p[u.showWhen.field]!==u.showWhen.equals)&&u.required){const f=p[u.key];(f==null||f==="")&&(j.setFieldMeta(u.key,A=>({...A,isTouched:!0,errors:[`${u.label} is required`],errorMap:{onSubmit:`${u.label} is required`}})),g=!1)}return g},[j,W]),L=x.useCallback(()=>{if(i==="agent"){if(!c)return;n("configure");return}if(i==="configure"){if(!O())return;if(B&&s.setupSteps&&d<s.setupSteps.length-1){b(u=>u+1);return}const g=j.state.values;n("test"),S.mutate({type:s.type,config:Y(g)},{onSuccess:u=>{u.botUsername&&(C(u.botUsername),m||y(`@${u.botUsername}`))}})}else i==="test"&&n("confirm")},[i,c,B,s,d,O,j,S,m]),V=x.useCallback(()=>{i==="test"?(n("configure"),S.reset()):i==="confirm"?n("test"):i==="configure"&&(B&&d>0?b(p=>p-1):l||n("agent"))},[i,B,d,S,l]),P=x.useCallback(async p=>{try{return await w.removeRelayAdapter(p),!0}catch{return!1}finally{q.invalidateQueries({queryKey:["relay"]})}},[w,q]),U=x.useCallback(()=>{const p=j.state.values,g=Y(p),u=m?{...g,label:m}:g;if(l&&t){z.mutate({id:t.id,config:u},{onSuccess:()=>r(!1)});return}if(!c){n("agent");return}E.mutate({type:s.type,id:h,config:u},{onSuccess:()=>{M.mutate({adapterId:h,agentId:c,sessionStrategy:$,label:""},{onSuccess:()=>{var A;const f=((A=T.find(_=>_.id===c))==null?void 0:A.name)??c;G.success(`${s.displayName} is connected`,{description:`Messages here go to ${f}.`}),r(!1)},onError:f=>{n("agent"),P(h).then(A=>{A?G.error("Nothing was set up",{description:`${s.displayName} couldn’t be linked to an agent, so it wasn’t saved. ${f.message}`}):G.error("Couldn’t finish undoing",{description:`${s.displayName} was added with no agent to answer it. Remove it from Messaging. ${f.message}`})})}})},onError:f=>{var A,_,ne;(A=f.message)!=null&&A.includes("timed out")?G.error(`Couldn’t reach ${s.displayName}`,{description:"Check your token and network, then try again."}):((_=f.message)!=null&&_.includes("duplicate")||(ne=f.message)!=null&&ne.includes("exists"))&&(n("configure"),b(0))}})},[j,l,t,z,E,M,s,h,m,c,$,T,P,r]),Ce=x.useCallback(p=>{p||(n(l?"configure":"agent"),b(0),y(""),C(""),D(""),R("per-chat"),v(!1),j.reset(),S.reset()),r(p)},[r,j,S,l]),Ae=x.useCallback(()=>{S.mutate({type:s.type,config:Y(j.state.values)})},[S,s.type,j]),Fe=E.isPending||z.isPending||M.isPending,Be=B&&s.setupSteps?s.setupSteps[d]:void 0;return{step:i,isEditMode:l,adapterId:h,label:m,setLabel:y,botUsername:N,guideOpen:o,setGuideOpen:v,form:j,visibleFields:W,bindAgentId:c,setBindAgentId:D,bindStrategy:$,setBindStrategy:R,agentOptions:T,isSaving:Fe,hasSetupSteps:B,setupStepIndex:d,currentSetupStep:Be,testConnection:S,handleContinue:L,handleBack:V,handleSave:U,handleOpenChange:Ce,handleRetryTest:Ae}}function Cs({open:s,onOpenChange:t,manifest:a,existingInstance:r,existingAdapterIds:l=[]}){var L;const i=Ns({manifest:a,existingInstance:r,existingAdapterIds:l,onOpenChange:t}),{step:n,isEditMode:o,adapterId:v,label:h,setLabel:m,botUsername:y,guideOpen:d,setGuideOpen:b,form:N,visibleFields:C,bindAgentId:c,setBindAgentId:D,bindStrategy:$,setBindStrategy:R,agentOptions:E,isSaving:z,hasSetupSteps:S,setupStepIndex:M,currentSetupStep:F,testConnection:w,handleContinue:q,handleBack:T,handleSave:B,handleOpenChange:j,handleRetryTest:W}=i,O={agent:"Pick who answers messages here.",configure:(F==null?void 0:F.description)??"Fill in the settings this needs.",test:"Checking the connection…",confirm:"Check it over, then save."}[n];return e.jsxs(x.Fragment,{children:[e.jsx(es,{open:s,onOpenChange:j,children:e.jsxs(ss,{className:"flex max-h-[85vh] max-w-lg flex-col",children:[e.jsxs(ts,{children:[e.jsx(rs,{children:o?`Edit ${a.displayName}`:`Add ${a.displayName}`}),e.jsx(as,{children:O})]}),e.jsxs("div",{className:"min-h-0 space-y-4 overflow-y-auto py-2",children:[e.jsx(ds,{current:n,showAgentStep:!o}),e.jsx(K,{mode:"wait",children:e.jsxs(Z.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:[n==="agent"&&e.jsx(ms,{agentOptions:E,agentId:c,onAgentIdChange:D,strategy:$,onStrategyChange:R}),n==="configure"&&e.jsx(us,{manifest:a,label:h,onLabelChange:m,fields:C,form:N,currentSetupStep:F,hasSetupGuide:!!a.setupGuide,onOpenGuide:()=>b(!0)}),n==="test"&&e.jsx(hs,{isPending:w.isPending,isSuccess:w.isSuccess,isError:w.isError,errorMessage:(L=w.error)==null?void 0:L.message,botUsername:y,onRetry:W}),n==="confirm"&&e.jsx(N.Subscribe,{selector:V=>V.values,children:V=>{var P;return e.jsx(xs,{manifest:a,adapterId:v,isEditMode:o,values:V,botUsername:y,agentName:((P=E.find(U=>U.id===c))==null?void 0:P.name)||c})}})]},n)})]}),e.jsxs(ns,{className:"flex items-center justify-between sm:justify-between",children:[e.jsxs("div",{children:[(n==="test"||n==="confirm")&&e.jsxs(k,{variant:"ghost",onClick:T,disabled:z,children:[e.jsx(fe,{className:"mr-1 size-4"}),"Back"]}),n==="configure"&&(S?M>0:!o)&&e.jsxs(k,{variant:"ghost",onClick:T,children:[e.jsx(fe,{className:"mr-1 size-4"}),"Back"]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(k,{variant:"outline",onClick:()=>j(!1),children:"Cancel"}),n==="agent"&&e.jsxs(k,{onClick:q,disabled:!c,children:["Continue",e.jsx(H,{className:"ml-1 size-4"})]}),n==="configure"&&e.jsxs(k,{onClick:q,children:["Continue",e.jsx(H,{className:"ml-1 size-4"})]}),n==="test"&&!w.isPending&&!w.isSuccess&&e.jsx(k,{variant:"ghost",onClick:q,children:"Skip"}),n==="test"&&w.isSuccess&&e.jsxs(k,{onClick:q,children:["Continue",e.jsx(H,{className:"ml-1 size-4"})]}),n==="confirm"&&e.jsxs(k,{onClick:B,disabled:z,children:[z&&e.jsx(ke,{className:"mr-2"}),o?"Save changes":"Connect"]})]})]})]})}),a.setupGuide&&e.jsx(gs,{open:d,onOpenChange:b,title:a.displayName,content:a.setupGuide})]})}export{Cs as A,ws as u};
@@ -1,4 +1,4 @@
1
- import{a4 as Oe,ae as Y,ap as De,aI as O,aj as ln,af as xe,ag as fe,jx as ae,jy as ze,r as j,jz as V,jA as un,j as n,a6 as q,h9 as pe,B as b,jB as hn,jC as gn,e as z,Z as P,dD as Me,cA as Ke,cB as Ve,C as mn,cC as qe,a8 as xn,h4 as se,dd as re,$ as ye,jD as Be,hS as We,hT as le,e3 as F,ix as Ue,aa as fn,at as Se,dw as pn,hw as yn,hx as jn,jE as ue,jF as vn,i as Nn,g2 as kn,h1 as bn,dY as U,dZ as G,d_ as Q,d$ as H,e0 as K,I as he,jG as Sn,jH as Cn,jI as In,jJ as wn,jK as An,e6 as Ge,e7 as Qe,jL as $n,a7 as Rn,l as En,jM as _n,jN as Ln,jO as Fn,jP as Ce,jQ as Tn,df as Pn,jR as He,ac as On,ab as Dn,a9 as zn}from"./index-BZKMWkth.js";import{u as Mn,a as Kn,b as Vn,c as qn,d as Bn,e as Wn}from"./use-connector-management-BZ-sfu8O.js";/**
1
+ import{a4 as Oe,ae as Y,ap as De,aI as O,aj as ln,af as xe,ag as fe,jx as ae,jy as ze,r as j,jz as V,jA as un,j as n,a6 as q,h9 as pe,B as b,jB as hn,jC as gn,e as z,Z as P,dD as Me,cA as Ke,cB as Ve,C as mn,cC as qe,a8 as xn,h4 as se,dd as re,$ as ye,jD as Be,hS as We,hT as le,e3 as F,ix as Ue,aa as fn,at as Se,dw as pn,hw as yn,hx as jn,jE as ue,jF as vn,i as Nn,g2 as kn,h1 as bn,dY as U,dZ as G,d_ as Q,d$ as H,e0 as K,I as he,jG as Sn,jH as Cn,jI as In,jJ as wn,jK as An,e6 as Ge,e7 as Qe,jL as $n,a7 as Rn,l as En,jM as _n,jN as Ln,jO as Fn,jP as Ce,jQ as Tn,df as Pn,jR as He,ac as On,ab as Dn,a9 as zn}from"./index-Dr-0P6rd.js";import{u as Mn,a as Kn,b as Vn,c as qn,d as Bn,e as Wn}from"./use-connector-management-pgVHbXoO.js";/**
2
2
  * @license lucide-react v1.48.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{j as e,cp as $,cq as F,Z as v,a3 as f,bl as b,cr as U,cs as B,ct as G,$ as D,r as u,cu as E,B as W,X as V,cv as q,b as J,e as K,t as Z,g as X}from"./index-BZKMWkth.js";import{u as Y,P as Q}from"./use-personality-commit-CgQm9Y7m.js";import"./dorkbot-templates-8Yu9POWJ.js";import"./sound-D3r8dGFH.js";import"./soul-file-B_MwZHvh.js";const H={hidden:{},visible:{transition:{staggerChildren:.04}}},I={hidden:{opacity:0,scale:.5},visible:{opacity:1,scale:1,transition:{type:"spring",stiffness:500,damping:25}}};function _(){return e.jsx(f.span,{className:"pointer-events-none absolute inset-0 flex items-center justify-center",initial:{scale:0,opacity:1},animate:{scale:1,opacity:0},transition:{duration:.6,ease:[.34,1.56,.64,1]},"aria-hidden":!0,children:e.jsx(D,{className:"size-4 text-white drop-shadow-md",strokeWidth:3})})}function O({celebratory:s,className:t,children:a}){return s?e.jsx(f.div,{className:t,variants:H,initial:"hidden",animate:"visible",children:a}):e.jsx("div",{className:t,children:a})}function A({celebratory:s,children:t}){return s?e.jsx(f.div,{variants:I,children:t}):t}const ee=e.jsx("span",{className:"text-3xs leading-none font-bold",children:"A"}),te="ring-muted-foreground/50 ring-dashed ring-2 ring-offset-2",se="Select default color";function ae({value:s,autoColor:t,onSelect:a,onHoverChange:i,justSelectedKey:o,celebratory:n=!1,autoIcon:r=ee,autoActiveRing:c=te,autoLabel:d=se}){const x=s!=null;return e.jsxs(O,{celebratory:n,className:"flex flex-wrap items-center gap-2",children:[e.jsx(A,{celebratory:n,children:e.jsx(T,{active:!x,activeRing:c,color:t,label:d,tooltip:"Unique, derived from agent name",onClick:()=>a(null),onHoverChange:i,justSelected:o==="auto",celebratory:n,children:r})}),e.jsx("div",{className:"bg-border mx-0.5 h-5 w-px"}),$.map(l=>e.jsx(A,{celebratory:n,children:e.jsx(T,{active:s===l.hex,activeRing:"ring-foreground ring-2 ring-offset-2",color:l.hex,label:`Select ${l.name}`,tooltip:l.name,onClick:()=>a(l.hex),onHoverChange:i,justSelected:o===l.hex,celebratory:n})},l.hex))]})}function T({active:s,activeRing:t,color:a,label:i,tooltip:o,tooltipSide:n="bottom",onClick:r,onHoverChange:c,justSelected:d,celebratory:x,children:l}){const h=e.jsxs("button",{type:"button",onClick:r,onMouseEnter:()=>c==null?void 0:c(a),onMouseLeave:()=>c==null?void 0:c(null),className:v("group/swatch relative size-8 rounded-full transition-[scale,box-shadow] duration-150",s?t:"hover:scale-110"),style:{backgroundColor:a},"aria-label":i,children:[l&&e.jsx("span",{className:"bg-background/80 text-foreground absolute inset-0 flex items-center justify-center rounded-full",children:l}),x&&e.jsx("span",{className:"absolute inset-[-4px] -z-10 rounded-full opacity-0 blur-md transition-opacity duration-200 group-hover/swatch:opacity-50",style:{backgroundColor:a},"aria-hidden":!0}),e.jsx(b,{children:d&&e.jsx(_,{})})]});return x?e.jsxs(U,{children:[e.jsx(B,{asChild:!0,children:h}),e.jsx(G,{side:n,className:"text-3xs",children:o})]}):h}function ne({value:s,autoEmoji:t,hasOverride:a,onSelect:i,justSelectedKey:o,celebratory:n=!1}){return e.jsx(O,{celebratory:n,className:"grid grid-cols-6 gap-1.5",children:F.map(r=>{const c=r===s,d=r===t&&!a,x=v("relative flex size-9 items-center justify-center rounded-md text-lg transition-colors duration-150",c?v(d?"bg-accent ring-muted-foreground/50 ring-1":"bg-accent ring-foreground ring-1",d&&!n&&"ring-dashed"):"hover:bg-accent/50 active:scale-90");return e.jsx(ie,{celebratory:n,onClick:()=>i(r),className:x,ariaLabel:`Select icon ${r}`,justSelected:o===`emoji-${r}`,children:r},r)})})}function ie({celebratory:s,onClick:t,className:a,ariaLabel:i,justSelected:o,children:n}){const r=e.jsx(b,{children:o&&e.jsx(_,{})});return s?e.jsxs(f.button,{type:"button",onClick:t,className:a,"aria-label":i,variants:I,whileHover:{scale:1.25},whileTap:{scale:.85},transition:{type:"spring",stiffness:500,damping:20},children:[n,r]}):e.jsxs("button",{type:"button",onClick:t,className:a,"aria-label":i,children:[n,r]})}const re=e.jsx(q,{className:"size-3"}),oe="ring-muted-foreground/50 ring-2 ring-offset-2",ce="Select unique auto-generated color",C="dorkos:avatar-first-customization",le={hidden:{},visible:{transition:{staggerChildren:.04}}},w={hidden:{opacity:0,y:4},visible:{opacity:1,y:0,transition:{duration:.2,ease:"easeOut"}}};function ue(){const[s]=u.useState(()=>Array.from({length:14},(a,i)=>{const o=Math.PI*2*i/14,n=28+Math.random()*20,r=360*i/14;return{x:Math.cos(o)*n,y:Math.sin(o)*n,size:3+Math.random()*3,hue:r,delay:i*.02}}));return e.jsx("div",{className:"pointer-events-none absolute inset-0 z-50 overflow-visible","aria-hidden":!0,children:s.map((t,a)=>e.jsx(f.span,{className:"absolute top-1/2 left-1/2 rounded-full",style:{width:t.size,height:t.size,background:`hsl(${t.hue}, 80%, 70%)`,boxShadow:`0 0 6px hsl(${t.hue}, 80%, 70%)`},initial:{x:"-50%",y:"-50%",scale:0,opacity:1},animate:{x:t.x,y:t.y,scale:1,opacity:0},transition:{duration:.6,ease:"easeOut",delay:t.delay}},a))})}function de({agent:s,onUpdate:t,onPreviewColor:a,title:i,onClose:o}){const n=u.useMemo(()=>E(s.id),[s.id]),r=n.color,c=n.icon,d=s.icon??c,x=s.color!=null,l=s.icon!=null,h=x||l,[y,S]=u.useState(null),p=u.useRef(null),[z,k]=u.useState(!1),N=u.useRef(!1);u.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]);const g=u.useCallback(()=>{if(!N.current){try{if(localStorage.getItem(C))return;localStorage.setItem(C,"true")}catch{return}N.current=!0,k(!0),setTimeout(()=>k(!1),800)}},[]),j=u.useCallback(m=>{p.current&&clearTimeout(p.current),S(m),p.current=setTimeout(()=>S(null),600)},[]),R=u.useCallback(()=>{t({color:null,icon:null})},[t]),P=u.useCallback(m=>{t({color:m}),a(null),j(m??"auto"),g()},[t,a,j,g]),L=u.useCallback(m=>{t({icon:m===c?null:m}),j(`emoji-${m}`),g()},[t,c,j,g]),M=u.useCallback(m=>{a(m)},[a]);return e.jsxs("div",{className:"flex flex-1 flex-col overflow-auto","data-testid":"avatar-picker-panel",children:[(i||o||h)&&e.jsxs("div",{className:v("flex items-center justify-between px-4 py-2",(i||o)&&"border-b"),children:[i&&e.jsx("span",{className:"text-xs font-semibold",children:i}),e.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[e.jsx(b,{children:h&&e.jsx(f.button,{type:"button",onClick:R,className:"text-muted-foreground hover:text-foreground text-3xs transition-colors",initial:{opacity:0,x:8},animate:{opacity:1,x:0},exit:{opacity:0,x:8},transition:{duration:.2},children:"Reset to defaults"})}),o&&e.jsx(W,{variant:"ghost",size:"icon-md",className:"size-6",onClick:o,"aria-label":"Close appearance picker",children:e.jsx(V,{className:"size-3.5"})})]})]}),e.jsxs(f.div,{className:"space-y-5 p-4",variants:le,initial:"hidden",animate:"visible",children:[e.jsxs(f.div,{variants:w,children:[e.jsx("div",{className:"text-muted-foreground text-3xs mb-2 font-medium tracking-wider uppercase",children:"Color"}),e.jsx(ae,{value:s.color,autoColor:r,onSelect:P,onHoverChange:M,justSelectedKey:y,celebratory:!0,autoIcon:re,autoActiveRing:oe,autoLabel:ce})]}),e.jsxs(f.div,{variants:w,children:[e.jsx("div",{className:"text-muted-foreground text-3xs mb-2 font-medium tracking-wider uppercase",children:"Icon"}),e.jsx(ne,{value:d,autoEmoji:c,hasOverride:l,onSelect:L,justSelectedKey:y,celebratory:!0})]})]}),e.jsx(b,{children:z&&e.jsx(ue,{})})]})}function xe({children:s}){return e.jsx("h3",{className:"text-muted-foreground text-3xs font-medium tracking-wider uppercase",children:s})}function ve({member:s}){const{agent:t,isPending:a,update:i}=J(s),o=Y(t,i),[n,r]=u.useState(null);if(a)return e.jsx(K,{className:"h-64 w-full"});if(!t)return e.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this agent’s appearance."});const c=Z(s),d=E(t.id),x=n??t.color??d.color,l=t.icon??d.icon;return e.jsxs("div",{className:"flex flex-col gap-5","data-slot":"profile-appearance",children:[e.jsx("div",{className:"flex justify-center pt-1",children:e.jsx(X,{size:"lg",kind:c.kind,color:x,emoji:l,fallback:c.fallback,origin:c.origin})}),e.jsx(de,{agent:t,onUpdate:i,onPreviewColor:r}),e.jsxs("div",{className:"space-y-2 border-t pt-4",children:[e.jsx(xe,{children:"Personality"}),e.jsx(Q,{traits:o.traits,onTraitsChange:o.onTraitsChange,compact:!0})]})]})}export{ve as AppearancePage};
1
+ import{j as e,cp as $,cq as F,Z as v,a3 as f,bl as b,cr as U,cs as B,ct as G,$ as D,r as u,cu as E,B as W,X as V,cv as q,b as J,e as K,t as Z,g as X}from"./index-Dr-0P6rd.js";import{u as Y,P as Q}from"./use-personality-commit-Gfoi__sT.js";import"./dorkbot-templates-8Yu9POWJ.js";import"./sound-D3r8dGFH.js";import"./soul-file-C7YgkNET.js";const H={hidden:{},visible:{transition:{staggerChildren:.04}}},I={hidden:{opacity:0,scale:.5},visible:{opacity:1,scale:1,transition:{type:"spring",stiffness:500,damping:25}}};function _(){return e.jsx(f.span,{className:"pointer-events-none absolute inset-0 flex items-center justify-center",initial:{scale:0,opacity:1},animate:{scale:1,opacity:0},transition:{duration:.6,ease:[.34,1.56,.64,1]},"aria-hidden":!0,children:e.jsx(D,{className:"size-4 text-white drop-shadow-md",strokeWidth:3})})}function O({celebratory:s,className:t,children:a}){return s?e.jsx(f.div,{className:t,variants:H,initial:"hidden",animate:"visible",children:a}):e.jsx("div",{className:t,children:a})}function A({celebratory:s,children:t}){return s?e.jsx(f.div,{variants:I,children:t}):t}const ee=e.jsx("span",{className:"text-3xs leading-none font-bold",children:"A"}),te="ring-muted-foreground/50 ring-dashed ring-2 ring-offset-2",se="Select default color";function ae({value:s,autoColor:t,onSelect:a,onHoverChange:i,justSelectedKey:o,celebratory:n=!1,autoIcon:r=ee,autoActiveRing:c=te,autoLabel:d=se}){const x=s!=null;return e.jsxs(O,{celebratory:n,className:"flex flex-wrap items-center gap-2",children:[e.jsx(A,{celebratory:n,children:e.jsx(T,{active:!x,activeRing:c,color:t,label:d,tooltip:"Unique, derived from agent name",onClick:()=>a(null),onHoverChange:i,justSelected:o==="auto",celebratory:n,children:r})}),e.jsx("div",{className:"bg-border mx-0.5 h-5 w-px"}),$.map(l=>e.jsx(A,{celebratory:n,children:e.jsx(T,{active:s===l.hex,activeRing:"ring-foreground ring-2 ring-offset-2",color:l.hex,label:`Select ${l.name}`,tooltip:l.name,onClick:()=>a(l.hex),onHoverChange:i,justSelected:o===l.hex,celebratory:n})},l.hex))]})}function T({active:s,activeRing:t,color:a,label:i,tooltip:o,tooltipSide:n="bottom",onClick:r,onHoverChange:c,justSelected:d,celebratory:x,children:l}){const h=e.jsxs("button",{type:"button",onClick:r,onMouseEnter:()=>c==null?void 0:c(a),onMouseLeave:()=>c==null?void 0:c(null),className:v("group/swatch relative size-8 rounded-full transition-[scale,box-shadow] duration-150",s?t:"hover:scale-110"),style:{backgroundColor:a},"aria-label":i,children:[l&&e.jsx("span",{className:"bg-background/80 text-foreground absolute inset-0 flex items-center justify-center rounded-full",children:l}),x&&e.jsx("span",{className:"absolute inset-[-4px] -z-10 rounded-full opacity-0 blur-md transition-opacity duration-200 group-hover/swatch:opacity-50",style:{backgroundColor:a},"aria-hidden":!0}),e.jsx(b,{children:d&&e.jsx(_,{})})]});return x?e.jsxs(U,{children:[e.jsx(B,{asChild:!0,children:h}),e.jsx(G,{side:n,className:"text-3xs",children:o})]}):h}function ne({value:s,autoEmoji:t,hasOverride:a,onSelect:i,justSelectedKey:o,celebratory:n=!1}){return e.jsx(O,{celebratory:n,className:"grid grid-cols-6 gap-1.5",children:F.map(r=>{const c=r===s,d=r===t&&!a,x=v("relative flex size-9 items-center justify-center rounded-md text-lg transition-colors duration-150",c?v(d?"bg-accent ring-muted-foreground/50 ring-1":"bg-accent ring-foreground ring-1",d&&!n&&"ring-dashed"):"hover:bg-accent/50 active:scale-90");return e.jsx(ie,{celebratory:n,onClick:()=>i(r),className:x,ariaLabel:`Select icon ${r}`,justSelected:o===`emoji-${r}`,children:r},r)})})}function ie({celebratory:s,onClick:t,className:a,ariaLabel:i,justSelected:o,children:n}){const r=e.jsx(b,{children:o&&e.jsx(_,{})});return s?e.jsxs(f.button,{type:"button",onClick:t,className:a,"aria-label":i,variants:I,whileHover:{scale:1.25},whileTap:{scale:.85},transition:{type:"spring",stiffness:500,damping:20},children:[n,r]}):e.jsxs("button",{type:"button",onClick:t,className:a,"aria-label":i,children:[n,r]})}const re=e.jsx(q,{className:"size-3"}),oe="ring-muted-foreground/50 ring-2 ring-offset-2",ce="Select unique auto-generated color",C="dorkos:avatar-first-customization",le={hidden:{},visible:{transition:{staggerChildren:.04}}},w={hidden:{opacity:0,y:4},visible:{opacity:1,y:0,transition:{duration:.2,ease:"easeOut"}}};function ue(){const[s]=u.useState(()=>Array.from({length:14},(a,i)=>{const o=Math.PI*2*i/14,n=28+Math.random()*20,r=360*i/14;return{x:Math.cos(o)*n,y:Math.sin(o)*n,size:3+Math.random()*3,hue:r,delay:i*.02}}));return e.jsx("div",{className:"pointer-events-none absolute inset-0 z-50 overflow-visible","aria-hidden":!0,children:s.map((t,a)=>e.jsx(f.span,{className:"absolute top-1/2 left-1/2 rounded-full",style:{width:t.size,height:t.size,background:`hsl(${t.hue}, 80%, 70%)`,boxShadow:`0 0 6px hsl(${t.hue}, 80%, 70%)`},initial:{x:"-50%",y:"-50%",scale:0,opacity:1},animate:{x:t.x,y:t.y,scale:1,opacity:0},transition:{duration:.6,ease:"easeOut",delay:t.delay}},a))})}function de({agent:s,onUpdate:t,onPreviewColor:a,title:i,onClose:o}){const n=u.useMemo(()=>E(s.id),[s.id]),r=n.color,c=n.icon,d=s.icon??c,x=s.color!=null,l=s.icon!=null,h=x||l,[y,S]=u.useState(null),p=u.useRef(null),[z,k]=u.useState(!1),N=u.useRef(!1);u.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]);const g=u.useCallback(()=>{if(!N.current){try{if(localStorage.getItem(C))return;localStorage.setItem(C,"true")}catch{return}N.current=!0,k(!0),setTimeout(()=>k(!1),800)}},[]),j=u.useCallback(m=>{p.current&&clearTimeout(p.current),S(m),p.current=setTimeout(()=>S(null),600)},[]),R=u.useCallback(()=>{t({color:null,icon:null})},[t]),P=u.useCallback(m=>{t({color:m}),a(null),j(m??"auto"),g()},[t,a,j,g]),L=u.useCallback(m=>{t({icon:m===c?null:m}),j(`emoji-${m}`),g()},[t,c,j,g]),M=u.useCallback(m=>{a(m)},[a]);return e.jsxs("div",{className:"flex flex-1 flex-col overflow-auto","data-testid":"avatar-picker-panel",children:[(i||o||h)&&e.jsxs("div",{className:v("flex items-center justify-between px-4 py-2",(i||o)&&"border-b"),children:[i&&e.jsx("span",{className:"text-xs font-semibold",children:i}),e.jsxs("div",{className:"ml-auto flex items-center gap-1",children:[e.jsx(b,{children:h&&e.jsx(f.button,{type:"button",onClick:R,className:"text-muted-foreground hover:text-foreground text-3xs transition-colors",initial:{opacity:0,x:8},animate:{opacity:1,x:0},exit:{opacity:0,x:8},transition:{duration:.2},children:"Reset to defaults"})}),o&&e.jsx(W,{variant:"ghost",size:"icon-md",className:"size-6",onClick:o,"aria-label":"Close appearance picker",children:e.jsx(V,{className:"size-3.5"})})]})]}),e.jsxs(f.div,{className:"space-y-5 p-4",variants:le,initial:"hidden",animate:"visible",children:[e.jsxs(f.div,{variants:w,children:[e.jsx("div",{className:"text-muted-foreground text-3xs mb-2 font-medium tracking-wider uppercase",children:"Color"}),e.jsx(ae,{value:s.color,autoColor:r,onSelect:P,onHoverChange:M,justSelectedKey:y,celebratory:!0,autoIcon:re,autoActiveRing:oe,autoLabel:ce})]}),e.jsxs(f.div,{variants:w,children:[e.jsx("div",{className:"text-muted-foreground text-3xs mb-2 font-medium tracking-wider uppercase",children:"Icon"}),e.jsx(ne,{value:d,autoEmoji:c,hasOverride:l,onSelect:L,justSelectedKey:y,celebratory:!0})]})]}),e.jsx(b,{children:z&&e.jsx(ue,{})})]})}function xe({children:s}){return e.jsx("h3",{className:"text-muted-foreground text-3xs font-medium tracking-wider uppercase",children:s})}function ve({member:s}){const{agent:t,isPending:a,update:i}=J(s),o=Y(t,i),[n,r]=u.useState(null);if(a)return e.jsx(K,{className:"h-64 w-full"});if(!t)return e.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this agent’s appearance."});const c=Z(s),d=E(t.id),x=n??t.color??d.color,l=t.icon??d.icon;return e.jsxs("div",{className:"flex flex-col gap-5","data-slot":"profile-appearance",children:[e.jsx("div",{className:"flex justify-center pt-1",children:e.jsx(X,{size:"lg",kind:c.kind,color:x,emoji:l,fallback:c.fallback,origin:c.origin})}),e.jsx(de,{agent:t,onUpdate:i,onPreviewColor:r}),e.jsxs("div",{className:"space-y-2 border-t pt-4",children:[e.jsx(xe,{children:"Personality"}),e.jsx(Q,{traits:o.traits,onTraitsChange:o.onTraitsChange,compact:!0})]})]})}export{ve as AppearancePage};
@@ -1 +1 @@
1
- import{ar as r,as as n,j as e,a3 as i,at as o,B as d}from"./index-BZKMWkth.js";const c={initial:{opacity:0,y:8},animate:{opacity:1,y:0}};function l({signal:t}){const a=r(),s=n(t.since);return e.jsxs(i.div,{variants:c,"data-slot":"attention-signal-row",className:"hover:bg-accent/50 flex min-w-0 items-center gap-2.5 rounded-md px-2 py-1 transition-colors",children:[e.jsx("span",{className:"bg-status-error size-1.5 shrink-0 rounded-full","aria-hidden":!0}),e.jsx(o,{className:"text-status-error/70 size-3.5 shrink-0","aria-hidden":!0}),e.jsxs("span",{className:"text-foreground/90 min-w-0 flex-1 truncate text-xs",children:[t.primary,t.secondary!==void 0&&e.jsxs("span",{className:"text-muted-foreground",children:[" · ",t.secondary]})]}),e.jsx("span",{className:"text-muted-foreground shrink-0 text-xs tabular-nums",children:s}),e.jsx(d,{variant:"ghost",size:"sm",className:"relative h-6 shrink-0 px-2 text-xs after:absolute after:-inset-3 md:after:hidden","aria-label":`Open ${t.primary}`,onClick:()=>void a.navigate({href:t.deepLink}),children:"Open →"})]})}export{l as A};
1
+ import{ar as r,as as n,j as e,a3 as i,at as o,B as d}from"./index-Dr-0P6rd.js";const c={initial:{opacity:0,y:8},animate:{opacity:1,y:0}};function l({signal:t}){const a=r(),s=n(t.since);return e.jsxs(i.div,{variants:c,"data-slot":"attention-signal-row",className:"hover:bg-accent/50 flex min-w-0 items-center gap-2.5 rounded-md px-2 py-1 transition-colors",children:[e.jsx("span",{className:"bg-status-error size-1.5 shrink-0 rounded-full","aria-hidden":!0}),e.jsx(o,{className:"text-status-error/70 size-3.5 shrink-0","aria-hidden":!0}),e.jsxs("span",{className:"text-foreground/90 min-w-0 flex-1 truncate text-xs",children:[t.primary,t.secondary!==void 0&&e.jsxs("span",{className:"text-muted-foreground",children:[" · ",t.secondary]})]}),e.jsx("span",{className:"text-muted-foreground shrink-0 text-xs tabular-nums",children:s}),e.jsx(d,{variant:"ghost",size:"sm",className:"relative h-6 shrink-0 px-2 text-xs after:absolute after:-inset-3 md:after:hidden","aria-label":`Open ${t.primary}`,onClick:()=>void a.navigate({href:t.deepLink}),children:"Open →"})]})}export{l as A};
@@ -1,4 +1,4 @@
1
- import{u as _t,c as Q,a as Te,b as U,s as ht,m as Je,i as g,k as Ft,e as w,f as s,d as S,l as L,M as He,j as le,F as zt,S as Et,n as pt,t as E,o as It,p as mt,q as Bt,r as $t,v as Ke}from"./index-1flHw44u.js";import{cj as Dt,ck as be,aM as V,cl as st,cm as Tt,cn as At,co as Rt}from"./index-BZKMWkth.js";let Mt={data:""},Pt=r=>{if(typeof window=="object"){let e=(r?r.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return e.nonce=window.__nonce__,e.parentNode||(r||document.head).appendChild(e),e.firstChild}return r||Mt},Lt=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Ot=/\/\*[^]*?\*\/| +/g,lt=/\n+/g,ae=(r,e)=>{let i="",t="",c="";for(let a in r){let l=r[a];a[0]=="@"?a[1]=="i"?i=a+" "+l+";":t+=a[1]=="f"?ae(l,a):a+"{"+ae(l,a[1]=="k"?"":e)+"}":typeof l=="object"?t+=ae(l,e?e.replace(/([^,])+/g,v=>a.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,u=>/&/.test(u)?u.replace(/&/g,v):v?v+" "+u:u)):a):l!=null&&(a=a[1]=="-"?a:a.replace(/[A-Z]/g,"-$&").toLowerCase(),c+=ae.p?ae.p(a,l):a+":"+l+";")}return i+(e&&c?e+"{"+c+"}":c)+t},ne={},bt=r=>{if(typeof r=="object"){let e="";for(let i in r)e+=i+bt(r[i]);return e}return r},jt=(r,e,i,t,c)=>{let a=bt(r),l=ne[a]||(ne[a]=(u=>{let o=0,n=11;for(;o<u.length;)n=101*n+u.charCodeAt(o++)>>>0;return"go"+n})(a));if(!ne[l]){let u=a!==r?r:(o=>{let n,k,m=[{}];for(;n=Lt.exec(o.replace(Ot,""));)n[4]?m.shift():n[3]?(k=n[3].replace(lt," ").trim(),m.unshift(m[0][k]=m[0][k]||{})):m[0][n[1]]=n[2].replace(lt," ").trim();return m[0]})(r);ne[l]=ae(c?{["@keyframes "+l]:u}:u,i?"":"."+l)}let v=i&&ne.g;return i&&(ne.g=ne[l]),((u,o,n,k)=>{k?o.data=o.data.replace(k,u):o.data.indexOf(u)===-1&&(o.data=n?u+o.data:o.data+u)})(ne[l],e,t,v),l},Ht=(r,e,i)=>r.reduce((t,c,a)=>{let l=e[a];if(l&&l.call){let v=l(i),u=v&&v.props&&v.props.className||/^go/.test(v)&&v;l=u?"."+u:v&&typeof v=="object"?v.props?"":ae(v,""):v===!1?"":v}return t+c+(l??"")},"");function ue(r){let e=this||{},i=r.call?r(e.p):r;return jt(i.unshift?i.raw?Ht(i,[].slice.call(arguments,1),e.p):i.reduce((t,c)=>Object.assign(t,c&&c.call?c(e.p):c),{}):i,Pt(e.target),e.g,e.o,e.k)}ue.bind({g:1});ue.bind({k:1});var D={colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000000",white:"#ffffff",neutral:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},darkGray:{50:"#525c7a",100:"#49536e",200:"#414962",300:"#394056",400:"#313749",500:"#292e3d",600:"#212530",700:"#191c24",800:"#111318",900:"#0b0d10"},gray:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},blue:{25:"#F5FAFF",50:"#EFF8FF",100:"#D1E9FF",200:"#B2DDFF",300:"#84CAFF",400:"#53B1FD",500:"#2E90FA",600:"#1570EF",700:"#175CD3",800:"#1849A9",900:"#194185"},green:{25:"#F6FEF9",50:"#ECFDF3",100:"#D1FADF",200:"#A6F4C5",300:"#6CE9A6",400:"#32D583",500:"#12B76A",600:"#039855",700:"#027A48",800:"#05603A",900:"#054F31"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},yellow:{25:"#FFFCF5",50:"#FFFAEB",100:"#FEF0C7",200:"#FEDF89",300:"#FEC84B",400:"#FDB022",500:"#F79009",600:"#DC6803",700:"#B54708",800:"#93370D",900:"#7A2E0E"},purple:{25:"#FAFAFF",50:"#F4F3FF",100:"#EBE9FE",200:"#D9D6FE",300:"#BDB4FE",400:"#9B8AFB",500:"#7A5AF8",600:"#6938EF",700:"#5925DC",800:"#4A1FB8",900:"#3E1C96"},teal:{25:"#F6FEFC",50:"#F0FDF9",100:"#CCFBEF",200:"#99F6E0",300:"#5FE9D0",400:"#2ED3B7",500:"#15B79E",600:"#0E9384",700:"#107569",800:"#125D56",900:"#134E48"},pink:{25:"#fdf2f8",50:"#fce7f3",100:"#fbcfe8",200:"#f9a8d4",300:"#f472b6",400:"#ec4899",500:"#db2777",600:"#be185d",700:"#9d174d",800:"#831843",900:"#500724"},cyan:{25:"#ecfeff",50:"#cffafe",100:"#a5f3fc",200:"#67e8f9",300:"#22d3ee",400:"#06b6d4",500:"#0891b2",600:"#0e7490",700:"#155e75",800:"#164e63",900:"#083344"}},alpha:{90:"e5",70:"b3",20:"33"},font:{size:{"2xs":"calc(var(--tsrd-font-size) * 0.625)",xs:"calc(var(--tsrd-font-size) * 0.75)",sm:"calc(var(--tsrd-font-size) * 0.875)",md:"var(--tsrd-font-size)"},lineHeight:{xs:"calc(var(--tsrd-font-size) * 1)",sm:"calc(var(--tsrd-font-size) * 1.25)"},weight:{normal:"400",medium:"500",semibold:"600",bold:"700"},fontFamily:{sans:"ui-sans-serif, Inter, system-ui, sans-serif, sans-serif",mono:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace"}},border:{radius:{xs:"calc(var(--tsrd-font-size) * 0.125)",sm:"calc(var(--tsrd-font-size) * 0.25)",md:"calc(var(--tsrd-font-size) * 0.375)",full:"9999px"}},size:{0:"0px",.5:"calc(var(--tsrd-font-size) * 0.125)",1:"calc(var(--tsrd-font-size) * 0.25)",1.5:"calc(var(--tsrd-font-size) * 0.375)",2:"calc(var(--tsrd-font-size) * 0.5)",2.5:"calc(var(--tsrd-font-size) * 0.625)",3:"calc(var(--tsrd-font-size) * 0.75)",3.5:"calc(var(--tsrd-font-size) * 0.875)",4:"calc(var(--tsrd-font-size) * 1)",5:"calc(var(--tsrd-font-size) * 1.25)",8:"calc(var(--tsrd-font-size) * 2)"}},Gt=r=>{const{colors:e,font:i,size:t,alpha:c,border:a}=D,{fontFamily:l,lineHeight:v,size:u}=i,o=r?ue.bind({target:r}):ue;return{devtoolsPanelContainer:o`
1
+ import{u as _t,c as Q,a as Te,b as U,s as ht,m as Je,i as g,k as Ft,e as w,f as s,d as S,l as L,M as He,j as le,F as zt,S as Et,n as pt,t as E,o as It,p as mt,q as Bt,r as $t,v as Ke}from"./index-B8R78Nnj.js";import{cj as Dt,ck as be,aM as V,cl as st,cm as Tt,cn as At,co as Rt}from"./index-Dr-0P6rd.js";let Mt={data:""},Pt=r=>{if(typeof window=="object"){let e=(r?r.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return e.nonce=window.__nonce__,e.parentNode||(r||document.head).appendChild(e),e.firstChild}return r||Mt},Lt=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Ot=/\/\*[^]*?\*\/| +/g,lt=/\n+/g,ae=(r,e)=>{let i="",t="",c="";for(let a in r){let l=r[a];a[0]=="@"?a[1]=="i"?i=a+" "+l+";":t+=a[1]=="f"?ae(l,a):a+"{"+ae(l,a[1]=="k"?"":e)+"}":typeof l=="object"?t+=ae(l,e?e.replace(/([^,])+/g,v=>a.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,u=>/&/.test(u)?u.replace(/&/g,v):v?v+" "+u:u)):a):l!=null&&(a=a[1]=="-"?a:a.replace(/[A-Z]/g,"-$&").toLowerCase(),c+=ae.p?ae.p(a,l):a+":"+l+";")}return i+(e&&c?e+"{"+c+"}":c)+t},ne={},bt=r=>{if(typeof r=="object"){let e="";for(let i in r)e+=i+bt(r[i]);return e}return r},jt=(r,e,i,t,c)=>{let a=bt(r),l=ne[a]||(ne[a]=(u=>{let o=0,n=11;for(;o<u.length;)n=101*n+u.charCodeAt(o++)>>>0;return"go"+n})(a));if(!ne[l]){let u=a!==r?r:(o=>{let n,k,m=[{}];for(;n=Lt.exec(o.replace(Ot,""));)n[4]?m.shift():n[3]?(k=n[3].replace(lt," ").trim(),m.unshift(m[0][k]=m[0][k]||{})):m[0][n[1]]=n[2].replace(lt," ").trim();return m[0]})(r);ne[l]=ae(c?{["@keyframes "+l]:u}:u,i?"":"."+l)}let v=i&&ne.g;return i&&(ne.g=ne[l]),((u,o,n,k)=>{k?o.data=o.data.replace(k,u):o.data.indexOf(u)===-1&&(o.data=n?u+o.data:o.data+u)})(ne[l],e,t,v),l},Ht=(r,e,i)=>r.reduce((t,c,a)=>{let l=e[a];if(l&&l.call){let v=l(i),u=v&&v.props&&v.props.className||/^go/.test(v)&&v;l=u?"."+u:v&&typeof v=="object"?v.props?"":ae(v,""):v===!1?"":v}return t+c+(l??"")},"");function ue(r){let e=this||{},i=r.call?r(e.p):r;return jt(i.unshift?i.raw?Ht(i,[].slice.call(arguments,1),e.p):i.reduce((t,c)=>Object.assign(t,c&&c.call?c(e.p):c),{}):i,Pt(e.target),e.g,e.o,e.k)}ue.bind({g:1});ue.bind({k:1});var D={colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000000",white:"#ffffff",neutral:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},darkGray:{50:"#525c7a",100:"#49536e",200:"#414962",300:"#394056",400:"#313749",500:"#292e3d",600:"#212530",700:"#191c24",800:"#111318",900:"#0b0d10"},gray:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},blue:{25:"#F5FAFF",50:"#EFF8FF",100:"#D1E9FF",200:"#B2DDFF",300:"#84CAFF",400:"#53B1FD",500:"#2E90FA",600:"#1570EF",700:"#175CD3",800:"#1849A9",900:"#194185"},green:{25:"#F6FEF9",50:"#ECFDF3",100:"#D1FADF",200:"#A6F4C5",300:"#6CE9A6",400:"#32D583",500:"#12B76A",600:"#039855",700:"#027A48",800:"#05603A",900:"#054F31"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},yellow:{25:"#FFFCF5",50:"#FFFAEB",100:"#FEF0C7",200:"#FEDF89",300:"#FEC84B",400:"#FDB022",500:"#F79009",600:"#DC6803",700:"#B54708",800:"#93370D",900:"#7A2E0E"},purple:{25:"#FAFAFF",50:"#F4F3FF",100:"#EBE9FE",200:"#D9D6FE",300:"#BDB4FE",400:"#9B8AFB",500:"#7A5AF8",600:"#6938EF",700:"#5925DC",800:"#4A1FB8",900:"#3E1C96"},teal:{25:"#F6FEFC",50:"#F0FDF9",100:"#CCFBEF",200:"#99F6E0",300:"#5FE9D0",400:"#2ED3B7",500:"#15B79E",600:"#0E9384",700:"#107569",800:"#125D56",900:"#134E48"},pink:{25:"#fdf2f8",50:"#fce7f3",100:"#fbcfe8",200:"#f9a8d4",300:"#f472b6",400:"#ec4899",500:"#db2777",600:"#be185d",700:"#9d174d",800:"#831843",900:"#500724"},cyan:{25:"#ecfeff",50:"#cffafe",100:"#a5f3fc",200:"#67e8f9",300:"#22d3ee",400:"#06b6d4",500:"#0891b2",600:"#0e7490",700:"#155e75",800:"#164e63",900:"#083344"}},alpha:{90:"e5",70:"b3",20:"33"},font:{size:{"2xs":"calc(var(--tsrd-font-size) * 0.625)",xs:"calc(var(--tsrd-font-size) * 0.75)",sm:"calc(var(--tsrd-font-size) * 0.875)",md:"var(--tsrd-font-size)"},lineHeight:{xs:"calc(var(--tsrd-font-size) * 1)",sm:"calc(var(--tsrd-font-size) * 1.25)"},weight:{normal:"400",medium:"500",semibold:"600",bold:"700"},fontFamily:{sans:"ui-sans-serif, Inter, system-ui, sans-serif, sans-serif",mono:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace"}},border:{radius:{xs:"calc(var(--tsrd-font-size) * 0.125)",sm:"calc(var(--tsrd-font-size) * 0.25)",md:"calc(var(--tsrd-font-size) * 0.375)",full:"9999px"}},size:{0:"0px",.5:"calc(var(--tsrd-font-size) * 0.125)",1:"calc(var(--tsrd-font-size) * 0.25)",1.5:"calc(var(--tsrd-font-size) * 0.375)",2:"calc(var(--tsrd-font-size) * 0.5)",2.5:"calc(var(--tsrd-font-size) * 0.625)",3:"calc(var(--tsrd-font-size) * 0.75)",3.5:"calc(var(--tsrd-font-size) * 0.875)",4:"calc(var(--tsrd-font-size) * 1)",5:"calc(var(--tsrd-font-size) * 1.25)",8:"calc(var(--tsrd-font-size) * 2)"}},Gt=r=>{const{colors:e,font:i,size:t,alpha:c,border:a}=D,{fontFamily:l,lineHeight:v,size:u}=i,o=r?ue.bind({target:r}):ue;return{devtoolsPanelContainer:o`
2
2
  direction: ltr;
3
3
  position: fixed;
4
4
  bottom: 0;
@@ -1,4 +1,4 @@
1
- var qy=Object.defineProperty;var Em=r=>{throw TypeError(r)};var _y=(r,e,t)=>e in r?qy(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var we=(r,e,t)=>_y(r,typeof e!="symbol"?e+"":e,t),Du=(r,e,t)=>e.has(r)||Em("Cannot "+t);var C=(r,e,t)=>(Du(r,e,"read from private field"),t?t.call(r):e.get(r)),P=(r,e,t)=>e.has(r)?Em("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),I=(r,e,t,n)=>(Du(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),mi=(r,e,t)=>(Du(r,e,"access private method"),t);import{o3 as Dm,o4 as $y,o5 as jy,o6 as Rd,o7 as Vy,o8 as Wy,o9 as Uy,r as B,hB as z4,e8 as Fl,oa as Od,ob as Id,oc as no,od as Rm,oe as Ky,of as Gy,og as qr,oh as Kh,oi as Xi,eS as Jy,oj as g0,ok as wr,ol as Yy,om as Xy,on as Om,oo as Ys,op as Zy,oq as y0,j as L,aO as Qy,Z as e7}from"./index-BZKMWkth.js";import{aw as t7,ax as r7,ab as n7,ac as i7,ad as o7,ae as s7,af as a7,ag as L4,ah as l7,q as q0,ai as c7,aj as B4,ar as u7,ak as d7,al as h7,am as f7,an as p7,ao as m7,ap as g7,aq as y7,Z as Gh,a4 as v7,a5 as P4,a6 as b7,a7 as w7,a8 as x7,a9 as k7,aa as S7,E as na,as as C7,t as nt,at as M7,n as T7,C as Im}from"./index-K2hqr6x6.js";const A7={}.hasOwnProperty;function F4(r,e){let t=-1,n;if(e.extensions)for(;++t<e.extensions.length;)F4(r,e.extensions[t]);for(n in e)if(A7.call(e,n))switch(n){case"extensions":break;case"unsafe":{zm(r[n],e[n]);break}case"join":{zm(r[n],e[n]);break}case"handlers":{N7(r[n],e[n]);break}default:r.options[n]=e[n]}return r}function zm(r,e){e&&r.push(...e)}function N7(r,e){e&&Object.assign(r,e)}const E7=[D7];function D7(r,e,t,n){if(e.type==="code"&&Dm(e,n)&&(r.type==="list"||r.type===e.type&&Dm(r,n)))return!1;if("spread"in t&&typeof t.spread=="boolean")return r.type==="paragraph"&&(r.type===e.type||e.type==="definition"||e.type==="heading"&&$y(e,n))?void 0:t.spread?1:0}const gi=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],R7=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:`
1
+ var qy=Object.defineProperty;var Em=r=>{throw TypeError(r)};var _y=(r,e,t)=>e in r?qy(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var we=(r,e,t)=>_y(r,typeof e!="symbol"?e+"":e,t),Du=(r,e,t)=>e.has(r)||Em("Cannot "+t);var C=(r,e,t)=>(Du(r,e,"read from private field"),t?t.call(r):e.get(r)),P=(r,e,t)=>e.has(r)?Em("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),I=(r,e,t,n)=>(Du(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),mi=(r,e,t)=>(Du(r,e,"access private method"),t);import{o4 as Dm,o5 as $y,o6 as jy,o7 as Rd,o8 as Vy,o9 as Wy,oa as Uy,r as B,hB as z4,e8 as Fl,ob as Od,oc as Id,od as no,oe as Rm,of as Ky,og as Gy,oh as qr,oi as Kh,oj as Xi,eS as Jy,ok as g0,ol as wr,om as Yy,on as Xy,oo as Om,op as Ys,oq as Zy,or as y0,j as L,aO as Qy,Z as e7}from"./index-Dr-0P6rd.js";import{aw as t7,ax as r7,ab as n7,ac as i7,ad as o7,ae as s7,af as a7,ag as L4,ah as l7,q as q0,ai as c7,aj as B4,ar as u7,ak as d7,al as h7,am as f7,an as p7,ao as m7,ap as g7,aq as y7,Z as Gh,a4 as v7,a5 as P4,a6 as b7,a7 as w7,a8 as x7,a9 as k7,aa as S7,E as na,as as C7,t as nt,at as M7,n as T7,C as Im}from"./index-C_uYJzKi.js";const A7={}.hasOwnProperty;function F4(r,e){let t=-1,n;if(e.extensions)for(;++t<e.extensions.length;)F4(r,e.extensions[t]);for(n in e)if(A7.call(e,n))switch(n){case"extensions":break;case"unsafe":{zm(r[n],e[n]);break}case"join":{zm(r[n],e[n]);break}case"handlers":{N7(r[n],e[n]);break}default:r.options[n]=e[n]}return r}function zm(r,e){e&&r.push(...e)}function N7(r,e){e&&Object.assign(r,e)}const E7=[D7];function D7(r,e,t,n){if(e.type==="code"&&Dm(e,n)&&(r.type==="list"||r.type===e.type&&Dm(r,n)))return!1;if("spread"in t&&typeof t.spread=="boolean")return r.type==="paragraph"&&(r.type===e.type||e.type==="definition"||e.type==="heading"&&$y(e,n))?void 0:t.spread?1:0}const gi=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],R7=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:`
2
2
  `,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:gi},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
3
3
  ]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:gi},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
4
4
  *])`},{character:"*",inConstruct:"phrasing",notInConstruct:gi},{atBreak:!0,character:"+",after:`(?:[ \r
@@ -1,4 +1,4 @@
1
- import{eS as Ee,ae as xe,aN as Re,r as ve,aj as Se,j,Z as Ce}from"./index-BZKMWkth.js";import{u as Oe}from"./index-D4em25Xt.js";import{r as Te}from"./use-session-canvas-8hTR83y8.js";import"./rotate-cw-TrlUqVdq.js";import"./WidgetErrorCard-l8cP9oJc.js";import"./card-CTGm0Blo.js";import"./markdown-content-plNIomQc.js";import"./table-BJDpTBxJ.js";import"./package-B7amjGSw.js";import"./heart-cgLUdSV5.js";import"./git-branch-D9jctpSd.js";import"./file-B6neiwXF.js";import"./McpAppFrame-DcPNmy1o.js";var he={exports:{}};/* @license
1
+ import{eS as Ee,ae as xe,aN as Re,r as ve,aj as Se,j,Z as Ce}from"./index-Dr-0P6rd.js";import{u as Oe}from"./index-CcV9S7cO.js";import{r as Te}from"./use-session-canvas-BaXuEhw8.js";import"./rotate-cw-DrGRGSwy.js";import"./WidgetErrorCard-BQwrR6PJ.js";import"./card-BTgwskmX.js";import"./markdown-content-aNzh-54y.js";import"./table-P4N5xQn2.js";import"./package-CoTlAnXZ.js";import"./heart-Bp14wOx6.js";import"./git-branch-Dq_w3Iyx.js";import"./file-DlQX-hKl.js";import"./McpAppFrame-DmHduNgp.js";var he={exports:{}};/* @license
2
2
  Papa Parse
3
3
  v5.7.0
4
4
  https://github.com/mholt/PapaParse
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeMirrorEditor-gShkyo4u.js","assets/index-BZKMWkth.js","assets/index-ExcAk4pE.css","assets/index-LP8S5WuT.js","assets/index-K2hqr6x6.js","assets/BlintzCanvas-D-7b_-SG.js","assets/BlintzCanvas-GgiCXV7C.css"])))=>i.map(i=>d[i]);
2
- import{ae as q,aN as b,aO as H,aj as $,r,j as t,af as K,Z as V,B as R,$ as U,aP as Y,aQ as L}from"./index-BZKMWkth.js";import{u as G}from"./use-session-canvas-8hTR83y8.js";import{R as I}from"./rotate-cw-TrlUqVdq.js";import"./WidgetErrorCard-l8cP9oJc.js";import"./card-CTGm0Blo.js";import"./markdown-content-plNIomQc.js";import"./table-BJDpTBxJ.js";import"./package-B7amjGSw.js";import"./heart-cgLUdSV5.js";import"./git-branch-D9jctpSd.js";import"./file-B6neiwXF.js";import"./McpAppFrame-DcPNmy1o.js";const Z=r.lazy(()=>L(()=>import("./CodeMirrorEditor-gShkyo4u.js"),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.CodeMirrorEditor}))),J=r.lazy(()=>L(()=>import("./BlintzCanvas-D-7b_-SG.js"),__vite__mapDeps([5,1,2,4,6])).then(e=>({default:e.BlintzCanvas}))),W=500;function w(e,o){return["canvas-file",e,o]}function X(e,o){return o==="markdown"||/\.(md|markdown|mdx)$/i.test(e)}function ee(e){switch(e==null?void 0:e.code){case"NOT_FOUND":return"This file doesn’t exist.";case"NOT_A_FILE":return"This path is a directory, not a file.";case"TOO_LARGE":return"This file is too large to open here.";case"BINARY_FILE":return"This file isn’t text, so the editor can’t show it.";default:return"This file couldn’t be loaded."}}function te(e){switch(e){case"saving":return"Saving…";case"saved":return"Saved";case"error":return"Couldn’t save";default:return null}}function xe({content:e,documentId:o}){const m=q(),i=b(s=>s.selectedCwd),C=b(s=>s.setDocumentEditing),a=b(s=>{var f;return((f=s.openDocuments.find(j=>j.id===o))==null?void 0:f.editing)??!1}),h=H(),{data:c,error:x,isLoading:N}=$({queryKey:w(i,e.sourcePath),enabled:i!==null,queryFn:()=>m.readFileContent(i,e.sourcePath),staleTime:3e4,retry:!1}),[d,v]=r.useState(null),p=s=>{v(s&&c?{pinnedHash:c.hash}:null)};if(i===null)return t.jsx(k,{children:"Open a chat to view files."});if(N)return t.jsx(k,{children:"Loading file…"});if(x||!c)return t.jsx(k,{children:ee(x)});const u=d!==null&&a,n=(u?d==null?void 0:d.pinnedHash:null)??c.hash;return t.jsx(se,{content:e,documentId:o,cwd:i,loaded:c.content,theme:h,isEditing:u,onEditingChange:p,setDocumentEditing:C},`${e.sourcePath}:${n}`)}function se({content:e,documentId:o,cwd:m,loaded:i,theme:C,isEditing:a,onEditingChange:h,setDocumentEditing:c}){const x=e.readOnly!==!0,N=X(e.sourcePath,e.language),d=K(),[v,p]=r.useState(i),u=G({sourcePath:e.sourcePath,cwd:m,loadedContent:i}),n=r.useRef(null),s=r.useRef(v),f=r.useRef(0),j=r.useRef(0),g=r.useRef(u.save),P=r.useRef(h);r.useEffect(()=>{s.current=v,g.current=u.save,P.current=h});const E=r.useCallback(l=>{f.current+=1,s.current=l,p(l),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{n.current=null,g.current(s.current)},W)},[]),S=()=>{f.current+=1,s.current=i,p(i),h(!0),c(o,!0)},A=async()=>{n.current&&(clearTimeout(n.current),n.current=null);const l=s.current,Q=f.current,B=++j.current,y=await g.current(l);if(y.status!=="changed"&&y.status!=="no_op"||f.current!==Q||j.current!==B||y.confirmed.content!==l)return;const T=y.confirmed;T.content===s.current&&d.setQueryData(w(m,e.sourcePath),_=>_&&{..._,content:T.content,hash:T.hash}),h(!1),c(o,!1)},F=()=>{d.invalidateQueries({queryKey:w(m,e.sourcePath)})};r.useEffect(()=>{a||!n.current||(clearTimeout(n.current),n.current=null)},[a]),r.useEffect(()=>()=>{n.current&&(clearTimeout(n.current),g.current(s.current)),c(o,!1),P.current(!1)},[o,c]);const D=()=>{const l=u.adoptDisk();l!=null&&p(l)},M=()=>{u.overwrite(s.current)},O=te(u.status),z=a?v:i;return t.jsxs("div",{className:"relative flex h-full flex-col",children:[t.jsxs("div",{className:"sticky top-0 z-10 flex h-0 items-start justify-end gap-2 pr-2",children:[x&&O&&t.jsx("span",{className:V("mt-3 text-xs",u.status==="error"?"text-destructive":"text-muted-foreground"),"aria-live":"polite",children:O}),!a&&t.jsx(R,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground mt-2",onClick:F,"aria-label":"Refresh from disk",children:t.jsx(I,{className:"size-4"})}),x&&t.jsx(R,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground mt-2",onClick:a?()=>void A():S,"aria-label":a?"Finish editing":"Edit file",children:a?t.jsx(U,{className:"size-4"}):t.jsx(Y,{className:"size-4"})})]}),u.status==="conflict"&&t.jsxs("div",{className:"bg-destructive/10 text-destructive mx-2 mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 rounded-md px-3 py-2 text-sm",children:[t.jsx("span",{className:"flex-1",children:"This file changed on disk since you opened it."}),t.jsx(R,{type:"button",variant:"ghost",size:"sm",className:"h-7",onClick:D,children:"Reload"}),t.jsx(R,{type:"button",variant:"destructive",size:"sm",className:"h-7",onClick:M,children:"Overwrite"})]}),t.jsx("div",{className:"min-h-0 flex-1",children:t.jsx(r.Suspense,{fallback:t.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading editor…"}),children:N?t.jsx("div",{className:"px-2 pb-6",children:t.jsx(J,{value:z,editable:a,onChange:a?E:void 0})}):t.jsx(Z,{value:z,editable:a,filename:e.sourcePath,languageHint:e.language,theme:C,onChange:a?E:void 0})})})]})}function k({children:e}){return t.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-8 text-center",children:t.jsx("p",{children:e})})}export{xe as CanvasFileContent};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeMirrorEditor-SkdXRKSN.js","assets/index-Dr-0P6rd.js","assets/index-ExcAk4pE.css","assets/index-DKQDBIWq.js","assets/index-C_uYJzKi.js","assets/BlintzCanvas-B7qs2dxW.js","assets/BlintzCanvas-GgiCXV7C.css"])))=>i.map(i=>d[i]);
2
+ import{ae as q,aN as b,aO as H,aj as $,r,j as t,af as K,Z as V,B as R,$ as U,aP as Y,aQ as L}from"./index-Dr-0P6rd.js";import{u as G}from"./use-session-canvas-BaXuEhw8.js";import{R as I}from"./rotate-cw-DrGRGSwy.js";import"./WidgetErrorCard-BQwrR6PJ.js";import"./card-BTgwskmX.js";import"./markdown-content-aNzh-54y.js";import"./table-P4N5xQn2.js";import"./package-CoTlAnXZ.js";import"./heart-Bp14wOx6.js";import"./git-branch-Dq_w3Iyx.js";import"./file-DlQX-hKl.js";import"./McpAppFrame-DmHduNgp.js";const Z=r.lazy(()=>L(()=>import("./CodeMirrorEditor-SkdXRKSN.js"),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.CodeMirrorEditor}))),J=r.lazy(()=>L(()=>import("./BlintzCanvas-B7qs2dxW.js"),__vite__mapDeps([5,1,2,4,6])).then(e=>({default:e.BlintzCanvas}))),W=500;function w(e,o){return["canvas-file",e,o]}function X(e,o){return o==="markdown"||/\.(md|markdown|mdx)$/i.test(e)}function ee(e){switch(e==null?void 0:e.code){case"NOT_FOUND":return"This file doesn’t exist.";case"NOT_A_FILE":return"This path is a directory, not a file.";case"TOO_LARGE":return"This file is too large to open here.";case"BINARY_FILE":return"This file isn’t text, so the editor can’t show it.";default:return"This file couldn’t be loaded."}}function te(e){switch(e){case"saving":return"Saving…";case"saved":return"Saved";case"error":return"Couldn’t save";default:return null}}function xe({content:e,documentId:o}){const m=q(),i=b(s=>s.selectedCwd),C=b(s=>s.setDocumentEditing),a=b(s=>{var f;return((f=s.openDocuments.find(j=>j.id===o))==null?void 0:f.editing)??!1}),h=H(),{data:c,error:x,isLoading:N}=$({queryKey:w(i,e.sourcePath),enabled:i!==null,queryFn:()=>m.readFileContent(i,e.sourcePath),staleTime:3e4,retry:!1}),[d,v]=r.useState(null),p=s=>{v(s&&c?{pinnedHash:c.hash}:null)};if(i===null)return t.jsx(k,{children:"Open a chat to view files."});if(N)return t.jsx(k,{children:"Loading file…"});if(x||!c)return t.jsx(k,{children:ee(x)});const u=d!==null&&a,n=(u?d==null?void 0:d.pinnedHash:null)??c.hash;return t.jsx(se,{content:e,documentId:o,cwd:i,loaded:c.content,theme:h,isEditing:u,onEditingChange:p,setDocumentEditing:C},`${e.sourcePath}:${n}`)}function se({content:e,documentId:o,cwd:m,loaded:i,theme:C,isEditing:a,onEditingChange:h,setDocumentEditing:c}){const x=e.readOnly!==!0,N=X(e.sourcePath,e.language),d=K(),[v,p]=r.useState(i),u=G({sourcePath:e.sourcePath,cwd:m,loadedContent:i}),n=r.useRef(null),s=r.useRef(v),f=r.useRef(0),j=r.useRef(0),g=r.useRef(u.save),P=r.useRef(h);r.useEffect(()=>{s.current=v,g.current=u.save,P.current=h});const E=r.useCallback(l=>{f.current+=1,s.current=l,p(l),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{n.current=null,g.current(s.current)},W)},[]),S=()=>{f.current+=1,s.current=i,p(i),h(!0),c(o,!0)},A=async()=>{n.current&&(clearTimeout(n.current),n.current=null);const l=s.current,Q=f.current,B=++j.current,y=await g.current(l);if(y.status!=="changed"&&y.status!=="no_op"||f.current!==Q||j.current!==B||y.confirmed.content!==l)return;const T=y.confirmed;T.content===s.current&&d.setQueryData(w(m,e.sourcePath),_=>_&&{..._,content:T.content,hash:T.hash}),h(!1),c(o,!1)},F=()=>{d.invalidateQueries({queryKey:w(m,e.sourcePath)})};r.useEffect(()=>{a||!n.current||(clearTimeout(n.current),n.current=null)},[a]),r.useEffect(()=>()=>{n.current&&(clearTimeout(n.current),g.current(s.current)),c(o,!1),P.current(!1)},[o,c]);const D=()=>{const l=u.adoptDisk();l!=null&&p(l)},M=()=>{u.overwrite(s.current)},O=te(u.status),z=a?v:i;return t.jsxs("div",{className:"relative flex h-full flex-col",children:[t.jsxs("div",{className:"sticky top-0 z-10 flex h-0 items-start justify-end gap-2 pr-2",children:[x&&O&&t.jsx("span",{className:V("mt-3 text-xs",u.status==="error"?"text-destructive":"text-muted-foreground"),"aria-live":"polite",children:O}),!a&&t.jsx(R,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground mt-2",onClick:F,"aria-label":"Refresh from disk",children:t.jsx(I,{className:"size-4"})}),x&&t.jsx(R,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground mt-2",onClick:a?()=>void A():S,"aria-label":a?"Finish editing":"Edit file",children:a?t.jsx(U,{className:"size-4"}):t.jsx(Y,{className:"size-4"})})]}),u.status==="conflict"&&t.jsxs("div",{className:"bg-destructive/10 text-destructive mx-2 mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 rounded-md px-3 py-2 text-sm",children:[t.jsx("span",{className:"flex-1",children:"This file changed on disk since you opened it."}),t.jsx(R,{type:"button",variant:"ghost",size:"sm",className:"h-7",onClick:D,children:"Reload"}),t.jsx(R,{type:"button",variant:"destructive",size:"sm",className:"h-7",onClick:M,children:"Overwrite"})]}),t.jsx("div",{className:"min-h-0 flex-1",children:t.jsx(r.Suspense,{fallback:t.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading editor…"}),children:N?t.jsx("div",{className:"px-2 pb-6",children:t.jsx(J,{value:z,editable:a,onChange:a?E:void 0})}):t.jsx(Z,{value:z,editable:a,filename:e.sourcePath,languageHint:e.language,theme:C,onChange:a?E:void 0})})})]})}function k({children:e}){return t.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-8 text-center",children:t.jsx("p",{children:e})})}export{xe as CanvasFileContent};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Model3dViewer-D9HznL8w.js","assets/index-BZKMWkth.js","assets/index-ExcAk4pE.css"])))=>i.map(i=>d[i]);
2
- import{ae as n,aN as u,r as l,j as t,aQ as d}from"./index-BZKMWkth.js";import{r as m}from"./use-session-canvas-8hTR83y8.js";import"./rotate-cw-TrlUqVdq.js";import"./WidgetErrorCard-l8cP9oJc.js";import"./card-CTGm0Blo.js";import"./markdown-content-plNIomQc.js";import"./table-BJDpTBxJ.js";import"./package-B7amjGSw.js";import"./heart-cgLUdSV5.js";import"./git-branch-D9jctpSd.js";import"./file-B6neiwXF.js";import"./McpAppFrame-DcPNmy1o.js";const f=l.lazy(()=>d(()=>import("./Model3dViewer-D9HznL8w.js"),__vite__mapDeps([0,1,2])).then(r=>({default:r.Model3dViewer})));function p(r){var s;const e=(s=r.split(".").pop())==null?void 0:s.toLowerCase();return e==="glb"||e==="gltf"?"gltf":e==="stl"?"stl":e==="obj"?"obj":e==="3mf"?"3mf":e==="ply"?"ply":e==="fbx"?"fbx":e==="dae"?"dae":null}function D({content:r}){const e=n(),s=u(o=>o.selectedCwd),i=l.useMemo(()=>m(r.src,o=>e.mediaUrl(s??"",o)),[r.src,e,s]),a=l.useMemo(()=>p(r.src),[r.src]);return i.url===null||a===null?t.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-8 text-center",children:t.jsx("p",{children:"This 3D model can’t be displayed here."})}):t.jsx("div",{className:"bg-muted/40 h-full w-full",children:t.jsx(l.Suspense,{fallback:t.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading 3D viewer…"}),children:t.jsx(f,{url:i.url,format:a,label:r.title??"Canvas 3D model"})})})}export{D as CanvasModel3dContent,p as formatOf};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Model3dViewer-BZEdR7-9.js","assets/index-Dr-0P6rd.js","assets/index-ExcAk4pE.css"])))=>i.map(i=>d[i]);
2
+ import{ae as n,aN as u,r as l,j as t,aQ as d}from"./index-Dr-0P6rd.js";import{r as m}from"./use-session-canvas-BaXuEhw8.js";import"./rotate-cw-DrGRGSwy.js";import"./WidgetErrorCard-BQwrR6PJ.js";import"./card-BTgwskmX.js";import"./markdown-content-aNzh-54y.js";import"./table-P4N5xQn2.js";import"./package-CoTlAnXZ.js";import"./heart-Bp14wOx6.js";import"./git-branch-Dq_w3Iyx.js";import"./file-DlQX-hKl.js";import"./McpAppFrame-DmHduNgp.js";const f=l.lazy(()=>d(()=>import("./Model3dViewer-BZEdR7-9.js"),__vite__mapDeps([0,1,2])).then(r=>({default:r.Model3dViewer})));function p(r){var s;const e=(s=r.split(".").pop())==null?void 0:s.toLowerCase();return e==="glb"||e==="gltf"?"gltf":e==="stl"?"stl":e==="obj"?"obj":e==="3mf"?"3mf":e==="ply"?"ply":e==="fbx"?"fbx":e==="dae"?"dae":null}function D({content:r}){const e=n(),s=u(o=>o.selectedCwd),i=l.useMemo(()=>m(r.src,o=>e.mediaUrl(s??"",o)),[r.src,e,s]),a=l.useMemo(()=>p(r.src),[r.src]);return i.url===null||a===null?t.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-8 text-center",children:t.jsx("p",{children:"This 3D model can’t be displayed here."})}):t.jsx("div",{className:"bg-muted/40 h-full w-full",children:t.jsx(l.Suspense,{fallback:t.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading 3D viewer…"}),children:t.jsx(f,{url:i.url,format:a,label:r.title??"Canvas 3D model"})})})}export{D as CanvasModel3dContent,p as formatOf};