@kortix/ui 0.14.8 → 0.14.10

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 (567) hide show
  1. package/README.md +2 -2
  2. package/dist/_vendor/kortix-shared.js +116 -3
  3. package/dist/_vendor/shared/app-config.d.ts +175 -0
  4. package/dist/_vendor/shared/artifact-comments.d.ts +235 -0
  5. package/dist/_vendor/shared/channel-descriptors.d.ts +96 -0
  6. package/dist/_vendor/shared/channel-message.d.ts +45 -5
  7. package/dist/_vendor/shared/index.d.ts +2 -0
  8. package/dist/_vendor/shared/space-slug.d.ts +37 -0
  9. package/dist/access/access/access-detail-shell.js +1 -1
  10. package/dist/access/access/principal-picker.d.ts +11 -0
  11. package/dist/access/access/principal-picker.js +3 -2
  12. package/dist/apps/app-preview-pool.d.ts +7 -2
  13. package/dist/apps/app-preview-pool.js +30 -7
  14. package/dist/apps/app-shared.d.ts +22 -15
  15. package/dist/apps/app-shared.js +37 -19
  16. package/dist/apps/index.d.ts +2 -2
  17. package/dist/apps/index.js +2 -2
  18. package/dist/artifacts/artifact-frame.d.ts +16 -0
  19. package/dist/artifacts/artifact-frame.js +55 -0
  20. package/dist/artifacts/artifact-session.d.ts +18 -0
  21. package/dist/artifacts/artifact-session.js +101 -0
  22. package/dist/artifacts/frame-policy.d.ts +30 -0
  23. package/dist/artifacts/frame-policy.js +61 -0
  24. package/dist/artifacts/index.d.ts +3 -0
  25. package/dist/artifacts/index.js +5 -0
  26. package/dist/browser/sandbox-browser-chrome.d.ts +4 -1
  27. package/dist/browser/sandbox-browser-chrome.js +2 -2
  28. package/dist/customize/agents/agent-grant-pages.d.ts +5 -1
  29. package/dist/customize/agents/agent-grant-pages.js +30 -4
  30. package/dist/customize/agents/agent-page.js +3 -1
  31. package/dist/customize/agents/agent-policy-sets.d.ts +43 -0
  32. package/dist/customize/agents/agent-policy-sets.js +72 -0
  33. package/dist/customize/agents/agent-triggers-section.js +2 -1
  34. package/dist/customize/connectors/add-mcp/add-mcp-server-dialog.d.ts +6 -1
  35. package/dist/customize/connectors/add-mcp/add-mcp-server-dialog.js +10 -4
  36. package/dist/customize/connectors/agent-access.d.ts +35 -0
  37. package/dist/customize/connectors/agent-access.js +77 -0
  38. package/dist/customize/connectors/catalog/browse-sections.d.ts +2 -29
  39. package/dist/customize/connectors/catalog/browse-sections.js +7 -74
  40. package/dist/customize/connectors/catalog/catalog-entry.d.ts +18 -37
  41. package/dist/customize/connectors/catalog/catalog-entry.js +28 -40
  42. package/dist/customize/connectors/catalog/connector-browse.d.ts +3 -32
  43. package/dist/customize/connectors/catalog/connector-browse.js +19 -50
  44. package/dist/customize/connectors/catalog/use-catalog.d.ts +20 -59
  45. package/dist/customize/connectors/catalog/use-catalog.js +48 -175
  46. package/dist/customize/connectors/connector-identity.d.ts +9 -11
  47. package/dist/customize/connectors/connector-identity.js +13 -42
  48. package/dist/customize/connectors/connector-moves-banner.d.ts +2 -1
  49. package/dist/customize/connectors/connector-moves-banner.js +4 -6
  50. package/dist/customize/connectors/connector-routes.d.ts +21 -9
  51. package/dist/customize/connectors/connector-routes.js +29 -20
  52. package/dist/customize/connectors/connectors-page.js +53 -82
  53. package/dist/customize/connectors/detail/app-page.js +226 -98
  54. package/dist/customize/connectors/detail/computer-app-page.d.ts +16 -0
  55. package/dist/customize/connectors/detail/computer-app-page.js +39 -0
  56. package/dist/customize/connectors/detail/connector-accounts.js +3 -1
  57. package/dist/customize/connectors/detail/connector-advanced-tools.d.ts +4 -1
  58. package/dist/customize/connectors/detail/connector-advanced-tools.js +2 -2
  59. package/dist/customize/connectors/detail/connector-agents.d.ts +14 -0
  60. package/dist/customize/connectors/detail/connector-agents.js +69 -0
  61. package/dist/customize/connectors/detail/connector-detail-tabs.js +2 -1
  62. package/dist/customize/connectors/detail/connector-move-row.d.ts +8 -5
  63. package/dist/customize/connectors/detail/connector-move-row.js +23 -14
  64. package/dist/customize/connectors/detail/connector-page.d.ts +4 -1
  65. package/dist/customize/connectors/detail/connector-page.js +14 -10
  66. package/dist/customize/connectors/detail/connector-policy-sets.d.ts +28 -0
  67. package/dist/customize/connectors/detail/connector-policy-sets.js +203 -0
  68. package/dist/customize/connectors/detail/connector-settings.d.ts +4 -1
  69. package/dist/customize/connectors/detail/connector-settings.js +7 -3
  70. package/dist/customize/connectors/detail/connector-status.d.ts +19 -6
  71. package/dist/customize/connectors/detail/connector-status.js +34 -10
  72. package/dist/customize/connectors/detail/connector-tabs.d.ts +4 -1
  73. package/dist/customize/connectors/detail/connector-tabs.js +8 -2
  74. package/dist/customize/connectors/detail/connector-tools.d.ts +3 -3
  75. package/dist/customize/connectors/detail/connector-tools.js +105 -48
  76. package/dist/customize/connectors/detail/email-inboxes.d.ts +43 -0
  77. package/dist/customize/connectors/detail/email-inboxes.js +184 -0
  78. package/dist/customize/connectors/detail/provider-info.d.ts +1 -1
  79. package/dist/customize/connectors/detail/provider-info.js +2 -2
  80. package/dist/customize/connectors/detail/status-badge.d.ts +1 -1
  81. package/dist/customize/connectors/detail/status-badge.js +4 -5
  82. package/dist/customize/connectors/detail/use-connector-detail.d.ts +6 -0
  83. package/dist/customize/connectors/detail/use-connector-detail.js +14 -4
  84. package/dist/customize/connectors/install/install-dialog.d.ts +23 -0
  85. package/dist/customize/connectors/install/install-dialog.js +40 -0
  86. package/dist/customize/connectors/install/install.d.ts +13 -2
  87. package/dist/customize/connectors/install/install.js +9 -4
  88. package/dist/customize/connectors/install/use-install.d.ts +19 -2
  89. package/dist/customize/connectors/install/use-install.js +65 -37
  90. package/dist/customize/connectors/install/way-kind.d.ts +5 -0
  91. package/dist/customize/connectors/install/way-kind.js +16 -0
  92. package/dist/customize/connectors/provider-label.d.ts +2 -1
  93. package/dist/customize/connectors/provider-label.js +13 -3
  94. package/dist/customize/connectors/tools/pattern-rule-draft.d.ts +4 -0
  95. package/dist/customize/connectors/tools/pattern-rule-draft.js +12 -3
  96. package/dist/customize/connectors/tools/policy-sets.d.ts +27 -0
  97. package/dist/customize/connectors/tools/policy-sets.js +41 -0
  98. package/dist/customize/connectors/tools/tool-groups.d.ts +32 -9
  99. package/dist/customize/connectors/tools/tool-groups.js +78 -16
  100. package/dist/customize/connectors/tools/tool-policy-control.d.ts +11 -10
  101. package/dist/customize/connectors/tools/tool-policy-control.js +15 -16
  102. package/dist/customize/connectors/tools/tool-policy-labels.d.ts +6 -5
  103. package/dist/customize/connectors/tools/tool-policy-labels.js +17 -16
  104. package/dist/customize/connectors/tools/tool-policy.d.ts +50 -4
  105. package/dist/customize/connectors/tools/tool-policy.js +74 -8
  106. package/dist/customize/connectors/use-agent-access.d.ts +85 -0
  107. package/dist/customize/connectors/use-agent-access.js +72 -0
  108. package/dist/customize/migrate-to-v2/index.d.ts +1 -2
  109. package/dist/customize/migrate-to-v2/index.js +1 -2
  110. package/dist/customize/migrate-to-v2/migration-prompt.d.ts +12 -25
  111. package/dist/customize/migrate-to-v2/migration-prompt.js +34 -236
  112. package/dist/customize/migrate-to-v2/upgrade-defs.d.ts +1 -1
  113. package/dist/customize/migrate-to-v2/upgrade-defs.js +7 -6
  114. package/dist/customize/migrate-to-v2/upgrade-view.js +7 -7
  115. package/dist/customize/migrate-to-v2/use-run-upgrade.d.ts +3 -3
  116. package/dist/customize/providers/provider-accordion.js +17 -2
  117. package/dist/customize/sections/component/channel-access-panel.d.ts +16 -0
  118. package/dist/customize/sections/component/channel-access-panel.js +146 -0
  119. package/dist/customize/sections/component/channel-connect-hero.d.ts +3 -2
  120. package/dist/customize/sections/component/channel-connect-hero.js +3 -2
  121. package/dist/customize/sections/component/channel-hero-frame.d.ts +31 -0
  122. package/dist/customize/sections/component/channel-hero-frame.js +40 -0
  123. package/dist/customize/sections/component/channel-mocks.d.ts +6 -0
  124. package/dist/customize/sections/component/channel-mocks.js +46 -0
  125. package/dist/customize/sections/component/channel-row.d.ts +13 -3
  126. package/dist/customize/sections/component/channel-row.js +10 -4
  127. package/dist/customize/sections/component/email-connect-form.d.ts +27 -0
  128. package/dist/customize/sections/component/email-connect-form.js +183 -0
  129. package/dist/customize/sections/component/slack-connect-card.d.ts +7 -0
  130. package/dist/customize/sections/component/slack-connect-card.js +2 -3
  131. package/dist/customize/sections/component/teams-connect-card.d.ts +7 -0
  132. package/dist/customize/sections/component/teams-connect-card.js +2 -3
  133. package/dist/customize/sections/component/telegram-channel-row.js +21 -28
  134. package/dist/customize/sections/connectors-view.d.ts +1 -15
  135. package/dist/customize/sections/connectors-view.js +81 -314
  136. package/dist/customize/sections/view/agent-editor-catalog.js +10 -0
  137. package/dist/customize/sections/view/channels-view.d.ts +6 -1
  138. package/dist/customize/sections/view/channels-view.js +72 -81
  139. package/dist/customize/sections/view/gateway/gateway-overview.js +10 -2
  140. package/dist/customize/settings/rail.js +9 -0
  141. package/dist/customize/settings/settings-tabs.d.ts +1 -1
  142. package/dist/customize/settings/settings-tabs.js +1 -0
  143. package/dist/customize/settings/tabs/chrome-connections-tab.d.ts +6 -0
  144. package/dist/customize/settings/tabs/chrome-connections-tab.js +99 -0
  145. package/dist/customize/settings/tabs/experimental-tab.js +35 -16
  146. package/dist/customize/shared/catalog/catalog-empty-state.d.ts +4 -15
  147. package/dist/customize/shared/catalog/catalog-empty-state.js +9 -7
  148. package/dist/customize/shared/channels-switch-dialog.d.ts +18 -0
  149. package/dist/customize/shared/channels-switch-dialog.js +30 -0
  150. package/dist/customize/shared/feature-gate-screen.js +27 -9
  151. package/dist/customize/shared/use-customize-prefetch.d.ts +2 -3
  152. package/dist/customize/shared/use-customize-prefetch.js +9 -27
  153. package/dist/customize/triggers/schedule/post-to-field.d.ts +18 -0
  154. package/dist/customize/triggers/schedule/post-to-field.js +49 -0
  155. package/dist/customize/triggers/schedule/schedule-copy.d.ts +10 -6
  156. package/dist/customize/triggers/schedule/schedule-copy.js +42 -11
  157. package/dist/customize/triggers/schedule/schedule-detail-sheet.js +2 -1
  158. package/dist/customize/triggers/schedule/trigger-composer-logic.d.ts +22 -0
  159. package/dist/customize/triggers/schedule/trigger-composer-logic.js +25 -0
  160. package/dist/customize/triggers/schedule/trigger-composer.d.ts +5 -0
  161. package/dist/customize/triggers/schedule/trigger-composer.js +23 -14
  162. package/dist/customize/triggers/schedule/trigger-edit-logic.js +3 -0
  163. package/dist/customize/triggers/schedule/trigger-filter.js +1 -1
  164. package/dist/customize/triggers/schedule/trigger-runs-logic.d.ts +2 -2
  165. package/dist/customize/triggers/schedule/trigger-runs-panel.js +1 -0
  166. package/dist/customize/triggers/schedule/trigger-toast.js +2 -1
  167. package/dist/customize/triggers/schedule-view.js +5 -2
  168. package/dist/files/index.d.ts +1 -0
  169. package/dist/files/index.js +1 -0
  170. package/dist/files/project/change-request-recovery.d.ts +1 -26
  171. package/dist/files/project/change-request-recovery.js +1 -59
  172. package/dist/files/project/components/change-request-detail-dialog.js +13 -3
  173. package/dist/files/project/components/drive-explorer.js +15 -15
  174. package/dist/files/project/components/drive-toolbar.d.ts +16 -2
  175. package/dist/files/project/components/drive-toolbar.js +14 -5
  176. package/dist/files/project/hooks/use-change-request-recovery.js +3 -19
  177. package/dist/files/project/hooks/use-change-requests.d.ts +1 -0
  178. package/dist/files/project/hooks/use-change-requests.js +11 -2
  179. package/dist/files/renderers/image-frame.d.ts +48 -0
  180. package/dist/files/renderers/image-frame.js +59 -0
  181. package/dist/files/renderers/image-renderer.d.ts +11 -1
  182. package/dist/files/renderers/image-renderer.js +13 -3
  183. package/dist/files/renderers/pdf/pdf-clipboard.d.ts +2 -0
  184. package/dist/files/renderers/pdf/pdf-clipboard.js +21 -0
  185. package/dist/files/renderers/pdf/pdf-viewer.js +4 -2
  186. package/dist/files/renderers/show-content-renderer.d.ts +9 -1
  187. package/dist/files/renderers/show-content-renderer.js +56 -14
  188. package/dist/files/runtime/file-source.js +2 -0
  189. package/dist/files/runtime/hooks/use-binary-blob.d.ts +10 -1
  190. package/dist/files/runtime/hooks/use-binary-blob.js +10 -4
  191. package/dist/files/runtime/hooks/use-shared-image.d.ts +41 -0
  192. package/dist/files/runtime/hooks/use-shared-image.js +177 -0
  193. package/dist/files/viewer/file-content-renderer.d.ts +22 -1
  194. package/dist/files/viewer/file-content-renderer.js +50 -7
  195. package/dist/files/viewer/file-header.d.ts +7 -3
  196. package/dist/files/viewer/file-header.js +20 -11
  197. package/dist/files/viewer/file-preview-modal.d.ts +1 -1
  198. package/dist/files/viewer/file-preview-modal.js +10 -22
  199. package/dist/files/viewer/file-source.d.ts +13 -0
  200. package/dist/files/viewer/use-file-content-state.d.ts +2 -0
  201. package/dist/files/viewer/use-file-content-state.js +28 -10
  202. package/dist/files/viewer/viewer-actions.d.ts +3 -1
  203. package/dist/files/viewer/viewer-actions.js +2 -2
  204. package/dist/hooks/use-media-query.d.ts +1 -0
  205. package/dist/hooks/use-mobile.d.ts +5 -0
  206. package/dist/hooks/use-mobile.js +8 -0
  207. package/dist/i18n/en.d.ts +1062 -85
  208. package/dist/i18n/en.js +1078 -101
  209. package/dist/i18n/ui-catalog/localize-ui-catalog.js +4 -0
  210. package/dist/i18n/ui-catalog/remaining-ui-translation-keys.generated.js +15 -3
  211. package/dist/index.d.ts +2 -2
  212. package/dist/index.js +2 -2
  213. package/dist/internal/account-hub/account-settings-sidebar.js +1 -1
  214. package/dist/internal/account-hub/hub-sheet.d.ts +9 -1
  215. package/dist/internal/account-hub/hub-sheet.js +21 -5
  216. package/dist/internal/account-hub/sections.d.ts +1 -1
  217. package/dist/internal/account-hub/sections.js +2 -1
  218. package/dist/internal/apps-and-extensions/apps-modal.d.ts +9 -0
  219. package/dist/internal/apps-and-extensions/apps-modal.js +107 -0
  220. package/dist/internal/auth/auth-card-shell.js +3 -3
  221. package/dist/internal/chrome/browser-icon.d.ts +24 -0
  222. package/dist/internal/chrome/browser-icon.js +58 -0
  223. package/dist/internal/chrome/chrome-card-state.d.ts +16 -0
  224. package/dist/internal/chrome/chrome-card-state.js +9 -0
  225. package/dist/internal/chrome/chrome-connect.d.ts +69 -0
  226. package/dist/internal/chrome/chrome-connect.js +178 -0
  227. package/dist/internal/chrome/chrome-mock.d.ts +4 -0
  228. package/dist/internal/chrome/chrome-mock.js +15 -0
  229. package/dist/internal/chrome/chrome-names.d.ts +15 -0
  230. package/dist/internal/chrome/chrome-names.js +35 -0
  231. package/dist/internal/chrome/extension.d.ts +47 -0
  232. package/dist/internal/chrome/extension.js +91 -0
  233. package/dist/internal/chrome/use-chrome-offered.d.ts +11 -0
  234. package/dist/internal/chrome/use-chrome-offered.js +22 -0
  235. package/dist/internal/components/agent-mark.js +5 -2
  236. package/dist/internal/connector-logo/connector-logo-source.d.ts +64 -0
  237. package/dist/internal/connector-logo/connector-logo-source.js +49 -0
  238. package/dist/internal/connector-logo/connector-logo.d.ts +39 -0
  239. package/dist/internal/connector-logo/connector-logo.js +56 -0
  240. package/dist/internal/connector-logo/connector-mark-files.d.ts +11 -0
  241. package/dist/internal/connector-logo/connector-mark-files.js +35 -0
  242. package/dist/internal/files/file-read-retry.d.ts +13 -0
  243. package/dist/internal/files/file-read-retry.js +23 -3
  244. package/dist/internal/files/session-drive-files.d.ts +5 -1
  245. package/dist/internal/files/session-drive-files.js +7 -2
  246. package/dist/internal/hooks/channels/use-channels-installations.d.ts +32 -5
  247. package/dist/internal/hooks/channels/use-channels-installations.js +55 -7
  248. package/dist/internal/hooks/channels/use-email-inboxes.d.ts +19 -0
  249. package/dist/internal/hooks/channels/use-email-inboxes.js +48 -0
  250. package/dist/internal/hooks/connectors/use-add-account.js +1 -1
  251. package/dist/internal/hooks/index.d.ts +1 -1
  252. package/dist/internal/hooks/index.js +1 -1
  253. package/dist/internal/hooks/projects/use-new-project-session.d.ts +9 -0
  254. package/dist/internal/hooks/projects/use-new-project-session.js +28 -12
  255. package/dist/internal/hooks/use-auto-scroll.d.ts +8 -1
  256. package/dist/internal/hooks/use-auto-scroll.js +4 -4
  257. package/dist/internal/icons/edge.d.ts +5 -0
  258. package/dist/internal/icons/edge.js +10 -0
  259. package/dist/internal/icons/telegram.d.ts +5 -0
  260. package/dist/internal/icons/telegram.js +6 -1
  261. package/dist/internal/layout/nav-hover-card.d.ts +35 -0
  262. package/dist/internal/layout/nav-hover-card.js +84 -0
  263. package/dist/internal/layout/project-nav-row.d.ts +3 -1
  264. package/dist/internal/layout/project-nav-row.js +3 -2
  265. package/dist/internal/layout/project-page-header.d.ts +4 -2
  266. package/dist/internal/layout/project-page-header.js +4 -3
  267. package/dist/internal/layout/project-settings-nav.js +59 -2
  268. package/dist/internal/lib/browser-error-noise.d.ts +1 -1
  269. package/dist/internal/lib/browser-error-noise.js +1 -1
  270. package/dist/internal/lib/browser-noise/rules/extensions.js +17 -3
  271. package/dist/internal/lib/browser-noise/rules/injected-scripts.d.ts +7 -0
  272. package/dist/internal/lib/browser-noise/rules/injected-scripts.js +15 -0
  273. package/dist/internal/lib/detect-os.d.ts +43 -0
  274. package/dist/internal/lib/detect-os.js +70 -0
  275. package/dist/internal/lib/manifest-version.d.ts +1 -1
  276. package/dist/internal/lib/manifest-version.js +2 -2
  277. package/dist/internal/lib/memory-href.d.ts +16 -0
  278. package/dist/internal/lib/memory-href.js +46 -0
  279. package/dist/internal/lib/use-project-feature-flags.js +13 -9
  280. package/dist/internal/lib/utils/heic-convert.d.ts +1 -1
  281. package/dist/internal/lib/utils/heic-convert.js +3 -4
  282. package/dist/internal/lib/web-notifications.d.ts +20 -0
  283. package/dist/internal/lib/web-notifications.js +48 -4
  284. package/dist/internal/notifications/notification-bell.d.ts +4 -1
  285. package/dist/internal/notifications/notification-bell.js +2 -2
  286. package/dist/internal/selection/selection-bar.d.ts +2 -1
  287. package/dist/internal/selection/selection-bar.js +1 -1
  288. package/dist/internal/stores/apps-modal-store.d.ts +8 -0
  289. package/dist/internal/stores/apps-modal-store.js +6 -0
  290. package/dist/internal/stores/composer-prefill-store.d.ts +12 -5
  291. package/dist/internal/stores/file-preview-store.d.ts +29 -2
  292. package/dist/internal/stores/file-preview-store.js +19 -1
  293. package/dist/internal/stores/kortix-computer-store.js +3 -0
  294. package/dist/internal/stores/sidebar-nav-store.d.ts +1 -1
  295. package/dist/internal/stores/sidebar-nav-store.js +3 -1
  296. package/dist/lib/routes.d.ts +13 -1
  297. package/dist/lib/routes.js +13 -0
  298. package/dist/markdown/index.d.ts +2 -1
  299. package/dist/markdown/index.js +2 -1
  300. package/dist/markdown/setup-links/approval-decision.d.ts +1 -0
  301. package/dist/markdown/setup-links/approval-decision.js +9 -3
  302. package/dist/markdown/setup-links/connector-handshake.d.ts +3 -1
  303. package/dist/markdown/setup-links/connector-handshake.js +12 -10
  304. package/dist/markdown/setup-links/secret-intake-form.d.ts +0 -10
  305. package/dist/markdown/setup-links/secret-intake-form.js +1 -1
  306. package/dist/markdown/setup-links/show-connect-hero.d.ts +28 -0
  307. package/dist/markdown/setup-links/show-connect-hero.js +91 -0
  308. package/dist/markdown/unified-markdown.js +5 -5
  309. package/dist/primitives/badge.d.ts +1 -1
  310. package/dist/primitives/badge.js +2 -0
  311. package/dist/primitives/disclosure.js +14 -2
  312. package/dist/primitives/empty-art.d.ts +12 -0
  313. package/dist/primitives/empty-art.js +11 -0
  314. package/dist/primitives/empty-state.d.ts +2 -2
  315. package/dist/primitives/empty-state.js +6 -5
  316. package/dist/primitives/mermaid-renderer.d.ts +2 -0
  317. package/dist/primitives/mermaid-renderer.js +21 -15
  318. package/dist/primitives/resizable.js +6 -1
  319. package/dist/primitives/resize-seam.d.ts +11 -0
  320. package/dist/primitives/resize-seam.js +12 -0
  321. package/dist/primitives/sidebar-panel.js +4 -7
  322. package/dist/primitives/tabs.d.ts +14 -1
  323. package/dist/primitives/tabs.js +1 -1
  324. package/dist/providers/ui-provider.d.ts +9 -0
  325. package/dist/session/composer/ComposerAboveCard.d.ts +1 -1
  326. package/dist/session/composer/ComposerAboveCard.js +2 -2
  327. package/dist/session/composer/ComposerCard.d.ts +1 -1
  328. package/dist/session/composer/ComposerCard.js +3 -3
  329. package/dist/session/composer/agent-selector.d.ts +13 -1
  330. package/dist/session/composer/agent-selector.js +25 -5
  331. package/dist/session/composer/composer-agent-access.d.ts +15 -0
  332. package/dist/session/composer/composer-agent-access.js +27 -0
  333. package/dist/session/composer/composer-chat-input.d.ts +8 -2
  334. package/dist/session/composer/composer-chat-input.js +8 -6
  335. package/dist/session/composer/composer-logic.d.ts +16 -0
  336. package/dist/session/composer/composer-logic.js +12 -0
  337. package/dist/session/composer/composer-underbar.d.ts +3 -1
  338. package/dist/session/composer/composer-underbar.js +4 -3
  339. package/dist/session/composer/composer.d.ts +15 -1
  340. package/dist/session/composer/composer.js +19 -1
  341. package/dist/session/composer/draft/composer-draft.d.ts +6 -2
  342. package/dist/session/composer/draft/composer-draft.js +5 -1
  343. package/dist/session/composer/reasoning-effort-selector.js +1 -1
  344. package/dist/session/models/chatgpt-connection-button.d.ts +11 -0
  345. package/dist/session/models/chatgpt-connection-button.js +54 -0
  346. package/dist/session/models/model-selector.js +5 -2
  347. package/dist/session/models/use-model-connection-gate.d.ts +5 -5
  348. package/dist/session/models/use-model-connection-gate.js +5 -5
  349. package/dist/session/outcomes/jump-to-outcome.d.ts +10 -0
  350. package/dist/session/outcomes/jump-to-outcome.js +11 -0
  351. package/dist/session/outcomes/session-outcomes-bridge.d.ts +14 -0
  352. package/dist/session/outcomes/session-outcomes-bridge.js +12 -0
  353. package/dist/session/outcomes/session-outcomes-provider.d.ts +3 -1
  354. package/dist/session/outcomes/session-outcomes-provider.js +33 -3
  355. package/dist/session/panel/easy/app-preview.d.ts +10 -0
  356. package/dist/session/panel/easy/app-preview.js +31 -12
  357. package/dist/session/panel/easy/change-requests-card.d.ts +7 -0
  358. package/dist/session/panel/easy/change-requests-card.js +17 -0
  359. package/dist/session/panel/easy/easy-panel-logic.js +7 -1
  360. package/dist/session/panel/easy/easy-panel.js +5 -2
  361. package/dist/session/panel/easy/file-preview.js +1 -1
  362. package/dist/session/panel/easy/outputs-card.d.ts +2 -1
  363. package/dist/session/panel/easy/outputs-card.js +3 -2
  364. package/dist/session/panel/mobile-tool-drawer.js +7 -1
  365. package/dist/session/panel/session-audit-panel.js +9 -2
  366. package/dist/session/panel/session-audit-shared.js +3 -1
  367. package/dist/session/panel/session-detail-panel.js +9 -3
  368. package/dist/session/panel/session-files-explorer.d.ts +9 -0
  369. package/dist/session/panel/session-files-explorer.js +12 -3
  370. package/dist/session/panel/session-panel-provider.d.ts +15 -1
  371. package/dist/session/panel/session-panel-provider.js +32 -7
  372. package/dist/session/panel/shared/derive-panels.d.ts +8 -1
  373. package/dist/session/panel/shared/derive-panels.js +12 -2
  374. package/dist/session/panel/shared/output-priority.js +2 -0
  375. package/dist/session/participants/session-participants.d.ts +8 -2
  376. package/dist/session/participants/session-participants.js +11 -4
  377. package/dist/session/prompts/approval-request.d.ts +5 -0
  378. package/dist/session/prompts/approval-request.js +9 -1
  379. package/dist/session/prompts/session-approval-review.d.ts +9 -0
  380. package/dist/session/prompts/session-approval-review.js +18 -0
  381. package/dist/session/status/session-error-banner.js +2 -49
  382. package/dist/session/status/session-starting-loader.d.ts +14 -2
  383. package/dist/session/status/session-starting-loader.js +16 -4
  384. package/dist/session/thread/after-first-prompt.d.ts +7 -0
  385. package/dist/session/thread/after-first-prompt.js +8 -0
  386. package/dist/session/thread/detect-command.d.ts +12 -0
  387. package/dist/session/thread/detect-command.js +20 -0
  388. package/dist/session/thread/session-chat.d.ts +3 -1
  389. package/dist/session/thread/session-chat.js +377 -252
  390. package/dist/session/thread/session-thread.d.ts +15 -1
  391. package/dist/session/thread/session-thread.js +20 -3
  392. package/dist/session/thread/session-transcript-class.d.ts +5 -1
  393. package/dist/session/thread/session-transcript-class.js +5 -1
  394. package/dist/session/thread/thread-boot-rows.d.ts +36 -0
  395. package/dist/session/thread/thread-boot-rows.js +89 -0
  396. package/dist/session/thread/transcript-rows.d.ts +31 -0
  397. package/dist/session/thread/transcript-rows.js +3 -0
  398. package/dist/session/thread/transcript.d.ts +0 -9
  399. package/dist/session/thread/transcript.js +104 -19
  400. package/dist/session/tool/shared/infrastructure-contexts.d.ts +28 -0
  401. package/dist/session/tool/shared/infrastructure-contexts.js +31 -3
  402. package/dist/session/tool/tool-part-renderer.d.ts +5 -4
  403. package/dist/session/tool/tool-part-renderer.js +8 -3
  404. package/dist/session/tool/tools/bash-tool.js +7 -6
  405. package/dist/session/tool/tools/channel-send-card.d.ts +1 -2
  406. package/dist/session/tool/tools/channel-send.d.ts +2 -1
  407. package/dist/session/tool/tools/codemode-tool.js +1 -1
  408. package/dist/session/tool/tools/connector-tools.js +1 -1
  409. package/dist/session/tool/tools/image-gen-tool.d.ts +1 -1
  410. package/dist/session/tool/tools/image-gen-tool.js +241 -53
  411. package/dist/session/tool/tools/show-tool.js +19 -8
  412. package/dist/session/turn/channel-brand.d.ts +8 -3
  413. package/dist/session/turn/channel-brand.js +20 -4
  414. package/dist/session/turn/message-author.d.ts +8 -0
  415. package/dist/session/turn/message-author.js +24 -0
  416. package/dist/session/turn/message-row.d.ts +52 -0
  417. package/dist/session/turn/message-row.js +44 -0
  418. package/dist/session/turn/plan-anchor.d.ts +1 -1
  419. package/dist/session/turn/plan-anchor.js +1 -1
  420. package/dist/session/turn/user-message.d.ts +14 -6
  421. package/dist/session/turn/user-message.js +35 -15
  422. package/dist/styles.css +1 -1
  423. package/dist/workspace/home/access-requests-bell.d.ts +9 -2
  424. package/dist/workspace/home/access-requests-bell.js +20 -6
  425. package/dist/workspace/home/first-chat.d.ts +8 -21
  426. package/dist/workspace/home/first-chat.js +22 -72
  427. package/dist/workspace/index.d.ts +6 -0
  428. package/dist/workspace/index.js +6 -0
  429. package/dist/workspace/layout/project-home.d.ts +14 -2
  430. package/dist/workspace/layout/project-home.js +60 -21
  431. package/dist/workspace/layout/use-project-home-send.d.ts +9 -1
  432. package/dist/workspace/layout/use-project-home-send.js +82 -3
  433. package/dist/workspace/memory/body-doc.d.ts +17 -0
  434. package/dist/workspace/memory/body-doc.js +208 -0
  435. package/dist/workspace/memory/body-extensions.d.ts +38 -0
  436. package/dist/workspace/memory/body-extensions.js +103 -0
  437. package/dist/workspace/memory/company-memory-page.d.ts +8 -0
  438. package/dist/workspace/memory/company-memory-page.js +16 -0
  439. package/dist/workspace/memory/memory-all.d.ts +20 -0
  440. package/dist/workspace/memory/memory-all.js +27 -0
  441. package/dist/workspace/memory/memory-body.d.ts +19 -0
  442. package/dist/workspace/memory/memory-body.js +139 -0
  443. package/dist/workspace/memory/memory-empty.d.ts +13 -0
  444. package/dist/workspace/memory/memory-empty.js +28 -0
  445. package/dist/workspace/memory/memory-history.d.ts +27 -0
  446. package/dist/workspace/memory/memory-history.js +108 -0
  447. package/dist/workspace/memory/memory-labels.d.ts +16 -0
  448. package/dist/workspace/memory/memory-labels.js +47 -0
  449. package/dist/workspace/memory/memory-page-list.d.ts +34 -0
  450. package/dist/workspace/memory/memory-page-list.js +156 -0
  451. package/dist/workspace/memory/memory-reader.d.ts +58 -0
  452. package/dist/workspace/memory/memory-reader.js +123 -0
  453. package/dist/workspace/memory/memory-view.d.ts +21 -0
  454. package/dist/workspace/memory/memory-view.js +124 -0
  455. package/dist/workspace/memory/remember-popover.d.ts +19 -0
  456. package/dist/workspace/memory/remember-popover.js +61 -0
  457. package/dist/workspace/memory/remember-this.d.ts +12 -0
  458. package/dist/workspace/memory/remember-this.js +89 -0
  459. package/dist/workspace/memory/source-mark.d.ts +18 -0
  460. package/dist/workspace/memory/source-mark.js +79 -0
  461. package/dist/workspace/memory/used-memory-chip.d.ts +14 -0
  462. package/dist/workspace/memory/used-memory-chip.js +61 -0
  463. package/dist/workspace/new/advanced-fields.d.ts +2 -1
  464. package/dist/workspace/new/advanced-fields.js +2 -2
  465. package/dist/workspace/new/source-param.d.ts +1 -1
  466. package/dist/workspace/new/source-param.js +3 -1
  467. package/dist/workspace/new/use-create-workspace.d.ts +8 -10
  468. package/dist/workspace/new/use-create-workspace.js +3 -3
  469. package/dist/workspace/projects/onboarding/app-logo.d.ts +7 -2
  470. package/dist/workspace/projects/onboarding/app-logo.js +6 -13
  471. package/dist/workspace/projects/policies-panel.js +5 -3
  472. package/dist/workspace/review/review-actions.d.ts +4 -2
  473. package/dist/workspace/review/review-actions.js +8 -2
  474. package/dist/workspace/review/review-center.js +11 -7
  475. package/dist/workspace/review/review-detail.d.ts +10 -0
  476. package/dist/workspace/review/review-detail.js +101 -13
  477. package/dist/workspace/saved-session-skeleton.d.ts +2 -2
  478. package/dist/workspace/saved-session-skeleton.js +3 -3
  479. package/dist/workspace/session-workspace.js +15 -13
  480. package/dist/workspace/sessions/project-sessions-view.js +3 -2
  481. package/dist/workspace/sessions/session-label-badges.js +2 -1
  482. package/dist/workspace/sessions/sessions-toolbar.d.ts +3 -1
  483. package/dist/workspace/sessions/sessions-toolbar.js +2 -2
  484. package/dist/workspace/sidebar/footer/project-apps-nav.d.ts +5 -0
  485. package/dist/workspace/sidebar/footer/project-apps-nav.js +41 -2
  486. package/dist/workspace/sidebar/footer/project-artifacts-nav.d.ts +6 -0
  487. package/dist/workspace/sidebar/footer/project-artifacts-nav.js +22 -0
  488. package/dist/workspace/sidebar/footer/project-chrome-nav.d.ts +10 -0
  489. package/dist/workspace/sidebar/footer/project-chrome-nav.js +56 -0
  490. package/dist/workspace/sidebar/footer/project-manifest-upgrade-alert.js +13 -13
  491. package/dist/workspace/sidebar/footer/project-memory-nav.d.ts +7 -0
  492. package/dist/workspace/sidebar/footer/project-memory-nav.js +19 -0
  493. package/dist/workspace/sidebar/nav-row-meta.js +14 -2
  494. package/dist/workspace/sidebar/project-nav-items.js +3 -0
  495. package/dist/workspace/sidebar/project-session-list.js +68 -56
  496. package/dist/workspace/sidebar/project-sidebar.js +13 -2
  497. package/dist/workspace/sidebar/project-spaces-nav.d.ts +8 -0
  498. package/dist/workspace/sidebar/project-spaces-nav.js +69 -0
  499. package/dist/workspace/sidebar/session-group-order.d.ts +9 -0
  500. package/dist/workspace/sidebar/session-group-order.js +25 -0
  501. package/dist/workspace/sidebar/session-group-sections.d.ts +62 -0
  502. package/dist/workspace/sidebar/session-group-sections.js +267 -0
  503. package/dist/workspace/sidebar/session-list-chrome.d.ts +28 -0
  504. package/dist/workspace/sidebar/session-list-chrome.js +50 -0
  505. package/dist/workspace/spaces/channel-glyph.d.ts +5 -0
  506. package/dist/workspace/spaces/channel-glyph.js +6 -0
  507. package/dist/workspace/spaces/channel-setup.d.ts +16 -0
  508. package/dist/workspace/spaces/channel-setup.js +105 -0
  509. package/dist/workspace/spaces/channels-onboarding.d.ts +13 -0
  510. package/dist/workspace/spaces/channels-onboarding.js +37 -0
  511. package/dist/workspace/spaces/create-channel-dialog.d.ts +16 -0
  512. package/dist/workspace/spaces/create-channel-dialog.js +158 -0
  513. package/dist/workspace/spaces/private-channels-not-in.d.ts +9 -0
  514. package/dist/workspace/spaces/private-channels-not-in.js +69 -0
  515. package/dist/workspace/spaces/space-agents.d.ts +10 -0
  516. package/dist/workspace/spaces/space-agents.js +10 -0
  517. package/dist/workspace/spaces/space-details-dialog.d.ts +20 -0
  518. package/dist/workspace/spaces/space-details-dialog.js +176 -0
  519. package/dist/workspace/spaces/space-link-label.d.ts +49 -0
  520. package/dist/workspace/spaces/space-link-label.js +73 -0
  521. package/dist/workspace/spaces/space-links.d.ts +19 -0
  522. package/dist/workspace/spaces/space-links.js +230 -0
  523. package/dist/workspace/spaces/space-members.d.ts +46 -0
  524. package/dist/workspace/spaces/space-members.js +182 -0
  525. package/dist/workspace/spaces/space-roster.d.ts +15 -0
  526. package/dist/workspace/spaces/space-roster.js +44 -0
  527. package/dist/workspace/spaces/space-threads-tab.d.ts +56 -0
  528. package/dist/workspace/spaces/space-threads-tab.js +156 -0
  529. package/dist/workspace/spaces/space-timeline-view.d.ts +254 -0
  530. package/dist/workspace/spaces/space-timeline-view.js +235 -0
  531. package/dist/workspace/spaces/space-timeline.d.ts +106 -0
  532. package/dist/workspace/spaces/space-timeline.js +183 -0
  533. package/dist/workspace/spaces/space-triggers.d.ts +13 -0
  534. package/dist/workspace/spaces/space-triggers.js +78 -0
  535. package/dist/workspace/spaces/space-view.d.ts +37 -0
  536. package/dist/workspace/spaces/space-view.js +436 -0
  537. package/package.json +67 -36
  538. package/skills/kortix-ui/SKILL.md +3 -3
  539. package/skills/kortix-ui/references/custom-dashboard.md +3 -3
  540. package/skills/kortix-ui/references/modules.md +29 -5
  541. package/skills/kortix-ui/references/theming.md +1 -1
  542. package/dist/customize/connectors/catalog/merge-search.d.ts +0 -10
  543. package/dist/customize/connectors/catalog/merge-search.js +0 -26
  544. package/dist/customize/connectors/detail/find-easy-connect-app.d.ts +0 -29
  545. package/dist/customize/connectors/detail/find-easy-connect-app.js +0 -22
  546. package/dist/customize/migrate-to-v2/use-migrate-to-v2.d.ts +0 -9
  547. package/dist/customize/migrate-to-v2/use-migrate-to-v2.js +0 -24
  548. package/dist/customize/sections/connector-connection-header.d.ts +0 -36
  549. package/dist/customize/sections/connector-connection-header.js +0 -33
  550. package/dist/customize/sections/connector-connection-modal.d.ts +0 -34
  551. package/dist/customize/sections/connector-connection-modal.js +0 -72
  552. package/dist/customize/sections/discover-catalogue-card.d.ts +0 -19
  553. package/dist/customize/sections/discover-catalogue-card.js +0 -26
  554. package/dist/customize/sections/discover-catalogue-detail.d.ts +0 -15
  555. package/dist/customize/sections/discover-catalogue-detail.js +0 -24
  556. package/dist/customize/sections/discover-catalogue.d.ts +0 -17
  557. package/dist/customize/sections/discover-catalogue.js +0 -132
  558. package/dist/customize/sections/llm-provider/provider-access-menu.d.ts +0 -10
  559. package/dist/customize/sections/llm-provider/provider-access-menu.js +0 -23
  560. package/dist/files/project/components/drive-empty-art.d.ts +0 -2
  561. package/dist/files/project/components/drive-empty-art.js +0 -5
  562. package/dist/internal/hooks/use-media-query.d.ts +0 -2
  563. package/dist/internal/share/public-share-link-button.d.ts +0 -14
  564. package/dist/internal/share/public-share-link-button.js +0 -17
  565. package/dist/markdown/setup-links/app-credentials-form.d.ts +0 -12
  566. package/dist/markdown/setup-links/app-credentials-form.js +0 -115
  567. /package/dist/{internal/hooks → hooks}/use-media-query.js +0 -0
