@kortix/ui 0.14.12 → 0.14.14

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 (438) hide show
  1. package/README.md +1 -1
  2. package/dist/_vendor/kortix-shared.js +521 -7045
  3. package/dist/_vendor/shared/app-config.d.ts +8 -0
  4. package/dist/_vendor/shared/artifact-annotations.d.ts +708 -0
  5. package/dist/_vendor/shared/artifact-comments.d.ts +327 -0
  6. package/dist/_vendor/shared/index.d.ts +3 -1
  7. package/dist/_vendor/shared/my-kortix-agent.d.ts +40 -0
  8. package/dist/_vendor/shared/peer-message-prompt.d.ts +35 -0
  9. package/dist/_vendor/shared/pixel-mark.d.ts +11 -0
  10. package/dist/_vendor/shared/prompt-attachments.d.ts +1 -0
  11. package/dist/_vendor/shared/reminder-prompt.d.ts +8 -2
  12. package/dist/_vendor/shared/runtime-versions.d.ts +8 -0
  13. package/dist/artifacts/artifact-frame.d.ts +1 -0
  14. package/dist/artifacts/artifact-frame.js +18 -5
  15. package/dist/artifacts/frame-policy.d.ts +1 -1
  16. package/dist/artifacts/frame-policy.js +10 -5
  17. package/dist/customize/agents/agent-access-text.d.ts +16 -0
  18. package/dist/customize/agents/agent-access-text.js +54 -0
  19. package/dist/customize/agents/agent-approval-rules.d.ts +8 -0
  20. package/dist/customize/agents/agent-approval-rules.js +26 -0
  21. package/dist/customize/agents/agent-authority-card.js +4 -1
  22. package/dist/customize/agents/agent-cover-card.d.ts +4 -1
  23. package/dist/customize/agents/agent-cover-card.js +2 -2
  24. package/dist/customize/agents/agent-detail-aside.d.ts +1 -2
  25. package/dist/customize/agents/agent-detail-aside.js +8 -11
  26. package/dist/customize/agents/agent-drives-section.d.ts +23 -7
  27. package/dist/customize/agents/agent-drives-section.js +107 -41
  28. package/dist/customize/agents/agent-instructions.d.ts +11 -0
  29. package/dist/customize/agents/agent-instructions.js +114 -0
  30. package/dist/customize/agents/agent-model-view.d.ts +17 -0
  31. package/dist/customize/agents/agent-model-view.js +67 -0
  32. package/dist/customize/agents/agent-overview.d.ts +53 -0
  33. package/dist/customize/agents/agent-overview.js +242 -0
  34. package/dist/customize/agents/agent-page-chrome.d.ts +128 -0
  35. package/dist/customize/agents/agent-page-chrome.js +145 -0
  36. package/dist/customize/agents/agent-page.d.ts +13 -1
  37. package/dist/customize/agents/agent-page.js +478 -367
  38. package/dist/customize/agents/agent-pin-button.d.ts +10 -0
  39. package/dist/customize/agents/agent-pin-button.js +20 -0
  40. package/dist/customize/agents/agent-policy-sets-section.d.ts +16 -0
  41. package/dist/customize/agents/agent-policy-sets-section.js +80 -0
  42. package/dist/customize/agents/agent-policy-sets.js +1 -1
  43. package/dist/customize/agents/agent-section-rail.d.ts +21 -0
  44. package/dist/customize/agents/agent-section-rail.js +23 -0
  45. package/dist/customize/agents/agent-share-control.d.ts +4 -3
  46. package/dist/customize/agents/agent-share-control.js +15 -16
  47. package/dist/customize/agents/{agent-people-section.d.ts → agent-share-dialog.d.ts} +3 -1
  48. package/dist/customize/agents/{agent-people-section.js → agent-share-dialog.js} +21 -21
  49. package/dist/customize/agents/agent-tabs.d.ts +95 -0
  50. package/dist/customize/agents/agent-tabs.js +199 -0
  51. package/dist/customize/agents/agents-page.d.ts +0 -21
  52. package/dist/customize/agents/agents-page.js +104 -118
  53. package/dist/customize/agents/connectors-required.d.ts +16 -0
  54. package/dist/customize/agents/connectors-required.js +19 -0
  55. package/dist/customize/agents/create-agent-modal.d.ts +19 -0
  56. package/dist/customize/agents/create-agent-modal.js +94 -0
  57. package/dist/customize/connectors/agent-access.d.ts +4 -4
  58. package/dist/customize/connectors/agent-access.js +7 -10
  59. package/dist/customize/connectors/connector-identity.d.ts +12 -0
  60. package/dist/customize/connectors/connector-identity.js +15 -2
  61. package/dist/customize/connectors/connector-routes.js +2 -2
  62. package/dist/customize/connectors/connectors-page.d.ts +14 -1
  63. package/dist/customize/connectors/connectors-page.js +101 -32
  64. package/dist/customize/connectors/detail/app-page.js +1 -1
  65. package/dist/customize/connectors/detail/connector-agents.js +0 -3
  66. package/dist/customize/connectors/detail/connector-page.d.ts +1 -1
  67. package/dist/customize/connectors/detail/connector-page.js +5 -2
  68. package/dist/customize/connectors/detail/connector-policy-sets.js +1 -1
  69. package/dist/customize/connectors/detail/connector-triggers.js +2 -2
  70. package/dist/customize/connectors/use-agent-access.d.ts +7 -5
  71. package/dist/customize/connectors/use-agent-access.js +2 -6
  72. package/dist/customize/models/models-page.d.ts +7 -1
  73. package/dist/customize/models/models-page.js +2 -2
  74. package/dist/customize/project-settings/project-admin-sections.d.ts +63 -0
  75. package/dist/customize/project-settings/project-admin-sections.js +80 -0
  76. package/dist/customize/project-settings/project-settings-page.d.ts +1 -1
  77. package/dist/customize/project-settings/project-settings-page.js +4 -13
  78. package/dist/customize/project-settings/project-settings-sections.d.ts +5 -5
  79. package/dist/customize/project-settings/project-settings-sections.js +6 -20
  80. package/dist/customize/providers/provider-accordion.js +29 -17
  81. package/dist/customize/providers/provider-connect.js +1 -1
  82. package/dist/customize/providers/provider-sheet.d.ts +4 -1
  83. package/dist/customize/providers/provider-sheet.js +15 -5
  84. package/dist/customize/secrets/secrets-page.d.ts +5 -1
  85. package/dist/customize/secrets/secrets-page.js +2 -2
  86. package/dist/customize/sections/gateway-view.d.ts +10 -2
  87. package/dist/customize/sections/gateway-view.js +16 -4
  88. package/dist/customize/sections/llm-provider/chatgpt-subscription-connect.d.ts +12 -5
  89. package/dist/customize/sections/llm-provider/chatgpt-subscription-connect.js +131 -8
  90. package/dist/customize/sections/llm-provider/claude-code-step.d.ts +10 -0
  91. package/dist/customize/sections/llm-provider/claude-code-step.js +32 -0
  92. package/dist/customize/sections/llm-provider/models-tab.js +5 -1
  93. package/dist/customize/sections/view/account-secret-resources-panel.d.ts +5 -3
  94. package/dist/customize/sections/view/account-secret-resources-panel.js +122 -19
  95. package/dist/customize/sections/view/agent-editor-access-fields.d.ts +1 -1
  96. package/dist/customize/sections/view/agent-editor-access-fields.js +8 -4
  97. package/dist/customize/sections/view/agent-editor-basics-fields.d.ts +4 -1
  98. package/dist/customize/sections/view/agent-editor-basics-fields.js +33 -4
  99. package/dist/customize/sections/view/agent-editor-catalog.d.ts +2 -2
  100. package/dist/customize/sections/view/agent-editor-catalog.js +10 -12
  101. package/dist/customize/sections/view/agent-editor-primitives.d.ts +1 -1
  102. package/dist/customize/sections/view/agent-editor-primitives.js +4 -4
  103. package/dist/customize/sections/view/agent-editor.d.ts +37 -26
  104. package/dist/customize/sections/view/agent-editor.js +19 -19
  105. package/dist/customize/sections/view/grant-mode-field.d.ts +8 -20
  106. package/dist/customize/sections/view/grant-mode-field.js +31 -57
  107. package/dist/customize/sections/view/permission-editor.d.ts +3 -1
  108. package/dist/customize/sections/view/permission-editor.js +19 -10
  109. package/dist/customize/sections/view/review-view.d.ts +8 -0
  110. package/dist/customize/sections/view/review-view.js +12 -1
  111. package/dist/customize/sections/view/secret-delivery.js +1 -4
  112. package/dist/customize/sections/view/secrets-view.d.ts +7 -1
  113. package/dist/customize/sections/view/secrets-view.js +42 -6
  114. package/dist/customize/settings/rail.js +2 -8
  115. package/dist/customize/settings/settings-tabs.d.ts +2 -2
  116. package/dist/customize/settings/settings-tabs.js +17 -19
  117. package/dist/customize/settings/tabs/experimental-tab.d.ts +3 -0
  118. package/dist/customize/settings/tabs/experimental-tab.js +6 -1
  119. package/dist/customize/settings/tabs/sandbox-tab.d.ts +4 -6
  120. package/dist/customize/settings/tabs/sandbox-tab.js +9 -9
  121. package/dist/customize/shared/access-list.d.ts +39 -0
  122. package/dist/customize/shared/access-list.js +62 -0
  123. package/dist/customize/shared/agent-resource-scope.d.ts +87 -0
  124. package/dist/customize/shared/agent-resource-scope.js +123 -0
  125. package/dist/customize/shared/capability-library.d.ts +41 -0
  126. package/dist/customize/shared/capability-library.js +271 -0
  127. package/dist/customize/shared/capability-page-shell.d.ts +18 -1
  128. package/dist/customize/shared/capability-page-shell.js +21 -1
  129. package/dist/customize/shared/catalog/catalog-space-tabs.d.ts +14 -0
  130. package/dist/customize/shared/catalog/catalog-space-tabs.js +20 -0
  131. package/dist/customize/shared/customize-tab-bar.d.ts +13 -0
  132. package/dist/customize/shared/customize-tab-bar.js +95 -0
  133. package/dist/customize/shared/entity/entity-modal.d.ts +17 -1
  134. package/dist/customize/shared/entity/entity-modal.js +10 -9
  135. package/dist/customize/shared/leave-guard.d.ts +23 -0
  136. package/dist/customize/shared/leave-guard.js +87 -0
  137. package/dist/customize/shared/standalone-settings-nav.js +4 -1
  138. package/dist/customize/shared/tool-rules.d.ts +11 -0
  139. package/dist/customize/shared/tool-rules.js +29 -0
  140. package/dist/customize/skills/builtin-skill-modal.d.ts +6 -0
  141. package/dist/customize/skills/builtin-skill-modal.js +41 -0
  142. package/dist/customize/skills/skills-page.d.ts +21 -18
  143. package/dist/customize/skills/skills-page.js +16 -110
  144. package/dist/customize/triggers/runtime-triggers.d.ts +17 -0
  145. package/dist/customize/triggers/runtime-triggers.js +57 -0
  146. package/dist/customize/triggers/schedule/event-trigger-copy.js +2 -2
  147. package/dist/customize/triggers/schedule/post-to-field.js +2 -2
  148. package/dist/customize/triggers/schedule/schedule-copy.d.ts +11 -6
  149. package/dist/customize/triggers/schedule/schedule-copy.js +29 -8
  150. package/dist/customize/triggers/schedule/schedule-detail-sheet.js +7 -3
  151. package/dist/customize/triggers/schedule/trigger-composer-logic.d.ts +26 -1
  152. package/dist/customize/triggers/schedule/trigger-composer-logic.js +64 -3
  153. package/dist/customize/triggers/schedule/trigger-composer.js +57 -20
  154. package/dist/customize/triggers/schedule/trigger-edit-logic.js +18 -5
  155. package/dist/customize/triggers/schedule/trigger-filter.d.ts +10 -0
  156. package/dist/customize/triggers/schedule/trigger-filter.js +16 -0
  157. package/dist/customize/triggers/schedule/trigger-runs-panel.js +1 -0
  158. package/dist/customize/triggers/schedule/trigger-toast.js +2 -1
  159. package/dist/customize/triggers/schedule/use-trigger-mutations.d.ts +1 -1
  160. package/dist/customize/triggers/schedule/use-trigger-mutations.js +1 -1
  161. package/dist/customize/triggers/schedule/when-app.d.ts +15 -0
  162. package/dist/customize/triggers/schedule/when-app.js +21 -0
  163. package/dist/customize/triggers/schedule/when-change-request.d.ts +10 -0
  164. package/dist/customize/triggers/schedule/when-change-request.js +15 -0
  165. package/dist/customize/triggers/schedule-view.d.ts +17 -3
  166. package/dist/customize/triggers/schedule-view.js +46 -16
  167. package/dist/customize/triggers/triggers-page.d.ts +3 -3
  168. package/dist/customize/triggers/triggers-page.js +2 -2
  169. package/dist/customize/use-configure-thread.d.ts +8 -2
  170. package/dist/customize/use-configure-thread.js +30 -18
  171. package/dist/files/project/components/change-request-detail-dialog.js +2 -3
  172. package/dist/files/project/components/drive-explorer.js +6 -5
  173. package/dist/files/project/explorer-source.d.ts +3 -0
  174. package/dist/files/project/upload-batch.d.ts +3 -3
  175. package/dist/files/project/upload-batch.js +7 -6
  176. package/dist/files/runtime/sandbox-explorer-source.js +3 -3
  177. package/dist/i18n/en.d.ts +1330 -53
  178. package/dist/i18n/en.js +1422 -145
  179. package/dist/i18n/ui-catalog/remaining-ui-translation-keys.generated.js +16 -7
  180. package/dist/internal/auth/auth-primitives.d.ts +1 -3
  181. package/dist/internal/auth/auth-primitives.js +2 -2
  182. package/dist/internal/billing/session-cost-format.d.ts +1 -0
  183. package/dist/internal/billing/session-cost-format.js +11 -0
  184. package/dist/internal/components/agent-mark.d.ts +12 -1
  185. package/dist/internal/components/agent-mark.js +34 -11
  186. package/dist/internal/components/nav-rail.d.ts +22 -0
  187. package/dist/internal/components/nav-rail.js +16 -0
  188. package/dist/internal/components/repository-disconnected.js +2 -2
  189. package/dist/internal/goals/goal-meta.d.ts +15 -1
  190. package/dist/internal/goals/goal-meta.js +42 -2
  191. package/dist/internal/hooks/projects/use-agent-config.d.ts +11 -7
  192. package/dist/internal/hooks/projects/use-agent-config.js +28 -11
  193. package/dist/internal/hooks/use-slash-focus.d.ts +7 -1
  194. package/dist/internal/hooks/use-slash-focus.js +9 -3
  195. package/dist/internal/layout/project-capability-nav.d.ts +24 -0
  196. package/dist/internal/layout/project-capability-nav.js +86 -0
  197. package/dist/internal/layout/project-page-header.d.ts +1 -1
  198. package/dist/internal/layout/project-page-header.js +1 -1
  199. package/dist/internal/layout/project-settings-nav.d.ts +3 -2
  200. package/dist/internal/layout/project-settings-nav.js +5 -3
  201. package/dist/internal/lib/browser-noise/rules/old-browsers.js +1 -1
  202. package/dist/internal/lib/capability-tab-routes.d.ts +34 -3
  203. package/dist/internal/lib/capability-tab-routes.js +76 -8
  204. package/dist/internal/lib/manifest-health.d.ts +10 -0
  205. package/dist/internal/lib/manifest-health.js +20 -0
  206. package/dist/internal/lib/pixel-mark.d.ts +4 -1
  207. package/dist/internal/lib/pixel-mark.js +33 -6
  208. package/dist/internal/lib/project-actions.d.ts +1 -1
  209. package/dist/internal/lib/project-actions.js +0 -4
  210. package/dist/internal/lib/provider-branding.js +2 -0
  211. package/dist/internal/lib/space-scope.d.ts +29 -0
  212. package/dist/internal/lib/space-scope.js +28 -0
  213. package/dist/internal/lib/use-project-feature-flags.js +3 -3
  214. package/dist/internal/lib/web-notifications.d.ts +74 -8
  215. package/dist/internal/lib/web-notifications.js +243 -117
  216. package/dist/internal/notifications/notification-rows.d.ts +14 -7
  217. package/dist/internal/notifications/notification-rows.js +21 -14
  218. package/dist/internal/notifications/session-toast-cards.d.ts +2 -2
  219. package/dist/internal/reminders/reminder-format.d.ts +6 -2
  220. package/dist/internal/reminders/reminder-format.js +7 -1
  221. package/dist/internal/stores/active-space-store.d.ts +35 -0
  222. package/dist/internal/stores/active-space-store.js +29 -0
  223. package/dist/internal/stores/kortix-computer-store.js +13 -4
  224. package/dist/internal/stores/pinned-agents-store.d.ts +26 -0
  225. package/dist/internal/stores/pinned-agents-store.js +20 -0
  226. package/dist/internal/stores/session-panel-memory-store.js +3 -0
  227. package/dist/internal/stores/turn-attention-store.d.ts +5 -4
  228. package/dist/lib/routes.d.ts +16 -1
  229. package/dist/lib/routes.js +15 -3
  230. package/dist/markdown/doc-editor/doc-embed.d.ts +31 -0
  231. package/dist/markdown/doc-editor/doc-embed.js +168 -0
  232. package/dist/markdown/doc-editor/doc-extensions.d.ts +26 -0
  233. package/dist/markdown/doc-editor/doc-extensions.js +149 -0
  234. package/dist/markdown/doc-editor/doc-menus.d.ts +9 -0
  235. package/dist/markdown/doc-editor/doc-menus.js +56 -0
  236. package/dist/markdown/doc-editor/markdown.d.ts +12 -0
  237. package/dist/markdown/doc-editor/markdown.js +140 -0
  238. package/dist/markdown/genui/components/inline.d.ts +1 -1
  239. package/dist/primitives/badge.d.ts +1 -1
  240. package/dist/primitives/button.d.ts +1 -1
  241. package/dist/primitives/pixel-kortix-mark.d.ts +5 -4
  242. package/dist/primitives/pixel-kortix-mark.js +5 -15
  243. package/dist/primitives/tag.d.ts +1 -1
  244. package/dist/primitives/textarea.js +14 -0
  245. package/dist/primitives/toast.d.ts +2 -0
  246. package/dist/primitives/toast.js +4 -2
  247. package/dist/providers/ui-provider.d.ts +16 -0
  248. package/dist/session/actions/session-label.d.ts +1 -1
  249. package/dist/session/actions/session-label.js +3 -3
  250. package/dist/session/agents/agent-model.d.ts +92 -0
  251. package/dist/session/agents/agent-model.js +123 -0
  252. package/dist/session/agents/agent-state-mark.d.ts +10 -0
  253. package/dist/session/agents/agent-state-mark.js +22 -0
  254. package/dist/session/agents/agent-strip.d.ts +58 -0
  255. package/dist/session/agents/agent-strip.js +259 -0
  256. package/dist/session/agents/held-messages.d.ts +33 -0
  257. package/dist/session/agents/held-messages.js +50 -0
  258. package/dist/session/agents/legacy-subagent-chat.d.ts +11 -0
  259. package/dist/session/agents/legacy-subagent-chat.js +19 -0
  260. package/dist/session/agents/session-peek.d.ts +20 -0
  261. package/dist/session/agents/session-peek.js +67 -0
  262. package/dist/session/agents/session-prompt.d.ts +13 -0
  263. package/dist/session/agents/session-prompt.js +18 -0
  264. package/dist/session/agents/steer-session.d.ts +13 -0
  265. package/dist/session/agents/steer-session.js +29 -0
  266. package/dist/session/agents/subagent-dialog-content.d.ts +11 -0
  267. package/dist/session/agents/subagent-dialog-content.js +115 -0
  268. package/dist/session/agents/subagent-view.d.ts +8 -0
  269. package/dist/session/agents/subagent-view.js +18 -0
  270. package/dist/session/agents/tasks-panel.d.ts +13 -0
  271. package/dist/session/agents/tasks-panel.js +41 -0
  272. package/dist/session/agents/workflow-run-controls.d.ts +43 -0
  273. package/dist/session/agents/workflow-run-controls.js +141 -0
  274. package/dist/session/composer/ComposerCard.d.ts +1 -1
  275. package/dist/session/composer/ComposerCard.js +3 -3
  276. package/dist/session/composer/agent-selector.js +13 -19
  277. package/dist/session/composer/composer-underbar.d.ts +3 -1
  278. package/dist/session/composer/composer-underbar.js +2 -2
  279. package/dist/session/composer/composer.d.ts +5 -0
  280. package/dist/session/composer/composer.js +16 -10
  281. package/dist/session/composer/editor/composer-editor.js +19 -8
  282. package/dist/session/composer/editor/ultracode.d.ts +34 -0
  283. package/dist/session/composer/editor/ultracode.js +127 -0
  284. package/dist/session/composer/send-blockers.d.ts +1 -11
  285. package/dist/session/composer/send-blockers.js +1 -11
  286. package/dist/session/composer/session-composer-readiness.d.ts +1 -28
  287. package/dist/session/composer/session-composer-readiness.js +5 -16
  288. package/dist/session/header/reminder-parts.d.ts +1 -1
  289. package/dist/session/header/session-site-header.js +6 -3
  290. package/dist/session/header/subagent-hover-card.d.ts +0 -2
  291. package/dist/session/header/subagent-hover-card.js +1 -4
  292. package/dist/session/models/claude-connection-slot.d.ts +11 -0
  293. package/dist/session/models/claude-connection-slot.js +30 -0
  294. package/dist/session/models/model-availability.d.ts +3 -1
  295. package/dist/session/models/model-availability.js +3 -0
  296. package/dist/session/models/model-selector.js +11 -12
  297. package/dist/session/models/model-tags.d.ts +9 -0
  298. package/dist/session/models/model-tags.js +8 -0
  299. package/dist/session/panel/easy/easy-panel.js +1 -1
  300. package/dist/session/panel/easy/step-icon.js +5 -1
  301. package/dist/session/panel/mobile-tool-drawer.js +1 -1
  302. package/dist/session/panel/session-action-panel-column.js +1 -1
  303. package/dist/session/panel/session-desktop.js +41 -14
  304. package/dist/session/panel/session-panel-provider.d.ts +1 -1
  305. package/dist/session/panel/session-panel-provider.js +7 -11
  306. package/dist/session/prompts/question-prompt.js +3 -1
  307. package/dist/session/status/session-error-banner.js +4 -1
  308. package/dist/session/thread/session-chat.js +286 -296
  309. package/dist/session/thread/session-context-modal.js +29 -10
  310. package/dist/session/thread/session-context-spawned-sessions.d.ts +13 -0
  311. package/dist/session/thread/session-context-spawned-sessions.js +44 -0
  312. package/dist/session/thread/session-context-sub-sessions.js +3 -8
  313. package/dist/session/thread/transcript.d.ts +3 -0
  314. package/dist/session/thread/transcript.js +32 -8
  315. package/dist/session/tool/shared/full-view-action.d.ts +29 -0
  316. package/dist/session/tool/shared/full-view-action.js +43 -0
  317. package/dist/session/tool/tool-part-renderer.js +10 -2
  318. package/dist/session/tool/tools/agent-message-tool.js +2 -2
  319. package/dist/session/tool/tools/agent-spawn-tool.js +2 -2
  320. package/dist/session/tool/tools/agent-status-tool.js +2 -2
  321. package/dist/session/tool/tools/kortix-action-tool.d.ts +2 -0
  322. package/dist/session/tool/tools/kortix-action-tool.js +148 -0
  323. package/dist/session/tool/tools/kortix-tool-card.d.ts +83 -0
  324. package/dist/session/tool/tools/kortix-tool-card.js +186 -0
  325. package/dist/session/tool/tools/multi-agent-tool-bodies.d.ts +11 -0
  326. package/dist/session/tool/tools/multi-agent-tool-bodies.js +141 -0
  327. package/dist/session/tool/tools/multi-agent-tool-data.d.ts +63 -0
  328. package/dist/session/tool/tools/multi-agent-tool-data.js +118 -0
  329. package/dist/session/tool/tools/multi-agent-tools.d.ts +9 -0
  330. package/dist/session/tool/tools/multi-agent-tools.js +38 -0
  331. package/dist/session/tool/tools/question-tool.js +1 -1
  332. package/dist/session/tool/tools/register.d.ts +3 -0
  333. package/dist/session/tool/tools/register.js +3 -0
  334. package/dist/session/tool/tools/session-spawn-tool.js +2 -2
  335. package/dist/session/tool/tools/task-tool.d.ts +1 -1
  336. package/dist/session/tool/tools/task-tool.js +29 -41
  337. package/dist/session/tool/tools/workflow-progress.d.ts +34 -0
  338. package/dist/session/tool/tools/workflow-progress.js +186 -0
  339. package/dist/session/tool/tools/workflow-run.d.ts +128 -0
  340. package/dist/session/tool/tools/workflow-run.js +251 -0
  341. package/dist/session/tool/tools/workflow-tool.d.ts +9 -0
  342. package/dist/session/tool/tools/workflow-tool.js +253 -0
  343. package/dist/session/turn/notice-batch-group.d.ts +12 -0
  344. package/dist/session/turn/notice-batch-group.js +17 -0
  345. package/dist/session/turn/peer-message-row.d.ts +14 -0
  346. package/dist/session/turn/peer-message-row.js +57 -0
  347. package/dist/session/turn/subagent-notice-row.d.ts +4 -0
  348. package/dist/session/turn/subagent-notice-row.js +50 -0
  349. package/dist/session/turn/subagent-notice.d.ts +58 -0
  350. package/dist/session/turn/subagent-notice.js +111 -0
  351. package/dist/session/turn/user-message.js +24 -5
  352. package/dist/styles/tokens.css +2 -0
  353. package/dist/styles.css +1 -1
  354. package/dist/terminal/session-terminal-connect-bar.js +1 -1
  355. package/dist/workspace/admin/project-admin-dashboard.d.ts +53 -0
  356. package/dist/workspace/admin/project-admin-dashboard.js +252 -0
  357. package/dist/workspace/admin/project-admin-nav.d.ts +20 -0
  358. package/dist/workspace/admin/project-admin-nav.js +41 -0
  359. package/dist/workspace/home/welcome-body.js +25 -3
  360. package/dist/workspace/index.d.ts +6 -2
  361. package/dist/workspace/index.js +12 -2
  362. package/dist/workspace/layout/new-session-create.js +3 -3
  363. package/dist/workspace/layout/project-home.js +3 -3
  364. package/dist/workspace/memory/memory-labels.js +5 -0
  365. package/dist/workspace/repository-disconnected.js +2 -2
  366. package/dist/workspace/sessions/board-dispatch.d.ts +52 -0
  367. package/dist/workspace/sessions/board-dispatch.js +110 -0
  368. package/dist/workspace/sessions/board-grouping.d.ts +63 -0
  369. package/dist/workspace/sessions/board-grouping.js +141 -0
  370. package/dist/workspace/sessions/board-peek.d.ts +15 -0
  371. package/dist/workspace/sessions/board-peek.js +54 -0
  372. package/dist/workspace/sessions/board-state-mark.d.ts +15 -0
  373. package/dist/workspace/sessions/board-state-mark.js +24 -0
  374. package/dist/workspace/sessions/project-sessions-view.js +42 -31
  375. package/dist/workspace/sessions/sessions-board.d.ts +12 -0
  376. package/dist/workspace/sessions/sessions-board.js +214 -0
  377. package/dist/workspace/sidebar/footer/project-manifest-issues-alert.d.ts +46 -0
  378. package/dist/workspace/sidebar/footer/project-manifest-issues-alert.js +85 -0
  379. package/dist/workspace/sidebar/footer/sidebar-alert.js +1 -1
  380. package/dist/workspace/sidebar/new-agent-modal-provider.d.ts +12 -0
  381. package/dist/workspace/sidebar/new-agent-modal-provider.js +19 -0
  382. package/dist/workspace/sidebar/project-nav-items.d.ts +3 -1
  383. package/dist/workspace/sidebar/project-nav-items.js +53 -5
  384. package/dist/workspace/sidebar/project-session-list.js +35 -12
  385. package/dist/workspace/sidebar/project-sidebar.js +6 -3
  386. package/dist/workspace/sidebar/session-filter-menu.js +2 -1
  387. package/dist/workspace/space/space-blocks.d.ts +25 -0
  388. package/dist/workspace/space/space-blocks.js +124 -0
  389. package/dist/workspace/space/space-filter-tabs.d.ts +17 -0
  390. package/dist/workspace/space/space-filter-tabs.js +31 -0
  391. package/dist/workspace/space/space-page.d.ts +24 -0
  392. package/dist/workspace/space/space-page.js +157 -0
  393. package/dist/workspace/space/space-room.d.ts +20 -0
  394. package/dist/workspace/space/space-room.js +27 -0
  395. package/dist/workspace/space/space-tab-menu.d.ts +14 -0
  396. package/dist/workspace/space/space-tab-menu.js +127 -0
  397. package/dist/workspace/space/space-tab-panels.d.ts +9 -0
  398. package/dist/workspace/space/space-tab-panels.js +203 -0
  399. package/dist/workspace/space/space-templates.d.ts +34 -0
  400. package/dist/workspace/space/space-templates.js +71 -0
  401. package/dist/workspace/space/use-space-filter.d.ts +10 -0
  402. package/dist/workspace/space/use-space-filter.js +40 -0
  403. package/dist/workspace/space/use-space-manifest.d.ts +8 -0
  404. package/dist/workspace/space/use-space-manifest.js +27 -0
  405. package/dist/workspace/spaces/space-timeline.js +2 -2
  406. package/package.json +56 -53
  407. package/skills/kortix-ui/SKILL.md +1 -1
  408. package/skills/kortix-ui/references/custom-dashboard.md +10 -4
  409. package/skills/kortix-ui/references/modules.md +10 -8
  410. package/dist/_vendor/shared/meta-agent.d.ts +0 -7
  411. package/dist/customize/agents/agent-grant-pages.d.ts +0 -37
  412. package/dist/customize/agents/agent-grant-pages.js +0 -226
  413. package/dist/customize/agents/agent-triggers-section.d.ts +0 -17
  414. package/dist/customize/agents/agent-triggers-section.js +0 -109
  415. package/dist/customize/migrate-to-v2/index.d.ts +0 -5
  416. package/dist/customize/migrate-to-v2/index.js +0 -5
  417. package/dist/customize/migrate-to-v2/migration-prompt.d.ts +0 -16
  418. package/dist/customize/migrate-to-v2/migration-prompt.js +0 -59
  419. package/dist/customize/migrate-to-v2/upgrade-defs.d.ts +0 -30
  420. package/dist/customize/migrate-to-v2/upgrade-defs.js +0 -43
  421. package/dist/customize/migrate-to-v2/upgrade-view.d.ts +0 -32
  422. package/dist/customize/migrate-to-v2/upgrade-view.js +0 -152
  423. package/dist/customize/migrate-to-v2/use-run-upgrade.d.ts +0 -18
  424. package/dist/customize/migrate-to-v2/use-run-upgrade.js +0 -16
  425. package/dist/customize/shared/capability-tabs.d.ts +0 -3
  426. package/dist/customize/shared/capability-tabs.js +0 -137
  427. package/dist/customize/skills/skill-scope.d.ts +0 -14
  428. package/dist/customize/skills/skill-scope.js +0 -18
  429. package/dist/internal/lib/manifest-version.d.ts +0 -21
  430. package/dist/internal/lib/manifest-version.js +0 -55
  431. package/dist/session/composer/hooks/use-composer-escape-stop.d.ts +0 -6
  432. package/dist/session/composer/hooks/use-composer-escape-stop.js +0 -28
  433. package/dist/session/thread/sub-session-modal-content.d.ts +0 -8
  434. package/dist/session/thread/sub-session-modal-content.js +0 -23
  435. package/dist/session/thread/sub-session-modal.d.ts +0 -2
  436. package/dist/session/thread/sub-session-modal.js +0 -14
  437. package/dist/workspace/sidebar/footer/project-manifest-upgrade-alert.d.ts +0 -13
  438. package/dist/workspace/sidebar/footer/project-manifest-upgrade-alert.js +0 -48
