limixbot 0.2.12 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/dist/assets/{ActivityPanel-BHCUppbs.js → ActivityPanel-O6Su2c-u.js} +1 -1
  2. package/dist/assets/{App-D93hKk8l.js → App-Bcey1qup.js} +108 -108
  3. package/dist/assets/{AppEventEditor-tGh5VM2Z.js → AppEventEditor-BlJGPJ3Z.js} +1 -1
  4. package/dist/assets/{BotSettingsDialog-D6Y7Bflm.js → BotSettingsDialog-PiCk9us7.js} +4 -4
  5. package/dist/assets/{BrowserPanel-k55-4cIw.js → BrowserPanel-BWcb5CXi.js} +1 -1
  6. package/dist/assets/{BrowserProfilesManager-BRZM0q_M.js → BrowserProfilesManager-dKHyQotG.js} +1 -1
  7. package/dist/assets/{CloudAddDialog-BZQDNnKi.js → CloudAddDialog-D1ZSbkxV.js} +1 -1
  8. package/dist/assets/{ComputerFilesPane-DAQhcfSG.js → ComputerFilesPane-wgtikCgi.js} +1 -1
  9. package/dist/assets/{ComputerPanel-ExjbTj4s.js → ComputerPanel-Cyj53a7W.js} +2 -2
  10. package/dist/assets/{DataPanel-DRPDfcrQ.js → DataPanel-BlBidswi.js} +1 -1
  11. package/dist/assets/{DesktopViewer-D9jr2w9X.js → DesktopViewer-D7JeLJbi.js} +1 -1
  12. package/dist/assets/{FilesView-CplahKQt.js → FilesView-CNkEKeZB.js} +1 -1
  13. package/dist/assets/{GrokMoveDialog-Cc5o6HuE.js → GrokMoveDialog-fyBulzXL.js} +2 -2
  14. package/dist/assets/{InspectorPanel-B5iY0Ism.js → InspectorPanel-Cut2OqiB.js} +1 -1
  15. package/dist/assets/{KeyboardShortcutsModal-DhUpWvIZ.js → KeyboardShortcutsModal-DnxUB4cd.js} +1 -1
  16. package/dist/assets/{LiveDesktop-DRcJOYg3.js → LiveDesktop-CnbyXW61.js} +1 -1
  17. package/dist/assets/{LocalVmWorkspace-CrRyugwl.js → LocalVmWorkspace-D9xFPGF0.js} +1 -1
  18. package/dist/assets/{MacLocalControl-D2pf75xx.js → MacLocalControl-CpswtfCI.js} +1 -1
  19. package/dist/assets/{MarkdownFilePreview-CLYypRvz.js → MarkdownFilePreview-V-y-0ksi.js} +1 -1
  20. package/dist/assets/{MenuMotion-CNjHVOE4.js → MenuMotion-VeZ_fZ8M.js} +1 -1
  21. package/dist/assets/NewBotDialog-rBjsSV0e.js +1 -0
  22. package/dist/assets/{PhoneAppDialog-EKN4JV-B.js → PhoneAppDialog-DAW1N-hM.js} +1 -1
  23. package/dist/assets/{PlacesRail-eySktVNq.js → PlacesRail-C_3Mh4C8.js} +1 -1
  24. package/dist/assets/{PluginsPanel-D8Kw3j_E.js → PluginsPanel-CMsgWSNg.js} +1 -1
  25. package/dist/assets/{ProIntroduction-Dutut6C-.js → ProIntroduction-6ByF2_US.js} +1 -1
  26. package/dist/assets/{RemoteAgentSettingsPanel-BuNfrHcn.js → RemoteAgentSettingsPanel-D4X4rHMQ.js} +1 -1
  27. package/dist/assets/{RoomPanel-vlOHVr2o.js → RoomPanel-mg6M04wy.js} +1 -1
  28. package/dist/assets/{RoutinesPage-Dgl6g38a.js → RoutinesPage-DomuZMUT.js} +2 -2
  29. package/dist/assets/{SettingsModal-B6mWaU4-.js → SettingsModal-Dd9l0b2C.js} +1 -1
  30. package/dist/assets/{ShareTeamDialog-BNMxpMeG.js → ShareTeamDialog-B_0Gr8Mq.js} +1 -1
  31. package/dist/assets/{SignedInSites-rqBhWQLe.js → SignedInSites-C-eqeBxT.js} +1 -1
  32. package/dist/assets/TeamLibraryPanel-DpXOFOQr.js +1 -0
  33. package/dist/assets/{TeamMapPage-BPNPSuOR.js → TeamMapPage-CIQPYaxL.js} +1 -1
  34. package/dist/assets/{TriggersPage--eDtuNSl.js → TriggersPage-D7RDjrjV.js} +1 -1
  35. package/dist/assets/{VisibilitySection-BCqfMHFk.js → VisibilitySection-Bimhk6c5.js} +1 -1
  36. package/dist/assets/{WebhookTrigger-AXmqIpLx.js → WebhookTrigger-D5c2bPJu.js} +1 -1
  37. package/dist/assets/{WorksOnGrid-IvyvcWBI.js → WorksOnGrid-PZ-caKHg.js} +1 -1
  38. package/dist/assets/{abnfDiagram-YUKMZFIV-CNbBpzNE.js → abnfDiagram-YUKMZFIV-D7az-C1J.js} +1 -1
  39. package/dist/assets/{activity-CtCHrNz-.js → activity-W_ia4q-Y.js} +1 -1
  40. package/dist/assets/{architectureDiagram-47P4ROYG-BZ3BXsFv.js → architectureDiagram-47P4ROYG-B2IC9169.js} +1 -1
  41. package/dist/assets/{blockDiagram-E7TT5TSB-9DpYtThS.js → blockDiagram-E7TT5TSB-FnweBzU4.js} +1 -1
  42. package/dist/assets/{c4Diagram-CRA5TL53-C9ygyYDI.js → c4Diagram-CRA5TL53-rxgwSaAP.js} +1 -1
  43. package/dist/assets/{calendar-days-7b_rKY9F.js → calendar-days-wM1DS-Cu.js} +1 -1
  44. package/dist/assets/channel-BQyC_QMX.js +1 -0
  45. package/dist/assets/{chunk-2Q5K7J3B-DXA1dGYf.js → chunk-2Q5K7J3B-B7yhqEe8.js} +1 -1
  46. package/dist/assets/{chunk-5VM5RSS4-Cmdn6u6A.js → chunk-5VM5RSS4-Sw6phnaf.js} +1 -1
  47. package/dist/assets/{chunk-7TKQ45FW-C6_3KbD6.js → chunk-7TKQ45FW-CheglUSd.js} +1 -1
  48. package/dist/assets/{chunk-AW2ZBBNX-DE_9xcGW.js → chunk-AW2ZBBNX-CswkqPkf.js} +1 -1
  49. package/dist/assets/{chunk-FVRAUYC3-DeXezLUR.js → chunk-FVRAUYC3-DeN53o4S.js} +2 -2
  50. package/dist/assets/{chunk-HTAEGDNF-WoJSboze.js → chunk-HTAEGDNF-CCZ_Udf0.js} +1 -1
  51. package/dist/assets/{chunk-JWPE2WC7-BarwLFEj.js → chunk-JWPE2WC7-nG1rfC9P.js} +1 -1
  52. package/dist/assets/{chunk-KQW6MTUR-DZV0Hgcq.js → chunk-KQW6MTUR-Bh_TxL0e.js} +1 -1
  53. package/dist/assets/{chunk-XXDRQBXY-XRA7d5ef.js → chunk-XXDRQBXY-CLIJBS-V.js} +1 -1
  54. package/dist/assets/{classDiagram-v2-K4WV4PDN-BB9-8H0H.js → classDiagram-v2-K4WV4PDN-B04FntQx.js} +1 -1
  55. package/dist/assets/{coins-RZxks5Iq.js → coins-81htcDNx.js} +1 -1
  56. package/dist/assets/{core-CNxiO5i6.js → core-BLAzrox0.js} +1 -1
  57. package/dist/assets/{cose-bilkent-JH36ORCC-DlAty1qX.js → cose-bilkent-JH36ORCC-D9PAieWF.js} +1 -1
  58. package/dist/assets/{cynefin-EF2NZ3EQ-DjVt4mTB.js → cynefin-EF2NZ3EQ-BAC2DRg5.js} +1 -1
  59. package/dist/assets/{cynefinDiagram-3GCD6N5R-BP3mxzbM.js → cynefinDiagram-3GCD6N5R-Cc3k_C-5.js} +1 -1
  60. package/dist/assets/{dagre-W4DXFKR2-D6R89cka.js → dagre-W4DXFKR2-CpbzxBGo.js} +1 -1
  61. package/dist/assets/{diagram-2UJZ2QOL-ED6ZLR9P.js → diagram-2UJZ2QOL-d22NGVzG.js} +1 -1
  62. package/dist/assets/{diagram-OVF4WLC6-DS5DPgfj.js → diagram-OVF4WLC6-BFTJTNpN.js} +1 -1
  63. package/dist/assets/{diagram-PFPMY2P6-CkwWFUys.js → diagram-PFPMY2P6-CA_YgAo3.js} +1 -1
  64. package/dist/assets/{diagram-UMYRVEAY-B6_INDe2.js → diagram-UMYRVEAY-CCsuWndY.js} +1 -1
  65. package/dist/assets/{diagram-YEKJPTXX-Dt30zl92.js → diagram-YEKJPTXX-Bcwhmpgl.js} +1 -1
  66. package/dist/assets/{diagram-ZIFT7M5P-BWQrszzW.js → diagram-ZIFT7M5P-Bs1iIjhq.js} +1 -1
  67. package/dist/assets/{ebnfDiagram-VR2GEFS7-B40bZpn4.js → ebnfDiagram-VR2GEFS7-CFr96fLM.js} +1 -1
  68. package/dist/assets/{elk-IJKZMXRS-BOAPURLs.js → elk-IJKZMXRS-DSdTG_hW.js} +1 -1
  69. package/dist/assets/{erDiagram-O2IAPWRE-DhIN8EFk.js → erDiagram-O2IAPWRE-BGdMdwi1.js} +1 -1
  70. package/dist/assets/{file-up-Dg7JsLFP.js → file-up-DvGMRF5I.js} +1 -1
  71. package/dist/assets/{flowDiagram-OXPTDLAJ-o61yZ5Jp.js → flowDiagram-OXPTDLAJ-DL25A20O.js} +1 -1
  72. package/dist/assets/{ganttDiagram-R7TSEDQI-DKwTsk_A.js → ganttDiagram-R7TSEDQI-DQaNIRGv.js} +1 -1
  73. package/dist/assets/{gitGraphDiagram-XJZIOB7I-Dqte4h2a.js → gitGraphDiagram-XJZIOB7I-B6ypA1ZF.js} +1 -1
  74. package/dist/assets/{import-name-BpcY7eF3.js → import-name-Cdh9ZlkK.js} +1 -1
  75. package/dist/assets/{index-y3wal1WK.js → index-BaW02tJl.js} +1 -1
  76. package/dist/assets/{index-Df4sIScD.js → index-CxcnLo81.js} +1 -1
  77. package/dist/assets/{index-CN3qYQZ7.js → index-oVds-_Vz.js} +2 -2
  78. package/dist/assets/{infoDiagram-5W2HQ5XZ-CeOhDqP5.js → infoDiagram-5W2HQ5XZ-8YbtI4S4.js} +1 -1
  79. package/dist/assets/{ishikawaDiagram-K3B6WC7H-BLxBG4Ku.js → ishikawaDiagram-K3B6WC7H-DYpDWk2K.js} +1 -1
  80. package/dist/assets/{journeyDiagram-COXZFDF6-a7-OqFVb.js → journeyDiagram-COXZFDF6-BUd8Vnbq.js} +1 -1
  81. package/dist/assets/{kanban-definition-P3RFRI5V-BpqE9wv9.js → kanban-definition-P3RFRI5V-AywqsEBB.js} +1 -1
  82. package/dist/assets/{mcp-servers-Cb7NFF4i.js → mcp-servers-Bu5RuYBT.js} +1 -1
  83. package/dist/assets/{mermaid.core-DCkDS2l6.js → mermaid.core-B5yiNmEY.js} +4 -4
  84. package/dist/assets/{mindmap-definition-LZFPQGKD-CbVxI-Dw.js → mindmap-definition-LZFPQGKD-DRALSCg6.js} +1 -1
  85. package/dist/assets/{minimize-BzhEcU2C.js → minimize-CWsi9mRL.js} +1 -1
  86. package/dist/assets/{monitor-tq9gQZRc.js → monitor-c1mf38zt.js} +1 -1
  87. package/dist/assets/{new-bot-FZ7p0MaB.js → new-bot-mp2gi3ed.js} +1 -1
  88. package/dist/assets/{org-library-BurlfP-M.js → org-library-Bi3EieNo.js} +1 -1
  89. package/dist/assets/{package-format-B2CMS446.js → package-format-CaPiTXn3.js} +1 -1
  90. package/dist/assets/{pegDiagram-BGZESJAR-JzbTYrpF.js → pegDiagram-BGZESJAR-Drj_UJz5.js} +1 -1
  91. package/dist/assets/{pieDiagram-CAPJLFHJ-FJGAn2CJ.js → pieDiagram-CAPJLFHJ-CL7MryRt.js} +1 -1
  92. package/dist/assets/{quadrantDiagram-GDMTTRAM-BH0XP_4R.js → quadrantDiagram-GDMTTRAM-BvWxqPJn.js} +1 -1
  93. package/dist/assets/{rail-Cq1USSn9.js → rail-DApFzTxo.js} +1 -1
  94. package/dist/assets/{railroadDiagram-SM67HX2B-DdmOm9v7.js → railroadDiagram-SM67HX2B-CGfR0UsO.js} +1 -1
  95. package/dist/assets/{remote-desktop-panel-ByjBIDKD.js → remote-desktop-panel-B4uIIoh3.js} +1 -1
  96. package/dist/assets/{requirementDiagram-X7JNWC4A-CmHsqVU3.js → requirementDiagram-X7JNWC4A-CJq96anP.js} +1 -1
  97. package/dist/assets/{sankeyDiagram-UM26HJRW-20UkT1qC.js → sankeyDiagram-UM26HJRW-BdZSA65i.js} +1 -1
  98. package/dist/assets/{sequenceDiagram-ZO4K6R2Y-DbOCvva9.js → sequenceDiagram-ZO4K6R2Y-B5W6udgn.js} +1 -1
  99. package/dist/assets/{sizeCapture-INFHLROL-BiRygHwv.js → sizeCapture-INFHLROL-CuKCNVLn.js} +1 -1
  100. package/dist/assets/{stateDiagram-v2-TBUQTH76-_b0RTe98.js → stateDiagram-v2-TBUQTH76-C7mAgpvB.js} +1 -1
  101. package/dist/assets/{styles-b2tBrp-F.js → styles-C_rlkDrt.js} +2 -2
  102. package/dist/assets/styles-bUbK33f1.css +1 -0
  103. package/dist/assets/{swimlanes-N4OXWK64-Cph2675B.js → swimlanes-N4OXWK64-D-mimAU7.js} +1 -1
  104. package/dist/assets/swimlanesDiagram-K3J5GTZL-Dn31PG7h.js +8 -0
  105. package/dist/assets/{team-share-BegoEw7-.js → team-share-wuAG66b7.js} +1 -1
  106. package/dist/assets/{timeline-definition-YOQAKGHF-2fj61Rzb.js → timeline-definition-YOQAKGHF-C5prnOXi.js} +1 -1
  107. package/dist/assets/{usecaseDiagram-VIAY4XPW-Cfx3YEF_.js → usecaseDiagram-VIAY4XPW-BC-9KKSF.js} +1 -1
  108. package/dist/assets/{vennDiagram-BLWOH2XV-BX_M6eTv.js → vennDiagram-BLWOH2XV-LCNTQN9e.js} +1 -1
  109. package/dist/assets/{vi-KgT8L8Qj.js → vi-NX09tr5q.js} +1 -1
  110. package/dist/assets/{wardleyDiagram-YMQ3BMBF-BfDn4ghH.js → wardleyDiagram-YMQ3BMBF-CtWGEzVU.js} +1 -1
  111. package/dist/assets/{xychartDiagram-TAQBALBS-CqrDBgpf.js → xychartDiagram-TAQBALBS-DadPRdBp.js} +1 -1
  112. package/dist/index.html +3 -3
  113. package/dist/rail.html +5 -5
  114. package/dist-server/container-mcp.js +22 -21
  115. package/dist-server/index.js +106 -105
  116. package/dist-server/openmausbot.js +24 -24
  117. package/dist-server/package.json +1 -1
  118. package/dist-server/pair-cli.js +24 -24
  119. package/dist-server/server/config.js +6 -1
  120. package/dist-server/server/container-computer.js +4 -4
  121. package/dist-server/server/host/team-connections-host.js +2 -2
  122. package/dist-server/server/index.js +20 -3
  123. package/dist-server/server/mcp-registry.js +2 -2
  124. package/dist-server/server/service-unit.js +1 -1
  125. package/dist-server/server/skill-library.js +1 -1
  126. package/dist-server/server/team-library.js +2 -2
  127. package/dist-server/shared/grok-import.js +1 -1
  128. package/dist-server/shared/package-format.js +3 -3
  129. package/dist-server/vps-container-mcp.js +22 -21
  130. package/dist-server/workspace-backup.worker.js +20 -20
  131. package/package.json +1 -1
  132. package/dist/assets/NewBotDialog-CuYIfLJL.js +0 -1
  133. package/dist/assets/TeamLibraryPanel-pCffPnk4.js +0 -1
  134. package/dist/assets/channel-CkUESPbF.js +0 -1
  135. package/dist/assets/styles-D-yh7Z23.css +0 -1
  136. package/dist/assets/swimlanesDiagram-K3J5GTZL-DqgQUDUL.js +0 -8