@@ -0,0 +1,16 @@
1
+ const LABELS = {
2
+ mcp: 'MCP',
3
+ composio: 'Composio',
4
+ kortix: 'Kortix',
5
+ pipedream: 'Pipedream',
6
+ openapi: 'REST API',
7
+ graphql: 'GraphQL',
8
+ postman: 'Postman',
9
+ http: 'HTTP API',
10
+ // Kept for the SDK type: the catalogue no longer lists CLIs.
11
+ cli: 'CLI',
12
+ };
13
+ /** The badge a way to connect carries everywhere: cards, the app page, Install. */
14
+ export function wayKindLabel(kind) {
15
+ return LABELS[kind] ?? kind.toUpperCase();
16
+ }
@@ -1,6 +1,7 @@
1
1
  import type { AdminConnector } from '@kortix/sdk';
2
2
  /**
3
- * Forward-facing provider label — "App" for the 1-click (Pipedream) connectors.
3
+ * Forward-facing provider label. A managed connector names its partner
4
+ * (Composio, Pipedream): it is never just an "App".
4
5
  *
5
6
  * Lives here, in the connectors feature folder, rather than in
6
7
  * `customize/sections/connectors-view.tsx` where it started. That module is
@@ -1,5 +1,6 @@
1
1
  /**
2
- * Forward-facing provider label — "App" for the 1-click (Pipedream) connectors.
2
+ * Forward-facing provider label. A managed connector names its partner
3
+ * (Composio, Pipedream): it is never just an "App".
3
4
  *
4
5
  * Lives here, in the connectors feature folder, rather than in
5
6
  * `customize/sections/connectors-view.tsx` where it started. That module is
@@ -13,14 +14,23 @@
13
14
  * deliberate: when `connectors-view.tsx` is retired, this module does not move.
14
15
  */
