@openhands/agent-canvas 1.8.0 → 1.9.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 (492) hide show
  1. package/README.md +1 -1
  2. package/README.windows.md +2 -2
  3. package/build/assets/{Trans-B7lYw4uD.js → Trans-Bwpzk1wT.js} +1 -1
  4. package/build/assets/{acp-providers-WUD4tfSq.js → acp-providers-C921BlYB.js} +1 -1
  5. package/build/assets/active-backend-context-BiwzkzDy.js +2 -0
  6. package/build/assets/agent-context-settings-DXNT_dcw.js +1 -0
  7. package/build/assets/agent-profiles-settings-BymJf3EP.js +1 -0
  8. package/build/assets/agent-server-conversation-service.api-CYSWw-2g.js +41 -0
  9. package/build/assets/agent-settings-BjgQQe-_.js +1 -0
  10. package/build/assets/{agent-settings-BGTyoT6X.js → agent-settings-WzqXk6B4.js} +2 -2
  11. package/build/assets/{alert-banner-eRyIwDyU.js → alert-banner-DR8EVyZM.js} +1 -1
  12. package/build/assets/api-error-message-e16L1kwH.js +1 -0
  13. package/build/assets/{api-key-entry-screen-JOx3SH1-.js → api-key-entry-screen-DI0I04O3.js} +1 -1
  14. package/build/assets/{app-settings-D53QZy5p.js → app-settings-DGistSFV.js} +1 -1
  15. package/build/assets/automation-C_eCrGyP.js +1 -0
  16. package/build/assets/automation-detail-DY6x2FW1.js +2 -0
  17. package/build/assets/automation-export-C09f-Lua.js +2 -0
  18. package/build/assets/automation-setup-route-CqKp0717.js +1 -0
  19. package/build/assets/automations-list-CqWJ7qXW.js +1 -0
  20. package/build/assets/{back-nav-button-C02hGa8t.js → back-nav-button-D4ngzpSh.js} +1 -1
  21. package/build/assets/backend-form-modal-B8D5hBzK.js +1 -0
  22. package/build/assets/{backend-synced-settings-badge-CQ9xtNWm.js → backend-synced-settings-badge-BnzI8Ysj.js} +1 -1
  23. package/build/assets/{badge-CzXbf7tR.js → badge-1Mf1iPcX.js} +1 -1
  24. package/build/assets/{base-modal-DkVyzFMt.js → base-modal-BBuy0WQQ.js} +1 -1
  25. package/build/assets/{brand-button-BUlDL-mz.js → brand-button-DGN6Y9o6.js} +1 -1
  26. package/build/assets/browser-D_ekTlTS.js +6 -0
  27. package/build/assets/{browser-tab-BijpUbdt.js → browser-tab-D4a4Ou_w.js} +1 -1
  28. package/build/assets/{chat-send-button-BKsVjhtA.js → chat-send-button-CgbcjD97.js} +1 -1
  29. package/build/assets/check-CPLXgluF.js +1 -0
  30. package/build/assets/chevron-down-CP4QHvyc.js +1 -0
  31. package/build/assets/circle-check-Dpy2_xSI.js +1 -0
  32. package/build/assets/{circle-plus-check-toggle-DdjUiOo1.js → circle-plus-check-toggle-yTAS-nX3.js} +1 -1
  33. package/build/assets/cloud-funnel-analytics-CEOl5Gxr.js +1 -0
  34. package/build/assets/{combobox-caret-Dl9UtvD6.js → combobox-caret-Bd2yySnF.js} +1 -1
  35. package/build/assets/command-menu-Bj6X4ckE.js +1 -0
  36. package/build/assets/condenser-settings-EAXQNR2E.js +1 -0
  37. package/build/assets/{confirmation-modal-CRBJSllP.js → confirmation-modal-NCUPr2-O.js} +1 -1
  38. package/build/assets/{context-menu-list-item-FGaafXGh.js → context-menu-list-item-CrCrYuPF.js} +1 -1
  39. package/build/assets/conversation-BzyIcSwr.js +1 -0
  40. package/build/assets/conversation-CUJ0Vo8g.js +90 -0
  41. package/build/assets/conversation-panel-BzyIcSwr.js +1 -0
  42. package/build/assets/conversation-state-store-F62HvuI1.js +1 -0
  43. package/build/assets/{conversation-tab-empty-state-CDjvNgpG.js → conversation-tab-empty-state-BCZ7rUMH.js} +1 -1
  44. package/build/assets/{copy-Drwu97Gx.js → copy-DCmZtz6n.js} +1 -1
  45. package/build/assets/{copy-to-clipboard-button-NbN1clVr.js → copy-to-clipboard-button-D_Lp6-Fl.js} +1 -1
  46. package/build/assets/{device-verify-CDm_WrVu.js → device-verify-DLmolX8Q.js} +1 -1
  47. package/build/assets/{dropdown-classes-CqA2BTCL.js → dropdown-classes-BB8rzqXL.js} +1 -1
  48. package/build/assets/{entry.client-BO2KQj0y.js → entry.client-BbIYOsIg.js} +2 -2
  49. package/build/assets/{enum-filter-dropdown-DSqPZnsD.js → enum-filter-dropdown-C08-srev.js} +1 -1
  50. package/build/assets/{environment-switch-overlay-mGl2pqqx.js → environment-switch-overlay-BepBBX66.js} +1 -1
  51. package/build/assets/{extensions-hub-Br3Lgynp.js → extensions-hub-R3KNv-5V.js} +1 -1
  52. package/build/assets/{extensions-navigation-BQmstKDZ.js → extensions-navigation-CfWFmI1I.js} +1 -1
  53. package/build/assets/{external-link-D9B2QMPf.js → external-link-BdBSg8rk.js} +1 -1
  54. package/build/assets/files-tab-DEq8MbHu.js +1 -0
  55. package/build/assets/{form-control-classes-CtVAktAy.js → form-control-classes-DAfsCJTe.js} +1 -1
  56. package/build/assets/{format-time-delta-DICE64sz.js → format-time-delta-CxfPJpzC.js} +1 -1
  57. package/build/assets/git-provider-icon-BZqqUPlm.js +1 -0
  58. package/build/assets/git-repo-dropdown-9WKINV6J.js +1 -0
  59. package/build/assets/git-repo-dropdown-DEpOwUez.js +1 -0
  60. package/build/assets/{highlighted-source-view-KMsA9c4a.js → highlighted-source-view-CX9oIoVT.js} +1 -1
  61. package/build/assets/home-CY0JaxiY.js +1 -0
  62. package/build/assets/home-CaNWlVvB.js +1 -0
  63. package/build/assets/home-store-Ch1ErdBc.js +1 -0
  64. package/build/assets/index-home-CaNWlVvB.js +1 -0
  65. package/build/assets/info-CmWQXtRQ.js +1 -0
  66. package/build/assets/install-server-modal-BWrudmZU.js +1 -0
  67. package/build/assets/{launch-DjkKw55l.js → launch-B1POpHuP.js} +1 -1
  68. package/build/assets/{list-todo-BpAf7aOT.js → list-todo-DtiL3lTp.js} +1 -1
  69. package/build/assets/llm-not-configured-banner-3tMsM4K6.js +27 -0
  70. package/build/assets/{llm-settings-D8zNkIlP.js → llm-settings-CXo8iPNW.js} +1 -1
  71. package/build/assets/llm-settings-D0W8mJDk.js +1 -0
  72. package/build/assets/{llm-subscription-service-COTgZc1C.js → llm-subscription-service-DBJbfd8Z.js} +1 -1
  73. package/build/assets/loader-circle-B4QDBARx.js +1 -0
  74. package/build/assets/{loading-spinner-DRFyh6Iy.js → loading-spinner-DfZ_bhV7.js} +1 -1
  75. package/build/assets/{manage-backends-modal-DiRWE3tJ.js → manage-backends-modal-CwyWsiag.js} +1 -1
  76. package/build/assets/manifest-39f4789d.js +1 -0
  77. package/build/assets/markdown-renderer-DgiLLhW6.js +8 -0
  78. package/build/assets/mcp-DXG9LWrI.js +9 -0
  79. package/build/assets/mcp-marketplace-utils-DFmhKc5s.js +1 -0
  80. package/build/assets/messages-kBjKaAeA.js +40 -0
  81. package/build/assets/{modal-body-C3bGicn4.js → modal-body-CMsDpalT.js} +1 -1
  82. package/build/assets/{modal-classes-DFFO6BMU.js → modal-classes-B6PDrxXo.js} +1 -1
  83. package/build/assets/{modal-close-button-vxkAIRyZ.js → modal-close-button-DyxBZaAb.js} +1 -1
  84. package/build/assets/{onboarding-DWuFieEA.js → onboarding-47hh2IHA.js} +1 -1
  85. package/build/assets/{onboarding-modal-C8m72Dpb.js → onboarding-modal-9BuvvROo.js} +1 -1
  86. package/build/assets/{organization-service.api-CQ73CB-S.js → organization-service.api-UDy63-oC.js} +1 -1
  87. package/build/assets/{pencil-DzW2GB2M.js → pencil-BjgtZmWp.js} +1 -1
  88. package/build/assets/{planner-tab-YG0bGxDY.js → planner-tab-BWk8885v.js} +1 -1
  89. package/build/assets/{plugins-management-service-ijhH8OSh.js → plugins-management-service-CjkgF2dd.js} +1 -1
  90. package/build/assets/plus-DrKuuvMe.js +1 -0
  91. package/build/assets/{profiles-service.api-C32pPm70.js → profiles-service.api-CukSFLzz.js} +1 -1
  92. package/build/assets/{providers-DuSn9s2i.js → providers-CqUWC85T.js} +1 -1
  93. package/build/assets/{proxy-BiyDhMBd.js → proxy-BBUG3sd2.js} +1 -1
  94. package/build/assets/{puzzle-DlqT0yvr.js → puzzle-BoNc6zZ8.js} +1 -1
  95. package/build/assets/recommended-automations-launcher-ejxy1P27.js +1 -0
  96. package/build/assets/{refresh-cw-Br5254f4.js → refresh-cw-BrM5ZAZD.js} +1 -1
  97. package/build/assets/root-5S-M8SYa.js +2 -0
  98. package/build/assets/root-DZ39lS5f.css +1 -0
  99. package/build/assets/root-layout-BPqoa0gv.js +3 -0
  100. package/build/assets/{schema-field-htfNouTG.js → schema-field-nImDoY6-.js} +1 -1
  101. package/build/assets/{sdk-section-page-D0K1dBQY.js → sdk-section-page-BxMrtUNV.js} +1 -1
  102. package/build/assets/search-Dc2qR4O2.js +1 -0
  103. package/build/assets/{secrets-service-Dbv5Zb8G.js → secrets-service-Dhjh3HhH.js} +1 -1
  104. package/build/assets/{secrets-settings-Da4SSaX9.js → secrets-settings-CPdxceT_.js} +1 -1
  105. package/build/assets/segmented-toggle-Do6oyepX.js +1 -0
  106. package/build/assets/{settings-F4a09IxY.js → settings-BRbnfKEm.js} +1 -1
  107. package/build/assets/{settings-dropdown-input-jOiv5Yrk.js → settings-dropdown-input-DYCULKpp.js} +1 -1
  108. package/build/assets/{settings-index-CyJBf5NA.js → settings-index-C9o2NBO0.js} +1 -1
  109. package/build/assets/settings-input-B-q2gkVy.js +1 -0
  110. package/build/assets/{settings-list-classes-VqMzkYYt.js → settings-list-classes-WpQi0q1L.js} +1 -1
  111. package/build/assets/{settings-modal-C-S1NpbC.js → settings-modal-CEK0AIx6.js} +1 -1
  112. package/build/assets/{settings-service.api-CTJRrvMu.js → settings-service.api-CZiPD8__.js} +1 -1
  113. package/build/assets/{settings-switch-B405oU_v.js → settings-switch-LqKdGxHL.js} +1 -1
  114. package/build/assets/shared-conversation-Bu-dQlgp.js +1 -0
  115. package/build/assets/{sidebar-layout-BGMuyC86.js → sidebar-layout-oHBGQmLh.js} +1 -1
  116. package/build/assets/{sidebar-mobile-menu-toggle-xiKoUfGa.js → sidebar-mobile-menu-toggle-ND-hgygu.js} +1 -1
  117. package/build/assets/{sidebar-nav-link-DA4_ct9G.js → sidebar-nav-link-CrujNA09.js} +1 -1
  118. package/build/assets/{sidebar-store-FRJ3rADB.js → sidebar-store-Bui-WNEr.js} +1 -1
  119. package/build/assets/{skill-card-pill-row-BMdhr_sd.js → skill-card-pill-row-CZBI7OqH.js} +1 -1
  120. package/build/assets/{skill-icon-badge-CGUkgcVH.js → skill-icon-badge-BOov_phZ.js} +1 -1
  121. package/build/assets/{skills-plugins-C5eJnyft.js → skills-plugins-D0PiHWAD.js} +1 -1
  122. package/build/assets/{skills-settings-pUxMr6WZ.js → skills-settings-B43KArIz.js} +2 -2
  123. package/build/assets/{styled-tooltip-B3kIdVyH.js → styled-tooltip-C7grwnOX.js} +1 -1
  124. package/build/assets/{task-list-tab-B3k4W1cK.js → task-list-tab-R3ac6m7O.js} +1 -1
  125. package/build/assets/{terminal-CBI_41Zc.js → terminal-yqkNdEAx.js} +1 -1
  126. package/build/assets/{toggle-switch-DYRr9CAR.js → toggle-switch-BeSrbgCg.js} +1 -1
  127. package/build/assets/{trash-2-gZPlx23R.js → trash-2-wW5TWcdN.js} +1 -1
  128. package/build/assets/{typography-B1UxuuEC.js → typography-iYhzLlHO.js} +1 -1
  129. package/build/assets/{use-acp-credential-form-CjSvKWFH.js → use-acp-credential-form-DUxbxmbq.js} +1 -1
  130. package/build/assets/{use-activate-agent-profile-DCRf47e-.js → use-activate-agent-profile-CDHA52tC.js} +1 -1
  131. package/build/assets/use-agent-profiles-TsOdIyw5.js +1 -0
  132. package/build/assets/{use-can-manage-org-profiles-vBiP7rHF.js → use-can-manage-org-profiles-Bt1M71u5.js} +1 -1
  133. package/build/assets/{use-cloud-current-user-id-BMq9gw93.js → use-cloud-current-user-id-DWt7HCgf.js} +1 -1
  134. package/build/assets/use-config-CxlEdf_v.js +1 -0
  135. package/build/assets/{use-create-conversation-CakhLF0X.js → use-create-conversation-nOJ6Um5h.js} +1 -1
  136. package/build/assets/{use-create-secret-RT4QtSS9.js → use-create-secret-Dj5ang9x.js} +1 -1
  137. package/build/assets/use-is-authed-BT7Iud4U.js +1 -0
  138. package/build/assets/{use-is-creating-conversation-CIAcnd8M.js → use-is-creating-conversation-CAggrM75.js} +1 -1
  139. package/build/assets/use-llm-profiles-2Wc2db8u.js +1 -0
  140. package/build/assets/{use-onboarding-completion-CJU4MNAY.js → use-onboarding-completion-gxQlcEy2.js} +1 -1
  141. package/build/assets/{use-plugins-marketplace-D-93nqtJ.js → use-plugins-marketplace-CVO7sXYR.js} +1 -1
  142. package/build/assets/use-save-agent-profile-D0wC5ExW.js +1 -0
  143. package/build/assets/{use-save-settings--C6LZXfI.js → use-save-settings-L3aMaDeS.js} +1 -1
  144. package/build/assets/{use-settings-DIAo5KFk.js → use-settings-8nt3DGxW.js} +1 -1
  145. package/build/assets/use-settings-nav-items-DHAAD-zk.js +16 -0
  146. package/build/assets/{use-skills-D_mLhYNa.js → use-skills-CE6miQ3r.js} +1 -1
  147. package/build/assets/use-tracking-BGboadaZ.js +68 -0
  148. package/build/assets/{use-user-conversation-DhcAEyJX.js → use-user-conversation-BIIpGUgM.js} +1 -1
  149. package/build/assets/useInfiniteQuery-BLRVmVPU.js +1 -0
  150. package/build/assets/{useMutation-DHLpZ6J0.js → useMutation-CaSHLnX0.js} +1 -1
  151. package/build/assets/{useQueries-B3T1a7qt.js → useQueries--d_WWAzc.js} +1 -1
  152. package/build/assets/{useQuery-B38jBavx.js → useQuery-DiPh8LRJ.js} +1 -1
  153. package/build/assets/utils-BgGG1znF.js +1 -0
  154. package/build/assets/{vendor~browser-CIoZCqGs.js → vendor~browser-IVYgIgG1.js} +1 -1
  155. package/build/assets/{vendor~entry.client-Di4qO77Y.js → vendor~entry.client-BcYIVQvB.js} +1 -1
  156. package/build/assets/{vendor~entry.client-BfviqoVc.js → vendor~entry.client-CXM9oiAk.js} +1 -1
  157. package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~g4xrpilz-CYPMCkX1.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~b0bpqexo-CbTboogo.js} +1 -1
  158. package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f9xdmd0z-DLMP7bZx.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~d4by102p-C2f0ZhS-.js} +1 -1
  159. package/build/assets/{vendor~files-tab-atebg0iG.js → vendor~files-tab-C7RmQJwN.js} +1 -1
  160. package/build/assets/{vendor~index-home~home~conversation-panel~conversation-G9DMrR7m.js → vendor~index-home~home~conversation-panel~conversation-Bqp1ZqJM.js} +1 -1
  161. package/build/assets/{vendor~root-layout~conversation-panel~conversation-DEhW1h3I.js → vendor~root-layout~conversation-panel~conversation-BCn8lzeG.js} +1 -1
  162. package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation~automation-setup-route-B_L-gcOG.js +1 -0
  163. package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-sjx0x5ac.js +1 -0
  164. package/build/assets/vendor~root-layout~index-home~home~mcp~automations-list~automation-setup-route~onboarding-modal-D7IDevqN.js +1 -0
  165. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~bi2r7bko-VFnwct3q.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~dfc8ddxy-tTyxnjXT.js} +1 -1
  166. package/build/assets/{vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~hakxo2tj-ClV0p9g3.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~extensions-h~gy8zbn65-CGt6bWRT.js} +1 -1
  167. package/build/assets/{vendor~root-layout~index-home~home~conversation-panel~conversation~launch~skills-settings~a~eywn6ulz-BKxxr74w.js → vendor~root~root-layout~index-home~home~conversation-panel~conversation~launch~skills-setti~dufan6ng-Dtdw8H0q.js} +17 -4
  168. package/build/assets/{verification-settings-Vr5cN4md.js → verification-settings-DBsnSXC3.js} +1 -1
  169. package/build/assets/x-omAzpXkl.js +1 -0
  170. package/build/index.html +4 -4
  171. package/build/locales/ar/openhands.json +37 -2
  172. package/build/locales/ca/openhands.json +37 -2
  173. package/build/locales/de/openhands.json +37 -2
  174. package/build/locales/en/openhands.json +38 -3
  175. package/build/locales/es/openhands.json +37 -2
  176. package/build/locales/fr/openhands.json +37 -2
  177. package/build/locales/it/openhands.json +37 -2
  178. package/build/locales/ja/openhands.json +37 -2
  179. package/build/locales/ko-KR/openhands.json +37 -2
  180. package/build/locales/no/openhands.json +37 -2
  181. package/build/locales/pt/openhands.json +37 -2
  182. package/build/locales/tr/openhands.json +37 -2
  183. package/build/locales/uk/openhands.json +37 -2
  184. package/build/locales/zh-CN/openhands.json +37 -2
  185. package/build/locales/zh-TW/openhands.json +37 -2
  186. package/config/defaults.json +1 -1
  187. package/dist/api/agent-server-adapter.cjs +3 -3
  188. package/dist/api/agent-server-adapter.cjs.map +1 -1
  189. package/dist/api/agent-server-adapter.d.ts +46 -6
  190. package/dist/api/agent-server-adapter.js +187 -168
  191. package/dist/api/agent-server-adapter.js.map +1 -1
  192. package/dist/api/agent-server-compatibility.cjs +1 -1
  193. package/dist/api/agent-server-compatibility.cjs.map +1 -1
  194. package/dist/api/agent-server-compatibility.d.ts +4 -0
  195. package/dist/api/agent-server-compatibility.js +41 -38
  196. package/dist/api/agent-server-compatibility.js.map +1 -1
  197. package/dist/api/automation-service/automation-service.api.cjs +1 -1
  198. package/dist/api/automation-service/automation-service.api.cjs.map +1 -1
  199. package/dist/api/automation-service/automation-service.api.d.ts +20 -0
  200. package/dist/api/automation-service/automation-service.api.js +99 -62
  201. package/dist/api/automation-service/automation-service.api.js.map +1 -1
  202. package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.cjs +2 -0
  203. package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.cjs.map +1 -0
  204. package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.d.ts +12 -0
  205. package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.js +94 -0
  206. package/dist/components/conversation-events/chat/event-content-helpers/get-action-event-title.js.map +1 -0
  207. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs +1 -1
  208. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.cjs.map +1 -1
  209. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js +31 -90
  210. package/dist/components/conversation-events/chat/event-content-helpers/get-event-content.js.map +1 -1
  211. package/dist/components/features/automations/recommended-automations-launcher.d.ts +0 -7
  212. package/dist/components/features/automations/recommended-automations-section.d.ts +0 -6
  213. package/dist/components/features/backends/backend-form-modal.cjs +1 -1
  214. package/dist/components/features/backends/backend-form-modal.cjs.map +1 -1
  215. package/dist/components/features/backends/backend-form-modal.js +568 -358
  216. package/dist/components/features/backends/backend-form-modal.js.map +1 -1
  217. package/dist/components/features/backends/device-flow-auth.cjs +1 -1
  218. package/dist/components/features/backends/device-flow-auth.cjs.map +1 -1
  219. package/dist/components/features/backends/device-flow-auth.d.ts +9 -1
  220. package/dist/components/features/backends/device-flow-auth.js +56 -55
  221. package/dist/components/features/backends/device-flow-auth.js.map +1 -1
  222. package/dist/components/features/backends/manage-backends-modal.cjs +1 -1
  223. package/dist/components/features/backends/manage-backends-modal.cjs.map +1 -1
  224. package/dist/components/features/backends/manage-backends-modal.js +1 -1
  225. package/dist/components/features/backends/manage-backends-modal.js.map +1 -1
  226. package/dist/components/features/chat/chat-interface.cjs +1 -1
  227. package/dist/components/features/chat/chat-interface.cjs.map +1 -1
  228. package/dist/components/features/chat/chat-interface.js +105 -105
  229. package/dist/components/features/chat/chat-interface.js.map +1 -1
  230. package/dist/components/features/chat/chat-message.cjs +1 -1
  231. package/dist/components/features/chat/chat-message.cjs.map +1 -1
  232. package/dist/components/features/chat/chat-message.d.ts +2 -1
  233. package/dist/components/features/chat/chat-message.js +59 -49
  234. package/dist/components/features/chat/chat-message.js.map +1 -1
  235. package/dist/components/features/chat/pending-user-messages.cjs +1 -1
  236. package/dist/components/features/chat/pending-user-messages.cjs.map +1 -1
  237. package/dist/components/features/chat/pending-user-messages.js +4 -1
  238. package/dist/components/features/chat/pending-user-messages.js.map +1 -1
  239. package/dist/components/features/chat/typing-indicator.cjs +1 -1
  240. package/dist/components/features/chat/typing-indicator.cjs.map +1 -1
  241. package/dist/components/features/chat/typing-indicator.d.ts +8 -1
  242. package/dist/components/features/chat/typing-indicator.js +94 -10
  243. package/dist/components/features/chat/typing-indicator.js.map +1 -1
  244. package/dist/components/features/command-menu/command-menu-items.d.ts +5 -1
  245. package/dist/components/features/files-tab/segmented-toggle.cjs +1 -1
  246. package/dist/components/features/files-tab/segmented-toggle.cjs.map +1 -1
  247. package/dist/components/features/files-tab/segmented-toggle.d.ts +2 -0
  248. package/dist/components/features/files-tab/segmented-toggle.js +17 -14
  249. package/dist/components/features/files-tab/segmented-toggle.js.map +1 -1
  250. package/dist/components/features/manifest/manifest-form-field.d.ts +27 -0
  251. package/dist/components/features/manifest/manifest-prerequisites-step.d.ts +11 -0
  252. package/dist/components/features/manifest/manifest-review-step.d.ts +14 -0
  253. package/dist/components/features/manifest/manifest-setup-dialog.d.ts +14 -0
  254. package/dist/components/features/settings/settings-input.cjs +1 -1
  255. package/dist/components/features/settings/settings-input.cjs.map +1 -1
  256. package/dist/components/features/settings/settings-input.d.ts +6 -0
  257. package/dist/components/features/settings/settings-input.js +13 -8
  258. package/dist/components/features/settings/settings-input.js.map +1 -1
  259. package/dist/components/features/sidebar/sidebar-rail-body.cjs +1 -1
  260. package/dist/components/features/sidebar/sidebar-rail-body.cjs.map +1 -1
  261. package/dist/components/features/sidebar/sidebar-rail-body.js +124 -123
  262. package/dist/components/features/sidebar/sidebar-rail-body.js.map +1 -1
  263. package/dist/config/defaults.cjs +1 -1
  264. package/dist/config/defaults.cjs.map +1 -1
  265. package/dist/config/defaults.js +1 -1
  266. package/dist/config/defaults.js.map +1 -1
  267. package/dist/hooks/query/query-keys.cjs.map +1 -1
  268. package/dist/hooks/query/query-keys.d.ts +4 -0
  269. package/dist/hooks/query/query-keys.js.map +1 -1
  270. package/dist/hooks/query/use-manifest-capabilities.d.ts +21 -0
  271. package/dist/hooks/query/use-manifest-prerequisites.d.ts +24 -0
  272. package/dist/hooks/use-llm-configured.cjs +1 -1
  273. package/dist/hooks/use-llm-configured.cjs.map +1 -1
  274. package/dist/hooks/use-llm-configured.js +2 -1
  275. package/dist/hooks/use-llm-configured.js.map +1 -1
  276. package/dist/hooks/use-manifest-preflight.d.ts +18 -0
  277. package/dist/hooks/use-tracking.cjs +1 -1
  278. package/dist/hooks/use-tracking.cjs.map +1 -1
  279. package/dist/hooks/use-tracking.d.ts +14 -0
  280. package/dist/hooks/use-tracking.js +19 -1
  281. package/dist/hooks/use-tracking.js.map +1 -1
  282. package/dist/i18n/declaration.cjs +1 -1
  283. package/dist/i18n/declaration.cjs.map +1 -1
  284. package/dist/i18n/declaration.d.ts +36 -1
  285. package/dist/i18n/declaration.js +1 -1
  286. package/dist/i18n/declaration.js.map +1 -1
  287. package/dist/i18n/translation.cjs +2 -2
  288. package/dist/i18n/translation.cjs.map +1 -1
  289. package/dist/i18n/translation.js +611 -16
  290. package/dist/i18n/translation.js.map +1 -1
  291. package/dist/icons/external-link.cjs +2 -0
  292. package/dist/icons/external-link.cjs.map +1 -0
  293. package/dist/icons/external-link.js +22 -0
  294. package/dist/icons/external-link.js.map +1 -0
  295. package/dist/icons/server.cjs +2 -0
  296. package/dist/icons/server.cjs.map +1 -0
  297. package/dist/icons/server.js +17 -0
  298. package/dist/icons/server.js.map +1 -0
  299. package/dist/locales/ar/openhands.json +37 -2
  300. package/dist/locales/ca/openhands.json +37 -2
  301. package/dist/locales/de/openhands.json +37 -2
  302. package/dist/locales/en/openhands.json +38 -3
  303. package/dist/locales/es/openhands.json +37 -2
  304. package/dist/locales/fr/openhands.json +37 -2
  305. package/dist/locales/it/openhands.json +37 -2
  306. package/dist/locales/ja/openhands.json +37 -2
  307. package/dist/locales/ko-KR/openhands.json +37 -2
  308. package/dist/locales/no/openhands.json +37 -2
  309. package/dist/locales/pt/openhands.json +37 -2
  310. package/dist/locales/tr/openhands.json +37 -2
  311. package/dist/locales/uk/openhands.json +37 -2
  312. package/dist/locales/zh-CN/openhands.json +37 -2
  313. package/dist/locales/zh-TW/openhands.json +37 -2
  314. package/dist/manifests/automation-interface.cjs +2 -0
  315. package/dist/manifests/automation-interface.cjs.map +1 -0
  316. package/dist/manifests/automation-interface.d.ts +44 -0
  317. package/dist/manifests/automation-interface.js +81 -0
  318. package/dist/manifests/automation-interface.js.map +1 -0
  319. package/dist/manifests/automation-setup.cjs +2 -0
  320. package/dist/manifests/automation-setup.cjs.map +1 -0
  321. package/dist/manifests/automation-setup.d.ts +52 -0
  322. package/dist/manifests/automation-setup.js +8 -0
  323. package/dist/manifests/automation-setup.js.map +1 -0
  324. package/dist/manifests/interface-validation.cjs +2 -0
  325. package/dist/manifests/interface-validation.cjs.map +1 -0
  326. package/dist/manifests/interface-validation.d.ts +27 -0
  327. package/dist/manifests/interface-validation.js +182 -0
  328. package/dist/manifests/interface-validation.js.map +1 -0
  329. package/dist/manifests/manifest-actions.d.ts +15 -0
  330. package/dist/manifests/manifest-capabilities.d.ts +25 -0
  331. package/dist/manifests/manifest-error-map.d.ts +40 -0
  332. package/dist/manifests/manifest-local-validation.d.ts +56 -0
  333. package/dist/manifests/manifest-registry.cjs +2 -0
  334. package/dist/manifests/manifest-registry.cjs.map +1 -0
  335. package/dist/manifests/manifest-registry.d.ts +15 -0
  336. package/dist/manifests/manifest-registry.js +26 -0
  337. package/dist/manifests/manifest-registry.js.map +1 -0
  338. package/dist/manifests/manifest-sources.cjs +2 -0
  339. package/dist/manifests/manifest-sources.cjs.map +1 -0
  340. package/dist/manifests/manifest-sources.d.ts +15 -0
  341. package/dist/manifests/manifest-sources.js +8 -0
  342. package/dist/manifests/manifest-sources.js.map +1 -0
  343. package/dist/manifests/manifest-template.d.ts +18 -0
  344. package/dist/manifests/manifest-validation.cjs +2 -0
  345. package/dist/manifests/manifest-validation.cjs.map +1 -0
  346. package/dist/manifests/manifest-validation.d.ts +30 -0
  347. package/dist/manifests/manifest-validation.js +145 -0
  348. package/dist/manifests/manifest-validation.js.map +1 -0
  349. package/dist/manifests/types.cjs +2 -0
  350. package/dist/manifests/types.cjs.map +1 -0
  351. package/dist/manifests/types.d.ts +227 -0
  352. package/dist/manifests/types.js +6 -0
  353. package/dist/manifests/types.js.map +1 -0
  354. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs +9 -0
  355. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.cjs.map +1 -0
  356. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js +75 -0
  357. package/dist/node_modules/@openhands/extensions/automations/catalog/github-pr-reviewer/manifest.js.map +1 -0
  358. package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.cjs +9 -0
  359. package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.cjs.map +1 -0
  360. package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.js +78 -0
  361. package/dist/node_modules/@openhands/extensions/automations/catalog/github-repo-monitor/manifest.js.map +1 -0
  362. package/dist/node_modules/@openhands/extensions/automations/catalog/incident-retrospective-drafter/manifest.cjs +17 -0
  363. package/dist/node_modules/@openhands/extensions/automations/catalog/incident-retrospective-drafter/manifest.cjs.map +1 -0
  364. package/dist/node_modules/@openhands/extensions/automations/catalog/incident-retrospective-drafter/manifest.js +89 -0
  365. package/dist/node_modules/@openhands/extensions/automations/catalog/incident-retrospective-drafter/manifest.js.map +1 -0
  366. package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-pr/manifest.cjs +10 -0
  367. package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-pr/manifest.cjs.map +1 -0
  368. package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-pr/manifest.js +17 -0
  369. package/dist/node_modules/@openhands/extensions/automations/catalog/jira-issue-to-pr/manifest.js.map +1 -0
  370. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-triage-assistant/manifest.cjs +9 -0
  371. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-triage-assistant/manifest.cjs.map +1 -0
  372. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-triage-assistant/manifest.js +15 -0
  373. package/dist/node_modules/@openhands/extensions/automations/catalog/linear-triage-assistant/manifest.js.map +1 -0
  374. package/dist/node_modules/@openhands/extensions/automations/catalog/research-brief-writer/manifest.cjs +9 -0
  375. package/dist/node_modules/@openhands/extensions/automations/catalog/research-brief-writer/manifest.cjs.map +1 -0
  376. package/dist/node_modules/@openhands/extensions/automations/catalog/research-brief-writer/manifest.js +18 -0
  377. package/dist/node_modules/@openhands/extensions/automations/catalog/research-brief-writer/manifest.js.map +1 -0
  378. package/dist/node_modules/@openhands/extensions/automations/catalog/slack-channel-monitor/manifest.cjs +9 -0
  379. package/dist/node_modules/@openhands/extensions/automations/catalog/slack-channel-monitor/manifest.cjs.map +1 -0
  380. package/dist/node_modules/@openhands/extensions/automations/catalog/slack-channel-monitor/manifest.js +14 -0
  381. package/dist/node_modules/@openhands/extensions/automations/catalog/slack-channel-monitor/manifest.js.map +1 -0
  382. package/dist/node_modules/@openhands/extensions/automations/catalog/slack-standup-digest/manifest.cjs +9 -0
  383. package/dist/node_modules/@openhands/extensions/automations/catalog/slack-standup-digest/manifest.cjs.map +1 -0
  384. package/dist/node_modules/@openhands/extensions/automations/catalog/slack-standup-digest/manifest.js +14 -0
  385. package/dist/node_modules/@openhands/extensions/automations/catalog/slack-standup-digest/manifest.js.map +1 -0
  386. package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs +2 -0
  387. package/dist/node_modules/@openhands/extensions/automations/catalog-index.cjs.map +1 -0
  388. package/dist/node_modules/@openhands/extensions/automations/catalog-index.js +23 -0
  389. package/dist/node_modules/@openhands/extensions/automations/catalog-index.js.map +1 -0
  390. package/dist/node_modules/@openhands/extensions/automations/index.cjs +2 -0
  391. package/dist/node_modules/@openhands/extensions/automations/index.cjs.map +1 -0
  392. package/dist/node_modules/@openhands/extensions/automations/index.js +18 -0
  393. package/dist/node_modules/@openhands/extensions/automations/index.js.map +1 -0
  394. package/dist/node_modules/@openhands/extensions/automations/interface.cjs +2 -0
  395. package/dist/node_modules/@openhands/extensions/automations/interface.cjs.map +1 -0
  396. package/dist/node_modules/@openhands/extensions/automations/interface.js +89 -0
  397. package/dist/node_modules/@openhands/extensions/automations/interface.js.map +1 -0
  398. package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.cjs +1 -1
  399. package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.cjs.map +1 -1
  400. package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.js +3 -3
  401. package/dist/node_modules/@openhands/extensions/integrations/catalog/datadog.js.map +1 -1
  402. package/dist/node_modules/@openhands/extensions/skills/index.cjs +17 -4
  403. package/dist/node_modules/@openhands/extensions/skills/index.cjs.map +1 -1
  404. package/dist/node_modules/@openhands/extensions/skills/index.js +5 -5
  405. package/dist/node_modules/@openhands/extensions/skills/index.js.map +1 -1
  406. package/dist/node_modules/lucide-react/dist/esm/icons/monitor.cjs +2 -0
  407. package/dist/node_modules/lucide-react/dist/esm/icons/monitor.cjs.map +1 -0
  408. package/dist/node_modules/lucide-react/dist/esm/icons/monitor.js +29 -0
  409. package/dist/node_modules/lucide-react/dist/esm/icons/monitor.js.map +1 -0
  410. package/dist/package.cjs +1 -1
  411. package/dist/package.cjs.map +1 -1
  412. package/dist/package.js +2 -2
  413. package/dist/package.js.map +1 -1
  414. package/dist/types/agent-server/core/events/conversation-state-event.d.ts +2 -19
  415. package/dist/types/agent-server/core/events/observation-event.d.ts +2 -18
  416. package/dist/types/automation.d.ts +7 -3
  417. package/dist/utils/api-error-message.d.ts +6 -2
  418. package/dist/utils/automation-catalog.cjs +2 -0
  419. package/dist/utils/automation-catalog.cjs.map +1 -0
  420. package/dist/utils/automation-catalog.d.ts +28 -0
  421. package/dist/utils/automation-catalog.js +5 -0
  422. package/dist/utils/automation-catalog.js.map +1 -0
  423. package/dist/utils/automation-timeout.d.ts +3 -2
  424. package/dist/utils/responder-deployment.d.ts +5 -1
  425. package/dist/utils/transcript-export/index.cjs +5 -5
  426. package/dist/utils/transcript-export/index.js +12 -12
  427. package/package.json +2 -2
  428. package/scripts/check-translation-completeness.cjs +1 -0
  429. package/scripts/dev-safe.mjs +15 -10
  430. package/scripts/dev-static.mjs +17 -0
  431. package/scripts/dev-with-automation.mjs +12 -14
  432. package/scripts/ingress.mjs +22 -0
  433. package/scripts/proxy-utils.mjs +157 -2
  434. package/scripts/runtime-services-info.mjs +6 -6
  435. package/scripts/static-build.mjs +0 -7
  436. package/scripts/static-server.mjs +10 -0
  437. package/build/assets/active-backend-context-mY7Gff5c.js +0 -2
  438. package/build/assets/agent-context-settings-BTUmWEzL.js +0 -1
  439. package/build/assets/agent-profiles-settings-Ilqid_R5.js +0 -1
  440. package/build/assets/agent-server-conversation-service.api-C_7YnjzP.js +0 -41
  441. package/build/assets/agent-settings-CxfT4ksO.js +0 -1
  442. package/build/assets/automation-BGP_I1RR.js +0 -1
  443. package/build/assets/automation-detail-nEflClmc.js +0 -2
  444. package/build/assets/automation-export-BO_kfqC8.js +0 -2
  445. package/build/assets/automations-list-BYncC7gv.js +0 -1
  446. package/build/assets/backend-form-modal-CKrBF80P.js +0 -1
  447. package/build/assets/browser-3QjrEr1D.js +0 -6
  448. package/build/assets/check-CrxQfJZ2.js +0 -1
  449. package/build/assets/chevron-down-D_LsyTA7.js +0 -1
  450. package/build/assets/circle-check-DZn9HkLE.js +0 -1
  451. package/build/assets/cloud-funnel-analytics-NlmDoeo2.js +0 -1
  452. package/build/assets/command-menu-CvLPs7dg.js +0 -1
  453. package/build/assets/condenser-settings-C4Y9CzQV.js +0 -1
  454. package/build/assets/conversation-D_ORtpKC.js +0 -1
  455. package/build/assets/conversation-Dpc5nmGi.js +0 -90
  456. package/build/assets/conversation-panel-D_ORtpKC.js +0 -1
  457. package/build/assets/conversation-state-store-CGRQemtx.js +0 -1
  458. package/build/assets/files-tab-4c9HFSLo.js +0 -1
  459. package/build/assets/git-provider-icon-0PqmIS_S.js +0 -1
  460. package/build/assets/home-D9JsyEmE.js +0 -1
  461. package/build/assets/home-TFhnmZLx.js +0 -1
  462. package/build/assets/index-home-D9JsyEmE.js +0 -1
  463. package/build/assets/install-server-modal-BgGRnqA0.js +0 -1
  464. package/build/assets/llm-not-configured-banner-Y4W9-sar.js +0 -27
  465. package/build/assets/llm-settings-nPwv7hKu.js +0 -1
  466. package/build/assets/loader-circle-CGD6-Vak.js +0 -1
  467. package/build/assets/manifest-1cf33a7b.js +0 -1
  468. package/build/assets/markdown-renderer-U40HF0Ak.js +0 -8
  469. package/build/assets/mcp-xDMaHzOw.js +0 -9
  470. package/build/assets/messages-CdNfZPgd.js +0 -40
  471. package/build/assets/plus-CTGLo3aa.js +0 -1
  472. package/build/assets/recommended-automations-launcher-Dru1yN46.js +0 -58
  473. package/build/assets/root-B5JXKp1P.css +0 -1
  474. package/build/assets/root-DOLLQteU.js +0 -2
  475. package/build/assets/root-layout-xmylWoew.js +0 -3
  476. package/build/assets/search-BrpWXWUi.js +0 -1
  477. package/build/assets/segmented-toggle-CZKOdIly.js +0 -1
  478. package/build/assets/settings-input-BEaTCem1.js +0 -1
  479. package/build/assets/shared-conversation-BvWtTwES.js +0 -1
  480. package/build/assets/use-agent-profiles-DmT9zxAN.js +0 -1
  481. package/build/assets/use-config-C959QcRC.js +0 -1
  482. package/build/assets/use-is-authed-BsS4XwSL.js +0 -1
  483. package/build/assets/use-llm-profiles-CdaxVpyY.js +0 -1
  484. package/build/assets/use-save-agent-profile-DGJ3-u0M.js +0 -1
  485. package/build/assets/use-settings-nav-items-DPK5sxvR.js +0 -16
  486. package/build/assets/use-tracking-COqZLobY.js +0 -1
  487. package/build/assets/utils-DsWhWn2F.js +0 -1
  488. package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation-Acmf1sKj.js +0 -1
  489. package/build/assets/vendor~root-layout~index-home~home~conversation-panel~conversation~shared-conversation-CmzCY1BT.js +0 -1
  490. package/build/assets/vendor~root-layout~index-home~home~mcp~automations-list~onboarding-modal-C7Yh77RT.js +0 -1
  491. package/build/assets/x-Dx_JbpHA.js +0 -1
  492. /package/build/assets/{vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~f1hl7voa-BrmgjeOw.js → vendor~entry.client~root~root-layout~index-home~home~conversation-panel~conversation~launch~emdr2jt4-BrmgjeOw.js} +0 -0
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Translate service-reported errors back to the form field that produced them.
3
+ *
4
+ * The host validates and submits the *derived payload*, so errors come back
5
+ * addressed by payload path (`trigger.schedule`) rather than by form field
6
+ * (`schedule`). The reverse lookup is derived from the same builder that made
7
+ * the payload; the mapping is lossy by nature, since one payload value can be
8
+ * built from several fields.
9
+ */
10
+ import type { SetupRequestBody } from "./types";
11
+ /** An error the service reported, addressed by payload path where it gave one. */
12
+ export interface ManifestServiceError {
13
+ path: string;
14
+ message: string;
15
+ }
16
+ export interface MappedManifestErrors {
17
+ /** Keyed by form field name. */
18
+ fieldErrors: Record<string, string>;
19
+ /** Errors with no field to attach to; shown against the form as a whole. */
20
+ formErrors: string[];
21
+ }
22
+ /**
23
+ * Turn a service `loc` array into a path into the payload actually sent.
24
+ *
25
+ * A validation framework may address a value through segments that are not keys
26
+ * of the request body — a discriminated union reports
27
+ * `["body","trigger","cron","schedule"]` for a body whose trigger has no `cron`
28
+ * key. Walking the payload and skipping segments that do not resolve reduces
29
+ * that to `trigger.schedule` without knowing anything about the payload's
30
+ * meaning.
31
+ */
32
+ export declare function locToPayloadPath(loc: readonly (string | number)[], payload: unknown): string;
33
+ /**
34
+ * Read errors out of a service response body, whichever of the two shapes it
35
+ * uses: a preflight result keyed by field, or a validation failure keyed by
36
+ * `loc`.
37
+ */
38
+ export declare function normalizeServiceErrors(body: unknown, payload: SetupRequestBody | null): ManifestServiceError[];
39
+ /** Apply the derived payload-path map, falling back to a form-level error. */
40
+ export declare function mapServiceErrors(errors: readonly ManifestServiceError[], errorMap: Record<string, string[]>): MappedManifestErrors;
@@ -0,0 +1,56 @@
1
+ /**
2
+ * The form model, and the host's own check of what the user typed into it.
3
+ *
4
+ * Local validation is a convenience, not the authority: it is instant and needs
5
+ * no round trip, so it catches empty required fields and obvious typos.
6
+ * Deployment-specific questions ("is a one-minute schedule allowed here?")
7
+ * belong to preflight, which is authoritative.
8
+ *
9
+ * Errors are returned as codes rather than sentences so the host can render
10
+ * them through its own translations; only manifest-authored copy is literal.
11
+ */
12
+ import type { DeploymentCapabilities, SetupBlock, SetupFieldOption, SetupFormField, SetupFormFields, SetupFormValues } from "./types";
13
+ export type SetupFieldError = {
14
+ code: "required";
15
+ } | {
16
+ code: "minLength";
17
+ length: number;
18
+ } | {
19
+ code: "maxLength";
20
+ length: number;
21
+ } | {
22
+ code: "invalidOption";
23
+ } | {
24
+ code: "unsafeExpressionLiteral";
25
+ };
26
+ export type SetupFieldErrors = Record<string, SetupFieldError>;
27
+ /** Field constraints supplied by the deployment rather than by the manifest. */
28
+ export interface SetupFieldOverride {
29
+ options?: SetupFieldOption[];
30
+ }
31
+ export type SetupFieldOverrides = Record<string, SetupFieldOverride>;
32
+ /**
33
+ * Every input the form declares, keyed by name, whichever half it is in.
34
+ *
35
+ * Trigger inputs come first so the user is asked when it runs before what it
36
+ * runs on, and so every derived view of the form keeps that order. Admission
37
+ * rejects a name declared in both halves, so the merge cannot lose a field.
38
+ */
39
+ export declare function collectFields(setup: SetupBlock): SetupFormFields;
40
+ /**
41
+ * Feed deployment values into form field constraints, so the form offers only
42
+ * what the deployment accepts.
43
+ *
44
+ * A `timezone` field is the case that needs it: a manifest declares no options
45
+ * for one, because the accepted zones belong to the deployment. The cron
46
+ * interval floor is deliberately left to preflight — the deployment owns that
47
+ * limit and states it in its own words, and a local approximation would
48
+ * pre-empt the authoritative message with a worse one.
49
+ */
50
+ export declare function resolveFieldOverrides(setup: SetupBlock, capabilities: DeploymentCapabilities | null): SetupFieldOverrides;
51
+ /** The options a field offers, after deployment constraints are applied. */
52
+ export declare function getFieldOptions(name: string, field: SetupFormField, overrides?: SetupFieldOverrides): SetupFieldOption[];
53
+ /** Initial form state: every declared field, seeded with its declared default. */
54
+ export declare function getInitialFormValues(setup: SetupBlock): SetupFormValues;
55
+ /** Check every declared field. Returns only the fields that failed. */
56
+ export declare function validateFormValues(setup: SetupBlock, values: SetupFormValues, overrides?: SetupFieldOverrides): SetupFieldErrors;
@@ -0,0 +1,2 @@
1
+ require("../_virtual/_rolldown/runtime.cjs");const e=require("./manifest-validation.cjs");function t(t){let n=[],r=new Map;return t.forEach(t=>{if(!e.hasSetupBlock(t))return;let{valid:i,errors:a}=e.validateSetupEntry(t);if(!i){console.warn(`Rejected a setup manifest:`,a.join(`; `));return}let o=t;if(r.has(o.id)){console.warn(`Rejected a setup manifest: id "${o.id}" is already registered`);return}n.push(o),r.set(o.id,o)}),{entries:n,findById:e=>r.get(e)??null}}exports.createSetupRegistry=t;
2
+ //# sourceMappingURL=manifest-registry.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest-registry.cjs","names":[],"sources":["../../src/manifests/manifest-registry.ts"],"sourcesContent":["/**\n * Registry of admitted setup manifests.\n *\n * Stage 1 of the setup flow: load the catalog, decide which entries this host\n * will act on, and index the survivors by id. An entry that fails admission is\n * dropped entirely rather than rendered partially, because everything\n * downstream treats its content as instructions.\n */\n\nimport { hasSetupBlock, validateSetupEntry } from \"./manifest-validation\";\nimport type { SetupEntry } from \"./types\";\n\nexport interface SetupRegistry {\n /** Entries this host has admitted, in source order. */\n readonly entries: readonly SetupEntry[];\n findById(id: string): SetupEntry | null;\n}\n\nexport function createSetupRegistry(\n candidates: readonly unknown[],\n): SetupRegistry {\n const entries: SetupEntry[] = [];\n const byId = new Map<string, SetupEntry>();\n\n candidates.forEach((candidate) => {\n // A catalog entry without a setup block is a card, not a setup experience.\n // That is the normal case, so it is skipped rather than reported.\n if (!hasSetupBlock(candidate)) return;\n\n const { valid, errors } = validateSetupEntry(candidate);\n if (!valid) {\n console.warn(\"Rejected a setup manifest:\", errors.join(\"; \"));\n return;\n }\n\n const entry = candidate as SetupEntry;\n if (byId.has(entry.id)) {\n console.warn(\n `Rejected a setup manifest: id \"${entry.id}\" is already registered`,\n );\n return;\n }\n\n entries.push(entry);\n byId.set(entry.id, entry);\n });\n\n return {\n entries,\n findById: (id) => byId.get(id) ?? null,\n };\n}\n"],"mappings":"0FAkBA,SAAgB,EACd,EACe,CACf,IAAM,EAAwB,CAAC,EACzB,EAAO,IAAI,IAyBjB,OAvBA,EAAW,QAAS,GAAc,CAGhC,GAAI,CAAC,EAAA,cAAc,CAAS,EAAG,OAE/B,GAAM,CAAE,QAAO,UAAW,EAAA,mBAAmB,CAAS,EACtD,GAAI,CAAC,EAAO,CACV,QAAQ,KAAK,6BAA8B,EAAO,KAAK,IAAI,CAAC,EAC5D,MACF,CAEA,IAAM,EAAQ,EACd,GAAI,EAAK,IAAI,EAAM,EAAE,EAAG,CACtB,QAAQ,KACN,kCAAkC,EAAM,GAAG,wBAC7C,EACA,MACF,CAEA,EAAQ,KAAK,CAAK,EAClB,EAAK,IAAI,EAAM,GAAI,CAAK,CAC1B,CAAC,EAEM,CACL,UACA,SAAW,GAAO,EAAK,IAAI,CAAE,GAAK,IACpC,CACF"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Registry of admitted setup manifests.
3
+ *
4
+ * Stage 1 of the setup flow: load the catalog, decide which entries this host
5
+ * will act on, and index the survivors by id. An entry that fails admission is
6
+ * dropped entirely rather than rendered partially, because everything
7
+ * downstream treats its content as instructions.
8
+ */
9
+ import type { SetupEntry } from "./types";
10
+ export interface SetupRegistry {
11
+ /** Entries this host has admitted, in source order. */
12
+ readonly entries: readonly SetupEntry[];
13
+ findById(id: string): SetupEntry | null;
14
+ }
15
+ export declare function createSetupRegistry(candidates: readonly unknown[]): SetupRegistry;
@@ -0,0 +1,26 @@
1
+ import { hasSetupBlock as e, validateSetupEntry as t } from "./manifest-validation.js";
2
+ //#region src/manifests/manifest-registry.ts
3
+ function n(n) {
4
+ let r = [], i = /* @__PURE__ */ new Map();
5
+ return n.forEach((n) => {
6
+ if (!e(n)) return;
7
+ let { valid: a, errors: o } = t(n);
8
+ if (!a) {
9
+ console.warn("Rejected a setup manifest:", o.join("; "));
10
+ return;
11
+ }
12
+ let s = n;
13
+ if (i.has(s.id)) {
14
+ console.warn(`Rejected a setup manifest: id "${s.id}" is already registered`);
15
+ return;
16
+ }
17
+ r.push(s), i.set(s.id, s);
18
+ }), {
19
+ entries: r,
20
+ findById: (e) => i.get(e) ?? null
21
+ };
22
+ }
23
+ //#endregion
24
+ export { n as createSetupRegistry };
25
+
26
+ //# sourceMappingURL=manifest-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest-registry.js","names":[],"sources":["../../src/manifests/manifest-registry.ts"],"sourcesContent":["/**\n * Registry of admitted setup manifests.\n *\n * Stage 1 of the setup flow: load the catalog, decide which entries this host\n * will act on, and index the survivors by id. An entry that fails admission is\n * dropped entirely rather than rendered partially, because everything\n * downstream treats its content as instructions.\n */\n\nimport { hasSetupBlock, validateSetupEntry } from \"./manifest-validation\";\nimport type { SetupEntry } from \"./types\";\n\nexport interface SetupRegistry {\n /** Entries this host has admitted, in source order. */\n readonly entries: readonly SetupEntry[];\n findById(id: string): SetupEntry | null;\n}\n\nexport function createSetupRegistry(\n candidates: readonly unknown[],\n): SetupRegistry {\n const entries: SetupEntry[] = [];\n const byId = new Map<string, SetupEntry>();\n\n candidates.forEach((candidate) => {\n // A catalog entry without a setup block is a card, not a setup experience.\n // That is the normal case, so it is skipped rather than reported.\n if (!hasSetupBlock(candidate)) return;\n\n const { valid, errors } = validateSetupEntry(candidate);\n if (!valid) {\n console.warn(\"Rejected a setup manifest:\", errors.join(\"; \"));\n return;\n }\n\n const entry = candidate as SetupEntry;\n if (byId.has(entry.id)) {\n console.warn(\n `Rejected a setup manifest: id \"${entry.id}\" is already registered`,\n );\n return;\n }\n\n entries.push(entry);\n byId.set(entry.id, entry);\n });\n\n return {\n entries,\n findById: (id) => byId.get(id) ?? null,\n };\n}\n"],"mappings":";;AAkBA,SAAgB,EACd,GACe;CACf,IAAM,IAAwB,CAAC,GACzB,oBAAO,IAAI,IAAwB;CAyBzC,OAvBA,EAAW,SAAS,MAAc;EAGhC,IAAI,CAAC,EAAc,CAAS,GAAG;EAE/B,IAAM,EAAE,UAAO,cAAW,EAAmB,CAAS;EACtD,IAAI,CAAC,GAAO;GACV,QAAQ,KAAK,8BAA8B,EAAO,KAAK,IAAI,CAAC;GAC5D;EACF;EAEA,IAAM,IAAQ;EACd,IAAI,EAAK,IAAI,EAAM,EAAE,GAAG;GACtB,QAAQ,KACN,kCAAkC,EAAM,GAAG,wBAC7C;GACA;EACF;EAGA,AADA,EAAQ,KAAK,CAAK,GAClB,EAAK,IAAI,EAAM,IAAI,CAAK;CAC1B,CAAC,GAEM;EACL;EACA,WAAW,MAAO,EAAK,IAAI,CAAE,KAAK;CACpC;AACF"}
@@ -0,0 +1,2 @@
1
+ require("../_virtual/_rolldown/runtime.cjs");const e=require("../node_modules/@openhands/extensions/automations/index.cjs");require("./manifest-registry.cjs").createSetupRegistry(e.default);var t=e.automations_exports,n=`AUTOMATION_INTERFACE`in t?t.AUTOMATION_INTERFACE:void 0;exports.AUTOMATION_INTERFACE_CANDIDATE=n;
2
+ //# sourceMappingURL=manifest-sources.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest-sources.cjs","names":[],"sources":["../../src/manifests/manifest-sources.ts"],"sourcesContent":["/**\n * The one place that decides which manifests this host is offered.\n *\n * Setup manifests are published by `@openhands/extensions` as an optional\n * `setup` block on a catalog entry, so the catalog is the whole source. Entries\n * without one are skipped, which means the pinned package deciding to ship them\n * is the only step left — there is no wiring to add here.\n *\n * The catalog is passed as `unknown[]` on purpose: admission is a trust\n * boundary, so the host validates the published data rather than trusting the\n * types that shipped beside it.\n */\n\nimport * as automationsModule from \"@openhands/extensions/automations\";\nimport { AUTOMATION_CATALOG } from \"@openhands/extensions/automations\";\nimport { createSetupRegistry, type SetupRegistry } from \"./manifest-registry\";\n\nexport const SETUP_REGISTRY: SetupRegistry = createSetupRegistry(\n AUTOMATION_CATALOG as readonly unknown[],\n);\n\n/**\n * The interface manifest the pinned package publishes, if any. It is read off\n * the module namespace so a package that predates the export yields\n * `undefined` rather than a build error; admission in\n * `automation-interface.ts` decides what to do with it.\n */\nconst automationsExports: object = automationsModule;\nexport const AUTOMATION_INTERFACE_CANDIDATE: unknown =\n \"AUTOMATION_INTERFACE\" in automationsExports\n ? automationsExports.AUTOMATION_INTERFACE\n : undefined;\n"],"mappings":"6JAiB6C,EAAA,oBAC3C,EAAA,OACF,EAQA,IAAM,EAA6B,EAAA,oBACtB,EACX,yBAA0B,EACtB,EAAmB,qBACnB,IAAA"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The one place that decides which manifests this host is offered.
3
+ *
4
+ * Setup manifests are published by `@openhands/extensions` as an optional
5
+ * `setup` block on a catalog entry, so the catalog is the whole source. Entries
6
+ * without one are skipped, which means the pinned package deciding to ship them
7
+ * is the only step left — there is no wiring to add here.
8
+ *
9
+ * The catalog is passed as `unknown[]` on purpose: admission is a trust
10
+ * boundary, so the host validates the published data rather than trusting the
11
+ * types that shipped beside it.
12
+ */
13
+ import { type SetupRegistry } from "./manifest-registry";
14
+ export declare const SETUP_REGISTRY: SetupRegistry;
15
+ export declare const AUTOMATION_INTERFACE_CANDIDATE: unknown;
@@ -0,0 +1,8 @@
1
+ import e, { automations_exports as t } from "../node_modules/@openhands/extensions/automations/index.js";
2
+ import { createSetupRegistry as n } from "./manifest-registry.js";
3
+ n(e);
4
+ var r = t, i = "AUTOMATION_INTERFACE" in r ? r.AUTOMATION_INTERFACE : void 0;
5
+ //#endregion
6
+ export { i as AUTOMATION_INTERFACE_CANDIDATE };
7
+
8
+ //# sourceMappingURL=manifest-sources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest-sources.js","names":[],"sources":["../../src/manifests/manifest-sources.ts"],"sourcesContent":["/**\n * The one place that decides which manifests this host is offered.\n *\n * Setup manifests are published by `@openhands/extensions` as an optional\n * `setup` block on a catalog entry, so the catalog is the whole source. Entries\n * without one are skipped, which means the pinned package deciding to ship them\n * is the only step left — there is no wiring to add here.\n *\n * The catalog is passed as `unknown[]` on purpose: admission is a trust\n * boundary, so the host validates the published data rather than trusting the\n * types that shipped beside it.\n */\n\nimport * as automationsModule from \"@openhands/extensions/automations\";\nimport { AUTOMATION_CATALOG } from \"@openhands/extensions/automations\";\nimport { createSetupRegistry, type SetupRegistry } from \"./manifest-registry\";\n\nexport const SETUP_REGISTRY: SetupRegistry = createSetupRegistry(\n AUTOMATION_CATALOG as readonly unknown[],\n);\n\n/**\n * The interface manifest the pinned package publishes, if any. It is read off\n * the module namespace so a package that predates the export yields\n * `undefined` rather than a build error; admission in\n * `automation-interface.ts` decides what to do with it.\n */\nconst automationsExports: object = automationsModule;\nexport const AUTOMATION_INTERFACE_CANDIDATE: unknown =\n \"AUTOMATION_INTERFACE\" in automationsExports\n ? automationsExports.AUTOMATION_INTERFACE\n : undefined;\n"],"mappings":";;AAiB6C,EAC3C,CACF;AAQA,IAAM,IAA6B,GACtB,IACX,0BAA0B,IACtB,EAAmB,uBACnB,KAAA"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Placeholder interpolation for setup copy and request-body strings.
3
+ *
4
+ * A setup block declares what the user sees and the two request strings the
5
+ * host cannot derive as templates over a small set of namespaces. Interpolation
6
+ * is plain substitution — there is no expression language, so a setup block
7
+ * cannot express behavior here.
8
+ */
9
+ import type { SetupEntry, SetupFormValues } from "./types";
10
+ export interface SetupScope {
11
+ form?: SetupFormValues;
12
+ /** The catalog entry the setup block belongs to. */
13
+ automation?: SetupEntry;
14
+ }
15
+ /** Walk a dotted path through plain objects. */
16
+ export declare function getByPath(source: unknown, path: string): unknown;
17
+ /** Substitute placeholders inside a template string. */
18
+ export declare function interpolateText(template: string, scope: SetupScope): string;
@@ -0,0 +1,2 @@
1
+ require("../_virtual/_rolldown/runtime.cjs");const e=require("./types.cjs");var t=/^[a-z0-9]+(-[a-z0-9]+)*$/,n=/^[a-z][A-Za-z0-9]*$/,r=/<[A-Za-z/!]/,i=RegExp(`\\{\\{(?!(?:${e.SETUP_PLACEHOLDER_NAMESPACES.join(`|`)})\\.[A-Za-z0-9_.]+\\}\\})`),a=[`direct`,`assisted`],o=[`text`,`textarea`,`select`,`cron`,`timezone`,`repo-picker`],s=[`github`,`gitlab`,`bitbucket`],c=[`cron`,`event`],l=[`safeExpressionLiteral`],u=2e3;function d(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function f(e,t){return typeof e==`string`&&t.includes(e)}function p(e,t){return typeof e==`number`&&Number.isInteger(e)&&e>=t}var m=class{errors=[];fail(e,t){return this.errors.push(`${e}: ${t}`),!1}copy(e,t){return typeof e!=`string`||e.length===0?this.fail(t,`must be a non-empty string`):r.test(e)?this.fail(t,`must not contain markup`):!0}placeholders(e,t){return i.test(e)?this.fail(t,`uses an unknown placeholder namespace`):!0}templateCopy(e,t){return this.copy(e,t)&&this.placeholders(e,t)}templateValue(e,t){return typeof e!=`string`||e.length===0?this.fail(t,`must be a non-empty string`):this.placeholders(e,t)}absent(e,t,n,r){return t in e?this.fail(`${n}.${t}`,r):!0}};function h(e,t){if(!d(t)){e.fail(`requires`,`must be an object`);return}let{integrations:n,features:r}=t;!d(n)||Object.keys(n).length===0?e.fail(`requires.integrations`,`must be a non-empty object`):Object.entries(n).forEach(([t,n])=>{let r=`requires.integrations.${t}`;if(!d(n)){e.fail(r,`must be an object`);return}e.copy(n.message,`${r}.message`),`required`in n&&n.required!==!1&&e.fail(`${r}.required`,`may only be false`);let i=[`message`,`required`];Object.keys(n).filter(e=>!i.includes(e)).forEach(t=>e.fail(`${r}.${t}`,`is not allowed`))}),r!==void 0&&(!Array.isArray(r)||r.length===0?e.fail(`requires.features`,`must be a non-empty array`):r.forEach((t,n)=>{(typeof t!=`string`||t.length===0)&&e.fail(`requires.features[${n}]`,`must be a non-empty string`)}))}function g(e,t,n){if(!d(t)||Object.keys(t).length===0){e.fail(n,`must be a non-empty object`);return}let{minLength:r,maxLength:i,format:a}=t;r!==void 0&&!p(r,0)&&e.fail(`${n}.minLength`,`must be a non-negative integer`),i!==void 0&&!p(i,1)&&e.fail(`${n}.maxLength`,`must be a positive integer`),a!==void 0&&!f(a,l)&&e.fail(`${n}.format`,`is not a supported format`)}function _(e,t,n){if(!d(t)){e.fail(n,`must be an object`);return}let{type:r,label:i,help:a,placeholder:c,required:l,provider:u,options:p}=t;f(r,o)||e.fail(`${n}.type`,`is not a supported field type`),e.copy(i,`${n}.label`),e.copy(a,`${n}.help`),c!==void 0&&e.copy(c,`${n}.placeholder`),t.default!==void 0&&typeof t.default!=`string`&&e.fail(`${n}.default`,`must be a string`),typeof l!=`boolean`&&e.fail(`${n}.required`,`must be a boolean`),u!==void 0&&!f(u,s)&&e.fail(`${n}.provider`,`is not a supported provider`),r===`repo-picker`&&u===void 0&&e.fail(`${n}.provider`,`is required for a repository field`),p!==void 0&&(r===`select`?!Array.isArray(p)||p.length===0?e.fail(`${n}.options`,`must be a non-empty array`):p.forEach((t,r)=>{let i=`${n}.options[${r}]`;if(!d(t)){e.fail(i,`must be an object`);return}(typeof t.value!=`string`||t.value.length===0)&&e.fail(`${i}.value`,`must be a non-empty string`),e.copy(t.label,`${i}.label`)}):e.fail(`${n}.options`,`is only allowed on a select field`)),t.constraints!==void 0&&g(e,t.constraints,`${n}.constraints`)}function v(e,t,r){return!d(t)||Object.keys(t).length===0?(e.fail(r,`must be a non-empty object`),[]):Object.entries(t).map(([t,i])=>(n.test(t)||e.fail(`${r}.${t}`,`is not a valid field name`),_(e,i,`${r}.${t}`),t))}function y(e,t){if(!d(t))return e.fail(`setup.form`,`must be an object`),[];t.note!==void 0&&e.copy(t.note,`setup.form.note`);let n=v(e,t.args,`setup.form.args`),r=[];t.triggers!==void 0&&(!d(t.triggers)||Object.keys(t.triggers).length===0?e.fail(`setup.form.triggers`,`must be a non-empty object`):Object.entries(t.triggers).forEach(([t,i])=>{if(!f(t,c)){e.fail(`setup.form.triggers.${t}`,`is not a trigger kind`);return}r.push(t),n.push(...v(e,i,`setup.form.triggers.${t}`))}));let i=n.filter((e,t)=>n.indexOf(e)!==t);return Array.from(new Set(i)).forEach(t=>e.fail(`setup.form.${t}`,`is declared more than once`)),r}function b(e){return d(e)?[e.args,...Object.values(d(e.triggers)?e.triggers:{})].some(e=>d(e)&&Object.values(e).some(e=>d(e)&&e.type===`repo-picker`)):!1}function x(e,t){e.templateCopy(t,`setup.message`)&&t.length>u&&e.fail(`setup.message`,`must be at most ${u} characters`)}function S(e,t,n){if(!f(t.mode,a)){e.fail(`setup.mode`,`is not a supported mode`);return}if(t.mode===`direct`){e.templateValue(t.prompt,`setup.prompt`),t.message!==void 0&&x(e,t.message),n.length!==1&&e.fail(`setup.form.triggers`,`must declare exactly one trigger kind`),n.includes(`event`)&&!b(t.form)&&e.fail(`setup.form`,`must declare a repository field for an event trigger`),t.filter!==void 0&&(n.includes(`event`)?e.templateValue(t.filter,`setup.filter`):e.fail(`setup.filter`,`is only allowed for an event trigger`));return}x(e,t.message),e.absent(t,`prompt`,`setup`,`is only allowed for direct setup`),e.absent(t,`filter`,`setup`,`is only allowed for direct setup`)}function C(e){return d(e)&&e.setup!==void 0}function w(e){let n=new m;if(!d(e))return{valid:!1,errors:[`manifest: must be an object`]};let{setup:r}=e;return d(r)?r.version===`1.0`?((typeof e.id!=`string`||!t.test(e.id))&&n.fail(`id`,`must be a lowercase slug`),n.copy(e.name,`name`),n.copy(e.description,`description`),e.skill!==void 0&&(typeof e.skill!=`string`||!t.test(e.skill))&&n.fail(`skill`,`must be a lowercase slug`),h(n,e.requires),S(n,r,y(n,r.form)),{valid:n.errors.length===0,errors:n.errors}):{valid:!1,errors:[`setup.version: must be "1.0"`]}:{valid:!1,errors:[`setup: must be an object`]}}exports.hasSetupBlock=C,exports.validateSetupEntry=w;
2
+ //# sourceMappingURL=manifest-validation.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest-validation.cjs","names":[],"sources":["../../src/manifests/manifest-validation.ts"],"sourcesContent":["/**\n * Admission policy for extension-authored catalog manifests.\n *\n * A manifest is data authored in a different repository that instructs this host\n * to render copy and compose a request. The host therefore decides what a\n * manifest is *permitted* to do rather than trusting the file — validation here\n * is a trust boundary, not a convenience check, and it deliberately does not\n * defer to a schema shipped alongside the manifests it would be validating.\n *\n * Beyond mirroring the published schema, this adds the invariants the host's own\n * derivation depends on: a single trigger kind to read, a repository field for\n * an event trigger's source, and field names unique across the form. Without\n * them the derived request body would be silently wrong rather than rejected.\n *\n * A manifest that fails any check is rejected outright. It never renders a\n * partial UI, because everything downstream treats its content as instructions.\n */\n\nimport { SETUP_PLACEHOLDER_NAMESPACES, SETUP_VERSION } from \"./types\";\n\nconst ENTRY_ID_PATTERN = /^[a-z0-9]+(-[a-z0-9]+)*$/;\nconst FIELD_NAME_PATTERN = /^[a-z][A-Za-z0-9]*$/;\n/** Copy must never be able to inject markup into the host. */\nconst MARKUP_PATTERN = /<[A-Za-z/!]/;\n/** Every `{{` must open a known namespace and close immediately. */\nconst UNKNOWN_PLACEHOLDER_PATTERN = new RegExp(\n `\\\\{\\\\{(?!(?:${SETUP_PLACEHOLDER_NAMESPACES.join(\"|\")})\\\\.[A-Za-z0-9_.]+\\\\}\\\\})`,\n);\n\nconst SETUP_MODES = [\"direct\", \"assisted\"] as const;\nconst FIELD_TYPES = [\n \"text\",\n \"textarea\",\n \"select\",\n \"cron\",\n \"timezone\",\n \"repo-picker\",\n] as const;\nconst GIT_PROVIDERS = [\"github\", \"gitlab\", \"bitbucket\"] as const;\nconst TRIGGER_KINDS = [\"cron\", \"event\"] as const;\nconst CONSTRAINT_FORMATS = [\"safeExpressionLiteral\"] as const;\n\n/** Setup context only, so this can never become a channel for runtime instructions. */\nconst MAX_MESSAGE_LENGTH = 2000;\n\nexport interface SetupValidationResult {\n valid: boolean;\n errors: string[];\n}\n\ntype Rec = Record<string, unknown>;\n\nfunction isRecord(value: unknown): value is Rec {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction isOneOf<T extends readonly string[]>(\n value: unknown,\n allowed: T,\n): value is T[number] {\n return (\n typeof value === \"string\" && (allowed as readonly string[]).includes(value)\n );\n}\n\nfunction isInteger(value: unknown, minimum: number): boolean {\n return (\n typeof value === \"number\" && Number.isInteger(value) && value >= minimum\n );\n}\n\nclass SetupChecker {\n readonly errors: string[] = [];\n\n fail(path: string, reason: string): false {\n this.errors.push(`${path}: ${reason}`);\n return false;\n }\n\n /** Literal user-visible copy. Carries no markup. */\n copy(value: unknown, path: string): boolean {\n if (typeof value !== \"string\" || value.length === 0) {\n return this.fail(path, \"must be a non-empty string\");\n }\n if (MARKUP_PATTERN.test(value)) {\n return this.fail(path, \"must not contain markup\");\n }\n return true;\n }\n\n placeholders(value: string, path: string): boolean {\n if (UNKNOWN_PLACEHOLDER_PATTERN.test(value)) {\n return this.fail(path, \"uses an unknown placeholder namespace\");\n }\n return true;\n }\n\n /** Copy that may embed `{{namespace.key}}` placeholders. */\n templateCopy(value: unknown, path: string): boolean {\n return this.copy(value, path) && this.placeholders(value as string, path);\n }\n\n /**\n * A request-body string that may embed placeholders. Never rendered, so\n * expression syntax such as a JMESPath filter is allowed through.\n */\n templateValue(value: unknown, path: string): boolean {\n if (typeof value !== \"string\" || value.length === 0) {\n return this.fail(path, \"must be a non-empty string\");\n }\n return this.placeholders(value, path);\n }\n\n absent(container: Rec, key: string, path: string, reason: string): boolean {\n if (key in container) return this.fail(`${path}.${key}`, reason);\n return true;\n }\n}\n\nfunction checkRequires(check: SetupChecker, requires: unknown): void {\n if (!isRecord(requires)) {\n check.fail(\"requires\", \"must be an object\");\n return;\n }\n\n const { integrations, features } = requires;\n if (!isRecord(integrations) || Object.keys(integrations).length === 0) {\n check.fail(\"requires.integrations\", \"must be a non-empty object\");\n } else {\n Object.entries(integrations).forEach(([id, requirement]) => {\n const path = `requires.integrations.${id}`;\n if (!isRecord(requirement)) {\n check.fail(path, \"must be an object\");\n return;\n }\n check.copy(requirement.message, `${path}.message`);\n if (\"required\" in requirement && requirement.required !== false) {\n check.fail(`${path}.required`, \"may only be false\");\n }\n const allowed = [\"message\", \"required\"];\n Object.keys(requirement)\n .filter((key) => !allowed.includes(key))\n .forEach((key) => check.fail(`${path}.${key}`, \"is not allowed\"));\n });\n }\n\n if (features !== undefined) {\n if (!Array.isArray(features) || features.length === 0) {\n check.fail(\"requires.features\", \"must be a non-empty array\");\n } else {\n features.forEach((feature, index) => {\n if (typeof feature !== \"string\" || feature.length === 0) {\n check.fail(\n `requires.features[${index}]`,\n \"must be a non-empty string\",\n );\n }\n });\n }\n }\n}\n\nfunction checkConstraints(\n check: SetupChecker,\n constraints: unknown,\n path: string,\n): void {\n if (!isRecord(constraints) || Object.keys(constraints).length === 0) {\n check.fail(path, \"must be a non-empty object\");\n return;\n }\n\n const { minLength, maxLength, format } = constraints;\n if (minLength !== undefined && !isInteger(minLength, 0)) {\n check.fail(`${path}.minLength`, \"must be a non-negative integer\");\n }\n if (maxLength !== undefined && !isInteger(maxLength, 1)) {\n check.fail(`${path}.maxLength`, \"must be a positive integer\");\n }\n if (format !== undefined && !isOneOf(format, CONSTRAINT_FORMATS)) {\n check.fail(`${path}.format`, \"is not a supported format\");\n }\n}\n\nfunction checkField(check: SetupChecker, field: unknown, path: string): void {\n if (!isRecord(field)) {\n check.fail(path, \"must be an object\");\n return;\n }\n\n const { type, label, help, placeholder, required, provider, options } = field;\n\n if (!isOneOf(type, FIELD_TYPES)) {\n check.fail(`${path}.type`, \"is not a supported field type\");\n }\n check.copy(label, `${path}.label`);\n check.copy(help, `${path}.help`);\n if (placeholder !== undefined) check.copy(placeholder, `${path}.placeholder`);\n if (field.default !== undefined && typeof field.default !== \"string\") {\n check.fail(`${path}.default`, \"must be a string\");\n }\n if (typeof required !== \"boolean\") {\n check.fail(`${path}.required`, \"must be a boolean\");\n }\n if (provider !== undefined && !isOneOf(provider, GIT_PROVIDERS)) {\n check.fail(`${path}.provider`, \"is not a supported provider\");\n }\n if (type === \"repo-picker\" && provider === undefined) {\n check.fail(`${path}.provider`, \"is required for a repository field\");\n }\n\n if (options !== undefined) {\n if (type !== \"select\") {\n check.fail(`${path}.options`, \"is only allowed on a select field\");\n } else if (!Array.isArray(options) || options.length === 0) {\n check.fail(`${path}.options`, \"must be a non-empty array\");\n } else {\n options.forEach((option, index) => {\n const optionPath = `${path}.options[${index}]`;\n if (!isRecord(option)) {\n check.fail(optionPath, \"must be an object\");\n return;\n }\n if (typeof option.value !== \"string\" || option.value.length === 0) {\n check.fail(`${optionPath}.value`, \"must be a non-empty string\");\n }\n check.copy(option.label, `${optionPath}.label`);\n });\n }\n }\n\n if (field.constraints !== undefined) {\n checkConstraints(check, field.constraints, `${path}.constraints`);\n }\n}\n\n/** Returns the declared field names, so the caller can check them for collisions. */\nfunction checkFields(\n check: SetupChecker,\n fields: unknown,\n path: string,\n): string[] {\n if (!isRecord(fields) || Object.keys(fields).length === 0) {\n check.fail(path, \"must be a non-empty object\");\n return [];\n }\n\n return Object.entries(fields).map(([name, field]) => {\n if (!FIELD_NAME_PATTERN.test(name)) {\n check.fail(`${path}.${name}`, \"is not a valid field name\");\n }\n checkField(check, field, `${path}.${name}`);\n return name;\n });\n}\n\n/** Returns the trigger kinds declared, in order. */\nfunction checkForm(check: SetupChecker, form: unknown): string[] {\n if (!isRecord(form)) {\n check.fail(\"setup.form\", \"must be an object\");\n return [];\n }\n\n if (form.note !== undefined) check.copy(form.note, \"setup.form.note\");\n\n const names = checkFields(check, form.args, \"setup.form.args\");\n const kinds: string[] = [];\n\n if (form.triggers !== undefined) {\n if (!isRecord(form.triggers) || Object.keys(form.triggers).length === 0) {\n check.fail(\"setup.form.triggers\", \"must be a non-empty object\");\n } else {\n Object.entries(form.triggers).forEach(([kind, fields]) => {\n if (!isOneOf(kind, TRIGGER_KINDS)) {\n check.fail(`setup.form.triggers.${kind}`, \"is not a trigger kind\");\n return;\n }\n kinds.push(kind);\n names.push(\n ...checkFields(check, fields, `setup.form.triggers.${kind}`),\n );\n });\n }\n }\n\n // The host merges both halves into one value map, so a repeated name would\n // silently shadow a field and misaddress every error reported against it.\n const duplicates = names.filter(\n (name, index) => names.indexOf(name) !== index,\n );\n Array.from(new Set(duplicates)).forEach((name) =>\n check.fail(`setup.form.${name}`, \"is declared more than once\"),\n );\n\n return kinds;\n}\n\nfunction hasRepoPicker(form: unknown): boolean {\n if (!isRecord(form)) return false;\n const groups = [\n form.args,\n ...Object.values(isRecord(form.triggers) ? form.triggers : {}),\n ];\n return groups.some(\n (group) =>\n isRecord(group) &&\n Object.values(group).some(\n (field) => isRecord(field) && field.type === \"repo-picker\",\n ),\n );\n}\n\nfunction checkMessage(check: SetupChecker, message: unknown): void {\n if (check.templateCopy(message, \"setup.message\")) {\n if ((message as string).length > MAX_MESSAGE_LENGTH) {\n check.fail(\n \"setup.message\",\n `must be at most ${MAX_MESSAGE_LENGTH} characters`,\n );\n }\n }\n}\n\nfunction checkMode(check: SetupChecker, setup: Rec, kinds: string[]): void {\n if (!isOneOf(setup.mode, SETUP_MODES)) {\n check.fail(\"setup.mode\", \"is not a supported mode\");\n return;\n }\n\n if (setup.mode === \"direct\") {\n check.templateValue(setup.prompt, \"setup.prompt\");\n // Optional here: it seeds the fallback conversation offered when the\n // deployment cannot run the direct path.\n if (setup.message !== undefined) checkMessage(check, setup.message);\n\n // The derivation reads a single trigger kind, and an event trigger takes\n // its source from the repository field's provider.\n if (kinds.length !== 1) {\n check.fail(\n \"setup.form.triggers\",\n \"must declare exactly one trigger kind\",\n );\n }\n if (kinds.includes(\"event\") && !hasRepoPicker(setup.form)) {\n check.fail(\n \"setup.form\",\n \"must declare a repository field for an event trigger\",\n );\n }\n if (setup.filter !== undefined) {\n if (!kinds.includes(\"event\")) {\n check.fail(\"setup.filter\", \"is only allowed for an event trigger\");\n } else {\n check.templateValue(setup.filter, \"setup.filter\");\n }\n }\n return;\n }\n\n checkMessage(check, setup.message);\n check.absent(setup, \"prompt\", \"setup\", \"is only allowed for direct setup\");\n check.absent(setup, \"filter\", \"setup\", \"is only allowed for direct setup\");\n}\n\n/** Whether a catalog entry ships a setup experience at all. It is optional. */\nexport function hasSetupBlock(candidate: unknown): boolean {\n return isRecord(candidate) && candidate.setup !== undefined;\n}\n\n/**\n * Decide whether this host will act on a catalog manifest.\n *\n * The version is checked first and fails closed: a format this host does not\n * recognise is refused rather than interpreted with today's rules.\n */\nexport function validateSetupEntry(candidate: unknown): SetupValidationResult {\n const check = new SetupChecker();\n\n if (!isRecord(candidate)) {\n return { valid: false, errors: [\"manifest: must be an object\"] };\n }\n\n const { setup } = candidate;\n if (!isRecord(setup)) {\n return { valid: false, errors: [\"setup: must be an object\"] };\n }\n if (setup.version !== SETUP_VERSION) {\n return {\n valid: false,\n errors: [`setup.version: must be \"${SETUP_VERSION}\"`],\n };\n }\n\n if (\n typeof candidate.id !== \"string\" ||\n !ENTRY_ID_PATTERN.test(candidate.id)\n ) {\n check.fail(\"id\", \"must be a lowercase slug\");\n }\n check.copy(candidate.name, \"name\");\n check.copy(candidate.description, \"description\");\n if (\n candidate.skill !== undefined &&\n (typeof candidate.skill !== \"string\" ||\n !ENTRY_ID_PATTERN.test(candidate.skill))\n ) {\n check.fail(\"skill\", \"must be a lowercase slug\");\n }\n\n checkRequires(check, candidate.requires);\n const kinds = checkForm(check, setup.form);\n checkMode(check, setup, kinds);\n\n return { valid: check.errors.length === 0, errors: check.errors };\n}\n"],"mappings":"4EAoBA,IAAM,EAAmB,2BACnB,EAAqB,sBAErB,EAAiB,cAEjB,EAAkC,OACtC,eAAe,EAAA,6BAA6B,KAAK,GAAG,EAAE,0BACxD,EAEM,EAAc,CAAC,SAAU,UAAU,EACnC,EAAc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gB,EAAc,EAA6B,CACzD,OAAO,EAAS,CAAS,GAAK,EAAU,QAAU,IAAA,EACpD,CAQA,SAAgB,EAAmB,EAA2C,CAC5E,IAAM,EAAQ,IAAI,EAElB,GAAI,CAAC,EAAS,CAAS,EACrB,MAAO,CAAE,MAAO,GAAO,OAAQ,CAAC,6BAA6B,CAAE,EAGjE,GAAM,CAAE,SAAU,EA+BlB,OA9BK,EAAS,CAAK,EAGf,EAAM,UAAA,QAQR,OAAO,EAAU,IAAO,UACxB,CAAC,EAAiB,KAAK,EAAU,EAAE,IAEnC,EAAM,KAAK,KAAM,0BAA0B,EAE7C,EAAM,KAAK,EAAU,KAAM,MAAM,EACjC,EAAM,KAAK,EAAU,YAAa,aAAa,EAE7C,EAAU,QAAU,IAAA,KACnB,OAAO,EAAU,OAAU,UAC1B,CAAC,EAAiB,KAAK,EAAU,KAAK,IAExC,EAAM,KAAK,QAAS,0BAA0B,EAGhD,EAAc,EAAO,EAAU,QAAQ,EAEvC,EAAU,EAAO,EADH,EAAU,EAAO,EAAM,IACb,CAAK,EAEtB,CAAE,MAAO,EAAM,OAAO,SAAW,EAAG,OAAQ,EAAM,MAAO,GA1BvD,CACL,MAAO,GACP,OAAQ,CAAC,8BAA2C,CACtD,EANO,CAAE,MAAO,GAAO,OAAQ,CAAC,0BAA0B,CAAE,CA8BhE"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Admission policy for extension-authored catalog manifests.
3
+ *
4
+ * A manifest is data authored in a different repository that instructs this host
5
+ * to render copy and compose a request. The host therefore decides what a
6
+ * manifest is *permitted* to do rather than trusting the file — validation here
7
+ * is a trust boundary, not a convenience check, and it deliberately does not
8
+ * defer to a schema shipped alongside the manifests it would be validating.
9
+ *
10
+ * Beyond mirroring the published schema, this adds the invariants the host's own
11
+ * derivation depends on: a single trigger kind to read, a repository field for
12
+ * an event trigger's source, and field names unique across the form. Without
13
+ * them the derived request body would be silently wrong rather than rejected.
14
+ *
15
+ * A manifest that fails any check is rejected outright. It never renders a
16
+ * partial UI, because everything downstream treats its content as instructions.
17
+ */
18
+ export interface SetupValidationResult {
19
+ valid: boolean;
20
+ errors: string[];
21
+ }
22
+ /** Whether a catalog entry ships a setup experience at all. It is optional. */
23
+ export declare function hasSetupBlock(candidate: unknown): boolean;
24
+ /**
25
+ * Decide whether this host will act on a catalog manifest.
26
+ *
27
+ * The version is checked first and fails closed: a format this host does not
28
+ * recognise is refused rather than interpreted with today's rules.
29
+ */
30
+ export declare function validateSetupEntry(candidate: unknown): SetupValidationResult;
@@ -0,0 +1,145 @@
1
+ import { SETUP_PLACEHOLDER_NAMESPACES as e } from "./types.js";
2
+ //#region src/manifests/manifest-validation.ts
3
+ var t = /^[a-z0-9]+(-[a-z0-9]+)*$/, n = /^[a-z][A-Za-z0-9]*$/, r = /<[A-Za-z/!]/, i = RegExp(`\\{\\{(?!(?:${e.join("|")})\\.[A-Za-z0-9_.]+\\}\\})`), a = ["direct", "assisted"], o = [
4
+ "text",
5
+ "textarea",
6
+ "select",
7
+ "cron",
8
+ "timezone",
9
+ "repo-picker"
10
+ ], s = [
11
+ "github",
12
+ "gitlab",
13
+ "bitbucket"
14
+ ], c = ["cron", "event"], l = ["safeExpressionLiteral"], u = 2e3;
15
+ function d(e) {
16
+ return typeof e == "object" && !!e && !Array.isArray(e);
17
+ }
18
+ function f(e, t) {
19
+ return typeof e == "string" && t.includes(e);
20
+ }
21
+ function p(e, t) {
22
+ return typeof e == "number" && Number.isInteger(e) && e >= t;
23
+ }
24
+ var m = class {
25
+ errors = [];
26
+ fail(e, t) {
27
+ return this.errors.push(`${e}: ${t}`), !1;
28
+ }
29
+ copy(e, t) {
30
+ return typeof e != "string" || e.length === 0 ? this.fail(t, "must be a non-empty string") : r.test(e) ? this.fail(t, "must not contain markup") : !0;
31
+ }
32
+ placeholders(e, t) {
33
+ return i.test(e) ? this.fail(t, "uses an unknown placeholder namespace") : !0;
34
+ }
35
+ templateCopy(e, t) {
36
+ return this.copy(e, t) && this.placeholders(e, t);
37
+ }
38
+ templateValue(e, t) {
39
+ return typeof e != "string" || e.length === 0 ? this.fail(t, "must be a non-empty string") : this.placeholders(e, t);
40
+ }
41
+ absent(e, t, n, r) {
42
+ return t in e ? this.fail(`${n}.${t}`, r) : !0;
43
+ }
44
+ };
45
+ function h(e, t) {
46
+ if (!d(t)) {
47
+ e.fail("requires", "must be an object");
48
+ return;
49
+ }
50
+ let { integrations: n, features: r } = t;
51
+ !d(n) || Object.keys(n).length === 0 ? e.fail("requires.integrations", "must be a non-empty object") : Object.entries(n).forEach(([t, n]) => {
52
+ let r = `requires.integrations.${t}`;
53
+ if (!d(n)) {
54
+ e.fail(r, "must be an object");
55
+ return;
56
+ }
57
+ e.copy(n.message, `${r}.message`), "required" in n && n.required !== !1 && e.fail(`${r}.required`, "may only be false");
58
+ let i = ["message", "required"];
59
+ Object.keys(n).filter((e) => !i.includes(e)).forEach((t) => e.fail(`${r}.${t}`, "is not allowed"));
60
+ }), r !== void 0 && (!Array.isArray(r) || r.length === 0 ? e.fail("requires.features", "must be a non-empty array") : r.forEach((t, n) => {
61
+ (typeof t != "string" || t.length === 0) && e.fail(`requires.features[${n}]`, "must be a non-empty string");
62
+ }));
63
+ }
64
+ function g(e, t, n) {
65
+ if (!d(t) || Object.keys(t).length === 0) {
66
+ e.fail(n, "must be a non-empty object");
67
+ return;
68
+ }
69
+ let { minLength: r, maxLength: i, format: a } = t;
70
+ r !== void 0 && !p(r, 0) && e.fail(`${n}.minLength`, "must be a non-negative integer"), i !== void 0 && !p(i, 1) && e.fail(`${n}.maxLength`, "must be a positive integer"), a !== void 0 && !f(a, l) && e.fail(`${n}.format`, "is not a supported format");
71
+ }
72
+ function _(e, t, n) {
73
+ if (!d(t)) {
74
+ e.fail(n, "must be an object");
75
+ return;
76
+ }
77
+ let { type: r, label: i, help: a, placeholder: c, required: l, provider: u, options: p } = t;
78
+ f(r, o) || e.fail(`${n}.type`, "is not a supported field type"), e.copy(i, `${n}.label`), e.copy(a, `${n}.help`), c !== void 0 && e.copy(c, `${n}.placeholder`), t.default !== void 0 && typeof t.default != "string" && e.fail(`${n}.default`, "must be a string"), typeof l != "boolean" && e.fail(`${n}.required`, "must be a boolean"), u !== void 0 && !f(u, s) && e.fail(`${n}.provider`, "is not a supported provider"), r === "repo-picker" && u === void 0 && e.fail(`${n}.provider`, "is required for a repository field"), p !== void 0 && (r === "select" ? !Array.isArray(p) || p.length === 0 ? e.fail(`${n}.options`, "must be a non-empty array") : p.forEach((t, r) => {
79
+ let i = `${n}.options[${r}]`;
80
+ if (!d(t)) {
81
+ e.fail(i, "must be an object");
82
+ return;
83
+ }
84
+ (typeof t.value != "string" || t.value.length === 0) && e.fail(`${i}.value`, "must be a non-empty string"), e.copy(t.label, `${i}.label`);
85
+ }) : e.fail(`${n}.options`, "is only allowed on a select field")), t.constraints !== void 0 && g(e, t.constraints, `${n}.constraints`);
86
+ }
87
+ function v(e, t, r) {
88
+ return !d(t) || Object.keys(t).length === 0 ? (e.fail(r, "must be a non-empty object"), []) : Object.entries(t).map(([t, i]) => (n.test(t) || e.fail(`${r}.${t}`, "is not a valid field name"), _(e, i, `${r}.${t}`), t));
89
+ }
90
+ function y(e, t) {
91
+ if (!d(t)) return e.fail("setup.form", "must be an object"), [];
92
+ t.note !== void 0 && e.copy(t.note, "setup.form.note");
93
+ let n = v(e, t.args, "setup.form.args"), r = [];
94
+ t.triggers !== void 0 && (!d(t.triggers) || Object.keys(t.triggers).length === 0 ? e.fail("setup.form.triggers", "must be a non-empty object") : Object.entries(t.triggers).forEach(([t, i]) => {
95
+ if (!f(t, c)) {
96
+ e.fail(`setup.form.triggers.${t}`, "is not a trigger kind");
97
+ return;
98
+ }
99
+ r.push(t), n.push(...v(e, i, `setup.form.triggers.${t}`));
100
+ }));
101
+ let i = n.filter((e, t) => n.indexOf(e) !== t);
102
+ return Array.from(new Set(i)).forEach((t) => e.fail(`setup.form.${t}`, "is declared more than once")), r;
103
+ }
104
+ function b(e) {
105
+ return d(e) ? [e.args, ...Object.values(d(e.triggers) ? e.triggers : {})].some((e) => d(e) && Object.values(e).some((e) => d(e) && e.type === "repo-picker")) : !1;
106
+ }
107
+ function x(e, t) {
108
+ e.templateCopy(t, "setup.message") && t.length > u && e.fail("setup.message", `must be at most ${u} characters`);
109
+ }
110
+ function S(e, t, n) {
111
+ if (!f(t.mode, a)) {
112
+ e.fail("setup.mode", "is not a supported mode");
113
+ return;
114
+ }
115
+ if (t.mode === "direct") {
116
+ e.templateValue(t.prompt, "setup.prompt"), t.message !== void 0 && x(e, t.message), n.length !== 1 && e.fail("setup.form.triggers", "must declare exactly one trigger kind"), n.includes("event") && !b(t.form) && e.fail("setup.form", "must declare a repository field for an event trigger"), t.filter !== void 0 && (n.includes("event") ? e.templateValue(t.filter, "setup.filter") : e.fail("setup.filter", "is only allowed for an event trigger"));
117
+ return;
118
+ }
119
+ x(e, t.message), e.absent(t, "prompt", "setup", "is only allowed for direct setup"), e.absent(t, "filter", "setup", "is only allowed for direct setup");
120
+ }
121
+ function C(e) {
122
+ return d(e) && e.setup !== void 0;
123
+ }
124
+ function w(e) {
125
+ let n = new m();
126
+ if (!d(e)) return {
127
+ valid: !1,
128
+ errors: ["manifest: must be an object"]
129
+ };
130
+ let { setup: r } = e;
131
+ return d(r) ? r.version === "1.0" ? ((typeof e.id != "string" || !t.test(e.id)) && n.fail("id", "must be a lowercase slug"), n.copy(e.name, "name"), n.copy(e.description, "description"), e.skill !== void 0 && (typeof e.skill != "string" || !t.test(e.skill)) && n.fail("skill", "must be a lowercase slug"), h(n, e.requires), S(n, r, y(n, r.form)), {
132
+ valid: n.errors.length === 0,
133
+ errors: n.errors
134
+ }) : {
135
+ valid: !1,
136
+ errors: ["setup.version: must be \"1.0\""]
137
+ } : {
138
+ valid: !1,
139
+ errors: ["setup: must be an object"]
140
+ };
141
+ }
142
+ //#endregion
143
+ export { C as hasSetupBlock, w as validateSetupEntry };
144
+
145
+ //# sourceMappingURL=manifest-validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest-validation.js","names":[],"sources":["../../src/manifests/manifest-validation.ts"],"sourcesContent":["/**\n * Admission policy for extension-authored catalog manifests.\n *\n * A manifest is data authored in a different repository that instructs this host\n * to render copy and compose a request. The host therefore decides what a\n * manifest is *permitted* to do rather than trusting the file — validation here\n * is a trust boundary, not a convenience check, and it deliberately does not\n * defer to a schema shipped alongside the manifests it would be validating.\n *\n * Beyond mirroring the published schema, this adds the invariants the host's own\n * derivation depends on: a single trigger kind to read, a repository field for\n * an event trigger's source, and field names unique across the form. Without\n * them the derived request body would be silently wrong rather than rejected.\n *\n * A manifest that fails any check is rejected outright. It never renders a\n * partial UI, because everything downstream treats its content as instructions.\n */\n\nimport { SETUP_PLACEHOLDER_NAMESPACES, SETUP_VERSION } from \"./types\";\n\nconst ENTRY_ID_PATTERN = /^[a-z0-9]+(-[a-z0-9]+)*$/;\nconst FIELD_NAME_PATTERN = /^[a-z][A-Za-z0-9]*$/;\n/** Copy must never be able to inject markup into the host. */\nconst MARKUP_PATTERN = /<[A-Za-z/!]/;\n/** Every `{{` must open a known namespace and close immediately. */\nconst UNKNOWN_PLACEHOLDER_PATTERN = new RegExp(\n `\\\\{\\\\{(?!(?:${SETUP_PLACEHOLDER_NAMESPACES.join(\"|\")})\\\\.[A-Za-z0-9_.]+\\\\}\\\\})`,\n);\n\nconst SETUP_MODES = [\"direct\", \"assisted\"] as const;\nconst FIELD_TYPES = [\n \"text\",\n \"textarea\",\n \"select\",\n \"cron\",\n \"timezone\",\n \"repo-picker\",\n] as const;\nconst GIT_PROVIDERS = [\"github\", \"gitlab\", \"bitbucket\"] as const;\nconst TRIGGER_KINDS = [\"cron\", \"event\"] as const;\nconst CONSTRAINT_FORMATS = [\"safeExpressionLiteral\"] as const;\n\n/** Setup context only, so this can never become a channel for runtime instructions. */\nconst MAX_MESSAGE_LENGTH = 2000;\n\nexport interface SetupValidationResult {\n valid: boolean;\n errors: string[];\n}\n\ntype Rec = Record<string, unknown>;\n\nfunction isRecord(value: unknown): value is Rec {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction isOneOf<T extends readonly string[]>(\n value: unknown,\n allowed: T,\n): value is T[number] {\n return (\n typeof value === \"string\" && (allowed as readonly string[]).includes(value)\n );\n}\n\nfunction isInteger(value: unknown, minimum: number): boolean {\n return (\n typeof value === \"number\" && Number.isInteger(value) && value >= minimum\n );\n}\n\nclass SetupChecker {\n readonly errors: string[] = [];\n\n fail(path: string, reason: string): false {\n this.errors.push(`${path}: ${reason}`);\n return false;\n }\n\n /** Literal user-visible copy. Carries no markup. */\n copy(value: unknown, path: string): boolean {\n if (typeof value !== \"string\" || value.length === 0) {\n return this.fail(path, \"must be a non-empty string\");\n }\n if (MARKUP_PATTERN.test(value)) {\n return this.fail(path, \"must not contain markup\");\n }\n return true;\n }\n\n placeholders(value: string, path: string): boolean {\n if (UNKNOWN_PLACEHOLDER_PATTERN.test(value)) {\n return this.fail(path, \"uses an unknown placeholder namespace\");\n }\n return true;\n }\n\n /** Copy that may embed `{{namespace.key}}` placeholders. */\n templateCopy(value: unknown, path: string): boolean {\n return this.copy(value, path) && this.placeholders(value as string, path);\n }\n\n /**\n * A request-body string that may embed placeholders. Never rendered, so\n * expression syntax such as a JMESPath filter is allowed through.\n */\n templateValue(value: unknown, path: string): boolean {\n if (typeof value !== \"string\" || value.length === 0) {\n return this.fail(path, \"must be a non-empty string\");\n }\n return this.placeholders(value, path);\n }\n\n absent(container: Rec, key: string, path: string, reason: string): boolean {\n if (key in container) return this.fail(`${path}.${key}`, reason);\n return true;\n }\n}\n\nfunction checkRequires(check: SetupChecker, requires: unknown): void {\n if (!isRecord(requires)) {\n check.fail(\"requires\", \"must be an object\");\n return;\n }\n\n const { integrations, features } = requires;\n if (!isRecord(integrations) || Object.keys(integrations).length === 0) {\n check.fail(\"requires.integrations\", \"must be a non-empty object\");\n } else {\n Object.entries(integrations).forEach(([id, requirement]) => {\n const path = `requires.integrations.${id}`;\n if (!isRecord(requirement)) {\n check.fail(path, \"must be an object\");\n return;\n }\n check.copy(requirement.message, `${path}.message`);\n if (\"required\" in requirement && requirement.required !== false) {\n check.fail(`${path}.required`, \"may only be false\");\n }\n const allowed = [\"message\", \"required\"];\n Object.keys(requirement)\n .filter((key) => !allowed.includes(key))\n .forEach((key) => check.fail(`${path}.${key}`, \"is not allowed\"));\n });\n }\n\n if (features !== undefined) {\n if (!Array.isArray(features) || features.length === 0) {\n check.fail(\"requires.features\", \"must be a non-empty array\");\n } else {\n features.forEach((feature, index) => {\n if (typeof feature !== \"string\" || feature.length === 0) {\n check.fail(\n `requires.features[${index}]`,\n \"must be a non-empty string\",\n );\n }\n });\n }\n }\n}\n\nfunction checkConstraints(\n check: SetupChecker,\n constraints: unknown,\n path: string,\n): void {\n if (!isRecord(constraints) || Object.keys(constraints).length === 0) {\n check.fail(path, \"must be a non-empty object\");\n return;\n }\n\n const { minLength, maxLength, format } = constraints;\n if (minLength !== undefined && !isInteger(minLength, 0)) {\n check.fail(`${path}.minLength`, \"must be a non-negative integer\");\n }\n if (maxLength !== undefined && !isInteger(maxLength, 1)) {\n check.fail(`${path}.maxLength`, \"must be a positive integer\");\n }\n if (format !== undefined && !isOneOf(format, CONSTRAINT_FORMATS)) {\n check.fail(`${path}.format`, \"is not a supported format\");\n }\n}\n\nfunction checkField(check: SetupChecker, field: unknown, path: string): void {\n if (!isRecord(field)) {\n check.fail(path, \"must be an object\");\n return;\n }\n\n const { type, label, help, placeholder, required, provider, options } = field;\n\n if (!isOneOf(type, FIELD_TYPES)) {\n check.fail(`${path}.type`, \"is not a supported field type\");\n }\n check.copy(label, `${path}.label`);\n check.copy(help, `${path}.help`);\n if (placeholder !== undefined) check.copy(placeholder, `${path}.placeholder`);\n if (field.default !== undefined && typeof field.default !== \"string\") {\n check.fail(`${path}.default`, \"must be a string\");\n }\n if (typeof required !== \"boolean\") {\n check.fail(`${path}.required`, \"must be a boolean\");\n }\n if (provider !== undefined && !isOneOf(provider, GIT_PROVIDERS)) {\n check.fail(`${path}.provider`, \"is not a supported provider\");\n }\n if (type === \"repo-picker\" && provider === undefined) {\n check.fail(`${path}.provider`, \"is required for a repository field\");\n }\n\n if (options !== undefined) {\n if (type !== \"select\") {\n check.fail(`${path}.options`, \"is only allowed on a select field\");\n } else if (!Array.isArray(options) || options.length === 0) {\n check.fail(`${path}.options`, \"must be a non-empty array\");\n } else {\n options.forEach((option, index) => {\n const optionPath = `${path}.options[${index}]`;\n if (!isRecord(option)) {\n check.fail(optionPath, \"must be an object\");\n return;\n }\n if (typeof option.value !== \"string\" || option.value.length === 0) {\n check.fail(`${optionPath}.value`, \"must be a non-empty string\");\n }\n check.copy(option.label, `${optionPath}.label`);\n });\n }\n }\n\n if (field.constraints !== undefined) {\n checkConstraints(check, field.constraints, `${path}.constraints`);\n }\n}\n\n/** Returns the declared field names, so the caller can check them for collisions. */\nfunction checkFields(\n check: SetupChecker,\n fields: unknown,\n path: string,\n): string[] {\n if (!isRecord(fields) || Object.keys(fields).length === 0) {\n check.fail(path, \"must be a non-empty object\");\n return [];\n }\n\n return Object.entries(fields).map(([name, field]) => {\n if (!FIELD_NAME_PATTERN.test(name)) {\n check.fail(`${path}.${name}`, \"is not a valid field name\");\n }\n checkField(check, field, `${path}.${name}`);\n return name;\n });\n}\n\n/** Returns the trigger kinds declared, in order. */\nfunction checkForm(check: SetupChecker, form: unknown): string[] {\n if (!isRecord(form)) {\n check.fail(\"setup.form\", \"must be an object\");\n return [];\n }\n\n if (form.note !== undefined) check.copy(form.note, \"setup.form.note\");\n\n const names = checkFields(check, form.args, \"setup.form.args\");\n const kinds: string[] = [];\n\n if (form.triggers !== undefined) {\n if (!isRecord(form.triggers) || Object.keys(form.triggers).length === 0) {\n check.fail(\"setup.form.triggers\", \"must be a non-empty object\");\n } else {\n Object.entries(form.triggers).forEach(([kind, fields]) => {\n if (!isOneOf(kind, TRIGGER_KINDS)) {\n check.fail(`setup.form.triggers.${kind}`, \"is not a trigger kind\");\n return;\n }\n kinds.push(kind);\n names.push(\n ...checkFields(check, fields, `setup.form.triggers.${kind}`),\n );\n });\n }\n }\n\n // The host merges both halves into one value map, so a repeated name would\n // silently shadow a field and misaddress every error reported against it.\n const duplicates = names.filter(\n (name, index) => names.indexOf(name) !== index,\n );\n Array.from(new Set(duplicates)).forEach((name) =>\n check.fail(`setup.form.${name}`, \"is declared more than once\"),\n );\n\n return kinds;\n}\n\nfunction hasRepoPicker(form: unknown): boolean {\n if (!isRecord(form)) return false;\n const groups = [\n form.args,\n ...Object.values(isRecord(form.triggers) ? form.triggers : {}),\n ];\n return groups.some(\n (group) =>\n isRecord(group) &&\n Object.values(group).some(\n (field) => isRecord(field) && field.type === \"repo-picker\",\n ),\n );\n}\n\nfunction checkMessage(check: SetupChecker, message: unknown): void {\n if (check.templateCopy(message, \"setup.message\")) {\n if ((message as string).length > MAX_MESSAGE_LENGTH) {\n check.fail(\n \"setup.message\",\n `must be at most ${MAX_MESSAGE_LENGTH} characters`,\n );\n }\n }\n}\n\nfunction checkMode(check: SetupChecker, setup: Rec, kinds: string[]): void {\n if (!isOneOf(setup.mode, SETUP_MODES)) {\n check.fail(\"setup.mode\", \"is not a supported mode\");\n return;\n }\n\n if (setup.mode === \"direct\") {\n check.templateValue(setup.prompt, \"setup.prompt\");\n // Optional here: it seeds the fallback conversation offered when the\n // deployment cannot run the direct path.\n if (setup.message !== undefined) checkMessage(check, setup.message);\n\n // The derivation reads a single trigger kind, and an event trigger takes\n // its source from the repository field's provider.\n if (kinds.length !== 1) {\n check.fail(\n \"setup.form.triggers\",\n \"must declare exactly one trigger kind\",\n );\n }\n if (kinds.includes(\"event\") && !hasRepoPicker(setup.form)) {\n check.fail(\n \"setup.form\",\n \"must declare a repository field for an event trigger\",\n );\n }\n if (setup.filter !== undefined) {\n if (!kinds.includes(\"event\")) {\n check.fail(\"setup.filter\", \"is only allowed for an event trigger\");\n } else {\n check.templateValue(setup.filter, \"setup.filter\");\n }\n }\n return;\n }\n\n checkMessage(check, setup.message);\n check.absent(setup, \"prompt\", \"setup\", \"is only allowed for direct setup\");\n check.absent(setup, \"filter\", \"setup\", \"is only allowed for direct setup\");\n}\n\n/** Whether a catalog entry ships a setup experience at all. It is optional. */\nexport function hasSetupBlock(candidate: unknown): boolean {\n return isRecord(candidate) && candidate.setup !== undefined;\n}\n\n/**\n * Decide whether this host will act on a catalog manifest.\n *\n * The version is checked first and fails closed: a format this host does not\n * recognise is refused rather than interpreted with today's rules.\n */\nexport function validateSetupEntry(candidate: unknown): SetupValidationResult {\n const check = new SetupChecker();\n\n if (!isRecord(candidate)) {\n return { valid: false, errors: [\"manifest: must be an object\"] };\n }\n\n const { setup } = candidate;\n if (!isRecord(setup)) {\n return { valid: false, errors: [\"setup: must be an object\"] };\n }\n if (setup.version !== SETUP_VERSION) {\n return {\n valid: false,\n errors: [`setup.version: must be \"${SETUP_VERSION}\"`],\n };\n }\n\n if (\n typeof candidate.id !== \"string\" ||\n !ENTRY_ID_PATTERN.test(candidate.id)\n ) {\n check.fail(\"id\", \"must be a lowercase slug\");\n }\n check.copy(candidate.name, \"name\");\n check.copy(candidate.description, \"description\");\n if (\n candidate.skill !== undefined &&\n (typeof candidate.skill !== \"string\" ||\n !ENTRY_ID_PATTERN.test(candidate.skill))\n ) {\n check.fail(\"skill\", \"must be a lowercase slug\");\n }\n\n checkRequires(check, candidate.requires);\n const kinds = checkForm(check, setup.form);\n checkMode(check, setup, kinds);\n\n return { valid: check.errors.length === 0, errors: check.errors };\n}\n"],"mappings":";;AAoBA,IAAM,IAAmB,4BACnB,IAAqB,uBAErB,IAAiB,eAEjB,IAAkC,OACtC,eAAe,EAA6B,KAAK,GAAG,EAAE,0BACxD,GAEM,IAAc,CAAC,UAAU,UAAU,GACnC,IAAc;CAClB;CACA;CACA;CACA;CACA;CACA;AACF,GACM,IAAgB;CAAC;CAAU;CAAU;AAAW,GAChD,IAAgB,CAAC,QAAQ,OAAO,GAChC,IAAqB,CAAC,uBAAuB,GAG7C,IAAqB;AAS3B,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D;AAQA,SAAgB,EAAmB,GAA2C;CAC5E,IAAM,IAAQ,IAAI,EAAa;CAE/B,IAAI,CAAC,EAAS,CAAS,GACrB,OAAO;EAAE,OAAO;EAAO,QAAQ,CAAC,6BAA6B;CAAE;CAGjE,IAAM,EAAE,aAAU;CA+BlB,OA9BK,EAAS,CAAK,IAGf,EAAM,YAAA,UAQR,OAAO,EAAU,MAAO,YACxB,CAAC,EAAiB,KAAK,EAAU,EAAE,MAEnC,EAAM,KAAK,MAAM,0BAA0B,GAE7C,EAAM,KAAK,EAAU,MAAM,MAAM,GACjC,EAAM,KAAK,EAAU,aAAa,aAAa,GAE7C,EAAU,UAAU,KAAA,MACnB,OAAO,EAAU,SAAU,YAC1B,CAAC,EAAiB,KAAK,EAAU,KAAK,MAExC,EAAM,KAAK,SAAS,0BAA0B,GAGhD,EAAc,GAAO,EAAU,QAAQ,GAEvC,EAAU,GAAO,GADH,EAAU,GAAO,EAAM,IACb,CAAK,GAEtB;EAAE,OAAO,EAAM,OAAO,WAAW;EAAG,QAAQ,EAAM;CAAO,KA1BvD;EACL,OAAO;EACP,QAAQ,CAAC,gCAA2C;CACtD,IANO;EAAE,OAAO;EAAO,QAAQ,CAAC,0BAA0B;CAAE;AA8BhE"}
@@ -0,0 +1,2 @@
1
+ require("../_virtual/_rolldown/runtime.cjs");var e=[`form`,`automation`];exports.SETUP_PLACEHOLDER_NAMESPACES=e;
2
+ //# sourceMappingURL=types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.cjs","names":[],"sources":["../../src/manifests/types.ts"],"sourcesContent":["/**\n * Host-owned shape of an extension-authored setup experience.\n *\n * A catalog entry is declarative data published by `@openhands/extensions`. Its\n * optional `setup` block says what to ask a user for; everything derivable from\n * that — the request to send, the route, the review screen, the analytics — is\n * this host's to generate, so none of it appears here.\n *\n * The names mirror `@openhands/extensions/automations`' own declarations, so an\n * entry from the published package assigns without an adapter.\n */\n\nexport const SETUP_VERSION = \"1.0\";\n\nexport type SetupMode = \"direct\" | \"assisted\";\n\nexport type SetupFieldType =\n | \"text\"\n | \"textarea\"\n | \"select\"\n | \"cron\"\n | \"timezone\"\n | \"repo-picker\";\n\nexport type SetupGitProvider = \"github\" | \"gitlab\" | \"bitbucket\";\n\nexport type SetupTriggerKind = \"cron\" | \"event\";\n\n/** Placeholder namespaces a setup block may reference inside `{{...}}`. */\nexport const SETUP_PLACEHOLDER_NAMESPACES = [\"form\", \"automation\"] as const;\n\nexport interface SetupFieldOption {\n value: string;\n label: string;\n}\n\nexport interface SetupFieldConstraints {\n minLength?: number;\n maxLength?: number;\n /**\n * A host-implemented check named from a closed set. Entries supply no regex\n * of their own, so they cannot hand the host a pathological pattern.\n */\n format?: \"safeExpressionLiteral\";\n}\n\nexport interface SetupFormField {\n type: SetupFieldType;\n label: string;\n help: string;\n placeholder?: string;\n default?: string;\n required: boolean;\n provider?: SetupGitProvider;\n options?: SetupFieldOption[];\n constraints?: SetupFieldConstraints;\n}\n\n/** Keyed by field name, which is what `{{form.<name>}}` resolves against. */\nexport type SetupFormFields = Record<string, SetupFormField>;\n\nexport interface SetupForm {\n note?: string;\n /** Inputs that decide when the automation runs, keyed by trigger kind. */\n triggers?: Partial<Record<SetupTriggerKind, SetupFormFields>>;\n /** Every other input: the arguments to the automation itself. */\n args: SetupFormFields;\n}\n\nexport interface SetupBlock {\n version: typeof SETUP_VERSION;\n mode: SetupMode;\n form: SetupForm;\n /** direct only. What the automation is told to do. */\n prompt?: string;\n /** direct only, event trigger only. Which delivered events belong to it. */\n filter?: string;\n /**\n * Setup context for the conversation that finishes setup. Required for\n * assisted mode. Optional for direct mode, where it seeds the fallback\n * conversation offered when the deployment cannot run the direct path.\n */\n message?: string;\n}\n\nexport interface SetupIntegrationRequirement {\n /** Why this entry needs the integration. */\n message: string;\n /** Defaults to true. `false` lets setup continue while it is unconnected. */\n required?: false;\n}\n\nexport interface SetupPrerequisites {\n /** Keyed by integration catalog id. */\n integrations: Record<string, SetupIntegrationRequirement>;\n /** Deployment capabilities this entry cannot run without. */\n features?: string[];\n}\n\n/**\n * The part of a catalog entry this host reads. An admitted entry always has a\n * `setup` block; entries without one are simply not setup entries.\n */\nexport interface SetupEntry {\n id: string;\n name: string;\n description: string;\n requires: SetupPrerequisites;\n /** The skill that owns the launch command. Defaults to `id`. */\n skill?: string;\n setup: SetupBlock;\n}\n\nexport type SetupPayloadValue =\n | string\n | number\n | boolean\n | null\n | SetupPayloadValue[]\n | { [key: string]: SetupPayloadValue };\n\nexport interface SetupRequestBody {\n [key: string]: SetupPayloadValue;\n}\n\n/** Form values are collected as strings; the payload mapping shapes them. */\nexport type SetupFormValues = Record<string, string>;\n\n/** `GET /v1/capabilities` — what this deployment supports. */\nexport interface DeploymentCapabilities {\n ready: boolean;\n triggerKinds: string[];\n eventSources: string[];\n eventTypes: string[];\n triggers: {\n cron?: { minIntervalSeconds: number; timezones: string[] };\n event?: { filterLanguage: string; filterFunctions: string[] };\n };\n features: string[];\n}\n\n/** A single problem with a draft, addressed to the field that caused it. */\nexport interface DraftValidationError {\n /** Dotted path into the draft. Null when the problem spans the whole draft. */\n field: string | null;\n code: string;\n message: string;\n}\n\n/** `POST /v1/validate` — an invalid draft is still a 200. */\nexport interface ValidateDraftResponse {\n valid: boolean;\n errors: DraftValidationError[];\n sampleEventMatched?: boolean | null;\n}\n\n/**\n * Host-owned shape of the production Automation interface manifest, published\n * by `@openhands/extensions/automations` as `AUTOMATION_INTERFACE`.\n *\n * The catalog states what varies per automation; this states the domain-level\n * facts of the interface itself. As with setup entries, the published data is\n * validated at admission rather than trusted, and a package that predates the\n * manifest simply leaves the host on its own defaults.\n */\n\nexport const INTERFACE_VERSION = \"1.0\";\n\n/** The closed set of runtime-model properties a client may offer for setting. */\nexport type AutomationAttributeName =\n | \"name\"\n | \"prompt\"\n | \"model\"\n | \"timeout\"\n | \"schedule\";\n\nexport type InterfaceAttributeType =\n | \"text\"\n | \"textarea\"\n | \"number\"\n | \"llm-profile\"\n | \"schedule\";\n\n/** How one settable attribute of an existing Automation is offered. */\nexport interface InterfaceAttribute {\n type: InterfaceAttributeType;\n label: string;\n help?: string;\n required: boolean;\n /** Only a `number` attribute carries constraints. */\n constraints?: { min?: number; max?: number };\n}\n\nexport interface InterfaceRoutes {\n list: string;\n /** Carries the `:automationId` segment the host substitutes. */\n setup: string;\n /** Carries the `:automationId` segment the host substitutes. */\n detail: string;\n}\n\n/**\n * Service-relative paths the host calls. The base path, methods, headers, and\n * auth remain the host's. `{id}` marks where the automation id is substituted.\n */\nexport interface InterfaceEndpoints {\n list: string;\n detail: string;\n dispatch: string;\n runs: string;\n tarball: string;\n health: string;\n capabilities: string;\n validate: string;\n createPrompt: string;\n createPlugin: string;\n}\n\nexport type InterfaceEndpointName = keyof InterfaceEndpoints;\n\nexport interface InterfaceImportExport {\n fileKind: string;\n fileVersion: number;\n filenameSuffix: string;\n importDefaults: {\n /** Provider inferred for short owner/repo repository URLs on import. */\n repoProvider: SetupGitProvider;\n /** Event source of the placeholder trigger that keeps an import inert. */\n placeholderEventSource: string;\n };\n}\n\nexport interface InterfaceManifest {\n version: typeof INTERFACE_VERSION;\n routes: InterfaceRoutes;\n navigation: {\n sidebar: { label: string };\n commandMenu: { title: string; description: string; keywords: string };\n };\n pages: {\n list: { title: string; subtitle: string };\n detail: { backLabel: string };\n edit: { title: string };\n };\n docsUrl: string;\n /**\n * The input surface of an existing Automation, keyed by the runtime-model\n * property the host sends. Rendering it as an edit dialog is this host's\n * choice, not stated here.\n */\n attributes: Partial<Record<AutomationAttributeName, InterfaceAttribute>>;\n importExport: InterfaceImportExport;\n endpoints: InterfaceEndpoints;\n featuredAutomationIds: string[];\n responderIntegrationIds: string[];\n}\n"],"mappings":"6CA6BA,IAAa,EAA+B,CAAC,OAAQ,YAAY"}