@makinbakin/sdk 0.0.1-rc.4 → 0.0.1-rc.40

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 (342) hide show
  1. package/README.md +248 -3
  2. package/_internal/app/components/agent-avatar.d.ts +2 -1
  3. package/_internal/app/components/conversation/attention.d.ts +56 -0
  4. package/_internal/app/components/conversation/fold.d.ts +3 -0
  5. package/_internal/app/components/conversation/notification-sound.d.ts +8 -0
  6. package/_internal/app/components/conversation/reply-toast.d.ts +15 -0
  7. package/_internal/app/components/conversation/thread-id.d.ts +8 -0
  8. package/_internal/app/components/conversation/turn-recorder.d.ts +37 -0
  9. package/_internal/app/components/conversation/use-conversation-attention.d.ts +61 -0
  10. package/_internal/app/components/drawer.d.ts +27 -0
  11. package/_internal/app/components/ui/button.d.ts +2 -8
  12. package/_internal/app/components/ui/dialog.d.ts +2 -17
  13. package/_internal/app/components/ui/sheet.d.ts +2 -14
  14. package/_internal/app/core/conversation-turns.d.ts +229 -0
  15. package/_internal/app/core/logger.d.ts +1 -0
  16. package/_internal/app/core/tool-access.d.ts +42 -0
  17. package/_internal/app/hooks/use-available-models.d.ts +25 -0
  18. package/_internal/app/hooks/use-content-store.d.ts +0 -9
  19. package/_internal/app/hooks/use-history-back.d.ts +5 -0
  20. package/_internal/app/hooks/use-horizontal-resize.d.ts +21 -0
  21. package/_internal/app/hooks/use-json-fetch.d.ts +36 -0
  22. package/_internal/app/hooks/use-nav-badge.d.ts +13 -0
  23. package/_internal/app/hooks/use-plugin-event.d.ts +19 -0
  24. package/_internal/app/hooks/use-query-state.d.ts +3 -12
  25. package/_internal/app/hooks/use-resizable-pane.d.ts +35 -0
  26. package/_internal/app/hooks/use-runtime-status.d.ts +22 -6
  27. package/_internal/app/hooks/use-schedule.d.ts +47 -1
  28. package/_internal/app/hooks/use-search.d.ts +27 -8
  29. package/_internal/app/hooks/use-task-run-history.d.ts +26 -0
  30. package/_internal/app/hooks/use-toast.d.ts +13 -3
  31. package/_internal/app/lib/browser-notify.d.ts +12 -1
  32. package/_internal/app/types/index.d.ts +1 -105
  33. package/_internal/core/adapters/runtime/channels.d.ts +231 -0
  34. package/_internal/core/adapters/runtime/concepts.d.ts +794 -235
  35. package/_internal/core/adapters/runtime/errors.d.ts +105 -0
  36. package/_internal/core/adapters/runtime/helpers.d.ts +19 -0
  37. package/_internal/core/adapters/runtime/index.d.ts +8 -2
  38. package/_internal/core/adapters/runtime/skill-files.d.ts +12 -0
  39. package/_internal/core/adapters/runtime/testing.d.ts +99 -0
  40. package/_internal/core/adapters/runtime/turn-activity.d.ts +23 -0
  41. package/_internal/core/adapters/shared.d.ts +133 -12
  42. package/_internal/core/content-dir.d.ts +11 -0
  43. package/_internal/core/delivery/bridge.d.ts +36 -0
  44. package/_internal/core/docs/route.d.ts +1 -1
  45. package/_internal/core/format/structured.d.ts +44 -0
  46. package/_internal/core/format.d.ts +25 -1
  47. package/_internal/core/health/observation-builders.d.ts +42 -0
  48. package/_internal/core/media/downscale.d.ts +18 -0
  49. package/_internal/core/media/pin-data.d.ts +36 -0
  50. package/_internal/core/media/pin.d.ts +22 -0
  51. package/_internal/core/media/sharp-import.d.ts +10 -0
  52. package/_internal/core/media/sharp-loader.d.ts +41 -0
  53. package/_internal/core/media/store.d.ts +21 -0
  54. package/_internal/core/plugin-types.d.ts +248 -500
  55. package/_internal/core/routing/define.d.ts +33 -3
  56. package/_internal/core/routing/dispatcher.d.ts +15 -6
  57. package/_internal/core/routing/index.d.ts +1 -1
  58. package/_internal/core/routing/types.d.ts +13 -70
  59. package/_internal/core/storage/atomic-write.d.ts +11 -0
  60. package/_internal/core/tasks/store.d.ts +129 -0
  61. package/_internal/core/tasks/testing.d.ts +2 -0
  62. package/_internal/{plugins/workflows/lib → core/workflows}/notification-channel-registry.d.ts +1 -1
  63. package/_internal/host/ui/action-status.d.ts +13 -0
  64. package/_internal/host/ui/modals.d.ts +5 -0
  65. package/_internal/host/ui/resize.d.ts +2 -0
  66. package/_internal/plugins/team/types.d.ts +61 -4
  67. package/_internal/plugins/workflows/hooks/use-notification-channels.d.ts +1 -1
  68. package/_internal/ui/behaviors/clipboard.d.ts +10 -0
  69. package/_internal/ui/behaviors/resize-handle.d.ts +15 -0
  70. package/_internal/ui/behaviors/selection-navigation.d.ts +5 -0
  71. package/_internal/ui/behaviors/use-persisted-leading-edge-resize.d.ts +31 -0
  72. package/_internal/ui/charts/area-chart.d.ts +27 -0
  73. package/_internal/ui/charts/axis.d.ts +13 -0
  74. package/_internal/ui/charts/bar-chart.d.ts +21 -0
  75. package/_internal/ui/charts/chart-data-table.d.ts +61 -0
  76. package/_internal/ui/charts/chart-explainer.d.ts +4 -0
  77. package/_internal/ui/charts/chart-tooltip.d.ts +8 -0
  78. package/_internal/ui/charts/composition-bar.d.ts +46 -0
  79. package/_internal/ui/charts/index.d.ts +24 -0
  80. package/_internal/ui/charts/line-chart.d.ts +26 -0
  81. package/_internal/ui/charts/monotone-curve.d.ts +23 -0
  82. package/_internal/ui/charts/palette.d.ts +32 -0
  83. package/_internal/ui/charts/pie-chart.d.ts +80 -0
  84. package/_internal/ui/charts/ranked-bar-chart.d.ts +41 -0
  85. package/_internal/ui/charts/sparkline.d.ts +16 -0
  86. package/_internal/ui/charts/stacked-column-chart.d.ts +33 -0
  87. package/_internal/ui/content/code-block.d.ts +43 -0
  88. package/_internal/ui/content/index.d.ts +2 -0
  89. package/_internal/ui/conversation/activity-group.d.ts +27 -0
  90. package/_internal/ui/conversation/agent-turn.d.ts +47 -0
  91. package/_internal/ui/conversation/composer.d.ts +62 -0
  92. package/_internal/ui/conversation/context-meter.d.ts +37 -0
  93. package/_internal/ui/conversation/conversation-empty-state.d.ts +13 -0
  94. package/_internal/ui/conversation/conversation-header.d.ts +26 -0
  95. package/_internal/ui/conversation/conversation-panel.d.ts +61 -0
  96. package/_internal/ui/conversation/conversation.d.ts +37 -0
  97. package/_internal/ui/conversation/fold.d.ts +150 -0
  98. package/_internal/ui/conversation/glyphs.d.ts +30 -0
  99. package/_internal/ui/conversation/index.d.ts +31 -0
  100. package/_internal/ui/conversation/queued-message-list.d.ts +22 -0
  101. package/_internal/ui/conversation/relative-time.d.ts +8 -0
  102. package/_internal/ui/conversation/tool-call-drawer.d.ts +14 -0
  103. package/_internal/ui/conversation/turn-controls.d.ts +9 -0
  104. package/_internal/ui/conversation/turn-output.d.ts +42 -0
  105. package/_internal/ui/conversation/turn-usage.d.ts +16 -0
  106. package/_internal/ui/conversation/user-message.d.ts +13 -0
  107. package/_internal/ui/forms/field.d.ts +30 -0
  108. package/_internal/ui/forms/fieldset.d.ts +10 -0
  109. package/_internal/ui/forms/form.d.ts +19 -0
  110. package/_internal/ui/forms/index.d.ts +6 -0
  111. package/_internal/ui/index.d.ts +89 -0
  112. package/_internal/ui/layout/bounded-overflow.d.ts +42 -0
  113. package/_internal/ui/layout/disclosure-panel.d.ts +24 -0
  114. package/_internal/ui/layout/flow.d.ts +27 -0
  115. package/_internal/ui/layout/grid.d.ts +16 -0
  116. package/_internal/ui/layout/index.d.ts +14 -0
  117. package/_internal/ui/layout/page-shell.d.ts +11 -0
  118. package/_internal/ui/layout/panel.d.ts +28 -0
  119. package/_internal/ui/layout/section.d.ts +15 -0
  120. package/_internal/ui/layout/sticky-overflow-scrollbar.d.ts +11 -0
  121. package/_internal/ui/layout/utils.d.ts +1 -0
  122. package/_internal/ui/patterns/agent-filter.d.ts +21 -0
  123. package/_internal/ui/patterns/calendar-grid.d.ts +80 -0
  124. package/_internal/ui/patterns/calendar-item.d.ts +42 -0
  125. package/_internal/ui/patterns/calendar-nav.d.ts +21 -0
  126. package/_internal/ui/patterns/confirm-dialog.d.ts +29 -0
  127. package/_internal/ui/patterns/copy-button.d.ts +15 -0
  128. package/_internal/ui/patterns/danger-zone.d.ts +17 -0
  129. package/_internal/ui/patterns/data-table.d.ts +157 -0
  130. package/_internal/ui/patterns/drawer-section.d.ts +11 -0
  131. package/_internal/ui/patterns/facet-filter.d.ts +22 -0
  132. package/_internal/ui/patterns/filter-indicator.d.ts +3 -0
  133. package/_internal/ui/patterns/guide-card.d.ts +33 -0
  134. package/_internal/ui/patterns/index.d.ts +75 -0
  135. package/_internal/ui/patterns/inspector-panel.d.ts +39 -0
  136. package/_internal/ui/patterns/kanban.d.ts +70 -0
  137. package/_internal/ui/patterns/key-value.d.ts +35 -0
  138. package/_internal/ui/patterns/list-rows.d.ts +111 -0
  139. package/_internal/ui/patterns/nav-list.d.ts +41 -0
  140. package/_internal/ui/patterns/node-card.d.ts +37 -0
  141. package/_internal/ui/patterns/page-aside.d.ts +49 -0
  142. package/_internal/ui/patterns/page-body.d.ts +49 -0
  143. package/_internal/ui/patterns/page-canvas.d.ts +12 -0
  144. package/_internal/ui/patterns/page-composer.d.ts +8 -0
  145. package/_internal/ui/patterns/page-controls.d.ts +33 -0
  146. package/_internal/ui/patterns/page-header.d.ts +40 -0
  147. package/_internal/ui/patterns/page-timeline.d.ts +18 -0
  148. package/_internal/ui/patterns/page.d.ts +32 -0
  149. package/_internal/ui/patterns/pagination.d.ts +23 -0
  150. package/_internal/ui/patterns/save-bar.d.ts +21 -0
  151. package/_internal/ui/patterns/search-input.d.ts +20 -0
  152. package/_internal/ui/patterns/segmented-control.d.ts +22 -0
  153. package/_internal/ui/patterns/sortable-head.d.ts +13 -0
  154. package/_internal/ui/patterns/stat-group.d.ts +8 -0
  155. package/_internal/ui/patterns/stat-tile.d.ts +25 -0
  156. package/_internal/ui/patterns/status-badge.d.ts +15 -0
  157. package/_internal/ui/patterns/status-marker.d.ts +10 -0
  158. package/_internal/ui/patterns/timeline.d.ts +59 -0
  159. package/_internal/ui/patterns/unsaved-changes-dialog.d.ts +22 -0
  160. package/_internal/ui/patterns/workspace-page.d.ts +76 -0
  161. package/_internal/ui/primitives/alert.d.ts +17 -0
  162. package/_internal/ui/primitives/avatar.d.ts +13 -0
  163. package/_internal/ui/primitives/badge.d.ts +27 -0
  164. package/_internal/ui/primitives/button.d.ts +32 -0
  165. package/_internal/ui/primitives/card.d.ts +55 -0
  166. package/_internal/ui/primitives/checkbox.d.ts +3 -0
  167. package/_internal/ui/primitives/collapsible.d.ts +7 -0
  168. package/_internal/ui/primitives/color-input.d.ts +21 -0
  169. package/_internal/ui/primitives/combobox.d.ts +40 -0
  170. package/_internal/ui/primitives/command.d.ts +36 -0
  171. package/_internal/ui/primitives/control-styles.d.ts +10 -0
  172. package/_internal/ui/primitives/dialog.d.ts +31 -0
  173. package/_internal/ui/primitives/dropdown-menu.d.ts +54 -0
  174. package/_internal/ui/primitives/file-input.d.ts +33 -0
  175. package/_internal/ui/primitives/input-group.d.ts +30 -0
  176. package/_internal/ui/primitives/input.d.ts +10 -0
  177. package/_internal/ui/primitives/interactive-surface.d.ts +24 -0
  178. package/_internal/ui/primitives/label.d.ts +3 -0
  179. package/_internal/ui/primitives/modal-context.d.ts +9 -0
  180. package/_internal/ui/primitives/option-list.d.ts +10 -0
  181. package/_internal/ui/primitives/popover.d.ts +18 -0
  182. package/_internal/ui/primitives/portal-ownership.d.ts +11 -0
  183. package/_internal/ui/primitives/progress.d.ts +38 -0
  184. package/_internal/ui/primitives/radio-group.d.ts +12 -0
  185. package/_internal/ui/primitives/select.d.ts +35 -0
  186. package/_internal/ui/primitives/separator.d.ts +7 -0
  187. package/_internal/ui/primitives/sheet.d.ts +34 -0
  188. package/_internal/ui/primitives/shimmer-text.d.ts +13 -0
  189. package/_internal/ui/primitives/skeleton.d.ts +6 -0
  190. package/_internal/ui/primitives/spinner.d.ts +31 -0
  191. package/_internal/ui/primitives/switch.d.ts +6 -0
  192. package/_internal/{app/components/ui → ui/primitives}/tabs.d.ts +1 -1
  193. package/_internal/ui/primitives/text.d.ts +43 -0
  194. package/_internal/ui/primitives/textarea.d.ts +19 -0
  195. package/_internal/ui/primitives/tooltip.d.ts +14 -0
  196. package/_internal/ui/primitives/use-textarea-autosize.d.ts +3 -0
  197. package/_internal/ui/private-ui-boundary-probe.d.ts +9 -0
  198. package/_internal/ui/states/banner.d.ts +15 -0
  199. package/_internal/ui/states/index.d.ts +6 -0
  200. package/_internal/ui/states/system-state.d.ts +88 -0
  201. package/_internal/ui/states/toast.d.ts +26 -0
  202. package/_internal/ui/utils.d.ts +14 -0
  203. package/bin/bakin-plugin-test-ui.js +6854 -0
  204. package/charts/index.d.ts +3 -0
  205. package/charts/index.js +2 -0
  206. package/content/index.d.ts +14 -0
  207. package/content/index.js +38 -0
  208. package/content/markdown-comparison.d.ts +12 -0
  209. package/content/markdown-content.d.ts +18 -0
  210. package/content/markdown-document.d.ts +4 -0
  211. package/content/markdown-editor.d.ts +35 -0
  212. package/conversation/index.d.ts +50 -0
  213. package/conversation/index.js +4 -0
  214. package/conversation/use-conversation-thread.d.ts +73 -0
  215. package/hooks/index.d.ts +86 -11
  216. package/hooks/index.js +1 -1747
  217. package/hooks/router.d.ts +4 -36
  218. package/index.d.ts +30 -6
  219. package/index.js +10 -14210
  220. package/internal/index.d.ts +74 -0
  221. package/internal/index.js +2 -0
  222. package/internal/lazy.d.ts +58 -0
  223. package/internal/plugin-ownership.d.ts +18 -0
  224. package/internal/private-ui-boundary-probe.d.ts +2 -0
  225. package/layout/index.d.ts +9 -0
  226. package/layout/index.js +2 -0
  227. package/metadata/index.d.ts +14 -1
  228. package/metadata/index.js +1 -30
  229. package/navigation/history-back.d.ts +5 -0
  230. package/navigation/index.d.ts +23 -0
  231. package/navigation/index.js +2 -0
  232. package/navigation/plugin-link.d.ts +11 -0
  233. package/navigation/query-state.d.ts +7 -0
  234. package/navigation/router.d.ts +35 -0
  235. package/navigation/search-params.d.ts +7 -0
  236. package/navigation/unsaved-changes-guard.d.ts +35 -0
  237. package/package.json +63 -10
  238. package/patterns/agent-patterns.d.ts +81 -0
  239. package/patterns/asset-library-picker.d.ts +38 -0
  240. package/patterns/channel-patterns.d.ts +32 -0
  241. package/patterns/index.d.ts +40 -0
  242. package/patterns/index.js +47 -0
  243. package/patterns/picker-patterns.d.ts +108 -0
  244. package/patterns/plugin-settings-renderer.d.ts +41 -0
  245. package/patterns/presentation-color.d.ts +2 -0
  246. package/patterns/search-patterns.d.ts +51 -0
  247. package/register.d.ts +63 -9
  248. package/routing/index.d.ts +6 -1
  249. package/routing/index.js +10 -14014
  250. package/slots/index.d.ts +12 -24
  251. package/slots/index.js +1 -91
  252. package/slots/registry.d.ts +45 -0
  253. package/styles.css +2 -0
  254. package/testing/index.d.ts +122 -0
  255. package/testing/index.js +93 -0
  256. package/testing/ui/conformance/cli.d.ts +2 -0
  257. package/testing/ui/conformance/contracts.d.ts +73 -0
  258. package/testing/ui/conformance/index.d.ts +11 -0
  259. package/testing/ui/conformance/index.js +85 -0
  260. package/testing/ui/conformance/plugin-css.d.ts +37 -0
  261. package/testing/ui/conformance/plugin-id.d.ts +6 -0
  262. package/testing/ui/conformance/runner.d.ts +13 -0
  263. package/testing/ui/index.d.ts +24 -0
  264. package/testing/ui/index.js +2 -0
  265. package/testing/ui/plugin-ui-fixture-host.d.ts +36 -0
  266. package/testing/ui/runtime.d.ts +70 -0
  267. package/types/api-route.d.ts +89 -0
  268. package/types/context.d.ts +166 -0
  269. package/types/conversation-turns.d.ts +229 -0
  270. package/types/events.d.ts +10 -0
  271. package/types/health.d.ts +376 -0
  272. package/types/index.d.ts +19 -919
  273. package/types/index.js +1 -0
  274. package/types/manifest.d.ts +255 -0
  275. package/types/primitives.d.ts +33 -0
  276. package/types/registration.d.ts +281 -0
  277. package/types/runtime.d.ts +292 -0
  278. package/types/scheduled-events.d.ts +80 -0
  279. package/types/services.d.ts +599 -0
  280. package/ui/index.d.ts +73 -31
  281. package/ui/index.js +38 -28704
  282. package/utils/asset-id.d.ts +15 -0
  283. package/utils/index.d.ts +27 -7
  284. package/utils/index.js +4 -2098
  285. package/utils/plugin-fetch.d.ts +44 -0
  286. package/_internal/app/components/agent-filter.d.ts +0 -8
  287. package/_internal/app/components/agent-select.d.ts +0 -15
  288. package/_internal/app/components/agent-status.d.ts +0 -8
  289. package/_internal/app/components/bakin-drawer.d.ts +0 -23
  290. package/_internal/app/components/color-picker.d.ts +0 -7
  291. package/_internal/app/components/empty-state.d.ts +0 -10
  292. package/_internal/app/components/error-banner.d.ts +0 -6
  293. package/_internal/app/components/error-state.d.ts +0 -8
  294. package/_internal/app/components/facet-filter.d.ts +0 -17
  295. package/_internal/app/components/integrated-brainstorm/activity.d.ts +0 -23
  296. package/_internal/app/components/integrated-brainstorm/collapsed-header.d.ts +0 -14
  297. package/_internal/app/components/integrated-brainstorm/empty-state.d.ts +0 -5
  298. package/_internal/app/components/integrated-brainstorm/index.d.ts +0 -8
  299. package/_internal/app/components/integrated-brainstorm/input-row.d.ts +0 -16
  300. package/_internal/app/components/integrated-brainstorm/message-list.d.ts +0 -8
  301. package/_internal/app/components/integrated-brainstorm/session.d.ts +0 -16
  302. package/_internal/app/components/integrated-brainstorm/sse.d.ts +0 -8
  303. package/_internal/app/components/integrated-brainstorm/thinking-indicator.d.ts +0 -19
  304. package/_internal/app/components/integrated-brainstorm/types.d.ts +0 -63
  305. package/_internal/app/components/integrated-brainstorm/use-auto-grow.d.ts +0 -6
  306. package/_internal/app/components/integrated-brainstorm/use-brainstorm-state.d.ts +0 -21
  307. package/_internal/app/components/markdown-content.d.ts +0 -3
  308. package/_internal/app/components/markdown-editor.d.ts +0 -11
  309. package/_internal/app/components/model-select.d.ts +0 -9
  310. package/_internal/app/components/page-layout.d.ts +0 -9
  311. package/_internal/app/components/plugin-header.d.ts +0 -16
  312. package/_internal/app/components/plugin-settings-renderer.d.ts +0 -9
  313. package/_internal/app/components/sortable-head.d.ts +0 -13
  314. package/_internal/app/components/ui/alert.d.ts +0 -10
  315. package/_internal/app/components/ui/avatar.d.ts +0 -11
  316. package/_internal/app/components/ui/badge.d.ts +0 -7
  317. package/_internal/app/components/ui/card.d.ts +0 -11
  318. package/_internal/app/components/ui/checkbox.d.ts +0 -3
  319. package/_internal/app/components/ui/collapsible.d.ts +0 -5
  320. package/_internal/app/components/ui/command.d.ts +0 -19
  321. package/_internal/app/components/ui/dropdown-menu.d.ts +0 -29
  322. package/_internal/app/components/ui/form.d.ts +0 -23
  323. package/_internal/app/components/ui/input-group.d.ts +0 -18
  324. package/_internal/app/components/ui/input.d.ts +0 -3
  325. package/_internal/app/components/ui/label.d.ts +0 -3
  326. package/_internal/app/components/ui/popover.d.ts +0 -9
  327. package/_internal/app/components/ui/progress.d.ts +0 -7
  328. package/_internal/app/components/ui/select.d.ts +0 -15
  329. package/_internal/app/components/ui/separator.d.ts +0 -3
  330. package/_internal/app/components/ui/skeleton.d.ts +0 -2
  331. package/_internal/app/components/ui/switch.d.ts +0 -5
  332. package/_internal/app/components/ui/textarea.d.ts +0 -3
  333. package/_internal/app/components/ui/tooltip.d.ts +0 -6
  334. package/_internal/app/components/underline-tabs.d.ts +0 -15
  335. package/_internal/app/hooks/use-assets.d.ts +0 -25
  336. package/_internal/app/hooks/use-form-guard.d.ts +0 -5
  337. package/_internal/app/hooks/use-vertical-resize.d.ts +0 -22
  338. package/_internal/app/lib/utils.d.ts +0 -2
  339. package/_internal/plugins/workflows/hooks/channel-icon.d.ts +0 -6
  340. package/components/index.d.ts +0 -34
  341. package/components/index.js +0 -40175
  342. /package/_internal/{app/components/ui → ui/primitives}/table.d.ts +0 -0