15
16
  export function providerLabel(p) {
16
- if (isManagedConnectorProvider(p))
17
- return 'App';
17
+ if (p === 'composio')
18
+ return 'Composio';
19
+ if (p === 'pipedream')
20
+ return 'Pipedream';
18
21
  if (p === 'channel')
19
22
  return 'Channel';
20
23
  if (p === 'computer')
21
24
  return 'Computer';
22
25
  if (p === 'postman')
23
26
  return 'Postman';
27
+ // The catalogue's words for the same ways in (`install/way-kind.ts`).
28
+ if (p === 'openapi')
29
+ return 'REST API';
30
+ if (p === 'graphql')
31
+ return 'GraphQL';
32
+ if (p === 'http')
33
+ return 'HTTP API';
24
34
  return p.toUpperCase();
25
35
  }
26
36
  /** Providers whose accounts are authorized through the normalized Connect Link gateway. */
@@ -5,6 +5,10 @@ export interface PatternDraftRow {
5
5
  id: string;
6
6
  match: string;
7
7
  action: ConnectorPolicyAction;
8
+ /** Argument conditions authored in kortix.yaml. The editor has no control
9
+ * for them, so they ride along untouched: dropping them on save would turn
10
+ * a conditional rule into an unconditional one. */
11
+ conditions?: ConnectorPolicyRule['conditions'];
8
12
  }
