@makinbakin/sdk 0.0.1-rc.26 → 0.0.1-rc.28
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 +247 -3
- package/_internal/app/components/agent-avatar.d.ts +2 -1
- package/_internal/app/components/conversation/fold.d.ts +3 -129
- 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 +83 -2
- package/_internal/app/core/tool-access.d.ts +42 -0
- package/_internal/app/hooks/use-history-back.d.ts +5 -1
- package/_internal/app/hooks/use-json-fetch.d.ts +13 -3
- package/_internal/app/hooks/use-nav-badge.d.ts +1 -1
- package/_internal/app/hooks/use-query-state.d.ts +3 -14
- package/_internal/core/adapters/runtime/channels.d.ts +231 -0
- package/_internal/core/adapters/runtime/concepts.d.ts +42 -167
- package/_internal/core/adapters/runtime/index.d.ts +2 -1
- package/_internal/core/adapters/runtime/skill-files.d.ts +12 -0
- package/_internal/core/adapters/shared.d.ts +11 -0
- package/_internal/core/delivery/bridge.d.ts +36 -0
- package/_internal/core/format.d.ts +12 -1
- package/_internal/core/plugin-types.d.ts +20 -1
- package/_internal/core/routing/define.d.ts +1 -0
- package/_internal/host/ui/action-status.d.ts +13 -0
- package/_internal/host/ui/modals.d.ts +5 -0
- 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/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 +105 -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/{_internal/app/components/conversation → conversation}/use-conversation-thread.d.ts +21 -3
- package/hooks/index.d.ts +9 -9
- package/hooks/index.js +1 -16243
- package/hooks/router.d.ts +4 -52
- package/index.d.ts +10 -3
- package/index.js +10 -14248
- package/internal/index.d.ts +18 -14
- package/internal/index.js +1 -408
- 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.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 +54 -9
- 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/routing/index.js +10 -14054
- package/slots/index.d.ts +4 -4
- package/slots/index.js +1 -276
- package/slots/registry.d.ts +45 -0
- package/styles.css +2 -0
- package/testing/index.d.ts +1 -1
- package/testing/index.js +56 -21837
- 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 +10 -10
- package/types/index.js +1 -16
- 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 +286 -0
- package/types/scheduled-events.d.ts +80 -0
- package/types/services.d.ts +570 -0
- package/ui/index.d.ts +70 -31
- package/ui/index.js +38 -28705
- package/utils/asset-id.d.ts +15 -0
- package/utils/index.d.ts +5 -10
- package/utils/index.js +4 -2228
- 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 -29
- package/_internal/app/components/agent-status.d.ts +0 -8
- package/_internal/app/components/asset-picker.d.ts +0 -25
- package/_internal/app/components/bakin-drawer.d.ts +0 -23
- package/_internal/app/components/charts/bar-chart.d.ts +0 -16
- package/_internal/app/components/charts/chart-data-table.d.ts +0 -31
- package/_internal/app/components/charts/chart-explainer.d.ts +0 -9
- package/_internal/app/components/charts/line-chart.d.ts +0 -13
- package/_internal/app/components/charts/palette.d.ts +0 -24
- package/_internal/app/components/charts/sparkline.d.ts +0 -12
- package/_internal/app/components/charts/stacked-column-chart.d.ts +0 -40
- package/_internal/app/components/color-picker.d.ts +0 -7
- package/_internal/app/components/confirm-dialog.d.ts +0 -54
- package/_internal/app/components/conversation/activity-group.d.ts +0 -15
- package/_internal/app/components/conversation/agent-turn.d.ts +0 -36
- package/_internal/app/components/conversation/composer.d.ts +0 -35
- package/_internal/app/components/conversation/conversation-empty-state.d.ts +0 -8
- package/_internal/app/components/conversation/conversation-panel.d.ts +0 -33
- package/_internal/app/components/conversation/conversation.d.ts +0 -14
- package/_internal/app/components/conversation/relative-time.d.ts +0 -8
- package/_internal/app/components/conversation/tool-call-drawer.d.ts +0 -7
- package/_internal/app/components/conversation/user-message.d.ts +0 -11
- package/_internal/app/components/danger-zone.d.ts +0 -28
- package/_internal/app/components/empty-state.d.ts +0 -22
- 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/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 -17
- package/_internal/app/components/plugin-settings-renderer.d.ts +0 -9
- package/_internal/app/components/save-bar.d.ts +0 -32
- package/_internal/app/components/score-overlay.d.ts +0 -33
- package/_internal/app/components/search-degraded-chip.d.ts +0 -4
- package/_internal/app/components/search-partial-chip.d.ts +0 -13
- package/_internal/app/components/search-unavailable.d.ts +0 -12
- package/_internal/app/components/section-card.d.ts +0 -22
- package/_internal/app/components/segmented-control.d.ts +0 -28
- package/_internal/app/components/sortable-head.d.ts +0 -13
- package/_internal/app/components/stat-tile.d.ts +0 -26
- package/_internal/app/components/status-badge.d.ts +0 -19
- package/_internal/app/components/turn-output-view.d.ts +0 -57
- 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 -19
- package/_internal/app/components/unsaved-changes-guard.d.ts +0 -34
- 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 -140
- package/components/index.js +0 -71930
- /package/_internal/{app/components → ui}/charts/chart-tooltip.d.ts +0 -0
- /package/_internal/{app/components/ui → ui/primitives}/table.d.ts +0 -0
package/README.md
CHANGED
|
@@ -96,16 +96,260 @@ The public npm package exposes these sub-paths:
|
|
|
96
96
|
| Import path | What it exposes |
|
|
97
97
|
| ------------------------ | -------------------------------------------- |
|
|
98
98
|
| `@makinbakin/sdk` | Plugin registration, route helpers, top-level exports |
|
|
99
|
-
| `@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 |
|
|
100
105
|
| `@makinbakin/sdk/hooks` | Shared React hooks |
|
|
101
|
-
| `@makinbakin/sdk/components` |
|
|
106
|
+
| `@makinbakin/sdk/components` | Migration-only legacy component barrel |
|
|
102
107
|
| `@makinbakin/sdk/slots` | Slot runtime and provider |
|
|
103
108
|
| `@makinbakin/sdk/types` | TypeScript contract types |
|
|
104
109
|
| `@makinbakin/sdk/utils` | Shared utilities |
|
|
105
110
|
| `@makinbakin/sdk/metadata` | Docs-aware contract metadata helpers |
|
|
106
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 |
|
|
107
116
|
|
|
108
|
-
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.
|
|
109
353
|
|
|
110
354
|
## Repository
|
|
111
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 {};
|
|
@@ -1,129 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* Consumes persisted `ConversationMessage` rows plus the in-flight turn's
|
|
5
|
-
* raw `RuntimeChatChunk`s and produces the renderable turn model
|
|
6
|
-
* (`ConversationTurn[]`). Every conversational surface (chat plugin,
|
|
7
|
-
* embedded brainstorm panels, task/workflow turn output) folds through
|
|
8
|
-
* here — never hand-roll chunk heuristics in a component.
|
|
9
|
-
*
|
|
10
|
-
* Semantics (pinned by tests/sdk/conversation-fold.test.ts):
|
|
11
|
-
* - Item ORDER inside a turn is preserved: text and tool-activity items
|
|
12
|
-
* interleave in arrival order. Consecutive tool chunks group into ONE
|
|
13
|
-
* activity item; a text chunk closes the group and later tools start a
|
|
14
|
-
* new one.
|
|
15
|
-
* - Tool call/result pairs match by callId ACROSS group boundaries (a
|
|
16
|
-
* result settles its original call even if text arrived in between).
|
|
17
|
-
* A callId-less result closes the most recent RUNNING call of the same
|
|
18
|
-
* tool; an orphan result settles as its own call.
|
|
19
|
-
* - Consecutive same-format text chunks coalesce; a format change starts
|
|
20
|
-
* a new text item.
|
|
21
|
-
* - The newest status chunk is the streaming label. `done` → complete,
|
|
22
|
-
* `error` → error (with a typed error item). Aborted turns come from
|
|
23
|
-
* persisted `aborted` rows — the stream itself ends aborts with a clean
|
|
24
|
-
* `done` (runtime contract).
|
|
25
|
-
*/
|
|
26
|
-
import type { ChatChunk as RuntimeChatChunk, ChatTextFormat } from '../../../core/adapters/runtime';
|
|
27
|
-
/** Attachment as displayed in a conversation (URL-addressed, not path). */
|
|
28
|
-
export interface DisplayAttachment {
|
|
29
|
-
name: string;
|
|
30
|
-
mimeType: string;
|
|
31
|
-
url: string;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* One persisted conversation row — the kit's storable message shape.
|
|
35
|
-
* The chat plugin's transcript rows serialize to exactly this (plus its
|
|
36
|
-
* own storage concerns); embedded surfaces map their local shapes onto it.
|
|
37
|
-
* `turnId` groups the rows of one agent turn; rows without it (legacy)
|
|
38
|
-
* group by adjacency between user rows.
|
|
39
|
-
*/
|
|
40
|
-
export type ConversationMessage = {
|
|
41
|
-
kind: 'user';
|
|
42
|
-
ts: string;
|
|
43
|
-
content: string;
|
|
44
|
-
attachments?: DisplayAttachment[];
|
|
45
|
-
} | {
|
|
46
|
-
kind: 'assistant';
|
|
47
|
-
ts: string;
|
|
48
|
-
turnId?: string;
|
|
49
|
-
agentId?: string;
|
|
50
|
-
content: string;
|
|
51
|
-
} | {
|
|
52
|
-
kind: 'tool';
|
|
53
|
-
ts: string;
|
|
54
|
-
turnId?: string;
|
|
55
|
-
agentId?: string;
|
|
56
|
-
callId?: string;
|
|
57
|
-
toolName: string;
|
|
58
|
-
status?: 'running' | 'completed' | 'failed' | string;
|
|
59
|
-
summary?: string;
|
|
60
|
-
inputPreview?: string;
|
|
61
|
-
outputPreview?: string;
|
|
62
|
-
durationMs?: number;
|
|
63
|
-
metadata?: Record<string, unknown>;
|
|
64
|
-
} | {
|
|
65
|
-
kind: 'error';
|
|
66
|
-
ts: string;
|
|
67
|
-
turnId?: string;
|
|
68
|
-
message: string;
|
|
69
|
-
errorKind?: string;
|
|
70
|
-
} | {
|
|
71
|
-
kind: 'aborted';
|
|
72
|
-
ts: string;
|
|
73
|
-
turnId?: string;
|
|
74
|
-
};
|
|
75
|
-
/** One tool invocation inside an activity group. */
|
|
76
|
-
export interface ConversationToolCall {
|
|
77
|
-
/** Stable render key (callId when present). */
|
|
78
|
-
key: string;
|
|
79
|
-
callId?: string;
|
|
80
|
-
toolName: string;
|
|
81
|
-
status: 'running' | 'completed' | 'failed';
|
|
82
|
-
summary?: string;
|
|
83
|
-
inputPreview?: string;
|
|
84
|
-
outputPreview?: string;
|
|
85
|
-
durationMs?: number;
|
|
86
|
-
metadata?: Record<string, unknown>;
|
|
87
|
-
}
|
|
88
|
-
export type TurnItem = {
|
|
89
|
-
type: 'text';
|
|
90
|
-
format: ChatTextFormat;
|
|
91
|
-
content: string;
|
|
92
|
-
} | {
|
|
93
|
-
type: 'activity';
|
|
94
|
-
calls: ConversationToolCall[];
|
|
95
|
-
} | {
|
|
96
|
-
type: 'error';
|
|
97
|
-
message: string;
|
|
98
|
-
errorKind?: string;
|
|
99
|
-
};
|
|
100
|
-
export type TurnStatus = 'streaming' | 'complete' | 'error' | 'aborted';
|
|
101
|
-
export type ConversationTurn = {
|
|
102
|
-
kind: 'user';
|
|
103
|
-
key: string;
|
|
104
|
-
ts: string;
|
|
105
|
-
content: string;
|
|
106
|
-
attachments?: DisplayAttachment[];
|
|
107
|
-
} | {
|
|
108
|
-
kind: 'agent';
|
|
109
|
-
key: string;
|
|
110
|
-
ts?: string;
|
|
111
|
-
/** Author agent, when known (multi-agent embedded threads switch mid-conversation). */
|
|
112
|
-
agentId?: string;
|
|
113
|
-
items: TurnItem[];
|
|
114
|
-
status: TurnStatus;
|
|
115
|
-
/** Latest runtime status label ('thinking', …) — meaningful while streaming. */
|
|
116
|
-
statusLabel?: string;
|
|
117
|
-
};
|
|
118
|
-
export interface FoldOptions {
|
|
119
|
-
/** Raw chunks of the in-flight turn; presence (even empty) appends a streaming turn. */
|
|
120
|
-
liveChunks?: readonly RuntimeChatChunk[];
|
|
121
|
-
/** Author of the live turn, when known. */
|
|
122
|
-
liveAgentId?: string;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Fold persisted rows + optional live chunks into the renderable turn list.
|
|
126
|
-
* Pure — same inputs, same output (keys are derived from row position, so
|
|
127
|
-
* they're stable across re-folds).
|
|
128
|
-
*/
|
|
129
|
-
export declare function foldConversation(messages: readonly ConversationMessage[], opts?: FoldOptions): ConversationTurn[];
|
|
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,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?: "warning" | "destructive" | "info" | "default" | "link" | "outline" | "secondary" | "ghost" | "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';
|
|
@@ -7,6 +7,14 @@ export interface TurnAttachment {
|
|
|
7
7
|
mimeType: string;
|
|
8
8
|
path: string;
|
|
9
9
|
}
|
|
10
|
+
export declare function isRasterAttachment(a: TurnAttachment): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* THE file-lane note generator (#742) — every chat-like surface (web
|
|
13
|
+
* composer, Discord inbound) converges here; never hand-roll this note.
|
|
14
|
+
* PDFs point at the blessed pdf tool rendered in the active runtime's
|
|
15
|
+
* calling style; other files get the generic file-tools wording.
|
|
16
|
+
*/
|
|
17
|
+
export declare function fileLaneNote(a: TurnAttachment, agentId: string, renderCall?: (tool: string, args: string) => string): string;
|
|
10
18
|
/**
|
|
11
19
|
* The durable transcript row shape (identical to chat's schema-v2 rows —
|
|
12
20
|
* user attachments are path-addressed server-side; display URLs are a
|
|
@@ -44,12 +52,42 @@ export type ConversationTurnRow = {
|
|
|
44
52
|
kind: 'aborted';
|
|
45
53
|
ts: string;
|
|
46
54
|
turnId?: string;
|
|
55
|
+
} | {
|
|
56
|
+
kind: 'done';
|
|
57
|
+
ts: string;
|
|
58
|
+
turnId?: string;
|
|
47
59
|
};
|
|
48
60
|
export interface TurnOutcome {
|
|
49
61
|
aborted: boolean;
|
|
50
62
|
errored: boolean;
|
|
51
63
|
}
|
|
52
|
-
export type StartTurnResult = 'accepted' | 'not_found' | 'busy';
|
|
64
|
+
export type StartTurnResult = 'accepted' | 'not_found' | 'busy' | QueuedStart;
|
|
65
|
+
/**
|
|
66
|
+
* The queued acceptance (#729) — captured synchronously at push time so
|
|
67
|
+
* callers get THEIR item's id, never a tail re-read that a concurrent
|
|
68
|
+
* enqueue could poison (review finding: the awaited persist can park
|
|
69
|
+
* behind streaming transcript writes, making post-await reads stale).
|
|
70
|
+
*/
|
|
71
|
+
export interface QueuedStart {
|
|
72
|
+
queued: true;
|
|
73
|
+
queueId: string;
|
|
74
|
+
queueLength: number;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* A message accepted while the slot was busy (#729). Queued messages are a
|
|
78
|
+
* consumer-durable snapshot (the `queue.persist` hook) and drain as ONE
|
|
79
|
+
* combined turn when the active turn settles — done, error, and abort all
|
|
80
|
+
* drain. `agentId` is the agent resolved at enqueue time; the drain's
|
|
81
|
+
* synchronous slot reservation uses it, then refreshes from resolveThread
|
|
82
|
+
* before the runtime call.
|
|
83
|
+
*/
|
|
84
|
+
export interface QueuedMessage {
|
|
85
|
+
id: string;
|
|
86
|
+
ts: string;
|
|
87
|
+
content: string;
|
|
88
|
+
agentId: string;
|
|
89
|
+
attachments?: TurnAttachment[];
|
|
90
|
+
}
|
|
53
91
|
export interface InflightTurnInfo {
|
|
54
92
|
key: string;
|
|
55
93
|
agentId: string;
|
|
@@ -89,6 +127,29 @@ export interface ConversationTurnServiceConfig {
|
|
|
89
127
|
framing?: string;
|
|
90
128
|
/** Run turns as ephemeral runtime sessions (no provider-side accumulation). */
|
|
91
129
|
ephemeral?: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* Persist an invisible `{kind:'done'}` marker row at clean success settle
|
|
132
|
+
* (#735). Abort/error settles already end on their own terminal rows, so
|
|
133
|
+
* with this on EVERY settled turn ends on a terminal row — the evidence a
|
|
134
|
+
* boot sweep needs to stamp partial-output deaths without ever falsely
|
|
135
|
+
* marking a completed turn. Chat-style sweepable transcripts only:
|
|
136
|
+
* bounded stores (brands' 300-row brainstorm array) would evict real
|
|
137
|
+
* rows, and foreign zod schemas would reject the kind.
|
|
138
|
+
*/
|
|
139
|
+
terminalMarkerRows?: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Opt-in pending queue (#729). Without this, a busy slot always answers
|
|
142
|
+
* `'busy'` — strict surfaces are unchanged.
|
|
143
|
+
*/
|
|
144
|
+
queue?: {
|
|
145
|
+
/**
|
|
146
|
+
* Full-snapshot persistence after every queue mutation — the restart
|
|
147
|
+
* durability promise. Failures are logged, never thrown to callers.
|
|
148
|
+
*/
|
|
149
|
+
persist?: (key: string, items: QueuedMessage[]) => void | Promise<void>;
|
|
150
|
+
/** Bus event emitted on enqueue (payload + queueId + queueLength). */
|
|
151
|
+
event?: string;
|
|
152
|
+
};
|
|
92
153
|
hooks?: {
|
|
93
154
|
/** Read-only tap on EVERY runtime chunk (e.g. messaging proposal parsing). */
|
|
94
155
|
onChunk?: (key: string, chunk: ChatChunk) => void;
|
|
@@ -121,6 +182,15 @@ export interface StartTurnOptions {
|
|
|
121
182
|
attachments?: TurnAttachment[];
|
|
122
183
|
/** Per-turn agent override (surfaces with an agent picker); default = resolveThread's. */
|
|
123
184
|
agentId?: string;
|
|
185
|
+
/**
|
|
186
|
+
* Busy slot → enqueue instead of `'busy'` (requires `config.queue`).
|
|
187
|
+
* The busy-check and enqueue happen in one synchronous block (no TOCTOU).
|
|
188
|
+
* CAVEAT: a QUEUED send keeps only content + attachments — a per-turn
|
|
189
|
+
* `agentId` override and `runtimeContent` are DISCARDED at drain time
|
|
190
|
+
* (the combined turn resolves the thread's agent fresh and joins clean
|
|
191
|
+
* content). Surfaces that need either must not opt into queueing.
|
|
192
|
+
*/
|
|
193
|
+
queueIfBusy?: boolean;
|
|
124
194
|
/**
|
|
125
195
|
* Pre-assembled runtime content for THIS turn (embedded surfaces inject
|
|
126
196
|
* doc/context prompts here). The persisted user row always keeps the
|
|
@@ -130,8 +200,19 @@ export interface StartTurnOptions {
|
|
|
130
200
|
}
|
|
131
201
|
export interface ConversationTurnService {
|
|
132
202
|
start(ctx: TurnContext, key: string, content: string, opts?: StartTurnOptions): Promise<StartTurnResult>;
|
|
133
|
-
/** Abort the in-flight turn; false when the thread is idle. */
|
|
203
|
+
/** Abort the in-flight turn; false when the thread is idle. Queued messages stay — they drain at settle. */
|
|
134
204
|
abort(key: string): boolean;
|
|
205
|
+
/** Snapshot of the pending queue (empty for strict surfaces). */
|
|
206
|
+
listQueued(key: string): QueuedMessage[];
|
|
207
|
+
/** Remove one queued message by id; persists. False when absent. */
|
|
208
|
+
removeQueued(key: string, id: string): boolean;
|
|
209
|
+
/** Drop the whole queue (delete-thread path); persists empty. */
|
|
210
|
+
clearQueue(key: string): void;
|
|
211
|
+
/**
|
|
212
|
+
* Seed the queue from persisted state (boot path) and drain immediately
|
|
213
|
+
* when the slot is idle. Does NOT re-persist — the items came from disk.
|
|
214
|
+
*/
|
|
215
|
+
restore(ctx: TurnContext, key: string, items: QueuedMessage[]): void;
|
|
135
216
|
isInFlight(key: string): boolean;
|
|
136
217
|
/** Assistant text streamed so far for the in-flight turn (null when idle) —
|
|
137
218
|
* lets GET responses seed mid-turn rehydration without the missing-start gap. */
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ONE renderer for a runtime's tool-access instructions (P1.2).
|
|
3
|
+
*
|
|
4
|
+
* A runtime declares HOW its agents reach Bakin's `bakin_exec_*` tools via
|
|
5
|
+
* `describeToolAccess()` → {@link RuntimeToolAccess}. This module turns that
|
|
6
|
+
* declaration into the agent-facing instruction block. Both the projected
|
|
7
|
+
* AGENTS.md role layer and the per-dispatch prompt render through here (P1.4),
|
|
8
|
+
* so the two surfaces can never drift.
|
|
9
|
+
*
|
|
10
|
+
* Style intent:
|
|
11
|
+
* - `in-process` — exec tools are first-class session tools; bare calls,
|
|
12
|
+
* no cheat-sheet (the agent discovers the live set).
|
|
13
|
+
* - `mcp` — tools appear as native MCP tools under a per-agent
|
|
14
|
+
* server; prefixed calls, still discovered live.
|
|
15
|
+
* - `cli-shim` — tools are reached through a shell command; the exhaustive
|
|
16
|
+
* cheat-sheet IS warranted here because the invocation is
|
|
17
|
+
* non-obvious and easy to get wrong.
|
|
18
|
+
*/
|
|
19
|
+
import type { RuntimeToolAccess } from '../../core/adapters/runtime';
|
|
20
|
+
export interface ToolAccessRenderOptions {
|
|
21
|
+
/** Agent whose per-agent server / shim names to substitute (mcp, cli-shim). */
|
|
22
|
+
agentId: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Render ONE tool invocation in the runtime's style — the primitive shared by
|
|
26
|
+
* both the standing tool-access block (below) and the per-dispatch prompt
|
|
27
|
+
* authors, so invocation bytes cannot drift between the two surfaces.
|
|
28
|
+
* - in-process → `bakin_exec_x arg=1`
|
|
29
|
+
* - mcp → `bakin-<agent>.bakin_exec_x arg=1`
|
|
30
|
+
* - cli-shim → the shim command with `<tool>`/`<args>` filled in
|
|
31
|
+
* `args` may be empty (trailing space is trimmed).
|
|
32
|
+
*/
|
|
33
|
+
export declare function renderToolCall(access: RuntimeToolAccess, opts: {
|
|
34
|
+
agentId: string;
|
|
35
|
+
tool: string;
|
|
36
|
+
args?: string;
|
|
37
|
+
}): string;
|
|
38
|
+
/**
|
|
39
|
+
* Render the runtime-specific tool-access instruction block for `agentId`.
|
|
40
|
+
* Returns a single markdown string (no trailing newline).
|
|
41
|
+
*/
|
|
42
|
+
export declare function renderToolAccessInstructions(access: RuntimeToolAccess, opts: ToolAccessRenderOptions): string;
|