@40rty/ams-ui 0.1.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/dist/agent.js +148 -0
- package/dist/catalog-data.js +93 -0
- package/dist/catalog-entries.js +8 -0
- package/dist/chunk-432XYPDT.js +1012 -0
- package/dist/chunk-54QPRWEG.js +2800 -0
- package/dist/chunk-CKGGECAQ.js +239 -0
- package/dist/chunk-E3IJDSKY.js +173 -0
- package/dist/chunk-JQNZ5UUK.js +226 -0
- package/dist/chunk-LQLOG2V3.js +649 -0
- package/dist/chunk-MHUEIBJ3.js +117 -0
- package/dist/chunk-ORIOBWTD.js +112 -0
- package/dist/css/preset/motion.css +78 -0
- package/dist/css/preset/tailwind-theme.css +163 -0
- package/dist/css/shell/mobile/island.css +478 -0
- package/dist/hooks.js +25 -0
- package/dist/index.js +7165 -0
- package/dist/motion.js +113 -0
- package/dist/shell.js +5621 -0
- package/dist/types/agent/AgentStreamingState.d.ts +58 -0
- package/dist/types/agent/ProseSurface.d.ts +31 -0
- package/dist/types/agent/index.d.ts +8 -0
- package/dist/types/agent/phase-label.d.ts +13 -0
- package/dist/types/agent/presence/AgentPresenceWidget.d.ts +85 -0
- package/dist/types/agent/presence/BriefIdentity.d.ts +9 -0
- package/dist/types/agent/presence/CompactRead.d.ts +44 -0
- package/dist/types/agent/presence/CriteriaRail.d.ts +68 -0
- package/dist/types/agent/presence/DefaultNotch.d.ts +2 -0
- package/dist/types/agent/presence/FactChip.d.ts +10 -0
- package/dist/types/agent/presence/InlinePresenceRead.d.ts +25 -0
- package/dist/types/agent/presence/KnowledgePeek.d.ts +23 -0
- package/dist/types/agent/presence/LayoutMorphSkeleton.d.ts +59 -0
- package/dist/types/agent/presence/PresenceBrief.d.ts +29 -0
- package/dist/types/agent/presence/PresenceFiller.d.ts +24 -0
- package/dist/types/agent/presence/SourceSift.d.ts +48 -0
- package/dist/types/agent/presence/StreamRead.d.ts +50 -0
- package/dist/types/agent/presence/VoiceLine.d.ts +19 -0
- package/dist/types/agent/presence/band-beat.d.ts +40 -0
- package/dist/types/agent/presence/band-row.d.ts +188 -0
- package/dist/types/agent/presence/cite-image.d.ts +9 -0
- package/dist/types/agent/presence/class-names.d.ts +134 -0
- package/dist/types/agent/presence/element-view.d.ts +83 -0
- package/dist/types/agent/presence/fact-forms/baseline-forms.d.ts +20 -0
- package/dist/types/agent/presence/fact-forms/class-names.d.ts +14 -0
- package/dist/types/agent/presence/fact-forms/index.d.ts +3 -0
- package/dist/types/agent/presence/fact-forms/register.d.ts +9 -0
- package/dist/types/agent/presence/fact-rail.d.ts +76 -0
- package/dist/types/agent/presence/fact-slots.d.ts +97 -0
- package/dist/types/agent/presence/folded.d.ts +26 -0
- package/dist/types/agent/presence/forms.d.ts +5 -0
- package/dist/types/agent/presence/index.d.ts +39 -0
- package/dist/types/agent/presence/notch/PresenceNotch.d.ts +20 -0
- package/dist/types/agent/presence/parts.d.ts +29 -0
- package/dist/types/agent/presence/read-data.d.ts +48 -0
- package/dist/types/agent/presence/reads.d.ts +37 -0
- package/dist/types/agent/presence/sift-deck.d.ts +58 -0
- package/dist/types/agent/presence/source-cards/ArticleSourceCard.d.ts +4 -0
- package/dist/types/agent/presence/source-cards/CollectionSourceCard.d.ts +4 -0
- package/dist/types/agent/presence/source-cards/PolicySourceCard.d.ts +4 -0
- package/dist/types/agent/presence/source-cards/ProductSourceCard.d.ts +4 -0
- package/dist/types/agent/presence/source-cards/ReviewSourceCard.d.ts +4 -0
- package/dist/types/agent/presence/source-cards/SourceCard.d.ts +4 -0
- package/dist/types/agent/presence/source-cards/card-frame.d.ts +38 -0
- package/dist/types/agent/presence/source-cards/card-marks.d.ts +69 -0
- package/dist/types/agent/presence/source-cards/card-plate.d.ts +20 -0
- package/dist/types/agent/presence/source-cards/card-shell.d.ts +91 -0
- package/dist/types/agent/presence/source-cards/register.d.ts +6 -0
- package/dist/types/agent/presence/source-cards/review-passage.d.ts +53 -0
- package/dist/types/agent/presence/swatch.d.ts +4 -0
- package/dist/types/agent/presence/use-band-facts.d.ts +9 -0
- package/dist/types/agent/presence/use-forget-fact.d.ts +56 -0
- package/dist/types/agent/presence/use-measured-height.d.ts +11 -0
- package/dist/types/catalog-data/base.d.ts +2 -0
- package/dist/types/catalog-data/chat.d.ts +55 -0
- package/dist/types/catalog-data/content.d.ts +1129 -0
- package/dist/types/catalog-data/ecommerce.d.ts +4842 -0
- package/dist/types/catalog-data/index.d.ts +7 -0
- package/dist/types/catalog-data/social.d.ts +1552 -0
- package/dist/types/catalog-data/tokens.d.ts +20 -0
- package/dist/types/catalog-data/ugc.d.ts +50 -0
- package/dist/types/catalog-entries.d.ts +35 -0
- package/dist/types/catalog.d.ts +18 -0
- package/dist/types/components/SkeletonSwap.d.ts +27 -0
- package/dist/types/components/agentic/AgentText.d.ts +44 -0
- package/dist/types/components/agentic/Turn.d.ts +21 -0
- package/dist/types/components/browse/CanvasBootLoader.d.ts +16 -0
- package/dist/types/components/browse/ContinuationLoading.d.ts +22 -0
- package/dist/types/components/browse/canvas-booting.d.ts +37 -0
- package/dist/types/components/browse/constants.d.ts +2 -0
- package/dist/types/components/browse/index.d.ts +4 -0
- package/dist/types/components/chat/SuggestionCards.d.ts +2 -0
- package/dist/types/components/chat/index.d.ts +1 -0
- package/dist/types/components/content/FAQ.d.ts +12 -0
- package/dist/types/components/content/FeatureGrid.d.ts +11 -0
- package/dist/types/components/content/InfoCards.d.ts +16 -0
- package/dist/types/components/content/Reviews.d.ts +9 -0
- package/dist/types/components/content/RichText.d.ts +10 -0
- package/dist/types/components/content/article/ArticleDetail.d.ts +15 -0
- package/dist/types/components/content/article/BlogCard.d.ts +11 -0
- package/dist/types/components/content/article/BlogPosts.d.ts +19 -0
- package/dist/types/components/content/page/PageDetail.d.ts +13 -0
- package/dist/types/components/content/page/PolicyDetail.d.ts +23 -0
- package/dist/types/components/ecommerce/cart/AddToCartButton.d.ts +9 -0
- package/dist/types/components/ecommerce/cart/CartContent.d.ts +40 -0
- package/dist/types/components/ecommerce/cart/CartDrawer.d.ts +41 -0
- package/dist/types/components/ecommerce/cart/CartFoot.d.ts +30 -0
- package/dist/types/components/ecommerce/cart/CartLineItem.d.ts +13 -0
- package/dist/types/components/ecommerce/cart/CartLineRow.d.ts +17 -0
- package/dist/types/components/ecommerce/cart/CartPromoCode.d.ts +29 -0
- package/dist/types/components/ecommerce/cart/CartSummary.d.ts +7 -0
- package/dist/types/components/ecommerce/cart/CartWidget.d.ts +10 -0
- package/dist/types/components/ecommerce/cart/VariantPickerModal.d.ts +12 -0
- package/dist/types/components/ecommerce/cart/cart-format.d.ts +8 -0
- package/dist/types/components/ecommerce/cart/use-cart-view.d.ts +50 -0
- package/dist/types/components/ecommerce/collection/CollectionCard.d.ts +10 -0
- package/dist/types/components/ecommerce/collection/CollectionGrid.d.ts +8 -0
- package/dist/types/components/ecommerce/collection/CollectionList.d.ts +13 -0
- package/dist/types/components/ecommerce/collection/internal/CollectionListItem.d.ts +13 -0
- package/dist/types/components/ecommerce/product/AddToRegistry.d.ts +36 -0
- package/dist/types/components/ecommerce/product/ComparisonTable.d.ts +25 -0
- package/dist/types/components/ecommerce/product/ComparisonTableSkeleton.d.ts +11 -0
- package/dist/types/components/ecommerce/product/PresenceProductRail.d.ts +35 -0
- package/dist/types/components/ecommerce/product/ProductBadge.d.ts +9 -0
- package/dist/types/components/ecommerce/product/ProductCard.d.ts +27 -0
- package/dist/types/components/ecommerce/product/ProductDetail.d.ts +25 -0
- package/dist/types/components/ecommerce/product/ProductGallery.d.ts +19 -0
- package/dist/types/components/ecommerce/product/ProductGrid.d.ts +26 -0
- package/dist/types/components/ecommerce/product/ProductImage.d.ts +54 -0
- package/dist/types/components/ecommerce/product/ProductOption.d.ts +9 -0
- package/dist/types/components/ecommerce/product/ProductPrice.d.ts +8 -0
- package/dist/types/components/ecommerce/product/ProductVideoPlayer.d.ts +17 -0
- package/dist/types/components/ecommerce/product/comparison-table-parts.d.ts +41 -0
- package/dist/types/components/ecommerce/product/comparison-table-rows.d.ts +24 -0
- package/dist/types/components/ecommerce/product/image-trim.d.ts +35 -0
- package/dist/types/components/ecommerce/product/product-card-glyphs.d.ts +2 -0
- package/dist/types/components/ecommerce/product/registry-logos.d.ts +2 -0
- package/dist/types/components/ecommerce/product/trim-geometry.d.ts +45 -0
- package/dist/types/components/ecommerce/wishlist/WishlistDrawer.d.ts +16 -0
- package/dist/types/components/feedback/Skeleton.d.ts +13 -0
- package/dist/types/components/feedback/Thinking.d.ts +15 -0
- package/dist/types/components/layout/AspectRatio.d.ts +5 -0
- package/dist/types/components/layout/Backdrop.d.ts +32 -0
- package/dist/types/components/layout/Container.d.ts +6 -0
- package/dist/types/components/layout/Divider.d.ts +5 -0
- package/dist/types/components/layout/Drawer.d.ts +9 -0
- package/dist/types/components/layout/DrawerDockSlot.d.ts +40 -0
- package/dist/types/components/layout/Grid.d.ts +8 -0
- package/dist/types/components/layout/Modal.d.ts +25 -0
- package/dist/types/components/layout/Page.d.ts +11 -0
- package/dist/types/components/layout/Section.d.ts +6 -0
- package/dist/types/components/layout/Stack.d.ts +7 -0
- package/dist/types/components/marketing/AnnouncementBar.d.ts +15 -0
- package/dist/types/components/marketing/BrandStory.d.ts +19 -0
- package/dist/types/components/marketing/HeroBanner.d.ts +69 -0
- package/dist/types/components/marketing/HeroBannerFeatures.d.ts +10 -0
- package/dist/types/components/marketing/HeroBannerInline.d.ts +20 -0
- package/dist/types/components/marketing/PromoBanner.d.ts +11 -0
- package/dist/types/components/marketing/internal/AnnouncementLink.d.ts +5 -0
- package/dist/types/components/marketing/internal/AnnouncementMessage.d.ts +10 -0
- package/dist/types/components/navigation/Breadcrumbs.d.ts +10 -0
- package/dist/types/components/navigation/Footer.d.ts +15 -0
- package/dist/types/components/navigation/Header.d.ts +14 -0
- package/dist/types/components/navigation/internal/BreadcrumbLink.d.ts +5 -0
- package/dist/types/components/navigation/internal/FooterLink.d.ts +5 -0
- package/dist/types/components/navigation/internal/HeaderLink.d.ts +5 -0
- package/dist/types/components/shell/BaseMark.d.ts +11 -0
- package/dist/types/components/shell/CartPill.d.ts +13 -0
- package/dist/types/components/shell/ComposerDock.d.ts +9 -0
- package/dist/types/components/shell/ErrorBanner.d.ts +14 -0
- package/dist/types/components/shell/HistoryMenu.d.ts +15 -0
- package/dist/types/components/shell/MenuButton.d.ts +31 -0
- package/dist/types/components/shell/MountainRidges.d.ts +11 -0
- package/dist/types/components/shell/PendingTurn.d.ts +1 -0
- package/dist/types/components/shell/ShellTop.d.ts +35 -0
- package/dist/types/components/shell/brand-shell.d.ts +441 -0
- package/dist/types/components/shell/index.d.ts +9 -0
- package/dist/types/components/shell/marks/index.d.ts +5 -0
- package/dist/types/components/social/ReviewCard.d.ts +9 -0
- package/dist/types/components/social/ReviewSummary.d.ts +7 -0
- package/dist/types/components/social/TestimonialCard.d.ts +9 -0
- package/dist/types/components/social/TestimonialCarousel.d.ts +16 -0
- package/dist/types/components/social/UgcCard.d.ts +9 -0
- package/dist/types/components/social/UgcGallery.d.ts +8 -0
- package/dist/types/hooks/index.d.ts +8 -0
- package/dist/types/hooks/keyboard.d.ts +18 -0
- package/dist/types/hooks/use-container-width.d.ts +11 -0
- package/dist/types/hooks/use-dismiss-on-outside.d.ts +23 -0
- package/dist/types/hooks/use-focus-on-change.d.ts +8 -0
- package/dist/types/hooks/use-focus-trap.d.ts +12 -0
- package/dist/types/hooks/use-media-query.d.ts +12 -0
- package/dist/types/hooks/use-projection.d.ts +24 -0
- package/dist/types/hooks/use-reduced-motion.d.ts +1 -0
- package/dist/types/hooks/use-scroll-lock.d.ts +19 -0
- package/dist/types/hooks/use-scroll-threshold.d.ts +14 -0
- package/dist/types/hooks/use-textarea-autosize.d.ts +16 -0
- package/dist/types/index.d.ts +74 -0
- package/dist/types/labels-context.d.ts +18 -0
- package/dist/types/labels.d.ts +240 -0
- package/dist/types/motion/ease.d.ts +10 -0
- package/dist/types/motion/generation/ActiveBlockIndicator.d.ts +27 -0
- package/dist/types/motion/generation/BlurUpImage.d.ts +23 -0
- package/dist/types/motion/generation/ResolveEntrance.d.ts +22 -0
- package/dist/types/motion/generation/ShimmerSkeleton.d.ts +20 -0
- package/dist/types/motion/generation/WordReveal.d.ts +26 -0
- package/dist/types/motion/generation/index.d.ts +6 -0
- package/dist/types/motion/hooks/useInViewOnce.d.ts +14 -0
- package/dist/types/motion/hooks/useScrollDirection.d.ts +38 -0
- package/dist/types/motion/hooks/useScrollProgress.d.ts +23 -0
- package/dist/types/motion/hooks/useStableValue.d.ts +36 -0
- package/dist/types/motion/hooks/useSuccessFlash.d.ts +1 -0
- package/dist/types/motion/index.d.ts +18 -0
- package/dist/types/motion/presets.d.ts +335 -0
- package/dist/types/motion/primitives/Agent.d.ts +118 -0
- package/dist/types/motion/primitives/MorphRegion.d.ts +16 -0
- package/dist/types/motion/primitives/Parallax.d.ts +19 -0
- package/dist/types/motion/primitives/Pin.d.ts +26 -0
- package/dist/types/motion/primitives/Reveal.d.ts +29 -0
- package/dist/types/motion/primitives/RevealStagger.d.ts +16 -0
- package/dist/types/motion/primitives/StickyShelf.d.ts +18 -0
- package/dist/types/primitives/Badge/index.d.ts +12 -0
- package/dist/types/primitives/Button/index.d.ts +25 -0
- package/dist/types/primitives/Input/index.d.ts +5 -0
- package/dist/types/primitives/Money/index.d.ts +13 -0
- package/dist/types/primitives/Select/index.d.ts +5 -0
- package/dist/types/primitives/Skeleton/index.d.ts +4 -0
- package/dist/types/shell/AnimatedPlaceholder.d.ts +13 -0
- package/dist/types/shell/BottomSheet.d.ts +54 -0
- package/dist/types/shell/Button.d.ts +19 -0
- package/dist/types/shell/ChromeSurface.d.ts +33 -0
- package/dist/types/shell/Composer.d.ts +56 -0
- package/dist/types/shell/ComposerChipStrip.d.ts +9 -0
- package/dist/types/shell/ConversationTransition.d.ts +27 -0
- package/dist/types/shell/DictationButton.d.ts +24 -0
- package/dist/types/shell/DragSheet.d.ts +34 -0
- package/dist/types/shell/InlineCompletion.d.ts +38 -0
- package/dist/types/shell/LauncherDock.d.ts +40 -0
- package/dist/types/shell/ListeningWaveform.d.ts +18 -0
- package/dist/types/shell/MenuAccordionPanel.d.ts +26 -0
- package/dist/types/shell/MenuDrawer.d.ts +72 -0
- package/dist/types/shell/MenuFlyout.d.ts +22 -0
- package/dist/types/shell/MenuNav.d.ts +30 -0
- package/dist/types/shell/MenuNavBar.d.ts +22 -0
- package/dist/types/shell/ShellMenuChrome.d.ts +66 -0
- package/dist/types/shell/ShellScaffold.d.ts +92 -0
- package/dist/types/shell/SideDock.d.ts +75 -0
- package/dist/types/shell/Skeleton.d.ts +22 -0
- package/dist/types/shell/Spinner.d.ts +10 -0
- package/dist/types/shell/TypedPlaceholder.d.ts +11 -0
- package/dist/types/shell/VoiceControl.d.ts +23 -0
- package/dist/types/shell/VoiceIsland.d.ts +24 -0
- package/dist/types/shell/canvas-gutter-style.d.ts +15 -0
- package/dist/types/shell/composer/AttachButton.d.ts +14 -0
- package/dist/types/shell/composer/AttachmentStrip.d.ts +12 -0
- package/dist/types/shell/composer/ClearSessionButton.d.ts +16 -0
- package/dist/types/shell/composer/ConversationHistoryButton.d.ts +25 -0
- package/dist/types/shell/composer/ShareCanvasButton.d.ts +19 -0
- package/dist/types/shell/composer/ThreadJumpRail.d.ts +43 -0
- package/dist/types/shell/composer/composer-metrics.d.ts +6 -0
- package/dist/types/shell/composer/field-metrics.d.ts +97 -0
- package/dist/types/shell/composer/heic-convert.d.ts +6 -0
- package/dist/types/shell/composer/use-field-autosize.d.ts +26 -0
- package/dist/types/shell/composer/useComposerAttachments.d.ts +37 -0
- package/dist/types/shell/composer/usePromptComposer.d.ts +51 -0
- package/dist/types/shell/dock-context.d.ts +10 -0
- package/dist/types/shell/index.d.ts +36 -0
- package/dist/types/shell/menu-columns.d.ts +19 -0
- package/dist/types/shell/mobile/DefaultMobileShell.d.ts +88 -0
- package/dist/types/shell/mobile/IslandComposeGroup.d.ts +41 -0
- package/dist/types/shell/mobile/IslandInputBar.d.ts +61 -0
- package/dist/types/shell/mobile/IslandNavButtons.d.ts +20 -0
- package/dist/types/shell/mobile/IslandTrailingAction.d.ts +34 -0
- package/dist/types/shell/mobile/MobileChrome.d.ts +34 -0
- package/dist/types/shell/mobile/MobileVoiceConsole.d.ts +42 -0
- package/dist/types/shell/mobile/MorphIsland.d.ts +105 -0
- package/dist/types/shell/mobile/RestIsland.d.ts +41 -0
- package/dist/types/shell/mobile/constants.d.ts +26 -0
- package/dist/types/shell/mobile/document-scroll-ref.d.ts +22 -0
- package/dist/types/shell/mobile/hero-entry-point.d.ts +110 -0
- package/dist/types/shell/mobile/island-metrics.d.ts +131 -0
- package/dist/types/shell/mobile/sheet-detents.d.ts +49 -0
- package/dist/types/shell/mobile/turn-end-action.d.ts +44 -0
- package/dist/types/shell/mobile/use-blur-on-canvas-gesture.d.ts +31 -0
- package/dist/types/shell/mobile/use-island-fold-scroll.d.ts +28 -0
- package/dist/types/shell/mobile/use-keyboard-inset.d.ts +18 -0
- package/dist/types/shell/mobile/use-sheet-fold-gesture.d.ts +57 -0
- package/dist/types/shell/slots.d.ts +16 -0
- package/dist/types/shell/thread-reland.d.ts +22 -0
- package/dist/types/shell/use-dock-state.d.ts +54 -0
- package/dist/types/types/commerce.d.ts +1 -0
- package/dist/types/utils/cn.d.ts +2 -0
- package/dist/types/utils/format-money.d.ts +2 -0
- package/dist/types/utils/html-to-text.d.ts +8 -0
- package/dist/types/utils/sanitize-html.d.ts +12 -0
- package/dist/types/utils/use-backdrop-presence.d.ts +24 -0
- package/dist/types/utils/use-composer-mode.d.ts +26 -0
- package/dist/types/utils/use-is-seed-home.d.ts +13 -0
- package/dist/types/utils/use-safe-cart.d.ts +17 -0
- package/dist/types/utils/use-safe-facts.d.ts +9 -0
- package/dist/types/utils/use-safe-fourty-session.d.ts +15 -0
- package/package.json +80 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { PhaseProgress, PhaseProgressPreview } from '@40rty/ams-sdk';
|
|
3
|
+
/**
|
|
4
|
+
* Headless primitive exposing the agent's live streaming state to brand
|
|
5
|
+
* surfaces. Owns nothing visual — brands compose chrome via the render
|
|
6
|
+
* prop. Wraps the SDK's `currentProgress` channel so every brand reads
|
|
7
|
+
* from the same source of truth, and so future progress kinds (sub-step
|
|
8
|
+
* counters, preview thumbnails, percentage) flow through one boundary.
|
|
9
|
+
*
|
|
10
|
+
* Usage:
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <AgentStreamingState>
|
|
13
|
+
* {(state) =>
|
|
14
|
+
* state.hasProgress
|
|
15
|
+
* ? <MyWhisperLine label={state.label} previews={state.previews} />
|
|
16
|
+
* : null
|
|
17
|
+
* }
|
|
18
|
+
* </AgentStreamingState>
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* Brands stay free to ignore `hasProgress` and render an always-on
|
|
22
|
+
* placeholder, or to render distinct chrome per `phase`. The primitive
|
|
23
|
+
* never decides where on the page it lives.
|
|
24
|
+
*/
|
|
25
|
+
export interface AgentStreamingStateRenderProps {
|
|
26
|
+
/** Latest emitted progress signal, or null between turns. */
|
|
27
|
+
progress: PhaseProgress | null;
|
|
28
|
+
/** SDK-resolved visitor-facing label (agent override > curated map > humanised). `null` when no progress. */
|
|
29
|
+
label: string | null;
|
|
30
|
+
/** Canonical phase name (e.g. 'prompt_assembly'). `null` when no progress. */
|
|
31
|
+
phase: string | null;
|
|
32
|
+
/** Optional longer subline supplied by the agent. */
|
|
33
|
+
description: string | null;
|
|
34
|
+
/** Optional sub-step counter supplied by the agent. */
|
|
35
|
+
count: {
|
|
36
|
+
done: number;
|
|
37
|
+
total?: number;
|
|
38
|
+
} | null;
|
|
39
|
+
/** 0..1 progress when knowable. */
|
|
40
|
+
percent: number | null;
|
|
41
|
+
/** Discriminated preview parts the agent attached this emit. Empty array when none. */
|
|
42
|
+
previews: PhaseProgressPreview[];
|
|
43
|
+
/** True whenever there's a progress signal to display. */
|
|
44
|
+
hasProgress: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Live reasoning/thinking text from the model's thinking phase
|
|
47
|
+
* (Gemini thinking, Anthropic extended-thinking). Empty string when
|
|
48
|
+
* none is streaming. Brand shells can surface this as a "thinking…"
|
|
49
|
+
* whisper while waiting for the first prose token.
|
|
50
|
+
*/
|
|
51
|
+
reasoningText: string;
|
|
52
|
+
/** Convenience flag — `reasoningText.length > 0`. */
|
|
53
|
+
hasReasoning: boolean;
|
|
54
|
+
}
|
|
55
|
+
export interface AgentStreamingStateProps {
|
|
56
|
+
children: (state: AgentStreamingStateRenderProps) => React.ReactNode;
|
|
57
|
+
}
|
|
58
|
+
export declare function AgentStreamingState({ children }: AgentStreamingStateProps): React.ReactElement;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface ProseSurfaceProps {
|
|
3
|
+
text: string;
|
|
4
|
+
/** Live-turn rendering: repairs incomplete markdown mid-stream (no raw
|
|
5
|
+
* `**`/`*` flashes), fades each word in calmly, and shows a caret. */
|
|
6
|
+
streaming?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* The wrapper class, defaulting to the brand-voice hook `agent-md`.
|
|
9
|
+
*
|
|
10
|
+
* A caller OUTSIDE the spacefront overrides it. `agent-md` colours itself
|
|
11
|
+
* from `--fg1`/`--fg2`, tokens defined only under `.fourty-theme-ui`; render
|
|
12
|
+
* it in the admin console (the session transcript replays agent prose there)
|
|
13
|
+
* and those resolve to nothing, so the ink falls to whatever it inherits.
|
|
14
|
+
* Passing the surface's own type + colour class keeps the markdown structure
|
|
15
|
+
* while reading as that surface rather than as an unstyled brand voice.
|
|
16
|
+
*/
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Prose renderer for agent voice — full streaming markdown via Streamdown
|
|
21
|
+
* (block-memoized rendering, incomplete-marker repair, GFM), with its
|
|
22
|
+
* built-in element styling. Raw model text goes straight in; there is no
|
|
23
|
+
* bespoke pre-parsing here — malformed markdown is a prompt problem, not
|
|
24
|
+
* a client-parser problem. Brands compose this inside their own styled
|
|
25
|
+
* container; the `.agent-md` wrapper carries only voice tokens
|
|
26
|
+
* (font/color), never markdown structure.
|
|
27
|
+
*
|
|
28
|
+
* The Streamdown import is lazy — see the note above. Call sites are
|
|
29
|
+
* unchanged: this stays an ordinary synchronous component.
|
|
30
|
+
*/
|
|
31
|
+
export declare const ProseSurface: React.FC<ProseSurfaceProps>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { AgentStreamingState, type AgentStreamingStateRenderProps, type AgentStreamingStateProps, } from './AgentStreamingState';
|
|
2
|
+
export { ProseSurface, type ProseSurfaceProps } from './ProseSurface';
|
|
3
|
+
export { renderInline } from '@40rty/ams-sdk';
|
|
4
|
+
export { blockifyProse, sanitizeProse } from '../components/agentic/AgentText';
|
|
5
|
+
export { DefaultNotch, PresenceNotch, AgentPresenceWidget, type AgentPresenceWidgetProps, registerDefaultPresenceForms, InlinePresenceRead, LayoutMorphSkeleton, Eyebrow, Rule, Fallback, Thought, Dossier, FoldedRead, BriefHandle, PresenceBriefBody, PresenceBriefDrawer, colorSwatch, readFacts, readLabel, type Fact, presenceClass, useMeasuredHeight, FactChips, useForgetFact, useVisibleFacts, useVisibleFactList, } from './presence';
|
|
6
|
+
export { registerBaselineFactForms, BaselineColorFactForm, BaselineFigureFactForm, factFormClass, } from './presence';
|
|
7
|
+
export { bandRowTemplate, criteriaRailTemplate, criteriaRegionWidth, siftRegionWidth, SIFT_BAND_HEIGHT, CRITERION_SLOT, CRITERION_GAP, CRITERION_TAIL_LANE, VOICE_MIN_WIDTH, PRESENCE_FACT_LIMIT, PRESENCE_DURABLE_SLOTS, } from './presence';
|
|
8
|
+
export { PresenceSourceCard, registerDefaultPresenceSourceForms, BASELINE_SOURCE_KINDS, ProductSourceCard, CollectionSourceCard, ArticleSourceCard, PolicySourceCard, ReviewSourceCard, productSourceForm, collectionSourceForm, articleSourceForm, policySourceForm, reviewSourceForm, SourceCardFrame, SourcePlate, SourceImage, CaptionRule, RuledLines, CornerFold, sourceCardClass, sourceCardBox, sourceCardState, SOURCE_CARD_BOX, platePad, ruleWeight, ink, type RuledLine, type SourceCardState, } from './presence';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PhaseProgress } from '@40rty/ams-sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Resolve a visitor-facing label for a phase_progress event.
|
|
4
|
+
*
|
|
5
|
+
* Resolution order:
|
|
6
|
+
* 1. Explicit `event.label` (agent layer override — preferred path
|
|
7
|
+
* for context-rich labels like "Pulling wedding heels under $200").
|
|
8
|
+
* 2. Curated mapping for the few phases worth a label of their own.
|
|
9
|
+
* 3. null — unmapped phases yield NO label. The caller falls through
|
|
10
|
+
* to richer signals (reasoning beats, visitor echo) or stays
|
|
11
|
+
* silent. Better silence than "Session Resolve" leaking through.
|
|
12
|
+
*/
|
|
13
|
+
export declare function defaultPhaseLabel(progress: PhaseProgress | null): string | null;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type NotchWidgetProps } from '@40rty/ams-sdk';
|
|
3
|
+
import './forms';
|
|
4
|
+
export interface AgentPresenceWidgetProps extends NotchWidgetProps {
|
|
5
|
+
/** Suppress the resting promo line when idle — for a brand whose own trail
|
|
6
|
+
* widget already fills the band at rest. Default false (the fallback shows). */
|
|
7
|
+
suppressIdleFallback?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Brand REST content for the band when presence has NOTHING — e.g. rotating
|
|
10
|
+
* announcements, so the notch doubles as the storefront's top promo bar on a
|
|
11
|
+
* cold visit.
|
|
12
|
+
*
|
|
13
|
+
* "Nothing" means nothing, not "the turn is over". Once the agent knows one
|
|
14
|
+
* thing about this visitor, the brief owns the band and keeps it — promo copy
|
|
15
|
+
* does not come back four seconds after a turn settles, because the surface's
|
|
16
|
+
* whole claim is that what it knows is still there when you look up. This
|
|
17
|
+
* takes precedence over the generic fallback; when omitted, the fallback (or
|
|
18
|
+
* nothing, if suppressed) shows.
|
|
19
|
+
*/
|
|
20
|
+
idleContent?: React.ReactNode;
|
|
21
|
+
/** Don't animate the band height (and skip the ResizeObserver). For a host
|
|
22
|
+
* that already fixes + clips the height (the mobile island) — there the
|
|
23
|
+
* height morph is invisible AND non-composited, so it only burns main-thread
|
|
24
|
+
* layout (measured CLS + jank). The frame still crossfades. Default false. */
|
|
25
|
+
staticBand?: boolean;
|
|
26
|
+
/** Render the held content as CHIPS ONLY — drop the lead line, keep just the
|
|
27
|
+
* knowledge (dossier) chips. The mobile island uses this so the idle read is
|
|
28
|
+
* the standing dossier, not turn narration. The sift is unaffected. */
|
|
29
|
+
chipsOnly?: boolean;
|
|
30
|
+
/** Don't render the HELD content (facts / voice / ask) at all — only the
|
|
31
|
+
* sift. For a host that shows the dossier chips as a SEPARATE persistent
|
|
32
|
+
* element (the mobile island) so the knowledge chips never swap with the
|
|
33
|
+
* sift. */
|
|
34
|
+
hideHeld?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* THE band height — one strip, every state.
|
|
38
|
+
*
|
|
39
|
+
* ONE ROW: the compact source card plus breathing room, which is also what a
|
|
40
|
+
* line of dossier chips and the voice's own line need. The read lays out
|
|
41
|
+
* HORIZONTALLY (see `StreamRead`) — criteria, then sentence, then deck — so a
|
|
42
|
+
* strip this tall holds every state without shearing any of them.
|
|
43
|
+
*
|
|
44
|
+
* DERIVED FROM THE TALLEST THING ON THE ROW rather than written down beside it.
|
|
45
|
+
* The two disagreed: this strip stayed 44px while the read above it stacked a
|
|
46
|
+
* 24px sentence and a 10px gap on top of the 40px deck, so 74px of content was
|
|
47
|
+
* clipped to 44 and every card on the row was sheared for the whole turn. A
|
|
48
|
+
* height stated independently of its content is a height that can be wrong about
|
|
49
|
+
* it; taking the card's own box means the band can never open shorter than what
|
|
50
|
+
* it holds.
|
|
51
|
+
*
|
|
52
|
+
* Still a constant, not a measurement: a measured height is a height that can
|
|
53
|
+
* change, and the whole point here is that it cannot. What does not fit on the
|
|
54
|
+
* row is not squeezed in — it lives behind the expand handle, which is what that
|
|
55
|
+
* handle is for.
|
|
56
|
+
*/
|
|
57
|
+
export { BAND_HEIGHT as COMPACT_BAND_HEIGHT } from './band-row';
|
|
58
|
+
/**
|
|
59
|
+
* The notch's default LEAD widget — the agent's PRESENCE, rendered from the
|
|
60
|
+
* ELEMENT STREAM.
|
|
61
|
+
*
|
|
62
|
+
* Presence is not a narration of a turn. It is a typed, additive stream of
|
|
63
|
+
* elements, each with declared provenance and a causal lifecycle. So this
|
|
64
|
+
* widget has NO precedence ladder: it draws every bucket the stream holds, at
|
|
65
|
+
* once. Sources and facts COEXIST — you watch a belief crystallize out of the
|
|
66
|
+
* reviews that produced it, which is the understanding visualization the old
|
|
67
|
+
* single-frame notch made structurally unrepresentable.
|
|
68
|
+
*
|
|
69
|
+
* Three consequences worth stating, because each replaces something deleted:
|
|
70
|
+
*
|
|
71
|
+
* · SILENCE IS CORRECT. An empty stream renders nothing. A clear ask with a
|
|
72
|
+
* clean find, nothing inferred and nothing conceded, is a turn presence has
|
|
73
|
+
* no business commenting on. Rarity buys attention; the three pulsing dots
|
|
74
|
+
* that used to fill this gap carried zero bits.
|
|
75
|
+
* · NOTHING IS SCHEDULED. Elements retire causally (a card leaves when its
|
|
76
|
+
* entity lands on the canvas) — there is no dwell timer mediating display,
|
|
77
|
+
* so the read never lags behind what the agent actually knows.
|
|
78
|
+
* · THE VOICE IS CONFIGURED. At `voice: 'off'` the stream carries no voice
|
|
79
|
+
* element and this renders no prose AT ALL — it does not fall back to other
|
|
80
|
+
* text. The default profile is 'terse' (one lead line), because presence
|
|
81
|
+
* explains THE SEARCH while it is running and compose explains THE ANSWER
|
|
82
|
+
* once it exists; an empty band through a long think reads as broken, not
|
|
83
|
+
* as calm.
|
|
84
|
+
*/
|
|
85
|
+
export declare function AgentPresenceWidget({ expanded, drawer, suppressIdleFallback, staticBand, chipsOnly, hideHeld, idleContent, }: AgentPresenceWidgetProps): React.ReactElement;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The brief's identity line.
|
|
4
|
+
*
|
|
5
|
+
* Renders the greeting when a name is known and the invitation when it is not —
|
|
6
|
+
* and it is always ONE row in the same place, so learning the visitor's name
|
|
7
|
+
* changes what the line says rather than whether the panel has a head.
|
|
8
|
+
*/
|
|
9
|
+
export declare function BriefIdentity(): React.ReactElement;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { PresenceSourceElement } from '@40rty/ams-sdk';
|
|
3
|
+
import { type Fact } from './read-data';
|
|
4
|
+
import type { SlottedFact } from './fact-slots';
|
|
5
|
+
/**
|
|
6
|
+
* CompactStream — the mobile island's face for the ELEMENT STREAM. The desktop
|
|
7
|
+
* band lays the lead, the criteria and the candidate deck on one wide row; on
|
|
8
|
+
* the slim island they stack: the lead line, then the deck, then the criteria.
|
|
9
|
+
*
|
|
10
|
+
* The DECK LEADS THE CRITERIA here, which is the reverse of the desktop order,
|
|
11
|
+
* and deliberately: stacked vertically there is no "applied to" reading to
|
|
12
|
+
* preserve — the two are simply two rows — and the deck is the thing worth the
|
|
13
|
+
* island's best line. The criteria rail below it scrolls horizontally.
|
|
14
|
+
*
|
|
15
|
+
* Every bucket is independent — the deck shows WITH the chips rather than
|
|
16
|
+
* instead of them, which is the coexistence the old single-frame notch could not
|
|
17
|
+
* express. Any empty bucket contributes nothing.
|
|
18
|
+
*/
|
|
19
|
+
export declare function CompactStream({ lead, sources, materialized, facts, hiddenFacts, chipsOnly, }: {
|
|
20
|
+
lead: string;
|
|
21
|
+
sources: readonly PresenceSourceElement[];
|
|
22
|
+
materialized: ReadonlySet<string>;
|
|
23
|
+
/** Already ranked, capped AND PLACED by the widget — the same slotted list the
|
|
24
|
+
* desktop rail draws (`fact-slots.ts`), so a chip holds the same slot and the
|
|
25
|
+
* same lifetime on the phone as it does on the band. */
|
|
26
|
+
facts: readonly SlottedFact[];
|
|
27
|
+
/** Constraints held but not drawn, as a `+N` tail. */
|
|
28
|
+
hiddenFacts?: number;
|
|
29
|
+
chipsOnly?: boolean;
|
|
30
|
+
}): React.ReactElement;
|
|
31
|
+
/**
|
|
32
|
+
* FactChips — the editable knowledge (dossier) chips, standalone so a host can
|
|
33
|
+
* render them SEPARATELY from the sift (they are different concerns and must not
|
|
34
|
+
* swap for the same slot). Each chip's × forgets the fact (the dismiss signal +
|
|
35
|
+
* optimistic hide). Renders nothing when there are none.
|
|
36
|
+
*/
|
|
37
|
+
export declare function FactChips({ facts, more, }: {
|
|
38
|
+
/** Already ORDERED by the caller — the band's slot order on the island's
|
|
39
|
+
* notch, first-seen order on the uncapped brief rail. This renders what it
|
|
40
|
+
* is handed; a second ordering rule here is how two surfaces that read one
|
|
41
|
+
* projection end up showing two different rows. */
|
|
42
|
+
facts: readonly Fact[];
|
|
43
|
+
more?: number;
|
|
44
|
+
}): React.ReactElement | null;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/** How long an outgoing criterion takes to clear its cell. */
|
|
3
|
+
export declare const CRITERION_EXIT_S = 0.16;
|
|
4
|
+
import { type Fact } from './read-data';
|
|
5
|
+
import type { SlottedFact } from './fact-slots';
|
|
6
|
+
/**
|
|
7
|
+
* One criterion as it appears beside the deck. READ-ONLY, always — no dismiss ×,
|
|
8
|
+
* at rest or in flight.
|
|
9
|
+
*
|
|
10
|
+
* Editing controls are noise at glance distance: the band is read across a
|
|
11
|
+
* storefront header in half a second, and a row of × targets turns three facts
|
|
12
|
+
* into six things to parse. The edit surface is the BRIEF (`PresenceBrief`),
|
|
13
|
+
* which is opened deliberately and has room to be deliberate in. What the chip
|
|
14
|
+
* carries instead is a way IN: clicking any criterion opens the brief, so the
|
|
15
|
+
* thing you reached for is one target away from where you reached.
|
|
16
|
+
*
|
|
17
|
+
* It arrives by DRAWING ITS OWN RULE — a hairline under the label and value,
|
|
18
|
+
* struck left to right in 340ms as the chip fades up. A belief forming is a
|
|
19
|
+
* decision, so it is one of the few things on this surface allowed to move.
|
|
20
|
+
*
|
|
21
|
+
* BOUNDED BY ITS SLOT, which is the track it is placed in — not a width it
|
|
22
|
+
* carries. Past the slot the label and the value ellipsize and the brief holds
|
|
23
|
+
* them whole, the same trade the one-line voice makes against the canvas prose.
|
|
24
|
+
*/
|
|
25
|
+
export declare const Criterion: React.ForwardRefExoticComponent<{
|
|
26
|
+
fact: Fact;
|
|
27
|
+
/** 1-based grid column — the slot this criterion stands in. NAMED, never left
|
|
28
|
+
* to auto-placement: an exiting chip holds its cell for the length of its
|
|
29
|
+
* fade, and auto-placement answered that by putting the chip replacing it in
|
|
30
|
+
* an implicit FOURTH column — measured live, half a chip hanging past the
|
|
31
|
+
* rail's reservation for 340ms on every substitution. */
|
|
32
|
+
slot: number;
|
|
33
|
+
onOpenBrief: (() => void) | undefined;
|
|
34
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
35
|
+
/**
|
|
36
|
+
* The rail as the band's LEFT TRACK — always drawn, one slot per criterion.
|
|
37
|
+
*
|
|
38
|
+
* `popLayout` so an outgoing criterion leaves the flow and fades WHERE IT STOOD
|
|
39
|
+
* rather than shunting its neighbours: a turn that replaces all three would
|
|
40
|
+
* otherwise put six chips on a rail sized for three for the length of the
|
|
41
|
+
* crossfade. Substitution in place, never a positional FLIP — the chips carry no
|
|
42
|
+
* `layout`, so a chip that stays never travels because a chip beside it changed.
|
|
43
|
+
*/
|
|
44
|
+
export declare function CriteriaRail({ facts, slots, hidden, brief, onOpenBrief, }: {
|
|
45
|
+
/** How many slots the rail lays out — the highest one in use, HELD through a
|
|
46
|
+
* departing chip's exit so the template never shrinks under it (see
|
|
47
|
+
* `useHeldSlotCount`). Passed in rather than derived here, because the row's
|
|
48
|
+
* own track is sized from the same number and two derivations of one
|
|
49
|
+
* reservation is how a rail and its track drift apart. */
|
|
50
|
+
slots: number;
|
|
51
|
+
/** The criteria, each PLACED in the slot it holds (`fact-slots.ts`) — already
|
|
52
|
+
* ranked, de-duplicated and capped upstream (`fact-rail.ts`). Nothing here
|
|
53
|
+
* re-sorts or re-places it: a second ordering rule at the render site is how
|
|
54
|
+
* the surface ends up showing a different three than the projection chose,
|
|
55
|
+
* and a second placement rule is how a chip ends up travelling. */
|
|
56
|
+
facts: readonly SlottedFact[];
|
|
57
|
+
/** How many constraints are held but have no slot — the `+N`. */
|
|
58
|
+
hidden: number;
|
|
59
|
+
/** The brief's open state + toggle, when the host has a drawer. The handle
|
|
60
|
+
* stands in the rail's LAST LANE — beside the chips it opens, in the flow,
|
|
61
|
+
* reserved. It was absolutely positioned at the band's right edge, ~1400px
|
|
62
|
+
* away from them and floating over the deck. */
|
|
63
|
+
brief: {
|
|
64
|
+
open: boolean;
|
|
65
|
+
toggle: () => void;
|
|
66
|
+
} | undefined;
|
|
67
|
+
onOpenBrief: (() => void) | undefined;
|
|
68
|
+
}): React.ReactElement;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { Fact } from './read-data';
|
|
3
|
+
export declare function FactChip({ fact, onForget }: {
|
|
4
|
+
fact: Fact;
|
|
5
|
+
onForget: (f: Fact) => void;
|
|
6
|
+
}): React.ReactElement;
|
|
7
|
+
/** Profile (durable) facts lead, session notes follow — long-term
|
|
8
|
+
* understanding is the anchor the per-focus notes hang off. Stable
|
|
9
|
+
* within each tier (no re-sorting churn between reads). */
|
|
10
|
+
export declare function sortFactsByTier(facts: Fact[]): Fact[];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The inline continuation presence — the loading foot shown the INSTANT the extend
|
|
4
|
+
* lane is live, and never blank. ONE moment:
|
|
5
|
+
*
|
|
6
|
+
* · COMPOSING — the layout ENGINE assembling a layout: frosted tiles morphing
|
|
7
|
+
* through layout archetypes (`LayoutMorphSkeleton`) over a single centred status
|
|
8
|
+
* line — the agent's live read when one is streaming, else the archetype label
|
|
9
|
+
* naming the shape currently forming. This is the product thesis rendered as
|
|
10
|
+
* the loader.
|
|
11
|
+
*
|
|
12
|
+
* The status text is the agent's OWN read (never hardcoded narration); the archetype
|
|
13
|
+
* label is only a graceful floor when there's no live reasoning to latch, and it
|
|
14
|
+
* names the visible morph, so it stays ambient truth about the compose. The status
|
|
15
|
+
* line swaps on the calm opacity crossfade (the shared `enter`) — same choreography
|
|
16
|
+
* as every other presence read swap, no per-character typewriter.
|
|
17
|
+
*
|
|
18
|
+
* Flow-scoped (`useAgentPresence(flowId)`); omit `flowId` to read the foreground
|
|
19
|
+
* presence flow (the boot loader). Gated `fresh` so a frame restored from a
|
|
20
|
+
* prior load never surfaces.
|
|
21
|
+
*/
|
|
22
|
+
export declare function InlinePresenceRead({ flowId, compact, }: {
|
|
23
|
+
flowId?: string;
|
|
24
|
+
compact?: boolean;
|
|
25
|
+
}): React.ReactElement;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The resting island's KNOWLEDGE RAIL — the mobile brief.
|
|
4
|
+
*
|
|
5
|
+
* It used to be a PEEK: the chips appeared for 4.2 seconds after a turn settled
|
|
6
|
+
* and folded themselves away, on the reasoning that a permanent rail would read
|
|
7
|
+
* as chrome. That inverted the point of the surface. "I know these things about
|
|
8
|
+
* you" is only worth saying if it is still there when the visitor looks up, and
|
|
9
|
+
* a claim that erases itself four seconds later is worse than one never made —
|
|
10
|
+
* the visitor sees the agent forget them, on a timer.
|
|
11
|
+
*
|
|
12
|
+
* So it stands. One row, horizontally scrollable, every constraint the agent
|
|
13
|
+
* holds and each one dismissible: on mobile there is no drawer to put the full
|
|
14
|
+
* brief in, so this row IS the brief rather than a capped preview of one. It is
|
|
15
|
+
* uncapped for exactly that reason — a `+N` here would name constraints with
|
|
16
|
+
* nowhere to go.
|
|
17
|
+
*
|
|
18
|
+
* Sourced from the ELEMENT STREAM (not the frame) so it survives a reload the
|
|
19
|
+
* same way the desktop band does — the whole surface reads from one projection.
|
|
20
|
+
* Renders nothing when the agent knows nothing, which is the cold-visit state
|
|
21
|
+
* and correctly costs the island no height at all.
|
|
22
|
+
*/
|
|
23
|
+
export declare function PresenceBriefRail(): React.ReactElement | null;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The continuation composing preview — a miniature of the layout ENGINE at work:
|
|
4
|
+
* a small set of frosted tiles that split, collapse and regroup through the layout
|
|
5
|
+
* archetypes a real view is built from (a single panel → columns → a grid → a
|
|
6
|
+
* header + split → a sidebar). It replaces the old product-card skeleton, which
|
|
7
|
+
* presupposed the next thing was a product grid; the morph is archetype-neutral
|
|
8
|
+
* and renders the product thesis itself — "your layout is being assembled" — while
|
|
9
|
+
* the extend composes.
|
|
10
|
+
*
|
|
11
|
+
* Purely presentational: driven by `rects` (the geometry of the archetype currently
|
|
12
|
+
* showing). The parent owns the cadence via `useLayoutMorph` so the status line's
|
|
13
|
+
* fallback label can name the SAME shape the tiles are forming. Six tile slots are
|
|
14
|
+
* always mounted; a slot with no rect collapses to the centre at opacity 0, and the
|
|
15
|
+
* CSS transition on each tile animates the morph between archetypes.
|
|
16
|
+
*/
|
|
17
|
+
/** One tile's geometry, as percentages of the morph box. */
|
|
18
|
+
export interface MorphRect {
|
|
19
|
+
l: number;
|
|
20
|
+
t: number;
|
|
21
|
+
w: number;
|
|
22
|
+
h: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A layout archetype: the tiles that make it up.
|
|
26
|
+
*
|
|
27
|
+
* GEOMETRY ONLY. It used to carry its own `label` — 'Arranging the columns',
|
|
28
|
+
* 'Placing the header', 'Docking the sidebar' — which is the layout engine's
|
|
29
|
+
* parts list narrated to a shopper, hard-coded in shared infra where no brand
|
|
30
|
+
* could touch it. The phrases live in the `Labels` seam now
|
|
31
|
+
* (`presence.composing`, one per archetype, in this order); the shapes stay
|
|
32
|
+
* here, because a shape is code and a sentence is copy.
|
|
33
|
+
*/
|
|
34
|
+
export interface LayoutArchetype {
|
|
35
|
+
rects: MorphRect[];
|
|
36
|
+
}
|
|
37
|
+
/** The archetypes the preview cycles, in order. Geometry mirrors the layout shapes
|
|
38
|
+
* the canvas actually composes; `Labels.presence.composing` names each one. */
|
|
39
|
+
export declare const LAYOUT_ARCHETYPES: LayoutArchetype[];
|
|
40
|
+
/** How long each archetype is held before the next morph begins. The 1.05s tile
|
|
41
|
+
* transition (base.css) means the shape sits settled for ~2s before it moves
|
|
42
|
+
* again — and, when the status line is showing the archetype label, the label
|
|
43
|
+
* gets a real hold between retypes instead of near-constant churn. */
|
|
44
|
+
export declare const MORPH_MS = 3200;
|
|
45
|
+
/** Advance through the archetypes on a calm cadence. Holds on the first archetype
|
|
46
|
+
* (a single settled panel) under reduced-motion — no cycling, no jump. `active`
|
|
47
|
+
* pauses the advance (e.g. while the scan deck shows real candidates instead),
|
|
48
|
+
* as does a hidden tab — a cycle ticking while hidden falls out of step with its
|
|
49
|
+
* throttled CSS transitions and replays in a burst on refocus. */
|
|
50
|
+
export declare function useLayoutMorph(active: boolean): {
|
|
51
|
+
index: number;
|
|
52
|
+
label: string;
|
|
53
|
+
rects: MorphRect[];
|
|
54
|
+
};
|
|
55
|
+
/** The frosted tiles, morphing to `rects`. Six slots always render; unused slots
|
|
56
|
+
* collapse to the centre at opacity 0 so the count never reflows the DOM. */
|
|
57
|
+
export declare function LayoutMorphSkeleton({ rects }: {
|
|
58
|
+
rects: MorphRect[];
|
|
59
|
+
}): React.ReactElement;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type Fact } from './read-data';
|
|
3
|
+
/**
|
|
4
|
+
* The brief's body. Takes its facts rather than reading them, so the two hosts
|
|
5
|
+
* that draw it — the desktop notch drawer and the mobile island's expanded face
|
|
6
|
+
* — cannot end up showing different sets, and so the mobile host does not have
|
|
7
|
+
* to mount a second copy of the dismissal machinery.
|
|
8
|
+
*
|
|
9
|
+
* Renders nothing when it holds nothing. A cold visit has no brief, and drawing
|
|
10
|
+
* an empty panel with two headers over it would be the surface claiming to know
|
|
11
|
+
* the visitor before it does.
|
|
12
|
+
*/
|
|
13
|
+
export declare function PresenceBriefBody({ facts }: {
|
|
14
|
+
facts: Fact[];
|
|
15
|
+
}): React.ReactElement | null;
|
|
16
|
+
/**
|
|
17
|
+
* The notch DRAWER's content — the brief, dismiss-filtered, uncapped.
|
|
18
|
+
*
|
|
19
|
+
* Mounted by `<PresenceNotch>` in its drawer region, which is a SIBLING of the
|
|
20
|
+
* band rather than a child of it, so it derives its own fact list from the same
|
|
21
|
+
* stream instead of receiving one down a prop it has no path to. The projection
|
|
22
|
+
* is the same pure function the band uses, called with the same live turn — the
|
|
23
|
+
* two surfaces cannot rank or collapse differently — and only the CAP differs,
|
|
24
|
+
* which is the entire point of there being two of them.
|
|
25
|
+
*
|
|
26
|
+
* It uses the dismissal filter WITHOUT the optimistic bridge
|
|
27
|
+
* (`useUndismissedFacts`); see that hook for why two mounted bridges would fight.
|
|
28
|
+
*/
|
|
29
|
+
export declare function PresenceBriefDrawer(): React.ReactElement | null;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* PresenceFiller — the band is working and has nothing to say yet.
|
|
4
|
+
*
|
|
5
|
+
* The band's `working` branch deliberately renders NOTHING when its stream is
|
|
6
|
+
* empty, on the reasoning that a surface with no bits should stay quiet. On a
|
|
7
|
+
* real turn that reads as a stall: measured on Babysense, the strip sat blank
|
|
8
|
+
* for 1.4s after the visitor pressed send, then again for 2.7s and 2.2s before
|
|
9
|
+
* any prose landed.
|
|
10
|
+
*
|
|
11
|
+
* So this fills it, and is honest about being filler: a hairline that travels.
|
|
12
|
+
* It reports no progress and claims no thought — it only says the turn is
|
|
13
|
+
* live. That is a deliberately smaller claim than the rotating sentences and
|
|
14
|
+
* the typewriter that used to live near here (both removed for manufacturing
|
|
15
|
+
* the appearance of advancing thought), and a different one from the three
|
|
16
|
+
* pulsing dots it replaces, which read as a stalled spinner rather than an
|
|
17
|
+
* occupied one.
|
|
18
|
+
*
|
|
19
|
+
* Pure CSS, no timer and no state: the canvas render-isolation work took the
|
|
20
|
+
* whole tree down to near-zero renders per streamed frame, and a JS-driven
|
|
21
|
+
* filler would hand that back a commit at a time. `aria-hidden` because the
|
|
22
|
+
* band is a polite live region and a decorative sweep has nothing to announce.
|
|
23
|
+
*/
|
|
24
|
+
export declare function PresenceFiller(): React.ReactElement;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { PresenceSourceCardSize, PresenceSourceElement } from '@40rty/ams-sdk';
|
|
3
|
+
/**
|
|
4
|
+
* The band's vertical envelope for a sift row — the height the streaming band
|
|
5
|
+
* opens to. Derived from the uniform card box, so the band can never open
|
|
6
|
+
* shorter than a card and shear it, and shrinks automatically if the box does.
|
|
7
|
+
* Single source of truth shared with `AgentPresenceWidget`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const SIFT_BAND_HEIGHT: number;
|
|
10
|
+
/**
|
|
11
|
+
* The band's RESERVED RIGHT-HAND REGION — the gate lane, the deck track and the
|
|
12
|
+
* tail slot, as one fixed width the host stands at the right edge of the row for
|
|
13
|
+
* the whole session.
|
|
14
|
+
*
|
|
15
|
+
* The band used to hold this region only while a turn ran, and put the criteria
|
|
16
|
+
* inside it, so the whole block changed ends of the band when a turn opened and
|
|
17
|
+
* again when it settled — measured at ~1100px of travel, twice a turn, on every
|
|
18
|
+
* element it contained. A region that is always there and always the same width
|
|
19
|
+
* is what makes that traversal not exist rather than merely eased: the deck can
|
|
20
|
+
* appear, fill, prune and retire inside it without one card, chip or hairline
|
|
21
|
+
* outside it moving a pixel.
|
|
22
|
+
*
|
|
23
|
+
* Exported so a brand composing its own band reserves the same box this
|
|
24
|
+
* component fills, rather than deriving a second number that drifts from it.
|
|
25
|
+
*/
|
|
26
|
+
export declare function siftRegionWidth(size: PresenceSourceCardSize): number;
|
|
27
|
+
export declare function SourceSift({ sources, materialized, criteria, size, reserveTrack, }: {
|
|
28
|
+
sources: readonly PresenceSourceElement[];
|
|
29
|
+
/** Entity ids the canvas has placed — which candidates were CHOSEN. */
|
|
30
|
+
materialized: ReadonlySet<string>;
|
|
31
|
+
/** How many criteria the agent has crystallized this turn. Each increment
|
|
32
|
+
* sends one pass across the deck. */
|
|
33
|
+
criteria?: number;
|
|
34
|
+
size?: PresenceSourceCardSize;
|
|
35
|
+
/**
|
|
36
|
+
* RESERVE the whole track before anything lands in it — the host says so,
|
|
37
|
+
* rather than the card size implying it.
|
|
38
|
+
*
|
|
39
|
+
* A track that grows as records arrive drags every card already on it
|
|
40
|
+
* sideways, which is the churn this deck was rebuilt to remove. Whether there
|
|
41
|
+
* is room for an empty reservation is a fact about the HOST, not about the box
|
|
42
|
+
* a card is drawn in: the desktop band stands its deck in a fixed region and
|
|
43
|
+
* reserves; the mobile island is too narrow to hold an empty one and sizes to
|
|
44
|
+
* content. Deriving it from `size` conflated the two the moment the band
|
|
45
|
+
* adopted the island's card box, and the band silently lost its reservation.
|
|
46
|
+
*/
|
|
47
|
+
reserveTrack?: boolean;
|
|
48
|
+
}): React.ReactElement | null;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type SlottedFact } from './fact-slots';
|
|
3
|
+
import type { PresenceStreamView } from './element-view';
|
|
4
|
+
/**
|
|
5
|
+
* WHAT "THE COMPOSITION CHANGED" MEANS for the band.
|
|
6
|
+
*
|
|
7
|
+
* The view is rebuilt on every upstream render, so object identity says nothing
|
|
8
|
+
* — the band would compose itself for a parent re-render. This states the parts
|
|
9
|
+
* the band actually draws: the criteria it is showing, the count behind them,
|
|
10
|
+
* the sentence, and the deck's records and their states. Anything not in here
|
|
11
|
+
* cannot move the band, which is the point.
|
|
12
|
+
*/
|
|
13
|
+
export declare function compositionSignature(view: PresenceStreamView): string;
|
|
14
|
+
/**
|
|
15
|
+
* The agent's question is drawn as plain prose on purpose: the interactive
|
|
16
|
+
* answer path (quick replies, a claimed signal) belongs to the standing-signal
|
|
17
|
+
* `AgentAsk` widget the band renders in the lead zone. Duplicating that chrome
|
|
18
|
+
* here would give the visitor two places to answer one question.
|
|
19
|
+
*/
|
|
20
|
+
export declare function PresenceStream({ view, slotted, materialized, showHeld, working, brief, onOpenBrief, }: {
|
|
21
|
+
view: PresenceStreamView;
|
|
22
|
+
/** The criteria the band draws, each in the slot it holds (`fact-slots.ts`).
|
|
23
|
+
* Placement is decided ONCE, for both faces, in `useBandFacts` — the band and
|
|
24
|
+
* the island cannot disagree about where a chip stands or when it leaves. */
|
|
25
|
+
slotted: readonly SlottedFact[];
|
|
26
|
+
/** Entity ids the canvas has placed this turn — which candidates were chosen. */
|
|
27
|
+
materialized: ReadonlySet<string>;
|
|
28
|
+
/** False when the host renders the held content itself (the mobile island's
|
|
29
|
+
* separate dossier rail) — the sift still shows. */
|
|
30
|
+
showHeld: boolean;
|
|
31
|
+
/** A turn is running. The voice's LINE is then reserved whether or not a
|
|
32
|
+
* sentence has landed yet, so the row beneath it does not move when one does.
|
|
33
|
+
* At rest the line is drawn only when there is something to say. */
|
|
34
|
+
working?: boolean;
|
|
35
|
+
/** The brief's open state + toggle, when the host has a drawer — the rail draws
|
|
36
|
+
* the handle in its own last lane. */
|
|
37
|
+
brief?: {
|
|
38
|
+
open: boolean;
|
|
39
|
+
toggle: () => void;
|
|
40
|
+
} | undefined;
|
|
41
|
+
/** Open the full brief. `undefined` when the host has no surface to open it
|
|
42
|
+
* on — the chips and the `+N` then render as plain text rather than as
|
|
43
|
+
* handles that lead nowhere. */
|
|
44
|
+
onOpenBrief: (() => void) | undefined;
|
|
45
|
+
}): React.ReactElement;
|
|
46
|
+
/** The one line a slim host (the mobile island, the folded pill) shows for a
|
|
47
|
+
* stream — the agent's voice or its question, and nothing invented when it has
|
|
48
|
+
* neither. Exported so a host sizing itself from the line and the host drawing
|
|
49
|
+
* it can never disagree. */
|
|
50
|
+
export declare function streamLeadLine(view: PresenceStreamView): string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface VoiceLineProps {
|
|
3
|
+
/** The sentence. A change re-runs the arrival from the first word. */
|
|
4
|
+
text: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
/** Geometry from the host — the band RESERVES this line's height, so a line
|
|
7
|
+
* mid-arrival cannot be squeezed by the row below it. */
|
|
8
|
+
style?: React.CSSProperties;
|
|
9
|
+
/**
|
|
10
|
+
* Seconds to wait before the first word.
|
|
11
|
+
*
|
|
12
|
+
* The line's PLACE IN THE BAND'S GESTURE, handed down by the host rather than
|
|
13
|
+
* decided here (`bandRegionDelay` — see `band-beat.ts`). The sweep is this
|
|
14
|
+
* component's business; when the sweep starts relative to everything else on
|
|
15
|
+
* the band is the band's.
|
|
16
|
+
*/
|
|
17
|
+
delay?: number;
|
|
18
|
+
}
|
|
19
|
+
export declare function VoiceLine({ text, className, style, delay }: VoiceLineProps): React.ReactElement;
|