9
13
  /**
10
14
  * A content signature for a set of pattern rules, immune to the one reordering
@@ -26,12 +26,17 @@ import { orderPolicyRules } from './tool-policy.js';
26
26
  */
27
27
  export function signPatternRules(rules) {
28
28
  return orderPolicyRules(rules)
29
- .map((rule) => `${rule.match}=${rule.action}`)
29
+ .map((rule) => `${rule.match}=${rule.action}${rule.conditions?.length ? JSON.stringify(rule.conditions) : ''}`)
30
30
  .join('\n');
31
31
  }
32
32
  /** The draft rows a rule set seeds, in the order the rules arrived. */
33
33
  export function seedPatternDraft(rules, nextId) {
34
- return rules.map((rule) => ({ id: nextId(), match: rule.match, action: rule.action }));
34
+ return rules.map((rule) => ({
35
+ id: nextId(),
36
+ match: rule.match,
37
+ action: rule.action,
38
+ ...(rule.conditions?.length ? { conditions: rule.conditions } : {}),
39
+ }));
35
40
  }
36
41
  /** The wire form of a draft: blank rows dropped, every match trimmed, `id`
37
42
  * gone. Shared by the dirty check and the save, so the two can never disagree
@@ -39,5 +44,9 @@ export function seedPatternDraft(rules, nextId) {
39
44
  export function draftToRules(draft) {
40
45
  return draft
41
46
  .filter((row) => row.match.trim())
42
- .map((row) => ({ match: row.match.trim(), action: row.action }));
47
+ .map((row) => ({
48
+ match: row.match.trim(),
49
+ action: row.action,
50
+ ...(row.conditions?.length ? { conditions: row.conditions } : {}),
51
+ }));
43
52
  }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Connector policy sets: named rule lists on one connector that an agent is
3
+ * given with `agents.<a>.policy_sets.<slug>` in kortix.yaml. The connector's
4
+ * own `policies:` are the base rules. The API owns the shape; these helpers
5
+ * are what the Tools tab and the agent editor need on top of it.
6
+ */
7
+ /**
8
+ * Channel and computer connectors have no kortix.yaml entry, so they cannot
9
+ * carry sets (the API answers 400 `policy_sets_unsupported`). The switcher is
10
+ * hidden there.
11
+ */
12
+ export declare function supportsPolicySets(provider: string | null | undefined): boolean;
13
+ export type PolicySetNameProblem = 'invalid' | 'taken';
14
+ /**
15
+ * Why a name cannot be used for a new or renamed set, or null. `current` is
16
+ * the set being renamed: keeping its own name is not a clash.
17
+ */
18
+ export declare function policySetNameProblem(name: string, existing: readonly string[], current?: string | null): PolicySetNameProblem | null;
19
+ /** The react-query key of one connector's set list. */
20
+ export declare function connectorPolicySetsKey(projectId: string, slug: string): readonly ["connector-policy-sets", string, string];
21
+ /** The react-query key of one rule list: the base rules (`null`) or one set. */
22
+ export declare function connectorPoliciesKey(projectId: string, slug: string, policySet: string | null): readonly ["connector-policies", string, string, string | null];
23
+ /** A starting point for a new set. `empty` inherits every tool from the base rules. */
24
+ export type PolicySetTemplate = 'empty' | 'read_only' | 'ask_before_writes';
25
+ export declare const POLICY_SET_TEMPLATES: readonly PolicySetTemplate[];
26
+ /** The name a template proposes. */
27
+ export declare const TEMPLATE_NAME: Record<PolicySetTemplate, string>;
@@ -0,0 +1,41 @@
1
+ import { POLICY_SETS_UNSUPPORTED_PROVIDERS, policySetNameError, } from '../../../_vendor/kortix-shared.js';
2
+ /**
3
+ * Connector policy sets: named rule lists on one connector that an agent is
4
+ * given with `agents.<a>.policy_sets.<slug>` in kortix.yaml. The connector's
5
+ * own `policies:` are the base rules. The API owns the shape; these helpers
6
+ * are what the Tools tab and the agent editor need on top of it.
7
+ */
8
+ /**
9
+ * Channel and computer connectors have no kortix.yaml entry, so they cannot
10
+ * carry sets (the API answers 400 `policy_sets_unsupported`). The switcher is
11
+ * hidden there.
12
+ */
13
+ export function supportsPolicySets(provider) {
14
+ return !POLICY_SETS_UNSUPPORTED_PROVIDERS.includes((provider ?? '').trim().toLowerCase());
15
+ }
16
+ /**
17
+ * Why a name cannot be used for a new or renamed set, or null. `current` is
18
+ * the set being renamed: keeping its own name is not a clash.
19
+ */
20
+ export function policySetNameProblem(name, existing, current = null) {
21
+ if (policySetNameError(name))
22
+ return 'invalid';
23
+ if (name !== current && existing.includes(name))
24
+ return 'taken';
25
+ return null;
26
+ }
27
+ /** The react-query key of one connector's set list. */
28
+ export function connectorPolicySetsKey(projectId, slug) {
29
+ return ['connector-policy-sets', projectId, slug];
30
+ }
31
+ /** The react-query key of one rule list: the base rules (`null`) or one set. */
32
+ export function connectorPoliciesKey(projectId, slug, policySet) {
33
+ return ['connector-policies', projectId, slug, policySet];
34
+ }
35
+ export const POLICY_SET_TEMPLATES = ['read_only', 'ask_before_writes', 'empty'];
36
+ /** The name a template proposes. */
37
+ export const TEMPLATE_NAME = {
38
+ empty: '',
39
+ read_only: 'read_only',
40
+ ask_before_writes: 'ask_before_writes',
41
+ };
@@ -1,23 +1,34 @@
1
1
  import type { UiTranslator } from '../../../i18n/index.js';