@@ -4,7 +4,7 @@ export interface SearchResult {
4
4
  score: number;
5
5
  fields: Record<string, unknown>;
6
6
  _table?: string;
7
- /** Per-index score breakdown (e.g. { search: 0.8, embeddings: 0.6 }) */
7
+ /** Per-leg score breakdown keyed by neutral leg names (e.g. { full_text: 0.8, assets_visual: -0.2 }) */
8
8
  indexScores?: Record<string, number>;
9
9
  }
10
10
  export interface SearchResponse {
@@ -17,25 +17,39 @@ export interface SearchResponse {
17
17
  query: string;
18
18
  total: number;
19
19
  took_ms: number;
20
- source: 'search' | 'fallback';
20
+ source: 'search' | 'unavailable';
21
+ /** True when any source degraded/was omitted under the query budget. */
22
+ partial?: boolean;
23
+ tables?: Array<{
24
+ table: string;
25
+ hits: number;
26
+ took_ms: number;
27
+ budget?: 'degraded' | 'omitted';
28
+ }>;
21
29
  };
22
30
  }
31
+ /**
32
+ * Honest search lifecycle (spec D11). `unavailable` is the explicit
33
+ * engine-down signal (HTTP 503 `search_unavailable`) — render
34
+ * `<SearchUnavailable/>`, never a silent lower-quality substitute.
35
+ */
36
+ export type SearchStatus = 'idle' | 'loading' | 'ok' | 'unavailable' | 'error';
23
37
  export interface UseSearchOptions {
24
38
  /**
25
39
  * Plugin id to route the query to. When set, the hook fetches
26
40
  * `/api/plugins/{plugin}/search?q=...` — the plugin owns its table
27
41
  * name and the client never sees the raw `bakin_` prefix. Omit for
28
- * cross-plugin search, which falls back to `/api/search?q=...`.
42
+ * cross-plugin search via `/api/search?q=...`.
29
43
  */
30
44
  plugin?: string;
31
45
  /** Max results */
32
46
  limit?: number;
33
47
  /** Facet fields to include aggregation counts for */
34
48
  facets?: string[];
49
+ /** Restrict cross-plugin search to these content types (tables). */
50
+ types?: string[];
35
51
  /** Debounce delay in ms (default: 250) */
36
52
  debounce?: number;
37
- /** Fallback filter function when search returns no results or errors */
38
- fallback?: (query: string) => SearchResult[];
39
53
  }
