@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
@@ -1,13 +1,35 @@
1
+ /** The `effective.source` that marks a decision made in the list being edited. */
2
+ function ownSource(scope) {
3
+ return scope === 'set' ? 'policy_set' : 'connector';
4
+ }
1
5
  /**
2
6
  * What the control should read for a tool. `risk_default` and `allow_all` are
3
7
  * the platform deciding, not the user — showing them as an explicit Allow would
4
8
  * claim a choice nobody made, and hide that changing the default moves them.
5
9
  */
6
- export function effectiveChoice(path, effective) {
10
+ export function effectiveChoice(path, effective, scope = 'base') {
7
11
  const hit = effective.find((e) => e.path === path);
8
12
  if (!hit)
9
13
  return 'default';
10
- return hit.source === 'connector' || hit.source === 'project' ? hit.action : 'default';
14
+ return hit.source === ownSource(scope) || hit.source === 'project' ? hit.action : 'default';
15
+ }
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 function inheritedAction(path, choice, effective, baseEffective, scope, fallback) {
28
+ const base = scope === 'set' ? baseEffective.find((e) => e.path === path) : undefined;
29
+ if (base)
30
+ return base.action;
31
+ const own = choice === 'default' ? effective.find((e) => e.path === path) : undefined;
32
+ return own?.action ?? fallback;
11
33
  }
12
34
  /**
13
35
  * Project-scope rules are evaluated first and win
@@ -41,7 +63,9 @@ export function applyBulkPolicy(rules, paths, choice) {
41
63
  const targets = new Set(paths.map((path) => path.toLowerCase()));
42
64
  // Only an exact rule can name one tool. A glob is never replaced by a
43
65
  // per-tool decision, even when it happens to cover the same tool.
44
- const kept = rules.filter((r) => isPatternRule(r.match) || !targets.has(r.match.toLowerCase()));
66
+ // A conditional rule (`conditions:` in kortix.yaml) is kept too: a per-tool
67
+ // click has no way to express it, and replacing it would drop the condition.
68
+ const kept = rules.filter((r) => isAdvancedRule(r) || !targets.has(r.match.toLowerCase()));
45
69
  if (choice === 'default')
46
70
  return kept;
47
71
  return [...kept, ...paths.map((match) => ({ match, action: choice }))];
@@ -56,6 +80,13 @@ export function applyBulkPolicy(rules, paths, choice) {
56
80
  export function isPatternRule(match) {
57
81
  return match.includes('*') || /^\/.*\/[a-z]*$/.test(match);
58
82
  }
83
+ /**
84
+ * A rule the per-tool control cannot represent: a pattern, or a rule with
85
+ * argument conditions. Both live in the Advanced editor.
86
+ */
87
+ export function isAdvancedRule(rule) {
88
+ return isPatternRule(rule.match) || (rule.conditions?.length ?? 0) > 0;
89
+ }
59
90
  /**
60
91
  * Order a rule set for the wire.
61
92
  *
@@ -84,12 +115,12 @@ export function orderPolicyRules(rules) {
84
115
  * entirely. Falling back to the stored exact rule keeps the control live in
85
116
  * both cases instead of showing every tool as unset.
86
117
  */
87
- export function toolChoice(path, policies, effective) {
118
+ export function toolChoice(path, policies, effective, scope = 'base') {
88
119
  if (effective.some((e) => e.path === path))
89
- return effectiveChoice(path, effective);
120
+ return effectiveChoice(path, effective, scope);
90
121
  // Case-insensitive, like the engine — `GetPetById` governs `getpetbyid`.
91
122
  const needle = path.toLowerCase();
92
- const exact = policies.find((p) => !isPatternRule(p.match) && p.match.toLowerCase() === needle);
123
+ const exact = policies.find((p) => !isAdvancedRule(p) && p.match.toLowerCase() === needle);
93
124
  return exact ? exact.action : 'default';
94
125
  }
95
126
  /**
@@ -107,10 +138,45 @@ export function toolChoice(path, policies, effective) {
107
138
  * the server never said. `toolChoice` reads `'default'` from the absence, so
108
139
  * the control lands on Default immediately and the refetch fills in the truth.
109
140
  */
110
- export function previewEffective(effective, paths, choice) {
141
+ export function previewEffective(effective, paths, choice, scope = 'base') {
111
142
  const targets = new Set(paths);
112
143
  const touched = (entry) => targets.has(entry.path) && entry.source !== 'project';
113
144
  if (choice === 'default')
114
145
  return effective.filter((entry) => !touched(entry));
115
- return effective.map((entry) => touched(entry) ? { path: entry.path, action: choice, source: 'connector' } : entry);
146
+ return effective.map((entry) => touched(entry) ? { path: entry.path, action: choice, source: ownSource(scope) } : entry);
147
+ }
148
+ /**
149
+ * What a tool does when no rule names it: the server's default
150
+ * (`resolveEffectiveAction`, connectors/policy.ts). A sensitive connector asks
151
+ * for every tool, `allow_all` runs every tool, and otherwise reads run and
152
+ * writes ask.
153
+ */
154
+ export function connectorDefaultAction(sensitive, defaultMode, risk) {
155
+ if (sensitive)
156
+ return 'require_approval';
157
+ if (defaultMode === 'allow_all')
158
+ return 'always_run';
159
+ return risk === 'read' ? 'always_run' : 'require_approval';
160
+ }
161
+ /**
162
+ * The counts above the tool list: what each tool does on its next call, and
163
+ * how many tools this list changes. `effective` is the server's answer and
164
+ * wins; `fallback` names what a tool with no entry does.
165
+ */
166
+ export function summarizeToolDecisions(actions, policies, effective, scope, fallback) {
167
+ const summary = { total: actions.length, block: 0, ask: 0, run: 0, changed: 0 };
168
+ for (const action of actions) {
169
+ const choice = toolChoice(action.path, policies, effective, scope);
170
+ const decided = effective.find((entry) => entry.path === action.path)?.action ??
171
+ (choice === 'default' ? fallback(action) : choice);
172
+ if (decided === 'block')
173
+ summary.block++;
174
+ else if (decided === 'require_approval')
175
+ summary.ask++;
176
+ else
177
+ summary.run++;
178
+ if (choice !== 'default' && !isLockedByProject(action.path, effective))
179
+ summary.changed++;
180
+ }
181
+ return summary;
116
182
  }
@@ -0,0 +1,85 @@
1
+ import { type AgentGrants } from './agent-access.js';
2
+ /**
3
+ * The project's agents and their connector grants and rule sets, plus the two
4
+ * writes: give or take a connector, and pick an agent's rule set on it. Both
5
+ * commit kortix.yaml through `PUT …/agents/{name}/scope`.
6
+ *
7
+ * `supported` is false on a v1 manifest: its agents are a TOML overlay this
8
+ * reader does not parse, and rule sets need v2.
9
+ */
10
+ export declare function useAgentAccess(projectId: string): {
11
+ isPending: boolean;
12
+ isError: boolean;
13
+ error: Error | null;
14
+ refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<{
15
+ config: {
16
+ default_agent: string | null;
17
+ is_kortix_repo: boolean;
18
+ signals: Record<string, boolean>;
19
+ manifest_raw: string | null;
20
+ open_code_raw: string | null;
21
+ open_code_default_agent: string | null;
22
+ agent_discovery: "opencode" | "declarative";
23
+ agents: Array<{
24
+ name: string;
25
+ path: string;
26
+ description: string | null;
27
+ mode: string | null;
28
+ hidden?: boolean;
29
+ model?: string | null;
30
+ source?: "opencode" | "kortix.toml";
31
+ enabled?: boolean;
32
+ platform?: boolean;
33
+ sandbox?: string | null;
34
+ scope?: {
35
+ env: string[] | "all";
36
+ connectors: string[] | "all";
37
+ kortix_permissions?: string[] | "all";
38
+ kortix_cli: string[] | "all";
39
+ apps?: string[] | "all";
40
+ };
41
+ }>;
42
+ skills: Array<{
43
+ name: string;
44
+ path: string;
45
+ description: string | null;
46
+ }>;
47
+ commands: Array<{
48
+ name: string;
49
+ path: string;
50
+ description: string | null;
51
+ }>;
52
+ env: {
53
+ required: string[];
54
+ optional: string[];
55
+ };
56
+ };
57
+ project: import("@kortix/sdk").KortixProject;
58
+ git_connection?: import("@kortix/sdk").ProjectGitConnection | null;
59
+ file_count: number;
60
+ files: import("@kortix/sdk").ProjectFileEntry[];
61
+ }, Error>>;
62
+ supported: boolean;
63
+ canEdit: boolean;
64
+ agents: string[];
65
+ grantsOf: (agent: string) => AgentGrants | undefined;
66
+ pending: string | null;
67
+ /** Give (`on`) or take one connector. `allSlugs` are the project's connectors. */
68
+ setGrant: (agent: string, slug: string, on: boolean, allSlugs: readonly string[]) => Promise<{
69
+ ok: boolean;
70
+ agent: string;
71
+ env: import("@kortix/sdk").AgentGrantSet;
72
+ connectors: import("@kortix/sdk").AgentGrantSet;
73
+ connectors_required: string[];
74
+ policy_sets?: Record<string, string>;
75
+ }>;
76
+ /** Pick the agent's rule set on a connector; null is the base rules. Grants the connector too. */
77
+ setPolicySet: (agent: string, slug: string, set: string | null, allSlugs: readonly string[]) => Promise<{
78
+ ok: boolean;
79
+ agent: string;
80
+ env: import("@kortix/sdk").AgentGrantSet;
81
+ connectors: import("@kortix/sdk").AgentGrantSet;
82
+ connectors_required: string[];
83
+ policy_sets?: Record<string, string>;
84
+ }>;
85
+ };
@@ -0,0 +1,72 @@
1
+ 'use client';
2
+ import { getProjectDetail, setAgentScope } from '@kortix/sdk';
3
+ import { contract, qk, useProjectAccountId } from '@kortix/sdk/react';
4
+ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
5
+ import { useMemo } from 'react';
6
+ import { errorToast } from '../../primitives/toast.js';
7
+ import { PROJECT_ACTIONS } from '../../internal/lib/project-actions.js';
8
+ import { useProjectCans } from '../../internal/lib/use-project-can.js';
9
+ import { manifestAgentGrants, withConnectorGrant } from './agent-access.js';
10
+ const ACTIONS = [PROJECT_ACTIONS.PROJECT_AGENT_WRITE, PROJECT_ACTIONS.PROJECT_CONNECTOR_WRITE];
11
+ /**
12
+ * The project's agents and their connector grants and rule sets, plus the two
13
+ * writes: give or take a connector, and pick an agent's rule set on it. Both
14
+ * commit kortix.yaml through `PUT …/agents/{name}/scope`.
15
+ *
16
+ * `supported` is false on a v1 manifest: its agents are a TOML overlay this
17
+ * reader does not parse, and rule sets need v2.
18
+ */
19
+ export function useAgentAccess(projectId) {
20
+ const queryClient = useQueryClient();
21
+ const accountId = useProjectAccountId(projectId);
22
+ const cans = useProjectCans(projectId, ACTIONS, { accountId });
23
+ const canEdit = cans[PROJECT_ACTIONS.PROJECT_AGENT_WRITE]?.allowed === true &&
24
+ cans[PROJECT_ACTIONS.PROJECT_CONNECTOR_WRITE]?.allowed === true;
25
+ const projectQuery = useQuery({
26
+ queryKey: qk.project.detail(projectId),
27
+ queryFn: () => getProjectDetail(projectId),
28
+ ...contract('config'),
29
+ });
30
+ const config = projectQuery.data?.config;
31
+ const grants = useMemo(() => manifestAgentGrants(config?.manifest_raw), [config?.manifest_raw]);
32
+ const agents = useMemo(() => {
33
+ const names = new Set(Object.keys(grants ?? {}));
34
+ for (const agent of config?.agents ?? [])
35
+ if (!agent.hidden)
36
+ names.add(agent.name);
37
+ return [...names].sort((a, b) => a.localeCompare(b));
38
+ }, [grants, config?.agents]);
39
+ const write = useMutation({
40
+ mutationFn: (input) => setAgentScope(projectId, input.agent, input.scope),
41
+ onError: (error) => errorToast(error.message),
42
+ onSettled: () => {
43
+ void queryClient.invalidateQueries({ queryKey: qk.project.detail(projectId) });
44
+ void queryClient.invalidateQueries({ queryKey: ['connector-policy-sets', projectId] });
45
+ },
46
+ });
47
+ const grantsOf = (agent) => grants?.[agent];
48
+ return {
49
+ isPending: projectQuery.isPending,
50
+ isError: projectQuery.isError,
51
+ error: projectQuery.error,
52
+ refetch: projectQuery.refetch,
53
+ supported: grants !== null,
54
+ canEdit,
55
+ agents,
56
+ grantsOf,
57
+ pending: write.isPending ? write.variables?.agent ?? null : null,
58
+ /** Give (`on`) or take one connector. `allSlugs` are the project's connectors. */
59
+ setGrant: (agent, slug, on, allSlugs) => write.mutateAsync({
60
+ agent,
61
+ scope: { connectors: withConnectorGrant(grantsOf(agent), slug, on, allSlugs) },
62
+ }),
63
+ /** Pick the agent's rule set on a connector; null is the base rules. Grants the connector too. */
64
+ setPolicySet: (agent, slug, set, allSlugs) => write.mutateAsync({
65
+ agent,
66
+ scope: {
67
+ ...(set ? { connectors: withConnectorGrant(grantsOf(agent), slug, true, allSlugs) } : {}),
68
+ policy_sets: { [slug]: set },
69
+ },
70
+ }),
71
+ };
72
+ }
@@ -1,6 +1,5 @@
1
1
  export { detectManifestVersion, manifestFilename, manifestNeedsUpgrade, useProjectManifestVersion, type ManifestVersion, type ProjectManifestVersionState, } from '../../internal/lib/manifest-version.js';
2
- export { MIGRATE_TO_V2_PROMPT } from './migration-prompt.js';
2
+ export { MIGRATE_TO_V3_PROMPT } from './migration-prompt.js';
3
3
  export { PROJECT_UPGRADES, applicableUpgrades, buildOneOffUpgradePrompt, type ProjectUpgrade, type ProjectUpgradeContext, } from './upgrade-defs.js';
4
4
  export { UpgradesView, UpgradesViewContent } from './upgrade-view.js';
5
- export { useMigrateToV2, type MigrateToV2 } from './use-migrate-to-v2.js';
6
5
  export { useRunUpgrade, type RunUpgrade } from './use-run-upgrade.js';
@@ -1,6 +1,5 @@
1
1
  export { detectManifestVersion, manifestFilename, manifestNeedsUpgrade, useProjectManifestVersion, } from '../../internal/lib/manifest-version.js';
2
- export { MIGRATE_TO_V2_PROMPT } from './migration-prompt.js';
2
+ export { MIGRATE_TO_V3_PROMPT } from './migration-prompt.js';
3
3
  export { PROJECT_UPGRADES, applicableUpgrades, buildOneOffUpgradePrompt, } from './upgrade-defs.js';
4
4
  export { UpgradesView, UpgradesViewContent } from './upgrade-view.js';
5
- export { useMigrateToV2 } from './use-migrate-to-v2.js';
6
5
  export { useRunUpgrade } from './use-run-upgrade.js';
@@ -1,29 +1,16 @@
1
1
  /**
2
- * The seed prompt for "Migrate to v2" — a normal agent session does the
3
- * conversion because it's just files + git (Marko's framing). We start a
4
- * fresh session with this as the first message; the project's default agent
5
- * reads the repo, rewrites the manifest, and opens a change request for a
6
- * human to review. Nothing here merges anything — that's the whole point of
7
- * routing config changes through the same CR path as any other edit.
2
+ * The seed prompt for "Upgrade manifest to v3": a normal agent session does
3
+ * the conversion, because it is files and git. Upgrading starts a fresh
4
+ * session with this as the first message; the project's default agent runs
5
+ * `kortix migrate`, checks what it cannot know, and opens a change request for
6
+ * a human to review. Nothing here merges anything.
8
7
  *
9
- * Simplified by the 2026-07-05 redirect ("one home per concern"): v1's `.md` frontmatter
10
- * IS already valid v2 OpenCode behavior — a stock OpenCode agent file, no
11
- * Kortix-specific split. The manifest side therefore touches ONLY governance
12
- * (kortix.toml's `[[agents]]` → kortix.yaml's `agents:` map). The same change
13
- * request also moves the project to the root layout (`agents/`, `skills/`,
14
- * `memory/`, `harnesses/opencode/`; see `@kortix/manifest-schema/layout`):
15
- * each agent's `.md` moves with `git mv`, and only its old path references
16
- * change.
8
+ * `kortix migrate` (apps/cli/src/commands/migrate.ts) holds the conversion
9
+ * rules for kortix_version 1 and 2, so this prompt carries only what the tool
10
+ * cannot decide: the marketplace baseline, the checks after the conversion, the
11
+ * old folders, validation and the landing contract.
17
12
  *
18
- * The prompt carries the ENTIRE v1→v2 contract inline — every clean-break the
19
- * v2 validator enforces, a worked before/after example, and pointers to the
20
- * canonical JSON Schema (`kortix schema --version 2` in the sandbox, or the
21
- * published kortix.com/schema documents) — so the agent never has to guess at
22
- * the target shape and `kortix validate` passes on the first try.
23
- *
24
- * Kept as a plain exported constant (not inlined at the call site) so it's
25
- * independently testable and diffable — this is the load-bearing artifact of
26
- * the feature, not the wiring around it.
27
- * @deprecated Moves a v1 project to the OpenCode-era v2 layout (harnesses/opencode). OpenCode is sunset (2026-10-23); migrate with `kortix migrate` to kortix_version 3.
13
+ * `kortix projects upgrade` (apps/cli/src/commands/projects.ts) sends a
14
+ * verbatim copy. `projects-parity.test.ts` fails when the two differ.
28
15
  */
29
- export declare const MIGRATE_TO_V2_PROMPT = "Migrate this project's manifest from kortix_version 1 (kortix.toml) to kortix_version 2 (kortix.yaml), and move its files to the root layout. Read everything first, then make the change, then land it as a change request \u2014 do not merge it yourself.\n\n## 1. Read before you write\n\n- The current manifest: `kortix.toml` (or `kortix.yaml` if this project already partially moved \u2014 check `kortix_version` at the top either way).\n- Any `[[agents]]` entries in the v1 manifest \u2014 these carry `connectors`, `kortix_permissions` (older manifests spell it `kortix_cli`), and `env` grants per agent name. An agent name with NO `[[agents]]` entry at all is today unrestricted (v1's back-compat default is \"all\" when a grant key is omitted).\n- `.kortix/opencode/opencode.jsonc` \u2014 if it sets a top-level `default_agent`, that is the project's existing default; use it. If it doesn't, pick the agent whose `.kortix/opencode/agents/*.md` frontmatter has `mode: primary` and reads as the general/primary one (usually the first-created or the one with the broadest permissions). Record which you picked and why in the change request description \u2014 a human reviews this before it merges, so a defensible choice beats blocking on it.\n- **You do NOT need to read each agent's `.md` frontmatter to migrate it.** v1's frontmatter (mode/model/temperature/permission/prompt/\u2026) is ALREADY valid v2 OpenCode behavior \u2014 its content stays unchanged. Only the file moves (section 5). The manifest conversion is governance-only.\n- The current layout: v1 projects keep agents in `.kortix/opencode/agents/`, skills in `.kortix/opencode/skills/`, the other OpenCode files in `.kortix/opencode/`, and memory in `.kortix/memory/`. A v1 manifest that sets `opencode.config_dir` uses that directory instead of `.kortix/opencode`.\n\n## 2. Bring the platform baseline up to date first\n\nA project still on a v1 manifest is usually also running stale platform skills. Refresh them BEFORE touching the manifest so the migration lands on a current baseline:\n\n1. `kortix marketplace updates` \u2014 a hash-diff report of every marketplace-tracked item (the kortix-managed skills like `kortix-system`/`kortix-memory`, plus any marketplace skills the user installed).\n2. If updates are listed, apply them: `kortix marketplace update --all`. **This commits directly to `main` through the platform's own hash-safe update path \u2014 it is intentionally NOT part of your change request.** It only rewrites files whose installed hash no longer matches the catalog, so untouched user files are never clobbered.\n3. Sync your session branch on top of the refreshed main: `git fetch origin && git rebase origin/main`.\n4. Items reported as `orphaned` (no longer in the catalog) are not updatable \u2014 leave them alone and mention them in the change request description.\n5. Marketplace-tracked items are the ONLY thing you refresh this way. Do NOT hand-update anything else \"to latest\": agents' `.md` files, the memory directory, `opencode.jsonc`, the continuation plugin, `tools/*.ts`, and custom skills are user- or platform-owned files with no update tracking \u2014 leave every one of them untouched. Section 5 moves some of them and rewrites their old paths; that is the only change they get.\n\n## 3. The authoritative schema is one command away\n\nWhenever you are unsure about a field name, an allowed value, or whether a key survived into v2, consult the canonical JSON Schema instead of guessing:\n\n- `kortix schema --version 2` \u2014 prints the exact v2 schema the validator and the CR-merge gate enforce. Works offline inside your sandbox. `kortix schema --version 1` prints the v1 shape you are migrating FROM.\n- The same documents are published at `https://kortix.com/schema/kortix.v2.schema.json` (and `kortix.v1.schema.json`, plus the combined `kortix.schema.json` that dispatches on `kortix_version`).\n\nThe schema, this prompt, and `kortix validate` all enforce the same rules \u2014 if they ever appear to disagree, trust `kortix validate`'s output and say so in the change request description.\n\n## 4. The v2 shape you're producing\n\nv2's `agents:` map is GOVERNANCE ONLY \u2014 connectors/secrets/skills/kortix_permissions/workspace/enabled. OpenCode behavior (mode/model/temperature/permission/the prompt itself) is NOT part of the manifest at all; it lives entirely in each agent's own `.md` frontmatter + body, exactly as it does today. After section 5 that file is `agents/<name>.md`, and the agent's `file:` key names it.\n\n```yaml\nkortix_version: 2\ndefault_agent: <name> # REQUIRED \u2014 must resolve to a declared, enabled agent below\n\nagents:\n <name>:\n file: agents/<name>.md # the agent's .md, repo-relative (section 5 moves it there)\n enabled: true # optional; false = can't start sessions (default true)\n connectors: all # connector slugs | \"all\" | \"none\"\n secrets: all # renamed from v1's \"env\" \u2014 names | \"all\" | \"none\"\n kortix_permissions: all # project.* permission names | \"all\" | \"none\"\n skills: all # names of skills/* this agent may invoke | \"all\" | \"none\"\n workspace:\n project_repository: false # optional \u2014 true (default) | false\n```\n\nThat's the WHOLE block. No `description`, no `model`, no `opencode:` sub-object, no `mode`/`temperature`/`permission`/`prompt` \u2014 every one of those is a hard schema error if authored here. They already live in the `.md` and are staying there.\n\nRules that the schema enforces (get these right or `kortix validate` fails):\n\n- `agents` is a MAP (`name: {...}`), not the v1 `[[agents]]` array of tables.\n- `default_agent` is required at the top level and must name a declared, enabled (`enabled` not `false`) agent.\n- Any behavioral field (`description`, `model`, `mode`, `temperature`, `top_p`, `steps`, `variant`, `color`, `hidden`, `permission`, `prompt`, or a nested `opencode:` block) authored on the manifest agent block is a hard error, pointing you at the agent's own `.md` frontmatter instead \u2014 because that's where it already lives, untouched.\n- `disable` is a hard error too \u2014 it's the manifest-governance `enabled` (inverted): write `enabled: false` instead. (This is unrelated to a NATIVE `disable` key that might already be hand-authored in an agent's own `.md` frontmatter \u2014 leave that alone; it's a different, runtime-level concept.)\n- `env` is a hard error in v2 \u2014 it is renamed `secrets`. **v2 defaults every omitted grant (`connectors`/`secrets`/`kortix_permissions`/`skills`) to `\"none\"` (deny-by-default), unlike v1 which defaulted an omitted grant to `\"all\"`.** To avoid silently narrowing an agent's access during migration, write the EXPLICIT value that reproduces today's behavior for every agent \u2014 if a v1 agent had no `[[agents]]` entry, or its `env`/`connectors`/`kortix_cli` (or `kortix_permissions`) were omitted or set to `all`, write `secrets: all`, `connectors: all`, `kortix_permissions: all` explicitly in its v2 block. Only narrow a grant if the v1 manifest already narrowed it (an explicit list, or `none`) \u2014 carry that exact list over. `skills` has no v1 equivalent; default new agents to `all` unless you have a specific reason to narrow.\n- `channels` is removed entirely in v2 \u2014 delete any `[[channels]]` block. Channel\u2194agent routing now lives in the dashboard (Customize \u2192 Channels), not in git. Do not try to replicate it in the manifest.\n- Every other top-level section (`project`, `env` for required/optional documentation vars \u2014 NOT the per-agent grant, `sandbox`, `triggers`, `connectors`, `apps`) keeps its v1 shape unchanged \u2014 translated to YAML, not restructured. `opencode.config_dir` is the one exception: section 5 sets it. If `triggers[].agent` names an agent, make sure that name still exists in the new `agents` map (rename references if you renamed an agent).\n- If an agent has no `.md` today (a bare `[[agents]]` entry with no matching OpenCode agent file), still declare it in `agents:` with its governance grants carried over \u2014 don't drop it. Omit its `file:` key. It has no behavior until someone adds `agents/<name>.md`.\n\n## 5. Move to the root layout\n\nv2 projects keep harness-neutral files at the repo root. Move this project in the same change request. Use `git mv`, so git records every move as a rename and keeps each file's history.\n\n| From | To |\n| --- | --- |\n| `.kortix/opencode/agents/<name>.md` | `agents/<name>.md` |\n| `.kortix/opencode/skills/<name>/` | `skills/<name>/` |\n| `.kortix/memory/` | `memory/` |\n| the rest of `.kortix/opencode/` (`opencode.jsonc`, `package.json`, `bun.lock`, `plugins/`, `tools/`, `commands/`) | `harnesses/opencode/` |\n\nIf the v1 manifest sets `opencode.config_dir`, that directory is the source instead of `.kortix/opencode`. Skip a row when its source does not exist.\n\n```\nmkdir -p harnesses\ngit mv .kortix/opencode/agents agents\ngit mv .kortix/opencode/skills skills\ngit mv .kortix/memory memory\ngit mv .kortix/opencode harnesses/opencode\n```\n\n`git mv <dir> <target>` moves `<dir>` INTO `<target>` when `<target>` already exists. Check each target with `ls` first. When it exists, move the entries one at a time (`git mv .kortix/opencode/skills/<name> skills/<name>`).\n\nThen:\n\n1. Set the OpenCode config dir in `kortix.yaml`: `opencode:` with `config_dir: harnesses/opencode`.\n2. Give every agent whose `.md` you moved a `file:` key: `file: agents/<name>.md`.\n3. Update `.gitignore`: rewrite each `.kortix/opencode/<path>` entry as `harnesses/opencode/<path>`, and each `.kortix/memory/<path>` entry as `memory/<path>`. Keep `.kortix/state/` \u2014 runtime state stays there.\n4. Find every remaining reference to an old path: `git grep -n -e '.kortix/opencode' -e '.kortix/memory'`. Replace each one with its new path. For example, `tools/memory.ts` hard-codes `.kortix/memory`, and agent prompts often name it. Change only the path. Leave `.kortix/state/` and `.kortix/link.json` references alone.\n\nEdge cases:\n\n- A root `agents/`, `memory/`, or `harnesses/` directory that already holds files unrelated to Kortix: do not merge into it. Skip this whole section, steps 1\u20134 included, keep the legacy layout (Kortix still reads it), and say why in the change request description.\n- A skill that already exists in `skills/<name>/` (the marketplace update in section 2 can install it there): keep the root copy and remove the legacy copy with `git rm -r`.\n\n## 6. Legacy keys v2 refuses \u2014 drop these while you convert\n\nv1 tolerates several retired keys with a deprecation warning; v2 makes every one of them a hard error. Remove them as part of the conversion and note each removal in the change request description:\n\n- **Retired `kortix_permissions` actions** \u2014 `project.session.exec`, `project.gateway.routing.edit`, `project.schedule.read`, `project.schedule.write`, `project.webhook.read`, `project.webhook.write`, `channel.read`, `channel.connect`, `channel.send`, `channel.disconnect`. These were removed from the enforcement catalog and have been no-ops for a while \u2014 granting or omitting them never had any effect, so deleting them from a grant list changes nothing. Do NOT substitute a broader grant (e.g. `all`) to \"cover\" a deleted action.\n- **`credential = \"per_user\"` on a `[[connectors]]` entry** \u2014 the per-user credential mode was removed; every connector is `\"shared\"` now. Delete the `credential` key (or write `shared` explicitly if the entry already spelled it out).\n- **`agent_scope` on a `[[connectors]]` entry** \u2014 retired; the runtime no longer reads it. Per-agent connector access is expressed from the OTHER side now: each agent's `connectors:` grant in the `agents:` map. If a v1 connector had `agent_scope = [\"a\", \"b\"]`, make sure agents outside that list don't get that connector slug in their `connectors` grant (use an explicit slug list instead of `all` for the agents that should keep access), then delete the key.\n- **Legacy singular `[sandbox]` image keys** (`image`, `dockerfile`, `cpu`, `memory`, `disk`, \u2026) \u2014 already an error in v1's validator; if `kortix validate` flags them, move the image definition under `[[sandbox.templates]]` \u2192 `sandbox.templates:` with a named slug.\n\n## 7. Worked example\n\nA representative v1 `kortix.toml`:\n\n```toml\nkortix_version = 1\n\n[project]\nname = \"acme-ops\"\n\n[env]\nrequired = [\"DATABASE_URL\"]\n\n[[agents]]\nname = \"dev\"\nconnectors = [\"github\", \"linear\"]\nenv = \"all\"\nkortix_cli = [\"project.file.read\", \"project.file.write\", \"project.session.exec\"]\n\n[[agents]]\nname = \"support\"\n# no grants declared \u2014 v1 treats omitted grants as \"all\"\n\n[[channels]]\ntype = \"slack\"\nagent = \"support\"\n\n[[triggers]]\nslug = \"weekly-summary\"\ntype = \"cron\"\ncron = \"0 9 * * 1\"\nagent = \"dev\"\nprompt = \"Post the weekly summary.\"\n\n[[connectors]]\nslug = \"github\"\nprovider = \"github\"\ncredential = \"per_user\"\nagent_scope = [\"dev\"]\n```\n\nbecomes this v2 `kortix.yaml`:\n\n```yaml\nkortix_version: 2\ndefault_agent: dev\n\nproject:\n name: acme-ops\n\nenv:\n required:\n - DATABASE_URL\n\nopencode:\n config_dir: harnesses/opencode\n\nagents:\n dev:\n file: agents/dev.md\n connectors:\n - github\n - linear\n secrets: all # v1 \"env = all\", renamed\n kortix_permissions: # renamed from v1's kortix_cli; project.session.exec dropped \u2014 retired no-op action\n - project.file.read\n - project.file.write\n skills: all\n support:\n file: agents/support.md\n # v1 had no grants (implicit all) \u2014 but the github connector was\n # agent_scoped to dev only, so \"all\" would WIDEN support's access.\n # An explicit list preserves today's effective behavior instead.\n connectors: none\n secrets: all\n kortix_permissions: all\n skills: all\n\ntriggers:\n - slug: weekly-summary\n type: cron\n cron: \"0 9 * * 1\"\n agent: dev\n prompt: Post the weekly summary.\n\nconnectors:\n - slug: github\n provider: github\n # credential/agent_scope removed \u2014 connectors are shared; per-agent\n # access now lives in the agents map above.\n```\n\nNote what happened: the `[[channels]]` block is gone (dashboard-owned now), each agent names its moved `.md` with `file:`, `opencode.config_dir` points at `harnesses/opencode`, `env` became `secrets`, the retired CLI action and connector keys were dropped, every omitted-in-v1 grant was written out explicitly, and the old `agent_scope` was honored by adjusting the AGENTS' `connectors` grants rather than copied over. Your project will differ \u2014 apply the rules, not this output verbatim.\n\n## 8. Leave every agent's `.md` alone\n\nBeyond the move and the path updates in section 5, do not edit or reformat any agent's `.md` as part of this migration. Its frontmatter (mode/model/permission/temperature/\u2026) and body (the system prompt) are ALREADY the agent's v2 behavior \u2014 nothing else about them needs to change. This is what keeps the manifest conversion governance-only and comparatively small: you're translating one array-of-tables into one map of governance grants, full stop.\n\n## 9. Write the file, remove the old one\n\n- Write the fully assembled manifest to `kortix.yaml` at the repo root (same directory as the old `kortix.toml`).\n- If the project has more than ~10 triggers, or long multi-line prompts, keep `kortix.yaml` readable: add `imports: [triggers/]` to the root and write the triggers into YAML files under `triggers/` (one file per trigger or per group; each file is a `triggers:` list). Every other key stays in `kortix.yaml`. Slugs must stay unique across all files.\n- Carry over meaningful TOML comments as YAML comments next to the same keys \u2014 hand-written context in a manifest is documentation someone chose to leave; don't strip it.\n- Delete the old `kortix.toml` in the same commit \u2014 don't leave both files (the platform always prefers `kortix.yaml` when both exist, but a stale v1 file next to it is confusing for the next person who edits by hand).\n- You do not need to touch any project setting outside git \u2014 the platform resolves `kortix.yaml` automatically once it exists, regardless of the configured manifest filename.\n\n## 10. Validate before you're done\n\nRun `kortix validate` (it auto-detects `kortix.yaml`). Fix every error it reports \u2014 do not open the change request with a manifest that fails validation. Warnings are fine to leave if they're informational, but read them. If an error surprises you, cross-check the field against `kortix schema --version 2`.\n\n## 11. Land it as a change request \u2014 never merge\n\nFirst, re-sync: `git fetch origin` and check whether `origin/main` advanced while you worked (`git log HEAD..origin/main --oneline`) \u2014 on active projects it will (connectors added from the dashboard, other sessions merging). If it moved, rebase; if the rebase conflicts on `kortix.toml` (main changed the manifest you deleted), don't fight it \u2014 `git rebase --abort`, `git reset --hard origin/main`, and redo the conversion against the CURRENT manifest, then continue. Never revert main's changes to win a conflict.\n\nThen commit, **push the branch**, and open the change request. A commit that is never pushed leaves the CR empty (\"No changes detected\") and un-appliable \u2014 the platform refuses such a CR outright (`422 CR_HEAD_NOT_AHEAD`):\n\n```\ngit add -A && git commit -m \"Migrate to kortix_version 2 (kortix.yaml) and the root layout\"\ngit push origin HEAD\nkortix cr open --head <your-branch> --title \"Migrate to kortix_version 2 (kortix.yaml) and the root layout\" --description \"<what you converted, which files you moved, which agent you picked as default_agent and why, every legacy key you removed, and any grant you had to leave narrowed>\"\n```\n\nIf the push is rejected because the remote session branch moved, `git fetch origin` then `git push --force-with-lease origin HEAD` \u2014 your own session branch only, never any other branch.\n\nThen verify the CR actually carries your diff: run `kortix cr diff <number>` \u2014 if it reports no changes, your push didn't land; push again and re-check (the CR updates automatically, do not open a second one).\n\nDo **not** run `kortix cr merge`. This is a human-reviewed change like any other \u2014 stop once the CR is open and verified non-empty, and tell the user its number so they can review the diff and merge it themselves.";
16
+ export declare const MIGRATE_TO_V3_PROMPT = "Upgrade this project's manifest to kortix_version 3 (kortix.yaml). Check `kortix_version` at the top of the manifest first: kortix_version 1 is `kortix.toml`, 2 and 3 are `kortix.yaml`. On kortix_version 3 there is nothing to upgrade: say so and stop. Land the upgrade as a change request \u2014 do not merge it yourself.\n\n## 1. Bring the platform baseline up to date first\n\n1. `kortix marketplace updates` \u2014 a hash-diff report of every marketplace-tracked item (the Kortix-managed skills, plus any marketplace skills the user installed).\n2. If updates are listed, apply them: `kortix marketplace update --all`. **This commits directly to `main` through the platform's own hash-safe update path \u2014 it is intentionally NOT part of your change request.**\n3. Sync your session branch on top of the refreshed main: `git fetch origin && git rebase origin/main`.\n4. Items reported as `orphaned` (no longer in the catalog) are not updatable \u2014 leave them alone and mention them in the change request description.\n\n## 2. Convert with kortix migrate\n\n1. Run `kortix migrate`. It prints the plan, the new `kortix.yaml`, a \"Not carried over\" list, and whether the result validates. It changes nothing.\n2. Run `kortix migrate --write`. It writes the v3 `kortix.yaml`, moves each agent's behavior out of its `.md` frontmatter into its `agents.<name>` block, keeps the prompt in the `.md` as its `prompt_file`, and deletes `kortix.toml` and `opencode.json(c)`. It refuses a result that does not validate: fix what it reports, then run it again.\n3. Carry over by hand each \"Not carried over\" item that has a v3 key. `kortix schema --version 3` prints the exact schema. List each item that has no v3 key in the change request description; do not invent a key for it.\n\n## 3. Check what kortix migrate cannot decide\n\n- **Grants.** v3 grants are deny-by-default. Every agent must keep the access it has today: `skills`, `subagents`, `commands`, `extensions`, `connectors`, `secrets`, `kortix_permissions` and `workspace: { project_repository: true }` for an agent that works in the repository. Never widen a grant to cover a key you removed.\n- **The default agent.** `default_agent` must name a declared agent with `mode: primary` or `all`. A kortix_version 1 project takes it from `opencode.jsonc`, else from its first agent. Confirm the choice and record it and the reason in the change request description.\n- **Old folders.** v3 reads no harness folder: `harnesses/` and `.kortix/opencode/` are not read. Move every file that a registry or a `prompt_file` still names there to the root folders (`agents/`, `skills/`, `tools/`, `commands/`, `extensions/`) with `git mv`, and update the path in `kortix.yaml`. From kortix_version 1, also run `git mv .kortix/memory memory`. Keep `.kortix/state/` and `.kortix/link.json`. Then delete what is left: `git rm -r harnesses/` or `git rm -r .kortix/opencode/`.\n- **OpenCode-only extensions.** Every new session runs pi, and pi loads only an extension's `pi:` implementation. `kortix migrate` turns each OpenCode plugin into an extension with only an `opencode:` implementation (under `extensions/opencode/`), which never loads. Remove each such extension from `extensions` and from every agent's `extensions` grant, and `git rm -r` its files. List each one in the change request description; when it did something the project needs, say that a pi extension (`pi:`) replaces it.\n- **Old paths.** Run `git grep -n -e '.kortix/opencode' -e '.kortix/memory' -e 'harnesses/'` and replace each old path with the new one, in prompts, skills, tools and `.gitignore`. Change only the path.\n\n## 4. Validate before you are done\n\nRun `kortix validate`. Fix every error it reports. Do not open the change request with a manifest that fails validation.\n\n## 5. Land it as a change request \u2014 never merge\n\nFirst, re-sync: `git fetch origin` and check whether `origin/main` advanced while you worked (`git log HEAD..origin/main --oneline`). If it moved, rebase. If the rebase conflicts on the manifest or a moved file, `git rebase --abort`, `git reset --hard origin/main`, and redo the conversion against the current files. Never revert main's changes to win a conflict.\n\nThen commit, **push the branch**, and open the change request. A commit that is never pushed leaves the CR empty (`422 CR_HEAD_NOT_AHEAD`):\n\n```\ngit add -A && git commit -m \"Upgrade to kortix_version 3\"\ngit push origin HEAD\nkortix cr open --head <your-branch> --title \"Upgrade to kortix_version 3\" --description \"<the default agent and why, every file you moved or removed, each agent's grants, every item kortix migrate did not carry over and why>\"\n```\n\nIf the push is rejected because the remote session branch moved, `git fetch origin` then `git push --force-with-lease origin HEAD` \u2014 your own session branch only, never any other branch.\n\nThen run `kortix cr diff <number>`. If it reports no changes, your push did not land; push again and re-check (the CR updates automatically, do not open a second one).\n\nDo **not** run `kortix cr merge`. Stop once the CR is open and verified non-empty, and tell the user its number so they can review the diff and merge it themselves.";