2
2
  import type { ConnectorAction } from '@kortix/sdk';
3
3
  export interface ToolGroup {
4
- key: 'read' | 'write';
4
+ key: 'read' | 'write' | 'unclassified';
5
5
  label: string;
6
6
  actions: ConnectorAction[];
7
7
  }
8
8
  /**
9
- * Two buckets, because that is the only distinction a non-technical reader
10
- * needs before granting access: can this look at my data, or change it.
11
- * `destructive` folds into writes — a delete is a write with worse consequences,
12
- * and a third bucket would just make the safe/unsafe line harder to see.
9
+ * Which bucket a tool sits in. The server's `likely_risk` wins, then the
10
+ * stored risk. A tool the server could not classify (`unknown`, sent once tool risk is
11
+ * inferred server side) goes by its name, without the app prefix:
12
+ * `LINEAR_GET_ISSUE` reads, `send_email` writes, and the rest are
13
+ * unclassified. It is never shown as a write it may not be.
14
+ */
15
+ export declare function toolBucket(action: Pick<ConnectorAction, 'path' | 'name'> & {
16
+ risk: string;
17
+ likely_risk?: string;
18
+ }, appNames?: readonly string[]): ToolGroup['key'];
19
+ /**
20
+ * Three buckets: can this look at my data, can it change it, or does nobody
21
+ * know yet. `destructive` folds into writes: a delete is a write with worse
22
+ * consequences. Unclassified is its own bucket, so an unknown tool is never
23
+ * presented as safe or as a write.
13
24
  *
14
25
  * An empty bucket is omitted rather than rendered as a heading over nothing.
15
26
  * Input order is kept inside each bucket: that is the order the connector
16
27
  * reports its tools in, which is the order its own docs use.
17
28
  */