40
54
  export interface UseSearchReturn {
41
55
  results: SearchResult[];
@@ -43,11 +57,15 @@ export interface UseSearchReturn {
43
57
  value: string;
44
58
  count: number;
45
59
  }>>;
60
+ status: SearchStatus;
61
+ /** True while a request is in flight or debounce-pending (=== status 'loading'). */
46
62
  loading: boolean;
47
63
  error: string | null;
48
64
  meta: SearchResponse['meta'] | null;
49
65
  search: (query: string) => void;
50
66
  clear: () => void;
67
+ /** Re-run the last query immediately (Retry in the unavailable state). */
68
+ retry: () => void;
51
69
  }
52
70
  /**
53
71
  * Given a client-side filtered list and search results, reorder the list
@@ -58,8 +76,9 @@ export declare function reorderBySearchResults<T extends {
58
76
  id: string;
59
77
  }>(items: T[], searchResults: SearchResult[]): T[];
60
78
  /**
61
- * React hook for Bakin search with debouncing, AbortController, and an
62
- * optional client-side fallback. Scopes to a plugin via `plugin:` or
63
- * runs cross-plugin when omitted.
79
+ * React hook for Bakin search with debouncing and AbortController.
80
+ * Scopes to a plugin via `plugin:` or runs cross-plugin when omitted.
81
+ * There is deliberately NO client-side fallback: engine-down is an
82
+ * explicit `unavailable` status the UI must surface (spec D11).
64
83
  */
