@lobu/runtime-server 24.5.0 → 24.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/dist/catalogs/connectors.json +342 -4
  2. package/dist/catalogs/skills.json +1 -1
  3. package/dist/component.json +1 -1
  4. package/dist/connectors/linkedin-identity.ts +43 -0
  5. package/dist/connectors/linkedin.ts +154 -3
  6. package/dist/connectors/x-like-follow.ts +329 -0
  7. package/dist/connectors/x.ts +709 -80
  8. package/dist/dependencies.bun.lock +18 -18
  9. package/dist/owletto/dist/assets/_-DT3E3BmS.js +3 -0
  10. package/dist/owletto/dist/assets/_-c1xy7bLu.js +2 -0
  11. package/dist/owletto/dist/assets/_agentId-CTfoi0-7.js +2 -0
  12. package/dist/owletto/dist/assets/_agentId-DV8utajn.js +2 -0
  13. package/dist/owletto/dist/assets/_automationId-DvP3qyYL.js +2 -0
  14. package/dist/owletto/dist/assets/_connectorKey._connectionId-CL5SivCn.js +2 -0
  15. package/dist/owletto/dist/assets/_connectorKey.index-tnMwC67b.js +2 -0
  16. package/dist/owletto/dist/assets/_conversationId-DXN_8m88.js +2 -0
  17. package/dist/owletto/dist/assets/_eventId-SdpFT7jB.js +2 -0
  18. package/dist/owletto/dist/assets/_name-CM1AMywz.js +2 -0
  19. package/dist/owletto/dist/assets/_owner-CaGsXXBW.js +3 -0
  20. package/dist/owletto/dist/assets/_shape-DGAkETDp.js +2 -0
  21. package/dist/owletto/dist/assets/_skillKey-Dd4ZHPY8.js +2 -0
  22. package/dist/owletto/dist/assets/_slug-cRvJQtNo.js +2 -0
  23. package/dist/owletto/dist/assets/_view-B5I7mmkl.js +2 -0
  24. package/dist/owletto/dist/assets/_viewKey-Bwn0dyLo.js +2 -0
  25. package/dist/owletto/dist/assets/_viewKey-YjSYD0wc.js +2 -0
  26. package/dist/owletto/dist/assets/{accept-invitation-pUl-c1KQ.js → accept-invitation-CQZQ0wwC.js} +2 -2
  27. package/dist/owletto/dist/assets/{activity-route-view-DN0ZEAzr.js → activity-route-view-CZykJXQp.js} +2 -2
  28. package/dist/owletto/dist/assets/{agent-card-controls-C5jNWgfq.js → agent-card-controls-DuQJhtqp.js} +2 -2
  29. package/dist/owletto/dist/assets/{agent-client-setup-list-DbXtJTsO.js → agent-client-setup-list-CpUTAjXf.js} +2 -2
  30. package/dist/owletto/dist/assets/{agent-connect-pages-DcTuiSt9.js → agent-connect-pages-Br_ycC0z.js} +2 -2
  31. package/dist/owletto/dist/assets/agent-editor-form-BXQBFHSv.js +2 -0
  32. package/dist/owletto/dist/assets/{agent-guardrails-route-BJyfalBY.js → agent-guardrails-route-CN7vpC0X.js} +2 -2
  33. package/dist/owletto/dist/assets/{agent-list-row-rF5LH-3k.js → agent-list-row-BnP6r4pm.js} +2 -2
  34. package/dist/owletto/dist/assets/{agent-loading-shells-ClY_O6lb.js → agent-loading-shells-_18OREnx.js} +2 -2
  35. package/dist/owletto/dist/assets/{agent-permissions-matrix-bP1Qihv7.js → agent-permissions-matrix-DSjidWHL.js} +2 -2
  36. package/dist/owletto/dist/assets/{agent-skill-context-BAaGpvfS.js → agent-skill-context-1DBn7Xc_.js} +2 -2
  37. package/dist/owletto/dist/assets/{agent-skills-route-Bv5luNdw.js → agent-skills-route-d5jh3oBR.js} +2 -2
  38. package/dist/owletto/dist/assets/{agent-tab-intro-ednTs4WF.js → agent-tab-intro-DKrC3SQt.js} +2 -2
  39. package/dist/owletto/dist/assets/{agent-thread-WNk2HapT.js → agent-thread-FyEO-y44.js} +3 -3
  40. package/dist/owletto/dist/assets/agents-kXojozTU.js +2 -0
  41. package/dist/owletto/dist/assets/{agents-workbench-bPTjdVS1.js → agents-workbench-CDpJmUVN.js} +2 -2
  42. package/dist/owletto/dist/assets/{app._appId-DrL5H5lB.js → app._appId-DwNeXRJp.js} +2 -2
  43. package/dist/owletto/dist/assets/{assist-composer-ClfFEVx7.js → assist-composer-Mn9EfX4X.js} +2 -2
  44. package/dist/owletto/dist/assets/automation-detail-content-Bs3vwAPd.js +2 -0
  45. package/dist/owletto/dist/assets/{automation-row-DCHM--aD.js → automation-row-B5Q1B10y.js} +2 -2
  46. package/dist/owletto/dist/assets/automation-source-list-Dhucq1sI.js +2 -0
  47. package/dist/owletto/dist/assets/automations-kXojozTU.js +2 -0
  48. package/dist/owletto/dist/assets/{callback-DRABUOha.js → callback-9xSHyA12.js} +2 -2
  49. package/dist/owletto/dist/assets/{card-Bdi7VEwo.js → card-g4yxo4Hr.js} +2 -2
  50. package/dist/owletto/dist/assets/{change-summary-PBoM6Asb.js → change-summary-DeuXQEpb.js} +2 -2
  51. package/dist/owletto/dist/assets/{claim-CUIG1Oc-.js → claim-B98IhDra.js} +2 -2
  52. package/dist/owletto/dist/assets/{client-activity-scopes-CXOWB5co.js → client-activity-scopes-BD2HBo-_.js} +2 -2
  53. package/dist/owletto/dist/assets/{client-rows-36VnmgMK.js → client-rows-x_CxeWkP.js} +2 -2
  54. package/dist/owletto/dist/assets/{clients-BJRcMk1A.js → clients-Cmp0LmOp.js} +2 -2
  55. package/dist/owletto/dist/assets/connect-menu-CezOH3s7.js +2 -0
  56. package/dist/owletto/dist/assets/connect-zUot_0kG.js +2 -0
  57. package/dist/owletto/dist/assets/connect._clientId-nsGxe6yO.js +2 -0
  58. package/dist/owletto/dist/assets/connected._clientId-DnclRRXk.js +2 -0
  59. package/dist/owletto/dist/assets/connected._clientId.activity-CDB8atTX.js +2 -0
  60. package/dist/owletto/dist/assets/{connected._clientId.index-jSnGvzYs.js → connected._clientId.index-DBNP2mZo.js} +2 -2
  61. package/dist/owletto/dist/assets/{connection-q1bdnxCN.js → connection-B6fM2KHN.js} +2 -2
  62. package/dist/owletto/dist/assets/{connection-feed-detail-BIlkK0Pd.js → connection-feed-detail-Ckq-qEbD.js} +2 -2
  63. package/dist/owletto/dist/assets/{connections-browser-V-3td9DB.js → connections-browser-BXsJqieG.js} +2 -2
  64. package/dist/owletto/dist/assets/{connector-boxes-lFc-WP83.js → connector-boxes-CbqSFeVm.js} +2 -2
  65. package/dist/owletto/dist/assets/{connector-page-shell-Cs1SjrYB.js → connector-page-shell-Di6XzkVo.js} +2 -2
  66. package/dist/owletto/dist/assets/{connector-provenance-aJFeeRIC.js → connector-provenance-BrnasBW4.js} +2 -2
  67. package/dist/owletto/dist/assets/{connector-scope-lists--vNdbOn0.js → connector-scope-lists-dQnZARCD.js} +2 -2
  68. package/dist/owletto/dist/assets/{connectors-BsvDMdsQ.js → connectors-DnOUxX_U.js} +2 -2
  69. package/dist/owletto/dist/assets/{consent-DJV78pnz.js → consent-Byli4yMs.js} +2 -2
  70. package/dist/owletto/dist/assets/{copy-button-DjMWgrBf.js → copy-button-Ddf7lBjZ.js} +2 -2
  71. package/dist/owletto/dist/assets/{core.esm-CQzL3ObT.js → core.esm-BsXtvNoI.js} +2 -2
  72. package/dist/owletto/dist/assets/create-B34eskZ_.js +2 -0
  73. package/dist/owletto/dist/assets/create-DLB9sXgU.js +2 -0
  74. package/dist/owletto/dist/assets/{create-jBEuveV1.js → create-YdAnh3ml.js} +2 -2
  75. package/dist/owletto/dist/assets/create-automation-form-C9PMX7N8.js +3 -0
  76. package/dist/owletto/dist/assets/create._connectorKey-Bz4OYRiC.js +2 -0
  77. package/dist/owletto/dist/assets/definition-comparison-B5WgZILB.js +2 -0
  78. package/dist/owletto/dist/assets/{device-Ba3RsIgb.js → device-DdCoCj-Q.js} +2 -2
  79. package/dist/owletto/dist/assets/device-pin-tombstone-B06J7Af1.js +2 -0
  80. package/dist/owletto/dist/assets/device._deviceId-Bh9S4bFp.js +2 -0
  81. package/dist/owletto/dist/assets/dynamic-schema-form-qWSRtOAv.js +2 -0
  82. package/dist/owletto/dist/assets/{entity-options-daOOQo7O.js → entity-options-BkU_En_f.js} +2 -2
  83. package/dist/owletto/dist/assets/entity-page-BPFDHY8q.js +2 -0
  84. package/dist/owletto/dist/assets/entity-pages-DxgbjLMt.js +2 -0
  85. package/dist/owletto/dist/assets/entity-type-page-D0ghgRgq.js +2 -0
  86. package/dist/owletto/dist/assets/event-card-CjA_dLzq.js +2 -0
  87. package/dist/owletto/dist/assets/{event-detail-DkY95e5b.js → event-detail-CmC-DVrK.js} +2 -2
  88. package/dist/owletto/dist/assets/{events-feed-B9CZHI_P.js → events-feed-CGzA1w3R.js} +2 -2
  89. package/dist/owletto/dist/assets/filter-bar-CQ_oE7a9.js +2 -0
  90. package/dist/owletto/dist/assets/{full-page-spinner-BqmckkOf.js → full-page-spinner-B5xXnKtV.js} +2 -2
  91. package/dist/owletto/dist/assets/guardrails-DkXatmea.js +2 -0
  92. package/dist/owletto/dist/assets/identity-BwJy3ixB.js +2 -0
  93. package/dist/owletto/dist/assets/{index--ZWegctR.js → index-35ehGReZ.js} +2 -2
  94. package/dist/owletto/dist/assets/index-B9hYiwBw.js +2 -0
  95. package/dist/owletto/dist/assets/{index-C186T2Rw.js → index-BDl1_w6U.js} +2 -2
  96. package/dist/owletto/dist/assets/{index-ijqrJaRB.js → index-BdNR51Ua.js} +2 -2
  97. package/dist/owletto/dist/assets/{index-DdBTTN3y.js → index-BjcZVe7n.js} +52 -52
  98. package/dist/owletto/dist/assets/{index-CsrT07TJ.js → index-BqAVebvY.js} +2 -2
  99. package/dist/owletto/dist/assets/index-BvK1fS1J.js +2 -0
  100. package/dist/owletto/dist/assets/{index-DdYWarql.css → index-CNEpTkgw.css} +1 -1
  101. package/dist/owletto/dist/assets/index-CRc73k1t.js +2 -0
  102. package/dist/owletto/dist/assets/index-CYGaSD3y.js +2 -0
  103. package/dist/owletto/dist/assets/index-CfZGe-zn.js +2 -0
  104. package/dist/owletto/dist/assets/{index-B0kw2lFL.js → index-CkiyxW4w.js} +2 -2
  105. package/dist/owletto/dist/assets/index-CzLDNB2E.js +2 -0
  106. package/dist/owletto/dist/assets/{index-BKrdVwW9.js → index-D-o5iOVd.js} +2 -2
  107. package/dist/owletto/dist/assets/index-DjYVV1Ml.js +2 -0
  108. package/dist/owletto/dist/assets/{index-ikp_mTsf.js → index-TkPy_P_u.js} +2 -2
  109. package/dist/owletto/dist/assets/index-VyAX-asP.js +2 -0
  110. package/dist/owletto/dist/assets/json-diff-DtZtra_g.js +28 -0
  111. package/dist/owletto/dist/assets/{list-skeleton-CXDLkYTg.js → list-skeleton-CIHWCi2a.js} +2 -2
  112. package/dist/owletto/dist/assets/{login-u6LCgDYG.js → login-TWR0vF4_.js} +2 -2
  113. package/dist/owletto/dist/assets/{logout-JhmuWJEH.js → logout-BA5kojS0.js} +2 -2
  114. package/dist/owletto/dist/assets/{manage-gear-D8LMhehh.js → manage-gear-C-0BAMbC.js} +2 -2
  115. package/dist/owletto/dist/assets/{member-scope-gate-4FQ0aanZ.js → member-scope-gate-BQiRAqtx.js} +2 -2
  116. package/dist/owletto/dist/assets/memory-browse-page-Ba32-vVL.js +74 -0
  117. package/dist/owletto/dist/assets/{model-jL871x2J.js → model-C2q7WDcS.js} +2 -2
  118. package/dist/owletto/dist/assets/{model-selector-CgU8SJMF.js → model-selector-B2cjCn0V.js} +2 -2
  119. package/dist/owletto/dist/assets/models-CZkH5gtj.js +2 -0
  120. package/dist/owletto/dist/assets/{nav-pill-DrFkuyUQ.js → nav-pill-Bam6s3jj.js} +2 -2
  121. package/dist/owletto/dist/assets/new-BJst6K0b.js +2 -0
  122. package/dist/owletto/dist/assets/{new-DgE1pVV0.js → new-Dc5Bbotb.js} +2 -2
  123. package/dist/owletto/dist/assets/new-DgbivfDe.js +2 -0
  124. package/dist/owletto/dist/assets/{organization-CKM_oFX3.js → organization-B9U1L-56.js} +2 -2
  125. package/dist/owletto/dist/assets/peek-pane-content-Cq8P38s3.js +2 -0
  126. package/dist/owletto/dist/assets/{pending-seed-sml8Uf6e.js → pending-seed-BP3xHM2d.js} +2 -2
  127. package/dist/owletto/dist/assets/{permissions-BvA9SATv.js → permissions-BVlbeY4u.js} +2 -2
  128. package/dist/owletto/dist/assets/proposal-review-shell-BED-DO9C.js +2 -0
  129. package/dist/owletto/dist/assets/public-shell-ready-Diq15_QW.js +2 -0
  130. package/dist/owletto/dist/assets/{record-activity-C9gVBbF0.js → record-activity-CTLwq8s1.js} +2 -2
  131. package/dist/owletto/dist/assets/{record-session-R-uHNuby.js → record-session-DOFgdd43.js} +2 -2
  132. package/dist/owletto/dist/assets/renderer-CHPS-1vD.js +96 -0
  133. package/dist/owletto/dist/assets/{reset-password-Mx3baeNc.js → reset-password-BmNM-apc.js} +2 -2
  134. package/dist/owletto/dist/assets/{run-activity-link-CaIBSRQj.js → run-activity-link-Dh1YyCfk.js} +2 -2
  135. package/dist/owletto/dist/assets/{run-initiator-BvzQJYW9.js → run-initiator-CCxNv0rK.js} +2 -2
  136. package/dist/owletto/dist/assets/{runs-fFJ1lPnw.js → runs-BntGAKQG.js} +2 -2
  137. package/dist/owletto/dist/assets/{runs-panel-DEnZHTa5.js → runs-panel-BwTVaRsE.js} +2 -2
  138. package/dist/owletto/dist/assets/{runs-table-XGnxJl7S.js → runs-table-CYS1jDdL.js} +2 -2
  139. package/dist/owletto/dist/assets/{schema-type-editor-panel-C0_9VcSs.js → schema-type-editor-panel-v3nR2Oa2.js} +2 -2
  140. package/dist/owletto/dist/assets/schema-value-BFb7jCBo.js +3 -0
  141. package/dist/owletto/dist/assets/settings-DBgT60nY.js +2 -0
  142. package/dist/owletto/dist/assets/{settings-CP4PjMQA.js → settings-DubSpJfg.js} +2 -2
  143. package/dist/owletto/dist/assets/skills-DDoeRGhJ.js +2 -0
  144. package/dist/owletto/dist/assets/{source-record-panels-Bh0n4gGw.js → source-record-panels-m8gECt82.js} +2 -2
  145. package/dist/owletto/dist/assets/{status-dot-Cpq63I7p.js → status-dot-BnQPFrcU.js} +2 -2
  146. package/dist/owletto/dist/assets/{table-BUqshjxa.js → table-DALHuXPE.js} +2 -2
  147. package/dist/owletto/dist/assets/{use-automations-BLNjxq2K.js → use-automations-D9hKpufo.js} +2 -2
  148. package/dist/owletto/dist/assets/{use-login-redirect-CmyQW7GT.js → use-login-redirect-ciwfc-7A.js} +2 -2
  149. package/dist/owletto/dist/assets/{use-mention-search-dn3ws1WB.js → use-mention-search-CJGCatFS.js} +2 -2
  150. package/dist/owletto/dist/assets/{use-scroll-sentinel-DRyBMueA.js → use-scroll-sentinel-BWCrmNIB.js} +2 -2
  151. package/dist/owletto/dist/assets/view-param-filters-CDvwie_f.js +2 -0
  152. package/dist/owletto/dist/assets/views-access-required-CZ1fvAks.js +2 -0
  153. package/dist/owletto/dist/index.html +2 -2
  154. package/dist/server-main.bundle.mjs +5596 -4000
  155. package/npm-shrinkwrap.json +99 -99
  156. package/package.json +1 -1
  157. package/vendor/connector-sdk/package.json +1 -1
  158. package/vendor/core/dist/contracts/tools/view-host.d.ts +7 -0
  159. package/vendor/core/dist/contracts/tools/view-host.js +28 -0
  160. package/vendor/core/dist/contracts/tools/view-runtime.d.ts +2 -4
  161. package/vendor/core/dist/contracts/tools/view-runtime.js +19 -7
  162. package/vendor/core/package.json +11 -1
  163. package/vendor/views/dist/api.d.ts +9 -4
  164. package/vendor/views/dist/api.js +33 -2
  165. package/vendor/views/dist/bridge.d.ts +8 -0
  166. package/vendor/views/dist/bridge.js +12 -2
  167. package/vendor/views/dist/components.d.ts +4 -2
  168. package/vendor/views/dist/components.js +29 -14
  169. package/vendor/views/dist/index.d.ts +1 -1
  170. package/vendor/views/dist/index.js +1 -1
  171. package/vendor/views/dist/native.d.ts +327 -0
  172. package/vendor/views/dist/native.js +57 -0
  173. package/vendor/views/package.json +1 -1
  174. package/dist/owletto/dist/assets/_-CCWuGXtQ.js +0 -2
  175. package/dist/owletto/dist/assets/_-DOJW1D-I.js +0 -3
  176. package/dist/owletto/dist/assets/_agentId-CJhQbi6k.js +0 -2
  177. package/dist/owletto/dist/assets/_agentId-DD4K1i6V.js +0 -2
  178. package/dist/owletto/dist/assets/_automationId-Cbd7B0mP.js +0 -2
  179. package/dist/owletto/dist/assets/_connectorKey._connectionId-DFpPep9B.js +0 -2
  180. package/dist/owletto/dist/assets/_connectorKey.index-n3iSDT74.js +0 -2
  181. package/dist/owletto/dist/assets/_conversationId-B1yGIGA9.js +0 -2
  182. package/dist/owletto/dist/assets/_eventId-B1H0-vD7.js +0 -2
  183. package/dist/owletto/dist/assets/_name-D30_V03t.js +0 -2
  184. package/dist/owletto/dist/assets/_owner-Be8O41u8.js +0 -3
  185. package/dist/owletto/dist/assets/_shape-C6YbloRh.js +0 -2
  186. package/dist/owletto/dist/assets/_skillKey-BMPvvoOI.js +0 -2
  187. package/dist/owletto/dist/assets/_slug-Bc4YIEA2.js +0 -2
  188. package/dist/owletto/dist/assets/_view-aoFDwEld.js +0 -2
  189. package/dist/owletto/dist/assets/_viewKey-DuNHc3cc.js +0 -2
  190. package/dist/owletto/dist/assets/_viewKey-rJ7A1zNx.js +0 -2
  191. package/dist/owletto/dist/assets/agent-editor-form-CdA5vLr8.js +0 -2
  192. package/dist/owletto/dist/assets/agents-DY2S2SGE.js +0 -2
  193. package/dist/owletto/dist/assets/automation-detail-content-dFy1Huas.js +0 -2
  194. package/dist/owletto/dist/assets/automations-DY2S2SGE.js +0 -2
  195. package/dist/owletto/dist/assets/calendar-Ck0yOLYu.js +0 -2
  196. package/dist/owletto/dist/assets/code-editor-DNuRKde1.js +0 -16
  197. package/dist/owletto/dist/assets/connect-CMcEQWls.js +0 -2
  198. package/dist/owletto/dist/assets/connect-menu-C-B-1xGR.js +0 -2
  199. package/dist/owletto/dist/assets/connect._clientId-tGipxP5a.js +0 -2
  200. package/dist/owletto/dist/assets/connected._clientId-DSGU78eV.js +0 -2
  201. package/dist/owletto/dist/assets/connected._clientId.activity-CPLbry8R.js +0 -2
  202. package/dist/owletto/dist/assets/create-BmKx5vq3.js +0 -2
  203. package/dist/owletto/dist/assets/create-Rt0RbiD4.js +0 -2
  204. package/dist/owletto/dist/assets/create-automation-form-PEmSLMD6.js +0 -3
  205. package/dist/owletto/dist/assets/create._connectorKey-DcxhYIYC.js +0 -2
  206. package/dist/owletto/dist/assets/device-pin-tombstone-C79KIAIK.js +0 -2
  207. package/dist/owletto/dist/assets/device._deviceId-CIaoq9co.js +0 -2
  208. package/dist/owletto/dist/assets/entity-avatar-TVKjZxWQ.js +0 -2
  209. package/dist/owletto/dist/assets/entity-page-BfJXvbxn.js +0 -2
  210. package/dist/owletto/dist/assets/entity-type-page-BLwH6qa7.js +0 -2
  211. package/dist/owletto/dist/assets/event-card-DVUB8my6.js +0 -2
  212. package/dist/owletto/dist/assets/filter-bar-wPaR12SS.js +0 -2
  213. package/dist/owletto/dist/assets/guardrails-Csusrok2.js +0 -2
  214. package/dist/owletto/dist/assets/identity-Dmg3STO8.js +0 -2
  215. package/dist/owletto/dist/assets/index-BUBcNNUY.js +0 -2
  216. package/dist/owletto/dist/assets/index-BUDr4-Yv.js +0 -2
  217. package/dist/owletto/dist/assets/index-BYPQWVwD.js +0 -2
  218. package/dist/owletto/dist/assets/index-BfpaPJPj.js +0 -2
  219. package/dist/owletto/dist/assets/index-BicNFLBW.js +0 -2
  220. package/dist/owletto/dist/assets/index-Bsdv5aks.js +0 -2
  221. package/dist/owletto/dist/assets/index-CX0pJ9j9.js +0 -2
  222. package/dist/owletto/dist/assets/index-JYEIN8nM.js +0 -2
  223. package/dist/owletto/dist/assets/json-diff-BaLL4Fsu.js +0 -14
  224. package/dist/owletto/dist/assets/memory-browse-page-CNZJbCJC.js +0 -74
  225. package/dist/owletto/dist/assets/models-jdemgIZk.js +0 -2
  226. package/dist/owletto/dist/assets/new-CcJOd5aH.js +0 -2
  227. package/dist/owletto/dist/assets/new-OWwrYckd.js +0 -2
  228. package/dist/owletto/dist/assets/peek-pane-content-D68BjguQ.js +0 -2
  229. package/dist/owletto/dist/assets/proposal-review-shell-D6KABxah.js +0 -2
  230. package/dist/owletto/dist/assets/public-shell-ready-BIVCHQHe.js +0 -2
  231. package/dist/owletto/dist/assets/renderer-DXfJaCCa.js +0 -97
  232. package/dist/owletto/dist/assets/settings-CgaUJMHH.js +0 -2
  233. package/dist/owletto/dist/assets/skills-D-e_h3a9.js +0 -2
  234. package/dist/owletto/dist/assets/view-param-filters-CER47Tlz.js +0 -2
  235. package/dist/owletto/dist/assets/views-access-required-C_b9itZ2.js +0 -2
