@vendoai/ui 0.4.0
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/LICENSE +202 -0
- package/README.md +7 -0
- package/dist/chrome/activity-ledger.d.ts +14 -0
- package/dist/chrome/activity-ledger.d.ts.map +1 -0
- package/dist/chrome/activity-ledger.js +40 -0
- package/dist/chrome/activity-ledger.js.map +1 -0
- package/dist/chrome/activity-panel.d.ts +7 -0
- package/dist/chrome/activity-panel.d.ts.map +1 -0
- package/dist/chrome/activity-panel.js +27 -0
- package/dist/chrome/activity-panel.js.map +1 -0
- package/dist/chrome/activity-semantics.d.ts +42 -0
- package/dist/chrome/activity-semantics.d.ts.map +1 -0
- package/dist/chrome/activity-semantics.js +119 -0
- package/dist/chrome/activity-semantics.js.map +1 -0
- package/dist/chrome/approval-card.d.ts +22 -0
- package/dist/chrome/approval-card.d.ts.map +1 -0
- package/dist/chrome/approval-card.js +95 -0
- package/dist/chrome/approval-card.js.map +1 -0
- package/dist/chrome/approval-sheet.d.ts +23 -0
- package/dist/chrome/approval-sheet.d.ts.map +1 -0
- package/dist/chrome/approval-sheet.js +72 -0
- package/dist/chrome/approval-sheet.js.map +1 -0
- package/dist/chrome/automations-panel.d.ts +3 -0
- package/dist/chrome/automations-panel.d.ts.map +1 -0
- package/dist/chrome/automations-panel.js +305 -0
- package/dist/chrome/automations-panel.js.map +1 -0
- package/dist/chrome/build-beat.d.ts +70 -0
- package/dist/chrome/build-beat.d.ts.map +1 -0
- package/dist/chrome/build-beat.js +101 -0
- package/dist/chrome/build-beat.js.map +1 -0
- package/dist/chrome/chrome-css.d.ts +7 -0
- package/dist/chrome/chrome-css.d.ts.map +1 -0
- package/dist/chrome/chrome-css.js +2042 -0
- package/dist/chrome/chrome-css.js.map +1 -0
- package/dist/chrome/chrome-root.d.ts +13 -0
- package/dist/chrome/chrome-root.d.ts.map +1 -0
- package/dist/chrome/chrome-root.js +39 -0
- package/dist/chrome/chrome-root.js.map +1 -0
- package/dist/chrome/clipboard.d.ts +4 -0
- package/dist/chrome/clipboard.d.ts.map +1 -0
- package/dist/chrome/clipboard.js +49 -0
- package/dist/chrome/clipboard.js.map +1 -0
- package/dist/chrome/connect-card.d.ts +19 -0
- package/dist/chrome/connect-card.d.ts.map +1 -0
- package/dist/chrome/connect-card.js +57 -0
- package/dist/chrome/connect-card.js.map +1 -0
- package/dist/chrome/connect-dock.d.ts +25 -0
- package/dist/chrome/connect-dock.d.ts.map +1 -0
- package/dist/chrome/connect-dock.js +192 -0
- package/dist/chrome/connect-dock.js.map +1 -0
- package/dist/chrome/connected-accounts-panel.d.ts +14 -0
- package/dist/chrome/connected-accounts-panel.d.ts.map +1 -0
- package/dist/chrome/connected-accounts-panel.js +157 -0
- package/dist/chrome/connected-accounts-panel.js.map +1 -0
- package/dist/chrome/dev-mode.d.ts +5 -0
- package/dist/chrome/dev-mode.d.ts.map +1 -0
- package/dist/chrome/dev-mode.js +7 -0
- package/dist/chrome/dev-mode.js.map +1 -0
- package/dist/chrome/discoverability.d.ts +33 -0
- package/dist/chrome/discoverability.d.ts.map +1 -0
- package/dist/chrome/discoverability.js +63 -0
- package/dist/chrome/discoverability.js.map +1 -0
- package/dist/chrome/embeds.d.ts +21 -0
- package/dist/chrome/embeds.d.ts.map +1 -0
- package/dist/chrome/embeds.js +181 -0
- package/dist/chrome/embeds.js.map +1 -0
- package/dist/chrome/fluid-thinking.d.ts +15 -0
- package/dist/chrome/fluid-thinking.d.ts.map +1 -0
- package/dist/chrome/fluid-thinking.js +37 -0
- package/dist/chrome/fluid-thinking.js.map +1 -0
- package/dist/chrome/humanize.d.ts +46 -0
- package/dist/chrome/humanize.d.ts.map +1 -0
- package/dist/chrome/humanize.js +104 -0
- package/dist/chrome/humanize.js.map +1 -0
- package/dist/chrome/index.d.ts +39 -0
- package/dist/chrome/index.d.ts.map +1 -0
- package/dist/chrome/index.js +38 -0
- package/dist/chrome/index.js.map +1 -0
- package/dist/chrome/markdown.d.ts +23 -0
- package/dist/chrome/markdown.d.ts.map +1 -0
- package/dist/chrome/markdown.js +149 -0
- package/dist/chrome/markdown.js.map +1 -0
- package/dist/chrome/morph-toast.d.ts +43 -0
- package/dist/chrome/morph-toast.d.ts.map +1 -0
- package/dist/chrome/morph-toast.js +89 -0
- package/dist/chrome/morph-toast.js.map +1 -0
- package/dist/chrome/no-policy-notice.d.ts +8 -0
- package/dist/chrome/no-policy-notice.d.ts.map +1 -0
- package/dist/chrome/no-policy-notice.js +18 -0
- package/dist/chrome/no-policy-notice.js.map +1 -0
- package/dist/chrome/onest-font.gen.d.ts +10 -0
- package/dist/chrome/onest-font.gen.d.ts.map +1 -0
- package/dist/chrome/onest-font.gen.js +10 -0
- package/dist/chrome/onest-font.gen.js.map +1 -0
- package/dist/chrome/overlay-registry.d.ts +66 -0
- package/dist/chrome/overlay-registry.d.ts.map +1 -0
- package/dist/chrome/overlay-registry.js +103 -0
- package/dist/chrome/overlay-registry.js.map +1 -0
- package/dist/chrome/palette-hotkey.d.ts +42 -0
- package/dist/chrome/palette-hotkey.d.ts.map +1 -0
- package/dist/chrome/palette-hotkey.js +91 -0
- package/dist/chrome/palette-hotkey.js.map +1 -0
- package/dist/chrome/policy-notice-body.d.ts +3 -0
- package/dist/chrome/policy-notice-body.d.ts.map +1 -0
- package/dist/chrome/policy-notice-body.js +6 -0
- package/dist/chrome/policy-notice-body.js.map +1 -0
- package/dist/chrome/takeover-portal.d.ts +16 -0
- package/dist/chrome/takeover-portal.d.ts.map +1 -0
- package/dist/chrome/takeover-portal.js +21 -0
- package/dist/chrome/takeover-portal.js.map +1 -0
- package/dist/chrome/thread/attachments.d.ts +24 -0
- package/dist/chrome/thread/attachments.d.ts.map +1 -0
- package/dist/chrome/thread/attachments.js +50 -0
- package/dist/chrome/thread/attachments.js.map +1 -0
- package/dist/chrome/thread/composer.d.ts +63 -0
- package/dist/chrome/thread/composer.d.ts.map +1 -0
- package/dist/chrome/thread/composer.js +259 -0
- package/dist/chrome/thread/composer.js.map +1 -0
- package/dist/chrome/thread/index.d.ts +41 -0
- package/dist/chrome/thread/index.d.ts.map +1 -0
- package/dist/chrome/thread/index.js +258 -0
- package/dist/chrome/thread/index.js.map +1 -0
- package/dist/chrome/thread/message-data.d.ts +35 -0
- package/dist/chrome/thread/message-data.d.ts.map +1 -0
- package/dist/chrome/thread/message-data.js +127 -0
- package/dist/chrome/thread/message-data.js.map +1 -0
- package/dist/chrome/thread/message-list.d.ts +30 -0
- package/dist/chrome/thread/message-list.d.ts.map +1 -0
- package/dist/chrome/thread/message-list.js +11 -0
- package/dist/chrome/thread/message-list.js.map +1 -0
- package/dist/chrome/thread/message.d.ts +18 -0
- package/dist/chrome/thread/message.d.ts.map +1 -0
- package/dist/chrome/thread/message.js +57 -0
- package/dist/chrome/thread/message.js.map +1 -0
- package/dist/chrome/thread/parts.d.ts +53 -0
- package/dist/chrome/thread/parts.d.ts.map +1 -0
- package/dist/chrome/thread/parts.js +184 -0
- package/dist/chrome/thread/parts.js.map +1 -0
- package/dist/chrome/thread/scrolling.d.ts +26 -0
- package/dist/chrome/thread/scrolling.d.ts.map +1 -0
- package/dist/chrome/thread/scrolling.js +214 -0
- package/dist/chrome/thread/scrolling.js.map +1 -0
- package/dist/chrome/truncate.d.ts +12 -0
- package/dist/chrome/truncate.d.ts.map +1 -0
- package/dist/chrome/truncate.js +18 -0
- package/dist/chrome/truncate.js.map +1 -0
- package/dist/chrome/vendo-activities.d.ts +24 -0
- package/dist/chrome/vendo-activities.d.ts.map +1 -0
- package/dist/chrome/vendo-activities.js +38 -0
- package/dist/chrome/vendo-activities.js.map +1 -0
- package/dist/chrome/vendo-overlay.d.ts +63 -0
- package/dist/chrome/vendo-overlay.d.ts.map +1 -0
- package/dist/chrome/vendo-overlay.js +256 -0
- package/dist/chrome/vendo-overlay.js.map +1 -0
- package/dist/chrome/vendo-page.d.ts +3 -0
- package/dist/chrome/vendo-page.d.ts.map +1 -0
- package/dist/chrome/vendo-page.js +162 -0
- package/dist/chrome/vendo-page.js.map +1 -0
- package/dist/chrome/vendo-palette.d.ts +29 -0
- package/dist/chrome/vendo-palette.d.ts.map +1 -0
- package/dist/chrome/vendo-palette.js +95 -0
- package/dist/chrome/vendo-palette.js.map +1 -0
- package/dist/chrome/vendo-slot.d.ts +79 -0
- package/dist/chrome/vendo-slot.d.ts.map +1 -0
- package/dist/chrome/vendo-slot.js +153 -0
- package/dist/chrome/vendo-slot.js.map +1 -0
- package/dist/chrome/vendo-toasts.d.ts +40 -0
- package/dist/chrome/vendo-toasts.d.ts.map +1 -0
- package/dist/chrome/vendo-toasts.js +135 -0
- package/dist/chrome/vendo-toasts.js.map +1 -0
- package/dist/chrome/vendo-trigger.d.ts +24 -0
- package/dist/chrome/vendo-trigger.d.ts.map +1 -0
- package/dist/chrome/vendo-trigger.js +30 -0
- package/dist/chrome/vendo-trigger.js.map +1 -0
- package/dist/chrome/waiting-queue.d.ts +8 -0
- package/dist/chrome/waiting-queue.d.ts.map +1 -0
- package/dist/chrome/waiting-queue.js +21 -0
- package/dist/chrome/waiting-queue.js.map +1 -0
- package/dist/client-impl.d.ts +4 -0
- package/dist/client-impl.d.ts.map +1 -0
- package/dist/client-impl.js +160 -0
- package/dist/client-impl.js.map +1 -0
- package/dist/client.d.ts +136 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +2 -0
- package/dist/client.js.map +1 -0
- package/dist/context.d.ts +97 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +71 -0
- package/dist/context.js.map +1 -0
- package/dist/eject-templates/activities/index.tsx +113 -0
- package/dist/eject-templates/templates.json +29 -0
- package/dist/eject-templates/thread/attachments.tsx +69 -0
- package/dist/eject-templates/thread/composer.tsx +409 -0
- package/dist/eject-templates/thread/index.tsx +422 -0
- package/dist/eject-templates/thread/message-data.ts +151 -0
- package/dist/eject-templates/thread/message-list.tsx +123 -0
- package/dist/eject-templates/thread/message.tsx +149 -0
- package/dist/eject-templates/thread/parts.tsx +293 -0
- package/dist/eject-templates/thread/scrolling.ts +223 -0
- package/dist/embeds.d.ts +28 -0
- package/dist/embeds.d.ts.map +1 -0
- package/dist/embeds.js +2 -0
- package/dist/embeds.js.map +1 -0
- package/dist/hooks/index.d.ts +18 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +19 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/scripted-transport.d.ts +44 -0
- package/dist/hooks/scripted-transport.d.ts.map +1 -0
- package/dist/hooks/scripted-transport.js +58 -0
- package/dist/hooks/scripted-transport.js.map +1 -0
- package/dist/hooks/use-activity.d.ts +17 -0
- package/dist/hooks/use-activity.d.ts.map +1 -0
- package/dist/hooks/use-activity.js +50 -0
- package/dist/hooks/use-activity.js.map +1 -0
- package/dist/hooks/use-app.d.ts +19 -0
- package/dist/hooks/use-app.d.ts.map +1 -0
- package/dist/hooks/use-app.js +66 -0
- package/dist/hooks/use-app.js.map +1 -0
- package/dist/hooks/use-approvals.d.ts +13 -0
- package/dist/hooks/use-approvals.d.ts.map +1 -0
- package/dist/hooks/use-approvals.js +14 -0
- package/dist/hooks/use-approvals.js.map +1 -0
- package/dist/hooks/use-apps.d.ts +17 -0
- package/dist/hooks/use-apps.d.ts.map +1 -0
- package/dist/hooks/use-apps.js +30 -0
- package/dist/hooks/use-apps.js.map +1 -0
- package/dist/hooks/use-automations.d.ts +25 -0
- package/dist/hooks/use-automations.d.ts.map +1 -0
- package/dist/hooks/use-automations.js +30 -0
- package/dist/hooks/use-automations.js.map +1 -0
- package/dist/hooks/use-connections.d.ts +12 -0
- package/dist/hooks/use-connections.d.ts.map +1 -0
- package/dist/hooks/use-connections.js +15 -0
- package/dist/hooks/use-connections.js.map +1 -0
- package/dist/hooks/use-connector-catalog.d.ts +8 -0
- package/dist/hooks/use-connector-catalog.d.ts.map +1 -0
- package/dist/hooks/use-connector-catalog.js +52 -0
- package/dist/hooks/use-connector-catalog.js.map +1 -0
- package/dist/hooks/use-grants.d.ts +13 -0
- package/dist/hooks/use-grants.d.ts.map +1 -0
- package/dist/hooks/use-grants.js +14 -0
- package/dist/hooks/use-grants.js.map +1 -0
- package/dist/hooks/use-mobile-takeover.d.ts +22 -0
- package/dist/hooks/use-mobile-takeover.d.ts.map +1 -0
- package/dist/hooks/use-mobile-takeover.js +66 -0
- package/dist/hooks/use-mobile-takeover.js.map +1 -0
- package/dist/hooks/use-resource.d.ts +21 -0
- package/dist/hooks/use-resource.d.ts.map +1 -0
- package/dist/hooks/use-resource.js +79 -0
- package/dist/hooks/use-resource.js.map +1 -0
- package/dist/hooks/use-slot-app.d.ts +19 -0
- package/dist/hooks/use-slot-app.d.ts.map +1 -0
- package/dist/hooks/use-slot-app.js +18 -0
- package/dist/hooks/use-slot-app.js.map +1 -0
- package/dist/hooks/use-threads.d.ts +16 -0
- package/dist/hooks/use-threads.d.ts.map +1 -0
- package/dist/hooks/use-threads.js +15 -0
- package/dist/hooks/use-threads.js.map +1 -0
- package/dist/hooks/use-vendo-overlay.d.ts +31 -0
- package/dist/hooks/use-vendo-overlay.d.ts.map +1 -0
- package/dist/hooks/use-vendo-overlay.js +23 -0
- package/dist/hooks/use-vendo-overlay.js.map +1 -0
- package/dist/hooks/use-vendo-status.d.ts +6 -0
- package/dist/hooks/use-vendo-status.d.ts.map +1 -0
- package/dist/hooks/use-vendo-status.js +28 -0
- package/dist/hooks/use-vendo-status.js.map +1 -0
- package/dist/hooks/use-vendo-thread.d.ts +39 -0
- package/dist/hooks/use-vendo-thread.d.ts.map +1 -0
- package/dist/hooks/use-vendo-thread.js +185 -0
- package/dist/hooks/use-vendo-thread.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/kit/charts/bar.d.ts +16 -0
- package/dist/kit/charts/bar.d.ts.map +1 -0
- package/dist/kit/charts/bar.js +21 -0
- package/dist/kit/charts/bar.js.map +1 -0
- package/dist/kit/charts/donut.d.ts +16 -0
- package/dist/kit/charts/donut.d.ts.map +1 -0
- package/dist/kit/charts/donut.js +17 -0
- package/dist/kit/charts/donut.js.map +1 -0
- package/dist/kit/charts/line.d.ts +19 -0
- package/dist/kit/charts/line.d.ts.map +1 -0
- package/dist/kit/charts/line.js +21 -0
- package/dist/kit/charts/line.js.map +1 -0
- package/dist/kit/charts/progress.d.ts +12 -0
- package/dist/kit/charts/progress.d.ts.map +1 -0
- package/dist/kit/charts/progress.js +25 -0
- package/dist/kit/charts/progress.js.map +1 -0
- package/dist/kit/charts/sanitize.d.ts +24 -0
- package/dist/kit/charts/sanitize.d.ts.map +1 -0
- package/dist/kit/charts/sanitize.js +50 -0
- package/dist/kit/charts/sanitize.js.map +1 -0
- package/dist/kit/charts/sparkline.d.ts +11 -0
- package/dist/kit/charts/sparkline.d.ts.map +1 -0
- package/dist/kit/charts/sparkline.js +17 -0
- package/dist/kit/charts/sparkline.js.map +1 -0
- package/dist/kit/data/badge.d.ts +13 -0
- package/dist/kit/data/badge.d.ts.map +1 -0
- package/dist/kit/data/badge.js +12 -0
- package/dist/kit/data/badge.js.map +1 -0
- package/dist/kit/data/card-list.d.ts +23 -0
- package/dist/kit/data/card-list.d.ts.map +1 -0
- package/dist/kit/data/card-list.js +43 -0
- package/dist/kit/data/card-list.js.map +1 -0
- package/dist/kit/data/data-table.d.ts +32 -0
- package/dist/kit/data/data-table.d.ts.map +1 -0
- package/dist/kit/data/data-table.js +153 -0
- package/dist/kit/data/data-table.js.map +1 -0
- package/dist/kit/data/stat.d.ts +15 -0
- package/dist/kit/data/stat.d.ts.map +1 -0
- package/dist/kit/data/stat.js +28 -0
- package/dist/kit/data/stat.js.map +1 -0
- package/dist/kit/feedback/accordion.d.ts +15 -0
- package/dist/kit/feedback/accordion.d.ts.map +1 -0
- package/dist/kit/feedback/accordion.js +33 -0
- package/dist/kit/feedback/accordion.js.map +1 -0
- package/dist/kit/feedback/callout.d.ts +13 -0
- package/dist/kit/feedback/callout.d.ts.map +1 -0
- package/dist/kit/feedback/callout.js +24 -0
- package/dist/kit/feedback/callout.js.map +1 -0
- package/dist/kit/feedback/tabs.d.ts +14 -0
- package/dist/kit/feedback/tabs.d.ts.map +1 -0
- package/dist/kit/feedback/tabs.js +37 -0
- package/dist/kit/feedback/tabs.js.map +1 -0
- package/dist/kit/format.d.ts +60 -0
- package/dist/kit/format.d.ts.map +1 -0
- package/dist/kit/format.js +123 -0
- package/dist/kit/format.js.map +1 -0
- package/dist/kit/forms/button.d.ts +17 -0
- package/dist/kit/forms/button.d.ts.map +1 -0
- package/dist/kit/forms/button.js +33 -0
- package/dist/kit/forms/button.js.map +1 -0
- package/dist/kit/forms/checkbox.d.ts +9 -0
- package/dist/kit/forms/checkbox.d.ts.map +1 -0
- package/dist/kit/forms/checkbox.js +9 -0
- package/dist/kit/forms/checkbox.js.map +1 -0
- package/dist/kit/forms/date-picker.d.ts +13 -0
- package/dist/kit/forms/date-picker.d.ts.map +1 -0
- package/dist/kit/forms/date-picker.js +9 -0
- package/dist/kit/forms/date-picker.js.map +1 -0
- package/dist/kit/forms/disclaimer.d.ts +8 -0
- package/dist/kit/forms/disclaimer.d.ts.map +1 -0
- package/dist/kit/forms/disclaimer.js +20 -0
- package/dist/kit/forms/disclaimer.js.map +1 -0
- package/dist/kit/forms/field.d.ts +18 -0
- package/dist/kit/forms/field.d.ts.map +1 -0
- package/dist/kit/forms/field.js +19 -0
- package/dist/kit/forms/field.js.map +1 -0
- package/dist/kit/forms/form.d.ts +10 -0
- package/dist/kit/forms/form.d.ts.map +1 -0
- package/dist/kit/forms/form.js +9 -0
- package/dist/kit/forms/form.js.map +1 -0
- package/dist/kit/forms/input.d.ts +14 -0
- package/dist/kit/forms/input.d.ts.map +1 -0
- package/dist/kit/forms/input.js +9 -0
- package/dist/kit/forms/input.js.map +1 -0
- package/dist/kit/forms/select.d.ts +21 -0
- package/dist/kit/forms/select.d.ts.map +1 -0
- package/dist/kit/forms/select.js +35 -0
- package/dist/kit/forms/select.js.map +1 -0
- package/dist/kit/forms/textarea.d.ts +12 -0
- package/dist/kit/forms/textarea.d.ts.map +1 -0
- package/dist/kit/forms/textarea.js +9 -0
- package/dist/kit/forms/textarea.js.map +1 -0
- package/dist/kit/index.d.ts +42 -0
- package/dist/kit/index.d.ts.map +1 -0
- package/dist/kit/index.js +45 -0
- package/dist/kit/index.js.map +1 -0
- package/dist/kit/kit-prompt.d.ts +7 -0
- package/dist/kit/kit-prompt.d.ts.map +1 -0
- package/dist/kit/kit-prompt.js +7 -0
- package/dist/kit/kit-prompt.js.map +1 -0
- package/dist/kit/layout.d.ts +29 -0
- package/dist/kit/layout.d.ts.map +1 -0
- package/dist/kit/layout.js +64 -0
- package/dist/kit/layout.js.map +1 -0
- package/dist/kit/registry.d.ts +11 -0
- package/dist/kit/registry.d.ts.map +1 -0
- package/dist/kit/registry.js +34 -0
- package/dist/kit/registry.js.map +1 -0
- package/dist/kit/schema.d.ts +9 -0
- package/dist/kit/schema.d.ts.map +1 -0
- package/dist/kit/schema.js +9 -0
- package/dist/kit/schema.js.map +1 -0
- package/dist/kit/tokens.d.ts +33 -0
- package/dist/kit/tokens.d.ts.map +1 -0
- package/dist/kit/tokens.js +48 -0
- package/dist/kit/tokens.js.map +1 -0
- package/dist/kit/values.d.ts +55 -0
- package/dist/kit/values.d.ts.map +1 -0
- package/dist/kit/values.js +108 -0
- package/dist/kit/values.js.map +1 -0
- package/dist/theme.d.ts +25 -0
- package/dist/theme.d.ts.map +1 -0
- package/dist/theme.js +100 -0
- package/dist/theme.js.map +1 -0
- package/dist/tree/bindings.d.ts +4 -0
- package/dist/tree/bindings.d.ts.map +1 -0
- package/dist/tree/bindings.js +20 -0
- package/dist/tree/bindings.js.map +1 -0
- package/dist/tree/branded.d.ts +124 -0
- package/dist/tree/branded.d.ts.map +1 -0
- package/dist/tree/branded.js +319 -0
- package/dist/tree/branded.js.map +1 -0
- package/dist/tree/error-boundary.d.ts +22 -0
- package/dist/tree/error-boundary.d.ts.map +1 -0
- package/dist/tree/error-boundary.js +25 -0
- package/dist/tree/error-boundary.js.map +1 -0
- package/dist/tree/fluid-reveal.d.ts +22 -0
- package/dist/tree/fluid-reveal.d.ts.map +1 -0
- package/dist/tree/fluid-reveal.js +28 -0
- package/dist/tree/fluid-reveal.js.map +1 -0
- package/dist/tree/forming-skeleton.d.ts +14 -0
- package/dist/tree/forming-skeleton.d.ts.map +1 -0
- package/dist/tree/forming-skeleton.js +36 -0
- package/dist/tree/forming-skeleton.js.map +1 -0
- package/dist/tree/frames.d.ts +52 -0
- package/dist/tree/frames.d.ts.map +1 -0
- package/dist/tree/frames.js +143 -0
- package/dist/tree/frames.js.map +1 -0
- package/dist/tree/host-mount.d.ts +24 -0
- package/dist/tree/host-mount.d.ts.map +1 -0
- package/dist/tree/host-mount.js +0 -0
- package/dist/tree/host-mount.js.map +1 -0
- package/dist/tree/index.d.ts +9 -0
- package/dist/tree/index.d.ts.map +1 -0
- package/dist/tree/index.js +9 -0
- package/dist/tree/index.js.map +1 -0
- package/dist/tree/jail/JailedComponent.d.ts +41 -0
- package/dist/tree/jail/JailedComponent.d.ts.map +1 -0
- package/dist/tree/jail/JailedComponent.js +269 -0
- package/dist/tree/jail/JailedComponent.js.map +1 -0
- package/dist/tree/jail/runtime-bundle.gen.d.ts +3 -0
- package/dist/tree/jail/runtime-bundle.gen.d.ts.map +1 -0
- package/dist/tree/jail/runtime-bundle.gen.js +3 -0
- package/dist/tree/jail/runtime-bundle.gen.js.map +1 -0
- package/dist/tree/jail/runtime-entry.d.ts +18 -0
- package/dist/tree/jail/runtime-entry.d.ts.map +1 -0
- package/dist/tree/jail/runtime-entry.js +440 -0
- package/dist/tree/jail/runtime-entry.js.map +1 -0
- package/dist/tree/jail/viewport-css.d.ts +17 -0
- package/dist/tree/jail/viewport-css.d.ts.map +1 -0
- package/dist/tree/jail/viewport-css.js +32 -0
- package/dist/tree/jail/viewport-css.js.map +1 -0
- package/dist/tree/mcp-shim/entry.d.ts +2 -0
- package/dist/tree/mcp-shim/entry.d.ts.map +1 -0
- package/dist/tree/mcp-shim/entry.js +45 -0
- package/dist/tree/mcp-shim/entry.js.map +1 -0
- package/dist/tree/mcp-shim/http-open-card.d.ts +5 -0
- package/dist/tree/mcp-shim/http-open-card.d.ts.map +1 -0
- package/dist/tree/mcp-shim/http-open-card.js +61 -0
- package/dist/tree/mcp-shim/http-open-card.js.map +1 -0
- package/dist/tree/mcp-shim/shim-core.d.ts +58 -0
- package/dist/tree/mcp-shim/shim-core.d.ts.map +1 -0
- package/dist/tree/mcp-shim/shim-core.js +176 -0
- package/dist/tree/mcp-shim/shim-core.js.map +1 -0
- package/dist/tree/mcp-shim/theme.d.ts +8 -0
- package/dist/tree/mcp-shim/theme.d.ts.map +1 -0
- package/dist/tree/mcp-shim/theme.js +36 -0
- package/dist/tree/mcp-shim/theme.js.map +1 -0
- package/dist/tree/notice.d.ts +8 -0
- package/dist/tree/notice.d.ts.map +1 -0
- package/dist/tree/notice.js +30 -0
- package/dist/tree/notice.js.map +1 -0
- package/dist/tree/primitives.d.ts +30 -0
- package/dist/tree/primitives.d.ts.map +1 -0
- package/dist/tree/primitives.js +105 -0
- package/dist/tree/primitives.js.map +1 -0
- package/dist/tree/renderer-v2.d.ts +15 -0
- package/dist/tree/renderer-v2.d.ts.map +1 -0
- package/dist/tree/renderer-v2.js +71 -0
- package/dist/tree/renderer-v2.js.map +1 -0
- package/dist/tree/renderer.d.ts +77 -0
- package/dist/tree/renderer.d.ts.map +1 -0
- package/dist/tree/renderer.js +376 -0
- package/dist/tree/renderer.js.map +1 -0
- package/dist/voice/driver.d.ts +94 -0
- package/dist/voice/driver.d.ts.map +1 -0
- package/dist/voice/driver.js +2 -0
- package/dist/voice/driver.js.map +1 -0
- package/dist/voice/index.d.ts +7 -0
- package/dist/voice/index.d.ts.map +1 -0
- package/dist/voice/index.js +5 -0
- package/dist/voice/index.js.map +1 -0
- package/dist/voice/realtime-driver.d.ts +57 -0
- package/dist/voice/realtime-driver.d.ts.map +1 -0
- package/dist/voice/realtime-driver.js +592 -0
- package/dist/voice/realtime-driver.js.map +1 -0
- package/dist/voice/stage.d.ts +12 -0
- package/dist/voice/stage.d.ts.map +1 -0
- package/dist/voice/stage.js +259 -0
- package/dist/voice/stage.js.map +1 -0
- package/dist/voice/use-voice-approvals.d.ts +16 -0
- package/dist/voice/use-voice-approvals.d.ts.map +1 -0
- package/dist/voice/use-voice-approvals.js +77 -0
- package/dist/voice/use-voice-approvals.js.map +1 -0
- package/dist/voice/use-voice.d.ts +26 -0
- package/dist/voice/use-voice.d.ts.map +1 -0
- package/dist/voice/use-voice.js +201 -0
- package/dist/voice/use-voice.js.map +1 -0
- package/dist/voice/voice-act.d.ts +13 -0
- package/dist/voice/voice-act.d.ts.map +1 -0
- package/dist/voice/voice-act.js +301 -0
- package/dist/voice/voice-act.js.map +1 -0
- package/dist/voice/voice-blob.d.ts +17 -0
- package/dist/voice/voice-blob.d.ts.map +1 -0
- package/dist/voice/voice-blob.js +67 -0
- package/dist/voice/voice-blob.js.map +1 -0
- package/dist/voice/voice-consent.d.ts +17 -0
- package/dist/voice/voice-consent.d.ts.map +1 -0
- package/dist/voice/voice-consent.js +45 -0
- package/dist/voice/voice-consent.js.map +1 -0
- package/dist/voice/voice-drawer.d.ts +10 -0
- package/dist/voice/voice-drawer.d.ts.map +1 -0
- package/dist/voice/voice-drawer.js +22 -0
- package/dist/voice/voice-drawer.js.map +1 -0
- package/dist/wire-types.d.ts +238 -0
- package/dist/wire-types.d.ts.map +1 -0
- package/dist/wire-types.js +2 -0
- package/dist/wire-types.js.map +1 -0
- package/package.json +106 -0
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { isToolUIPart } from "ai";
|
|
3
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
4
|
+
import { useVendoDiscoverability, useVendoGreeting } from "../../context.js";
|
|
5
|
+
import { useVendoThread } from "../../hooks/use-vendo-thread.js";
|
|
6
|
+
import { StatusRibbon } from "../build-beat.js";
|
|
7
|
+
import { ChromeRoot } from "../chrome-root.js";
|
|
8
|
+
import { defaultVendoGreeting, hasSeen, markSeen } from "../discoverability.js";
|
|
9
|
+
import { MorphToast } from "../morph-toast.js";
|
|
10
|
+
import { Composer, dragHasFiles, useComposer } from "./composer.js";
|
|
11
|
+
import { MessageList } from "./message-list.js";
|
|
12
|
+
import { useMessageWindow, useStickToBottom } from "./scrolling.js";
|
|
13
|
+
import { approvalByCall, riskByCall, userText } from "./message-data.js";
|
|
14
|
+
/** 08-ui §4 — conversation chrome over the headless thread transport. */
|
|
15
|
+
export function VendoThread({ threadId, greeting = "What can I help you build?", suggestions = [], onVoice, onThreadId, discoverability, firstRunGreeting, composerAccessory, }) {
|
|
16
|
+
const thread = useVendoThread(threadId);
|
|
17
|
+
// ui-usage-dx §6 — greeting-as-tutorial: the user's FIRST-ever conversation
|
|
18
|
+
// open (fresh thread only — an adopted thread with history is not a first
|
|
19
|
+
// open and does not burn the flag) renders the agent-voiced intro + starter
|
|
20
|
+
// chips locally. Presentation-only: nothing here touches the transport or
|
|
21
|
+
// the transcript; chips prefill the composer and never send.
|
|
22
|
+
const providerDial = useVendoDiscoverability();
|
|
23
|
+
const dial = discoverability ?? providerDial;
|
|
24
|
+
const contextGreeting = useVendoGreeting();
|
|
25
|
+
const tutorial = firstRunGreeting ?? contextGreeting ?? defaultVendoGreeting;
|
|
26
|
+
const [tutorialActive, setTutorialActive] = useState(false);
|
|
27
|
+
// Arming is REACTIVE, not mount-only: surfaces that don't remount their
|
|
28
|
+
// thread (VendoPage flips threadId props on one instance) become eligible
|
|
29
|
+
// later — e.g. when the page's dial gate opens on an explicit "New
|
|
30
|
+
// conversation". Burned on first showing (not on interaction) — a reload
|
|
31
|
+
// mid-look never replays it, per the once-per-user-ever rule.
|
|
32
|
+
const messageCount = thread.messages.length;
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (tutorialActive || dial === "quiet" || threadId !== undefined)
|
|
35
|
+
return;
|
|
36
|
+
if (messageCount > 0 || hasSeen("greeting"))
|
|
37
|
+
return;
|
|
38
|
+
markSeen("greeting");
|
|
39
|
+
setTutorialActive(true);
|
|
40
|
+
}, [tutorialActive, dial, threadId, messageCount]);
|
|
41
|
+
// Once the landing is left (a turn exists, or the surface switches to a
|
|
42
|
+
// stored thread), the tutorial is done for good on this instance too — the
|
|
43
|
+
// burned flag keeps every later landing plain.
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
if (tutorialActive && (messageCount > 0 || threadId !== undefined))
|
|
46
|
+
setTutorialActive(false);
|
|
47
|
+
}, [tutorialActive, messageCount, threadId]);
|
|
48
|
+
// ENG-222 — surface the effective (possibly server-minted) thread id upward.
|
|
49
|
+
const reportedThreadId = thread.threadId;
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (reportedThreadId !== undefined)
|
|
52
|
+
onThreadId?.(reportedThreadId);
|
|
53
|
+
}, [reportedThreadId, onThreadId]);
|
|
54
|
+
const busy = thread.status === "submitted" || thread.status === "streaming";
|
|
55
|
+
// busy is a content-revision signal for the scroll hook: turn-actions mount
|
|
56
|
+
// below the last turn when a stream settles, which changes the list height.
|
|
57
|
+
const scroll = useStickToBottom(thread.messages, threadId, busy);
|
|
58
|
+
const approvalCardRefs = useRef(new Map());
|
|
59
|
+
const [morph, setMorph] = useState(null);
|
|
60
|
+
// A build's approval lands below a tall generated view — off-screen — so it
|
|
61
|
+
// would sit unnoticed until the reader scrolls. When a NEW approval appears,
|
|
62
|
+
// bring it into view (and re-stick), so consent is never something you have
|
|
63
|
+
// to go hunting for.
|
|
64
|
+
const seenApprovalsRef = useRef(new Set());
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
const pending = thread.messages
|
|
67
|
+
.flatMap(message => message.parts)
|
|
68
|
+
.filter(part => isToolUIPart(part) && part.state === "approval-requested")
|
|
69
|
+
.map(part => part.approval?.id)
|
|
70
|
+
.filter((id) => typeof id === "string");
|
|
71
|
+
const fresh = pending.find(id => !seenApprovalsRef.current.has(id));
|
|
72
|
+
seenApprovalsRef.current = new Set(pending);
|
|
73
|
+
if (fresh === undefined)
|
|
74
|
+
return;
|
|
75
|
+
const timer = setTimeout(() => {
|
|
76
|
+
const card = approvalCardRefs.current.get(fresh)?.querySelector(".fl-approval");
|
|
77
|
+
// block: "end", not "center": a sibling surface sharing this pane's
|
|
78
|
+
// flex column (VendoStage docked below the thread, Maple's /vendo tab)
|
|
79
|
+
// can leave the list shorter than the card itself at a short viewport
|
|
80
|
+
// height — centering then crops evenly off BOTH edges, hiding the
|
|
81
|
+
// card's own Approve/Decline row behind whatever renders next in flow
|
|
82
|
+
// with no way to reach it. Bottom-aligning always leaves the action
|
|
83
|
+
// row — the part the reader actually needs — as the last thing in
|
|
84
|
+
// view, consistent with the list's own stick-to-bottom behavior.
|
|
85
|
+
if (card)
|
|
86
|
+
card.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
87
|
+
else
|
|
88
|
+
scroll.jumpToLatest();
|
|
89
|
+
}, 80);
|
|
90
|
+
return () => clearTimeout(timer);
|
|
91
|
+
}, [thread.messages, scroll]);
|
|
92
|
+
const messageWindow = useMessageWindow(thread.messages, scroll.listRef, threadId);
|
|
93
|
+
// ENG-218 — entrance-animation gating on restore. The .fl-item-in rise runs
|
|
94
|
+
// when an article first mounts; a reopened long thread mounts them all at once
|
|
95
|
+
// → a stampede on first paint. We record every message id present when the
|
|
96
|
+
// thread is first shown (and after each switch) as "restored" and suppress
|
|
97
|
+
// the entrance on those; only turns that arrive AFTER restore (streamed
|
|
98
|
+
// replies, sends) animate. A ref, not state — read during render, no re-render.
|
|
99
|
+
const restoredIdsRef = useRef({ key: undefined, ids: new Set() });
|
|
100
|
+
if (restoredIdsRef.current.key !== threadId) {
|
|
101
|
+
restoredIdsRef.current = { key: threadId, ids: new Set(thread.messages.map(message => message.id)) };
|
|
102
|
+
}
|
|
103
|
+
else if (restoredIdsRef.current.ids.size === 0 && thread.messages.length > 0) {
|
|
104
|
+
// First non-empty render after an async history load (mount → list/get):
|
|
105
|
+
// that whole batch is a restore, not new arrivals.
|
|
106
|
+
restoredIdsRef.current.ids = new Set(thread.messages.map(message => message.id));
|
|
107
|
+
}
|
|
108
|
+
const isRestored = (id) => restoredIdsRef.current.ids.has(id);
|
|
109
|
+
const composerApi = useComposer({ busy, sendMessage: message => thread.sendMessage(message) });
|
|
110
|
+
const { setDraft, setQueued, textareaRef, send } = composerApi;
|
|
111
|
+
const risks = useMemo(() => riskByCall(thread.messages), [thread.messages]);
|
|
112
|
+
const guardApprovals = useMemo(() => approvalByCall(thread.messages), [thread.messages]);
|
|
113
|
+
const landing = thread.messages.length === 0;
|
|
114
|
+
const activeAssistant = thread.messages.at(-1)?.role === "assistant" ? thread.messages.at(-1) : undefined;
|
|
115
|
+
const assistantHasVisibleText = activeAssistant?.parts.some(part => part.type === "text" && part.text.trim().length > 0) ?? false;
|
|
116
|
+
// ENG-217 — the three streaming moments each get exactly ONE affordance:
|
|
117
|
+
// before the first chunk the generating skeleton holds the floor; a streamed
|
|
118
|
+
// turn whose text is still empty shows the lone caret (renderPart); once
|
|
119
|
+
// text flows the trailing caret rides .fl-md--streaming. FluidThinking
|
|
120
|
+
// covers the remaining gap (tool phases with no text yet).
|
|
121
|
+
const awaitingFirstChunk = busy && (activeAssistant === undefined || activeAssistant.parts.length === 0);
|
|
122
|
+
const lastPart = activeAssistant?.parts.at(-1);
|
|
123
|
+
const caretShowing = busy && lastPart?.type === "text" && lastPart.state === "streaming"
|
|
124
|
+
&& lastPart.text.trim().length === 0;
|
|
125
|
+
// Once ANY build beat exists in the active turn, the checklist is the
|
|
126
|
+
// progress voice — the thinking indicator between beats reads as two
|
|
127
|
+
// indicators fighting.
|
|
128
|
+
const hasBeats = activeAssistant?.parts.some(part => isToolUIPart(part)) ?? false;
|
|
129
|
+
const working = busy && !assistantHasVisibleText && !awaitingFirstChunk && !caretShowing && !hasBeats;
|
|
130
|
+
// ENG-215 — edit the last user turn: drop it (and anything after) from the
|
|
131
|
+
// transcript and refill the composer, so re-sending amends rather than
|
|
132
|
+
// duplicates. Only meaningful when idle.
|
|
133
|
+
const lastUserIndex = (() => {
|
|
134
|
+
for (let index = thread.messages.length - 1; index >= 0; index -= 1) {
|
|
135
|
+
if (thread.messages[index]?.role === "user")
|
|
136
|
+
return index;
|
|
137
|
+
}
|
|
138
|
+
return -1;
|
|
139
|
+
})();
|
|
140
|
+
// Turn actions attach by id, not list index: the map below renders a windowed
|
|
141
|
+
// slice (ENG-218), so positional indices no longer line up with thread.messages.
|
|
142
|
+
const lastUserId = lastUserIndex >= 0 ? thread.messages[lastUserIndex]?.id : undefined;
|
|
143
|
+
const editLast = () => {
|
|
144
|
+
if (busy || lastUserIndex < 0)
|
|
145
|
+
return;
|
|
146
|
+
const message = thread.messages[lastUserIndex];
|
|
147
|
+
if (!message)
|
|
148
|
+
return;
|
|
149
|
+
thread.setMessages(thread.messages.slice(0, lastUserIndex));
|
|
150
|
+
setQueued(null);
|
|
151
|
+
setDraft(userText(message));
|
|
152
|
+
requestAnimationFrame(() => textareaRef.current?.focus());
|
|
153
|
+
};
|
|
154
|
+
// ENG-215 — regenerate the last assistant turn (re-issues from the preserved
|
|
155
|
+
// user message; no duplication). Only when idle and an assistant turn exists.
|
|
156
|
+
const lastAssistantIndex = (() => {
|
|
157
|
+
for (let index = thread.messages.length - 1; index >= 0; index -= 1) {
|
|
158
|
+
if (thread.messages[index]?.role === "assistant")
|
|
159
|
+
return index;
|
|
160
|
+
}
|
|
161
|
+
return -1;
|
|
162
|
+
})();
|
|
163
|
+
const lastAssistantId = lastAssistantIndex >= 0 ? thread.messages[lastAssistantIndex]?.id : undefined;
|
|
164
|
+
const regenerateLast = () => {
|
|
165
|
+
if (busy || lastAssistantIndex < 0)
|
|
166
|
+
return;
|
|
167
|
+
void thread.regenerate();
|
|
168
|
+
};
|
|
169
|
+
// ENG-214 — a broken turn (failed send, mid-stream drop, any thread.error)
|
|
170
|
+
// surfaces VISIBLY in the thread, not only through the hidden status span.
|
|
171
|
+
// The copy stays friendly — raw transport errors are announced to assistive
|
|
172
|
+
// tech below but never printed to end users. Retry regenerates the failed
|
|
173
|
+
// turn from the preserved user message (no duplication).
|
|
174
|
+
const errorBanner = thread.error ? (_jsxs("div", { className: "fl-error", children: [_jsx("span", { children: "Something went wrong and the response didn\u2019t finish." }), _jsx("button", { type: "button", className: "fl-error-retry", onClick: () => {
|
|
175
|
+
// Nothing to re-issue (sends append the user turn before any request
|
|
176
|
+
// fires, so this is a defensive rail): degrade to dismissing the
|
|
177
|
+
// error instead of letting regenerate() throw on an empty thread.
|
|
178
|
+
if (thread.messages.length === 0) {
|
|
179
|
+
thread.clearError();
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
void thread.regenerate();
|
|
183
|
+
}, children: "Retry" })] })) : null;
|
|
184
|
+
const composer = (_jsx(Composer, { composer: composerApi, busy: busy, status: thread.status, errorMessage: thread.status === "error" && thread.error ? thread.error.message : undefined, onStop: () => void thread.stop(), onVoice: onVoice }));
|
|
185
|
+
const approvals = thread.messages.flatMap(message => message.parts).filter(isToolUIPart).filter(part => part.state === "approval-requested");
|
|
186
|
+
// Lane pick C1 — the live status ribbon: while the turn works through tool
|
|
187
|
+
// calls (and no text has started flowing), the ACTIVE call narrates above
|
|
188
|
+
// the composer — label · elapsed · step N of M. The transcript stays
|
|
189
|
+
// beat-free (parts.tsx renders only errored calls). Once text streams the
|
|
190
|
+
// ribbon yields the floor to the caret choreography.
|
|
191
|
+
const activeToolParts = (activeAssistant?.parts ?? []).filter(isToolUIPart);
|
|
192
|
+
const liveToolPart = [...activeToolParts].reverse()
|
|
193
|
+
.find(part => part.state !== "output-available" && part.state !== "output-error");
|
|
194
|
+
// A turn parked on an approval is not "busy" (the stream yielded), but the
|
|
195
|
+
// pause still narrates: the ribbon holds "— waiting for your approval" while
|
|
196
|
+
// the card sits in the transcript.
|
|
197
|
+
const awaitingApprovalPart = activeToolParts.find(part => part.state === "approval-requested");
|
|
198
|
+
const activeToolPart = busy && !assistantHasVisibleText
|
|
199
|
+
? liveToolPart ?? (activeToolParts.length > 0 && !caretShowing ? activeToolParts.at(-1) : undefined)
|
|
200
|
+
: awaitingApprovalPart;
|
|
201
|
+
const ribbon = activeToolPart ? (_jsx(StatusRibbon, { part: activeToolPart, stepIndex: activeToolParts.indexOf(activeToolPart) + 1, stepTotal: activeToolParts.length, risk: risks.get(activeToolPart.toolCallId) ?? "read" })) : null;
|
|
202
|
+
// Lane pick 2E — the WHOLE thread surface is the drop target (the composer
|
|
203
|
+
// bar no longer owns drag): a huge, overshoot-proof zone with a centered
|
|
204
|
+
// card naming what will happen. Depth counter as before (child crossings).
|
|
205
|
+
const { dragDepth, setDragDepth, setFiles } = composerApi;
|
|
206
|
+
const dropProps = {
|
|
207
|
+
onDragEnter: (event) => {
|
|
208
|
+
if (!dragHasFiles(event))
|
|
209
|
+
return;
|
|
210
|
+
event.preventDefault();
|
|
211
|
+
setDragDepth(depth => depth + 1);
|
|
212
|
+
},
|
|
213
|
+
onDragOver: (event) => {
|
|
214
|
+
if (dragHasFiles(event))
|
|
215
|
+
event.preventDefault();
|
|
216
|
+
},
|
|
217
|
+
onDragLeave: (event) => {
|
|
218
|
+
if (dragHasFiles(event))
|
|
219
|
+
setDragDepth(depth => Math.max(0, depth - 1));
|
|
220
|
+
},
|
|
221
|
+
onDrop: (event) => {
|
|
222
|
+
if (!dragHasFiles(event))
|
|
223
|
+
return;
|
|
224
|
+
event.preventDefault();
|
|
225
|
+
setDragDepth(0);
|
|
226
|
+
const dropped = Array.from(event.dataTransfer.files);
|
|
227
|
+
if (dropped.length > 0)
|
|
228
|
+
setFiles(current => [...current, ...dropped]);
|
|
229
|
+
},
|
|
230
|
+
};
|
|
231
|
+
const dropOverlay = dragDepth > 0 ? (_jsx("div", { className: "fl-drop fl-drop--thread", children: _jsxs("div", { className: "fl-drop-card", children: [_jsx("svg", { width: "26", height: "26", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48" }) }), "Drop files to attach to your message"] }) })) : null;
|
|
232
|
+
if (landing) {
|
|
233
|
+
return (_jsx(ChromeRoot, { children: _jsxs("div", { className: "fl-thread", role: "region", "aria-label": "Vendo conversation", ...dropProps, children: [dropOverlay, _jsxs("div", { className: "fl-landing", children: [tutorialActive ? (
|
|
234
|
+
// The one-time tutorial replaces the headline (and the host's
|
|
235
|
+
// send-on-tap suggestion chips — two chip rows with different
|
|
236
|
+
// behaviors would read as one). Chips PREFILL, never send.
|
|
237
|
+
_jsxs("div", { className: "fl-greeting", role: "group", "aria-label": "Getting started", children: [_jsx("p", { className: "fl-greeting-intro", children: tutorial.intro }), _jsx("div", { className: "fl-chips fl-greeting-chips", children: tutorial.prompts.slice(0, 3).map((text, i) => (_jsx("button", { type: "button", className: "fl-chip", onClick: () => {
|
|
238
|
+
setDraft(text);
|
|
239
|
+
requestAnimationFrame(() => textareaRef.current?.focus());
|
|
240
|
+
}, children: text }, `${i}-${text}`))) })] })) : (_jsx("h1", { className: "fl-greet", children: greeting })), errorBanner, composerAccessory, _jsx("div", { className: "fl-landing-composer", children: composer }), !tutorialActive && suggestions.length > 0 ? (
|
|
241
|
+
// Lane pick 4B — object suggestions render as two-line starter
|
|
242
|
+
// cards (title + concrete outcome, optional host icon); plain
|
|
243
|
+
// strings keep the pill chip. A MIXED array renders both
|
|
244
|
+
// containers (cards grid, then a chips row) so string entries
|
|
245
|
+
// never stretch as grid cells (AI-review catch). Both send on
|
|
246
|
+
// tap, unchanged.
|
|
247
|
+
_jsxs(_Fragment, { children: [suggestions.some(s => typeof s !== "string") ? (_jsx("div", { className: "fl-cards", children: suggestions.flatMap((suggestion, i) => {
|
|
248
|
+
if (typeof suggestion === "string")
|
|
249
|
+
return [];
|
|
250
|
+
const prompt = suggestion.prompt ?? suggestion.title;
|
|
251
|
+
return [(_jsxs("button", { type: "button", className: "fl-card", onClick: () => send(prompt), children: [suggestion.icon, _jsx("b", { children: suggestion.title }), _jsx("span", { children: suggestion.description })] }, `${i}-${suggestion.title}`))];
|
|
252
|
+
}) })) : null, suggestions.some(s => typeof s === "string") ? (_jsx("div", { className: "fl-chips", children: suggestions.flatMap((text, i) => (typeof text === "string"
|
|
253
|
+
? [_jsx("button", { type: "button", className: "fl-chip", onClick: () => send(text), children: text }, `${i}-${text}`)]
|
|
254
|
+
: [])) })) : null] })) : null] })] }) }));
|
|
255
|
+
}
|
|
256
|
+
return (_jsxs(ChromeRoot, { children: [_jsxs("div", { className: "fl-thread", role: "region", "aria-label": "Vendo conversation", ...dropProps, children: [dropOverlay, _jsx(MessageList, { scroll: scroll, messageWindow: messageWindow, busy: busy, risks: risks, isRestored: isRestored, activeAssistantId: activeAssistant?.id, lastUserId: lastUserId, lastAssistantId: lastAssistantId, onEditLast: editLast, onRegenerateLast: regenerateLast, approvals: approvals, guardApprovals: guardApprovals, cardRefs: approvalCardRefs, respond: response => thread.addToolApprovalResponse(response), onMorph: setMorph, messages: thread.messages, sendMessage: message => thread.sendMessage(message), awaitingFirstChunk: awaitingFirstChunk, working: working }), errorBanner, composerAccessory, ribbon, composer] }), morph ? _jsx(MorphToast, { ...morph, onDone: () => setMorph(null) }) : null] }));
|
|
257
|
+
}
|
|
258
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/chrome/thread/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7D,OAAO,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,CAAC;IAED,OAAO,CACL,MAAC,UAAU,eACT,eAAK,SAAS,EAAC,WAAW,EAAC,IAAI,EAAC,QAAQ,gBAAY,oBAAoB,KAAK,SAAS,aACnF,WAAW,EACZ,KAAC,WAAW,IACV,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,aAAa,EAC5B,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,iBAAiB,EAAE,eAAe,EAAE,EAAE,EACtC,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,UAAU,EAAE,QAAQ,EACpB,gBAAgB,EAAE,cAAc,EAChC,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,EAAE,QAAQ,CAAC,EAAE,CAAC,MAAM,CAAC,uBAAuB,CAAC,QAAQ,CAAC,EAC7D,OAAO,EAAE,QAAQ,EACjB,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,WAAW,EAAE,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,EACnD,kBAAkB,EAAE,kBAAkB,EACtC,OAAO,EAAE,OAAO,GAChB,EACD,WAAW,EACX,iBAAiB,EACjB,MAAM,EACN,QAAQ,IACL,EACL,KAAK,CAAC,CAAC,CAAC,KAAC,UAAU,OAAK,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAI,CAAC,CAAC,CAAC,IAAI,IAC5D,CACd,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ApprovalRequest, RiskLabel } from "@vendoai/core";
|
|
2
|
+
import { type UIMessage } from "ai";
|
|
3
|
+
export declare function partData(part: UIMessage["parts"][number]): unknown;
|
|
4
|
+
export declare const SYNTHESIZED_CREATED_AT = "1970-01-01T00:00:00.000Z";
|
|
5
|
+
export declare function riskByCall(messages: UIMessage[]): Map<string, RiskLabel>;
|
|
6
|
+
/** Guard approval metadata by tool call — carried in the data-vendo-approval
|
|
7
|
+
part beside the native ai-SDK approval (whose own id is transport-local). */
|
|
8
|
+
export declare function approvalByCall(messages: UIMessage[]): Map<string, {
|
|
9
|
+
approvalId?: string;
|
|
10
|
+
invalidatedGrant?: ApprovalRequest["invalidatedGrant"];
|
|
11
|
+
}>;
|
|
12
|
+
export declare function toolName(part: Extract<UIMessage["parts"][number], {
|
|
13
|
+
toolCallId: string;
|
|
14
|
+
}>): string;
|
|
15
|
+
/** The app-boundary title: the payload's `name`, else its first heading Text node. */
|
|
16
|
+
export declare function appTitle(payload: unknown): string | undefined;
|
|
17
|
+
/** ENG-216 — collapse runs of consecutive identical tool chips (e.g. eight
|
|
18
|
+
`host_listClientDocuments` calls) into one entry carrying a count. The
|
|
19
|
+
latest part in the run is kept so the chip icon reflects the final state. */
|
|
20
|
+
export declare function collapseToolRuns(parts: UIMessage["parts"]): {
|
|
21
|
+
part: UIMessage["parts"][number];
|
|
22
|
+
index: number;
|
|
23
|
+
count: number;
|
|
24
|
+
}[];
|
|
25
|
+
/** The plain text a user turn carried, joined across its text parts — the seed
|
|
26
|
+
for "edit last message" (ENG-215). */
|
|
27
|
+
export declare function userText(message: UIMessage): string;
|
|
28
|
+
/** What "copy this turn" yields for an assistant message: its text parts (the
|
|
29
|
+
markdown source), blank-line separated — tool beats and views don't copy. */
|
|
30
|
+
export declare function assistantText(message: UIMessage): string;
|
|
31
|
+
/** ENG-216 — the in-thread approval preview is built client-side (the wire part
|
|
32
|
+
carries no descriptor), so format args as readable `Label: value` lines
|
|
33
|
+
instead of the raw JSON with literal \n escapes end users were reading. */
|
|
34
|
+
export declare function preview(input: unknown): string;
|
|
35
|
+
//# sourceMappingURL=message-data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-data.d.ts","sourceRoot":"","sources":["../../../src/chrome/thread/message-data.ts"],"names":[],"mappings":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,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAS9C"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { isToolUIPart } from "ai";
|
|
2
|
+
import { previewArgs } from "../humanize.js";
|
|
3
|
+
import { LONG_TEXT_CAP, truncateHead } from "../truncate.js";
|
|
4
|
+
export function partData(part) {
|
|
5
|
+
return "data" in part ? part.data : part;
|
|
6
|
+
}
|
|
7
|
+
// ENG-216 — a stable placeholder for the in-thread synthesized ApprovalRequest's
|
|
8
|
+
// required `createdAt`. The wire approval part carries no timestamp; this value
|
|
9
|
+
// is never displayed (the card hides the context byline in-thread) and a fixed
|
|
10
|
+
// constant replaces the former per-render `new Date()` that churned on every
|
|
11
|
+
// re-render and broke deterministic tests.
|
|
12
|
+
export const SYNTHESIZED_CREATED_AT = "1970-01-01T00:00:00.000Z";
|
|
13
|
+
export function riskByCall(messages) {
|
|
14
|
+
const risks = new Map();
|
|
15
|
+
for (const message of messages) {
|
|
16
|
+
for (const part of message.parts) {
|
|
17
|
+
if (part.type !== "data-vendo-approval")
|
|
18
|
+
continue;
|
|
19
|
+
const data = partData(part);
|
|
20
|
+
if (typeof data.toolCallId === "string" && ["read", "write", "destructive"].includes(String(data.risk))) {
|
|
21
|
+
risks.set(data.toolCallId, data.risk);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return risks;
|
|
26
|
+
}
|
|
27
|
+
/** Guard approval metadata by tool call — carried in the data-vendo-approval
|
|
28
|
+
part beside the native ai-SDK approval (whose own id is transport-local). */
|
|
29
|
+
export function approvalByCall(messages) {
|
|
30
|
+
const approvals = new Map();
|
|
31
|
+
for (const message of messages) {
|
|
32
|
+
for (const part of message.parts) {
|
|
33
|
+
if (part.type !== "data-vendo-approval")
|
|
34
|
+
continue;
|
|
35
|
+
const data = partData(part);
|
|
36
|
+
if (typeof data.toolCallId !== "string")
|
|
37
|
+
continue;
|
|
38
|
+
approvals.set(data.toolCallId, {
|
|
39
|
+
...(typeof data.approvalId === "string" ? { approvalId: data.approvalId } : {}),
|
|
40
|
+
...(typeof data.invalidatedGrant?.id === "string"
|
|
41
|
+
&& typeof data.invalidatedGrant.grantedAt === "string"
|
|
42
|
+
? { invalidatedGrant: data.invalidatedGrant }
|
|
43
|
+
: {}),
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return approvals;
|
|
48
|
+
}
|
|
49
|
+
export function toolName(part) {
|
|
50
|
+
return part.type === "dynamic-tool" && "toolName" in part ? part.toolName : part.type.replace(/^tool-/, "");
|
|
51
|
+
}
|
|
52
|
+
/** The app-boundary title: the payload's `name`, else its first heading Text node. */
|
|
53
|
+
export function appTitle(payload) {
|
|
54
|
+
const named = payload.name;
|
|
55
|
+
if (typeof named === "string" && named.trim())
|
|
56
|
+
return named;
|
|
57
|
+
const nodes = payload.nodes;
|
|
58
|
+
if (!Array.isArray(nodes))
|
|
59
|
+
return undefined;
|
|
60
|
+
for (const node of nodes) {
|
|
61
|
+
if (node.component === "Text" && node.props?.variant === "heading" && typeof node.props.text === "string") {
|
|
62
|
+
return node.props.text;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
/** A stable signature for a tool part — same tool + same input = the same call. */
|
|
68
|
+
function toolSignature(part) {
|
|
69
|
+
const input = "input" in part ? part.input : undefined;
|
|
70
|
+
let serialized;
|
|
71
|
+
try {
|
|
72
|
+
serialized = JSON.stringify(input);
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
serialized = String(input);
|
|
76
|
+
}
|
|
77
|
+
return `${toolName(part)}::${serialized}`;
|
|
78
|
+
}
|
|
79
|
+
/** ENG-216 — collapse runs of consecutive identical tool chips (e.g. eight
|
|
80
|
+
`host_listClientDocuments` calls) into one entry carrying a count. The
|
|
81
|
+
latest part in the run is kept so the chip icon reflects the final state. */
|
|
82
|
+
export function collapseToolRuns(parts) {
|
|
83
|
+
const items = [];
|
|
84
|
+
parts.forEach((part, index) => {
|
|
85
|
+
const previous = items.at(-1);
|
|
86
|
+
if (isToolUIPart(part)
|
|
87
|
+
&& previous !== undefined
|
|
88
|
+
&& isToolUIPart(previous.part)
|
|
89
|
+
&& toolSignature(previous.part) === toolSignature(part)) {
|
|
90
|
+
previous.count += 1;
|
|
91
|
+
previous.part = part;
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
items.push({ part, index, count: 1 });
|
|
95
|
+
});
|
|
96
|
+
return items;
|
|
97
|
+
}
|
|
98
|
+
/** The plain text a user turn carried, joined across its text parts — the seed
|
|
99
|
+
for "edit last message" (ENG-215). */
|
|
100
|
+
export function userText(message) {
|
|
101
|
+
return message.parts
|
|
102
|
+
.filter((part) => part.type === "text")
|
|
103
|
+
.map(part => part.text)
|
|
104
|
+
.join("");
|
|
105
|
+
}
|
|
106
|
+
/** What "copy this turn" yields for an assistant message: its text parts (the
|
|
107
|
+
markdown source), blank-line separated — tool beats and views don't copy. */
|
|
108
|
+
export function assistantText(message) {
|
|
109
|
+
return message.parts
|
|
110
|
+
.filter((part) => part.type === "text")
|
|
111
|
+
.map(part => part.text)
|
|
112
|
+
.join("\n\n");
|
|
113
|
+
}
|
|
114
|
+
/** ENG-216 — the in-thread approval preview is built client-side (the wire part
|
|
115
|
+
carries no descriptor), so format args as readable `Label: value` lines
|
|
116
|
+
instead of the raw JSON with literal \n escapes end users were reading. */
|
|
117
|
+
export function preview(input) {
|
|
118
|
+
// ENG-216 — readable `Label: value` lines instead of raw JSON. ENG-218 — then
|
|
119
|
+
// bound the result before it reaches the DOM: a huge argument blob (dumped
|
|
120
|
+
// rows, base64) otherwise renders unbounded inside the approval card's <pre>,
|
|
121
|
+
// blowing up layout and the node count.
|
|
122
|
+
const formatted = previewArgs(input);
|
|
123
|
+
return formatted.length > LONG_TEXT_CAP
|
|
124
|
+
? `${truncateHead(formatted)}\n… (${(formatted.length / 1000).toFixed(0)}k chars, truncated)`
|
|
125
|
+
: formatted;
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=message-data.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-data.js","sourceRoot":"","sources":["../../../src/chrome/thread/message-data.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAkB,MAAM,IAAI,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE7D,MAAM,UAAU,QAAQ,CAAC,IAAgC;IACvD,OAAO,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AAC3C,CAAC;AAED,iFAAiF;AACjF,gFAAgF;AAChF,+EAA+E;AAC/E,6EAA6E;AAC7E,2CAA2C;AAC3C,MAAM,CAAC,MAAM,sBAAsB,GAAG,0BAA0B,CAAC;AAEjE,MAAM,UAAU,UAAU,CAAC,QAAqB;IAC9C,MAAM,KAAK,GAAG,IAAI,GAAG,EAAqB,CAAC;IAC3C,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;YACjC,IAAI,IAAI,CAAC,IAAI,KAAK,qBAAqB;gBAAE,SAAS;YAClD,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAA6C,CAAC;YACxE,IAAI,OAAO,IAAI,CAAC,UAAU,KAAK,QAAQ,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,aAAa,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;gBACxG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAiB,CAAC,CAAC;YACrD,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,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Y,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,qBAAqB;QAC7F,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { RiskLabel } from "@vendoai/core";
|
|
2
|
+
import type { UIMessage } from "ai";
|
|
3
|
+
import type { ComponentProps } from "react";
|
|
4
|
+
import { ThreadApprovals, ThreadConnectRequests } from "./parts.js";
|
|
5
|
+
import type { useMessageWindow, useStickToBottom } from "./scrolling.js";
|
|
6
|
+
/** The transcript pane: the windowed message list (ENG-218), parked approval
|
|
7
|
+
and connect cards, the ENG-217 streaming indicators, and the jump-to-latest
|
|
8
|
+
affordance (ENG-213). Pure presentation over the thread-level state. */
|
|
9
|
+
export declare function MessageList({ scroll, messageWindow, busy, risks, isRestored, activeAssistantId, lastUserId, lastAssistantId, onEditLast, onRegenerateLast, approvals, guardApprovals, cardRefs, respond, onMorph, messages, sendMessage, awaitingFirstChunk, working, }: {
|
|
10
|
+
scroll: ReturnType<typeof useStickToBottom>;
|
|
11
|
+
messageWindow: ReturnType<typeof useMessageWindow>;
|
|
12
|
+
busy: boolean;
|
|
13
|
+
risks: Map<string, RiskLabel>;
|
|
14
|
+
isRestored: (id: string) => boolean;
|
|
15
|
+
activeAssistantId?: string | undefined;
|
|
16
|
+
lastUserId?: string | undefined;
|
|
17
|
+
lastAssistantId?: string | undefined;
|
|
18
|
+
onEditLast: () => void;
|
|
19
|
+
onRegenerateLast: () => void;
|
|
20
|
+
approvals: ComponentProps<typeof ThreadApprovals>["approvals"];
|
|
21
|
+
guardApprovals: ComponentProps<typeof ThreadApprovals>["guardApprovals"];
|
|
22
|
+
cardRefs: ComponentProps<typeof ThreadApprovals>["cardRefs"];
|
|
23
|
+
respond: ComponentProps<typeof ThreadApprovals>["respond"];
|
|
24
|
+
onMorph: ComponentProps<typeof ThreadApprovals>["onMorph"];
|
|
25
|
+
messages: UIMessage[];
|
|
26
|
+
sendMessage: ComponentProps<typeof ThreadConnectRequests>["sendMessage"];
|
|
27
|
+
awaitingFirstChunk: boolean;
|
|
28
|
+
working: boolean;
|
|
29
|
+
}): import("react").JSX.Element;
|
|
30
|
+
//# sourceMappingURL=message-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-list.d.ts","sourceRoot":"","sources":["../../../src/chrome/thread/message-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAG5C,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEzE;;2EAE2E;AAC3E,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAC9C,iBAAiB,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAC5E,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EACrD,QAAQ,EAAE,WAAW,EAAE,kBAAkB,EAAE,OAAO,GACnD,EAAE;IACD,MAAM,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;IAC5C,aAAa,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;IACnD,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC9B,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;IACpC,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,SAAS,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,CAAC,WAAW,CAAC,CAAC;IAC/D,cAAc,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,CAAC,gBAAgB,CAAC,CAAC;IACzE,QAAQ,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,CAAC,UAAU,CAAC,CAAC;IAC7D,OAAO,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC;IAC3D,OAAO,EAAE,cAAc,CAAC,OAAO,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC;IAC3D,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtB,WAAW,EAAE,cAAc,CAAC,OAAO,qBAAqB,CAAC,CAAC,aAAa,CAAC,CAAC;IACzE,kBAAkB,EAAE,OAAO,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;CAClB,+BAiFA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { FluidThinking } from "../fluid-thinking.js";
|
|
3
|
+
import { ThreadMessage } from "./message.js";
|
|
4
|
+
import { ThreadApprovals, ThreadConnectRequests } from "./parts.js";
|
|
5
|
+
/** The transcript pane: the windowed message list (ENG-218), parked approval
|
|
6
|
+
and connect cards, the ENG-217 streaming indicators, and the jump-to-latest
|
|
7
|
+
affordance (ENG-213). Pure presentation over the thread-level state. */
|
|
8
|
+
export function MessageList({ scroll, messageWindow, busy, risks, isRestored, activeAssistantId, lastUserId, lastAssistantId, onEditLast, onRegenerateLast, approvals, guardApprovals, cardRefs, respond, onMorph, messages, sendMessage, awaitingFirstChunk, working, }) {
|
|
9
|
+
return (_jsxs("div", { className: "fl-msglist-wrap", children: [_jsxs("div", { className: "fl-msglist", role: "log", "aria-label": "Conversation messages", "aria-live": "polite", "aria-busy": busy, ref: scroll.listRef, onScroll: () => { scroll.onScroll(); messageWindow.onNearTop(); }, children: [messageWindow.hasOlder ? (_jsxs("button", { type: "button", className: "fl-load-older", onClick: messageWindow.loadOlder, children: ["Show ", messageWindow.olderCount, " earlier message", messageWindow.olderCount === 1 ? "" : "s"] })) : null, messageWindow.windowed.map(message => (_jsx(ThreadMessage, { message: message, restored: isRestored(message.id), risks: risks, busy: busy, activeAssistantId: activeAssistantId, lastUserId: lastUserId, lastAssistantId: lastAssistantId, onEditLast: onEditLast, onRegenerateLast: onRegenerateLast }, message.id))), _jsx(ThreadApprovals, { approvals: approvals, risks: risks, guardApprovals: guardApprovals, cardRefs: cardRefs, respond: respond, onMorph: onMorph }), _jsx(ThreadConnectRequests, { messages: messages, sendMessage: sendMessage }), awaitingFirstChunk ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "fl-generating", children: [_jsx("span", { className: "fl-pulse", "aria-hidden": "true" }), "Generating\u2026"] }), _jsxs("div", { className: "fl-skeleton", "aria-hidden": "true", children: [_jsx("div", { className: "fl-skeleton-bar" }), _jsx("div", { className: "fl-skeleton-bar" }), _jsx("div", { className: "fl-skeleton-bar" })] })] })) : null, working ? _jsx(FluidThinking, { label: "Working" }) : null] }), scroll.showJump ? (_jsxs("button", { type: "button", className: "fl-newbar", "aria-label": `Jump to latest — ${scroll.unseenCount === 1 ? "1 new reply" : `${scroll.unseenCount} new replies`}`, onClick: scroll.jumpToLatest, children: [_jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("path", { d: "M12 5v14" }), _jsx("path", { d: "m19 12-7 7-7-7" })] }), scroll.unseenCount === 1 ? "1 new reply" : `${scroll.unseenCount} new replies`, scroll.snippet ? _jsx("small", { children: scroll.snippet }) : null] })) : null] }));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=message-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-list.js","sourceRoot":"","sources":["../../../src/chrome/thread/message-list.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAGpE;;2EAE2E;AAC3E,MAAM,UAAU,WAAW,CAAC,EAC1B,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAC9C,iBAAiB,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAC5E,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EACrD,QAAQ,EAAE,WAAW,EAAE,kBAAkB,EAAE,OAAO,GAqBnD;IACC,OAAO,CACL,eAAK,SAAS,EAAC,iBAAiB,aAG9B,eACE,SAAS,EAAC,YAAY,EACtB,IAAI,EAAC,KAAK,gBACC,uBAAuB,eACxB,QAAQ,eACP,IAAI,EACf,GAAG,EAAE,MAAM,CAAC,OAAO,EACnB,QAAQ,EAAE,GAAG,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,aAAa,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,aAEhE,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CACxB,kBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,eAAe,EACzB,OAAO,EAAE,aAAa,CAAC,SAAS,sBAE1B,aAAa,CAAC,UAAU,sBAAkB,aAAa,CAAC,UAAU,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,IAClF,CACV,CAAC,CAAC,CA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Aa,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,WAAW,cAAc,EAAE,EAChH,OAAO,EAAE,MAAM,CAAC,YAAY,aAE5B,eAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,MAAM,EAAC,cAAc,EAAC,WAAW,EAAC,KAAK,EAAC,aAAa,EAAC,OAAO,EAAC,cAAc,EAAC,OAAO,iBAAa,MAAM,aACjK,eAAM,CAAC,EAAC,UAAU,GAAG,EAAA,eAAM,CAAC,EAAC,gBAAgB,GAAG,IAC5C,EACL,MAAM,CAAC,WAAW,KAAK,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,WAAW,cAAc,EAC9E,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,0BAAQ,MAAM,CAAC,OAAO,GAAS,CAAC,CAAC,CAAC,IAAI,IACjD,CACV,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { RiskLabel } from "@vendoai/core";
|
|
2
|
+
import { type UIMessage } from "ai";
|
|
3
|
+
/** One turn in the transcript: the user attachments beside the bubble
|
|
4
|
+
(ENG-225), the article with its stream parts, and the settled-turn
|
|
5
|
+
actions (Copy always; Edit on the last user turn, Regenerate on the
|
|
6
|
+
last assistant turn — ENG-215). */
|
|
7
|
+
export declare function ThreadMessage({ message, restored, risks, busy, activeAssistantId, lastUserId, lastAssistantId, onEditLast, onRegenerateLast }: {
|
|
8
|
+
message: UIMessage;
|
|
9
|
+
restored: boolean;
|
|
10
|
+
risks: Map<string, RiskLabel>;
|
|
11
|
+
busy: boolean;
|
|
12
|
+
activeAssistantId?: string | undefined;
|
|
13
|
+
lastUserId?: string | undefined;
|
|
14
|
+
lastAssistantId?: string | undefined;
|
|
15
|
+
onEditLast: () => void;
|
|
16
|
+
onRegenerateLast: () => void;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/chrome/thread/message.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,IAAI,CAAC;AAyDlD;;;sCAGsC;AACtC,wBAAgB,aAAa,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,iBAAiB,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAE,EAAE;IAC9I,OAAO,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B,+BAuEA"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { isToolUIPart } from "ai";
|
|
3
|
+
import { Fragment } from "react";
|
|
4
|
+
import { useVendoContext } from "../../context.js";
|
|
5
|
+
import { useCopyFeedback } from "../clipboard.js";
|
|
6
|
+
import { toolTitle } from "../humanize.js";
|
|
7
|
+
import { SentAttachment } from "./attachments.js";
|
|
8
|
+
import { assistantText, collapseToolRuns, toolName, userText } from "./message-data.js";
|
|
9
|
+
import { ThreadPart } from "./parts.js";
|
|
10
|
+
/** Lane pick 8C — the settled turn's quiet sources row: every completed tool
|
|
11
|
+
call the turn drew on, as informational chips ("what did it read?"). The
|
|
12
|
+
full mechanical record stays in the Activity panel; these are the in-place
|
|
13
|
+
scent. Only read-risk calls qualify — writes are actions, not sources. */
|
|
14
|
+
function TurnSources({ message, risks }) {
|
|
15
|
+
const { tools } = useVendoContext();
|
|
16
|
+
// Identical repeated calls collapse to one chip with a ×N count — the same
|
|
17
|
+
// ENG-216 run-collapse identity (name + args) the old beat stack used.
|
|
18
|
+
const sources = collapseToolRuns(message.parts).filter(({ part }) => isToolUIPart(part) && part.state === "output-available"
|
|
19
|
+
&& (risks.get(part.toolCallId) ?? "read") === "read");
|
|
20
|
+
if (sources.length === 0)
|
|
21
|
+
return null;
|
|
22
|
+
return (_jsx("div", { className: "fl-sources", "aria-label": "Sources", children: sources.map(({ part, count }) => {
|
|
23
|
+
const toolPart = part;
|
|
24
|
+
const name = toolName(toolPart);
|
|
25
|
+
return (_jsxs("span", { className: "fl-source", title: "Recorded in Activity", children: [_jsx("i", { "aria-hidden": "true" }), toolTitle(name, tools[name]), count > 1 ? _jsxs("span", { className: "fl-source-count", "aria-label": `repeated ${count} times`, children: ["\u00D7", count] }) : null] }, toolPart.toolCallId));
|
|
26
|
+
}) }));
|
|
27
|
+
}
|
|
28
|
+
/** ENG-225 — the copy turn action (.fl-turn-actions design). */
|
|
29
|
+
function CopyTurnButton({ text }) {
|
|
30
|
+
const [copied, copy] = useCopyFeedback();
|
|
31
|
+
return (_jsxs("button", { type: "button", className: "fl-turn-btn", "aria-label": "Copy message", onClick: () => copy(text), children: [copied ? (_jsx("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "M20 6 9 17l-5-5" }) })) : (_jsxs("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("rect", { width: "13", height: "13", x: "9", y: "9", rx: "2" }), _jsx("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })] })), copied ? "Copied" : "Copy"] }));
|
|
32
|
+
}
|
|
33
|
+
/** One turn in the transcript: the user attachments beside the bubble
|
|
34
|
+
(ENG-225), the article with its stream parts, and the settled-turn
|
|
35
|
+
actions (Copy always; Edit on the last user turn, Regenerate on the
|
|
36
|
+
last assistant turn — ENG-215). */
|
|
37
|
+
export function ThreadMessage({ message, restored, risks, busy, activeAssistantId, lastUserId, lastAssistantId, onEditLast, onRegenerateLast }) {
|
|
38
|
+
// ENG-225 — a user turn's attachments render BESIDE the bubble
|
|
39
|
+
// (the designed .fl-turn-user-att block), not inside it; a
|
|
40
|
+
// files-only send has no bubble at all.
|
|
41
|
+
const sentFiles = message.role === "user"
|
|
42
|
+
? message.parts.filter((part) => part.type === "file")
|
|
43
|
+
: [];
|
|
44
|
+
const bubbleText = message.role === "user" ? userText(message) : assistantText(message);
|
|
45
|
+
const skipBubble = message.role === "user" && bubbleText.length === 0
|
|
46
|
+
&& message.parts.every(part => part.type === "file");
|
|
47
|
+
// ENG-225 — every settled turn carries a Copy action (hover-
|
|
48
|
+
// revealed, see chrome-css); Edit stays on the last user turn and
|
|
49
|
+
// Regenerate on the last assistant turn (ENG-215). The actively
|
|
50
|
+
// streaming turn gets no actions — its text is still arriving.
|
|
51
|
+
const streamingTurn = busy && message.role === "assistant" && message.id === activeAssistantId;
|
|
52
|
+
const showEdit = !busy && message.role === "user" && message.id === lastUserId;
|
|
53
|
+
const showRegenerate = !busy && message.role === "assistant" && message.id === lastAssistantId;
|
|
54
|
+
const showActions = !streamingTurn && (bubbleText.length > 0 || showEdit || showRegenerate);
|
|
55
|
+
return (_jsxs(Fragment, { children: [sentFiles.length > 0 ? (_jsx("div", { className: `fl-turn-user-att${restored ? " fl-no-entrance" : ""}`, children: sentFiles.map((part, index) => _jsx(SentAttachment, { part: part }, index)) })) : null, skipBubble ? null : (_jsxs("article", { className: `${message.role === "user" ? "fl-turn-user" : "fl-turn-assistant"}${restored ? " fl-no-entrance" : ""}`, "data-role": message.role, "aria-label": `${message.role} message`, children: [collapseToolRuns(message.parts).map(({ part, index, count }) => (_jsx(ThreadPart, { part: part, partKey: `${message.id}-${index}`, role: message.role, restored: restored, count: count, risks: risks }, `${message.id}-${index}`))), !streamingTurn && message.role === "assistant" ? (_jsx(TurnSources, { message: message, risks: risks })) : null, showActions ? (_jsxs("div", { className: "fl-turn-actions", children: [bubbleText.length > 0 ? _jsx(CopyTurnButton, { text: bubbleText }) : null, showEdit ? (_jsxs("button", { type: "button", className: "fl-turn-btn", "aria-label": "Edit message", onClick: onEditLast, children: [_jsxs("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("path", { d: "M12 20h9" }), _jsx("path", { d: "M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z" })] }), "Edit"] })) : null, showRegenerate ? (_jsxs("button", { type: "button", className: "fl-turn-btn", "aria-label": "Regenerate", onClick: onRegenerateLast, children: [_jsxs("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("path", { d: "M3 12a9 9 0 0 1 15-6.7L21 8" }), _jsx("path", { d: "M21 3v5h-5" }), _jsx("path", { d: "M21 12a9 9 0 0 1-15 6.7L3 16" }), _jsx("path", { d: "M3 21v-5h5" })] }), "Regenerate"] })) : null] })) : null] }))] }));
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=message.js.map
|