18
- export declare function groupToolsByRisk(actions: readonly ConnectorAction[], tI18nComplete: UiTranslator): ToolGroup[];
29
+ export declare function groupToolsByRisk(actions: readonly ConnectorAction[], tI18nComplete: UiTranslator, appNames?: readonly string[]): ToolGroup[];
19
30
  export interface ToolRowText {
20
- /** The row's heading. */
31
+ /** The row's heading, in words: `LINEAR_ARCHIVE_ISSUE` reads "Archive issue". */
21
32
  title: string;
22
33
  /** The tool path, or `null` when the title already IS the path. */
23
34
  path: string | null;
@@ -30,9 +41,21 @@ export interface ToolRowText {
30
41
  * An OpenAPI connector commonly derives both `name` and `description` from the
31
42
  * same `summary` — the live `petstore` fixture does for all 19 of its tools —
32
43
  * so a naive row renders "Deletes a pet." over "Deletes a pet." The path is
33
- * dropped the same way when the connector never gave the tool a real name.
44
+ * dropped the same way when the title is the path itself.
45
+ *
46
+ * `appNames` are the connector's slug and names: a title drops the one it
47
+ * starts with, because every row on the page already belongs to that app.
48
+ */
49
+ export declare function toolRowText(action: ConnectorAction, appNames?: readonly string[]): ToolRowText;
50
+ /**
51
+ * A tool id as a sentence-case title. `LINEAR_ARCHIVE_ISSUE` with app name
52
+ * `linear` reads "Archive issue"; `ask_wiki_question` reads "Ask wiki
53
+ * question"; `getPetById` reads "Get pet by id".
54
+ *
55
+ * Only an identifier is rewritten. A name with a space is the connector's own
56
+ * wording and stays as it is. A prefix is dropped only when words remain.
34
57
  */
35
- export declare function toolRowText(action: ConnectorAction): ToolRowText;
58
+ export declare function humanizeToolName(name: string, appNames?: readonly string[]): string;
36
59
  /**
37
60
  * Narrow a tool list by a free-text query. A connector with 60 tools is
38
61
  * unusable without one.
@@ -1,22 +1,49 @@
1
+ const READ_NAME = /^(get|list|read|search|fetch|find|query|describe|lookup|view|show|count|check)(?:\s|$)/i;
2
+ const WRITE_NAME = /^(create|update|delete|send|post|remove|archive|set|add|edit|patch|put|insert|upsert|move|reply|cancel|close|invite|upload|merge|assign)(?:\s|$)/i;
1
3
  /**
2
- * Two buckets, because that is the only distinction a non-technical reader
3
- * needs before granting access: can this look at my data, or change it.
4
- * `destructive` folds into writes — a delete is a write with worse consequences,
5
- * and a third bucket would just make the safe/unsafe line harder to see.
4
+ * Which bucket a tool sits in. The server's `likely_risk` wins, then the
5
+ * stored risk. A tool the server could not classify (`unknown`, sent once tool risk is
6
+ * inferred server side) goes by its name, without the app prefix:
7
+ * `LINEAR_GET_ISSUE` reads, `send_email` writes, and the rest are
8
+ * unclassified. It is never shown as a write it may not be.
9
+ */
10
+ export function toolBucket(action, appNames = []) {
11
+ // `likely_risk` is the server's reading for display; `risk` stays what the
12
+ // gateway enforces (an un-annotated MCP tool is stored as `write`).
13
+ const risk = action.likely_risk ?? action.risk;
14
+ if (risk === 'read')
15
+ return 'read';
16
+ if (risk === 'write' || risk === 'destructive')
17
+ return 'write';
18
+ const words = humanizeToolName(action.name?.trim() || action.path, appNames);
19
+ if (READ_NAME.test(words))
20
+ return 'read';
21
+ if (WRITE_NAME.test(words))
22
+ return 'write';
23
+ return 'unclassified';
24
+ }
25
+ /**
26
+ * Three buckets: can this look at my data, can it change it, or does nobody
27
+ * know yet. `destructive` folds into writes: a delete is a write with worse
28
+ * consequences. Unclassified is its own bucket, so an unknown tool is never
29
+ * presented as safe or as a write.
6
30
  *
7
31
  * An empty bucket is omitted rather than rendered as a heading over nothing.
8
32
  * Input order is kept inside each bucket: that is the order the connector
9
33
  * reports its tools in, which is the order its own docs use.
10
34
  */
11
- export function groupToolsByRisk(actions, tI18nComplete) {
12
- const read = actions.filter((a) => a.risk === 'read');
13
- const write = actions.filter((a) => a.risk !== 'read');
14
- const groups = [];
15
- if (read.length)
16
- groups.push({ key: 'read', label: tI18nComplete.raw('textdd28b5cb26fd'), actions: read });
17
- if (write.length)
18
- groups.push({ key: 'write', label: tI18nComplete.raw('texted26c1af81cf'), actions: write });
19
- return groups;
35
+ export function groupToolsByRisk(actions, tI18nComplete, appNames = []) {
36
+ const buckets = { read: [], write: [], unclassified: [] };
37
+ for (const action of actions)
38
+ buckets[toolBucket(action, appNames)].push(action);
39
+ const labels = {
40
+ read: tI18nComplete.raw('textdd28b5cb26fd'),
41
+ write: tI18nComplete.raw('texted26c1af81cf'),
42
+ unclassified: tI18nComplete.raw('text7c0a91e5b3d2'),
43
+ };
44
+ return ['read', 'write', 'unclassified']
45
+ .filter((key) => buckets[key].length > 0)
46
+ .map((key) => ({ key, label: labels[key], actions: buckets[key] }));
20
47
  }
21
48
  /**
22
49
  * What one row prints, with nothing said twice.
@@ -24,12 +51,15 @@ export function groupToolsByRisk(actions, tI18nComplete) {
24
51
  * An OpenAPI connector commonly derives both `name` and `description` from the
25
52
  * same `summary` — the live `petstore` fixture does for all 19 of its tools —
26
53
  * so a naive row renders "Deletes a pet." over "Deletes a pet." The path is
27
- * dropped the same way when the connector never gave the tool a real name.
54
+ * dropped the same way when the title is the path itself.
55
+ *
56
+ * `appNames` are the connector's slug and names: a title drops the one it
57
+ * starts with, because every row on the page already belongs to that app.
28
58
  */
29
- export function toolRowText(action) {
59
+ export function toolRowText(action, appNames = []) {
30
60
  const name = action.name?.trim();
31
61
  const description = action.description?.trim();
32
- const title = name || action.path;
62
+ const title = humanizeToolName(name || action.path, appNames);
33
63
  const same = (value) => Boolean(value) && value.toLowerCase() === title.toLowerCase();
34
64
  return {
35
65
  title,
@@ -37,6 +67,38 @@ export function toolRowText(action) {
37
67
  description: !description || same(description) ? null : description,
38
68
  };
39
69
  }
70
+ const IDENTIFIER = /^[A-Za-z0-9_.\-/:]+$/;
71
+ const normalize = (value) => value.toLowerCase().replace(/[^a-z0-9]/g, '');
72
+ /**
73
+ * A tool id as a sentence-case title. `LINEAR_ARCHIVE_ISSUE` with app name
74
+ * `linear` reads "Archive issue"; `ask_wiki_question` reads "Ask wiki
75
+ * question"; `getPetById` reads "Get pet by id".
76
+ *
77
+ * Only an identifier is rewritten. A name with a space is the connector's own
78
+ * wording and stays as it is. A prefix is dropped only when words remain.
79
+ */
80
+ export function humanizeToolName(name, appNames = []) {
81
+ const trimmed = name.trim();
82
+ if (!IDENTIFIER.test(trimmed))
83
+ return trimmed;
84
+ const words = trimmed
85
+ .replace(/([a-z0-9])([A-Z])/g, '$1 $2')
86
+ .split(/[\s_.\-/:]+/)
87
+ .filter(Boolean)
88
+ .map((word) => word.toLowerCase());
89
+ if (words.length === 0)
90
+ return trimmed;
91
+ const apps = new Set(appNames.map(normalize).filter(Boolean));
92
+ // Up to three words: `GOOGLE_SHEETS_ADD_ROW` with app `googlesheets`.
93
+ for (let take = Math.min(3, words.length - 1); take > 0; take--) {
94
+ if (apps.has(words.slice(0, take).join(''))) {
95
+ words.splice(0, take);
96
+ break;
97
+ }
98
+ }
99
+ const sentence = words.join(' ');
100
+ return sentence.charAt(0).toUpperCase() + sentence.slice(1);
101
+ }
40
102
  /**
41
103
  * Narrow a tool list by a free-text query. A connector with 60 tools is
42
104
  * unusable without one.
@@ -9,22 +9,23 @@ export interface ToolPolicyControlProps {
9
9
  disabled?: boolean;
10
10
  /** Set when a project rule decides this tool: disables the group and says why. */
11
11
  lockedReason?: string;
12
- /** Shown while `value` is `'default'` — what following the default DOES. */
13
- defaultHint?: string;
12
+ /** Replaces the Default segment's label with what it resolves to: "Default · runs", "Inherit · asks". */
13
+ defaultLabel?: string;
14
14
  }
15
15
  /**
16
16
  * The per-tool decision: four segments, four states, every one reachable in
17
17
  * both directions.
18
18
  *
19
- * `'default'` presses its own segment and a `Hint` names what the default
20
- * actually does, because "Default" alone does not tell a reader whether the
21
- * tool runs or asks.
19
+ * It is the segmented track of `Tabs` (`tabs.tsx`): a recessed track and one
20
+ * raised chip, so the choice reads at a glance down a 60-row list. It is not
21
+ * a tablist: each segment is a toggle button with `aria-pressed`.
22
+ *
23
+ * `'default'` carries the label the caller gives it ("Default · runs",
24
+ * "Inherit · asks"), because "Default" alone does not tell a reader whether
25
+ * the tool runs or asks.
22
26
  *
23
27
  * `transition-[…,scale]`, not `transition-transform`: Tailwind v4's `scale-*`
24
28
  * utility sets the standalone `scale` property, which
25
- * `transition-property: transform` does not cover — the press would snap. The
26
- * explicit list also replaces `Button`'s base `transition-all`
27
- * (`button.tsx:8`), which the polish rules treat as a defect. Same override,
28
- * same reason, as `project-icon-field.tsx:217`.
29
+ * `transition-property: transform` does not cover — the press would snap.
29
30
  */
30
- export declare function ToolPolicyControl({ value, onChange, label, disabled, lockedReason, defaultHint, }: ToolPolicyControlProps): import("react").JSX.Element;
31
+ export declare function ToolPolicyControl({ value, onChange, label, disabled, lockedReason, defaultLabel, }: ToolPolicyControlProps): import("react").JSX.Element;
@@ -1,8 +1,7 @@
1
1
  'use client';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
- import { Button } from '../../../primitives/button.js';
4
- import { ButtonGroup } from '../../../primitives/button-group.js';
5
3
  import Hint from '../../../primitives/hint.js';
4
+ import { tabsSegmentedChipClasses, tabsSegmentedTrackClasses } from '../../../primitives/tabs.js';
6
5
  import { cn } from '../../../internal/lib/utils.js';
7
6
  import { useLocalizedUiCatalog } from '../../../i18n/ui-catalog/use-localized-ui-catalog.js';
8
7
  import { POLICY_SEGMENTS } from './tool-policy-labels.js';
@@ -10,29 +9,32 @@ import { POLICY_SEGMENTS } from './tool-policy-labels.js';
10
9
  * The per-tool decision: four segments, four states, every one reachable in
11
10
  * both directions.
12
11
  *
13
- * `'default'` presses its own segment and a `Hint` names what the default
14
- * actually does, because "Default" alone does not tell a reader whether the
15
- * tool runs or asks.
12
+ * It is the segmented track of `Tabs` (`tabs.tsx`): a recessed track and one
13
+ * raised chip, so the choice reads at a glance down a 60-row list. It is not
14
+ * a tablist: each segment is a toggle button with `aria-pressed`.
15
+ *
16
+ * `'default'` carries the label the caller gives it ("Default · runs",
17
+ * "Inherit · asks"), because "Default" alone does not tell a reader whether
18
+ * the tool runs or asks.
16
19
  *
17
20
  * `transition-[…,scale]`, not `transition-transform`: Tailwind v4's `scale-*`
18
21
  * utility sets the standalone `scale` property, which
19
- * `transition-property: transform` does not cover — the press would snap. The
20
- * explicit list also replaces `Button`'s base `transition-all`
21
- * (`button.tsx:8`), which the polish rules treat as a defect. Same override,
22
- * same reason, as `project-icon-field.tsx:217`.
22
+ * `transition-property: transform` does not cover — the press would snap.
23
23
  */
24
- export function ToolPolicyControl({ value, onChange, label, disabled = false, lockedReason, defaultHint, }) {
24
+ export function ToolPolicyControl({ value, onChange, label, disabled = false, lockedReason, defaultLabel, }) {
25
25
  const policySegments = useLocalizedUiCatalog(POLICY_SEGMENTS);
26
26
  const locked = Boolean(lockedReason);
27
- const group = (_jsx(ButtonGroup, { "aria-label": label, className: "shrink-0", children: policySegments.map((segment) => {
27
+ const group = (_jsx("div", { role: "group", "aria-label": label, className: cn(tabsSegmentedTrackClasses, 'inline-flex h-7 shrink-0 items-stretch gap-0.5'), children: policySegments.map((segment) => {
28
28
  const selected = value === segment.choice;
29
- return (_jsx(Button, { type: "button", size: "sm", variant: selected ? 'secondary-outline' : 'outline', "aria-pressed": selected, disabled: disabled || locked,
29
+ return (_jsx("button", { type: "button", "aria-pressed": selected, disabled: disabled || locked,
30
30
  // Re-pressing the current choice is a no-op, not a redundant PUT
31
31
  // that rewrites the rule set to what it already is.
32
32
  onClick: () => {
33
33
  if (!selected)
34
34
  onChange(segment.choice);
35
- }, className: cn('px-2.5 text-xs font-medium', 'transition-[color,background-color,scale] duration-150 active:scale-[0.96]', selected ? segment.tint : cn('text-muted-foreground', segment.hoverTint)), children: segment.label }, segment.choice));
35
+ }, className: cn('rounded-sm px-2 text-xs font-medium whitespace-nowrap', 'focus-visible:ring-kortix-blue focus-visible:ring-[0.6px] focus-visible:outline-none', 'disabled:pointer-events-none disabled:opacity-50', 'transition-[color,background-color,box-shadow,scale] duration-normal ease-default active:scale-[0.96] motion-reduce:transition-none', selected
36
+ ? cn(tabsSegmentedChipClasses, segment.tint)
37
+ : cn('text-muted-foreground', segment.hoverTint)), children: segment.choice === 'default' && defaultLabel ? defaultLabel : segment.label }, segment.choice));
36
38
  }) }));
37
39
  // A disabled control with no explanation is a dead end. The segments carry
38
40
  // `disabled:pointer-events-none`, so the pointer reaches this wrapper and the
@@ -40,8 +42,5 @@ export function ToolPolicyControl({ value, onChange, label, disabled = false, lo
40
42
  if (lockedReason) {
41
43
  return (_jsx(Hint, { label: lockedReason, side: "bottom", children: _jsx("div", { className: "shrink-0", children: group }) }));
42
44
  }
43
- if (value === 'default' && defaultHint) {
44
- return (_jsx(Hint, { label: defaultHint, side: "bottom", children: _jsx("div", { className: "shrink-0", children: group }) }));
45
- }
46
45
  return group;
47
46
  }
@@ -17,14 +17,15 @@ export interface PolicySegment {
17
17
  hoverTint: string;
18
18
  }
19
19
  /**
20
- * Default · Block · Ask · Allow.
20
+ * Default · Allow · Ask · Block.
21
21
  *
22
22
  * FOUR segments, because there are genuinely four states. Default sits first
23
- * because it is the state every tool starts in, and because the remaining three
24
- * then read left-to-right as a trust dial: least on the left, most on the right.
23
+ * because it is the state every tool starts in; the control labels it with
24
+ * what it resolves to ("Default · runs").
25
25
  *
26
- * Default carries no tint. Inheriting is not a decision, and colouring it would
27
- * put a fourth hue in every row of a 60-tool connector.
26
+ * Only Block carries a hue, the destructive token. Allow and Ask are plain
27
+ * ink: a 60-tool list in three status colours reads as noise, and the word
28
+ * already says the decision.
28
29
  */
29
30
  export declare const POLICY_SEGMENTS: readonly PolicySegment[];
30
31
  export declare const POLICY_CHOICE_LABEL: Record<PolicyChoice, string>;
@@ -1,37 +1,38 @@
1
1
  /**
2
- * Default · Block · Ask · Allow.
2
+ * Default · Allow · Ask · Block.
3
3
  *
4
4
  * FOUR segments, because there are genuinely four states. Default sits first
5
- * because it is the state every tool starts in, and because the remaining three
6
- * then read left-to-right as a trust dial: least on the left, most on the right.
5
+ * because it is the state every tool starts in; the control labels it with
6
+ * what it resolves to ("Default · runs").
7
7
  *
8
- * Default carries no tint. Inheriting is not a decision, and colouring it would
9
- * put a fourth hue in every row of a 60-tool connector.
8
+ * Only Block carries a hue, the destructive token. Allow and Ask are plain
9
+ * ink: a 60-tool list in three status colours reads as noise, and the word
10
+ * already says the decision.
10
11
  */
11
12
  export const POLICY_SEGMENTS = [
12
13
  {
13
14
  choice: 'default',
14
15
  label: 'Default',
15
- tint: 'text-muted-foreground',
16
+ tint: 'text-foreground',
16
17
  hoverTint: 'hover:text-foreground',
17
18
  },
18
19
  {
19
- choice: 'block',
20
- label: 'Block',
21
- tint: 'text-destructive',
22
- hoverTint: 'hover:text-destructive',
20
+ choice: 'always_run',
21
+ label: 'Allow',
22
+ tint: 'text-foreground',
23
+ hoverTint: 'hover:text-foreground',
23
24
  },
24
25
  {
25
26
  choice: 'require_approval',
26
27
  label: 'Ask',
27
- tint: 'text-kortix-yellow',
28
- hoverTint: 'hover:text-kortix-yellow',
28
+ tint: 'text-foreground',
29
+ hoverTint: 'hover:text-foreground',
29
30
  },
30
31
  {
31
- choice: 'always_run',
32
- label: 'Allow',
33
- tint: 'text-kortix-green',
34
- hoverTint: 'hover:text-kortix-green',
32
+ choice: 'block',
33
+ label: 'Block',
34
+ tint: 'text-destructive',
35
+ hoverTint: 'hover:text-destructive',
35
36
  },
36
37
  ];
37
38
  export const POLICY_CHOICE_LABEL = {
@@ -1,11 +1,30 @@
1
- import type { ConnectorEffectivePolicy, ConnectorPolicyAction, ConnectorPolicyRule } from '@kortix/sdk';
1
+ import type { ConnectorAction, ConnectorEffectivePolicy, ConnectorPolicyAction, ConnectorPolicyRule } from '@kortix/sdk';
2
2
  export type PolicyChoice = 'default' | ConnectorPolicyAction;
3
+ /**
4
+ * Which rule list the Tools tab edits: the connector's base rules, or one
5
+ * policy set. In a set, `'default'` means "inherit": the tool has no rule in
6
+ * the set, so the base rules decide (`resolveEffectiveAction` checks the set
7
+ * before the base rules, connectors/policy.ts).
8
+ */
9
+ export type PolicyScope = 'base' | 'set';
3
10
  /**
4
11
  * What the control should read for a tool. `risk_default` and `allow_all` are
5
12
  * the platform deciding, not the user — showing them as an explicit Allow would
6
13
  * claim a choice nobody made, and hide that changing the default moves them.
7
14
  */
8
- export declare function effectiveChoice(path: string, effective: readonly ConnectorEffectivePolicy[]): PolicyChoice;
15
+ export declare function effectiveChoice(path: string, effective: readonly ConnectorEffectivePolicy[], scope?: PolicyScope): PolicyChoice;
16
+ /**
17
+ * What the Default segment (base rules) or the Inherit segment (a set)
18
+ * resolves to for one tool, so the control can say it: "Default · runs",
19
+ * "Inherit · blocked".
20
+ *
21
+ * - In a set, the base rules decide an inherited tool: `baseEffective` is the
22
+ * server's answer for the base list.
23
+ * - While the tool is on Default/Inherit, its own `effective` entry is that
24
+ * answer too (a pattern rule, the risk default, `allow_all`).
25
+ * - Otherwise the connector default (`fallback`) decides.
26
+ */
27
+ export declare function inheritedAction(path: string, choice: PolicyChoice, effective: readonly ConnectorEffectivePolicy[], baseEffective: readonly ConnectorEffectivePolicy[], scope: PolicyScope, fallback: ConnectorPolicyAction): ConnectorPolicyAction;
9
28
  /**
10
29
  * Project-scope rules are evaluated first and win
11
30
  * (`resolveEffectiveAction`, apps/api/src/connectors/policy.ts:342). Editing the
@@ -41,6 +60,11 @@ export declare function applyBulkPolicy(rules: readonly ConnectorPolicyRule[], p
41
60
  * explicit regex when slash-wrapped. Everything else is a literal path.
42
61
  */
43
62
  export declare function isPatternRule(match: string): boolean;
63
+ /**
64
+ * A rule the per-tool control cannot represent: a pattern, or a rule with
65
+ * argument conditions. Both live in the Advanced editor.
66
+ */
67
+ export declare function isAdvancedRule(rule: ConnectorPolicyRule): boolean;
44
68
  /**
45
69
  * Order a rule set for the wire.
46
70
  *
@@ -64,7 +88,7 @@ export declare function orderPolicyRules(rules: readonly ConnectorPolicyRule[]):
64
88
  * entirely. Falling back to the stored exact rule keeps the control live in
65
89
  * both cases instead of showing every tool as unset.
66
90
  */
67
- export declare function toolChoice(path: string, policies: readonly ConnectorPolicyRule[], effective: readonly ConnectorEffectivePolicy[]): PolicyChoice;
91
+ export declare function toolChoice(path: string, policies: readonly ConnectorPolicyRule[], effective: readonly ConnectorEffectivePolicy[], scope?: PolicyScope): PolicyChoice;
68
92
  /**
69
93
  * What `effective` will look like once the server applies this change — used
70
94
  * to keep an optimistic update honest.
@@ -80,4 +104,26 @@ export declare function toolChoice(path: string, policies: readonly ConnectorPol
80
104
  * the server never said. `toolChoice` reads `'default'` from the absence, so
81
105
  * the control lands on Default immediately and the refetch fills in the truth.
82
106
  */
83
- export declare function previewEffective(effective: readonly ConnectorEffectivePolicy[], paths: readonly string[], choice: PolicyChoice): ConnectorEffectivePolicy[];
107
+ export declare function previewEffective(effective: readonly ConnectorEffectivePolicy[], paths: readonly string[], choice: PolicyChoice, scope?: PolicyScope): ConnectorEffectivePolicy[];
108
+ export type DefaultMode = 'risk' | 'allow_all';
109
+ /**
110
+ * What a tool does when no rule names it: the server's default
111
+ * (`resolveEffectiveAction`, connectors/policy.ts). A sensitive connector asks
112
+ * for every tool, `allow_all` runs every tool, and otherwise reads run and
113
+ * writes ask.
114
+ */
115
+ export declare function connectorDefaultAction(sensitive: boolean, defaultMode: DefaultMode | undefined, risk: ConnectorAction['risk']): ConnectorPolicyAction;
116
+ export interface ToolDecisionSummary {
117
+ total: number;
118
+ block: number;
119
+ ask: number;
120
+ run: number;
121
+ /** Tools the list being edited decides itself (not Default/Inherit, not a project rule). */
122
+ changed: number;
123
+ }
124
+ /**
125
+ * The counts above the tool list: what each tool does on its next call, and
126
+ * how many tools this list changes. `effective` is the server's answer and
127
+ * wins; `fallback` names what a tool with no entry does.
128
+ */
129
+ export declare function summarizeToolDecisions(actions: readonly ConnectorAction[], policies: readonly ConnectorPolicyRule[], effective: readonly ConnectorEffectivePolicy[], scope: PolicyScope, fallback: (action: ConnectorAction) => ConnectorPolicyAction): ToolDecisionSummary;