@makinbakin/sdk 0.0.1-rc.3 → 0.0.1-rc.30
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.
- package/README.md +248 -3
- package/_internal/app/components/agent-avatar.d.ts +2 -1
- package/_internal/app/components/conversation/attention.d.ts +56 -0
- package/_internal/app/components/conversation/fold.d.ts +3 -0
- package/_internal/app/components/conversation/notification-sound.d.ts +8 -0
- package/_internal/app/components/conversation/reply-toast.d.ts +15 -0
- package/_internal/app/components/conversation/thread-id.d.ts +8 -0
- package/_internal/app/components/conversation/turn-recorder.d.ts +37 -0
- package/_internal/app/components/conversation/use-conversation-attention.d.ts +64 -0
- package/_internal/app/components/drawer.d.ts +29 -0
- package/_internal/app/components/ui/button.d.ts +2 -8
- package/_internal/app/components/ui/dialog.d.ts +2 -17
- package/_internal/app/components/ui/sheet.d.ts +2 -14
- package/_internal/app/core/conversation-turns.d.ts +229 -0
- package/_internal/app/core/logger.d.ts +1 -0
- package/_internal/app/core/tool-access.d.ts +42 -0
- package/_internal/app/hooks/use-available-models.d.ts +5 -0
- package/_internal/app/hooks/use-content-store.d.ts +0 -9
- package/_internal/app/hooks/use-history-back.d.ts +5 -0
- package/_internal/app/hooks/use-horizontal-resize.d.ts +21 -0
- package/_internal/app/hooks/use-json-fetch.d.ts +36 -0
- package/_internal/app/hooks/use-nav-badge.d.ts +13 -0
- package/_internal/app/hooks/use-plugin-event.d.ts +19 -0
- package/_internal/app/hooks/use-query-state.d.ts +3 -12
- package/_internal/app/hooks/use-resizable-pane.d.ts +35 -0
- package/_internal/app/hooks/use-schedule.d.ts +47 -1
- package/_internal/app/hooks/use-search.d.ts +27 -8
- package/_internal/app/hooks/use-task-run-history.d.ts +26 -0
- package/_internal/app/hooks/use-toast.d.ts +3 -3
- package/_internal/app/lib/browser-notify.d.ts +12 -1
- package/_internal/app/types/index.d.ts +1 -105
- package/_internal/core/adapters/runtime/channels.d.ts +231 -0
- package/_internal/core/adapters/runtime/concepts.d.ts +709 -237
- package/_internal/core/adapters/runtime/errors.d.ts +105 -0
- package/_internal/core/adapters/runtime/helpers.d.ts +19 -0
- package/_internal/core/adapters/runtime/index.d.ts +8 -2
- package/_internal/core/adapters/runtime/skill-files.d.ts +12 -0
- package/_internal/core/adapters/runtime/testing.d.ts +79 -0
- package/_internal/core/adapters/runtime/turn-activity.d.ts +23 -0
- package/_internal/core/adapters/shared.d.ts +133 -12
- package/_internal/core/content-dir.d.ts +9 -0
- package/_internal/core/delivery/bridge.d.ts +36 -0
- package/_internal/core/docs/route.d.ts +1 -1
- package/_internal/core/format/structured.d.ts +44 -0
- package/_internal/core/format.d.ts +25 -1
- package/_internal/core/health/observation-builders.d.ts +42 -0
- package/_internal/core/media/downscale.d.ts +18 -0
- package/_internal/core/media/sharp-loader.d.ts +36 -0
- package/_internal/core/plugin-types.d.ts +236 -500
- package/_internal/core/routing/define.d.ts +27 -3
- package/_internal/core/routing/dispatcher.d.ts +15 -6
- package/_internal/core/routing/index.d.ts +1 -1
- package/_internal/core/routing/types.d.ts +13 -70
- package/_internal/core/storage/atomic-write.d.ts +11 -0
- package/_internal/core/tasks/store.d.ts +129 -0
- package/_internal/core/tasks/testing.d.ts +2 -0
- package/_internal/{plugins/workflows/lib → core/workflows}/notification-channel-registry.d.ts +1 -1
- package/_internal/host/ui/action-status.d.ts +13 -0
- package/_internal/host/ui/modals.d.ts +5 -0
- package/_internal/plugins/team/types.d.ts +61 -4
- package/_internal/plugins/workflows/hooks/use-notification-channels.d.ts +1 -1
- package/_internal/ui/behaviors/clipboard.d.ts +10 -0
- package/_internal/ui/behaviors/selection-navigation.d.ts +5 -0
- package/_internal/ui/behaviors/use-persisted-leading-edge-resize.d.ts +29 -0
- package/_internal/ui/charts/area-chart.d.ts +27 -0
- package/_internal/ui/charts/axis.d.ts +13 -0
- package/_internal/ui/charts/bar-chart.d.ts +21 -0
- package/_internal/ui/charts/chart-data-table.d.ts +61 -0
- package/_internal/ui/charts/chart-explainer.d.ts +4 -0
- package/_internal/ui/charts/chart-tooltip.d.ts +8 -0
- package/_internal/ui/charts/composition-bar.d.ts +41 -0
- package/_internal/ui/charts/index.d.ts +24 -0
- package/_internal/ui/charts/line-chart.d.ts +26 -0
- package/_internal/ui/charts/monotone-curve.d.ts +23 -0
- package/_internal/ui/charts/palette.d.ts +32 -0
- package/_internal/ui/charts/pie-chart.d.ts +80 -0
- package/_internal/ui/charts/ranked-bar-chart.d.ts +41 -0
- package/_internal/ui/charts/sparkline.d.ts +16 -0
- package/_internal/ui/charts/stacked-column-chart.d.ts +33 -0
- package/_internal/ui/content/code-block.d.ts +43 -0
- package/_internal/ui/content/index.d.ts +2 -0
- package/_internal/ui/conversation/activity-group.d.ts +27 -0
- package/_internal/ui/conversation/agent-turn.d.ts +47 -0
- package/_internal/ui/conversation/composer.d.ts +62 -0
- package/_internal/ui/conversation/context-meter.d.ts +37 -0
- package/_internal/ui/conversation/conversation-empty-state.d.ts +13 -0
- package/_internal/ui/conversation/conversation-header.d.ts +26 -0
- package/_internal/ui/conversation/conversation-panel.d.ts +59 -0
- package/_internal/ui/conversation/conversation.d.ts +35 -0
- package/_internal/ui/conversation/fold.d.ts +150 -0
- package/_internal/ui/conversation/glyphs.d.ts +30 -0
- package/_internal/ui/conversation/index.d.ts +31 -0
- package/_internal/ui/conversation/queued-message-list.d.ts +22 -0
- package/_internal/ui/conversation/relative-time.d.ts +8 -0
- package/_internal/ui/conversation/resize-handle.d.ts +13 -0
- package/_internal/ui/conversation/tool-call-drawer.d.ts +14 -0
- package/_internal/ui/conversation/turn-controls.d.ts +9 -0
- package/_internal/ui/conversation/turn-output.d.ts +42 -0
- package/_internal/ui/conversation/turn-usage.d.ts +16 -0
- package/_internal/ui/conversation/user-message.d.ts +13 -0
- package/_internal/ui/forms/field.d.ts +25 -0
- package/_internal/ui/forms/fieldset.d.ts +10 -0
- package/_internal/ui/forms/form.d.ts +19 -0
- package/_internal/ui/forms/index.d.ts +6 -0
- package/_internal/ui/index.d.ts +86 -0
- package/_internal/ui/layout/bounded-overflow.d.ts +42 -0
- package/_internal/ui/layout/disclosure-panel.d.ts +24 -0
- package/_internal/ui/layout/flow.d.ts +27 -0
- package/_internal/ui/layout/grid.d.ts +16 -0
- package/_internal/ui/layout/index.d.ts +14 -0
- package/_internal/ui/layout/page-shell.d.ts +11 -0
- package/_internal/ui/layout/panel.d.ts +28 -0
- package/_internal/ui/layout/section.d.ts +15 -0
- package/_internal/ui/layout/sticky-overflow-scrollbar.d.ts +11 -0
- package/_internal/ui/layout/utils.d.ts +1 -0
- package/_internal/ui/patterns/agent-filter.d.ts +20 -0
- package/_internal/ui/patterns/calendar-grid.d.ts +80 -0
- package/_internal/ui/patterns/calendar-item.d.ts +42 -0
- package/_internal/ui/patterns/calendar-nav.d.ts +21 -0
- package/_internal/ui/patterns/confirm-dialog.d.ts +29 -0
- package/_internal/ui/patterns/copy-button.d.ts +15 -0
- package/_internal/ui/patterns/danger-zone.d.ts +17 -0
- package/_internal/ui/patterns/data-table.d.ts +151 -0
- package/_internal/ui/patterns/drawer-section.d.ts +11 -0
- package/_internal/ui/patterns/facet-filter.d.ts +22 -0
- package/_internal/ui/patterns/index.d.ts +73 -0
- package/_internal/ui/patterns/inspector-panel.d.ts +39 -0
- package/_internal/ui/patterns/kanban.d.ts +70 -0
- package/_internal/ui/patterns/key-value.d.ts +35 -0
- package/_internal/ui/patterns/list-rows.d.ts +111 -0
- package/_internal/ui/patterns/nav-list.d.ts +41 -0
- package/_internal/ui/patterns/node-card.d.ts +37 -0
- package/_internal/ui/patterns/page-aside.d.ts +49 -0
- package/_internal/ui/patterns/page-body.d.ts +49 -0
- package/_internal/ui/patterns/page-canvas.d.ts +12 -0
- package/_internal/ui/patterns/page-composer.d.ts +8 -0
- package/_internal/ui/patterns/page-controls.d.ts +31 -0
- package/_internal/ui/patterns/page-header.d.ts +40 -0
- package/_internal/ui/patterns/page-timeline.d.ts +18 -0
- package/_internal/ui/patterns/page.d.ts +32 -0
- package/_internal/ui/patterns/pagination.d.ts +23 -0
- package/_internal/ui/patterns/save-bar.d.ts +21 -0
- package/_internal/ui/patterns/search-input.d.ts +20 -0
- package/_internal/ui/patterns/segmented-control.d.ts +22 -0
- package/_internal/ui/patterns/sortable-head.d.ts +13 -0
- package/_internal/ui/patterns/stat-group.d.ts +8 -0
- package/_internal/ui/patterns/stat-tile.d.ts +25 -0
- package/_internal/ui/patterns/status-badge.d.ts +15 -0
- package/_internal/ui/patterns/status-marker.d.ts +10 -0
- package/_internal/ui/patterns/timeline.d.ts +59 -0
- package/_internal/ui/patterns/unsaved-changes-dialog.d.ts +22 -0
- package/_internal/ui/patterns/workspace-page.d.ts +76 -0
- package/_internal/ui/primitives/alert.d.ts +17 -0
- package/_internal/ui/primitives/avatar.d.ts +13 -0
- package/_internal/ui/primitives/badge.d.ts +27 -0
- package/_internal/ui/primitives/button.d.ts +32 -0
- package/_internal/ui/primitives/card.d.ts +47 -0
- package/_internal/ui/primitives/checkbox.d.ts +3 -0
- package/_internal/ui/primitives/collapsible.d.ts +7 -0
- package/_internal/ui/primitives/color-input.d.ts +21 -0
- package/_internal/ui/primitives/command.d.ts +36 -0
- package/_internal/ui/primitives/dialog.d.ts +31 -0
- package/_internal/ui/primitives/dropdown-menu.d.ts +54 -0
- package/_internal/ui/primitives/file-input.d.ts +33 -0
- package/_internal/ui/primitives/input-group.d.ts +24 -0
- package/_internal/ui/primitives/input.d.ts +5 -0
- package/_internal/ui/primitives/interactive-surface.d.ts +24 -0
- package/_internal/ui/primitives/label.d.ts +3 -0
- package/_internal/ui/primitives/modal-context.d.ts +9 -0
- package/_internal/ui/primitives/option-list.d.ts +10 -0
- package/_internal/ui/primitives/popover.d.ts +18 -0
- package/_internal/ui/primitives/portal-ownership.d.ts +11 -0
- package/_internal/ui/primitives/progress.d.ts +38 -0
- package/_internal/ui/primitives/radio-group.d.ts +12 -0
- package/_internal/ui/primitives/select.d.ts +25 -0
- package/_internal/ui/primitives/separator.d.ts +7 -0
- package/_internal/ui/primitives/sheet.d.ts +34 -0
- package/_internal/ui/primitives/shimmer-text.d.ts +13 -0
- package/_internal/ui/primitives/skeleton.d.ts +6 -0
- package/_internal/ui/primitives/spinner.d.ts +31 -0
- package/_internal/ui/primitives/switch.d.ts +6 -0
- package/_internal/{app/components/ui → ui/primitives}/tabs.d.ts +1 -1
- package/_internal/ui/primitives/text.d.ts +43 -0
- package/_internal/ui/primitives/textarea.d.ts +3 -0
- package/_internal/ui/primitives/tooltip.d.ts +14 -0
- package/_internal/ui/private-ui-boundary-probe.d.ts +9 -0
- package/_internal/ui/states/banner.d.ts +15 -0
- package/_internal/ui/states/index.d.ts +6 -0
- package/_internal/ui/states/system-state.d.ts +88 -0
- package/_internal/ui/states/toast.d.ts +26 -0
- package/_internal/ui/utils.d.ts +14 -0
- package/bin/bakin-plugin-test-ui.js +6822 -0
- package/charts/index.d.ts +3 -0
- package/charts/index.js +2 -0
- package/content/index.d.ts +14 -0
- package/content/index.js +39 -0
- package/content/markdown-content.d.ts +16 -0
- package/content/markdown-editor.d.ts +35 -0
- package/conversation/index.d.ts +50 -0
- package/conversation/index.js +4 -0
- package/conversation/use-conversation-thread.d.ts +73 -0
- package/hooks/index.d.ts +85 -11
- package/hooks/index.js +1 -1747
- package/hooks/router.d.ts +4 -36
- package/index.d.ts +30 -6
- package/index.js +10 -14210
- package/internal/index.d.ts +74 -0
- package/internal/index.js +2 -0
- package/internal/lazy.d.ts +58 -0
- package/internal/plugin-ownership.d.ts +18 -0
- package/internal/private-ui-boundary-probe.d.ts +2 -0
- package/layout/index.d.ts +9 -0
- package/layout/index.js +2 -0
- package/metadata/index.d.ts +14 -1
- package/metadata/index.js +1 -30
- package/navigation/history-back.d.ts +5 -0
- package/navigation/index.d.ts +23 -0
- package/navigation/index.js +2 -0
- package/navigation/plugin-link.d.ts +11 -0
- package/navigation/query-state.d.ts +7 -0
- package/navigation/router.d.ts +35 -0
- package/navigation/search-params.d.ts +7 -0
- package/navigation/unsaved-changes-guard.d.ts +35 -0
- package/package.json +62 -10
- package/patterns/agent-patterns.d.ts +79 -0
- package/patterns/asset-library-picker.d.ts +38 -0
- package/patterns/channel-patterns.d.ts +32 -0
- package/patterns/index.d.ts +40 -0
- package/patterns/index.js +47 -0
- package/patterns/picker-patterns.d.ts +96 -0
- package/patterns/plugin-settings-renderer.d.ts +41 -0
- package/patterns/presentation-color.d.ts +2 -0
- package/patterns/search-patterns.d.ts +51 -0
- package/register.d.ts +63 -9
- package/routing/index.d.ts +6 -1
- package/routing/index.js +10 -14014
- package/slots/index.d.ts +12 -24
- package/slots/index.js +1 -91
- package/slots/registry.d.ts +45 -0
- package/styles.css +2 -0
- package/testing/index.d.ts +122 -0
- package/testing/index.js +93 -0
- package/testing/ui/conformance/cli.d.ts +2 -0
- package/testing/ui/conformance/contracts.d.ts +73 -0
- package/testing/ui/conformance/index.d.ts +11 -0
- package/testing/ui/conformance/index.js +85 -0
- package/testing/ui/conformance/plugin-css.d.ts +37 -0
- package/testing/ui/conformance/plugin-id.d.ts +6 -0
- package/testing/ui/conformance/runner.d.ts +13 -0
- package/testing/ui/index.d.ts +24 -0
- package/testing/ui/index.js +2 -0
- package/testing/ui/plugin-ui-fixture-host.d.ts +36 -0
- package/testing/ui/runtime.d.ts +70 -0
- package/types/api-route.d.ts +89 -0
- package/types/context.d.ts +166 -0
- package/types/conversation-turns.d.ts +229 -0
- package/types/events.d.ts +10 -0
- package/types/health.d.ts +374 -0
- package/types/index.d.ts +19 -919
- package/types/index.js +1 -0
- package/types/manifest.d.ts +221 -0
- package/types/primitives.d.ts +33 -0
- package/types/registration.d.ts +281 -0
- package/types/runtime.d.ts +292 -0
- package/types/scheduled-events.d.ts +80 -0
- package/types/services.d.ts +578 -0
- package/ui/index.d.ts +70 -31
- package/ui/index.js +38 -28704
- package/utils/asset-id.d.ts +15 -0
- package/utils/index.d.ts +25 -7
- package/utils/index.js +4 -2098
- package/utils/plugin-fetch.d.ts +23 -0
- package/_internal/app/components/agent-filter.d.ts +0 -8
- package/_internal/app/components/agent-select.d.ts +0 -15
- package/_internal/app/components/agent-status.d.ts +0 -8
- package/_internal/app/components/bakin-drawer.d.ts +0 -23
- package/_internal/app/components/color-picker.d.ts +0 -7
- package/_internal/app/components/empty-state.d.ts +0 -10
- package/_internal/app/components/error-banner.d.ts +0 -6
- package/_internal/app/components/error-state.d.ts +0 -8
- package/_internal/app/components/facet-filter.d.ts +0 -17
- package/_internal/app/components/integrated-brainstorm/activity.d.ts +0 -23
- package/_internal/app/components/integrated-brainstorm/collapsed-header.d.ts +0 -14
- package/_internal/app/components/integrated-brainstorm/empty-state.d.ts +0 -5
- package/_internal/app/components/integrated-brainstorm/index.d.ts +0 -8
- package/_internal/app/components/integrated-brainstorm/input-row.d.ts +0 -16
- package/_internal/app/components/integrated-brainstorm/message-list.d.ts +0 -8
- package/_internal/app/components/integrated-brainstorm/session.d.ts +0 -16
- package/_internal/app/components/integrated-brainstorm/sse.d.ts +0 -8
- package/_internal/app/components/integrated-brainstorm/thinking-indicator.d.ts +0 -19
- package/_internal/app/components/integrated-brainstorm/types.d.ts +0 -63
- package/_internal/app/components/integrated-brainstorm/use-auto-grow.d.ts +0 -6
- package/_internal/app/components/integrated-brainstorm/use-brainstorm-state.d.ts +0 -21
- package/_internal/app/components/markdown-content.d.ts +0 -3
- package/_internal/app/components/markdown-editor.d.ts +0 -11
- package/_internal/app/components/model-select.d.ts +0 -9
- package/_internal/app/components/page-layout.d.ts +0 -9
- package/_internal/app/components/plugin-header.d.ts +0 -16
- package/_internal/app/components/plugin-settings-renderer.d.ts +0 -9
- package/_internal/app/components/sortable-head.d.ts +0 -13
- package/_internal/app/components/ui/alert.d.ts +0 -10
- package/_internal/app/components/ui/avatar.d.ts +0 -11
- package/_internal/app/components/ui/badge.d.ts +0 -7
- package/_internal/app/components/ui/card.d.ts +0 -11
- package/_internal/app/components/ui/checkbox.d.ts +0 -3
- package/_internal/app/components/ui/collapsible.d.ts +0 -5
- package/_internal/app/components/ui/command.d.ts +0 -19
- package/_internal/app/components/ui/dropdown-menu.d.ts +0 -29
- package/_internal/app/components/ui/form.d.ts +0 -23
- package/_internal/app/components/ui/input-group.d.ts +0 -18
- package/_internal/app/components/ui/input.d.ts +0 -3
- package/_internal/app/components/ui/label.d.ts +0 -3
- package/_internal/app/components/ui/popover.d.ts +0 -9
- package/_internal/app/components/ui/progress.d.ts +0 -7
- package/_internal/app/components/ui/select.d.ts +0 -15
- package/_internal/app/components/ui/separator.d.ts +0 -3
- package/_internal/app/components/ui/skeleton.d.ts +0 -2
- package/_internal/app/components/ui/switch.d.ts +0 -5
- package/_internal/app/components/ui/textarea.d.ts +0 -3
- package/_internal/app/components/ui/tooltip.d.ts +0 -6
- package/_internal/app/components/underline-tabs.d.ts +0 -15
- package/_internal/app/hooks/use-assets.d.ts +0 -25
- package/_internal/app/hooks/use-form-guard.d.ts +0 -5
- package/_internal/app/hooks/use-vertical-resize.d.ts +0 -22
- package/_internal/app/lib/utils.d.ts +0 -2
- package/_internal/plugins/workflows/hooks/channel-icon.d.ts +0 -6
- package/components/index.d.ts +0 -34
- package/components/index.js +0 -40175
- /package/_internal/{app/components/ui → ui/primitives}/table.d.ts +0 -0
package/README.md
CHANGED
|
@@ -86,6 +86,7 @@ component for a slot via `registerPlugin({ slots: { 'slot-name': Component } })`
|
|
|
86
86
|
| `task-assets` | Task drawer, asset attachments section |
|
|
87
87
|
| `task-sidebar` | Task drawer sidebar (custom panels for a plugin's tasks) |
|
|
88
88
|
| `home-widget` | Dashboard home widget grid |
|
|
89
|
+
| `nav-badge-providers` | Background hook runners (render `null`) that drive `setNavBadge` |
|
|
89
90
|
| `page:/<route>` | Full-page mount at `<route>` |
|
|
90
91
|
|
|
91
92
|
## Sub-path imports
|
|
@@ -95,16 +96,260 @@ The public npm package exposes these sub-paths:
|
|
|
95
96
|
| Import path | What it exposes |
|
|
96
97
|
| ------------------------ | -------------------------------------------- |
|
|
97
98
|
| `@makinbakin/sdk` | Plugin registration, route helpers, top-level exports |
|
|
98
|
-
| `@makinbakin/sdk/ui` |
|
|
99
|
+
| `@makinbakin/sdk/ui` | Supported Bakin UI primitives and semantic style helpers |
|
|
100
|
+
| `@makinbakin/sdk/layout` | Canonical page and responsive composition |
|
|
101
|
+
| `@makinbakin/sdk/patterns` | Reusable application-aware UI patterns |
|
|
102
|
+
| `@makinbakin/sdk/charts` | Isolated data-visualization components |
|
|
103
|
+
| `@makinbakin/sdk/conversation` | Isolated conversation UI and models |
|
|
104
|
+
| `@makinbakin/sdk/content` | Opt-in rich content rendering and editing |
|
|
99
105
|
| `@makinbakin/sdk/hooks` | Shared React hooks |
|
|
100
|
-
| `@makinbakin/sdk/components` |
|
|
106
|
+
| `@makinbakin/sdk/components` | Migration-only legacy component barrel |
|
|
101
107
|
| `@makinbakin/sdk/slots` | Slot runtime and provider |
|
|
102
108
|
| `@makinbakin/sdk/types` | TypeScript contract types |
|
|
103
109
|
| `@makinbakin/sdk/utils` | Shared utilities |
|
|
104
110
|
| `@makinbakin/sdk/metadata` | Docs-aware contract metadata helpers |
|
|
105
111
|
| `@makinbakin/sdk/routing` | Typed declarative route helpers |
|
|
112
|
+
| `@makinbakin/sdk/navigation` | Browser links, URL state, history, and dirty-exit guards |
|
|
113
|
+
| `@makinbakin/sdk/testing/ui` | Deterministic browser fixture host for plugin pages and slots |
|
|
114
|
+
| `@makinbakin/sdk/testing/ui/conformance` | Plugin UI test config, reports, CSS gate, and runner |
|
|
115
|
+
| `@makinbakin/sdk/styles.css` | Canonical compiled design-system stylesheet |
|
|
106
116
|
|
|
107
|
-
Use
|
|
117
|
+
Use the focused entrypoints for new plugin UI and browser navigation. Existing
|
|
118
|
+
`@makinbakin/sdk/components` consumers migrate as their replacement exports
|
|
119
|
+
land; do not add new dependencies on that legacy barrel.
|
|
120
|
+
|
|
121
|
+
## Browser UI fixtures
|
|
122
|
+
|
|
123
|
+
Use `PluginUiFixtureHost` from `@makinbakin/sdk/testing/ui` to exercise a
|
|
124
|
+
plugin's real client registration without a Bakin account, host database, or
|
|
125
|
+
live service. The browser-only entrypoint mounts registered pages and slots
|
|
126
|
+
through the production route matcher, ownership wrappers, and SDK portal
|
|
127
|
+
roots. It also provides deterministic time, random values, UUIDs, theme,
|
|
128
|
+
motion preferences, routes, and explicit network responses.
|
|
129
|
+
|
|
130
|
+
```tsx
|
|
131
|
+
import '@makinbakin/sdk/styles.css'
|
|
132
|
+
import { PluginUiFixtureHost } from '@makinbakin/sdk/testing/ui'
|
|
133
|
+
import { pluginRegistration } from './client-registration'
|
|
134
|
+
|
|
135
|
+
export function PluginPreview() {
|
|
136
|
+
return (
|
|
137
|
+
<PluginUiFixtureHost
|
|
138
|
+
registrations={[pluginRegistration]}
|
|
139
|
+
fixture={{
|
|
140
|
+
fixedNow: '2026-01-15T12:00:00.000Z',
|
|
141
|
+
route: '/bookmarks?tag=release',
|
|
142
|
+
randomSeed: 'bookmarks-preview',
|
|
143
|
+
colorScheme: 'dark',
|
|
144
|
+
reducedMotion: true,
|
|
145
|
+
viewport: 'desktop',
|
|
146
|
+
network: [{ path: '/api/plugins/bookmarks', status: 200, json: { bookmarks: [] } }],
|
|
147
|
+
}}
|
|
148
|
+
slots={[{ name: 'home-widget', label: 'Home widget contributions' }]}
|
|
149
|
+
/>
|
|
150
|
+
)
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Import the canonical stylesheet exactly once at the preview root; installed
|
|
155
|
+
plugin clients still leave stylesheet loading to Bakin. Apply the matching
|
|
156
|
+
`PLUGIN_UI_VIEWPORTS.desktop` or `.mobile` dimensions in the browser runner—the
|
|
157
|
+
fixture's viewport field freezes responsive preferences and records intent but
|
|
158
|
+
cannot resize the browser from inside React. Unlisted requests fail loudly so
|
|
159
|
+
fixtures cannot silently depend on a developer machine or user state.
|
|
160
|
+
|
|
161
|
+
Add the one-command conformance suite to a client-bearing plugin package:
|
|
162
|
+
|
|
163
|
+
```json
|
|
164
|
+
{
|
|
165
|
+
"scripts": { "test:ui": "bakin-plugin-test-ui" },
|
|
166
|
+
"devDependencies": {
|
|
167
|
+
"axe-core": "^4.12.0",
|
|
168
|
+
"playwright": "^1.60.0"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Install the browser once with `bunx playwright install chromium`.
|
|
174
|
+
|
|
175
|
+
Then define the package-root fixture in `bakin.ui-test.ts`:
|
|
176
|
+
|
|
177
|
+
```ts
|
|
178
|
+
import { definePluginUiConformance } from '@makinbakin/sdk/testing/ui/conformance'
|
|
179
|
+
|
|
180
|
+
export default definePluginUiConformance({
|
|
181
|
+
pluginId: 'bookmarks',
|
|
182
|
+
fixtureEntry: './tests/ui.fixture.tsx',
|
|
183
|
+
})
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
`bun run test:ui` builds that real fixture, verifies CSS ownership and exactly
|
|
187
|
+
one canonical stylesheet import, then runs axe, keyboard/focus, overflow, and
|
|
188
|
+
browser-error checks in 1440×900 and 320×800 Chromium viewports. It writes
|
|
189
|
+
machine-readable JSON, a self-contained HTML report, and both screenshots to
|
|
190
|
+
`test-results/bakin-ui/`. CSS scope and stylesheet identity are reusable
|
|
191
|
+
package/install blockers; broader browser findings gate CI or release without
|
|
192
|
+
changing runtime installation policy.
|
|
193
|
+
|
|
194
|
+
The prerelease migration surface is machine-inventoried in
|
|
195
|
+
[`design-system/public-api.json`](https://github.com/markhayden/bakin/blob/main/design-system/public-api.json).
|
|
196
|
+
Any value or type addition, removal, or entrypoint ownership change requires an
|
|
197
|
+
explicit inventory review. The legacy components symbol set is frozen: it may
|
|
198
|
+
shrink during migration but must not receive new exports.
|
|
199
|
+
|
|
200
|
+
Action and status UI starts with `Button`, `Badge`, `Alert`, and `Progress`.
|
|
201
|
+
Choose their semantic `variant`, `tone`, and `size` props instead of recreating
|
|
202
|
+
colors or dimensions in plugin CSS. The `buttonVariants` and `badgeVariants`
|
|
203
|
+
helpers are supported when a link or render integration needs the same visual
|
|
204
|
+
treatment while preserving its native element semantics.
|
|
205
|
+
|
|
206
|
+
Routine forms compose `Field`, `FieldLabel`, `FieldDescription`, `FieldError`,
|
|
207
|
+
and SDK controls inside `Form`. Use `Fieldset` for related choices and finish
|
|
208
|
+
with `FormActions` plus `SubmitButton`; the form's `busy` prop marks submission
|
|
209
|
+
and prevents duplicate saves. Form-state libraries may manage values and dirty
|
|
210
|
+
state, but the SDK components continue to own labels, errors, spacing, and
|
|
211
|
+
actions.
|
|
212
|
+
|
|
213
|
+
Data-driven surfaces use `SystemState` for initial-empty, filtered no-results,
|
|
214
|
+
loading, recoverable or terminal error, and permission-denied states. A
|
|
215
|
+
no-results state requires a clear/adjust action; a recoverable error requires a
|
|
216
|
+
recovery action. Use `Banner` for persistent page context. Plugins call
|
|
217
|
+
`toast()` from `@makinbakin/sdk/hooks` for transient outcomes and leave the
|
|
218
|
+
shell-owned `ToastRegion` to Bakin.
|
|
219
|
+
|
|
220
|
+
Routed indexes and record pages compose from `@makinbakin/sdk/patterns`.
|
|
221
|
+
`PageHeader` owns the single page heading and its responsive controls/action
|
|
222
|
+
order. Use its `controls` slot for the canonical compact `SearchInput` and peer
|
|
223
|
+
view navigation when they belong beside the primary action; the reserved
|
|
224
|
+
search slot expands without repacking the desktop header row. Longer queries
|
|
225
|
+
remain intact behind an ellipsis, and the pattern supplies its own accessible
|
|
226
|
+
clear action instead of a browser-dependent native cancel control.
|
|
227
|
+
`Page` owns the page canvas (width measure, density, scroll ownership);
|
|
228
|
+
`PageControls` and `PageBody` keep query controls separate from the named
|
|
229
|
+
result/state boundary, and `PageBody layout="aside"` composes a primary flow
|
|
230
|
+
with an optional named `PageAside` that reflows below it. The recipes do not own
|
|
231
|
+
data or routing: keep filters, search, tabs, pagination, and overlays in the
|
|
232
|
+
existing `useQueryState` contract, and use `PluginLink` for client-routed page
|
|
233
|
+
navigation. The host retains the `main` landmark and vertical page scroll.
|
|
234
|
+
|
|
235
|
+
Settings and overview pages also compose the same archetype. A multi-category
|
|
236
|
+
settings surface keeps a consumer-owned named category `nav` beside a
|
|
237
|
+
`PageBody` region so the active form owns only its own feedback and
|
|
238
|
+
replacement-state boundary. A dashboard is a named `PageBody gap="page"`
|
|
239
|
+
overview canvas that consumers compose with `Section`, `Stack`, and `Grid`.
|
|
240
|
+
Keep settings categories and dashboard view state in the existing query-state
|
|
241
|
+
contract. Values, validation, dirty state, saves, telemetry, and domain actions
|
|
242
|
+
remain consumer owned; avoid equal-weight card walls and nested page scrollers.
|
|
243
|
+
|
|
244
|
+
Conversation pages use the default `Page` document scroll. Choose
|
|
245
|
+
`scroll="contained"` only inside an explicitly bounded parent; then
|
|
246
|
+
`PageTimeline` is the single named log scroller and the composer
|
|
247
|
+
remains outside it. Render folded turns with `Conversation` from
|
|
248
|
+
`@makinbakin/sdk/conversation`; its default `document` mode avoids creating a
|
|
249
|
+
second scroller inside the page recipe. `mode="contained"` is reserved for a
|
|
250
|
+
standalone conversation with an explicit height boundary. `ConversationEmptyState`
|
|
251
|
+
renders starter suggestions only when their callback is supplied. Put `Composer`
|
|
252
|
+
inside `PageComposer`; its stable `storageKey` scopes browser-local
|
|
253
|
+
draft/history/resize preferences, while the consumer owns routing, upload requests,
|
|
254
|
+
object-URL cleanup, persistence, and send mutations. Attachment `acceptedTypes`
|
|
255
|
+
apply consistently to picker, paste, and drop. Pending uploads hold send, `busy`
|
|
256
|
+
keeps typing live, and a stop control appears only when `onAbort` exists.
|
|
257
|
+
`InspectorPanel` supplies named header/content/footer hierarchy beside a canvas
|
|
258
|
+
or inside `Drawer`. Transport, server persistence, rich text, routing, selection,
|
|
259
|
+
drawer focus, and domain mutations remain consumer owned.
|
|
260
|
+
|
|
261
|
+
Workflow and action workspaces use `Page density="compact"` with a named
|
|
262
|
+
`PageControls as="toolbar"`, a bounded `PageCanvas`, and a consumer-owned
|
|
263
|
+
named actions group.
|
|
264
|
+
Vertical is the default graph orientation; horizontal is an explicit option.
|
|
265
|
+
The recipe supplies hierarchy and a bounded overflow region without importing
|
|
266
|
+
React Flow or owning nodes, edges, selection, graph commands, persistence,
|
|
267
|
+
drawers, or URL state. Use the existing routing contract for linkable selected
|
|
268
|
+
nodes and view modes, and provide named non-drag actions for required graph
|
|
269
|
+
operations.
|
|
270
|
+
|
|
271
|
+
Consequential actions and staged drafts use `ConfirmDialog`, `DangerZone`,
|
|
272
|
+
`SaveBar`, and `UnsavedChangesDialog` from `@makinbakin/sdk/patterns`.
|
|
273
|
+
Consumers retain mutation, dirty, persistence, retry, and routing behavior;
|
|
274
|
+
the patterns provide typed confirmation, busy/error presentation, responsive
|
|
275
|
+
action placement, and the save/discard/stay decision. Keep normal links and
|
|
276
|
+
query-only state changes on the existing SDK router contract.
|
|
277
|
+
|
|
278
|
+
Filtering and view navigation use `FacetFilter`, `AgentFilter`,
|
|
279
|
+
`SegmentedControl`, and `SortableHead` from the same focused patterns
|
|
280
|
+
entrypoint, and page-section tabs use `Tabs` with
|
|
281
|
+
`<TabsList variant="underline">` from `@makinbakin/sdk/ui`. These components
|
|
282
|
+
own searchable counts, clearing, keyboard selection, linked-tab semantics,
|
|
283
|
+
long-label overflow, and table sort semantics. Consumers still own values and routing: connect linkable filters and
|
|
284
|
+
views to `useQueryArrayState` or `useQueryState` from
|
|
285
|
+
`@makinbakin/sdk/hooks`. The public `AgentFilter` accepts presentation-ready
|
|
286
|
+
options; host adapters may add app-owned agent metadata and avatars.
|
|
287
|
+
|
|
288
|
+
Agent identity and assignment use the same focused patterns entrypoint.
|
|
289
|
+
`AgentAvatar`, `AgentStatus`, and `AgentSelect` accept presentation-ready
|
|
290
|
+
identity, status, agent, and team options; they never fetch the registry or
|
|
291
|
+
team API. Status remains visible in text, and consumers keep assignment state,
|
|
292
|
+
heartbeat timing, URL state, and persistence. Existing official surfaces may
|
|
293
|
+
continue through the migration-only components adapters until fleet migration.
|
|
294
|
+
|
|
295
|
+
Asset, model, and color choices use `AssetPicker`, `ModelSelect`, and
|
|
296
|
+
`ColorPicker` from the focused patterns entrypoint. `AssetPicker` supports a
|
|
297
|
+
controlled library dialog plus inline grid or list composition with exact
|
|
298
|
+
loading, error, empty, and filtered states. Consumers own asset endpoints,
|
|
299
|
+
uploads, eligibility, attachment mutations, and route state. `ModelSelect`
|
|
300
|
+
groups presentation-ready catalog options by provider and exports the stable
|
|
301
|
+
`DEFAULT_MODEL_VALUE` sentinel; consumers own catalog loading and persistence.
|
|
302
|
+
`ColorPicker` provides labelled radio semantics and enabled-option keyboard
|
|
303
|
+
movement while consumers own palette values and saving. Existing official
|
|
304
|
+
surfaces may remain on the migration-only components adapters until their
|
|
305
|
+
incremental migration.
|
|
306
|
+
|
|
307
|
+
Schema-driven plugin forms use `PluginSettingsRenderer` from
|
|
308
|
+
`@makinbakin/sdk/patterns`; the settings schema and field types are co-exported
|
|
309
|
+
from that entrypoint. The renderer owns defaults, draft editing, validation,
|
|
310
|
+
list-row controls, and accessible feedback placement. Consumers own loading,
|
|
311
|
+
persistence, retry, route state, and the durable `busy`/`feedback` values that
|
|
312
|
+
describe a save result. Official surfaces may continue through the app-aware
|
|
313
|
+
components adapter until fleet migration.
|
|
314
|
+
|
|
315
|
+
Compact task and workflow output uses `TurnOutputView`, `TurnToolChip`, and
|
|
316
|
+
`foldTurnChunks` from `@makinbakin/sdk/conversation`. They share the canonical
|
|
317
|
+
conversation fold and tool-row semantics, keep wide code output locally
|
|
318
|
+
scrollable, and expose typed live, terminal, and error evidence. Markdown is
|
|
319
|
+
plain safe text by default; consumers that need rich content provide
|
|
320
|
+
`renderText`, normally with `MarkdownContent` from the opt-in
|
|
321
|
+
`@makinbakin/sdk/content` entrypoint. The compatibility adapter retains the
|
|
322
|
+
host's existing rich-Markdown behavior during migration.
|
|
323
|
+
|
|
324
|
+
Compact display patterns use `StatusBadge` and `StatTile`. Status labels carry
|
|
325
|
+
meaning without color, while optional icons remain decorative. Focused status
|
|
326
|
+
tones use `attention` and `danger`; the legacy components adapter maps the old
|
|
327
|
+
`warning` and `destructive` names during migration. `StatTile` is low-chrome by
|
|
328
|
+
default, offers an explicit bounded `surface` variant, and exposes labelled
|
|
329
|
+
progress values to assistive technology.
|
|
330
|
+
|
|
331
|
+
## Stylesheet
|
|
332
|
+
|
|
333
|
+
Bakin loads one shared copy of `@makinbakin/sdk/styles.css` for the host and all
|
|
334
|
+
installed plugins. Do not import it from a plugin client entry or copy its
|
|
335
|
+
contents into plugin-owned CSS.
|
|
336
|
+
|
|
337
|
+
Standalone browser previews and test harnesses do not have the Bakin host, so
|
|
338
|
+
they import the public artifact once at their application root:
|
|
339
|
+
|
|
340
|
+
```ts
|
|
341
|
+
import '@makinbakin/sdk/styles.css'
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
That package export is the exact compiled stylesheet used by the host and the
|
|
345
|
+
public component catalog. Plugin-owned CSS remains for domain-specific styling
|
|
346
|
+
and should be scoped to the plugin root.
|
|
347
|
+
|
|
348
|
+
SDK dialogs, sheets, popovers, menus, selects, and tooltips automatically keep
|
|
349
|
+
the host-injected plugin identity when their content is portalled. Plugin code
|
|
350
|
+
uses the normal primitive APIs without adding ownership wrappers or custom
|
|
351
|
+
portal containers for styling. Toast presentation remains host-owned; plugins
|
|
352
|
+
request toasts through the SDK instead of mounting a toast region.
|
|
108
353
|
|
|
109
354
|
## Repository
|
|
110
355
|
|
|
@@ -7,5 +7,6 @@ interface AgentAvatarProps {
|
|
|
7
7
|
status?: StatusValue;
|
|
8
8
|
className?: string;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
/** Compatibility adapter that supplies registered-agent identity to the public presentation pattern. */
|
|
11
|
+
export declare function AgentAvatar({ agentId, size, showStatus, status, className }: AgentAvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
11
12
|
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conversation attention rules — ONE set of pure decisions for every
|
|
3
|
+
* conversational surface's badge provider (#703): what a turn's done/error
|
|
4
|
+
* means given where the user is looking. Providers execute the returned
|
|
5
|
+
* actions (toast/sound/OS notification/seen); this module never touches
|
|
6
|
+
* the DOM so the rules stay unit-testable. Generalized verbatim from the
|
|
7
|
+
* chat plugin's attention module (chat re-exports from here).
|
|
8
|
+
*
|
|
9
|
+
* Suppression rules (chat spec S6, now kit-wide):
|
|
10
|
+
* - Reply lands while the user is VIEWING that thread → no toast, no
|
|
11
|
+
* sound, no OS notification (the conversation itself is the signal);
|
|
12
|
+
* unread is cleared (the view fires seen).
|
|
13
|
+
* - Reply lands elsewhere in the app → toast + sound; the OS notification
|
|
14
|
+
* is also requested — sendBrowserNotification suppresses itself when
|
|
15
|
+
* the tab has focus, so it only fires when the user is in another app.
|
|
16
|
+
* - Aborted turns notify nothing — the user stopped it themselves.
|
|
17
|
+
*/
|
|
18
|
+
export interface ConversationDonePayload {
|
|
19
|
+
/** The thread key (chat: chatId; projects: projectId; …). */
|
|
20
|
+
key: string;
|
|
21
|
+
agentId: string;
|
|
22
|
+
preview?: string;
|
|
23
|
+
aborted?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface ConversationAttentionContext {
|
|
26
|
+
/** The thread currently open in the UI, '' when none. */
|
|
27
|
+
visibleKey: string;
|
|
28
|
+
settings: {
|
|
29
|
+
sound: boolean;
|
|
30
|
+
toasts: boolean;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export interface AttentionActions {
|
|
34
|
+
toast: boolean;
|
|
35
|
+
sound: boolean;
|
|
36
|
+
/** Ask browser-notify (it self-suppresses while the tab is focused). */
|
|
37
|
+
browserNotification: boolean;
|
|
38
|
+
/** The user is looking at the thread — mark it seen instead of unread. */
|
|
39
|
+
markSeen: boolean;
|
|
40
|
+
}
|
|
41
|
+
export declare function attentionForDone(payload: ConversationDonePayload, ctx: ConversationAttentionContext): AttentionActions;
|
|
42
|
+
/**
|
|
43
|
+
* The entity id the user is currently viewing, derived from a
|
|
44
|
+
* `<base>/<id>` URL path (list and excluded ids — e.g. a `/new` draft
|
|
45
|
+
* route — view no conversation, so they never suppress attention).
|
|
46
|
+
*/
|
|
47
|
+
export declare function visibleIdFromLocation(pathname: string, base: string, opts?: {
|
|
48
|
+
exclude?: readonly string[];
|
|
49
|
+
}): string;
|
|
50
|
+
/** Nav badge from unread totals + in-flight turns: count wins, dot while working. */
|
|
51
|
+
export declare function badgeFor(totalUnread: number, inflightCount: number): {
|
|
52
|
+
count?: number;
|
|
53
|
+
tone: 'attention' | 'info';
|
|
54
|
+
} | null;
|
|
55
|
+
/** `(N) ` tab-title prefix management (idempotent). */
|
|
56
|
+
export declare function withUnreadPrefix(title: string, totalUnread: number): string;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** @deprecated Import conversation models and folding from `@makinbakin/sdk/conversation`. */
|
|
2
|
+
export { foldConversation } from '@makinbakin/sdk/conversation';
|
|
3
|
+
export type { ConversationChunk, ConversationMessage, ConversationTextFormat, ConversationToolActivity, ConversationToolCall, ConversationTurn, DisplayAttachment, FoldOptions, TurnItem, TurnStatus, } from '@makinbakin/sdk/conversation';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reply chime — a soft two-tone WebAudio blip shared by every
|
|
3
|
+
* conversational surface's attention provider (moved from the chat plugin
|
|
4
|
+
* in #703; chat re-exports from here). Generated, not an asset: zero
|
|
5
|
+
* bundle weight, no file to embed, and the volume stays deliberately low
|
|
6
|
+
* (this is a nudge, not an alarm).
|
|
7
|
+
*/
|
|
8
|
+
export declare function playReplyChime(): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare function ConversationReplyToast({ agentId, title, preview, to, onNavigate, testId }: {
|
|
2
|
+
agentId: string;
|
|
3
|
+
/** e.g. "replied" / "replied in a project brainstorm" — prefixed with the agent's name. */
|
|
4
|
+
title: string;
|
|
5
|
+
preview?: string;
|
|
6
|
+
/** Internal route to navigate to on click (router push, never a reload). */
|
|
7
|
+
to: string;
|
|
8
|
+
/** Called before navigation (wire the attention hook's `dismiss` here). */
|
|
9
|
+
onNavigate?: () => void;
|
|
10
|
+
/** data-* marker attribute value for tests (e.g. chat sets data-chat-toast). */
|
|
11
|
+
testId?: {
|
|
12
|
+
attr: string;
|
|
13
|
+
value: string;
|
|
14
|
+
};
|
|
15
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* conversationThreadId — the adapter-neutral durable thread key for embedded
|
|
3
|
+
* conversation surfaces: `scope:entityId:agentId`, each part URL-encoded,
|
|
4
|
+
* empty parts defaulting to 'default'. (The chat plugin uses its own
|
|
5
|
+
* `chat:<chatId>` scheme; this is for entity-scoped threads like
|
|
6
|
+
* brainstorms and plan reviews.)
|
|
7
|
+
*/
|
|
8
|
+
export declare function conversationThreadId(scope: string, entityId: string, agentId: string): string;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* createTurnRecorder — server-side helper turning one streamed turn's
|
|
3
|
+
* RuntimeChatChunks into persisted ConversationMessage rows. ONE
|
|
4
|
+
* implementation of "what survives a turn" shared by the chat plugin's
|
|
5
|
+
* stream bridge and embedded surfaces' plugin routes:
|
|
6
|
+
*
|
|
7
|
+
* - assistant text accumulates and lands as ONE assistant row (in stream
|
|
8
|
+
* position relative to the tool rows around it — earlier text flushes
|
|
9
|
+
* when a tool result arrives so replay preserves interleaving)
|
|
10
|
+
* - only `phase:'result'` tool chunks persist, merged over their call
|
|
11
|
+
* phase (summary/previews), previews clipped at honest byte caps with
|
|
12
|
+
* a `metadata.truncated` marker
|
|
13
|
+
* - error chunks persist as error rows (after any partial text)
|
|
14
|
+
* - status/done chunks never persist
|
|
15
|
+
*/
|
|
16
|
+
import type { ChatChunk as RuntimeChatChunk } from '../../../core/adapters/runtime';
|
|
17
|
+
import type { ConversationMessage } from './fold';
|
|
18
|
+
export declare const SUMMARY_MAX_CHARS = 500;
|
|
19
|
+
export declare const PREVIEW_MAX_CHARS = 2000;
|
|
20
|
+
interface RecorderOptions {
|
|
21
|
+
turnId: string;
|
|
22
|
+
agentId?: string;
|
|
23
|
+
now?: () => string;
|
|
24
|
+
}
|
|
25
|
+
export interface TurnRecorder {
|
|
26
|
+
ingest: (chunk: RuntimeChatChunk) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Rows settled since the last drain (tool results, flushed text) — lets
|
|
29
|
+
* callers persist incrementally so a crash keeps the partial turn.
|
|
30
|
+
* Pending (unflushed) text stays buffered until finish().
|
|
31
|
+
*/
|
|
32
|
+
drain: () => ConversationMessage[];
|
|
33
|
+
/** Flush trailing text and return the remaining undrained rows; call once at turn end. */
|
|
34
|
+
finish: () => ConversationMessage[];
|
|
35
|
+
}
|
|
36
|
+
export declare function createTurnRecorder({ turnId, agentId, now }: RecorderOptions): TurnRecorder;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useConversationAttention — the provider building block behind every
|
|
3
|
+
* conversational surface's `nav-badge-providers` slot component (#703).
|
|
4
|
+
* Mount the consumer's provider outside the router (the host renders the
|
|
5
|
+
* slot on every page) and call this hook with the surface's wiring; it
|
|
6
|
+
* keeps the nav badge (unread count / working dot), the optional `(N)`
|
|
7
|
+
* tab-title prefix, and fires toast + chime + OS notification when a
|
|
8
|
+
* reply lands while the user is elsewhere — rules in ./attention.ts,
|
|
9
|
+
* mechanics generalized from chat's ChatBadgeProvider (which now
|
|
10
|
+
* composes this hook).
|
|
11
|
+
*/
|
|
12
|
+
import { type ReactNode } from 'react';
|
|
13
|
+
import { type PluginEventPayload } from '../../hooks/use-plugin-event';
|
|
14
|
+
import { type ConversationDonePayload } from './attention';
|
|
15
|
+
export interface ConversationAttentionTotals {
|
|
16
|
+
unreadTotal: number;
|
|
17
|
+
/** Threads with a server-seeded in-flight turn (kept live by chunk/done events). */
|
|
18
|
+
inflightKeys: string[];
|
|
19
|
+
}
|
|
20
|
+
export interface ConversationAttentionConfig {
|
|
21
|
+
pluginId: string;
|
|
22
|
+
navItemId: string;
|
|
23
|
+
/**
|
|
24
|
+
* The surface's bus event names; `refresh` lists extra total-bumping
|
|
25
|
+
* events — AT MOST TWO (hook-count constraints; extras would be
|
|
26
|
+
* silently dropped, so the type forbids them).
|
|
27
|
+
*/
|
|
28
|
+
events: {
|
|
29
|
+
chunk: string;
|
|
30
|
+
done: string;
|
|
31
|
+
error: string;
|
|
32
|
+
started?: string;
|
|
33
|
+
refresh?: [string] | [string, string];
|
|
34
|
+
};
|
|
35
|
+
keyOf: (payload: PluginEventPayload) => string;
|
|
36
|
+
/** The thread key currently on screen ('' = none) — read at event time. */
|
|
37
|
+
visibleKey: () => string;
|
|
38
|
+
/** Fetch unread + in-flight totals; null keeps the previous totals. */
|
|
39
|
+
refreshTotals: () => Promise<ConversationAttentionTotals | null>;
|
|
40
|
+
/** Attention settings at event time. Default: sound + toasts on. */
|
|
41
|
+
settings?: () => {
|
|
42
|
+
sound: boolean;
|
|
43
|
+
toasts: boolean;
|
|
44
|
+
};
|
|
45
|
+
/** Reply toast content; `dismiss` closes it (call before in-app navigation). */
|
|
46
|
+
renderToast: (payload: ConversationDonePayload, dismiss: () => void) => ReactNode | string;
|
|
47
|
+
/**
|
|
48
|
+
* OS notification for a reply that landed while the user was elsewhere;
|
|
49
|
+
* null skips it. Runs only when the done carries a preview (matching
|
|
50
|
+
* chat: silent settles never notify).
|
|
51
|
+
*/
|
|
52
|
+
osNotification: (payload: ConversationDonePayload) => {
|
|
53
|
+
title: string;
|
|
54
|
+
body: string;
|
|
55
|
+
href: string;
|
|
56
|
+
} | null;
|
|
57
|
+
/** Error toast content when a turn fails off-screen; null skips. */
|
|
58
|
+
errorToast?: (payload: PluginEventPayload) => string | null;
|
|
59
|
+
/** Maintain the `(N)` tab-title prefix (chat does; embedded surfaces may skip). */
|
|
60
|
+
titlePrefix?: boolean;
|
|
61
|
+
/** Injectable chime (tests); defaults to the kit reply chime. */
|
|
62
|
+
chime?: () => void;
|
|
63
|
+
}
|
|
64
|
+
export declare function useConversationAttention(config: ConversationAttentionConfig): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
declare const MIN_WIDTH = 320;
|
|
3
|
+
declare const MAX_WIDTH = 960;
|
|
4
|
+
declare const DEFAULT_WIDTH = 810;
|
|
5
|
+
declare const DRAWER_WIDTH_STORAGE_KEY = "bakin-drawer-width";
|
|
6
|
+
declare function clampDrawerWidth(width: number): number;
|
|
7
|
+
declare function getDrawerWidthStorageKey(storageKey?: string): string;
|
|
8
|
+
declare function getStoredDrawerWidth(defaultWidth: number, storageKey?: string): number;
|
|
9
|
+
export interface DrawerProps {
|
|
10
|
+
open: boolean;
|
|
11
|
+
onOpenChange: (open: boolean) => void;
|
|
12
|
+
title?: ReactNode;
|
|
13
|
+
/** Accessible title used when the visible title is intentionally omitted. */
|
|
14
|
+
ariaLabel?: string;
|
|
15
|
+
description?: ReactNode;
|
|
16
|
+
actions?: ReactNode;
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
defaultWidth?: number;
|
|
19
|
+
/** Optional suffix for per-context drawer width persistence. */
|
|
20
|
+
storageKey?: string;
|
|
21
|
+
/** When provided, a back action appears left of the title. */
|
|
22
|
+
onBack?: () => void;
|
|
23
|
+
/** When true, closing the drawer shows an unsaved-changes confirmation. */
|
|
24
|
+
dirty?: boolean;
|
|
25
|
+
/** Prevents escape, outside, close-button, and dirty-confirm dismissal while work is in flight. */
|
|
26
|
+
busy?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export declare function Drawer({ open, onOpenChange, title, ariaLabel, description, actions, children, defaultWidth, storageKey, onBack, dirty, busy, }: DrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export { MIN_WIDTH, MAX_WIDTH, DEFAULT_WIDTH, DRAWER_WIDTH_STORAGE_KEY, clampDrawerWidth, getDrawerWidthStorageKey, getStoredDrawerWidth, };
|
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare const buttonVariants: (props?: ({
|
|
4
|
-
variant?: "destructive" | "link" | "default" | "outline" | "secondary" | "ghost" | "warning" | "accent" | null | undefined;
|
|
5
|
-
size?: "default" | "sm" | "lg" | "icon" | "xs" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
|
-
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
-
declare function Button({ className, variant, size, ...props }: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export { Button, buttonVariants };
|
|
1
|
+
export { Button, buttonVariants } from '../../../host/ui/action-status';
|
|
2
|
+
export type { ButtonProps, ButtonSize, ButtonVariant, ButtonVariantOptions, LegacyButtonSize, LegacyButtonVariant, } from '../../../host/ui/action-status';
|
|
@@ -1,17 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare function Dialog({ ...props }: DialogPrimitive.Root.Props): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare function DialogTrigger({ ...props }: DialogPrimitive.Trigger.Props): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
declare function DialogPortal({ ...props }: DialogPrimitive.Portal.Props): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
declare function DialogClose({ ...props }: DialogPrimitive.Close.Props): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
declare function DialogOverlay({ className, ...props }: DialogPrimitive.Backdrop.Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
declare function DialogContent({ className, children, showCloseButton, ...props }: DialogPrimitive.Popup.Props & {
|
|
9
|
-
showCloseButton?: boolean;
|
|
10
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
declare function DialogFooter({ className, showCloseButton, children, ...props }: React.ComponentProps<"div"> & {
|
|
13
|
-
showCloseButton?: boolean;
|
|
14
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
declare function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props): import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
declare function DialogDescription({ className, ...props }: DialogPrimitive.Description.Props): import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
1
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, UnsavedChangesDialog, } from '../../../host/ui/modals';
|
|
2
|
+
export type { DialogCloseProps, DialogContentProps, DialogDescriptionProps, DialogFooterProps, DialogHeaderProps, DialogOverlayProps, DialogPortalProps, DialogProps, DialogTitleProps, DialogTriggerProps, UnsavedChangesDialogProps, } from '../../../host/ui/modals';
|
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare function Sheet({ ...props }: SheetPrimitive.Root.Props): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
declare function SheetTrigger({ ...props }: SheetPrimitive.Trigger.Props): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
declare function SheetClose({ ...props }: SheetPrimitive.Close.Props): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
declare function SheetContent({ className, children, side, showCloseButton, ...props }: SheetPrimitive.Popup.Props & {
|
|
7
|
-
side?: "top" | "right" | "bottom" | "left";
|
|
8
|
-
showCloseButton?: boolean;
|
|
9
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
declare function SheetHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
declare function SheetFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
declare function SheetTitle({ className, ...props }: SheetPrimitive.Title.Props): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
declare function SheetDescription({ className, ...props }: SheetPrimitive.Description.Props): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, };
|
|
1
|
+
export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, } from '../../../host/ui/modals';
|
|
2
|
+
export type { SheetCloseProps, SheetContentProps, SheetDescriptionProps, SheetFooterProps, SheetHeaderProps, SheetOverlayProps, SheetPortalProps, SheetProps, SheetSide, SheetTitleProps, SheetTriggerProps, } from '../../../host/ui/modals';
|