65
84
  export declare function useSearch(options?: UseSearchOptions): UseSearchReturn;
@@ -0,0 +1,26 @@
1
+ /** Task-level terminal outcome (mirrors plugins/tasks TaskOutcome). */
2
+ export interface TaskOutcome {
3
+ state: 'done' | 'blocked' | 'archived' | 'in_progress';
4
+ /** Set when state === 'done' and a completion row exists. */
5
+ completedAt?: string;
6
+ /** Agent that recorded the completion, when known. */
7
+ agent?: string;
8
+ }
9
+ /** One dispatch attempt for a task (mirrors plugins/tasks TaskRunEntry). */
10
+ export interface TaskRunEntry {
11
+ runId: string;
12
+ taskId: string;
13
+ seq: number;
14
+ agent: string;
15
+ status: 'running' | 'settled' | 'superseded' | 'lost';
16
+ startedAt: string;
17
+ settledAt?: string;
18
+ settleReason?: string;
19
+ durationMs?: number;
20
+ }
21
+ /** Fetch a task's dispatch run history (newest-first) + task outcome from the execution ledger. */
22
+ export declare function useTaskRunHistory(taskId: string | null, limit?: number): {
23
+ runs: TaskRunEntry[];
24
+ outcome: TaskOutcome | undefined;
25
+ loading: boolean;
26
+ };
@@ -4,13 +4,23 @@ export interface Toast {
4
4
  message: ReactNode;
5
5
  type: 'success' | 'error' | 'info';
6
6
  duration?: number;
7
+ /** Optional heading above the message (the kit Toast's title slot). */
8
+ title?: ReactNode;
9
+ /** Optional action row (the kit Toast's action slot). */
10
+ action?: ReactNode;
11
+ /**
12
+ * Stays until dismissed — no timer. For attention the operator must act
13
+ * on (the spend ladder's 90% and cap toasts); a caller that needs to know
14
+ * WHEN it was closed subscribes to the store and watches its id go.
15
+ */
16
+ persistent?: boolean;
7
17
  }