@@ -1529,26 +1529,26 @@ map(partitionId=>partitionId.toLowerCase())]);rawBases.forEach((base,index)=>{if
1529
1529
  index)>score(current)&&partitionWinner.set(folded,index)});let effectivePartitions=requestedPartitions.map((partitionId,index)=>partitionWinner.get(partitionId.toLowerCase())===index?partitionId:canonicalIds[index]),conflictingIdOwners=new Set;canonicalIds.forEach((id2,owner)=>{effectivePartitions.forEach((partitionId,partitionOwner)=>{partitionOwner!==owner&&partitionId.toLowerCase()===id2&&conflictingIdOwners.add(owner)})});let unavailable=new Set([...reserved,...used]);for(let owner of conflictingIdOwners){
1530
1530
  let id2=suffixedBrowserProfileId(rawBases[owner],unavailable);canonicalIds[owner]=id2,unavailable.add(id2)}conflictingIdOwners.size>0&&(effectivePartitions=requestedPartitions.map((partitionId,index)=>partitionWinner.get(partitionId.toLowerCase())===index?partitionId:canonicalIds[index]));let aliases=new Map;return{profiles:profiles.map((profile,index)=>{let id2=canonicalIds[index],partitionId=effectivePartitions[index],migrated={id:id2,name:profile.name};return profile.browser&&(migrated.browser=
1531
1531
  profile.browser),partitionId!==id2&&(migrated.partitionId=partitionId),aliases.has(profile.id)||aliases.set(profile.id,id2),migrated}),aliases}}var legacyBrowserProfilesSchema=external_exports.array(legacyBrowserProfileSchema).max(20),storedBrowserProfilesSchema=legacyBrowserProfilesSchema.transform(profiles=>migrateStoredBrowserProfiles(profiles).profiles),browserProfilesSchema=external_exports.array(browserProfileSchema).max(20).superRefine((profiles,ctx)=>{let seen=new Set;profiles.forEach((profile,index)=>{
1532
- if(!seen.has(profile.id)){seen.add(profile.id);return}ctx.addIssue({code:"custom",path:[index,"id"],message:`browser profile id ${profile.id} is duplicated`})})}),featureConfigSchema=external_exports.object({skillAuthoring:external_exports.boolean().optional(),skillReview:external_exports.boolean().optional(),skillReviewSteps:external_exports.number().int().min(3).max(100).optional(),showToolCalls:external_exports.boolean().optional(),browser:external_exports.boolean().optional(),sharedComputers:external_exports.
1533
- boolean().optional(),claudeUserMcp:external_exports.boolean().optional(),claudeUserSkills:external_exports.boolean().optional(),llmThreadTitles:external_exports.boolean().optional(),smartSetupChoices:external_exports.boolean().optional(),autoRecall:external_exports.boolean().optional(),skillsLibrary:external_exports.boolean().optional(),shareLearnedSkills:external_exports.enum(["off","ask","auto"]).optional(),roomMemoryCapture:external_exports.boolean().optional(),parallelRoomJobs:external_exports.
1534
- boolean().optional(),acpPlanLines:external_exports.boolean().optional()}).extend({agentsToolBridge:external_exports.boolean().optional(),savedSteps:external_exports.boolean().optional()}),onboardingConfigSchema=external_exports.object({completedAt:external_exports.string().trim().max(40).optional(),version:external_exports.number().int().min(0).max(1e3).optional(),reelSeen:external_exports.boolean().optional(),hintsSeen:external_exports.array(external_exports.string().trim().min(1).max(60)).max(
1535
- 100).optional(),firstTurnAt:external_exports.string().trim().max(40).optional()}).strict(),instanceConfigSchema=external_exports.object({driver:external_exports.string().min(1),displayName:optionalText2,accentColor:optionalText2,icon:external_exports.discriminatedUnion("kind",[external_exports.object({kind:external_exports.literal("preset"),preset:external_exports.enum(PROVIDER_ICON_PRESETS)}).strict(),external_exports.object({kind:external_exports.literal("custom"),dataUrl:external_exports.string()}).
1536
- strict().refine(icon=>providerIconError(icon)===null,{message:"Invalid provider icon"})]).optional(),environment:external_exports.record(external_exports.string(),external_exports.string()).optional(),enabled:external_exports.boolean().optional(),hidden:external_exports.boolean().optional(),access:external_exports.enum(["subscription","custom","api"]).optional(),config:external_exports.json().optional()}),instanceConfigMapSchema=external_exports.record(external_exports.string(),instanceConfigSchema),
1537
- defaultModelSelectionSchema=external_exports.object({instanceId:external_exports.string().trim().min(1).max(200),model:external_exports.string().trim().min(1).max(500),effort:external_exports.enum(EFFORT_LEVELS).optional(),variant:external_exports.string().refine(isModelVariant,"invalid model variant").optional()}).refine(selection=>selection.variant===void 0||selection.effort===void 0,"choose either a model variant or an effort level"),automaticRecoverySchema=external_exports.object({enabled:external_exports.
1538
- boolean(),backup:defaultModelSelectionSchema.optional()}).strict().refine(recovery=>!recovery.enabled||recovery.backup!==void 0,{message:"Choose a backup model before enabling automatic recovery",path:["backup"]}),cacheKeepWarmSchema=external_exports.object({enabled:external_exports.boolean(),windowMinutes:external_exports.number().int().min(15).max(1440).optional()}).strict(),threadsConfigSchema=external_exports.object({maxConcurrentPerBot:external_exports.number().int().min(1).max(MAX_CONCURRENT_BOT_THREADS),
1539
- eventLogMaxBytes:external_exports.number().int().min(MIN_THREAD_EVENT_LOG_BYTES).max(MAX_THREAD_EVENT_LOG_BYTES).optional(),eventLogRetentionDays:external_exports.number().int().min(1).max(3650).optional()}).strict(),newBotsConfigSchema=external_exports.object({effort:external_exports.enum(EFFORT_LEVELS).optional()}).strict(),newBotsPatchSchema=external_exports.object({effort:newBotsConfigSchema.shape.effort.nullable()}).strict(),threadsPatchSchema=threadsConfigSchema.extend({maxConcurrentPerBot:threadsConfigSchema.
1540
- shape.maxConcurrentPerBot.optional(),eventLogMaxBytes:threadsConfigSchema.shape.eventLogMaxBytes.nullable(),eventLogRetentionDays:threadsConfigSchema.shape.eventLogRetentionDays.nullable()}),appConfigSchema=external_exports.object({customDomain:external_exports.string().optional(),signIn:external_exports.object({admins:external_exports.array(external_exports.string().max(320)).max(500).optional(),members:external_exports.array(external_exports.string().max(320)).max(5e3).optional()}).optional(),
1541
- defaultModelSelection:defaultModelSelectionSchema.optional(),automaticRecovery:automaticRecoverySchema.optional(),cacheKeepWarm:cacheKeepWarmSchema.optional(),newBotDefaults:newBotDefaultsSchema.optional(),newBots:newBotsConfigSchema.optional(),cliStartup:external_exports.object({access:external_exports.enum(["local","tunnel","tailscale","public-url"]),publicUrl:external_exports.string().url().optional(),phone:external_exports.enum(["ios","android"]).optional()}).optional(),mistral:external_exports.
1542
- object({key:optionalText2}).optional(),cerebras:external_exports.object({key:optionalText2}).optional(),treg:external_exports.object({key:optionalText2}).optional(),postiz:external_exports.object({key:optionalText2,url:optionalText2}).optional(),groq:external_exports.object({key:optionalText2,url:optionalText2}).optional(),greenference:external_exports.object({key:optionalText2}).optional(),modelgo:external_exports.object({key:optionalText2}).optional(),meta:external_exports.object({key:optionalText2,
1543
- url:optionalText2}).optional(),deepseek:external_exports.object({key:optionalText2}).optional(),xai:external_exports.object({key:optionalText2,url:optionalText2}).optional(),anthropic:external_exports.object({key:optionalText2,url:optionalText2,everyClaudeBot:external_exports.boolean().optional()}).optional(),openai:external_exports.object({key:optionalText2}).optional(),openrouter:external_exports.object({key:optionalText2}).optional(),budgets:external_exports.object({monthlyUsd:external_exports.
1544
- number().min(0).max(1e6).optional(),warnAtPercent:external_exports.number().int().min(1).max(100).optional()}).optional(),billing:external_exports.object({currency:external_exports.string().regex(/^[A-Z]{3}$/).optional(),prices:external_exports.record(external_exports.string().min(1).max(160),external_exports.object({inputPerMillion:external_exports.number().min(0).max(1e6),outputPerMillion:external_exports.number().min(0).max(1e6),cachedInputPerMillion:external_exports.number().min(0).max(1e6).
1545
- optional()})).optional()}).optional(),openaiCompat:external_exports.object({key:optionalText2,url:optionalText2,model:optionalText2,provider:optionalText2}).optional(),composio:external_exports.object({apiKey:optionalText2,userId:optionalText2,sessionId:optionalText2}).optional(),box:external_exports.object({token:optionalText2}).optional(),vps:vpsConfigSchema.optional(),opencodeGo:external_exports.object({apiKey:optionalText2,providerKeys:external_exports.record(external_exports.string(),external_exports.
1546
- string()).optional()}).optional(),tts:external_exports.object({key:optionalText2,fishKey:optionalText2,geminiKey:optionalText2,voice:optionalText2,provider:external_exports.enum(["elevenlabs","fish","system","chatterbox","xai","gemini","openai"]).optional(),baseUrl:external_exports.string().trim().max(2048).refine(value=>!value||/^https?:\/\//i.test(value),"the Chatterbox server address must start with http:// or https://").optional(),model:optionalText2,fishModel:external_exports.enum(FISH_TTS_MODELS).
1547
- optional(),everyReply:external_exports.boolean().optional()}).optional(),decider:deciderConfigSchema.optional(),live:liveConfigSchema.optional(),imageGen:imageGenConfigSchema.optional(),everyBotRules:external_exports.string().max(24e3).optional(),profile:external_exports.object({name:optionalText2,email:optionalText2,aboutMe:external_exports.string().max(24e3).optional(),avatarUrl:external_exports.union([external_exports.literal(""),botAvatarUrlSchema]).optional()}).optional(),language:optionalText2,
1548
- computerName:external_exports.string().trim().max(63).optional(),rooms:roomConfigSchema.optional(),mcp:mcpConfigSchema.optional(),context:external_exports.object({compactAt:external_exports.number().positive().max(1e7).optional(),autoCompact:external_exports.boolean().optional()}).extend(roomContextSettings).extend(replaySettings).optional(),memory:external_exports.object({captureQuietMs:external_exports.number().int().min(1e3).max(1440*6e4).optional(),tidyHour:external_exports.number().int().min(
1549
- 0).max(23).optional()}).strict().optional(),threads:threadsConfigSchema.optional(),burst:external_exports.object({maxParallel:external_exports.number().int().min(1).max(100).optional()}).strict().optional(),decisions:external_exports.object({retentionDays:external_exports.number().int().min(1).max(3650).optional()}).strict().optional(),loopGuard:loopGuardConfigSchema.optional(),safetyFloor:external_exports.object({enabled:external_exports.boolean().optional()}).strict().optional(),localVm:localVmConfigSchema.
1550
- optional(),features:featureConfigSchema.optional(),onboarding:onboardingConfigSchema.optional(),browserEngine:browserEngineConfigSchema.optional(),browserProfiles:browserProfilesSchema.optional(),instances:instanceConfigMapSchema.optional(),mcpServers:external_exports.record(external_exports.string(),external_exports.unknown()).optional()}),storedAppConfigSchema=appConfigSchema.extend(helperStoredShape).extend({browserProfiles:storedBrowserProfilesSchema.optional(),opencodeGo:external_exports.object(
1551
- {apiKey:optionalText2,providerKeys:external_exports.record(external_exports.string(),external_exports.unknown()).catch({}).transform(keys=>Object.fromEntries(Object.entries(keys).filter(entry=>typeof entry[1]=="string"))).optional()}).optional()}),appConfigPatchSchema=appConfigSchema.omit({instances:!0,mcpServers:!0,cliStartup:!0,customDomain:!0}).extend({threads:threadsPatchSchema.optional(),newBots:newBotsPatchSchema.optional(),imageGen:imageGenPatchSchema.optional()}),jsonObjectSchema2=external_exports.
1532
+ if(!seen.has(profile.id)){seen.add(profile.id);return}ctx.addIssue({code:"custom",path:[index,"id"],message:`browser profile id ${profile.id} is duplicated`})})}),featureConfigSchema=external_exports.object({skillAuthoring:external_exports.boolean().optional(),skillReview:external_exports.boolean().optional(),skillAutoApply:external_exports.boolean().optional(),skillReviewSteps:external_exports.number().int().min(3).max(100).optional(),showToolCalls:external_exports.boolean().optional(),browser:external_exports.
1533
+ boolean().optional(),sharedComputers:external_exports.boolean().optional(),claudeUserMcp:external_exports.boolean().optional(),claudeUserSkills:external_exports.boolean().optional(),llmThreadTitles:external_exports.boolean().optional(),smartSetupChoices:external_exports.boolean().optional(),autoRecall:external_exports.boolean().optional(),skillsLibrary:external_exports.boolean().optional(),shareLearnedSkills:external_exports.enum(["off","ask","auto"]).optional(),roomMemoryCapture:external_exports.
1534
+ boolean().optional(),parallelRoomJobs:external_exports.boolean().optional(),acpPlanLines:external_exports.boolean().optional()}).extend({agentsToolBridge:external_exports.boolean().optional(),savedSteps:external_exports.boolean().optional()}),onboardingConfigSchema=external_exports.object({completedAt:external_exports.string().trim().max(40).optional(),version:external_exports.number().int().min(0).max(1e3).optional(),reelSeen:external_exports.boolean().optional(),hintsSeen:external_exports.array(
1535
+ external_exports.string().trim().min(1).max(60)).max(100).optional(),firstTurnAt:external_exports.string().trim().max(40).optional()}).strict(),instanceConfigSchema=external_exports.object({driver:external_exports.string().min(1),displayName:optionalText2,accentColor:optionalText2,icon:external_exports.discriminatedUnion("kind",[external_exports.object({kind:external_exports.literal("preset"),preset:external_exports.enum(PROVIDER_ICON_PRESETS)}).strict(),external_exports.object({kind:external_exports.
1536
+ literal("custom"),dataUrl:external_exports.string()}).strict().refine(icon=>providerIconError(icon)===null,{message:"Invalid provider icon"})]).optional(),environment:external_exports.record(external_exports.string(),external_exports.string()).optional(),enabled:external_exports.boolean().optional(),hidden:external_exports.boolean().optional(),access:external_exports.enum(["subscription","custom","api"]).optional(),config:external_exports.json().optional()}),instanceConfigMapSchema=external_exports.
1537
+ record(external_exports.string(),instanceConfigSchema),defaultModelSelectionSchema=external_exports.object({instanceId:external_exports.string().trim().min(1).max(200),model:external_exports.string().trim().min(1).max(500),effort:external_exports.enum(EFFORT_LEVELS).optional(),variant:external_exports.string().refine(isModelVariant,"invalid model variant").optional()}).refine(selection=>selection.variant===void 0||selection.effort===void 0,"choose either a model variant or an effort level"),automaticRecoverySchema=external_exports.
1538
+ object({enabled:external_exports.boolean(),backup:defaultModelSelectionSchema.optional()}).strict().refine(recovery=>!recovery.enabled||recovery.backup!==void 0,{message:"Choose a backup model before enabling automatic recovery",path:["backup"]}),cacheKeepWarmSchema=external_exports.object({enabled:external_exports.boolean(),windowMinutes:external_exports.number().int().min(15).max(1440).optional()}).strict(),threadsConfigSchema=external_exports.object({maxConcurrentPerBot:external_exports.number().
1539
+ int().min(1).max(MAX_CONCURRENT_BOT_THREADS),eventLogMaxBytes:external_exports.number().int().min(MIN_THREAD_EVENT_LOG_BYTES).max(MAX_THREAD_EVENT_LOG_BYTES).optional(),eventLogRetentionDays:external_exports.number().int().min(1).max(3650).optional()}).strict(),newBotsConfigSchema=external_exports.object({effort:external_exports.enum(EFFORT_LEVELS).optional()}).strict(),newBotsPatchSchema=external_exports.object({effort:newBotsConfigSchema.shape.effort.nullable()}).strict(),threadsPatchSchema=threadsConfigSchema.
1540
+ extend({maxConcurrentPerBot:threadsConfigSchema.shape.maxConcurrentPerBot.optional(),eventLogMaxBytes:threadsConfigSchema.shape.eventLogMaxBytes.nullable(),eventLogRetentionDays:threadsConfigSchema.shape.eventLogRetentionDays.nullable()}),appConfigSchema=external_exports.object({customDomain:external_exports.string().optional(),signIn:external_exports.object({admins:external_exports.array(external_exports.string().max(320)).max(500).optional(),members:external_exports.array(external_exports.string().
1541
+ max(320)).max(5e3).optional()}).optional(),defaultModelSelection:defaultModelSelectionSchema.optional(),automaticRecovery:automaticRecoverySchema.optional(),cacheKeepWarm:cacheKeepWarmSchema.optional(),newBotDefaults:newBotDefaultsSchema.optional(),newBots:newBotsConfigSchema.optional(),cliStartup:external_exports.object({access:external_exports.enum(["local","tunnel","tailscale","public-url"]),publicUrl:external_exports.string().url().optional(),phone:external_exports.enum(["ios","android"]).optional()}).
1542
+ optional(),mistral:external_exports.object({key:optionalText2}).optional(),cerebras:external_exports.object({key:optionalText2}).optional(),treg:external_exports.object({key:optionalText2}).optional(),postiz:external_exports.object({key:optionalText2,url:optionalText2}).optional(),groq:external_exports.object({key:optionalText2,url:optionalText2}).optional(),greenference:external_exports.object({key:optionalText2}).optional(),modelgo:external_exports.object({key:optionalText2}).optional(),meta:external_exports.
1543
+ object({key:optionalText2,url:optionalText2}).optional(),deepseek:external_exports.object({key:optionalText2}).optional(),xai:external_exports.object({key:optionalText2,url:optionalText2}).optional(),anthropic:external_exports.object({key:optionalText2,url:optionalText2,everyClaudeBot:external_exports.boolean().optional()}).optional(),openai:external_exports.object({key:optionalText2}).optional(),openrouter:external_exports.object({key:optionalText2}).optional(),budgets:external_exports.object({
1544
+ monthlyUsd:external_exports.number().min(0).max(1e6).optional(),warnAtPercent:external_exports.number().int().min(1).max(100).optional()}).optional(),billing:external_exports.object({currency:external_exports.string().regex(/^[A-Z]{3}$/).optional(),prices:external_exports.record(external_exports.string().min(1).max(160),external_exports.object({inputPerMillion:external_exports.number().min(0).max(1e6),outputPerMillion:external_exports.number().min(0).max(1e6),cachedInputPerMillion:external_exports.
1545
+ number().min(0).max(1e6).optional()})).optional()}).optional(),openaiCompat:external_exports.object({key:optionalText2,url:optionalText2,model:optionalText2,provider:optionalText2}).optional(),composio:external_exports.object({apiKey:optionalText2,userId:optionalText2,sessionId:optionalText2}).optional(),box:external_exports.object({token:optionalText2}).optional(),vps:vpsConfigSchema.optional(),opencodeGo:external_exports.object({apiKey:optionalText2,providerKeys:external_exports.record(external_exports.
1546
+ string(),external_exports.string()).optional()}).optional(),tts:external_exports.object({key:optionalText2,fishKey:optionalText2,geminiKey:optionalText2,voice:optionalText2,provider:external_exports.enum(["elevenlabs","fish","system","chatterbox","xai","gemini","openai"]).optional(),baseUrl:external_exports.string().trim().max(2048).refine(value=>!value||/^https?:\/\//i.test(value),"the Chatterbox server address must start with http:// or https://").optional(),model:optionalText2,fishModel:external_exports.
1547
+ enum(FISH_TTS_MODELS).optional(),everyReply:external_exports.boolean().optional()}).optional(),decider:deciderConfigSchema.optional(),live:liveConfigSchema.optional(),imageGen:imageGenConfigSchema.optional(),everyBotRules:external_exports.string().max(24e3).optional(),profile:external_exports.object({name:optionalText2,email:optionalText2,aboutMe:external_exports.string().max(24e3).optional(),avatarUrl:external_exports.union([external_exports.literal(""),botAvatarUrlSchema]).optional()}).optional(),
1548
+ language:optionalText2,computerName:external_exports.string().trim().max(63).optional(),rooms:roomConfigSchema.optional(),mcp:mcpConfigSchema.optional(),context:external_exports.object({compactAt:external_exports.number().positive().max(1e7).optional(),autoCompact:external_exports.boolean().optional()}).extend(roomContextSettings).extend(replaySettings).optional(),memory:external_exports.object({captureQuietMs:external_exports.number().int().min(1e3).max(1440*6e4).optional(),tidyHour:external_exports.
1549
+ number().int().min(0).max(23).optional()}).strict().optional(),threads:threadsConfigSchema.optional(),burst:external_exports.object({maxParallel:external_exports.number().int().min(1).max(100).optional()}).strict().optional(),decisions:external_exports.object({retentionDays:external_exports.number().int().min(1).max(3650).optional()}).strict().optional(),loopGuard:loopGuardConfigSchema.optional(),safetyFloor:external_exports.object({enabled:external_exports.boolean().optional()}).strict().optional(),
1550
+ localVm:localVmConfigSchema.optional(),features:featureConfigSchema.optional(),onboarding:onboardingConfigSchema.optional(),browserEngine:browserEngineConfigSchema.optional(),browserProfiles:browserProfilesSchema.optional(),instances:instanceConfigMapSchema.optional(),mcpServers:external_exports.record(external_exports.string(),external_exports.unknown()).optional()}),storedAppConfigSchema=appConfigSchema.extend(helperStoredShape).extend({browserProfiles:storedBrowserProfilesSchema.optional(),opencodeGo:external_exports.
1551
+ object({apiKey:optionalText2,providerKeys:external_exports.record(external_exports.string(),external_exports.unknown()).catch({}).transform(keys=>Object.fromEntries(Object.entries(keys).filter(entry=>typeof entry[1]=="string"))).optional()}).optional()}),appConfigPatchSchema=appConfigSchema.omit({instances:!0,mcpServers:!0,cliStartup:!0,customDomain:!0}).extend({threads:threadsPatchSchema.optional(),newBots:newBotsPatchSchema.optional(),imageGen:imageGenPatchSchema.optional()}),jsonObjectSchema2=external_exports.
1552
1552
  record(external_exports.string(),external_exports.json());function parseStoredConfig(value){let parsed=storedAppConfigSchema.safeParse(value);if(!parsed.success)throw new Error(schemaIssue(parsed.error,"Invalid stored configuration"));return parsed.data}var DEFAULT_CAPTURE_QUIET_MS=2*6e4;var DATA_DIR=process.env.OMB_DATA_DIR||join3(dataHome(),".limixbot"),LEGACY_DATA_DIR=join3(dataHome(),".opengrokbot"),EVENTS_DIR=join3(DATA_DIR,"events"),NATIVE_DIR=join3(DATA_DIR,"native");var storedConfig=settledFileCache(()=>join3(DATA_DIR,"config.json"),()=>parseStoredConfig(parseJson(readFileSync3(join3(DATA_DIR,"config.json"),"utf8"))));var SECRET_FOLDER=".limixbot-secrets";function inSecretFolder(path){return path.split(/[\\/]/).includes(SECRET_FOLDER)}var PORTABLE_CONFIG_KEYS=["profile","language","budgets","billing","rooms","threads","localVm","features","browserProfiles"];function portableWorkspaceConfig(value){if(!value||typeof value!="object"||Array.isArray(value))throw new Error("Invalid workspace configuration in backup.");let config2=parseStoredConfig(value);return Object.fromEntries(PORTABLE_CONFIG_KEYS.filter(key=>config2[key]!==void 0).map(key=>[key,config2[key]]))}function excludedWorkspaceAuthPath(path){return inSecretFolder(path)||/^command-allowlist\.json(?:$|\.\d+\.[0-9a-f-]+\.tmp$)/.test(path)||/^mcp-oauth\.json(?:$|\.\d+\.[0-9a-f-]+\.tmp$)/.test(path)||/^(?:logins\.json\.enc|logins-key|webhook-key)(?:$|\.\d+\.[0-9a-f-]+\.tmp$)/.test(path)||/^connected-apps-installation\.json(?:$|\.\d+\.[0-9a-f-]+\.tmp$)/.test(path)||/^team-policy\.json(?:$|\.\d+\.[0-9a-f-]+\.tmp$)/.test(path)||/^people-connections(?:\/|$)/.test(path)?!0:/^(?:(?:providers|caddy|chrome-profile|\.agent-browser)(?:\/|$)|workspace-credentials\.json$|external-runtimes\.json$|browser-engine-key$)/.
1553
1553
  test(path)||/^(?:config\.json|webhooks\.json|workspace-credentials\.json|external-runtimes\.json|browser-engine-key|sessions\.json|tunnel-account\.json)\.\d+(?:\.[0-9a-f-]+)?\.tmp$/.test(path)||/^(?:vm-home|vm-homes\/[^/]+)\/\.browser-profiles(?:\/|$)/.test(path)}function redownloadedOrgLibraryPath(path){return/^org-library\/(?:catalog\.json(?:\.[0-9a-f-]{36}\.tmp)?$|blobs(?:\/|$))/.test(path)}function ephemeralWorkspaceTokenPath(path){return/^(?:hook-tokens(?:\/|$)|sessions\.json\.open$)/.test(
1554
1554
  path)}function liveDataEnginePath(path){return/^bots\/[^/]+\/(?:data\.duckdb(?:\.wal)?$|data-tmp(?:\/|$))/.test(path)}function managedTaskSkillLink(source,path,roots){let match=/^task-workspaces\/([^/]+)\/[^/]+\/\.(?:claude|agents|grok)\/skills\/([^/]+)$/.exec(path);if(!match)return!1;let target;try{target=resolve(dirname(source),readlinkSync(source).replace(/^\\\\\?\\/,""))}catch{return!1}return roots.some(root=>{let rel=relative(join4(root,"workspaces",match[1],"skills"),target);return rel!==""&&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "limixbot",
3
- "version": "0.2.12",
3
+ "version": "0.3.1",
4
4
  "description": "Run the Limix Bot server anywhere and pair your devices to it (Leox ৹ Limix AI)",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -1 +0,0 @@
1
- import{t as s,r as o,d as Te,j as e,X as ve,f as Ae,a as G,ah as ye,ai as Le,h as De,k as Oe,aj as Me,ak as Ue,al as Fe,b as ze,am as Ie,an as Ke,ao as _e,ap as $e,p as le,B as He}from"./styles-b2tBrp-F.js";import{n as B,E as Je,u as k,bH as ee,bI as Ve,bJ as w,S as T,bK as We,bL as we,bM as te,bN as Ye,bO as qe,bP as Xe,bQ as oe,bR as ce,bS as Qe,bT as Ze,bU as Ge,bV as je,D as O,bW as et,bX as tt,e as Se,bY as st,bZ as de,b_ as nt,b$ as at,c0 as it,c1 as rt,c2 as lt,c3 as ot,c4 as ct,c5 as dt,c6 as ut,c7 as pt,c8 as mt,c9 as xt,ca as ue,cb as gt,cc as ht,cd as ft,ce as bt,cf as ke,cg as Ne,ch as vt,ci as yt,cj as wt,ck as jt,cl as St,cm as pe,T as Ce,cn as kt}from"./App-D93hKk8l.js";import{B as me,E as Nt,s as Ct,r as xe,p as Et,c as Bt,a as Rt}from"./new-bot-FZ7p0MaB.js";import{o as Pt}from"./index-CN3qYQZ7.js";import{I as Tt,S as At,a as Lt,A as Dt,M as Ot,P as Mt,V as Ut,v as Ft,i as ge}from"./VisibilitySection-BCqfMHFk.js";import{R as zt}from"./RoutinesPage-Dgl6g38a.js";import{r as It,L as X,Q as Kt,R as _t,U as $t,P as Ht}from"./PlacesRail-eySktVNq.js";import{p as Jt,d as Vt,e as Wt,f as Yt}from"./team-share-BegoEw7-.js";import{B as qt}from"./BrowserProfilesManager-BRZM0q_M.js";function Xt(t){const n=[];for(const a of t){const i=a.source==="org"?s("newBot.presetsFromOrganization",{name:a.publisherName??a.packageName}):s("newBot.presetsImported"),r=n.find(l=>l.label===i);r?r.presets.push(a):n.push({label:i,presets:[a]})}return n}function Qt(t){const n={name:t.bot.name??t.name,title:t.bot.title??"",description:t.bot.description??"",soul:t.bot.soul??""},a=t.bot.appearance;return a&&(n.color=a.color,n.mascotExpression=a.mascotExpression??null,a.mascotBody&&(n.mascotBody=a.mascotBody)),n}function Zt(t){const n=t.bot.appearance?.avatar;if(!n)return null;let a;try{a=atob(n.data)}catch{return null}const i=new Uint8Array(a.length);for(let r=0;r<a.length;r+=1)i[r]=a.charCodeAt(r);return new File([i],`preset.${n.mime.slice(6)}`,{type:n.mime})}function Gt(t){const n=[t.source==="org"&&t.publisherName?s("newBot.presetFromOrg",{package:t.packageName,release:t.release,publisher:t.publisherName}):s("newBot.presetFrom",{package:t.packageName,release:t.release})];t.description&&n.push(t.description);const a=t.skills.map(i=>i.name).join(", ");return a&&n.push(s(t.skillsEnabled?"newBot.presetSkillsOn":"newBot.presetSkillsOff",{names:a})),t.notes.length&&n.push(s("newBot.presetNotes",{names:t.notes.join(", ")})),t.playbooks.length&&n.push(s("newBot.presetPlaybooks",{names:t.playbooks.join(", ")})),n.push(s("newBot.presetKeeps")),n}function es(t){return{id:t.id,skills:t.skills.map(n=>n.name),notes:[...t.notes]}}function he(t){const n=a=>a?.trim()?a.trim():void 0;return{format:"package",version:2,kind:"library",name:n(t.name),presetName:n(t.name),presetDescription:n(t.description),release:n(t.release),notes:n(t.notes),includeMemory:t.includeNotes,...t.picture?{presetAvatar:t.picture}:{},...t.dryRun?{dryRun:!0}:{}}}function fe({preview:t,localSkips:n}){const a=t.document.package.presets?.[0],i=Object.keys(a?.seed?.memory??{}).length,r=[[s("teamShare.part.skills"),a?.skills?.length?`${a.skills.length} · ${a.skills.join(", ")}`:"0"],[s("teamShare.part.notes"),i?String(i):s("teamShare.none")],[s("teamShare.part.pictures"),a?.bot.appearance?.avatar?s("teamShare.yes"):s("teamShare.none")]],l=[...n,...t.skipped.map(d=>Vt(d,t.document))];return e.jsxs("div",{children:[e.jsx("div",{className:"text-[12px] font-medium text-ink-secondary",children:s("teamShare.included")}),e.jsx("dl",{className:"mt-2 grid grid-cols-[minmax(0,1fr)_auto] gap-x-4 gap-y-1.5 rounded-xl bg-raised/45 px-4 py-3 text-[13px]",children:r.map(([d,c])=>e.jsxs("div",{className:"contents",children:[e.jsx("dt",{className:"text-ink-secondary",children:d}),e.jsx("dd",{className:"max-w-[300px] truncate text-right text-ink",title:c,children:c})]},d))}),e.jsxs("p",{className:"mt-3 flex items-start gap-2 text-[13px] leading-relaxed text-ink-secondary",children:[e.jsx(Je,{size:15,className:"mt-0.5 shrink-0 text-success"}),e.jsx("span",{children:s("presetShare.never")})]}),t.redacted.length>0&&e.jsxs("div",{className:"mt-3 rounded-xl border border-hairline px-4 py-3 text-[13px] text-ink-secondary",children:[e.jsx("div",{className:"font-medium text-ink",children:s("teamShare.redacted")}),e.jsx("ul",{className:"mt-1 list-disc pl-5",children:t.redacted.map(d=>e.jsx("li",{children:Wt(d,t.document)},d))})]}),l.length>0&&e.jsxs("div",{className:"mt-3 rounded-xl border border-hairline px-4 py-3 text-[13px] text-ink-secondary",children:[e.jsx("div",{className:"font-medium text-ink",children:s("teamShare.skipped")}),e.jsx("ul",{className:"mt-1 list-disc pl-5",children:l.map((d,c)=>e.jsx("li",{children:d},`${d}-${c}`))})]})]})}function ts({onClose:t}){const n=o.useRef(null),[a,i]=o.useState(""),[r,l]=o.useState(""),[d,c]=o.useState(""),[p,g]=o.useState(""),[j,A]=o.useState(!0),[N,x]=o.useState(!0),[h,y]=o.useState(null),[b,v]=o.useState(null),[f,M]=o.useState(!1),[I,$]=o.useState(null),[U,K]=o.useState(""),_=o.useRef(0);o.useEffect(()=>{let u=!1;return B("/api/bot-defaults").then(async({defaults:R})=>{!u&&R.profile.name?.trim()&&i(L=>L||R.profile.name.trim());const C=await Jt([{id:"defaults",avatarUrl:R.profile.avatarUrl,avatarCrop:R.profile.avatarCrop}]);u||y({dataUrl:C.avatars.defaults,skipped:C.skipped.map(L=>`${s("teamShare.field.picture")} — ${Te(`teamShare.skip.${L.reason}`,L.reason)}`)})}).catch(()=>{u||y({skipped:[]})}),()=>{u=!0}},[]);const V=u=>({name:a,description:r,release:d,notes:p,includeNotes:j,dryRun:u,...N&&h?.dataUrl?{picture:h.dataUrl}:{}});o.useEffect(()=>{if(!h)return;const u=++_.current,R=window.setTimeout(()=>{B("/api/teams/export",{method:"POST",body:JSON.stringify(he({...V(!0),release:void 0}))}).then(C=>{u===_.current&&(v(C),K(""),c(L=>L||C.document.package.release))}).catch(C=>{u===_.current&&(v(null),K(C instanceof Error?C.message:String(C)))})},250);return()=>window.clearTimeout(R)},[h,j,N]);const F=async()=>{if(!f){M(!0),K("");try{const u=await B("/api/teams/export",{method:"POST",body:JSON.stringify(he(V(!1)))});Yt(u.filename,u.document),$(u)}catch(u){K(u instanceof Error?u.message:String(u))}finally{M(!1)}}};o.useEffect(()=>{const u=document.activeElement instanceof HTMLElement?document.activeElement:null;return n.current?.focus(),()=>{u?.isConnected&&u.focus()}},[]);const H=N?h?.skipped??[]:[],z="mt-1 w-full rounded-lg border border-hairline/50 bg-inset px-3 py-2 text-[14px] text-ink disabled:opacity-60";return It.createPortal(e.jsx("div",{className:"fixed inset-0 z-[80] flex items-center justify-center bg-black/55 p-4",onMouseDown:u=>{u.target===u.currentTarget&&!f&&t()},children:e.jsxs("div",{ref:n,role:"dialog","aria-modal":"true","aria-labelledby":"share-preset-title",tabIndex:-1,className:"flex max-h-[90vh] w-full max-w-[560px] flex-col overflow-hidden rounded-2xl border border-hairline/50 bg-panel text-ink shadow-2xl outline-none",onKeyDown:u=>{if(u.key==="Escape"&&!f&&(u.stopPropagation(),t()),u.key==="Tab"){const R=n.current?.querySelectorAll("input:enabled, textarea:enabled, button:enabled");if(!R?.length)return;const C=R[0],L=R[R.length-1];u.shiftKey&&document.activeElement===C?(u.preventDefault(),L.focus()):!u.shiftKey&&document.activeElement===L&&(u.preventDefault(),C.focus())}},children:[e.jsxs("header",{className:"flex items-start justify-between gap-3 px-6 pb-2 pt-5",children:[e.jsxs("div",{children:[e.jsx("h2",{id:"share-preset-title",className:"text-[17px] font-semibold",children:s("presetShare.title")}),e.jsx("p",{className:"mt-1 text-[13px] leading-relaxed text-ink-secondary",children:s("presetShare.intro")})]}),e.jsx("button",{"aria-label":s("presetShare.close"),disabled:f,onClick:t,className:"rounded-lg p-1.5 text-ink-secondary hover:bg-raised",children:e.jsx(ve,{size:18})})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-6 pb-4 pt-2",children:I?e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"flex items-center gap-2 text-[14px] font-medium text-ink",children:[e.jsx(Ae,{size:16,className:"text-success"}),s("teamShare.saved",{filename:I.filename})]}),e.jsx("p",{className:"mt-1 text-[13px] leading-relaxed text-ink-secondary",children:s("presetShare.savedHint")}),e.jsx("div",{className:"mt-4",children:e.jsx(fe,{preview:I,localSkips:H})})]}):e.jsxs(e.Fragment,{children:[b?e.jsx(fe,{preview:b,localSkips:H}):!U&&e.jsxs("div",{className:"flex items-center gap-2 py-6 text-[13px] text-ink-secondary",children:[e.jsx(X,{size:15,className:"animate-spin"}),s("presetShare.preparing")]}),e.jsxs("fieldset",{className:"mt-4 space-y-2 text-[13px]",disabled:f,children:[e.jsxs("label",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",className:"size-4 accent-accent",checked:N,onChange:u=>x(u.target.checked)}),s("presetShare.includePicture")]}),e.jsxs("label",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",className:"size-4 accent-accent",checked:j,onChange:u=>A(u.target.checked)}),s("presetShare.includeNotes")]})]}),e.jsxs("div",{className:"mt-4 grid gap-3 sm:grid-cols-2",children:[e.jsxs("label",{className:"block text-[13px] text-ink-secondary",children:[s("presetShare.name"),e.jsx("input",{value:a,maxLength:100,disabled:f,onChange:u=>i(u.target.value),className:z})]}),e.jsxs("label",{className:"block text-[13px] text-ink-secondary",children:[s("teamShare.release"),e.jsx("input",{value:d,maxLength:20,disabled:f,placeholder:"1.0.0",onChange:u=>c(u.target.value),className:z})]})]}),e.jsxs("label",{className:"mt-3 block text-[13px] text-ink-secondary",children:[s("presetShare.description"),e.jsx("input",{value:r,maxLength:300,disabled:f,onChange:u=>l(u.target.value),className:z})]}),e.jsxs("label",{className:"mt-3 block text-[13px] text-ink-secondary",children:[s("teamShare.notes"),e.jsx("textarea",{value:p,maxLength:4e3,rows:2,disabled:f,onChange:u=>g(u.target.value),className:z})]})]})}),U&&e.jsx("p",{role:"alert",className:"mx-6 mb-2 rounded-lg bg-danger/10 px-3 py-2 text-[13px] text-danger",children:U}),e.jsx("footer",{className:"flex justify-end gap-2 border-t border-hairline/35 px-6 py-3",children:I?e.jsx("button",{onClick:t,className:"rounded-lg bg-accent px-4 py-2 text-[13px] font-medium text-white",children:s("teamShare.done")}):e.jsxs(e.Fragment,{children:[e.jsx("button",{disabled:f,onClick:t,className:"rounded-lg px-3 py-2 text-[13px] text-ink-secondary hover:bg-raised",children:s("common.cancel")}),e.jsxs("button",{disabled:f||!b,onClick:()=>{F()},className:"flex items-center gap-2 rounded-lg bg-accent px-4 py-2 text-[13px] font-medium text-white disabled:opacity-40",children:[f&&e.jsx(X,{size:14,className:"animate-spin"}),f?s("teamShare.saving"):s("teamShare.save")]})]})})]})}),document.body)}function se(){const{dispatch:t}=k(),[n,a]=o.useState(!1),[i,r]=o.useState("");return{saving:n,error:i,save:async d=>{if(!n){a(!0),r("");try{const c=await B("/api/config",{method:"PATCH",body:JSON.stringify(d)});t({type:"configStatus",config:c})}catch(c){r(c instanceof Error?c.message:s("settings.experimental.error"))}finally{a(!1)}}}}}function Es(){const{state:t}=k(),n=ee(t.config),a=Ve(t.config),i=t.config?.browserEngine?.installable===!0,r=window.ogb?.platform==="win32"&&!a&&!i,{saving:l,error:d,save:c}=se();return e.jsx(w,{title:s("settings.experimental.browserAria"),subtitle:a?n?s("settings.experimental.browserOn"):s("settings.experimental.browserOff"):r?s("settings.experimental.browserWindows"):We(t.config),message:d?e.jsx("p",{role:"alert",className:"text-danger",children:d}):null,children:e.jsx(T,{checked:n,"aria-label":s("settings.experimental.browserAria"),disabled:l||!n&&!a&&!i,onClick:()=>{c({features:{browser:!n}})},className:"disabled:cursor-wait disabled:opacity-50"})})}function Bs(){const{state:t}=k(),n=we(),a=t.config?.browserEngine?.serverSites,{saving:i,error:r,save:l}=se();return a===void 0||n!==!0||!ee(t.config)?null:e.jsx(w,{title:s("settings.browser.serverSites"),subtitle:s("settings.browser.serverSitesDetail"),message:r?e.jsx("p",{role:"alert",className:"text-danger",children:r}):null,children:e.jsx(T,{checked:a,"aria-label":s("settings.browser.serverSites"),disabled:i,onClick:()=>{l({browserEngine:{egress:{localNetwork:!a}}})},className:"disabled:cursor-wait disabled:opacity-50"})})}function ss(){const{state:t}=k(),n=t.config?.browserEngine?.engine==="chrome",{saving:a,error:i,save:r}=se();return e.jsxs("div",{className:"mt-4 border-t border-hairline/30 pt-4","data-testid":"new-browser-settings",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[14px] font-medium text-ink",children:s("settings.experimental.newBrowser")}),e.jsx("div",{className:"mt-0.5 text-[12px] leading-relaxed text-ink-secondary",children:s("settings.experimental.newBrowserDetail")})]}),e.jsx(T,{checked:n,"aria-label":s("settings.experimental.newBrowserAria"),disabled:a,onClick:()=>{r({browserEngine:{engine:n?"agent-browser":"chrome"}})},className:"disabled:cursor-wait disabled:opacity-50"})]}),i?e.jsx("p",{role:"alert",className:"mt-2 text-[12px] text-danger",children:i}):null]})}function ns(){const{state:t,dispatch:n}=k(),a=te(t.config),i=Ye(t.config),r=qe(t.config),l=Xe(t.bots,t.instances),[d,c]=o.useState(String(r)),[p,g]=o.useState(!1),[j,A]=o.useState(!1),[N,x]=o.useState(""),h=o.useRef(!1);o.useEffect(()=>{p||c(String(r))},[r,p]);const y=async v=>{if(h.current)return!1;h.current=!0,A(!0),x("");try{const f=await B("/api/config",{method:"PATCH",body:JSON.stringify({features:v})});return n({type:"configStatus",config:f}),!0}catch(f){return x(f instanceof Error?f.message:s("settings.experimental.error")),!1}finally{h.current=!1,A(!1)}},b=async()=>{if(!p)return;const v=Qe(d);if(v===null){x(s("settings.experimental.skillReviewStepsRange",{min:ce,max:oe}));return}await y({skillReviewSteps:v})&&g(!1)};return e.jsxs("div",{className:"mt-4 border-t border-hairline/30 pt-4","data-testid":"skill-review-settings",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[14px] font-medium text-ink",children:s("settings.experimental.skillReview")}),e.jsx("div",{className:"mt-0.5 text-[12px] leading-relaxed text-ink-secondary",children:s(a?"settings.experimental.skillReviewDetail":"settings.experimental.skillReviewNeedsAuthoring")})]}),e.jsx(T,{checked:i,"aria-label":s("settings.experimental.skillReviewAria"),disabled:j||!a,onClick:()=>{y({skillReview:!i})},className:"disabled:cursor-not-allowed disabled:opacity-50"})]}),e.jsx(as,{engines:l}),i?e.jsxs("div",{className:"mt-3 flex items-center gap-3",children:[e.jsx("label",{htmlFor:"skill-review-steps",className:"text-[13px] text-ink",children:s("settings.experimental.skillReviewSteps")}),e.jsx("div",{className:`flex w-[96px] items-center rounded-lg border bg-inset ${N?"border-danger/60":"border-hairline/40 focus-within:border-focus"}`,children:e.jsx("input",{id:"skill-review-steps",type:"number",min:ce,max:oe,step:1,inputMode:"numeric",value:d,disabled:j,"aria-invalid":!!N,onChange:v=>{c(v.target.value),g(!0),x("")},onBlur:()=>{b()},onKeyDown:v=>{v.key==="Enter"&&v.currentTarget.blur()},className:"min-w-0 flex-1 bg-transparent px-3 py-1.5 text-[14px] tabular-nums text-ink focus:outline-none"})})]}):null,N?e.jsx("p",{role:"alert",className:"mt-2 text-[12px] text-danger",children:N}):null]})}function as({engines:t}){return t.length?e.jsx("p",{className:"mt-2 text-[12px] leading-relaxed text-ink-secondary","data-testid":"skill-review-engine-note",children:s("settings.experimental.skillReviewNoEngine",{engines:t.join(", ")})}):null}const is=[{value:"off",label:"settings.experimental.shareSkillsOff"},{value:"ask",label:"settings.experimental.shareSkillsAsk"},{value:"auto",label:"settings.experimental.shareSkillsAuto"}];function rs(){const{state:t,dispatch:n}=k(),[a,i]=o.useState(!1),[r,l]=o.useState("");if(!Ze(t.config))return null;const d=te(t.config),c=Ge(t.config),p=async g=>{if(!(a||g===c)){i(!0),l("");try{const j=await B("/api/config",{method:"PATCH",body:JSON.stringify({features:{shareLearnedSkills:g}})});n({type:"configStatus",config:j})}catch(j){l(j instanceof Error?j.message:s("settings.experimental.error"))}finally{i(!1)}}};return e.jsxs("div",{className:"mt-4 border-t border-hairline/30 pt-4","data-testid":"share-learned-skills-settings",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-[14px] font-medium text-ink",children:s("settings.experimental.shareSkills")}),e.jsx("div",{className:"mt-0.5 text-[12px] leading-relaxed text-ink-secondary",children:s(d?"settings.experimental.shareSkillsDetail":"settings.experimental.shareSkillsNeedsAuthoring")})]}),e.jsx("div",{className:"inline-flex shrink-0 rounded-xl bg-inset p-1",role:"radiogroup","aria-label":s("settings.experimental.shareSkillsAria"),children:is.map(g=>e.jsx("button",{type:"button",role:"radio","aria-checked":c===g.value,disabled:a||!d,onClick:()=>{p(g.value)},className:G("rounded-lg px-3 py-1.5 text-[13px] transition-colors disabled:cursor-not-allowed disabled:opacity-50",c===g.value?"bg-raised text-ink shadow":"text-ink-secondary hover:text-ink"),children:s(g.label)},g.value))})]}),r?e.jsx("p",{role:"alert",className:"mt-2 text-[12px] text-danger",children:r}):null]})}function ls(){return e.jsxs(e.Fragment,{children:[e.jsx(ns,{}),e.jsx(rs,{})]})}function Rs({title:t=s("settings.updates.title")}){const n=xt(),a=window.ogb?.updater;if(!n||!a)return null;const i=n.status==="checking"?s("settings.updates.checking"):n.status==="downloading"?n.percent==null?s("settings.updates.startingDownload"):s("settings.updates.downloading",{percent:Math.round(n.percent)}):n.status==="preparing"?s("settings.updates.preparing"):n.status==="downloaded"?n.installMode==="handoff"?s("settings.updates.readyInstall",{app:le(),version:n.version??""}):s("settings.updates.ready",{app:le(),version:n.version??""}):n.status==="installing"?ue(n)||(n.installMode==="handoff"?s("settings.updates.openingTerminal"):s("settings.updates.restarting")):n.status==="handed-off"?s("settings.updates.handedOff"):n.status==="error"?s("settings.updates.failed",{message:ue(n)??s("settings.updates.unknownError")}):s("settings.updates.latest");return e.jsx(w,{title:t,subtitle:i,children:e.jsx("button",{onClick:()=>{if(n.status==="downloaded")return void a.install();a.check()},disabled:n.status==="checking"||n.status==="downloading"||n.status==="preparing"||n.status==="installing"||n.retryable===!1,className:"ui-button",children:n.retryable===!1?s("settings.updates.quitReopen"):n.status==="downloaded"?n.installMode==="handoff"?s("settings.updates.install"):s("settings.updates.restart"):n.status==="preparing"?s("settings.updates.preparingShort"):n.status==="installing"?n.installMode==="handoff"?s("settings.updates.opening"):s("settings.updates.restartingShort"):s("settings.updates.check")})})}function Ee(){const{state:t,dispatch:n}=k(),a=t.config?.newBots?.effort??"",[i,r]=o.useState(!1),[l,d]=o.useState("");return{current:a,saving:i,error:l,save:async p=>{if(!i){r(!0),d("");try{const g=await B("/api/config",{method:"PATCH",body:JSON.stringify({newBots:{effort:bt(p)?p:null}})});n({type:"configStatus",config:g})}catch(g){d(g instanceof Error?g.message:s("settings.newBotEffort.error"))}finally{r(!1)}}}}}function Be({effort:t,className:n}){return e.jsxs(O,{size:"sm",className:n,value:t.current,disabled:t.saving,"aria-label":s("settings.newBotEffort.aria"),onChange:a=>{t.save(a.target.value)},children:[e.jsx("option",{value:"",children:s("settings.newBotEffort.default")}),gt.map(a=>e.jsx("option",{value:a,children:ht(a)},a))]})}function Ps(){const t=Ee();return e.jsx(w,{title:s("settings.newBotEffort.title"),subtitle:s("settings.newBotEffort.subtitle"),message:t.error?e.jsx("p",{role:"alert",className:"text-danger",children:t.error}):null,children:e.jsx(Be,{effort:t,className:"w-full max-w-[240px]"})})}function os({onEdit:t,onShare:n}){const a=Ee();return e.jsx(w,{title:s("newBot.defaults"),subtitle:s("settings.newBotEffort.title"),message:a.error?e.jsx("p",{role:"alert",className:"text-danger",children:a.error}):null,children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Be,{effort:a,className:"w-auto"}),e.jsx("button",{type:"button",className:"ui-button","data-new-bot-share":!0,onClick:n,children:s("newBot.sharePreset")}),e.jsx("button",{type:"button",className:"ui-button","data-new-bot-defaults":!0,onClick:t,children:s("newBot.edit")})]})})}function cs(){const{state:t,dispatch:n}=k(),[a,i]=o.useState(!1),[r,l]=o.useState(!1);return e.jsxs("div",{children:[e.jsx("button",{disabled:a,onClick:()=>{i(!0),l(!1),B("/api/config",{method:"PUT",body:JSON.stringify({onboarding:{...t.config?.onboarding?.completedAt?{}:Kt().onboarding,hintsSeen:ft(t.config?.onboarding)}}),signal:AbortSignal.timeout(1e4)}).then(d=>{n({type:"configStatus",config:d}),n({type:"toggleTour",open:!0})}).catch(()=>l(!0)).finally(()=>i(!1))},className:"ui-button",children:s("settings.welcome.appTour")}),r&&e.jsx("p",{role:"alert",className:"mt-2 text-[13px] text-danger",children:s("onboarding.tour.error")})]})}function Ts(){const{dispatch:t}=k();return e.jsx(w,{title:s("settings.welcome.title"),subtitle:s("settings.welcome.subtitleShort"),children:e.jsxs("div",{className:"flex flex-wrap justify-end gap-2",children:[e.jsx(cs,{}),e.jsx("button",{onClick:()=>t({type:"toggleWelcome",open:!0}),className:"ui-button",children:s("settings.welcome.replay")})]})})}function As({simple:t=!1}){const{state:n}=k(),a=De(Oe(),n.config?.language);return e.jsx(w,{title:s("settings.language.title"),subtitle:Fe()?s("settings.language.subtitleComplete"):t?ze()==="en"?void 0:s("settings.simple.language.partial"):s("settings.language.subtitle"),children:e.jsxs(O,{size:"sm",variant:t?"ghost":"field",className:t?void 0:"w-full max-w-[240px]",value:a,"aria-label":s("settings.language.aria"),onChange:i=>Ue(i.target.value),children:[e.jsx("option",{value:"",children:s(t?"settings.simple.language.system":"settings.language.system")}),Me.map(({code:i,label:r})=>e.jsx("option",{value:i,children:r},i))]})})}function Ls({simple:t=!1}){const n=Se();return e.jsx(w,{title:s("settings.sendKey.title"),subtitle:s(t?"settings.simple.sendKey":"settings.sendKey.subtitle",{key:de("mod-enter")}),children:e.jsx(O,{size:"sm",variant:t?"ghost":"field",className:t?void 0:"w-full max-w-[240px]",value:n,"aria-label":s("settings.sendKey.title"),onChange:a=>nt(at(a.target.value)),children:st.map(a=>e.jsx("option",{value:a,children:de(a)},a))})})}function Ds({simple:t=!1}){const n=it(),a=rt(Se());return e.jsx(w,{title:s("settings.followUp.title"),subtitle:s(t?"settings.simple.followUp":"settings.followUp.subtitle",{key:a}),children:e.jsxs(O,{size:"sm",variant:t?"ghost":"field",className:t?void 0:"w-full max-w-[240px]",value:n,"aria-label":s("settings.followUp.title"),onChange:i=>lt(ot(i.target.value)),children:[e.jsx("option",{value:"steer",children:s("settings.followUp.steer")}),e.jsx("option",{value:"queue",children:s("settings.followUp.queue")})]})})}function Os({simple:t=!1}){const n=et();return e.jsx(w,{title:s(t?"settings.userBubbles.simpleTitle":"settings.userBubbles.title"),subtitle:t?void 0:s("settings.userBubbles.subtitle"),children:e.jsx(T,{checked:n,"aria-label":s("settings.userBubbles.aria"),onClick:()=>tt(!n)})})}function Ms({simple:t=!1}){const n=ye();return e.jsx(w,{className:t?void 0:"rounded-2xl border border-accent-border/40 bg-raised-hover/40 py-4",title:s("settings.advancedMode.title"),subtitle:s(t?"settings.simple.advancedMode":"settings.advancedMode.subtitle"),children:e.jsx(T,{checked:n,"aria-label":s("settings.advancedMode.title"),onClick:()=>Le(!n)})})}function Us(){const t=Ie();return e.jsx(w,{title:s("settings.threadDisplay.title"),subtitle:s("settings.threadDisplay.subtitle"),children:e.jsx(T,{checked:t,"aria-label":s("settings.threadDisplay.show"),onClick:()=>Ke(!t)})})}function Fs(){const t=ct();return e.jsx(w,{title:s("settings.pinnedCircles.title"),subtitle:s("settings.pinnedCircles.subtitle"),children:e.jsx(T,{checked:t,"aria-label":s("settings.pinnedCircles.title"),onClick:()=>dt(!t)})})}function zs(){const t=_e();return e.jsx(w,{title:s("settings.runCard.title"),subtitle:s("settings.runCard.subtitle"),children:e.jsx(T,{checked:t,"aria-label":s("settings.runCard.show"),onClick:()=>$e(!t)})})}function Is(){const t=ut();return e.jsx(w,{title:s("settings.universalPins.title"),subtitle:s("settings.universalPins.subtitle"),children:e.jsx(T,{checked:t,"aria-label":s("settings.universalPins.title"),onClick:()=>pt(!t)})})}function Ks(){const{state:t,dispatch:n}=k(),a=mt(t.config),[i,r]=o.useState(!1),[l,d]=o.useState(""),c=async()=>{if(!i){r(!0),d("");try{const p=await B("/api/config",{method:"PATCH",body:JSON.stringify({features:{showToolCalls:!a}})});n({type:"configStatus",config:p})}catch(p){d(p instanceof Error?p.message:s("settings.toolCalls.error"))}finally{r(!1)}}};return e.jsx(w,{title:s("settings.toolCalls.title"),subtitle:e.jsxs(e.Fragment,{children:[s("settings.toolCalls.subtitle")," ",s("settings.toolCalls.detail")]}),message:l?e.jsx("p",{role:"alert",className:"text-danger",children:l}):null,children:e.jsx(T,{checked:a,"aria-label":s("settings.toolCalls.aria"),disabled:i,onClick:()=>{c()},className:"disabled:cursor-wait disabled:opacity-50"})})}function _s(){const{state:t,dispatch:n}=k(),a=te(t.config),[i,r]=o.useState(!1),[l,d]=o.useState(""),c=async p=>{if(!i){r(!0),d("");try{const g=await B("/api/config",{method:"PATCH",body:JSON.stringify({features:{skillAuthoring:p}})});n({type:"configStatus",config:g})}catch(g){d(g instanceof Error?g.message:s("settings.experimental.error"))}finally{r(!1)}}};return e.jsxs(je,{title:s("settings.experimental.title"),subtitle:s("settings.experimental.subtitle"),children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[14px] font-medium text-ink",children:s("settings.experimental.skillAuthoring")}),e.jsx("div",{className:"mt-0.5 text-[12px] leading-relaxed text-ink-secondary",children:s("settings.experimental.skillAuthoringDetail")})]}),e.jsx(T,{checked:a,"aria-label":s("settings.experimental.skillAuthoringAria"),disabled:i,onClick:()=>{c(!a)},className:"disabled:cursor-wait disabled:opacity-50"})]}),l?e.jsx("p",{role:"alert",className:"mt-2 text-[12px] text-danger",children:l}):null,e.jsx(ls,{}),e.jsx(ss,{})]})}function $s(){const{state:t}=k(),n=t.config?.browserProfiles??[];return!ee(t.config)&&n.length===0?null:e.jsx(je,{title:s("settings.profiles.title"),subtitle:s("settings.profiles.sharedSubtitle"),children:e.jsx(qt,{})})}const be=["Identity","Soul","Skills","Memory","Routines","Access","Model","Permissions","Voice & alerts"],ds={Identity:"botSettings.sections.identity",Soul:"botSettings.sections.soul",Skills:"botSettings.sections.skills",Memory:"botSettings.sections.memory",Routines:"botSettings.sections.routines",Access:"botSettings.sections.access",Model:"botSettings.sections.model",Permissions:"botSettings.sections.permissions","Voice & alerts":"botSettings.sections.voice"};function Re(t){return e.jsx(_t,{modal:!0,children:e.jsx(us,{...t})})}function us({defaultsMode:t=!1,onClose:n,onCreated:a,readyBotId:i}){const r=$t(),l=k(),[,d]=o.useState(0),[c,p]=o.useState(()=>new me(Nt,()=>d(m=>m+1))),[g,j]=o.useState("Identity"),[A,N]=o.useState(!1),[x,h]=o.useState(!1),y=x||l.state.botCreationPending,b=o.useRef(!1),v=o.useRef(!0),[f,M]=o.useState(""),[I,$]=o.useState(null),[U,K]=o.useState("everyone"),[_,V]=o.useState(""),F=ke(),H=l.state.config?.team?.name,[z,u]=o.useState(null),R=we(),C=He(),L=ye()?be:be.filter(m=>m!=="Model"),ne=!t&&typeof window<"u"&&!window.ogb&&R===!0,W=o.useRef(null),J=o.useRef(n);J.current=n,o.useEffect(()=>{let m=!1;return B("/api/bot-defaults").then(P=>{if(m)return;const S=Ct(P,!t),E=t||!i?void 0:Ne(i),D=new me(E?vt(S,E):S,()=>d(q=>q+1));E&&(D.role=E.id),p(D),N(!0)}).catch(P=>{m||M(String(P))}),()=>{m=!0}},[t,i]),o.useEffect(()=>(v.current=!0,()=>{v.current=!1}),[]),o.useEffect(()=>()=>c.dispose(),[c]),o.useEffect(()=>{y&&W.current?.focus()},[y]),o.useEffect(()=>{const m=document.activeElement instanceof HTMLElement?document.activeElement:null;W.current?.focus();const P=S=>{if(!r())return;const E=W.current;if(!E||S.target instanceof Node&&!E.contains(S.target))return;const D=E.querySelector('[role="dialog"], [role="alertdialog"]');if(D&&D.getClientRects().length||(S.key==="Escape"&&(S.preventDefault(),J.current()),S.key!=="Tab"))return;const q=[...E.querySelectorAll('button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex="0"]')].filter(re=>re.getClientRects().length&&!re.closest("[hidden],fieldset:disabled")),Q=q[0],Z=q.at(-1);if(!Q||!Z){S.preventDefault(),E.focus();return}S.shiftKey&&(document.activeElement===Q||document.activeElement===E)?(S.preventDefault(),Z.focus()):!S.shiftKey&&(document.activeElement===Z||document.activeElement===E)&&(S.preventDefault(),Q.focus())};return window.addEventListener("keydown",P),()=>{window.removeEventListener("keydown",P),m?.isConnected&&m.focus()}},[r]);const ae=async()=>{if(!A||b.current||l.state.botCreationPending)return;if(!t&&c.bot.approvalMode==="auto"&&c.bot.computer==="local"&&!c.consent.acknowledgeLocalAuto){$("local");return}const m=ne?Ft(U,_):null;if(m&&!m.ok){M(s("botSettings.visibility.needPeople"));return}b.current=!0,h(!0),M(""),l.dispatch({type:"botCreationPending",on:!0});try{if(t)await B("/api/config",{method:"PATCH",body:JSON.stringify({newBotDefaults:await Et(c)})});else{const{bot:P,warnings:S,paused:E}=await Bt(c,void 0,void 0,void 0,m?.ok?m.visibility:void 0,F?xe(z,c.bot.section,l.state.bots,F)??void 0:void 0);Rt(l.dispatch,P,S,{showThreads:C,source:c.preset?"preset":c.role?"template":"blank",role:c.role,paused:E});try{await a?.(P)}catch(D){l.dispatch({type:"error",message:D instanceof Error?D.message:String(D)})}}b.current=!1,v.current&&J.current()}catch(P){v.current&&M(P instanceof Error?P.message:String(P))}finally{b.current=!1,l.dispatch({type:"botCreationPending",on:!1}),v.current&&h(!1)}},Y=c.bot,Pe={...l,state:{...l.state,bots:[Y,...l.state.bots],routines:c.routines,routineRuns:[],routinesLoadState:"ready"},flushBotPatches:async()=>Y,dispatch:m=>{m.type==="updateBot"&&m.botId===c.id?c.patch(m.patch):m.type==="setModel"&&m.botId===c.id?(c.setModel(m.selection),m.resetApprovalToAsk&&c.patch({approvalMode:"ask"})):m.type==="routinePatched"||m.type==="toggleSettings"||l.dispatch(m)}},ie=t?s("newBot.defaults"):s("sidebar.newBot");return e.jsx("div",{className:"fixed inset-0 z-[70] flex items-center justify-center bg-black/60 p-3 sm:p-5",hidden:!t&&l.state.appSettingsOpen,children:e.jsxs("div",{ref:W,role:"dialog","aria-modal":"true","aria-label":ie,"aria-busy":y,tabIndex:-1,className:"flex h-[min(760px,94dvh)] w-full max-w-[900px] flex-col overflow-hidden rounded-2xl border border-hairline/50 bg-panel shadow-2xl outline-none",children:[e.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-hairline/40 px-5 py-4",children:[e.jsx("h2",{className:"text-[17px] font-semibold text-ink",children:ie}),e.jsx("button",{type:"button",onClick:()=>J.current(),"aria-label":s("common.close"),className:"flex size-8 shrink-0 items-center justify-center rounded-lg text-ink-secondary hover:bg-control hover:text-ink disabled:opacity-40",children:e.jsx(ve,{size:18,className:"pointer-events-none"})})]}),F&&!t&&H&&e.jsx(ps,{team:H}),ne&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-5 pt-3 text-[13px] text-ink-secondary","data-new-bot-visibility":!0,children:[e.jsxs("label",{className:"flex items-center gap-2",children:[s("botSettings.visibility.title"),e.jsxs(O,{size:"sm",value:U,disabled:y,onChange:m=>K(m.target.value),children:[e.jsx("option",{value:"everyone",children:s("botSettings.visibility.everyone")}),e.jsx("option",{value:"admins",children:s("botSettings.visibility.admins")}),e.jsx("option",{value:"people",children:s("botSettings.visibility.people")})]})]}),U==="people"&&e.jsx("input",{value:_,disabled:y,onChange:m=>V(m.target.value),placeholder:s("botSettings.visibility.peoplePlaceholder"),"aria-label":s("botSettings.visibility.peopleLabel"),className:"min-w-[16rem] flex-1 rounded-lg border border-hairline/40 bg-inset px-3 py-1.5 text-[13px] text-ink placeholder:text-ink-secondary focus:outline-none"})]}),e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col sm:flex-row",children:[e.jsx("nav",{"aria-label":s("newBot.sections"),className:"flex shrink-0 gap-1 overflow-x-auto border-b border-hairline/40 p-2 sm:w-40 sm:flex-col sm:border-b-0 sm:border-r",children:L.map(m=>e.jsx("button",{type:"button",onClick:()=>j(m),"aria-current":g===m?"page":void 0,className:G("shrink-0 rounded-lg px-3 py-2 text-left text-[13px]",g===m?"bg-control text-ink":"text-ink-secondary hover:bg-control/50"),children:s(ds[m])},m))}),e.jsxs("div",{className:"min-h-0 min-w-0 flex-1 overflow-y-auto p-4 sm:p-5",children:[!A&&!f&&e.jsxs("div",{role:"status",className:"flex items-center gap-2 text-[13px] text-ink-secondary",children:[e.jsx(X,{size:16,className:"animate-spin"}),s("newBot.loading")]}),A&&e.jsx("fieldset",{disabled:y,className:"min-w-0",children:e.jsx(yt,{value:Pe,children:e.jsx(wt.Provider,{value:{request:c.request,draft:!0,uploadAvatar:c.uploadAvatar},children:e.jsx(ms,{active:g,draft:c,defaultsMode:t,owner:F&&!t?{value:xe(z,Y.section,l.state.bots,F),choose:u}:void 0})})})})]})]}),f&&e.jsx("p",{role:"alert",className:"max-h-24 overflow-y-auto border-t border-hairline/40 px-5 py-3 text-[13px] text-danger",children:f}),e.jsxs("div",{className:"flex shrink-0 justify-end gap-2 border-t border-hairline/40 px-5 py-3",children:[e.jsx("button",{type:"button",onClick:()=>J.current(),className:"rounded-lg px-4 py-2 text-[13px] text-ink-secondary hover:bg-control",children:s("common.cancel")}),e.jsxs("button",{type:"button",disabled:!A||y||!t&&!Y.name.trim(),onClick:()=>{ae()},className:"ui-button-primary flex items-center gap-2 rounded-lg bg-accent px-5 py-2 text-[13px] font-medium text-white hover:brightness-110 disabled:opacity-40",children:[y&&e.jsx(X,{size:15,className:"animate-spin"}),s(t?"newBot.saveDefaults":"newBot.create")]})]}),e.jsx(jt,{open:I==="local",onCancel:()=>$(null),onConfirm:()=>{c.consent.acknowledgeLocalAuto=!0,$(null),ae()}})]})})}function ps({team:t}){const n=typeof window>"u"?void 0:window.ogb?.workspaces;return e.jsxs("div",{"data-new-bot-shared":!0,className:"flex flex-wrap items-center gap-x-2 gap-y-1 border-b border-hairline/40 bg-raised/30 px-5 py-2.5 text-[13px] text-ink-secondary",children:[e.jsx("span",{children:s("newBot.sharedWith",{team:t})}),n?e.jsx("button",{type:"button",onClick:()=>{Pt(n).catch(()=>{})},className:"font-medium text-accent hover:underline",children:s("newBot.justForYou")}):e.jsx("span",{children:s("newBot.justForYou").replace(/\s*→$/,"")})]})}function ms({active:t,draft:n,defaultsMode:a,owner:i}){const r=n.bot,{state:l}=k(),d=ke(),c=St(r);return t==="Identity"?e.jsxs("div",{className:"space-y-4",children:[e.jsx(xs,{draft:n,defaultsMode:a}),e.jsx(Tt,{bot:r,patch:c.patch,activeState:c.activeState,mascotMotion:null,namePlaceholder:a?s("newBot.randomName"):void 0}),e.jsxs("label",{className:"block text-[13px] text-ink-secondary",children:[s("newBot.team"),e.jsxs(O,{size:"lg",className:"mt-1.5 w-full",value:r.section??"",onChange:p=>n.patch({section:p.target.value}),children:[e.jsx("option",{value:"",children:s("teamSettings.general")}),[...new Set([...l.sections??[],...l.bots.map(p=>p.section??"")])].filter(Boolean).map(p=>e.jsx("option",{children:p},p))]})]}),i&&d&&e.jsxs("label",{className:"block text-[13px] text-ink-secondary","data-new-bot-reports-to":!0,children:[s("lookedAfter.newBot"),e.jsx(O,{size:"lg",className:"mt-1.5 w-full",value:i.value??"",onChange:p=>i.choose(p.target.value),children:d.people.map(p=>e.jsx("option",{value:p.email,children:p.you?s("owner.you",{name:p.name}):p.name},p.email))}),e.jsx("span",{className:"mt-1 block text-[12px]",children:s("lookedAfter.pickHint")})]})]}):t==="Soul"?e.jsx(At,{bot:r,patch:c.patch}):t==="Skills"?e.jsx(Lt,{bot:r}):t==="Memory"?e.jsx(gs,{draft:n}):t==="Routines"?e.jsx(hs,{draft:n}):t==="Access"?e.jsx(Dt,{bot:r,derived:c}):t==="Model"?e.jsx(Ot,{bot:r}):t==="Permissions"?e.jsx(Mt,{bot:r,derived:c}):e.jsx(Ut,{bot:r,derived:c})}function xs({draft:t,defaultsMode:n}){const[a,i]=o.useState([]),[r,l]=o.useState(0),[d,c]=o.useState(""),p=o.useRef(!1);o.useEffect(()=>{if(n)return;let x=!1;return B("/api/bot-presets").then(h=>{x||i(h.presets)}).catch(()=>{x||i([])}),()=>{x=!0}},[n,r]);const g=t.preset?a.find(x=>x.id===t.preset.id):void 0,j=async x=>{c("");const h=x.startsWith("preset:")?a.find(b=>b.id===x.slice(7)):void 0;if(!h){t.choosePreset(void 0);const b=pe.find(f=>f.id===x);t.chooseRole(b?.id);const v=b&&Ne(b.id)?.look;b&&t.patch({...kt(b),...v});return}t.patch(Qt(h)),t.choosePreset(es(h));const y=Zt(h);try{y?(t.patch({avatarUrl:await t.uploadAvatar(y),avatarCrop:h.bot.appearance.avatar.crop}),p.current=!0):p.current&&(t.patch({avatarUrl:""}),p.current=!1)}catch(b){c(b instanceof Error?b.message:String(b))}},A=async x=>{c("");try{await B(`/api/bot-presets/${encodeURIComponent(x.id)}`,{method:"DELETE"}),t.preset?.id===x.id&&t.choosePreset(void 0),l(h=>h+1)}catch(h){c(h instanceof Error?h.message:String(h))}},N=pe.map(x=>e.jsx("option",{value:x.id,children:x.title},x.id));return e.jsxs("div",{children:[e.jsxs("label",{className:"block text-[13px] text-ink-secondary",children:[s("newBot.startingRole"),e.jsxs(O,{size:"lg",className:"mt-1.5 w-full",value:t.preset?`preset:${t.preset.id}`:"",onChange:x=>{j(x.target.value)},children:[e.jsx("option",{value:"",children:s("newBot.customSettings")}),Xt(a).map(x=>e.jsx("optgroup",{label:x.label,children:x.presets.map(h=>e.jsx("option",{value:`preset:${h.id}`,children:h.name},h.id))},x.label)),a.length?e.jsx("optgroup",{label:s("newBot.builtInRoles"),children:N}):N]})]}),g&&e.jsxs("div",{className:"mt-2 space-y-1 rounded-lg bg-card px-3 py-2.5 text-[13px] text-ink-secondary","data-new-bot-preset":!0,children:[Gt(g).map((x,h)=>e.jsx("p",{className:"break-words",children:x},h)),g.source==="file"&&e.jsx("button",{type:"button",onClick:()=>{A(g)},className:"mt-1 rounded-md px-2 py-1 text-[12px] text-ink-secondary hover:bg-control hover:text-ink",children:s("newBot.presetRemove")})]}),d&&e.jsx("p",{role:"alert",className:"mt-2 text-[13px] text-danger",children:d})]})}function gs({draft:t}){const[n,a]=o.useState("MEMORY.md"),[i,r]=o.useState("");return e.jsxs("div",{className:"space-y-3",children:[e.jsx(O,{size:"lg",className:"w-full","aria-label":s("memory.fileLabel",{path:n}),value:n,onChange:l=>a(l.target.value),children:[...new Set(["MEMORY.md",...Object.keys(t.template.memory)])].map(l=>e.jsx("option",{children:l},l))}),e.jsx("textarea",{className:G(ge,"min-h-72 font-mono"),"aria-label":s("memory.contents"),value:t.template.memory[n]??"",onChange:l=>t.setMemory(n,l.target.value)}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{className:ge,"aria-label":s("memory.newTopicLabel"),placeholder:s("memory.newTopicLabel"),value:i,onChange:l=>r(l.target.value)}),e.jsx("button",{type:"button","aria-label":s("memory.addTopic"),disabled:!/^[a-zA-Z0-9_-]+$/.test(i),className:"rounded-lg bg-control px-3 disabled:opacity-40",onClick:()=>{const l=`memory/${i}.md`;l in t.template.memory||t.setMemory(l,""),a(l),r("")},children:e.jsx(Ht,{size:16})}),n!=="MEMORY.md"&&e.jsx("button",{type:"button","aria-label":s("memory.removeTopic"),className:"rounded-lg bg-control px-3",onClick:()=>{t.setMemory(n,null),a("MEMORY.md")},children:e.jsx(Ce,{size:16})})]})]})}function hs({draft:t}){const[n,a]=o.useState(null);return e.jsxs("div",{className:"space-y-3",children:[e.jsx("button",{type:"button",className:"rounded-lg bg-accent px-3 py-2 text-[13px] text-white",onClick:()=>a("new"),children:s("computer.routines.create")}),t.routines.map(i=>e.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-card p-3",children:[e.jsx("button",{type:"button",className:"min-w-0 flex-1 text-left text-[13px]",onClick:()=>a(i),children:i.name}),e.jsxs("label",{className:"flex items-center gap-1.5 text-[12px] text-ink-secondary",children:[e.jsx("input",{type:"checkbox",checked:i.enabled,onChange:r=>t.setRoutineEnabled(i.id,r.target.checked)}),s("newBot.enabled")]}),e.jsx("button",{type:"button","aria-label":s("newBot.removeRoutine",{name:i.name}),onClick:()=>t.removeRoutine(i.id),className:"rounded p-1.5 hover:bg-control",children:e.jsx(Ce,{size:15})})]},i.id)),n&&e.jsx(zt,{routine:n==="new"?void 0:n,bots:[t.bot],lockedBotId:t.id,onClose:()=>a(null)})]})}function fs({simple:t=!1}){const[n,a]=o.useState(!1),[i,r]=o.useState(!1),l=e.jsxs(e.Fragment,{children:[n&&e.jsx(Re,{defaultsMode:!0,onClose:()=>a(!1)}),i&&e.jsx(ts,{onClose:()=>r(!1)})]});if(t)return e.jsxs(e.Fragment,{children:[e.jsx(os,{onEdit:()=>a(!0),onShare:()=>r(!0)}),l]});const d=e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex shrink-0 gap-2",children:[e.jsx("button",{type:"button",onClick:()=>r(!0),className:"cursor-pointer rounded-lg px-3 py-1.5 text-[13px] text-ink-secondary hover:bg-control hover:text-ink",children:s("newBot.sharePreset")}),e.jsx("button",{type:"button",onClick:()=>a(!0),className:"cursor-pointer rounded-lg bg-control px-3 py-1.5 text-[13px] text-ink hover:bg-raised-hover",children:s("newBot.edit")})]}),l]});return e.jsx(w,{title:s("newBot.defaults"),children:d})}const Hs=Object.freeze(Object.defineProperty({__proto__:null,DefaultBotSettings:fs,NewBotDialog:Re},Symbol.toStringTag,{value:"Module"}));export{Ms as A,Es as B,Os as C,fs as D,_s as E,Ds as F,As as L,Ps as N,Fs as P,Ts as R,Bs as S,Ks as T,Rs as U,$s as a,Ls as b,Us as c,Is as d,zs as e,Hs as f};
@@ -1 +0,0 @@
1
- import{t as s,j as e,a as y,f as re,r as n,X as lt,S as ot,D as J}from"./styles-b2tBrp-F.js";import{o as Fe,a as ct,b as dt,c as mt,d as xt,t as ae,e as pt,M as ut}from"./org-library-BurlfP-M.js";import{t as gt,a as ht}from"./import-name-BpcY7eF3.js";import{bs as bt,bt as ft,bu as yt,w as jt,bv as Te,bw as kt,aM as Ge,u as Me,bx as Nt,by as vt,bz as wt,bA as St,bB as Ct,bC as Lt,n as S,bD as Bt,bE as Oe,bF as Et,F as zt,bG as Tt}from"./App-D93hKk8l.js";import{K as Ot,P as It,r as _e,N as At,L as C,y as Ie,O as Dt}from"./PlacesRail-eySktVNq.js";import{ShareTeamDialog as Pt}from"./ShareTeamDialog-BNMxpMeG.js";import"./package-format-B2CMS446.js";import"./index-CN3qYQZ7.js";import"./monitor-tq9gQZRc.js";import"./MenuMotion-CNjHVOE4.js";import"./team-share-BegoEw7-.js";const Rt={"seo growth team":"seoGrowth","engineering team":"engineering","100x marketing team":"marketing100x","reddit lead miner":"redditLeadMiner","competitor watch":"competitorWatch","inbox follow-up":"inboxFollowup"};function Ue(a){const m=Rt[a.name.trim().toLowerCase()];return m?{...a,name:s(`templates.catalog.${m}.name`),summary:s(`templates.catalog.${m}.summary`),outcome:a.outcome?s(`templates.catalog.${m}.outcome`):void 0}:a}function $t(a,m){const x=Ue(a);return`${x.name} ${x.summary} ${a.name} ${a.summary} ${a.category} ${a.skills.join(" ")} ${a.requires.apps.join(" ")}`.toLowerCase().includes(m)}const O=["bg-purple-500/15 text-purple-300","bg-cyan-500/15 text-cyan-300","bg-orange-500/15 text-orange-300","bg-emerald-500/15 text-emerald-300"];function Ft({pending:a,importedNames:m,org:x=!1}){return e.jsxs(e.Fragment,{children:[a.description&&e.jsx("p",{className:"max-w-2xl text-[14px] leading-relaxed text-ink-secondary",children:a.description}),a.brief&&e.jsxs("div",{className:"mt-4 rounded-xl border border-hairline px-4 py-3 text-[13px] text-ink-secondary",children:[e.jsx("div",{className:"font-medium text-ink",children:s("teamImport.brief")}),e.jsx("p",{className:"mt-1 line-clamp-4 whitespace-pre-wrap break-words",children:a.brief})]}),!!a.warnings?.length&&e.jsxs("div",{className:"mt-4 rounded-xl border border-hairline px-4 py-3 text-[13px] text-ink-secondary",children:[e.jsx("div",{className:"mb-2 font-medium text-ink",children:s("templates.backupNotes")}),a.warnings?.map((d,o)=>e.jsx("p",{children:d},o))]}),(a.kind==="package"||a.kind==="backup")&&e.jsxs("div",{className:"mt-5 flex flex-wrap gap-2 text-[12px] text-ink-secondary",children:[a.chiefOfStaff&&e.jsxs("span",{className:"flex items-center gap-1.5 rounded-full bg-raised px-3 py-1.5",children:[e.jsx(bt,{size:13}),s("templates.leads",{name:a.chiefOfStaff})]}),!a.library&&e.jsxs("span",{className:"flex items-center gap-1.5 rounded-full bg-raised px-3 py-1.5",children:[e.jsx(ft,{size:13}),s("templates.groupChats",{count:a.rooms})]}),!(a.library&&!a.playbooks)&&e.jsxs("span",{className:"flex items-center gap-1.5 rounded-full bg-raised px-3 py-1.5",children:[e.jsx(yt,{size:13}),s("templates.playbooks",{count:a.playbooks})]}),!a.library&&e.jsxs("span",{className:"flex items-center gap-1.5 rounded-full bg-raised px-3 py-1.5",children:[e.jsx(jt,{size:13}),a.version===2?s("teamImport.routinesPaused",{count:a.routines}):s("templates.pausedRoutines",{count:a.routines})]}),a.kind==="package"&&a.version!==2&&e.jsxs("span",{className:"flex items-center gap-1.5 rounded-full bg-raised px-3 py-1.5",children:[e.jsx(Te,{size:13}),s("templates.connections",{count:a.apps.length})]}),!!a.connections?.length&&e.jsxs("span",{className:"flex items-center gap-1.5 rounded-full bg-raised px-3 py-1.5",children:[e.jsx(Te,{size:13}),s("teamImport.connections",{count:a.connections?.length??0})]}),!!a.notes&&e.jsxs("span",{className:"flex items-center gap-1.5 rounded-full bg-raised px-3 py-1.5",children:[e.jsx(kt,{size:13}),s("teamImport.notes",{count:a.notes??0})]}),!!a.presets?.length&&e.jsxs("span",{className:"flex items-center gap-1.5 rounded-full bg-raised px-3 py-1.5",children:[e.jsx(Ge,{size:13}),s("teamImport.presets",{count:a.presets?.length??0})]})]}),!!a.skills?.length&&e.jsxs("div",{className:"mt-4 rounded-xl border border-hairline px-4 py-3 text-[13px] text-ink-secondary",children:[e.jsx("div",{className:"font-medium text-ink",children:x?s("orgLibrary.skillsOn"):a.version===2?s("teamImport.skillsOff"):s("templates.skillsDisabled")}),e.jsx("p",{className:"mt-1 break-words",children:a.skills?.join(", ")}),!x&&e.jsx("p",{className:"mt-1",children:a.version===2?s("teamImport.skillsReview"):s("templates.skillsReview")})]}),a.library&&!!a.presets?.length&&e.jsxs("div",{className:"mt-4 rounded-xl border border-hairline px-4 py-3 text-[13px] text-ink-secondary",children:[e.jsx("div",{className:"font-medium text-ink",children:s("teamImport.presetList")}),e.jsx("p",{className:"mt-1 break-words",children:a.presets?.join(", ")})]}),!!a.offeredSkills?.length&&e.jsxs("div",{className:"mt-4 rounded-xl border border-hairline px-4 py-3 text-[13px] text-ink-secondary",children:[e.jsx("div",{className:"font-medium text-ink",children:s("teamImport.offeredSkills")}),e.jsx("p",{className:"mt-1 break-words",children:a.offeredSkills?.join(", ")})]}),!!a.connections?.length&&e.jsxs("div",{className:"mt-4 rounded-xl border border-hairline px-4 py-3 text-[13px] text-ink-secondary",children:[e.jsx("div",{className:"font-medium text-ink",children:s("teamImport.connections",{count:a.connections?.length??0})}),e.jsx("ul",{className:"mt-1",children:a.connections?.map((d,o)=>e.jsxs("li",{className:"truncate",children:[d.label," · ",d.url]},`${d.label}-${o}`))})]}),a.members.length>0&&e.jsx("div",{className:"mt-6 text-[12px] font-medium text-ink-secondary",children:s("templates.teamMembers")}),e.jsx("div",{className:"mt-2 grid grid-cols-1 gap-x-10 md:grid-cols-2",children:a.members.map((d,o)=>e.jsxs("div",{className:"flex min-h-[72px] items-center gap-3 border-b border-hairline/35 px-1 py-3",children:[a.pictures?.[o]?e.jsx("img",{src:a.pictures[o],alt:"",className:"size-9 shrink-0 rounded-lg object-cover"}):e.jsx("div",{className:y("flex size-9 shrink-0 items-center justify-center rounded-lg text-[13px] font-semibold",O[o%O.length]),children:d.name.slice(0,1).toUpperCase()}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-[14px] font-medium text-ink",children:m[o]}),m[o]!==d.name&&e.jsx("div",{className:"text-[12px] text-ink-secondary",children:s("templates.newCopyOf",{name:d.name})}),e.jsx("div",{className:"mt-0.5 truncate text-[13px] text-ink-secondary",children:d.title||s("templates.generalAssistant")})]})]},`${d.name}-${o}`))}),e.jsxs("div",{className:"mt-6 flex items-start gap-2.5 rounded-xl bg-raised/45 px-4 py-3 text-[13px] leading-relaxed text-ink-secondary",children:[e.jsx(re,{size:15,className:"mt-0.5 shrink-0 text-success"}),e.jsx("p",{children:a.kind==="backup"?s("templates.backupSafety",{archived:a.archivedBots?s("templates.archivedBots",{count:a.archivedBots}):""}):x?a.members.length?s("orgLibrary.teamSafety"):s("orgLibrary.librarySafety"):a.library?s("teamImport.librarySafety"):a.version===2?s("teamImport.sharedTeamSafety"):a.kind==="package"?s("templates.packageSafety"):s("templates.legacySafety")})]})]})}const Gt={gmail:"Gmail",github:"GitHub",discord:"Discord",slack:"Slack",googlecalendar:"Google Calendar",notion:"Notion",linear:"Linear",figma:"Figma",gong:"Gong",hubspot:"HubSpot",postiz:"Postiz"},Ae={everyday:"readyBots.category.everyday",work:"readyBots.category.work",writing:"readyBots.category.writing",design:"readyBots.category.design",sales:"readyBots.category.sales",personal:"readyBots.category.personal"};function Mt({search:a,onDialog:m,onAdded:x}){const[d,o]=n.useState(null),{state:h,dispatch:j}=Me(),[v,p]=n.useState(null),b=l=>{if(!(l!==null&&Lt(h))){if(l!==null&&window.ogb?.remoteClient?.active){j({type:"newBot",onCreated:x});return}p(l),m(l!==null)}},L=Nt.filter(l=>(!d||l.category===d)&&vt(l,a));return a.trim()&&L.length===0?null:e.jsxs("section",{className:"mb-8","aria-labelledby":"ready-bots-title",children:[e.jsxs("div",{className:"mb-1 flex flex-wrap items-baseline justify-between gap-2",children:[e.jsx("h3",{id:"ready-bots-title",className:"text-[12px] font-medium text-ink-secondary",children:s("readyBots.title")}),e.jsx("p",{className:"text-[12px] text-ink-tertiary",children:s("readyBots.subtitle")})]}),e.jsx("div",{className:"mb-3 mt-2 flex flex-wrap gap-1.5",role:"group","aria-label":s("readyBots.categories"),children:[null,...wt].map(l=>e.jsx("button",{type:"button","aria-pressed":d===l,onClick:()=>o(l),className:y("rounded-full px-3 py-1 text-[13px] transition-colors",d===l?"bg-ink text-panel":"bg-raised/70 text-ink-secondary hover:text-ink"),children:l?s(Ae[l]):s("readyBots.all")},l??"all"))}),e.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3",children:L.map(l=>{const w=St(l);return e.jsxs("article",{"data-ready-bot":l.id,className:"flex flex-col rounded-2xl border border-hairline/40 bg-card p-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ot,{color:l.look.color,bodyId:l.look.mascotBody,size:40,animated:!1,label:l.name}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h4",{className:"truncate text-[14px] font-medium text-ink",children:l.name}),e.jsxs("p",{className:"truncate text-[12px] text-ink-secondary",children:[w.title," · ",s(Ae[l.category])]})]}),e.jsxs("button",{type:"button",onClick:()=>b(l.id),"aria-label":s("readyBots.addAria",{name:l.name,title:w.title}),className:"flex h-8 shrink-0 items-center gap-1 rounded-full bg-raised px-3 text-[13px] font-medium text-ink hover:bg-raised-hover focus-visible:outline-2 focus-visible:outline-accent",children:[e.jsx(It,{size:14,"aria-hidden":"true"}),s("readyBots.add")]})]}),e.jsx("p",{className:"mt-3 text-[13px] leading-[1.45] text-ink-secondary",children:w.description}),e.jsx("p",{className:"mt-2 text-[12px] italic text-ink-tertiary",children:s("readyBots.try",{prompt:w.tryAsking})}),(l.apps.length>0||l.routines?.length)&&e.jsx("p",{className:"mt-auto pt-2 text-[12px] text-ink-tertiary",children:[l.apps.length>0&&s("readyBots.worksWith",{apps:l.apps.map(I=>Gt[I]??I).join(", ")}),l.routines?.length&&s("readyBots.pausedRoutine")].filter(Boolean).join(" · ")})]},l.id)})}),v&&_e.createPortal(e.jsx(Ct,{readyBotId:v,onClose:()=>b(null),onCreated:l=>{m(!1),x(l)}}),document.body)]})}const De=["bg-cyan-500/15 text-cyan-300","bg-purple-500/15 text-purple-300","bg-emerald-500/15 text-emerald-300","bg-orange-500/15 text-orange-300"];function _t({listing:a,busy:m,notice:x,error:d,onAdd:o,onDetails:h}){const j=a.organization.name;return e.jsxs("div",{children:[e.jsx("p",{className:"max-w-2xl text-[13px] leading-relaxed text-ink-secondary",children:s("orgLibrary.intro",{name:j})}),a.packages.length===0?e.jsx("p",{className:"mt-6 text-[13px] text-ink-secondary",children:s("orgLibrary.empty",{name:j})}):e.jsx("div",{className:"mt-4 grid grid-cols-1 gap-x-10 md:grid-cols-2",children:a.packages.map((v,p)=>e.jsx(Ut,{entry:v,index:p,busy:m,onAdd:o,onDetails:h},v.packageId))}),x&&e.jsx("div",{role:"status",className:"mt-4 rounded-lg bg-raised/60 px-3 py-2 text-[13px] text-ink-secondary",children:x}),d&&e.jsx("div",{role:"alert",className:"mt-4 rounded-lg bg-danger/10 px-3 py-2 text-[13px] text-danger",children:d})]})}function Ut({entry:a,index:m,busy:x,onAdd:d,onDetails:o}){const h=Fe(a),j=ct(a),v=dt(a),p=x===a.packageId;return e.jsxs("article",{className:"flex min-h-[104px] items-center gap-3 border-b border-hairline/35 px-1 py-4",children:[e.jsx("div",{className:y("flex size-11 shrink-0 items-center justify-center rounded-xl",De[m%De.length]),children:e.jsx(At,{size:20})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h3",{className:"truncate text-[14px] font-medium text-ink",children:a.name}),e.jsx("p",{className:"mt-0.5 truncate text-[13px] text-ink-secondary",children:a.tagline}),e.jsxs("p",{className:"mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-[12px] text-ink-tertiary",children:[e.jsx("span",{children:mt(a)}),j&&e.jsx("span",{className:"rounded-full bg-accent/10 px-2 py-0.5 text-accent-text",children:j}),a.release&&e.jsx("span",{children:a.release.version})]}),e.jsx("p",{className:"mt-0.5 truncate text-[12px] text-ink-tertiary",children:xt(a.contents)}),v.map(b=>e.jsx("p",{className:"mt-0.5 text-[12px] text-warning",children:b},b))]}),e.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1.5",children:[h==="add"&&e.jsxs("button",{onClick:()=>d(a),disabled:x!==null,"aria-label":s("orgLibrary.addAria",{name:a.name}),className:"flex min-w-[72px] items-center justify-center gap-1.5 rounded-full bg-accent px-3.5 py-2 text-[13px] font-medium text-white hover:bg-accent/90 disabled:opacity-40",children:[p&&e.jsx(C,{size:13,className:"animate-spin"}),p?s("orgLibrary.adding"):s("orgLibrary.add")]}),h==="added"&&e.jsxs("span",{className:"flex items-center gap-1 rounded-full bg-raised px-3 py-1.5 text-[12px] text-ink-secondary",children:[e.jsx(re,{size:13,className:"text-success"}),s("orgLibrary.added")]}),h==="updateApp"&&e.jsx("span",{className:"max-w-[140px] text-right text-[12px] text-ink-secondary",children:s("orgLibrary.updateApp")}),h==="notReady"&&e.jsx("span",{className:"text-[12px] text-ink-secondary",children:s("orgLibrary.notReady")}),h==="noRelease"&&e.jsx("span",{className:"text-[12px] text-ink-secondary",children:s("orgLibrary.noRelease")}),a.blob==="ready"&&e.jsx("button",{onClick:()=>o(a),disabled:x!==null,"aria-label":s("orgLibrary.detailsAria",{name:a.name}),className:"rounded-full px-2.5 py-1 text-[12px] text-ink-secondary hover:bg-raised hover:text-ink disabled:opacity-40",children:s("orgLibrary.details")})]})]})}const Yt="https://github.com/milind-soni/openmausbot-teams",Pe=["cyan","red","purple","green","orange"];async function Re(a){if(window.ogb?.openExternal){await window.ogb.openExternal(a);return}const m=window.open(a,"_blank","noopener,noreferrer");m&&(m.opener=null)}function Kt(a,m){const x=new Map;for(const o of m){if(o.hidden)continue;const h=o.section?.trim()??"";x.set(h,(x.get(h)??0)+1)}return[...[...new Set([...a.map(o=>o.trim()).filter(Boolean),...x.keys()])].filter(o=>o!==""),""].flatMap(o=>x.get(o)?[{name:o,bots:x.get(o)}]:[])}function $e({index:a}){return e.jsx("div",{className:y("flex size-11 shrink-0 items-center justify-center rounded-xl",O[a%O.length]),children:e.jsx(Ge,{size:20})})}function as({onClose:a,onImported:m,returnFocusRef:x,initialUrl:d}){const{state:o,dispatch:h}=Me(),j=n.useRef(null),v=n.useRef(null),[p,b]=n.useState("explore"),[L,l]=n.useState(null),[w,I]=n.useState(!0),[ne,ie]=n.useState(""),[W,le]=n.useState(null),[c,A]=n.useState(null),[Ye,Ke]=n.useState("file"),[X,oe]=n.useState(""),[ce,de]=n.useState(!1),[k,P]=n.useState(!1),[He,Q]=n.useState(!1),[R,qe]=n.useState(""),[E,g]=n.useState(""),[me,xe]=n.useState(""),[$,pe]=n.useState(!1),[f,ue]=n.useState(null),[Je,We]=n.useState(""),[F,V]=n.useState(null),[ge,he]=n.useState(new Set),[be,fe]=n.useState(""),[G,ye]=n.useState(!1),[M,je]=n.useState(null),[ke,Xe]=n.useState(!1),[_,Ne]=n.useState(null),[Qe,U]=n.useState(null),[Ve,ve]=n.useState(""),[Ze,Y]=n.useState(""),[z,K]=n.useState(null),B=n.useRef(!1),T=n.useRef(0),Z=o.bots.filter(t=>!t.hidden).length,we=Kt(o.sections??[],o.bots),et=new Set(o.bots.map(t=>t.name.trim().toLowerCase())),tt=c?.members.map(t=>gt(t.name,et))??[],ee=n.useCallback(async()=>{I(!0),ie("");try{l(await S("/api/team-library/catalog"))}catch(t){ie(t instanceof Error?t.message:String(t))}finally{I(!1)}},[]);n.useEffect(()=>{ee()},[ee]);const H=n.useCallback(async()=>{try{const t=await S("/api/org-library");Ne(t),t.organization&&!B.current&&b("org")}catch{Ne({organization:null,packages:[]})}},[]);n.useEffect(()=>{H()},[H]),n.useEffect(()=>(j.current?.focus(),()=>x.current?.focus()),[x]),n.useEffect(()=>{const t=r=>{if(M!==null||ke)return;if(r.key==="Escape"&&!k){r.preventDefault(),r.stopPropagation(),c?(A(null),K(null)):a();return}if(r.key!=="Tab")return;const i=j.current,u=Array.from(i?.querySelectorAll('button:not([disabled]), a[href], input:not([disabled]), [tabindex]:not([tabindex="-1"])')??[]);if(!i||u.length===0)return;const N=u[0],q=u.at(-1);r.shiftKey&&(document.activeElement===N||!i.contains(document.activeElement))?(r.preventDefault(),q.focus()):!r.shiftKey&&document.activeElement===q&&(r.preventDefault(),N.focus())};return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[k,a,c,M,ke]);const te=(t,r)=>{A(t),Ke(r),g("")},Se=async t=>{if(t.size>ut)throw new Error(s("templates.fileTooLarge"));const r=await t.text();let i=r;if(!t.name.toLowerCase().endsWith(".md"))try{i=JSON.parse(r)}catch(u){throw u instanceof SyntaxError?new Error(s("teamLibrary.invalidJson")):u}te(ae(i),"file")},st=async t=>{le(t.slug),g("");try{te(ae(await S(`/api/team-library/teams/${t.slug}`)),"library")}catch(r){g(r instanceof Error?r.message:String(r))}finally{le(null)}},Ce=async()=>{await Le(X)},Le=async t=>{if(t.trim()){de(!0),g("");try{const r=await S("/api/team-library/github",{method:"POST",body:JSON.stringify({url:t.trim()})});te(ae(r),"github")}catch(r){g(r instanceof Error?r.message:String(r))}finally{de(!1)}}};n.useEffect(()=>{d&&(B.current=!0,b("import"),oe(d),Le(d))},[d]);const at=async()=>{if(c){P(!0),g("");try{const t=await ht(c.manifest,h);J("team_imported",{members:t.bots.length,source:Ye,mode:"add",format:c.kind}),m({name:c.name,members:t.bots.length,...t.connections?.length?{connections:t.connections.length}:{},...t.presets?.length?{presets:t.presets.length}:{}})}catch(t){g(t instanceof Error?t.message:String(t))}finally{P(!1)}}},rt=async t=>{U(t.packageId),Y("");try{const r=await S(`/api/org-library/packages/${t.packageId}`);A(pt(r.document)),K(t),g("")}catch(r){Y(r instanceof Error?r.message:String(r))}finally{U(null)}},Be=async t=>{U(t.packageId),P(!0),Y(""),ve(""),g("");try{const r=await S("/api/org-library/add",{method:"POST",body:JSON.stringify({packageId:t.packageId})});for(const u of r.bots??[])h({type:"botAdded",bot:u});for(const u of r.groups??[])h({type:"groupPatched",group:u});for(const u of r.routines??[])h({type:"routinePatched",routine:u});const i=r.bots?.find(u=>!u.hidden);if(J("team_imported",{members:r.bots?.length??0,source:"organization",mode:"add",format:"package"}),i){h({type:"select",id:i.id}),m({name:t.name,members:r.bots.length,...r.connections?.length?{connections:r.connections.length}:{}});return}A(null),K(null),r.alreadyAdded||ve(s("orgLibrary.addedSkills",{name:t.name})),await H()}catch(r){const i=r instanceof Error?r.message:String(r);z?g(i):Y(i),await H()}finally{U(null),P(!1)}},D=me.trim(),se=async t=>{const r=++T.current;pe(!0),g(""),ue(null),V(null),he(new Set);try{const i=await S(`/api/teams/scout?cwd=${encodeURIComponent(t)}`);if(r!==T.current)return;ue(i),We(t),fe(i.suggestion.roomName),J("team_scouted",{signals:i.suggestion.manifest.team.members.length-1}),S(`/api/teams/scout/directory?cwd=${encodeURIComponent(t)}`).then(u=>{r===T.current&&V(u.directory)}).catch(()=>{r===T.current&&V([])})}catch(i){if(r!==T.current)return;g(i instanceof Error?i.message:String(i))}finally{r===T.current&&pe(!1)}},nt=async()=>{const t=await window.ogb?.pickFolder?.(D||void 0);t&&(xe(t),await se(t))},it=async()=>{if(!(!f||G)){ye(!0),g("");try{const t=(F??[]).filter(N=>ge.has(N.slug)).map((N,q)=>({key:`dir-${N.slug}`,name:N.name,title:N.category||s("templates.communityBot"),description:N.prompt,appearance:{color:Pe[q%Pe.length]}})),r={...f.suggestion.manifest,team:{...f.suggestion.manifest.team,members:[...f.suggestion.manifest.team.members,...t]}},i=be.trim()||f.suggestion.roomName,u=await S(`/api/teams/import?mode=project&cwd=${encodeURIComponent(Je)}&room=${encodeURIComponent(i)}`,{method:"POST",body:JSON.stringify(r)});for(const N of u.bots)h({type:"botAdded",bot:N});u.group&&(h({type:"groupPatched",group:{...u.group,messages:[]}}),h({type:"select",id:u.group.id})),J("team_imported",{members:u.bots.length,source:"scout",mode:"project"}),m({name:i,members:u.bots.length})}catch(t){g(t instanceof Error?t.message:String(t))}finally{ye(!1)}}},Ee=R.trim().toLowerCase(),ze=(L?.teams??[]).filter(t=>!Ee||$t(t,Ee));return _e.createPortal(e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/55 p-4 sm:p-6",onMouseDown:t=>t.target===t.currentTarget&&!k&&a(),children:[e.jsxs("div",{ref:j,role:"dialog","aria-modal":"true","aria-labelledby":"team-library-title",tabIndex:-1,className:"animate-pop-in flex h-[min(780px,calc(100dvh-2rem))] w-full max-w-[1040px] flex-col overflow-hidden rounded-2xl border border-hairline/50 bg-panel shadow-2xl shadow-black/50 outline-none",children:[e.jsxs("header",{className:"flex items-start justify-between gap-4 px-6 pb-3 pt-6 sm:px-8 sm:pt-7",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[c&&e.jsx("button",{onClick:()=>{A(null),K(null),g("")},disabled:k,className:"rounded-lg p-1.5 text-ink-secondary hover:bg-raised hover:text-ink disabled:opacity-50","aria-label":s("templates.back"),children:e.jsx(Bt,{size:18})}),e.jsx("h2",{id:"team-library-title",className:"truncate text-[22px] font-semibold tracking-[-0.01em] text-ink",children:c?c.name:s("templates.title")})]}),e.jsx("p",{className:y("mt-1 text-[13px] text-ink-secondary",c&&"ml-9"),children:c?c.kind==="backup"?s("templates.backupSummary",{bots:c.members.length,conversations:c.conversations??0}):c.kind==="package"?c.library?s("teamImport.library"):c.version===2?s("teamImport.sharedTeam",{count:c.members.length}):s("templates.playbookSummary",{count:c.members.length}):s("templates.readyBots",{count:c.members.length}):s("templates.subtitle")})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[!c&&e.jsxs("button",{onClick:()=>{Re(L?.repositoryUrl??Yt)},className:"flex items-center gap-1.5 rounded-lg px-2.5 py-2 text-[13px] text-ink-secondary hover:bg-raised hover:text-ink",title:s("templates.openRepository"),children:[e.jsx(Oe,{size:16}),e.jsx("span",{className:"max-sm:hidden",children:s("templates.communityRepo")}),e.jsx(Ie,{size:12})]}),e.jsx("button",{onClick:a,disabled:k,className:"rounded-lg p-2 text-ink-secondary hover:bg-raised hover:text-ink disabled:opacity-50","aria-label":s("templates.close"),children:e.jsx(lt,{size:21})})]})]}),c?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto px-6 pb-6 pt-6 sm:px-8",children:[e.jsx(Ft,{pending:c,importedNames:tt,org:z!==null}),E&&e.jsx("div",{role:"alert",className:"mt-4 rounded-lg bg-danger/10 px-3 py-2 text-[13px] text-danger",children:E})]}),e.jsxs("footer",{className:"flex flex-col gap-3 border-t border-hairline/35 px-6 py-4 sm:flex-row sm:items-center sm:justify-between sm:px-8",children:[e.jsxs("div",{className:"text-[13px] text-ink-secondary",children:[s(Z===0?"templates.existingNone":Z===1?"templates.existingOne":"templates.existingMany",{count:Z})," ",c.kind==="backup"?s("teamImport.backupCopies"):c.library?s("teamImport.libraryAdds"):c.members.length===0?"":s("teamImport.newSection",{name:c.teamName??c.name})]}),z?Fe(z)==="add"?e.jsxs("button",{onClick:()=>{Be(z)},disabled:k,"aria-label":s("orgLibrary.addAria",{name:z.name}),className:"flex shrink-0 items-center justify-center gap-2 rounded-full bg-accent px-5 py-2.5 text-[14px] font-medium text-white hover:bg-accent/90 disabled:opacity-60",children:[k&&e.jsx(C,{size:15,className:"animate-spin"}),k?s("orgLibrary.adding"):s("orgLibrary.add")]}):e.jsxs("span",{className:"flex shrink-0 items-center gap-1 rounded-full bg-raised px-4 py-2 text-[13px] text-ink-secondary",children:[e.jsx(re,{size:14,className:"text-success"}),s("orgLibrary.added")]}):e.jsxs("button",{onClick:()=>{at()},disabled:k,className:"flex shrink-0 items-center justify-center gap-2 rounded-full bg-accent px-5 py-2.5 text-[14px] font-medium text-white hover:bg-accent/90 disabled:opacity-60",children:[k&&e.jsx(C,{size:15,className:"animate-spin"}),k?s("templates.importing"):c.kind==="backup"?s("templates.importBackup"):c.library?s("teamImport.addPresets"):s("templates.addTeam")]})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-3 px-6 pb-4 pt-5 sm:flex-row sm:items-center sm:justify-between sm:px-8",children:[e.jsxs("div",{className:"flex w-fit rounded-xl bg-raised/70 p-1",role:"tablist","aria-label":s("templates.source"),children:[_?.organization&&e.jsx("button",{role:"tab","aria-selected":p==="org",onClick:()=>{B.current=!0,b("org"),g("")},className:y("max-w-[220px] truncate rounded-lg px-4 py-2 text-[14px] transition-colors",p==="org"?"bg-card text-ink shadow-sm":"text-ink-secondary hover:text-ink"),children:s("orgLibrary.tab",{name:_.organization.name})}),e.jsx("button",{role:"tab","aria-selected":p==="explore",onClick:()=>{B.current=!0,b("explore"),g("")},className:y("rounded-lg px-4 py-2 text-[14px] transition-colors",p==="explore"?"bg-card text-ink shadow-sm":"text-ink-secondary hover:text-ink"),children:s("templates.explore")}),e.jsx("button",{role:"tab","aria-selected":p==="import",onClick:()=>{B.current=!0,b("import"),g("")},className:y("rounded-lg px-4 py-2 text-[14px] transition-colors",p==="import"?"bg-card text-ink shadow-sm":"text-ink-secondary hover:text-ink"),children:s("templates.import")}),e.jsx("button",{role:"tab","aria-selected":p==="scout",onClick:()=>{B.current=!0,b("scout"),g("")},className:y("rounded-lg px-4 py-2 text-[14px] transition-colors",p==="scout"?"bg-card text-ink shadow-sm":"text-ink-secondary hover:text-ink"),children:s("templates.fromFolder")}),e.jsx("button",{role:"tab","aria-selected":p==="share",onClick:()=>{B.current=!0,b("share"),g("")},className:y("rounded-lg px-4 py-2 text-[14px] transition-colors",p==="share"?"bg-card text-ink shadow-sm":"text-ink-secondary hover:text-ink"),children:s("teamLibrary.shareTab")})]}),p==="explore"&&e.jsxs("label",{className:"flex h-11 w-full items-center gap-2.5 rounded-xl bg-raised/70 px-3.5 sm:w-[320px]",children:[e.jsx(ot,{size:17,className:"shrink-0 text-ink-secondary"}),e.jsx("input",{value:R,onChange:t=>qe(t.target.value),placeholder:s("templates.search"),"aria-label":s("templates.search"),className:"min-w-0 flex-1 bg-transparent text-[14px] text-ink placeholder:text-ink-secondary focus:outline-none"})]})]}),e.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto px-6 pb-7 pt-5 sm:px-8",children:[p==="org"&&_?.organization&&e.jsx(_t,{listing:_,busy:Qe,notice:Ve,error:Ze,onAdd:t=>{Be(t)},onDetails:t=>{rt(t)}}),p==="explore"&&e.jsxs("div",{children:[e.jsx(Mt,{search:R,onDialog:Xe,onAdded:a}),e.jsx("div",{className:"mb-3 text-[12px] font-medium text-ink-secondary",children:R?s("templates.searchResults"):s("templates.communityTemplates")}),w&&e.jsxs("div",{className:"flex items-center justify-center gap-2 py-24 text-[13px] text-ink-secondary",children:[e.jsx(C,{size:16,className:"animate-spin"})," ",s("templates.loading")]}),!w&&ne&&e.jsxs("div",{className:"rounded-xl bg-danger/10 p-4 text-[13px] text-danger",children:[e.jsx("p",{children:ne}),e.jsx("button",{onClick:()=>{ee()},className:"mt-3 rounded-full bg-raised px-3.5 py-2 text-ink hover:bg-raised-hover",children:s("common.tryAgain")})]}),!w&&L&&e.jsx("div",{className:"grid grid-cols-1 gap-x-10 md:grid-cols-2",children:ze.map((t,r)=>{const i=Ue(t);return e.jsxs("article",{className:"flex min-h-[104px] items-center gap-3 border-b border-hairline/35 px-1 py-4",children:[e.jsx($e,{index:r}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h3",{className:"truncate text-[14px] font-medium text-ink",children:i.name}),e.jsx("p",{className:"mt-0.5 truncate text-[13px] text-ink-secondary",children:i.outcome??i.summary}),e.jsxs("p",{className:"mt-1 truncate text-[12px] text-ink-tertiary",children:[s("templates.botCount",{count:t.members})," · ",s("templates.playbookCount",{count:t.skills.length}),t.requires.apps.length>0&&` · ${t.requires.apps.join(", ")}`,t.setupMinutes&&` · ${s("templates.minutes",{count:t.setupMinutes})}`]})]}),e.jsxs("button",{onClick:()=>{st(t)},disabled:W!==null,className:"flex min-w-[72px] items-center justify-center gap-1.5 rounded-full bg-raised px-3.5 py-2 text-[13px] text-ink hover:bg-raised-hover disabled:opacity-40",children:[W===t.slug&&e.jsx(C,{size:13,className:"animate-spin"}),W===t.slug?s("templates.loadingShort"):s("templates.load")]})]},t.slug)})}),!w&&L&&ze.length===0&&e.jsxs("div",{className:"flex min-h-56 flex-col items-center justify-center text-center",children:[e.jsx("div",{className:"text-[14px] font-medium text-ink",children:s("templates.noneFound")}),e.jsx("div",{className:"mt-1 text-[13px] text-ink-secondary",children:s("templates.tryDifferentSearch")})]})]}),p==="import"&&e.jsxs("div",{children:[e.jsx("input",{ref:v,type:"file",accept:".md,.json,.mausbackup.json,.mausteam.json,text/markdown,application/json",className:"hidden",onChange:t=>{const r=t.currentTarget.files?.[0];t.currentTarget.value="",r&&Se(r).catch(i=>g(i instanceof Error?i.message:String(i)))}}),e.jsx("div",{className:"mb-3 text-[12px] font-medium text-ink-secondary",children:s("templates.bringYourOwn")}),e.jsxs("div",{className:"grid gap-5 md:grid-cols-2",children:[e.jsxs("button",{onClick:()=>v.current?.click(),onDragEnter:t=>{t.preventDefault(),Q(!0)},onDragOver:t=>t.preventDefault(),onDragLeave:()=>Q(!1),onDrop:t=>{t.preventDefault(),Q(!1);const r=t.dataTransfer.files[0];r&&Se(r).catch(i=>g(i instanceof Error?i.message:String(i)))},className:y("flex min-h-56 flex-col items-center justify-center rounded-2xl border border-dashed px-6 text-center transition-colors",He?"border-accent bg-accent/5":"border-hairline/60 bg-raised/20 hover:bg-raised/35"),children:[e.jsx(Dt,{size:27,className:"text-accent"}),e.jsx("span",{className:"mt-3 text-[14px] font-medium text-ink",children:s("templates.chooseFile")}),e.jsx("span",{className:"mt-1 text-[13px] text-ink-secondary",children:s("templates.dropFile")})]}),e.jsxs("div",{className:"flex min-h-56 flex-col justify-center rounded-2xl bg-raised/25 px-6",children:[e.jsx(Oe,{size:25,className:"text-ink-secondary"}),e.jsx("h3",{className:"mt-3 text-[14px] font-medium text-ink",children:s("templates.loadGithub")}),e.jsx("p",{className:"mt-1 text-[13px] leading-relaxed text-ink-secondary",children:s("templates.githubHint")}),e.jsxs("div",{className:"mt-4 flex gap-2",children:[e.jsx("input",{value:X,onChange:t=>oe(t.target.value),onKeyDown:t=>t.key==="Enter"&&void Ce(),placeholder:s("templates.githubPlaceholder"),"aria-label":s("templates.githubUrl"),className:"min-w-0 flex-1 rounded-xl bg-raised/80 px-3 py-2.5 text-[13px] text-ink placeholder:text-ink-secondary focus:outline-none"}),e.jsxs("button",{onClick:()=>{Ce()},disabled:!X.trim()||ce,className:"flex items-center gap-1.5 rounded-full bg-accent px-4 py-2.5 text-[13px] font-medium text-white hover:bg-accent/90 disabled:opacity-40",children:[ce&&e.jsx(C,{size:13,className:"animate-spin"}),s("templates.load")]})]})]})]}),E&&e.jsx("div",{role:"alert",className:"mt-4 rounded-lg bg-danger/10 px-3 py-2 text-[13px] text-danger",children:E})]}),p==="share"&&e.jsxs("div",{children:[e.jsx("p",{className:"max-w-2xl text-[13px] leading-relaxed text-ink-secondary",children:s("teamLibrary.shareIntro")}),we.length===0?e.jsx("p",{className:"mt-6 text-[13px] text-ink-secondary",children:s("teamLibrary.shareEmpty")}):e.jsx("div",{className:"mt-4 grid grid-cols-1 gap-x-10 md:grid-cols-2",children:we.map((t,r)=>e.jsxs("article",{className:"flex min-h-[84px] items-center gap-3 border-b border-hairline/35 px-1 py-4",children:[e.jsx($e,{index:r}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h3",{className:"truncate text-[14px] font-medium text-ink",children:t.name||s("teamLibrary.general")}),e.jsx("p",{className:"mt-0.5 text-[13px] text-ink-secondary",children:s("teamLibrary.shareBots",{count:t.bots})})]}),e.jsxs("button",{onClick:()=>je(t.name),"aria-label":s("teamLibrary.shareTeamAria",{name:t.name||s("teamLibrary.general")}),className:"flex items-center gap-1.5 rounded-full bg-raised px-3.5 py-2 text-[13px] text-ink hover:bg-raised-hover",children:[e.jsx(Et,{size:13}),s("teamLibrary.shareTeam")]})]},t.name||"general"))})]}),p==="scout"&&e.jsxs("div",{children:[e.jsx("div",{className:"mb-3 text-[12px] font-medium text-ink-secondary",children:s("templates.startFolder")}),e.jsx("p",{className:"max-w-2xl text-[13px] leading-relaxed text-ink-secondary",children:s("templates.scoutHint")}),e.jsxs("div",{className:"mt-4 flex flex-col gap-2 sm:flex-row",children:[e.jsx("input",{value:me,onChange:t=>xe(t.target.value),onKeyDown:t=>t.key==="Enter"&&D&&void se(D),placeholder:"/path/to/your/project","aria-label":s("templates.projectFolder"),className:"min-w-0 flex-1 rounded-xl bg-raised/80 px-3 py-2.5 text-[13px] text-ink placeholder:text-ink-secondary focus:outline-none"}),!!window.ogb?.pickFolder&&e.jsxs("button",{onClick:()=>{nt()},disabled:$,className:"flex items-center justify-center gap-1.5 rounded-full bg-raised px-4 py-2.5 text-[13px] text-ink hover:bg-raised-hover disabled:opacity-40",children:[e.jsx(zt,{size:14}),s("templates.browse")]}),e.jsxs("button",{onClick:()=>{se(D)},disabled:!D||$,className:"flex items-center justify-center gap-1.5 rounded-full bg-accent px-4 py-2.5 text-[13px] font-medium text-white hover:bg-accent/90 disabled:opacity-40",children:[$?e.jsx(C,{size:14,className:"animate-spin"}):e.jsx(Tt,{size:14}),$?s("templates.scouting"):s("templates.scout")]})]}),f&&e.jsxs("div",{className:"mt-6",children:[e.jsxs("div",{className:"rounded-2xl bg-raised/25 px-5 py-4",children:[e.jsx("div",{className:"text-[15px] font-semibold text-ink",children:f.profile.name}),f.profile.summary&&e.jsx("p",{className:"mt-1 text-[13px] leading-relaxed text-ink-secondary",children:f.profile.summary}),f.profile.stacks.length>0&&e.jsx("div",{className:"mt-2.5 flex flex-wrap gap-1.5",children:f.profile.stacks.map(t=>e.jsx("span",{className:"rounded-full bg-raised px-2.5 py-1 text-[12px] text-ink-secondary",children:t},t))})]}),e.jsx("div",{className:"mt-5 text-[12px] font-medium text-ink-secondary",children:s("templates.suggestedTeam")}),e.jsx("div",{className:"mt-1 grid grid-cols-1 gap-x-10 md:grid-cols-2",children:f.suggestion.manifest.team.members.map((t,r)=>e.jsxs("div",{className:"flex min-h-[64px] items-center gap-3 border-b border-hairline/35 px-1 py-3",children:[e.jsx("div",{className:y("flex size-9 shrink-0 items-center justify-center rounded-lg text-[13px] font-semibold",O[r%O.length]),children:t.name.slice(0,1).toUpperCase()}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"truncate text-[14px] font-medium text-ink",children:[t.name," ",e.jsxs("span",{className:"font-normal text-ink-secondary",children:["· ",t.title]})]}),e.jsx("div",{className:"mt-0.5 truncate text-[12px] text-ink-secondary",children:f.suggestion.reasons[t.key]??""})]})]},t.key))}),F&&F.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mt-5 text-[12px] font-medium text-ink-secondary",children:s("templates.communityDirectory")}),e.jsx("div",{className:"mt-1 flex flex-col",children:F.map(t=>e.jsxs("div",{className:"flex items-center gap-3 border-b border-hairline/35 px-1 py-3",children:[e.jsxs("label",{className:"flex min-w-0 flex-1 cursor-pointer items-center gap-3",children:[e.jsx("input",{type:"checkbox",checked:ge.has(t.slug),onChange:()=>he(r=>{const i=new Set(r);return i.has(t.slug)?i.delete(t.slug):i.add(t.slug),i}),className:"size-4 accent-accent"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"truncate text-[14px] font-medium text-ink",children:[t.name,t.category&&e.jsxs("span",{className:"font-normal text-ink-secondary",children:[" · ",t.category]})]}),e.jsx("div",{className:"mt-0.5 truncate text-[12px] text-ink-secondary",children:s("templates.matches",{values:t.matched.join(", ")})})]})]}),e.jsx("button",{onClick:()=>{Re(t.detailUrl)},"aria-label":s("templates.openDirectory",{name:t.name}),title:s("templates.readBeforeAdding"),className:"rounded-lg p-1.5 text-ink-secondary hover:bg-raised hover:text-ink",children:e.jsx(Ie,{size:14})})]},t.slug))})]}),e.jsxs("div",{className:"mt-6 flex flex-col gap-3 sm:flex-row sm:items-center",children:[e.jsx("input",{value:be,onChange:t=>fe(t.target.value),"aria-label":s("templates.groupChatName"),className:"min-w-0 flex-1 rounded-xl bg-raised/80 px-3 py-2.5 text-[13px] text-ink placeholder:text-ink-secondary focus:outline-none"}),e.jsxs("button",{onClick:()=>{it()},disabled:G,className:"flex shrink-0 items-center justify-center gap-2 rounded-full bg-accent px-5 py-2.5 text-[14px] font-medium text-white hover:bg-accent/90 disabled:opacity-60",children:[G&&e.jsx(C,{size:15,className:"animate-spin"}),G?s("templates.creating"):s("templates.createGroupChat")]})]}),e.jsx("p",{className:"mt-2 text-[12px] text-ink-secondary",children:s("templates.createGroupHint")})]}),E&&e.jsx("div",{role:"alert",className:"mt-4 rounded-lg bg-danger/10 px-3 py-2 text-[13px] text-danger",children:E})]})]})]})]}),M!==null&&e.jsx(Pt,{team:M,onClose:()=>je(null)})]}),document.body)}export{Ft as TeamImportDetails,as as TeamLibraryPanel,Kt as shareableTeamList};
@@ -1 +0,0 @@
1
- import{U as a,C as n}from"./mermaid.core-DCkDS2l6.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c};