@@ -1,2 +1,2 @@
1
- import{bs as C,ft as R}from"./index-DdBTTN3y.js";var U={exports:{}},I;function W(){return I||(I=1,(function(u,d){(function(O,_){u.exports=_()})(globalThis,()=>(()=>{var y={949(X,v,m){Object.defineProperty(v,"__esModule",{value:!0}),v.CronParser=void 0;var r=m(515),T=(function(){function f(t,e,o){e===void 0&&(e=!0),o===void 0&&(o=!1),this.expression=t,this.dayOfWeekStartIndexZero=e,this.monthStartIndexZero=o}return f.prototype.parse=function(){var t,e,o=(t=this.expression)!==null&&t!==void 0?t:"";if(o==="@reboot")return e=["@reboot","","","","","",""],e;if(o.startsWith("@")){var n=this.parseSpecial(this.expression);e=this.extractParts(n)}else e=this.extractParts(this.expression);return this.normalize(e),this.validate(e),e},f.prototype.parseSpecial=function(t){var e={"@yearly":"0 0 1 1 *","@annually":"0 0 1 1 *","@monthly":"0 0 1 * *","@weekly":"0 0 * * 0","@daily":"0 0 * * *","@midnight":"0 0 * * *","@hourly":"0 * * * *","@reboot":"@reboot"},o=e[t];if(!o)throw new Error("Unknown special expression.");return o},f.prototype.extractParts=function(t){if(!this.expression)throw new Error("cron expression is empty");for(var e=t.trim().split(/[ ]+/),o=0;o<e.length;o++)if(e[o].includes(",")){var n=e[o].split(",").map(function(a){return a.trim()}).filter(function(a){return a!==""}).map(function(a){return isNaN(Number(a))?a:Number(a)}).filter(function(a){return a!==null&&a!==""});n.length===0&&n.push("*"),n.sort(function(a,s){return a!==null&&s!==null?a-s:0}),e[o]=n.map(function(a){return a!==null?a.toString():""}).join(",")}if(e.length<5)throw new Error("Expression has only ".concat(e.length," part").concat(e.length==1?"":"s",". At least 5 parts are required."));if(e.length==5)e.unshift(""),e.push("");else if(e.length==6){var i=/\d{4}$/.test(e[5])||e[4]=="?"||e[2]=="?";i?e.unshift(""):e.push("")}else if(e.length>7)throw new Error("Expression has ".concat(e.length," parts; too many!"));return e},f.prototype.normalize=function(t){var e=this;if(t[3]=t[3].replace("?","*"),t[5]=t[5].replace("?","*"),t[2]=t[2].replace("?","*"),t[0].indexOf("0/")==0&&(t[0]=t[0].replace("0/","*/")),t[1].indexOf("0/")==0&&(t[1]=t[1].replace("0/","*/")),t[2].indexOf("0/")==0&&(t[2]=t[2].replace("0/","*/")),t[3].indexOf("1/")==0&&(t[3]=t[3].replace("1/","*/")),t[4].indexOf("1/")==0&&(t[4]=t[4].replace("1/","*/")),t[6].indexOf("1/")==0&&(t[6]=t[6].replace("1/","*/")),t[5]=t[5].replace(/(^\d)|([^#/\s]\d)/g,function(l){var g=l.replace(/\D/,""),h=g;return e.dayOfWeekStartIndexZero?g=="7"&&(h="0"):h=(parseInt(g)-1).toString(),l.replace(g,h)}),t[5]=="L"&&(t[5]="6"),t[3]=="?"&&(t[3]="*"),t[3].indexOf("W")>-1&&(t[3].indexOf(",")>-1||t[3].indexOf("-")>-1))throw new Error("The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.");var o={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var n in o)t[5]=t[5].replace(new RegExp(n,"gi"),o[n].toString());t[4]=t[4].replace(/(^\d{1,2})|([^#/\s]\d{1,2})/g,function(l){var g=l.replace(/\D/,""),h=g;return e.monthStartIndexZero&&(h=(parseInt(g)+1).toString()),l.replace(g,h)});var i={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};for(var a in i)t[4]=t[4].replace(new RegExp(a,"gi"),i[a].toString());t[0]=="0"&&(t[0]=""),!/\*|\-|\,|\//.test(t[2])&&(/\*|\//.test(t[1])||/\*|\//.test(t[0]))&&(t[2]+="-".concat(t[2]));for(var s=0;s<t.length;s++)if(t[s].indexOf(",")!=-1&&(t[s]=t[s].split(",").filter(function(l){return l!==""}).join(",")||"*"),t[s]=="*/1"&&(t[s]="*"),t[s].indexOf("/")>-1&&!/^\*|\-|\,/.test(t[s])){var c=null;switch(s){case 4:c="12";break;case 5:c="6";break;case 6:c="9999";break;default:c=null;break}if(c!==null){var p=t[s].split("/");t[s]="".concat(p[0],"-").concat(c,"/").concat(p[1])}}},f.prototype.validate=function(t){var e="0-9,\\-*/";this.validateOnlyExpectedCharactersFound(t[0],e),this.validateOnlyExpectedCharactersFound(t[1],e),this.validateOnlyExpectedCharactersFound(t[2],e),this.validateOnlyExpectedCharactersFound(t[3],"0-9,\\-*/LW"),this.validateOnlyExpectedCharactersFound(t[4],e),this.validateOnlyExpectedCharactersFound(t[5],"0-9,\\-*/L#"),this.validateOnlyExpectedCharactersFound(t[6],e),this.validateAnyRanges(t)},f.prototype.validateAnyRanges=function(t){r.default.secondRange(t[0]),r.default.minuteRange(t[1]),r.default.hourRange(t[2]),r.default.dayOfMonthRange(t[3]),r.default.monthRange(t[4],this.monthStartIndexZero),r.default.dayOfWeekRange(t[5],this.dayOfWeekStartIndexZero)},f.prototype.validateOnlyExpectedCharactersFound=function(t,e){var o=t.match(new RegExp("[^".concat(e,"]+"),"gi"));if(o&&o.length)throw new Error("Expression contains invalid values: '".concat(o.toString(),"'"))},f})();v.CronParser=T},333(X,v,m){Object.defineProperty(v,"__esModule",{value:!0}),v.ExpressionDescriptor=void 0;var r=m(823),T=m(949),f=(function(){function t(e,o){if(this.expression=e,this.options=o,this.expressionParts=new Array(5),!this.options.locale&&t.defaultLocale&&(this.options.locale=t.defaultLocale),!t.locales[this.options.locale]){var n=Object.keys(t.locales)[0];console.warn("Locale '".concat(this.options.locale,"' could not be found; falling back to '").concat(n,"'.")),this.options.locale=n}this.i18n=t.locales[this.options.locale],o.use24HourTimeFormat===void 0&&(o.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return t.toString=function(e,o){var n=o===void 0?{}:o,i=n.throwExceptionOnParseError,a=i===void 0?!0:i,s=n.verbose,c=s===void 0?!1:s,p=n.dayOfWeekStartIndexZero,l=p===void 0?!0:p,g=n.monthStartIndexZero,h=g===void 0?!1:g,S=n.use24HourTimeFormat,x=n.trimHoursLeadingZero,b=x===void 0?!1:x,k=n.locale,D=k===void 0?null:k,E=n.logicalAndDayFields,A=E===void 0?!1:E,M={throwExceptionOnParseError:a,verbose:c,dayOfWeekStartIndexZero:l,monthStartIndexZero:h,use24HourTimeFormat:S,trimHoursLeadingZero:b,locale:D,logicalAndDayFields:A};M.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported.");var H=new t(e,M);return H.getFullDescription()},t.initialize=function(e,o){o===void 0&&(o="en"),t.specialCharacters=["/","-",",","*"],t.defaultLocale=o,e.load(t.locales)},t.prototype.getFullDescription=function(){var e,o,n="";try{var i=new T.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);if(this.expressionParts=i.parse(),this.expressionParts[0]==="@reboot")return((o=(e=this.i18n).atReboot)===null||o===void 0?void 0:o.call(e))||"Run once, at startup";var a=this.getTimeOfDayDescription(),s=this.getDayOfMonthDescription(),c=this.getMonthDescription(),p=this.getDayOfWeekDescription(),l=this.getYearDescription();n+=a+s+p+c+l,n=this.transformVerbosity(n,!!this.options.verbose),n=n.charAt(0).toLocaleUpperCase()+n.substr(1)}catch(g){if(!this.options.throwExceptionOnParseError)n=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw"".concat(g)}return n},t.prototype.getTimeOfDayDescription=function(){var e=this.expressionParts[0],o=this.expressionParts[1],n=this.expressionParts[2],i="";if(!r.StringUtilities.containsAny(o,t.specialCharacters)&&!r.StringUtilities.containsAny(n,t.specialCharacters)&&!r.StringUtilities.containsAny(e,t.specialCharacters))i+=this.i18n.atSpace()+this.formatTime(n,o,e);else if(!e&&o.indexOf("-")>-1&&!(o.indexOf(",")>-1)&&!(o.indexOf("/")>-1)&&!r.StringUtilities.containsAny(n,t.specialCharacters)){var a=o.split("-");i+=r.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(n,a[0],""),this.formatTime(n,a[1],""))}else if(!e&&n.indexOf(",")>-1&&n.indexOf("-")==-1&&n.indexOf("/")==-1&&!r.StringUtilities.containsAny(o,t.specialCharacters)){var s=n.split(",");i+=this.i18n.at();for(var c=0;c<s.length;c++)i&&(i+=" "),i+=this.formatTime(s[c],o,""),c<s.length-2&&(i+=","),c==s.length-2&&(i+=this.i18n.spaceAnd())}else{var p=this.getSecondsDescription(),l=this.getMinutesDescription(),g=this.getHoursDescription();if(i+=p,i&&l&&(i+=", "),i+=l,l===g)return i;i&&g&&(i+=", "),i+=g}return i},t.prototype.getSecondsDescription=function(){var e=this,o=this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),function(n){return n},function(n){return r.StringUtilities.format(e.i18n.everyX0Seconds(n),n)},function(n){return e.i18n.secondsX0ThroughX1PastTheMinute()},function(n){return n=="0"?"":parseInt(n)<20?e.i18n.atX0SecondsPastTheMinute(n):e.i18n.atX0SecondsPastTheMinuteGt20()||e.i18n.atX0SecondsPastTheMinute(n)});return o},t.prototype.getMinutesDescription=function(){var e=this,o=this.expressionParts[0],n=this.expressionParts[2],i=this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),function(a){return a},function(a){return r.StringUtilities.format(e.i18n.everyX0Minutes(a),a)},function(a){return e.i18n.minutesX0ThroughX1PastTheHour()},function(a){var s,c;try{return a=="0"&&n.indexOf("/")==-1&&o==""?e.i18n.everyHour():a=="0"?((c=(s=e.i18n).onTheHour)===null||c===void 0?void 0:c.call(s))||e.i18n.atX0MinutesPastTheHour(a):parseInt(a)<20?e.i18n.atX0MinutesPastTheHour(a):e.i18n.atX0MinutesPastTheHourGt20()||e.i18n.atX0MinutesPastTheHour(a)}catch{return e.i18n.atX0MinutesPastTheHour(a)}});return i},t.prototype.getHoursDescription=function(){var e=this,o=this.expressionParts[2],n=0,i=[];o.split("/")[0].split(",").forEach(function(c){var p=c.split("-");p.length===2&&i.push({value:p[1],index:n+1}),n+=p.length});var a=0,s=this.getSegmentDescription(o,this.i18n.everyHour(),function(c){var p=i.find(function(g){return g.value===c&&g.index===a}),l=p&&e.expressionParts[1]!=="0";return a++,l?e.formatTime(c,"59",""):e.formatTime(c,"0","")},function(c){return r.StringUtilities.format(e.i18n.everyX0Hours(c),c)},function(c){return e.i18n.betweenX0AndX1()},function(c){return e.i18n.atX0()});return s},t.prototype.getDayOfWeekDescription=function(){var e=this,o=this.i18n.daysOfTheWeek(),n=null;return this.expressionParts[5]=="*"?n="":n=this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),function(i,a){var s=i;i.indexOf("#")>-1?s=i.substring(0,i.indexOf("#")):i.indexOf("L")>-1&&(s=s.replace("L",""));var c=parseInt(s),p=e.i18n.daysOfTheWeekInCase?e.i18n.daysOfTheWeekInCase(a)[c]:o[c];if(i.indexOf("#")>-1){var l=null,g=i.substring(i.indexOf("#")+1),h=i.substring(0,i.indexOf("#"));switch(g){case"1":l=e.i18n.first(h);break;case"2":l=e.i18n.second(h);break;case"3":l=e.i18n.third(h);break;case"4":l=e.i18n.fourth(h);break;case"5":l=e.i18n.fifth(h);break}p=l+" "+p}return p},function(i){return parseInt(i)==1?"":r.StringUtilities.format(e.i18n.commaEveryX0DaysOfTheWeek(i),i)},function(i){var a=i.substring(0,i.indexOf("-")),s=e.expressionParts[3]!="*";return s?e.i18n.commaAndX0ThroughX1(a):e.i18n.commaX0ThroughX1(a)},function(i){var a=null;if(i.indexOf("#")>-1){var s=i.substring(i.indexOf("#")+1),c=i.substring(0,i.indexOf("#"));a=e.i18n.commaOnThe(s,c).trim()+e.i18n.spaceX0OfTheMonth()}else if(i.indexOf("L")>-1)a=e.i18n.commaOnTheLastX0OfTheMonth(i.replace("L",""));else{var p=e.expressionParts[3]!="*";p?e.options.logicalAndDayFields?a=e.i18n.commaOnlyOnX0(i):a=e.i18n.commaAndOnX0():a=e.i18n.commaOnlyOnX0(i)}return a}),n},t.prototype.getMonthDescription=function(){var e=this,o=this.i18n.monthsOfTheYear(),n=this.getSegmentDescription(this.expressionParts[4],"",function(i,a){return a&&e.i18n.monthsOfTheYearInCase?e.i18n.monthsOfTheYearInCase(a)[parseInt(i)-1]:o[parseInt(i)-1]},function(i){return parseInt(i)==1?"":r.StringUtilities.format(e.i18n.commaEveryX0Months(i),i)},function(i){return e.i18n.commaMonthX0ThroughMonthX1()||e.i18n.commaX0ThroughX1()},function(i){return e.i18n.commaOnlyInMonthX0?e.i18n.commaOnlyInMonthX0():e.i18n.commaOnlyInX0()});return n},t.prototype.getDayOfMonthDescription=function(){var e=this,o=null,n=this.expressionParts[3];switch(n){case"L":o=this.i18n.commaOnTheLastDayOfTheMonth();break;case"WL":case"LW":o=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var i=n.match(/(\d{1,2}W)|(W\d{1,2})/);if(i){var a=parseInt(i[0].replace("W","")),s=a==1?this.i18n.firstWeekday():r.StringUtilities.format(this.i18n.weekdayNearestDayX0(),a.toString());o=r.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),s);break}else{var c=n.match(/L-(\d{1,2})/);if(c){var p=c[1];o=r.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(p),p);break}else{if(n=="*"&&this.expressionParts[5]!="*")return"";o=this.getSegmentDescription(n,this.i18n.commaEveryDay(),function(l){return l=="L"?e.i18n.lastDay():e.i18n.dayX0?r.StringUtilities.format(e.i18n.dayX0(),l):l},function(l){return l=="1"?e.i18n.commaEveryDay():e.i18n.commaEveryX0Days(l)},function(l){return e.i18n.commaBetweenDayX0AndX1OfTheMonth(l)},function(l){return e.i18n.commaOnDayX0OfTheMonth(l)})}break}}return o},t.prototype.getYearDescription=function(){var e=this,o=this.getSegmentDescription(this.expressionParts[6],"",function(n){return/^\d+$/.test(n)?new Date(parseInt(n),1).getFullYear().toString():n},function(n){return r.StringUtilities.format(e.i18n.commaEveryX0Years(n),n)},function(n){return e.i18n.commaYearX0ThroughYearX1()||e.i18n.commaX0ThroughX1()},function(n){return e.i18n.commaOnlyInYearX0?e.i18n.commaOnlyInYearX0():e.i18n.commaOnlyInX0()});return o},t.prototype.getSegmentDescription=function(e,o,n,i,a,s){var c=null,p=e.indexOf("/")>-1,l=e.indexOf("-")>-1,g=e.indexOf(",")>-1;if(!e)c="";else if(e==="*")c=o;else if(!p&&!l&&!g)c=r.StringUtilities.format(s(e),n(e));else if(g){for(var h=e.split(","),S="",x=this.i18n.spaceAnd(),b=0;b<h.length;b++)if(b>0&&h.length>2&&(S+=",",b<h.length-1&&(S+=" ")),b>0&&h.length>1&&(b==h.length-1||h.length==2)&&(S+=x==","&&h.length>2?" ":"".concat(x," ")),h[b].indexOf("/")>-1||h[b].indexOf("-")>-1){var k=h[b].indexOf("-")>-1&&h[b].indexOf("/")==-1,D=this.getSegmentDescription(h[b],o,n,i,k?this.i18n.commaX0ThroughX1:a,s);k&&(D=D.replace(", ","")),S+=D}else if(!p)S+=n(h[b]);else{var E=this.getSegmentDescription(h[b],o,n,i,a,s);E&&E.startsWith(", ")&&(E=E.substring(2)),S+=E}p?c=S:c=r.StringUtilities.format(s(e),S)}else if(p){var h=e.split("/");if(c=r.StringUtilities.format(i(h[1]),h[1]),h[0].indexOf("-")>-1){var A=this.generateRangeSegmentDescription(h[0],a,n);A.indexOf(", ")!=0&&(c+=", "),c+=A}else if(h[0].indexOf("*")==-1){var M=r.StringUtilities.format(s(h[0]),n(h[0]));M=M.replace(", ",""),c+=r.StringUtilities.format(this.i18n.commaStartingX0(),M)}}else l&&(c=this.generateRangeSegmentDescription(e,a,n));return c},t.prototype.generateRangeSegmentDescription=function(e,o,n){var i="",a=e.split("-"),s=n(a[0],1),c=n(a[1],2),p=o(e);return i+=r.StringUtilities.format(p,s,c),i},t.prototype.formatTime=function(e,o,n){var i=0,a=0,s=parseInt(e)+i,c=parseInt(o)+a;c>=60?(c-=60,s+=1):c<0&&(c+=60,s-=1),s>=24?s=s-24:s<0&&(s=24+s);var p="",l=!1;this.options.use24HourTimeFormat||(l=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),p=l?"".concat(this.getPeriod(s)," "):" ".concat(this.getPeriod(s)),s>12&&(s-=12),s===0&&(s=12));var g="";n&&(g=":".concat(("00"+n).substring(n.length)));var h=s.toString(),S=("00"+h).substring(h.length),x=c.toString(),b=("00"+x).substring(x.length),k=this.options.trimHoursLeadingZero?h:S;return"".concat(l?p:"").concat(k,":").concat(b).concat(g).concat(l?"":p)},t.prototype.transformVerbosity=function(e,o){if(!o&&(e=e.replace(new RegExp(", ".concat(this.i18n.everyMinute()),"g"),""),e=e.replace(new RegExp(", ".concat(this.i18n.everyHour()),"g"),""),e=e.replace(new RegExp(this.i18n.commaEveryDay(),"g"),""),e=e.replace(/\, ?$/,""),this.i18n.conciseVerbosityReplacements))for(var n=0,i=Object.entries(this.i18n.conciseVerbosityReplacements());n<i.length;n++){var a=i[n],s=a[0],c=a[1];e=e.replace(new RegExp(s,"g"),c)}return e},t.prototype.getPeriod=function(e){return e>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},t.locales={},t})();v.ExpressionDescriptor=f},747(X,v,m){Object.defineProperty(v,"__esModule",{value:!0}),v.enLocaleLoader=void 0;var r=m(486),T=(function(){function f(){}return f.prototype.load=function(t){t.en=new r.en},f})();v.enLocaleLoader=T},486(X,v){Object.defineProperty(v,"__esModule",{value:!0}),v.en=void 0;var m=(function(){function r(){}return r.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},r.prototype.atX0MinutesPastTheHourGt20=function(){return null},r.prototype.commaMonthX0ThroughMonthX1=function(){return null},r.prototype.commaYearX0ThroughYearX1=function(){return null},r.prototype.use24HourTimeFormatByDefault=function(){return!1},r.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occurred when generating the expression description. Check the cron expression syntax."},r.prototype.everyMinute=function(){return"every minute"},r.prototype.everyHour=function(){return"every hour"},r.prototype.atSpace=function(){return"At "},r.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},r.prototype.at=function(){return"At"},r.prototype.spaceAnd=function(){return" and"},r.prototype.everySecond=function(){return"every second"},r.prototype.everyX0Seconds=function(){return"every %s seconds"},r.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},r.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},r.prototype.everyX0Minutes=function(){return"every %s minutes"},r.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},r.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},r.prototype.everyX0Hours=function(){return"every %s hours"},r.prototype.betweenX0AndX1=function(){return"between %s and %s"},r.prototype.atX0=function(){return"at %s"},r.prototype.commaEveryDay=function(){return", every day"},r.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},r.prototype.commaX0ThroughX1=function(){return", %s through %s"},r.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},r.prototype.first=function(){return"first"},r.prototype.second=function(){return"second"},r.prototype.third=function(){return"third"},r.prototype.fourth=function(){return"fourth"},r.prototype.fifth=function(){return"fifth"},r.prototype.commaOnThe=function(){return", on the "},r.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},r.prototype.lastDay=function(){return"the last day"},r.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},r.prototype.commaOnlyOnX0=function(){return", only on %s"},r.prototype.commaAndOnX0=function(){return", and on %s"},r.prototype.commaEveryX0Months=function(){return", every %s months"},r.prototype.commaOnlyInX0=function(){return", only in %s"},r.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},r.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},r.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},r.prototype.firstWeekday=function(){return"first weekday"},r.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},r.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},r.prototype.commaEveryX0Days=function(){return", every %s days in a month"},r.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},r.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},r.prototype.commaEveryHour=function(){return", every hour"},r.prototype.commaEveryX0Years=function(){return", every %s years"},r.prototype.commaStartingX0=function(){return", starting %s"},r.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},r.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},r.prototype.atReboot=function(){return"Run once, at startup"},r.prototype.onTheHour=function(){return"on the hour"},r})();v.en=m},515(X,v){Object.defineProperty(v,"__esModule",{value:!0});function m(T,f){if(!T)throw new Error(f)}var r=(function(){function T(){}return T.secondRange=function(f){for(var t=f.split(","),e=0;e<t.length;e++)if(!isNaN(parseInt(t[e],10))){var o=parseInt(t[e],10);m(o>=0&&o<=59,"seconds part must be >= 0 and <= 59")}},T.minuteRange=function(f){for(var t=f.split(","),e=0;e<t.length;e++)if(!isNaN(parseInt(t[e],10))){var o=parseInt(t[e],10);m(o>=0&&o<=59,"minutes part must be >= 0 and <= 59")}},T.hourRange=function(f){for(var t=f.split(","),e=0;e<t.length;e++)if(!isNaN(parseInt(t[e],10))){var o=parseInt(t[e],10);m(o>=0&&o<=23,"hours part must be >= 0 and <= 23")}},T.dayOfMonthRange=function(f){for(var t=f.split(","),e=0;e<t.length;e++)if(!isNaN(parseInt(t[e],10))){var o=parseInt(t[e],10);m(o>=1&&o<=31,"DOM part must be >= 1 and <= 31")}},T.monthRange=function(f,t){for(var e=f.split(","),o=0;o<e.length;o++)if(!isNaN(parseInt(e[o],10))){var n=parseInt(e[o],10);m(n>=1&&n<=12,t?"month part must be >= 0 and <= 11":"month part must be >= 1 and <= 12")}},T.dayOfWeekRange=function(f,t){for(var e=f.split(","),o=0;o<e.length;o++)if(!isNaN(parseInt(e[o],10))){var n=parseInt(e[o],10);m(n>=0&&n<=6,t?"DOW part must be >= 0 and <= 6":"DOW part must be >= 1 and <= 7")}},T})();v.default=r},823(X,v){Object.defineProperty(v,"__esModule",{value:!0}),v.StringUtilities=void 0;var m=(function(){function r(){}return r.format=function(T){for(var f=[],t=1;t<arguments.length;t++)f[t-1]=arguments[t];return T.replace(/%s/g,function(e){return f.shift()})},r.containsAny=function(T,f){return f.some(function(t){return T.indexOf(t)>-1})},r})();v.StringUtilities=m}},O={};function _(X){var v=O[X];if(v!==void 0)return v.exports;var m=O[X]={exports:{}};return y[X](m,m.exports,_),m.exports}var w={};return(()=>{var X=w;Object.defineProperty(X,"__esModule",{value:!0}),X.toString=void 0;var v=_(333),m=_(747);v.ExpressionDescriptor.initialize(new m.enLocaleLoader),X.default=v.ExpressionDescriptor;var r=v.ExpressionDescriptor.toString;X.toString=r})(),w})())})(U)),U.exports}var F=W();const N=C(F);function j(u){const d=u?.execution_config?.executor;if(d&&typeof d=="object"&&"kind"in d){if(d.kind==="external")return"external";if(d.kind==="script")return"script"}return u?.device_worker_id?"device":u?.managed_agent_id?"agent":"manual"}function K(u){const d=j(u);return d==="agent"||d==="device"?u?.managed_agent_id??null:null}function Y(u){try{return N.toString(u.trim(),{throwExceptionOnParseError:!0})}catch{return`On schedule ${u.trim()}`}}function Z(u,d){return d.get(u)??u}function B(u){return R(u.replace(/^\$/,""))}function $(u,d){const y=d?.display_name?.trim();return y&&d?.external_tenant_id===u?y:`#${u}`}function V(u,d){if(!u||typeof u!="object"||Array.isArray(u))return"";const y=u;return typeof y.repository=="string"?` in ${y.repository}`:typeof y.channel_id=="string"?` in ${$(y.channel_id,d)}`:typeof y.resource_ref=="string"?` for ${y.resource_ref}`:""}function P(u){return Array.isArray(u.triggers)?u.triggers.filter(d=>!!d&&typeof d=="object"):[]}function G(u,d,y){if(u.kind==="schedule"&&typeof u.cron=="string")return Y(u.cron);if(u.kind==="event"&&u.source!=="workspace"&&typeof u.connector_key=="string"){const O=Array.isArray(u.event_types)?u.event_types.filter(X=>typeof X=="string"):[],_=O.length>0?O.join(" or "):"an event",w=typeof u.connection_id=="number"?y.get(u.connection_id):void 0;return`${Z(u.connector_key,d)} sends ${_}${V(u.match,w)}`}if(u.kind==="event"&&u.source==="workspace"){const O=Array.isArray(u.event_types)?u.event_types.filter(X=>typeof X=="string"):[],_=O.length>0?O.join(" or "):"an event",w=typeof u.entity_type=="string"?` on ${B(u.entity_type)}`:"";return`another Automation writes ${_}${w}`}return null}function z(u){return u.health==="degraded"?"error":"enabled"}function J(u,d=new Map,y=new Map){const O=P(u),_=u.name?.trim()||"Untitled automation",w=O.some(f=>f.kind==="event"),X=O.some(f=>f.kind==="schedule"),v=w?"event":X?"schedule":"manual",m=O.map(f=>G(f,d,y)).filter(f=>!!f);let r="When started manually";m.length===1?r=`When ${m[0]}`:m.length>1&&(r=`When ${m[0]}${m.slice(1).map(f=>`, or when ${f}`).join("")}`);const T=O.some(f=>f.kind==="event"&&f.output==="reply_to_source")?"source":"silent";return{key:`automation:${u.automation_id}`,kind:v,when:r,does:_,output:{destination:T},state:z(u),sortTime:u.next_run_at?Date.parse(u.next_run_at):null,automation:u}}const L={event:0,schedule:1,manual:2};function Q(u,d=new Map,y=new Map){return u.map(O=>J(O,d,y)).sort((O,_)=>O.state!==_.state?O.state==="enabled"?-1:1:L[O.kind]!==L[_.kind]?L[O.kind]-L[_.kind]:O.sortTime!==_.sortTime?O.sortTime===null?1:_.sortTime===null?-1:O.sortTime-_.sortTime:O.when.localeCompare(_.when)||O.key.localeCompare(_.key))}const ee={kind:"all",output:"any",state:"any"};function te(u,d){return u.filter(y=>(d.kind==="all"||y.kind===d.kind)&&(d.output==="any"||(d.output==="reply"?y.output.destination==="source":y.output.destination==="silent"))&&(d.state==="any"||(d.state==="active"?y.state==="enabled":y.state==="error")))}function ne(u){const d=Array.isArray(u.triggers)?u.triggers:[];for(const y of d)if(y&&typeof y=="object"&&y.kind==="event"&&y.source!=="workspace"&&typeof y.connector_key=="string")return y.connector_key;return null}export{ee as D,j as a,K as b,N as c,J as d,ne as e,te as f,Q as m};
2
- //# sourceMappingURL=model-jL871x2J.js.map
1
+ import{bs as C,fl as R}from"./index-BjcZVe7n.js";var U={exports:{}},I;function W(){return I||(I=1,(function(u,d){(function(O,_){u.exports=_()})(globalThis,()=>(()=>{var y={949(X,v,m){Object.defineProperty(v,"__esModule",{value:!0}),v.CronParser=void 0;var r=m(515),T=(function(){function f(t,e,o){e===void 0&&(e=!0),o===void 0&&(o=!1),this.expression=t,this.dayOfWeekStartIndexZero=e,this.monthStartIndexZero=o}return f.prototype.parse=function(){var t,e,o=(t=this.expression)!==null&&t!==void 0?t:"";if(o==="@reboot")return e=["@reboot","","","","","",""],e;if(o.startsWith("@")){var n=this.parseSpecial(this.expression);e=this.extractParts(n)}else e=this.extractParts(this.expression);return this.normalize(e),this.validate(e),e},f.prototype.parseSpecial=function(t){var e={"@yearly":"0 0 1 1 *","@annually":"0 0 1 1 *","@monthly":"0 0 1 * *","@weekly":"0 0 * * 0","@daily":"0 0 * * *","@midnight":"0 0 * * *","@hourly":"0 * * * *","@reboot":"@reboot"},o=e[t];if(!o)throw new Error("Unknown special expression.");return o},f.prototype.extractParts=function(t){if(!this.expression)throw new Error("cron expression is empty");for(var e=t.trim().split(/[ ]+/),o=0;o<e.length;o++)if(e[o].includes(",")){var n=e[o].split(",").map(function(a){return a.trim()}).filter(function(a){return a!==""}).map(function(a){return isNaN(Number(a))?a:Number(a)}).filter(function(a){return a!==null&&a!==""});n.length===0&&n.push("*"),n.sort(function(a,s){return a!==null&&s!==null?a-s:0}),e[o]=n.map(function(a){return a!==null?a.toString():""}).join(",")}if(e.length<5)throw new Error("Expression has only ".concat(e.length," part").concat(e.length==1?"":"s",". At least 5 parts are required."));if(e.length==5)e.unshift(""),e.push("");else if(e.length==6){var i=/\d{4}$/.test(e[5])||e[4]=="?"||e[2]=="?";i?e.unshift(""):e.push("")}else if(e.length>7)throw new Error("Expression has ".concat(e.length," parts; too many!"));return e},f.prototype.normalize=function(t){var e=this;if(t[3]=t[3].replace("?","*"),t[5]=t[5].replace("?","*"),t[2]=t[2].replace("?","*"),t[0].indexOf("0/")==0&&(t[0]=t[0].replace("0/","*/")),t[1].indexOf("0/")==0&&(t[1]=t[1].replace("0/","*/")),t[2].indexOf("0/")==0&&(t[2]=t[2].replace("0/","*/")),t[3].indexOf("1/")==0&&(t[3]=t[3].replace("1/","*/")),t[4].indexOf("1/")==0&&(t[4]=t[4].replace("1/","*/")),t[6].indexOf("1/")==0&&(t[6]=t[6].replace("1/","*/")),t[5]=t[5].replace(/(^\d)|([^#/\s]\d)/g,function(l){var g=l.replace(/\D/,""),h=g;return e.dayOfWeekStartIndexZero?g=="7"&&(h="0"):h=(parseInt(g)-1).toString(),l.replace(g,h)}),t[5]=="L"&&(t[5]="6"),t[3]=="?"&&(t[3]="*"),t[3].indexOf("W")>-1&&(t[3].indexOf(",")>-1||t[3].indexOf("-")>-1))throw new Error("The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.");var o={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var n in o)t[5]=t[5].replace(new RegExp(n,"gi"),o[n].toString());t[4]=t[4].replace(/(^\d{1,2})|([^#/\s]\d{1,2})/g,function(l){var g=l.replace(/\D/,""),h=g;return e.monthStartIndexZero&&(h=(parseInt(g)+1).toString()),l.replace(g,h)});var i={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};for(var a in i)t[4]=t[4].replace(new RegExp(a,"gi"),i[a].toString());t[0]=="0"&&(t[0]=""),!/\*|\-|\,|\//.test(t[2])&&(/\*|\//.test(t[1])||/\*|\//.test(t[0]))&&(t[2]+="-".concat(t[2]));for(var s=0;s<t.length;s++)if(t[s].indexOf(",")!=-1&&(t[s]=t[s].split(",").filter(function(l){return l!==""}).join(",")||"*"),t[s]=="*/1"&&(t[s]="*"),t[s].indexOf("/")>-1&&!/^\*|\-|\,/.test(t[s])){var c=null;switch(s){case 4:c="12";break;case 5:c="6";break;case 6:c="9999";break;default:c=null;break}if(c!==null){var p=t[s].split("/");t[s]="".concat(p[0],"-").concat(c,"/").concat(p[1])}}},f.prototype.validate=function(t){var e="0-9,\\-*/";this.validateOnlyExpectedCharactersFound(t[0],e),this.validateOnlyExpectedCharactersFound(t[1],e),this.validateOnlyExpectedCharactersFound(t[2],e),this.validateOnlyExpectedCharactersFound(t[3],"0-9,\\-*/LW"),this.validateOnlyExpectedCharactersFound(t[4],e),this.validateOnlyExpectedCharactersFound(t[5],"0-9,\\-*/L#"),this.validateOnlyExpectedCharactersFound(t[6],e),this.validateAnyRanges(t)},f.prototype.validateAnyRanges=function(t){r.default.secondRange(t[0]),r.default.minuteRange(t[1]),r.default.hourRange(t[2]),r.default.dayOfMonthRange(t[3]),r.default.monthRange(t[4],this.monthStartIndexZero),r.default.dayOfWeekRange(t[5],this.dayOfWeekStartIndexZero)},f.prototype.validateOnlyExpectedCharactersFound=function(t,e){var o=t.match(new RegExp("[^".concat(e,"]+"),"gi"));if(o&&o.length)throw new Error("Expression contains invalid values: '".concat(o.toString(),"'"))},f})();v.CronParser=T},333(X,v,m){Object.defineProperty(v,"__esModule",{value:!0}),v.ExpressionDescriptor=void 0;var r=m(823),T=m(949),f=(function(){function t(e,o){if(this.expression=e,this.options=o,this.expressionParts=new Array(5),!this.options.locale&&t.defaultLocale&&(this.options.locale=t.defaultLocale),!t.locales[this.options.locale]){var n=Object.keys(t.locales)[0];console.warn("Locale '".concat(this.options.locale,"' could not be found; falling back to '").concat(n,"'.")),this.options.locale=n}this.i18n=t.locales[this.options.locale],o.use24HourTimeFormat===void 0&&(o.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return t.toString=function(e,o){var n=o===void 0?{}:o,i=n.throwExceptionOnParseError,a=i===void 0?!0:i,s=n.verbose,c=s===void 0?!1:s,p=n.dayOfWeekStartIndexZero,l=p===void 0?!0:p,g=n.monthStartIndexZero,h=g===void 0?!1:g,S=n.use24HourTimeFormat,x=n.trimHoursLeadingZero,b=x===void 0?!1:x,k=n.locale,D=k===void 0?null:k,E=n.logicalAndDayFields,A=E===void 0?!1:E,M={throwExceptionOnParseError:a,verbose:c,dayOfWeekStartIndexZero:l,monthStartIndexZero:h,use24HourTimeFormat:S,trimHoursLeadingZero:b,locale:D,logicalAndDayFields:A};M.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported.");var H=new t(e,M);return H.getFullDescription()},t.initialize=function(e,o){o===void 0&&(o="en"),t.specialCharacters=["/","-",",","*"],t.defaultLocale=o,e.load(t.locales)},t.prototype.getFullDescription=function(){var e,o,n="";try{var i=new T.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);if(this.expressionParts=i.parse(),this.expressionParts[0]==="@reboot")return((o=(e=this.i18n).atReboot)===null||o===void 0?void 0:o.call(e))||"Run once, at startup";var a=this.getTimeOfDayDescription(),s=this.getDayOfMonthDescription(),c=this.getMonthDescription(),p=this.getDayOfWeekDescription(),l=this.getYearDescription();n+=a+s+p+c+l,n=this.transformVerbosity(n,!!this.options.verbose),n=n.charAt(0).toLocaleUpperCase()+n.substr(1)}catch(g){if(!this.options.throwExceptionOnParseError)n=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw"".concat(g)}return n},t.prototype.getTimeOfDayDescription=function(){var e=this.expressionParts[0],o=this.expressionParts[1],n=this.expressionParts[2],i="";if(!r.StringUtilities.containsAny(o,t.specialCharacters)&&!r.StringUtilities.containsAny(n,t.specialCharacters)&&!r.StringUtilities.containsAny(e,t.specialCharacters))i+=this.i18n.atSpace()+this.formatTime(n,o,e);else if(!e&&o.indexOf("-")>-1&&!(o.indexOf(",")>-1)&&!(o.indexOf("/")>-1)&&!r.StringUtilities.containsAny(n,t.specialCharacters)){var a=o.split("-");i+=r.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(n,a[0],""),this.formatTime(n,a[1],""))}else if(!e&&n.indexOf(",")>-1&&n.indexOf("-")==-1&&n.indexOf("/")==-1&&!r.StringUtilities.containsAny(o,t.specialCharacters)){var s=n.split(",");i+=this.i18n.at();for(var c=0;c<s.length;c++)i&&(i+=" "),i+=this.formatTime(s[c],o,""),c<s.length-2&&(i+=","),c==s.length-2&&(i+=this.i18n.spaceAnd())}else{var p=this.getSecondsDescription(),l=this.getMinutesDescription(),g=this.getHoursDescription();if(i+=p,i&&l&&(i+=", "),i+=l,l===g)return i;i&&g&&(i+=", "),i+=g}return i},t.prototype.getSecondsDescription=function(){var e=this,o=this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),function(n){return n},function(n){return r.StringUtilities.format(e.i18n.everyX0Seconds(n),n)},function(n){return e.i18n.secondsX0ThroughX1PastTheMinute()},function(n){return n=="0"?"":parseInt(n)<20?e.i18n.atX0SecondsPastTheMinute(n):e.i18n.atX0SecondsPastTheMinuteGt20()||e.i18n.atX0SecondsPastTheMinute(n)});return o},t.prototype.getMinutesDescription=function(){var e=this,o=this.expressionParts[0],n=this.expressionParts[2],i=this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),function(a){return a},function(a){return r.StringUtilities.format(e.i18n.everyX0Minutes(a),a)},function(a){return e.i18n.minutesX0ThroughX1PastTheHour()},function(a){var s,c;try{return a=="0"&&n.indexOf("/")==-1&&o==""?e.i18n.everyHour():a=="0"?((c=(s=e.i18n).onTheHour)===null||c===void 0?void 0:c.call(s))||e.i18n.atX0MinutesPastTheHour(a):parseInt(a)<20?e.i18n.atX0MinutesPastTheHour(a):e.i18n.atX0MinutesPastTheHourGt20()||e.i18n.atX0MinutesPastTheHour(a)}catch{return e.i18n.atX0MinutesPastTheHour(a)}});return i},t.prototype.getHoursDescription=function(){var e=this,o=this.expressionParts[2],n=0,i=[];o.split("/")[0].split(",").forEach(function(c){var p=c.split("-");p.length===2&&i.push({value:p[1],index:n+1}),n+=p.length});var a=0,s=this.getSegmentDescription(o,this.i18n.everyHour(),function(c){var p=i.find(function(g){return g.value===c&&g.index===a}),l=p&&e.expressionParts[1]!=="0";return a++,l?e.formatTime(c,"59",""):e.formatTime(c,"0","")},function(c){return r.StringUtilities.format(e.i18n.everyX0Hours(c),c)},function(c){return e.i18n.betweenX0AndX1()},function(c){return e.i18n.atX0()});return s},t.prototype.getDayOfWeekDescription=function(){var e=this,o=this.i18n.daysOfTheWeek(),n=null;return this.expressionParts[5]=="*"?n="":n=this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),function(i,a){var s=i;i.indexOf("#")>-1?s=i.substring(0,i.indexOf("#")):i.indexOf("L")>-1&&(s=s.replace("L",""));var c=parseInt(s),p=e.i18n.daysOfTheWeekInCase?e.i18n.daysOfTheWeekInCase(a)[c]:o[c];if(i.indexOf("#")>-1){var l=null,g=i.substring(i.indexOf("#")+1),h=i.substring(0,i.indexOf("#"));switch(g){case"1":l=e.i18n.first(h);break;case"2":l=e.i18n.second(h);break;case"3":l=e.i18n.third(h);break;case"4":l=e.i18n.fourth(h);break;case"5":l=e.i18n.fifth(h);break}p=l+" "+p}return p},function(i){return parseInt(i)==1?"":r.StringUtilities.format(e.i18n.commaEveryX0DaysOfTheWeek(i),i)},function(i){var a=i.substring(0,i.indexOf("-")),s=e.expressionParts[3]!="*";return s?e.i18n.commaAndX0ThroughX1(a):e.i18n.commaX0ThroughX1(a)},function(i){var a=null;if(i.indexOf("#")>-1){var s=i.substring(i.indexOf("#")+1),c=i.substring(0,i.indexOf("#"));a=e.i18n.commaOnThe(s,c).trim()+e.i18n.spaceX0OfTheMonth()}else if(i.indexOf("L")>-1)a=e.i18n.commaOnTheLastX0OfTheMonth(i.replace("L",""));else{var p=e.expressionParts[3]!="*";p?e.options.logicalAndDayFields?a=e.i18n.commaOnlyOnX0(i):a=e.i18n.commaAndOnX0():a=e.i18n.commaOnlyOnX0(i)}return a}),n},t.prototype.getMonthDescription=function(){var e=this,o=this.i18n.monthsOfTheYear(),n=this.getSegmentDescription(this.expressionParts[4],"",function(i,a){return a&&e.i18n.monthsOfTheYearInCase?e.i18n.monthsOfTheYearInCase(a)[parseInt(i)-1]:o[parseInt(i)-1]},function(i){return parseInt(i)==1?"":r.StringUtilities.format(e.i18n.commaEveryX0Months(i),i)},function(i){return e.i18n.commaMonthX0ThroughMonthX1()||e.i18n.commaX0ThroughX1()},function(i){return e.i18n.commaOnlyInMonthX0?e.i18n.commaOnlyInMonthX0():e.i18n.commaOnlyInX0()});return n},t.prototype.getDayOfMonthDescription=function(){var e=this,o=null,n=this.expressionParts[3];switch(n){case"L":o=this.i18n.commaOnTheLastDayOfTheMonth();break;case"WL":case"LW":o=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var i=n.match(/(\d{1,2}W)|(W\d{1,2})/);if(i){var a=parseInt(i[0].replace("W","")),s=a==1?this.i18n.firstWeekday():r.StringUtilities.format(this.i18n.weekdayNearestDayX0(),a.toString());o=r.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),s);break}else{var c=n.match(/L-(\d{1,2})/);if(c){var p=c[1];o=r.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(p),p);break}else{if(n=="*"&&this.expressionParts[5]!="*")return"";o=this.getSegmentDescription(n,this.i18n.commaEveryDay(),function(l){return l=="L"?e.i18n.lastDay():e.i18n.dayX0?r.StringUtilities.format(e.i18n.dayX0(),l):l},function(l){return l=="1"?e.i18n.commaEveryDay():e.i18n.commaEveryX0Days(l)},function(l){return e.i18n.commaBetweenDayX0AndX1OfTheMonth(l)},function(l){return e.i18n.commaOnDayX0OfTheMonth(l)})}break}}return o},t.prototype.getYearDescription=function(){var e=this,o=this.getSegmentDescription(this.expressionParts[6],"",function(n){return/^\d+$/.test(n)?new Date(parseInt(n),1).getFullYear().toString():n},function(n){return r.StringUtilities.format(e.i18n.commaEveryX0Years(n),n)},function(n){return e.i18n.commaYearX0ThroughYearX1()||e.i18n.commaX0ThroughX1()},function(n){return e.i18n.commaOnlyInYearX0?e.i18n.commaOnlyInYearX0():e.i18n.commaOnlyInX0()});return o},t.prototype.getSegmentDescription=function(e,o,n,i,a,s){var c=null,p=e.indexOf("/")>-1,l=e.indexOf("-")>-1,g=e.indexOf(",")>-1;if(!e)c="";else if(e==="*")c=o;else if(!p&&!l&&!g)c=r.StringUtilities.format(s(e),n(e));else if(g){for(var h=e.split(","),S="",x=this.i18n.spaceAnd(),b=0;b<h.length;b++)if(b>0&&h.length>2&&(S+=",",b<h.length-1&&(S+=" ")),b>0&&h.length>1&&(b==h.length-1||h.length==2)&&(S+=x==","&&h.length>2?" ":"".concat(x," ")),h[b].indexOf("/")>-1||h[b].indexOf("-")>-1){var k=h[b].indexOf("-")>-1&&h[b].indexOf("/")==-1,D=this.getSegmentDescription(h[b],o,n,i,k?this.i18n.commaX0ThroughX1:a,s);k&&(D=D.replace(", ","")),S+=D}else if(!p)S+=n(h[b]);else{var E=this.getSegmentDescription(h[b],o,n,i,a,s);E&&E.startsWith(", ")&&(E=E.substring(2)),S+=E}p?c=S:c=r.StringUtilities.format(s(e),S)}else if(p){var h=e.split("/");if(c=r.StringUtilities.format(i(h[1]),h[1]),h[0].indexOf("-")>-1){var A=this.generateRangeSegmentDescription(h[0],a,n);A.indexOf(", ")!=0&&(c+=", "),c+=A}else if(h[0].indexOf("*")==-1){var M=r.StringUtilities.format(s(h[0]),n(h[0]));M=M.replace(", ",""),c+=r.StringUtilities.format(this.i18n.commaStartingX0(),M)}}else l&&(c=this.generateRangeSegmentDescription(e,a,n));return c},t.prototype.generateRangeSegmentDescription=function(e,o,n){var i="",a=e.split("-"),s=n(a[0],1),c=n(a[1],2),p=o(e);return i+=r.StringUtilities.format(p,s,c),i},t.prototype.formatTime=function(e,o,n){var i=0,a=0,s=parseInt(e)+i,c=parseInt(o)+a;c>=60?(c-=60,s+=1):c<0&&(c+=60,s-=1),s>=24?s=s-24:s<0&&(s=24+s);var p="",l=!1;this.options.use24HourTimeFormat||(l=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),p=l?"".concat(this.getPeriod(s)," "):" ".concat(this.getPeriod(s)),s>12&&(s-=12),s===0&&(s=12));var g="";n&&(g=":".concat(("00"+n).substring(n.length)));var h=s.toString(),S=("00"+h).substring(h.length),x=c.toString(),b=("00"+x).substring(x.length),k=this.options.trimHoursLeadingZero?h:S;return"".concat(l?p:"").concat(k,":").concat(b).concat(g).concat(l?"":p)},t.prototype.transformVerbosity=function(e,o){if(!o&&(e=e.replace(new RegExp(", ".concat(this.i18n.everyMinute()),"g"),""),e=e.replace(new RegExp(", ".concat(this.i18n.everyHour()),"g"),""),e=e.replace(new RegExp(this.i18n.commaEveryDay(),"g"),""),e=e.replace(/\, ?$/,""),this.i18n.conciseVerbosityReplacements))for(var n=0,i=Object.entries(this.i18n.conciseVerbosityReplacements());n<i.length;n++){var a=i[n],s=a[0],c=a[1];e=e.replace(new RegExp(s,"g"),c)}return e},t.prototype.getPeriod=function(e){return e>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},t.locales={},t})();v.ExpressionDescriptor=f},747(X,v,m){Object.defineProperty(v,"__esModule",{value:!0}),v.enLocaleLoader=void 0;var r=m(486),T=(function(){function f(){}return f.prototype.load=function(t){t.en=new r.en},f})();v.enLocaleLoader=T},486(X,v){Object.defineProperty(v,"__esModule",{value:!0}),v.en=void 0;var m=(function(){function r(){}return r.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},r.prototype.atX0MinutesPastTheHourGt20=function(){return null},r.prototype.commaMonthX0ThroughMonthX1=function(){return null},r.prototype.commaYearX0ThroughYearX1=function(){return null},r.prototype.use24HourTimeFormatByDefault=function(){return!1},r.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occurred when generating the expression description. Check the cron expression syntax."},r.prototype.everyMinute=function(){return"every minute"},r.prototype.everyHour=function(){return"every hour"},r.prototype.atSpace=function(){return"At "},r.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},r.prototype.at=function(){return"At"},r.prototype.spaceAnd=function(){return" and"},r.prototype.everySecond=function(){return"every second"},r.prototype.everyX0Seconds=function(){return"every %s seconds"},r.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},r.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},r.prototype.everyX0Minutes=function(){return"every %s minutes"},r.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},r.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},r.prototype.everyX0Hours=function(){return"every %s hours"},r.prototype.betweenX0AndX1=function(){return"between %s and %s"},r.prototype.atX0=function(){return"at %s"},r.prototype.commaEveryDay=function(){return", every day"},r.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},r.prototype.commaX0ThroughX1=function(){return", %s through %s"},r.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},r.prototype.first=function(){return"first"},r.prototype.second=function(){return"second"},r.prototype.third=function(){return"third"},r.prototype.fourth=function(){return"fourth"},r.prototype.fifth=function(){return"fifth"},r.prototype.commaOnThe=function(){return", on the "},r.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},r.prototype.lastDay=function(){return"the last day"},r.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},r.prototype.commaOnlyOnX0=function(){return", only on %s"},r.prototype.commaAndOnX0=function(){return", and on %s"},r.prototype.commaEveryX0Months=function(){return", every %s months"},r.prototype.commaOnlyInX0=function(){return", only in %s"},r.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},r.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},r.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},r.prototype.firstWeekday=function(){return"first weekday"},r.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},r.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},r.prototype.commaEveryX0Days=function(){return", every %s days in a month"},r.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},r.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},r.prototype.commaEveryHour=function(){return", every hour"},r.prototype.commaEveryX0Years=function(){return", every %s years"},r.prototype.commaStartingX0=function(){return", starting %s"},r.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},r.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},r.prototype.atReboot=function(){return"Run once, at startup"},r.prototype.onTheHour=function(){return"on the hour"},r})();v.en=m},515(X,v){Object.defineProperty(v,"__esModule",{value:!0});function m(T,f){if(!T)throw new Error(f)}var r=(function(){function T(){}return T.secondRange=function(f){for(var t=f.split(","),e=0;e<t.length;e++)if(!isNaN(parseInt(t[e],10))){var o=parseInt(t[e],10);m(o>=0&&o<=59,"seconds part must be >= 0 and <= 59")}},T.minuteRange=function(f){for(var t=f.split(","),e=0;e<t.length;e++)if(!isNaN(parseInt(t[e],10))){var o=parseInt(t[e],10);m(o>=0&&o<=59,"minutes part must be >= 0 and <= 59")}},T.hourRange=function(f){for(var t=f.split(","),e=0;e<t.length;e++)if(!isNaN(parseInt(t[e],10))){var o=parseInt(t[e],10);m(o>=0&&o<=23,"hours part must be >= 0 and <= 23")}},T.dayOfMonthRange=function(f){for(var t=f.split(","),e=0;e<t.length;e++)if(!isNaN(parseInt(t[e],10))){var o=parseInt(t[e],10);m(o>=1&&o<=31,"DOM part must be >= 1 and <= 31")}},T.monthRange=function(f,t){for(var e=f.split(","),o=0;o<e.length;o++)if(!isNaN(parseInt(e[o],10))){var n=parseInt(e[o],10);m(n>=1&&n<=12,t?"month part must be >= 0 and <= 11":"month part must be >= 1 and <= 12")}},T.dayOfWeekRange=function(f,t){for(var e=f.split(","),o=0;o<e.length;o++)if(!isNaN(parseInt(e[o],10))){var n=parseInt(e[o],10);m(n>=0&&n<=6,t?"DOW part must be >= 0 and <= 6":"DOW part must be >= 1 and <= 7")}},T})();v.default=r},823(X,v){Object.defineProperty(v,"__esModule",{value:!0}),v.StringUtilities=void 0;var m=(function(){function r(){}return r.format=function(T){for(var f=[],t=1;t<arguments.length;t++)f[t-1]=arguments[t];return T.replace(/%s/g,function(e){return f.shift()})},r.containsAny=function(T,f){return f.some(function(t){return T.indexOf(t)>-1})},r})();v.StringUtilities=m}},O={};function _(X){var v=O[X];if(v!==void 0)return v.exports;var m=O[X]={exports:{}};return y[X](m,m.exports,_),m.exports}var w={};return(()=>{var X=w;Object.defineProperty(X,"__esModule",{value:!0}),X.toString=void 0;var v=_(333),m=_(747);v.ExpressionDescriptor.initialize(new m.enLocaleLoader),X.default=v.ExpressionDescriptor;var r=v.ExpressionDescriptor.toString;X.toString=r})(),w})())})(U)),U.exports}var F=W();const N=C(F);function j(u){const d=u?.execution_config?.executor;if(d&&typeof d=="object"&&"kind"in d){if(d.kind==="external")return"external";if(d.kind==="script")return"script"}return u?.device_worker_id?"device":u?.managed_agent_id?"agent":"manual"}function K(u){const d=j(u);return d==="agent"||d==="device"?u?.managed_agent_id??null:null}function Y(u){try{return N.toString(u.trim(),{throwExceptionOnParseError:!0})}catch{return`On schedule ${u.trim()}`}}function Z(u,d){return d.get(u)??u}function B(u){return R(u.replace(/^\$/,""))}function $(u,d){const y=d?.display_name?.trim();return y&&d?.external_tenant_id===u?y:`#${u}`}function V(u,d){if(!u||typeof u!="object"||Array.isArray(u))return"";const y=u;return typeof y.repository=="string"?` in ${y.repository}`:typeof y.channel_id=="string"?` in ${$(y.channel_id,d)}`:typeof y.resource_ref=="string"?` for ${y.resource_ref}`:""}function P(u){return Array.isArray(u.triggers)?u.triggers.filter(d=>!!d&&typeof d=="object"):[]}function G(u,d,y){if(u.kind==="schedule"&&typeof u.cron=="string")return Y(u.cron);if(u.kind==="event"&&u.source!=="workspace"&&typeof u.connector_key=="string"){const O=Array.isArray(u.event_types)?u.event_types.filter(X=>typeof X=="string"):[],_=O.length>0?O.join(" or "):"an event",w=typeof u.connection_id=="number"?y.get(u.connection_id):void 0;return`${Z(u.connector_key,d)} sends ${_}${V(u.match,w)}`}if(u.kind==="event"&&u.source==="workspace"){const O=Array.isArray(u.event_types)?u.event_types.filter(X=>typeof X=="string"):[],_=O.length>0?O.join(" or "):"an event",w=typeof u.entity_type=="string"?` on ${B(u.entity_type)}`:"";return`another Automation writes ${_}${w}`}return null}function z(u){return u.health==="degraded"?"error":"enabled"}function J(u,d=new Map,y=new Map){const O=P(u),_=u.name?.trim()||"Untitled automation",w=O.some(f=>f.kind==="event"),X=O.some(f=>f.kind==="schedule"),v=w?"event":X?"schedule":"manual",m=O.map(f=>G(f,d,y)).filter(f=>!!f);let r="When started manually";m.length===1?r=`When ${m[0]}`:m.length>1&&(r=`When ${m[0]}${m.slice(1).map(f=>`, or when ${f}`).join("")}`);const T=O.some(f=>f.kind==="event"&&f.output==="reply_to_source")?"source":"silent";return{key:`automation:${u.automation_id}`,kind:v,when:r,does:_,output:{destination:T},state:z(u),sortTime:u.next_run_at?Date.parse(u.next_run_at):null,automation:u}}const L={event:0,schedule:1,manual:2};function Q(u,d=new Map,y=new Map){return u.map(O=>J(O,d,y)).sort((O,_)=>O.state!==_.state?O.state==="enabled"?-1:1:L[O.kind]!==L[_.kind]?L[O.kind]-L[_.kind]:O.sortTime!==_.sortTime?O.sortTime===null?1:_.sortTime===null?-1:O.sortTime-_.sortTime:O.when.localeCompare(_.when)||O.key.localeCompare(_.key))}const ee={kind:"all",output:"any",state:"any"};function te(u,d){return u.filter(y=>(d.kind==="all"||y.kind===d.kind)&&(d.output==="any"||(d.output==="reply"?y.output.destination==="source":y.output.destination==="silent"))&&(d.state==="any"||(d.state==="active"?y.state==="enabled":y.state==="error")))}function ne(u){const d=Array.isArray(u.triggers)?u.triggers:[];for(const y of d)if(y&&typeof y=="object"&&y.kind==="event"&&y.source!=="workspace"&&typeof y.connector_key=="string")return y.connector_key;return null}export{ee as D,j as a,K as b,N as c,J as d,ne as e,te as f,Q as m};
2
+ //# sourceMappingURL=model-C2q7WDcS.js.map
@@ -1,2 +1,2 @@
1
- import{aD as g,aE as N,j as s,fa as y,cU as m,Y as p,i as f,B as w,fc as b}from"./index-DdBTTN3y.js";function D(o,r){const l=new Map(r.map(e=>[e.slug,e])),i=new Map,d=e=>{const a=e.model?.trim();if(!a)return;const t=`${e.slug}/${a}`;i.has(t)||i.set(t,{value:t,provider:e.provider,model:a,isDefault:e.isDefault})};for(const e of o){const a=l.get(e.kind)??l.get(e.slug),t={slug:e.slug,provider:e.displayName||e.slug,isDefault:e.isDefault};d({...t,model:e.capabilities.text?.model}),d({...t,model:a?.defaultModel});for(const x of a?.models??[])d({...t,model:x})}for(const e of r){if(!e.systemAvailable)continue;const a={slug:e.slug,provider:e.displayName||e.slug,isDefault:!1};d({...a,model:e.defaultModel});for(const t of e.models)d({...a,model:t})}return[...i.values()]}function M(o,r){const l=o.trim();return l.length>0&&l!=="auto"&&!r.some(i=>i.value===l)}function S({value:o,onChange:r,placeholder:l,disabled:i,className:d}){const{data:e=[]}=g(),{data:a=[]}=N(),t=D(e,a),x=t.find(c=>c.value===o),h=o==="auto"?"auto":x?.value??o;return s.jsx(y,{contentClassName:"w-[--radix-popover-trigger-width] min-w-[280px]",searchPlaceholder:"Search or type a model ref…",emptyText:"Type a full provider/model ref to use it.",trigger:c=>s.jsxs(w,{type:"button",variant:"outline",role:"combobox","aria-expanded":c,disabled:i,className:f("w-full justify-between font-normal",o?"":"text-muted-foreground",d),children:[s.jsx("span",{className:"truncate",children:o?h:l}),s.jsx(b,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]}),children:(c,j)=>{const u=j.trim(),v=M(u,t);return s.jsxs(s.Fragment,{children:[s.jsxs(m,{value:"__inherit__ use default inherit",onSelect:()=>{r(""),c()},className:"cursor-pointer",children:[s.jsx(p,{className:f("mr-2 h-4 w-4",o===""?"opacity-100":"opacity-0")}),s.jsx("span",{className:"text-muted-foreground",children:l})]}),s.jsxs(m,{value:"auto newest latest",onSelect:()=>{r("auto"),c()},className:"cursor-pointer",children:[s.jsx(p,{className:f("mr-2 h-4 w-4",o==="auto"?"opacity-100":"opacity-0")}),s.jsxs("span",{children:["auto"," ",s.jsx("span",{className:"text-muted-foreground text-xs",children:"(newest for the provider)"})]})]}),t.map(n=>s.jsxs(m,{value:`${n.provider} ${n.model} ${n.value}`,onSelect:()=>{r(n.value),c()},className:"cursor-pointer",children:[s.jsx(p,{className:f("mr-2 h-4 w-4",o===n.value?"opacity-100":"opacity-0")}),s.jsxs("span",{className:"truncate",children:[n.provider," ",s.jsx("span",{className:"text-muted-foreground text-xs",children:n.model}),n.isDefault?s.jsx("span",{className:"ml-1.5 text-muted-foreground text-xs",children:"· org default"}):null]})]},n.value)),v?s.jsxs(m,{value:`__custom__ ${u}`,onSelect:()=>{r(u),c()},className:"cursor-pointer",children:[s.jsx(p,{className:"mr-2 h-4 w-4 opacity-0"}),s.jsxs("span",{children:["Use ",s.jsx("span",{className:"font-mono text-xs",children:u})]})]}):null]})}})}export{S as M,D as b,M as s};
2
- //# sourceMappingURL=model-selector-CgU8SJMF.js.map
1
+ import{aD as v,aE as N,j as s,gu as y,cU as m,Y as p,i as f,B as w,gw as b}from"./index-BjcZVe7n.js";function D(o,r){const l=new Map(r.map(e=>[e.slug,e])),i=new Map,d=e=>{const a=e.model?.trim();if(!a)return;const t=`${e.slug}/${a}`;i.has(t)||i.set(t,{value:t,provider:e.provider,model:a,isDefault:e.isDefault})};for(const e of o){const a=l.get(e.kind)??l.get(e.slug),t={slug:e.slug,provider:e.displayName||e.slug,isDefault:e.isDefault};d({...t,model:e.capabilities.text?.model}),d({...t,model:a?.defaultModel});for(const x of a?.models??[])d({...t,model:x})}for(const e of r){if(!e.systemAvailable)continue;const a={slug:e.slug,provider:e.displayName||e.slug,isDefault:!1};d({...a,model:e.defaultModel});for(const t of e.models)d({...a,model:t})}return[...i.values()]}function M(o,r){const l=o.trim();return l.length>0&&l!=="auto"&&!r.some(i=>i.value===l)}function S({value:o,onChange:r,placeholder:l,disabled:i,className:d}){const{data:e=[]}=v(),{data:a=[]}=N(),t=D(e,a),x=t.find(c=>c.value===o),h=o==="auto"?"auto":x?.value??o;return s.jsx(y,{contentClassName:"w-[--radix-popover-trigger-width] min-w-[280px]",searchPlaceholder:"Search or type a model ref…",emptyText:"Type a full provider/model ref to use it.",trigger:c=>s.jsxs(w,{type:"button",variant:"outline",role:"combobox","aria-expanded":c,disabled:i,className:f("w-full justify-between font-normal",o?"":"text-muted-foreground",d),children:[s.jsx("span",{className:"truncate",children:o?h:l}),s.jsx(b,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]}),children:(c,j)=>{const u=j.trim(),g=M(u,t);return s.jsxs(s.Fragment,{children:[s.jsxs(m,{value:"__inherit__ use default inherit",onSelect:()=>{r(""),c()},className:"cursor-pointer",children:[s.jsx(p,{className:f("mr-2 h-4 w-4",o===""?"opacity-100":"opacity-0")}),s.jsx("span",{className:"text-muted-foreground",children:l})]}),s.jsxs(m,{value:"auto newest latest",onSelect:()=>{r("auto"),c()},className:"cursor-pointer",children:[s.jsx(p,{className:f("mr-2 h-4 w-4",o==="auto"?"opacity-100":"opacity-0")}),s.jsxs("span",{children:["auto"," ",s.jsx("span",{className:"text-muted-foreground text-xs",children:"(newest for the provider)"})]})]}),t.map(n=>s.jsxs(m,{value:`${n.provider} ${n.model} ${n.value}`,onSelect:()=>{r(n.value),c()},className:"cursor-pointer",children:[s.jsx(p,{className:f("mr-2 h-4 w-4",o===n.value?"opacity-100":"opacity-0")}),s.jsxs("span",{className:"truncate",children:[n.provider," ",s.jsx("span",{className:"text-muted-foreground text-xs",children:n.model}),n.isDefault?s.jsx("span",{className:"ml-1.5 text-muted-foreground text-xs",children:"· org default"}):null]})]},n.value)),g?s.jsxs(m,{value:`__custom__ ${u}`,onSelect:()=>{r(u),c()},className:"cursor-pointer",children:[s.jsx(p,{className:"mr-2 h-4 w-4 opacity-0"}),s.jsxs("span",{children:["Use ",s.jsx("span",{className:"font-mono text-xs",children:u})]})]}):null]})}})}export{S as M,D as b,M as s};
2
+ //# sourceMappingURL=model-selector-B2cjCn0V.js.map
@@ -0,0 +1,2 @@
1
+ import{j4 as r,j as m}from"./index-BjcZVe7n.js";import{a as i}from"./agents-workbench-CDpJmUVN.js";import"./agent-editor-form-BXQBFHSv.js";import"./definition-comparison-B5WgZILB.js";import"./automation-source-list-Dhucq1sI.js";import"./schema-value-BFb7jCBo.js";import"./json-diff-DtZtra_g.js";import"./index-Vcq4gwWv.js";import"./model-selector-B2cjCn0V.js";import"./proposal-review-shell-BED-DO9C.js";import"./runs-BntGAKQG.js";import"./nav-pill-Bam6s3jj.js";function R(){const{owner:o,agentId:t}=r.useParams();return m.jsx(i,{owner:o,agentId:t,tab:"models"})}export{R as component};
2
+ //# sourceMappingURL=models-CZkH5gtj.js.map
@@ -1,2 +1,2 @@
1
- import{i as o}from"./index-DdBTTN3y.js";function i(e,n){return o("inline-flex items-center justify-center rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",n,e?"bg-secondary text-secondary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground")}export{i as n};
2
- //# sourceMappingURL=nav-pill-DrFkuyUQ.js.map
1
+ import{i as o}from"./index-BjcZVe7n.js";function i(e,n){return o("inline-flex items-center justify-center rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",n,e?"bg-secondary text-secondary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground")}export{i as n};
2
+ //# sourceMappingURL=nav-pill-Bam6s3jj.js.map
@@ -0,0 +1,2 @@
1
+ import{hC as o,c as p,a6 as x,q as b,at as h,bb as w,j as a,ak as f,al as j,gS as A,b3 as L,gT as C,L as S,gU as N,f5 as k,b2 as y,c5 as E}from"./index-BjcZVe7n.js";import{A as O}from"./agent-editor-form-BXQBFHSv.js";import"./definition-comparison-B5WgZILB.js";import"./automation-source-list-Dhucq1sI.js";import"./schema-value-BFb7jCBo.js";import"./json-diff-DtZtra_g.js";import"./index-Vcq4gwWv.js";import"./model-selector-B2cjCn0V.js";function M(){const{owner:e}=o.useParams(),t=o.useSearch(),r=p(),i=x(),{isAuthenticated:c}=b(),{isMember:g,isLoading:m}=h(),n=c&&g,{data:u=[],isLoading:d}=w({enabled:n});return a.jsx(f,{className:"gap-3 pt-2.5 pb-8",children:a.jsxs(j,{className:"flex flex-1 flex-col gap-6",children:[a.jsx(A,{breadcrumb:a.jsx(C,{crumbs:[a.jsx(S,{to:"/$owner/agents",params:{owner:e},className:N,children:"Agents"},"agents")]}),icon:a.jsx(L.agents.icon,{className:"h-6 w-6"}),title:"Build a managed agent",caption:"Create an agent that Lobu runs and manages for this workspace."}),m||n&&d?a.jsx(k,{rows:1}):n?a.jsx(O,{mode:{kind:"create"},existingAgentIds:u.map(s=>s.agentId),onCreated:async s=>{const l=["agents",e];if(await i.refetchQueries({queryKey:l,exact:!0}),t.platform&&t.listen){await r({to:"/$owner/automations/new",params:{owner:e},search:{...t,agent:s}});return}await r({to:"/$owner/agents/$agentId/settings",params:{owner:e,agentId:s},search:{run_id:void 0}})}}):a.jsx(y,{icon:E,title:"Workspace membership required",description:"Only workspace members can build managed agents."})]})})}export{M as component};
2
+ //# sourceMappingURL=new-BJst6K0b.js.map
@@ -1,2 +1,2 @@
1
- import{c as z,q as F,G as L,r,j as e,H as v,I as S,B as U,J as N,K as E}from"./index-DdBTTN3y.js";import{C as I,a as A,b as T,c as k}from"./card-Bdi7VEwo.js";import{F as q}from"./full-page-spinner-BqmckkOf.js";function c(l){return l.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function $(){const l=z(),{session:u,isReady:d}=F(),{slug:n,name:i}=L.useSearch(),[m,y]=r.useState(i||n||""),[g,h]=r.useState(n||(i?c(i):"")),[b,C]=r.useState(!!n),[x,o]=r.useState(null),[f,p]=r.useState(!1),j=r.useRef(!1);if(r.useEffect(()=>{if(!d||u||j.current)return;j.current=!0;const a=new URL("/orgs/new",window.location.origin);n&&a.searchParams.set("slug",n),i&&a.searchParams.set("name",i);const s=new URL("/auth/login",window.location.origin);s.searchParams.set("callbackUrl",`${a.pathname}${a.search}`),window.location.assign(s.toString())},[d,u,n,i]),!d||!u)return e.jsx(q,{});const P=a=>{const s=E(a);if(s.kind==="cross-host"){window.location.assign(s.href);return}l({to:s.to})},R=async a=>{a.preventDefault(),o(null);const s=m.trim(),w=(g.trim()||c(s)).trim();if(!s){o("Name is required");return}if(!w){o("Slug is required");return}p(!0);try{const t=await N.create({name:s,slug:w});if(t.error){o(t.error.message||"Failed to create organization");return}t.data&&(await N.setActive({organizationId:t.data.id}),P(t.data.slug))}catch(t){o(t instanceof Error?t.message:"An error occurred")}finally{p(!1)}};return e.jsx("div",{className:"container mx-auto max-w-md px-4 py-10",children:e.jsxs(I,{children:[e.jsx(A,{children:e.jsx(T,{children:"Create organization"})}),e.jsx(k,{children:e.jsxs("form",{onSubmit:R,className:"space-y-4",children:[x&&e.jsx("div",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:x}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(v,{htmlFor:"org-name",children:["Name",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(S,{id:"org-name",value:m,onChange:a=>{y(a.target.value),b||h(c(a.target.value))},placeholder:"Acme Inc.",autoFocus:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(v,{htmlFor:"org-slug",children:["Slug",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(S,{id:"org-slug",value:g,onChange:a=>{C(!0),h(c(a.target.value))},placeholder:"acme"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Used in URLs and as the org id in ",e.jsx("code",{children:"lobu.toml"}),". Lowercase letters, numbers, and hyphens."]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(U,{type:"submit",disabled:f,children:f?"Creating…":"Create organization"})})]})})]})})}export{$ as component};
2
- //# sourceMappingURL=new-DgE1pVV0.js.map
1
+ import{c as z,q as F,G as L,r,j as e,H as v,I as S,B as U,J as N,K as E}from"./index-BjcZVe7n.js";import{C as I,a as A,b as T,c as k}from"./card-g4yxo4Hr.js";import{F as q}from"./full-page-spinner-B5xXnKtV.js";function c(l){return l.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function $(){const l=z(),{session:u,isReady:d}=F(),{slug:n,name:i}=L.useSearch(),[m,y]=r.useState(i||n||""),[g,h]=r.useState(n||(i?c(i):"")),[b,C]=r.useState(!!n),[x,o]=r.useState(null),[f,p]=r.useState(!1),j=r.useRef(!1);if(r.useEffect(()=>{if(!d||u||j.current)return;j.current=!0;const a=new URL("/orgs/new",window.location.origin);n&&a.searchParams.set("slug",n),i&&a.searchParams.set("name",i);const s=new URL("/auth/login",window.location.origin);s.searchParams.set("callbackUrl",`${a.pathname}${a.search}`),window.location.assign(s.toString())},[d,u,n,i]),!d||!u)return e.jsx(q,{});const P=a=>{const s=E(a);if(s.kind==="cross-host"){window.location.assign(s.href);return}l({to:s.to})},R=async a=>{a.preventDefault(),o(null);const s=m.trim(),w=(g.trim()||c(s)).trim();if(!s){o("Name is required");return}if(!w){o("Slug is required");return}p(!0);try{const t=await N.create({name:s,slug:w});if(t.error){o(t.error.message||"Failed to create organization");return}t.data&&(await N.setActive({organizationId:t.data.id}),P(t.data.slug))}catch(t){o(t instanceof Error?t.message:"An error occurred")}finally{p(!1)}};return e.jsx("div",{className:"container mx-auto max-w-md px-4 py-10",children:e.jsxs(I,{children:[e.jsx(A,{children:e.jsx(T,{children:"Create organization"})}),e.jsx(k,{children:e.jsxs("form",{onSubmit:R,className:"space-y-4",children:[x&&e.jsx("div",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:x}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(v,{htmlFor:"org-name",children:["Name",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(S,{id:"org-name",value:m,onChange:a=>{y(a.target.value),b||h(c(a.target.value))},placeholder:"Acme Inc.",autoFocus:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(v,{htmlFor:"org-slug",children:["Slug",e.jsx("span",{className:"ml-1 text-destructive",children:"*"})]}),e.jsx(S,{id:"org-slug",value:g,onChange:a=>{C(!0),h(c(a.target.value))},placeholder:"acme"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Used in URLs and as the org id in ",e.jsx("code",{children:"lobu.toml"}),". Lowercase letters, numbers, and hyphens."]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(U,{type:"submit",disabled:f,children:f?"Creating…":"Create organization"})})]})})]})})}export{$ as component};
2
+ //# sourceMappingURL=new-Dc5Bbotb.js.map
@@ -0,0 +1,2 @@
1
+ import{c as S,at as C,aH as k,aB as A,bb as T,r as g,j as e,ak as L,al as B,gT as P,L as p,gU as R,d1 as $,S as f,hm as w,az as I}from"./index-BjcZVe7n.js";import{C as O,A as D}from"./create-automation-form-C9PMX7N8.js";import"./model-C2q7WDcS.js";import"./entity-options-BkU_En_f.js";import"./connection-label-BobuYiAG.js";import"./use-automations-D9hKpufo.js";import"./model-selector-B2cjCn0V.js";import"./skill-editor-D_W3QlRz.js";import"./json-diff-DtZtra_g.js";import"./index-Vcq4gwWv.js";import"./use-mention-search-CJGCatFS.js";import"./automation-source-list-Dhucq1sI.js";function E(n){return n.includes(":")?n.slice(n.indexOf(":")+1):n}function F({prefillAgentId:n,onCancel:t,initialTriggers:l,conversationSetup:h}){const{org:a}=C(),[c,d]=g.useState({ready:!1,triggers:[]}),[u,N]=g.useState(),o=g.useCallback(s=>{d(m=>JSON.stringify(m)===JSON.stringify(s)?m:s)},[]),r=u??l;return e.jsx(O,{startFromScratch:!!l,organizationId:a?.id??"",prefillAgentId:n,conversationSetup:h,onClose:t,onPrefillTriggers:s=>N(s.length>0?s:void 0),onSuccess:t,hideHeader:!0,hideCancel:!0,submitLabel:"Create Automation",submitDisabled:!c.ready,createFields:{triggers:c.triggers},triggerFields:e.jsx(D,{organizationId:a?.id??null,initialTriggers:r,onChange:o},JSON.stringify(r??"new"))})}function z({owner:n,prefilled:t}){const l=S(),{org:h}=C(),a=k(h?.id??null,{status:"active",limit:500}),c=A(h?.id??null),{data:d=[]}=T(),u=!!(t?.platform&&(t.listen||t.resource)),N=u&&(a.isLoading||c.isLoading),o=g.useMemo(()=>{if(!t?.platform||!t.listen&&!t.resource)return;const x=a.data??[],j=t.connection?x.find(i=>i.slug===t.connection):(()=>{const i=x.filter(v=>v.connector_key!==t.platform?!1:t.resource?!0:v.facets.chat&&(v.external_tenant_id??"")===(t.team??""));return i.length===1?i[0]:void 0})();if(t.connection&&!j)return;const b=t.events?.split(",").map(i=>i.trim()).filter(Boolean)??[];return[{kind:"event",source:"connector",connector_key:t.platform,...j?{connection_id:j.id}:{},event_types:b.length>0?b:t.listen?["message.created"]:[],match:t.resource?{resource_ref:t.resource,...t.resource_type?{resource_type:t.resource_type}:{}}:{channel_id:E(t.listen??"")},execution:"turn",active_run:t.listen?"steer":"queue",output:t.listen?"reply_to_source":"silent",skip_if_unchanged:!t.listen}]},[a.data,t]),r=c.data?.find(x=>x.key===t?.platform)?.name,s=t?.label??t?.listen,m=g.useMemo(()=>t?.listen&&o&&s?{name:r?`${r}: ${s}`:s}:void 0,[s,r,o,t?.listen]),y=()=>void l({to:"/$owner/automations",params:{owner:n}}),_=o?t?.resource?`React to changes on ${t.label??t.resource}.`:`React to messages in ${t?.label??t?.listen}.`:u&&!a.isLoading?"Choose the matching connection and event, then define the reaction.":"Start from a template, from scratch, or clone an existing Automation.";return e.jsx(L,{className:"gap-6 pt-2.5 pb-8",children:e.jsxs(B,{className:"flex min-w-0 flex-col gap-4",children:[e.jsx(P,{crumbs:[e.jsx(p,{to:"/$owner/automations",params:{owner:n},className:R,children:"Automations"},"automations")],current:"New automation"}),e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3",children:e.jsx("div",{className:"flex min-w-0 items-center gap-2",children:e.jsxs("h1",{className:"flex min-w-0 items-center gap-2 truncate font-display text-xl font-semibold",children:[e.jsx($,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":!0}),"New automation"]})})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:_}),m&&!t?.agent?e.jsxs("p",{className:"text-sm text-muted-foreground",children:[d.length===0?"This workspace has no agents yet. ":"Choose the agent that answers here, or ",e.jsx(p,{to:"/$owner/agents/new",params:{owner:n},search:t,className:"underline underline-offset-4",children:d.length===0?"Create an agent":"create an agent"})," ","and come back to finish this setup."]}):null,N?e.jsxs("div",{className:"space-y-3",children:[e.jsx(f,{className:"h-10 w-full"}),e.jsx(f,{className:"h-32 w-full"})]}):u&&t?.connection&&!o?e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:"This connection is no longer available. Reopen setup from your conversation."}):e.jsx(F,{prefillAgentId:t?.agent,onCancel:y,initialTriggers:o,conversationSetup:m})]})})}function K(){const{owner:n}=w.useParams(),t=w.useSearch();return e.jsx(I,{owner:n,children:()=>e.jsx(z,{owner:n,prefilled:t})})}export{K as component};
2
+ //# sourceMappingURL=new-DgbivfDe.js.map
@@ -1,2 +1,2 @@
1
- import{a6 as ge,r as j,bJ as Ie,bK as Be,bL as Ke,bM as Me,bN as be,j as e,bO as J,B as C,bP as Ve,b2 as He,bQ as Ue,bR as Ge,bS as Je,bT as Ye,bU as Ze,bV as Xe,bW as es,bX as ve,bt as ie,bY as ss,bZ as ts,b_ as ns,b$ as me,c0 as is,c1 as as,c as os,a1 as Le,v as rs,c2 as cs,c3 as ne,c4 as ls,H as je,I as Ne,c5 as ds,c6 as us,c7 as ms,ab as Ce,bc as hs,S as z,J as le,c8 as ps,c9 as _e,ca as ke,cb as gs,K as xs,cc as Se,w as fs,cd as ys,ak as bs,al as vs,ce as js,i as Ns,cf as Cs}from"./index-DdBTTN3y.js";import{P as he,a as We,A as _s}from"./agent-permissions-matrix-bP1Qihv7.js";import{C as we,a as Ae,b as Oe,c as ze}from"./card-Bdi7VEwo.js";const Pe=["auto","approval","deny"],ks={matched_rule:"Matching policy rules apply.",default_approval:"No rule matches; approval is required.",unresolved_principal:"The requesting agent or Automation could not be identified.",parent_approval:"Approval is inherited from the parent action.",unavailable_operation:"This action is unavailable on the connection."},De={read:"Reads",write:"Writes",destructive:"Destructive writes",non_destructive:"Non-destructive writes",unknown:"Unclassified writes"};function pe(s){return{operation_key:s.operation_key??null,connector_key:s.connector_key??null,connection_id:s.connection_id??null,operation_category:s.operation_category??null}}const de=s=>JSON.stringify(pe(s)),$e=s=>({...s,effect:s.effects.execute??"approval"});function F({label:s,value:n,onChange:o,children:r,disabled:h}){return e.jsxs("label",{className:"flex min-w-0 flex-col gap-1 text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:s}),e.jsx("select",{"aria-label":s,value:n,onChange:c=>o(c.target.value),disabled:h,className:"h-9 w-full rounded-lg border bg-background px-2 text-foreground",children:r})]})}function Ss(s,n){const o=n.connections?.find(r=>r.id===s.connection_id);return s.connection_id?`Connection: ${o?.display_name||o?.connector_key||"Unavailable"} (#${s.connection_id})`:s.connector_key?`Connector: ${n.connectors?.find(r=>r.key===s.connector_key)?.name||s.connector_key}`:"All connectors"}function ws(s,n){return s.operation_key?n.connector_operations.find(o=>o.operation_key===s.operation_key)?.name||s.operation_key:s.operation_category?De[s.operation_category]:"All actions"}function ue(s,n){return`${Ss(s,n)} · ${ws(s,n)}`}function Ee(s){return s.connection_id?`connection:${s.connection_id}`:s.connector_key?`connector:${s.connector_key}`:"all"}function Te({catalog:s}){return e.jsxs(e.Fragment,{children:[e.jsx("option",{value:"all",children:"All connectors"}),e.jsx("optgroup",{label:"Connectors",children:s.connectors?.map(n=>e.jsx("option",{value:`connector:${n.key}`,children:n.name},n.key))}),e.jsx("optgroup",{label:"Connections",children:s.connections?.map(n=>e.jsxs("option",{value:`connection:${n.id}`,children:[n.display_name||n.connector_key," (#",n.id,")"]},n.id))})]})}function As({label:s,ariaLabel:n,disabled:o,onRemove:r}){const[h,c]=j.useState(!1);return h?e.jsxs("div",{className:"flex gap-1",children:[e.jsx(C,{type:"button",variant:"destructive",size:"sm",disabled:o,"aria-label":"Confirm removal",onClick:async()=>{await r()&&c(!1)},children:"Confirm"}),e.jsx(C,{type:"button",variant:"ghost",size:"sm",disabled:o,onClick:()=>c(!1),children:"Cancel"})]}):e.jsx(C,{type:"button",variant:"ghost",size:"sm",disabled:o,"aria-label":n,onClick:()=>c(!0),children:s})}function Os({owner:s,connector:n,connection:o,agent:r}){const h=ge(),[c,b]=j.useState(r??""),y=Ie(s),l=y.data,u=l?.agents.some(t=>t.id===c)?c:"",m=Be(s,u),i=Ke(s,!u),[P,_]=j.useState(o?`connection:${o}`:n?`connector:${n}`:"all"),[M,Y]=j.useState(P),[I,L]=j.useState(!1),[k,W]=j.useState(""),[A,V]=j.useState("all"),[Z,E]=j.useState("approval"),[g,S]=j.useState(!1),[D,T]=j.useState(null),[H,X]=j.useState(o?String(o):""),[U,Q]=j.useState(""),R=l?.connections?.some(t=>String(t.id)===H)?H:"",w=Me(s,R?Number(R):void 0,U,u||void 0);async function G(t,f){S(!0),T(null);try{if(u){const d={resource_class:"connector_action",...pe(t)};f?await Je(s,u,{...d,effects:{execute:f}}):await Ye(s,u,d)||T("This rule was already removed. The list has been refreshed.")}else{const d=i.data;if(!d)return;const K=d.rules.filter(qe=>de(qe)!==de(t));f&&K.push({...pe(t),effect:f});const ce=await Ze(s,{revision:d.revision,rules:K});h.setQueryData(Xe(s),ce)}return await Promise.all(["write-permissions","agent-permissions","available-operations","connector-operations","policy-explanation"].map(d=>h.invalidateQueries({queryKey:[d]}))),t}catch(d){d instanceof be&&d.status===409?(T("Policies changed in another session. Review the refreshed rules before saving again."),await i.refetch()):T(d instanceof Error?d.message:"Could not save policy.")}finally{S(!1)}}const q=y.error||(u?m.error:i.error);if(q instanceof be&&q.status===403)return e.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:"Only organization owners and admins can manage policies."});if(q)return e.jsxs("p",{role:"alert",className:"text-sm text-destructive",children:["Could not load policies. ",String(q)]});if(!l||(u?!m.data:!i.data))return e.jsx(J,{label:"policies",rows:2});const v=t=>t==="all"||l.connectors?.some(f=>`connector:${f.key}`===t)||l.connections?.some(f=>`connection:${f.id}`===t)?t:"all",a=v(P),p=v(M),N=l.connections?.find(t=>`connection:${t.id}`===p),$=N?.connector_key??(p.startsWith("connector:")?p.slice(10):void 0),x=t=>p==="all"||Ee(t)==="all"?!0:t.connection_id?N?t.connection_id===N.id:l.connections?.some(f=>f.id===t.connection_id&&f.connector_key===$):t.connector_key===$;function B(t){return u?t.principal_kind==="agent"&&t.principal_id===u:!t.principal_kind}const ee=a.startsWith("connector:")?a.slice(10):a.startsWith("connection:")?l.connections?.find(t=>t.id===Number(a.slice(11)))?.connector_key:void 0,O=l.connector_operations.filter(t=>!ee||t.connector_key===ee),se=l.connections?.find(t=>t.id===Number(R))?.connector_key,ae=l.connector_operations.filter(t=>t.connector_key===se),oe=u?(m.data?.agent??[]).filter(t=>t.resource_class==="connector_action").map($e):i.data?.rules??[],te=(m.data?.floor??[]).filter(t=>t.resource_class==="connector_action"&&x(t)).map($e),Qe={connector_key:a.startsWith("connector:")?a.slice(10):a==="all"&&A==="specific"?O.find(t=>t.operation_key===k)?.connector_key??null:null,connection_id:a.startsWith("connection:")?Number(a.slice(11)):null,operation_key:A==="specific"?k:null,operation_category:A.startsWith("category:")?A.slice(9):null},re=oe.filter(x);function fe(){_(p),V("all"),W(""),E("approval"),L(!0)}const ye=(t,f=!1)=>e.jsx("div",{className:"divide-y rounded-lg border",children:t.map(d=>{const K=!f&&B(d);return e.jsxs(We,{controls:e.jsxs(e.Fragment,{children:[e.jsx(he,{options:Pe,value:d.effect,floor:"auto",compact:!0,disabled:g||!K,ariaLabel:`Policy for ${ue(d,l)}`,onChange:ce=>void G(d,ce)}),K&&e.jsx(As,{label:"Remove",disabled:g,ariaLabel:`Remove rule: ${ue(d,l)}`,onRemove:()=>G(d)})]}),children:[e.jsx("p",{className:"text-sm break-words",children:ue(d,l)}),!K&&e.jsx("p",{className:"text-xs text-muted-foreground",children:d.principal_kind==="agent"&&!d.principal_id?"All agents":"Inherited restriction"})]},JSON.stringify([d.principal_kind,d.principal_id,de(d)]))})});return e.jsxs("div",{className:"space-y-4",children:[(p!==M||u!==c)&&e.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:"The requested scope is unavailable. Showing organization rules; install the connector or choose an available scope."}),e.jsxs("div",{className:"space-y-1 text-sm text-muted-foreground",children:[e.jsx("p",{children:"Auto runs immediately. Ask waits for human approval. Block prevents execution and hides the action from agents. Authentication and guardrails still apply."}),e.jsxs("details",{className:"space-y-2",children:[e.jsx("summary",{className:"cursor-pointer text-sm font-medium text-foreground",children:"How rules combine"}),e.jsx("p",{children:"A rule overrides another when it is narrower in target or actions and at least as narrow in the other. When rules are narrower in different ways, or use different categories, the stricter choice wins: Block, then Ask, then Auto. With no matching rule, the result is Ask. Impact categories apply only to writes."}),e.jsx("p",{children:"A connection-wide Auto does not override an organization-wide destructive Block. Add a destructive rule for that connection to make an exception."}),e.jsx("p",{children:"Agents and their Automations can only tighten organization policy. Internal browser steps inherit the parent approval; an explicit browser Block still wins."})]})]}),e.jsxs(F,{label:"Policy owner",value:u,onChange:b,disabled:g,children:[e.jsx("option",{value:"",children:"Organization"}),l.agents.map(t=>e.jsxs("option",{value:t.id,children:["Agent: ",t.name]},t.id))]}),u&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"Auto adds no restriction for this agent. It inherits organization policy and cannot bypass Ask or Block."}),e.jsx("p",{className:"text-sm text-muted-foreground",children:u?"Without a matching restriction, this agent inherits organization policy.":"Without a matching rule, actions require approval (Ask)."}),e.jsx(F,{label:"Show rules for",value:p,onChange:Y,disabled:g,children:e.jsx(Te,{catalog:l})}),u&&te.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium",children:"Inherited organization rules"}),ye(te,!0)]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:u?"Saved restrictions":"Saved rules"}),!I&&re.length>0&&e.jsx(C,{variant:"outline",size:"sm",disabled:g,onClick:fe,children:"Add rule"})]}),I&&e.jsxs("form",{className:"space-y-3 border-t pt-4",onSubmit:t=>{t.preventDefault(),!g&&(A!=="specific"||k)&&G(Qe,Z).then(f=>{f&&(L(!1),Y(Ee(f)))})},children:[e.jsx("h3",{className:"text-sm font-medium",children:"Add rule"}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(F,{label:"Applies to",value:a,onChange:t=>{_(t),V("all"),W("")},disabled:g,children:e.jsx(Te,{catalog:l})}),e.jsxs(F,{label:"Actions",value:A,onChange:V,disabled:g,children:[e.jsx("option",{value:"all",children:"All actions"}),e.jsx("optgroup",{label:"Categories",children:l.operation_categories?.map(t=>e.jsx("option",{value:`category:${t}`,children:De[t]},t))}),e.jsx("option",{value:"specific",children:"Specific action"})]})]}),A==="specific"&&e.jsxs(F,{label:"Specific action",value:k,onChange:W,disabled:g,children:[e.jsx("option",{value:"",children:"Choose action"}),O.map(t=>e.jsxs("option",{value:t.operation_key,children:[t.connector_name,": ",t.name]},t.operation_key))]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx(he,{options:Pe,value:Z,floor:"auto",compact:!0,disabled:g,ariaLabel:"New rule decision",onChange:E}),e.jsx(Ve,{onCancel:()=>L(!1),cancelDisabled:g,children:e.jsx(C,{type:"submit",disabled:g||A==="specific"&&!k,children:g?"Saving…":"Save rule"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Saving an existing scope replaces its decision. Removing a rule reveals the next matching rule."})]}),re.length?ye(re):!I&&e.jsx(He,{icon:Ue,title:"No saved rules in this scope",description:"Add a rule for all actions, a category, or a specific action.",actionLabel:"Add rule",onAction:fe})]}),D&&e.jsx("p",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:D}),e.jsxs("details",{className:"space-y-3 border-t pt-4",children:[e.jsx("summary",{className:"cursor-pointer text-sm font-medium",children:"Check an action"}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs(F,{label:"Check connection",value:R,onChange:t=>{X(t),Q("")},children:[e.jsx("option",{value:"",children:"Choose connection"}),l.connections?.map(t=>e.jsxs("option",{value:String(t.id),children:[t.display_name||t.connector_key," (#",t.id,")"]},t.id))]}),e.jsxs(F,{label:"Check action",value:U,onChange:Q,disabled:!R,children:[e.jsx("option",{value:"",children:"Choose action"}),ae.map(t=>e.jsx("option",{value:t.operation_key.slice(t.connector_key.length+2),children:t.name},t.operation_key))]})]}),w.error?e.jsxs("p",{role:"alert",className:"text-sm text-destructive",children:["Could not check policy. ",String(w.error)]}):e.jsx("p",{"aria-live":"polite",className:"text-sm",children:U?w.isPending?"Checking…":w.data?e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:Ge[w.data.effect]})," ·"," ",ks[w.data.reason]??"The server evaluated this action.",w.data.rule_ids.length>0?` · Rules ${w.data.rule_ids.map(t=>`#${t}`).join(", ")}`:""]}):"":""})]})]})}const zs=[{action:"create_type",label:"Create entity types",description:"Add a new type and its initial fields."},{action:"update_type",label:"Edit entity types",description:"Change fields, write rules, event kinds, or type metadata."},{action:"delete_type",label:"Delete entity types",description:"Remove an entity-type definition."}],Ps=[{action:"create_relationship_type",label:"Create relationship types",description:"Add a new kind of link between entity types."},{action:"update_relationship_type",label:"Edit relationship types",description:"Change a definition, or which types it may connect."},{action:"delete_relationship_type",label:"Delete relationship types",description:"Remove a relationship-type definition."}];function xe(s){return s.resource_class==="entity_schema"&&s.principal_kind===null&&s.entity_type_slug===null&&s.operation_key===null&&s.target_agent_id===null}function $s(s){return s.agent.find(xe)}function Es(s,n){return{...s,agent:[...s.agent.filter(o=>!xe(o)),n]}}function Ts(s){return{...s,agent:s.agent.filter(n=>!xe(n))}}function Rs({label:s,description:n,action:o,value:r,pending:h,onChange:c}){return e.jsxs(We,{controls:e.jsx(he,{options:as("entity_schema",o),value:r,floor:"auto",disabled:h,compact:!0,ariaLabel:s,onChange:c}),children:[e.jsx("p",{children:s}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:n})]})}function Re({title:s,actions:n,effects:o,pending:r,onChange:h}){return e.jsxs("section",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium",children:s}),e.jsx("div",{className:"divide-y overflow-hidden rounded-lg border",children:n.map(({action:c,label:b,description:y})=>e.jsx(Rs,{action:c,label:b,description:y,value:o[c]??me.entity_schema[c]??"deny",pending:r,onChange:l=>h(c,l)},c))})]})}function Fs({owner:s}){const n=ge(),o=es(s),r=Ie(s),h=ve({mutationFn:m=>ss(s,{resource_class:"entity_schema",effects:m}),onSuccess:m=>{n.setQueryData(o,i=>i&&Es(i,m)),n.invalidateQueries({queryKey:o})},onError:m=>{ie.error(m instanceof Error?m.message:"Failed to save schema policy")}}),c=ve({mutationFn:()=>ts(s,{resource_class:"entity_schema"}),onSuccess:()=>{n.setQueryData(o,m=>m&&Ts(m)),n.invalidateQueries({queryKey:o})},onError:m=>{ie.error(m instanceof Error?m.message:"Failed to reset schema policy")}});if(r.isLoading)return e.jsx(J,{label:"schema policy",variant:"cards",cards:1});if(r.isError||!r.data)return e.jsx(ns,{label:"schema policy"});const b=$s(r.data),y=b?.effects??me.entity_schema,l=h.isPending||c.isPending,u=(m,i)=>{h.mutate({...b?.effects??me.entity_schema,[m]:i})};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:b?"Custom policy":"Workspace defaults"}),b?e.jsxs(C,{type:"button",variant:"outline",size:"sm",disabled:l,onClick:()=>c.mutate(),children:[e.jsx(is,{className:"mr-1.5 h-3.5 w-3.5"}),"Remove custom policy"]}):null]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(Re,{title:"Entity types",actions:zs,effects:y,pending:l,onChange:u}),e.jsx(Re,{title:"Relationship types",actions:Ps,effects:y,pending:l,onChange:u})]})]})}function Fe(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Is(s,n,o){const r=s.split("/");return r[1]===n?(r[1]=o,r.join("/")||"/"):`/${o}`}function Ls({section:s}){return s==="policies"?e.jsx(J,{label:"policies",rows:2}):s==="governance"?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-sm font-medium",children:"Agent write defaults"}),e.jsx(J,{label:"agent write defaults",variant:"table",rows:3})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-sm font-medium",children:"Schema governance"}),e.jsx(J,{label:"schema governance",rows:3})]})]}):e.jsxs("div",{role:"status","aria-label":"Loading general settings","aria-busy":"true",className:"space-y-6",children:[e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-base font-semibold leading-none",children:"Identity"}),e.jsxs("div",{"aria-hidden":"true",className:"space-y-4",children:[["name","slug"].map(n=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(z,{className:"h-3.5 w-12 rounded-none"}),e.jsx("div",{className:"flex h-9 items-center border border-input bg-background px-3",children:e.jsx(z,{className:"h-4 w-32 rounded-none"})})]},n)),e.jsx(z,{className:"h-3 w-4/5 rounded-none"})]})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold leading-none",children:"Workspace visibility"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Choose who can browse this workspace and its public pages."})]}),e.jsx("div",{"aria-hidden":"true",className:"grid gap-2 sm:grid-cols-2",children:["private","public"].map(n=>e.jsxs("div",{className:"flex items-start gap-3 rounded-lg border p-3",children:[e.jsx(z,{className:"mt-0.5 h-4 w-4 shrink-0 rounded-none"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(z,{className:"h-4 w-16 rounded-none"}),e.jsx(z,{className:"h-3 w-full rounded-none"}),e.jsx(z,{className:"h-3 w-2/3 rounded-none"})]})]},n))})]}),e.jsxs("div",{"aria-hidden":"true",className:"flex justify-end gap-2",children:[e.jsx(z,{className:"h-9 w-20 rounded-none"}),e.jsx(z,{className:"h-9 w-28 rounded-none"})]})]})}function Ws({owner:s,section:n="general",connector:o,connection:r,agent:h}){const c=os(),b=ge(),{data:y,error:l}=Le(),{activeOrg:u,urlOrgSlug:m}=rs(),i=(y??[]).find(a=>a.slug===s&&a.is_member)??null,P=i?.id??s,_=cs(P,{name:i?.name??"",slug:i?.slug??"",visibility:i?.visibility??"private"}),[M,Y]=_.field("name"),[I,L]=_.field("slug"),[k,W]=_.field("visibility"),[A,V]=ne(P,!!i),[Z,E]=ne(P,!1),[g,S]=ne(P,null),[D,T]=j.useState(!1),[H,X]=j.useState(!1),[U,Q]=ne(P,!1);if(ls(l)&&y===void 0)return e.jsxs(we,{role:"alert",children:[e.jsx(Ae,{children:e.jsx(Oe,{children:"Couldn't load organizations"})}),e.jsx(ze,{children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Please try again in a moment."})})]});if(y===void 0)return e.jsx(Ls,{section:n});if(!i)return e.jsxs(we,{children:[e.jsx(Ae,{children:e.jsx(Oe,{children:"Organization not found"})}),e.jsx(ze,{children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:["You aren't a member of an organization at"," ",e.jsx("span",{className:"font-mono",children:s}),", or it has been deleted."]})})]});if(n==="policies")return e.jsx("div",{className:"space-y-6",children:e.jsxs("section",{id:"policies",className:"scroll-mt-6 space-y-4",children:[e.jsx("div",{className:"space-y-1",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Control connector actions across the organization. Changes to existing rules save automatically."})}),e.jsx(Os,{owner:s,connector:o,connection:r,agent:h},`${s}:${h??""}:${o??""}:${r??""}`)]})});if(n==="governance")return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{className:"text-sm font-medium",children:"Agent write defaults"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Set the defaults agents inherit for entities and agents. Changes save automatically; agents can only tighten them."})]}),e.jsx(_s,{owner:s,variant:"org-floor"})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{className:"text-sm font-medium",children:"Schema governance"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Control structural changes by agents and connected AI clients. Changes save automatically."})]}),e.jsx(Fs,{owner:s})]})]});const R=a=>{const p=xs(a);if(p.kind==="cross-host"){window.location.assign(p.href);return}c({to:p.to})},w=a=>{if(a==="public"&&i.visibility!=="public"){E(!0);return}W(a),E(!1)},G=async()=>{if(!_.canSubmit)return;const a=M.trim();if(!a){S("Name is required");return}const p=I.trim()||Fe(a);if(!p){S("Slug is required");return}T(!0),S(null);try{const N=a!==i.name||p!==i.slug,$=k!==i.visibility;let x=i.slug;if(N){const O=await le.update({organizationId:i.id,data:{name:a,slug:p}});if(O.error){S(O.error.message||"Failed to update organization");return}x=O.data?.slug??p}$&&(x=(await ps(x,k)).slug),(N||$)&&(_.accept(_.values,{name:a,slug:x,visibility:k}),await b.invalidateQueries({queryKey:["organizations"]}),ie.success("Organization updated"));const B=u?.id===i.id||m===i.slug,ee=x!==i.slug;if(B&&ee){const O=_e(),se=ke();if(O===i.slug&&se){const oe=gs(window.location.pathname,i.slug)||"/",te=`${window.location.protocol}//${x}.${se}${oe}${window.location.search}${window.location.hash}`;window.location.assign(te);return}const ae=Is(window.location.pathname,i.slug,x);c({to:`${ae}${window.location.search}${window.location.hash}`});return}}catch(N){S(N instanceof Error?N.message:"Failed to update organization")}finally{T(!1)}},q=async()=>{X(!0),S(null);try{const a=await le.delete({organizationId:i.id});if(a.error){S(a.error.message||"Failed to delete organization");return}await b.invalidateQueries({queryKey:["organizations"]}),ie.success("Organization deleted");const N=(y??[]).filter(x=>x.is_member).find(x=>x.id!==i.id)??null,$=u?.id===i.id||m===i.slug;if($&&N){await le.setActive({organizationId:N.id}),R(N.slug);return}if($){const x=_e(),B=ke();if(x===i.slug&&B){window.location.assign(`${window.location.protocol}//app.${B}/`);return}c({to:"/"});return}c({to:"/"})}catch(a){S(a instanceof Error?a.message:"Failed to delete organization")}finally{X(!1),Q(!1)}},v=D||H;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-base font-semibold leading-none",children:"Identity"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(je,{htmlFor:"org-name",children:"Name"}),e.jsx(Ne,{id:"org-name",value:M,onChange:a=>{Y(a.target.value),A||L(Fe(a.target.value))},placeholder:"e.g. My Team",disabled:v})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(je,{htmlFor:"org-slug",children:"Slug"}),e.jsx(Ne,{id:"org-slug",value:I,onChange:a=>{V(!0),L(a.target.value)},placeholder:"e.g. my-team",disabled:v}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Changing the slug rewrites this workspace's URL. Existing links to"," ",e.jsxs("span",{className:"font-mono",children:["/",i.slug]})," redirect for a grace period."]})]})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold leading-none",children:"Workspace visibility"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Choose who can browse this workspace and its public pages."})]}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[e.jsxs("button",{type:"button",onClick:()=>w("private"),disabled:v,className:`flex items-start gap-3 rounded-lg border p-3 text-left transition-colors ${k==="private"?"border-primary bg-primary/5":"border-border hover:bg-muted/40"}`,children:[e.jsx(ds,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium",children:"Private"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Only members can access this workspace."})]})]}),e.jsxs("button",{type:"button",onClick:()=>w("public"),disabled:v,className:`flex items-start gap-3 rounded-lg border p-3 text-left transition-colors ${k==="public"?"border-primary bg-primary/5":"border-border hover:bg-muted/40"}`,children:[e.jsx(us,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium",children:"Public"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Anyone can browse public pages for this workspace."})]})]})]}),Z&&e.jsxs("div",{className:"rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm",children:[e.jsx("p",{className:"text-foreground",children:"Make this workspace public? Catalog-style content may become visible outside the membership."}),e.jsxs("div",{className:"mt-2 flex gap-2",children:[e.jsx(C,{type:"button",size:"sm",onClick:()=>{W("public"),E(!1)},disabled:v,children:"Confirm public"}),e.jsx(C,{type:"button",size:"sm",variant:"ghost",onClick:()=>E(!1),disabled:v,children:"Cancel"})]})]})]}),g&&e.jsx("div",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:g}),e.jsx(ms,{visible:_.hasConflict,onReload:_.reset}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(C,{variant:"outline",onClick:()=>void c({to:`/${s}`}),disabled:v,children:"Cancel"}),e.jsxs(C,{onClick:G,disabled:v||!_.canSubmit,children:[D?e.jsx(Ce,{size:"lg",className:"mr-1.5"}):null,D?"Saving...":"Save changes"]})]}),e.jsxs("div",{className:"rounded-lg border border-destructive/30 bg-destructive/5 p-4",children:[e.jsx("p",{className:"text-sm font-medium",children:i.is_personal?"Personal workspace":"Delete this organization"}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:i.is_personal?"Your personal workspace can't be deleted — your devices and personal connections are bound to it.":"Permanently removes the organization and all members' workspace access. This cannot be undone."}),!i.is_personal&&e.jsx("div",{className:"mt-3",children:U?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(C,{variant:"destructive",size:"sm",onClick:q,disabled:v,children:[H?e.jsx(Ce,{className:"mr-1.5"}):null,"Confirm delete"]}),e.jsx(C,{variant:"ghost",size:"sm",onClick:()=>Q(!1),disabled:v,children:"Cancel"})]}):e.jsxs(C,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>Q(!0),disabled:v,children:[e.jsx(hs,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete organization"]})})]})]})}function Bs(){const{owner:s}=Se.useParams(),n=Se.useSearch(),{hash:o}=fs(),r=ys(n,o),h={general:"General",policies:"Policies",governance:"Governance"}[r],{data:c}=Le(),b=(c??[]).find(y=>y.slug===s&&y.is_member)?.name;return e.jsx(bs,{className:"pt-2.5 pb-8",children:e.jsxs(vs,{className:Ns("flex flex-1 flex-col gap-6",Cs(r)),children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(js,{className:"h-7 w-7"}),e.jsx("h1",{className:"text-3xl font-semibold leading-tight",children:h})]}),b?e.jsx("p",{className:"text-base font-medium text-foreground",children:b}):null]}),e.jsx(Ws,{owner:s,...n,section:r})]})})}export{Bs as component};
2
- //# sourceMappingURL=organization-CKM_oFX3.js.map
1
+ import{a6 as ge,r as j,bJ as Ie,bK as Be,bL as Ke,bM as Me,bN as be,j as e,bO as J,B as C,bP as Ve,b2 as He,bQ as Ue,bR as Ge,bS as Je,bT as Ye,bU as Ze,bV as Xe,bW as es,bX as ve,bt as ie,bY as ss,bZ as ts,b_ as ns,b$ as me,c0 as is,c1 as as,c as os,a1 as Le,v as rs,c2 as cs,c3 as ne,c4 as ls,H as je,I as Ne,c5 as ds,c6 as us,c7 as ms,ab as Ce,bc as hs,S as z,J as le,c8 as ps,c9 as _e,ca as ke,cb as gs,K as xs,cc as Se,w as fs,cd as ys,ak as bs,al as vs,ce as js,i as Ns,cf as Cs}from"./index-BjcZVe7n.js";import{P as he,a as We,A as _s}from"./agent-permissions-matrix-DSjidWHL.js";import{C as we,a as Ae,b as Oe,c as ze}from"./card-g4yxo4Hr.js";const Pe=["auto","approval","deny"],ks={matched_rule:"Matching policy rules apply.",default_approval:"No rule matches; approval is required.",unresolved_principal:"The requesting agent or Automation could not be identified.",parent_approval:"Approval is inherited from the parent action.",unavailable_operation:"This action is unavailable on the connection."},De={read:"Reads",write:"Writes",destructive:"Destructive writes",non_destructive:"Non-destructive writes",unknown:"Unclassified writes"};function pe(s){return{operation_key:s.operation_key??null,connector_key:s.connector_key??null,connection_id:s.connection_id??null,operation_category:s.operation_category??null}}const de=s=>JSON.stringify(pe(s)),$e=s=>({...s,effect:s.effects.execute??"approval"});function F({label:s,value:n,onChange:o,children:r,disabled:h}){return e.jsxs("label",{className:"flex min-w-0 flex-col gap-1 text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:s}),e.jsx("select",{"aria-label":s,value:n,onChange:c=>o(c.target.value),disabled:h,className:"h-9 w-full rounded-lg border bg-background px-2 text-foreground",children:r})]})}function Ss(s,n){const o=n.connections?.find(r=>r.id===s.connection_id);return s.connection_id?`Connection: ${o?.display_name||o?.connector_key||"Unavailable"} (#${s.connection_id})`:s.connector_key?`Connector: ${n.connectors?.find(r=>r.key===s.connector_key)?.name||s.connector_key}`:"All connectors"}function ws(s,n){return s.operation_key?n.connector_operations.find(o=>o.operation_key===s.operation_key)?.name||s.operation_key:s.operation_category?De[s.operation_category]:"All actions"}function ue(s,n){return`${Ss(s,n)} · ${ws(s,n)}`}function Ee(s){return s.connection_id?`connection:${s.connection_id}`:s.connector_key?`connector:${s.connector_key}`:"all"}function Te({catalog:s}){return e.jsxs(e.Fragment,{children:[e.jsx("option",{value:"all",children:"All connectors"}),e.jsx("optgroup",{label:"Connectors",children:s.connectors?.map(n=>e.jsx("option",{value:`connector:${n.key}`,children:n.name},n.key))}),e.jsx("optgroup",{label:"Connections",children:s.connections?.map(n=>e.jsxs("option",{value:`connection:${n.id}`,children:[n.display_name||n.connector_key," (#",n.id,")"]},n.id))})]})}function As({label:s,ariaLabel:n,disabled:o,onRemove:r}){const[h,c]=j.useState(!1);return h?e.jsxs("div",{className:"flex gap-1",children:[e.jsx(C,{type:"button",variant:"destructive",size:"sm",disabled:o,"aria-label":"Confirm removal",onClick:async()=>{await r()&&c(!1)},children:"Confirm"}),e.jsx(C,{type:"button",variant:"ghost",size:"sm",disabled:o,onClick:()=>c(!1),children:"Cancel"})]}):e.jsx(C,{type:"button",variant:"ghost",size:"sm",disabled:o,"aria-label":n,onClick:()=>c(!0),children:s})}function Os({owner:s,connector:n,connection:o,agent:r}){const h=ge(),[c,b]=j.useState(r??""),y=Ie(s),l=y.data,u=l?.agents.some(t=>t.id===c)?c:"",m=Be(s,u),i=Ke(s,!u),[P,_]=j.useState(o?`connection:${o}`:n?`connector:${n}`:"all"),[M,Y]=j.useState(P),[I,L]=j.useState(!1),[k,W]=j.useState(""),[A,V]=j.useState("all"),[Z,E]=j.useState("approval"),[g,S]=j.useState(!1),[D,T]=j.useState(null),[H,X]=j.useState(o?String(o):""),[U,Q]=j.useState(""),R=l?.connections?.some(t=>String(t.id)===H)?H:"",w=Me(s,R?Number(R):void 0,U,u||void 0);async function G(t,f){S(!0),T(null);try{if(u){const d={resource_class:"connector_action",...pe(t)};f?await Je(s,u,{...d,effects:{execute:f}}):await Ye(s,u,d)||T("This rule was already removed. The list has been refreshed.")}else{const d=i.data;if(!d)return;const K=d.rules.filter(qe=>de(qe)!==de(t));f&&K.push({...pe(t),effect:f});const ce=await Ze(s,{revision:d.revision,rules:K});h.setQueryData(Xe(s),ce)}return await Promise.all(["write-permissions","agent-permissions","available-operations","connector-operations","policy-explanation"].map(d=>h.invalidateQueries({queryKey:[d]}))),t}catch(d){d instanceof be&&d.status===409?(T("Policies changed in another session. Review the refreshed rules before saving again."),await i.refetch()):T(d instanceof Error?d.message:"Could not save policy.")}finally{S(!1)}}const q=y.error||(u?m.error:i.error);if(q instanceof be&&q.status===403)return e.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:"Only organization owners and admins can manage policies."});if(q)return e.jsxs("p",{role:"alert",className:"text-sm text-destructive",children:["Could not load policies. ",String(q)]});if(!l||(u?!m.data:!i.data))return e.jsx(J,{label:"policies",rows:2});const v=t=>t==="all"||l.connectors?.some(f=>`connector:${f.key}`===t)||l.connections?.some(f=>`connection:${f.id}`===t)?t:"all",a=v(P),p=v(M),N=l.connections?.find(t=>`connection:${t.id}`===p),$=N?.connector_key??(p.startsWith("connector:")?p.slice(10):void 0),x=t=>p==="all"||Ee(t)==="all"?!0:t.connection_id?N?t.connection_id===N.id:l.connections?.some(f=>f.id===t.connection_id&&f.connector_key===$):t.connector_key===$;function B(t){return u?t.principal_kind==="agent"&&t.principal_id===u:!t.principal_kind}const ee=a.startsWith("connector:")?a.slice(10):a.startsWith("connection:")?l.connections?.find(t=>t.id===Number(a.slice(11)))?.connector_key:void 0,O=l.connector_operations.filter(t=>!ee||t.connector_key===ee),se=l.connections?.find(t=>t.id===Number(R))?.connector_key,ae=l.connector_operations.filter(t=>t.connector_key===se),oe=u?(m.data?.agent??[]).filter(t=>t.resource_class==="connector_action").map($e):i.data?.rules??[],te=(m.data?.floor??[]).filter(t=>t.resource_class==="connector_action"&&x(t)).map($e),Qe={connector_key:a.startsWith("connector:")?a.slice(10):a==="all"&&A==="specific"?O.find(t=>t.operation_key===k)?.connector_key??null:null,connection_id:a.startsWith("connection:")?Number(a.slice(11)):null,operation_key:A==="specific"?k:null,operation_category:A.startsWith("category:")?A.slice(9):null},re=oe.filter(x);function fe(){_(p),V("all"),W(""),E("approval"),L(!0)}const ye=(t,f=!1)=>e.jsx("div",{className:"divide-y rounded-lg border",children:t.map(d=>{const K=!f&&B(d);return e.jsxs(We,{controls:e.jsxs(e.Fragment,{children:[e.jsx(he,{options:Pe,value:d.effect,floor:"auto",compact:!0,disabled:g||!K,ariaLabel:`Policy for ${ue(d,l)}`,onChange:ce=>void G(d,ce)}),K&&e.jsx(As,{label:"Remove",disabled:g,ariaLabel:`Remove rule: ${ue(d,l)}`,onRemove:()=>G(d)})]}),children:[e.jsx("p",{className:"text-sm break-words",children:ue(d,l)}),!K&&e.jsx("p",{className:"text-xs text-muted-foreground",children:d.principal_kind==="agent"&&!d.principal_id?"All agents":"Inherited restriction"})]},JSON.stringify([d.principal_kind,d.principal_id,de(d)]))})});return e.jsxs("div",{className:"space-y-4",children:[(p!==M||u!==c)&&e.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:"The requested scope is unavailable. Showing organization rules; install the connector or choose an available scope."}),e.jsxs("div",{className:"space-y-1 text-sm text-muted-foreground",children:[e.jsx("p",{children:"Auto runs immediately. Ask waits for human approval. Block prevents execution and hides the action from agents. Authentication and guardrails still apply."}),e.jsxs("details",{className:"space-y-2",children:[e.jsx("summary",{className:"cursor-pointer text-sm font-medium text-foreground",children:"How rules combine"}),e.jsx("p",{children:"A rule overrides another when it is narrower in target or actions and at least as narrow in the other. When rules are narrower in different ways, or use different categories, the stricter choice wins: Block, then Ask, then Auto. With no matching rule, the result is Ask. Impact categories apply only to writes."}),e.jsx("p",{children:"A connection-wide Auto does not override an organization-wide destructive Block. Add a destructive rule for that connection to make an exception."}),e.jsx("p",{children:"Agents and their Automations can only tighten organization policy. Internal browser steps inherit the parent approval; an explicit browser Block still wins."})]})]}),e.jsxs(F,{label:"Policy owner",value:u,onChange:b,disabled:g,children:[e.jsx("option",{value:"",children:"Organization"}),l.agents.map(t=>e.jsxs("option",{value:t.id,children:["Agent: ",t.name]},t.id))]}),u&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"Auto adds no restriction for this agent. It inherits organization policy and cannot bypass Ask or Block."}),e.jsx("p",{className:"text-sm text-muted-foreground",children:u?"Without a matching restriction, this agent inherits organization policy.":"Without a matching rule, actions require approval (Ask)."}),e.jsx(F,{label:"Show rules for",value:p,onChange:Y,disabled:g,children:e.jsx(Te,{catalog:l})}),u&&te.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium",children:"Inherited organization rules"}),ye(te,!0)]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("h3",{className:"text-sm font-medium",children:u?"Saved restrictions":"Saved rules"}),!I&&re.length>0&&e.jsx(C,{variant:"outline",size:"sm",disabled:g,onClick:fe,children:"Add rule"})]}),I&&e.jsxs("form",{className:"space-y-3 border-t pt-4",onSubmit:t=>{t.preventDefault(),!g&&(A!=="specific"||k)&&G(Qe,Z).then(f=>{f&&(L(!1),Y(Ee(f)))})},children:[e.jsx("h3",{className:"text-sm font-medium",children:"Add rule"}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(F,{label:"Applies to",value:a,onChange:t=>{_(t),V("all"),W("")},disabled:g,children:e.jsx(Te,{catalog:l})}),e.jsxs(F,{label:"Actions",value:A,onChange:V,disabled:g,children:[e.jsx("option",{value:"all",children:"All actions"}),e.jsx("optgroup",{label:"Categories",children:l.operation_categories?.map(t=>e.jsx("option",{value:`category:${t}`,children:De[t]},t))}),e.jsx("option",{value:"specific",children:"Specific action"})]})]}),A==="specific"&&e.jsxs(F,{label:"Specific action",value:k,onChange:W,disabled:g,children:[e.jsx("option",{value:"",children:"Choose action"}),O.map(t=>e.jsxs("option",{value:t.operation_key,children:[t.connector_name,": ",t.name]},t.operation_key))]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx(he,{options:Pe,value:Z,floor:"auto",compact:!0,disabled:g,ariaLabel:"New rule decision",onChange:E}),e.jsx(Ve,{onCancel:()=>L(!1),cancelDisabled:g,children:e.jsx(C,{type:"submit",disabled:g||A==="specific"&&!k,children:g?"Saving…":"Save rule"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Saving an existing scope replaces its decision. Removing a rule reveals the next matching rule."})]}),re.length?ye(re):!I&&e.jsx(He,{icon:Ue,title:"No saved rules in this scope",description:"Add a rule for all actions, a category, or a specific action.",actionLabel:"Add rule",onAction:fe})]}),D&&e.jsx("p",{role:"alert",className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:D}),e.jsxs("details",{className:"space-y-3 border-t pt-4",children:[e.jsx("summary",{className:"cursor-pointer text-sm font-medium",children:"Check an action"}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs(F,{label:"Check connection",value:R,onChange:t=>{X(t),Q("")},children:[e.jsx("option",{value:"",children:"Choose connection"}),l.connections?.map(t=>e.jsxs("option",{value:String(t.id),children:[t.display_name||t.connector_key," (#",t.id,")"]},t.id))]}),e.jsxs(F,{label:"Check action",value:U,onChange:Q,disabled:!R,children:[e.jsx("option",{value:"",children:"Choose action"}),ae.map(t=>e.jsx("option",{value:t.operation_key.slice(t.connector_key.length+2),children:t.name},t.operation_key))]})]}),w.error?e.jsxs("p",{role:"alert",className:"text-sm text-destructive",children:["Could not check policy. ",String(w.error)]}):e.jsx("p",{"aria-live":"polite",className:"text-sm",children:U?w.isPending?"Checking…":w.data?e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:Ge[w.data.effect]})," ·"," ",ks[w.data.reason]??"The server evaluated this action.",w.data.rule_ids.length>0?` · Rules ${w.data.rule_ids.map(t=>`#${t}`).join(", ")}`:""]}):"":""})]})]})}const zs=[{action:"create_type",label:"Create entity types",description:"Add a new type and its initial fields."},{action:"update_type",label:"Edit entity types",description:"Change fields, write rules, event kinds, or type metadata."},{action:"delete_type",label:"Delete entity types",description:"Remove an entity-type definition."}],Ps=[{action:"create_relationship_type",label:"Create relationship types",description:"Add a new kind of link between entity types."},{action:"update_relationship_type",label:"Edit relationship types",description:"Change a definition, or which types it may connect."},{action:"delete_relationship_type",label:"Delete relationship types",description:"Remove a relationship-type definition."}];function xe(s){return s.resource_class==="entity_schema"&&s.principal_kind===null&&s.entity_type_slug===null&&s.operation_key===null&&s.target_agent_id===null}function $s(s){return s.agent.find(xe)}function Es(s,n){return{...s,agent:[...s.agent.filter(o=>!xe(o)),n]}}function Ts(s){return{...s,agent:s.agent.filter(n=>!xe(n))}}function Rs({label:s,description:n,action:o,value:r,pending:h,onChange:c}){return e.jsxs(We,{controls:e.jsx(he,{options:as("entity_schema",o),value:r,floor:"auto",disabled:h,compact:!0,ariaLabel:s,onChange:c}),children:[e.jsx("p",{children:s}),e.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:n})]})}function Re({title:s,actions:n,effects:o,pending:r,onChange:h}){return e.jsxs("section",{className:"space-y-2",children:[e.jsx("h3",{className:"text-sm font-medium",children:s}),e.jsx("div",{className:"divide-y overflow-hidden rounded-lg border",children:n.map(({action:c,label:b,description:y})=>e.jsx(Rs,{action:c,label:b,description:y,value:o[c]??me.entity_schema[c]??"deny",pending:r,onChange:l=>h(c,l)},c))})]})}function Fs({owner:s}){const n=ge(),o=es(s),r=Ie(s),h=ve({mutationFn:m=>ss(s,{resource_class:"entity_schema",effects:m}),onSuccess:m=>{n.setQueryData(o,i=>i&&Es(i,m)),n.invalidateQueries({queryKey:o})},onError:m=>{ie.error(m instanceof Error?m.message:"Failed to save schema policy")}}),c=ve({mutationFn:()=>ts(s,{resource_class:"entity_schema"}),onSuccess:()=>{n.setQueryData(o,m=>m&&Ts(m)),n.invalidateQueries({queryKey:o})},onError:m=>{ie.error(m instanceof Error?m.message:"Failed to reset schema policy")}});if(r.isLoading)return e.jsx(J,{label:"schema policy",variant:"cards",cards:1});if(r.isError||!r.data)return e.jsx(ns,{label:"schema policy"});const b=$s(r.data),y=b?.effects??me.entity_schema,l=h.isPending||c.isPending,u=(m,i)=>{h.mutate({...b?.effects??me.entity_schema,[m]:i})};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:b?"Custom policy":"Workspace defaults"}),b?e.jsxs(C,{type:"button",variant:"outline",size:"sm",disabled:l,onClick:()=>c.mutate(),children:[e.jsx(is,{className:"mr-1.5 h-3.5 w-3.5"}),"Remove custom policy"]}):null]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(Re,{title:"Entity types",actions:zs,effects:y,pending:l,onChange:u}),e.jsx(Re,{title:"Relationship types",actions:Ps,effects:y,pending:l,onChange:u})]})]})}function Fe(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Is(s,n,o){const r=s.split("/");return r[1]===n?(r[1]=o,r.join("/")||"/"):`/${o}`}function Ls({section:s}){return s==="policies"?e.jsx(J,{label:"policies",rows:2}):s==="governance"?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-sm font-medium",children:"Agent write defaults"}),e.jsx(J,{label:"agent write defaults",variant:"table",rows:3})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-sm font-medium",children:"Schema governance"}),e.jsx(J,{label:"schema governance",rows:3})]})]}):e.jsxs("div",{role:"status","aria-label":"Loading general settings","aria-busy":"true",className:"space-y-6",children:[e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-base font-semibold leading-none",children:"Identity"}),e.jsxs("div",{"aria-hidden":"true",className:"space-y-4",children:[["name","slug"].map(n=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(z,{className:"h-3.5 w-12 rounded-none"}),e.jsx("div",{className:"flex h-9 items-center border border-input bg-background px-3",children:e.jsx(z,{className:"h-4 w-32 rounded-none"})})]},n)),e.jsx(z,{className:"h-3 w-4/5 rounded-none"})]})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold leading-none",children:"Workspace visibility"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Choose who can browse this workspace and its public pages."})]}),e.jsx("div",{"aria-hidden":"true",className:"grid gap-2 sm:grid-cols-2",children:["private","public"].map(n=>e.jsxs("div",{className:"flex items-start gap-3 rounded-lg border p-3",children:[e.jsx(z,{className:"mt-0.5 h-4 w-4 shrink-0 rounded-none"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(z,{className:"h-4 w-16 rounded-none"}),e.jsx(z,{className:"h-3 w-full rounded-none"}),e.jsx(z,{className:"h-3 w-2/3 rounded-none"})]})]},n))})]}),e.jsxs("div",{"aria-hidden":"true",className:"flex justify-end gap-2",children:[e.jsx(z,{className:"h-9 w-20 rounded-none"}),e.jsx(z,{className:"h-9 w-28 rounded-none"})]})]})}function Ws({owner:s,section:n="general",connector:o,connection:r,agent:h}){const c=os(),b=ge(),{data:y,error:l}=Le(),{activeOrg:u,urlOrgSlug:m}=rs(),i=(y??[]).find(a=>a.slug===s&&a.is_member)??null,P=i?.id??s,_=cs(P,{name:i?.name??"",slug:i?.slug??"",visibility:i?.visibility??"private"}),[M,Y]=_.field("name"),[I,L]=_.field("slug"),[k,W]=_.field("visibility"),[A,V]=ne(P,!!i),[Z,E]=ne(P,!1),[g,S]=ne(P,null),[D,T]=j.useState(!1),[H,X]=j.useState(!1),[U,Q]=ne(P,!1);if(ls(l)&&y===void 0)return e.jsxs(we,{role:"alert",children:[e.jsx(Ae,{children:e.jsx(Oe,{children:"Couldn't load organizations"})}),e.jsx(ze,{children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Please try again in a moment."})})]});if(y===void 0)return e.jsx(Ls,{section:n});if(!i)return e.jsxs(we,{children:[e.jsx(Ae,{children:e.jsx(Oe,{children:"Organization not found"})}),e.jsx(ze,{children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:["You aren't a member of an organization at"," ",e.jsx("span",{className:"font-mono",children:s}),", or it has been deleted."]})})]});if(n==="policies")return e.jsx("div",{className:"space-y-6",children:e.jsxs("section",{id:"policies",className:"scroll-mt-6 space-y-4",children:[e.jsx("div",{className:"space-y-1",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Control connector actions across the organization. Changes to existing rules save automatically."})}),e.jsx(Os,{owner:s,connector:o,connection:r,agent:h},`${s}:${h??""}:${o??""}:${r??""}`)]})});if(n==="governance")return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{className:"text-sm font-medium",children:"Agent write defaults"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Set the defaults agents inherit for entities and agents. Changes save automatically; agents can only tighten them."})]}),e.jsx(_s,{owner:s,variant:"org-floor"})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h2",{className:"text-sm font-medium",children:"Schema governance"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Control structural changes by agents and connected AI clients. Changes save automatically."})]}),e.jsx(Fs,{owner:s})]})]});const R=a=>{const p=xs(a);if(p.kind==="cross-host"){window.location.assign(p.href);return}c({to:p.to})},w=a=>{if(a==="public"&&i.visibility!=="public"){E(!0);return}W(a),E(!1)},G=async()=>{if(!_.canSubmit)return;const a=M.trim();if(!a){S("Name is required");return}const p=I.trim()||Fe(a);if(!p){S("Slug is required");return}T(!0),S(null);try{const N=a!==i.name||p!==i.slug,$=k!==i.visibility;let x=i.slug;if(N){const O=await le.update({organizationId:i.id,data:{name:a,slug:p}});if(O.error){S(O.error.message||"Failed to update organization");return}x=O.data?.slug??p}$&&(x=(await ps(x,k)).slug),(N||$)&&(_.accept(_.values,{name:a,slug:x,visibility:k}),await b.invalidateQueries({queryKey:["organizations"]}),ie.success("Organization updated"));const B=u?.id===i.id||m===i.slug,ee=x!==i.slug;if(B&&ee){const O=_e(),se=ke();if(O===i.slug&&se){const oe=gs(window.location.pathname,i.slug)||"/",te=`${window.location.protocol}//${x}.${se}${oe}${window.location.search}${window.location.hash}`;window.location.assign(te);return}const ae=Is(window.location.pathname,i.slug,x);c({to:`${ae}${window.location.search}${window.location.hash}`});return}}catch(N){S(N instanceof Error?N.message:"Failed to update organization")}finally{T(!1)}},q=async()=>{X(!0),S(null);try{const a=await le.delete({organizationId:i.id});if(a.error){S(a.error.message||"Failed to delete organization");return}await b.invalidateQueries({queryKey:["organizations"]}),ie.success("Organization deleted");const N=(y??[]).filter(x=>x.is_member).find(x=>x.id!==i.id)??null,$=u?.id===i.id||m===i.slug;if($&&N){await le.setActive({organizationId:N.id}),R(N.slug);return}if($){const x=_e(),B=ke();if(x===i.slug&&B){window.location.assign(`${window.location.protocol}//app.${B}/`);return}c({to:"/"});return}c({to:"/"})}catch(a){S(a instanceof Error?a.message:"Failed to delete organization")}finally{X(!1),Q(!1)}},v=D||H;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-base font-semibold leading-none",children:"Identity"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(je,{htmlFor:"org-name",children:"Name"}),e.jsx(Ne,{id:"org-name",value:M,onChange:a=>{Y(a.target.value),A||L(Fe(a.target.value))},placeholder:"e.g. My Team",disabled:v})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(je,{htmlFor:"org-slug",children:"Slug"}),e.jsx(Ne,{id:"org-slug",value:I,onChange:a=>{V(!0),L(a.target.value)},placeholder:"e.g. my-team",disabled:v}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Changing the slug rewrites this workspace's URL. Existing links to"," ",e.jsxs("span",{className:"font-mono",children:["/",i.slug]})," redirect for a grace period."]})]})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold leading-none",children:"Workspace visibility"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Choose who can browse this workspace and its public pages."})]}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[e.jsxs("button",{type:"button",onClick:()=>w("private"),disabled:v,className:`flex items-start gap-3 rounded-lg border p-3 text-left transition-colors ${k==="private"?"border-primary bg-primary/5":"border-border hover:bg-muted/40"}`,children:[e.jsx(ds,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium",children:"Private"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Only members can access this workspace."})]})]}),e.jsxs("button",{type:"button",onClick:()=>w("public"),disabled:v,className:`flex items-start gap-3 rounded-lg border p-3 text-left transition-colors ${k==="public"?"border-primary bg-primary/5":"border-border hover:bg-muted/40"}`,children:[e.jsx(us,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium",children:"Public"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Anyone can browse public pages for this workspace."})]})]})]}),Z&&e.jsxs("div",{className:"rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm",children:[e.jsx("p",{className:"text-foreground",children:"Make this workspace public? Catalog-style content may become visible outside the membership."}),e.jsxs("div",{className:"mt-2 flex gap-2",children:[e.jsx(C,{type:"button",size:"sm",onClick:()=>{W("public"),E(!1)},disabled:v,children:"Confirm public"}),e.jsx(C,{type:"button",size:"sm",variant:"ghost",onClick:()=>E(!1),disabled:v,children:"Cancel"})]})]})]}),g&&e.jsx("div",{className:"rounded-md bg-destructive/10 px-3 py-2 text-sm text-destructive",children:g}),e.jsx(ms,{visible:_.hasConflict,onReload:_.reset}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx(C,{variant:"outline",onClick:()=>void c({to:`/${s}`}),disabled:v,children:"Cancel"}),e.jsxs(C,{onClick:G,disabled:v||!_.canSubmit,children:[D?e.jsx(Ce,{size:"lg",className:"mr-1.5"}):null,D?"Saving...":"Save changes"]})]}),e.jsxs("div",{className:"rounded-lg border border-destructive/30 bg-destructive/5 p-4",children:[e.jsx("p",{className:"text-sm font-medium",children:i.is_personal?"Personal workspace":"Delete this organization"}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:i.is_personal?"Your personal workspace can't be deleted — your devices and personal connections are bound to it.":"Permanently removes the organization and all members' workspace access. This cannot be undone."}),!i.is_personal&&e.jsx("div",{className:"mt-3",children:U?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(C,{variant:"destructive",size:"sm",onClick:q,disabled:v,children:[H?e.jsx(Ce,{className:"mr-1.5"}):null,"Confirm delete"]}),e.jsx(C,{variant:"ghost",size:"sm",onClick:()=>Q(!1),disabled:v,children:"Cancel"})]}):e.jsxs(C,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>Q(!0),disabled:v,children:[e.jsx(hs,{className:"mr-1.5 h-3.5 w-3.5"}),"Delete organization"]})})]})]})}function Bs(){const{owner:s}=Se.useParams(),n=Se.useSearch(),{hash:o}=fs(),r=ys(n,o),h={general:"General",policies:"Policies",governance:"Governance"}[r],{data:c}=Le(),b=(c??[]).find(y=>y.slug===s&&y.is_member)?.name;return e.jsx(bs,{className:"pt-2.5 pb-8",children:e.jsxs(vs,{className:Ns("flex flex-1 flex-col gap-6",Cs(r)),children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(js,{className:"h-7 w-7"}),e.jsx("h1",{className:"text-3xl font-semibold leading-tight",children:h})]}),b?e.jsx("p",{className:"text-base font-medium text-foreground",children:b}):null]}),e.jsx(Ws,{owner:s,...n,section:r})]})})}export{Bs as component};
2
+ //# sourceMappingURL=organization-B9U1L-56.js.map
@@ -0,0 +1,2 @@
1
+ import{j as e,dw as H,js as A,jt as V,ju as z,jv as q,jw as U,r as f,hA as G,u as C,aB as W,aH as Q,S as b,iM as Y,B as N,jx as Z,jy as R,jz as J,d3 as X,o as S,aq as D,cm as F,ab as I,eI as ee,v as te,l as se,fS as ne,w as re,L as $,jA as ie,fA as oe,fV as ae,fO as ce,jB as le,g1 as E,cz as de,az as ue,jC as me,at as pe,k as xe,jD as he,cP as fe,ec as ye,cQ as ge,p as je,gy as ve,eC as Ne,jE as we,ek as be,jF as ke,eH as Ae,a0 as Ce,jG as Se}from"./index-BjcZVe7n.js";import{u as Ie,A as Pe}from"./automation-detail-content-Bs3vwAPd.js";import{A as Le}from"./agent-loading-shells-_18OREnx.js";import{s as _e,h as Re,R as Te,A as $e}from"./agent-thread-FyEO-y44.js";import{C as Ee,b as Oe,A as ze}from"./connection-feed-detail-Ckq-qEbD.js";import{O as De}from"./connect-menu-CezOH3s7.js";import{a as Fe}from"./connections-browser-BXsJqieG.js";import{f as Be}from"./connector-scope-lists-dQnZARCD.js";import{S as Me}from"./source-record-panels-m8gECt82.js";import{E as T}from"./events-feed-CGzA1w3R.js";import{S as Ke}from"./schema-type-editor-panel-v3nR2Oa2.js";import{c as He,s as Ve,k as qe}from"./renderer-CHPS-1vD.js";import{E as Ue}from"./event-detail-CmC-DVrK.js";import{V as Ge,R as We}from"./views-access-required-CZ1fvAks.js";import{R as Qe,b as Ye}from"./event-card-CjA_dLzq.js";import{V as Ze,a as Je}from"./view-param-filters-CDvwie_f.js";import{S as Xe,g as et}from"./runs-table-CYS1jDdL.js";import{R as tt}from"./runs-panel-BwTVaRsE.js";import{b as st}from"./use-automations-D9hKpufo.js";import{b as nt}from"./model-C2q7WDcS.js";import"./create-automation-form-C9PMX7N8.js";import"./entity-options-BkU_En_f.js";import"./connection-label-BobuYiAG.js";import"./model-selector-B2cjCn0V.js";import"./skill-editor-D_W3QlRz.js";import"./json-diff-DtZtra_g.js";import"./index-Vcq4gwWv.js";import"./use-mention-search-CJGCatFS.js";import"./automation-source-list-Dhucq1sI.js";import"./proposal-review-shell-BED-DO9C.js";import"./runs-BntGAKQG.js";import"./definition-comparison-B5WgZILB.js";import"./schema-value-BFb7jCBo.js";import"./app-bridge-C4nPtae3.js";import"./pending-seed-BP3xHM2d.js";import"./feed-event-kinds-BYuZCoU4.js";import"./status-dot-BnQPFrcU.js";import"./client-activity-scopes-BD2HBo-_.js";import"./client-rows-x_CxeWkP.js";import"./use-scroll-sentinel-BWCrmNIB.js";import"./entity-type-page-D0ghgRgq.js";import"./change-summary-DeuXQEpb.js";import"./card-g4yxo4Hr.js";import"./table-DALHuXPE.js";import"./dynamic-schema-form-qWSRtOAv.js";import"./filter-bar-CQ_oE7a9.js";import"./record-session-DOFgdd43.js";import"./run-initiator-CCxNv0rK.js";import"./clients-Cmp0LmOp.js";import"./copy-button-Ddf7lBjZ.js";import"./agent-list-row-BnP6r4pm.js";import"./automation-row-B5Q1B10y.js";import"./manage-gear-C-0BAMbC.js";function rt(t){if(!t||typeof t!="object")return[];const n=t.properties;if(!n)return[];const s=Array.isArray(t.required)?new Set(t.required.map(String)):new Set;return Object.entries(n).map(([r,i])=>({name:r,type:String(i.type??"any"),required:s.has(r),description:typeof i.description=="string"?i.description:void 0}))}function it({fields:t}){return t.length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:"No fields."}):e.jsx("ul",{className:"space-y-2",children:t.map(n=>e.jsxs("li",{className:"space-y-0.5",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-2",children:[e.jsx("code",{className:"text-xs font-medium text-foreground",children:n.name}),e.jsx("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground/70",children:n.type}),n.required?e.jsx("span",{className:"text-[10px] font-medium text-amber-600 dark:text-amber-400",children:"required"}):null]}),n.description?e.jsx("p",{className:"text-xs text-muted-foreground",children:n.description}):null]},n.name))})}function P({item:t,hideHeading:n=!1}){const s=t.schemaSections;return s?e.jsxs("article",{className:n?"space-y-4":"space-y-4 px-5 py-5",children:[!n&&e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(H,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[e.jsx("h2",{className:"text-base font-medium text-foreground",children:t.title}),s.description?e.jsx("p",{className:"text-xs text-muted-foreground",children:s.description}):null]})]}),s.sections.map(r=>{const i=rt(r.schema);return e.jsxs("section",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("h3",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:r.title}),r.description?e.jsx("span",{className:"truncate text-xs text-muted-foreground",children:r.description}):null]}),e.jsx(it,{fields:i})]},r.title)})]}):null}function ot({actions:t}){const n=Object.entries(t).map(([s,r])=>{const i=r;return{id:s,name:i.name??s,description:i.description,action:i}});return e.jsx(A,{entries:n,label:"actions",renderDetail:({name:s,action:r})=>e.jsx(P,{hideHeading:!0,item:{href:"",title:s,schemaSections:z(r)}})})}function at({feeds:t}){const n=Object.entries(t).map(([s,r])=>{const i=r;return{id:s,name:i.name??s,description:i.description,feed:i}});return e.jsx(A,{entries:n,label:"feed types",renderDetail:({name:s,feed:r})=>e.jsx(P,{hideHeading:!0,item:{href:"",title:s,schemaSections:V(r)}})})}function ct(t){const n=[];return t.forEach((s,r)=>{n.push({id:`sep:${s.runId}`,role:"system",parts:[{type:"text",text:lt(s,r)}],createdAt:s.completedAt?new Date(s.completedAt).getTime():void 0});for(const i of s.messages)n.push({...i,id:`r${s.runId}:${i.id}`})}),n}function lt(t,n){const s=(t.pendingActionCount??0)>0?`Waiting for you (${t.pendingActionCount})`:t.status==="completed"?"Completed":t.status??"Completed",r=(t.autoAppliedCount??0)>0?` · ${t.autoAppliedCount} applied automatically`:"",i=t.completedAt?new Date(t.completedAt).toLocaleString():null;return i?`Run ${n+1} · ${s}${r} · ${i}`:`Run ${n+1} · ${s}${r}`}const B=Symbol("trusted-automation-interaction");function dt(t){return Object.defineProperty(t,B,{value:!0}),t}function ut(t){return{title:`${t} items waiting for you`,icon:"entity",impact:{level:"normal"},tone:"default",blocks:[{type:"text",value:"Review the individual proposals below, or decide the whole run at once.",muted:!0}],actions:[{id:"approve-all",label:"Approve all",variant:"primary",icon:"check",confirm:!0,confirmPrompt:`Approve all ${t} proposals?`,tool:"manage_operations",args:{action:"approve"},resolvedLabel:`Approved all ${t} proposals.`},{id:"reject-all",label:"Reject all",variant:"outline",icon:"x",confirm:!0,confirmPrompt:`Reject all ${t} proposals?`,tool:"manage_operations",args:{action:"reject"},resolvedLabel:`Rejected all ${t} proposals.`}]}}const mt=new Set(["automation-approval-batch"]);function pt(t){return new Promise(n=>{t({onSettled:(s,r)=>n(!!r)})})}function xt(){const t=q(),n=U();return f.useMemo(()=>({toolNames:mt,resolve:(s,r)=>{if(!r||typeof r!="object"||r[B]!==!0)return null;const i=r;if(s==="automation-approval-batch"){const o=typeof i.runId=="number"&&Number.isSafeInteger(i.runId)&&i.runId>0?i.runId:null,c=typeof i.count=="number"&&Number.isSafeInteger(i.count)&&i.count>1?i.count:null,a=Array.isArray(i.runIds)?i.runIds.filter(l=>typeof l=="number"&&Number.isSafeInteger(l)&&l>0):[];return o===null||c===null||a.length!==c||new Set(a).size!==c?null:{view:ut(c),handlers:{manage_operations:l=>l.action!=="approve"&&l.action!=="reject"?Promise.resolve(!0):pt(p=>l.action==="approve"?t.mutate({run_id:o,run_ids:a},p):n.mutate({run_id:o,run_ids:a},p))}}}return null}}),[t,n])}const ht=/(?:^|\n)Run this Automation now/;function ft(t){return t.role==="user"&&t.parts.some(n=>n.type==="text"&&ht.test(n.text))}function yt(t){return`history-interaction:${t.runId}:${t.eventId??"error"}`}function gt({agentId:t,automationId:n,ownerSlug:s,runId:r}){const{data:i,isLoading:o}=G(t,n,{orgSlug:s,...r!=null?{runId:r}:{}}),c=xt(),a=C(),l=f.useCallback(d=>{a?.open({href:`/${s}/automations/${n}?view=activity&run_id=${d}`,title:`Automation run #${d}`,runId:d})},[a,s,n]),p=f.useMemo(()=>{const d=i?.runs??[],j=(r!=null?d.filter(m=>m.runId===r):d).slice().reverse();return ct(j.map(m=>{const g=m.messages.map(u=>_e(u,{showToolCalls:!0})).filter(u=>u!==null&&!ft(u));m.task?.trim()&&g.unshift({id:"task",role:"user",parts:[{type:"text",text:m.task.trim()}]});const v=m.actions??[],h=v.filter(u=>u.status==="pending");if(h.length>1){const u=h.map(x=>x.runId).sort((x,k)=>x-k);g.push({id:"approval-batch",role:"assistant",parts:[{type:"tool-call",toolCallId:`approval-batch-${m.runId}`,toolName:"automation-approval-batch",args:dt({runId:m.runId,count:h.length,runIds:u})}]})}for(const u of v){const x=Re([u],{workspaceSlug:s,agentId:t,webOrigin:typeof window>"u"?null:window.location.origin});x&&g.push({...x,id:yt(u)})}return{runId:m.runId,completedAt:m.completedAt,status:m.status,pendingActionCount:m.pendingActionCount,autoAppliedCount:m.autoAppliedCount,messages:g}}))},[t,i,s,r]);return o?e.jsx(Le,{readOnly:!0}):p.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No run transcripts yet. Recent runs will show here when the Automation fires (failed runs appear with their prompt even without a full transcript)."}):e.jsx("div",{className:"flex h-[calc(100dvh-12rem)] min-h-[24rem] min-w-0 flex-1 flex-col",children:e.jsx(Te,{messages:p,workspaceSlug:s,children:e.jsx($e,{readOnly:!0,readerPositionMode:"runs",interactionExtension:c,onRunSelect:r==null&&a?l:void 0})})})}function jt({panel:t}){const n=W(t.organizationId),s=t.section==="connections"||!!t.connectionId,r=Q(t.organizationId,{connectorKey:t.connectorKey,connectionIds:t.connectionId?[t.connectionId]:void 0,enabled:s}),i=n.data?.find(c=>c.key===t.connectorKey),o=r.data?.find(c=>c.id===t.connectionId&&c.connector_key===t.connectorKey);return n.isLoading||s&&r.isLoading?e.jsx("div",{className:"p-5",children:e.jsx(b,{className:"h-28 w-full"})}):n.isError||s&&r.isError?e.jsx("p",{role:"alert",className:"p-5 text-sm",children:"Could not load this connector. Close the pane and try again."}):t.connectionId&&!o||!i&&!o&&t.section!=="connections"?e.jsx("p",{className:"p-5 text-sm",children:"This connection is no longer available."}):e.jsx("div",{className:"p-5",children:t.section==="connections"?e.jsx(Fe,{connections:r.data??[],connector:i,connectorKey:t.connectorKey,ownerSlug:t.ownerSlug}):o?e.jsx(wt,{connection:o,connector:i,panel:t}):i?t.section==="oauth-apps"?e.jsx(De,{connector:i,organizationId:t.organizationId,newApp:!!t.newApp}):t.section==="feeds"?e.jsx(vt,{connector:i}):i.installed===!1?e.jsx(Nt,{connector:i,ownerSlug:t.ownerSlug}):e.jsx(kt,{connector:i,ownerSlug:t.ownerSlug}):null},`${t.connectorKey}:${t.connectionId??"connector"}:${t.section}`)}function vt({connector:t}){return e.jsx(at,{feeds:t.feeds_schema??{}})}function Nt({connector:t,ownerSlug:n}){return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Policy depends on connection."," ",e.jsx(R,{ownerSlug:n,connectorKey:t.key})]}),e.jsx(ot,{actions:t.actions_schema??{}})]})}function wt({connection:t,connector:n,panel:s}){const[r,i]=f.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx("div",{hidden:r,children:s.section==="feeds"?e.jsx(bt,{connection:t,connector:n,ownerSlug:s.ownerSlug}):e.jsx(Y,{connection:t,ownerSlug:s.ownerSlug,inPeek:!0,onReviewPermissions:n?()=>i(!0):void 0})}),r&&n&&e.jsxs("div",{className:"space-y-4",children:[e.jsx(N,{variant:"ghost",size:"sm",onClick:()=>i(!1),children:"Back to actions"}),e.jsx("h2",{className:"text-base font-semibold",children:"Provider permissions"}),e.jsx(Z,{connection:t,connectorDef:n})]})]})}function bt({connection:t,connector:n,ownerSlug:s}){const{data:r=[],isLoading:i,isError:o}=X(t.id),[c,a]=f.useState(!1),l=t.facets?.chat??!1;if(i)return e.jsx(b,{className:"h-28 w-full"});if(o)return e.jsx("p",{role:"alert",children:"Could not load sources. Close the pane and try again."});const p=r.map(d=>({id:String(d.id),name:d.display_name||d.feed_key,status:Be(d)??(d.operations.includes("sync")?"Sync enabled":"Live access"),feed:d}));return e.jsxs(e.Fragment,{children:[e.jsx("div",{hidden:c,children:e.jsx(A,{entries:p,label:l?"channels":"feeds",action:Object.keys(n?.feeds_schema??{}).length>0?e.jsx(N,{size:"sm",variant:"outline",onClick:()=>a(!0),children:l?"Add channel":"Add feed"}):void 0,renderDetail:({feed:d})=>d.store==="channel_messages"?e.jsx(Ee,{feed:d,hideHeader:!0}):e.jsx(Oe,{feed:d,connectorDef:n,ownerSlug:s})})}),c&&n&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-base font-semibold",children:l?"Add channel":"Add feed"}),e.jsx(ze,{organizationId:t.organization_id,connections:[t],connectorDefinitions:[n],onClose:()=>a(!1)})]})]})}function kt({connector:t,ownerSlug:n}){const{data:s=[],isLoading:r,isError:i}=J(t.key);if(r)return e.jsx(b,{className:"h-28 w-full"});if(i)return e.jsx("p",{role:"alert",children:"Could not load actions. Close the pane and try again."});const o=t.actions_schema??{},c=s.map(a=>({id:a.operation_key,name:a.name??a.operation_key,description:a.description,operation:a}));return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Policy depends on connection. Click an action to inspect its inputs."," ",e.jsx(R,{ownerSlug:n,connectorKey:t.key})]}),e.jsx(A,{entries:c,label:"actions",renderControl:()=>e.jsx(R,{ownerSlug:n,connectorKey:t.key}),renderDetail:({operation:a,name:l})=>o[a.operation_key]?e.jsx(P,{hideHeading:!0,item:{href:"",title:l,schemaSections:z(o[a.operation_key])}}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"No input fields."})})]})}function At({owner:t,path:n}){const{data:s,isLoading:r}=S(t,{slug:t}),i=s?.workspace,o=i?.type==="organization"?i.id:null,c=o?{slug:t}:void 0,{data:a,isLoading:l}=D(`/${t}/${F(n)}`,c),p=a?.entity,d=p?.id;return r||l?e.jsxs("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:[e.jsx(I,{className:"mr-2"})," Loading…"]}):o?d==null?e.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Couldn't find this record. It may have been deleted, or it may live in a workspace you can't access."}):p?.is_derived?e.jsx(Me,{record:{type:p.entity_type,key:p.slug},orgContext:c}):e.jsx("div",{className:"px-4 py-4",children:e.jsx(T,{organizationId:o,ownerSlug:t,entityId:typeof d=="number"?d:void 0,filters:{sortBy:"date",sortOrder:"desc"},emptyState:e.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Nothing has happened to this record yet."})})}):e.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Couldn't resolve this workspace."})}function Ct(t){if(Array.isArray(t.enum))return`One of ${t.enum.length}`;if(t.format==="date"||t.format==="date-time")return"Date";if(t.format==="uri")return"Link";if(t.format==="email")return"Email";const n=Array.isArray(t.type)?t.type[0]:t.type;return n==="array"?"List":n==="object"?"Group":n==="integer"||n==="number"?"Number":n==="boolean"?"Yes / no":"Text"}function St({owner:t,typeSlug:n,view:s}){const{data:r,isLoading:i}=S(t,{slug:t}),o=r?.workspace,c=o?.type==="organization"?o.id:null,{isAdmin:a}=ee(c??void 0),{orgContext:l}=te(),{data:p,isSuccess:d}=se(l),y=(p??[]).find(w=>w.slug===n),j=d&&!y,m=`/${t}/${ne(n)}`,{pathname:g}=re(),v=g===m||g===`${m}/`||g.startsWith(`${m}/-/`),h=f.useMemo(()=>He(y?.metadata_schema),[y?.metadata_schema]),u=C(),x=u?.close;f.useEffect(()=>{j&&x?.()},[j,x]);const k=f.useMemo(()=>({entityTypes:[n],sortBy:"date",sortOrder:"desc"}),[n]);if(i)return e.jsxs("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:[e.jsx(I,{className:"mr-2"})," Loading…"]});if(j)return e.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"This entity type no longer exists."});if(!c)return e.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Couldn't resolve this workspace."});const K=y?.name??n;return e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-4 py-2.5",children:[v?null:e.jsx(N,{asChild:!0,variant:"outline",size:"sm",className:"h-8 text-xs",children:e.jsxs($,{...oe(t,n),children:[e.jsx(ie,{className:"mr-1.5 h-3.5 w-3.5"}),"Browse records"]})}),y&&!v&&!ae(y)&&y.entity_count!==0?e.jsx(N,{asChild:!0,variant:"outline",size:"sm",className:"h-8 text-xs",children:e.jsxs($,{to:"/$owner/$entityType/-/$shape",params:{owner:t,entityType:n,shape:"graph"},search:le(E(t,n)),children:[e.jsx(ce,{className:"mr-1.5 h-3.5 w-3.5"}),"Graph"]})}):null,s!=="activity"&&u?e.jsxs(N,{type:"button",variant:"ghost",size:"sm",className:"ml-auto h-8 gap-1.5 text-xs text-muted-foreground hover:text-foreground",onClick:()=>u.open({href:E(t,n,"activity"),title:`${K} activity`}),children:[e.jsx(de,{className:"h-3.5 w-3.5"}),"Activity"]}):null]}),s==="activity"?e.jsx("div",{className:"px-4 py-4",children:e.jsx(T,{organizationId:c,ownerSlug:t,filters:k,showEntityLinks:!0,emptyState:e.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Nothing has happened to these records yet."})})}):a?e.jsx("div",{className:"p-4",children:e.jsx(Ke,{slug:n,onClose:()=>x?.()})}):h.length>0?e.jsxs("section",{"aria-labelledby":"entity-type-peek-fields",className:"px-4 py-4",children:[e.jsx("h3",{id:"entity-type-peek-fields",className:"mb-1.5 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Fields"}),e.jsx("dl",{className:"divide-y divide-border/60 text-sm",children:h.map(w=>e.jsxs("div",{className:"flex items-baseline justify-between gap-3 py-1.5",title:w.prop.description,children:[e.jsx("dt",{className:"min-w-0 truncate",children:Ve(w)}),e.jsx("dd",{className:"shrink-0 text-xs text-muted-foreground",children:Ct(w.prop)})]},w.key))})]}):e.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"This type has no fields yet."})]})}function It({owner:t,eventId:n,viewKey:s}){const r=C(),i=(o,c)=>e.jsx(Ue,{owner:c,organizationId:o,eventId:n,viewKey:s,dense:!0,onSelectView:r?a=>r.retarget(a):void 0},`${c}/${n}/${s??""}`);return e.jsx("div",{className:"px-4 py-4",children:t==="me"?i(null,t):e.jsx(ue,{owner:t,children:({organizationId:o,ownerSlug:c})=>o?i(o,c):e.jsx("div",{className:"h-40 animate-pulse rounded-md bg-muted/40"})})})}function L({owner:t,runId:n,runIds:s,contentIds:r}){const{data:i,isLoading:o}=S(t==="me"?null:t,{slug:t}),c=i?.workspace,a=t!=="me"&&c?.type==="organization"?c.id:null,l=f.useMemo(()=>{if(t==="me")return r?.length?{contentIds:r,sortBy:"date",sortOrder:"desc"}:void 0;const d=s??(n!=null?[n]:void 0);if(!(!d?.length&&!r?.length))return{...d?.length?{runIds:d}:{},...r?.length?{contentIds:r}:{}}},[t,r,n,s]),p=l!=null;return t!=="me"&&o?e.jsxs("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:[e.jsx(I,{className:"mr-2"})," Loading…"]}):t!=="me"&&a==null?e.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Couldn't resolve this workspace."}):p?e.jsx("div",{className:"px-4 py-4",children:e.jsx(T,{presentation:"detail",organizationId:a,ownerSlug:t,filters:l,emptyState:e.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:n!=null||s?.length?"No matching events from this run yet.":"No matching events yet."})})}):e.jsx("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"Nothing to preview."})}const _=25;function Pt({target:t}){const[n,s]=f.useState(0),{data:r,isLoading:i,isError:o,refetch:c}=me(t.entityId,t.orgContext,{relationshipType:t.relationshipType,limit:_,offset:n}),a=r?.total;return e.jsxs("div",{className:"space-y-3 px-5 py-4",children:[e.jsxs("p",{className:"text-xs text-muted-foreground",children:[t.label," · ",t.entityName,a!==void 0?` · ${a} current ${a===1?"link":"links"}`:r?` · ${r.rows.length} shown`:""]}),e.jsx(Qe,{count:r?.failures?.length??0,onRetry:()=>void c()}),i?e.jsxs("div",{className:"space-y-2",children:[e.jsx(b,{className:"h-6 w-full"}),e.jsx(b,{className:"h-6 w-full"})]}):o||!r?e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Could not load these links."," ",e.jsx("button",{type:"button",className:"underline",onClick:()=>void c(),children:"Retry"})]}):r.rows.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No links on this page."}):e.jsx("ul",{className:"divide-y divide-border",children:r.rows.map(l=>e.jsx("li",{className:"flex items-center justify-between gap-3 py-1.5",children:e.jsx(Ye,{row:l,entityId:t.entityId,ownerSlug:t.ownerSlug,orgContext:t.orgContext})},l.id))}),r&&(n>0||r.hasMore)?e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(N,{type:"button",variant:"outline",size:"sm",disabled:n===0,onClick:()=>s(Math.max(0,n-_)),children:"Previous"}),e.jsxs("span",{className:"text-xs tabular-nums text-muted-foreground",children:[r.rows.length," shown",a===void 0?"":` of ${a}`]}),e.jsx(N,{type:"button",variant:"outline",size:"sm",disabled:!r.hasMore,onClick:()=>s(n+_),children:"Next"})]}):null]})}function Lt({owner:t,path:n,viewKey:s}){const[r,i]=f.useState({}),{data:o,isLoading:c}=S(t,{slug:t}),a=o?.workspace,l=a?.type==="organization"?a.id:null,p=l?{slug:t,organizationId:l}:void 0,{data:d,isLoading:y}=D(`/${t}/${F(n)}`,p),{isMember:j,isPublic:m,isLoading:g}=pe(t),v=j||m,h=xe({slug:t,organizationId:j?l:null}),u=d?.entity;if(c||y||g||v&&h.isLoading)return e.jsxs("div",{className:"flex items-center justify-center py-12 text-muted-foreground",children:[e.jsx(I,{className:"mr-2"})," Loading…"]});if(!v)return e.jsx(Ge,{});if(h.isError)return e.jsx(Ze,{onRetry:()=>void h.refetch()});const x=u?he(h.data??[],{type:u.entity_type,id:u.id??u.slug}).find(k=>k.key===s):void 0;return!l||!u||!x?e.jsx("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:"This view isn't attached to this record any more."}):e.jsx("div",{className:"px-4 py-4",children:e.jsx(Je,{orgSlug:t,viewKey:x.key,scope:{type:u.entity_type,entity:u.is_derived?u.slug:u.id??u.slug},params:r,onParamsChange:i,contentHash:x.content_hash,title:x.name,minHeight:320})})}function M({owner:t,runId:n}){const s=fe({queryKey:["run-outcome",t,n],queryFn:async()=>{const i=await ge("manage_operations",{action:"get_run",run_id:n},{slug:t});if(!i.run)throw new Error(i.error||"Run not found");return i.run},enabled:t!=="me",staleTime:15e3,refetchInterval:i=>["pending","claimed","running"].includes(i.state.data?.status??"")?5e3:!1});if(t==="me")return null;if(s.isLoading)return e.jsx("p",{role:"status",className:"px-4 pt-4 text-xs text-muted-foreground",children:"Loading run…"});if(!s.data)return e.jsx("p",{role:"alert",className:"px-4 pt-4 text-sm text-destructive",children:"Could not load this run."});const r=s.data;return e.jsxs("section",{"aria-label":"Run outcome",className:"space-y-2 border-b px-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(Xe,{status:et(r.status),children:r.status}),e.jsx("time",{dateTime:r.created_at,className:"text-xs text-muted-foreground",children:ye(r.created_at)})]}),r.connection_display_name?e.jsx("p",{className:"text-sm",children:r.connection_display_name}):null,r.error_message?e.jsx("p",{className:"whitespace-pre-wrap break-words text-sm text-destructive",children:r.error_message}):null,s.isError?e.jsx("p",{role:"alert",className:"text-xs text-destructive",children:"Could not refresh this run. Showing its last known outcome."}):null]})}function Rs({item:t}){const n=C();if(t.connectorPanel)return e.jsx(jt,{panel:t.connectorPanel});if(t.schemaSections)return e.jsx(P,{item:t});if(t.recordField)return e.jsx(We,{target:t.recordField});if(t.recordPeer)return e.jsx(qe,{target:t.recordPeer});if(t.recordLinks)return e.jsx(Pt,{target:t.recordLinks});if(typeof t.browserUrl=="string"&&t.browserUrl.length>0)return e.jsx(O,{item:t});const s=t.href?je(t.href):null;return s?s.kind==="runs"?e.jsx("section",{"aria-label":"Runs history",className:"p-4",children:e.jsx(tt,{scope:{workspace:!0},ownerSlug:s.owner,filterState:s.filters,onFilterChange:r=>n?.retarget(ve(s.owner,r))})}):s.kind==="memory"?"runId"in s?e.jsxs(e.Fragment,{children:[e.jsx(M,{owner:s.owner,runId:s.runId}),e.jsx(L,{owner:s.owner,runId:s.runId})]}):"runIds"in s?e.jsx(L,{owner:s.owner,runIds:s.runIds}):e.jsx(L,{owner:s.owner,contentIds:s.contentIds}):s.kind==="entity"?e.jsx(At,{owner:s.owner,path:s.path}):s.kind==="entity-type"?e.jsx(St,{owner:s.owner,typeSlug:s.typeSlug,view:s.view}):s.kind==="record-view"?e.jsx(Lt,{owner:s.owner,path:s.path,viewKey:s.viewKey}):s.kind==="event"?e.jsx(It,{owner:s.owner,eventId:s.eventId,viewKey:s.viewKey}):t.runId?e.jsx(_t,{owner:s.owner,automationId:s.automationId,runId:t.runId}):e.jsx(Rt,{owner:s.owner,automationId:s.automationId}):e.jsx(O,{item:t})}function O({item:t}){const n=t.body,s=t.notificationType??"generic",r=t.createdAt,i=t.browserUrl??null,o=t.browserHandoff??null;return e.jsxs("article",{className:"space-y-4 px-5 py-5",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Ne,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-0.5 text-xs text-muted-foreground",children:[e.jsx("span",{children:we(s)}),r?e.jsx("span",{children:be(r)}):null]})]}),n?e.jsx("div",{className:"text-sm leading-6 text-foreground/90",children:e.jsx(ke,{text:n,linkPolicy:s==="action_approval_needed"?"app-links":"strip"})}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"No additional details were provided."}),t.owner&&t.sourceAttribution?e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground/80",children:"Generated from"}),e.jsx(Ae,{owner:t.owner,source:t.sourceAttribution,className:"text-xs"})]}):null,i?e.jsx("div",{className:"space-y-2",children:o?.state==="expired"?e.jsx("p",{className:"text-sm text-amber-700 dark:text-amber-300",children:o.error_message??"This draft expired before the page was opened."}):o?.state==="completed"||o?.state==="preparing"?e.jsx("p",{className:"text-sm text-muted-foreground",children:o.state==="preparing"?"Preparing draft — keep your browser tab open.":"Draft prepared — review and post in your browser."}):e.jsxs(N,{type:"button",size:"sm",className:"h-8 text-sm",onClick:()=>{Se(i)},children:[e.jsx(Ce,{className:"mr-1.5 h-3.5 w-3.5"}),"Open post"]})}):null]})}function _t({owner:t,automationId:n,runId:s}){const{organizationId:r}=Ie(t),i=st(n,void 0,r),o=nt(i.data?.automation);return o?e.jsx(gt,{agentId:o,automationId:n,ownerSlug:t,runId:s}):i.isLoading?e.jsx(b,{className:"h-24 w-full rounded-lg"}):e.jsx(M,{owner:t,runId:s})}function Rt({owner:t,automationId:n}){return e.jsx(Pe,{owner:t,agentId:null,automationId:n,view:"activity",onDone:()=>{}})}export{Rs as PeekPaneContent};
2
+ //# sourceMappingURL=peek-pane-content-Cq8P38s3.js.map
@@ -1,2 +1,2 @@
1
- import{j as a,B as l,i as u}from"./index-DdBTTN3y.js";const c=({prompts:e,onPick:s,className:n})=>e.length===0?null:a.jsx("div",{className:u("flex flex-wrap gap-2",n),children:e.map(t=>a.jsx(l,{type:"button",variant:"outline",size:"sm",className:"h-auto rounded-full whitespace-normal px-3.5 py-1.5 text-left",title:t.message,"aria-label":`${t.title}: ${t.message}`,onClick:()=>s(t.message),children:t.title},`${t.title}\0${t.message}`))}),i=new Map;function d(e,s){const n=s.trim();n&&i.set(e,n)}function o(e){const s=i.get(e);return s===void 0?null:(i.delete(e),s)}export{c as P,d as s,o as t};
2
- //# sourceMappingURL=pending-seed-sml8Uf6e.js.map
1
+ import{j as a,B as l,i as u}from"./index-BjcZVe7n.js";const c=({prompts:e,onPick:s,className:n})=>e.length===0?null:a.jsx("div",{className:u("flex flex-wrap gap-2",n),children:e.map(t=>a.jsx(l,{type:"button",variant:"outline",size:"sm",className:"h-auto rounded-full whitespace-normal px-3.5 py-1.5 text-left",title:t.message,"aria-label":`${t.title}: ${t.message}`,onClick:()=>s(t.message),children:t.title},`${t.title}\0${t.message}`))}),i=new Map;function d(e,s){const n=s.trim();n&&i.set(e,n)}function o(e){const s=i.get(e);return s===void 0?null:(i.delete(e),s)}export{c as P,d as s,o as t};
2
+ //# sourceMappingURL=pending-seed-BP3xHM2d.js.map
@@ -1,2 +1,2 @@
1
- import{v as i,eP as r,j as e,j2 as c}from"./index-DdBTTN3y.js";import{A as m}from"./agent-permissions-matrix-bP1Qihv7.js";import{A as g,a as l}from"./agent-tab-intro-ednTs4WF.js";function x({owner:n,agentId:s}){const{orgContext:t}=i(),{isAdmin:a,isLoading:o}=r(t.organizationId);return e.jsx(g,{children:a?e.jsxs("div",{className:"space-y-4",children:[e.jsx(l,{description:"Control which data, agent settings, and connector actions this agent may use automatically, with approval, or not at all."}),e.jsx("div",{className:"overflow-x-auto",children:e.jsx(m,{owner:n,agentId:s})})]}):o?null:e.jsx("p",{className:"text-center text-sm text-muted-foreground",children:"Only organization admins can view or change agent permissions."})})}function h(){const{owner:n,agentId:s}=c.useParams();return e.jsx(x,{owner:n,agentId:s})}export{h as component};
2
- //# sourceMappingURL=permissions-BvA9SATv.js.map
1
+ import{v as i,eI as r,j as e,j3 as c}from"./index-BjcZVe7n.js";import{A as m}from"./agent-permissions-matrix-DSjidWHL.js";import{A as g,a as l}from"./agent-tab-intro-DKrC3SQt.js";function x({owner:n,agentId:s}){const{orgContext:t}=i(),{isAdmin:a,isLoading:o}=r(t.organizationId);return e.jsx(g,{children:a?e.jsxs("div",{className:"space-y-4",children:[e.jsx(l,{description:"Control which data, agent settings, and connector actions this agent may use automatically, with approval, or not at all."}),e.jsx("div",{className:"overflow-x-auto",children:e.jsx(m,{owner:n,agentId:s})})]}):o?null:e.jsx("p",{className:"text-center text-sm text-muted-foreground",children:"Only organization admins can view or change agent permissions."})})}function h(){const{owner:n,agentId:s}=c.useParams();return e.jsx(x,{owner:n,agentId:s})}export{h as component};
2
+ //# sourceMappingURL=permissions-BVlbeY4u.js.map
@@ -0,0 +1,2 @@
1
+ import{hB as f,h9 as w,ha as y,r as C,j as e,W as N,B as d,H as P,eL as k}from"./index-BjcZVe7n.js";import{a as A}from"./runs-BntGAKQG.js";function L({resource:g,runId:r,children:h,onDone:l}){const c=!!r,{data:a,isLoading:E,isError:u,refetch:v}=A(g,c?r:void 0),s=f({isReview:c,isError:u,status:a?.status}),m=a?.status==="pending"?a.proposal:null,n=w(),i=y(),[p,x]=C.useState(""),o=n.isPending||i.isPending,j=s==="active"||s==="loading"||s==="error",b=()=>{r&&n.mutate({run_id:r},{onSuccess:()=>l?.()})},R=()=>{if(!r)return;const t=p.trim();i.mutate({run_id:r,...t?{reason:t}:{}},{onSuccess:()=>l?.()})};return e.jsxs("div",{className:"grid content-start gap-4",children:[s==="active"?e.jsx("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-3 text-sm text-amber-950 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-100",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(N,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsxs("p",{children:["Review the change the builder agent proposed. Compare Current and Proposed, then ",e.jsx("strong",{children:"Approve"})," to apply, or"," ",e.jsx("strong",{children:"Reject"}),"."]})]})}):null,s==="gone"?e.jsx("div",{className:"rounded-lg border bg-muted/30 p-3 text-sm text-muted-foreground",children:"This change is no longer pending (it may have been approved or rejected already)."}):null,s==="error"?e.jsx("div",{className:"rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx("p",{className:"text-destructive",children:"Couldn't load the proposed change to review. Editing is disabled until it loads — retry, or reopen the link."}),e.jsx(d,{type:"button",variant:"outline",size:"sm",onClick:()=>void v(),children:"Retry"})]})}):null,h({reviewMode:s,proposal:m,controlsDisabled:j}),s==="active"?e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(P,{htmlFor:"review-reject-reason",children:"Reason (optional)"}),e.jsx(k,{id:"review-reject-reason",rows:2,value:p,onChange:t=>x(t.target.value),placeholder:"Why you're rejecting — shared back to the requester.",disabled:o})]}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:justify-end",children:[e.jsx(d,{type:"button",variant:"outline",onClick:R,disabled:o,children:i.isPending?"Rejecting...":"Reject"}),e.jsx(d,{type:"button",onClick:b,disabled:o,children:n.isPending?"Approving...":"Approve"})]})]}):null]})}export{L as P};
2
+ //# sourceMappingURL=proposal-review-shell-BED-DO9C.js.map
@@ -0,0 +1,2 @@
1
+ import{r as e,dA as l}from"./index-BjcZVe7n.js";function a(){return e.useEffect(()=>{l()},[]),null}export{a as P};
2
+ //# sourceMappingURL=public-shell-ready-Diq15_QW.js.map