8
18
  interface ToastStore {
9
19
  toasts: Toast[];
10
- add: (toast: Omit<Toast, 'id'>) => void;
20
+ add: (toast: Omit<Toast, 'id'>) => string;
11
21
  dismiss: (id: string) => void;
12
22
  }
13
23
  export declare const useToastStore: import("zustand").UseBoundStore<import("zustand").StoreApi<ToastStore>>;
14
- /** Convenience: call from anywhere without hooks */
15
- export declare function toast(message: ReactNode, type?: Toast['type'], duration?: number): void;
24
+ /** Convenience: call from anywhere without hooks. Returns the toast id for programmatic dismiss. */
25
+ export declare function toast(message: ReactNode, type?: Toast['type'], duration?: number): string;
16
26
  export {};
@@ -1,5 +1,16 @@
1
+ /**
2
+ * Navigate bridge — the host registers its router here at boot so
3
+ * notification clicks route client-side instead of full-reloading the shell.
4
+ * globalThis-based (like __bakinBroadcast) because every plugin bundle
5
+ * inlines its own copy of this module; a module-level variable would never
6
+ * reach those copies.
7
+ */
8
+ type NavigateFn = (url: string) => void;
9
+ export declare function setNotificationNavigator(navigate: NavigateFn): void;
10
+ export declare function navigateToUrl(url: string): void;
1
11
  export declare function isNotificationsSupported(): boolean;