@@ -0,0 +1,148 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { Badge } from '../../../primitives/badge.js';
4
+ import { Button } from '../../../primitives/button.js';
5
+ import { ButtonGroup } from '../../../primitives/button-group.js';
6
+ import { StatusDot } from '../../../primitives/status.js';
7
+ import { TextShimmer } from '../../../primitives/text-shimmer.js';
8
+ import { GenericTool } from '../generic-tool.js';
9
+ import { BasicTool, partError, partInput, partRawOutput, partStatus, ToolOutcomeContext, ToolRunningContext, useToolIndent, useToolOpen, } from '../shared/infrastructure.js';
10
+ import { FoldedSection, OutputBlock } from '../shared/output-block.js';
11
+ import { ToolRegistry } from '../shared/registry.js';
12
+ import { ToolResultCard } from '../shared/result-card.js';
13
+ import { useTranslations } from '../../../i18n/index.js';
14
+ import { cn } from '../../../lib/utils.js';
15
+ import { UiLink } from '../../../providers/ui-provider.js';
16
+ import { ArrowRightIcon, ArrowSquareOutIcon, CalendarDotsIcon, CaretRightIcon, ChartBarIcon, ChatsCircleIcon, CheckIcon, GitPullRequestIcon, SunDimIcon, HandPointingIcon, LockKeyIcon, PlugIcon, RobotIcon, UsersIcon, WarningIcon, } from '@phosphor-icons/react';
17
+ import { useContext, useMemo } from 'react';
18
+ import { MULTI_AGENT_ICON, multiAgentBody, runningKey } from './multi-agent-tool-bodies.js';
19
+ import { KORTIX_PLATFORM_TOOLS, isReadAction, kortixCardTool, kortixPlatformTool, multiAgentTool, parseKortixToolResult, } from './kortix-tool-card.js';
20
+ const TOOL_META = {
21
+ kortix_agents: { icon: RobotIcon, object: 'agents' },
22
+ kortix_sessions: { icon: ChatsCircleIcon, object: 'sessions' },
23
+ kortix_schedules: { icon: CalendarDotsIcon, object: 'schedules' },
24
+ kortix_connectors: { icon: PlugIcon, object: 'connectors' },
25
+ kortix_people: { icon: UsersIcon, object: 'people' },
26
+ kortix_access: { icon: LockKeyIcon, object: 'access' },
27
+ kortix_usage: { icon: ChartBarIcon, object: 'usage' },
28
+ kortix_change_requests: { icon: GitPullRequestIcon, object: 'changeRequests' },
29
+ kortix_memory: { icon: SunDimIcon, object: 'memory' },
30
+ };
31
+ /** Row badge words that name a state with a hue (color.md status table). Any other word stays neutral. */
32
+ const SUCCESS_WORDS = new Set(['running', 'active', 'connected', 'enabled', 'done', 'live', 'merged', 'on']);
33
+ const ATTENTION_WORDS = new Set(['paused', 'expired', 'not signed in', 'disconnected', 'needs you']);
34
+ function badgeVariant(badge) {
35
+ const word = badge.toLowerCase();
36
+ if (SUCCESS_WORDS.has(word))
37
+ return 'success';
38
+ if (ATTENTION_WORDS.has(word))
39
+ return 'warning';
40
+ return 'muted';
41
+ }
42
+ /** Raw output for "Show details": the result pretty-printed, capped. */
43
+ const DETAILS_LIMIT = 8_000;
44
+ function detailsText(raw) {
45
+ let text = raw;
46
+ try {
47
+ text = JSON.stringify(JSON.parse(raw), null, 2);
48
+ }
49
+ catch {
50
+ // keep the raw text
51
+ }
52
+ return text.length > DETAILS_LIMIT ? `${text.slice(0, DETAILS_LIMIT)}\n…` : text;
53
+ }
54
+ /** The card's state at the row's right edge. The glyph carries the hue; the word is for a screen reader. */
55
+ function StatusMark({ status }) {
56
+ const t = useTranslations('tools.kortixAction.status');
57
+ const glyph = status === 'done' ? (_jsx(CheckIcon, { "aria-hidden": true, className: "text-kortix-green size-3.5 shrink-0" })) : status === 'running' ? (
58
+ // The thing the tool started runs on (a session). No spinner: the call itself is over.
59
+ _jsx(StatusDot, { tone: "success" })) : status === 'needs_you' ? (_jsx(HandPointingIcon, { weight: "fill", "aria-hidden": true, className: "text-kortix-yellow size-3.5 shrink-0" })) : status === 'denied' ? (_jsx(LockKeyIcon, { weight: "fill", "aria-hidden": true, className: "text-kortix-orange size-3.5 shrink-0" })) : (_jsx(WarningIcon, { weight: "fill", "aria-hidden": true, className: "text-kortix-red size-3.5 shrink-0" }));
60
+ const label = { done: t('done'), running: t('running'), needs_you: t('needsYou'), denied: t('denied'), error: t('error') }[status];
61
+ return (_jsxs("span", { className: "ml-auto flex shrink-0 items-center pl-1", children: [glyph, _jsx("span", { className: "sr-only", children: label })] }));
62
+ }
63
+ /** The row's words stay ink; the status mark at the right edge carries the hue. */
64
+ function CardTrigger({ title, subtitle, live, status, }) {
65
+ return (_jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-1.5 overflow-hidden text-sm", children: [live ? (_jsx(TextShimmer, { duration: 1, spread: 2, className: "min-w-0 truncate text-sm", children: title })) : (_jsx("span", { className: "text-foreground min-w-0 truncate", title: title, children: title })), subtitle && (_jsx("span", { className: "text-muted-foreground min-w-0 flex-1 truncate", title: subtitle, children: subtitle })), status && _jsx(StatusMark, { status: status })] }));
66
+ }
67
+ const ROW_CLASS = 'flex min-w-0 items-center gap-2 rounded-sm px-2 py-1.5 text-xs';
68
+ function CardRowLine({ row }) {
69
+ const body = (_jsxs(_Fragment, { children: [_jsx("span", { className: "text-foreground min-w-0 truncate font-medium", title: row.title, children: row.title }), row.detail ? (_jsx("span", { className: "text-muted-foreground min-w-0 flex-1 truncate", title: row.detail, children: row.detail })) : (_jsx("span", { className: "flex-1" })), row.badge && (_jsx(Badge, { variant: badgeVariant(row.badge), size: "sm", className: "shrink-0", children: row.badge })), row.href && _jsx(CaretRightIcon, { "aria-hidden": true, className: "text-muted-foreground size-3 shrink-0" })] }));
70
+ return row.href ? (_jsx(UiLink, { href: row.href, className: cn(ROW_CLASS, 'hover:bg-muted/40 transition-colors'), children: body })) : (_jsx("div", { className: ROW_CLASS, children: body }));
71
+ }
72
+ function ChangeLine({ change }) {
73
+ const t = useTranslations('tools.kortixAction');
74
+ return (_jsxs("li", { className: ROW_CLASS, children: [_jsx("span", { className: "text-muted-foreground shrink-0", children: change.field }), change.before === null ? (_jsxs(_Fragment, { children: [_jsx(Badge, { variant: "new", size: "sm", className: "shrink-0", children: t('newSetting') }), _jsx("span", { className: "text-foreground min-w-0 truncate", title: change.after ?? '', children: change.after })] })) : change.after === null ? (_jsxs(_Fragment, { children: [_jsx("span", { className: "text-muted-foreground min-w-0 truncate line-through", title: change.before, children: change.before }), _jsx(Badge, { variant: "muted", size: "sm", className: "shrink-0", children: t('removedSetting') })] })) : (_jsxs(_Fragment, { children: [_jsx("span", { className: "text-muted-foreground min-w-0 truncate", title: change.before, children: change.before }), _jsx(ArrowRightIcon, { "aria-hidden": true, className: "text-muted-foreground size-3 shrink-0" }), _jsx("span", { className: "text-foreground min-w-0 truncate", title: change.after, children: change.after })] }))] }));
75
+ }
76
+ /** "Needs a permission", then who can grant it. The brand's refusal wording when the tool could not read them. */
77
+ function DeniedNotice({ error }) {
78
+ const t = useTranslations('tools.kortixAction');
79
+ const grantors = error?.grantors ?? [];
80
+ return (_jsxs(ToolResultCard, { bodyClassName: "space-y-1.5 px-2 py-1.5 text-xs", children: [_jsxs("div", { className: "text-foreground flex items-center gap-1.5 font-medium", children: [_jsx(LockKeyIcon, { weight: "fill", "aria-hidden": true, className: "text-kortix-orange size-3.5 shrink-0" }), t('deniedTitle')] }), grantors.length > 0 ? (_jsxs("div", { className: "space-y-1", children: [_jsx("div", { className: "text-muted-foreground", children: t('grantors') }), _jsx("ul", { className: "space-y-0.5", children: grantors.map((grantor, index) => (_jsxs("li", { className: "flex min-w-0 items-center gap-1.5", children: [_jsx("span", { className: "text-foreground min-w-0 truncate", children: grantor.name }), grantor.role && (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": true, className: "text-muted-foreground shrink-0", children: "\u00B7" }), _jsx("span", { className: "text-muted-foreground shrink-0", children: grantor.role })] }))] }, `${grantor.name}-${index}`))) })] })) : (_jsx("p", { className: "text-muted-foreground", children: t('grantorsUnknown') }))] }));
81
+ }
82
+ /**
83
+ * The card's links. An absolute `https://` link (a connector sign-in) is the card's
84
+ * primary action and opens a new tab; in-app paths stay in the app.
85
+ */
86
+ function CardLinks({ links }) {
87
+ const t = useTranslations('tools.kortixAction');
88
+ const indent = useToolIndent();
89
+ const external = links.filter((link) => link.external);
90
+ const internal = links.filter((link) => !link.external);
91
+ const internalButtons = internal.map((link) => (_jsx(Button, { asChild: true, variant: "outline", size: "xs", children: _jsx(UiLink, { href: link.href, children: link.label }) }, `${link.label}-${link.href}`)));
92
+ return (_jsxs("div", { className: cn('flex flex-wrap items-center gap-1.5', indent && 'mt-1.5', indent), children: [external.map((link) => (_jsx(Button, { asChild: true, size: "xs", children: _jsxs("a", { href: link.href, target: "_blank", rel: "noopener noreferrer", title: t('opensInNewTab'), children: [link.label, _jsx(ArrowSquareOutIcon, { "aria-hidden": true, className: "size-3 shrink-0" })] }) }, `${link.label}-${link.href}`))), internalButtons.length > 1 ? _jsx(ButtonGroup, { children: internalButtons }) : internalButtons] }));
93
+ }
94
+ function CardDetails({ raw }) {
95
+ const t = useTranslations('tools.kortixAction');
96
+ const indent = useToolIndent();
97
+ const text = useMemo(() => detailsText(raw), [raw]);
98
+ return (_jsx("div", { className: cn(indent && 'mt-1.5', indent), children: _jsx(FoldedSection, { label: t('showDetails'), children: _jsx(OutputBlock, { text: text }) }) }));
99
+ }
100
+ /** The trigger subtitle while the row is closed; open, the body says it in full. */
101
+ function SettledTrigger({ title, subtitle, subtitleInBody, status, }) {
102
+ const open = useToolOpen();
103
+ return (_jsx(CardTrigger, { title: title, subtitle: open && subtitleInBody ? undefined : subtitle, live: false, status: status }));
104
+ }
105
+ export function KortixActionTool(props) {
106
+ const { call, defaultOpen, forceOpen, locked } = props;
107
+ const t = useTranslations('tools.kortixAction');
108
+ const tMulti = useTranslations('multiAgent.tools');
109
+ const running = useContext(ToolRunningContext);
110
+ const tool = kortixCardTool(call.name);
111
+ const platform = kortixPlatformTool(call.name);
112
+ const multi = multiAgentTool(call.name);
113
+ const status = partStatus(call);
114
+ const settled = status === 'completed' || status === 'error';
115
+ const raw = status === 'error' ? (partError(call) ?? '') : partRawOutput(call);
116
+ const result = useMemo(() => (settled ? parseKortixToolResult(raw, call.name) : null), [settled, raw, call.name]);
117
+ if (!tool || (settled && !result)) {
118
+ return _jsx(GenericTool, { call: call, defaultOpen: defaultOpen, forceOpen: forceOpen, locked: locked });
119
+ }
120
+ const ToolIcon = platform ? TOOL_META[platform].icon : MULTI_AGENT_ICON[multi];
121
+ const icon = _jsx(ToolIcon, { className: "size-4 shrink-0" });
122
+ if (!result) {
123
+ const title = platform
124
+ ? t(`running.${TOOL_META[platform].object}.${isReadAction(partInput(call).action) ? 'read' : 'change'}`)
125
+ : tMulti(`running.${runningKey(multi)}`);
126
+ return (_jsx(BasicTool, { icon: icon, trigger: _jsx(CardTrigger, { title: title, live: running }), defaultOpen: defaultOpen, forceOpen: forceOpen, locked: locked }));
127
+ }
128
+ const { card, error } = result;
129
+ const denied = card.status === 'denied';
130
+ const failure = card.status === 'error' && error && error.message && error.message !== card.title ? error.message : undefined;
131
+ // A multi-agent result draws its own body from `data`; the card's rows would say it twice.
132
+ const rich = multi && !denied ? multiAgentBody(multi, result) : null;
133
+ // `fail()` puts the error message in the subtitle, and a rich body says what
134
+ // the subtitle sums up: the open card shows it in full instead.
135
+ const subtitleInBody = denied || Boolean(rich) || (failure !== undefined && failure === card.subtitle);
136
+ const hasBody = denied || Boolean(failure) || Boolean(rich) || card.rows.length > 0 || card.changes.length > 0 || card.links.length > 0 || Boolean(raw);
137
+ // What the person must see or act on opens itself: a refusal, a change, a sign-in link.
138
+ const attention = denied || card.status === 'needs_you' || card.changes.length > 0 || card.links.some((link) => link.external);
139
+ return (
140
+ // The card names its own outcome (the status mark); the shared failure triangle would repeat it.
141
+ _jsx(ToolOutcomeContext.Provider, { value: "ok", children: _jsx(BasicTool, { icon: icon, trigger: _jsx(SettledTrigger, { title: card.title, subtitle: card.subtitle, subtitleInBody: subtitleInBody, status: card.status }), defaultOpen: defaultOpen, forceOpen: forceOpen || attention, locked: locked, children: hasBody ? (_jsxs(_Fragment, { children: [denied && _jsx(DeniedNotice, { error: error }), failure && (_jsx(ToolResultCard, { bodyClassName: "px-2 py-1.5", children: _jsx("p", { className: "text-muted-foreground text-xs wrap-break-word", children: failure }) })), rich, !rich && card.rows.length > 0 && (_jsx(ToolResultCard, { bodyClassName: "py-0.5", children: _jsx("ul", { children: card.rows.map((row, index) => (_jsx("li", { children: _jsx(CardRowLine, { row: row }) }, `${row.title}-${index}`))) }) })), card.changes.length > 0 && (_jsx(ToolResultCard, { bodyClassName: "py-0.5", children: _jsx("ul", { children: card.changes.map((change, index) => (_jsx(ChangeLine, { change: change }, `${change.field}-${index}`))) }) })), card.links.length > 0 && _jsx(CardLinks, { links: card.links }), raw && !rich && _jsx(CardDetails, { raw: raw })] })) : undefined }) }));
142
+ }
143
+ for (const name of KORTIX_PLATFORM_TOOLS)
144
+ ToolRegistry.register(name, KortixActionTool);
145
+ // The multi-agent tools no older tool shares a name with. `task_create`, `task_list`,
146
+ // `task_get` and `task_update` register in `multi-agent-tools.tsx`, beside the older tools.
147
+ for (const name of ['send_message', 'list_agents', 'task_stop'])
148
+ ToolRegistry.register(name, KortixActionTool);
@@ -0,0 +1,83 @@
1
+ /**
2
+ * The My Kortix platform tools' result, parsed defensively.
3
+ *
4
+ * The shape is `KortixToolResult` in `packages/api-contract/src/kortix-tool-card.ts`.
5
+ * `@kortix/ui` does not depend on that package, so the types are mirrored here
6
+ * and every field is checked. A result that does not parse is `null`, and the
7
+ * call renders as the generic tool card instead of a half-drawn one.
8
+ */
9
+ /** `KORTIX_PLATFORM_TOOL_NAMES` in `packages/api-contract/src/kortix-tool-card.ts`. */
10
+ export declare const KORTIX_PLATFORM_TOOLS: readonly ["kortix_agents", "kortix_sessions", "kortix_schedules", "kortix_connectors", "kortix_people", "kortix_access", "kortix_usage", "kortix_change_requests", "kortix_memory"];
11
+ export type KortixPlatformTool = (typeof KORTIX_PLATFORM_TOOLS)[number];
12
+ /**
13
+ * The multi-agent tools (`packages/api-contract/src/multi-agent.ts`): the same
14
+ * `KortixToolResult`, with `data` = the contract object the card body draws.
15
+ * `task_create`, `task_list`, `task_get` and `task_update` are also the names of
16
+ * older plugin tools: `multi-agent-tools.tsx` tells the two apart by the output.
17
+ */
18
+ export declare const MULTI_AGENT_TOOLS: readonly ["send_message", "list_agents", "task_create", "task_list", "task_get", "task_update", "task_stop"];
19
+ export type MultiAgentTool = (typeof MULTI_AGENT_TOOLS)[number];
20
+ /** Every tool whose result is a `KortixToolResult` card. */
21
+ export type KortixCardTool = KortixPlatformTool | MultiAgentTool;
22
+ export type KortixCardStatus = 'done' | 'running' | 'needs_you' | 'denied' | 'error';
23
+ export interface KortixCardRow {
24
+ title: string;
25
+ detail?: string;
26
+ badge?: string;
27
+ /** In-app path (`/projects/…`). A row never links outside the app. */
28
+ href?: string;
29
+ }
30
+ /** A `before` of `null` is a new setting; an `after` of `null` is a removed one. */
31
+ export interface KortixCardChange {
32
+ field: string;
33
+ before: string | null;
34
+ after: string | null;
35
+ }
36
+ export interface KortixCardLink {
37
+ label: string;
38
+ /** An in-app path, or an absolute `https://` URL (a connector sign-in link). */
39
+ href: string;
40
+ /** True for an absolute `https://` URL: it opens in a new tab and is the card's primary action. */
41
+ external: boolean;
42
+ }
43
+ export interface KortixToolCard {
44
+ title: string;
45
+ subtitle?: string;
46
+ status: KortixCardStatus;
47
+ rows: KortixCardRow[];
48
+ changes: KortixCardChange[];
49
+ links: KortixCardLink[];
50
+ }
51
+ export interface KortixGrantor {
52
+ name: string;
53
+ role: string;
54
+ }
55
+ export interface KortixToolError {
56
+ kind: 'denied' | 'not_found' | 'invalid' | 'failed';
57
+ message: string;
58
+ grantors: KortixGrantor[];
59
+ }
60
+ export interface KortixToolResult {
61
+ ok: boolean;
62
+ tool: KortixCardTool;
63
+ action: string;
64
+ card: KortixToolCard;
65
+ error?: KortixToolError;
66
+ /** What the model reads. Only the multi-agent card bodies draw it, each through its own defensive parser. */
67
+ data?: unknown;
68
+ }
69
+ /** The platform tool a call name names: `kortix_agents`, also as `kortix-agents` or `oc-kortix_agents`. */
70
+ export declare function kortixPlatformTool(name: string): KortixPlatformTool | undefined;
71
+ /** A multi-agent tool a call name names: `send_message`, also as `send-message` or `oc-send_message`. */
72
+ export declare function multiAgentTool(name: string): MultiAgentTool | undefined;
73
+ /** Any tool that answers with a `KortixToolResult` card. */
74
+ export declare function kortixCardTool(name: string): KortixCardTool | undefined;
75
+ /** An in-app path: one leading `/`, never `//` (a protocol-relative URL leaves the app). */
76
+ export declare function inAppHref(value: unknown): string | undefined;
77
+ /**
78
+ * The result in a platform call's output (or its error text, when the call threw
79
+ * it): one JSON object. `null` when the text is not that object. `callName` names
80
+ * the tool when the result leaves `tool` out.
81
+ */
82
+ export declare function parseKortixToolResult(raw: string | undefined, callName?: string): KortixToolResult | null;
83
+ export declare function isReadAction(action: unknown): boolean;
@@ -0,0 +1,186 @@
1
+ /**
2
+ * The My Kortix platform tools' result, parsed defensively.
3
+ *
4
+ * The shape is `KortixToolResult` in `packages/api-contract/src/kortix-tool-card.ts`.
5
+ * `@kortix/ui` does not depend on that package, so the types are mirrored here
6
+ * and every field is checked. A result that does not parse is `null`, and the
7
+ * call renders as the generic tool card instead of a half-drawn one.
8
+ */
9
+ /** `KORTIX_PLATFORM_TOOL_NAMES` in `packages/api-contract/src/kortix-tool-card.ts`. */
10
+ export const KORTIX_PLATFORM_TOOLS = [
11
+ 'kortix_agents',
12
+ 'kortix_sessions',
13
+ 'kortix_schedules',
14
+ 'kortix_connectors',
15
+ 'kortix_people',
16
+ 'kortix_access',
17
+ 'kortix_usage',
18
+ 'kortix_change_requests',
19
+ 'kortix_memory',
20
+ ];
21
+ /**
22
+ * The multi-agent tools (`packages/api-contract/src/multi-agent.ts`): the same
23
+ * `KortixToolResult`, with `data` = the contract object the card body draws.
24
+ * `task_create`, `task_list`, `task_get` and `task_update` are also the names of
25
+ * older plugin tools: `multi-agent-tools.tsx` tells the two apart by the output.
26
+ */
27
+ export const MULTI_AGENT_TOOLS = [
28
+ 'send_message',
29
+ 'list_agents',
30
+ 'task_create',
31
+ 'task_list',
32
+ 'task_get',
33
+ 'task_update',
34
+ 'task_stop',
35
+ ];
36
+ const STATUSES = new Set(['done', 'running', 'needs_you', 'denied', 'error']);
37
+ const ERROR_KINDS = new Set(['denied', 'not_found', 'invalid', 'failed']);
38
+ /** A card holds a short list; a longer one is the tool's mistake, not a page to render. */
39
+ const MAX_ITEMS = 50;
40
+ const isObject = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
41
+ const text = (value) => typeof value === 'string' && value.trim() ? value.trim() : undefined;
42
+ /** The platform tool a call name names: `kortix_agents`, also as `kortix-agents` or `oc-kortix_agents`. */
43
+ export function kortixPlatformTool(name) {
44
+ const normalized = name.replace(/^oc[-_]/, '').replace(/-/g, '_');
45
+ return KORTIX_PLATFORM_TOOLS.includes(normalized)
46
+ ? normalized
47
+ : undefined;
48
+ }
49
+ /** A multi-agent tool a call name names: `send_message`, also as `send-message` or `oc-send_message`. */
50
+ export function multiAgentTool(name) {
51
+ const normalized = name.replace(/^oc[-_]/, '').replace(/-/g, '_');
52
+ return MULTI_AGENT_TOOLS.includes(normalized) ? normalized : undefined;
53
+ }
54
+ /** Any tool that answers with a `KortixToolResult` card. */
55
+ export function kortixCardTool(name) {
56
+ return kortixPlatformTool(name) ?? multiAgentTool(name);
57
+ }
58
+ /** An in-app path: one leading `/`, never `//` (a protocol-relative URL leaves the app). */
59
+ export function inAppHref(value) {
60
+ const href = text(value);
61
+ return href && href.startsWith('/') && !href.startsWith('//') && !href.includes('\\') ? href : undefined;
62
+ }
63
+ function externalHref(value) {
64
+ const href = text(value);
65
+ if (!href)
66
+ return undefined;
67
+ try {
68
+ return new URL(href).protocol === 'https:' ? href : undefined;
69
+ }
70
+ catch {
71
+ return undefined;
72
+ }
73
+ }
74
+ function list(value, item) {
75
+ if (!Array.isArray(value))
76
+ return [];
77
+ const out = [];
78
+ for (const entry of value.slice(0, MAX_ITEMS)) {
79
+ const parsed = item(entry);
80
+ if (parsed !== undefined)
81
+ out.push(parsed);
82
+ }
83
+ return out;
84
+ }
85
+ function row(entry) {
86
+ if (!isObject(entry))
87
+ return undefined;
88
+ const title = text(entry.title);
89
+ if (!title)
90
+ return undefined;
91
+ const detail = text(entry.detail);
92
+ const badge = text(entry.badge);
93
+ const href = inAppHref(entry.href);
94
+ return { title, ...(detail ? { detail } : {}), ...(badge ? { badge } : {}), ...(href ? { href } : {}) };
95
+ }
96
+ const setting = (value) => value === null ? null : typeof value === 'string' ? value : typeof value === 'number' || typeof value === 'boolean' ? String(value) : undefined;
97
+ function change(entry) {
98
+ if (!isObject(entry))
99
+ return undefined;
100
+ const field = text(entry.field);
101
+ const before = setting(entry.before);
102
+ const after = setting(entry.after);
103
+ if (!field || before === undefined || after === undefined || (before === null && after === null))
104
+ return undefined;
105
+ return { field, before, after };
106
+ }
107
+ function link(entry) {
108
+ if (!isObject(entry))
109
+ return undefined;
110
+ const label = text(entry.label);
111
+ if (!label)
112
+ return undefined;
113
+ const internal = inAppHref(entry.href);
114
+ if (internal)
115
+ return { label, href: internal, external: false };
116
+ const external = externalHref(entry.href);
117
+ return external ? { label, href: external, external: true } : undefined;
118
+ }
119
+ function grantor(entry) {
120
+ if (!isObject(entry))
121
+ return undefined;
122
+ const name = text(entry.name);
123
+ return name ? { name, role: text(entry.role) ?? '' } : undefined;
124
+ }
125
+ function toolError(value) {
126
+ if (!isObject(value) || !ERROR_KINDS.has(value.kind))
127
+ return undefined;
128
+ return {
129
+ kind: value.kind,
130
+ message: text(value.message) ?? '',
131
+ grantors: list(value.grantors, grantor),
132
+ };
133
+ }
134
+ /**
135
+ * The result in a platform call's output (or its error text, when the call threw
136
+ * it): one JSON object. `null` when the text is not that object. `callName` names
137
+ * the tool when the result leaves `tool` out.
138
+ */
139
+ export function parseKortixToolResult(raw, callName) {
140
+ const source = raw?.trim();
141
+ if (!source || !source.startsWith('{'))
142
+ return null;
143
+ let value;
144
+ try {
145
+ value = JSON.parse(source);
146
+ }
147
+ catch {
148
+ return null;
149
+ }
150
+ if (!isObject(value) || typeof value.ok !== 'boolean' || !isObject(value.card))
151
+ return null;
152
+ const tool = typeof value.tool === 'string' ? kortixCardTool(value.tool) : callName !== undefined ? kortixCardTool(callName) : undefined;
153
+ const title = text(value.card.title);
154
+ if (!tool || !title)
155
+ return null;
156
+ const error = toolError(value.error);
157
+ // A refusal reads as one whatever status the card names: the error kind is the fact.
158
+ const status = error?.kind === 'denied'
159
+ ? 'denied'
160
+ : STATUSES.has(value.card.status)
161
+ ? value.card.status
162
+ : value.ok
163
+ ? 'done'
164
+ : 'error';
165
+ const subtitle = text(value.card.subtitle);
166
+ return {
167
+ ok: value.ok,
168
+ tool,
169
+ action: text(value.action) ?? '',
170
+ card: {
171
+ title,
172
+ ...(subtitle ? { subtitle } : {}),
173
+ status,
174
+ rows: list(value.card.rows, row),
175
+ changes: list(value.card.changes, change),
176
+ links: list(value.card.links, link),
177
+ },
178
+ ...(error ? { error } : {}),
179
+ ...(value.data !== undefined ? { data: value.data } : {}),
180
+ };
181
+ }
182
+ /** The actions that only read; every other action changes something (the SDK narration uses the same set). */
183
+ const READ_ACTIONS = new Set(['', 'list', 'get', 'read', 'find', 'show', 'view', 'events', 'search', 'check', 'status', 'pending', 'who']);
184
+ export function isReadAction(action) {
185
+ return READ_ACTIONS.has(typeof action === 'string' ? action : '');
186
+ }
@@ -0,0 +1,11 @@
1
+ import { type Icon } from '@phosphor-icons/react';
2
+ import { type ReactNode } from 'react';
3
+ import type { KortixToolResult, MultiAgentTool } from './kortix-tool-card.js';
4
+ export declare const MULTI_AGENT_ICON: Record<MultiAgentTool, Icon>;
5
+ /** The key under `multiAgent.tools.running` for a call still in flight. */
6
+ export declare function runningKey(tool: MultiAgentTool): 'sending' | 'checkingAgents' | 'checkingTasks' | 'updatingTasks' | 'stopping';
7
+ /**
8
+ * The body a multi-agent result draws from its `data`, or `null` when the data
9
+ * does not parse or holds nothing to show (the card's own rows draw instead).
10
+ */
11
+ export declare function multiAgentBody(tool: MultiAgentTool, result: KortixToolResult): ReactNode | null;
@@ -0,0 +1,141 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { Badge } from '../../../primitives/badge.js';
4
+ import { Button } from '../../../primitives/button.js';
5
+ import { Hint } from '../../../primitives/hint.js';
6
+ import { ToolResultCard } from '../shared/result-card.js';
7
+ import { SubagentDialog } from '../../agents/subagent-view.js';
8
+ import { useTranslations } from '../../../i18n/index.js';
9
+ import { AgentStateMark } from '../../agents/agent-state-mark.js';
10
+ import { subagentTitle } from '../../agents/agent-model.js';
11
+ import { agentDisplayName } from '../../../internal/components/agent-mark.js';
12
+ import { ArrowSquareOutIcon, ArrowUpRightIcon, ListChecksIcon, PaperPlaneTiltIcon, StopCircleIcon, UsersThreeIcon, } from '@phosphor-icons/react';
13
+ import { useState } from 'react';
14
+ import { parsePeerSend, parseReachable, parseStoppedChild, parseTasks, } from './multi-agent-tool-data.js';
15
+ export const MULTI_AGENT_ICON = {
16
+ send_message: PaperPlaneTiltIcon,
17
+ list_agents: UsersThreeIcon,
18
+ task_create: ListChecksIcon,
19
+ task_list: ListChecksIcon,
20
+ task_get: ListChecksIcon,
21
+ task_update: ListChecksIcon,
22
+ task_stop: StopCircleIcon,
23
+ };
24
+ /** The key under `multiAgent.tools.running` for a call still in flight. */
25
+ export function runningKey(tool) {
26
+ switch (tool) {
27
+ case 'send_message':
28
+ return 'sending';
29
+ case 'list_agents':
30
+ return 'checkingAgents';
31
+ case 'task_list':
32
+ case 'task_get':
33
+ return 'checkingTasks';
34
+ case 'task_create':
35
+ case 'task_update':
36
+ return 'updatingTasks';
37
+ case 'task_stop':
38
+ return 'stopping';
39
+ }
40
+ }
41
+ const PEER_VARIANT = {
42
+ delivered: 'success',
43
+ held: 'warning',
44
+ refused: 'warning',
45
+ denied: 'warning',
46
+ expired: 'muted',
47
+ dropped: 'muted',
48
+ };
49
+ const TASK_VARIANT = {
50
+ pending: 'muted',
51
+ in_progress: 'info',
52
+ completed: 'success',
53
+ };
54
+ const STATE_KEY = {
55
+ working: 'working',
56
+ needs_input: 'needsInput',
57
+ idle: 'idle',
58
+ completed: 'completed',
59
+ failed: 'failed',
60
+ stopped: 'stopped',
61
+ };
62
+ const TASK_KEY = {
63
+ pending: 'pending',
64
+ in_progress: 'inProgress',
65
+ completed: 'completed',
66
+ };
67
+ const ROW_CLASS = 'flex min-w-0 items-center gap-2 rounded-sm px-2 py-1.5 text-xs';
68
+ function PeerSendBody({ send }) {
69
+ const t = useTranslations('multiAgent.tools');
70
+ const preview = send.summary ?? send.message;
71
+ return (_jsxs(ToolResultCard, { bodyClassName: "space-y-1 px-2 py-1.5 text-xs", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-1.5", "data-testid": "peer-send-body", children: [send.to && (_jsxs(_Fragment, { children: [_jsx("span", { className: "text-muted-foreground shrink-0", children: t('to') }), _jsxs("span", { className: "text-foreground min-w-0 truncate font-medium", children: ["@", send.to] })] })), _jsx("span", { className: "flex-1" }), _jsx(Badge, { variant: PEER_VARIANT[send.status], size: "sm", className: "shrink-0", children: t(`peerStatus.${send.status}`) })] }), preview && _jsx("p", { className: "text-muted-foreground line-clamp-3 whitespace-pre-wrap wrap-break-word", children: preview }), send.note && send.status !== 'delivered' && _jsx("p", { className: "text-muted-foreground", children: send.note })] }));
72
+ }
73
+ /** Row actions: shown on hover and on keyboard focus, always on a touch screen (as in the agents line). */
74
+ const ROW_ACTIONS = 'flex shrink-0 items-center pr-1 opacity-0 group-hover/row:opacity-100 group-focus-within/row:opacity-100 [@media(hover:none)]:opacity-100';
75
+ /**
76
+ * One agent `list_agents` found, drawn as the agents line draws it: the state
77
+ * mark, the handle and its state, then one muted line with what it works on
78
+ * and how it relates to this session. The row opens the agent's session.
79
+ */
80
+ function AgentLine({ agent }) {
81
+ const t = useTranslations('multiAgent.tools');
82
+ const tStrip = useTranslations('multiAgent.strip');
83
+ const [viewing, setViewing] = useState(false);
84
+ const title = agent.title ? subagentTitle(agent.title) || null : null;
85
+ const relation = t.has(`relation.${agent.relation}`) ? t(`relation.${agent.relation}`) : null;
86
+ const meta = [
87
+ title ?? (agent.agentName ? tStrip('runsAs', { agent: agentDisplayName(agent.agentName) }) : null),
88
+ relation,
89
+ agent.canReceive ? null : t('cannotReceive'),
90
+ ]
91
+ .filter(Boolean)
92
+ .join(' · ');
93
+ const name = `@${agent.handle}`;
94
+ return (_jsxs("li", { className: "group/row hover:bg-hover focus-within:bg-hover flex min-w-0 items-center gap-1 rounded-sm", "data-agent-row": agent.sessionId, children: [_jsxs("button", { type: "button", onClick: () => setViewing(true), className: "flex min-w-0 flex-1 cursor-pointer items-center gap-2 py-1.5 pl-2 text-left text-xs outline-none", children: [agent.state ? _jsx(AgentStateMark, { state: agent.state }) : _jsx("span", { "aria-hidden": true, className: "size-3 shrink-0" }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsxs("span", { className: "flex min-w-0 items-baseline gap-2", children: [_jsx("span", { className: "text-foreground min-w-0 truncate font-medium", children: name }), agent.state && (_jsx("span", { className: "text-muted-foreground shrink-0", children: t(`state.${STATE_KEY[agent.state]}`) }))] }), meta && (_jsx("span", { className: "text-muted-foreground block truncate", title: meta, children: meta }))] })] }), _jsx("div", { className: ROW_ACTIONS, children: _jsx(Hint, { label: tStrip('openAgent', { name }), side: "top", children: _jsx(Button, { type: "button", variant: "ghost", size: "icon-xs", "aria-label": tStrip('openAgent', { name }), onClick: () => setViewing(true), className: "text-muted-foreground hover:text-foreground", children: _jsx(ArrowUpRightIcon, { className: "size-3.5 shrink-0" }) }) }) }), _jsx(SubagentDialog, { open: viewing, onOpenChange: setViewing, sessionId: agent.sessionId, title: name })] }));
95
+ }
96
+ function TaskLine({ task }) {
97
+ const t = useTranslations('multiAgent.tools');
98
+ return (_jsxs("div", { className: ROW_CLASS, "data-task-seq": task.seq, children: [_jsxs("span", { className: "text-muted-foreground shrink-0 tabular-nums", children: ["#", task.seq] }), _jsx("span", { className: "text-foreground min-w-0 flex-1 truncate", title: task.subject, children: task.subject }), task.blockedBy.length > 0 && task.blocked && (_jsx("span", { className: "text-muted-foreground shrink-0", children: t('blockedBy', { tasks: task.blockedBy.map((n) => `#${n}`).join(', ') }) })), task.owner && (_jsxs(Badge, { variant: "outline", size: "sm", className: "shrink-0", children: ["@", task.owner] })), _jsx(Badge, { variant: TASK_VARIANT[task.status], size: "sm", className: "shrink-0", children: t(`taskStatus.${TASK_KEY[task.status]}`) })] }));
99
+ }
100
+ /** `task_stop`: the agent it stopped, whether it was still running, and a way into its session. */
101
+ function StoppedChildBody({ child }) {
102
+ const t = useTranslations('multiAgent.tools');
103
+ const [viewing, setViewing] = useState(false);
104
+ const name = child.handle ? `@${child.handle}` : (child.title ?? child.sessionId.slice(0, 8));
105
+ const detail = child.handle ? child.title : null;
106
+ return (_jsxs(ToolResultCard, { bodyClassName: "py-0.5", children: [_jsxs("div", { className: ROW_CLASS, "data-testid": "stopped-child-body", children: [_jsx("span", { className: "text-foreground shrink-0 font-medium", children: name }), detail ? (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": true, className: "text-muted-foreground shrink-0", children: "\u00B7" }), _jsx("span", { className: "text-muted-foreground min-w-0 flex-1 truncate", title: detail, children: detail })] })) : (_jsx("span", { className: "flex-1" })), _jsx(Badge, { variant: "muted", size: "sm", className: "shrink-0", children: child.stopped ? t('stopped') : t('alreadyEnded') }), _jsx(Hint, { label: t('openSession'), children: _jsx(Button, { type: "button", variant: "ghost", size: "icon-xs", "aria-label": t('openSession'), onClick: () => setViewing(true), className: "text-muted-foreground hover:text-foreground shrink-0", children: _jsx(ArrowSquareOutIcon, { className: "size-3.5 shrink-0" }) }) })] }), _jsx(SubagentDialog, { open: viewing, onOpenChange: setViewing, sessionId: child.sessionId, title: name })] }));
107
+ }
108
+ function RowList({ children }) {
109
+ return (_jsx(ToolResultCard, { bodyClassName: "py-0.5", children: _jsx("ul", { children: children }) }));
110
+ }
111
+ /**
112
+ * The body a multi-agent result draws from its `data`, or `null` when the data
113
+ * does not parse or holds nothing to show (the card's own rows draw instead).
114
+ */
115
+ export function multiAgentBody(tool, result) {
116
+ switch (tool) {
117
+ case 'send_message': {
118
+ const send = parsePeerSend(result.data);
119
+ return send ? _jsx(PeerSendBody, { send: send }) : null;
120
+ }
121
+ case 'list_agents': {
122
+ const agents = parseReachable(result.data);
123
+ if (!agents || agents.length === 0)
124
+ return null;
125
+ return (_jsx(ToolResultCard, { bodyClassName: "p-1", children: _jsx("ul", { children: agents.map((agent) => (_jsx(AgentLine, { agent: agent }, agent.sessionId))) }) }));
126
+ }
127
+ case 'task_create':
128
+ case 'task_list':
129
+ case 'task_get':
130
+ case 'task_update': {
131
+ const tasks = parseTasks(result.data);
132
+ if (!tasks || tasks.length === 0)
133
+ return null;
134
+ return (_jsx(RowList, { children: tasks.map((task) => (_jsx("li", { children: _jsx(TaskLine, { task: task }) }, task.seq))) }));
135
+ }
136
+ case 'task_stop': {
137
+ const child = parseStoppedChild(result.data);
138
+ return child ? _jsx(StoppedChildBody, { child: child }) : null;
139
+ }
140
+ }
141
+ }
@@ -0,0 +1,63 @@
1
+ /**
2
+ * The `data` of a multi-agent tool result, parsed defensively for its card body.
3
+ *
4
+ * The shapes are in `packages/api-contract/src/multi-agent.ts` (`PeerMessageSendResult`,
5
+ * `ReachableAgents`, `SessionTask`). `@kortix/ui` does not depend on that package, so
6
+ * only the fields a card draws are mirrored here, and every one is checked. A value
7
+ * that does not parse is `null`: the card then draws its own rows, as every platform
8
+ * card does.
9
+ */
10
+ export type PeerSendStatus = 'delivered' | 'held' | 'refused' | 'denied' | 'expired' | 'dropped';
11
+ export type AgentBoardState = 'working' | 'needs_input' | 'idle' | 'completed' | 'failed' | 'stopped';
12
+ export type TeamTaskStatus = 'pending' | 'in_progress' | 'completed';
13
+ export interface PeerSendSummary {
14
+ status: PeerSendStatus;
15
+ /** The receiver's handle, without `@`. */
16
+ to: string | null;
17
+ /** The message text the sender wrote. */
18
+ message: string | null;
19
+ summary: string | null;
20
+ /** The sentence the API wrote for the sending agent ("Not sent: reviewer refuses messages."). */
21
+ note: string | null;
22
+ }
23
+ export interface ReachableAgentRow {
24
+ handle: string;
25
+ sessionId: string;
26
+ title: string | null;
27
+ agentName: string | null;
28
+ relation: string;
29
+ state: AgentBoardState | null;
30
+ canReceive: boolean;
31
+ }
32
+ /** `task_stop`: `StopChildResult` (apps/kortix-sandbox-agent-server/src/harness/pi/cloud-subagent.ts). */
33
+ export interface StoppedChild {
34
+ sessionId: string;
35
+ handle: string | null;
36
+ title: string | null;
37
+ /** False: it had already ended, and nothing was stopped. */
38
+ stopped: boolean;
39
+ }
40
+ export interface TeamTaskRow {
41
+ seq: number;
42
+ subject: string;
43
+ status: TeamTaskStatus;
44
+ owner: string | null;
45
+ blockedBy: number[];
46
+ blocked: boolean;
47
+ }
48
+ /** `send_message`: `PeerMessageSendResult`. */
49
+ export declare function parsePeerSend(data: unknown): PeerSendSummary | null;
50
+ /** `list_agents`: `ReachableAgents` (the asking session itself is left out). */
51
+ export declare function parseReachable(data: unknown): ReachableAgentRow[] | null;
52
+ /** `task_*`: one `SessionTask`, or `{ tasks: SessionTask[] }`. */
53
+ export declare function parseTasks(data: unknown): TeamTaskRow[] | null;
54
+ /** `task_stop`: the child it stopped, or null. */
55
+ export declare function parseStoppedChild(data: unknown): StoppedChild | null;
56
+ /**
57
+ * True when a running call's input has the shape of pi's `task_*` tools
58
+ * (apps/kortix-sandbox-agent-server/src/harness/pi/extensions/team-tasks.ts):
59
+ * `task_create { subject, … }`, `task_get { seq }`, `task_update { seq, … }`.
60
+ * The older plugin tools that share these names take neither. pi's
61
+ * `task_list {}` has no input to tell: its output decides once it settles.
62
+ */
63
+ export declare function looksLikeTeamTaskInput(input: unknown): boolean;