2
12
  export declare function isNotificationsEnabled(): boolean;
3
13
  export declare function requestNotificationPermission(): Promise<boolean>;
4
14
  export declare function toggleNotifications(enabled: boolean): void;
5
- export declare function sendBrowserNotification(title: string, body: string): void;
15
+ export declare function sendBrowserNotification(title: string, body: string, url?: string): void;
16
+ export {};
@@ -1,113 +1,8 @@
1
- export interface TaskLogEntry {
2
- timestamp: string;
3
- author: string;
4
- message: string;
5
- }
6
- export interface Task {
7
- id: string;
8
- title: string;
9
- agent?: string;
10
- checked: boolean;
11
- date?: string;
12
- blockedReason?: string;
13
- description?: string;
14
- log?: TaskLogEntry[];
15
- }
16
- export interface TaskColumns {
17
- inProgress: Task[];
18
- todo: Task[];
19
- done: Task[];
20
- blocked: Task[];
21
- }
22
- export interface TaskBoard {
23
- columns: TaskColumns;
24
- timestamp?: string;
25
- }
26
- export type ColumnId = keyof TaskColumns;
27
- export interface CalendarEvent {
28
- time?: string;
29
- text: string;
30
- }
31
- export interface CalendarDay {
32
- date: string;
33
- label?: string;
34
- events: CalendarEvent[];
35
- }
36
- export interface RecurringEvent {
37
- schedule: string;
38
- text: string;
39
- }
40
- export interface MemoryEntry {
41
- type: 'decision' | 'learned' | 'note';
42
- text: string;
43
- }
44
- export interface MemoryDay {
45
- date: string;
46
- entries: MemoryEntry[];
47
- }
48
1
  export interface Heartbeat {
49
2
  status: 'working' | 'idle' | 'down';
50
3
  currentTask?: string;
51
4
  timestamp: string;
52
5
  }
53
- export interface ProjectMeta {
54
- filename: string;
55
- title: string;
56
- status?: string;
57
- content: string;
58
- }
59
- export interface AssetVariantMeta {
60
- role: 'thumbnail' | 'optimized' | 'webp';
61
- path: string;
62
- filename: string;
63
- size: number;
64
- mimeType: string;
65
- }
66
- export interface AssetMeta {
67
- path: string;
68
- filename: string;
69
- type: 'text' | 'images' | 'video' | 'audio' | 'plans' | 'research' | 'pdf' | 'data' | 'other';
70
- mimeType: string;
71
- size: number;
72
- mtimeMs?: number;
73
- metadata: {
74
- agent: string;
75
- taskId: string | null;
76
- created: string;
77
- tool?: string;
78
- description?: string;
79
- tags?: string[];
80
- originalFilename?: string;
81
- };
82
- variants?: AssetVariantMeta[];
83
- }
84
- export interface TrashedAssetMeta {
85
- filename: string;
86
- originalFilename: string;
87
- type: string;
88
- mimeType: string;
89
- size: number;
90
- deletedAt: string;
91
- expiresAt: string;
92
- metadata: {
93
- agent: string;
94
- taskId: string | null;
95
- created: string;
96
- tool?: string;
97
- description?: string;
98
- tags?: string[];
99
- } | null;
100
- }
101
- export interface OfficeData {
102
- asciiMap: string;
103
- statusTable: {
104
- agent: string;
105
- status: string;
106
- task: string;
107
- heartbeat: string;
108
- }[];
109
- history: string[];
110
- }
111
6
  export interface ActivityEvent {
112
7
  id: string;
113
8
  ts: string;
@@ -118,6 +13,7 @@ export interface ActivityEvent {
118
13
  taskTitle?: string;
119
14
  eventName?: string;
120
15
  duplicate?: boolean;
16
+ data?: Record<string, unknown>;
121
17
  }
122
18
  export interface ContentState {
123
19
  files: Record<string, string>;
@@ -0,0 +1,231 @@
1
+ /**
2
+ * Channel/delivery contract types — a LEAF module (imports only
3
+ * ./capabilities) so both the runtime contract (concepts.ts) and the
4
+ * delivery-bridge seam (packages/core/src/delivery/bridge.ts, threaded
5
+ * through AdapterInitOpts in ../shared.ts) can share the surface without an
6
+ * import cycle: shared -> bridge -> channels and concepts -> channels.
7
+ */
8
+ import type { ChannelCapability } from './capabilities';
9
+ export type RuntimeMetadata = Record<string, unknown>;
10
+ export interface ChannelInfo {
11
+ id: string;
12
+ platform: string;
13
+ label: string;
14
+ capabilities: ChannelCapability[];
15
+ metadata?: RuntimeMetadata;
16
+ }
17
+ export interface DeliveryResult {
18
+ deliveries: ApprovalDelivery[];
19
+ }
20
+ export interface NotificationArgs {
21
+ channels: string[];
22
+ notification: {
23
+ severity: 'info' | 'warn' | 'error' | 'success';
24
+ title: string;
25
+ body: string;
26
+ fields?: {
27
+ label: string;
28
+ value: string;
29
+ }[];
30
+ metadata?: RuntimeMetadata;
31
+ };
32
+ }
33
+ export interface ChannelMessageArgs {
34
+ channels: string[];
35
+ message: {
36
+ body: string;
37
+ title?: string;
38
+ threadId?: string;
39
+ metadata?: RuntimeMetadata;
40
+ };
41
+ }
42
+ export interface ContentDeliveryArgs {
43
+ channels: string[];
44
+ content: {
45
+ title: string;
46
+ body?: string;
47
+ url?: string;
48
+ /**
49
+ * Path files are read from disk (trusted plugin/core callers only). For
50
+ * `{ kind: 'asset' }` refs, `filename` is the ASSET ID — providers
51
+ * resolve it through the `assets.resolveServe` hook; an unresolvable id
52
+ * degrades to a visible omission, never a failed delivery.
53
+ */
54
+ files?: Array<{
55
+ name: string;
56
+ path: string;
57
+ contentType?: string;
58
+ } | {
59
+ kind: 'asset';
60
+ filename: string;
61
+ mimeType?: string;
62
+ }>;
63
+ metadata?: RuntimeMetadata;
64
+ };
65
+ }
66
+ export interface CreateThreadArgs {
67
+ /** Channel ref the anchor message lives in (provider or provider:target). */
68
+ channel: string;
69
+ /** Delivery ref of the message to anchor the thread to (e.g. "message:<id>"). */
70
+ messageRef?: string;
71
+ name: string;
72
+ }
73
+ export interface CreatedThread {
74
+ threadId: string;
75
+ /**
76
+ * Provider-addressable channel ref for posting INTO the thread (opaque to
77
+ * callers — provider target syntax stays inside the adapter).
78
+ */
79
+ channelRef: string;
80
+ }
81
+ export interface EditChannelMessageArgs {
82
+ /** Channel ref the message lives in (provider or provider:target). */
83
+ channel: string;
84
+ /** Delivery ref of the message to edit (e.g. "message:<id>"). */
85
+ messageRef: string;
86
+ body: string;
87
+ }
88
+ export interface ApprovalOption {
89
+ id: string;
90
+ label: string;
91
+ variant?: 'primary' | 'destructive' | 'neutral';
92
+ }
93
+ export interface ApprovalDelivery {
94
+ channelId: string;
95
+ ref: string;
96
+ renderedAt: string;
97
+ }
98
+ export interface ApprovalPatch {
99
+ body?: string;
100
+ options?: ApprovalOption[];
101
+ expiresAt?: string;
102
+ context?: RuntimeMetadata;
103
+ }
104
+ export interface ApprovalResponse {
105
+ selectedOption: string;
106
+ respondedAt: string;
107
+ actor: {
108
+ type: 'agent' | 'human';
109
+ id: string;
110
+ displayName?: string;
111
+ };
112
+ comment?: string;
113
+ }
114
+ export interface ApprovalRenderResult {
115
+ deliveries: ApprovalDelivery[];
116
+ }
117
+ export interface ApprovalRenderRef {
118
+ approvalId: string;
119
+ deliveries: ApprovalDelivery[];
120
+ }
121
+ export interface CreateApprovalArgs {
122
+ approvalId: string;
123
+ channels: string[];
124
+ request: {
125
+ title: string;
126
+ body: string;
127
+ options: ApprovalOption[];
128
+ expiresAt?: string;
129
+ context?: RuntimeMetadata;
130
+ };
131
+ }
132
+ export interface EditApprovalArgs extends ApprovalRenderRef {
133
+ patch: ApprovalPatch;
134
+ }
135
+ export interface CancelApprovalArgs extends ApprovalRenderRef {
136
+ reason?: string;
137
+ }
138
+ export interface ResolveApprovalArgs extends ApprovalRenderRef {
139
+ response: ApprovalResponse;
140
+ }
141
+ export interface ApprovalResolveEvent {
142
+ approvalId: string;
143
+ response: ApprovalResponse;
144
+ channelId: string;
145
+ }
146
+ export interface DurableApprovalRecord {
147
+ approvalId: string;
148
+ owner: {
149
+ workflowId: string;
150
+ runId: string;
151
+ stepId: string;
152
+ taskId?: string;
153
+ };
154
+ status: 'pending' | 'approved' | 'rejected' | 'cancelled' | 'expired';
155
+ request: CreateApprovalArgs['request'];
156
+ deliveries: ApprovalDelivery[];
157
+ response?: ApprovalResponse;
158
+ createdAt: string;
159
+ updatedAt: string;
160
+ resolvedAt?: string;
161
+ }
162
+ /** An inbound attachment already materialized to a LOCAL file by the provider. */
163
+ export interface InboundChannelAttachment {
164
+ name: string;
165
+ path: string;
166
+ contentType?: string;
167
+ size?: number;
168
+ }
169
+ /**
170
+ * A human message arriving FROM a channel (#669 Phase B). The provider has
171
+ * already applied its gating (allowlists, mention requirements) — a handler
172
+ * receiving this may treat the sender as authorized. `channelRef` is
173
+ * provider-qualified and directly usable as a send target for the reply.
174
+ */
175
+ export interface InboundChannelMessage {
176
+ platform: string;
177
+ channelRef: string;
178
+ authorId: string;
179
+ authorName?: string;
180
+ text: string;
181
+ attachments?: InboundChannelAttachment[];
182
+ /** Provider message ref (e.g. "message:<id>"). */
183
+ messageRef: string;
184
+ /**
185
+ * Structured control command (e.g. a slash command) instead of chat text —
186
+ * when present, `text` is empty and consumers act on the verb ("new-chat"
187
+ * unbinds the channel's chat so the next message starts fresh). The
188
+ * provider has already acked the command UI-side.
189
+ */
190
+ command?: {
191
+ name: string;
192
+ };
193
+ }
194
+ /**
195
+ * The full channel surface a delivering runtime exposes (see
196
+ * `AgentRuntimeAdapter.channels` for the capability semantics — the member
197
+ * is OPTIONAL there; this type is the shape when present).
198
+ */
199
+ export interface RuntimeChannelSurface {
200
+ list(): Promise<ChannelInfo[]>;
201
+ sendNotification(args: NotificationArgs): Promise<DeliveryResult>;
202
+ sendMessage(args: ChannelMessageArgs): Promise<DeliveryResult>;
203
+ deliverContent(args: ContentDeliveryArgs): Promise<DeliveryResult>;
204
+ createApproval(args: CreateApprovalArgs): Promise<ApprovalRenderResult>;
205
+ editApproval(args: EditApprovalArgs): Promise<ApprovalRenderResult>;
206
+ cancelApproval(args: CancelApprovalArgs): Promise<void>;
207
+ resolveApproval(args: ResolveApprovalArgs): Promise<void>;
208
+ subscribeApprovalResponses(handler: (event: ApprovalResolveEvent) => void): () => void;
209
+ /**
210
+ * Optional threading/editing capabilities. Adapters for providers without
211
+ * threads or message editing omit them; callers MUST feature-detect and
212
+ * fall back to flat channel messages — never error on absence.
213
+ */
214
+ createThread?(args: CreateThreadArgs): Promise<CreatedThread | null>;
215
+ editMessage?(args: EditChannelMessageArgs): Promise<void>;
216
+ /**
217
+ * OPTIONAL inbound stream (#669 Phase B): human messages from the channel
218
+ * platform, pre-gated by the provider (allowlists fail closed; guild
219
+ * messages mention-gated). Runtimes that handle inbound themselves
220
+ * (OpenClaw) OMIT this member — consumers feature-detect.
221
+ */
222
+ subscribeInboundMessages?(handler: (message: InboundChannelMessage) => void): () => void;
223
+ /**
224
+ * OPTIONAL ephemeral typing/activity signal (#669 Phase B, D10). Providers
225
+ * without the concept omit it; callers feature-detect and repeat while
226
+ * work runs (platform typing states expire — Discord's after ~10s).
227
+ */
228
+ sendTyping?(args: {
229
+ channel: string;
230
+ }): Promise<void>;
231
+ }